sandboxedjs 0.2.22 → 0.2.23
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/dist/agent.cjs +20 -14
- package/dist/agent.d.cts +4 -4
- package/dist/agent.d.ts +4 -4
- package/dist/agent.js +20 -14
- package/dist/{container-D-e5SMXQ.d.ts → container-CPwPlvmB.d.cts} +9 -1
- package/dist/{container-BQx27_d-.d.cts → container-DZabLWLy.d.ts} +9 -1
- package/dist/{contracts-BHo4LdY2.d.cts → contracts-BFG82pSs.d.cts} +40 -2
- package/dist/{contracts-BHo4LdY2.d.ts → contracts-BFG82pSs.d.ts} +40 -2
- package/dist/index.cjs +1014 -780
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1014 -780
- package/dist/{memory-volume-meoRW8ST.d.ts → memory-volume-DhGUwDqX.d.ts} +1 -1
- package/dist/{memory-volume-e-uJFRnG.d.cts → memory-volume-Din7xmmT.d.cts} +1 -1
- package/dist/python-abi.d.cts +3 -3
- package/dist/python-abi.d.ts +3 -3
- package/dist/worker-entry.js +215 -55
- package/docs/nextjs-compatibility.md +17 -0
- package/docs/to_implement/agent.md +178 -44
- package/package.json +1 -1
package/dist/agent.cjs
CHANGED
|
@@ -356,6 +356,8 @@ host machine you can reach. Everything below is real and available to you.
|
|
|
356
356
|
container.
|
|
357
357
|
- A virtual network stack. Servers you start inside the container really listen
|
|
358
358
|
on their ports and can really be requested.
|
|
359
|
+
- A machine-readable inventory. Run \`sandboxedjs-capabilities --json\` before
|
|
360
|
+
planning an unfamiliar workflow instead of guessing what the runtime has.
|
|
359
361
|
|
|
360
362
|
## What you do not have
|
|
361
363
|
|
|
@@ -391,33 +393,37 @@ the user receives and what a preview will serve. Write real, complete files to
|
|
|
391
393
|
real paths \u2014 do not print a project to stdout and call it done.`;
|
|
392
394
|
var SANDBOX_AGENT_RULES = `# Rules
|
|
393
395
|
|
|
394
|
-
1.
|
|
396
|
+
1. For an unfamiliar task, inspect \`sandboxedjs-capabilities --json\`, the
|
|
397
|
+
workspace, and relevant command help. Work backward from the requested
|
|
398
|
+
outcome and compose a workflow from capabilities that are actually present.
|
|
399
|
+
2. Verify before you claim. If you say a server runs or a build passes, you
|
|
395
400
|
ran it in this container and read the output. Never report success you have
|
|
396
401
|
not observed.
|
|
397
|
-
|
|
402
|
+
3. One command, one purpose. Chain with \`&&\` when steps depend on each other
|
|
398
403
|
so a failure stops the chain instead of hiding under a later success.
|
|
399
|
-
|
|
404
|
+
4. Read a file before editing it. Edits are literal string replacements; they
|
|
400
405
|
fail when you are guessing at the current contents.
|
|
401
|
-
|
|
406
|
+
5. Use absolute paths in file tools. Use \`cd\` inside a single shell command
|
|
402
407
|
when a command needs a working directory.
|
|
403
|
-
|
|
408
|
+
6. Install dependencies with \`npm install <pkg>\`, in the directory that has
|
|
404
409
|
the \`package.json\`. Do not hand-write \`node_modules\` or invent versions
|
|
405
410
|
in \`package.json\` \u2014 let the installer resolve them.
|
|
406
|
-
|
|
411
|
+
7. Background every server and long task, redirect its output to a log file,
|
|
407
412
|
then poll the log. Never leave a command running in the foreground.
|
|
408
|
-
|
|
413
|
+
8. Keep command output small. Pipe noisy commands through \`tail\`, \`head\`
|
|
409
414
|
or \`grep\`. Output is truncated past the backend's limit and you will lose
|
|
410
415
|
the part you needed.
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
+
9. When a command fails, read stderr, update the workflow, and use another
|
|
417
|
+
available capability when appropriate. Do not retry the same command
|
|
418
|
+
unchanged, and do not work around a failure by faking its result.
|
|
419
|
+
10. Prefer the project's own tooling \u2014 \`npm run build\`, \`npm test\`,
|
|
420
|
+
\`npx vite\` \u2014 over reimplementing what it already does.
|
|
421
|
+
11. Do not attempt to escape the container, reach the host, or disable the
|
|
416
422
|
network policy. Outbound access is the host's decision, not yours.
|
|
417
|
-
|
|
423
|
+
12. Prefer the non-interactive form of a command when one exists \u2014 pass the
|
|
418
424
|
flags that pre-answer its questions. A generator that asks nothing is
|
|
419
425
|
faster and its result is the same every run.
|
|
420
|
-
|
|
426
|
+
13. An interactive prompt is not a failure. If a command stops on a question
|
|
421
427
|
or a menu, answer it: send the text, or the arrow keys and Enter that the
|
|
422
428
|
prompt names. Read what is on screen before answering, and do not send a
|
|
423
429
|
second answer until the screen has changed.`;
|
package/dist/agent.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Container } from './container-
|
|
2
|
-
import './contracts-
|
|
1
|
+
import { C as Container } from './container-CPwPlvmB.cjs';
|
|
2
|
+
import './contracts-BFG82pSs.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Structural copies of the LangChain Deep Agents backend contract.
|
|
@@ -167,14 +167,14 @@ declare class SandboxedJsBackend implements SandboxBackendProtocolV2 {
|
|
|
167
167
|
* `docker`, `sudo`, `systemctl`, `curl localhost:3000`, or a background process
|
|
168
168
|
* that outlives the turn. Saying plainly what exists is what stops that.
|
|
169
169
|
*/
|
|
170
|
-
declare const SANDBOX_ENVIRONMENT_PROMPT = "# Your environment\n\nYou are working inside a sandboxedjs container: a Linux-like environment that\nruns entirely inside a JavaScript process. There is no Docker, no VM, and no\nhost machine you can reach. Everything below is real and available to you.\n\n## What you have\n\n- A POSIX shell (`sh`/`bash` syntax): pipes, redirection, `&&`, `||`,\n subshells, globs, heredocs, variables, functions, `for`/`while`/`case`.\n- Around 140 coreutils: `ls cat cp mv rm mkdir find grep sed awk head tail\n sort uniq wc diff patch tar gzip curl chmod ln touch echo printf test` and\n the rest of the usual set.\n- Node.js, with `node`, `npm` and `npx`. `npm install` resolves against\n the real npm registry when outbound network is enabled.\n- Python 3 via `python3` and `pip`, when the host enabled the Python runtime.\n- A writable virtual filesystem rooted at `/`, persistent for the life of the\n container.\n- A virtual network stack. Servers you start inside the container really listen\n on their ports and can really be requested.\n\n## What you do not have\n\n- No Docker, no VM, no `systemctl`, no `service`, no `apt`/`apt-get`,\n no `yum`, no `brew`. Never try to install system packages.\n- No `sudo` and no reason for it: you already run as the container's user and\n the filesystem is yours.\n- No access to the host machine, its files, its network interfaces, or its\n environment variables. Nothing outside the container exists for you.\n- No GUI, no browser, no interactive editors. Do not run `vim`, `nano`,\n `less`, or `top`; they will hang or fail. Read files by reading them and\n edit them by editing them.\n- No long-running foreground commands. A command that never exits will hit the\n execution timeout and the turn is wasted.\n\n## Running servers\n\nStart servers in the background and never block on them:\n\n```sh\nnode server.js > /tmp/server.log 2>&1 &\n```\n\nThen poll the log for readiness rather than requesting the port immediately.\nDo not run a dev server in the foreground. Do not use `curl localhost:PORT`\nto prove a server works unless you started it in the background first \u2014 the\nhost, not you, is the one that will connect to it.\n\n## How your work is used\n\nThe container is the deliverable. Files you write to the filesystem are what\nthe user receives and what a preview will serve. Write real, complete files to\nreal paths \u2014 do not print a project to stdout and call it done.";
|
|
170
|
+
declare const SANDBOX_ENVIRONMENT_PROMPT = "# Your environment\n\nYou are working inside a sandboxedjs container: a Linux-like environment that\nruns entirely inside a JavaScript process. There is no Docker, no VM, and no\nhost machine you can reach. Everything below is real and available to you.\n\n## What you have\n\n- A POSIX shell (`sh`/`bash` syntax): pipes, redirection, `&&`, `||`,\n subshells, globs, heredocs, variables, functions, `for`/`while`/`case`.\n- Around 140 coreutils: `ls cat cp mv rm mkdir find grep sed awk head tail\n sort uniq wc diff patch tar gzip curl chmod ln touch echo printf test` and\n the rest of the usual set.\n- Node.js, with `node`, `npm` and `npx`. `npm install` resolves against\n the real npm registry when outbound network is enabled.\n- Python 3 via `python3` and `pip`, when the host enabled the Python runtime.\n- A writable virtual filesystem rooted at `/`, persistent for the life of the\n container.\n- A virtual network stack. Servers you start inside the container really listen\n on their ports and can really be requested.\n- A machine-readable inventory. Run `sandboxedjs-capabilities --json` before\n planning an unfamiliar workflow instead of guessing what the runtime has.\n\n## What you do not have\n\n- No Docker, no VM, no `systemctl`, no `service`, no `apt`/`apt-get`,\n no `yum`, no `brew`. Never try to install system packages.\n- No `sudo` and no reason for it: you already run as the container's user and\n the filesystem is yours.\n- No access to the host machine, its files, its network interfaces, or its\n environment variables. Nothing outside the container exists for you.\n- No GUI, no browser, no interactive editors. Do not run `vim`, `nano`,\n `less`, or `top`; they will hang or fail. Read files by reading them and\n edit them by editing them.\n- No long-running foreground commands. A command that never exits will hit the\n execution timeout and the turn is wasted.\n\n## Running servers\n\nStart servers in the background and never block on them:\n\n```sh\nnode server.js > /tmp/server.log 2>&1 &\n```\n\nThen poll the log for readiness rather than requesting the port immediately.\nDo not run a dev server in the foreground. Do not use `curl localhost:PORT`\nto prove a server works unless you started it in the background first \u2014 the\nhost, not you, is the one that will connect to it.\n\n## How your work is used\n\nThe container is the deliverable. Files you write to the filesystem are what\nthe user receives and what a preview will serve. Write real, complete files to\nreal paths \u2014 do not print a project to stdout and call it done.";
|
|
171
171
|
/**
|
|
172
172
|
* Operating rules, in the register a coding harness uses.
|
|
173
173
|
*
|
|
174
174
|
* Deliberately about this environment rather than about coding in general: the
|
|
175
175
|
* host's own system prompt owns the latter, and repeating it only dilutes both.
|
|
176
176
|
*/
|
|
177
|
-
declare const SANDBOX_AGENT_RULES = "# Rules\n\n1. Verify before you claim. If you say a server runs or a build passes, you\n ran it in this container and read the output. Never report success you have\n not observed.\
|
|
177
|
+
declare const SANDBOX_AGENT_RULES = "# Rules\n\n1. For an unfamiliar task, inspect `sandboxedjs-capabilities --json`, the\n workspace, and relevant command help. Work backward from the requested\n outcome and compose a workflow from capabilities that are actually present.\n2. Verify before you claim. If you say a server runs or a build passes, you\n ran it in this container and read the output. Never report success you have\n not observed.\n3. One command, one purpose. Chain with `&&` when steps depend on each other\n so a failure stops the chain instead of hiding under a later success.\n4. Read a file before editing it. Edits are literal string replacements; they\n fail when you are guessing at the current contents.\n5. Use absolute paths in file tools. Use `cd` inside a single shell command\n when a command needs a working directory.\n6. Install dependencies with `npm install <pkg>`, in the directory that has\n the `package.json`. Do not hand-write `node_modules` or invent versions\n in `package.json` \u2014 let the installer resolve them.\n7. Background every server and long task, redirect its output to a log file,\n then poll the log. Never leave a command running in the foreground.\n8. Keep command output small. Pipe noisy commands through `tail`, `head`\n or `grep`. Output is truncated past the backend's limit and you will lose\n the part you needed.\n9. When a command fails, read stderr, update the workflow, and use another\n available capability when appropriate. Do not retry the same command\n unchanged, and do not work around a failure by faking its result.\n10. Prefer the project's own tooling \u2014 `npm run build`, `npm test`,\n `npx vite` \u2014 over reimplementing what it already does.\n11. Do not attempt to escape the container, reach the host, or disable the\n network policy. Outbound access is the host's decision, not yours.\n12. Prefer the non-interactive form of a command when one exists \u2014 pass the\n flags that pre-answer its questions. A generator that asks nothing is\n faster and its result is the same every run.\n13. An interactive prompt is not a failure. If a command stops on a question\n or a menu, answer it: send the text, or the arrow keys and Enter that the\n prompt names. Read what is on screen before answering, and do not send a\n second answer until the screen has changed.";
|
|
178
178
|
/** A Deep Agents skill: markdown with the frontmatter its loader parses. */
|
|
179
179
|
interface SandboxSkill {
|
|
180
180
|
name: string;
|
package/dist/agent.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Container } from './container-
|
|
2
|
-
import './contracts-
|
|
1
|
+
import { C as Container } from './container-DZabLWLy.js';
|
|
2
|
+
import './contracts-BFG82pSs.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Structural copies of the LangChain Deep Agents backend contract.
|
|
@@ -167,14 +167,14 @@ declare class SandboxedJsBackend implements SandboxBackendProtocolV2 {
|
|
|
167
167
|
* `docker`, `sudo`, `systemctl`, `curl localhost:3000`, or a background process
|
|
168
168
|
* that outlives the turn. Saying plainly what exists is what stops that.
|
|
169
169
|
*/
|
|
170
|
-
declare const SANDBOX_ENVIRONMENT_PROMPT = "# Your environment\n\nYou are working inside a sandboxedjs container: a Linux-like environment that\nruns entirely inside a JavaScript process. There is no Docker, no VM, and no\nhost machine you can reach. Everything below is real and available to you.\n\n## What you have\n\n- A POSIX shell (`sh`/`bash` syntax): pipes, redirection, `&&`, `||`,\n subshells, globs, heredocs, variables, functions, `for`/`while`/`case`.\n- Around 140 coreutils: `ls cat cp mv rm mkdir find grep sed awk head tail\n sort uniq wc diff patch tar gzip curl chmod ln touch echo printf test` and\n the rest of the usual set.\n- Node.js, with `node`, `npm` and `npx`. `npm install` resolves against\n the real npm registry when outbound network is enabled.\n- Python 3 via `python3` and `pip`, when the host enabled the Python runtime.\n- A writable virtual filesystem rooted at `/`, persistent for the life of the\n container.\n- A virtual network stack. Servers you start inside the container really listen\n on their ports and can really be requested.\n\n## What you do not have\n\n- No Docker, no VM, no `systemctl`, no `service`, no `apt`/`apt-get`,\n no `yum`, no `brew`. Never try to install system packages.\n- No `sudo` and no reason for it: you already run as the container's user and\n the filesystem is yours.\n- No access to the host machine, its files, its network interfaces, or its\n environment variables. Nothing outside the container exists for you.\n- No GUI, no browser, no interactive editors. Do not run `vim`, `nano`,\n `less`, or `top`; they will hang or fail. Read files by reading them and\n edit them by editing them.\n- No long-running foreground commands. A command that never exits will hit the\n execution timeout and the turn is wasted.\n\n## Running servers\n\nStart servers in the background and never block on them:\n\n```sh\nnode server.js > /tmp/server.log 2>&1 &\n```\n\nThen poll the log for readiness rather than requesting the port immediately.\nDo not run a dev server in the foreground. Do not use `curl localhost:PORT`\nto prove a server works unless you started it in the background first \u2014 the\nhost, not you, is the one that will connect to it.\n\n## How your work is used\n\nThe container is the deliverable. Files you write to the filesystem are what\nthe user receives and what a preview will serve. Write real, complete files to\nreal paths \u2014 do not print a project to stdout and call it done.";
|
|
170
|
+
declare const SANDBOX_ENVIRONMENT_PROMPT = "# Your environment\n\nYou are working inside a sandboxedjs container: a Linux-like environment that\nruns entirely inside a JavaScript process. There is no Docker, no VM, and no\nhost machine you can reach. Everything below is real and available to you.\n\n## What you have\n\n- A POSIX shell (`sh`/`bash` syntax): pipes, redirection, `&&`, `||`,\n subshells, globs, heredocs, variables, functions, `for`/`while`/`case`.\n- Around 140 coreutils: `ls cat cp mv rm mkdir find grep sed awk head tail\n sort uniq wc diff patch tar gzip curl chmod ln touch echo printf test` and\n the rest of the usual set.\n- Node.js, with `node`, `npm` and `npx`. `npm install` resolves against\n the real npm registry when outbound network is enabled.\n- Python 3 via `python3` and `pip`, when the host enabled the Python runtime.\n- A writable virtual filesystem rooted at `/`, persistent for the life of the\n container.\n- A virtual network stack. Servers you start inside the container really listen\n on their ports and can really be requested.\n- A machine-readable inventory. Run `sandboxedjs-capabilities --json` before\n planning an unfamiliar workflow instead of guessing what the runtime has.\n\n## What you do not have\n\n- No Docker, no VM, no `systemctl`, no `service`, no `apt`/`apt-get`,\n no `yum`, no `brew`. Never try to install system packages.\n- No `sudo` and no reason for it: you already run as the container's user and\n the filesystem is yours.\n- No access to the host machine, its files, its network interfaces, or its\n environment variables. Nothing outside the container exists for you.\n- No GUI, no browser, no interactive editors. Do not run `vim`, `nano`,\n `less`, or `top`; they will hang or fail. Read files by reading them and\n edit them by editing them.\n- No long-running foreground commands. A command that never exits will hit the\n execution timeout and the turn is wasted.\n\n## Running servers\n\nStart servers in the background and never block on them:\n\n```sh\nnode server.js > /tmp/server.log 2>&1 &\n```\n\nThen poll the log for readiness rather than requesting the port immediately.\nDo not run a dev server in the foreground. Do not use `curl localhost:PORT`\nto prove a server works unless you started it in the background first \u2014 the\nhost, not you, is the one that will connect to it.\n\n## How your work is used\n\nThe container is the deliverable. Files you write to the filesystem are what\nthe user receives and what a preview will serve. Write real, complete files to\nreal paths \u2014 do not print a project to stdout and call it done.";
|
|
171
171
|
/**
|
|
172
172
|
* Operating rules, in the register a coding harness uses.
|
|
173
173
|
*
|
|
174
174
|
* Deliberately about this environment rather than about coding in general: the
|
|
175
175
|
* host's own system prompt owns the latter, and repeating it only dilutes both.
|
|
176
176
|
*/
|
|
177
|
-
declare const SANDBOX_AGENT_RULES = "# Rules\n\n1. Verify before you claim. If you say a server runs or a build passes, you\n ran it in this container and read the output. Never report success you have\n not observed.\
|
|
177
|
+
declare const SANDBOX_AGENT_RULES = "# Rules\n\n1. For an unfamiliar task, inspect `sandboxedjs-capabilities --json`, the\n workspace, and relevant command help. Work backward from the requested\n outcome and compose a workflow from capabilities that are actually present.\n2. Verify before you claim. If you say a server runs or a build passes, you\n ran it in this container and read the output. Never report success you have\n not observed.\n3. One command, one purpose. Chain with `&&` when steps depend on each other\n so a failure stops the chain instead of hiding under a later success.\n4. Read a file before editing it. Edits are literal string replacements; they\n fail when you are guessing at the current contents.\n5. Use absolute paths in file tools. Use `cd` inside a single shell command\n when a command needs a working directory.\n6. Install dependencies with `npm install <pkg>`, in the directory that has\n the `package.json`. Do not hand-write `node_modules` or invent versions\n in `package.json` \u2014 let the installer resolve them.\n7. Background every server and long task, redirect its output to a log file,\n then poll the log. Never leave a command running in the foreground.\n8. Keep command output small. Pipe noisy commands through `tail`, `head`\n or `grep`. Output is truncated past the backend's limit and you will lose\n the part you needed.\n9. When a command fails, read stderr, update the workflow, and use another\n available capability when appropriate. Do not retry the same command\n unchanged, and do not work around a failure by faking its result.\n10. Prefer the project's own tooling \u2014 `npm run build`, `npm test`,\n `npx vite` \u2014 over reimplementing what it already does.\n11. Do not attempt to escape the container, reach the host, or disable the\n network policy. Outbound access is the host's decision, not yours.\n12. Prefer the non-interactive form of a command when one exists \u2014 pass the\n flags that pre-answer its questions. A generator that asks nothing is\n faster and its result is the same every run.\n13. An interactive prompt is not a failure. If a command stops on a question\n or a menu, answer it: send the text, or the arrow keys and Enter that the\n prompt names. Read what is on screen before answering, and do not send a\n second answer until the screen has changed.";
|
|
178
178
|
/** A Deep Agents skill: markdown with the frontmatter its loader parses. */
|
|
179
179
|
interface SandboxSkill {
|
|
180
180
|
name: string;
|
package/dist/agent.js
CHANGED
|
@@ -354,6 +354,8 @@ host machine you can reach. Everything below is real and available to you.
|
|
|
354
354
|
container.
|
|
355
355
|
- A virtual network stack. Servers you start inside the container really listen
|
|
356
356
|
on their ports and can really be requested.
|
|
357
|
+
- A machine-readable inventory. Run \`sandboxedjs-capabilities --json\` before
|
|
358
|
+
planning an unfamiliar workflow instead of guessing what the runtime has.
|
|
357
359
|
|
|
358
360
|
## What you do not have
|
|
359
361
|
|
|
@@ -389,33 +391,37 @@ the user receives and what a preview will serve. Write real, complete files to
|
|
|
389
391
|
real paths \u2014 do not print a project to stdout and call it done.`;
|
|
390
392
|
var SANDBOX_AGENT_RULES = `# Rules
|
|
391
393
|
|
|
392
|
-
1.
|
|
394
|
+
1. For an unfamiliar task, inspect \`sandboxedjs-capabilities --json\`, the
|
|
395
|
+
workspace, and relevant command help. Work backward from the requested
|
|
396
|
+
outcome and compose a workflow from capabilities that are actually present.
|
|
397
|
+
2. Verify before you claim. If you say a server runs or a build passes, you
|
|
393
398
|
ran it in this container and read the output. Never report success you have
|
|
394
399
|
not observed.
|
|
395
|
-
|
|
400
|
+
3. One command, one purpose. Chain with \`&&\` when steps depend on each other
|
|
396
401
|
so a failure stops the chain instead of hiding under a later success.
|
|
397
|
-
|
|
402
|
+
4. Read a file before editing it. Edits are literal string replacements; they
|
|
398
403
|
fail when you are guessing at the current contents.
|
|
399
|
-
|
|
404
|
+
5. Use absolute paths in file tools. Use \`cd\` inside a single shell command
|
|
400
405
|
when a command needs a working directory.
|
|
401
|
-
|
|
406
|
+
6. Install dependencies with \`npm install <pkg>\`, in the directory that has
|
|
402
407
|
the \`package.json\`. Do not hand-write \`node_modules\` or invent versions
|
|
403
408
|
in \`package.json\` \u2014 let the installer resolve them.
|
|
404
|
-
|
|
409
|
+
7. Background every server and long task, redirect its output to a log file,
|
|
405
410
|
then poll the log. Never leave a command running in the foreground.
|
|
406
|
-
|
|
411
|
+
8. Keep command output small. Pipe noisy commands through \`tail\`, \`head\`
|
|
407
412
|
or \`grep\`. Output is truncated past the backend's limit and you will lose
|
|
408
413
|
the part you needed.
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
+
9. When a command fails, read stderr, update the workflow, and use another
|
|
415
|
+
available capability when appropriate. Do not retry the same command
|
|
416
|
+
unchanged, and do not work around a failure by faking its result.
|
|
417
|
+
10. Prefer the project's own tooling \u2014 \`npm run build\`, \`npm test\`,
|
|
418
|
+
\`npx vite\` \u2014 over reimplementing what it already does.
|
|
419
|
+
11. Do not attempt to escape the container, reach the host, or disable the
|
|
414
420
|
network policy. Outbound access is the host's decision, not yours.
|
|
415
|
-
|
|
421
|
+
12. Prefer the non-interactive form of a command when one exists \u2014 pass the
|
|
416
422
|
flags that pre-answer its questions. A generator that asks nothing is
|
|
417
423
|
faster and its result is the same every run.
|
|
418
|
-
|
|
424
|
+
13. An interactive prompt is not a failure. If a command stops on a question
|
|
419
425
|
or a menu, answer it: send the text, or the arrow keys and Enter that the
|
|
420
426
|
prompt names. Read what is on screen before answering, and do not send a
|
|
421
427
|
second answer until the screen has changed.`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as Vfs, C as Cred, f as RuntimePod, O as OutboundPolicy, D as DirEntry,
|
|
1
|
+
import { V as Vfs, C as Cred, q as SealedSecrets, f as RuntimePod, O as OutboundPolicy, D as DirEntry, r as Stats } from './contracts-BFG82pSs.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Byte streams for stdin/stdout/stderr, pipelines and redirections.
|
|
@@ -481,6 +481,14 @@ interface NetworkOptions {
|
|
|
481
481
|
* proxy widens what a page can reach, not what the container may.
|
|
482
482
|
*/
|
|
483
483
|
proxy?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Sealed secrets: credentials a guest program may use but never read.
|
|
486
|
+
*
|
|
487
|
+
* A program writes `{{secret:NAME}}` in a request header; the value is put
|
|
488
|
+
* in as the request leaves, only for the hosts listed, and removed from the
|
|
489
|
+
* response. It is never written to the filesystem or the environment.
|
|
490
|
+
*/
|
|
491
|
+
secrets?: SealedSecrets;
|
|
484
492
|
/** Address handed to eth0. */
|
|
485
493
|
ipv4?: string;
|
|
486
494
|
gateway?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as Vfs, C as Cred, f as RuntimePod, O as OutboundPolicy, D as DirEntry,
|
|
1
|
+
import { V as Vfs, C as Cred, q as SealedSecrets, f as RuntimePod, O as OutboundPolicy, D as DirEntry, r as Stats } from './contracts-BFG82pSs.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Byte streams for stdin/stdout/stderr, pipelines and redirections.
|
|
@@ -481,6 +481,14 @@ interface NetworkOptions {
|
|
|
481
481
|
* proxy widens what a page can reach, not what the container may.
|
|
482
482
|
*/
|
|
483
483
|
proxy?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Sealed secrets: credentials a guest program may use but never read.
|
|
486
|
+
*
|
|
487
|
+
* A program writes `{{secret:NAME}}` in a request header; the value is put
|
|
488
|
+
* in as the request leaves, only for the hosts listed, and removed from the
|
|
489
|
+
* response. It is never written to the filesystem or the environment.
|
|
490
|
+
*/
|
|
491
|
+
secrets?: SealedSecrets;
|
|
484
492
|
/** Address handed to eth0. */
|
|
485
493
|
ipv4?: string;
|
|
486
494
|
gateway?: string;
|
|
@@ -16,7 +16,7 @@ interface ChildHandle {
|
|
|
16
16
|
exitCode: number | undefined;
|
|
17
17
|
on(event: "stdout" | "stderr" | "exit" | "rawmode" | "fd", listener: (...args: any[]) => void): unknown;
|
|
18
18
|
exec(): void;
|
|
19
|
-
sendStdin(data: string): void;
|
|
19
|
+
sendStdin(data: string | Uint8Array): void;
|
|
20
20
|
/**
|
|
21
21
|
* Close the child's input.
|
|
22
22
|
*
|
|
@@ -95,6 +95,36 @@ declare function createChildProcessModule(spawnChild: SpawnChild, defaultCwd: ()
|
|
|
95
95
|
ipc?: IpcTransport;
|
|
96
96
|
}): Record<string, unknown>;
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Sealed secrets: credentials a guest can use but cannot read.
|
|
100
|
+
*
|
|
101
|
+
* A program inside the container names a secret — `{{secret:GITHUB_TOKEN}}` in
|
|
102
|
+
* a header — and the egress layer puts the value in as the request leaves, and
|
|
103
|
+
* only for the hosts that secret is bound to. The value is never in the
|
|
104
|
+
* filesystem, the environment or a process's arguments, so there is nothing
|
|
105
|
+
* for a prompt-injected `cat`, `env` or `curl evil.example` to send anywhere.
|
|
106
|
+
*
|
|
107
|
+
* Two things make that hold rather than merely sound good:
|
|
108
|
+
*
|
|
109
|
+
* * A placeholder for a host the secret is not bound to is a refusal, not a
|
|
110
|
+
* pass-through. Sending the literal `{{secret:…}}` onward would tell the
|
|
111
|
+
* other side which secrets exist; sending the value would be the leak.
|
|
112
|
+
* * What comes back is scanned. A server that echoes the request — plenty of
|
|
113
|
+
* debugging endpoints do — would otherwise hand the value to the guest in
|
|
114
|
+
* the response body.
|
|
115
|
+
*
|
|
116
|
+
* What this does not claim: the value lives in the memory of the runtime that
|
|
117
|
+
* performs the request. It is out of reach of every guest API, not of a
|
|
118
|
+
* debugger attached to the host.
|
|
119
|
+
*/
|
|
120
|
+
interface SealedSecret {
|
|
121
|
+
/** The credential itself. */
|
|
122
|
+
value: string;
|
|
123
|
+
/** Hosts it may be sent to; subdomains are included, as in `allowedHosts`. */
|
|
124
|
+
hosts: string[];
|
|
125
|
+
}
|
|
126
|
+
type SealedSecrets = Record<string, SealedSecret>;
|
|
127
|
+
|
|
98
128
|
/**
|
|
99
129
|
* The outbound network policy, as plain functions every client consults.
|
|
100
130
|
*
|
|
@@ -109,6 +139,7 @@ declare function createChildProcessModule(spawnChild: SpawnChild, defaultCwd: ()
|
|
|
109
139
|
* container, so those requests are routed to its own servers and never handed
|
|
110
140
|
* to the host's network stack, whatever the policy allows.
|
|
111
141
|
*/
|
|
142
|
+
|
|
112
143
|
interface OutboundPolicy {
|
|
113
144
|
/** Whether requests may leave the container at all. */
|
|
114
145
|
allowOutbound: boolean;
|
|
@@ -123,6 +154,13 @@ interface OutboundPolicy {
|
|
|
123
154
|
* setting whose meaning depended on which language the guest was written in.
|
|
124
155
|
*/
|
|
125
156
|
proxy?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Credentials the egress layer adds to requests on the guest's behalf.
|
|
159
|
+
*
|
|
160
|
+
* A guest writes `{{secret:NAME}}` in a header; the value is substituted
|
|
161
|
+
* here, for the hosts it is bound to, and removed from whatever comes back.
|
|
162
|
+
*/
|
|
163
|
+
secrets?: SealedSecrets;
|
|
126
164
|
}
|
|
127
165
|
|
|
128
166
|
/**
|
|
@@ -660,4 +698,4 @@ interface RuntimePod {
|
|
|
660
698
|
teardown(): void;
|
|
661
699
|
}
|
|
662
700
|
|
|
663
|
-
export { type Cred as C, type DirEntry as D, type IpcTransport as I, type OutboundPolicy as O, type RuntimeVolume as R, type SpawnChild as S, Vfs as V, type WriteOptions as W, VirtualTcpNetwork as a, type RuntimeHttpResponse as b, type SyncSpawn as c, type VolumeStat as d, type VolumeStats as e, type RuntimePod as f, type RuntimePackageInstaller as g, type ChildSpawnConfig as h, type ChildHandle as i, type RuntimeProcess as j, type RuntimeSocketPeer as k, type RuntimeConnection as l, ROOT_CRED as m, type RuntimeProcessManager as n, type RuntimeProcessResult as o,
|
|
701
|
+
export { type Cred as C, type DirEntry as D, type IpcTransport as I, type OutboundPolicy as O, type RuntimeVolume as R, type SpawnChild as S, Vfs as V, type WriteOptions as W, VirtualTcpNetwork as a, type RuntimeHttpResponse as b, type SyncSpawn as c, type VolumeStat as d, type VolumeStats as e, type RuntimePod as f, type RuntimePackageInstaller as g, type ChildSpawnConfig as h, type ChildHandle as i, type RuntimeProcess as j, type RuntimeSocketPeer as k, type RuntimeConnection as l, ROOT_CRED as m, type RuntimeProcessManager as n, type RuntimeProcessResult as o, type SealedSecret as p, type SealedSecrets as q, Stats as r, type VirtualNode as s, type VirtualProvider as t, applyChmod as u, createChildProcessModule as v, formatMode as w, makeCred as x, octalMode as y, parseUmask as z };
|
|
@@ -16,7 +16,7 @@ interface ChildHandle {
|
|
|
16
16
|
exitCode: number | undefined;
|
|
17
17
|
on(event: "stdout" | "stderr" | "exit" | "rawmode" | "fd", listener: (...args: any[]) => void): unknown;
|
|
18
18
|
exec(): void;
|
|
19
|
-
sendStdin(data: string): void;
|
|
19
|
+
sendStdin(data: string | Uint8Array): void;
|
|
20
20
|
/**
|
|
21
21
|
* Close the child's input.
|
|
22
22
|
*
|
|
@@ -95,6 +95,36 @@ declare function createChildProcessModule(spawnChild: SpawnChild, defaultCwd: ()
|
|
|
95
95
|
ipc?: IpcTransport;
|
|
96
96
|
}): Record<string, unknown>;
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Sealed secrets: credentials a guest can use but cannot read.
|
|
100
|
+
*
|
|
101
|
+
* A program inside the container names a secret — `{{secret:GITHUB_TOKEN}}` in
|
|
102
|
+
* a header — and the egress layer puts the value in as the request leaves, and
|
|
103
|
+
* only for the hosts that secret is bound to. The value is never in the
|
|
104
|
+
* filesystem, the environment or a process's arguments, so there is nothing
|
|
105
|
+
* for a prompt-injected `cat`, `env` or `curl evil.example` to send anywhere.
|
|
106
|
+
*
|
|
107
|
+
* Two things make that hold rather than merely sound good:
|
|
108
|
+
*
|
|
109
|
+
* * A placeholder for a host the secret is not bound to is a refusal, not a
|
|
110
|
+
* pass-through. Sending the literal `{{secret:…}}` onward would tell the
|
|
111
|
+
* other side which secrets exist; sending the value would be the leak.
|
|
112
|
+
* * What comes back is scanned. A server that echoes the request — plenty of
|
|
113
|
+
* debugging endpoints do — would otherwise hand the value to the guest in
|
|
114
|
+
* the response body.
|
|
115
|
+
*
|
|
116
|
+
* What this does not claim: the value lives in the memory of the runtime that
|
|
117
|
+
* performs the request. It is out of reach of every guest API, not of a
|
|
118
|
+
* debugger attached to the host.
|
|
119
|
+
*/
|
|
120
|
+
interface SealedSecret {
|
|
121
|
+
/** The credential itself. */
|
|
122
|
+
value: string;
|
|
123
|
+
/** Hosts it may be sent to; subdomains are included, as in `allowedHosts`. */
|
|
124
|
+
hosts: string[];
|
|
125
|
+
}
|
|
126
|
+
type SealedSecrets = Record<string, SealedSecret>;
|
|
127
|
+
|
|
98
128
|
/**
|
|
99
129
|
* The outbound network policy, as plain functions every client consults.
|
|
100
130
|
*
|
|
@@ -109,6 +139,7 @@ declare function createChildProcessModule(spawnChild: SpawnChild, defaultCwd: ()
|
|
|
109
139
|
* container, so those requests are routed to its own servers and never handed
|
|
110
140
|
* to the host's network stack, whatever the policy allows.
|
|
111
141
|
*/
|
|
142
|
+
|
|
112
143
|
interface OutboundPolicy {
|
|
113
144
|
/** Whether requests may leave the container at all. */
|
|
114
145
|
allowOutbound: boolean;
|
|
@@ -123,6 +154,13 @@ interface OutboundPolicy {
|
|
|
123
154
|
* setting whose meaning depended on which language the guest was written in.
|
|
124
155
|
*/
|
|
125
156
|
proxy?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Credentials the egress layer adds to requests on the guest's behalf.
|
|
159
|
+
*
|
|
160
|
+
* A guest writes `{{secret:NAME}}` in a header; the value is substituted
|
|
161
|
+
* here, for the hosts it is bound to, and removed from whatever comes back.
|
|
162
|
+
*/
|
|
163
|
+
secrets?: SealedSecrets;
|
|
126
164
|
}
|
|
127
165
|
|
|
128
166
|
/**
|
|
@@ -660,4 +698,4 @@ interface RuntimePod {
|
|
|
660
698
|
teardown(): void;
|
|
661
699
|
}
|
|
662
700
|
|
|
663
|
-
export { type Cred as C, type DirEntry as D, type IpcTransport as I, type OutboundPolicy as O, type RuntimeVolume as R, type SpawnChild as S, Vfs as V, type WriteOptions as W, VirtualTcpNetwork as a, type RuntimeHttpResponse as b, type SyncSpawn as c, type VolumeStat as d, type VolumeStats as e, type RuntimePod as f, type RuntimePackageInstaller as g, type ChildSpawnConfig as h, type ChildHandle as i, type RuntimeProcess as j, type RuntimeSocketPeer as k, type RuntimeConnection as l, ROOT_CRED as m, type RuntimeProcessManager as n, type RuntimeProcessResult as o,
|
|
701
|
+
export { type Cred as C, type DirEntry as D, type IpcTransport as I, type OutboundPolicy as O, type RuntimeVolume as R, type SpawnChild as S, Vfs as V, type WriteOptions as W, VirtualTcpNetwork as a, type RuntimeHttpResponse as b, type SyncSpawn as c, type VolumeStat as d, type VolumeStats as e, type RuntimePod as f, type RuntimePackageInstaller as g, type ChildSpawnConfig as h, type ChildHandle as i, type RuntimeProcess as j, type RuntimeSocketPeer as k, type RuntimeConnection as l, ROOT_CRED as m, type RuntimeProcessManager as n, type RuntimeProcessResult as o, type SealedSecret as p, type SealedSecrets as q, Stats as r, type VirtualNode as s, type VirtualProvider as t, applyChmod as u, createChildProcessModule as v, formatMode as w, makeCred as x, octalMode as y, parseUmask as z };
|