pi-one-ui 0.3.0 → 0.4.0
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 +31 -1
- package/README.en.md +39 -35
- package/README.md +20 -16
- package/extensions/app/commands/settings-previews.ts +4 -16
- package/extensions/app/config/renderer.ts +7 -6
- package/extensions/app/config/shell.ts +15 -137
- package/extensions/app/overlay/selector-border.ts +5 -5
- package/extensions/app/ownership.ts +1 -1
- package/extensions/app/panel.ts +19 -25
- package/extensions/app/runtime/tui-runtime.ts +31 -56
- 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/controller.ts +3 -57
- package/extensions/layouts/editor/editor-metadata-format.ts +4 -4
- package/extensions/layouts/editor/factory.ts +5 -23
- package/extensions/layouts/editor/index.ts +2 -8
- package/extensions/layouts/editor/minimalist-editor.ts +1 -52
- package/extensions/layouts/editor/ui.ts +23 -255
- 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/layouts/working-line/interaction-summary.ts +47 -7
- package/extensions/layouts/working-line/working-line.ts +24 -3
- package/extensions/services/project-refresh.ts +2 -2
- package/extensions/services/session-state.ts +1 -1
- package/extensions/shared/format.ts +2 -2
- package/extensions/shared/icons.ts +0 -4
- package/package.json +9 -12
- package/extensions/features/legacy/working-message.ts +0 -226
- package/extensions/layouts/editor/accent-rail-editor.ts +0 -112
- package/extensions/layouts/editor/accent-rail-layout-patch.ts +0 -530
|
@@ -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,
|
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type Component,
|
|
2
3
|
Text,
|
|
3
4
|
truncateToWidth,
|
|
4
5
|
visibleWidth,
|
|
5
|
-
type Component,
|
|
6
6
|
} from "@earendil-works/pi-tui";
|
|
7
7
|
import { sanitizeToolResultText } from "../../../../../tools/tool-result-sanitize.ts";
|
|
8
8
|
import { showMoreHintText } from "../show-more-hint.ts";
|
|
9
|
-
import { splitWriteContentLines } from "./diff-text.ts";
|
|
10
9
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
createDiffRenderCache,
|
|
11
|
+
type DiffRenderOptions,
|
|
12
|
+
type DisplayConfigInput,
|
|
13
|
+
displayConfigCacheKey,
|
|
14
|
+
RICH_DIFF_COMPONENT,
|
|
15
|
+
resolveDiffIndicatorMode,
|
|
16
|
+
resolveLiveDisplayConfig,
|
|
17
|
+
} from "./diff-component.ts";
|
|
18
|
+
import {
|
|
19
|
+
renderDiffFrameLine,
|
|
20
|
+
renderSingleDiffRow,
|
|
21
|
+
renderWriteHeader,
|
|
22
|
+
} from "./diff-header.ts";
|
|
23
|
+
import {
|
|
24
|
+
type CodeLineHighlighter,
|
|
25
|
+
createCodeLineHighlighter,
|
|
26
|
+
resolveLanguageFromPath,
|
|
27
|
+
} from "./diff-highlight.ts";
|
|
17
28
|
import {
|
|
18
29
|
buildInlineHighlightMap,
|
|
19
30
|
buildSplitRows,
|
|
20
31
|
type DiffSpan,
|
|
21
32
|
type SplitDiffRow,
|
|
22
33
|
} from "./diff-inline.ts";
|
|
23
|
-
import { resolveDiffPalette, type DiffTheme } from "./diff-palette.ts";
|
|
24
|
-
import {
|
|
25
|
-
createCodeLineHighlighter,
|
|
26
|
-
resolveLanguageFromPath,
|
|
27
|
-
type CodeLineHighlighter,
|
|
28
|
-
} from "./diff-highlight.ts";
|
|
29
34
|
import {
|
|
30
35
|
canRenderSplitLayout,
|
|
36
|
+
type DiffRenderContext,
|
|
37
|
+
type RenderedRow,
|
|
31
38
|
renderCompact,
|
|
32
39
|
renderSplit,
|
|
33
40
|
renderUnified,
|
|
34
|
-
type DiffRenderContext,
|
|
35
|
-
type RenderedRow,
|
|
36
41
|
} from "./diff-layout.ts";
|
|
37
|
-
import {
|
|
38
|
-
renderDiffFrameLine,
|
|
39
|
-
renderSingleDiffRow,
|
|
40
|
-
renderWriteHeader,
|
|
41
|
-
} from "./diff-header.ts";
|
|
42
42
|
import {
|
|
43
43
|
applyLineLimit,
|
|
44
|
-
clampDiffLineToWidth,
|
|
45
44
|
clampDiffLinesToWidth,
|
|
45
|
+
clampDiffLineToWidth,
|
|
46
46
|
resolveDiffDisplayLimit,
|
|
47
47
|
resolveDiffProcessBudget,
|
|
48
48
|
resolveWriteCollapsedLimit,
|
|
49
49
|
takeEntriesForLineBudget,
|
|
50
50
|
takeSplitRowsForBudget,
|
|
51
51
|
} from "./diff-limits.ts";
|
|
52
|
+
import { type DiffTheme, resolveDiffPalette } from "./diff-palette.ts";
|
|
52
53
|
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
type DisplayConfigInput,
|
|
60
|
-
} from "./diff-component.ts";
|
|
54
|
+
collectDiffStats,
|
|
55
|
+
type DiffLineEntry,
|
|
56
|
+
type DiffStats,
|
|
57
|
+
getLineNumberWidth,
|
|
58
|
+
type ParsedDiffEntry,
|
|
59
|
+
} from "./diff-parse.ts";
|
|
61
60
|
import {
|
|
62
61
|
buildDiffSummaryText,
|
|
62
|
+
type DiffPresentationMode,
|
|
63
63
|
normalizeDiffRenderWidth,
|
|
64
64
|
resolveDiffPresentationMode,
|
|
65
|
-
type DiffPresentationMode,
|
|
66
65
|
} from "./diff-presentation.ts";
|
|
66
|
+
import { splitWriteContentLines } from "./diff-text.ts";
|
|
67
67
|
|
|
68
68
|
type WriteDiffOperationKind = "context" | "remove" | "add";
|
|
69
69
|
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
type ExtensionAPI,
|
|
4
4
|
} from "@earendil-works/pi-coding-agent";
|
|
5
5
|
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
6
|
+
import { DEFAULT_TOOL_DISPLAY_CONFIG } from "../../../../../app/config/renderer.ts";
|
|
6
7
|
import {
|
|
8
|
+
type DisplayConfigInput,
|
|
7
9
|
renderEditDiffResult,
|
|
8
10
|
renderWriteDiffResult,
|
|
9
|
-
type DisplayConfigInput,
|
|
10
11
|
} from "./diff-renderer.ts";
|
|
11
|
-
import { DEFAULT_TOOL_DISPLAY_CONFIG } from "../../../../../app/config/renderer.ts";
|
|
12
12
|
import {
|
|
13
13
|
executeWriteWithMetadata,
|
|
14
14
|
WriteExecutionMetadataStore,
|
|
@@ -139,9 +139,9 @@ export function installWriteOverride(
|
|
|
139
139
|
|
|
140
140
|
export {
|
|
141
141
|
DEFAULT_TOOL_DISPLAY_CONFIG,
|
|
142
|
-
type ToolDisplayConfig,
|
|
143
|
-
type DiffViewMode,
|
|
144
142
|
type DiffIndicatorMode,
|
|
143
|
+
type DiffViewMode,
|
|
144
|
+
type ToolDisplayConfig,
|
|
145
145
|
} from "../../../../../app/config/renderer.ts";
|
|
146
146
|
export type { DisplayConfigInput } from "./diff-renderer.ts";
|
|
147
147
|
export { WriteExecutionMetadataStore } from "./write-execution.ts";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { showMoreHintText } from "../show-more-hint.ts";
|
|
1
2
|
import { normalizeDiffRenderWidth } from "./diff-presentation.ts";
|
|
2
3
|
import { pluralize } from "./diff-text.ts";
|
|
3
|
-
import { showMoreHintText } from "../show-more-hint.ts";
|
|
4
4
|
|
|
5
5
|
export interface WidthMeasurementOps {
|
|
6
6
|
measure(text: string): number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { withFileMutationQueue } from "@earendil-works/pi-coding-agent";
|
|
2
1
|
import { lstat, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
2
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
3
|
+
import { withFileMutationQueue } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
|
|
5
5
|
export const MAX_COMPARABLE_WRITE_BYTES = 512_000;
|
|
6
6
|
export const MAX_WRITE_METADATA_ENTRIES = 100;
|
|
@@ -3,38 +3,38 @@ import {
|
|
|
3
3
|
ToolExecutionComponent,
|
|
4
4
|
} from "@earendil-works/pi-coding-agent";
|
|
5
5
|
import {
|
|
6
|
+
type Component,
|
|
6
7
|
Container,
|
|
7
8
|
Spacer,
|
|
8
9
|
truncateToWidth,
|
|
9
10
|
visibleWidth,
|
|
10
|
-
type Component,
|
|
11
11
|
} from "@earendil-works/pi-tui";
|
|
12
|
-
import { toolLoadingIcon } from "../../../../tools/tool-loading-icon.ts";
|
|
13
|
-
import { isToolTuiFullscreen, showMoreHintText } from "./show-more-hint.ts";
|
|
14
12
|
import {
|
|
15
13
|
stripAnsi,
|
|
16
14
|
stripBackgroundAnsi,
|
|
17
15
|
stripLeadingStatusIcon,
|
|
18
16
|
} from "../../../../tools/ansi-text.ts";
|
|
19
17
|
import { walkComponentTree } from "../../../../tools/component-tree.ts";
|
|
18
|
+
import {
|
|
19
|
+
TOOL_GROUPING_GENERATION_KEY as GENERATION_KEY,
|
|
20
|
+
TOOL_GROUPING_PARENT_KEY as PARENT_KEY,
|
|
21
|
+
TOOL_GROUPING_PATCH_KEY as PATCH_KEY,
|
|
22
|
+
patchRegistry,
|
|
23
|
+
} from "../../../../tools/patch-keys.ts";
|
|
24
|
+
import { toolLoadingIcon } from "../../../../tools/tool-loading-icon.ts";
|
|
20
25
|
import { humanizeToolLabel, toolCallSummary } from "./names.ts";
|
|
21
26
|
import {
|
|
27
|
+
type CapturedIoViewMarker,
|
|
22
28
|
captureIoViewMarkers,
|
|
29
|
+
type ExpandedToolIoView,
|
|
23
30
|
getActiveIoViewFrame,
|
|
24
31
|
isExpandedToolIoView,
|
|
25
32
|
replayIoViewMarkers,
|
|
26
|
-
type CapturedIoViewMarker,
|
|
27
|
-
type ExpandedToolIoView,
|
|
28
33
|
type ToolIoSection,
|
|
29
34
|
} from "./result.ts";
|
|
30
|
-
import {
|
|
31
|
-
patchRegistry,
|
|
32
|
-
TOOL_GROUPING_GENERATION_KEY as GENERATION_KEY,
|
|
33
|
-
TOOL_GROUPING_PARENT_KEY as PARENT_KEY,
|
|
34
|
-
TOOL_GROUPING_PATCH_KEY as PATCH_KEY,
|
|
35
|
-
} from "../../../../tools/patch-keys.ts";
|
|
35
|
+
import { isToolTuiFullscreen, showMoreHintText } from "./show-more-hint.ts";
|
|
36
36
|
|
|
37
|
-
const NON_GROUPABLE = new Set(["edit", "write", "apply_patch"]);
|
|
37
|
+
const NON_GROUPABLE = new Set(["edit", "write", "apply_patch", "subagent"]);
|
|
38
38
|
|
|
39
39
|
type Patch = {
|
|
40
40
|
owner: object;
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
SkillInvocationMessageComponent,
|
|
5
5
|
} from "@earendil-works/pi-coding-agent";
|
|
6
6
|
import { Markdown, Spacer, Text } from "@earendil-works/pi-tui";
|
|
7
|
+
import { config } from "../../../../app/config/renderer.ts";
|
|
8
|
+
import { walkComponentTree } from "../../../../tools/component-tree.ts";
|
|
7
9
|
import {
|
|
8
10
|
MESSAGE_DISPLAY_PATCH,
|
|
9
11
|
patchRegistry,
|
|
10
12
|
} from "../../../../tools/patch-keys.ts";
|
|
11
|
-
import { config } from "../../../../app/config/renderer.ts";
|
|
12
13
|
import { showMoreHintText } from "./show-more-hint.ts";
|
|
13
|
-
import { walkComponentTree } from "../../../../tools/component-tree.ts";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* 接管三个消息组件(`<skill>` 块、压缩摘要、分支摘要),ccstyle on 时渲染为
|