TypeScript project. DeepSeek-native coding agent, cache-first loop. MIT-licensed. Node ≥22 required.
- Language — TS 5.6+, ES2022, ESM (
"type": "module") - CLI — Commander.js + Ink 5 (React 18) TUI
- Test — Vitest 2.x
- Lint / Format — Biome 1.9 (2-space, double quotes, semicolons always, 100 width)
- Build — tsup (bundle),
tsx(dev runner) - MCP — stdio + SSE transports, in-process fake in tests
| Path | What |
|---|---|
src/cli/ |
CLI entry + commands (chat.tsx, code.tsx, diff.ts, etc.) + Ink TUI in ui/ |
src/tools/ |
Tool defs (filesystem, shell, MCP, plan, subagent, web, workspace) |
src/mcp/ |
MCP client, transports (stdio, SSE), registry, spec |
src/repair/ |
Tool-call repair pipeline (flatten, scavenge, storm, truncation) |
src/index/ |
Semantic vector index |
src/code/ |
SEARCH/REPLACE edit-block parser + apply gate |
src/core/ |
Event-log kernel — events.ts (Event union), reducers.ts (pure projections), eventize.ts |
src/ports/ |
Port interfaces — ModelClient, ToolHost, EventSink, MemoryStore, HookRunner, CheckpointStore |
src/adapters/ |
Concrete adapters for the ports (e.g. event-sink-jsonl.ts, event-source-jsonl.ts) |
src/frame/ |
Frame compiler (cell grid → ANSI) used by the TUI log renderer |
src/memory/ |
Project / session / user / runtime memory stores |
src/transcript/ |
Transcript log (write), diff, replay |
src/telemetry/ |
Usage records + cross-session stats |
src/server/ |
Dashboard HTTP server + REST API |
tests/ |
Vitest tests, flat *.test.ts |
examples/ |
basic-chat.ts, mcp-server-demo.ts, etc. |
benchmarks/ |
Harvest + tau-bench harnesses |
dashboard/ |
Compiled dashboard SPA assets |
data/ |
Tokenizer data (deepseek-tokenizer.json.gz) |
dist/ |
Build output — do not edit |
.github/ |
CI + issue / PR templates |
npm run build # tsup → dist/
npm run dev # tsx src/cli/index.ts
npm run chat # tsx src/cli/index.ts chat
npm run test # vitest run
npm run test:watch # vitest
npm run lint # biome check src tests
npm run lint:fix # biome check --write src tests
npm run format # biome format --write src tests
npm run typecheck # tsc --noEmitprepublishOnly: lint → typecheck → test → build.
- Imports — explicit
import typefor type-only imports (BiomeuseImportType: warn). Direct relative imports within project, no barrel re-exports. - Exports — named exports only; no
export default. Entry:src/index.ts. - Tests — vitest
describe/it/expect, no globals. Naming:<module>.test.tsflat intests/. - JSX —
.tsxfor Ink components.jsx: "react"in tsconfig. - TypeScript —
strict,noUncheckedIndexedAccess,noImplicitOverride. Tools acceptToolCallContext(abort signal). - MCP — All transports implement
McpTransportinterface. Tools registered via registry at startup. - Changelog — Keep a Changelog format. Semver.
- This IS Reasonix — edits to
src/loop.ts,src/repair/,src/tools/,src/mcp/affect every session. Test before publishing. - SEARCH must match byte-for-byte — the edit-gate in
src/code/edit-blocks.tsenforces exact match. Trailing whitespace or wrong indent = mismatch. dist/is generated bytsup. Never hand-edit..reasonix/semantic/is auto-generated vector index. Never hand-edit.sessions/and.reasonix/sessions/are user-private, git-ignored (per.gitignore).