opencode-swarm 7.78.1 → 7.78.3

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
@@ -52,7 +52,7 @@ var package_default;
52
52
  var init_package = __esm(() => {
53
53
  package_default = {
54
54
  name: "opencode-swarm",
55
- version: "7.78.1",
55
+ version: "7.78.3",
56
56
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
57
57
  main: "dist/index.js",
58
58
  types: "dist/index.d.ts",
@@ -38738,14 +38738,14 @@ async function computeLearningMetrics(directory, options) {
38738
38738
  const now = options?.now ?? new Date;
38739
38739
  const nowMs = now.getTime();
38740
38740
  const phasesThreshold = options?.currentPhase ?? DEFAULT_PHASES_ALIVE_THRESHOLD;
38741
- const [events, entries] = await Promise.all([
38741
+ const [events, entries, rollups] = await Promise.all([
38742
38742
  readKnowledgeEvents(directory),
38743
- readKnowledge(resolveSwarmKnowledgePath(directory))
38743
+ readKnowledge(resolveSwarmKnowledgePath(directory)),
38744
+ readKnowledgeCounterRollups(directory)
38744
38745
  ]);
38745
38746
  if (events.length === 0 && entries.length === 0) {
38746
38747
  return emptyMetrics();
38747
38748
  }
38748
- const rollups = recomputeCounters(events);
38749
38749
  const entryMap = new Map;
38750
38750
  for (const entry of entries) {
38751
38751
  entryMap.set(entry.id, entry);
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ var package_default;
69
69
  var init_package = __esm(() => {
70
70
  package_default = {
71
71
  name: "opencode-swarm",
72
- version: "7.78.1",
72
+ version: "7.78.3",
73
73
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
74
74
  main: "dist/index.js",
75
75
  types: "dist/index.d.ts",
@@ -26887,7 +26887,8 @@ ${textPart2.text}`;
26887
26887
  const TRANSIENT_PREFIXES = [
26888
26888
  "TRANSIENT ERROR:",
26889
26889
  "MODEL FALLBACK:",
26890
- "DEGRADED:"
26890
+ "DEGRADED:",
26891
+ "[pr-monitor:"
26891
26892
  ];
26892
26893
  const transientAdvisories = allAdvisories.filter((m) => TRANSIENT_PREFIXES.some((p) => m.startsWith(p)));
26893
26894
  if (transientAdvisories.length > 0) {
@@ -60989,14 +60990,14 @@ async function computeLearningMetrics(directory, options) {
60989
60990
  const now = options?.now ?? new Date;
60990
60991
  const nowMs = now.getTime();
60991
60992
  const phasesThreshold = options?.currentPhase ?? DEFAULT_PHASES_ALIVE_THRESHOLD;
60992
- const [events, entries] = await Promise.all([
60993
+ const [events, entries, rollups] = await Promise.all([
60993
60994
  readKnowledgeEvents(directory),
60994
- readKnowledge(resolveSwarmKnowledgePath(directory))
60995
+ readKnowledge(resolveSwarmKnowledgePath(directory)),
60996
+ readKnowledgeCounterRollups(directory)
60995
60997
  ]);
60996
60998
  if (events.length === 0 && entries.length === 0) {
60997
60999
  return emptyMetrics();
60998
61000
  }
60999
- const rollups = recomputeCounters(events);
61000
61001
  const entryMap = new Map;
61001
61002
  for (const entry of entries) {
61002
61003
  entryMap.set(entry.id, entry);
@@ -103181,12 +103182,14 @@ async function searchKnowledge(params) {
103181
103182
  const triggerRecallBoost = triggerRecallHit ? TRIGGER_RECALL_BOOST : 0;
103182
103183
  const finalScore = Math.min(1, Math.max(0, textWeight * textScore + metaWeight * metaScore + ds.score + confBoost + generatedSkillBoost + outcomeBoost + coldStartBonus + synonymBoost + triggerRecallBoost + (hasQuery ? statusBoost(entry.status) : 0)));
103183
103184
  const isCritical = entry.directive_priority === "critical" && (ds.triggerHit || ds.actionHit || ds.agentHit);
103185
+ const isForceHive = forceReadHive && entry.tier === "hive";
103184
103186
  return {
103185
103187
  ...entry,
103186
103188
  retrieval_outcomes: retrievalOutcomes,
103187
103189
  finalScore,
103188
103190
  coldStartBoost: coldStartBonus,
103189
- __critical: isCritical
103191
+ __critical: isCritical,
103192
+ __forceHive: isForceHive
103190
103193
  };
103191
103194
  });
103192
103195
  scored.sort((a, b) => {
@@ -103205,6 +103208,14 @@ async function searchKnowledge(params) {
103205
103208
  seen.add(e.id);
103206
103209
  }
103207
103210
  }
103211
+ for (const e of scored) {
103212
+ if (top.length >= max)
103213
+ break;
103214
+ if (e.__forceHive && !seen.has(e.id)) {
103215
+ top.push(e);
103216
+ seen.add(e.id);
103217
+ }
103218
+ }
103208
103219
  const lambda = clampLambda(config3.retrieval?.mmr_lambda);
103209
103220
  const remaining = scored.filter((e) => !seen.has(e.id));
103210
103221
  const selected = mmrRerank(remaining, top, max, lambda);
@@ -103216,7 +103227,7 @@ async function searchKnowledge(params) {
103216
103227
  seen.add(e.id);
103217
103228
  }
103218
103229
  }
103219
- results = top.map(({ __critical: _c, ...rest }) => rest);
103230
+ results = top.map(({ __critical: _c, __forceHive: _f, ...rest }) => rest);
103220
103231
  } catch (err2) {
103221
103232
  warn(`[search-knowledge] retrieval failed: ${err2 instanceof Error ? err2.message : String(err2)}`);
103222
103233
  results = [];
@@ -104283,14 +104294,6 @@ async function ghExecAsync(args2, cwd) {
104283
104294
  });
104284
104295
  }
104285
104296
  var _internals59 = { ghExec, ghExecAsync };
104286
- function isGhAvailable(cwd) {
104287
- try {
104288
- ghExec(["--version"], cwd);
104289
- return true;
104290
- } catch {
104291
- return false;
104292
- }
104293
- }
104294
104297
  async function getPRStatus(prNumber, repoFullName, cwd) {
104295
104298
  let stdout;
104296
104299
  try {
@@ -104811,7 +104814,7 @@ class PrMonitorWorker {
104811
104814
  const cooldownSeconds = Math.min(this.config.cooldown_seconds * 2 ** (cb.cooldownLevel - 1), this.config.max_cooldown_seconds);
104812
104815
  cb.suspendedUntil = Date.now() + cooldownSeconds * 1000;
104813
104816
  this.circuitBreakerMap.set(correlationId, cb);
104814
- log("[PrMonitorWorker] Circuit breaker tripped for PR", {
104817
+ error48("[PrMonitorWorker] Circuit breaker tripped for PR", {
104815
104818
  correlationId,
104816
104819
  errorCount: cb.errorCount,
104817
104820
  cooldownSeconds
@@ -105988,9 +105991,6 @@ function tickAndMaybeDispatchCadence(directory, sessionID, counter, config3, opt
105988
105991
  return decision;
105989
105992
  }
105990
105993
 
105991
- // src/git/index.ts
105992
- init_branch();
105993
-
105994
105994
  // src/hooks/agent-activity.ts
105995
105995
  init_state();
105996
105996
  init_utils();
@@ -146809,14 +146809,10 @@ async function initializeOpenCodeSwarm(ctx) {
146809
146809
  });
146810
146810
  }
146811
146811
  const prMonitorConfig = PrMonitorConfigSchema.parse(config3.pr_monitor ?? {});
146812
- setOnSubscriptionCreated((directory, _record3) => {
146812
+ function ensurePrMonitorWorkerRunning(directory) {
146813
146813
  try {
146814
146814
  if (!prMonitorConfig.enabled)
146815
146815
  return;
146816
- if (!isGhAvailable(directory)) {
146817
- log("[pr-monitor] gh CLI not available — skipping worker start");
146818
- return;
146819
- }
146820
146816
  if (!prMonitorWorker) {
146821
146817
  prMonitorWorker = new PrMonitorWorker({
146822
146818
  directory,
@@ -146825,13 +146821,16 @@ async function initializeOpenCodeSwarm(ctx) {
146825
146821
  }
146826
146822
  if (!prMonitorWorker.isRunning()) {
146827
146823
  prMonitorWorker.start();
146828
- log("PR Monitor Worker lazy-started", { directory });
146824
+ log("PR Monitor Worker started", { directory });
146829
146825
  }
146830
146826
  } catch (err3) {
146831
- log("PR Monitor Worker failed to lazy-start (non-fatal)", {
146827
+ error48("[pr-monitor] Worker failed to start (non-fatal)", {
146832
146828
  error: err3 instanceof Error ? err3.message : String(err3)
146833
146829
  });
146834
146830
  }
146831
+ }
146832
+ setOnSubscriptionCreated((directory, _record3) => {
146833
+ ensurePrMonitorWorkerRunning(directory);
146835
146834
  });
146836
146835
  let prEventCleanup = null;
146837
146836
  if (prMonitorConfig.enabled) {
@@ -146847,6 +146846,19 @@ async function initializeOpenCodeSwarm(ctx) {
146847
146846
  });
146848
146847
  }
146849
146848
  }
146849
+ if (prMonitorConfig.enabled) {
146850
+ queueMicrotask(() => {
146851
+ listActive(ctx.directory).then((active) => {
146852
+ if (active.length > 0) {
146853
+ ensurePrMonitorWorkerRunning(ctx.directory);
146854
+ }
146855
+ }).catch((err3) => {
146856
+ error48("[pr-monitor] Startup scan failed (non-fatal)", {
146857
+ error: err3 instanceof Error ? err3.message : String(err3)
146858
+ });
146859
+ });
146860
+ });
146861
+ }
146850
146862
  const cleanupAutomation = () => {
146851
146863
  automationManager?.stop();
146852
146864
  prMonitorWorker?.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.78.1",
3
+ "version": "7.78.3",
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",