opencode-swarm 7.135.2 → 7.135.3

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 (70) hide show
  1. package/.opencode/skills/critic-gate/SKILL.md +10 -0
  2. package/dist/agents/index.d.ts +12 -0
  3. package/dist/cli/{config-doctor-pj3yvxdb.js → config-doctor-4nznqeca.js} +3 -2
  4. package/dist/cli/{core-4va9z2ng.js → core-4z1s2ak1.js} +3 -2
  5. package/dist/cli/{curation-policy-b2caf3v3.js → curation-policy-81m14519.js} +3 -3
  6. package/dist/cli/{curator-drift-2ta83hss.js → curator-drift-jpap6hv4.js} +2 -2
  7. package/dist/cli/{curator-r1s2mwf2.js → curator-e0z5gcww.js} +24 -23
  8. package/dist/cli/{curator-llm-factory-9983528d.js → curator-llm-factory-fem13y9n.js} +24 -23
  9. package/dist/cli/{dispatch-wtk6dxky.js → dispatch-b1fge4xk.js} +2 -2
  10. package/dist/cli/{evidence-summary-service-feby8ny0.js → evidence-summary-service-w006jnpg.js} +5 -5
  11. package/dist/cli/{gate-evidence-84b03mb4.js → gate-evidence-aenyz6vt.js} +2 -2
  12. package/dist/cli/{guardrail-explain-pwxvg5n0.js → guardrail-explain-wgaj23hd.js} +25 -24
  13. package/dist/cli/{guardrail-log-yzpz8b7t.js → guardrail-log-04p1z1vt.js} +5 -4
  14. package/dist/cli/{hive-promoter-586dhndj.js → hive-promoter-k345z42k.js} +24 -23
  15. package/dist/cli/{index-g3meqrsg.js → index-168phrs7.js} +12 -10
  16. package/dist/cli/{index-3m7kpnqf.js → index-30pg2rs3.js} +1 -1
  17. package/dist/cli/{index-b0eva00y.js → index-36v55ryg.js} +1 -1
  18. package/dist/cli/index-3jcyn8g6.js +1219 -0
  19. package/dist/cli/{index-hdy2nd5h.js → index-45t7w06b.js} +4 -4
  20. package/dist/cli/{index-bs4m85v1.js → index-5436jxnw.js} +2 -2
  21. package/dist/cli/{index-j92ser8n.js → index-a01r818w.js} +5 -3
  22. package/dist/cli/{index-hvrrq3f3.js → index-bcmrg4t4.js} +1 -1
  23. package/dist/cli/{index-d5psymdk.js → index-c9ddxv4k.js} +57 -8
  24. package/dist/cli/{index-7pnvf04s.js → index-cggqh2dz.js} +10 -10
  25. package/dist/cli/{index-340chr1e.js → index-dwargd10.js} +10105 -9998
  26. package/dist/cli/{index-ckdva4rs.js → index-f52jt0am.js} +5 -5
  27. package/dist/cli/{index-jgkjxpdh.js → index-gxxxmajn.js} +2 -2
  28. package/dist/cli/{index-2pxk6qg4.js → index-kb7qy7an.js} +4 -2
  29. package/dist/cli/{index-j0kte6gd.js → index-p5kr35wh.js} +8 -1210
  30. package/dist/cli/{index-02cqjna3.js → index-p9ngg568.js} +4 -4
  31. package/dist/cli/{index-8gw8p7yh.js → index-rv7s2k9y.js} +1 -1
  32. package/dist/cli/{index-3xbx305x.js → index-tcn457d5.js} +1 -1
  33. package/dist/cli/{index-9c3gf2wd.js → index-wygxzvtf.js} +6 -4
  34. package/dist/cli/{index-73dfyfhq.js → index-x20cgr2q.js} +1 -1
  35. package/dist/cli/{index-cwdy5vw9.js → index-y47crdg9.js} +30 -28
  36. package/dist/cli/{index-qqkw794p.js → index-yf30m841.js} +3 -3
  37. package/dist/cli/index.js +27 -25
  38. package/dist/cli/{knowledge-escalator-w7by1m8m.js → knowledge-escalator-42ecv7m3.js} +4 -4
  39. package/dist/cli/{knowledge-events-n8xxsay3.js → knowledge-events-zhna7v3g.js} +2 -2
  40. package/dist/cli/knowledge-link-mm1w967j.js +1 -1
  41. package/dist/cli/{knowledge-store-xzmvfnx3.js → knowledge-store-56jcfc5k.js} +2 -2
  42. package/dist/cli/{knowledge-validator-5q1amsq6.js → knowledge-validator-8zk0pnb6.js} +5 -5
  43. package/dist/cli/{pending-delegations-mt5gs1bt.js → pending-delegations-qajsxct0.js} +4 -4
  44. package/dist/cli/{pr-subscriptions-v5xd3j6d.js → pr-subscriptions-qhr41epq.js} +4 -4
  45. package/dist/cli/{scan-cursor-1q1zmt4b.js → scan-cursor-h3ndxd41.js} +3 -3
  46. package/dist/cli/{schema-8mtsfspm.js → schema-r6wmd7zp.js} +2 -1
  47. package/dist/cli/scope-persistence-h2fpgxww.js +2 -2
  48. package/dist/cli/{skill-generator-54xbjgak.js → skill-generator-12cftsx4.js} +6 -6
  49. package/dist/cli/{worktree-collision-ownership-15hymf1y.js → worktree-collision-ownership-13btcj9g.js} +5 -5
  50. package/dist/commands/approve-plan-critic.d.ts +21 -0
  51. package/dist/commands/registry.d.ts +8 -0
  52. package/dist/config/cache-paths.d.ts +48 -0
  53. package/dist/config/constants.d.ts +18 -0
  54. package/dist/config/host-path.d.ts +95 -0
  55. package/dist/config/lane-context.d.ts +117 -0
  56. package/dist/config/lane-permissions.d.ts +277 -0
  57. package/dist/config/schema.d.ts +10 -0
  58. package/dist/config/swarm-branch.d.ts +130 -0
  59. package/dist/hooks/delegation-gate.d.ts +42 -1
  60. package/dist/hooks/skill-propagation-gate.d.ts +10 -0
  61. package/dist/index.js +211 -199
  62. package/dist/memory/schema.d.ts +4 -4
  63. package/dist/tools/approve-plan-critic.d.ts +5 -0
  64. package/dist/tools/index.d.ts +1 -0
  65. package/dist/tools/manifest.d.ts +1 -0
  66. package/dist/tools/tool-metadata.d.ts +4 -0
  67. package/package.json +1 -1
  68. package/dist/cli/{index-bfd4xfpp.js → index-4qzeef9h.js} +3 -3
  69. package/dist/cli/{index-ryqnn3nv.js → index-mrtms113.js} +3 -3
  70. package/dist/cli/{index-m0ynxkaa.js → index-vm4xw9z3.js} +3 -3
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-bfd4xfpp.js";
4
+ } from "./index-4qzeef9h.js";
5
5
  import {
6
6
  withEvidenceLock
7
7
  } from "./index-09b9zncg.js";
@@ -9,13 +9,13 @@ import {
9
9
  exports_external,
10
10
  init_zod
11
11
  } from "./index-bpmtbmy9.js";
12
+ import {
13
+ bunWrite
14
+ } from "./index-y111zefa.js";
12
15
  import {
13
16
  init_logger,
14
17
  warn
15
18
  } from "./index-zgwm4ryv.js";
16
- import {
17
- bunWrite
18
- } from "./index-y111zefa.js";
19
19
 
20
20
  // src/background/pending-delegations.ts
21
21
  init_zod();
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-340chr1e.js";
15
+ } from "./index-dwargd10.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-2pxk6qg4.js";
22
+ } from "./index-kb7qy7an.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -1,14 +1,16 @@
1
1
  // @bun
2
2
  import {
3
- ALL_AGENT_NAMES,
4
3
  FALLBACK_MODELS_MAX,
5
4
  GATE_CONFIG_KNOWN_SECTION_KEYS,
6
5
  GateConfigSchema,
7
6
  PluginConfigSchema,
8
- init_constants,
9
7
  init_schema,
10
8
  stripKnownSwarmPrefix
11
- } from "./index-j0kte6gd.js";
9
+ } from "./index-p5kr35wh.js";
10
+ import {
11
+ ALL_AGENT_NAMES,
12
+ init_constants
13
+ } from "./index-3jcyn8g6.js";
12
14
  import {
13
15
  log
14
16
  } from "./index-zgwm4ryv.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-2pxk6qg4.js";
5
+ } from "./index-kb7qy7an.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -4,21 +4,68 @@ import {
4
4
  init_warning_buffer
5
5
  } from "./index-4rhhvd1a.js";
6
6
  import {
7
- log
8
- } from "./index-zgwm4ryv.js";
7
+ SWARM_WORKTREE_DIR_NAME,
8
+ init_constants
9
+ } from "./index-3jcyn8g6.js";
9
10
  import {
10
11
  bunSpawn
11
12
  } from "./index-y111zefa.js";
13
+ import {
14
+ log
15
+ } from "./index-zgwm4ryv.js";
12
16
  import {
13
17
  __require
14
18
  } from "./index-a76rekgs.js";
15
19
 
16
20
  // src/worktree/core.ts
17
- init_warning_buffer();
21
+ init_constants();
18
22
  import * as fs from "fs";
19
23
  import * as fsPromises from "fs/promises";
20
24
  import * as os from "os";
21
25
  import * as path from "path";
26
+
27
+ // src/config/swarm-branch.ts
28
+ init_constants();
29
+ var SWARM_WORKTREE_BRANCH_PREFIXES = ["swarm/", "swarm-lane/"];
30
+ var SESSION_ID_PATTERN = /^ses_[A-Za-z0-9]+$/;
31
+ function isPlainSegment(segment) {
32
+ return typeof segment === "string" && segment.length > 0 && segment !== "." && segment !== "..";
33
+ }
34
+ function buildSwarmBranchName(sessionId, id, purpose, legacyLane) {
35
+ const [standardPrefix, legacyLanePrefix] = SWARM_WORKTREE_BRANCH_PREFIXES;
36
+ return legacyLane ? `${legacyLanePrefix}${sessionId}/${id}` : `${standardPrefix}${purpose}/${sessionId}/${id}`;
37
+ }
38
+ function matchSwarmLaneBranch(branch) {
39
+ if (typeof branch !== "string" || branch === "")
40
+ return;
41
+ const segments = branch.split("/");
42
+ if (segments[0] === "swarm-lane") {
43
+ if (segments.length !== 3)
44
+ return;
45
+ const [, sessionId, id] = segments;
46
+ if (!SESSION_ID_PATTERN.test(sessionId ?? ""))
47
+ return;
48
+ if (!isPlainSegment(id))
49
+ return;
50
+ return { purpose: "lane", sessionId, id, style: "legacy-lane" };
51
+ }
52
+ if (segments[0] === "swarm") {
53
+ if (segments.length !== 4)
54
+ return;
55
+ const [, purpose, sessionId, id] = segments;
56
+ if (!isPlainSegment(purpose))
57
+ return;
58
+ if (!SESSION_ID_PATTERN.test(sessionId ?? ""))
59
+ return;
60
+ if (!isPlainSegment(id))
61
+ return;
62
+ return { purpose, sessionId, id, style: "purpose" };
63
+ }
64
+ return;
65
+ }
66
+
67
+ // src/worktree/core.ts
68
+ init_warning_buffer();
22
69
  var _internals = {
23
70
  bunSpawn,
24
71
  platform: process.platform,
@@ -162,13 +209,10 @@ function shortenWorktreePath(_directory, sessionId, laneId) {
162
209
  return path.join(tmp, "swwt", sessionId, laneId);
163
210
  }
164
211
  function makeWorktreeBranchName(sessionId, id, options) {
165
- if (options.branchStyle === "legacy-lane" && options.purpose === "lane") {
166
- return `swarm-lane/${sessionId}/${id}`;
167
- }
168
- return `swarm/${options.purpose}/${sessionId}/${id}`;
212
+ return buildSwarmBranchName(sessionId, id, options.purpose, options.branchStyle === "legacy-lane" && options.purpose === "lane");
169
213
  }
170
214
  function resolveWorktreeBaseDir(directory, worktreeDir) {
171
- return worktreeDir ? path.resolve(directory, worktreeDir) : path.resolve(path.dirname(directory), ".swarm-worktrees");
215
+ return worktreeDir ? path.resolve(directory, worktreeDir) : path.resolve(path.dirname(directory), SWARM_WORKTREE_DIR_NAME);
172
216
  }
173
217
  function isPathUnderSwarmWorktreeBase(targetPath, directory, worktreeDirOverrides = []) {
174
218
  const caseInsensitive = process.platform === "win32";
@@ -199,6 +243,11 @@ function isPathUnderSwarmWorktreeBase(targetPath, directory, worktreeDirOverride
199
243
  }
200
244
  async function provisionWorktree(directory, id, sessionId, options) {
201
245
  const branchName = makeWorktreeBranchName(sessionId, id, options);
246
+ if (!matchSwarmLaneBranch(branchName)) {
247
+ return {
248
+ error: `Refusing to provision worktree: branch "${branchName}" does not match the swarm lane grammar, so lane permission scoping could not recognise it and the lane would hang on the first external-directory prompt. This is almost always an invalid sessionId ("${sessionId}"); it must look like "ses_" followed by letters/digits, and the execution-unit id ("${id}") must be a single path segment.`
249
+ };
250
+ }
202
251
  let worktreePath = path.resolve(resolveWorktreeBaseDir(directory, options.worktreeDir), sessionId, id);
203
252
  const budgetResult = await checkPathBudget(worktreePath, directory);
204
253
  if (budgetResult.ok === false) {
@@ -7,7 +7,7 @@ import {
7
7
  readTaskEvidence,
8
8
  readTaskEvidenceRaw,
9
9
  sanitizeTaskId
10
- } from "./index-ryqnn3nv.js";
10
+ } from "./index-mrtms113.js";
11
11
  import {
12
12
  atomicWriteFile
13
13
  } from "./index-ey29aap6.js";
@@ -48,32 +48,32 @@ import {
48
48
  import {
49
49
  readSwarmFileAsync,
50
50
  validateSwarmPath
51
- } from "./index-bfd4xfpp.js";
51
+ } from "./index-4qzeef9h.js";
52
52
  import {
53
53
  readCachedParsedFile
54
54
  } from "./index-fsrp8wp3.js";
55
55
  import {
56
56
  withEvidenceLock
57
57
  } from "./index-09b9zncg.js";
58
- import {
59
- emit
60
- } from "./index-7a2hm51h.js";
61
58
  import {
62
59
  ZodError,
63
60
  exports_external,
64
61
  init_zod
65
62
  } from "./index-bpmtbmy9.js";
66
63
  import {
67
- criticalWarn,
68
- error,
69
- init_logger,
70
- warn
71
- } from "./index-zgwm4ryv.js";
64
+ emit
65
+ } from "./index-7a2hm51h.js";
72
66
  import {
73
67
  bunHash,
74
68
  bunWrite,
75
69
  mergeEnvForChild
76
70
  } from "./index-y111zefa.js";
71
+ import {
72
+ criticalWarn,
73
+ error,
74
+ init_logger,
75
+ warn
76
+ } from "./index-zgwm4ryv.js";
77
77
  import {
78
78
  __esm,
79
79
  __export,