opencode-swarm 7.185.0 → 7.186.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 (100) hide show
  1. package/README.md +5 -1
  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-feedback-event-queue.d.ts +3 -2
  5. package/dist/background/pr-feedback-loop-runtime.d.ts +4 -1
  6. package/dist/background/pr-feedback-loop.d.ts +2 -1
  7. package/dist/background/pr-monitor-worker.d.ts +9 -1
  8. package/dist/background/pr-review-trigger-receipt-reader.d.ts +35 -0
  9. package/dist/background/pr-subscriptions.d.ts +23 -0
  10. package/dist/cli/{auto-checkpoint-adn8bg66.js → auto-checkpoint-wd99h2bt.js} +7 -7
  11. package/dist/cli/{checkpoint-dvyx8gee.js → checkpoint-kjzwsxw2.js} +14 -14
  12. package/dist/cli/{coder-settlement-95dv9r28.js → coder-settlement-kp3ph56n.js} +10 -10
  13. package/dist/cli/{config-doctor-f2jtx8y5.js → config-doctor-28ggsms8.js} +2 -2
  14. package/dist/cli/{core-xn2epqfk.js → core-pj2fz34e.js} +3 -3
  15. package/dist/cli/{curation-policy-swnyg1jr.js → curation-policy-ytzwb080.js} +4 -4
  16. package/dist/cli/{curator-drift-qem70sry.js → curator-drift-q84jn9cc.js} +8 -8
  17. package/dist/cli/curator-llm-factory-13h02244.js +81 -0
  18. package/dist/cli/{curator-91rqz7xg.js → curator-r0jfc7xw.js} +39 -39
  19. package/dist/cli/{evidence-summary-service-n7ndpen0.js → evidence-summary-service-rsectw2t.js} +17 -17
  20. package/dist/cli/{gate-evidence-ajh95p02.js → gate-evidence-mpwhcm2s.js} +5 -5
  21. package/dist/cli/guardrail-explain-njv3pnsw.js +82 -0
  22. package/dist/cli/{guardrail-log-b23sf549.js → guardrail-log-r8zmh4rd.js} +6 -6
  23. package/dist/cli/{guardrail-reset-e6njf0hv.js → guardrail-reset-11cvwgbe.js} +39 -39
  24. package/dist/cli/{hive-promoter-8dqvfwsx.js → hive-promoter-0vg8w79a.js} +39 -39
  25. package/dist/cli/{index-2tv5zp9x.js → index-151bdyf9.js} +7 -7
  26. package/dist/cli/{index-sz755xt1.js → index-1fc5aj26.js} +1 -1
  27. package/dist/cli/{index-73vnyt4b.js → index-22f1ek6k.js} +39 -39
  28. package/dist/cli/{index-gemq38en.js → index-373880cv.js} +1 -1
  29. package/dist/cli/{index-fkzv0hj4.js → index-4dwhfbed.js} +41 -41
  30. package/dist/cli/{index-gxjy9y0t.js → index-4fd28s8v.js} +2 -2
  31. package/dist/cli/{index-4ysdy8sx.js → index-5pa0e0k3.js} +4 -4
  32. package/dist/cli/{index-62z1vsvf.js → index-62akgg9d.js} +1 -1
  33. package/dist/cli/{index-26nhk01d.js → index-6bfcsczm.js} +1 -1
  34. package/dist/cli/{index-s0c1wxtt.js → index-6ndc8cmn.js} +1 -1
  35. package/dist/cli/{index-h5f5q60s.js → index-6sffjy74.js} +1 -1
  36. package/dist/cli/{index-s5xmvt3k.js → index-74yxwf8y.js} +1 -1
  37. package/dist/cli/{index-cah5ffkh.js → index-7xt5m1cz.js} +5 -5
  38. package/dist/cli/{index-97nbaxye.js → index-8nsjefpc.js} +1 -1
  39. package/dist/cli/{index-1zpgtnhp.js → index-9g61bfj9.js} +1 -1
  40. package/dist/cli/{index-2e7h9yw5.js → index-9th8npp7.js} +5 -5
  41. package/dist/cli/{index-359w27b1.js → index-9y6cyc7z.js} +4 -4
  42. package/dist/cli/{index-djen6c7q.js → index-a1tpq5zr.js} +1 -1
  43. package/dist/cli/{index-rcx4kb02.js → index-a6h5arqs.js} +4 -4
  44. package/dist/cli/{index-t9jr6zc7.js → index-afmyp3kt.js} +1 -1
  45. package/dist/cli/{index-tmd5j8kh.js → index-amamkcpy.js} +4 -4
  46. package/dist/cli/{index-hx9vyvx0.js → index-bajvxmnb.js} +3 -3
  47. package/dist/cli/{index-zkm995wa.js → index-bgpq7wn2.js} +856 -619
  48. package/dist/cli/{index-v5k5jw0r.js → index-d7mcdyqb.js} +2 -2
  49. package/dist/cli/{index-qccnny3g.js → index-fp4hxcsy.js} +3 -3
  50. package/dist/cli/{index-n0wyd905.js → index-hvmfa7m8.js} +3 -3
  51. package/dist/cli/{index-qqjqpmhj.js → index-j972ags2.js} +43 -20
  52. package/dist/cli/{index-vfr3z9rv.js → index-jxd67x6z.js} +1 -1
  53. package/dist/cli/{index-fmxty2h3.js → index-kv3n7g8w.js} +2 -2
  54. package/dist/cli/{index-9am1ry6w.js → index-m94gfe82.js} +7 -7
  55. package/dist/cli/{index-7jqnckzg.js → index-nen885g8.js} +1 -1
  56. package/dist/cli/{index-e5wczpj3.js → index-nxjm66qb.js} +2 -2
  57. package/dist/cli/{index-f3grtpy3.js → index-p6bvzgp2.js} +3 -3
  58. package/dist/cli/{index-zxm9h19f.js → index-p9m1nhds.js} +3 -3
  59. package/dist/cli/{index-w7sftxdy.js → index-qyjyd3ej.js} +1 -1
  60. package/dist/cli/{index-3fnpjy4g.js → index-s68z4a39.js} +2 -2
  61. package/dist/cli/{index-m7g4dsr4.js → index-vk3ngryj.js} +5 -5
  62. package/dist/cli/{index-yg15df3b.js → index-vqz0avr4.js} +2 -2
  63. package/dist/cli/{index-rp0pyywc.js → index-w2b8qq6d.js} +7 -7
  64. package/dist/cli/{index-6wy9m25t.js → index-wkv1qdb0.js} +18 -20
  65. package/dist/cli/{index-erv39311.js → index-wmazt588.js} +2 -2
  66. package/dist/cli/{index-p544ppcp.js → index-xgdypzch.js} +1 -1
  67. package/dist/cli/{index-580t912d.js → index-yj7etak0.js} +1 -1
  68. package/dist/cli/{index-zyz0xp2b.js → index-zxck9sr7.js} +1 -1
  69. package/dist/cli/index.js +40 -40
  70. package/dist/cli/{knowledge-escalator-xdz6vg62.js → knowledge-escalator-7xcd0zea.js} +11 -11
  71. package/dist/cli/{knowledge-events-dnca00ye.js → knowledge-events-e4ts8y2v.js} +9 -9
  72. package/dist/cli/{knowledge-link-y653vvr8.js → knowledge-link-dv78fb9g.js} +3 -3
  73. package/dist/cli/{knowledge-store-yc20na25.js → knowledge-store-mmeqmjwj.js} +4 -4
  74. package/dist/cli/{knowledge-validator-c2kfrqdy.js → knowledge-validator-w2ttgxyj.js} +6 -6
  75. package/dist/cli/{mcp-mefjep3p.js → mcp-5dmm4fk2.js} +1 -1
  76. package/dist/cli/{model-preflight-5xcxc75n.js → model-preflight-kap3zp3g.js} +39 -39
  77. package/dist/cli/{pending-delegations-emhmdkn4.js → pending-delegations-q3sj608s.js} +10 -10
  78. package/dist/cli/{pr-subscriptions-amc1z05d.js → pr-subscriptions-qw4wjv66.js} +12 -10
  79. package/dist/cli/{pr-workflow-gate-gpq41zx9.js → pr-workflow-gate-tdj50p2g.js} +39 -39
  80. package/dist/cli/{runner-ss88pbb2.js → runner-tb3eppeg.js} +4 -4
  81. package/dist/cli/{scan-cursor-71gq82ez.js → scan-cursor-fgecb928.js} +5 -5
  82. package/dist/cli/{schema-108trhk6.js → schema-zrcgm9d9.js} +1 -1
  83. package/dist/cli/{scope-persistence-9gfgvy3p.js → scope-persistence-08xd3kyb.js} +13 -13
  84. package/dist/cli/{server-pkk6y7fa.js → server-kng2nggc.js} +39 -39
  85. package/dist/cli/{skill-generator-7g6xjwhr.js → skill-generator-dztn1ctf.js} +13 -13
  86. package/dist/cli/{snapshot-coordination-init-pactfmsy.js → snapshot-coordination-init-5q0hac3d.js} +39 -39
  87. package/dist/cli/{speckit-checkoff-xyp4c36r.js → speckit-checkoff-hhsy83m9.js} +4 -4
  88. package/dist/cli/{workspace-snapshot-0hffyjhd.js → workspace-snapshot-kcfkk3a2.js} +3 -3
  89. package/dist/cli/{worktree-collision-ownership-g26m4c10.js → worktree-collision-ownership-e2cqcmnw.js} +11 -11
  90. package/dist/cli/{worktree-isolation-52529c62.js → worktree-isolation-refd2n16.js} +39 -39
  91. package/dist/git/pr.d.ts +73 -0
  92. package/dist/hooks/extractors.d.ts +24 -0
  93. package/dist/hooks/pr-workflow-gate.d.ts +2 -0
  94. package/dist/index.js +52 -48
  95. package/dist/pr-review/completion.d.ts +14 -1
  96. package/dist/pr-review/types.d.ts +8 -1
  97. package/dist/tools/write-pr-review-trigger-eval.d.ts +2 -0
  98. package/package.json +1 -1
  99. package/dist/cli/curator-llm-factory-tr6rabws.js +0 -81
  100. package/dist/cli/guardrail-explain-cne2701m.js +0 -82
package/dist/git/pr.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as child_process from 'node:child_process';
2
2
  import { resolveGhExecutable } from '../utils/gh-executable.js';
3
3
  import { resolveGitExecutable } from '../utils/git-executable.js';
4
+ import { resolveGlabExecutable } from '../utils/glab-executable.js';
4
5
  import { readLaneEnvFileFromDiskSync } from './branch.js';
5
6
  export declare const GIT_TIMEOUT_MS = 30000;
6
7
  /**
@@ -60,6 +61,21 @@ declare function spawnSyncWithTransientRetry(command: string, args: string[], op
60
61
  * stdin: 'ignore', timeout, bounded stdout/stderr, proc.kill() in finally.
61
62
  */
62
63
  export declare function ghExecAsync(args: string[], cwd: string): Promise<string>;
64
+ /**
65
+ * Bounded async spawn shared by the gh and glab (GitLab) fetch paths
66
+ * (issue #2882). Same safety contract as the pre-#2882 ghExecAsync body:
67
+ * array-form argv, explicit cwd, stdin 'ignore', GIT_TIMEOUT_MS timeout,
68
+ * MAX_OUTPUT_BYTES per-stream caps, best-effort proc.kill() on settle.
69
+ *
70
+ * `label` names the CLI in error messages ('gh' / 'glab') so existing
71
+ * GitHub-path error text is unchanged. `opts.env` is an overlay merged onto
72
+ * process.env via mergeEnvForChild ONLY when defined — an absent overlay
73
+ * leaves the spawn options without an `env` key, preserving the inherit-
74
+ * process.env behavior the gh path has always had.
75
+ */
76
+ declare function forgeExecAsyncImpl(binary: string, args: string[], cwd: string, label: string, opts?: {
77
+ env?: Record<string, string>;
78
+ }): Promise<string>;
63
79
  /**
64
80
  * Test-only dependency-injection seam — see `gitignore-warning.ts:_internals`.
65
81
  * Production code calls `_internals.ghExec(...)` so tests can replace the
@@ -68,12 +84,16 @@ export declare function ghExecAsync(args: string[], cwd: string): Promise<string
68
84
  export declare const _internals: {
69
85
  ghExec: typeof ghExec;
70
86
  ghExecAsync: typeof ghExecAsync;
87
+ forgeExecAsync: typeof forgeExecAsyncImpl;
88
+ getMRPollSnapshot: typeof getMRPollSnapshot;
89
+ getMRComments: typeof getMRComments;
71
90
  spawnSyncWithTransientRetry: typeof spawnSyncWithTransientRetry;
72
91
  spawnSync: typeof __spawnSyncSeam.spawnSync;
73
92
  readLaneEnvFileFromDiskSync: typeof readLaneEnvFileFromDiskSync;
74
93
  getMergeGroupRun: typeof getMergeGroupRun;
75
94
  resolveGhExecutable: typeof resolveGhExecutable;
76
95
  resolveGitExecutable: typeof resolveGitExecutable;
96
+ resolveGlabExecutable: typeof resolveGlabExecutable;
77
97
  };
78
98
  /**
79
99
  * Check if gh CLI is available
@@ -160,6 +180,59 @@ export declare function getPRPollSnapshot(prNumber: number, repoFullName: string
160
180
  * equivalent, so this stays the second spawn of the poll cycle.
161
181
  */
162
182
  export declare function getPRReviewComments(prNumber: number, repoFullName: string, cwd: string): Promise<PRCommentResult[]>;
183
+ /**
184
+ * Honest-unavailable marker for the three GitHub-synthesized fields
185
+ * (statusCheckRollup / reviewDecision / mergeStateStatus). `getProviderCapabilities`
186
+ * is the source of truth: GitLab reports all three unavailable, so the glab-backed
187
+ * snapshot carries explicit markers instead of fabricated equivalents (#2733 AC7).
188
+ */
189
+ export declare const MR_SYNTHESIZED_FIELD_MARKER = "NOT_AVAILABLE";
190
+ /** Input for glab-backed MR fetches. `host` is the resolved forge host. */
191
+ export interface MRFetchInput {
192
+ /** Full project path (may be multi-segment: group/subgroup/repo). */
193
+ projectPath: string;
194
+ /** Merge request iid (the subscription's prNumber). */
195
+ iid: number;
196
+ cwd: string;
197
+ /** Forge host; when present and not gitlab.com, spawns get GITLAB_HOST. */
198
+ host?: string;
199
+ }
200
+ /** Check-shaped entry derived from a real GitLab pipeline (NOT a statusCheckRollup member). */
201
+ export interface MRPipelineCheck {
202
+ name: string;
203
+ status: string;
204
+ conclusion: string | null;
205
+ detailsUrl?: string;
206
+ }
207
+ /** glab-backed MR snapshot: PRPollSnapshot-compatible core plus a pipelines channel. */
208
+ export interface MRPollSnapshot {
209
+ status: PRStatusResult;
210
+ comments: PRCommentResult[];
211
+ merge: MergeStateResult;
212
+ review: ReviewStateResult;
213
+ /** Terminal pipeline verdicts for the MR head sha (empty when none terminal yet). */
214
+ pipelines: MRPipelineCheck[];
215
+ /** False when the pipelines fetch failed — caller preserves prior CI state. */
216
+ pipelinesFetchSucceeded: boolean;
217
+ }
218
+ /**
219
+ * glab-backed MR snapshot (issue #2882): three bounded spawns.
220
+ * 1. `glab mr view <iid> -R <projectPath> -F json` — MR fields.
221
+ * 2. `glab api projects/<url-encoded-path>/merge_requests/<iid>` — REST
222
+ * detail (deprecated-but-present merge_status; the issue prescribes this
223
+ * call for merge state). Approvals on this payload are intentionally NOT
224
+ * consumed: no existing event vocabulary maps to GitLab approvals without
225
+ * fabricating the GitHub-synthesized reviewDecision (#2733 AC7 binding).
226
+ * 3. `glab api .../merge_requests/<iid>/pipelines?per_page=20` — pipelines
227
+ * for the MR, filtered to the head sha, latest by id, terminal-only.
228
+ */
229
+ export declare function getMRPollSnapshot(input: MRFetchInput): Promise<MRPollSnapshot>;
230
+ /**
231
+ * glab-backed MR comments (issue #2882): the MR notes endpoint, ascending by
232
+ * creation time, system notes excluded (automation notes are not user
233
+ * comments). Bounded single page (per_page=100).
234
+ */
235
+ export declare function getMRComments(input: MRFetchInput): Promise<PRCommentResult[]>;
163
236
  /**
164
237
  * Result of fetching a GitHub Actions run for a PR's merge group.
165
238
  */
@@ -7,10 +7,17 @@ import { type Plan } from '../config/plan-schema';
7
7
  */
8
8
  /**
9
9
  * Extracts the current phase information from plan content.
10
+ *
11
+ * #2841: plan.md is user-writeable content and this one-liner feeds the
12
+ * `[SWARM CONTEXT] Phase:` architect-context injection, so it MUST pass the
13
+ * shared sanitizer (input-side, the same pattern as `extractPlanCursor`).
10
14
  */
11
15
  export declare function extractCurrentPhase(planContent: string): string | null;
12
16
  /**
13
17
  * Extracts the first incomplete task from the current IN PROGRESS phase.
18
+ *
19
+ * #2841: feeds the `[SWARM CONTEXT] Current task:` injection — sanitized
20
+ * input-side like its siblings.
14
21
  */
15
22
  export declare function extractCurrentTask(planContent: string): string | null;
16
23
  /**
@@ -24,14 +31,28 @@ export declare function extractCurrentTask(planContent: string): string | null;
24
31
  * indented sub-bullets are filtered out here).
25
32
  * - Lines are reproduced verbatim from `raw` — bullet prefix, markers
26
33
  * (✅ / [timestamps]) and all — then joined, trimmed and truncated.
34
+ *
35
+ * #2886: context.md is agent-written after consuming untrusted task/issue
36
+ * text and this return feeds the compaction `SWARM DECISIONS` LLM-context
37
+ * fact, so it MUST pass the shared sanitizer input-side (the same pattern as
38
+ * `extractCurrentPhase`); the system-enhancer wraps of this output become
39
+ * idempotent no-ops.
27
40
  */
28
41
  export declare function extractDecisions(contextContent: string, maxChars?: number): string | null;
29
42
  /**
30
43
  * Extracts incomplete tasks from plan content under the current IN PROGRESS phase.
44
+ *
45
+ * #2841: feeds the `SWARM TASKS` compaction fact (LLM-context injection) —
46
+ * sanitized input-side like its siblings.
31
47
  */
32
48
  export declare function extractIncompleteTasks(planContent: string, maxChars?: number): string | null;
33
49
  /**
34
50
  * Extracts patterns section from context content.
51
+ *
52
+ * #2886: context.md is agent-written after consuming untrusted task/issue
53
+ * text and this return feeds the compaction `SWARM PATTERNS` LLM-context
54
+ * fact, so it MUST pass the shared sanitizer input-side (the same pattern as
55
+ * `extractCurrentPhase`).
35
56
  */
36
57
  export declare function extractPatterns(contextContent: string, maxChars?: number): string | null;
37
58
  /**
@@ -44,6 +65,9 @@ export declare function extractPatterns(contextContent: string, maxChars?: numbe
44
65
  export declare function extractCurrentPhaseFromPlan(plan: Plan): string | null;
45
66
  /**
46
67
  * Extracts the first incomplete task from the current phase of a Plan object.
68
+ *
69
+ * #2841: task fields feed the `[SWARM CONTEXT] Current task:` injection —
70
+ * the composed line must pass the shared sanitizer before it is returned.
47
71
  */
48
72
  export declare function extractCurrentTaskFromPlan(plan: Plan): string | null;
49
73
  /**
@@ -15,6 +15,7 @@ import { type PrReviewDimensionCancellationRecord, type PrReviewPartialBaseCover
15
15
  import { type CriticOutcome } from '../pr-review/finding-policy.js';
16
16
  import { type PrReviewComposablePhase, type PrReviewItemClaim, type PrReviewPhaseComposition, parseCriticVerdict } from '../pr-review/legacy-transcript-adapter.js';
17
17
  import { withPrWorkflowCheckoutMutationLock, workflowCheckoutMutationLockRelativePath, workflowGateStateLockRelativePath, workflowGateStateRelativePath } from '../pr-review/persistence.js';
18
+ import { type ForgeContext } from '../providers/forge-provider.js';
18
19
  import { classifyLaneLivenessCondition, type EffectivePrLaneHorizon, resolveEffectivePrLaneHorizonMs } from './lane-liveness-watchdog.js';
19
20
  export type { PrReviewDimensionCancellationRecord, PrReviewDimensionTerminalState, PrReviewPartialBaseCoverageRecord, PrReviewPartialBaseCoverageRecordV1, PrReviewPartialBaseCoverageRecordV2, PrReviewReportVerdict, PrReviewTerminalCoverageKind, PrReviewTerminalCoverageSettlement, PrReviewUnresolvedDimensionRecord, } from '../pr-review/completion.js';
20
21
  export { allowedPrReviewReportVerdicts, normalizePrReviewPartialBaseCoverageRecord, PR_REVIEW_REPORT_VERDICTS, readPrReviewTerminalCoverageForReport, rollbackPrReviewPartialBaseCoverageAdmission, } from '../pr-review/completion.js';
@@ -623,6 +624,7 @@ export declare function activatePrWorkflow(directory: string, sessionID: string,
623
624
  prHeadSha?: string;
624
625
  requireCheckoutPreflight?: boolean;
625
626
  prUrl?: string;
627
+ forge?: ForgeContext;
626
628
  }): Promise<PrWorkflowGateState>;
627
629
  /**
628
630
  * Issue #2601: append skill-contract advisories detected by the auto-resume