opencode-swarm 7.154.3 → 7.155.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 (67) hide show
  1. package/dist/cli/{coder-settlement-7c9h07f5.js → coder-settlement-2kdtysrg.js} +6 -6
  2. package/dist/cli/{config-doctor-8zjz6dej.js → config-doctor-s6p9aqfv.js} +2 -2
  3. package/dist/cli/{core-dn8bn81g.js → core-ev2ebc4v.js} +1 -1
  4. package/dist/cli/{curation-policy-2jkbybw7.js → curation-policy-jabphe51.js} +4 -4
  5. package/dist/cli/{curator-v12rhct2.js → curator-adp0dsv4.js} +27 -27
  6. package/dist/cli/{curator-llm-factory-mxdjw6kz.js → curator-llm-factory-kd8v16jj.js} +27 -27
  7. package/dist/cli/{evidence-summary-service-zzvvcaa9.js → evidence-summary-service-kpjpd86j.js} +9 -9
  8. package/dist/cli/{gate-evidence-16jkjre9.js → gate-evidence-etbcms2v.js} +4 -4
  9. package/dist/cli/{guardrail-explain-11fx66cx.js → guardrail-explain-wqb5h7kk.js} +28 -28
  10. package/dist/cli/{guardrail-log-ahvfn58c.js → guardrail-log-614g1pta.js} +3 -3
  11. package/dist/cli/{guardrail-reset-zp5xe0n5.js → guardrail-reset-0wdj53cp.js} +27 -27
  12. package/dist/cli/{hive-promoter-k6y06jj8.js → hive-promoter-b1wv52fs.js} +27 -27
  13. package/dist/cli/{index-vntggpez.js → index-0q8kywcf.js} +1 -1
  14. package/dist/cli/{index-g1bh7980.js → index-26cvxrym.js} +2 -2
  15. package/dist/cli/{index-m0fy8jra.js → index-2gfe61qp.js} +312 -216
  16. package/dist/cli/{index-y3kw1zpm.js → index-34wn2ztk.js} +4 -2
  17. package/dist/cli/{index-0f4b9ywa.js → index-6bqqzfbe.js} +1 -1
  18. package/dist/cli/{index-q0prhdds.js → index-79qymsxf.js} +1 -1
  19. package/dist/cli/{index-ed13peqr.js → index-85p1850w.js} +1 -1
  20. package/dist/cli/{index-zak50rve.js → index-aqg7c1z9.js} +1 -1
  21. package/dist/cli/{index-qxj63890.js → index-c590qxts.js} +1 -1
  22. package/dist/cli/{index-env8fk17.js → index-c9nabqzd.js} +1 -1
  23. package/dist/cli/{index-kck2gtxk.js → index-caqe8x14.js} +1 -1
  24. package/dist/cli/{index-n7nnz0jp.js → index-ctsct3hy.js} +6 -6
  25. package/dist/cli/{index-gbkdj7ay.js → index-dw2q720x.js} +2 -2
  26. package/dist/cli/{index-6vcrkz80.js → index-e90g4dsw.js} +4 -4
  27. package/dist/cli/{index-ymgsmjba.js → index-egnpzfe3.js} +4 -4
  28. package/dist/cli/{index-bhjkxasn.js → index-ew6fykvv.js} +1 -1
  29. package/dist/cli/{index-94e20w95.js → index-fjcm6wwf.js} +1 -1
  30. package/dist/cli/{index-d7r6y724.js → index-ketfp4rv.js} +3 -3
  31. package/dist/cli/{index-a6xjn2zt.js → index-kgdbtwfm.js} +5 -5
  32. package/dist/cli/{index-qdnmnq65.js → index-kyc2c7hq.js} +1 -1
  33. package/dist/cli/{index-wkagbmpt.js → index-mm7ase9k.js} +1 -1
  34. package/dist/cli/{index-s23q9v6t.js → index-qj9jrjvr.js} +5 -5
  35. package/dist/cli/{index-9nw6z98k.js → index-qzqpq75z.js} +29 -29
  36. package/dist/cli/{index-v6xkgxts.js → index-rb4t72we.js} +2 -2
  37. package/dist/cli/{index-7qky94rr.js → index-spbxf9vn.js} +1 -1
  38. package/dist/cli/{index-4n557t8w.js → index-t3xqpece.js} +3 -3
  39. package/dist/cli/{index-4dt91x6e.js → index-veajr5x7.js} +1 -1
  40. package/dist/cli/{index-7fyv62b2.js → index-wwv3cbv1.js} +4 -4
  41. package/dist/cli/{index-ckp0z9d4.js → index-x9tbe9v7.js} +2 -2
  42. package/dist/cli/{index-2rgm3hgq.js → index-xn23xnnk.js} +4 -4
  43. package/dist/cli/{index-s5p8ryar.js → index-zvp68qx6.js} +1 -1
  44. package/dist/cli/index.js +27 -27
  45. package/dist/cli/{knowledge-escalator-yew2fbxb.js → knowledge-escalator-z09aqvfe.js} +9 -9
  46. package/dist/cli/{knowledge-events-zfg423hp.js → knowledge-events-03f1rwm8.js} +7 -7
  47. package/dist/cli/{knowledge-link-ydv6shg2.js → knowledge-link-4frk38w8.js} +3 -3
  48. package/dist/cli/{knowledge-store-zcv9stzz.js → knowledge-store-sn28k13f.js} +4 -4
  49. package/dist/cli/{knowledge-validator-q68wx2bf.js → knowledge-validator-rwrt3yja.js} +6 -6
  50. package/dist/cli/{pending-delegations-yet1rza6.js → pending-delegations-qe16vfrj.js} +1 -1
  51. package/dist/cli/{pr-subscriptions-mp7fyh1r.js → pr-subscriptions-00evnffe.js} +2 -2
  52. package/dist/cli/{runner-s89ja08q.js → runner-k1rkbjm8.js} +4 -4
  53. package/dist/cli/{scan-cursor-38bzfhwf.js → scan-cursor-h3mfzjc9.js} +5 -5
  54. package/dist/cli/{schema-9hqyt4t6.js → schema-c37h5xw4.js} +1 -1
  55. package/dist/cli/{scope-persistence-dd9s9q2b.js → scope-persistence-35z42pj5.js} +5 -5
  56. package/dist/cli/{skill-generator-b28ezazm.js → skill-generator-60px2mvb.js} +11 -11
  57. package/dist/cli/{worktree-collision-ownership-zw65t2p9.js → worktree-collision-ownership-2pc20ypq.js} +3 -3
  58. package/dist/cli/{worktree-isolation-0ag393t0.js → worktree-isolation-w4yamc3b.js} +27 -27
  59. package/dist/commands/close.d.ts +2 -0
  60. package/dist/config/schema.d.ts +8 -0
  61. package/dist/hooks/repo-graph-injection.d.ts +40 -0
  62. package/dist/index.js +376 -356
  63. package/dist/memory/reflection-service.d.ts +8 -2
  64. package/dist/memory/schema.d.ts +4 -4
  65. package/dist/tools/repo-graph/indexed-storage.d.ts +136 -0
  66. package/dist/tools/repo-graph/query.d.ts +7 -0
  67. package/package.json +2 -1
@@ -6,7 +6,7 @@ import {
6
6
  resolveExecutableFromPath,
7
7
  runEvaluation,
8
8
  runExternalTool
9
- } from "./index-qdnmnq65.js";
9
+ } from "./index-kyc2c7hq.js";
10
10
  import {
11
11
  finalizeShellAuditForClose,
12
12
  isPolicyProtectedPath,
@@ -14,13 +14,13 @@ import {
14
14
  protectedRoots,
15
15
  redactDecisionLineForArchive,
16
16
  stableCanonicalStringify
17
- } from "./index-qxj63890.js";
17
+ } from "./index-c590qxts.js";
18
18
  import {
19
19
  detectStraySwarmDirs,
20
20
  readDoctorArtifact,
21
21
  removeStraySwarmDir,
22
22
  runConfigDoctor
23
- } from "./index-wkagbmpt.js";
23
+ } from "./index-mm7ase9k.js";
24
24
  import {
25
25
  MAX_TRANSIENT_RETRIES,
26
26
  archiveEvidence,
@@ -67,7 +67,7 @@ import {
67
67
  validateProjectRoot,
68
68
  validateSymlinkBoundary,
69
69
  validateTargetWithinRoot
70
- } from "./index-7fyv62b2.js";
70
+ } from "./index-wwv3cbv1.js";
71
71
  import {
72
72
  EvaluationTaskV1Schema,
73
73
  GateAuditManifestV1Schema,
@@ -84,7 +84,7 @@ import {
84
84
  saveGateAuditResult,
85
85
  savePromotionDecision,
86
86
  saveTaskSetSnapshot
87
- } from "./index-env8fk17.js";
87
+ } from "./index-c9nabqzd.js";
88
88
  import {
89
89
  loadDatabaseCtor
90
90
  } from "./index-134d35c1.js";
@@ -110,12 +110,12 @@ import {
110
110
  } from "./index-y8552snf.js";
111
111
  import {
112
112
  readRecentEscalations
113
- } from "./index-a6xjn2zt.js";
113
+ } from "./index-kgdbtwfm.js";
114
114
  import {
115
115
  alreadyCuratedThisGeneration,
116
116
  claimNextScanBatch,
117
117
  resolveCohortId
118
- } from "./index-v6xkgxts.js";
118
+ } from "./index-rb4t72we.js";
119
119
  import {
120
120
  CURATOR_INIT_PROMPT,
121
121
  CURATOR_PHASE_PROMPT,
@@ -139,7 +139,7 @@ import {
139
139
  listActive,
140
140
  subscribe,
141
141
  unsubscribe
142
- } from "./index-94e20w95.js";
142
+ } from "./index-fjcm6wwf.js";
143
143
  import {
144
144
  clearWorktreeMergeStatus,
145
145
  getAllWorktreeMergeFailures,
@@ -151,12 +151,12 @@ import {
151
151
  listCoderSettlementWalStates,
152
152
  recoverCoderSettlement,
153
153
  recoverStaleCoderSettlements
154
- } from "./index-ymgsmjba.js";
154
+ } from "./index-egnpzfe3.js";
155
155
  import {
156
156
  WORKTREE_LIFECYCLE_LOCK_FILE,
157
157
  recordWorktreeProvisioningOwner,
158
158
  removeWorktreeProvisioningOwner
159
- } from "./index-vntggpez.js";
159
+ } from "./index-0q8kywcf.js";
160
160
  import {
161
161
  BUNDLED_PROJECT_SKILL_ROOT,
162
162
  DEFAULT_SKILL_MIN_CONFIDENCE,
@@ -177,7 +177,7 @@ import {
177
177
  retireSkill,
178
178
  selectCandidateEntries,
179
179
  syncBundledProjectSkillsIfMissingAsync
180
- } from "./index-2rgm3hgq.js";
180
+ } from "./index-xn23xnnk.js";
181
181
  import {
182
182
  appendUnactionable,
183
183
  quarantineEntry,
@@ -188,11 +188,11 @@ import {
188
188
  validateActionableFields,
189
189
  validateLesson,
190
190
  validateSkillPath
191
- } from "./index-6vcrkz80.js";
191
+ } from "./index-e90g4dsw.js";
192
192
  import {
193
193
  authorizeCuration,
194
194
  buildConfigFingerprintInput
195
- } from "./index-zak50rve.js";
195
+ } from "./index-aqg7c1z9.js";
196
196
  import {
197
197
  cohortConfigFingerprint
198
198
  } from "./index-rtry5xyf.js";
@@ -223,12 +223,12 @@ import {
223
223
  transitionTaskWorkflowEvidence,
224
224
  withTaskEvidenceTransaction,
225
225
  writeWorkflowWalFile
226
- } from "./index-g1bh7980.js";
226
+ } from "./index-26cvxrym.js";
227
227
  import {
228
228
  makeWorktreeBranchName,
229
229
  provisionWorktree,
230
230
  removeWorktree
231
- } from "./index-7qky94rr.js";
231
+ } from "./index-spbxf9vn.js";
232
232
  import {
233
233
  DEFAULT_STALE_DELEGATION_TIMEOUT_MS,
234
234
  DELEGATION_COMPACTION_HIGH_WATER_BYTES,
@@ -243,7 +243,7 @@ import {
243
243
  scanBackgroundCoderReservationsForAdmission,
244
244
  scanDelegationsForRecovery,
245
245
  sweepStaleDelegations
246
- } from "./index-kck2gtxk.js";
246
+ } from "./index-caqe8x14.js";
247
247
  import {
248
248
  compositeSessionKey,
249
249
  sessionKeySuffix
@@ -279,7 +279,7 @@ import {
279
279
  clearAllScopes,
280
280
  clearScopeBindingFromDisk,
281
281
  clearScopeBindings
282
- } from "./index-4n557t8w.js";
282
+ } from "./index-t3xqpece.js";
283
283
  import {
284
284
  appendLedgerEvent,
285
285
  computePlanHash,
@@ -294,7 +294,7 @@ import {
294
294
  readPlanEpochIdentity,
295
295
  replayFromLedgerWithStatus,
296
296
  takeSnapshotEvent
297
- } from "./index-s5p8ryar.js";
297
+ } from "./index-zvp68qx6.js";
298
298
  import {
299
299
  CORE_EVENT_LOCKED,
300
300
  appendCoreEventSync,
@@ -353,7 +353,7 @@ import {
353
353
  transactFile,
354
354
  transactKnowledge,
355
355
  wordBigrams
356
- } from "./index-n7nnz0jp.js";
356
+ } from "./index-ctsct3hy.js";
357
357
  import {
358
358
  MAX_EVENT_LOG_ENTRIES,
359
359
  _internals as _internals2,
@@ -369,10 +369,10 @@ import {
369
369
  recordKnowledgeEvent,
370
370
  recordPhaseCloseIntent,
371
371
  resolveKnowledgeEventsPath
372
- } from "./index-s23q9v6t.js";
372
+ } from "./index-qj9jrjvr.js";
373
373
  import {
374
374
  resolveWorktreeIsolationConfig
375
- } from "./index-gbkdj7ay.js";
375
+ } from "./index-dw2q720x.js";
376
376
  import {
377
377
  RetrospectiveEvidenceSchema
378
378
  } from "./index-gprxjmm7.js";
@@ -395,7 +395,7 @@ import {
395
395
  init_loader,
396
396
  loadPluginConfig,
397
397
  loadPluginConfigWithMeta
398
- } from "./index-q0prhdds.js";
398
+ } from "./index-79qymsxf.js";
399
399
  import {
400
400
  DEFAULT_PR_REVIEW_RESILIENCE_CONFIG,
401
401
  DEFAULT_SKILL_OPT_CONFIG,
@@ -410,7 +410,7 @@ import {
410
410
  package_default,
411
411
  resolveAutoReviewConfig,
412
412
  stripKnownSwarmPrefix
413
- } from "./index-y3kw1zpm.js";
413
+ } from "./index-34wn2ztk.js";
414
414
  import {
415
415
  AGENT_TOOL_MAP,
416
416
  ALL_AGENT_NAMES,
@@ -450,10 +450,10 @@ import {
450
450
  resolveLinkDir,
451
451
  sanitizeLinkId,
452
452
  writeLinkPointer
453
- } from "./index-ed13peqr.js";
453
+ } from "./index-85p1850w.js";
454
454
  import {
455
455
  atomicWriteFile
456
- } from "./index-bhjkxasn.js";
456
+ } from "./index-ew6fykvv.js";
457
457
  import {
458
458
  KNOWLEDGE_SCHEMA_VERSION,
459
459
  OUTCOME_BLOCK_THRESHOLD,
@@ -465,7 +465,7 @@ import {
465
465
  atomicWriteSwarmFileSync,
466
466
  matchTempGrammar,
467
467
  parseTargetBasename
468
- } from "./index-0f4b9ywa.js";
468
+ } from "./index-6bqqzfbe.js";
469
469
  import {
470
470
  assertProjectRoot,
471
471
  hasExplicitProjectBoundary,
@@ -19487,7 +19487,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
19487
19487
  };
19488
19488
  }
19489
19489
  async function sweepActiveNearDuplicates(directory, options = {}) {
19490
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-d7r6y724.js");
19490
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-ketfp4rv.js");
19491
19491
  const { config } = loadPluginConfigWithMeta2(directory);
19492
19492
  const sweepConfig = config.learning?.dedup_sweep;
19493
19493
  if (sweepConfig?.enabled === false)
@@ -20617,7 +20617,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
20617
20617
  }
20618
20618
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
20619
20619
  try {
20620
- const skillModule = await import("./skill-generator-b28ezazm.js");
20620
+ const skillModule = await import("./skill-generator-60px2mvb.js");
20621
20621
  for (const cand of skillCandidates) {
20622
20622
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
20623
20623
  continue;
@@ -21089,7 +21089,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
21089
21089
  } catch {}
21090
21090
  }
21091
21091
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
21092
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-yew2fbxb.js");
21092
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-z09aqvfe.js");
21093
21093
  for (const { id } of contradictedEntries) {
21094
21094
  try {
21095
21095
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -21908,7 +21908,7 @@ async function runCuratorPostMortem(directory, options = {}) {
21908
21908
  warnings.push("Failed to collect knowledge summary.");
21909
21909
  }
21910
21910
  try {
21911
- const { getScanStatus } = await import("./scan-cursor-38bzfhwf.js");
21911
+ const { getScanStatus } = await import("./scan-cursor-h3mfzjc9.js");
21912
21912
  const scanStatus = await getScanStatus(directory);
21913
21913
  if (scanStatus.remaining_estimate > 0) {
21914
21914
  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.`);
@@ -22080,9 +22080,9 @@ var _internals26 = {
22080
22080
  verifyPostMortemKnowledgeActions,
22081
22081
  repairPostMortemActions,
22082
22082
  loadDefaultKnowledgeConfig: async (directory) => {
22083
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-9hqyt4t6.js");
22083
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-c37h5xw4.js");
22084
22084
  try {
22085
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-d7r6y724.js");
22085
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-ketfp4rv.js");
22086
22086
  const loaded = loadPluginConfigWithMeta2(directory);
22087
22087
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
22088
22088
  } catch {
@@ -22090,11 +22090,11 @@ var _internals26 = {
22090
22090
  }
22091
22091
  },
22092
22092
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
22093
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-v12rhct2.js");
22093
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-adp0dsv4.js");
22094
22094
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
22095
22095
  },
22096
22096
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
22097
- const { checkHivePromotions } = await import("./hive-promoter-k6y06jj8.js");
22097
+ const { checkHivePromotions } = await import("./hive-promoter-b1wv52fs.js");
22098
22098
  return checkHivePromotions(entries, knowledgeConfig, directory);
22099
22099
  },
22100
22100
  applyProposalTriage: async (directory, triage) => {
@@ -22103,7 +22103,7 @@ var _internals26 = {
22103
22103
  activateProposal,
22104
22104
  listSkills: listSkills2,
22105
22105
  sanitizeSlug
22106
- } = await import("./skill-generator-b28ezazm.js");
22106
+ } = await import("./skill-generator-60px2mvb.js");
22107
22107
  const result = {
22108
22108
  approved: [],
22109
22109
  rejected: [],
@@ -23433,9 +23433,9 @@ function hashContent(content) {
23433
23433
  return createHash12("sha1").update(content).digest("hex");
23434
23434
  }
23435
23435
  async function loadConfigForPolicyCurator(directory) {
23436
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-9hqyt4t6.js");
23436
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-c37h5xw4.js");
23437
23437
  try {
23438
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-d7r6y724.js");
23438
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-ketfp4rv.js");
23439
23439
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
23440
23440
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
23441
23441
  } catch {
@@ -24450,6 +24450,241 @@ var _internals30 = {
24450
24450
  realpath: realpath3
24451
24451
  };
24452
24452
 
24453
+ // src/tools/repo-graph/indexed-storage.ts
24454
+ init_loader();
24455
+ init_schema();
24456
+ init_logger();
24457
+
24458
+ // src/tools/repo-graph/safe-realpath.ts
24459
+ import { realpathSync as realpathSync3 } from "fs";
24460
+ function safeRealpathSync(targetPath, fallback, realpathResolver = realpathSync3) {
24461
+ try {
24462
+ return realpathResolver(targetPath);
24463
+ } catch (error2) {
24464
+ if (error2 instanceof Error && error2.code === "ENOENT") {
24465
+ return fallback;
24466
+ }
24467
+ return null;
24468
+ }
24469
+ }
24470
+
24471
+ // src/tools/repo-graph/types.ts
24472
+ var GRAPH_SCHEMA_VERSION = "1.5.0";
24473
+ var FILE_ROLE_VALUES = [
24474
+ "api_route",
24475
+ "middleware",
24476
+ "service_module",
24477
+ "data_module",
24478
+ "swarm_tool",
24479
+ "agent",
24480
+ "hook",
24481
+ "config",
24482
+ "schema",
24483
+ "test_file",
24484
+ "cli_command",
24485
+ "documentation",
24486
+ "source_module"
24487
+ ];
24488
+ var ROUTE_METHOD_VALUES = [
24489
+ "GET",
24490
+ "POST",
24491
+ "PUT",
24492
+ "PATCH",
24493
+ "DELETE",
24494
+ "OPTIONS",
24495
+ "HEAD",
24496
+ "ALL"
24497
+ ];
24498
+ var ROUTE_SOURCE_VALUES = [
24499
+ "file_path",
24500
+ "handler_export",
24501
+ "router_call"
24502
+ ];
24503
+ var DATA_OPERATION_VALUES = [
24504
+ "read",
24505
+ "write",
24506
+ "delete",
24507
+ "transaction",
24508
+ "migration"
24509
+ ];
24510
+ var DATA_ACCESS_VALUES = [
24511
+ "database",
24512
+ "orm",
24513
+ "sql",
24514
+ "filesystem",
24515
+ "network",
24516
+ "unknown"
24517
+ ];
24518
+ var SECURITY_KIND_VALUES = [
24519
+ "authentication",
24520
+ "authorization",
24521
+ "input_validation",
24522
+ "csrf",
24523
+ "sanitization",
24524
+ "secret_handling"
24525
+ ];
24526
+ var SECURITY_CONFIDENCE_VALUES = ["low", "medium", "high"];
24527
+ var ONTOLOGY_FINDING_SEVERITY_VALUES = [
24528
+ "info",
24529
+ "low",
24530
+ "medium",
24531
+ "high"
24532
+ ];
24533
+ var IMPORT_TYPE_VALUES = [
24534
+ "default",
24535
+ "named",
24536
+ "namespace",
24537
+ "require",
24538
+ "sideeffect",
24539
+ "type"
24540
+ ];
24541
+ var SYMBOL_EDGE_KIND_VALUES = [
24542
+ "CALLS",
24543
+ "REFERENCES",
24544
+ "USES_TYPE",
24545
+ "INSTANTIATES",
24546
+ "IMPLEMENTS",
24547
+ "OVERRIDES"
24548
+ ];
24549
+ var SYMBOL_EDGE_RESOLUTION_VALUES = [
24550
+ "exact",
24551
+ "import_binding",
24552
+ "same_file_scope",
24553
+ "unique_name",
24554
+ "type_resolved",
24555
+ "lsp",
24556
+ "scip",
24557
+ "heuristic",
24558
+ "unresolved"
24559
+ ];
24560
+ var PACKAGE_BOUNDARY_ROOTS = new Set([
24561
+ "packages",
24562
+ "crates",
24563
+ "apps",
24564
+ "libs",
24565
+ "services"
24566
+ ]);
24567
+ function inferPackageBoundary(moduleName, hasManifest) {
24568
+ const normalized = moduleName.replace(/\\/g, "/").replace(/^(?:\.\/)+/, "");
24569
+ const parts = normalized.split("/").filter(Boolean);
24570
+ if (parts.length === 0)
24571
+ return ".";
24572
+ if (PACKAGE_BOUNDARY_ROOTS.has(parts[0]) && parts.length >= 2) {
24573
+ return `${parts[0]}/${parts[1]}`;
24574
+ }
24575
+ if (parts[0] === "src" && parts.length >= 2) {
24576
+ return `src/${parts[1]}`;
24577
+ }
24578
+ if (parts[0] === "tests" && parts.length >= 2) {
24579
+ return `tests/${parts[1]}`;
24580
+ }
24581
+ if (hasManifest && parts.length >= 2) {
24582
+ if (hasManifest(parts[0]) || hasManifest(`${parts[0]}/${parts[1]}`)) {
24583
+ return `${parts[0]}/${parts[1]}`;
24584
+ }
24585
+ }
24586
+ return parts[0];
24587
+ }
24588
+
24589
+ // src/tools/repo-graph/symbol-edge.ts
24590
+ var KIND_SET = new Set(SYMBOL_EDGE_KIND_VALUES);
24591
+ var RESOLUTION_SET = new Set(SYMBOL_EDGE_RESOLUTION_VALUES);
24592
+
24593
+ // src/tools/repo-graph/validation.ts
24594
+ var FILE_ROLE_SET = new Set(FILE_ROLE_VALUES);
24595
+ var ROUTE_METHOD_SET = new Set(ROUTE_METHOD_VALUES);
24596
+ var ROUTE_SOURCE_SET = new Set(ROUTE_SOURCE_VALUES);
24597
+ var DATA_OPERATION_SET = new Set(DATA_OPERATION_VALUES);
24598
+ var DATA_ACCESS_SET = new Set(DATA_ACCESS_VALUES);
24599
+ var SECURITY_KIND_SET = new Set(SECURITY_KIND_VALUES);
24600
+ var SECURITY_CONFIDENCE_SET = new Set(SECURITY_CONFIDENCE_VALUES);
24601
+ var ONTOLOGY_FINDING_SEVERITY_SET = new Set(ONTOLOGY_FINDING_SEVERITY_VALUES);
24602
+ var IMPORT_TYPE_SET = new Set(IMPORT_TYPE_VALUES);
24603
+ function validateWorkspace(workspace) {
24604
+ if (!workspace || typeof workspace !== "string" || workspace.trim() === "") {
24605
+ throw new Error("Invalid workspace: must be a non-empty string");
24606
+ }
24607
+ if (containsControlChars(workspace)) {
24608
+ throw new Error("Invalid workspace: control characters detected");
24609
+ }
24610
+ if (containsPathTraversal(workspace)) {
24611
+ throw new Error("Invalid workspace: path traversal detected");
24612
+ }
24613
+ }
24614
+
24615
+ // src/tools/repo-graph/indexed-storage.ts
24616
+ var REPO_MEMORY_FILENAME = "repo-memory.sqlite";
24617
+ var MIGRATIONS = [
24618
+ {
24619
+ version: 1,
24620
+ name: "create_graph_meta",
24621
+ sql: `CREATE TABLE graph_meta (
24622
+ key TEXT PRIMARY KEY,
24623
+ value TEXT NOT NULL
24624
+ )`
24625
+ },
24626
+ {
24627
+ version: 2,
24628
+ name: "create_files",
24629
+ sql: `CREATE TABLE files (
24630
+ path TEXT PRIMARY KEY,
24631
+ module_name TEXT NOT NULL,
24632
+ node_json TEXT NOT NULL
24633
+ )`
24634
+ },
24635
+ {
24636
+ version: 3,
24637
+ name: "create_files_module_name_index",
24638
+ sql: "CREATE INDEX idx_files_module_name ON files(module_name)"
24639
+ },
24640
+ {
24641
+ version: 4,
24642
+ name: "create_edges",
24643
+ sql: `CREATE TABLE edges (
24644
+ seq INTEGER PRIMARY KEY,
24645
+ source TEXT NOT NULL,
24646
+ target TEXT NOT NULL,
24647
+ edge_json TEXT NOT NULL
24648
+ )`
24649
+ },
24650
+ {
24651
+ version: 5,
24652
+ name: "create_edges_source_index",
24653
+ sql: "CREATE INDEX idx_edges_source ON edges(source)"
24654
+ },
24655
+ {
24656
+ version: 6,
24657
+ name: "create_edges_target_index",
24658
+ sql: "CREATE INDEX idx_edges_target ON edges(target)"
24659
+ }
24660
+ ];
24661
+ var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
24662
+ var _handles = new Map;
24663
+ function getRepoMemoryPath(workspace) {
24664
+ validateWorkspace(workspace);
24665
+ const basePath = validateSwarmPath(workspace, REPO_MEMORY_FILENAME);
24666
+ validateSymlinkBoundary(basePath, workspace);
24667
+ return basePath;
24668
+ }
24669
+ function closeHandleAt(storePath) {
24670
+ const db = _handles.get(storePath);
24671
+ if (!db)
24672
+ return;
24673
+ _handles.delete(storePath);
24674
+ try {
24675
+ db.close();
24676
+ } catch {}
24677
+ }
24678
+ function closeRepoMemory(workspace) {
24679
+ let storePath;
24680
+ try {
24681
+ storePath = getRepoMemoryPath(workspace);
24682
+ } catch {
24683
+ return;
24684
+ }
24685
+ closeHandleAt(storePath);
24686
+ }
24687
+
24453
24688
  // src/context-map/telemetry.ts
24454
24689
  import * as fs14 from "fs";
24455
24690
  import * as path30 from "path";
@@ -27284,7 +27519,7 @@ async function repairIncompleteJsonlTail(filePath) {
27284
27519
  }
27285
27520
 
27286
27521
  // src/memory/provider-pool.ts
27287
- import { realpathSync as realpathSync3 } from "fs";
27522
+ import { realpathSync as realpathSync4 } from "fs";
27288
27523
  import * as path37 from "path";
27289
27524
 
27290
27525
  // src/memory/sqlite-provider.ts
@@ -28067,7 +28302,7 @@ var FTS_INSERT_COLUMNS = [
28067
28302
  "id",
28068
28303
  ...FTS_INDEX_COLUMNS.map((column) => column.name)
28069
28304
  ];
28070
- var MIGRATIONS = [
28305
+ var MIGRATIONS2 = [
28071
28306
  {
28072
28307
  version: 1,
28073
28308
  name: "create_memory_provider_tables",
@@ -29202,7 +29437,7 @@ class SQLiteMemoryProvider {
29202
29437
  const row = db.query("SELECT MAX(version) as version FROM schema_migrations").get();
29203
29438
  const currentVersion = row?.version ?? 0;
29204
29439
  this.databaseStartedFresh = currentVersion === 0;
29205
- for (const migration of MIGRATIONS) {
29440
+ for (const migration of MIGRATIONS2) {
29206
29441
  if (migration.version <= currentVersion)
29207
29442
  continue;
29208
29443
  const apply = db.transaction(() => {
@@ -30337,7 +30572,7 @@ function getOrCreateProviderForRoot(root, config) {
30337
30572
  function resolvePoolKeyForRoot(root) {
30338
30573
  if (root.kind === "cohort") {
30339
30574
  try {
30340
- return `cohort:${realpathSync3(root.cohortRoot)}`;
30575
+ return `cohort:${realpathSync4(root.cohortRoot)}`;
30341
30576
  } catch {
30342
30577
  return `cohort:${path37.resolve(root.cohortRoot)}`;
30343
30578
  }
@@ -30420,7 +30655,7 @@ function unlinkEntry(entry) {
30420
30655
  function resolvePoolKey(directory) {
30421
30656
  const rawKey = path37.resolve(directory);
30422
30657
  try {
30423
- const canonical = realpathSync3(directory);
30658
+ const canonical = realpathSync4(directory);
30424
30659
  resolvedKeyCache.delete(rawKey);
30425
30660
  resolvedKeyCache.set(rawKey, canonical);
30426
30661
  if (resolvedKeyCache.size > MAX_POOL_SIZE) {
@@ -35065,6 +35300,7 @@ var ARCHIVE_ARTIFACTS = [
35065
35300
  "telemetry.jsonl",
35066
35301
  "telemetry.jsonl.1",
35067
35302
  "swarm.db",
35303
+ REPO_MEMORY_FILENAME,
35068
35304
  "close-summary.md",
35069
35305
  "session-reflection.md",
35070
35306
  "spec.md",
@@ -35097,7 +35333,8 @@ var ACTIVE_STATE_TO_CLEAN = [
35097
35333
  "spec.md",
35098
35334
  "spec-staleness.json",
35099
35335
  "spec-snapshot.md",
35100
- "swarm.db"
35336
+ "swarm.db",
35337
+ REPO_MEMORY_FILENAME
35101
35338
  ];
35102
35339
  var TERMINAL_STATE_FILES = [
35103
35340
  "plan.json",
@@ -35479,7 +35716,7 @@ async function runFinalizeStage(ctx) {
35479
35716
  }
35480
35717
  }
35481
35718
  try {
35482
- const { CuratorConfigSchema: CCS } = await import("./schema-9hqyt4t6.js");
35719
+ const { CuratorConfigSchema: CCS } = await import("./schema-c37h5xw4.js");
35483
35720
  const { config: pmLoadedConfig } = _internals41.loadPluginConfigWithMeta(ctx.directory);
35484
35721
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
35485
35722
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -35541,7 +35778,7 @@ async function runArchiveStage(ctx) {
35541
35778
  const srcPath = path47.join(ctx.swarmDir, artifact);
35542
35779
  const destPath = path47.join(ctx.archiveDir, artifact);
35543
35780
  const requiredness = REQUIRED_ARTIFACTS.has(artifact) ? "required" : "optional";
35544
- if (artifact === "swarm.db") {
35781
+ if (artifact === "swarm.db" || artifact === REPO_MEMORY_FILENAME) {
35545
35782
  const r = await archiveSqliteSnapshot({
35546
35783
  sourcePath: srcPath,
35547
35784
  destDir: ctx.archiveDir,
@@ -35764,6 +36001,11 @@ async function runCleanStage(ctx) {
35764
36001
  closeProjectDb(ctx.directory);
35765
36002
  } catch {}
35766
36003
  }
36004
+ if (artifact === REPO_MEMORY_FILENAME) {
36005
+ try {
36006
+ _internals41.closeRepoMemory(ctx.directory);
36007
+ } catch {}
36008
+ }
35767
36009
  try {
35768
36010
  await fs17.unlink(filePath);
35769
36011
  cleanedFiles.push(artifact);
@@ -36327,6 +36569,7 @@ function detectFullAuto(directory, sessionID) {
36327
36569
  }
36328
36570
  }
36329
36571
  var _internals41 = {
36572
+ closeRepoMemory,
36330
36573
  ACTIVE_STATE_DIRS_TO_CLEAN,
36331
36574
  countSessionKnowledgeEntries,
36332
36575
  CLOSE_SKILL_REVIEW_TIMEOUT_MS,
@@ -37692,9 +37935,9 @@ var _internals45 = {
37692
37935
  loadPluginConfigWithMeta,
37693
37936
  loadCuratorDeps: async () => {
37694
37937
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
37695
- import("./schema-9hqyt4t6.js"),
37696
- import("./curator-v12rhct2.js"),
37697
- import("./curator-llm-factory-mxdjw6kz.js")
37938
+ import("./schema-c37h5xw4.js"),
37939
+ import("./curator-adp0dsv4.js"),
37940
+ import("./curator-llm-factory-kd8v16jj.js")
37698
37941
  ]);
37699
37942
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
37700
37943
  }
@@ -38703,7 +38946,7 @@ async function computeCurationDiagnostics(directory, entries) {
38703
38946
  let scanCompleted = false;
38704
38947
  let scanRemaining = 0;
38705
38948
  try {
38706
- const { getScanStatus } = await import("./scan-cursor-38bzfhwf.js");
38949
+ const { getScanStatus } = await import("./scan-cursor-h3mfzjc9.js");
38707
38950
  const status = await getScanStatus(directory);
38708
38951
  scanGeneration = status.generation;
38709
38952
  scanCompleted = status.completed;
@@ -38711,19 +38954,19 @@ async function computeCurationDiagnostics(directory, entries) {
38711
38954
  } catch {}
38712
38955
  let configMatch = null;
38713
38956
  try {
38714
- const { isLinked: isLinked2 } = await import("./knowledge-link-ydv6shg2.js");
38957
+ const { isLinked: isLinked2 } = await import("./knowledge-link-4frk38w8.js");
38715
38958
  if (isLinked2(directory)) {
38716
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-9hqyt4t6.js");
38959
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-c37h5xw4.js");
38717
38960
  let config;
38718
38961
  try {
38719
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-d7r6y724.js");
38962
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-ketfp4rv.js");
38720
38963
  const loaded = loadPluginConfigWithMeta2(directory);
38721
38964
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
38722
38965
  } catch {
38723
38966
  config = KnowledgeConfigSchema2.parse({});
38724
38967
  }
38725
38968
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
38726
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-2jkbybw7.js");
38969
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-jabphe51.js");
38727
38970
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
38728
38971
  const cohortFp = await readCohortConfigFingerprint(directory);
38729
38972
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -40036,7 +40279,7 @@ async function handleDoctorCommand(directory, args) {
40036
40279
  const result = runConfigDoctor(config, directory);
40037
40280
  let output;
40038
40281
  if (enableAutoFix && result.hasAutoFixableIssues) {
40039
- const { runConfigDoctorWithFixes } = await import("./config-doctor-8zjz6dej.js");
40282
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-s6p9aqfv.js");
40040
40283
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
40041
40284
  applyLossy: true
40042
40285
  });
@@ -40976,7 +41219,7 @@ async function handleEvidenceCommand(directory, args) {
40976
41219
  return formatTaskEvidenceMarkdown(evidenceData);
40977
41220
  }
40978
41221
  async function handleEvidenceSummaryCommand(directory) {
40979
- const { buildEvidenceSummary } = await import("./evidence-summary-service-zzvvcaa9.js");
41222
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-kpjpd86j.js");
40980
41223
  const artifact = await buildEvidenceSummary(directory);
40981
41224
  if (!artifact) {
40982
41225
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -55611,126 +55854,6 @@ var _internals66 = {
55611
55854
 
55612
55855
  // src/tools/repo-graph/ontology.ts
55613
55856
  import * as path75 from "path";
55614
-
55615
- // src/tools/repo-graph/types.ts
55616
- var GRAPH_SCHEMA_VERSION = "1.5.0";
55617
- var FILE_ROLE_VALUES = [
55618
- "api_route",
55619
- "middleware",
55620
- "service_module",
55621
- "data_module",
55622
- "swarm_tool",
55623
- "agent",
55624
- "hook",
55625
- "config",
55626
- "schema",
55627
- "test_file",
55628
- "cli_command",
55629
- "documentation",
55630
- "source_module"
55631
- ];
55632
- var ROUTE_METHOD_VALUES = [
55633
- "GET",
55634
- "POST",
55635
- "PUT",
55636
- "PATCH",
55637
- "DELETE",
55638
- "OPTIONS",
55639
- "HEAD",
55640
- "ALL"
55641
- ];
55642
- var ROUTE_SOURCE_VALUES = [
55643
- "file_path",
55644
- "handler_export",
55645
- "router_call"
55646
- ];
55647
- var DATA_OPERATION_VALUES = [
55648
- "read",
55649
- "write",
55650
- "delete",
55651
- "transaction",
55652
- "migration"
55653
- ];
55654
- var DATA_ACCESS_VALUES = [
55655
- "database",
55656
- "orm",
55657
- "sql",
55658
- "filesystem",
55659
- "network",
55660
- "unknown"
55661
- ];
55662
- var SECURITY_KIND_VALUES = [
55663
- "authentication",
55664
- "authorization",
55665
- "input_validation",
55666
- "csrf",
55667
- "sanitization",
55668
- "secret_handling"
55669
- ];
55670
- var SECURITY_CONFIDENCE_VALUES = ["low", "medium", "high"];
55671
- var ONTOLOGY_FINDING_SEVERITY_VALUES = [
55672
- "info",
55673
- "low",
55674
- "medium",
55675
- "high"
55676
- ];
55677
- var IMPORT_TYPE_VALUES = [
55678
- "default",
55679
- "named",
55680
- "namespace",
55681
- "require",
55682
- "sideeffect",
55683
- "type"
55684
- ];
55685
- var SYMBOL_EDGE_KIND_VALUES = [
55686
- "CALLS",
55687
- "REFERENCES",
55688
- "USES_TYPE",
55689
- "INSTANTIATES",
55690
- "IMPLEMENTS",
55691
- "OVERRIDES"
55692
- ];
55693
- var SYMBOL_EDGE_RESOLUTION_VALUES = [
55694
- "exact",
55695
- "import_binding",
55696
- "same_file_scope",
55697
- "unique_name",
55698
- "type_resolved",
55699
- "lsp",
55700
- "scip",
55701
- "heuristic",
55702
- "unresolved"
55703
- ];
55704
- var PACKAGE_BOUNDARY_ROOTS = new Set([
55705
- "packages",
55706
- "crates",
55707
- "apps",
55708
- "libs",
55709
- "services"
55710
- ]);
55711
- function inferPackageBoundary(moduleName, hasManifest) {
55712
- const normalized = moduleName.replace(/\\/g, "/").replace(/^(?:\.\/)+/, "");
55713
- const parts = normalized.split("/").filter(Boolean);
55714
- if (parts.length === 0)
55715
- return ".";
55716
- if (PACKAGE_BOUNDARY_ROOTS.has(parts[0]) && parts.length >= 2) {
55717
- return `${parts[0]}/${parts[1]}`;
55718
- }
55719
- if (parts[0] === "src" && parts.length >= 2) {
55720
- return `src/${parts[1]}`;
55721
- }
55722
- if (parts[0] === "tests" && parts.length >= 2) {
55723
- return `tests/${parts[1]}`;
55724
- }
55725
- if (hasManifest && parts.length >= 2) {
55726
- if (hasManifest(parts[0]) || hasManifest(`${parts[0]}/${parts[1]}`)) {
55727
- return `${parts[0]}/${parts[1]}`;
55728
- }
55729
- }
55730
- return parts[0];
55731
- }
55732
-
55733
- // src/tools/repo-graph/ontology.ts
55734
55857
  var HTTP_METHODS = [
55735
55858
  "GET",
55736
55859
  "POST",
@@ -56203,34 +56326,6 @@ function extractFileOntology(input) {
56203
56326
  };
56204
56327
  }
56205
56328
 
56206
- // src/tools/repo-graph/safe-realpath.ts
56207
- import { realpathSync as realpathSync7 } from "fs";
56208
- function safeRealpathSync(targetPath, fallback, realpathResolver = realpathSync7) {
56209
- try {
56210
- return realpathResolver(targetPath);
56211
- } catch (error2) {
56212
- if (error2 instanceof Error && error2.code === "ENOENT") {
56213
- return fallback;
56214
- }
56215
- return null;
56216
- }
56217
- }
56218
-
56219
- // src/tools/repo-graph/symbol-edge.ts
56220
- var KIND_SET = new Set(SYMBOL_EDGE_KIND_VALUES);
56221
- var RESOLUTION_SET = new Set(SYMBOL_EDGE_RESOLUTION_VALUES);
56222
-
56223
- // src/tools/repo-graph/validation.ts
56224
- var FILE_ROLE_SET = new Set(FILE_ROLE_VALUES);
56225
- var ROUTE_METHOD_SET = new Set(ROUTE_METHOD_VALUES);
56226
- var ROUTE_SOURCE_SET = new Set(ROUTE_SOURCE_VALUES);
56227
- var DATA_OPERATION_SET = new Set(DATA_OPERATION_VALUES);
56228
- var DATA_ACCESS_SET = new Set(DATA_ACCESS_VALUES);
56229
- var SECURITY_KIND_SET = new Set(SECURITY_KIND_VALUES);
56230
- var SECURITY_CONFIDENCE_SET = new Set(SECURITY_CONFIDENCE_VALUES);
56231
- var ONTOLOGY_FINDING_SEVERITY_SET = new Set(ONTOLOGY_FINDING_SEVERITY_VALUES);
56232
- var IMPORT_TYPE_SET = new Set(IMPORT_TYPE_VALUES);
56233
-
56234
56329
  // src/tools/repo-graph/builder.ts
56235
56330
  var _internals67 = {
56236
56331
  now: Date.now,
@@ -56979,6 +57074,7 @@ var RANGE_WIDENED_GRAMMARS = new Set([
56979
57074
  ]);
56980
57075
 
56981
57076
  // src/tools/repo-graph/query.ts
57077
+ var queryIndexCache = new WeakMap;
56982
57078
  var DEAD_EXPORT_EXCLUDED_ROLES = new Set([
56983
57079
  "api_route",
56984
57080
  "cli_command",
@@ -73541,7 +73637,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
73541
73637
  if (!input.dispatcher) {
73542
73638
  throw new Error("no evaluation dispatcher available (cannot run validation)");
73543
73639
  }
73544
- const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-s89ja08q.js");
73640
+ const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-k1rkbjm8.js");
73545
73641
  const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
73546
73642
  const result = await withProtectedSetIntegrity([evalInputRoot, ...protectedRoots(input.directory)], () => _internals97.evaluateCandidateV1({
73547
73643
  projectRoot: input.directory,
@@ -75586,7 +75682,7 @@ function buildDetailedHelp(commandName, entry) {
75586
75682
  async function handleHelpCommand(ctx) {
75587
75683
  const targetCommand = ctx.args.join(" ");
75588
75684
  if (!targetCommand) {
75589
- const { buildHelpText } = await import("./index-9nw6z98k.js");
75685
+ const { buildHelpText } = await import("./index-qzqpq75z.js");
75590
75686
  return buildHelpText();
75591
75687
  }
75592
75688
  const tokens = targetCommand.split(/\s+/);
@@ -75595,7 +75691,7 @@ async function handleHelpCommand(ctx) {
75595
75691
  return _internals100.buildDetailedHelp(resolved.key, resolved.entry);
75596
75692
  }
75597
75693
  const similar = _internals100.findSimilarCommands(targetCommand);
75598
- const { buildHelpText: fullHelp } = await import("./index-9nw6z98k.js");
75694
+ const { buildHelpText: fullHelp } = await import("./index-qzqpq75z.js");
75599
75695
  if (similar.length > 0) {
75600
75696
  return `Command '/swarm ${targetCommand}' not found.
75601
75697
 
@@ -75782,7 +75878,7 @@ var COMMAND_REGISTRY = {
75782
75878
  },
75783
75879
  "guardrail explain": {
75784
75880
  handler: async (ctx) => {
75785
- const { handleGuardrailExplain } = await import("./guardrail-explain-11fx66cx.js");
75881
+ const { handleGuardrailExplain } = await import("./guardrail-explain-wqb5h7kk.js");
75786
75882
  return handleGuardrailExplain(ctx.directory, ctx.args);
75787
75883
  },
75788
75884
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -75792,7 +75888,7 @@ var COMMAND_REGISTRY = {
75792
75888
  },
75793
75889
  "guardrail reset": {
75794
75890
  handler: async (ctx) => {
75795
- const { handleGuardrailReset } = await import("./guardrail-reset-zp5xe0n5.js");
75891
+ const { handleGuardrailReset } = await import("./guardrail-reset-0wdj53cp.js");
75796
75892
  return handleGuardrailReset(ctx.args, ctx.sessionID);
75797
75893
  },
75798
75894
  description: "Reset one exact active invocation/action circuit after repair",
@@ -75801,7 +75897,7 @@ var COMMAND_REGISTRY = {
75801
75897
  },
75802
75898
  "guardrail-explain": {
75803
75899
  handler: async (ctx) => {
75804
- const { handleGuardrailExplain } = await import("./guardrail-explain-11fx66cx.js");
75900
+ const { handleGuardrailExplain } = await import("./guardrail-explain-wqb5h7kk.js");
75805
75901
  return handleGuardrailExplain(ctx.directory, ctx.args);
75806
75902
  },
75807
75903
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -75811,7 +75907,7 @@ var COMMAND_REGISTRY = {
75811
75907
  },
75812
75908
  "guardrail-reset": {
75813
75909
  handler: async (ctx) => {
75814
- const { handleGuardrailReset } = await import("./guardrail-reset-zp5xe0n5.js");
75910
+ const { handleGuardrailReset } = await import("./guardrail-reset-0wdj53cp.js");
75815
75911
  return handleGuardrailReset(ctx.args, ctx.sessionID);
75816
75912
  },
75817
75913
  description: "Reset one exact active invocation/action circuit after repair",
@@ -75821,7 +75917,7 @@ var COMMAND_REGISTRY = {
75821
75917
  },
75822
75918
  "guardrail-log": {
75823
75919
  handler: async (ctx) => {
75824
- const { handleGuardrailLog } = await import("./guardrail-log-ahvfn58c.js");
75920
+ const { handleGuardrailLog } = await import("./guardrail-log-614g1pta.js");
75825
75921
  return handleGuardrailLog(ctx.directory, ctx.args);
75826
75922
  },
75827
75923
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -81796,7 +81892,7 @@ function getDisplayFinalPromptPressure() {
81796
81892
  async function rehydratePrSubscriptions(sessionID, directory) {
81797
81893
  const map = new Map;
81798
81894
  try {
81799
- const { listActive: listActive2 } = await import("./pr-subscriptions-mp7fyh1r.js");
81895
+ const { listActive: listActive2 } = await import("./pr-subscriptions-00evnffe.js");
81800
81896
  const records = await listActive2(directory);
81801
81897
  for (const record of records) {
81802
81898
  if (record.sessionID !== sessionID)
@@ -82242,7 +82338,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
82242
82338
  return extracted === expectedSessionId;
82243
82339
  }
82244
82340
  async function inspectStandardWorktreeCollisionOwnership(identity) {
82245
- const collisionOwnership = await import("./worktree-collision-ownership-zw65t2p9.js");
82341
+ const collisionOwnership = await import("./worktree-collision-ownership-2pc20ypq.js");
82246
82342
  return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
82247
82343
  }
82248
82344
  async function runRecoveryGit(directory, args, timeoutMs = 15000) {
@@ -82651,7 +82747,7 @@ async function precreateStandardWorktreeSession(args) {
82651
82747
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
82652
82748
  if (laneProfile) {
82653
82749
  try {
82654
- const { writeLaneProfileToDiskReal } = await import("./core-dn8bn81g.js");
82750
+ const { writeLaneProfileToDiskReal } = await import("./core-ev2ebc4v.js");
82655
82751
  await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
82656
82752
  } catch {}
82657
82753
  }
@@ -83576,7 +83672,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
83576
83672
  }
83577
83673
  clearWorktreeMergeStatus(statusKey);
83578
83674
  try {
83579
- const { removeLaneProfileFromDiskReal } = await import("./core-dn8bn81g.js");
83675
+ const { removeLaneProfileFromDiskReal } = await import("./core-ev2ebc4v.js");
83580
83676
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
83581
83677
  } catch {}
83582
83678
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);
@@ -83779,4 +83875,4 @@ var _internals102 = {
83779
83875
  resolveGitExecutable
83780
83876
  };
83781
83877
 
83782
- export { resetActionCircuitExternally, getBlockingActionCircuit, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcExtractRecursiveRmTargets, dcEvaluateRecursiveDeleteTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, getSharedClassifierGuardrailBlock, classifyCommand, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, getAgentSession, parseLeanLaneIndex, computeLaneRuntimeProfile, MAX_TRACKED_STANDARD_WORKTREE_CALLS, awaitingMergeByCallID, standardWorktreeByCallID, standardWorktreeSerializationSessions, getStandardWorktreeDegradationReason, resetStandardWorktreeIsolationState, checkStandardWorktreeSerializationRelease, sanitizeWorktreeTaskId, preProvisionCollisionCheck, isLaneOwnedByCurrentSession, precreateStandardWorktreeSession, preserveBackgroundWorktreeOwnershipForCallId, preserveDirtyWorktreeForCallId, preserveDirtyWorktreeAtPath, cleanupStandardWorktreeForCallId, abortStandardWorktreeDispatch, finishStandardWorktreeDispatch, readLaneEnvFileFromDisk, _internals102 as _internals, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleApproveWriteCommand, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals25 as _internals1, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals29 as _internals2, createHivePromoterHook, promoteToHive, promoteFromSwarm, handleCloseCommand, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getPluginConfigDir, getPluginCachePaths, getPluginLockFilePaths, VERSION_PINNED_LEAF, discoverVersionPinnedCachePaths, readCachePackageVersion, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, safeRealpathSync, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleRecoverCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleReviewCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, COMMAND_REGISTRY, VALID_COMMANDS, _internals100 as _internals3, resolveCommand };
83878
+ export { resetActionCircuitExternally, getBlockingActionCircuit, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcExtractRecursiveRmTargets, dcEvaluateRecursiveDeleteTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, getSharedClassifierGuardrailBlock, classifyCommand, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, getAgentSession, parseLeanLaneIndex, computeLaneRuntimeProfile, MAX_TRACKED_STANDARD_WORKTREE_CALLS, awaitingMergeByCallID, standardWorktreeByCallID, standardWorktreeSerializationSessions, getStandardWorktreeDegradationReason, resetStandardWorktreeIsolationState, checkStandardWorktreeSerializationRelease, sanitizeWorktreeTaskId, preProvisionCollisionCheck, isLaneOwnedByCurrentSession, precreateStandardWorktreeSession, preserveBackgroundWorktreeOwnershipForCallId, preserveDirtyWorktreeForCallId, preserveDirtyWorktreeAtPath, cleanupStandardWorktreeForCallId, abortStandardWorktreeDispatch, finishStandardWorktreeDispatch, readLaneEnvFileFromDisk, _internals102 as _internals, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleApproveWriteCommand, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals25 as _internals1, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals29 as _internals2, createHivePromoterHook, promoteToHive, promoteFromSwarm, safeRealpathSync, handleCloseCommand, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getPluginConfigDir, getPluginCachePaths, getPluginLockFilePaths, VERSION_PINNED_LEAF, discoverVersionPinnedCachePaths, readCachePackageVersion, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleRecoverCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleReviewCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, COMMAND_REGISTRY, VALID_COMMANDS, _internals100 as _internals3, resolveCommand };