You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2777fe3
Browse filesBrowse the repository at this point in the historyBrowse files
Load AGENTS.md in the browser terminal from its workspace
The browser build turned off AGENTS.md loading because WebAssembly has no
filesystem, and nothing gave createFxTerminal another way to read the files
or said they were left out.
Workspace adapters can now provide readFile. The terminal reads the global,
project, and scoped AGENTS.md files through it with the CLI's selection and
size rules. A workspace without readFile reports the omitted instructions to
the model and the full transcript.
Copy file name to clipboardExpand all lines: sdk/AGENTS.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ The SDK has two WebAssembly surfaces and one shared JavaScript host layer:
16
16
| Native and WebAssembly capability policy |`src/core/hosts/runtime_profile.zig`|
17
17
| Host-backed terminal session persistence |`src/core/app/app_session_runtime.zig` and `sdk/fx-sdk.js`|
18
18
| Browser workspace contract and `shell.run` bridge |`src/core/hosts/js_host_workspace.zig` and `src/tools/shell/browser_shell.zig`|
19
+
| Browser workspace AGENTS.md reads |`src/core/hosts/js_host_workspace.zig`, `src/builtins/context.zig`, and `sdk/fx-sdk.js`|
19
20
| Browser device login, OAuth session persistence, and URL opening |`src/core/auth/js_host_auth.zig`, `src/core/auth/oauth_session.zig`, and `src/core/hosts/js_host_url_opener.zig`|
20
21
| WASI target, optimization mode, threading, and artifact names |`build.zig`|
21
22
| Core browser fixture and its automation contract |`sdk/index.html` and `sdk/tests/test-core-browser.mjs`|
@@ -32,6 +33,7 @@ Do not treat the demos or this file as the implementation contract. When prose a
32
33
- 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.
33
34
- 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.
34
35
- 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.
36
+
- The optional workspace `readFile` boundary serves only project instruction loading. Keep it limited to absolute `AGENTS.md` paths inside the workspace root or home, with UTF-8 validation, the 1 MiB copy limit, and the shared abort path. It is not a model-callable file tool. A workspace without `readFile` must report the omitted instructions rather than skip them silently.
35
37
- 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.
36
38
-`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.
37
39
- 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.
@@ -46,6 +48,7 @@ Do not treat the demos or this file as the implementation contract. When prose a
46
48
| Terminal adapter, input encoding, resize, cleanup, config, or prompt history | Terminal build and the headless terminal suite |
47
49
| Terminal session persistence or browser device login | Terminal build plus `sdk/tests/test-term-session-resume.mjs` or `sdk/tests/test-term-login.mjs`|
48
50
| Browser workspace metadata, permissions, execution, limits, or cancellation | Terminal build plus `sdk/node/test-term-workspace.mjs`|
51
+
| Browser workspace AGENTS.md reads | Terminal build plus `sdk/node/test-term-agents-md.mjs`|
49
52
|`encodeXtermKeyEvent()` or `xtermAdapter()` only |`sdk/node/test-xterm-adapter.mjs`|
50
53
| Core debugger query behavior or automation state |`sdk/tests/test-core-browser.mjs`|
51
54
| Terminal demo asset references, integrity, or cache policy | Package into a fresh temporary directory and inspect the generated HTML, manifest, and headers |
0 commit comments