@each1024/pi-mini-mode 1.3.8 → 1.3.9

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
@@ -18,7 +18,7 @@ pi install npm:@each1024/pi-mini-mode
18
18
 
19
19
  Run `/reload` in Pi, then open `/pi-mini-mode-settings` to make it yours.
20
20
 
21
- **Pi ≥ 0.84.0.** Input enhancements are on by default; minimal output is opt-in. Minimal mode uses a private **Pi 0.85.x** layout adapter—see [compatibility](#compatibility) before enabling it.
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
 
23
23
  <details>
24
24
  <summary>Install from GitHub instead</summary>
@@ -97,13 +97,13 @@ This earlier screenshot and recording show footer configuration, not the newer i
97
97
  <details>
98
98
  <summary><strong>First run & configuration</strong> — defaults, controls, and settings file</summary>
99
99
 
100
- On the first interactive TUI session, Pi Mini Mode shows a preview. Footer metrics are on by default except MCP count; the dot-matrix style and minimal output are off:
100
+ On the first interactive TUI session, Pi Mini Mode shows a preview. Footer metrics are on by default except MCP count; the dot-matrix style is off; minimal output is on:
101
101
 
102
102
  ```text
103
103
  deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █░░░░░░░░░ 1% 120 tok/s
104
104
  ```
105
105
 
106
- The first-run picker offers **Keep defaults** and **Configure now**. Keeping defaults saves the default field selection, leaves minimal output off, and prevents the prompt from appearing again; configuring opens the same settings list immediately. Print, JSON, and other non-interactive modes never prompt.
106
+ 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.
107
107
 
108
108
  Open that settings UI any time with:
109
109
 
@@ -131,7 +131,7 @@ Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-m
131
131
  "pi-mini-mode-context-percent-show": true,
132
132
  "pi-mini-mode-speed-show": true,
133
133
  "pi-mini-mode-speed-unit-show": true,
134
- "pi-mini-mode-minimal-show": false,
134
+ "pi-mini-mode-minimal-show": true,
135
135
  "pi-mini-mode-input-enhancements": true,
136
136
  "onboardingCompleted": true
137
137
  }
@@ -151,7 +151,7 @@ Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-m
151
151
  | `pi-mini-mode-context-percent-show` | `true` | Context-use percentage |
152
152
  | `pi-mini-mode-speed-show` | `true` | Generation speed at the far right |
153
153
  | `pi-mini-mode-speed-unit-show` | `true` | Generation-speed sub-setting: append `tok/s` to the numeric value |
154
- | `pi-mini-mode-minimal-show` | `false` | Minimal output; off keeps Pi's default conversation history |
154
+ | `pi-mini-mode-minimal-show` | `true` | Minimal output; off restores Pi's default conversation history |
155
155
  | `pi-mini-mode-input-enhancements` | `true` | Image previews, inline skills, and message file links |
156
156
  | `onboardingCompleted` | `false` initially | Internal marker that prevents another first-run prompt |
157
157
 
package/README.zh-CN.md CHANGED
@@ -18,7 +18,7 @@ pi install npm:@each1024/pi-mini-mode
18
18
 
19
19
  在 Pi 中运行 `/reload`,再用 `/pi-mini-mode-settings` 按你的习惯配置。
20
20
 
21
- **需要 Pi ≥ 0.84.0。** 输入增强默认开启,极简输出按需开启。极简模式使用私有 **Pi 0.85.x** 布局适配器,启用前请查看[兼容性](#兼容性)。
21
+ **需要 Pi ≥ 0.84.0。** 输入增强和极简输出默认开启。极简模式使用私有 **Pi 0.85.x** 布局适配器,启用前请查看[兼容性](#兼容性)。
22
22
 
23
23
  <details>
24
24
  <summary>也可以从 GitHub 安装</summary>
@@ -97,13 +97,13 @@ pi install git:github.com/eachann1024/pi-mini-mode
97
97
  <details>
98
98
  <summary><strong>首次使用与配置</strong></summary>
99
99
 
100
- 首次进入交互式 TUI 会话时,Pi Mini Mode 显示设置预览。页脚指标除 MCP 数量外默认开启,点阵样式与极简输出默认关闭,例如:
100
+ 首次进入交互式 TUI 会话时,Pi Mini Mode 显示设置预览。页脚指标除 MCP 数量外默认开启,点阵样式默认关闭,极简输出默认开启,例如:
101
101
 
102
102
  ```text
103
103
  deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █░░░░░░░░░ 1% 120 tok/s
104
104
  ```
105
105
 
106
- 首次设置会提供 **Keep defaults(保留默认值)** 和 **Configure now(立即配置)**。保留默认值会保存默认字段选择、保持极简输出关闭,并且不再显示首次设置提示;立即配置会直接打开同一设置列表。Print、JSON 等非交互模式不会显示提示。
106
+ 首次设置会提供 **Keep defaults(保留默认值)** 和 **Configure now(立即配置)**。保留默认值会保存默认字段选择、保持极简输出开启,并且不再显示首次设置提示;立即配置会直接打开同一设置列表。Print、JSON 等非交互模式不会显示提示。
107
107
 
108
108
  设置保存在 Pi 的 agent 目录中,通常是 `~/.pi/agent/pi-mini-mode.json`;如果 Pi 使用其他配置目录,则保存在对应目录。文件缺失或格式错误时会安全回退到默认设置。设置示例:
109
109
 
@@ -121,7 +121,7 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █
121
121
  "pi-mini-mode-context-percent-show": true,
122
122
  "pi-mini-mode-speed-show": true,
123
123
  "pi-mini-mode-speed-unit-show": true,
124
- "pi-mini-mode-minimal-show": false,
124
+ "pi-mini-mode-minimal-show": true,
125
125
  "pi-mini-mode-input-enhancements": true,
126
126
  "onboardingCompleted": true
127
127
  }
@@ -141,7 +141,7 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █
141
141
  | `pi-mini-mode-context-percent-show` | `true` | 显示上下文使用百分比 |
142
142
  | `pi-mini-mode-speed-show` | `true` | 显示最新生成速度 |
143
143
  | `pi-mini-mode-speed-unit-show` | `true` | 速度子设置:在数字后追加 `tok/s` |
144
- | `pi-mini-mode-minimal-show` | `false` | 极简输出总开关;关闭则使用 Pi 默认历史显示 |
144
+ | `pi-mini-mode-minimal-show` | `true` | 极简输出总开关;关闭则恢复 Pi 默认历史显示 |
145
145
  | `pi-mini-mode-input-enhancements` | `true` | 图片预览、行内技能补全与展开、消息文件链接 |
146
146
  | `onboardingCompleted` | 初始为 `false` | 防止再次显示首次设置提示的内部标记 |
147
147
 
@@ -52,7 +52,7 @@ export const DEFAULT_SETTINGS: Readonly<MiniLensSettings> = {
52
52
  "pi-mini-mode-context-percent-show": true,
53
53
  "pi-mini-mode-speed-show": true,
54
54
  "pi-mini-mode-speed-unit-show": true,
55
- "pi-mini-mode-minimal-show": false,
55
+ "pi-mini-mode-minimal-show": true,
56
56
  "pi-mini-mode-input-enhancements": true,
57
57
  "pi-mini-mode-minimal-thinking-show": true,
58
58
  "pi-mini-mode-minimal-tools-show": true,
@@ -71,7 +71,7 @@ const COPY = {
71
71
  totalDescription: "Total:当前会话分支上的全部 token,含工具上报的 LLM 用量。", cachedDescription: "Cached:累计 cache-read + cache-write token(包含在 Total 中)。", cacheHitDescription: "CH(cache hit):cache-read / (input + cache-read)。Cache write 不计入此比率。",
72
72
  enableMinimalDescription: "开启统一折叠思考、工具和技能过程;关闭恢复 Pi 默认会话历史。",
73
73
  inputEnhancementsDescription: "原生 Ctrl+V 粘贴图片(Windows/WSL:Alt+V);图片显示为 [image1] 标签,光标移入或全屏悬停可预览。空白后 / 选择技能并在光标处插入。Cmd+点击带下划线的图片标签或消息文件路径,用系统默认应用打开;预览及点击需终端支持。关闭仅恢复原生行为。",
74
- tuiRequired: "/pi-mini-mode-settings 需要 TUI 模式", saveFailed: "无法保存 Pi Mini Mode 设置", minimalRequired: "/pi-mini-mode-minimal 需要 TUI 模式", minimalUsage: "用法:/pi-mini-mode-minimal [on|off]", minimalState: "Pi Mini Mode 极简输出:", onboarding: "MCP 数量、点阵样式和极简输出默认关闭;其余项默认开启。", keepDefaults: "保留默认", configureNow: "立即配置",
74
+ tuiRequired: "/pi-mini-mode-settings 需要 TUI 模式", saveFailed: "无法保存 Pi Mini Mode 设置", minimalRequired: "/pi-mini-mode-minimal 需要 TUI 模式", minimalUsage: "用法:/pi-mini-mode-minimal [on|off]", minimalState: "Pi Mini Mode 极简输出:", onboarding: "MCP 数量和点阵样式默认关闭;极简输出、输入增强及其余项默认开启。", keepDefaults: "保留默认", configureNow: "立即配置",
75
75
  } as const;
76
76
 
77
77
  export function settingsPath(agentDir = process.env.PI_MINI_MODE_AGENT_DIR ?? join(homedir(), CONFIG_DIR_NAME, "agent")): string {
@@ -93,6 +93,12 @@ export function parseSettings(value: unknown): MiniLensSettings {
93
93
  return settings;
94
94
  }
95
95
 
96
+ /** Pi /model and other selectors own Ctrl+S; the editor exposes getText. */
97
+ export function focusedSelectorOwnsKeys(tui?: { getFocusedComponent?(): unknown } | null): boolean {
98
+ const focused = tui?.getFocusedComponent?.();
99
+ return !!focused && typeof focused === "object" && typeof (focused as { getText?: unknown }).getText !== "function";
100
+ }
101
+
96
102
  export async function loadSettings(path = settingsPath()): Promise<{ settings: MiniLensSettings; exists: boolean }> {
97
103
  try {
98
104
  return { settings: parseSettings(JSON.parse(await readFile(path, "utf8"))), exists: true };
@@ -858,6 +864,7 @@ export default function (pi: ExtensionAPI) {
858
864
  let shortcutTimer: ReturnType<typeof setTimeout> | undefined;
859
865
  let waitingTimer: ReturnType<typeof setInterval> | undefined;
860
866
  let unsubscribeMinimalInput: (() => void) | undefined;
867
+ let minimalTui: { getFocusedComponent?(): unknown } | undefined;
861
868
  let restoreAgentWidgets: (() => void) | undefined;
862
869
  let restoreTranscript: (() => void) | undefined;
863
870
  let persistAgentStatuses: (() => void) | undefined;
@@ -902,6 +909,7 @@ export default function (pi: ExtensionAPI) {
902
909
  if (settings["pi-mini-mode-minimal-show"] && ctx.mode === "tui") unsubscribeMinimalInput = ctx.ui.onTerminalInput?.((data) => {
903
910
  const nativeKey = matchesKey(data, "ctrl+alt+o");
904
911
  const subAgentKey = matchesKey(data, "ctrl+s");
912
+ if (!nativeKey && focusedSelectorOwnsKeys(minimalTui)) return;
905
913
  if (!nativeKey && (!restoreTranscript || (!subAgentKey && !matchesKey(data, "ctrl+o")))) return;
906
914
  // Input listeners run before Pi filters Kitty release/repeat events.
907
915
  if (isKeyRelease(data) || isKeyRepeat(data)) return { consume: true };
@@ -914,6 +922,7 @@ export default function (pi: ExtensionAPI) {
914
922
  return { consume: true };
915
923
  });
916
924
  if (nativeOutput || !settings["pi-mini-mode-minimal-show"] || ctx.mode !== "tui") {
925
+ minimalTui = undefined;
917
926
  lastAttachMode = undefined;
918
927
  ctx.ui.setWidget?.("pi-mini-mode-minimal-output", undefined);
919
928
  refreshMinimalOutput();
@@ -921,6 +930,7 @@ export default function (pi: ExtensionAPI) {
921
930
  return;
922
931
  }
923
932
  ctx.ui.setWidget("pi-mini-mode-minimal-output", (tui, theme) => {
933
+ minimalTui = tui as unknown as { getFocusedComponent?(): unknown };
924
934
  refreshMinimal = () => tui.requestRender();
925
935
  // Retain children under their originating user turn, including while idle,
926
936
  // after a follow-up user message, and when rebuilding a saved session.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@each1024/pi-mini-mode",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "A compact Pi footer with live usage metrics, theme-aware settings previews, and configurable progress bars.",
5
5
  "type": "module",
6
6
  "scripts": {