@hearsay-tools/squawk 0.18.0-dev.8043 → 0.18.0-dev.8044
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/built-in-cli-commands.d.ts +3 -0
- package/dist/built-in-cli-commands.js +152 -0
- package/dist/built-in-cli-commands.js.map +1 -0
- package/dist/cli-dispatch.js +13 -73
- package/dist/cli-dispatch.js.map +1 -1
- package/dist/core/cli-registry.d.ts +50 -0
- package/dist/core/cli-registry.js +13 -0
- package/dist/core/cli-registry.js.map +1 -0
- package/dist/delegation/transport.d.ts +10 -10
- package/dist/home/backup-args.d.ts +18 -0
- package/dist/home/backup-args.js +35 -0
- package/dist/home/backup-args.js.map +1 -0
- package/dist/home/entry.js +9 -6
- package/dist/home/entry.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/runs/run-archive.d.ts +72 -72
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/server.d.ts +6 -6
- package/dist/subcommands.d.ts +2 -10
- package/dist/subcommands.js +11 -62
- package/dist/subcommands.js.map +1 -1
- package/dist/workflows/continuation-admission.d.ts +72 -72
- package/dist/workspace/backups.d.ts +1 -18
- package/dist/workspace/backups.js +2 -34
- package/dist/workspace/backups.js.map +1 -1
- package/package.json +4 -4
|
@@ -228,30 +228,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
|
|
|
228
228
|
deadline: string;
|
|
229
229
|
seconds: number;
|
|
230
230
|
note?: string | undefined;
|
|
231
|
-
} | {
|
|
232
|
-
id: string;
|
|
233
|
-
source: "agent" | "cezar";
|
|
234
|
-
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
235
|
-
registeredAt: string;
|
|
236
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
237
|
-
resolvedAt?: string | undefined;
|
|
238
|
-
deliveredAt?: string | undefined;
|
|
239
|
-
cancelledAt?: string | undefined;
|
|
240
|
-
turnId: string;
|
|
241
|
-
kind: "process";
|
|
242
|
-
deadline: string;
|
|
243
|
-
timeoutSeconds: number;
|
|
244
|
-
pid: number;
|
|
245
|
-
startToken?: string | undefined;
|
|
246
|
-
exitFile?: string | undefined;
|
|
247
|
-
note?: string | undefined;
|
|
248
|
-
result?: {
|
|
249
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
250
|
-
observedAt: string;
|
|
251
|
-
exitCode?: number | undefined;
|
|
252
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
253
|
-
diagnostic?: string | undefined;
|
|
254
|
-
} | undefined;
|
|
255
231
|
} | {
|
|
256
232
|
id: string;
|
|
257
233
|
source: "agent" | "cezar";
|
|
@@ -313,6 +289,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
|
|
|
313
289
|
reason: "outcome" | "timeout";
|
|
314
290
|
} | undefined;
|
|
315
291
|
wakeInputId?: string | undefined;
|
|
292
|
+
} | {
|
|
293
|
+
id: string;
|
|
294
|
+
source: "agent" | "cezar";
|
|
295
|
+
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
296
|
+
registeredAt: string;
|
|
297
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
298
|
+
resolvedAt?: string | undefined;
|
|
299
|
+
deliveredAt?: string | undefined;
|
|
300
|
+
cancelledAt?: string | undefined;
|
|
301
|
+
turnId: string;
|
|
302
|
+
kind: "process";
|
|
303
|
+
deadline: string;
|
|
304
|
+
timeoutSeconds: number;
|
|
305
|
+
pid: number;
|
|
306
|
+
startToken?: string | undefined;
|
|
307
|
+
exitFile?: string | undefined;
|
|
308
|
+
note?: string | undefined;
|
|
309
|
+
result?: {
|
|
310
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
311
|
+
observedAt: string;
|
|
312
|
+
exitCode?: number | undefined;
|
|
313
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
314
|
+
diagnostic?: string | undefined;
|
|
315
|
+
} | undefined;
|
|
316
316
|
} | {
|
|
317
317
|
id: string;
|
|
318
318
|
source: "agent" | "cezar";
|
|
@@ -440,30 +440,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
|
|
|
440
440
|
deadline: string;
|
|
441
441
|
seconds: number;
|
|
442
442
|
note?: string | undefined;
|
|
443
|
-
} | {
|
|
444
|
-
id: string;
|
|
445
|
-
source: "agent" | "cezar";
|
|
446
|
-
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
447
|
-
registeredAt: string;
|
|
448
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
449
|
-
resolvedAt?: string | undefined;
|
|
450
|
-
deliveredAt?: string | undefined;
|
|
451
|
-
cancelledAt?: string | undefined;
|
|
452
|
-
turnId: string;
|
|
453
|
-
kind: "process";
|
|
454
|
-
deadline: string;
|
|
455
|
-
timeoutSeconds: number;
|
|
456
|
-
pid: number;
|
|
457
|
-
startToken?: string | undefined;
|
|
458
|
-
exitFile?: string | undefined;
|
|
459
|
-
note?: string | undefined;
|
|
460
|
-
result?: {
|
|
461
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
462
|
-
observedAt: string;
|
|
463
|
-
exitCode?: number | undefined;
|
|
464
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
465
|
-
diagnostic?: string | undefined;
|
|
466
|
-
} | undefined;
|
|
467
443
|
} | {
|
|
468
444
|
id: string;
|
|
469
445
|
source: "agent" | "cezar";
|
|
@@ -525,6 +501,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
|
|
|
525
501
|
reason: "outcome" | "timeout";
|
|
526
502
|
} | undefined;
|
|
527
503
|
wakeInputId?: string | undefined;
|
|
504
|
+
} | {
|
|
505
|
+
id: string;
|
|
506
|
+
source: "agent" | "cezar";
|
|
507
|
+
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
508
|
+
registeredAt: string;
|
|
509
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
510
|
+
resolvedAt?: string | undefined;
|
|
511
|
+
deliveredAt?: string | undefined;
|
|
512
|
+
cancelledAt?: string | undefined;
|
|
513
|
+
turnId: string;
|
|
514
|
+
kind: "process";
|
|
515
|
+
deadline: string;
|
|
516
|
+
timeoutSeconds: number;
|
|
517
|
+
pid: number;
|
|
518
|
+
startToken?: string | undefined;
|
|
519
|
+
exitFile?: string | undefined;
|
|
520
|
+
note?: string | undefined;
|
|
521
|
+
result?: {
|
|
522
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
523
|
+
observedAt: string;
|
|
524
|
+
exitCode?: number | undefined;
|
|
525
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
526
|
+
diagnostic?: string | undefined;
|
|
527
|
+
} | undefined;
|
|
528
528
|
} | {
|
|
529
529
|
id: string;
|
|
530
530
|
source: "agent" | "cezar";
|
|
@@ -651,30 +651,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
|
|
|
651
651
|
deadline: string;
|
|
652
652
|
seconds: number;
|
|
653
653
|
note?: string | undefined;
|
|
654
|
-
} | {
|
|
655
|
-
id: string;
|
|
656
|
-
source: "agent" | "cezar";
|
|
657
|
-
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
658
|
-
registeredAt: string;
|
|
659
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
660
|
-
resolvedAt?: string | undefined;
|
|
661
|
-
deliveredAt?: string | undefined;
|
|
662
|
-
cancelledAt?: string | undefined;
|
|
663
|
-
turnId: string;
|
|
664
|
-
kind: "process";
|
|
665
|
-
deadline: string;
|
|
666
|
-
timeoutSeconds: number;
|
|
667
|
-
pid: number;
|
|
668
|
-
startToken?: string | undefined;
|
|
669
|
-
exitFile?: string | undefined;
|
|
670
|
-
note?: string | undefined;
|
|
671
|
-
result?: {
|
|
672
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
673
|
-
observedAt: string;
|
|
674
|
-
exitCode?: number | undefined;
|
|
675
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
676
|
-
diagnostic?: string | undefined;
|
|
677
|
-
} | undefined;
|
|
678
654
|
} | {
|
|
679
655
|
id: string;
|
|
680
656
|
source: "agent" | "cezar";
|
|
@@ -736,6 +712,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
|
|
|
736
712
|
reason: "outcome" | "timeout";
|
|
737
713
|
} | undefined;
|
|
738
714
|
wakeInputId?: string | undefined;
|
|
715
|
+
} | {
|
|
716
|
+
id: string;
|
|
717
|
+
source: "agent" | "cezar";
|
|
718
|
+
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
719
|
+
registeredAt: string;
|
|
720
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
721
|
+
resolvedAt?: string | undefined;
|
|
722
|
+
deliveredAt?: string | undefined;
|
|
723
|
+
cancelledAt?: string | undefined;
|
|
724
|
+
turnId: string;
|
|
725
|
+
kind: "process";
|
|
726
|
+
deadline: string;
|
|
727
|
+
timeoutSeconds: number;
|
|
728
|
+
pid: number;
|
|
729
|
+
startToken?: string | undefined;
|
|
730
|
+
exitFile?: string | undefined;
|
|
731
|
+
note?: string | undefined;
|
|
732
|
+
result?: {
|
|
733
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
734
|
+
observedAt: string;
|
|
735
|
+
exitCode?: number | undefined;
|
|
736
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
737
|
+
diagnostic?: string | undefined;
|
|
738
|
+
} | undefined;
|
|
739
739
|
} | {
|
|
740
740
|
id: string;
|
|
741
741
|
source: "agent" | "cezar";
|
|
@@ -16,6 +16,12 @@ export declare function createLiveRoutes({ resolveProject, serverGeneration, res
|
|
|
16
16
|
output: {
|
|
17
17
|
generation: string;
|
|
18
18
|
results: ({
|
|
19
|
+
projectId: string;
|
|
20
|
+
runId: string;
|
|
21
|
+
type: "error" | "reset";
|
|
22
|
+
status: 400 | 404 | 409 | 413 | 503;
|
|
23
|
+
error: string;
|
|
24
|
+
} | {
|
|
19
25
|
projectId: string;
|
|
20
26
|
runId: string;
|
|
21
27
|
type: "batch";
|
|
@@ -29,12 +35,6 @@ export declare function createLiveRoutes({ resolveProject, serverGeneration, res
|
|
|
29
35
|
cursor: string;
|
|
30
36
|
afterSeq: number;
|
|
31
37
|
hasMore: boolean;
|
|
32
|
-
} | {
|
|
33
|
-
projectId: string;
|
|
34
|
-
runId: string;
|
|
35
|
-
type: "error" | "reset";
|
|
36
|
-
status: 400 | 404 | 409 | 413 | 503;
|
|
37
|
-
error: string;
|
|
38
38
|
})[];
|
|
39
39
|
};
|
|
40
40
|
outputFormat: "json";
|
package/dist/server/server.d.ts
CHANGED
|
@@ -3105,6 +3105,12 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
3105
3105
|
output: {
|
|
3106
3106
|
generation: string;
|
|
3107
3107
|
results: ({
|
|
3108
|
+
projectId: string;
|
|
3109
|
+
runId: string;
|
|
3110
|
+
type: "error" | "reset";
|
|
3111
|
+
status: 400 | 404 | 409 | 413 | 503;
|
|
3112
|
+
error: string;
|
|
3113
|
+
} | {
|
|
3108
3114
|
projectId: string;
|
|
3109
3115
|
runId: string;
|
|
3110
3116
|
type: "batch";
|
|
@@ -3118,12 +3124,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
3118
3124
|
cursor: string;
|
|
3119
3125
|
afterSeq: number;
|
|
3120
3126
|
hasMore: boolean;
|
|
3121
|
-
} | {
|
|
3122
|
-
projectId: string;
|
|
3123
|
-
runId: string;
|
|
3124
|
-
type: "error" | "reset";
|
|
3125
|
-
status: 400 | 404 | 409 | 413 | 503;
|
|
3126
|
-
error: string;
|
|
3127
3127
|
})[];
|
|
3128
3128
|
};
|
|
3129
3129
|
outputFormat: "json";
|
package/dist/subcommands.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The CLI subcommands that take flags of their own, so `index.ts` runs them before its global
|
|
3
|
-
* parseArgs: their flags are not cockpit flags (#504, #774, #1576). Each module loads only when
|
|
4
|
-
* its command runs.
|
|
5
|
-
*/
|
|
6
1
|
import type { Home } from './home/home.ts';
|
|
7
|
-
export type SubcommandRunner
|
|
8
|
-
export declare
|
|
9
|
-
/** The runner for `name`, or nothing when `name` is not a subcommand. */
|
|
10
|
-
export declare function loadSubcommand(name: string | undefined, home?: (env: NodeJS.ProcessEnv) => Home): Promise<SubcommandRunner | undefined>;
|
|
11
|
-
/** Run `argv[0]` when it names a subcommand and answer its exit code; anything else is not ours. */
|
|
2
|
+
export type { SubcommandRunner } from './core/cli-registry.ts';
|
|
3
|
+
export declare function loadSubcommand(name: string | undefined, home?: (env: NodeJS.ProcessEnv) => Home): Promise<import("./core/cli-registry.ts").SubcommandRunner | undefined>;
|
|
12
4
|
export declare function runSubcommand(argv: string[], env: NodeJS.ProcessEnv, home?: () => Home): Promise<number | undefined>;
|
|
13
5
|
/** Install process services before loading commands that read runner or removal registries. */
|
|
14
6
|
export declare function prepareCommandRuntime(command: string, argv?: readonly string[]): Promise<void>;
|
package/dist/subcommands.js
CHANGED
|
@@ -1,68 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The CLI subcommands that take flags of their own, so `index.ts` runs them before its global
|
|
3
|
-
* parseArgs: their flags are not cockpit flags (#504, #774, #1576). Each module loads only when
|
|
4
|
-
* its command runs.
|
|
5
|
-
*/
|
|
6
1
|
import { resolveHome } from './home/resolve.js';
|
|
7
|
-
import {
|
|
8
|
-
export const SUBCOMMAND_NAMES = ['backup', 'discover', 'artifact', 'job', 'task', 'automation', 'webhook', 'worker', 'message', 'remote-settings', 'migrate', 'server-migrate', 'migrate-project'];
|
|
9
|
-
/** An unreadable marker still marks the split home as in use: list it, as before the fallback. */
|
|
10
|
-
function hasInstallMarker(root) {
|
|
11
|
-
try {
|
|
12
|
-
return readInstallMarker(root) !== undefined;
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
/** The runner for `name`, or nothing when `name` is not a subcommand. */
|
|
2
|
+
import { cliCommand } from './core/cli-registry.js';
|
|
19
3
|
export async function loadSubcommand(name, home = env => resolveHome({ purpose: 'cli', env })) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
case 'migrate-project': return (await import('./project-migration/cli.js')).migrateProjectRunner(env => {
|
|
23
|
-
return [resolveHome({ purpose: 'cli', env, layout: 'legacy' }), resolveHome({ purpose: 'cli', env, layout: 'split' })];
|
|
24
|
-
});
|
|
25
|
-
case 'server-migrate': return async (argv, env) => {
|
|
26
|
-
const legacy = resolveHome({ purpose: 'cli', env, layout: 'legacy' }), target = resolveHome({ purpose: 'cli', env, layout: 'split' });
|
|
27
|
-
return (await import('./server-install/migrate-cli.js')).runServerMigrateCommand(argv, env, { legacy, target });
|
|
28
|
-
};
|
|
29
|
-
case 'backup': return async (argv, env) => {
|
|
30
|
-
const selected = operatorHelp('backup', argv) ? resolveHome({ purpose: 'cli', env }) : home(env);
|
|
31
|
-
const source = selected.layout === 'split' && argv[0] === 'list' && !hasInstallMarker(selected.config)
|
|
32
|
-
? resolveHome({ purpose: 'cli', env, layout: 'legacy' }) : selected;
|
|
33
|
-
return (await import('./workspace/backup-cli.js')).runBackupCommand(argv, env, source, { contained: source !== selected });
|
|
34
|
-
};
|
|
35
|
-
case 'discover': return (await import('./discovery/cli.js')).runDiscoverCommand;
|
|
36
|
-
case 'artifact': return (await import('./artifacts/cli.js')).runArtifactCommand;
|
|
37
|
-
case 'job': return (await import('./jobs/cli.js')).runJobCommand;
|
|
38
|
-
case 'task': return (await import('./task-cli/cli.js')).runTaskCommand;
|
|
39
|
-
case 'automation': return (await import('./automations/automation-cli.js')).runAutomationCommand;
|
|
40
|
-
case 'webhook': return (await import('./webhooks/cli.js')).runWebhookCommand;
|
|
41
|
-
case 'message': return (await import('./delegation/cli.js')).runMessageCommand;
|
|
42
|
-
case 'worker': return (await import('./delegation/cli.js')).runWorkerCommand;
|
|
43
|
-
case 'remote-settings': return async (argv, env) => {
|
|
44
|
-
return (await import('./remote-settings-cli.js')).runRemoteSettingsCommand(argv, env, undefined, operatorHelp('remote-settings', argv)
|
|
45
|
-
? resolveHome({ purpose: 'cli', env }) : home(env));
|
|
46
|
-
};
|
|
47
|
-
default: return undefined;
|
|
48
|
-
}
|
|
4
|
+
const command = cliCommand(name ?? '');
|
|
5
|
+
return command?.parseMode === 'subcommand' ? command.load(home) : undefined;
|
|
49
6
|
}
|
|
50
|
-
/** Run `argv[0]` when it names a subcommand and answer its exit code; anything else is not ours. */
|
|
51
7
|
export async function runSubcommand(argv, env, home = () => resolveHome({ purpose: 'cli', env })) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
8
|
+
const command = cliCommand(argv[0] ?? '');
|
|
9
|
+
if (command?.parseMode !== 'subcommand')
|
|
10
|
+
return undefined;
|
|
11
|
+
await prepareCommandRuntime(command.name, argv.slice(1));
|
|
12
|
+
const run = await loadSubcommand(command.name, () => home());
|
|
13
|
+
return run(argv.slice(1), env);
|
|
57
14
|
}
|
|
58
15
|
/** Install process services before loading commands that read runner or removal registries. */
|
|
59
16
|
export async function prepareCommandRuntime(command, argv = []) {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const operator = command === 'backup' || command === 'remote-settings';
|
|
63
|
-
const operatorRuntime = operator && !operatorHelp(command, argv);
|
|
64
|
-
if (!worker && !operatorRuntime && !['serve', 'run', 'init', 'projects', 'server-install', 'server-deploy', 'server-uninstall',
|
|
65
|
-
'migrate', 'server-migrate', 'migrate-project', 'discover', 'task'].includes(command))
|
|
17
|
+
const definition = cliCommand(command);
|
|
18
|
+
if (!definition || definition.runtimeMode === 'none' || (typeof definition.runtimeMode === 'function' && !definition.runtimeMode(argv)))
|
|
66
19
|
return;
|
|
67
20
|
const { registerBuiltInRunners, sealBuiltInRunners } = await import('./runners/built-in.js');
|
|
68
21
|
registerBuiltInRunners();
|
|
@@ -74,8 +27,4 @@ export async function prepareCommandRuntime(command, argv = []) {
|
|
|
74
27
|
registerBuiltInStepKinds();
|
|
75
28
|
sealBuiltInStepKinds();
|
|
76
29
|
}
|
|
77
|
-
/** Help must skip both runtime registration and the migrating operator Home factory. */
|
|
78
|
-
function operatorHelp(command, argv) {
|
|
79
|
-
return ['--help', '-h', ...(command === 'remote-settings' ? ['help'] : [])].includes(argv[0] ?? '');
|
|
80
|
-
}
|
|
81
30
|
//# sourceMappingURL=subcommands.js.map
|
package/dist/subcommands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subcommands.js","sourceRoot":"","sources":["../src/subcommands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subcommands.js","sourceRoot":"","sources":["../src/subcommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAwB,EAAE,IAAI,GAAqC,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACjJ,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACvC,OAAO,OAAO,EAAE,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAc,EAAE,GAAsB,EAAE,IAAI,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IAC3H,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1C,IAAI,OAAO,EAAE,SAAS,KAAK,YAAY;QAAE,OAAO,SAAS,CAAC;IAC1D,MAAM,qBAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,OAAO,GAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,+FAA+F;AAC/F,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAAe,EAAE,IAAI,GAAsB,EAAE;IACvF,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,WAAW,KAAK,MAAM,IAAI,CAAC,OAAO,UAAU,CAAC,WAAW,KAAK,UAAU,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO;IAChJ,MAAM,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAC7F,sBAAsB,EAAE,CAAC;IACzB,kBAAkB,EAAE,CAAC;IACrB,MAAM,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;IACjG,uBAAuB,EAAE,CAAC;IAC1B,mBAAmB,EAAE,CAAC;IACtB,MAAM,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC;IAC7G,wBAAwB,EAAE,CAAC;IAC3B,oBAAoB,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -296,6 +296,30 @@ export declare class ContinuationChecks {
|
|
|
296
296
|
deadline: string;
|
|
297
297
|
seconds: number;
|
|
298
298
|
note?: string | undefined;
|
|
299
|
+
} | {
|
|
300
|
+
id: string;
|
|
301
|
+
source: "agent" | "cezar";
|
|
302
|
+
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
303
|
+
registeredAt: string;
|
|
304
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
305
|
+
resolvedAt?: string | undefined;
|
|
306
|
+
deliveredAt?: string | undefined;
|
|
307
|
+
cancelledAt?: string | undefined;
|
|
308
|
+
turnId: string;
|
|
309
|
+
kind: "process";
|
|
310
|
+
deadline: string;
|
|
311
|
+
timeoutSeconds: number;
|
|
312
|
+
pid: number;
|
|
313
|
+
startToken?: string | undefined;
|
|
314
|
+
exitFile?: string | undefined;
|
|
315
|
+
note?: string | undefined;
|
|
316
|
+
result?: {
|
|
317
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
318
|
+
observedAt: string;
|
|
319
|
+
exitCode?: number | undefined;
|
|
320
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
321
|
+
diagnostic?: string | undefined;
|
|
322
|
+
} | undefined;
|
|
299
323
|
} | {
|
|
300
324
|
id: string;
|
|
301
325
|
source: "agent" | "cezar";
|
|
@@ -357,30 +381,6 @@ export declare class ContinuationChecks {
|
|
|
357
381
|
reason: "outcome" | "timeout";
|
|
358
382
|
} | undefined;
|
|
359
383
|
wakeInputId?: string | undefined;
|
|
360
|
-
} | {
|
|
361
|
-
id: string;
|
|
362
|
-
source: "agent" | "cezar";
|
|
363
|
-
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
364
|
-
registeredAt: string;
|
|
365
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
366
|
-
resolvedAt?: string | undefined;
|
|
367
|
-
deliveredAt?: string | undefined;
|
|
368
|
-
cancelledAt?: string | undefined;
|
|
369
|
-
turnId: string;
|
|
370
|
-
kind: "process";
|
|
371
|
-
deadline: string;
|
|
372
|
-
timeoutSeconds: number;
|
|
373
|
-
pid: number;
|
|
374
|
-
startToken?: string | undefined;
|
|
375
|
-
exitFile?: string | undefined;
|
|
376
|
-
note?: string | undefined;
|
|
377
|
-
result?: {
|
|
378
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
379
|
-
observedAt: string;
|
|
380
|
-
exitCode?: number | undefined;
|
|
381
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
382
|
-
diagnostic?: string | undefined;
|
|
383
|
-
} | undefined;
|
|
384
384
|
} | {
|
|
385
385
|
id: string;
|
|
386
386
|
source: "agent" | "cezar";
|
|
@@ -508,6 +508,30 @@ export declare class ContinuationChecks {
|
|
|
508
508
|
deadline: string;
|
|
509
509
|
seconds: number;
|
|
510
510
|
note?: string | undefined;
|
|
511
|
+
} | {
|
|
512
|
+
id: string;
|
|
513
|
+
source: "agent" | "cezar";
|
|
514
|
+
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
515
|
+
registeredAt: string;
|
|
516
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
517
|
+
resolvedAt?: string | undefined;
|
|
518
|
+
deliveredAt?: string | undefined;
|
|
519
|
+
cancelledAt?: string | undefined;
|
|
520
|
+
turnId: string;
|
|
521
|
+
kind: "process";
|
|
522
|
+
deadline: string;
|
|
523
|
+
timeoutSeconds: number;
|
|
524
|
+
pid: number;
|
|
525
|
+
startToken?: string | undefined;
|
|
526
|
+
exitFile?: string | undefined;
|
|
527
|
+
note?: string | undefined;
|
|
528
|
+
result?: {
|
|
529
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
530
|
+
observedAt: string;
|
|
531
|
+
exitCode?: number | undefined;
|
|
532
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
533
|
+
diagnostic?: string | undefined;
|
|
534
|
+
} | undefined;
|
|
511
535
|
} | {
|
|
512
536
|
id: string;
|
|
513
537
|
source: "agent" | "cezar";
|
|
@@ -569,30 +593,6 @@ export declare class ContinuationChecks {
|
|
|
569
593
|
reason: "outcome" | "timeout";
|
|
570
594
|
} | undefined;
|
|
571
595
|
wakeInputId?: string | undefined;
|
|
572
|
-
} | {
|
|
573
|
-
id: string;
|
|
574
|
-
source: "agent" | "cezar";
|
|
575
|
-
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
576
|
-
registeredAt: string;
|
|
577
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
578
|
-
resolvedAt?: string | undefined;
|
|
579
|
-
deliveredAt?: string | undefined;
|
|
580
|
-
cancelledAt?: string | undefined;
|
|
581
|
-
turnId: string;
|
|
582
|
-
kind: "process";
|
|
583
|
-
deadline: string;
|
|
584
|
-
timeoutSeconds: number;
|
|
585
|
-
pid: number;
|
|
586
|
-
startToken?: string | undefined;
|
|
587
|
-
exitFile?: string | undefined;
|
|
588
|
-
note?: string | undefined;
|
|
589
|
-
result?: {
|
|
590
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
591
|
-
observedAt: string;
|
|
592
|
-
exitCode?: number | undefined;
|
|
593
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
594
|
-
diagnostic?: string | undefined;
|
|
595
|
-
} | undefined;
|
|
596
596
|
} | {
|
|
597
597
|
id: string;
|
|
598
598
|
source: "agent" | "cezar";
|
|
@@ -719,6 +719,30 @@ export declare class ContinuationChecks {
|
|
|
719
719
|
deadline: string;
|
|
720
720
|
seconds: number;
|
|
721
721
|
note?: string | undefined;
|
|
722
|
+
} | {
|
|
723
|
+
id: string;
|
|
724
|
+
source: "agent" | "cezar";
|
|
725
|
+
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
726
|
+
registeredAt: string;
|
|
727
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
728
|
+
resolvedAt?: string | undefined;
|
|
729
|
+
deliveredAt?: string | undefined;
|
|
730
|
+
cancelledAt?: string | undefined;
|
|
731
|
+
turnId: string;
|
|
732
|
+
kind: "process";
|
|
733
|
+
deadline: string;
|
|
734
|
+
timeoutSeconds: number;
|
|
735
|
+
pid: number;
|
|
736
|
+
startToken?: string | undefined;
|
|
737
|
+
exitFile?: string | undefined;
|
|
738
|
+
note?: string | undefined;
|
|
739
|
+
result?: {
|
|
740
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
741
|
+
observedAt: string;
|
|
742
|
+
exitCode?: number | undefined;
|
|
743
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
744
|
+
diagnostic?: string | undefined;
|
|
745
|
+
} | undefined;
|
|
722
746
|
} | {
|
|
723
747
|
id: string;
|
|
724
748
|
source: "agent" | "cezar";
|
|
@@ -780,30 +804,6 @@ export declare class ContinuationChecks {
|
|
|
780
804
|
reason: "outcome" | "timeout";
|
|
781
805
|
} | undefined;
|
|
782
806
|
wakeInputId?: string | undefined;
|
|
783
|
-
} | {
|
|
784
|
-
id: string;
|
|
785
|
-
source: "agent" | "cezar";
|
|
786
|
-
via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
|
|
787
|
-
registeredAt: string;
|
|
788
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
789
|
-
resolvedAt?: string | undefined;
|
|
790
|
-
deliveredAt?: string | undefined;
|
|
791
|
-
cancelledAt?: string | undefined;
|
|
792
|
-
turnId: string;
|
|
793
|
-
kind: "process";
|
|
794
|
-
deadline: string;
|
|
795
|
-
timeoutSeconds: number;
|
|
796
|
-
pid: number;
|
|
797
|
-
startToken?: string | undefined;
|
|
798
|
-
exitFile?: string | undefined;
|
|
799
|
-
note?: string | undefined;
|
|
800
|
-
result?: {
|
|
801
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
802
|
-
observedAt: string;
|
|
803
|
-
exitCode?: number | undefined;
|
|
804
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
805
|
-
diagnostic?: string | undefined;
|
|
806
|
-
} | undefined;
|
|
807
807
|
} | {
|
|
808
808
|
id: string;
|
|
809
809
|
source: "agent" | "cezar";
|
|
@@ -6,24 +6,7 @@ export interface BackupEntry {
|
|
|
6
6
|
time: string;
|
|
7
7
|
path: string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
/** The newest allowed backup time for `--at`; NaN when the value is not an ISO UTC time. */
|
|
11
|
-
export declare function restoreLimit(at: string | undefined): number;
|
|
12
|
-
/** The one parser for `backup` arguments: the command and its home entry read the same options. */
|
|
13
|
-
export declare function parseBackupArgs(argv: readonly string[]): {
|
|
14
|
-
values: {
|
|
15
|
-
at?: string;
|
|
16
|
-
help?: boolean;
|
|
17
|
-
};
|
|
18
|
-
positionals: string[];
|
|
19
|
-
};
|
|
20
|
-
/** `restore <file> [--at <time>]` with one supported file and no help; anything else is not a restore. */
|
|
21
|
-
export declare function restoreRequest({ values, positionals }: ReturnType<typeof parseBackupArgs>): {
|
|
22
|
-
file: BackupFile;
|
|
23
|
-
at: string | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
/** A restore that will run: its arguments parse and its time is valid. Anything else is help or a usage error. */
|
|
26
|
-
export declare function isValidRestore(argv: readonly string[]): boolean;
|
|
9
|
+
export { isBackupFile, restoreLimit, parseBackupArgs, restoreRequest, isValidRestore } from '../home/backup-args.ts';
|
|
27
10
|
/** `contained` lists a home this command does not own: every read must stay inside its root. */
|
|
28
11
|
export declare function listBackups(file: BackupFile | undefined, home: string | Home, { contained }?: {
|
|
29
12
|
contained?: boolean | undefined;
|
|
@@ -1,44 +1,12 @@
|
|
|
1
1
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
2
|
import { linkSync, mkdirSync, readFileSync, readdirSync, statSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { basename, dirname, join } from 'node:path';
|
|
4
|
-
import { parseArgs } from 'node:util';
|
|
5
4
|
import { assertSquawkHomeWriteIsSandboxed } from '../paths.js';
|
|
6
5
|
import { assertHomePaths } from '../home/boundary.js';
|
|
7
|
-
import { homeFileSchema } from '../contract/index.js';
|
|
8
6
|
import { homeFileLocation, homePathLocation } from '../home/file-location.js';
|
|
9
7
|
export const BACKUP_FILES = ['config.json', 'config.json.bak', 'agent-accounts.json', 'ui-state.json', 'server.json', 'server.install.lock'];
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
/** The newest allowed backup time for `--at`; NaN when the value is not an ISO UTC time. */
|
|
14
|
-
export function restoreLimit(at) {
|
|
15
|
-
if (at === undefined)
|
|
16
|
-
return Infinity;
|
|
17
|
-
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/.test(at) ? Date.parse(at) : NaN;
|
|
18
|
-
}
|
|
19
|
-
/** The one parser for `backup` arguments: the command and its home entry read the same options. */
|
|
20
|
-
export function parseBackupArgs(argv) {
|
|
21
|
-
return parseArgs({ args: [...argv], allowPositionals: true, options: {
|
|
22
|
-
at: { type: 'string' }, help: { type: 'boolean', short: 'h' },
|
|
23
|
-
} });
|
|
24
|
-
}
|
|
25
|
-
/** `restore <file> [--at <time>]` with one supported file and no help; anything else is not a restore. */
|
|
26
|
-
export function restoreRequest({ values, positionals }) {
|
|
27
|
-
const [command, file] = positionals;
|
|
28
|
-
if (values.help || command !== 'restore' || positionals.length !== 2 || file === undefined || !isBackupFile(file))
|
|
29
|
-
return undefined;
|
|
30
|
-
return { file, at: values.at };
|
|
31
|
-
}
|
|
32
|
-
/** A restore that will run: its arguments parse and its time is valid. Anything else is help or a usage error. */
|
|
33
|
-
export function isValidRestore(argv) {
|
|
34
|
-
try {
|
|
35
|
-
const request = restoreRequest(parseBackupArgs(argv));
|
|
36
|
-
return request !== undefined && !Number.isNaN(restoreLimit(request.at));
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
8
|
+
export { isBackupFile, restoreLimit, parseBackupArgs, restoreRequest, isValidRestore } from '../home/backup-args.js';
|
|
9
|
+
import { isBackupFile } from '../home/backup-args.js';
|
|
42
10
|
function backupRoot(home) {
|
|
43
11
|
return typeof home === 'string' ? join(home, 'backups') : home.backups;
|
|
44
12
|
}
|