opencode-orchestrator 0.5.24 → 0.5.26

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/index.js CHANGED
@@ -15308,22 +15308,27 @@ function formatElapsedTime(startMs, endMs = Date.now()) {
15308
15308
  }
15309
15309
 
15310
15310
  // src/utils/sanity.ts
15311
+ var SEVERITY = {
15312
+ OK: "ok",
15313
+ WARNING: "warning",
15314
+ CRITICAL: "critical"
15315
+ };
15311
15316
  function checkOutputSanity(text) {
15312
15317
  if (!text || text.length < 50) {
15313
- return { isHealthy: true, severity: "ok" };
15318
+ return { isHealthy: true, severity: SEVERITY.OK };
15314
15319
  }
15315
15320
  if (/(.)\1{15,}/.test(text)) {
15316
15321
  return {
15317
15322
  isHealthy: false,
15318
15323
  reason: "Single character repetition detected",
15319
- severity: "critical"
15324
+ severity: SEVERITY.CRITICAL
15320
15325
  };
15321
15326
  }
15322
15327
  if (/(.{2,6})\1{8,}/.test(text)) {
15323
15328
  return {
15324
15329
  isHealthy: false,
15325
15330
  reason: "Pattern loop detected",
15326
- severity: "critical"
15331
+ severity: SEVERITY.CRITICAL
15327
15332
  };
15328
15333
  }
15329
15334
  if (text.length > 200) {
@@ -15335,7 +15340,7 @@ function checkOutputSanity(text) {
15335
15340
  return {
15336
15341
  isHealthy: false,
15337
15342
  reason: "Low information density",
15338
- severity: "critical"
15343
+ severity: SEVERITY.CRITICAL
15339
15344
  };
15340
15345
  }
15341
15346
  }
@@ -15345,7 +15350,7 @@ function checkOutputSanity(text) {
15345
15350
  return {
15346
15351
  isHealthy: false,
15347
15352
  reason: "Visual gibberish detected",
15348
- severity: "critical"
15353
+ severity: SEVERITY.CRITICAL
15349
15354
  };
15350
15355
  }
15351
15356
  const lines = text.split("\n").filter((l) => l.trim().length > 10);
@@ -15355,7 +15360,7 @@ function checkOutputSanity(text) {
15355
15360
  return {
15356
15361
  isHealthy: false,
15357
15362
  reason: "Excessive line repetition",
15358
- severity: "warning"
15363
+ severity: SEVERITY.WARNING
15359
15364
  };
15360
15365
  }
15361
15366
  }
@@ -15368,11 +15373,11 @@ function checkOutputSanity(text) {
15368
15373
  return {
15369
15374
  isHealthy: false,
15370
15375
  reason: "CJK character spam detected",
15371
- severity: "critical"
15376
+ severity: SEVERITY.CRITICAL
15372
15377
  };
15373
15378
  }
15374
15379
  }
15375
- return { isHealthy: true, severity: "ok" };
15380
+ return { isHealthy: true, severity: SEVERITY.OK };
15376
15381
  }
15377
15382
  var RECOVERY_PROMPT = `<anomaly_recovery>
15378
15383
  \u26A0\uFE0F SYSTEM NOTICE: Previous output was malformed (gibberish/loop detected).
@@ -16474,7 +16479,7 @@ var OrchestratorPlugin = async (input) => {
16474
16479
  name: AGENT_NAMES.COMMANDER,
16475
16480
  description: "Autonomous orchestrator - executes until mission complete",
16476
16481
  mode: "primary",
16477
- prompt: AGENTS.commander.systemPrompt,
16482
+ prompt: AGENTS[AGENT_NAMES.COMMANDER].systemPrompt,
16478
16483
  maxTokens: 64e3,
16479
16484
  thinking: { type: "enabled", budgetTokens: 32e3 },
16480
16485
  color: "#FF6B6B"
@@ -16483,7 +16488,7 @@ var OrchestratorPlugin = async (input) => {
16483
16488
  name: AGENT_NAMES.LIBRARIAN,
16484
16489
  description: "Documentation research specialist - reduces hallucination",
16485
16490
  mode: "subagent",
16486
- prompt: AGENTS.librarian?.systemPrompt || "",
16491
+ prompt: AGENTS[AGENT_NAMES.LIBRARIAN]?.systemPrompt || "",
16487
16492
  maxTokens: 16e3,
16488
16493
  color: "#4ECDC4"
16489
16494
  },
@@ -16491,7 +16496,7 @@ var OrchestratorPlugin = async (input) => {
16491
16496
  name: AGENT_NAMES.RESEARCHER,
16492
16497
  description: "Pre-task investigation - gathers all info before implementation",
16493
16498
  mode: "subagent",
16494
- prompt: AGENTS.researcher?.systemPrompt || "",
16499
+ prompt: AGENTS[AGENT_NAMES.RESEARCHER]?.systemPrompt || "",
16495
16500
  maxTokens: 16e3,
16496
16501
  color: "#45B7D1"
16497
16502
  }
@@ -16499,7 +16504,7 @@ var OrchestratorPlugin = async (input) => {
16499
16504
  config2.command = { ...existingCommands, ...orchestratorCommands };
16500
16505
  config2.agent = { ...existingAgents, ...orchestratorAgents };
16501
16506
  console.log(`[orchestrator] Registered agents: ${Object.keys(orchestratorAgents).join(", ")}`);
16502
- console.log(`[orchestrator] Commander prompt length: ${(AGENTS.commander.systemPrompt || "").length}`);
16507
+ console.log(`[orchestrator] Commander prompt length: ${(AGENTS[AGENT_NAMES.COMMANDER]?.systemPrompt || "").length}`);
16503
16508
  },
16504
16509
  // -----------------------------------------------------------------
16505
16510
  // chat.message hook - runs when user sends a message
@@ -8,10 +8,16 @@
8
8
  * - Visual gibberish (box drawing characters)
9
9
  * - Line repetition
10
10
  */
11
+ export declare const SEVERITY: {
12
+ readonly OK: "ok";
13
+ readonly WARNING: "warning";
14
+ readonly CRITICAL: "critical";
15
+ };
16
+ export type Severity = (typeof SEVERITY)[keyof typeof SEVERITY];
11
17
  export interface SanityResult {
12
18
  isHealthy: boolean;
13
19
  reason?: string;
14
- severity: "ok" | "warning" | "critical";
20
+ severity: Severity;
15
21
  }
16
22
  /**
17
23
  * Check if LLM output shows signs of degeneration
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "opencode-orchestrator",
3
3
  "displayName": "OpenCode Orchestrator",
4
4
  "description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
5
- "version": "0.5.24",
5
+ "version": "0.5.26",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {