@wjarka/cezarion 0.14.8 → 0.14.9-dev.1004
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/README.md +129 -2
- package/dist/application-update/bin-recovery.d.ts +5 -0
- package/dist/application-update/bin-recovery.js +96 -0
- package/dist/application-update/bin-recovery.js.map +1 -0
- package/dist/application-update/discovery.d.ts +22 -0
- package/dist/application-update/discovery.js +91 -0
- package/dist/application-update/discovery.js.map +1 -0
- package/dist/application-update/helper.d.ts +57 -0
- package/dist/application-update/helper.js +374 -0
- package/dist/application-update/helper.js.map +1 -0
- package/dist/application-update/launcher.d.ts +8 -0
- package/dist/application-update/launcher.js +53 -0
- package/dist/application-update/launcher.js.map +1 -0
- package/dist/application-update/lock.d.ts +4 -0
- package/dist/application-update/lock.js +70 -0
- package/dist/application-update/lock.js.map +1 -0
- package/dist/application-update/npm-process.d.ts +17 -0
- package/dist/application-update/npm-process.js +133 -0
- package/dist/application-update/npm-process.js.map +1 -0
- package/dist/application-update/service.d.ts +69 -0
- package/dist/application-update/service.js +456 -0
- package/dist/application-update/service.js.map +1 -0
- package/dist/artifacts/cli.d.ts +1 -0
- package/dist/artifacts/cli.js +32 -0
- package/dist/artifacts/cli.js.map +1 -0
- package/dist/artifacts/lifecycle.d.ts +4 -0
- package/dist/artifacts/lifecycle.js +42 -0
- package/dist/artifacts/lifecycle.js.map +1 -0
- package/dist/artifacts/resolve.d.ts +18 -0
- package/dist/artifacts/resolve.js +102 -0
- package/dist/artifacts/resolve.js.map +1 -0
- package/dist/artifacts/store.d.ts +8 -0
- package/dist/artifacts/store.js +323 -0
- package/dist/artifacts/store.js.map +1 -0
- package/dist/automations/scheduler.d.ts +6 -0
- package/dist/automations/scheduler.js +45 -17
- package/dist/automations/scheduler.js.map +1 -1
- package/dist/automations/store.d.ts +12 -4
- package/dist/automations/store.js +199 -22
- package/dist/automations/store.js.map +1 -1
- package/dist/automations/types.d.ts +2 -0
- package/dist/automations/types.js +1 -0
- package/dist/automations/types.js.map +1 -1
- package/dist/ci-wait/mcp.d.ts +3 -0
- package/dist/ci-wait/mcp.js +14 -3
- package/dist/ci-wait/mcp.js.map +1 -1
- package/dist/contract/application-update.d.ts +32 -0
- package/dist/contract/artifacts.d.ts +83 -0
- package/dist/contract/ask-schema.d.ts +32 -0
- package/dist/contract/ask.d.ts +2 -32
- package/dist/contract/automations.d.ts +6 -0
- package/dist/contract/conversations.d.ts +165 -0
- package/dist/contract/delegation.d.ts +68 -0
- package/dist/contract/discovery.d.ts +134 -0
- package/dist/contract/events.d.ts +49 -0
- package/dist/contract/health.d.ts +12 -0
- package/dist/contract/index.d.ts +3 -0
- package/dist/contract/index.js +1654 -1454
- package/dist/contract/projects.d.ts +40 -0
- package/dist/contract/runs.d.ts +186 -0
- package/dist/contract/skills.d.ts +33 -0
- package/dist/core/agent-runner.d.ts +33 -4
- package/dist/core/agent-runner.js +5 -0
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/claude-cli-runner.d.ts +6 -12
- package/dist/core/claude-cli-runner.js +90 -20
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +2 -1
- package/dist/core/codex-app-server-runner.js +327 -92
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-app-server-transport.d.ts +13 -1
- package/dist/core/codex-app-server-transport.js +58 -17
- package/dist/core/codex-app-server-transport.js.map +1 -1
- package/dist/core/cursor-acp-runner.d.ts +6 -1
- package/dist/core/cursor-acp-runner.js +162 -26
- package/dist/core/cursor-acp-runner.js.map +1 -1
- package/dist/core/cursor-provider-error.d.ts +3 -0
- package/dist/core/cursor-provider-error.js +16 -1
- package/dist/core/cursor-provider-error.js.map +1 -1
- package/dist/core/input-submissions.d.ts +14 -0
- package/dist/core/input-submissions.js +26 -0
- package/dist/core/input-submissions.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +4 -1
- package/dist/core/opencode-server-runner.js +156 -26
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/pi-runner.d.ts +2 -1
- package/dist/core/pi-runner.js +88 -10
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/provider-auth.d.ts +99 -1
- package/dist/core/provider-auth.js +203 -2
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/delegation/cli.d.ts +1 -0
- package/dist/delegation/cli.js +103 -7
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/conversations.js +13 -5
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/input.d.ts +2 -1
- package/dist/delegation/input.js +6 -1
- package/dist/delegation/input.js.map +1 -1
- package/dist/delegation/policy.d.ts +3 -2
- package/dist/delegation/policy.js +3 -1
- package/dist/delegation/policy.js.map +1 -1
- package/dist/delegation/process-liveness.d.ts +66 -0
- package/dist/delegation/process-liveness.js +215 -0
- package/dist/delegation/process-liveness.js.map +1 -0
- package/dist/delegation/provision.d.ts +1 -1
- package/dist/delegation/provision.js +10 -5
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/questions.d.ts +19 -0
- package/dist/delegation/questions.js +45 -0
- package/dist/delegation/questions.js.map +1 -0
- package/dist/delegation/results.d.ts +1 -1
- package/dist/delegation/results.js +33 -19
- package/dist/delegation/results.js.map +1 -1
- package/dist/delegation/routes.d.ts +185 -11
- package/dist/delegation/routes.js +6 -2
- package/dist/delegation/routes.js.map +1 -1
- package/dist/delegation/service.d.ts +16 -5
- package/dist/delegation/service.js +161 -13
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +228 -65
- package/dist/discovery/catalog.d.ts +14 -0
- package/dist/discovery/catalog.js +31 -0
- package/dist/discovery/catalog.js.map +1 -0
- package/dist/discovery/cli.d.ts +8 -0
- package/dist/discovery/cli.js +104 -0
- package/dist/discovery/cli.js.map +1 -0
- package/dist/git-worktree.d.ts +3 -1
- package/dist/git-worktree.js +26 -4
- package/dist/git-worktree.js.map +1 -1
- package/dist/index.js +92 -26
- package/dist/index.js.map +1 -1
- package/dist/open-url.d.ts +2 -0
- package/dist/open-url.js +20 -0
- package/dist/open-url.js.map +1 -0
- package/dist/release/snapshot.d.ts +3 -3
- package/dist/release/snapshot.js +6 -6
- package/dist/release/snapshot.js.map +1 -1
- package/dist/runs/agent-tmpdir.d.ts +2 -0
- package/dist/runs/agent-tmpdir.js +5 -2
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/runs/client-request.d.ts +11 -0
- package/dist/runs/client-request.js +26 -0
- package/dist/runs/client-request.js.map +1 -0
- package/dist/runs/delegation-state.d.ts +17 -0
- package/dist/runs/event-history.js +6 -0
- package/dist/runs/event-history.js.map +1 -1
- package/dist/runs/retention.d.ts +7 -2
- package/dist/runs/retention.js +39 -7
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/store.d.ts +100 -6
- package/dist/runs/store.js +245 -2
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/webhook.d.ts +125 -0
- package/dist/runs/webhook.js +256 -0
- package/dist/runs/webhook.js.map +1 -0
- package/dist/server/provider-auth-runtime.d.ts +30 -4
- package/dist/server/provider-auth-runtime.js +71 -6
- package/dist/server/provider-auth-runtime.js.map +1 -1
- package/dist/server/server.d.ts +8226 -4860
- package/dist/server/server.js +309 -15
- package/dist/server/server.js.map +1 -1
- package/dist/server-install/platforms/ubuntu-vps.d.ts +5 -1
- package/dist/server-install/platforms/ubuntu-vps.js +160 -18
- package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
- package/dist/server-install/steps.d.ts +4 -2
- package/dist/server-install/steps.js +5 -4
- package/dist/server-install/steps.js.map +1 -1
- package/dist/skills-remote.d.ts +30 -5
- package/dist/skills-remote.js +122 -32
- package/dist/skills-remote.js.map +1 -1
- package/dist/skills.js +15 -6
- package/dist/skills.js.map +1 -1
- package/dist/task-cli/cli.d.ts +38 -0
- package/dist/task-cli/cli.js +580 -0
- package/dist/task-cli/cli.js.map +1 -0
- package/dist/task-cli/discovery.d.ts +22 -0
- package/dist/task-cli/discovery.js +96 -0
- package/dist/task-cli/discovery.js.map +1 -0
- package/dist/task-cli/http.d.ts +46 -0
- package/dist/task-cli/http.js +101 -0
- package/dist/task-cli/http.js.map +1 -0
- package/dist/task-cli/projections.d.ts +40 -0
- package/dist/task-cli/projections.js +45 -0
- package/dist/task-cli/projections.js.map +1 -0
- package/dist/task-cli/watch.d.ts +78 -0
- package/dist/task-cli/watch.js +336 -0
- package/dist/task-cli/watch.js.map +1 -0
- package/dist/workflows/run.d.ts +160 -2
- package/dist/workflows/run.js +1141 -108
- package/dist/workflows/run.js.map +1 -1
- package/dist/workspace/agent-profiles.d.ts +22 -0
- package/dist/workspace/agent-profiles.js +15 -0
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/dist/workspace/config.d.ts +9 -0
- package/dist/workspace/config.js +13 -1
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/projects-cli.js +1 -1
- package/dist/workspace/projects.d.ts +24 -1
- package/dist/workspace/projects.js +14 -1
- package/dist/workspace/projects.js.map +1 -1
- package/package.json +5 -5
- package/scripts/mock-claude.mjs +64 -2
- package/scripts/mock-codex-app-server.mjs +124 -1
- package/scripts/mock-cursor-acp.mjs +54 -3
- package/scripts/mock-cursor-hang-stdin-late.mjs +35 -0
- package/scripts/mock-cursor-hang-stdin.mjs +30 -0
- package/scripts/mock-opencode-serve.mjs +102 -2
- package/scripts/mock-pi-rpc.mjs +82 -3
- package/web/dist/assets/agent-accounts-CerclGiO.js +1 -0
- package/web/dist/assets/centered-state-DH8qtCz-.js +43 -0
- package/web/dist/assets/collapsible-De2G0xqQ.js +1 -0
- package/web/dist/assets/commit-list-CQubP1iS.js +1 -0
- package/web/dist/assets/compare-variants-C_NijJvg.js +1 -0
- package/web/dist/assets/{diff-tRE59UNb2.js → diff-8M5HlDxq2.js} +2 -2
- package/web/dist/assets/diff-controls-B6ok0TtQ.js +1 -0
- package/web/dist/assets/{diff-stat-Cgnl_hYF.js → diff-stat-D1AODN2a.js} +1 -1
- package/web/dist/assets/{diff-view-DN1ort7Q.js → diff-view-Bs5Gh7UF.js} +2 -2
- package/web/dist/assets/dropdown-menu-7KGQMoFj.js +1 -0
- package/web/dist/assets/git-toolbar-DqbapMXr.js +1 -0
- package/web/dist/assets/github-lMHiuYSx.js +1 -0
- package/web/dist/assets/{image-preview-C2JGcBlC.js → image-preview-jzHoEyLM.js} +1 -1
- package/web/dist/assets/index-D4OJTArJ.js +7 -0
- package/web/dist/assets/index-D5NkwqY7.css +1 -0
- package/web/dist/assets/markdown-DvbymqXz.js +2 -0
- package/web/dist/assets/pill-BL6ugwXo.js +1 -0
- package/web/dist/assets/project-router-ChC5Rb-Y.js +1 -0
- package/web/dist/assets/prompt-templates-j8qlK7c-.js +15 -0
- package/web/dist/assets/repo-git-BbPAgkqb.js +1 -0
- package/web/dist/assets/{run-diff-CyG0Nciv.js → run-diff-BuATgZpx.js} +2 -2
- package/web/dist/assets/run-header-DuAWswYM.js +1 -0
- package/web/dist/assets/skills-DiC2XrU1.js +1 -0
- package/web/dist/assets/{tab-link-BWNp3mLY.js → tab-link-BmGKj9Rt.js} +1 -1
- package/web/dist/assets/task-changes-CP9kPnsy.js +1 -0
- package/web/dist/assets/task-commits-D6NfTw5r.js +1 -0
- package/web/dist/assets/task-files-W-b_gtcb.js +2 -0
- package/web/dist/assets/task-thread-Bw_nQuTx.css +1 -0
- package/web/dist/assets/task-thread-Q7Nj33DH.js +9 -0
- package/web/dist/assets/textarea-ByZ-txS7.js +1 -0
- package/web/dist/assets/thread-loading-DHT9p5o5.js +1 -0
- package/web/dist/assets/token-metrics-k4XoovDS.js +1 -0
- package/web/dist/assets/utils-BTFBhZ55.js +64 -0
- package/web/dist/assets/workflows-DqQszPHJ.js +11 -0
- package/web/dist/assets/{zoomable-image-Z3JDnm0b.js → zoomable-image-Ba6y6Wyl.js} +1 -1
- package/web/dist/index.html +14 -14
- package/web/dist/assets/agent-accounts-BZm_2WAv.js +0 -1
- package/web/dist/assets/alert-dialog-B422RI-k.js +0 -43
- package/web/dist/assets/collapsible-Cy_Fmkrd.js +0 -1
- package/web/dist/assets/commit-list-Dcnk7TnI.js +0 -1
- package/web/dist/assets/compare-variants-Ciqwvd_f.js +0 -1
- package/web/dist/assets/diff-controls-BGrXGi7O.js +0 -1
- package/web/dist/assets/dropdown-menu-dwDGT8MM.js +0 -1
- package/web/dist/assets/git-toolbar-UiHnGvE0.js +0 -1
- package/web/dist/assets/github-D-MrkbJ7.js +0 -1
- package/web/dist/assets/ibm-plex-mono-regular-BF3vfe7_.ttf +0 -0
- package/web/dist/assets/index-BszfYvBq.js +0 -7
- package/web/dist/assets/index-CWh4pKP3.css +0 -1
- package/web/dist/assets/markdown-C_IcKVQd.js +0 -2
- package/web/dist/assets/pill-BsbO6G7y.js +0 -1
- package/web/dist/assets/project-router-DbLkll25.js +0 -1
- package/web/dist/assets/prompt-templates-BlTGJB5W.js +0 -15
- package/web/dist/assets/repo-git-Bm3s6Why.js +0 -1
- package/web/dist/assets/run-header-IFyIGCey.js +0 -1
- package/web/dist/assets/skills-C-C4DVFY.js +0 -1
- package/web/dist/assets/task-changes-D2PHtWUW.js +0 -1
- package/web/dist/assets/task-commits-N5u9U0_R.js +0 -1
- package/web/dist/assets/task-files-BS7c7CFm.js +0 -2
- package/web/dist/assets/task-thread-BQFdz1dJ.css +0 -1
- package/web/dist/assets/task-thread-DGM2dZV-.js +0 -9
- package/web/dist/assets/textarea-FjaU370i.js +0 -1
- package/web/dist/assets/thread-loading-77sJ8Yu_.js +0 -1
- package/web/dist/assets/token-metrics-Clxh03bE.js +0 -1
- package/web/dist/assets/utils-PYYcpCFZ.js +0 -64
- package/web/dist/assets/workflows-Czl0ZfXH.js +0 -11
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
import type { DelegationRoutes } from './routes.ts';
|
|
2
2
|
export declare function createDelegationApp(routes: DelegationRoutes): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
|
|
3
|
+
"/discover": {
|
|
4
|
+
$post: {
|
|
5
|
+
output: {
|
|
6
|
+
runner: "claude" | "codex" | "cursor" | "opencode" | "pi";
|
|
7
|
+
models: {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
|
|
12
|
+
}[];
|
|
13
|
+
source: "cache" | "live" | "unavailable";
|
|
14
|
+
stale: boolean;
|
|
15
|
+
reason?: string | undefined;
|
|
16
|
+
} | {
|
|
17
|
+
scope: "host-default-account";
|
|
18
|
+
runners: {
|
|
19
|
+
status: "connected" | "disconnected" | "not-installed" | "unknown";
|
|
20
|
+
enabled?: boolean | undefined;
|
|
21
|
+
hint?: string | undefined;
|
|
22
|
+
authFailureId?: string | undefined;
|
|
23
|
+
runner: "claude" | "codex" | "cursor" | "opencode" | "pi";
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
outputFormat: "json";
|
|
27
|
+
status: 200;
|
|
28
|
+
input: {
|
|
29
|
+
json: {
|
|
30
|
+
kind: "runners";
|
|
31
|
+
} | {
|
|
32
|
+
kind: "models";
|
|
33
|
+
runner: "claude" | "codex" | "cursor" | "opencode" | "pi";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
} & {
|
|
3
39
|
"/spawn": {
|
|
4
40
|
$post: {
|
|
5
41
|
output: {
|
|
@@ -41,7 +77,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
41
77
|
requestIds?: string[] | undefined;
|
|
42
78
|
requestOutcomes?: {
|
|
43
79
|
requestId: string;
|
|
44
|
-
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
|
|
80
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
45
81
|
observedAt: string;
|
|
46
82
|
replyId?: string | undefined;
|
|
47
83
|
}[] | undefined;
|
|
@@ -68,13 +104,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
68
104
|
status: 200;
|
|
69
105
|
input: {
|
|
70
106
|
json: {
|
|
71
|
-
workerIds: string[];
|
|
72
|
-
timeoutSeconds?: number | undefined;
|
|
73
|
-
mode?: "all" | "any" | "one" | undefined;
|
|
74
|
-
} | {
|
|
75
107
|
requestIds: string[];
|
|
76
108
|
mode?: "all" | "any" | "one" | undefined;
|
|
77
109
|
timeoutSeconds?: number | undefined;
|
|
110
|
+
} | {
|
|
111
|
+
workerIds: string[];
|
|
112
|
+
timeoutSeconds?: number | undefined;
|
|
113
|
+
mode?: "all" | "any" | "one" | undefined;
|
|
78
114
|
};
|
|
79
115
|
};
|
|
80
116
|
};
|
|
@@ -89,7 +125,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
89
125
|
requestIds?: string[] | undefined;
|
|
90
126
|
requestOutcomes?: {
|
|
91
127
|
requestId: string;
|
|
92
|
-
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
|
|
128
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
93
129
|
observedAt: string;
|
|
94
130
|
replyId?: string | undefined;
|
|
95
131
|
}[] | undefined;
|
|
@@ -137,11 +173,23 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
137
173
|
state: "accepted" | "continuation-required" | "destroyed" | "late";
|
|
138
174
|
resumed?: true | undefined;
|
|
139
175
|
instruction?: string | undefined;
|
|
176
|
+
question?: {
|
|
177
|
+
questions: {
|
|
178
|
+
id?: string | undefined;
|
|
179
|
+
header: string;
|
|
180
|
+
question: string;
|
|
181
|
+
options: {
|
|
182
|
+
label: string;
|
|
183
|
+
description?: string | undefined;
|
|
184
|
+
}[];
|
|
185
|
+
multiSelect?: boolean | undefined;
|
|
186
|
+
}[];
|
|
187
|
+
} | undefined;
|
|
140
188
|
};
|
|
141
|
-
delivery: "delivered" | "not-delivered" | "queued";
|
|
189
|
+
delivery: "consumed" | "delivered" | "not-delivered" | "queued";
|
|
142
190
|
outcome?: {
|
|
143
191
|
requestId: string;
|
|
144
|
-
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
|
|
192
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
145
193
|
observedAt: string;
|
|
146
194
|
replyId?: string | undefined;
|
|
147
195
|
} | undefined;
|
|
@@ -178,11 +226,23 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
178
226
|
state: "accepted" | "continuation-required" | "destroyed" | "late";
|
|
179
227
|
resumed?: true | undefined;
|
|
180
228
|
instruction?: string | undefined;
|
|
229
|
+
question?: {
|
|
230
|
+
questions: {
|
|
231
|
+
id?: string | undefined;
|
|
232
|
+
header: string;
|
|
233
|
+
question: string;
|
|
234
|
+
options: {
|
|
235
|
+
label: string;
|
|
236
|
+
description?: string | undefined;
|
|
237
|
+
}[];
|
|
238
|
+
multiSelect?: boolean | undefined;
|
|
239
|
+
}[];
|
|
240
|
+
} | undefined;
|
|
181
241
|
};
|
|
182
|
-
delivery: "delivered" | "not-delivered" | "queued";
|
|
242
|
+
delivery: "consumed" | "delivered" | "not-delivered" | "queued";
|
|
183
243
|
outcome?: {
|
|
184
244
|
requestId: string;
|
|
185
|
-
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
|
|
245
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
186
246
|
observedAt: string;
|
|
187
247
|
replyId?: string | undefined;
|
|
188
248
|
} | undefined;
|
|
@@ -219,11 +279,23 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
219
279
|
state: "accepted" | "continuation-required" | "destroyed" | "late";
|
|
220
280
|
resumed?: true | undefined;
|
|
221
281
|
instruction?: string | undefined;
|
|
282
|
+
question?: {
|
|
283
|
+
questions: {
|
|
284
|
+
id?: string | undefined;
|
|
285
|
+
header: string;
|
|
286
|
+
question: string;
|
|
287
|
+
options: {
|
|
288
|
+
label: string;
|
|
289
|
+
description?: string | undefined;
|
|
290
|
+
}[];
|
|
291
|
+
multiSelect?: boolean | undefined;
|
|
292
|
+
}[];
|
|
293
|
+
} | undefined;
|
|
222
294
|
};
|
|
223
|
-
delivery: "delivered" | "not-delivered" | "queued";
|
|
295
|
+
delivery: "consumed" | "delivered" | "not-delivered" | "queued";
|
|
224
296
|
outcome?: {
|
|
225
297
|
requestId: string;
|
|
226
|
-
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
|
|
298
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
227
299
|
observedAt: string;
|
|
228
300
|
replyId?: string | undefined;
|
|
229
301
|
} | undefined;
|
|
@@ -260,13 +332,26 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
260
332
|
state: "accepted" | "continuation-required" | "destroyed" | "late";
|
|
261
333
|
resumed?: true | undefined;
|
|
262
334
|
instruction?: string | undefined;
|
|
335
|
+
question?: {
|
|
336
|
+
questions: {
|
|
337
|
+
id?: string | undefined;
|
|
338
|
+
header: string;
|
|
339
|
+
question: string;
|
|
340
|
+
options: {
|
|
341
|
+
label: string;
|
|
342
|
+
description?: string | undefined;
|
|
343
|
+
}[];
|
|
344
|
+
multiSelect?: boolean | undefined;
|
|
345
|
+
}[];
|
|
346
|
+
} | undefined;
|
|
263
347
|
}[];
|
|
264
348
|
outcomes: {
|
|
265
349
|
requestId: string;
|
|
266
|
-
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
|
|
350
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
267
351
|
observedAt: string;
|
|
268
352
|
replyId?: string | undefined;
|
|
269
353
|
}[];
|
|
354
|
+
hint?: string | undefined;
|
|
270
355
|
};
|
|
271
356
|
outputFormat: "json";
|
|
272
357
|
status: 200;
|
|
@@ -277,12 +362,90 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
277
362
|
};
|
|
278
363
|
};
|
|
279
364
|
};
|
|
365
|
+
} & {
|
|
366
|
+
"/inbox": {
|
|
367
|
+
$post: {
|
|
368
|
+
output: {
|
|
369
|
+
messages: {
|
|
370
|
+
senderRunId: string;
|
|
371
|
+
recipientRunId: string;
|
|
372
|
+
kind: "follow-up" | "progress" | "reply" | "request";
|
|
373
|
+
requestId?: string | undefined;
|
|
374
|
+
id: string;
|
|
375
|
+
text: string;
|
|
376
|
+
createdAt: string;
|
|
377
|
+
deadline?: string | undefined;
|
|
378
|
+
requestHash: string;
|
|
379
|
+
state: "accepted" | "continuation-required" | "destroyed" | "late";
|
|
380
|
+
resumed?: true | undefined;
|
|
381
|
+
instruction?: string | undefined;
|
|
382
|
+
question?: {
|
|
383
|
+
questions: {
|
|
384
|
+
id?: string | undefined;
|
|
385
|
+
header: string;
|
|
386
|
+
question: string;
|
|
387
|
+
options: {
|
|
388
|
+
label: string;
|
|
389
|
+
description?: string | undefined;
|
|
390
|
+
}[];
|
|
391
|
+
multiSelect?: boolean | undefined;
|
|
392
|
+
}[];
|
|
393
|
+
} | undefined;
|
|
394
|
+
}[];
|
|
395
|
+
outcomes: {
|
|
396
|
+
requestId: string;
|
|
397
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
398
|
+
observedAt: string;
|
|
399
|
+
replyId?: string | undefined;
|
|
400
|
+
}[];
|
|
401
|
+
receiptId?: string | undefined;
|
|
402
|
+
expiresAt?: string | undefined;
|
|
403
|
+
};
|
|
404
|
+
outputFormat: "json";
|
|
405
|
+
status: 200;
|
|
406
|
+
input: {
|
|
407
|
+
json: Record<string, never>;
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
} & {
|
|
412
|
+
"/inbox/ack": {
|
|
413
|
+
$post: {
|
|
414
|
+
output: {
|
|
415
|
+
receiptId: string;
|
|
416
|
+
status: "acknowledged" | "already-acknowledged" | "released";
|
|
417
|
+
};
|
|
418
|
+
outputFormat: "json";
|
|
419
|
+
status: 200;
|
|
420
|
+
input: {
|
|
421
|
+
json: {
|
|
422
|
+
receiptId: string;
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
} & {
|
|
428
|
+
"/inbox/release": {
|
|
429
|
+
$post: {
|
|
430
|
+
output: {
|
|
431
|
+
receiptId: string;
|
|
432
|
+
status: "acknowledged" | "already-acknowledged" | "released";
|
|
433
|
+
};
|
|
434
|
+
outputFormat: "json";
|
|
435
|
+
status: 200;
|
|
436
|
+
input: {
|
|
437
|
+
json: {
|
|
438
|
+
receiptId: string;
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
};
|
|
280
443
|
} & {
|
|
281
444
|
"/cancel-request": {
|
|
282
445
|
$post: {
|
|
283
446
|
output: {
|
|
284
447
|
requestId: string;
|
|
285
|
-
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
|
|
448
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
286
449
|
observedAt: string;
|
|
287
450
|
replyId?: string | undefined;
|
|
288
451
|
};
|
|
@@ -298,18 +461,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
298
461
|
} & {
|
|
299
462
|
"/:workerId": {
|
|
300
463
|
$get: {
|
|
301
|
-
output: {
|
|
302
|
-
error: string;
|
|
303
|
-
code?: "invalid_input" | undefined;
|
|
304
|
-
};
|
|
305
|
-
outputFormat: "json";
|
|
306
|
-
status: 400;
|
|
307
|
-
input: {
|
|
308
|
-
param: {
|
|
309
|
-
workerId: string;
|
|
310
|
-
};
|
|
311
|
-
};
|
|
312
|
-
} | {
|
|
313
464
|
output: {
|
|
314
465
|
workerId: string;
|
|
315
466
|
parentRunId: string;
|
|
@@ -344,7 +495,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
344
495
|
requestIds?: string[] | undefined;
|
|
345
496
|
requestOutcomes?: {
|
|
346
497
|
requestId: string;
|
|
347
|
-
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "replied" | "sender-closed" | "timed-out";
|
|
498
|
+
status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
|
|
348
499
|
observedAt: string;
|
|
349
500
|
replyId?: string | undefined;
|
|
350
501
|
}[] | undefined;
|
|
@@ -386,11 +537,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
386
537
|
workerId: string;
|
|
387
538
|
};
|
|
388
539
|
};
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
} & {
|
|
392
|
-
"/:workerId/collect": {
|
|
393
|
-
$post: {
|
|
540
|
+
} | {
|
|
394
541
|
output: {
|
|
395
542
|
error: string;
|
|
396
543
|
code?: "invalid_input" | undefined;
|
|
@@ -401,10 +548,12 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
401
548
|
param: {
|
|
402
549
|
workerId: string;
|
|
403
550
|
};
|
|
404
|
-
} & {
|
|
405
|
-
json: Record<string, never>;
|
|
406
551
|
};
|
|
407
|
-
}
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
} & {
|
|
555
|
+
"/:workerId/collect": {
|
|
556
|
+
$post: {
|
|
408
557
|
output: {
|
|
409
558
|
workerId: string;
|
|
410
559
|
parentRunId: string;
|
|
@@ -506,11 +655,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
506
655
|
} & {
|
|
507
656
|
json: Record<string, never>;
|
|
508
657
|
};
|
|
509
|
-
}
|
|
510
|
-
};
|
|
511
|
-
} & {
|
|
512
|
-
"/:workerId/steer": {
|
|
513
|
-
$post: {
|
|
658
|
+
} | {
|
|
514
659
|
output: {
|
|
515
660
|
error: string;
|
|
516
661
|
code?: "invalid_input" | undefined;
|
|
@@ -522,11 +667,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
522
667
|
workerId: string;
|
|
523
668
|
};
|
|
524
669
|
} & {
|
|
525
|
-
json:
|
|
526
|
-
text: string;
|
|
527
|
-
};
|
|
670
|
+
json: Record<string, never>;
|
|
528
671
|
};
|
|
529
|
-
}
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
} & {
|
|
675
|
+
"/:workerId/steer": {
|
|
676
|
+
$post: {
|
|
530
677
|
output: {
|
|
531
678
|
workerId: string;
|
|
532
679
|
state: "delivered" | "queued";
|
|
@@ -542,11 +689,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
542
689
|
text: string;
|
|
543
690
|
};
|
|
544
691
|
};
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
} & {
|
|
548
|
-
"/:workerId/stop": {
|
|
549
|
-
$post: {
|
|
692
|
+
} | {
|
|
550
693
|
output: {
|
|
551
694
|
error: string;
|
|
552
695
|
code?: "invalid_input" | undefined;
|
|
@@ -558,9 +701,15 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
558
701
|
workerId: string;
|
|
559
702
|
};
|
|
560
703
|
} & {
|
|
561
|
-
json:
|
|
704
|
+
json: {
|
|
705
|
+
text: string;
|
|
706
|
+
};
|
|
562
707
|
};
|
|
563
|
-
}
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
} & {
|
|
711
|
+
"/:workerId/stop": {
|
|
712
|
+
$post: {
|
|
564
713
|
output: {
|
|
565
714
|
workerId: string;
|
|
566
715
|
state: "stopping" | "terminated";
|
|
@@ -574,11 +723,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
574
723
|
} & {
|
|
575
724
|
json: Record<string, never>;
|
|
576
725
|
};
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
} & {
|
|
580
|
-
"/:workerId/destroy": {
|
|
581
|
-
$post: {
|
|
726
|
+
} | {
|
|
582
727
|
output: {
|
|
583
728
|
error: string;
|
|
584
729
|
code?: "invalid_input" | undefined;
|
|
@@ -592,7 +737,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
592
737
|
} & {
|
|
593
738
|
json: Record<string, never>;
|
|
594
739
|
};
|
|
595
|
-
}
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
} & {
|
|
743
|
+
"/:workerId/destroy": {
|
|
744
|
+
$post: {
|
|
596
745
|
output: {
|
|
597
746
|
workerId: string;
|
|
598
747
|
state: "complete" | "incomplete";
|
|
@@ -615,6 +764,20 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
615
764
|
} & {
|
|
616
765
|
json: Record<string, never>;
|
|
617
766
|
};
|
|
767
|
+
} | {
|
|
768
|
+
output: {
|
|
769
|
+
error: string;
|
|
770
|
+
code?: "invalid_input" | undefined;
|
|
771
|
+
};
|
|
772
|
+
outputFormat: "json";
|
|
773
|
+
status: 400;
|
|
774
|
+
input: {
|
|
775
|
+
param: {
|
|
776
|
+
workerId: string;
|
|
777
|
+
};
|
|
778
|
+
} & {
|
|
779
|
+
json: Record<string, never>;
|
|
780
|
+
};
|
|
618
781
|
} | {
|
|
619
782
|
output: {
|
|
620
783
|
workerId: string;
|
|
@@ -644,11 +807,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
644
807
|
"/:workerId/diff": {
|
|
645
808
|
$get: {
|
|
646
809
|
output: {
|
|
647
|
-
|
|
648
|
-
|
|
810
|
+
workerId: string;
|
|
811
|
+
baselineSha: string;
|
|
812
|
+
diff: string;
|
|
813
|
+
truncated: boolean;
|
|
649
814
|
};
|
|
650
815
|
outputFormat: "json";
|
|
651
|
-
status:
|
|
816
|
+
status: 200;
|
|
652
817
|
input: {
|
|
653
818
|
param: {
|
|
654
819
|
workerId: string;
|
|
@@ -656,13 +821,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
656
821
|
};
|
|
657
822
|
} | {
|
|
658
823
|
output: {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
diff: string;
|
|
662
|
-
truncated: boolean;
|
|
824
|
+
error: string;
|
|
825
|
+
code?: "invalid_input" | undefined;
|
|
663
826
|
};
|
|
664
827
|
outputFormat: "json";
|
|
665
|
-
status:
|
|
828
|
+
status: 400;
|
|
666
829
|
input: {
|
|
667
830
|
param: {
|
|
668
831
|
workerId: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ProviderAuthService } from '../core/provider-auth.ts';
|
|
2
|
+
import { type ModelDiscoveryRunner, type ModelChoices, type DiscoveredRunners, type ProviderStatusResponse } from '../contract/index.js';
|
|
3
|
+
import { RunnerModelCatalog } from '../core/runner-model-catalog.ts';
|
|
4
|
+
export interface HostDiscovery {
|
|
5
|
+
models: Pick<RunnerModelCatalog, 'get'>;
|
|
6
|
+
providers(): Promise<ProviderStatusResponse>;
|
|
7
|
+
}
|
|
8
|
+
/** Initialize before recovery or headless execution; the cockpit reuses this same model cache. */
|
|
9
|
+
export declare function createHostDiscovery(root: string, auth: ProviderAuthService): HostDiscovery & {
|
|
10
|
+
models: RunnerModelCatalog;
|
|
11
|
+
};
|
|
12
|
+
export declare function discoveredRunners(status: ProviderStatusResponse): DiscoveredRunners;
|
|
13
|
+
/** A fresh nonempty host catalog can disprove an explicit selection; unavailable data cannot. */
|
|
14
|
+
export declare function missingModelChoices(source: HostDiscovery, runner: ModelDiscoveryRunner, model: string, effectiveModel?: string, modelIdentity?: string): Promise<ModelChoices | undefined>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { hostModelCatalogAdapters } from '../core/host-model-catalog.js';
|
|
2
|
+
import { providerAuthChecksDisabled } from '../core/provider-auth.js';
|
|
3
|
+
import { applyProviderEnablement } from '../core/provider-availability.js';
|
|
4
|
+
import { loadWorkspaceConfig } from '../workspace/config.js';
|
|
5
|
+
import { MODEL_DISCOVERY_RUNNERS } from '../contract/index.js';
|
|
6
|
+
import { RunnerModelCatalog } from '../core/runner-model-catalog.js';
|
|
7
|
+
/** Initialize before recovery or headless execution; the cockpit reuses this same model cache. */
|
|
8
|
+
export function createHostDiscovery(root, auth) {
|
|
9
|
+
return {
|
|
10
|
+
models: new RunnerModelCatalog({ adapters: hostModelCatalogAdapters(root) }),
|
|
11
|
+
providers: async () => applyProviderEnablement(await auth.status(), providerAuthChecksDisabled() ? [] : (await loadWorkspaceConfig()).disabledProviders),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function discoveredRunners(status) {
|
|
15
|
+
return { scope: 'host-default-account', runners: status.providers.map(({ provider, profileId: _profileId, ...row }) => ({ runner: provider, ...row })) };
|
|
16
|
+
}
|
|
17
|
+
/** A fresh nonempty host catalog can disprove an explicit selection; unavailable data cannot. */
|
|
18
|
+
export async function missingModelChoices(source, runner, model, effectiveModel, modelIdentity) {
|
|
19
|
+
// Reuse account-aware normalization from execution selection, including custom providers.
|
|
20
|
+
// Compare complete IDs only: never strip another runner's provider prefix speculatively.
|
|
21
|
+
const ids = new Set([model, effectiveModel, modelIdentity].filter((id) => id !== undefined));
|
|
22
|
+
const catalog = await source.models.get(runner);
|
|
23
|
+
if (catalog.source === 'unavailable' || catalog.stale || !catalog.models.length || catalog.models.some(row => ids.has(row.id)))
|
|
24
|
+
return;
|
|
25
|
+
const alternatives = await Promise.all(MODEL_DISCOVERY_RUNNERS.filter(id => id !== runner).map(async (id) => {
|
|
26
|
+
const other = await source.models.get(id);
|
|
27
|
+
return other.source !== 'unavailable' && !other.stale && other.models.some(row => ids.has(row.id)) ? id : undefined;
|
|
28
|
+
}));
|
|
29
|
+
return { runner, requestedModel: model, availableModels: catalog.models, otherRunners: alternatives.filter((id) => id !== undefined) };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/discovery/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAA4B,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAqG,MAAM,8BAA8B,CAAC;AAC1K,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAOrE,kGAAkG;AAClG,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,IAAyB;IACzE,OAAO;QACL,MAAM,EAAE,IAAI,kBAAkB,CAAC,EAAE,QAAQ,EAAE,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5E,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,uBAAuB,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,mBAAmB,EAAE,CAAC,CAAC,iBAAiB,CAAC;KACzJ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAA8B;IAC9D,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,GAAG,EAAE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E,CAAC,CAAC,CAAC,SAAS,CAAC;IACtH,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,EAA8B,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,EAAE,CAAC;AACrK,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type DiscoverOptions } from '../task-cli/discovery.ts';
|
|
2
|
+
import { type Cockpit } from '../task-cli/http.ts';
|
|
3
|
+
interface DiscoveryIo {
|
|
4
|
+
stdout(line: string): void;
|
|
5
|
+
discover?: (options: DiscoverOptions) => Promise<Cockpit>;
|
|
6
|
+
}
|
|
7
|
+
export declare function runDiscoverCommand(argv: string[], env?: NodeJS.ProcessEnv, io?: DiscoveryIo): Promise<number>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { parseArgs } from 'node:util';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { delegationErrorResponseSchema, discoveredRunnersSchema, discoveryRequestSchema, providerStatusResponseSchema, runnerModelCatalogResponseSchema, } from '../contract/index.js';
|
|
4
|
+
import { boundedJson, delegationEndpoint } from '../delegation/cli.js';
|
|
5
|
+
import { discoverCockpit } from '../task-cli/discovery.js';
|
|
6
|
+
import { fetchJson, invalidResponse, refuse, TaskCliError } from '../task-cli/http.js';
|
|
7
|
+
import { discoveredRunners } from './catalog.js';
|
|
8
|
+
const HELP = `cez discover — inspect the host's default-account catalog
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
cez discover runners
|
|
12
|
+
cez discover models --runner <claude|codex|opencode|pi|cursor>
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--url <origin> Cockpit to use (also CEZ_URL); operators only.
|
|
16
|
+
--repo <dir> Checkout whose cockpit to find (default cwd); operators only.
|
|
17
|
+
-h, --help Show help without contacting a controller.
|
|
18
|
+
|
|
19
|
+
Commands return JSON. Runners include connection status and enablement.
|
|
20
|
+
Model rows include effortLevels when advertised; absent means unknown, [] means
|
|
21
|
+
no advertised levels. Omit an effort pin to use the runner's default.
|
|
22
|
+
Catalog source/stale/reason describe discovery availability and freshness.
|
|
23
|
+
Inside a parent session, discovery uses its authenticated controller, including
|
|
24
|
+
headless runs. It never falls back to another cockpit on authentication failure.
|
|
25
|
+
Outside a session, it finds an existing cockpit; it never starts one.
|
|
26
|
+
Catalogs describe host default accounts, not every named account or spawn policy.`;
|
|
27
|
+
export async function runDiscoverCommand(argv, env = process.env, io = { stdout: line => console.log(line) }) {
|
|
28
|
+
const print = (value) => {
|
|
29
|
+
let line = JSON.stringify(value);
|
|
30
|
+
if (env.CEZ_DELEGATION_TOKEN)
|
|
31
|
+
line = line.replaceAll(env.CEZ_DELEGATION_TOKEN, '[REDACTED]');
|
|
32
|
+
io.stdout(line);
|
|
33
|
+
};
|
|
34
|
+
try {
|
|
35
|
+
let parsed;
|
|
36
|
+
try {
|
|
37
|
+
parsed = parseDiscoveryArgs(argv);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
throw new TaskCliError(64, { code: 'invalid_input', error: 'Use cez discover runners or cez discover models --runner=<runner>. See cez discover --help.' });
|
|
41
|
+
}
|
|
42
|
+
const { values, positionals } = parsed;
|
|
43
|
+
if (values.help) {
|
|
44
|
+
io.stdout(HELP);
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
const selected = discoveryRequestSchema.safeParse({ kind: positionals[0], ...(values.runner === undefined ? {} : { runner: values.runner }) });
|
|
48
|
+
if (positionals.length !== 1 || !selected.success)
|
|
49
|
+
throw new TaskCliError(64, { code: 'invalid_input', error: 'Use cez discover runners or cez discover models --runner=<runner>.' });
|
|
50
|
+
const request = selected.data;
|
|
51
|
+
const schema = request.kind === 'runners' ? discoveredRunnersSchema : runnerModelCatalogResponseSchema;
|
|
52
|
+
// Even a partial/expired session must not silently escape its controller or scope.
|
|
53
|
+
if (env.CEZ_DELEGATION_URL !== undefined || env.CEZ_DELEGATION_TOKEN !== undefined) {
|
|
54
|
+
if (values.url !== undefined || values.repo !== undefined)
|
|
55
|
+
throw new TaskCliError(64, { code: 'invalid_input', error: 'A delegation session uses its own controller; --url and --repo are unavailable.' });
|
|
56
|
+
try {
|
|
57
|
+
const endpoint = delegationEndpoint(env.CEZ_DELEGATION_URL);
|
|
58
|
+
const token = z.string().regex(/^[A-Za-z0-9_-]{43}$/).parse(env.CEZ_DELEGATION_TOKEN);
|
|
59
|
+
const response = await fetch(`${endpoint.href}/discover`, { method: 'POST', redirect: 'error', headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' }, body: JSON.stringify(request), signal: AbortSignal.timeout(45_000) });
|
|
60
|
+
const data = await boundedJson(response);
|
|
61
|
+
if (!response.ok) {
|
|
62
|
+
print(delegationErrorResponseSchema.parse(data));
|
|
63
|
+
return 2;
|
|
64
|
+
}
|
|
65
|
+
print(schema.parse(data));
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
throw new TaskCliError(2, { code: 'unavailable_transport', error: 'Discovery session is unavailable or returned an invalid response.' });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const cockpit = await (io.discover ?? discoverCockpit)({ repoDir: values.repo ?? process.cwd(), ...(values.url ?? env.CEZ_URL ? { url: values.url ?? env.CEZ_URL } : {}) });
|
|
73
|
+
const response = await fetchJson(`${cockpit.origin}/api/v1/${request.kind === 'runners' ? 'providers/status' : `models?runner=${encodeURIComponent(request.runner)}`}`);
|
|
74
|
+
if (response.status !== 200)
|
|
75
|
+
refuse(response);
|
|
76
|
+
if (request.kind === 'runners') {
|
|
77
|
+
const parsed = providerStatusResponseSchema.safeParse(response.data);
|
|
78
|
+
if (!parsed.success)
|
|
79
|
+
invalidResponse('runners');
|
|
80
|
+
print(discoveredRunners(parsed.data));
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const parsed = runnerModelCatalogResponseSchema.safeParse(response.data);
|
|
84
|
+
if (!parsed.success)
|
|
85
|
+
invalidResponse('models');
|
|
86
|
+
print(parsed.data);
|
|
87
|
+
}
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
if (error instanceof TaskCliError) {
|
|
92
|
+
print(error.body);
|
|
93
|
+
return error.exitCode;
|
|
94
|
+
}
|
|
95
|
+
print({ code: 'unavailable', error: 'Discovery is unavailable.' });
|
|
96
|
+
return 2;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function parseDiscoveryArgs(args) {
|
|
100
|
+
return parseArgs({ args, allowPositionals: true, strict: true, options: {
|
|
101
|
+
runner: { type: 'string' }, url: { type: 'string' }, repo: { type: 'string' }, help: { type: 'boolean', short: 'h' },
|
|
102
|
+
} });
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/discovery/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,6BAA6B,EAAE,uBAAuB,EAAE,sBAAsB,EAC9E,4BAA4B,EAAE,gCAAgC,GAC/D,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAwB,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,YAAY,EAAgB,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMjD,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;kFAkBqE,C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AAM,CAAC,OAAO;gBAAE,eAAe,CAAC,SAAS,CAAC,CAAC;YAChD,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,GAAG,gCAAgC,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACzE,IAAI,CAAC,MAAM,CAAC,OAAO;gBAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;YAC/C,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;YAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAAC,OAAO,KAAK,CAAC,QAAQ,CAAC;QAAC,CAAC;QAChF,KAAK,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC;QAAC,OAAO,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAc;IACxC,OAAO,SAAS,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE;YACtE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;SACrH,EAAE,CAAC,CAAC;AACP,CAAC"}
|
package/dist/git-worktree.d.ts
CHANGED
|
@@ -56,7 +56,9 @@ export declare function createWorktree(repoRoot: string, runId: string, baseBran
|
|
|
56
56
|
* size only blanks the panel's size column, it does not affect reclamation.
|
|
57
57
|
*/
|
|
58
58
|
export declare function worktreeSizeBytes(path: string): Promise<number | null>;
|
|
59
|
-
export declare function removeWorktree(repoRoot: string, worktreePath: string, branch?: string
|
|
59
|
+
export declare function removeWorktree(repoRoot: string, worktreePath: string, branch?: string, opts?: {
|
|
60
|
+
reclaimOwnedDirectory?: boolean;
|
|
61
|
+
}): Promise<void>;
|
|
60
62
|
/**
|
|
61
63
|
* Why an autosave commit happened. Only `periodic` is gated (behind
|
|
62
64
|
* `CEZ_AUTOSAVE=1`, #471) — the three flushes always run so the branch ends
|