opencode-orchestrator 1.2.35 → 1.2.36
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/core/cache/constants.d.ts +2 -2
- package/dist/core/loop/verification.d.ts +2 -2
- package/dist/core/todo/todo-manager.d.ts +1 -9
- package/dist/index.js +57 -30
- package/dist/shared/core/constants/paths.d.ts +16 -10
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/prompt/constants/mandates.d.ts +1 -1
- package/dist/shared/todo/index.d.ts +4 -0
- package/dist/shared/todo/interfaces/index.d.ts +12 -0
- package/dist/shared/verification/constants/checklist.d.ts +1 -1
- package/dist/tools/parallel/update-todo.d.ts +1 -1
- package/dist/tools/slashCommand.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @deprecated Use CACHE from shared/constants instead
|
|
5
5
|
*/
|
|
6
|
-
export declare const CACHE_DIR: ".opencode/docs";
|
|
7
|
-
export declare const METADATA_FILE: ".opencode/docs/_metadata.json";
|
|
6
|
+
export declare const CACHE_DIR: ".opencode/cache/docs";
|
|
7
|
+
export declare const METADATA_FILE: ".opencode/cache/docs/_metadata.json";
|
|
8
8
|
export declare const DEFAULT_TTL_MS: number;
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides a structured checklist system for mission completion verification.
|
|
5
5
|
*
|
|
6
|
-
* The LLM creates and checks items in .opencode/verification-checklist.md
|
|
6
|
+
* The LLM creates and checks items in .opencode/mission/verification-checklist.md
|
|
7
7
|
* The hook system verifies all items are checked before allowing CONCLUDE.
|
|
8
8
|
*/
|
|
9
9
|
import { type ChecklistCategory, type ChecklistItem, type ChecklistVerificationResult, type VerificationResult } from "../../shared/index.js";
|
|
10
10
|
export type { ChecklistItem, ChecklistCategory, ChecklistVerificationResult, VerificationResult };
|
|
11
|
-
export declare const CHECKLIST_FILE: ".opencode/verification-checklist.md";
|
|
11
|
+
export declare const CHECKLIST_FILE: ".opencode/mission/verification-checklist.md";
|
|
12
12
|
export declare function parseChecklist(content: string): ChecklistItem[];
|
|
13
13
|
export declare function readChecklist(directory: string): ChecklistItem[];
|
|
14
14
|
export declare function verifyChecklist(directory: string): ChecklistVerificationResult;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TodoManager - MVCC-based Optimistic Locking with Mutex for TODO Synchronization
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
version: number;
|
|
6
|
-
timestamp: number;
|
|
7
|
-
author: string;
|
|
8
|
-
}
|
|
9
|
-
export interface TodoData {
|
|
10
|
-
content: string;
|
|
11
|
-
version: TodoVersion;
|
|
12
|
-
}
|
|
4
|
+
import { type TodoData } from "../../shared/index.js";
|
|
13
5
|
export declare class TodoManager {
|
|
14
6
|
private static _instance;
|
|
15
7
|
private directory;
|
package/dist/index.js
CHANGED
|
@@ -129,22 +129,29 @@ var init_paths = __esm({
|
|
|
129
129
|
"use strict";
|
|
130
130
|
PATHS = {
|
|
131
131
|
OPENCODE: ".opencode",
|
|
132
|
-
|
|
132
|
+
// Mission State (Ephemeral)
|
|
133
|
+
MISSION_ROOT: ".opencode/mission",
|
|
134
|
+
TODO: ".opencode/mission/todo.md",
|
|
135
|
+
CONTEXT: ".opencode/mission/context.md",
|
|
136
|
+
SUMMARY: ".opencode/mission/summary.md",
|
|
137
|
+
WORK_LOG: ".opencode/mission/work-log.md",
|
|
138
|
+
STATUS: ".opencode/mission/status.md",
|
|
139
|
+
SYNC_ISSUES: ".opencode/mission/sync-issues.md",
|
|
140
|
+
INTEGRATION_STATUS: ".opencode/mission/integration-status.md",
|
|
141
|
+
UNIT_TESTS: ".opencode/mission/unit-tests",
|
|
142
|
+
TODO_VERSION: ".opencode/mission/todo.version.json",
|
|
143
|
+
VERIFICATION_CHECKLIST: ".opencode/mission/verification-checklist.md",
|
|
144
|
+
ACTIVE_TASKS_LOG: ".opencode/mission/active_tasks.jsonl",
|
|
145
|
+
// Cache & Resources
|
|
146
|
+
CACHE_ROOT: ".opencode/cache",
|
|
147
|
+
DOCS: ".opencode/cache/docs",
|
|
148
|
+
DOC_METADATA: ".opencode/cache/docs/_metadata.json",
|
|
149
|
+
// Archive
|
|
133
150
|
ARCHIVE: ".opencode/archive",
|
|
134
151
|
TASK_ARCHIVE: ".opencode/archive/tasks",
|
|
135
152
|
DOC_ARCHIVE: ".opencode/archive/docs",
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
SUMMARY: ".opencode/summary.md",
|
|
139
|
-
DOC_METADATA: ".opencode/docs/_metadata.json",
|
|
140
|
-
// TDD & Parallel Work State
|
|
141
|
-
WORK_LOG: ".opencode/work-log.md",
|
|
142
|
-
UNIT_TESTS: ".opencode/unit-tests",
|
|
143
|
-
SYNC_ISSUES: ".opencode/sync-issues.md",
|
|
144
|
-
INTEGRATION_STATUS: ".opencode/integration-status.md",
|
|
145
|
-
// Progress tracking
|
|
146
|
-
STATUS: ".opencode/status.md",
|
|
147
|
-
// Configuration
|
|
153
|
+
TODO_HISTORY: ".opencode/archive/todo_history.jsonl",
|
|
154
|
+
// Configuration (Static)
|
|
148
155
|
AGENTS_CONFIG: ".opencode/agents.json",
|
|
149
156
|
PLUGINS: ".opencode/plugins"
|
|
150
157
|
};
|
|
@@ -1822,7 +1829,7 @@ var init_checklist = __esm({
|
|
|
1822
1829
|
init_paths();
|
|
1823
1830
|
CHECKLIST = {
|
|
1824
1831
|
/** Path to the verification checklist file */
|
|
1825
|
-
FILE:
|
|
1832
|
+
FILE: PATHS.VERIFICATION_CHECKLIST,
|
|
1826
1833
|
/** Minimum required items for valid checklist */
|
|
1827
1834
|
MIN_ITEMS: 1,
|
|
1828
1835
|
/** Maximum items to show in error messages */
|
|
@@ -1950,6 +1957,21 @@ var init_verification = __esm({
|
|
|
1950
1957
|
}
|
|
1951
1958
|
});
|
|
1952
1959
|
|
|
1960
|
+
// src/shared/todo/interfaces/index.ts
|
|
1961
|
+
var init_interfaces9 = __esm({
|
|
1962
|
+
"src/shared/todo/interfaces/index.ts"() {
|
|
1963
|
+
"use strict";
|
|
1964
|
+
}
|
|
1965
|
+
});
|
|
1966
|
+
|
|
1967
|
+
// src/shared/todo/index.ts
|
|
1968
|
+
var init_todo2 = __esm({
|
|
1969
|
+
"src/shared/todo/index.ts"() {
|
|
1970
|
+
"use strict";
|
|
1971
|
+
init_interfaces9();
|
|
1972
|
+
}
|
|
1973
|
+
});
|
|
1974
|
+
|
|
1953
1975
|
// src/shared/errors/constants/error-patterns.ts
|
|
1954
1976
|
var ERROR_PATTERNS;
|
|
1955
1977
|
var init_error_patterns = __esm({
|
|
@@ -2287,7 +2309,7 @@ var init_mandates = __esm({
|
|
|
2287
2309
|
1. **ZERO TOLERANCE**: Finishing with incomplete \`[ ]\` items is a FAILURE.
|
|
2288
2310
|
2. **FORCED CONTINUATION**: If you stop prematurely, the system will inject a "CONTINUE" prompt and iteration count.
|
|
2289
2311
|
3. **HIERARCHICAL PROOF**: You must provide evidence (tool output) for every \`[x]\` mark.
|
|
2290
|
-
4. **NO PERMISSION**: Do not ask "Should I continue?". The answer is always YES until
|
|
2312
|
+
4. **NO PERMISSION**: Do not ask "Should I continue?". The answer is always YES until \`${PATHS.TODO}\` is 100% checked.
|
|
2291
2313
|
`;
|
|
2292
2314
|
}
|
|
2293
2315
|
});
|
|
@@ -2419,6 +2441,7 @@ var init_shared = __esm({
|
|
|
2419
2441
|
init_message();
|
|
2420
2442
|
init_os();
|
|
2421
2443
|
init_verification();
|
|
2444
|
+
init_todo2();
|
|
2422
2445
|
init_errors();
|
|
2423
2446
|
init_prompt();
|
|
2424
2447
|
init_task_status_const();
|
|
@@ -2971,7 +2994,7 @@ var init_planning_todo_format = __esm({
|
|
|
2971
2994
|
init_shared();
|
|
2972
2995
|
COMMANDER_TODO_FORMAT = `${PROMPT_TAGS.TODO_FORMAT.open}
|
|
2973
2996
|
## Strict Hierarchical Task Decomposition
|
|
2974
|
-
The mission MUST be broken down into a multi-layered hierarchy in
|
|
2997
|
+
The mission MUST be broken down into a multi-layered hierarchy in \`${PATHS.TODO}\`.
|
|
2975
2998
|
This allows for maximum parallel execution and granular verification.
|
|
2976
2999
|
|
|
2977
3000
|
### Hierarchy Levels:
|
|
@@ -3007,7 +3030,7 @@ This allows for maximum parallel execution and granular verification.
|
|
|
3007
3030
|
3. **RECURSIVE REFINEMENT**: If a task is still too abstract, break it down further before executing.
|
|
3008
3031
|
4. **CONTINUOUS VERIFICATION**: Run tests/builds constantly. Do not wait for the end to verify.
|
|
3009
3032
|
|
|
3010
|
-
\u26A0\uFE0F **AUTONOMOUS LOOP**: The system will automatically RESTART you if any \`[ ]\` remain in
|
|
3033
|
+
\u26A0\uFE0F **AUTONOMOUS LOOP**: The system will automatically RESTART you if any \`[ ]\` remain in \`${PATHS.TODO}\`. Do not stop until every box is checked.
|
|
3011
3034
|
${PROMPT_TAGS.TODO_FORMAT.close}`;
|
|
3012
3035
|
}
|
|
3013
3036
|
});
|
|
@@ -4525,7 +4548,7 @@ var init_commander_forbidden = __esm({
|
|
|
4525
4548
|
**COMMANDER FORBIDDEN ACTIONS**
|
|
4526
4549
|
|
|
4527
4550
|
## \u26D4 Premature Conclusion
|
|
4528
|
-
- NEVER claim "mission complete" without 100% check-off in
|
|
4551
|
+
- NEVER claim "mission complete" without 100% check-off in \`${PATHS.TODO}\`.
|
|
4529
4552
|
- NEVER stop before ${AGENT_NAMES.REVIEWER} has verified the integration.
|
|
4530
4553
|
- NEVER assume success based on Worker output alone.
|
|
4531
4554
|
|
|
@@ -17850,7 +17873,7 @@ $ARGUMENTS
|
|
|
17850
17873
|
<execution_rules>
|
|
17851
17874
|
1. Complete this mission without user intervention.
|
|
17852
17875
|
2. Use your full capabilities: hierarchical planning, parallel execution, and strict verification.
|
|
17853
|
-
3. Conclude ONLY when all items in .
|
|
17876
|
+
3. Conclude ONLY when all items in ${PATHS.TODO} are verified and marked [x].
|
|
17854
17877
|
</execution_rules>
|
|
17855
17878
|
</mission>`;
|
|
17856
17879
|
var COMMANDS = {
|
|
@@ -17864,7 +17887,7 @@ var COMMANDS = {
|
|
|
17864
17887
|
template: `<delegate>
|
|
17865
17888
|
<agent>${AGENT_NAMES.PLANNER}</agent>
|
|
17866
17889
|
<objective>Create parallel task plan for: $ARGUMENTS</objective>
|
|
17867
|
-
<success>Valid .
|
|
17890
|
+
<success>Valid ${PATHS.TODO} with tasks, each having id, description, agent, size, dependencies</success>
|
|
17868
17891
|
<must_do>
|
|
17869
17892
|
- Maximize parallelism by grouping independent tasks
|
|
17870
17893
|
- Assign correct agent to each task (${AGENT_NAMES.WORKER} or ${AGENT_NAMES.REVIEWER})
|
|
@@ -17877,7 +17900,7 @@ var COMMANDS = {
|
|
|
17877
17900
|
</must_not>
|
|
17878
17901
|
<context>
|
|
17879
17902
|
- This is planning only, no execution
|
|
17880
|
-
- Output to .
|
|
17903
|
+
- Output to ${PATHS.TODO}
|
|
17881
17904
|
</context>
|
|
17882
17905
|
</delegate>`,
|
|
17883
17906
|
argumentHint: '"complex task to plan"'
|
|
@@ -19114,7 +19137,7 @@ var TaskWAL = class {
|
|
|
19114
19137
|
walPath;
|
|
19115
19138
|
initialized = false;
|
|
19116
19139
|
constructor(customPath) {
|
|
19117
|
-
this.walPath = customPath || path3.resolve(process.cwd(),
|
|
19140
|
+
this.walPath = customPath || path3.resolve(process.cwd(), PATHS.ACTIVE_TASKS_LOG);
|
|
19118
19141
|
}
|
|
19119
19142
|
async init() {
|
|
19120
19143
|
if (this.initialized) return;
|
|
@@ -34252,8 +34275,12 @@ var TodoManager = class _TodoManager {
|
|
|
34252
34275
|
setDirectory(dir) {
|
|
34253
34276
|
this.directory = dir;
|
|
34254
34277
|
this.todoPath = path5.join(this.directory, PATHS.TODO);
|
|
34255
|
-
this.versionPath = path5.join(this.directory,
|
|
34256
|
-
this.historyPath = path5.join(this.directory,
|
|
34278
|
+
this.versionPath = path5.join(this.directory, PATHS.TODO_VERSION);
|
|
34279
|
+
this.historyPath = path5.join(this.directory, PATHS.TODO_HISTORY);
|
|
34280
|
+
const todoDir = path5.dirname(this.todoPath);
|
|
34281
|
+
if (!fs5.existsSync(todoDir)) {
|
|
34282
|
+
fs5.mkdirSync(todoDir, { recursive: true });
|
|
34283
|
+
}
|
|
34257
34284
|
const archiveDir = path5.dirname(this.historyPath);
|
|
34258
34285
|
if (!fs5.existsSync(archiveDir)) {
|
|
34259
34286
|
fs5.mkdirSync(archiveDir, { recursive: true });
|
|
@@ -35151,7 +35178,7 @@ var createShowMetricsTool = () => tool({
|
|
|
35151
35178
|
// src/tools/parallel/update-todo.ts
|
|
35152
35179
|
init_shared();
|
|
35153
35180
|
var createUpdateTodoTool = () => tool({
|
|
35154
|
-
description:
|
|
35181
|
+
description: `Update the status of a task in ${PATHS.TODO} or add a sub-task. Use this for incremental updates instead of rewriting the whole file.`,
|
|
35155
35182
|
args: {
|
|
35156
35183
|
action: tool.schema.enum(["update", "add"]).describe("Action to perform"),
|
|
35157
35184
|
task: tool.schema.string().describe("Text content of the task to update or the parent task to add under"),
|
|
@@ -37085,10 +37112,10 @@ function buildTodoIncompletePrompt(result) {
|
|
|
37085
37112
|
|
|
37086
37113
|
${result.todoIncomplete} task(s) remaining. Continue working on incomplete items.
|
|
37087
37114
|
|
|
37088
|
-
**REQUIRED**: Check .
|
|
37115
|
+
**REQUIRED**: Check ${PATHS.TODO} and complete ALL [ ] items before concluding.
|
|
37089
37116
|
|
|
37090
37117
|
\`\`\`bash
|
|
37091
|
-
cat .
|
|
37118
|
+
cat ${PATHS.TODO}
|
|
37092
37119
|
\`\`\`
|
|
37093
37120
|
|
|
37094
37121
|
**DO NOT** try to finish until ALL items are [x].`;
|
|
@@ -39216,7 +39243,7 @@ ACTIVE MISSION LOOP:
|
|
|
39216
39243
|
- Started: ${loopState.startedAt}
|
|
39217
39244
|
- Original Task: ${loopState.prompt.slice(0, 500)}${loopState.prompt.length > 500 ? "..." : ""}
|
|
39218
39245
|
|
|
39219
|
-
IMPORTANT: Continue this mission after compaction. Check .
|
|
39246
|
+
IMPORTANT: Continue this mission after compaction. Check ${PATHS.TODO} for progress.
|
|
39220
39247
|
The mission is NOT complete until all hierarchical tasks are verified [x].
|
|
39221
39248
|
</mission_context>`;
|
|
39222
39249
|
}
|
|
@@ -39292,8 +39319,8 @@ function buildMissionLoopSystemPrompt(iteration, maxIterations) {
|
|
|
39292
39319
|
You are in an autonomous mission loop. Continue working until ALL tasks are verified and 100% complete.
|
|
39293
39320
|
|
|
39294
39321
|
COMPLETION CRITERIA:
|
|
39295
|
-
- All hierarchical items in .
|
|
39296
|
-
- .
|
|
39322
|
+
- All hierarchical items in ${PATHS.TODO} are marked [x]
|
|
39323
|
+
- ${PATHS.VERIFICATION_CHECKLIST} is fully checked off [x]
|
|
39297
39324
|
- All tests pass and builds succeed
|
|
39298
39325
|
|
|
39299
39326
|
DO NOT stop or ask for permission. Execute autonomously.
|
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const PATHS: {
|
|
5
5
|
readonly OPENCODE: ".opencode";
|
|
6
|
-
readonly
|
|
6
|
+
readonly MISSION_ROOT: ".opencode/mission";
|
|
7
|
+
readonly TODO: ".opencode/mission/todo.md";
|
|
8
|
+
readonly CONTEXT: ".opencode/mission/context.md";
|
|
9
|
+
readonly SUMMARY: ".opencode/mission/summary.md";
|
|
10
|
+
readonly WORK_LOG: ".opencode/mission/work-log.md";
|
|
11
|
+
readonly STATUS: ".opencode/mission/status.md";
|
|
12
|
+
readonly SYNC_ISSUES: ".opencode/mission/sync-issues.md";
|
|
13
|
+
readonly INTEGRATION_STATUS: ".opencode/mission/integration-status.md";
|
|
14
|
+
readonly UNIT_TESTS: ".opencode/mission/unit-tests";
|
|
15
|
+
readonly TODO_VERSION: ".opencode/mission/todo.version.json";
|
|
16
|
+
readonly VERIFICATION_CHECKLIST: ".opencode/mission/verification-checklist.md";
|
|
17
|
+
readonly ACTIVE_TASKS_LOG: ".opencode/mission/active_tasks.jsonl";
|
|
18
|
+
readonly CACHE_ROOT: ".opencode/cache";
|
|
19
|
+
readonly DOCS: ".opencode/cache/docs";
|
|
20
|
+
readonly DOC_METADATA: ".opencode/cache/docs/_metadata.json";
|
|
7
21
|
readonly ARCHIVE: ".opencode/archive";
|
|
8
22
|
readonly TASK_ARCHIVE: ".opencode/archive/tasks";
|
|
9
23
|
readonly DOC_ARCHIVE: ".opencode/archive/docs";
|
|
10
|
-
readonly
|
|
11
|
-
readonly CONTEXT: ".opencode/context.md";
|
|
12
|
-
readonly SUMMARY: ".opencode/summary.md";
|
|
13
|
-
readonly DOC_METADATA: ".opencode/docs/_metadata.json";
|
|
14
|
-
readonly WORK_LOG: ".opencode/work-log.md";
|
|
15
|
-
readonly UNIT_TESTS: ".opencode/unit-tests";
|
|
16
|
-
readonly SYNC_ISSUES: ".opencode/sync-issues.md";
|
|
17
|
-
readonly INTEGRATION_STATUS: ".opencode/integration-status.md";
|
|
18
|
-
readonly STATUS: ".opencode/status.md";
|
|
24
|
+
readonly TODO_HISTORY: ".opencode/archive/todo_history.jsonl";
|
|
19
25
|
readonly AGENTS_CONFIG: ".opencode/agents.json";
|
|
20
26
|
readonly PLUGINS: ".opencode/plugins";
|
|
21
27
|
};
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./tool/index.js";
|
|
|
14
14
|
export * from "./message/index.js";
|
|
15
15
|
export * from "./os/index.js";
|
|
16
16
|
export * from "./verification/index.js";
|
|
17
|
+
export * from "./todo/index.js";
|
|
17
18
|
export * from "./errors/index.js";
|
|
18
19
|
export * from "./prompt/index.js";
|
|
19
20
|
export { TASK_STATUS, TODO_STATUS } from "../core/agents/consts/task-status.const.js";
|
|
@@ -23,4 +23,4 @@ export declare const HPFA_RULES = "1. **Commander-Only Spawning**: All agents ar
|
|
|
23
23
|
/**
|
|
24
24
|
* Autonomous Completion Mandate
|
|
25
25
|
*/
|
|
26
|
-
export declare const AUTONOMOUS_MANDATE
|
|
26
|
+
export declare const AUTONOMOUS_MANDATE: string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const CHECKLIST: {
|
|
10
10
|
/** Path to the verification checklist file */
|
|
11
|
-
readonly FILE: ".opencode/verification-checklist.md";
|
|
11
|
+
readonly FILE: ".opencode/mission/verification-checklist.md";
|
|
12
12
|
/** Minimum required items for valid checklist */
|
|
13
13
|
readonly MIN_ITEMS: 1;
|
|
14
14
|
/** Maximum items to show in error messages */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* update_todo Tool
|
|
3
3
|
*
|
|
4
|
-
* Performs incremental updates to .opencode/todo.md
|
|
4
|
+
* Performs incremental updates to .opencode/mission/todo.md
|
|
5
5
|
*/
|
|
6
6
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
7
7
|
export declare const createUpdateTodoTool: () => ToolDefinition;
|
|
@@ -5,7 +5,7 @@ import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
|
5
5
|
* - /plan: Planning only
|
|
6
6
|
* - /agents: Show architecture
|
|
7
7
|
*/
|
|
8
|
-
export declare const MISSION_MODE_TEMPLATE
|
|
8
|
+
export declare const MISSION_MODE_TEMPLATE: string;
|
|
9
9
|
export declare const COMMANDS: Record<string, {
|
|
10
10
|
description: string;
|
|
11
11
|
template: string;
|
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.
|
|
5
|
+
"version": "1.2.36",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|