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>
22 lines
470 B
Go
22 lines
470 B
Go
// 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
|
|
}
|