lonny-agent 0.1.2 → 0.1.9
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/.kilo/plans/1780064105789-mighty-pixel.md +171 -0
- package/.lonny/fix-new-command-session-cleanup.md +65 -0
- package/.lonny/tui-autocomplete-above.md +62 -0
- package/dist/agent/__tests__/compaction.test.js +6 -4
- package/dist/agent/__tests__/compaction.test.js.map +1 -1
- package/dist/agent/llm.d.ts +1 -1
- package/dist/agent/llm.d.ts.map +1 -1
- package/dist/agent/prompt-builder.d.ts.map +1 -1
- package/dist/agent/prompt-builder.js +26 -8
- package/dist/agent/prompt-builder.js.map +1 -1
- package/dist/agent/providers/anthropic.d.ts +1 -1
- package/dist/agent/providers/anthropic.d.ts.map +1 -1
- package/dist/agent/providers/anthropic.js +2 -2
- package/dist/agent/providers/anthropic.js.map +1 -1
- package/dist/agent/providers/google.d.ts +1 -1
- package/dist/agent/providers/google.d.ts.map +1 -1
- package/dist/agent/providers/google.js +2 -1
- package/dist/agent/providers/google.js.map +1 -1
- package/dist/agent/providers/ollama.d.ts +1 -1
- package/dist/agent/providers/ollama.d.ts.map +1 -1
- package/dist/agent/providers/ollama.js +2 -1
- package/dist/agent/providers/ollama.js.map +1 -1
- package/dist/agent/providers/openai.d.ts +1 -1
- package/dist/agent/providers/openai.d.ts.map +1 -1
- package/dist/agent/providers/openai.js +2 -2
- package/dist/agent/providers/openai.js.map +1 -1
- package/dist/agent/session.d.ts +1 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +8 -2
- package/dist/agent/session.js.map +1 -1
- package/dist/pi-tui/autocomplete.d.ts +54 -0
- package/dist/pi-tui/autocomplete.d.ts.map +1 -0
- package/dist/pi-tui/autocomplete.js +636 -0
- package/dist/pi-tui/autocomplete.js.map +1 -0
- package/dist/pi-tui/components/box.d.ts +22 -0
- package/dist/pi-tui/components/box.d.ts.map +1 -0
- package/dist/pi-tui/components/box.js +104 -0
- package/dist/pi-tui/components/box.js.map +1 -0
- package/dist/pi-tui/components/cancellable-loader.d.ts +22 -0
- package/dist/pi-tui/components/cancellable-loader.d.ts.map +1 -0
- package/dist/pi-tui/components/cancellable-loader.js +35 -0
- package/dist/pi-tui/components/cancellable-loader.js.map +1 -0
- package/dist/pi-tui/components/editor.d.ts +249 -0
- package/dist/pi-tui/components/editor.d.ts.map +1 -0
- package/dist/pi-tui/components/editor.js +1883 -0
- package/dist/pi-tui/components/editor.js.map +1 -0
- package/dist/pi-tui/components/image.d.ts +28 -0
- package/dist/pi-tui/components/image.d.ts.map +1 -0
- package/dist/pi-tui/components/image.js +90 -0
- package/dist/pi-tui/components/image.js.map +1 -0
- package/dist/pi-tui/components/input.d.ts +37 -0
- package/dist/pi-tui/components/input.d.ts.map +1 -0
- package/dist/pi-tui/components/input.js +382 -0
- package/dist/pi-tui/components/input.js.map +1 -0
- package/dist/pi-tui/components/loader.d.ts +31 -0
- package/dist/pi-tui/components/loader.d.ts.map +1 -0
- package/dist/pi-tui/components/loader.js +70 -0
- package/dist/pi-tui/components/loader.js.map +1 -0
- package/dist/pi-tui/components/markdown.d.ts +96 -0
- package/dist/pi-tui/components/markdown.d.ts.map +1 -0
- package/dist/pi-tui/components/markdown.js +647 -0
- package/dist/pi-tui/components/markdown.js.map +1 -0
- package/dist/pi-tui/components/select-list.d.ts +50 -0
- package/dist/pi-tui/components/select-list.d.ts.map +1 -0
- package/dist/pi-tui/components/select-list.js +167 -0
- package/dist/pi-tui/components/select-list.js.map +1 -0
- package/dist/pi-tui/components/settings-list.d.ts +50 -0
- package/dist/pi-tui/components/settings-list.d.ts.map +1 -0
- package/dist/pi-tui/components/settings-list.js +189 -0
- package/dist/pi-tui/components/settings-list.js.map +1 -0
- package/dist/pi-tui/components/spacer.d.ts +12 -0
- package/dist/pi-tui/components/spacer.d.ts.map +1 -0
- package/dist/pi-tui/components/spacer.js +23 -0
- package/dist/pi-tui/components/spacer.js.map +1 -0
- package/dist/pi-tui/components/text.d.ts +19 -0
- package/dist/pi-tui/components/text.d.ts.map +1 -0
- package/dist/pi-tui/components/text.js +91 -0
- package/dist/pi-tui/components/text.js.map +1 -0
- package/dist/pi-tui/components/truncated-text.d.ts +13 -0
- package/dist/pi-tui/components/truncated-text.d.ts.map +1 -0
- package/dist/pi-tui/components/truncated-text.js +51 -0
- package/dist/pi-tui/components/truncated-text.js.map +1 -0
- package/dist/pi-tui/editor-component.d.ts +39 -0
- package/dist/pi-tui/editor-component.d.ts.map +1 -0
- package/dist/pi-tui/editor-component.js +2 -0
- package/dist/pi-tui/editor-component.js.map +1 -0
- package/dist/pi-tui/fuzzy.d.ts +16 -0
- package/dist/pi-tui/fuzzy.d.ts.map +1 -0
- package/dist/pi-tui/fuzzy.js +110 -0
- package/dist/pi-tui/fuzzy.js.map +1 -0
- package/dist/pi-tui/index.d.ts +23 -0
- package/dist/pi-tui/index.d.ts.map +1 -0
- package/dist/pi-tui/index.js +32 -0
- package/dist/pi-tui/index.js.map +1 -0
- package/dist/pi-tui/keybindings.d.ts +193 -0
- package/dist/pi-tui/keybindings.d.ts.map +1 -0
- package/dist/pi-tui/keybindings.js +174 -0
- package/dist/pi-tui/keybindings.js.map +1 -0
- package/dist/pi-tui/keys.d.ts +184 -0
- package/dist/pi-tui/keys.d.ts.map +1 -0
- package/dist/pi-tui/keys.js +1182 -0
- package/dist/pi-tui/keys.js.map +1 -0
- package/dist/pi-tui/kill-ring.d.ts +28 -0
- package/dist/pi-tui/kill-ring.d.ts.map +1 -0
- package/dist/pi-tui/kill-ring.js +44 -0
- package/dist/pi-tui/kill-ring.js.map +1 -0
- package/dist/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/dist/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/dist/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/dist/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/dist/pi-tui/native-modifiers.d.ts +3 -0
- package/dist/pi-tui/native-modifiers.d.ts.map +1 -0
- package/dist/pi-tui/native-modifiers.js +53 -0
- package/dist/pi-tui/native-modifiers.js.map +1 -0
- package/dist/pi-tui/stdin-buffer.d.ts +50 -0
- package/dist/pi-tui/stdin-buffer.d.ts.map +1 -0
- package/dist/pi-tui/stdin-buffer.js +361 -0
- package/dist/pi-tui/stdin-buffer.js.map +1 -0
- package/dist/pi-tui/terminal-image.d.ts +90 -0
- package/dist/pi-tui/terminal-image.d.ts.map +1 -0
- package/dist/pi-tui/terminal-image.js +343 -0
- package/dist/pi-tui/terminal-image.js.map +1 -0
- package/dist/pi-tui/terminal.d.ts +113 -0
- package/dist/pi-tui/terminal.d.ts.map +1 -0
- package/dist/pi-tui/terminal.js +478 -0
- package/dist/pi-tui/terminal.js.map +1 -0
- package/dist/pi-tui/tui.d.ts +227 -0
- package/dist/pi-tui/tui.d.ts.map +1 -0
- package/dist/pi-tui/tui.js +1091 -0
- package/dist/pi-tui/tui.js.map +1 -0
- package/dist/pi-tui/undo-stack.d.ts +17 -0
- package/dist/pi-tui/undo-stack.d.ts.map +1 -0
- package/dist/pi-tui/undo-stack.js +25 -0
- package/dist/pi-tui/undo-stack.js.map +1 -0
- package/dist/pi-tui/utils.d.ts +84 -0
- package/dist/pi-tui/utils.d.ts.map +1 -0
- package/dist/pi-tui/utils.js +1024 -0
- package/dist/pi-tui/utils.js.map +1 -0
- package/dist/pi-tui/word-navigation.d.ts +25 -0
- package/dist/pi-tui/word-navigation.d.ts.map +1 -0
- package/dist/pi-tui/word-navigation.js +98 -0
- package/dist/pi-tui/word-navigation.js.map +1 -0
- package/dist/tools/__tests__/edit.test.js +85 -0
- package/dist/tools/__tests__/edit.test.js.map +1 -1
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +23 -1
- package/dist/tools/edit.js.map +1 -1
- package/dist/tui/components.d.ts +1 -1
- package/dist/tui/components.d.ts.map +1 -1
- package/dist/tui/components.js +1 -1
- package/dist/tui/components.js.map +1 -1
- package/dist/tui/editor-patch.d.ts +13 -0
- package/dist/tui/editor-patch.d.ts.map +1 -0
- package/dist/tui/editor-patch.js +41 -0
- package/dist/tui/editor-patch.js.map +1 -0
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +15 -3
- package/dist/tui/index.js.map +1 -1
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +9 -2
- package/dist/web/index.js.map +1 -1
- package/dist/web/public/app.js +65 -4
- package/dist/web/public/style.css +49 -0
- package/dist/web/session-bridge.d.ts +0 -4
- package/dist/web/session-bridge.d.ts.map +1 -1
- package/dist/web/session-bridge.js +16 -2
- package/dist/web/session-bridge.js.map +1 -1
- package/package.json +5 -3
- package/src/agent/__tests__/compaction.test.ts +6 -4
- package/src/agent/llm.ts +5 -1
- package/src/agent/prompt-builder.ts +27 -8
- package/src/agent/providers/anthropic.ts +15 -8
- package/src/agent/providers/google.ts +6 -1
- package/src/agent/providers/ollama.ts +6 -1
- package/src/agent/providers/openai.ts +21 -12
- package/src/agent/session.ts +12 -2
- package/src/pi-tui/autocomplete.ts +808 -0
- package/src/pi-tui/components/box.ts +137 -0
- package/src/pi-tui/components/cancellable-loader.ts +40 -0
- package/src/pi-tui/components/editor.ts +2321 -0
- package/src/pi-tui/components/image.ts +130 -0
- package/src/pi-tui/components/input.ts +456 -0
- package/src/pi-tui/components/loader.ts +93 -0
- package/src/pi-tui/components/markdown.ts +839 -0
- package/src/pi-tui/components/select-list.ts +263 -0
- package/src/pi-tui/components/settings-list.ts +264 -0
- package/src/pi-tui/components/spacer.ts +28 -0
- package/src/pi-tui/components/text.ts +113 -0
- package/src/pi-tui/components/truncated-text.ts +65 -0
- package/src/pi-tui/editor-component.ts +74 -0
- package/src/pi-tui/fuzzy.ts +137 -0
- package/src/pi-tui/index.ts +115 -0
- package/src/pi-tui/keybindings.ts +245 -0
- package/src/pi-tui/keys.ts +1440 -0
- package/src/pi-tui/kill-ring.ts +46 -0
- package/src/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/src/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/src/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/src/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/src/pi-tui/native-modifiers.ts +65 -0
- package/src/pi-tui/stdin-buffer.ts +434 -0
- package/src/pi-tui/terminal-image.ts +469 -0
- package/src/pi-tui/terminal.ts +594 -0
- package/src/pi-tui/tui.ts +1376 -0
- package/src/pi-tui/undo-stack.ts +28 -0
- package/src/pi-tui/utils.ts +1176 -0
- package/src/pi-tui/word-navigation.ts +127 -0
- package/src/tools/__tests__/edit.test.ts +91 -0
- package/src/tools/edit.ts +27 -1
- package/src/tui/components.ts +2 -2
- package/src/tui/index.ts +24 -10
- package/src/web/index.ts +9 -2
- package/src/web/public/app.js +65 -4
- package/src/web/public/style.css +49 -0
- package/src/web/session-bridge.ts +13 -2
- package/tsconfig.json +2 -2
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal TUI implementation with differential rendering
|
|
3
|
+
*/
|
|
4
|
+
import type { Terminal } from './terminal.js';
|
|
5
|
+
import { visibleWidth } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Component interface - all components must implement this
|
|
8
|
+
*/
|
|
9
|
+
export interface Component {
|
|
10
|
+
/**
|
|
11
|
+
* Render the component to lines for the given viewport width
|
|
12
|
+
* @param width - Current viewport width
|
|
13
|
+
* @returns Array of strings, each representing a line
|
|
14
|
+
*/
|
|
15
|
+
render(width: number): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Optional handler for keyboard input when component has focus
|
|
18
|
+
*/
|
|
19
|
+
handleInput?(data: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* If true, component receives key release events (Kitty protocol).
|
|
22
|
+
* Default is false - release events are filtered out.
|
|
23
|
+
*/
|
|
24
|
+
wantsKeyRelease?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Invalidate any cached rendering state.
|
|
27
|
+
* Called when theme changes or when component needs to re-render from scratch.
|
|
28
|
+
*/
|
|
29
|
+
invalidate(): void;
|
|
30
|
+
}
|
|
31
|
+
type InputListenerResult = {
|
|
32
|
+
consume?: boolean;
|
|
33
|
+
data?: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
type InputListener = (data: string) => InputListenerResult;
|
|
36
|
+
/**
|
|
37
|
+
* Interface for components that can receive focus and display a hardware cursor.
|
|
38
|
+
* When focused, the component should emit CURSOR_MARKER at the cursor position
|
|
39
|
+
* in its render output. TUI will find this marker and position the hardware
|
|
40
|
+
* cursor there for proper IME candidate window positioning.
|
|
41
|
+
*/
|
|
42
|
+
export interface Focusable {
|
|
43
|
+
/** Set by TUI when focus changes. Component should emit CURSOR_MARKER when true. */
|
|
44
|
+
focused: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** Type guard to check if a component implements Focusable */
|
|
47
|
+
export declare function isFocusable(component: Component | null): component is Component & Focusable;
|
|
48
|
+
/**
|
|
49
|
+
* Cursor position marker - APC (Application Program Command) sequence.
|
|
50
|
+
* This is a zero-width escape sequence that terminals ignore.
|
|
51
|
+
* Components emit this at the cursor position when focused.
|
|
52
|
+
* TUI finds and strips this marker, then positions the hardware cursor there.
|
|
53
|
+
*/
|
|
54
|
+
export declare const CURSOR_MARKER = "\u001B_pi:c\u0007";
|
|
55
|
+
export { visibleWidth };
|
|
56
|
+
/**
|
|
57
|
+
* Anchor position for overlays
|
|
58
|
+
*/
|
|
59
|
+
export type OverlayAnchor = 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center' | 'left-center' | 'right-center';
|
|
60
|
+
/**
|
|
61
|
+
* Margin configuration for overlays
|
|
62
|
+
*/
|
|
63
|
+
export interface OverlayMargin {
|
|
64
|
+
top?: number;
|
|
65
|
+
right?: number;
|
|
66
|
+
bottom?: number;
|
|
67
|
+
left?: number;
|
|
68
|
+
}
|
|
69
|
+
/** Value that can be absolute (number) or percentage (string like "50%") */
|
|
70
|
+
export type SizeValue = number | `${number}%`;
|
|
71
|
+
/**
|
|
72
|
+
* Options for overlay positioning and sizing.
|
|
73
|
+
* Values can be absolute numbers or percentage strings (e.g., "50%").
|
|
74
|
+
*/
|
|
75
|
+
export interface OverlayOptions {
|
|
76
|
+
/** Width in columns, or percentage of terminal width (e.g., "50%") */
|
|
77
|
+
width?: SizeValue;
|
|
78
|
+
/** Minimum width in columns */
|
|
79
|
+
minWidth?: number;
|
|
80
|
+
/** Maximum height in rows, or percentage of terminal height (e.g., "50%") */
|
|
81
|
+
maxHeight?: SizeValue;
|
|
82
|
+
/** Anchor point for positioning (default: 'center') */
|
|
83
|
+
anchor?: OverlayAnchor;
|
|
84
|
+
/** Horizontal offset from anchor position (positive = right) */
|
|
85
|
+
offsetX?: number;
|
|
86
|
+
/** Vertical offset from anchor position (positive = down) */
|
|
87
|
+
offsetY?: number;
|
|
88
|
+
/** Row position: absolute number, or percentage (e.g., "25%" = 25% from top) */
|
|
89
|
+
row?: SizeValue;
|
|
90
|
+
/** Column position: absolute number, or percentage (e.g., "50%" = centered horizontally) */
|
|
91
|
+
col?: SizeValue;
|
|
92
|
+
/** Margin from terminal edges. Number applies to all sides. */
|
|
93
|
+
margin?: OverlayMargin | number;
|
|
94
|
+
/**
|
|
95
|
+
* Control overlay visibility based on terminal dimensions.
|
|
96
|
+
* If provided, overlay is only rendered when this returns true.
|
|
97
|
+
* Called each render cycle with current terminal dimensions.
|
|
98
|
+
*/
|
|
99
|
+
visible?: (termWidth: number, termHeight: number) => boolean;
|
|
100
|
+
/** If true, don't capture keyboard focus when shown */
|
|
101
|
+
nonCapturing?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Handle returned by showOverlay for controlling the overlay
|
|
105
|
+
*/
|
|
106
|
+
export interface OverlayHandle {
|
|
107
|
+
/** Permanently remove the overlay (cannot be shown again) */
|
|
108
|
+
hide(): void;
|
|
109
|
+
/** Temporarily hide or show the overlay */
|
|
110
|
+
setHidden(hidden: boolean): void;
|
|
111
|
+
/** Check if overlay is temporarily hidden */
|
|
112
|
+
isHidden(): boolean;
|
|
113
|
+
/** Focus this overlay and bring it to the visual front */
|
|
114
|
+
focus(): void;
|
|
115
|
+
/** Release focus to the previous target */
|
|
116
|
+
unfocus(): void;
|
|
117
|
+
/** Check if this overlay currently has focus */
|
|
118
|
+
isFocused(): boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Container - a component that contains other components
|
|
122
|
+
*/
|
|
123
|
+
export declare class Container implements Component {
|
|
124
|
+
children: Component[];
|
|
125
|
+
addChild(component: Component): void;
|
|
126
|
+
removeChild(component: Component): void;
|
|
127
|
+
clear(): void;
|
|
128
|
+
invalidate(): void;
|
|
129
|
+
render(width: number): string[];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* TUI - Main class for managing terminal UI with differential rendering
|
|
133
|
+
*/
|
|
134
|
+
export declare class TUI extends Container {
|
|
135
|
+
terminal: Terminal;
|
|
136
|
+
private previousLines;
|
|
137
|
+
private previousKittyImageIds;
|
|
138
|
+
private previousWidth;
|
|
139
|
+
private previousHeight;
|
|
140
|
+
private focusedComponent;
|
|
141
|
+
private inputListeners;
|
|
142
|
+
/** Global callback for debug key (Shift+Ctrl+D). Called before input is forwarded to focused component. */
|
|
143
|
+
onDebug?: () => void;
|
|
144
|
+
private renderRequested;
|
|
145
|
+
private renderTimer;
|
|
146
|
+
private lastRenderAt;
|
|
147
|
+
private static readonly MIN_RENDER_INTERVAL_MS;
|
|
148
|
+
private cursorRow;
|
|
149
|
+
private hardwareCursorRow;
|
|
150
|
+
private showHardwareCursor;
|
|
151
|
+
private clearOnShrink;
|
|
152
|
+
private maxLinesRendered;
|
|
153
|
+
private previousViewportTop;
|
|
154
|
+
private fullRedrawCount;
|
|
155
|
+
private stopped;
|
|
156
|
+
private focusOrderCounter;
|
|
157
|
+
private overlayStack;
|
|
158
|
+
constructor(terminal: Terminal, showHardwareCursor?: boolean);
|
|
159
|
+
get fullRedraws(): number;
|
|
160
|
+
getShowHardwareCursor(): boolean;
|
|
161
|
+
setShowHardwareCursor(enabled: boolean): void;
|
|
162
|
+
getClearOnShrink(): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Set whether to trigger full re-render when content shrinks.
|
|
165
|
+
* When true (default), empty rows are cleared when content shrinks.
|
|
166
|
+
* When false, empty rows remain (reduces redraws on slower terminals).
|
|
167
|
+
*/
|
|
168
|
+
setClearOnShrink(enabled: boolean): void;
|
|
169
|
+
setFocus(component: Component | null): void;
|
|
170
|
+
/**
|
|
171
|
+
* Show an overlay component with configurable positioning and sizing.
|
|
172
|
+
* Returns a handle to control the overlay's visibility.
|
|
173
|
+
*/
|
|
174
|
+
showOverlay(component: Component, options?: OverlayOptions): OverlayHandle;
|
|
175
|
+
/** Hide the topmost overlay and restore previous focus. */
|
|
176
|
+
hideOverlay(): void;
|
|
177
|
+
/** Check if there are any visible overlays */
|
|
178
|
+
hasOverlay(): boolean;
|
|
179
|
+
/** Check if an overlay entry is currently visible */
|
|
180
|
+
private isOverlayVisible;
|
|
181
|
+
/** Find the topmost visible capturing overlay, if any */
|
|
182
|
+
private getTopmostVisibleOverlay;
|
|
183
|
+
invalidate(): void;
|
|
184
|
+
start(): void;
|
|
185
|
+
addInputListener(listener: InputListener): () => void;
|
|
186
|
+
removeInputListener(listener: InputListener): void;
|
|
187
|
+
private queryCellSize;
|
|
188
|
+
stop(): void;
|
|
189
|
+
requestRender(force?: boolean): void;
|
|
190
|
+
private scheduleRender;
|
|
191
|
+
private handleInput;
|
|
192
|
+
private consumeCellSizeResponse;
|
|
193
|
+
/**
|
|
194
|
+
* Resolve overlay layout from options.
|
|
195
|
+
* Returns { width, row, col, maxHeight } for rendering.
|
|
196
|
+
*/
|
|
197
|
+
private resolveOverlayLayout;
|
|
198
|
+
private resolveAnchorRow;
|
|
199
|
+
private resolveAnchorCol;
|
|
200
|
+
/** Composite all overlays into content lines (sorted by focusOrder, higher = on top). */
|
|
201
|
+
private compositeOverlays;
|
|
202
|
+
private static readonly SEGMENT_RESET;
|
|
203
|
+
private applyLineResets;
|
|
204
|
+
private collectKittyImageIds;
|
|
205
|
+
private deleteKittyImages;
|
|
206
|
+
private expandLastChangedForKittyImages;
|
|
207
|
+
private deleteChangedKittyImages;
|
|
208
|
+
/** Splice overlay content into a base line at a specific column. Single-pass optimized. */
|
|
209
|
+
private compositeLineAt;
|
|
210
|
+
/**
|
|
211
|
+
* Find and extract cursor position from rendered lines.
|
|
212
|
+
* Searches for CURSOR_MARKER, calculates its position, and strips it from the output.
|
|
213
|
+
* Only scans the bottom terminal height lines (visible viewport).
|
|
214
|
+
* @param lines - Rendered lines to search
|
|
215
|
+
* @param height - Terminal height (visible viewport size)
|
|
216
|
+
* @returns Cursor position { row, col } or null if no marker found
|
|
217
|
+
*/
|
|
218
|
+
private extractCursorPosition;
|
|
219
|
+
private doRender;
|
|
220
|
+
/**
|
|
221
|
+
* Position the hardware cursor for IME candidate window.
|
|
222
|
+
* @param cursorPos The cursor position extracted from rendered output, or null
|
|
223
|
+
* @param totalLines Total number of rendered lines
|
|
224
|
+
*/
|
|
225
|
+
private positionHardwareCursor;
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=tui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../../src/pi-tui/tui.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAO7C,OAAO,EAKL,YAAY,EACb,MAAM,YAAY,CAAA;AAwBnB;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAE/B;;OAEG;I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