@yu_robotics/remote-cli 1.6.101 → 1.6.105
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 +3 -0
- package/dist/client/MessageHandler.d.ts.map +1 -1
- package/dist/client/MessageHandler.js +101 -17
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/client/WebSocketClient.js +1 -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 +23 -3
- package/dist/delegation/DelegationManager.d.ts.map +1 -1
- package/dist/delegation/DelegationManager.js +259 -29
- 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/ClaudePersistentExecutor.d.ts +7 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.js +27 -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 +23 -0
- package/dist/executor/CodexAppServerExecutor.js.map +1 -1
- package/dist/executor/IExecutor.d.ts +6 -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 -1
- 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 +17 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -37,10 +37,12 @@ export declare class MessageHandler {
|
|
|
37
37
|
private readonly abortOperations;
|
|
38
38
|
private automaticUpdateInProgress;
|
|
39
39
|
private approvalCardsSupported;
|
|
40
|
+
private delegationProgressSupported;
|
|
40
41
|
private readonly pendingApprovalCards;
|
|
41
42
|
private readonly delegation;
|
|
42
43
|
private readonly delegationBridges;
|
|
43
44
|
constructor(wsClient: WebSocketClient, threadPool: ThreadExecutorPool, threadManager: ThreadManager, directoryGuard: DirectoryGuard, config: ConfigManager);
|
|
45
|
+
reconcilePendingDelegatedWorkers(): Promise<void>;
|
|
44
46
|
/**
|
|
45
47
|
* Handle message (supports new IncomingMessage format)
|
|
46
48
|
*/
|
|
@@ -165,6 +167,7 @@ export declare class MessageHandler {
|
|
|
165
167
|
private sendStreamChunk;
|
|
166
168
|
private sendToolUse;
|
|
167
169
|
private sendToolResult;
|
|
170
|
+
private sendDelegationProgress;
|
|
168
171
|
private sendRedactedThinking;
|
|
169
172
|
private sendPlanMode;
|
|
170
173
|
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,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAwGxD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAA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AsB9B,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,7 @@ class MessageHandler {
|
|
|
94
94
|
abortOperations = new Map();
|
|
95
95
|
automaticUpdateInProgress = false;
|
|
96
96
|
approvalCardsSupported = false;
|
|
97
|
+
delegationProgressSupported = false;
|
|
97
98
|
pendingApprovalCards = new Map();
|
|
98
99
|
delegation;
|
|
99
100
|
delegationBridges = new Map();
|
|
@@ -110,6 +111,16 @@ class MessageHandler {
|
|
|
110
111
|
// Initialize machine commands
|
|
111
112
|
this.machineCommands = new MachineCommands_1.MachineCommands(config);
|
|
112
113
|
}
|
|
114
|
+
async reconcilePendingDelegatedWorkers() {
|
|
115
|
+
try {
|
|
116
|
+
const result = await this.delegation.reconcilePendingWorkerLanes();
|
|
117
|
+
if (result.failed)
|
|
118
|
+
console.warn(`[Delegation] ${result.failed} pending worker lane(s) still need cleanup`);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
console.warn('[Delegation] Pending worker lane reconciliation could not complete:', error instanceof Error ? error.message : 'Storage failure');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
113
124
|
/**
|
|
114
125
|
* Handle message (supports new IncomingMessage format)
|
|
115
126
|
*/
|
|
@@ -137,6 +148,7 @@ class MessageHandler {
|
|
|
137
148
|
if (data?.success !== true)
|
|
138
149
|
return;
|
|
139
150
|
this.approvalCardsSupported = data.capabilities?.approvalCards === true;
|
|
151
|
+
this.delegationProgressSupported = data.capabilities?.delegationProgress === true;
|
|
140
152
|
for (const pending of this.pendingApprovalCards.values()) {
|
|
141
153
|
if (this.approvalCardsSupported)
|
|
142
154
|
this.sendApprovalMessage(pending.request);
|
|
@@ -318,7 +330,7 @@ class MessageHandler {
|
|
|
318
330
|
return;
|
|
319
331
|
}
|
|
320
332
|
const queueSensitiveCommand = /^\/(?:clear|new|compact|cd|model|effort|sandbox)(?:\s|$)/.test(content?.trim() ?? '')
|
|
321
|
-
|| /^\/delegation\s+(?:on|off)(?:\s|$)/.test(content?.trim() ?? '')
|
|
333
|
+
|| /^\/delegation\s+(?:on|off|reset)(?:\s|$)/.test(content?.trim() ?? '')
|
|
322
334
|
|| /^\/thread\s+delete(?:\s|$)/.test(content?.trim() ?? '');
|
|
323
335
|
if (queueSensitiveCommand && this.hasThreadQueueState(resolvedThreadId)) {
|
|
324
336
|
this.sendResponse(messageId, resolvedThreadId, {
|
|
@@ -342,7 +354,16 @@ class MessageHandler {
|
|
|
342
354
|
});
|
|
343
355
|
return;
|
|
344
356
|
}
|
|
345
|
-
|
|
357
|
+
if (this.delegation.hasActiveTasks(resolvedThreadId)) {
|
|
358
|
+
throw new Error('Cannot change working directory while a delegated worker is running. Wait for it to finish or send /abort first.');
|
|
359
|
+
}
|
|
360
|
+
const generation = this.threadManager.getThread(resolvedThreadId)?.delegationWorkspaceGeneration ?? 0;
|
|
361
|
+
const changedDirectory = await this.threadPool.setWorkingDirectory(resolvedThreadId, workingDirectory);
|
|
362
|
+
if (changedDirectory.changed) {
|
|
363
|
+
const cleanup = await this.delegation.invalidateWorkspaceGeneration(resolvedThreadId, generation + 1);
|
|
364
|
+
if (cleanup.failed)
|
|
365
|
+
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`);
|
|
366
|
+
}
|
|
346
367
|
}
|
|
347
368
|
// Update thread activity timestamp
|
|
348
369
|
await this.threadManager.updateThread(resolvedThreadId, { lastActiveAt: Date.now() });
|
|
@@ -467,17 +488,54 @@ class MessageHandler {
|
|
|
467
488
|
async handleBuiltInCommand(messageId, threadId, content, executor) {
|
|
468
489
|
const trimmed = content.trim();
|
|
469
490
|
if (trimmed === '/delegation' || trimmed.startsWith('/delegation ')) {
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
|
|
491
|
+
const argumentsList = trimmed.slice('/delegation'.length).trim().split(/\s+/).filter(Boolean);
|
|
492
|
+
const action = argumentsList[0];
|
|
493
|
+
const backendArgument = argumentsList[1];
|
|
494
|
+
if (argumentsList.length > 2 || (action && action !== 'on' && action !== 'off' && action !== 'reset')) {
|
|
495
|
+
this.sendResponse(messageId, threadId, { success: false, error: 'Usage: /delegation [on|off|reset [backend]]' });
|
|
473
496
|
return true;
|
|
474
497
|
}
|
|
475
|
-
if (
|
|
498
|
+
if (action === 'reset') {
|
|
499
|
+
if (backendArgument && !contract_1.DELEGATION_BACKENDS.includes(backendArgument)) {
|
|
500
|
+
this.sendResponse(messageId, threadId, {
|
|
501
|
+
success: false,
|
|
502
|
+
error: `Unknown delegation backend: ${backendArgument}. Available: ${contract_1.DELEGATION_BACKENDS.join(', ')}`,
|
|
503
|
+
});
|
|
504
|
+
return true;
|
|
505
|
+
}
|
|
506
|
+
if (this.delegation.hasActiveTasks(threadId)) {
|
|
507
|
+
this.sendResponse(messageId, threadId, {
|
|
508
|
+
success: false,
|
|
509
|
+
error: 'Cannot reset delegated worker context while this thread is running. Wait for it to finish or send /abort first.',
|
|
510
|
+
});
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
try {
|
|
514
|
+
const removed = await this.delegation.resetWorkerLanes(threadId, backendArgument);
|
|
515
|
+
const target = backendArgument ? `${backendDisplayName(backendArgument)} worker` : 'all delegated worker';
|
|
516
|
+
this.sendResponse(messageId, threadId, {
|
|
517
|
+
success: true,
|
|
518
|
+
output: `✅ Reset ${target} context${removed === 1 ? '' : 's'} (${removed} lane${removed === 1 ? '' : 's'} removed).`,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
catch (error) {
|
|
522
|
+
this.sendResponse(messageId, threadId, {
|
|
523
|
+
success: false,
|
|
524
|
+
error: error instanceof Error ? error.message : 'Failed to reset delegated worker context.',
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
529
|
+
if (backendArgument || (action && action !== 'on' && action !== 'off')) {
|
|
530
|
+
this.sendResponse(messageId, threadId, { success: false, error: 'Usage: /delegation [on|off|reset [backend]]' });
|
|
531
|
+
return true;
|
|
532
|
+
}
|
|
533
|
+
if (action === 'on' && !executor.configureDelegation) {
|
|
476
534
|
this.sendResponse(messageId, threadId, { success: false, error: 'This executor does not support delegation tool registration.' });
|
|
477
535
|
return true;
|
|
478
536
|
}
|
|
479
|
-
if (
|
|
480
|
-
if (
|
|
537
|
+
if (action) {
|
|
538
|
+
if (action === 'off') {
|
|
481
539
|
const thread = this.threadManager.getThread(threadId);
|
|
482
540
|
const backend = this.threadPool.getBackendKey(threadId);
|
|
483
541
|
if (thread.delegationBackends?.includes(backend) || (thread.delegation && !thread.delegationBackends)) {
|
|
@@ -489,7 +547,7 @@ class MessageHandler {
|
|
|
489
547
|
await this.delegationBridges.get(threadId)?.close();
|
|
490
548
|
this.delegationBridges.delete(threadId);
|
|
491
549
|
}
|
|
492
|
-
await this.threadManager.updateThread(threadId, { delegation:
|
|
550
|
+
await this.threadManager.updateThread(threadId, { delegation: action === 'on' });
|
|
493
551
|
}
|
|
494
552
|
const config = this.config.get('executor') ?? { type: 'auto' };
|
|
495
553
|
const backends = await this.delegation.registry.list(config);
|
|
@@ -627,7 +685,7 @@ Use /compact to reduce conversation context or /clear to start a fresh context.`
|
|
|
627
685
|
- /model [name] - Show models for the active backend, or set this thread's model
|
|
628
686
|
- /effort [auto|level] - Show or set effort for Codex/AGY/OpenCode/Kimi/ZCode/Pi (Claude Code is unsupported)
|
|
629
687
|
- /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
|
|
688
|
+
- /delegation [on|off|reset [backend]] - Delegate tasks between installed agent backends; reset saved worker context when needed
|
|
631
689
|
- /backend - List backends and show the current thread's effective backend
|
|
632
690
|
- /backend <index> - Switch all threads and clear per-thread backend overrides
|
|
633
691
|
- /backend <index> @ - Switch only the current thread
|
|
@@ -692,10 +750,17 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
692
750
|
}
|
|
693
751
|
const targetDir = parts.slice(1).join(' ');
|
|
694
752
|
try {
|
|
753
|
+
if (this.delegation.hasActiveTasks(threadId)) {
|
|
754
|
+
throw new Error('Cannot change working directory while a delegated worker is running. Wait for it to finish or send /abort first.');
|
|
755
|
+
}
|
|
756
|
+
const generation = this.threadManager.getThread(threadId)?.delegationWorkspaceGeneration ?? 0;
|
|
695
757
|
const { cwd: newCwd, changed } = await this.threadPool.setWorkingDirectory(threadId, targetDir);
|
|
758
|
+
const cleanup = changed
|
|
759
|
+
? await this.delegation.invalidateWorkspaceGeneration(threadId, generation + 1)
|
|
760
|
+
: { removed: 0, failed: 0 };
|
|
696
761
|
this.sendResponse(messageId, threadId, {
|
|
697
762
|
success: true,
|
|
698
|
-
output: `✅ Changed working directory to: ${newCwd}${changed ? '\nConversation context cleared for all backends in this thread.' : ''}`,
|
|
763
|
+
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
764
|
});
|
|
700
765
|
}
|
|
701
766
|
catch (error) {
|
|
@@ -1201,12 +1266,11 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1201
1266
|
return;
|
|
1202
1267
|
}
|
|
1203
1268
|
try {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
}
|
|
1269
|
+
await this.delegation.cancelThread(target.id);
|
|
1270
|
+
await this.delegationBridges.get(target.id)?.close();
|
|
1271
|
+
this.delegationBridges.delete(target.id);
|
|
1272
|
+
await this.delegation.deleteWorkerLanes(target.id);
|
|
1273
|
+
await this.delegation.store.deleteThread(target.id);
|
|
1210
1274
|
await this.threadPool.destroyThread(target.id);
|
|
1211
1275
|
await this.threadManager.deleteThread(target.id);
|
|
1212
1276
|
this.sendResponse(messageId, callerThreadId, {
|
|
@@ -1686,6 +1750,8 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1686
1750
|
onToolUse: tool => this.sendToolUse(messageId, threadId, tool),
|
|
1687
1751
|
onToolResult: result => this.sendToolResult(messageId, threadId, result),
|
|
1688
1752
|
onNotice: text => this.sendStreamChunk(messageId, threadId, text),
|
|
1753
|
+
onProgress: progress => this.delegationProgressSupported
|
|
1754
|
+
&& this.sendDelegationProgress(messageId, threadId, progress),
|
|
1689
1755
|
onApproval: (request, child) => this.forwardApproval(request, child, messageId, threadId, true),
|
|
1690
1756
|
onApprovalResolved: (id, status) => this.resolveApprovalCard(id, status),
|
|
1691
1757
|
isWorkspaceBusy: cwd => this.threadManager.listThreads().some(other => {
|
|
@@ -2032,6 +2098,24 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2032
2098
|
console.error('Failed to send tool result:', error);
|
|
2033
2099
|
}
|
|
2034
2100
|
}
|
|
2101
|
+
sendDelegationProgress(messageId, threadId, delegationProgress) {
|
|
2102
|
+
try {
|
|
2103
|
+
this.wsClient.send({
|
|
2104
|
+
type: 'stream',
|
|
2105
|
+
messageId,
|
|
2106
|
+
streamType: 'delegation_progress',
|
|
2107
|
+
delegationProgress,
|
|
2108
|
+
openId: this.getMessageOpenId(messageId),
|
|
2109
|
+
threadId,
|
|
2110
|
+
timestamp: Date.now(),
|
|
2111
|
+
});
|
|
2112
|
+
return true;
|
|
2113
|
+
}
|
|
2114
|
+
catch (error) {
|
|
2115
|
+
console.error('Failed to send delegated worker progress:', error);
|
|
2116
|
+
return false;
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2035
2119
|
sendRedactedThinking(messageId, threadId) {
|
|
2036
2120
|
try {
|
|
2037
2121
|
this.wsClient.send({
|