@hearsay-tools/squawk 0.18.0-pr3753.6949 → 0.18.0-pr3755.6957

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.
Files changed (49) hide show
  1. package/dist/ci-wait/controller.d.ts +4 -4
  2. package/dist/contract/index.d.ts +1 -0
  3. package/dist/contract/index.js +24 -0
  4. package/dist/contract/runner-skills.d.ts +60 -0
  5. package/dist/core/claude-cli-runner.js +2 -4
  6. package/dist/core/claude-cli-runner.js.map +1 -1
  7. package/dist/core/claude-setting-sources.d.ts +2 -0
  8. package/dist/core/claude-setting-sources.js +7 -0
  9. package/dist/core/claude-setting-sources.js.map +1 -0
  10. package/dist/core/claude-skill-catalog.d.ts +4 -0
  11. package/dist/core/claude-skill-catalog.js +30 -0
  12. package/dist/core/claude-skill-catalog.js.map +1 -0
  13. package/dist/core/codex-skill-catalog.d.ts +4 -0
  14. package/dist/core/codex-skill-catalog.js +36 -0
  15. package/dist/core/codex-skill-catalog.js.map +1 -0
  16. package/dist/core/host-skill-catalog.d.ts +5 -0
  17. package/dist/core/host-skill-catalog.js +16 -0
  18. package/dist/core/host-skill-catalog.js.map +1 -0
  19. package/dist/core/omp-skill-catalog.d.ts +4 -0
  20. package/dist/core/omp-skill-catalog.js +23 -0
  21. package/dist/core/omp-skill-catalog.js.map +1 -0
  22. package/dist/core/opencode-skill-catalog.d.ts +4 -0
  23. package/dist/core/opencode-skill-catalog.js +37 -0
  24. package/dist/core/opencode-skill-catalog.js.map +1 -0
  25. package/dist/core/pi-skill-catalog.d.ts +4 -0
  26. package/dist/core/pi-skill-catalog.js +35 -0
  27. package/dist/core/pi-skill-catalog.js.map +1 -0
  28. package/dist/core/runner-skill-catalog.d.ts +29 -0
  29. package/dist/core/runner-skill-catalog.js +91 -0
  30. package/dist/core/runner-skill-catalog.js.map +1 -0
  31. package/dist/core/skill-path-scope.d.ts +4 -0
  32. package/dist/core/skill-path-scope.js +28 -0
  33. package/dist/core/skill-path-scope.js.map +1 -0
  34. package/dist/core/skill-probe.d.ts +17 -0
  35. package/dist/core/skill-probe.js +89 -0
  36. package/dist/core/skill-probe.js.map +1 -0
  37. package/dist/delegation/routes.d.ts +75 -75
  38. package/dist/delegation/transport.d.ts +13 -13
  39. package/dist/server/live-routes.d.ts +6 -6
  40. package/dist/server/reports-api.d.ts +2 -2
  41. package/dist/server/server.d.ts +6 -6
  42. package/package.json +4 -4
  43. package/scripts/mock-claude.mjs +12 -0
  44. package/scripts/mock-codex-app-server.mjs +4 -0
  45. package/scripts/mock-omp-rpc.mjs +6 -0
  46. package/scripts/mock-opencode-serve.mjs +9 -0
  47. package/scripts/mock-pi-rpc.mjs +5 -0
  48. package/scripts/mock-skill-list-data.mjs +184 -0
  49. package/scripts/mock-skill-list.mjs +8 -0
@@ -0,0 +1,29 @@
1
+ import type { RunnerSkillList } from '../contract/index.js';
2
+ import type { RunnerId } from './agent-runner.ts';
3
+ export type SkillCatalog = Pick<RunnerSkillList, 'skills' | 'problems'>;
4
+ export interface SkillCatalogQuery {
5
+ runner: RunnerId;
6
+ cwd: string;
7
+ accountHome?: string | undefined;
8
+ }
9
+ export interface RunnerSkillCatalogAdapter {
10
+ discover(query: SkillCatalogQuery, signal: AbortSignal): Promise<SkillCatalog>;
11
+ }
12
+ /** Folder and account sensitive, with concurrent callers joined and last good lists retained. */
13
+ export declare class RunnerSkillCatalog {
14
+ #private;
15
+ readonly options: {
16
+ adapters: Partial<Record<RunnerId, RunnerSkillCatalogAdapter>>;
17
+ now?: () => number;
18
+ ttlMs?: number;
19
+ timeoutMs?: number;
20
+ };
21
+ constructor(options: {
22
+ adapters: Partial<Record<RunnerId, RunnerSkillCatalogAdapter>>;
23
+ now?: () => number;
24
+ ttlMs?: number;
25
+ timeoutMs?: number;
26
+ });
27
+ invalidate(query: SkillCatalogQuery): void;
28
+ get(query: SkillCatalogQuery): Promise<RunnerSkillList>;
29
+ }
@@ -0,0 +1,91 @@
1
+ /** Folder and account sensitive, with concurrent callers joined and last good lists retained. */
2
+ export class RunnerSkillCatalog {
3
+ options;
4
+ #cache = new Map();
5
+ #pending = new Map();
6
+ #generation = new Map();
7
+ #now;
8
+ #ttl;
9
+ #timeout;
10
+ constructor(options) {
11
+ this.options = options;
12
+ this.#now = options.now ?? Date.now;
13
+ this.#ttl = options.ttlMs ?? 300_000;
14
+ this.#timeout = options.timeoutMs ?? 15_000;
15
+ }
16
+ invalidate(query) {
17
+ const key = catalogKey(query);
18
+ const entry = this.#cache.get(key);
19
+ if (entry)
20
+ entry.expiresAt = 0;
21
+ this.#pending.delete(key);
22
+ this.#generation.set(key, (this.#generation.get(key) ?? 0) + 1);
23
+ }
24
+ get(query) {
25
+ const key = catalogKey(query);
26
+ const entry = this.#cache.get(key);
27
+ if (entry && entry.expiresAt > this.#now())
28
+ return Promise.resolve(answer(query.runner, entry));
29
+ const pending = this.#pending.get(key);
30
+ if (pending)
31
+ return pending;
32
+ const generation = this.#generation.get(key) ?? 0;
33
+ const current = () => (this.#generation.get(key) ?? 0) === generation;
34
+ const refresh = this.#refresh(query, entry).then(result => {
35
+ if (current())
36
+ this.#cache.set(key, result);
37
+ return answer(query.runner, result, true);
38
+ }).finally(() => { if (current())
39
+ this.#pending.delete(key); });
40
+ this.#pending.set(key, refresh);
41
+ return refresh;
42
+ }
43
+ async #refresh(query, old) {
44
+ const controller = new AbortController();
45
+ let timer;
46
+ let discovery;
47
+ const deadline = new Promise((_, reject) => {
48
+ timer = setTimeout(() => { controller.abort(); reject(new Error('timeout')); }, this.#timeout);
49
+ });
50
+ try {
51
+ const adapter = this.options.adapters[query.runner];
52
+ if (!adapter)
53
+ throw new Error('adapter missing');
54
+ discovery = adapter.discover(query, controller.signal);
55
+ const value = await Promise.race([discovery, deadline]);
56
+ return { value: structuredClone(value), expiresAt: this.#now() + this.#ttl };
57
+ }
58
+ catch {
59
+ return { value: old?.value, expiresAt: this.#now() + this.#ttl,
60
+ reason: `${query.runner} skill discovery is temporarily unavailable` };
61
+ }
62
+ finally {
63
+ clearTimeout(timer);
64
+ if (controller.signal.aborted && discovery)
65
+ await settleCancelledProbe(discovery);
66
+ }
67
+ }
68
+ }
69
+ function catalogKey(query) {
70
+ return JSON.stringify([query.runner, query.accountHome ?? null, query.cwd]);
71
+ }
72
+ function answer(runner, entry, fresh = false) {
73
+ return structuredClone({ runner, skills: entry.value?.skills ?? [], problems: entry.value?.problems ?? [],
74
+ source: entry.value ? (fresh && !entry.reason ? 'live' : 'cache') : 'unavailable',
75
+ ...(entry.reason ? { reason: entry.reason } : {}) });
76
+ }
77
+ /** Cancellation sends the kill immediately; observe adapter cleanup before answering. A broken
78
+ * adapter cannot extend a request by more than this one-second cleanup bound. */
79
+ async function settleCancelledProbe(discovery) {
80
+ let timer;
81
+ try {
82
+ await Promise.race([
83
+ discovery.catch(() => undefined),
84
+ new Promise(resolve => { timer = setTimeout(resolve, 1000); }),
85
+ ]);
86
+ }
87
+ finally {
88
+ clearTimeout(timer);
89
+ }
90
+ }
91
+ //# sourceMappingURL=runner-skill-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-skill-catalog.js","sourceRoot":"","sources":["../../src/core/runner-skill-catalog.ts"],"names":[],"mappings":"AAUA,iGAAiG;AACjG,MAAM,OAAO,kBAAkB;IAOR,OAAO;IANnB,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IAClC,QAAQ,GAAG,IAAI,GAAG,EAAoC,CAAC;IACvD,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,IAAI,CAAe;IACnB,IAAI,CAAS;IACb,QAAQ,CAAS;IAC1B,YAAqB,OAKpB;uBALoB,OAAO;QAM1B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,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AAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACzD,CAAC;AAED;iFACiF;AACjF,KAAK,UAAU,oBAAoB,CAAC,SAAgC;IAClE,IAAI,KAAiC,CAAC;IACtC,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;YAChC,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;SACrE,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { RunnerSkillScope } from '../contract/index.js';
2
+ /** Location metadata only: never read a skill file or scan a skill folder. */
3
+ export declare function skillPathScope(path: string, cwd: string, userHome: string): RunnerSkillScope;
4
+ export declare function skillPathPlugin(path: string): string | undefined;
@@ -0,0 +1,28 @@
1
+ import { isAbsolute, relative, sep } from 'node:path';
2
+ function within(folder, path) {
3
+ const suffix = relative(folder, path);
4
+ return suffix === '' || (!isAbsolute(suffix) && suffix !== '..' && !suffix.startsWith(`..${sep}`));
5
+ }
6
+ /** Location metadata only: never read a skill file or scan a skill folder. */
7
+ export function skillPathScope(path, cwd, userHome) {
8
+ if (!isAbsolute(path))
9
+ return path === '<built-in>' ? 'system' : 'other';
10
+ if (within(cwd, path))
11
+ return 'repo';
12
+ const normalized = path.split(sep).join('/');
13
+ const marker = normalized.search(/\/(?:\.agents|\.claude|\.opencode|\.pi)\/skills?\//);
14
+ if (marker !== -1) {
15
+ const root = normalized.slice(0, marker);
16
+ if (root !== userHome && within(root, cwd))
17
+ return 'repo';
18
+ }
19
+ if (userHome && within(userHome, path))
20
+ return 'user';
21
+ // OpenCode's built-in skills may have a virtual location rather than a file path.
22
+ return 'other';
23
+ }
24
+ export function skillPathPlugin(path) {
25
+ const marker = path.match(/\/(?:plugins\/cache\/[^/]+\/([^/]+)|plugins\/([^/]+)\/skills\/)/);
26
+ return marker?.[1] ?? marker?.[2];
27
+ }
28
+ //# sourceMappingURL=skill-path-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-path-scope.js","sourceRoot":"","sources":["../../src/core/skill-path-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGtD,SAAS,MAAM,CAAC,MAAc,EAAE,IAAY;IAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACtC,OAAO,MAAM,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC;AACrG,CAAC;AACD,8EAA8E;AAC9E,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,GAAW,EAAE,QAAgB;IACxE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IACzE,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IACrC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,oDAAoD,CAAC,CAAC;IACvF,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;QAClB,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACzC,IAAI,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;YAAE,OAAO,MAAM,CAAC;IAC5D,CAAC;IACD,IAAI,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IACtD,kFAAkF;IAClF,OAAO,OAAO,CAAC;AACjB,CAAC;AACD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;IAC7F,OAAO,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type ChildProcessWithoutNullStreams } from 'node:child_process';
2
+ import type { RunnerId } from './agent-runner.ts';
3
+ export interface SkillDiscoveryOptions {
4
+ cwd: string;
5
+ accountHome?: string | undefined;
6
+ bin?: string | undefined;
7
+ timeoutMs?: number | undefined;
8
+ signal?: AbortSignal | undefined;
9
+ spawn?: ((bin: string, args: readonly string[], cwd: string, env: NodeJS.ProcessEnv) => ChildProcessWithoutNullStreams) | undefined;
10
+ }
11
+ export declare function skillExecutable(runner: RunnerId, bin?: string): string;
12
+ /** A no-turn probe owns a process group. Kill it and observe exit before releasing its caller. */
13
+ export declare function skillProbe<T>(runner: RunnerId, args: readonly string[], options: SkillDiscoveryOptions, read: (child: ChildProcessWithoutNullStreams, signal: AbortSignal, env: NodeJS.ProcessEnv) => Promise<T>): Promise<T>;
14
+ /** Bound streams even when a CLI emits a single line without a newline. */
15
+ export declare function skillLines(child: ChildProcessWithoutNullStreams): AsyncGenerator<string>;
16
+ /** CLI list commands finish on EOF; errors and deadlines are owned by skillProbe. */
17
+ export declare function skillOutput(child: ChildProcessWithoutNullStreams): Promise<string>;
@@ -0,0 +1,89 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { buildChildEnv } from './agent-env.js';
3
+ import { profileEnv } from './agent-profiles.js';
4
+ import { productEnv } from './product-env.js';
5
+ import { signalSession, spawnSessionLeader } from './session-process.js';
6
+ export function skillExecutable(runner, bin) {
7
+ return bin ?? { claude: productEnv('CLAUDE_BIN'), codex: productEnv('CODEX_BIN'),
8
+ opencode: productEnv('OPENCODE_BIN'), pi: productEnv('PI_BIN'), omp: productEnv('OMP_BIN') }[runner] ?? (productEnv('DRY_RUN') === '1'
9
+ ? fileURLToPath(new URL(`../../scripts/${MOCKS[runner]}`, import.meta.url)) : runner);
10
+ }
11
+ const MOCKS = {
12
+ claude: 'mock-claude.mjs', codex: 'mock-codex-app-server.mjs', opencode: 'mock-opencode-serve.mjs',
13
+ pi: 'mock-pi-rpc.mjs', omp: 'mock-omp-rpc.mjs',
14
+ };
15
+ /** A no-turn probe owns a process group. Kill it and observe exit before releasing its caller. */
16
+ export async function skillProbe(runner, args, options, read) {
17
+ options.signal?.throwIfAborted();
18
+ const env = buildChildEnv({ backend: runner, extraEnv: profileEnv(runner, options.accountHome) });
19
+ const launch = options.spawn ?? ((bin, argv, cwd, env) => spawnSessionLeader(bin, argv, { cwd, env }));
20
+ const child = launch(skillExecutable(runner, options.bin), args, options.cwd, env);
21
+ const exited = probeExit(child);
22
+ const signal = AbortSignal.any([options.signal ?? new AbortController().signal, AbortSignal.timeout(options.timeoutMs ?? 15_000)]);
23
+ const kill = () => signalSession(child, 'SIGKILL');
24
+ child.stderr.on('error', () => { });
25
+ child.stderr.resume();
26
+ child.stdin.on('error', () => { });
27
+ let onAbort = () => { };
28
+ const failed = new Promise((_, reject) => {
29
+ child.once('error', () => reject(new Error('Skill probe child failed')));
30
+ child.once('exit', code => { if (code !== 0)
31
+ reject(new Error('Skill probe exited before answering')); });
32
+ });
33
+ const aborted = new Promise((_, reject) => {
34
+ onAbort = () => { kill(); reject(new Error('Skill probe timed out or was cancelled')); };
35
+ signal.addEventListener('abort', onAbort, { once: true });
36
+ if (signal.aborted)
37
+ onAbort();
38
+ });
39
+ try {
40
+ return await Promise.race([read(child, signal, env), failed, aborted]);
41
+ }
42
+ finally {
43
+ signal.removeEventListener('abort', onAbort);
44
+ kill();
45
+ await exited;
46
+ child.stdin.destroy();
47
+ child.stdout.destroy();
48
+ child.stderr.destroy();
49
+ }
50
+ }
51
+ /** Bound streams even when a CLI emits a single line without a newline. */
52
+ export async function* skillLines(child) {
53
+ child.stdout.setEncoding('utf8');
54
+ let pending = '';
55
+ let size = 0;
56
+ for await (const chunk of child.stdout) {
57
+ size += Buffer.byteLength(chunk);
58
+ if (size > 4 * 1024 * 1024)
59
+ throw new Error('Skill probe exceeded the output limit');
60
+ pending += chunk.toString();
61
+ let end;
62
+ while ((end = pending.indexOf('\n')) !== -1) {
63
+ yield pending.slice(0, end);
64
+ pending = pending.slice(end + 1);
65
+ }
66
+ }
67
+ if (pending)
68
+ yield pending;
69
+ }
70
+ /** CLI list commands finish on EOF; errors and deadlines are owned by skillProbe. */
71
+ export async function skillOutput(child) {
72
+ const exited = probeExit(child);
73
+ const lines = [];
74
+ for await (const line of skillLines(child))
75
+ lines.push(line);
76
+ if (await exited !== 0)
77
+ throw new Error('Skill list command failed');
78
+ return lines.join('\n');
79
+ }
80
+ function probeExit(child) {
81
+ if (child.exitCode !== null || child.signalCode !== null)
82
+ return Promise.resolve(child.exitCode);
83
+ return new Promise(resolve => {
84
+ child.once('exit', resolve);
85
+ child.once('error', () => { if (child.pid === undefined)
86
+ resolve(null); });
87
+ });
88
+ }
89
+ //# sourceMappingURL=skill-probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-probe.js","sourceRoot":"","sources":["../../src/core/skill-probe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,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AI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,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;
@@ -76,12 +64,33 @@ export declare function createDelegationRoutes(service: DelegationService, crede
76
64
  offset?: string | undefined;
77
65
  };
78
66
  };
67
+ } | {
68
+ output: {
69
+ error: string;
70
+ code?: "invalid_input" | undefined;
71
+ };
72
+ outputFormat: "json";
73
+ status: 400;
74
+ input: {
75
+ query: {
76
+ offset?: string | undefined;
77
+ };
78
+ };
79
79
  };
80
80
  };
81
81
  } & {
82
82
  "/discover": {
83
83
  $post: {
84
84
  output: {
85
+ scope: "host-default-account";
86
+ runners: {
87
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
88
+ enabled?: boolean | undefined;
89
+ hint?: string | undefined;
90
+ authFailureId?: string | undefined;
91
+ runner: "claude" | "codex" | "omp" | "opencode" | "pi";
92
+ }[];
93
+ } | {
85
94
  runner: "claude" | "codex" | "omp" | "opencode" | "pi";
86
95
  models: {
87
96
  id: string;
@@ -92,15 +101,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
92
101
  source: "cache" | "live" | "unavailable";
93
102
  stale: boolean;
94
103
  reason?: string | undefined;
95
- } | {
96
- scope: "host-default-account";
97
- runners: {
98
- status: "connected" | "disconnected" | "not-installed" | "unknown";
99
- enabled?: boolean | undefined;
100
- hint?: string | undefined;
101
- authFailureId?: string | undefined;
102
- runner: "claude" | "codex" | "omp" | "opencode" | "pi";
103
- }[];
104
104
  } | {
105
105
  tasks: {
106
106
  id: string;
@@ -221,13 +221,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
221
221
  status: 200;
222
222
  input: {
223
223
  json: {
224
- workerIds: string[];
225
- timeoutSeconds?: number | undefined;
226
- mode?: "all" | "any" | "one" | undefined;
227
- } | {
228
224
  requestIds: string[];
229
225
  mode?: "all" | "any" | "one" | undefined;
230
226
  timeoutSeconds?: number | undefined;
227
+ } | {
228
+ workerIds: string[];
229
+ timeoutSeconds?: number | undefined;
230
+ mode?: "all" | "any" | "one" | undefined;
231
231
  } | {
232
232
  peerIds: string[];
233
233
  timeoutSeconds?: number | undefined;
@@ -613,18 +613,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
613
613
  } & {
614
614
  "/:workerId": {
615
615
  $get: {
616
- output: {
617
- error: string;
618
- code?: "invalid_input" | undefined;
619
- };
620
- outputFormat: "json";
621
- status: 400;
622
- input: {
623
- param: {
624
- workerId: string;
625
- };
626
- };
627
- } | {
628
616
  output: {
629
617
  workerId: string;
630
618
  parentRunId: string;
@@ -732,11 +720,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
732
720
  workerId: string;
733
721
  };
734
722
  };
735
- };
736
- };
737
- } & {
738
- "/:workerId/collect": {
739
- $post: {
723
+ } | {
740
724
  output: {
741
725
  error: string;
742
726
  code?: "invalid_input" | undefined;
@@ -747,10 +731,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
747
731
  param: {
748
732
  workerId: string;
749
733
  };
750
- } & {
751
- json: Record<string, never>;
752
734
  };
753
- } | {
735
+ };
736
+ };
737
+ } & {
738
+ "/:workerId/collect": {
739
+ $post: {
754
740
  output: {
755
741
  workerId: string;
756
742
  parentRunId: string;
@@ -852,11 +838,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
852
838
  } & {
853
839
  json: Record<string, never>;
854
840
  };
855
- };
856
- };
857
- } & {
858
- "/:workerId/steer": {
859
- $post: {
841
+ } | {
860
842
  output: {
861
843
  error: string;
862
844
  code?: "invalid_input" | undefined;
@@ -868,11 +850,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
868
850
  workerId: string;
869
851
  };
870
852
  } & {
871
- json: {
872
- text: string;
873
- };
853
+ json: Record<string, never>;
874
854
  };
875
- } | {
855
+ };
856
+ };
857
+ } & {
858
+ "/:workerId/steer": {
859
+ $post: {
876
860
  output: {
877
861
  workerId: string;
878
862
  state: "delivered" | "queued";
@@ -888,11 +872,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
888
872
  text: string;
889
873
  };
890
874
  };
891
- };
892
- };
893
- } & {
894
- "/:workerId/stop": {
895
- $post: {
875
+ } | {
896
876
  output: {
897
877
  error: string;
898
878
  code?: "invalid_input" | undefined;
@@ -904,9 +884,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
904
884
  workerId: string;
905
885
  };
906
886
  } & {
907
- json: Record<string, never>;
887
+ json: {
888
+ text: string;
889
+ };
908
890
  };
909
- } | {
891
+ };
892
+ };
893
+ } & {
894
+ "/:workerId/stop": {
895
+ $post: {
910
896
  output: {
911
897
  workerId: string;
912
898
  state: "stopping" | "terminated";
@@ -920,11 +906,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
920
906
  } & {
921
907
  json: Record<string, never>;
922
908
  };
923
- };
924
- };
925
- } & {
926
- "/:workerId/destroy": {
927
- $post: {
909
+ } | {
928
910
  output: {
929
911
  error: string;
930
912
  code?: "invalid_input" | undefined;
@@ -938,7 +920,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
938
920
  } & {
939
921
  json: Record<string, never>;
940
922
  };
941
- } | {
923
+ };
924
+ };
925
+ } & {
926
+ "/:workerId/destroy": {
927
+ $post: {
942
928
  output: {
943
929
  workerId: string;
944
930
  state: "complete" | "incomplete";
@@ -961,6 +947,20 @@ export declare function createDelegationRoutes(service: DelegationService, crede
961
947
  } & {
962
948
  json: Record<string, never>;
963
949
  };
950
+ } | {
951
+ output: {
952
+ error: string;
953
+ code?: "invalid_input" | undefined;
954
+ };
955
+ outputFormat: "json";
956
+ status: 400;
957
+ input: {
958
+ param: {
959
+ workerId: string;
960
+ };
961
+ } & {
962
+ json: Record<string, never>;
963
+ };
964
964
  } | {
965
965
  output: {
966
966
  workerId: string;
@@ -990,11 +990,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
990
990
  "/:workerId/diff": {
991
991
  $get: {
992
992
  output: {
993
- error: string;
994
- code?: "invalid_input" | undefined;
993
+ workerId: string;
994
+ baselineSha: string;
995
+ diff: string;
996
+ truncated: boolean;
995
997
  };
996
998
  outputFormat: "json";
997
- status: 400;
999
+ status: 200;
998
1000
  input: {
999
1001
  param: {
1000
1002
  workerId: string;
@@ -1002,13 +1004,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1002
1004
  };
1003
1005
  } | {
1004
1006
  output: {
1005
- workerId: string;
1006
- baselineSha: string;
1007
- diff: string;
1008
- truncated: boolean;
1007
+ error: string;
1008
+ code?: "invalid_input" | undefined;
1009
1009
  };
1010
1010
  outputFormat: "json";
1011
- status: 200;
1011
+ status: 400;
1012
1012
  input: {
1013
1013
  param: {
1014
1014
  workerId: string;
@@ -57,15 +57,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
57
57
  "/discover": {
58
58
  $post: {
59
59
  output: {
60
- scope: "host-default-account";
61
- runners: {
62
- status: "connected" | "disconnected" | "not-installed" | "unknown";
63
- enabled?: boolean | undefined;
64
- hint?: string | undefined;
65
- authFailureId?: string | undefined;
66
- runner: "claude" | "codex" | "omp" | "opencode" | "pi";
67
- }[];
68
- } | {
69
60
  tasks: {
70
61
  id: string;
71
62
  title: string;
@@ -77,6 +68,15 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
77
68
  reason?: string | undefined;
78
69
  }[];
79
70
  nextOffset?: number | undefined;
71
+ } | {
72
+ scope: "host-default-account";
73
+ runners: {
74
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
75
+ enabled?: boolean | undefined;
76
+ hint?: string | undefined;
77
+ authFailureId?: string | undefined;
78
+ runner: "claude" | "codex" | "omp" | "opencode" | "pi";
79
+ }[];
80
80
  } | {
81
81
  runner: "claude" | "codex" | "omp" | "opencode" | "pi";
82
82
  models: {
@@ -196,13 +196,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
196
196
  status: 200;
197
197
  input: {
198
198
  json: {
199
- workerIds: string[];
200
- timeoutSeconds?: number | undefined;
201
- mode?: "all" | "any" | "one" | undefined;
202
- } | {
203
199
  requestIds: string[];
204
200
  mode?: "all" | "any" | "one" | undefined;
205
201
  timeoutSeconds?: number | undefined;
202
+ } | {
203
+ workerIds: string[];
204
+ timeoutSeconds?: number | undefined;
205
+ mode?: "all" | "any" | "one" | undefined;
206
206
  } | {
207
207
  peerIds: string[];
208
208
  timeoutSeconds?: number | undefined;
@@ -16,12 +16,6 @@ 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
- } | {
25
19
  projectId: string;
26
20
  runId: string;
27
21
  type: "batch";
@@ -35,6 +29,12 @@ export declare function createLiveRoutes({ resolveProject, serverGeneration, res
35
29
  cursor: string;
36
30
  afterSeq: number;
37
31
  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";
@@ -40,7 +40,7 @@ export declare const reportsRoutes: import("hono/hono-base").HonoBase<ProjectApi
40
40
  error: string;
41
41
  };
42
42
  outputFormat: "json";
43
- status: 409;
43
+ status: 400;
44
44
  input: {
45
45
  query: {
46
46
  q?: string | undefined;
@@ -53,7 +53,7 @@ export declare const reportsRoutes: import("hono/hono-base").HonoBase<ProjectApi
53
53
  error: string;
54
54
  };
55
55
  outputFormat: "json";
56
- status: 400;
56
+ status: 409;
57
57
  input: {
58
58
  query: {
59
59
  q?: string | undefined;