@hncode/hncode 0.1.0 → 0.1.1

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 (3) hide show
  1. package/README.md +340 -330
  2. package/package.json +9 -1
  3. package/TODO.md +0 -72
package/README.md CHANGED
@@ -1,330 +1,340 @@
1
- # hncode — AI Coding Agent CLI
2
-
3
- > **这是我 Vibe Coding 的产物,可能不是特别好,但是如果有什么建议的话也欢迎提 issue**
4
-
5
- A cyan-blue TUI coding agent inspired by kimi-code-cli, with OpenAI + Anthropic support, MCP-style toolbelt, and intelligent context management.
6
-
7
- ---
8
-
9
- ## 🌟 Features
10
-
11
- - **Cyan-blue TUI**: Raw terminal renderer for perfect Windows Terminal compatibility
12
- - **Dual Protocol Support**: Works with both OpenAI-compatible APIs and Anthropic
13
- - **Smart Context Management**: Auto-compaction at 85% usage, AI-summarized history retention
14
- - **MCP-style Toolbelt**: Read, Write, Edit, Bash, Glob, Grep, TodoList, WebSearch, etc.
15
- - **Plugin System**: Extend with custom tools, commands, and hooks
16
- - **Session Persistence**: Resume conversations across sessions
17
- - **Permission Modes**: Ask, YOLO, or Auto modes for different workflows
18
-
19
- ---
20
-
21
- ## 🚀 Installation
22
-
23
- ```bash
24
- npm install -g hncode
25
- ```
26
-
27
- Or use directly:
28
- ```bash
29
- npx hncode
30
- ```
31
-
32
- ---
33
-
34
- ## ⚙️ Configuration
35
-
36
- Create `~/.hncode/config.toml`:
37
-
38
- ```toml
39
- default_model = "gpt-4o-mini"
40
-
41
- [providers.openai]
42
- base_url = "https://api.openai.com/v1"
43
- api_key = "your-api-key-here"
44
-
45
- [models.gpt-4o-mini]
46
- provider = "openai"
47
- model = "gpt-4o-mini"
48
- ```
49
-
50
- Or set environment variables:
51
- ```bash
52
- export HNCODE_API_KEY="your-key"
53
- export HNCODE_PROVIDER="openai"
54
- export HNCODE_MODEL="gpt-4o-mini"
55
- ```
56
-
57
- ---
58
-
59
- ## 📖 Usage
60
-
61
- ### Basic Commands
62
-
63
- ```bash
64
- # Start interactive session
65
- hncode
66
-
67
- # Headless mode (one prompt)
68
- hncode -p "Fix the bug in src/main.js"
69
-
70
- # Continue previous session
71
- hncode --continue
72
-
73
- # Auto mode (no questions)
74
- hncode --auto
75
- ```
76
-
77
- ### Slash Commands
78
-
79
- | Command | Description |
80
- |---------|-------------|
81
- | `/compact [ratio]` | Compact conversation (AI summary + keep last 20%) |
82
- | `/model <name>` | Switch LLM model |
83
- | `/sessions` | Browse and resume past conversations |
84
- | `/move <path>` | Move current session to another directory |
85
- | `/auto` / `/ask` / `/yolo` | Toggle permission mode |
86
- | `/plan` / `/focus` | Toggle research-only or full-edit mode |
87
- | `/calm-mode` | Terse replies (skip narration) |
88
- | `/help` | Show all commands |
89
-
90
- ### Advanced Features
91
-
92
- **Tab Completion**:
93
- - Type `/` → command menu
94
- - Type `@` → file/folder completion
95
- - Use Tab to navigate and Enter to select
96
-
97
- **Auto Compaction**:
98
- - Triggers at 85% context window
99
- - AI summarizes dropped messages
100
- - Keeps most recent 20% of conversation
101
-
102
- **Plugin System**:
103
- Place plugins in `~/.hncode/plugins/`:
104
- ```javascript
105
- // my-plugin.mjs
106
- export function install(api) {
107
- api.registerTool({ /* ... */ });
108
- api.registerCommand({ name: 'mycmd', run: () => {} });
109
- }
110
- export default { name: 'my-plugin', version: '1.0.0' };
111
- ```
112
-
113
- ---
114
-
115
- ## 🛠 Tools
116
-
117
- Built-in tools include:
118
- - `Read`, `Write`, `Edit` - File operations
119
- - `Bash` - Execute shell commands
120
- - `Glob`, `Grep` - Search files
121
- - `TodoList`, `TaskOutput` - Task management
122
- - `FetchURL`, `WebSearch` - Internet access
123
- - `ReadMediaFile`, `FileLines` - Media handling
124
-
125
- ---
126
-
127
- ## 🎨 Theme
128
-
129
- Supported themes: `auto`, `dark`, `light`, or custom RGB colors.
130
-
131
- Set via config:
132
- ```toml
133
- theme = "dark"
134
- ```
135
-
136
- Or `/theme <name>` in TUI.
137
-
138
- ---
139
-
140
- ## 🤝 Contributing
141
-
142
- This project was created through Vibe Coding. While it may not be perfect, I welcome your feedback!
143
-
144
- **Please feel free to:**
145
- - Submit issues for bugs or suggestions
146
- - Fork and create pull requests
147
- - Share your experience using hncode
148
-
149
- ---
150
-
151
- ## 🙏 Acknowledgments
152
-
153
- hncode draws inspiration from several excellent projects:
154
-
155
- - **[kimi-code-cli](https://github.com/mckaymatt/kimi-code-cli)** - The original cyan-blue TUI coding agent that inspired this project's design and approach
156
- - **[claude-code](https://github.com/anthropics/claude-code)** - The conversation flow and tool interaction patterns
157
-
158
- Special thanks to the communities behind these projects for pushing the boundaries of AI-assisted coding.
159
-
160
- ---
161
-
162
- ## 📄 License
163
-
164
- MIT License - See LICENSE file for details.
165
-
166
- ---
167
-
168
- # hncode — AI 编程助手命令行工具
169
-
170
- > **这是我 Vibe Coding 的产物,可能不是特别好,但是如果有什么建议的话也欢迎提 issue**
171
-
172
- 一个青色蓝调终端界面的 AI 编程助手,灵感来自 kimi-code-cli,支持 OpenAI 和 Anthropic API,配备 MCP 风格的工具集和智能上下文管理。
173
-
174
- ---
175
-
176
- ## 🌟 功能特性
177
-
178
- - **青色蓝调 TUI**: 原生终端渲染器,完美兼容 Windows Terminal
179
- - **双协议支持**: 同时支持 OpenAI 兼容 API 和 Anthropic
180
- - **智能上下文管理**: 85% 使用率时自动压缩,AI 摘要保留历史对话
181
- - **MCP 风格工具集**: Read、Write、Edit、Bash、Glob、Grep、TodoList、WebSearch 等
182
- - **插件系统**: 通过自定义工具、命令和钩子扩展功能
183
- - **会话持久化**: 跨会话恢复对话
184
- - **权限模式**: Ask、YOLO、Auto 三种工作流模式
185
-
186
- ---
187
-
188
- ## 🚀 安装
189
-
190
- ```bash
191
- npm install -g hncode
192
- ```
193
-
194
- 或直接使用:
195
- ```bash
196
- npx hncode
197
- ```
198
-
199
- ---
200
-
201
- ## ⚙️ 配置
202
-
203
- 创建 `~/.hncode/config.toml`:
204
-
205
- ```toml
206
- default_model = "gpt-4o-mini"
207
-
208
- [providers.openai]
209
- base_url = "https://api.openai.com/v1"
210
- api_key = "你的-api-key"
211
-
212
- [models.gpt-4o-mini]
213
- provider = "openai"
214
- model = "gpt-4o-mini"
215
- ```
216
-
217
- 或使用环境变量:
218
- ```bash
219
- export HNCODE_API_KEY="你的-key"
220
- export HNCODE_PROVIDER="openai"
221
- export HNCODE_MODEL="gpt-4o-mini"
222
- ```
223
-
224
- ---
225
-
226
- ## 📖 使用方法
227
-
228
- ### 基本命令
229
-
230
- ```bash
231
- # 启动交互式会话
232
- hncode
233
-
234
- # 无头模式(单次提示)
235
- hncode -p "修复 src/main.js 中的 bug"
236
-
237
- # 继续之前的会话
238
- hncode --continue
239
-
240
- # 自动模式(不问问题)
241
- hncode --auto
242
- ```
243
-
244
- ### 斜杠命令
245
-
246
- | 命令 | 描述 |
247
- |------|------|
248
- | `/compact [ratio]` | 压缩对话(AI 摘要 + 保留最近 20%) |
249
- | `/model <name>` | 切换 LLM 模型 |
250
- | `/sessions` | 浏览和恢复过往对话 |
251
- | `/move <path>` | 将当前会话迁移到另一个目录 |
252
- | `/auto` / `/ask` / `/yolo` | 切换权限模式 |
253
- | `/plan` / `/focus` | 切换仅研究或完整编辑模式 |
254
- | `/calm-mode` | 简洁回复(跳过叙述) |
255
- | `/help` | 显示所有命令 |
256
-
257
- ### 高级功能
258
-
259
- **Tab 补全**:
260
- - 输入 `/` → 命令菜单
261
- - 输入 `@` → 文件/文件夹补全
262
- - 使用 Tab 导航,Enter 选择
263
-
264
- **自动压缩**:
265
- - 在 85% 上下文窗口时触发
266
- - AI 摘要被丢弃的消息
267
- - 保留最近 20% 的对话
268
-
269
- **插件系统**:
270
- 将插件放在 `~/.hncode/plugins/`:
271
- ```javascript
272
- // my-plugin.mjs
273
- export function install(api) {
274
- api.registerTool({ /* ... */ });
275
- api.registerCommand({ name: 'mycmd', run: () => {} });
276
- }
277
- export default { name: 'my-plugin', version: '1.0.0' };
278
- ```
279
-
280
- ---
281
-
282
- ## 🛠 内置工具
283
-
284
- - `Read`, `Write`, `Edit` - 文件操作
285
- - `Bash` - 执行 Shell 命令
286
- - `Glob`, `Grep` - 搜索文件
287
- - `TodoList`, `TaskOutput` - 任务管理
288
- - `FetchURL`, `WebSearch` - 网络访问
289
- - `ReadMediaFile`, `FileLines` - 媒体处理
290
-
291
- ---
292
-
293
- ## 🎨 主题
294
-
295
- 支持的 theme:`auto`、`dark`、`light` 或自定义 RGB 颜色。
296
-
297
- 通过配置设置:
298
- ```toml
299
- theme = "dark"
300
- ```
301
-
302
- 或在 TUI 中使用 `/theme <name>`。
303
-
304
- ---
305
-
306
- ## 🤝 贡献
307
-
308
- 这个项目是通过 Vibe Coding 创建的。虽然它可能不够完美,但我欢迎您的反馈!
309
-
310
- **欢迎:**
311
- - 提交问题报告 bug 或提出建议
312
- - Fork 并创建拉取请求
313
- - 分享您使用 hncode 的体验
314
-
315
- ---
316
-
317
- ## 🙏 致谢
318
-
319
- hncode 从以下几个优秀项目中汲取了灵感:
320
-
321
- - **[kimi-code-cli](https://github.com/mckaymatt/kimi-code-cli)** - 原始的青色蓝调终端界面 AI 编程助手,启发了本项目的设计和理念
322
- - **[claude-code](https://github.com/anthropics/claude-code)** - 对话流程和工具交互模式
323
-
324
- 特别感谢这些项目背后的社区,它们推动了 AI 辅助编程的边界。
325
-
326
- ---
327
-
328
- ## 📄 许可证
329
-
330
- MIT License - 详见 LICENSE 文件。
1
+ # hncode — AI Coding Agent CLI
2
+
3
+ > **这是我 Vibe Coding 的产物,可能不是特别好,但是如果有什么建议的话也欢迎提 issue**
4
+
5
+ A cyan-blue TUI coding agent inspired by kimi-code-cli, with OpenAI + Anthropic support, MCP-style toolbelt, and intelligent context management.
6
+
7
+ ---
8
+
9
+ ## 🌟 Features
10
+
11
+ - **Cyan-blue TUI**: Raw terminal renderer for perfect Windows Terminal compatibility
12
+ - **Dual Protocol Support**: Works with both OpenAI-compatible APIs and Anthropic
13
+ - **Smart Context Management**: Auto-compaction at 85% usage, AI-summarized history retention
14
+ - **MCP-style Toolbelt**: Read, Write, Edit, Bash, Glob, Grep, TodoList, WebSearch, etc.
15
+ - **Plugin System**: Extend with custom tools, commands, and hooks
16
+ - **Session Persistence**: Resume conversations across sessions
17
+ - **Permission Modes**: Ask, YOLO, or Auto modes for different workflows
18
+
19
+ ---
20
+
21
+ ## 🚀 Installation
22
+
23
+ ### Global Installation (Recommended)
24
+
25
+ ```bash
26
+ npm install -g @hncode/hncode
27
+ ```
28
+
29
+ Then run:
30
+ ```bash
31
+ hncode
32
+ ```
33
+
34
+ ### Using npx (No installation required)
35
+
36
+ ```bash
37
+ npx @hncode/hncode
38
+ ```
39
+
40
+ This will download and run the latest version without installing it globally.
41
+
42
+ ---
43
+
44
+ ## ⚙️ Configuration
45
+
46
+ Create `~/.hncode/config.toml`:
47
+
48
+ ```toml
49
+ default_model = "gpt-4o-mini"
50
+
51
+ [providers.openai]
52
+ base_url = "https://api.openai.com/v1"
53
+ api_key = "your-api-key-here"
54
+
55
+ [models.gpt-4o-mini]
56
+ provider = "openai"
57
+ model = "gpt-4o-mini"
58
+ ```
59
+
60
+ Or set environment variables:
61
+ ```bash
62
+ export HNCODE_API_KEY="your-key"
63
+ export HNCODE_PROVIDER="openai"
64
+ export HNCODE_MODEL="gpt-4o-mini"
65
+ ```
66
+
67
+ ---
68
+
69
+ ## 📖 Usage
70
+
71
+ ### Basic Commands
72
+
73
+ ```bash
74
+ # Start interactive session
75
+ hncode
76
+
77
+ # Headless mode (one prompt)
78
+ hncode -p "Fix the bug in src/main.js"
79
+
80
+ # Continue previous session
81
+ hncode --continue
82
+
83
+ # Auto mode (no questions)
84
+ hncode --auto
85
+ ```
86
+
87
+ ### Slash Commands
88
+
89
+ | Command | Description |
90
+ |---------|-------------|
91
+ | `/compact [ratio]` | Compact conversation (AI summary + keep last 20%) |
92
+ | `/model <name>` | Switch LLM model |
93
+ | `/sessions` | Browse and resume past conversations |
94
+ | `/move <path>` | Move current session to another directory |
95
+ | `/auto` / `/ask` / `/yolo` | Toggle permission mode |
96
+ | `/plan` / `/focus` | Toggle research-only or full-edit mode |
97
+ | `/calm-mode` | Terse replies (skip narration) |
98
+ | `/help` | Show all commands |
99
+
100
+ ### Advanced Features
101
+
102
+ **Tab Completion**:
103
+ - Type `/` → command menu
104
+ - Type `@` → file/folder completion
105
+ - Use Tab to navigate and Enter to select
106
+
107
+ **Auto Compaction**:
108
+ - Triggers at 85% context window
109
+ - AI summarizes dropped messages
110
+ - Keeps most recent 20% of conversation
111
+
112
+ **Plugin System**:
113
+ Place plugins in `~/.hncode/plugins/`:
114
+ ```javascript
115
+ // my-plugin.mjs
116
+ export function install(api) {
117
+ api.registerTool({ /* ... */ });
118
+ api.registerCommand({ name: 'mycmd', run: () => {} });
119
+ }
120
+ export default { name: 'my-plugin', version: '1.0.0' };
121
+ ```
122
+
123
+ ---
124
+
125
+ ## 🛠 Tools
126
+
127
+ Built-in tools include:
128
+ - `Read`, `Write`, `Edit` - File operations
129
+ - `Bash` - Execute shell commands
130
+ - `Glob`, `Grep` - Search files
131
+ - `TodoList`, `TaskOutput` - Task management
132
+ - `FetchURL`, `WebSearch` - Internet access
133
+ - `ReadMediaFile`, `FileLines` - Media handling
134
+
135
+ ---
136
+
137
+ ## 🎨 Theme
138
+
139
+ Supported themes: `auto`, `dark`, `light`, or custom RGB colors.
140
+
141
+ Set via config:
142
+ ```toml
143
+ theme = "dark"
144
+ ```
145
+
146
+ Or `/theme <name>` in TUI.
147
+
148
+ ---
149
+
150
+ ## 🤝 Contributing
151
+
152
+ This project was created through Vibe Coding. While it may not be perfect, I welcome your feedback!
153
+
154
+ **Please feel free to:**
155
+ - Submit issues for bugs or suggestions
156
+ - Fork and create pull requests
157
+ - Share your experience using hncode
158
+
159
+ ---
160
+
161
+ ## 🙏 Acknowledgments
162
+
163
+ hncode draws inspiration from several excellent projects:
164
+
165
+ - **[kimi-code-cli](https://github.com/mckaymatt/kimi-code-cli)** - The original cyan-blue TUI coding agent that inspired this project's design and approach
166
+ - **[claude-code](https://github.com/anthropics/claude-code)** - The conversation flow and tool interaction patterns
167
+
168
+ Special thanks to the communities behind these projects for pushing the boundaries of AI-assisted coding.
169
+
170
+ ---
171
+
172
+ ## 📄 License
173
+
174
+ MIT License - See LICENSE file for details.
175
+
176
+ ---
177
+
178
+ # hncode — AI 编程助手命令行工具
179
+
180
+ > **这是我 Vibe Coding 的产物,可能不是特别好,但是如果有什么建议的话也欢迎提 issue**
181
+
182
+ 一个青色蓝调终端界面的 AI 编程助手,灵感来自 kimi-code-cli,支持 OpenAI 和 Anthropic API,配备 MCP 风格的工具集和智能上下文管理。
183
+
184
+ ---
185
+
186
+ ## 🌟 功能特性
187
+
188
+ - **青色蓝调 TUI**: 原生终端渲染器,完美兼容 Windows Terminal
189
+ - **双协议支持**: 同时支持 OpenAI 兼容 API 和 Anthropic
190
+ - **智能上下文管理**: 85% 使用率时自动压缩,AI 摘要保留历史对话
191
+ - **MCP 风格工具集**: Read、Write、Edit、Bash、Glob、Grep、TodoList、WebSearch 等
192
+ - **插件系统**: 通过自定义工具、命令和钩子扩展功能
193
+ - **会话持久化**: 跨会话恢复对话
194
+ - **权限模式**: Ask、YOLO、Auto 三种工作流模式
195
+
196
+ ---
197
+
198
+ ## 🚀 安装
199
+
200
+ ```bash
201
+ npm install -g hncode
202
+ ```
203
+
204
+ 或直接使用:
205
+ ```bash
206
+ npx hncode
207
+ ```
208
+
209
+ ---
210
+
211
+ ## ⚙️ 配置
212
+
213
+ 创建 `~/.hncode/config.toml`:
214
+
215
+ ```toml
216
+ default_model = "gpt-4o-mini"
217
+
218
+ [providers.openai]
219
+ base_url = "https://api.openai.com/v1"
220
+ api_key = "你的-api-key"
221
+
222
+ [models.gpt-4o-mini]
223
+ provider = "openai"
224
+ model = "gpt-4o-mini"
225
+ ```
226
+
227
+ 或使用环境变量:
228
+ ```bash
229
+ export HNCODE_API_KEY="你的-key"
230
+ export HNCODE_PROVIDER="openai"
231
+ export HNCODE_MODEL="gpt-4o-mini"
232
+ ```
233
+
234
+ ---
235
+
236
+ ## 📖 使用方法
237
+
238
+ ### 基本命令
239
+
240
+ ```bash
241
+ # 启动交互式会话
242
+ hncode
243
+
244
+ # 无头模式(单次提示)
245
+ hncode -p "修复 src/main.js 中的 bug"
246
+
247
+ # 继续之前的会话
248
+ hncode --continue
249
+
250
+ # 自动模式(不问问题)
251
+ hncode --auto
252
+ ```
253
+
254
+ ### 斜杠命令
255
+
256
+ | 命令 | 描述 |
257
+ |------|------|
258
+ | `/compact [ratio]` | 压缩对话(AI 摘要 + 保留最近 20%) |
259
+ | `/model <name>` | 切换 LLM 模型 |
260
+ | `/sessions` | 浏览和恢复过往对话 |
261
+ | `/move <path>` | 将当前会话迁移到另一个目录 |
262
+ | `/auto` / `/ask` / `/yolo` | 切换权限模式 |
263
+ | `/plan` / `/focus` | 切换仅研究或完整编辑模式 |
264
+ | `/calm-mode` | 简洁回复(跳过叙述) |
265
+ | `/help` | 显示所有命令 |
266
+
267
+ ### 高级功能
268
+
269
+ **Tab 补全**:
270
+ - 输入 `/` → 命令菜单
271
+ - 输入 `@` → 文件/文件夹补全
272
+ - 使用 Tab 导航,Enter 选择
273
+
274
+ **自动压缩**:
275
+ - 在 85% 上下文窗口时触发
276
+ - AI 摘要被丢弃的消息
277
+ - 保留最近 20% 的对话
278
+
279
+ **插件系统**:
280
+ 将插件放在 `~/.hncode/plugins/`:
281
+ ```javascript
282
+ // my-plugin.mjs
283
+ export function install(api) {
284
+ api.registerTool({ /* ... */ });
285
+ api.registerCommand({ name: 'mycmd', run: () => {} });
286
+ }
287
+ export default { name: 'my-plugin', version: '1.0.0' };
288
+ ```
289
+
290
+ ---
291
+
292
+ ## 🛠 内置工具
293
+
294
+ - `Read`, `Write`, `Edit` - 文件操作
295
+ - `Bash` - 执行 Shell 命令
296
+ - `Glob`, `Grep` - 搜索文件
297
+ - `TodoList`, `TaskOutput` - 任务管理
298
+ - `FetchURL`, `WebSearch` - 网络访问
299
+ - `ReadMediaFile`, `FileLines` - 媒体处理
300
+
301
+ ---
302
+
303
+ ## 🎨 主题
304
+
305
+ 支持的 theme:`auto`、`dark`、`light` 或自定义 RGB 颜色。
306
+
307
+ 通过配置设置:
308
+ ```toml
309
+ theme = "dark"
310
+ ```
311
+
312
+ 或在 TUI 中使用 `/theme <name>`。
313
+
314
+ ---
315
+
316
+ ## 🤝 贡献
317
+
318
+ 这个项目是通过 Vibe Coding 创建的。虽然它可能不够完美,但我欢迎您的反馈!
319
+
320
+ **欢迎:**
321
+ - 提交问题报告 bug 或提出建议
322
+ - Fork 并创建拉取请求
323
+ - 分享您使用 hncode 的体验
324
+
325
+ ---
326
+
327
+ ## 🙏 致谢
328
+
329
+ hncode 从以下几个优秀项目中汲取了灵感:
330
+
331
+ - **[kimi-code-cli](https://github.com/mckaymatt/kimi-code-cli)** - 原始的青色蓝调终端界面 AI 编程助手,启发了本项目的设计和理念
332
+ - **[claude-code](https://github.com/anthropics/claude-code)** - 对话流程和工具交互模式
333
+
334
+ 特别感谢这些项目背后的社区,它们推动了 AI 辅助编程的边界。
335
+
336
+ ---
337
+
338
+ ## 📄 许可证
339
+
340
+ MIT License - 详见 LICENSE 文件。
package/package.json CHANGED
@@ -1,11 +1,19 @@
1
1
  {
2
2
  "name": "@hncode/hncode",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "hncode — A cyan-blue TUI AI coding agent with zero runtime dependencies.",
5
5
  "type": "module",
6
+ "main": "src/index.js",
6
7
  "bin": {
7
8
  "hncode": "bin/hncode"
8
9
  },
10
+ "files": [
11
+ "bin/",
12
+ "src/",
13
+ "LICENSE",
14
+ "README.md",
15
+ "package.json"
16
+ ],
9
17
  "scripts": {
10
18
  "preinstall": "node bin/preinstall.js",
11
19
  "install": "node bin/install.js"
package/TODO.md DELETED
@@ -1,72 +0,0 @@
1
- # hncode TODO
2
-
3
- ## Fixed
4
-
5
- - [x] **Fix `args is not defined` in `/compact` command** — `src/tui.js:2508`
6
- The `compact` case referenced an undefined variable `args`. Removed the
7
- redundant `const raw = args.trim();` line; the function's existing
8
- `const raw = (arg || '').trim();` (line ~2142) is used instead.
9
-
10
- - [x] **Fix `/model` picker overflow above screen** — `src/tui.js:~1617-1620`
11
- The picker's `overhead` calculation did not account for footer rows (the
12
- "Thinking" options in the `/model` picker). Now includes `footerRows`
13
- (0 or 2) in the overhead. Also added `MAX_PICKER = 12` constant to cap
14
- visible items.
15
-
16
- - [x] **Add `MAX_PICKER = 12` constant** — `src/tui.js:111`
17
- Caps the number of visible picker items at 12, similar to `MAX_MENU = 6`.
18
-
19
- - [x] **Reduce right-side width by 1 for queue panel and user message boxes**
20
- - Queue panel text width: `w - 4` → `w - 6` (`src/tui.js:711`)
21
- - User/queued message box width: `boxW = innerW` → `boxW = innerW - 2`
22
- (`src/tui.js:1213`)
23
-
24
- - [x] **Fix steer format: render as `steer` role (no box)** — `src/tui.js:3774`
25
- Steered messages were added as `user` role (with a box). Changed to
26
- `addChat({ role: 'steer', text })`. The `steer` role has no box, is
27
- yellow, and shows the `❯` marker.
28
-
29
- - [x] **Rename `/cool-mode` to `/calm-mode`** — `src/tui.js, src/config.js`
30
- - Command: `cool-mode` → `calm-mode`
31
- - Config key: `cool_mode` → `calm_mode`
32
- - Config property: `coolMode` → `calmMode`
33
- - Env var: `HNCODE_COOL_MODE` → `HNCODE_CALM_MODE`
34
- - Constant: `COOL_MODE_INSTRUCTION` → `CALM_MODE_INSTRUCTION`
35
- - Backward compat: legacy `cool_mode` key still read in config.js
36
-
37
- - [x] **Fix `setConfigString is not defined` error** — `src/tui.js:27`
38
- `setConfigString` was used but never imported from `./config.js`.
39
- Added to the import statement.
40
-
41
- - [x] **Fix editor ESC/arrow keys when running** — `src/tui.js:~3957`
42
- When the editor (from `/set-system-prompt`) is open and a turn is running,
43
- ESC interrupted the agent instead of closing the editor. Fixed by adding
44
- `state.editor` to the `overlayOpen` check.
45
-
46
- - [x] **Fix scroll jumping to session beginning** — `src/tui.js:~4772`
47
- `anchorScroll()` used `state._anchorRows || 0` as the previous row count,
48
- which caused a massive scroll jump on the first call after scrolling up.
49
- Changed to only adjust scroll when `_anchorRows` is previously set.
50
-
51
- - [x] **Add category tabs to `/model` picker** — `src/tui.js`
52
- - Added `pickerCategory` and `pickerCategories` state fields
53
- - `pickerFiltered()` now filters by active category
54
- - Category tabs rendered above the item list ("All" + provider names)
55
- - Tab key cycles through categories
56
- - `/model` picker items now have a `category` field (the provider name)
57
- - Hint updated to mention Tab for category switching
58
-
59
- - [x] **Composer text selection via mouse drag** — `src/tui.js`
60
- - Added `composerSel` state for selection range
61
- - Mousedown on composer rows stores position for drag selection
62
- - Mousemove extends the selection (highlighted in yellow)
63
- - Mouseup clears the mousedown state
64
- - Context menu includes "Copy" for composer selection
65
- - Ctrl+Shift+C copies composer selection (before falling back to last answer)
66
- - All key handlers (typing, arrows, backspace, etc.) clear the selection
67
- - Added `highlightSelection()` helper function
68
-
69
- - [x] **Fix `/provider` Enter to edit, remove Ctrl+E** — `src/tui.js`
70
- - Enter on a regular provider now opens the edit form (was: selects provider)
71
- - Ctrl+E handler removed from the generic key handler
72
- - Hint updated: "Enter edit" instead of "Enter select · Ctrl+E edit"