opencode-swarm 7.96.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 (35) hide show
  1. package/.opencode/skills/codebase-review-swarm/references/review-protocol-v8.2.md +1 -1
  2. package/.opencode/skills/deep-dive/SKILL.md +3 -1
  3. package/.opencode/skills/deep-research/SKILL.md +8 -8
  4. package/.opencode/skills/pre-phase-briefing/SKILL.md +21 -5
  5. package/.opencode/skills/swarm-pr-feedback/SKILL.md +19 -7
  6. package/.opencode/skills/swarm-pr-review/SKILL.md +2 -0
  7. package/README.md +7 -1
  8. package/dist/agents/architect.d.ts +1 -1
  9. package/dist/cli/{config-doctor-h1xrvq83.js → config-doctor-7yrxfa6b.js} +2 -2
  10. package/dist/cli/{guardrail-explain-0hw3kyab.js → guardrail-explain-xdv74tfk.js} +5 -5
  11. package/dist/cli/{guardrail-log-9yyeccv5.js → guardrail-log-53z1cf46.js} +3 -3
  12. package/dist/cli/{index-tqbb2jx6.js → index-471qxz9g.js} +33 -9
  13. package/dist/cli/{index-b223mczb.js → index-5z2e78tv.js} +1 -1
  14. package/dist/cli/{index-rdc6nvmw.js → index-gnd1280x.js} +1 -1
  15. package/dist/cli/{index-r0zbs7ny.js → index-h6h8qfsh.js} +6 -6
  16. package/dist/cli/{index-q0t7gpf2.js → index-pc10e4d7.js} +9 -9
  17. package/dist/cli/{index-d3ds25vx.js → index-wmm21nsk.js} +2 -2
  18. package/dist/cli/{index-xx3sv77e.js → index-zy22fg5h.js} +1 -1
  19. package/dist/cli/index.js +4 -4
  20. package/dist/cli/{schema-a8fneygm.js → schema-mygkbbe9.js} +5 -1
  21. package/dist/config/constants.d.ts +4 -0
  22. package/dist/config/schema.d.ts +11 -0
  23. package/dist/evidence/normalize-verdict.d.ts +67 -0
  24. package/dist/hooks/knowledge-injector.d.ts +1 -1
  25. package/dist/index.js +576 -285
  26. package/dist/services/injection-budget.d.ts +98 -0
  27. package/dist/summaries/summarizer.d.ts +36 -0
  28. package/dist/tools/context-status.d.ts +102 -0
  29. package/dist/tools/index.d.ts +1 -0
  30. package/dist/tools/manifest.d.ts +1 -0
  31. package/dist/tools/tool-metadata.d.ts +11 -7
  32. package/dist/tools/write-drift-evidence.d.ts +11 -0
  33. package/dist/tools/write-hallucination-evidence.d.ts +11 -0
  34. package/dist/tools/write-mutation-evidence.d.ts +11 -0
  35. package/package.json +1 -1
@@ -128,7 +128,7 @@ Before writing under `.swarm/`, verify `.swarm/` is ignored or locally excluded.
128
128
  1. Run 0A alone.
129
129
  2. After 0A, run 0B and 0C through `dispatch_lanes_async` only if the repository is large enough to benefit. While those lanes run, the Architect continues deterministic inventory work that does not depend on their results.
130
130
  3. After 0B, run 0D and 0E through `dispatch_lanes_async` only if 0E can leave `linked_claims` blank for Architect linking in 0J. Otherwise run 0D before 0E.
131
- 4. Preferred async batch order: batch 1 = 0F and 0G; batch 2 = 0H and 0I. Never exceed two Phase 0 agents.
131
+ 4. Preferred async batch order: batch 1 = 0F and 0G; batch 2 = 0H and 0I. Never exceed two Phase 0 agents — Phase 0 inventory units (0A→0J) form a largely sequential dependency chain, so concurrency is intentionally capped at 2 to respect that ordering rather than scaled toward the 8-lane dispatch limit.
132
132
  5. Run 0F after 0E when possible.
133
133
  6. Run 0G after 0B and 0C.
134
134
  7. Run 0H and 0I after 0B and 0C.
@@ -18,7 +18,7 @@ Read-only deep audit of a specified codebase scope using parallel explorer waves
18
18
  Parse the MODE: DEEP_DIVE header to extract:
19
19
  - `scope`: the codebase area to audit (e.g., "auth", "payment flow", "src/hooks/")
20
20
  - `profile`: one of standard | security | ux | architecture | full (default: standard)
21
- - `max_explorers`: integer 1..8 (default: 6, or 8 for full profile)
21
+ - `max_explorers`: integer 1..8 — upper bound on explorer waves (default: 6, or 8 for full profile). This is a CAP, not a fixed count: scale the actual wave size to the resolved scope surface — a trivial scope needs 1–2 explorers, a typical scope 3–5, a large multi-module scope up to the cap — never fix the count in advance.
22
22
  - `output`: markdown | json (default: markdown)
23
23
  - `update_main`: boolean (default: true) — whether to fetch/ff-only main before starting
24
24
  - `allow_dirty`: boolean (default: false) — whether to proceed with uncommitted changes
@@ -52,6 +52,8 @@ Dispatch explorer waves with `dispatch_lanes_async` when available. Each wave co
52
52
  - ~3500 total lines across all files in a mission
53
53
  - Group files by import proximity (files that import each other go in the same mission)
54
54
 
55
+ **Partition is the contract:** missions own non-overlapping file sets — no file appears in two missions — and the union of all missions must cover every file in the Step 2 scope map. Any scope-map file not assigned to a mission is an explicit coverage gap, not an optional skip.
56
+
55
57
  **Profile-based lane selection — each profile activates specific lanes:**
56
58
 
57
59
  | Lane | Template | standard | security | ux | architecture | full |
@@ -123,14 +123,14 @@ synthesis lanes run, poll with `collect_lane_results` without `wait` (or
123
123
  `wait: false`) to process completed worker responses as they settle while
124
124
  continuing independent architect work between polls. Before Step 5, call
125
125
  `collect_lane_results` with `wait: true` for every open synthesis batch only if
126
- lanes are still pending and no independent work remains. Collect all completed
127
- worker responses into a candidate findings set, each finding tagged with its
128
- subtopic, evidence refs, and the worker's confidence. Treat missing, stale,
129
- cancelled, or failed lanes as explicit coverage gaps. If `dispatch_lanes_async`
130
- is unavailable, use blocking `dispatch_lanes` and record that async advisory
131
- lanes were unavailable; do not substitute per-agent Task calls for this fallback
132
- unless lane tools are unavailable and you explicitly verify equivalent agent
133
- type, prompt, scope, and isolation.
126
+ lanes are still pending and no independent work remains. Do not advance to Step 5
127
+ until every synthesis lane is settled. Collect all completed worker responses into
128
+ a candidate findings set, each finding tagged with its subtopic, evidence refs,
129
+ and the worker's confidence. Treat missing, stale, cancelled, or failed lanes as
130
+ explicit coverage gaps. If `dispatch_lanes_async` is unavailable, use blocking
131
+ `dispatch_lanes` and record that async advisory lanes were unavailable; do not
132
+ substitute per-agent Task calls for this fallback unless lane tools are unavailable
133
+ and you explicitly verify equivalent agent type, prompt, scope, and isolation.
134
134
 
135
135
  ## Step 5 — Dual-Reviewer Claim Verification
136
136
 
@@ -42,15 +42,31 @@ This briefing is a HARD REQUIREMENT for ALL phases. Skipping it is a process vio
42
42
 
43
43
  ### CODEBASE REALITY CHECK (Required Before Speccing or Planning)
44
44
 
45
- Before any spec generation, plan creation, or plan ingestion begins, the Architect must dispatch the Explorer agent in targeted, scoped chunks one per logical area of the codebase referenced by the work (e.g., per module, per hook, per config surface). Each chunk must be explored with full depth rather than a broad surface pass.
45
+ Before any spec generation, plan creation, or plan ingestion begins, the Architect must verify the codebase reality of every item the work references. This runs as **asynchronous, fanned-out Explorer lanes by default**, joined behind a hard settlement gate never as a single blocking explorer call, and never as fire-and-forget.
46
46
 
47
- For each scoped chunk, Explorer must determine:
47
+ **1. Enumerate and partition the references (before dispatch).**
48
+ List every referenced item — file, module, function, API, config surface, and behavioral assumption — named or implied by the spec, the user request, or the plan. Partition them into **non-overlapping** lane assignments. The partition is the contract: no two lanes may share a reference (this prevents duplicated work), and the **union of all lanes must cover every referenced item** (this prevents gaps). Under-specified lane boundaries are the dominant fan-out failure mode — be explicit about what each lane owns.
49
+
50
+ **2. Scale the number of lanes to the size of the referenced surface.**
51
+ - Trivial surface (a single file/function, one logical area) → **1 lane**.
52
+ - Typical phase spanning a few areas → **2–4 lanes**.
53
+ - Large surface (many modules/hooks/config surfaces) → **more lanes, up to the dispatch cap of 8 lanes per batch**.
54
+
55
+ Do not fix the lane count in advance and do not over-spawn: extra lanes on a small surface waste tokens without improving coverage, while too few on a large surface leave gaps. Split by codebase area by default; when the surface is a single dense area, split by check-type instead — one lane for *existence & current state*, one for *assumption correctness & prior-work*.
56
+
57
+ **3. Dispatch asynchronously, then keep working.**
58
+ Dispatch the lanes with `dispatch_lanes_async`, record the returned `batch_id`, and continue **non-dependent** Architect work while they run — digest the retrospective and `user_directives`, review the spec/plan text for internal consistency, check governance/QA-gate config and the obligation ledger, and prepare the plan skeleton / task decomposition. This is dispatch-and-keep-busy, not fire-and-forget. Poll with `collect_lane_results` (wait omitted or false) to process settled lanes incrementally, or join with `wait: true` once independent work is exhausted.
59
+
60
+ Each lane must be given: its objective, its named (disjoint) reference subset, the fixed REALITY-CHECK output format below, and clear boundaries. Lanes are read-only — they cannot `declare_scope` or mutate the worktree.
61
+
62
+ **4. For each referenced item, the lane must determine:**
48
63
  - Does this file/module/function already exist?
49
64
  - If it exists, what is its current state? Does it already implement any part of what the plan or spec describes?
50
65
  - Is the plan's or user's assumption about the current state accurate? Flag any discrepancy between what is expected and what actually exists.
51
66
  - Has any portion of this work already been applied (partially or fully) in a prior session or commit?
52
67
 
53
- Explorer outputs a CODEBASE REALITY REPORT before any other agent proceeds. The report must list every referenced item with one of:
68
+ **5. Hard settlement gate (join before any downstream work).**
69
+ The Architect synthesizes the lane outputs into a single CODEBASE REALITY REPORT. The report must list every referenced item with one of:
54
70
  NOT STARTED | PARTIALLY DONE | ALREADY COMPLETE | ASSUMPTION INCORRECT
55
71
 
56
72
  Format:
@@ -59,11 +75,11 @@ Format:
59
75
  ✗ src/services/status-service.ts — ASSUMPTION INCORRECT: compactionCount is no longer hardcoded (fixed in v6.29.1)
60
76
  ✓ src/config/evidence-schema.ts — confirmed phase_number min(1)
61
77
 
62
- No implementation agent (coder, reviewer, test-engineer) may begin until this report is finalized.
78
+ No spec finalization, plan generation, plan ingestion, `declare_scope`, or implementation-agent dispatch (coder, reviewer, test-engineer) may begin until ALL lanes in the batch are settled (`collect_lane_results` reports `all_settled`) AND this report is finalized. A lane that is missing, failed, or timed out is an explicit coverage gap, not a pass: mark the affected references BLOCKED or SKIPPED_WITH_REASON and resolve them before proceeding — never silently continue. Async dispatch changes *when* the Architect waits, never *whether* the gate holds.
63
79
 
64
80
  This check fires automatically in:
65
81
  - MODE: SPECIFY — before explorer dispatch for context (step 2)
66
82
  - MODE: PLAN — before plan generation or validation
67
83
  - EXTERNAL PLAN IMPORT PATH — before parsing the provided plan
68
84
 
69
- GREENFIELD EXEMPTION: If the work is purely greenfield (new project, no existing codebase references), skip this check.
85
+ GREENFIELD EXEMPTION: If the work is purely greenfield (new project, no existing codebase references), skip this check. A trivial single-area surface stays a single lane rather than being force-fanned.
@@ -198,15 +198,27 @@ If a source is unavailable, retry with alternative access paths. If unavailable
198
198
  After the complete feedback ledger exists and before editing, use
199
199
  `dispatch_lanes_async` when available for independent read-only verification lanes:
200
200
  comment classification, CI/log root-cause inspection, test impact mapping,
201
- release/docs claim checks, and stale-branch/conflict analysis. Record each
202
- returned `batch_id`, then continue only ledger-safe architect work: normalize
203
- feedback IDs, gather deterministic PR metadata, prepare reproduction commands,
204
- and plan likely fix groups. Do not edit, close items, or mark feedback resolved
205
- from running lanes.
201
+ release/docs claim checks, and stale-branch/conflict analysis. Partition the
202
+ ledger so each `FB-###` item is owned by exactly one verification lane and the
203
+ union of lanes covers the entire ledger no feedback item may be left
204
+ unassigned to a lane; state each lane's owned `FB-###` range in its prompt. Scale
205
+ the lane count to the ledger size: a 1–3 item round may use a single combined
206
+ lane, while a large multi-round intake may warrant one lane per category above.
207
+ Cap each `dispatch_lanes_async` batch at 8 lanes (`MAX_LANES`); if the ledger
208
+ needs more than 8 verification lanes, dispatch in sequential batches and settle
209
+ each batch's COVERAGE GATE before the next — do not over-spawn lanes for a
210
+ trivial round. Record each returned `batch_id`, then continue only ledger-safe
211
+ architect work: normalize feedback IDs, gather deterministic PR metadata, prepare
212
+ reproduction commands, and plan likely fix groups. Do not edit, close items, or
213
+ mark feedback resolved from running lanes.
206
214
 
207
215
  Before the Verification step can mark any item `RESOLVED`, `DISPROVED`,
208
- `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or `NEEDS_USER_DECISION`, call
209
- `collect_lane_results` with `wait: true` for every open verification batch.
216
+ `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or `NEEDS_USER_DECISION`, every open
217
+ verification batch must be fully settled. Poll with `collect_lane_results` (wait
218
+ omitted or `false`) to process settled lanes incrementally — clustering confirmed
219
+ items and pre-reading files for settled findings while ledger-safe work remains —
220
+ then issue a final `collect_lane_results` with `wait: true` per batch once
221
+ independent work is exhausted, to confirm every lane is settled.
210
222
  Missing, stale, cancelled, or failed lanes are coverage gaps that must be closed
211
223
  before marking any item RESOLVED/DISPROVED/PRE_EXISTING. Apply the COVERAGE GATE:
212
224
  retry failed lanes (max 2), deploy a verified equivalent alternative (same agent
@@ -558,6 +558,8 @@ in the same batch unless intentionally replacing that exact lane before dispatch
558
558
 
559
559
  Explorers optimize for recall. Over-reporting is expected. Explorers produce candidates only.
560
560
 
561
+ The six lanes are a fixed **check-type** partition (correctness / security / deps / docs / tests / performance), not an area partition: the count is intentionally constant — every PR needs all six review dimensions — and the lanes deliberately overlap by file, each receiving the same diff via `common_prompt` and viewing it through a different lens. This is the deliberate exception to surface-scaled fan-out: the base wave is a fixed six by design, never collapsed or expanded with the size of the change. Coverage is guaranteed by the six dimensions each reading the whole diff, not by partitioning files across lanes — so the disjoint-partition rule that governs area-split fan-outs does not apply to these check-type lanes.
562
+
561
563
  | Lane | Focus | Required checks |
562
564
  |---|---|---|
563
565
  | Lane 1: Correctness and edge cases | Logic errors, null/undefined handling, incorrect operators, async ordering, races, off-by-one, error paths | input domain, nullability, async/await, loop termination, exception behavior, backward compatibility |
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-d3ds25vx.js";
5
- import"./index-q0t7gpf2.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-d3ds25vx.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-q0t7gpf2.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.96.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-r0zbs7ny.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-r0zbs7ny.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-0hw3kyab.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-q0t7gpf2.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-q0t7gpf2.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.