@herbertgao/pi-extensions 2026.10.9 → 2026.10.10
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 +4 -2
- package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +1 -1
- package/node_modules/@dietrichgebert/ponytail/README.md +16 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/band/board.ts +560 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/band/logo.ts +3 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/band/metrics.ts +317 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/band/register.tsx +472 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/band/types.d.ts +35 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/claude-band.json +6 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-band-import.js +274 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-mode-tracker.js +43 -5
- package/node_modules/@dietrichgebert/ponytail/package.json +1 -1
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail/SKILL.md +1 -1
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-debt/SKILL.md +1 -2
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-gain/SKILL.md +0 -1
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-help/SKILL.md +6 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +7 -5
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +5 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +11 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/token-rate.ts +21 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/working-message.ts +23 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +4 -128
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/package.json +3 -3
|
@@ -60,7 +60,7 @@ export default function (pi: ExtensionAPI): void {
|
|
|
60
60
|
getThinkingAnimationFrame: () => compactThinking?.getThinkingAnimationFrame?.() ?? 0,
|
|
61
61
|
setCompactSummaryActive: (active) => compactThinking?.setCompactSummaryActive?.(active),
|
|
62
62
|
};
|
|
63
|
-
markdownEnhance(pi);
|
|
63
|
+
if (config.enableMarkdownEnhance) markdownEnhance(pi);
|
|
64
64
|
claudeCodeStyle(pi, undefined, compactThinkingQuery);
|
|
65
65
|
compactThinking = installCompactThinking(pi, getCompactThinkingConfig());
|
|
66
66
|
|
|
@@ -41,99 +41,6 @@ function collectFence(lines: string[], i: number): { diagram: string; next: numb
|
|
|
41
41
|
return null; // 未闭合:放弃转换,保持原文
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
// ============================================================================
|
|
45
|
-
// GitHub 风格提示框(admonition)
|
|
46
|
-
// ============================================================================
|
|
47
|
-
|
|
48
|
-
const ADMONITION = /^>\s*\[\s*!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\s*\]\s*(.*)$/i;
|
|
49
|
-
const ADMONITION_STYLE: Record<string, { icon: string; label: string }> = {
|
|
50
|
-
NOTE: { icon: "💡", label: "NOTE" },
|
|
51
|
-
TIP: { icon: "✅", label: "TIP" },
|
|
52
|
-
IMPORTANT: { icon: "❗", label: "IMPORTANT" },
|
|
53
|
-
WARNING: { icon: "⚠️", label: "WARNING" },
|
|
54
|
-
CAUTION: { icon: "⚠️", label: "CAUTION" },
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* 把 > [!TYPE] 及其后续 > 行转成带加粗标签的引用块,视觉上成提示框。
|
|
59
|
-
* 多行内容用空格合并为一行。返回 null 表示该行不是提示框。
|
|
60
|
-
*/
|
|
61
|
-
function renderAdmonition(lines: string[], i: number): { output: string[]; next: number } | null {
|
|
62
|
-
const m = lines[i].match(ADMONITION);
|
|
63
|
-
if (!m) return null;
|
|
64
|
-
const style = ADMONITION_STYLE[m[1].toUpperCase()];
|
|
65
|
-
const body: string[] = [m[2]];
|
|
66
|
-
let j = i + 1;
|
|
67
|
-
while (j < lines.length && /^>\s?/.test(lines[j]) && !ADMONITION.test(lines[j])) {
|
|
68
|
-
body.push(lines[j].replace(/^>\s?/, ""));
|
|
69
|
-
j++;
|
|
70
|
-
}
|
|
71
|
-
while (body.length > 0 && body[body.length - 1].trim() === "") body.pop();
|
|
72
|
-
// 内容合并为一行,作为引用块正文
|
|
73
|
-
const content = body.join(" ").trim();
|
|
74
|
-
// 保留引用块形态(pi 渲染为左侧竖线),标签加粗
|
|
75
|
-
return {
|
|
76
|
-
output: [`> **${style.icon} ${style.label}**${content ? ` ${content}` : ""}`, ""],
|
|
77
|
-
next: j,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// ============================================================================
|
|
82
|
-
// 裸 URL 转可点击超链接
|
|
83
|
-
// ============================================================================
|
|
84
|
-
|
|
85
|
-
const URL_RE = /(?<!<)(?<!\]\()https?:\/\/[^\s<>'"|,。;:!?、」』】()【】《》『』「」]+/g;
|
|
86
|
-
const TRIM_URL_RE = /[.,;:!?】」』"'》)}]+$/;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 去掉 URL 尾部标点;括号按平衡保留(如 Wikipedia 链接含括号、
|
|
90
|
-
* IPv6 地址含 [::1]),尾部不成对的 ] 与 ) 会截掉。
|
|
91
|
-
*/
|
|
92
|
-
function trimUrl(url: string): string {
|
|
93
|
-
let t = url.replace(TRIM_URL_RE, "");
|
|
94
|
-
for (;;) {
|
|
95
|
-
if (t.endsWith(")") && (t.match(/\(/g)?.length ?? 0) < (t.match(/\)/g)?.length ?? 0)) {
|
|
96
|
-
t = t.slice(0, -1);
|
|
97
|
-
} else if (t.endsWith("]") && (t.match(/\[/g)?.length ?? 0) < (t.match(/\]/g)?.length ?? 0)) {
|
|
98
|
-
t = t.slice(0, -1);
|
|
99
|
-
} else {
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return t;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* 把代码块和行内代码外的裸 URL 转成 markdown 链接。
|
|
108
|
-
* 已有的 [text](url) /  / <url> 自动链接用 lookbehind 排除。
|
|
109
|
-
*/
|
|
110
|
-
function linkifyUrls(markdown: string): string {
|
|
111
|
-
const lines = markdown.split("\n");
|
|
112
|
-
const out: string[] = [];
|
|
113
|
-
let fence: MarkdownFence | undefined;
|
|
114
|
-
for (const line of lines) {
|
|
115
|
-
const scanned = scanMarkdownFence(line, fence);
|
|
116
|
-
fence = scanned.fence;
|
|
117
|
-
if (scanned.protected) {
|
|
118
|
-
out.push(line);
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
// 行内代码(`...`)按反引号分片,只处理偶数片(代码外)
|
|
122
|
-
const parts = line.split("`");
|
|
123
|
-
for (let p = 0; p < parts.length; p++) {
|
|
124
|
-
if (p % 2 === 0) {
|
|
125
|
-
parts[p] = parts[p].replace(URL_RE, (url) => {
|
|
126
|
-
const trimmed = trimUrl(url);
|
|
127
|
-
if (trimmed.length === 0) return url;
|
|
128
|
-
return `[${trimmed}](${trimmed})`;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
out.push(parts.join("`"));
|
|
133
|
-
}
|
|
134
|
-
return out.join("\n");
|
|
135
|
-
}
|
|
136
|
-
|
|
137
44
|
// ============================================================================
|
|
138
45
|
// 圈数字 → 半角括号
|
|
139
46
|
// ============================================================================
|
|
@@ -231,7 +138,9 @@ function normalizeMultilineLinks(markdown: string): string {
|
|
|
231
138
|
|
|
232
139
|
export default function (pi: ExtensionAPI): void {
|
|
233
140
|
// 注意:pi 每个扩展只有一个 markdownTransformer 槽位,多次注册会互相覆盖,
|
|
234
|
-
//
|
|
141
|
+
// 所以剩下的转换合并为一次注册,内部按序链式执行。
|
|
142
|
+
// 提示框和裸 URL 不接管:pi 的 marked 已自带裸 URL 链接化(带尾标点回退,
|
|
143
|
+
// 且在链接文本内不再嵌套),提示框交给默认引用块风格。
|
|
235
144
|
pi.registerMarkdownTransformer((markdown, context) => {
|
|
236
145
|
const { messageType, isStreaming = false } = context ?? {};
|
|
237
146
|
// thinking 保持原文;普通回复即使流式中也先关闭跨行链接的空白点击区。
|
|
@@ -241,11 +150,7 @@ export default function (pi: ExtensionAPI): void {
|
|
|
241
150
|
// 0. 圈数字转半角括号(Nerd Font 补丁字形缺陷规避)
|
|
242
151
|
markdown = deCircled(markdown);
|
|
243
152
|
// 1. Mermaid 方言渲染
|
|
244
|
-
|
|
245
|
-
// 2. GitHub 风格提示框
|
|
246
|
-
markdown = renderAdmonitions(markdown);
|
|
247
|
-
// 3. 裸 URL 转超链接
|
|
248
|
-
return linkifyUrls(markdown);
|
|
153
|
+
return renderDiagrams(markdown, context);
|
|
249
154
|
});
|
|
250
155
|
}
|
|
251
156
|
|
|
@@ -307,32 +212,3 @@ function renderDiagrams(
|
|
|
307
212
|
}
|
|
308
213
|
return out.join("\n");
|
|
309
214
|
}
|
|
310
|
-
|
|
311
|
-
/** GitHub 风格提示框 → 加粗标签引用块(跳过代码块)。 */
|
|
312
|
-
function renderAdmonitions(markdown: string): string {
|
|
313
|
-
const lines = markdown.split("\n");
|
|
314
|
-
const out: string[] = [];
|
|
315
|
-
let fence: MarkdownFence | undefined;
|
|
316
|
-
let i = 0;
|
|
317
|
-
while (i < lines.length) {
|
|
318
|
-
const line = lines[i];
|
|
319
|
-
const scanned = scanMarkdownFence(line, fence);
|
|
320
|
-
fence = scanned.fence;
|
|
321
|
-
if (scanned.protected) {
|
|
322
|
-
out.push(line);
|
|
323
|
-
i++;
|
|
324
|
-
continue;
|
|
325
|
-
}
|
|
326
|
-
if (/^>\s*\[\s*!/i.test(line)) {
|
|
327
|
-
const result = renderAdmonition(lines, i);
|
|
328
|
-
if (result) {
|
|
329
|
-
out.push(...result.output);
|
|
330
|
-
i = result.next;
|
|
331
|
-
continue;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
out.push(line);
|
|
335
|
-
i++;
|
|
336
|
-
}
|
|
337
|
-
return out.join("\n");
|
|
338
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-cc-extensions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7-local.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A Pi productivity suite with Claude Code-style UI, context inspection, and agent/session references",
|
|
6
6
|
"type": "module",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
},
|
|
72
72
|
"x-upstream": {
|
|
73
73
|
"package": "pi-cc-extensions",
|
|
74
|
-
"version": "1.0.
|
|
75
|
-
"reviewedVersion": "1.0.
|
|
74
|
+
"version": "1.0.7",
|
|
75
|
+
"reviewedVersion": "1.0.7",
|
|
76
76
|
"repository": "https://github.com/minuque/pi-cc-extensions",
|
|
77
|
-
"commit": "
|
|
77
|
+
"commit": "5963eefd452822994e6a001830ded7676ebb1845",
|
|
78
78
|
"trackVersion": true
|
|
79
79
|
}
|
|
80
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-extensions",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.10",
|
|
4
4
|
"description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"extensions",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ast-grep/cli": "0.45.3",
|
|
39
39
|
"@ast-grep/napi": "^0.45.0",
|
|
40
|
-
"@dietrichgebert/ponytail": "5.2
|
|
40
|
+
"@dietrichgebert/ponytail": "5.3.2",
|
|
41
41
|
"@herbertgao/pi-agency": "0.1.1",
|
|
42
42
|
"@herbertgao/pi-bark": "0.2.1",
|
|
43
|
-
"@herbertgao/pi-cc-extensions": "1.0.
|
|
43
|
+
"@herbertgao/pi-cc-extensions": "1.0.7-local.1",
|
|
44
44
|
"@herbertgao/pi-subagents": "0.22.0-local.1",
|
|
45
45
|
"@herbertgao/sol-pi": "0.4.1",
|
|
46
46
|
"@juicesharp/rpiv-ask-user-question": "2.13.8",
|