@ganglion/xacpx 0.23.0-beta.2 → 0.23.0-beta.4

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.
@@ -3529,6 +3529,7 @@ function buildToolUseEvent(update, driver) {
3529
3529
  const content = update.content;
3530
3530
  const rawOutput = update.rawOutput ?? claudeToolResponse;
3531
3531
  const locations = update.locations;
3532
+ const machineToolName = (isClaudeDriver ? update._meta?.claudeCode?.toolName?.trim() : "") || (driver === "qoder" ? update._meta?.qoder?.toolName?.trim() : "") || (driver === "codex" ? codexMcpMachineToolName(update.rawInput) : "") || (driver === "cursor" ? machineToolNameFromCursorInput(update.rawInput) : "") || undefined;
3532
3533
  const parentToolCallId = claudeMeta?.parentToolUseId?.trim() || update.parentToolCallId?.trim();
3533
3534
  const isSubagent = claudeMeta?.toolName === "Agent" || driver === "qoder" && update._meta?.qoder?.toolName === "Agent" || driver === "kimi" && isKimiSubagentInput(rawInput) || driver === "codex" && isCodexSubagentMeta(update._meta?.codex?.subagent) || driver === "cursor" && isCursorSubagentInput(rawInput, title);
3534
3535
  return {
@@ -3536,6 +3537,7 @@ function buildToolUseEvent(update, driver) {
3536
3537
  ...parentToolCallId ? { parentToolCallId } : {},
3537
3538
  ...isSubagent ? { isSubagent: true } : {},
3538
3539
  toolName,
3540
+ ...machineToolName ? { machineToolName } : {},
3539
3541
  kind,
3540
3542
  ...summary ? { summary } : {},
3541
3543
  ...rawInput !== undefined ? { rawInput } : {},
@@ -3545,6 +3547,26 @@ function buildToolUseEvent(update, driver) {
3545
3547
  status
3546
3548
  };
3547
3549
  }
3550
+ function codexMcpMachineToolName(rawInput) {
3551
+ if (!isRecord2(rawInput))
3552
+ return "";
3553
+ const server = rawInput.server;
3554
+ const tool = rawInput.tool;
3555
+ if (typeof server !== "string" || server.trim().length === 0)
3556
+ return "";
3557
+ if (typeof tool !== "string" || tool.trim().length === 0)
3558
+ return "";
3559
+ return tool.trim();
3560
+ }
3561
+ function machineToolNameFromCursorInput(rawInput) {
3562
+ if (!isRecord2(rawInput))
3563
+ return;
3564
+ const declared = rawInput[CURSOR_TOOL_NAME_KEY];
3565
+ if (typeof declared !== "string")
3566
+ return;
3567
+ const trimmed = declared.trim();
3568
+ return trimmed.length > 0 ? trimmed : undefined;
3569
+ }
3548
3570
  function normalizeCursorPlanUpdate(state, update) {
3549
3571
  if (state.driver !== "cursor")
3550
3572
  return;
@@ -176,6 +176,26 @@ export interface MessageChannelRuntime {
176
176
  errorCode?: string;
177
177
  deduplicated?: boolean;
178
178
  }>;
179
+ /** Relay-capable channels: route an Agent Message completion back to the source node. */
180
+ sendAgentMessageCompletion?(payload: {
181
+ requestMessageId: string;
182
+ source: {
183
+ nodeId: string;
184
+ endpointId: string;
185
+ };
186
+ target: {
187
+ nodeId: string;
188
+ endpointId: string;
189
+ };
190
+ status: "completed" | "failed" | "cancelled";
191
+ result?: string;
192
+ error?: string;
193
+ completedAt: number;
194
+ }): Promise<{
195
+ ok: boolean;
196
+ deduplicated?: boolean;
197
+ error?: string;
198
+ }>;
179
199
  /** Relay-capable channels: publish this instance's agent endpoint directory to
180
200
  * the hub. The FULL snapshot replaces the previous one (no delta protocol). */
181
201
  syncAgentEndpoints?(endpoints: unknown[]): void;
@@ -188,8 +208,17 @@ export interface ToolUseEvent {
188
208
  parentToolCallId?: string;
189
209
  /** This tool call represents a delegated subagent task rather than an ordinary tool. */
190
210
  isSubagent?: boolean;
191
- /** Free-form tool name from the agent (e.g. "Read File", "Bash"). */
211
+ /** Free-form tool name from the agent (e.g. "Read File", "Bash"). This is the
212
+ * ACP DISPLAY title — a human phrase, not a stable protocol identity, and may
213
+ * differ from the underlying machine tool name on every driver. Presentation
214
+ * only; NEVER use for protocol/tool-identity decisions (see machineToolName). */
192
215
  toolName: string;
216
+ /** Stable machine tool name extracted from provider metadata (Claude
217
+ * `_meta.claudeCode.toolName`, Qoder `_meta.qoder.toolName`, Cursor
218
+ * `rawInput._toolName`). Absent when the driver exposes none (e.g. Codex).
219
+ * This is the ONLY field protocol-level tool identification (agent_send
220
+ * correlation) may match on when present. */
221
+ machineToolName?: string;
193
222
  /** Coarse classifier produced by the transport from the agent's tool kind; channels use it to pick an icon. */
194
223
  kind: ToolUseKind;
195
224
  /** Best-effort one-line summary derived from `rawInput`. */