opencode-swarm 6.22.14 → 6.22.16

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.
package/dist/cli/index.js CHANGED
@@ -17078,6 +17078,16 @@ var GuardrailsConfigSchema = exports_external.object({
17078
17078
  max_consecutive_errors: exports_external.number().min(2).max(20).default(5),
17079
17079
  warning_threshold: exports_external.number().min(0.1).max(0.9).default(0.75),
17080
17080
  idle_timeout_minutes: exports_external.number().min(5).max(240).default(60),
17081
+ qa_gates: exports_external.object({
17082
+ required_tools: exports_external.array(exports_external.string().min(1)).default([
17083
+ "diff",
17084
+ "syntax_check",
17085
+ "placeholder_scan",
17086
+ "lint",
17087
+ "pre_check_batch"
17088
+ ]),
17089
+ require_reviewer_test_engineer: exports_external.boolean().default(true)
17090
+ }).optional(),
17081
17091
  profiles: exports_external.record(exports_external.string(), GuardrailsProfileSchema).optional()
17082
17092
  });
17083
17093
  var ToolFilterConfigSchema = exports_external.object({
@@ -310,6 +310,10 @@ export declare const GuardrailsConfigSchema: z.ZodObject<{
310
310
  max_consecutive_errors: z.ZodDefault<z.ZodNumber>;
311
311
  warning_threshold: z.ZodDefault<z.ZodNumber>;
312
312
  idle_timeout_minutes: z.ZodDefault<z.ZodNumber>;
313
+ qa_gates: z.ZodOptional<z.ZodObject<{
314
+ required_tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
315
+ require_reviewer_test_engineer: z.ZodDefault<z.ZodBoolean>;
316
+ }, z.core.$strip>>;
313
317
  profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
314
318
  max_tool_calls: z.ZodOptional<z.ZodNumber>;
315
319
  max_duration_minutes: z.ZodOptional<z.ZodNumber>;
@@ -541,6 +545,10 @@ export declare const PluginConfigSchema: z.ZodObject<{
541
545
  max_consecutive_errors: z.ZodDefault<z.ZodNumber>;
542
546
  warning_threshold: z.ZodDefault<z.ZodNumber>;
543
547
  idle_timeout_minutes: z.ZodDefault<z.ZodNumber>;
548
+ qa_gates: z.ZodOptional<z.ZodObject<{
549
+ required_tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
550
+ require_reviewer_test_engineer: z.ZodDefault<z.ZodBoolean>;
551
+ }, z.core.$strip>>;
544
552
  profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
545
553
  max_tool_calls: z.ZodOptional<z.ZodNumber>;
546
554
  max_duration_minutes: z.ZodOptional<z.ZodNumber>;
package/dist/index.js CHANGED
@@ -14791,6 +14791,16 @@ var init_schema = __esm(() => {
14791
14791
  max_consecutive_errors: exports_external.number().min(2).max(20).default(5),
14792
14792
  warning_threshold: exports_external.number().min(0.1).max(0.9).default(0.75),
14793
14793
  idle_timeout_minutes: exports_external.number().min(5).max(240).default(60),
14794
+ qa_gates: exports_external.object({
14795
+ required_tools: exports_external.array(exports_external.string().min(1)).default([
14796
+ "diff",
14797
+ "syntax_check",
14798
+ "placeholder_scan",
14799
+ "lint",
14800
+ "pre_check_batch"
14801
+ ]),
14802
+ require_reviewer_test_engineer: exports_external.boolean().default(true)
14803
+ }).optional(),
14794
14804
  profiles: exports_external.record(exports_external.string(), GuardrailsProfileSchema).optional()
14795
14805
  });
14796
14806
  ToolFilterConfigSchema = exports_external.object({
@@ -47997,6 +48007,14 @@ function createGuardrailsHooks(directoryOrConfig, config3) {
47997
48007
  };
47998
48008
  }
47999
48009
  const cfg = guardrailsConfig;
48010
+ const requiredQaGates = cfg.qa_gates?.required_tools ?? [
48011
+ "diff",
48012
+ "syntax_check",
48013
+ "placeholder_scan",
48014
+ "lint",
48015
+ "pre_check_batch"
48016
+ ];
48017
+ const requireReviewerAndTestEngineer = cfg.qa_gates?.require_reviewer_test_engineer ?? true;
48000
48018
  return {
48001
48019
  toolBefore: async (input, output) => {
48002
48020
  const currentSession = swarmState.agentSessions.get(input.sessionID);
@@ -48416,18 +48434,11 @@ function createGuardrailsHooks(directoryOrConfig, config3) {
48416
48434
  const taskId = getCurrentTaskId(sessionId);
48417
48435
  if (!session.partialGateWarningsIssuedForTask.has(taskId)) {
48418
48436
  const gates = session.gateLog.get(taskId);
48419
- const REQUIRED_GATES = [
48420
- "diff",
48421
- "syntax_check",
48422
- "placeholder_scan",
48423
- "lint",
48424
- "pre_check_batch"
48425
- ];
48426
48437
  const missingGates = [];
48427
48438
  if (!gates) {
48428
- missingGates.push(...REQUIRED_GATES);
48439
+ missingGates.push(...requiredQaGates);
48429
48440
  } else {
48430
- for (const gate of REQUIRED_GATES) {
48441
+ for (const gate of requiredQaGates) {
48431
48442
  if (!gates.has(gate)) {
48432
48443
  missingGates.push(gate);
48433
48444
  }
@@ -48442,7 +48453,8 @@ function createGuardrailsHooks(directoryOrConfig, config3) {
48442
48453
  }
48443
48454
  } catch {}
48444
48455
  const hasReviewerDelegation = (session.reviewerCallCount.get(currentPhaseForCheck) ?? 0) > 0;
48445
- if (missingGates.length > 0 || !hasReviewerDelegation) {
48456
+ const missingQaDelegation = requireReviewerAndTestEngineer && !hasReviewerDelegation;
48457
+ if (missingGates.length > 0 || missingQaDelegation) {
48446
48458
  const currentSystemMsgs = messages.filter((msg) => msg.info?.role === "system");
48447
48459
  let targetSysMsgForGate = currentSystemMsgs[0];
48448
48460
  if (!targetSysMsgForGate) {
@@ -48456,7 +48468,7 @@ function createGuardrailsHooks(directoryOrConfig, config3) {
48456
48468
  const sysTextPart = (targetSysMsgForGate.parts ?? []).find((part) => part.type === "text" && typeof part.text === "string");
48457
48469
  if (sysTextPart && !sysTextPart.text.includes("PARTIAL GATE VIOLATION")) {
48458
48470
  const missing = [...missingGates];
48459
- if (!hasReviewerDelegation) {
48471
+ if (missingQaDelegation) {
48460
48472
  missing.push("reviewer/test_engineer (no delegations this phase)");
48461
48473
  }
48462
48474
  session.partialGateWarningsIssuedForTask.add(taskId);
@@ -48496,7 +48508,7 @@ function createGuardrailsHooks(directoryOrConfig, config3) {
48496
48508
  }
48497
48509
  }
48498
48510
  }
48499
- if (isArchitectSessionForGates && session && session.catastrophicPhaseWarnings) {
48511
+ if (isArchitectSessionForGates && session && session.catastrophicPhaseWarnings && requireReviewerAndTestEngineer) {
48500
48512
  try {
48501
48513
  const plan = await loadPlan(directory);
48502
48514
  if (plan?.phases) {
@@ -59675,7 +59687,6 @@ init_create_tool();
59675
59687
  var DEFAULT_OUTPUT_DIR = ".swarm/evidence/sbom";
59676
59688
  function findManifestFiles(rootDir) {
59677
59689
  const manifestFiles = [];
59678
- const cwd = process.cwd();
59679
59690
  const patterns = [...new Set(allDetectors.flatMap((d) => d.patterns))];
59680
59691
  function searchDir(dir) {
59681
59692
  try {
@@ -59691,7 +59702,7 @@ function findManifestFiles(rootDir) {
59691
59702
  for (const pattern of patterns) {
59692
59703
  const regex = pattern.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".");
59693
59704
  if (new RegExp(regex, "i").test(entry.name)) {
59694
- manifestFiles.push(path43.relative(cwd, fullPath));
59705
+ manifestFiles.push(path43.relative(rootDir, fullPath));
59695
59706
  break;
59696
59707
  }
59697
59708
  }
@@ -59704,7 +59715,6 @@ function findManifestFiles(rootDir) {
59704
59715
  }
59705
59716
  function findManifestFilesInDirs(directories, workingDir) {
59706
59717
  const found = [];
59707
- const _cwd = process.cwd();
59708
59718
  const patterns = [...new Set(allDetectors.flatMap((d) => d.patterns))];
59709
59719
  for (const dir of directories) {
59710
59720
  try {
@@ -59814,8 +59824,9 @@ var sbom_generate = createSwarmTool({
59814
59824
  const obj = args2;
59815
59825
  const scope = obj.scope;
59816
59826
  const changedFiles = obj.changed_files;
59817
- const outputDir = obj.output_dir || DEFAULT_OUTPUT_DIR;
59827
+ const relativeOutputDir = obj.output_dir || DEFAULT_OUTPUT_DIR;
59818
59828
  const workingDir = directory;
59829
+ const outputDir = path43.isAbsolute(relativeOutputDir) ? relativeOutputDir : path43.join(workingDir, relativeOutputDir);
59819
59830
  let manifestFiles = [];
59820
59831
  if (scope === "all") {
59821
59832
  manifestFiles = findManifestFiles(workingDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.22.14",
3
+ "version": "6.22.16",
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",