A Windows-first, terminal-only coding agent designed for long-term daily use. The project starts with a small reliable runtime core, then grows through tested vertical slices.
Milestone 1.22.12: the agent is a usable daily tool on Windows — interactive, crash-safe, budget-aware, extensible, and observable. It is explicitly NOT a production product: see "Known limits" before relying on it.
local-agent start the interactive TUI
local-agent run "run the tests, fix the bug, and prove the fix" --workspace .
-
TypeScript strict mode on Node.js 24+
-
Provider-neutral typed model streaming and response assembly
-
Pi
@earendil-works/pi-ai-backed OpenAI-compatible, Anthropic-compatible, and OpenCode Provider routes -
Per-provider request-start timeout, stream-idle timeout, and separate retry budgets
-
Stable Provider-neutral failures with HTTP status, Retry-After, and request-id diagnostics
-
Attempt-aware partial-stream recovery without committing failed output or executing partial tool calls
-
Runtime-validated, typed Session Events and event-derived model context
-
Ordered JSONL EventStore for one in-process Session writer
-
Workspace tools behind one boundary:
read_file,list_files,search_text,apply_patch,run_command -
Read-before-edit, stale-file rejection, whole-line patch preview, and atomic file replacement
-
ProcessRunnerseam with bounded output, timeout, cancellation, and process-tree kill -
safe/balanced/yolopermission modes with durableallow/ask/denydecisions -
Approval bound to the tool call id and a canonical argument digest, before anything executes
-
Completion evidence: a run that changed files cannot succeed until a recognized verification command passes afterwards
-
No-progress stop: a repeating identical verification failure ends the run instead of burning budget
-
Interactive TUI on Pi
@earendil-works/pi-tui: streaming transcript, tool cards, status line, in-shell approval,/help/status/model/new/sessions/resume/cancel/reasoning/exit -
Headless CLI with stable exit codes, text/JSON/event output, and stderr-only diagnostics
-
Sessions are reopenable: an unterminated Run from a killed process is closed with an explicit
run.interruptedfact that names any tool whose side effects are unknown -
A damaged final log line is repaired by truncation while a damaged middle line stays a loud failure; a writer lock refuses a second live writer
-
Project rules (
AGENTS.md,CLAUDE.md) are read from disk into the request and recorded in the manifest with their hashes, never copied into history -
Every request is projected against the selected model's context window: old tool results are shrunk first, then the oldest exchanges are dropped, and the run stops with
context_budget_exceededrather than sending an oversized request -
Compaction: when pruning cannot fit the budget, dropped history is replaced by a deterministic digest, so long tasks keep their thread instead of stopping
-
Steering: typing while a task runs queues input that lands between steps as a durable fact and reaches the next request
-
Skills: SKILL.md files in three scopes — workspace
.local-agent/skills, the app user directory (%APPDATA%\local-coding-agent\skills), and the cross-tool shared~/.agents/skillsthat Codex and ZCode also read (override withLOCAL_AGENT_AGENTS_SKILLS). Later scopes shadow earlier ones: workspace > app > shared. Skills are listed in context and loaded on demand throughload_skill; skill scripts run throughrun_commandunder normal policy -
MCP: stdio servers from config become
mcp__<server>__<tool>tools with conservative execute effects — every call goes through policy and approval -
Extras:
update_plan(visible task plan),save_memory(persistent notes, credential-content refused),delegate_research(isolated read-only subagent),local-agent doctor,local-agent replay <id>,local-agent sessions -
Extensibility:
registerTool/registerCommand/onEventonly — extension tools pass the same gateway, policy, and approval as built-ins
npm run build
# interactive shell in a terminal
node dist/cli/bin.js --workspace C:\work\repo --provider maas
# one task, human-readable, for scripts and CI
node dist/cli/bin.js run "fix the failing test" --workspace C:\work\repo --provider maas
# machine-readable result
node dist/cli/bin.js run "explain src/app.ts" --output json --workspace C:\work\repo
# list configured provider routes and models
node dist/cli/bin.js models --provider maas
# list this workspace's sessions and resume one
node dist/cli/bin.js sessions --workspace C:\work\repo
node dist/cli/bin.js run "continue where we stopped" --workspace C:\work\repo --session cli-20260919-...local-agent, local-agent tui, and local-agent --workspace <dir> all start the same TUI. Inside it:
- type a task and press Enter; assistant text streams, tool calls render as one card each with a one-line result
- typing
/opens a command menu (arrow keys to move, Enter to run, Tab to fill, Esc to close);/modeland/resumealso suggest their arguments from the live catalog and session list;@completes file paths EscorCtrl+Ccancels the running task, a secondCtrl+Cexits;/exitalways works- an
askdecision becomes a prompt:yallows,norEscdenies, and the patch preview is shown above the prompt /model <id>switches the model and/newopens a new session for the next task; neither disturbs a running task/sessionslists this workspace's sessions and/resume <id>reopens one, reporting any run that a previous process left interrupted/reasoningshows or hides model reasoning
The TUI needs a terminal on stdin and stdout. Without one it exits with code 2 instead of writing control sequences into a pipe, so the same binary stays safe in scripts.
The CLI reads one versioned JSON file: %APPDATA%\local-coding-agent\config.json, overridable with
--config or LOCAL_AGENT_CONFIG. It stores provider descriptions and a credential reference, never a secret.
{
"version": 1,
"providers": {
"maas": {
"kind": "compatible",
"protocol": "openai-completions",
"baseUrl": "https://<host>/compatible-mode/v1",
"credentialRef": "DASHSCOPE_API_KEY",
"models": [{ "id": "qwen3.8-max-0902", "displayName": "Qwen 3.8 Max" }],
"reliability": { "requestStartTimeoutMs": 60000, "streamIdleTimeoutMs": 90000 }
}
}
}The key is resolved at request time from the process environment, the Windows user or machine environment, or the
DPAPI vault (WindowsCredentialProvider). A missing named credential fails before any network call.
| Code | Meaning |
|---|---|
| 0 | success |
| 1 | run failed |
| 2 | usage or configuration error |
| 3 | cancelled |
| 4 | step budget exhausted |
| 5 | interrupted |
| 6 | blocked: approval denied, missing verification, or no progress |
balanced is the default. Modes only change the rule set; the Tool Gateway, the durable event log, and the
workspace boundary are identical in all of them.
| Command kind | safe | balanced | yolo |
|---|---|---|---|
| reads, searches, listings | allow | allow | allow |
| workspace write after a read | ask | allow | allow |
| file delete | ask | ask | allow |
| recognized test / build / lint | allow | allow | allow |
| unknown, install, git write | ask | ask | allow |
| network | ask | ask | ask |
| machine-level or history-rewriting command | deny | deny | deny |
ask needs an approver. Inside a terminal the CLI prompts and prints the patch preview; without a terminal
(--approval deny, or piped input) the call is denied and the run continues with that fact recorded.
TUI / CLI adapters
↓
Application service
↓
Runtime core ──→ Session EventStore
↓
Context / Model / Tool Gateway / Completion contracts
↓
Replaceable providers, tools, skills, and projections
Tool call → schema validation → policy allow/ask/deny → approval (when asked)
→ execution world → tool result → session event → completion evidence
The Python prototype in the career-system repository remains an executable behavioral baseline. This repository does not copy its module layout.
npm install
npm run checknpm test and npm run check execute the MaaS live tests by default and may incur Provider charges. For an offline-only run:
npm test -- --exclude tests/pi-ai-live.test.ts --exclude tests/agent-runtime-live.test.ts{
"version": 1,
"providers": { "...": "..." },
"mcpServers": {
"filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "C:\work"] }
}
}Servers start with the agent. A server that fails to start degrades to a warning on stderr and in doctor, not a broken agent. MCP tool calls are treated like unknown commands: they need approval in safe and balanced, always.
- The operator is trusted; the model is constrained. The boundary keeps the model inside the workspace, keeps credentials out of child processes and logs, and gates every side effect behind policy and approval.
- Not an OS-level sandbox: a model-approved command runs with the operator's permissions.
yolowidens rules, never removes them — machine-level and history-rewriting commands are denied in every mode, and network tools always ask. - Secrets live in the environment or the DPAPI vault and are referenced by name. They never enter config, session logs, or child processes.
- The runtime allows one tool call per model turn; a batch is rejected with a structured observation.
- File deletion and shell commands that need approval are denied in non-interactive runs unless the mode allows them.
balancedandyoloassume the user trusts the model inside the workspace. The boundary prevents path escape and credential leakage to child processes, but this is not an OS-level sandbox.- Sessions are workspace-local (
<workspace>/.local-agent/sessions/<id>/events.jsonl). Nothing deletes them yet, and listing reads each log once instead of maintaining an index. - A session written by an older schema version is skipped when listing rather than migrated; session migration is still on the roadmap.
- Compaction digests are deterministic summaries, not model-written ones; a very long task with huge outputs may still hit the budget stop.
- MCP support covers stdio servers with tools/list and tools/call only (no resources, prompts, or sampling).
- The eval suite is a grading contract plus fixtures, not yet a public benchmark; numbers come from your own runs.