agentleFS
VercelKnown publishervercel-labs/fx/sdk/AGENTS.md

fx / sdk

AGENTS.md3.3k starsChanged 2 months agoApache-2.0View on GitHub

These instructions apply to work under sdk/ and supplement the repository-level AGENTS.md. This file is maintainer guidance, not consumer documentation. Keep setup and the supported public surface in sdk/README.md. Keep exact API shapes in sdk/fx-sdk.js and its tests. Add details here only when they help an agent choose the right owner, preserve a non-obvious invariant, or run the right proof. The native Node-API architecture and security model are documented in sdk/NAPI.md. The SDK has two WebAssembly surfaces and one shared…

  • Reads credentials

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 18 mentionsSep 2026: 8 mentionsOct 2026: 4 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the vercel-labs/fx repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about vercel-labs/fx

The biggest 5 of 30 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 30

Talked about on GitHub, Bluesky and Hacker News (30 times).

On GitHub · 26

21 more on GitHub

On Hacker News · 1

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not treat the demos or this file as the implementation contract.

    line 25
  2. Very specific:

    Keep sdk/fx-sdk.js a dependency-free ECMAScript module.

    line 29
  3. Very specific:

    Keep the core and terminal surfaces distinct.

    line 30
  4. Very specific:

    Treat JavaScript host stores as durable contracts.

    line 32
  5. Very specific:

    Keep workspace version 1 constrained to an ephemeral, non-git workspace whose normalized cwd equals root.

    line 35
  6. Very specific:

    Use Node.js 24 for SDK tests.

    line 54
  7. Very specific:

    Do not commit zig-out/, sdk/dist/, or other generated artifacts.

    line 93

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

WebAssembly SDK instructions

These instructions apply to work under sdk/ and supplement the repository-level AGENTS.md.

This file is maintainer guidance, not consumer documentation. Keep setup and the supported public surface in sdk/README.md. Keep exact API shapes in sdk/fx-sdk.js and its tests. Add details here only when they help an agent choose the right owner, preserve a non-obvious invariant, or run the right proof. The native Node-API architecture and security model are documented in sdk/NAPI.md.

Start from the correct owner

The SDK has two WebAssembly surfaces and one shared JavaScript host layer:

ConcernSource of truth
Shared loader, host imports, adapters, and public JavaScript exportssdk/fx-sdk.js
Headless ACP composition for fx-core.wasmsrc/wasm_core_main.zig
Interactive terminal entry point for fx-term.wasmsrc/wasm_term_main.zig and runWasmTerminal in src/main.zig
Native and WebAssembly capability policysrc/core/hosts/runtime_profile.zig
Host-backed terminal session persistencesrc/core/app/app_session_runtime.zig and sdk/fx-sdk.js
Browser workspace contract and shell.run bridgesrc/core/hosts/js_host_workspace.zig and src/tools/shell/browser_shell.zig
Browser device login, OAuth session persistence, and URL openingsrc/core/auth/js_host_auth.zig, src/core/auth/oauth_session.zig, and src/core/hosts/js_host_url_opener.zig
WASI target, optimization mode, threading, and artifact namesbuild.zig
Core browser fixture and its automation contractsdk/index.html and sdk/tests/test-core-browser.mjs
Terminal fixture and static packaging contractsdk/term-demo.html and sdk/scripts/package-term-demo.mjs
Commands required by CI.github/workflows/ci.yml

Do not treat the demos or this file as the implementation contract. When prose and behavior disagree, establish the current behavior from code and focused tests before changing either.

Preserve these invariants

  • Keep sdk/fx-sdk.js a dependency-free ECMAScript module. A bundler, framework, or runtime package must not become necessary to load the SDK.
  • Keep the core and terminal surfaces distinct. fx-core.wasm starts the headless ACP server; fx-term.wasm starts the interactive terminal. Shared loader changes must be validated against both.
  • Detect JavaScript Promise Integration (JSPI) by capability through supportsJspi(). Do not replace feature detection with browser or version sniffing. Keep loader errors, demo fallback states, and the compatibility statement in sdk/README.md consistent.
  • Treat JavaScript host stores as durable contracts. Session and OAuth snapshots are opaque bytes with optimistic revisions. Preserve FX_SESSION_REVISION_CONFLICT and FX_OAUTH_SESSION_REVISION_CONFLICT. Persist configuration only after fx accepts it, and do not collapse prompt-history outcomes into generic success.
  • Preserve cancellation and lifecycle behavior. Fetch cancellation must reach the host AbortSignal; terminal subscriptions must be released exactly once; abort() must settle exited and must not leave input or resize listeners attached.
  • The WebAssembly runtime is not the native runtime. Keep native tools disabled. The optional workspace host may expose only completion-only shell.run through its typed boundary and permission policy. Its schema is exactly { action: "run", command }; native profiles, TTYs, and managed running handles are unavailable. Any additional capability requires its own typed host boundary, permission review where applicable, and coverage on the affected surface.
  • Keep workspace version 1 constrained to an ephemeral, non-git workspace whose normalized cwd equals root. Preserve command and output limits, the 30-second maximum deadline, and Ctrl+C cancellation through the shared host-effect abort path.
  • window.__fxCoreTest and document.body.dataset.state are test interfaces for the core debugger. If either changes intentionally, update the browser test in the same change.
  • The live demos may pass a locally stored credential into the WebAssembly environment. Never print, serialize into artifacts, or add test assertions containing that credential.

Match the proof to the change

ChangeMinimum focused proof
Public export, shared loader, WASI import, or JSPI gateBuild and test both surfaces
createFxAgent(), ACP translation, core session persistence, streaming, or cancellationCore build, core Node tests, and the browser test when browser behavior is involved
Live Gateway request or model-catalog translationCore tests plus the opt-in live smoke test when a credential is available
Terminal adapter, input encoding, resize, cleanup, config, or prompt historyTerminal build and the headless terminal suite
Terminal session persistence or browser device loginTerminal build plus sdk/tests/test-term-session-resume.mjs or sdk/tests/test-term-login.mjs
Browser workspace metadata, permissions, execution, limits, or cancellationTerminal build plus sdk/node/test-term-workspace.mjs
encodeXtermKeyEvent() or xtermAdapter() onlysdk/node/test-xterm-adapter.mjs
Core debugger query behavior or automation statesdk/tests/test-core-browser.mjs
Terminal demo asset references, integrity, or cache policyPackage into a fresh temporary directory and inspect the generated HTML, manifest, and headers
Supported public behavior or setupUpdate sdk/README.md in the same change

Use Node.js 24 for SDK tests. CI relies on its JSPI implementation behind --experimental-wasm-jspi.

Core validation from the repository root:

zig build -Dwasm-surface=core
node --experimental-wasm-jspi sdk/tests/test-core.mjs
node --experimental-wasm-jspi sdk/tests/test-core-cancel.mjs
node --experimental-wasm-jspi sdk/tests/test-core-home-unavailable.mjs
node sdk/tests/test-core-browser.mjs

Set CHROME_PATH for the browser test only when Chrome or Chromium is outside the paths searched by the script.

Terminal validation from the repository root:

zig build -Dwasm-surface=term
npm ci --prefix sdk/node
npm run --prefix sdk/node test:term
node --experimental-wasm-jspi sdk/tests/test-term-session-resume.mjs
node --experimental-wasm-jspi sdk/tests/test-term-login.mjs

For a live Gateway transport change, AI_GATEWAY_API_KEY must already be present in the environment before running the opt-in smoke test:

node --experimental-wasm-jspi sdk/tests/test-core-live.mjs

For behavior changes, also follow sdk/README.md to serve the repository and drive one real interaction in the affected browser demo. Automated tests do not replace this runtime exercise.

The terminal packaging script removes its output directory before writing. Always give it a newly created temporary directory:

sdk_package_dir="$(mktemp -d)"
node sdk/scripts/package-term-demo.mjs "$sdk_package_dir"

Do not commit zig-out/, sdk/dist/, or other generated artifacts. Run git diff --check before creating a checkpoint. The repository-level build, binary exercise, and Full CI ship gates still apply.

Code review rules

  • Flag a public contract change that lacks a focused regression test. Require a README update only when supported public behavior or setup changed.
  • Flag code that makes one surface silently depend on the other surface's composition or capability profile.
  • Flag user-agent checks for JSPI, swallowed session or OAuth revision conflicts, premature config writes, lost prompt-history outcomes, or terminal listener leaks.
  • Flag workspace adapters that bypass typed metadata validation, permission admission, resource limits, or the shared cancellation path.
  • Flag deployment changes that give mutable HTML the same long-lived cache policy as content-addressed JavaScript or WebAssembly assets.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.