@steerable/agent-shell 0.12.8 → 0.14.0
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/attachments/image-normalizer.d.ts +39 -0
- package/dist/attachments/image-normalizer.js +131 -0
- package/dist/auth/credentials.d.ts +83 -0
- package/dist/auth/credentials.js +426 -0
- package/dist/auth/index.d.ts +33 -9
- package/dist/auth/index.js +85 -0
- package/dist/host/external-pack-loader.d.ts +40 -0
- package/dist/host/external-pack-loader.js +247 -0
- package/dist/host/http-routes.d.ts +6 -2
- package/dist/host/http-routes.js +5 -2
- package/dist/host/pack-assembly.d.ts +9 -1
- package/dist/host/runtime.js +54 -1
- package/dist/image-attachment.js +10 -5
- package/dist/local-backend/coreloop-stream.d.ts +4 -0
- package/dist/local-backend/coreloop-stream.js +4 -0
- package/dist/local-backend/fact-chain.d.ts +38 -0
- package/dist/local-backend/fact-chain.js +145 -0
- package/dist/local-backend/router.d.ts +3 -1
- package/dist/local-backend/router.js +602 -45
- package/dist/local-backend/state-reconcile.d.ts +42 -0
- package/dist/local-backend/state-reconcile.js +81 -0
- package/dist/local-backend/title-refresh.d.ts +39 -0
- package/dist/local-backend/title-refresh.js +80 -0
- package/dist/local-backend/turn-security-context.d.ts +42 -0
- package/dist/local-backend/turn-security-context.js +62 -0
- package/dist/local-backend/ui-surface.d.ts +75 -0
- package/dist/local-backend/ui-surface.js +368 -0
- package/dist/local-executor.d.ts +3 -0
- package/dist/local-executor.js +40 -1
- package/dist/memory/authoring-candidates.d.ts +26 -0
- package/dist/memory/authoring-candidates.js +73 -0
- package/dist/memory/injector.d.ts +38 -0
- package/dist/memory/injector.js +122 -0
- package/dist/memory/routes.d.ts +16 -0
- package/dist/memory/routes.js +146 -0
- package/dist/memory/store.d.ts +176 -0
- package/dist/memory/store.js +623 -0
- package/dist/memory/tools.d.ts +83 -0
- package/dist/memory/tools.js +143 -0
- package/dist/present-files.d.ts +25 -1
- package/dist/present-files.js +170 -2
- package/dist/raster-image.d.ts +7 -1
- package/dist/raster-image.js +34 -0
- package/dist/scenario/applications.d.ts +52 -0
- package/dist/scenario/applications.js +143 -0
- package/dist/scenario/pack.d.ts +1 -1
- package/dist/security/policy-digest.d.ts +28 -0
- package/dist/security/policy-digest.js +104 -0
- package/dist/server/http-server.js +23 -6
- package/dist/sidecar/boot.d.ts +1 -0
- package/dist/sidecar/boot.js +2 -0
- package/dist/sidecar/index.d.ts +1 -1
- package/dist/sidecar/rejected-before-effect.d.ts +22 -0
- package/dist/sidecar/rejected-before-effect.js +63 -0
- package/dist/sidecar/reverse-approval.d.ts +2 -0
- package/dist/sidecar/reverse-approval.js +28 -5
- package/dist/sidecar/reverse-tools.d.ts +3 -0
- package/dist/sidecar/reverse-tools.js +146 -18
- package/dist/sidecar/supervisor.d.ts +31 -1
- package/dist/sidecar/supervisor.js +47 -0
- package/dist/sidecar/types.d.ts +72 -0
- package/dist/storage/fde-fallback.d.ts +4 -0
- package/dist/storage/fde-fallback.js +354 -0
- package/dist/storage/fde-types.d.ts +215 -0
- package/dist/storage/fde-types.js +1 -0
- package/dist/storage/index.d.ts +113 -1
- package/dist/storage/index.js +797 -0
- package/dist/storage/insights-redact.d.ts +4 -1
- package/dist/storage/insights-redact.js +6 -1
- package/dist/storage/process-locks.d.ts +1 -1
- package/dist/storage/process-locks.js +1 -1
- package/dist/storage/reliability-summary.d.ts +1 -1
- package/dist/storage/scoped-store.d.ts +3 -1
- package/dist/tool-presentation.js +20 -0
- package/dist/tool-router.d.ts +20 -1
- package/dist/tool-router.js +76 -12
- package/package.json +5 -5
|
@@ -6,9 +6,15 @@
|
|
|
6
6
|
* Hard-gates critical shell commands — the TS loop only annotates them, but
|
|
7
7
|
* on the CoreLoop path the framework's blocking semantics apply.
|
|
8
8
|
*/
|
|
9
|
+
import { createHash } from 'node:crypto';
|
|
10
|
+
import { normalizeToolImagePayload, } from '../attachments/image-normalizer.js';
|
|
9
11
|
import { classifyShellCommand } from './safety-patterns.js';
|
|
12
|
+
import { isRejectedBeforeEffectError } from './rejected-before-effect.js';
|
|
10
13
|
import { compactToolResultJson } from '../local-backend/context-compactor.js';
|
|
11
14
|
import { normalizeToolPolicy } from '../local-backend/agent-capability.js';
|
|
15
|
+
import { getTurnSecurityContext, touchHostActivity, } from '../local-backend/turn-security-context.js';
|
|
16
|
+
import { LOCAL_DEFAULT_PRINCIPAL, isRestrictedOriginChannel, } from '../auth/index.js';
|
|
17
|
+
import { ensurePhase9Store } from '../storage/fde-fallback.js';
|
|
12
18
|
/**
|
|
13
19
|
* 模型上下文硬顶:喂给 sidecar 的工具结果必须待在框架逐项 10k token 断言线
|
|
14
20
|
* 以下(2026-08-28 E2E 录制实锤:local_exec_shell 对 node_modules 跑
|
|
@@ -25,13 +31,28 @@ function capResultForModelContext(out) {
|
|
|
25
31
|
: null;
|
|
26
32
|
const image = data?._image;
|
|
27
33
|
if (image && typeof image === 'object') {
|
|
34
|
+
const imgRecord = image;
|
|
35
|
+
const normalizedImage = typeof imgRecord.b64 === 'string' && typeof imgRecord.media_type === 'string'
|
|
36
|
+
? normalizeToolImagePayload(imgRecord)
|
|
37
|
+
: image;
|
|
28
38
|
const textOnly = { ...record, data: { ...data } };
|
|
29
39
|
delete textOnly.data._image;
|
|
30
40
|
const capped = capResultForModelContext(textOnly);
|
|
31
41
|
const cappedData = capped.data && typeof capped.data === 'object'
|
|
32
42
|
? capped.data
|
|
33
43
|
: {};
|
|
34
|
-
return {
|
|
44
|
+
return {
|
|
45
|
+
...capped,
|
|
46
|
+
data: {
|
|
47
|
+
...cappedData,
|
|
48
|
+
_image: typeof normalizedImage.b64 === 'string'
|
|
49
|
+
? {
|
|
50
|
+
b64: normalizedImage.b64,
|
|
51
|
+
media_type: normalizedImage.media_type,
|
|
52
|
+
}
|
|
53
|
+
: image,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
35
56
|
}
|
|
36
57
|
}
|
|
37
58
|
const json = JSON.stringify(out);
|
|
@@ -45,7 +66,7 @@ export function createToolInvokeHandler(deps) {
|
|
|
45
66
|
const name = typeof p.name === 'string' ? p.name : '';
|
|
46
67
|
const toolArgs = p.arguments ?? {};
|
|
47
68
|
if (!name) {
|
|
48
|
-
return { success: false, error: 'missing tool name', needsFollowup: false };
|
|
69
|
+
return { success: false, error: 'missing tool name', effect: 'none', retryable: false, needsFollowup: false };
|
|
49
70
|
}
|
|
50
71
|
// Plan mode is enforced at the execution layer too, not just by tool
|
|
51
72
|
// advertisement — a pseudo-recovered call could name a write tool that
|
|
@@ -56,6 +77,8 @@ export function createToolInvokeHandler(deps) {
|
|
|
56
77
|
return {
|
|
57
78
|
success: false,
|
|
58
79
|
error: `blocked by plan mode: ${name} is a write tool`,
|
|
80
|
+
effect: 'none',
|
|
81
|
+
retryable: false,
|
|
59
82
|
needsFollowup: false,
|
|
60
83
|
};
|
|
61
84
|
}
|
|
@@ -87,6 +110,8 @@ export function createToolInvokeHandler(deps) {
|
|
|
87
110
|
return {
|
|
88
111
|
success: false,
|
|
89
112
|
error: `blocked by shell safety policy (critical): ${classification.matchedRules.join(', ')}`,
|
|
113
|
+
effect: 'none',
|
|
114
|
+
retryable: false,
|
|
90
115
|
needsFollowup: false,
|
|
91
116
|
};
|
|
92
117
|
}
|
|
@@ -97,32 +122,135 @@ export function createToolInvokeHandler(deps) {
|
|
|
97
122
|
? normalizeToolPolicy(p.context.toolPolicy)
|
|
98
123
|
: null;
|
|
99
124
|
const toolPolicy = normalizedPolicy && normalizedPolicy.mode !== 'all' ? normalizedPolicy : null;
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
125
|
+
const chatId = p.context?.chatId;
|
|
126
|
+
const turnSec = getTurnSecurityContext(chatId);
|
|
127
|
+
const activeStore = turnSec?.store ?? deps.store;
|
|
128
|
+
const principal = turnSec?.principal ?? LOCAL_DEFAULT_PRINCIPAL;
|
|
129
|
+
const originChannel = turnSec?.originChannel ?? 'web';
|
|
130
|
+
const schema = deps.toolRouter.getSchemaByName?.(name);
|
|
131
|
+
if (chatId && activeStore) {
|
|
132
|
+
const allForChat = await ensurePhase9Store(activeStore).listPendingReconciliations(chatId, { includeResolved: true });
|
|
133
|
+
const latestForTool = allForChat.find((item) => item.toolName === name);
|
|
134
|
+
if (latestForTool &&
|
|
135
|
+
(latestForTool.status === 'pending' || latestForTool.status === 'confirmed_executed')) {
|
|
136
|
+
const reason = latestForTool.status === 'confirmed_executed'
|
|
137
|
+
? `reconciliation_committed: previous call to "${name}" was confirmed_succeeded (reconciliationId=${latestForTool.id}); automatic re-execution is locked.`
|
|
138
|
+
: `reconciliation_required: previous call to "${name}" ended with outcome_unknown (reconciliationId=${latestForTool.id}). Confirm whether external side effects occurred before retrying.`;
|
|
139
|
+
return {
|
|
140
|
+
success: false,
|
|
141
|
+
error: reason,
|
|
142
|
+
effect: 'none',
|
|
143
|
+
retryable: false,
|
|
144
|
+
reconciliationId: latestForTool.id,
|
|
145
|
+
needsFollowup: false,
|
|
146
|
+
};
|
|
113
147
|
}
|
|
114
|
-
|
|
148
|
+
}
|
|
149
|
+
if (isRestrictedOriginChannel(originChannel) && schema?.checkpoint === 'outward') {
|
|
150
|
+
const workbenchHref = chatId ? `/#/agent/${encodeURIComponent(chatId)}` : '/#/agent';
|
|
151
|
+
return {
|
|
152
|
+
success: false,
|
|
153
|
+
error: `outward_confirmation_required: tool "${name}" requires interactive confirmation in the Web or Desktop workbench (${workbenchHref})`,
|
|
154
|
+
effect: 'none',
|
|
155
|
+
retryable: true,
|
|
156
|
+
needsFollowup: false,
|
|
157
|
+
workbenchHref,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
if (schema?.inputSchema && typeof schema.inputSchema === 'object') {
|
|
161
|
+
const schemaObj = schema.inputSchema;
|
|
162
|
+
if (Array.isArray(schemaObj.required)) {
|
|
163
|
+
for (const reqKey of schemaObj.required) {
|
|
164
|
+
if (typeof reqKey === 'string' && toolArgs[reqKey] === undefined) {
|
|
165
|
+
return {
|
|
166
|
+
success: false,
|
|
167
|
+
error: `schema_validation_failed: missing required argument "${reqKey}" for tool "${name}"`,
|
|
168
|
+
effect: 'none',
|
|
169
|
+
retryable: true,
|
|
170
|
+
needsFollowup: true,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
touchHostActivity();
|
|
177
|
+
const execContext = {
|
|
178
|
+
projectRoot,
|
|
179
|
+
chatId,
|
|
180
|
+
principal,
|
|
181
|
+
originChannel,
|
|
182
|
+
...(turnSec?.credentials ? { credentials: turnSec.credentials } : {}),
|
|
183
|
+
...(toolPolicy ? { toolPolicy } : {}),
|
|
184
|
+
...(additionalReadRoots.length > 0 ? { additionalReadRoots } : {}),
|
|
185
|
+
...(additionalWriteRoots.length > 0 ? { additionalWriteRoots } : {}),
|
|
186
|
+
};
|
|
187
|
+
const isNonIdempotent = schema?.idempotent === false;
|
|
188
|
+
const recordUnknownOutcome = async (errorText) => {
|
|
189
|
+
const rawArgsJson = JSON.stringify(toolArgs);
|
|
190
|
+
const safeArgsJson = turnSec?.redactor.hasSecrets
|
|
191
|
+
? turnSec.redactor.redactString(rawArgsJson)
|
|
192
|
+
: rawArgsJson;
|
|
193
|
+
const argsDigest = createHash('sha256').update(safeArgsJson).digest('hex').slice(0, 16);
|
|
194
|
+
let reconciliationId;
|
|
195
|
+
if (chatId && activeStore) {
|
|
196
|
+
const rec = await ensurePhase9Store(activeStore).createPendingReconciliation({
|
|
197
|
+
chatId,
|
|
198
|
+
toolName: name,
|
|
199
|
+
argsDigest,
|
|
200
|
+
argsPreview: safeArgsJson.slice(0, 300),
|
|
201
|
+
errorDetail: errorText.slice(0, 500),
|
|
202
|
+
});
|
|
203
|
+
reconciliationId = rec.id;
|
|
204
|
+
deps.broadcast?.('reconciliation:updated', { chatId, reconciliation: rec });
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
success: false,
|
|
208
|
+
error: errorText.startsWith('outcome_unknown') ? errorText : `outcome_unknown: ${errorText}`,
|
|
209
|
+
effect: 'unknown',
|
|
210
|
+
outcomeUnknown: true,
|
|
211
|
+
retryable: false,
|
|
212
|
+
...(reconciliationId ? { reconciliationId } : {}),
|
|
213
|
+
needsFollowup: true,
|
|
214
|
+
};
|
|
215
|
+
};
|
|
115
216
|
try {
|
|
116
|
-
const
|
|
217
|
+
const rawOut = await deps.toolRouter.execute({ name, arguments: toolArgs }, execContext);
|
|
218
|
+
const out = turnSec?.redactor.hasSecrets
|
|
219
|
+
? turnSec.redactor.redactUnknown(rawOut)
|
|
220
|
+
: rawOut;
|
|
221
|
+
if (out &&
|
|
222
|
+
typeof out === 'object' &&
|
|
223
|
+
out.outcomeUnknown === true) {
|
|
224
|
+
const msg = String(out.error ??
|
|
225
|
+
`tool "${name}" returned an unknown side-effect outcome`);
|
|
226
|
+
return await recordUnknownOutcome(msg);
|
|
227
|
+
}
|
|
117
228
|
if (out && typeof out === 'object' && 'success' in out) {
|
|
118
229
|
return capResultForModelContext(out);
|
|
119
230
|
}
|
|
120
231
|
return capResultForModelContext({ success: true, data: { value: out } });
|
|
121
232
|
}
|
|
122
233
|
catch (err) {
|
|
234
|
+
const rawMsg = err instanceof Error ? err.message : String(err);
|
|
235
|
+
const safeMsg = turnSec?.redactor.hasSecrets
|
|
236
|
+
? turnSec.redactor.redactString(rawMsg)
|
|
237
|
+
: rawMsg;
|
|
238
|
+
if (isRejectedBeforeEffectError(err)) {
|
|
239
|
+
return {
|
|
240
|
+
success: false,
|
|
241
|
+
error: safeMsg,
|
|
242
|
+
effect: 'none',
|
|
243
|
+
retryable: err.retryable,
|
|
244
|
+
needsFollowup: err.retryable,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
const explicitUnknown = Boolean(err && typeof err === 'object' && err.outcomeUnknown === true);
|
|
248
|
+
if (isNonIdempotent || explicitUnknown) {
|
|
249
|
+
return await recordUnknownOutcome(safeMsg);
|
|
250
|
+
}
|
|
123
251
|
return {
|
|
124
252
|
success: false,
|
|
125
|
-
error:
|
|
253
|
+
error: safeMsg,
|
|
126
254
|
needsFollowup: true,
|
|
127
255
|
};
|
|
128
256
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - kill the process when the Electron app quits.
|
|
11
11
|
*/
|
|
12
12
|
import { EventEmitter } from 'node:events';
|
|
13
|
-
import type { SidecarApplyEditsResult, SidecarChatStreamHandlers, SidecarChatStreamRequest, SidecarHealthSnapshot, SidecarMethodOptions, SidecarModelCatalog, SidecarReverseHandler, SidecarSandboxPosture, SidecarSessionBranches, SidecarSessionForkOutcome, SidecarSessionMessages, SidecarSessionTree, SidecarChildrenList, SidecarSkillModule, SidecarStartOptions, SidecarToolResult } from './types.js';
|
|
13
|
+
import type { SidecarApplyEditsResult, SidecarChatStreamHandlers, SidecarChatStreamRequest, SidecarHealthSnapshot, SidecarLicenseStatus, SidecarMethodOptions, SidecarModelCatalog, SidecarReverseHandler, SidecarSandboxPosture, SidecarSessionBranches, SidecarSessionCompactParams, SidecarSessionCompactResult, SidecarSessionContextStatus, SidecarSessionForkOutcome, SidecarSessionMessages, SidecarSessionTree, SidecarChildrenList, SidecarSkillModule, SidecarStartOptions, SidecarToolResult } from './types.js';
|
|
14
14
|
/**
|
|
15
15
|
* Tool names carried by a `tool.list` reply.
|
|
16
16
|
*
|
|
@@ -147,6 +147,30 @@ export declare class SidecarSupervisor extends EventEmitter {
|
|
|
147
147
|
* the read path for rendering a branch after a switch. Soft-fail null.
|
|
148
148
|
*/
|
|
149
149
|
sessionMessages(recordId: string): Promise<SidecarSessionMessages | null>;
|
|
150
|
+
/**
|
|
151
|
+
* Phase 10 R3: authoritatively compact a durable session in `sessions.db`
|
|
152
|
+
* (with optional Partial Compaction `focus`, `keepHeadTurns`, `keepTailMessages`).
|
|
153
|
+
*/
|
|
154
|
+
sessionCompact(params: SidecarSessionCompactParams): Promise<SidecarSessionCompactResult | null>;
|
|
155
|
+
/**
|
|
156
|
+
* Phase 10 R3: fetch live token & wire-byte budget status for `sessions.db`.
|
|
157
|
+
*/
|
|
158
|
+
sessionContextStatus(params: {
|
|
159
|
+
recordId: string;
|
|
160
|
+
model?: string;
|
|
161
|
+
provider?: string;
|
|
162
|
+
baseUrl?: string;
|
|
163
|
+
maxContextTokens?: number;
|
|
164
|
+
maxRequestBytes?: number;
|
|
165
|
+
}): Promise<SidecarSessionContextStatus | null>;
|
|
166
|
+
/**
|
|
167
|
+
* Phase 10 R3: queue manual/partial compaction on an active CoreLoop turn.
|
|
168
|
+
*/
|
|
169
|
+
compactChat(streamId: string, options?: {
|
|
170
|
+
focus?: string;
|
|
171
|
+
keepHeadTurns?: number;
|
|
172
|
+
keepTailMessages?: number;
|
|
173
|
+
}): Promise<boolean>;
|
|
150
174
|
/**
|
|
151
175
|
* Every child agent recorded for one parent session.
|
|
152
176
|
*
|
|
@@ -191,6 +215,12 @@ export declare class SidecarSupervisor extends EventEmitter {
|
|
|
191
215
|
onReverseRequest(method: string, handler: SidecarReverseHandler): void;
|
|
192
216
|
/** Returns the most recent ready snapshot collected at boot. */
|
|
193
217
|
getBootSnapshot(): SidecarHealthSnapshot | null;
|
|
218
|
+
/** Query commercial license status from the native engine (`disabled` on public builds). */
|
|
219
|
+
getLicenseStatus(): Promise<SidecarLicenseStatus>;
|
|
220
|
+
/** Hot-reload the `.lic` file inside the native engine without restarting the sidecar. */
|
|
221
|
+
reloadLicense(): Promise<SidecarLicenseStatus>;
|
|
222
|
+
/** Pre-verify candidate `.lic` text before atomic disk replacement. */
|
|
223
|
+
verifyLicense(content: string): Promise<SidecarLicenseStatus>;
|
|
194
224
|
/**
|
|
195
225
|
* W4-3: the layer-1 (sidecar process sandbox) posture recorded at
|
|
196
226
|
* spawn-plan time. This is the value the renderer reads (via
|
|
@@ -307,6 +307,41 @@ export class SidecarSupervisor extends EventEmitter {
|
|
|
307
307
|
return null;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Phase 10 R3: authoritatively compact a durable session in `sessions.db`
|
|
312
|
+
* (with optional Partial Compaction `focus`, `keepHeadTurns`, `keepTailMessages`).
|
|
313
|
+
*/
|
|
314
|
+
async sessionCompact(params) {
|
|
315
|
+
try {
|
|
316
|
+
return await this.call('agent.session.compact', { ...params }, { timeoutMs: 60_000 });
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Phase 10 R3: fetch live token & wire-byte budget status for `sessions.db`.
|
|
324
|
+
*/
|
|
325
|
+
async sessionContextStatus(params) {
|
|
326
|
+
try {
|
|
327
|
+
return await this.call('agent.session.context_status', { ...params }, { timeoutMs: 10_000 });
|
|
328
|
+
}
|
|
329
|
+
catch {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Phase 10 R3: queue manual/partial compaction on an active CoreLoop turn.
|
|
335
|
+
*/
|
|
336
|
+
async compactChat(streamId, options) {
|
|
337
|
+
try {
|
|
338
|
+
const res = await this.call('agent.chat.compact', { streamId, ...options }, { timeoutMs: 5_000 });
|
|
339
|
+
return res.ok === true;
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
310
345
|
/**
|
|
311
346
|
* Every child agent recorded for one parent session.
|
|
312
347
|
*
|
|
@@ -375,6 +410,18 @@ export class SidecarSupervisor extends EventEmitter {
|
|
|
375
410
|
getBootSnapshot() {
|
|
376
411
|
return this.readyHealth;
|
|
377
412
|
}
|
|
413
|
+
/** Query commercial license status from the native engine (`disabled` on public builds). */
|
|
414
|
+
async getLicenseStatus() {
|
|
415
|
+
return this.call('license.status', {});
|
|
416
|
+
}
|
|
417
|
+
/** Hot-reload the `.lic` file inside the native engine without restarting the sidecar. */
|
|
418
|
+
async reloadLicense() {
|
|
419
|
+
return this.call('license.reload', {});
|
|
420
|
+
}
|
|
421
|
+
/** Pre-verify candidate `.lic` text before atomic disk replacement. */
|
|
422
|
+
async verifyLicense(content) {
|
|
423
|
+
return this.call('license.verify', { content });
|
|
424
|
+
}
|
|
378
425
|
/**
|
|
379
426
|
* W4-3: the layer-1 (sidecar process sandbox) posture recorded at
|
|
380
427
|
* spawn-plan time. This is the value the renderer reads (via
|
package/dist/sidecar/types.d.ts
CHANGED
|
@@ -184,6 +184,46 @@ export interface SidecarSessionMessages {
|
|
|
184
184
|
content: string;
|
|
185
185
|
}>;
|
|
186
186
|
}
|
|
187
|
+
/** Phase 10 R3: `agent.session.compact` parameters (supports Partial Compaction). */
|
|
188
|
+
export interface SidecarSessionCompactParams {
|
|
189
|
+
recordId: string;
|
|
190
|
+
focus?: string;
|
|
191
|
+
keepHeadTurns?: number;
|
|
192
|
+
keepTailMessages?: number;
|
|
193
|
+
provider?: string;
|
|
194
|
+
model?: string;
|
|
195
|
+
apiKey?: string;
|
|
196
|
+
baseUrl?: string;
|
|
197
|
+
maxContextTokens?: number;
|
|
198
|
+
maxRequestBytes?: number;
|
|
199
|
+
}
|
|
200
|
+
/** Phase 10 R3: `agent.session.compact` result. */
|
|
201
|
+
export interface SidecarSessionCompactResult {
|
|
202
|
+
recordId: string;
|
|
203
|
+
recordExists: boolean;
|
|
204
|
+
compacted: number;
|
|
205
|
+
preTokens: number;
|
|
206
|
+
postTokens: number;
|
|
207
|
+
preBytes: number;
|
|
208
|
+
postBytes: number;
|
|
209
|
+
summaryText?: string;
|
|
210
|
+
messages: Array<{
|
|
211
|
+
seq: number;
|
|
212
|
+
role: string;
|
|
213
|
+
content: string;
|
|
214
|
+
}>;
|
|
215
|
+
}
|
|
216
|
+
/** Phase 10 R3: `agent.session.context_status` result. */
|
|
217
|
+
export interface SidecarSessionContextStatus {
|
|
218
|
+
recordId: string;
|
|
219
|
+
recordExists: boolean;
|
|
220
|
+
estimatedTokens: number;
|
|
221
|
+
maxContextTokens: number;
|
|
222
|
+
estimatedBytes: number;
|
|
223
|
+
maxRequestBytes: number;
|
|
224
|
+
messageCount: number;
|
|
225
|
+
compactionCount: number;
|
|
226
|
+
}
|
|
187
227
|
/**
|
|
188
228
|
* `agent.children.list` result: the durable child-agent index for one parent
|
|
189
229
|
* session. `status` is composed, never stored raw — a terminal row reports
|
|
@@ -518,6 +558,12 @@ export interface SidecarChatStreamRequest {
|
|
|
518
558
|
* starts with `..`.
|
|
519
559
|
*/
|
|
520
560
|
pathBase?: string;
|
|
561
|
+
/**
|
|
562
|
+
* Authoritative host map of unresolved `outcome_unknown` tool locks
|
|
563
|
+
* (`toolName -> reconciliationId`), synced before opening a new turn.
|
|
564
|
+
*/
|
|
565
|
+
pendingReconciliations?: Record<string, string>;
|
|
566
|
+
policyDigest?: string;
|
|
521
567
|
};
|
|
522
568
|
}
|
|
523
569
|
/**
|
|
@@ -762,3 +808,29 @@ export interface SidecarModelCatalog {
|
|
|
762
808
|
reasoningEffort: string | null;
|
|
763
809
|
};
|
|
764
810
|
}
|
|
811
|
+
export type SidecarLicenseState = 'disabled' | 'valid' | 'expiring' | 'grace' | 'expired' | 'invalid';
|
|
812
|
+
export interface SidecarLicenseStatus {
|
|
813
|
+
enforced: boolean;
|
|
814
|
+
state: SidecarLicenseState;
|
|
815
|
+
errorCode: string | null;
|
|
816
|
+
message: string | null;
|
|
817
|
+
licenseId: string | null;
|
|
818
|
+
customer: string | null;
|
|
819
|
+
product: string | null;
|
|
820
|
+
features: string[];
|
|
821
|
+
issuedAt?: string | null;
|
|
822
|
+
notBefore: string | null;
|
|
823
|
+
notAfter: string | null;
|
|
824
|
+
graceDays: number | null;
|
|
825
|
+
expiringNoticeDays?: number | null;
|
|
826
|
+
daysRemaining: number | null;
|
|
827
|
+
graceDaysRemaining: number | null;
|
|
828
|
+
maxUsers: number | null;
|
|
829
|
+
maxConcurrentRuns: number | null;
|
|
830
|
+
activeConcurrentRuns: number;
|
|
831
|
+
deploymentId: string | null;
|
|
832
|
+
boundDeploymentId?: string | null;
|
|
833
|
+
keyEnvironment?: string | null;
|
|
834
|
+
observedNow?: number;
|
|
835
|
+
maxRecordedTime?: number | null;
|
|
836
|
+
}
|