erosolar-cli 1.7.117 → 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 +32 -2
  17. package/dist/ui/persistentPrompt.d.ts.map +1 -1
  18. package/dist/ui/persistentPrompt.js +231 -79
  19. package/dist/ui/persistentPrompt.js.map +1 -1
  20. package/package.json +1 -1
  21. package/dist/shell/enhancedInteractiveShell.d.ts +0 -42
  22. package/dist/shell/enhancedInteractiveShell.d.ts.map +0 -1
  23. package/dist/shell/enhancedInteractiveShell.js +0 -139
  24. package/dist/shell/enhancedInteractiveShell.js.map +0 -1
  25. package/dist/shell/enhancedShellApp.d.ts +0 -22
  26. package/dist/shell/enhancedShellApp.d.ts.map +0 -1
  27. package/dist/shell/enhancedShellApp.js +0 -148
  28. package/dist/shell/enhancedShellApp.js.map +0 -1
  29. package/dist/ui/enhancedPinnedChatBox.d.ts +0 -93
  30. package/dist/ui/enhancedPinnedChatBox.d.ts.map +0 -1
  31. package/dist/ui/enhancedPinnedChatBox.js +0 -372
  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,42 +0,0 @@
1
- /**
2
- * EnhancedInteractiveShell - Extends InteractiveShell with PersistentChatBox for better UX
3
- *
4
- * Key improvements:
5
- * - Persistent chat box remains visible during AI streaming
6
- * - Enhanced paste handling with summarization
7
- * - Only submits to AI when user explicitly hits Enter
8
- */
9
- import { InteractiveShell, type ShellConfig } from './interactiveShell.js';
10
- export declare class EnhancedInteractiveShell extends InteractiveShell {
11
- private persistentChatBox;
12
- constructor(config: ShellConfig);
13
- /**
14
- * Override the processRequest method to integrate persistent chat box during streaming
15
- */
16
- protected processRequest(request: any): Promise<void>;
17
- /**
18
- * Override to handle enhanced paste detection
19
- */
20
- protected handleBracketedPaste(content: string): void;
21
- /**
22
- * Override to handle character input with enhanced paste detection
23
- */
24
- protected handleCharacter(char: string): void;
25
- /**
26
- * Override to handle Enter key with enhanced submission logic
27
- */
28
- protected handleEnter(): void;
29
- /**
30
- * Override to integrate with persistent chat box
31
- */
32
- protected setProcessingStatus(detail?: string): void;
33
- /**
34
- * Override to update context usage in persistent chat box
35
- */
36
- protected refreshContextGauge(): void;
37
- /**
38
- * Override to ensure persistent chat box is properly disposed
39
- */
40
- dispose(): Promise<void>;
41
- }
42
- //# sourceMappingURL=enhancedInteractiveShell.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhancedInteractiveShell.d.ts","sourceRoot":"","sources":["../../src/shell/enhancedInteractiveShell.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI3E,qBAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,OAAO,CAAC,iBAAiB,CAAoB;gBAEjC,MAAM,EAAE,WAAW;IA4B/B;;OAEG;cACa,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IA6D3D;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKrD;;OAEG;IACH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI7C;;OAEG;IACH,SAAS,CAAC,WAAW,IAAI,IAAI;IAQ7B;;OAEG;IACH,SAAS,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAQpD;;OAEG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAQrC;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAItC"}
@@ -1,139 +0,0 @@
1
- /**
2
- * EnhancedInteractiveShell - Extends InteractiveShell with PersistentChatBox for better UX
3
- *
4
- * Key improvements:
5
- * - Persistent chat box remains visible during AI streaming
6
- * - Enhanced paste handling with summarization
7
- * - Only submits to AI when user explicitly hits Enter
8
- */
9
- import { stdout as output } from 'node:process';
10
- import { InteractiveShell } from './interactiveShell.js';
11
- import { display } from '../ui/display.js';
12
- import { PersistentChatBox } from '../ui/persistentChatBox.js';
13
- export class EnhancedInteractiveShell extends InteractiveShell {
14
- persistentChatBox;
15
- constructor(config) {
16
- super(config);
17
- // Initialize persistent chat box for always-visible input during AI processing
18
- this.persistentChatBox = new PersistentChatBox(output, {
19
- onCommandQueued: (cmd) => {
20
- // Bridge to existing follow-up queue system
21
- this.followUpQueue.push({
22
- type: cmd.type === 'slash' ? 'request' : cmd.type,
23
- text: cmd.text,
24
- });
25
- this.refreshQueueIndicators();
26
- },
27
- onInputSubmit: (input) => {
28
- // Process the input through the normal flow
29
- this.processInputBlock(input).catch((err) => {
30
- display.showError(err instanceof Error ? err.message : String(err), err);
31
- });
32
- },
33
- });
34
- // Register persistent chat box with display's output interceptor system
35
- this.persistentChatBox.registerOutputInterceptor(display);
36
- }
37
- /**
38
- * Override the processRequest method to integrate persistent chat box during streaming
39
- */
40
- async processRequest(request) {
41
- const requestStartTime = Date.now();
42
- try {
43
- this.isProcessing = true;
44
- this.uiAdapter.beginProcessing();
45
- // Set streaming state on persistent chat box
46
- this.persistentChatBox.setStreaming(true);
47
- this.persistentChatBox.setProcessing(true);
48
- // Enable scroll region so streaming output scrolls while input stays at bottom
49
- this.persistentChatBox.enableScrollRegion();
50
- // Suppress readline echo so typed characters only appear in persistent input box
51
- this.suppressReadlineOutput();
52
- const agent = this.getAgent();
53
- // Enable streaming for real-time text output (Claude Code style)
54
- await agent.send(request, true);
55
- await this.awaitPendingCleanup();
56
- this.captureHistorySnapshot();
57
- this.autosaveIfEnabled();
58
- // Track metrics with Alpha Zero 2
59
- const elapsedMs = Date.now() - requestStartTime;
60
- this.alphaZeroMetrics.recordMessage(elapsedMs);
61
- }
62
- catch (error) {
63
- const handled = this.handleProviderError(error, () => this.processRequest(request));
64
- if (!handled) {
65
- // Pass full error object for enhanced formatting with stack trace
66
- display.showError(error instanceof Error ? error.message : String(error), error);
67
- }
68
- }
69
- finally {
70
- // Restore readline echo before other cleanup
71
- this.restoreReadlineOutput();
72
- // Disable scroll region before any other output to restore normal terminal behavior
73
- this.persistentChatBox.disableScrollRegion();
74
- display.stopThinking(false);
75
- this.isProcessing = false;
76
- this.uiAdapter.endProcessing('Ready for prompts');
77
- this.setIdleStatus();
78
- display.newLine();
79
- // Clear the processing status and ensure persistent chat box is visible
80
- this.persistentChatBox.setStreaming(false);
81
- this.persistentChatBox.setProcessing(false);
82
- this.persistentChatBox.setStatusMessage(null);
83
- this.persistentChatBox.forceRender();
84
- // CRITICAL: Ensure readline prompt is active for user input
85
- // Call ensureReadlineReady to resume stdin if paused and re-enable keypress
86
- this.ensureReadlineReady();
87
- this.rl.prompt();
88
- }
89
- }
90
- /**
91
- * Override to handle enhanced paste detection
92
- */
93
- handleBracketedPaste(content) {
94
- // Use enhanced paste handling from persistent chat box
95
- this.persistentChatBox.handlePaste(content);
96
- }
97
- /**
98
- * Override to handle character input with enhanced paste detection
99
- */
100
- handleCharacter(char) {
101
- this.persistentChatBox.handleCharacter(char);
102
- }
103
- /**
104
- * Override to handle Enter key with enhanced submission logic
105
- */
106
- handleEnter() {
107
- const input = this.persistentChatBox.handleEnter();
108
- if (input) {
109
- // Input was submitted and processed
110
- this.rl.prompt();
111
- }
112
- }
113
- /**
114
- * Override to integrate with persistent chat box
115
- */
116
- setProcessingStatus(detail) {
117
- super.setProcessingStatus(detail);
118
- if (detail) {
119
- this.persistentChatBox.setStatusMessage(detail);
120
- }
121
- }
122
- /**
123
- * Override to update context usage in persistent chat box
124
- */
125
- refreshContextGauge() {
126
- super.refreshContextGauge();
127
- if (this.contextUsage !== undefined) {
128
- this.persistentChatBox.setContextUsage(this.contextUsage);
129
- }
130
- }
131
- /**
132
- * Override to ensure persistent chat box is properly disposed
133
- */
134
- async dispose() {
135
- await super.dispose();
136
- this.persistentChatBox.dispose();
137
- }
138
- }
139
- //# sourceMappingURL=enhancedInteractiveShell.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhancedInteractiveShell.js","sourceRoot":"","sources":["../../src/shell/enhancedInteractiveShell.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAoB,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAsB,MAAM,4BAA4B,CAAC;AAEnF,MAAM,OAAO,wBAAyB,SAAQ,gBAAgB;IACpD,iBAAiB,CAAoB;IAE7C,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,+EAA+E;QAC/E,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,CAC5C,MAAM,EACN;YACE,eAAe,EAAE,CAAC,GAAkB,EAAE,EAAE;gBACtC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EAAE,CAAC;QACtB,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;CACF"}
@@ -1,22 +0,0 @@
1
- /**
2
- * EnhancedShellApp - Uses EnhancedInteractiveShell for persistent chat box during streaming
3
- */
4
- import '../config.js';
5
- import type { ProfileName } from '../config.js';
6
- export interface LaunchEnhancedShellOptions {
7
- enableProfileSelection?: boolean;
8
- }
9
- /**
10
- * Plugin flags for enabling optional features.
11
- */
12
- export interface PluginFlags {
13
- alphaZero?: boolean;
14
- coding?: boolean;
15
- security?: boolean;
16
- allPlugins?: boolean;
17
- }
18
- /**
19
- * Launch the enhanced interactive shell with persistent chat box
20
- */
21
- export declare function launchEnhancedShell(profile: ProfileName, options?: LaunchEnhancedShellOptions): Promise<void>;
22
- //# sourceMappingURL=enhancedShellApp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhancedShellApp.d.ts","sourceRoot":"","sources":["../../src/shell/enhancedShellApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA6BhD,MAAM,WAAW,0BAA0B;IACzC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;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,GACvC,OAAO,CAAC,IAAI,CAAC,CA0Hf"}
@@ -1,148 +0,0 @@
1
- /**
2
- * EnhancedShellApp - Uses EnhancedInteractiveShell for persistent chat box during streaming
3
- */
4
- import { exit } from 'node:process';
5
- import '../config.js';
6
- import { buildWorkspaceContext, resolveWorkspaceCaptureOptions } from '../workspace.js';
7
- import { EnhancedInteractiveShell } from './enhancedInteractiveShell.js';
8
- import { display } from '../ui/display.js';
9
- import { loadModelPreference, loadToolSettings, } from '../core/preferences.js';
10
- import { createNodeRuntime } from '../runtime/node.js';
11
- import { buildEnabledToolSet, evaluateToolPermissions, isPluginEnabled, } from '../capabilities/toolRegistry.js';
12
- import { listAgentProfiles } from '../core/agentProfiles.js';
13
- import { maybeOfferCliUpdate } from './updateManager.js';
14
- import { LiveStatusTracker } from './liveStatus.js';
15
- import { buildInteractiveSystemPrompt } from './systemPrompt.js';
16
- import { ShellUIAdapter } from '../ui/ShellUIAdapter.js';
17
- import { stdout } from 'node:process';
18
- import { getPluginIdsFromFlags, loadPlugin } from '../plugins/index.js';
19
- import { quickCheckProviders } from '../core/modelDiscovery.js';
20
- import { loadAllSecrets } from '../core/secretStore.js';
21
- /**
22
- * Launch the enhanced interactive shell with persistent chat box
23
- */
24
- export async function launchEnhancedShell(profile, options = {}) {
25
- const { enableProfileSelection = false } = options;
26
- try {
27
- // Check for CLI updates in background
28
- maybeOfferCliUpdate();
29
- // Quick check for available providers
30
- await quickCheckProviders();
31
- // Load secrets early to avoid delays
32
- await loadAllSecrets();
33
- // Parse CLI arguments for prompt
34
- const argv = process.argv.slice(2);
35
- const promptArgs = argv.filter(arg => !arg.startsWith('--'));
36
- // Handle profile selection if enabled
37
- const allowProfileSelection = enableProfileSelection;
38
- const profileConfig = await selectProfile(profile, {
39
- allowSavedProfile: allowProfileSelection,
40
- });
41
- const workingDir = process.cwd();
42
- const workspaceOptions = resolveWorkspaceCaptureOptions(process.env);
43
- const workspaceContext = buildWorkspaceContext(workingDir, workspaceOptions);
44
- const statusTracker = new LiveStatusTracker();
45
- // Create unified UI adapter early to get the tool observer
46
- // We'll add the file change callback after creating the shell
47
- const uiAdapter = new ShellUIAdapter(stdout, display, {
48
- useUnifiedUI: true,
49
- preserveCompatibility: true,
50
- enableTelemetry: true,
51
- debugMode: false,
52
- });
53
- // Use the unified UI adapter's tool observer instead of the legacy one
54
- const toolObserver = uiAdapter.createToolObserver();
55
- const toolSettings = loadToolSettings();
56
- const toolSelection = buildEnabledToolSet(toolSettings);
57
- const permissionSummary = evaluateToolPermissions(toolSelection);
58
- const pluginFilter = (plugin) => isPluginEnabled(plugin.id, permissionSummary.allowedPluginIds);
59
- const runtime = await createNodeRuntime({
60
- profile,
61
- workspaceContext,
62
- workingDir,
63
- toolObserver,
64
- adapterOptions: {
65
- filter: pluginFilter,
66
- },
67
- });
68
- const session = runtime.session;
69
- const profileConfig = session.profileConfig;
70
- const providerTools = session.toolRuntime.listProviderTools();
71
- // CLI overrides take highest priority, then persisted preferences, then profile defaults
72
- const persistedSelection = profileConfig.modelLocked || profileConfig.providerLocked
73
- ? null
74
- : loadModelPreference(profile);
75
- let initialModel = persistedSelection ?? {
76
- provider: profileConfig.defaultProvider,
77
- model: profileConfig.defaultModel,
78
- };
79
- // Build enhanced system prompt with workspace context
80
- const enhancedSystemPrompt = buildInteractiveSystemPrompt({
81
- profile: profileConfig,
82
- workspaceContext,
83
- workingDir,
84
- toolSelection,
85
- agentSelection: providerTools,
86
- });
87
- // Load enabled plugins
88
- const enabledPluginIds = getPluginIdsFromFlags({
89
- alphaZero: false,
90
- coding: false,
91
- security: false,
92
- allPlugins: false,
93
- });
94
- // Load optional plugins if enabled via CLI flags
95
- for (const pluginId of enabledPluginIds) {
96
- await loadPlugin(pluginId);
97
- }
98
- // Report skipped tools due to missing secrets
99
- reportSkippedTools(permissionSummary.warnings);
100
- // Create enhanced interactive shell with persistent chat box
101
- const shell = new EnhancedInteractiveShell({
102
- profile,
103
- profileLabel: profileConfig.label,
104
- workingDir,
105
- session,
106
- baseSystemPrompt: enhancedSystemPrompt,
107
- initialModel,
108
- agentSelection: providerTools,
109
- statusTracker,
110
- uiAdapter,
111
- workspaceOptions,
112
- sessionRestore: { mode: 'none' },
113
- enabledPlugins: enabledPluginIds,
114
- });
115
- const initialPrompt = promptArgs.join(' ').trim();
116
- await shell.start(initialPrompt || undefined);
117
- }
118
- catch (error) {
119
- const message = error instanceof Error ? error.message : String(error);
120
- display.showError(message);
121
- exit(1);
122
- }
123
- }
124
- /**
125
- * Select profile with user interaction if needed
126
- */
127
- async function selectProfile(profile, options) {
128
- // Simplified profile selection - in practice this would be more complex
129
- const availableProfiles = listAgentProfiles();
130
- const matchedProfile = availableProfiles.find(p => p.name === profile);
131
- if (!matchedProfile) {
132
- throw new Error(`Profile "${profile}" not found. Available profiles: ${availableProfiles.map(p => p.name).join(', ')}`);
133
- }
134
- return matchedProfile;
135
- }
136
- /**
137
- * Report skipped tools due to missing configuration
138
- */
139
- function reportSkippedTools(entries) {
140
- for (const warning of entries) {
141
- const details = warning.reason === 'missing-secret' && warning.secretId
142
- ? `missing ${warning.secretId}`
143
- : warning.reason;
144
- const suffix = warning.secretId ? ' (use /secrets to configure it)' : '';
145
- display.showWarning(`Skipped ${warning.label} — ${details}${suffix}`);
146
- }
147
- }
148
- //# sourceMappingURL=enhancedShellApp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhancedShellApp.js","sourceRoot":"","sources":["../../src/shell/enhancedShellApp.ts"],"names":[],"mappings":"AAAA;;GAEG;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,iBAA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AAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,aAAa,CAC1B,OAAoB,EACpB,OAAuC;IAEvC,wEAAwE;IACxE,MAAM,iBAAiB,GAAG,iBAAiB,EAAE,CAAC;IAC9C,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAEvE,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,oCAAoC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1H,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,OAA0B;IACpD,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,CAAC;QAC9B,MAAM,OAAO,GACX,OAAO,CAAC,MAAM,KAAK,gBAAgB,IAAI,OAAO,CAAC,QAAQ;YACrD,CAAC,CAAC,WAAW,OAAO,CAAC,QAAQ,EAAE;YAC/B,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACrB,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,OAAO,CAAC,WAAW,CAAC,WAAW,OAAO,CAAC,KAAK,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC"}
@@ -1,93 +0,0 @@
1
- /**
2
- * EnhancedPinnedChatBox - Modified version of PinnedChatBox with persistent visibility during streaming
3
- * and enhanced paste handling
4
- */
5
- export interface QueuedCommand {
6
- id: string;
7
- text: string;
8
- type: 'request' | 'continuous' | 'slash';
9
- timestamp: number;
10
- preview: string;
11
- }
12
- export interface PinnedChatBoxState {
13
- isProcessing: boolean;
14
- queuedCommands: QueuedCommand[];
15
- currentInput: string;
16
- contextUsage: number;
17
- statusMessage: string | null;
18
- isVisible: boolean;
19
- }
20
- export declare class EnhancedPinnedChatBox {
21
- private writeStream;
22
- private state;
23
- private reservedLines;
24
- private _lastRenderedHeight;
25
- private inputBuffer;
26
- private cursorPosition;
27
- private commandIdCounter;
28
- private onCommandQueued?;
29
- private onInputSubmit?;
30
- private renderScheduled;
31
- private isEnabled;
32
- private isDisposed;
33
- private lastRenderTime;
34
- 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
- });
57
- /**
58
- * Enhanced paste detection with summarization
59
- */
60
- handlePaste(content: string): void;
61
- /**
62
- * Clear paste state
63
- */
64
- private clearPastedBlock;
65
- /**
66
- * Handle character input with paste detection
67
- */
68
- handleCharacter(char: string): void;
69
- /**
70
- * Handle Enter key - only submit when explicitly pressed
71
- */
72
- handleEnter(): string | null;
73
- /**
74
- * Enhanced render that always shows during processing
75
- */
76
- render(): void;
77
- /**
78
- * Render persistent input during processing
79
- */
80
- renderPersistentInput(): void;
81
- private supportsRendering;
82
- private safeWrite;
83
- private sanitizeCommandText;
84
- private sanitizeStatusMessage;
85
- private addToHistory;
86
- setEnabled(enabled: boolean): void;
87
- setProcessing(isProcessing: boolean): void;
88
- setContextUsage(percentage: number): void;
89
- setStatusMessage(message: string | null): void;
90
- queueCommand(text: string, type?: 'request' | 'continuous' | 'slash'): QueuedCommand | null;
91
- clearQueue(): void;
92
- }
93
- //# sourceMappingURL=enhancedPinnedChatBox.d.ts.map
@@ -1 +0,0 @@
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,CAA0B;IAChD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,cA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