@yu_robotics/remote-cli 1.6.102 → 1.6.106
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/dist/client/MessageHandler.d.ts +4 -0
- package/dist/client/MessageHandler.d.ts.map +1 -1
- package/dist/client/MessageHandler.js +108 -17
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/client/WebSocketClient.d.ts.map +1 -1
- package/dist/client/WebSocketClient.js +7 -1
- package/dist/client/WebSocketClient.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +1 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/delegation/DelegatedWorkerLaneCleanup.d.ts +11 -0
- package/dist/delegation/DelegatedWorkerLaneCleanup.d.ts.map +1 -0
- package/dist/delegation/DelegatedWorkerLaneCleanup.js +91 -0
- package/dist/delegation/DelegatedWorkerLaneCleanup.js.map +1 -0
- package/dist/delegation/DelegatedWorkerSessionStore.d.ts +62 -0
- package/dist/delegation/DelegatedWorkerSessionStore.d.ts.map +1 -0
- package/dist/delegation/DelegatedWorkerSessionStore.js +276 -0
- package/dist/delegation/DelegatedWorkerSessionStore.js.map +1 -0
- package/dist/delegation/DelegationManager.d.ts +31 -3
- package/dist/delegation/DelegationManager.d.ts.map +1 -1
- package/dist/delegation/DelegationManager.js +359 -34
- package/dist/delegation/DelegationManager.js.map +1 -1
- package/dist/delegation/DelegationStatusFormatter.js +2 -2
- package/dist/delegation/DelegationStatusFormatter.js.map +1 -1
- package/dist/delegation/contract.d.ts +2 -2
- package/dist/delegation/contract.d.ts.map +1 -1
- package/dist/delegation/contract.js +2 -2
- package/dist/delegation/contract.js.map +1 -1
- package/dist/executor/AcpExecutor.d.ts.map +1 -1
- package/dist/executor/AcpExecutor.js +3 -0
- package/dist/executor/AcpExecutor.js.map +1 -1
- package/dist/executor/AgyExecutor.d.ts.map +1 -1
- package/dist/executor/AgyExecutor.js +1 -0
- package/dist/executor/AgyExecutor.js.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts +10 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.js +32 -1
- package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
- package/dist/executor/CodexAppServerClient.d.ts +2 -0
- package/dist/executor/CodexAppServerClient.d.ts.map +1 -1
- package/dist/executor/CodexAppServerClient.js +63 -9
- package/dist/executor/CodexAppServerClient.js.map +1 -1
- package/dist/executor/CodexAppServerExecutor.d.ts +5 -0
- package/dist/executor/CodexAppServerExecutor.d.ts.map +1 -1
- package/dist/executor/CodexAppServerExecutor.js +24 -0
- package/dist/executor/CodexAppServerExecutor.js.map +1 -1
- package/dist/executor/IExecutor.d.ts +8 -0
- package/dist/executor/IExecutor.d.ts.map +1 -1
- package/dist/executor/PiExecutor.d.ts +6 -0
- package/dist/executor/PiExecutor.d.ts.map +1 -1
- package/dist/executor/PiExecutor.js +18 -0
- package/dist/executor/PiExecutor.js.map +1 -1
- package/dist/executor/index.js +3 -3
- package/dist/executor/index.js.map +1 -1
- package/dist/executor/pi/PiClient.d.ts +1 -0
- package/dist/executor/pi/PiClient.d.ts.map +1 -1
- package/dist/executor/pi/PiClient.js +9 -0
- package/dist/executor/pi/PiClient.js.map +1 -1
- package/dist/executor/pi/PiTypes.d.ts +2 -0
- package/dist/executor/pi/PiTypes.d.ts.map +1 -1
- package/dist/executor/pi/PiTypes.js.map +1 -1
- package/dist/thread/ThreadExecutorPool.d.ts.map +1 -1
- package/dist/thread/ThreadExecutorPool.js +10 -1
- package/dist/thread/ThreadExecutorPool.js.map +1 -1
- package/dist/thread/ThreadManager.d.ts +1 -1
- package/dist/thread/ThreadManager.d.ts.map +1 -1
- package/dist/thread/ThreadManager.js +2 -0
- package/dist/thread/ThreadManager.js.map +1 -1
- package/dist/thread/types.d.ts +6 -0
- package/dist/thread/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +19 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -37,10 +37,13 @@ export declare class MessageHandler {
|
|
|
37
37
|
private readonly abortOperations;
|
|
38
38
|
private automaticUpdateInProgress;
|
|
39
39
|
private approvalCardsSupported;
|
|
40
|
+
private delegationProgressSupported;
|
|
41
|
+
private delegationProgressTextSupported;
|
|
40
42
|
private readonly pendingApprovalCards;
|
|
41
43
|
private readonly delegation;
|
|
42
44
|
private readonly delegationBridges;
|
|
43
45
|
constructor(wsClient: WebSocketClient, threadPool: ThreadExecutorPool, threadManager: ThreadManager, directoryGuard: DirectoryGuard, config: ConfigManager);
|
|
46
|
+
reconcilePendingDelegatedWorkers(): Promise<void>;
|
|
44
47
|
/**
|
|
45
48
|
* Handle message (supports new IncomingMessage format)
|
|
46
49
|
*/
|
|
@@ -165,6 +168,7 @@ export declare class MessageHandler {
|
|
|
165
168
|
private sendStreamChunk;
|
|
166
169
|
private sendToolUse;
|
|
167
170
|
private sendToolResult;
|
|
171
|
+
private sendDelegationProgress;
|
|
168
172
|
private sendRedactedThinking;
|
|
169
173
|
private sendPlanMode;
|
|
170
174
|
private sendImage;
|
|
@@ -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;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"MessageHandler.d.ts","sourceRoot":"","sources":["../../src/client/MessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,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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CAAC,gBAAgB;IAIxB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,sBAAsB;IAuB9B,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,sBAAsB;IAsB9B,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,YAAY;IA6CpB,OAAO,CAAC,YAAY;YAMN,cAAc;YAqBd,oBAAoB;IAkHlC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAa/B"}
|
|
@@ -94,6 +94,8 @@ class MessageHandler {
|
|
|
94
94
|
abortOperations = new Map();
|
|
95
95
|
automaticUpdateInProgress = false;
|
|
96
96
|
approvalCardsSupported = false;
|
|
97
|
+
delegationProgressSupported = false;
|
|
98
|
+
delegationProgressTextSupported = false;
|
|
97
99
|
pendingApprovalCards = new Map();
|
|
98
100
|
delegation;
|
|
99
101
|
delegationBridges = new Map();
|
|
@@ -110,6 +112,16 @@ class MessageHandler {
|
|
|
110
112
|
// Initialize machine commands
|
|
111
113
|
this.machineCommands = new MachineCommands_1.MachineCommands(config);
|
|
112
114
|
}
|
|
115
|
+
async reconcilePendingDelegatedWorkers() {
|
|
116
|
+
try {
|
|
117
|
+
const result = await this.delegation.reconcilePendingWorkerLanes();
|
|
118
|
+
if (result.failed)
|
|
119
|
+
console.warn(`[Delegation] ${result.failed} pending worker lane(s) still need cleanup`);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
console.warn('[Delegation] Pending worker lane reconciliation could not complete:', error instanceof Error ? error.message : 'Storage failure');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
113
125
|
/**
|
|
114
126
|
* Handle message (supports new IncomingMessage format)
|
|
115
127
|
*/
|
|
@@ -137,6 +149,9 @@ class MessageHandler {
|
|
|
137
149
|
if (data?.success !== true)
|
|
138
150
|
return;
|
|
139
151
|
this.approvalCardsSupported = data.capabilities?.approvalCards === true;
|
|
152
|
+
this.delegationProgressSupported = data.capabilities?.delegationProgress === true;
|
|
153
|
+
this.delegationProgressTextSupported = this.delegationProgressSupported
|
|
154
|
+
&& data.capabilities?.delegationProgressText === true;
|
|
140
155
|
for (const pending of this.pendingApprovalCards.values()) {
|
|
141
156
|
if (this.approvalCardsSupported)
|
|
142
157
|
this.sendApprovalMessage(pending.request);
|
|
@@ -318,7 +333,7 @@ class MessageHandler {
|
|
|
318
333
|
return;
|
|
319
334
|
}
|
|
320
335
|
const queueSensitiveCommand = /^\/(?:clear|new|compact|cd|model|effort|sandbox)(?:\s|$)/.test(content?.trim() ?? '')
|
|
321
|
-
|| /^\/delegation\s+(?:on|off)(?:\s|$)/.test(content?.trim() ?? '')
|
|
336
|
+
|| /^\/delegation\s+(?:on|off|reset)(?:\s|$)/.test(content?.trim() ?? '')
|
|
322
337
|
|| /^\/thread\s+delete(?:\s|$)/.test(content?.trim() ?? '');
|
|
323
338
|
if (queueSensitiveCommand && this.hasThreadQueueState(resolvedThreadId)) {
|
|
324
339
|
this.sendResponse(messageId, resolvedThreadId, {
|
|
@@ -342,7 +357,16 @@ class MessageHandler {
|
|
|
342
357
|
});
|
|
343
358
|
return;
|
|
344
359
|
}
|
|
345
|
-
|
|
360
|
+
if (this.delegation.hasActiveTasks(resolvedThreadId)) {
|
|
361
|
+
throw new Error('Cannot change working directory while a delegated worker is running. Wait for it to finish or send /abort first.');
|
|
362
|
+
}
|
|
363
|
+
const generation = this.threadManager.getThread(resolvedThreadId)?.delegationWorkspaceGeneration ?? 0;
|
|
364
|
+
const changedDirectory = await this.threadPool.setWorkingDirectory(resolvedThreadId, workingDirectory);
|
|
365
|
+
if (changedDirectory.changed) {
|
|
366
|
+
const cleanup = await this.delegation.invalidateWorkspaceGeneration(resolvedThreadId, generation + 1);
|
|
367
|
+
if (cleanup.failed)
|
|
368
|
+
this.sendStreamChunk(messageId, resolvedThreadId, `Working directory changed, but ${cleanup.failed} delegated worker lane(s) could not be cleaned up. Retry with /delegation reset after checking filesystem permissions.\n`);
|
|
369
|
+
}
|
|
346
370
|
}
|
|
347
371
|
// Update thread activity timestamp
|
|
348
372
|
await this.threadManager.updateThread(resolvedThreadId, { lastActiveAt: Date.now() });
|
|
@@ -467,17 +491,54 @@ class MessageHandler {
|
|
|
467
491
|
async handleBuiltInCommand(messageId, threadId, content, executor) {
|
|
468
492
|
const trimmed = content.trim();
|
|
469
493
|
if (trimmed === '/delegation' || trimmed.startsWith('/delegation ')) {
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
|
|
494
|
+
const argumentsList = trimmed.slice('/delegation'.length).trim().split(/\s+/).filter(Boolean);
|
|
495
|
+
const action = argumentsList[0];
|
|
496
|
+
const backendArgument = argumentsList[1];
|
|
497
|
+
if (argumentsList.length > 2 || (action && action !== 'on' && action !== 'off' && action !== 'reset')) {
|
|
498
|
+
this.sendResponse(messageId, threadId, { success: false, error: 'Usage: /delegation [on|off|reset [backend]]' });
|
|
473
499
|
return true;
|
|
474
500
|
}
|
|
475
|
-
if (
|
|
501
|
+
if (action === 'reset') {
|
|
502
|
+
if (backendArgument && !contract_1.DELEGATION_BACKENDS.includes(backendArgument)) {
|
|
503
|
+
this.sendResponse(messageId, threadId, {
|
|
504
|
+
success: false,
|
|
505
|
+
error: `Unknown delegation backend: ${backendArgument}. Available: ${contract_1.DELEGATION_BACKENDS.join(', ')}`,
|
|
506
|
+
});
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
if (this.delegation.hasActiveTasks(threadId)) {
|
|
510
|
+
this.sendResponse(messageId, threadId, {
|
|
511
|
+
success: false,
|
|
512
|
+
error: 'Cannot reset delegated worker context while this thread is running. Wait for it to finish or send /abort first.',
|
|
513
|
+
});
|
|
514
|
+
return true;
|
|
515
|
+
}
|
|
516
|
+
try {
|
|
517
|
+
const removed = await this.delegation.resetWorkerLanes(threadId, backendArgument);
|
|
518
|
+
const target = backendArgument ? `${backendDisplayName(backendArgument)} worker` : 'all delegated worker';
|
|
519
|
+
this.sendResponse(messageId, threadId, {
|
|
520
|
+
success: true,
|
|
521
|
+
output: `✅ Reset ${target} context${removed === 1 ? '' : 's'} (${removed} lane${removed === 1 ? '' : 's'} removed).`,
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
catch (error) {
|
|
525
|
+
this.sendResponse(messageId, threadId, {
|
|
526
|
+
success: false,
|
|
527
|
+
error: error instanceof Error ? error.message : 'Failed to reset delegated worker context.',
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
if (backendArgument || (action && action !== 'on' && action !== 'off')) {
|
|
533
|
+
this.sendResponse(messageId, threadId, { success: false, error: 'Usage: /delegation [on|off|reset [backend]]' });
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
if (action === 'on' && !executor.configureDelegation) {
|
|
476
537
|
this.sendResponse(messageId, threadId, { success: false, error: 'This executor does not support delegation tool registration.' });
|
|
477
538
|
return true;
|
|
478
539
|
}
|
|
479
|
-
if (
|
|
480
|
-
if (
|
|
540
|
+
if (action) {
|
|
541
|
+
if (action === 'off') {
|
|
481
542
|
const thread = this.threadManager.getThread(threadId);
|
|
482
543
|
const backend = this.threadPool.getBackendKey(threadId);
|
|
483
544
|
if (thread.delegationBackends?.includes(backend) || (thread.delegation && !thread.delegationBackends)) {
|
|
@@ -489,7 +550,7 @@ class MessageHandler {
|
|
|
489
550
|
await this.delegationBridges.get(threadId)?.close();
|
|
490
551
|
this.delegationBridges.delete(threadId);
|
|
491
552
|
}
|
|
492
|
-
await this.threadManager.updateThread(threadId, { delegation:
|
|
553
|
+
await this.threadManager.updateThread(threadId, { delegation: action === 'on' });
|
|
493
554
|
}
|
|
494
555
|
const config = this.config.get('executor') ?? { type: 'auto' };
|
|
495
556
|
const backends = await this.delegation.registry.list(config);
|
|
@@ -627,7 +688,7 @@ Use /compact to reduce conversation context or /clear to start a fresh context.`
|
|
|
627
688
|
- /model [name] - Show models for the active backend, or set this thread's model
|
|
628
689
|
- /effort [auto|level] - Show or set effort for Codex/AGY/OpenCode/Kimi/ZCode/Pi (Claude Code is unsupported)
|
|
629
690
|
- /sandbox [on|off|read-only|default|allow <directory>|remove <directory>|network on|off] - Configure this thread's sandbox (Codex, Claude Code)
|
|
630
|
-
- /delegation [on|off] - Delegate tasks between installed agent backends
|
|
691
|
+
- /delegation [on|off|reset [backend]] - Delegate tasks between installed agent backends; reset saved worker context when needed
|
|
631
692
|
- /backend - List backends and show the current thread's effective backend
|
|
632
693
|
- /backend <index> - Switch all threads and clear per-thread backend overrides
|
|
633
694
|
- /backend <index> @ - Switch only the current thread
|
|
@@ -692,10 +753,17 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
692
753
|
}
|
|
693
754
|
const targetDir = parts.slice(1).join(' ');
|
|
694
755
|
try {
|
|
756
|
+
if (this.delegation.hasActiveTasks(threadId)) {
|
|
757
|
+
throw new Error('Cannot change working directory while a delegated worker is running. Wait for it to finish or send /abort first.');
|
|
758
|
+
}
|
|
759
|
+
const generation = this.threadManager.getThread(threadId)?.delegationWorkspaceGeneration ?? 0;
|
|
695
760
|
const { cwd: newCwd, changed } = await this.threadPool.setWorkingDirectory(threadId, targetDir);
|
|
761
|
+
const cleanup = changed
|
|
762
|
+
? await this.delegation.invalidateWorkspaceGeneration(threadId, generation + 1)
|
|
763
|
+
: { removed: 0, failed: 0 };
|
|
696
764
|
this.sendResponse(messageId, threadId, {
|
|
697
765
|
success: true,
|
|
698
|
-
output: `✅ Changed working directory to: ${newCwd}${changed ? '\nConversation context cleared for all backends in this thread.' : ''}`,
|
|
766
|
+
output: `✅ Changed working directory to: ${newCwd}${changed ? '\nConversation context cleared for all direct and delegated backends in this thread.' : ''}${cleanup.failed ? `\n⚠️ ${cleanup.failed} delegated worker lane(s) could not be cleaned up. Retry with /delegation reset after checking filesystem permissions.` : ''}`,
|
|
699
767
|
});
|
|
700
768
|
}
|
|
701
769
|
catch (error) {
|
|
@@ -1201,12 +1269,11 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1201
1269
|
return;
|
|
1202
1270
|
}
|
|
1203
1271
|
try {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
}
|
|
1272
|
+
await this.delegation.cancelThread(target.id);
|
|
1273
|
+
await this.delegationBridges.get(target.id)?.close();
|
|
1274
|
+
this.delegationBridges.delete(target.id);
|
|
1275
|
+
await this.delegation.deleteWorkerLanes(target.id);
|
|
1276
|
+
await this.delegation.store.deleteThread(target.id);
|
|
1210
1277
|
await this.threadPool.destroyThread(target.id);
|
|
1211
1278
|
await this.threadManager.deleteThread(target.id);
|
|
1212
1279
|
this.sendResponse(messageId, callerThreadId, {
|
|
@@ -1686,6 +1753,12 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1686
1753
|
onToolUse: tool => this.sendToolUse(messageId, threadId, tool),
|
|
1687
1754
|
onToolResult: result => this.sendToolResult(messageId, threadId, result),
|
|
1688
1755
|
onNotice: text => this.sendStreamChunk(messageId, threadId, text),
|
|
1756
|
+
onProgress: this.delegationProgressSupported
|
|
1757
|
+
? progress => this.sendDelegationProgress(messageId, threadId, progress)
|
|
1758
|
+
: undefined,
|
|
1759
|
+
onTextProgress: this.delegationProgressTextSupported
|
|
1760
|
+
? progress => this.sendDelegationProgress(messageId, threadId, progress)
|
|
1761
|
+
: undefined,
|
|
1689
1762
|
onApproval: (request, child) => this.forwardApproval(request, child, messageId, threadId, true),
|
|
1690
1763
|
onApprovalResolved: (id, status) => this.resolveApprovalCard(id, status),
|
|
1691
1764
|
isWorkspaceBusy: cwd => this.threadManager.listThreads().some(other => {
|
|
@@ -2032,6 +2105,24 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2032
2105
|
console.error('Failed to send tool result:', error);
|
|
2033
2106
|
}
|
|
2034
2107
|
}
|
|
2108
|
+
sendDelegationProgress(messageId, threadId, delegationProgress) {
|
|
2109
|
+
try {
|
|
2110
|
+
this.wsClient.send({
|
|
2111
|
+
type: 'stream',
|
|
2112
|
+
messageId,
|
|
2113
|
+
streamType: 'delegation_progress',
|
|
2114
|
+
delegationProgress,
|
|
2115
|
+
openId: this.getMessageOpenId(messageId),
|
|
2116
|
+
threadId,
|
|
2117
|
+
timestamp: Date.now(),
|
|
2118
|
+
});
|
|
2119
|
+
return true;
|
|
2120
|
+
}
|
|
2121
|
+
catch (error) {
|
|
2122
|
+
console.error('Failed to send delegated worker progress:', error);
|
|
2123
|
+
return false;
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2035
2126
|
sendRedactedThinking(messageId, threadId) {
|
|
2036
2127
|
try {
|
|
2037
2128
|
this.wsClient.send({
|