cc-claw 0.14.4 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -527,155 +527,10 @@ if (!IS_SUB_AGENT) {
527
527
  }
528
528
  );
529
529
  }
530
- function deprecationWarning(oldName, newTool, action) {
531
- console.error(`[cc-claw-mcp] DEPRECATED: ${oldName} \u2192 use ${newTool}(action: '${action}')`);
532
- }
533
- if (!IS_SUB_AGENT) {
534
- server.tool("spawn_agent", "DEPRECATED \u2014 use cc_claw_agents(action: 'spawn')", {
535
- runner: z.string(),
536
- task: z.string(),
537
- name: z.string().optional(),
538
- description: z.string().optional(),
539
- model: z.string().optional(),
540
- skills: z.array(z.string()).optional(),
541
- permMode: z.string().optional(),
542
- role: z.string().optional(),
543
- persona: z.string().optional(),
544
- allowedTools: z.array(z.string()).optional(),
545
- maxRuntimeMs: z.number().optional(),
546
- summarizeResult: z.boolean().optional(),
547
- mcps: z.array(z.string()).optional(),
548
- cwd: z.string().optional(),
549
- template: z.string().optional()
550
- }, async (params) => {
551
- deprecationWarning("spawn_agent", "cc_claw_agents", "spawn");
552
- try {
553
- const result = await callApi("/api/orchestrator/spawn", { chatId: CHAT_ID, ...params });
554
- const status = result.queued ? "queued (at capacity)" : "spawning";
555
- return ok(`Agent ${result.agentId} \u2014 ${status}`);
556
- } catch (err) {
557
- return fail(`spawn_agent failed: ${err instanceof Error ? err.message : String(err)}`);
558
- }
559
- });
560
- server.tool("list_templates", "DEPRECATED \u2014 use cc_claw_agents(action: 'templates')", {}, async () => {
561
- deprecationWarning("list_templates", "cc_claw_agents", "templates");
562
- const templates = await callApi("/api/orchestrator/list-templates");
563
- if (!templates.length) return ok("No agent templates found.");
564
- return ok(templates.map((t) => `\u2022 ${t.name}${t.description ? ` \u2014 ${t.description}` : ""}`).join("\n"));
565
- });
566
- server.tool("cancel_agent", "DEPRECATED \u2014 use cc_claw_agents(action: 'cancel')", {
567
- agentId: z.string(),
568
- reason: z.string().optional()
569
- }, async ({ agentId, reason }) => {
570
- deprecationWarning("cancel_agent", "cc_claw_agents", "cancel");
571
- const result = await callApi("/api/orchestrator/cancel", { agentId, reason });
572
- return ok(result.success ? `Agent ${agentId} cancelled.` : `Agent ${agentId} not found.`);
573
- });
574
- server.tool("create_task", "DEPRECATED \u2014 use cc_claw_tasks(action: 'create')", {
575
- subject: z.string(),
576
- description: z.string(),
577
- assignee: z.string().optional(),
578
- blockedBy: z.array(z.number()).optional()
579
- }, async (params) => {
580
- deprecationWarning("create_task", "cc_claw_tasks", "create");
581
- const result = await callApi("/api/orchestrator/create-task", { chatId: CHAT_ID, task: { ...params, createdBy: AGENT_ID } });
582
- return ok(`Task #${result.taskId} created.`);
583
- });
584
- }
585
- server.tool("list_agents", "DEPRECATED \u2014 use cc_claw_agents(action: 'list')", {}, async () => {
586
- deprecationWarning("list_agents", "cc_claw_agents", "list");
587
- const agents = await callApi("/api/agents");
588
- if (!agents.length) return ok("No active agents.");
589
- return ok(agents.map((a) => `\u2022 ${a.name ?? a.id.slice(0, 8)} (${a.runnerId}) \u2014 ${a.status}`).join("\n"));
590
- });
591
- server.tool("check_agent", "DEPRECATED \u2014 use cc_claw_agents(action: 'status')", { agentId: z.string() }, async ({ agentId }) => {
592
- deprecationWarning("check_agent", "cc_claw_agents", "status");
593
- const agent = await callApi("/api/orchestrator/check-agent", { agentId });
594
- if (!agent) return ok(`Agent ${agentId} not found.`);
595
- return ok(`${agent.name ?? agent.id.slice(0, 8)} \u2014 ${agent.status}`);
596
- });
597
- server.tool("list_tasks", "DEPRECATED \u2014 use cc_claw_tasks(action: 'list')", {}, async () => {
598
- deprecationWarning("list_tasks", "cc_claw_tasks", "list");
599
- const tasks = await callApi("/api/tasks");
600
- if (!tasks.length) return ok("No tasks.");
601
- return ok(tasks.map((t) => `#${t.id} [${t.status}] ${t.subject}`).join("\n"));
602
- });
603
- server.tool("update_task", "DEPRECATED \u2014 use cc_claw_tasks(action: 'update')", {
604
- taskId: z.number(),
605
- status: z.enum(["pending", "in_progress", "completed", "failed", "abandoned"]),
606
- result: z.string().optional()
607
- }, async ({ taskId, status, result }) => {
608
- deprecationWarning("update_task", "cc_claw_tasks", "update");
609
- await callApi("/api/orchestrator/update-task", { taskId, status, result });
610
- return ok(`Task #${taskId} \u2192 ${status}`);
611
- });
612
- server.tool("send_message", "DEPRECATED \u2014 use cc_claw_comms(action: 'send')", {
613
- toAgentId: z.string(),
614
- content: z.string(),
615
- messageType: z.enum(["task_result", "question", "status_update", "direct_message"]).optional()
616
- }, async ({ toAgentId, content, messageType }) => {
617
- deprecationWarning("send_message", "cc_claw_comms", "send");
618
- await callApi("/api/orchestrator/send-message", { chatId: CHAT_ID, message: { toAgentId, fromAgentId: AGENT_ID, messageType: messageType ?? "direct_message", content } });
619
- return ok(`Message sent to ${toAgentId}.`);
620
- });
621
- server.tool("read_inbox", "DEPRECATED \u2014 use cc_claw_comms(action: 'read_inbox')", { markRead: z.boolean().optional() }, async ({ markRead }) => {
622
- deprecationWarning("read_inbox", "cc_claw_comms", "read_inbox");
623
- const messages = await callApi("/api/orchestrator/read-inbox", { chatId: CHAT_ID, agentId: AGENT_ID, markRead: markRead ?? false });
624
- if (!messages.length) return ok("No new messages.");
625
- return ok(messages.map((m) => `[${m.messageType}] from ${m.fromAgentId.slice(0, 8)}: ${m.content.slice(0, 500)}`).join("\n\n"));
626
- });
627
- server.tool("set_state", "DEPRECATED \u2014 use cc_claw_comms(action: 'set_state')", { key: z.string(), value: z.string() }, async ({ key, value }) => {
628
- deprecationWarning("set_state", "cc_claw_comms", "set_state");
629
- await callApi("/api/orchestrator/set-state", { chatId: CHAT_ID, key, value, setBy: AGENT_ID });
630
- return ok(`State '${key}' set.`);
631
- });
632
- server.tool("get_state", "DEPRECATED \u2014 use cc_claw_comms(action: 'get_state')", { key: z.string() }, async ({ key }) => {
633
- deprecationWarning("get_state", "cc_claw_comms", "get_state");
634
- const entry = await callApi("/api/orchestrator/get-state", { chatId: CHAT_ID, key });
635
- if (!entry) return ok(`State '${key}' not set.`);
636
- return ok(`${key} = ${entry.value} (set by ${entry.setBy})`);
637
- });
638
- server.tool("list_state", "DEPRECATED \u2014 use cc_claw_comms(action: 'list_state')", {}, async () => {
639
- deprecationWarning("list_state", "cc_claw_comms", "list_state");
640
- const entries = await callApi("/api/orchestrator/list-state", { chatId: CHAT_ID });
641
- if (!entries.length) return ok("Whiteboard is empty.");
642
- return ok(entries.map((e) => `${e.setBy}: ${e.key} = ${e.value}`).join("\n"));
643
- });
644
- server.tool("broadcast", "DEPRECATED \u2014 use cc_claw_comms(action: 'broadcast')", {
645
- content: z.string(),
646
- messageType: z.enum(["status_update", "direct_message"]).optional()
647
- }, async ({ content, messageType }) => {
648
- deprecationWarning("broadcast", "cc_claw_comms", "broadcast");
649
- const result = await callApi("/api/orchestrator/broadcast", { chatId: CHAT_ID, fromAgentId: AGENT_ID, content, messageType: messageType ?? "direct_message" });
650
- return ok(`Broadcast sent to ${result.sent} agent(s).`);
651
- });
652
- server.tool("report_progress", "DEPRECATED \u2014 use cc_claw_comms(action: 'report_progress')", {
653
- status: z.string(),
654
- detail: z.string().optional()
655
- }, async ({ status, detail }) => {
656
- deprecationWarning("report_progress", "cc_claw_comms", "report_progress");
657
- const shortId = AGENT_ID.slice(0, 8);
658
- await callApi("/api/orchestrator/set-state", { chatId: CHAT_ID, key: `progress:${shortId}`, value: JSON.stringify({ status, detail, timestamp: (/* @__PURE__ */ new Date()).toISOString() }), setBy: AGENT_ID });
659
- if (IS_SUB_AGENT) {
660
- await callApi("/api/orchestrator/send-message", { chatId: CHAT_ID, message: { toAgentId: "main", fromAgentId: AGENT_ID, messageType: "status_update", content: `Progress: ${status}${detail ? ` \u2014 ${detail}` : ""}` } });
661
- }
662
- return ok(`Progress reported: ${status}`);
663
- });
664
- server.tool("list_runners", "DEPRECATED \u2014 use cc_claw_agents(action: 'runners')", {}, async () => {
665
- deprecationWarning("list_runners", "cc_claw_agents", "runners");
666
- const runners = await callApi("/api/orchestrator/list-runners");
667
- return ok(runners.map((r) => `\u2022 ${r.id} (${r.displayName}) \u2014 ${r.capabilities.specialties.join(", ")}`).join("\n"));
668
- });
669
- server.tool("list_mcps", "DEPRECATED \u2014 use cc_claw_agents(action: 'mcps')", {}, async () => {
670
- deprecationWarning("list_mcps", "cc_claw_agents", "mcps");
671
- const mcps = await callApi("/api/orchestrator/list-mcps");
672
- if (!mcps.length) return ok("No MCP servers registered.");
673
- return ok(mcps.map((m) => `\u2022 ${m.name} (${m.transport})${m.description ? ` \u2014 ${m.description}` : ""}`).join("\n"));
674
- });
675
530
  async function main() {
676
531
  const transport = new StdioServerTransport();
677
532
  await server.connect(transport);
678
- console.error(`[cc-claw-mcp] Server v2.0 running on stdio (chatId=${CHAT_ID}, agentId=${AGENT_ID}, tools=5+${IS_SUB_AGENT ? 13 : 17} deprecated)`);
533
+ console.error(`[cc-claw-mcp] Server v2.1 running on stdio (chatId=${CHAT_ID}, agentId=${AGENT_ID}, subAgent=${IS_SUB_AGENT})`);
679
534
  }
680
535
  main().catch((err) => {
681
536
  console.error("[cc-claw-mcp] Fatal error:", err);