@yu_robotics/remote-cli 1.6.253 → 1.6.255
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/WebSocketClient.d.ts +0 -3
- package/dist/client/WebSocketClient.d.ts.map +1 -1
- package/dist/client/WebSocketClient.js +1 -3
- package/dist/client/WebSocketClient.js.map +1 -1
- package/dist/commands/start.d.ts +0 -5
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +0 -25
- package/dist/commands/start.js.map +1 -1
- package/dist/executor/AgyExecutor.js +3 -3
- package/dist/executor/AgyExecutor.js.map +1 -1
- package/dist/executor/IExecutor.d.ts +1 -1
- package/dist/executor/IExecutor.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/maintenance/release-notes.json +1 -1
- package/dist/scheduling/ScheduleService.d.ts +0 -15
- package/dist/scheduling/ScheduleService.d.ts.map +1 -1
- package/dist/scheduling/ScheduleService.js +8 -92
- package/dist/scheduling/ScheduleService.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
- package/dist/service/SessionHostSupervisor.d.ts +0 -63
- package/dist/service/SessionHostSupervisor.d.ts.map +0 -1
- package/dist/service/SessionHostSupervisor.js +0 -323
- package/dist/service/SessionHostSupervisor.js.map +0 -1
- package/dist/sessionHost/HostClient.d.ts +0 -49
- package/dist/sessionHost/HostClient.d.ts.map +0 -1
- package/dist/sessionHost/HostClient.js +0 -101
- package/dist/sessionHost/HostClient.js.map +0 -1
- package/dist/sessionHost/HostProtocol.d.ts +0 -65
- package/dist/sessionHost/HostProtocol.d.ts.map +0 -1
- package/dist/sessionHost/HostProtocol.js +0 -78
- package/dist/sessionHost/HostProtocol.js.map +0 -1
- package/dist/sessionHost/HostServer.d.ts +0 -52
- package/dist/sessionHost/HostServer.d.ts.map +0 -1
- package/dist/sessionHost/HostServer.js +0 -413
- package/dist/sessionHost/HostServer.js.map +0 -1
- package/dist/sessionHost/HostStore.d.ts +0 -43
- package/dist/sessionHost/HostStore.d.ts.map +0 -1
- package/dist/sessionHost/HostStore.js +0 -206
- package/dist/sessionHost/HostStore.js.map +0 -1
- package/dist/sessionHost/RetainedFrontend.d.ts +0 -63
- package/dist/sessionHost/RetainedFrontend.d.ts.map +0 -1
- package/dist/sessionHost/RetainedFrontend.js +0 -244
- package/dist/sessionHost/RetainedFrontend.js.map +0 -1
- package/dist/sessionHost/RetainedHostLauncher.d.ts +0 -25
- package/dist/sessionHost/RetainedHostLauncher.d.ts.map +0 -1
- package/dist/sessionHost/RetainedHostLauncher.js +0 -132
- package/dist/sessionHost/RetainedHostLauncher.js.map +0 -1
- package/dist/sessionHost/RetainedRuntime.d.ts +0 -62
- package/dist/sessionHost/RetainedRuntime.d.ts.map +0 -1
- package/dist/sessionHost/RetainedRuntime.js +0 -478
- package/dist/sessionHost/RetainedRuntime.js.map +0 -1
- package/dist/sessionHost/RuntimeJournal.d.ts +0 -47
- package/dist/sessionHost/RuntimeJournal.d.ts.map +0 -1
- package/dist/sessionHost/RuntimeJournal.js +0 -103
- package/dist/sessionHost/RuntimeJournal.js.map +0 -1
- package/dist/sessionHost/entry.d.ts +0 -13
- package/dist/sessionHost/entry.d.ts.map +0 -1
- package/dist/sessionHost/entry.js +0 -107
- package/dist/sessionHost/entry.js.map +0 -1
- package/dist/update/PinnedHostBundle.d.ts +0 -49
- package/dist/update/PinnedHostBundle.d.ts.map +0 -1
- package/dist/update/PinnedHostBundle.js +0 -309
- package/dist/update/PinnedHostBundle.js.map +0 -1
|
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,GAAG,IAAI;IAwB/C,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAK3D,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAS3C,KAAK,IAAI,IAAI;IAEb,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,QAAQ;IAmChB,OAAO,CAAC,eAAe;CAWxB"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HostStore = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const crypto_1 = require("crypto");
|
|
10
|
-
const OwnershipRuntime_1 = require("../delegation/OwnershipRuntime");
|
|
11
|
-
const HostProtocol_1 = require("./HostProtocol");
|
|
12
|
-
/** Synchronous, bounded transactions: no await can interleave acceptance and dispatch. */
|
|
13
|
-
class HostStore {
|
|
14
|
-
gate;
|
|
15
|
-
file;
|
|
16
|
-
directory;
|
|
17
|
-
identity;
|
|
18
|
-
value;
|
|
19
|
-
faulted = false;
|
|
20
|
-
closed = false;
|
|
21
|
-
limits;
|
|
22
|
-
constructor(directory, binding, limits = { operations: 64, events: 64 }) {
|
|
23
|
-
(0, HostProtocol_1.secret)(binding);
|
|
24
|
-
for (const limit of Object.values(limits))
|
|
25
|
-
if (!Number.isInteger(limit) || limit < 1 || limit > 64)
|
|
26
|
-
throw new HostProtocol_1.HostError('invalid_capacity');
|
|
27
|
-
this.limits = { ...limits };
|
|
28
|
-
fs_1.default.mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
29
|
-
const entry = fs_1.default.lstatSync(directory);
|
|
30
|
-
if (!entry.isDirectory() || entry.isSymbolicLink() || process.platform !== 'win32' && (entry.mode & 0o077) !== 0)
|
|
31
|
-
throw new HostProtocol_1.HostError('unsafe_store_directory');
|
|
32
|
-
this.directory = fs_1.default.realpathSync(directory);
|
|
33
|
-
this.identity = fs_1.default.statSync(this.directory);
|
|
34
|
-
this.file = path_1.default.join(this.directory, 'state.json');
|
|
35
|
-
const gate = (0, OwnershipRuntime_1.kernelGate)(path_1.default.join(this.directory, 'writer.lock'));
|
|
36
|
-
if (!gate)
|
|
37
|
-
throw new HostProtocol_1.HostError('host_already_owned');
|
|
38
|
-
this.gate = gate;
|
|
39
|
-
this.value = { version: 2, acceptedThrough: 0, retiredThrough: 0, binding, epoch: 0, sequence: 0, acknowledged: 0, operations: [], events: [] };
|
|
40
|
-
try {
|
|
41
|
-
if (fs_1.default.existsSync(this.file)) {
|
|
42
|
-
this.checkFile();
|
|
43
|
-
const loaded = JSON.parse(fs_1.default.readFileSync(this.file, 'utf8'));
|
|
44
|
-
if (loaded?.version === 1) {
|
|
45
|
-
loaded.version = 2;
|
|
46
|
-
loaded.acceptedThrough = 0;
|
|
47
|
-
loaded.retiredThrough = 0;
|
|
48
|
-
}
|
|
49
|
-
this.validate(loaded, binding);
|
|
50
|
-
this.value = loaded;
|
|
51
|
-
}
|
|
52
|
-
// Restart never dispatches old accepted inputs. Their reserved output slots
|
|
53
|
-
// become durable uncertainty events; no native absence/retirement is inferred.
|
|
54
|
-
this.change(state => {
|
|
55
|
-
state.epoch++;
|
|
56
|
-
for (const operation of state.operations)
|
|
57
|
-
if (operation.status === 'pending') {
|
|
58
|
-
operation.status = 'unknown';
|
|
59
|
-
operation.error = 'host_restarted';
|
|
60
|
-
this.addEvent(state, operation);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
gate.close();
|
|
66
|
-
throw error;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
get failed() { return this.faulted; }
|
|
70
|
-
snapshot() { return structuredClone(this.value); }
|
|
71
|
-
change(update) {
|
|
72
|
-
if (this.closed || this.faulted)
|
|
73
|
-
throw new HostProtocol_1.HostError('storage_unavailable');
|
|
74
|
-
const next = this.snapshot();
|
|
75
|
-
update(next);
|
|
76
|
-
this.validate(next, this.value.binding);
|
|
77
|
-
const temporary = path_1.default.join(this.directory, `.state-${(0, crypto_1.randomUUID)()}.tmp`);
|
|
78
|
-
try {
|
|
79
|
-
this.gate.verify();
|
|
80
|
-
const current = fs_1.default.lstatSync(this.directory);
|
|
81
|
-
if (!current.isDirectory() || current.isSymbolicLink() || current.ino !== this.identity.ino || current.dev !== this.identity.dev)
|
|
82
|
-
throw new HostProtocol_1.HostError('store_identity_changed');
|
|
83
|
-
if (fs_1.default.existsSync(this.file))
|
|
84
|
-
this.checkFile();
|
|
85
|
-
const fd = fs_1.default.openSync(temporary, 'wx', 0o600);
|
|
86
|
-
try {
|
|
87
|
-
fs_1.default.writeFileSync(fd, JSON.stringify(next));
|
|
88
|
-
fs_1.default.fsyncSync(fd);
|
|
89
|
-
}
|
|
90
|
-
finally {
|
|
91
|
-
fs_1.default.closeSync(fd);
|
|
92
|
-
}
|
|
93
|
-
fs_1.default.renameSync(temporary, this.file);
|
|
94
|
-
(0, OwnershipRuntime_1.syncDirectory)(this.directory);
|
|
95
|
-
this.value = next;
|
|
96
|
-
}
|
|
97
|
-
catch {
|
|
98
|
-
// Rename may already have committed. Never roll back and redispatch from
|
|
99
|
-
// stale in-memory state after an uncertain persistence outcome.
|
|
100
|
-
this.faulted = true;
|
|
101
|
-
throw new HostProtocol_1.HostError('storage_unavailable');
|
|
102
|
-
}
|
|
103
|
-
finally {
|
|
104
|
-
try {
|
|
105
|
-
fs_1.default.unlinkSync(temporary);
|
|
106
|
-
}
|
|
107
|
-
catch { /* Renamed or not created. */ }
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
addEvent(state, receipt) {
|
|
111
|
-
const { requestId, status, result, error } = receipt;
|
|
112
|
-
state.events.push({ id: (0, crypto_1.randomUUID)(), sequence: ++state.sequence, requestId, status,
|
|
113
|
-
...(result !== undefined ? { result } : {}), ...(error ? { error } : {}) });
|
|
114
|
-
}
|
|
115
|
-
compactAcknowledged(state) {
|
|
116
|
-
while (state.retiredThrough < state.acceptedThrough) {
|
|
117
|
-
const next = state.retiredThrough + 1;
|
|
118
|
-
const operation = state.operations.find(op => op.requestSequence === next);
|
|
119
|
-
if (!operation || operation.status === 'pending' || state.events.some(event => event.requestId === operation.requestId))
|
|
120
|
-
break;
|
|
121
|
-
state.operations = state.operations.filter(op => op !== operation);
|
|
122
|
-
state.retiredThrough = next;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
close() { if (!this.closed) {
|
|
126
|
-
this.closed = true;
|
|
127
|
-
this.gate.close();
|
|
128
|
-
} }
|
|
129
|
-
checkFile() {
|
|
130
|
-
const stat = fs_1.default.lstatSync(this.file);
|
|
131
|
-
// Counts and payload limits independently bound even a hostile catalog read.
|
|
132
|
-
if (!stat.isFile() || stat.isSymbolicLink() || stat.nlink !== 1 || stat.size > 4 * 1024 * 1024
|
|
133
|
-
|| process.platform !== 'win32' && (stat.mode & 0o077) !== 0)
|
|
134
|
-
throw new HostProtocol_1.HostError('unsafe_store_file');
|
|
135
|
-
}
|
|
136
|
-
validate(value, binding) {
|
|
137
|
-
(0, HostProtocol_1.fields)(value, ['version', 'binding', 'epoch', 'sequence', 'acknowledged', 'operations', 'events', 'acceptedThrough', 'retiredThrough']);
|
|
138
|
-
if (value.version !== 2 || value.binding !== binding || !Array.isArray(value.operations) || !Array.isArray(value.events))
|
|
139
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
140
|
-
(0, HostProtocol_1.integer)(value.acceptedThrough);
|
|
141
|
-
(0, HostProtocol_1.integer)(value.retiredThrough);
|
|
142
|
-
if (value.retiredThrough > value.acceptedThrough)
|
|
143
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
144
|
-
(0, HostProtocol_1.integer)(value.epoch);
|
|
145
|
-
(0, HostProtocol_1.integer)(value.sequence);
|
|
146
|
-
(0, HostProtocol_1.integer)(value.acknowledged);
|
|
147
|
-
if (value.acknowledged > value.sequence || value.operations.length > this.limits.operations || value.events.length > this.limits.events)
|
|
148
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
149
|
-
const requests = new Map();
|
|
150
|
-
for (const raw of value.operations) {
|
|
151
|
-
(0, HostProtocol_1.fields)(raw, ['requestId', 'digest', 'status'], ['result', 'error', 'requestSequence']);
|
|
152
|
-
if (raw.requestSequence !== undefined) {
|
|
153
|
-
(0, HostProtocol_1.integer)(raw.requestSequence);
|
|
154
|
-
if (raw.requestId !== `sequenced-${raw.requestSequence}` || raw.requestSequence <= value.retiredThrough || raw.requestSequence > value.acceptedThrough)
|
|
155
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
156
|
-
}
|
|
157
|
-
(0, HostProtocol_1.identifier)(raw.requestId);
|
|
158
|
-
(0, HostProtocol_1.secret)(raw.digest);
|
|
159
|
-
this.validateReceipt(raw);
|
|
160
|
-
if (requests.has(raw.requestId))
|
|
161
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
162
|
-
requests.set(raw.requestId, raw);
|
|
163
|
-
}
|
|
164
|
-
if ([...requests.values()].filter(op => op.requestSequence !== undefined).length !== value.acceptedThrough - value.retiredThrough)
|
|
165
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
166
|
-
const ids = new Set();
|
|
167
|
-
const eventRequests = new Set();
|
|
168
|
-
for (const [index, raw] of value.events.entries()) {
|
|
169
|
-
(0, HostProtocol_1.fields)(raw, ['id', 'sequence', 'requestId', 'status'], ['result', 'error']);
|
|
170
|
-
(0, HostProtocol_1.identifier)(raw.id);
|
|
171
|
-
(0, HostProtocol_1.identifier)(raw.requestId);
|
|
172
|
-
(0, HostProtocol_1.integer)(raw.sequence);
|
|
173
|
-
this.validateReceipt(raw);
|
|
174
|
-
const op = requests.get(raw.requestId);
|
|
175
|
-
if (!op || raw.status === 'pending' || raw.sequence !== value.acknowledged + index + 1 || ids.has(raw.id) || eventRequests.has(raw.requestId)
|
|
176
|
-
|| (0, HostProtocol_1.canonical)([raw.status, raw.result ?? null, raw.error ?? null]) !== (0, HostProtocol_1.canonical)([op.status, op.result ?? null, op.error ?? null]))
|
|
177
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
178
|
-
ids.add(raw.id);
|
|
179
|
-
eventRequests.add(raw.requestId);
|
|
180
|
-
}
|
|
181
|
-
if (value.events.length !== value.sequence - value.acknowledged
|
|
182
|
-
|| [...requests.values()].filter(op => op.status !== 'pending').length + value.retiredThrough !== value.sequence
|
|
183
|
-
|| value.events.length + [...requests.values()].filter(op => op.status === 'pending').length > this.limits.events)
|
|
184
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
185
|
-
}
|
|
186
|
-
validateReceipt(raw) {
|
|
187
|
-
if (raw.status === 'completed') {
|
|
188
|
-
if (!Object.hasOwn(raw, 'result') || Object.hasOwn(raw, 'error'))
|
|
189
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
190
|
-
(0, HostProtocol_1.payload)(raw.result);
|
|
191
|
-
}
|
|
192
|
-
else if (raw.status === 'pending') {
|
|
193
|
-
if (Object.hasOwn(raw, 'result') || Object.hasOwn(raw, 'error'))
|
|
194
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
195
|
-
}
|
|
196
|
-
else if (raw.status === 'failed' || raw.status === 'unknown') {
|
|
197
|
-
const allowed = raw.status === 'failed' ? ['runtime_failed', 'invalid_runtime_result'] : ['host_restarted'];
|
|
198
|
-
if (Object.hasOwn(raw, 'result') || !allowed.includes(raw.error))
|
|
199
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
200
|
-
}
|
|
201
|
-
else
|
|
202
|
-
throw new HostProtocol_1.HostError('invalid_store');
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
exports.HostStore = HostStore;
|
|
206
|
-
//# sourceMappingURL=HostStore.js.map
|
|
@@ -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AM,IAAI,wBAAS,CAAC,eAAe,CAAC,CAAC;YACvG,IAAA,sBAAO,EAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;aAAM,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC;gBAAE,MAAM,IAAI,wBAAS,CAAC,eAAe,CAAC,CAAC;QACxG,CAAC;aAAM,IAAI,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC/D,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;YAC5G,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAe,CAAC;gBAAE,MAAM,IAAI,wBAAS,CAAC,eAAe,CAAC,CAAC;QACnH,CAAC;;YAAM,MAAM,IAAI,wBAAS,CAAC,eAAe,CAAC,CAAC;IAC9C,CAAC;CACF;AA1ID,8BA0IC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { UpdateReadiness } from '../update/AutomaticUpdater';
|
|
2
|
-
import { type HostAddress, type Json } from './HostProtocol';
|
|
3
|
-
import type { RuntimeBinding, RuntimeCommand } from './RuntimeJournal';
|
|
4
|
-
export interface RetainedConnection {
|
|
5
|
-
address: HostAddress;
|
|
6
|
-
secret: string;
|
|
7
|
-
launcherSecret: string;
|
|
8
|
-
directory: string;
|
|
9
|
-
}
|
|
10
|
-
/** The supervisor must return an independently owned, pinned host; never spawn under the frontend job. */
|
|
11
|
-
export interface RetainedLauncher {
|
|
12
|
-
connect(): Promise<RetainedConnection>;
|
|
13
|
-
}
|
|
14
|
-
export interface RuntimeSnapshot {
|
|
15
|
-
runtimeVersion: string;
|
|
16
|
-
frontendVersion?: string;
|
|
17
|
-
routerVersion?: string;
|
|
18
|
-
ready: boolean;
|
|
19
|
-
healthy: boolean;
|
|
20
|
-
commands: RuntimeCommand[];
|
|
21
|
-
owners: RuntimeBinding[];
|
|
22
|
-
}
|
|
23
|
-
export declare function privateJson(file: string): unknown;
|
|
24
|
-
export declare function descriptorLauncher(file: string): RetainedLauncher;
|
|
25
|
-
/** This parser is loaded from the newly installed frontend, not the pinned host. */
|
|
26
|
-
export declare function retainedIntent(command: RuntimeCommand, state: RuntimeSnapshot, version: string): {
|
|
27
|
-
context: RuntimeBinding | null;
|
|
28
|
-
intent: Json;
|
|
29
|
-
};
|
|
30
|
-
/** Replaceable command plane. No Router socket, executor or native callback lives here. */
|
|
31
|
-
export declare class RetainedFrontend implements UpdateReadiness {
|
|
32
|
-
private readonly launcher;
|
|
33
|
-
readonly version: string;
|
|
34
|
-
private readonly dispatch;
|
|
35
|
-
private readonly onVersion;
|
|
36
|
-
private client;
|
|
37
|
-
private lease;
|
|
38
|
-
private gate?;
|
|
39
|
-
private timer?;
|
|
40
|
-
private ticking?;
|
|
41
|
-
private closed;
|
|
42
|
-
private updating;
|
|
43
|
-
private last?;
|
|
44
|
-
private sequence;
|
|
45
|
-
private cursor;
|
|
46
|
-
private fault?;
|
|
47
|
-
private pendingSubmission?;
|
|
48
|
-
constructor(launcher: RetainedLauncher, version: string, dispatch?: typeof retainedIntent, onVersion?: (version: string) => void);
|
|
49
|
-
start(pollMs?: number): Promise<void>;
|
|
50
|
-
status(): {
|
|
51
|
-
frontendVersion: string;
|
|
52
|
-
runtimeVersion?: string;
|
|
53
|
-
error?: string;
|
|
54
|
-
};
|
|
55
|
-
tick(): Promise<void>;
|
|
56
|
-
private submit;
|
|
57
|
-
private flushSubmission;
|
|
58
|
-
tryBeginAutomaticUpdate(): boolean;
|
|
59
|
-
prepareAutomaticUpdate(): Promise<void>;
|
|
60
|
-
endAutomaticUpdate(): Promise<void>;
|
|
61
|
-
close(): Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=RetainedFrontend.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RetainedFrontend.d.ts","sourceRoot":"","sources":["../../src/sessionHost/RetainedFrontend.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAA0D,KAAK,WAAW,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACrH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IAAG,OAAO,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE;AACvH,0GAA0G;AAC1G,MAAM,WAAW,gBAAgB;IAAG,OAAO,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAAE;AAC5E,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAC3G,QAAQ,EAAE,cAAc,EAAE,CAAC;IAAC,MAAM,EAAE,cAAc,EAAE,CAAC;CACtD;AACD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKjD;AACD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAQjE;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,eAAe,EAAE,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I,CAAC;IACnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAa7B"}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RetainedFrontend = void 0;
|
|
7
|
-
exports.privateJson = privateJson;
|
|
8
|
-
exports.descriptorLauncher = descriptorLauncher;
|
|
9
|
-
exports.retainedIntent = retainedIntent;
|
|
10
|
-
const fs_1 = __importDefault(require("fs"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const crypto_1 = require("crypto");
|
|
13
|
-
const OwnershipRuntime_1 = require("../delegation/OwnershipRuntime");
|
|
14
|
-
const ScheduleCommand_1 = require("../scheduling/ScheduleCommand");
|
|
15
|
-
const HostClient_1 = require("./HostClient");
|
|
16
|
-
const HostProtocol_1 = require("./HostProtocol");
|
|
17
|
-
function privateJson(file) {
|
|
18
|
-
const stat = fs_1.default.lstatSync(file);
|
|
19
|
-
if (!stat.isFile() || stat.isSymbolicLink() || stat.nlink !== 1 || stat.size > 16 * 1024
|
|
20
|
-
|| process.platform !== 'win32' && (stat.mode & 0o077) !== 0)
|
|
21
|
-
throw new Error('Retained host descriptor must be a private regular file.');
|
|
22
|
-
return JSON.parse(fs_1.default.readFileSync(file, 'utf8'));
|
|
23
|
-
}
|
|
24
|
-
function descriptorLauncher(file) {
|
|
25
|
-
return { connect: async () => {
|
|
26
|
-
const value = privateJson(file);
|
|
27
|
-
(0, HostProtocol_1.fields)(value, ['address', 'secret', 'launcherSecret', 'directory']);
|
|
28
|
-
(0, HostProtocol_1.fields)(value.address, ['hostId', 'port', 'installationId']);
|
|
29
|
-
(0, HostProtocol_1.secret)(value.secret);
|
|
30
|
-
(0, HostProtocol_1.secret)(value.launcherSecret);
|
|
31
|
-
if (typeof value.directory !== 'string' || !path_1.default.isAbsolute(value.directory))
|
|
32
|
-
throw new Error('Invalid retained host directory.');
|
|
33
|
-
return value;
|
|
34
|
-
} };
|
|
35
|
-
}
|
|
36
|
-
/** This parser is loaded from the newly installed frontend, not the pinned host. */
|
|
37
|
-
function retainedIntent(command, state, version) {
|
|
38
|
-
const text = command.command.trim();
|
|
39
|
-
const own = state.owners.filter(owner => owner.openId === command.openId);
|
|
40
|
-
const context = own.find(owner => owner.threadId === command.threadId) ?? (!command.threadId ? own[0] : undefined) ?? null;
|
|
41
|
-
const reply = (output) => ({ context: null, intent: { kind: 'reply', output } });
|
|
42
|
-
if (text === '/host status')
|
|
43
|
-
return reply(`Frontend ${version}; native runtime ${state.runtimeVersion}. Native sessions remain owned by the retained host.`);
|
|
44
|
-
if (text === '/help')
|
|
45
|
-
return reply('Retained-host commands: /thread new <name> <claude|agy|dsh> <directory>, /thread list, /t <name>, /schedule list|cancel|after|at|cron, /host status. Other context changes are not enabled.');
|
|
46
|
-
if (text === '/thread list')
|
|
47
|
-
return reply(own.map(owner => `${owner.name}: ${owner.threadId} (${owner.backend})`).join('\n') || 'No retained-host threads. Existing monolithic sessions are not imported.');
|
|
48
|
-
const create = /^\/thread new ([A-Za-z0-9-]+) (claude|agy|dsh) (.+)$/.exec(text);
|
|
49
|
-
if (create)
|
|
50
|
-
return { context: null, intent: { kind: 'newThread', name: create[1], backend: create[2], cwd: create[3] } };
|
|
51
|
-
const select = /^\/t ([A-Za-z0-9-]+)$/.exec(text);
|
|
52
|
-
if (select) {
|
|
53
|
-
const selected = own.find(owner => owner.name === select[1]);
|
|
54
|
-
return selected ? { context: selected, intent: { kind: 'select' } } : reply('Retained-host thread not found.');
|
|
55
|
-
}
|
|
56
|
-
const schedule = (0, ScheduleCommand_1.parseScheduleCommand)(text);
|
|
57
|
-
if (schedule) {
|
|
58
|
-
if (schedule.kind === 'invalid')
|
|
59
|
-
return reply(schedule.message);
|
|
60
|
-
if (!['create', 'list', 'cancel'].includes(schedule.kind))
|
|
61
|
-
return reply('This retained-host frontend supports schedule create, list and cancel. Other cleanup/context commands are not enabled.');
|
|
62
|
-
return { context, intent: { kind: 'schedule', operation: schedule } };
|
|
63
|
-
}
|
|
64
|
-
if (text.startsWith('/'))
|
|
65
|
-
return reply('This command is not enabled in the retained-host frontend. No native context was changed. Use /help.');
|
|
66
|
-
return { context, intent: { kind: 'prompt', prompt: command.command } };
|
|
67
|
-
}
|
|
68
|
-
/** Replaceable command plane. No Router socket, executor or native callback lives here. */
|
|
69
|
-
class RetainedFrontend {
|
|
70
|
-
launcher;
|
|
71
|
-
version;
|
|
72
|
-
dispatch;
|
|
73
|
-
onVersion;
|
|
74
|
-
client;
|
|
75
|
-
lease;
|
|
76
|
-
gate;
|
|
77
|
-
timer;
|
|
78
|
-
ticking;
|
|
79
|
-
closed = false;
|
|
80
|
-
updating = false;
|
|
81
|
-
last;
|
|
82
|
-
sequence = 0;
|
|
83
|
-
cursor = 0;
|
|
84
|
-
fault;
|
|
85
|
-
pendingSubmission;
|
|
86
|
-
constructor(launcher, version, dispatch = retainedIntent, onVersion = () => { }) {
|
|
87
|
-
this.launcher = launcher;
|
|
88
|
-
this.version = version;
|
|
89
|
-
this.dispatch = dispatch;
|
|
90
|
-
this.onVersion = onVersion;
|
|
91
|
-
}
|
|
92
|
-
async start(pollMs = 250) {
|
|
93
|
-
const connection = await this.launcher.connect();
|
|
94
|
-
const admin = new HostClient_1.HostClient(connection.address, connection.launcherSecret);
|
|
95
|
-
this.client = new HostClient_1.HostClient(connection.address, connection.secret);
|
|
96
|
-
try {
|
|
97
|
-
const hello = await admin.hello();
|
|
98
|
-
if (!['sequenced-requests-v1', 'launcher-recovery-v1'].every(cap => hello.capabilities.includes(cap)))
|
|
99
|
-
throw new Error('Retained host attachment capabilities are unavailable.');
|
|
100
|
-
this.lease = await admin.recoverFrontend((0, crypto_1.randomUUID)(), hello.epoch);
|
|
101
|
-
this.gate = (0, OwnershipRuntime_1.kernelGate)(path_1.default.join(connection.directory, 'frontend.lock'));
|
|
102
|
-
if (!this.gate)
|
|
103
|
-
throw new Error('Another frontend acquired the launcher lease.');
|
|
104
|
-
// A contender may have won between claim and lock; verify before dispatch.
|
|
105
|
-
await this.client.inspect(this.lease, 'state');
|
|
106
|
-
this.sequence = hello.acceptedThrough;
|
|
107
|
-
this.cursor = hello.acknowledged;
|
|
108
|
-
await this.submit('frontendVersion', this.version);
|
|
109
|
-
await this.tick();
|
|
110
|
-
this.timer = setInterval(() => { void this.tick().catch(error => { this.fault = error instanceof Error ? error : new Error('Retained frontend failed.'); }); }, pollMs);
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
this.gate?.close();
|
|
114
|
-
this.gate = undefined;
|
|
115
|
-
this.client.close();
|
|
116
|
-
throw error;
|
|
117
|
-
}
|
|
118
|
-
finally {
|
|
119
|
-
admin.close();
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
status() {
|
|
123
|
-
return { frontendVersion: this.version, runtimeVersion: this.last?.runtimeVersion, ...(this.fault ? { error: this.fault.message } : {}) };
|
|
124
|
-
}
|
|
125
|
-
tick() {
|
|
126
|
-
if (this.ticking)
|
|
127
|
-
return this.ticking;
|
|
128
|
-
const run = async () => {
|
|
129
|
-
if (this.closed || this.updating)
|
|
130
|
-
return;
|
|
131
|
-
this.gate.verify();
|
|
132
|
-
// Resolve ambiguous acceptance before ACK can retire its receipt. The
|
|
133
|
-
// original arguments and sequence survive any number of transport failures.
|
|
134
|
-
if (this.pendingSubmission)
|
|
135
|
-
await this.flushSubmission();
|
|
136
|
-
const state = await this.client.inspect(this.lease, 'state');
|
|
137
|
-
this.last = state;
|
|
138
|
-
if (!state.healthy)
|
|
139
|
-
throw new Error('Retained runtime persistence is unavailable.');
|
|
140
|
-
const events = await this.client.events(this.lease, this.cursor);
|
|
141
|
-
if (events.events.some(event => event.status === 'unknown'))
|
|
142
|
-
throw new Error('Host operation outcome is unknown; no native request was replayed.');
|
|
143
|
-
// These are control receipts. Actual user output remains in the host's
|
|
144
|
-
// Router-ACK outbox; acknowledging here cannot acknowledge a user result.
|
|
145
|
-
try {
|
|
146
|
-
await this.client.ack(this.lease, events.through);
|
|
147
|
-
this.cursor = events.through;
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
if (error instanceof HostProtocol_1.HostError && error.code === 'transport_outcome_unknown') {
|
|
151
|
-
const hello = await this.client.hello();
|
|
152
|
-
if (hello.epoch === this.lease.epoch)
|
|
153
|
-
this.cursor = hello.acknowledged;
|
|
154
|
-
}
|
|
155
|
-
throw error;
|
|
156
|
-
}
|
|
157
|
-
for (const command of state.commands.slice(0, 16)) {
|
|
158
|
-
if (this.updating || this.closed)
|
|
159
|
-
break;
|
|
160
|
-
const parsed = this.dispatch(command, state, this.version);
|
|
161
|
-
let args;
|
|
162
|
-
try {
|
|
163
|
-
args = (0, HostProtocol_1.payload)({ messageId: command.messageId, ...parsed });
|
|
164
|
-
}
|
|
165
|
-
catch {
|
|
166
|
-
// Reject a nontransportable command explicitly instead of retaining it
|
|
167
|
-
// forever at the head of ingress and blocking later frontend updates.
|
|
168
|
-
args = { messageId: command.messageId, context: null, intent: { kind: 'reject',
|
|
169
|
-
error: 'Command exceeds retained-host transport limits. No native work was dispatched.' } };
|
|
170
|
-
}
|
|
171
|
-
await this.submit('command', args);
|
|
172
|
-
}
|
|
173
|
-
if (state.routerVersion)
|
|
174
|
-
this.onVersion(state.routerVersion);
|
|
175
|
-
this.fault = undefined;
|
|
176
|
-
};
|
|
177
|
-
this.ticking = run().finally(() => { this.ticking = undefined; });
|
|
178
|
-
return this.ticking;
|
|
179
|
-
}
|
|
180
|
-
async submit(method, args) {
|
|
181
|
-
if (this.pendingSubmission)
|
|
182
|
-
throw new Error('A frontend request still has an unknown outcome.');
|
|
183
|
-
this.pendingSubmission = { sequence: this.sequence + 1, method, args };
|
|
184
|
-
await this.flushSubmission();
|
|
185
|
-
}
|
|
186
|
-
async flushSubmission() {
|
|
187
|
-
const pending = this.pendingSubmission;
|
|
188
|
-
try {
|
|
189
|
-
await this.client.submitSequenced(this.lease, pending.sequence, pending.method, pending.args);
|
|
190
|
-
}
|
|
191
|
-
catch (error) {
|
|
192
|
-
// A lost acceptance reply must not assign a new sequence to the same input.
|
|
193
|
-
if (!(error instanceof HostProtocol_1.HostError) || error.code !== 'transport_outcome_unknown')
|
|
194
|
-
throw error;
|
|
195
|
-
const status = await this.client.status(this.lease, `sequenced-${pending.sequence}`).catch(() => undefined);
|
|
196
|
-
if (!status)
|
|
197
|
-
throw error;
|
|
198
|
-
}
|
|
199
|
-
this.sequence = pending.sequence;
|
|
200
|
-
this.pendingSubmission = undefined;
|
|
201
|
-
}
|
|
202
|
-
tryBeginAutomaticUpdate() {
|
|
203
|
-
if (this.closed || this.updating || this.fault || this.pendingSubmission || !this.last?.healthy)
|
|
204
|
-
return false;
|
|
205
|
-
this.updating = true;
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
async prepareAutomaticUpdate() {
|
|
209
|
-
if (!this.updating || this.closed)
|
|
210
|
-
throw new Error('Frontend update admission expired.');
|
|
211
|
-
await this.ticking;
|
|
212
|
-
this.gate.verify();
|
|
213
|
-
const state = await this.client.inspect(this.lease, 'state');
|
|
214
|
-
if (!state.healthy)
|
|
215
|
-
throw new Error('Retained native host is unavailable.');
|
|
216
|
-
// No native list/cancel/load/recreate/suspend operation is used here.
|
|
217
|
-
}
|
|
218
|
-
async endAutomaticUpdate() { this.updating = false; }
|
|
219
|
-
async close() {
|
|
220
|
-
if (this.closed)
|
|
221
|
-
return;
|
|
222
|
-
this.updating = true;
|
|
223
|
-
await this.ticking?.catch(() => { });
|
|
224
|
-
try {
|
|
225
|
-
await this.client.detach(this.lease);
|
|
226
|
-
}
|
|
227
|
-
catch (error) {
|
|
228
|
-
const hello = error instanceof HostProtocol_1.HostError && error.code === 'transport_outcome_unknown'
|
|
229
|
-
? await this.client.hello().catch(() => undefined) : undefined;
|
|
230
|
-
if (!hello || hello.active || hello.epoch !== this.lease.epoch + 1) {
|
|
231
|
-
this.updating = false;
|
|
232
|
-
throw error;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
this.closed = true;
|
|
236
|
-
if (this.timer)
|
|
237
|
-
clearInterval(this.timer);
|
|
238
|
-
this.client.close();
|
|
239
|
-
this.gate?.close();
|
|
240
|
-
this.gate = undefined;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
exports.RetainedFrontend = RetainedFrontend;
|
|
244
|
-
//# sourceMappingURL=RetainedFrontend.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RetainedFrontend.js","sourceRoot":"","sources":["../../src/sessionHost/RetainedFrontend.ts"],"names":[],"mappings":";;;;;;AAiBA,kCAKC;AACD,gDAQC;AAGD,wCAuBC;AAzDD,4CAAoB;AACpB,gDAAwB;AACxB,mCAAoC;AACpC,qEAA6E;AAE7E,mEAAqE;AACrE,6CAA0C;AAC1C,iDAAqH;AAUrH,SAAgB,WAAW,CAAC,IAAY;IACtC,MAAM,IAAI,GAAG,YAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI;WACnF,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC5I,OAAO,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AACnD,CAAC;AACD,SAAgB,kBAAkB,CAAC,IAAY;IAC7C,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;YAC3B,MAA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,CAAC,KAAK;YAAE,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9D,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QAAC,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACjE,CAAC;CACF;AA1HD,4CA0HC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type SessionHostLaunchContext, type SessionHostServiceStatus } from '../service/SessionHostSupervisor';
|
|
2
|
-
import { type PinnedHostBundleInput } from '../update/PinnedHostBundle';
|
|
3
|
-
import { type RetainedLauncher } from './RetainedFrontend';
|
|
4
|
-
export interface RetainedInstallationInput {
|
|
5
|
-
homeDir: string;
|
|
6
|
-
installationId: string;
|
|
7
|
-
bundle: PinnedHostBundleInput;
|
|
8
|
-
backendSearchPath?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface RetainedLauncherOptions {
|
|
11
|
-
supervisor?: (context: SessionHostLaunchContext) => {
|
|
12
|
-
ensureStarted(): Promise<SessionHostServiceStatus>;
|
|
13
|
-
};
|
|
14
|
-
startupTimeoutMs?: number;
|
|
15
|
-
}
|
|
16
|
-
/** Prepare only from explicit verified distribution inventories. This does not
|
|
17
|
-
* start a service, import an old session, or scan the user's configuration tree.
|
|
18
|
-
* Existing launch metadata is immutable: a frontend update reuses it.
|
|
19
|
-
*/
|
|
20
|
-
export declare function prepareRetainedHostInstallation(input: RetainedInstallationInput): Promise<string>;
|
|
21
|
-
/** Manager status permits an attach attempt, never native recovery or replay.
|
|
22
|
-
* Both the private descriptor and subsequent HostClient HMAC handshake are needed.
|
|
23
|
-
*/
|
|
24
|
-
export declare function supervisedLauncher(launchFile: string, options?: RetainedLauncherOptions): RetainedLauncher;
|
|
25
|
-
//# sourceMappingURL=RetainedHostLauncher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RetainedHostLauncher.d.ts","sourceRoot":"","sources":["../../src/sessionHost/RetainedHostLauncher.ts"],"names":[],"mappings":"AAIA,OAAO,EAAyB,KAAK,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACvI,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEjG,OAAO,EAAmC,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK5F,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AACD,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK;QAAE,aAAa,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAAA;KAAE,CAAC;IAC3G,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAiBD;;;GAGG;AACH,wBAAsB,+BAA+B,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiCvG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAiC9G"}
|