@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.
@@ -14,7 +14,7 @@ permissions:
14
14
  edit: deny
15
15
  bash: deny
16
16
  webfetch: deny
17
- allowed_tools: [read, smart_search, repo_map, task, plan_read, review_approval, session_merge]
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
@@ -14,7 +14,7 @@ permissions:
14
14
  edit: allow
15
15
  bash: allow
16
16
  webfetch: deny
17
- allowed_tools: [ast_edit, plan_read, smart_search, bash, task]
17
+ allowed_tools: [ast_edit, plan_read, bash, task]
18
18
  model: anthropic/claude-opus-4-8
19
19
  model_category: deep
20
20
  tier: deep
@@ -14,7 +14,7 @@ permissions:
14
14
  edit: allow
15
15
  bash: allow
16
16
  webfetch: deny
17
- allowed_tools: [ast_edit, plan_read, smart_search, bash, task]
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: quick
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, smart_search, bash, task]
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
@@ -13,7 +13,6 @@ permissions:
13
13
  webfetch: deny
14
14
  allowed_tools:
15
15
  - read
16
- - smart_search
17
16
  # 故意不给 save_chat_insight:challenger 是过程角色,不沉淀
18
17
  # 故意不给 task:物理禁止派子 agent(避免嵌套对抗)
19
18
  # 故意不给 edit/write:零写权(worktree 也不允许写)
@@ -29,7 +29,6 @@ allowed_tools:
29
29
  - read
30
30
  - write
31
31
  - edit
32
- - smart_search
33
32
  - save_chat_insight
34
33
  - task
35
34
  - skill
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: [smart_search, repo_map, read, webfetch, plan_write]
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
@@ -14,7 +14,7 @@ permissions:
14
14
  edit: deny
15
15
  bash: allow
16
16
  webfetch: deny
17
- allowed_tools: [pending_changes, plan_read, bash, read, smart_search, task, review_approval]
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
@@ -14,7 +14,7 @@ permissions:
14
14
  edit: deny
15
15
  bash: allow
16
16
  webfetch: deny
17
- allowed_tools: [pending_changes, plan_read, bash, read, smart_search, task, review_approval]
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:薄壳,调现成的 install.ps1 / install.sh
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 isWin = process.platform === "win32"
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 cmd = isWin ? "powershell" : "bash"
106
- const baseArgs = isWin
107
- ? ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", script]
108
- : [script]
109
- const flagArgs = []
110
- if (isWin) {
111
- if (scope === "global") flagArgs.push("-Global")
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 isWin = process.platform === "win32"
129
- const script = isWin ? path.join(REPO_ROOT, "install.ps1") : path.join(REPO_ROOT, "install.sh")
130
- const cmd = isWin ? "powershell" : "bash"
131
- const baseArgs = isWin
132
- ? ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", script, "-Uninstall"]
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(process.platform === "win32" ? "-EnableLegacyTools" : "--enable-legacy-tools")
159
- if (args.flags["skip-build"] || autoSkipBuild) extraArgs.push(process.platform === "win32" ? "-SkipBuild" : "--skip-build")
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 后跑 install.sh / install.ps1`)
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 skipBuildFlag = process.platform === "win32" ? "-SkipBuild" : "--skip-build"
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