opencode-orchestrator 1.2.13 → 1.2.14

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.
@@ -5,62 +5,18 @@
5
5
  *
6
6
  * The LLM creates and checks items in .opencode/verification-checklist.md
7
7
  * The hook system verifies all items are checked before allowing CONCLUDE.
8
- *
9
- * This approach:
10
- * 1. LLM discovers environment and creates appropriate checklist items
11
- * 2. LLM executes and marks items as complete
12
- * 3. Hook verifies all items are checked (hard gate)
13
8
  */
14
9
  import { type ChecklistCategory, type ChecklistItem, type ChecklistVerificationResult, type VerificationResult } from "../../shared/index.js";
15
10
  export type { ChecklistItem, ChecklistCategory, ChecklistVerificationResult, VerificationResult };
16
- /** Path to the verification checklist file (re-export for convenience) */
17
11
  export declare const CHECKLIST_FILE: ".opencode/verification-checklist.md";
18
- /**
19
- * Parse checklist from markdown content
20
- */
21
12
  export declare function parseChecklist(content: string): ChecklistItem[];
22
- /**
23
- * Read checklist from file
24
- */
25
13
  export declare function readChecklist(directory: string): ChecklistItem[];
26
- /**
27
- * Verify that all checklist items are complete
28
- */
29
14
  export declare function verifyChecklist(directory: string): ChecklistVerificationResult;
30
- /**
31
- * Quick check if checklist exists and has items
32
- */
33
15
  export declare function hasValidChecklist(directory: string): boolean;
34
- /**
35
- * Get checklist summary for display
36
- */
37
16
  export declare function getChecklistSummary(directory: string): string;
38
- /**
39
- * Build prompt for when checklist verification fails
40
- */
41
17
  export declare function buildChecklistFailurePrompt(result: ChecklistVerificationResult): string;
42
- /**
43
- * Build checklist creation prompt (for inclusion in agent prompts)
44
- */
45
18
  export declare function getChecklistCreationInstructions(): string;
46
- /**
47
- * Verify mission completion conditions
48
- *
49
- * Checks (in order):
50
- * 1. Verification checklist (primary - if exists)
51
- * 2. TODO completion rate (fallback)
52
- * 3. Sync issues (always checked)
53
- */
54
19
  export declare function verifyMissionCompletion(directory: string): VerificationResult;
55
- /**
56
- * Build prompt for when conclusion is rejected due to verification failure
57
- */
58
20
  export declare function buildVerificationFailurePrompt(result: VerificationResult): string;
59
- /**
60
- * Build prompt for when TODO is incomplete
61
- */
62
21
  export declare function buildTodoIncompletePrompt(result: VerificationResult): string;
63
- /**
64
- * Build a concise status summary for logs
65
- */
66
22
  export declare function buildVerificationSummary(result: VerificationResult): string;
package/dist/index.js CHANGED
@@ -417,6 +417,10 @@ var init_memory_hooks = __esm({
417
417
  COMPLETED: "completed",
418
418
  PROGRESS: "progress",
419
419
  FAILED: "failed"
420
+ },
421
+ PREFIX: {
422
+ TASK: "task-",
423
+ FILE: "file-task-"
420
424
  }
421
425
  };
422
426
  }
@@ -38389,11 +38393,12 @@ import * as fs10 from "node:fs";
38389
38393
  import * as path9 from "node:path";
38390
38394
 
38391
38395
  // src/core/sync/todo-parser.ts
38396
+ init_shared();
38392
38397
  function parseTodoMd(content) {
38393
38398
  const lines = content.split("\n");
38394
38399
  const todos = [];
38395
38400
  const generateId = (text, index2) => {
38396
- return `file-task-${index2}-${text.substring(0, 10).replace(/[^a-zA-Z0-9]/g, "")}`;
38401
+ return `${TODO_CONSTANTS.PREFIX.FILE}${index2}-${text.substring(0, 10).replace(/[^a-zA-Z0-9]/g, "")}`;
38397
38402
  };
38398
38403
  let index = 0;
38399
38404
  for (const line of lines) {
@@ -38401,28 +38406,28 @@ function parseTodoMd(content) {
38401
38406
  if (match) {
38402
38407
  const [, statusChar, text] = match;
38403
38408
  const content2 = text.trim();
38404
- let status = "pending";
38409
+ let status = TODO_STATUS2.PENDING;
38405
38410
  switch (statusChar.toLowerCase()) {
38406
38411
  case "x":
38407
- status = "completed";
38412
+ status = TODO_STATUS2.COMPLETED;
38408
38413
  break;
38409
38414
  case "/":
38410
38415
  case ".":
38411
- status = "in_progress";
38416
+ status = TODO_STATUS2.IN_PROGRESS;
38412
38417
  break;
38413
38418
  case "-":
38414
- status = "cancelled";
38419
+ status = TODO_STATUS2.CANCELLED;
38415
38420
  break;
38416
38421
  case " ":
38417
38422
  default:
38418
- status = "pending";
38423
+ status = TODO_STATUS2.PENDING;
38419
38424
  break;
38420
38425
  }
38421
38426
  todos.push({
38422
38427
  id: generateId(content2, index),
38423
38428
  content: content2,
38424
38429
  status,
38425
- priority: "medium",
38430
+ priority: STATUS_LABEL.MEDIUM,
38426
38431
  // Default priority for file items
38427
38432
  createdAt: /* @__PURE__ */ new Date()
38428
38433
  });
@@ -38441,16 +38446,6 @@ var TodoSyncService = class {
38441
38446
  taskTodos = /* @__PURE__ */ new Map();
38442
38447
  updateTimeout = null;
38443
38448
  watcher = null;
38444
- // We only want to sync to the "primary" session or all sessions?
38445
- // The design says `syncTaskStore(sessionID)`.
38446
- // Usually TUI TODO is per session.
38447
- // However, `todo.md` is global (project level).
38448
- // So we should probably broadcast to active sessions or just the one associated with the tasks?
38449
- // Current TUI limitation: we might need to know which session to update.
38450
- // For TUI sidebar, we usually update the session the user is looking at.
38451
- // But we don't know that.
38452
- // We will maintain a set of "active sessions" provided by index.ts or just update relevant ones.
38453
- // For Phase 1, we might just update the sessions we know about (parents of tasks) or register sessions.
38454
38449
  activeSessions = /* @__PURE__ */ new Set();
38455
38450
  constructor(client, directory) {
38456
38451
  this.client = client;
@@ -38522,18 +38517,18 @@ var TodoSyncService = class {
38522
38517
  }
38523
38518
  async sendTodosToSession(sessionID) {
38524
38519
  const taskTodosList = Array.from(this.taskTodos.values()).map((t) => {
38525
- let status = "pending";
38520
+ let status = TODO_STATUS2.PENDING;
38526
38521
  const s = t.status.toLowerCase();
38527
- if (s.includes("run") || s.includes("wait") || s.includes("que")) status = "in_progress";
38528
- else if (s.includes("complete") || s.includes("done")) status = "completed";
38529
- else if (s.includes("fail") || s.includes("error")) status = "cancelled";
38530
- else if (s.includes("cancel")) status = "cancelled";
38522
+ if (s.includes(STATUS_LABEL.RUNNING) || s.includes("wait") || s.includes("que")) status = TODO_STATUS2.IN_PROGRESS;
38523
+ else if (s.includes(STATUS_LABEL.COMPLETED) || s.includes(STATUS_LABEL.DONE)) status = TODO_STATUS2.COMPLETED;
38524
+ else if (s.includes(STATUS_LABEL.FAILED) || s.includes(STATUS_LABEL.ERROR)) status = TODO_STATUS2.CANCELLED;
38525
+ else if (s.includes(STATUS_LABEL.CANCELLED)) status = TODO_STATUS2.CANCELLED;
38531
38526
  return {
38532
- id: `task-${t.id}`,
38527
+ id: `${TODO_CONSTANTS.PREFIX.TASK}${t.id}`,
38533
38528
  // Prefix to avoid collision
38534
38529
  content: `[${t.agent.toUpperCase()}] ${t.description}`,
38535
38530
  status,
38536
- priority: t.isBackground ? "low" : "high",
38531
+ priority: t.isBackground ? STATUS_LABEL.LOW : STATUS_LABEL.HIGH,
38537
38532
  createdAt: /* @__PURE__ */ new Date()
38538
38533
  };
38539
38534
  });
@@ -38541,11 +38536,17 @@ var TodoSyncService = class {
38541
38536
  ...this.fileTodos,
38542
38537
  ...taskTodosList
38543
38538
  ];
38539
+ const payloadTodos = merged.map((todo) => ({
38540
+ id: todo.id,
38541
+ content: todo.content,
38542
+ status: todo.status,
38543
+ priority: todo.priority
38544
+ }));
38544
38545
  try {
38545
38546
  await this.client.session.todo({
38546
38547
  path: { id: sessionID },
38547
38548
  // Standardize to id
38548
- body: { todos: merged }
38549
+ body: { todos: payloadTodos }
38549
38550
  });
38550
38551
  } catch (error92) {
38551
38552
  }
@@ -47,6 +47,10 @@ export declare const TODO_CONSTANTS: {
47
47
  readonly PROGRESS: "progress";
48
48
  readonly FAILED: "failed";
49
49
  };
50
+ readonly PREFIX: {
51
+ readonly TASK: "task-";
52
+ readonly FILE: "file-task-";
53
+ };
50
54
  };
51
55
  export declare const TUI_CONSTANTS: {
52
56
  readonly BAR_WIDTH: 30;
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": "1.2.13",
5
+ "version": "1.2.14",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {