@nzkbuild/toche 1.0.9 → 1.1.0
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/LICENSE +201 -201
- package/NOTICE +18 -18
- package/README.md +421 -367
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/npm/install.js +13 -4
- package/npm/install.test.js +53 -5
- package/package.json +1 -1
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -11,7 +11,7 @@ copyright notices, project links, and integration decisions are preserved here.
|
|
|
11
11
|
| Project | License | Clone commit | Integration | Purpose |
|
|
12
12
|
|---------|---------|-------------|-------------|---------|
|
|
13
13
|
| [ccusage](https://github.com/ccusage/ccusage) | MIT | `ba99c0d` | Reference: adapt pricing/reporting patterns | Usage ledger concepts, pricing models, reporting |
|
|
14
|
-
| [RTK](https://github.com/rtk-ai/rtk) | Apache-2.0 | `
|
|
14
|
+
| [RTK](https://github.com/rtk-ai/rtk) | Apache-2.0 | `5d32d0736f686b69d1e8b9dc45c007d4eb77a0a2` | Reference: adapt filter and hook architecture | Command/tool-output reduction, Claude Code hook integration |
|
|
15
15
|
| [Graphify](https://github.com/Graphify-Labs/graphify) | MIT | `43b2aff` | External CLI/MCP adapter | Local project graph and query service |
|
|
16
16
|
| [andrej-karpathy-skills](https://github.com/multica-ai/andrej-karpathy-skills) | MIT | `2c60614` | Reference: adapt policy rules | Careful-work policy profile (Section 0.6.0) |
|
|
17
17
|
| [caveman-claude](https://github.com/juliusbrussee/caveman) | MIT | `0d95a81` | Reference: adapt concision patterns | Concise response profile, token reduction strategies |
|
package/npm/install.js
CHANGED
|
@@ -82,11 +82,20 @@ function extract(archive, destination, format) {
|
|
|
82
82
|
const powershell = process.env.SystemRoot
|
|
83
83
|
? path.join(process.env.SystemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe")
|
|
84
84
|
: "powershell.exe";
|
|
85
|
-
const command =
|
|
85
|
+
const command =
|
|
86
|
+
"Expand-Archive -LiteralPath $env:TOCHE_ARCHIVE_PATH " +
|
|
87
|
+
"-DestinationPath $env:TOCHE_EXTRACT_DESTINATION -Force";
|
|
86
88
|
const result = spawnSync(
|
|
87
89
|
powershell,
|
|
88
|
-
["-NoProfile", "-NonInteractive", "-Command", command
|
|
89
|
-
{
|
|
90
|
+
["-NoProfile", "-NonInteractive", "-Command", command],
|
|
91
|
+
{
|
|
92
|
+
stdio: "inherit",
|
|
93
|
+
env: {
|
|
94
|
+
...process.env,
|
|
95
|
+
TOCHE_ARCHIVE_PATH: archive,
|
|
96
|
+
TOCHE_EXTRACT_DESTINATION: destination
|
|
97
|
+
}
|
|
98
|
+
}
|
|
90
99
|
);
|
|
91
100
|
if (result.status !== 0) throw new Error("Could not extract the Toche zip archive.");
|
|
92
101
|
}
|
|
@@ -144,4 +153,4 @@ if (require.main === module) {
|
|
|
144
153
|
});
|
|
145
154
|
}
|
|
146
155
|
|
|
147
|
-
module.exports = { install, parseChecksum, releaseAsset };
|
|
156
|
+
module.exports = { extract, install, parseChecksum, releaseAsset };
|
package/npm/install.test.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const assert = require("node:assert/strict");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const os = require("node:os");
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
const { spawnSync } = require("node:child_process");
|
|
4
8
|
const test = require("node:test");
|
|
5
|
-
const { parseChecksum, releaseAsset } = require("./install");
|
|
9
|
+
const { extract, parseChecksum, releaseAsset } = require("./install");
|
|
6
10
|
|
|
7
11
|
test("maps every published platform to its release archive", () => {
|
|
8
|
-
assert.equal(releaseAsset("linux", "x64").archive, "toche-1.0.
|
|
9
|
-
assert.equal(releaseAsset("win32", "x64").archive, "toche-1.0.
|
|
10
|
-
assert.equal(releaseAsset("darwin", "x64").archive, "toche-1.0.
|
|
11
|
-
assert.equal(releaseAsset("darwin", "arm64").archive, "toche-1.0.
|
|
12
|
+
assert.equal(releaseAsset("linux", "x64").archive, "toche-1.0.10-x86_64-unknown-linux-gnu.tar.gz");
|
|
13
|
+
assert.equal(releaseAsset("win32", "x64").archive, "toche-1.0.10-x86_64-pc-windows-msvc.zip");
|
|
14
|
+
assert.equal(releaseAsset("darwin", "x64").archive, "toche-1.0.10-x86_64-apple-darwin.tar.gz");
|
|
15
|
+
assert.equal(releaseAsset("darwin", "arm64").archive, "toche-1.0.10-aarch64-apple-darwin.tar.gz");
|
|
12
16
|
});
|
|
13
17
|
|
|
14
18
|
test("rejects a platform without a published binary", () => {
|
|
@@ -23,3 +27,47 @@ test("parses sha256sum output", () => {
|
|
|
23
27
|
test("rejects malformed checksums", () => {
|
|
24
28
|
assert.throws(() => parseChecksum("not-a-checksum"), /malformed/);
|
|
25
29
|
});
|
|
30
|
+
|
|
31
|
+
test("extracts a Windows zip when paths contain spaces", { skip: process.platform !== "win32" }, () => {
|
|
32
|
+
const temporary = fs.mkdtempSync(path.join(os.tmpdir(), "toche npm extraction "));
|
|
33
|
+
const source = path.join(temporary, "source folder");
|
|
34
|
+
const payload = path.join(source, "payload");
|
|
35
|
+
const archive = path.join(temporary, "archive with spaces.zip");
|
|
36
|
+
const destination = path.join(temporary, "destination folder");
|
|
37
|
+
const powershell = process.env.SystemRoot
|
|
38
|
+
? path.join(process.env.SystemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe")
|
|
39
|
+
: "powershell.exe";
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
fs.mkdirSync(payload, { recursive: true });
|
|
43
|
+
fs.writeFileSync(path.join(payload, "toche.exe"), "windows-test-binary");
|
|
44
|
+
|
|
45
|
+
const compressed = spawnSync(
|
|
46
|
+
powershell,
|
|
47
|
+
[
|
|
48
|
+
"-NoProfile",
|
|
49
|
+
"-NonInteractive",
|
|
50
|
+
"-Command",
|
|
51
|
+
"Compress-Archive -LiteralPath $env:TOCHE_TEST_SOURCE " +
|
|
52
|
+
"-DestinationPath $env:TOCHE_TEST_ARCHIVE -Force"
|
|
53
|
+
],
|
|
54
|
+
{
|
|
55
|
+
stdio: "inherit",
|
|
56
|
+
env: {
|
|
57
|
+
...process.env,
|
|
58
|
+
TOCHE_TEST_SOURCE: payload,
|
|
59
|
+
TOCHE_TEST_ARCHIVE: archive
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
assert.equal(compressed.status, 0, "test zip creation should succeed");
|
|
64
|
+
|
|
65
|
+
extract(archive, destination, "zip");
|
|
66
|
+
assert.equal(
|
|
67
|
+
fs.readFileSync(path.join(destination, "payload", "toche.exe"), "utf8"),
|
|
68
|
+
"windows-test-binary"
|
|
69
|
+
);
|
|
70
|
+
} finally {
|
|
71
|
+
fs.rmSync(temporary, { recursive: true, force: true });
|
|
72
|
+
}
|
|
73
|
+
});
|