TEDI
AGENTS.md167 starsChanged 6 months agoApache-2.0View on GitHub
Cross-platform terminal with split panes, tab groups, workspaces, a CodeMirror editor, a BYOK AI agent and a runtime extension system. Tauri 2 + Rust owns every OS resource; a React 19 webview owns the UI. Forked from Crynta/Terax v0.5.9. Stack: Tauri 2, Rust (portable-pty, russh), React 19 + TS, xterm.js (WebGL), CodeMirror 6, shadcn/ui, Tailwind v4, @ai-sdk/* v6. Package manager is pnpm. CI runs exactly those. It does not run pnpm format:check, which already fails on files nobody touched, so…
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.
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 84
shadcn/ui and AI Elements are OWNED, not generated: Add a NEW component with the CLI.
- Distinctive: line 86
Prose and docs: no em-dashes: Use commas, colons or parentheses.
- Very specific: line 87
Commit messages carry no AI attribution: no Co-Authored-By line for an assistant.
- Very specific: line 102
If it decides what the agent may do or where credentials go, also add it to AGENT_DENIED_PREFS, so an agent cannot grant it to itself.
- Distinctive: line 142
When a shipped feature is reported broken, check the INSTALLED exe's FileVersion before debugging anything.
≈ “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.
Files
TEDI
Cross-platform terminal with split panes, tab groups, workspaces, a CodeMirror editor, a BYOK AI agent and a runtime extension system. Tauri 2 + Rust owns every OS resource; a React 19 webview owns the UI. Forked from Crynta/Terax v0.5.9.
Stack: Tauri 2, Rust (portable-pty, russh), React 19 + TS, xterm.js (WebGL),
CodeMirror 6, shadcn/ui, Tailwind v4, @ai-sdk/* v6. Package manager is pnpm.
Commands
pnpm exec tsc --noEmit # frontend types
pnpm lint:imports # module import discipline
pnpm verify # the invariant suite; `pnpm verify ai` filters to one folder
pnpm build # frontend build
pnpm tauri:dev # dev, ISOLATED data dir (`pnpm tauri dev` shares prod data)
pnpm tauri:dev:ext # same, plus symlink local extensions/ into the dev profile
cd src-tauri && cargo check && cargo clippy && cargo testCI runs exactly those. It does not run pnpm format:check, which already
fails on files nobody touched, so format only your own paths
(pnpm exec prettier --write <files>) and never repo-wide pnpm format.
Where things live
src-tauri/src/lib.rs: every Tauri command (invoke_handler), app boot and CLI dispatch.src-tauri/src/modules/: one folder or file per OS resource.pty/runs terminals andpty_daemon/is the sidecar that keeps them alive across a window close; alsofs/,shell/,git/,ssh/,extensions/,browser/, andmcp_bridge.rs(the local socket outside AI CLIs connect through).src/app/App.tsx: cross-module wiring only.src/modules/<area>/: every feature.ai/is the agent,terminal/the xterm side,tabs/+panes/+workspaces/the layout model,extensions/the extension host,automation/bridge.tseverything an outside driver may call in-realm.src/settings/: the Settings window, a SEPARATE webview. Its state layer issrc/modules/settings/, shared with the main window through the store.scripts/: the verify suite (one folder per subsystem),mcp/(the stdio MCP server and its shared tool table) andrelease/.extensions/: gitignored working copies of the extension repos. OnlyREADME.md,tedi.d.tsandmanifest.schema.jsonare committed here.
Architecture rules
Load-bearing. Breaking one is a bug, not a style question.
- Two processes. The webview reaches the OS only through
invoke("cmd", args); streaming comes back over a TauriChannel. Every command is registered insrc-tauri/src/lib.rsinvoke_handler- that list is the whole backend API surface, so read it there rather than trusting any doc. - Import through the
@/*alias only, never a relative path that leaves your own module. Enforced bypnpm lint:imports. A module'sindex.tsis a convenience re-export, not a required door. - Tabs never unmount. Inactive tabs hide with
invisible pointer-events-noneso PTYs and dev servers keep streaming.visibility:hiddenKEEPS the layout box, so a size check reports "visible" for a pane nobody is showing and anIntersectionObservernever fires. - Secrets live only in the OS keychain (
secrets_*, servicetedi). Never on disk, in the settings store, or inlocalStorage. - Extensions are not sandboxed. Their JS runs in the main webview with full
privileges, and a raw
@tauri-apps/apiimport skips everyctxpermission gate. The trust boundary is the install-time permission review, so a gate is a guard rail, never a security boundary. App.tsxcoordinates, it does not implement. Feature logic belongs insrc/modules/<area>/.- Tauri commands must be async. A sync one runs on the WebView2 UI thread and blocking there freezes the app. A test pins the allowed-sync list.
- The budget is RAM and idle CPU, not bundle size. The old ~10 MB download cap is retired: ship what the feature needs. Resident cost is what still matters, so no per-tick process spawn, watch instead of poll, and gate pollers on visibility.
Conventions that differ from the default
- Send
\r(CR) for Enter to a terminal, never\n. PowerShell needs CR. - Paths: split with
.split(/[\\/]/). Canonical frontend form is forward-slash; converthomeDir()backslashes at the boundary. - Cross-platform: resolve HOME and cache via the
dirscrate, never raw env vars.#[cfg(not(windows))]code never compiles on Windows, so CI is the first thing that sees it. - shadcn/ui and AI Elements are OWNED, not generated. Add a NEW component with the CLI; re-running it over an existing one silently reverts TEDI's tokens.
- Prose and docs: no em-dashes. Use commas, colons or parentheses.
- Commit messages carry no AI attribution: no
Co-Authored-Byline for an assistant.
Common changes
- New Tauri command: an
async#[tauri::command]in its module, registered inlib.rsinvoke_handler. A sync one fails theui_thread_guardtest. An extension can only call it with aninvoke:<name>permission. - New AI tool: a builder in
src/modules/ai/tools/with an honestneedsApproval, added inbuildTools(tools.ts); its picker group lives incatalog.ts. Tool schemas are re-sent on every step of every turn, sotool-budget-verifyfails a chatty description. - New AI provider or model:
src/modules/ai/config.ts(PROVIDERS,MODELS) is the single source of truth. - New setting: a key in
DEFAULT_PREFERENCES(src/modules/settings/store.ts). If it decides what the agent may do or where credentials go, also add it toAGENT_DENIED_PREFS, so an agent cannot grant it to itself. - New shortcut: an entry in
SHORTCUTS(shortcuts/shortcuts.ts), handled by id inApp.tsx. A focused terminal keeps its own control chords. - New MCP tool: its name, description and JSON Schema go in
scripts/mcp/tools.mjs, which BOTH servers read. A capability registered withregisterBridge(automation/bridge.ts) then serves both transports at once. - Extension API change:
host.ts, thenextensions/tedi.d.ts, whichtscchecks for drift. A new OPTION field on an existing method also needs aHOST_FEATURESentry, or an older host silently ignores it.
Gotchas that have cost real time
- There is no
sshpane kind.LeafStatehas six:terminal,editor,extension-panel,board,scm,ai. SSH is a TERMINAL leaf carryingsshConnectionId. Readingtab.titleinstead ofleafLabel(leaf, sshHosts)renders a bare "ssh" for every remote pane. - A terminal holds a WebGL context only while visible, and Chromium caps live contexts near 16. An evicted context paints BLANK, which is why offscreen canvas panes are culled.
- Windows PTY:
SPAWN_LOCKgates ConPTY lifecycle soClosePseudoConsolecannot race a sibling's openpty; each child joins a Job withKILL_ON_JOB_CLOSEbecausekiller.kill()only kills the immediate child; and cwd must be backslashes before ConPTY. - pwsh never emits OSC 133 C, so nothing may assume a command-start marker arrived; the frontend synthesises it from the keystroke.
- Zod strips unknown keys, which is why MCP tool schemas are raw JSON Schema. The extension manifest schema must stay LOOSER than Rust: Rust decides what installs, Zod only what renders, and a field Rust accepts but Zod rejects installs with a success toast and then never appears.
serde_jsonre-sorts object keys, so never round-trip a user's JSON.- Radix: a
Popoverinside aDialogmust not bemodal, and*SubContentis not self-portaling.@layer componentsloses to utilities. A controlledopennever firesonOpenChange. React bubbles up the REACT tree, not the DOM tree. - The dev profile shares the PTY daemon with the installed app unless you use
pnpm tauri:dev. The daemon outlives the dev GUI; setTEDI_PTYD_IDLE_SECS=60while iterating on it. - Git worktree writes run from the MAIN worktree (
mainWorktreePath), never from the one being acted on:git worktree removerun inside its target half-succeeds on Windows and strands a folder git no longer knows about. - When a shipped feature is reported broken, check the INSTALLED exe's FileVersion before debugging anything.
Working on the AI agent (src/modules/ai/)
- Keep the system prompt byte-stable across turns. Providers cache the
prompt prefix, so any text that changes per turn re-prices the whole
conversation. Per-turn state (cwd, terminals, time) goes in the
<env>block of the user message, never in the system prompt. - Project memory is the workspace root's
AGENTS.mdplusTEDI.md, preloaded together into one 12 KB budget (lib/projectMemory.ts), and read against the SESSION-PINNED root: reading the live root once dropped it whenever a terminal in another project took focus. - A tool call left without a result makes every provider reject the chat, so
interrupted calls are closed before each request (
closeDanglingToolCalls). - Chat sessions are GLOBAL (
tedi-sessions.json), not per workspace.
Testing
pnpm verify discovers every scripts/**/*-verify.ts. Two things about it:
- Run it through pnpm. Bare
node scripts/verify-all.mjscannot find thetsxshim and reports every check as failed. - Most checks assert on SOURCE TEXT, not behaviour. Renaming a symbol they cover fails them by design: re-point the assertion at the new name, never delete it.
New checks are plain tsx scripts, no framework. Put one in the folder for its
subsystem and the runner picks it up.
Releasing
Version lives in three files: package.json, src-tauri/Cargo.toml and
src-tauri/tauri.conf.json. After bumping, run cargo check (not --locked) to
write the lock, then text-diff it: git treats that lock as binary, so a byte
count hides a stray dependency edge.
git fetch and compare BOTH directions before starting. Push main and wait for
CI green before pushing the tag, because a tag starts a ~19 minute signed
build. A core release comes out a DRAFT and ships only when published, which
auto-updates every client irreversibly, so confirm first - and list drafts before
and after, because a release has silently stayed a draft while releases/latest
kept serving the previous version. An EXTENSION tag auto-publishes, so there the
tag push is the ship.
Where to read more
- Architecture, module by module: ARCHITECTURE.md - the two-process model, the backend and frontend module tables, the AI subsystem, data-flow traces, and the core/extension contract.
- Build, PR and review rules: CONTRIBUTING.md.
- Writing an extension: extensions/README.md - the
manifest schema, the permission-gated
ctxAPI, and the reference extensions. - The self-check suite: scripts/README.md.
- The MCP surface:
scripts/mcp/tools.mjsis the one tool table both the stdio server and TEDI's in-process server read. - What changed and when: CHANGELOG.md.
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
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.

