pi-one-ui 0.2.2 → 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.
Files changed (61) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.en.md +256 -0
  3. package/README.md +26 -25
  4. package/extensions/app/commands/settings-previews.ts +3 -3
  5. package/extensions/app/config/renderer.ts +12 -23
  6. package/extensions/app/config/shell.ts +122 -426
  7. package/extensions/app/config/store.ts +23 -92
  8. package/extensions/app/overlay/selector-border.ts +5 -5
  9. package/extensions/app/ownership.ts +1 -1
  10. package/extensions/app/panel.ts +18 -19
  11. package/extensions/app/presets.ts +1 -2
  12. package/extensions/app/runtime/tui-runtime.ts +31 -31
  13. package/extensions/features/context-inspector/index.ts +3 -3
  14. package/extensions/features/session-reference/index.ts +5 -5
  15. package/extensions/features/subagent-autocomplete.ts +1 -1
  16. package/extensions/layouts/context/index.ts +9 -12
  17. package/extensions/layouts/context/renderer/compact-mode.ts +24 -24
  18. package/extensions/layouts/context/renderer/default-mode.ts +21 -16
  19. package/extensions/layouts/context/renderer/index.ts +24 -24
  20. package/extensions/layouts/context/renderer/mouse/hover.ts +6 -6
  21. package/extensions/layouts/context/renderer/mouse/interaction.ts +35 -35
  22. package/extensions/layouts/context/renderer/mouse/packets.ts +3 -2
  23. package/extensions/layouts/context/renderer/mouse/scroll.ts +2 -2
  24. package/extensions/layouts/context/renderer/tool/diff/diff-component.ts +2 -1
  25. package/extensions/layouts/context/renderer/tool/diff/diff-edit-render.ts +21 -21
  26. package/extensions/layouts/context/renderer/tool/diff/diff-header.ts +4 -4
  27. package/extensions/layouts/context/renderer/tool/diff/diff-highlight.ts +6 -6
  28. package/extensions/layouts/context/renderer/tool/diff/diff-inline.ts +1 -1
  29. package/extensions/layouts/context/renderer/tool/diff/diff-layout.ts +18 -18
  30. package/extensions/layouts/context/renderer/tool/diff/diff-limits.ts +5 -5
  31. package/extensions/layouts/context/renderer/tool/diff/diff-palette.ts +3 -3
  32. package/extensions/layouts/context/renderer/tool/diff/diff-presentation.ts +1 -1
  33. package/extensions/layouts/context/renderer/tool/diff/diff-renderer.ts +2 -1
  34. package/extensions/layouts/context/renderer/tool/diff/diff-write-render.ts +31 -31
  35. package/extensions/layouts/context/renderer/tool/diff/index.ts +4 -4
  36. package/extensions/layouts/context/renderer/tool/diff/line-width-safety.ts +1 -1
  37. package/extensions/layouts/context/renderer/tool/diff/write-execution.ts +1 -1
  38. package/extensions/layouts/context/renderer/tool/grouping.ts +12 -12
  39. package/extensions/layouts/context/renderer/tool/message-display.ts +2 -2
  40. package/extensions/layouts/context/renderer/tool/result.ts +199 -19
  41. package/extensions/layouts/context/summary/core.ts +1 -0
  42. package/extensions/layouts/context/summary/index.ts +3 -3
  43. package/extensions/layouts/context/thinking/compact-thinking.ts +12 -13
  44. package/extensions/layouts/editor/accent-rail-editor.ts +5 -5
  45. package/extensions/layouts/editor/controller.ts +4 -4
  46. package/extensions/layouts/editor/editor-metadata-format.ts +4 -4
  47. package/extensions/layouts/editor/factory.ts +3 -3
  48. package/extensions/layouts/editor/index.ts +7 -7
  49. package/extensions/layouts/editor/minimalist-editor.ts +1 -1
  50. package/extensions/layouts/editor/ui.ts +7 -7
  51. package/extensions/layouts/footer/controller.ts +3 -3
  52. package/extensions/layouts/footer/footer.ts +21 -21
  53. package/extensions/layouts/footer/index.ts +8 -8
  54. package/extensions/layouts/header/index.ts +1 -1
  55. package/extensions/layouts/header/startup-header.ts +3 -2
  56. package/extensions/layouts/working-line/controller.ts +6 -6
  57. package/extensions/services/project-refresh.ts +2 -2
  58. package/extensions/services/session-state.ts +1 -1
  59. package/extensions/shared/format.ts +2 -2
  60. package/package.json +17 -10
  61. package/extensions/features/legacy/working-message.ts +0 -226
@@ -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
- installToolGrouping,
5
- type ToolGroupingHooks,
6
- } from "./tool/grouping.ts";
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 { isLazyProxyTui } from "../../../tools/fullscreen-detect.ts";
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 { ToolGroupComponent } from "../tool/grouping.ts";
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 { ThinkingPreviewBlock } from "../../thinking/compact-thinking.ts";
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 { ToolGroupComponent } from "../tool/grouping.ts";
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
- getLineNumberWidth,
6
- parseDiff,
7
- type ParsedDiff,
8
- } from "./diff-parse.ts";
9
- import { buildInlineHighlightMap, buildSplitRows } from "./diff-inline.ts";
10
- import { resolveDiffPalette, type DiffTheme } from "./diff-palette.ts";
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
- RICH_DIFF_COMPONENT,
37
- createDiffRenderCache,
38
- displayConfigCacheKey,
39
- resolveDiffIndicatorMode,
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 { normalizeCodeWhitespace, wrapToWidth } from "./diff-text.ts";
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 type { RenderedRow } from "./diff-layout.ts";
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 { MAX_HL_CHARS, shikiHighlightCache } from "./shiki-highlight.ts";
8
- import { normalizeCodeWhitespace } from "./diff-text.ts";
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 type { DiffSpan } from "./diff-inline.ts";
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
- fitToWidth,
4
- normalizeCodeWhitespace,
5
- wrapToWidth,
6
- } from "./diff-text.ts";
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
- getCellLineNumber,
30
- type DiffSpan,
31
- type SplitDiffRow,
32
- } from "./diff-inline.ts";
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 { ansi256ToRgb } from "../../../../../tools/ansi-color.ts";
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
- export { shouldHighlightCodeBlock } from "./diff-highlight.ts";
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
- collectDiffStats,
12
- getLineNumberWidth,
13
- type DiffLineEntry,
14
- type DiffStats,
15
- type ParsedDiffEntry,
16
- } from "./diff-parse.ts";
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
- RICH_DIFF_COMPONENT,
54
- createDiffRenderCache,
55
- displayConfigCacheKey,
56
- resolveDiffIndicatorMode,
57
- resolveLiveDisplayConfig,
58
- type DiffRenderOptions,
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;