@hearsay-tools/squawk 0.19.0-pr4481.8832 → 0.19.0-pr4482.8837

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 (139) hide show
  1. package/dist/boot.d.ts +1 -1
  2. package/dist/boot.js +4 -1
  3. package/dist/boot.js.map +1 -1
  4. package/dist/built-in-forges.d.ts +8 -0
  5. package/dist/built-in-forges.js +15 -0
  6. package/dist/built-in-forges.js.map +1 -0
  7. package/dist/contract/health.d.ts +2 -2
  8. package/dist/contract/index.d.ts +0 -1
  9. package/dist/contract/index.js +13 -37
  10. package/dist/contract/projects.d.ts +6 -6
  11. package/dist/contract/runs.d.ts +1 -10
  12. package/dist/core/forge-registry.d.ts +113 -0
  13. package/dist/core/forge-registry.js +127 -0
  14. package/dist/core/forge-registry.js.map +1 -0
  15. package/dist/delegation/routes.d.ts +4 -4
  16. package/dist/delegation/transport.d.ts +69 -69
  17. package/dist/features/automations/github-repository.js +2 -1
  18. package/dist/features/automations/github-repository.js.map +1 -1
  19. package/dist/features/automations/task-template.js +1 -1
  20. package/dist/features/automations/task-template.js.map +1 -1
  21. package/dist/plugin/api.d.ts +4 -0
  22. package/dist/plugin/api.js +10 -1
  23. package/dist/plugin/api.js.map +1 -1
  24. package/dist/plugin/cli.js +1 -1
  25. package/dist/plugin/cli.js.map +1 -1
  26. package/dist/plugin/index.d.ts +1 -0
  27. package/dist/plugin/index.js.map +1 -1
  28. package/dist/runs/pull-requests.d.ts +0 -10
  29. package/dist/runs/pull-requests.js +19 -30
  30. package/dist/runs/pull-requests.js.map +1 -1
  31. package/dist/runs/run-archive.d.ts +0 -1
  32. package/dist/runs/run-archive.js +4 -14
  33. package/dist/runs/run-archive.js.map +1 -1
  34. package/dist/runs/run-decode.d.ts +72 -74
  35. package/dist/runs/run-exits.d.ts +0 -6
  36. package/dist/runs/run-references.d.ts +0 -1
  37. package/dist/runs/run-references.js +6 -7
  38. package/dist/runs/run-references.js.map +1 -1
  39. package/dist/runs/store-open.d.ts +1 -7
  40. package/dist/runs/store-open.js +2 -8
  41. package/dist/runs/store-open.js.map +1 -1
  42. package/dist/runs/task-markers.js +1 -1
  43. package/dist/runs/task-markers.js.map +1 -1
  44. package/dist/runs/task-refs.d.ts +7 -14
  45. package/dist/runs/task-refs.js +18 -32
  46. package/dist/runs/task-refs.js.map +1 -1
  47. package/dist/server/activity-routes.d.ts +23 -23
  48. package/dist/server/completion-actions.js +3 -3
  49. package/dist/server/completion-actions.js.map +1 -1
  50. package/dist/server/forge/draft-pr.d.ts +6 -0
  51. package/dist/server/forge/draft-pr.js +11 -3
  52. package/dist/server/forge/draft-pr.js.map +1 -1
  53. package/dist/server/forge/github-forge.d.ts +4 -0
  54. package/dist/server/forge/github-forge.js +80 -0
  55. package/dist/server/forge/github-forge.js.map +1 -0
  56. package/dist/server/forge/github-mutations.js +2 -4
  57. package/dist/server/forge/github-mutations.js.map +1 -1
  58. package/dist/server/forge/index.d.ts +0 -19
  59. package/dist/server/forge/index.js +6 -29
  60. package/dist/server/forge/index.js.map +1 -1
  61. package/dist/server/forge/types.d.ts +2 -1
  62. package/dist/server/live-routes.d.ts +6 -6
  63. package/dist/server/projects-routes.d.ts +9 -9
  64. package/dist/server/repo-routes.d.ts +34 -34
  65. package/dist/server/runs-routes.d.ts +17 -26
  66. package/dist/server/server.d.ts +1281 -1299
  67. package/dist/server/workspace-live-routes.d.ts +6 -6
  68. package/dist/server/workspace-routes.d.ts +84 -84
  69. package/dist/workflows/continuation-admission.d.ts +0 -1
  70. package/dist/workflows/run/wait-engine.d.ts +72 -73
  71. package/dist/workspace/projects.d.ts +4 -5
  72. package/dist/workspace/projects.js +1 -1
  73. package/dist/workspace/projects.js.map +1 -1
  74. package/package.json +4 -4
  75. package/scripts/benchmark-project-probes.mjs +4 -0
  76. package/web/dist/assets/{accounts-section-BULNNzUp.js → accounts-section-COJzKqsN.js} +1 -1
  77. package/web/dist/assets/{activity-motion-b63VkoL7.js → activity-motion-BKEnbaU3.js} +1 -1
  78. package/web/dist/assets/{activity-route-1BPPXfg0.js → activity-route-BktC7K27.js} +1 -1
  79. package/web/dist/assets/{agent-config-section-DUFiYn_s.js → agent-config-section-CUbXvXBE.js} +1 -1
  80. package/web/dist/assets/{agent-defaults-section-YDBBZLgz.js → agent-defaults-section-Bja_7urR.js} +1 -1
  81. package/web/dist/assets/{appearance-DtCghYVR.js → appearance-DCnUfFut.js} +1 -1
  82. package/web/dist/assets/{archive-on-merge-field-D3OBzagt.js → archive-on-merge-field-B0qWUHNs.js} +1 -1
  83. package/web/dist/assets/attention-D3JmzDQv.js +1 -0
  84. package/web/dist/assets/{automations-route-DSClQHpk.js → automations-route-BUrEq0VH.js} +1 -1
  85. package/web/dist/assets/{commit-list-C9GATxxl.js → commit-list-BWK9da82.js} +1 -1
  86. package/web/dist/assets/{diff-ER_oHiMa.js → diff-BVH_RWBz.js} +2 -2
  87. package/web/dist/assets/{diff-controls-B_MFH4Kt.js → diff-controls-DuDm8Ywc.js} +1 -1
  88. package/web/dist/assets/{diff-view-DiSP3-lY.js → diff-view-CGSmQHjf.js} +1 -1
  89. package/web/dist/assets/{file-preview-BFgWEp5Q.js → file-preview-dLUnWpCG.js} +1 -1
  90. package/web/dist/assets/{folder-browser-BKpkblOg.js → folder-browser-sASDxPXD.js} +1 -1
  91. package/web/dist/assets/{git-toolbar-k_mkGLJa.js → git-toolbar-C7waT1AJ.js} +1 -1
  92. package/web/dist/assets/{github-DJv6cebT.js → github-BkLTCoB7.js} +1 -1
  93. package/web/dist/assets/{global-activity-route-D2AXM4ol.js → global-activity-route-CXm2vmR-.js} +1 -1
  94. package/web/dist/assets/{index-6zQe_0aQ.js → index-CDd7AdAu.js} +5 -5
  95. package/web/dist/assets/{label-r2EmPWPF.js → label-DF0V6WoC.js} +1 -1
  96. package/web/dist/assets/{markdown-BgWVYVYg.js → markdown-BODUip-p.js} +1 -1
  97. package/web/dist/assets/{notifications-section--Gyk7UKV.js → notifications-section-BoMwLKQj.js} +1 -1
  98. package/web/dist/assets/{open-in-menu-DURN-8Iq.js → open-in-menu-D9VOIWhI.js} +1 -1
  99. package/web/dist/assets/{preview-pane-connected-GmJbIAW5.js → preview-pane-connected-BncD5HPr.js} +1 -1
  100. package/web/dist/assets/{project-location-BVh3MyY6.js → project-location-BKXBQJPm.js} +1 -1
  101. package/web/dist/assets/{project-router-1ohBdsN0.js → project-router-p_FJwg-L.js} +1 -1
  102. package/web/dist/assets/{projects-section-PXgWMbCg.js → projects-section-C2mLLBLO.js} +1 -1
  103. package/web/dist/assets/{prompt-templates-section-B4FEmqam.js → prompt-templates-section-CwWAsTg5.js} +1 -1
  104. package/web/dist/assets/{queries-ScB0s5Ar.js → queries-C0l1puJe.js} +1 -1
  105. package/web/dist/assets/{reference-chip-B_gqhu5D.js → reference-chip--9aRttZG.js} +1 -1
  106. package/web/dist/assets/{remote-settings-notice-BNk1mBzq.js → remote-settings-notice-B9h38exH.js} +1 -1
  107. package/web/dist/assets/{repo-git-Bjzf3q3L.js → repo-git-CgQA2pWS.js} +1 -1
  108. package/web/dist/assets/{report-reader-B7AyB7C8.js → report-reader-B7knRXaW.js} +1 -1
  109. package/web/dist/assets/{report-selection-TxRk0uQB.js → report-selection-DQsrMoxl.js} +1 -1
  110. package/web/dist/assets/{reports-DcVAE_Kl.js → reports-Dpn_dl7x.js} +1 -1
  111. package/web/dist/assets/{resources-section-SB3QaB4H.js → resources-section-BTRVTMVx.js} +1 -1
  112. package/web/dist/assets/{review-panel-DKpPLRUv.js → review-panel-CuPvmcQp.js} +1 -1
  113. package/web/dist/assets/{run-detail-refresh-Dd21Z89D.js → run-detail-refresh-DyeLywhA.js} +1 -1
  114. package/web/dist/assets/{run-header-COYiWZM3.js → run-header-UEj20eIu.js} +1 -1
  115. package/web/dist/assets/{select-BwWUe2Px.js → select-B_nJiiFA.js} +1 -1
  116. package/web/dist/assets/{session-context-section-FDmJqOKx.js → session-context-section-CaYkntsJ.js} +1 -1
  117. package/web/dist/assets/{settings-agent-picker-DccnW7PI.js → settings-agent-picker-Dl49O0Uz.js} +1 -1
  118. package/web/dist/assets/{settings-shell-DoU_fUX5.js → settings-shell-DZOsC9Iv.js} +1 -1
  119. package/web/dist/assets/{sidebar-section-T-de9wg7.js → sidebar-section-bs9nIVDs.js} +1 -1
  120. package/web/dist/assets/{skills-B6X4yU1R.js → skills-B9orSgbp.js} +1 -1
  121. package/web/dist/assets/{tab-link-vUBbOMng.js → tab-link-9ky9_HfJ.js} +1 -1
  122. package/web/dist/assets/{task-changes-B4J_Injz.js → task-changes-CXTuG2Cn.js} +1 -1
  123. package/web/dist/assets/{task-commits-Bk0Iy2bj.js → task-commits-B2u2A-CY.js} +1 -1
  124. package/web/dist/assets/{task-file-scope-zeMRtXh3.js → task-file-scope-Xr7UxjvR.js} +1 -1
  125. package/web/dist/assets/{task-files-DkA_UBcJ.js → task-files-BJnVrRlr.js} +1 -1
  126. package/web/dist/assets/{task-github-item-B7yTtACn.js → task-github-item-DiU77rbk.js} +1 -1
  127. package/web/dist/assets/{task-groups-BHP2J8M9.js → task-groups-DDxVSOHs.js} +1 -1
  128. package/web/dist/assets/{task-thread-DKI0y1Bc.js → task-thread-CWZI9Pb7.js} +1 -1
  129. package/web/dist/assets/{tasks-table-Ddm8zmrJ.js → tasks-table-aF1_yUcS.js} +1 -1
  130. package/web/dist/assets/{thread-state-5yYxjBaw.js → thread-state-Bfa3qy5W.js} +1 -1
  131. package/web/dist/assets/toaster-BYPWDBoi.js +4 -0
  132. package/web/dist/assets/{use-hand-to-agent-state-Bp3UhJv3.js → use-hand-to-agent-state-BCjGdF1N.js} +1 -1
  133. package/web/dist/assets/{workflows-CRwy8Uqr.js → workflows-Crhe2aKn.js} +1 -1
  134. package/web/dist/assets/{workspace-tools-DGA5qye_.js → workspace-tools-CW9ltpbo.js} +1 -1
  135. package/web/dist/assets/{worktrees-section-EgSAm8FD.js → worktrees-section-DleqD_YR.js} +1 -1
  136. package/web/dist/index.html +13 -13
  137. package/dist/contract/pull-request-urls.d.ts +0 -20
  138. package/web/dist/assets/attention-DBS2iaFI.js +0 -1
  139. package/web/dist/assets/toaster-CRikzxTs.js +0 -4
package/dist/boot.d.ts CHANGED
@@ -30,7 +30,7 @@ export interface BootRuntimeOptions {
30
30
  /**
31
31
  * Register every built-in extension table, load the bundled runners and then the host plugins
32
32
  * through the plugin loader, run the optional hook, then seal
33
- * all nine registries in this one place. A second call returns the same boot and does not load
33
+ * all twelve registries in this one place. A second call returns the same boot and does not load
34
34
  * plugins or run the hook again.
35
35
  */
36
36
  export declare function bootRuntime(options?: BootRuntimeOptions): Promise<void>;
package/dist/boot.js CHANGED
@@ -29,7 +29,7 @@ let hostPluginsLoaded = false;
29
29
  /**
30
30
  * Register every built-in extension table, load the bundled runners and then the host plugins
31
31
  * through the plugin loader, run the optional hook, then seal
32
- * all nine registries in this one place. A second call returns the same boot and does not load
32
+ * all twelve registries in this one place. A second call returns the same boot and does not load
33
33
  * plugins or run the hook again.
34
34
  */
35
35
  export function bootRuntime(options) {
@@ -48,6 +48,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, bundledFeaturesDir,
48
48
  if (!cliCommandsSealed())
49
49
  registerBuiltInCliCommands();
50
50
  const { registerBuiltInRunSlots, sealBuiltInRunSlots } = await import('./built-in-run-slots.js');
51
+ const { registerBuiltInForges, sealBuiltInForges } = await import('./built-in-forges.js');
51
52
  const { registerBuiltInLaunchParts, sealBuiltInLaunchParts } = await import('./built-in-launch-parts.js');
52
53
  const { registerBuiltInStepKinds, sealBuiltInStepKinds } = await import('./workflows/step-kind-registry.js');
53
54
  const { registerBuiltInTools, sealBuiltInTools } = await import('./built-in-tools.js');
@@ -59,6 +60,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, bundledFeaturesDir,
59
60
  const { sealCapabilities } = await import('./core/capability-registry.js');
60
61
  const loader = await import('./plugin/loader.js');
61
62
  registerBuiltInRunSlots();
63
+ registerBuiltInForges();
62
64
  registerBuiltInLaunchParts();
63
65
  registerBuiltInStepKinds();
64
66
  registerBuiltInTools();
@@ -76,6 +78,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, bundledFeaturesDir,
76
78
  sealHttpRoutes();
77
79
  sealServerHooks();
78
80
  sealCapabilities();
81
+ sealBuiltInForges();
79
82
  sealRunners();
80
83
  sealBuiltInRunSlots();
81
84
  sealBuiltInLaunchParts();
package/dist/boot.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAGpE;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,0BAA0B,EAAE,CAAC;IAC7B,sBAAsB,EAAE,CAAC;AAC3B,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,cAAc,CAAC,IAAgB,EAAE,IAAI,GAA2B,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;IACzG,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,oCAAoC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACjI,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAwBD,IAAI,WAAsC,CAAC;AAC3C,kHAAkH;AAClH,IAAI,kBAAgD,CAAC;AACrD,yFAAyF;AACzF,IAAI,mBAAiD,CAAC;AACtD,iGAAiG;AACjG,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;;GAKG;AACH,MA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BAAwB,EAAE,CAAC;IAC3B,MAAM,CAAC,kBAAkB,KAAK,iBAAiB,KAAK,SAAS;QAC3D,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE;QAC7B,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxE,MAAM,CAAC,mBAAmB,KAAK,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC/E,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACnD,iBAAiB,GAAG,IAAI,CAAC;QACzB,MAAM,MAAM,CAAC,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,UAAU,EAAE,EAAE,CAAC;IACrB,sBAAsB,EAAE,CAAC;IACzB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC;IAClB,gBAAgB,EAAE,CAAC;IACnB,iBAAiB,EAAE,CAAC;IACpB,WAAW,EAAE,CAAC;IACd,mBAAmB,EAAE,CAAC;IACtB,sBAAsB,EAAE,CAAC;IACzB,oBAAoB,EAAE,CAAC;IACvB,gBAAgB,EAAE,CAAC;IACnB,oBAAoB,EAAE,CAAC;IACvB,yBAAyB,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Temporary bridge (spec 2026-11-28-forge-plugin-seam, S1): registers the GitHub forge until
3
+ * `features/github/` registers it through `SquawkPluginApi` (S5 deletes this module). Boot calls it
4
+ * before any plugin loads, so GitHub is first in load order. A second call is a no-op.
5
+ */
6
+ export declare function registerBuiltInForges(): void;
7
+ /** Seal after every built-in and plugin forge registered, at the boot boundary. */
8
+ export declare function sealBuiltInForges(): void;
@@ -0,0 +1,15 @@
1
+ import { registerForge, sealForges } from './core/forge-registry.js';
2
+ import { githubForge } from './server/forge/github-forge.js';
3
+ /**
4
+ * Temporary bridge (spec 2026-11-28-forge-plugin-seam, S1): registers the GitHub forge until
5
+ * `features/github/` registers it through `SquawkPluginApi` (S5 deletes this module). Boot calls it
6
+ * before any plugin loads, so GitHub is first in load order. A second call is a no-op.
7
+ */
8
+ export function registerBuiltInForges() {
9
+ registerForge(githubForge);
10
+ }
11
+ /** Seal after every built-in and plugin forge registered, at the boot boundary. */
12
+ export function sealBuiltInForges() {
13
+ sealForges();
14
+ }
15
+ //# sourceMappingURL=built-in-forges.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in-forges.js","sourceRoot":"","sources":["../src/built-in-forges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,aAAa,CAAC,WAAW,CAAC,CAAC;AAC7B,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,iBAAiB;IAC/B,UAAU,EAAE,CAAC;AACf,CAAC"}
@@ -10,7 +10,7 @@ export declare const backendCheckSchema: z.ZodObject<{
10
10
  }, z.core.$strip>;
11
11
  export type BackendCheck = z.infer<typeof backendCheckSchema>;
12
12
  export declare const forgeInfoSchema: z.ZodObject<{
13
- kind: z.ZodLiteral<"github">;
13
+ kind: z.ZodString;
14
14
  available: z.ZodOptional<z.ZodBoolean>;
15
15
  reason: z.ZodOptional<z.ZodString>;
16
16
  }, z.core.$strip>;
@@ -96,7 +96,7 @@ export declare const healthResponseSchema: z.ZodObject<{
96
96
  }, z.core.$strip>>;
97
97
  defaultRunner: z.ZodString;
98
98
  forge: z.ZodNullable<z.ZodObject<{
99
- kind: z.ZodLiteral<"github">;
99
+ kind: z.ZodString;
100
100
  available: z.ZodOptional<z.ZodBoolean>;
101
101
  reason: z.ZodOptional<z.ZodString>;
102
102
  }, z.core.$strip>>;
@@ -37,7 +37,6 @@ export * from './scheduled-tasks.ts';
37
37
  export * from './preview.ts';
38
38
  export * from './conversations.ts';
39
39
  export * from './ci-wait.ts';
40
- export * from './pull-request-urls.ts';
41
40
  export * from './waits.ts';
42
41
  export * from './wait-tools.ts';
43
42
  export * from './run-predicates.ts';
@@ -889,7 +889,8 @@ var backendCheckSchema = z12.object({
889
889
  hint: z12.string().optional()
890
890
  });
891
891
  var forgeInfoSchema = z12.object({
892
- kind: z12.literal("github"),
892
+ /** The forge id (`github`): an open string, because a plugin can add a forge. */
893
+ kind: z12.string().min(1),
893
894
  /**
894
895
  * Whether the forge is reachable — **absent until the availability probe has warmed**.
895
896
  *
@@ -1448,24 +1449,6 @@ function runWorkflowLabel(run) {
1448
1449
  var ARCHIVED_RUNS_PAGE_DEFAULT = 50;
1449
1450
  var ARCHIVED_RUNS_PAGE_MAX = 200;
1450
1451
 
1451
- // ../contract/src/pull-request-urls.ts
1452
- var DEFAULT_PULL_REQUEST_HOST = "github.com";
1453
- var PULL_REQUEST_URL = /^(https?):\/\/([a-z0-9](?:[a-z0-9.-]*[a-z0-9])?)(?::([0-9]+))?\/([a-z0-9_.-]+)\/([a-z0-9_.-]+)\/pulls?\/([1-9][0-9]*)\/?(?:[?#][^\s]*)?$/i;
1454
- function pullRequestUrlParts(value) {
1455
- const match = PULL_REQUEST_URL.exec(value);
1456
- if (!match) return void 0;
1457
- const [, scheme, hostname, port2, owner, repo, digits] = match;
1458
- const host = hostname.toLowerCase();
1459
- const number = Number(digits);
1460
- if (host === DEFAULT_PULL_REQUEST_HOST ? port2 !== void 0 : scheme.toLowerCase() !== "https" || port2 !== void 0 && !serverPort(port2)) return void 0;
1461
- if ([owner, repo].some((segment) => segment === "." || segment === "..") || !Number.isSafeInteger(number)) return void 0;
1462
- return { host: port2 === void 0 ? host : `${host}:${port2}`, owner, repo, number };
1463
- }
1464
- function serverPort(port2) {
1465
- const value = Number(port2);
1466
- return /^[1-9][0-9]*$/.test(port2) && value <= 65535 && value !== 443;
1467
- }
1468
-
1469
1452
  // ../contract/src/queued-messages.ts
1470
1453
  import { z as z19 } from "zod";
1471
1454
  var queuedMessageSchema = z19.object({
@@ -1531,11 +1514,11 @@ function utf8Bytes(value) {
1531
1514
  // ../contract/src/ci-wait.ts
1532
1515
  var CI_WAIT_LIMITATION = "Passing reported checks does not prove that every expected workflow has appeared or that the PR is merge-ready. This observation is not merge approval.";
1533
1516
  var CI_WAIT_RECEIPT_INSTRUCTION = "End your turn to wait for CI; no marker is needed. " + CI_WAIT_LIMITATION;
1534
- var prPattern = /^https:\/\/[a-zA-Z0-9](?:[a-zA-Z0-9.-]*[a-zA-Z0-9])?(?::[0-9]+)?\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+\/pulls?\/[1-9][0-9]*$/;
1535
- var ciPrUrlSchema = z20.string().max(2048).regex(prPattern).refine(
1536
- (value) => pullRequestUrlParts(value) !== void 0,
1537
- "Expected an HTTPS PR URL with a positive integer PR number"
1538
- );
1517
+ var prPattern = /^https:\/\/([a-zA-Z0-9](?:[a-zA-Z0-9.-]*[a-zA-Z0-9])?)\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)\/pull\/([1-9][0-9]*)$/;
1518
+ var ciPrUrlSchema = z20.string().max(2048).regex(prPattern).refine((value) => {
1519
+ const match = prPattern.exec(value);
1520
+ return !!match && Number.isSafeInteger(Number(match[4])) && match[3] !== "." && match[3] !== "..";
1521
+ }, "Expected an HTTPS GitHub PR URL with a positive integer PR number");
1539
1522
  var prWaitUntilSchema = z20.enum(["checks", "merge", "merge_or_blocked"]);
1540
1523
  var prWaitChecksSchema = z20.enum(["required", "all"]);
1541
1524
  var ciWaitRequestSchema = z20.object({
@@ -2097,7 +2080,6 @@ function nextLineIndex(text, index) {
2097
2080
 
2098
2081
  // ../contract/src/runs.ts
2099
2082
  var archivePullRequestIdentitySchema = z23.object({
2100
- host: z23.string().min(1).optional(),
2101
2083
  owner: z23.string().min(1),
2102
2084
  repo: z23.string().min(1),
2103
2085
  number: z23.number().int().positive()
@@ -2187,16 +2169,11 @@ var runWorktreeSetupSchema = z23.object({
2187
2169
  /** One line: "`npm ci` exited 1", "`npm ci` timed out after 900s", "invalid config: …". */
2188
2170
  error: z23.string().optional()
2189
2171
  });
2190
- var SAVED_GITHUB_PULL_REQUEST_URL = /^https?:\/\/github\.com\/[a-z0-9_.-]+\/[a-z0-9_.-]+\/pull\/(\d+)\/?(?:[?#][^\s]*)?$/i;
2191
- function recordUrlNumber(url) {
2192
- const saved = SAVED_GITHUB_PULL_REQUEST_URL.exec(url);
2193
- return pullRequestUrlParts(url)?.number ?? (saved ? Number(saved[1]) : void 0);
2194
- }
2195
2172
  var runPullRequestSchema = z23.object({
2196
2173
  number: z23.number().int().positive().lt(1e7),
2197
- url: z23.string().refine((url) => recordUrlNumber(url) !== void 0, { message: "Expected a PR URL" }).optional(),
2174
+ url: z23.string().regex(/^https?:\/\/github\.com\/[a-z0-9_.-]+\/[a-z0-9_.-]+\/pull\/\d+\/?(?:[?#][^\s]*)?$/i).optional(),
2198
2175
  source: z23.enum(["declared", "created"])
2199
- }).refine((entry) => entry.url === void 0 || recordUrlNumber(entry.url) === entry.number, { message: "PR URL and number must agree" });
2176
+ }).refine((entry) => entry.url === void 0 || Number(/\/pull\/(\d+)/i.exec(entry.url)?.[1]) === entry.number, { message: "PR URL and number must agree" });
2200
2177
  var workflowCursorSchema = z23.object({ stepId: z23.string(), mode: z23.enum(["resume", "start"]) });
2201
2178
  var doneAcceptedSchema = z23.object({
2202
2179
  session: z23.string(),
@@ -3506,9 +3483,10 @@ var projectListEntrySchema = z26.object({
3506
3483
  status: z26.enum(["ok", "missing", "not-git"]),
3507
3484
  /** Current branch when cheaply available (omitted e.g. on an unborn HEAD). */
3508
3485
  branch: z26.string().optional(),
3509
- /** Which forge this project's remote belongs to (#698) — classified server-side from the
3510
- * remote URL alone. Gates the project group's GitHub nav item; omitted = no forge remote. */
3511
- forge: z26.literal("github").optional(),
3486
+ /** The forge id (`github`) of this project's remote (#698), classified server-side from the
3487
+ * remote URL alone. An open string, because a plugin can add a forge. Gates the project
3488
+ * group's GitHub nav item; omitted = no forge matches the remote. */
3489
+ forge: z26.string().min(1).optional(),
3512
3490
  /**
3513
3491
  * The remote's web root, `https://github.com/owner/repo`. Rebuilt server-side from the parsed
3514
3492
  * remote rather than passed through, so a remote carrying credentials cannot leak into the
@@ -6451,7 +6429,6 @@ export {
6451
6429
  CONVERSATION_PAGE_MESSAGES,
6452
6430
  DEFAULT_AGENT_ACCOUNT_ID,
6453
6431
  DEFAULT_CONVERSATION_REQUEST_SECONDS,
6454
- DEFAULT_PULL_REQUEST_HOST,
6455
6432
  DEFAULT_WEBHOOK_TRIGGERS,
6456
6433
  EFFORT_LEVELS,
6457
6434
  FILE_ATTACHMENT_MEDIA_TYPES,
@@ -6922,7 +6899,6 @@ export {
6922
6899
  providerStatusSchema,
6923
6900
  providersRequiredByWorkflow,
6924
6901
  publishedArtifactSchema,
6925
- pullRequestUrlParts,
6926
6902
  queryRunnerSchema,
6927
6903
  queryValue,
6928
6904
  queuedMessagePatchSchema,
@@ -64,7 +64,7 @@ export declare const projectListEntrySchema: z.ZodObject<{
64
64
  ok: "ok";
65
65
  }>;
66
66
  branch: z.ZodOptional<z.ZodString>;
67
- forge: z.ZodOptional<z.ZodLiteral<"github">>;
67
+ forge: z.ZodOptional<z.ZodString>;
68
68
  repoUrl: z.ZodOptional<z.ZodString>;
69
69
  maxParallel: z.ZodOptional<z.ZodNumber>;
70
70
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -125,7 +125,7 @@ export declare const projectsResponseSchema: z.ZodObject<{
125
125
  ok: "ok";
126
126
  }>;
127
127
  branch: z.ZodOptional<z.ZodString>;
128
- forge: z.ZodOptional<z.ZodLiteral<"github">>;
128
+ forge: z.ZodOptional<z.ZodString>;
129
129
  repoUrl: z.ZodOptional<z.ZodString>;
130
130
  maxParallel: z.ZodOptional<z.ZodNumber>;
131
131
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -191,7 +191,7 @@ export declare const registerProjectResponseSchema: z.ZodObject<{
191
191
  ok: "ok";
192
192
  }>;
193
193
  branch: z.ZodOptional<z.ZodString>;
194
- forge: z.ZodOptional<z.ZodLiteral<"github">>;
194
+ forge: z.ZodOptional<z.ZodString>;
195
195
  repoUrl: z.ZodOptional<z.ZodString>;
196
196
  maxParallel: z.ZodOptional<z.ZodNumber>;
197
197
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -265,7 +265,7 @@ export declare const updateProjectResponseSchema: z.ZodObject<{
265
265
  ok: "ok";
266
266
  }>;
267
267
  branch: z.ZodOptional<z.ZodString>;
268
- forge: z.ZodOptional<z.ZodLiteral<"github">>;
268
+ forge: z.ZodOptional<z.ZodString>;
269
269
  repoUrl: z.ZodOptional<z.ZodString>;
270
270
  maxParallel: z.ZodOptional<z.ZodNumber>;
271
271
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -392,7 +392,7 @@ export declare const projectWebhookResponseSchema: z.ZodObject<{
392
392
  ok: "ok";
393
393
  }>;
394
394
  branch: z.ZodOptional<z.ZodString>;
395
- forge: z.ZodOptional<z.ZodLiteral<"github">>;
395
+ forge: z.ZodOptional<z.ZodString>;
396
396
  repoUrl: z.ZodOptional<z.ZodString>;
397
397
  maxParallel: z.ZodOptional<z.ZodNumber>;
398
398
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -594,7 +594,7 @@ export declare const createProjectResponseSchema: z.ZodObject<{
594
594
  ok: "ok";
595
595
  }>;
596
596
  branch: z.ZodOptional<z.ZodString>;
597
- forge: z.ZodOptional<z.ZodLiteral<"github">>;
597
+ forge: z.ZodOptional<z.ZodString>;
598
598
  repoUrl: z.ZodOptional<z.ZodString>;
599
599
  maxParallel: z.ZodOptional<z.ZodNumber>;
600
600
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -19,19 +19,14 @@ export { runStatusSchema, type RunStatus, stepStatusSchema, type StepStatus, ste
19
19
  * keys. The client narrows on which key is present, and the DTO's flattened shape allowed
20
20
  * `{}` — a payload the route cannot produce.
21
21
  */
22
- /**
23
- * Canonical PR authority retained with an automatic archive receipt. A missing `host` means
24
- * `github.com`, so identities saved before hosts existed read unchanged (hearsay-tools/squawk#4472).
25
- */
22
+ /** Canonical GitHub authority retained with an automatic archive receipt. */
26
23
  export declare const archivePullRequestIdentitySchema: z.ZodObject<{
27
- host: z.ZodOptional<z.ZodString>;
28
24
  owner: z.ZodString;
29
25
  repo: z.ZodString;
30
26
  number: z.ZodNumber;
31
27
  }, z.core.$strip>;
32
28
  export type ArchivePullRequestIdentity = z.infer<typeof archivePullRequestIdentitySchema>;
33
29
  export declare const mergedPullRequestSchema: z.ZodObject<{
34
- host: z.ZodOptional<z.ZodString>;
35
30
  owner: z.ZodString;
36
31
  repo: z.ZodString;
37
32
  number: z.ZodNumber;
@@ -43,7 +38,6 @@ export declare const autoArchiveReceiptSchema: z.ZodObject<{
43
38
  archivedAt: z.ZodString;
44
39
  fingerprint: z.ZodString;
45
40
  pullRequests: z.ZodArray<z.ZodObject<{
46
- host: z.ZodOptional<z.ZodString>;
47
41
  owner: z.ZodString;
48
42
  repo: z.ZodString;
49
43
  number: z.ZodNumber;
@@ -2145,7 +2139,6 @@ export declare const runRecordSchema: z.ZodObject<{
2145
2139
  archivedAt: z.ZodString;
2146
2140
  fingerprint: z.ZodString;
2147
2141
  pullRequests: z.ZodArray<z.ZodObject<{
2148
- host: z.ZodOptional<z.ZodString>;
2149
2142
  owner: z.ZodString;
2150
2143
  repo: z.ZodString;
2151
2144
  number: z.ZodNumber;
@@ -4211,7 +4204,6 @@ export declare const apiRunSchema: z.ZodObject<{
4211
4204
  archivedAt: z.ZodString;
4212
4205
  fingerprint: z.ZodString;
4213
4206
  pullRequests: z.ZodArray<z.ZodObject<{
4214
- host: z.ZodOptional<z.ZodString>;
4215
4207
  owner: z.ZodString;
4216
4208
  repo: z.ZodString;
4217
4209
  number: z.ZodNumber;
@@ -7078,7 +7070,6 @@ export declare const createRunResponseSchema: z.ZodObject<{
7078
7070
  archivedAt: z.ZodString;
7079
7071
  fingerprint: z.ZodString;
7080
7072
  pullRequests: z.ZodArray<z.ZodObject<{
7081
- host: z.ZodOptional<z.ZodString>;
7082
7073
  owner: z.ZodString;
7083
7074
  repo: z.ZodString;
7084
7075
  number: z.ZodNumber;
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Forge registry (spec 2026-11-28-forge-plugin-seam, hearsay-tools/squawk#4471). Follows the
3
+ * register → seal → read lifecycle of `core/registry.ts`. A project's forge is the first
4
+ * definition, in registration order, whose `matchRemote` accepts the project's parsed remote.
5
+ * Built-in forges register first, then host plugins by folder name.
6
+ */
7
+ import type { GithubCommentsData } from '../contract/index.js';
8
+ import type { ArchivePullRequestIdentity, MergedPullRequest } from '../contract/index.js';
9
+ /** A git remote reduced to what a forge needs. `host` is lower case; an HTTP(S) host keeps a non-default port. */
10
+ export interface ForgeRemote {
11
+ host: string;
12
+ owner: string;
13
+ repo: string;
14
+ }
15
+ /** One pull request on one forge host. */
16
+ export interface ForgePullRequestIdentity extends ForgeRemote {
17
+ number: number;
18
+ }
19
+ export interface ForgeAvailability {
20
+ available: boolean;
21
+ /** Human-readable hint when unavailable. */
22
+ reason?: string;
23
+ }
24
+ export interface ForgePullRequest {
25
+ state: 'open' | 'closed' | 'merged';
26
+ headSha: string;
27
+ headRef: string;
28
+ baseRef: string;
29
+ /** ISO time of the merge, when merged. */
30
+ mergedAt?: string;
31
+ }
32
+ export type ForgeWebRefKind = 'repo' | 'issue' | 'pr' | 'branch' | 'commit';
33
+ export interface ForgeCreatePullRequestInput {
34
+ branch: string;
35
+ base?: string;
36
+ title: string;
37
+ body: string;
38
+ draft: boolean;
39
+ }
40
+ export type ForgeCreatePullRequestOutcome = {
41
+ ok: true;
42
+ url: string;
43
+ } | {
44
+ ok: false;
45
+ error: string;
46
+ };
47
+ /** The forge operations for one project's repository. `ForgeDefinition.open` returns it. */
48
+ export interface ForgeProjectClient {
49
+ /** Availability. Never throws. */
50
+ detect(): Promise<ForgeAvailability>;
51
+ /** Web URL of the repo, an issue, a PR, a branch or a commit; null when the forge cannot build one. */
52
+ webUrl(kind: ForgeWebRefKind, ref: string | number): string | null;
53
+ /** Create a PR after Squawk pushed `branch`. Never throws. */
54
+ createPullRequest(input: ForgeCreatePullRequestInput): Promise<ForgeCreatePullRequestOutcome>;
55
+ /** Comments and reviews of a PR in this repository, oldest first. */
56
+ pullRequestComments(number: number, options?: {
57
+ refresh?: boolean;
58
+ }): Promise<GithubCommentsData>;
59
+ }
60
+ /** What `SquawkPluginApi.registerForge` takes. One object serves every project of its forge. */
61
+ export interface ForgeDefinition {
62
+ /** Forge id, such as `github`. Health `forge.kind` and the project list's `forge` carry it. */
63
+ readonly id: string;
64
+ /** Display name. */
65
+ readonly label: string;
66
+ /** True when this forge serves the remote. Synchronous; a throw counts as no match. */
67
+ matchRemote(remote: ForgeRemote): boolean;
68
+ /** A PR web URL on this forge to its identity, or null. */
69
+ parsePullRequestUrl(url: string): ForgePullRequestIdentity | null;
70
+ /** The PR's web URL. */
71
+ pullRequestUrl(identity: ForgePullRequestIdentity): string;
72
+ readPullRequest(identity: ForgePullRequestIdentity, signal?: AbortSignal): Promise<ForgePullRequest>;
73
+ /** The merged PRs among `identities`. */
74
+ mergedPullRequests(identities: ArchivePullRequestIdentity[], signal: AbortSignal): Promise<MergedPullRequest[]>;
75
+ open(input: {
76
+ repoRoot: string;
77
+ remote: ForgeRemote;
78
+ }): ForgeProjectClient;
79
+ }
80
+ /** Throws what `registerForge` would throw, without writing. */
81
+ export declare function checkForgeRegistration(definition: ForgeDefinition): void;
82
+ export declare function registerForge(definition: ForgeDefinition): void;
83
+ export declare function sealForges(): void;
84
+ /** Whether the registry is sealed. Never throws. */
85
+ export declare function forgesSealed(): boolean;
86
+ /** Registered forges in registration order. Throws until sealed. */
87
+ export declare function registeredForges(): ForgeDefinition[];
88
+ /**
89
+ * Parse a git remote URL into host/owner/repo. Handles the scheme forms (`https://`, `ssh://`,
90
+ * `git://`, with optional credentials and port) and the scp-like form (`git@host:owner/repo.git`).
91
+ * An HTTP(S) host keeps a non-default port, because it names the web server; an SSH or git port
92
+ * does not. Null for local paths and anything else that does not look like a forge remote.
93
+ */
94
+ export declare function parseRemote(remote: string): ForgeRemote | null;
95
+ /**
96
+ * The forge of a remote: the first registered definition whose `matchRemote` returns true, with
97
+ * the parsed remote. Null for no remote, a remote that does not parse, or a remote no forge
98
+ * matches. Throws until the registry is sealed.
99
+ */
100
+ export declare function forgeForRemote(remote: string | undefined, warn?: (line: string) => void): {
101
+ forge: ForgeDefinition;
102
+ remote: ForgeRemote;
103
+ } | null;
104
+ /** The forge id of a remote, from the remote string alone. Null when no forge matches. */
105
+ export declare function forgeKindOfRemote(remote: string | undefined): string | null;
106
+ /**
107
+ * A remote's web root (`https://<host>/<owner>/<repo>`), or null when no forge matches.
108
+ *
109
+ * Built from the PARSED remote, never by string-editing the raw one: a remote may carry
110
+ * credentials (`https://user:token@github.com/o/r.git`), and the cockpit renders and links this
111
+ * value. Rebuilding it from `{host, owner, repo}` leaves nothing to leak.
112
+ */
113
+ export declare function forgeWebRoot(remote: string | undefined): string | null;
@@ -0,0 +1,127 @@
1
+ import { createKeyedRegistry } from './registry.js';
2
+ const DEFINITION_FUNCTIONS = ['matchRemote', 'parsePullRequestUrl', 'pullRequestUrl', 'readPullRequest', 'mergedPullRequests', 'open'];
3
+ const forges = createKeyedRegistry({
4
+ name: 'Forges',
5
+ bootHint: 'register every forge, then call sealForges() at the runtime boot boundary (boot.ts), or import a testkit that seals it.',
6
+ });
7
+ function checkShape(definition) {
8
+ if (typeof definition !== 'object' || definition === null)
9
+ throw new Error('Forges: a forge definition must be an object.');
10
+ if (typeof definition.id !== 'string' || definition.id.length === 0)
11
+ throw new Error(`Forges: invalid id ${JSON.stringify(definition.id)}.`);
12
+ if (typeof definition.label !== 'string' || definition.label.length === 0)
13
+ throw new Error(`Forges: '${definition.id}' needs a label.`);
14
+ for (const member of DEFINITION_FUNCTIONS) {
15
+ if (typeof definition[member] !== 'function')
16
+ throw new Error(`Forges: '${definition.id}' ${member} must be a function.`);
17
+ }
18
+ if (definition.matchRemote.constructor?.name === 'AsyncFunction')
19
+ throw new Error(`Forges: '${definition.id}' matchRemote must be synchronous.`);
20
+ }
21
+ /** Throws what `registerForge` would throw, without writing. */
22
+ export function checkForgeRegistration(definition) {
23
+ checkShape(definition);
24
+ forges.check(definition.id, definition);
25
+ }
26
+ export function registerForge(definition) {
27
+ checkForgeRegistration(definition);
28
+ forges.register(definition.id, definition);
29
+ }
30
+ export function sealForges() { forges.seal(); }
31
+ /** Whether the registry is sealed. Never throws. */
32
+ export function forgesSealed() { return forges.isSealed(); }
33
+ /** Registered forges in registration order. Throws until sealed. */
34
+ export function registeredForges() { return forges.values(); }
35
+ const DEFAULT_PORTS = { http: '80', https: '443' };
36
+ /**
37
+ * Parse a git remote URL into host/owner/repo. Handles the scheme forms (`https://`, `ssh://`,
38
+ * `git://`, with optional credentials and port) and the scp-like form (`git@host:owner/repo.git`).
39
+ * An HTTP(S) host keeps a non-default port, because it names the web server; an SSH or git port
40
+ * does not. Null for local paths and anything else that does not look like a forge remote.
41
+ */
42
+ export function parseRemote(remote) {
43
+ const r = remote.trim().replace(/\/+$/, '');
44
+ let host;
45
+ let path;
46
+ const url = /^(https?|ssh|git|git\+ssh):\/\/(?:[^@/]+@)?([^/:]+)(?::(\d+))?\/(.+)$/i.exec(r);
47
+ if (url) {
48
+ const [, scheme, name, port, rest] = url;
49
+ const web = scheme.toLowerCase();
50
+ host = port && DEFAULT_PORTS[web] !== undefined && DEFAULT_PORTS[web] !== port ? `${name}:${port}` : name;
51
+ path = rest;
52
+ }
53
+ else {
54
+ // scp-like: [user@]host:owner/repo(.git) — a leading '/' (local path)
55
+ // can't match the host group, so plain directories fall through to null.
56
+ const scp = /^(?:[^@/:]+@)?([^:/]+):(.+)$/.exec(r);
57
+ if (!scp)
58
+ return null;
59
+ [, host, path] = scp;
60
+ }
61
+ if (!host || !path)
62
+ return null;
63
+ const parts = path.replace(/\.git$/i, '').split('/').filter(Boolean);
64
+ const owner = parts[parts.length - 2];
65
+ const repo = parts[parts.length - 1];
66
+ if (!owner || !repo)
67
+ return null;
68
+ return { host: host.toLowerCase(), owner, repo };
69
+ }
70
+ /** Forges whose `matchRemote` threw once: each warns one time per process. */
71
+ const warnedForges = new Set();
72
+ function errorText(error) {
73
+ if (error instanceof Error)
74
+ return error.message;
75
+ try {
76
+ return String(error);
77
+ }
78
+ catch {
79
+ return 'a thrown value with no string form';
80
+ }
81
+ }
82
+ function matches(definition, remote, warn) {
83
+ try {
84
+ const value = definition.matchRemote(remote);
85
+ if ((typeof value === 'object' || typeof value === 'function') && value !== null && typeof value.then === 'function') {
86
+ // A promise is not an answer; consume its rejection so it cannot end the process.
87
+ void Promise.resolve(value).catch(() => undefined);
88
+ throw new Error('matchRemote must be synchronous');
89
+ }
90
+ return value === true;
91
+ }
92
+ catch (error) {
93
+ if (warnedForges.has(definition))
94
+ return false;
95
+ warnedForges.add(definition);
96
+ warn(`[hsq] forge '${definition.id}' matchRemote threw (${errorText(error)}) — treated as no match`);
97
+ return false;
98
+ }
99
+ }
100
+ /**
101
+ * The forge of a remote: the first registered definition whose `matchRemote` returns true, with
102
+ * the parsed remote. Null for no remote, a remote that does not parse, or a remote no forge
103
+ * matches. Throws until the registry is sealed.
104
+ */
105
+ export function forgeForRemote(remote, warn = line => console.error(line)) {
106
+ const parsed = remote ? parseRemote(remote) : null;
107
+ if (!parsed)
108
+ return null;
109
+ const forge = registeredForges().find(definition => matches(definition, parsed, warn));
110
+ return forge ? { forge, remote: parsed } : null;
111
+ }
112
+ /** The forge id of a remote, from the remote string alone. Null when no forge matches. */
113
+ export function forgeKindOfRemote(remote) {
114
+ return forgeForRemote(remote)?.forge.id ?? null;
115
+ }
116
+ /**
117
+ * A remote's web root (`https://<host>/<owner>/<repo>`), or null when no forge matches.
118
+ *
119
+ * Built from the PARSED remote, never by string-editing the raw one: a remote may carry
120
+ * credentials (`https://user:token@github.com/o/r.git`), and the cockpit renders and links this
121
+ * value. Rebuilding it from `{host, owner, repo}` leaves nothing to leak.
122
+ */
123
+ export function forgeWebRoot(remote) {
124
+ const match = forgeForRemote(remote);
125
+ return match ? `https://${match.remote.host}/${match.remote.owner}/${match.remote.repo}` : null;
126
+ }
127
+ //# sourceMappingURL=forge-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forge-registry.js","sourceRoot":"","sources":["../../src/core/forge-registry.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAuEpD,MAAM,oBAAoB,GAAG,CAAC,aAAa,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,CAAU,CAAC;AAEhJ,MAAM,MAAM,GAAG,mBAAmB,CAA0B;IAC1D,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,yHAAyH;CACpI,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,UAA2B;IAC7C,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAC5H,IAAI,OAAO,UAAU,CAAC,EAAE,KAAK,QAAQ,IAAI,UAAU,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC7I,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,UAAU,CAAC,EAAE,kBAAkB,CAAC,CAAC;IACxI,KAAK,MAAM,MAA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C,IAAI,CAAC;IAE1D,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IACvF,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,iBAAiB,CAAC,MAA0B;IAC1D,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO,KAAK,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAClG,CAAC"}
@@ -247,13 +247,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
247
247
  status: 200;
248
248
  input: {
249
249
  json: {
250
- requestIds: string[];
251
- mode?: "all" | "any" | "one" | undefined;
252
- timeoutSeconds?: number | undefined;
253
- } | {
254
250
  workerIds: string[];
255
251
  timeoutSeconds?: number | undefined;
256
252
  mode?: "all" | "any" | "one" | undefined;
253
+ } | {
254
+ requestIds: string[];
255
+ mode?: "all" | "any" | "one" | undefined;
256
+ timeoutSeconds?: number | undefined;
257
257
  } | {
258
258
  peerIds: string[];
259
259
  timeoutSeconds?: number | undefined;