src/ holds the TypeScript source of the agent-tty npm package. tsconfig.build.json compiles it from rootDir ./src to outDir ./dist. The CLI entry point is src/cli/main.ts, published as the agent-tty bin (dist/cli/main.js). The only file directly in src/ is index.ts, the package's type-only library entry. Each subdirectory below has its own contract.
index.tsre-exports the CLI JSON envelope typesCommandEnvelope,CommandError,CommandErrorEnvelopeandCommandSuccessEnvelopefromsrc/protocol/envelope.ts. [index.ts:CommandEnvelope]index.tsre-exports the RPC typesRpcMethod,RpcRequest,RpcResponse,RpcSuccessResponse,RpcErrorResponseandRpcError, and the*Params/*Resultpairs forDestroy,Inspect,Paste,Resize,SendKeys,Signal,TypeandWait, fromsrc/protocol/messages.ts. [index.ts:RpcMethod]index.tsre-exportsEventRecord,EventType,SessionRecordandSessionStatusfromsrc/protocol/schemas.ts,ProtocolErrorCodefromsrc/protocol/errors.tsandAgentTtyConfigfromsrc/config/resolveConfig.ts. [index.ts:SessionRecord] [index.ts:ProtocolErrorCode] [index.ts:AgentTtyConfig]- Package wiring:
mainis./dist/index.jsandtypesis./dist/index.d.ts, both built fromindex.ts.package.jsonhas noexportsfield.bin.agent-ttyis./dist/cli/main.js. [package.json:main] [package.json:types] [package.json:bin] - Subdirectories:
./cli/README.md: Commander front end.main.tsregisters every command and mapsCliErrorto envelopes and exit codes. Handlers live in./cli/commands/../host/README.md: per-session host and its lifecycle: detached host spawn, PTY plus append-onlyEventLog, Unix-socket JSON RPC, renderer management, run-completion sentinels, and destroy, list and reconcile../protocol/README.md: machine-facing contract: CLI JSON envelopes, error codes, strict Zod schemas for manifests, event records and RPC methods, and the per-status session policy. No I/O../storage/README.md: on-disk layout: Home resolution, guarded session, socket and artifact paths, temp-file-plus-rename JSON writes, artifact manifests, the Home registry and the 50 MB event-log codec../pty/README.md: spawns the PTY child throughnode-pty, builds its environment, encodes keys and bracketed paste, and answers DSR and OSC 10/11 terminal queries../config/README.md: default session constants and the Zod-validated loader for the optional<home>/config.json../replay/README.md: offline replay of a session's manifest andevents.jsonlinto a renderer backend up to a targetseq../renderer/README.md:RendererBackendcontract, replay, snapshot and profile schemas, the backend registry, Screen Hash helpers and theghostty-webandlibghostty-vtbackends../renderWait/README.md: validateswaitForRenderconditions and matches them against semantic snapshots. Pure../snapshot/README.md: builds structured and text snapshot results with a Screen Hash and saves them as JSON artifacts with a manifest entry../screenshot/README.md: captures a renderer PNG to a temp path, validates it, renames it to the artifact name and appends a manifest entry../export/README.md: asciicast v2 text from the event log, and WebM video by timed replay into aghostty-webbackend../batch/README.md: parses and runs Batch plans oftype,paste,sendKeys,runandwaitsteps over host RPC../dashboard/README.md: Ink/React Session Dashboard behindagent-tty dashboard../skills/README.md: finds, parses and serves the bundled skills from<packageRoot>/skill-data/<name>/SKILL.md../tools/README.md: maintainertsxtools for dogfood proof bundles, the Hero Demo videos and release-please runs../util/README.md: shared helpers: fail-fast assertions, abort and timeout plumbing, resource scopes, a per-key serializer, a line diff, a leveled logger, hashing and path checks.
- Every export in
index.tsisexport type, andtsconfig.jsonsetsverbatimModuleSyntaxtotrue. TypeScript therefore erases these re-exports from the emitteddist/index.js, which exports no runtime values. [index.ts:CommandEnvelope] [tsconfig.json:verbatimModuleSyntax] - The install smoke test requires
dist/index.jsanddist/index.d.tsin the packed tarball and in the installed package.assertPackedFilesandassertPackagePathsthrow when one is missing. [scripts/smoke-install.mjs:getRequiredPackPaths] [scripts/smoke-install.mjs:assertPackedFiles] [scripts/smoke-install.mjs:assertPackagePaths]
- None found in code.
index.tsonly re-exports types.
- Run:
npm run typecheck - Run:
npm run build && npm run smoke:install -- --skip-build(checks thatdist/index.jsanddist/index.d.tsship) - Run:
npm test(everytest/**/*.test.ts; integration and e2e tests need Playwright Chromium frommise run bootstrap)