@kilocode/cli 7.3.1 → 7.3.6
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/bin/kilo +11 -0
- package/package.json +13 -13
- package/postinstall.mjs +14 -0
package/bin/kilo
CHANGED
|
@@ -5,7 +5,17 @@ const fs = require("fs")
|
|
|
5
5
|
const path = require("path")
|
|
6
6
|
const os = require("os")
|
|
7
7
|
|
|
8
|
+
// kilocode_change start - point packaged binaries at co-located tree-sitter WASM resources
|
|
9
|
+
function configureTreeSitterResources(target) {
|
|
10
|
+
const wasmDir = path.join(path.dirname(target), "tree-sitter")
|
|
11
|
+
if (!process.env.KILO_TREE_SITTER_WASM_DIR && fs.existsSync(path.join(wasmDir, "tree-sitter.wasm"))) {
|
|
12
|
+
process.env.KILO_TREE_SITTER_WASM_DIR = wasmDir
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
// kilocode_change end
|
|
16
|
+
|
|
8
17
|
function run(target) {
|
|
18
|
+
configureTreeSitterResources(target) // kilocode_change
|
|
9
19
|
const result = childProcess.spawnSync(target, process.argv.slice(2), {
|
|
10
20
|
stdio: "inherit",
|
|
11
21
|
})
|
|
@@ -28,6 +38,7 @@ const scriptDir = path.dirname(scriptPath)
|
|
|
28
38
|
// kilocode_change start - fall through to findBinary() if cached binary fails
|
|
29
39
|
const cached = path.join(scriptDir, ".kilo")
|
|
30
40
|
if (fs.existsSync(cached)) {
|
|
41
|
+
configureTreeSitterResources(cached)
|
|
31
42
|
const result = childProcess.spawnSync(cached, process.argv.slice(2), {
|
|
32
43
|
stdio: "inherit",
|
|
33
44
|
})
|
package/package.json
CHANGED
|
@@ -7,21 +7,21 @@
|
|
|
7
7
|
"scripts": {
|
|
8
8
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
9
9
|
},
|
|
10
|
-
"version": "7.3.
|
|
10
|
+
"version": "7.3.6",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"optionalDependencies": {
|
|
13
|
-
"@kilocode/cli-linux-x64-baseline-musl": "7.3.
|
|
14
|
-
"@kilocode/cli-linux-x64-musl": "7.3.
|
|
15
|
-
"@kilocode/cli-darwin-x64-baseline": "7.3.
|
|
16
|
-
"@kilocode/cli-darwin-x64": "7.3.
|
|
17
|
-
"@kilocode/cli-linux-arm64": "7.3.
|
|
18
|
-
"@kilocode/cli-linux-x64": "7.3.
|
|
19
|
-
"@kilocode/cli-windows-x64-baseline": "7.3.
|
|
20
|
-
"@kilocode/cli-linux-arm64-musl": "7.3.
|
|
21
|
-
"@kilocode/cli-windows-arm64": "7.3.
|
|
22
|
-
"@kilocode/cli-windows-x64": "7.3.
|
|
23
|
-
"@kilocode/cli-linux-x64-baseline": "7.3.
|
|
24
|
-
"@kilocode/cli-darwin-arm64": "7.3.
|
|
13
|
+
"@kilocode/cli-linux-x64-baseline-musl": "7.3.6",
|
|
14
|
+
"@kilocode/cli-linux-x64-musl": "7.3.6",
|
|
15
|
+
"@kilocode/cli-darwin-x64-baseline": "7.3.6",
|
|
16
|
+
"@kilocode/cli-darwin-x64": "7.3.6",
|
|
17
|
+
"@kilocode/cli-linux-arm64": "7.3.6",
|
|
18
|
+
"@kilocode/cli-linux-x64": "7.3.6",
|
|
19
|
+
"@kilocode/cli-windows-x64-baseline": "7.3.6",
|
|
20
|
+
"@kilocode/cli-linux-arm64-musl": "7.3.6",
|
|
21
|
+
"@kilocode/cli-windows-arm64": "7.3.6",
|
|
22
|
+
"@kilocode/cli-windows-x64": "7.3.6",
|
|
23
|
+
"@kilocode/cli-linux-x64-baseline": "7.3.6",
|
|
24
|
+
"@kilocode/cli-darwin-arm64": "7.3.6"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
package/postinstall.mjs
CHANGED
|
@@ -126,6 +126,19 @@ function findBinary() {
|
|
|
126
126
|
}
|
|
127
127
|
// kilocode_change end
|
|
128
128
|
|
|
129
|
+
// kilocode_change start - copy tree-sitter WASM resources next to cached binary
|
|
130
|
+
function copyTreeSitterResources(binaryPath) {
|
|
131
|
+
const source = path.join(path.dirname(binaryPath), "tree-sitter")
|
|
132
|
+
const target = path.join(__dirname, "bin", "tree-sitter")
|
|
133
|
+
const runtime = path.join(source, "tree-sitter.wasm")
|
|
134
|
+
|
|
135
|
+
if (!fs.existsSync(runtime)) return
|
|
136
|
+
|
|
137
|
+
fs.rmSync(target, { recursive: true, force: true })
|
|
138
|
+
fs.cpSync(source, target, { recursive: true })
|
|
139
|
+
}
|
|
140
|
+
// kilocode_change end
|
|
141
|
+
|
|
129
142
|
function main() {
|
|
130
143
|
if (os.platform() === "win32") {
|
|
131
144
|
// On Windows, the .exe is already included in the package and bin field points to it
|
|
@@ -141,6 +154,7 @@ function main() {
|
|
|
141
154
|
} catch {
|
|
142
155
|
fs.copyFileSync(binaryPath, target)
|
|
143
156
|
}
|
|
157
|
+
copyTreeSitterResources(binaryPath) // kilocode_change
|
|
144
158
|
fs.chmodSync(target, 0o755)
|
|
145
159
|
}
|
|
146
160
|
|