Events carry what happened and no secret; tokens travel on requests (design 32 §10). The manager's licence.rotated/switched events make the module ask anthropic-licence-manager.current; at start it asks once to catch up. A refresh token appearing in the credentials file is a login: it is pushed to the manager's adopt at once, sealed to the manager's key — the one time a refresh token travels. A switch replaces the old licence's grant whole, removes the API key and its helper, and rewrites oauthAccount in ~/.claude.json. New tools register and unregister MCP servers on this node, or with nodes: all / a list via an mcp.registered event every node consumes; called for one node, the answer names the other nodes running claude-code. 26 tests.
97 lines
2.2 KiB
JSON
97 lines
2.2 KiB
JSON
{
|
|
"module": "claude-code",
|
|
"version": "1",
|
|
"slug": "agent",
|
|
"capabilities": [
|
|
"package-manager"
|
|
],
|
|
"requires": [
|
|
"mcp-endpoint"
|
|
],
|
|
"binds": {
|
|
"mcp-endpoint": "${dir:state}/mcp-endpoint.json"
|
|
},
|
|
"emits": [
|
|
"mcp.registered",
|
|
"mcp.unregistered"
|
|
],
|
|
"consumes": [
|
|
"claude-code.mcp.registered",
|
|
"claude-code.mcp.unregistered",
|
|
"claude-licence-manager.licence.rotated",
|
|
"claude-licence-manager.licence.switched"
|
|
],
|
|
"uses": [
|
|
"anthropic-licence-manager"
|
|
],
|
|
"tools": [
|
|
"claude_code_status",
|
|
"claude_code_render",
|
|
"claude_code_pull",
|
|
"claude_code_mcp_list",
|
|
"claude_code_mcp_register",
|
|
"claude_code_mcp_unregister"
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "package",
|
|
"type": "package",
|
|
"package": "claude-code"
|
|
},
|
|
{
|
|
"id": "managed",
|
|
"type": "directory",
|
|
"path": "/etc/claude-code",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "agent-home",
|
|
"type": "directory",
|
|
"path": "${machine:account-home}/.claude",
|
|
"mode": "0700",
|
|
"owner": "${machine:account}"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "${machine:account}",
|
|
"place": "."
|
|
},
|
|
{
|
|
"id": "facts",
|
|
"type": "file",
|
|
"path": "${dir:state}/facts.json",
|
|
"mode": "0600",
|
|
"owner": "${machine:account}",
|
|
"content": "{\n \"node\": \"${machine:name}\",\n \"console\": \"http://127.0.0.1:${bound:mcp-endpoint:port}/mcp\"\n}\n"
|
|
},
|
|
{
|
|
"id": "settings",
|
|
"type": "file",
|
|
"path": "${dir:state}/settings.json",
|
|
"mode": "0600",
|
|
"owner": "${machine:account}",
|
|
"merge": "json",
|
|
"content": "{\n \"role\": \"\",\n \"mcp_servers\": {}\n}\n"
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "tools",
|
|
"kind": "bundle",
|
|
"language": "typescript",
|
|
"entrypoints": [
|
|
"tools/index.js"
|
|
],
|
|
"env": {
|
|
"MESH_CLAUDE_CODE_STATE": "${dir:state}",
|
|
"MESH_CLAUDE_CODE_FACTS": "${dir:state}/facts.json",
|
|
"MESH_CLAUDE_CODE_SETTINGS": "${dir:state}/settings.json"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|