@each1024/pi-mini-mode 2.0.6 → 2.0.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.md CHANGED
@@ -60,7 +60,7 @@ pi install git:github.com/eachann1024/pi-mini-mode
60
60
 
61
61
  ![Image previews and compact labels in Pi Mini Mode](https://github.com/user-attachments/assets/2ea6d037-d3f0-423c-8588-17992a49d445)
62
62
 
63
- **Images at your cursor.** Move the editing cursor into an image path or compact label to preview it. Fullscreen also supports editor hover. Press `Esc` to dismiss.
63
+ **Images where you write.** Images appear as inline cards above the editor by default; you can switch to cursor popups in settings. Press `Esc` to dismiss a popup.
64
64
 
65
65
  **Less path clutter. Same image.** Image paths become underlined `[image1]` labels in the editor and messages, preserving the original path when submitted. Open the original image or another linked file in its default app using your terminal’s link gesture.
66
66
 
@@ -120,17 +120,15 @@ Example with optional Cached and MCP fields enabled:
120
120
  deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 ◇ MCP 3 500/1.0M ⣿⣀⣀⣀⣀⣀⣀⣀⣀⣀ 1% 120 tok/s
121
121
  ```
122
122
 
123
- 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; it runs again on the next interactive session. Print, JSON, and other non-interactive modes never prompt.
123
+ The first-run picker offers **Keep defaults (保留默认)**, **Open browser settings (打开浏览器设置)**, 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 HTML settings page in your browser 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; it runs again on the next interactive session. Print, JSON, and other non-interactive modes never prompt.
124
124
 
125
- Open that settings UI any time with:
125
+ Open settings any time in your browser with:
126
126
 
127
127
  ```text
128
128
  /pi-mini-mode-settings
129
129
  ```
130
130
 
131
- The focused option and its corresponding preview field use bold theme `accent` text with a `selectedBg` background. Fullscreen Pi supports hover to focus and click to toggle; regular terminal mode uses keyboard navigation. Hovering never changes a setting.
132
-
133
- Changes take effect immediately. The command requires Pi's TUI mode. Its preview always uses fixed example data rather than your current session, while reflecting every setting toggle immediately.
131
+ The command requires an interactive Pi session and opens settings in your browser. Changes save automatically and apply immediately where the current renderer supports them. Focus a preview item and use the left/right arrow keys, or drag it, to change the footer order. The preview uses fixed sample data. Resetting defaults restores feature switches, image preview mode, and footer visibility and order.
134
132
 
135
133
  Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-mini-mode.json`; installations with a different Pi config directory use that directory). A malformed or missing file safely falls back to the defaults.
136
134
 
package/README.zh-CN.md CHANGED
@@ -60,7 +60,7 @@ pi install git:github.com/eachann1024/pi-mini-mode
60
60
 
61
61
  ![图片预览与紧凑标签](https://github.com/user-attachments/assets/2ea6d037-d3f0-423c-8588-17992a49d445)
62
62
 
63
- **图片,随光标浮现。** 编辑光标移入图片路径或紧凑标签,即可预览。全屏编辑器也支持悬停,按 `Esc` 关闭。
63
+ **图片,就在输入框上方。** 图片默认以内联卡片显示,也可在设置中切换为光标浮窗。按 `Esc` 可关闭浮窗。
64
64
 
65
65
  **收起路径,保留原图。** 输入框和消息中的图片路径收纳为带下划线的 `[image1]` 标签,提交时保留原始路径。使用终端的链接点击手势,即可通过系统默认应用打开原图或其他文件。
66
66
 
@@ -120,7 +120,7 @@ pi install git:github.com/eachann1024/pi-mini-mode
120
120
  deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 ◇ MCP 3 500/1.0M ⣿⣀⣀⣀⣀⣀⣀⣀⣀⣀ 1% 120 tok/s
121
121
  ```
122
122
 
123
- 首次设置会提供 **Keep defaults(保留默认值)**、**Configure now(立即配置)** 和 **Apply recommended setup(应用推荐配置)**。保留默认值会保存默认字段选择、保持极简输出开启,并且不再显示首次设置提示;立即配置会直接打开同一设置列表。应用推荐配置会让你选择内置的 `cc-dark` 或 `cc-light` 主题,通过 Pi 官方设置 API 保存该主题和全局 `tuiMode=fullscreen`,立即应用主题,并提示重启 Pi(全屏渲染器在启动时决定)。项目设置和命令行参数可能覆盖全局设置。按 Esc/取消不会完成首次设置,下次交互式会话会再次提示。Print、JSON 等非交互模式不会显示提示。
123
+ 首次设置会提供 **保留默认**、**打开浏览器设置** 和 **应用推荐配置**。保留默认值会保存默认字段选择、保持极简输出开启,并且不再显示首次设置提示;立即配置会直接在浏览器中打开 HTML 设置页。应用推荐配置会让你选择内置的 `cc-dark` 或 `cc-light` 主题,通过 Pi 官方设置 API 保存该主题和全局 `tuiMode=fullscreen`,立即应用主题,并提示重启 Pi(全屏渲染器在启动时决定)。项目设置和命令行参数可能覆盖全局设置。按 Esc/取消不会完成首次设置,下次交互式会话会再次提示。Print、JSON 等非交互模式不会显示提示。
124
124
 
125
125
  设置保存在 Pi 的 agent 目录中,通常是 `~/.pi/agent/pi-mini-mode.json`;如果 Pi 使用其他配置目录,则保存在对应目录。文件缺失或格式错误时会安全回退到默认设置。设置示例:
126
126
 
@@ -171,7 +171,7 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 ◇ MCP 3 500
171
171
  生成速度设置中的 **显示 tok/s 单位** 是 **显示最新生成速度** 下方的缩进子设置。关闭它只会移除 `tok/s`,保留速度数字;即使隐藏生成速度,该子设置仍会保留。
172
172
 
173
173
 
174
- 设置命令需要 Pi 的 TUI 模式。预览使用固定示例数据而非当前会话,但会即时反映每项开关。选中项及对应预览字段会突出显示;全屏支持悬停聚焦、点击切换,普通终端使用键盘操作,悬停本身不会改变设置。
174
+ 设置命令需要 Pi 交互会话,并在浏览器中打开设置页。修改会自动保存,并在当前渲染器支持时立即生效。选中预览字段后按左右方向键,或拖拽字段,可调整状态栏顺序。预览使用固定示例数据,费用为估算值。恢复默认会重置功能开关、图片预览方式、字段显示与排序。
175
175
 
176
176
  </details>
177
177
 
@@ -36,6 +36,7 @@ export interface MiniLensSettings {
36
36
  "pi-mini-mode-speed-show": boolean;
37
37
  "pi-mini-mode-speed-unit-show": boolean;
38
38
  "pi-mini-mode-minimal-show": boolean;
39
+ "pi-mini-mode-minimal-record-limit": number;
39
40
  "pi-mini-mode-input-enhancements": boolean;
40
41
  "pi-mini-mode-image-preview": "hover" | "inline";
41
42
  "pi-mini-mode-minimal-thinking-show": boolean;
@@ -65,6 +66,7 @@ export const DEFAULT_SETTINGS: Readonly<MiniLensSettings> = {
65
66
  "pi-mini-mode-speed-show": true,
66
67
  "pi-mini-mode-speed-unit-show": true,
67
68
  "pi-mini-mode-minimal-show": true,
69
+ "pi-mini-mode-minimal-record-limit": 6,
68
70
  "pi-mini-mode-input-enhancements": true,
69
71
  "pi-mini-mode-image-preview": "inline",
70
72
  "pi-mini-mode-minimal-thinking-show": true,
@@ -85,8 +87,8 @@ const COPY = {
85
87
  model: "显示模型", thinking: "显示思考等级", total: "显示会话总 token", cached: "显示会话缓存 token", miss: "显示缓存 miss", totalLabel: "Total", cachedLabel: "Cached", cacheHitLabel: "CH", cacheHit: "显示缓存命中率 (CH)", price: "显示会话价格", mcp: "显示已启用 MCP 服务器", context: "显示上下文 token 与进度条", dots: "↳ 使用点阵进度条", percent: "显示上下文百分比", speed: "显示最近生成速度", speedUnit: "↳ 显示 tok/s 单位", inputEnhancements: "输入增强", showThinking: "显示思考", tools: "显示工具调用", output: "显示过程输出", skills: "显示技能", agentUsage: "显示 Agent token 用量", shortcut: "新 Agent 显示 Ctrl+O 提示(6 秒)",
86
88
  totalDescription: "Total:当前会话分支上的全部 token,含工具上报的 LLM 用量。", cachedDescription: "Cached:累计 cache-read + cache-write token(包含在 Total 中)。", cacheHitDescription: "CH(cache hit):cache-read / (input + cache-read)。Cache write 不计入此比率。",
87
89
  enableMinimalDescription: "开启统一折叠思考、工具和技能过程;关闭恢复 Pi 默认会话历史。",
88
- inputEnhancementsDescription: "原生 Ctrl+V 粘贴图片(Windows/WSL:Alt+V);图片显示为 [image1] 标签,光标移入或全屏悬停可预览。空白后 / 选择技能并在光标处插入。Cmd+点击带下划线的图片标签或消息文件路径,用系统默认应用打开;预览及点击需终端支持。关闭仅恢复原生行为。",
89
- 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: "多数功能默认开启;「仅显示分支」「缓存 token」「MCP」默认关,「仅显示分支」与「项目与分支」互斥。可用 /pi-mini-mode-settings 再改。", keepDefaults: "保留默认", configureNow: "立即配置", applyRecommended: "应用推荐配置", chooseTheme: "选择 Pi Mini Mode 主题(将保存全局主题和全屏模式;重启后生效)", themeSaved: "已保存推荐主题和全屏模式。请重启 Pi;项目设置或命令行参数可能覆盖全局设置。", themeSaveFailed: "无法保存推荐的 Pi 主题和全屏模式;未完成首次配置。", themeApplyFailed: "推荐设置已保存,但当前主题未能立即应用;请重启 Pi。",
90
+ inputEnhancementsDescription: "原生 Ctrl+V 粘贴图片(Windows/WSL:Alt+V);图片显示为 [image1] 标签,默认在输入框上方显示内联卡片(可切换光标悬停模式)。空白后 / 选择技能并在光标处插入。Cmd+点击带下划线的图片标签或消息文件路径,用系统默认应用打开;预览及点击需终端支持。关闭仅恢复原生行为。",
91
+ 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: "默认开启输入增强和极简输出;极简输出需要全屏模式。仅显示分支、缓存 token 和 MCP 服务数默认关闭。选择「打开浏览器设置」可调整字段、预览方式和功能开关;推荐配置会保存主题和全屏模式。以后可用 /pi-mini-mode-settings 修改。", keepDefaults: "保留默认", configureNow: "打开浏览器设置", applyRecommended: "应用推荐配置", chooseTheme: "选择主题(主题立即应用;全屏模式需重启 Pi)", themeSaved: "已保存主题和全屏模式。请重启 Pi 以启用全屏;项目设置或命令行参数可能覆盖全局设置。", themeSaveFailed: "无法保存推荐的 Pi 主题和全屏模式;未完成首次配置。", themeApplyFailed: "推荐设置已保存,但当前主题未能立即应用;请重启 Pi。",
90
92
  } as const;
91
93
 
92
94
  const RECOMMENDED_THEMES = ["cc-dark", "cc-light"] as const;
@@ -100,12 +102,18 @@ function isBoolean(value: unknown): value is boolean {
100
102
  return typeof value === "boolean";
101
103
  }
102
104
 
105
+ function isRecordLimit(value: unknown): value is number {
106
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
107
+ }
108
+
103
109
  export function parseSettings(value: unknown): MiniLensSettings {
104
110
  const candidate = value && typeof value === "object" ? value as Record<string, unknown> : {};
105
111
  const settings = { ...DEFAULT_SETTINGS };
106
112
  for (const id of SETTING_IDS) {
107
113
  if (id === "pi-mini-mode-image-preview") {
108
114
  if (candidate[id] === "hover" || candidate[id] === "inline") settings[id] = candidate[id];
115
+ } else if (id === "pi-mini-mode-minimal-record-limit") {
116
+ if (isRecordLimit(candidate[id])) settings[id] = candidate[id];
109
117
  } else if (isBoolean(candidate[id])) settings[id] = candidate[id];
110
118
  }
111
119
  if (Array.isArray(candidate.footerOrder)) {
@@ -119,7 +127,7 @@ export function parseSettings(value: unknown): MiniLensSettings {
119
127
  return settings;
120
128
  }
121
129
 
122
- /** True when saved JSON is missing a boolean key or a footer field, so defaults can be written back. */
130
+ /** True when saved JSON is missing a setting or a footer field, so defaults can be written back. */
123
131
  export function settingsNeedBackfill(raw: unknown, parsed: MiniLensSettings): boolean {
124
132
  if (!raw || typeof raw !== "object") return true;
125
133
  const candidate = raw as Record<string, unknown>;
@@ -495,7 +503,7 @@ export function isCollapsedReplyChildSetting(id: string): boolean {
495
503
 
496
504
  export function settingsItems(settings: MiniLensSettings): SettingItem[] {
497
505
  const values = ["on", "off"];
498
- const labels: Record<Exclude<keyof MiniLensSettings, "onboardingCompleted" | "footerOrder" | "pi-mini-mode-image-preview">, string> = {
506
+ const labels: Record<Exclude<keyof MiniLensSettings, "onboardingCompleted" | "footerOrder" | "pi-mini-mode-image-preview" | "pi-mini-mode-minimal-record-limit">, string> = {
499
507
  "pi-mini-mode-project-branch-show": "显示项目名称和分支(互斥)",
500
508
  "pi-mini-mode-branch-show": "仅显示分支(思考等级后,互斥)",
501
509
  "pi-mini-mode-model-show": COPY.model, "pi-mini-mode-thinking-show": COPY.thinking, "pi-mini-mode-session-tokens-show": COPY.total, "pi-mini-mode-cache-tokens-show": COPY.cached, "pi-mini-mode-cache-miss-show": COPY.miss, "pi-mini-mode-ch-show": COPY.cacheHit, "pi-mini-mode-cost-show": COPY.price, "pi-mini-mode-mcp-show": COPY.mcp, "pi-mini-mode-context-show": COPY.context, "pi-mini-mode-context-dots-show": COPY.dots, "pi-mini-mode-context-percent-show": COPY.percent, "pi-mini-mode-speed-show": COPY.speed, "pi-mini-mode-speed-unit-show": COPY.speedUnit, "pi-mini-mode-minimal-show": COPY.minimal, "pi-mini-mode-input-enhancements": COPY.inputEnhancements, "pi-mini-mode-minimal-thinking-show": COPY.showThinking, "pi-mini-mode-minimal-tools-show": COPY.tools, "pi-mini-mode-minimal-output-show": COPY.output, "pi-mini-mode-minimal-skills-show": COPY.skills, "pi-mini-mode-agent-usage-show": COPY.agentUsage, "pi-mini-mode-agent-shortcut-show": COPY.shortcut,
@@ -601,7 +609,7 @@ export function formatToolElapsed(startedAt: number | undefined, endedAt = Date.
601
609
 
602
610
  function ensureThinkingClock(turn: MinimalTurn, index: number, startedAt = Date.now()): ThinkingClock {
603
611
  const clocks = turn.thinkingClocks ??= [];
604
- return clocks[index] ??= { startedAt: turn.startedAt ?? startedAt };
612
+ return clocks[index] ??= { startedAt };
605
613
  }
606
614
 
607
615
  function freezeThinkingClock(turn: MinimalTurn | undefined, index: number | undefined, endedAt = Date.now()): void {
@@ -617,7 +625,7 @@ function freezeOpenThinkingClocks(turn: MinimalTurn | undefined, endedAt = Date.
617
625
  }
618
626
  }
619
627
 
620
- /** Active Thinking counts from the turn start; completed Thinking keeps the frozen stop time. */
628
+ /** Each Thinking row counts from its own start and keeps its frozen stop time. */
621
629
  export function formatThinkingElapsed(
622
630
  turn: Pick<MinimalTurn, "startedAt" | "thinkingClocks">,
623
631
  processIndex: number,
@@ -625,7 +633,7 @@ export function formatThinkingElapsed(
625
633
  now = Date.now(),
626
634
  ): string {
627
635
  const clock = turn.thinkingClocks?.[processIndex];
628
- const startedAt = clock?.startedAt ?? turn.startedAt;
636
+ const startedAt = clock?.startedAt;
629
637
  if (active && startedAt != null) return `${(Math.max(0, now - startedAt) / 1_000).toFixed(1)}s`;
630
638
  if (clock?.endedAt != null) return `${(Math.max(0, clock.endedAt - clock.startedAt) / 1_000).toFixed(1)}s`;
631
639
  return "";
@@ -759,7 +767,7 @@ function visibleMinimalTurns(settings: MiniLensSettings, turns: MinimalTurn[]):
759
767
  });
760
768
  }
761
769
 
762
- export function minimalOutputComponent(theme: ExtensionContext["ui"]["theme"], getTurns: () => MinimalTurn[], isExpanded: () => boolean = () => false, showShortcut: (turn: MinimalTurn) => boolean = () => true, showUsage: () => boolean = () => true, subAgentsExpanded: () => boolean = () => false, agentDeadlines = new Map<string, number>(), transformText: (text: string) => string = text => text, imageOptions?: { cwd(): string; requestRender(): void; write?(data: string): void }) {
770
+ export function minimalOutputComponent(theme: ExtensionContext["ui"]["theme"], getTurns: () => MinimalTurn[], isExpanded: () => boolean = () => false, showShortcut: (turn: MinimalTurn) => boolean = () => true, showUsage: () => boolean = () => true, subAgentsExpanded: () => boolean = () => false, agentDeadlines = new Map<string, number>(), transformText: (text: string) => string = text => text, imageOptions?: { cwd(): string; requestRender(): void; write?(data: string): void }, getRecordLimit: () => number = () => DEFAULT_SETTINGS["pi-mini-mode-minimal-record-limit"]) {
763
771
  const placeholderText = (text: string) => imageOptions ? imagePlaceholders(text, imageOptions.cwd()) : text;
764
772
  const markdown = (text: string, width: number, process = false) => renderMinimalMarkdown(text, width, getMarkdownTheme(), theme.getBgAnsi?.("userMessageBg") ?? "",
765
773
  { color: (value) => theme.fg(process ? "muted" : "text", value) }, (source, available) => transformText(placeholderText(diagramMarkdown(source, available))));
@@ -778,7 +786,6 @@ export function minimalOutputComponent(theme: ExtensionContext["ui"]["theme"], g
778
786
  const expandedTools = new Set<string>();
779
787
  const expandedThinking = new Set<string>();
780
788
  const thinkingPreviews = new Map<string, { text: string; width: number; rows: number; updatedAt: number }>();
781
- const PROCESS_PREVIEW_ROWS = 6;
782
789
  const agentModes = new Map<number, "all" | "preview" | "closed">();
783
790
  const runningTurns = new Set<number>();
784
791
  let pinnedToolId: string | undefined;
@@ -979,11 +986,10 @@ export function minimalOutputComponent(theme: ExtensionContext["ui"]["theme"], g
979
986
  }
980
987
  const agentTurnControls: Array<{ runId: string; y: number; width: number; line: string }> = [];
981
988
  const agents = liveAgentView(turn.subAgents ?? [], theme, width, subAgentsExpanded(), true, agentDeadlines, Date.now(), expandedSubagents, agentTurnControls);
982
- if (agents.total && !entries.length) entries.push({ title: `SubAgent ${agents.done + agents.errors}/${agents.total}`, detail: "", state: agents.running ? "running" : agents.errors ? "error" : "done", id: `agents:${index}`, thinking: false, processIndex: -1, activeThinking: false });
983
989
  const active = !!turn.running || agents.running > 0 || entries.some(entry => entry.state === "running") || (turn.waitingTools?.length ?? 0) > 0;
984
990
  if (active) runningTurns.add(index);
985
991
  else if (runningTurns.delete(index)) {
986
- // Return to the six-row preview once; a later click can expand everything again.
992
+ // Return to the configured preview once; a later click can expand everything again.
987
993
  if (agentModes.get(index) === "all") {
988
994
  agentModes.set(index, "preview");
989
995
  expandedThinking.clear();
@@ -997,8 +1003,10 @@ export function minimalOutputComponent(theme: ExtensionContext["ui"]["theme"], g
997
1003
  const expanded = mode === "all";
998
1004
  const busy = entries.some(entry => entry.state === "running") || (turn.waitingTools?.length ?? 0) > 0;
999
1005
  const working = turn.running && !busy && !turn.final;
1000
- // Six recent records stay visible while running and after completion.
1001
- const shown = mode === "closed" ? [] : expanded ? entries : entries.slice(-PROCESS_PREVIEW_ROWS);
1006
+ // Every child keeps its heading; process records share the remaining preview budget.
1007
+ const processLimit = Math.max(0, getRecordLimit() - agents.total);
1008
+ const shown = mode === "closed" ? [] : expanded ? entries : processLimit ? entries.slice(-processLimit) : [];
1009
+ const showWorking = working && (expanded || (!shown.length && !agents.total));
1002
1010
  const done = entries.filter(entry => entry.state === "done").length;
1003
1011
  // ponytail: two terminal text frames; use Pi's motion preference if it exposes one.
1004
1012
  const sparkle = active ? Math.floor(Date.now() / 360) % 2 ? "✧" : "✦" : "✦";
@@ -1015,9 +1023,9 @@ export function minimalOutputComponent(theme: ExtensionContext["ui"]["theme"], g
1015
1023
  ? theme.fg("muted", "会话 ") + theme.bold(theme.fg("text", formatTokens(usage.totalTokens)))
1016
1024
  + theme.fg("muted", " · 缓存 ") + theme.bold(theme.fg("text", formatTokens(usage.cacheRead)))
1017
1025
  : "";
1018
- const recordCount = entries.filter(entry => !entry.title.startsWith("SubAgent ")).length || agents.total;
1026
+ const recordCount = entries.length + agents.total;
1019
1027
  const progressHeader = theme.fg(active ? "accent" : "muted", sparkle + " ") + theme.bold(theme.fg("text", "Agent")) + theme.fg("muted", recordCount ? ` · ${recordCount}` : "");
1020
- const showAgentRows = mode !== "closed" && expanded;
1028
+ const showAgentRows = agents.total > 0;
1021
1029
  const caret = theme.fg("muted", expanded ? " ▾" : " ▸");
1022
1030
  const elapsedHeader = turn.startedAt == null ? "" : theme.fg("muted", " · ") + theme.fg(active ? "success" : "muted", formatElapsed(turn.startedAt, turn.endedAt ?? Date.now()));
1023
1031
  const left = progressHeader + elapsedHeader + caret;
@@ -1050,7 +1058,7 @@ export function minimalOutputComponent(theme: ExtensionContext["ui"]["theme"], g
1050
1058
  const keepStatus = entry.state === "running" || (open && entry.state === "error");
1051
1059
  const glyph = arrow ? (open ? "▼" : "▶") + (keepStatus ? ` ${status}` : "") : status;
1052
1060
  const glyphColor = entry.state === "error" ? "error" : entry.state === "running" || arrow ? "accent" : "muted";
1053
- const last = row === shown.length - 1 && !working && (!showAgentRows || !agents.rows.length);
1061
+ const last = row === shown.length - 1 && !showWorking && !agents.rows.length;
1054
1062
  const prefix = theme.fg(open ? "accent" : "dim", "│ ") + (entry.state === "running" || entry.state === "error" || arrow ? theme.fg(glyphColor, glyph) + " " : "") + summary;
1055
1063
  if (label === "Output") {
1056
1064
  // Wrapped output hangs under the body column and keeps the tree rail to the next sibling.
@@ -1108,7 +1116,7 @@ export function minimalOutputComponent(theme: ExtensionContext["ui"]["theme"], g
1108
1116
  }
1109
1117
  lines.push(...agents.rows);
1110
1118
  }
1111
- if (working && (expanded || !shown.length)) {
1119
+ if (showWorking) {
1112
1120
  const label = turn.awaitingResponse && !shown.length ? "Thinking" : "Working";
1113
1121
  const prefix = theme.fg("dim", "└─ ") + theme.fg("accent", `${runningGlyph()} `) + theme.fg("text", theme.bold(label)) + " ";
1114
1122
  lines.push(truncateToWidth(prefix + theme.fg("muted", turn.awaitingResponse ? "等待模型响应" : "等待下一步执行"), width, ""));
@@ -1260,7 +1268,7 @@ export default function (pi: ExtensionAPI) {
1260
1268
  cwd: () => ctx.cwd,
1261
1269
  requestRender: () => tui.requestRender(),
1262
1270
  write: data => tui.terminal.write(data),
1263
- });
1271
+ }, () => settings["pi-mini-mode-minimal-record-limit"]);
1264
1272
  const hintRemaining = (activeMinimalTurn?.shortcutHintUntil ?? 0) - Date.now();
1265
1273
  if (hintRemaining > 0) {
1266
1274
  shortcutTimer = setTimeout(() => tui.requestRender(), hintRemaining);
@@ -1432,6 +1440,8 @@ export default function (pi: ExtensionAPI) {
1432
1440
  || entry.some(id => typeof id !== "string" || !(FOOTER_FIELDS as readonly string[]).includes(id))) throw new TypeError("Invalid order");
1433
1441
  } else if (key === "pi-mini-mode-image-preview") {
1434
1442
  if (entry !== "hover" && entry !== "inline") throw new TypeError("Invalid preview mode");
1443
+ } else if (key === "pi-mini-mode-minimal-record-limit") {
1444
+ if (!isRecordLimit(entry)) throw new TypeError("Invalid record limit");
1435
1445
  } else if (!SETTING_IDS.includes(key as typeof SETTING_IDS[number]) || typeof entry !== "boolean") throw new TypeError("Invalid setting");
1436
1446
  }
1437
1447
  const next = parseSettings({ ...settings, ...input, onboardingCompleted: true });
@@ -1492,7 +1502,7 @@ export default function (pi: ExtensionAPI) {
1492
1502
  if (choice === COPY.configureNow) await openSettings(ctx);
1493
1503
  };
1494
1504
  pi.registerCommand("pi-mini-mode-settings", {
1495
- description: "Open HTML settings in the browser",
1505
+ description: "Open browser settings for footer fields, image previews, and minimal output",
1496
1506
  handler: async (_args, ctx) => openSettings(ctx),
1497
1507
  });
1498
1508
 
package/lib/file-links.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
- import { dirname, isAbsolute, resolve } from "node:path";
3
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import { Marked, getCapabilities, sliceByColumn, stripTerminalSequences, visibleWidth } from "@earendil-works/pi-tui";
6
6
 
@@ -23,6 +23,21 @@ export function localPath(path: string, cwd: string): string {
23
23
  return path.startsWith("~/") ? resolve(homedir(), path.slice(2)) : isAbsolute(path) ? path : resolve(cwd, path);
24
24
  }
25
25
 
26
+ /** Otty always underlines OSC 8; ordinary paths use its Cmd-only detection instead. */
27
+ function nativePathLinks(): boolean {
28
+ return process.env.TERM_PROGRAM?.toLowerCase() === "otty"
29
+ && !process.env.TMUX && !process.env.STY && !/^(tmux|screen)/i.test(process.env.TERM ?? "");
30
+ }
31
+
32
+ /** Short forms must remain real paths that Otty can resolve from the pane's cwd. */
33
+ function nativePathLabel(path: string, cwd: string): string {
34
+ const fromCwd = relative(cwd, path);
35
+ if (fromCwd && fromCwd !== ".." && !fromCwd.startsWith("../") && !isAbsolute(fromCwd)) return `./${fromCwd}`;
36
+ const fromHome = relative(homedir(), path);
37
+ if (fromHome && fromHome !== ".." && !fromHome.startsWith("../") && !isAbsolute(fromHome)) return `~/${fromHome}`;
38
+ return path;
39
+ }
40
+
26
41
  /** Opening/closing fences must stay intact; quoted paths inside them are not links. */
27
42
  function fenceRanges(text: string): Array<[number, number]> {
28
43
  const ranges: Array<[number, number]> = [];
@@ -67,14 +82,15 @@ export const fileLink = (text: string, path: string, underline = true) => `\x1b]
67
82
 
68
83
  /** Shorten only visible tool labels; OSC 8 targets retain the complete original path. */
69
84
  export function linkToolFiles(text: string, cwd: string, compact: boolean): string {
70
- const shorten = (label: string) => compact ? label
85
+ const native = nativePathLinks();
86
+ const shorten = (label: string) => compact && !native ? label
71
87
  .replace(/\/var\/folders\/[^\s]*\/otty-paste\//g, "…/otty-paste/")
72
88
  .replace(/node_modules\/@earendil-works\//g, "…/") : label;
73
89
  const hyperlinks = inputCapabilities().hyperlinks;
74
90
  // Image chips already carry a complete target; never shorten or relink it.
75
91
  return text.split(/(\x1b\]8;[^\x07]*\x07[\s\S]*?\x1b\]8;;\x07)/g).map((part, index) => {
76
92
  if (index % 2) return part;
77
- if (!hyperlinks) return shorten(part);
93
+ if (!hyperlinks && !native) return shorten(part);
78
94
  // A path tool's entire argument can contain spaces or punctuation without quotes.
79
95
  const matches = part && !/[\x00-\x1f\x7f]/.test(part) && existsSync(localPath(part, cwd))
80
96
  ? [{ path: part, start: 0, end: part.length }] : filePaths(part);
@@ -82,8 +98,9 @@ export function linkToolFiles(text: string, cwd: string, compact: boolean): stri
82
98
  for (const match of matches) {
83
99
  const path = localPath(match.path, cwd);
84
100
  result += shorten(part.slice(offset, match.start));
85
- const label = shorten(part.slice(match.start, match.end));
86
- result += existsSync(path) ? fileLink(label, path, false) : label;
101
+ const exists = existsSync(path);
102
+ const label = native && compact && exists ? nativePathLabel(path, cwd) : shorten(part.slice(match.start, match.end));
103
+ result += exists && !native ? fileLink(label, path, false) : label;
87
104
  offset = match.end;
88
105
  }
89
106
  return result + shorten(part.slice(offset));
@@ -93,6 +110,7 @@ export function linkToolFiles(text: string, cwd: string, compact: boolean): stri
93
110
  /** Display-only: normalize local targets without changing persisted messages or remote URLs. */
94
111
  export function linkMessageFiles(text: string, cwd: string): string {
95
112
  if (!inputCapabilities().hyperlinks) return text;
113
+ const native = nativePathLinks();
96
114
  let imageNumber = 0;
97
115
  return text.split(/(\x1b\]8;[^\x07]*(?:\x07)[\s\S]*?\x1b\]8;;\x07|\[[^\]\n]*\]\([^\n]*?\))/g).map((part, index) => {
98
116
  if (index % 2) {
@@ -108,7 +126,9 @@ export function linkMessageFiles(text: string, cwd: string): string {
108
126
  for (const match of matches.reverse()) {
109
127
  const path = localPath(match.path, cwd);
110
128
  if (!existsSync(path)) continue;
111
- part = part.slice(0, match.start) + fileLink(match.image ? ` #${match.number}` : match.path, path, !match.image) + part.slice(match.end);
129
+ const label = native && !match.image ? part.slice(match.start, match.end)
130
+ : fileLink(match.image ? ` #${match.number}` : match.path, path, !match.image);
131
+ part = part.slice(0, match.start) + label + part.slice(match.end);
112
132
  }
113
133
  return part;
114
134
  }).join("");
package/lib/settings.html CHANGED
@@ -7,6 +7,7 @@
7
7
  *{box-sizing:border-box}body{margin:0;background:var(--background);color:var(--foreground);font:var(--text-base)/1.5 ui-sans-serif,system-ui,sans-serif}main{max-width:1080px;margin:auto;padding:40px 24px 72px}header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}h1{font:italic 400 var(--text-lg)/1.05 "Didot","Bodoni 72","Iowan Old Style","Songti SC","STSong",serif;letter-spacing:.04em;margin:0}h2{font-size:var(--text-sm);font-weight:600;margin:0 0 12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}nav{display:flex;gap:8px;align-items:center}.hint{margin:12px 0 0;color:var(--accent);font-weight:600}section{margin:28px 0}button{font:inherit;color:inherit;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:8px 12px;cursor:pointer}button:disabled{opacity:.4;cursor:default}:focus-visible{outline:2px solid var(--ring);outline-offset:3px}#preview{position:relative;padding:16px 20px;background:var(--preview-bg);color:var(--preview-text);border:1px dashed var(--border);border-radius:var(--radius);font:var(--text-sm)/1.8 ui-monospace,monospace;display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;height:112px;overflow:auto}#preview button{flex:none;font:inherit;padding:4px 2px;border-color:transparent;background:transparent;color:var(--preview-muted);cursor:grab;white-space:nowrap}#preview button:focus-visible{border-color:var(--accent)}#preview button.over{border-left:2px solid var(--accent)}#preview button.preview-exit{opacity:0;pointer-events:none;transition:opacity 280ms ease-in;position:absolute}#preview .tone-accent{color:var(--preview-accent);font-weight:650}#preview .tone-text{color:var(--preview-text)}#preview .tone-warning{color:var(--preview-warning);font-weight:650}#preview .tone-success{color:var(--preview-success);font-weight:650}#preview .tone-error{color:var(--preview-error);font-weight:650}#preview .tone-muted{color:var(--preview-muted)}#preview #preview-context{flex:1 1 180px;display:flex;align-items:center;gap:8px;min-width:180px}.progress{flex:1;overflow:hidden;text-align:left;color:var(--preview-accent);min-width:0}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:2px 6px}label{display:flex;align-items:center;gap:10px;padding:10px 0;cursor:pointer;-webkit-user-select:none;user-select:none}.grid label{border:1px solid transparent;border-radius:var(--radius);padding:10px}input{accent-color:var(--accent);width:18px;height:18px;flex-shrink:0}.dragging{opacity:.45}#statusbar{position:fixed;top:12px;right:12px;z-index:2;display:flex;align-items:center;gap:10px;max-width:min(520px,calc(100vw - 24px));padding:8px 12px;background:var(--surface);border:1px solid var(--accent);border-radius:var(--radius);box-shadow:0 6px 20px rgb(0 0 0/.12);color:var(--accent);font-size:var(--text-sm);opacity:0;transform:translateY(-6px);transition:opacity 150ms ease-out,transform 150ms ease-out;pointer-events:none}#statusbar.on{opacity:1;transform:none}#statusbar.error{border-color:var(--destructive);color:var(--destructive)}#statusbar #retry{pointer-events:auto}[hidden]{display:none!important}nav button[aria-pressed=true]{border-color:var(--accent);color:var(--accent)}.features{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:12px}.feature{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px}.feature-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.feature-head h3{margin:0;font-size:var(--text-base);font-weight:600}.feature-body{margin:10px 0 0;color:var(--muted);font-size:var(--text-sm);line-height:1.65}.feature-points{margin:10px 0 0;padding-left:1.15em;font-size:var(--text-sm);line-height:1.7}.feature-points li{margin:2px 0}.feature-points li::marker{color:var(--accent)}.feature-hint{margin:auto 0 0;padding-top:12px;color:var(--muted);font:var(--text-sm)/1.6 ui-monospace,monospace;overflow-wrap:anywhere}.feature-hint::before{content:'› ';color:var(--accent)}.preview-mode{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:14px 0 0;font-size:var(--text-sm)}.preview-mode select{font:inherit;color:var(--foreground);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:8px;min-height:44px}.preview-mode select:disabled{opacity:.5}.switch{display:flex;align-items:center;gap:8px;padding:0;font-size:var(--text-sm);color:var(--muted)}.notice{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;margin:20px 0 0;padding:14px 16px;background:var(--surface);border:1px solid var(--accent);border-left-width:4px;border-radius:var(--radius)}.notice strong{font-size:var(--text-sm)}.notice p{margin:6px 0 0;color:var(--muted);font-size:var(--text-sm);line-height:1.6;max-width:640px}.notice code{display:block;margin:0 0 8px;padding:8px 10px;background:var(--background);border:1px solid var(--border);border-radius:var(--radius);font:var(--text-sm)/1.5 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-width:520px;color:var(--foreground)}#preview{margin-top:12px;margin-bottom:20px}@media(max-width:450px){h1{font-size:2rem}main{padding:24px 16px}#statusbar{top:8px;right:8px;max-width:calc(100vw - 16px)}}@media(prefers-reduced-motion:reduce){#preview button.preview-exit{transition-duration:80ms}}@media(prefers-reduced-motion:reduce){#statusbar{transform:none;transition:opacity 80ms ease-out}}
8
8
  @media(hover:hover) and (pointer:fine){#preview button:hover,.grid label:hover,.feature:hover{border-color:var(--accent)}}
9
9
  #preview button.preview-highlight{border-color:var(--accent)}#preview button.preview-placeholder{border-style:dashed;opacity:1}
10
+ .preview-mode input[type=number]{font:inherit;color:var(--foreground);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:8px;width:6em;height:44px}.preview-mode input:disabled{opacity:.5}
10
11
 
11
12
  /* Editorial headings; controls and status data retain readable system fonts. */
12
13
  body{background:light-dark(#f6f3ed,#141614)}main{max-width:1160px;padding:32px 32px 88px}header{align-items:flex-start;border-bottom:1px solid var(--border);padding-bottom:36px}h1{font:italic 400 clamp(2.625rem,5vw,3.625rem)/1.06 "Didot","Bodoni 72","Songti SC","STSong",serif;letter-spacing:.02em}.subtitle{font:normal 1.625rem/1.4 "Didot","Bodoni 72","Songti SC","STSong",serif;color:var(--accent);margin:16px 0 0}h2{font:normal 2rem/1.25 "Didot","Bodoni 72","Songti SC","STSong",serif;letter-spacing:0;text-transform:none;color:var(--foreground);margin:0 0 16px}section{margin:0;padding-top:24px}.feature-head h3{font:normal 1.625rem/1.25 "Didot","Bodoni 72","Songti SC","STSong",serif}.feature{padding:20px}.feature:first-child{border-top:3px solid var(--accent)}.feature-body,.feature-points{line-height:1.7}#preview{background:var(--surface);border:1px solid var(--border);padding:16px 24px;height:80px;margin-bottom:12px}.grid label{min-height:44px}@media(max-width:760px){main{padding:20px 16px 64px}header{padding-bottom:20px}.features{grid-template-columns:1fr}h2{font-size:1.75rem}.subtitle{font-size:1.375rem}}
@@ -34,28 +35,30 @@ const $=id=>document.getElementById(id),token=location.hash.slice(1);
34
35
  history.replaceState(null,'',location.pathname);
35
36
  const I18N={
36
37
  title:{zh:'Pi Mini Mode',en:'Pi Mini Mode'},
37
- subtitle:{zh:'轻一点,读得更远。',en:'A quieter way to think.'},
38
+ subtitle:{zh:'调整状态栏、图片预览和对话折叠。',en:'Adjust your footer, image previews, and conversation folding.'},
38
39
  documentTitle:{zh:'Pi Mini Mode 设置',en:'Pi Mini Mode Settings'},
39
- dragHint:{zh:'拖拽预览中的字段可调整顺序,松手自动保存。',en:'Drag preview items to reorder · saves on drop.'},
40
+ dragHint:{zh:'拖拽或左右方向键调整预览字段顺序,改动自动保存。',en:'Drag or use Arrow Left/Right to reorder preview items · saves automatically.'},
40
41
  featuresHeading:{zh:'功能说明',en:'Features'},
41
- fieldsHeading:{zh:'状态栏字段与预览',en:'Status bar items & preview'},
42
+ fieldsHeading:{zh:'状态栏字段与预览(示例数据)',en:'Status bar items & preview (sample data)'},
42
43
  optionsHeading:{zh:'状态栏样式',en:'Status bar style'},
43
44
  on:{zh:'开启',en:'On'},off:{zh:'关闭',en:'Off'},previewModeLabel:{zh:'图片预览方式',en:'Image preview mode'},previewHover:{zh:'光标浮窗',en:'Cursor popup'},previewInline:{zh:'内联卡片(多图排列)',en:'Inline cards (multiple images)'},previewModeHint:{zh:'卡片显示在输入框上方;终端不支持图片时显示占位。',en:'Cards appear above the editor; unsupported terminals show placeholders.'},
45
+ recordLimitLabel:{zh:'折叠时记录数',en:'Collapsed record limit'},
46
+ recordLimitHint:{zh:'默认 6 条。子代理始终显示,每个占一条;剩余额度显示最新执行记录。子代理超过上限时,仅显示全部子代理。',en:'Defaults to 6. Every subagent stays visible and uses one record; remaining slots show the latest execution records. When subagents exceed the limit, only their rows remain.'},
44
47
  featureList:{
45
48
  zh:[
46
- {id:'minimal',setting:'pi-mini-mode-minimal-show',title:'极简输出',body:'把对话收成结论:思考、工具与技能汇成一棵按时间排序的可折叠过程树。',points:['长用户消息默认保留前四行,点击展开全文','子代理行可展开活动记录与输出','Ctrl+O 展开或收起过程树,新问题默认收起','最终 Markdown 流畅呈现,失败与中断明确标记']},
47
- {id:'input-enhancements',setting:'pi-mini-mode-input-enhancements',title:'输入增强',body:'让输入框和消息里的图片、技能与文件路径直接可用。',points:['光标移入图片路径即可预览,全屏编辑器同样支持','图片路径收纳为 [image1] 标签,提交时保留原图','空白后输入 / 就地搜索技能并插入光标处','点击图片标签或文件路径,用系统默认应用打开'],hint:'Ctrl+V 粘贴图片(Windows/WSL 使用 Alt+V)'},
49
+ {id:'minimal',setting:'pi-mini-mode-minimal-show',title:'极简输出',body:'在全屏模式下,把思考、工具与技能记录收进一棵可折叠过程树,保留完整回复。',points:['长用户消息显示前四行,点击展开全文','子代理始终显示,可展开活动记录与输出','Ctrl+O 展开或收起过程树,新问题默认收起','最终 Markdown 流畅呈现,失败与中断明确标记']},
50
+ {id:'input-enhancements',setting:'pi-mini-mode-input-enhancements',title:'输入增强',body:'让输入框和消息里的图片、技能与文件路径直接可用。',points:['图片默认以内联卡片陈列于输入框上方,亦可切换光标悬停','图片路径收纳为 [image1] 标签,提交时保留原图','空白后输入 / 就地搜索技能并插入光标处','点击图片标签或文件路径,用系统默认应用打开'],hint:'Ctrl+V 粘贴图片(Windows/WSL 使用 Alt+V)'},
48
51
  {id:'themes',title:'明暗主题',body:'主题让 Markdown、代码高亮、表格与 Mermaid 图表跟随明暗切换。',points:['用户消息使用主题用户背景色,与正文区分','不支持、不完整或过宽的图表保留源文本'],hint:'回到 Pi,输入 /settings → Theme,选择 cc-dark / cc-light'}
49
52
  ],
50
53
  en:[
51
- {id:'minimal',setting:'pi-mini-mode-minimal-show',title:'Minimal transcript',body:'Turns the conversation into conclusions: thinking, tools and skills collapse into one chronological, foldable tree.',points:['Long user messages keep four lines; click to expand','Subagent rows expand to activity and output','Ctrl+O expands or collapses the full process tree; new questions start collapsed','Final Markdown streams plainly; failures and interrupts are marked']},
52
- {id:'input-enhancements',setting:'pi-mini-mode-input-enhancements',title:'Input enhancements',body:'Makes images, skills and file paths usable right where you type.',points:['Preview an image as soon as the cursor enters its path, in fullscreen too','Image paths collapse to [image1] labels while keeping the original path on submit','Type / after a space to search skills and insert at the cursor','Click image labels or file paths to open them in the default app'],hint:'Ctrl+V pastes images (Windows/WSL: Alt+V)'},
54
+ {id:'minimal',setting:'pi-mini-mode-minimal-show',title:'Minimal transcript',body:'In fullscreen mode, fold thinking, tools and skill reads into one process tree while keeping the full reply.',points:['Long user messages show four rendered rows; click to expand','Subagents stay visible; click to expand activity and output','Ctrl+O expands or collapses the full process tree; new questions start collapsed','Final Markdown streams plainly; failures and interrupts are marked']},
55
+ {id:'input-enhancements',setting:'pi-mini-mode-input-enhancements',title:'Input enhancements',body:'Makes images, skills and file paths usable right where you type.',points:['Images appear as inline cards above the editor by default, with optional cursor hover','Image paths collapse to [image1] labels while keeping the original path on submit','Type / after a space to search skills and insert at the cursor','Click image labels or file paths to open them in the default app'],hint:'Ctrl+V pastes images (Windows/WSL: Alt+V)'},
53
56
  {id:'themes',title:'Light and dark themes',body:'Themes keep Markdown, code highlighting, tables and Mermaid diagrams in step with light and dark.',points:['User messages use the theme user background to stand out','Unsupported, incomplete or overly wide diagrams keep their source text'],hint:'In Pi, enter /settings → Theme and choose cc-dark or cc-light'}
54
57
  ]
55
58
  },
56
59
  reset:{zh:'恢复默认',en:'Reset defaults'},
57
60
  retry:{zh:'重试',en:'Retry'},
58
- confirmReset:{zh:'恢复默认排序与显示设置?',en:'Reset layout and visibility to defaults?'},
61
+ confirmReset:{zh:'恢复默认功能开关、图片预览方式、字段显示与排序?',en:'Reset feature switches, image previews, and footer visibility and order?'},
59
62
  connecting:{zh:'正在同步…',en:'Connecting…'},
60
63
  saved:{zh:'已保存',en:'Saved'},
61
64
  unsaved:{zh:'未保存的修改',en:'Unsaved changes'},
@@ -78,9 +81,9 @@ const I18N={
78
81
  branch:{zh:'仅分支',en:'Branch Only'},
79
82
  'session-tokens':{zh:'会话 Token',en:'Session Tokens'},
80
83
  'cache-tokens':{zh:'缓存 Token',en:'Cache Tokens'},
81
- 'cache-miss':{zh:'缓存 miss',en:'Cache miss'},
84
+ 'cache-miss':{zh:'缓存未命中估算',en:'Estimated cache misses'},
82
85
  ch:{zh:'缓存命中率',en:'Cache Hit Rate'},
83
- cost:{zh:'累计费用',en:'Cost'},
86
+ cost:{zh:'会话费用估算',en:'Estimated session cost'},
84
87
  mcp:{zh:'MCP 服务数',en:'MCP Count'},
85
88
  context:{zh:'上下文进度条',en:'Context Bar'},
86
89
  'context-percent':{zh:'上下文百分比',en:'Context %'},
@@ -204,6 +207,19 @@ function feature(item){
204
207
  const points=document.createElement('ul');points.className='feature-points';
205
208
  points.append(...item.points.map(point=>{const li=document.createElement('li');li.textContent=point;return li}));
206
209
  card.append(head,body,points);
210
+ if(item.id==='minimal'){
211
+ const label=document.createElement('label');label.className='preview-mode';label.htmlFor='pi-mini-mode-minimal-record-limit';
212
+ const text=document.createElement('span');text.textContent=t('recordLimitLabel');
213
+ const input=document.createElement('input');input.type='number';input.id=label.htmlFor;input.min='1';input.step='1';input.required=true;input.disabled=!state[item.setting];
214
+ input.value=String(state[input.id]??6);input.onchange=()=>{
215
+ const value=Number(input.value);
216
+ if(!input.checkValidity()||!Number.isSafeInteger(value)||value<1){input.value=String(state[input.id]??6);return}
217
+ state[input.id]=value;change();
218
+ };
219
+ label.append(text,input);card.append(label);
220
+ const hint=document.createElement('p');hint.className='feature-hint';hint.textContent=t('recordLimitHint');card.append(hint);
221
+ head.querySelector('input').addEventListener('change',()=>{input.disabled=!state[item.setting]});
222
+ }
207
223
  if(item.id==='input-enhancements'){
208
224
  const label=document.createElement('label');label.className='preview-mode';label.htmlFor='pi-mini-mode-image-preview';
209
225
  const text=document.createElement('span');text.textContent=t('previewModeLabel');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@each1024/pi-mini-mode",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
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": {