@yu_robotics/remote-cli 1.6.128 → 1.6.133

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.
Files changed (64) hide show
  1. package/README.md +15 -2
  2. package/dist/client/MessageHandler.d.ts.map +1 -1
  3. package/dist/client/MessageHandler.js +37 -3
  4. package/dist/client/MessageHandler.js.map +1 -1
  5. package/dist/client/TaskRecovery.d.ts.map +1 -1
  6. package/dist/client/TaskRecovery.js +5 -0
  7. package/dist/client/TaskRecovery.js.map +1 -1
  8. package/dist/delegation/DelegatedWorkerSessionStore.d.ts +4 -1
  9. package/dist/delegation/DelegatedWorkerSessionStore.d.ts.map +1 -1
  10. package/dist/delegation/DelegatedWorkerSessionStore.js +6 -7
  11. package/dist/delegation/DelegatedWorkerSessionStore.js.map +1 -1
  12. package/dist/delegation/DelegatedWorkspaceManager.d.ts +91 -0
  13. package/dist/delegation/DelegatedWorkspaceManager.d.ts.map +1 -0
  14. package/dist/delegation/DelegatedWorkspaceManager.js +377 -0
  15. package/dist/delegation/DelegatedWorkspaceManager.js.map +1 -0
  16. package/dist/delegation/DelegationManager.d.ts +13 -4
  17. package/dist/delegation/DelegationManager.d.ts.map +1 -1
  18. package/dist/delegation/DelegationManager.js +388 -114
  19. package/dist/delegation/DelegationManager.js.map +1 -1
  20. package/dist/delegation/DelegationNotice.d.ts.map +1 -1
  21. package/dist/delegation/DelegationNotice.js +2 -0
  22. package/dist/delegation/DelegationNotice.js.map +1 -1
  23. package/dist/delegation/DelegationStore.d.ts +6 -2
  24. package/dist/delegation/DelegationStore.d.ts.map +1 -1
  25. package/dist/delegation/DelegationStore.js +12 -5
  26. package/dist/delegation/DelegationStore.js.map +1 -1
  27. package/dist/delegation/GitCheckpoint.d.ts +27 -0
  28. package/dist/delegation/GitCheckpoint.d.ts.map +1 -0
  29. package/dist/delegation/GitCheckpoint.js +226 -0
  30. package/dist/delegation/GitCheckpoint.js.map +1 -0
  31. package/dist/delegation/contract.d.ts +18 -4
  32. package/dist/delegation/contract.d.ts.map +1 -1
  33. package/dist/delegation/contract.js +13 -4
  34. package/dist/delegation/contract.js.map +1 -1
  35. package/dist/executor/AcpExecutor.d.ts +2 -0
  36. package/dist/executor/AcpExecutor.d.ts.map +1 -1
  37. package/dist/executor/AcpExecutor.js +22 -2
  38. package/dist/executor/AcpExecutor.js.map +1 -1
  39. package/dist/executor/AgyExecutor.d.ts +1 -0
  40. package/dist/executor/AgyExecutor.d.ts.map +1 -1
  41. package/dist/executor/AgyExecutor.js +4 -0
  42. package/dist/executor/AgyExecutor.js.map +1 -1
  43. package/dist/executor/ClaudePersistentExecutor.d.ts +2 -0
  44. package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
  45. package/dist/executor/ClaudePersistentExecutor.js +19 -0
  46. package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
  47. package/dist/executor/CodexAppServerExecutor.d.ts +4 -0
  48. package/dist/executor/CodexAppServerExecutor.d.ts.map +1 -1
  49. package/dist/executor/CodexAppServerExecutor.js +32 -0
  50. package/dist/executor/CodexAppServerExecutor.js.map +1 -1
  51. package/dist/executor/ExecutionMetadata.d.ts +9 -0
  52. package/dist/executor/ExecutionMetadata.d.ts.map +1 -0
  53. package/dist/executor/ExecutionMetadata.js +57 -0
  54. package/dist/executor/ExecutionMetadata.js.map +1 -0
  55. package/dist/executor/IExecutor.d.ts +4 -1
  56. package/dist/executor/IExecutor.d.ts.map +1 -1
  57. package/dist/executor/PiExecutor.d.ts +3 -0
  58. package/dist/executor/PiExecutor.d.ts.map +1 -1
  59. package/dist/executor/PiExecutor.js +36 -0
  60. package/dist/executor/PiExecutor.js.map +1 -1
  61. package/dist/maintenance/release-notes.json +1 -1
  62. package/dist/types/index.d.ts +15 -0
  63. package/dist/types/index.d.ts.map +1 -1
  64. package/package.json +1 -1
package/README.md CHANGED
@@ -229,8 +229,21 @@ is disabled and cross-backend sandbox translation remains unsupported. Saved
229
229
  sandbox policies are not weakened. `read_only` remains recognized for
230
230
  compatibility but is unavailable; discovery reports the rejection reason.
231
231
  There is one
232
- active child per parent and at most three per CLI process, with overlapping
233
- workspaces serialized and bounded time/output. Workspace reservations apply to
232
+ active child per parent and at most three per CLI process, with bounded time/output.
233
+ From CLI 1.6.129, a request may accept multiple independent tasks before collecting
234
+ results. Followers report `queued`, execute in FIFO order, and may be cancelled
235
+ individually without starting a worker. The cumulative limit is 12 accepted tasks
236
+ per request across continuations, including failures and cancellations. Queue
237
+ waits expire one hour after admission. Confirmed process exit and reusable lane
238
+ metadata are required before the next worker starts; an uncertain exit blocks
239
+ queued siblings. No peer communication or native backend behavior changes are
240
+ included. Other overlapping requests or a new request without an available
241
+ global execution slot are rejected rather than queued. Queue status uses existing
242
+ notice text, with progress cards only for started workers; existing Routers remain
243
+ compatible. Restarting the CLI interrupts retained queued/running records without
244
+ replaying work. Sibling results are not explicitly forwarded; a reused same-backend
245
+ lane retains its own earlier task context. Uncertain startup or cleanup retains
246
+ the occupied global slot until the CLI restarts. Workspace reservations apply to
234
247
  delegation-enabled work; opted-out threads keep ordinary workspace access, so
235
248
  use separate workspaces for independent writers. See
236
249
  [Cross-backend Delegation](../../README.md#cross-backend-delegation) for limits,
@@ -1 +1 @@
1
- {"version":3,"file":"MessageHandler.d.ts","sourceRoot":"","sources":["../../src/client/MessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAgK,MAAM,UAAU,CAAC;AACzM,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA4GxD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAA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IAgBpB,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,YAAY;IAgDpB,OAAO,CAAC,YAAY;YAUN,cAAc;YAuBd,oBAAoB;IAkHlC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAc/B"}
@@ -29,6 +29,7 @@ const contract_1 = require("../delegation/contract");
29
29
  const DelegationStatusFormatter_1 = require("../delegation/DelegationStatusFormatter");
30
30
  const BackendCommand_1 = require("../utils/BackendCommand");
31
31
  const ClaudeStderrFilter_1 = require("../executor/claude/ClaudeStderrFilter");
32
+ const ExecutionMetadata_1 = require("../executor/ExecutionMetadata");
32
33
  const EFFORT_BACKENDS = new Set(['codex', 'agy', 'opencode', 'kimi', 'zcode', 'pi', 'dsh']);
33
34
  const NATIVE_MODEL_LIST_BACKENDS = new Set(['codex', 'opencode', 'kimi', 'zcode', 'pi', 'dsh']);
34
35
  const SLASH_SESSION_BACKENDS = new Set(['opencode', 'kimi', 'zcode', 'pi']);
@@ -313,6 +314,28 @@ class MessageHandler {
313
314
  return;
314
315
  }
315
316
  // Child input belongs to the child executor, even though the parent owns the thread.
317
+ const addressedReply = /^(yes|no)\s+(\S+)$/i.exec(content?.trim() ?? '');
318
+ const addressedApproval = addressedReply ? this.pendingApprovalCards.get(addressedReply[2]) : undefined;
319
+ if (addressedApproval?.delegated && addressedReply) {
320
+ let accepted = false;
321
+ if (addressedApproval.request.threadId === resolvedThreadId && addressedApproval.request.openId === message.openId) {
322
+ const action = addressedReply[1].toLowerCase() === 'yes' ? 'approve' : 'deny';
323
+ try {
324
+ accepted = addressedApproval.executor.respondToApproval?.(addressedReply[2], action) === true;
325
+ }
326
+ catch { /* Never fall through to another executor after a targeted approval fails. */ }
327
+ if (accepted)
328
+ this.resolveApprovalCard(addressedReply[2], action === 'approve' ? 'approved' : 'denied');
329
+ }
330
+ this.sendResponse(messageId, resolvedThreadId, accepted ? { success: true, output: 'Approval response sent.' }
331
+ : { success: false, error: 'The addressed worker approval could not be applied. Check its request ID and owner.' });
332
+ return;
333
+ }
334
+ if (this.delegation.hasAmbiguousInput(resolvedThreadId)) {
335
+ this.sendResponse(messageId, resolvedThreadId, { success: false,
336
+ error: 'Multiple workers are waiting for input. Use the specific approval card or request ID; an unaddressed reply cannot be routed safely.' });
337
+ return;
338
+ }
316
339
  const inputExecutor = this.delegation.waitingExecutor(resolvedThreadId) ?? executor;
317
340
  if ('isWaitingInput' in inputExecutor && typeof inputExecutor.isWaitingInput === 'function') {
318
341
  const ex = inputExecutor;
@@ -1800,6 +1823,7 @@ You can also use natural language commands to control Claude Code CLI.`,
1800
1823
  this.sendStreamContext(messageId, threadId, executor);
1801
1824
  let delegationScope;
1802
1825
  let delegationBridge;
1826
+ let executionMetadata;
1803
1827
  const complete = async (success, error) => {
1804
1828
  delegationBridge?.activate(undefined);
1805
1829
  const retained = !success && delegationScope && !delegationScope.isClosed()
@@ -1823,7 +1847,7 @@ You can also use natural language commands to control Claude Code CLI.`,
1823
1847
  }
1824
1848
  const responseError = fromQueue && !success
1825
1849
  ? this.pauseQueueAfterFailure(threadId, error || 'Queued command failed') : error;
1826
- this.sendResponse(messageId, threadId, { success, error: responseError, threads: this.threadPool.getSummaries() });
1850
+ this.sendResponse(messageId, threadId, { success, error: responseError, threads: this.threadPool.getSummaries(), executionMetadata });
1827
1851
  if (fromQueue)
1828
1852
  console.log(`[MessageHandler] Finished queued message ${messageId} in thread ${threadId}: success=${success}, remaining=${this.threadQueues.get(threadId)?.length ?? 0}, paused=${this.pausedQueues.has(threadId)}`);
1829
1853
  return success;
@@ -1920,7 +1944,7 @@ You can also use natural language commands to control Claude Code CLI.`,
1920
1944
  this.sendStreamChunk(messageId, threadId, chunk);
1921
1945
  },
1922
1946
  onToolUse: (toolUse) => {
1923
- if (delegationScope && /remote_cli_(list_backends|delegate|result|cancel)$/.test(toolUse.name)) {
1947
+ if (delegationScope && /remote_cli_(list_backends|delegate|result|cancel|integrate)$/.test(toolUse.name)) {
1924
1948
  delegationControlTools.add(toolUse.id);
1925
1949
  return;
1926
1950
  }
@@ -1991,8 +2015,14 @@ You can also use natural language commands to control Claude Code CLI.`,
1991
2015
  onToolResult: tool => { if (active && !scope.isClosed())
1992
2016
  options.onToolResult?.(tool); },
1993
2017
  } : options;
2018
+ const backend = this.threadPool.getBackendKey(threadId);
2019
+ const launchMetadata = (0, ExecutionMetadata_1.captureExecutionMetadata)(executor, backend);
2020
+ executionMetadata = launchMetadata;
2021
+ let capturedMetadata = false;
1994
2022
  try {
1995
2023
  const result = await executor.execute(prompt, guardedOptions);
2024
+ executionMetadata = (0, ExecutionMetadata_1.mergeReportedExecutionMetadata)(launchMetadata, (0, ExecutionMetadata_1.captureExecutionMetadata)(executor, backend));
2025
+ capturedMetadata = true;
1996
2026
  active = false;
1997
2027
  delegationBridge?.activate(undefined);
1998
2028
  assertCoordinatorActive();
@@ -2007,6 +2037,8 @@ You can also use natural language commands to control Claude Code CLI.`,
2007
2037
  return result;
2008
2038
  }
2009
2039
  finally {
2040
+ if (!capturedMetadata)
2041
+ executionMetadata = (0, ExecutionMetadata_1.mergeReportedExecutionMetadata)(launchMetadata, (0, ExecutionMetadata_1.captureExecutionMetadata)(executor, backend));
2010
2042
  active = false;
2011
2043
  delegationBridge?.activate(undefined);
2012
2044
  if (!finished)
@@ -2121,7 +2153,8 @@ You can also use natural language commands to control Claude Code CLI.`,
2121
2153
  const description = request.approval.description;
2122
2154
  const longest = (description.match(/`+/g) ?? []).reduce((length, run) => Math.max(length, run.length), 2);
2123
2155
  const fence = '`'.repeat(longest + 1);
2124
- this.sendStreamChunk(request.taskMessageId, request.threadId, `\nšŸ” **Approval required**\n\n${fence}\n${description}\n${fence}\n\nReply yes, no${request.approval.canRemember ? ', or remember to save these directories' : ''}.\n`);
2156
+ this.sendStreamChunk(request.taskMessageId, request.threadId, `\nšŸ” **Approval required**\n\n${fence}\n${description}\n${fence}\n\nReply yes, no${request.approval.canRemember ? ', or remember to save these directories' : ''}.${pending.delegated
2157
+ ? ` To address this worker explicitly, reply yes ${requestId} or no ${requestId}.` : ''}\n`);
2125
2158
  }
2126
2159
  resolveApprovalCard(requestId, status) {
2127
2160
  const pending = this.pendingApprovalCards.get(requestId);
@@ -2327,6 +2360,7 @@ You can also use natural language commands to control Claude Code CLI.`,
2327
2360
  threadId,
2328
2361
  threads: result.threads,
2329
2362
  queueConfirmation: result.queueConfirmation,
2363
+ ...(result.executionMetadata ? { executionMetadata: result.executionMetadata } : {}),
2330
2364
  cwd,
2331
2365
  timestamp: Date.now(),
2332
2366
  });