OverlayFs, output hooks, curl, bun ci#1
Merged
peteretelej merged 12 commits intomainfrom Mar 19, 2026
Merged
Conversation
Allow injecting a custom FileSystem via ShellOptions.fs, expose SHELL_MAX_OUTPUT env var from execution limits, and add THREAT_MODEL.md documenting the security model.
Three new commands (yes with output cap, xxd hex dump, timeout with Promise.race) and fixed wc -m to count Unicode characters via string iterator.
onBeforeCommand and onCommandResult hooks fire for every command including pipeline stages, enabling logging, blocking, and output filtering at the command dispatch level.
curl delegates HTTP to a consumer-provided handler via ShellOptions.network, with hostname allowlist, redirect following, and file I/O flags. Core stays network-free.
Read-through OverlayFs reads from a host directory, writes to memory, and exposes getChanges() for tracking. Shipped as @mylocalgpt/shell/overlay.
Parallel test-bun job runs unit tests via bun runtime to verify cross-runtime compatibility.
Documentation pass across README, AGENTS.md, and design docs for all v0.1.0 features. Added THREAT_MODEL.md to package files. Verified all entry points.
- curl: use URL constructor instead of manual parsing - overlay: fix realpath root prefix check security hole - version: inject from package.json at build time
Use absolute /bin/bash path to work around smokepod hang when recorded_with is a short name.
There was a problem hiding this comment.
Pull request overview
Adds a Node-only OverlayFs entrypoint plus new execution hooks and network delegation features to the virtual shell, along with new default commands and expanded CI/testing coverage.
Changes:
- Add
OverlayFsread-through filesystem (@mylocalgpt/shell/overlay) with change tracking + security docs. - Add per-command interpreter hooks (
onBeforeCommand,onCommandResult) and network delegation (ShellOptions.network) to supportcurl. - Add new default commands (
curl,timeout,xxd,yes), expand tests/fixtures, and add Bun CI job.
Reviewed changes
Copilot reviewed 35 out of 36 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tsdown.config.ts | Build config: adds overlay entry and embeds package version define. |
| tests/shell.test.ts | Adds tests for custom FS injection and SHELL_MAX_OUTPUT env exposure. |
| tests/overlay/overlay.test.ts | New OverlayFs unit + integration tests. |
| tests/hooks.test.ts | New tests for per-command hooks behavior. |
| tests/comparison/fixtures/commands/yes.fixture.json | New recorded fixture for comparison tests (yes). |
| tests/comparison/fixtures/commands/xxd.fixture.json | New recorded fixture for comparison tests (xxd). |
| tests/comparison/fixtures/commands/timeout.fixture.json | New recorded fixture for comparison tests (timeout). |
| tests/comparison/commands/yes.test | New smokepod comparison spec for yes. |
| tests/comparison/commands/xxd.test | New smokepod comparison spec for xxd. |
| tests/comparison/commands/timeout.test | New smokepod comparison spec for timeout. |
| tests/commands/yes.test.ts | New unit tests for yes (including output cap behavior). |
| tests/commands/xxd.test.ts | New unit tests for xxd. |
| tests/commands/timeout.test.ts | New unit tests for timeout behavior. |
| tests/commands/curl.test.ts | New unit tests for curl network delegation + allowlist + piping. |
| src/overlay/types.ts | OverlayFs public types (options + changeset). |
| src/overlay/index.ts | OverlayFs implementation (host read + memory write overlay). |
| src/interpreter/interpreter.ts | Adds per-command hooks, exposes output limit via env, passes network config into CommandContext. |
| src/index.ts | ShellOptions adds fs, hooks, network; wires them into Interpreter; updates VERSION injection. |
| src/commands/yes.ts | New yes command with output cap via env. |
| src/commands/xxd.ts | New xxd command implementation with -l/-s. |
| src/commands/wc.ts | Fixes wc character counting to handle surrogate pairs. |
| src/commands/types.ts | Adds NetworkConfig/NetworkRequest/NetworkResponse + exposes ctx.network. |
| src/commands/timeout.ts | New timeout command using Promise.race. |
| src/commands/defaults.ts | Registers new default commands (yes, timeout, xxd, curl). |
| src/commands/curl.ts | New curl command delegating requests to consumer-provided handler with allowlist and redirects. |
| pnpm-lock.yaml | Locks new dev dependency (@types/node). |
| package.json | Exports new ./overlay entrypoint; publishes THREAT_MODEL; adds @types/node. |
| docs/design/security.md | Documents network allowlist + OverlayFs security considerations. |
| docs/design/filesystem.md | Documents OverlayFs architecture and API notes. |
| docs/design/commands.md | Updates default command list and adds docs for new commands. |
| docs/design.md | High-level docs updated for OverlayFs and new command count. |
| biome.json | Disables restricted-import rule for overlay/tests overlay (Node-only). |
| THREAT_MODEL.md | Adds repository threat model document. |
| README.md | Updates public docs: new options, OverlayFs usage, network config, expanded command list. |
| AGENTS.md | Updates contributor docs (CI includes Bun; docs index includes threat model). |
| .github/workflows/ci.yml | Excludes dist/overlay from node-import check; adds Bun test job. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- curl: also filter proxy-authorization header on cross-origin redirects - overlay: use nodePath.sep for Windows compatibility in escape checks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Node-only OverlayFs entrypoint plus new execution hooks and network delegation features to the virtual shell, along with new default commands and expanded CI/testing coverage.
Changes:
OverlayFsread-through filesystem (@mylocalgpt/shell/overlay) with change tracking + security docs.onBeforeCommand,onCommandResult) and network delegation (ShellOptions.network) to supportcurl.curl,timeout,xxd,yes), expand tests/fixtures, and add Bun CI job.