@yu_robotics/remote-cli 1.6.236 → 1.6.237
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.map +1 -1
- package/dist/client/MessageHandler.js +65 -14
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts +35 -5
- package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.js +437 -69
- package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
- package/dist/executor/IExecutor.d.ts +8 -0
- package/dist/executor/IExecutor.d.ts.map +1 -1
- package/dist/executor/claude/TurnLedger.d.ts +33 -0
- package/dist/executor/claude/TurnLedger.d.ts.map +1 -0
- package/dist/executor/claude/TurnLedger.js +126 -0
- package/dist/executor/claude/TurnLedger.js.map +1 -0
- package/dist/maintenance/release-notes.json +1 -1
- package/dist/managed/ManagedToolBridge.d.ts +4 -1
- package/dist/managed/ManagedToolBridge.d.ts.map +1 -1
- package/dist/managed/ManagedToolBridge.js +17 -2
- package/dist/managed/ManagedToolBridge.js.map +1 -1
- package/dist/scheduling/ScheduleService.d.ts +2 -0
- package/dist/scheduling/ScheduleService.d.ts.map +1 -1
- package/dist/scheduling/ScheduleService.js +13 -0
- package/dist/scheduling/ScheduleService.js.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts +3 -0
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.js +32 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.js.map +1 -1
- package/native/prebuilds/darwin-arm64/managed_native.node +0 -0
- package/native/prebuilds/darwin-arm64/manifest.json +1 -1
- package/native/prebuilds/darwin-x64/managed_native.node +0 -0
- package/native/prebuilds/darwin-x64/manifest.json +1 -1
- package/native/prebuilds/win32-arm64/managed_native.node +0 -0
- package/native/prebuilds/win32-arm64/manifest.json +1 -1
- package/native/prebuilds/win32-x64/managed_native.node +0 -0
- package/native/prebuilds/win32-x64/manifest.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageHandler.d.ts","sourceRoot":"","sources":["../../src/client/MessageHandler.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAQpD,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;AAOxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAmIxD;;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,MAAM,CAAC;CACpB;AAsBD,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,mBAAmB,CAA4B;IACvD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAA0C;IACjE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsC;IACnE,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA+C;IACzF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqB;IAClD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyC;IACxE,qEAAqE;I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erB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,gBAAgB;IAYxB,uFAAuF;YACzE,sBAAsB;IAsBpC,mFAAmF;YACrE,eAAe;YAuDf,mBAAmB;IA0BjC,OAAO,CAAC,YAAY;YAUN,cAAc;YAuBd,oBAAoB;IAgHlC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAiC/B"}
|
|
@@ -1011,6 +1011,11 @@ class MessageHandler {
|
|
|
1011
1011
|
const existingAbort = this.abortOperations.get(threadId);
|
|
1012
1012
|
if (existingAbort) {
|
|
1013
1013
|
await existingAbort;
|
|
1014
|
+
if (executor?.hasPendingCancellation?.()) {
|
|
1015
|
+
this.sendResponse(messageId, threadId, { success: false,
|
|
1016
|
+
error: 'Native cancellation cleanup remains pending. Retry /abort, or use /clear to stop the host and lose its session-only schedules.' });
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1014
1019
|
if (executor?.hasUncertainShutdown?.()) {
|
|
1015
1020
|
this.sendResponse(messageId, threadId, {
|
|
1016
1021
|
success: false,
|
|
@@ -1034,7 +1039,10 @@ class MessageHandler {
|
|
|
1034
1039
|
const wasExecuting = this.threadPool.isThreadBusy(threadId);
|
|
1035
1040
|
const clearedCount = this.clearThreadQueue(threadId);
|
|
1036
1041
|
const activeOperation = this.cancelThreadOperation(threadId);
|
|
1037
|
-
|
|
1042
|
+
if (executor?.preservesProcessOnAbort?.())
|
|
1043
|
+
this.delegationBridges.get(threadId)?.retireCurrentActivation();
|
|
1044
|
+
else
|
|
1045
|
+
this.detachDelegationBridge(threadId);
|
|
1038
1046
|
for (const [id, approval] of this.pendingApprovalCards) {
|
|
1039
1047
|
if (approval.request.threadId === threadId)
|
|
1040
1048
|
this.resolveApprovalCard(id, 'expired');
|
|
@@ -1078,7 +1086,7 @@ class MessageHandler {
|
|
|
1078
1086
|
this.threadPool.setThreadBusy(threadId, false);
|
|
1079
1087
|
this.sendResponse(messageId, threadId, {
|
|
1080
1088
|
success: true,
|
|
1081
|
-
output: `${wasExecuting ? '✅ Current command has been aborted' : '⚠️ No command was executing, but executor has been reset'}${clearedCount ? `\n🗑️ Cleared ${clearedCount} queued message${clearedCount === 1 ? '' : 's'}.` : ''}`,
|
|
1089
|
+
output: `${executor?.abortStatusMessage?.() ?? (wasExecuting ? '✅ Current command has been aborted' : '⚠️ No command was executing, but executor has been reset')}${clearedCount ? `\n🗑️ Cleared ${clearedCount} queued message${clearedCount === 1 ? '' : 's'}.` : ''}`,
|
|
1082
1090
|
});
|
|
1083
1091
|
}
|
|
1084
1092
|
else {
|
|
@@ -1145,12 +1153,15 @@ class MessageHandler {
|
|
|
1145
1153
|
const bridge = this.delegationBridges.get(threadId);
|
|
1146
1154
|
if (!bridge)
|
|
1147
1155
|
return;
|
|
1148
|
-
bridge.activate(undefined);
|
|
1149
1156
|
this.delegationBridges.delete(threadId);
|
|
1150
1157
|
void bridge.close().catch(() => undefined);
|
|
1151
1158
|
}
|
|
1152
1159
|
async clearThreadConversation(messageId, threadId) {
|
|
1153
|
-
|
|
1160
|
+
if (this.abortOperations.has(threadId))
|
|
1161
|
+
throw new Error('Direct backend abort is still pending; retry /clear after it settles.');
|
|
1162
|
+
const destructiveRecovery = this.threadPool.getExistingExecutor(threadId)?.hasPendingCancellation?.() === true;
|
|
1163
|
+
if (!destructiveRecovery)
|
|
1164
|
+
await this.assertSchedulesIdle(threadId);
|
|
1154
1165
|
this.conversationRevisions.set(threadId, (this.conversationRevisions.get(threadId) ?? 0) + 1);
|
|
1155
1166
|
this.settingsService.invalidate(threadId);
|
|
1156
1167
|
this.directoryBrowser.invalidate(threadId);
|
|
@@ -1177,7 +1188,10 @@ class MessageHandler {
|
|
|
1177
1188
|
throw new Error('Direct backend abort is still pending; retry after it settles');
|
|
1178
1189
|
const executor = this.threadPool.getExistingExecutor(threadId);
|
|
1179
1190
|
if (executor) {
|
|
1180
|
-
|
|
1191
|
+
if (executor.stopForContextReset)
|
|
1192
|
+
await executor.stopForContextReset();
|
|
1193
|
+
else
|
|
1194
|
+
await executor.abort();
|
|
1181
1195
|
if (executor.hasUncertainShutdown?.())
|
|
1182
1196
|
throw new Error('Direct backend shutdown is unconfirmed');
|
|
1183
1197
|
}
|
|
@@ -1191,7 +1205,7 @@ class MessageHandler {
|
|
|
1191
1205
|
this.threadPool.setThreadBusy(threadId, false);
|
|
1192
1206
|
await workers;
|
|
1193
1207
|
this.sendResponse(messageId, threadId, { success: true,
|
|
1194
|
-
output: 'Started a fresh conversation for direct backends and managed workers. Permanent deletion of old managed child native sessions is queued. Verified Codex, Kimi, Pi, and Claude child sessions are supported on Linux; unsupported versions, layouts, backends, platforms, and unconfirmed targets remain pending. Task artifacts and recovery evidence are retained. Pending native writers still block conflicting execution
|
|
1208
|
+
output: `${destructiveRecovery ? 'Explicit recovery stopped the Claude host; its session-only schedules were lost. ' : ''}Started a fresh conversation for direct backends and managed workers. Permanent deletion of old managed child native sessions is queued. Verified Codex, Kimi, Pi, and Claude child sessions are supported on Linux; unsupported versions, layouts, backends, platforms, and unconfirmed targets remain pending. Task artifacts and recovery evidence are retained. Pending native writers still block conflicting execution.` }, true);
|
|
1195
1209
|
}
|
|
1196
1210
|
catch (error) {
|
|
1197
1211
|
const detail = error instanceof Error ? error.message : 'Local context storage is unavailable';
|
|
@@ -2255,6 +2269,8 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2255
2269
|
}
|
|
2256
2270
|
if (executor.hasUncertainShutdown?.())
|
|
2257
2271
|
throw new Error('Direct backend shutdown is unconfirmed. Retry /abort or /clear before sending more work.');
|
|
2272
|
+
if (executor.hasPendingCancellation?.())
|
|
2273
|
+
throw new Error('Native cancellation cleanup is pending. Retry /abort or use /clear (session-only schedules will be lost).');
|
|
2258
2274
|
await this.delegation.assertExecutionSafe(executor.getCurrentWorkingDirectory(), threadId);
|
|
2259
2275
|
if (this.isDestroyed || this.abortOperations.has(threadId) || (token &&
|
|
2260
2276
|
(this.cancelledOperations.has(token) || this.activeThreadOperations.get(threadId)?.token !== token))) {
|
|
@@ -2403,6 +2419,8 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2403
2419
|
}
|
|
2404
2420
|
if (executor.hasUncertainShutdown?.())
|
|
2405
2421
|
throw new Error('Direct backend shutdown is unconfirmed. Retry /abort or /clear before sending more work.');
|
|
2422
|
+
if (executor.hasPendingCancellation?.())
|
|
2423
|
+
throw new Error('Native cancellation cleanup is pending. Retry /abort or use /clear (session-only schedules will be lost).');
|
|
2406
2424
|
this.pendingOutputFiles.invalidateThread(threadId);
|
|
2407
2425
|
const conversationRevision = this.conversationRevisions.get(threadId) ?? 0;
|
|
2408
2426
|
const operationToken = this.activeThreadOperations.get(threadId)?.token;
|
|
@@ -2423,6 +2441,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2423
2441
|
let scheduleScope;
|
|
2424
2442
|
let clearScheduleModelOverride;
|
|
2425
2443
|
let delegationBridge;
|
|
2444
|
+
let retireActivation;
|
|
2426
2445
|
let executionMetadata;
|
|
2427
2446
|
let requestFinished = false;
|
|
2428
2447
|
let imageDelivery;
|
|
@@ -2464,7 +2483,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2464
2483
|
this.imageDeliveries.delete(threadId);
|
|
2465
2484
|
requestFinished = true;
|
|
2466
2485
|
activity.dispose();
|
|
2467
|
-
|
|
2486
|
+
retireActivation?.();
|
|
2468
2487
|
const retained = !success && delegationScope && !delegationScope.isClosed()
|
|
2469
2488
|
&& !this.isDestroyed && !this.abortOperations.has(threadId)
|
|
2470
2489
|
? delegationScope.getRetainedResults() : [];
|
|
@@ -2754,7 +2773,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2754
2773
|
scope?.beginExecution(continuationResults.map(task => task.taskId));
|
|
2755
2774
|
const launchRevision = scope?.getLaunchRevision();
|
|
2756
2775
|
if (scope || scheduleScope)
|
|
2757
|
-
delegationBridge?.activate((name, args, callId) => {
|
|
2776
|
+
retireActivation = delegationBridge?.activate((name, args, callId) => {
|
|
2758
2777
|
if (!active || !isCurrent())
|
|
2759
2778
|
return Promise.reject(new Error('The coordinator execution has ended'));
|
|
2760
2779
|
if (name.startsWith('remote_cli_schedule_') && scheduleScope)
|
|
@@ -2843,7 +2862,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2843
2862
|
active = false;
|
|
2844
2863
|
executionActive = false;
|
|
2845
2864
|
activity.clear();
|
|
2846
|
-
|
|
2865
|
+
retireActivation?.();
|
|
2847
2866
|
assertCoordinatorActive();
|
|
2848
2867
|
scope?.finishExecution(result.success);
|
|
2849
2868
|
finished = true;
|
|
@@ -2881,7 +2900,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2881
2900
|
active = false;
|
|
2882
2901
|
executionActive = false;
|
|
2883
2902
|
activity.clear();
|
|
2884
|
-
|
|
2903
|
+
retireActivation?.();
|
|
2885
2904
|
if (!finished)
|
|
2886
2905
|
scope?.finishExecution(false);
|
|
2887
2906
|
// Goal activation mutates durable native state; never replay it as a model retry.
|
|
@@ -2934,7 +2953,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2934
2953
|
}
|
|
2935
2954
|
if (!delegationScope || !result.success)
|
|
2936
2955
|
return complete(result.success, result.error);
|
|
2937
|
-
|
|
2956
|
+
retireActivation?.();
|
|
2938
2957
|
if (delegationScope.hasPendingResults())
|
|
2939
2958
|
showState('Waiting for worker results');
|
|
2940
2959
|
const results = await delegationScope.collectPendingResults();
|
|
@@ -2980,7 +2999,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2980
2999
|
finally {
|
|
2981
3000
|
finishPreparation();
|
|
2982
3001
|
await scheduleScope?.close();
|
|
2983
|
-
|
|
3002
|
+
retireActivation?.();
|
|
2984
3003
|
if (delegationBridge && this.delegationBridges.get(threadId) !== delegationBridge) {
|
|
2985
3004
|
void delegationBridge.close().catch(() => undefined);
|
|
2986
3005
|
}
|
|
@@ -3471,6 +3490,11 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3471
3490
|
const check = () => { if (!current() || this.automaticUpdateInProgress)
|
|
3472
3491
|
throw new Error('Scheduling context changed or client is shutting down/updating.'); };
|
|
3473
3492
|
check();
|
|
3493
|
+
if (command.kind === 'list' && this.threadPool.getExistingExecutor(owner.threadId)?.hasPendingCancellation?.()) {
|
|
3494
|
+
const service = await this.initializeSchedules();
|
|
3495
|
+
check();
|
|
3496
|
+
return service.list(owner); // Catalog-only recovery visibility; never acquire native management admission.
|
|
3497
|
+
}
|
|
3474
3498
|
if (!nativeBound && this.scheduleManagement.has(owner.threadId))
|
|
3475
3499
|
throw new Error('A schedule operation is already in progress for this thread.');
|
|
3476
3500
|
this.scheduleManagement.add(owner.threadId);
|
|
@@ -3500,7 +3524,31 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3500
3524
|
await executor.configureManagedTools(connection);
|
|
3501
3525
|
check();
|
|
3502
3526
|
}
|
|
3503
|
-
|
|
3527
|
+
const records = await executor.withNativeScheduleOperation(id, current, () => this.runScheduleOperation(owner, command, id, context, true), !!context);
|
|
3528
|
+
if (command.kind === 'create' && !current()) {
|
|
3529
|
+
const cleanupCurrent = () => {
|
|
3530
|
+
try {
|
|
3531
|
+
return !this.isDestroyed && this.scheduleGeneration(owner.threadId) === owner.generation
|
|
3532
|
+
&& this.threadPool.getExistingExecutor(owner.threadId) === executor;
|
|
3533
|
+
}
|
|
3534
|
+
catch {
|
|
3535
|
+
return false;
|
|
3536
|
+
}
|
|
3537
|
+
};
|
|
3538
|
+
const service = await this.initializeSchedules();
|
|
3539
|
+
try {
|
|
3540
|
+
if (!executor.reconcileNativeSchedule) {
|
|
3541
|
+
throw new Error(`Schedule ${id} requires explicit cancellation; native cleanup admission is unavailable.`);
|
|
3542
|
+
}
|
|
3543
|
+
await executor.reconcileNativeSchedule(id, cleanupCurrent, () => service.cancel(owner, id));
|
|
3544
|
+
}
|
|
3545
|
+
catch (error) {
|
|
3546
|
+
await service.retainCleanupError(owner, id, error);
|
|
3547
|
+
throw error;
|
|
3548
|
+
}
|
|
3549
|
+
throw new Error('Scheduling context retired during creation. Inspect /schedule list for the final task state.');
|
|
3550
|
+
}
|
|
3551
|
+
return records;
|
|
3504
3552
|
}
|
|
3505
3553
|
const service = await this.initializeSchedules();
|
|
3506
3554
|
check();
|
|
@@ -3540,7 +3588,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3540
3588
|
command: config[backend]?.command,
|
|
3541
3589
|
model: context ? context.model : thread.models?.[backend] ?? (backend === 'claude' ? thread.model || undefined : config.dsh?.model),
|
|
3542
3590
|
effort: context ? context.effort : thread.efforts?.[backend] });
|
|
3543
|
-
if (!current()) {
|
|
3591
|
+
if (!current() && !nativeBound) {
|
|
3544
3592
|
await service.cancel(owner, record.id);
|
|
3545
3593
|
throw new Error('Scheduling context retired during creation; the native task was cancelled.');
|
|
3546
3594
|
}
|
|
@@ -3585,6 +3633,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3585
3633
|
throw new Error('Use /cd first and include a self-contained text prompt. Schedule commands do not accept attachments or directory overrides.');
|
|
3586
3634
|
}
|
|
3587
3635
|
const owner = { threadId, openId: message.openId, generation: this.scheduleGeneration(threadId) };
|
|
3636
|
+
const storedOnly = command.kind === 'list' && this.threadPool.getExistingExecutor(threadId)?.hasPendingCancellation?.();
|
|
3588
3637
|
const records = await this.runScheduleOperation(owner, command.kind === 'list' ? { kind: 'list' } : command);
|
|
3589
3638
|
const record = records[0];
|
|
3590
3639
|
let output;
|
|
@@ -3598,6 +3647,8 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3598
3647
|
: 'Native job storage is isolated and is never automatically reopened after process exit.';
|
|
3599
3648
|
output = `Schedule ${record.id}: ${record.state}.\n${record.rule.kind === 'once' ? record.rule.at : `${record.rule.expression} (${record.rule.timezone})`}\n\nRuns in this thread's foreground ${ScheduleCapabilities_1.NATIVE_SCHEDULE_CAPABILITIES[record.backend].label} conversation and returns results here. Keep the CLI running; native timing is approximate. ${lifecycle}\nUse /schedule list or /schedule cancel ${record.id}.`;
|
|
3600
3649
|
}
|
|
3650
|
+
if (storedOnly)
|
|
3651
|
+
output = `Native cancellation cleanup is pending. This is the stored catalog, not a fresh native inventory. Retry /abort; /clear stops the host and loses session-only schedules.\n\n${output}`;
|
|
3601
3652
|
respond({ success: true, scheduleMenu: menuFor(owner, records), output });
|
|
3602
3653
|
}
|
|
3603
3654
|
catch (error) {
|