@hearsay-tools/squawk 0.18.0-dev.6973 → 0.18.0-dev.6987

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/automations/github-poller.js +1 -5
  2. package/dist/automations/github-poller.js.map +1 -1
  3. package/dist/automations/prompts.js +19 -14
  4. package/dist/automations/prompts.js.map +1 -1
  5. package/dist/automations/scheduler.d.ts +1 -1
  6. package/dist/automations/scheduler.js +3 -1
  7. package/dist/automations/scheduler.js.map +1 -1
  8. package/dist/automations/service.d.ts +1 -1
  9. package/dist/automations/service.js +3 -1
  10. package/dist/automations/service.js.map +1 -1
  11. package/dist/automations/tool-adapter.d.ts +6 -1
  12. package/dist/automations/tool-adapter.js +85 -1
  13. package/dist/automations/tool-adapter.js.map +1 -1
  14. package/dist/automations/tool-github.d.ts +9 -0
  15. package/dist/automations/tool-github.js +9 -0
  16. package/dist/automations/tool-github.js.map +1 -0
  17. package/dist/automations/tool-timeout.d.ts +2 -0
  18. package/dist/automations/tool-timeout.js +22 -0
  19. package/dist/automations/tool-timeout.js.map +1 -0
  20. package/dist/ci-wait/client.d.ts +2 -0
  21. package/dist/ci-wait/client.js +5 -0
  22. package/dist/ci-wait/client.js.map +1 -1
  23. package/dist/ci-wait/controller.d.ts +347 -0
  24. package/dist/ci-wait/controller.js +13 -0
  25. package/dist/ci-wait/controller.js.map +1 -1
  26. package/dist/ci-wait/tool-catalog.d.ts +29 -0
  27. package/dist/ci-wait/tool-catalog.js +16 -1
  28. package/dist/ci-wait/tool-catalog.js.map +1 -1
  29. package/dist/ci-wait/tools.d.ts +100 -1
  30. package/dist/ci-wait/tools.js +10 -4
  31. package/dist/ci-wait/tools.js.map +1 -1
  32. package/dist/contract/automation-tool.d.ts +320 -0
  33. package/dist/contract/index.d.ts +1 -0
  34. package/dist/contract/index.js +31 -7
  35. package/dist/core/github-request-limits.d.ts +9 -0
  36. package/dist/core/github-request-limits.js +13 -0
  37. package/dist/core/github-request-limits.js.map +1 -0
  38. package/dist/delegation/routes.d.ts +4 -4
  39. package/dist/delegation/transport.d.ts +11 -11
  40. package/dist/server/live-routes.d.ts +6 -6
  41. package/dist/server/server.d.ts +246 -246
  42. package/dist/workflows/run/squawk-tools.js +4 -0
  43. package/dist/workflows/run/squawk-tools.js.map +1 -1
  44. package/dist/workflows/run/types.d.ts +2 -0
  45. package/dist/workflows/run.d.ts +2 -2
  46. package/dist/workflows/run.js +2 -2
  47. package/package.json +4 -4
  48. package/scripts/mock-ci-tool.mjs +5 -0
  49. package/scripts/mock-omp-rpc.mjs +1 -1
@@ -588,7 +588,7 @@ function parentFileRefusal(path) {
588
588
  }
589
589
  var workerContextReferenceSchema = z9.discriminatedUnion("kind", [
590
590
  z9.object({ kind: z9.literal("baseline-file"), path: relativeInputPath }).strict(),
591
- z9.object({ kind: z9.literal("parent-attachment"), id: z9.string().min(1).max(255).regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((id) => !id.includes("..")) }).strict(),
591
+ z9.object({ kind: z9.literal("parent-attachment"), id: z9.string().min(1).max(255).regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((id2) => !id2.includes("..")) }).strict(),
592
592
  /** A git-ignored file in the parent's own worktree, relative to its root (`cez worker spawn --attach`, hearsay-tools/cezarion#1149). */
593
593
  z9.object({ kind: z9.literal("parent-file"), path: relativeInputPath }).strict().superRefine(({ path }, ctx) => {
594
594
  const message2 = parentFileRefusal(path);
@@ -2309,15 +2309,15 @@ function withRootLedger(slim, raw) {
2309
2309
  }
2310
2310
  function requestsToPeers(delegation, requestIds) {
2311
2311
  const toPeers = peerRequestIds(delegation);
2312
- return !!requestIds?.some((id) => toPeers.has(id));
2312
+ return !!requestIds?.some((id2) => toPeers.has(id2));
2313
2313
  }
2314
2314
  function workerWaitTargets(wait) {
2315
2315
  if (wait.requestIds) {
2316
2316
  const answered = new Set(wait.requestOutcomes?.map((outcome) => outcome.requestId));
2317
- return wait.requestIds.map((id) => ({ key: `request:${id}`, settled: answered.has(id) }));
2317
+ return wait.requestIds.map((id2) => ({ key: `request:${id2}`, settled: answered.has(id2) }));
2318
2318
  }
2319
2319
  const reported = new Set(wait.outcomes?.map((outcome) => outcome.workerId));
2320
- return (wait.workerIds ?? []).map((id) => ({ key: `worker:${id}`, settled: reported.has(id) }));
2320
+ return (wait.workerIds ?? []).map((id2) => ({ key: `worker:${id2}`, settled: reported.has(id2) }));
2321
2321
  }
2322
2322
  function workersOwed(open) {
2323
2323
  const entries = open.filter((wait) => wait.kind === "worker");
@@ -3185,7 +3185,7 @@ function isUnseen(_run) {
3185
3185
  function workerWaitLabel(role, wait, peers = false) {
3186
3186
  if (wait.requestIds?.length) return role === "worker" ? "waiting on parent reply" : peers ? "waiting on replies" : "waiting on worker replies";
3187
3187
  const reported = new Set(wait.outcomes?.map((outcome) => outcome.workerId));
3188
- const workers = wait.workerIds?.filter((id) => !reported.has(id)).length;
3188
+ const workers = wait.workerIds?.filter((id2) => !reported.has(id2)).length;
3189
3189
  return workers ? `waiting on ${workers} worker${workers === 1 ? "" : "s"}` : "waiting on workers";
3190
3190
  }
3191
3191
  var PRESENTATION_OF_RUNG = {
@@ -4754,9 +4754,9 @@ function matchesRunSearch(run, query, options = {}) {
4754
4754
  if (prose.some((field2) => field2.includes(token))) return true;
4755
4755
  const bare = token.replace(/^#/, "");
4756
4756
  if (/^\d+$/.test(bare)) {
4757
- return references().has(String(Number(bare))) || ids.some((id) => id.startsWith(bare));
4757
+ return references().has(String(Number(bare))) || ids.some((id2) => id2.startsWith(bare));
4758
4758
  }
4759
- return ids.some((id) => id.includes(token)) || links.some((link) => link.includes(token));
4759
+ return ids.some((id2) => id2.includes(token)) || links.some((link) => link.includes(token));
4760
4760
  });
4761
4761
  }
4762
4762
  function sqlPrefilterTokens(query, options = {}) {
@@ -5927,6 +5927,27 @@ var runnerSkillListSchema = z50.object({
5927
5927
  source: z50.enum(["live", "cache", "unavailable"]),
5928
5928
  reason: z50.string().optional()
5929
5929
  });
5930
+
5931
+ // ../contract/src/automation-tool.ts
5932
+ import { z as z51 } from "zod";
5933
+ var repeatingAutomationInputSchema = automationCreateSchema.omit({ enabled: true, enable: true }).refine((value) => value.schedule?.type !== "once", "Use cezar_schedule_task for a one-time schedule.");
5934
+ var id = z51.string().min(1).max(100);
5935
+ var automationToolRequestSchema = z51.discriminatedUnion("action", [
5936
+ z51.object({ action: z51.literal("create"), definition: repeatingAutomationInputSchema }).strict(),
5937
+ z51.object({ action: z51.literal("show"), id }).strict(),
5938
+ z51.object({ action: z51.literal("preview"), id }).strict(),
5939
+ z51.object({ action: z51.literal("enable"), id, explicit: z51.boolean().optional() }).strict()
5940
+ ]);
5941
+ var automationToolAnswerSchema = z51.union([
5942
+ z51.object({
5943
+ ok: z51.literal(true),
5944
+ automation: storedAutomationDefinitionSchema,
5945
+ url: z51.string().optional(),
5946
+ next_run_at: z51.string().optional(),
5947
+ preview: z51.object({ matches: z51.number().int().nonnegative(), truncated: z51.boolean() }).optional()
5948
+ }),
5949
+ z51.object({ ok: z51.literal(false), code: z51.enum([...scheduledTaskRefusalCodeSchema.options, "explicit_required", "preview_required"]), message: z51.string() })
5950
+ ]);
5930
5951
  export {
5931
5952
  ACTIVITY_CHECKS_MAX,
5932
5953
  ACTIVITY_CHECK_NAME_MAX,
@@ -6116,6 +6137,8 @@ export {
6116
6137
  automationRuntimeStateSchema,
6117
6138
  automationScheduleSchema,
6118
6139
  automationTaskSchema,
6140
+ automationToolAnswerSchema,
6141
+ automationToolRequestSchema,
6119
6142
  automationUpdateSchema,
6120
6143
  automationsResponseSchema,
6121
6144
  backendCheckSchema,
@@ -6424,6 +6447,7 @@ export {
6424
6447
  removedRunnerLabel,
6425
6448
  removedRunnerMessage,
6426
6449
  removedRunnerStepAfter,
6450
+ repeatingAutomationInputSchema,
6427
6451
  repoBranchCountsResponseSchema,
6428
6452
  repoBranchEntrySchema,
6429
6453
  repoBranchResponseSchema,
@@ -0,0 +1,9 @@
1
+ export declare const GITHUB_COMMAND_TIMEOUT_MS = 30000;
2
+ /** Provider requests one history check may spend, its search included. */
3
+ export declare const HISTORY_REQUEST_CAP = 10;
4
+ /** The timeline is oldest first, so a live poll reads every page up to this cap. */
5
+ export declare const TIMELINE_PAGE_CAP = 10;
6
+ /** One scan can spend each provider request's full command timeout. */
7
+ export declare const GITHUB_POLL_TIMEOUT_MS: number;
8
+ export declare const AUTOMATION_TOOL_TIMEOUT_MS: number;
9
+ export declare const AUTOMATION_TOOL_CLIENT_TIMEOUT_MS: number;
@@ -0,0 +1,13 @@
1
+ export const GITHUB_COMMAND_TIMEOUT_MS = 30_000;
2
+ /** Provider requests one history check may spend, its search included. */
3
+ export const HISTORY_REQUEST_CAP = 10;
4
+ /** The timeline is oldest first, so a live poll reads every page up to this cap. */
5
+ export const TIMELINE_PAGE_CAP = 10;
6
+ /** One scan can spend each provider request's full command timeout. */
7
+ export const GITHUB_POLL_TIMEOUT_MS = Math.max(HISTORY_REQUEST_CAP, TIMELINE_PAGE_CAP + 1) * GITHUB_COMMAND_TIMEOUT_MS;
8
+ // Two scans cover the canonical-name retry. One command budget covers discovery
9
+ // and queueing; that wait shares the total bound rather than extending it.
10
+ export const AUTOMATION_TOOL_TIMEOUT_MS = 2 * GITHUB_POLL_TIMEOUT_MS + GITHUB_COMMAND_TIMEOUT_MS;
11
+ // Let the server return its timeout diagnostic before the transport gives up.
12
+ export const AUTOMATION_TOOL_CLIENT_TIMEOUT_MS = AUTOMATION_TOOL_TIMEOUT_MS + GITHUB_COMMAND_TIMEOUT_MS;
13
+ //# sourceMappingURL=github-request-limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-request-limits.js","sourceRoot":"","sources":["../../src/core/github-request-limits.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAChD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,oFAAoF;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,uEAAuE;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,iBAAiB,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;AAEvH,gFAAgF;AAChF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAG,sBAAsB,GAAG,yBAAyB,CAAC;AACjG,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iCAAiC,GAAG,0BAA0B,GAAG,yBAAyB,CAAC"}
@@ -221,13 +221,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
221
221
  status: 200;
222
222
  input: {
223
223
  json: {
224
- requestIds: string[];
225
- mode?: "all" | "any" | "one" | undefined;
226
- timeoutSeconds?: number | undefined;
227
- } | {
228
224
  workerIds: string[];
229
225
  timeoutSeconds?: number | undefined;
230
226
  mode?: "all" | "any" | "one" | undefined;
227
+ } | {
228
+ requestIds: string[];
229
+ mode?: "all" | "any" | "one" | undefined;
230
+ timeoutSeconds?: number | undefined;
231
231
  } | {
232
232
  peerIds: string[];
233
233
  timeoutSeconds?: number | undefined;
@@ -57,6 +57,17 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
57
57
  "/discover": {
58
58
  $post: {
59
59
  output: {
60
+ runner: "claude" | "codex" | "omp" | "opencode" | "pi";
61
+ models: {
62
+ id: string;
63
+ label: string;
64
+ description: string;
65
+ effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
66
+ }[];
67
+ source: "cache" | "live" | "unavailable";
68
+ stale: boolean;
69
+ reason?: string | undefined;
70
+ } | {
60
71
  tasks: {
61
72
  id: string;
62
73
  title: string;
@@ -77,17 +88,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
77
88
  authFailureId?: string | undefined;
78
89
  runner: "claude" | "codex" | "omp" | "opencode" | "pi";
79
90
  }[];
80
- } | {
81
- runner: "claude" | "codex" | "omp" | "opencode" | "pi";
82
- models: {
83
- id: string;
84
- label: string;
85
- description: string;
86
- effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
87
- }[];
88
- source: "cache" | "live" | "unavailable";
89
- stale: boolean;
90
- reason?: string | undefined;
91
91
  };
92
92
  outputFormat: "json";
93
93
  status: 200;
@@ -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";