opencode-swarm 7.138.4 → 7.139.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 (91) hide show
  1. package/README.md +7 -6
  2. package/dist/cli/{config-doctor-31yppse4.js → config-doctor-tgnr91q3.js} +2 -2
  3. package/dist/cli/{core-65c7rvqf.js → core-g2dfh9fq.js} +1 -1
  4. package/dist/cli/{curation-policy-hs9pc1rp.js → curation-policy-2qnhgdtt.js} +7 -7
  5. package/dist/cli/{curator-drift-jpap6hv4.js → curator-drift-vfh07mqy.js} +5 -2
  6. package/dist/cli/{curator-llm-factory-wm27ra25.js → curator-llm-factory-1ftzece0.js} +28 -28
  7. package/dist/cli/{curator-54n1y4j8.js → curator-nbsag633.js} +28 -28
  8. package/dist/cli/{evidence-summary-service-hrxcf29a.js → evidence-summary-service-kzxr71yd.js} +9 -9
  9. package/dist/cli/{gate-evidence-ecx4djaw.js → gate-evidence-z2b1ymnw.js} +5 -5
  10. package/dist/cli/{guardrail-explain-1729nse8.js → guardrail-explain-vb9k9zwm.js} +29 -29
  11. package/dist/cli/{guardrail-log-yjj5srkw.js → guardrail-log-0djnvfas.js} +3 -3
  12. package/dist/cli/{hive-promoter-es2x2b0e.js → hive-promoter-bpt26yew.js} +28 -28
  13. package/dist/cli/{index-mycqmsz5.js → index-0wp67gqj.js} +452 -159
  14. package/dist/cli/{index-c60whfgh.js → index-0ymhx85c.js} +2 -2
  15. package/dist/cli/{index-5q009kc4.js → index-15526t16.js} +8 -3
  16. package/dist/cli/{index-smsy2p8n.js → index-3eddtgxt.js} +1 -1
  17. package/dist/cli/{index-4fmztnrq.js → index-4xbyy6aw.js} +2 -2
  18. package/dist/cli/{index-xybtaph7.js → index-5j6chvj8.js} +1 -1
  19. package/dist/cli/{index-39k6y018.js → index-5w7ekpy3.js} +2 -2
  20. package/dist/cli/{index-z7jgvm9b.js → index-5zyk8qgv.js} +2 -2
  21. package/dist/cli/{index-en4fb04r.js → index-668dpw5e.js} +1 -1
  22. package/dist/cli/{index-m8txs2a9.js → index-91s653xx.js} +1 -1
  23. package/dist/cli/{index-y28n2wmq.js → index-a12906mj.js} +1 -1
  24. package/dist/cli/{index-10mz5js6.js → index-a5eba0t8.js} +2 -2
  25. package/dist/cli/{index-57stye65.js → index-aymt7hzw.js} +6 -3
  26. package/dist/cli/{index-1g6xpjk3.js → index-db7wf6ke.js} +7 -7
  27. package/dist/cli/{index-m1pwkwfe.js → index-dw09fz3w.js} +1 -1
  28. package/dist/cli/{index-fsrp8wp3.js → index-ed5ykebp.js} +25 -2
  29. package/dist/cli/{index-jbge0dyh.js → index-en6qq954.js} +3 -3
  30. package/dist/cli/{index-tqshdzaw.js → index-gvhvz176.js} +2 -2
  31. package/dist/cli/{index-e1kgxchq.js → index-hgrkhxbk.js} +2 -2
  32. package/dist/cli/{index-33q2gmgd.js → index-hn0mdcmj.js} +1 -1
  33. package/dist/cli/{index-a9xny52r.js → index-ht4q3548.js} +2 -2
  34. package/dist/cli/{index-q344kj84.js → index-prmb5qfp.js} +2 -2
  35. package/dist/cli/{index-x20cgr2q.js → index-q7ezzgwq.js} +16 -2
  36. package/dist/cli/{index-ngqxzkqm.js → index-s608d3hw.js} +2 -2
  37. package/dist/cli/{index-50mwt8fx.js → index-vxbppwvf.js} +5 -5
  38. package/dist/cli/{index-rrxcfxrd.js → index-wrt6m5ze.js} +1 -1
  39. package/dist/cli/{index-4qzeef9h.js → index-x9q4bbhd.js} +1 -1
  40. package/dist/cli/{index-m40ea3zk.js → index-xec724kg.js} +2 -2
  41. package/dist/cli/{index-k27a4e5g.js → index-xka8s8jw.js} +30 -30
  42. package/dist/cli/{index-a18hk2fw.js → index-xr07r80d.js} +513 -483
  43. package/dist/cli/{index-gm3pjfhb.js → index-y1zcsf2a.js} +1 -1
  44. package/dist/cli/{index-tjwz5tct.js → index-ywysg26s.js} +4 -4
  45. package/dist/cli/index.js +28 -28
  46. package/dist/cli/{knowledge-escalator-s6z1x65b.js → knowledge-escalator-pjg2x75c.js} +8 -8
  47. package/dist/cli/{knowledge-events-nnyn6hst.js → knowledge-events-vxheptk8.js} +6 -6
  48. package/dist/cli/{knowledge-link-xc6yhxmz.js → knowledge-link-3tq8w6gs.js} +5 -5
  49. package/dist/cli/{knowledge-store-x4yfc7v3.js → knowledge-store-36mascwz.js} +6 -6
  50. package/dist/cli/{knowledge-validator-1v047gsa.js → knowledge-validator-anats6rj.js} +9 -9
  51. package/dist/cli/{pending-delegations-7dbc0j2a.js → pending-delegations-tmyf18p4.js} +5 -5
  52. package/dist/cli/{pr-subscriptions-m943zn6g.js → pr-subscriptions-hhx6yk24.js} +5 -5
  53. package/dist/cli/{runner-x1hy047y.js → runner-w30gazew.js} +6 -6
  54. package/dist/cli/{scan-cursor-jxajj6s7.js → scan-cursor-apbz9eez.js} +7 -7
  55. package/dist/cli/{schema-fj32eyae.js → schema-x9fr2ey8.js} +3 -1
  56. package/dist/cli/{scope-persistence-w7zen2wz.js → scope-persistence-3f0d4fwv.js} +4 -4
  57. package/dist/cli/{skill-generator-rt0jqcsa.js → skill-generator-20czn4kd.js} +10 -10
  58. package/dist/cli/{telemetry-0yqed3jv.js → telemetry-4tgrfhaz.js} +1 -1
  59. package/dist/cli/{worktree-collision-ownership-hjrt5hx2.js → worktree-collision-ownership-vexb0b6r.js} +38 -8
  60. package/dist/config/context-window.d.ts +210 -0
  61. package/dist/config/schema.d.ts +18 -0
  62. package/dist/evaluation/ephemeral-agent-dispatcher.d.ts +18 -0
  63. package/dist/evaluation/model-dispatcher.d.ts +1 -0
  64. package/dist/hooks/delegate-ack-collector.d.ts +1 -1
  65. package/dist/hooks/delegation-gate/worktree-collision-ownership.d.ts +7 -0
  66. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +2 -1
  67. package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +6 -0
  68. package/dist/hooks/index.d.ts +2 -2
  69. package/dist/hooks/init-orphan-recovery.d.ts +4 -1
  70. package/dist/hooks/knowledge-application-gate.d.ts +2 -1
  71. package/dist/hooks/knowledge-application.d.ts +5 -4
  72. package/dist/hooks/knowledge-injector.d.ts +16 -0
  73. package/dist/hooks/knowledge-types.d.ts +1 -1
  74. package/dist/hooks/messages-transform.d.ts +18 -0
  75. package/dist/hooks/model-limits.d.ts +88 -30
  76. package/dist/index.js +501 -499
  77. package/dist/memory/injector.d.ts +2 -0
  78. package/dist/plan/manager.d.ts +2 -0
  79. package/dist/services/context-budget-service.d.ts +6 -1
  80. package/dist/services/run-memory.d.ts +53 -5
  81. package/dist/services/status-service.d.ts +14 -0
  82. package/dist/state.d.ts +37 -0
  83. package/dist/tools/context-status.d.ts +3 -1
  84. package/dist/tools/update-task-status.d.ts +2 -0
  85. package/dist/turbo/lean/runner.d.ts +10 -0
  86. package/dist/utils/ephemeral-session-teardown.d.ts +98 -0
  87. package/dist/utils/path-security.d.ts +95 -1
  88. package/dist/utils/swarm-artifact-cache.d.ts +13 -0
  89. package/dist/worktree/index.d.ts +1 -1
  90. package/dist/worktree/merge.d.ts +36 -3
  91. package/package.json +1 -1
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-1g6xpjk3.js";
5
+ } from "./index-db7wf6ke.js";
6
6
  import {
7
7
  resolveKnowledgeStoreDir
8
- } from "./index-en4fb04r.js";
8
+ } from "./index-668dpw5e.js";
9
9
  import {
10
10
  init_knowledge_types,
11
11
  isActiveStatus
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.138.4",
24
+ version: "7.139.1",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",
@@ -152,6 +152,10 @@ var init_package = __esm(() => {
152
152
  };
153
153
  });
154
154
 
155
+ // src/config/context-window.ts
156
+ var DEFAULT_MODEL_CONTEXT_TOKENS = 128000;
157
+ var init_context_window = () => {};
158
+
155
159
  // src/config/schema.ts
156
160
  function isKnownCanonicalRole(role) {
157
161
  if (!role)
@@ -290,6 +294,7 @@ var init_schema = __esm(() => {
290
294
  init_package();
291
295
  init_knowledge_types();
292
296
  init_constants();
297
+ init_context_window();
293
298
  _internals = {
294
299
  stripKnownSwarmPrefix,
295
300
  getCanonicalAgentRole,
@@ -371,7 +376,7 @@ var init_schema = __esm(() => {
371
376
  enabled: exports_external.boolean().default(true),
372
377
  warn_threshold: exports_external.number().min(0).max(1).default(0.7),
373
378
  critical_threshold: exports_external.number().min(0).max(1).default(0.9),
374
- model_limits: exports_external.record(exports_external.string(), exports_external.number().min(1000)).default({ default: 128000 }),
379
+ model_limits: exports_external.record(exports_external.string(), exports_external.number().min(1000)).default({}),
375
380
  max_injection_tokens: exports_external.number().min(100).max(50000).default(4000),
376
381
  unified_injection_tokens: exports_external.number().min(100).max(50000).optional(),
377
382
  tracked_agents: exports_external.array(exports_external.string()).default(["architect"]),
@@ -1790,4 +1795,4 @@ var init_schema = __esm(() => {
1790
1795
  });
1791
1796
  });
1792
1797
 
1793
- export { init_package, package_default, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, PluginConfigSchema, init_schema };
1798
+ export { init_package, package_default, DEFAULT_MODEL_CONTEXT_TOKENS, init_context_window, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, PluginConfigSchema, init_schema };
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  computePlanStructureHash,
7
7
  derivePlanId
8
- } from "./index-4fmztnrq.js";
8
+ } from "./index-4xbyy6aw.js";
9
9
  import {
10
10
  PlanSchema
11
11
  } from "./index-1kz6da87.js";
@@ -6,10 +6,10 @@ import {
6
6
  } from "./index-1kz6da87.js";
7
7
  import {
8
8
  withEvidenceLock
9
- } from "./index-xybtaph7.js";
9
+ } from "./index-5j6chvj8.js";
10
10
  import {
11
11
  emit
12
- } from "./index-10mz5js6.js";
12
+ } from "./index-a5eba0t8.js";
13
13
  import {
14
14
  criticalWarn,
15
15
  init_logger,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-7g4c7s5r.js";
5
5
  import {
6
6
  emit
7
- } from "./index-10mz5js6.js";
7
+ } from "./index-a5eba0t8.js";
8
8
  import {
9
9
  __toESM
10
10
  } from "./index-a76rekgs.js";
@@ -3,10 +3,10 @@ import {
3
3
  atomicWriteFile,
4
4
  taskEvidencePath,
5
5
  withTaskEvidenceLock
6
- } from "./index-tqshdzaw.js";
6
+ } from "./index-gvhvz176.js";
7
7
  import {
8
8
  telemetry
9
- } from "./index-10mz5js6.js";
9
+ } from "./index-a5eba0t8.js";
10
10
  import {
11
11
  exports_external,
12
12
  init_zod
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-4qzeef9h.js";
4
+ } from "./index-x9q4bbhd.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-xybtaph7.js";
7
+ } from "./index-5j6chvj8.js";
8
8
  import {
9
9
  exports_external,
10
10
  init_zod
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  atomicWriteFile
4
- } from "./index-tqshdzaw.js";
4
+ } from "./index-gvhvz176.js";
5
5
  import {
6
6
  init_logger,
7
7
  warn
@@ -6,7 +6,7 @@ import {
6
6
  PluginConfigSchema,
7
7
  init_schema,
8
8
  stripKnownSwarmPrefix
9
- } from "./index-5q009kc4.js";
9
+ } from "./index-15526t16.js";
10
10
  import {
11
11
  ALL_AGENT_NAMES,
12
12
  init_constants
@@ -86,7 +86,7 @@ var _internals = {
86
86
  symlinkSync: fs.symlinkSync
87
87
  },
88
88
  writeScopeToDisk: async (directory, taskId, files) => {
89
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-w7zen2wz.js");
89
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-3f0d4fwv.js");
90
90
  return realWrite(directory, taskId, files);
91
91
  },
92
92
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -532,7 +532,7 @@ var CATALOG_SOURCE = [
532
532
  category: "plan",
533
533
  severity: "notice",
534
534
  privacyClass: "operational",
535
- producer: "src/plan/manager.ts:329",
535
+ producer: "src/plan/manager.ts:335",
536
536
  consumers: NO_CONSUMERS,
537
537
  futureOwnerIssue: ISSUE_SINK,
538
538
  retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
@@ -545,7 +545,7 @@ var CATALOG_SOURCE = [
545
545
  category: "plan",
546
546
  severity: "warning",
547
547
  privacyClass: "sensitive",
548
- producer: "src/plan/manager.ts:1696",
548
+ producer: "src/plan/manager.ts:1724",
549
549
  consumers: NO_CONSUMERS,
550
550
  futureOwnerIssue: ISSUE_SINK,
551
551
  retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
@@ -4,10 +4,10 @@ import {
4
4
  } from "./index-ae75rja9.js";
5
5
  import {
6
6
  resolveKnowledgeStoreDir
7
- } from "./index-en4fb04r.js";
7
+ } from "./index-668dpw5e.js";
8
8
  import {
9
9
  atomicWriteFile
10
- } from "./index-tqshdzaw.js";
10
+ } from "./index-gvhvz176.js";
11
11
  import {
12
12
  require_proper_lockfile
13
13
  } from "./index-7g4c7s5r.js";
@@ -457,6 +457,9 @@ function recomputeCounters(events, legacyRecords = [], baseline = new Map) {
457
457
  case "ignored":
458
458
  r.ignored_count += 1;
459
459
  break;
460
+ case "contradicted":
461
+ r.contradicted_count += 1;
462
+ break;
460
463
  case "violated":
461
464
  r.violated_count += 1;
462
465
  r.violation_timestamps.push(rec.timestamp);
@@ -625,7 +628,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
625
628
  deltas.push({ id, delta });
626
629
  }
627
630
  if (deltas.length > 0) {
628
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-x4yfc7v3.js");
631
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-36mascwz.js");
629
632
  await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
630
633
  }
631
634
  return {
@@ -6,17 +6,17 @@ import {
6
6
  } from "./index-ae75rja9.js";
7
7
  import {
8
8
  resolveKnowledgeStoreDir
9
- } from "./index-en4fb04r.js";
9
+ } from "./index-668dpw5e.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-tqshdzaw.js";
12
+ } from "./index-gvhvz176.js";
13
13
  import {
14
14
  init_knowledge_types,
15
15
  isActiveStatus
16
16
  } from "./index-bk5tah7q.js";
17
17
  import {
18
18
  readCachedParsedFile
19
- } from "./index-fsrp8wp3.js";
19
+ } from "./index-ed5ykebp.js";
20
20
  import {
21
21
  require_proper_lockfile
22
22
  } from "./index-7g4c7s5r.js";
@@ -702,7 +702,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
702
702
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
703
703
  if (atFloor.length === 0 && recovered.length === 0)
704
704
  return;
705
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-nnyn6hst.js");
705
+ const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-vxheptk8.js");
706
706
  const rollups = await readKnowledgeCounterRollups(directory);
707
707
  const flagIds = new Set;
708
708
  for (const e of atFloor) {
@@ -769,11 +769,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
769
769
  });
770
770
  }
771
771
  if (action === "quarantine" && toQuarantine.length > 0) {
772
- const { quarantineEntry } = await import("./knowledge-validator-1v047gsa.js");
773
- const { KnowledgeConfigSchema } = await import("./schema-fj32eyae.js");
772
+ const { quarantineEntry } = await import("./knowledge-validator-anats6rj.js");
773
+ const { KnowledgeConfigSchema } = await import("./schema-x9fr2ey8.js");
774
774
  let config;
775
775
  try {
776
- const { loadPluginConfigWithMeta } = await import("./index-a9xny52r.js");
776
+ const { loadPluginConfigWithMeta } = await import("./index-ht4q3548.js");
777
777
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
778
778
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
779
779
  } catch {
@@ -6,7 +6,7 @@ import {
6
6
  PluginConfigSchema,
7
7
  init_schema,
8
8
  resolveExternalSkillsConfig
9
- } from "./index-5q009kc4.js";
9
+ } from "./index-15526t16.js";
10
10
  import {
11
11
  advisoryWarn,
12
12
  init_warning_buffer
@@ -1,5 +1,6 @@
1
1
  // @bun
2
2
  // src/utils/swarm-artifact-cache.ts
3
+ import * as fsSync from "fs";
3
4
  import * as fs from "fs/promises";
4
5
  import * as path from "path";
5
6
  var MAX_CACHE_ENTRIES = 128;
@@ -24,9 +25,13 @@ var stats = {
24
25
  function sameStamp(a, b) {
25
26
  return a.mtimeMs === b.mtimeMs && a.ctimeMs === b.ctimeMs && a.size === b.size;
26
27
  }
28
+ var _internals = {
29
+ stat: fs.stat,
30
+ statSync: fsSync.statSync
31
+ };
27
32
  async function getStamp(filePath) {
28
33
  try {
29
- const stat2 = await fs.stat(filePath);
34
+ const stat2 = await _internals.stat(filePath);
30
35
  if (!stat2.isFile())
31
36
  return null;
32
37
  return { mtimeMs: stat2.mtimeMs, ctimeMs: stat2.ctimeMs, size: stat2.size };
@@ -124,5 +129,23 @@ function invalidateCachedArtifact(filePath) {
124
129
  parsedCache.delete(key);
125
130
  }
126
131
  }
132
+ function resetSwarmArtifactCache() {
133
+ textCache.clear();
134
+ parsedCache.clear();
135
+ stats.textReadCount = 0;
136
+ stats.textCacheHitCount = 0;
137
+ stats.textCacheMissCount = 0;
138
+ stats.parsedReadCount = 0;
139
+ stats.parseCount = 0;
140
+ stats.parsedCacheHitCount = 0;
141
+ stats.parsedCacheMissCount = 0;
142
+ stats.statFailureCount = 0;
143
+ stats.evictionCount = 0;
144
+ stats.textEvictionCount = 0;
145
+ stats.parsedEvictionCount = 0;
146
+ stats.cloneFallbackCount = 0;
147
+ stats.textEntryCount = 0;
148
+ stats.parsedEntryCount = 0;
149
+ }
127
150
 
128
- export { readCachedTextFile, readCachedParsedFile, invalidateCachedArtifact };
151
+ export { readCachedTextFile, readCachedParsedFile, invalidateCachedArtifact, resetSwarmArtifactCache };
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  ALLOWED_SKILL_PATH_PREFIXES,
4
4
  validateSkillPath
5
- } from "./index-tjwz5tct.js";
5
+ } from "./index-ywysg26s.js";
6
6
  import {
7
7
  computeOutcomeSignal,
8
8
  readKnowledge,
9
9
  resolveHiveKnowledgePath,
10
10
  resolveSwarmKnowledgePath,
11
11
  transactKnowledge
12
- } from "./index-1g6xpjk3.js";
12
+ } from "./index-db7wf6ke.js";
13
13
  import {
14
14
  effectiveRetrievalOutcomes,
15
15
  readKnowledgeCounterRollups
16
- } from "./index-57stye65.js";
16
+ } from "./index-aymt7hzw.js";
17
17
  import {
18
18
  init_knowledge_types,
19
19
  isActiveStatus
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  invalidateCachedArtifact
4
- } from "./index-fsrp8wp3.js";
4
+ } from "./index-ed5ykebp.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-xybtaph7.js";
7
+ } from "./index-5j6chvj8.js";
8
8
  import {
9
9
  bunWrite
10
10
  } from "./index-y111zefa.js";
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-a18hk2fw.js";
15
+ } from "./index-xr07r80d.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-gm3pjfhb.js";
22
+ } from "./index-y1zcsf2a.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-gm3pjfhb.js";
5
+ } from "./index-y1zcsf2a.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -7,7 +7,7 @@ import {
7
7
  loadPluginConfigWithMeta,
8
8
  loadPluginConfigWithMetaAsync,
9
9
  resolveWorktreeIsolationConfig
10
- } from "./index-m1pwkwfe.js";
10
+ } from "./index-dw09fz3w.js";
11
11
  import {
12
12
  ApprovalEvidenceSchema,
13
13
  BaseEvidenceSchema,
@@ -54,7 +54,7 @@ import {
54
54
  TurboConfigSchema,
55
55
  WorktreeIsolationConfigSchema,
56
56
  resolveAutoReviewConfig
57
- } from "./index-5q009kc4.js";
57
+ } from "./index-15526t16.js";
58
58
  import"./index-bk5tah7q.js";
59
59
  import {
60
60
  MigrationStatusSchema,
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-4qzeef9h.js";
4
+ } from "./index-x9q4bbhd.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-xybtaph7.js";
7
+ } from "./index-5j6chvj8.js";
8
8
  import {
9
9
  exports_external,
10
10
  init_zod
@@ -1,17 +1,23 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-4qzeef9h.js";
4
+ } from "./index-x9q4bbhd.js";
5
5
 
6
6
  // src/hooks/delegation-gate/worktree-provisioning-owner.ts
7
+ import { createHash, randomBytes } from "crypto";
7
8
  import * as fs from "fs";
8
9
  import * as path from "path";
9
10
  var PROVISIONING_OWNER_DIR = "worktree-provisioning-owners";
10
11
  var MAX_PROVISIONING_OWNERS = 512;
11
12
  var MAX_PROVISIONING_OWNER_BYTES = 16 * 1024;
13
+ var WORKTREE_PROVISIONING_OWNER_LEASE_MS = 5 * 60 * 1000;
12
14
  function ownerDirectory(directory) {
13
15
  return path.dirname(validateSwarmPath(directory, path.join(PROVISIONING_OWNER_DIR, ".containment-anchor")));
14
16
  }
17
+ function ownerPath(directory, callID) {
18
+ const digest = createHash("sha256").update(callID).digest("hex");
19
+ return validateSwarmPath(directory, path.join(PROVISIONING_OWNER_DIR, `${digest}.json`));
20
+ }
15
21
  function isOwner(value) {
16
22
  if (!value || typeof value !== "object" || Array.isArray(value))
17
23
  return false;
@@ -20,6 +26,14 @@ function isOwner(value) {
20
26
  const validTaskIdentity = schemaVersion === 1 ? candidate.taskId === undefined : schemaVersion === 2 && typeof candidate.taskId === "string" && candidate.taskId.length > 0 && candidate.taskId.length <= 512;
21
27
  return (schemaVersion === 1 || schemaVersion === 2) && validTaskIdentity && typeof candidate.callID === "string" && candidate.callID.length > 0 && candidate.callID.length <= 512 && typeof candidate.parentSessionId === "string" && candidate.parentSessionId.length > 0 && candidate.parentSessionId.length <= 512 && typeof candidate.worktreeSessionId === "string" && candidate.worktreeSessionId.length > 0 && candidate.worktreeSessionId.length <= 512 && typeof candidate.createdAt === "number" && Number.isFinite(candidate.createdAt) && candidate.createdAt >= 0;
22
28
  }
29
+ function removeWorktreeProvisioningOwner(directory, callID) {
30
+ try {
31
+ fs.unlinkSync(ownerPath(directory, callID));
32
+ return true;
33
+ } catch (error) {
34
+ return error.code === "ENOENT";
35
+ }
36
+ }
23
37
  function scanWorktreeProvisioningOwnersForRecovery(directory) {
24
38
  let directoryPath;
25
39
  let entries;
@@ -77,4 +91,4 @@ function scanWorktreeProvisioningOwnersForRecovery(directory) {
77
91
  return { status: "ok", owners };
78
92
  }
79
93
 
80
- export { scanWorktreeProvisioningOwnersForRecovery };
94
+ export { WORKTREE_PROVISIONING_OWNER_LEASE_MS, removeWorktreeProvisioningOwner, scanWorktreeProvisioningOwnersForRecovery };
@@ -9,10 +9,10 @@ import {
9
9
  } from "./index-y8552snf.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-tqshdzaw.js";
12
+ } from "./index-gvhvz176.js";
13
13
  import {
14
14
  withEvidenceLock
15
- } from "./index-xybtaph7.js";
15
+ } from "./index-5j6chvj8.js";
16
16
  import {
17
17
  exports_external,
18
18
  init_zod
@@ -6,13 +6,13 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-1g6xpjk3.js";
9
+ } from "./index-db7wf6ke.js";
10
10
  import {
11
11
  countEntryContradictionsInWindow,
12
12
  countEntryViolationsInWindow,
13
13
  readKnowledgeEvents,
14
14
  recordKnowledgeEvent
15
- } from "./index-57stye65.js";
15
+ } from "./index-aymt7hzw.js";
16
16
  import {
17
17
  init_knowledge_types,
18
18
  isActiveStatus
@@ -190,11 +190,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
190
190
  alreadyInactive: true
191
191
  };
192
192
  }
193
- const { quarantineEntry } = await import("./knowledge-validator-1v047gsa.js");
193
+ const { quarantineEntry } = await import("./knowledge-validator-anats6rj.js");
194
194
  let policyConfig;
195
195
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-fj32eyae.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-a9xny52r.js");
196
+ const { KnowledgeConfigSchema } = await import("./schema-x9fr2ey8.js");
197
+ const { loadPluginConfigWithMeta } = await import("./index-ht4q3548.js");
198
198
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
199
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
200
  } catch {
@@ -9,7 +9,7 @@ import {
9
9
  readEvaluationRun,
10
10
  saveEvaluationRun,
11
11
  saveTaskSetSnapshot
12
- } from "./index-ngqxzkqm.js";
12
+ } from "./index-s608d3hw.js";
13
13
  import {
14
14
  canonicalHash,
15
15
  computeCandidateInputContentHash,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  readCachedTextFile
4
- } from "./index-fsrp8wp3.js";
4
+ } from "./index-ed5ykebp.js";
5
5
  import {
6
6
  SwarmError
7
7
  } from "./index-z6xqpmqg.js";
@@ -4,13 +4,13 @@ import {
4
4
  } from "./index-rtry5xyf.js";
5
5
  import {
6
6
  readKnowledgeEvents
7
- } from "./index-57stye65.js";
7
+ } from "./index-aymt7hzw.js";
8
8
  import {
9
9
  isLinked,
10
10
  readLinkPointer,
11
11
  resolveKnowledgeStoreDir,
12
12
  resolveLinkDir
13
- } from "./index-en4fb04r.js";
13
+ } from "./index-668dpw5e.js";
14
14
 
15
15
  // src/knowledge/curation-policy.ts
16
16
  import { appendFile, mkdir as mkdir2, readFile as readFile2 } from "fs/promises";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-e1kgxchq.js";
4
+ } from "./index-hgrkhxbk.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-33q2gmgd.js";
7
+ } from "./index-hn0mdcmj.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -84,62 +84,62 @@ import {
84
84
  handleWriteRetroCommand,
85
85
  normalizeSwarmCommandInput,
86
86
  resolveCommand
87
- } from "./index-a18hk2fw.js";
87
+ } from "./index-xr07r80d.js";
88
88
  import"./index-vm4xw9z3.js";
89
- import"./index-rrxcfxrd.js";
90
- import"./index-gm3pjfhb.js";
91
- import"./index-m8txs2a9.js";
92
- import"./index-mycqmsz5.js";
93
- import"./index-ngqxzkqm.js";
89
+ import"./index-wrt6m5ze.js";
90
+ import"./index-y1zcsf2a.js";
91
+ import"./index-91s653xx.js";
92
+ import"./index-0wp67gqj.js";
93
+ import"./index-s608d3hw.js";
94
94
  import"./index-y8552snf.js";
95
95
  import"./index-4905hd2m.js";
96
96
  import"./index-134d35c1.js";
97
- import"./index-jbge0dyh.js";
98
- import"./index-50mwt8fx.js";
99
- import"./index-c60whfgh.js";
97
+ import"./index-en6qq954.js";
98
+ import"./index-vxbppwvf.js";
99
+ import"./index-0ymhx85c.js";
100
100
  import"./index-6mjf4vr1.js";
101
101
  import"./index-c8s9a3zh.js";
102
102
  import"./index-9ss2m4rs.js";
103
103
  import"./index-wsdnttf4.js";
104
- import"./index-39k6y018.js";
105
- import"./index-tjwz5tct.js";
106
- import"./index-m40ea3zk.js";
104
+ import"./index-5w7ekpy3.js";
105
+ import"./index-ywysg26s.js";
106
+ import"./index-xec724kg.js";
107
107
  import"./index-rtry5xyf.js";
108
- import"./index-1g6xpjk3.js";
109
- import"./index-57stye65.js";
108
+ import"./index-db7wf6ke.js";
109
+ import"./index-aymt7hzw.js";
110
110
  import"./index-ae75rja9.js";
111
- import"./index-en4fb04r.js";
112
- import"./index-tqshdzaw.js";
113
- import"./index-m1pwkwfe.js";
111
+ import"./index-668dpw5e.js";
112
+ import"./index-gvhvz176.js";
113
+ import"./index-dw09fz3w.js";
114
114
  import"./index-gprxjmm7.js";
115
115
  import"./index-n832052r.js";
116
116
  import {
117
117
  init_schema,
118
118
  stripKnownSwarmPrefix
119
- } from "./index-5q009kc4.js";
119
+ } from "./index-15526t16.js";
120
120
  import"./index-bk5tah7q.js";
121
121
  import"./index-8fwhhayc.js";
122
122
  import"./index-q1exe2b3.js";
123
- import"./index-z7jgvm9b.js";
124
- import"./index-smsy2p8n.js";
123
+ import"./index-5zyk8qgv.js";
124
+ import"./index-3eddtgxt.js";
125
125
  import"./index-556ja8an.js";
126
- import"./index-4fmztnrq.js";
126
+ import"./index-4xbyy6aw.js";
127
127
  import"./index-1kz6da87.js";
128
- import"./index-x20cgr2q.js";
128
+ import"./index-q7ezzgwq.js";
129
129
  import"./index-b8zgtz81.js";
130
- import"./index-y28n2wmq.js";
130
+ import"./index-a12906mj.js";
131
131
  import"./index-4rhhvd1a.js";
132
132
  import {
133
133
  AGENT_TOOL_MAP,
134
134
  ORCHESTRATOR_NAME,
135
135
  init_constants
136
136
  } from "./index-3jcyn8g6.js";
137
- import"./index-q344kj84.js";
138
- import"./index-4qzeef9h.js";
139
- import"./index-fsrp8wp3.js";
140
- import"./index-xybtaph7.js";
137
+ import"./index-prmb5qfp.js";
138
+ import"./index-x9q4bbhd.js";
139
+ import"./index-ed5ykebp.js";
140
+ import"./index-5j6chvj8.js";
141
141
  import"./index-7g4c7s5r.js";
142
- import"./index-10mz5js6.js";
142
+ import"./index-a5eba0t8.js";
143
143
  import"./index-bpmtbmy9.js";
144
144
  import"./index-z6xqpmqg.js";
145
145
  import"./index-zjygnfay.js";