@yu_robotics/remote-cli 1.6.152 → 1.6.156
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/README.md +21 -2
- package/dist/client/MessageHandler.d.ts +3 -0
- package/dist/client/MessageHandler.d.ts.map +1 -1
- package/dist/client/MessageHandler.js +58 -20
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/client/WebSocketClient.d.ts.map +1 -1
- package/dist/client/WebSocketClient.js +1 -0
- package/dist/client/WebSocketClient.js.map +1 -1
- package/dist/delegation/BoundedFileChecks.d.ts +3 -0
- package/dist/delegation/BoundedFileChecks.d.ts.map +1 -0
- package/dist/delegation/BoundedFileChecks.js +13 -0
- package/dist/delegation/BoundedFileChecks.js.map +1 -0
- package/dist/delegation/DelegatedWorkspaceManager.d.ts.map +1 -1
- package/dist/delegation/DelegatedWorkspaceManager.js +14 -7
- package/dist/delegation/DelegatedWorkspaceManager.js.map +1 -1
- package/dist/delegation/GitCheckpoint.d.ts.map +1 -1
- package/dist/delegation/GitCheckpoint.js +49 -32
- package/dist/delegation/GitCheckpoint.js.map +1 -1
- package/dist/executor/AgyExecutor.d.ts +2 -5
- package/dist/executor/AgyExecutor.d.ts.map +1 -1
- package/dist/executor/AgyExecutor.js +13 -37
- package/dist/executor/AgyExecutor.js.map +1 -1
- package/dist/executor/CodexAppServerExecutor.d.ts +1 -0
- package/dist/executor/CodexAppServerExecutor.d.ts.map +1 -1
- package/dist/executor/CodexAppServerExecutor.js +26 -7
- package/dist/executor/CodexAppServerExecutor.js.map +1 -1
- package/dist/executor/CodexCommandActions.d.ts +2 -2
- package/dist/executor/CodexCommandActions.d.ts.map +1 -1
- package/dist/executor/CodexCommandActions.js +26 -5
- package/dist/executor/CodexCommandActions.js.map +1 -1
- package/dist/executor/agy/AgyModels.d.ts +32 -0
- package/dist/executor/agy/AgyModels.d.ts.map +1 -0
- package/dist/executor/agy/AgyModels.js +112 -0
- package/dist/executor/agy/AgyModels.js.map +1 -0
- package/dist/maintenance/release-notes.json +1 -1
- package/dist/settings/SettingsService.d.ts +5 -2
- package/dist/settings/SettingsService.d.ts.map +1 -1
- package/dist/settings/SettingsService.js +33 -11
- package/dist/settings/SettingsService.js.map +1 -1
- package/dist/types/Settings.d.ts +3 -1
- package/dist/types/Settings.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,8 @@ Router 1.6.117 and newer explicitly label standalone background-task notificatio
|
|
|
20
20
|
|
|
21
21
|
## Public Activity
|
|
22
22
|
|
|
23
|
+
From CLI 1.6.153, Codex shell calls no longer lose their label when native command actions are absent or unknown. Native reads, searches, and directory listings remain preferred. Other calls use fixed operation labels such as `Run npm command` or `Run Git command` for simple allowlisted programs, and `Run shell command` for compound or unrecognized commands. These are deterministic operation labels, not model-authored purpose summaries: installed Codex 0.160.0 command items have no per-call description field. Arguments, full paths, output, and execution-wide reasoning are never copied into these fallback labels. Late native action metadata can enrich a pending row before its first result; repeated results retain one row. Existing description fields, heading limits, and card-node counts are unchanged; upgrade the CLI, with no new Router capability required.
|
|
24
|
+
|
|
23
25
|
Router 1.6.145 combines each foreground tool call and its matching result into one collapsed row, retaining input, output, and diff previews. Independent calls, workers, and approvals remain separate. This uses the existing CLI protocol; the client does not need a new capability. See [Code Change Previews](../../README.md#code-change-previews).
|
|
24
26
|
|
|
25
27
|
Router 1.6.146 gives Bash and other foreground tools one compact heading with a gray success dot, pending hourglass, or gray failure cross, plus the tool name and an optional public description or file basename. Full tool IDs and explicit status labels remain inside the expanded details. Raw commands are not fallback headings; the existing CLI protocol is unchanged.
|
|
@@ -185,6 +187,12 @@ Linux users upgrading from version 1.6.23 or earlier should run `remote-cli serv
|
|
|
185
187
|
|
|
186
188
|
CLI and Router 1.6.152 add standalone settings cards. `/backend` lists all eight stable backend choices, disables missing installations and applies only after Confirm; Current thread is the default and All threads on this device is opt-in. `/model` and `/effort` submit native options immediately, and show applied state only after a saved-setting acknowledgement. Their target-backend selector configures future worker launches without switching the coordinator. Busy work, expired cards and changed settings require refresh; older peers and parameterized text commands retain their existing behavior. See [Model and Reasoning Effort](../../README.md#model-and-reasoning-effort).
|
|
187
189
|
|
|
190
|
+
From 1.6.154, numbered sections separate backend selection, scope and Confirm, or target backend, model/effort choices and secondary actions. Selected drafts and known preferences carry explicit checks; changing the target still never switches the coordinator. AGY model catalogs accept tab-delimited and formatted multi-space native rows, with exact IDs and explicit failures for empty, unusable or oversized responses. No inference or additional protocol capability is needed.
|
|
191
|
+
|
|
192
|
+
From Router 1.6.155, the selected backend application scope is highlighted in blue, and model/effort target selectors separate the main backend from other backends' worker preferences. Choices are shown together when the complete card fits its node and byte budgets; only oversized catalogs paginate, with headers, groups and pending/retry controls included. Viewing a target never changes the coordinator, and same-backend workers continue to share its per-thread preference. Existing CLI settings metadata is sufficient; no new capability or native request is required.
|
|
193
|
+
|
|
194
|
+
From CLI and Router 1.6.156, bare `/delegation` opens a thread-only On/Off card with a separate backend-availability section, gated by both `settingsCards` and `delegationCards`. Selection is confirmed only after cleanup and persistence succeed. Busy or queued work blocks toggles but not inspection/refresh; enabling does not bypass sandbox policy or prove authentication/quota. Parameterized toggles and `/delegation reset [backend]` remain text commands, and older peers retain the text menu.
|
|
195
|
+
|
|
188
196
|
### Threads & Machines
|
|
189
197
|
|
|
190
198
|
From CLI 1.6.121, new and existing threads without a saved preference enable
|
|
@@ -296,8 +304,19 @@ fail admission; reconcile those rules before delegating.
|
|
|
296
304
|
From CLI 1.6.151, checkpoint index queries are combined and identical trees are
|
|
297
305
|
audited once within a capture. Both working-file passes and source HEAD/index
|
|
298
306
|
checks remain; no state is cached across tasks and Git deadlines are unchanged.
|
|
299
|
-
CLI
|
|
300
|
-
|
|
307
|
+
From CLI 1.6.153, real Git fixture suites use at most two isolated processes
|
|
308
|
+
(one on hosts with fewer than four available CPUs), alongside one to four
|
|
309
|
+
lightweight test threads. Pristine test repositories are copied into independently
|
|
310
|
+
owned directories instead of rebuilt for every case. Publish still runs the full
|
|
311
|
+
suite; ordinary test deadlines and production Git safety checks are unchanged.
|
|
312
|
+
From 1.6.154, filesystem checks run in batches of at most eight and drain before
|
|
313
|
+
failure; checkout readers still hash every byte with independent buffers up to
|
|
314
|
+
1 MiB each. Test-only clocks remove mocked startup/stop and transfer-deadline
|
|
315
|
+
waits after readiness gates; real Git streams, partial packs, cleanup assertions,
|
|
316
|
+
129 MiB files and 10,001-file stress coverage remain. ZIP fixtures use faster
|
|
317
|
+
CRC generation without changing archive bytes. Hosts with at least eight
|
|
318
|
+
available CPUs use at most four isolated Git processes plus at most four
|
|
319
|
+
lightweight threads; lower-core pool limits and ordinary deadlines are unchanged.
|
|
301
320
|
|
|
302
321
|
From CLI 1.6.140, managed Git preparation, repository-lock waits, and artifact
|
|
303
322
|
collection are awaited separately from native startup/stop deadlines. Slots and
|
|
@@ -43,6 +43,7 @@ export declare class MessageHandler {
|
|
|
43
43
|
private activityProgressSupported;
|
|
44
44
|
private workerContextResetSupported;
|
|
45
45
|
private settingsCardsSupported;
|
|
46
|
+
private delegationCardsSupported;
|
|
46
47
|
private readonly settingsAdmission;
|
|
47
48
|
private readonly settingsCatalogReader;
|
|
48
49
|
private readonly settingsService;
|
|
@@ -186,6 +187,8 @@ export declare class MessageHandler {
|
|
|
186
187
|
private settingsState;
|
|
187
188
|
private settingsBusy;
|
|
188
189
|
private settingsFallback;
|
|
190
|
+
/** Shared delegation cleanup/persistence for cards and parameterized text commands. */
|
|
191
|
+
private applyDelegationSetting;
|
|
189
192
|
/** Shared native/persistent mutation for cards and parameterized text commands. */
|
|
190
193
|
private applyPreference;
|
|
191
194
|
private applyBackendSetting;
|
|
@@ -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;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;IAI3B,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,sBAAsB;IAuB9B,iFAAiF;IACjF,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,YAAY;IAmDpB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,gBAAgB;IAYxB,uFAAuF;YACzE,sBAAsB;IAsBpC,mFAAmF;YACrE,eAAe;YA2Cf,mBAAmB;IAuBjC,OAAO,CAAC,YAAY;YAUN,cAAc;YAuBd,oBAAoB;IAgHlC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAe/B"}
|
|
@@ -117,6 +117,7 @@ class MessageHandler {
|
|
|
117
117
|
activityProgressSupported = false;
|
|
118
118
|
workerContextResetSupported = false;
|
|
119
119
|
settingsCardsSupported = false;
|
|
120
|
+
delegationCardsSupported = false;
|
|
120
121
|
settingsAdmission = new SettingsAdmission_1.SettingsAdmission();
|
|
121
122
|
settingsCatalogReader;
|
|
122
123
|
settingsService;
|
|
@@ -135,7 +136,17 @@ class MessageHandler {
|
|
|
135
136
|
this.settingsCatalogReader = new SettingsCatalog_1.SettingsCatalogReader(directoryGuard);
|
|
136
137
|
this.settingsService = new SettingsService_1.SettingsService({
|
|
137
138
|
state: id => this.settingsState(id),
|
|
138
|
-
backends: async (
|
|
139
|
+
backends: async (id, kind) => {
|
|
140
|
+
if (kind !== 'delegation' || !id)
|
|
141
|
+
return (await this.detectBackends()).map(entry => ({ ...entry, value: (0, config_1.backendKeyOf)(entry.id) }));
|
|
142
|
+
const config = this.executorConfiguration();
|
|
143
|
+
const coordinator = this.threadPool.getBackendKey(id);
|
|
144
|
+
return (await this.delegation.registry.list(config)).map(item => {
|
|
145
|
+
const entry = (0, WorkerPolicy_1.workerAvailability)(config, this.directoryGuard, id, coordinator, item);
|
|
146
|
+
return { value: entry.backend, label: backendDisplayName(entry.backend), installed: entry.installed,
|
|
147
|
+
worker: entry.worker, version: entry.version, reason: entry.reason };
|
|
148
|
+
});
|
|
149
|
+
},
|
|
139
150
|
catalog: async (id, target, kind) => {
|
|
140
151
|
const thread = this.threadManager.getThread(id);
|
|
141
152
|
if (!thread)
|
|
@@ -157,6 +168,8 @@ class MessageHandler {
|
|
|
157
168
|
},
|
|
158
169
|
backend: (id, target, scope, follow) => this.applyBackendSetting(id, target, scope, follow),
|
|
159
170
|
preference: (id, target, kind, value) => this.applyPreference(id, target, kind, value),
|
|
171
|
+
delegation: (id, enabled) => this.applyDelegationSetting(id, enabled),
|
|
172
|
+
delegationSupported: id => Boolean(this.threadPool.getExecutor(id).configureDelegation),
|
|
160
173
|
});
|
|
161
174
|
this.wsClient.onClose?.(() => this.settingsService.invalidate());
|
|
162
175
|
this.notificationAdapter = new hooks_1.FeishuNotificationAdapter(wsClient);
|
|
@@ -197,7 +210,7 @@ class MessageHandler {
|
|
|
197
210
|
return;
|
|
198
211
|
case 'settings_action':
|
|
199
212
|
if (this.settingsCardsSupported) {
|
|
200
|
-
const result = await this.settingsService.action(message);
|
|
213
|
+
const result = await this.settingsService.action(message, this.delegationCardsSupported);
|
|
201
214
|
this.wsClient.send(result);
|
|
202
215
|
}
|
|
203
216
|
return;
|
|
@@ -242,6 +255,7 @@ class MessageHandler {
|
|
|
242
255
|
this.delegationProgressSupported = data.capabilities?.delegationProgress === true;
|
|
243
256
|
this.workerContextResetSupported = this.delegationProgressSupported && data.capabilities?.workerContextReset === true;
|
|
244
257
|
this.settingsCardsSupported = data.capabilities?.settingsCards === true;
|
|
258
|
+
this.delegationCardsSupported = this.settingsCardsSupported && data.capabilities?.delegationCards === true;
|
|
245
259
|
this.delegationProgressTextSupported = this.delegationProgressSupported
|
|
246
260
|
&& data.capabilities?.delegationProgressText === true;
|
|
247
261
|
for (const pending of this.pendingApprovalCards.values()) {
|
|
@@ -343,7 +357,9 @@ class MessageHandler {
|
|
|
343
357
|
});
|
|
344
358
|
return;
|
|
345
359
|
}
|
|
346
|
-
|
|
360
|
+
const settingsCommand = content?.trim() ?? '';
|
|
361
|
+
if (this.settingsCardsSupported && openId && (/^\/(?:backend|model|effort)$/.test(settingsCommand)
|
|
362
|
+
|| (this.delegationCardsSupported && settingsCommand === '/delegation'))) {
|
|
347
363
|
const kind = content.trim().slice(1);
|
|
348
364
|
try {
|
|
349
365
|
const menu = await this.settingsService.open(kind, resolvedThreadId, openId, undefined, messageId);
|
|
@@ -741,20 +757,11 @@ class MessageHandler {
|
|
|
741
757
|
return true;
|
|
742
758
|
}
|
|
743
759
|
if (action) {
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
if (thread.delegationBackends?.includes(backend) || (thread.delegation === true && !thread.delegationBackends)) {
|
|
749
|
-
await executor.configureDelegation?.(undefined);
|
|
750
|
-
// Preserve cleanup ownership across process recreation and backend switches.
|
|
751
|
-
if (!thread.delegationBackends)
|
|
752
|
-
await this.threadManager.updateThread(threadId, { delegationBackends: [backend] });
|
|
753
|
-
}
|
|
754
|
-
await this.delegationBridges.get(threadId)?.close();
|
|
755
|
-
this.delegationBridges.delete(threadId);
|
|
760
|
+
const applied = await this.applyDelegationSetting(threadId, action === 'on');
|
|
761
|
+
if (!applied.success) {
|
|
762
|
+
this.sendResponse(messageId, threadId, applied);
|
|
763
|
+
return true;
|
|
756
764
|
}
|
|
757
|
-
await this.threadManager.updateThread(threadId, { delegation: action === 'on' });
|
|
758
765
|
}
|
|
759
766
|
const config = this.config.get('executor') ?? { type: 'auto' };
|
|
760
767
|
const backends = await this.delegation.registry.list(config);
|
|
@@ -2523,7 +2530,8 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2523
2530
|
threads: result.threads,
|
|
2524
2531
|
queueConfirmation: result.queueConfirmation,
|
|
2525
2532
|
...(result.executionMetadata ? { executionMetadata: result.executionMetadata } : {}),
|
|
2526
|
-
...(this.settingsCardsSupported && result.settingsMenu
|
|
2533
|
+
...(this.settingsCardsSupported && result.settingsMenu
|
|
2534
|
+
&& (result.settingsMenu.kind !== 'delegation' || this.delegationCardsSupported) ? { settingsMenu: result.settingsMenu } : {}),
|
|
2527
2535
|
cwd,
|
|
2528
2536
|
timestamp: Date.now(),
|
|
2529
2537
|
});
|
|
@@ -2543,13 +2551,13 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2543
2551
|
return undefined;
|
|
2544
2552
|
const projection = (entry) => ({ id: entry.id, backend: entry.backend,
|
|
2545
2553
|
cwd: entry.workingDirectory, generation: entry.delegationWorkspaceGeneration, model: entry.model,
|
|
2546
|
-
models: entry.models, efforts: entry.efforts });
|
|
2554
|
+
models: entry.models, efforts: entry.efforts, delegation: entry.delegation, delegationBackends: entry.delegationBackends });
|
|
2547
2555
|
const all = this.threadManager.listThreads().map(projection).sort((a, b) => a.id.localeCompare(b.id));
|
|
2548
2556
|
const configuredModels = { ...thread.models };
|
|
2549
2557
|
if (configuredModels.claude === undefined && thread.model)
|
|
2550
2558
|
configuredModels.claude = thread.model;
|
|
2551
2559
|
return { threadId, threadName: thread.name, coordinatorBackend: this.threadPool.getBackendKey(threadId),
|
|
2552
|
-
followsGlobal: !thread.backend, configuredModels, configuredEfforts: { ...thread.efforts },
|
|
2560
|
+
followsGlobal: !thread.backend, configuredModels, configuredEfforts: { ...thread.efforts }, delegationEnabled: (0, DelegationSettings_1.isDelegationEnabled)(thread),
|
|
2553
2561
|
revision: (0, crypto_1.createHash)('sha256').update(JSON.stringify({ thread: projection(thread), all, config: this.executorConfiguration() })).digest('hex') };
|
|
2554
2562
|
}
|
|
2555
2563
|
settingsBusy(threadId, exceptRequest, includeQueue = true) {
|
|
@@ -2558,7 +2566,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2558
2566
|
|| this.settingsAdmission.hasCommand(threadId, exceptRequest) || (includeQueue && this.hasThreadQueueState(threadId));
|
|
2559
2567
|
}
|
|
2560
2568
|
settingsFallback(menu) {
|
|
2561
|
-
const lines = [`${menu.kind === 'backend' ? 'Backend' : menu.kind === 'model' ? 'Model' : 'Reasoning effort'} settings`,
|
|
2569
|
+
const lines = [`${menu.kind === 'backend' ? 'Backend' : menu.kind === 'model' ? 'Model' : menu.kind === 'delegation' ? 'Delegation' : 'Reasoning effort'} settings`,
|
|
2562
2570
|
`Thread: ${menu.threadName}`, `Target backend: ${menu.targetBackend}`,
|
|
2563
2571
|
`Configured: ${menu.configuredValue ?? 'default'}`, `Effective: ${menu.effectiveValue ?? 'not reported'} (${menu.effectiveSource})`];
|
|
2564
2572
|
if (menu.unavailableReason)
|
|
@@ -2567,10 +2575,40 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2567
2575
|
lines.push(`${choice.label}${choice.disabled ? ' (unavailable)' : ''}`);
|
|
2568
2576
|
if (menu.kind === 'backend')
|
|
2569
2577
|
lines.push('Card scope defaults to Current thread. Confirm to apply. Text commands: /backend <index> @ (current), /backend <index> (all).');
|
|
2578
|
+
else if (menu.kind === 'delegation')
|
|
2579
|
+
lines.push('Applies only to this thread. Text commands: /delegation on or /delegation off.');
|
|
2570
2580
|
else
|
|
2571
2581
|
lines.push(`Use the card buttons, or /${menu.kind} <value> for the active backend.`);
|
|
2572
2582
|
return lines.join('\n');
|
|
2573
2583
|
}
|
|
2584
|
+
/** Shared delegation cleanup/persistence for cards and parameterized text commands. */
|
|
2585
|
+
async applyDelegationSetting(threadId, enabled) {
|
|
2586
|
+
const thread = this.threadManager.getThread(threadId);
|
|
2587
|
+
if (!thread)
|
|
2588
|
+
return { success: false, error: 'This thread no longer exists.' };
|
|
2589
|
+
const executor = this.threadPool.getExecutor(threadId);
|
|
2590
|
+
if (enabled && !executor.configureDelegation)
|
|
2591
|
+
return { success: false, error: 'This executor does not support delegation tool registration.' };
|
|
2592
|
+
try {
|
|
2593
|
+
if (!enabled) {
|
|
2594
|
+
const backend = this.threadPool.getBackendKey(threadId);
|
|
2595
|
+
// An inherited enabled default does not mean tools were registered.
|
|
2596
|
+
if (thread.delegationBackends?.includes(backend) || (thread.delegation === true && !thread.delegationBackends)) {
|
|
2597
|
+
await executor.configureDelegation?.(undefined);
|
|
2598
|
+
// Keep ownership so inactive backends are cleaned when next resumed.
|
|
2599
|
+
if (!thread.delegationBackends)
|
|
2600
|
+
await this.threadManager.updateThread(threadId, { delegationBackends: [backend] });
|
|
2601
|
+
}
|
|
2602
|
+
await this.delegationBridges.get(threadId)?.close();
|
|
2603
|
+
this.delegationBridges.delete(threadId);
|
|
2604
|
+
}
|
|
2605
|
+
await this.threadManager.updateThread(threadId, { delegation: enabled });
|
|
2606
|
+
return { success: true, output: `Delegation ${enabled ? 'enabled' : 'disabled'} for this thread.` };
|
|
2607
|
+
}
|
|
2608
|
+
finally {
|
|
2609
|
+
this.settingsService.invalidate(threadId);
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2574
2612
|
/** Shared native/persistent mutation for cards and parameterized text commands. */
|
|
2575
2613
|
async applyPreference(threadId, backend, kind, value, onStream) {
|
|
2576
2614
|
const thread = this.threadManager.getThread(threadId);
|