opencode-swarm 7.114.1 → 7.114.2

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.
@@ -14,7 +14,7 @@ import {
14
14
  runCuratorInit,
15
15
  runCuratorPhase,
16
16
  writeCuratorSummary
17
- } from "./index-8phvk4v4.js";
17
+ } from "./index-64168f15.js";
18
18
  import"./index-g6va6n3t.js";
19
19
  import"./index-c8s9a3zh.js";
20
20
  import"./index-2148358e.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  createCuratorLLMDelegate
4
- } from "./index-8phvk4v4.js";
4
+ } from "./index-64168f15.js";
5
5
  import"./index-g6va6n3t.js";
6
6
  import"./index-c8s9a3zh.js";
7
7
  import"./index-2148358e.js";
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-2aszzcyk.js";
5
- import"./index-8phvk4v4.js";
4
+ } from "./index-tnm0e2vb.js";
5
+ import"./index-64168f15.js";
6
6
  import"./index-g6va6n3t.js";
7
7
  import"./index-c8s9a3zh.js";
8
8
  import"./index-2148358e.js";
@@ -6,7 +6,7 @@ import {
6
6
  isHiveEligible,
7
7
  promoteFromSwarm,
8
8
  promoteToHive
9
- } from "./index-8phvk4v4.js";
9
+ } from "./index-64168f15.js";
10
10
  import"./index-g6va6n3t.js";
11
11
  import"./index-c8s9a3zh.js";
12
12
  import"./index-2148358e.js";
@@ -10432,11 +10432,11 @@ var _internals12 = {
10432
10432
  return KnowledgeConfigSchema2.parse({});
10433
10433
  },
10434
10434
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig) => {
10435
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-wwyj379g.js");
10435
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-2g6v327b.js");
10436
10436
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig);
10437
10437
  },
10438
10438
  checkHivePromotions: async (entries, knowledgeConfig) => {
10439
- const { checkHivePromotions } = await import("./hive-promoter-kfjbydfj.js");
10439
+ const { checkHivePromotions } = await import("./hive-promoter-bxngckjh.js");
10440
10440
  return checkHivePromotions(entries, knowledgeConfig);
10441
10441
  },
10442
10442
  applyProposalTriage: async (directory, triage) => {
@@ -17585,8 +17585,8 @@ var _internals24 = {
17585
17585
  loadCuratorDeps: async () => {
17586
17586
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
17587
17587
  import("./schema-e5kd993s.js"),
17588
- import("./curator-wwyj379g.js"),
17589
- import("./curator-llm-factory-26pyy8cq.js")
17588
+ import("./curator-2g6v327b.js"),
17589
+ import("./curator-llm-factory-31e6dsqe.js")
17590
17590
  ]);
17591
17591
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
17592
17592
  }
@@ -18082,7 +18082,7 @@ import { fileURLToPath } from "url";
18082
18082
  // package.json
18083
18083
  var package_default = {
18084
18084
  name: "opencode-swarm",
18085
- version: "7.114.1",
18085
+ version: "7.114.2",
18086
18086
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
18087
18087
  main: "dist/index.js",
18088
18088
  types: "dist/index.d.ts",
@@ -32968,7 +32968,7 @@ function buildDetailedHelp(commandName, entry) {
32968
32968
  async function handleHelpCommand(ctx) {
32969
32969
  const targetCommand = ctx.args.join(" ");
32970
32970
  if (!targetCommand) {
32971
- const { buildHelpText } = await import("./index-gge9vh5s.js");
32971
+ const { buildHelpText } = await import("./index-fdwtf08h.js");
32972
32972
  return buildHelpText();
32973
32973
  }
32974
32974
  const tokens = targetCommand.split(/\s+/);
@@ -32977,7 +32977,7 @@ async function handleHelpCommand(ctx) {
32977
32977
  return _internals49.buildDetailedHelp(resolved.key, resolved.entry);
32978
32978
  }
32979
32979
  const similar = _internals49.findSimilarCommands(targetCommand);
32980
- const { buildHelpText: fullHelp } = await import("./index-gge9vh5s.js");
32980
+ const { buildHelpText: fullHelp } = await import("./index-fdwtf08h.js");
32981
32981
  if (similar.length > 0) {
32982
32982
  return `Command '/swarm ${targetCommand}' not found.
32983
32983
 
@@ -33110,7 +33110,7 @@ var COMMAND_REGISTRY = {
33110
33110
  },
33111
33111
  "guardrail explain": {
33112
33112
  handler: async (ctx) => {
33113
- const { handleGuardrailExplain } = await import("./guardrail-explain-qzg7rr7f.js");
33113
+ const { handleGuardrailExplain } = await import("./guardrail-explain-ygvp1aj9.js");
33114
33114
  return handleGuardrailExplain(ctx.directory, ctx.args);
33115
33115
  },
33116
33116
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -33120,7 +33120,7 @@ var COMMAND_REGISTRY = {
33120
33120
  },
33121
33121
  "guardrail-explain": {
33122
33122
  handler: async (ctx) => {
33123
- const { handleGuardrailExplain } = await import("./guardrail-explain-qzg7rr7f.js");
33123
+ const { handleGuardrailExplain } = await import("./guardrail-explain-ygvp1aj9.js");
33124
33124
  return handleGuardrailExplain(ctx.directory, ctx.args);
33125
33125
  },
33126
33126
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-2aszzcyk.js";
4
+ } from "./index-tnm0e2vb.js";
5
5
  import {
6
6
  handleGuardrailLog
7
7
  } from "./index-xbe1wtme.js";
@@ -81,7 +81,7 @@ import {
81
81
  handleWriteRetroCommand,
82
82
  normalizeSwarmCommandInput,
83
83
  resolveCommand
84
- } from "./index-8phvk4v4.js";
84
+ } from "./index-64168f15.js";
85
85
  import"./index-g6va6n3t.js";
86
86
  import"./index-c8s9a3zh.js";
87
87
  import"./index-2148358e.js";
@@ -12,7 +12,7 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-8phvk4v4.js";
15
+ } from "./index-64168f15.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
package/dist/cli/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-8phvk4v4.js";
10
+ } from "./index-64168f15.js";
11
11
  import"./index-g6va6n3t.js";
12
12
  import"./index-c8s9a3zh.js";
13
13
  import"./index-2148358e.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{createRequire}from"node:module";var __create=Object.create;var{getPrototypeOf:__getProtoOf,defineProperty:__defProp,getOwnPropertyNames:__getOwnPropNames,getOwnPropertyDescriptor:__getOwnPropDesc}=Object,__hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node,__toESMCache_esm,__toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap,cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};let to=isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target;for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:!0});if(canCache)cache.set(mod,to);return to},__toCommonJS=(from)=>{var entry=(__moduleCache??=new WeakMap).get(from),desc;if(entry)return entry;if(entry=__defProp({},"__esModule",{value:!0}),from&&typeof from==="object"||typeof from==="function"){for(var key of __getOwnPropNames(from))if(!__hasOwnProp.call(entry,key))__defProp(entry,key,{get:__accessProp.bind(from,key),enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return __moduleCache.set(from,entry),entry},__moduleCache,__commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name,newValue){this[name]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0,configurable:!0,set:__exportSetter.bind(all,name)})};var __esm=(fn2,res)=>()=>(fn2&&(res=fn2(fn2=0)),res);var __require=createRequire(import.meta.url);var package_default;var init_package=__esm(()=>{package_default={name:"opencode-swarm",version:"7.114.1",description:"Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",main:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"},"./package.json":"./package.json"},bin:{"opencode-swarm":"./dist/cli/index.js"},type:"module",engines:{bun:">=1.3.13"},license:"MIT",repository:{type:"git",url:"https://github.com/ZaxbyHub/opencode-swarm.git"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},keywords:["opencode","opencode-plugin","ai","agents","orchestration","swarm","multi-agent","llm"],files:["dist","dist/lang/grammars","binaries",".opencode/skills/brainstorm",".opencode/skills/specify",".opencode/skills/clarify-spec",".opencode/skills/resume",".opencode/skills/clarify",".opencode/skills/discover",".opencode/skills/consult",".opencode/skills/pre-phase-briefing",".opencode/skills/council",".opencode/skills/deep-dive",".opencode/skills/deep-research",".opencode/skills/codebase-review-swarm",".opencode/skills/swarm-implement",".opencode/skills/design-docs",".opencode/skills/swarm-pr-review",".opencode/skills/swarm",".opencode/skills/swarm-pr-feedback",".opencode/skills/swarm-pr-subscribe",".opencode/skills/swarm-ci-monitor",".opencode/skills/issue-ingest",".opencode/skills/plan",".opencode/skills/critic-gate",".opencode/skills/execute",".opencode/skills/phase-wrap",".opencode/skills/loop",".opencode/skills/writing-tests",".opencode/skills/running-tests",".opencode/skills/engineering-conventions",".opencode/skills/commit-pr",".opencode/skills/ci-failure-batching",".opencode/skills/gate-attribution",".opencode/skills/merge-queue-readiness",".opencode/skills/skill-edit-validation",".opencode/skills/worktree-retry-cleanup",".opencode/skills/test-file-split",".opencode/skills/fork-pr-operations",".opencode/skills/parallel-work-check",".opencode/skills/ci-fix-monitor","tests/fixtures/memory-recall","README.md","LICENSE"],scripts:{clean:`bun -e "require('fs').rmSync('dist',{recursive:true,force:true})"`,build:"bun run clean && bun run scripts/copy-grammars.ts && bun build src/index.ts --outdir dist --target node --format esm --external web-tree-sitter --minify-whitespace --minify-syntax && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external bash-parser --splitting && bun run scripts/copy-grammars.ts --to-dist && tsc --emitDeclarationOnly",typecheck:"tsc --noEmit",test:"bun test",lint:"biome lint .","lint:ci":"biome ci .","test:unit:ci":"bun scripts/ci/run-unit-tests-local.ts","drift:check":"bun run scripts/drift-check.ts","drift:fix":"bun run scripts/drift-check.ts --fix --confirm",format:"biome format . --write",check:"biome check --write .",dev:"bun run build && opencode","package:smoke":"node scripts/package-smoke.mjs",prepare:"bun run build","repro:704":"node scripts/repro-704.mjs","repro:1144":"bun scripts/repro-1144.mjs"},dependencies:{"@opencode-ai/plugin":"^1.1.53","@opencode-ai/sdk":"^1.1.53","@vscode/tree-sitter-wasm":"^0.3.0","bash-parser":"^0.5.0","p-limit":"^7.3.0",picomatch:"^4.0.4","proper-lockfile":"^4.1.2","quick-lru":"^7.3.0","web-tree-sitter":"^0.25.0",zod:"^4.1.8"},devDependencies:{"@biomejs/biome":"2.3.14","@types/picomatch":"^4.0.3","bun-types":"1.3.8","js-yaml":"^4.1.1",typescript:"^5.7.3"}}});var QA_AGENTS,PIPELINE_AGENTS,ORCHESTRATOR_NAME="architect",ALL_SUBAGENT_NAMES,ALL_AGENT_NAMES;var init_agent_names=__esm(()=>{QA_AGENTS=["reviewer","critic","critic_oversight"],PIPELINE_AGENTS=["explorer","coder","test_engineer"],ALL_SUBAGENT_NAMES=["sme","researcher","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","curator_init","curator_phase","curator_postmortem","curator_consolidation","council_generalist","council_skeptic","council_domain_expert","skill_improver","spec_writer",...QA_AGENTS,...PIPELINE_AGENTS],ALL_AGENT_NAMES=["architect",...ALL_SUBAGENT_NAMES]});var TOOL_METADATA,TOOL_NAMES,TOOL_NAME_SET,TOOL_DESCRIPTIONS,AGENT_TOOL_MAP;var init_tool_metadata=__esm(()=>{init_agent_names();TOOL_METADATA={diff:{description:"structured git diff with contract change detection",agents:["architect","reviewer","critic_oversight","coder","test_engineer"]},diff_summary:{description:"filter classified AST changes by category, risk level, or file for reviewer drill-down",agents:["architect","reviewer","critic_oversight"]},syntax_check:{description:"check syntax of source files using tree-sitter parsers across multiple languages, returning per-file errors",agents:["architect","coder","test_engineer"]},placeholder_scan:{description:"todo and FIXME comment detection",agents:["architect","reviewer"]},imports:{description:"find all consumers that import from a given file — use before refactoring shared modules to avoid breaking unseen dependents",agents:["architect","sme","researcher","docs","docs_design","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","reviewer","critic","coder","test_engineer"]},lint:{description:"run project linter in check or fix mode; supports biome, eslint, ruff, clippy, and more, returns structured results",agents:["architect","reviewer","coder"]},secretscan:{description:"scan for secrets (API keys, tokens, passwords) via regex and entropy; returns redacted previews, excludes common dirs",agents:["architect","reviewer","critic_oversight"]},sast_scan:{description:"static analysis security scan",agents:["architect","reviewer","critic_oversight"]},build_check:{description:"discover and run build, typecheck, and test commands for various project ecosystems in the working directory",agents:["architect","coder","test_engineer"]},pre_check_batch:{description:"parallel verification: lint:check + secretscan + sast_scan + quality_budget",agents:["architect","reviewer"]},quality_budget:{description:"code quality budget check",agents:["architect"]},symbols:{description:"extract exported symbols (functions, classes, interfaces, types) from source files; supports TypeScript, JavaScript, and Python",agents:["architect","sme","researcher","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","spec_writer","reviewer","critic","coder","test_engineer"]},complexity_hotspots:{description:"git churn × complexity risk map",agents:["architect","sme","researcher","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","reviewer","critic","critic_oversight","explorer","test_engineer"]},schema_drift:{description:"OpenAPI spec vs route drift",agents:["architect","sme","researcher","docs","explorer"]},todo_extract:{description:"structured TODO/FIXME extraction",agents:["architect","researcher","docs","explorer"]},evidence_check:{description:"verify task evidence completeness",agents:["architect","critic_oversight"]},check_gate_status:{description:"check the gate status of a specific task",agents:["architect","critic_oversight"]},completion_verify:{description:"verify completed tasks have required evidence",agents:["architect","critic_oversight"]},submit_council_verdicts:{description:"submit pre-collected council member verdicts for synthesis (architect MUST dispatch critic/reviewer/sme/test_engineer/explorer as Agent tasks first; this tool synthesizes only, it does not contact members)",agents:[]},submit_phase_council_verdicts:{description:"submit pre-collected phase-level council member verdicts for holistic phase synthesis (architect MUST dispatch all 5 council members with phase-scoped context first; this tool synthesizes only, it does not contact members)",agents:[]},declare_council_criteria:{description:"pre-declare acceptance criteria for a task before the coder starts work; criteria are read back during council evaluation",agents:[]},sbom_generate:{description:"SBOM generation for dependency inventory",agents:["architect"]},checkpoint:{description:"create named git checkpoints for save, restore, and delete — use before risky operations to enable rollback",agents:["architect"]},pkg_audit:{description:"dependency vulnerability scan — npm/pip/cargo",agents:["architect","critic_hallucination_verifier","reviewer","critic_oversight","test_engineer"]},parse_lane_candidates:{description:"Parse [CANDIDATE] rows from a dispatch_lanes or collect_lane_results artifact (by output_ref), produce structured records with provenance, optionally persist to a per-batch sidecar JSONL. Pure-parser variant exists as internal module.",agents:["architect"]},test_runner:{description:"auto-detect and run tests",agents:["architect","reviewer","test_engineer"]},test_impact:{description:"identify test files impacted by changed source files via import analysis",agents:["architect","reviewer","critic_oversight","test_engineer"]},mutation_test:{description:"executes pre-generated mutation patches against tests, evaluates kill rate against quality gate thresholds",agents:["architect","test_engineer"]},generate_mutants:{description:"generate LLM-based mutation testing patches for source files; returns MutationPatch[] for direct consumption by the mutation_test tool",agents:["architect"]},detect_domains:{description:"detect which SME domains are relevant for a given text",agents:["architect","sme","docs","docs_design","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic","critic_oversight","explorer"]},git_blame:{description:"per-line git blame metadata: sha, author, date, summary for each line in a file",agents:["reviewer","explorer","architect"]},gitingest:{description:"fetch a GitHub repository full content via gitingest.com",agents:["architect","docs","explorer"]},retrieve_summary:{description:"retrieve the full content of a stored tool output summary",agents:["architect","sme","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","spec_writer","reviewer","critic","coder","test_engineer"]},retrieve_lane_output:{description:"retrieve paged full dispatch lane output by output_ref; use before consuming truncated lane previews or routing candidates from lane results",agents:["architect"]},extract_code_blocks:{description:"extract code blocks from text content and save them to files",agents:["docs","docs_design","designer","spec_writer","coder","test_engineer"]},phase_complete:{description:"mark a phase as complete and track dispatched agents",agents:["architect"]},save_plan:{description:"save a structured implementation plan",agents:["architect"]},update_task_status:{description:"mark tasks complete, track phase progress",agents:["architect"]},lint_spec:{description:"validate .swarm/spec.md format and required fields",agents:["architect","spec_writer"]},write_retro:{description:"document phase retrospectives via phase_complete workflow, capture lessons learned",agents:["architect"]},write_drift_evidence:{description:"write drift verification evidence for a completed phase",agents:["architect"]},write_hallucination_evidence:{description:"write hallucination verification evidence for a completed phase",agents:["architect"]},write_mutation_evidence:{description:"write mutation gate evidence for a completed phase; normalizes PASS/WARN/FAIL/SKIP verdicts and writes .swarm/evidence/{phase}/mutation-gate.json",agents:["architect"]},declare_scope:{description:"declare file scope for next coder delegation",agents:["architect"]},knowledge_query:{description:"query swarm or hive knowledge with optional filters",agents:["architect","skill_improver","spec_writer"]},doc_scan:{description:"scan project documentation files and build an index manifest",agents:["architect","docs_design","skill_improver","spec_writer","explorer"]},doc_extract:{description:"extract actionable constraints from project documentation",agents:["architect","docs_design","skill_improver","spec_writer"]},curator_analyze:{description:"run curator phase analysis and optionally apply knowledge recommendations",agents:["architect"]},knowledge_add:{description:"store a new lesson in the knowledge base",agents:["architect","coder"]},knowledge_recall:{description:"search the knowledge base for relevant past decisions",agents:["architect","sme","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","curator_init","curator_phase","skill_improver","spec_writer","reviewer","critic","critic_oversight","explorer","coder","test_engineer"]},knowledge_remove:{description:"delete an outdated swarm knowledge entry by ID (swarm tier only)",agents:["architect"]},co_change_analyzer:{description:"detect hidden couplings by analyzing git history",agents:["architect"]},context_status:{description:"report current context-window headroom for the active session — 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.",agents:["architect"]},search:{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 — use symbols and imports tools for structural queries.",agents:["architect","sme","docs","docs_design","designer","critic_hallucination_verifier","skill_improver","spec_writer","reviewer","critic_oversight","explorer","coder","test_engineer","researcher"]},ast_grep:{description:"Read-only structural AST search using ast-grep patterns with optional language and glob filters. Use for syntax-aware code pattern searches; does not rewrite files.",agents:["architect","sme","docs","docs_design","critic_hallucination_verifier","spec_writer","explorer","coder","test_engineer","researcher"]},actionlint_scan:{description:"Run actionlint against GitHub Actions workflow YAML files with structured findings. Resolves actionlint lazily and does not modify files.",agents:["architect","test_engineer"]},osv_scan:{description:"Run OSV-Scanner against a workspace path and return structured dependency vulnerability findings. Resolves osv-scanner lazily and does not modify files.",agents:["architect","test_engineer"]},gh_evidence:{description:"Fetch bounded GitHub pull request or issue metadata through gh for review and CI evidence. Resolves gh lazily and is read-only.",agents:["architect","researcher"]},batch_symbols:{description:"Batched symbol extraction across multiple files. Returns per-file symbol summaries with isolated error handling.",agents:["architect","critic_hallucination_verifier","reviewer","critic_oversight","explorer"]},suggest_patch:{description:"Reviewer-safe structured patch suggestion tool. Produces context-anchored patch artifacts without file modification. Returns structured diagnostics on context mismatch.",agents:["architect","reviewer"]},req_coverage:{description:"query requirement coverage status for tracked functional requirements",agents:["critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","spec_writer","critic","critic_oversight"]},get_approved_plan:{description:"retrieve the last critic-approved immutable plan snapshot for baseline drift comparison",agents:["critic_drift_verifier","critic","critic_oversight"]},repo_map:{description:"query the repo code graph: importers, dependencies, blast radius, localization, ontology facts, package boundaries, and heuristic preflight packets before refactoring; ontology findings are advisory, not formal proofs",agents:["architect","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","reviewer","critic","critic_oversight","explorer","coder"]},get_qa_gate_profile:{description:"retrieve the QA gate profile for the current plan: gates (reviewer, test_engineer, sme_enabled, critic_pre_plan, sast_enabled, council_mode, hallucination_guard, mutation_test, phase_council, drift_check, final_council), lock state, and profile hash. Read-only.",agents:["architect"]},set_qa_gates:{description:"configure the QA gate profile for the current plan. Architect-only. Ratchet-tighter only — rejected once the profile is locked after critic approval. Supports: reviewer, test_engineer, sme_enabled, critic_pre_plan, sast_enabled, council_mode, hallucination_guard, mutation_test, phase_council, drift_check, final_council.",agents:["architect"]},web_search:{description:"External web search (Tavily or Brave) for architect-driven council research, SME domain research, researcher auto-research, and skill-improver research. Returns titled results with snippets, URLs, normalized query metadata, temporal intent, freshness, and removed stale years. Config-gated on council.general.enabled in the resolved config: global ~/.config/opencode/opencode-swarm.json, then project .opencode/opencode-swarm.json overrides. Requires a search API key. Used by the architect in MODE: COUNCIL to gather a RESEARCH CONTEXT before dispatching council agents, by SME for opt-in external skill/source evaluation, and by the researcher agent for multi-source auto-research.",agents:["sme","researcher","skill_improver"]},web_fetch:{description:"Fetch the readable text of a single http(s) URL (architect-only). Returns decoded page text, document title, final URL after redirects, and an evidence reference. Reads primary sources that web_search only surfaces as snippets. Config-gated on council.general.enabled. Blocks private/loopback/link-local/metadata addresses (re-validated and re-pinned across redirects); enforces timeout and body size cap.",agents:[]},convene_general_council:{description:"Synthesize responses from a multi-model General Council. Accepts parallel member responses (Round 1, optionally Round 2), detects disagreements, and returns consensus points, persisting disagreements, and a structured synthesis. Architect-only. Config-gated on council.general.enabled in the resolved config: global ~/.config/opencode/opencode-swarm.json, then project .opencode/opencode-swarm.json overrides.",agents:[]},write_final_council_evidence:{description:"Persist project-scoped final council evidence to .swarm/evidence/final-council.json. PREREQUISITE: dispatch critic, reviewer, sme, test_engineer, and explorer as project-scoped Agent tasks and collect their CouncilMemberVerdict JSON — this tool synthesizes only. Rejects on insufficient quorum or CONCERNS with unresolved requiredFixes; normalizes verdicts to approved/concerns/rejected. Architect-only.",agents:[]},skill_generate:{description:"compile knowledge entries into a structured SKILL.md draft",agents:["skill_improver"]},skill_list:{description:"list generated skill files and their status",agents:["skill_improver"]},skill_apply:{description:"activate a draft skill proposal",agents:[]},skill_inspect:{description:"inspect the content and source entries of a skill file",agents:["skill_improver"]},run_stale_reconciliation:{description:"reconcile skills against the knowledge store: mark skills stale when source knowledge is archived or deleted, or clear stale markers",agents:["architect"]},skill_regenerate:{description:"regenerate an active skill by re-clustering its source knowledge entries and updating the SKILL.md in place",agents:[]},skill_retire:{description:"retire a generated skill by adding a retired.marker file; retired skills are excluded from scoring and injection",agents:[]},skill_improve:{description:"run the skill_improver agent to review and refine skills",agents:["skill_improver"]},spec_write:{description:"author or update .swarm/spec.md for the current project",agents:["spec_writer"]},knowledge_receipt:{description:"file a receipt for retrieved knowledge (applied/ignored/contradicted + new lessons), recorded as immutable knowledge events",agents:["architect","sme","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","curator_init","curator_phase","skill_improver","spec_writer","reviewer","critic","coder","test_engineer"]},knowledge_archive:{description:"archive (default), quarantine, or purge a swarm or hive knowledge entry by ID with an immutable audit tombstone; purge requires an admin flag",agents:["architect"]},swarm_memory_recall:{description:"recall scoped Swarm memory for the current repository as untrusted background",agents:[]},swarm_memory_propose:{description:"create a pending Swarm memory proposal; does not write durable memory directly",agents:[]},swarm_command:{description:"run supported /swarm commands through the canonical command registry",agents:["architect","sme","researcher","docs","docs_design","designer","reviewer","critic","explorer","coder","test_engineer"]},dispatch_lanes:{description:"dispatch read-only exploration/review lanes concurrently and BLOCK until all finish; prefer dispatch_lanes_async for non-blocking dispatch, use this only when promptAsync is unavailable",agents:["architect"]},dispatch_lanes_async:{description:"launch read-only advisory lanes non-blockingly and return a batch id plus lane session handles immediately so you can keep working; launch_timeout_ms is only a promptAsync acceptance budget, not a lane runtime timeout; poll incrementally with collect_lane_results (wait omitted or false) while doing independent investigation, or join with wait: true when you need all results",agents:["architect"]},collect_lane_results:{description:"collect or poll results for a dispatch_lanes_async batch; supports both non-blocking polling (wait omitted or false) and blocking join (wait: true). Non-blocking polls include pending lane identities by default and process settled lanes incrementally while continuing independent work; busy/retry lanes are not timed out just because they run for a long time. Does not advance workflow gates.",agents:["architect"]},summarize_work:{description:"emit a short structured summary of completed work (key decisions, assumptions, risks, constraints) at task completion; rolls up per phase for architecture-supervisor review. Advisory, never blocks.",agents:["architect","sme","researcher","docs","docs_design","designer","explorer","coder","test_engineer"]},write_architecture_supervisor_evidence:{description:"persist the architecture supervisor verdict for a phase (architect MUST dispatch critic_architecture_supervisor first and collect its JSON verdict; this tool persists only, it does not contact the supervisor)",agents:["architect"]},lean_turbo_plan_lanes:{description:"partition phase tasks into parallel lanes based on file-scope conflicts for Lean Turbo execution",agents:[]},lean_turbo_acquire_locks:{description:"acquire file locks for all files in a lane (all-or-nothing) before lane execution",agents:[]},lean_turbo_runner_status:{description:"read Lean Turbo run state from .swarm/turbo-state.json",agents:[]},lean_turbo_review:{description:"dispatch a read-only reviewer agent to evaluate a completed Lean Turbo phase",agents:[]},lean_turbo_run_phase:{description:"Execute a phase using Lean Turbo parallel lane execution. Plans lanes, acquires file locks, and dispatches coder agents concurrently. Use when Lean Turbo is active and you want to execute all tasks in a phase in parallel lanes.",agents:[]},lean_turbo_status:{description:"returns Lean Turbo configuration and active status for the current session",agents:[]},swarm_apply_patch:{description:"Apply a unified diff patch to workspace files with exact context matching, atomic writes, and path validation. Use standard unified diff format only — does NOT support *** Begin Patch / *** Update File payloads (use native apply_patch for those).",agents:["coder","test_engineer"]},external_skill_discover:{description:"Discover external skill candidates from configured sources. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_list:{description:"List external skill candidates in the quarantine store. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_inspect:{description:"Inspect a specific external skill candidate by ID. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_promote:{description:"Promote a validated external skill candidate to an active generated skill. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_reject:{description:"Reject an external skill candidate after evaluation. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_delete:{description:"Delete an external skill candidate from the quarantine store. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_revoke:{description:"Revoke a previously promoted external skill. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},epic_decide_phase:{description:"Compute the Epic Mode verdict for a phase WITHOUT dispatching coders. Runs preflight + calibration + the three gates (p-threshold, hot-module, greenfield), persists the decision, and returns the verdict so the architect can dispatch waves via the visible Task tool (promote) or fall back to per-task serial (demote). Pair with `epic_plan_waves` to get the wave plan when promoted. Use when /swarm epic is on for the session.",agents:["architect"]},epic_plan_waves:{description:"Partition a phase's pending tasks into ordered concurrent waves for Epic Mode dispatch. A wave is a set of tasks with mutually disjoint declared scopes and all dependencies satisfied by prior waves. Returns `{ waves: [{ waveId, taskIds, files }, ...], serializedTasks, degradedTasks }`. "+'For each wave in order, the architect dispatches one `Task(subagent_type="coder", ...)` per `taskId` — all in one assistant message — so the wave runs concurrently and each coder appears as a visible subagent. '+"Wait for the wave to finish before dispatching the next. Pair with `epic_decide_phase` (called first; this tool is only relevant on a `promote` verdict). "+"Preflight reject reasons: `no-plan`, `no-phase`, `phase-empty`, `phase-already-complete`, `scopes-missing` (call `declare_scope` for `missingScopes`), `git-failed` (transient — retry), `planner-error`.",agents:["architect"]},epic_record_divergence:{description:"After every `update_task_status(completed)`, record the task's declared-vs-actual divergence to .swarm/epic/divergence.jsonl. Feeds Epic Mode's self-calibration loop (Capability D). Best-effort: never blocks.",agents:["architect"]}},TOOL_NAMES=Object.keys(TOOL_METADATA),TOOL_NAME_SET=new Set(TOOL_NAMES),TOOL_DESCRIPTIONS=Object.fromEntries(Object.entries(TOOL_METADATA).map(([name,meta])=>[name,meta.description])),AGENT_TOOL_MAP=(()=>{let map=Object.fromEntries(ALL_AGENT_NAMES.map((agent)=>[agent,[]]));for(let[name,meta]of Object.entries(TOOL_METADATA))for(let agent of meta.agents)map[agent].push(name);return map})()});function deepMergeInternal(base,override,depth){if(depth>=10)throw Error("deepMerge exceeded maximum depth of 10");let result={...base};for(let key of Object.keys(override)){let baseVal=base[key],overrideVal=override[key];if(typeof baseVal==="object"&&baseVal!==null&&typeof overrideVal==="object"&&overrideVal!==null&&!Array.isArray(baseVal)&&!Array.isArray(overrideVal))result[key]=deepMergeInternal(baseVal,overrideVal,depth+1);else result[key]=overrideVal}return result}function deepMerge(base,override){if(!base)return override;if(!override)return base;return deepMergeInternal(base,override,0)}function freezeSet(items){let set=new Set(items),proxy=new Proxy(set,{get(target,prop){if(prop==="add"||prop==="delete"||prop==="clear")return()=>{throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")};if(prop==="forEach")return(callback,thisArg)=>{let wrapped=(v,k)=>callback.call(thisArg??void 0,v,k,proxy);return set.forEach(wrapped)};let value=Reflect.get(target,prop);return typeof value==="function"?value.bind(target):value},set(){throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")},deleteProperty(){throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")},defineProperty(){throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")},setPrototypeOf(){throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")}});return proxy}function isQAAgent(name){return QA_AGENTS.includes(name)}function isSubagent(name){return ALL_SUBAGENT_NAMES.includes(name)}function isLowCapabilityModel(modelId){let lower=(modelId||"").toLowerCase();return LOW_CAPABILITY_MODELS.some((substr)=>lower.includes(substr))}var OPENCODE_NATIVE_AGENTS,CLAUDE_CODE_NATIVE_COMMANDS,MEMORY_AGENT_TOOL_MAP,EXTERNAL_SKILL_TOOL_NAMES,EXTERNAL_SKILL_AGENT_TOOL_MAP,COUNCIL_TOOL_NAMES,COUNCIL_AGENT_TOOL_MAP,GENERAL_COUNCIL_TOOL_NAMES,GENERAL_COUNCIL_AGENT_TOOL_MAP,TURBO_TOOL_NAMES,TURBO_AGENT_TOOL_MAP,SKILL_TOOL_NAMES,SKILL_AGENT_TOOL_MAP,WRITE_TOOL_NAMES,DEFAULT_MODELS,DEFAULT_SCORING_CONFIG,LOW_CAPABILITY_MODELS,TURBO_MODE_BANNER=`## \uD83D\uDE80 TURBO MODE ACTIVE
1
+ import{createRequire}from"node:module";var __create=Object.create;var{getPrototypeOf:__getProtoOf,defineProperty:__defProp,getOwnPropertyNames:__getOwnPropNames,getOwnPropertyDescriptor:__getOwnPropDesc}=Object,__hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node,__toESMCache_esm,__toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap,cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};let to=isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target;for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:!0});if(canCache)cache.set(mod,to);return to},__toCommonJS=(from)=>{var entry=(__moduleCache??=new WeakMap).get(from),desc;if(entry)return entry;if(entry=__defProp({},"__esModule",{value:!0}),from&&typeof from==="object"||typeof from==="function"){for(var key of __getOwnPropNames(from))if(!__hasOwnProp.call(entry,key))__defProp(entry,key,{get:__accessProp.bind(from,key),enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return __moduleCache.set(from,entry),entry},__moduleCache,__commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name,newValue){this[name]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0,configurable:!0,set:__exportSetter.bind(all,name)})};var __esm=(fn2,res)=>()=>(fn2&&(res=fn2(fn2=0)),res);var __require=createRequire(import.meta.url);var package_default;var init_package=__esm(()=>{package_default={name:"opencode-swarm",version:"7.114.2",description:"Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",main:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"},"./package.json":"./package.json"},bin:{"opencode-swarm":"./dist/cli/index.js"},type:"module",engines:{bun:">=1.3.13"},license:"MIT",repository:{type:"git",url:"https://github.com/ZaxbyHub/opencode-swarm.git"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},keywords:["opencode","opencode-plugin","ai","agents","orchestration","swarm","multi-agent","llm"],files:["dist","dist/lang/grammars","binaries",".opencode/skills/brainstorm",".opencode/skills/specify",".opencode/skills/clarify-spec",".opencode/skills/resume",".opencode/skills/clarify",".opencode/skills/discover",".opencode/skills/consult",".opencode/skills/pre-phase-briefing",".opencode/skills/council",".opencode/skills/deep-dive",".opencode/skills/deep-research",".opencode/skills/codebase-review-swarm",".opencode/skills/swarm-implement",".opencode/skills/design-docs",".opencode/skills/swarm-pr-review",".opencode/skills/swarm",".opencode/skills/swarm-pr-feedback",".opencode/skills/swarm-pr-subscribe",".opencode/skills/swarm-ci-monitor",".opencode/skills/issue-ingest",".opencode/skills/plan",".opencode/skills/critic-gate",".opencode/skills/execute",".opencode/skills/phase-wrap",".opencode/skills/loop",".opencode/skills/writing-tests",".opencode/skills/running-tests",".opencode/skills/engineering-conventions",".opencode/skills/commit-pr",".opencode/skills/ci-failure-batching",".opencode/skills/gate-attribution",".opencode/skills/merge-queue-readiness",".opencode/skills/skill-edit-validation",".opencode/skills/worktree-retry-cleanup",".opencode/skills/test-file-split",".opencode/skills/fork-pr-operations",".opencode/skills/parallel-work-check",".opencode/skills/ci-fix-monitor","tests/fixtures/memory-recall","README.md","LICENSE"],scripts:{clean:`bun -e "require('fs').rmSync('dist',{recursive:true,force:true})"`,build:"bun run clean && bun run scripts/copy-grammars.ts && bun build src/index.ts --outdir dist --target node --format esm --external web-tree-sitter --minify-whitespace --minify-syntax && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external bash-parser --splitting && bun run scripts/copy-grammars.ts --to-dist && tsc --emitDeclarationOnly",typecheck:"tsc --noEmit",test:"bun test",lint:"biome lint .","lint:ci":"biome ci .","test:unit:ci":"bun scripts/ci/run-unit-tests-local.ts","drift:check":"bun run scripts/drift-check.ts","drift:fix":"bun run scripts/drift-check.ts --fix --confirm",format:"biome format . --write",check:"biome check --write .",dev:"bun run build && opencode","package:smoke":"node scripts/package-smoke.mjs",prepare:"bun run build","repro:704":"node scripts/repro-704.mjs","repro:1144":"bun scripts/repro-1144.mjs"},dependencies:{"@opencode-ai/plugin":"^1.1.53","@opencode-ai/sdk":"^1.1.53","@vscode/tree-sitter-wasm":"^0.3.0","bash-parser":"^0.5.0","p-limit":"^7.3.0",picomatch:"^4.0.4","proper-lockfile":"^4.1.2","quick-lru":"^7.3.0","web-tree-sitter":"^0.25.0",zod:"^4.1.8"},devDependencies:{"@biomejs/biome":"2.3.14","@types/picomatch":"^4.0.3","bun-types":"1.3.8","js-yaml":"^4.1.1",typescript:"^5.7.3"}}});var QA_AGENTS,PIPELINE_AGENTS,ORCHESTRATOR_NAME="architect",ALL_SUBAGENT_NAMES,ALL_AGENT_NAMES;var init_agent_names=__esm(()=>{QA_AGENTS=["reviewer","critic","critic_oversight"],PIPELINE_AGENTS=["explorer","coder","test_engineer"],ALL_SUBAGENT_NAMES=["sme","researcher","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","curator_init","curator_phase","curator_postmortem","curator_consolidation","council_generalist","council_skeptic","council_domain_expert","skill_improver","spec_writer",...QA_AGENTS,...PIPELINE_AGENTS],ALL_AGENT_NAMES=["architect",...ALL_SUBAGENT_NAMES]});var TOOL_METADATA,TOOL_NAMES,TOOL_NAME_SET,TOOL_DESCRIPTIONS,AGENT_TOOL_MAP;var init_tool_metadata=__esm(()=>{init_agent_names();TOOL_METADATA={diff:{description:"structured git diff with contract change detection",agents:["architect","reviewer","critic_oversight","coder","test_engineer"]},diff_summary:{description:"filter classified AST changes by category, risk level, or file for reviewer drill-down",agents:["architect","reviewer","critic_oversight"]},syntax_check:{description:"check syntax of source files using tree-sitter parsers across multiple languages, returning per-file errors",agents:["architect","coder","test_engineer"]},placeholder_scan:{description:"todo and FIXME comment detection",agents:["architect","reviewer"]},imports:{description:"find all consumers that import from a given file — use before refactoring shared modules to avoid breaking unseen dependents",agents:["architect","sme","researcher","docs","docs_design","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","reviewer","critic","coder","test_engineer"]},lint:{description:"run project linter in check or fix mode; supports biome, eslint, ruff, clippy, and more, returns structured results",agents:["architect","reviewer","coder"]},secretscan:{description:"scan for secrets (API keys, tokens, passwords) via regex and entropy; returns redacted previews, excludes common dirs",agents:["architect","reviewer","critic_oversight"]},sast_scan:{description:"static analysis security scan",agents:["architect","reviewer","critic_oversight"]},build_check:{description:"discover and run build, typecheck, and test commands for various project ecosystems in the working directory",agents:["architect","coder","test_engineer"]},pre_check_batch:{description:"parallel verification: lint:check + secretscan + sast_scan + quality_budget",agents:["architect","reviewer"]},quality_budget:{description:"code quality budget check",agents:["architect"]},symbols:{description:"extract exported symbols (functions, classes, interfaces, types) from source files; supports TypeScript, JavaScript, and Python",agents:["architect","sme","researcher","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","spec_writer","reviewer","critic","coder","test_engineer"]},complexity_hotspots:{description:"git churn × complexity risk map",agents:["architect","sme","researcher","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","reviewer","critic","critic_oversight","explorer","test_engineer"]},schema_drift:{description:"OpenAPI spec vs route drift",agents:["architect","sme","researcher","docs","explorer"]},todo_extract:{description:"structured TODO/FIXME extraction",agents:["architect","researcher","docs","explorer"]},evidence_check:{description:"verify task evidence completeness",agents:["architect","critic_oversight"]},check_gate_status:{description:"check the gate status of a specific task",agents:["architect","critic_oversight"]},completion_verify:{description:"verify completed tasks have required evidence",agents:["architect","critic_oversight"]},submit_council_verdicts:{description:"submit pre-collected council member verdicts for synthesis (architect MUST dispatch critic/reviewer/sme/test_engineer/explorer as Agent tasks first; this tool synthesizes only, it does not contact members)",agents:[]},submit_phase_council_verdicts:{description:"submit pre-collected phase-level council member verdicts for holistic phase synthesis (architect MUST dispatch all 5 council members with phase-scoped context first; this tool synthesizes only, it does not contact members)",agents:[]},declare_council_criteria:{description:"pre-declare acceptance criteria for a task before the coder starts work; criteria are read back during council evaluation",agents:[]},sbom_generate:{description:"SBOM generation for dependency inventory",agents:["architect"]},checkpoint:{description:"create named git checkpoints for save, restore, and delete — use before risky operations to enable rollback",agents:["architect"]},pkg_audit:{description:"dependency vulnerability scan — npm/pip/cargo",agents:["architect","critic_hallucination_verifier","reviewer","critic_oversight","test_engineer"]},parse_lane_candidates:{description:"Parse [CANDIDATE] rows from a dispatch_lanes or collect_lane_results artifact (by output_ref), produce structured records with provenance, optionally persist to a per-batch sidecar JSONL. Pure-parser variant exists as internal module.",agents:["architect"]},test_runner:{description:"auto-detect and run tests",agents:["architect","reviewer","test_engineer"]},test_impact:{description:"identify test files impacted by changed source files via import analysis",agents:["architect","reviewer","critic_oversight","test_engineer"]},mutation_test:{description:"executes pre-generated mutation patches against tests, evaluates kill rate against quality gate thresholds",agents:["architect","test_engineer"]},generate_mutants:{description:"generate LLM-based mutation testing patches for source files; returns MutationPatch[] for direct consumption by the mutation_test tool",agents:["architect"]},detect_domains:{description:"detect which SME domains are relevant for a given text",agents:["architect","sme","docs","docs_design","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic","critic_oversight","explorer"]},git_blame:{description:"per-line git blame metadata: sha, author, date, summary for each line in a file",agents:["reviewer","explorer","architect"]},gitingest:{description:"fetch a GitHub repository full content via gitingest.com",agents:["architect","docs","explorer"]},retrieve_summary:{description:"retrieve the full content of a stored tool output summary",agents:["architect","sme","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","spec_writer","reviewer","critic","coder","test_engineer"]},retrieve_lane_output:{description:"retrieve paged full dispatch lane output by output_ref; use before consuming truncated lane previews or routing candidates from lane results",agents:["architect"]},extract_code_blocks:{description:"extract code blocks from text content and save them to files",agents:["docs","docs_design","designer","spec_writer","coder","test_engineer"]},phase_complete:{description:"mark a phase as complete and track dispatched agents",agents:["architect"]},save_plan:{description:"save a structured implementation plan",agents:["architect"]},update_task_status:{description:"mark tasks complete, track phase progress",agents:["architect"]},lint_spec:{description:"validate .swarm/spec.md format and required fields",agents:["architect","spec_writer"]},write_retro:{description:"document phase retrospectives via phase_complete workflow, capture lessons learned",agents:["architect"]},write_drift_evidence:{description:"write drift verification evidence for a completed phase",agents:["architect"]},write_hallucination_evidence:{description:"write hallucination verification evidence for a completed phase",agents:["architect"]},write_mutation_evidence:{description:"write mutation gate evidence for a completed phase; normalizes PASS/WARN/FAIL/SKIP verdicts and writes .swarm/evidence/{phase}/mutation-gate.json",agents:["architect"]},declare_scope:{description:"declare file scope for next coder delegation",agents:["architect"]},knowledge_query:{description:"query swarm or hive knowledge with optional filters",agents:["architect","skill_improver","spec_writer"]},doc_scan:{description:"scan project documentation files and build an index manifest",agents:["architect","docs_design","skill_improver","spec_writer","explorer"]},doc_extract:{description:"extract actionable constraints from project documentation",agents:["architect","docs_design","skill_improver","spec_writer"]},curator_analyze:{description:"run curator phase analysis and optionally apply knowledge recommendations",agents:["architect"]},knowledge_add:{description:"store a new lesson in the knowledge base",agents:["architect","coder"]},knowledge_recall:{description:"search the knowledge base for relevant past decisions",agents:["architect","sme","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","curator_init","curator_phase","skill_improver","spec_writer","reviewer","critic","critic_oversight","explorer","coder","test_engineer"]},knowledge_remove:{description:"delete an outdated swarm knowledge entry by ID (swarm tier only)",agents:["architect"]},co_change_analyzer:{description:"detect hidden couplings by analyzing git history",agents:["architect"]},context_status:{description:"report current context-window headroom for the active session — 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.",agents:["architect"]},search:{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 — use symbols and imports tools for structural queries.",agents:["architect","sme","docs","docs_design","designer","critic_hallucination_verifier","skill_improver","spec_writer","reviewer","critic_oversight","explorer","coder","test_engineer","researcher"]},ast_grep:{description:"Read-only structural AST search using ast-grep patterns with optional language and glob filters. Use for syntax-aware code pattern searches; does not rewrite files.",agents:["architect","sme","docs","docs_design","critic_hallucination_verifier","spec_writer","explorer","coder","test_engineer","researcher"]},actionlint_scan:{description:"Run actionlint against GitHub Actions workflow YAML files with structured findings. Resolves actionlint lazily and does not modify files.",agents:["architect","test_engineer"]},osv_scan:{description:"Run OSV-Scanner against a workspace path and return structured dependency vulnerability findings. Resolves osv-scanner lazily and does not modify files.",agents:["architect","test_engineer"]},gh_evidence:{description:"Fetch bounded GitHub pull request or issue metadata through gh for review and CI evidence. Resolves gh lazily and is read-only.",agents:["architect","researcher"]},batch_symbols:{description:"Batched symbol extraction across multiple files. Returns per-file symbol summaries with isolated error handling.",agents:["architect","critic_hallucination_verifier","reviewer","critic_oversight","explorer"]},suggest_patch:{description:"Reviewer-safe structured patch suggestion tool. Produces context-anchored patch artifacts without file modification. Returns structured diagnostics on context mismatch.",agents:["architect","reviewer"]},req_coverage:{description:"query requirement coverage status for tracked functional requirements",agents:["critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","spec_writer","critic","critic_oversight"]},get_approved_plan:{description:"retrieve the last critic-approved immutable plan snapshot for baseline drift comparison",agents:["critic_drift_verifier","critic","critic_oversight"]},repo_map:{description:"query the repo code graph: importers, dependencies, blast radius, localization, ontology facts, package boundaries, and heuristic preflight packets before refactoring; ontology findings are advisory, not formal proofs",agents:["architect","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","reviewer","critic","critic_oversight","explorer","coder"]},get_qa_gate_profile:{description:"retrieve the QA gate profile for the current plan: gates (reviewer, test_engineer, sme_enabled, critic_pre_plan, sast_enabled, council_mode, hallucination_guard, mutation_test, phase_council, drift_check, final_council), lock state, and profile hash. Read-only.",agents:["architect"]},set_qa_gates:{description:"configure the QA gate profile for the current plan. Architect-only. Ratchet-tighter only — rejected once the profile is locked after critic approval. Supports: reviewer, test_engineer, sme_enabled, critic_pre_plan, sast_enabled, council_mode, hallucination_guard, mutation_test, phase_council, drift_check, final_council.",agents:["architect"]},web_search:{description:"External web search (Tavily or Brave) for architect-driven council research, SME domain research, researcher auto-research, and skill-improver research. Returns titled results with snippets, URLs, normalized query metadata, temporal intent, freshness, and removed stale years. Config-gated on council.general.enabled in the resolved config: global ~/.config/opencode/opencode-swarm.json, then project .opencode/opencode-swarm.json overrides. Requires a search API key. Used by the architect in MODE: COUNCIL to gather a RESEARCH CONTEXT before dispatching council agents, by SME for opt-in external skill/source evaluation, and by the researcher agent for multi-source auto-research.",agents:["sme","researcher","skill_improver"]},web_fetch:{description:"Fetch the readable text of a single http(s) URL (architect-only). Returns decoded page text, document title, final URL after redirects, and an evidence reference. Reads primary sources that web_search only surfaces as snippets. Config-gated on council.general.enabled. Blocks private/loopback/link-local/metadata addresses (re-validated and re-pinned across redirects); enforces timeout and body size cap.",agents:[]},convene_general_council:{description:"Synthesize responses from a multi-model General Council. Accepts parallel member responses (Round 1, optionally Round 2), detects disagreements, and returns consensus points, persisting disagreements, and a structured synthesis. Architect-only. Config-gated on council.general.enabled in the resolved config: global ~/.config/opencode/opencode-swarm.json, then project .opencode/opencode-swarm.json overrides.",agents:[]},write_final_council_evidence:{description:"Persist project-scoped final council evidence to .swarm/evidence/final-council.json. PREREQUISITE: dispatch critic, reviewer, sme, test_engineer, and explorer as project-scoped Agent tasks and collect their CouncilMemberVerdict JSON — this tool synthesizes only. Rejects on insufficient quorum or CONCERNS with unresolved requiredFixes; normalizes verdicts to approved/concerns/rejected. Architect-only.",agents:[]},skill_generate:{description:"compile knowledge entries into a structured SKILL.md draft",agents:["skill_improver"]},skill_list:{description:"list generated skill files and their status",agents:["skill_improver"]},skill_apply:{description:"activate a draft skill proposal",agents:[]},skill_inspect:{description:"inspect the content and source entries of a skill file",agents:["skill_improver"]},run_stale_reconciliation:{description:"reconcile skills against the knowledge store: mark skills stale when source knowledge is archived or deleted, or clear stale markers",agents:["architect"]},skill_regenerate:{description:"regenerate an active skill by re-clustering its source knowledge entries and updating the SKILL.md in place",agents:[]},skill_retire:{description:"retire a generated skill by adding a retired.marker file; retired skills are excluded from scoring and injection",agents:[]},skill_improve:{description:"run the skill_improver agent to review and refine skills",agents:["skill_improver"]},spec_write:{description:"author or update .swarm/spec.md for the current project",agents:["spec_writer"]},knowledge_receipt:{description:"file a receipt for retrieved knowledge (applied/ignored/contradicted + new lessons), recorded as immutable knowledge events",agents:["architect","sme","docs","docs_design","designer","critic_sounding_board","critic_drift_verifier","critic_hallucination_verifier","critic_architecture_supervisor","curator_init","curator_phase","skill_improver","spec_writer","reviewer","critic","coder","test_engineer"]},knowledge_archive:{description:"archive (default), quarantine, or purge a swarm or hive knowledge entry by ID with an immutable audit tombstone; purge requires an admin flag",agents:["architect"]},swarm_memory_recall:{description:"recall scoped Swarm memory for the current repository as untrusted background",agents:[]},swarm_memory_propose:{description:"create a pending Swarm memory proposal; does not write durable memory directly",agents:[]},swarm_command:{description:"run supported /swarm commands through the canonical command registry",agents:["architect","sme","researcher","docs","docs_design","designer","reviewer","critic","explorer","coder","test_engineer"]},dispatch_lanes:{description:"dispatch read-only exploration/review lanes concurrently and BLOCK until all finish; prefer dispatch_lanes_async for non-blocking dispatch, use this only when promptAsync is unavailable",agents:["architect"]},dispatch_lanes_async:{description:"launch read-only advisory lanes non-blockingly and return a batch id plus lane session handles immediately so you can keep working; launch_timeout_ms is only a promptAsync acceptance budget, not a lane runtime timeout; poll incrementally with collect_lane_results (wait omitted or false) while doing independent investigation, or join with wait: true when you need all results",agents:["architect"]},collect_lane_results:{description:"collect or poll results for a dispatch_lanes_async batch; supports both non-blocking polling (wait omitted or false) and blocking join (wait: true). Non-blocking polls include pending lane identities by default and process settled lanes incrementally while continuing independent work; busy/retry lanes are not timed out just because they run for a long time. Does not advance workflow gates.",agents:["architect"]},summarize_work:{description:"emit a short structured summary of completed work (key decisions, assumptions, risks, constraints) at task completion; rolls up per phase for architecture-supervisor review. Advisory, never blocks.",agents:["architect","sme","researcher","docs","docs_design","designer","explorer","coder","test_engineer"]},write_architecture_supervisor_evidence:{description:"persist the architecture supervisor verdict for a phase (architect MUST dispatch critic_architecture_supervisor first and collect its JSON verdict; this tool persists only, it does not contact the supervisor)",agents:["architect"]},lean_turbo_plan_lanes:{description:"partition phase tasks into parallel lanes based on file-scope conflicts for Lean Turbo execution",agents:[]},lean_turbo_acquire_locks:{description:"acquire file locks for all files in a lane (all-or-nothing) before lane execution",agents:[]},lean_turbo_runner_status:{description:"read Lean Turbo run state from .swarm/turbo-state.json",agents:[]},lean_turbo_review:{description:"dispatch a read-only reviewer agent to evaluate a completed Lean Turbo phase",agents:[]},lean_turbo_run_phase:{description:"Execute a phase using Lean Turbo parallel lane execution. Plans lanes, acquires file locks, and dispatches coder agents concurrently. Use when Lean Turbo is active and you want to execute all tasks in a phase in parallel lanes.",agents:[]},lean_turbo_status:{description:"returns Lean Turbo configuration and active status for the current session",agents:[]},swarm_apply_patch:{description:"Apply a unified diff patch to workspace files with exact context matching, atomic writes, and path validation. Use standard unified diff format only — does NOT support *** Begin Patch / *** Update File payloads (use native apply_patch for those).",agents:["coder","test_engineer"]},external_skill_discover:{description:"Discover external skill candidates from configured sources. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_list:{description:"List external skill candidates in the quarantine store. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_inspect:{description:"Inspect a specific external skill candidate by ID. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_promote:{description:"Promote a validated external skill candidate to an active generated skill. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_reject:{description:"Reject an external skill candidate after evaluation. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_delete:{description:"Delete an external skill candidate from the quarantine store. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},external_skill_revoke:{description:"Revoke a previously promoted external skill. Returns a disabled message when external_skills.curation_enabled is false.",agents:[]},epic_decide_phase:{description:"Compute the Epic Mode verdict for a phase WITHOUT dispatching coders. Runs preflight + calibration + the three gates (p-threshold, hot-module, greenfield), persists the decision, and returns the verdict so the architect can dispatch waves via the visible Task tool (promote) or fall back to per-task serial (demote). Pair with `epic_plan_waves` to get the wave plan when promoted. Use when /swarm epic is on for the session.",agents:["architect"]},epic_plan_waves:{description:"Partition a phase's pending tasks into ordered concurrent waves for Epic Mode dispatch. A wave is a set of tasks with mutually disjoint declared scopes and all dependencies satisfied by prior waves. Returns `{ waves: [{ waveId, taskIds, files }, ...], serializedTasks, degradedTasks }`. "+'For each wave in order, the architect dispatches one `Task(subagent_type="coder", ...)` per `taskId` — all in one assistant message — so the wave runs concurrently and each coder appears as a visible subagent. '+"Wait for the wave to finish before dispatching the next. Pair with `epic_decide_phase` (called first; this tool is only relevant on a `promote` verdict). "+"Preflight reject reasons: `no-plan`, `no-phase`, `phase-empty`, `phase-already-complete`, `scopes-missing` (call `declare_scope` for `missingScopes`), `git-failed` (transient — retry), `planner-error`.",agents:["architect"]},epic_record_divergence:{description:"After every `update_task_status(completed)`, record the task's declared-vs-actual divergence to .swarm/epic/divergence.jsonl. Feeds Epic Mode's self-calibration loop (Capability D). Best-effort: never blocks.",agents:["architect"]}},TOOL_NAMES=Object.keys(TOOL_METADATA),TOOL_NAME_SET=new Set(TOOL_NAMES),TOOL_DESCRIPTIONS=Object.fromEntries(Object.entries(TOOL_METADATA).map(([name,meta])=>[name,meta.description])),AGENT_TOOL_MAP=(()=>{let map=Object.fromEntries(ALL_AGENT_NAMES.map((agent)=>[agent,[]]));for(let[name,meta]of Object.entries(TOOL_METADATA))for(let agent of meta.agents)map[agent].push(name);return map})()});function deepMergeInternal(base,override,depth){if(depth>=10)throw Error("deepMerge exceeded maximum depth of 10");let result={...base};for(let key of Object.keys(override)){let baseVal=base[key],overrideVal=override[key];if(typeof baseVal==="object"&&baseVal!==null&&typeof overrideVal==="object"&&overrideVal!==null&&!Array.isArray(baseVal)&&!Array.isArray(overrideVal))result[key]=deepMergeInternal(baseVal,overrideVal,depth+1);else result[key]=overrideVal}return result}function deepMerge(base,override){if(!base)return override;if(!override)return base;return deepMergeInternal(base,override,0)}function freezeSet(items){let set=new Set(items),proxy=new Proxy(set,{get(target,prop){if(prop==="add"||prop==="delete"||prop==="clear")return()=>{throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")};if(prop==="forEach")return(callback,thisArg)=>{let wrapped=(v,k)=>callback.call(thisArg??void 0,v,k,proxy);return set.forEach(wrapped)};let value=Reflect.get(target,prop);return typeof value==="function"?value.bind(target):value},set(){throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")},deleteProperty(){throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")},defineProperty(){throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")},setPrototypeOf(){throw TypeError("CLAUDE_CODE_NATIVE_COMMANDS is readonly")}});return proxy}function isQAAgent(name){return QA_AGENTS.includes(name)}function isSubagent(name){return ALL_SUBAGENT_NAMES.includes(name)}function isLowCapabilityModel(modelId){let lower=(modelId||"").toLowerCase();return LOW_CAPABILITY_MODELS.some((substr)=>lower.includes(substr))}var OPENCODE_NATIVE_AGENTS,CLAUDE_CODE_NATIVE_COMMANDS,MEMORY_AGENT_TOOL_MAP,EXTERNAL_SKILL_TOOL_NAMES,EXTERNAL_SKILL_AGENT_TOOL_MAP,COUNCIL_TOOL_NAMES,COUNCIL_AGENT_TOOL_MAP,GENERAL_COUNCIL_TOOL_NAMES,GENERAL_COUNCIL_AGENT_TOOL_MAP,TURBO_TOOL_NAMES,TURBO_AGENT_TOOL_MAP,SKILL_TOOL_NAMES,SKILL_AGENT_TOOL_MAP,WRITE_TOOL_NAMES,DEFAULT_MODELS,DEFAULT_SCORING_CONFIG,LOW_CAPABILITY_MODELS,TURBO_MODE_BANNER=`## \uD83D\uDE80 TURBO MODE ACTIVE
2
2
 
3
3
  **Speed optimization enabled for this session.**
4
4
 
@@ -1689,7 +1689,7 @@ ${USAGE5}`;let councilFlag=parsed.council?"council=true":"council=false",signal=
1689
1689
  `)}let repoFullName=`${prInfo.owner}/${prInfo.repo}`,prUrl=`https://github.com/${prInfo.owner}/${prInfo.repo}/pull/${prInfo.number}`;try{let correlationId=_internals67.buildCorrelationId(sessionID,repoFullName,prInfo.number);if(!await _internals67.unsubscribe(directory,correlationId))return[`Not subscribed to ${prUrl}`,`Session: ${sessionID}`,`PR: ${repoFullName}#${prInfo.number}`,"","No active subscription found for this session and PR.","Use /swarm pr subscribe to start monitoring."].join(`
1690
1690
  `);return[`Unsubscribed from ${prUrl}`,`Session: ${sessionID}`,`PR: ${repoFullName}#${prInfo.number}`,"","The background PR monitor will no longer check this PR for","the current session. Use /swarm pr subscribe to re-subscribe."].join(`
1691
1691
  `)}catch(err){let message=err instanceof Error?err.message:String(err);return[`Error: Failed to unsubscribe from ${prUrl}`,"",message].join(`
1692
- `)}}var _internals67;var init_pr_unsubscribe=__esm(()=>{init_pr_subscriptions();init_pr_ref();_internals67={unsubscribe,buildCorrelationId,parsePrRef,looksLikePrRef}});import*as fs43 from"node:fs";import*as path99 from"node:path";function containsPathTraversal(str){if(/\.\.[/\\]/.test(str))return!0;if(/(?:^|[/\\])\.\.(?:[/\\]|$)/.test(str))return!0;if(/%2e%2e/i.test(str))return!0;if(/%2e\./i.test(str))return!0;if(/%2e/i.test(str)&&/\.\./.test(str))return!0;if(/%252e%252e/i.test(str))return!0;if(/\uff0e/.test(str))return!0;if(/\u3002/.test(str))return!0;if(/\uff65/.test(str))return!0;if(/%2f/i.test(str))return!0;if(/%5c/i.test(str))return!0;return!1}function containsControlChars(str){for(let ch of str){let code=ch.codePointAt(0);if(code===void 0)continue;if(code<=31||code>=127&&code<=159)return!0;if(code>=8234&&code<=8238)return!0;if(code>=8294&&code<=8297)return!0}return!1}function validateDirectory(directory){if(!directory||directory.trim()==="")throw Error("Invalid directory: empty");if(containsPathTraversal(directory))throw Error("Invalid directory: path traversal detected");if(containsControlChars(directory))throw Error("Invalid directory: control characters detected");if(directory.startsWith("/")||directory.startsWith("\\"))throw Error("Invalid directory: absolute path");if(/^[A-Za-z]:[/\\]/.test(directory))throw Error("Invalid directory: Windows absolute path")}function validateSymlinkBoundary(targetPath,rootPath){let realTarget;try{realTarget=fs43.realpathSync(targetPath)}catch{realTarget=path99.normalize(targetPath)}let realRoot;try{realRoot=fs43.realpathSync(rootPath)}catch{realRoot=path99.normalize(rootPath)}let normalizedTarget=path99.normalize(realTarget),normalizedRoot=path99.normalize(realRoot);if(!normalizedTarget.startsWith(normalizedRoot+path99.sep)&&normalizedTarget!==normalizedRoot)throw Error(`Symlink resolution escaped boundary: ${realTarget} is not within ${realRoot}`)}function isCanonicalPathWithinRoot(targetPath,rootPath){let canonicalRoot;try{canonicalRoot=fs43.realpathSync(rootPath)}catch{canonicalRoot=path99.normalize(rootPath)}let probe2=path99.normalize(targetPath);for(let i=0;i<4096;i++)try{let canonicalProbe=fs43.realpathSync(probe2),relative20=path99.relative(canonicalRoot,canonicalProbe);return!relative20.startsWith("..")&&!path99.isAbsolute(relative20)}catch{let parent=path99.dirname(probe2);if(parent===probe2)return!1;probe2=parent}return!1}function validateTargetWithinRoot(filePath,root){if(!filePath||filePath.trim()==="")return"Empty path";if(path99.isAbsolute(filePath)||/^[A-Za-z]:[/\\]/.test(filePath))return`Absolute path rejected: ${filePath}`;if(containsPathTraversal(filePath))return`Path traversal detected: ${filePath}`;if(containsControlChars(filePath))return`Control characters detected in path: ${filePath}`;let resolved=path99.resolve(root,filePath),relative20=path99.relative(root,resolved);if(relative20.startsWith("..")||path99.isAbsolute(relative20))return`Path escapes root: ${filePath}`;if(!isCanonicalPathWithinRoot(resolved,root))return`Path escapes root via symlink/junction: ${filePath}`;return null}var init_path_security=()=>{};import*as fs44 from"node:fs";import*as path100 from"node:path";function validateArgs(args2){if(typeof args2!=="object"||args2===null)return!1;let obj=args2;if(obj.mode!=="fix"&&obj.mode!=="check")return!1;return!0}function getLinterCommand(linter,mode,projectDir){let isWindows=process.platform==="win32",binDir=path100.join(projectDir,"node_modules",".bin"),biomeBin=isWindows?path100.join(binDir,"biome.EXE"):path100.join(binDir,"biome"),eslintBin=isWindows?path100.join(binDir,"eslint.cmd"):path100.join(binDir,"eslint");switch(linter){case"biome":if(mode==="fix")return isWindows?[biomeBin,"check","--write","."]:[biomeBin,"check","--write","."];return isWindows?[biomeBin,"check","."]:[biomeBin,"check","."];case"eslint":if(mode==="fix")return isWindows?[eslintBin,".","--fix"]:[eslintBin,".","--fix"];return isWindows?[eslintBin,"."]:[eslintBin,"."]}}function getAdditionalLinterCommand(linter,mode,cwd){let gradlewName=process.platform==="win32"?"gradlew.bat":"gradlew",gradlew=fs44.existsSync(path100.join(cwd,gradlewName))?path100.join(cwd,gradlewName):null;switch(linter){case"ruff":return mode==="fix"?["ruff","check","--fix","."]:["ruff","check","."];case"clippy":return mode==="fix"?["cargo","clippy","--fix","--allow-dirty"]:["cargo","clippy"];case"golangci-lint":return mode==="fix"?["golangci-lint","run","--fix"]:["golangci-lint","run"];case"checkstyle":if(gradlew)return[gradlew,"checkstyleMain"];if(isCommandAvailable("gradle"))return["gradle","checkstyleMain"];return["mvn","checkstyle:check"];case"ktlint":return mode==="fix"?["ktlint","--format"]:["ktlint"];case"dotnet-format":return mode==="fix"?["dotnet","format"]:["dotnet","format","--verify-no-changes"];case"cppcheck":return["cppcheck","--enable=all","."];case"swiftlint":return mode==="fix"?["swiftlint","--fix"]:["swiftlint"];case"dart-analyze":return mode==="fix"?["dart","fix"]:["dart","analyze"];case"rubocop":{let base=isCommandAvailable("bundle")?["bundle","exec","rubocop"]:["rubocop"];return mode==="fix"?[...base,"-A"]:base}case"phpstan":return[phpVendorBin(cwd,"phpstan"),"analyse"];case"pint":return mode==="fix"?[phpVendorBin(cwd,"pint")]:[phpVendorBin(cwd,"pint"),"--test"];case"php-cs-fixer":return mode==="fix"?[phpVendorBin(cwd,"php-cs-fixer"),"fix"]:[phpVendorBin(cwd,"php-cs-fixer"),"fix","--dry-run","--diff"];case"phpcs":return[phpVendorBin(cwd,"phpcs")]}}function detectRuff(cwd){if(fs44.existsSync(path100.join(cwd,"ruff.toml")))return isCommandAvailable("ruff");try{let pyproject=path100.join(cwd,"pyproject.toml");if(fs44.existsSync(pyproject)){if(fs44.readFileSync(pyproject,"utf-8").includes("[tool.ruff]"))return isCommandAvailable("ruff")}}catch{}return!1}function detectClippy(cwd){return fs44.existsSync(path100.join(cwd,"Cargo.toml"))&&isCommandAvailable("cargo")}function detectGolangciLint(cwd){return fs44.existsSync(path100.join(cwd,"go.mod"))&&isCommandAvailable("golangci-lint")}function readTextFileSafe(filePath){try{return fs44.readFileSync(filePath,"utf-8")}catch{return""}}function phpVendorBin(_cwd,name){let fileName=process.platform==="win32"?`${name}.bat`:name;return path100.join("vendor","bin",fileName)}function phpVendorBinExists(cwd,name){let local=path100.join(cwd,"vendor","bin",name),localWin=path100.join(cwd,"vendor","bin",`${name}.bat`);return fs44.existsSync(local)||fs44.existsSync(localWin)}function detectCheckstyle(cwd){let hasMaven=fs44.existsSync(path100.join(cwd,"pom.xml")),gradleFiles=["build.gradle","build.gradle.kts"].map((file3)=>path100.join(cwd,file3)).filter((file3)=>fs44.existsSync(file3)),hasGradleCheckstyleSignal=fs44.existsSync(path100.join(cwd,"checkstyle.xml"))||fs44.existsSync(path100.join(cwd,"config","checkstyle","checkstyle.xml"))||gradleFiles.some((file3)=>/\bcheckstyle\b/i.test(readTextFileSafe(file3))),hasBinary=hasMaven&&isCommandAvailable("mvn")||hasGradleCheckstyleSignal&&(fs44.existsSync(path100.join(cwd,"gradlew"))||isCommandAvailable("gradle"));return(hasMaven||hasGradleCheckstyleSignal)&&hasBinary}function hasRootKotlinFile(cwd){try{return fs44.readdirSync(cwd).some((f)=>f.endsWith(".kt")||f.endsWith(".kts"))}catch{return!1}}function buildGradleHasKotlinSignal(cwd){let content=readTextFileSafe(path100.join(cwd,"build.gradle"));return/\b(kotlin|org\.jetbrains\.kotlin|ktlint)\b/i.test(content)}function detectKtlint(cwd){return(fs44.existsSync(path100.join(cwd,"build.gradle.kts"))||fs44.existsSync(path100.join(cwd,"build.gradle"))&&buildGradleHasKotlinSignal(cwd)||hasRootKotlinFile(cwd))&&isCommandAvailable("ktlint")}function detectPhpLinter(cwd){if((fs44.existsSync(path100.join(cwd,"phpstan.neon"))||fs44.existsSync(path100.join(cwd,"phpstan.neon.dist")))&&phpVendorBinExists(cwd,"phpstan"))return"phpstan";if(fs44.existsSync(path100.join(cwd,"pint.json"))&&phpVendorBinExists(cwd,"pint"))return"pint";if(fs44.existsSync(path100.join(cwd,".php-cs-fixer.php"))&&phpVendorBinExists(cwd,"php-cs-fixer"))return"php-cs-fixer";if(fs44.existsSync(path100.join(cwd,"phpcs.xml"))&&phpVendorBinExists(cwd,"phpcs"))return"phpcs";return null}function detectDotnetFormat(cwd){try{return fs44.readdirSync(cwd).some((f)=>f.endsWith(".csproj")||f.endsWith(".sln"))&&isCommandAvailable("dotnet")}catch{return!1}}function detectCppcheck(cwd){if(fs44.existsSync(path100.join(cwd,"CMakeLists.txt")))return isCommandAvailable("cppcheck");try{return[cwd,path100.join(cwd,"src")].some((dir)=>{try{return fs44.readdirSync(dir).some((f)=>/\.(c|cpp|cc|cxx|h|hpp)$/.test(f))}catch{return!1}})&&isCommandAvailable("cppcheck")}catch{return!1}}function detectSwiftlint(cwd){return fs44.existsSync(path100.join(cwd,"Package.swift"))&&isCommandAvailable("swiftlint")}function detectDartAnalyze(cwd){return fs44.existsSync(path100.join(cwd,"pubspec.yaml"))&&(isCommandAvailable("dart")||isCommandAvailable("flutter"))}function detectRubocop(cwd){return(fs44.existsSync(path100.join(cwd,"Gemfile"))||fs44.existsSync(path100.join(cwd,"gems.rb"))||fs44.existsSync(path100.join(cwd,".rubocop.yml")))&&(isCommandAvailable("rubocop")||isCommandAvailable("bundle"))}function detectAdditionalLinter(cwd){if(detectRuff(cwd))return"ruff";if(detectClippy(cwd))return"clippy";if(detectGolangciLint(cwd))return"golangci-lint";let phpLinter=detectPhpLinter(cwd);if(phpLinter)return phpLinter;if(detectKtlint(cwd))return"ktlint";if(detectCheckstyle(cwd))return"checkstyle";if(detectDotnetFormat(cwd))return"dotnet-format";if(detectCppcheck(cwd))return"cppcheck";if(detectSwiftlint(cwd))return"swiftlint";if(detectDartAnalyze(cwd))return"dart-analyze";if(detectRubocop(cwd))return"rubocop";return null}function resolveLinterBinPath(linter,projectDir){let isWindows=process.platform==="win32",binName=linter==="biome"?isWindows?"biome.EXE":"biome":isWindows?"eslint.cmd":"eslint",localBin=path100.join(projectDir,"node_modules",".bin",binName);if(fs44.existsSync(localBin))return localBin;let ancestor=findBinInAncestors(path100.dirname(projectDir),binName);if(ancestor)return ancestor;let fromPath=findBinInEnvPath(binName);if(fromPath)return fromPath;return localBin}function findBinInAncestors(startDir,binName){let dir=startDir;while(!0){let candidate=path100.join(dir,"node_modules",".bin",binName);if(fs44.existsSync(candidate))return candidate;let parent=path100.dirname(dir);if(parent===dir)break;dir=parent}return null}function findBinInEnvPath(binName){let searchPath=process.env.PATH??"";for(let dir of searchPath.split(path100.delimiter)){if(!dir)continue;let candidate=path100.join(dir,binName);if(fs44.existsSync(candidate))return candidate}return null}async function detectAvailableLinter(directory){if(!directory)return null;if(!fs44.existsSync(directory))return null;let projectDir=directory,isWindows=process.platform==="win32",biomeBin=isWindows?path100.join(projectDir,"node_modules",".bin","biome.EXE"):path100.join(projectDir,"node_modules",".bin","biome"),eslintBin=isWindows?path100.join(projectDir,"node_modules",".bin","eslint.cmd"):path100.join(projectDir,"node_modules",".bin","eslint"),localResult=await _detectAvailableLinter(projectDir,biomeBin,eslintBin);if(localResult)return localResult;let biomeAncestor=findBinInAncestors(path100.dirname(projectDir),isWindows?"biome.EXE":"biome"),eslintAncestor=findBinInAncestors(path100.dirname(projectDir),isWindows?"eslint.cmd":"eslint");if(biomeAncestor||eslintAncestor)return _detectAvailableLinter(projectDir,biomeAncestor??biomeBin,eslintAncestor??eslintBin);let pathBiome=findBinInEnvPath(isWindows?"biome.EXE":"biome"),pathEslint=findBinInEnvPath(isWindows?"eslint.cmd":"eslint");if(pathBiome||pathEslint)return _detectAvailableLinter(projectDir,pathBiome??biomeBin,pathEslint??eslintBin);return null}async function _detectAvailableLinter(_projectDir,biomeBin,eslintBin){try{let biomeProc=bunSpawn([biomeBin,"--version"],{stdout:"pipe",stderr:"pipe"}),biomeExit=biomeProc.exited,timeout=new Promise((resolve41)=>setTimeout(()=>resolve41("timeout"),2000));if(await Promise.race([biomeExit,timeout])==="timeout")biomeProc.kill();else if(biomeProc.exitCode===0&&fs44.existsSync(biomeBin))return"biome"}catch{}try{let eslintProc=bunSpawn([eslintBin,"--version"],{stdout:"pipe",stderr:"pipe"}),eslintExit=eslintProc.exited,timeout=new Promise((resolve41)=>setTimeout(()=>resolve41("timeout"),2000));if(await Promise.race([eslintExit,timeout])==="timeout")eslintProc.kill();else if(eslintProc.exitCode===0&&fs44.existsSync(eslintBin))return"eslint"}catch{}return null}async function runLint(linter,mode,directory){let command=getLinterCommand(linter,mode,directory);if(command.join(" ").length>MAX_COMMAND_LENGTH)return{success:!1,mode,linter,command,error:"Command exceeds maximum allowed length"};try{let proc=bunSpawn(command,{stdout:"pipe",stderr:"pipe",cwd:directory}),[stdout,stderr]=await Promise.all([proc.stdout.text(),proc.stderr.text()]),exitCode=await proc.exited,output=stdout;if(stderr)output+=(output?`
1692
+ `)}}var _internals67;var init_pr_unsubscribe=__esm(()=>{init_pr_subscriptions();init_pr_ref();_internals67={unsubscribe,buildCorrelationId,parsePrRef,looksLikePrRef}});import*as fs43 from"node:fs";import*as path99 from"node:path";function containsPathTraversal(str){if(/\.\.[/\\]/.test(str))return!0;if(/(?:^|[/\\])\.\.(?:[/\\]|$)/.test(str))return!0;if(/%2e%2e/i.test(str))return!0;if(/%2e\./i.test(str))return!0;if(/%2e/i.test(str)&&/\.\./.test(str))return!0;if(/%252e%252e/i.test(str))return!0;if(/\uff0e/.test(str))return!0;if(/\u3002/.test(str))return!0;if(/\uff65/.test(str))return!0;if(/%2f/i.test(str))return!0;if(/%5c/i.test(str))return!0;return!1}function containsControlChars(str){for(let ch of str){let code=ch.codePointAt(0);if(code===void 0)continue;if(code<=31||code>=127&&code<=159)return!0;if(code>=8234&&code<=8238)return!0;if(code>=8294&&code<=8297)return!0}return!1}function validateDirectory(directory){if(!directory||directory.trim()==="")throw Error("Invalid directory: empty");if(containsPathTraversal(directory))throw Error("Invalid directory: path traversal detected");if(containsControlChars(directory))throw Error("Invalid directory: control characters detected");if(directory.startsWith("/")||directory.startsWith("\\"))throw Error("Invalid directory: absolute path");if(/^[A-Za-z]:[/\\]/.test(directory))throw Error("Invalid directory: Windows absolute path")}function validateSymlinkBoundary(targetPath,rootPath){let realTarget;try{realTarget=fs43.realpathSync(targetPath)}catch{realTarget=path99.resolve(targetPath)}let realRoot;try{realRoot=fs43.realpathSync(rootPath)}catch{realRoot=path99.resolve(rootPath)}let normalizedTarget=path99.normalize(realTarget),normalizedRoot=path99.normalize(realRoot);if(!normalizedTarget.startsWith(normalizedRoot+path99.sep)&&normalizedTarget!==normalizedRoot)throw Error(`Symlink resolution escaped boundary: ${realTarget} is not within ${realRoot}`)}function isCanonicalPathWithinRoot(targetPath,rootPath){let canonicalRoot;try{canonicalRoot=fs43.realpathSync(rootPath)}catch{canonicalRoot=path99.normalize(rootPath)}let probe2=path99.normalize(targetPath);for(let i=0;i<4096;i++)try{let canonicalProbe=fs43.realpathSync(probe2),relative20=path99.relative(canonicalRoot,canonicalProbe);return!relative20.startsWith("..")&&!path99.isAbsolute(relative20)}catch{let parent=path99.dirname(probe2);if(parent===probe2)return!1;probe2=parent}return!1}function validateTargetWithinRoot(filePath,root){if(!filePath||filePath.trim()==="")return"Empty path";if(path99.isAbsolute(filePath)||/^[A-Za-z]:[/\\]/.test(filePath))return`Absolute path rejected: ${filePath}`;if(containsPathTraversal(filePath))return`Path traversal detected: ${filePath}`;if(containsControlChars(filePath))return`Control characters detected in path: ${filePath}`;let resolved=path99.resolve(root,filePath),relative20=path99.relative(root,resolved);if(relative20.startsWith("..")||path99.isAbsolute(relative20))return`Path escapes root: ${filePath}`;if(!isCanonicalPathWithinRoot(resolved,root))return`Path escapes root via symlink/junction: ${filePath}`;return null}var init_path_security=()=>{};import*as fs44 from"node:fs";import*as path100 from"node:path";function validateArgs(args2){if(typeof args2!=="object"||args2===null)return!1;let obj=args2;if(obj.mode!=="fix"&&obj.mode!=="check")return!1;return!0}function getLinterCommand(linter,mode,projectDir){let isWindows=process.platform==="win32",binDir=path100.join(projectDir,"node_modules",".bin"),biomeBin=isWindows?path100.join(binDir,"biome.EXE"):path100.join(binDir,"biome"),eslintBin=isWindows?path100.join(binDir,"eslint.cmd"):path100.join(binDir,"eslint");switch(linter){case"biome":if(mode==="fix")return isWindows?[biomeBin,"check","--write","."]:[biomeBin,"check","--write","."];return isWindows?[biomeBin,"check","."]:[biomeBin,"check","."];case"eslint":if(mode==="fix")return isWindows?[eslintBin,".","--fix"]:[eslintBin,".","--fix"];return isWindows?[eslintBin,"."]:[eslintBin,"."]}}function getAdditionalLinterCommand(linter,mode,cwd){let gradlewName=process.platform==="win32"?"gradlew.bat":"gradlew",gradlew=fs44.existsSync(path100.join(cwd,gradlewName))?path100.join(cwd,gradlewName):null;switch(linter){case"ruff":return mode==="fix"?["ruff","check","--fix","."]:["ruff","check","."];case"clippy":return mode==="fix"?["cargo","clippy","--fix","--allow-dirty"]:["cargo","clippy"];case"golangci-lint":return mode==="fix"?["golangci-lint","run","--fix"]:["golangci-lint","run"];case"checkstyle":if(gradlew)return[gradlew,"checkstyleMain"];if(isCommandAvailable("gradle"))return["gradle","checkstyleMain"];return["mvn","checkstyle:check"];case"ktlint":return mode==="fix"?["ktlint","--format"]:["ktlint"];case"dotnet-format":return mode==="fix"?["dotnet","format"]:["dotnet","format","--verify-no-changes"];case"cppcheck":return["cppcheck","--enable=all","."];case"swiftlint":return mode==="fix"?["swiftlint","--fix"]:["swiftlint"];case"dart-analyze":return mode==="fix"?["dart","fix"]:["dart","analyze"];case"rubocop":{let base=isCommandAvailable("bundle")?["bundle","exec","rubocop"]:["rubocop"];return mode==="fix"?[...base,"-A"]:base}case"phpstan":return[phpVendorBin(cwd,"phpstan"),"analyse"];case"pint":return mode==="fix"?[phpVendorBin(cwd,"pint")]:[phpVendorBin(cwd,"pint"),"--test"];case"php-cs-fixer":return mode==="fix"?[phpVendorBin(cwd,"php-cs-fixer"),"fix"]:[phpVendorBin(cwd,"php-cs-fixer"),"fix","--dry-run","--diff"];case"phpcs":return[phpVendorBin(cwd,"phpcs")]}}function detectRuff(cwd){if(fs44.existsSync(path100.join(cwd,"ruff.toml")))return isCommandAvailable("ruff");try{let pyproject=path100.join(cwd,"pyproject.toml");if(fs44.existsSync(pyproject)){if(fs44.readFileSync(pyproject,"utf-8").includes("[tool.ruff]"))return isCommandAvailable("ruff")}}catch{}return!1}function detectClippy(cwd){return fs44.existsSync(path100.join(cwd,"Cargo.toml"))&&isCommandAvailable("cargo")}function detectGolangciLint(cwd){return fs44.existsSync(path100.join(cwd,"go.mod"))&&isCommandAvailable("golangci-lint")}function readTextFileSafe(filePath){try{return fs44.readFileSync(filePath,"utf-8")}catch{return""}}function phpVendorBin(_cwd,name){let fileName=process.platform==="win32"?`${name}.bat`:name;return path100.join("vendor","bin",fileName)}function phpVendorBinExists(cwd,name){let local=path100.join(cwd,"vendor","bin",name),localWin=path100.join(cwd,"vendor","bin",`${name}.bat`);return fs44.existsSync(local)||fs44.existsSync(localWin)}function detectCheckstyle(cwd){let hasMaven=fs44.existsSync(path100.join(cwd,"pom.xml")),gradleFiles=["build.gradle","build.gradle.kts"].map((file3)=>path100.join(cwd,file3)).filter((file3)=>fs44.existsSync(file3)),hasGradleCheckstyleSignal=fs44.existsSync(path100.join(cwd,"checkstyle.xml"))||fs44.existsSync(path100.join(cwd,"config","checkstyle","checkstyle.xml"))||gradleFiles.some((file3)=>/\bcheckstyle\b/i.test(readTextFileSafe(file3))),hasBinary=hasMaven&&isCommandAvailable("mvn")||hasGradleCheckstyleSignal&&(fs44.existsSync(path100.join(cwd,"gradlew"))||isCommandAvailable("gradle"));return(hasMaven||hasGradleCheckstyleSignal)&&hasBinary}function hasRootKotlinFile(cwd){try{return fs44.readdirSync(cwd).some((f)=>f.endsWith(".kt")||f.endsWith(".kts"))}catch{return!1}}function buildGradleHasKotlinSignal(cwd){let content=readTextFileSafe(path100.join(cwd,"build.gradle"));return/\b(kotlin|org\.jetbrains\.kotlin|ktlint)\b/i.test(content)}function detectKtlint(cwd){return(fs44.existsSync(path100.join(cwd,"build.gradle.kts"))||fs44.existsSync(path100.join(cwd,"build.gradle"))&&buildGradleHasKotlinSignal(cwd)||hasRootKotlinFile(cwd))&&isCommandAvailable("ktlint")}function detectPhpLinter(cwd){if((fs44.existsSync(path100.join(cwd,"phpstan.neon"))||fs44.existsSync(path100.join(cwd,"phpstan.neon.dist")))&&phpVendorBinExists(cwd,"phpstan"))return"phpstan";if(fs44.existsSync(path100.join(cwd,"pint.json"))&&phpVendorBinExists(cwd,"pint"))return"pint";if(fs44.existsSync(path100.join(cwd,".php-cs-fixer.php"))&&phpVendorBinExists(cwd,"php-cs-fixer"))return"php-cs-fixer";if(fs44.existsSync(path100.join(cwd,"phpcs.xml"))&&phpVendorBinExists(cwd,"phpcs"))return"phpcs";return null}function detectDotnetFormat(cwd){try{return fs44.readdirSync(cwd).some((f)=>f.endsWith(".csproj")||f.endsWith(".sln"))&&isCommandAvailable("dotnet")}catch{return!1}}function detectCppcheck(cwd){if(fs44.existsSync(path100.join(cwd,"CMakeLists.txt")))return isCommandAvailable("cppcheck");try{return[cwd,path100.join(cwd,"src")].some((dir)=>{try{return fs44.readdirSync(dir).some((f)=>/\.(c|cpp|cc|cxx|h|hpp)$/.test(f))}catch{return!1}})&&isCommandAvailable("cppcheck")}catch{return!1}}function detectSwiftlint(cwd){return fs44.existsSync(path100.join(cwd,"Package.swift"))&&isCommandAvailable("swiftlint")}function detectDartAnalyze(cwd){return fs44.existsSync(path100.join(cwd,"pubspec.yaml"))&&(isCommandAvailable("dart")||isCommandAvailable("flutter"))}function detectRubocop(cwd){return(fs44.existsSync(path100.join(cwd,"Gemfile"))||fs44.existsSync(path100.join(cwd,"gems.rb"))||fs44.existsSync(path100.join(cwd,".rubocop.yml")))&&(isCommandAvailable("rubocop")||isCommandAvailable("bundle"))}function detectAdditionalLinter(cwd){if(detectRuff(cwd))return"ruff";if(detectClippy(cwd))return"clippy";if(detectGolangciLint(cwd))return"golangci-lint";let phpLinter=detectPhpLinter(cwd);if(phpLinter)return phpLinter;if(detectKtlint(cwd))return"ktlint";if(detectCheckstyle(cwd))return"checkstyle";if(detectDotnetFormat(cwd))return"dotnet-format";if(detectCppcheck(cwd))return"cppcheck";if(detectSwiftlint(cwd))return"swiftlint";if(detectDartAnalyze(cwd))return"dart-analyze";if(detectRubocop(cwd))return"rubocop";return null}function resolveLinterBinPath(linter,projectDir){let isWindows=process.platform==="win32",binName=linter==="biome"?isWindows?"biome.EXE":"biome":isWindows?"eslint.cmd":"eslint",localBin=path100.join(projectDir,"node_modules",".bin",binName);if(fs44.existsSync(localBin))return localBin;let ancestor=findBinInAncestors(path100.dirname(projectDir),binName);if(ancestor)return ancestor;let fromPath=findBinInEnvPath(binName);if(fromPath)return fromPath;return localBin}function findBinInAncestors(startDir,binName){let dir=startDir;while(!0){let candidate=path100.join(dir,"node_modules",".bin",binName);if(fs44.existsSync(candidate))return candidate;let parent=path100.dirname(dir);if(parent===dir)break;dir=parent}return null}function findBinInEnvPath(binName){let searchPath=process.env.PATH??"";for(let dir of searchPath.split(path100.delimiter)){if(!dir)continue;let candidate=path100.join(dir,binName);if(fs44.existsSync(candidate))return candidate}return null}async function detectAvailableLinter(directory){if(!directory)return null;if(!fs44.existsSync(directory))return null;let projectDir=directory,isWindows=process.platform==="win32",biomeBin=isWindows?path100.join(projectDir,"node_modules",".bin","biome.EXE"):path100.join(projectDir,"node_modules",".bin","biome"),eslintBin=isWindows?path100.join(projectDir,"node_modules",".bin","eslint.cmd"):path100.join(projectDir,"node_modules",".bin","eslint"),localResult=await _detectAvailableLinter(projectDir,biomeBin,eslintBin);if(localResult)return localResult;let biomeAncestor=findBinInAncestors(path100.dirname(projectDir),isWindows?"biome.EXE":"biome"),eslintAncestor=findBinInAncestors(path100.dirname(projectDir),isWindows?"eslint.cmd":"eslint");if(biomeAncestor||eslintAncestor)return _detectAvailableLinter(projectDir,biomeAncestor??biomeBin,eslintAncestor??eslintBin);let pathBiome=findBinInEnvPath(isWindows?"biome.EXE":"biome"),pathEslint=findBinInEnvPath(isWindows?"eslint.cmd":"eslint");if(pathBiome||pathEslint)return _detectAvailableLinter(projectDir,pathBiome??biomeBin,pathEslint??eslintBin);return null}async function _detectAvailableLinter(_projectDir,biomeBin,eslintBin){try{let biomeProc=bunSpawn([biomeBin,"--version"],{stdout:"pipe",stderr:"pipe"}),biomeExit=biomeProc.exited,timeout=new Promise((resolve41)=>setTimeout(()=>resolve41("timeout"),2000));if(await Promise.race([biomeExit,timeout])==="timeout")biomeProc.kill();else if(biomeProc.exitCode===0&&fs44.existsSync(biomeBin))return"biome"}catch{}try{let eslintProc=bunSpawn([eslintBin,"--version"],{stdout:"pipe",stderr:"pipe"}),eslintExit=eslintProc.exited,timeout=new Promise((resolve41)=>setTimeout(()=>resolve41("timeout"),2000));if(await Promise.race([eslintExit,timeout])==="timeout")eslintProc.kill();else if(eslintProc.exitCode===0&&fs44.existsSync(eslintBin))return"eslint"}catch{}return null}async function runLint(linter,mode,directory){let command=getLinterCommand(linter,mode,directory);if(command.join(" ").length>MAX_COMMAND_LENGTH)return{success:!1,mode,linter,command,error:"Command exceeds maximum allowed length"};try{let proc=bunSpawn(command,{stdout:"pipe",stderr:"pipe",cwd:directory}),[stdout,stderr]=await Promise.all([proc.stdout.text(),proc.stderr.text()]),exitCode=await proc.exited,output=stdout;if(stderr)output+=(output?`
1693
1693
  `:"")+stderr;if(output.length>MAX_OUTPUT_BYTES)output=`${output.slice(0,MAX_OUTPUT_BYTES)}
1694
1694
  ... (output truncated)`;let result={success:!0,mode,linter,command,exitCode,output};if(exitCode===0)result.message=`${linter} ${mode} completed successfully with no issues`;else if(mode==="fix")result.message=`${linter} fix completed with exit code ${exitCode}. Run check mode to see remaining issues.`;else result.message=`${linter} check found issues (exit code ${exitCode}).`;return result}catch(error93){return{success:!1,mode,linter,command,error:error93 instanceof Error?`Execution failed: ${error93.message}`:"Execution failed: unknown error"}}}async function runAdditionalLint(linter,mode,cwd){let command=getAdditionalLinterCommand(linter,mode,cwd);if(command.join(" ").length>MAX_COMMAND_LENGTH)return{success:!1,mode,linter,command,error:"Command exceeds maximum allowed length"};try{let proc=bunSpawn(command,{stdout:"pipe",stderr:"pipe",cwd}),[stdout,stderr]=await Promise.all([proc.stdout.text(),proc.stderr.text()]),exitCode=await proc.exited,output=stdout;if(stderr)output+=(output?`
1695
1695
  `:"")+stderr;if(output.length>MAX_OUTPUT_BYTES)output=`${output.slice(0,MAX_OUTPUT_BYTES)}
@@ -29,6 +29,19 @@ export declare function validateDirectory(directory: string): void;
29
29
  * Resolves symlinks via realpathSync for both the target path and the root,
30
30
  * then verifies the resolved target is within the resolved root.
31
31
  *
32
+ * The non-existent-path fallback uses path.resolve (not path.normalize):
33
+ * path.resolve anchors a rootless-absolute path (e.g. POSIX-style '/foo/bar'
34
+ * passed on Windows) to the current drive, matching what realpathSync would
35
+ * produce for a path that DOES exist. path.normalize does not add a drive
36
+ * letter. Without this, a case where exactly one of targetPath/rootPath
37
+ * happens to exist on disk (e.g. leftover state from an unrelated test, or
38
+ * any incidental real path) resolves that side via realpathSync (drive
39
+ * letter attached) while the other falls back to normalize (no drive
40
+ * letter) — an apples-to-oranges comparison that spuriously throws
41
+ * regardless of whether a real boundary escape occurred. Using resolve for
42
+ * both fallback branches keeps the comparison basis consistent whether
43
+ * realpathSync succeeds or not, independent of incidental filesystem state.
44
+ *
32
45
  * @param targetPath - The path to validate (absolute)
33
46
  * @param rootPath - The root directory boundary (absolute)
34
47
  * @throws Error if the resolved target escapes the root boundary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.114.1",
3
+ "version": "7.114.2",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",