cmdr-agent 2.5.3 → 2.5.5

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.
package/README.md CHANGED
@@ -1,252 +1,129 @@
1
- # cmdr
1
+ <div align="center">
2
2
 
3
- [![CI](https://github.com/reyyanxahmed/cmdr/actions/workflows/ci.yml/badge.svg)](https://github.com/reyyanxahmed/cmdr/actions/workflows/ci.yml)
4
- [![npm](https://img.shields.io/npm/v/cmdr-agent)](https://www.npmjs.com/package/cmdr-agent)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
6
-
7
- > Open-source, Ollama-native, multi-agent coding tool for your terminal.
8
-
9
- ```
3
+ <pre>
10
4
  ██████╗███╗ ███╗██████╗ ██████╗
11
5
  ██╔════╝████╗ ████║██╔══██╗██╔══██╗
12
6
  ██║ ██╔████╔██║██║ ██║██████╔╝
13
7
  ██║ ██║╚██╔╝██║██║ ██║██╔══██╗
14
8
  ╚██████╗██║ ╚═╝ ██║██████╔╝██║ ██║
15
9
  ╚═════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝
16
- ```
10
+ </pre>
17
11
 
18
- **cmdr** is a local-first AI coding assistant that runs entirely on your machine using [Ollama](https://ollama.ai). No API keys, no cloud, no data leaves your laptop.
19
-
20
- ## Features
21
-
22
- - **Local-first** — powered by Ollama, all inference runs on your hardware
23
- - **Multi-agent architecture** — extensible agent/runner pipeline with tool calling
24
- - **Interactive REPL** — streaming output, markdown rendering, AMOLED-friendly theme
25
- - **Built-in tools** — file read/write/edit, glob, grep, bash, git diff/log/commit/branch, web fetch, think
26
- - **HITL permissions** — approve, deny, or always-allow each tool call
27
- - **Context compaction** — multi-stage strategy keeps conversations within context limits
28
- - **Session persistence** — auto-save, resume, and `--continue` flag
29
- - **Token cost tracking** — `/cost` command shows per-session usage breakdown
30
- - **Undo** — `/undo` reverts file changes made by the agent
31
- - **Multi-agent teams** — built-in presets: code review, full-stack, security audit
32
- - **Plugin system** — load custom plugins from npm modules or local paths
33
- - **MCP client** — connect to Model Context Protocol servers for extended tools
34
- - **Project awareness** — auto-detects language, framework, and reads `CMDR.md` instructions
35
- - **Whimsical UX** — 150+ spinner verbs, past-tense summaries, collapsed tool output
12
+ **Local-first, multi-agent AI coding in your terminal.**
36
13
 
37
- ## Quick Start
38
-
39
- ```bash
40
- # Install Ollama (https://ollama.ai)
41
- ollama pull qwen3-coder:latest
42
-
43
- # Install cmdr
44
- npm install -g cmdr-agent
14
+ [![CI](https://github.com/reyyanxahmed/cmdr/actions/workflows/ci.yml/badge.svg)](https://github.com/reyyanxahmed/cmdr/actions/workflows/ci.yml)
15
+ [![npm](https://img.shields.io/npm/v/cmdr-agent)](https://www.npmjs.com/package/cmdr-agent)
16
+ [![npm downloads](https://img.shields.io/npm/dw/cmdr-agent)](https://www.npmjs.com/package/cmdr-agent)
17
+ [![GitHub stars](https://img.shields.io/github/stars/reyyanxahmed/cmdr?style=social)](https://github.com/reyyanxahmed/cmdr)
18
+ [![Lines of Code](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/reyyanxahmed/cmdr/main/.github/badges/loc.json)](https://github.com/reyyanxahmed/cmdr)
19
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
45
20
 
46
- # Start coding
47
- cmdr
48
- ```
21
+ [Getting Started](docs/getting-started.md) · [Usage](docs/usage.md) · [Configuration](docs/configuration.md) · [Benchmarks](docs/benchmarks.md)
49
22
 
50
- ## Usage
23
+ </div>
51
24
 
52
- ```bash
53
- cmdr # Interactive REPL
54
- cmdr "fix the failing tests" # Single prompt, then exit
55
- cmdr -m llama3.1:8b # Use a specific model
56
- cmdr -c # Continue most recent session
57
- cmdr --resume <session-id> # Resume a specific session
58
- cmdr --team review # Multi-agent code review team
59
- cmdr --cwd /path/to/project # Override working directory
60
- ```
25
+ ---
61
26
 
62
- ### CLI Flags
27
+ ## What is cmdr?
63
28
 
64
- | Flag | Description |
65
- |------|-------------|
66
- | `-m, --model <name>` | Set the Ollama model |
67
- | `-u, --ollama-url <url>` | Ollama server URL |
68
- | `-p, --prompt <text>` | Run a single prompt and exit |
69
- | `-r, --resume <id>` | Resume a previous session |
70
- | `-c, --continue` | Resume most recent session for this directory |
71
- | `-t, --team <preset>` | Run with a multi-agent team (review, fullstack, security) |
72
- | `--cwd <path>` | Set working directory |
73
- | `--verbose` | Print full tool output |
74
- | `--dangerously-skip-permissions` | Auto-approve all tool calls |
75
- | `--max-turns <n>` | Limit agent tool-call turns |
76
- | `-h, --help` | Show help |
77
- | `-v, --version` | Show version |
78
-
79
- ### Slash Commands
80
-
81
- | Command | Description |
82
- |---------|-------------|
83
- | `/help` | Show available commands |
84
- | `/model <name>` | Switch model |
85
- | `/models` | List available Ollama models |
86
- | `/status` | Show session info |
87
- | `/context` | Show context window usage |
88
- | `/compact` | Manually trigger compaction |
89
- | `/cost` | Show token usage breakdown |
90
- | `/undo` | Revert the last file change made by the agent |
91
- | `/diff` | Show git diff |
92
- | `/team [preset]` | Switch to a multi-agent team |
93
- | `/agents` | Show active agents and status |
94
- | `/tasks` | Show task queue status |
95
- | `/config` | View configuration |
96
- | `/plugin list` | List loaded plugins |
97
- | `/mcp list` | List MCP server connections |
98
- | `/session save` | Save current session |
99
- | `/session resume <id>` | Resume a session |
100
- | `/sessions` | List saved sessions |
101
- | `/permissions [mode]` | View/set permission mode |
102
- | `/init` | Create CMDR.md template |
103
- | `/clear` | Clear conversation |
104
- | `/quit` | Exit |
105
-
106
- ### Built-in Tools
107
-
108
- | Tool | Description |
109
- |------|-------------|
110
- | `bash` | Execute shell commands with timeout and error handling |
111
- | `file_read` | Read file contents with offset/limit support |
112
- | `file_write` | Create or overwrite files (auto-creates directories) |
113
- | `file_edit` | Surgical string replacement in files |
114
- | `grep` | Regex search (uses ripgrep when available) |
115
- | `glob` | Find files by pattern |
116
- | `git_diff` | Show working tree or staged changes |
117
- | `git_log` | Recent commit history |
118
- | `git_commit` | Stage and commit files |
119
- | `git_branch` | Create, switch, or list branches |
120
- | `web_fetch` | Fetch a URL (SSRF-protected) |
121
- | `ask_user` | Ask the user a question |
122
- | `think` | Extended reasoning scratchpad (no side effects) |
123
-
124
- ## Multi-Agent Teams
125
-
126
- cmdr supports multi-agent collaboration with built-in presets:
29
+ **cmdr** is an AI coding assistant that runs **entirely on your machine** using [Ollama](https://ollama.ai). No API keys, no cloud, no data leaves your laptop.
127
30
 
128
31
  ```bash
129
- cmdr --team review # Coder + Reviewer
130
- cmdr --team fullstack # Planner + Frontend + Backend + Reviewer
131
- cmdr --team security # Security Scanner + Reviewer
132
- ```
133
-
134
- Or switch teams mid-session with `/team review`.
135
-
136
- Each agent has its own system prompt, tool access, and optional model. Results flow through shared memory so downstream agents see what upstream agents produced.
137
-
138
- ## Plugins & MCP
139
-
140
- Load plugins from npm modules or local paths in `~/.cmdr/config.toml`:
141
-
142
- ```toml
143
- plugins = ["cmdr-plugin-prettier", "./my-local-plugin.js"]
144
-
145
- [[mcp.servers]]
146
- name = "my-tools"
147
- url = "http://localhost:8080"
32
+ npm install -g cmdr-agent
33
+ cmdr
148
34
  ```
149
35
 
150
- Plugins can provide tools, slash commands, and lifecycle hooks (beforePrompt, afterResponse, onError, etc.).
36
+ ## Contents
151
37
 
152
- MCP servers are discovered via the `/tools` endpoint and their tools are registered with a `mcp_` prefix.
38
+ - [Screenshots](#screenshots)
39
+ - [Highlights](#highlights)
40
+ - [Quick Start](#quick-start)
41
+ - [Documentation](#documentation)
42
+ - [Contributing](#contributing)
43
+ - [License](#license)
153
44
 
154
- ## CMDR.md
45
+ ## Screenshots
155
46
 
156
- Create a `CMDR.md` file in your project root to give cmdr project-specific instructions:
47
+ <p align="center">
48
+ <img src="screenshots/welcome.png" alt="cmdr on npm — 1,800+ weekly downloads" width="700">
49
+ <br>
50
+ <em>Published on npm with 1,800+ weekly downloads</em>
51
+ </p>
157
52
 
158
- ```markdown
159
- # CMDR Instructions
53
+ <details>
54
+ <summary><strong>More screenshots</strong></summary>
55
+ <br>
160
56
 
161
- ## Project Overview
162
- A TypeScript web app using Next.js and Prisma.
57
+ <p align="center">
58
+ <img src="screenshots/interactive-repl.png" alt="Interactive model picker" width="700">
59
+ <br>
60
+ <em>Interactive model picker — choose from your locally available Ollama models on startup</em>
61
+ </p>
163
62
 
164
- ## Code Style
165
- - Use bun instead of npm
166
- - Prefer functional components with hooks
167
- - Always add JSDoc comments
168
-
169
- ## Testing
170
- Run `vitest` after every change.
171
-
172
- ## Rules
173
- - Never modify files in /core without asking
174
- - Always run linting before committing
175
- ```
63
+ <p align="center">
64
+ <img src="screenshots/tool-calling.png" alt="Welcome banner and session dashboard" width="700">
65
+ <br>
66
+ <em>Session dashboard with model info, permission mode, status bar, and operator boot sequence</em>
67
+ </p>
176
68
 
177
- You can also use `.cmdr/instructions.md` — both files are loaded and concatenated.
69
+ <p align="center">
70
+ <img src="screenshots/status-bar.png" alt="Context window usage breakdown" width="700">
71
+ <br>
72
+ <em>Real-time context window tracking — see token usage, remaining capacity, and per-component breakdown</em>
73
+ </p>
178
74
 
179
- ## Permission Modes
75
+ </details>
180
76
 
181
- - **normal** (default) — read-only tools auto-approved, write/bash require confirmation
182
- - **yolo** — all tools auto-approved (use `--dangerously-skip-permissions`)
183
- - **strict** — all tools require approval (`/permissions strict`)
77
+ ## Highlights
184
78
 
185
- ## Configuration
79
+ | | Feature | |
80
+ |---|---|---|
81
+ | 🔒 | **Local-first** | All inference on your hardware via Ollama |
82
+ | 🤖 | **Multi-agent teams** | Code review, full-stack, security audit presets |
83
+ | 🛠 | **13 built-in tools** | Files, grep, glob, bash, git, web fetch, think |
84
+ | ✅ | **Human-in-the-loop** | Approve, deny, or always-allow each tool call |
85
+ | 🧠 | **Context compaction** | Multi-stage strategy keeps long conversations in bounds |
86
+ | 🔌 | **Plugins & MCP** | Extend with npm modules or Model Context Protocol servers |
87
+ | 💾 | **Session persistence** | Auto-save, resume, `--continue` |
88
+ | ↩️ | **Undo** | `/undo` reverts any file change the agent made |
89
+ | 📊 | **Token tracking** | `/cost` for per-session usage breakdown |
90
+ | 📁 | **Project awareness** | Reads `CMDR.md` for project-specific instructions |
186
91
 
187
- cmdr reads config from `~/.cmdr/config.toml` (user) and `.cmdr.toml` (project):
92
+ ## Quick Start
188
93
 
189
- ```toml
190
- defaultModel = "qwen3-coder:latest"
191
- ollamaUrl = "http://localhost:11434"
94
+ ```bash
95
+ # 1. Install Ollama — https://ollama.ai
96
+ ollama pull qwen3-coder:latest
192
97
 
193
- [spinner]
194
- speed = 150
98
+ # 2. Install cmdr
99
+ npm install -g cmdr-agent
195
100
 
196
- [telemetry]
197
- enabled = false # opt-in local-only usage stats
101
+ # 3. Go
102
+ cmdr
198
103
  ```
199
104
 
200
- ### Environment Variables
201
-
202
- | Variable | Default | Description |
203
- |----------|---------|-------------|
204
- | `CMDR_MODEL` | `qwen2.5-coder:14b` | Default model |
205
- | `CMDR_OLLAMA_URL` | `http://localhost:11434` | Ollama server URL |
206
-
207
- ## Benchmark Results
208
-
209
- ### Custom Eval Suite (50 tasks, 4 tiers)
210
-
211
- | Model | Pass Rate | Score | Grade |
212
- |---|---|---|---|
213
- | qwen3-coder:latest (14B) | 42/50 (84%) | ~160/197 | **S** |
214
-
215
- Grade A at 38/50 (71.6%) after the v1.3.0 system prompt rewrite alone (+8 tasks, +19pp from v1.2). Verify script hardening pushed it to 42/50.
216
-
217
- ### HumanEval (164 tasks, pass@1)
218
-
219
- | Model | pass@1 | Passed |
220
- |---|---|---|
221
- | minimax-m2.5:cloud | **95.7%** | 157/164 |
222
-
223
- All benchmarks run through cmdr's eval harness on local hardware (Ollama). No cloud inference for the custom eval suite.
105
+ ```bash
106
+ # One-shot mode
107
+ cmdr "fix the failing tests"
224
108
 
225
- ## Architecture
109
+ # Pick a model
110
+ cmdr -m llama3.1:8b
226
111
 
227
- ```
228
- bin/cmdr.ts CLI entry point
229
- src/
230
- cli/ REPL, commands, args, spinner, theme, renderer
231
- core/ Agent, AgentRunner, Orchestrator, Team, presets, permissions
232
- communication/ MessageBus, SharedMemory, TaskQueue
233
- scheduling/ Semaphore, agent selection strategies
234
- config/ Config loader, schema, telemetry
235
- llm/ OllamaAdapter, model registry, token counter
236
- plugins/ PluginManager, McpClient
237
- session/ SessionManager, compaction, persistence, cost tracker, undo
238
- tools/ ToolRegistry, ToolExecutor, built-in tools
112
+ # Multi-agent review
113
+ cmdr --team review
239
114
  ```
240
115
 
241
- ## Development
116
+ ## Documentation
242
117
 
243
- ```bash
244
- git clone https://github.com/reyyanxahmed/cmdr.git
245
- cd cmdr
246
- npm install
247
- npm run build
248
- node dist/bin/cmdr.js -m qwen3-coder:latest
249
- ```
118
+ | Page | Description |
119
+ |------|-------------|
120
+ | [Getting Started](docs/getting-started.md) | Installation, first run, verify |
121
+ | [Usage](docs/usage.md) | CLI flags, slash commands, built-in tools |
122
+ | [Multi-Agent Teams](docs/multi-agent.md) | Team presets and orchestration |
123
+ | [Plugins & MCP](docs/plugins.md) | Plugin system and MCP integration |
124
+ | [Configuration](docs/configuration.md) | Config files, env vars, permissions, CMDR.md |
125
+ | [Benchmarks](docs/benchmarks.md) | Eval suite and HumanEval results |
126
+ | [Architecture](docs/architecture.md) | Project structure and development setup |
250
127
 
251
128
  ## Contributing
252
129
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmdr-agent",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
4
4
  "description": "Open-source multi-agent coding tool for your terminal. Powered by Ollama.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,6 +27,6 @@ export declare class AgentExecutor {
27
27
  * @param adapter — The LLM adapter to use
28
28
  * @param parentToolRegistry — The parent's full tool registry (we pick allowed tools)
29
29
  */
30
- execute(definition: AgentDefinition, task: string, parentModel: string, adapter: LLMAdapter, parentToolRegistry: ToolRegistry): Promise<SubagentResult>;
30
+ execute(definition: AgentDefinition, task: string, parentModel: string, adapter: LLMAdapter, parentToolRegistry: ToolRegistry, metadata?: Readonly<Record<string, unknown>>): Promise<SubagentResult>;
31
31
  }
32
32
  //# sourceMappingURL=executor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/agents/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7C,KAAK,EAAE,MAAM,CAAA;CACd;AAED,qBAAa,aAAa;IACxB;;;;;;;;OAQG;IACG,OAAO,CACX,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,UAAU,EACnB,kBAAkB,EAAE,YAAY,GAC/B,OAAO,CAAC,cAAc,CAAC;CAkC3B"}
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/agents/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7C,KAAK,EAAE,MAAM,CAAA;CACd;AAED,qBAAa,aAAa;IACxB;;;;;;;;OAQG;IACG,OAAO,CACX,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,UAAU,EACnB,kBAAkB,EAAE,YAAY,EAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAC3C,OAAO,CAAC,cAAc,CAAC;CAqC3B"}
@@ -18,7 +18,7 @@ export class AgentExecutor {
18
18
  * @param adapter — The LLM adapter to use
19
19
  * @param parentToolRegistry — The parent's full tool registry (we pick allowed tools)
20
20
  */
21
- async execute(definition, task, parentModel, adapter, parentToolRegistry) {
21
+ async execute(definition, task, parentModel, adapter, parentToolRegistry, metadata) {
22
22
  // 1. Create a restricted ToolRegistry with only the agent's allowed tools
23
23
  const agentTools = new ToolRegistry();
24
24
  for (const toolName of definition.tools) {
@@ -34,7 +34,7 @@ export class AgentExecutor {
34
34
  tools: definition.tools,
35
35
  maxTurns: definition.maxTurns,
36
36
  temperature: definition.temperature,
37
- }, adapter, agentTools);
37
+ }, adapter, agentTools, undefined, undefined, metadata);
38
38
  // 3. Run to completion, collecting all text output
39
39
  const result = await agent.run(task);
40
40
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/agents/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AASnD,MAAM,OAAO,aAAa;IACxB;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,CACX,UAA2B,EAC3B,IAAY,EACZ,WAAmB,EACnB,OAAmB,EACnB,kBAAgC;QAEhC,0EAA0E;QAC1E,MAAM,UAAU,GAAG,IAAI,YAAY,EAAE,CAAA;QACrC,KAAK,MAAM,QAAQ,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;YACxC,MAAM,IAAI,GAAG,kBAAkB,CAAC,GAAG,C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,eAAe,EAC3B,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,UAAU,EACnB,kBAAkB,EAAE,YAAY;;GAoBjC"}
1
+ {"version":3,"file":"subagent-tool.d.ts","sourceRoot":"","sources":["../../../src/agents/subagent-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,UAAU,EACnB,kBAAkB,EAAE,YAAY;;GAqBjC"}
@@ -28,7 +28,7 @@ export function createSubagentTool(definition, executor, adapter, parentToolRegi
28
28
  }),
29
29
  execute: async (input, context) => {
30
30
  const parentModel = context.agent.model;
31
- const result = await executor.execute(definition, input.task, parentModel, adapter, parentToolRegistry);
31
+ const result = await executor.execute(definition, input.task, parentModel, adapter, parentToolRegistry, context.metadata);
32
32
  return { data: result.output, isError: false };
33
33
  },
34
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-tool.js","sourceRoot":"","sources":["../../../src/agents/subagent-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAMjD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAA2B,EAC3B,QAAuB,EACvB,OAAmB,EACnB,kBAAgC;IAEhC,OAAO,UAAU,CAAC;QAChB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,WAAW,EAAE,UAAU,CAAC,WAAW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C,IAAI,EACV,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,OAAO,CAAC,QAAQ,CACjB,CAAA;YACD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;QAChD,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -43,6 +43,7 @@ export interface InkAppProps {
43
43
  autoSaver: DebouncedSaver;
44
44
  version?: string;
45
45
  gitBranch?: string;
46
+ welcomeBanner?: string;
46
47
  }
47
48
  export default function App(props: InkAppProps): React.ReactElement;
48
49
  //# sourceMappingURL=App.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink/App.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAA4D,MAAM,OAAO,CAAA;AAGhF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAkE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACjI,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAI9D,OAAO,EACsD,cAAc,EAC1E,MAAM,sCAAsC,CAAA;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AA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,CAAC,IAAI,CAAC,CAAA;IAC3B,SAAS,EAAE,cAAc,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAoED,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CA8jClE"}
@@ -108,7 +108,12 @@ export default function App(props) {
108
108
  const { agent, session, permissionManager, adapter, orchestrator, costTracker, undoManager, pluginManager, mcpClient, toolRegistry, agentRegistry, commandLoader, taskScheduler, ollamaUrl, verbose, doSave, autoSaver, } = props;
109
109
  const { exit } = useApp();
110
110
  const [state, setState] = useState('idle');
111
- const [outputLines, setOutputLines] = useState([]);
111
+ const [outputLines, setOutputLines] = useState(() => {
112
+ if (props.welcomeBanner) {
113
+ return props.welcomeBanner.split('\n').map(text => ({ id: nextId(), text }));
114
+ }
115
+ return [];
116
+ });
112
117
  const [historyScrollOffset, setHistoryScrollOffset] = useState(0);
113
118
  const [spinnerText, setSpinnerText] = useState('');
114
119
  const [approval, setApproval] = useState(null);
@@ -157,7 +162,6 @@ export default function App(props) {
157
162
  appendLines(prefixed);
158
163
  }, [appendLines]);
159
164
  const terminalRows = process.stdout.rows || 42;
160
- const hasTranscript = outputLines.length > 0 || state !== 'idle';
161
165
  const reservedRows = state === 'idle' ? 9 : state === 'waiting_approval' ? 13 : 6;
162
166
  const historyWindowSize = Math.max(8, terminalRows - reservedRows);
163
167
  const visibleOutputLines = useMemo(() => {
@@ -1069,7 +1073,7 @@ export default function App(props) {
1069
1073
  // ---------------------------------------------------------------------------
1070
1074
  // Render
1071
1075
  // ---------------------------------------------------------------------------
1072
- return (_jsxs(Box, { flexDirection: "column", height: hasTranscript ? terminalRows : undefined, children: [_jsx(Box, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children: visibleOutputLines.map((line) => (_jsx(Text, { children: line.text }, line.id))) }), historyScrollOffset > 0 && (_jsx(Text, { children: ` ${DIM('Scrollback')} ${WHITE(String(historyScrollOffset))} ${DIM('(PgUp/PgDn, Esc to jump to live)')}` })), state === 'processing' && spinnerText && (_jsx(Text, { children: spinnerText })), state === 'waiting_approval' && approval && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: '' }), _jsx(Text, { children: ` ${YELLOW('⚠')} ${WHITE('Tool approval required')} ${DIM('[')}${approval.riskLevel === 'dangerous' ? RED(approval.riskLevel.toUpperCase()) : YELLOW(approval.riskLevel.toUpperCase())}${DIM(']')}` }), _jsx(Text, { children: ` ${DIM('Tool:')} ${CYAN(approval.toolName)}` }), Object.entries(approval.input).map(([key, val]) => {
1076
+ return (_jsxs(Box, { flexDirection: "column", height: terminalRows, children: [_jsx(Box, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children: visibleOutputLines.map((line) => (_jsx(Text, { children: line.text }, line.id))) }), historyScrollOffset > 0 && (_jsx(Text, { children: ` ${DIM('Scrollback')} ${WHITE(String(historyScrollOffset))} ${DIM('(PgUp/PgDn, Esc to jump to live)')}` })), state === 'processing' && spinnerText && (_jsx(Text, { children: spinnerText })), state === 'waiting_approval' && approval && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: '' }), _jsx(Text, { children: ` ${YELLOW('⚠')} ${WHITE('Tool approval required')} ${DIM('[')}${approval.riskLevel === 'dangerous' ? RED(approval.riskLevel.toUpperCase()) : YELLOW(approval.riskLevel.toUpperCase())}${DIM(']')}` }), _jsx(Text, { children: ` ${DIM('Tool:')} ${CYAN(approval.toolName)}` }), Object.entries(approval.input).map(([key, val]) => {
1073
1077
  const display = typeof val === 'string'
1074
1078
  ? val.length > 120 ? val.slice(0, 120) + DIM('...') : val
1075
1079
  : JSON.stringify(val).slice(0, 120);