opencode-swarm 7.184.16 → 7.185.0

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 (106) hide show
  1. package/README.md +1 -0
  2. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  3. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  4. package/dist/background/pr-subscriptions.d.ts +18 -0
  5. package/dist/background/stage-b-dispatch-binding-store.d.ts +115 -0
  6. package/dist/cli/{auto-checkpoint-dccr5m5w.js → auto-checkpoint-adn8bg66.js} +7 -7
  7. package/dist/cli/{checkpoint-sntn9axf.js → checkpoint-dvyx8gee.js} +14 -14
  8. package/dist/cli/{coder-settlement-wvesf12p.js → coder-settlement-95dv9r28.js} +10 -10
  9. package/dist/cli/{config-doctor-2kf93041.js → config-doctor-f2jtx8y5.js} +2 -2
  10. package/dist/cli/{core-27f3zcnn.js → core-xn2epqfk.js} +3 -3
  11. package/dist/cli/{curation-policy-1rzheh1x.js → curation-policy-swnyg1jr.js} +4 -4
  12. package/dist/cli/{curator-26a9vxkj.js → curator-91rqz7xg.js} +39 -39
  13. package/dist/cli/{curator-drift-dcysavga.js → curator-drift-qem70sry.js} +8 -8
  14. package/dist/cli/curator-llm-factory-tr6rabws.js +81 -0
  15. package/dist/cli/{evidence-summary-service-7t4xgh9q.js → evidence-summary-service-n7ndpen0.js} +17 -17
  16. package/dist/cli/{gate-evidence-44ydv262.js → gate-evidence-ajh95p02.js} +5 -5
  17. package/dist/cli/guardrail-explain-cne2701m.js +82 -0
  18. package/dist/cli/{guardrail-log-ybxh0ama.js → guardrail-log-b23sf549.js} +6 -6
  19. package/dist/cli/{guardrail-reset-qx2nx56s.js → guardrail-reset-e6njf0hv.js} +39 -39
  20. package/dist/cli/{hive-promoter-hkzhaeyc.js → hive-promoter-8dqvfwsx.js} +39 -39
  21. package/dist/cli/{index-7r3pkgma.js → index-1zpgtnhp.js} +1 -1
  22. package/dist/cli/{index-7m4zf48w.js → index-26nhk01d.js} +1 -1
  23. package/dist/cli/{index-6dgghy8n.js → index-2e7h9yw5.js} +5 -5
  24. package/dist/cli/{index-gvnsfcj0.js → index-2tv5zp9x.js} +7 -7
  25. package/dist/cli/{index-8y9aq9f6.js → index-359w27b1.js} +4 -4
  26. package/dist/cli/{index-m1pqenq9.js → index-3fnpjy4g.js} +2 -2
  27. package/dist/cli/{index-v9ynrcst.js → index-4ysdy8sx.js} +4 -4
  28. package/dist/cli/{index-bntwj2tp.js → index-580t912d.js} +2 -1
  29. package/dist/cli/{index-jtg0zsnx.js → index-62z1vsvf.js} +1 -1
  30. package/dist/cli/{index-8pmx61z1.js → index-6wy9m25t.js} +10 -10
  31. package/dist/cli/{index-marmy421.js → index-73vnyt4b.js} +39 -39
  32. package/dist/cli/{index-cftva3pa.js → index-7jqnckzg.js} +1 -1
  33. package/dist/cli/{index-fxf3zhtq.js → index-97nbaxye.js} +1 -1
  34. package/dist/cli/{index-n5z3d8nc.js → index-9am1ry6w.js} +7 -7
  35. package/dist/cli/{index-a9cajj7y.js → index-cah5ffkh.js} +5 -5
  36. package/dist/cli/{index-ctd0xa67.js → index-djen6c7q.js} +1 -1
  37. package/dist/cli/{index-e2a3evhm.js → index-e5wczpj3.js} +2 -2
  38. package/dist/cli/{index-6h55yp6c.js → index-erv39311.js} +2 -2
  39. package/dist/cli/{index-kvd6jbzr.js → index-f3grtpy3.js} +3 -3
  40. package/dist/cli/{index-dggrcd8z.js → index-fkzv0hj4.js} +41 -41
  41. package/dist/cli/{index-rmr36a5k.js → index-fmxty2h3.js} +2 -2
  42. package/dist/cli/{index-7rzgdcvc.js → index-gemq38en.js} +1 -1
  43. package/dist/cli/{index-df845cwk.js → index-gxjy9y0t.js} +2 -2
  44. package/dist/cli/{index-2y9b45jj.js → index-h5f5q60s.js} +1 -1
  45. package/dist/cli/{index-rnqfz57d.js → index-hx9vyvx0.js} +3 -3
  46. package/dist/cli/{index-8gxb2xxe.js → index-m7g4dsr4.js} +5 -5
  47. package/dist/cli/{index-6drqsy4n.js → index-n0wyd905.js} +3 -3
  48. package/dist/cli/{index-yx5z4200.js → index-p544ppcp.js} +1 -1
  49. package/dist/cli/{index-jns2mnbz.js → index-qccnny3g.js} +3 -3
  50. package/dist/cli/{index-tyzmjw2s.js → index-qqjqpmhj.js} +420 -9
  51. package/dist/cli/{index-r2nr4qxg.js → index-rcx4kb02.js} +4 -4
  52. package/dist/cli/{index-g4d1d91p.js → index-rp0pyywc.js} +7 -7
  53. package/dist/cli/{index-9grg5gr3.js → index-s0c1wxtt.js} +1 -1
  54. package/dist/cli/{index-pwcbtbhd.js → index-s5xmvt3k.js} +1 -1
  55. package/dist/cli/{index-mfqge140.js → index-sz755xt1.js} +1 -1
  56. package/dist/cli/{index-dftztz4y.js → index-t9jr6zc7.js} +1 -1
  57. package/dist/cli/{index-tzrbeas0.js → index-tmd5j8kh.js} +4 -4
  58. package/dist/cli/{index-mdkydrnr.js → index-v5k5jw0r.js} +2 -2
  59. package/dist/cli/{index-fzen7z3b.js → index-vfr3z9rv.js} +5 -1
  60. package/dist/cli/{index-b3q241ze.js → index-w7sftxdy.js} +8 -3
  61. package/dist/cli/{index-yydv4jfy.js → index-yg15df3b.js} +2 -2
  62. package/dist/cli/{index-2fc9ecr0.js → index-zkm995wa.js} +4222 -3674
  63. package/dist/cli/{index-v2v8gdvy.js → index-zxm9h19f.js} +3 -3
  64. package/dist/cli/{index-4g4sr4ah.js → index-zyz0xp2b.js} +1 -1
  65. package/dist/cli/index.js +40 -40
  66. package/dist/cli/{knowledge-escalator-ebr3rw8e.js → knowledge-escalator-xdz6vg62.js} +11 -11
  67. package/dist/cli/{knowledge-events-bw9en61p.js → knowledge-events-dnca00ye.js} +9 -9
  68. package/dist/cli/{knowledge-link-vvyfhhmr.js → knowledge-link-y653vvr8.js} +3 -3
  69. package/dist/cli/{knowledge-store-z9y0rn82.js → knowledge-store-yc20na25.js} +4 -4
  70. package/dist/cli/{knowledge-validator-p1zxa4rp.js → knowledge-validator-c2kfrqdy.js} +6 -6
  71. package/dist/cli/{mcp-qtqcdjj3.js → mcp-mefjep3p.js} +1 -1
  72. package/dist/cli/{model-preflight-fz3dh7wj.js → model-preflight-5xcxc75n.js} +39 -39
  73. package/dist/cli/{pending-delegations-69kt91zp.js → pending-delegations-emhmdkn4.js} +10 -10
  74. package/dist/cli/{pr-subscriptions-yjwfaaqk.js → pr-subscriptions-amc1z05d.js} +10 -10
  75. package/dist/cli/{pr-workflow-gate-6wft8t65.js → pr-workflow-gate-gpq41zx9.js} +41 -39
  76. package/dist/cli/{runner-cwmgb9rw.js → runner-ss88pbb2.js} +4 -4
  77. package/dist/cli/{scan-cursor-srmwyzgp.js → scan-cursor-71gq82ez.js} +5 -5
  78. package/dist/cli/{schema-ks83tpk5.js → schema-108trhk6.js} +3 -1
  79. package/dist/cli/{scope-persistence-68sf3zbq.js → scope-persistence-9gfgvy3p.js} +13 -13
  80. package/dist/cli/{server-e9r2796f.js → server-pkk6y7fa.js} +39 -39
  81. package/dist/cli/{skill-generator-8em4gnwh.js → skill-generator-7g6xjwhr.js} +13 -13
  82. package/dist/cli/{snapshot-coordination-init-s1q9h6ex.js → snapshot-coordination-init-pactfmsy.js} +39 -39
  83. package/dist/cli/{speckit-checkoff-t2msmjh2.js → speckit-checkoff-xyp4c36r.js} +4 -4
  84. package/dist/cli/{workspace-snapshot-gnwak61t.js → workspace-snapshot-0hffyjhd.js} +3 -3
  85. package/dist/cli/{worktree-collision-ownership-r5p156gs.js → worktree-collision-ownership-g26m4c10.js} +11 -11
  86. package/dist/cli/{worktree-isolation-9x2vs2ym.js → worktree-isolation-52529c62.js} +39 -39
  87. package/dist/commands/_shared/url-security.d.ts +20 -9
  88. package/dist/commands/pr-ref.d.ts +44 -8
  89. package/dist/commands/pr-subscribe.d.ts +0 -8
  90. package/dist/commands/pr-unsubscribe.d.ts +2 -1
  91. package/dist/config/schema.d.ts +17 -0
  92. package/dist/config/skill-contract-digest.d.ts +20 -0
  93. package/dist/hooks/delegation-gate.d.ts +5 -1
  94. package/dist/hooks/pr-auto-subscribe.d.ts +5 -4
  95. package/dist/hooks/pr-workflow-gate.d.ts +387 -0
  96. package/dist/hooks/pr-workflow-response-gate.d.ts +2 -0
  97. package/dist/index.js +591 -585
  98. package/dist/providers/forge-provider.d.ts +167 -0
  99. package/dist/providers/host-guards.d.ts +31 -0
  100. package/dist/services/pr-workflow-skill-contract.d.ts +45 -0
  101. package/dist/utils/gh-executable.d.ts +10 -0
  102. package/dist/utils/glab-executable.d.ts +85 -0
  103. package/opencode-swarm.schema.json +19 -0
  104. package/package.json +1 -1
  105. package/dist/cli/curator-llm-factory-tq54zhpw.js +0 -81
  106. package/dist/cli/guardrail-explain-00zvh1zq.js +0 -82
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Forge provider core (issue #2733): the provider model that makes GitLab a
3
+ * first-class forge alongside GitHub for the PR/issue command surface.
4
+ *
5
+ * This module is the SINGLE source of truth for provider-specific facts that
6
+ * were previously hardcoded inline at every integration point (see the trace
7
+ * localization log for the six duplicated validators it replaces):
8
+ *
9
+ * - which hosts indicate which provider (`detectForgeFromUrl`)
10
+ * - how a git remote maps to provider + host + owner/repo
11
+ * (`parseForgeRemoteUrl`; GitLab owners may be nested namespace paths)
12
+ * - how canonical PR/MR and issue URLs are built (`buildPrUrl`/`buildIssueUrl`)
13
+ * - how a PR URL canonicalizes for identity matching (`canonicalForgePrUrl`,
14
+ * a drop-in for the four module-local `canonicalGitHubPrUrl` copies)
15
+ * - how an explicit provider/base_url configuration plus the observed git
16
+ * remotes resolve to a provider context (`resolveProviderSelection`,
17
+ * fail-closed on ambiguity)
18
+ * - which GitHub-synthesized fields a provider can serve
19
+ * (`getProviderCapabilities` — honest "unavailable" reporting; GitLab's MR
20
+ * API does not synthesize statusCheckRollup/reviewDecision/mergeStateStatus)
21
+ *
22
+ * Shape detection is CONFIG-FREE for the well-known hosts: github.com →
23
+ * github; gitlab.com and any host whose first label is `gitlab` → gitlab with
24
+ * that host. Every other host is generic and requires an explicit configured
25
+ * context (`resolveProviderSelection`); it is never silently assumed.
26
+ *
27
+ * Security note: every guard applied to GitHub URLs applies here unchanged —
28
+ * HTTPS-only, private/localhost-host rejection, IDN (non-ASCII) host
29
+ * rejection, control-character rejection — via the shared guards in
30
+ * `./host-guards.ts` (the same implementation url-security.ts re-exports).
31
+ * The `base_url` override is NOT a trust whitelist: it passes through the
32
+ * same guards and never bypasses one.
33
+ */
34
+ export type ForgeProviderId = 'github' | 'gitlab';
35
+ /** Canonical web host, lowercase (e.g. 'github.com', 'gitlab.internal.example.com'). */
36
+ export interface ForgeContext {
37
+ provider: ForgeProviderId;
38
+ host: string;
39
+ }
40
+ export interface ForgeRemote extends ForgeContext {
41
+ owner: string;
42
+ repo: string;
43
+ }
44
+ export interface ForgeResourceRef extends ForgeContext {
45
+ owner: string;
46
+ repo: string;
47
+ number: number;
48
+ }
49
+ export interface ProviderSelectionInput {
50
+ config?: {
51
+ provider?: 'github' | 'gitlab' | 'auto';
52
+ /** camelCase form (frozen-check binding). */
53
+ baseUrl?: string;
54
+ /** snake_case form — the plugin config schema key (`forge.base_url`). */
55
+ base_url?: string;
56
+ };
57
+ remotes: string[];
58
+ }
59
+ export type ProviderSelection = {
60
+ ok: true;
61
+ context: ForgeContext;
62
+ } | {
63
+ ok: false;
64
+ error: string;
65
+ };
66
+ /** Fields GitHub's `gh pr view` synthesizes and GitLab's MR API does not. */
67
+ export interface ForgeCapabilities {
68
+ statusCheckRollup: boolean;
69
+ reviewDecision: boolean;
70
+ mergeStateStatus: boolean;
71
+ }
72
+ export declare const GITHUB_CANONICAL_HOST = "github.com";
73
+ export declare const GITLAB_PUBLIC_HOST = "gitlab.com";
74
+ /**
75
+ * Hosts whose first DNS label is exactly `gitlab` (gitlab.com,
76
+ * gitlab.example.com). The remainder must be a syntactically plausible
77
+ * hostname: non-empty, no empty labels (`gitlab..com`), no bare trailing dot
78
+ * (`gitlab.`), and no leading digit violation on the next label.
79
+ */
80
+ export declare function isGitLabIndicatingHost(host: string): boolean;
81
+ /**
82
+ * True when the URL string is a canonical PR URL of either provider shape.
83
+ * A `configured` context (declared via `forge.base_url`) additionally
84
+ * authorizes exactly that generic self-hosted GitLab host — every guard in
85
+ * canonicalForgePrUrl still applies to the URL itself.
86
+ */
87
+ export declare function isForgePrUrl(url: string, configured?: ForgeContext): boolean;
88
+ /**
89
+ * Shape-based provider detection from any https URL. github.com → github;
90
+ * gitlab.com or a `gitlab.`-prefixed host → gitlab with that host; anything
91
+ * else → null unless the host matches a `configured` context (issue #2733:
92
+ * `forge.base_url` declares a generic self-hosted GitLab instance, and the
93
+ * declared host is then authorized exactly as gitlab.com is — it is NOT a
94
+ * trust whitelist: every URL guard still applies).
95
+ */
96
+ export declare function detectForgeFromUrl(url: string, configured?: ForgeContext): ForgeContext | null;
97
+ /**
98
+ * Match a resource URL (`resource: 'pull'` matches GitHub `/pull/N` and GitLab
99
+ * `/-/merge_requests/N`; `'issues'` matches `/issues/N` and `/-/issues/N`).
100
+ * Returns the provider context plus owner/repo/number, or null when the URL
101
+ * is not a well-formed resource URL of a recognized provider host. Owner may
102
+ * be a multi-segment namespace path for GitLab. The input must already be
103
+ * sanitized (query/fragment/credentials stripped) by the caller.
104
+ */
105
+ export declare function matchForgeResourceUrl(url: string, resource: 'issues' | 'pull', configured?: ForgeContext): ForgeResourceRef | null;
106
+ /**
107
+ * Host-aware git-remote parsing (HTTPS and SSH scp forms). GitLab owners may
108
+ * be nested namespace paths (`group/subgroup/repo` → owner `group/subgroup`);
109
+ * the host is preserved and lowercased. Generic hosts return null — unlike
110
+ * url-security's legacy `parseGitRemoteUrl` path fallback (kept for GHE/proxy
111
+ * bare-number resolution), this function never guesses a provider.
112
+ */
113
+ export declare function parseForgeRemoteUrl(remoteUrl: string): ForgeRemote | null;
114
+ /** Build the canonical PR/MR URL for a provider context. */
115
+ export declare function buildPrUrl(ctx: ForgeContext, owner: string, repo: string, number: number): string;
116
+ /** Build the canonical issue URL for a provider context. */
117
+ export declare function buildIssueUrl(ctx: ForgeContext, owner: string, repo: string, number: number): string;
118
+ /**
119
+ * Canonical scheme-less lowercase PR/MR URL for identity matching — the
120
+ * provider-aware replacement for the four duplicated `canonicalGitHubPrUrl`
121
+ * implementations (github output is byte-identical: host and owner/repo
122
+ * lowercased, trailing slash dropped). Null for anything that is not an
123
+ * https PR/MR URL of a recognized provider host.
124
+ */
125
+ export declare function canonicalForgePrUrl(value: string, configured?: ForgeContext): string | null;
126
+ /**
127
+ * Honest capability reporting. GitHub's `gh pr view` synthesizes these three
128
+ * fields; GitLab's MR API does not provide equivalents, so consumers must
129
+ * surface an explicit "not supported / unavailable" marker instead of
130
+ * fabricating or substituting a value (issue #2733 AC7).
131
+ */
132
+ export declare function getProviderCapabilities(provider: ForgeProviderId): ForgeCapabilities;
133
+ /**
134
+ * Production adapter: resolve the active forge context from the plugin
135
+ * config's `forge` section (schema keys: provider, base_url) plus the
136
+ * observed git remotes. Returns null when no context can be determined —
137
+ * callers fall back to config-free shape detection (GitHub behavior
138
+ * unchanged). Used lazily by the command surface ONLY when shape detection
139
+ * cannot answer (generic-host URLs / ambiguous bare numbers), so ordinary
140
+ * GitHub usage performs zero extra I/O.
141
+ */
142
+ export declare function resolveForgeContextFromPluginConfig(pluginConfig: {
143
+ forge?: {
144
+ provider?: string;
145
+ base_url?: string;
146
+ };
147
+ } | undefined, remotes: string[]): ForgeContext | null;
148
+ /**
149
+ * Resolve the active provider context from explicit configuration plus the
150
+ * observed git remotes. FAIL-CLOSED on ambiguity — a mixed/generic/empty
151
+ * remote set never silently assumes a provider.
152
+ *
153
+ * Rules (frozen by acceptance checks C3/C4):
154
+ * 1. A configured `baseUrl` runs through the same guards as any forge URL
155
+ * (HTTPS-only, non-private, ASCII host) and is stripped to its host; a
156
+ * failing baseUrl is a configuration error, not a fallback trigger.
157
+ * 2. Explicit `provider: 'github'` selects github.com; combining it with a
158
+ * `baseUrl` is a configuration conflict (GitHub's base is fixed).
159
+ * 3. Explicit `provider: 'gitlab'` takes its host from a valid `baseUrl`,
160
+ * else from a unanimously GitLab-indicating remote set — never assumes
161
+ * gitlab.com; without either it fails closed.
162
+ * 4. `provider: 'auto'` (the default): a valid `baseUrl` selects gitlab with
163
+ * that host (a baseUrl is itself an explicit instance declaration);
164
+ * otherwise unanimous github remotes → github, a unanimous single-host
165
+ * GitLab-indicating remote set → gitlab, and anything else fails closed.
166
+ */
167
+ export declare function resolveProviderSelection(input: ProviderSelectionInput): ProviderSelection;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared host/URL-component guards for forge-provider URL validation
3
+ * (issue #2733).
4
+ *
5
+ * Extracted verbatim from `src/commands/_shared/url-security.ts` so the
6
+ * provider layer can apply the identical private-host, IPv4-mapped-private,
7
+ * zero-network, IDN-homograph, and control-character guards WITHOUT a
8
+ * circular import (url-security imports the forge shape matcher; the forge
9
+ * layer imports these leaf guards). url-security re-exports its previous
10
+ * public surface from here, so its API is unchanged.
11
+ */
12
+ /** True when any code point is a C0/DEL control character. */
13
+ export declare function containsControlCharacters(value: string): boolean;
14
+ /**
15
+ * Returns true if the hostname contains any non-ASCII code point (IDN
16
+ * homograph protection).
17
+ */
18
+ export declare function hasNonAsciiHostname(hostname: string): boolean;
19
+ export declare function isIpv4MappedPrivateHost(inner: string): boolean;
20
+ /**
21
+ * Blocklist of private/localhost hostnames and IP ranges.
22
+ */
23
+ export declare function isPrivateHost(url: URL): boolean;
24
+ /**
25
+ * True when any DNS label is a punycode label (xn--…). The WHATWG URL parser
26
+ * silently converts non-ASCII (IDN) hosts to punycode, so a raw non-ASCII scan
27
+ * on `url.hostname` cannot detect them; rejecting punycode labels is how the
28
+ * IDN-homograph policy stays enforceable post-parse (issue #2733).
29
+ */
30
+ export declare function hasPunycodeLabel(host: string): boolean;
31
+ export declare function isIPv4ZeroNetwork(host: string): boolean;
@@ -0,0 +1,45 @@
1
+ import type { PrWorkflowMode } from '../hooks/pr-workflow-gate.js';
2
+ /** Stamped skill owning each mode's runtime protocol. */
3
+ export declare const PR_WORKFLOW_MODE_SKILL: Record<PrWorkflowMode, string>;
4
+ /** Activation budget mirrors the init-time sync ceiling (src/index.ts). */
5
+ export declare const SKILL_CONTRACT_ACTIVATION_BUDGET_MS = 2000;
6
+ /**
7
+ * Wake budget is tighter: the wake path also owes the continuation prompt
8
+ * inside its existing wakeTimeoutMs/boundaryWatchdogMs envelopes.
9
+ */
10
+ export declare const SKILL_CONTRACT_WAKE_BUDGET_MS = 750;
11
+ /**
12
+ * Shared advisory cap: the service's return bound, the gate-state schema's
13
+ * `.max()`, and the append guard all derive from this one constant (a desync
14
+ * would make the CAS writer's parse throw and silently drop advisories).
15
+ */
16
+ export declare const MAX_SKILL_CONTRACT_ADVISORIES = 8;
17
+ /**
18
+ * Nearest ancestor of `startDir` containing a package.json, bounded walk.
19
+ *
20
+ * Module-relative `'..'` arithmetic is NOT bundle-safe (Copilot review on
21
+ * PR #2875): this module is inlined into `dist/index.js` by the plugin
22
+ * build, so at runtime `import.meta.url` points ONE level below the package
23
+ * root (`dist/`), while in source form it sits two levels deep
24
+ * (`src/services/`). Walking up to the nearest package.json yields the
25
+ * package root in both layouts.
26
+ */
27
+ export declare function nearestPackageRootFrom(startDir: string): string | undefined;
28
+ /**
29
+ * Test seams (AGENTS.md invariant 7: `_internals` DI over `mock.module`).
30
+ * Restore in afterEach; see the sibling precedents in bundled-skills.ts.
31
+ */
32
+ export declare const _internals: {
33
+ resolvePackageRoot: () => string;
34
+ resolveUserGlobalHome: () => string;
35
+ syncBundled: (projectDirectory: string, packageRoot: string, quiet: boolean) => Promise<void>;
36
+ };
37
+ /**
38
+ * Verify the mode's stamped skill copies against the shipped canonical and
39
+ * heal the bundled copy. Returns actionable advisories (also routed through
40
+ * `advisoryWarn`); [] on a clean host. Fail-open: any internal error becomes
41
+ * a single advisory and never throws.
42
+ */
43
+ export declare function ensurePrWorkflowSkillContractsFresh(directory: string, mode: PrWorkflowMode, options?: {
44
+ budgetMs?: number;
45
+ }): Promise<string[]>;
@@ -49,6 +49,16 @@
49
49
  import { spawnSync } from 'node:child_process';
50
50
  /** Env var escape hatch — a blocked user can set this without editing files. */
51
51
  export declare const GH_BINARY_ENV_VAR = "OPENCODE_SWARM_GH_BINARY";
52
+ declare const PER_PROBE_TIMEOUT_MS = 250;
53
+ declare const TOTAL_BUDGET_MS = 1000;
54
+ declare const NEGATIVE_CACHE_TTL_MS = 60000;
55
+ /**
56
+ * Budget/TTL constants exported for the gh↔glab resolver parity ratchet
57
+ * (tests/unit/utils/forge-executable-parity.test.ts, issue #2733): the glab
58
+ * twin must track the gh hardening, and the ratchet enforces identical probe
59
+ * bounds so a future gh hardening cannot land without its glab mirror.
60
+ */
61
+ export { PER_PROBE_TIMEOUT_MS, TOTAL_BUDGET_MS, NEGATIVE_CACHE_TTL_MS };
52
62
  /**
53
63
  * `gh --version` prints `gh version 2.74.0 (2025-...)` — a fixed format
54
64
  * string in gh's own root command. Same accident-not-attacker contract as
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Single source of truth for "what absolute path do we invoke for glab" — the
3
+ * glab twin of `src/utils/gh-executable.ts` (issue #2733, GitLab provider).
4
+ *
5
+ * Built to the SAME contract as the gh resolver (the maintainer-verified shape
6
+ * for this feature, and issue #2262/#2476's hardening for gh):
7
+ *
8
+ * 1. explicit override — the `OPENCODE_SWARM_GLAB_BINARY` env var ONLY
9
+ * (no config-file key; env-only keeps every override user-controlled);
10
+ * 2. platform absolute candidates first;
11
+ * 3. ALL PATH matches for `glab` (win32: `.exe`/`.cmd`/`.bat` variants);
12
+ * 4. bare `'glab'` LAST, unprobed.
13
+ *
14
+ * Each non-bare candidate must be ABSOLUTE and is validated once with
15
+ * `glab --version` whose output must match GLAB_VERSION_PATTERN
16
+ * (`glab version 1.65.0 (...)` — https://docs.gitlab.com/cli). Same
17
+ * accident-not-attacker contract as the gh probe.
18
+ *
19
+ * Bounded probing mirrors gh exactly (enforced by
20
+ * tests/unit/utils/forge-executable-parity.test.ts): per-probe timeout 250 ms,
21
+ * total first-resolution budget 1000 ms, negative-cache TTL 60 s. Resolution
22
+ * is LAZY (never plugin init) and NEVER throws — both non-accepting outcomes
23
+ * return the bare `'glab'` fallback so a host that works via plain PATH
24
+ * lookup never regresses. The probe/candidate machinery is one
25
+ * parameterized core so the glab twin cannot silently drift from the gh
26
+ * discipline it must track.
27
+ */
28
+ import { spawnSync } from 'node:child_process';
29
+ /** Env var escape hatch — a blocked user can set this without editing files. */
30
+ export declare const GLAB_BINARY_ENV_VAR = "OPENCODE_SWARM_GLAB_BINARY";
31
+ export declare const PER_PROBE_TIMEOUT_MS = 250;
32
+ export declare const TOTAL_BUDGET_MS = 1000;
33
+ export declare const NEGATIVE_CACHE_TTL_MS = 60000;
34
+ /**
35
+ * `glab --version` prints `glab version 1.65.0 (...)` — a fixed format string
36
+ * in glab's own root command. Anchored to the first line, like
37
+ * `GH_VERSION_PATTERN`.
38
+ */
39
+ export declare const GLAB_VERSION_PATTERN: RegExp;
40
+ export type GlabResolutionCandidateSource = 'override' | 'platform' | 'path';
41
+ export interface GlabResolutionAttempt {
42
+ source: GlabResolutionCandidateSource;
43
+ candidate: string;
44
+ accepted: boolean;
45
+ /** Rejection reason; absent when `accepted` is true. */
46
+ reason?: string;
47
+ }
48
+ export interface GlabResolutionDescription {
49
+ resolved: boolean;
50
+ resolvedPath?: string;
51
+ attempts: GlabResolutionAttempt[];
52
+ overrideValue?: string;
53
+ }
54
+ /**
55
+ * Windows install locations for glab (same ProgramFiles/LOCALAPPDATA layout
56
+ * gh uses, under a `GitLab CLI` directory).
57
+ */
58
+ export declare function windowsGlabAbsoluteCandidates(env: NodeJS.ProcessEnv): string[];
59
+ /**
60
+ * Resolve the glab executable to invoke. Lazy, memoized, bounded by
61
+ * TOTAL_BUDGET_MS, never throws. Returns a validated absolute path or the
62
+ * bare `'glab'` fallback.
63
+ */
64
+ export declare function resolveGlabExecutable(): string;
65
+ /** Exported for tests; clears the memoized cache (and bumps the generation). */
66
+ export declare function resetGlabExecutableCache(): void;
67
+ /**
68
+ * TEST-ONLY seam — NOT a production API, do not call from `src/`. Pre-seeds
69
+ * the resolver cache with an explicit "success" entry so
70
+ * `resolveGlabExecutable()` returns `value` with zero probe spawns.
71
+ */
72
+ export declare function __seedGlabExecutableForTests(value: string): void;
73
+ /** Diagnostic surface: candidates tried in the most recent probe cycle. */
74
+ export declare function describeGlabResolution(): GlabResolutionDescription;
75
+ /**
76
+ * DI seam for testability (repo convention — see gh-executable.ts).
77
+ * `platform`/`env` let tests drive every platform branch regardless of the
78
+ * host OS; `now` makes the TTL and budget deterministically testable.
79
+ */
80
+ export declare const _internals: {
81
+ spawnSync: typeof spawnSync;
82
+ platform: () => NodeJS.Platform;
83
+ env: () => NodeJS.ProcessEnv;
84
+ now: () => number;
85
+ };
@@ -3112,6 +3112,25 @@
3112
3112
  }
3113
3113
  }
3114
3114
  },
3115
+ "forge": {
3116
+ "description": "Forge provider (GitHub/GitLab) selection for PR/issue workflows (issue #2733). Ambiguous git remotes (mixed providers, unrecognized self-hosted hosts, or no remote) fail closed and require an explicit selection; forge.base_url passes through the same HTTPS-only / non-private / ASCII-host guards as every forge URL and is never a trust whitelist; combining base_url with provider \"github\" is rejected as a configuration conflict.",
3117
+ "type": "object",
3118
+ "properties": {
3119
+ "provider": {
3120
+ "default": "auto",
3121
+ "type": "string",
3122
+ "enum": [
3123
+ "github",
3124
+ "gitlab",
3125
+ "auto"
3126
+ ]
3127
+ },
3128
+ "base_url": {
3129
+ "type": "string",
3130
+ "format": "uri"
3131
+ }
3132
+ }
3133
+ },
3115
3134
  "observability": {
3116
3135
  "description": "Observability options — remote OTLP/OpenInference export is opt-in and disabled by default (issue #2485).",
3117
3136
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.184.16",
3
+ "version": "7.185.0",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,81 +0,0 @@
1
- // @bun
2
- import {
3
- createCuratorLLMDelegate
4
- } from "./index-2fc9ecr0.js";
5
- import"./index-df845cwk.js";
6
- import"./index-fzen7z3b.js";
7
- import"./index-tzrbeas0.js";
8
- import"./index-7bxssqaf.js";
9
- import"./index-mfqge140.js";
10
- import"./index-jtg0zsnx.js";
11
- import"./index-txdagbh7.js";
12
- import"./index-6h55yp6c.js";
13
- import"./index-rdec0y3z.js";
14
- import"./index-6drqsy4n.js";
15
- import"./index-gvnsfcj0.js";
16
- import"./index-8y9aq9f6.js";
17
- import"./index-a9cajj7y.js";
18
- import"./index-m1pqenq9.js";
19
- import"./index-tyzmjw2s.js";
20
- import"./index-cjapb4hy.js";
21
- import"./index-yydv4jfy.js";
22
- import"./index-pt7h91zc.js";
23
- import"./index-q7sjgr1y.js";
24
- import"./index-r2nr4qxg.js";
25
- import"./index-8pmx61z1.js";
26
- import"./index-6b295cas.js";
27
- import"./index-9nyqt3kb.js";
28
- import"./index-9grg5gr3.js";
29
- import"./index-zsrtt42s.js";
30
- import"./index-rmr36a5k.js";
31
- import"./index-jns2mnbz.js";
32
- import"./index-v2v8gdvy.js";
33
- import"./index-g4fs6z4e.js";
34
- import"./index-6dgghy8n.js";
35
- import"./index-g4d1d91p.js";
36
- import"./index-dftztz4y.js";
37
- import"./index-2s7dvzff.js";
38
- import"./index-v9ynrcst.js";
39
- import"./index-fxf3zhtq.js";
40
- import"./index-rtry5xyf.js";
41
- import"./index-mdkydrnr.js";
42
- import"./index-frcemc0b.js";
43
- import"./index-0725jpp7.js";
44
- import"./index-8gxb2xxe.js";
45
- import"./index-rnqfz57d.js";
46
- import"./index-7rzgdcvc.js";
47
- import"./index-7r3pkgma.js";
48
- import"./index-cftva3pa.js";
49
- import"./index-pwcbtbhd.js";
50
- import"./index-ry16d01s.js";
51
- import"./index-rdm3px0g.js";
52
- import"./index-7pmbnjvj.js";
53
- import"./index-yx5z4200.js";
54
- import"./index-n5z3d8nc.js";
55
- import"./index-vzm6zre7.js";
56
- import"./index-ae75rja9.js";
57
- import"./index-4g4sr4ah.js";
58
- import"./index-2y9b45jj.js";
59
- import"./index-6cjpmvpa.js";
60
- import"./index-t7hmqgjy.js";
61
- import"./index-w6w6ny06.js";
62
- import"./index-mc72pk74.js";
63
- import"./index-c1ggtmpm.js";
64
- import"./index-ejhxgyvm.js";
65
- import"./index-7g4c7s5r.js";
66
- import"./index-bntwj2tp.js";
67
- import"./index-gx2vp8gx.js";
68
- import"./index-ctd0xa67.js";
69
- import"./index-zxdawwc7.js";
70
- import"./index-b3q241ze.js";
71
- import"./index-48jvqqfa.js";
72
- import"./index-bk5tah7q.js";
73
- import"./index-gknz3bv1.js";
74
- import"./index-zpsr8rpc.js";
75
- import"./index-wvghb3x6.js";
76
- import"./index-9rwhas09.js";
77
- import"./index-zgwm4ryv.js";
78
- import"./index-a76rekgs.js";
79
- export {
80
- createCuratorLLMDelegate
81
- };
@@ -1,82 +0,0 @@
1
- // @bun
2
- import {
3
- handleGuardrailExplain
4
- } from "./index-e2a3evhm.js";
5
- import"./index-2fc9ecr0.js";
6
- import"./index-df845cwk.js";
7
- import"./index-fzen7z3b.js";
8
- import"./index-tzrbeas0.js";
9
- import"./index-7bxssqaf.js";
10
- import"./index-mfqge140.js";
11
- import"./index-jtg0zsnx.js";
12
- import"./index-txdagbh7.js";
13
- import"./index-6h55yp6c.js";
14
- import"./index-rdec0y3z.js";
15
- import"./index-6drqsy4n.js";
16
- import"./index-gvnsfcj0.js";
17
- import"./index-8y9aq9f6.js";
18
- import"./index-a9cajj7y.js";
19
- import"./index-m1pqenq9.js";
20
- import"./index-tyzmjw2s.js";
21
- import"./index-cjapb4hy.js";
22
- import"./index-yydv4jfy.js";
23
- import"./index-pt7h91zc.js";
24
- import"./index-q7sjgr1y.js";
25
- import"./index-r2nr4qxg.js";
26
- import"./index-8pmx61z1.js";
27
- import"./index-6b295cas.js";
28
- import"./index-9nyqt3kb.js";
29
- import"./index-9grg5gr3.js";
30
- import"./index-zsrtt42s.js";
31
- import"./index-rmr36a5k.js";
32
- import"./index-jns2mnbz.js";
33
- import"./index-v2v8gdvy.js";
34
- import"./index-g4fs6z4e.js";
35
- import"./index-6dgghy8n.js";
36
- import"./index-g4d1d91p.js";
37
- import"./index-dftztz4y.js";
38
- import"./index-2s7dvzff.js";
39
- import"./index-v9ynrcst.js";
40
- import"./index-fxf3zhtq.js";
41
- import"./index-rtry5xyf.js";
42
- import"./index-mdkydrnr.js";
43
- import"./index-frcemc0b.js";
44
- import"./index-0725jpp7.js";
45
- import"./index-8gxb2xxe.js";
46
- import"./index-rnqfz57d.js";
47
- import"./index-7rzgdcvc.js";
48
- import"./index-7r3pkgma.js";
49
- import"./index-cftva3pa.js";
50
- import"./index-pwcbtbhd.js";
51
- import"./index-ry16d01s.js";
52
- import"./index-rdm3px0g.js";
53
- import"./index-7pmbnjvj.js";
54
- import"./index-yx5z4200.js";
55
- import"./index-n5z3d8nc.js";
56
- import"./index-vzm6zre7.js";
57
- import"./index-ae75rja9.js";
58
- import"./index-4g4sr4ah.js";
59
- import"./index-2y9b45jj.js";
60
- import"./index-6cjpmvpa.js";
61
- import"./index-t7hmqgjy.js";
62
- import"./index-w6w6ny06.js";
63
- import"./index-mc72pk74.js";
64
- import"./index-c1ggtmpm.js";
65
- import"./index-ejhxgyvm.js";
66
- import"./index-7g4c7s5r.js";
67
- import"./index-bntwj2tp.js";
68
- import"./index-gx2vp8gx.js";
69
- import"./index-ctd0xa67.js";
70
- import"./index-zxdawwc7.js";
71
- import"./index-b3q241ze.js";
72
- import"./index-48jvqqfa.js";
73
- import"./index-bk5tah7q.js";
74
- import"./index-gknz3bv1.js";
75
- import"./index-zpsr8rpc.js";
76
- import"./index-wvghb3x6.js";
77
- import"./index-9rwhas09.js";
78
- import"./index-zgwm4ryv.js";
79
- import"./index-a76rekgs.js";
80
- export {
81
- handleGuardrailExplain
82
- };