@hearsay-tools/squawk 0.18.0-pr3391.5936 → 0.18.0-pr3392.5937

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 (66) hide show
  1. package/dist/automations/service.d.ts +1 -1
  2. package/dist/automations/service.js +1 -1
  3. package/dist/ci-wait/controller.d.ts +37 -37
  4. package/dist/contract/automation-schedule.d.ts +0 -9
  5. package/dist/contract/automations.d.ts +9 -1
  6. package/dist/contract/index.js +1960 -1956
  7. package/dist/contract/runs.d.ts +21 -1
  8. package/dist/delegation/routes.d.ts +16 -16
  9. package/dist/delegation/service.d.ts +1 -1
  10. package/dist/delegation/service.js +1 -1
  11. package/dist/delegation/transport.d.ts +9 -9
  12. package/dist/discovery/catalog.d.ts +2 -9
  13. package/dist/discovery/catalog.js +1 -18
  14. package/dist/discovery/catalog.js.map +1 -1
  15. package/dist/discovery/choices.d.ts +10 -0
  16. package/dist/discovery/choices.js +19 -0
  17. package/dist/discovery/choices.js.map +1 -0
  18. package/dist/runs/run-exits.d.ts +301 -301
  19. package/dist/server/live-routes.d.ts +6 -6
  20. package/dist/server/server.d.ts +34 -34
  21. package/dist/voice/routes.d.ts +19 -19
  22. package/package.json +4 -4
  23. package/web/dist/assets/{activity-motion-Bqd8S9Xy.js → activity-motion-XsGcc9eM.js} +2 -2
  24. package/web/dist/assets/{activity-route-DQI_8J09.js → activity-route-DIDXHV7J.js} +1 -1
  25. package/web/dist/assets/{agent-accounts-C6eyz75V.js → agent-accounts-CuRvwNoA.js} +1 -1
  26. package/web/dist/assets/{cez-idle-NomdGTfa.js → cez-idle-DtpdVf_5.js} +1 -1
  27. package/web/dist/assets/{commit-diff-panel-C7BUSPzE.js → commit-diff-panel-DtHg36xc.js} +1 -1
  28. package/web/dist/assets/{control-locations-DlrUP5vD.js → control-locations-CljaLD_b.js} +1 -1
  29. package/web/dist/assets/{diff-Bwy0qFul.js → diff-ImdJ4tPA.js} +2 -2
  30. package/web/dist/assets/{diff-view-B9kgeZTm.js → diff-view-BMqNpcSH.js} +1 -1
  31. package/web/dist/assets/{file-preview-DrXgM1-S.js → file-preview-C58stPPw.js} +1 -1
  32. package/web/dist/assets/{git-toolbar-B1gOn_1U.js → git-toolbar-Dzp24LO7.js} +1 -1
  33. package/web/dist/assets/{github-g-ZOTwHQ.js → github-Cn0hlJsH.js} +1 -1
  34. package/web/dist/assets/{github-sidebar-model-BdoLA7qT.js → github-sidebar-model-BSNdxNKJ.js} +1 -1
  35. package/web/dist/assets/{global-activity-route-CZ_xwiz3.js → global-activity-route-D5ke1ZQa.js} +1 -1
  36. package/web/dist/assets/index-lMBPAedr.js +17 -0
  37. package/web/dist/assets/{live-protocol-DBPXI6ks.js → live-protocol-BAiIX_Mf.js} +1 -1
  38. package/web/dist/assets/{live-refetch-pzhdhNS_.js → live-refetch-CstQIN6c.js} +1 -1
  39. package/web/dist/assets/{preview-pane-connected-Cx8q-Yrh.js → preview-pane-connected-Cl-W1pDv.js} +1 -1
  40. package/web/dist/assets/{project-router-BFKfAFvq.js → project-router-Dd63wBeA.js} +1 -1
  41. package/web/dist/assets/project-scope-context-wlB-Y0ii.js +4 -0
  42. package/web/dist/assets/{queries-BtScxiQP.js → queries-BPdWfTBN.js} +1 -1
  43. package/web/dist/assets/{repo-git-DgZuI4FP.js → repo-git-YYivBJ2x.js} +1 -1
  44. package/web/dist/assets/{report-reader-CeBtx_Sf.js → report-reader-gGAlVnKU.js} +1 -1
  45. package/web/dist/assets/reports-B_xpuTvK.js +1 -0
  46. package/web/dist/assets/{run-header-C8Eeonkx.js → run-header-CxRJxVsR.js} +2 -2
  47. package/web/dist/assets/{skills-DDoJCcmD.js → skills-CEFXcZA5.js} +1 -1
  48. package/web/dist/assets/{tab-link-DDpdYMnv.js → tab-link-CDrve3Rf.js} +1 -1
  49. package/web/dist/assets/{task-changes-XAcKfebn.js → task-changes-Bm4gjXBb.js} +1 -1
  50. package/web/dist/assets/{task-commits-D5V0Q0au.js → task-commits-DYHV533w.js} +1 -1
  51. package/web/dist/assets/{task-files-CkPJZE0w.js → task-files-Bqvj0rbX.js} +1 -1
  52. package/web/dist/assets/{task-github-item-CbCOKkvp.js → task-github-item-YkTV2--_.js} +1 -1
  53. package/web/dist/assets/{task-thread-DyR8HsDz.js → task-thread-CempX7k0.js} +5 -5
  54. package/web/dist/assets/{thread-state-BtmIMbkZ.js → thread-state-BpcneWuV.js} +1 -1
  55. package/web/dist/assets/{use-hand-to-agent-state-BUpbMYM9.js → use-hand-to-agent-state-B9qtivFb.js} +1 -1
  56. package/web/dist/assets/{useInfiniteQuery-BmfExLUr.js → useInfiniteQuery-hrWYY8aw.js} +1 -1
  57. package/web/dist/assets/useQuery-BHmKi9_o.js +1 -0
  58. package/web/dist/assets/{workflows-CEFtJj_h.js → workflows-z-CqJ0JW.js} +1 -1
  59. package/web/dist/assets/{ws-CEQH0TUT.js → ws-Cn8d-Fu-.js} +1 -1
  60. package/web/dist/index.html +13 -13
  61. package/web/dist/live-worker.js +1 -1
  62. package/dist/contract/run-status.d.ts +0 -32
  63. package/web/dist/assets/index-75IttVLX.js +0 -17
  64. package/web/dist/assets/project-scope-context-DSkcNKO7.js +0 -4
  65. package/web/dist/assets/reports-CRPxIRMM.js +0 -1
  66. package/web/dist/assets/useQuery-8pHkglP4.js +0 -1
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- export { runStatusSchema, type RunStatus, stepStatusSchema, type StepStatus, stepKindSchema, type StepKind } from './run-status.ts';
3
2
  /**
4
3
  * The RUNS family of `/api/v1` — a task's record, its lifecycle mutations, and the artifacts
5
4
  * (queued prompt stack, commits, git actions) that hang off one run.
@@ -43,6 +42,16 @@ export declare const autoArchiveReceiptSchema: z.ZodObject<{
43
42
  mergedAt: z.ZodString;
44
43
  }, z.core.$strip>>;
45
44
  }, z.core.$strip>;
45
+ export declare const runStatusSchema: z.ZodEnum<{
46
+ cancelled: "cancelled";
47
+ done: "done";
48
+ failed: "failed";
49
+ queued: "queued";
50
+ review: "review";
51
+ running: "running";
52
+ waiting: "waiting";
53
+ }>;
54
+ export type RunStatus = z.infer<typeof runStatusSchema>;
46
55
  /** Durable completion work. The id fences replies from a previous completion or setting. */
47
56
  export declare const completionActionSchema: z.ZodObject<{
48
57
  id: z.ZodString;
@@ -53,6 +62,17 @@ export declare const completionActionSchema: z.ZodObject<{
53
62
  }>;
54
63
  message: z.ZodOptional<z.ZodString>;
55
64
  }, z.core.$strip>;
65
+ export declare const stepStatusSchema: z.ZodEnum<{
66
+ cancelled: "cancelled";
67
+ done: "done";
68
+ failed: "failed";
69
+ pending: "pending";
70
+ review: "review";
71
+ running: "running";
72
+ skipped: "skipped";
73
+ waiting: "waiting";
74
+ }>;
75
+ export type StepStatus = z.infer<typeof stepStatusSchema>;
56
76
  /** Cursor native session transport; legacy ones omit it (ACP). `cursor-acp` is only read (hearsay-tools/cezarion#1267). */
57
77
  export declare const sessionTransportSchema: z.ZodEnum<{
58
78
  "cursor-acp": "cursor-acp";
@@ -82,18 +82,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
82
82
  "/discover": {
83
83
  $post: {
84
84
  output: {
85
- tasks: {
86
- id: string;
87
- title: string;
88
- runner?: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi" | undefined;
89
- status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
90
- attention: "error" | "none" | "permission" | "running" | "unseen" | "waiting";
91
- attentionLabel: string;
92
- accepts: boolean;
93
- reason?: string | undefined;
94
- }[];
95
- nextOffset?: number | undefined;
96
- } | {
97
85
  scope: "host-default-account";
98
86
  runners: {
99
87
  status: "connected" | "disconnected" | "not-installed" | "unknown";
@@ -113,6 +101,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
113
101
  source: "cache" | "live" | "unavailable";
114
102
  stale: boolean;
115
103
  reason?: string | undefined;
104
+ } | {
105
+ tasks: {
106
+ id: string;
107
+ title: string;
108
+ runner?: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi" | undefined;
109
+ status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
110
+ attention: "error" | "none" | "permission" | "running" | "unseen" | "waiting";
111
+ attentionLabel: string;
112
+ accepts: boolean;
113
+ reason?: string | undefined;
114
+ }[];
115
+ nextOffset?: number | undefined;
116
116
  };
117
117
  outputFormat: "json";
118
118
  status: 200;
@@ -221,13 +221,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
221
221
  status: 200;
222
222
  input: {
223
223
  json: {
224
- workerIds: string[];
225
- timeoutSeconds?: number | undefined;
226
- mode?: "all" | "any" | "one" | undefined;
227
- } | {
228
224
  requestIds: string[];
229
225
  mode?: "all" | "any" | "one" | undefined;
230
226
  timeoutSeconds?: number | undefined;
227
+ } | {
228
+ workerIds: string[];
229
+ timeoutSeconds?: number | undefined;
230
+ mode?: "all" | "any" | "one" | undefined;
231
231
  } | {
232
232
  peerIds: string[];
233
233
  timeoutSeconds?: number | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { Home } from '../home/home.ts';
2
- import { type HostDiscovery } from '../discovery/catalog.ts';
2
+ import { type HostDiscovery } from '../discovery/choices.ts';
3
3
  export { rootDelegation } from './conversations.ts';
4
4
  import { type DiscoveryRequest, type DiscoveryResponse } from '../contract/index.js';
5
5
  import { type ConversationSendRequest, type ConversationSendResult, type ConversationInspectRequest, type ConversationInspectResult, type ConversationCancelRequest, type InboxReserveResult, type InboxReceiptRequest, type InboxReceiptResult, type RequestWaitRequest, type RequestOutcome } from '../contract/index.js';
@@ -3,7 +3,7 @@ import { WAIT_KINDS } from '../workflows/run/wait-kinds.js';
3
3
  import { projectPaths } from '../project-paths.js';
4
4
  import { assertReplyDirection, sendRequestContext, sendAdmission, sendMessage, sendInput } from './conversation-send.js';
5
5
  import { discoverTasks } from './task-discovery.js';
6
- import { discoveredRunners, missingModelChoices } from '../discovery/catalog.js';
6
+ import { discoveredRunners, missingModelChoices } from '../discovery/choices.js';
7
7
  import { assertConversationCapacity, assertFamilySender, byCreatedAtAndId, commitAccepted, familyPair, inboxEntryIn, orphanedPeerMessage, peerPair, takesPart, projectConversationEvents, reconcileConversationState, replyOutcomes } from './conversations.js';
8
8
  export { rootDelegation } from './conversations.js';
9
9
  import { collectWorkerEvidence, revalidateRetainedWorkerResult, workerRevision } from './results.js';
@@ -57,15 +57,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
57
57
  "/discover": {
58
58
  $post: {
59
59
  output: {
60
- scope: "host-default-account";
61
- runners: {
62
- status: "connected" | "disconnected" | "not-installed" | "unknown";
63
- enabled?: boolean | undefined;
64
- hint?: string | undefined;
65
- authFailureId?: string | undefined;
66
- runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
67
- }[];
68
- } | {
69
60
  runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
70
61
  models: {
71
62
  id: string;
@@ -88,6 +79,15 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
88
79
  reason?: string | undefined;
89
80
  }[];
90
81
  nextOffset?: number | undefined;
82
+ } | {
83
+ scope: "host-default-account";
84
+ runners: {
85
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
86
+ enabled?: boolean | undefined;
87
+ hint?: string | undefined;
88
+ authFailureId?: string | undefined;
89
+ runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
90
+ }[];
91
91
  };
92
92
  outputFormat: "json";
93
93
  status: 200;
@@ -1,16 +1,9 @@
1
1
  import type { Home } from '../home/home.ts';
2
2
  import { type ProviderAuthService } from '../core/provider-auth.ts';
3
- import { type ModelDiscoveryRunner, type ProviderStatusResponse } from '../contract/index.js';
4
- import type { ModelChoices, DiscoveredRunners } from '../contract/index.js';
5
3
  import { RunnerModelCatalog } from '../core/runner-model-catalog.ts';
6
- export interface HostDiscovery {
7
- models: Pick<RunnerModelCatalog, 'get'>;
8
- providers(): Promise<ProviderStatusResponse>;
9
- }
4
+ import type { HostDiscovery } from './choices.ts';
5
+ export { discoveredRunners, missingModelChoices, type HostDiscovery } from './choices.ts';
10
6
  /** Initialize before recovery or headless execution; the cockpit reuses this same model cache. */
11
7
  export declare function createHostDiscovery(root: string, auth: ProviderAuthService, home: Home): HostDiscovery & {
12
8
  models: RunnerModelCatalog;
13
9
  };
14
- export declare function discoveredRunners(status: ProviderStatusResponse): DiscoveredRunners;
15
- /** A fresh nonempty host catalog can disprove an explicit selection; unavailable data cannot. */
16
- export declare function missingModelChoices(source: HostDiscovery, runner: ModelDiscoveryRunner, model: string, effectiveModel?: string, modelIdentity?: string): Promise<ModelChoices | undefined>;
@@ -2,8 +2,8 @@ import { hostModelCatalogAdapters } from '../core/host-model-catalog.js';
2
2
  import { providerAuthChecksDisabled } from '../core/provider-auth.js';
3
3
  import { applyProviderEnablement } from '../core/provider-availability.js';
4
4
  import { loadWorkspaceConfig } from '../workspace/config.js';
5
- import { MODEL_DISCOVERY_RUNNERS } from '../contract/index.js';
6
5
  import { RunnerModelCatalog } from '../core/runner-model-catalog.js';
6
+ export { discoveredRunners, missingModelChoices } from './choices.js';
7
7
  /** Initialize before recovery or headless execution; the cockpit reuses this same model cache. */
8
8
  export function createHostDiscovery(root, auth, home) {
9
9
  return {
@@ -11,21 +11,4 @@ export function createHostDiscovery(root, auth, home) {
11
11
  providers: async () => applyProviderEnablement(await auth.status(), providerAuthChecksDisabled() ? [] : (await loadWorkspaceConfig(home.workspaceConfig)).disabledProviders),
12
12
  };
13
13
  }
14
- export function discoveredRunners(status) {
15
- return { scope: 'host-default-account', runners: status.providers.map(({ provider, profileId: _profileId, ...row }) => ({ runner: provider, ...row })) };
16
- }
17
- /** A fresh nonempty host catalog can disprove an explicit selection; unavailable data cannot. */
18
- export async function missingModelChoices(source, runner, model, effectiveModel, modelIdentity) {
19
- // Reuse account-aware normalization from execution selection, including custom providers.
20
- // Compare complete IDs only: never strip another runner's provider prefix speculatively.
21
- const ids = new Set([model, effectiveModel, modelIdentity].filter((id) => id !== undefined));
22
- const catalog = await source.models.get(runner);
23
- if (catalog.source === 'unavailable' || catalog.stale || !catalog.models.length || catalog.models.some(row => ids.has(row.id)))
24
- return;
25
- const alternatives = await Promise.all(MODEL_DISCOVERY_RUNNERS.filter(id => id !== runner).map(async (id) => {
26
- const other = await source.models.get(id);
27
- return other.source !== 'unavailable' && !other.stale && other.models.some(row => ids.has(row.id)) ? id : undefined;
28
- }));
29
- return { runner, requestedModel: model, availableModels: catalog.models, otherRunners: alternatives.filter((id) => id !== undefined) };
30
- }
31
14
  //# sourceMappingURL=catalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/discovery/catalog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAA4B,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAA0D,MAAM,wCAAwC,CAAC;AAEzI,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAOrE,kGAAkG;AAClG,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,IAAyB,EAAE,IAAU;IACrF,OAAO;QACL,MAAM,EAAE,IAAI,kBAAkB,CAAC,EAAE,QAAQ,EAAE,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5E,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,uBAAuB,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,mBAAmB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC;KAC7K,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAA8B;IAC9D,OAAO,EAAE,KAAK,EAAE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C;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type ModelDiscoveryRunner, type ProviderStatusResponse } from '../contract/index.js';
2
+ import type { ModelChoices, DiscoveredRunners } from '../contract/index.js';
3
+ import type { RunnerModelCatalog } from '../core/runner-model-catalog.ts';
4
+ export interface HostDiscovery {
5
+ models: Pick<RunnerModelCatalog, 'get'>;
6
+ providers(): Promise<ProviderStatusResponse>;
7
+ }
8
+ export declare function discoveredRunners(status: ProviderStatusResponse): DiscoveredRunners;
9
+ /** A fresh nonempty host catalog can disprove an explicit selection; unavailable data cannot. */
10
+ export declare function missingModelChoices(source: HostDiscovery, runner: ModelDiscoveryRunner, model: string, effectiveModel?: string, modelIdentity?: string): Promise<ModelChoices | undefined>;
@@ -0,0 +1,19 @@
1
+ import { MODEL_DISCOVERY_RUNNERS } from '../contract/index.js';
2
+ export function discoveredRunners(status) {
3
+ return { scope: 'host-default-account', runners: status.providers.map(({ provider, profileId: _profileId, ...row }) => ({ runner: provider, ...row })) };
4
+ }
5
+ /** A fresh nonempty host catalog can disprove an explicit selection; unavailable data cannot. */
6
+ export async function missingModelChoices(source, runner, model, effectiveModel, modelIdentity) {
7
+ // Reuse account-aware normalization from execution selection, including custom providers.
8
+ // Compare complete IDs only: never strip another runner's provider prefix speculatively.
9
+ const ids = new Set([model, effectiveModel, modelIdentity].filter((id) => id !== undefined));
10
+ const catalog = await source.models.get(runner);
11
+ if (catalog.source === 'unavailable' || catalog.stale || !catalog.models.length || catalog.models.some(row => ids.has(row.id)))
12
+ return;
13
+ const alternatives = await Promise.all(MODEL_DISCOVERY_RUNNERS.filter(id => id !== runner).map(async (id) => {
14
+ const other = await source.models.get(id);
15
+ return other.source !== 'unavailable' && !other.stale && other.models.some(row => ids.has(row.id)) ? id : undefined;
16
+ }));
17
+ return { runner, requestedModel: model, availableModels: catalog.models, otherRunners: alternatives.filter((id) => id !== undefined) };
18
+ }
19
+ //# sourceMappingURL=choices.js.map
@@ -0,0 +1 @@
1
+ {"version":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