pi-one-ui 0.3.0 → 0.3.1
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 +13 -1
- package/README.en.md +14 -14
- package/README.md +14 -14
- package/extensions/app/commands/settings-previews.ts +3 -3
- package/extensions/app/config/renderer.ts +7 -6
- package/extensions/app/config/shell.ts +4 -4
- package/extensions/app/overlay/selector-border.ts +5 -5
- package/extensions/app/ownership.ts +1 -1
- package/extensions/app/panel.ts +18 -19
- package/extensions/app/runtime/tui-runtime.ts +31 -31
- package/extensions/features/context-inspector/index.ts +3 -3
- package/extensions/features/session-reference/index.ts +5 -5
- package/extensions/features/subagent-autocomplete.ts +1 -1
- package/extensions/layouts/context/index.ts +9 -12
- package/extensions/layouts/context/renderer/compact-mode.ts +24 -24
- package/extensions/layouts/context/renderer/default-mode.ts +21 -16
- package/extensions/layouts/context/renderer/index.ts +24 -24
- package/extensions/layouts/context/renderer/mouse/hover.ts +6 -6
- package/extensions/layouts/context/renderer/mouse/interaction.ts +35 -35
- package/extensions/layouts/context/renderer/mouse/packets.ts +3 -2
- package/extensions/layouts/context/renderer/mouse/scroll.ts +2 -2
- package/extensions/layouts/context/renderer/tool/diff/diff-component.ts +2 -1
- package/extensions/layouts/context/renderer/tool/diff/diff-edit-render.ts +21 -21
- package/extensions/layouts/context/renderer/tool/diff/diff-header.ts +4 -4
- package/extensions/layouts/context/renderer/tool/diff/diff-highlight.ts +6 -6
- package/extensions/layouts/context/renderer/tool/diff/diff-inline.ts +1 -1
- package/extensions/layouts/context/renderer/tool/diff/diff-layout.ts +18 -18
- package/extensions/layouts/context/renderer/tool/diff/diff-limits.ts +5 -5
- package/extensions/layouts/context/renderer/tool/diff/diff-palette.ts +3 -3
- package/extensions/layouts/context/renderer/tool/diff/diff-presentation.ts +1 -1
- package/extensions/layouts/context/renderer/tool/diff/diff-renderer.ts +2 -1
- package/extensions/layouts/context/renderer/tool/diff/diff-write-render.ts +31 -31
- package/extensions/layouts/context/renderer/tool/diff/index.ts +4 -4
- package/extensions/layouts/context/renderer/tool/diff/line-width-safety.ts +1 -1
- package/extensions/layouts/context/renderer/tool/diff/write-execution.ts +1 -1
- package/extensions/layouts/context/renderer/tool/grouping.ts +12 -12
- package/extensions/layouts/context/renderer/tool/message-display.ts +2 -2
- package/extensions/layouts/context/renderer/tool/result.ts +199 -19
- package/extensions/layouts/context/summary/core.ts +1 -0
- package/extensions/layouts/context/summary/index.ts +3 -3
- package/extensions/layouts/context/thinking/compact-thinking.ts +12 -13
- package/extensions/layouts/editor/accent-rail-editor.ts +5 -5
- package/extensions/layouts/editor/controller.ts +4 -4
- package/extensions/layouts/editor/editor-metadata-format.ts +4 -4
- package/extensions/layouts/editor/factory.ts +3 -3
- package/extensions/layouts/editor/index.ts +7 -7
- package/extensions/layouts/editor/minimalist-editor.ts +1 -1
- package/extensions/layouts/editor/ui.ts +7 -7
- package/extensions/layouts/footer/controller.ts +3 -3
- package/extensions/layouts/footer/footer.ts +21 -21
- package/extensions/layouts/footer/index.ts +8 -8
- package/extensions/layouts/header/index.ts +1 -1
- package/extensions/layouts/header/startup-header.ts +3 -2
- package/extensions/layouts/working-line/controller.ts +6 -6
- package/extensions/services/project-refresh.ts +2 -2
- package/extensions/services/session-state.ts +1 -1
- package/extensions/shared/format.ts +2 -2
- package/package.json +8 -10
- package/extensions/features/legacy/working-message.ts +0 -226
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
import { ToolExecutionComponent } from "@earendil-works/pi-coding-agent";
|
|
8
8
|
import { Text, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
9
9
|
import {
|
|
10
|
+
type CompactStyleMode,
|
|
10
11
|
config,
|
|
11
12
|
getToolDisplayConfig,
|
|
12
|
-
type CompactStyleMode,
|
|
13
13
|
} from "../../../app/config/renderer.ts";
|
|
14
|
+
import { oneLine } from "../../../tools/format.ts";
|
|
14
15
|
import {
|
|
15
16
|
COMPONENT_TOOL_RENDER_MODE,
|
|
16
17
|
GLOBAL_TOOL_RENDER_PATCH,
|
|
@@ -18,6 +19,13 @@ import {
|
|
|
18
19
|
TOOL_EXPANDED_BACKGROUND_PATCH,
|
|
19
20
|
} from "../../../tools/patch-keys.ts";
|
|
20
21
|
import { isToolCallHovered } from "./mouse/hover.ts";
|
|
22
|
+
import { countWriteDiffStats } from "./tool/diff/diff-renderer.ts";
|
|
23
|
+
import {
|
|
24
|
+
renderRichToolResult,
|
|
25
|
+
type WriteExecutionMetadataStore,
|
|
26
|
+
} from "./tool/diff/index.ts";
|
|
27
|
+
import { getMessageDisplayTheme } from "./tool/message-display.ts";
|
|
28
|
+
import { humanizeToolLabel, toolCallSummary } from "./tool/names.ts";
|
|
21
29
|
import {
|
|
22
30
|
countLines,
|
|
23
31
|
hasExpandableDetail,
|
|
@@ -30,28 +38,20 @@ import {
|
|
|
30
38
|
renderExpandedToolResult,
|
|
31
39
|
resolveToolVisualState,
|
|
32
40
|
scheduleAnimation,
|
|
33
|
-
settledIcon,
|
|
34
41
|
setToolVisualState,
|
|
42
|
+
settledIcon,
|
|
35
43
|
textFromResult,
|
|
36
44
|
toolIconColor,
|
|
37
45
|
toolViewportWidth,
|
|
38
46
|
} from "./tool/result.ts";
|
|
39
|
-
import { oneLine } from "../../../tools/format.ts";
|
|
40
47
|
import { showMoreHintText } from "./tool/show-more-hint.ts";
|
|
41
|
-
import { countWriteDiffStats } from "./tool/diff/diff-renderer.ts";
|
|
42
|
-
import {
|
|
43
|
-
renderRichToolResult,
|
|
44
|
-
type WriteExecutionMetadataStore,
|
|
45
|
-
} from "./tool/diff/index.ts";
|
|
46
|
-
import { getMessageDisplayTheme } from "./tool/message-display.ts";
|
|
47
|
-
import { humanizeToolLabel, toolCallSummary } from "./tool/names.ts";
|
|
48
48
|
|
|
49
49
|
// 成功勾:亮绿 truecolor(与 message-display 一致)
|
|
50
50
|
const BRIGHT_GREEN = "\x1b[38;2;80;220;100m";
|
|
51
51
|
const ANSI_FG_RESET = "\x1b[39m";
|
|
52
52
|
|
|
53
|
-
//
|
|
54
|
-
const DEDICATED_RENDERER_TOOLS = new Set(["Agent"]);
|
|
53
|
+
// Preserve rich renderers owned by legacy Agent tools and modern pi-subagents.
|
|
54
|
+
const DEDICATED_RENDERER_TOOLS = new Set(["Agent", "subagent"]);
|
|
55
55
|
|
|
56
56
|
export type DefaultModeHooks = {
|
|
57
57
|
/** 本安装是否仍持有全局工具渲染补丁。 */
|
|
@@ -148,14 +148,14 @@ function renderDefault(
|
|
|
148
148
|
tool: any,
|
|
149
149
|
slot: "renderCall" | "renderResult",
|
|
150
150
|
args: any[],
|
|
151
|
-
fallback = "",
|
|
151
|
+
fallback: string | (() => string) = "",
|
|
152
152
|
) {
|
|
153
153
|
try {
|
|
154
154
|
if (typeof tool?.[slot] === "function") return tool[slot](...args);
|
|
155
155
|
} catch {
|
|
156
156
|
// Fall through to raw fallback.
|
|
157
157
|
}
|
|
158
|
-
return new Text(fallback, 0, 0);
|
|
158
|
+
return new Text(typeof fallback === "function" ? fallback() : fallback, 0, 0);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
type ParsedTask = { id: string; status: string; subject: string };
|
|
@@ -320,7 +320,7 @@ function createCcstyleTool(
|
|
|
320
320
|
originalTool,
|
|
321
321
|
"renderResult",
|
|
322
322
|
[result, options, theme, context],
|
|
323
|
-
textFromResult(result),
|
|
323
|
+
() => textFromResult(result),
|
|
324
324
|
);
|
|
325
325
|
}
|
|
326
326
|
|
|
@@ -421,7 +421,12 @@ function createCcstyleTool(
|
|
|
421
421
|
isToolCallHovered(toolCallId) ? cachedHoveredLine! : cachedLine,
|
|
422
422
|
];
|
|
423
423
|
},
|
|
424
|
-
invalidate() {
|
|
424
|
+
invalidate() {
|
|
425
|
+
cachedWidth = undefined;
|
|
426
|
+
cachedLine = undefined;
|
|
427
|
+
cachedHoveredLine = undefined;
|
|
428
|
+
context?.state?.ccstyleExpandedIoView?.invalidate?.();
|
|
429
|
+
},
|
|
425
430
|
};
|
|
426
431
|
},
|
|
427
432
|
};
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type { CompactThinkingController } from "../thinking/compact-thinking.ts";
|
|
3
2
|
import {
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
|
|
3
|
+
type CompactStyleMode,
|
|
4
|
+
type Config,
|
|
5
|
+
config,
|
|
6
|
+
normalizeConfig,
|
|
7
|
+
setConfig,
|
|
8
|
+
updateConfig,
|
|
9
|
+
} from "../../../app/config/renderer.ts";
|
|
10
|
+
import { isLazyProxyTui } from "../../../tools/fullscreen-detect.ts";
|
|
11
|
+
import {
|
|
12
|
+
GLOBAL_COMPACTION_RENDER_PATCH,
|
|
13
|
+
patchRegistry,
|
|
14
|
+
} from "../../../tools/patch-keys.ts";
|
|
15
|
+
import type { CompactThinkingController } from "../thinking/compact-thinking.ts";
|
|
7
16
|
import {
|
|
8
|
-
installCompactMode,
|
|
9
|
-
refreshCompactModeComponents,
|
|
10
17
|
type CompactModeHooks,
|
|
11
18
|
type CompactThinkingQuery,
|
|
19
|
+
installCompactMode,
|
|
20
|
+
refreshCompactModeComponents,
|
|
12
21
|
} from "./compact-mode.ts";
|
|
13
22
|
import {
|
|
23
|
+
type DefaultModeHooks,
|
|
14
24
|
installDefaultMode,
|
|
15
25
|
installToolExpandedBackground,
|
|
16
|
-
type DefaultModeHooks,
|
|
17
26
|
} from "./default-mode.ts";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
GLOBAL_COMPACTION_RENDER_PATCH,
|
|
21
|
-
patchRegistry,
|
|
22
|
-
} from "../../../tools/patch-keys.ts";
|
|
23
|
-
import {
|
|
24
|
-
config,
|
|
25
|
-
normalizeConfig,
|
|
26
|
-
setConfig,
|
|
27
|
-
updateConfig,
|
|
28
|
-
type CompactStyleMode,
|
|
29
|
-
type Config,
|
|
30
|
-
} from "../../../app/config/renderer.ts";
|
|
27
|
+
import { setHoveredToolGroup, setHoveredToolIo } from "./mouse/hover.ts";
|
|
31
28
|
import {
|
|
32
29
|
installToolMouseInteraction,
|
|
33
30
|
resetToolHoverState,
|
|
34
31
|
scheduleSessionRender,
|
|
35
|
-
teardownToolMouseInteraction,
|
|
36
32
|
TOOL_MOUSE_DISABLE,
|
|
33
|
+
teardownToolMouseInteraction,
|
|
37
34
|
} from "./mouse/interaction.ts";
|
|
38
35
|
import { getToolMouseTui } from "./mouse/scroll.ts";
|
|
39
|
-
import { setHoveredToolGroup, setHoveredToolIo } from "./mouse/hover.ts";
|
|
40
|
-
import { clearAllAnimations } from "./tool/result.ts";
|
|
41
36
|
import {
|
|
42
37
|
installWriteOverride,
|
|
43
38
|
WriteExecutionMetadataStore,
|
|
44
39
|
} from "./tool/diff/index.ts";
|
|
40
|
+
import {
|
|
41
|
+
installToolGrouping,
|
|
42
|
+
type ToolGroupingHooks,
|
|
43
|
+
} from "./tool/grouping.ts";
|
|
45
44
|
import {
|
|
46
45
|
installMessageDisplayRendering,
|
|
47
46
|
refreshMessageDisplays,
|
|
48
47
|
setMessageDisplayTheme,
|
|
49
48
|
} from "./tool/message-display.ts";
|
|
49
|
+
import { clearAllAnimations } from "./tool/result.ts";
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Claude Code Style for pi — 装配入口。
|
|
@@ -277,10 +277,10 @@ export {
|
|
|
277
277
|
preservesOriginalRenderer,
|
|
278
278
|
shouldRenderRichDiff,
|
|
279
279
|
} from "./default-mode.ts";
|
|
280
|
+
export { installToolMouseInteraction } from "./mouse/interaction.ts";
|
|
280
281
|
export {
|
|
281
282
|
ExpandedToolIoView,
|
|
282
283
|
ExpandedToolResultText,
|
|
283
284
|
formatToolInputArgs,
|
|
284
285
|
SHOW_MORE_LABEL,
|
|
285
286
|
} from "./tool/result.ts";
|
|
286
|
-
export { installToolMouseInteraction } from "./mouse/interaction.ts";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ThinkingPreviewBlock } from "../../thinking/compact-thinking.ts";
|
|
2
|
-
import { setHoveredCompactAssistant } from "../compact-mode.ts";
|
|
3
1
|
import {
|
|
4
2
|
patchRegistry,
|
|
5
3
|
TOOL_HOVER_STATE_KEY,
|
|
6
4
|
} from "../../../../tools/patch-keys.ts";
|
|
5
|
+
import type { ThinkingPreviewBlock } from "../../thinking/compact-thinking.ts";
|
|
6
|
+
import { setHoveredCompactAssistant } from "../compact-mode.ts";
|
|
7
|
+
import type { ToolGroupComponent } from "../tool/grouping.ts";
|
|
7
8
|
import {
|
|
8
|
-
isExpandedToolIoView,
|
|
9
|
-
invalidateIoView,
|
|
10
9
|
type ExpandedToolIoView,
|
|
10
|
+
invalidateIoView,
|
|
11
|
+
isExpandedToolIoView,
|
|
11
12
|
type ToolIoSection,
|
|
12
13
|
} from "../tool/result.ts";
|
|
13
|
-
import type
|
|
14
|
-
import { componentAtLocalRow, type ComponentRowHit } from "./layout.ts";
|
|
14
|
+
import { type ComponentRowHit, componentAtLocalRow } from "./layout.ts";
|
|
15
15
|
import { setScrollButtonHovered } from "./scroll.ts";
|
|
16
16
|
|
|
17
17
|
type SharedToolHoverState = { toolCallId: string | null };
|
|
@@ -1,53 +1,67 @@
|
|
|
1
|
+
import { config } from "../../../../app/config/renderer.ts";
|
|
2
|
+
import { inputRouter } from "../../../../app/overlay/input-router.ts";
|
|
3
|
+
import { overlayManager } from "../../../../app/overlay/overlay-manager.ts";
|
|
1
4
|
import {
|
|
2
5
|
hasActiveTextPreview,
|
|
3
6
|
showTextPreview,
|
|
4
7
|
} from "../../../../features/context-inspector/index.ts";
|
|
5
|
-
import {
|
|
6
|
-
import { inputRouter } from "../../../../app/overlay/input-router.ts";
|
|
7
|
-
import { overlayManager } from "../../../../app/overlay/overlay-manager.ts";
|
|
8
|
+
import { isLazyProxyTui } from "../../../../tools/fullscreen-detect.ts";
|
|
8
9
|
import {
|
|
9
10
|
patchRegistry,
|
|
10
11
|
TOOL_MOUSE_OWNER_KEY,
|
|
11
12
|
} from "../../../../tools/patch-keys.ts";
|
|
12
|
-
import {
|
|
13
|
+
import { ThinkingPreviewBlock } from "../../thinking/compact-thinking.ts";
|
|
13
14
|
import {
|
|
14
15
|
isCompactAssistantComponent,
|
|
15
16
|
setHoveredCompactAssistant,
|
|
16
17
|
} from "../compact-mode.ts";
|
|
18
|
+
import { ToolGroupComponent } from "../tool/grouping.ts";
|
|
17
19
|
import { isMessageDisplayComponent } from "../tool/message-display.ts";
|
|
18
|
-
import { config } from "../../../../app/config/renderer.ts";
|
|
19
|
-
import { isLazyProxyTui } from "../../../../tools/fullscreen-detect.ts";
|
|
20
|
-
import { setToolTuiFullscreen } from "../tool/show-more-hint.ts";
|
|
21
20
|
import {
|
|
22
21
|
type ExpandedToolIoView,
|
|
23
22
|
getActiveIoViewFrame,
|
|
24
|
-
isExpandedToolIoView,
|
|
25
23
|
type IoViewFrameState,
|
|
24
|
+
isExpandedToolIoView,
|
|
26
25
|
setActiveIoViewFrame,
|
|
27
26
|
type ToolIoSection,
|
|
28
27
|
} from "../tool/result.ts";
|
|
28
|
+
import { setToolTuiFullscreen } from "../tool/show-more-hint.ts";
|
|
29
|
+
import {
|
|
30
|
+
applyFullscreenHover,
|
|
31
|
+
cachedFullscreenComponentAtRow,
|
|
32
|
+
type FullscreenHoverTarget,
|
|
33
|
+
setHoveredMessageDisplay,
|
|
34
|
+
setHoveredThinking,
|
|
35
|
+
setHoveredToolCallId,
|
|
36
|
+
setHoveredToolGroup,
|
|
37
|
+
setHoveredToolIo,
|
|
38
|
+
sharedToolHoverState,
|
|
39
|
+
} from "./hover.ts";
|
|
40
|
+
import {
|
|
41
|
+
collapsedHintHitbox,
|
|
42
|
+
collectFullscreenToolCards,
|
|
43
|
+
componentAtLocalRow,
|
|
44
|
+
fullscreenContentWidth,
|
|
45
|
+
fullscreenLeafAt,
|
|
46
|
+
isScrollbarColumnAt,
|
|
47
|
+
} from "./layout.ts";
|
|
29
48
|
import {
|
|
30
49
|
collectToolComponents,
|
|
31
50
|
extractToolFramePlacements,
|
|
51
|
+
type FrameToolPlacement,
|
|
32
52
|
isSgrLeftPress,
|
|
33
53
|
isToolExecutionComponent,
|
|
34
54
|
parseSgrMousePackets,
|
|
55
|
+
type SgrMousePacket,
|
|
35
56
|
stripTerminalSequences,
|
|
36
57
|
stripTerminalSequencesPreservingLayout,
|
|
37
58
|
toolFrameMarker,
|
|
38
|
-
type FrameToolPlacement,
|
|
39
|
-
type SgrMousePacket,
|
|
40
59
|
} from "./packets.ts";
|
|
41
|
-
import {
|
|
42
|
-
collectFullscreenToolCards,
|
|
43
|
-
componentAtLocalRow,
|
|
44
|
-
collapsedHintHitbox,
|
|
45
|
-
fullscreenContentWidth,
|
|
46
|
-
fullscreenLeafAt,
|
|
47
|
-
isScrollbarColumnAt,
|
|
48
|
-
} from "./layout.ts";
|
|
49
60
|
import {
|
|
50
61
|
fullscreenLazyTui,
|
|
62
|
+
getScrollButtonVisible,
|
|
63
|
+
getScrollButtonWidget,
|
|
64
|
+
getToolMouseTui,
|
|
51
65
|
hideScrollButton,
|
|
52
66
|
isScrollBottomInput,
|
|
53
67
|
renderScrollButton,
|
|
@@ -57,23 +71,9 @@ import {
|
|
|
57
71
|
setScrollButtonVisible,
|
|
58
72
|
setScrollButtonWidget,
|
|
59
73
|
setToolMouseTui,
|
|
60
|
-
getScrollButtonVisible,
|
|
61
|
-
getScrollButtonWidget,
|
|
62
|
-
getToolMouseTui,
|
|
63
74
|
toolMouseInteractionActive,
|
|
64
75
|
updateScrollButtonFromInput,
|
|
65
76
|
} from "./scroll.ts";
|
|
66
|
-
import {
|
|
67
|
-
applyFullscreenHover,
|
|
68
|
-
cachedFullscreenComponentAtRow,
|
|
69
|
-
sharedToolHoverState,
|
|
70
|
-
setHoveredToolCallId,
|
|
71
|
-
setHoveredToolGroup,
|
|
72
|
-
setHoveredThinking,
|
|
73
|
-
setHoveredMessageDisplay,
|
|
74
|
-
setHoveredToolIo,
|
|
75
|
-
type FullscreenHoverTarget,
|
|
76
|
-
} from "./hover.ts";
|
|
77
77
|
|
|
78
78
|
type FrameToolRender = {
|
|
79
79
|
component: any;
|
|
@@ -1024,12 +1024,12 @@ export function scheduleSessionRender(refresh?: () => void): void {
|
|
|
1024
1024
|
}, 0);
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
|
-
// toolMouseTui 跨模块读取一律走 getToolMouseTui()(jiti 转译下 let 绑定可能是快照);
|
|
1028
|
-
// 此 re-export 仅保留兼容旧导入,新代码请用 getToolMouseTui。
|
|
1029
|
-
export { toolMouseTui } from "./scroll.ts";
|
|
1030
1027
|
export {
|
|
1031
1028
|
hoveredToolCallId,
|
|
1032
1029
|
isToolCallHovered,
|
|
1033
1030
|
setHoveredToolGroup,
|
|
1034
1031
|
setHoveredToolIo,
|
|
1035
1032
|
} from "./hover.ts";
|
|
1033
|
+
// toolMouseTui 跨模块读取一律走 getToolMouseTui()(jiti 转译下 let 绑定可能是快照);
|
|
1034
|
+
// 此 re-export 仅保留兼容旧导入,新代码请用 getToolMouseTui。
|
|
1035
|
+
export { toolMouseTui } from "./scroll.ts";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { ExpandedToolIoView, ToolIoSection } from "../tool/result.ts";
|
|
2
1
|
import { walkComponentTree } from "../../../../tools/component-tree.ts";
|
|
2
|
+
import type { ExpandedToolIoView, ToolIoSection } from "../tool/result.ts";
|
|
3
|
+
|
|
3
4
|
export {
|
|
4
5
|
stripTerminalSequences,
|
|
5
6
|
stripTerminalSequencesPreservingLayout,
|
|
6
7
|
} from "../../../../tools/ansi-text.ts";
|
|
7
8
|
export {
|
|
8
|
-
parseSgrMousePackets,
|
|
9
9
|
isSgrLeftPress,
|
|
10
|
+
parseSgrMousePackets,
|
|
10
11
|
type SgrMousePacket,
|
|
11
12
|
} from "../../../../tools/sgr-mouse.ts";
|
|
12
13
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getKeybindings,
|
|
3
|
+
type Keybinding,
|
|
3
4
|
matchesKey,
|
|
4
5
|
truncateToWidth,
|
|
5
6
|
visibleWidth,
|
|
6
|
-
type Keybinding,
|
|
7
7
|
} from "@earendil-works/pi-tui";
|
|
8
8
|
import { config } from "../../../../app/config/renderer.ts";
|
|
9
9
|
import { isLazyProxyTui } from "../../../../tools/fullscreen-detect.ts";
|
|
10
|
-
import { parseSgrMousePackets } from "./packets.ts";
|
|
11
10
|
import {
|
|
12
11
|
patchRegistry,
|
|
13
12
|
SCROLL_BUTTON_STATE_SLOT,
|
|
14
13
|
TOOL_MOUSE_TUI_SLOT,
|
|
15
14
|
} from "../../../../tools/patch-keys.ts";
|
|
15
|
+
import { parseSgrMousePackets } from "./packets.ts";
|
|
16
16
|
|
|
17
17
|
const ZENTUI_PAGE_UP_INPUT =
|
|
18
18
|
/^\x1b\[5;9(?::[12])?~$|^\x1b\[57421;9(?::[12])?u$|^\x1b\[1;6A$/;
|
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
type DiffIndicatorMode,
|
|
4
4
|
type ToolDisplayConfig,
|
|
5
5
|
} from "../../../../../app/config/renderer.ts";
|
|
6
|
-
import type { DiffPresentationMode } from "./diff-presentation.ts";
|
|
7
6
|
import { RICH_DIFF_COMPONENT } from "../../../../../tools/patch-keys.ts";
|
|
7
|
+
import type { DiffPresentationMode } from "./diff-presentation.ts";
|
|
8
|
+
|
|
8
9
|
export { RICH_DIFF_COMPONENT };
|
|
9
10
|
|
|
10
11
|
/** Snapshot or live getter — panel changes must apply on the next paint. */
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import { Text, type Component } from "@earendil-works/pi-tui";
|
|
2
1
|
import type { EditToolDetails } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { type Component, Text } from "@earendil-works/pi-tui";
|
|
3
3
|
import { sanitizeToolResultText } from "../../../../../tools/tool-result-sanitize.ts";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
createDiffRenderCache,
|
|
6
|
+
type DiffRenderOptions,
|
|
7
|
+
type DisplayConfigInput,
|
|
8
|
+
displayConfigCacheKey,
|
|
9
|
+
RICH_DIFF_COMPONENT,
|
|
10
|
+
resolveDiffIndicatorMode,
|
|
11
|
+
resolveLiveDisplayConfig,
|
|
12
|
+
} from "./diff-component.ts";
|
|
13
|
+
import {
|
|
14
|
+
renderDiffFrameLine,
|
|
15
|
+
renderHeaderRows,
|
|
16
|
+
renderSingleDiffRow,
|
|
17
|
+
} from "./diff-header.ts";
|
|
11
18
|
import {
|
|
12
19
|
createCodeLineHighlighter,
|
|
13
20
|
resolveLanguageFromPath,
|
|
14
21
|
} from "./diff-highlight.ts";
|
|
22
|
+
import { buildInlineHighlightMap, buildSplitRows } from "./diff-inline.ts";
|
|
15
23
|
import {
|
|
16
24
|
canRenderSplitLayout,
|
|
25
|
+
type DiffRenderContext,
|
|
17
26
|
renderCompact,
|
|
18
27
|
renderSplit,
|
|
19
28
|
renderUnified,
|
|
20
|
-
type DiffRenderContext,
|
|
21
29
|
} from "./diff-layout.ts";
|
|
22
|
-
import {
|
|
23
|
-
renderDiffFrameLine,
|
|
24
|
-
renderHeaderRows,
|
|
25
|
-
renderSingleDiffRow,
|
|
26
|
-
} from "./diff-header.ts";
|
|
27
30
|
import {
|
|
28
31
|
applyLineLimit,
|
|
29
32
|
clampDiffLinesToWidth,
|
|
@@ -32,15 +35,12 @@ import {
|
|
|
32
35
|
takeEntriesForLineBudget,
|
|
33
36
|
takeSplitRowsForBudget,
|
|
34
37
|
} from "./diff-limits.ts";
|
|
38
|
+
import { type DiffTheme, resolveDiffPalette } from "./diff-palette.ts";
|
|
35
39
|
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
resolveLiveDisplayConfig,
|
|
41
|
-
type DiffRenderOptions,
|
|
42
|
-
type DisplayConfigInput,
|
|
43
|
-
} from "./diff-component.ts";
|
|
40
|
+
getLineNumberWidth,
|
|
41
|
+
type ParsedDiff,
|
|
42
|
+
parseDiff,
|
|
43
|
+
} from "./diff-parse.ts";
|
|
44
44
|
import {
|
|
45
45
|
buildDiffSummaryText,
|
|
46
46
|
normalizeDiffRenderWidth,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
2
2
|
import { sanitizeAnsiForThemedOutput } from "./ansi-utils.ts";
|
|
3
|
-
import {
|
|
3
|
+
import type { RenderedRow } from "./diff-layout.ts";
|
|
4
|
+
import { clampDiffLineToWidth } from "./diff-limits.ts";
|
|
4
5
|
import {
|
|
6
|
+
type DiffTheme,
|
|
5
7
|
emphasis,
|
|
6
8
|
stabilizeBackgroundResets,
|
|
7
|
-
type DiffTheme,
|
|
8
9
|
} from "./diff-palette.ts";
|
|
9
|
-
import { clampDiffLineToWidth } from "./diff-limits.ts";
|
|
10
10
|
import type { DiffMetaEntry, DiffStats } from "./diff-parse.ts";
|
|
11
11
|
import type { DiffPresentationMode } from "./diff-presentation.ts";
|
|
12
|
-
import
|
|
12
|
+
import { normalizeCodeWhitespace, wrapToWidth } from "./diff-text.ts";
|
|
13
13
|
|
|
14
14
|
export function formatMetaEntryRows(
|
|
15
15
|
entry: DiffMetaEntry,
|
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
getLanguageFromPath,
|
|
3
3
|
highlightCode,
|
|
4
4
|
} from "@earendil-works/pi-coding-agent";
|
|
5
|
-
import { sanitizeAnsiForThemedOutput } from "./ansi-utils.ts";
|
|
6
5
|
import { sanitizeToolResultText } from "../../../../../tools/tool-result-sanitize.ts";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { sanitizeAnsiForThemedOutput } from "./ansi-utils.ts";
|
|
7
|
+
import type { DiffSpan } from "./diff-inline.ts";
|
|
9
8
|
import {
|
|
10
9
|
applyInlineSpanHighlight,
|
|
11
|
-
getLineBackground,
|
|
12
|
-
resolveShikiTheme,
|
|
13
10
|
type DiffPalette,
|
|
14
11
|
type DiffTheme,
|
|
12
|
+
getLineBackground,
|
|
13
|
+
resolveShikiTheme,
|
|
15
14
|
} from "./diff-palette.ts";
|
|
16
15
|
import type { DiffLineEntry, ParsedDiffEntry } from "./diff-parse.ts";
|
|
17
|
-
import
|
|
16
|
+
import { normalizeCodeWhitespace } from "./diff-text.ts";
|
|
17
|
+
import { MAX_HL_CHARS, shikiHighlightCache } from "./shiki-highlight.ts";
|
|
18
18
|
|
|
19
19
|
export type CodeLineHighlighter = (
|
|
20
20
|
line: string,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { normalizeCodeWhitespace } from "./diff-text.ts";
|
|
2
1
|
import type {
|
|
3
2
|
DiffLineEntry,
|
|
4
3
|
DiffMetaEntry,
|
|
5
4
|
ParsedDiffEntry,
|
|
6
5
|
} from "./diff-parse.ts";
|
|
6
|
+
import { normalizeCodeWhitespace } from "./diff-text.ts";
|
|
7
7
|
|
|
8
8
|
export interface DiffSpan {
|
|
9
9
|
start: number;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { DiffIndicatorMode } from "../../../../../app/config/renderer.ts";
|
|
3
|
+
import { formatMetaEntryRows } from "./diff-header.ts";
|
|
2
4
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type CodeLineHighlighter,
|
|
6
|
+
highlightDiffLine,
|
|
7
|
+
} from "./diff-highlight.ts";
|
|
8
|
+
import {
|
|
9
|
+
type DiffSpan,
|
|
10
|
+
getCellLineNumber,
|
|
11
|
+
type SplitDiffRow,
|
|
12
|
+
} from "./diff-inline.ts";
|
|
7
13
|
import {
|
|
8
14
|
ANSI_BG_RESET,
|
|
9
15
|
applyLineBackgroundToWrappedRows,
|
|
10
16
|
colorizeSegment,
|
|
11
|
-
readThemeAnsi,
|
|
12
|
-
stabilizeBackgroundResets,
|
|
13
17
|
type DiffPalette,
|
|
14
18
|
type DiffTheme,
|
|
19
|
+
readThemeAnsi,
|
|
20
|
+
stabilizeBackgroundResets,
|
|
15
21
|
} from "./diff-palette.ts";
|
|
16
22
|
import {
|
|
17
|
-
highlightDiffLine,
|
|
18
|
-
type CodeLineHighlighter,
|
|
19
|
-
} from "./diff-highlight.ts";
|
|
20
|
-
import {
|
|
21
|
-
formatLineNumberLabel,
|
|
22
|
-
getCompactLineRenderContent,
|
|
23
23
|
type DiffLineEntry,
|
|
24
24
|
type DiffLineKind,
|
|
25
25
|
type DiffMetaEntry,
|
|
26
|
+
formatLineNumberLabel,
|
|
27
|
+
getCompactLineRenderContent,
|
|
26
28
|
type ParsedDiffEntry,
|
|
27
29
|
} from "./diff-parse.ts";
|
|
28
30
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} from "./diff-
|
|
33
|
-
import { formatMetaEntryRows } from "./diff-header.ts";
|
|
34
|
-
import type { DiffIndicatorMode } from "../../../../../app/config/renderer.ts";
|
|
31
|
+
fitToWidth,
|
|
32
|
+
normalizeCodeWhitespace,
|
|
33
|
+
wrapToWidth,
|
|
34
|
+
} from "./diff-text.ts";
|
|
35
35
|
|
|
36
36
|
export interface RenderedRow {
|
|
37
37
|
text: string;
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
type ToolDisplayConfig,
|
|
5
5
|
} from "../../../../../app/config/renderer.ts";
|
|
6
6
|
import { showMoreHintText } from "../show-more-hint.ts";
|
|
7
|
+
import type { SplitDiffRow } from "./diff-inline.ts";
|
|
8
|
+
import type { RenderedRow } from "./diff-layout.ts";
|
|
9
|
+
import { type DiffTheme, stabilizeBackgroundResets } from "./diff-palette.ts";
|
|
10
|
+
import { countDiffLineEntries, type ParsedDiffEntry } from "./diff-parse.ts";
|
|
7
11
|
import {
|
|
8
12
|
buildCollapsedDiffHintText,
|
|
9
|
-
clampRenderedLineToWidth,
|
|
10
13
|
clampRenderedLinesToWidth,
|
|
14
|
+
clampRenderedLineToWidth,
|
|
11
15
|
} from "./line-width-safety.ts";
|
|
12
|
-
import { stabilizeBackgroundResets, type DiffTheme } from "./diff-palette.ts";
|
|
13
|
-
import { countDiffLineEntries, type ParsedDiffEntry } from "./diff-parse.ts";
|
|
14
|
-
import type { SplitDiffRow } from "./diff-inline.ts";
|
|
15
|
-
import type { RenderedRow } from "./diff-layout.ts";
|
|
16
16
|
|
|
17
17
|
const DIFF_WIDTH_OPS = {
|
|
18
18
|
measure: visibleWidth,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ansi256ToRgb } from "../../../../../tools/ansi-color.ts";
|
|
1
2
|
import {
|
|
2
3
|
ANSI_SGR_PATTERN,
|
|
3
4
|
expandSgrReset,
|
|
@@ -5,10 +6,9 @@ import {
|
|
|
5
6
|
readSgrColorSequence,
|
|
6
7
|
toSgrParams,
|
|
7
8
|
} from "./ansi-utils.ts";
|
|
8
|
-
import {
|
|
9
|
-
import { fitToWidth } from "./diff-text.ts";
|
|
10
|
-
import { mergeSpans, type DiffSpan } from "./diff-inline.ts";
|
|
9
|
+
import { type DiffSpan, mergeSpans } from "./diff-inline.ts";
|
|
11
10
|
import type { DiffLineKind } from "./diff-parse.ts";
|
|
11
|
+
import { fitToWidth } from "./diff-text.ts";
|
|
12
12
|
|
|
13
13
|
export interface DiffTheme {
|
|
14
14
|
fg(color: string, text: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
2
|
-
import { pluralize } from "./diff-text.ts";
|
|
3
2
|
import type { ToolDisplayConfig } from "../../../../../app/config/renderer.ts";
|
|
3
|
+
import { pluralize } from "./diff-text.ts";
|
|
4
4
|
|
|
5
5
|
export interface DiffSummaryStats {
|
|
6
6
|
added: number;
|
|
@@ -16,13 +16,14 @@
|
|
|
16
16
|
* This file re-exports the stable public symbols so external importers
|
|
17
17
|
* (diff/index.ts, compact-mode.ts, tests) keep working unchanged.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
export type { DisplayConfigInput } from "./diff-component.ts";
|
|
21
21
|
export { isRichDiffComponent } from "./diff-component.ts";
|
|
22
22
|
export {
|
|
23
23
|
countEditDiffStats,
|
|
24
24
|
renderEditDiffResult,
|
|
25
25
|
} from "./diff-edit-render.ts";
|
|
26
|
+
export { shouldHighlightCodeBlock } from "./diff-highlight.ts";
|
|
26
27
|
export {
|
|
27
28
|
countWriteDiffStats,
|
|
28
29
|
renderWriteDiffResult,
|