@desplega.ai/agent-swarm 1.77.0 → 1.77.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/agent-swarm",
3
- "version": "1.77.0",
3
+ "version": "1.77.1",
4
4
  "description": "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
5
5
  "license": "MIT",
6
6
  "author": "desplega.sh <contact@desplega.sh>",
@@ -415,13 +415,19 @@ export function humanizeToolName(name: string): string {
415
415
  export function toolCallToProgress(toolName: string, args: unknown): string | null {
416
416
  if (SKIP_PROGRESS_TOOLS.has(toolName)) return null;
417
417
 
418
+ const a = args as Record<string, unknown>;
419
+ const maybeMcpServer = typeof a?.server === "string" ? a.server : undefined;
420
+ const maybeMcpTool = typeof a?.tool === "string" ? a.tool : undefined;
421
+ const effectiveToolName =
422
+ maybeMcpServer && maybeMcpTool ? `mcp__${maybeMcpServer}__${maybeMcpTool}` : toolName;
423
+ if (SKIP_PROGRESS_TOOLS.has(effectiveToolName)) return null;
424
+
418
425
  // Normalize: pi-mono uses lowercase ("read"), Claude uses PascalCase ("Read")
419
426
  const normalized =
420
- toolName.startsWith("mcp__") || toolName.includes("_")
421
- ? toolName
422
- : toolName.charAt(0).toUpperCase() + toolName.slice(1);
427
+ effectiveToolName.startsWith("mcp__") || effectiveToolName.includes("_")
428
+ ? effectiveToolName
429
+ : effectiveToolName.charAt(0).toUpperCase() + effectiveToolName.slice(1);
423
430
 
424
- const a = args as Record<string, unknown>;
425
431
  const shortPath = (p: unknown) => {
426
432
  if (typeof p !== "string") return "";
427
433
  // Show last 2 path segments for readability
@@ -450,8 +456,8 @@ export function toolCallToProgress(toolName: string, args: unknown): string | nu
450
456
  return `⚙️ Running /${a.skill}`;
451
457
  default: {
452
458
  // MCP tools: mcp__server__tool
453
- if (toolName.startsWith("mcp__")) {
454
- const parts = toolName.split("__");
459
+ if (effectiveToolName.startsWith("mcp__")) {
460
+ const parts = effectiveToolName.split("__");
455
461
  if (parts.length >= 3) {
456
462
  const server = parts[1];
457
463
  const tool = parts.slice(2).join("__");
@@ -465,8 +471,18 @@ export function toolCallToProgress(toolName: string, args: unknown): string | nu
465
471
  // Other MCP servers: "🔌 server: Humanized tool"
466
472
  return `🔌 ${server}: ${humanizeToolName(tool)}`;
467
473
  }
468
- return `🔌 ${toolName}`;
474
+ return `🔌 ${effectiveToolName}`;
469
475
  }
476
+
477
+ // Pi-mono exposes tools from the built-in swarm MCP endpoint as bare
478
+ // names ("store-progress", "send-task", ...), not as mcp__ names.
479
+ // Treat those names as agent-swarm tools so activity stays readable.
480
+ if (toolName.includes("-")) {
481
+ const label = SWARM_TOOL_LABELS[toolName];
482
+ if (label === null) return null;
483
+ if (label) return label;
484
+ }
485
+
470
486
  return `🔧 ${toolName}`;
471
487
  }
472
488
  }
@@ -175,6 +175,50 @@ describe("toolCallToProgress", () => {
175
175
  expect(result).toBe("🔌 context7: Query docs");
176
176
  });
177
177
 
178
+ // --- Provider-normalized MCP variants ---
179
+
180
+ test("bare agent-swarm store-progress is skipped", () => {
181
+ expect(toolCallToProgress("store-progress", {})).toBeNull();
182
+ });
183
+
184
+ test("bare agent-swarm send-task has pretty label", () => {
185
+ const result = toolCallToProgress("send-task", {});
186
+ expect(result).toBe("📤 Delegating task");
187
+ });
188
+
189
+ test("bare agent-swarm db-query has pretty label", () => {
190
+ const result = toolCallToProgress("db-query", {});
191
+ expect(result).toBe("🗃️ Querying database");
192
+ });
193
+
194
+ test("codex MCP args with agent-swarm server use pretty labels", () => {
195
+ const result = toolCallToProgress("send-task", {
196
+ server: "agent-swarm",
197
+ tool: "send-task",
198
+ arguments: { task: "ping" },
199
+ });
200
+ expect(result).toBe("📤 Delegating task");
201
+ });
202
+
203
+ test("codex MCP args with agent-swarm store-progress are skipped", () => {
204
+ expect(
205
+ toolCallToProgress("store-progress", {
206
+ server: "agent-swarm",
207
+ tool: "store-progress",
208
+ arguments: { status: "completed" },
209
+ }),
210
+ ).toBeNull();
211
+ });
212
+
213
+ test("codex MCP args with external server keep server prefix", () => {
214
+ const result = toolCallToProgress("list-issues", {
215
+ server: "linear",
216
+ tool: "list-issues",
217
+ arguments: {},
218
+ });
219
+ expect(result).toBe("🔌 linear: List issues");
220
+ });
221
+
178
222
  // --- Short path helper (tested implicitly) ---
179
223
 
180
224
  test("Read with short path (<=2 segments) keeps full path", () => {