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

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 (44) hide show
  1. package/dist/built-in-tool-definitions.d.ts +4 -0
  2. package/dist/built-in-tool-definitions.js +61 -0
  3. package/dist/built-in-tool-definitions.js.map +1 -0
  4. package/dist/built-in-tools.d.ts +3 -0
  5. package/dist/built-in-tools.js +9 -0
  6. package/dist/built-in-tools.js.map +1 -0
  7. package/dist/ci-wait/client.d.ts +75 -0
  8. package/dist/ci-wait/client.js +44 -13
  9. package/dist/ci-wait/client.js.map +1 -1
  10. package/dist/ci-wait/controller.d.ts +57 -1153
  11. package/dist/ci-wait/controller.js +56 -175
  12. package/dist/ci-wait/controller.js.map +1 -1
  13. package/dist/ci-wait/mcp.d.ts +1 -1
  14. package/dist/ci-wait/mcp.js +7 -5
  15. package/dist/ci-wait/mcp.js.map +1 -1
  16. package/dist/ci-wait/tool-catalog.d.ts +6 -528
  17. package/dist/ci-wait/tool-catalog.js +3 -7
  18. package/dist/ci-wait/tool-catalog.js.map +1 -1
  19. package/dist/ci-wait/tool-names.d.ts +1 -8
  20. package/dist/ci-wait/tool-names.js +8 -16
  21. package/dist/ci-wait/tool-names.js.map +1 -1
  22. package/dist/ci-wait/tool-registry.d.ts +64 -0
  23. package/dist/ci-wait/tool-registry.js +32 -0
  24. package/dist/ci-wait/tool-registry.js.map +1 -0
  25. package/dist/ci-wait/tools.d.ts +452 -8
  26. package/dist/ci-wait/tools.js +40 -28
  27. package/dist/ci-wait/tools.js.map +1 -1
  28. package/dist/contract/agent-tools.d.ts +51 -0
  29. package/dist/contract/index.d.ts +1 -0
  30. package/dist/contract/index.js +21 -0
  31. package/dist/delegation/transport.d.ts +10 -10
  32. package/dist/runs/run-exits.d.ts +336 -336
  33. package/dist/server/live-routes.d.ts +6 -6
  34. package/dist/server/server.d.ts +240 -240
  35. package/dist/server/workspace-live-routes.d.ts +6 -6
  36. package/dist/subcommands.js +3 -0
  37. package/dist/subcommands.js.map +1 -1
  38. package/package.json +4 -4
  39. package/scripts/benchmark-runtime.ts +3 -0
  40. package/scripts/measure-transcript-facts-health.mjs +3 -0
  41. package/scripts/mock-ci-tool.mjs +1 -1
  42. package/scripts/mock-wire-tools.mjs +4 -1
  43. package/scripts/omp-ci-wait.mjs +4 -14
  44. package/scripts/pi-ci-wait.mjs +3 -13
@@ -0,0 +1,64 @@
1
+ import type { z } from 'zod';
2
+ import type { SquawkToolHandlers } from './controller.ts';
3
+ export type JsonObject = {
4
+ type: 'object';
5
+ properties?: Record<string, unknown>;
6
+ [key: string]: unknown;
7
+ };
8
+ export type AgentToolResult = {
9
+ content: Array<{
10
+ type: 'text';
11
+ text: string;
12
+ }>;
13
+ isError?: boolean | undefined;
14
+ details: unknown;
15
+ };
16
+ /** One registration owns metadata, validation, transport policy and session dispatch. */
17
+ export interface AgentToolDefinition {
18
+ name: string;
19
+ description: string | (() => string);
20
+ inputSchema: JsonObject | (() => JsonObject);
21
+ trigger: string;
22
+ label: string;
23
+ enabled?(env: NodeJS.ProcessEnv): boolean;
24
+ envNames?(env: NodeJS.ProcessEnv): string[];
25
+ maxBodyBytes?: number;
26
+ timeoutMs?: number;
27
+ schema: z.ZodType;
28
+ runnerFields?: {
29
+ ids: string[];
30
+ };
31
+ invalid(error: z.ZodError, input: unknown): unknown;
32
+ oversized(): unknown;
33
+ disabled?(): unknown;
34
+ unavailable(error?: unknown, input?: unknown): unknown;
35
+ /** Wait registration receipts survive session revocation after their commit. */
36
+ committedReceipt?: boolean;
37
+ handle(handlers: SquawkToolHandlers, input: unknown, signal: AbortSignal): Promise<unknown>;
38
+ format?(answer: unknown): AgentToolResult;
39
+ invoke(input: unknown): Promise<AgentToolResult>;
40
+ }
41
+ export declare const registerAgentTool: (tool: AgentToolDefinition) => void;
42
+ export declare const sealAgentTools: () => void;
43
+ export declare const agentToolsSealed: () => boolean;
44
+ export declare const registeredAgentTools: () => AgentToolDefinition[];
45
+ export declare const agentTool: (key: string) => AgentToolDefinition | undefined;
46
+ export declare const agentToolNames: () => string[];
47
+ export declare function enabledAgentTools(env?: NodeJS.ProcessEnv): AgentToolDefinition[];
48
+ export declare function agentToolMetadata(tool: AgentToolDefinition): {
49
+ name: string;
50
+ description: string;
51
+ inputSchema: JsonObject;
52
+ trigger: string;
53
+ label: string;
54
+ };
55
+ export declare function agentToolInstructions(tools: Array<{
56
+ name: string;
57
+ trigger: string;
58
+ }>): string;
59
+ /** Adapters receive transport policy with metadata so feature hints stay feature-owned. */
60
+ export declare function agentToolTransport(tool: AgentToolDefinition): {
61
+ timeoutMs: number;
62
+ unavailable: AgentToolResult;
63
+ };
64
+ export declare function formatAgentToolAnswer(tool: AgentToolDefinition, answer: unknown): AgentToolResult;
@@ -0,0 +1,32 @@
1
+ import { createKeyedRegistry } from '../core/registry.js';
2
+ const registry = createKeyedRegistry({
3
+ name: 'Agent tool registry', reservedKeys: ['ci-wait'], bootHint: 'Call registerBuiltInTools(), then sealAgentTools() at boot.',
4
+ });
5
+ export const registerAgentTool = (tool) => registry.register(tool.name, tool);
6
+ export const sealAgentTools = registry.seal;
7
+ export const agentToolsSealed = registry.isSealed;
8
+ export const registeredAgentTools = registry.values;
9
+ export const agentTool = registry.get;
10
+ export const agentToolNames = registry.keys;
11
+ export function enabledAgentTools(env = process.env) {
12
+ return registeredAgentTools().filter(tool => !tool.enabled || tool.enabled(env));
13
+ }
14
+ export function agentToolMetadata(tool) {
15
+ return { name: tool.name, description: typeof tool.description === 'function' ? tool.description() : tool.description,
16
+ inputSchema: typeof tool.inputSchema === 'function' ? tool.inputSchema() : tool.inputSchema,
17
+ trigger: tool.trigger, label: tool.label };
18
+ }
19
+ export function agentToolInstructions(tools) {
20
+ return ['The interface to Squawk, the orchestrator running this session. Load a tool below when its situation comes up.',
21
+ ...tools.map(tool => `- ${tool.name}: ${tool.trigger}`)].join('\n');
22
+ }
23
+ /** Adapters receive transport policy with metadata so feature hints stay feature-owned. */
24
+ export function agentToolTransport(tool) {
25
+ const answer = tool.unavailable();
26
+ return { timeoutMs: tool.timeoutMs ?? 15_000,
27
+ unavailable: formatAgentToolAnswer(tool, answer) };
28
+ }
29
+ export function formatAgentToolAnswer(tool, answer) {
30
+ return tool.format ? tool.format(answer) : { content: [{ type: 'text', text: JSON.stringify(answer) }], details: answer };
31
+ }
32
+ //# sourceMappingURL=tool-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-registry.js","sourceRoot":"","sources":["../../src/ci-wait/tool-registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AA2B1D,MAAM,QAAQ,GAAG,mBAAmB,CAA8B;IAChE,IAAI,EAAE,qBAAqB,EAAE,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,6DAA6D;CAChI,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAyB,EAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACzG,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC;AACpD,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC;AACtC,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC;AAC5C,MAAM,UAAU,iBAAiB,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IACpE,OAAO,oBAAoB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AACnF,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,IAAyB;IACzD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,IAAI,CAAC,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW;QACnH,WAAW,EAAE,OAAO,IAAI,CAAC,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW;QAC3F,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;AAC/C,CAAC;AACD,MAAM,UAAU,qBAAqB,CAAC,KAA+C;IACnF,OAAO,CAAC,gHAAgH;QACtH,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,kBAAkB,CAAC,IAAyB;IAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAClC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,MAAM;QAC1C,WAAW,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC;AACvD,CAAC;AACD,MAAM,UAAU,qBAAqB,CAAC,IAAyB,EAAE,MAAe;IAC9E,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC5H,CAAC"}
@@ -1,19 +1,14 @@
1
+ import { type AgentToolResult } from './tool-registry.ts';
1
2
  import type { SquawkAskAnswer, SquawkWaitAnswer } from '../contract/index.js';
2
3
  export { waitToolDefinition, askToolDefinition, cancelWaitToolDefinition, doneToolDefinition, previewToolDefinition, previewStopToolDefinition, scheduleTaskToolDefinition, automationToolDefinition, scheduledTasksToolDefinition } from './tool-catalog.ts';
3
4
  export { previewToolEnabled, automationsToolEnabled } from './tool-env.ts';
4
5
  export { squawkToolNames, squawkToolEnvNames } from './tool-names.ts';
6
+ import { callSquawkAsk, callSquawkCancelWait, callSquawkDone, callSquawkWait, callPreviewServe, callPreviewStop, callScheduleTask, callAutomation, callScheduledTasks } from './client.ts';
5
7
  /**
6
8
  * The one list of Squawk tools (#781). The MCP adapter lists it, Pi's extension registers it, and
7
9
  * every allow-list or admission site reads its names, so adding a tool is one edit here.
8
10
  */
9
- type ToolResult = {
10
- content: Array<{
11
- type: 'text';
12
- text: string;
13
- }>;
14
- isError?: boolean;
15
- details: unknown;
16
- };
11
+ type ToolResult = AgentToolResult;
17
12
  export type SquawkTool = {
18
13
  definition: {
19
14
  name: string;
@@ -82,6 +77,53 @@ export declare function invokeAskTool(input: unknown): Promise<{
82
77
  })[] | undefined;
83
78
  };
84
79
  }>;
80
+ export declare function formatAskTool(answer: Awaited<ReturnType<typeof callSquawkAsk>>): {
81
+ content: {
82
+ type: 'text';
83
+ text: string;
84
+ }[];
85
+ isError: boolean;
86
+ details: {
87
+ ok: true;
88
+ wait_id: string;
89
+ open_waits: ({
90
+ wait_id: string;
91
+ summary: string;
92
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
93
+ deadline: string;
94
+ } | {
95
+ wait_id: string;
96
+ summary: string;
97
+ kind: "human";
98
+ } | {
99
+ wait_id: string;
100
+ summary: string;
101
+ kind: "plugin";
102
+ pluginKind: string;
103
+ deadline?: string | undefined;
104
+ })[];
105
+ } | {
106
+ ok: false;
107
+ code: "autonomous_run" | "capability_revoked" | "capacity" | "finish_requested" | "generation_mismatch" | "invalid_request" | "manager_disposed" | "persistence" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "supervisor_is_worker" | "unauthorized" | "unavailable" | "worker_execution_stopped" | "worker_wait_pending";
108
+ message: string;
109
+ open_waits?: ({
110
+ wait_id: string;
111
+ summary: string;
112
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
113
+ deadline: string;
114
+ } | {
115
+ wait_id: string;
116
+ summary: string;
117
+ kind: "human";
118
+ } | {
119
+ wait_id: string;
120
+ summary: string;
121
+ kind: "plugin";
122
+ pluginKind: string;
123
+ deadline?: string | undefined;
124
+ })[] | undefined;
125
+ };
126
+ };
85
127
  /** JSON first, then one hint sentence, as `invokePreviewTool` answers. */
86
128
  export declare function waitAnswerHint(answer: SquawkWaitAnswer): string;
87
129
  export declare function invokeWaitTool(input: unknown): Promise<{
@@ -156,6 +198,78 @@ export declare function invokeWaitTool(input: unknown): Promise<{
156
198
  })[] | undefined;
157
199
  };
158
200
  }>;
201
+ export declare function formatWaitTool(answer: Awaited<ReturnType<typeof callSquawkWait>>): {
202
+ content: {
203
+ type: 'text';
204
+ text: string;
205
+ }[];
206
+ isError: boolean;
207
+ details: {
208
+ operation_id?: string | undefined;
209
+ ok: true;
210
+ effect?: "applied" | "unchanged" | undefined;
211
+ deduplicated?: boolean | undefined;
212
+ replayed?: boolean | undefined;
213
+ wait_phase?: "cancelled" | "delivered" | "open" | "resolved" | "unavailable" | undefined;
214
+ wait_id: string;
215
+ kind: string;
216
+ deadline?: string | undefined;
217
+ open_waits: ({
218
+ wait_id: string;
219
+ summary: string;
220
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
221
+ deadline: string;
222
+ } | {
223
+ wait_id: string;
224
+ summary: string;
225
+ kind: "human";
226
+ } | {
227
+ wait_id: string;
228
+ summary: string;
229
+ kind: "plugin";
230
+ pluginKind: string;
231
+ deadline?: string | undefined;
232
+ })[];
233
+ } | {
234
+ operation_id?: string | undefined;
235
+ ok: false;
236
+ effect?: "refused" | "unknown" | undefined;
237
+ retained_wait?: {
238
+ wait_id: string;
239
+ summary: string;
240
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
241
+ deadline: string;
242
+ } | {
243
+ wait_id: string;
244
+ summary: string;
245
+ kind: "human";
246
+ } | {
247
+ wait_id: string;
248
+ summary: string;
249
+ kind: "plugin";
250
+ pluginKind: string;
251
+ deadline?: string | undefined;
252
+ } | undefined;
253
+ code: "authentication" | "capability_revoked" | "capacity" | "command_failed" | "denied_scope" | "duplicate_deadline" | "exit_file_outside" | "finish_requested" | "generation_mismatch" | "gh_missing" | "inaccessible_pr" | "invalid_request" | "malformed_data" | "manager_disposed" | "messaging_off" | "operation_conflict" | "outcome_unknown" | "output_limit" | "persistence" | "process_not_allowed" | "process_not_owned" | "query_timeout" | "registration_aborted" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "timers_disabled" | "turn_changed" | "unauthorized" | "unavailable" | "unsupported_host" | "wait_conflict" | "wake_budget_spent" | "worker_execution_stopped" | "worker_wait_pending";
254
+ message: string;
255
+ open_waits?: ({
256
+ wait_id: string;
257
+ summary: string;
258
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
259
+ deadline: string;
260
+ } | {
261
+ wait_id: string;
262
+ summary: string;
263
+ kind: "human";
264
+ } | {
265
+ wait_id: string;
266
+ summary: string;
267
+ kind: "plugin";
268
+ pluginKind: string;
269
+ deadline?: string | undefined;
270
+ })[] | undefined;
271
+ };
272
+ };
159
273
  export declare function invokeCancelWaitTool(input: unknown): Promise<{
160
274
  content: {
161
275
  type: 'text';
@@ -203,6 +317,53 @@ export declare function invokeCancelWaitTool(input: unknown): Promise<{
203
317
  })[] | undefined;
204
318
  };
205
319
  }>;
320
+ export declare function formatCancelWaitTool(answer: Awaited<ReturnType<typeof callSquawkCancelWait>>): {
321
+ content: {
322
+ type: 'text';
323
+ text: string;
324
+ }[];
325
+ isError: boolean;
326
+ details: {
327
+ cancelled: true;
328
+ wait_id: string;
329
+ open_waits: ({
330
+ wait_id: string;
331
+ summary: string;
332
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
333
+ deadline: string;
334
+ } | {
335
+ wait_id: string;
336
+ summary: string;
337
+ kind: "human";
338
+ } | {
339
+ wait_id: string;
340
+ summary: string;
341
+ kind: "plugin";
342
+ pluginKind: string;
343
+ deadline?: string | undefined;
344
+ })[];
345
+ } | {
346
+ cancelled: false;
347
+ code: "already_resolved" | "human_question" | "invalid_request" | "not_found" | "unavailable";
348
+ message: string;
349
+ open_waits?: ({
350
+ wait_id: string;
351
+ summary: string;
352
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
353
+ deadline: string;
354
+ } | {
355
+ wait_id: string;
356
+ summary: string;
357
+ kind: "human";
358
+ } | {
359
+ wait_id: string;
360
+ summary: string;
361
+ kind: "plugin";
362
+ pluginKind: string;
363
+ deadline?: string | undefined;
364
+ })[] | undefined;
365
+ };
366
+ };
206
367
  export declare function invokeDoneTool(input: unknown): Promise<{
207
368
  content: {
208
369
  type: 'text';
@@ -291,6 +452,94 @@ export declare function invokeDoneTool(input: unknown): Promise<{
291
452
  })[] | undefined;
292
453
  };
293
454
  }>;
455
+ export declare function formatDoneTool(answer: Awaited<ReturnType<typeof callSquawkDone>>): {
456
+ content: {
457
+ type: 'text';
458
+ text: string;
459
+ }[];
460
+ isError: boolean;
461
+ details: {
462
+ ok: true;
463
+ finishes: "at_turn_end";
464
+ open_waits: ({
465
+ wait_id: string;
466
+ summary: string;
467
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
468
+ deadline: string;
469
+ } | {
470
+ wait_id: string;
471
+ summary: string;
472
+ kind: "human";
473
+ } | {
474
+ wait_id: string;
475
+ summary: string;
476
+ kind: "plugin";
477
+ pluginKind: string;
478
+ deadline?: string | undefined;
479
+ })[];
480
+ completes: "task";
481
+ } | {
482
+ ok: true;
483
+ finishes: "at_turn_end";
484
+ open_waits: ({
485
+ wait_id: string;
486
+ summary: string;
487
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
488
+ deadline: string;
489
+ } | {
490
+ wait_id: string;
491
+ summary: string;
492
+ kind: "human";
493
+ } | {
494
+ wait_id: string;
495
+ summary: string;
496
+ kind: "plugin";
497
+ pluginKind: string;
498
+ deadline?: string | undefined;
499
+ })[];
500
+ completes: "step";
501
+ next_step: string;
502
+ } | {
503
+ ok: false;
504
+ code: "capability_revoked" | "finish_requested" | "generation_mismatch" | "human_question_pending" | "input_pending" | "invalid_request" | "manager_disposed" | "not_final_step" | "requests_outstanding" | "requests_unanswered" | "root_finish_pending" | "run_cancelled" | "run_missing" | "run_not_running" | "run_stopping" | "session_closed" | "session_replaced" | "unavailable" | "worker_questions" | "worker_wait_pending" | "workers_outstanding" | "workers_uncollected";
505
+ message: string;
506
+ workers?: {
507
+ worker_id: string;
508
+ reason: "outstanding" | "question" | "uncollected";
509
+ }[] | undefined;
510
+ open_waits?: ({
511
+ wait_id: string;
512
+ summary: string;
513
+ kind: "peer" | "pr" | "process" | "subagent" | "timer" | "worker";
514
+ deadline: string;
515
+ } | {
516
+ wait_id: string;
517
+ summary: string;
518
+ kind: "human";
519
+ } | {
520
+ wait_id: string;
521
+ summary: string;
522
+ kind: "plugin";
523
+ pluginKind: string;
524
+ deadline?: string | undefined;
525
+ })[] | undefined;
526
+ owed?: ({
527
+ kind: "wait_result";
528
+ wait_id: string;
529
+ wait_kind: string;
530
+ } | {
531
+ kind: "queued";
532
+ input_id?: string | undefined;
533
+ source: string;
534
+ } | {
535
+ kind: "in_flight";
536
+ input_id: string;
537
+ } | {
538
+ kind: "unread";
539
+ input_id: string;
540
+ })[] | undefined;
541
+ };
542
+ };
294
543
  /** JSON first, then the hint as a plain sentence: the shape every Squawk tool answers in. */
295
544
  export declare function invokePreviewTool(input: unknown): Promise<{
296
545
  content: {
@@ -305,6 +554,19 @@ export declare function invokePreviewTool(input: unknown): Promise<{
305
554
  hint: string;
306
555
  };
307
556
  }>;
557
+ export declare function formatPreviewTool(result: Awaited<ReturnType<typeof callPreviewServe>>): {
558
+ content: {
559
+ type: 'text';
560
+ text: string;
561
+ }[];
562
+ isError: boolean;
563
+ details: {
564
+ ok: boolean;
565
+ code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
566
+ message: string;
567
+ hint: string;
568
+ };
569
+ };
308
570
  export declare function invokePreviewStopTool(input: unknown): Promise<{
309
571
  content: {
310
572
  type: 'text';
@@ -318,6 +580,20 @@ export declare function invokePreviewStopTool(input: unknown): Promise<{
318
580
  hint: string;
319
581
  };
320
582
  }>;
583
+ export declare function formatPreviewStopTool(result: Awaited<ReturnType<typeof callPreviewStop>>): {
584
+ content: {
585
+ type: 'text';
586
+ text: string;
587
+ }[];
588
+ isError: boolean;
589
+ details: {
590
+ ok: boolean;
591
+ code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
592
+ message: string;
593
+ hint: string;
594
+ };
595
+ };
596
+ export declare const PREVIEW_STOP_TOOL: SquawkTool;
321
597
  export declare function invokeScheduleTaskTool(input: unknown): Promise<{
322
598
  content: {
323
599
  type: 'text';
@@ -342,6 +618,30 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
342
618
  message: string;
343
619
  };
344
620
  }>;
621
+ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof callScheduleTask>>): {
622
+ content: {
623
+ type: 'text';
624
+ text: string;
625
+ }[];
626
+ isError: boolean;
627
+ details: {
628
+ ok: true;
629
+ task: {
630
+ id: string;
631
+ name: string;
632
+ status: "archived" | "failed" | "missed" | "paused" | "waiting";
633
+ due_at: string;
634
+ latest_start_minutes?: number | undefined;
635
+ run_id?: string | undefined;
636
+ url?: string | undefined;
637
+ };
638
+ note: string;
639
+ } | {
640
+ ok: false;
641
+ code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
642
+ message: string;
643
+ };
644
+ };
345
645
  export declare function invokeScheduledTasksTool(input: unknown): Promise<{
346
646
  content: {
347
647
  type: 'text';
@@ -376,6 +676,40 @@ export declare function invokeScheduledTasksTool(input: unknown): Promise<{
376
676
  };
377
677
  };
378
678
  }>;
679
+ export declare function formatScheduledTasksTool(answer: Awaited<ReturnType<typeof callScheduledTasks>>): {
680
+ content: {
681
+ type: 'text';
682
+ text: string;
683
+ }[];
684
+ isError: boolean;
685
+ details: {
686
+ ok: false;
687
+ code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
688
+ message: string;
689
+ } | {
690
+ ok: true;
691
+ tasks: {
692
+ id: string;
693
+ name: string;
694
+ status: "archived" | "failed" | "missed" | "paused" | "waiting";
695
+ due_at: string;
696
+ latest_start_minutes?: number | undefined;
697
+ run_id?: string | undefined;
698
+ url?: string | undefined;
699
+ }[];
700
+ } | {
701
+ ok: true;
702
+ task: {
703
+ id: string;
704
+ name: string;
705
+ status: "archived" | "failed" | "missed" | "paused" | "waiting";
706
+ due_at: string;
707
+ latest_start_minutes?: number | undefined;
708
+ run_id?: string | undefined;
709
+ url?: string | undefined;
710
+ };
711
+ };
712
+ };
379
713
  export declare function invokeAutomationTool(input: unknown): Promise<{
380
714
  content: {
381
715
  type: 'text';
@@ -478,5 +812,115 @@ export declare function invokeAutomationTool(input: unknown): Promise<{
478
812
  message: string;
479
813
  };
480
814
  }>;
815
+ export declare function formatAutomationTool(answer: Awaited<ReturnType<typeof callAutomation>>): {
816
+ content: {
817
+ type: 'text';
818
+ text: string;
819
+ }[];
820
+ isError: boolean;
821
+ details: {
822
+ ok: true;
823
+ automation: {
824
+ [x: string]: unknown;
825
+ id: string;
826
+ revision: number;
827
+ name: string;
828
+ description?: string | undefined;
829
+ enabled: boolean;
830
+ kind: "github" | "schedule";
831
+ events?: ("issue.labeled" | "issue.opened" | "issue.unlabeled" | "pull_request.opened")[] | undefined;
832
+ intervalSeconds?: number | undefined;
833
+ filters?: {
834
+ [x: string]: unknown;
835
+ includeExisting?: boolean | undefined;
836
+ requireCurrentLabels?: boolean | undefined;
837
+ authors?: string[] | undefined;
838
+ assignees?: string[] | undefined;
839
+ allLabels?: string[] | undefined;
840
+ anyLabels?: string[] | undefined;
841
+ excludeLabels?: string[] | undefined;
842
+ changedLabels?: string[] | undefined;
843
+ lookbackDays: number;
844
+ maxRecords: number;
845
+ } | undefined;
846
+ schedule?: {
847
+ [x: string]: unknown;
848
+ type: "daily" | "hours" | "once" | "weekdays" | "weekly";
849
+ hour?: number | undefined;
850
+ minute?: number | undefined;
851
+ day?: number | undefined;
852
+ every?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | undefined;
853
+ at?: string | undefined;
854
+ timeZone?: string | undefined;
855
+ latestStartMinutes?: number | undefined;
856
+ } | undefined;
857
+ task: {
858
+ [x: string]: unknown;
859
+ archiveWhenDone?: boolean | undefined;
860
+ autoMergePr?: boolean | undefined;
861
+ allowWorkers?: boolean | undefined;
862
+ allowMessaging?: boolean | undefined;
863
+ prompt: string;
864
+ workflow?: string | undefined;
865
+ steps?: {
866
+ id: string;
867
+ name?: string | undefined;
868
+ prompt?: string | undefined;
869
+ skill?: string | undefined;
870
+ model?: string | undefined;
871
+ effort?: string | undefined;
872
+ timeoutMs?: number | undefined;
873
+ runner?: string | undefined;
874
+ agentProfile?: string | undefined;
875
+ allowedTools?: string[] | undefined;
876
+ bashAllowlist?: string[] | undefined;
877
+ kind?: "plugin" | undefined;
878
+ pluginKind?: string | undefined;
879
+ config?: Record<string, unknown> | undefined;
880
+ command?: string | undefined;
881
+ onFail?: {
882
+ retry: string;
883
+ max: number;
884
+ } | undefined;
885
+ }[] | undefined;
886
+ runner?: string | undefined;
887
+ model?: string | undefined;
888
+ effort?: string | undefined;
889
+ variants?: 1 | 2 | 3 | undefined;
890
+ worktree?: boolean | undefined;
891
+ autonomous?: boolean | undefined;
892
+ systemPrompt?: string | undefined;
893
+ };
894
+ archived?: {
895
+ [x: string]: unknown;
896
+ at: string;
897
+ outcome: "cancelled" | "launched";
898
+ runId?: string | undefined;
899
+ receiptId?: string | undefined;
900
+ trigger?: "late" | "manual" | "retry" | "schedule" | undefined;
901
+ } | undefined;
902
+ createdAt: string;
903
+ updatedAt: string;
904
+ };
905
+ url?: string | undefined;
906
+ next_run_at?: string | undefined;
907
+ preview?: {
908
+ matches: number;
909
+ truncated: boolean;
910
+ } | undefined;
911
+ } | {
912
+ ok: false;
913
+ code: "automations_off" | "conflict" | "explicit_required" | "invalid_request" | "not_found" | "preview_required" | "unavailable";
914
+ message: string;
915
+ };
916
+ };
917
+ export declare const AUTOMATION_TOOL: SquawkTool;
918
+ export declare const SCHEDULE_TASK_TOOL: SquawkTool;
919
+ export declare const SCHEDULED_TASKS_TOOL: SquawkTool;
920
+ export declare const WAIT_TOOL: SquawkTool;
921
+ export declare const ASK_TOOL: SquawkTool;
922
+ export declare const CANCEL_WAIT_TOOL: SquawkTool;
923
+ export declare const DONE_TOOL: SquawkTool;
924
+ export declare const PREVIEW_TOOL: SquawkTool;
481
925
  export declare function squawkTools(env?: NodeJS.ProcessEnv): SquawkTool[];
482
926
  export declare function squawkServerInstructions(env?: NodeJS.ProcessEnv): string;