@each1024/pi-mini-mode 1.3.11 → 1.3.13

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
@@ -16,7 +16,7 @@ An everyday refinement for [Pi](https://pi.dev), not just a footer. Preview imag
16
16
  pi install npm:@each1024/pi-mini-mode
17
17
  ```
18
18
 
19
- Run `/reload` in Pi, then open `/pi-mini-mode-settings` to make it yours.
19
+ Run `/reload` in Pi. On the first interactive TUI session, choose **Apply recommended setup** to select `cc-dark` or `cc-light` and save the theme plus `tuiMode=fullscreen` globally; restart Pi for fullscreen to take effect. Project settings and CLI flags may override global settings. You can retry later with `/pi-mini-mode-setup`, or configure only Pi Mini Mode with `/pi-mini-mode-settings`.
20
20
 
21
21
  **Pi ≥ 0.84.0.** Input enhancements and minimal output are on by default. Minimal mode uses a private **Pi 0.85.x** layout adapter—see [compatibility](#compatibility) before enabling it.
22
22
 
@@ -75,6 +75,7 @@ This earlier screenshot and recording show footer configuration, not the newer i
75
75
  | Command / shortcut | Purpose |
76
76
  | --- | --- |
77
77
  | `/pi-mini-mode-settings` | Configure fields, input enhancements and minimal output |
78
+ | `/pi-mini-mode-setup` | Choose the bundled theme and save global fullscreen mode; restart Pi afterward |
78
79
  | `/pi-mini-mode-minimal on` / `off` | Enable minimal output / restore native history |
79
80
  | `Ctrl+O` | Expand or collapse the complete process tree |
80
81
  | `Ctrl+S` | Expand or collapse completed subagent rows; yields to Pi `/model`, `/thinking`, and other selectors |
@@ -104,7 +105,7 @@ On the first interactive TUI session, Pi Mini Mode shows a preview. Footer metri
104
105
  deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █░░░░░░░░░ 1% 120 tok/s
105
106
  ```
106
107
 
107
- The first-run picker offers **Keep defaults** and **Configure now**. Keeping defaults saves the default field selection, leaves minimal output on, and prevents the prompt from appearing again; configuring opens the same settings list immediately. Print, JSON, and other non-interactive modes never prompt.
108
+ The first-run picker offers **Keep defaults**, **Configure now**, and **Apply recommended setup**. Keeping defaults saves the default field selection, leaves minimal output on, and prevents the prompt from appearing again; configuring opens the same settings list immediately. Applying the recommendation asks you to choose the bundled `cc-dark` or `cc-light` theme, saves that theme and global `tuiMode=fullscreen` through Pi's settings API, applies the theme immediately, and asks you to restart Pi because the fullscreen renderer is chosen at startup. Project settings and CLI flags may override these global values. Escape/cancel leaves onboarding incomplete; retry with `/pi-mini-mode-setup`. Print, JSON, and other non-interactive modes never prompt.
108
109
 
109
110
  Open that settings UI any time with:
110
111
 
@@ -167,7 +168,7 @@ Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-m
167
168
 
168
169
  Session totals are aggregated from each finalized `assistant` and `toolResult` entry on the active session branch. This includes nested LLM work reported by tools (such as a child agent) exactly once. `Total` uses the provider's `totalTokens` when supplied; older/custom results without it fall back to the sum of input, output, cache-read, and cache-write tokens. `Cached` is cache-read + cache-write (included in Total); `CH` is cache-read / (input + cache-read). Only persisted finalized usage is counted, so stream updates cannot double count totals.
169
170
 
170
- During an assistant stream, speed appears as soon as a positive cumulative `usage.output` sample and elapsed time are available. It is refreshed while streaming and is output tokens divided by elapsed time from the assistant message start. The completed rate remains visible while later assistant messages only call tools or wait for output; it is replaced only by a newer measurable generation. Regressing output samples and non-increasing timestamps are ignored. For a tool result that reports nested LLM usage but has no stream events, the final rate is output tokens divided by that tool execution's duration. A tool that does not report output usage has no measurable speed and leaves the prior rate intact.
171
+ During an assistant stream, speed is decode TPS: provider `usage.output` divided by elapsed time from the first output token, excluding TTFT/prefill wait. It appears after at least two output tokens and 100ms of decode time, and is refreshed while streaming. The completed rate remains visible while later assistant messages only call tools or wait for output; it is replaced only by a newer measurable main-turn generation. Nested tool LLM usage does not overwrite a measured main-turn rate; it can set the footer only when no main generation has been measured yet. Short or single-token bursts are hidden rather than shown as inflated tok/s. Regressing output samples and non-increasing timestamps are ignored.
171
172
 
172
173
  Before a measurable response exists, the speed field is absent entirely—Pi Mini Mode never displays a `-- tok/s` placeholder. When present, speed is the rightmost footer field (the context percentage, if enabled, is immediately to its left). Its color uses Pi theme semantics: **success** at >=30 tok/s, **warning** at 10–29.9 tok/s, and **error** below 10 tok/s. No colors are hard-coded, so it follows the selected Pi theme.
173
174
 
package/README.zh-CN.md CHANGED
@@ -16,7 +16,7 @@
16
16
  pi install npm:@each1024/pi-mini-mode
17
17
  ```
18
18
 
19
- 在 Pi 中运行 `/reload`,再用 `/pi-mini-mode-settings` 按你的习惯配置。
19
+ 在 Pi 中运行 `/reload`。首次进入交互式 TUI 时,选择 **应用推荐配置**,再选择 `cc-dark` 或 `cc-light`;它会通过 Pi 官方设置 API 保存主题与全局 `tuiMode=fullscreen`,重启 Pi 后全屏模式才会生效。项目设置和命令行参数可能覆盖全局设置。之后可用 `/pi-mini-mode-setup` 重试,或用 `/pi-mini-mode-settings` 只配置 Pi Mini Mode。
20
20
 
21
21
  **需要 Pi ≥ 0.84.0。** 输入增强和极简输出默认开启。极简模式使用私有 **Pi 0.85.x** 布局适配器,启用前请查看[兼容性](#兼容性)。
22
22
 
@@ -75,6 +75,7 @@ pi install git:github.com/eachann1024/pi-mini-mode
75
75
  | 命令/快捷键 | 用途 |
76
76
  | --- | --- |
77
77
  | `/pi-mini-mode-settings` | 配置字段、输入增强和极简输出 |
78
+ | `/pi-mini-mode-setup` | 选择内置主题并保存全局全屏模式;之后需重启 Pi |
78
79
  | `/pi-mini-mode-minimal on` / `off` | 开启极简输出/恢复原生历史 |
79
80
  | `Ctrl+O` | 展开/收起完整过程树 |
80
81
  | `Ctrl+S` | 展开/收起已完成的子代理行;打开 `/model`、`/thinking` 等选择器时交给 Pi |
@@ -104,7 +105,7 @@ pi install git:github.com/eachann1024/pi-mini-mode
104
105
  deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █░░░░░░░░░ 1% 120 tok/s
105
106
  ```
106
107
 
107
- 首次设置会提供 **Keep defaults(保留默认值)** 和 **Configure now(立即配置)**。保留默认值会保存默认字段选择、保持极简输出开启,并且不再显示首次设置提示;立即配置会直接打开同一设置列表。Print、JSON 等非交互模式不会显示提示。
108
+ 首次设置会提供 **Keep defaults(保留默认值)**、**Configure now(立即配置)** 和 **Apply recommended setup(应用推荐配置)**。保留默认值会保存默认字段选择、保持极简输出开启,并且不再显示首次设置提示;立即配置会直接打开同一设置列表。应用推荐配置会让你选择内置的 `cc-dark` 或 `cc-light` 主题,通过 Pi 官方设置 API 保存该主题和全局 `tuiMode=fullscreen`,立即应用主题,并提示重启 Pi(全屏渲染器在启动时决定)。项目设置和命令行参数可能覆盖全局设置。按 Esc/取消不会完成首次设置,可稍后用 `/pi-mini-mode-setup` 重试。Print、JSON 等非交互模式不会显示提示。
108
109
 
109
110
  设置保存在 Pi 的 agent 目录中,通常是 `~/.pi/agent/pi-mini-mode.json`;如果 Pi 使用其他配置目录,则保存在对应目录。文件缺失或格式错误时会安全回退到默认设置。设置示例:
110
111
 
@@ -158,7 +159,7 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █
158
159
 
159
160
  会话总量来自当前会话分支中每一条已完成的 `assistant` 和 `toolResult` 记录。工具报告的嵌套 LLM 工作(例如子 Agent)会准确计入一次。若 provider 提供 `totalTokens`,`Total` 使用该值;较旧或自定义结果没有该字段时,则使用输入、输出、缓存读取和缓存写入令牌之和。`Cached` 是缓存读取与写入之和(包含在 `Total` 中);`CH` 是缓存读取量除以输入量与缓存读取量之和。只有已持久化的最终用量会计入,因此流式更新不会重复累计。
160
161
 
161
- 助手生成过程中,只要有正数的累计 `usage.output` 样本和可用耗时,就会显示速度,并持续刷新。速度等于输出令牌数除以助手消息开始后的耗时。后续助手消息如果只是调用工具或等待输出,之前完成的速度仍会保留;只有新的可测量生成才会替换它。倒退的输出样本和不递增的时间戳会被忽略。工具结果若报告嵌套 LLM 用量但没有流事件,则使用输出令牌数除以工具执行时长计算最终速度;无法报告输出用量的工具不会产生速度,也不会清除之前的速度。
162
+ 助手生成过程中,速度按 decode TPS 计算:用 provider 的 `usage.output` 除以从第一个输出 token 开始的耗时,不包含 TTFT/预填充等待。至少 2 个输出 token 且解码时长达 100ms 后才显示,并在流式过程中刷新。后续助手消息如果只是调用工具或等待输出,之前完成的速度仍会保留;只有新的可测量主回复才会替换它。嵌套工具里的 LLM 用量不会覆盖已测量的主回复速度;只有还没有主生成速度时,嵌套完成才能写入页脚。过短或单 token 突发不显示,避免虚高的 tok/s。倒退的输出样本和不递增的时间戳会被忽略。
162
163
 
163
164
  在获得可测量响应前,速度字段完全不显示,不会出现 `-- tok/s` 占位符。速度位于页脚最右侧;启用上下文百分比时,百分比紧邻其左侧。颜色遵循 Pi 主题语义:至少 30 tok/s 为成功色,10–29.9 tok/s 为警告色,低于 10 tok/s 为错误色。费用是基于当前分支已完成用量和配置的每百万令牌费率得出的估算,并非 provider 账单。窄终端中,页脚会丢弃或截断优先级较低的内容,确保保持单行且不溢出。
164
165