opencode-orchestrator 0.1.32 → 0.1.34
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.d.ts +1 -0
- package/dist/index.js +15 -0
- package/dist/scripts/postinstall.js +15 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
|
|
|
61
61
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
+
config: (config: Record<string, unknown>) => Promise<void>;
|
|
64
65
|
"chat.message": (input: any, output: any) => Promise<void>;
|
|
65
66
|
"tool.execute.after": (input: {
|
|
66
67
|
tool: string;
|
package/dist/index.js
CHANGED
|
@@ -12968,6 +12968,21 @@ var OrchestratorPlugin = async (input) => {
|
|
|
12968
12968
|
grep_search: grepSearchTool(directory),
|
|
12969
12969
|
glob_search: globSearchTool(directory)
|
|
12970
12970
|
},
|
|
12971
|
+
config: async (config2) => {
|
|
12972
|
+
const existingCommands = config2.command ?? {};
|
|
12973
|
+
const orchestratorCommands = {};
|
|
12974
|
+
for (const [name, cmd] of Object.entries(COMMANDS)) {
|
|
12975
|
+
orchestratorCommands[name] = {
|
|
12976
|
+
description: cmd.description,
|
|
12977
|
+
template: cmd.template,
|
|
12978
|
+
argumentHint: cmd.argumentHint
|
|
12979
|
+
};
|
|
12980
|
+
}
|
|
12981
|
+
config2.command = {
|
|
12982
|
+
...orchestratorCommands,
|
|
12983
|
+
...existingCommands
|
|
12984
|
+
};
|
|
12985
|
+
},
|
|
12971
12986
|
"chat.message": async (input2, output) => {
|
|
12972
12987
|
const parts = output.parts;
|
|
12973
12988
|
const textPartIndex = parts.findIndex((p) => p.type === "text" && p.text);
|
|
@@ -9,9 +9,8 @@ var CONFIG_FILE = join(CONFIG_DIR, "opencode.json");
|
|
|
9
9
|
var PLUGIN_NAME = "opencode-orchestrator";
|
|
10
10
|
function getPluginPath() {
|
|
11
11
|
try {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
return packageRoot.replace(/\/$/, "");
|
|
12
|
+
const packagePath = new URL(".", import.meta.url).pathname;
|
|
13
|
+
return packagePath.replace(/\/$/, "");
|
|
15
14
|
} catch {
|
|
16
15
|
return PLUGIN_NAME;
|
|
17
16
|
}
|
|
@@ -33,17 +32,22 @@ function install() {
|
|
|
33
32
|
config.plugin = [];
|
|
34
33
|
}
|
|
35
34
|
const pluginPath = getPluginPath();
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
const hasPlugin = config.plugin.some((p) => p === PLUGIN_NAME || p === pluginPath || p.includes("opencode-orchestrator"));
|
|
36
|
+
if (!hasPlugin) {
|
|
37
|
+
config.plugin.push(PLUGIN_NAME);
|
|
38
|
+
writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
39
|
+
console.log("✅ Plugin registered!");
|
|
40
|
+
console.log(` Config: ${CONFIG_FILE}`);
|
|
41
|
+
} else {
|
|
42
|
+
console.log("✅ Plugin already registered.");
|
|
43
|
+
}
|
|
42
44
|
console.log("");
|
|
43
45
|
console.log("\uD83D\uDE80 Ready! Restart OpenCode to use.");
|
|
44
46
|
console.log("");
|
|
45
|
-
console.log("
|
|
46
|
-
console.log(' /auto "task" -
|
|
47
|
+
console.log("Commands:");
|
|
48
|
+
console.log(' /auto "task" - Autonomous execution');
|
|
49
|
+
console.log(' /plan "task" - Decompose into atomic tasks');
|
|
50
|
+
console.log(" /review - Quality check");
|
|
47
51
|
console.log("");
|
|
48
52
|
}
|
|
49
53
|
install();
|