@slenderbuilds/niti 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +176 -111
  2. package/package.json +8 -7
package/README.md CHANGED
@@ -1,144 +1,210 @@
1
1
  <div align="center">
2
2
 
3
- # <img src="assets/logo.png" alt="niti logo" width="90" valign="middle"> niti
4
- [![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](#license)
5
- [![Bun](https://img.shields.io/badge/core-Bun%20%2F%20TypeScript-f9f1e1)](#two-front-ends-one-core)
6
- [![Go](https://img.shields.io/badge/TUI-Go%20%2F%20Bubbletea-00add8)](#two-front-ends-one-core)
3
+ <br>
7
4
 
8
- **A terminal CLI that runs multiple AI coding agents — from different LLM providers — concurrently on one project.**
5
+ <img src="assets/logo.png" alt="" width="112">
9
6
 
10
- Assign models to custom roles, pick an **orchestrator** to plan the work into a task DAG, and watch the team build together. They talk to each other directly to stay aligned — live in your terminal, or in an optional web dashboard.
7
+ <picture>
8
+ <source media="(prefers-color-scheme: dark)" srcset="assets/wordmark-dark.svg">
9
+ <source media="(prefers-color-scheme: light)" srcset="assets/wordmark-light.svg">
10
+ <img src="assets/wordmark-dark.svg" alt="niti" width="360">
11
+ </picture>
11
12
 
13
+ ### A team of AI coding agents, on any mix of models, working on one project — live in your terminal.
12
14
 
13
15
  <br>
14
16
 
15
- <img src="readme_images/CLI.png" alt="niti's terminal UI — team of 4 agents, live context/token sidebar" width="100%">
17
+ [![npm](https://img.shields.io/npm/v/@slenderbuilds/niti?style=flat-square&color=7aa2d6&label=npm)](https://www.npmjs.com/package/@slenderbuilds/niti)
18
+ [![CI](https://img.shields.io/github/actions/workflow/status/slenderongithub/niti/ci.yml?branch=main&style=flat-square&label=CI&color=8fbf8a)](https://github.com/slenderongithub/niti/actions/workflows/ci.yml)
19
+ [![Platforms](https://img.shields.io/badge/macOS%20·%20Linux%20·%20Windows-2e333d?style=flat-square)](#install)
20
+ [![License: MIT](https://img.shields.io/badge/license-MIT-2e333d?style=flat-square)](#license)
21
+
22
+ **[Install](#install)** &nbsp;·&nbsp; **[The terminal](#the-terminal)** &nbsp;·&nbsp; **[In the browser](#in-the-browser)** &nbsp;·&nbsp; **[Under the hood](#under-the-hood)** &nbsp;·&nbsp; **[Configure](#configure)**
23
+
24
+ <br>
25
+
26
+ <img src="readme_images/cli.png" alt="niti's terminal: a three-agent team, the project's files, and the live transcript" width="100%">
16
27
 
17
28
  </div>
18
29
 
19
- ---
30
+ <br>
20
31
 
21
- ## Quickstart
32
+ ## Install
22
33
 
23
34
  ```sh
24
- npm install -g @slenderbuilds/niti # prebuilt binaries — no Bun, no Go, no build step
25
- niti # pick your team, then start building
35
+ npm install -g @slenderbuilds/niti
36
+ niti
26
37
  ```
27
38
 
28
- > Published as **`@slenderbuilds/niti`** — the unscoped `niti` was rejected by npm's own
29
- > anti-squatting check (too similar to `jiti`/`vite`/others), and it suggested this scope. The
30
- > commands are still `niti` (TUI) and `niti-core` (headless engine); project state still lives
31
- > in `.niti/` — only the install name changed.
39
+ Prebuilt for macOS, Linux and Windows — no Bun, no Go, no build step. On first launch niti asks
40
+ how many teammates you want (1–6) and, for each, a **provider**, a **model**, a **name** and a
41
+ one-line **job**. One of them leads: it turns your request into a plan, the others build it, and
42
+ they talk to each other as they go.
43
+
44
+ Anthropic, OpenAI, Gemini, OpenRouter, DeepSeek, Groq, xAI, Mistral and many more come from the
45
+ [Models.dev](https://models.dev) catalog, alongside local models (Ollama, LM Studio) and any
46
+ OpenAI-compatible endpoint. Keys stay on your machine — `~/.config/niti/auth.json` (mode 0600) and
47
+ your OS keychain.
48
+
49
+ <br>
50
+
51
+ ## What you get
52
+
53
+ <table>
54
+ <tr>
55
+ <td width="50%" valign="top">
56
+
57
+ **A team, not a chatbot**<br>
58
+ Mix models by strength — a careful model to plan, a fast one to build, a cheap one to review. The
59
+ lead plans the work as a dependency graph; independent tasks run at the same time; teammates ask
60
+ each other questions directly.
61
+
62
+ </td>
63
+ <td width="50%" valign="top">
64
+
65
+ **Watch it work**<br>
66
+ Every edit appears as a numbered, syntax-colored diff. Commands stream their output, then fold to a
67
+ one-line result. Each agent's checklist stays pinned. Every run ends with a summary card and a
68
+ suggested next step.
69
+
70
+ </td>
71
+ </tr>
72
+ <tr>
73
+ <td width="50%" valign="top">
74
+
75
+ **Talk to it mid-run**<br>
76
+ Say hello and it says hello — no invented work. Ask a question and it reads the code to answer.
77
+ Anything you type while agents work steers them; <kbd>esc</kbd> stops them at once.
78
+
79
+ </td>
80
+ <td width="50%" valign="top">
81
+
82
+ **Guardrails on by default**<br>
83
+ Approvals before risky actions, a project-scoped sandbox, verification against your own build
84
+ before a task counts as done, undo and rewind for every write, and a check that refuses "fixes"
85
+ that only edited the tests.
86
+
87
+ </td>
88
+ </tr>
89
+ </table>
90
+
91
+ <br>
92
+
93
+ ## The terminal
94
+
95
+ The footer always lists the keys that work where you are, and <kbd>f1</kbd> explains them — along
96
+ with every glyph in the transcript. The ones worth knowing on day one:
32
97
 
33
- On first launch, `niti` opens a picker: how many teammates (1–6), then per teammate — provider,
34
- model, name, and a one-line job description. **29 providers / 152 models** from the
35
- [Models.dev](https://models.dev) catalog, plus local (Ollama/LM Studio) and **Custom** for any
36
- OpenAI-compatible endpoint. Keys live in `~/.config/niti/auth.json` (0600) and your OS keychain —
37
- never a server.
98
+ | Key | |
99
+ |---|---|
100
+ | <kbd>^p</kbd> | Command palette — every command, view, agent and theme, fuzzy-searchable |
101
+ | <kbd>tab</kbd> | Move focus: prompt → transcript → agents → files |
102
+ | <kbd>⇧tab</kbd> | Switch **Build** ↔ **Plan** (plan first, run when you like it) |
103
+ | <kbd>esc</kbd> | While agents work: interrupt them. Anything you type mid-run steers the working agent |
104
+ | <kbd>^o</kbd> | Unfold full command output and whole diffs |
105
+ | <kbd>^l</kbd> | Switch an agent's model |
106
+ | <kbd>^t</kbd> | Theme picker with live preview |
107
+ | <kbd>↑</kbd> · <kbd>^r</kbd> | Recall or search earlier prompts |
108
+ | `@path` · `!cmd` | Mention a project file · run a command right here |
38
109
 
39
- Type `/` for the full command list:
110
+ The **Files** panel marks what the agents touched this session — **M** edited, **A** created,
111
+ **·** read. Open any file read-only with this session's changes marked, or hand it to `$EDITOR`.
40
112
 
41
- <img src="readme_images/commands.png" alt="the / command palette, listing every slash command" width="100%">
113
+ Type <kbd>/</kbd> for every command:
42
114
 
43
- ## Watch it from the browser too
115
+ <img src="readme_images/commands.png" alt="the command list over the running session" width="100%">
116
+
117
+ **Themes** — six calm palettes (graphite, obsidian, ember, tide, dusk, moss), each with a designed
118
+ light version that takes over when you turn on light mode. Or add your own in
119
+ `~/.config/niti/themes/*.json`.
120
+
121
+ <br>
44
122
 
45
- `/dashboard` opens a live control center — agent avatars, message graph, task board, and per-agent
46
- usage, all pushed over SSE as the team works:
123
+ ## In the browser
47
124
 
48
- <img src="readme_images/dashboardniti.png" alt="the web dashboard — live agent graph with task/message/usage panels" width="100%">
125
+ `/dashboard` opens a live control center: the team as a graph, the task board, agent-to-agent
126
+ messages and usage, updated as the work happens. Click an agent to read its transcript, switch its
127
+ model or message it mid-task. Approvals can be answered here too.
49
128
 
50
- `/graph` opens an interactive force-graph — your project's file/import structure, or (toggle to
51
- **Models**) the live agent-to-agent conversation as it happens:
129
+ <img src="readme_images/dashboard.png" alt="the web dashboard: team graph, board and an agent's live transcript" width="100%">
130
+
131
+ `/graph` maps your project's imports — or, in **Models** mode, the team talking in real time.
52
132
 
53
133
  <table>
54
134
  <tr>
55
- <td width="50%"><img src="readme_images/graph1.png" alt="project mode: 137-file dependency graph"></td>
56
- <td width="50%"><img src="readme_images/graph2.png" alt="models mode: live pixel-art agent avatars, message-colored edges"></td>
135
+ <td width="33%"><img src="readme_images/graph-project.png" alt="project mode: every file, colored by directory"></td>
136
+ <td width="33%"><img src="readme_images/graph-focus.png" alt="hovering a file highlights what it imports and what imports it"></td>
137
+ <td width="34%"><img src="readme_images/graph-models.png" alt="models mode: each agent, colored by status"></td>
57
138
  </tr>
58
139
  <tr>
59
- <td>Project mode — every file, colored by directory</td>
60
- <td>Models mode — your team, colored by status, talking in real time</td>
140
+ <td align="center"><sub>Every file, colored by directory</sub></td>
141
+ <td align="center"><sub>Hover to trace a file's imports</sub></td>
142
+ <td align="center"><sub>Models mode: the team, live</sub></td>
61
143
  </tr>
62
144
  </table>
63
145
 
64
- Both pages retheme live with whatever theme (`ctrl+t` / `/theme`) the TUI has active.
146
+ Both pages follow the theme you pick in the terminal.
147
+
148
+ <br>
65
149
 
66
- ## Everything, at a glance
150
+ ## Settings, at a glance
67
151
 
68
- `/settings` (or `tab`) opens Status, Config, Usage, and Stats panes without leaving the session:
152
+ `/settings` opens Status, Config, Usage and Stats without leaving the session.
69
153
 
70
154
  <table>
71
155
  <tr>
72
- <td width="33%"><img src="readme_images/status.png" alt="Status tab — version, team, mode, theme, models"></td>
73
- <td width="33%"><img src="readme_images/usage.png" alt="Usage tab — session cost, tokens, per-agent breakdown"></td>
74
- <td width="34%"><img src="readme_images/stats_models.png" alt="Stats tab — tokens per day, tokens by model"></td>
156
+ <td width="50%"><img src="readme_images/config.png" alt="Config: mode, theme, permissions, thinking, light mode and more"></td>
157
+ <td width="50%"><img src="readme_images/stats_models.png" alt="Stats: tokens per day and by model"></td>
75
158
  </tr>
76
159
  </table>
77
160
 
78
- ## What's actually happening under the hood
79
-
80
- - **Orchestrator DAG** — the lead agent turns your goal into a validated task graph (dependencies +
81
- hand-offs), not a flat queue; independent tasks run concurrently and the lead reviews at the end.
82
- - **Agent-to-agent messaging** — any teammate can `ask_agent`/`send_message` another mid-task (e.g.
83
- frontend asking backend about an API shape), rate-capped per pair as the loop guard.
84
- - **Sandboxed tools** — `read_file` / `write_file` / `edit` / `shell` plus read-only navigation
85
- (`grep` / `glob` / `list_dir`), gated per-agent by `allowedTools` and a wildcard permission
86
- policy; every path is jailed to the project root. Reads are line-numbered and paged, so `grep`'s
87
- `path:line:` output and a read share one coordinate system; independent reads in a turn run
88
- together rather than one round-trip at a time.
89
- - **Project map + ranked context** — a generated outline of the repo (directory shape plus the
90
- files most of the project imports, PageRank over the import graph) rides in the system prompt, so
91
- an agent starts oriented instead of guessing. `repoMap: false` turns it off.
92
- - **Working checklist** — agents write a `todo` list for multi-step tasks, re-stated to the model
93
- whenever it changes so the plan stays recent context instead of something to reconstruct from a
94
- transcript. Scoped to one task; never carried into the next.
95
- - **Per-model steering** — each agent's prompt carries a short addendum for its model family
96
- (`src/agent/steering.ts`). Mechanical only — verbosity, tool-call shape, when to stop. Anything
97
- two agents must agree on stays in the shared guidance, since they message each other across
98
- providers.
99
- - **Reasoning effort** — `reasoning: off|low|medium|high|auto` per agent maps to Gemini's
100
- `thinkingBudget` and OpenAI's `reasoning_effort`. Unset sends nothing; note that Flash and
101
- Flash-Lite do not think at all unless you set it.
102
- - **Verification before "done"** — an agent that changed files must pass the project's own checks
103
- (a `typecheck`/`build` script, `go build`, `cargo check`, or whatever `verify:` names) before it
104
- may report a task complete; failures go back to it as the real compiler output, twice at most.
105
- A task whose checks never pass ends `unverified` rather than `done`, so the DAG never releases
106
- dependents onto a tree that doesn't build.
107
- - **Check-gaming guard** — a green result that arrived only because the agent edited the tests,
108
- the lint config or the check script itself is refused, and the agent is told to revert it and fix
109
- the code. Judged by content, not by touch, so reverting as instructed isn't flagged; and only
110
- ever after a failure, so writing a test in a task that never failed is ordinary work.
111
- - **Objective retry** — an `unverified` task is handed to a *different* model with the check output
112
- attached, before any replan. Best-of-N where the selector is a compiler rather than a judge
113
- model, and where the tasks that were right first time cost nothing extra.
114
- - **Approval gates** — agents pause for `[y] approve · [n] deny · [a] always` before risky actions,
115
- answered from the TUI or the web dashboard; dangerous shell patterns always prompt.
116
- - **Persistence** — every turn checkpoints to SQLite (`.niti/niti.db`); `niti-core resume` picks up
117
- unfinished tasks with history intact. `/undo` and `/rewind` revert file writes.
118
- - **MCP + LSP** — declare `mcpServers`/`lsp` in `agents.yaml`; both merge into the same tool loop,
119
- gated the same way as everything else.
120
- - **Failover** — a 429/overload/context-limit requeues the task instead of failing it; another agent
121
- picks it up.
122
-
123
- See [`project_context.md`](./project_context.md) for the full architecture record, the verification
124
- history, and the deliberate ceilings (what's intentionally out of scope, and why).
125
-
126
- ## Configuring agents
127
-
128
- `niti` rewrites only the `agents:` block on each team pick — everything else survives a relaunch.
129
- Edit `.niti/agents.yaml` directly for anything the picker doesn't cover:
161
+ <br>
162
+
163
+ ## Under the hood
164
+
165
+ - **Talks before it plans** — a greeting gets a reply and a question gets an answer (read-only). Only
166
+ a request to change something becomes a plan, and a follow-up adjusts the unfinished plan instead
167
+ of replacing it. The lead remembers the last few exchanges.
168
+ - **Plans as a graph** — the lead turns a request into tasks with dependencies and hand-offs;
169
+ independent tasks run concurrently, and the lead reviews the result at the end.
170
+ - **Agents talk to each other** — any teammate can ask another mid-task (the frontend asking the
171
+ backend about an API shape), rate-capped per pair.
172
+ - **Starts oriented** — a map of the repository (its layout and the files most of it depends on)
173
+ rides in every agent's prompt, so work begins with context instead of guesses.
174
+ - **Verified before "done"** — an agent that changed files must pass your project's own checks
175
+ (a `typecheck` or `build` script, `go build`, `cargo check`, or whatever `verify:` names). A task
176
+ that never passes ends `unverified`, and is retried on a different model before any replan.
177
+ - **Honest about cost** — prompt caching tuned per provider (Anthropic breakpoints, OpenAI cache
178
+ keys, Gemini implicit caching), reasoning effort per agent, real per-model context windows and
179
+ prices, and thinking tokens counted — see `/cost`.
180
+ - **Guarded tools** — `read_file`, `write_file`, `edit`, `shell` and read-only search, gated per
181
+ agent and by a permission policy; paths are jailed to the project; dangerous commands always ask.
182
+ - **Picks up where you left off** — every turn checkpoints to SQLite; `niti-core resume` continues
183
+ unfinished work, and `/undo` / `/rewind` revert writes.
184
+ - **Extensible** — MCP servers and language servers join the same tool loop, under the same gates.
185
+
186
+ The full architecture record, the verification history and what is deliberately out of scope live
187
+ in [`project_context.md`](./project_context.md).
188
+
189
+ <br>
190
+
191
+ ## Configure
192
+
193
+ The team picker rewrites only the `agents:` block of `.niti/agents.yaml`; everything else is
194
+ yours to edit.
130
195
 
131
196
  ```yaml
132
197
  agents:
133
198
  - id: architect
134
199
  provider: anthropic
135
- model: claude-opus-4-8
200
+ model: claude-opus-5
136
201
  role: Architect
137
202
  lead: true
138
- systemPrompt: You are a software architect. Decompose work into independent subtasks.
203
+ reasoning: high
204
+ systemPrompt: You are a software architect. Plan the work into independent tasks.
139
205
  - id: engineer
140
206
  provider: openai
141
- model: gpt-4o
207
+ model: gpt-5
142
208
  role: Backend Engineer
143
209
  systemPrompt: You are a backend engineer. Implement the assigned task.
144
210
  allowedTools: [read_file, write_file, edit, shell, mcp]
@@ -152,42 +218,41 @@ mcpServers:
152
218
  command: code-review-graph
153
219
  args: [--stdio]
154
220
 
155
- theme: niti # ctrl+t / /theme opens a live carousel, synced to any open dashboard/graph tab
156
- auto: false # approve anything not explicitly denied
157
- maxAgents: 6
221
+ theme: graphite
222
+ auto: false # true: approve anything not explicitly denied
158
223
  ```
159
224
 
160
- Full config reference — permissions resolution order, environment variables, LSP setup — lives in
161
- [`project_context.md`](./project_context.md).
225
+ <br>
162
226
 
163
- ## From source
227
+ ## Build from source
164
228
 
165
229
  Requires [Bun](https://bun.sh) ≥ 1.3 and [Go](https://go.dev) ≥ 1.22.
166
230
 
167
231
  ```sh
168
232
  bun install
169
- bun run build:tui # builds ./niti (the Go TUI)
233
+ bun run build:all # ./niti (terminal UI) and ./niti-core (engine)
170
234
  ./niti
171
235
  ```
172
236
 
173
- Headless / scripting, no interactive terminal needed:
237
+ Headless, for scripts and CI:
174
238
 
175
239
  ```sh
176
240
  bun run src/cli.ts "Build a clothing website for gen-z." # one-shot
177
- bun run src/cli.ts --web "..." # + live web dashboard
178
- bun run src/server/main.ts # headless server, prints its own handshake URL
241
+ bun run src/cli.ts --web "…" # with the live dashboard
179
242
  ```
180
243
 
181
- ## Development
244
+ Tests: `bun test` · `bunx tsc --noEmit` · `cd tui && go test ./...`
182
245
 
183
- ```sh
184
- bun test # TypeScript unit + integration tests
185
- bunx tsc --noEmit # typecheck
186
- cd tui && go build ./... && go vet ./... && go test ./... # Go TUI: build, vet, unit tests
187
- ```
246
+ <br>
188
247
 
189
248
  ## License
190
249
 
191
- MIT.
250
+ MIT
251
+
252
+ <br>
192
253
 
193
- <img src="assets/logo.png" alt="niti logo" width="40">
254
+ <div align="center">
255
+ <img src="assets/logo.png" alt="niti" width="40">
256
+ <br>
257
+ <sub>Built for people who would rather watch their tools work than wonder what they're doing.</sub>
258
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slenderbuilds/niti",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "A terminal CLI that runs multiple AI coding agents from different LLM providers concurrently on one project.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,7 +22,8 @@
22
22
  "build:release": "bun run scripts/build-release.ts",
23
23
  "test": "bun test ./src ./web",
24
24
  "typecheck": "tsc --noEmit",
25
- "gen:catalog": "bun run scripts/gen-catalog.ts"
25
+ "gen:catalog": "bun run scripts/gen-catalog.ts",
26
+ "bump": "bun run scripts/bump-version.ts"
26
27
  },
27
28
  "engines": {
28
29
  "node": ">=18"
@@ -53,11 +54,11 @@
53
54
  "access": "public"
54
55
  },
55
56
  "optionalDependencies": {
56
- "niti-darwin-arm64": "0.3.2",
57
- "niti-darwin-x64": "0.3.2",
58
- "niti-linux-arm64": "0.3.2",
59
- "niti-linux-x64": "0.3.2",
60
- "niti-win32-x64": "0.3.2"
57
+ "niti-darwin-arm64": "0.4.0",
58
+ "niti-darwin-x64": "0.4.0",
59
+ "niti-linux-arm64": "0.4.0",
60
+ "niti-linux-x64": "0.4.0",
61
+ "niti-win32-x64": "0.4.0"
61
62
  },
62
63
  "devDependencies": {
63
64
  "@anthropic-ai/sdk": "^0.115.0",