feat: add tier and session_log MCP tools
Adds two new MCP skill packages:
- internal/skills/org: exposes the tier tool, calling an injected TierFn
for testability; returns current operating tier as structured JSON
- internal/skills/sessionlog: exposes the session_log tool, appending
structured JSONL entries to brain/sessions/{session_id}.jsonl; requires
session_id, wraps internal/session.Append
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
21
internal/skills/org/handlers.go
Normal file
21
internal/skills/org/handlers.go
Normal file
@@ -0,0 +1,21 @@
|
||||
// internal/skills/org/handlers.go
|
||||
package org
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Handle dispatches the tier tool call.
|
||||
func (s *Skill) Handle(ctx context.Context, tool string, args json.RawMessage) (json.RawMessage, error) {
|
||||
if tool != "tier" {
|
||||
return nil, fmt.Errorf("unknown org tool: %s", tool)
|
||||
}
|
||||
info := s.cfg.TierFn(ctx)
|
||||
b, err := json.Marshal(info)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("marshal tier info: %w", err)
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
Reference in New Issue
Block a user