@evomap/evolver-cli 2.0.32 → 2.0.34
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/atp.js +6 -1
- package/dist/autoexec.d.ts +2 -6
- package/dist/autoexec.js +18 -17
- package/dist/distillObserver.js +21 -7
- package/dist/distillPrimitives.d.ts +39 -6
- package/dist/distillPrimitives.js +293 -75
- package/dist/index.js +153 -21
- package/dist/lifecycleBootstrapTransaction.js +123 -8
- package/dist/materialPackage.d.ts +4 -0
- package/dist/materialPackage.js +30 -9
- package/dist/materialSnapshot.d.ts +3 -0
- package/dist/materialSnapshot.js +49 -3
- package/dist/migrate/oauthImport.js +4 -1
- package/dist/setupHooks.js +121 -2
- package/dist/setupHooksLifecycle.d.ts +73 -0
- package/dist/setupHooksLifecycle.js +448 -0
- package/package.json +7 -7
package/dist/materialSnapshot.js
CHANGED
|
@@ -14,7 +14,9 @@ function isRecord(value) {
|
|
|
14
14
|
function trimText(value, remaining) {
|
|
15
15
|
if (remaining <= 0)
|
|
16
16
|
return { text: '', used: 0, truncated: value.length > 0 };
|
|
17
|
-
const redacted = hub.redactString(value)
|
|
17
|
+
const redacted = hub.redactString(value);
|
|
18
|
+
if (!redacted.trim())
|
|
19
|
+
return { text: '', used: 0, truncated: false };
|
|
18
20
|
if (redacted.length <= remaining)
|
|
19
21
|
return { text: redacted, used: redacted.length, truncated: false };
|
|
20
22
|
return { text: redacted.slice(0, remaining), used: remaining, truncated: true };
|
|
@@ -184,8 +186,11 @@ export function buildRuntimeSessionMaterialSnapshot(sources, maxChars = DEFAULT_
|
|
|
184
186
|
}
|
|
185
187
|
const rawText = snapshotTurnText(turn);
|
|
186
188
|
const trimmed = trimText(rawText, remaining);
|
|
189
|
+
const metadata = isRecord(turn.metadata) && isRecord(turn.metadata['evolverMaterialSnapshot'])
|
|
190
|
+
? turn.metadata['evolverMaterialSnapshot'] : undefined;
|
|
191
|
+
const textTruncated = trimmed.truncated || (rawText === turn.text && metadata?.['textTruncated'] === true);
|
|
187
192
|
remaining -= trimmed.used;
|
|
188
|
-
truncated = truncated ||
|
|
193
|
+
truncated = truncated || textTruncated;
|
|
189
194
|
if (trimmed.text.length > 0) {
|
|
190
195
|
retainedTurnCount += 1;
|
|
191
196
|
turns.push({
|
|
@@ -194,6 +199,7 @@ export function buildRuntimeSessionMaterialSnapshot(sources, maxChars = DEFAULT_
|
|
|
194
199
|
...(turn.isMeta ? { isMeta: true } : {}),
|
|
195
200
|
...(turn.toolName ? { toolName: hub.redactString(turn.toolName).slice(0, 120) } : {}),
|
|
196
201
|
...(turn.errorMessage && trimmed.text ? { errorMessage: trimmed.text } : {}),
|
|
202
|
+
...(textTruncated ? { textTruncated: true } : {}),
|
|
197
203
|
});
|
|
198
204
|
}
|
|
199
205
|
if (remaining <= 0) {
|
|
@@ -226,6 +232,7 @@ export function buildRuntimeSessionMaterialSnapshot(sources, maxChars = DEFAULT_
|
|
|
226
232
|
omittedSourceCount: omittedEvidenceAggregate?.sourceCount ?? 0,
|
|
227
233
|
...(omittedEvidenceAggregate ? { omittedEvidenceAggregate } : {}),
|
|
228
234
|
truncated: truncated || omittedEvidenceAggregate !== undefined,
|
|
235
|
+
preservesTextLayout: true,
|
|
229
236
|
maxChars: safeMaxChars,
|
|
230
237
|
};
|
|
231
238
|
// Source and turn caps make this loop constant-bounded even for very large Cursor databases.
|
|
@@ -269,6 +276,8 @@ function sourceFromSnapshot(value) {
|
|
|
269
276
|
isMeta: turn['isMeta'] === true,
|
|
270
277
|
...(toolName ? { toolName } : {}),
|
|
271
278
|
...(errorMessage ? { errorMessage } : {}),
|
|
279
|
+
...(turn['textTruncated'] !== undefined && turn['textTruncated'] !== false
|
|
280
|
+
? { metadata: { evolverMaterialSnapshot: { textTruncated: true } } } : {}),
|
|
272
281
|
};
|
|
273
282
|
})
|
|
274
283
|
.filter((turn) => turn !== null);
|
|
@@ -290,6 +299,32 @@ function sourceFromSnapshot(value) {
|
|
|
290
299
|
turns,
|
|
291
300
|
};
|
|
292
301
|
}
|
|
302
|
+
/** 旧writer只有一次共享字符截断;整条尾部裁剪不产生新的部分文本。 */
|
|
303
|
+
function legacyTailMayBeTruncated(payload, sources) {
|
|
304
|
+
if (payload['truncated'] !== true || payload['preservesTextLayout'] === true)
|
|
305
|
+
return false;
|
|
306
|
+
const maxChars = payload['maxChars'];
|
|
307
|
+
if (typeof maxChars !== 'number' || !Number.isSafeInteger(maxChars)
|
|
308
|
+
|| maxChars <= 0 || maxChars > DEFAULT_MATERIAL_SNAPSHOT_MAX_CHARS)
|
|
309
|
+
return true;
|
|
310
|
+
let retainedChars = 0;
|
|
311
|
+
// 必须统计原始存储文本,不能过滤后或重复计入errorMessage而制造预算证明。
|
|
312
|
+
for (const source of sources) {
|
|
313
|
+
if (!isRecord(source) || typeof source['agent'] !== 'string' || !source['agent']
|
|
314
|
+
|| typeof source['label'] !== 'string' || !source['label'] || !Array.isArray(source['turns']))
|
|
315
|
+
return true;
|
|
316
|
+
for (const turn of source['turns']) {
|
|
317
|
+
if (!isRecord(turn) || typeof turn['text'] !== 'string' || typeof turn['role'] !== 'string'
|
|
318
|
+
|| !['user', 'assistant', 'tool', 'system'].includes(turn['role']))
|
|
319
|
+
return true;
|
|
320
|
+
retainedChars += turn['text'].length;
|
|
321
|
+
if (retainedChars >= maxChars)
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
// 若部分截断仍被保留,总text长度必然耗尽maxChars;有余量则只发生整条省略。
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
293
328
|
export function runtimeSessionSourcesFromMaterialPayload(payload) {
|
|
294
329
|
if (!isRecord(payload))
|
|
295
330
|
return [];
|
|
@@ -298,9 +333,20 @@ export function runtimeSessionSourcesFromMaterialPayload(payload) {
|
|
|
298
333
|
if (payload['sourceKind'] !== 'runtime_session' || payload['kind'] !== 'session_log')
|
|
299
334
|
return [];
|
|
300
335
|
const sources = Array.isArray(payload['sources']) ? payload['sources'] : [];
|
|
301
|
-
|
|
336
|
+
const restored = sources
|
|
302
337
|
.map(sourceFromSnapshot)
|
|
303
338
|
.filter((source) => source !== null);
|
|
339
|
+
if (legacyTailMayBeTruncated(payload, sources)) {
|
|
340
|
+
// 顺序字符预算只能在全局最后一段保留文本内切断,较早source的尾部不是不完整证据。
|
|
341
|
+
for (let index = restored.length - 1; index >= 0; index--) {
|
|
342
|
+
const tail = restored[index].turns.findLast((turn) => turn.text.trim().length > 0);
|
|
343
|
+
if (!tail)
|
|
344
|
+
continue;
|
|
345
|
+
tail.metadata = { ...(isRecord(tail.metadata) ? tail.metadata : {}), evolverMaterialSnapshot: { textTruncated: true } };
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return restored;
|
|
304
350
|
}
|
|
305
351
|
export function runtimeSessionEvidenceSummariesFromMaterialPayload(payload) {
|
|
306
352
|
if (!isRecord(payload))
|
|
@@ -650,7 +650,10 @@ export async function runMigrateOAuthCommand(argv, io = {}) {
|
|
|
650
650
|
stderr('migrate oauth: failed to load EVOLVER_ENV_FILE\n');
|
|
651
651
|
return 1;
|
|
652
652
|
}
|
|
653
|
-
const report = migrateV1OAuth({
|
|
653
|
+
const report = migrateV1OAuth({
|
|
654
|
+
...parsed,
|
|
655
|
+
env,
|
|
656
|
+
});
|
|
654
657
|
if (json) {
|
|
655
658
|
stdout(`${JSON.stringify(report, null, 2)}\n`);
|
|
656
659
|
}
|
package/dist/setupHooks.js
CHANGED
|
@@ -15,6 +15,7 @@ import { currentTopCursorGenes } from './cursorRewrite.js';
|
|
|
15
15
|
import { resolveProxyBinPath, resolveStableNodePath } from './lifecycle.js';
|
|
16
16
|
import { reviewLedgerForStore } from './reviewFilter.js';
|
|
17
17
|
import { maybeEmitNonGitWorkspaceNotice } from './nonGitWorkspaceNotice.js';
|
|
18
|
+
import { createSetupLifecyclePlan, decodeSetupLifecyclePlan, executeSetupLifecyclePlan, SETUP_LIFECYCLE_SCHEMA, setupLifecycleCapabilities, SetupLifecycleError, verifySetupLifecycle, } from './setupHooksLifecycle.js';
|
|
18
19
|
const requireFromHere = createRequire(import.meta.url);
|
|
19
20
|
function configuredHomeDir() {
|
|
20
21
|
const configured = process.platform === 'win32'
|
|
@@ -42,7 +43,7 @@ function parseFlags(argv) {
|
|
|
42
43
|
}
|
|
43
44
|
return out;
|
|
44
45
|
}
|
|
45
|
-
const USAGE = `usage: evolver setup-hooks [--runtime=${SETUP_RUNTIMES.join('|')}] [--scope=user|project|global] [--root=<dir>] [--env-file=<path>] [--profile-descriptor=<json>] [--service=${SERVICE_TARGETS.join('|')}] [--verify] [--uninstall] [--dry-run] [--force] [--json] [--hook-command="evolver inject session-start"] [--server-node=<absolute-node>] [--server-command=<cmd>] [--server-args=a,b] [--service-command=<cmd>] [--service-args=a,b]\n --verify is read-only for opencode and kiro\n`;
|
|
46
|
+
const USAGE = `usage: evolver setup-hooks [--runtime=${SETUP_RUNTIMES.join('|')}] [--scope=user|project|global] [--root=<dir>] [--lifecycle=capabilities|plan|verify|execute] [--action=install|uninstall] [--confirmed-plan=<base64url>] [--target-id=<id>] [--completed-targets=<id,id>] [--env-file=<path>] [--profile-descriptor=<json>] [--service=${SERVICE_TARGETS.join('|')}] [--verify] [--uninstall] [--dry-run] [--force] [--json] [--hook-command="evolver inject session-start"] [--server-node=<absolute-node>] [--server-command=<cmd>] [--server-args=a,b] [--service-command=<cmd>] [--service-args=a,b]\n --verify is read-only for opencode and kiro\n lifecycle operations are versioned JSON and require --json\n`;
|
|
46
47
|
export function commandNamesForPath(command, platform, pathExt) {
|
|
47
48
|
if (platform !== 'win32' || /\.[^\\/]+$/.test(command))
|
|
48
49
|
return [command];
|
|
@@ -513,7 +514,7 @@ function appendAdapterNotes(text, hints) {
|
|
|
513
514
|
: text;
|
|
514
515
|
}
|
|
515
516
|
const SETUP_VALUE_FLAGS = new Set([
|
|
516
|
-
'runtime', 'platform', 'scope', 'root', 'env-file', 'profile-descriptor', 'service',
|
|
517
|
+
'runtime', 'platform', 'scope', 'root', 'lifecycle', 'action', 'confirmed-plan', 'target-id', 'completed-targets', 'env-file', 'profile-descriptor', 'service',
|
|
517
518
|
'hook-command', 'server-node', 'server-command', 'server-args', 'service-command', 'service-args',
|
|
518
519
|
]);
|
|
519
520
|
function setupHelpRequested(argv) {
|
|
@@ -528,6 +529,121 @@ function setupHelpRequested(argv) {
|
|
|
528
529
|
return !SETUP_VALUE_FLAGS.has(previous.slice(2));
|
|
529
530
|
});
|
|
530
531
|
}
|
|
532
|
+
function lifecycleAction(raw) {
|
|
533
|
+
return raw === 'install' || raw === 'uninstall' ? raw : undefined;
|
|
534
|
+
}
|
|
535
|
+
function runSetupLifecycle(f, runtime, scope, configRoot, emit, deps) {
|
|
536
|
+
const operation = f['lifecycle'];
|
|
537
|
+
if (operation === undefined)
|
|
538
|
+
return undefined;
|
|
539
|
+
const fail = (code, error, exitCode = 2) => {
|
|
540
|
+
if (f['json'] === true)
|
|
541
|
+
emit({ schema: SETUP_LIFECYCLE_SCHEMA, operation, ok: false, code, error });
|
|
542
|
+
else
|
|
543
|
+
process.stderr.write(`[setup-hooks] ${error}\n`);
|
|
544
|
+
return exitCode;
|
|
545
|
+
};
|
|
546
|
+
if (f['json'] !== true)
|
|
547
|
+
return fail('PLAN_INVALID', 'lifecycle operations require --json');
|
|
548
|
+
if (typeof operation !== 'string' || !['capabilities', 'plan', 'verify', 'execute'].includes(operation)) {
|
|
549
|
+
return fail('PLAN_INVALID', 'invalid --lifecycle operation');
|
|
550
|
+
}
|
|
551
|
+
if (f['verify'] !== undefined || f['uninstall'] !== undefined || f['dry-run'] !== undefined || f['force'] !== undefined) {
|
|
552
|
+
return fail('PLAN_INVALID', 'lifecycle operations cannot be combined with legacy mutation flags');
|
|
553
|
+
}
|
|
554
|
+
if (operation !== 'execute' && (f['target-id'] !== undefined || f['completed-targets'] !== undefined)) {
|
|
555
|
+
return fail('PLAN_INVALID', 'target execution flags are valid only for --lifecycle=execute');
|
|
556
|
+
}
|
|
557
|
+
if (operation === 'execute' && f['completed-targets'] !== undefined && f['target-id'] === undefined) {
|
|
558
|
+
return fail('PLAN_INVALID', '--completed-targets requires --target-id');
|
|
559
|
+
}
|
|
560
|
+
const capabilities = setupLifecycleCapabilities(runtime, scope);
|
|
561
|
+
if (operation === 'capabilities') {
|
|
562
|
+
emit({ schema: SETUP_LIFECYCLE_SCHEMA, operation, ok: true, capabilities });
|
|
563
|
+
return 0;
|
|
564
|
+
}
|
|
565
|
+
if (!capabilities.supported)
|
|
566
|
+
return fail('CAPABILITY_UNAVAILABLE', `lifecycle protocol is unavailable for ${runtime}/${scope}`);
|
|
567
|
+
const action = lifecycleAction(f['action']);
|
|
568
|
+
if ((operation === 'plan' || operation === 'execute') && action === undefined) {
|
|
569
|
+
return fail('PLAN_INVALID', '--action=install|uninstall is required');
|
|
570
|
+
}
|
|
571
|
+
const descriptor = profileDescriptorFromFlag(f);
|
|
572
|
+
if (!descriptor.ok)
|
|
573
|
+
return fail('PLAN_INVALID', descriptor.error, 1);
|
|
574
|
+
let server = { command: 'evolver-mcp' };
|
|
575
|
+
let productBridgeNodePath;
|
|
576
|
+
if (operation === 'verify' || action === 'install') {
|
|
577
|
+
try {
|
|
578
|
+
const built = buildServer(f, descriptor.descriptor, deps.resolveMcpNodePath);
|
|
579
|
+
server = built.server;
|
|
580
|
+
productBridgeNodePath = built.nodePath ?? (deps.resolveMcpNodePath ?? resolveStableMcpNodePath)();
|
|
581
|
+
}
|
|
582
|
+
catch (error) {
|
|
583
|
+
return fail('CAPABILITY_UNAVAILABLE', safeSetupOperationError(error), 1);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
const injectionPlan = planInjection(runtime, server);
|
|
587
|
+
const context = {
|
|
588
|
+
runtime,
|
|
589
|
+
scope,
|
|
590
|
+
configRoot,
|
|
591
|
+
injectionPlan,
|
|
592
|
+
installOptions: {
|
|
593
|
+
configRoot,
|
|
594
|
+
server,
|
|
595
|
+
scope,
|
|
596
|
+
...(productBridgeNodePath !== undefined ? { productBridgeNodePath } : {}),
|
|
597
|
+
...(typeof f['hook-command'] === 'string' ? { hookCommand: f['hook-command'] } : {}),
|
|
598
|
+
homeDir: configuredHomeDir(),
|
|
599
|
+
codexHome: process.env['CODEX_HOME'],
|
|
600
|
+
kiroHome: process.env['KIRO_HOME'],
|
|
601
|
+
xdgConfigHome: process.env['XDG_CONFIG_HOME'],
|
|
602
|
+
opencodeConfig: process.env['OPENCODE_CONFIG'],
|
|
603
|
+
opencodeConfigDir: process.env['OPENCODE_CONFIG_DIR'],
|
|
604
|
+
},
|
|
605
|
+
};
|
|
606
|
+
try {
|
|
607
|
+
if (operation === 'plan') {
|
|
608
|
+
const plan = createSetupLifecyclePlan(context, action);
|
|
609
|
+
emit({ schema: SETUP_LIFECYCLE_SCHEMA, operation, ok: true, plan });
|
|
610
|
+
return 0;
|
|
611
|
+
}
|
|
612
|
+
if (operation === 'verify') {
|
|
613
|
+
const verified = verifySetupLifecycle(context);
|
|
614
|
+
emit({ schema: SETUP_LIFECYCLE_SCHEMA, operation, ok: true, verified });
|
|
615
|
+
return 0;
|
|
616
|
+
}
|
|
617
|
+
const encoded = f['confirmed-plan'];
|
|
618
|
+
if (typeof encoded !== 'string' || encoded.length === 0) {
|
|
619
|
+
return fail('PLAN_INVALID', '--confirmed-plan=<base64url> is required');
|
|
620
|
+
}
|
|
621
|
+
const confirmed = decodeSetupLifecyclePlan(encoded);
|
|
622
|
+
if (confirmed.action !== action)
|
|
623
|
+
return fail('PLAN_INVALID', 'confirmed lifecycle plan action does not match --action');
|
|
624
|
+
const targetId = f['target-id'];
|
|
625
|
+
const completedRaw = f['completed-targets'];
|
|
626
|
+
if (targetId !== undefined && (typeof targetId !== 'string' || targetId.length === 0)) {
|
|
627
|
+
return fail('PLAN_INVALID', '--target-id requires a value');
|
|
628
|
+
}
|
|
629
|
+
if (completedRaw !== undefined && typeof completedRaw !== 'string') {
|
|
630
|
+
return fail('PLAN_INVALID', '--completed-targets requires a comma-separated value');
|
|
631
|
+
}
|
|
632
|
+
const result = executeSetupLifecyclePlan(context, confirmed, {
|
|
633
|
+
...(typeof targetId === 'string' ? { targetId } : {}),
|
|
634
|
+
...(typeof completedRaw === 'string' && completedRaw.length > 0
|
|
635
|
+
? { completedTargetIds: completedRaw.split(',').filter(Boolean) }
|
|
636
|
+
: {}),
|
|
637
|
+
});
|
|
638
|
+
emit({ schema: SETUP_LIFECYCLE_SCHEMA, operation, ok: true, result });
|
|
639
|
+
return result.complete ? 0 : 1;
|
|
640
|
+
}
|
|
641
|
+
catch (error) {
|
|
642
|
+
if (error instanceof SetupLifecycleError)
|
|
643
|
+
return fail(error.code, error.message, 1);
|
|
644
|
+
return fail('VERIFY_FAILED', safeSetupOperationError(error), 1);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
531
647
|
export async function runSetupHooks(argv, store, review, deps = {}) {
|
|
532
648
|
if (setupHelpRequested(argv)) {
|
|
533
649
|
process.stdout.write(USAGE);
|
|
@@ -570,6 +686,9 @@ export async function runSetupHooks(argv, store, review, deps = {}) {
|
|
|
570
686
|
const configRoot = typeof f['root'] === 'string' ? f['root'] : process.cwd();
|
|
571
687
|
// claude-code: user scope targets ~/.claude.json regardless of --root; project scope uses configRoot.
|
|
572
688
|
const scope = scopeResult.scope;
|
|
689
|
+
const lifecycleCode = runSetupLifecycle(f, runtime, scope, configRoot, emit, deps);
|
|
690
|
+
if (lifecycleCode !== undefined)
|
|
691
|
+
return lifecycleCode;
|
|
573
692
|
// V1 exposed setup-hooks --verify as a read-only operation. Silently ignoring it is unsafe: the command then
|
|
574
693
|
// falls through to installInjection and can rewrite runtime configuration while the operator asked only to
|
|
575
694
|
// inspect it. V2's JSON MCP installers already have a transaction-free dry-run preflight, so use that as the
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type InjectionPlan, type InstallOptions, type InstallScope, type RuntimeId } from '@evomap/evolver-mcp';
|
|
2
|
+
export declare const SETUP_LIFECYCLE_SCHEMA = "evolver.setup_hooks.lifecycle.v1";
|
|
3
|
+
export declare const SETUP_LIFECYCLE_PLAN_TTL_MS = 120000;
|
|
4
|
+
export type SetupLifecycleAction = 'install' | 'uninstall';
|
|
5
|
+
export type SetupLifecycleOperation = 'plan' | 'verify' | 'install' | 'uninstall';
|
|
6
|
+
export interface SetupLifecycleCapabilities {
|
|
7
|
+
schema: typeof SETUP_LIFECYCLE_SCHEMA;
|
|
8
|
+
runtime: RuntimeId;
|
|
9
|
+
scope: InstallScope;
|
|
10
|
+
supported: boolean;
|
|
11
|
+
operations: Record<SetupLifecycleOperation, boolean>;
|
|
12
|
+
}
|
|
13
|
+
export interface SetupLifecycleTarget {
|
|
14
|
+
target_id: string;
|
|
15
|
+
target_ref: string;
|
|
16
|
+
expected_identity: string;
|
|
17
|
+
disposition: 'installable' | 'removable' | 'already_satisfied';
|
|
18
|
+
impact_hints: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface SetupLifecyclePlan {
|
|
21
|
+
schema: typeof SETUP_LIFECYCLE_SCHEMA;
|
|
22
|
+
plan_id: string;
|
|
23
|
+
generation: string;
|
|
24
|
+
target_set_digest: string;
|
|
25
|
+
intent_digest: string;
|
|
26
|
+
created_at: string;
|
|
27
|
+
expires_at: string;
|
|
28
|
+
action: SetupLifecycleAction;
|
|
29
|
+
runtime: RuntimeId;
|
|
30
|
+
scope: InstallScope;
|
|
31
|
+
targets: SetupLifecycleTarget[];
|
|
32
|
+
}
|
|
33
|
+
export interface SetupLifecycleTargetResult {
|
|
34
|
+
target_id: string;
|
|
35
|
+
outcome: 'installed' | 'removed' | 'already_satisfied' | 'already_absent' | 'failed';
|
|
36
|
+
committed: boolean;
|
|
37
|
+
verified: boolean;
|
|
38
|
+
recovery?: 'REFRESH_PLAN' | 'OPEN_CONFIG' | 'RETRY_VERIFICATION';
|
|
39
|
+
}
|
|
40
|
+
export interface SetupLifecycleExecutionResult {
|
|
41
|
+
schema: typeof SETUP_LIFECYCLE_SCHEMA;
|
|
42
|
+
action: SetupLifecycleAction;
|
|
43
|
+
runtime: RuntimeId;
|
|
44
|
+
scope: InstallScope;
|
|
45
|
+
plan_id: string;
|
|
46
|
+
generation: string;
|
|
47
|
+
target_set_digest: string;
|
|
48
|
+
complete: boolean;
|
|
49
|
+
verified: boolean;
|
|
50
|
+
targets: SetupLifecycleTargetResult[];
|
|
51
|
+
}
|
|
52
|
+
export interface SetupLifecycleExecutionOptions {
|
|
53
|
+
targetId?: string;
|
|
54
|
+
completedTargetIds?: readonly string[];
|
|
55
|
+
}
|
|
56
|
+
export interface SetupLifecycleContext {
|
|
57
|
+
runtime: RuntimeId;
|
|
58
|
+
scope: InstallScope;
|
|
59
|
+
configRoot: string;
|
|
60
|
+
injectionPlan: InjectionPlan;
|
|
61
|
+
installOptions: InstallOptions;
|
|
62
|
+
now?: () => Date;
|
|
63
|
+
}
|
|
64
|
+
export declare class SetupLifecycleError extends Error {
|
|
65
|
+
readonly code: 'CAPABILITY_UNAVAILABLE' | 'PLAN_INVALID' | 'PLAN_EXPIRED' | 'PLAN_STALE' | 'VERIFY_FAILED';
|
|
66
|
+
constructor(code: 'CAPABILITY_UNAVAILABLE' | 'PLAN_INVALID' | 'PLAN_EXPIRED' | 'PLAN_STALE' | 'VERIFY_FAILED', message: string);
|
|
67
|
+
}
|
|
68
|
+
export declare function setupLifecycleCapabilities(runtime: RuntimeId, scope: InstallScope): SetupLifecycleCapabilities;
|
|
69
|
+
export declare function createSetupLifecyclePlan(context: SetupLifecycleContext, action: SetupLifecycleAction): SetupLifecyclePlan;
|
|
70
|
+
export declare function encodeSetupLifecyclePlan(plan: SetupLifecyclePlan): string;
|
|
71
|
+
export declare function decodeSetupLifecyclePlan(raw: string): SetupLifecyclePlan;
|
|
72
|
+
export declare function verifySetupLifecycle(context: SetupLifecycleContext): boolean;
|
|
73
|
+
export declare function executeSetupLifecyclePlan(context: SetupLifecycleContext, confirmed: SetupLifecyclePlan, options?: SetupLifecycleExecutionOptions): SetupLifecycleExecutionResult;
|