@hearsay-tools/squawk 0.18.0-dev.5833 → 0.18.0-dev.5845

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 (63) hide show
  1. package/dist/automations/automation-cli.js +5 -0
  2. package/dist/automations/automation-cli.js.map +1 -1
  3. package/dist/automations/github-baseline.js +2 -0
  4. package/dist/automations/github-baseline.js.map +1 -1
  5. package/dist/automations/github-repository.d.ts +22 -0
  6. package/dist/automations/github-repository.js +40 -0
  7. package/dist/automations/github-repository.js.map +1 -0
  8. package/dist/automations/scheduler.d.ts +2 -3
  9. package/dist/automations/scheduler.js +31 -11
  10. package/dist/automations/scheduler.js.map +1 -1
  11. package/dist/automations/service.d.ts +4 -0
  12. package/dist/automations/task-template.js +12 -2
  13. package/dist/automations/task-template.js.map +1 -1
  14. package/dist/ci-wait/controller.d.ts +4 -4
  15. package/dist/ci-wait/tools.d.ts +4 -4
  16. package/dist/contract/automation-storage.d.ts +4 -0
  17. package/dist/contract/automations.d.ts +26 -0
  18. package/dist/contract/index.js +22 -0
  19. package/dist/delegation/routes.d.ts +75 -75
  20. package/dist/delegation/transport.d.ts +9 -9
  21. package/dist/release/stable.d.ts +20 -0
  22. package/dist/release/stable.js +26 -0
  23. package/dist/release/stable.js.map +1 -1
  24. package/dist/server/activity-routes.d.ts +23 -23
  25. package/dist/server/forge/github-cli.d.ts +14 -0
  26. package/dist/server/forge/github-cli.js +25 -0
  27. package/dist/server/forge/github-cli.js.map +1 -0
  28. package/dist/server/forge/github-repo-handle.d.ts +42 -0
  29. package/dist/server/forge/github-repo-handle.js +160 -0
  30. package/dist/server/forge/github-repo-handle.js.map +1 -0
  31. package/dist/server/forge/github.d.ts +11 -17
  32. package/dist/server/forge/github.js +22 -139
  33. package/dist/server/forge/github.js.map +1 -1
  34. package/dist/server/live-routes.d.ts +6 -6
  35. package/dist/server/server.d.ts +3167 -3159
  36. package/dist/server/server.js +7 -11
  37. package/dist/server/server.js.map +1 -1
  38. package/dist/workflows/run/wait-engine.d.ts +72 -72
  39. package/package.json +4 -4
  40. package/web/dist/assets/{activity-motion-2nE59DAT.js → activity-motion-BdGFmrw-.js} +1 -1
  41. package/web/dist/assets/{activity-route-R9lPc2jy.js → activity-route-1OFUVP3A.js} +1 -1
  42. package/web/dist/assets/{commit-diff-panel-BJyNYmCY.js → commit-diff-panel-BiNPMHC6.js} +1 -1
  43. package/web/dist/assets/{diff-D_9MtICR.js → diff-BHwQUS2W.js} +2 -2
  44. package/web/dist/assets/{diff-view-xRPxXHXl.js → diff-view-BBhxSIlf.js} +1 -1
  45. package/web/dist/assets/{git-toolbar-D9taioU5.js → git-toolbar-BnOaO_OH.js} +1 -1
  46. package/web/dist/assets/{github-bv_pBGc5.js → github-CXc8nroh.js} +1 -1
  47. package/web/dist/assets/{global-activity-route-QxTPDyx-.js → global-activity-route-Dt83uvZc.js} +1 -1
  48. package/web/dist/assets/{index-DgU3yYUl.js → index-B5LayM4y.js} +6 -6
  49. package/web/dist/assets/{preview-pane-connected-cD-MTiVN.js → preview-pane-connected-JHeCgq7I.js} +1 -1
  50. package/web/dist/assets/{repo-git-E_4Ighvg.js → repo-git-wEXDON29.js} +1 -1
  51. package/web/dist/assets/{report-reader-XVNQsXB4.js → report-reader-DJ_0htSx.js} +1 -1
  52. package/web/dist/assets/{reports-B_PVTBzP.js → reports-BIXmTBFJ.js} +1 -1
  53. package/web/dist/assets/{run-header-wm0gSs6X.js → run-header-Bgtlx-vc.js} +1 -1
  54. package/web/dist/assets/{skills-D2RLxUIc.js → skills-BJ2nSfyr.js} +1 -1
  55. package/web/dist/assets/{task-changes-DNtkfFzQ.js → task-changes-Dz0udwrE.js} +1 -1
  56. package/web/dist/assets/{task-commits-CivO-OrN.js → task-commits-5uILgm5M.js} +1 -1
  57. package/web/dist/assets/{task-files-dczkxV_G.js → task-files-DGZjTKSS.js} +1 -1
  58. package/web/dist/assets/{task-github-item-DKV4yrcf.js → task-github-item-npfGLu9C.js} +1 -1
  59. package/web/dist/assets/{task-thread-DIaTTGEF.js → task-thread-DnpkXb5P.js} +1 -1
  60. package/web/dist/assets/{thread-state-DIozHuHb.js → thread-state-BfrO2t7g.js} +1 -1
  61. package/web/dist/assets/{use-hand-to-agent-state-D58ayxI4.js → use-hand-to-agent-state-DyVB4IBv.js} +1 -1
  62. package/web/dist/assets/{workflows-YMEsGXeB.js → workflows-ByduCwgu.js} +1 -1
  63. package/web/dist/index.html +1 -1
@@ -783,6 +783,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
783
783
  }[];
784
784
  isError: boolean;
785
785
  details: {
786
+ ok: false;
787
+ code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
788
+ message: string;
789
+ } | {
786
790
  ok: true;
787
791
  task: {
788
792
  id: string;
@@ -794,10 +798,6 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
794
798
  url?: string | undefined;
795
799
  };
796
800
  note: string;
797
- } | {
798
- ok: false;
799
- code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
800
- message: string;
801
801
  };
802
802
  }>;
803
803
  export declare function invokeScheduledTasksTool(input: unknown): Promise<{
@@ -309,6 +309,8 @@ export declare const storedAutomationHistoryScanSchema: z.ZodObject<{
309
309
  }, z.core.$loose>>;
310
310
  }, z.core.$strip>;
311
311
  export declare const storedAutomationRuntimeStateSchema: z.ZodObject<{
312
+ lastError: z.ZodOptional<z.ZodString>;
313
+ lastErrorAt: z.ZodOptional<z.ZodString>;
312
314
  revision: z.ZodOptional<z.ZodNumber>;
313
315
  baselineAt: z.ZodOptional<z.ZodString>;
314
316
  armedAt: z.ZodOptional<z.ZodString>;
@@ -351,6 +353,8 @@ export declare const storedAutomationRuntimeStateSchema: z.ZodObject<{
351
353
  export declare const storedAutomationStateFileSchema: z.ZodObject<{
352
354
  version: z.ZodDefault<z.ZodLiteral<1>>;
353
355
  states: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
356
+ lastError: z.ZodOptional<z.ZodString>;
357
+ lastErrorAt: z.ZodOptional<z.ZodString>;
354
358
  revision: z.ZodOptional<z.ZodNumber>;
355
359
  baselineAt: z.ZodOptional<z.ZodString>;
356
360
  armedAt: z.ZodOptional<z.ZodString>;
@@ -269,7 +269,16 @@ export declare const automationHistoryScanSchema: z.ZodObject<{
269
269
  tieBreaker: z.ZodOptional<z.ZodString>;
270
270
  }, z.core.$strip>>;
271
271
  }, z.core.$strip>;
272
+ /** The longest `lastError` the scheduler stores. */
273
+ export declare const AUTOMATION_LAST_ERROR_MAX = 1000;
274
+ /** `github` kind: the error of the last failed check and when it failed, until a check succeeds. */
275
+ export declare const automationLastErrorShape: {
276
+ lastError: z.ZodOptional<z.ZodString>;
277
+ lastErrorAt: z.ZodOptional<z.ZodString>;
278
+ };
272
279
  export declare const automationRuntimeStateSchema: z.ZodObject<{
280
+ lastError: z.ZodOptional<z.ZodString>;
281
+ lastErrorAt: z.ZodOptional<z.ZodString>;
273
282
  revision: z.ZodOptional<z.ZodNumber>;
274
283
  baselineAt: z.ZodOptional<z.ZodString>;
275
284
  armedAt: z.ZodOptional<z.ZodString>;
@@ -310,6 +319,17 @@ export declare const automationRuntimeStateSchema: z.ZodObject<{
310
319
  }>>;
311
320
  }, z.core.$strip>;
312
321
  export type AutomationRuntimeState = z.infer<typeof automationRuntimeStateSchema>;
322
+ /** Consecutive failed checks after which the cockpit and `hsq automation list` show the error. */
323
+ export declare const AUTOMATION_FAILURE_NOTICE_AFTER = 3;
324
+ export interface AutomationFailureNotice {
325
+ consecutiveFailures: number;
326
+ lastError: string;
327
+ lastErrorAt?: string;
328
+ /** When the scheduler tries again. */
329
+ retryAt?: string;
330
+ }
331
+ /** The failure a GitHub automation shows, or undefined while fewer checks than the threshold failed in a row. */
332
+ export declare function automationFailureNotice(state: AutomationRuntimeState | undefined): AutomationFailureNotice | undefined;
313
333
  /** What one poll decided about one candidate. `baseline` and `preview` are bookkeeping rows: no
314
334
  * task was launched and none was meant to be. */
315
335
  export declare const automationLogResultSchema: z.ZodEnum<{
@@ -490,6 +510,8 @@ export declare const automationListEntrySchema: z.ZodObject<{
490
510
  createdAt: z.ZodString;
491
511
  updatedAt: z.ZodString;
492
512
  state: z.ZodOptional<z.ZodObject<{
513
+ lastError: z.ZodOptional<z.ZodString>;
514
+ lastErrorAt: z.ZodOptional<z.ZodString>;
493
515
  revision: z.ZodOptional<z.ZodNumber>;
494
516
  baselineAt: z.ZodOptional<z.ZodString>;
495
517
  armedAt: z.ZodOptional<z.ZodString>;
@@ -717,6 +739,8 @@ export declare const automationsResponseSchema: z.ZodObject<{
717
739
  createdAt: z.ZodString;
718
740
  updatedAt: z.ZodString;
719
741
  state: z.ZodOptional<z.ZodObject<{
742
+ lastError: z.ZodOptional<z.ZodString>;
743
+ lastErrorAt: z.ZodOptional<z.ZodString>;
720
744
  revision: z.ZodOptional<z.ZodNumber>;
721
745
  baselineAt: z.ZodOptional<z.ZodString>;
722
746
  armedAt: z.ZodOptional<z.ZodString>;
@@ -1167,6 +1191,8 @@ export declare const automationDetailResponseSchema: z.ZodObject<{
1167
1191
  updatedAt: z.ZodString;
1168
1192
  }, z.core.$strip>;
1169
1193
  state: z.ZodOptional<z.ZodObject<{
1194
+ lastError: z.ZodOptional<z.ZodString>;
1195
+ lastErrorAt: z.ZodOptional<z.ZodString>;
1170
1196
  revision: z.ZodOptional<z.ZodNumber>;
1171
1197
  baselineAt: z.ZodOptional<z.ZodString>;
1172
1198
  armedAt: z.ZodOptional<z.ZodString>;
@@ -4280,6 +4280,11 @@ var automationHistoryScanSchema = z28.object({
4280
4280
  event: z28.number().int().min(0).max(1e3),
4281
4281
  cursor: automationCursorSchema.optional()
4282
4282
  });
4283
+ var AUTOMATION_LAST_ERROR_MAX = 1e3;
4284
+ var automationLastErrorShape = {
4285
+ lastError: z28.string().max(AUTOMATION_LAST_ERROR_MAX).optional(),
4286
+ lastErrorAt: z28.string().datetime().optional()
4287
+ };
4283
4288
  var automationRuntimeStateSchema = z28.object({
4284
4289
  /** The definition revision this state belongs to; activation or history-policy changes re-arm. */
4285
4290
  revision: z28.number().optional(),
@@ -4300,9 +4305,21 @@ var automationRuntimeStateSchema = z28.object({
4300
4305
  etags: z28.record(z28.string(), z28.string()).optional(),
4301
4306
  backoffUntil: z28.string().optional(),
4302
4307
  consecutiveFailures: z28.number().optional(),
4308
+ ...automationLastErrorShape,
4303
4309
  /** `once` schedules: why it stopped without a task — its launch failed, or it started past its cutoff. */
4304
4310
  onceOutcome: z28.enum(["failed", "missed"]).optional()
4305
4311
  });
4312
+ var AUTOMATION_FAILURE_NOTICE_AFTER = 3;
4313
+ function automationFailureNotice(state) {
4314
+ const failures = state?.consecutiveFailures ?? 0;
4315
+ if (failures < AUTOMATION_FAILURE_NOTICE_AFTER || !state?.lastError) return void 0;
4316
+ return {
4317
+ consecutiveFailures: failures,
4318
+ lastError: state.lastError,
4319
+ ...state.lastErrorAt ? { lastErrorAt: state.lastErrorAt } : {},
4320
+ ...state.backoffUntil ? { retryAt: state.backoffUntil } : {}
4321
+ };
4322
+ }
4306
4323
  var automationLogResultSchema = z28.enum([
4307
4324
  "launched",
4308
4325
  "no-match",
@@ -5538,6 +5555,7 @@ var storedAutomationRuntimeStateSchema = z39.object({
5538
5555
  etags: z39.record(z39.string(), z39.string()).optional(),
5539
5556
  backoffUntil: z39.string().datetime().optional(),
5540
5557
  consecutiveFailures: z39.number().int().nonnegative().optional(),
5558
+ ...automationLastErrorShape,
5541
5559
  /** once schedule: it stopped without a task — the launch failed, or it started past its cutoff. */
5542
5560
  onceOutcome: z39.enum(["failed", "missed"]).optional()
5543
5561
  }).passthrough();
@@ -5992,6 +6010,8 @@ export {
5992
6010
  ASK_LIMITS,
5993
6011
  ATTENTION_RANK,
5994
6012
  ATTENTION_RUNGS,
6013
+ AUTOMATION_FAILURE_NOTICE_AFTER,
6014
+ AUTOMATION_LAST_ERROR_MAX,
5995
6015
  CI_WAIT_LIMITATION,
5996
6016
  CI_WAIT_RECEIPT_INSTRUCTION,
5997
6017
  CONTROL_LOCATIONS,
@@ -6152,10 +6172,12 @@ export {
6152
6172
  automationDetailResponseSchema,
6153
6173
  automationEditableSchema,
6154
6174
  automationEventSchema,
6175
+ automationFailureNotice,
6155
6176
  automationFiltersSchema,
6156
6177
  automationHistoryScanSchema,
6157
6178
  automationIdOf,
6158
6179
  automationKindSchema,
6180
+ automationLastErrorShape,
6159
6181
  automationListEntrySchema,
6160
6182
  automationListQuerySchema,
6161
6183
  automationLogQuerySchema,
@@ -27,6 +27,18 @@ export declare function delegationFailure(error: unknown): {
27
27
  export declare function createDelegationRoutes(service: DelegationService, credentials: CredentialRegistry): import("hono/hono-base").HonoBase<Env, {
28
28
  "/list": {
29
29
  $get: {
30
+ output: {
31
+ error: string;
32
+ code?: "invalid_input" | undefined;
33
+ };
34
+ outputFormat: "json";
35
+ status: 400;
36
+ input: {
37
+ query: {
38
+ offset?: string | undefined;
39
+ };
40
+ };
41
+ } | {
30
42
  output: {
31
43
  workers: {
32
44
  workerId: string;
@@ -64,33 +76,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
64
76
  offset?: string | undefined;
65
77
  };
66
78
  };
67
- } | {
68
- output: {
69
- error: string;
70
- code?: "invalid_input" | undefined;
71
- };
72
- outputFormat: "json";
73
- status: 400;
74
- input: {
75
- query: {
76
- offset?: string | undefined;
77
- };
78
- };
79
79
  };
80
80
  };
81
81
  } & {
82
82
  "/discover": {
83
83
  $post: {
84
84
  output: {
85
- scope: "host-default-account";
86
- runners: {
87
- status: "connected" | "disconnected" | "not-installed" | "unknown";
88
- enabled?: boolean | undefined;
89
- hint?: string | undefined;
90
- authFailureId?: string | undefined;
91
- runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
92
- }[];
93
- } | {
94
85
  tasks: {
95
86
  id: string;
96
87
  title: string;
@@ -102,6 +93,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
102
93
  reason?: string | undefined;
103
94
  }[];
104
95
  nextOffset?: number | undefined;
96
+ } | {
97
+ scope: "host-default-account";
98
+ runners: {
99
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
100
+ enabled?: boolean | undefined;
101
+ hint?: string | undefined;
102
+ authFailureId?: string | undefined;
103
+ runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
104
+ }[];
105
105
  } | {
106
106
  runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
107
107
  models: {
@@ -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;
@@ -613,6 +613,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
613
613
  } & {
614
614
  "/:workerId": {
615
615
  $get: {
616
+ output: {
617
+ error: string;
618
+ code?: "invalid_input" | undefined;
619
+ };
620
+ outputFormat: "json";
621
+ status: 400;
622
+ input: {
623
+ param: {
624
+ workerId: string;
625
+ };
626
+ };
627
+ } | {
616
628
  output: {
617
629
  workerId: string;
618
630
  parentRunId: string;
@@ -716,7 +728,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
716
728
  workerId: string;
717
729
  };
718
730
  };
719
- } | {
731
+ };
732
+ };
733
+ } & {
734
+ "/:workerId/collect": {
735
+ $post: {
720
736
  output: {
721
737
  error: string;
722
738
  code?: "invalid_input" | undefined;
@@ -727,12 +743,10 @@ export declare function createDelegationRoutes(service: DelegationService, crede
727
743
  param: {
728
744
  workerId: string;
729
745
  };
746
+ } & {
747
+ json: Record<string, never>;
730
748
  };
731
- };
732
- };
733
- } & {
734
- "/:workerId/collect": {
735
- $post: {
749
+ } | {
736
750
  output: {
737
751
  workerId: string;
738
752
  parentRunId: string;
@@ -834,7 +848,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
834
848
  } & {
835
849
  json: Record<string, never>;
836
850
  };
837
- } | {
851
+ };
852
+ };
853
+ } & {
854
+ "/:workerId/steer": {
855
+ $post: {
838
856
  output: {
839
857
  error: string;
840
858
  code?: "invalid_input" | undefined;
@@ -846,13 +864,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
846
864
  workerId: string;
847
865
  };
848
866
  } & {
849
- json: Record<string, never>;
867
+ json: {
868
+ text: string;
869
+ };
850
870
  };
851
- };
852
- };
853
- } & {
854
- "/:workerId/steer": {
855
- $post: {
871
+ } | {
856
872
  output: {
857
873
  workerId: string;
858
874
  state: "delivered" | "queued";
@@ -868,7 +884,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
868
884
  text: string;
869
885
  };
870
886
  };
871
- } | {
887
+ };
888
+ };
889
+ } & {
890
+ "/:workerId/stop": {
891
+ $post: {
872
892
  output: {
873
893
  error: string;
874
894
  code?: "invalid_input" | undefined;
@@ -880,15 +900,9 @@ export declare function createDelegationRoutes(service: DelegationService, crede
880
900
  workerId: string;
881
901
  };
882
902
  } & {
883
- json: {
884
- text: string;
885
- };
903
+ json: Record<string, never>;
886
904
  };
887
- };
888
- };
889
- } & {
890
- "/:workerId/stop": {
891
- $post: {
905
+ } | {
892
906
  output: {
893
907
  workerId: string;
894
908
  state: "stopping" | "terminated";
@@ -902,7 +916,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
902
916
  } & {
903
917
  json: Record<string, never>;
904
918
  };
905
- } | {
919
+ };
920
+ };
921
+ } & {
922
+ "/:workerId/destroy": {
923
+ $post: {
906
924
  output: {
907
925
  error: string;
908
926
  code?: "invalid_input" | undefined;
@@ -916,11 +934,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
916
934
  } & {
917
935
  json: Record<string, never>;
918
936
  };
919
- };
920
- };
921
- } & {
922
- "/:workerId/destroy": {
923
- $post: {
937
+ } | {
924
938
  output: {
925
939
  workerId: string;
926
940
  state: "complete" | "incomplete";
@@ -943,20 +957,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
943
957
  } & {
944
958
  json: Record<string, never>;
945
959
  };
946
- } | {
947
- output: {
948
- error: string;
949
- code?: "invalid_input" | undefined;
950
- };
951
- outputFormat: "json";
952
- status: 400;
953
- input: {
954
- param: {
955
- workerId: string;
956
- };
957
- } & {
958
- json: Record<string, never>;
959
- };
960
960
  } | {
961
961
  output: {
962
962
  workerId: string;
@@ -986,13 +986,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
986
986
  "/:workerId/diff": {
987
987
  $get: {
988
988
  output: {
989
- workerId: string;
990
- baselineSha: string;
991
- diff: string;
992
- truncated: boolean;
989
+ error: string;
990
+ code?: "invalid_input" | undefined;
993
991
  };
994
992
  outputFormat: "json";
995
- status: 200;
993
+ status: 400;
996
994
  input: {
997
995
  param: {
998
996
  workerId: string;
@@ -1000,11 +998,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1000
998
  };
1001
999
  } | {
1002
1000
  output: {
1003
- error: string;
1004
- code?: "invalid_input" | undefined;
1001
+ workerId: string;
1002
+ baselineSha: string;
1003
+ diff: string;
1004
+ truncated: boolean;
1005
1005
  };
1006
1006
  outputFormat: "json";
1007
- status: 400;
1007
+ status: 200;
1008
1008
  input: {
1009
1009
  param: {
1010
1010
  workerId: string;
@@ -57,6 +57,15 @@ 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
+ } | {
60
69
  runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
61
70
  models: {
62
71
  id: string;
@@ -67,15 +76,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
67
76
  source: "cache" | "live" | "unavailable";
68
77
  stale: boolean;
69
78
  reason?: string | undefined;
70
- } | {
71
- scope: "host-default-account";
72
- runners: {
73
- status: "connected" | "disconnected" | "not-installed" | "unknown";
74
- enabled?: boolean | undefined;
75
- hint?: string | undefined;
76
- authFailureId?: string | undefined;
77
- runner: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi";
78
- }[];
79
79
  } | {
80
80
  tasks: {
81
81
  id: string;
@@ -36,3 +36,23 @@ export type { ManifestLike, ReleaseManifests } from './manifests.ts';
36
36
  * from. Everything else — which manifests exist, which sections carry the pin, what the alias
37
37
  * inherits — lives in `manifests.ts` so the two channels cannot drift apart. */
38
38
  export declare function stampStableManifests(manifests: ReleaseManifestSet, version: string): ReleaseManifestSet;
39
+ /** What one publication of the Release workflow writes: the version, its dist-tag, and how
40
+ * the set pins its siblings. */
41
+ export interface ReleaseTarget {
42
+ version: string;
43
+ distTag: string;
44
+ /** A release candidate pins its siblings exactly, so its tests run exactly that build. */
45
+ exactPins: boolean;
46
+ }
47
+ /** Resolve the release target, or explain why it is refused.
48
+ *
49
+ * Without a requested version the bump decides, under `latest`, as before. A requested
50
+ * version is either stable (`x.y.z`, under `latest` or a maintenance line's `latest-x.y`)
51
+ * or a release candidate (`x.y.z-rc.n`, under `next` or `next-x.y`). A candidate can never
52
+ * take `latest`, so an install of `@latest` never resolves to one. */
53
+ export declare function resolveReleaseTarget(bump: ReleaseBump, base: string, requested?: {
54
+ version?: string | undefined;
55
+ distTag?: string | undefined;
56
+ }): ReleaseTarget | {
57
+ error: string;
58
+ };
@@ -52,4 +52,30 @@ export function computeStableVersion(bump, base) {
52
52
  export function stampStableManifests(manifests, version) {
53
53
  return stampManifestSet(manifests, version, (v) => `^${v}`);
54
54
  }
55
+ const STABLE_VERSION = /^\d+\.\d+\.\d+$/;
56
+ const CANDIDATE_VERSION = /^\d+\.\d+\.\d+-rc\.[1-9]\d*$/;
57
+ const STABLE_TAG = /^latest(?:-\d+\.\d+)?$/;
58
+ const CANDIDATE_TAG = /^next(?:-\d+\.\d+)?$/;
59
+ /** Resolve the release target, or explain why it is refused.
60
+ *
61
+ * Without a requested version the bump decides, under `latest`, as before. A requested
62
+ * version is either stable (`x.y.z`, under `latest` or a maintenance line's `latest-x.y`)
63
+ * or a release candidate (`x.y.z-rc.n`, under `next` or `next-x.y`). A candidate can never
64
+ * take `latest`, so an install of `@latest` never resolves to one. */
65
+ export function resolveReleaseTarget(bump, base, requested = {}) {
66
+ const version = requested.version || computeStableVersion(bump, base);
67
+ if (!version)
68
+ return { error: `cannot ${bump}-bump base version "${base}" — a stable release must start from a plain x.y.z.` };
69
+ const candidate = CANDIDATE_VERSION.test(version);
70
+ if (!candidate && !STABLE_VERSION.test(version))
71
+ return { error: `"${version}" is neither x.y.z nor x.y.z-rc.n.` };
72
+ const distTag = requested.distTag || (candidate ? '' : 'latest');
73
+ if (!(candidate ? CANDIDATE_TAG : STABLE_TAG).test(distTag)) {
74
+ return { error: `dist-tag "${distTag}" does not fit ${candidate ? 'a release candidate (next or next-x.y)' : 'a stable version (latest or latest-x.y)'}.` };
75
+ }
76
+ const line = /-(\d+\.\d+)$/.exec(distTag)?.[1];
77
+ if (line && !version.startsWith(`${line}.`))
78
+ return { error: `dist-tag "${distTag}" names another version line than ${version}.` };
79
+ return { version, distTag, exactPins: candidate };
80
+ }
55
81
  //# sourceMappingURL=stable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stable.js","sourceRoot":"","sources":["../../src/release/stable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,gBAAgB,EAA+C,MAAM,gBAAgB,CAAC;AAO/F,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,C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GAAG,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,aAAa,OAAO,qCAAqC,OAAO,GAAG,EAAE,CAAC;IACnI,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AACpD,CAAC"}
@@ -59,6 +59,29 @@ export declare function ciProgressPlugs(demand: ActivityDemand): {
59
59
  export declare function createActivityRoutes(routeDeps: ActivityRouteDeps): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
60
60
  "/workspace/activity": {
61
61
  $get: {
62
+ output: {
63
+ error: string;
64
+ code?: "invalid_input" | undefined;
65
+ };
66
+ outputFormat: "json";
67
+ status: 400;
68
+ input: {
69
+ query: {
70
+ project?: string | undefined;
71
+ };
72
+ };
73
+ } | {
74
+ output: {
75
+ error: string;
76
+ };
77
+ outputFormat: "json";
78
+ status: 404 | 409 | 503;
79
+ input: {
80
+ query: {
81
+ project?: string | undefined;
82
+ };
83
+ };
84
+ } | {
62
85
  output: {
63
86
  generatedAt: string;
64
87
  projects: {
@@ -289,29 +312,6 @@ export declare function createActivityRoutes(routeDeps: ActivityRouteDeps): impo
289
312
  project?: string | undefined;
290
313
  };
291
314
  };
292
- } | {
293
- output: {
294
- error: string;
295
- code?: "invalid_input" | undefined;
296
- };
297
- outputFormat: "json";
298
- status: 400;
299
- input: {
300
- query: {
301
- project?: string | undefined;
302
- };
303
- };
304
- } | {
305
- output: {
306
- error: string;
307
- };
308
- outputFormat: "json";
309
- status: 404 | 409 | 503;
310
- input: {
311
- query: {
312
- project?: string | undefined;
313
- };
314
- };
315
315
  };
316
316
  };
317
317
  }, "/", "/workspace/activity">;
@@ -0,0 +1,14 @@
1
+ export declare function githubContext(repoRoot: string): {
2
+ key: string;
3
+ env: {
4
+ GH_HOST: string | undefined;
5
+ GH_CONFIG_DIR: string | undefined;
6
+ };
7
+ };
8
+ export type GithubContext = ReturnType<typeof githubContext>;
9
+ export declare function gh(repoRoot: string, args: string[], timeout?: number, signal?: AbortSignal, context?: GithubContext): Promise<string>;
10
+ /** `owner/name` → `{ owner, name }`, or null when the handle isn't a clean two-part slug. */
11
+ export declare function parseOwnerName(nameWithOwner: string): {
12
+ owner: string;
13
+ name: string;
14
+ } | null;
@@ -0,0 +1,25 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { promisify } from 'node:util';
3
+ const exec = promisify(execFile);
4
+ // Keep account-directory and host selection attached to shared work. Never key by owner/name:
5
+ // separate local roots (including different remotes/accounts) must not share results.
6
+ export function githubContext(repoRoot) {
7
+ const env = { GH_HOST: process.env.GH_HOST, GH_CONFIG_DIR: process.env.GH_CONFIG_DIR };
8
+ return { key: JSON.stringify([repoRoot, env.GH_HOST, env.GH_CONFIG_DIR]), env };
9
+ }
10
+ export async function gh(repoRoot, args, timeout = 15_000, signal, context) {
11
+ const { stdout } = await exec('gh', args, {
12
+ cwd: repoRoot,
13
+ ...(context ? { env: { ...process.env, ...context.env } } : {}),
14
+ timeout,
15
+ maxBuffer: 50 * 1024 * 1024,
16
+ ...(signal ? { signal } : {}),
17
+ });
18
+ return stdout;
19
+ }
20
+ /** `owner/name` → `{ owner, name }`, or null when the handle isn't a clean two-part slug. */
21
+ export function parseOwnerName(nameWithOwner) {
22
+ const [owner, name, ...rest] = nameWithOwner.trim().split('/');
23
+ return owner && name && rest.length === 0 ? { owner, name } : null;
24
+ }
25
+ //# sourceMappingURL=github-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-cli.js","sourceRoot":"","sources":["../../../src/server/forge/github-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEjC,8FAA8F;AAC9F,sFAAsF;AACtF,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,MAAM,GAAG,GAAG,EAAE,OAAO,EAAE,O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