opencode-swarm 7.141.0 → 7.141.1

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 (44) hide show
  1. package/dist/cli/{config-doctor-ayer8jwj.js → config-doctor-xs2p0xy3.js} +2 -2
  2. package/dist/cli/{core-yep18rkf.js → core-znrxk8gw.js} +1 -1
  3. package/dist/cli/{curator-fkwhph34.js → curator-a95x81ek.js} +17 -17
  4. package/dist/cli/{curator-llm-factory-b1wtbwwv.js → curator-llm-factory-ak7p0scv.js} +17 -17
  5. package/dist/cli/{dispatch-y8rergph.js → dispatch-rd10kdk1.js} +1 -1
  6. package/dist/cli/{evidence-summary-service-8e6594tg.js → evidence-summary-service-2gk48s5s.js} +4 -4
  7. package/dist/cli/{guardrail-explain-fhx1kft6.js → guardrail-explain-4st3vc3d.js} +18 -18
  8. package/dist/cli/{guardrail-log-x94s1jh9.js → guardrail-log-vjexgpfm.js} +3 -3
  9. package/dist/cli/{hive-promoter-3ay1hffy.js → hive-promoter-g9ad9vad.js} +17 -17
  10. package/dist/cli/{index-x5kk9gyk.js → index-2ygp3pnx.js} +5 -5
  11. package/dist/cli/{index-pkby67j3.js → index-39xs96mk.js} +1 -1
  12. package/dist/cli/{index-m54erqap.js → index-3gfdb0t9.js} +1 -1
  13. package/dist/cli/{index-9snyxgtf.js → index-44nf5s90.js} +1 -1
  14. package/dist/cli/{index-nkr3j0j1.js → index-5ykn39wq.js} +2 -2
  15. package/dist/cli/{index-sd1w4pya.js → index-8056f16v.js} +2 -2
  16. package/dist/cli/{index-w95sxwfr.js → index-8s4vnqts.js} +1 -1
  17. package/dist/cli/{index-awwqa1f5.js → index-c6m3t5n2.js} +2 -2
  18. package/dist/cli/{index-nk2ma3mh.js → index-dx1mdsrj.js} +134 -72
  19. package/dist/cli/{index-ays8g6cm.js → index-ebwznsfy.js} +54 -14
  20. package/dist/cli/{index-h375yxj5.js → index-g29r600w.js} +19 -19
  21. package/dist/cli/{index-fcsf8vjm.js → index-hjf8pjd4.js} +3 -3
  22. package/dist/cli/{index-xcqst95a.js → index-mr397tze.js} +1 -1
  23. package/dist/cli/{index-g4w73p1v.js → index-pkxt2rg2.js} +1 -1
  24. package/dist/cli/{index-acpsb3g1.js → index-ry609ctr.js} +3 -3
  25. package/dist/cli/{index-ytnm84ed.js → index-vnr917xf.js} +3 -3
  26. package/dist/cli/{index-b9mwe99e.js → index-w9613ace.js} +4 -4
  27. package/dist/cli/{index-10zsx1x2.js → index-wbf8sv70.js} +1 -1
  28. package/dist/cli/{index-1dwa96x7.js → index-ysapwztd.js} +2 -2
  29. package/dist/cli/{index-fckf6g01.js → index-z8yr1yra.js} +1 -1
  30. package/dist/cli/{index-rx33k785.js → index-zqshpey0.js} +1 -1
  31. package/dist/cli/index.js +17 -17
  32. package/dist/cli/{knowledge-escalator-53m3sh8p.js → knowledge-escalator-5xg6vmr4.js} +6 -6
  33. package/dist/cli/{knowledge-events-s5pmx5h3.js → knowledge-events-qvzpqt5b.js} +4 -4
  34. package/dist/cli/{knowledge-store-dv70gxxc.js → knowledge-store-k5td1vqx.js} +1 -1
  35. package/dist/cli/{knowledge-validator-je30smbr.js → knowledge-validator-zz26gk5d.js} +2 -2
  36. package/dist/cli/{scan-cursor-tcdcjbp9.js → scan-cursor-nhcpebh5.js} +2 -2
  37. package/dist/cli/{schema-6cg2smxx.js → schema-6ecb0xhn.js} +1 -1
  38. package/dist/cli/{scope-persistence-v51d74j2.js → scope-persistence-yet1hvmq.js} +4 -4
  39. package/dist/cli/{skill-generator-7kp8s0ne.js → skill-generator-j0mbd2pp.js} +7 -7
  40. package/dist/cli/{worktree-isolation-g6t99t0x.js → worktree-isolation-445zjngp.js} +17 -17
  41. package/dist/index.js +12 -12
  42. package/dist/lang/backend.d.ts +1 -0
  43. package/dist/tools/test-runner.d.ts +3 -2
  44. package/package.json +1 -1
@@ -9,7 +9,7 @@ import {
9
9
  getProfileForFile,
10
10
  isCommandAvailable,
11
11
  tool
12
- } from "./index-ays8g6cm.js";
12
+ } from "./index-ebwznsfy.js";
13
13
  import {
14
14
  captureWorkingTreeFingerprint,
15
15
  createModelEvaluationExecutor,
@@ -20,7 +20,7 @@ import {
20
20
  } from "./index-f1hsrgw1.js";
21
21
  import {
22
22
  stableCanonicalStringify
23
- } from "./index-pkby67j3.js";
23
+ } from "./index-39xs96mk.js";
24
24
  import {
25
25
  getGlobalEventBus
26
26
  } from "./index-c8s9a3zh.js";
@@ -29,7 +29,7 @@ import {
29
29
  readDoctorArtifact,
30
30
  removeStraySwarmDir,
31
31
  runConfigDoctor
32
- } from "./index-m54erqap.js";
32
+ } from "./index-3gfdb0t9.js";
33
33
  import {
34
34
  MAX_TRANSIENT_RETRIES,
35
35
  archiveEvidence,
@@ -75,7 +75,7 @@ import {
75
75
  transientBackoff,
76
76
  updateTaskCheckpointReceipt,
77
77
  validateProjectRoot
78
- } from "./index-awwqa1f5.js";
78
+ } from "./index-c6m3t5n2.js";
79
79
  import {
80
80
  loadDatabaseCtor
81
81
  } from "./index-134d35c1.js";
@@ -161,15 +161,15 @@ import {
161
161
  retireSkill,
162
162
  selectCandidateEntries,
163
163
  syncBundledProjectSkillsIfMissingAsync
164
- } from "./index-fcsf8vjm.js";
164
+ } from "./index-hjf8pjd4.js";
165
165
  import {
166
166
  readRecentEscalations
167
- } from "./index-x5kk9gyk.js";
167
+ } from "./index-2ygp3pnx.js";
168
168
  import {
169
169
  alreadyCuratedThisGeneration,
170
170
  claimNextScanBatch,
171
171
  resolveCohortId
172
- } from "./index-xcqst95a.js";
172
+ } from "./index-mr397tze.js";
173
173
  import {
174
174
  CURATOR_INIT_PROMPT,
175
175
  CURATOR_PHASE_PROMPT,
@@ -186,7 +186,7 @@ import {
186
186
  clearAllScopes,
187
187
  clearScopeBindingFromDisk,
188
188
  clearScopeBindings
189
- } from "./index-sd1w4pya.js";
189
+ } from "./index-8056f16v.js";
190
190
  import {
191
191
  appendLedgerEvent,
192
192
  computePlanHash,
@@ -196,7 +196,7 @@ import {
196
196
  initLedger,
197
197
  readLedgerEvents,
198
198
  takeSnapshotEvent
199
- } from "./index-rx33k785.js";
199
+ } from "./index-zqshpey0.js";
200
200
  import {
201
201
  clearWorktreeMergeStatus,
202
202
  getAllWorktreeMergeFailures,
@@ -208,7 +208,7 @@ import {
208
208
  cleanUntrackedFiles,
209
209
  provisionWorktree,
210
210
  removeWorktree
211
- } from "./index-10zsx1x2.js";
211
+ } from "./index-wbf8sv70.js";
212
212
  import {
213
213
  WORKTREE_LIFECYCLE_LOCK_FILE,
214
214
  recordWorktreeProvisioningOwner,
@@ -241,7 +241,7 @@ import {
241
241
  recordKnowledgeEvent,
242
242
  recordPhaseCloseIntent,
243
243
  resolveKnowledgeEventsPath
244
- } from "./index-acpsb3g1.js";
244
+ } from "./index-ry609ctr.js";
245
245
  import {
246
246
  readSwarmFileAsync,
247
247
  safeHook,
@@ -257,7 +257,7 @@ import {
257
257
  validateActionableFields,
258
258
  validateLesson,
259
259
  validateSkillPath
260
- } from "./index-w95sxwfr.js";
260
+ } from "./index-8s4vnqts.js";
261
261
  import {
262
262
  authorizeCuration,
263
263
  buildConfigFingerprintInput
@@ -294,7 +294,7 @@ import {
294
294
  transactFile,
295
295
  transactKnowledge,
296
296
  wordBigrams
297
- } from "./index-b9mwe99e.js";
297
+ } from "./index-w9613ace.js";
298
298
  import {
299
299
  resolveHiveDataDir,
300
300
  resolveHiveEventsPath,
@@ -335,7 +335,7 @@ import {
335
335
  } from "./index-4nt52yr9.js";
336
336
  import {
337
337
  resolveWorktreeIsolationConfig
338
- } from "./index-1dwa96x7.js";
338
+ } from "./index-ysapwztd.js";
339
339
  import {
340
340
  RetrospectiveEvidenceSchema
341
341
  } from "./index-gprxjmm7.js";
@@ -345,7 +345,7 @@ import {
345
345
  init_loader,
346
346
  loadPluginConfig,
347
347
  loadPluginConfigWithMeta
348
- } from "./index-fckf6g01.js";
348
+ } from "./index-z8yr1yra.js";
349
349
  import {
350
350
  advisoryWarn,
351
351
  getDeferredWarnings,
@@ -371,7 +371,7 @@ import {
371
371
  package_default,
372
372
  resolveAutoReviewConfig,
373
373
  stripKnownSwarmPrefix
374
- } from "./index-g4w73p1v.js";
374
+ } from "./index-pkxt2rg2.js";
375
375
  import {
376
376
  AGENT_TOOL_MAP,
377
377
  ALL_AGENT_NAMES,
@@ -14524,7 +14524,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
14524
14524
  };
14525
14525
  }
14526
14526
  async function sweepActiveNearDuplicates(directory, options = {}) {
14527
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-ytnm84ed.js");
14527
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-vnr917xf.js");
14528
14528
  const { config } = loadPluginConfigWithMeta2(directory);
14529
14529
  const sweepConfig = config.learning?.dedup_sweep;
14530
14530
  if (sweepConfig?.enabled === false)
@@ -15608,7 +15608,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
15608
15608
  }
15609
15609
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
15610
15610
  try {
15611
- const skillModule = await import("./skill-generator-7kp8s0ne.js");
15611
+ const skillModule = await import("./skill-generator-j0mbd2pp.js");
15612
15612
  for (const cand of skillCandidates) {
15613
15613
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
15614
15614
  continue;
@@ -16068,7 +16068,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
16068
16068
  } catch {}
16069
16069
  }
16070
16070
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
16071
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-53m3sh8p.js");
16071
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-5xg6vmr4.js");
16072
16072
  for (const { id } of contradictedEntries) {
16073
16073
  try {
16074
16074
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -16887,7 +16887,7 @@ async function runCuratorPostMortem(directory, options = {}) {
16887
16887
  warnings.push("Failed to collect knowledge summary.");
16888
16888
  }
16889
16889
  try {
16890
- const { getScanStatus } = await import("./scan-cursor-tcdcjbp9.js");
16890
+ const { getScanStatus } = await import("./scan-cursor-nhcpebh5.js");
16891
16891
  const scanStatus = await getScanStatus(directory);
16892
16892
  if (scanStatus.remaining_estimate > 0) {
16893
16893
  warnings.push(`Fair scan: reviewed ${knowledgeSummary.length} entries this sweep (generation ${scanStatus.generation}); ${scanStatus.remaining_estimate} more eligible entries will be visited in future curation sweeps.`);
@@ -17059,9 +17059,9 @@ var _internals22 = {
17059
17059
  verifyPostMortemKnowledgeActions,
17060
17060
  repairPostMortemActions,
17061
17061
  loadDefaultKnowledgeConfig: async (directory) => {
17062
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-6cg2smxx.js");
17062
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-6ecb0xhn.js");
17063
17063
  try {
17064
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-ytnm84ed.js");
17064
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-vnr917xf.js");
17065
17065
  const loaded = loadPluginConfigWithMeta2(directory);
17066
17066
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
17067
17067
  } catch {
@@ -17069,11 +17069,11 @@ var _internals22 = {
17069
17069
  }
17070
17070
  },
17071
17071
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
17072
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-fkwhph34.js");
17072
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-a95x81ek.js");
17073
17073
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
17074
17074
  },
17075
17075
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
17076
- const { checkHivePromotions } = await import("./hive-promoter-3ay1hffy.js");
17076
+ const { checkHivePromotions } = await import("./hive-promoter-g9ad9vad.js");
17077
17077
  return checkHivePromotions(entries, knowledgeConfig, directory);
17078
17078
  },
17079
17079
  applyProposalTriage: async (directory, triage) => {
@@ -17082,7 +17082,7 @@ var _internals22 = {
17082
17082
  activateProposal,
17083
17083
  listSkills: listSkills2,
17084
17084
  sanitizeSlug
17085
- } = await import("./skill-generator-7kp8s0ne.js");
17085
+ } = await import("./skill-generator-j0mbd2pp.js");
17086
17086
  const result = {
17087
17087
  approved: [],
17088
17088
  rejected: [],
@@ -18357,9 +18357,9 @@ function hashContent(content) {
18357
18357
  return createHash7("sha1").update(content).digest("hex");
18358
18358
  }
18359
18359
  async function loadConfigForPolicyCurator(directory) {
18360
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-6cg2smxx.js");
18360
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-6ecb0xhn.js");
18361
18361
  try {
18362
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-ytnm84ed.js");
18362
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-vnr917xf.js");
18363
18363
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
18364
18364
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
18365
18365
  } catch {
@@ -26953,7 +26953,7 @@ async function runFinalizeStage(ctx) {
26953
26953
  }
26954
26954
  }
26955
26955
  try {
26956
- const { CuratorConfigSchema: CCS } = await import("./schema-6cg2smxx.js");
26956
+ const { CuratorConfigSchema: CCS } = await import("./schema-6ecb0xhn.js");
26957
26957
  const { config: pmLoadedConfig } = _internals35.loadPluginConfigWithMeta(ctx.directory);
26958
26958
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
26959
26959
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -29226,9 +29226,9 @@ var _internals40 = {
29226
29226
  loadPluginConfigWithMeta,
29227
29227
  loadCuratorDeps: async () => {
29228
29228
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
29229
- import("./schema-6cg2smxx.js"),
29230
- import("./curator-fkwhph34.js"),
29231
- import("./curator-llm-factory-b1wtbwwv.js")
29229
+ import("./schema-6ecb0xhn.js"),
29230
+ import("./curator-a95x81ek.js"),
29231
+ import("./curator-llm-factory-ak7p0scv.js")
29232
29232
  ]);
29233
29233
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
29234
29234
  }
@@ -30133,7 +30133,7 @@ async function computeCurationDiagnostics(directory, entries) {
30133
30133
  let scanCompleted = false;
30134
30134
  let scanRemaining = 0;
30135
30135
  try {
30136
- const { getScanStatus } = await import("./scan-cursor-tcdcjbp9.js");
30136
+ const { getScanStatus } = await import("./scan-cursor-nhcpebh5.js");
30137
30137
  const status = await getScanStatus(directory);
30138
30138
  scanGeneration = status.generation;
30139
30139
  scanCompleted = status.completed;
@@ -30143,10 +30143,10 @@ async function computeCurationDiagnostics(directory, entries) {
30143
30143
  try {
30144
30144
  const { isLinked: isLinked2 } = await import("./knowledge-link-x86ebng8.js");
30145
30145
  if (isLinked2(directory)) {
30146
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-6cg2smxx.js");
30146
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-6ecb0xhn.js");
30147
30147
  let config;
30148
30148
  try {
30149
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-ytnm84ed.js");
30149
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-vnr917xf.js");
30150
30150
  const loaded = loadPluginConfigWithMeta2(directory);
30151
30151
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
30152
30152
  } catch {
@@ -31364,7 +31364,7 @@ async function handleDoctorCommand(directory, args) {
31364
31364
  const result = runConfigDoctor(config, directory);
31365
31365
  let output;
31366
31366
  if (enableAutoFix && result.hasAutoFixableIssues) {
31367
- const { runConfigDoctorWithFixes } = await import("./config-doctor-ayer8jwj.js");
31367
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-xs2p0xy3.js");
31368
31368
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
31369
31369
  applyLossy: true
31370
31370
  });
@@ -32201,7 +32201,7 @@ async function handleEvidenceCommand(directory, args) {
32201
32201
  return formatTaskEvidenceMarkdown(evidenceData);
32202
32202
  }
32203
32203
  async function handleEvidenceSummaryCommand(directory) {
32204
- const { buildEvidenceSummary } = await import("./evidence-summary-service-8e6594tg.js");
32204
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-2gk48s5s.js");
32205
32205
  const artifact = await buildEvidenceSummary(directory);
32206
32206
  if (!artifact) {
32207
32207
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -44408,6 +44408,10 @@ var POWERSHELL_METACHARACTERS = /[|;&`$(){}[\]<>"'#*?\x00-\x1f]/;
44408
44408
  function containsPowerShellMetacharacters(str) {
44409
44409
  return POWERSHELL_METACHARACTERS.test(str);
44410
44410
  }
44411
+ var SHELL_METACHARACTERS2 = /[;&`$(){}<>"'\x00-\x1f]/;
44412
+ function containsShellMetacharacters(str) {
44413
+ return SHELL_METACHARACTERS2.test(str);
44414
+ }
44411
44415
  function validateArgs2(args) {
44412
44416
  if (typeof args !== "object" || args === null)
44413
44417
  return false;
@@ -44462,6 +44466,24 @@ function validateArgs2(args) {
44462
44466
  return false;
44463
44467
  }
44464
44468
  }
44469
+ if (obj.targets !== undefined) {
44470
+ if (!Array.isArray(obj.targets))
44471
+ return false;
44472
+ for (const t of obj.targets) {
44473
+ if (typeof t !== "string")
44474
+ return false;
44475
+ if (t.length === 0)
44476
+ return false;
44477
+ if (isAbsolutePath(t))
44478
+ return false;
44479
+ if (containsPathTraversal(t))
44480
+ return false;
44481
+ if (containsControlChars(t))
44482
+ return false;
44483
+ if (containsShellMetacharacters(t))
44484
+ return false;
44485
+ }
44486
+ }
44465
44487
  if (obj.coverage !== undefined) {
44466
44488
  if (typeof obj.coverage !== "boolean")
44467
44489
  return false;
@@ -44651,7 +44673,7 @@ var DISPATCH_FRAMEWORK_MAP = {
44651
44673
  };
44652
44674
  async function detectTestFrameworkViaDispatch(cwd) {
44653
44675
  try {
44654
- const { pickBackend } = await import("./dispatch-y8rergph.js");
44676
+ const { pickBackend } = await import("./dispatch-rd10kdk1.js");
44655
44677
  const backend = await pickBackend(cwd);
44656
44678
  if (!backend?.selectTestFramework)
44657
44679
  return "none";
@@ -44663,17 +44685,18 @@ async function detectTestFrameworkViaDispatch(cwd) {
44663
44685
  return "none";
44664
44686
  }
44665
44687
  }
44666
- async function buildTestCommandViaDispatch(framework, scope, files, coverage, baseDir, bail, nativeTarget) {
44688
+ async function buildTestCommandViaDispatch(framework, scope, files, coverage, baseDir, bail, targets, nativeTarget) {
44667
44689
  if (framework === "none")
44668
44690
  return null;
44669
44691
  try {
44670
- const { pickBackend } = await import("./dispatch-y8rergph.js");
44692
+ const { pickBackend } = await import("./dispatch-rd10kdk1.js");
44671
44693
  const backend = await pickBackend(baseDir);
44672
44694
  if (backend?.buildTestCommand) {
44673
44695
  const cmd = backend.buildTestCommand(framework, files, baseDir, {
44674
44696
  scope,
44675
44697
  coverage,
44676
44698
  bail,
44699
+ targets,
44677
44700
  nativeTarget
44678
44701
  });
44679
44702
  if (cmd)
@@ -44688,7 +44711,7 @@ async function parseTestOutputViaDispatch(framework, output, baseDir) {
44688
44711
  if (framework === "none")
44689
44712
  return null;
44690
44713
  try {
44691
- const { pickBackend } = await import("./dispatch-y8rergph.js");
44714
+ const { pickBackend } = await import("./dispatch-rd10kdk1.js");
44692
44715
  const backend = await pickBackend(baseDir);
44693
44716
  if (!backend?.parseTestOutput)
44694
44717
  return null;
@@ -45079,7 +45102,7 @@ function getTargetedExecutionUnsupportedReason(framework) {
45079
45102
  return null;
45080
45103
  }
45081
45104
  }
45082
- function buildTestCommand(framework, scope, files, coverage, baseDir, bail, nativeTarget) {
45105
+ function buildTestCommand(framework, scope, files, coverage, baseDir, bail, targets, nativeTarget) {
45083
45106
  if (nativeTarget) {
45084
45107
  return nativeTarget.framework === framework ? buildNativeTargetCommand(nativeTarget) : null;
45085
45108
  }
@@ -45147,7 +45170,9 @@ function buildTestCommand(framework, scope, files, coverage, baseDir, bail, nati
45147
45170
  }
45148
45171
  case "cargo": {
45149
45172
  const args = ["cargo", "test"];
45150
- if (scope !== "all" && files.length > 0) {
45173
+ if (targets && targets.length > 0) {
45174
+ args.push("--", ...targets);
45175
+ } else if (scope !== "all" && files.length > 0) {
45151
45176
  args.push(...files);
45152
45177
  }
45153
45178
  return args;
@@ -45163,22 +45188,47 @@ function buildTestCommand(framework, scope, files, coverage, baseDir, bail, nati
45163
45188
  }
45164
45189
  return ["pwsh", "-Command", "Invoke-Pester"];
45165
45190
  }
45166
- case "go-test":
45167
- return ["go", "test", "./..."];
45168
- case "maven":
45169
- return ["mvn", "test"];
45191
+ case "go-test": {
45192
+ const args = ["go", "test"];
45193
+ if (targets && targets.length > 0) {
45194
+ args.push("-run", targets.join("|"));
45195
+ }
45196
+ args.push("./...");
45197
+ return args;
45198
+ }
45199
+ case "maven": {
45200
+ const args = ["mvn", "test"];
45201
+ if (targets && targets.length > 0) {
45202
+ args.push(`-Dtest=${targets.join(",")}`);
45203
+ }
45204
+ return args;
45205
+ }
45170
45206
  case "gradle": {
45171
45207
  const isWindows = process.platform === "win32";
45172
45208
  const hasGradlewBat = fs33.existsSync(path76.join(baseDir, "gradlew.bat"));
45173
45209
  const hasGradlew = fs33.existsSync(path76.join(baseDir, "gradlew"));
45210
+ const args = [];
45174
45211
  if (hasGradlewBat && isWindows)
45175
- return ["gradlew.bat", "test"];
45176
- if (hasGradlew)
45177
- return ["./gradlew", "test"];
45178
- return ["gradle", "test"];
45212
+ args.push("gradlew.bat");
45213
+ else if (hasGradlew)
45214
+ args.push("./gradlew");
45215
+ else
45216
+ args.push("gradle");
45217
+ args.push("test");
45218
+ if (targets && targets.length > 0) {
45219
+ for (const target of targets) {
45220
+ args.push("--tests", target);
45221
+ }
45222
+ }
45223
+ return args;
45224
+ }
45225
+ case "dotnet-test": {
45226
+ const args = ["dotnet", "test"];
45227
+ if (targets && targets.length > 0) {
45228
+ args.push("--filter", targets.join("|"));
45229
+ }
45230
+ return args;
45179
45231
  }
45180
- case "dotnet-test":
45181
- return ["dotnet", "test"];
45182
45232
  case "ctest": {
45183
45233
  const buildDirCandidates = [
45184
45234
  "build",
@@ -45188,10 +45238,21 @@ function buildTestCommand(framework, scope, files, coverage, baseDir, bail, nati
45188
45238
  "out"
45189
45239
  ];
45190
45240
  const actualBuildDir = buildDirCandidates.find((d) => fs33.existsSync(path76.join(baseDir, d, "CMakeCache.txt"))) ?? "build";
45191
- return ["ctest", "--test-dir", actualBuildDir];
45241
+ const args = ["ctest", "--test-dir", actualBuildDir];
45242
+ if (targets && targets.length > 0) {
45243
+ args.push("-R", targets.join("|"));
45244
+ }
45245
+ return args;
45246
+ }
45247
+ case "swift-test": {
45248
+ const args = ["swift", "test"];
45249
+ if (targets && targets.length > 0) {
45250
+ for (const target of targets) {
45251
+ args.push("--filter", target);
45252
+ }
45253
+ }
45254
+ return args;
45192
45255
  }
45193
- case "swift-test":
45194
- return ["swift", "test"];
45195
45256
  case "dart-test":
45196
45257
  return _internals66.isCommandAvailable("flutter") ? ["flutter", "test", ...files] : ["dart", "test", ...files];
45197
45258
  case "rspec": {
@@ -45640,7 +45701,7 @@ function formatPassingMessage(framework, totals, coveragePercent) {
45640
45701
  function formatNativeHistoryTestFile(target, historyPath) {
45641
45702
  return `native:${target.framework}:path=${encodeURIComponent(historyPath)}#name=${encodeURIComponent(target.name)}`;
45642
45703
  }
45643
- async function runTests(framework, scope, files, coverage, timeout_ms, cwd, bail, nativeTarget) {
45704
+ async function runTests(framework, scope, files, coverage, timeout_ms, cwd, bail, targets, nativeTarget) {
45644
45705
  let executionCwd = cwd;
45645
45706
  let resolvedNativeTarget = nativeTarget;
45646
45707
  if (scope === "target" && !nativeTarget || scope !== "target" && nativeTarget !== undefined || nativeTarget !== undefined && nativeTarget.framework !== framework) {
@@ -45687,7 +45748,7 @@ async function runTests(framework, scope, files, coverage, timeout_ms, cwd, bail
45687
45748
  resolvedNativeTarget = resolvedTarget.target;
45688
45749
  executionCwd = resolvedTarget.executionDirectory;
45689
45750
  }
45690
- if (scope !== "all" && scope !== "target" && files.length > 0) {
45751
+ if (scope !== "all" && scope !== "target" && files.length > 0 && !(targets && targets.length > 0)) {
45691
45752
  const unsupportedReason = getTargetedExecutionUnsupportedReason(framework);
45692
45753
  if (unsupportedReason) {
45693
45754
  return {
@@ -45701,7 +45762,7 @@ async function runTests(framework, scope, files, coverage, timeout_ms, cwd, bail
45701
45762
  }
45702
45763
  }
45703
45764
  const useDispatchBuild = process.env.SWARM_LANG_BACKEND !== "legacy";
45704
- const command = useDispatchBuild ? await buildTestCommandViaDispatch(framework, scope, files, coverage, executionCwd, bail, resolvedNativeTarget) ?? buildTestCommand(framework, scope, files, coverage, executionCwd, bail, resolvedNativeTarget) : buildTestCommand(framework, scope, files, coverage, executionCwd, bail, resolvedNativeTarget);
45765
+ const command = useDispatchBuild ? await buildTestCommandViaDispatch(framework, scope, files, coverage, executionCwd, bail, targets, resolvedNativeTarget) ?? buildTestCommand(framework, scope, files, coverage, executionCwd, bail, targets, resolvedNativeTarget) : buildTestCommand(framework, scope, files, coverage, executionCwd, bail, targets, resolvedNativeTarget);
45705
45766
  if (!command) {
45706
45767
  return {
45707
45768
  success: false,
@@ -46035,7 +46096,7 @@ function analyzeFailures(workingDir) {
46035
46096
  return report;
46036
46097
  }
46037
46098
  var test_runner = createSwarmTool({
46038
- description: 'Run project tests with automatic framework detection for bun, vitest, jest, mocha, pytest, cargo, pester, go test, maven, gradle, dotnet test, ctest, swift test, dart test, rspec, minitest, pest, phpunit, or php-artisan. Returns JSON with success, framework, scope, command, timeout_ms, duration_ms, totals, outcome, and optional coveragePercent, rawOutput, testCases, and message fields. Scope "target" runs one exact Go test/subtest or CTest name via native_target using a workspace-relative package/build directory, with no broad fallback, coverage, or bail.',
46099
+ description: 'Run project tests with automatic framework detection for bun, vitest, jest, mocha, pytest, cargo, pester, go test, maven, gradle, dotnet test, ctest, swift test, dart test, rspec, minitest, pest, phpunit, or php-artisan. Returns JSON with success, framework, scope, command, timeout_ms, duration_ms, totals, outcome, and optional coveragePercent, rawOutput, testCases, and message fields. Scope "target" runs one exact Go test/subtest or CTest name via native_target using a workspace-relative package/build directory, with no broad fallback, coverage, or bail. The "targets" array passes framework-native test name patterns to cargo, go-test, maven, gradle, dotnet-test, ctest, and swift-test.',
46039
46100
  args: {
46040
46101
  scope: exports_external.enum(["all", "convention", "graph", "impact", "target"]).optional().describe('Test scope: "all" runs the full suite, "convention"/"graph"/"impact" resolve files, and "target" runs one exact Go or CTest native name without file fallback.'),
46041
46102
  native_target: exports_external.object({
@@ -46044,6 +46105,7 @@ var test_runner = createSwarmTool({
46044
46105
  path: exports_external.string()
46045
46106
  }).optional().describe('For scope "target": exact framework-native test name plus a workspace-relative package/build directory. Absolute paths, traversal, coverage, bail, and broad fallback are rejected.'),
46046
46107
  files: exports_external.array(exports_external.string()).optional().describe('Specific files to test. For "convention", pass source files or direct test files. For "graph" and "impact", pass source files only.'),
46108
+ targets: exports_external.array(exports_external.string()).optional().describe("Framework-native test names or patterns to filter which tests run. Supported by cargo, go-test, maven, gradle, dotnet-test, ctest, and swift-test. Each entry is passed as-is to the framework's native filter flag."),
46047
46109
  coverage: exports_external.boolean().optional().describe("Enable coverage reporting if supported"),
46048
46110
  bail: exports_external.boolean().optional().describe("Stop running tests after the first failure. Default false. Note: coverage may be incomplete when bail=true with coverage=true."),
46049
46111
  timeout_ms: exports_external.number().optional().describe("Timeout in milliseconds (default 60000, max 300000)"),
@@ -46113,7 +46175,7 @@ var test_runner = createSwarmTool({
46113
46175
  framework: "none",
46114
46176
  scope: "all",
46115
46177
  error: "Invalid arguments",
46116
- message: 'scope must be "all", "convention", "graph", "impact", or "target"; target scope requires one valid native_target and cannot be combined with files, coverage, or bail',
46178
+ message: 'scope must be "all", "convention", "graph", "impact", or "target"; files and targets must be string arrays with safe values; target scope requires one valid native_target and cannot be combined with files, coverage, or bail',
46117
46179
  outcome: "error"
46118
46180
  };
46119
46181
  return JSON.stringify(errorResult, null, 2);
@@ -46150,13 +46212,13 @@ var test_runner = createSwarmTool({
46150
46212
  return JSON.stringify(errorResult, null, 2);
46151
46213
  }
46152
46214
  }
46153
- if ((scope === "convention" || scope === "graph" || scope === "impact") && (!args.files || args.files.length === 0)) {
46215
+ if ((scope === "convention" || scope === "graph" || scope === "impact") && (!args.files || args.files.length === 0) && (!args.targets || args.targets.length === 0)) {
46154
46216
  const errorResult = {
46155
46217
  success: false,
46156
46218
  framework: "none",
46157
46219
  scope,
46158
- error: 'scope "convention" and "graph" require explicit files array - omitting files causes unsafe full-project discovery',
46159
- message: 'When using scope "convention" or "graph", you must provide a non-empty "files" array. Use scope "all" for full project test suite without specifying files.',
46220
+ error: 'scope "convention" and "graph" require explicit files or targets array - omitting both causes unsafe full-project discovery',
46221
+ message: 'When using scope "convention" or "graph", you must provide a non-empty "files" or "targets" array. Use scope "all" for full project test suite without specifying files.',
46160
46222
  outcome: "error"
46161
46223
  };
46162
46224
  return JSON.stringify(errorResult, null, 2);
@@ -46378,7 +46440,7 @@ var test_runner = createSwarmTool({
46378
46440
  }
46379
46441
  }
46380
46442
  }
46381
- if (scope !== "all" && scope !== "target" && testFiles.length === 0) {
46443
+ if (scope !== "all" && scope !== "target" && testFiles.length === 0 && !(args.targets && args.targets.length > 0)) {
46382
46444
  const baseMessage = "No matching test files found for the provided source files. Check that test files exist with matching naming conventions (.spec.*, .test.*, .Tests.ps1, __tests__/, tests/, test/, spec/).";
46383
46445
  const errorResult = {
46384
46446
  success: false,
@@ -46404,7 +46466,7 @@ var test_runner = createSwarmTool({
46404
46466
  };
46405
46467
  return JSON.stringify(errorResult, null, 2);
46406
46468
  }
46407
- const result = await runTests(framework, effectiveScope, testFiles, coverage, timeout_ms, nativeExecutionDirectory, bail, nativeTarget);
46469
+ const result = await runTests(framework, effectiveScope, testFiles, coverage, timeout_ms, nativeExecutionDirectory, bail, args.targets, nativeTarget);
46408
46470
  const historyTestFiles = nativeTarget ? [formatNativeHistoryTestFile(nativeTarget, nativeHistoryPath)] : testFiles;
46409
46471
  recordAndAnalyzeResults(result, historyTestFiles, workingDir, nativeTarget ? [] : _files.length > 0 ? _files : undefined, result.testCases);
46410
46472
  let historyReport;
@@ -55824,7 +55886,7 @@ function buildDetailedHelp(commandName, entry) {
55824
55886
  async function handleHelpCommand(ctx) {
55825
55887
  const targetCommand = ctx.args.join(" ");
55826
55888
  if (!targetCommand) {
55827
- const { buildHelpText } = await import("./index-h375yxj5.js");
55889
+ const { buildHelpText } = await import("./index-g29r600w.js");
55828
55890
  return buildHelpText();
55829
55891
  }
55830
55892
  const tokens = targetCommand.split(/\s+/);
@@ -55833,7 +55895,7 @@ async function handleHelpCommand(ctx) {
55833
55895
  return _internals85.buildDetailedHelp(resolved.key, resolved.entry);
55834
55896
  }
55835
55897
  const similar = _internals85.findSimilarCommands(targetCommand);
55836
- const { buildHelpText: fullHelp } = await import("./index-h375yxj5.js");
55898
+ const { buildHelpText: fullHelp } = await import("./index-g29r600w.js");
55837
55899
  if (similar.length > 0) {
55838
55900
  return `Command '/swarm ${targetCommand}' not found.
55839
55901
 
@@ -56010,7 +56072,7 @@ var COMMAND_REGISTRY = {
56010
56072
  },
56011
56073
  "guardrail explain": {
56012
56074
  handler: async (ctx) => {
56013
- const { handleGuardrailExplain } = await import("./guardrail-explain-fhx1kft6.js");
56075
+ const { handleGuardrailExplain } = await import("./guardrail-explain-4st3vc3d.js");
56014
56076
  return handleGuardrailExplain(ctx.directory, ctx.args);
56015
56077
  },
56016
56078
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -56020,7 +56082,7 @@ var COMMAND_REGISTRY = {
56020
56082
  },
56021
56083
  "guardrail-explain": {
56022
56084
  handler: async (ctx) => {
56023
- const { handleGuardrailExplain } = await import("./guardrail-explain-fhx1kft6.js");
56085
+ const { handleGuardrailExplain } = await import("./guardrail-explain-4st3vc3d.js");
56024
56086
  return handleGuardrailExplain(ctx.directory, ctx.args);
56025
56087
  },
56026
56088
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -56030,7 +56092,7 @@ var COMMAND_REGISTRY = {
56030
56092
  },
56031
56093
  "guardrail-log": {
56032
56094
  handler: async (ctx) => {
56033
- const { handleGuardrailLog } = await import("./guardrail-log-x94s1jh9.js");
56095
+ const { handleGuardrailLog } = await import("./guardrail-log-vjexgpfm.js");
56034
56096
  return handleGuardrailLog(ctx.directory, ctx.args);
56035
56097
  },
56036
56098
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -63354,7 +63416,7 @@ async function precreateStandardWorktreeSession(args) {
63354
63416
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, provisionResult.worktreePath);
63355
63417
  if (laneProfile) {
63356
63418
  try {
63357
- const { writeLaneProfileToDiskReal } = await import("./core-yep18rkf.js");
63419
+ const { writeLaneProfileToDiskReal } = await import("./core-znrxk8gw.js");
63358
63420
  await writeLaneProfileToDiskReal(provisionResult.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
63359
63421
  } catch {}
63360
63422
  }
@@ -63853,7 +63915,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
63853
63915
  }
63854
63916
  clearWorktreeMergeStatus(statusKey);
63855
63917
  try {
63856
- const { removeLaneProfileFromDiskReal } = await import("./core-yep18rkf.js");
63918
+ const { removeLaneProfileFromDiskReal } = await import("./core-znrxk8gw.js");
63857
63919
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
63858
63920
  } catch {}
63859
63921
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);