@tangle-network/agent-app 0.46.9 → 0.46.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.
@@ -340,9 +340,76 @@ export declare function sandboxToolPath(options: SandboxToolPathOptions & {
340
340
  }): string;
341
341
  /** Build file mounts for sandbox tools based on provided options and tool configurations */
342
342
  export declare function buildSandboxToolFileMounts(options: BuildSandboxToolFileMountsOptions): AgentProfileFileMount[];
343
- /** Build a shell script that sets up and exports the sandbox tool binary directory in user profiles */
343
+ /**
344
+ * Build the `SANDBOX_TOOL_BIN_DIRS` entry that puts these apps' tool bin dirs on
345
+ * a sandbox PATH. Declare it in the same box env as the mounts from
346
+ * {@link buildSandboxToolFileMounts}: the mounts place the executables, this
347
+ * places the directory that makes a bare tool name resolve.
348
+ *
349
+ * Every sandbox PATH builder appends these directories at the TAIL, after the
350
+ * Nix, npm, and image entries, so a tool never shadows a platform or system
351
+ * binary of the same name. That placement is identical for a non-interactive
352
+ * exec, a sidecar-spawned CLI, and an SSH shell, which is why this variable and
353
+ * not a shell rc file is the mechanism: an exec reads no rc file, and the SSH
354
+ * shell environment assigns PATH absolutely.
355
+ *
356
+ * Entries come from {@link sandboxToolBinDir}, so the value can never name a
357
+ * directory the mounts did not use — a caller that hand-writes the literal
358
+ * instead drifts silently the moment a base dir changes. Order is preserved,
359
+ * and two apps that resolve to one directory collapse to the FIRST position it
360
+ * appeared in.
361
+ *
362
+ * A `:` in a resolved bin dir throws here. The character separates entries both
363
+ * in this variable and in PATH itself, so such a directory is unrepresentable
364
+ * rather than merely awkward: joining it would split one absolute path into a
365
+ * leading path and a relative remainder, and the runtime rejects a relative
366
+ * segment by failing the whole box. Throwing names the offending directory
367
+ * instead.
368
+ *
369
+ * The consuming half lives in agent-dev-container: `resolveSandboxToolBinDirs`
370
+ * parses this value and every PATH builder appends it at the tail — sidecar
371
+ * exec and PTY through `packages/shared/src/cache-env.ts`, an SSH session
372
+ * through `packages/shared/src/ssh-bootstrap.ts`, and a spawned CLI through
373
+ * `packages/sdk-cli-runner/src/cli-process.ts`, each with its own tests. This
374
+ * package has no sandbox runtime, so tail placement is pinned there, not here.
375
+ */
376
+ export declare function buildSandboxToolBinDirsEnv(apps: readonly SandboxToolPathOptions[]): {
377
+ SANDBOX_TOOL_BIN_DIRS: string;
378
+ };
379
+ /**
380
+ * Build a shell script that creates the sandbox tool binary directory.
381
+ * {@link buildSandboxToolBinDirsEnv}, not this script, puts that directory on a
382
+ * sandbox PATH.
383
+ *
384
+ * The `mkdir -p` makes the directory exist before a tool mount lands in it.
385
+ */
386
+ export declare function buildSandboxToolBinDirScript(options: SandboxToolPathOptions): string;
387
+ /** Build a shell script that creates the sandbox tool binary directory.
388
+ *
389
+ * @deprecated Renamed to {@link buildSandboxToolBinDirScript}, and the script
390
+ * no longer appends the bin dir to PATH in `~/.profile`, `~/.bashrc` and
391
+ * `~/.zshrc`. Those edits never reached the contexts that run a tool: an exec
392
+ * and a spawned CLI read no rc file, and the SSH shell assigns PATH
393
+ * absolutely, which discards an appended entry. Put the directory on PATH with
394
+ * {@link buildSandboxToolBinDirsEnv} instead. This name forwards to the new
395
+ * one so an existing import keeps resolving; removal is a major.
396
+ */
344
397
  export declare function buildSandboxToolPathSetupScript(options: SandboxToolPathOptions): string;
345
- /** Resolve the sandbox environment PATH setup by executing the configuration script with given options */
398
+ /**
399
+ * Create the sandbox tool binary directory in a running box.
400
+ * {@link buildSandboxToolBinDirsEnv}, not this call, puts it on a sandbox PATH.
401
+ */
402
+ export declare function ensureSandboxToolBinDir(box: SandboxInstance, options: SandboxToolPathOptions): Promise<Outcome<void>>;
403
+ /** Create the sandbox tool binary directory in a running box.
404
+ *
405
+ * @deprecated Renamed to {@link ensureSandboxToolBinDir}, and the call no
406
+ * longer appends the bin dir to PATH in `~/.profile`, `~/.bashrc` and
407
+ * `~/.zshrc`. Those edits never reached the contexts that run a tool: an exec
408
+ * and a spawned CLI read no rc file, and the SSH shell assigns PATH
409
+ * absolutely, which discards an appended entry. Put the directory on PATH with
410
+ * {@link buildSandboxToolBinDirsEnv} instead. This name forwards to the new
411
+ * one so an existing import keeps resolving; removal is a major.
412
+ */
346
413
  export declare function runSandboxToolPathSetup(box: SandboxInstance, options: SandboxToolPathOptions): Promise<Outcome<void>>;
347
414
  /** Split profile files into inline deferred files and a lean profile without them */
348
415
  export declare function splitDeferredProfileFiles(profile: AgentProfile): {
@@ -28,6 +28,8 @@ import {
28
28
  attachReasoningEffort,
29
29
  buildAppToolMcpServers,
30
30
  buildProductEgressPolicy,
31
+ buildSandboxToolBinDirScript,
32
+ buildSandboxToolBinDirsEnv,
31
33
  buildSandboxToolFileMounts,
32
34
  buildSandboxToolPathSetupScript,
33
35
  classifySeveredStream,
@@ -41,6 +43,7 @@ import {
41
43
  deleteSecret,
42
44
  detectInteractiveQuestion,
43
45
  driveSandboxTurn,
46
+ ensureSandboxToolBinDir,
44
47
  ensureWorkspaceSandbox,
45
48
  flattenHistory,
46
49
  formatSandboxProvisioningSupportDetails,
@@ -88,7 +91,7 @@ import {
88
91
  workspaceSandboxRecoveryMessage,
89
92
  workspaceSandboxRecoveryRecommendedActions,
90
93
  writeProfileFilesToBox
91
- } from "../chunk-MA2RIIIH.js";
94
+ } from "../chunk-3HBH5GFN.js";
92
95
  import "../chunk-TH7L265V.js";
93
96
  import "../chunk-LWSJK546.js";
94
97
  import "../chunk-P5PIAQVS.js";
@@ -127,6 +130,8 @@ export {
127
130
  attachReasoningEffort,
128
131
  buildAppToolMcpServers,
129
132
  buildProductEgressPolicy,
133
+ buildSandboxToolBinDirScript,
134
+ buildSandboxToolBinDirsEnv,
130
135
  buildSandboxToolFileMounts,
131
136
  buildSandboxToolPathSetupScript,
132
137
  classifySeveredStream,
@@ -140,6 +145,7 @@ export {
140
145
  deleteSecret,
141
146
  detectInteractiveQuestion,
142
147
  driveSandboxTurn,
148
+ ensureSandboxToolBinDir,
143
149
  ensureWorkspaceSandbox,
144
150
  flattenHistory,
145
151
  formatSandboxProvisioningSupportDetails,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.46.9",
3
+ "version": "0.46.10",
4
4
  "packageManager": "pnpm@11.17.0",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [