opencode-swarm 6.86.9 → 6.86.10

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
@@ -18580,7 +18580,7 @@ import * as path33 from "path";
18580
18580
  // package.json
18581
18581
  var package_default = {
18582
18582
  name: "opencode-swarm",
18583
- version: "6.86.9",
18583
+ version: "6.86.10",
18584
18584
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
18585
18585
  main: "dist/index.js",
18586
18586
  types: "dist/index.d.ts",
@@ -20170,6 +20170,7 @@ function getEffectiveGates(profile, sessionOverrides) {
20170
20170
 
20171
20171
  // src/hooks/delegation-gate.ts
20172
20172
  init_telemetry();
20173
+ init_logger();
20173
20174
 
20174
20175
  // node_modules/quick-lru/index.js
20175
20176
  class QuickLRU extends Map {
@@ -20533,6 +20534,7 @@ function clearAllScopes(directory) {
20533
20534
  // src/hooks/guardrails.ts
20534
20535
  init_telemetry();
20535
20536
  init_utils();
20537
+ init_logger();
20536
20538
 
20537
20539
  // src/hooks/conflict-resolution.ts
20538
20540
  init_telemetry();
@@ -35625,6 +35627,7 @@ function getGlobalEventBus() {
35625
35627
 
35626
35628
  // src/hooks/curator.ts
35627
35629
  init_manager();
35630
+ init_logger();
35628
35631
  init_utils2();
35629
35632
 
35630
35633
  // src/hooks/hive-promoter.ts
@@ -39485,6 +39488,7 @@ async function handleHistoryCommand(directory, _args) {
39485
39488
  return formatHistoryMarkdown(historyData);
39486
39489
  }
39487
39490
  // src/hooks/knowledge-migrator.ts
39491
+ init_logger();
39488
39492
  import { randomUUID as randomUUID2 } from "crypto";
39489
39493
  import { existsSync as existsSync13, readFileSync as readFileSync10 } from "fs";
39490
39494
  import { mkdir as mkdir3, readFile as readFile4, writeFile as writeFile4 } from "fs/promises";
@@ -39582,7 +39586,7 @@ async function migrateContextToKnowledge(directory, config3) {
39582
39586
  await rewriteKnowledge(knowledgePath, existing);
39583
39587
  }
39584
39588
  await writeSentinel(sentinelPath, migrated, dropped);
39585
- console.log(`[knowledge-migrator] Migrated ${migrated} entries, dropped ${dropped}`);
39589
+ log(`[knowledge-migrator] Migrated ${migrated} entries, dropped ${dropped}`);
39586
39590
  return {
39587
39591
  migrated: true,
39588
39592
  entriesMigrated: migrated,
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ var package_default;
33
33
  var init_package = __esm(() => {
34
34
  package_default = {
35
35
  name: "opencode-swarm",
36
- version: "6.86.9",
36
+ version: "6.86.10",
37
37
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
38
38
  main: "dist/index.js",
39
39
  types: "dist/index.d.ts",
@@ -23300,7 +23300,7 @@ function redactShellCommand(cmd) {
23300
23300
  function createGuardrailsHooks(directory, directoryOrConfig, config2, authorityConfig) {
23301
23301
  let guardrailsConfig;
23302
23302
  if (directory && typeof directory === "object" && "enabled" in directory) {
23303
- console.warn("[guardrails] Legacy call without directory, falling back to process.cwd()");
23303
+ warn("[guardrails] Legacy call without directory, falling back to process.cwd()");
23304
23304
  guardrailsConfig = directory;
23305
23305
  } else if (directoryOrConfig && typeof directoryOrConfig === "object" && "enabled" in directoryOrConfig) {
23306
23306
  guardrailsConfig = directoryOrConfig;
@@ -23311,7 +23311,7 @@ function createGuardrailsHooks(directory, directoryOrConfig, config2, authorityC
23311
23311
  if (typeof directory === "string")
23312
23312
  return directory;
23313
23313
  const cwd = process.cwd();
23314
- console.warn(`[guardrails] effectiveDirectory resolved to process.cwd() "${cwd}" — ` + "pass an explicit directory string to createGuardrailsHooks to avoid .swarm artifacts in wrong locations");
23314
+ warn(`[guardrails] effectiveDirectory resolved to process.cwd() "${cwd}" — ` + "pass an explicit directory string to createGuardrailsHooks to avoid .swarm artifacts in wrong locations");
23315
23315
  return cwd;
23316
23316
  })();
23317
23317
  if (guardrailsConfig?.enabled === false) {
@@ -24719,6 +24719,7 @@ var init_guardrails = __esm(() => {
24719
24719
  init_state();
24720
24720
  init_telemetry();
24721
24721
  init_utils();
24722
+ init_logger();
24722
24723
  init_conflict_resolution();
24723
24724
  init_delegation_gate();
24724
24725
  init_loop_detector();
@@ -25064,7 +25065,7 @@ async function getEvidenceTaskId(session, directory) {
25064
25065
  }
25065
25066
  } catch (err2) {
25066
25067
  if (process.env.DEBUG_SWARM && err2 instanceof Error) {
25067
- console.warn(`[delegation-gate] getEvidenceTaskId error: ${err2.message} (code=${err2.code ?? "none"})`);
25068
+ warn(`[delegation-gate] getEvidenceTaskId error: ${err2.message} (code=${err2.code ?? "none"})`);
25068
25069
  }
25069
25070
  return null;
25070
25071
  }
@@ -25121,7 +25122,7 @@ function createDelegationGateHook(config2, directory) {
25121
25122
  const hasCurrentSessionCoderDelegation = delegationChains.some((d) => stripKnownSwarmPrefix(d.to) === "coder" && d.timestamp > freshnessThreshold);
25122
25123
  if (!hasCurrentSessionCoderDelegation) {
25123
25124
  session.taskWorkflowStates.set(taskId, "idle");
25124
- console.warn(`[delegation-gate] Reset stale coder_delegated state for task ${taskId} — ` + `no coder delegation found in current session.`);
25125
+ warn(`[delegation-gate] Reset stale coder_delegated state for task ${taskId} — ` + `no coder delegation found in current session.`);
25125
25126
  continue;
25126
25127
  }
25127
25128
  const turbo = hasActiveTurboMode(input.sessionID);
@@ -25162,7 +25163,7 @@ function createDelegationGateHook(config2, directory) {
25162
25163
  try {
25163
25164
  await advanceTaskStateAndPersist(session, taskId, "complete", directory, config2.council);
25164
25165
  } catch (err2) {
25165
- console.warn(`[delegation-gate] toolAfter submit_council_verdicts: could not advance ${taskId} → complete: ${err2 instanceof Error ? err2.message : String(err2)}`);
25166
+ warn(`[delegation-gate] toolAfter submit_council_verdicts: could not advance ${taskId} → complete: ${err2 instanceof Error ? err2.message : String(err2)}`);
25166
25167
  }
25167
25168
  }
25168
25169
  }
@@ -25205,7 +25206,7 @@ function createDelegationGateHook(config2, directory) {
25205
25206
  }
25206
25207
  advanceTaskState(session, taskId, "tests_run");
25207
25208
  } catch (err2) {
25208
- console.warn(`[delegation-gate] toolAfter stage-b-parallel: could not advance ${taskId} (${eligibleState}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25209
+ warn(`[delegation-gate] toolAfter stage-b-parallel: could not advance ${taskId} (${eligibleState}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25209
25210
  }
25210
25211
  }
25211
25212
  }
@@ -25232,7 +25233,7 @@ function createDelegationGateHook(config2, directory) {
25232
25233
  }
25233
25234
  advanceTaskState(otherSession, seedTaskId, "tests_run");
25234
25235
  } catch (err2) {
25235
- console.warn(`[delegation-gate] toolAfter cross-session stage-b-parallel: could not advance ${seedTaskId} (${seedEligibleState}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25236
+ warn(`[delegation-gate] toolAfter cross-session stage-b-parallel: could not advance ${seedTaskId} (${seedEligibleState}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25236
25237
  }
25237
25238
  }
25238
25239
  }
@@ -25245,7 +25246,7 @@ function createDelegationGateHook(config2, directory) {
25245
25246
  try {
25246
25247
  advanceTaskState(session, taskId, "reviewer_run");
25247
25248
  } catch (err2) {
25248
- console.warn(`[delegation-gate] toolAfter: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25249
+ warn(`[delegation-gate] toolAfter: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25249
25250
  }
25250
25251
  }
25251
25252
  }
@@ -25256,7 +25257,7 @@ function createDelegationGateHook(config2, directory) {
25256
25257
  try {
25257
25258
  advanceTaskState(session, taskId, "tests_run");
25258
25259
  } catch (err2) {
25259
- console.warn(`[delegation-gate] toolAfter: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25260
+ warn(`[delegation-gate] toolAfter: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25260
25261
  }
25261
25262
  }
25262
25263
  }
@@ -25280,7 +25281,7 @@ function createDelegationGateHook(config2, directory) {
25280
25281
  try {
25281
25282
  advanceTaskState(otherSession, taskId, "reviewer_run");
25282
25283
  } catch (err2) {
25283
- console.warn(`[delegation-gate] toolAfter cross-session: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25284
+ warn(`[delegation-gate] toolAfter cross-session: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25284
25285
  }
25285
25286
  }
25286
25287
  }
@@ -25298,7 +25299,7 @@ function createDelegationGateHook(config2, directory) {
25298
25299
  try {
25299
25300
  advanceTaskState(otherSession, taskId, "tests_run");
25300
25301
  } catch (err2) {
25301
- console.warn(`[delegation-gate] toolAfter cross-session: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25302
+ warn(`[delegation-gate] toolAfter cross-session: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25302
25303
  }
25303
25304
  }
25304
25305
  }
@@ -25370,7 +25371,7 @@ function createDelegationGateHook(config2, directory) {
25370
25371
  try {
25371
25372
  advanceTaskState(session, taskId, "reviewer_run");
25372
25373
  } catch (err2) {
25373
- console.warn(`[delegation-gate] fallback: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25374
+ warn(`[delegation-gate] fallback: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25374
25375
  }
25375
25376
  }
25376
25377
  }
@@ -25381,7 +25382,7 @@ function createDelegationGateHook(config2, directory) {
25381
25382
  try {
25382
25383
  advanceTaskState(session, taskId, "tests_run");
25383
25384
  } catch (err2) {
25384
- console.warn(`[delegation-gate] fallback: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25385
+ warn(`[delegation-gate] fallback: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25385
25386
  }
25386
25387
  }
25387
25388
  }
@@ -25401,7 +25402,7 @@ function createDelegationGateHook(config2, directory) {
25401
25402
  try {
25402
25403
  advanceTaskState(otherSession, taskId, "reviewer_run");
25403
25404
  } catch (err2) {
25404
- console.warn(`[delegation-gate] fallback cross-session: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25405
+ warn(`[delegation-gate] fallback cross-session: could not advance ${taskId} (${state}) → reviewer_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25405
25406
  }
25406
25407
  }
25407
25408
  }
@@ -25422,7 +25423,7 @@ function createDelegationGateHook(config2, directory) {
25422
25423
  try {
25423
25424
  advanceTaskState(otherSession, taskId, "tests_run");
25424
25425
  } catch (err2) {
25425
- console.warn(`[delegation-gate] fallback cross-session: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25426
+ warn(`[delegation-gate] fallback cross-session: could not advance ${taskId} (${state}) → tests_run: ${err2 instanceof Error ? err2.message : String(err2)}`);
25426
25427
  }
25427
25428
  }
25428
25429
  }
@@ -25549,7 +25550,7 @@ ${trimComment}${after}`;
25549
25550
  try {
25550
25551
  await advanceTaskStateAndPersist(session, currentTaskId, "coder_delegated", directory);
25551
25552
  } catch (err2) {
25552
- console.warn(`[delegation-gate] state machine warn: ${err2 instanceof Error ? err2.message : String(err2)}`);
25553
+ warn(`[delegation-gate] state machine warn: ${err2 instanceof Error ? err2.message : String(err2)}`);
25553
25554
  }
25554
25555
  }
25555
25556
  if (sessionID && !isCoderDelegation && currentTaskId) {
@@ -25677,6 +25678,7 @@ var init_delegation_gate = __esm(() => {
25677
25678
  init_schema();
25678
25679
  init_state();
25679
25680
  init_telemetry();
25681
+ init_logger();
25680
25682
  init_guardrails();
25681
25683
  init_normalize_tool_name();
25682
25684
  init_utils2();
@@ -42601,7 +42603,7 @@ async function readCuratorSummary(directory) {
42601
42603
  try {
42602
42604
  const parsed = JSON.parse(content);
42603
42605
  if (parsed.schema_version !== 1) {
42604
- console.warn(`Curator summary has unsupported schema version: ${parsed.schema_version}. Expected 1.`);
42606
+ warn(`Curator summary has unsupported schema version: ${parsed.schema_version}. Expected 1.`);
42605
42607
  return null;
42606
42608
  }
42607
42609
  return parsed;
@@ -42838,7 +42840,7 @@ ${llmOutput.trim()}`;
42838
42840
  enhanced: true
42839
42841
  });
42840
42842
  } catch (err2) {
42841
- console.warn(`[curator] LLM delegation failed during CURATOR_INIT, using data-only mode: ${err2 instanceof Error ? err2.message : String(err2)}`);
42843
+ warn(`[curator] LLM delegation failed during CURATOR_INIT, using data-only mode: ${err2 instanceof Error ? err2.message : String(err2)}`);
42842
42844
  getGlobalEventBus().publish("curator.init.llm_fallback", {
42843
42845
  error: String(err2)
42844
42846
  });
@@ -42962,7 +42964,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config3, _kno
42962
42964
  recommendations: knowledgeRecommendations.length
42963
42965
  });
42964
42966
  } catch (err2) {
42965
- console.warn(`[curator] LLM delegation failed during CURATOR_PHASE ${phase}, using data-only mode: ${err2 instanceof Error ? err2.message : String(err2)}`);
42967
+ warn(`[curator] LLM delegation failed during CURATOR_PHASE ${phase}, using data-only mode: ${err2 instanceof Error ? err2.message : String(err2)}`);
42966
42968
  getGlobalEventBus().publish("curator.phase.llm_fallback", {
42967
42969
  phase,
42968
42970
  error: String(err2)
@@ -43123,7 +43125,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
43123
43125
  if (rec.entry_id !== undefined && !appliedIds.has(rec.entry_id)) {
43124
43126
  const found = entries.some((e) => e.id === rec.entry_id);
43125
43127
  if (!found) {
43126
- console.warn(`[curator] applyCuratorKnowledgeUpdates: entry_id '${rec.entry_id}' not found — skipping`);
43128
+ warn(`[curator] applyCuratorKnowledgeUpdates: entry_id '${rec.entry_id}' not found — skipping`);
43127
43129
  }
43128
43130
  skipped++;
43129
43131
  }
@@ -43191,6 +43193,7 @@ var DEFAULT_CURATOR_LLM_TIMEOUT_MS = 300000;
43191
43193
  var init_curator = __esm(() => {
43192
43194
  init_event_bus();
43193
43195
  init_manager();
43196
+ init_logger();
43194
43197
  init_knowledge_store();
43195
43198
  init_knowledge_validator();
43196
43199
  init_utils2();
@@ -48264,7 +48267,7 @@ async function migrateContextToKnowledge(directory, config3) {
48264
48267
  await rewriteKnowledge(knowledgePath, existing);
48265
48268
  }
48266
48269
  await writeSentinel(sentinelPath, migrated, dropped);
48267
- console.log(`[knowledge-migrator] Migrated ${migrated} entries, dropped ${dropped}`);
48270
+ log(`[knowledge-migrator] Migrated ${migrated} entries, dropped ${dropped}`);
48268
48271
  return {
48269
48272
  migrated: true,
48270
48273
  entriesMigrated: migrated,
@@ -48394,6 +48397,7 @@ async function writeSentinel(sentinelPath, migrated, dropped) {
48394
48397
  await writeFile5(sentinelPath, JSON.stringify(sentinel, null, 2), "utf-8");
48395
48398
  }
48396
48399
  var init_knowledge_migrator = __esm(() => {
48400
+ init_logger();
48397
48401
  init_knowledge_store();
48398
48402
  init_knowledge_validator();
48399
48403
  });
@@ -59201,7 +59205,7 @@ function createPreflightIntegration(config3) {
59201
59205
  statusArtifact = new AutomationStatusArtifact(swarmDir);
59202
59206
  }
59203
59207
  const preflightHandler = async (request) => {
59204
- console.log("[PreflightIntegration] Handling preflight request", {
59208
+ log("[PreflightIntegration] Handling preflight request", {
59205
59209
  requestId: request.id,
59206
59210
  phase: request.currentPhase,
59207
59211
  source: request.source
@@ -59210,13 +59214,13 @@ function createPreflightIntegration(config3) {
59210
59214
  if (statusArtifact) {
59211
59215
  const state = report.overall === "pass" ? "success" : "failure";
59212
59216
  statusArtifact.recordOutcome(state, request.currentPhase, report.message);
59213
- console.log("[PreflightIntegration] Status artifact updated", {
59217
+ log("[PreflightIntegration] Status artifact updated", {
59214
59218
  state,
59215
59219
  phase: request.currentPhase,
59216
59220
  message: report.message
59217
59221
  });
59218
59222
  }
59219
- console.log("[PreflightIntegration] Preflight complete", {
59223
+ log("[PreflightIntegration] Preflight complete", {
59220
59224
  requestId: request.id,
59221
59225
  overall: report.overall,
59222
59226
  message: report.message,
@@ -59239,6 +59243,7 @@ var init_preflight_integration = __esm(() => {
59239
59243
  init_status_artifact();
59240
59244
  init_trigger();
59241
59245
  init_preflight_service();
59246
+ init_logger();
59242
59247
  });
59243
59248
 
59244
59249
  // node_modules/web-tree-sitter/tree-sitter.js
@@ -63143,12 +63148,12 @@ async function readPriorDriftReports(directory) {
63143
63148
  try {
63144
63149
  const report = JSON.parse(content);
63145
63150
  if (typeof report.phase !== "number" || typeof report.alignment !== "string" || typeof report.timestamp !== "string" || typeof report.drift_score !== "number" || typeof report.schema_version !== "number" || !Array.isArray(report.compounding_effects)) {
63146
- console.warn(`[curator-drift] Skipping corrupt drift report: ${filename}`);
63151
+ warn(`[curator-drift] Skipping corrupt drift report: ${filename}`);
63147
63152
  continue;
63148
63153
  }
63149
63154
  reports.push(report);
63150
63155
  } catch {
63151
- console.warn(`[curator-drift] Skipping unreadable drift report: ${filename}`);
63156
+ warn(`[curator-drift] Skipping unreadable drift report: ${filename}`);
63152
63157
  }
63153
63158
  }
63154
63159
  reports.sort((a, b) => a.phase - b.phase);
@@ -63285,6 +63290,7 @@ function buildDriftInjectionText(report, maxChars) {
63285
63290
  var DRIFT_REPORT_PREFIX = "drift-report-phase-";
63286
63291
  var init_curator_drift = __esm(() => {
63287
63292
  init_event_bus();
63293
+ init_logger();
63288
63294
  init_utils2();
63289
63295
  });
63290
63296
 
@@ -64511,6 +64517,7 @@ init_schema();
64511
64517
  init_file_locks();
64512
64518
  init_state();
64513
64519
  init_telemetry();
64520
+ init_logger();
64514
64521
  init_utils2();
64515
64522
  import * as fs33 from "node:fs";
64516
64523
  var END_OF_SENTENCE_QUESTION_PATTERN = /\?\s*$/;
@@ -64622,7 +64629,7 @@ function parseCriticResponse(rawResponse) {
64622
64629
  if (validVerdicts.includes(normalized)) {
64623
64630
  res.verdict = normalized;
64624
64631
  } else {
64625
- console.warn(`[full-auto-intercept] Unknown verdict '${value}' — defaulting to NEEDS_REVISION`);
64632
+ warn(`[full-auto-intercept] Unknown verdict '${value}' — defaulting to NEEDS_REVISION`);
64626
64633
  res.verdict = "NEEDS_REVISION";
64627
64634
  }
64628
64635
  break;
@@ -64699,23 +64706,23 @@ async function writeAutoOversightEvent(directory, architectOutput, criticVerdict
64699
64706
  try {
64700
64707
  lockResult = await tryAcquireLock(dir, eventsFilePath, "auto-oversight", lockTaskId);
64701
64708
  } catch (error93) {
64702
- console.warn(`[full-auto-intercept] Warning: failed to acquire lock for auto_oversight event: ${error93 instanceof Error ? error93.message : String(error93)}`);
64709
+ warn(`[full-auto-intercept] Warning: failed to acquire lock for auto_oversight event: ${error93 instanceof Error ? error93.message : String(error93)}`);
64703
64710
  }
64704
64711
  if (!lockResult?.acquired) {
64705
- console.warn(`[full-auto-intercept] Warning: could not acquire lock for events.jsonl write — proceeding without lock`);
64712
+ warn(`[full-auto-intercept] Warning: could not acquire lock for events.jsonl write — proceeding without lock`);
64706
64713
  }
64707
64714
  try {
64708
64715
  const eventsPath = validateSwarmPath(dir, "events.jsonl");
64709
64716
  fs33.appendFileSync(eventsPath, `${JSON.stringify(event)}
64710
64717
  `, "utf-8");
64711
64718
  } catch (writeError) {
64712
- console.error(`[full-auto-intercept] Warning: failed to write auto_oversight event: ${writeError instanceof Error ? writeError.message : String(writeError)}`);
64719
+ error48(`[full-auto-intercept] Warning: failed to write auto_oversight event: ${writeError instanceof Error ? writeError.message : String(writeError)}`);
64713
64720
  } finally {
64714
64721
  if (lockResult?.acquired && lockResult.lock._release) {
64715
64722
  try {
64716
64723
  await lockResult.lock._release();
64717
64724
  } catch (releaseError) {
64718
- console.error(`[full-auto-intercept] Lock release failed:`, releaseError);
64725
+ error48(`[full-auto-intercept] Lock release failed:`, releaseError);
64719
64726
  }
64720
64727
  }
64721
64728
  }
@@ -64821,7 +64828,7 @@ Critic reasoning: ${criticResult.reasoning}`
64821
64828
  async function dispatchCriticAndWriteEvent(directory, architectOutput, criticContext, criticModel, escalationType, interactionCount, deadlockCount, oversightAgentName) {
64822
64829
  const client = swarmState.opencodeClient;
64823
64830
  if (!client) {
64824
- console.warn("[full-auto-intercept] No opencodeClient — critic dispatch skipped (fallback to PENDING)");
64831
+ warn("[full-auto-intercept] No opencodeClient — critic dispatch skipped (fallback to PENDING)");
64825
64832
  const result = {
64826
64833
  verdict: "PENDING",
64827
64834
  reasoning: "No opencodeClient available — critic dispatch not possible",
@@ -64834,7 +64841,7 @@ async function dispatchCriticAndWriteEvent(directory, architectOutput, criticCon
64834
64841
  return result;
64835
64842
  }
64836
64843
  const oversightAgent = createCriticAutonomousOversightAgent(criticModel, criticContext);
64837
- console.log(`[full-auto-intercept] Dispatching critic: ${oversightAgent.name} using model ${criticModel}`);
64844
+ log(`[full-auto-intercept] Dispatching critic: ${oversightAgent.name} using model ${criticModel}`);
64838
64845
  let ephemeralSessionId;
64839
64846
  const cleanup = () => {
64840
64847
  if (ephemeralSessionId) {
@@ -64852,7 +64859,7 @@ async function dispatchCriticAndWriteEvent(directory, architectOutput, criticCon
64852
64859
  throw new Error(`Failed to create critic session: ${JSON.stringify(createResult.error)}`);
64853
64860
  }
64854
64861
  ephemeralSessionId = createResult.data.id;
64855
- console.log(`[full-auto-intercept] Created ephemeral session: ${ephemeralSessionId}`);
64862
+ log(`[full-auto-intercept] Created ephemeral session: ${ephemeralSessionId}`);
64856
64863
  const promptResult = await client.session.prompt({
64857
64864
  path: { id: ephemeralSessionId },
64858
64865
  body: {
@@ -64867,9 +64874,9 @@ async function dispatchCriticAndWriteEvent(directory, architectOutput, criticCon
64867
64874
  const textParts = promptResult.data.parts.filter((p) => p.type === "text");
64868
64875
  criticResponse = textParts.map((p) => p.text).join(`
64869
64876
  `);
64870
- console.log(`[full-auto-intercept] Critic response received (${criticResponse.length} chars)`);
64877
+ log(`[full-auto-intercept] Critic response received (${criticResponse.length} chars)`);
64871
64878
  if (!criticResponse.trim()) {
64872
- console.warn("[full-auto-intercept] Critic returned empty response — using fallback verdict");
64879
+ warn("[full-auto-intercept] Critic returned empty response — using fallback verdict");
64873
64880
  criticResponse = `VERDICT: NEEDS_REVISION
64874
64881
  REASONING: Critic returned empty response
64875
64882
  EVIDENCE_CHECKED: none
@@ -64882,9 +64889,9 @@ ESCALATION_NEEDED: NO`;
64882
64889
  let parsed;
64883
64890
  try {
64884
64891
  parsed = parseCriticResponse(criticResponse);
64885
- console.log(`[full-auto-intercept] Critic verdict: ${parsed.verdict} | escalation: ${parsed.escalationNeeded}`);
64892
+ log(`[full-auto-intercept] Critic verdict: ${parsed.verdict} | escalation: ${parsed.escalationNeeded}`);
64886
64893
  } catch (parseError) {
64887
- console.error(`[full-auto-intercept] Failed to parse critic response: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
64894
+ error48(`[full-auto-intercept] Failed to parse critic response: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
64888
64895
  parsed = {
64889
64896
  verdict: "NEEDS_REVISION",
64890
64897
  reasoning: "Critic response parsing failed — defaulting to NEEDS_REVISION",
@@ -64897,7 +64904,7 @@ ESCALATION_NEEDED: NO`;
64897
64904
  try {
64898
64905
  await writeAutoOversightEvent(directory, architectOutput, parsed.verdict, parsed.reasoning, parsed.evidenceChecked, interactionCount, deadlockCount, escalationType);
64899
64906
  } catch (writeError) {
64900
- console.error(`[full-auto-intercept] Failed to write auto_oversight event: ${writeError instanceof Error ? writeError.message : String(writeError)}`);
64907
+ error48(`[full-auto-intercept] Failed to write auto_oversight event: ${writeError instanceof Error ? writeError.message : String(writeError)}`);
64901
64908
  }
64902
64909
  return parsed;
64903
64910
  }
@@ -64966,7 +64973,7 @@ function createFullAutoInterceptHook(config3, directory) {
64966
64973
  const lastQuestionHash = session.fullAutoLastQuestionHash;
64967
64974
  if (lastQuestionHash === questionHash) {
64968
64975
  session.fullAutoDeadlockCount = (session.fullAutoDeadlockCount ?? 0) + 1;
64969
- console.warn(`[full-auto-intercept] Potential deadlock detected (count: ${session.fullAutoDeadlockCount}/${deadlockThreshold}) — identical question repeated`);
64976
+ warn(`[full-auto-intercept] Potential deadlock detected (count: ${session.fullAutoDeadlockCount}/${deadlockThreshold}) — identical question repeated`);
64970
64977
  if (session.fullAutoDeadlockCount >= deadlockThreshold) {
64971
64978
  const escalated = await handleEscalation(directory, "deadlock", sessionID, architectText, session.fullAutoInteractionCount ?? 0, session.fullAutoDeadlockCount, escalationMode);
64972
64979
  if (escalated)
@@ -64978,14 +64985,14 @@ function createFullAutoInterceptHook(config3, directory) {
64978
64985
  session.fullAutoLastQuestionHash = questionHash;
64979
64986
  }
64980
64987
  }
64981
- console.log(`[full-auto-intercept] Escalation detected (${escalationType}) — triggering autonomous oversight`);
64988
+ log(`[full-auto-intercept] Escalation detected (${escalationType}) — triggering autonomous oversight`);
64982
64989
  const criticContext = buildCriticContext(architectText, escalationType);
64983
64990
  const criticModel = fullAutoConfig.critic_model ?? "claude-sonnet-4-20250514";
64984
64991
  const oversightAgent = createCriticAutonomousOversightAgent(criticModel, criticContext);
64985
64992
  const architectAgent = architectMessage.info?.agent;
64986
64993
  const resolvedOversightAgentName = resolveOversightAgentName(architectAgent);
64987
64994
  const dispatchAgentName = resolvedOversightAgentName && resolvedOversightAgentName.length > 0 ? resolvedOversightAgentName : "critic_oversight";
64988
- console.log(`[full-auto-intercept] Created autonomous oversight agent: ${oversightAgent.name} using model ${criticModel} (dispatch as: ${dispatchAgentName})`);
64995
+ log(`[full-auto-intercept] Created autonomous oversight agent: ${oversightAgent.name} using model ${criticModel} (dispatch as: ${dispatchAgentName})`);
64989
64996
  const criticResult = await dispatchCriticAndWriteEvent(directory, architectText, criticContext, criticModel, escalationType, session?.fullAutoInteractionCount ?? 0, session?.fullAutoDeadlockCount ?? 0, dispatchAgentName);
64990
64997
  injectVerdictIntoMessages(messages, lastArchitectMessageIndex, criticResult, escalationType, dispatchAgentName);
64991
64998
  };
@@ -65058,19 +65065,19 @@ This escalation requires human intervention. The swarm has been paused.
65058
65065
  Please review the architect's output above and provide guidance.
65059
65066
  `;
65060
65067
  fs33.writeFileSync(reportPath, reportContent, "utf-8");
65061
- console.log(`[full-auto-intercept] Escalation report written to: ${reportPath}`);
65068
+ log(`[full-auto-intercept] Escalation report written to: ${reportPath}`);
65062
65069
  } catch (error93) {
65063
- console.error(`[full-auto-intercept] Failed to write escalation report:`, error93 instanceof Error ? error93.message : String(error93));
65070
+ error48(`[full-auto-intercept] Failed to write escalation report:`, error93 instanceof Error ? error93.message : String(error93));
65064
65071
  }
65065
65072
  }
65066
65073
  async function handleEscalation(directory, reason, sessionID, architectOutput, interactionCount, deadlockCount, escalationMode, phase) {
65067
65074
  telemetry.autoOversightEscalation(sessionID ?? "unknown", reason, interactionCount, deadlockCount, phase);
65068
65075
  await writeEscalationReport(directory, reason, architectOutput, interactionCount, deadlockCount, phase);
65069
65076
  if (escalationMode === "terminate") {
65070
- console.error(`[full-auto-intercept] ESCALATION (terminate mode) — reason: ${reason}, session: ${sessionID}`);
65077
+ error48(`[full-auto-intercept] ESCALATION (terminate mode) — reason: ${reason}, session: ${sessionID}`);
65071
65078
  process.exit(1);
65072
65079
  }
65073
- console.warn(`[full-auto-intercept] ESCALATION (pause mode) — reason: ${reason}, session: ${sessionID}`);
65080
+ warn(`[full-auto-intercept] ESCALATION (pause mode) — reason: ${reason}, session: ${sessionID}`);
65074
65081
  return true;
65075
65082
  }
65076
65083
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.86.9",
3
+ "version": "6.86.10",
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",