@hearsay-tools/squawk 0.18.0-dev.8050 → 0.18.0-dev.8057

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 (146) hide show
  1. package/dist/automations/agent-tools.d.ts +2 -0
  2. package/dist/automations/agent-tools.js +24 -0
  3. package/dist/automations/agent-tools.js.map +1 -0
  4. package/dist/automations/tool-catalog.d.ts +119 -0
  5. package/dist/automations/tool-catalog.js +48 -0
  6. package/dist/automations/tool-catalog.js.map +1 -0
  7. package/dist/automations/tool-client.d.ts +9 -0
  8. package/dist/automations/tool-client.js +19 -0
  9. package/dist/automations/tool-client.js.map +1 -0
  10. package/dist/automations/tool-env.d.ts +1 -0
  11. package/dist/automations/tool-env.js +3 -0
  12. package/dist/automations/tool-env.js.map +1 -0
  13. package/dist/automations/tool-errors.d.ts +9 -0
  14. package/dist/automations/tool-errors.js +34 -0
  15. package/dist/automations/tool-errors.js.map +1 -0
  16. package/dist/automations/tool-session.d.ts +5 -0
  17. package/dist/automations/tool-session.js +19 -0
  18. package/dist/automations/tool-session.js.map +1 -0
  19. package/dist/automations/tools.d.ts +325 -0
  20. package/dist/automations/tools.js +30 -0
  21. package/dist/automations/tools.js.map +1 -0
  22. package/dist/built-in-tool-definitions.d.ts +0 -2
  23. package/dist/built-in-tool-definitions.js +3 -35
  24. package/dist/built-in-tool-definitions.js.map +1 -1
  25. package/dist/built-in-tools.js +4 -2
  26. package/dist/built-in-tools.js.map +1 -1
  27. package/dist/built-in-wait-kinds.d.ts +3 -0
  28. package/dist/built-in-wait-kinds.js +10 -0
  29. package/dist/built-in-wait-kinds.js.map +1 -0
  30. package/dist/ci-wait/client.d.ts +0 -17
  31. package/dist/ci-wait/client.js +0 -31
  32. package/dist/ci-wait/client.js.map +1 -1
  33. package/dist/ci-wait/controller.js +1 -2
  34. package/dist/ci-wait/controller.js.map +1 -1
  35. package/dist/ci-wait/errors.d.ts +1 -14
  36. package/dist/ci-wait/errors.js +0 -68
  37. package/dist/ci-wait/errors.js.map +1 -1
  38. package/dist/ci-wait/tool-catalog.d.ts +13 -313
  39. package/dist/ci-wait/tool-catalog.js +14 -89
  40. package/dist/ci-wait/tool-catalog.js.map +1 -1
  41. package/dist/ci-wait/tool-definition.d.ts +21 -0
  42. package/dist/ci-wait/tool-definition.js +9 -0
  43. package/dist/ci-wait/tool-definition.js.map +1 -0
  44. package/dist/ci-wait/tool-registry.d.ts +2 -0
  45. package/dist/ci-wait/tool-registry.js.map +1 -1
  46. package/dist/ci-wait/tools.d.ts +2 -381
  47. package/dist/ci-wait/tools.js +3 -46
  48. package/dist/ci-wait/tools.js.map +1 -1
  49. package/dist/delegation/park-notice.js +2 -2
  50. package/dist/delegation/park-notice.js.map +1 -1
  51. package/dist/delegation/routes.d.ts +79 -79
  52. package/dist/delegation/transport.d.ts +12 -12
  53. package/dist/preview/agent-address.js +1 -1
  54. package/dist/preview/agent-address.js.map +1 -1
  55. package/dist/preview/agent-tools.d.ts +2 -0
  56. package/dist/preview/agent-tools.js +18 -0
  57. package/dist/preview/agent-tools.js.map +1 -0
  58. package/dist/preview/registration.js +1 -1
  59. package/dist/preview/registration.js.map +1 -1
  60. package/dist/preview/run-tools.d.ts +1 -0
  61. package/dist/preview/run-tools.js +2 -1
  62. package/dist/preview/run-tools.js.map +1 -1
  63. package/dist/preview/tool-catalog.d.ts +146 -0
  64. package/dist/preview/tool-catalog.js +14 -0
  65. package/dist/preview/tool-catalog.js.map +1 -0
  66. package/dist/preview/tool-client.d.ts +8 -0
  67. package/dist/preview/tool-client.js +16 -0
  68. package/dist/preview/tool-client.js.map +1 -0
  69. package/dist/preview/tool-env.d.ts +2 -0
  70. package/dist/preview/tool-env.js +4 -0
  71. package/dist/preview/tool-env.js.map +1 -0
  72. package/dist/preview/tool-errors.d.ts +7 -0
  73. package/dist/preview/tool-errors.js +36 -0
  74. package/dist/preview/tool-errors.js.map +1 -0
  75. package/dist/preview/tool-session.d.ts +6 -0
  76. package/dist/preview/tool-session.js +9 -0
  77. package/dist/preview/tool-session.js.map +1 -0
  78. package/dist/preview/tools.d.ts +57 -0
  79. package/dist/preview/tools.js +18 -0
  80. package/dist/preview/tools.js.map +1 -0
  81. package/dist/runs/run-archive.d.ts +72 -72
  82. package/dist/serve-command.d.ts +1 -1
  83. package/dist/serve-command.js +1 -1
  84. package/dist/server/live-routes.d.ts +6 -6
  85. package/dist/server/preview-cdp-socket.js +1 -1
  86. package/dist/server/preview-socket.js +1 -1
  87. package/dist/server/reports-api.d.ts +2 -2
  88. package/dist/server/runner-install-routes.d.ts +10 -10
  89. package/dist/server/server.d.ts +64 -64
  90. package/dist/server/workspace-live-routes.d.ts +6 -6
  91. package/dist/subcommands.js +3 -0
  92. package/dist/subcommands.js.map +1 -1
  93. package/dist/workflows/continuation-admission.d.ts +72 -72
  94. package/dist/workflows/run/compose.d.ts +1 -1
  95. package/dist/workflows/run/compose.js +2 -2
  96. package/dist/workflows/run/compose.js.map +1 -1
  97. package/dist/workflows/run/continuation-session.js +2 -2
  98. package/dist/workflows/run/continuation-session.js.map +1 -1
  99. package/dist/workflows/run/done-accepted.js +4 -4
  100. package/dist/workflows/run/done-accepted.js.map +1 -1
  101. package/dist/workflows/run/input-batch.js +2 -2
  102. package/dist/workflows/run/input-batch.js.map +1 -1
  103. package/dist/workflows/run/input-delivery.js +2 -2
  104. package/dist/workflows/run/input-delivery.js.map +1 -1
  105. package/dist/workflows/run/squawk-tools.d.ts +7 -10
  106. package/dist/workflows/run/squawk-tools.js +8 -18
  107. package/dist/workflows/run/squawk-tools.js.map +1 -1
  108. package/dist/workflows/run/step-loop.js +2 -2
  109. package/dist/workflows/run/step-loop.js.map +1 -1
  110. package/dist/workflows/run/subagent-waits.js +2 -2
  111. package/dist/workflows/run/subagent-waits.js.map +1 -1
  112. package/dist/workflows/run/turn-settler.js +2 -2
  113. package/dist/workflows/run/turn-settler.js.map +1 -1
  114. package/dist/workflows/run/wait-engine.d.ts +75 -73
  115. package/dist/workflows/run/wait-engine.js +50 -6
  116. package/dist/workflows/run/wait-engine.js.map +1 -1
  117. package/dist/workflows/run/wait-input-descriptors.d.ts +3 -0
  118. package/dist/workflows/run/wait-input-descriptors.js +30 -0
  119. package/dist/workflows/run/wait-input-descriptors.js.map +1 -0
  120. package/dist/workflows/run/wait-kind-registry.d.ts +73 -0
  121. package/dist/workflows/run/wait-kind-registry.js +35 -0
  122. package/dist/workflows/run/wait-kind-registry.js.map +1 -0
  123. package/dist/workflows/run/wait-kinds.d.ts +1033 -4
  124. package/dist/workflows/run/wait-kinds.js +45 -9
  125. package/dist/workflows/run/wait-kinds.js.map +1 -1
  126. package/dist/workflows/run/wait-registration-tool.js +3 -3
  127. package/dist/workflows/run/wait-registration-tool.js.map +1 -1
  128. package/dist/workflows/run/wait-registration.js +13 -8
  129. package/dist/workflows/run/wait-registration.js.map +1 -1
  130. package/dist/workflows/run/wait-registry.d.ts +5 -1
  131. package/dist/workflows/run/wait-registry.js +42 -2
  132. package/dist/workflows/run/wait-registry.js.map +1 -1
  133. package/dist/workflows/run/wake-admission.js +7 -3
  134. package/dist/workflows/run/wake-admission.js.map +1 -1
  135. package/dist/workflows/run.d.ts +1 -1
  136. package/dist/workflows/run.js.map +1 -1
  137. package/dist/workflows/waits.d.ts +3 -8
  138. package/dist/workflows/waits.js +10 -15
  139. package/dist/workflows/waits.js.map +1 -1
  140. package/package.json +4 -4
  141. package/scripts/benchmark-runtime.ts +3 -0
  142. package/scripts/measure-transcript-facts-health.mjs +3 -0
  143. package/scripts/mock-wire-tools.mjs +3 -0
  144. package/dist/ci-wait/tool-env.d.ts +0 -4
  145. package/dist/ci-wait/tool-env.js +0 -11
  146. package/dist/ci-wait/tool-env.js.map +0 -1
@@ -0,0 +1,146 @@
1
+ import { z } from 'zod';
2
+ export declare const previewToolDefinition: {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
7
+ $id?: string;
8
+ $anchor?: string;
9
+ $ref?: string;
10
+ $dynamicRef?: string;
11
+ $dynamicAnchor?: string;
12
+ $vocabulary?: Record<string, boolean>;
13
+ $comment?: string;
14
+ $defs?: Record<string, z.core.JSONSchema.JSONSchema>;
15
+ additionalItems?: z.core.JSONSchema._JSONSchema;
16
+ unevaluatedItems?: z.core.JSONSchema._JSONSchema;
17
+ prefixItems?: z.core.JSONSchema._JSONSchema[];
18
+ items?: z.core.JSONSchema._JSONSchema | z.core.JSONSchema._JSONSchema[];
19
+ contains?: z.core.JSONSchema._JSONSchema;
20
+ additionalProperties?: z.core.JSONSchema._JSONSchema;
21
+ unevaluatedProperties?: z.core.JSONSchema._JSONSchema;
22
+ properties?: Record<string, z.core.JSONSchema._JSONSchema>;
23
+ patternProperties?: Record<string, z.core.JSONSchema._JSONSchema>;
24
+ dependentSchemas?: Record<string, z.core.JSONSchema._JSONSchema>;
25
+ propertyNames?: z.core.JSONSchema._JSONSchema;
26
+ if?: z.core.JSONSchema._JSONSchema;
27
+ then?: z.core.JSONSchema._JSONSchema;
28
+ else?: z.core.JSONSchema._JSONSchema;
29
+ allOf?: z.core.JSONSchema.JSONSchema[];
30
+ anyOf?: z.core.JSONSchema.JSONSchema[];
31
+ oneOf?: z.core.JSONSchema.JSONSchema[];
32
+ not?: z.core.JSONSchema._JSONSchema;
33
+ multipleOf?: number;
34
+ maximum?: number;
35
+ exclusiveMaximum?: number | boolean;
36
+ minimum?: number;
37
+ exclusiveMinimum?: number | boolean;
38
+ maxLength?: number;
39
+ minLength?: number;
40
+ pattern?: string;
41
+ maxItems?: number;
42
+ minItems?: number;
43
+ uniqueItems?: boolean;
44
+ maxContains?: number;
45
+ minContains?: number;
46
+ maxProperties?: number;
47
+ minProperties?: number;
48
+ required?: string[];
49
+ dependentRequired?: Record<string, string[]>;
50
+ enum?: Array<string | number | boolean | null>;
51
+ const?: string | number | boolean | null;
52
+ id?: string;
53
+ title?: string;
54
+ description?: string;
55
+ default?: unknown;
56
+ deprecated?: boolean;
57
+ readOnly?: boolean;
58
+ writeOnly?: boolean;
59
+ nullable?: boolean;
60
+ examples?: unknown[];
61
+ format?: string;
62
+ contentMediaType?: string;
63
+ contentEncoding?: string;
64
+ contentSchema?: z.core.JSONSchema.JSONSchema;
65
+ _prefault?: unknown;
66
+ "~standard": z.core.ZodStandardSchemaWithJSON<z.ZodObject<{
67
+ command: z.ZodString;
68
+ port: z.ZodNumber;
69
+ cwd: z.ZodOptional<z.ZodString>;
70
+ label: z.ZodOptional<z.ZodString>;
71
+ path: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strip>>;
73
+ type: 'object';
74
+ };
75
+ };
76
+ export declare const previewStopToolDefinition: {
77
+ name: string;
78
+ description: string;
79
+ inputSchema: {
80
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
81
+ $id?: string;
82
+ $anchor?: string;
83
+ $ref?: string;
84
+ $dynamicRef?: string;
85
+ $dynamicAnchor?: string;
86
+ $vocabulary?: Record<string, boolean>;
87
+ $comment?: string;
88
+ $defs?: Record<string, z.core.JSONSchema.JSONSchema>;
89
+ additionalItems?: z.core.JSONSchema._JSONSchema;
90
+ unevaluatedItems?: z.core.JSONSchema._JSONSchema;
91
+ prefixItems?: z.core.JSONSchema._JSONSchema[];
92
+ items?: z.core.JSONSchema._JSONSchema | z.core.JSONSchema._JSONSchema[];
93
+ contains?: z.core.JSONSchema._JSONSchema;
94
+ additionalProperties?: z.core.JSONSchema._JSONSchema;
95
+ unevaluatedProperties?: z.core.JSONSchema._JSONSchema;
96
+ properties?: Record<string, z.core.JSONSchema._JSONSchema>;
97
+ patternProperties?: Record<string, z.core.JSONSchema._JSONSchema>;
98
+ dependentSchemas?: Record<string, z.core.JSONSchema._JSONSchema>;
99
+ propertyNames?: z.core.JSONSchema._JSONSchema;
100
+ if?: z.core.JSONSchema._JSONSchema;
101
+ then?: z.core.JSONSchema._JSONSchema;
102
+ else?: z.core.JSONSchema._JSONSchema;
103
+ allOf?: z.core.JSONSchema.JSONSchema[];
104
+ anyOf?: z.core.JSONSchema.JSONSchema[];
105
+ oneOf?: z.core.JSONSchema.JSONSchema[];
106
+ not?: z.core.JSONSchema._JSONSchema;
107
+ multipleOf?: number;
108
+ maximum?: number;
109
+ exclusiveMaximum?: number | boolean;
110
+ minimum?: number;
111
+ exclusiveMinimum?: number | boolean;
112
+ maxLength?: number;
113
+ minLength?: number;
114
+ pattern?: string;
115
+ maxItems?: number;
116
+ minItems?: number;
117
+ uniqueItems?: boolean;
118
+ maxContains?: number;
119
+ minContains?: number;
120
+ maxProperties?: number;
121
+ minProperties?: number;
122
+ required?: string[];
123
+ dependentRequired?: Record<string, string[]>;
124
+ enum?: Array<string | number | boolean | null>;
125
+ const?: string | number | boolean | null;
126
+ id?: string;
127
+ title?: string;
128
+ description?: string;
129
+ default?: unknown;
130
+ deprecated?: boolean;
131
+ readOnly?: boolean;
132
+ writeOnly?: boolean;
133
+ nullable?: boolean;
134
+ examples?: unknown[];
135
+ format?: string;
136
+ contentMediaType?: string;
137
+ contentEncoding?: string;
138
+ contentSchema?: z.core.JSONSchema.JSONSchema;
139
+ _prefault?: unknown;
140
+ "~standard": z.core.ZodStandardSchemaWithJSON<z.ZodObject<{
141
+ port: z.ZodNumber;
142
+ restart: z.ZodOptional<z.ZodBoolean>;
143
+ }, z.core.$strict>>;
144
+ type: 'object';
145
+ };
146
+ };
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { previewStopRequestSchema, previewServeRequestSchema } from '../contract/index.js';
3
+ export const previewToolDefinition = {
4
+ name: 'cezar_preview_serve',
5
+ description: `Register a web dev server of this task so the user can click through it in the cockpit's live preview. Always pin the port (\`vite --strictPort\`, \`next dev -p\`) so the server comes up on the port you register. Squawk starts the command itself when the user opens the preview; do not wait for the user. ` +
6
+ 'To drive the browser the user sees, connect to `$CEZ_PREVIEW_CDP_URL` when it is set, e.g. `agent-browser --cdp "$CEZ_PREVIEW_CDP_URL" --pin-tab open http://localhost:5173`; the user watches your page live. `agent-browser record` needs ffmpeg on PATH.',
7
+ inputSchema: { ...z.toJSONSchema(previewServeRequestSchema, { io: 'input' }), type: 'object' },
8
+ };
9
+ export const previewStopToolDefinition = {
10
+ name: 'cezar_preview_stop',
11
+ description: `Stop a preview server Squawk started for your own task. Set restart to true to reuse the unchanged command the owner approved, including after a crash. Adopted servers cannot be stopped; changed registrations need the owner to press Run and open again.`,
12
+ inputSchema: { ...z.toJSONSchema(previewStopRequestSchema, { io: 'input' }), type: 'object' },
13
+ };
14
+ //# sourceMappingURL=tool-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-catalog.js","sourceRoot":"","sources":["../../src/preview/tool-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAE3G,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,mTAAmT;QAC9T,6PAA6P;IAC/P,WAAW,EAAE,EAAE,GAAG,CAAC,CAAC,YAAY,CAAC,yBAAyB,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE;CACxG,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,8PAA8P;IAC3Q,WAAW,EAAE,EAAE,GAAG,CAAC,CAAC,YAAY,CAAC,wBAAwB,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE;CACvG,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type PreviewStopResult, type PreviewServeResult } from '../contract/index.js';
2
+ /**
3
+ * hearsay-tools/cezarion#781: posts the arguments unparsed, so the server names the failing field in its hint. Every
4
+ * transport failure, refusal or unreadable answer becomes the typed `unavailable` result; this
5
+ * never throws.
6
+ */
7
+ export declare function callPreviewServe(input: unknown, env?: NodeJS.ProcessEnv): Promise<PreviewServeResult>;
8
+ export declare function callPreviewStop(input: unknown, env?: NodeJS.ProcessEnv): Promise<PreviewStopResult>;
@@ -0,0 +1,16 @@
1
+ import { callTool } from '../ci-wait/client.js';
2
+ import { previewRefusal } from './tool-errors.js';
3
+ import { previewStopResult } from './registration.js';
4
+ import { previewServeResultSchema, previewStopResultSchema } from '../contract/index.js';
5
+ /**
6
+ * hearsay-tools/cezarion#781: posts the arguments unparsed, so the server names the failing field in its hint. Every
7
+ * transport failure, refusal or unreadable answer becomes the typed `unavailable` result; this
8
+ * never throws.
9
+ */
10
+ export function callPreviewServe(input, env = process.env) {
11
+ return callTool(input, env, 'cezar_preview_serve', previewServeResultSchema, previewRefusal('unavailable'));
12
+ }
13
+ export function callPreviewStop(input, env = process.env) {
14
+ return callTool(input, env, 'cezar_preview_stop', previewStopResultSchema, previewStopResult('unavailable'));
15
+ }
16
+ //# sourceMappingURL=tool-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-client.js","sourceRoot":"","sources":["../../src/preview/tool-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAmD,MAAM,sCAAsC,CAAC;AAC1J;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc,EAAE,GAAG,GAAsB,OAAO,CAAC,GAAG;IACnF,OAAO,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;AAC9G,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc,EAAE,GAAG,GAAsB,OAAO,CAAC,GAAG;IAClF,OAAO,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC;AAC/G,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Live preview is enabled only by the exact value `1`. */
2
+ export declare function previewToolEnabled(env?: NodeJS.ProcessEnv): boolean;
@@ -0,0 +1,4 @@
1
+ import { productEnv } from '../core/product-env.js';
2
+ /** Live preview is enabled only by the exact value `1`. */
3
+ export function previewToolEnabled(env = process.env) { return productEnv('PREVIEW', env) === '1'; }
4
+ //# sourceMappingURL=tool-env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-env.js","sourceRoot":"","sources":["../../src/preview/tool-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,2DAA2D;AAC3D,MAAM,UAAU,kBAAkB,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG,IAAa,OAAO,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { PreviewResultCode, PreviewServeResult } from '../contract/index.js';
2
+ import type { z } from 'zod';
3
+ /** The refusals Squawk's tool server answers itself; registration codes come from its owner. */
4
+ export declare function previewRefusal(code: Extract<PreviewResultCode, 'preview_disabled' | 'headless' | 'unavailable'>): PreviewServeResult;
5
+ export declare function previewOversized(): PreviewServeResult;
6
+ /** Names the first failing field and its rule, then a valid example call. */
7
+ export declare function previewInvalidInput(error: z.ZodError, input: unknown): PreviewServeResult;
@@ -0,0 +1,36 @@
1
+ import { productIdentity } from '../home/identity.js';
2
+ const EXAMPLE_CALL = '{ "command": "npm run dev -- --port 5173 --strictPort", "port": 5173 }';
3
+ /** The refusals Squawk's tool server answers itself; registration codes come from its owner. */
4
+ export function previewRefusal(code) {
5
+ switch (code) {
6
+ case 'preview_disabled': return { ok: false, code, message: 'Live preview is not enabled in this cockpit.', hint: 'Do not retry. Tell the user the server command and port so they can open it themselves.' };
7
+ case 'headless': return { ok: false, code, message: `No cockpit is attached to this run (\`${productIdentity().command} run\`).`, hint: 'Do not retry. Report the command and port in your final message.' };
8
+ case 'unavailable': return { ok: false, code, message: `Squawk's tool server did not answer.`, hint: 'Retry once. If it fails again, continue without preview and report the command and port in your message.' };
9
+ }
10
+ }
11
+ const FIELD_RULES = {
12
+ command: 'must be a string of 1 to 1024 characters',
13
+ port: 'must be an integer between 1 and 65535',
14
+ cwd: 'must be a path relative to the worktree root',
15
+ label: 'must be a string of 1 to 48 characters',
16
+ path: 'must be a path starting with "/"',
17
+ };
18
+ export function previewOversized() {
19
+ return { ok: false, code: 'invalid_input', message: 'The arguments exceed 16 KiB.', hint: `Send only the documented fields, e.g. ${EXAMPLE_CALL}, and call again.` };
20
+ }
21
+ /** Names the first failing field and its rule, then a valid example call. */
22
+ export function previewInvalidInput(error, input) {
23
+ const field = error.issues.map(issue => issue.path[0]).find((key) => typeof key === 'string' && key in FIELD_RULES);
24
+ if (!field) {
25
+ return { ok: false, code: 'invalid_input', message: 'The arguments must be a JSON object with `command` and `port`.', hint: `Call again with a JSON object, e.g. ${EXAMPLE_CALL}.` };
26
+ }
27
+ const value = input !== null && typeof input === 'object' ? input[field] : undefined;
28
+ const got = value === undefined ? 'nothing' : JSON.stringify(value).slice(0, 64);
29
+ return {
30
+ ok: false,
31
+ code: 'invalid_input',
32
+ message: `\`${field}\` ${FIELD_RULES[field]} (got ${got}).`,
33
+ hint: `"${field}" ${FIELD_RULES[field]}. A valid call: ${EXAMPLE_CALL}. Fix the field and call again.`,
34
+ };
35
+ }
36
+ //# sourceMappingURL=tool-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-errors.js","sourceRoot":"","sources":["../../src/preview/tool-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,YAAY,GAAG,wEAAwE,CAAC;AAE9F,gGAAgG;AAChG,MAAM,UAAU,cAAc,CAAC,IAAiF;IAC9G,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,kBAAkB,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,8CAA8C,EAAE,IAAI,EAAE,yFAAyF,EAAE,CAAC;QAC9M,KAAK,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,yCAAyC,eAAe,EAAE,CAAC,OAAO,UAAU,EAAE,IAAI,EAAE,kEAAkE,EAAE,CAAC;QAC7M,KAAK,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,sCAAsC,EAAE,IAAI,EAAE,0GAA0G,EAAE,CAAC;IACpN,CAAC;AACH,CAAC;AAED,MAAM,WAAW,GAA2B;IAC1C,OAAO,EAAE,0CAA0C;IACnD,IAAI,EAAE,wCAAwC;IAC9C,GAAG,EAAE,8CAA8C;IACnD,KAAK,EAAE,wCAAwC;IAC/C,IAAI,EAAE,kCAAkC;CACzC,CAAC;AAEF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,8BAA8B,EAAE,IAAI,EAAE,yCAAyC,YAAY,mBAAmB,EAAE,CAAC;AACvK,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,KAAiB,EAAE,KAAc;IACnE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAiB,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,WAAW,CAAC,CAAC;IACnI,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,gEAAgE,EAAE,IAAI,EAAE,uCAAuC,YAAY,GAAG,EAAE,CAAC;IACvL,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAiC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClH,MAAM,GAAG,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjF,OAAO;QACL,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,KAAK,KAAK,MAAM,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI;QAC3D,IAAI,EAAE,IAAI,KAAK,KAAK,WAAW,CAAC,KAAK,CAAC,mBAAmB,YAAY,iCAAiC;KACvG,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { CiToolSession } from '../ci-wait/controller.ts';
2
+ import type { RunStore } from '../runs/store.ts';
3
+ import { type PreviewHostLike } from './registration.ts';
4
+ export declare function decoratePreviewSession(session: CiToolSession, store: RunStore, dataDir: string, runId: string, host: PreviewHostLike | undefined, cockpitOrigin: string | undefined): CiToolSession;
5
+ /** Bind the trusted run identity before the tool accepts model input. */
6
+ export declare function previewSessionHandlers(host: Pick<import('../workflows/run/squawk-tools.ts').ToolHost, 'registerPreviewServer' | 'stopPreviewServer'>, runId: string): Pick<import('../ci-wait/controller.ts').SquawkToolHandlers, 'registerPreview' | 'stopPreview'>;
@@ -0,0 +1,9 @@
1
+ import { previewCdpSession, previewRunContext } from './registration.js';
2
+ export function decoratePreviewSession(session, store, dataDir, runId, host, cockpitOrigin) {
3
+ return previewCdpSession(session, { host, cockpitOrigin, runId, worktree: !!store.getRun(runId)?.worktreePath, context: () => previewRunContext(store, dataDir, runId) });
4
+ }
5
+ /** Bind the trusted run identity before the tool accepts model input. */
6
+ export function previewSessionHandlers(host, runId) {
7
+ return { registerPreview: (request, signal) => host.registerPreviewServer(runId, request, signal), stopPreview: (request, signal) => host.stopPreviewServer(runId, request, signal) };
8
+ }
9
+ //# sourceMappingURL=tool-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-session.js","sourceRoot":"","sources":["../../src/preview/tool-session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAwB,MAAM,mBAAmB,CAAC;AAE/F,MAAM,UAAU,sBAAsB,CAAC,OAAsB,EAAE,KAAe,EAAE,OAAe,EAAE,KAAa,EAAE,IAAiC,EAAE,aAAiC;IAClL,OAAO,iBAAiB,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;AAC5K,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,sBAAsB,CAAC,IAA8G,EAAE,KAAa;IAClK,OAAO,EAAE,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;AACxL,CAAC"}
@@ -0,0 +1,57 @@
1
+ import type { SquawkTool } from '../ci-wait/tools.ts';
2
+ import { callPreviewServe, callPreviewStop } from './tool-client.ts';
3
+ /** JSON first, then the hint as a plain sentence: the shape every Squawk tool answers in. */
4
+ export declare function invokePreviewTool(input: unknown): Promise<{
5
+ content: {
6
+ type: 'text';
7
+ text: string;
8
+ }[];
9
+ isError: boolean;
10
+ details: {
11
+ ok: boolean;
12
+ code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
13
+ message: string;
14
+ hint: string;
15
+ };
16
+ }>;
17
+ export declare function formatPreviewTool(result: Awaited<ReturnType<typeof callPreviewServe>>): {
18
+ content: {
19
+ type: 'text';
20
+ text: string;
21
+ }[];
22
+ isError: boolean;
23
+ details: {
24
+ ok: boolean;
25
+ code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
26
+ message: string;
27
+ hint: string;
28
+ };
29
+ };
30
+ export declare function invokePreviewStopTool(input: unknown): Promise<{
31
+ content: {
32
+ type: 'text';
33
+ text: string;
34
+ }[];
35
+ isError: boolean;
36
+ details: {
37
+ ok: boolean;
38
+ code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
39
+ message: string;
40
+ hint: string;
41
+ };
42
+ }>;
43
+ export declare function formatPreviewStopTool(result: Awaited<ReturnType<typeof callPreviewStop>>): {
44
+ content: {
45
+ type: 'text';
46
+ text: string;
47
+ }[];
48
+ isError: boolean;
49
+ details: {
50
+ ok: boolean;
51
+ code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
52
+ message: string;
53
+ hint: string;
54
+ };
55
+ };
56
+ export declare const PREVIEW_STOP_TOOL: SquawkTool;
57
+ export declare const PREVIEW_TOOL: SquawkTool;
@@ -0,0 +1,18 @@
1
+ import { previewToolDefinition, previewStopToolDefinition } from './tool-catalog.js';
2
+ import { callPreviewServe, callPreviewStop } from './tool-client.js';
3
+ /** JSON first, then the hint as a plain sentence: the shape every Squawk tool answers in. */
4
+ export async function invokePreviewTool(input) {
5
+ return formatPreviewTool(await callPreviewServe(input));
6
+ }
7
+ export function formatPreviewTool(result) {
8
+ return { content: [{ type: 'text', text: `${JSON.stringify(result)}\n${result.hint}` }], isError: !result.ok, details: result };
9
+ }
10
+ export async function invokePreviewStopTool(input) {
11
+ return formatPreviewStopTool(await callPreviewStop(input));
12
+ }
13
+ export function formatPreviewStopTool(result) {
14
+ return { content: [{ type: 'text', text: `${JSON.stringify(result)}\n${result.hint}` }], isError: !result.ok, details: result };
15
+ }
16
+ export const PREVIEW_STOP_TOOL = { definition: previewStopToolDefinition, trigger: `load when your Squawk-started preview server needs stopping or restarting.`, label: 'Stop live preview', invoke: invokePreviewStopTool };
17
+ export const PREVIEW_TOOL = { definition: previewToolDefinition, trigger: 'load when you have started, or are about to start, a web server the user should click through.', label: 'Live preview', invoke: invokePreviewTool };
18
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/preview/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAAc;IACpD,OAAO,iBAAiB,CAAC,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,MAAoD;IACpF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC3I,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,KAAc;IACxD,OAAO,qBAAqB,CAAC,MAAM,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7D,CAAC;AACD,MAAM,UAAU,qBAAqB,CAAC,MAAmD;IACvF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC3I,CAAC;AACD,MAAM,CAAC,MAAM,iBAAiB,GAAe,EAAE,UAAU,EAAE,yBAAyB,EAAE,OAAO,EAAE,4EAA4E,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;AAEzO,MAAM,CAAC,MAAM,YAAY,GAAe,EAAE,UAAU,EAAE,qBAAqB,EAAE,OAAO,EAAE,gGAAgG,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC"}
@@ -228,6 +228,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
228
228
  deadline: string;
229
229
  seconds: number;
230
230
  note?: string | undefined;
231
+ } | {
232
+ id: string;
233
+ source: "agent" | "cezar";
234
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
235
+ registeredAt: string;
236
+ phase: "cancelled" | "delivered" | "open" | "resolved";
237
+ resolvedAt?: string | undefined;
238
+ deliveredAt?: string | undefined;
239
+ cancelledAt?: string | undefined;
240
+ turnId: string;
241
+ kind: "process";
242
+ deadline: string;
243
+ timeoutSeconds: number;
244
+ pid: number;
245
+ startToken?: string | undefined;
246
+ exitFile?: string | undefined;
247
+ note?: string | undefined;
248
+ result?: {
249
+ outcome: "deadline" | "error" | "exit_file" | "exited";
250
+ observedAt: string;
251
+ exitCode?: number | undefined;
252
+ exitFileNote?: "not-an-exit-code" | undefined;
253
+ diagnostic?: string | undefined;
254
+ } | undefined;
231
255
  } | {
232
256
  id: string;
233
257
  source: "agent" | "cezar";
@@ -289,30 +313,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
289
313
  reason: "outcome" | "timeout";
290
314
  } | undefined;
291
315
  wakeInputId?: string | undefined;
292
- } | {
293
- id: string;
294
- source: "agent" | "cezar";
295
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
296
- registeredAt: string;
297
- phase: "cancelled" | "delivered" | "open" | "resolved";
298
- resolvedAt?: string | undefined;
299
- deliveredAt?: string | undefined;
300
- cancelledAt?: string | undefined;
301
- turnId: string;
302
- kind: "process";
303
- deadline: string;
304
- timeoutSeconds: number;
305
- pid: number;
306
- startToken?: string | undefined;
307
- exitFile?: string | undefined;
308
- note?: string | undefined;
309
- result?: {
310
- outcome: "deadline" | "error" | "exit_file" | "exited";
311
- observedAt: string;
312
- exitCode?: number | undefined;
313
- exitFileNote?: "not-an-exit-code" | undefined;
314
- diagnostic?: string | undefined;
315
- } | undefined;
316
316
  } | {
317
317
  id: string;
318
318
  source: "agent" | "cezar";
@@ -440,6 +440,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
440
440
  deadline: string;
441
441
  seconds: number;
442
442
  note?: string | undefined;
443
+ } | {
444
+ id: string;
445
+ source: "agent" | "cezar";
446
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
447
+ registeredAt: string;
448
+ phase: "cancelled" | "delivered" | "open" | "resolved";
449
+ resolvedAt?: string | undefined;
450
+ deliveredAt?: string | undefined;
451
+ cancelledAt?: string | undefined;
452
+ turnId: string;
453
+ kind: "process";
454
+ deadline: string;
455
+ timeoutSeconds: number;
456
+ pid: number;
457
+ startToken?: string | undefined;
458
+ exitFile?: string | undefined;
459
+ note?: string | undefined;
460
+ result?: {
461
+ outcome: "deadline" | "error" | "exit_file" | "exited";
462
+ observedAt: string;
463
+ exitCode?: number | undefined;
464
+ exitFileNote?: "not-an-exit-code" | undefined;
465
+ diagnostic?: string | undefined;
466
+ } | undefined;
443
467
  } | {
444
468
  id: string;
445
469
  source: "agent" | "cezar";
@@ -501,30 +525,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
501
525
  reason: "outcome" | "timeout";
502
526
  } | undefined;
503
527
  wakeInputId?: string | undefined;
504
- } | {
505
- id: string;
506
- source: "agent" | "cezar";
507
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
508
- registeredAt: string;
509
- phase: "cancelled" | "delivered" | "open" | "resolved";
510
- resolvedAt?: string | undefined;
511
- deliveredAt?: string | undefined;
512
- cancelledAt?: string | undefined;
513
- turnId: string;
514
- kind: "process";
515
- deadline: string;
516
- timeoutSeconds: number;
517
- pid: number;
518
- startToken?: string | undefined;
519
- exitFile?: string | undefined;
520
- note?: string | undefined;
521
- result?: {
522
- outcome: "deadline" | "error" | "exit_file" | "exited";
523
- observedAt: string;
524
- exitCode?: number | undefined;
525
- exitFileNote?: "not-an-exit-code" | undefined;
526
- diagnostic?: string | undefined;
527
- } | undefined;
528
528
  } | {
529
529
  id: string;
530
530
  source: "agent" | "cezar";
@@ -651,6 +651,30 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
651
651
  deadline: string;
652
652
  seconds: number;
653
653
  note?: string | undefined;
654
+ } | {
655
+ id: string;
656
+ source: "agent" | "cezar";
657
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
658
+ registeredAt: string;
659
+ phase: "cancelled" | "delivered" | "open" | "resolved";
660
+ resolvedAt?: string | undefined;
661
+ deliveredAt?: string | undefined;
662
+ cancelledAt?: string | undefined;
663
+ turnId: string;
664
+ kind: "process";
665
+ deadline: string;
666
+ timeoutSeconds: number;
667
+ pid: number;
668
+ startToken?: string | undefined;
669
+ exitFile?: string | undefined;
670
+ note?: string | undefined;
671
+ result?: {
672
+ outcome: "deadline" | "error" | "exit_file" | "exited";
673
+ observedAt: string;
674
+ exitCode?: number | undefined;
675
+ exitFileNote?: "not-an-exit-code" | undefined;
676
+ diagnostic?: string | undefined;
677
+ } | undefined;
654
678
  } | {
655
679
  id: string;
656
680
  source: "agent" | "cezar";
@@ -712,30 +736,6 @@ export declare class RunArchiveTopic implements RunArchive, RunCompletionActions
712
736
  reason: "outcome" | "timeout";
713
737
  } | undefined;
714
738
  wakeInputId?: string | undefined;
715
- } | {
716
- id: string;
717
- source: "agent" | "cezar";
718
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
719
- registeredAt: string;
720
- phase: "cancelled" | "delivered" | "open" | "resolved";
721
- resolvedAt?: string | undefined;
722
- deliveredAt?: string | undefined;
723
- cancelledAt?: string | undefined;
724
- turnId: string;
725
- kind: "process";
726
- deadline: string;
727
- timeoutSeconds: number;
728
- pid: number;
729
- startToken?: string | undefined;
730
- exitFile?: string | undefined;
731
- note?: string | undefined;
732
- result?: {
733
- outcome: "deadline" | "error" | "exit_file" | "exited";
734
- observedAt: string;
735
- exitCode?: number | undefined;
736
- exitFileNote?: "not-an-exit-code" | undefined;
737
- diagnostic?: string | undefined;
738
- } | undefined;
739
739
  } | {
740
740
  id: string;
741
741
  source: "agent" | "cezar";
@@ -5,7 +5,7 @@ import { ProviderAuthService } from './core/provider-auth.ts';
5
5
  import { detectEnvironment } from './core/backend-detect.ts';
6
6
  import { getRepoInfo } from './server/git.ts';
7
7
  import { sweepMergedBranches } from './server/repo-branch-sweep.ts';
8
- import { previewToolEnabled } from './ci-wait/tool-env.ts';
8
+ import { previewToolEnabled } from './preview/tool-env.ts';
9
9
  import { PreviewHost } from './preview/host.ts';
10
10
  import { ToolActivityTracker } from './activity/tool-activity.ts';
11
11
  import { TaskWebhooks } from './runs/webhook.ts';
@@ -9,7 +9,7 @@ import { ProviderAuthService } from './core/provider-auth.js';
9
9
  import { detectEnvironment } from './core/backend-detect.js';
10
10
  import { getRepoInfo } from './server/git.js';
11
11
  import { SWEEP_MIN_INTERVAL_MS, sweepMergedBranches } from './server/repo-branch-sweep.js';
12
- import { previewToolEnabled } from './ci-wait/tool-env.js';
12
+ import { previewToolEnabled } from './preview/tool-env.js';
13
13
  import { PreviewHost } from './preview/host.js';
14
14
  import { ToolActivityTracker } from './activity/tool-activity.js';
15
15
  import { TaskWebhooks } from './runs/webhook.js';
@@ -16,6 +16,12 @@ export declare function createLiveRoutes({ resolveProject, serverGeneration, res
16
16
  output: {
17
17
  generation: string;
18
18
  results: ({
19
+ projectId: string;
20
+ runId: string;
21
+ type: "error" | "reset";
22
+ status: 400 | 404 | 409 | 413 | 503;
23
+ error: string;
24
+ } | {
19
25
  projectId: string;
20
26
  runId: string;
21
27
  type: "batch";
@@ -29,12 +35,6 @@ export declare function createLiveRoutes({ resolveProject, serverGeneration, res
29
35
  cursor: string;
30
36
  afterSeq: number;
31
37
  hasMore: boolean;
32
- } | {
33
- projectId: string;
34
- runId: string;
35
- type: "error" | "reset";
36
- status: 400 | 404 | 409 | 413 | 503;
37
- error: string;
38
38
  })[];
39
39
  };
40
40
  outputFormat: "json";
@@ -1,5 +1,5 @@
1
1
  import { WebSocketServer } from 'ws';
2
- import { previewToolEnabled } from '../ci-wait/tool-env.js';
2
+ import { previewToolEnabled } from '../preview/tool-env.js';
3
3
  import { isLoopbackHostHeader } from './capabilities.js';
4
4
  import { keepAlive, reject } from './preview-socket.js';
5
5
  import { matchPath } from './upgrade-router.js';
@@ -1,7 +1,7 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { previewClientMessageSchema } from '../contract/index.js';
3
3
  import { WebSocketServer } from 'ws';
4
- import { previewToolEnabled } from '../ci-wait/tool-env.js';
4
+ import { previewToolEnabled } from '../preview/tool-env.js';
5
5
  import { PROJECT_ID_RE } from '../workspace/config.js';
6
6
  import { matchPath } from './upgrade-router.js';
7
7
  import { withProjectAdmission } from './cockpit-ownership.js';
@@ -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;