@go-hare/claude-code 2.7.9 → 2.7.11
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 +5 -3
- package/install.cjs +252 -254
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -43,12 +43,14 @@
|
|
|
43
43
|
|
|
44
44
|
仓库里**没有**独立的 `src/core` / `src/hosts` / `src/runtime` 包级 Agent Core 分层;旧文档里的 `createAgent from 'claude/core'`、`./core` 子路径描述已过时,请勿依赖。
|
|
45
45
|
|
|
46
|
-
近期主线在对齐 **densable 2.1.211** 的 agent / 会话 / 队列 / inbox / daemon 行为(git tag `v2.8.5` 合入前、`v2.8.6` 合入后)。**npm 包版本以 `package.json` / npm 为准**(当前发布线 **2.7.
|
|
46
|
+
近期主线在对齐 **densable 2.1.211** 的 agent / 会话 / 队列 / inbox / daemon 行为(git tag `v2.8.5` 合入前、`v2.8.6` 合入后)。**npm 包版本以 `package.json` / npm 为准**(当前发布线 **2.7.11**),与 git tag 可能不同步。
|
|
47
47
|
|
|
48
|
-
### 近期更新(2.7.5 → 2.7.
|
|
48
|
+
### 近期更新(2.7.5 → 2.7.11)
|
|
49
49
|
|
|
50
50
|
| 版本 | 要点 |
|
|
51
51
|
| ---- | ---- |
|
|
52
|
+
| **2.7.11** | **Effort densable 对齐**:模型驱动 effort resolve、ultracode 会话模式、ModelPicker pin 约定、effort pin 落盘;粘性滚动白屏与 effort toast 同 key 刷新修复;文字+图片同 tick Enter 吞消息修复。 |
|
|
53
|
+
| **2.7.10** | **Shell 对话框 hooks 崩溃修复**:打开 BackgroundTasksDialog 时 PromptInput 的 `onKeyDownBefore` useCallback 位于 early return 之后导致 "Rendered fewer hooks than expected";钩子上移 + onDoneEvent 延后触发。 |
|
|
52
54
|
| **2.7.9** | 全平台二进制重编发布(含 2.7.8 Enter 吞消息修复等当前 main)。 |
|
|
53
55
|
| **2.7.8** | **Enter 偶发吞消息修复**:对齐 densable Enter 路径(typeahead / history search / PromptInput),避免提交键在部分状态下丢输入。 |
|
|
54
56
|
| **2.7.7** | **OpenAI 兼容流多 ● 修复**:坏代理对每个 chunk 重发全文并带 `finish_reason` 时,不再反复开闭 text block(`normalizeMessages` 一行一个 ●);累计全文 delta 只 emit 后缀;assemble 侧合并相邻相同 text block 作防御。 |
|
|
@@ -78,7 +80,7 @@ CLAUDE_BRIDGE_OAUTH_TOKEN=your-token \
|
|
|
78
80
|
claude --remote-control
|
|
79
81
|
```
|
|
80
82
|
|
|
81
|
-
安装失败时:`npm rm -g @go-hare/claude-code` 后再装 `@latest`(可钉版本 `@2.7.
|
|
83
|
+
安装失败时:`npm rm -g @go-hare/claude-code` 后再装 `@latest`(可钉版本 `@2.7.11`)。
|
|
82
84
|
旧文档里的全局包名 `claude-code` **不再**对应本仓库发布流。
|
|
83
85
|
|
|
84
86
|
---
|
package/install.cjs
CHANGED
|
@@ -1,254 +1,252 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Postinstall for the claude wrapper package.
|
|
3
|
-
//
|
|
4
|
-
// In development (monorepo with .git), delegates to the dev postinstall scripts.
|
|
5
|
-
// In production (npm install from registry), copies the native binary from the
|
|
6
|
-
// platform-specific optionalDependency into bin/claude.exe.
|
|
7
|
-
//
|
|
8
|
-
// Platform detection + PLATFORMS map is duplicated in cli-wrapper.cjs — keep in sync.
|
|
9
|
-
|
|
10
|
-
const { spawnSync } = require('child_process')
|
|
11
|
-
const {
|
|
12
|
-
copyFileSync,
|
|
13
|
-
cpSync,
|
|
14
|
-
existsSync,
|
|
15
|
-
linkSync,
|
|
16
|
-
unlinkSync,
|
|
17
|
-
chmodSync,
|
|
18
|
-
readFileSync,
|
|
19
|
-
writeFileSync,
|
|
20
|
-
statSync,
|
|
21
|
-
readdirSync,
|
|
22
|
-
mkdirSync,
|
|
23
|
-
} = require('fs')
|
|
24
|
-
const { arch } = require('os')
|
|
25
|
-
const path = require('path')
|
|
26
|
-
|
|
27
|
-
// Dev environment detection: if .git exists at package root, we're in the monorepo
|
|
28
|
-
if (existsSync(path.join(__dirname, '.git'))) {
|
|
29
|
-
const r = spawnSync(
|
|
30
|
-
'node',
|
|
31
|
-
[
|
|
32
|
-
'scripts/run-parallel.mjs',
|
|
33
|
-
'scripts/postinstall.cjs',
|
|
34
|
-
'scripts/setup-chrome-mcp.mjs',
|
|
35
|
-
],
|
|
36
|
-
{ cwd: __dirname, stdio: 'inherit' },
|
|
37
|
-
)
|
|
38
|
-
process.exit(r.status ?? 0)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const PACKAGE_PREFIX = '@go-hare/claude-code'
|
|
42
|
-
const BINARY_NAME = 'claude'
|
|
43
|
-
const WRAPPER_NAME = require('./package.json').name
|
|
44
|
-
|
|
45
|
-
const PLATFORMS = {
|
|
46
|
-
'darwin-arm64': { pkg: PACKAGE_PREFIX + '-darwin-arm64', bin: BINARY_NAME },
|
|
47
|
-
'darwin-x64': { pkg: PACKAGE_PREFIX + '-darwin-x64', bin: BINARY_NAME },
|
|
48
|
-
'linux-x64': { pkg: PACKAGE_PREFIX + '-linux-x64', bin: BINARY_NAME },
|
|
49
|
-
'linux-arm64': { pkg: PACKAGE_PREFIX + '-linux-arm64', bin: BINARY_NAME },
|
|
50
|
-
'linux-x64-musl': {
|
|
51
|
-
pkg: PACKAGE_PREFIX + '-linux-x64-musl',
|
|
52
|
-
bin: BINARY_NAME,
|
|
53
|
-
},
|
|
54
|
-
'linux-arm64-musl': {
|
|
55
|
-
pkg: PACKAGE_PREFIX + '-linux-arm64-musl',
|
|
56
|
-
bin: BINARY_NAME,
|
|
57
|
-
},
|
|
58
|
-
'linux-arm64-android': {
|
|
59
|
-
pkg: PACKAGE_PREFIX + '-linux-arm64-android',
|
|
60
|
-
bin: BINARY_NAME,
|
|
61
|
-
},
|
|
62
|
-
'linux-x64-android': {
|
|
63
|
-
pkg: PACKAGE_PREFIX + '-linux-x64-android',
|
|
64
|
-
bin: BINARY_NAME,
|
|
65
|
-
},
|
|
66
|
-
'freebsd-x64': { pkg: PACKAGE_PREFIX + '-freebsd-x64', bin: BINARY_NAME },
|
|
67
|
-
'freebsd-arm64': {
|
|
68
|
-
pkg: PACKAGE_PREFIX + '-freebsd-arm64',
|
|
69
|
-
bin: BINARY_NAME,
|
|
70
|
-
},
|
|
71
|
-
'win32-x64': {
|
|
72
|
-
pkg: PACKAGE_PREFIX + '-win32-x64',
|
|
73
|
-
bin: BINARY_NAME + '.exe',
|
|
74
|
-
},
|
|
75
|
-
'win32-arm64': {
|
|
76
|
-
pkg: PACKAGE_PREFIX + '-win32-arm64',
|
|
77
|
-
bin: BINARY_NAME + '.exe',
|
|
78
|
-
},
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function detectMusl() {
|
|
82
|
-
if (process.platform !== 'linux') return false
|
|
83
|
-
const report =
|
|
84
|
-
typeof process.report?.getReport === 'function'
|
|
85
|
-
? process.report.getReport()
|
|
86
|
-
: null
|
|
87
|
-
return report != null && report.header?.glibcVersionRuntime === undefined
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function getPlatformKey() {
|
|
91
|
-
const platform = process.platform
|
|
92
|
-
let cpu = arch()
|
|
93
|
-
if (platform === 'android') return 'linux-' + cpu + '-android'
|
|
94
|
-
if (platform === 'linux')
|
|
95
|
-
return 'linux-' + cpu + (detectMusl() ? '-musl' : '')
|
|
96
|
-
if (platform === 'darwin' && cpu === 'x64') {
|
|
97
|
-
const r = spawnSync('sysctl', ['-n', 'sysctl.proc_translated'], {
|
|
98
|
-
encoding: 'utf8',
|
|
99
|
-
})
|
|
100
|
-
if (r.stdout?.trim() === '1') cpu = 'arm64'
|
|
101
|
-
}
|
|
102
|
-
return platform + '-' + cpu
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function placeBinary(src, dest) {
|
|
106
|
-
try {
|
|
107
|
-
linkSync(src, dest)
|
|
108
|
-
} catch (err) {
|
|
109
|
-
if (err.code === 'EEXIST') {
|
|
110
|
-
const stub = statSync(dest).size < 4096 ? readFileSync(dest) : null
|
|
111
|
-
unlinkSync(dest)
|
|
112
|
-
try {
|
|
113
|
-
linkSync(src, dest)
|
|
114
|
-
} catch {
|
|
115
|
-
try {
|
|
116
|
-
copyFileSync(src, dest)
|
|
117
|
-
} catch (copyErr) {
|
|
118
|
-
if (stub) {
|
|
119
|
-
try {
|
|
120
|
-
writeFileSync(dest, stub, { mode: 0o755 })
|
|
121
|
-
} catch {}
|
|
122
|
-
}
|
|
123
|
-
throw copyErr
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
} else if (err.code === 'EXDEV' || err.code === 'EPERM') {
|
|
127
|
-
copyFileSync(src, dest)
|
|
128
|
-
} else {
|
|
129
|
-
throw err
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (process.platform !== 'win32') chmodSync(dest, 0o755)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// npm install may drop the executable bit on vendored helpers (clipboard-image,
|
|
136
|
-
// ripgrep). Only the main binary was chmod'd before — restore +x under vendor/.
|
|
137
|
-
function ensureVendorBinariesExecutable(pkgDir) {
|
|
138
|
-
if (process.platform === 'win32') return
|
|
139
|
-
|
|
140
|
-
const vendorDir = path.join(pkgDir, 'vendor')
|
|
141
|
-
if (!existsSync(vendorDir)) return
|
|
142
|
-
|
|
143
|
-
const stack = [vendorDir]
|
|
144
|
-
while (stack.length > 0) {
|
|
145
|
-
const dir = stack.pop()
|
|
146
|
-
let entries
|
|
147
|
-
try {
|
|
148
|
-
entries = readdirSync(dir, { withFileTypes: true })
|
|
149
|
-
} catch {
|
|
150
|
-
continue
|
|
151
|
-
}
|
|
152
|
-
for (const entry of entries) {
|
|
153
|
-
const full = path.join(dir, entry.name)
|
|
154
|
-
if (entry.isDirectory()) {
|
|
155
|
-
stack.push(full)
|
|
156
|
-
continue
|
|
157
|
-
}
|
|
158
|
-
if (!entry.isFile()) continue
|
|
159
|
-
try {
|
|
160
|
-
chmodSync(full, 0o755)
|
|
161
|
-
} catch {
|
|
162
|
-
// Best-effort: missing write permission shouldn't fail install.
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function main() {
|
|
169
|
-
const platformKey = getPlatformKey()
|
|
170
|
-
const info = PLATFORMS[platformKey]
|
|
171
|
-
|
|
172
|
-
if (!info) {
|
|
173
|
-
console.error(
|
|
174
|
-
`[${WRAPPER_NAME} postinstall] Unsupported platform: ${process.platform} ${arch()}`,
|
|
175
|
-
)
|
|
176
|
-
console.error(` Supported: ${Object.keys(PLATFORMS).join(', ')}`)
|
|
177
|
-
return
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const optionalDeps = require('./package.json').optionalDependencies || {}
|
|
181
|
-
if (!optionalDeps[info.pkg]) {
|
|
182
|
-
console.error(
|
|
183
|
-
`[${WRAPPER_NAME} postinstall] Native binaries for ${platformKey} are not available on this release channel.`,
|
|
184
|
-
)
|
|
185
|
-
console.error(
|
|
186
|
-
` Available: ${Object.keys(optionalDeps)
|
|
187
|
-
.map(p => p.replace(PACKAGE_PREFIX + '-', ''))
|
|
188
|
-
.join(', ')}`,
|
|
189
|
-
)
|
|
190
|
-
return
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
let pkgDir
|
|
194
|
-
let src
|
|
195
|
-
try {
|
|
196
|
-
pkgDir = path.dirname(require.resolve(info.pkg + '/package.json'))
|
|
197
|
-
src = path.join(pkgDir, info.bin)
|
|
198
|
-
} catch {
|
|
199
|
-
console.error(
|
|
200
|
-
`[${WRAPPER_NAME} postinstall] Native package "${info.pkg}" not found.`,
|
|
201
|
-
)
|
|
202
|
-
console.error(
|
|
203
|
-
' This happens with --omit=optional or when the download failed.',
|
|
204
|
-
)
|
|
205
|
-
console.error(
|
|
206
|
-
' The `claude` command will print instructions when invoked.',
|
|
207
|
-
)
|
|
208
|
-
console.error(' Fallback: node ' + path.join(__dirname, 'cli-wrapper.cjs'))
|
|
209
|
-
return
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
const dest = path.join(__dirname, 'bin', 'claude.exe')
|
|
213
|
-
|
|
214
|
-
try {
|
|
215
|
-
placeBinary(src, dest)
|
|
216
|
-
// Bundled claude.exe resolves vendored rg next to process.execPath
|
|
217
|
-
// (bin/vendor/ripgrep/<platform>/rg[.exe]). Copy platform-package vendor
|
|
218
|
-
// tree beside the placed binary so Grep/Glob work without system rg.
|
|
219
|
-
copyVendorBesideBinary(pkgDir, dest)
|
|
220
|
-
ensureVendorBinariesExecutable(pkgDir)
|
|
221
|
-
ensureVendorBinariesExecutable(path.dirname(dest))
|
|
222
|
-
} catch (err) {
|
|
223
|
-
console.error(
|
|
224
|
-
`[${WRAPPER_NAME} postinstall] Failed to place binary: ${err.message}`,
|
|
225
|
-
)
|
|
226
|
-
console.error(' Fallback: node ' + path.join(__dirname, 'cli-wrapper.cjs'))
|
|
227
|
-
process.exitCode = 1
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Copy platform package `vendor/` next to the installed native binary.
|
|
233
|
-
* Required on Windows (and useful elsewhere) so builtin ripgrep is found at:
|
|
234
|
-
* <dir of claude.exe>/vendor/ripgrep/<arch>-win32/rg.exe
|
|
235
|
-
*/
|
|
236
|
-
function copyVendorBesideBinary(pkgDir, destBinary) {
|
|
237
|
-
const srcVendor = path.join(pkgDir, 'vendor')
|
|
238
|
-
if (!existsSync(srcVendor)) return
|
|
239
|
-
|
|
240
|
-
const destVendor = path.join(path.dirname(destBinary), 'vendor')
|
|
241
|
-
try {
|
|
242
|
-
mkdirSync(path.dirname(destVendor), { recursive: true })
|
|
243
|
-
cpSync(srcVendor, destVendor, { recursive: true, force: true })
|
|
244
|
-
} catch (err) {
|
|
245
|
-
console.error(
|
|
246
|
-
`[${WRAPPER_NAME} postinstall] Warning: could not copy vendor helpers: ${err.message}`,
|
|
247
|
-
)
|
|
248
|
-
console.error(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
main()
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Postinstall for the claude wrapper package.
|
|
3
|
+
//
|
|
4
|
+
// In development (monorepo with .git), delegates to the dev postinstall scripts.
|
|
5
|
+
// In production (npm install from registry), copies the native binary from the
|
|
6
|
+
// platform-specific optionalDependency into bin/claude.exe.
|
|
7
|
+
//
|
|
8
|
+
// Platform detection + PLATFORMS map is duplicated in cli-wrapper.cjs — keep in sync.
|
|
9
|
+
|
|
10
|
+
const { spawnSync } = require('child_process')
|
|
11
|
+
const {
|
|
12
|
+
copyFileSync,
|
|
13
|
+
cpSync,
|
|
14
|
+
existsSync,
|
|
15
|
+
linkSync,
|
|
16
|
+
unlinkSync,
|
|
17
|
+
chmodSync,
|
|
18
|
+
readFileSync,
|
|
19
|
+
writeFileSync,
|
|
20
|
+
statSync,
|
|
21
|
+
readdirSync,
|
|
22
|
+
mkdirSync,
|
|
23
|
+
} = require('fs')
|
|
24
|
+
const { arch } = require('os')
|
|
25
|
+
const path = require('path')
|
|
26
|
+
|
|
27
|
+
// Dev environment detection: if .git exists at package root, we're in the monorepo
|
|
28
|
+
if (existsSync(path.join(__dirname, '.git'))) {
|
|
29
|
+
const r = spawnSync(
|
|
30
|
+
'node',
|
|
31
|
+
[
|
|
32
|
+
'scripts/run-parallel.mjs',
|
|
33
|
+
'scripts/postinstall.cjs',
|
|
34
|
+
'scripts/setup-chrome-mcp.mjs',
|
|
35
|
+
],
|
|
36
|
+
{ cwd: __dirname, stdio: 'inherit' },
|
|
37
|
+
)
|
|
38
|
+
process.exit(r.status ?? 0)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const PACKAGE_PREFIX = '@go-hare/claude-code'
|
|
42
|
+
const BINARY_NAME = 'claude'
|
|
43
|
+
const WRAPPER_NAME = require('./package.json').name
|
|
44
|
+
|
|
45
|
+
const PLATFORMS = {
|
|
46
|
+
'darwin-arm64': { pkg: PACKAGE_PREFIX + '-darwin-arm64', bin: BINARY_NAME },
|
|
47
|
+
'darwin-x64': { pkg: PACKAGE_PREFIX + '-darwin-x64', bin: BINARY_NAME },
|
|
48
|
+
'linux-x64': { pkg: PACKAGE_PREFIX + '-linux-x64', bin: BINARY_NAME },
|
|
49
|
+
'linux-arm64': { pkg: PACKAGE_PREFIX + '-linux-arm64', bin: BINARY_NAME },
|
|
50
|
+
'linux-x64-musl': {
|
|
51
|
+
pkg: PACKAGE_PREFIX + '-linux-x64-musl',
|
|
52
|
+
bin: BINARY_NAME,
|
|
53
|
+
},
|
|
54
|
+
'linux-arm64-musl': {
|
|
55
|
+
pkg: PACKAGE_PREFIX + '-linux-arm64-musl',
|
|
56
|
+
bin: BINARY_NAME,
|
|
57
|
+
},
|
|
58
|
+
'linux-arm64-android': {
|
|
59
|
+
pkg: PACKAGE_PREFIX + '-linux-arm64-android',
|
|
60
|
+
bin: BINARY_NAME,
|
|
61
|
+
},
|
|
62
|
+
'linux-x64-android': {
|
|
63
|
+
pkg: PACKAGE_PREFIX + '-linux-x64-android',
|
|
64
|
+
bin: BINARY_NAME,
|
|
65
|
+
},
|
|
66
|
+
'freebsd-x64': { pkg: PACKAGE_PREFIX + '-freebsd-x64', bin: BINARY_NAME },
|
|
67
|
+
'freebsd-arm64': {
|
|
68
|
+
pkg: PACKAGE_PREFIX + '-freebsd-arm64',
|
|
69
|
+
bin: BINARY_NAME,
|
|
70
|
+
},
|
|
71
|
+
'win32-x64': {
|
|
72
|
+
pkg: PACKAGE_PREFIX + '-win32-x64',
|
|
73
|
+
bin: BINARY_NAME + '.exe',
|
|
74
|
+
},
|
|
75
|
+
'win32-arm64': {
|
|
76
|
+
pkg: PACKAGE_PREFIX + '-win32-arm64',
|
|
77
|
+
bin: BINARY_NAME + '.exe',
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function detectMusl() {
|
|
82
|
+
if (process.platform !== 'linux') return false
|
|
83
|
+
const report =
|
|
84
|
+
typeof process.report?.getReport === 'function'
|
|
85
|
+
? process.report.getReport()
|
|
86
|
+
: null
|
|
87
|
+
return report != null && report.header?.glibcVersionRuntime === undefined
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function getPlatformKey() {
|
|
91
|
+
const platform = process.platform
|
|
92
|
+
let cpu = arch()
|
|
93
|
+
if (platform === 'android') return 'linux-' + cpu + '-android'
|
|
94
|
+
if (platform === 'linux')
|
|
95
|
+
return 'linux-' + cpu + (detectMusl() ? '-musl' : '')
|
|
96
|
+
if (platform === 'darwin' && cpu === 'x64') {
|
|
97
|
+
const r = spawnSync('sysctl', ['-n', 'sysctl.proc_translated'], {
|
|
98
|
+
encoding: 'utf8',
|
|
99
|
+
})
|
|
100
|
+
if (r.stdout?.trim() === '1') cpu = 'arm64'
|
|
101
|
+
}
|
|
102
|
+
return platform + '-' + cpu
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function placeBinary(src, dest) {
|
|
106
|
+
try {
|
|
107
|
+
linkSync(src, dest)
|
|
108
|
+
} catch (err) {
|
|
109
|
+
if (err.code === 'EEXIST') {
|
|
110
|
+
const stub = statSync(dest).size < 4096 ? readFileSync(dest) : null
|
|
111
|
+
unlinkSync(dest)
|
|
112
|
+
try {
|
|
113
|
+
linkSync(src, dest)
|
|
114
|
+
} catch {
|
|
115
|
+
try {
|
|
116
|
+
copyFileSync(src, dest)
|
|
117
|
+
} catch (copyErr) {
|
|
118
|
+
if (stub) {
|
|
119
|
+
try {
|
|
120
|
+
writeFileSync(dest, stub, { mode: 0o755 })
|
|
121
|
+
} catch {}
|
|
122
|
+
}
|
|
123
|
+
throw copyErr
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} else if (err.code === 'EXDEV' || err.code === 'EPERM') {
|
|
127
|
+
copyFileSync(src, dest)
|
|
128
|
+
} else {
|
|
129
|
+
throw err
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (process.platform !== 'win32') chmodSync(dest, 0o755)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// npm install may drop the executable bit on vendored helpers (clipboard-image,
|
|
136
|
+
// ripgrep). Only the main binary was chmod'd before — restore +x under vendor/.
|
|
137
|
+
function ensureVendorBinariesExecutable(pkgDir) {
|
|
138
|
+
if (process.platform === 'win32') return
|
|
139
|
+
|
|
140
|
+
const vendorDir = path.join(pkgDir, 'vendor')
|
|
141
|
+
if (!existsSync(vendorDir)) return
|
|
142
|
+
|
|
143
|
+
const stack = [vendorDir]
|
|
144
|
+
while (stack.length > 0) {
|
|
145
|
+
const dir = stack.pop()
|
|
146
|
+
let entries
|
|
147
|
+
try {
|
|
148
|
+
entries = readdirSync(dir, { withFileTypes: true })
|
|
149
|
+
} catch {
|
|
150
|
+
continue
|
|
151
|
+
}
|
|
152
|
+
for (const entry of entries) {
|
|
153
|
+
const full = path.join(dir, entry.name)
|
|
154
|
+
if (entry.isDirectory()) {
|
|
155
|
+
stack.push(full)
|
|
156
|
+
continue
|
|
157
|
+
}
|
|
158
|
+
if (!entry.isFile()) continue
|
|
159
|
+
try {
|
|
160
|
+
chmodSync(full, 0o755)
|
|
161
|
+
} catch {
|
|
162
|
+
// Best-effort: missing write permission shouldn't fail install.
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function main() {
|
|
169
|
+
const platformKey = getPlatformKey()
|
|
170
|
+
const info = PLATFORMS[platformKey]
|
|
171
|
+
|
|
172
|
+
if (!info) {
|
|
173
|
+
console.error(
|
|
174
|
+
`[${WRAPPER_NAME} postinstall] Unsupported platform: ${process.platform} ${arch()}`,
|
|
175
|
+
)
|
|
176
|
+
console.error(` Supported: ${Object.keys(PLATFORMS).join(', ')}`)
|
|
177
|
+
return
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const optionalDeps = require('./package.json').optionalDependencies || {}
|
|
181
|
+
if (!optionalDeps[info.pkg]) {
|
|
182
|
+
console.error(
|
|
183
|
+
`[${WRAPPER_NAME} postinstall] Native binaries for ${platformKey} are not available on this release channel.`,
|
|
184
|
+
)
|
|
185
|
+
console.error(
|
|
186
|
+
` Available: ${Object.keys(optionalDeps)
|
|
187
|
+
.map(p => p.replace(PACKAGE_PREFIX + '-', ''))
|
|
188
|
+
.join(', ')}`,
|
|
189
|
+
)
|
|
190
|
+
return
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let pkgDir
|
|
194
|
+
let src
|
|
195
|
+
try {
|
|
196
|
+
pkgDir = path.dirname(require.resolve(info.pkg + '/package.json'))
|
|
197
|
+
src = path.join(pkgDir, info.bin)
|
|
198
|
+
} catch {
|
|
199
|
+
console.error(
|
|
200
|
+
`[${WRAPPER_NAME} postinstall] Native package "${info.pkg}" not found.`,
|
|
201
|
+
)
|
|
202
|
+
console.error(
|
|
203
|
+
' This happens with --omit=optional or when the download failed.',
|
|
204
|
+
)
|
|
205
|
+
console.error(
|
|
206
|
+
' The `claude` command will print instructions when invoked.',
|
|
207
|
+
)
|
|
208
|
+
console.error(' Fallback: node ' + path.join(__dirname, 'cli-wrapper.cjs'))
|
|
209
|
+
return
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const dest = path.join(__dirname, 'bin', 'claude.exe')
|
|
213
|
+
|
|
214
|
+
try {
|
|
215
|
+
placeBinary(src, dest)
|
|
216
|
+
// Bundled claude.exe resolves vendored rg next to process.execPath
|
|
217
|
+
// (bin/vendor/ripgrep/<platform>/rg[.exe]). Copy platform-package vendor
|
|
218
|
+
// tree beside the placed binary so Grep/Glob work without system rg.
|
|
219
|
+
copyVendorBesideBinary(pkgDir, dest)
|
|
220
|
+
ensureVendorBinariesExecutable(pkgDir)
|
|
221
|
+
ensureVendorBinariesExecutable(path.dirname(dest))
|
|
222
|
+
} catch (err) {
|
|
223
|
+
console.error(
|
|
224
|
+
`[${WRAPPER_NAME} postinstall] Failed to place binary: ${err.message}`,
|
|
225
|
+
)
|
|
226
|
+
console.error(' Fallback: node ' + path.join(__dirname, 'cli-wrapper.cjs'))
|
|
227
|
+
process.exitCode = 1
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Copy platform package `vendor/` next to the installed native binary.
|
|
233
|
+
* Required on Windows (and useful elsewhere) so builtin ripgrep is found at:
|
|
234
|
+
* <dir of claude.exe>/vendor/ripgrep/<arch>-win32/rg.exe
|
|
235
|
+
*/
|
|
236
|
+
function copyVendorBesideBinary(pkgDir, destBinary) {
|
|
237
|
+
const srcVendor = path.join(pkgDir, 'vendor')
|
|
238
|
+
if (!existsSync(srcVendor)) return
|
|
239
|
+
|
|
240
|
+
const destVendor = path.join(path.dirname(destBinary), 'vendor')
|
|
241
|
+
try {
|
|
242
|
+
mkdirSync(path.dirname(destVendor), { recursive: true })
|
|
243
|
+
cpSync(srcVendor, destVendor, { recursive: true, force: true })
|
|
244
|
+
} catch (err) {
|
|
245
|
+
console.error(
|
|
246
|
+
`[${WRAPPER_NAME} postinstall] Warning: could not copy vendor helpers: ${err.message}`,
|
|
247
|
+
)
|
|
248
|
+
console.error(' Grep/Glob may fall back to system ripgrep if available.')
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
main()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@go-hare/claude-code",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.11",
|
|
4
4
|
"description": "Source restoration / engineering rebuild of Anthropic Claude Code CLI — multi-provider models, self-hosted Remote Control, ACP, daemon sessions, MCP, plugins, and terminal automation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "DeQiang",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"README.md"
|
|
40
40
|
],
|
|
41
41
|
"optionalDependencies": {
|
|
42
|
-
"@go-hare/claude-code-darwin-arm64": ">=2.7.
|
|
43
|
-
"@go-hare/claude-code-darwin-x64": ">=2.7.
|
|
44
|
-
"@go-hare/claude-code-linux-x64": ">=2.7.
|
|
45
|
-
"@go-hare/claude-code-linux-arm64": ">=2.7.
|
|
46
|
-
"@go-hare/claude-code-linux-x64-musl": ">=2.7.
|
|
47
|
-
"@go-hare/claude-code-linux-arm64-musl": ">=2.7.
|
|
48
|
-
"@go-hare/claude-code-win32-x64": ">=2.7.
|
|
49
|
-
"@go-hare/claude-code-win32-arm64": ">=2.7.
|
|
42
|
+
"@go-hare/claude-code-darwin-arm64": ">=2.7.11",
|
|
43
|
+
"@go-hare/claude-code-darwin-x64": ">=2.7.11",
|
|
44
|
+
"@go-hare/claude-code-linux-x64": ">=2.7.11",
|
|
45
|
+
"@go-hare/claude-code-linux-arm64": ">=2.7.11",
|
|
46
|
+
"@go-hare/claude-code-linux-x64-musl": ">=2.7.11",
|
|
47
|
+
"@go-hare/claude-code-linux-arm64-musl": ">=2.7.11",
|
|
48
|
+
"@go-hare/claude-code-win32-x64": ">=2.7.11",
|
|
49
|
+
"@go-hare/claude-code-win32-arm64": ">=2.7.11",
|
|
50
50
|
"doubaoime-asr": "^0.1.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|