coderider 0.0.21-beta → 1.2.2-beta
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 +3 -3
- package/bin/coderider +104 -9
- package/package.json +20 -21
- package/postinstall.mjs +8 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Coderider CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AI-powered development tool
|
|
4
4
|
|
|
5
5
|
## Quick Install
|
|
6
6
|
|
|
@@ -24,5 +24,5 @@ coderider --help
|
|
|
24
24
|
|
|
25
25
|
## Links
|
|
26
26
|
|
|
27
|
-
- [Project Repository](https://
|
|
28
|
-
- [Documentation](https://
|
|
27
|
+
- [Project Repository](https://github.com/anomalyco/opencode)
|
|
28
|
+
- [Documentation](https://github.com/anomalyco/opencode)
|
package/bin/coderider
CHANGED
|
@@ -25,6 +25,12 @@ if (envPath) {
|
|
|
25
25
|
const scriptPath = fs.realpathSync(__filename)
|
|
26
26
|
const scriptDir = path.dirname(scriptPath)
|
|
27
27
|
|
|
28
|
+
//
|
|
29
|
+
const cached = path.join(scriptDir, ".opencode")
|
|
30
|
+
if (fs.existsSync(cached)) {
|
|
31
|
+
run(cached)
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
const platformMap = {
|
|
29
35
|
darwin: "darwin",
|
|
30
36
|
linux: "linux",
|
|
@@ -47,20 +53,109 @@ if (!arch) {
|
|
|
47
53
|
const base = "coderider-" + platform + "-" + arch
|
|
48
54
|
const binary = platform === "windows" ? "coderider.exe" : "coderider"
|
|
49
55
|
|
|
56
|
+
function supportsAvx2() {
|
|
57
|
+
if (arch !== "x64") return false
|
|
58
|
+
|
|
59
|
+
if (platform === "linux") {
|
|
60
|
+
try {
|
|
61
|
+
return /(^|\s)avx2(\s|$)/i.test(fs.readFileSync("/proc/cpuinfo", "utf8"))
|
|
62
|
+
} catch {
|
|
63
|
+
return false
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (platform === "darwin") {
|
|
68
|
+
try {
|
|
69
|
+
const result = childProcess.spawnSync("sysctl", ["-n", "hw.optional.avx2_0"], {
|
|
70
|
+
encoding: "utf8",
|
|
71
|
+
timeout: 1500,
|
|
72
|
+
})
|
|
73
|
+
if (result.status !== 0) return false
|
|
74
|
+
return (result.stdout || "").trim() === "1"
|
|
75
|
+
} catch {
|
|
76
|
+
return false
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (platform === "windows") {
|
|
81
|
+
const cmd =
|
|
82
|
+
'(Add-Type -MemberDefinition "[DllImport(""kernel32.dll"")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);" -Name Kernel32 -Namespace Win32 -PassThru)::IsProcessorFeaturePresent(40)'
|
|
83
|
+
|
|
84
|
+
for (const exe of ["powershell.exe", "pwsh.exe", "pwsh", "powershell"]) {
|
|
85
|
+
try {
|
|
86
|
+
const result = childProcess.spawnSync(exe, ["-NoProfile", "-NonInteractive", "-Command", cmd], {
|
|
87
|
+
encoding: "utf8",
|
|
88
|
+
timeout: 3000,
|
|
89
|
+
windowsHide: true,
|
|
90
|
+
})
|
|
91
|
+
if (result.status !== 0) continue
|
|
92
|
+
const out = (result.stdout || "").trim().toLowerCase()
|
|
93
|
+
if (out === "true" || out === "1") return true
|
|
94
|
+
if (out === "false" || out === "0") return false
|
|
95
|
+
} catch {
|
|
96
|
+
continue
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return false
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return false
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const names = (() => {
|
|
107
|
+
const avx2 = supportsAvx2()
|
|
108
|
+
const baseline = arch === "x64" && !avx2
|
|
109
|
+
|
|
110
|
+
if (platform === "linux") {
|
|
111
|
+
const musl = (() => {
|
|
112
|
+
try {
|
|
113
|
+
if (fs.existsSync("/etc/alpine-release")) return true
|
|
114
|
+
} catch {
|
|
115
|
+
// ignore
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
const result = childProcess.spawnSync("ldd", ["--version"], { encoding: "utf8" })
|
|
120
|
+
const text = ((result.stdout || "") + (result.stderr || "")).toLowerCase()
|
|
121
|
+
if (text.includes("musl")) return true
|
|
122
|
+
} catch {
|
|
123
|
+
// ignore
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return false
|
|
127
|
+
})()
|
|
128
|
+
|
|
129
|
+
if (musl) {
|
|
130
|
+
if (arch === "x64") {
|
|
131
|
+
if (baseline) return [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base]
|
|
132
|
+
return [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]
|
|
133
|
+
}
|
|
134
|
+
return [`${base}-musl`, base]
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (arch === "x64") {
|
|
138
|
+
if (baseline) return [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`]
|
|
139
|
+
return [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]
|
|
140
|
+
}
|
|
141
|
+
return [base, `${base}-musl`]
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (arch === "x64") {
|
|
145
|
+
if (baseline) return [`${base}-baseline`, base]
|
|
146
|
+
return [base, `${base}-baseline`]
|
|
147
|
+
}
|
|
148
|
+
return [base]
|
|
149
|
+
})()
|
|
150
|
+
|
|
50
151
|
function findBinary(startDir) {
|
|
51
152
|
let current = startDir
|
|
52
153
|
for (;;) {
|
|
53
154
|
const modules = path.join(current, "node_modules")
|
|
54
155
|
if (fs.existsSync(modules)) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
continue
|
|
59
|
-
}
|
|
60
|
-
const candidate = path.join(modules, entry, "bin", binary)
|
|
61
|
-
if (fs.existsSync(candidate)) {
|
|
62
|
-
return candidate
|
|
63
|
-
}
|
|
156
|
+
for (const name of names) {
|
|
157
|
+
const candidate = path.join(modules, name, "bin", binary)
|
|
158
|
+
if (fs.existsSync(candidate)) return candidate
|
|
64
159
|
}
|
|
65
160
|
}
|
|
66
161
|
const parent = path.dirname(current)
|
package/package.json
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coderider",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.2-beta",
|
|
4
|
+
"description": "AI-powered development tool",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"cli",
|
|
7
|
-
"code",
|
|
8
6
|
"ai",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
7
|
+
"coding",
|
|
8
|
+
"cli"
|
|
11
9
|
],
|
|
12
|
-
"author": "
|
|
10
|
+
"author": "CodeRider",
|
|
13
11
|
"license": "MIT",
|
|
14
12
|
"repository": {
|
|
15
13
|
"type": "git",
|
|
16
|
-
"url": "https://
|
|
14
|
+
"url": "https://github.com/anomalyco/opencode"
|
|
17
15
|
},
|
|
18
|
-
"homepage": "https://
|
|
16
|
+
"homepage": "https://github.com/anomalyco/opencode",
|
|
19
17
|
"bugs": {
|
|
20
|
-
"url": "https://
|
|
18
|
+
"url": "https://github.com/anomalyco/opencode/issues"
|
|
21
19
|
},
|
|
22
20
|
"bin": {
|
|
23
21
|
"coderider": "./bin/coderider"
|
|
@@ -26,16 +24,17 @@
|
|
|
26
24
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
27
25
|
},
|
|
28
26
|
"optionalDependencies": {
|
|
29
|
-
"coderider-darwin-x64-baseline": "
|
|
30
|
-
"coderider-windows-x64-baseline": "
|
|
31
|
-
"coderider-linux-arm64-musl": "
|
|
32
|
-
"coderider-
|
|
33
|
-
"coderider-
|
|
34
|
-
"coderider-
|
|
35
|
-
"coderider-
|
|
36
|
-
"coderider-
|
|
37
|
-
"coderider-linux-x64-baseline
|
|
38
|
-
"coderider-
|
|
39
|
-
"coderider-
|
|
27
|
+
"coderider-darwin-x64-baseline": "1.2.2-beta",
|
|
28
|
+
"coderider-windows-x64-baseline": "1.2.2-beta",
|
|
29
|
+
"coderider-linux-arm64-musl": "1.2.2-beta",
|
|
30
|
+
"coderider-windows-arm64": "1.2.2-beta",
|
|
31
|
+
"coderider-linux-x64-musl": "1.2.2-beta",
|
|
32
|
+
"coderider-windows-x64": "1.2.2-beta",
|
|
33
|
+
"coderider-linux-x64": "1.2.2-beta",
|
|
34
|
+
"coderider-darwin-x64": "1.2.2-beta",
|
|
35
|
+
"coderider-linux-x64-baseline": "1.2.2-beta",
|
|
36
|
+
"coderider-linux-x64-baseline-musl": "1.2.2-beta",
|
|
37
|
+
"coderider-darwin-arm64": "1.2.2-beta",
|
|
38
|
+
"coderider-linux-arm64": "1.2.2-beta"
|
|
40
39
|
}
|
|
41
40
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -109,8 +109,14 @@ async function main() {
|
|
|
109
109
|
// On non-Windows platforms, just verify the binary package exists
|
|
110
110
|
// Don't replace the wrapper script - it handles binary execution
|
|
111
111
|
const { binaryPath } = findBinary()
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
const target = path.join(__dirname, "bin", ".opencode")
|
|
113
|
+
if (fs.existsSync(target)) fs.unlinkSync(target)
|
|
114
|
+
try {
|
|
115
|
+
fs.linkSync(binaryPath, target)
|
|
116
|
+
} catch {
|
|
117
|
+
fs.copyFileSync(binaryPath, target)
|
|
118
|
+
}
|
|
119
|
+
fs.chmodSync(target, 0o755)
|
|
114
120
|
} catch (error) {
|
|
115
121
|
console.error("Failed to setup coderider binary:", error.message)
|
|
116
122
|
process.exit(1)
|