@herbertgao/pi-extensions 2026.11.9 → 2026.11.11
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/CHANGELOG.md +21 -0
- package/README.md +6 -6
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +12 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +8 -6
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +8 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +12 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +36 -13
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +4 -8
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +7 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +115 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +47 -15
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/startup-header.ts +3 -18
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +34 -10
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +6 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +30 -17
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +4 -21
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +63 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +3 -13
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/tool-io.ts +0 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/transcript-mode.ts +34 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +43 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/keybindings.ts +75 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-impeccable/README.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/package.json +4 -4
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/SKILL.md +3 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/adapt.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/audit.md +12 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/audit.native.md +4 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/critique.md +5 -5
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/documenter.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/finish-reviewer.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/distill.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/document.md +3 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/foundations.md +44 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/live-setup.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/live.md +26 -12
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work.md +10 -9
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/onboard.md +7 -6
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/overdrive.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/quieter.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/visualize.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/VERSION +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/engine-checksums.txt +5 -5
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/impeccable +69 -16
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/impeccable.cmd +55 -7
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/live-browser.js +34 -4
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +12 -0
- package/node_modules/@herbertgao/pi-subagents/README.md +53 -26
- package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +12 -12
- package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +84 -8
- package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +51 -32
- package/node_modules/@herbertgao/pi-subagents/src/default-agents.ts +7 -0
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +369 -879
- package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +4 -1
- package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +13 -0
- package/node_modules/@herbertgao/pi-subagents/src/schedule-store.ts +18 -13
- package/node_modules/@herbertgao/pi-subagents/src/schedule.ts +25 -5
- package/node_modules/@herbertgao/pi-subagents/src/settings.ts +225 -61
- package/node_modules/@herbertgao/pi-subagents/src/types.ts +27 -0
- package/node_modules/@herbertgao/pi-subagents/src/ui/agent-tree.ts +47 -0
- package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +16 -5
- package/node_modules/@herbertgao/pi-subagents/src/ui/agents-menu.ts +705 -0
- package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +211 -47
- package/node_modules/@herbertgao/pi-subagents/src/ui/settings-menu.ts +361 -0
- package/node_modules/@herbertgao/pi-subagents/src/ui/viewer-keys.ts +1 -1
- package/node_modules/pi-commandcode-provider/CHANGELOG.md +11 -1
- package/node_modules/pi-commandcode-provider/index.ts +2 -1
- package/node_modules/pi-commandcode-provider/package.json +5 -4
- package/node_modules/pi-commandcode-provider/src/pricing.ts +8 -1
- package/node_modules/pi-commandcode-provider/src/responses-compat.ts +137 -0
- package/package.json +5 -5
|
@@ -27,6 +27,8 @@ import { collapseHintText, isToolTuiFullscreen, showMoreHintText } from "./names
|
|
|
27
27
|
import {
|
|
28
28
|
contentRowRange,
|
|
29
29
|
hasVisibleText,
|
|
30
|
+
imageBlockRows,
|
|
31
|
+
type ImageRowKind,
|
|
30
32
|
imagePlacement,
|
|
31
33
|
stripAnsi,
|
|
32
34
|
stripBackgroundAnsi,
|
|
@@ -206,7 +208,8 @@ function visibleLines(lines: string[]): string[] {
|
|
|
206
208
|
for (let index = 0; index < lines.length; index++) {
|
|
207
209
|
const placement = imagePlacement(lines[index]);
|
|
208
210
|
if (!placement) {
|
|
209
|
-
|
|
211
|
+
// 鼠标命中的零宽 APC 标记也算空:只剥 CSI 会把图片前的空行留下来。
|
|
212
|
+
if (hasVisibleText(lines[index])) keep.add(index);
|
|
210
213
|
continue;
|
|
211
214
|
}
|
|
212
215
|
const start = placement.grows === "up" ? index - placement.rows + 1 : index;
|
|
@@ -250,16 +253,43 @@ export function paddedBackgroundRow(
|
|
|
250
253
|
const innerWidth = Math.max(0, width - 2);
|
|
251
254
|
const clipped = truncateToWidth(stripBackgroundAnsi(content), innerWidth, "");
|
|
252
255
|
const row = ` ${clipped}${" ".repeat(Math.max(0, innerWidth - visibleWidth(clipped)))} `;
|
|
253
|
-
const bgAnsi =
|
|
254
|
-
bgAnsiOverride ||
|
|
255
|
-
(typeof theme?.bg === "function"
|
|
256
|
-
? theme.getBgAnsi?.(slot) || theme.bg(slot, "").match(/^\x1b\[[0-?]*[ -/]*[@-~]/)?.[0] || ""
|
|
257
|
-
: "");
|
|
256
|
+
const bgAnsi = bgAnsiOverride || backgroundAnsi(theme, slot);
|
|
258
257
|
const stable = bgAnsi ? row.replace(/\x1b\[(?:0)?m/g, (reset) => reset + bgAnsi) : row;
|
|
259
258
|
if (!bgAnsi) return typeof theme?.bg === "function" ? theme.bg(slot, stable) : row;
|
|
260
259
|
return `${bgAnsi}${stable}\x1b[49m`;
|
|
261
260
|
}
|
|
262
261
|
|
|
262
|
+
function backgroundAnsi(theme: any, slot: string): string {
|
|
263
|
+
if (typeof theme?.bg !== "function") return "";
|
|
264
|
+
return theme.getBgAnsi?.(slot) || theme.bg(slot, "").match(/^\x1b\[[0-?]*[ -/]*[@-~]/)?.[0] || "";
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* 展开卡里内联图片块的一行。
|
|
269
|
+
*
|
|
270
|
+
* 全屏(alt-screen)渲染器先画文字、最后画图片,占位行可以带树线和底色:
|
|
271
|
+
* 占位行按普通行铺满底色;锚点行先用 ECH 按底色擦满整行(不移动光标、不写字符),
|
|
272
|
+
* 再写前缀和图片序列,图片首行右侧也有底色。
|
|
273
|
+
* 主屏渲染器靠「锚点行 + 其后连续零宽行」给图片预留行,占位行只能零宽,锚点行不补底色。
|
|
274
|
+
*/
|
|
275
|
+
export function imageBackgroundRow(
|
|
276
|
+
theme: any,
|
|
277
|
+
slot: string,
|
|
278
|
+
content: string,
|
|
279
|
+
kind: ImageRowKind,
|
|
280
|
+
width: number,
|
|
281
|
+
): string {
|
|
282
|
+
if (kind === "filler") {
|
|
283
|
+
return isToolTuiFullscreen() ? paddedBackgroundRow(theme, slot, content, width) : "";
|
|
284
|
+
}
|
|
285
|
+
// 与普通底色行同口径:左边留 1 格边距,图片才与上方正文对齐。
|
|
286
|
+
const row = ` ${content}`;
|
|
287
|
+
const bgAnsi = isToolTuiFullscreen() ? backgroundAnsi(theme, slot) : "";
|
|
288
|
+
if (!bgAnsi) return row;
|
|
289
|
+
const stable = row.replace(/\x1b\[(?:0)?m/g, (reset) => reset + bgAnsi);
|
|
290
|
+
return `${bgAnsi}\x1b[${Math.max(1, width)}X${stable}\x1b[49m`;
|
|
291
|
+
}
|
|
292
|
+
|
|
263
293
|
function toolSummary(tool: any): ToolCallSummary {
|
|
264
294
|
return toolCallSummary(toolName(tool), tool?.args ?? {}, {
|
|
265
295
|
title: toolTitle(tool),
|
|
@@ -379,12 +409,24 @@ function expandedToolRows(tool: any, width: number): string[] {
|
|
|
379
409
|
}
|
|
380
410
|
const rows = rendered.length
|
|
381
411
|
? // 续行只剥外层 Box 的 1 格 left pad,保留 Input/Output 相对缩进
|
|
382
|
-
|
|
412
|
+
alignImageAnchors(
|
|
413
|
+
rendered.map((line, index) => (index === 0 ? line : stripLeadingSpaces(line, 1))),
|
|
414
|
+
)
|
|
383
415
|
: [toolSummary(tool).main];
|
|
384
416
|
expandedToolRowsCache.set(paint, rows);
|
|
385
417
|
return rows;
|
|
386
418
|
}
|
|
387
419
|
|
|
420
|
+
/** 图片锚点行缩进到上一行正文的位置:图片与 Output 正文左对齐,不贴着树线。 */
|
|
421
|
+
function alignImageAnchors(rows: string[]): string[] {
|
|
422
|
+
let indent = "";
|
|
423
|
+
return rows.map((line) => {
|
|
424
|
+
if (imagePlacement(line)) return indent + line;
|
|
425
|
+
if (hasVisibleText(line)) indent = /^ */.exec(stripAnsi(line))?.[0] ?? "";
|
|
426
|
+
return line;
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
|
|
388
430
|
function toolItem(tool: any): GroupDisplayItem {
|
|
389
431
|
const toolStatus = status(tool);
|
|
390
432
|
return {
|
|
@@ -673,11 +715,25 @@ export class ToolGroupComponent extends Container {
|
|
|
673
715
|
const branch = last ? "└" : "├";
|
|
674
716
|
const continuation = last ? " " : "│ ";
|
|
675
717
|
const rows = panelRows(itemPaints[index], last);
|
|
718
|
+
const imageRows = imageBlockRows(rows);
|
|
676
719
|
for (let lineIndex = 0; lineIndex < rows.length; lineIndex++) {
|
|
677
720
|
const prefix =
|
|
678
721
|
lineIndex === 0
|
|
679
722
|
? `${fg("dim", branch)} ${fg(color, statusIcon(item.status))} `
|
|
680
723
|
: fg("dim", continuation);
|
|
724
|
+
const imageKind = imageRows.get(lineIndex);
|
|
725
|
+
if (imageKind) {
|
|
726
|
+
lines.push(
|
|
727
|
+
imageBackgroundRow(
|
|
728
|
+
theme,
|
|
729
|
+
backgroundSlot,
|
|
730
|
+
prefix + (imageKind === "anchor" ? rows[lineIndex] : ""),
|
|
731
|
+
imageKind,
|
|
732
|
+
width,
|
|
733
|
+
),
|
|
734
|
+
);
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
681
737
|
lines.push(paddedBackgroundRow(theme, backgroundSlot, prefix + rows[lineIndex], width));
|
|
682
738
|
}
|
|
683
739
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { posix, win32 } from "node:path";
|
|
2
2
|
import type { ThemeColor } from "@earendil-works/pi-coding-agent";
|
|
3
|
-
import {
|
|
3
|
+
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
4
|
+
import { keyText } from "../../utils/keybindings.ts";
|
|
4
5
|
import { config } from "../../config/config.ts";
|
|
5
6
|
import { oneLine } from "../../utils/format.ts";
|
|
6
7
|
import { headTruncateToWidth } from "./result.ts";
|
|
@@ -445,20 +446,9 @@ export function isToolTuiFullscreen(): boolean {
|
|
|
445
446
|
return toolTuiFullscreen !== false;
|
|
446
447
|
}
|
|
447
448
|
|
|
448
|
-
function formatKeyPart(part: string): string {
|
|
449
|
-
// 与 pi 内置 keybinding-hints 一致:macOS 上 alt 显示为 option
|
|
450
|
-
return process.platform === "darwin" && part.toLowerCase() === "alt" ? "option" : part;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
449
|
/** 默认展开快捷键(app.tools.expand)显示文本;未配置时回退 ctrl+o。 */
|
|
454
450
|
export function expandShortcutText(): string {
|
|
455
|
-
|
|
456
|
-
if (keys.length === 0) return "ctrl+o";
|
|
457
|
-
return keys
|
|
458
|
-
.join("/")
|
|
459
|
-
.split("/")
|
|
460
|
-
.map((part) => part.split("+").map(formatKeyPart).join("+"))
|
|
461
|
-
.join("/");
|
|
451
|
+
return keyText("app.tools.expand") || "ctrl+o";
|
|
462
452
|
}
|
|
463
453
|
|
|
464
454
|
export function showMoreHintText(): string {
|
|
@@ -310,10 +310,6 @@ export class ExpandedToolIoView {
|
|
|
310
310
|
lines.push(truncateToWidth(theme.fg("dim", prefix) + styledContent, safeWidth, ""));
|
|
311
311
|
};
|
|
312
312
|
|
|
313
|
-
const pushBlankRail = () => {
|
|
314
|
-
lines.push(truncateToWidth(theme.fg("dim", `${lead}│`), safeWidth, ""));
|
|
315
|
-
};
|
|
316
|
-
|
|
317
313
|
const pushBody = (
|
|
318
314
|
body: string,
|
|
319
315
|
opts: {
|
|
@@ -400,7 +396,6 @@ export class ExpandedToolIoView {
|
|
|
400
396
|
continued: true,
|
|
401
397
|
section: "input",
|
|
402
398
|
});
|
|
403
|
-
pushBlankRail();
|
|
404
399
|
this.truncated.output = outputWouldTruncate;
|
|
405
400
|
pushHeader("└", "Output");
|
|
406
401
|
pushBody(outputText, {
|
|
@@ -14,17 +14,20 @@
|
|
|
14
14
|
* 对话区本身一个状态都不改,关掉弹层即恢复原样。
|
|
15
15
|
*
|
|
16
16
|
* Pi 把 app.tools.expand 列为保留键,registerShortcut 注册不上;这里在原始输入到达
|
|
17
|
-
* 输入框之前拦截。只认 Pi 自己会响应该键的组件(带 actionHandlers
|
|
17
|
+
* 输入框之前拦截。只认 Pi 自己会响应该键的组件(带 actionHandlers 的编辑器),
|
|
18
|
+
* 且对话区里有可展开的 `!` / `!!` 命令输出时把键还给 Pi——它用同一个键展开命令行输出。
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
import {
|
|
21
22
|
AssistantMessageComponent,
|
|
23
|
+
BashExecutionComponent,
|
|
22
24
|
ToolExecutionComponent,
|
|
23
25
|
UserMessageComponent,
|
|
24
26
|
} from "@earendil-works/pi-coding-agent";
|
|
25
|
-
import {
|
|
27
|
+
import { isKeyRelease, matchesKey, truncateToWidth } from "@earendil-works/pi-tui";
|
|
26
28
|
import { config } from "../config/config.ts";
|
|
27
29
|
import { walkComponentTree } from "../utils/component-tree.ts";
|
|
30
|
+
import { keybindings, setInjectedKeybindings } from "../utils/keybindings.ts";
|
|
28
31
|
import { isCompactRoundTail } from "./compact-mode.ts";
|
|
29
32
|
import { stripToolFrameMarkers } from "./mouse/packets.ts";
|
|
30
33
|
import { fullscreenLazyTui, getToolMouseTui } from "./mouse/scroll.ts";
|
|
@@ -34,6 +37,9 @@ import { expandShortcutText } from "./tool/names.ts";
|
|
|
34
37
|
import { markTranscriptComponent, withTranscriptScope } from "./transcript-scope.ts";
|
|
35
38
|
|
|
36
39
|
const EXPAND_ACTION = "app.tools.expand";
|
|
40
|
+
// pi 的 BashExecutionComponent 在输出超过预览行数且已结束时,才在尾行给出
|
|
41
|
+
// 「ctrl+o to expand」;同样的键这时归 Pi,插件不接管。
|
|
42
|
+
const BASH_PREVIEW_LINES = 20;
|
|
37
43
|
// 与 Pi 的 tui.altScreen.pageUp/pageDown 同一重叠行数,翻页后保留上下文。
|
|
38
44
|
const PAGE_SCROLL_OVERLAP = 4;
|
|
39
45
|
const WHEEL_LINES = 3;
|
|
@@ -78,7 +84,7 @@ export function transcriptScrollAction(data: string): ScrollAction | undefined {
|
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
export function isTranscriptExitKey(data: string): boolean {
|
|
81
|
-
return matchesAny(data, EXIT_KEYS) ||
|
|
87
|
+
return matchesAny(data, EXIT_KEYS) || keybindings().matches(data, EXPAND_ACTION);
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
// ---------------------------------------------------------------------------
|
|
@@ -411,12 +417,28 @@ function canOpen(tui: any): boolean {
|
|
|
411
417
|
);
|
|
412
418
|
}
|
|
413
419
|
|
|
420
|
+
/** 对话区里是否有 `!` / `!!` 命令的长输出:这类输出用同一个展开键展开。 */
|
|
421
|
+
function hasExpandableBashOutput(root: any): boolean {
|
|
422
|
+
let found = false;
|
|
423
|
+
walkComponentTree(root, (value: any) => {
|
|
424
|
+
if (found) return false;
|
|
425
|
+
if (!(value instanceof BashExecutionComponent)) return undefined;
|
|
426
|
+
const component = value as any;
|
|
427
|
+
if (component.status === "running") return undefined;
|
|
428
|
+
const output = typeof component.getOutput === "function" ? component.getOutput() : "";
|
|
429
|
+
if (String(output ?? "").split("\n").length > BASH_PREVIEW_LINES) found = true;
|
|
430
|
+
return undefined;
|
|
431
|
+
});
|
|
432
|
+
return found;
|
|
433
|
+
}
|
|
434
|
+
|
|
414
435
|
function openTranscript(): void {
|
|
415
436
|
if (!ui || open) return;
|
|
416
437
|
open = true;
|
|
417
438
|
void ui
|
|
418
439
|
.custom<void>(
|
|
419
|
-
(tui: any, theme: any,
|
|
440
|
+
(tui: any, theme: any, injectedKeybindings: unknown, done: () => void) => {
|
|
441
|
+
setInjectedKeybindings(injectedKeybindings);
|
|
420
442
|
closeOpen = done;
|
|
421
443
|
return new TranscriptView({
|
|
422
444
|
rows: () => Number(tui?.terminal?.rows) || 24,
|
|
@@ -440,9 +462,14 @@ function openTranscript(): void {
|
|
|
440
462
|
|
|
441
463
|
function handleInput(data: string): { consume?: boolean } | undefined {
|
|
442
464
|
if (open) return undefined;
|
|
443
|
-
if (!
|
|
444
|
-
|
|
445
|
-
if (!
|
|
465
|
+
if (!keybindings().matches(data, EXPAND_ACTION)) return undefined;
|
|
466
|
+
const tui = getToolMouseTui();
|
|
467
|
+
if (!canOpen(tui)) return undefined;
|
|
468
|
+
// 按键释放事件只吞掉,不再开层,也不交给 Pi 重复处理。
|
|
469
|
+
if (isKeyRelease(data)) return { consume: true };
|
|
470
|
+
// 有可展开的 ! 输出时把键还给 Pi,由它展开/收起命令行输出。
|
|
471
|
+
if (hasExpandableBashOutput(tui)) return undefined;
|
|
472
|
+
openTranscript();
|
|
446
473
|
return { consume: true };
|
|
447
474
|
}
|
|
448
475
|
|
|
@@ -11,6 +11,8 @@ const CSI_SEQUENCE_RE = /\x1b\[[0-?]*[ -/]*[@-~]/g;
|
|
|
11
11
|
const OSC_SEQUENCE_RE = /\x1b\][^\x07]*(?:\x07|\x1b\\)/g;
|
|
12
12
|
/** compact-mode 原有 hasVisibleText 用的更严格 OSC(内容不允许内嵌 ESC)。 */
|
|
13
13
|
const OSC_SEQUENCE_STRICT_RE = /\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g;
|
|
14
|
+
/** APC 序列:鼠标命中用的零宽行标记(\x1b_cc:…\x07)、kitty 图片(\x1b_G…\x1b\\)。 */
|
|
15
|
+
const APC_SEQUENCE_RE = /\x1b_[^\x07\x1b]*(?:\x07|\x1b\\)/g;
|
|
14
16
|
|
|
15
17
|
/** 剥离一行内所有 CSI 序列。 */
|
|
16
18
|
export function stripAnsi(line: string): string {
|
|
@@ -19,7 +21,10 @@ export function stripAnsi(line: string): string {
|
|
|
19
21
|
|
|
20
22
|
/** 仅剥离终端序列、保留原布局(换行/空白不动),用于命中区间计算。 */
|
|
21
23
|
export function stripTerminalSequencesPreservingLayout(value: string): string {
|
|
22
|
-
return value
|
|
24
|
+
return value
|
|
25
|
+
.replace(OSC_SEQUENCE_RE, "")
|
|
26
|
+
.replace(APC_SEQUENCE_RE, "")
|
|
27
|
+
.replace(CSI_SEQUENCE_RE, "");
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
/** 剥离终端序列并折叠空白(用于纯文本比较)。 */
|
|
@@ -27,10 +32,16 @@ export function stripTerminalSequences(value: string): string {
|
|
|
27
32
|
return stripTerminalSequencesPreservingLayout(value).replace(/\s+/g, " ").trim();
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
/** 去掉行内所有 CSI/OSC 序列后是否仍有可见文本(判断工具卡首尾内容行)。 */
|
|
35
|
+
/** 去掉行内所有 CSI/OSC/APC 序列后是否仍有可见文本(判断工具卡首尾内容行)。 */
|
|
31
36
|
export function hasVisibleText(line: string): boolean {
|
|
32
37
|
// OSC 用更严格的变体:内容内嵌 ESC 时不吞并后续文本,保持 compact-mode 原有语义。
|
|
33
|
-
return
|
|
38
|
+
return (
|
|
39
|
+
line
|
|
40
|
+
.replace(CSI_SEQUENCE_RE, "")
|
|
41
|
+
.replace(OSC_SEQUENCE_STRICT_RE, "")
|
|
42
|
+
.replace(APC_SEQUENCE_RE, "")
|
|
43
|
+
.trim().length > 0
|
|
44
|
+
);
|
|
34
45
|
}
|
|
35
46
|
|
|
36
47
|
const KITTY_IMAGE_PREFIX = "\x1b_G";
|
|
@@ -58,6 +69,31 @@ export function imagePlacement(line: string): { rows: number; grows: "down" | "u
|
|
|
58
69
|
return undefined;
|
|
59
70
|
}
|
|
60
71
|
|
|
72
|
+
/** 行区里内联图片的两种行:锚点行带图片序列,占位行是它自己铺开的空白。 */
|
|
73
|
+
export type ImageRowKind = "anchor" | "filler";
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 行区里属于内联图片块的行及其种类。
|
|
77
|
+
*
|
|
78
|
+
* 最终输出里这两类行都必须是零宽或只带锚点前的少量前缀:pi-tui 靠「锚点行含图片序列、
|
|
79
|
+
* 其后连续零宽行」认出整块图片。锚点行补底色/空格会画在图片首行上,占位行只要有宽度,
|
|
80
|
+
* 图片块就认不出来,占位行会被当成普通行铺上底色,图片位置只剩一大片空白。
|
|
81
|
+
*/
|
|
82
|
+
export function imageBlockRows(rows: string[]): Map<number, ImageRowKind> {
|
|
83
|
+
const kinds = new Map<number, ImageRowKind>();
|
|
84
|
+
for (let index = 0; index < rows.length; index++) {
|
|
85
|
+
const placement = imagePlacement(rows[index]);
|
|
86
|
+
if (!placement) continue;
|
|
87
|
+
kinds.set(index, "anchor");
|
|
88
|
+
const start = placement.grows === "up" ? index - placement.rows + 1 : index + 1;
|
|
89
|
+
const end = placement.grows === "down" ? index + placement.rows - 1 : index - 1;
|
|
90
|
+
for (let row = Math.max(0, start); row <= Math.min(rows.length - 1, end); row++) {
|
|
91
|
+
if (!kinds.has(row)) kinds.set(row, "filler");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return kinds;
|
|
95
|
+
}
|
|
96
|
+
|
|
61
97
|
/**
|
|
62
98
|
* 行区里必须保留的范围(首行/末行下标;没有内容时 first 为 -1)。
|
|
63
99
|
* 内联图片的行要按 placement 整体算进来:锚点前后那些空行是图片自己占的位置,
|
|
@@ -98,7 +134,10 @@ export function stripLeadingStatusIcon(line: string): string {
|
|
|
98
134
|
}
|
|
99
135
|
|
|
100
136
|
/** 终端序列零宽(不计入 plain 下标),与 stripAnsi/stripTerminalSequencesPreservingLayout 一致。 */
|
|
101
|
-
const ANY_SEQUENCE_RE = new RegExp(
|
|
137
|
+
const ANY_SEQUENCE_RE = new RegExp(
|
|
138
|
+
`${CSI_SEQUENCE_RE.source}|${OSC_SEQUENCE_RE.source}|${APC_SEQUENCE_RE.source}`,
|
|
139
|
+
"g",
|
|
140
|
+
);
|
|
102
141
|
|
|
103
142
|
/** 只保留 [start, end) 之外的字符(base 为 text 首字符在 plain 串中的下标)。 */
|
|
104
143
|
function keepOutsideRange(text: string, base: number, start: number, end: number): string {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按键提示与按键匹配的统一取源。
|
|
3
|
+
*
|
|
4
|
+
* pi 1.5.0 起把 `keyText()` / `keyHint()` 放进渲染上下文,把 KeybindingsManager 注入
|
|
5
|
+
* `ctx.ui.custom()` 和编辑器工厂(docs/extensions.md「Keybinding Hints」)。扩展自己
|
|
6
|
+
* import 的那份副本可能看不到用户的 `keybindings.json`,所以这里优先用注入值;
|
|
7
|
+
* 没有注入点的位置(例如原型补丁里的思考块提示)再退回 `getKeybindings()`。
|
|
8
|
+
*/
|
|
9
|
+
import { getKeybindings } from "@earendil-works/pi-tui";
|
|
10
|
+
|
|
11
|
+
export type KeybindingsLike = {
|
|
12
|
+
getKeys(id: string): string[];
|
|
13
|
+
matches(data: string, id: string): boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type KeyTextSource = (id: string) => string;
|
|
17
|
+
|
|
18
|
+
let injectedManager: KeybindingsLike | undefined;
|
|
19
|
+
let injectedKeyText: KeyTextSource | undefined;
|
|
20
|
+
|
|
21
|
+
function isManager(value: unknown): value is KeybindingsLike {
|
|
22
|
+
const candidate = value as KeybindingsLike | undefined;
|
|
23
|
+
return (
|
|
24
|
+
Boolean(candidate) &&
|
|
25
|
+
typeof candidate?.getKeys === "function" &&
|
|
26
|
+
typeof candidate?.matches === "function"
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** 记下 pi 注入的 KeybindingsManager;值不匹配就忽略。 */
|
|
31
|
+
export function setInjectedKeybindings(value: unknown): void {
|
|
32
|
+
if (isManager(value)) injectedManager = value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** 记下渲染上下文里的 `context.keyText`;值不匹配就忽略。 */
|
|
36
|
+
export function setInjectedKeyText(value: unknown): void {
|
|
37
|
+
if (typeof value === "function") injectedKeyText = value as KeyTextSource;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** 当前的按键管理器:注入值优先,没有时回退到本进程解析到的 pi。 */
|
|
41
|
+
export function keybindings(): KeybindingsLike {
|
|
42
|
+
return injectedManager ?? getKeybindings();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function formatKeyPart(part: string, capitalize = false): string {
|
|
46
|
+
// 与 pi 内置 keybinding-hints 一致:macOS 上 alt 显示为 option
|
|
47
|
+
const display = process.platform === "darwin" && part.toLowerCase() === "alt" ? "option" : part;
|
|
48
|
+
return capitalize ? display.charAt(0).toUpperCase() + display.slice(1) : display;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** 把字面按键串(如 `"ctrl+o"`)格式化成显示文本。 */
|
|
52
|
+
export function formatKeyText(key: string, options?: { capitalize?: boolean }): string {
|
|
53
|
+
const capitalize = options?.capitalize === true;
|
|
54
|
+
return key
|
|
55
|
+
.split("/")
|
|
56
|
+
.map((part) =>
|
|
57
|
+
part
|
|
58
|
+
.split("+")
|
|
59
|
+
.map((piece) => formatKeyPart(piece, capitalize))
|
|
60
|
+
.join("+"),
|
|
61
|
+
)
|
|
62
|
+
.join("/");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** 按键显示文本:pi 注入的 keyText 说了算(包括 id 没绑键时的空串);没有注入时本地格式化。 */
|
|
66
|
+
export function keyText(id: string): string {
|
|
67
|
+
if (injectedKeyText) return injectedKeyText(id);
|
|
68
|
+
const keys = keybindings().getKeys(id);
|
|
69
|
+
return keys.length === 0 ? "" : formatKeyText(keys.join("/"));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** 与 pi 的 keyDisplayText 同形:首字母大写,用于 fullscreen 浮层按钮这类原生样式。 */
|
|
73
|
+
export function keyDisplayText(id: string): string {
|
|
74
|
+
return formatKeyText(keyText(id), { capitalize: true });
|
|
75
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-cc-extensions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18-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",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
},
|
|
75
75
|
"x-upstream": {
|
|
76
76
|
"package": "pi-cc-extensions",
|
|
77
|
-
"version": "1.0.
|
|
78
|
-
"reviewedVersion": "1.0.
|
|
77
|
+
"version": "1.0.18",
|
|
78
|
+
"reviewedVersion": "1.0.18",
|
|
79
79
|
"repository": "https://github.com/minuque/pi-cc-extensions",
|
|
80
|
-
"commit": "
|
|
80
|
+
"commit": "a251f652e8cdbb8d395b3df81ca714ed8711df5d",
|
|
81
81
|
"trackVersion": true
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @herbertgao/pi-impeccable
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#377](https://github.com/HerbertGao/pi-extensions/pull/377) [`b02be94`](https://github.com/HerbertGao/pi-extensions/commit/b02be9410f637abc110fd2ee02def0f9d75fd419) Thanks [@HerbertGao](https://github.com/HerbertGao)! - Vendor the official Impeccable 4.9.1 Pi skill. The launcher pins engine 0.1.24, and a GitHub HTTP 5xx during download says the outage is on GitHub's side. `/impeccable foundations` walks a product-foundations checklist. Hiding the live bar stops capturing clicks. The local Go staged-removal fix is kept.
|
|
8
|
+
|
|
3
9
|
## 0.3.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @herbertgao/pi-impeccable
|
|
2
2
|
|
|
3
|
-
The [Impeccable](https://github.com/pbakaus/impeccable) design skill for [Pi](https://pi.dev/), vendored from the official `skill-v4.
|
|
3
|
+
The [Impeccable](https://github.com/pbakaus/impeccable) design skill for [Pi](https://pi.dev/), vendored from the official `skill-v4.9.1` release. It provides design steering, critique, audit, and deterministic anti-pattern detection without an installer, background service, or global skill directory.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -27,7 +27,7 @@ Upstream `pin` and `unpin` only discover skill installations in project harness
|
|
|
27
27
|
|
|
28
28
|
## Updates and provenance
|
|
29
29
|
|
|
30
|
-
This package vendors the official Pi payload:
|
|
30
|
+
This package vendors the official Pi payload: 59 files from commit [`acb4cfe14470b1fdf51e855431af618d936b7db8`](https://github.com/pbakaus/impeccable/commit/acb4cfe14470b1fdf51e855431af618d936b7db8). `scripts/live-browser.js` has one local fix on top of that commit: Go still cleans edit markers on the live selection, but it no longer detaches a staged removal, so Undo and Discard can restore the hidden node. The review cursor stays at that commit. Updates are reviewed and released through this repository rather than the upstream auto-updater. The launcher pins engine `0.1.24`. `/impeccable foundations` walks a product-foundations checklist, and a hidden live bar stops capturing page clicks.
|
|
31
31
|
|
|
32
32
|
## License
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-impeccable",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The Impeccable design skill for Pi, vendored from the official release.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"x-upstream": {
|
|
48
48
|
"package": "impeccable",
|
|
49
|
-
"version": "4.
|
|
50
|
-
"reviewedVersion": "4.
|
|
49
|
+
"version": "4.9.1",
|
|
50
|
+
"reviewedVersion": "4.9.1",
|
|
51
51
|
"repository": "https://github.com/pbakaus/impeccable",
|
|
52
|
-
"commit": "
|
|
52
|
+
"commit": "acb4cfe14470b1fdf51e855431af618d936b7db8"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: impeccable
|
|
3
3
|
description: "Use when the user wants to design, redesign, shape, critique, audit, polish, simplify, harden, animate, or otherwise improve a frontend interface: websites, landing pages, dashboards, product UI, components, forms, settings, onboarding, empty states, and native iOS or Android screens. Handles UX review, hierarchy, layout, typography, color, motion, UX copy, accessibility, responsive behavior, edge cases, and capturing or documenting design systems (DESIGN.md, tokens). Also for making bland UI bolder, loud UI quieter, or ambitious visual effects. Not for backend-only or non-UI tasks."
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.9.1
|
|
5
5
|
license: Apache 2.0
|
|
6
6
|
allowed-tools:
|
|
7
7
|
- Bash(npx impeccable *)
|
|
@@ -86,4 +86,6 @@ After init writes PRODUCT.md, resume without rerunning `impeccable context`; ini
|
|
|
86
86
|
|
|
87
87
|
**Doctor:** `/impeccable doctor` reports and repairs drift between this project's Impeccable artifacts (PRODUCT.md, DESIGN.md and its sidecar, config, surface briefs, the hook) and what this version reads. Load [reference/doctor.md](reference/doctor.md) when the user invokes it, or when they ask what is out of date, stale, or needs refreshing. A `CONTEXT_STALE` directive in Setup's output is the cheap subset of the same report; act on it there per its own instructions rather than running doctor unasked.
|
|
88
88
|
|
|
89
|
+
**Foundations:** `/impeccable foundations` runs `.pi/skills/impeccable/scripts/impeccable foundations` and walks the user through the product-foundations roadmap (secrets, 404 page, icons, CI and more); `/impeccable foundations <id>` fixes that one item. Load [reference/foundations.md](reference/foundations.md) when the user invokes it.
|
|
90
|
+
|
|
89
91
|
**Never repair drift as a side effect of a design task.** A `CONTEXT_STALE` finding is reported, not acted on, unless the user asks. The one exception is a finding marked `auto`, which the next write to that file performs anyway.
|
|
@@ -161,7 +161,7 @@ Choose appropriate breakpoints:
|
|
|
161
161
|
### Navigation Adaptation
|
|
162
162
|
|
|
163
163
|
- Transform complex nav to hamburger/drawer on mobile
|
|
164
|
-
- Bottom nav bar for mobile
|
|
164
|
+
- Bottom nav bar for mobile web
|
|
165
165
|
- Persistent side navigation on desktop
|
|
166
166
|
- Breadcrumbs on smaller screens for context
|
|
167
167
|
|
|
@@ -53,7 +53,14 @@ Run comprehensive checks across 5 dimensions. Score each dimension 0-4 using the
|
|
|
53
53
|
- **Text scaling**: Layouts that break when text size increases
|
|
54
54
|
- **Missing breakpoints**: No mobile/tablet variants
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
On RTL-declared pages, each of the following is a signal to verify the rendered result, not a defect in itself; flag only where the rendering is actually wrong:
|
|
57
|
+
- **Physical directional properties**: `margin-left/right`, `padding-left/right`, `text-align: left/right`, `float: left/right`, `border-left/right` where logical equivalents (`margin-inline-start/end`, `padding-inline-start/end`, `text-align: start/end`, `float: inline-start/end`, `border-inline-start/end`) would be expected. A direction-scoped override like `[dir="rtl"] .x { margin-right:1rem }` is correct only when it also clears the conflicting base property (e.g. `margin-left: 0`); without that, both margins apply
|
|
58
|
+
- **Physical positioning on positioned elements**: `left:` or `right:` instead of `inset-inline-start` / `inset-inline-end`. Note: `left:50%; transform:translateX(-50%)` is a direction-agnostic centering pattern that works correctly in both LTR and RTL; replacing `left` with `inset-inline-start` there breaks the centering because `translateX` is physical and does not mirror
|
|
59
|
+
- **Directional icons and assets**: arrows, chevrons, and navigation icons that point the wrong direction for the reading order. An RTL-only page may ship assets already drawn correctly without a `[dir="rtl"]` flip; verify the rendered icon rather than assuming a missing `transform: scaleX(-1)` is a defect
|
|
60
|
+
|
|
61
|
+
**RTL scope**: flag physical directional properties only on pages that declare `dir="rtl"` on the `<html>` or `<body>` element. A `lang` attribute alone does not set direction (browsers take direction from `dir`, never from `lang`), but treat an RTL-script `lang` (`ar`, `fa`, `ur`, `ps`, `ckb`, `he`, `yi`, `ug`, `sd`, `dv`) without an explicit `dir` as a signal worth noting.
|
|
62
|
+
|
|
63
|
+
**Score 0-4**: 0=Desktop-only (breaks on mobile), 1=Major issues (some breakpoints, many failures), 2=Partial (works on mobile, rough edges), 3=Good (responsive, minor touch target or overflow issues), 4=Excellent (fluid, all viewports, proper touch targets, gestures work under touch). On RTL-declared pages, reduce by 1 for pervasive rendered RTL failures
|
|
57
64
|
|
|
58
65
|
### 5. Implementation Integrity (CRITICAL)
|
|
59
66
|
|
|
@@ -137,3 +144,7 @@ Keep P3s few: a long tail of minor issues buries the ones that matter.
|
|
|
137
144
|
- Skip positive findings (celebrate what works)
|
|
138
145
|
- Forget to prioritize (everything can't be P0)
|
|
139
146
|
- Report false positives without verification
|
|
147
|
+
|
|
148
|
+
## Save the Report
|
|
149
|
+
|
|
150
|
+
After the report is delivered, save a copy so the findings outlive this conversation: write it, from the score table through Recommended Actions, to a temp file, then run `.pi/skills/impeccable/scripts/impeccable audit-storage write "<resolved target, or . for the whole project>" <temp-file>` and delete the temp file. The helper prints the path it wrote, which you mention in one line; `REPORTS OFF:` means the project opted out, and you mention nothing. Saving never replaces delivering: the user reads the report in chat first.
|
|
@@ -137,3 +137,7 @@ Keep P3s few: a long tail of minor issues buries the ones that matter.
|
|
|
137
137
|
- Skip positive findings (celebrate what works)
|
|
138
138
|
- Forget to prioritize (everything can't be P0)
|
|
139
139
|
- Report false positives without verification
|
|
140
|
+
|
|
141
|
+
## Save the Report
|
|
142
|
+
|
|
143
|
+
After the report is delivered, save a copy so the findings outlive this conversation: write it, from the score table through Recommended Actions, to a temp file, then run `.pi/skills/impeccable/scripts/impeccable audit-storage write "<resolved target, or . for the whole project>" <temp-file>` and delete the temp file. The helper prints the path it wrote, which you mention in one line; `REPORTS OFF:` means the project opted out, and you mention nothing. Saving never replaces delivering: the user reads the report in chat first.
|
|
@@ -160,7 +160,7 @@ For each issue, tag with **P0-P3 severity** (see [Issue Severity below](#issue-s
|
|
|
160
160
|
#### Persona Red Flags
|
|
161
161
|
> *Consult the [Personas reference](#persona-based-design-testing) below.*
|
|
162
162
|
|
|
163
|
-
Auto-select 2-3 personas most relevant to this interface type (use the selection table in the reference). If
|
|
163
|
+
Auto-select 2-3 personas most relevant to this interface type (use the selection table in the reference). If PRODUCT.md has a `## Users` section, also generate 1-2 project-specific personas from it and from `## Brand Commitments`.
|
|
164
164
|
|
|
165
165
|
For each selected persona, walk through the primary user action and list specific red flags found:
|
|
166
166
|
|
|
@@ -210,7 +210,7 @@ Skip this step if the Setup slug was null (vague or root-level target).
|
|
|
210
210
|
IMPECCABLE_CRITIQUE_META='{"target":"<user phrasing>","total_score":<n>,"max_score":<n>,"na_heuristics":"<comma-separated numbers, or empty>","p0_count":<n>,"p1_count":<n>}' \
|
|
211
211
|
.pi/skills/impeccable/scripts/impeccable critique-storage write "<resolved target>" <body-file>
|
|
212
212
|
```
|
|
213
|
-
`max_score` is the applicable maximum from the heuristic table (40 when every heuristic applied), so a later run can tell a renormalized total from a full one. For a local file target, the helper also records an exact content fingerprint so polish can distinguish the assessed bytes from later edits without relying on Git state or timestamps. The helper prints the absolute path it wrote. Leave that file on disk. Polish closes it; this run does not.
|
|
213
|
+
`max_score` is the applicable maximum from the heuristic table (40 when every heuristic applied), so a later run can tell a renormalized total from a full one. For a local file target, the helper also records an exact content fingerprint so polish can distinguish the assessed bytes from later edits without relying on Git state or timestamps. The helper prints the absolute path it wrote. Leave that file on disk. Polish closes it; this run does not. `REPORTS OFF:` instead means the project opted out of saved reports: skip the trend read and carry on.
|
|
214
214
|
|
|
215
215
|
3. **Delete the temp body file** after the write attempt completes, whether the write succeeded or failed. If deletion fails, mention `temp-file cleanup failed: <reason>` briefly in the final output, but do not block the critique.
|
|
216
216
|
|
|
@@ -800,7 +800,7 @@ Choose personas based on the interface type:
|
|
|
800
800
|
|
|
801
801
|
#### Project-Specific Personas
|
|
802
802
|
|
|
803
|
-
If
|
|
803
|
+
If PRODUCT.md has a `## Users` section (written by `impeccable init`), derive 1–2 additional personas from it and from `## Brand Commitments`:
|
|
804
804
|
|
|
805
805
|
1. Read the target audience description
|
|
806
806
|
2. Identify the primary user archetype not covered by the 5 predefined personas
|
|
@@ -809,11 +809,11 @@ If `AGENTS.md` contains a `## Design Context` section (generated by `impeccable
|
|
|
809
809
|
```
|
|
810
810
|
##### [Role]: "[Name]"
|
|
811
811
|
|
|
812
|
-
**Profile**: [2-3 key characteristics derived from
|
|
812
|
+
**Profile**: [2-3 key characteristics derived from PRODUCT.md]
|
|
813
813
|
|
|
814
814
|
**Behaviors**: [3-4 specific behaviors based on the described audience]
|
|
815
815
|
|
|
816
816
|
**Red Flags**: [3-4 things that would alienate this specific user type]
|
|
817
817
|
```
|
|
818
818
|
|
|
819
|
-
Only generate project-specific personas when
|
|
819
|
+
Only generate project-specific personas when PRODUCT.md describes real users. Don't invent audience details; use the 5 predefined personas when no context exists.
|
package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/documenter.md
CHANGED
|
@@ -9,7 +9,7 @@ Complete the check within your turn ceiling. Batch Reads, take `reference/docume
|
|
|
9
9
|
|
|
10
10
|
## Input Contract
|
|
11
11
|
|
|
12
|
-
Expect: the project root; the artifact path(s); the direction contract text (THESIS, OWN-WORLD, STORY, FIRST VIEWPORT, FORM); PRODUCT.md path; the path to the skill's `reference/document.md`; the boundary to write at (project or app root); and, when a DESIGN.md already exists there, the user's choice for it (refresh, overwrite, or merge), the answer `reference/document.md` requires before any rewrite, which the parent collects. A merge preserves confirmed incumbent decisions and reconciles them with the build.
|
|
12
|
+
Expect: the project root; the artifact path(s); the direction contract text (THESIS, OWN-WORLD, STORY, FIRST VIEWPORT, FORM); PRODUCT.md path; the path to the skill's `reference/document.md`; the boundary to write at (project or app root); and, when a DESIGN.md already exists there, the user's choice for it (refresh, overwrite, or merge), the answer `reference/document.md` requires before any rewrite, which the parent collects. On a seeded world's first build the parent passes refresh without asking; that counts as the choice. A merge preserves confirmed incumbent decisions and reconciles them with the build.
|
|
13
13
|
|
|
14
14
|
## Workflow
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ Expect: the original request; the confirmed user answers; the artifact path(s);
|
|
|
19
19
|
1. **Persistence.** PRODUCT.md exists. On a comp-led build, `.impeccable/build/state.json` exists and every phase before `review` is `closed` or explicitly `skipped`; an open or failed phase is a material finding. A comp-led config with no state file, or a state whose `comps` phase is neither `closed` nor `skipped`, means the comp round was skipped and the build ran from a world description alone, a material finding that outranks craft; a phase closed with a `forced` record is disclosed as a material finding unless the user downgraded the comp in words the packet quotes; a state file whose `hero.gate.score` sits under 0.72, or a missing state file, means the reproduction ran unproven, a material finding, and `.impeccable/review/hero-repro.png` must exist either way. When DESIGN.md predates this build (an extension or redesign), it matches the built world; on a new world it is written after this review by the documenter, so its absence here is not a finding. When comp-round comps exist under `.impeccable/mocks/`, an approval record exists too: the surface brief naming the approved comp, or an `approved` flag in its sidecar. Comp-round comps with no recorded pick mean the approval point was skipped, a material finding. Files under `.impeccable/mocks/decision/` are exempt: they are the direction round's dealt hand, produced before any comp round, and imply no approval whatever the build path; a code-led build has no comp round at all.
|
|
20
20
|
2. **Fidelity.** Start from the measurement, then judge what it cannot: read `.impeccable/review/diff/final/report.json` (and hero) first; every region scored `missing` or `contradicted` is a matrix row in that state unless the paired crop under `regions/` shows the score is wrong, and you say why; a region scored `match` still gets your eye for lettering character and material, which the numbers do not measure. Then, against your own element inventory of the approved comp, never against the contract's summary of it: topology, reading order, focal scale, overlaps and z-order, density, signature geometry, the primary action's treatment (a CTA the comp physically works, dissolves, or stamps is a signature element; its plain-rectangle rendition is contradicted), navigation items and icons, headline levels and scale relationships. Classify every salient element: match, acceptable adaptation, missing, contradicted, or added without approval. Three rows are mandatory in every matrix. TYPE: the display lettering's character, compression, width, weight, contrast, terminals, against the comp's; a face of a different character is contradicted however the layout matches. MATERIAL: an element rendered as flat CSS or clean vector where the comp shows painted, textured, dimensional, or photographic material is contradicted regardless of placement; medium is part of the promise. GROUND: the page field's value and temperature against the comp's, sampled from pixels on both sides when tooling allows rather than judged from memory, and read as the net on-screen result where a texture or tile paints over the base color; a ground warmer or cooler than the comp's is contradicted however faithfully the layout matches, and drift toward the rendition prior (warm cream on light grounds, blue-black slate on dark) is the direction to hunt. With no approved comp, TYPE and MATERIAL do not lapse: judge them against the contract's OWN-WORLD and the world's real materials, and treat faked physicality (CSS bevels, embossing, stamped-metal or chalk effects imitating a material the page never renders) as contradicted on its face; imitation material is the single most reliable mark of machine-made design. GROUND narrows rather than lapses: with no comp to sample, a color OWN-WORLD names is the target and the same warmer-or-cooler judgment applies; when OWN-WORLD names none, there is no GROUND authority, and the review says so in place of a verdict, because a target the reviewer invents turns the check into taste. A critique-reference comp on such a build is provocation, not spec: no element matrix, no adaptation citations, no asset obligations; its one contribution is what the image dared that the build did not, and dares worth adopting enter material_fixes as ordinary ordered fixes. An adaptation counts as intentional only when it cites the user answer, surface brief, accessibility need, or product truth that forced it; an uncited deviation is a defect. A missing signature element, a changed topology, or content added without approval fails fidelity and outranks every craft point in material_fixes. When MATERIAL is contradicted on the focal element, or contradiction is the page rather than the exception, stop ordering repairs: make the first material fix a rebuild directive naming the comp regions to re-derive and the assets to produce; a list of patches against a rejected page launders the rejection into an approval. A fix that requires producing an asset says so explicitly ("produce: <region> as a raster asset"), never phrased as a style adjustment the parent will answer with CSS. The comp is the spec for composition, topology, element inventory, density, lettering character, and material; it is not a pixel spec for semantics, accessibility, or responsive reflow, and that allowance covers translation, never replacement.
|
|
21
21
|
3. **Ceiling.** Against the QUALITY BAR card: name the world's native devices the build left unused, frame, depth, lettering treatment, ornament density, motion. The card governs commitment and finish, never composition.
|
|
22
|
-
4. **Contract, promise by promise.** First verify FORM carries the seed reference the concept roll printed (`seed:` and 16 hex), corroborated against the roll output the parent saw or with `impeccable concept-seed --check-seed <reference>` (exit 0 means this machine rolled it). A raw seed key in FORM is itself a material fix: the brief is committed, and the key must not be. `seed: none (unavailable)` stands only when the roll printed SEED REFERENCE unavailable, which `--check-seed none` confirms with exit 0. Any other contract with no reference, or one neither source corroborates, means the roll was skipped, a material fix ahead of any craft point. Then, for each of the five blocks: does the render keep the promise? Apply the memory test to the first viewport.
|
|
22
|
+
4. **Contract, promise by promise.** First verify FORM carries the seed reference the concept roll printed (`seed:` and 16 hex), corroborated against the roll output the parent saw or with `impeccable concept-seed --check-seed <reference>` (exit 0 means this machine rolled it). A raw seed key in FORM is itself a material fix: the brief is committed, and the key must not be. `seed: none (unavailable)` stands only when the roll printed SEED REFERENCE unavailable, which `--check-seed none` confirms with exit 0. `seed: none (pinned)` stands only when the original request or the confirmed user answers pin both the direction's world and its first-surface experience, in the words FORM quotes; never judge it with `--check-seed`, which cannot see a pin and reports `none` as a skipped roll. A picture or metaphor alone pins neither. Any other contract with no reference, or one neither source corroborates, means the roll was skipped, a material fix ahead of any craft point. Then, for each of the five blocks: does the render keep the promise? Apply the memory test to the first viewport.
|
|
23
23
|
5. **Truth.** Demonstration data authored and labeled synthetic; no invented commercial claims; unanswered claims present as marked placeholders, not omissions. Every raster region of the spec shipped as its plate (the spec names the file; the page references it; the region's diff row is not `missing`), not a gradient, an inline SVG, or a many-vertex `clip-path` standing in for it, and every produced asset visibly present in the screenshots; an asset applied at near-zero opacity or buried behind a wash is a compliance token, not a shipped material, and the detector's `buried-raster` and `organic-clip-path` findings in the packet are material fixes.
|
|
24
24
|
6. **Floor.** Read the craft floor's Refuse list and hold the screenshots against it: kickers and eyebrows, hard offset shadows outside a neobrutalist world, glyph icons, system display faces, gradient text, side stripes, and the rest. A banned element is a material fix even when it matches nothing in the comp: the builder loaded the same ban before writing it, and fidelity to a comp cannot authorize what the floor refuses. The parent's hook findings cover this mechanically where hooks run; this check exists because hookless harnesses reach you with none, and on those harnesses a banned element you miss ships.
|
|
25
25
|
|