@hearsay-tools/squawk 0.18.0-pr3328.5835.2 → 0.18.0-pr3329.5837

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 (60) hide show
  1. package/dist/automations/automation-cli.js +0 -5
  2. package/dist/automations/automation-cli.js.map +1 -1
  3. package/dist/automations/github-baseline.js +0 -2
  4. package/dist/automations/github-baseline.js.map +1 -1
  5. package/dist/automations/scheduler.d.ts +3 -2
  6. package/dist/automations/scheduler.js +11 -31
  7. package/dist/automations/scheduler.js.map +1 -1
  8. package/dist/automations/service.d.ts +0 -4
  9. package/dist/automations/task-template.js +2 -12
  10. package/dist/automations/task-template.js.map +1 -1
  11. package/dist/ci-wait/controller.d.ts +41 -41
  12. package/dist/ci-wait/tools.d.ts +4 -4
  13. package/dist/contract/automation-storage.d.ts +0 -4
  14. package/dist/contract/automations.d.ts +0 -26
  15. package/dist/contract/index.js +0 -22
  16. package/dist/delegation/routes.d.ts +13 -13
  17. package/dist/delegation/transport.d.ts +9 -9
  18. package/dist/server/forge/github.d.ts +17 -11
  19. package/dist/server/forge/github.js +139 -22
  20. package/dist/server/forge/github.js.map +1 -1
  21. package/dist/server/live-routes.d.ts +6 -6
  22. package/dist/server/server.d.ts +1538 -1546
  23. package/dist/server/server.js +11 -7
  24. package/dist/server/server.js.map +1 -1
  25. package/dist/voice/routes.d.ts +19 -19
  26. package/dist/workflows/run/wait-engine.d.ts +72 -72
  27. package/package.json +4 -4
  28. package/web/dist/assets/{activity-motion-BdGFmrw-.js → activity-motion-2nE59DAT.js} +1 -1
  29. package/web/dist/assets/{activity-route-1OFUVP3A.js → activity-route-R9lPc2jy.js} +1 -1
  30. package/web/dist/assets/{commit-diff-panel-BiNPMHC6.js → commit-diff-panel-BJyNYmCY.js} +1 -1
  31. package/web/dist/assets/{diff-BHwQUS2W.js → diff-D_9MtICR.js} +2 -2
  32. package/web/dist/assets/{diff-view-BBhxSIlf.js → diff-view-xRPxXHXl.js} +1 -1
  33. package/web/dist/assets/{git-toolbar-BnOaO_OH.js → git-toolbar-D9taioU5.js} +1 -1
  34. package/web/dist/assets/{github-CXc8nroh.js → github-bv_pBGc5.js} +1 -1
  35. package/web/dist/assets/{global-activity-route-Dt83uvZc.js → global-activity-route-QxTPDyx-.js} +1 -1
  36. package/web/dist/assets/{index-B5LayM4y.js → index-DgU3yYUl.js} +6 -6
  37. package/web/dist/assets/{preview-pane-connected-JHeCgq7I.js → preview-pane-connected-cD-MTiVN.js} +1 -1
  38. package/web/dist/assets/{repo-git-wEXDON29.js → repo-git-E_4Ighvg.js} +1 -1
  39. package/web/dist/assets/{report-reader-DJ_0htSx.js → report-reader-XVNQsXB4.js} +1 -1
  40. package/web/dist/assets/{reports-BIXmTBFJ.js → reports-B_PVTBzP.js} +1 -1
  41. package/web/dist/assets/{run-header-Bgtlx-vc.js → run-header-wm0gSs6X.js} +1 -1
  42. package/web/dist/assets/{skills-BJ2nSfyr.js → skills-D2RLxUIc.js} +1 -1
  43. package/web/dist/assets/{task-changes-Dz0udwrE.js → task-changes-DNtkfFzQ.js} +1 -1
  44. package/web/dist/assets/{task-commits-5uILgm5M.js → task-commits-CivO-OrN.js} +1 -1
  45. package/web/dist/assets/{task-files-DGZjTKSS.js → task-files-dczkxV_G.js} +1 -1
  46. package/web/dist/assets/{task-github-item-npfGLu9C.js → task-github-item-DKV4yrcf.js} +1 -1
  47. package/web/dist/assets/{task-thread-DnpkXb5P.js → task-thread-DIaTTGEF.js} +1 -1
  48. package/web/dist/assets/{thread-state-BfrO2t7g.js → thread-state-DIozHuHb.js} +1 -1
  49. package/web/dist/assets/{use-hand-to-agent-state-DyVB4IBv.js → use-hand-to-agent-state-D58ayxI4.js} +1 -1
  50. package/web/dist/assets/{workflows-ByduCwgu.js → workflows-YMEsGXeB.js} +1 -1
  51. package/web/dist/index.html +1 -1
  52. package/dist/automations/github-repository.d.ts +0 -22
  53. package/dist/automations/github-repository.js +0 -40
  54. package/dist/automations/github-repository.js.map +0 -1
  55. package/dist/server/forge/github-cli.d.ts +0 -14
  56. package/dist/server/forge/github-cli.js +0 -25
  57. package/dist/server/forge/github-cli.js.map +0 -1
  58. package/dist/server/forge/github-repo-handle.d.ts +0 -42
  59. package/dist/server/forge/github-repo-handle.js +0 -160
  60. package/dist/server/forge/github-repo-handle.js.map +0 -1
@@ -288,11 +288,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
288
288
  "/api/v1/tools/ask": {
289
289
  $post: {
290
290
  output: {
291
- code: 'capability_revoked';
291
+ ok: false;
292
+ code: 'unavailable';
292
293
  message: string;
293
294
  };
294
295
  outputFormat: "json";
295
- status: 401;
296
+ status: import("hono/utils/http-status").ContentfulStatusCode;
296
297
  input: {
297
298
  json: {
298
299
  questions: {
@@ -310,12 +311,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
310
311
  };
311
312
  } | {
312
313
  output: {
313
- ok: false;
314
- code: 'unavailable';
314
+ code: 'capability_revoked';
315
315
  message: string;
316
316
  };
317
317
  outputFormat: "json";
318
- status: import("hono/utils/http-status").ContentfulStatusCode;
318
+ status: 401;
319
319
  input: {
320
320
  json: {
321
321
  questions: {
@@ -383,11 +383,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
383
383
  "/api/v1/tools/cancel-wait": {
384
384
  $post: {
385
385
  output: {
386
- code: 'capability_revoked';
386
+ cancelled: false;
387
+ code: 'unavailable';
387
388
  message: string;
388
389
  };
389
390
  outputFormat: "json";
390
- status: 401;
391
+ status: import("hono/utils/http-status").ContentfulStatusCode;
391
392
  input: {
392
393
  json: {
393
394
  wait_id: string;
@@ -395,12 +396,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
395
396
  };
396
397
  } | {
397
398
  output: {
398
- cancelled: false;
399
- code: 'unavailable';
399
+ code: 'capability_revoked';
400
400
  message: string;
401
401
  };
402
402
  outputFormat: "json";
403
- status: import("hono/utils/http-status").ContentfulStatusCode;
403
+ status: 401;
404
404
  input: {
405
405
  json: {
406
406
  wait_id: string;
@@ -448,11 +448,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
448
448
  "/api/v1/tools/done": {
449
449
  $post: {
450
450
  output: {
451
- code: 'capability_revoked';
451
+ ok: false;
452
+ code: 'unavailable';
452
453
  message: string;
453
454
  };
454
455
  outputFormat: "json";
455
- status: 401;
456
+ status: import("hono/utils/http-status").ContentfulStatusCode;
456
457
  input: {
457
458
  json: {
458
459
  summary?: string | undefined;
@@ -460,12 +461,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
460
461
  };
461
462
  } | {
462
463
  output: {
463
- ok: false;
464
- code: 'unavailable';
464
+ code: 'capability_revoked';
465
465
  message: string;
466
466
  };
467
467
  outputFormat: "json";
468
- status: import("hono/utils/http-status").ContentfulStatusCode;
468
+ status: 401;
469
469
  input: {
470
470
  json: {
471
471
  summary?: string | undefined;
@@ -533,11 +533,13 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
533
533
  "/api/v1/tools/preview-stop": {
534
534
  $post: {
535
535
  output: {
536
- code: 'capability_revoked';
536
+ ok: boolean;
537
+ code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
537
538
  message: string;
539
+ hint: string;
538
540
  };
539
541
  outputFormat: "json";
540
- status: 401;
542
+ status: import("hono/utils/http-status").ContentfulStatusCode;
541
543
  input: {
542
544
  json: {
543
545
  port: number;
@@ -546,13 +548,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
546
548
  };
547
549
  } | {
548
550
  output: {
549
- ok: boolean;
550
- code: "adopted" | "approval_required" | "headless" | "invalid_input" | "not_registered" | "port_held" | "port_in_use" | "preview_disabled" | "restarted" | "stopped" | "unavailable" | "worktree_missing";
551
+ code: 'capability_revoked';
551
552
  message: string;
552
- hint: string;
553
553
  };
554
554
  outputFormat: "json";
555
- status: import("hono/utils/http-status").ContentfulStatusCode;
555
+ status: 401;
556
556
  input: {
557
557
  json: {
558
558
  port: number;
@@ -565,11 +565,13 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
565
565
  "/api/v1/tools/preview-serve": {
566
566
  $post: {
567
567
  output: {
568
- code: 'capability_revoked';
568
+ ok: boolean;
569
+ code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
569
570
  message: string;
571
+ hint: string;
570
572
  };
571
573
  outputFormat: "json";
572
- status: 401;
574
+ status: import("hono/utils/http-status").ContentfulStatusCode;
573
575
  input: {
574
576
  json: {
575
577
  command: string;
@@ -581,13 +583,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
581
583
  };
582
584
  } | {
583
585
  output: {
584
- ok: boolean;
585
- code: "cezar_port" | "cwd_outside_worktree" | "headless" | "invalid_input" | "port_held" | "preview_disabled" | "registered" | "replaced" | "too_many" | "unavailable" | "worktree_missing";
586
+ code: 'capability_revoked';
586
587
  message: string;
587
- hint: string;
588
588
  };
589
589
  outputFormat: "json";
590
- status: import("hono/utils/http-status").ContentfulStatusCode;
590
+ status: 401;
591
591
  input: {
592
592
  json: {
593
593
  command: string;
@@ -603,11 +603,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
603
603
  "/api/v1/tools/schedule-task": {
604
604
  $post: {
605
605
  output: {
606
- code: 'capability_revoked';
606
+ ok: false;
607
+ code: import('../contract/index.js').ScheduledTaskRefusalCode;
607
608
  message: string;
608
609
  };
609
610
  outputFormat: "json";
610
- status: 401;
611
+ status: import("hono/utils/http-status").ContentfulStatusCode;
611
612
  input: {
612
613
  json: {
613
614
  at?: string | undefined;
@@ -624,12 +625,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
624
625
  };
625
626
  } | {
626
627
  output: {
627
- ok: false;
628
- code: import('../contract/index.js').ScheduledTaskRefusalCode;
628
+ code: 'capability_revoked';
629
629
  message: string;
630
630
  };
631
631
  outputFormat: "json";
632
- status: import("hono/utils/http-status").ContentfulStatusCode;
632
+ status: 401;
633
633
  input: {
634
634
  json: {
635
635
  at?: string | undefined;
@@ -646,10 +646,6 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
646
646
  };
647
647
  } | {
648
648
  output: {
649
- ok: false;
650
- code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
651
- message: string;
652
- } | {
653
649
  ok: true;
654
650
  task: {
655
651
  id: string;
@@ -661,6 +657,10 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
661
657
  url?: string | undefined;
662
658
  };
663
659
  note: string;
660
+ } | {
661
+ ok: false;
662
+ code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
663
+ message: string;
664
664
  };
665
665
  outputFormat: "json";
666
666
  status: import("hono/utils/http-status").ContentfulStatusCode;
@@ -684,11 +684,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
684
684
  "/api/v1/tools/scheduled-tasks": {
685
685
  $post: {
686
686
  output: {
687
- code: 'capability_revoked';
687
+ ok: false;
688
+ code: import('../contract/index.js').ScheduledTaskRefusalCode;
688
689
  message: string;
689
690
  };
690
691
  outputFormat: "json";
691
- status: 401;
692
+ status: import("hono/utils/http-status").ContentfulStatusCode;
692
693
  input: {
693
694
  json: {
694
695
  at?: string | undefined;
@@ -721,12 +722,11 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
721
722
  };
722
723
  } | {
723
724
  output: {
724
- ok: false;
725
- code: import('../contract/index.js').ScheduledTaskRefusalCode;
725
+ code: 'capability_revoked';
726
726
  message: string;
727
727
  };
728
728
  outputFormat: "json";
729
- status: import("hono/utils/http-status").ContentfulStatusCode;
729
+ status: 401;
730
730
  input: {
731
731
  json: {
732
732
  at?: string | undefined;
@@ -783,10 +783,6 @@ 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
- } | {
790
786
  ok: true;
791
787
  task: {
792
788
  id: string;
@@ -798,6 +794,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
798
794
  url?: string | undefined;
799
795
  };
800
796
  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,8 +309,6 @@ 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>;
314
312
  revision: z.ZodOptional<z.ZodNumber>;
315
313
  baselineAt: z.ZodOptional<z.ZodString>;
316
314
  armedAt: z.ZodOptional<z.ZodString>;
@@ -353,8 +351,6 @@ export declare const storedAutomationRuntimeStateSchema: z.ZodObject<{
353
351
  export declare const storedAutomationStateFileSchema: z.ZodObject<{
354
352
  version: z.ZodDefault<z.ZodLiteral<1>>;
355
353
  states: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
356
- lastError: z.ZodOptional<z.ZodString>;
357
- lastErrorAt: z.ZodOptional<z.ZodString>;
358
354
  revision: z.ZodOptional<z.ZodNumber>;
359
355
  baselineAt: z.ZodOptional<z.ZodString>;
360
356
  armedAt: z.ZodOptional<z.ZodString>;
@@ -269,16 +269,7 @@ 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
- };
279
272
  export declare const automationRuntimeStateSchema: z.ZodObject<{
280
- lastError: z.ZodOptional<z.ZodString>;
281
- lastErrorAt: z.ZodOptional<z.ZodString>;
282
273
  revision: z.ZodOptional<z.ZodNumber>;
283
274
  baselineAt: z.ZodOptional<z.ZodString>;
284
275
  armedAt: z.ZodOptional<z.ZodString>;
@@ -319,17 +310,6 @@ export declare const automationRuntimeStateSchema: z.ZodObject<{
319
310
  }>>;
320
311
  }, z.core.$strip>;
321
312
  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;
333
313
  /** What one poll decided about one candidate. `baseline` and `preview` are bookkeeping rows: no
334
314
  * task was launched and none was meant to be. */
335
315
  export declare const automationLogResultSchema: z.ZodEnum<{
@@ -510,8 +490,6 @@ export declare const automationListEntrySchema: z.ZodObject<{
510
490
  createdAt: z.ZodString;
511
491
  updatedAt: z.ZodString;
512
492
  state: z.ZodOptional<z.ZodObject<{
513
- lastError: z.ZodOptional<z.ZodString>;
514
- lastErrorAt: z.ZodOptional<z.ZodString>;
515
493
  revision: z.ZodOptional<z.ZodNumber>;
516
494
  baselineAt: z.ZodOptional<z.ZodString>;
517
495
  armedAt: z.ZodOptional<z.ZodString>;
@@ -739,8 +717,6 @@ export declare const automationsResponseSchema: z.ZodObject<{
739
717
  createdAt: z.ZodString;
740
718
  updatedAt: z.ZodString;
741
719
  state: z.ZodOptional<z.ZodObject<{
742
- lastError: z.ZodOptional<z.ZodString>;
743
- lastErrorAt: z.ZodOptional<z.ZodString>;
744
720
  revision: z.ZodOptional<z.ZodNumber>;
745
721
  baselineAt: z.ZodOptional<z.ZodString>;
746
722
  armedAt: z.ZodOptional<z.ZodString>;
@@ -1191,8 +1167,6 @@ export declare const automationDetailResponseSchema: z.ZodObject<{
1191
1167
  updatedAt: z.ZodString;
1192
1168
  }, z.core.$strip>;
1193
1169
  state: z.ZodOptional<z.ZodObject<{
1194
- lastError: z.ZodOptional<z.ZodString>;
1195
- lastErrorAt: z.ZodOptional<z.ZodString>;
1196
1170
  revision: z.ZodOptional<z.ZodNumber>;
1197
1171
  baselineAt: z.ZodOptional<z.ZodString>;
1198
1172
  armedAt: z.ZodOptional<z.ZodString>;
@@ -4280,11 +4280,6 @@ 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
- };
4288
4283
  var automationRuntimeStateSchema = z28.object({
4289
4284
  /** The definition revision this state belongs to; activation or history-policy changes re-arm. */
4290
4285
  revision: z28.number().optional(),
@@ -4305,21 +4300,9 @@ var automationRuntimeStateSchema = z28.object({
4305
4300
  etags: z28.record(z28.string(), z28.string()).optional(),
4306
4301
  backoffUntil: z28.string().optional(),
4307
4302
  consecutiveFailures: z28.number().optional(),
4308
- ...automationLastErrorShape,
4309
4303
  /** `once` schedules: why it stopped without a task — its launch failed, or it started past its cutoff. */
4310
4304
  onceOutcome: z28.enum(["failed", "missed"]).optional()
4311
4305
  });
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
- }
4323
4306
  var automationLogResultSchema = z28.enum([
4324
4307
  "launched",
4325
4308
  "no-match",
@@ -5555,7 +5538,6 @@ var storedAutomationRuntimeStateSchema = z39.object({
5555
5538
  etags: z39.record(z39.string(), z39.string()).optional(),
5556
5539
  backoffUntil: z39.string().datetime().optional(),
5557
5540
  consecutiveFailures: z39.number().int().nonnegative().optional(),
5558
- ...automationLastErrorShape,
5559
5541
  /** once schedule: it stopped without a task — the launch failed, or it started past its cutoff. */
5560
5542
  onceOutcome: z39.enum(["failed", "missed"]).optional()
5561
5543
  }).passthrough();
@@ -6010,8 +5992,6 @@ export {
6010
5992
  ASK_LIMITS,
6011
5993
  ATTENTION_RANK,
6012
5994
  ATTENTION_RUNGS,
6013
- AUTOMATION_FAILURE_NOTICE_AFTER,
6014
- AUTOMATION_LAST_ERROR_MAX,
6015
5995
  CI_WAIT_LIMITATION,
6016
5996
  CI_WAIT_RECEIPT_INSTRUCTION,
6017
5997
  CONTROL_LOCATIONS,
@@ -6172,12 +6152,10 @@ export {
6172
6152
  automationDetailResponseSchema,
6173
6153
  automationEditableSchema,
6174
6154
  automationEventSchema,
6175
- automationFailureNotice,
6176
6155
  automationFiltersSchema,
6177
6156
  automationHistoryScanSchema,
6178
6157
  automationIdOf,
6179
6158
  automationKindSchema,
6180
- automationLastErrorShape,
6181
6159
  automationListEntrySchema,
6182
6160
  automationListQuerySchema,
6183
6161
  automationLogQuerySchema,
@@ -82,6 +82,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
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
+ } | {
85
94
  tasks: {
86
95
  id: string;
87
96
  title: string;
@@ -93,15 +102,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
93
102
  reason?: string | undefined;
94
103
  }[];
95
104
  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
- 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;
@@ -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;
@@ -76,6 +67,15 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
76
67
  source: "cache" | "live" | "unavailable";
77
68
  stale: boolean;
78
69
  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;
@@ -1,20 +1,12 @@
1
+ import type { RepoHandleDiscovery } from './repo-handle-discovery.ts';
1
2
  export type { RepoHandleDiscovery } from './repo-handle-discovery.ts';
2
3
  export { createDraftPr, buildPrBody } from './draft-pr.ts';
3
4
  import type { ArchivePullRequestIdentity, MergedPullRequest } from '../../contract/index.js';
4
5
  import { z } from 'zod';
5
- export { parseOwnerName } from './github-cli.ts';
6
- export { __clearRepoHandleCacheForTests, discoverRepoHandle, forgetRepoHandle, resolveRepoHandle } from './github-repo-handle.ts';
7
6
  import { type GithubCommentCountsData, type GithubItemResponse, type GithubProjectsData } from '../../contract/index.js';
8
7
  export { normalizeMergeState } from './github-merge-state.ts';
9
8
  export { fetchTimelinePages, ghTimelineEventSchema, normalizeEvents, TIMELINE_BUDGET_MS, TIMELINE_EVENT_CAP, TIMELINE_EVENT_KINDS, TIMELINE_MAX_PAGES, TIMELINE_MIN_PAGE_MS, } from './github-timeline.ts';
10
9
  import type { ForgeAvailability, ForgeComment, ForgeCommentsData, ForgeDriver, ForgeItem, ForgeListOptions, ForgePrMergeState, ForgePrDiffResult, ForgeSearchData, ForgeTimelineEvent } from './types.ts';
11
- /**
12
- * The GitHub forge driver — all `gh`-CLI logic in one place, moved here from
13
- * `src/server/github.ts` (tab listing) and `src/server/pr.ts` (draft PRs)
14
- * behind the `ForgeDriver` seam. Those modules remain as thin delegates.
15
- * `/api/github`'s response shape is this driver's serialization and is
16
- * protected by BACKWARD_COMPATIBILITY.md — additive changes only.
17
- */
18
10
  export declare const GH_PR_DIFF_FILE_CAP = 300;
19
11
  export declare const GH_PR_PATCH_CAP: number;
20
12
  export declare const GH_PR_DIFF_JSON_CAP: number;
@@ -48,6 +40,11 @@ export type GraphqlRunner = (query: string, variables: Record<string, string | n
48
40
  * number goes through `-F`. A string never does: `-F` would read `@file` and coerce
49
41
  * `true`/numerals, which is not what an opaque cursor or a login means. */
50
42
  export declare function ghGraphqlArgs(query: string, variables?: Record<string, string | number>): string[];
43
+ /** `owner/name` → `{ owner, name }`, or null when the handle isn't a clean two-part slug. */
44
+ export declare function parseOwnerName(nameWithOwner: string): {
45
+ owner: string;
46
+ name: string;
47
+ } | null;
51
48
  /** GitHub GraphQL rejects `first` above 100 (EXCESSIVE_PAGINATION); larger limits walk pages. */
52
49
  export declare const GH_GRAPHQL_PAGE_MAX = 100;
53
50
  export type ListSide = 'issues' | 'pullRequests';
@@ -146,6 +143,16 @@ export declare function forgetGithubItem(repoRoot: string, kind: 'issue' | 'pr',
146
143
  /** Test-only: drop the single-item cache. */
147
144
  export declare function __clearGithubItemCacheForTests(): void;
148
145
  export declare function fetchGithubItem(repoRoot: string, kind: 'issue' | 'pr', number: number, refresh?: boolean): Promise<GithubItemResponse>;
146
+ /** Test-only: drop the memoized repo handles. */
147
+ export declare function __clearRepoHandleCacheForTests(): void;
148
+ /** Share the existing memo with ordinary discovery, but retain failure classification (#102).
149
+ * An aborted owner must never publish its late result into this shared cache. */
150
+ export declare function discoverRepoHandle(repoRoot: string, signal?: AbortSignal): Promise<RepoHandleDiscovery>;
151
+ /** Compatible fail-open lookup for existing API and cold-index callers. */
152
+ export declare function resolveRepoHandle(repoRoot: string, signal?: AbortSignal): Promise<{
153
+ owner: string;
154
+ name: string;
155
+ } | null>;
149
156
  /** SHAs per rollup query. Aliases resolve independently, so a chunk that fails costs only its own
150
157
  * glyphs — but an unbounded alias list would eventually blow the query size limit. */
151
158
  export declare const COMMIT_CHECKS_CHUNK = 50;
@@ -375,8 +382,7 @@ export declare function fetchGithubComments(repoRoot: string, kind: 'issue' | 'p
375
382
  export declare function detectGithubCached(repoRoot: string): ForgeAvailability | null;
376
383
  export declare function evictGithubProjectCaches(repoRoot: string): void;
377
384
  export declare function mergePreflightAllowed(current: ForgePrMergeState, overrideRules?: boolean): boolean;
378
- /** owner/repo parsed out of the origin remote — feeds `viewUrl`. Reads that name the repository
379
- * use `canonicalRepoRef` instead, which follows a rename. */
385
+ /** owner/repo parsed out of the origin remote — feeds `viewUrl`. */
380
386
  export interface GithubRepoRef {
381
387
  owner: string;
382
388
  repo: string;