This scaffold keeps the application runtime in Node.js and TypeScript. Local model inference is handled in-process through node-llama-cpp behind the TypeScript client boundary.
detoks/
├── docs/
├── scripts/
├── src/
│ ├── cli/
│ │ ├── commands/
│ │ └── repl/
│ ├── core/
│ │ ├── context/
│ │ ├── executor/
│ │ ├── output/
│ │ ├── pipeline/
│ │ ├── state/
│ │ ├── task-graph/
│ │ ├── translate/
│ │ ├── prompt/
│ │ ├── guardrails/
│ │ └── llm-client/
│ ├── integrations/
│ │ ├── adapters/
│ │ │ ├── codex/
│ │ │ └── gemini/
│ │ └── subprocess/
│ ├── schemas/
│ ├── types/
│ └── utils/
└── tests/
└── ts/
├── integration/
└── unit/
src/core/translate,src/core/prompt,src/core/guardrails: TypeScript implementation for Role 1src/*: TypeScript implementation for Roles 1, 2.1, 2.2, and 3src/integrations/*: external tool integrations such as Codex, Gemini, and subprocess handlingtests/ts/*: TypeScript tests for application logic, including Role 1 modules
src/cli: CLI layer, REPL, and user-facing commandssrc/core/pipeline: pipeline orchestrationsrc/core/task-graph: request analysis, task graph generation, and dependency orderingsrc/core/context: context compression and optimizationsrc/core/output: output summarization and result structuringsrc/core/state: session state managementsrc/core/executor: execution flow coordinationsrc/core/translate: Korean-to-English translation pipelinesrc/core/prompt: prompt normalization and reusable Kompress helperssrc/core/guardrails: translated output validation and repairsrc/core/llm-client: localnode-llama-cppruntime lifecycle and chat completion boundarysrc/integrations/adapters/*: target CLI integrations such as Codex and Geminisrc/integrations/subprocess: process spawning and I/O bridgingsrc/schemas: runtime schemas and validation definitionssrc/types: shared TypeScript typessrc/utils: shared TypeScript utilitiesscripts: developer automation scripts
- Core logic must reside under
src/core. - Translation, prompt processing, and LLM interaction are core pipeline responsibilities.
- The local LLM path must use the in-process
node-llama-cppruntime. - All LLM interaction must go through
src/core/llm-client. - External integrations must remain isolated under
src/integrations.