@miphamai/cli 0.85.20 → 0.85.21

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,4 +1,4 @@
1
- # Mipham Code v0.85.20
1
+ # Mipham Code v0.85.21
2
2
 
3
3
  **Multi-model open-core intelligent coding terminal** — 12 AI providers, 137 commands, 31 tools, 28 skills + marketplace, self-update. AI-assisted code generation, security auditing, MCP protocol, and extensible skills — in a single CLI.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miphamai/cli",
3
- "version": "0.85.20",
3
+ "version": "0.85.21",
4
4
  "description": "Mipham Code — Multi-model open-core intelligent coding terminal by MiphamAI",
5
5
  "keywords": [
6
6
  "ai",
@@ -9,7 +9,7 @@
9
9
  export const PACKAGE_NAME = '@miphamai/cli' as const
10
10
 
11
11
  /** 当前发布版本 */
12
- export const PACKAGE_VERSION = '0.85.20' as const
12
+ export const PACKAGE_VERSION = '0.85.21' as const
13
13
 
14
14
  /** npm install 全局安装命令 */
15
15
  export const NPM_INSTALL_COMMAND = `npm install -g ${PACKAGE_NAME}` as const
@@ -90,4 +90,4 @@ export const TOOL_COUNT = 31 as const
90
90
  * —— `test/e2e/full-pipeline.test.ts` 在 Linux 上整文件 skip、在 macOS 上跑 ——
91
91
  * 但**总数相同**(两边都把被 skip 的算进去)。
92
92
  */
93
- export const TEST_COUNT = 4228 as const
93
+ export const TEST_COUNT = 4231 as const
package/src/ui/chat.tsx CHANGED
@@ -30,6 +30,8 @@ interface ChatPanelProps {
30
30
  * through `sanitizeInlineField` (the same recipe minus `\n`), the way
31
31
  * `agent-footer.tsx` and `input.tsx` already do. The name below used to be
32
32
  * interpolated raw, on the theory that this function was the only way in; it is not.
33
+ * The same holds for the `↳ name1 ↳ name2` line `summarizeToolGroup` composes: one
34
+ * line, names straight off the model's `tool_use`, so the single-line gate.
33
35
  */
34
36
  function display(text: string): string {
35
37
  return stripControlCharsForDisplay(text)
@@ -318,11 +320,24 @@ function compactForFocus(messages: ChatMessage[]): ChatMessage[] {
318
320
  return result
319
321
  }
320
322
 
321
- /** Summarize a group of tool calls into a single compact message. */
322
- function summarizeToolGroup(tools: ChatMessage[]): ChatMessage {
323
+ /**
324
+ * Summarize a group of tool calls into a single compact message.
325
+ *
326
+ * Exported for `test/ui/chat-control-chars.test.ts`, which pins the composition
327
+ * itself: names come from the model's `tool_use`, and this line is a **one-line**
328
+ * display string, so each name goes through the single-line gate rather than
329
+ * `display()` — the latter keeps `\n` for legitimately multi-line bodies, and a
330
+ * `\n` in a name forges a row here just as it did on the tool-call row.
331
+ *
332
+ * That line is not rendered by today's `MessageRow` (the `toolMeta` branch is
333
+ * taken, where `output` wins and `collapsed: true` blocks the `content`
334
+ * fallback) — so this is hardening the composed value, not fixing an observed
335
+ * leak. It keeps the string safe under whichever renderer reads it next.
336
+ */
337
+ export function summarizeToolGroup(tools: ChatMessage[]): ChatMessage {
323
338
  const names = tools.map((t) => t.toolMeta!.name)
324
339
  const uniqueNames = [...new Set(names)]
325
- const toolList = uniqueNames.map((n) => `↳ ${n}`).join(' ')
340
+ const toolList = uniqueNames.map((n) => `↳ ${sanitizeInlineField(n)}`).join(' ')
326
341
  return {
327
342
  role: 'system',
328
343
  content: `[▶ ${tools.length} tool${tools.length > 1 ? 's' : ''}] ${toolList}`,