@andyqiu/codeforge 0.5.29 → 0.6.1
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/agents/codeforge.md +1 -1
- package/agents/coder-deep.md +1 -1
- package/agents/coder-quick.md +1 -1
- package/agents/coder.md +1 -1
- package/agents/discover-challenger.md +0 -1
- package/agents/discover.md +0 -1
- package/agents/planner.md +1 -1
- package/agents/reviewer-lite.md +1 -1
- package/agents/reviewer.md +1 -1
- package/bin/codeforge.mjs +22 -48
- package/dist/index.js +604 -2074
- package/install.mjs +754 -0
- package/package.json +5 -7
- package/context-templates/kh-instructions.md +0 -109
- package/install.ps1 +0 -559
- package/install.sh +0 -726
- package/scripts/merge-agents-md.mjs +0 -228
package/agents/codeforge.md
CHANGED
|
@@ -14,7 +14,7 @@ permissions:
|
|
|
14
14
|
edit: deny
|
|
15
15
|
bash: deny
|
|
16
16
|
webfetch: deny
|
|
17
|
-
allowed_tools: [read,
|
|
17
|
+
allowed_tools: [read, repo_map, task, plan_read, review_approval, session_merge]
|
|
18
18
|
model: anthropic/claude-sonnet-4-6
|
|
19
19
|
model_category: deep
|
|
20
20
|
tier: deep
|
package/agents/coder-deep.md
CHANGED
package/agents/coder-quick.md
CHANGED
package/agents/coder.md
CHANGED
|
@@ -14,7 +14,7 @@ permissions:
|
|
|
14
14
|
edit: allow
|
|
15
15
|
bash: allow
|
|
16
16
|
webfetch: deny
|
|
17
|
-
allowed_tools: [ast_edit, plan_read,
|
|
17
|
+
allowed_tools: [ast_edit, plan_read, bash, task]
|
|
18
18
|
model: anthropic/claude-sonnet-4-6
|
|
19
19
|
model_category: balanced
|
|
20
20
|
tier: balanced
|
package/agents/discover.md
CHANGED
package/agents/planner.md
CHANGED
|
@@ -14,7 +14,7 @@ permissions:
|
|
|
14
14
|
edit: deny
|
|
15
15
|
bash: allow
|
|
16
16
|
webfetch: allow
|
|
17
|
-
allowed_tools: [
|
|
17
|
+
allowed_tools: [repo_map, read, webfetch, plan_write]
|
|
18
18
|
model: anthropic/claude-opus-4-8
|
|
19
19
|
model_category: deep
|
|
20
20
|
tier: deep
|
package/agents/reviewer-lite.md
CHANGED
|
@@ -14,7 +14,7 @@ permissions:
|
|
|
14
14
|
edit: deny
|
|
15
15
|
bash: allow
|
|
16
16
|
webfetch: deny
|
|
17
|
-
allowed_tools: [
|
|
17
|
+
allowed_tools: [plan_read, bash, read, task, review_approval]
|
|
18
18
|
model: anthropic/claude-sonnet-4-6
|
|
19
19
|
model_category: balanced
|
|
20
20
|
tier: balanced
|
package/agents/reviewer.md
CHANGED
|
@@ -14,7 +14,7 @@ permissions:
|
|
|
14
14
|
edit: deny
|
|
15
15
|
bash: allow
|
|
16
16
|
webfetch: deny
|
|
17
|
-
allowed_tools: [
|
|
17
|
+
allowed_tools: [plan_read, bash, read, task, review_approval]
|
|
18
18
|
model: anthropic/claude-opus-4-8
|
|
19
19
|
model_category: ultrabrain
|
|
20
20
|
tier: deep
|
package/bin/codeforge.mjs
CHANGED
|
@@ -93,30 +93,22 @@ function parseArgs(argv) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// ────────────────────────────────────────────────────────────────────
|
|
96
|
-
// opencode installer
|
|
96
|
+
// opencode installer:薄壳,统一调 install.mjs(Node ESM 跨平台)
|
|
97
|
+
// ADR:unify-install-to-node-mjs
|
|
97
98
|
// ────────────────────────────────────────────────────────────────────
|
|
98
|
-
function installOpencode({ scope, dryRun, extraArgs, quiet = false }) {
|
|
99
|
-
const
|
|
100
|
-
const script = isWin ? path.join(REPO_ROOT, "install.ps1") : path.join(REPO_ROOT, "install.sh")
|
|
99
|
+
function installOpencode({ scope, dryRun, extraArgs, quiet = false, verbose = false }) {
|
|
100
|
+
const script = path.join(REPO_ROOT, "install.mjs")
|
|
101
101
|
if (!existsSync(script)) {
|
|
102
102
|
err(`installer 脚本不存在:${script}`)
|
|
103
103
|
return 2
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
if (dryRun) flagArgs.push("-DryRun")
|
|
113
|
-
} else {
|
|
114
|
-
if (scope === "global") flagArgs.push("--global")
|
|
115
|
-
if (dryRun) flagArgs.push("--dry-run")
|
|
116
|
-
}
|
|
117
|
-
const all = [...baseArgs, ...flagArgs, ...(extraArgs ?? [])]
|
|
118
|
-
if (!quiet) log(`opencode: ${cmd} ${all.join(" ")}`)
|
|
119
|
-
const r = spawnSync(cmd, all, { stdio: quiet ? "pipe" : "inherit", cwd: REPO_ROOT })
|
|
105
|
+
const args = [script]
|
|
106
|
+
if (scope === "global") args.push("--global")
|
|
107
|
+
if (dryRun) args.push("--dry-run")
|
|
108
|
+
if (verbose) args.push("--verbose")
|
|
109
|
+
if (extraArgs) args.push(...extraArgs)
|
|
110
|
+
if (!quiet) log(`opencode: node ${args.join(" ")}`)
|
|
111
|
+
const r = spawnSync(process.execPath, args, { stdio: quiet ? "pipe" : "inherit", cwd: REPO_ROOT })
|
|
120
112
|
if (quiet && r.status !== 0) {
|
|
121
113
|
if (r.stderr) process.stderr.write(r.stderr)
|
|
122
114
|
if (r.stdout) process.stderr.write(r.stdout)
|
|
@@ -125,16 +117,11 @@ function installOpencode({ scope, dryRun, extraArgs, quiet = false }) {
|
|
|
125
117
|
}
|
|
126
118
|
|
|
127
119
|
function uninstallOpencode({ scope }) {
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
: [script, "--uninstall"]
|
|
134
|
-
if (isWin && scope === "global") baseArgs.push("-Global")
|
|
135
|
-
if (!isWin && scope === "global") baseArgs.push("--global")
|
|
136
|
-
log(`opencode uninstall: ${cmd} ${baseArgs.join(" ")}`)
|
|
137
|
-
const r = spawnSync(cmd, baseArgs, { stdio: "inherit", cwd: REPO_ROOT })
|
|
120
|
+
const script = path.join(REPO_ROOT, "install.mjs")
|
|
121
|
+
const args = [script, "--uninstall"]
|
|
122
|
+
if (scope === "global") args.push("--global")
|
|
123
|
+
log(`opencode uninstall: node ${args.join(" ")}`)
|
|
124
|
+
const r = spawnSync(process.execPath, args, { stdio: "inherit", cwd: REPO_ROOT })
|
|
138
125
|
return r.status ?? 1
|
|
139
126
|
}
|
|
140
127
|
|
|
@@ -154,15 +141,10 @@ function cmdInstall(args) {
|
|
|
154
141
|
// npm 场景下 dist/ 已经被 prepack 打过包随 tarball 发布,强制 --skip-build
|
|
155
142
|
// (node_modules 里通常没有 dev 依赖,跑 npm run build 会失败)
|
|
156
143
|
const autoSkipBuild = fromNpm
|
|
144
|
+
const verbose = !!args.flags.verbose
|
|
157
145
|
const extraArgs = []
|
|
158
|
-
if (args.flags["enable-legacy-tools"]) extraArgs.push(
|
|
159
|
-
if (args.flags["skip-build"] || autoSkipBuild) extraArgs.push(
|
|
160
|
-
|
|
161
|
-
log(`CodeForge installer v${getVersion()}`)
|
|
162
|
-
log(` scope : ${scope}`)
|
|
163
|
-
log(` source : ${fromNpm ? "npm (prebuilt)" : "git clone (will build)"}`)
|
|
164
|
-
log(` dry-run : ${dryRun}`)
|
|
165
|
-
hr()
|
|
146
|
+
if (args.flags["enable-legacy-tools"]) extraArgs.push("--enable-legacy-tools")
|
|
147
|
+
if (args.flags["skip-build"] || autoSkipBuild) extraArgs.push("--skip-build")
|
|
166
148
|
|
|
167
149
|
// npm 场景:dist/index.js 必须已经被 prepack 打好;找不到就直接报错并提示
|
|
168
150
|
if (fromNpm && !dryRun) {
|
|
@@ -170,18 +152,16 @@ function cmdInstall(args) {
|
|
|
170
152
|
if (!existsSync(distEntry)) {
|
|
171
153
|
err(`从 npm 安装但找不到 prebuilt bundle:${distEntry}`)
|
|
172
154
|
err(`这通常是 package 发布问题:dist/ 没被 npm pack 进 tarball。`)
|
|
173
|
-
err(`临时解决:从 GitHub clone 后跑
|
|
155
|
+
err(`临时解决:从 GitHub clone 后跑 node install.mjs`)
|
|
174
156
|
return 1
|
|
175
157
|
}
|
|
176
158
|
}
|
|
177
159
|
|
|
178
|
-
const code = installOpencode({ scope, dryRun, extraArgs })
|
|
179
|
-
hr()
|
|
160
|
+
const code = installOpencode({ scope, dryRun, extraArgs, verbose })
|
|
180
161
|
if (code !== 0) {
|
|
181
162
|
err(`opencode 安装失败 (exit=${code})`)
|
|
182
163
|
return 1
|
|
183
164
|
}
|
|
184
|
-
ok(`opencode 安装完成`)
|
|
185
165
|
return 0
|
|
186
166
|
}
|
|
187
167
|
|
|
@@ -190,12 +170,7 @@ function cmdInstall(args) {
|
|
|
190
170
|
// ────────────────────────────────────────────────────────────────────
|
|
191
171
|
function cmdUninstall(args) {
|
|
192
172
|
const scope = "global"
|
|
193
|
-
log(`CodeForge uninstaller`)
|
|
194
|
-
log(` scope : ${scope}`)
|
|
195
|
-
hr()
|
|
196
173
|
uninstallOpencode({ scope })
|
|
197
|
-
hr()
|
|
198
|
-
ok("卸载流程完成")
|
|
199
174
|
return 0
|
|
200
175
|
}
|
|
201
176
|
|
|
@@ -373,8 +348,7 @@ async function cmdUpgrade(args) {
|
|
|
373
348
|
warn("清除 opencode 缓存失败(非致命,可手动重启 opencode)")
|
|
374
349
|
}
|
|
375
350
|
|
|
376
|
-
const
|
|
377
|
-
const code = installOpencode({ scope: "global", dryRun: false, extraArgs: [skipBuildFlag], quiet: true })
|
|
351
|
+
const code = installOpencode({ scope: "global", dryRun: false, extraArgs: ["--skip-build"], quiet: true })
|
|
378
352
|
if (code !== 0) {
|
|
379
353
|
err(`install --global 失败 (exit=${code})`)
|
|
380
354
|
return 1
|