feat(relay): expand to dev-c role + python/ts MCP fallback shims
queue.ts and server.ts now know about dev-c alongside pm/dev-a/dev-b so the four-role coordination paradigm works end-to-end. start.sh opens a fourth window for dev-c. call.py and call.ts are HTTP shims that agents can use when the MCP relay tools aren't registered in their session (the kickoff prompts reference call.py by path as a fallback). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
25
tools/relay/call.ts
Normal file
25
tools/relay/call.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* CLI shim: call a relay MCP tool from bash.
|
||||
* Usage:
|
||||
* npx tsx call.ts read_messages '{"for":"pm"}'
|
||||
* npx tsx call.ts post_message '{"from":"pm","to":"dev-a","kind":"directive","body":"..."}'
|
||||
* npx tsx call.ts list_pending '{"for":"pm"}'
|
||||
*/
|
||||
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
||||
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
||||
|
||||
const [, , toolName, argsJson] = process.argv;
|
||||
if (!toolName) {
|
||||
console.error("Usage: call.ts <tool_name> <args_json>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const args = argsJson ? JSON.parse(argsJson) : {};
|
||||
const url = new URL("http://localhost:7331/sse");
|
||||
const transport = new SSEClientTransport(url);
|
||||
const client = new Client({ name: "relay-cli", version: "0.1.0" }, { capabilities: {} });
|
||||
|
||||
await client.connect(transport);
|
||||
const result = await client.callTool({ name: toolName, arguments: args });
|
||||
console.log(JSON.stringify(result));
|
||||
await client.close();
|
||||
Reference in New Issue
Block a user