@hearsay-tools/squawk 0.18.0-dev.7889 → 0.18.0-dev.7893
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/cli-dispatch.d.ts +1 -2
- package/dist/cli-dispatch.js +7 -3
- package/dist/cli-dispatch.js.map +1 -1
- package/dist/delegation/routes.d.ts +81 -81
- package/dist/delegation/transport.d.ts +21 -21
- package/dist/index.js +42 -36
- package/dist/index.js.map +1 -1
- package/dist/legacy-runs.d.ts +6 -5
- package/dist/legacy-runs.js +16 -3
- package/dist/legacy-runs.js.map +1 -1
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/server.d.ts +98 -98
- package/dist/subcommands.d.ts +2 -0
- package/dist/subcommands.js +23 -2
- package/dist/subcommands.js.map +1 -1
- package/dist/task-cli/cli.js +2 -2
- package/dist/task-cli/cli.js.map +1 -1
- package/package.json +4 -4
package/dist/cli-dispatch.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { operatorHomeEntry, prepareOperatorHome } from './home/entry.ts';
|
|
|
3
3
|
import type { Home } from './home/home.ts';
|
|
4
4
|
import { runSubcommand } from './subcommands.ts';
|
|
5
5
|
import { getRepoInfo } from './server/git.ts';
|
|
6
|
-
import { runProjectsCommand } from './workspace/projects-cli.ts';
|
|
7
6
|
import type { serverCommand } from './server-command.ts';
|
|
8
7
|
import type { TaskAccess } from './headless-run.ts';
|
|
9
8
|
export declare const defaultCliDeps: {
|
|
@@ -12,7 +11,7 @@ export declare const defaultCliDeps: {
|
|
|
12
11
|
prepareOperatorHome: typeof prepareOperatorHome;
|
|
13
12
|
runSubcommand: typeof runSubcommand;
|
|
14
13
|
getRepoInfo: typeof getRepoInfo;
|
|
15
|
-
runProjectsCommand: typeof runProjectsCommand
|
|
14
|
+
runProjectsCommand: (...args: Parameters<typeof import('./workspace/projects-cli.ts').runProjectsCommand>) => Promise<number>;
|
|
16
15
|
process: NodeJS.Process;
|
|
17
16
|
console: Console;
|
|
18
17
|
};
|
package/dist/cli-dispatch.js
CHANGED
|
@@ -3,14 +3,15 @@ import { parseArgs } from 'node:util';
|
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
import { operatorHomeEntry, prepareOperatorHome } from './home/entry.js';
|
|
5
5
|
import { bindManagedCliHome } from './managed-install/runtime-home.js';
|
|
6
|
-
import { runSubcommand } from './subcommands.js';
|
|
6
|
+
import { runSubcommand, prepareCommandRuntime } from './subcommands.js';
|
|
7
7
|
import { getRepoInfo } from './server/git.js';
|
|
8
|
-
import { runProjectsCommand } from './workspace/projects-cli.js';
|
|
9
8
|
import { projectPaths } from './project-paths.js';
|
|
10
9
|
import { assertProjectAdmitted, projectAdmissionRefusal } from './server/cockpit-ownership.js';
|
|
11
10
|
export const defaultCliDeps = {
|
|
12
11
|
parseArgs, operatorHomeEntry, prepareOperatorHome,
|
|
13
|
-
runSubcommand, getRepoInfo,
|
|
12
|
+
runSubcommand, getRepoInfo,
|
|
13
|
+
runProjectsCommand: async (...args) => (await import('./workspace/projects-cli.js')).runProjectsCommand(...args),
|
|
14
|
+
process, console,
|
|
14
15
|
};
|
|
15
16
|
function cliHelp() {
|
|
16
17
|
return `Squawk — local cockpit for AI agent tasks in your repo
|
|
@@ -151,6 +152,9 @@ async function dispatch(deps) {
|
|
|
151
152
|
if (printCliMetadata(deps, values, help))
|
|
152
153
|
return;
|
|
153
154
|
const command = positionals[0] ?? 'serve';
|
|
155
|
+
if (['serve', 'run', 'init', 'projects', 'server-install', 'server-deploy', 'server-uninstall'].includes(command)) {
|
|
156
|
+
await prepareCommandRuntime(command);
|
|
157
|
+
}
|
|
154
158
|
const task = positionals.slice(1).join(' ').trim();
|
|
155
159
|
homeEntry = commandHomeEntry(command, task);
|
|
156
160
|
const cwd = resolve(values.repo ?? deps.process.cwd());
|
package/dist/cli-dispatch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-dispatch.js","sourceRoot":"","sources":["../src/cli-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-dispatch.js","sourceRoot":"","sources":["../src/cli-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAI/F,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,iBAAiB,EAAE,mBAAmB;IACjD,aAAa,EAAE,WAAW;IAC1B,kBAAkB,EAAE,KAAK,EAAE,GAAG,IAAiF,EAAE,EAAE,CACjH,CAAC,MAAM,MAAM,CAAC,6BAA6B,CA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CAAC,WAAW,CAAC;aAC9B,CAAC,CAAC;YACH,OAAO;QACT,KAAK,eAAe;YAClB,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;gBACpE,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;gBACxB,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;YACH,OAAO;QACT,KAAK,kBAAkB;YACrB,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;gBACvE,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;gBACxB,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;YACH,OAAO;QACT;YACE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,IAAI,CAAC,CAAC;YACpD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
|
|
@@ -27,18 +27,6 @@ export declare function delegationFailure(error: unknown): {
|
|
|
27
27
|
export declare function createDelegationRoutes(service: DelegationService, credentials: CredentialRegistry): import("hono/hono-base").HonoBase<Env, {
|
|
28
28
|
"/list": {
|
|
29
29
|
$get: {
|
|
30
|
-
output: {
|
|
31
|
-
error: string;
|
|
32
|
-
code?: "invalid_input" | undefined;
|
|
33
|
-
};
|
|
34
|
-
outputFormat: "json";
|
|
35
|
-
status: 400;
|
|
36
|
-
input: {
|
|
37
|
-
query: {
|
|
38
|
-
offset?: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
} | {
|
|
42
30
|
output: {
|
|
43
31
|
workers: {
|
|
44
32
|
workerId: string;
|
|
@@ -85,24 +73,24 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
85
73
|
offset?: string | undefined;
|
|
86
74
|
};
|
|
87
75
|
};
|
|
76
|
+
} | {
|
|
77
|
+
output: {
|
|
78
|
+
error: string;
|
|
79
|
+
code?: "invalid_input" | undefined;
|
|
80
|
+
};
|
|
81
|
+
outputFormat: "json";
|
|
82
|
+
status: 400;
|
|
83
|
+
input: {
|
|
84
|
+
query: {
|
|
85
|
+
offset?: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
} & {
|
|
91
91
|
"/discover": {
|
|
92
92
|
$post: {
|
|
93
93
|
output: {
|
|
94
|
-
tasks: {
|
|
95
|
-
id: string;
|
|
96
|
-
title: string;
|
|
97
|
-
runner?: string | undefined;
|
|
98
|
-
status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
|
|
99
|
-
attention: "error" | "none" | "permission" | "running" | "unseen" | "waiting";
|
|
100
|
-
attentionLabel: string;
|
|
101
|
-
accepts: boolean;
|
|
102
|
-
reason?: string | undefined;
|
|
103
|
-
}[];
|
|
104
|
-
nextOffset?: number | undefined;
|
|
105
|
-
} | {
|
|
106
94
|
scope: "host-default-account";
|
|
107
95
|
runners: {
|
|
108
96
|
requiresAccountHome?: boolean | undefined;
|
|
@@ -123,6 +111,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
123
111
|
source: "cache" | "live" | "unavailable";
|
|
124
112
|
stale: boolean;
|
|
125
113
|
reason?: string | undefined;
|
|
114
|
+
} | {
|
|
115
|
+
tasks: {
|
|
116
|
+
id: string;
|
|
117
|
+
title: string;
|
|
118
|
+
runner?: string | undefined;
|
|
119
|
+
status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
|
|
120
|
+
attention: "error" | "none" | "permission" | "running" | "unseen" | "waiting";
|
|
121
|
+
attentionLabel: string;
|
|
122
|
+
accepts: boolean;
|
|
123
|
+
reason?: string | undefined;
|
|
124
|
+
}[];
|
|
125
|
+
nextOffset?: number | undefined;
|
|
126
126
|
};
|
|
127
127
|
outputFormat: "json";
|
|
128
128
|
status: 200;
|
|
@@ -232,13 +232,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
232
232
|
status: 200;
|
|
233
233
|
input: {
|
|
234
234
|
json: {
|
|
235
|
-
requestIds: string[];
|
|
236
|
-
mode?: "all" | "any" | "one" | undefined;
|
|
237
|
-
timeoutSeconds?: number | undefined;
|
|
238
|
-
} | {
|
|
239
235
|
workerIds: string[];
|
|
240
236
|
timeoutSeconds?: number | undefined;
|
|
241
237
|
mode?: "all" | "any" | "one" | undefined;
|
|
238
|
+
} | {
|
|
239
|
+
requestIds: string[];
|
|
240
|
+
mode?: "all" | "any" | "one" | undefined;
|
|
241
|
+
timeoutSeconds?: number | undefined;
|
|
242
242
|
} | {
|
|
243
243
|
peerIds: string[];
|
|
244
244
|
timeoutSeconds?: number | undefined;
|
|
@@ -629,18 +629,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
629
629
|
} & {
|
|
630
630
|
"/:workerId": {
|
|
631
631
|
$get: {
|
|
632
|
-
output: {
|
|
633
|
-
error: string;
|
|
634
|
-
code?: "invalid_input" | undefined;
|
|
635
|
-
};
|
|
636
|
-
outputFormat: "json";
|
|
637
|
-
status: 400;
|
|
638
|
-
input: {
|
|
639
|
-
param: {
|
|
640
|
-
workerId: string;
|
|
641
|
-
};
|
|
642
|
-
};
|
|
643
|
-
} | {
|
|
644
632
|
output: {
|
|
645
633
|
workerId: string;
|
|
646
634
|
settled: boolean;
|
|
@@ -758,11 +746,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
758
746
|
workerId: string;
|
|
759
747
|
};
|
|
760
748
|
};
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
} & {
|
|
764
|
-
"/:workerId/collect": {
|
|
765
|
-
$post: {
|
|
749
|
+
} | {
|
|
766
750
|
output: {
|
|
767
751
|
error: string;
|
|
768
752
|
code?: "invalid_input" | undefined;
|
|
@@ -773,10 +757,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
773
757
|
param: {
|
|
774
758
|
workerId: string;
|
|
775
759
|
};
|
|
776
|
-
} & {
|
|
777
|
-
json: Record<string, never>;
|
|
778
760
|
};
|
|
779
|
-
}
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
} & {
|
|
764
|
+
"/:workerId/collect": {
|
|
765
|
+
$post: {
|
|
780
766
|
output: {
|
|
781
767
|
workerId: string;
|
|
782
768
|
parentRunId: string;
|
|
@@ -899,11 +885,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
899
885
|
} & {
|
|
900
886
|
json: Record<string, never>;
|
|
901
887
|
};
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
} & {
|
|
905
|
-
"/:workerId/steer": {
|
|
906
|
-
$post: {
|
|
888
|
+
} | {
|
|
907
889
|
output: {
|
|
908
890
|
error: string;
|
|
909
891
|
code?: "invalid_input" | undefined;
|
|
@@ -915,11 +897,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
915
897
|
workerId: string;
|
|
916
898
|
};
|
|
917
899
|
} & {
|
|
918
|
-
json:
|
|
919
|
-
text: string;
|
|
920
|
-
};
|
|
900
|
+
json: Record<string, never>;
|
|
921
901
|
};
|
|
922
|
-
}
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
} & {
|
|
905
|
+
"/:workerId/steer": {
|
|
906
|
+
$post: {
|
|
923
907
|
output: {
|
|
924
908
|
workerId: string;
|
|
925
909
|
state: "delivered" | "queued";
|
|
@@ -935,11 +919,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
935
919
|
text: string;
|
|
936
920
|
};
|
|
937
921
|
};
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
} & {
|
|
941
|
-
"/:workerId/stop": {
|
|
942
|
-
$post: {
|
|
922
|
+
} | {
|
|
943
923
|
output: {
|
|
944
924
|
error: string;
|
|
945
925
|
code?: "invalid_input" | undefined;
|
|
@@ -951,9 +931,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
951
931
|
workerId: string;
|
|
952
932
|
};
|
|
953
933
|
} & {
|
|
954
|
-
json:
|
|
934
|
+
json: {
|
|
935
|
+
text: string;
|
|
936
|
+
};
|
|
955
937
|
};
|
|
956
|
-
}
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
} & {
|
|
941
|
+
"/:workerId/stop": {
|
|
942
|
+
$post: {
|
|
957
943
|
output: {
|
|
958
944
|
workerId: string;
|
|
959
945
|
state: "stopping" | "terminated";
|
|
@@ -967,11 +953,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
967
953
|
} & {
|
|
968
954
|
json: Record<string, never>;
|
|
969
955
|
};
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
} & {
|
|
973
|
-
"/:workerId/destroy": {
|
|
974
|
-
$post: {
|
|
956
|
+
} | {
|
|
975
957
|
output: {
|
|
976
958
|
error: string;
|
|
977
959
|
code?: "invalid_input" | undefined;
|
|
@@ -983,11 +965,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
983
965
|
workerId: string;
|
|
984
966
|
};
|
|
985
967
|
} & {
|
|
986
|
-
json:
|
|
987
|
-
discardWork?: true | undefined;
|
|
988
|
-
};
|
|
968
|
+
json: Record<string, never>;
|
|
989
969
|
};
|
|
990
|
-
}
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
} & {
|
|
973
|
+
"/:workerId/destroy": {
|
|
974
|
+
$post: {
|
|
991
975
|
output: {
|
|
992
976
|
workerId: string;
|
|
993
977
|
state: "complete" | "incomplete";
|
|
@@ -1016,6 +1000,22 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1016
1000
|
discardWork?: true | undefined;
|
|
1017
1001
|
};
|
|
1018
1002
|
};
|
|
1003
|
+
} | {
|
|
1004
|
+
output: {
|
|
1005
|
+
error: string;
|
|
1006
|
+
code?: "invalid_input" | undefined;
|
|
1007
|
+
};
|
|
1008
|
+
outputFormat: "json";
|
|
1009
|
+
status: 400;
|
|
1010
|
+
input: {
|
|
1011
|
+
param: {
|
|
1012
|
+
workerId: string;
|
|
1013
|
+
};
|
|
1014
|
+
} & {
|
|
1015
|
+
json: {
|
|
1016
|
+
discardWork?: true | undefined;
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
1019
|
} | {
|
|
1020
1020
|
output: {
|
|
1021
1021
|
workerId: string;
|
|
@@ -1051,11 +1051,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1051
1051
|
"/:workerId/diff": {
|
|
1052
1052
|
$get: {
|
|
1053
1053
|
output: {
|
|
1054
|
-
|
|
1055
|
-
|
|
1054
|
+
workerId: string;
|
|
1055
|
+
baselineSha: string;
|
|
1056
|
+
diff: string;
|
|
1057
|
+
truncated: boolean;
|
|
1056
1058
|
};
|
|
1057
1059
|
outputFormat: "json";
|
|
1058
|
-
status:
|
|
1060
|
+
status: 200;
|
|
1059
1061
|
input: {
|
|
1060
1062
|
param: {
|
|
1061
1063
|
workerId: string;
|
|
@@ -1063,13 +1065,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1063
1065
|
};
|
|
1064
1066
|
} | {
|
|
1065
1067
|
output: {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
diff: string;
|
|
1069
|
-
truncated: boolean;
|
|
1068
|
+
error: string;
|
|
1069
|
+
code?: "invalid_input" | undefined;
|
|
1070
1070
|
};
|
|
1071
1071
|
outputFormat: "json";
|
|
1072
|
-
status:
|
|
1072
|
+
status: 400;
|
|
1073
1073
|
input: {
|
|
1074
1074
|
param: {
|
|
1075
1075
|
workerId: string;
|
|
@@ -66,15 +66,16 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
66
66
|
"/discover": {
|
|
67
67
|
$post: {
|
|
68
68
|
output: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
authFailureId?: string | undefined;
|
|
76
|
-
runner: string;
|
|
69
|
+
runner: string;
|
|
70
|
+
models: {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
description: string;
|
|
74
|
+
effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
|
|
77
75
|
}[];
|
|
76
|
+
source: "cache" | "live" | "unavailable";
|
|
77
|
+
stale: boolean;
|
|
78
|
+
reason?: string | undefined;
|
|
78
79
|
} | {
|
|
79
80
|
tasks: {
|
|
80
81
|
id: string;
|
|
@@ -88,16 +89,15 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
88
89
|
}[];
|
|
89
90
|
nextOffset?: number | undefined;
|
|
90
91
|
} | {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
scope: "host-default-account";
|
|
93
|
+
runners: {
|
|
94
|
+
requiresAccountHome?: boolean | undefined;
|
|
95
|
+
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
96
|
+
enabled?: boolean | undefined;
|
|
97
|
+
hint?: string | undefined;
|
|
98
|
+
authFailureId?: string | undefined;
|
|
99
|
+
runner: string;
|
|
97
100
|
}[];
|
|
98
|
-
source: "cache" | "live" | "unavailable";
|
|
99
|
-
stale: boolean;
|
|
100
|
-
reason?: string | undefined;
|
|
101
101
|
};
|
|
102
102
|
outputFormat: "json";
|
|
103
103
|
status: 200;
|
|
@@ -207,13 +207,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
207
207
|
status: 200;
|
|
208
208
|
input: {
|
|
209
209
|
json: {
|
|
210
|
-
workerIds: string[];
|
|
211
|
-
timeoutSeconds?: number | undefined;
|
|
212
|
-
mode?: "all" | "any" | "one" | undefined;
|
|
213
|
-
} | {
|
|
214
210
|
requestIds: string[];
|
|
215
211
|
mode?: "all" | "any" | "one" | undefined;
|
|
216
212
|
timeoutSeconds?: number | undefined;
|
|
213
|
+
} | {
|
|
214
|
+
workerIds: string[];
|
|
215
|
+
timeoutSeconds?: number | undefined;
|
|
216
|
+
mode?: "all" | "any" | "one" | undefined;
|
|
217
217
|
} | {
|
|
218
218
|
peerIds: string[];
|
|
219
219
|
timeoutSeconds?: number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { projectPaths } from './project-paths.js';
|
|
3
2
|
import { commandText } from './home/command.js';
|
|
4
3
|
import { readFileSync } from 'node:fs';
|
|
5
4
|
import { dirname, join } from 'node:path';
|
|
6
5
|
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import { RunStore } from './runs/store.js';
|
|
8
|
-
import { RunStoreOpenError } from './runs/store-open-error.js';
|
|
9
|
-
import { initCommand, openStore } from './project-commands.js';
|
|
10
6
|
import { warnLegacyEnv } from './home/deprecation.js';
|
|
11
7
|
import { resolveHome } from './home/resolve.js';
|
|
12
|
-
import { runMigrations } from './workspace/migrations.js';
|
|
13
|
-
import { registerProject, shouldRegisterProject } from './workspace/projects.js';
|
|
14
8
|
import { main, defaultCliDeps } from './cli-dispatch.js';
|
|
15
|
-
import {
|
|
16
|
-
import { runHeadless, defaultHeadlessDeps } from './headless-run.js';
|
|
17
|
-
import { serveCommand, defaultServeDeps } from './serve-command.js';
|
|
18
|
-
import { workerCleanups } from './delegation/worker-cleanup.js';
|
|
9
|
+
import { prepareCommandRuntime } from './subcommands.js';
|
|
19
10
|
import { onTerminal } from './serve-listener.js';
|
|
20
11
|
import { installWindowsIdentityStore } from './delegation/windows-identity-store.js';
|
|
21
|
-
import { registerBuiltInRunners } from './runners/built-in.js';
|
|
22
|
-
import { registerBuiltInRunSlots } from './built-in-run-slots.js';
|
|
23
12
|
// Workspace receipts and markers use the host's identity store (ADR 0032).
|
|
24
13
|
installWindowsIdentityStore();
|
|
25
|
-
// Every command, the cockpit, a headless task and each child process that reruns this entry read
|
|
26
|
-
// runner data from the registry (spec 2026-11-18-runner-definitions).
|
|
27
|
-
registerBuiltInRunners();
|
|
28
|
-
// A deletion, a reclaim or a family archive asks the removal slots, and throws in a process that
|
|
29
|
-
// sealed none (spec 2026-11-21-run-lifecycle-and-store-ports).
|
|
30
|
-
registerBuiltInRunSlots();
|
|
31
14
|
warnLegacyEnv(process.env);
|
|
32
15
|
// ---- workspace boot ----------------------------------------------------------
|
|
33
16
|
/**
|
|
@@ -47,6 +30,8 @@ warnLegacyEnv(process.env);
|
|
|
47
30
|
*/
|
|
48
31
|
async function initWorkspace(repoRoot, home) {
|
|
49
32
|
try {
|
|
33
|
+
const { runMigrations } = await import('./workspace/migrations.js');
|
|
34
|
+
const { registerProject, shouldRegisterProject } = await import('./workspace/projects.js');
|
|
50
35
|
await runMigrations({ bootRepoRoot: repoRoot, home });
|
|
51
36
|
if (await shouldRegisterProject(repoRoot))
|
|
52
37
|
return (await registerProject(repoRoot, 'local', home)).id;
|
|
@@ -78,6 +63,10 @@ async function runCommand(home, repoRoot, task, workflowName, model, access) {
|
|
|
78
63
|
process.exitCode = 1;
|
|
79
64
|
return;
|
|
80
65
|
}
|
|
66
|
+
await prepareCommandRuntime('run');
|
|
67
|
+
const { runHeadless, defaultHeadlessDeps } = await import('./headless-run.js');
|
|
68
|
+
const { openStore } = await import('./project-commands.js');
|
|
69
|
+
const { workerCleanups } = await import('./delegation/worker-cleanup.js');
|
|
81
70
|
const stopHint = hintRunningCockpit(repoRoot);
|
|
82
71
|
try {
|
|
83
72
|
await runHeadless(home, repoRoot, task, workflowName, model, access, { ...defaultHeadlessDeps, initWorkspace, openStore, onTerminal, workerCleanup: workerCleanups() });
|
|
@@ -87,22 +76,6 @@ async function runCommand(home, repoRoot, task, workflowName, model, access) {
|
|
|
87
76
|
}
|
|
88
77
|
}
|
|
89
78
|
// ---- helpers -----------------------------------------------------------------
|
|
90
|
-
/**
|
|
91
|
-
* The boot project's store for `serve` (#779, plan step 4). One that cannot open does not stop the
|
|
92
|
-
* cockpit: the boot project answers every route with the reason (`RunStore.unavailable`), the
|
|
93
|
-
* other projects work, and a restart once the cause is gone opens it.
|
|
94
|
-
*/
|
|
95
|
-
function openBootStore(repoRoot) {
|
|
96
|
-
try {
|
|
97
|
-
return openStore(repoRoot, { keepLive: true });
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
if (!(error instanceof RunStoreOpenError))
|
|
101
|
-
throw error;
|
|
102
|
-
console.error(`\n ✗ ${error.message}\n`);
|
|
103
|
-
return RunStore.unavailable(projectPaths(repoRoot).write, error);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
79
|
/** Own package name — for the npm-registry update check (#368). */
|
|
107
80
|
function readOwnName() {
|
|
108
81
|
try {
|
|
@@ -125,8 +98,41 @@ function readOwnVersion() {
|
|
|
125
98
|
}
|
|
126
99
|
}
|
|
127
100
|
main({
|
|
128
|
-
...defaultCliDeps, resolveCliHome: () => resolveHome({ purpose: 'cli' }), readOwnVersion, runCommand,
|
|
129
|
-
|
|
101
|
+
...defaultCliDeps, resolveCliHome: () => resolveHome({ purpose: 'cli' }), readOwnVersion, runCommand,
|
|
102
|
+
initCommand: async (...args) => {
|
|
103
|
+
await prepareCommandRuntime('init');
|
|
104
|
+
return (await import('./project-commands.js')).initCommand(...args);
|
|
105
|
+
},
|
|
106
|
+
serverCommand: async (...args) => {
|
|
107
|
+
await prepareCommandRuntime(`server-${args[0]}`);
|
|
108
|
+
return (await import('./server-command.js')).serverCommand(...args);
|
|
109
|
+
},
|
|
110
|
+
serveCommand: async (...args) => {
|
|
111
|
+
await prepareCommandRuntime('serve');
|
|
112
|
+
const { serveCommand, defaultServeDeps } = await import('./serve-command.js');
|
|
113
|
+
const { openStore } = await import('./project-commands.js');
|
|
114
|
+
const { RunStore } = await import('./runs/store.js');
|
|
115
|
+
const { RunStoreOpenError } = await import('./runs/store-open-error.js');
|
|
116
|
+
const { projectPaths } = await import('./project-paths.js');
|
|
117
|
+
const { workerCleanups } = await import('./delegation/worker-cleanup.js');
|
|
118
|
+
/**
|
|
119
|
+
* The boot project's store for `serve`. One that cannot open does not stop the
|
|
120
|
+
* cockpit: the boot project answers every route with the reason (`RunStore.unavailable`), the
|
|
121
|
+
* other projects work, and a restart once the cause is gone opens it.
|
|
122
|
+
*/
|
|
123
|
+
const openBootStore = (repoRoot) => {
|
|
124
|
+
try {
|
|
125
|
+
return openStore(repoRoot, { keepLive: true });
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
if (!(error instanceof RunStoreOpenError))
|
|
129
|
+
throw error;
|
|
130
|
+
console.error(`\n ✗ ${error.message}\n`);
|
|
131
|
+
return RunStore.unavailable(projectPaths(repoRoot).write, error);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return serveCommand(...args, { ...defaultServeDeps, initWorkspace, openBootStore, readOwnName, readOwnVersion, workerCleanup: workerCleanups() });
|
|
135
|
+
},
|
|
130
136
|
}).catch((err) => {
|
|
131
137
|
console.error(err instanceof Error ? err.message : String(err));
|
|
132
138
|
process.exit(1);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MA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,CAAC;QACF,OAAO,YAAY,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;IACpJ,CAAC;CACF,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACxB,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/legacy-runs.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
/**
|
|
3
2
|
* Tasks whose own files stay in `.ai/cezar/` after a project move (owner decision A,
|
|
4
3
|
* hearsay-tools/cezarion#2778). A move carries the run store and everything else to `.ai/squawk/`,
|
|
@@ -14,10 +13,12 @@ import { z } from 'zod';
|
|
|
14
13
|
* directory (`fallbackProjectWriteError`) exempts them.
|
|
15
14
|
*/
|
|
16
15
|
export declare const LEGACY_RUNS_FILE = "legacy-runs.json";
|
|
17
|
-
export declare const legacyRunsSchema:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export declare const legacyRunsSchema: {
|
|
17
|
+
parse(value: unknown): {
|
|
18
|
+
version: 1;
|
|
19
|
+
runs: string[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
21
22
|
/**
|
|
22
23
|
* `legacy-runs.json` exists but cannot be read or validated. Which tasks keep their items in
|
|
23
24
|
* `.ai/cezar/` is then unknown: a reader that guessed `.ai/squawk/` could miss a kept task's
|
package/dist/legacy-runs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { basename, dirname, join, resolve, sep } from 'node:path';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { runIdParamSchema } from './contract/index.js';
|
|
5
3
|
/**
|
|
6
4
|
* Tasks whose own files stay in `.ai/cezar/` after a project move (owner decision A,
|
|
7
5
|
* hearsay-tools/cezarion#2778). A move carries the run store and everything else to `.ai/squawk/`,
|
|
@@ -17,7 +15,22 @@ import { runIdParamSchema } from './contract/index.js';
|
|
|
17
15
|
* directory (`fallbackProjectWriteError`) exempts them.
|
|
18
16
|
*/
|
|
19
17
|
export const LEGACY_RUNS_FILE = 'legacy-runs.json';
|
|
20
|
-
|
|
18
|
+
/** Same accepted ids as contract/events runIdParamSchema, without loading the HTTP contract. */
|
|
19
|
+
function isRunId(value) {
|
|
20
|
+
return typeof value === 'string' && value.length >= 1 && value.length <= 128 && /^[A-Za-z0-9._-]+$/.test(value);
|
|
21
|
+
}
|
|
22
|
+
export const legacyRunsSchema = {
|
|
23
|
+
parse(value) {
|
|
24
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
25
|
+
throw new Error('Invalid legacy runs object');
|
|
26
|
+
const record = value;
|
|
27
|
+
if (Object.keys(record).some(key => key !== 'version' && key !== 'runs')
|
|
28
|
+
|| record.version !== 1 || !Array.isArray(record.runs) || !Array.from(record.runs).every(isRunId)) {
|
|
29
|
+
throw new Error('Invalid legacy runs: expected version 1 and an array of run ids');
|
|
30
|
+
}
|
|
31
|
+
return { version: 1, runs: [...record.runs] };
|
|
32
|
+
},
|
|
33
|
+
};
|
|
21
34
|
const cache = new Map();
|
|
22
35
|
/**
|
|
23
36
|
* `legacy-runs.json` exists but cannot be read or validated. Which tasks keep their items in
|