erosolar-cli 1.7.118 → 1.7.119

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 (36) hide show
  1. package/dist/core/agent.js +4 -4
  2. package/dist/core/agent.js.map +1 -1
  3. package/dist/shell/systemPrompt.d.ts.map +1 -1
  4. package/dist/shell/systemPrompt.js +3 -4
  5. package/dist/shell/systemPrompt.js.map +1 -1
  6. package/dist/tools/editTools.d.ts.map +1 -1
  7. package/dist/tools/editTools.js +29 -6
  8. package/dist/tools/editTools.js.map +1 -1
  9. package/dist/tools/fileTools.d.ts.map +1 -1
  10. package/dist/tools/fileTools.js +2 -126
  11. package/dist/tools/fileTools.js.map +1 -1
  12. package/dist/ui/EnhancedPinnedChatBox.d.ts +2 -0
  13. package/dist/ui/EnhancedPinnedChatBox.d.ts.map +1 -0
  14. package/dist/ui/EnhancedPinnedChatBox.js +3 -0
  15. package/dist/ui/EnhancedPinnedChatBox.js.map +1 -0
  16. package/dist/ui/persistentPrompt.d.ts +27 -2
  17. package/dist/ui/persistentPrompt.d.ts.map +1 -1
  18. package/dist/ui/persistentPrompt.js +189 -70
  19. package/dist/ui/persistentPrompt.js.map +1 -1
  20. package/package.json +1 -1
  21. package/dist/shell/enhancedInteractiveShell.d.ts +0 -56
  22. package/dist/shell/enhancedInteractiveShell.d.ts.map +0 -1
  23. package/dist/shell/enhancedInteractiveShell.js +0 -110
  24. package/dist/shell/enhancedInteractiveShell.js.map +0 -1
  25. package/dist/shell/enhancedShellApp.d.ts +0 -25
  26. package/dist/shell/enhancedShellApp.d.ts.map +0 -1
  27. package/dist/shell/enhancedShellApp.js +0 -161
  28. package/dist/shell/enhancedShellApp.js.map +0 -1
  29. package/dist/ui/enhancedPinnedChatBox.d.ts +0 -171
  30. package/dist/ui/enhancedPinnedChatBox.d.ts.map +0 -1
  31. package/dist/ui/enhancedPinnedChatBox.js +0 -370
  32. package/dist/ui/enhancedPinnedChatBox.js.map +0 -1
  33. package/dist/ui/persistentChatBox.d.ts +0 -137
  34. package/dist/ui/persistentChatBox.d.ts.map +0 -1
  35. package/dist/ui/persistentChatBox.js +0 -298
  36. package/dist/ui/persistentChatBox.js.map +0 -1
@@ -1,110 +0,0 @@
1
- /**
2
- * Enhanced Interactive Shell with Persistent Chat Box
3
- *
4
- * Extends the base InteractiveShell with enhanced persistent chat box features:
5
- * - Always visible chat input during AI streaming
6
- * - Graceful paste handling with summaries
7
- * - Input history navigation
8
- * - Visual feedback during streaming
9
- */
10
- import { InteractiveShell } from './interactiveShell.js';
11
- import { EnhancedPinnedChatBox } from '../ui/EnhancedPinnedChatBox.js';
12
- import { display } from '../ui/display.js';
13
- export class EnhancedInteractiveShell extends InteractiveShell {
14
- enhancedChatBox;
15
- constructor(config) {
16
- super(config);
17
- // Replace the standard pinned chat box with enhanced version
18
- this.enhancedChatBox = new EnhancedPinnedChatBox(process.stdout, (input) => {
19
- // Process the input through the normal flow
20
- this.processInputBlock(input).catch((err) => {
21
- display.showError(err instanceof Error ? err.message : String(err), err);
22
- });
23
- }, () => {
24
- // Cancel callback
25
- display.showInfo('Input cancelled');
26
- }, {
27
- enabled: true,
28
- position: 1,
29
- maxLines: 3,
30
- showPasteSummaries: true,
31
- autoScroll: true,
32
- maxInputLength: 10000,
33
- maxHistorySize: 100,
34
- });
35
- // Override the original pinnedChatBox reference
36
- this.pinnedChatBox = this.enhancedChatBox;
37
- }
38
- /**
39
- * Enhanced start method that activates the persistent chat box
40
- */
41
- async start(initialPrompt) {
42
- // Always render the enhanced chat box at startup so it's visible from the beginning
43
- this.enhancedChatBox.activate();
44
- this.enhancedChatBox.forceRender();
45
- if (initialPrompt) {
46
- display.newLine();
47
- console.log(`${this.formatUserPrompt()}${initialPrompt}`);
48
- await this.processInputBlock(initialPrompt);
49
- return;
50
- }
51
- // Start the normal readline prompt
52
- this.rl.prompt();
53
- }
54
- /**
55
- * Set streaming state for the chat box
56
- */
57
- setStreaming(isStreaming) {
58
- this.enhancedChatBox.setStreaming(isStreaming);
59
- }
60
- /**
61
- * Set processing state for the chat box
62
- */
63
- setProcessing(isProcessing) {
64
- this.enhancedChatBox.setProcessing(isProcessing);
65
- }
66
- /**
67
- * Handle enhanced input from the chat box
68
- */
69
- handleEnhancedInput(input) {
70
- this.enhancedChatBox.setInput(input);
71
- }
72
- /**
73
- * Submit current input
74
- */
75
- submitInput() {
76
- this.enhancedChatBox.submit();
77
- }
78
- /**
79
- * Cancel current input
80
- */
81
- cancelInput() {
82
- this.enhancedChatBox.cancel();
83
- }
84
- /**
85
- * Navigate input history up
86
- */
87
- navigateHistoryUp() {
88
- this.enhancedChatBox.navigateHistoryUp();
89
- }
90
- /**
91
- * Navigate input history down
92
- */
93
- navigateHistoryDown() {
94
- this.enhancedChatBox.navigateHistoryDown();
95
- }
96
- /**
97
- * Get user prompt format
98
- */
99
- formatUserPrompt() {
100
- return `> `;
101
- }
102
- /**
103
- * Override dispose to clean up enhanced chat box
104
- */
105
- dispose() {
106
- this.enhancedChatBox.dispose();
107
- super.dispose();
108
- }
109
- }
110
- //# sourceMappingURL=EnhancedInteractiveShell.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnhancedInteractiveShell.js","sourceRoot":"","sources":["../../src/shell/EnhancedInteractiveShell.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,MAAM,OAAO,wBAAyB,SAAQ,gBAAgB;IACpD,eAAe,CAAwB;IAE/C,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,6DAA6D;QAC7D,IAAI,CAAC,eAAe,GAAG,IAAI,qBAAqB,CAC9C,OAAO,CAAC,MAAM,EACd,CAAC,KAAa,EAAE,EAAE;YAChB,4CAA4C;YA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OAEG;IACH,aAAa,CAAC,YAAqB;QACjC,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,KAAa;QAC/B,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,IAAI,CAAC,eAAe,CAAC,mBAAmB,EAAE,CAAC;IAC7C,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QAC/B,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF"}
@@ -1,25 +0,0 @@
1
- /**
2
- * Enhanced Shell App with Persistent Chat Box
3
- *
4
- * Extends the base shell app with enhanced persistent chat box features
5
- */
6
- import '../config.js';
7
- import type { ProfileName } from '../config.js';
8
- export interface LaunchEnhancedShellOptions {
9
- enableProfileSelection?: boolean;
10
- enablePersistentChat?: boolean;
11
- }
12
- /**
13
- * Plugin flags for enabling optional features.
14
- */
15
- export interface PluginFlags {
16
- alphaZero?: boolean;
17
- coding?: boolean;
18
- security?: boolean;
19
- allPlugins?: boolean;
20
- }
21
- /**
22
- * Launch the enhanced interactive shell with persistent chat box
23
- */
24
- export declare function launchEnhancedShell(profile: ProfileName, options?: LaunchEnhancedShellOptions, pluginFlags?: PluginFlags, promptArgs?: string[]): Promise<void>;
25
- //# sourceMappingURL=EnhancedShellApp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnhancedShellApp.d.ts","sourceRoot":"","sources":["../../src/shell/EnhancedShellApp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA6BhD,MAAM,WAAW,0BAA0B;IACzC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,0BAA+B,EACxC,WAAW,GAAE,WAAgB,EAC7B,UAAU,GAAE,MAAM,EAAO,GACxB,OAAO,CAAC,IAAI,CAAC,CAiIf"}
@@ -1,161 +0,0 @@
1
- /**
2
- * Enhanced Shell App with Persistent Chat Box
3
- *
4
- * Extends the base shell app with enhanced persistent chat box features
5
- */
6
- import { exit } from 'node:process';
7
- import '../config.js';
8
- import { buildWorkspaceContext, resolveWorkspaceCaptureOptions } from '../workspace.js';
9
- import { EnhancedInteractiveShell } from './EnhancedInteractiveShell.js';
10
- import { display } from '../ui/display.js';
11
- import { loadModelPreference, loadToolSettings, } from '../core/preferences.js';
12
- import { createNodeRuntime } from '../runtime/node.js';
13
- import { buildEnabledToolSet, evaluateToolPermissions, isPluginEnabled, } from '../capabilities/toolRegistry.js';
14
- import { listAgentProfiles } from '../core/agentProfiles.js';
15
- import { maybeOfferCliUpdate } from './updateManager.js';
16
- import { LiveStatusTracker } from './liveStatus.js';
17
- import { buildInteractiveSystemPrompt } from './systemPrompt.js';
18
- import { ShellUIAdapter } from '../ui/ShellUIAdapter.js';
19
- import { stdout } from 'node:process';
20
- import { setPlainOutputMode } from '../ui/outputMode.js';
21
- import { getPluginIdsFromFlags, loadPlugin } from '../plugins/index.js';
22
- import { quickCheckProviders } from '../core/modelDiscovery.js';
23
- import { loadAllSecrets } from '../core/secretStore.js';
24
- /**
25
- * Launch the enhanced interactive shell with persistent chat box
26
- */
27
- export async function launchEnhancedShell(profile, options = {}, pluginFlags = {}, promptArgs = []) {
28
- try {
29
- // Check for plain output mode
30
- if (process.env['EROSOLAR_PLAIN_OUTPUT'] === '1') {
31
- setPlainOutputMode(true);
32
- }
33
- // Check for CLI update
34
- await maybeOfferCliUpdate();
35
- // Quick check for available providers
36
- const providerStatus = await quickCheckProviders();
37
- if (providerStatus.length === 0) {
38
- display.showError('No AI providers configured. Set at least one API key:\n' +
39
- ' ANTHROPIC_API_KEY, OPENAI_API_KEY, DEEPSEEK_API_KEY, or GEMINI_API_KEY');
40
- exit(1);
41
- }
42
- // Load secrets early
43
- await loadAllSecrets();
44
- const workingDir = process.cwd();
45
- const workspaceOptions = resolveWorkspaceCaptureOptions(process.env);
46
- const workspaceContext = buildWorkspaceContext(workingDir, workspaceOptions);
47
- const statusTracker = new LiveStatusTracker();
48
- // Create unified UI adapter early to get the tool observer
49
- // We'll add the file change callback after creating the shell
50
- const uiAdapter = new ShellUIAdapter(stdout, display, {
51
- useUnifiedUI: true,
52
- preserveCompatibility: true,
53
- enableTelemetry: true,
54
- debugMode: false,
55
- });
56
- // Use the unified UI adapter's tool observer instead of the legacy one
57
- const toolObserver = uiAdapter.createToolObserver();
58
- const toolSettings = loadToolSettings();
59
- const toolSelection = buildEnabledToolSet(toolSettings);
60
- const permissionSummary = evaluateToolPermissions(toolSelection);
61
- const pluginFilter = (plugin) => isPluginEnabled(plugin.id, permissionSummary.allowedPluginIds);
62
- const runtime = await createNodeRuntime({
63
- profile,
64
- workspaceContext,
65
- workingDir,
66
- toolObserver,
67
- adapterOptions: {
68
- filter: pluginFilter,
69
- },
70
- });
71
- const session = runtime.session;
72
- const profileConfig = session.profileConfig;
73
- const providerTools = session.toolRuntime.listProviderTools();
74
- // CLI overrides take highest priority, then persisted preferences, then profile defaults
75
- const persistedSelection = profileConfig.modelLocked || profileConfig.providerLocked
76
- ? null
77
- : loadModelPreference(profile);
78
- let initialModel = persistedSelection ?? {
79
- provider: profileConfig.provider,
80
- model: profileConfig.model,
81
- temperature: profileConfig.temperature,
82
- maxTokens: profileConfig.maxTokens,
83
- };
84
- // Apply reasoning effort if configured
85
- if (profileConfig.reasoningEffort) {
86
- initialModel.reasoningEffort = profileConfig.reasoningEffort;
87
- }
88
- // Build enhanced system prompt
89
- const enhancedSystemPrompt = buildInteractiveSystemPrompt({
90
- profile,
91
- profileConfig,
92
- workspaceContext,
93
- initialModel,
94
- toolSelection,
95
- providerTools,
96
- });
97
- // Handle agent selection menu
98
- const agentSelection = options.enableProfileSelection
99
- ? await buildAgentSelectionMenu()
100
- : null;
101
- // Handle session restore
102
- const sessionRestore = {
103
- mode: 'none',
104
- };
105
- // Load plugins
106
- const enabledPluginIds = getPluginIdsFromFlags(pluginFlags);
107
- for (const pluginId of enabledPluginIds) {
108
- await loadPlugin(pluginId);
109
- }
110
- // Create enhanced shell with persistent chat box
111
- const shell = new EnhancedInteractiveShell({
112
- profile,
113
- profileLabel: profileConfig.label,
114
- workingDir,
115
- session,
116
- baseSystemPrompt: enhancedSystemPrompt,
117
- initialModel,
118
- agentSelection,
119
- statusTracker,
120
- uiAdapter,
121
- workspaceOptions,
122
- sessionRestore,
123
- enabledPlugins: enabledPluginIds,
124
- });
125
- const initialPrompt = promptArgs.join(' ').trim();
126
- await shell.start(initialPrompt || undefined);
127
- }
128
- catch (error) {
129
- const message = error instanceof Error ? error.message : String(error);
130
- display.showError(message);
131
- exit(1);
132
- }
133
- }
134
- /**
135
- * Build agent selection menu
136
- */
137
- async function buildAgentSelectionMenu() {
138
- const availableProfiles = listAgentProfiles();
139
- return {
140
- profiles: availableProfiles.map((profile) => ({
141
- name: profile.name,
142
- label: profile.label || profile.name,
143
- })),
144
- onSelect: async (profile) => {
145
- await saveActiveProfilePreference(profile);
146
- display.showInfo(`Default agent profile set to: ${profile}`);
147
- },
148
- };
149
- }
150
- /**
151
- * Parse launch arguments
152
- */
153
- function parseLaunchArguments(args) {
154
- const profileOverride = args.find((arg) => !arg.startsWith('-')) || null;
155
- const promptArgs = args.filter((arg) => arg !== profileOverride);
156
- return {
157
- profileOverride,
158
- promptArgs,
159
- };
160
- }
161
- //# sourceMappingURL=EnhancedShellApp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnhancedShellApp.js","sourceRoot":"","sources":["../../src/shell/EnhancedShellApp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAEL,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,GAEhB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAA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AACH,KAAK,UAAU,uBAAuB;IAIpC,MAAM,iBAAiB,GAAG,iBAAiB,EAAE,CAAC;IAE9C,OAAO;QACL,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC5C,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI;SACrC,CAAC,CAAC;QACH,QAAQ,EAAE,KAAK,EAAE,OAAoB,EAAE,EAAE;YACvC,MAAM,2BAA2B,CAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,CAAC,QAAQ,CAAC,iCAAiC,OAAO,EAAE,CAAC,CAAC;QAC/D,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAAc;IAC1C,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;IACzE,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,eAAe,CAAC,CAAC;IAEjE,OAAO;QACL,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -1,171 +0,0 @@
1
- /**
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
13
- */
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;
29
- }
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 */
46
- statusMessage: string | null;
47
- /** Whether processing is active */
48
- isProcessing: boolean;
49
- }
50
- export type EnhancedChatBoxSubmitCallback = (input: string) => void;
51
- export type EnhancedChatBoxCancelCallback = () => void;
52
- export declare class EnhancedPinnedChatBox {
53
- private writeStream;
54
- private config;
55
- private state;
56
- private onSubmit;
57
- private onCancel;
58
- private isActive;
59
- private inputBuffer;
60
- private cursorPosition;
61
- private history;
62
- private historyIndex;
63
- private tempCurrentInput;
64
- private isPasteMode;
65
- private pasteBuffer;
66
- private renderScheduled;
67
- private lastRenderTime;
68
- private renderThrottleMs;
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;
82
- /**
83
- * Submit current input
84
- */
85
- submit(): void;
86
- /**
87
- * Cancel current input or paste
88
- */
89
- cancel(): void;
90
- /**
91
- * Handle history navigation - up
92
- */
93
- navigateHistoryUp(): void;
94
- /**
95
- * Handle history navigation - down
96
- */
97
- navigateHistoryDown(): void;
98
- /**
99
- * Set input text
100
- */
101
- setInput(text: string, cursorPos?: number): void;
102
- /**
103
- * Clear input
104
- */
105
- clearInput(): void;
106
- /**
107
- * Clear paste mode
108
- */
109
- private clearPasteMode;
110
- /**
111
- * Add input to history
112
- */
113
- private addToHistory;
114
- /**
115
- * Set status message
116
- */
117
- setStatusMessage(message: string | null): 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;
170
- }
171
- //# sourceMappingURL=EnhancedPinnedChatBox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnhancedPinnedChatBox.d.ts","sourceRoot":"","sources":["../../src/ui/EnhancedPinnedChatBox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,2BAA2B;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