opencode-swarm 7.97.0 → 7.98.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 (29) hide show
  1. package/README.md +7 -1
  2. package/dist/agents/architect.d.ts +1 -1
  3. package/dist/cli/{config-doctor-h1xrvq83.js → config-doctor-7yrxfa6b.js} +2 -2
  4. package/dist/cli/{guardrail-explain-t6svvtmn.js → guardrail-explain-xdv74tfk.js} +5 -5
  5. package/dist/cli/{guardrail-log-9yyeccv5.js → guardrail-log-53z1cf46.js} +3 -3
  6. package/dist/cli/{index-tqbb2jx6.js → index-471qxz9g.js} +33 -9
  7. package/dist/cli/{index-b223mczb.js → index-5z2e78tv.js} +1 -1
  8. package/dist/cli/{index-rdc6nvmw.js → index-gnd1280x.js} +1 -1
  9. package/dist/cli/{index-byb9tgay.js → index-h6h8qfsh.js} +6 -6
  10. package/dist/cli/{index-sgdr2e4n.js → index-pc10e4d7.js} +9 -9
  11. package/dist/cli/{index-a9ghr5cx.js → index-wmm21nsk.js} +2 -2
  12. package/dist/cli/{index-xx3sv77e.js → index-zy22fg5h.js} +1 -1
  13. package/dist/cli/index.js +4 -4
  14. package/dist/cli/{schema-a8fneygm.js → schema-mygkbbe9.js} +5 -1
  15. package/dist/config/constants.d.ts +4 -0
  16. package/dist/config/schema.d.ts +11 -0
  17. package/dist/evidence/normalize-verdict.d.ts +67 -0
  18. package/dist/hooks/knowledge-injector.d.ts +1 -1
  19. package/dist/index.js +575 -284
  20. package/dist/services/injection-budget.d.ts +98 -0
  21. package/dist/summaries/summarizer.d.ts +36 -0
  22. package/dist/tools/context-status.d.ts +102 -0
  23. package/dist/tools/index.d.ts +1 -0
  24. package/dist/tools/manifest.d.ts +1 -0
  25. package/dist/tools/tool-metadata.d.ts +11 -7
  26. package/dist/tools/write-drift-evidence.d.ts +11 -0
  27. package/dist/tools/write-hallucination-evidence.d.ts +11 -0
  28. package/dist/tools/write-mutation-evidence.d.ts +11 -0
  29. package/package.json +1 -1
package/README.md CHANGED
@@ -561,6 +561,8 @@ The Context Budget Guard monitors how much context Swarm is injecting into the c
561
561
 
562
562
  To disable entirely, set `context_budget.enabled: false` in your swarm config.
563
563
 
564
+ **On-demand status check:** architects can invoke the `context_status` tool at any time to read current context-window headroom (tokens used, model limit, usage percent, threshold state, model ID, provider) without triggering advisory warnings or mutating state. Works even when `context_budget.enabled` is false.
565
+
564
566
  ---
565
567
 
566
568
  ### Skill Propagation
@@ -614,7 +616,9 @@ Routing skills are merged with scored recommendations, with explicitly routed sk
614
616
 
615
617
  ### Skill Lifecycle Management
616
618
 
617
- Swarm provides tools for managing generated skill lifecycles:
619
+ Seven skill-management tools (`skill_generate`, `skill_list`, `skill_apply`, `skill_inspect`, `skill_regenerate`, `skill_retire`, `skill_improve`) are **opt-in** via the `skills.enabled` config flag (default `false`). With the flag off, the architect does not see them; with the flag on, they reappear. Tools remain exported and registered — only the merged architect tool map is gated.
620
+
621
+ Swarm provides tools for managing generated skill lifecycles:
618
622
 
619
623
  - **`skill_retire`** — Retires an active generated skill by creating a `retired.marker` file in its directory. Retired skills are excluded from discovery, scoring, and injection. The SKILL.md file is preserved for auditability. Use `skill_retire(slug, reason?)` to retire a skill, or pass a reason for tracking purposes.
620
624
 
@@ -699,7 +703,9 @@ Every candidate passes a 3-gate pipeline before entering quarantine:
699
703
  | `context_budget.tracked_agents` | string[] | `['architect']` | Agents to track for context budget warnings |
700
704
  | `context_budget.enforce_on_agent_switch` | boolean | `true` | Enforce budget limits when switching agents |
701
705
  | `context_budget.model_limits` | record | `{ default: 128000 }` | Per-model token limits (model name -> max tokens) |
706
+ | `context_budget.unified_injection_tokens` | number | `undefined` | Opt-in unified ceiling (tokens) for combined system-enhancer + knowledge-injector injection per turn. When set, both hooks share this budget with proportional split |
702
707
  | `context_budget.tool_output_mask_threshold` | number | `2000` | Threshold for masking tool outputs (chars) |
708
+ | `skills.enabled` | boolean | `false` | Gates the 7 skill-management tools (`skill_generate`, `skill_list`, `skill_apply`, `skill_inspect`, `skill_regenerate`, `skill_retire`, `skill_improve`) behind an opt-in flag. When `false` (default), these tools are hidden from the architect's tool map. |
703
709
  | `context_budget.scoring.enabled` | boolean | `false` | Enable context scoring/ranking |
704
710
  | `context_budget.scoring.max_candidates` | number | `100` | Maximum items to score (10-500) |
705
711
  | `context_budget.scoring.weights` | object | `{ recency: 0.3, ... }` | Scoring weights for priority |
@@ -71,4 +71,4 @@ export declare function buildCouncilWorkflow(council?: CouncilWorkflowConfig): s
71
71
  * BRAINSTORM, and PLAN inline paths stay in lockstep.
72
72
  */
73
73
  export declare function buildQaGateSelectionDialogue(modeLabel: 'BRAINSTORM' | 'SPECIFY' | 'PLAN'): string;
74
- export declare function createArchitectAgent(model: string, customPrompt?: string, customAppendPrompt?: string, adversarialTesting?: AdversarialTestingConfig, council?: CouncilWorkflowConfig, uiReview?: UIReviewConfig, memoryEnabled?: boolean, architecturalSupervision?: ArchitectureSupervisionWorkflowConfig, designDocsEnabled?: boolean, externalSkillsEnabled?: boolean, turboEnabled?: boolean): AgentDefinition;
74
+ export declare function createArchitectAgent(model: string, customPrompt?: string, customAppendPrompt?: string, adversarialTesting?: AdversarialTestingConfig, council?: CouncilWorkflowConfig, uiReview?: UIReviewConfig, memoryEnabled?: boolean, architecturalSupervision?: ArchitectureSupervisionWorkflowConfig, designDocsEnabled?: boolean, externalSkillsEnabled?: boolean, turboEnabled?: boolean, skillsEnabled?: boolean): AgentDefinition;
@@ -12,8 +12,8 @@ import {
12
12
  shouldRunOnStartup,
13
13
  writeBackupArtifact,
14
14
  writeDoctorArtifact
15
- } from "./index-xx3sv77e.js";
16
- import"./index-tqbb2jx6.js";
15
+ } from "./index-zy22fg5h.js";
16
+ import"./index-471qxz9g.js";
17
17
  import"./index-5e4e2hvv.js";
18
18
  import"./index-p0arc26j.js";
19
19
  import"./index-zgwm4ryv.js";
@@ -1,14 +1,14 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-a9ghr5cx.js";
5
- import"./index-sgdr2e4n.js";
6
- import"./index-b223mczb.js";
4
+ } from "./index-wmm21nsk.js";
5
+ import"./index-pc10e4d7.js";
6
+ import"./index-5z2e78tv.js";
7
7
  import"./index-2a6ppa65.js";
8
8
  import"./index-fjxjb66n.js";
9
9
  import"./index-hb10a2g8.js";
10
- import"./index-xx3sv77e.js";
11
- import"./index-tqbb2jx6.js";
10
+ import"./index-zy22fg5h.js";
11
+ import"./index-471qxz9g.js";
12
12
  import"./index-4c5jpmn9.js";
13
13
  import"./index-adz3nk9b.js";
14
14
  import"./index-v4fcn4tr.js";
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailLog
4
- } from "./index-rdc6nvmw.js";
5
- import"./index-b223mczb.js";
6
- import"./index-tqbb2jx6.js";
4
+ } from "./index-gnd1280x.js";
5
+ import"./index-5z2e78tv.js";
6
+ import"./index-471qxz9g.js";
7
7
  import"./index-5e4e2hvv.js";
8
8
  import"./index-p0arc26j.js";
9
9
  import"./index-zgwm4ryv.js";
@@ -365,6 +365,10 @@ var TOOL_METADATA = {
365
365
  description: "detect hidden couplings by analyzing git history",
366
366
  agents: ["architect"]
367
367
  },
368
+ context_status: {
369
+ description: "report current context-window headroom for the active session \u2014 returns tokens-used, model-limit, usage-percent, threshold-state (none/warn/critical), model name, and provider. Pure read-only: no state mutation, no warning injection. Works whether context_budget.enabled is true or false.",
370
+ agents: ["architect"]
371
+ },
368
372
  search: {
369
373
  description: "Workspace-scoped ripgrep-style text search with structured JSON output. Supports literal and regex modes, glob filtering, and result limits. NOTE: This is text search, not structural AST search \u2014 use symbols and imports tools for structural queries.",
370
374
  agents: [
@@ -481,19 +485,19 @@ var TOOL_METADATA = {
481
485
  },
482
486
  skill_generate: {
483
487
  description: "compile knowledge entries into a structured SKILL.md draft",
484
- agents: ["architect", "skill_improver"]
488
+ agents: ["skill_improver"]
485
489
  },
486
490
  skill_list: {
487
491
  description: "list generated skill files and their status",
488
- agents: ["architect", "skill_improver"]
492
+ agents: ["skill_improver"]
489
493
  },
490
494
  skill_apply: {
491
495
  description: "activate a draft skill proposal",
492
- agents: ["architect"]
496
+ agents: []
493
497
  },
494
498
  skill_inspect: {
495
499
  description: "inspect the content and source entries of a skill file",
496
- agents: ["architect", "skill_improver"]
500
+ agents: ["skill_improver"]
497
501
  },
498
502
  run_stale_reconciliation: {
499
503
  description: "reconcile skills against the knowledge store: mark skills stale when source knowledge is archived or deleted, or clear stale markers",
@@ -501,15 +505,15 @@ var TOOL_METADATA = {
501
505
  },
502
506
  skill_regenerate: {
503
507
  description: "regenerate an active skill by re-clustering its source knowledge entries and updating the SKILL.md in place",
504
- agents: ["architect"]
508
+ agents: []
505
509
  },
506
510
  skill_retire: {
507
511
  description: "retire a generated skill by adding a retired.marker file; retired skills are excluded from scoring and injection",
508
- agents: ["architect"]
512
+ agents: []
509
513
  },
510
514
  skill_improve: {
511
515
  description: "run the skill_improver agent to review and refine skills",
512
- agents: ["architect", "skill_improver"]
516
+ agents: ["skill_improver"]
513
517
  },
514
518
  spec_write: {
515
519
  description: "author or update .swarm/spec.md for the current project",
@@ -851,6 +855,18 @@ var TURBO_TOOL_NAMES = [
851
855
  var TURBO_AGENT_TOOL_MAP = {
852
856
  architect: [...TURBO_TOOL_NAMES]
853
857
  };
858
+ var SKILL_TOOL_NAMES = [
859
+ "skill_generate",
860
+ "skill_list",
861
+ "skill_apply",
862
+ "skill_inspect",
863
+ "skill_regenerate",
864
+ "skill_retire",
865
+ "skill_improve"
866
+ ];
867
+ var SKILL_AGENT_TOOL_MAP = {
868
+ architect: [...SKILL_TOOL_NAMES]
869
+ };
854
870
  var DEFAULT_AGENT_CONFIGS = {
855
871
  coder: {
856
872
  model: "opencode/minimax-m2.5-free",
@@ -1049,6 +1065,7 @@ var ContextBudgetConfigSchema = exports_external.object({
1049
1065
  critical_threshold: exports_external.number().min(0).max(1).default(0.9),
1050
1066
  model_limits: exports_external.record(exports_external.string(), exports_external.number().min(1000)).default({ default: 128000 }),
1051
1067
  max_injection_tokens: exports_external.number().min(100).max(50000).default(4000),
1068
+ unified_injection_tokens: exports_external.number().min(100).max(50000).optional(),
1052
1069
  tracked_agents: exports_external.array(exports_external.string()).default(["architect"]),
1053
1070
  scoring: ScoringConfigSchema.optional(),
1054
1071
  enforce: exports_external.boolean().default(true),
@@ -1688,6 +1705,9 @@ var SkillImproverConfigSchema = exports_external.object({
1688
1705
  quota_window: exports_external.enum(["utc", "local"]).default("utc"),
1689
1706
  allow_deterministic_fallback: exports_external.boolean().default(true)
1690
1707
  });
1708
+ var SkillsConfigSchema = exports_external.object({
1709
+ enabled: exports_external.boolean().default(false)
1710
+ });
1691
1711
  var SpecWriterConfigSchema = exports_external.object({
1692
1712
  enabled: exports_external.boolean().default(true),
1693
1713
  model: exports_external.string().nullable().default(null),
@@ -1948,6 +1968,9 @@ var DEFAULT_EXTERNAL_SKILLS_CONFIG = {
1948
1968
  max_concurrent_fetches: 5,
1949
1969
  fetch_timeout_ms: 30000
1950
1970
  };
1971
+ var DEFAULT_SKILLS_CONFIG = {
1972
+ enabled: false
1973
+ };
1951
1974
  function resolveExternalSkillsConfig(input) {
1952
1975
  if (input === undefined || input === null || typeof input !== "object" || Array.isArray(input)) {
1953
1976
  return { ...DEFAULT_EXTERNAL_SKILLS_CONFIG };
@@ -2194,7 +2217,8 @@ var PluginConfigSchema = exports_external.object({
2194
2217
  }
2195
2218
  })),
2196
2219
  pr_monitor: PrMonitorConfigSchema.optional(),
2197
- external_skills: ExternalSkillsConfigSchema.optional()
2220
+ external_skills: ExternalSkillsConfigSchema.optional(),
2221
+ skills: SkillsConfigSchema.optional()
2198
2222
  });
2199
2223
 
2200
- export { ORCHESTRATOR_NAME, ALL_SUBAGENT_NAMES, ALL_AGENT_NAMES, TOOL_NAMES, TOOL_NAME_SET, AGENT_TOOL_MAP, DEFAULT_AGENT_CONFIGS, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, AgentOverrideConfigSchema, SwarmConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AutoReviewConfigSchema, 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, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, 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, resolveExternalSkillsConfig, PluginConfigSchema };
2224
+ export { ORCHESTRATOR_NAME, ALL_SUBAGENT_NAMES, ALL_AGENT_NAMES, TOOL_NAMES, TOOL_NAME_SET, AGENT_TOOL_MAP, DEFAULT_AGENT_CONFIGS, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, AgentOverrideConfigSchema, SwarmConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AutoReviewConfigSchema, 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, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, 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 };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  stripKnownSwarmPrefix
4
- } from "./index-tqbb2jx6.js";
4
+ } from "./index-471qxz9g.js";
5
5
  import {
6
6
  init_logger,
7
7
  warn
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-b223mczb.js";
5
+ } from "./index-5z2e78tv.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-a9ghr5cx.js";
4
+ } from "./index-wmm21nsk.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-rdc6nvmw.js";
7
+ } from "./index-gnd1280x.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -78,17 +78,17 @@ import {
78
78
  handleWriteRetroCommand,
79
79
  normalizeSwarmCommandInput,
80
80
  resolveCommand
81
- } from "./index-sgdr2e4n.js";
82
- import"./index-b223mczb.js";
81
+ } from "./index-pc10e4d7.js";
82
+ import"./index-5z2e78tv.js";
83
83
  import"./index-2a6ppa65.js";
84
84
  import"./index-fjxjb66n.js";
85
85
  import"./index-hb10a2g8.js";
86
- import"./index-xx3sv77e.js";
86
+ import"./index-zy22fg5h.js";
87
87
  import {
88
88
  AGENT_TOOL_MAP,
89
89
  ORCHESTRATOR_NAME,
90
90
  stripKnownSwarmPrefix
91
- } from "./index-tqbb2jx6.js";
91
+ } from "./index-471qxz9g.js";
92
92
  import"./index-4c5jpmn9.js";
93
93
  import"./index-adz3nk9b.js";
94
94
  import"./index-v4fcn4tr.js";
@@ -57,7 +57,7 @@ import {
57
57
  readDoctorArtifact,
58
58
  removeStraySwarmDir,
59
59
  runConfigDoctor
60
- } from "./index-xx3sv77e.js";
60
+ } from "./index-zy22fg5h.js";
61
61
  import {
62
62
  AGENT_TOOL_MAP,
63
63
  ALL_SUBAGENT_NAMES,
@@ -70,7 +70,7 @@ import {
70
70
  TOOL_NAME_SET,
71
71
  resolveExternalSkillsConfig,
72
72
  stripKnownSwarmPrefix
73
- } from "./index-tqbb2jx6.js";
73
+ } from "./index-471qxz9g.js";
74
74
  import {
75
75
  MAX_TRANSIENT_RETRIES,
76
76
  PlanSchema,
@@ -909,7 +909,7 @@ var init_executor = __esm(() => {
909
909
  // package.json
910
910
  var package_default = {
911
911
  name: "opencode-swarm",
912
- version: "7.97.0",
912
+ version: "7.98.0",
913
913
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
914
914
  main: "dist/index.js",
915
915
  types: "dist/index.d.ts",
@@ -13070,7 +13070,7 @@ async function runFinalizeStage(ctx) {
13070
13070
  }
13071
13071
  }
13072
13072
  try {
13073
- const { CuratorConfigSchema: CCS } = await import("./schema-a8fneygm.js");
13073
+ const { CuratorConfigSchema: CCS } = await import("./schema-mygkbbe9.js");
13074
13074
  const { config: pmLoadedConfig } = _internals20.loadPluginConfigWithMeta(ctx.directory);
13075
13075
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
13076
13076
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -16793,7 +16793,7 @@ async function handleDoctorCommand(directory, args) {
16793
16793
  const result = runConfigDoctor(config, directory);
16794
16794
  let output;
16795
16795
  if (enableAutoFix && result.hasAutoFixableIssues) {
16796
- const { runConfigDoctorWithFixes } = await import("./config-doctor-h1xrvq83.js");
16796
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-7yrxfa6b.js");
16797
16797
  const fixResult = await runConfigDoctorWithFixes(directory, config, true);
16798
16798
  output = formatDoctorMarkdown(fixResult.result);
16799
16799
  } else {
@@ -31857,7 +31857,7 @@ function buildDetailedHelp(commandName, entry) {
31857
31857
  async function handleHelpCommand(ctx) {
31858
31858
  const targetCommand = ctx.args.join(" ");
31859
31859
  if (!targetCommand) {
31860
- const { buildHelpText } = await import("./index-byb9tgay.js");
31860
+ const { buildHelpText } = await import("./index-h6h8qfsh.js");
31861
31861
  return buildHelpText();
31862
31862
  }
31863
31863
  const tokens = targetCommand.split(/\s+/);
@@ -31866,7 +31866,7 @@ async function handleHelpCommand(ctx) {
31866
31866
  return _internals45.buildDetailedHelp(resolved.key, resolved.entry);
31867
31867
  }
31868
31868
  const similar = _internals45.findSimilarCommands(targetCommand);
31869
- const { buildHelpText: fullHelp } = await import("./index-byb9tgay.js");
31869
+ const { buildHelpText: fullHelp } = await import("./index-h6h8qfsh.js");
31870
31870
  if (similar.length > 0) {
31871
31871
  return `Command '/swarm ${targetCommand}' not found.
31872
31872
 
@@ -31999,7 +31999,7 @@ var COMMAND_REGISTRY = {
31999
31999
  },
32000
32000
  "guardrail explain": {
32001
32001
  handler: async (ctx) => {
32002
- const { handleGuardrailExplain } = await import("./guardrail-explain-t6svvtmn.js");
32002
+ const { handleGuardrailExplain } = await import("./guardrail-explain-xdv74tfk.js");
32003
32003
  return handleGuardrailExplain(ctx.directory, ctx.args);
32004
32004
  },
32005
32005
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -32009,7 +32009,7 @@ var COMMAND_REGISTRY = {
32009
32009
  },
32010
32010
  "guardrail-log": {
32011
32011
  handler: async (ctx) => {
32012
- const { handleGuardrailLog } = await import("./guardrail-log-9yyeccv5.js");
32012
+ const { handleGuardrailLog } = await import("./guardrail-log-53z1cf46.js");
32013
32013
  return handleGuardrailLog(ctx.directory, ctx.args);
32014
32014
  },
32015
32015
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-sgdr2e4n.js";
15
+ } from "./index-pc10e4d7.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-b223mczb.js";
22
+ } from "./index-5z2e78tv.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -3,7 +3,7 @@ import {
3
3
  ALL_AGENT_NAMES,
4
4
  PluginConfigSchema,
5
5
  stripKnownSwarmPrefix
6
- } from "./index-tqbb2jx6.js";
6
+ } from "./index-471qxz9g.js";
7
7
  import {
8
8
  log
9
9
  } from "./index-zgwm4ryv.js";
package/dist/cli/index.js CHANGED
@@ -7,15 +7,15 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-sgdr2e4n.js";
11
- import"./index-b223mczb.js";
10
+ } from "./index-pc10e4d7.js";
11
+ import"./index-5z2e78tv.js";
12
12
  import"./index-2a6ppa65.js";
13
13
  import"./index-fjxjb66n.js";
14
14
  import"./index-hb10a2g8.js";
15
- import"./index-xx3sv77e.js";
15
+ import"./index-zy22fg5h.js";
16
16
  import {
17
17
  DEFAULT_AGENT_CONFIGS
18
- } from "./index-tqbb2jx6.js";
18
+ } from "./index-471qxz9g.js";
19
19
  import"./index-4c5jpmn9.js";
20
20
  import"./index-adz3nk9b.js";
21
21
  import"./index-v4fcn4tr.js";
@@ -22,6 +22,7 @@ import {
22
22
  DEFAULT_AGENT_PROFILES,
23
23
  DEFAULT_ARCHITECT_PROFILE,
24
24
  DEFAULT_EXTERNAL_SKILLS_CONFIG,
25
+ DEFAULT_SKILLS_CONFIG,
25
26
  DecisionDecaySchema,
26
27
  DesignDocsConfigSchema,
27
28
  DiscoverySourceSchema,
@@ -63,6 +64,7 @@ import {
63
64
  SelfReviewConfigSchema,
64
65
  SkillImproverConfigSchema,
65
66
  SkillPropagationConfigSchema,
67
+ SkillsConfigSchema,
66
68
  SlopDetectorConfigSchema,
67
69
  SpecWriterConfigSchema,
68
70
  StandardTurboConfigSchema,
@@ -81,7 +83,7 @@ import {
81
83
  resolveGeneratedAgentRole,
82
84
  resolveGuardrailsConfig,
83
85
  stripKnownSwarmPrefix
84
- } from "./index-tqbb2jx6.js";
86
+ } from "./index-471qxz9g.js";
85
87
  import"./index-p0arc26j.js";
86
88
  import"./index-293f68mj.js";
87
89
  import"./index-a76rekgs.js";
@@ -104,6 +106,7 @@ export {
104
106
  StandardTurboConfigSchema,
105
107
  SpecWriterConfigSchema,
106
108
  SlopDetectorConfigSchema,
109
+ SkillsConfigSchema,
107
110
  SkillPropagationConfigSchema,
108
111
  SkillImproverConfigSchema,
109
112
  SelfReviewConfigSchema,
@@ -145,6 +148,7 @@ export {
145
148
  DiscoverySourceSchema,
146
149
  DesignDocsConfigSchema,
147
150
  DecisionDecaySchema,
151
+ DEFAULT_SKILLS_CONFIG,
148
152
  DEFAULT_EXTERNAL_SKILLS_CONFIG,
149
153
  DEFAULT_ARCHITECT_PROFILE,
150
154
  DEFAULT_AGENT_PROFILES,
@@ -15,6 +15,8 @@ export declare const GENERAL_COUNCIL_TOOL_NAMES: readonly ["convene_general_coun
15
15
  export declare const GENERAL_COUNCIL_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>>;
16
16
  export declare const TURBO_TOOL_NAMES: readonly ["lean_turbo_plan_lanes", "lean_turbo_acquire_locks", "lean_turbo_runner_status", "lean_turbo_review", "lean_turbo_run_phase", "lean_turbo_status"];
17
17
  export declare const TURBO_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>>;
18
+ export declare const SKILL_TOOL_NAMES: readonly ["skill_generate", "skill_list", "skill_apply", "skill_inspect", "skill_regenerate", "skill_retire", "skill_improve"];
19
+ export declare const SKILL_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>>;
18
20
  /**
19
21
  * Human-readable descriptions for tools shown in the architect Available Tools block.
20
22
  * Used to generate the Available Tools section of the architect prompt at construction time.
@@ -36,6 +38,8 @@ export declare function isQAAgent(name: string): name is QAAgentName;
36
38
  export declare function isSubagent(name: string): boolean;
37
39
  import type { LeanTurboConfig, ScoringConfig, WorktreeIsolationConfig } from './schema';
38
40
  export declare const DEFAULT_SCORING_CONFIG: ScoringConfig;
41
+ /** Unified injection budget is now configured only at the top level (context_budget.unified_injection_tokens). */
42
+ export declare const KNOWLEDGE_UNIFIED_INJECTION_TOKENS_DEFAULT: number | null;
39
43
  /**
40
44
  * Resolve scoring configuration by deep-merging user config with defaults.
41
45
  * Missing scoring block → use defaults; partial weights → merge with defaults.
@@ -204,6 +204,7 @@ export declare const ContextBudgetConfigSchema: z.ZodObject<{
204
204
  critical_threshold: z.ZodDefault<z.ZodNumber>;
205
205
  model_limits: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
206
206
  max_injection_tokens: z.ZodDefault<z.ZodNumber>;
207
+ unified_injection_tokens: z.ZodOptional<z.ZodNumber>;
207
208
  tracked_agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
208
209
  scoring: z.ZodOptional<z.ZodObject<{
209
210
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -757,6 +758,10 @@ export declare const SkillImproverConfigSchema: z.ZodObject<{
757
758
  allow_deterministic_fallback: z.ZodDefault<z.ZodBoolean>;
758
759
  }, z.core.$strip>;
759
760
  export type SkillImproverConfig = z.infer<typeof SkillImproverConfigSchema>;
761
+ export declare const SkillsConfigSchema: z.ZodObject<{
762
+ enabled: z.ZodDefault<z.ZodBoolean>;
763
+ }, z.core.$strip>;
764
+ export type SkillsConfig = z.infer<typeof SkillsConfigSchema>;
760
765
  export declare const SpecWriterConfigSchema: z.ZodObject<{
761
766
  enabled: z.ZodDefault<z.ZodBoolean>;
762
767
  model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -1341,6 +1346,8 @@ export declare const ExternalSkillsConfigSchema: z.ZodObject<{
1341
1346
  export type ExternalSkillsConfig = z.infer<typeof ExternalSkillsConfigSchema>;
1342
1347
  /** Default external skills configuration (all subsystems disabled). */
1343
1348
  export declare const DEFAULT_EXTERNAL_SKILLS_CONFIG: ExternalSkillsConfig;
1349
+ /** Default skills configuration (tools gated off). */
1350
+ export declare const DEFAULT_SKILLS_CONFIG: SkillsConfig;
1344
1351
  /**
1345
1352
  * Resolve the external_skills config section, merging user-provided values
1346
1353
  * over defaults. Returns the default (all-disabled) config when
@@ -1474,6 +1481,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
1474
1481
  critical_threshold: z.ZodDefault<z.ZodNumber>;
1475
1482
  model_limits: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1476
1483
  max_injection_tokens: z.ZodDefault<z.ZodNumber>;
1484
+ unified_injection_tokens: z.ZodOptional<z.ZodNumber>;
1477
1485
  tracked_agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1478
1486
  scoring: z.ZodOptional<z.ZodObject<{
1479
1487
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -2183,6 +2191,9 @@ export declare const PluginConfigSchema: z.ZodObject<{
2183
2191
  max_concurrent_fetches: z.ZodDefault<z.ZodNumber>;
2184
2192
  fetch_timeout_ms: z.ZodDefault<z.ZodNumber>;
2185
2193
  }, z.core.$strip>>;
2194
+ skills: z.ZodOptional<z.ZodObject<{
2195
+ enabled: z.ZodDefault<z.ZodBoolean>;
2196
+ }, z.core.$strip>>;
2186
2197
  }, z.core.$strip>;
2187
2198
  export type PluginConfig = z.infer<typeof PluginConfigSchema>;
2188
2199
  export type { AgentName, PipelineAgentName, QAAgentName, } from './constants';
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Shared verdict normalization utilities for evidence writers.
3
+ *
4
+ * Centralizes the uppercase→lowercase verdict mapping that was previously
5
+ * duplicated across write_drift_evidence, write_hallucination_evidence,
6
+ * and write_mutation_evidence.
7
+ *
8
+ * Two distinct verdict sets are supported:
9
+ * - 2-value (drift / hallucination): APPROVED ↔ approved, NEEDS_REVISION ↔ rejected
10
+ * - 4-value (mutation): PASS/WARN/FAIL/SKIP ↔ pass/warn/fail/skip
11
+ *
12
+ * All functions are pure and throw on invalid input, matching the original
13
+ * per-file behavior exactly.
14
+ */
15
+ /**
16
+ * Normalize a 2-value drift/hallucination verdict to lowercase.
17
+ * @param verdict - Raw verdict from VERDICT_SET_2 (base: 'APPROVED' | 'NEEDS_REVISION'; extensible)
18
+ * @returns Normalized verdict: 'approved' | 'rejected' | lowercase form for extended verdicts
19
+ * @throws Error if verdict is not one of the allowed values in the live set
20
+ */
21
+ export declare function normalizeVerdict2(verdict: 'APPROVED'): 'approved';
22
+ export declare function normalizeVerdict2(verdict: 'NEEDS_REVISION'): 'rejected';
23
+ export declare function normalizeVerdict2(verdict: 'APPROVED' | 'NEEDS_REVISION'): 'approved' | 'rejected';
24
+ export declare function normalizeVerdict2(verdict: string): string;
25
+ /**
26
+ * Normalize a 4-value mutation verdict to lowercase.
27
+ * @param verdict - Raw verdict from VERDICT_SET_4 (base: 'PASS' | 'WARN' | 'FAIL' | 'SKIP'; extensible)
28
+ * @returns Normalized verdict: 'pass' | 'warn' | 'fail' | 'skip' | lowercase form for extended verdicts
29
+ * @throws Error if verdict is not one of the allowed values in the live set
30
+ */
31
+ export declare function normalizeVerdict4(verdict: 'PASS'): 'pass';
32
+ export declare function normalizeVerdict4(verdict: 'WARN'): 'warn';
33
+ export declare function normalizeVerdict4(verdict: 'FAIL'): 'fail';
34
+ export declare function normalizeVerdict4(verdict: 'SKIP'): 'skip';
35
+ export declare function normalizeVerdict4(verdict: 'PASS' | 'WARN' | 'FAIL' | 'SKIP'): 'pass' | 'warn' | 'fail' | 'skip';
36
+ export declare function normalizeVerdict4(verdict: string): string;
37
+ /**
38
+ * Dependency-injection seam for testing. Tests can temporarily replace these
39
+ * to verify that evidence writers delegate to the shared normalize-verdict module.
40
+ * Restore each entry in afterEach via the saved original reference.
41
+ *
42
+ * VERDICT_SET_* are the single source of truth. Writers import VERDICT_SET_2 / _4
43
+ * for their Zod schemas and isAcceptedVerdict* for runtime checks. Adding a value
44
+ * here (or via _internals for tests) makes all three writers accept it with no
45
+ * per-writer edits.
46
+ */
47
+ declare const LIVE_VERDICT_SET_2: string[];
48
+ declare const LIVE_VERDICT_SET_4: string[];
49
+ export declare const VERDICT_SET_2: readonly string[];
50
+ export type Verdict2 = (typeof LIVE_VERDICT_SET_2)[number];
51
+ export declare const VERDICT_SET_4: readonly string[];
52
+ export type Verdict4 = (typeof LIVE_VERDICT_SET_4)[number];
53
+ export declare function isAcceptedVerdict2(v: string): v is Verdict2;
54
+ export declare function isAcceptedVerdict4(v: string): v is Verdict4;
55
+ export declare const _internals: {
56
+ normalizeVerdict2: typeof normalizeVerdict2;
57
+ normalizeVerdict4: typeof normalizeVerdict4;
58
+ VERDICT_SET_2: string[];
59
+ VERDICT_SET_4: string[];
60
+ isAcceptedVerdict2: typeof isAcceptedVerdict2;
61
+ isAcceptedVerdict4: typeof isAcceptedVerdict4;
62
+ setVerdictSet2: (values: string[]) => void;
63
+ setVerdictSet4: (values: string[]) => void;
64
+ getVerdictSet2: () => string[];
65
+ getVerdictSet4: () => string[];
66
+ };
67
+ export {};
@@ -87,7 +87,7 @@ export declare function matchesDelegateScope(entry: Pick<RankedEntry, 'applies_t
87
87
  * @param config - Knowledge system configuration
88
88
  * @returns A hook function that injects knowledge into messages
89
89
  */
90
- export declare function createKnowledgeInjectorHook(directory: string, config: KnowledgeConfig, modelLimitOverrides?: Record<string, number>): (input: Record<string, never>, output: {
90
+ export declare function createKnowledgeInjectorHook(directory: string, config: KnowledgeConfig, modelLimitOverrides?: Record<string, number>, unifiedInjectionTokens?: number | undefined): (input: Record<string, never>, output: {
91
91
  messages?: MessageWithParts[];
92
92
  }) => Promise<void>;
93
93
  export declare const _internals: {