opencode-swarm 7.184.17 → 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.
- package/README.md +1 -0
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/background/pr-subscriptions.d.ts +18 -0
- package/dist/background/stage-b-dispatch-binding-store.d.ts +115 -0
- package/dist/cli/{auto-checkpoint-8whpytsm.js → auto-checkpoint-adn8bg66.js} +7 -7
- package/dist/cli/{checkpoint-zjtcn0tx.js → checkpoint-dvyx8gee.js} +14 -14
- package/dist/cli/{coder-settlement-0z8sr1ep.js → coder-settlement-95dv9r28.js} +10 -10
- package/dist/cli/{config-doctor-4zwh0dkn.js → config-doctor-f2jtx8y5.js} +2 -2
- package/dist/cli/{core-fqbga0z4.js → core-xn2epqfk.js} +3 -3
- package/dist/cli/{curation-policy-1rzheh1x.js → curation-policy-swnyg1jr.js} +4 -4
- package/dist/cli/{curator-fkebhqnh.js → curator-91rqz7xg.js} +39 -39
- package/dist/cli/{curator-drift-44ba54w1.js → curator-drift-qem70sry.js} +8 -8
- package/dist/cli/curator-llm-factory-tr6rabws.js +81 -0
- package/dist/cli/{evidence-summary-service-e6wesfq2.js → evidence-summary-service-n7ndpen0.js} +17 -17
- package/dist/cli/{gate-evidence-8chc9f8q.js → gate-evidence-ajh95p02.js} +5 -5
- package/dist/cli/guardrail-explain-cne2701m.js +82 -0
- package/dist/cli/{guardrail-log-t0ketv64.js → guardrail-log-b23sf549.js} +6 -6
- package/dist/cli/{guardrail-reset-rzva9emn.js → guardrail-reset-e6njf0hv.js} +39 -39
- package/dist/cli/{hive-promoter-h60dddna.js → hive-promoter-8dqvfwsx.js} +39 -39
- package/dist/cli/{index-7r3pkgma.js → index-1zpgtnhp.js} +1 -1
- package/dist/cli/{index-r472pepw.js → index-26nhk01d.js} +1 -1
- package/dist/cli/{index-cyn2cb6k.js → index-2e7h9yw5.js} +5 -5
- package/dist/cli/{index-naxrpyb0.js → index-2tv5zp9x.js} +7 -7
- package/dist/cli/{index-e708d35g.js → index-359w27b1.js} +4 -4
- package/dist/cli/{index-m1pqenq9.js → index-3fnpjy4g.js} +2 -2
- package/dist/cli/{index-0zjg4kt5.js → index-4ysdy8sx.js} +4 -4
- package/dist/cli/{index-bntwj2tp.js → index-580t912d.js} +2 -1
- package/dist/cli/{index-jtg0zsnx.js → index-62z1vsvf.js} +1 -1
- package/dist/cli/{index-gx03v1y5.js → index-6wy9m25t.js} +10 -10
- package/dist/cli/{index-8twhrz1w.js → index-73vnyt4b.js} +39 -39
- package/dist/cli/{index-cftva3pa.js → index-7jqnckzg.js} +1 -1
- package/dist/cli/{index-fxf3zhtq.js → index-97nbaxye.js} +1 -1
- package/dist/cli/{index-y8gxcmnj.js → index-9am1ry6w.js} +7 -7
- package/dist/cli/{index-y0534tfs.js → index-cah5ffkh.js} +5 -5
- package/dist/cli/{index-kxacpqwf.js → index-djen6c7q.js} +1 -1
- package/dist/cli/{index-drndbj24.js → index-e5wczpj3.js} +2 -2
- package/dist/cli/{index-pef8ay7c.js → index-erv39311.js} +2 -2
- package/dist/cli/{index-hk2cap4d.js → index-f3grtpy3.js} +3 -3
- package/dist/cli/{index-vs1y869b.js → index-fkzv0hj4.js} +41 -41
- package/dist/cli/{index-50q314wd.js → index-fmxty2h3.js} +2 -2
- package/dist/cli/{index-7rzgdcvc.js → index-gemq38en.js} +1 -1
- package/dist/cli/{index-dky6qwrk.js → index-gxjy9y0t.js} +2 -2
- package/dist/cli/{index-2y9b45jj.js → index-h5f5q60s.js} +1 -1
- package/dist/cli/{index-a7y29h92.js → index-hx9vyvx0.js} +3 -3
- package/dist/cli/{index-sfsydeh8.js → index-m7g4dsr4.js} +5 -5
- package/dist/cli/{index-ww747mdg.js → index-n0wyd905.js} +3 -3
- package/dist/cli/{index-yx5z4200.js → index-p544ppcp.js} +1 -1
- package/dist/cli/{index-m8342y3n.js → index-qccnny3g.js} +3 -3
- package/dist/cli/{index-tyzmjw2s.js → index-qqjqpmhj.js} +420 -9
- package/dist/cli/{index-hx4jkj05.js → index-rcx4kb02.js} +4 -4
- package/dist/cli/{index-48we80k1.js → index-rp0pyywc.js} +7 -7
- package/dist/cli/{index-denfahc5.js → index-s0c1wxtt.js} +1 -1
- package/dist/cli/{index-pwcbtbhd.js → index-s5xmvt3k.js} +1 -1
- package/dist/cli/{index-mfqge140.js → index-sz755xt1.js} +1 -1
- package/dist/cli/{index-dftztz4y.js → index-t9jr6zc7.js} +1 -1
- package/dist/cli/{index-4v60grax.js → index-tmd5j8kh.js} +4 -4
- package/dist/cli/{index-bktc2g9n.js → index-v5k5jw0r.js} +2 -2
- package/dist/cli/{index-wxr5me67.js → index-vfr3z9rv.js} +5 -1
- package/dist/cli/{index-0pvvktht.js → index-w7sftxdy.js} +8 -3
- package/dist/cli/{index-yydv4jfy.js → index-yg15df3b.js} +2 -2
- package/dist/cli/{index-pak3x772.js → index-zkm995wa.js} +1462 -1078
- package/dist/cli/{index-7n1pfpnj.js → index-zxm9h19f.js} +3 -3
- package/dist/cli/{index-4g4sr4ah.js → index-zyz0xp2b.js} +1 -1
- package/dist/cli/index.js +40 -40
- package/dist/cli/{knowledge-escalator-kdeqdj0h.js → knowledge-escalator-xdz6vg62.js} +11 -11
- package/dist/cli/{knowledge-events-6fs0tz97.js → knowledge-events-dnca00ye.js} +9 -9
- package/dist/cli/{knowledge-link-vvyfhhmr.js → knowledge-link-y653vvr8.js} +3 -3
- package/dist/cli/{knowledge-store-z3fee1x1.js → knowledge-store-yc20na25.js} +4 -4
- package/dist/cli/{knowledge-validator-sz1bmbvt.js → knowledge-validator-c2kfrqdy.js} +6 -6
- package/dist/cli/{mcp-e1cnm4k3.js → mcp-mefjep3p.js} +1 -1
- package/dist/cli/{model-preflight-936dhs10.js → model-preflight-5xcxc75n.js} +39 -39
- package/dist/cli/{pending-delegations-m0vf63yd.js → pending-delegations-emhmdkn4.js} +10 -10
- package/dist/cli/{pr-subscriptions-2gvfff4q.js → pr-subscriptions-amc1z05d.js} +10 -10
- package/dist/cli/{pr-workflow-gate-68rg74bk.js → pr-workflow-gate-gpq41zx9.js} +39 -39
- package/dist/cli/{runner-cwmgb9rw.js → runner-ss88pbb2.js} +4 -4
- package/dist/cli/{scan-cursor-qzsanqx4.js → scan-cursor-71gq82ez.js} +5 -5
- package/dist/cli/{schema-jx4v0hg7.js → schema-108trhk6.js} +3 -1
- package/dist/cli/{scope-persistence-qk1h0c13.js → scope-persistence-9gfgvy3p.js} +13 -13
- package/dist/cli/{server-z9az3wc5.js → server-pkk6y7fa.js} +39 -39
- package/dist/cli/{skill-generator-h0veywz6.js → skill-generator-7g6xjwhr.js} +13 -13
- package/dist/cli/{snapshot-coordination-init-mwrvch16.js → snapshot-coordination-init-pactfmsy.js} +39 -39
- package/dist/cli/{speckit-checkoff-skyray2c.js → speckit-checkoff-xyp4c36r.js} +4 -4
- package/dist/cli/{workspace-snapshot-gnwak61t.js → workspace-snapshot-0hffyjhd.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-wvxm7q1h.js → worktree-collision-ownership-g26m4c10.js} +11 -11
- package/dist/cli/{worktree-isolation-bmzkxa64.js → worktree-isolation-52529c62.js} +39 -39
- package/dist/commands/_shared/url-security.d.ts +20 -9
- package/dist/commands/pr-ref.d.ts +44 -8
- package/dist/commands/pr-subscribe.d.ts +0 -8
- package/dist/commands/pr-unsubscribe.d.ts +2 -1
- package/dist/config/schema.d.ts +17 -0
- package/dist/hooks/delegation-gate.d.ts +5 -1
- package/dist/hooks/pr-auto-subscribe.d.ts +5 -4
- package/dist/index.js +519 -519
- package/dist/providers/forge-provider.d.ts +167 -0
- package/dist/providers/host-guards.d.ts +31 -0
- package/dist/utils/gh-executable.d.ts +10 -0
- package/dist/utils/glab-executable.d.ts +85 -0
- package/opencode-swarm.schema.json +19 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-65qve6xk.js +0 -81
- package/dist/cli/guardrail-explain-2prdgvjk.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;
|
|
@@ -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.
|
|
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-pak3x772.js";
|
|
5
|
-
import"./index-dky6qwrk.js";
|
|
6
|
-
import"./index-wxr5me67.js";
|
|
7
|
-
import"./index-4v60grax.js";
|
|
8
|
-
import"./index-7bxssqaf.js";
|
|
9
|
-
import"./index-mfqge140.js";
|
|
10
|
-
import"./index-jtg0zsnx.js";
|
|
11
|
-
import"./index-txdagbh7.js";
|
|
12
|
-
import"./index-pef8ay7c.js";
|
|
13
|
-
import"./index-rdec0y3z.js";
|
|
14
|
-
import"./index-ww747mdg.js";
|
|
15
|
-
import"./index-naxrpyb0.js";
|
|
16
|
-
import"./index-e708d35g.js";
|
|
17
|
-
import"./index-y0534tfs.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-hx4jkj05.js";
|
|
25
|
-
import"./index-gx03v1y5.js";
|
|
26
|
-
import"./index-6b295cas.js";
|
|
27
|
-
import"./index-9nyqt3kb.js";
|
|
28
|
-
import"./index-denfahc5.js";
|
|
29
|
-
import"./index-zsrtt42s.js";
|
|
30
|
-
import"./index-50q314wd.js";
|
|
31
|
-
import"./index-m8342y3n.js";
|
|
32
|
-
import"./index-7n1pfpnj.js";
|
|
33
|
-
import"./index-g4fs6z4e.js";
|
|
34
|
-
import"./index-cyn2cb6k.js";
|
|
35
|
-
import"./index-48we80k1.js";
|
|
36
|
-
import"./index-dftztz4y.js";
|
|
37
|
-
import"./index-2s7dvzff.js";
|
|
38
|
-
import"./index-0zjg4kt5.js";
|
|
39
|
-
import"./index-fxf3zhtq.js";
|
|
40
|
-
import"./index-rtry5xyf.js";
|
|
41
|
-
import"./index-bktc2g9n.js";
|
|
42
|
-
import"./index-frcemc0b.js";
|
|
43
|
-
import"./index-0725jpp7.js";
|
|
44
|
-
import"./index-sfsydeh8.js";
|
|
45
|
-
import"./index-a7y29h92.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-y8gxcmnj.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-kxacpqwf.js";
|
|
69
|
-
import"./index-zxdawwc7.js";
|
|
70
|
-
import"./index-0pvvktht.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-drndbj24.js";
|
|
5
|
-
import"./index-pak3x772.js";
|
|
6
|
-
import"./index-dky6qwrk.js";
|
|
7
|
-
import"./index-wxr5me67.js";
|
|
8
|
-
import"./index-4v60grax.js";
|
|
9
|
-
import"./index-7bxssqaf.js";
|
|
10
|
-
import"./index-mfqge140.js";
|
|
11
|
-
import"./index-jtg0zsnx.js";
|
|
12
|
-
import"./index-txdagbh7.js";
|
|
13
|
-
import"./index-pef8ay7c.js";
|
|
14
|
-
import"./index-rdec0y3z.js";
|
|
15
|
-
import"./index-ww747mdg.js";
|
|
16
|
-
import"./index-naxrpyb0.js";
|
|
17
|
-
import"./index-e708d35g.js";
|
|
18
|
-
import"./index-y0534tfs.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-hx4jkj05.js";
|
|
26
|
-
import"./index-gx03v1y5.js";
|
|
27
|
-
import"./index-6b295cas.js";
|
|
28
|
-
import"./index-9nyqt3kb.js";
|
|
29
|
-
import"./index-denfahc5.js";
|
|
30
|
-
import"./index-zsrtt42s.js";
|
|
31
|
-
import"./index-50q314wd.js";
|
|
32
|
-
import"./index-m8342y3n.js";
|
|
33
|
-
import"./index-7n1pfpnj.js";
|
|
34
|
-
import"./index-g4fs6z4e.js";
|
|
35
|
-
import"./index-cyn2cb6k.js";
|
|
36
|
-
import"./index-48we80k1.js";
|
|
37
|
-
import"./index-dftztz4y.js";
|
|
38
|
-
import"./index-2s7dvzff.js";
|
|
39
|
-
import"./index-0zjg4kt5.js";
|
|
40
|
-
import"./index-fxf3zhtq.js";
|
|
41
|
-
import"./index-rtry5xyf.js";
|
|
42
|
-
import"./index-bktc2g9n.js";
|
|
43
|
-
import"./index-frcemc0b.js";
|
|
44
|
-
import"./index-0725jpp7.js";
|
|
45
|
-
import"./index-sfsydeh8.js";
|
|
46
|
-
import"./index-a7y29h92.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-y8gxcmnj.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-kxacpqwf.js";
|
|
70
|
-
import"./index-zxdawwc7.js";
|
|
71
|
-
import"./index-0pvvktht.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
|
-
};
|