opencode-cc10x 6.0.21 → 6.0.23
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/README.md +13 -7
- package/bin/opencode-cc10x.mjs +204 -0
- package/dist/index.js +2 -2
- package/install-from-github.mjs +85 -4
- package/install.sh +19 -284
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -67,8 +67,14 @@ irm https://raw.githubusercontent.com/Chaim12345/cc10x/main/project/opencode-cc1
|
|
|
67
67
|
3. **Alternative package-manager install (public npm):**
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
npm add
|
|
71
|
-
bun add
|
|
70
|
+
npm add opencode-cc10x
|
|
71
|
+
bun add opencode-cc10x
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If commands do not appear in OpenCode, run:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx opencode-cc10x init
|
|
72
78
|
```
|
|
73
79
|
|
|
74
80
|
If you are testing locally before publishing, install from a tarball:
|
|
@@ -89,12 +95,12 @@ The plugin automatically configures the necessary agents. You can customize them
|
|
|
89
95
|
```json
|
|
90
96
|
{
|
|
91
97
|
"agent": {
|
|
92
|
-
"component-builder": {
|
|
93
|
-
"color": "
|
|
98
|
+
"cc10x-component-builder": {
|
|
99
|
+
"color": "#00ff00",
|
|
94
100
|
"temperature": 0.3
|
|
95
101
|
},
|
|
96
|
-
"code-reviewer": {
|
|
97
|
-
"color": "
|
|
102
|
+
"cc10x-code-reviewer": {
|
|
103
|
+
"color": "#ffff00",
|
|
98
104
|
"temperature": 0.1
|
|
99
105
|
}
|
|
100
106
|
}
|
|
@@ -121,7 +127,7 @@ All cc10x agents can be configured in `opencode.json`:
|
|
|
121
127
|
```json
|
|
122
128
|
{
|
|
123
129
|
"agent": {
|
|
124
|
-
"component-builder": {
|
|
130
|
+
"cc10x-component-builder": {
|
|
125
131
|
"description": "Builds features using TDD",
|
|
126
132
|
"model": "anthropic/claude-sonnet-4-20250514",
|
|
127
133
|
"temperature": 0.3,
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { mkdirSync, existsSync, writeFileSync, readFileSync } from "node:fs";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
const PLUGIN_NAME = "opencode-cc10x";
|
|
10
|
+
|
|
11
|
+
function configBase() {
|
|
12
|
+
if (process.platform === "win32") {
|
|
13
|
+
return process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming");
|
|
14
|
+
}
|
|
15
|
+
return process.env.XDG_CONFIG_HOME || path.join(os.homedir(), ".config");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function opencodeConfigDir() {
|
|
19
|
+
return path.join(configBase(), "opencode");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function ensureDir(p) {
|
|
23
|
+
mkdirSync(p, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function readBundledOpencodeConfig() {
|
|
27
|
+
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const pkgDir = path.resolve(scriptDir, "..");
|
|
29
|
+
const configPath = path.join(pkgDir, "opencode.json");
|
|
30
|
+
const raw = readFileSync(configPath, "utf8");
|
|
31
|
+
return JSON.parse(raw);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function isPlainObject(v) {
|
|
35
|
+
return Boolean(v && typeof v === "object" && !Array.isArray(v));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function deepMerge(target, source) {
|
|
39
|
+
// Merge objects without overwriting user customizations.
|
|
40
|
+
// Arrays are unioned (unique by primitive identity) and objects merge recursively.
|
|
41
|
+
if (!isPlainObject(target) || !isPlainObject(source)) return target;
|
|
42
|
+
|
|
43
|
+
for (const [k, sv] of Object.entries(source)) {
|
|
44
|
+
const tv = target[k];
|
|
45
|
+
if (tv === undefined) {
|
|
46
|
+
target[k] = sv;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (Array.isArray(tv) && Array.isArray(sv)) {
|
|
50
|
+
const set = new Set(tv);
|
|
51
|
+
for (const item of sv) set.add(item);
|
|
52
|
+
target[k] = Array.from(set);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (isPlainObject(tv) && isPlainObject(sv)) {
|
|
56
|
+
deepMerge(tv, sv);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
// Keep user's existing value.
|
|
60
|
+
}
|
|
61
|
+
return target;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function upsertOpencodeJson(pluginName) {
|
|
65
|
+
const cfgDir = opencodeConfigDir();
|
|
66
|
+
const cfgFile = path.join(cfgDir, "opencode.json");
|
|
67
|
+
ensureDir(cfgDir);
|
|
68
|
+
|
|
69
|
+
let cfg = {};
|
|
70
|
+
if (existsSync(cfgFile)) {
|
|
71
|
+
try {
|
|
72
|
+
cfg = JSON.parse(readFileSync(cfgFile, "utf8"));
|
|
73
|
+
} catch (err) {
|
|
74
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
75
|
+
throw new Error(
|
|
76
|
+
`Refusing to modify invalid JSON at ${cfgFile}. Fix the file first. Parse error: ${detail}`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Ensure base schema + plugin list.
|
|
82
|
+
if (!Array.isArray(cfg.plugin)) cfg.plugin = [];
|
|
83
|
+
if (!cfg.plugin.includes(pluginName)) cfg.plugin.push(pluginName);
|
|
84
|
+
if (!cfg.$schema) cfg.$schema = "https://opencode.ai/config.json";
|
|
85
|
+
|
|
86
|
+
// Merge bundled configuration (agents, permissions, etc.) without clobbering user customizations.
|
|
87
|
+
// This is how we make "everything loads automatically" work in a package-managed install.
|
|
88
|
+
const bundled = readBundledOpencodeConfig();
|
|
89
|
+
deepMerge(cfg, bundled);
|
|
90
|
+
|
|
91
|
+
writeFileSync(cfgFile, `${JSON.stringify(cfg, null, 2)}\n`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function writeCommands() {
|
|
95
|
+
const commandsDir = path.join(opencodeConfigDir(), "commands");
|
|
96
|
+
ensureDir(commandsDir);
|
|
97
|
+
|
|
98
|
+
const files = [
|
|
99
|
+
{
|
|
100
|
+
name: "cc10x-orchestrate.md",
|
|
101
|
+
content: `---\ndescription: Intelligent orchestration system for development tasks with multi-agent workflows\nagent: cc10x-planner\n---\n\nRun cc10x intelligent orchestration for this development task:\n\n$ARGUMENTS\n\nThis will automatically detect the intent and orchestrate the appropriate workflow with multiple specialized agents.\n`,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "cc10x-build.md",
|
|
105
|
+
content: `---\ndescription: Build features using TDD cycle (RED -> GREEN -> REFACTOR)\nagent: cc10x-component-builder\n---\n\nBuild this feature using TDD:\n\n$ARGUMENTS\n\nFollow the TDD cycle strictly:\n1. RED: Write a failing test first\n2. GREEN: Write minimal code to pass\n3. REFACTOR: Clean up while keeping tests green\n4. VERIFY: All tests must pass\n`,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "cc10x-debug.md",
|
|
109
|
+
content: `---\ndescription: Investigate and fix bugs with log-first approach\nagent: cc10x-bug-investigator\n---\n\nDebug this issue:\n\n$ARGUMENTS\n\nUse a log-first approach to:\n1. Identify the root cause\n2. Find all related error logs\n3. Propose fixes with evidence\n4. Implement the solution\n`,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "cc10x-review.md",
|
|
113
|
+
content: `---\ndescription: Comprehensive code review with 80%+ confidence threshold\nagent: cc10x-code-reviewer\n---\n\nReview this code:\n\n$ARGUMENTS\n\nPerform a comprehensive code review with 80%+ confidence threshold:\n- Check for bugs and security issues\n- Verify code quality and best practices\n- Suggest improvements\n- Only approve if confidence is high\n`,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "cc10x-plan.md",
|
|
117
|
+
content: `---\ndescription: Create detailed plans with research and architecture design\nagent: cc10x-planner\n---\n\nCreate a comprehensive plan for:\n\n$ARGUMENTS\n\nInclude:\n- Research phase\n- Architecture design\n- Implementation steps\n- Risk assessment\n- Timeline estimates\n`,
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
for (const f of files) {
|
|
122
|
+
const target = path.join(commandsDir, f.name);
|
|
123
|
+
if (!existsSync(target)) {
|
|
124
|
+
writeFileSync(target, f.content);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const current = readFileSync(target, "utf8");
|
|
129
|
+
const migrated = current
|
|
130
|
+
.replace(/(^|\n)agent:\s*planner(\n|$)/g, "$1agent: cc10x-planner$2")
|
|
131
|
+
.replace(/(^|\n)agent:\s*component-builder(\n|$)/g, "$1agent: cc10x-component-builder$2")
|
|
132
|
+
.replace(/(^|\n)agent:\s*bug-investigator(\n|$)/g, "$1agent: cc10x-bug-investigator$2")
|
|
133
|
+
.replace(/(^|\n)agent:\s*code-reviewer(\n|$)/g, "$1agent: cc10x-code-reviewer$2")
|
|
134
|
+
.replace(/(^|\n)model:\s*anthropic\/claude-sonnet-4-20250514(\n|$)/g, "$1");
|
|
135
|
+
|
|
136
|
+
if (migrated !== current) {
|
|
137
|
+
writeFileSync(target, migrated);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function canPrompt() {
|
|
143
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function shouldAttemptSudo() {
|
|
147
|
+
if (process.platform === "win32") return false;
|
|
148
|
+
if (typeof process.getuid === "function" && process.getuid() === 0) return false;
|
|
149
|
+
if (process.env.CC10X_ELEVATED === "1") return false;
|
|
150
|
+
return canPrompt();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function reRunWithSudo(argv) {
|
|
154
|
+
const nodePath = process.execPath;
|
|
155
|
+
const scriptPath = path.resolve(argv[1]);
|
|
156
|
+
const args = ["-E", nodePath, scriptPath, ...argv.slice(2)];
|
|
157
|
+
const result = spawnSync("sudo", args, { stdio: "inherit" });
|
|
158
|
+
process.exit(result.status ?? 1);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function usage() {
|
|
162
|
+
console.log(
|
|
163
|
+
`Usage: opencode-cc10x <command>\n\nCommands:\n init Install OpenCode commands and merge bundled config into opencode.json\n`
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function main() {
|
|
168
|
+
const cmd = process.argv[2] || "";
|
|
169
|
+
if (cmd === "init") {
|
|
170
|
+
const args = process.argv.slice(3);
|
|
171
|
+
const commandsOnly = args.includes("--commands-only");
|
|
172
|
+
const isPostinstall = args.includes("--postinstall");
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
if (!commandsOnly) upsertOpencodeJson(PLUGIN_NAME);
|
|
176
|
+
writeCommands();
|
|
177
|
+
console.log("cc10x initialized: commands installed" + (commandsOnly ? "" : " and plugin ensured in opencode.json"));
|
|
178
|
+
} catch (err) {
|
|
179
|
+
const code = err && typeof err === "object" ? err.code : "";
|
|
180
|
+
if (code === "EACCES" || code === "EPERM") {
|
|
181
|
+
console.error("Permission denied writing OpenCode config.");
|
|
182
|
+
console.error(`Try re-running with elevated privileges: sudo opencode-cc10x init`);
|
|
183
|
+
|
|
184
|
+
// During postinstall we want "everything", but we also must not brick installs in non-interactive contexts.
|
|
185
|
+
// Best effort: if interactive, we can prompt for sudo; otherwise print the instruction and exit success.
|
|
186
|
+
if (isPostinstall && !canPrompt()) {
|
|
187
|
+
console.error("postinstall is non-interactive; skipping sudo escalation.");
|
|
188
|
+
process.exit(0);
|
|
189
|
+
}
|
|
190
|
+
if (shouldAttemptSudo()) {
|
|
191
|
+
console.error("Attempting to re-run with sudo...");
|
|
192
|
+
process.env.CC10X_ELEVATED = "1";
|
|
193
|
+
reRunWithSudo(process.argv);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
throw err;
|
|
197
|
+
}
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
usage();
|
|
201
|
+
process.exit(cmd ? 1 : 0);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
main();
|
package/dist/index.js
CHANGED
|
@@ -1400,13 +1400,13 @@ function extractMemoryNotes(result) {
|
|
|
1400
1400
|
|
|
1401
1401
|
// src/index.ts
|
|
1402
1402
|
var OpenCodeCC10xPlugin = async (input) => {
|
|
1403
|
-
console.log("\u{1F50C} OpenCode cc10x Plugin v6.0.
|
|
1403
|
+
console.log("\u{1F50C} OpenCode cc10x Plugin v6.0.23 initializing...");
|
|
1404
1404
|
const { $ } = input;
|
|
1405
1405
|
const routerHook = await cc10xRouter({ ...input, $ });
|
|
1406
1406
|
return {
|
|
1407
1407
|
name: "opencode-cc10x",
|
|
1408
1408
|
description: "Intelligent orchestration system for OpenCode - port of cc10x from Claude Code",
|
|
1409
|
-
version: "6.0.
|
|
1409
|
+
version: "6.0.23",
|
|
1410
1410
|
hooks: {
|
|
1411
1411
|
// Router hook that intercepts user requests and orchestrates workflows
|
|
1412
1412
|
"message.received": routerHook.messageReceived,
|
package/install-from-github.mjs
CHANGED
|
@@ -87,21 +87,93 @@ function findPluginDir(rootDir) {
|
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
function
|
|
90
|
+
function isPlainObject(v) {
|
|
91
|
+
return Boolean(v && typeof v === "object" && !Array.isArray(v));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function deepMerge(target, source) {
|
|
95
|
+
if (!isPlainObject(target) || !isPlainObject(source)) return target;
|
|
96
|
+
for (const [k, sv] of Object.entries(source)) {
|
|
97
|
+
const tv = target[k];
|
|
98
|
+
if (tv === undefined) {
|
|
99
|
+
target[k] = sv;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (Array.isArray(tv) && Array.isArray(sv)) {
|
|
103
|
+
const set = new Set(tv);
|
|
104
|
+
for (const item of sv) set.add(item);
|
|
105
|
+
target[k] = Array.from(set);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (isPlainObject(tv) && isPlainObject(sv)) {
|
|
109
|
+
deepMerge(tv, sv);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return target;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function upsertConfig(configFile, pluginName, bundledConfig) {
|
|
91
116
|
let cfg = {};
|
|
92
117
|
if (existsSync(configFile)) {
|
|
93
118
|
try {
|
|
94
119
|
cfg = JSON.parse(readFileSync(configFile, "utf8"));
|
|
95
|
-
} catch {
|
|
96
|
-
|
|
120
|
+
} catch (err) {
|
|
121
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
122
|
+
fail(`Refusing to modify invalid JSON at ${configFile}. Fix this file first. Parse error: ${detail}`);
|
|
97
123
|
}
|
|
98
124
|
}
|
|
99
125
|
if (!Array.isArray(cfg.plugin)) cfg.plugin = [];
|
|
100
126
|
if (!cfg.plugin.includes(pluginName)) cfg.plugin.push(pluginName);
|
|
101
127
|
if (!cfg.$schema) cfg.$schema = "https://opencode.ai/config.json";
|
|
128
|
+
if (bundledConfig && isPlainObject(bundledConfig)) {
|
|
129
|
+
deepMerge(cfg, bundledConfig);
|
|
130
|
+
}
|
|
102
131
|
writeFileSync(configFile, `${JSON.stringify(cfg, null, 2)}\n`);
|
|
103
132
|
}
|
|
104
133
|
|
|
134
|
+
function writeCommands(commandsDir) {
|
|
135
|
+
mkdirSync(commandsDir, { recursive: true });
|
|
136
|
+
|
|
137
|
+
const files = [
|
|
138
|
+
{
|
|
139
|
+
name: "cc10x-orchestrate.md",
|
|
140
|
+
content: `---\ndescription: Intelligent orchestration system for development tasks with multi-agent workflows\nagent: cc10x-planner\n---\n\nRun cc10x intelligent orchestration for this development task:\n\n$ARGUMENTS\n\nThis will automatically detect the intent and orchestrate the appropriate workflow with multiple specialized agents.\n`,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "cc10x-build.md",
|
|
144
|
+
content: `---\ndescription: Build features using TDD cycle (RED -> GREEN -> REFACTOR)\nagent: cc10x-component-builder\n---\n\nBuild this feature using TDD:\n\n$ARGUMENTS\n\nFollow the TDD cycle strictly:\n1. RED: Write a failing test first\n2. GREEN: Write minimal code to pass\n3. REFACTOR: Clean up while keeping tests green\n4. VERIFY: All tests must pass\n`,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "cc10x-debug.md",
|
|
148
|
+
content: `---\ndescription: Investigate and fix bugs with log-first approach\nagent: cc10x-bug-investigator\n---\n\nDebug this issue:\n\n$ARGUMENTS\n\nUse a log-first approach to:\n1. Identify the root cause\n2. Find all related error logs\n3. Propose fixes with evidence\n4. Implement the solution\n`,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "cc10x-review.md",
|
|
152
|
+
content: `---\ndescription: Comprehensive code review with 80%+ confidence threshold\nagent: cc10x-code-reviewer\n---\n\nReview this code:\n\n$ARGUMENTS\n\nPerform a comprehensive code review with 80%+ confidence threshold:\n- Check for bugs and security issues\n- Verify code quality and best practices\n- Suggest improvements\n- Only approve if confidence is high\n`,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "cc10x-plan.md",
|
|
156
|
+
content: `---\ndescription: Create detailed plans with research and architecture design\nagent: cc10x-planner\n---\n\nCreate a comprehensive plan for:\n\n$ARGUMENTS\n\nInclude:\n- Research phase\n- Architecture design\n- Implementation steps\n- Risk assessment\n- Timeline estimates\n`,
|
|
157
|
+
},
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
for (const f of files) {
|
|
161
|
+
const target = path.join(commandsDir, f.name);
|
|
162
|
+
if (!existsSync(target)) {
|
|
163
|
+
writeFileSync(target, f.content);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
const current = readFileSync(target, "utf8");
|
|
167
|
+
const migrated = current
|
|
168
|
+
.replace(/(^|\n)agent:\s*planner(\n|$)/g, "$1agent: cc10x-planner$2")
|
|
169
|
+
.replace(/(^|\n)agent:\s*component-builder(\n|$)/g, "$1agent: cc10x-component-builder$2")
|
|
170
|
+
.replace(/(^|\n)agent:\s*bug-investigator(\n|$)/g, "$1agent: cc10x-bug-investigator$2")
|
|
171
|
+
.replace(/(^|\n)agent:\s*code-reviewer(\n|$)/g, "$1agent: cc10x-code-reviewer$2")
|
|
172
|
+
.replace(/(^|\n)model:\s*anthropic\/claude-sonnet-4-20250514(\n|$)/g, "$1");
|
|
173
|
+
if (migrated !== current) writeFileSync(target, migrated);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
105
177
|
async function main() {
|
|
106
178
|
log(`Installing ${PLUGIN_NAME} from GitHub (${REPO}@${REF})...`);
|
|
107
179
|
|
|
@@ -143,9 +215,18 @@ async function main() {
|
|
|
143
215
|
}
|
|
144
216
|
|
|
145
217
|
if (!installed) fail("Installation failed.");
|
|
146
|
-
|
|
218
|
+
let bundledConfig = null;
|
|
219
|
+
try {
|
|
220
|
+
bundledConfig = JSON.parse(await downloadText(`${RAW_BASE}/opencode.json`));
|
|
221
|
+
} catch (err) {
|
|
222
|
+
log(`Warning: could not load bundled opencode.json (${err instanceof Error ? err.message : String(err)}). Continuing with plugin registration only.`);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
upsertConfig(configFile, PLUGIN_NAME, bundledConfig);
|
|
226
|
+
writeCommands(path.join(configDir, "commands"));
|
|
147
227
|
|
|
148
228
|
log(`Installed ${PLUGIN_NAME} to ${pluginFile}`);
|
|
229
|
+
log(`Installed cc10x commands to ${path.join(configDir, "commands")}`);
|
|
149
230
|
log("Restart OpenCode to load the plugin.");
|
|
150
231
|
}
|
|
151
232
|
|
package/install.sh
CHANGED
|
@@ -1,295 +1,30 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
# This script installs and configures the cc10x orchestration system for OpenCode
|
|
3
|
+
set -euo pipefail
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
echo "Installing OpenCode cc10x plugin..."
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
if ! command -v opencode >/dev/null 2>&1; then
|
|
8
|
+
echo "OpenCode is not installed. Install OpenCode first."
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exit 1
|
|
12
|
+
if [ ! -f "dist/index.js" ]; then
|
|
13
|
+
echo "dist/index.js not found. Building plugin..."
|
|
14
|
+
npm run build
|
|
14
15
|
fi
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
PLUGIN_DIR="$
|
|
17
|
+
CONFIG_BASE="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|
18
|
+
PLUGIN_DIR="$CONFIG_BASE/opencode/plugins"
|
|
18
19
|
mkdir -p "$PLUGIN_DIR"
|
|
19
|
-
|
|
20
|
-
# Copy plugin file
|
|
21
|
-
echo "📦 Installing plugin..."
|
|
22
20
|
cp dist/index.js "$PLUGIN_DIR/opencode-cc10x.js"
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
echo "
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
cat > "$CONFIG_FILE" << 'EOF'
|
|
32
|
-
{
|
|
33
|
-
"$schema": "https://opencode.ai/config.json",
|
|
34
|
-
"plugin": ["opencode-cc10x"],
|
|
35
|
-
"command": {
|
|
36
|
-
"cc10x-orchestrate": {
|
|
37
|
-
"template": "Run cc10x intelligent orchestration for this development task: ${input}",
|
|
38
|
-
"description": "Intelligent orchestration system for development tasks with multi-agent workflows",
|
|
39
|
-
"agent": "planner",
|
|
40
|
-
"model": "anthropic/claude-sonnet-4-20250514"
|
|
41
|
-
},
|
|
42
|
-
"cc10x-build": {
|
|
43
|
-
"template": "Build this feature using TDD: ${input}",
|
|
44
|
-
"description": "Build features using TDD cycle (RED → GREEN → REFACTOR)",
|
|
45
|
-
"agent": "component-builder",
|
|
46
|
-
"model": "anthropic/claude-sonnet-4-20250514"
|
|
47
|
-
},
|
|
48
|
-
"cc10x-debug": {
|
|
49
|
-
"template": "Debug this issue: ${input}",
|
|
50
|
-
"description": "Investigate and fix bugs with log-first approach",
|
|
51
|
-
"agent": "bug-investigator",
|
|
52
|
-
"model": "anthropic/claude-sonnet-4-20250514"
|
|
53
|
-
},
|
|
54
|
-
"cc10x-review": {
|
|
55
|
-
"template": "Review this code: ${input}",
|
|
56
|
-
"description": "Comprehensive code review with 80%+ confidence threshold",
|
|
57
|
-
"agent": "code-reviewer",
|
|
58
|
-
"model": "anthropic/claude-sonnet-4-20250514"
|
|
59
|
-
},
|
|
60
|
-
"cc10x-plan": {
|
|
61
|
-
"template": "Create a comprehensive plan for: ${input}",
|
|
62
|
-
"description": "Create detailed plans with research and architecture design",
|
|
63
|
-
"agent": "planner",
|
|
64
|
-
"model": "anthropic/claude-sonnet-4-20250514"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"agent": {
|
|
68
|
-
"component-builder": {
|
|
69
|
-
"description": "Builds features using TDD cycle (RED → GREEN → REFACTOR). Part of cc10x orchestration system.",
|
|
70
|
-
"mode": "subagent",
|
|
71
|
-
"temperature": 0.3,
|
|
72
|
-
"color": "#00ff00",
|
|
73
|
-
"tools": {
|
|
74
|
-
"write": true,
|
|
75
|
-
"edit": true,
|
|
76
|
-
"bash": true,
|
|
77
|
-
"grep": true,
|
|
78
|
-
"glob": true,
|
|
79
|
-
"skill": true,
|
|
80
|
-
"lsp": true,
|
|
81
|
-
"askUserQuestion": true
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"bug-investigator": {
|
|
85
|
-
"description": "Investigates bugs with log-first approach. Part of cc10x orchestration system.",
|
|
86
|
-
"mode": "subagent",
|
|
87
|
-
"temperature": 0.2,
|
|
88
|
-
"color": "#ffa500",
|
|
89
|
-
"tools": {
|
|
90
|
-
"write": false,
|
|
91
|
-
"edit": false,
|
|
92
|
-
"bash": true,
|
|
93
|
-
"grep": true,
|
|
94
|
-
"glob": true,
|
|
95
|
-
"skill": true,
|
|
96
|
-
"lsp": true,
|
|
97
|
-
"webfetch": true
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"code-reviewer": {
|
|
101
|
-
"description": "Reviews code with 80%+ confidence threshold. Part of cc10x orchestration system.",
|
|
102
|
-
"mode": "subagent",
|
|
103
|
-
"temperature": 0.1,
|
|
104
|
-
"color": "#ffff00",
|
|
105
|
-
"tools": {
|
|
106
|
-
"write": false,
|
|
107
|
-
"edit": false,
|
|
108
|
-
"bash": true,
|
|
109
|
-
"grep": true,
|
|
110
|
-
"glob": true,
|
|
111
|
-
"skill": true,
|
|
112
|
-
"lsp": true
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"silent-failure-hunter": {
|
|
116
|
-
"description": "Finds silent failures and error handling gaps. Part of cc10x orchestration system.",
|
|
117
|
-
"mode": "subagent",
|
|
118
|
-
"temperature": 0.2,
|
|
119
|
-
"color": "#ff0000",
|
|
120
|
-
"tools": {
|
|
121
|
-
"write": false,
|
|
122
|
-
"edit": false,
|
|
123
|
-
"bash": true,
|
|
124
|
-
"grep": true,
|
|
125
|
-
"glob": true,
|
|
126
|
-
"skill": true,
|
|
127
|
-
"lsp": true
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
"integration-verifier": {
|
|
131
|
-
"description": "Performs end-to-end validation. Part of cc10x orchestration system.",
|
|
132
|
-
"mode": "subagent",
|
|
133
|
-
"temperature": 0.1,
|
|
134
|
-
"color": "#0000ff",
|
|
135
|
-
"tools": {
|
|
136
|
-
"write": false,
|
|
137
|
-
"edit": false,
|
|
138
|
-
"bash": true,
|
|
139
|
-
"grep": true,
|
|
140
|
-
"glob": true,
|
|
141
|
-
"skill": true,
|
|
142
|
-
"lsp": true,
|
|
143
|
-
"askUserQuestion": true
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
"planner": {
|
|
147
|
-
"description": "Creates comprehensive plans with research. Part of cc10x orchestration system.",
|
|
148
|
-
"mode": "subagent",
|
|
149
|
-
"temperature": 0.4,
|
|
150
|
-
"color": "#800080",
|
|
151
|
-
"tools": {
|
|
152
|
-
"write": true,
|
|
153
|
-
"edit": true,
|
|
154
|
-
"bash": true,
|
|
155
|
-
"grep": true,
|
|
156
|
-
"glob": true,
|
|
157
|
-
"skill": true,
|
|
158
|
-
"lsp": true,
|
|
159
|
-
"webfetch": true
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
"permission": {
|
|
164
|
-
"bash": {
|
|
165
|
-
"mkdir -p .claude/cc10x": "allow",
|
|
166
|
-
"git status": "allow",
|
|
167
|
-
"git diff": "allow",
|
|
168
|
-
"git log": "allow",
|
|
169
|
-
"npm test": "allow",
|
|
170
|
-
"yarn test": "allow",
|
|
171
|
-
"bun test": "allow",
|
|
172
|
-
"npm start": "allow",
|
|
173
|
-
"*": "ask"
|
|
174
|
-
},
|
|
175
|
-
"edit": "allow",
|
|
176
|
-
"write": "allow",
|
|
177
|
-
"skill": {
|
|
178
|
-
"cc10x:*": "allow"
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
EOF
|
|
183
|
-
|
|
184
|
-
# Create commands directory
|
|
185
|
-
COMMANDS_DIR="$CONFIG_DIR/commands"
|
|
186
|
-
mkdir -p "$COMMANDS_DIR"
|
|
187
|
-
|
|
188
|
-
echo "📝 Creating command files..."
|
|
189
|
-
|
|
190
|
-
# Create cc10x-orchestrate command
|
|
191
|
-
cat > "$COMMANDS_DIR/cc10x-orchestrate.md" << 'EOF'
|
|
192
|
-
---
|
|
193
|
-
description: Intelligent orchestration system for development tasks with multi-agent workflows
|
|
194
|
-
agent: planner
|
|
195
|
-
model: anthropic/claude-sonnet-4-20250514
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
Run cc10x intelligent orchestration for this development task:
|
|
199
|
-
|
|
200
|
-
$ARGUMENTS
|
|
201
|
-
|
|
202
|
-
This will automatically detect the intent and orchestrate the appropriate workflow with multiple specialized agents.
|
|
203
|
-
EOF
|
|
204
|
-
|
|
205
|
-
# Create cc10x-build command
|
|
206
|
-
cat > "$COMMANDS_DIR/cc10x-build.md" << 'EOF'
|
|
207
|
-
---
|
|
208
|
-
description: Build features using TDD cycle (RED → GREEN → REFACTOR)
|
|
209
|
-
agent: component-builder
|
|
210
|
-
model: anthropic/claude-sonnet-4-20250514
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
Build this feature using TDD:
|
|
214
|
-
|
|
215
|
-
$ARGUMENTS
|
|
216
|
-
|
|
217
|
-
Follow the TDD cycle strictly:
|
|
218
|
-
1. RED: Write a failing test first
|
|
219
|
-
2. GREEN: Write minimal code to pass
|
|
220
|
-
3. REFACTOR: Clean up while keeping tests green
|
|
221
|
-
4. VERIFY: All tests must pass
|
|
222
|
-
EOF
|
|
223
|
-
|
|
224
|
-
# Create cc10x-debug command
|
|
225
|
-
cat > "$COMMANDS_DIR/cc10x-debug.md" << 'EOF'
|
|
226
|
-
---
|
|
227
|
-
description: Investigate and fix bugs with log-first approach
|
|
228
|
-
agent: bug-investigator
|
|
229
|
-
model: anthropic/claude-sonnet-4-20250514
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
Debug this issue:
|
|
233
|
-
|
|
234
|
-
$ARGUMENTS
|
|
235
|
-
|
|
236
|
-
Use a log-first approach to:
|
|
237
|
-
1. Identify the root cause
|
|
238
|
-
2. Find all related error logs
|
|
239
|
-
3. Propose fixes with evidence
|
|
240
|
-
4. Implement the solution
|
|
241
|
-
EOF
|
|
242
|
-
|
|
243
|
-
# Create cc10x-review command
|
|
244
|
-
cat > "$COMMANDS_DIR/cc10x-review.md" << 'EOF'
|
|
245
|
-
---
|
|
246
|
-
description: Comprehensive code review with 80%+ confidence threshold
|
|
247
|
-
agent: code-reviewer
|
|
248
|
-
model: anthropic/claude-sonnet-4-20250514
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
Review this code:
|
|
252
|
-
|
|
253
|
-
$ARGUMENTS
|
|
254
|
-
|
|
255
|
-
Perform a comprehensive code review with 80%+ confidence threshold:
|
|
256
|
-
- Check for bugs and security issues
|
|
257
|
-
- Verify code quality and best practices
|
|
258
|
-
- Suggest improvements
|
|
259
|
-
- Only approve if confidence is high
|
|
260
|
-
EOF
|
|
261
|
-
|
|
262
|
-
# Create cc10x-plan command
|
|
263
|
-
cat > "$COMMANDS_DIR/cc10x-plan.md" << 'EOF'
|
|
264
|
-
---
|
|
265
|
-
description: Create detailed plans with research and architecture design
|
|
266
|
-
agent: planner
|
|
267
|
-
model: anthropic/claude-sonnet-4-20250514
|
|
268
|
-
---
|
|
269
|
-
|
|
270
|
-
Create a comprehensive plan for:
|
|
271
|
-
|
|
272
|
-
$ARGUMENTS
|
|
273
|
-
|
|
274
|
-
Include:
|
|
275
|
-
- Research phase
|
|
276
|
-
- Architecture design
|
|
277
|
-
- Implementation steps
|
|
278
|
-
- Risk assessment
|
|
279
|
-
- Timeline estimates
|
|
280
|
-
EOF
|
|
22
|
+
if [ -f "bin/opencode-cc10x.mjs" ]; then
|
|
23
|
+
node bin/opencode-cc10x.mjs init
|
|
24
|
+
else
|
|
25
|
+
echo "bin/opencode-cc10x.mjs is missing."
|
|
26
|
+
echo "Plugin copied, but config/commands were not initialized."
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
281
29
|
|
|
282
|
-
echo "
|
|
283
|
-
echo ""
|
|
284
|
-
echo "📁 Files installed:"
|
|
285
|
-
echo " Plugin: $PLUGIN_DIR/opencode-cc10x.js"
|
|
286
|
-
echo " Config: $CONFIG_FILE"
|
|
287
|
-
echo " Commands: $COMMANDS_DIR/"
|
|
288
|
-
echo ""
|
|
289
|
-
echo "🚀 Usage:"
|
|
290
|
-
echo " • Start OpenCode: opencode"
|
|
291
|
-
echo " • Press '/' to see cc10x commands"
|
|
292
|
-
echo " • Or use directly: /cc10x-orchestrate <task>"
|
|
293
|
-
echo " • Or run: opencode run \"<your task>\""
|
|
294
|
-
echo ""
|
|
295
|
-
echo "🎯 The cc10x orchestration system is now ready!"
|
|
30
|
+
echo "Installation complete. Restart OpenCode to load updates."
|
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-cc10x",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.23",
|
|
4
4
|
"description": "Intelligent orchestration plugin for OpenCode - port of cc10x from Claude Code",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"opencode-cc10x": "bin/opencode-cc10x.mjs"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:@opencode-ai/plugin",
|
|
8
11
|
"dev": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:@opencode-ai/plugin --watch",
|
|
9
12
|
"test": "bun test --coverage",
|
|
10
13
|
"test:watch": "bun test --watch",
|
|
11
14
|
"lint": "bun x tsc --noEmit",
|
|
12
|
-
"prepublishOnly": "npm run build"
|
|
15
|
+
"prepublishOnly": "npm run build",
|
|
16
|
+
"postinstall": "node bin/opencode-cc10x.mjs init --postinstall || exit 0"
|
|
13
17
|
},
|
|
14
18
|
"keywords": [
|
|
15
19
|
"opencode",
|
|
@@ -26,6 +30,9 @@
|
|
|
26
30
|
"type": "git",
|
|
27
31
|
"url": "https://github.com/Chaim12345/cc10x.git"
|
|
28
32
|
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"registry": "https://registry.npmjs.org"
|
|
35
|
+
},
|
|
29
36
|
"devDependencies": {
|
|
30
37
|
"@types/node": "^20.0.0",
|
|
31
38
|
"esbuild": "^0.25.10",
|