opencode-orchestrator 0.8.3 → 0.8.4
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TASK_STATUS - Task status constants
|
|
2
|
+
* TASK_STATUS - Task status constants (for parallel tasks)
|
|
3
3
|
*/
|
|
4
4
|
export declare const TASK_STATUS: {
|
|
5
5
|
readonly PENDING: "pending";
|
|
@@ -10,3 +10,12 @@ export declare const TASK_STATUS: {
|
|
|
10
10
|
readonly TIMEOUT: "timeout";
|
|
11
11
|
readonly CANCELLED: "cancelled";
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* TODO_STATUS - Todo item status constants
|
|
15
|
+
*/
|
|
16
|
+
export declare const TODO_STATUS: {
|
|
17
|
+
readonly PENDING: "pending";
|
|
18
|
+
readonly IN_PROGRESS: "in_progress";
|
|
19
|
+
readonly COMPLETED: "completed";
|
|
20
|
+
readonly CANCELLED: "cancelled";
|
|
21
|
+
};
|
|
@@ -8,6 +8,7 @@ import type { Todo } from "./interfaces.js";
|
|
|
8
8
|
export declare function formatProgress(todos: Todo[]): string;
|
|
9
9
|
/**
|
|
10
10
|
* Generate continuation prompt when todos remain
|
|
11
|
+
* Enforces parallel dispatch when multiple independent tasks exist
|
|
11
12
|
*/
|
|
12
13
|
export declare function generateContinuationPrompt(todos: Todo[]): string;
|
|
13
14
|
/**
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,12 @@ var TASK_STATUS = {
|
|
|
30
30
|
TIMEOUT: "timeout",
|
|
31
31
|
CANCELLED: "cancelled"
|
|
32
32
|
};
|
|
33
|
+
var TODO_STATUS = {
|
|
34
|
+
PENDING: "pending",
|
|
35
|
+
IN_PROGRESS: "in_progress",
|
|
36
|
+
COMPLETED: "completed",
|
|
37
|
+
CANCELLED: "cancelled"
|
|
38
|
+
};
|
|
33
39
|
|
|
34
40
|
// src/shared/constants.ts
|
|
35
41
|
var TIME = {
|
|
@@ -16329,19 +16335,21 @@ function formatProgress(todos) {
|
|
|
16329
16335
|
}
|
|
16330
16336
|
function generateContinuationPrompt(todos) {
|
|
16331
16337
|
const incomplete = todos.filter(
|
|
16332
|
-
(t) => t.status !==
|
|
16338
|
+
(t) => t.status !== TODO_STATUS.COMPLETED && t.status !== TODO_STATUS.CANCELLED
|
|
16333
16339
|
);
|
|
16334
16340
|
if (incomplete.length === 0) {
|
|
16335
16341
|
return "";
|
|
16336
16342
|
}
|
|
16337
16343
|
const next = getNextPending(todos);
|
|
16344
|
+
const pendingTasks = incomplete.filter((t) => t.status === TODO_STATUS.PENDING);
|
|
16345
|
+
const pendingCount = pendingTasks.length;
|
|
16338
16346
|
let prompt = `<todo_continuation>
|
|
16339
16347
|
\u{1F4CB} **TODO Progress**: ${formatProgress(todos)}
|
|
16340
16348
|
|
|
16341
16349
|
**Incomplete Tasks** (${incomplete.length} remaining):
|
|
16342
16350
|
`;
|
|
16343
16351
|
for (const todo of incomplete.slice(0, 5)) {
|
|
16344
|
-
const status = todo.status ===
|
|
16352
|
+
const status = todo.status === TODO_STATUS.IN_PROGRESS ? "\u{1F504}" : "\u23F3";
|
|
16345
16353
|
const priority = todo.priority === "high" ? "\u{1F534}" : todo.priority === "medium" ? "\u{1F7E1}" : "\u{1F7E2}";
|
|
16346
16354
|
prompt += `${status} ${priority} [${todo.id}] ${todo.content}
|
|
16347
16355
|
`;
|
|
@@ -16350,13 +16358,33 @@ function generateContinuationPrompt(todos) {
|
|
|
16350
16358
|
prompt += `... and ${incomplete.length - 5} more
|
|
16351
16359
|
`;
|
|
16352
16360
|
}
|
|
16353
|
-
|
|
16361
|
+
if (pendingCount >= 2) {
|
|
16362
|
+
prompt += `
|
|
16363
|
+
\u26A1 **PARALLEL DISPATCH REQUIRED** \u26A1
|
|
16364
|
+
You have ${pendingCount} pending tasks. Launch them ALL IN PARALLEL for maximum efficiency:
|
|
16365
|
+
|
|
16366
|
+
\`\`\`
|
|
16367
|
+
// EXECUTE NOW - Launch all ${pendingCount} tasks simultaneously:
|
|
16368
|
+
`;
|
|
16369
|
+
for (const todo of pendingTasks.slice(0, 6)) {
|
|
16370
|
+
prompt += `delegate_task({ agent: "Worker", prompt: "${todo.content}", background: true })
|
|
16371
|
+
`;
|
|
16372
|
+
}
|
|
16373
|
+
prompt += `\`\`\`
|
|
16374
|
+
|
|
16375
|
+
\u26A0\uFE0F Do NOT run these sequentially. Use background=true for ALL.
|
|
16376
|
+
After launching, use list_tasks to monitor progress.
|
|
16377
|
+
|
|
16378
|
+
`;
|
|
16379
|
+
} else {
|
|
16380
|
+
prompt += `
|
|
16354
16381
|
**Action Required**:
|
|
16355
16382
|
1. Continue working on incomplete todos
|
|
16356
16383
|
2. Mark each task complete when finished
|
|
16357
16384
|
3. Do NOT stop until all todos are completed or cancelled
|
|
16358
16385
|
|
|
16359
16386
|
`;
|
|
16387
|
+
}
|
|
16360
16388
|
if (next) {
|
|
16361
16389
|
prompt += `**Next Task**: [${next.id}] ${next.content}
|
|
16362
16390
|
`;
|
|
@@ -129,7 +129,7 @@ export declare const PROMPTS: {
|
|
|
129
129
|
readonly CONTINUE_DEFAULT: "continue from where we left off";
|
|
130
130
|
};
|
|
131
131
|
export { AGENT_NAMES } from "./agent.js";
|
|
132
|
-
export { TASK_STATUS } from "../core/agents/consts/task-status.const.js";
|
|
132
|
+
export { TASK_STATUS, TODO_STATUS } from "../core/agents/consts/task-status.const.js";
|
|
133
133
|
export type { ParallelTaskStatus } from "../core/agents/types/parallel-task-status.type.js";
|
|
134
134
|
export declare const STATUS_EMOJI: {
|
|
135
135
|
readonly pending: "⏳";
|
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.8.
|
|
5
|
+
"version": "0.8.4",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|