aa1143/NamiDSH
Learning ResourcesA compact TypeScript reimplementation of DeepSeek Harness's plugin architecture, built for developers who want to study how an industrial agent framework is assembled.
What this is
DeepSeek Harness (DSH) is a large industrial agent codebase, and reading it directly is slow. NamiDSH reconstructs its skeleton at roughly a thousand lines of TypeScript: a mini Cordis plugin framework, a mini DSH composed of eleven packages, and a browser-based agent. The point is correspondence — file structures, APIs, plugin style and package responsibilities mirror the real project, so after reading this code the original DSH files become easier to place.
The mini Cordis (about 680 lines) keeps dependency injection, async loading, error isolation, hot-plugging and the five event types. Fourteen scenarios in tests/compat.ts are run against both the mini framework and the real Cordis vendored in DSH, and the outputs are reported to match line by line. The agent side splits services (ctx.llm, ctx.tools, ctx.sessions), service providers (DeepSeek adapter, file tools) and consumers (agent loop, webserver) the same way DSH does, so swapping a model or adding a tool means mounting another plugin.
Getting started
You need Node.js 22.18 or newer, which runs TypeScript directly without a build step.
npm install # links the packages/* workspaces; no runtime dependencies are downloaded
npm start # serves http://localhost:3000
Without an API key the app uses an offline mock model, enough to try prompts such as “what time is it” and “what files are in the project”. To connect DeepSeek:
API_KEY=sk-xxx npm start
The following environment variables are also recognized: BASE_URL (defaults to https://api.deepseek.com), MODEL (defaults to deepseek-v4-flash), PORT and WORKSPACE. Open the printed local address in a browser to chat with the agent.
To check framework parity yourself:
node tests/compat.ts
CORDIS=/path/to/deepseek-harness/vendor/cordis/lib/index.js node tests/compat.ts
The second command requires a local DSH checkout; substitute your own path.
Study material
Seven articles accompany the code, each tied to specific files, covering the plugin model, Context, Fiber lifecycle, services and dependency injection, the event bus, the one-question agent journey, and a line-by-line comparison with real Cordis. They are available both as Markdown in docs/ and as a visual walkthrough that highlights the architecture diagram while showing the corresponding source lines.
Constraints
- Node.js 22.18+ is required because the project relies on built-in TypeScript execution; there is no compiled output to fall back on.
- The DeepSeek path needs a valid API key and network access; the mock model is offline but limited to the demo tools shipped with the project.
- File tools are read-only (
read_file,list_dir) and scoped to the configured workspace. - The mini Cordis intentionally omits isolate/intercept, mixins, accessors,
ctx.set,@Injectdecorators and generator effects, on the stated grounds that DSH does not use them. Code relying on those features will not behave the same. - Licensed under MIT.
HotRepo's take
The repository is young, created in early November 2026, and its only recorded appearance is on the TypeScript new-project list for 2026-11-06, where it added 21 stars over a roughly three-hour observation window to reach 130 stars and 15 forks. Sampling during that window rose from 109 to 130 stars. With one snapshot and no daily all-language rank, there is not enough same-basis history to read a trend; what the record does support is a short burst of attention right after publication. The value proposition here is pedagogical rather than operational: the fourteen dual-run compatibility scenarios and the explicit mapping table against DSH packages are the concrete artifacts that justify the “learn by shrinking” framing.
Written by AI from the project's README, updated . The project's own docs are the source of truth.