@nathapp/nax-agent 0.90.2 → 0.90.4
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 +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +1 -1
- package/dist/sandbox/launcher.d.ts +1 -0
- package/dist/sandbox/launcher.js +7 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to `@nathapp/nax-agent` are recorded here. The format follow
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/). While the version is `0.x`, a minor
|
|
5
5
|
release may change the public API.
|
|
6
6
|
|
|
7
|
+
## [0.90.4] - 2026-10-19
|
|
8
|
+
|
|
9
|
+
- No changes in this package. Released in lockstep with the other nax packages.
|
|
10
|
+
|
|
11
|
+
## [0.90.3] - 2026-10-19
|
|
12
|
+
|
|
13
|
+
- No changes in this package. Released in lockstep with the other nax packages.
|
|
14
|
+
|
|
7
15
|
## [0.90.2] - 2026-10-18
|
|
8
16
|
|
|
9
17
|
- No changes in this package. Released in lockstep with the other nax packages.
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type { AfterResponsePatch, AfterResponsePayload, AfterToolPatch, AfterToo
|
|
|
26
26
|
export { displayToolInput, TOOL_CALL_INPUT_BYTES, TOOL_RESULT_PREVIEW_BYTES, toolResultPreview, } from "#src/native/session/turn-event-emitter";
|
|
27
27
|
export { type ApprovalAuditRow, type ApprovalEntry, type ApprovalsFile, type ApprovalsFileRead, type ApprovalsFileState, type ApprovalsTaint, ASK_CANCELLED_REASON, ASK_DENIED_REASON, ASK_NO_CHANNEL_REASON, ASK_PROFILE_REASON, ASK_TIMEOUT_REASON, ASK_UNAVAILABLE_REASON, ASK_UNSHOWABLE_REASON, type AskControl, type AskDecidedBy, type AskDecision, type AskLink, type AskLinkOutcome, type AskRequest, type AskResolver, type AskVerdict, appendApproval, appendApprovalAudit, approvalId, approvalsPath, type BashLexResult, type BashRedirect, type BashSegment, type BashSegmentSeparator, type BashToken, type ClearTaintOutcome, chainAskLinks, clearApprovalsTaint, createApprovalsLink, findApproval, findSecretSpans, headlessAskResolver, isForgeCapable, lexBashCommand, type MaskResult, maskForPrompt, type PrepareApprovalsStoreOptions, parseRuleList, parseToolExpression, prepareApprovalsStore, type RemovalDecision, type RemovalResult, type ResolvedPermissions, readApprovals, readApprovalsFile, readApprovalsFileDetailed, redactForRow, redactRowStrings, removeApprovals, type SecretSpan, taintApprovals, writeApprovalsFile, } from "#src/permissions/index";
|
|
28
28
|
export { type AgentGlobOptions, type AgentRuntime, type AgentSpawnOptions, type AgentSpawnResult, type AgentSpawnStdin, getAgentRuntime, nodeRuntime, setAgentRuntime, } from "#src/runtime/index";
|
|
29
|
-
export { buildSandboxPolicy, type CommandLauncher, type CommandLauncherOptions, createCommandLauncher, createSrtBackend, DISABLED_SANDBOX_STATE, defaultTempRoots, denialHintLine, type GitLayout, type LaunchRequest, type LaunchResult, type LaunchSpec, LIKELY_SANDBOX_DENIAL, listCredentialFiles, listGitGuardFiles, listNaxEntries, type ProbeResult, probeSandbox, probeSandboxOnce, quoteArgvForShell, rawBashRefusalReason, resetSandboxBackend, resolveGitLayout, runTempRoots, runTmpRoot, type SandboxBackend, type SandboxBackendName, type SandboxNetworkPolicy, type SandboxPolicy, type SandboxPolicyInput, type SandboxRecord, type SandboxState, type SandboxWrapRequest, type SessionSandbox, sessionSandboxFrom, sandboxBackendFor, sandboxSentence, sessionTmpDir, sessionTmpDirUnder, strayCommonDirTripwire, unsandboxedSentence, warnSandboxUnavailableOnce, } from "#src/sandbox/index";
|
|
29
|
+
export { buildSandboxPolicy, type CommandLauncher, type CommandLauncherOptions, createCommandLauncher, createSrtBackend, DISABLED_SANDBOX_STATE, SANDBOXED_ENV, defaultTempRoots, denialHintLine, type GitLayout, type LaunchRequest, type LaunchResult, type LaunchSpec, LIKELY_SANDBOX_DENIAL, listCredentialFiles, listGitGuardFiles, listNaxEntries, type ProbeResult, probeSandbox, probeSandboxOnce, quoteArgvForShell, rawBashRefusalReason, resetSandboxBackend, resolveGitLayout, runTempRoots, runTmpRoot, type SandboxBackend, type SandboxBackendName, type SandboxNetworkPolicy, type SandboxPolicy, type SandboxPolicyInput, type SandboxRecord, type SandboxState, type SandboxWrapRequest, type SessionSandbox, sessionSandboxFrom, sandboxBackendFor, sandboxSentence, sessionTmpDir, sessionTmpDirUnder, strayCommonDirTripwire, unsandboxedSentence, warnSandboxUnavailableOnce, } from "#src/sandbox/index";
|
|
30
30
|
export type { AdapterFailure } from "#src/session/adapter-failure";
|
|
31
31
|
export { createAgentSession, resumeAgentSession } from "#src/session/agent-session";
|
|
32
32
|
export { AgentSessionError, type AgentSessionErrorCode } from "#src/session/agent-session-errors";
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export { AuthCancelledError, ambientShadows, anyAmbientCredential, authImportOut
|
|
|
21
21
|
export { displayToolInput, TOOL_CALL_INPUT_BYTES, TOOL_RESULT_PREVIEW_BYTES, toolResultPreview, } from "#src/native/session/turn-event-emitter";
|
|
22
22
|
export { ASK_CANCELLED_REASON, ASK_DENIED_REASON, ASK_NO_CHANNEL_REASON, ASK_PROFILE_REASON, ASK_TIMEOUT_REASON, ASK_UNAVAILABLE_REASON, ASK_UNSHOWABLE_REASON, appendApproval, appendApprovalAudit, approvalId, approvalsPath, chainAskLinks, clearApprovalsTaint, createApprovalsLink, findApproval, findSecretSpans, headlessAskResolver, isForgeCapable, lexBashCommand, maskForPrompt, parseRuleList, parseToolExpression, prepareApprovalsStore, readApprovals, readApprovalsFile, readApprovalsFileDetailed, redactForRow, redactRowStrings, removeApprovals, taintApprovals, writeApprovalsFile, } from "#src/permissions/index";
|
|
23
23
|
export { getAgentRuntime, nodeRuntime, setAgentRuntime, } from "#src/runtime/index";
|
|
24
|
-
export { buildSandboxPolicy, createCommandLauncher, createSrtBackend, DISABLED_SANDBOX_STATE, defaultTempRoots, denialHintLine, LIKELY_SANDBOX_DENIAL, listCredentialFiles, listGitGuardFiles, listNaxEntries, probeSandbox, probeSandboxOnce, quoteArgvForShell, rawBashRefusalReason, resetSandboxBackend, resolveGitLayout, runTempRoots, runTmpRoot, sessionSandboxFrom, sandboxBackendFor, sandboxSentence, sessionTmpDir, sessionTmpDirUnder, strayCommonDirTripwire, unsandboxedSentence, warnSandboxUnavailableOnce, } from "#src/sandbox/index";
|
|
24
|
+
export { buildSandboxPolicy, createCommandLauncher, createSrtBackend, DISABLED_SANDBOX_STATE, SANDBOXED_ENV, defaultTempRoots, denialHintLine, LIKELY_SANDBOX_DENIAL, listCredentialFiles, listGitGuardFiles, listNaxEntries, probeSandbox, probeSandboxOnce, quoteArgvForShell, rawBashRefusalReason, resetSandboxBackend, resolveGitLayout, runTempRoots, runTmpRoot, sessionSandboxFrom, sandboxBackendFor, sandboxSentence, sessionTmpDir, sessionTmpDirUnder, strayCommonDirTripwire, unsandboxedSentence, warnSandboxUnavailableOnce, } from "#src/sandbox/index";
|
|
25
25
|
export { createAgentSession, resumeAgentSession } from "#src/session/agent-session";
|
|
26
26
|
export { AgentSessionError } from "#src/session/agent-session-errors";
|
|
27
27
|
export { NO_OP_INTERACTION_HANDLER, } from "#src/session/interaction-handler";
|
package/dist/sandbox/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { quoteArgvForShell } from "./argv-quote.ts";
|
|
2
2
|
export { _gitGuardDeps, listGitGuardFiles, strayCommonDirTripwire } from "./git-guards.ts";
|
|
3
|
-
export { _launcherDeps, type CommandLauncherOptions, createCommandLauncher, DISABLED_SANDBOX_STATE, } from "./launcher.ts";
|
|
3
|
+
export { _launcherDeps, type CommandLauncherOptions, createCommandLauncher, DISABLED_SANDBOX_STATE, SANDBOXED_ENV, } from "./launcher.ts";
|
|
4
4
|
export { denialHintLine, LIKELY_SANDBOX_DENIAL, rawBashRefusalReason, sandboxSentence, unsandboxedSentence, } from "./messages.ts";
|
|
5
5
|
export { buildSandboxPolicy, type SandboxPolicyInput } from "./policy-builder.ts";
|
|
6
6
|
export { _policyInputDeps, defaultTempRoots, type GitLayout, listCredentialFiles, listNaxEntries, resolveGitLayout, runTempRoots, } from "./policy-inputs.ts";
|
package/dist/sandbox/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { quoteArgvForShell } from "./argv-quote.js";
|
|
2
2
|
export { _gitGuardDeps, listGitGuardFiles, strayCommonDirTripwire } from "./git-guards.js";
|
|
3
|
-
export { _launcherDeps, createCommandLauncher, DISABLED_SANDBOX_STATE, } from "./launcher.js";
|
|
3
|
+
export { _launcherDeps, createCommandLauncher, DISABLED_SANDBOX_STATE, SANDBOXED_ENV, } from "./launcher.js";
|
|
4
4
|
export { denialHintLine, LIKELY_SANDBOX_DENIAL, rawBashRefusalReason, sandboxSentence, unsandboxedSentence, } from "./messages.js";
|
|
5
5
|
export { buildSandboxPolicy } from "./policy-builder.js";
|
|
6
6
|
export { _policyInputDeps, defaultTempRoots, listCredentialFiles, listNaxEntries, resolveGitLayout, runTempRoots, } from "./policy-inputs.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { runArgv } from "#src/internal/argv-exec";
|
|
2
2
|
import type { CommandLauncher, SandboxBackend, SandboxPolicy, SandboxState } from "./types.ts";
|
|
3
|
+
export declare const SANDBOXED_ENV = "NAX_SANDBOXED";
|
|
3
4
|
export declare const DISABLED_SANDBOX_STATE: SandboxState;
|
|
4
5
|
export declare const _launcherDeps: {
|
|
5
6
|
runArgv: typeof runArgv;
|
package/dist/sandbox/launcher.js
CHANGED
|
@@ -16,6 +16,7 @@ import { getSafeLogger, NaxError } from "#src/infra/index";
|
|
|
16
16
|
import { runArgv } from "#src/internal/argv-exec";
|
|
17
17
|
import { quoteArgvForShell } from "./argv-quote.js";
|
|
18
18
|
import { denialHintLine, LIKELY_SANDBOX_DENIAL } from "./messages.js";
|
|
19
|
+
export const SANDBOXED_ENV = "NAX_SANDBOXED";
|
|
19
20
|
export const DISABLED_SANDBOX_STATE = { kind: "disabled" };
|
|
20
21
|
export const _launcherDeps = {
|
|
21
22
|
runArgv,
|
|
@@ -29,10 +30,12 @@ function logicalArgv(req) {
|
|
|
29
30
|
function shellSingleQuote(value) {
|
|
30
31
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
31
32
|
}
|
|
32
|
-
/**
|
|
33
|
+
/** Every wrapped command carries the marker; srt replaces the child env. */
|
|
33
34
|
function tmpEnvPrefix(tmpDir) {
|
|
35
|
+
if (tmpDir === undefined)
|
|
36
|
+
return `export ${SANDBOXED_ENV}=1; `;
|
|
34
37
|
const q = shellSingleQuote(tmpDir);
|
|
35
|
-
return `export TMPDIR=${q} TMP=${q} TEMP=${q}; `;
|
|
38
|
+
return `export ${SANDBOXED_ENV}=1 TMPDIR=${q} TMP=${q} TEMP=${q}; `;
|
|
36
39
|
}
|
|
37
40
|
/** The TMPDIR/TMP/TEMP overlay for an unwrapped run; the request's own env wins per key. */
|
|
38
41
|
function withTmpEnv(req, tmpDir) {
|
|
@@ -70,12 +73,13 @@ async function runWrapped(req, backend, policy, env) {
|
|
|
70
73
|
const rawCommand = req.spec.kind === "shell" ? req.spec.command : quoteArgvForShell(req.spec.argv);
|
|
71
74
|
// srt replaces the child environment wholesale, so a TMPDIR override cannot
|
|
72
75
|
// ride an `env` overlay — it has to be part of the shell command itself.
|
|
76
|
+
// The prefix always carries NAX_SANDBOXED=1, even without a TMPDIR override.
|
|
73
77
|
// Other overlay keys DO survive: the live suite proves it (`AGENT=1` reaches
|
|
74
78
|
// a wrapped child — see test/integration/sandbox/sandbox-live.test.ts
|
|
75
79
|
// "US-004 — the AGENT=1 overlay reaches a wrapped child"). `executed` below
|
|
76
80
|
// stays the unprefixed logical argv, so the ledger records what the agent
|
|
77
81
|
// wrote, not this shim.
|
|
78
|
-
const command =
|
|
82
|
+
const command = `${tmpEnvPrefix(env.tmpDir)}${rawCommand}`;
|
|
79
83
|
const shell = req.spec.kind === "shell" ? req.spec.shell : "/bin/sh";
|
|
80
84
|
const commandId = _launcherDeps.newCommandId();
|
|
81
85
|
let argv;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nathapp/nax-agent",
|
|
3
|
-
"version": "0.90.
|
|
3
|
+
"version": "0.90.4",
|
|
4
4
|
"description": "nax's native coding agent: session contract, native loop, tools, permissions, sandbox, command-safety.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "William Khoo",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@anthropic-ai/sandbox-runtime": "0.0.77",
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
50
|
-
"@nathapp/nax-ai": "0.90.
|
|
50
|
+
"@nathapp/nax-ai": "0.90.4",
|
|
51
51
|
"zod": "^4.3.6"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|