pi-cc-extensions 0.8.50 → 0.8.52
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 +9 -12
- package/README.md +9 -12
- package/extensions/config/config.ts +10 -10
- package/extensions/config/panel.ts +113 -26
- package/extensions/feature/agent-autocomplete.ts +3 -1
- package/extensions/feature/agent-summary.ts +8 -8
- package/extensions/feature/compact-thinking.ts +116 -55
- package/extensions/feature/context.ts +1 -1
- package/extensions/feature/markdown-enhance.ts +4 -1
- package/extensions/feature/pi-startup-header.ts +3 -8
- package/extensions/feature/session-reference-core.ts +3 -2
- package/extensions/feature/session-reference.ts +49 -21
- package/extensions/index.ts +12 -0
- package/extensions/renderer/compact-mode.ts +949 -0
- package/extensions/renderer/index.ts +73 -17
- package/extensions/renderer/message-display.ts +17 -3
- package/extensions/renderer/mouse-hover.ts +130 -0
- package/extensions/renderer/mouse-interaction.ts +74 -532
- package/extensions/renderer/mouse-layout.ts +160 -0
- package/extensions/renderer/mouse-packets.ts +143 -0
- package/extensions/renderer/mouse-scroll.ts +184 -0
- package/extensions/renderer/show-more-hint.ts +1 -3
- package/extensions/renderer/tool-diff/diff-renderer.ts +59 -2
- package/extensions/renderer/tool-grouping.ts +9 -2
- package/extensions/renderer/tool-result.ts +24 -8
- package/extensions/utils/agent-summary.ts +16 -2
- package/package.json +3 -2
- package/themes/cc-dark.json +3 -2
- package/themes/cc-light.json +3 -3
package/README.en.md
CHANGED
|
@@ -39,14 +39,14 @@ Run `/reload` after installation.
|
|
|
39
39
|
## Features
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
| Feature | Description
|
|
43
|
-
| ------------------------------ |
|
|
44
|
-
| Claude Code-style output | Tool summaries, expand/collapse, rich edit/write diffs, and`on` / `off` modes
|
|
45
|
-
| Fullscreen mouse interaction | Tool card/group click-to-toggle
|
|
46
|
-
| Settings panel | `Style / Diff / Thinking / Feature` tabs: startup header toggle and wheel step
|
|
47
|
-
| Context inspection | Usage breakdown and previews for the system prompt, tools, skills, and messages
|
|
48
|
-
| Session references | Search and inject effective context from previous Sessions or existing SubAgents
|
|
49
|
-
| Theme | Bundled CC Dark and CC Light themes
|
|
42
|
+
| Feature | Description | Entry point |
|
|
43
|
+
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
|
44
|
+
| Claude Code-style output | Tool summaries, expand/collapse, rich edit/write diffs, and`on` / `compact` / `off` modes | `/ccstyle` |
|
|
45
|
+
| Fullscreen mouse interaction | Tool card/group click-to-toggle, previews, hover highlight, and a back-to-bottom button | `TUIMODE=fullscreen` or `--tui-mode fullscreen` |
|
|
46
|
+
| Settings panel | `Style / Diff / Thinking / Feature` tabs: startup header toggle and wheel step | `/ccstyle` |
|
|
47
|
+
| Context inspection | Usage breakdown and previews for the system prompt, tools, skills, and messages | `/context` |
|
|
48
|
+
| Session references | Search and inject effective context from previous Sessions or existing SubAgents | `@session:` |
|
|
49
|
+
| Theme | Bundled CC Dark and CC Light themes | `/theme` |
|
|
50
50
|
|
|
51
51
|
## Configuration
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ Run `/reload` after installation.
|
|
|
54
54
|
|
|
55
55
|
```js
|
|
56
56
|
{
|
|
57
|
-
"mode": "on", // on: Claude Code
|
|
57
|
+
"mode": "on", // on: Claude Code style; compact: one-line summaries; off: Pi native rendering
|
|
58
58
|
"excludeRenderers": [], // exact tool names that keep their native renderer; Agent always keeps its dedicated renderer
|
|
59
59
|
"diffViewMode": "auto", // diff layout: auto / split / unified
|
|
60
60
|
"diffIndicatorMode": "bars", // diff change indicators: bars / classic / none
|
|
@@ -83,9 +83,6 @@ Run `/reload` after changing extensions.
|
|
|
83
83
|
## Compatibility
|
|
84
84
|
|
|
85
85
|
- Node.js `>=22.19.0`, Pi `^0.84.0` (loaded through `pi.extensions` and `pi.themes` in the root `package.json`)
|
|
86
|
-
- Fixed-editor features have been smoothly migrated to the official pipeline: in TUI fullscreen mode, all `/ccstyle` mouse interactions work as usual.
|
|
87
|
-
- Need the removed fixed-editor layout or `compact` one-line summary mode? Use version `0.8.46` or earlier
|
|
88
|
-
- Removed: the fixed-editor layout and the `compact` one-line summary mode (a new compact mode is planned for a future release). Old configs with `"mode": "compact"` automatically fall back to `on`, and the `/ccstyle` panel only offers `on` / `off`.
|
|
89
86
|
|
|
90
87
|
## Recommended companions
|
|
91
88
|
|
package/README.md
CHANGED
|
@@ -39,14 +39,14 @@ pi install git:github.com/minuque/pi-cc-extensions
|
|
|
39
39
|
## 功能
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
| 功能 | 说明
|
|
43
|
-
| ---------------------- |
|
|
44
|
-
| Claude Code 风格输出 | 工具摘要、折叠展开、rich edit/write diff,以及`on` / `off`
|
|
45
|
-
| Fullscreen 鼠标交互 | 工具卡/group
|
|
46
|
-
| 配置面板 | `Style / Diff / Thinking / Feature` 四页签,含启动头开关与滚轮步进
|
|
47
|
-
| 上下文检查 | 查看上下文占用,并预览 System prompt、Tools、Skills 和消息内容
|
|
48
|
-
| Session 引用 | 搜索并注入历史 Session 或现有 SubAgent 的有效上下文
|
|
49
|
-
| 主题 | 随包提供内置 CC Dark、CC Light 主题
|
|
42
|
+
| 功能 | 说明 | 入口 |
|
|
43
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------- | ------------- |
|
|
44
|
+
| Claude Code 风格输出 | 工具摘要、折叠展开、rich edit/write diff,以及`on` / `compact` / `off` 三种模式 | `/ccstyle` |
|
|
45
|
+
| Fullscreen 鼠标交互 | 工具卡/group 点击展开与收起、预览、hover 高亮、回到底部按钮 | `TUIMODE=fullscreen` 或 `--tui-mode fullscreen` |
|
|
46
|
+
| 配置面板 | `Style / Diff / Thinking / Feature` 四页签,含启动头开关与滚轮步进 | `/ccstyle` |
|
|
47
|
+
| 上下文检查 | 查看上下文占用,并预览 System prompt、Tools、Skills 和消息内容 | `/context` |
|
|
48
|
+
| Session 引用 | 搜索并注入历史 Session 或现有 SubAgent 的有效上下文 | `@session:` |
|
|
49
|
+
| 主题 | 随包提供内置 CC Dark、CC Light 主题 | `/theme` |
|
|
50
50
|
|
|
51
51
|
## 配置
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ pi install git:github.com/minuque/pi-cc-extensions
|
|
|
54
54
|
|
|
55
55
|
```js
|
|
56
56
|
{
|
|
57
|
-
"mode": "on", // on:Claude Code
|
|
57
|
+
"mode": "on", // on:Claude Code 风格;compact:单行摘要;off:Pi 原生渲染
|
|
58
58
|
"excludeRenderers": [], // 走原生渲染的工具名列表(精确匹配),Agent 始终保留专用渲染器
|
|
59
59
|
"diffViewMode": "auto", // diff 布局:auto / split / unified
|
|
60
60
|
"diffIndicatorMode": "bars", // diff 变更指示:bars / classic / none
|
|
@@ -83,9 +83,6 @@ npm run typecheck
|
|
|
83
83
|
## 兼容性
|
|
84
84
|
|
|
85
85
|
- Node.js `>=22.19.0`,Pi `^0.84.0`(通过根目录 `package.json` 的 `pi.extensions` 和 `pi.themes` 加载)
|
|
86
|
-
- fixed-editor相关功能已平滑迁移至官方管线:TUI mode=fullscreen 模式下 `/ccstyle` 全部鼠标交互功能类照常可用。
|
|
87
|
-
- 需要已移除的 fixed-editor 布局或 `compact` 单行摘要模式?请使用 `0.8.46` 及更早版本
|
|
88
|
-
- 已移除:固定编辑器布局与 `compact` 单行摘要模式(后续会有新版本 compact mode 发布)。旧配置 `mode: "compact"` 自动回退 `on`,`/ccstyle` 面板仅有 `on` / `off`。
|
|
89
86
|
|
|
90
87
|
## 推荐搭配
|
|
91
88
|
|
|
@@ -9,7 +9,7 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
|
|
12
|
-
export type CompactStyleMode = "on" | "off";
|
|
12
|
+
export type CompactStyleMode = "on" | "compact" | "off";
|
|
13
13
|
|
|
14
14
|
export type Config = {
|
|
15
15
|
mode: CompactStyleMode;
|
|
@@ -105,9 +105,9 @@ export function nearestPreset(value: number, presets: readonly string[]): string
|
|
|
105
105
|
export function normalizeConfig(input: unknown): Config {
|
|
106
106
|
const source = (input && typeof input === "object" ? input : {}) as Record<string, unknown>;
|
|
107
107
|
const mode = source.mode;
|
|
108
|
-
//
|
|
108
|
+
// 旧 `enabled: boolean` 配置迁移;compact 已恢复为受支持模式,不再回退 on。
|
|
109
109
|
const migratedMode: CompactStyleMode =
|
|
110
|
-
mode === "on" || mode === "off"
|
|
110
|
+
mode === "on" || mode === "compact" || mode === "off"
|
|
111
111
|
? mode
|
|
112
112
|
: typeof source.enabled === "boolean"
|
|
113
113
|
? source.enabled
|
|
@@ -163,12 +163,7 @@ export function normalizeConfig(input: unknown): Config {
|
|
|
163
163
|
DEFAULT_CONFIG.animationIntervalMs,
|
|
164
164
|
),
|
|
165
165
|
showStartupHeader: source.showStartupHeader !== false,
|
|
166
|
-
scrollStepLines: pickPositiveInt(
|
|
167
|
-
source.scrollStepLines,
|
|
168
|
-
DEFAULT_CONFIG.scrollStepLines,
|
|
169
|
-
1,
|
|
170
|
-
50,
|
|
171
|
-
),
|
|
166
|
+
scrollStepLines: pickPositiveInt(source.scrollStepLines, DEFAULT_CONFIG.scrollStepLines, 1, 50),
|
|
172
167
|
};
|
|
173
168
|
}
|
|
174
169
|
|
|
@@ -221,7 +216,12 @@ function loadConfig(): Config {
|
|
|
221
216
|
? (JSON.parse(readFileSync(CONFIG_PATH, "utf8")) as Record<string, unknown>)
|
|
222
217
|
: {};
|
|
223
218
|
const normalized = normalizeConfig(source);
|
|
224
|
-
if (
|
|
219
|
+
if (
|
|
220
|
+
typeof source.enabled === "boolean" &&
|
|
221
|
+
source.mode !== "on" &&
|
|
222
|
+
source.mode !== "compact" &&
|
|
223
|
+
source.mode !== "off"
|
|
224
|
+
) {
|
|
225
225
|
try {
|
|
226
226
|
writeFileSync(CONFIG_PATH, JSON.stringify(normalized, null, 2));
|
|
227
227
|
} catch {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* CcstylePanelHooks 注入,避免 config → renderer 循环依赖。
|
|
6
6
|
*/
|
|
7
7
|
import { getSettingsListTheme } from "@earendil-works/pi-coding-agent";
|
|
8
|
-
import { SettingsList, matchesKey, truncateToWidth } from "@earendil-works/pi-tui";
|
|
8
|
+
import { Input, SettingsList, matchesKey, truncateToWidth } from "@earendil-works/pi-tui";
|
|
9
9
|
import type { CompactThinkingController } from "../feature/compact-thinking.ts";
|
|
10
10
|
import { applyStartupHeader } from "../feature/pi-startup-header.ts";
|
|
11
11
|
import type { ToolGroupingHooks } from "../renderer/tool-grouping.ts";
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
EXPANDED_PREVIEW_MAX_LINES_VALUES,
|
|
22
22
|
formatExcludeRenderers,
|
|
23
23
|
getCompactThinkingConfig,
|
|
24
|
-
nearestPreset,
|
|
25
24
|
pickPositiveInt,
|
|
26
25
|
pickPositiveNumber,
|
|
27
26
|
saveConfig,
|
|
@@ -38,6 +37,9 @@ export type CcstylePanelHooks = {
|
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
function modeSettingDescription(mode: CompactStyleMode): string {
|
|
40
|
+
if (mode === "compact") {
|
|
41
|
+
return "(Experimental) One summary line per assistant round; expanded edit/write rows show rich diffs.";
|
|
42
|
+
}
|
|
41
43
|
if (mode === "off") {
|
|
42
44
|
return "Pi native tool rendering. Diff options below still apply independently.";
|
|
43
45
|
}
|
|
@@ -110,6 +112,48 @@ function buildExcludeRenderersSubmenu(
|
|
|
110
112
|
};
|
|
111
113
|
}
|
|
112
114
|
|
|
115
|
+
/** 数值项手动输入子面板:预填当前值,Space 循环预设,输入数字自定义,Enter 应用,Esc 取消。 */
|
|
116
|
+
function buildNumberInputSubmenu(
|
|
117
|
+
theme: any,
|
|
118
|
+
setting: { label: string; values: readonly string[]; currentValue: string },
|
|
119
|
+
closeSubmenu: (selected?: string) => void,
|
|
120
|
+
): {
|
|
121
|
+
render: (width: number) => string[];
|
|
122
|
+
invalidate: () => void;
|
|
123
|
+
handleInput: (data: string) => void;
|
|
124
|
+
} {
|
|
125
|
+
const input = new Input();
|
|
126
|
+
let error = "";
|
|
127
|
+
input.setValue(setting.currentValue);
|
|
128
|
+
input.onSubmit = (value: string) => {
|
|
129
|
+
const raw = value.trim();
|
|
130
|
+
if (raw === "") {
|
|
131
|
+
closeSubmenu(); // 空输入 = 取消
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (!Number.isFinite(Number(raw))) {
|
|
135
|
+
error = `Invalid number: "${raw}"`;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
closeSubmenu(raw);
|
|
139
|
+
};
|
|
140
|
+
input.onEscape = () => closeSubmenu();
|
|
141
|
+
return {
|
|
142
|
+
render: (width: number) => {
|
|
143
|
+
const safe = Math.max(0, Math.floor(width));
|
|
144
|
+
const lines = [
|
|
145
|
+
theme.fg("dim", ` ${setting.label} — custom value:`),
|
|
146
|
+
...input.render(safe),
|
|
147
|
+
truncateToWidth(theme.fg("dim", " Enter to apply · Esc to go back"), safe),
|
|
148
|
+
];
|
|
149
|
+
if (error !== "") lines.push(theme.fg("dim", ` ${error}`));
|
|
150
|
+
return lines;
|
|
151
|
+
},
|
|
152
|
+
invalidate: () => {},
|
|
153
|
+
handleInput: (data: string) => input.handleInput(data),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
113
157
|
/** Section tabs for /ccstyle — matches Zentui-style "A / B / C" headers. */
|
|
114
158
|
type CcstyleSection = {
|
|
115
159
|
id: "style" | "editor" | "diff" | "thinking" | "feature";
|
|
@@ -165,8 +209,8 @@ export async function showCcstylePanel(
|
|
|
165
209
|
id: "mode",
|
|
166
210
|
label: "Mode",
|
|
167
211
|
description: modeSettingDescription(config.mode),
|
|
168
|
-
currentValue: config.mode,
|
|
169
|
-
values: ["on", "off"],
|
|
212
|
+
currentValue: config.mode === "compact" ? "compact (Experimental)" : config.mode,
|
|
213
|
+
values: ["on", "compact (Experimental)", "off"],
|
|
170
214
|
};
|
|
171
215
|
// Tracks whether the Exclude-tools submenu is open so Tab switches sections
|
|
172
216
|
// only at the top level (mirrors Zentui settings: Tab = switch sections).
|
|
@@ -210,16 +254,22 @@ export async function showCcstylePanel(
|
|
|
210
254
|
const diffSplitSetting = {
|
|
211
255
|
id: "diffSplitMinWidth",
|
|
212
256
|
label: "Split min width",
|
|
213
|
-
description:
|
|
214
|
-
|
|
257
|
+
description:
|
|
258
|
+
"Minimum terminal width before auto/split layout uses side-by-side columns. Enter to type a custom value.",
|
|
259
|
+
currentValue: String(config.diffSplitMinWidth),
|
|
215
260
|
values: [...DIFF_SPLIT_MIN_WIDTH_VALUES],
|
|
261
|
+
submenu: (_current: string, closeSubmenu: (selected?: string) => void) =>
|
|
262
|
+
buildNumberInputSubmenu(theme, diffSplitSetting, closeSubmenu),
|
|
216
263
|
};
|
|
217
264
|
const diffCollapsedSetting = {
|
|
218
265
|
id: "diffCollapsedLines",
|
|
219
266
|
label: "Collapsed lines",
|
|
220
|
-
description:
|
|
221
|
-
|
|
267
|
+
description:
|
|
268
|
+
"How many diff body lines to show before the expand hint (Ctrl+O / click). Enter to type a custom value.",
|
|
269
|
+
currentValue: String(config.diffCollapsedLines),
|
|
222
270
|
values: [...DIFF_COLLAPSED_LINES_VALUES],
|
|
271
|
+
submenu: (_current: string, closeSubmenu: (selected?: string) => void) =>
|
|
272
|
+
buildNumberInputSubmenu(theme, diffCollapsedSetting, closeSubmenu),
|
|
223
273
|
};
|
|
224
274
|
const diffWordWrapSetting = {
|
|
225
275
|
id: "diffWordWrap",
|
|
@@ -235,11 +285,10 @@ export async function showCcstylePanel(
|
|
|
235
285
|
label: "Expanded max lines",
|
|
236
286
|
description:
|
|
237
287
|
"Max Output/diff body lines when expanded. Default 40 keeps the TUI compact; raise for large dumps.",
|
|
238
|
-
currentValue:
|
|
239
|
-
config.expandedPreviewMaxLines,
|
|
240
|
-
EXPANDED_PREVIEW_MAX_LINES_VALUES,
|
|
241
|
-
),
|
|
288
|
+
currentValue: String(config.expandedPreviewMaxLines),
|
|
242
289
|
values: [...EXPANDED_PREVIEW_MAX_LINES_VALUES],
|
|
290
|
+
submenu: (_current: string, closeSubmenu: (selected?: string) => void) =>
|
|
291
|
+
buildNumberInputSubmenu(theme, expandedMaxSetting, closeSubmenu),
|
|
243
292
|
};
|
|
244
293
|
const thinkingTitleSetting = {
|
|
245
294
|
id: "useSummaryTitlesAsThinkingTitle",
|
|
@@ -252,15 +301,19 @@ export async function showCcstylePanel(
|
|
|
252
301
|
id: "previewLines",
|
|
253
302
|
label: "Preview lines",
|
|
254
303
|
description: "Thinking preview lines; 0 hides the preview body.",
|
|
255
|
-
currentValue:
|
|
304
|
+
currentValue: String(config.previewLines),
|
|
256
305
|
values: [...THINKING_PREVIEW_LINES_VALUES],
|
|
306
|
+
submenu: (_current: string, closeSubmenu: (selected?: string) => void) =>
|
|
307
|
+
buildNumberInputSubmenu(theme, thinkingPreviewSetting, closeSubmenu),
|
|
257
308
|
};
|
|
258
309
|
const thinkingAnimationSetting = {
|
|
259
310
|
id: "animationIntervalMs",
|
|
260
311
|
label: "Animation interval ms",
|
|
261
312
|
description: "Thinking title animation interval for the next thinking run.",
|
|
262
|
-
currentValue:
|
|
313
|
+
currentValue: String(config.animationIntervalMs),
|
|
263
314
|
values: [...THINKING_ANIMATION_INTERVAL_VALUES],
|
|
315
|
+
submenu: (_current: string, closeSubmenu: (selected?: string) => void) =>
|
|
316
|
+
buildNumberInputSubmenu(theme, thinkingAnimationSetting, closeSubmenu),
|
|
264
317
|
};
|
|
265
318
|
const startupHeaderSetting = {
|
|
266
319
|
id: "showStartupHeader",
|
|
@@ -275,16 +328,22 @@ export async function showCcstylePanel(
|
|
|
275
328
|
id: "scrollStepLines",
|
|
276
329
|
label: "Scroll step",
|
|
277
330
|
description: "Mouse wheel scroll lines in fullscreen mode.",
|
|
278
|
-
currentValue:
|
|
331
|
+
currentValue: String(config.scrollStepLines),
|
|
279
332
|
values: [...SCROLL_STEP_LINES_VALUES],
|
|
333
|
+
submenu: (_current: string, closeSubmenu: (selected?: string) => void) =>
|
|
334
|
+
buildNumberInputSubmenu(theme, scrollStepSetting, closeSubmenu),
|
|
280
335
|
};
|
|
281
336
|
|
|
282
337
|
const onSettingChange = (id: string, value: string) => {
|
|
283
338
|
switch (id) {
|
|
284
|
-
case "mode":
|
|
285
|
-
|
|
286
|
-
|
|
339
|
+
case "mode": {
|
|
340
|
+
// 选项值带 Experimental 标记,选择后还原为真实 mode 值。
|
|
341
|
+
const mode: CompactStyleMode =
|
|
342
|
+
value === "compact (Experimental)" ? "compact" : (value as CompactStyleMode);
|
|
343
|
+
modeSetting.description = modeSettingDescription(mode);
|
|
344
|
+
hooks.applyStyleMode(mode, ctx, toolGrouping);
|
|
287
345
|
return;
|
|
346
|
+
}
|
|
288
347
|
case "excludeRenderers":
|
|
289
348
|
excludeSetting.currentValue = formatExcludeRenderers(config.excludeRenderers);
|
|
290
349
|
excludeSetting.description = excludeRenderersDescription(config.excludeRenderers);
|
|
@@ -304,6 +363,7 @@ export async function showCcstylePanel(
|
|
|
304
363
|
40,
|
|
305
364
|
300,
|
|
306
365
|
);
|
|
366
|
+
diffSplitSetting.currentValue = String(config.diffSplitMinWidth);
|
|
307
367
|
break;
|
|
308
368
|
case "diffCollapsedLines":
|
|
309
369
|
config.diffCollapsedLines = pickPositiveInt(
|
|
@@ -312,6 +372,7 @@ export async function showCcstylePanel(
|
|
|
312
372
|
1,
|
|
313
373
|
500,
|
|
314
374
|
);
|
|
375
|
+
diffCollapsedSetting.currentValue = String(config.diffCollapsedLines);
|
|
315
376
|
break;
|
|
316
377
|
case "diffWordWrap":
|
|
317
378
|
config.diffWordWrap = value === "on";
|
|
@@ -326,18 +387,21 @@ export async function showCcstylePanel(
|
|
|
326
387
|
10,
|
|
327
388
|
50_000,
|
|
328
389
|
);
|
|
390
|
+
expandedMaxSetting.currentValue = String(config.expandedPreviewMaxLines);
|
|
329
391
|
break;
|
|
330
392
|
case "useSummaryTitlesAsThinkingTitle":
|
|
331
393
|
config.useSummaryTitlesAsThinkingTitle = value === "on";
|
|
332
394
|
break;
|
|
333
395
|
case "previewLines":
|
|
334
396
|
config.previewLines = pickPositiveInt(value, DEFAULT_CONFIG.previewLines, 0);
|
|
397
|
+
thinkingPreviewSetting.currentValue = String(config.previewLines);
|
|
335
398
|
break;
|
|
336
399
|
case "animationIntervalMs":
|
|
337
400
|
config.animationIntervalMs = pickPositiveNumber(
|
|
338
401
|
value,
|
|
339
402
|
DEFAULT_CONFIG.animationIntervalMs,
|
|
340
403
|
);
|
|
404
|
+
thinkingAnimationSetting.currentValue = String(config.animationIntervalMs);
|
|
341
405
|
break;
|
|
342
406
|
case "showStartupHeader":
|
|
343
407
|
config.showStartupHeader = value === "on";
|
|
@@ -348,12 +412,8 @@ export async function showCcstylePanel(
|
|
|
348
412
|
applyStartupHeader(ctx);
|
|
349
413
|
break;
|
|
350
414
|
case "scrollStepLines":
|
|
351
|
-
config.scrollStepLines = pickPositiveInt(
|
|
352
|
-
|
|
353
|
-
DEFAULT_CONFIG.scrollStepLines,
|
|
354
|
-
1,
|
|
355
|
-
50,
|
|
356
|
-
);
|
|
415
|
+
config.scrollStepLines = pickPositiveInt(value, DEFAULT_CONFIG.scrollStepLines, 1, 50);
|
|
416
|
+
scrollStepSetting.currentValue = String(config.scrollStepLines);
|
|
357
417
|
break;
|
|
358
418
|
default:
|
|
359
419
|
return;
|
|
@@ -415,6 +475,27 @@ export async function showCcstylePanel(
|
|
|
415
475
|
activeSection = (activeSection + delta + sections.length) % sections.length;
|
|
416
476
|
};
|
|
417
477
|
|
|
478
|
+
/** 数值项:当前选中项有 submenu + values 时,Space 仅循环预设,不打开子面板。 */
|
|
479
|
+
const cyclePresetInList = (list: InstanceType<typeof SettingsList>): boolean => {
|
|
480
|
+
const internal = list as unknown as {
|
|
481
|
+
submenuComponent: unknown;
|
|
482
|
+
items: {
|
|
483
|
+
id: string;
|
|
484
|
+
currentValue: string;
|
|
485
|
+
submenu?: unknown;
|
|
486
|
+
values?: readonly string[];
|
|
487
|
+
}[];
|
|
488
|
+
selectedIndex: number;
|
|
489
|
+
};
|
|
490
|
+
if (internal.submenuComponent) return false;
|
|
491
|
+
const item = internal.items[internal.selectedIndex];
|
|
492
|
+
if (!item?.submenu || !item.values?.length) return false;
|
|
493
|
+
const i = item.values.indexOf(item.currentValue);
|
|
494
|
+
item.currentValue = item.values[i === -1 ? 0 : (i + 1) % item.values.length]!;
|
|
495
|
+
onSettingChange(item.id, item.currentValue);
|
|
496
|
+
return true;
|
|
497
|
+
};
|
|
498
|
+
|
|
418
499
|
return {
|
|
419
500
|
render(width: number): string[] {
|
|
420
501
|
const safeWidth = Math.max(0, Math.floor(width));
|
|
@@ -440,7 +521,7 @@ export async function showCcstylePanel(
|
|
|
440
521
|
truncateToWidth(
|
|
441
522
|
theme.fg(
|
|
442
523
|
"dim",
|
|
443
|
-
" Enter/Space to change · Tab/Shift+Tab to switch sections · Esc to close",
|
|
524
|
+
" Enter/Space to change · Enter on numbers types a custom value · Tab/Shift+Tab to switch sections · Esc to close",
|
|
444
525
|
),
|
|
445
526
|
safeWidth,
|
|
446
527
|
),
|
|
@@ -461,7 +542,13 @@ export async function showCcstylePanel(
|
|
|
461
542
|
tui.requestRender();
|
|
462
543
|
return;
|
|
463
544
|
}
|
|
464
|
-
activeList()
|
|
545
|
+
const list = activeList();
|
|
546
|
+
// Space 循环预设(数值项不进子面板);Enter 打开子面板输入自定义值。
|
|
547
|
+
if (data === " " && cyclePresetInList(list)) {
|
|
548
|
+
tui.requestRender();
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
list.handleInput?.(data);
|
|
465
552
|
tui.requestRender();
|
|
466
553
|
},
|
|
467
554
|
};
|
|
@@ -14,6 +14,7 @@ type AgentInfo = {
|
|
|
14
14
|
displayName: string;
|
|
15
15
|
description: string;
|
|
16
16
|
model?: string;
|
|
17
|
+
thinking?: string;
|
|
17
18
|
filePath: string;
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -53,6 +54,7 @@ function loadAgents(): AgentInfo[] {
|
|
|
53
54
|
displayName: fm.display_name || name,
|
|
54
55
|
description: fm.description || "",
|
|
55
56
|
model: fm.model,
|
|
57
|
+
thinking: fm.thinking,
|
|
56
58
|
filePath,
|
|
57
59
|
};
|
|
58
60
|
});
|
|
@@ -94,7 +96,7 @@ export function createAgentAutocompleteProvider(
|
|
|
94
96
|
const agentItems: AutocompleteItem[] = matches.slice(0, MAX_SUGGESTIONS).map((agent) => ({
|
|
95
97
|
value: `@${agent.name}`,
|
|
96
98
|
label: `[SubAgent] ${agent.displayName}`,
|
|
97
|
-
description: agent.
|
|
99
|
+
description: `${agent.model ?? "?"} · ${agent.thinking ?? "?"}`,
|
|
98
100
|
}));
|
|
99
101
|
const hasCompatibleBaseSuggestions = baseSuggestions?.prefix === `@${query}`;
|
|
100
102
|
const agentValues = new Set(agents.map((agent) => `@${agent.name}`));
|
|
@@ -19,14 +19,14 @@ import {
|
|
|
19
19
|
export const AGENT_SUMMARY_ENTRY_TYPE = "agent-summary";
|
|
20
20
|
|
|
21
21
|
export default function (pi: ExtensionAPI): void {
|
|
22
|
-
pi.registerEntryRenderer
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
22
|
+
pi.registerEntryRenderer(AGENT_SUMMARY_ENTRY_TYPE, (entry, _options, theme) => {
|
|
23
|
+
const line = summaryMarkdown(entry.data as AgentSummaryData, true, {
|
|
24
|
+
success: theme.getFgAnsi("success"),
|
|
25
|
+
failed: theme.getFgAnsi("error"),
|
|
26
|
+
});
|
|
27
|
+
if (!line) return undefined;
|
|
28
|
+
return new Markdown(line, 1, 0, getMarkdownTheme());
|
|
29
|
+
});
|
|
30
30
|
|
|
31
31
|
bindAgentSummary(pi, (data) => {
|
|
32
32
|
pi.appendEntry(AGENT_SUMMARY_ENTRY_TYPE, data);
|