@hearsay-tools/squawk 0.18.0-pr4321.8395 → 0.18.0-pr4322.8423

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 (80) hide show
  1. package/dist/automations/tools.d.ts +8 -8
  2. package/dist/boot.d.ts +1 -1
  3. package/dist/boot.js +4 -1
  4. package/dist/boot.js.map +1 -1
  5. package/dist/built-in-launch-parts.d.ts +16 -0
  6. package/dist/built-in-launch-parts.js +61 -0
  7. package/dist/built-in-launch-parts.js.map +1 -0
  8. package/dist/ci-wait/controller.d.ts +7 -7
  9. package/dist/core/launch-registry.d.ts +50 -0
  10. package/dist/core/launch-registry.js +60 -0
  11. package/dist/core/launch-registry.js.map +1 -0
  12. package/dist/delegation/transport.d.ts +65 -65
  13. package/dist/plugin/api.d.ts +4 -0
  14. package/dist/plugin/api.js +10 -1
  15. package/dist/plugin/api.js.map +1 -1
  16. package/dist/plugin/cli.js +1 -0
  17. package/dist/plugin/cli.js.map +1 -1
  18. package/dist/plugin/index.d.ts +1 -0
  19. package/dist/plugin/index.js.map +1 -1
  20. package/dist/server/runs-routes.d.ts +709 -709
  21. package/dist/server/workspace-live-routes.d.ts +6 -6
  22. package/dist/workflows/run/compose.js +1 -2
  23. package/dist/workflows/run/compose.js.map +1 -1
  24. package/dist/workflows/run/continuation-session.js +10 -9
  25. package/dist/workflows/run/continuation-session.js.map +1 -1
  26. package/dist/workflows/run/launch-context.d.ts +5 -9
  27. package/dist/workflows/run/launch-context.js +7 -24
  28. package/dist/workflows/run/launch-context.js.map +1 -1
  29. package/dist/workflows/run/session-events.d.ts +16 -8
  30. package/dist/workflows/run/session-events.js +12 -11
  31. package/dist/workflows/run/session-events.js.map +1 -1
  32. package/dist/workflows/run/step-session.js +10 -9
  33. package/dist/workflows/run/step-session.js.map +1 -1
  34. package/dist/workflows/run/types.d.ts +3 -2
  35. package/package.json +4 -4
  36. package/scripts/benchmark-runtime.ts +3 -0
  37. package/scripts/measure-transcript-facts-health.mjs +44 -4
  38. package/scripts/measure-transcript-facts-lag.mjs +3 -3
  39. package/scripts/transcript-facts-timing.mjs +126 -9
  40. package/web/dist/assets/{accounts-section-D3rKSj1e.js → accounts-section-DmCfsIhE.js} +1 -1
  41. package/web/dist/assets/{activity-motion-CFgok4CI.js → activity-motion-Dl9i8LMp.js} +1 -1
  42. package/web/dist/assets/{activity-route-HvdWBepL.js → activity-route-Cu2YIdei.js} +1 -1
  43. package/web/dist/assets/{agent-config-section-DbmhTCJA.js → agent-config-section-Bzm4-R__.js} +1 -1
  44. package/web/dist/assets/{agent-defaults-section-5fBA2FMV.js → agent-defaults-section-BKqo164A.js} +1 -1
  45. package/web/dist/assets/{appearance-ZpysBpxH.js → appearance-BqzgpB-Y.js} +1 -1
  46. package/web/dist/assets/{automations-route-aINxoEQX.js → automations-route-CUgWc2Qw.js} +1 -1
  47. package/web/dist/assets/{commit-diff-panel-BzAqXG0p.js → commit-diff-panel-Cm558uOv.js} +1 -1
  48. package/web/dist/assets/{diff-lVUk7FAR.js → diff-GEuSlT_R.js} +2 -2
  49. package/web/dist/assets/{diff-view-B5RGiepv.js → diff-view-DLSixc9l.js} +1 -1
  50. package/web/dist/assets/{file-preview-Bn5u5k1W.js → file-preview-RPc0KAo_.js} +1 -1
  51. package/web/dist/assets/{git-toolbar-xLFz5nnr.js → git-toolbar-Dd_SYvD0.js} +1 -1
  52. package/web/dist/assets/{github-DxiILmDg.js → github-CQ7IuYHM.js} +1 -1
  53. package/web/dist/assets/{global-activity-route-BmqMaZug.js → global-activity-route-BxZ0CMwG.js} +1 -1
  54. package/web/dist/assets/{index-DndX-kC-.js → index-BRgRv29I.js} +4 -4
  55. package/web/dist/assets/{markdown-DHYxiDex.js → markdown-CIm2Q7mB.js} +1 -1
  56. package/web/dist/assets/{notifications-section-xHvjaRxV.js → notifications-section-Cw8yBZWz.js} +1 -1
  57. package/web/dist/assets/{preview-pane-connected-C5Lsjf2P.js → preview-pane-connected-C3DmH_yh.js} +1 -1
  58. package/web/dist/assets/{projects-section-0ov7IK9p.js → projects-section-DftkCQ4q.js} +1 -1
  59. package/web/dist/assets/{prompt-templates-section-DgLWN4ZB.js → prompt-templates-section-CKSYhpin.js} +1 -1
  60. package/web/dist/assets/{remote-settings-notice-kmlL_JEi.js → remote-settings-notice-C727a84A.js} +1 -1
  61. package/web/dist/assets/{repo-git-D-L0KYwh.js → repo-git-CfmNmHkb.js} +1 -1
  62. package/web/dist/assets/{report-reader-Fb02sGC6.js → report-reader-wIj2Yog1.js} +1 -1
  63. package/web/dist/assets/{reports--yxm1Dbp.js → reports-DSkGAItT.js} +1 -1
  64. package/web/dist/assets/{resources-section-CZu7afz7.js → resources-section-DaEv2dar.js} +1 -1
  65. package/web/dist/assets/{run-header-Bajufo9w.js → run-header-CVZ0ZK7C.js} +1 -1
  66. package/web/dist/assets/{settings-agent-picker-XdHS0cXP.js → settings-agent-picker-DMVlOQzv.js} +1 -1
  67. package/web/dist/assets/{settings-shell-63smMna1.js → settings-shell-DfnGZk9I.js} +1 -1
  68. package/web/dist/assets/{sidebar-section-Dgf9Tda6.js → sidebar-section-DYJZAqtU.js} +1 -1
  69. package/web/dist/assets/{skills-CVoGqJeT.js → skills-CfzNcHh1.js} +1 -1
  70. package/web/dist/assets/{task-changes-Cd30VNwk.js → task-changes-C1I9CMew.js} +1 -1
  71. package/web/dist/assets/{task-commits-33kwaiVP.js → task-commits-d_R4H7pu.js} +1 -1
  72. package/web/dist/assets/{task-files-W2NkAX0s.js → task-files-B2JBO9Dx.js} +1 -1
  73. package/web/dist/assets/{task-github-item-C7dEQxMN.js → task-github-item-C9HMDHKn.js} +1 -1
  74. package/web/dist/assets/{task-thread-Bi5cKYmZ.js → task-thread-dKvX9xg6.js} +1 -1
  75. package/web/dist/assets/{thread-state-DI7JLoTx.js → thread-state-B3HGSNEy.js} +1 -1
  76. package/web/dist/assets/{use-hand-to-agent-state-B869bBKO.js → use-hand-to-agent-state-DzHDdmHn.js} +1 -1
  77. package/web/dist/assets/{workflows-CeRdeF9n.js → workflows-DqArthZn.js} +1 -1
  78. package/web/dist/assets/{workspace-tools-YqTAoyv7.js → workspace-tools-S5KvgCRm.js} +1 -1
  79. package/web/dist/assets/{worktrees-section-9fwC5DGp.js → worktrees-section-DNFnQfiW.js} +1 -1
  80. package/web/dist/index.html +1 -1
@@ -7,10 +7,6 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
7
7
  }[];
8
8
  isError: boolean;
9
9
  details: {
10
- ok: false;
11
- code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
12
- message: string;
13
- } | {
14
10
  ok: true;
15
11
  task: {
16
12
  id: string;
@@ -22,6 +18,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
22
18
  url?: string | undefined;
23
19
  };
24
20
  note: string;
21
+ } | {
22
+ ok: false;
23
+ code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
24
+ message: string;
25
25
  };
26
26
  }>;
27
27
  export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof callScheduleTask>>): {
@@ -31,10 +31,6 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
31
31
  }[];
32
32
  isError: boolean;
33
33
  details: {
34
- ok: false;
35
- code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
36
- message: string;
37
- } | {
38
34
  ok: true;
39
35
  task: {
40
36
  id: string;
@@ -46,6 +42,10 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
46
42
  url?: string | undefined;
47
43
  };
48
44
  note: string;
45
+ } | {
46
+ ok: false;
47
+ code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
48
+ message: string;
49
49
  };
50
50
  };
51
51
  export declare function invokeScheduledTasksTool(input: unknown): Promise<{
package/dist/boot.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface BootRuntimeOptions {
26
26
  /**
27
27
  * Register every built-in extension table, load the bundled runners and then the host plugins
28
28
  * through the plugin loader, run the optional hook, then seal
29
- * all eight registries in this one place. A second call returns the same boot and does not load
29
+ * all nine registries in this one place. A second call returns the same boot and does not load
30
30
  * plugins or run the hook again.
31
31
  */
32
32
  export declare function bootRuntime(options?: BootRuntimeOptions): Promise<void>;
package/dist/boot.js CHANGED
@@ -27,7 +27,7 @@ let hostPluginsLoaded = false;
27
27
  /**
28
28
  * Register every built-in extension table, load the bundled runners and then the host plugins
29
29
  * through the plugin loader, run the optional hook, then seal
30
- * all eight registries in this one place. A second call returns the same boot and does not load
30
+ * all nine registries in this one place. A second call returns the same boot and does not load
31
31
  * plugins or run the hook again.
32
32
  */
33
33
  export function bootRuntime(options) {
@@ -46,6 +46,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, beforeSeal }) {
46
46
  if (!cliCommandsSealed())
47
47
  registerBuiltInCliCommands();
48
48
  const { registerBuiltInRunSlots, sealBuiltInRunSlots } = await import('./built-in-run-slots.js');
49
+ const { registerBuiltInLaunchParts, sealBuiltInLaunchParts } = await import('./built-in-launch-parts.js');
49
50
  const { registerBuiltInStepKinds, sealBuiltInStepKinds } = await import('./workflows/step-kind-registry.js');
50
51
  const { registerBuiltInTools, sealBuiltInTools } = await import('./built-in-tools.js');
51
52
  const { registerBuiltInWaitKinds, sealBuiltInWaitKinds } = await import('./built-in-wait-kinds.js');
@@ -53,6 +54,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, beforeSeal }) {
53
54
  const { sealRunners } = await import('./core/runner-registry.js');
54
55
  const loader = await import('./plugin/loader.js');
55
56
  registerBuiltInRunSlots();
57
+ registerBuiltInLaunchParts();
56
58
  registerBuiltInStepKinds();
57
59
  registerBuiltInTools();
58
60
  registerBuiltInWaitKinds();
@@ -67,6 +69,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, beforeSeal }) {
67
69
  sealBuiltInCliCommands();
68
70
  sealRunners();
69
71
  sealBuiltInRunSlots();
72
+ sealBuiltInLaunchParts();
70
73
  sealBuiltInStepKinds();
71
74
  sealBuiltInTools();
72
75
  sealBuiltInWaitKinds();
package/dist/boot.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAGpE;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,0BAA0B,EAAE,CAAC;IAC7B,sBAAsB,EAAE,CAAC;AAC3B,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,cAAc,CAAC,IAAgB,EAAE,IAAI,GAA2B,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;IACzG,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,oCAAoC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACjI,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAoBD,IAAI,WAAsC,CAAC;AAC3C,kHAAkH;AAClH,IAAI,kBAAgD,CAAC;AACrD,iGAAiG;AACjG,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;IACtD,IAAI,WAAW;QAAE,OAAO,WAAW,CAAC;IACpC,WAAW,GAAG,WAAW,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACrD,WAAW,GAAG,SAAS,CAAC;QACxB,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;I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AC;IAC3B,oBAAoB,EAAE,CAAC;IACvB,wBAAwB,EAAE,CAAC;IAC3B,MAAM,CAAC,kBAAkB,KAAK,iBAAiB,KAAK,SAAS;QAC3D,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE;QAC7B,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxE,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACnD,iBAAiB,GAAG,IAAI,CAAC;QACzB,MAAM,MAAM,CAAC,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,UAAU,EAAE,EAAE,CAAC;IACrB,sBAAsB,EAAE,CAAC;IACzB,WAAW,EAAE,CAAC;IACd,mBAAmB,EAAE,CAAC;IACtB,sBAAsB,EAAE,CAAC;IACzB,oBAAoB,EAAE,CAAC;IACvB,gBAAgB,EAAE,CAAC;IACnB,oBAAoB,EAAE,CAAC;IACvB,yBAAyB,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type LaunchPartDefinition } from './core/launch-registry.ts';
2
+ /** Automations on AND a cockpit attached: the automations part of every session's system prompt. */
3
+ export declare const automationsLaunchPart: LaunchPartDefinition;
4
+ /** The "Project webhooks" part (#1576): the webhooks this project exposes to agents, read from
5
+ * the registry when a session starts. Needs a cockpit to send through; nothing exposed, or an
6
+ * unreadable registry, adds nothing. */
7
+ export declare const webhooksLaunchPart: LaunchPartDefinition;
8
+ /** The run's artifact directory as env, and the artifact contract. */
9
+ export declare const artifactsLaunchPart: LaunchPartDefinition;
10
+ /** The long-command part. Moves into the bundled jobs feature in hearsay-tools/squawk#4314. */
11
+ export declare const jobsLaunchPart: LaunchPartDefinition;
12
+ export declare const BUILT_IN_LAUNCH_PARTS: readonly LaunchPartDefinition[];
13
+ /** Register the built-in launch parts. A second call registers the same objects, which the registry ignores. */
14
+ export declare function registerBuiltInLaunchParts(): void;
15
+ /** Seal after every built-in and extension registration at the boot boundary. */
16
+ export declare function sealBuiltInLaunchParts(): void;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The launch parts that ship with Squawk (spec 2026-11-26-launch-slot-and-bundled-jobs § 2).
3
+ * Each feature adds its system-prompt part, and artifacts its env, through the public launch
4
+ * slot. Their orders keep the default system prompt byte for byte.
5
+ */
6
+ import { artifactInstructions, provisionArtifactDirectory } from './artifacts/lifecycle.js';
7
+ import { automationsEnabled } from './automations/enabled.js';
8
+ import { automationCliCommand, automationsPrompt } from './automations/prompts.js';
9
+ import { productEnvEntries } from './core/product-env.js';
10
+ import { registerLaunchPart, sealLaunchParts } from './core/launch-registry.js';
11
+ import { jobInstructions } from './jobs/command.js';
12
+ import { agentWebhooksPrompt, webhookCliCommand } from './webhooks/prompt.js';
13
+ import { registryEntry } from './workspace/registry-entry.js';
14
+ import { agentWebhooks } from './workspace/webhooks.js';
15
+ /** Automations on AND a cockpit attached: the automations part of every session's system prompt. */
16
+ export const automationsLaunchPart = {
17
+ id: 'automations',
18
+ order: 10,
19
+ contribute: ({ cockpit }) => (cockpit && automationsEnabled() ? { prompt: automationsPrompt(automationCliCommand()) } : undefined),
20
+ };
21
+ /** The "Project webhooks" part (#1576): the webhooks this project exposes to agents, read from
22
+ * the registry when a session starts. Needs a cockpit to send through; nothing exposed, or an
23
+ * unreadable registry, adds nothing. */
24
+ export const webhooksLaunchPart = {
25
+ id: 'webhooks',
26
+ order: 20,
27
+ async contribute({ cockpit, repoRoot, home }) {
28
+ if (!cockpit)
29
+ return undefined;
30
+ const entry = await registryEntry(cockpit.projectId, repoRoot, home).catch(() => undefined);
31
+ return { prompt: agentWebhooksPrompt(webhookCliCommand(), agentWebhooks(entry)) };
32
+ },
33
+ };
34
+ /** The run's artifact directory as env, and the artifact contract. */
35
+ export const artifactsLaunchPart = {
36
+ id: 'artifacts',
37
+ order: 30,
38
+ contribute({ dataDir, runId }) {
39
+ const directory = provisionArtifactDirectory(dataDir, runId);
40
+ return { env: productEnvEntries('ARTIFACTS_DIR', directory), prompt: artifactInstructions(directory) };
41
+ },
42
+ };
43
+ /** The long-command part. Moves into the bundled jobs feature in hearsay-tools/squawk#4314. */
44
+ export const jobsLaunchPart = {
45
+ id: 'jobs',
46
+ order: 40,
47
+ contribute: () => ({ prompt: jobInstructions() }),
48
+ };
49
+ export const BUILT_IN_LAUNCH_PARTS = [
50
+ automationsLaunchPart, webhooksLaunchPart, artifactsLaunchPart, jobsLaunchPart,
51
+ ];
52
+ /** Register the built-in launch parts. A second call registers the same objects, which the registry ignores. */
53
+ export function registerBuiltInLaunchParts() {
54
+ for (const part of BUILT_IN_LAUNCH_PARTS)
55
+ registerLaunchPart(part);
56
+ }
57
+ /** Seal after every built-in and extension registration at the boot boundary. */
58
+ export function sealBuiltInLaunchParts() {
59
+ sealLaunchParts();
60
+ }
61
+ //# sourceMappingURL=built-in-launch-parts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in-launch-parts.js","sourceRoot":"","sources":["../src/built-in-launch-parts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAA6B,MAAM,2BAA2B,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B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F,CAAC;AAEF,+FAA+F;AAC/F,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,EAAE;IACT,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAoC;IACpE,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc;CAC/E,CAAC;AAEF,gHAAgH;AAChH,MAAM,UAAU,0BAA0B;IACxC,KAAK,MAAM,IAAI,IAAI,qBAAqB;QAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,sBAAsB;IACpC,eAAe,EAAE,CAAC;AACpB,CAAC"}
@@ -121,9 +121,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
121
121
  } & {
122
122
  "/api/v1/tools/:name": {
123
123
  $post: {
124
- output: never;
124
+ output: {
125
+ code: string;
126
+ message: string;
127
+ };
125
128
  outputFormat: "json";
126
- status: import("hono/utils/http-status").ContentfulStatusCode;
129
+ status: 401;
127
130
  input: {
128
131
  json: unknown;
129
132
  } & {
@@ -146,12 +149,9 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
146
149
  };
147
150
  };
148
151
  } | {
149
- output: {
150
- code: string;
151
- message: string;
152
- };
152
+ output: never;
153
153
  outputFormat: "json";
154
- status: 401;
154
+ status: import("hono/utils/http-status").ContentfulStatusCode;
155
155
  input: {
156
156
  json: unknown;
157
157
  } & {
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The launch slot (spec 2026-11-26-launch-slot-and-bundled-jobs § 1-3). Features and host plugins
3
+ * register launch parts. Each agent launch resolves them once, in ascending `order`, into session
4
+ * env entries and system-prompt parts. Core knows no feature names.
5
+ */
6
+ import type { Home } from '../home/home.ts';
7
+ /** The cockpit a launch can reach, or undefined when no cockpit is attached. */
8
+ export type LaunchCockpitAddress = {
9
+ readonly origin: string;
10
+ readonly projectId: string;
11
+ } | undefined;
12
+ /** What a launch part reads. `env` holds the profile env and the entries of earlier parts. */
13
+ export interface LaunchPartContext {
14
+ readonly runId: string;
15
+ readonly dataDir: string;
16
+ readonly repoRoot: string;
17
+ readonly home: Home;
18
+ readonly cockpit: LaunchCockpitAddress;
19
+ readonly env: Readonly<Record<string, string>>;
20
+ }
21
+ /** What one launch part adds to a launch. */
22
+ export interface LaunchPartContribution {
23
+ readonly env?: Readonly<Record<string, string>> | undefined;
24
+ readonly prompt?: string | undefined;
25
+ }
26
+ export interface LaunchPartDefinition {
27
+ readonly id: string;
28
+ /** Parts run in ascending order; ties keep registration order. Default 100. */
29
+ readonly order?: number | undefined;
30
+ contribute(context: LaunchPartContext): LaunchPartContribution | undefined | Promise<LaunchPartContribution | undefined>;
31
+ }
32
+ /** The merged result of every launch part. */
33
+ export interface ResolvedLaunchParts {
34
+ env: Record<string, string>;
35
+ prompts: string[];
36
+ }
37
+ export declare const DEFAULT_LAUNCH_PART_ORDER = 100;
38
+ /** Throws what `registerLaunchPart` would throw, without writing. */
39
+ export declare function checkLaunchPartRegistration(part: LaunchPartDefinition): void;
40
+ export declare function registerLaunchPart(part: LaunchPartDefinition): void;
41
+ export declare function sealLaunchParts(): void;
42
+ /** Whether the registry is sealed. Never throws. */
43
+ export declare function launchPartsSealed(): boolean;
44
+ /** The registered parts in resolution order. Throws until sealed. */
45
+ export declare function registeredLaunchParts(): LaunchPartDefinition[];
46
+ /**
47
+ * Run every launch part in order. Each part sees the env of the parts before it. A part that
48
+ * throws or rejects is skipped with one warning; the launch goes on without it.
49
+ */
50
+ export declare function resolveLaunchParts(context: LaunchPartContext, warn?: (message: string) => void): Promise<ResolvedLaunchParts>;
@@ -0,0 +1,60 @@
1
+ import { createKeyedRegistry } from './registry.js';
2
+ export const DEFAULT_LAUNCH_PART_ORDER = 100;
3
+ const parts = createKeyedRegistry({
4
+ name: 'Launch parts',
5
+ bootHint: 'register every launch part, then call sealLaunchParts() at the runtime boot boundary (boot.ts), or import a testkit that seals it.',
6
+ });
7
+ function checkShape(part) {
8
+ if (typeof part !== 'object' || part === null)
9
+ throw new Error('Launch parts: a launch part must be an object.');
10
+ if (typeof part.id !== 'string' || part.id.length === 0)
11
+ throw new Error(`Launch parts: invalid id ${JSON.stringify(part.id)}.`);
12
+ if (part.order !== undefined && (typeof part.order !== 'number' || !Number.isFinite(part.order))) {
13
+ throw new Error(`Launch parts: '${part.id}' needs a finite number order.`);
14
+ }
15
+ if (typeof part.contribute !== 'function')
16
+ throw new Error(`Launch parts: '${part.id}' needs a contribute function.`);
17
+ }
18
+ /** Throws what `registerLaunchPart` would throw, without writing. */
19
+ export function checkLaunchPartRegistration(part) {
20
+ checkShape(part);
21
+ parts.check(part.id, part);
22
+ }
23
+ export function registerLaunchPart(part) {
24
+ checkShape(part);
25
+ parts.register(part.id, part);
26
+ }
27
+ export function sealLaunchParts() { parts.seal(); }
28
+ /** Whether the registry is sealed. Never throws. */
29
+ export function launchPartsSealed() { return parts.isSealed(); }
30
+ /** The registered parts in resolution order. Throws until sealed. */
31
+ export function registeredLaunchParts() {
32
+ // Array.prototype.sort is stable, so equal orders keep registration order.
33
+ return parts.values().sort((a, b) => (a.order ?? DEFAULT_LAUNCH_PART_ORDER) - (b.order ?? DEFAULT_LAUNCH_PART_ORDER));
34
+ }
35
+ const defaultWarn = (message) => { console.warn(message); };
36
+ /**
37
+ * Run every launch part in order. Each part sees the env of the parts before it. A part that
38
+ * throws or rejects is skipped with one warning; the launch goes on without it.
39
+ */
40
+ export async function resolveLaunchParts(context, warn = defaultWarn) {
41
+ const ordered = registeredLaunchParts();
42
+ const env = {};
43
+ const prompts = [];
44
+ for (const part of ordered) {
45
+ let contribution;
46
+ try {
47
+ contribution = await part.contribute({ ...context, env: Object.freeze({ ...context.env, ...env }) });
48
+ }
49
+ catch (error) {
50
+ warn(`Launch part '${part.id}' failed and was skipped: ${error instanceof Error ? error.message : String(error)}`);
51
+ continue;
52
+ }
53
+ if (contribution?.env)
54
+ Object.assign(env, contribution.env);
55
+ if (typeof contribution?.prompt === 'string' && contribution.prompt.length > 0)
56
+ prompts.push(contribution.prompt);
57
+ }
58
+ return { env, prompts };
59
+ }
60
+ //# sourceMappingURL=launch-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch-registry.js","sourceRoot":"","sources":["../../src/core/launch-registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAkCpD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,MAAM,KAAK,GAAG,mBAAmB,CAA+B;IAC9D,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,oIAAoI;CAC/I,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,IAA0B;IAC5C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACjH,IAAI,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACjI,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACjG,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,CAAC,EAAE,gCAAgC,CAAC,CAAC;IAC7E,CAAC;IACD,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,CAAC,EAAE,gCAAgC,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GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QACvG,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,gBAAgB,IAAI,CAAC,EAAE,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACnH,SAAS;QACX,CAAC;QACD,IAAI,YAAY,EAAE,GAAG;YAAE,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;QAC5D,IAAI,OAAO,YAAY,EAAE,MAAM,KAAK,QAAQ,IAAI,YAAY,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACpH,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC"}
@@ -2,18 +2,6 @@ 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
3
  "/list": {
4
4
  $get: {
5
- output: {
6
- error: string;
7
- code?: "invalid_input" | undefined;
8
- };
9
- outputFormat: "json";
10
- status: 400;
11
- input: {
12
- query: {
13
- offset?: string | undefined;
14
- };
15
- };
16
- } | {
17
5
  output: {
18
6
  workers: {
19
7
  workerId: string;
@@ -66,6 +54,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
66
54
  offset?: string | undefined;
67
55
  };
68
56
  };
57
+ } | {
58
+ output: {
59
+ error: string;
60
+ code?: "invalid_input" | undefined;
61
+ };
62
+ outputFormat: "json";
63
+ status: 400;
64
+ input: {
65
+ query: {
66
+ offset?: string | undefined;
67
+ };
68
+ };
69
69
  };
70
70
  };
71
71
  } & {
@@ -652,18 +652,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
652
652
  } & {
653
653
  "/:workerId": {
654
654
  $get: {
655
- output: {
656
- error: string;
657
- code?: "invalid_input" | undefined;
658
- };
659
- outputFormat: "json";
660
- status: 400;
661
- input: {
662
- param: {
663
- workerId: string;
664
- };
665
- };
666
- } | {
667
655
  output: {
668
656
  workerId: string;
669
657
  settled: boolean;
@@ -788,11 +776,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
788
776
  workerId: string;
789
777
  };
790
778
  };
791
- };
792
- };
793
- } & {
794
- "/:workerId/collect": {
795
- $post: {
779
+ } | {
796
780
  output: {
797
781
  error: string;
798
782
  code?: "invalid_input" | undefined;
@@ -803,10 +787,12 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
803
787
  param: {
804
788
  workerId: string;
805
789
  };
806
- } & {
807
- json: Record<string, never>;
808
790
  };
809
- } | {
791
+ };
792
+ };
793
+ } & {
794
+ "/:workerId/collect": {
795
+ $post: {
810
796
  output: {
811
797
  workerId: string;
812
798
  parentRunId: string;
@@ -929,11 +915,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
929
915
  } & {
930
916
  json: Record<string, never>;
931
917
  };
932
- };
933
- };
934
- } & {
935
- "/:workerId/steer": {
936
- $post: {
918
+ } | {
937
919
  output: {
938
920
  error: string;
939
921
  code?: "invalid_input" | undefined;
@@ -945,11 +927,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
945
927
  workerId: string;
946
928
  };
947
929
  } & {
948
- json: {
949
- text: string;
950
- };
930
+ json: Record<string, never>;
951
931
  };
952
- } | {
932
+ };
933
+ };
934
+ } & {
935
+ "/:workerId/steer": {
936
+ $post: {
953
937
  output: {
954
938
  workerId: string;
955
939
  state: "delivered" | "queued";
@@ -965,11 +949,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
965
949
  text: string;
966
950
  };
967
951
  };
968
- };
969
- };
970
- } & {
971
- "/:workerId/stop": {
972
- $post: {
952
+ } | {
973
953
  output: {
974
954
  error: string;
975
955
  code?: "invalid_input" | undefined;
@@ -981,9 +961,15 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
981
961
  workerId: string;
982
962
  };
983
963
  } & {
984
- json: Record<string, never>;
964
+ json: {
965
+ text: string;
966
+ };
985
967
  };
986
- } | {
968
+ };
969
+ };
970
+ } & {
971
+ "/:workerId/stop": {
972
+ $post: {
987
973
  output: {
988
974
  workerId: string;
989
975
  state: "stopping" | "terminated";
@@ -997,11 +983,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
997
983
  } & {
998
984
  json: Record<string, never>;
999
985
  };
1000
- };
1001
- };
1002
- } & {
1003
- "/:workerId/destroy": {
1004
- $post: {
986
+ } | {
1005
987
  output: {
1006
988
  error: string;
1007
989
  code?: "invalid_input" | undefined;
@@ -1013,11 +995,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1013
995
  workerId: string;
1014
996
  };
1015
997
  } & {
1016
- json: {
1017
- discardWork?: true | undefined;
1018
- };
998
+ json: Record<string, never>;
1019
999
  };
1020
- } | {
1000
+ };
1001
+ };
1002
+ } & {
1003
+ "/:workerId/destroy": {
1004
+ $post: {
1021
1005
  output: {
1022
1006
  workerId: string;
1023
1007
  state: "complete" | "incomplete";
@@ -1046,6 +1030,22 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1046
1030
  discardWork?: true | undefined;
1047
1031
  };
1048
1032
  };
1033
+ } | {
1034
+ output: {
1035
+ error: string;
1036
+ code?: "invalid_input" | undefined;
1037
+ };
1038
+ outputFormat: "json";
1039
+ status: 400;
1040
+ input: {
1041
+ param: {
1042
+ workerId: string;
1043
+ };
1044
+ } & {
1045
+ json: {
1046
+ discardWork?: true | undefined;
1047
+ };
1048
+ };
1049
1049
  } | {
1050
1050
  output: {
1051
1051
  workerId: string;
@@ -1081,11 +1081,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1081
1081
  "/:workerId/diff": {
1082
1082
  $get: {
1083
1083
  output: {
1084
- error: string;
1085
- code?: "invalid_input" | undefined;
1084
+ workerId: string;
1085
+ baselineSha: string;
1086
+ diff: string;
1087
+ truncated: boolean;
1086
1088
  };
1087
1089
  outputFormat: "json";
1088
- status: 400;
1090
+ status: 200;
1089
1091
  input: {
1090
1092
  param: {
1091
1093
  workerId: string;
@@ -1093,13 +1095,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1093
1095
  };
1094
1096
  } | {
1095
1097
  output: {
1096
- workerId: string;
1097
- baselineSha: string;
1098
- diff: string;
1099
- truncated: boolean;
1098
+ error: string;
1099
+ code?: "invalid_input" | undefined;
1100
1100
  };
1101
1101
  outputFormat: "json";
1102
- status: 200;
1102
+ status: 400;
1103
1103
  input: {
1104
1104
  param: {
1105
1105
  workerId: string;
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { type AgentToolDefinition } from '../ci-wait/tool-registry.ts';
8
8
  import { type CliCommandDefinition } from '../core/cli-registry.ts';
9
+ import { type LaunchPartDefinition } from '../core/launch-registry.ts';
9
10
  import type { RunnerDefinition } from '../core/runner-definition.ts';
10
11
  import type { RunLifecycleHandlers } from '../runs/lifecycle.ts';
11
12
  import { type RunSlots } from '../runs/removal-slots.ts';
@@ -19,6 +20,8 @@ export interface SquawkPluginApi {
19
20
  registerStepKind(step: StepKindDefinition): void;
20
21
  registerCliCommand(command: CliCommandDefinition): void;
21
22
  registerRemovalSlots(slots: Partial<RunSlots>): void;
23
+ /** Add env entries and a system-prompt part to every agent launch. */
24
+ registerLaunchPart(part: LaunchPartDefinition): void;
22
25
  onRunLifecycle(handlers: RunLifecycleHandlers): void;
23
26
  }
24
27
  /** A plugin module's default export. */
@@ -32,6 +35,7 @@ export interface PluginContributions {
32
35
  cliCommands: string[];
33
36
  removalSlots: number;
34
37
  runLifecycleListeners: number;
38
+ launchParts: string[];
35
39
  }
36
40
  /**
37
41
  * Run one plugin's setup and commit what it registered, all or nothing. A setup that throws or
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { checkAgentToolRegistration, registerAgentTool } from '../ci-wait/tool-registry.js';
8
8
  import { checkCliCommandRegistration, registerCliCommand } from '../core/cli-registry.js';
9
+ import { checkLaunchPartRegistration, registerLaunchPart } from '../core/launch-registry.js';
9
10
  import { checkRunnerRegistration, registerRunner } from '../core/runner-registry.js';
10
11
  import { checkRunLifecycleListenerRegistration, registerRunLifecycleListener } from '../runs/lifecycle-registry.js';
11
12
  import { checkRunSlotsRegistration, registerRunSlots } from '../runs/removal-slots.js';
@@ -33,6 +34,9 @@ const stepKinds = {
33
34
  const cliCommands = {
34
35
  name: 'CLI commands', key: value => value.name, check: checkCliCommandRegistration, commit: registerCliCommand,
35
36
  };
37
+ const launchParts = {
38
+ name: 'Launch parts', key: value => value.id, check: checkLaunchPartRegistration, commit: registerLaunchPart,
39
+ };
36
40
  function checkKeyed(table, values) {
37
41
  const staged = new Map();
38
42
  for (const value of values) {
@@ -73,6 +77,7 @@ function checkStaged(staged) {
73
77
  checkStagedRequestKinds(staged.waitKinds);
74
78
  checkKeyed(stepKinds, staged.stepKinds);
75
79
  checkKeyed(cliCommands, staged.cliCommands);
80
+ checkKeyed(launchParts, staged.launchParts);
76
81
  for (const slots of staged.removalSlots)
77
82
  checkSlots(slots);
78
83
  for (const handlers of staged.lifecycle) {
@@ -92,6 +97,8 @@ function commitStaged(staged) {
92
97
  stepKinds.commit(value);
93
98
  for (const value of staged.cliCommands)
94
99
  cliCommands.commit(value);
100
+ for (const value of staged.launchParts)
101
+ launchParts.commit(value);
95
102
  for (const slots of staged.removalSlots)
96
103
  registerRunSlots(slots);
97
104
  for (const handlers of staged.lifecycle)
@@ -110,6 +117,7 @@ function stagingApi(staged, open) {
110
117
  registerStepKind: stage(staged.stepKinds),
111
118
  registerCliCommand: stage(staged.cliCommands),
112
119
  registerRemovalSlots: stage(staged.removalSlots),
120
+ registerLaunchPart: stage(staged.launchParts),
113
121
  onRunLifecycle: stage(staged.lifecycle),
114
122
  };
115
123
  }
@@ -122,6 +130,7 @@ function contributions(staged) {
122
130
  cliCommands: staged.cliCommands.map(value => value.name),
123
131
  removalSlots: staged.removalSlots.length,
124
132
  runLifecycleListeners: staged.lifecycle.length,
133
+ launchParts: staged.launchParts.map(value => value.id),
125
134
  };
126
135
  }
127
136
  /**
@@ -131,7 +140,7 @@ function contributions(staged) {
131
140
  * rethrows that error. The api refuses calls once setup has ended. Returns what it committed.
132
141
  */
133
142
  export async function runPluginSetup(plugin) {
134
- const staged = { runners: [], tools: [], waitKinds: [], stepKinds: [], cliCommands: [], removalSlots: [], lifecycle: [] };
143
+ const staged = { runners: [], tools: [], waitKinds: [], stepKinds: [], cliCommands: [], launchParts: [], removalSlots: [], lifecycle: [] };
135
144
  let open = true;
136
145
  try {
137
146
  await plugin(stagingApi(staged, () => open));