opencode-swarm 7.181.2 → 7.181.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/cli/{coder-settlement-993vdsd2.js → coder-settlement-txte2m87.js} +10 -10
  4. package/dist/cli/{config-doctor-nr27vfv6.js → config-doctor-101n3c1r.js} +2 -2
  5. package/dist/cli/{core-t3tg4397.js → core-s0yzzpaj.js} +2 -2
  6. package/dist/cli/{curation-policy-m3x9mkj9.js → curation-policy-r4dkajw9.js} +4 -4
  7. package/dist/cli/{curator-gk392717.js → curator-dp49fr0p.js} +34 -34
  8. package/dist/cli/curator-drift-r7w3cg3m.js +37 -0
  9. package/dist/cli/{curator-llm-factory-n01we8pa.js → curator-llm-factory-tycc9xkw.js} +34 -34
  10. package/dist/cli/{evidence-summary-service-fkvj8ct1.js → evidence-summary-service-r648x5f2.js} +14 -14
  11. package/dist/cli/{gate-evidence-1n6zffzb.js → gate-evidence-8rh69tsh.js} +5 -5
  12. package/dist/cli/{guardrail-explain-81jvm99e.js → guardrail-explain-dfyj1g1c.js} +35 -35
  13. package/dist/cli/{guardrail-log-mw9x5j8g.js → guardrail-log-yr60w7h6.js} +6 -6
  14. package/dist/cli/{guardrail-reset-6thsn6ad.js → guardrail-reset-eztc62va.js} +34 -34
  15. package/dist/cli/{hive-promoter-pym6se37.js → hive-promoter-g56ba4a4.js} +34 -34
  16. package/dist/cli/{index-m65tnv4j.js → index-01r2wrwa.js} +1 -1
  17. package/dist/cli/{index-7nr9p5bd.js → index-1ks0rnzn.js} +5 -5
  18. package/dist/cli/{index-0h39trak.js → index-1w1xrk5k.js} +1 -1
  19. package/dist/cli/{index-12ewkms0.js → index-23mdeh2a.js} +1 -1
  20. package/dist/cli/{index-2sqfrvxj.js → index-2pt5g7zz.js} +2 -2
  21. package/dist/cli/{index-38cfx8g8.js → index-427x3j6p.js} +2 -2
  22. package/dist/cli/{index-m779twtf.js → index-4ffryqb1.js} +1 -1
  23. package/dist/cli/{index-dpxg347z.js → index-4jvt3r77.js} +3 -3
  24. package/dist/cli/{index-kzmd4gs7.js → index-6ep83w7x.js} +1 -1
  25. package/dist/cli/{index-5zy5k5w0.js → index-789tdsfv.js} +4 -4
  26. package/dist/cli/{index-qw9aqays.js → index-7s6ct0t2.js} +6 -6
  27. package/dist/cli/{index-1wpnt86a.js → index-8c37kzh6.js} +5 -5
  28. package/dist/cli/{index-gc6h1fmf.js → index-a2hvmc3a.js} +1 -1
  29. package/dist/cli/{index-ea9fk6v0.js → index-ap6hs8fj.js} +1 -1
  30. package/dist/cli/{index-92m05mew.js → index-by9wfeja.js} +1 -1
  31. package/dist/cli/{index-ehvkz2zv.js → index-ckrm4784.js} +7 -7
  32. package/dist/cli/{index-gmqf6bjj.js → index-dy9mxh0z.js} +36 -36
  33. package/dist/cli/{index-et28q7cp.js → index-ekwe81my.js} +1 -1
  34. package/dist/cli/{index-ernt0wrg.js → index-h6gxh3an.js} +4415 -1664
  35. package/dist/cli/{index-n5a9dq5s.js → index-hcaspktr.js} +1 -1
  36. package/dist/cli/{index-bdpgfep1.js → index-jrxrjz89.js} +1 -1
  37. package/dist/cli/{index-txx2mrsk.js → index-k5rqe97g.js} +25 -11
  38. package/dist/cli/{index-fmhd3zc8.js → index-kexzhwbq.js} +2 -2
  39. package/dist/cli/{index-516j9vsk.js → index-kkrbybgt.js} +27 -2
  40. package/dist/cli/{index-cr61qv27.js → index-m4e3p8na.js} +2 -2
  41. package/dist/cli/{index-5q3xsqwm.js → index-mdqp0cq2.js} +3 -3
  42. package/dist/cli/{index-6mwha20t.js → index-mkpdcbye.js} +3 -3
  43. package/dist/cli/{index-t93cp2tz.js → index-nw3z614g.js} +4 -4
  44. package/dist/cli/{index-et7tg13p.js → index-nw8pfcw1.js} +269 -9
  45. package/dist/cli/{index-6x36hhd3.js → index-qdz43cne.js} +34 -34
  46. package/dist/cli/{index-5hxv1er2.js → index-rchygh27.js} +56 -3
  47. package/dist/cli/{index-6gcxgx84.js → index-s34y6gbh.js} +1 -1
  48. package/dist/cli/{index-s0zgz4p1.js → index-sf51gh68.js} +1 -1
  49. package/dist/cli/{index-xz4q5vcg.js → index-sr9k8sh7.js} +3 -3
  50. package/dist/cli/{index-pqtmzee6.js → index-ttgex8ky.js} +4 -4
  51. package/dist/cli/{index-hbe56wtn.js → index-vgjmahnd.js} +2 -2
  52. package/dist/cli/{index-wph45kyb.js → index-xqr076aq.js} +4 -4
  53. package/dist/cli/{index-5v8zws0s.js → index-yv0q0hp9.js} +140 -9
  54. package/dist/cli/{index-vmwmwahh.js → index-yzapt508.js} +3 -3
  55. package/dist/cli/index.js +35 -35
  56. package/dist/cli/{knowledge-escalator-jmqbmfbf.js → knowledge-escalator-0rcft6q4.js} +11 -11
  57. package/dist/cli/{knowledge-events-5ksqpf4g.js → knowledge-events-7jyz3qxs.js} +9 -9
  58. package/dist/cli/{knowledge-link-s2qs178z.js → knowledge-link-655xa3db.js} +3 -3
  59. package/dist/cli/{knowledge-store-q3yy56sc.js → knowledge-store-asa26g6p.js} +4 -4
  60. package/dist/cli/{knowledge-validator-r5kaz53f.js → knowledge-validator-j3x9ezej.js} +6 -6
  61. package/dist/cli/{mcp-h82hxnxr.js → mcp-70hefjk6.js} +1 -1
  62. package/dist/cli/model-preflight-szekh1dc.js +359 -0
  63. package/dist/cli/{pending-delegations-e4h6vjeb.js → pending-delegations-rb6bhv5x.js} +7 -7
  64. package/dist/cli/{pr-subscriptions-j7hw3k6x.js → pr-subscriptions-v4ms5pfb.js} +7 -7
  65. package/dist/cli/{pr-workflow-gate-js8dcry2.js → pr-workflow-gate-qmfpz6wb.js} +34 -34
  66. package/dist/cli/{runner-tzgwvvn1.js → runner-b5vt1any.js} +4 -4
  67. package/dist/cli/{scan-cursor-yhf58mq2.js → scan-cursor-7zn4t1hw.js} +5 -5
  68. package/dist/cli/{schema-0k4st1qt.js → schema-tx62mfy8.js} +1 -1
  69. package/dist/cli/{scope-persistence-bpptmh1e.js → scope-persistence-f8w12sns.js} +10 -10
  70. package/dist/cli/{server-axnran6h.js → server-f2vrp2wc.js} +69 -599
  71. package/dist/cli/{skill-generator-n2w032d1.js → skill-generator-jme09w7n.js} +13 -13
  72. package/dist/cli/{snapshot-coordination-init-kyf50x12.js → snapshot-coordination-init-ad83sq6c.js} +34 -34
  73. package/dist/cli/{speckit-checkoff-m4184e1x.js → speckit-checkoff-98gfvn3r.js} +3 -3
  74. package/dist/cli/{telemetry-zhcgfe70.js → telemetry-6k8t2mrw.js} +1 -1
  75. package/dist/cli/{workspace-snapshot-4m2ex1ey.js → workspace-snapshot-hsssm50w.js} +2 -2
  76. package/dist/cli/{worktree-collision-ownership-1g2414pf.js → worktree-collision-ownership-47kdjtqb.js} +8 -8
  77. package/dist/cli/{worktree-isolation-x07f7cfp.js → worktree-isolation-etaawcnt.js} +34 -34
  78. package/dist/commands/registry.d.ts +1 -1
  79. package/dist/config/agent-model.d.ts +14 -0
  80. package/dist/config/bundled-skill-dispositions.d.ts +29 -0
  81. package/dist/index.js +273 -266
  82. package/dist/memory/index.d.ts +1 -0
  83. package/dist/memory/instruction-pairing.d.ts +112 -0
  84. package/dist/services/model-preflight.d.ts +103 -21
  85. package/package.json +1 -1
  86. package/dist/cli/curator-drift-hz3j3fad.js +0 -297
  87. package/dist/cli/model-preflight-5b81adsj.js +0 -170
@@ -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.181.2",
24
+ version: "7.181.3",
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",
@@ -192,7 +192,60 @@ var init_package = __esm(() => {
192
192
  });
193
193
 
194
194
  // src/config/context-window.ts
195
- var DEFAULT_MODEL_CONTEXT_TOKENS = 128000;
195
+ function normalizeLimitKey(key) {
196
+ return key.trim().toLowerCase();
197
+ }
198
+ function isUsableConfiguredWindow(value) {
199
+ return typeof value === "number" && Number.isFinite(value) && value >= 1;
200
+ }
201
+ function isUsableContextWindow(value) {
202
+ return typeof value === "number" && Number.isFinite(value) && value >= MIN_PLAUSIBLE_CONTEXT_TOKENS;
203
+ }
204
+ function resolveContextWindow(inputs) {
205
+ const { userLimits, modelID, providerID, liveContextLimit, fallbackLookup } = inputs;
206
+ if (userLimits) {
207
+ let normalized;
208
+ const normalizedLimits = () => {
209
+ if (normalized === undefined) {
210
+ normalized = {};
211
+ for (const [key, value] of Object.entries(userLimits)) {
212
+ normalized[normalizeLimitKey(key)] = value;
213
+ }
214
+ }
215
+ return normalized;
216
+ };
217
+ if (modelID && providerID) {
218
+ const compound = normalizedLimits()[normalizeLimitKey(`${providerID}/${modelID}`)];
219
+ if (isUsableConfiguredWindow(compound)) {
220
+ return { tokens: Math.floor(compound), source: "user_provider_model" };
221
+ }
222
+ }
223
+ if (modelID) {
224
+ const byModel = normalizedLimits()[normalizeLimitKey(modelID)];
225
+ if (isUsableConfiguredWindow(byModel)) {
226
+ return { tokens: Math.floor(byModel), source: "user_model" };
227
+ }
228
+ }
229
+ const byDefault = normalizedLimits().default;
230
+ if (isUsableConfiguredWindow(byDefault)) {
231
+ return { tokens: Math.floor(byDefault), source: "user_default" };
232
+ }
233
+ }
234
+ if (isUsableContextWindow(liveContextLimit)) {
235
+ return { tokens: Math.floor(liveContextLimit), source: "live_model_limit" };
236
+ }
237
+ if (fallbackLookup) {
238
+ const fromTable = fallbackLookup(modelID, providerID);
239
+ if (fromTable !== undefined && isUsableContextWindow(fromTable.tokens)) {
240
+ return {
241
+ tokens: Math.floor(fromTable.tokens),
242
+ source: fromTable.table === "provider_cap" ? "static_provider_cap" : "static_native"
243
+ };
244
+ }
245
+ }
246
+ return { tokens: DEFAULT_MODEL_CONTEXT_TOKENS, source: "static_default" };
247
+ }
248
+ var DEFAULT_MODEL_CONTEXT_TOKENS = 128000, MIN_PLAUSIBLE_CONTEXT_TOKENS = 1000;
196
249
  var init_context_window = () => {};
197
250
 
198
251
  // src/config/schema.ts
@@ -1978,4 +2031,4 @@ var init_schema = __esm(() => {
1978
2031
  });
1979
2032
  });
1980
2033
 
1981
- 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_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, 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, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, HarnessOptConfigSchema, DEFAULT_HARNESS_OPT_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, PrFeedbackLoopConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY, PluginConfigSchema, init_schema };
2034
+ export { init_package, package_default, DEFAULT_MODEL_CONTEXT_TOKENS, isUsableConfiguredWindow, isUsableContextWindow, resolveContextWindow, 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_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, 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, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, HarnessOptConfigSchema, DEFAULT_HARNESS_OPT_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, PrFeedbackLoopConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DashboardConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY, PluginConfigSchema, init_schema };
@@ -11,7 +11,7 @@ import {
11
11
  readLinkPointer,
12
12
  resolveKnowledgeStoreDir,
13
13
  resolveLinkDir
14
- } from "./index-12ewkms0.js";
14
+ } from "./index-23mdeh2a.js";
15
15
 
16
16
  // src/knowledge/curation-policy.ts
17
17
  import { readFile as readFile2 } from "fs/promises";
@@ -11,7 +11,7 @@ import {
11
11
  assertProjectRoot,
12
12
  atomicWriteFile,
13
13
  withEvidenceLock
14
- } from "./index-ea9fk6v0.js";
14
+ } from "./index-ap6hs8fj.js";
15
15
  import {
16
16
  exports_external,
17
17
  init_zod
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-hbe56wtn.js";
5
+ } from "./index-vgjmahnd.js";
6
6
  import {
7
7
  ApprovalEvidenceSchema,
8
8
  BaseEvidenceSchema,
@@ -46,7 +46,7 @@ import {
46
46
  loadPluginConfigWithMeta,
47
47
  loadPluginConfigWithMetaAsync,
48
48
  resetConfigAdvisoryDedup
49
- } from "./index-n5a9dq5s.js";
49
+ } from "./index-hcaspktr.js";
50
50
  import"./index-zxdawwc7.js";
51
51
  import {
52
52
  AUTO_REVIEW_V8_BURN_IN_DECISION,
@@ -72,7 +72,7 @@ import {
72
72
  TurboConfigSchema,
73
73
  WorktreeIsolationConfigSchema,
74
74
  resolveAutoReviewConfig
75
- } from "./index-5hxv1er2.js";
75
+ } from "./index-rchygh27.js";
76
76
  import {
77
77
  ALL_AGENT_NAMES,
78
78
  ALL_SUBAGENT_NAMES,
@@ -12,10 +12,10 @@ import {
12
12
  import {
13
13
  assertProjectRoot,
14
14
  withEvidenceLock
15
- } from "./index-ea9fk6v0.js";
15
+ } from "./index-ap6hs8fj.js";
16
16
  import {
17
17
  emit
18
- } from "./index-6mwha20t.js";
18
+ } from "./index-mkpdcbye.js";
19
19
  import {
20
20
  ExecutionProfileSchema,
21
21
  PlanSchema,
@@ -25,11 +25,11 @@ import {
25
25
  import {
26
26
  init_loader,
27
27
  loadPluginConfig
28
- } from "./index-n5a9dq5s.js";
28
+ } from "./index-hcaspktr.js";
29
29
  import {
30
30
  init_package,
31
31
  package_default
32
- } from "./index-5hxv1er2.js";
32
+ } from "./index-rchygh27.js";
33
33
  import {
34
34
  criticalWarn,
35
35
  init_logger,
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  init_loader,
4
4
  loadPluginConfigWithMeta
5
- } from "./index-n5a9dq5s.js";
5
+ } from "./index-hcaspktr.js";
6
6
  import {
7
7
  init_schema
8
- } from "./index-5hxv1er2.js";
8
+ } from "./index-rchygh27.js";
9
9
  import {
10
10
  DEFAULT_WORKTREE_ISOLATION_CONFIG,
11
11
  init_constants
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-6gcxgx84.js";
4
+ } from "./index-s34y6gbh.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,13 +9,13 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-qw9aqays.js";
12
+ } from "./index-7s6ct0t2.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
- } from "./index-12ewkms0.js";
15
+ } from "./index-23mdeh2a.js";
16
16
  import {
17
17
  atomicWriteFile
18
- } from "./index-ea9fk6v0.js";
18
+ } from "./index-ap6hs8fj.js";
19
19
  import {
20
20
  require_proper_lockfile
21
21
  } from "./index-7g4c7s5r.js";
@@ -1,23 +1,23 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-gc6h1fmf.js";
4
+ } from "./index-a2hvmc3a.js";
5
5
  import {
6
6
  observeReceiptTransition
7
- } from "./index-516j9vsk.js";
7
+ } from "./index-kkrbybgt.js";
8
8
  import {
9
9
  resolveHiveEventsPath
10
10
  } from "./index-ae75rja9.js";
11
11
  import {
12
12
  resolveKnowledgeStoreDir
13
- } from "./index-12ewkms0.js";
13
+ } from "./index-23mdeh2a.js";
14
14
  import {
15
15
  assertProjectRoot,
16
16
  atomicWriteFile
17
- } from "./index-ea9fk6v0.js";
17
+ } from "./index-ap6hs8fj.js";
18
18
  import {
19
19
  emit
20
- } from "./index-6mwha20t.js";
20
+ } from "./index-mkpdcbye.js";
21
21
  import {
22
22
  canonicalRootKey
23
23
  } from "./index-1xnse449.js";
@@ -26,11 +26,11 @@ import {
26
26
  } from "./index-7g4c7s5r.js";
27
27
  import {
28
28
  loadPluginConfigWithMeta
29
- } from "./index-n5a9dq5s.js";
29
+ } from "./index-hcaspktr.js";
30
30
  import {
31
31
  KnowledgeConfigSchema,
32
32
  init_schema
33
- } from "./index-5hxv1er2.js";
33
+ } from "./index-rchygh27.js";
34
34
  import {
35
35
  init_logger,
36
36
  warn
@@ -878,6 +878,13 @@ function legacyExposureKind(event) {
878
878
  return "manual_recall";
879
879
  return "legacy_unknown";
880
880
  }
881
+ function normalizeExposureKind(value) {
882
+ if (isReceiptExposureKind(value))
883
+ return value;
884
+ if (value === "delegate")
885
+ return "delegate_directive";
886
+ return "legacy_unknown";
887
+ }
881
888
  function parseEmptyTrace(value, requireSummaryKind = false) {
882
889
  if (!isPlainRecord(value))
883
890
  return null;
@@ -1782,6 +1789,130 @@ async function runLocked(directory, graceDays, action, options = {}) {
1782
1789
  return unavailable(error);
1783
1790
  }
1784
1791
  }
1792
+ async function clearRepairUncertaintyIfFresh(paths, state, input, clearedBy) {
1793
+ if (!input.phase)
1794
+ return;
1795
+ const key = repairUncertaintyKey(input.phase, input.session_id);
1796
+ const active = state.repairUncertainties.get(key);
1797
+ if (!active)
1798
+ return;
1799
+ const proof = input.repair_re_evaluation;
1800
+ if (!proof?.scope_complete || proof.repair_id !== active.repair_id || active.task_id !== undefined && input.task_id !== active.task_id) {
1801
+ return;
1802
+ }
1803
+ await appendRecord(paths, state, makeRecord(state, "repair_uncertainty_cleared", {
1804
+ phase: input.phase,
1805
+ session_id: input.session_id,
1806
+ task_id: input.task_id,
1807
+ repair_id: active.repair_id,
1808
+ cleared_by_event_id: clearedBy.event_id,
1809
+ cleared_by_trace_id: clearedBy.trace_id,
1810
+ cleared_by_kind: clearedBy.kind
1811
+ }));
1812
+ }
1813
+ async function commitDisplayedMembership(directory, input) {
1814
+ return runLocked(directory, input.grace_days, async (paths, state, graceDays) => {
1815
+ if (!input.trace_id || !input.session_id || input.entries.length === 0)
1816
+ throw new ReceiptStoreError("store_unavailable", "invalid displayed membership");
1817
+ const eventId = randomUUID2();
1818
+ const committedAt = nowIso();
1819
+ const exposureKind = normalizeExposureKind(input.exposure_kind);
1820
+ const memberships = [];
1821
+ const newMemberships = [];
1822
+ for (const entry of input.entries) {
1823
+ const existing = state.memberships.get(keyOf(input.trace_id, entry.entry_id));
1824
+ if (existing) {
1825
+ if (existing.session_id !== input.session_id || existing.phase !== input.phase || existing.task_id !== input.task_id || existing.critical !== entry.critical || existing.cohort_id !== input.cohort_id || existing.source_link_id !== input.source_link_id || existing.exposure_kind !== exposureKind) {
1826
+ throw new ReceiptStoreError("store_unavailable", `conflicting immutable membership for ${input.trace_id}/${entry.entry_id}`);
1827
+ }
1828
+ memberships.push({
1829
+ ...existing,
1830
+ terminal: existing.terminal ? { ...existing.terminal } : undefined
1831
+ });
1832
+ continue;
1833
+ }
1834
+ const closedLifecycle = state.phaseLifecycle.get(phaseLifecycleKey(input.phase ?? "", input.session_id, input.task_id)) ?? (input.task_id !== undefined ? state.phaseLifecycle.get(phaseLifecycleKey(input.phase ?? "", input.session_id)) : undefined);
1835
+ if (input.phase && closedLifecycle?.closed_event_id) {
1836
+ throw new ReceiptStoreError("store_unavailable", `cannot add receipt membership to closed lifecycle ${input.session_id}/${input.phase}`);
1837
+ }
1838
+ const membership = {
1839
+ trace_id: input.trace_id,
1840
+ entry_id: entry.entry_id,
1841
+ session_id: input.session_id,
1842
+ phase: input.phase,
1843
+ task_id: input.task_id,
1844
+ agent: input.agent,
1845
+ critical: entry.critical,
1846
+ rank: entry.rank,
1847
+ score: entry.score,
1848
+ committed_at: committedAt,
1849
+ membership_event_id: eventId,
1850
+ grace_days: graceDays,
1851
+ cohort_id: input.cohort_id,
1852
+ source_link_id: input.source_link_id,
1853
+ exposure_kind: exposureKind,
1854
+ origin: "v2"
1855
+ };
1856
+ memberships.push(membership);
1857
+ newMemberships.push(membership);
1858
+ }
1859
+ if (newMemberships.length) {
1860
+ await appendRecord(paths, state, makeRecord(state, "membership_committed", { memberships: newMemberships }, eventId));
1861
+ await clearRepairUncertaintyIfFresh(paths, state, input, {
1862
+ event_id: eventId,
1863
+ trace_id: input.trace_id,
1864
+ kind: "membership_committed"
1865
+ });
1866
+ }
1867
+ return {
1868
+ event_id: newMemberships.length ? eventId : memberships[0].membership_event_id,
1869
+ memberships
1870
+ };
1871
+ });
1872
+ }
1873
+ async function commitEmptyRetrieval(directory, input) {
1874
+ return runLocked(directory, input.grace_days, async (paths, state, graceDays) => {
1875
+ const existing = state.emptyTraces.get(emptyKeyOf(input.trace_id, input.session_id));
1876
+ if (existing) {
1877
+ if (existing.phase !== input.phase || existing.task_id !== input.task_id || existing.grace_days !== graceDays) {
1878
+ throw new ReceiptStoreError("store_unavailable", `conflicting immutable empty retrieval for ${input.trace_id}/${input.session_id}`);
1879
+ }
1880
+ if (!existing.terminal_event_id) {
1881
+ const terminal = makeRecord(state, "terminal_committed", {
1882
+ empty_trace_id: input.trace_id,
1883
+ empty_trace_session_id: input.session_id
1884
+ });
1885
+ await appendRecord(paths, state, terminal);
1886
+ }
1887
+ return {
1888
+ event_id: existing.empty_event_id,
1889
+ terminal_event_id: existing.terminal_event_id
1890
+ };
1891
+ }
1892
+ const eventId = randomUUID2();
1893
+ const terminalEventId = randomUUID2();
1894
+ const trace = {
1895
+ trace_id: input.trace_id,
1896
+ session_id: input.session_id,
1897
+ phase: input.phase,
1898
+ task_id: input.task_id,
1899
+ committed_at: nowIso(),
1900
+ empty_event_id: eventId,
1901
+ grace_days: graceDays
1902
+ };
1903
+ await appendRecord(paths, state, makeRecord(state, "empty_retrieval_committed", { trace }, eventId));
1904
+ await appendRecord(paths, state, makeRecord(state, "terminal_committed", {
1905
+ empty_trace_id: input.trace_id,
1906
+ empty_trace_session_id: input.session_id
1907
+ }, terminalEventId));
1908
+ await clearRepairUncertaintyIfFresh(paths, state, input, {
1909
+ event_id: eventId,
1910
+ trace_id: input.trace_id,
1911
+ kind: "empty_retrieval_committed"
1912
+ });
1913
+ return { event_id: eventId, terminal_event_id: terminalEventId };
1914
+ });
1915
+ }
1785
1916
  async function commitApplicationMarkerBatch(directory, input) {
1786
1917
  return runLocked(directory, undefined, async (paths, state) => {
1787
1918
  const items = input.items ?? input.markers ?? [];
@@ -2813,7 +2944,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
2813
2944
  }
2814
2945
  let bumps = 0;
2815
2946
  if (deltas.length > 0) {
2816
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-q3yy56sc.js");
2947
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-asa26g6p.js");
2817
2948
  bumps = await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
2818
2949
  }
2819
2950
  return {
@@ -2850,4 +2981,4 @@ var _internals4 = {
2850
2981
  mergeRollupInto
2851
2982
  };
2852
2983
 
2853
- export { commitGateReleaseBatch, queryLiveMemberships, queryHistoricalOutcomes, recordPhaseCloseIntent, reconcilePhaseClose, KNOWLEDGE_EVENT_SCHEMA_VERSION, MAX_EVENT_LOG_ENTRIES, RECEIPT_EVENT_TYPES, resolveKnowledgeEventsPath, resolveKnowledgeCounterBaselinePath, resolveHiveEventsPath2 as resolveHiveEventsPath, resolveLegacyApplicationLogPath, newTraceId, newEventId, appendKnowledgeEvent, appendKnowledgeEventsBatch, recordKnowledgeEvent, recordKnowledgeEventsBatch, appendHiveKnowledgeEvent, recordHiveKnowledgeEvent, readKnowledgeEvents, readHiveKnowledgeEvents, readLegacyApplicationRecords, MAX_VIOLATION_TIMESTAMPS, recomputeCounters, countViolationsInWindow, countEmptyTraceTerminals, countEntryViolationsInWindow, countEntryContradictionsInWindow, readKnowledgeCounterRollups, readAuthoritativeKnowledgeCounterRollups, effectiveRetrievalOutcomes, applyKnowledgeVerdictFeedback, _internals4 as _internals };
2984
+ export { commitDisplayedMembership, commitEmptyRetrieval, commitGateReleaseBatch, queryLiveMemberships, queryHistoricalOutcomes, recordPhaseCloseIntent, reconcilePhaseClose, KNOWLEDGE_EVENT_SCHEMA_VERSION, MAX_EVENT_LOG_ENTRIES, RECEIPT_EVENT_TYPES, resolveKnowledgeEventsPath, resolveKnowledgeCounterBaselinePath, resolveHiveEventsPath2 as resolveHiveEventsPath, resolveLegacyApplicationLogPath, newTraceId, newEventId, appendKnowledgeEvent, appendKnowledgeEventsBatch, recordKnowledgeEvent, recordKnowledgeEventsBatch, appendHiveKnowledgeEvent, recordHiveKnowledgeEvent, readKnowledgeEvents, readHiveKnowledgeEvents, readLegacyApplicationRecords, MAX_VIOLATION_TIMESTAMPS, recomputeCounters, countViolationsInWindow, countEmptyTraceTerminals, countEntryViolationsInWindow, countEntryContradictionsInWindow, readKnowledgeCounterRollups, readAuthoritativeKnowledgeCounterRollups, effectiveRetrievalOutcomes, applyKnowledgeVerdictFeedback, _internals4 as _internals };
@@ -5,18 +5,18 @@ import {
5
5
  import {
6
6
  effectiveRetrievalOutcomes,
7
7
  readAuthoritativeKnowledgeCounterRollups
8
- } from "./index-5v8zws0s.js";
8
+ } from "./index-yv0q0hp9.js";
9
9
  import {
10
10
  ALLOWED_SKILL_PATH_PREFIXES,
11
11
  validateSkillPath
12
- } from "./index-wph45kyb.js";
12
+ } from "./index-xqr076aq.js";
13
13
  import {
14
14
  computeOutcomeSignal,
15
15
  readKnowledge,
16
16
  resolveHiveKnowledgePath,
17
17
  resolveSwarmKnowledgePath,
18
18
  transactKnowledge
19
- } from "./index-qw9aqays.js";
19
+ } from "./index-7s6ct0t2.js";
20
20
  import {
21
21
  appendCappedJsonl,
22
22
  resolveRetentionCap
package/dist/cli/index.js CHANGED
@@ -14,69 +14,69 @@ import {
14
14
  readCachePackageVersion,
15
15
  resolveCommand,
16
16
  safeRealpathSync
17
- } from "./index-ernt0wrg.js";
18
- import"./index-5q3xsqwm.js";
17
+ } from "./index-h6gxh3an.js";
18
+ import"./index-mdqp0cq2.js";
19
19
  import"./index-hamqvzqn.js";
20
- import"./index-m65tnv4j.js";
21
- import"./index-et7tg13p.js";
22
- import"./index-et28q7cp.js";
23
- import"./index-txx2mrsk.js";
24
- import"./index-s0zgz4p1.js";
20
+ import"./index-01r2wrwa.js";
21
+ import"./index-nw8pfcw1.js";
22
+ import"./index-ekwe81my.js";
23
+ import"./index-k5rqe97g.js";
24
+ import"./index-sf51gh68.js";
25
25
  import"./index-txdagbh7.js";
26
- import"./index-m779twtf.js";
26
+ import"./index-4ffryqb1.js";
27
27
  import"./index-6b295cas.js";
28
- import"./index-vmwmwahh.js";
29
- import"./index-7nr9p5bd.js";
30
- import"./index-cr61qv27.js";
28
+ import"./index-yzapt508.js";
29
+ import"./index-1ks0rnzn.js";
30
+ import"./index-m4e3p8na.js";
31
31
  import"./index-rdec0y3z.js";
32
- import"./index-t93cp2tz.js";
32
+ import"./index-nw3z614g.js";
33
33
  import"./index-cjapb4hy.js";
34
34
  import"./index-zsrtt42s.js";
35
- import"./index-ehvkz2zv.js";
36
- import"./index-bdpgfep1.js";
37
- import"./index-92m05mew.js";
35
+ import"./index-ckrm4784.js";
36
+ import"./index-jrxrjz89.js";
37
+ import"./index-by9wfeja.js";
38
38
  import"./index-pt7h91zc.js";
39
39
  import"./index-q7sjgr1y.js";
40
- import"./index-kzmd4gs7.js";
41
- import"./index-5zy5k5w0.js";
42
- import"./index-2sqfrvxj.js";
43
- import"./index-1wpnt86a.js";
44
- import"./index-5v8zws0s.js";
45
- import"./index-gc6h1fmf.js";
40
+ import"./index-6ep83w7x.js";
41
+ import"./index-789tdsfv.js";
42
+ import"./index-2pt5g7zz.js";
43
+ import"./index-8c37kzh6.js";
44
+ import"./index-yv0q0hp9.js";
45
+ import"./index-a2hvmc3a.js";
46
46
  import"./index-2s7dvzff.js";
47
- import"./index-wph45kyb.js";
48
- import"./index-6gcxgx84.js";
47
+ import"./index-xqr076aq.js";
48
+ import"./index-s34y6gbh.js";
49
49
  import"./index-rtry5xyf.js";
50
- import"./index-hbe56wtn.js";
50
+ import"./index-vgjmahnd.js";
51
51
  import"./index-frcemc0b.js";
52
52
  import"./index-0725jpp7.js";
53
- import"./index-dpxg347z.js";
54
- import"./index-pqtmzee6.js";
55
- import"./index-38cfx8g8.js";
53
+ import"./index-4jvt3r77.js";
54
+ import"./index-ttgex8ky.js";
55
+ import"./index-427x3j6p.js";
56
56
  import"./index-ved1325w.js";
57
57
  import"./index-w1ydvzef.js";
58
58
  import"./index-vvgpgcyn.js";
59
59
  import"./index-rdm3px0g.js";
60
60
  import"./index-ry16d01s.js";
61
- import"./index-516j9vsk.js";
62
- import"./index-qw9aqays.js";
61
+ import"./index-kkrbybgt.js";
62
+ import"./index-7s6ct0t2.js";
63
63
  import"./index-vzm6zre7.js";
64
64
  import"./index-ae75rja9.js";
65
- import"./index-12ewkms0.js";
66
- import"./index-ea9fk6v0.js";
67
- import"./index-6mwha20t.js";
65
+ import"./index-23mdeh2a.js";
66
+ import"./index-ap6hs8fj.js";
67
+ import"./index-mkpdcbye.js";
68
68
  import"./index-1xnse449.js";
69
69
  import"./index-c1ggtmpm.js";
70
70
  import"./index-ejhxgyvm.js";
71
71
  import"./index-7g4c7s5r.js";
72
72
  import"./index-989v83pb.js";
73
73
  import"./index-gx2vp8gx.js";
74
- import"./index-n5a9dq5s.js";
74
+ import"./index-hcaspktr.js";
75
75
  import"./index-zxdawwc7.js";
76
76
  import {
77
77
  init_package,
78
78
  package_default
79
- } from "./index-5hxv1er2.js";
79
+ } from "./index-rchygh27.js";
80
80
  import {
81
81
  DEFAULT_AGENT_CONFIGS,
82
82
  init_constants
@@ -644,7 +644,7 @@ async function main() {
644
644
  const exitCode = await run(["ci", ...args.slice(1)]);
645
645
  process.exit(exitCode);
646
646
  } else if (command === "mcp") {
647
- const { handleMcpCommand } = await import("./mcp-h82hxnxr.js");
647
+ const { handleMcpCommand } = await import("./mcp-70hefjk6.js");
648
648
  const exitCode = await handleMcpCommand(args.slice(1));
649
649
  process.exit(exitCode);
650
650
  } else {
@@ -9,29 +9,29 @@ import {
9
9
  maybeEscalateOnViolation,
10
10
  maybeQuarantineOnContradiction,
11
11
  readRecentEscalations
12
- } from "./index-7nr9p5bd.js";
13
- import"./index-5v8zws0s.js";
14
- import"./index-gc6h1fmf.js";
12
+ } from "./index-1ks0rnzn.js";
13
+ import"./index-yv0q0hp9.js";
14
+ import"./index-a2hvmc3a.js";
15
15
  import"./index-2s7dvzff.js";
16
- import"./index-hbe56wtn.js";
16
+ import"./index-vgjmahnd.js";
17
17
  import"./index-frcemc0b.js";
18
18
  import"./index-0725jpp7.js";
19
- import"./index-516j9vsk.js";
20
- import"./index-qw9aqays.js";
19
+ import"./index-kkrbybgt.js";
20
+ import"./index-7s6ct0t2.js";
21
21
  import"./index-vzm6zre7.js";
22
22
  import"./index-ae75rja9.js";
23
- import"./index-12ewkms0.js";
24
- import"./index-ea9fk6v0.js";
25
- import"./index-6mwha20t.js";
23
+ import"./index-23mdeh2a.js";
24
+ import"./index-ap6hs8fj.js";
25
+ import"./index-mkpdcbye.js";
26
26
  import"./index-1xnse449.js";
27
27
  import"./index-c1ggtmpm.js";
28
28
  import"./index-ejhxgyvm.js";
29
29
  import"./index-7g4c7s5r.js";
30
30
  import"./index-989v83pb.js";
31
31
  import"./index-gx2vp8gx.js";
32
- import"./index-n5a9dq5s.js";
32
+ import"./index-hcaspktr.js";
33
33
  import"./index-zxdawwc7.js";
34
- import"./index-5hxv1er2.js";
34
+ import"./index-rchygh27.js";
35
35
  import"./index-2t21pv2v.js";
36
36
  import"./index-bk5tah7q.js";
37
37
  import"./index-gknz3bv1.js";
@@ -29,26 +29,26 @@ import {
29
29
  resolveKnowledgeCounterBaselinePath,
30
30
  resolveKnowledgeEventsPath,
31
31
  resolveLegacyApplicationLogPath
32
- } from "./index-5v8zws0s.js";
33
- import"./index-gc6h1fmf.js";
32
+ } from "./index-yv0q0hp9.js";
33
+ import"./index-a2hvmc3a.js";
34
34
  import"./index-2s7dvzff.js";
35
- import"./index-hbe56wtn.js";
35
+ import"./index-vgjmahnd.js";
36
36
  import"./index-frcemc0b.js";
37
37
  import"./index-0725jpp7.js";
38
- import"./index-516j9vsk.js";
38
+ import"./index-kkrbybgt.js";
39
39
  import"./index-ae75rja9.js";
40
- import"./index-12ewkms0.js";
41
- import"./index-ea9fk6v0.js";
42
- import"./index-6mwha20t.js";
40
+ import"./index-23mdeh2a.js";
41
+ import"./index-ap6hs8fj.js";
42
+ import"./index-mkpdcbye.js";
43
43
  import"./index-1xnse449.js";
44
44
  import"./index-c1ggtmpm.js";
45
45
  import"./index-ejhxgyvm.js";
46
46
  import"./index-7g4c7s5r.js";
47
47
  import"./index-989v83pb.js";
48
48
  import"./index-gx2vp8gx.js";
49
- import"./index-n5a9dq5s.js";
49
+ import"./index-hcaspktr.js";
50
50
  import"./index-zxdawwc7.js";
51
- import"./index-5hxv1er2.js";
51
+ import"./index-rchygh27.js";
52
52
  import"./index-2t21pv2v.js";
53
53
  import"./index-bk5tah7q.js";
54
54
  import"./index-gknz3bv1.js";
@@ -12,9 +12,9 @@ import {
12
12
  resolveLinkDir,
13
13
  sanitizeLinkId,
14
14
  writeLinkPointer
15
- } from "./index-12ewkms0.js";
16
- import"./index-ea9fk6v0.js";
17
- import"./index-6mwha20t.js";
15
+ } from "./index-23mdeh2a.js";
16
+ import"./index-ap6hs8fj.js";
17
+ import"./index-mkpdcbye.js";
18
18
  import"./index-1xnse449.js";
19
19
  import"./index-c1ggtmpm.js";
20
20
  import"./index-ejhxgyvm.js";
@@ -43,14 +43,14 @@ import {
43
43
  transactKnowledge,
44
44
  transactKnowledgeWithCas,
45
45
  wordBigrams
46
- } from "./index-qw9aqays.js";
46
+ } from "./index-7s6ct0t2.js";
47
47
  import"./index-vzm6zre7.js";
48
48
  import {
49
49
  resolveHiveDataDir
50
50
  } from "./index-ae75rja9.js";
51
- import"./index-12ewkms0.js";
52
- import"./index-ea9fk6v0.js";
53
- import"./index-6mwha20t.js";
51
+ import"./index-23mdeh2a.js";
52
+ import"./index-ap6hs8fj.js";
53
+ import"./index-mkpdcbye.js";
54
54
  import"./index-1xnse449.js";
55
55
  import"./index-c1ggtmpm.js";
56
56
  import"./index-ejhxgyvm.js";