@nzkbuild/toche 1.0.9 → 1.0.10

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 CHANGED
@@ -12,7 +12,7 @@
12
12
  </p>
13
13
 
14
14
  <p align="center">
15
- <img src="assets/branding/toche-status.svg" alt="Toche 1.0.9: 65 filters, duplicate requests coalesced from many to one, zero hosted accounts, 354 Rust tests" width="820">
15
+ <img src="assets/branding/toche-status.svg" alt="Toche 1.0.10: 65 filters, duplicate requests coalesced from many to one, zero hosted accounts, 354 Rust tests" width="820">
16
16
  </p>
17
17
 
18
18
  <p align="center">
@@ -351,7 +351,7 @@ gateway is stopped, inspect `~/.claude/settings.json` and its Toche backup.
351
351
  ## Documentation
352
352
 
353
353
  - [Architecture](docs/ARCHITECTURE.md): pipeline, modules, databases, and storage
354
- - [Changelog](CHANGELOG.md): release history from 0.1.0 through 1.0.9
354
+ - [Changelog](CHANGELOG.md): release history from 0.1.0 through 1.0.10
355
355
  - [Bug tracker](docs/BUG_TRACKER.md): issues found and fixed during dogfooding
356
356
  - [npm publishing](docs/NPM_PUBLISHING.md): maintainer checklist for the first npm release
357
357
  - [Third-party notices](THIRD_PARTY_NOTICES.md): reused ideas, integration decisions, and attribution
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 = "Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force";
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, archive, destination],
89
- { stdio: "inherit" }
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 };
@@ -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-x86_64-unknown-linux-gnu.tar.gz");
9
- assert.equal(releaseAsset("win32", "x64").archive, "toche-1.0.9-x86_64-pc-windows-msvc.zip");
10
- assert.equal(releaseAsset("darwin", "x64").archive, "toche-1.0.9-x86_64-apple-darwin.tar.gz");
11
- assert.equal(releaseAsset("darwin", "arm64").archive, "toche-1.0.9-aarch64-apple-darwin.tar.gz");
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
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nzkbuild/toche",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Local efficiency gateway for Claude Code",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {