opencode-swarm 7.109.3 → 7.109.4

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.
@@ -12,8 +12,8 @@ import {
12
12
  shouldRunOnStartup,
13
13
  writeBackupArtifact,
14
14
  writeDoctorArtifact
15
- } from "./index-fm7xz1ne.js";
16
- import"./index-h4c4rrwx.js";
15
+ } from "./index-zjh648z4.js";
16
+ import"./index-18690p15.js";
17
17
  import"./index-bfwt3abw.js";
18
18
  import"./index-5e4e2hvv.js";
19
19
  import"./index-p0arc26j.js";
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  createCuratorLLMDelegate
4
- } from "./index-xyz8epk6.js";
5
- import"./index-wj4jeavn.js";
4
+ } from "./index-y3nx3ss0.js";
5
+ import"./index-d3txrx5q.js";
6
6
  import"./index-mtzjbaaa.js";
7
7
  import"./index-c8s9a3zh.js";
8
- import"./index-fm7xz1ne.js";
8
+ import"./index-zjh648z4.js";
9
9
  import"./index-j2v3w1ds.js";
10
10
  import"./index-scww5b77.js";
11
11
  import"./index-yw8qpf51.js";
12
12
  import"./index-85bacexr.js";
13
13
  import"./index-09xpycan.js";
14
- import"./index-h4c4rrwx.js";
14
+ import"./index-18690p15.js";
15
15
  import"./index-b15qbvph.js";
16
16
  import"./index-y5z2qdvk.js";
17
17
  import"./index-41fgssqr.js";
@@ -11,17 +11,17 @@ import {
11
11
  runCuratorInit,
12
12
  runCuratorPhase,
13
13
  writeCuratorSummary
14
- } from "./index-xyz8epk6.js";
15
- import"./index-wj4jeavn.js";
14
+ } from "./index-y3nx3ss0.js";
15
+ import"./index-d3txrx5q.js";
16
16
  import"./index-mtzjbaaa.js";
17
17
  import"./index-c8s9a3zh.js";
18
- import"./index-fm7xz1ne.js";
18
+ import"./index-zjh648z4.js";
19
19
  import"./index-j2v3w1ds.js";
20
20
  import"./index-scww5b77.js";
21
21
  import"./index-yw8qpf51.js";
22
22
  import"./index-85bacexr.js";
23
23
  import"./index-09xpycan.js";
24
- import"./index-h4c4rrwx.js";
24
+ import"./index-18690p15.js";
25
25
  import"./index-b15qbvph.js";
26
26
  import"./index-y5z2qdvk.js";
27
27
  import"./index-41fgssqr.js";
@@ -1,18 +1,18 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-r9dbs4zr.js";
5
- import"./index-xyz8epk6.js";
6
- import"./index-wj4jeavn.js";
4
+ } from "./index-zh3qh6m7.js";
5
+ import"./index-y3nx3ss0.js";
6
+ import"./index-d3txrx5q.js";
7
7
  import"./index-mtzjbaaa.js";
8
8
  import"./index-c8s9a3zh.js";
9
- import"./index-fm7xz1ne.js";
9
+ import"./index-zjh648z4.js";
10
10
  import"./index-j2v3w1ds.js";
11
11
  import"./index-scww5b77.js";
12
12
  import"./index-yw8qpf51.js";
13
13
  import"./index-85bacexr.js";
14
14
  import"./index-09xpycan.js";
15
- import"./index-h4c4rrwx.js";
15
+ import"./index-18690p15.js";
16
16
  import"./index-b15qbvph.js";
17
17
  import"./index-y5z2qdvk.js";
18
18
  import"./index-41fgssqr.js";
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailLog
4
- } from "./index-vx76tcxe.js";
5
- import"./index-wj4jeavn.js";
6
- import"./index-h4c4rrwx.js";
4
+ } from "./index-p5vm9gy9.js";
5
+ import"./index-d3txrx5q.js";
6
+ import"./index-18690p15.js";
7
7
  import"./index-bfwt3abw.js";
8
8
  import"./index-5e4e2hvv.js";
9
9
  import"./index-p0arc26j.js";
@@ -5,17 +5,17 @@ import {
5
5
  isHiveEligible,
6
6
  promoteFromSwarm,
7
7
  promoteToHive
8
- } from "./index-xyz8epk6.js";
9
- import"./index-wj4jeavn.js";
8
+ } from "./index-y3nx3ss0.js";
9
+ import"./index-d3txrx5q.js";
10
10
  import"./index-mtzjbaaa.js";
11
11
  import"./index-c8s9a3zh.js";
12
- import"./index-fm7xz1ne.js";
12
+ import"./index-zjh648z4.js";
13
13
  import"./index-j2v3w1ds.js";
14
14
  import"./index-scww5b77.js";
15
15
  import"./index-yw8qpf51.js";
16
16
  import"./index-85bacexr.js";
17
17
  import"./index-09xpycan.js";
18
- import"./index-h4c4rrwx.js";
18
+ import"./index-18690p15.js";
19
19
  import"./index-b15qbvph.js";
20
20
  import"./index-y5z2qdvk.js";
21
21
  import"./index-41fgssqr.js";
@@ -1126,6 +1126,27 @@ var QualityBudgetConfigSchema = GateFeatureSchema.extend({
1126
1126
  enforce_on_globs: exports_external.array(exports_external.string()).default(["src/**"]),
1127
1127
  exclude_globs: exports_external.array(exports_external.string()).default(["docs/**", "tests/**", "**/*.test.*"])
1128
1128
  });
1129
+ var GATE_CONFIG_KNOWN_SECTION_KEYS = {
1130
+ syntax_check: ["enabled"],
1131
+ placeholder_scan: [
1132
+ "enabled",
1133
+ "deny_patterns",
1134
+ "allow_globs",
1135
+ "max_allowed_findings"
1136
+ ],
1137
+ sast_scan: ["enabled"],
1138
+ sbom_generate: ["enabled"],
1139
+ build_check: ["enabled"],
1140
+ quality_budget: [
1141
+ "enabled",
1142
+ "max_complexity_delta",
1143
+ "max_public_api_delta",
1144
+ "max_duplication_ratio",
1145
+ "min_test_to_code_ratio",
1146
+ "enforce_on_globs",
1147
+ "exclude_globs"
1148
+ ]
1149
+ };
1129
1150
  var GateConfigSchema = exports_external.object({
1130
1151
  syntax_check: GateFeatureSchema.default({ enabled: true }),
1131
1152
  placeholder_scan: PlaceholderScanConfigSchema.default({
@@ -1154,7 +1175,7 @@ var GateConfigSchema = exports_external.object({
1154
1175
  sast_scan: GateFeatureSchema.default({ enabled: true }),
1155
1176
  sbom_generate: GateFeatureSchema.default({ enabled: true }),
1156
1177
  build_check: GateFeatureSchema.default({ enabled: true }),
1157
- quality_budget: QualityBudgetConfigSchema
1178
+ quality_budget: QualityBudgetConfigSchema.default(() => QualityBudgetConfigSchema.parse({}))
1158
1179
  });
1159
1180
  var PipelineConfigSchema = exports_external.object({
1160
1181
  parallel_precheck: exports_external.boolean().default(true)
@@ -2362,4 +2383,4 @@ var PluginConfigSchema = exports_external.object({
2362
2383
  skills: SkillsConfigSchema.optional()
2363
2384
  });
2364
2385
 
2365
- export { ORCHESTRATOR_NAME, ALL_SUBAGENT_NAMES, ALL_AGENT_NAMES, TOOL_NAMES, TOOL_NAME_SET, AGENT_TOOL_MAP, DEFAULT_AGENT_CONFIGS, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, PluginConfigSchema };
2386
+ export { ORCHESTRATOR_NAME, ALL_SUBAGENT_NAMES, ALL_AGENT_NAMES, TOOL_NAMES, TOOL_NAME_SET, AGENT_TOOL_MAP, DEFAULT_AGENT_CONFIGS, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, PluginConfigSchema };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  stripKnownSwarmPrefix
4
- } from "./index-h4c4rrwx.js";
4
+ } from "./index-18690p15.js";
5
5
  import {
6
6
  init_logger,
7
7
  warn
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-r9dbs4zr.js";
4
+ } from "./index-zh3qh6m7.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-vx76tcxe.js";
7
+ } from "./index-p5vm9gy9.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -80,11 +80,11 @@ import {
80
80
  handleWriteRetroCommand,
81
81
  normalizeSwarmCommandInput,
82
82
  resolveCommand
83
- } from "./index-xyz8epk6.js";
84
- import"./index-wj4jeavn.js";
83
+ } from "./index-y3nx3ss0.js";
84
+ import"./index-d3txrx5q.js";
85
85
  import"./index-mtzjbaaa.js";
86
86
  import"./index-c8s9a3zh.js";
87
- import"./index-fm7xz1ne.js";
87
+ import"./index-zjh648z4.js";
88
88
  import"./index-j2v3w1ds.js";
89
89
  import"./index-scww5b77.js";
90
90
  import"./index-yw8qpf51.js";
@@ -94,7 +94,7 @@ import {
94
94
  AGENT_TOOL_MAP,
95
95
  ORCHESTRATOR_NAME,
96
96
  stripKnownSwarmPrefix
97
- } from "./index-h4c4rrwx.js";
97
+ } from "./index-18690p15.js";
98
98
  import"./index-b15qbvph.js";
99
99
  import"./index-y5z2qdvk.js";
100
100
  import"./index-41fgssqr.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-wj4jeavn.js";
5
+ } from "./index-d3txrx5q.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -10,7 +10,7 @@ import {
10
10
  readDoctorArtifact,
11
11
  removeStraySwarmDir,
12
12
  runConfigDoctor
13
- } from "./index-fm7xz1ne.js";
13
+ } from "./index-zjh648z4.js";
14
14
  import {
15
15
  MAX_TRANSIENT_RETRIES,
16
16
  PlanSchema,
@@ -85,6 +85,8 @@ import {
85
85
  AGENT_TOOL_MAP,
86
86
  ALL_SUBAGENT_NAMES,
87
87
  ExternalSkillsConfigSchema,
88
+ GATE_CONFIG_KNOWN_SECTION_KEYS,
89
+ GateConfigSchema,
88
90
  KnowledgeConfigSchema,
89
91
  ORCHESTRATOR_NAME,
90
92
  PluginConfigSchema,
@@ -94,7 +96,7 @@ import {
94
96
  getCanonicalAgentRole,
95
97
  resolveExternalSkillsConfig,
96
98
  stripKnownSwarmPrefix
97
- } from "./index-h4c4rrwx.js";
99
+ } from "./index-18690p15.js";
98
100
  import {
99
101
  DEFAULT_SKILL_MIN_CONFIDENCE,
100
102
  DEFAULT_SKILL_MIN_CONFIRMATIONS,
@@ -4859,6 +4861,62 @@ function sanitizeExternalSkillsConfig(raw) {
4859
4861
  delete cleaned.external_skills;
4860
4862
  return cleaned;
4861
4863
  }
4864
+ function sanitizeGatesConfig(raw) {
4865
+ if (!("gates" in raw) || raw.gates === undefined) {
4866
+ return raw;
4867
+ }
4868
+ if (typeof raw.gates !== "object" || raw.gates === null || Array.isArray(raw.gates)) {
4869
+ console.warn("[opencode-swarm] gates config validation failed: expected an object. Quality gates will use defaults; other config sections remain active.");
4870
+ const cleaned2 = { ...raw };
4871
+ delete cleaned2.gates;
4872
+ return cleaned2;
4873
+ }
4874
+ const gateSchemas = GateConfigSchema.shape;
4875
+ const cleanedGates = { ...raw.gates };
4876
+ for (const [key, value] of Object.entries(cleanedGates)) {
4877
+ const schema = gateSchemas[key];
4878
+ if (!schema) {
4879
+ console.warn(`[opencode-swarm] Unknown gates config section "gates.${key}" ignored. Other config sections remain active.`);
4880
+ delete cleanedGates[key];
4881
+ continue;
4882
+ }
4883
+ const knownFields = GATE_CONFIG_KNOWN_SECTION_KEYS[key];
4884
+ let sectionValue = value;
4885
+ if (knownFields && typeof value === "object" && value !== null && !Array.isArray(value)) {
4886
+ const cleanedSection = { ...value };
4887
+ const knownFieldSet = new Set(knownFields);
4888
+ for (const fieldName of Object.keys(cleanedSection)) {
4889
+ if (!knownFieldSet.has(fieldName)) {
4890
+ console.warn(`[opencode-swarm] Unknown gates config key "gates.${key}.${fieldName}" ignored. Other config sections remain active.`);
4891
+ delete cleanedSection[fieldName];
4892
+ }
4893
+ }
4894
+ sectionValue = cleanedSection;
4895
+ cleanedGates[key] = cleanedSection;
4896
+ }
4897
+ const sectionResult = schema.safeParse(sectionValue);
4898
+ if (!sectionResult.success) {
4899
+ console.warn(`[opencode-swarm] gates.${key} config validation failed; that gate section will use defaults and other config sections remain active:`);
4900
+ console.warn(sectionResult.error.format());
4901
+ delete cleanedGates[key];
4902
+ }
4903
+ }
4904
+ const gatesResult = GateConfigSchema.safeParse(cleanedGates);
4905
+ if (gatesResult.success) {
4906
+ return {
4907
+ ...raw,
4908
+ gates: gatesResult.data
4909
+ };
4910
+ }
4911
+ console.warn("[opencode-swarm] gates config validation failed after section cleanup; quality gates will use defaults and other config sections remain active:");
4912
+ console.warn(gatesResult.error.format());
4913
+ const cleaned = { ...raw };
4914
+ delete cleaned.gates;
4915
+ return cleaned;
4916
+ }
4917
+ function sanitizeSectionConfigs(raw) {
4918
+ return sanitizeGatesConfig(sanitizeExternalSkillsConfig(raw));
4919
+ }
4862
4920
  function rawFullAutoLocked(raw) {
4863
4921
  if (!raw || typeof raw !== "object")
4864
4922
  return false;
@@ -4889,11 +4947,11 @@ function loadPluginConfig(directory) {
4889
4947
  };
4890
4948
  }
4891
4949
  mergedRaw = migratePresetsConfig(mergedRaw);
4892
- mergedRaw = sanitizeExternalSkillsConfig(mergedRaw);
4950
+ mergedRaw = sanitizeSectionConfigs(mergedRaw);
4893
4951
  const result = PluginConfigSchema.safeParse(mergedRaw);
4894
4952
  if (!result.success) {
4895
4953
  if (rawUserConfig) {
4896
- const userParseResult = PluginConfigSchema.safeParse(sanitizeExternalSkillsConfig(rawUserConfig ?? {}));
4954
+ const userParseResult = PluginConfigSchema.safeParse(sanitizeSectionConfigs(rawUserConfig ?? {}));
4897
4955
  if (userParseResult.success) {
4898
4956
  console.warn("[opencode-swarm] Project config ignored due to validation errors. Using user config.");
4899
4957
  return userParseResult.data;
@@ -7207,15 +7265,15 @@ var _internals7 = {
7207
7265
  executePostMortemActions,
7208
7266
  repairPostMortemActions,
7209
7267
  loadDefaultKnowledgeConfig: async () => {
7210
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-x17zmd03.js");
7268
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-5vmb5dh8.js");
7211
7269
  return KnowledgeConfigSchema2.parse({});
7212
7270
  },
7213
7271
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig) => {
7214
- const { applyCuratorKnowledgeUpdates } = await import("./curator-9q3m25va.js");
7272
+ const { applyCuratorKnowledgeUpdates } = await import("./curator-zn1kmwmz.js");
7215
7273
  return applyCuratorKnowledgeUpdates(directory, recommendations, knowledgeConfig);
7216
7274
  },
7217
7275
  checkHivePromotions: async (entries, knowledgeConfig) => {
7218
- const { checkHivePromotions } = await import("./hive-promoter-xnx734y3.js");
7276
+ const { checkHivePromotions } = await import("./hive-promoter-j81yj97d.js");
7219
7277
  return checkHivePromotions(entries, knowledgeConfig);
7220
7278
  },
7221
7279
  applyProposalTriage: async (directory, triage) => {
@@ -14475,7 +14533,7 @@ async function runFinalizeStage(ctx) {
14475
14533
  }
14476
14534
  }
14477
14535
  try {
14478
- const { CuratorConfigSchema: CCS } = await import("./schema-x17zmd03.js");
14536
+ const { CuratorConfigSchema: CCS } = await import("./schema-5vmb5dh8.js");
14479
14537
  const { config: pmLoadedConfig } = _internals17.loadPluginConfigWithMeta(ctx.directory);
14480
14538
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
14481
14539
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -16588,9 +16646,9 @@ var _internals21 = {
16588
16646
  readSwarmFileAsync,
16589
16647
  loadCuratorDeps: async () => {
16590
16648
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
16591
- import("./schema-x17zmd03.js"),
16592
- import("./curator-9q3m25va.js"),
16593
- import("./curator-llm-factory-78dyv010.js")
16649
+ import("./schema-5vmb5dh8.js"),
16650
+ import("./curator-zn1kmwmz.js"),
16651
+ import("./curator-llm-factory-3hf9xpnd.js")
16594
16652
  ]);
16595
16653
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
16596
16654
  }
@@ -17086,7 +17144,7 @@ import { fileURLToPath } from "url";
17086
17144
  // package.json
17087
17145
  var package_default = {
17088
17146
  name: "opencode-swarm",
17089
- version: "7.109.3",
17147
+ version: "7.109.4",
17090
17148
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
17091
17149
  main: "dist/index.js",
17092
17150
  types: "dist/index.d.ts",
@@ -18536,7 +18594,7 @@ async function handleDoctorCommand(directory, args) {
18536
18594
  const result = runConfigDoctor(config, directory);
18537
18595
  let output;
18538
18596
  if (enableAutoFix && result.hasAutoFixableIssues) {
18539
- const { runConfigDoctorWithFixes } = await import("./config-doctor-q354tb2w.js");
18597
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-9vjyj9m3.js");
18540
18598
  const fixResult = await runConfigDoctorWithFixes(directory, config, true);
18541
18599
  output = formatDoctorMarkdown(fixResult.result);
18542
18600
  } else {
@@ -31809,7 +31867,7 @@ function buildDetailedHelp(commandName, entry) {
31809
31867
  async function handleHelpCommand(ctx) {
31810
31868
  const targetCommand = ctx.args.join(" ");
31811
31869
  if (!targetCommand) {
31812
- const { buildHelpText } = await import("./index-3nd7bz90.js");
31870
+ const { buildHelpText } = await import("./index-nvmy7xmj.js");
31813
31871
  return buildHelpText();
31814
31872
  }
31815
31873
  const tokens = targetCommand.split(/\s+/);
@@ -31818,7 +31876,7 @@ async function handleHelpCommand(ctx) {
31818
31876
  return _internals46.buildDetailedHelp(resolved.key, resolved.entry);
31819
31877
  }
31820
31878
  const similar = _internals46.findSimilarCommands(targetCommand);
31821
- const { buildHelpText: fullHelp } = await import("./index-3nd7bz90.js");
31879
+ const { buildHelpText: fullHelp } = await import("./index-nvmy7xmj.js");
31822
31880
  if (similar.length > 0) {
31823
31881
  return `Command '/swarm ${targetCommand}' not found.
31824
31882
 
@@ -31951,7 +32009,7 @@ var COMMAND_REGISTRY = {
31951
32009
  },
31952
32010
  "guardrail explain": {
31953
32011
  handler: async (ctx) => {
31954
- const { handleGuardrailExplain } = await import("./guardrail-explain-csnawe0d.js");
32012
+ const { handleGuardrailExplain } = await import("./guardrail-explain-hjz1k6w0.js");
31955
32013
  return handleGuardrailExplain(ctx.directory, ctx.args);
31956
32014
  },
31957
32015
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -31961,7 +32019,7 @@ var COMMAND_REGISTRY = {
31961
32019
  },
31962
32020
  "guardrail-log": {
31963
32021
  handler: async (ctx) => {
31964
- const { handleGuardrailLog } = await import("./guardrail-log-8mqqsssq.js");
32022
+ const { handleGuardrailLog } = await import("./guardrail-log-5240bawg.js");
31965
32023
  return handleGuardrailLog(ctx.directory, ctx.args);
31966
32024
  },
31967
32025
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-xyz8epk6.js";
15
+ } from "./index-y3nx3ss0.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-wj4jeavn.js";
22
+ } from "./index-d3txrx5q.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -1,9 +1,11 @@
1
1
  // @bun
2
2
  import {
3
3
  ALL_AGENT_NAMES,
4
+ GATE_CONFIG_KNOWN_SECTION_KEYS,
5
+ GateConfigSchema,
4
6
  PluginConfigSchema,
5
7
  stripKnownSwarmPrefix
6
- } from "./index-h4c4rrwx.js";
8
+ } from "./index-18690p15.js";
7
9
  import {
8
10
  log
9
11
  } from "./index-zgwm4ryv.js";
@@ -13,6 +15,7 @@ import * as crypto from "crypto";
13
15
  import * as fs from "fs";
14
16
  import * as os from "os";
15
17
  import * as path from "path";
18
+ var CONFIG_DOCTOR_MAX_CONFIG_FILE_BYTES = 102400;
16
19
  var KNOWN_TOP_LEVEL_KEYS = new Set(Object.keys(PluginConfigSchema.shape));
17
20
  var DEPRECATED_FIELDS = new Map([
18
21
  [
@@ -79,6 +82,82 @@ function emitObjectTypeMismatch(key, value, findings) {
79
82
  });
80
83
  }
81
84
  }
85
+ function isPlainObject(value) {
86
+ return typeof value === "object" && value !== null && !Array.isArray(value);
87
+ }
88
+ function collectRawGatesConfigFindings(directory) {
89
+ const findings = [];
90
+ const { userConfigPath, projectConfigPath } = getConfigPaths(directory);
91
+ for (const configPath of [userConfigPath, projectConfigPath]) {
92
+ if (!fs.existsSync(configPath))
93
+ continue;
94
+ try {
95
+ const stats = fs.statSync(configPath);
96
+ if (stats.size > CONFIG_DOCTOR_MAX_CONFIG_FILE_BYTES)
97
+ continue;
98
+ const raw = JSON.parse(fs.readFileSync(configPath, "utf-8"));
99
+ if (!isPlainObject(raw) || raw.gates === undefined)
100
+ continue;
101
+ if (!isPlainObject(raw.gates)) {
102
+ findings.push({
103
+ id: "invalid-gates-config",
104
+ title: "Invalid gates config",
105
+ description: `"gates" in ${configPath} must be an object. The loader ignores that section and keeps other valid config sections active.`,
106
+ severity: "error",
107
+ path: "gates",
108
+ currentValue: raw.gates,
109
+ autoFixable: false
110
+ });
111
+ continue;
112
+ }
113
+ for (const [sectionName, sectionValue] of Object.entries(raw.gates)) {
114
+ const schema = GateConfigSchema.shape[sectionName];
115
+ if (!schema) {
116
+ findings.push({
117
+ id: "unknown-gates-section",
118
+ title: "Unknown gates config section",
119
+ description: `Unknown gates section "gates.${sectionName}" in ${configPath} is ignored by the loader.`,
120
+ severity: "warn",
121
+ path: `gates.${sectionName}`,
122
+ currentValue: sectionValue,
123
+ autoFixable: false
124
+ });
125
+ continue;
126
+ }
127
+ const knownFields = GATE_CONFIG_KNOWN_SECTION_KEYS[sectionName];
128
+ if (knownFields && isPlainObject(sectionValue)) {
129
+ const knownFieldSet = new Set(knownFields);
130
+ for (const fieldName of Object.keys(sectionValue)) {
131
+ if (!knownFieldSet.has(fieldName)) {
132
+ findings.push({
133
+ id: "unknown-gates-key",
134
+ title: "Unknown gates config key",
135
+ description: `Unknown gates key "gates.${sectionName}.${fieldName}" in ${configPath} is ignored by the loader.`,
136
+ severity: "warn",
137
+ path: `gates.${sectionName}.${fieldName}`,
138
+ currentValue: sectionValue[fieldName],
139
+ autoFixable: false
140
+ });
141
+ }
142
+ }
143
+ }
144
+ const sectionResult = schema.safeParse(sectionValue);
145
+ if (!sectionResult.success) {
146
+ findings.push({
147
+ id: "invalid-gates-section",
148
+ title: "Invalid gates config section",
149
+ description: `"gates.${sectionName}" in ${configPath} failed validation. The loader uses defaults for that gate section and keeps other valid config sections active.`,
150
+ severity: "error",
151
+ path: `gates.${sectionName}`,
152
+ currentValue: sectionValue,
153
+ autoFixable: false
154
+ });
155
+ }
156
+ }
157
+ } catch {}
158
+ }
159
+ return findings;
160
+ }
82
161
  function emitWorktreeIsolationLayeringAdvisory(config, findings) {
83
162
  const parallelization = config.parallelization;
84
163
  const worktreePolicy = config.worktree?.policy ?? "auto";
@@ -927,6 +1006,7 @@ function walkConfigAndValidate(obj, path2, findings, visited = new WeakSet) {
927
1006
  function runConfigDoctor(config, directory) {
928
1007
  const findings = [];
929
1008
  walkConfigAndValidate(config, "", findings);
1009
+ findings.push(...collectRawGatesConfigFindings(directory));
930
1010
  emitWorktreeIsolationLayeringAdvisory(config, findings);
931
1011
  const summary = {
932
1012
  info: findings.filter((f) => f.severity === "info").length,
package/dist/cli/index.js CHANGED
@@ -7,11 +7,11 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-xyz8epk6.js";
11
- import"./index-wj4jeavn.js";
10
+ } from "./index-y3nx3ss0.js";
11
+ import"./index-d3txrx5q.js";
12
12
  import"./index-mtzjbaaa.js";
13
13
  import"./index-c8s9a3zh.js";
14
- import"./index-fm7xz1ne.js";
14
+ import"./index-zjh648z4.js";
15
15
  import"./index-j2v3w1ds.js";
16
16
  import"./index-scww5b77.js";
17
17
  import"./index-yw8qpf51.js";
@@ -19,7 +19,7 @@ import"./index-85bacexr.js";
19
19
  import"./index-09xpycan.js";
20
20
  import {
21
21
  DEFAULT_AGENT_CONFIGS
22
- } from "./index-h4c4rrwx.js";
22
+ } from "./index-18690p15.js";
23
23
  import"./index-b15qbvph.js";
24
24
  import"./index-y5z2qdvk.js";
25
25
  import"./index-41fgssqr.js";
@@ -33,6 +33,7 @@ import {
33
33
  ExternalSkillCandidateSchema,
34
34
  ExternalSkillCandidateSourceTypeSchema,
35
35
  ExternalSkillsConfigSchema,
36
+ GATE_CONFIG_KNOWN_SECTION_KEYS,
36
37
  GateConfigSchema,
37
38
  GateFeatureSchema,
38
39
  GeneralCouncilConfigSchema,
@@ -85,7 +86,7 @@ import {
85
86
  resolveGeneratedAgentRole,
86
87
  resolveGuardrailsConfig,
87
88
  stripKnownSwarmPrefix
88
- } from "./index-h4c4rrwx.js";
89
+ } from "./index-18690p15.js";
89
90
  import"./index-bfwt3abw.js";
90
91
  import"./index-p0arc26j.js";
91
92
  import"./index-293f68mj.js";
@@ -143,6 +144,7 @@ export {
143
144
  GeneralCouncilConfigSchema,
144
145
  GateFeatureSchema,
145
146
  GateConfigSchema,
147
+ GATE_CONFIG_KNOWN_SECTION_KEYS,
146
148
  ExternalSkillsConfigSchema,
147
149
  ExternalSkillCandidateSourceTypeSchema,
148
150
  ExternalSkillCandidateSchema,
@@ -285,6 +285,14 @@ export declare const QualityBudgetConfigSchema: z.ZodObject<{
285
285
  exclude_globs: z.ZodDefault<z.ZodArray<z.ZodString>>;
286
286
  }, z.core.$strip>;
287
287
  export type QualityBudgetConfig = z.infer<typeof QualityBudgetConfigSchema>;
288
+ export declare const GATE_CONFIG_KNOWN_SECTION_KEYS: {
289
+ readonly syntax_check: readonly ["enabled"];
290
+ readonly placeholder_scan: readonly ["enabled", "deny_patterns", "allow_globs", "max_allowed_findings"];
291
+ readonly sast_scan: readonly ["enabled"];
292
+ readonly sbom_generate: readonly ["enabled"];
293
+ readonly build_check: readonly ["enabled"];
294
+ readonly quality_budget: readonly ["enabled", "max_complexity_delta", "max_public_api_delta", "max_duplication_ratio", "min_test_to_code_ratio", "enforce_on_globs", "exclude_globs"];
295
+ };
288
296
  export declare const GateConfigSchema: z.ZodObject<{
289
297
  syntax_check: z.ZodDefault<z.ZodObject<{
290
298
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -304,7 +312,7 @@ export declare const GateConfigSchema: z.ZodObject<{
304
312
  build_check: z.ZodDefault<z.ZodObject<{
305
313
  enabled: z.ZodDefault<z.ZodBoolean>;
306
314
  }, z.core.$strip>>;
307
- quality_budget: z.ZodObject<{
315
+ quality_budget: z.ZodDefault<z.ZodObject<{
308
316
  enabled: z.ZodDefault<z.ZodBoolean>;
309
317
  max_complexity_delta: z.ZodDefault<z.ZodNumber>;
310
318
  max_public_api_delta: z.ZodDefault<z.ZodNumber>;
@@ -312,7 +320,7 @@ export declare const GateConfigSchema: z.ZodObject<{
312
320
  min_test_to_code_ratio: z.ZodDefault<z.ZodNumber>;
313
321
  enforce_on_globs: z.ZodDefault<z.ZodArray<z.ZodString>>;
314
322
  exclude_globs: z.ZodDefault<z.ZodArray<z.ZodString>>;
315
- }, z.core.$strip>;
323
+ }, z.core.$strip>>;
316
324
  }, z.core.$strip>;
317
325
  export type GateConfig = z.infer<typeof GateConfigSchema>;
318
326
  export declare const PipelineConfigSchema: z.ZodObject<{
@@ -1624,7 +1632,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
1624
1632
  build_check: z.ZodDefault<z.ZodObject<{
1625
1633
  enabled: z.ZodDefault<z.ZodBoolean>;
1626
1634
  }, z.core.$strip>>;
1627
- quality_budget: z.ZodObject<{
1635
+ quality_budget: z.ZodDefault<z.ZodObject<{
1628
1636
  enabled: z.ZodDefault<z.ZodBoolean>;
1629
1637
  max_complexity_delta: z.ZodDefault<z.ZodNumber>;
1630
1638
  max_public_api_delta: z.ZodDefault<z.ZodNumber>;
@@ -1632,7 +1640,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
1632
1640
  min_test_to_code_ratio: z.ZodDefault<z.ZodNumber>;
1633
1641
  enforce_on_globs: z.ZodDefault<z.ZodArray<z.ZodString>>;
1634
1642
  exclude_globs: z.ZodDefault<z.ZodArray<z.ZodString>>;
1635
- }, z.core.$strip>;
1643
+ }, z.core.$strip>>;
1636
1644
  }, z.core.$strip>>;
1637
1645
  context_budget: z.ZodOptional<z.ZodObject<{
1638
1646
  enabled: z.ZodDefault<z.ZodBoolean>;