@namzu/sandbox 35.0.0 → 36.0.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @namzu/sandbox
|
|
2
2
|
|
|
3
|
+
## 36.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [7d27644]
|
|
8
|
+
- @namzu/sdk@61.0.0
|
|
9
|
+
|
|
10
|
+
## 35.0.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 8723565: Namzu's temporary files now live in one place you can move. Set `NAMZU_TMPDIR` to a full path to put them on another disk; unset, nothing moves from the operating system's temporary folder (`TMPDIR`, `TMP`, `TEMP`). Under it Namzu keeps a private `namzu-<user>` folder (mode 0700, refused when it is a symbolic link, belongs to someone else or is open to other users) and puts there what used to land loose in the shared temporary folder: the shell's working-directory marker (`namzu-cwd-*`), rendered PDF pages, the sandbox's own working directory, pasted clipboard images, the external editor's draft, the update download, the `namzu doctor` code-analysis probe and a local Pal computer's port-forward files. A pasted image or draft is therefore no longer a world-readable path under `/tmp`.
|
|
15
|
+
|
|
16
|
+
New SDK exports for hosts that want the same behaviour: `NAMZU_TMPDIR_ENV`, `resolveTempBase`, `privateTempRoot`, `createTempDir`, `createTempDirSync`, `tempFilePath`, `TempDirectoryError`. `tempRoot` now honours `NAMZU_TMPDIR` too and still throws `SessionPathError` for a refused folder.
|
|
17
|
+
|
|
18
|
+
What changes when something is wrong: there is no silent fallback to another folder. A folder that cannot be created on a full disk stops with one line that names it and the variable ("The disk is full, so Namzu could not create <folder>. Free some space and start again, or set NAMZU_TMPDIR to a folder on another disk.") and, at start-up, exits with status 69 instead of a stack trace; a used-up quota, an unwritable or missing folder and a relative `NAMZU_TMPDIR` get their own plain sentences. A full disk under `NAMZU_HOME` is reported the same way, naming `NAMZU_HOME`. `namzu doctor` now checks the chosen base and the private folder.
|
|
19
|
+
|
|
20
|
+
Unchanged on purpose: the peer-socket runtime directory still falls back to the operating system's folder (a long `NAMZU_TMPDIR` can exceed the socket-path limit), and the macOS computer-use screenshot file and the code-analysis host's working directory still use the operating system's folder. To keep every file where it was, leave `NAMZU_TMPDIR` unset.
|
|
21
|
+
|
|
3
22
|
## 35.0.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
-
import {
|
|
2
|
+
import { rmdir, unlink, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { createServer } from 'node:net';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
4
|
import { join, win32 } from 'node:path';
|
|
5
|
+
import { createTempDir } from '@namzu/sdk';
|
|
6
6
|
/** Internal retained authority for retrying an unconfirmed owned startup cleanup. */
|
|
7
7
|
export class LocalForwardCleanupError extends Error {
|
|
8
8
|
forward;
|
|
@@ -43,7 +43,7 @@ export async function startLocalSshForward(options) {
|
|
|
43
43
|
if (!/^ssh-ed25519 [A-Za-z0-9+/=]+$/.test(options.hostPublicKey))
|
|
44
44
|
throw new Error('The registered local machine did not provide its SSH host public key');
|
|
45
45
|
const ports = await Promise.all(options.ports.map(() => reservePort()));
|
|
46
|
-
const directory = await
|
|
46
|
+
const directory = await createTempDir('pal-forward-');
|
|
47
47
|
const knownHosts = join(directory, 'known_hosts');
|
|
48
48
|
await writeFile(knownHosts, `[127.0.0.1]:${options.port} ${options.hostPublicKey}\n`, {
|
|
49
49
|
mode: 0o600,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssh-forward.js","sourceRoot":"","sources":["../../src/local-virtual-computer/ssh-forward.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ssh-forward.js","sourceRoot":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,CAAC;QAChB,IAAI,CAAC;YACJ,MAAM,KAAK,EAAE,CAAA;QACd,CAAC;QAAC,MAAM,CAAC;YACR,MAAM,IAAI,wBAAwB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACnD,CAAC;QACD,MAAM,KAAK,CAAA;IACZ,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namzu/sandbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "36.0.0",
|
|
4
4
|
"description": "Pluggable sandbox provider for @namzu/sdk. Process-level isolation (bubblewrap on Linux, Seatbelt on macOS, via @anthropic-ai/sandbox-runtime) for developer dev loops; container-level isolation (HTTP worker + a loopback-bound egress proxy that allows by resolved address and brokers outbound credentials so they never enter the sandbox) for multi-tenant production. Backend selected at construction time; the SDK consumes both through the same SandboxProvider interface.",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"engines": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"provenance": true
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@namzu/sdk": "^
|
|
55
|
+
"@namzu/sdk": "^61.0.0"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"ws": "8.21.3"
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"typescript": "^5.5.0",
|
|
64
64
|
"vitest": "^4.1.11",
|
|
65
65
|
"yaml": "^2.9.0",
|
|
66
|
-
"@namzu/sdk": "^
|
|
66
|
+
"@namzu/sdk": "^61.0.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"build": "tsc --build",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process'
|
|
2
|
-
import {
|
|
2
|
+
import { rmdir, unlink, writeFile } from 'node:fs/promises'
|
|
3
3
|
import { createServer } from 'node:net'
|
|
4
|
-
import { tmpdir } from 'node:os'
|
|
5
4
|
import { join, win32 } from 'node:path'
|
|
5
|
+
import { createTempDir } from '@namzu/sdk'
|
|
6
6
|
import type { LocalPortForward } from './engine.js'
|
|
7
7
|
|
|
8
8
|
/** Internal retained authority for retrying an unconfirmed owned startup cleanup. */
|
|
@@ -60,7 +60,7 @@ export async function startLocalSshForward(
|
|
|
60
60
|
if (!/^ssh-ed25519 [A-Za-z0-9+/=]+$/.test(options.hostPublicKey))
|
|
61
61
|
throw new Error('The registered local machine did not provide its SSH host public key')
|
|
62
62
|
const ports = await Promise.all(options.ports.map(() => reservePort()))
|
|
63
|
-
const directory = await
|
|
63
|
+
const directory = await createTempDir('pal-forward-')
|
|
64
64
|
const knownHosts = join(directory, 'known_hosts')
|
|
65
65
|
await writeFile(knownHosts, `[127.0.0.1]:${options.port} ${options.hostPublicKey}\n`, {
|
|
66
66
|
mode: 0o600,
|