opencode-swarm 7.113.2 → 7.113.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 (66) hide show
  1. package/binaries/win32-arm64/.gitkeep +0 -0
  2. package/binaries/win32-x64/.gitkeep +0 -0
  3. package/dist/background/event-bus.d.ts +1 -1
  4. package/dist/background/queue.d.ts +11 -0
  5. package/dist/background/trigger.d.ts +1 -0
  6. package/dist/cli/{capability-probe-sh9bwh39.js → capability-probe-f1paszww.js} +1 -1
  7. package/dist/cli/{config-doctor-az11cwf5.js → config-doctor-xbdfrbwt.js} +2 -2
  8. package/dist/cli/{core-f4cbabe7.js → core-zg8s1jwx.js} +2 -2
  9. package/dist/cli/{curator-9s04amtf.js → curator-ckzb8ww4.js} +22 -22
  10. package/dist/cli/{curator-drift-jvs1v6em.js → curator-drift-c0by7063.js} +2 -2
  11. package/dist/cli/curator-llm-factory-mhjcpy1s.js +41 -0
  12. package/dist/cli/{dispatch-wst7bypk.js → dispatch-mczsxy5s.js} +2 -2
  13. package/dist/cli/{evidence-summary-service-w1er1ea2.js → evidence-summary-service-8g594znj.js} +7 -7
  14. package/dist/cli/{gate-evidence-9hdwj6tt.js → gate-evidence-vkpqt300.js} +5 -5
  15. package/dist/cli/guardrail-explain-kabd97j8.js +42 -0
  16. package/dist/cli/{guardrail-log-hysxdwg9.js → guardrail-log-qfc2j0tb.js} +4 -4
  17. package/dist/cli/hive-promoter-h21wzpsr.js +49 -0
  18. package/dist/cli/{index-0dab9w37.js → index-0p660a87.js} +2 -2
  19. package/dist/cli/{index-32bx4kch.js → index-0q7rrh59.js} +4 -4
  20. package/dist/cli/{index-1ey3dxq7.js → index-147ja18h.js} +0 -4
  21. package/dist/cli/{index-0gf6de8b.js → index-2148358e.js} +45 -1
  22. package/dist/cli/{index-30ejh1tx.js → index-43khae15.js} +3 -3
  23. package/dist/cli/{index-x5g7et24.js → index-4h2ea8h5.js} +2 -2
  24. package/dist/cli/{index-5mkc2f9z.js → index-4sckv7y6.js} +1 -1
  25. package/dist/cli/{index-q1jaeynn.js → index-80jkseqw.js} +2 -2
  26. package/dist/cli/{index-wvrj16f0.js → index-8fwhhayc.js} +4 -0
  27. package/dist/cli/{index-54dgk0bv.js → index-dh87tpc5.js} +176 -63
  28. package/dist/cli/{index-afgh75zg.js → index-f6y341yk.js} +14 -11
  29. package/dist/cli/{index-db1fh1fv.js → index-g40r5d08.js} +1 -1
  30. package/dist/cli/{index-8f256d7t.js → index-g6va6n3t.js} +1 -1
  31. package/dist/cli/{index-9fxs0rm1.js → index-ga4ta3cr.js} +1 -1
  32. package/dist/cli/{index-t6wfwdm1.js → index-h7q1bvzm.js} +3 -3
  33. package/dist/cli/{index-w51xz4dr.js → index-hw4tcxs9.js} +24 -24
  34. package/dist/cli/{index-h389ed8y.js → index-mr4whary.js} +3 -3
  35. package/dist/cli/{index-g55nzpwn.js → index-n6fa2hhk.js} +1 -1
  36. package/dist/cli/{index-vn263hqt.js → index-pa6t33pt.js} +17 -10
  37. package/dist/cli/{index-h91bv3hy.js → index-qe3v54nb.js} +6 -1
  38. package/dist/cli/{index-hpp2r0sd.js → index-qzqx2qky.js} +3 -3
  39. package/dist/cli/{index-fhmw7evd.js → index-rdwfqhp7.js} +2 -2
  40. package/dist/cli/{index-n7rd2rkj.js → index-srvqfcyj.js} +2 -2
  41. package/dist/cli/{index-1rga1vvb.js → index-wh8949ef.js} +1 -1
  42. package/dist/cli/{index-r9fjzr3k.js → index-xbe1wtme.js} +1 -1
  43. package/dist/cli/index.js +22 -22
  44. package/dist/cli/{knowledge-escalator-4gbz527n.js → knowledge-escalator-0q1p6br7.js} +8 -8
  45. package/dist/cli/{knowledge-events-b6x28fgc.js → knowledge-events-9518gzsp.js} +6 -6
  46. package/dist/cli/{knowledge-store-h3cjx4dg.js → knowledge-store-k5rab79h.js} +6 -6
  47. package/dist/cli/{knowledge-validator-q6jw2p0t.js → knowledge-validator-csay9wqj.js} +7 -7
  48. package/dist/cli/{pending-delegations-t047f4a7.js → pending-delegations-ddbkbgxy.js} +4 -4
  49. package/dist/cli/{pr-subscriptions-p8g2rzxd.js → pr-subscriptions-vwv7zm2p.js} +5 -5
  50. package/dist/cli/{schema-qb313fyy.js → schema-e5kd993s.js} +1 -1
  51. package/dist/cli/{scope-persistence-5ccgtebg.js → scope-persistence-fm0gzhnk.js} +2 -2
  52. package/dist/cli/{skill-generator-nnwn4sq0.js → skill-generator-z01sjppf.js} +9 -9
  53. package/dist/cli/{telemetry-jm7t8031.js → telemetry-jny76r83.js} +1 -1
  54. package/dist/commands/registry.d.ts +7 -0
  55. package/dist/config/constants.d.ts +1 -1
  56. package/dist/hooks/messages-transform.d.ts +22 -1
  57. package/dist/hooks/spawn-helper.d.ts +10 -0
  58. package/dist/index.js +95 -93
  59. package/dist/sandbox/capability-probe.d.ts +14 -0
  60. package/dist/sandbox/macos/sandbox-exec-executor.d.ts +5 -0
  61. package/dist/tools/tool-metadata.d.ts +1 -1
  62. package/dist/utils/path-security.d.ts +28 -0
  63. package/package.json +2 -1
  64. package/dist/cli/curator-llm-factory-dwvk7rh0.js +0 -41
  65. package/dist/cli/guardrail-explain-2k271yh4.js +0 -42
  66. package/dist/cli/hive-promoter-0y4pnft4.js +0 -49
@@ -7,7 +7,7 @@ import {
7
7
  readDoctorArtifact,
8
8
  removeStraySwarmDir,
9
9
  runConfigDoctor
10
- } from "./index-0gf6de8b.js";
10
+ } from "./index-2148358e.js";
11
11
  import {
12
12
  AGENT_TOOL_MAP,
13
13
  ALL_SUBAGENT_NAMES,
@@ -23,7 +23,7 @@ import {
23
23
  getCanonicalAgentRole,
24
24
  resolveExternalSkillsConfig,
25
25
  stripKnownSwarmPrefix
26
- } from "./index-1ey3dxq7.js";
26
+ } from "./index-147ja18h.js";
27
27
  import {
28
28
  MAX_TRANSIENT_RETRIES,
29
29
  PlanSchema,
@@ -68,7 +68,7 @@ import {
68
68
  savePlan,
69
69
  transientBackoff,
70
70
  validateProjectRoot
71
- } from "./index-afgh75zg.js";
71
+ } from "./index-f6y341yk.js";
72
72
  import {
73
73
  buildOpenSpecProjectionSync,
74
74
  detectSpeckit,
@@ -83,13 +83,13 @@ import {
83
83
  _internals1 as _internals2,
84
84
  isCommandAvailable,
85
85
  tool
86
- } from "./index-9fxs0rm1.js";
86
+ } from "./index-ga4ta3cr.js";
87
87
  import {
88
88
  buildCorrelationId,
89
89
  listActive,
90
90
  subscribe,
91
91
  unsubscribe
92
- } from "./index-q1jaeynn.js";
92
+ } from "./index-80jkseqw.js";
93
93
  import {
94
94
  BUNDLED_PROJECT_SKILL_ROOT,
95
95
  DEFAULT_SKILL_MIN_CONFIDENCE,
@@ -111,7 +111,7 @@ import {
111
111
  retireSkill,
112
112
  selectCandidateEntries,
113
113
  syncBundledProjectSkillsIfMissingAsync
114
- } from "./index-h389ed8y.js";
114
+ } from "./index-mr4whary.js";
115
115
  import {
116
116
  appendUnactionable,
117
117
  quarantineEntry,
@@ -121,10 +121,10 @@ import {
121
121
  validateActionability,
122
122
  validateActionableFields,
123
123
  validateLesson
124
- } from "./index-30ejh1tx.js";
124
+ } from "./index-43khae15.js";
125
125
  import {
126
126
  readRecentEscalations
127
- } from "./index-t6wfwdm1.js";
127
+ } from "./index-h7q1bvzm.js";
128
128
  import {
129
129
  effectiveRetrievalOutcomes,
130
130
  readKnowledgeCounterRollups,
@@ -132,7 +132,7 @@ import {
132
132
  recordHiveKnowledgeEvent,
133
133
  recordKnowledgeEvent,
134
134
  resolveKnowledgeEventsPath
135
- } from "./index-hpp2r0sd.js";
135
+ } from "./index-qzqx2qky.js";
136
136
  import {
137
137
  appendKnowledge,
138
138
  appendRejectedLesson,
@@ -156,7 +156,7 @@ import {
156
156
  rewriteKnowledge,
157
157
  transactFile,
158
158
  transactKnowledge
159
- } from "./index-32bx4kch.js";
159
+ } from "./index-0q7rrh59.js";
160
160
  import {
161
161
  KNOWLEDGE_SCHEMA_VERSION,
162
162
  OUTCOME_BLOCK_THRESHOLD,
@@ -170,7 +170,7 @@ import {
170
170
  resolveLinkDir,
171
171
  sanitizeLinkId,
172
172
  writeLinkPointer
173
- } from "./index-db1fh1fv.js";
173
+ } from "./index-g40r5d08.js";
174
174
  import {
175
175
  CURATOR_INIT_PROMPT,
176
176
  CURATOR_PHASE_PROMPT,
@@ -179,15 +179,15 @@ import {
179
179
  import {
180
180
  SandboxCapabilityProbe,
181
181
  init_capability_probe
182
- } from "./index-wvrj16f0.js";
182
+ } from "./index-8fwhhayc.js";
183
183
  import {
184
184
  clearAllScopes
185
- } from "./index-g55nzpwn.js";
185
+ } from "./index-n6fa2hhk.js";
186
186
  import {
187
187
  readSwarmFileAsync,
188
188
  safeHook,
189
189
  validateSwarmPath
190
- } from "./index-1rga1vvb.js";
190
+ } from "./index-wh8949ef.js";
191
191
  import {
192
192
  deepMerge
193
193
  } from "./index-p0arc26j.js";
@@ -199,16 +199,16 @@ import {
199
199
  } from "./index-zgwm4ryv.js";
200
200
  import {
201
201
  atomicWriteFile
202
- } from "./index-0dab9w37.js";
202
+ } from "./index-0p660a87.js";
203
203
  import {
204
204
  exports_external
205
205
  } from "./index-293f68mj.js";
206
206
  import {
207
207
  tryAcquireLock
208
- } from "./index-5mkc2f9z.js";
208
+ } from "./index-4sckv7y6.js";
209
209
  import {
210
210
  telemetry
211
- } from "./index-vn263hqt.js";
211
+ } from "./index-pa6t33pt.js";
212
212
  import {
213
213
  require_proper_lockfile
214
214
  } from "./index-vvk2g744.js";
@@ -216,7 +216,7 @@ import {
216
216
  bunSpawn,
217
217
  bunWrite,
218
218
  mergeEnvForChild
219
- } from "./index-h91bv3hy.js";
219
+ } from "./index-qe3v54nb.js";
220
220
  import {
221
221
  __require,
222
222
  __toESM
@@ -4397,6 +4397,7 @@ var head = null;
4397
4397
  var tail = null;
4398
4398
  var entriesByKey = new Map;
4399
4399
  var deferredEntries = new Set;
4400
+ var resolvedKeyCache = new Map;
4400
4401
  function markAsPooled(provider) {
4401
4402
  const originalClose = provider.close;
4402
4403
  provider.close = () => {
@@ -4524,10 +4525,19 @@ function unlinkEntry(entry) {
4524
4525
  tail = entry.prev;
4525
4526
  }
4526
4527
  function resolvePoolKey(directory) {
4528
+ const rawKey = path6.resolve(directory);
4527
4529
  try {
4528
- return realpathSync(directory);
4530
+ const canonical = realpathSync(directory);
4531
+ resolvedKeyCache.delete(rawKey);
4532
+ resolvedKeyCache.set(rawKey, canonical);
4533
+ if (resolvedKeyCache.size > MAX_POOL_SIZE) {
4534
+ const oldest = resolvedKeyCache.keys().next().value;
4535
+ if (oldest !== undefined)
4536
+ resolvedKeyCache.delete(oldest);
4537
+ }
4538
+ return canonical;
4529
4539
  } catch {
4530
- return path6.resolve(directory);
4540
+ return resolvedKeyCache.get(rawKey) ?? rawKey;
4531
4541
  }
4532
4542
  }
4533
4543
  function evictAndClose(directory) {
@@ -4923,6 +4933,73 @@ function sanitizeGatesConfig(raw) {
4923
4933
  function sanitizeSectionConfigs(raw) {
4924
4934
  return sanitizeGatesConfig(sanitizeExternalSkillsConfig(raw));
4925
4935
  }
4936
+ function stripUnrecognizedKeys(raw, error2) {
4937
+ const removed = [];
4938
+ const cleaned = structuredClone(raw);
4939
+ for (const issue of error2.issues) {
4940
+ if (issue.code !== "unrecognized_keys")
4941
+ continue;
4942
+ const keys = issue.keys ?? [];
4943
+ let node = cleaned;
4944
+ for (const seg of issue.path) {
4945
+ if (node && typeof node === "object") {
4946
+ node = node[seg];
4947
+ } else {
4948
+ node = undefined;
4949
+ break;
4950
+ }
4951
+ }
4952
+ if (!node || typeof node !== "object")
4953
+ continue;
4954
+ for (const key of keys) {
4955
+ if (key in node) {
4956
+ delete node[key];
4957
+ const dotted = [...issue.path.map(String), key].join(".");
4958
+ removed.push(dotted);
4959
+ }
4960
+ }
4961
+ }
4962
+ return { cleaned, removed };
4963
+ }
4964
+ function parseConfigWithFallback(mergedRaw, rawUserConfig, failedResult, loadedFromFile, configHadErrors) {
4965
+ const result = failedResult;
4966
+ const secure = (config) => loadedFromFile && configHadErrors ? PluginConfigSchema.parse({
4967
+ ...config,
4968
+ guardrails: { enabled: true }
4969
+ }) : config;
4970
+ const { cleaned, removed } = stripUnrecognizedKeys(mergedRaw, result.error);
4971
+ if (removed.length > 0) {
4972
+ const recovered = PluginConfigSchema.safeParse(cleaned);
4973
+ if (recovered.success) {
4974
+ advisoryWarn(`[opencode-swarm] Ignored ${removed.length} unrecognized config key(s): ${removed.join(", ")}. The rest of your configuration was preserved. Fix or remove these keys.`);
4975
+ return secure(recovered.data);
4976
+ }
4977
+ }
4978
+ if (rawUserConfig) {
4979
+ const userSanitized = sanitizeSectionConfigs(rawUserConfig ?? {});
4980
+ const userParseResult = PluginConfigSchema.safeParse(userSanitized);
4981
+ if (userParseResult.success) {
4982
+ advisoryWarn("[opencode-swarm] Project config ignored due to validation errors. Using user config.");
4983
+ return secure(userParseResult.data);
4984
+ }
4985
+ const userStripped = stripUnrecognizedKeys(userSanitized, userParseResult.error);
4986
+ if (userStripped.removed.length > 0) {
4987
+ const userRecovered = PluginConfigSchema.safeParse(userStripped.cleaned);
4988
+ if (userRecovered.success) {
4989
+ advisoryWarn(`[opencode-swarm] Project config ignored; also ignored ${userStripped.removed.length} unrecognized user-config key(s): ${userStripped.removed.join(", ")}.`);
4990
+ return secure(userRecovered.data);
4991
+ }
4992
+ }
4993
+ }
4994
+ const offending = stripUnrecognizedKeys(mergedRaw, result.error).removed;
4995
+ if (offending.length > 0) {
4996
+ advisoryWarn(`[opencode-swarm] Merged config validation failed. Unrecognized key(s): ${offending.join(", ")}.`);
4997
+ } else {
4998
+ advisoryWarn("[opencode-swarm] Merged config validation failed:", result.error.format());
4999
+ }
5000
+ advisoryWarn("[opencode-swarm] \u26A0\uFE0F SECURITY: Falling back to conservative defaults with guardrails ENABLED. Fix the config file to restore custom configuration.");
5001
+ return PluginConfigSchema.parse({ guardrails: { enabled: true } });
5002
+ }
4926
5003
  function rawFullAutoLocked(raw) {
4927
5004
  if (!raw || typeof raw !== "object")
4928
5005
  return false;
@@ -4955,27 +5032,16 @@ function loadPluginConfig(directory) {
4955
5032
  mergedRaw = migratePresetsConfig(mergedRaw);
4956
5033
  mergedRaw = sanitizeSectionConfigs(mergedRaw);
4957
5034
  const result = PluginConfigSchema.safeParse(mergedRaw);
4958
- if (!result.success) {
4959
- if (rawUserConfig) {
4960
- const userParseResult = PluginConfigSchema.safeParse(sanitizeSectionConfigs(rawUserConfig ?? {}));
4961
- if (userParseResult.success) {
4962
- advisoryWarn("[opencode-swarm] Project config ignored due to validation errors. Using user config.");
4963
- return userParseResult.data;
4964
- }
5035
+ if (result.success) {
5036
+ if (loadedFromFile && configHadErrors) {
5037
+ return PluginConfigSchema.parse({
5038
+ ...mergedRaw,
5039
+ guardrails: { enabled: true }
5040
+ });
4965
5041
  }
4966
- advisoryWarn("[opencode-swarm] Merged config validation failed:", result.error.format());
4967
- advisoryWarn("[opencode-swarm] \u26A0\uFE0F SECURITY: Falling back to conservative defaults with guardrails ENABLED. Fix the config file to restore custom configuration.");
4968
- return PluginConfigSchema.parse({
4969
- guardrails: { enabled: true }
4970
- });
5042
+ return result.data;
4971
5043
  }
4972
- if (loadedFromFile && configHadErrors) {
4973
- return PluginConfigSchema.parse({
4974
- ...mergedRaw,
4975
- guardrails: { enabled: true }
4976
- });
4977
- }
4978
- return result.data;
5044
+ return parseConfigWithFallback(mergedRaw, rawUserConfig, result, loadedFromFile, configHadErrors);
4979
5045
  }
4980
5046
  function loadPluginConfigWithMeta(directory) {
4981
5047
  const userConfigPath = path7.join(getUserConfigDir(), "opencode", CONFIG_FILENAME);
@@ -8976,7 +9042,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
8976
9042
  }
8977
9043
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
8978
9044
  try {
8979
- const skillModule = await import("./skill-generator-nnwn4sq0.js");
9045
+ const skillModule = await import("./skill-generator-z01sjppf.js");
8980
9046
  for (const cand of skillCandidates) {
8981
9047
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
8982
9048
  continue;
@@ -9257,7 +9323,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
9257
9323
  } catch {}
9258
9324
  }
9259
9325
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
9260
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-4gbz527n.js");
9326
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-0q1p6br7.js");
9261
9327
  for (const { id } of contradictedEntries) {
9262
9328
  try {
9263
9329
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -10214,15 +10280,15 @@ var _internals12 = {
10214
10280
  verifyPostMortemKnowledgeActions,
10215
10281
  repairPostMortemActions,
10216
10282
  loadDefaultKnowledgeConfig: async () => {
10217
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-qb313fyy.js");
10283
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-e5kd993s.js");
10218
10284
  return KnowledgeConfigSchema2.parse({});
10219
10285
  },
10220
10286
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig) => {
10221
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-9s04amtf.js");
10287
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-ckzb8ww4.js");
10222
10288
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig);
10223
10289
  },
10224
10290
  checkHivePromotions: async (entries, knowledgeConfig) => {
10225
- const { checkHivePromotions } = await import("./hive-promoter-0y4pnft4.js");
10291
+ const { checkHivePromotions } = await import("./hive-promoter-h21wzpsr.js");
10226
10292
  return checkHivePromotions(entries, knowledgeConfig);
10227
10293
  },
10228
10294
  applyProposalTriage: async (directory, triage) => {
@@ -10231,7 +10297,7 @@ var _internals12 = {
10231
10297
  activateProposal,
10232
10298
  listSkills: listSkills2,
10233
10299
  sanitizeSlug
10234
- } = await import("./skill-generator-nnwn4sq0.js");
10300
+ } = await import("./skill-generator-z01sjppf.js");
10235
10301
  const result = {
10236
10302
  approved: [],
10237
10303
  rejected: [],
@@ -10273,7 +10339,7 @@ var _internals12 = {
10273
10339
  return result;
10274
10340
  },
10275
10341
  readPriorDriftReports: async (directory) => {
10276
- const { readPriorDriftReports } = await import("./curator-drift-jvs1v6em.js");
10342
+ const { readPriorDriftReports } = await import("./curator-drift-c0by7063.js");
10277
10343
  return readPriorDriftReports(directory);
10278
10344
  },
10279
10345
  readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
@@ -15166,7 +15232,7 @@ async function runFinalizeStage(ctx) {
15166
15232
  }
15167
15233
  }
15168
15234
  try {
15169
- const { CuratorConfigSchema: CCS } = await import("./schema-qb313fyy.js");
15235
+ const { CuratorConfigSchema: CCS } = await import("./schema-e5kd993s.js");
15170
15236
  const { config: pmLoadedConfig } = _internals19.loadPluginConfigWithMeta(ctx.directory);
15171
15237
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
15172
15238
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -17279,9 +17345,9 @@ var _internals23 = {
17279
17345
  readSwarmFileAsync,
17280
17346
  loadCuratorDeps: async () => {
17281
17347
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
17282
- import("./schema-qb313fyy.js"),
17283
- import("./curator-9s04amtf.js"),
17284
- import("./curator-llm-factory-dwvk7rh0.js")
17348
+ import("./schema-e5kd993s.js"),
17349
+ import("./curator-ckzb8ww4.js"),
17350
+ import("./curator-llm-factory-mhjcpy1s.js")
17285
17351
  ]);
17286
17352
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
17287
17353
  }
@@ -17777,7 +17843,7 @@ import { fileURLToPath } from "url";
17777
17843
  // package.json
17778
17844
  var package_default = {
17779
17845
  name: "opencode-swarm",
17780
- version: "7.113.2",
17846
+ version: "7.113.3",
17781
17847
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
17782
17848
  main: "dist/index.js",
17783
17849
  types: "dist/index.d.ts",
@@ -17817,6 +17883,7 @@ var package_default = {
17817
17883
  files: [
17818
17884
  "dist",
17819
17885
  "dist/lang/grammars",
17886
+ "binaries",
17820
17887
  ".opencode/skills/brainstorm",
17821
17888
  ".opencode/skills/specify",
17822
17889
  ".opencode/skills/clarify-spec",
@@ -18818,10 +18885,19 @@ async function getSandboxStatus() {
18818
18885
  const executor = await _internals24.getSandboxExecutor();
18819
18886
  const hasExecutor = executor !== null;
18820
18887
  if (hasExecutor) {
18888
+ const executorStrength = executor?.strength;
18889
+ const strength = executorStrength === "weak" || executorStrength === "advisory" ? "advisory" : capability.strength ?? executorStrength ?? "strong";
18890
+ if (strength === "advisory") {
18891
+ return {
18892
+ name: "Sandbox",
18893
+ status: "\u26A0\uFE0F",
18894
+ detail: `Mechanism: ${mechanism.toLowerCase()} | Available: advisory only | Strength: ADVISORY (env-scrub, NOT kernel-enforced) | Commands are NOT strongly sandboxed`
18895
+ };
18896
+ }
18821
18897
  return {
18822
18898
  name: "Sandbox",
18823
18899
  status: "\u2705",
18824
- detail: `Mechanism: ${mechanism.toLowerCase()} | Available: yes | Sandboxing commands: yes`
18900
+ detail: `Mechanism: ${mechanism.toLowerCase()} | Available: yes | Strength: strong (kernel-enforced) | Sandboxing commands: yes`
18825
18901
  };
18826
18902
  }
18827
18903
  if (mechanism !== "none") {
@@ -19237,7 +19313,7 @@ async function handleDoctorCommand(directory, args) {
19237
19313
  const result = runConfigDoctor(config, directory);
19238
19314
  let output;
19239
19315
  if (enableAutoFix && result.hasAutoFixableIssues) {
19240
- const { runConfigDoctorWithFixes } = await import("./config-doctor-az11cwf5.js");
19316
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-xbdfrbwt.js");
19241
19317
  const fixResult = await runConfigDoctorWithFixes(directory, config, true);
19242
19318
  output = formatDoctorMarkdown(fixResult.result);
19243
19319
  } else {
@@ -20050,7 +20126,7 @@ async function handleEvidenceCommand(directory, args) {
20050
20126
  return formatTaskEvidenceMarkdown(evidenceData);
20051
20127
  }
20052
20128
  async function handleEvidenceSummaryCommand(directory) {
20053
- const { buildEvidenceSummary } = await import("./evidence-summary-service-w1er1ea2.js");
20129
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-8g594znj.js");
20054
20130
  const artifact = await buildEvidenceSummary(directory);
20055
20131
  if (!artifact) {
20056
20132
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -26848,7 +26924,7 @@ var DISPATCH_FRAMEWORK_MAP = {
26848
26924
  };
26849
26925
  async function detectTestFrameworkViaDispatch(cwd) {
26850
26926
  try {
26851
- const { pickBackend } = await import("./dispatch-wst7bypk.js");
26927
+ const { pickBackend } = await import("./dispatch-mczsxy5s.js");
26852
26928
  const backend = await pickBackend(cwd);
26853
26929
  if (!backend?.selectTestFramework)
26854
26930
  return "none";
@@ -26864,7 +26940,7 @@ async function buildTestCommandViaDispatch(framework, scope, files, coverage, ba
26864
26940
  if (framework === "none")
26865
26941
  return null;
26866
26942
  try {
26867
- const { pickBackend } = await import("./dispatch-wst7bypk.js");
26943
+ const { pickBackend } = await import("./dispatch-mczsxy5s.js");
26868
26944
  const backend = await pickBackend(baseDir);
26869
26945
  if (backend?.buildTestCommand) {
26870
26946
  const cmd = backend.buildTestCommand(framework, files, baseDir, {
@@ -26884,7 +26960,7 @@ async function parseTestOutputViaDispatch(framework, output, baseDir) {
26884
26960
  if (framework === "none")
26885
26961
  return null;
26886
26962
  try {
26887
- const { pickBackend } = await import("./dispatch-wst7bypk.js");
26963
+ const { pickBackend } = await import("./dispatch-mczsxy5s.js");
26888
26964
  const backend = await pickBackend(baseDir);
26889
26965
  if (!backend?.parseTestOutput)
26890
26966
  return null;
@@ -29517,12 +29593,14 @@ class AutomationQueue {
29517
29593
  defaultBackoffMs;
29518
29594
  maxBackoffMs;
29519
29595
  eventBus;
29596
+ overflowStrategy;
29520
29597
  itemCounter = 0;
29521
29598
  constructor(config) {
29522
29599
  this.maxSize = config?.maxSize ?? 1000;
29523
29600
  this.defaultMaxRetries = config?.defaultMaxRetries ?? 3;
29524
29601
  this.defaultBackoffMs = config?.defaultBackoffMs ?? 1000;
29525
29602
  this.maxBackoffMs = config?.maxBackoffMs ?? 60000;
29603
+ this.overflowStrategy = config?.overflowStrategy ?? "throw";
29526
29604
  this.eventBus = getGlobalEventBus();
29527
29605
  }
29528
29606
  generateId() {
@@ -29530,7 +29608,20 @@ class AutomationQueue {
29530
29608
  }
29531
29609
  enqueue(payload, priority = "normal", metadata) {
29532
29610
  if (this.items.length >= this.maxSize) {
29533
- throw new Error(`Queue is full (max ${this.maxSize} items)`);
29611
+ if (this.overflowStrategy === "evict-oldest") {
29612
+ let oldestIdx = 0;
29613
+ for (let i = 1;i < this.items.length; i++) {
29614
+ if (this.items[i].createdAt < this.items[oldestIdx].createdAt) {
29615
+ oldestIdx = i;
29616
+ }
29617
+ }
29618
+ const [evicted] = this.items.splice(oldestIdx, 1);
29619
+ if (evicted) {
29620
+ this.eventBus.publish("queue.item.evicted", { itemId: evicted.id });
29621
+ }
29622
+ } else {
29623
+ throw new Error(`Queue is full (max ${this.maxSize} items)`);
29624
+ }
29534
29625
  }
29535
29626
  const item = {
29536
29627
  id: this.generateId(),
@@ -32618,7 +32709,7 @@ function buildDetailedHelp(commandName, entry) {
32618
32709
  async function handleHelpCommand(ctx) {
32619
32710
  const targetCommand = ctx.args.join(" ");
32620
32711
  if (!targetCommand) {
32621
- const { buildHelpText } = await import("./index-w51xz4dr.js");
32712
+ const { buildHelpText } = await import("./index-hw4tcxs9.js");
32622
32713
  return buildHelpText();
32623
32714
  }
32624
32715
  const tokens = targetCommand.split(/\s+/);
@@ -32627,7 +32718,7 @@ async function handleHelpCommand(ctx) {
32627
32718
  return _internals48.buildDetailedHelp(resolved.key, resolved.entry);
32628
32719
  }
32629
32720
  const similar = _internals48.findSimilarCommands(targetCommand);
32630
- const { buildHelpText: fullHelp } = await import("./index-w51xz4dr.js");
32721
+ const { buildHelpText: fullHelp } = await import("./index-hw4tcxs9.js");
32631
32722
  if (similar.length > 0) {
32632
32723
  return `Command '/swarm ${targetCommand}' not found.
32633
32724
 
@@ -32760,7 +32851,7 @@ var COMMAND_REGISTRY = {
32760
32851
  },
32761
32852
  "guardrail explain": {
32762
32853
  handler: async (ctx) => {
32763
- const { handleGuardrailExplain } = await import("./guardrail-explain-2k271yh4.js");
32854
+ const { handleGuardrailExplain } = await import("./guardrail-explain-kabd97j8.js");
32764
32855
  return handleGuardrailExplain(ctx.directory, ctx.args);
32765
32856
  },
32766
32857
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -32768,9 +32859,19 @@ var COMMAND_REGISTRY = {
32768
32859
  toolPolicy: "agent",
32769
32860
  toolNoArgs: false
32770
32861
  },
32862
+ "guardrail-explain": {
32863
+ handler: async (ctx) => {
32864
+ const { handleGuardrailExplain } = await import("./guardrail-explain-kabd97j8.js");
32865
+ return handleGuardrailExplain(ctx.directory, ctx.args);
32866
+ },
32867
+ description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
32868
+ category: "diagnostics",
32869
+ aliasOf: "guardrail explain",
32870
+ deprecated: true
32871
+ },
32771
32872
  "guardrail-log": {
32772
32873
  handler: async (ctx) => {
32773
- const { handleGuardrailLog } = await import("./guardrail-log-hysxdwg9.js");
32874
+ const { handleGuardrailLog } = await import("./guardrail-log-qfc2j0tb.js");
32774
32875
  return handleGuardrailLog(ctx.directory, ctx.args);
32775
32876
  },
32776
32877
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -36019,6 +36120,9 @@ function dcStripOneWrapper(cmd) {
36019
36120
  const shellMatch = /^(?:bash|sh|zsh|dash|fish)(?:\.exe)?\s+-c\s+"?(.*?)"?\s*$/is.exec(t);
36020
36121
  if (shellMatch)
36021
36122
  return shellMatch[1].trim();
36123
+ const evalMatch = /^eval\s+(.+)$/is.exec(t);
36124
+ if (evalMatch)
36125
+ return evalMatch[1].replace(/^["']|["']$/g, "").trim();
36022
36126
  const prefixMatch = /^(?:sudo|time|nohup)\s+(.+)$/is.exec(t) ?? /^env(?:\s+[A-Za-z_][A-Za-z0-9_]*=[^\s]*)*\s+(.+)$/is.exec(t) ?? /^nice\s+(?:-n\s+\d+\s+)?(.+)$/is.exec(t);
36023
36127
  if (prefixMatch)
36024
36128
  return prefixMatch[1].trim();
@@ -36080,6 +36184,15 @@ function dcSplitSegments(cmd) {
36080
36184
  current = "";
36081
36185
  continue;
36082
36186
  }
36187
+ if (ch === "&" && next !== "&") {
36188
+ const prev = cmd[i - 1];
36189
+ const isFdRedirect = prev === ">" || next === ">";
36190
+ if (!isFdRedirect) {
36191
+ segments.push(current.trim());
36192
+ current = "";
36193
+ continue;
36194
+ }
36195
+ }
36083
36196
  }
36084
36197
  current += ch;
36085
36198
  }
@@ -38727,7 +38840,7 @@ function hasActiveEpicMode(sessionID) {
38727
38840
  async function rehydratePrSubscriptions(sessionID, directory) {
38728
38841
  const map = new Map;
38729
38842
  try {
38730
- const { listActive: listActive2 } = await import("./pr-subscriptions-p8g2rzxd.js");
38843
+ const { listActive: listActive2 } = await import("./pr-subscriptions-vwv7zm2p.js");
38731
38844
  const records = await listActive2(directory);
38732
38845
  for (const record of records) {
38733
38846
  if (record.sessionID !== sessionID)
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  readSwarmFileAsync,
14
14
  validateSwarmPath
15
- } from "./index-1rga1vvb.js";
15
+ } from "./index-wh8949ef.js";
16
16
  import {
17
17
  readCachedParsedFile
18
18
  } from "./index-jtqkh8jf.js";
@@ -27,22 +27,22 @@ import {
27
27
  readTaskEvidence,
28
28
  readTaskEvidenceRaw,
29
29
  sanitizeTaskId
30
- } from "./index-x5g7et24.js";
30
+ } from "./index-4h2ea8h5.js";
31
31
  import {
32
32
  ZodError,
33
33
  exports_external
34
34
  } from "./index-293f68mj.js";
35
35
  import {
36
36
  withEvidenceLock
37
- } from "./index-5mkc2f9z.js";
37
+ } from "./index-4sckv7y6.js";
38
38
  import {
39
39
  emit
40
- } from "./index-vn263hqt.js";
40
+ } from "./index-pa6t33pt.js";
41
41
  import {
42
42
  bunHash,
43
43
  bunWrite,
44
44
  mergeEnvForChild
45
- } from "./index-h91bv3hy.js";
45
+ } from "./index-qe3v54nb.js";
46
46
  import {
47
47
  __esm,
48
48
  __export,
@@ -265,10 +265,10 @@ function buildSandboxProfile(scopePaths, tempDir, envOverrides) {
265
265
  (allow file-read* (subpath "/sbin"))
266
266
  (allow file-read* (subpath "/lib"))
267
267
  (allow file-read* (subpath "/lib64"))
268
+ (deny file-write*)
268
269
  ${rwAllowLines}
269
270
  ${envLines.join(`
270
- `)}
271
- (deny file-write*)`;
271
+ `)}`;
272
272
  return profile;
273
273
  }
274
274
 
@@ -351,7 +351,8 @@ var init_sandbox_exec_executor = __esm(() => {
351
351
  init_executor();
352
352
  SANDBOX_UNAVAILABLE_CODES = new Set(["ENOENT", "EACCES", "ENOSPC"]);
353
353
  _internals3 = {
354
- probeSandboxExec
354
+ probeSandboxExec,
355
+ buildSandboxProfile
355
356
  };
356
357
  });
357
358
 
@@ -792,7 +793,7 @@ async function _createExecutor() {
792
793
  return null;
793
794
  }
794
795
  async function _createLinuxExecutor() {
795
- const { SandboxCapabilityProbe, isBubblewrapAvailable } = await import("./capability-probe-sh9bwh39.js");
796
+ const { SandboxCapabilityProbe, isBubblewrapAvailable } = await import("./capability-probe-f1paszww.js");
796
797
  await new SandboxCapabilityProbe().detect();
797
798
  if (!isBubblewrapAvailable()) {
798
799
  return null;
@@ -805,7 +806,7 @@ async function _createLinuxExecutor() {
805
806
  }
806
807
  }
807
808
  async function _createMacOSExecutor() {
808
- const { SandboxCapabilityProbe, isSandboxExecAvailable } = await import("./capability-probe-sh9bwh39.js");
809
+ const { SandboxCapabilityProbe, isSandboxExecAvailable } = await import("./capability-probe-f1paszww.js");
809
810
  await new SandboxCapabilityProbe().detect();
810
811
  if (!isSandboxExecAvailable()) {
811
812
  return null;
@@ -818,7 +819,7 @@ async function _createMacOSExecutor() {
818
819
  }
819
820
  }
820
821
  async function _createWindowsExecutor() {
821
- const { SandboxCapabilityProbe, isWindowsSandboxAvailable } = await import("./capability-probe-sh9bwh39.js");
822
+ const { SandboxCapabilityProbe, isWindowsSandboxAvailable } = await import("./capability-probe-f1paszww.js");
822
823
  await new SandboxCapabilityProbe().detect();
823
824
  if (!isWindowsSandboxAvailable()) {
824
825
  return null;
@@ -1543,6 +1544,8 @@ function loadDurableStatus(statusPath) {
1543
1544
  }
1544
1545
  }
1545
1546
  function initDurableStatusPath(projectDir) {
1547
+ if (typeof projectDir !== "string" || projectDir.length === 0)
1548
+ return;
1546
1549
  const nextPath = path5.join(projectDir, ".swarm", "worktree-merge-status.json");
1547
1550
  if (durableStatusPath === nextPath && hasLoaded)
1548
1551
  return;
@@ -5,7 +5,7 @@ import {
5
5
  } from "./index-zgwm4ryv.js";
6
6
  import {
7
7
  atomicWriteFile
8
- } from "./index-0dab9w37.js";
8
+ } from "./index-0p660a87.js";
9
9
 
10
10
  // src/hooks/knowledge-link.ts
11
11
  import {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  stripKnownSwarmPrefix
4
- } from "./index-1ey3dxq7.js";
4
+ } from "./index-147ja18h.js";
5
5
  import {
6
6
  init_logger,
7
7
  warn
@@ -7,7 +7,7 @@ import {
7
7
  } from "./index-zgwm4ryv.js";
8
8
  import {
9
9
  bunSpawnSync
10
- } from "./index-h91bv3hy.js";
10
+ } from "./index-qe3v54nb.js";
11
11
  import {
12
12
  __export
13
13
  } from "./index-a76rekgs.js";