pi-cc-extensions 1.0.2 → 1.0.4
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 +35 -35
- package/README.md +3 -3
- package/extensions/config/config.ts +5 -0
- package/extensions/config/panel.ts +22 -0
- package/extensions/feature/context.ts +339 -149
- package/extensions/feature/reference/index.ts +2 -0
- package/extensions/feature/reference/subagent.ts +2 -0
- package/extensions/feature/shell/footer.ts +1 -0
- package/extensions/feature/shell/token-rate.ts +15 -3
- package/extensions/feature/shell/working-message.ts +0 -19
- package/extensions/renderer/compact-mode.ts +152 -49
- package/extensions/renderer/index.ts +3 -0
- package/extensions/renderer/mouse/interaction.ts +53 -26
- package/extensions/renderer/tool/diff/write-execution.ts +2 -2
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -45,52 +45,53 @@ Renderer snapshots for `on` / `compact` modes: [default](./docs/tool-render-exam
|
|
|
45
45
|
```jsonc
|
|
46
46
|
{
|
|
47
47
|
// style
|
|
48
|
-
"mode": "on",
|
|
49
|
-
"excludeRenderers": [],
|
|
48
|
+
"mode": "on", // on / compact / off
|
|
49
|
+
"excludeRenderers": [], // tools keeping the native renderer; Agent always keeps its dedicated renderer
|
|
50
50
|
|
|
51
51
|
// features
|
|
52
|
-
"enableSessionReference": true,
|
|
53
|
-
"enableSubagentAutocomplete": true,
|
|
54
|
-
"enableContextCommand": true,
|
|
55
|
-
"enableAgentSummary": true,
|
|
56
|
-
"enableWorkingMessage": true,
|
|
57
|
-
"enableAliases": true,
|
|
52
|
+
"enableSessionReference": true, // @ session references
|
|
53
|
+
"enableSubagentAutocomplete": true, // @subagent:[name] completion and delegation hints
|
|
54
|
+
"enableContextCommand": true, // /context usage check
|
|
55
|
+
"enableAgentSummary": true, // per-turn tool summary
|
|
56
|
+
"enableWorkingMessage": true, // Working... bottom token/elapsed
|
|
57
|
+
"enableAliases": true, // /clear, /exit aliases
|
|
58
58
|
|
|
59
59
|
// ui
|
|
60
|
-
"expandedInputMaxLines": 5,
|
|
61
|
-
"expandedOutputMaxLines": 10,
|
|
62
|
-
"expandedPreviewMaxLines": 40,
|
|
60
|
+
"expandedInputMaxLines": 5, // expanded tool Input lines; overflow shows a footer hint
|
|
61
|
+
"expandedOutputMaxLines": 10, // expanded tool Output lines; overflow shows a footer hint
|
|
62
|
+
"expandedPreviewMaxLines": 40, // max lines for expanded TaskList bodies (expanded diffs always show all)
|
|
63
63
|
"expandedCardBackground": "userMessageBg", // expanded card background slot: userMessageBg (same as user prompts) / toolPendingBg (neutral) etc.
|
|
64
|
-
"toolLabelClip": 0,
|
|
65
|
-
"showStartupHeader": true,
|
|
66
|
-
"stickyUserMessage": true,
|
|
64
|
+
"toolLabelClip": 0, // tool summary path/command clip length; 0 = fit width
|
|
65
|
+
"showStartupHeader": true, // startup header (logo + tips) toggle
|
|
66
|
+
"stickyUserMessage": true, // fullscreen: pin a user message's first line once it scrolls off the top edge, until the next one takes over
|
|
67
67
|
|
|
68
68
|
// diff
|
|
69
|
-
"diffViewMode": "auto",
|
|
70
|
-
"diffIndicatorMode": "bars",
|
|
71
|
-
"diffSplitMinWidth": 120,
|
|
72
|
-
"editDiffCollapsedLines": 24,
|
|
73
|
-
"writeDiffCollapsedLines": 0,
|
|
74
|
-
"diffWordWrap": true,
|
|
69
|
+
"diffViewMode": "auto", // layout: auto / split / unified
|
|
70
|
+
"diffIndicatorMode": "bars", // change indicators: bars / classic / none
|
|
71
|
+
"diffSplitMinWidth": 120, // min terminal width for side-by-side columns
|
|
72
|
+
"editDiffCollapsedLines": 24, // edit collapse lines; 0 = change-count summary only
|
|
73
|
+
"writeDiffCollapsedLines": 0, // write collapse lines; 0 = creation summary only
|
|
74
|
+
"diffWordWrap": true, // wrap long diff lines
|
|
75
75
|
|
|
76
76
|
// thinking
|
|
77
77
|
"useSummaryTitlesAsThinkingTitle": true, // use latest summary as thinking title
|
|
78
|
-
"previewLines": 3,
|
|
79
|
-
"animationIntervalMs": 90,
|
|
80
|
-
"dimThinkingText": false,
|
|
78
|
+
"previewLines": 3, // preview lines; 0 hides
|
|
79
|
+
"animationIntervalMs": 90, // title animation interval (ms)
|
|
80
|
+
"dimThinkingText": false, // dim thinking body text
|
|
81
81
|
|
|
82
82
|
// footer
|
|
83
|
-
"enableCustomFooter": true,
|
|
84
|
-
"footerTokenRate": true,
|
|
85
|
-
"footerTokenRateMode": "average",
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
83
|
+
"enableCustomFooter": true, // custom status bar
|
|
84
|
+
"footerTokenRate": true, // output rate chip; false hides it
|
|
85
|
+
"footerTokenRateMode": "average", // average: whole-prompt avg; live: trailing 1s rate
|
|
86
|
+
"footerTokenRateTtft": true, // append TTFT to the rate chip; false shows tok/s only
|
|
87
|
+
"footerCurrency": "USD", // display currency for the footer cost
|
|
88
|
+
"footerCurrencyRate": null, // display units per 1 cost unit; null changes the symbol only
|
|
89
|
+
"footerNerdIcons": true, // Nerd Font glyphs for git/cache; false = plain text
|
|
90
|
+
"footerGitStatsMode": "working", // working (default): uncommitted; branch: cumulative net changes
|
|
91
|
+
"footerHiddenKeys": [], // hidden plugin chip keys
|
|
92
|
+
"footerLine1Keys": ["pi-usage"], // line1 plugin chip order; pi-usage is shown by default, data from @narumitw/pi-usage
|
|
93
|
+
"footerLine2Keys": [], // line2 plugin chip order (after cwd/git)
|
|
94
|
+
"footerLine3Keys": [], // line3 overflow slot; painted only when a chip is visible
|
|
94
95
|
}
|
|
95
96
|
```
|
|
96
97
|
|
|
@@ -116,7 +117,6 @@ pi -e . # one run, does not edit settings.json
|
|
|
116
117
|
|
|
117
118
|
| Extension | Purpose |
|
|
118
119
|
| ------------------------ | ----------------------------------------------------------- |
|
|
119
|
-
| `npm:@ff-labs/pi-fff` | FFF-powered fuzzy file and content search (fffind / ffgrep) |
|
|
120
120
|
| `npm:pi-web-access` | Web search, URL fetching, GitHub cloning, PDF/video parsing |
|
|
121
121
|
| `npm:@narumitw/pi-usage` | Current-account usage for Codex / Copilot / OpenRouter |
|
|
122
122
|
|
package/README.md
CHANGED
|
@@ -81,8 +81,9 @@ pi install git:github.com/minuque/pi-cc-extensions
|
|
|
81
81
|
|
|
82
82
|
// footer
|
|
83
83
|
"enableCustomFooter": true, // 自定义状态栏
|
|
84
|
-
"footerTokenRate": true,
|
|
85
|
-
"footerTokenRateMode": "average",
|
|
84
|
+
"footerTokenRate": true, // 输出速率芯片;false 隐藏
|
|
85
|
+
"footerTokenRateMode": "average", // average:整段指令平均(avg);live:最近 1 秒瞬时(live)
|
|
86
|
+
"footerTokenRateTtft": true, // 速率芯片是否带 TTFT;false 只显示 tok/s
|
|
86
87
|
"footerCurrency": "USD", // 底栏费用的显示币种
|
|
87
88
|
"footerCurrencyRate": null, // 1 单位费用换成多少显示币种;null 只换符号、不乘倍率
|
|
88
89
|
"footerNerdIcons": true, // git/缓存用 Nerd Font 图标;false 为纯文本
|
|
@@ -116,7 +117,6 @@ pi -e . # 只跑一次,不改 settings.json
|
|
|
116
117
|
|
|
117
118
|
| 扩展 | 用途 |
|
|
118
119
|
| ---------------------------------------- | ------------------------------------------------ |
|
|
119
|
-
| `npm:@ff-labs/pi-fff` | 模糊文件与内容检索(fffind / ffgrep) |
|
|
120
120
|
| `npm:pi-web-access` | 网页搜索、URL 抓取、GitHub 克隆、PDF/视频解析 |
|
|
121
121
|
| `npm:@narumitw/pi-usage` | 查看当前账号用量(Codex / Copilot / OpenRouter) |
|
|
122
122
|
|
|
@@ -79,6 +79,8 @@ export type Config = {
|
|
|
79
79
|
footerTokenRate: boolean;
|
|
80
80
|
/** average:整段指令墙钟平均;live:最近 1 秒瞬时速率,空档回退平均。 */
|
|
81
81
|
footerTokenRateMode: FooterTokenRateMode;
|
|
82
|
+
/** 速率芯片是否带 TTFT。关则只显示速率。 */
|
|
83
|
+
footerTokenRateTtft: boolean;
|
|
82
84
|
/** ISO 4217 显示币种。USD 时不换算。 */
|
|
83
85
|
footerCurrency: string;
|
|
84
86
|
/** 1 单位费用对应的显示币种数量。null 只换符号、不乘倍率。 */
|
|
@@ -171,6 +173,7 @@ export const DEFAULT_CONFIG: Config = {
|
|
|
171
173
|
enableCustomFooter: true,
|
|
172
174
|
footerTokenRate: true,
|
|
173
175
|
footerTokenRateMode: "average",
|
|
176
|
+
footerTokenRateTtft: true,
|
|
174
177
|
footerCurrency: "USD",
|
|
175
178
|
footerCurrencyRate: null,
|
|
176
179
|
footerNerdIcons: true,
|
|
@@ -307,6 +310,7 @@ export function normalizeConfig(input: unknown): Config {
|
|
|
307
310
|
FOOTER_TOKEN_RATE_MODES,
|
|
308
311
|
DEFAULT_CONFIG.footerTokenRateMode,
|
|
309
312
|
),
|
|
313
|
+
footerTokenRateTtft: source.footerTokenRateTtft !== false,
|
|
310
314
|
footerCurrency: normalizeCurrency(source.footerCurrency),
|
|
311
315
|
footerCurrencyRate: normalizeFooterCurrencyRate(source.footerCurrencyRate),
|
|
312
316
|
footerNerdIcons: source.footerNerdIcons !== false,
|
|
@@ -372,6 +376,7 @@ export function formatConfigStatus(source: Config = config): string {
|
|
|
372
376
|
`footer=${source.enableCustomFooter ? "on" : "off"}`,
|
|
373
377
|
`footerTokenRate=${source.footerTokenRate ? "on" : "off"}`,
|
|
374
378
|
`footerTokenRateMode=${source.footerTokenRateMode}`,
|
|
379
|
+
`footerTokenRateTtft=${source.footerTokenRateTtft ? "on" : "off"}`,
|
|
375
380
|
`footerCurrency=${source.footerCurrency}`,
|
|
376
381
|
`footerRate=${source.footerCurrencyRate ?? "-"}`,
|
|
377
382
|
`footerIcons=${source.footerNerdIcons ? "nerd" : "plain"}`,
|
|
@@ -101,6 +101,12 @@ function footerTokenRateModeDescription(mode: FooterTokenRateMode): string {
|
|
|
101
101
|
: "Average over the whole user prompt (avg), including tool waits. Stays until the next prompt.";
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
function footerTokenRateTtftDescription(enabled: boolean): string {
|
|
105
|
+
return enabled
|
|
106
|
+
? "Append time to first token, e.g. (TTFT: 812ms) or (TTFT: 1.2s). Turn off to show the rate only."
|
|
107
|
+
: "Time to first token hidden. The rate chip shows tok/s only.";
|
|
108
|
+
}
|
|
109
|
+
|
|
104
110
|
function footerGitStatsDescription(mode: FooterGitStatsMode): string {
|
|
105
111
|
return mode === "branch"
|
|
106
112
|
? "Net changes since the merge base, including uncommitted edits. Base: origin/HEAD, then local main/master. Untracked files excluded; unavailable stats hidden."
|
|
@@ -758,6 +764,13 @@ export async function showCcstylePanel(
|
|
|
758
764
|
currentValue: config.footerTokenRateMode,
|
|
759
765
|
values: FOOTER_TOKEN_RATE_MODES,
|
|
760
766
|
};
|
|
767
|
+
const footerTokenRateTtftSetting = {
|
|
768
|
+
id: "footerTokenRateTtft",
|
|
769
|
+
label: "Token rate TTFT",
|
|
770
|
+
description: footerTokenRateTtftDescription(config.footerTokenRateTtft),
|
|
771
|
+
currentValue: config.footerTokenRateTtft ? "on" : "off",
|
|
772
|
+
values: ["on", "off"],
|
|
773
|
+
};
|
|
761
774
|
const pluginChipsSetting = {
|
|
762
775
|
id: "footerPluginChips",
|
|
763
776
|
label: "Plugin chips",
|
|
@@ -847,6 +860,14 @@ export async function showCcstylePanel(
|
|
|
847
860
|
ctx.ui.notify(`Updated ${id}: ${value}`, "info");
|
|
848
861
|
return;
|
|
849
862
|
}
|
|
863
|
+
if (id === "footerTokenRateTtft") {
|
|
864
|
+
const enabled = value === "on";
|
|
865
|
+
updateConfig({ footerTokenRateTtft: enabled });
|
|
866
|
+
footerTokenRateTtftSetting.currentValue = enabled ? "on" : "off";
|
|
867
|
+
footerTokenRateTtftSetting.description = footerTokenRateTtftDescription(enabled);
|
|
868
|
+
ctx.ui.notify(`Updated ${id}: ${value}`, "info");
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
850
871
|
if (id === "footerNerdIcons") {
|
|
851
872
|
const enabled = value === "on";
|
|
852
873
|
updateConfig({ footerNerdIcons: enabled });
|
|
@@ -1067,6 +1088,7 @@ export async function showCcstylePanel(
|
|
|
1067
1088
|
customFooterSetting,
|
|
1068
1089
|
footerTokenRateSetting,
|
|
1069
1090
|
footerTokenRateModeSetting,
|
|
1091
|
+
footerTokenRateTtftSetting,
|
|
1070
1092
|
footerCurrencySetting,
|
|
1071
1093
|
footerCurrencyRateSetting,
|
|
1072
1094
|
footerNerdIconsSetting,
|