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:
29
internal/skills/org/handlers_test.go
Normal file
29
internal/skills/org/handlers_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// internal/skills/org/handlers_test.go
|
||||
package org_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/mathiasbq/supervisor/internal/skills/org"
|
||||
"github.com/mathiasbq/supervisor/internal/tier"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestHandle_Tier_ReturnsTierInfo(t *testing.T) {
|
||||
s := org.New(org.Config{
|
||||
TierFn: func(ctx context.Context) tier.Info {
|
||||
return tier.Info{Tier: tier.LANOnly, Label: "lan-only", ManagedAgents: false}
|
||||
},
|
||||
})
|
||||
out, err := s.Handle(context.Background(), "tier", nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
var info tier.Info
|
||||
require.NoError(t, json.Unmarshal(out, &info))
|
||||
assert.Equal(t, tier.LANOnly, info.Tier)
|
||||
assert.Equal(t, "lan-only", info.Label)
|
||||
assert.False(t, info.ManagedAgents)
|
||||
}
|
||||
Reference in New Issue
Block a user