Phase 11, part 1: agents and their keys

Agents are users of kind agent, each given modules to read, or to read
and act on, and the CRM scope. Admins make them under Settings → Agents,
on every edition; keys (sm_…) are shown once and kept as hashes, can
expire, be rotated (the old one works a day) or revoked, and record their
last use. /mcp takes agent keys and offers each agent only the tools its
scopes allow. On the local edition, mcp-token is the key of a built-in
Hermes agent with the CRM and the Market.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 10:26:31 -07:00
co-authored by Claude Opus 5.5
parent da16736fb4
commit da2d56f8d2
19 changed files with 1323 additions and 138 deletions
+4 -1
View File
@@ -54,9 +54,12 @@ func newTestServer(t *testing.T, c *core.Core) (*Server, http.Handler) {
s := &Server{
DB: d, Secrets: sec, Core: c, DataDir: dir,
PublicURL: "http://localhost:8470", Version: "test", MCPToken: testToken,
MCP: mcpserver.Handler(d, testToken, "test"),
Log: slog.New(slog.NewTextHandler(io.Discard, nil)),
}
s.MCP = mcpserver.Handler(d, "test", s.AgentAuth)
if err := s.EnsureHermes(testToken); err != nil {
t.Fatal(err)
}
h, err := s.Handler()
if err != nil {
t.Fatal(err)