opencode-orchestrator 0.5.22 → 0.5.24
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 +35 -34
- package/dist/shared/agent.d.ts +7 -7
- package/dist/tools/callAgent.d.ts +5 -5
- package/dist/utils/sanity.d.ts +2 -2
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -9,13 +9,14 @@ import { createRequire } from "node:module";
|
|
|
9
9
|
|
|
10
10
|
// src/shared/agent.ts
|
|
11
11
|
var AGENT_NAMES = {
|
|
12
|
-
COMMANDER: "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
COMMANDER: "Commander",
|
|
13
|
+
// Capital C like Sisyphus
|
|
14
|
+
ARCHITECT: "Architect",
|
|
15
|
+
BUILDER: "Builder",
|
|
16
|
+
INSPECTOR: "Inspector",
|
|
17
|
+
RECORDER: "Recorder",
|
|
18
|
+
LIBRARIAN: "Librarian",
|
|
19
|
+
RESEARCHER: "Researcher"
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
// src/core/agents/consts/task-status.const.ts
|
|
@@ -113,13 +114,13 @@ var MISSION = {
|
|
|
113
114
|
CANCEL_COMMAND: "/cancel"
|
|
114
115
|
};
|
|
115
116
|
var AGENT_EMOJI = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
Architect: "\u{1F3D7}\uFE0F",
|
|
118
|
+
Builder: "\u{1F528}",
|
|
119
|
+
Inspector: "\u{1F50D}",
|
|
120
|
+
Recorder: "\u{1F4BE}",
|
|
121
|
+
Commander: "\u{1F3AF}",
|
|
122
|
+
Librarian: "\u{1F4DA}",
|
|
123
|
+
Researcher: "\u{1F52C}"
|
|
123
124
|
};
|
|
124
125
|
var PART_TYPES = {
|
|
125
126
|
TEXT: "text",
|
|
@@ -506,15 +507,15 @@ MISSION: [goal in one line]
|
|
|
506
507
|
|
|
507
508
|
TODO_HIERARCHY:
|
|
508
509
|
- [L1] Main objective 1
|
|
509
|
-
- [L2] Sub-task 1.1 | agent:
|
|
510
|
-
- [L2] Sub-task 1.2 | agent:
|
|
511
|
-
- [L2] Sub-task 1.3 | agent:
|
|
510
|
+
- [L2] Sub-task 1.1 | agent:Builder | parallel_group:A
|
|
511
|
+
- [L2] Sub-task 1.2 | agent:Builder | parallel_group:A
|
|
512
|
+
- [L2] Sub-task 1.3 | agent:Inspector | depends:1.1,1.2
|
|
512
513
|
- [L1] Main objective 2
|
|
513
|
-
- [L2] Sub-task 2.1 | agent:
|
|
514
|
-
- [L2] Sub-task 2.2 | agent:
|
|
515
|
-
- [L3] Atomic action 2.2.1 | agent:
|
|
516
|
-
- [L3] Atomic action 2.2.2 | agent:
|
|
517
|
-
- [L3] Verify 2.2 | agent:
|
|
514
|
+
- [L2] Sub-task 2.1 | agent:Librarian
|
|
515
|
+
- [L2] Sub-task 2.2 | agent:Builder | depends:2.1
|
|
516
|
+
- [L3] Atomic action 2.2.1 | agent:Builder
|
|
517
|
+
- [L3] Atomic action 2.2.2 | agent:Builder | parallel_group:B
|
|
518
|
+
- [L3] Verify 2.2 | agent:Inspector | depends:2.2.1,2.2.2
|
|
518
519
|
|
|
519
520
|
PARALLEL_EXECUTION:
|
|
520
521
|
- Group A: [1.1, 1.2] \u2192 Run simultaneously
|
|
@@ -539,17 +540,17 @@ REVISED_HIERARCHY:
|
|
|
539
540
|
</strategy_mode>
|
|
540
541
|
|
|
541
542
|
<agents_available>
|
|
542
|
-
-
|
|
543
|
-
-
|
|
544
|
-
-
|
|
545
|
-
-
|
|
543
|
+
- Builder: Code implementation
|
|
544
|
+
- Inspector: Verification and bug fixing
|
|
545
|
+
- Librarian: Documentation research (use BEFORE unfamiliar APIs)
|
|
546
|
+
- Researcher: Pre-task investigation
|
|
546
547
|
</agents_available>
|
|
547
548
|
|
|
548
549
|
<rules>
|
|
549
550
|
- One action per task
|
|
550
|
-
- Always end branches with
|
|
551
|
+
- Always end branches with Inspector task
|
|
551
552
|
- Group unrelated tasks (parallel execution)
|
|
552
|
-
- Use
|
|
553
|
+
- Use Librarian/Researcher before implementing unfamiliar features
|
|
553
554
|
- Be specific about files, patterns, and verification
|
|
554
555
|
</rules>`,
|
|
555
556
|
canWrite: false,
|
|
@@ -13581,12 +13582,12 @@ Before any planning or coding, you MUST understand:
|
|
|
13581
13582
|
</phase_1>
|
|
13582
13583
|
|
|
13583
13584
|
<phase_2 name="PLAN">
|
|
13584
|
-
- Call
|
|
13585
|
+
- Call Architect with Environment Context.
|
|
13585
13586
|
- Plan must respect the Infra (e.g. build location).
|
|
13586
13587
|
</phase_2>
|
|
13587
13588
|
|
|
13588
13589
|
<phase_3 name="EXECUTE">
|
|
13589
|
-
- Use
|
|
13590
|
+
- Use Builder with environment constraints.
|
|
13590
13591
|
- Match existing patterns exactly.
|
|
13591
13592
|
</phase_3>
|
|
13592
13593
|
|
|
@@ -15386,7 +15387,7 @@ var RECOVERY_PROMPT = `<anomaly_recovery>
|
|
|
15386
15387
|
<instructions>
|
|
15387
15388
|
- If a sub-agent produced bad output: try a different agent or simpler task
|
|
15388
15389
|
- If stuck in a loop: break down the task into smaller pieces
|
|
15389
|
-
- If context seems corrupted: call
|
|
15390
|
+
- If context seems corrupted: call Recorder to restore context
|
|
15390
15391
|
- THINK in English for maximum stability
|
|
15391
15392
|
</instructions>
|
|
15392
15393
|
|
|
@@ -15398,8 +15399,8 @@ var ESCALATION_PROMPT = `<critical_anomaly>
|
|
|
15398
15399
|
<emergency_protocol>
|
|
15399
15400
|
1. STOP current execution path immediately
|
|
15400
15401
|
2. DO NOT continue with the same approach - it is failing
|
|
15401
|
-
3. CALL
|
|
15402
|
-
4. If
|
|
15402
|
+
3. CALL Architect for a completely new strategy
|
|
15403
|
+
4. If Architect also fails: report status to user and await guidance
|
|
15403
15404
|
</emergency_protocol>
|
|
15404
15405
|
|
|
15405
15406
|
<diagnosis>
|
|
@@ -15407,7 +15408,7 @@ The current approach is producing corrupted output.
|
|
|
15407
15408
|
This may indicate: context overload, model instability, or task complexity.
|
|
15408
15409
|
</diagnosis>
|
|
15409
15410
|
|
|
15410
|
-
Request a fresh plan from
|
|
15411
|
+
Request a fresh plan from Architect with reduced scope.
|
|
15411
15412
|
</critical_anomaly>`;
|
|
15412
15413
|
|
|
15413
15414
|
// src/core/cache/constants.ts
|
package/dist/shared/agent.d.ts
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Agent names, types, and interfaces.
|
|
5
5
|
*/
|
|
6
6
|
export declare const AGENT_NAMES: {
|
|
7
|
-
readonly COMMANDER: "
|
|
8
|
-
readonly ARCHITECT: "
|
|
9
|
-
readonly BUILDER: "
|
|
10
|
-
readonly INSPECTOR: "
|
|
11
|
-
readonly RECORDER: "
|
|
12
|
-
readonly LIBRARIAN: "
|
|
13
|
-
readonly RESEARCHER: "
|
|
7
|
+
readonly COMMANDER: "Commander";
|
|
8
|
+
readonly ARCHITECT: "Architect";
|
|
9
|
+
readonly BUILDER: "Builder";
|
|
10
|
+
readonly INSPECTOR: "Inspector";
|
|
11
|
+
readonly RECORDER: "Recorder";
|
|
12
|
+
readonly LIBRARIAN: "Librarian";
|
|
13
|
+
readonly RESEARCHER: "Researcher";
|
|
14
14
|
};
|
|
15
15
|
export type AgentName = (typeof AGENT_NAMES)[keyof typeof AGENT_NAMES];
|
|
16
16
|
export interface AgentDefinition {
|
|
@@ -2,16 +2,16 @@ export declare const callAgentTool: {
|
|
|
2
2
|
description: string;
|
|
3
3
|
args: {
|
|
4
4
|
agent: import("zod").ZodEnum<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Architect: "Architect";
|
|
6
|
+
Builder: "Builder";
|
|
7
|
+
Inspector: "Inspector";
|
|
8
|
+
Recorder: "Recorder";
|
|
9
9
|
}>;
|
|
10
10
|
task: import("zod").ZodString;
|
|
11
11
|
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
12
|
};
|
|
13
13
|
execute(args: {
|
|
14
|
-
agent: "
|
|
14
|
+
agent: "Architect" | "Builder" | "Inspector" | "Recorder";
|
|
15
15
|
task: string;
|
|
16
16
|
context?: string | undefined;
|
|
17
17
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
package/dist/utils/sanity.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export declare function isEmptyOrMeaningless(text: string): boolean;
|
|
|
24
24
|
/**
|
|
25
25
|
* Recovery prompt for single anomaly
|
|
26
26
|
*/
|
|
27
|
-
export declare const RECOVERY_PROMPT = "<anomaly_recovery>\n\u26A0\uFE0F SYSTEM NOTICE: Previous output was malformed (gibberish/loop detected).\n\n<recovery_protocol>\n1. DISCARD the corrupted output completely - do not reference it\n2. RECALL the original mission objective\n3. IDENTIFY the last confirmed successful step\n4. RESTART with a simpler, more focused approach\n</recovery_protocol>\n\n<instructions>\n- If a sub-agent produced bad output: try a different agent or simpler task\n- If stuck in a loop: break down the task into smaller pieces\n- If context seems corrupted: call
|
|
27
|
+
export declare const RECOVERY_PROMPT = "<anomaly_recovery>\n\u26A0\uFE0F SYSTEM NOTICE: Previous output was malformed (gibberish/loop detected).\n\n<recovery_protocol>\n1. DISCARD the corrupted output completely - do not reference it\n2. RECALL the original mission objective\n3. IDENTIFY the last confirmed successful step\n4. RESTART with a simpler, more focused approach\n</recovery_protocol>\n\n<instructions>\n- If a sub-agent produced bad output: try a different agent or simpler task\n- If stuck in a loop: break down the task into smaller pieces\n- If context seems corrupted: call Recorder to restore context\n- THINK in English for maximum stability\n</instructions>\n\nWhat was the original task? Proceed from the last known good state.\n</anomaly_recovery>";
|
|
28
28
|
/**
|
|
29
29
|
* Escalation prompt for multiple consecutive anomalies
|
|
30
30
|
*/
|
|
31
|
-
export declare const ESCALATION_PROMPT = "<critical_anomaly>\n\uD83D\uDEA8 CRITICAL: Multiple consecutive malformed outputs detected.\n\n<emergency_protocol>\n1. STOP current execution path immediately\n2. DO NOT continue with the same approach - it is failing\n3. CALL
|
|
31
|
+
export declare const ESCALATION_PROMPT = "<critical_anomaly>\n\uD83D\uDEA8 CRITICAL: Multiple consecutive malformed outputs detected.\n\n<emergency_protocol>\n1. STOP current execution path immediately\n2. DO NOT continue with the same approach - it is failing\n3. CALL Architect for a completely new strategy\n4. If Architect also fails: report status to user and await guidance\n</emergency_protocol>\n\n<diagnosis>\nThe current approach is producing corrupted output.\nThis may indicate: context overload, model instability, or task complexity.\n</diagnosis>\n\nRequest a fresh plan from Architect with reduced scope.\n</critical_anomaly>";
|
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.
|
|
5
|
+
"version": "0.5.24",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"dev:test": "node dist/scripts/postinstall.js && echo '---' && node dist/scripts/preuninstall.js",
|
|
59
59
|
"dev:cache": "npm run build && rm -rf ~/.cache/opencode/node_modules/opencode-orchestrator && cp -r . ~/.cache/opencode/node_modules/opencode-orchestrator && echo 'SUCCESS: Copied to OpenCode cache. Restart OpenCode.'",
|
|
60
60
|
"reset:local": "brew uninstall opencode 2>/dev/null; rm -rf ~/.config/opencode ~/.opencode ~/.local/share/opencode ~/.cache/opencode/node_modules/opencode-orchestrator && echo '=== Clean done ===' && brew install opencode && echo '{\"plugin\": [\"opencode-orchestrator\"], \"$schema\": \"https://opencode.ai/config.json\"}' > ~/.config/opencode/opencode.json && echo '=== Reset (Dev) complete. Run: opencode ==='",
|
|
61
|
-
"reset:prod": "brew uninstall opencode 2>/dev/null; rm -rf ~/.config/opencode ~/.opencode ~/.local/share/opencode ~/.cache/opencode/node_modules/opencode-orchestrator && echo '=== Clean done ===' && brew install opencode && echo '{\"plugin\": [\"opencode-orchestrator\"], \"$schema\": \"https://opencode.ai/config.json\"}' > ~/.config/opencode/opencode.json && npm install -g opencode-orchestrator && echo '=== Reset (Prod) complete. Run: opencode ==='"
|
|
61
|
+
"reset:prod": "brew uninstall opencode 2>/dev/null; rm -rf ~/.config/opencode ~/.opencode ~/.local/share/opencode ~/.cache/opencode/node_modules/opencode-orchestrator && echo '=== Clean done ===' && brew install opencode && echo '{\"plugin\": [\"opencode-orchestrator\"], \"$schema\": \"https://opencode.ai/config.json\"}' > ~/.config/opencode/opencode.json && npm install -g opencode-orchestrator && echo '=== Reset (Prod) complete. Run: opencode ==='",
|
|
62
|
+
"ginstall": "npm install -g opencode-orchestrator"
|
|
62
63
|
},
|
|
63
64
|
"dependencies": {
|
|
64
65
|
"@opencode-ai/plugin": "^1.1.1",
|