@vincentbanana/bananacli 0.8.6 → 0.8.8

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.en.md CHANGED
@@ -36,7 +36,7 @@ A multi-provider AI agent for the terminal, with a local GUI. It can read and wr
36
36
  | |_) | (_| | | | | (_| | |_) | (_| | | | |
37
37
  |____/ \__,_|_| |_|\__,_|_.__/ \__,_|_| |_|
38
38
 
39
- BananaCLI v0.8.6 · terminal + GUI
39
+ BananaCLI v0.8.7 · terminal + GUI
40
40
  ```
41
41
 
42
42
  - **No frontend framework**: the CLI uses Node built-ins only; runtime dependencies are `ws` and `@lydell/node-pty` (prebuilt native module).
package/README.md CHANGED
@@ -34,7 +34,7 @@
34
34
  | |_) | (_| | | | | (_| | |_) | (_| | | | |
35
35
  |____/ \__,_|_| |_|\__,_|_.__/ \__,_|_| |_|
36
36
 
37
- BananaCLI v0.8.6 · 终端 + 图形界面
37
+ BananaCLI v0.8.7 · 终端 + 图形界面
38
38
  ```
39
39
 
40
40
  - **无前端框架依赖**:CLI 只用 Node 内置模块;运行时依赖 `ws`(GUI/终端 WebSocket)和 `@lydell/node-pty`(预编译原生模块)。
@@ -111,62 +111,39 @@ export function defaultSystemPrompt(workspace) {
111
111
  return [
112
112
  '你是 BananaCLI,一个运行在终端里的编程 agent。你可以使用工具读写文件、执行命令、搜索代码、上网查询。',
113
113
  '',
114
- `运行环境:${platformName} (${process.platform}/${process.arch}),shell 工具使用 ${shell}。写命令时按这个平台来:Windows 用 cmd 语法,Unix 用 sh 语法。`,
115
- `工作目录:${workspace}。默认只能在这个目录内读写文件;需要越界时先说明原因并征得同意。`,
114
+ `运行环境:${platformName} (${process.platform}/${process.arch}),shell 工具使用 ${shell}。写命令时按这个平台来。`,
115
+ `工作目录:${workspace}。默认只在这个目录内读写;需要越界时先说明原因。`,
116
116
  '',
117
117
  '## 冲突优先级',
118
- '规则冲突时按顺序裁决:安全 > 反幻觉 > 用户事实 > 能力边界 > 简洁 > 可扩展 > 自动探测。',
118
+ '安全 > 真实 > 用户事实 > 简洁。',
119
119
  '',
120
120
  '## 环境信息',
121
- '1. 用户已明确说过的环境(系统、版本、路径、命令、限制)直接采用,不重复验证,不跑 command -v / find / ls 去确认。',
122
- '2. 用户没说清的,一次性问清,不要来回追问。',
123
- '3. 只有用户不知道且任务必须时,才做单点、超时、只读的最小探测;失败就写 unknown。',
124
- '4. 不主动全盘扫描项目;需要时再读相关文件。',
121
+ '用户说过的环境、版本、路径直接用,不重复探测;没说清的一次问完;不主动全盘扫描项目。',
125
122
  '',
126
123
  '## 事实与不确定性',
127
- '- 区分事实来源:[事实-用户]、[事实-文档/代码]、[事实-实测]、[推断-依据]、[猜测-未验证]。',
128
- '- 没查文档或没实测的版本行为、性能数字、兼容性、命令参数、依赖关系、代价评估、安全结论,必须标为猜测或未知,并给出验证方法。',
129
- '- 不编造文件路径、API、版本号、测试结果、性能数字。',
130
- '- 已确认的事实和未验证项用 memory_write 分别记录,供后续轮次直接引用。',
124
+ '不确定就说不确定;不编造文件路径、API、版本号、测试结果。',
131
125
  '',
132
126
  '## 能力边界',
133
- '- 动手前先判断:能做到什么、做不到什么、需要用户决定什么。',
134
- '- 超出能力的需求,先说明边界,拆成阶段,给 2–3 条路径和取舍,让用户选一步;只做选定的那一步。',
135
- '- 禁止硬接超纲需求;禁止交付跑不起来的半成品。',
127
+ '做不到就直说,给 2–3 条可选路径;不硬接超纲需求。',
136
128
  '',
137
129
  '## 复杂度预算',
138
- '- 最短可行优先;先给最小实现,确认后再扩展。',
139
- '- 命令默认不超过 5 行;能用一条管道解决的不拆多步,不写临时文件、不加仪式性步骤。',
140
- '- 新增核心实现软预算 80 行、函数不超过 5 个、不新增依赖;不为未来可能的需求做抽象。',
141
- '- 只在真实边界加校验;注释解释为什么,不复述是什么。',
142
- '- 上述是默认值;确实需要突破时,先说明原因再动手。',
130
+ '最短可行优先;命令默认不超过 5 行;新增核心实现软预算 80 行;不新增依赖;不为假设的需求做抽象。',
143
131
  '',
144
132
  '## 执行与安全',
145
- '1. 动手前先读相关代码,看清现状再改,不凭猜测写文件。',
146
- '2. 优先最小改动,保持项目现有风格与命名;不顺手重构无关代码。',
147
- '3. 修改文件用 edit_file 做精确替换,不整文件重写来掩盖改动。',
148
- '4. 执行命令前说明要做什么;破坏性操作(删除、覆盖、git reset --hard、force push)必须先确认。',
149
- '5. 需要外部信息时用 web_search / web_fetch,并说明信息来源。',
150
- '6. 工具报错先读错误,自己修正一次;仍不行再说明卡点和已尝试方案。',
151
- '7. 不确定的事直接说不确定。',
133
+ '先读相关代码再改,最小改动;破坏性操作先确认;工具报错自己修一次,仍不行再说明卡点。',
152
134
  '',
153
135
  '## 验收',
154
- '- 交付前自检:能跑吗?测试/构建过了吗?未验证项列了吗?',
155
- '- 交付说明用四段:改了什么 / 验证结果 / 未验证项 / 下一步。',
156
- '- 没有验证过的不要说“已完成”“没问题”。',
136
+ '改了代码才跑测试 / 构建;没验证就别说“完成”;交付只说:改了什么 / 验证结果 / 未验证项。',
137
+ '',
138
+ '## 长任务',
139
+ '长任务可以连续多步执行,不因为步数多就提前收尾;做到完成或确实卡住再停。',
157
140
  '',
158
141
  '## 记忆与任务',
159
- '- 需要三步以上才能完成的任务,先用 todo_write 列清单;每完成一步更新状态;简单问题不建清单。',
160
- '- 所有任务完成后清空清单,避免旧任务影响后续对话。',
161
- '- 事实库和未验证项随会话保存;不确定时先 memory_read,再决定要不要 memory_write。',
162
- '- 项目根目录的 AGENT.md 是用户确认过的项目规则,优先遵守;与安全规则冲突时以安全规则为准。',
163
- '- 同一会话里已经确认过的事实和约束不要重复问。',
142
+ '三步以上才用 todo,简单问题不建清单;项目根目录的 AGENT.md 优先遵守。',
164
143
  '',
165
144
  '## 沟通',
166
- '- 用用户提问的语言回答。',
167
- '- 简洁直接:先结论,再必要解释和改动清单;不要复述每一步。',
168
- `- 做 UI 时先读 ${designRoot}/principles.md 与 ${designRoot}/tokens.md,遵守禁用清单。`,
169
- '- 交付 UI 前必须调用 ui_audit;审计未通过时先修复,不能直接说完成。',
145
+ '先给结论,再补必要解释,不复述每一步;',
146
+ `做 UI 先读 ${designRoot}/principles.md 与 tokens.md,交付前调用 ui_audit。`,
170
147
  ...(process.env['BANANA_PROMPT_SUFFIX']?.trim()
171
148
  ? [`\n## 实验提示词\n${process.env['BANANA_PROMPT_SUFFIX'].trim()}`]
172
149
  : []),
@@ -200,7 +177,7 @@ function defaultConfig(workspace) {
200
177
  sessionDir: defaultSessionDir(),
201
178
  workspace,
202
179
  systemPrompt: defaultSystemPrompt(workspace),
203
- maxSteps: 40,
180
+ maxSteps: 500,
204
181
  maxContextChars: 160_000,
205
182
  allowOutsideWorkspace: false,
206
183
  showReasoning: true,
@@ -5,13 +5,13 @@ export const REASONING_LABEL = {
5
5
  deep: '深入',
6
6
  };
7
7
  export const REASONING_HINT = {
8
- fast: '低推理,响应快、消耗少',
8
+ fast: '官方低强度思考,响应快、消耗少',
9
9
  standard: '日常默认,速度和准确率平衡',
10
- deep: '高推理,更慢但更适合复杂任务',
10
+ deep: '高强度思考,更适合复杂任务',
11
11
  };
12
12
  /** Anthropic extended thinking 的预算(token)。 */
13
13
  export const REASONING_BUDGET = {
14
- fast: 2048,
14
+ fast: 1024,
15
15
  standard: 8192,
16
16
  deep: 24576,
17
17
  };
@@ -50,15 +50,14 @@ export function openAIReasoningBody(name, protocol, model, level) {
50
50
  if (/^(o[1-9]|gpt-5)/.test(id))
51
51
  return { reasoning_effort: effortFor(level) };
52
52
  if (name === 'deepseek' || id.includes('deepseek')) {
53
+ // 快 / 标准 / 深入都走官方思考接口,快模式用低强度而不是关掉思考。
53
54
  return {
54
- thinking: { type: level === 'fast' ? 'disabled' : 'enabled' },
55
- ...(level === 'fast' ? {} : { reasoning_effort: effortFor(level) }),
55
+ thinking: { type: 'enabled' },
56
+ reasoning_effort: effortFor(level),
56
57
  };
57
58
  }
58
59
  if (name === 'qwen' || /qwen3|qwq|thinking/.test(id)) {
59
- return level === 'fast'
60
- ? { enable_thinking: false }
61
- : { enable_thinking: true, thinking_budget: REASONING_BUDGET[level] };
60
+ return { enable_thinking: true, thinking_budget: REASONING_BUDGET[level] };
62
61
  }
63
62
  return { reasoning_effort: effortFor(level) };
64
63
  }
package/dist/ui/app.js CHANGED
@@ -529,7 +529,7 @@ const state = {
529
529
  dock: { open: false, height: 280 },
530
530
  changes: null,
531
531
  changesFile: null,
532
- todoOpen: true,
532
+ todoOpen: false,
533
533
  attachmentPath: '',
534
534
  trustPrompted: false,
535
535
  };
@@ -2375,8 +2375,8 @@ async function send() {
2375
2375
  if (!reasoningStarted) {
2376
2376
  reasoningStarted = Date.now();
2377
2377
  reasoning.hidden = false;
2378
- // 默认只显示一行实时摘要,点开才看全文。
2379
- reasoning.open = reasoning.dataset.user === '1';
2378
+ // 思考时默认展开,开始回答后自动收起;用户手动操作过后尊重用户选择。
2379
+ if (reasoning.dataset.user !== '1') reasoning.open = true;
2380
2380
  }
2381
2381
  reasoningText += event.chunk;
2382
2382
  scheduleReasoning();
package/dist/ui/style.css CHANGED
@@ -346,7 +346,7 @@ button, input, textarea, select { font: inherit; color: inherit; }
346
346
  min-height: 0;
347
347
  overflow-y: auto;
348
348
  scroll-behavior: smooth;
349
- padding: 26px 0 12px;
349
+ padding: 18px 0 10px;
350
350
  }
351
351
 
352
352
  .msg {
@@ -410,7 +410,7 @@ body.switching { cursor: progress; }
410
410
  to { opacity: 1; transform: none; }
411
411
  }
412
412
 
413
- .msg + .msg { margin-top: 22px; }
413
+ .msg + .msg { margin-top: 16px; }
414
414
 
415
415
  .msg-role {
416
416
  display: flex;
@@ -557,7 +557,7 @@ pre.code code { border: 0; background: none; padding: 0; font-size: 12.6px; line
557
557
  /* ---------- composer ---------- */
558
558
 
559
559
  .composer-wrap {
560
- padding: 10px 24px 16px;
560
+ padding: 8px 24px 10px;
561
561
  border-top: 1px solid var(--line);
562
562
  background: var(--bg);
563
563
  }
@@ -568,7 +568,7 @@ pre.code code { border: 0; background: none; padding: 0; font-size: 12.6px; line
568
568
  display: flex;
569
569
  align-items: flex-end;
570
570
  gap: 8px;
571
- padding: 8px 8px 8px 14px;
571
+ padding: 6px 8px 6px 12px;
572
572
  border: 1px solid var(--line-strong);
573
573
  border-radius: 8px;
574
574
  background: var(--bg);
@@ -579,8 +579,8 @@ pre.code code { border: 0; background: none; padding: 0; font-size: 12.6px; line
579
579
 
580
580
  .composer textarea {
581
581
  flex: 1;
582
- min-height: 26px;
583
- max-height: 220px;
582
+ min-height: 24px;
583
+ max-height: 160px;
584
584
  padding: 4px 0;
585
585
  border: 0;
586
586
  outline: none;
@@ -3943,13 +3943,13 @@ input:focus-visible, textarea:focus-visible { outline: none; }
3943
3943
  .msg-attachments { margin-top: 7px; max-width: none; }
3944
3944
  .msg-attachments .att { height: 26px; font-size: 11px; }
3945
3945
 
3946
- .plan-card { width: 100%; max-width: 744px; margin: 2px auto 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent-ink) 24%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
3946
+ .plan-card { width: 100%; max-width: 744px; margin: 4px auto 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent-ink) 24%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
3947
3947
  .plan-card.is-approved { border-color: var(--line); background: var(--panel); }
3948
3948
  .plan-card.is-cancelled { opacity: 0.6; }
3949
3949
  .plan-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text); }
3950
3950
  .plan-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); }
3951
3951
  .plan-hint { margin-left: auto; font-size: 10.5px; font-weight: 400; color: var(--text-3); }
3952
- .plan-list { margin-top: 9px; display: flex; flex-direction: column; gap: 3px; }
3952
+ .plan-list { margin-top: 7px; display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
3953
3953
  .plan-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 19px; color: var(--text-2); }
3954
3954
  .plan-text { min-width: 0; }
3955
3955
  .plan-meta { flex-basis: 100%; margin-left: 40px; font-size: 11px; line-height: 16px; color: var(--text-3); }
@@ -3957,7 +3957,7 @@ input:focus-visible, textarea:focus-visible { outline: none; }
3957
3957
  .plan-mark { width: 13px; flex: none; display: grid; place-items: center; padding-top: 3px; color: var(--text-3); }
3958
3958
  .plan-mark svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
3959
3959
  .plan-empty { color: var(--text-3); font-size: 11.5px; line-height: 1.6; }
3960
- .plan-actions { display: flex; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
3960
+ .plan-actions { display: flex; gap: 7px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
3961
3961
  .plan-actions .btn { height: 28px; font-size: 11.5px; }
3962
3962
 
3963
3963
  .tasks-empty { padding: 18px 14px; color: var(--text-3); font-size: 12px; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
- {
1
+ {
2
2
  "name": "@vincentbanana/bananacli",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "description": "A multi-provider AI agent for your terminal: file tools, shell, web search, persistent sessions, diff preview and undo",
5
5
  "type": "module",
6
6
  "engines": {