erosolar-cli 1.7.116 → 1.7.118

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.
@@ -1,93 +1,171 @@
1
1
  /**
2
- * EnhancedPinnedChatBox - Modified version of PinnedChatBox with persistent visibility during streaming
3
- * and enhanced paste handling
2
+ * Enhanced Pinned Chat Box - Persistent chat input during AI streaming
3
+ *
4
+ * Enhanced features:
5
+ * - Always visible at bottom during AI streaming
6
+ * - Supports typing while AI is streaming responses
7
+ * - Gracefully handles long pastes without errors
8
+ * - Only submits to AI when user hits enter key
9
+ * - Integrates with existing multiline paste handler
10
+ * - Shows paste summaries for large content
11
+ * - Input history navigation with up/down arrows
12
+ * - Visual feedback during streaming
4
13
  */
5
- export interface QueuedCommand {
6
- id: string;
7
- text: string;
8
- type: 'request' | 'continuous' | 'slash';
9
- timestamp: number;
10
- preview: string;
14
+ export interface EnhancedChatBoxConfig {
15
+ /** Whether chat box is enabled */
16
+ enabled: boolean;
17
+ /** Position from bottom (lines) */
18
+ position: number;
19
+ /** Maximum lines for chat box display */
20
+ maxLines: number;
21
+ /** Whether to show paste summaries */
22
+ showPasteSummaries: boolean;
23
+ /** Whether to auto-scroll during streaming */
24
+ autoScroll: boolean;
25
+ /** Maximum input length */
26
+ maxInputLength: number;
27
+ /** Maximum history size */
28
+ maxHistorySize: number;
11
29
  }
12
- export interface PinnedChatBoxState {
13
- isProcessing: boolean;
14
- queuedCommands: QueuedCommand[];
15
- currentInput: string;
16
- contextUsage: number;
30
+ export interface EnhancedChatBoxState {
31
+ /** Current input text */
32
+ input: string;
33
+ /** Whether AI is currently streaming */
34
+ isStreaming: boolean;
35
+ /** Whether user is currently typing */
36
+ isTyping: boolean;
37
+ /** Whether paste mode is active */
38
+ isPasteMode: boolean;
39
+ /** Cursor position */
40
+ cursorPosition: number;
41
+ /** History of inputs */
42
+ history: string[];
43
+ /** Current history index */
44
+ historyIndex: number;
45
+ /** Status message */
17
46
  statusMessage: string | null;
18
- isVisible: boolean;
47
+ /** Whether processing is active */
48
+ isProcessing: boolean;
19
49
  }
50
+ export type EnhancedChatBoxSubmitCallback = (input: string) => void;
51
+ export type EnhancedChatBoxCancelCallback = () => void;
20
52
  export declare class EnhancedPinnedChatBox {
21
53
  private writeStream;
54
+ private config;
22
55
  private state;
23
- private reservedLines;
24
- private _lastRenderedHeight;
56
+ private onSubmit;
57
+ private onCancel;
58
+ private isActive;
25
59
  private inputBuffer;
26
60
  private cursorPosition;
27
- private commandIdCounter;
28
- private onCommandQueued?;
29
- private onInputSubmit?;
61
+ private history;
62
+ private historyIndex;
63
+ private tempCurrentInput;
64
+ private isPasteMode;
65
+ private pasteBuffer;
30
66
  private renderScheduled;
31
- private isEnabled;
32
- private isDisposed;
33
67
  private lastRenderTime;
34
68
  private renderThrottleMs;
35
- private maxInputLength;
36
- private maxQueueSize;
37
- private readonly ansiPattern;
38
- private readonly oscPattern;
39
- private readonly maxStatusMessageLength;
40
- private scrollRegionActive;
41
- private inputHistory;
42
- private historyIndex;
43
- private tempCurrentInput;
44
- private readonly maxHistorySize;
45
- private isPastedBlock;
46
- private pastedFullContent;
47
- private pasteStartTime;
48
- private pasteLineCount;
49
- private readonly maxPasteLines;
50
- private outputInterceptorCleanup?;
51
- constructor(writeStream: NodeJS.WriteStream, _promptText?: string, options?: {
52
- onCommandQueued?: (cmd: QueuedCommand) => void;
53
- onInputSubmit?: (input: string) => void;
54
- maxInputLength?: number;
55
- maxQueueSize?: number;
56
- });
69
+ constructor(writeStream: NodeJS.WriteStream, onSubmit: EnhancedChatBoxSubmitCallback, onCancel: EnhancedChatBoxCancelCallback, config?: Partial<EnhancedChatBoxConfig>);
70
+ /**
71
+ * Handle character input
72
+ */
73
+ handleInput(char: string): void;
74
+ /**
75
+ * Handle normal character input
76
+ */
77
+ private handleNormalInput;
78
+ /**
79
+ * Handle paste input
80
+ */
81
+ private handlePaste;
57
82
  /**
58
- * Enhanced paste detection with summarization
83
+ * Submit current input
59
84
  */
60
- handlePaste(content: string): void;
85
+ submit(): void;
61
86
  /**
62
- * Clear paste state
87
+ * Cancel current input or paste
63
88
  */
64
- private clearPastedBlock;
89
+ cancel(): void;
65
90
  /**
66
- * Handle character input with paste detection
91
+ * Handle history navigation - up
67
92
  */
68
- handleCharacter(char: string): void;
93
+ navigateHistoryUp(): void;
69
94
  /**
70
- * Handle Enter key - only submit when explicitly pressed
95
+ * Handle history navigation - down
71
96
  */
72
- handleEnter(): string | null;
97
+ navigateHistoryDown(): void;
73
98
  /**
74
- * Enhanced render that always shows during processing
99
+ * Set input text
75
100
  */
76
- render(): void;
101
+ setInput(text: string, cursorPos?: number): void;
77
102
  /**
78
- * Render persistent input during processing
103
+ * Clear input
104
+ */
105
+ clearInput(): void;
106
+ /**
107
+ * Clear paste mode
108
+ */
109
+ private clearPasteMode;
110
+ /**
111
+ * Add input to history
79
112
  */
80
- renderPersistentInput(): void;
81
- private supportsRendering;
82
- private safeWrite;
83
- private sanitizeCommandText;
84
- private sanitizeStatusMessage;
85
113
  private addToHistory;
86
- setEnabled(enabled: boolean): void;
87
- setProcessing(isProcessing: boolean): void;
88
- setContextUsage(percentage: number): void;
114
+ /**
115
+ * Set status message
116
+ */
89
117
  setStatusMessage(message: string | null): void;
90
- queueCommand(text: string, type?: 'request' | 'continuous' | 'slash'): QueuedCommand | null;
91
- clearQueue(): void;
118
+ /**
119
+ * Clear status message
120
+ */
121
+ clearStatusMessage(): void;
122
+ /**
123
+ * Update internal state
124
+ */
125
+ private updateState;
126
+ /**
127
+ * Set streaming state
128
+ */
129
+ setStreaming(isStreaming: boolean): void;
130
+ /**
131
+ * Set processing state
132
+ */
133
+ setProcessing(isProcessing: boolean): void;
134
+ /**
135
+ * Activate the chat box
136
+ */
137
+ activate(): void;
138
+ /**
139
+ * Deactivate the chat box
140
+ */
141
+ deactivate(): void;
142
+ /**
143
+ * Schedule render (throttled)
144
+ */
145
+ private scheduleRender;
146
+ /**
147
+ * Force immediate render
148
+ */
149
+ forceRender(): void;
150
+ /**
151
+ * Render the chat box
152
+ */
153
+ private render;
154
+ /**
155
+ * Get current state
156
+ */
157
+ getState(): EnhancedChatBoxState;
158
+ /**
159
+ * Get config
160
+ */
161
+ getConfig(): EnhancedChatBoxConfig;
162
+ /**
163
+ * Update config
164
+ */
165
+ updateConfig(config: Partial<EnhancedChatBoxConfig>): void;
166
+ /**
167
+ * Dispose of resources
168
+ */
169
+ dispose(): void;
92
170
  }
93
- //# sourceMappingURL=enhancedPinnedChatBox.d.ts.map
171
+ //# sourceMappingURL=EnhancedPinnedChatBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enhancedPinnedChatBox.d.ts","sourceRoot":"","sources":["../../src/ui/enhancedPinnedChatBox.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,eAAe,CAAC,CAA+B;IACvD,OAAO,CAAC,aAAa,CAAC,C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