centaurus-cli 2.3.0 → 2.5.0
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/README.md +151 -1
- package/dist/cli-adapter.d.ts +41 -2
- package/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +407 -79
- package/dist/cli-adapter.js.map +1 -1
- package/dist/config/types.d.ts +23 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +20 -0
- package/dist/config/types.js.map +1 -1
- package/dist/context/__tests__/command-detector.test.d.ts +14 -0
- package/dist/context/__tests__/command-detector.test.d.ts.map +1 -0
- package/dist/context/__tests__/command-detector.test.js +318 -0
- package/dist/context/__tests__/command-detector.test.js.map +1 -0
- package/dist/context/__tests__/context-manager.test.d.ts +16 -0
- package/dist/context/__tests__/context-manager.test.d.ts.map +1 -0
- package/dist/context/__tests__/context-manager.test.js +375 -0
- package/dist/context/__tests__/context-manager.test.js.map +1 -0
- package/dist/context/__tests__/error-handling.test.d.ts +15 -0
- package/dist/context/__tests__/error-handling.test.d.ts.map +1 -0
- package/dist/context/__tests__/error-handling.test.js +447 -0
- package/dist/context/__tests__/error-handling.test.js.map +1 -0
- package/dist/context/command-detector.d.ts +50 -0
- package/dist/context/command-detector.d.ts.map +1 -0
- package/dist/context/command-detector.js +72 -0
- package/dist/context/command-detector.js.map +1 -0
- package/dist/context/context-manager.d.ts +144 -0
- package/dist/context/context-manager.d.ts.map +1 -0
- package/dist/context/context-manager.js +487 -0
- package/dist/context/context-manager.js.map +1 -0
- package/dist/context/handlers/__tests__/docker-handler.test.d.ts +13 -0
- package/dist/context/handlers/__tests__/docker-handler.test.d.ts.map +1 -0
- package/dist/context/handlers/__tests__/docker-handler.test.js +285 -0
- package/dist/context/handlers/__tests__/docker-handler.test.js.map +1 -0
- package/dist/context/handlers/__tests__/ssh-handler.test.d.ts +13 -0
- package/dist/context/handlers/__tests__/ssh-handler.test.d.ts.map +1 -0
- package/dist/context/handlers/__tests__/ssh-handler.test.js +251 -0
- package/dist/context/handlers/__tests__/ssh-handler.test.js.map +1 -0
- package/dist/context/handlers/__tests__/wsl-handler.test.d.ts +7 -0
- package/dist/context/handlers/__tests__/wsl-handler.test.d.ts.map +1 -0
- package/dist/context/handlers/__tests__/wsl-handler.test.js +331 -0
- package/dist/context/handlers/__tests__/wsl-handler.test.js.map +1 -0
- package/dist/context/handlers/docker-handler.d.ts +111 -0
- package/dist/context/handlers/docker-handler.d.ts.map +1 -0
- package/dist/context/handlers/docker-handler.js +439 -0
- package/dist/context/handlers/docker-handler.js.map +1 -0
- package/dist/context/handlers/ssh-handler.d.ts +120 -0
- package/dist/context/handlers/ssh-handler.d.ts.map +1 -0
- package/dist/context/handlers/ssh-handler.js +523 -0
- package/dist/context/handlers/ssh-handler.js.map +1 -0
- package/dist/context/handlers/wsl-handler.d.ts +128 -0
- package/dist/context/handlers/wsl-handler.d.ts.map +1 -0
- package/dist/context/handlers/wsl-handler.js +590 -0
- package/dist/context/handlers/wsl-handler.js.map +1 -0
- package/dist/context/index.d.ts +8 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +7 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/subshell-handler.d.ts +130 -0
- package/dist/context/subshell-handler.d.ts.map +1 -0
- package/dist/context/subshell-handler.js +5 -0
- package/dist/context/subshell-handler.js.map +1 -0
- package/dist/context/types.d.ts +70 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/context/types.js +34 -0
- package/dist/context/types.js.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/services/__tests__/ai-context-injector.test.d.ts +15 -0
- package/dist/services/__tests__/ai-context-injector.test.d.ts.map +1 -0
- package/dist/services/__tests__/ai-context-injector.test.js +326 -0
- package/dist/services/__tests__/ai-context-injector.test.js.map +1 -0
- package/dist/services/ai-context-injector.d.ts +41 -0
- package/dist/services/ai-context-injector.d.ts.map +1 -0
- package/dist/services/ai-context-injector.js +97 -0
- package/dist/services/ai-context-injector.js.map +1 -0
- package/dist/services/ai-service-client.d.ts +4 -1
- package/dist/services/ai-service-client.d.ts.map +1 -1
- package/dist/services/ai-service-client.js +6 -2
- package/dist/services/ai-service-client.js.map +1 -1
- package/dist/services/api-client.js +1 -1
- package/dist/services/api-client.js.map +1 -1
- package/dist/src/context/types.js +27 -0
- package/dist/src/services/ai-context-injector.js +96 -0
- package/dist/src/services/ai-service-client.js +270 -0
- package/dist/src/services/api-client.js +349 -0
- package/dist/src/tools/types.js +1 -0
- package/dist/src/types/index.js +1 -0
- package/dist/test/context/types.js +27 -0
- package/dist/test/services/__tests__/ai-context-injector.test.js +325 -0
- package/dist/test/services/ai-context-injector.js +96 -0
- package/dist/test/services/ai-service-client.js +270 -0
- package/dist/test/services/api-client.js +349 -0
- package/dist/test/tools/types.js +1 -0
- package/dist/test/types/index.js +1 -0
- package/dist/test-ai-context-injector.js +97 -0
- package/dist/test-ssh-handler.d.ts +8 -0
- package/dist/test-ssh-handler.d.ts.map +1 -0
- package/dist/test-ssh-handler.js +198 -0
- package/dist/test-ssh-handler.js.map +1 -0
- package/dist/tools/command.d.ts.map +1 -1
- package/dist/tools/command.js +123 -46
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/file-ops.d.ts.map +1 -1
- package/dist/tools/file-ops.js +115 -48
- package/dist/tools/file-ops.js.map +1 -1
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/web-search.js +2 -2
- package/dist/tools/web-search.js.map +1 -1
- package/dist/types/index.d.ts +41 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/components/App.d.ts +3 -0
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +213 -46
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/Breadcrumbs.d.ts +12 -0
- package/dist/ui/components/Breadcrumbs.d.ts.map +1 -0
- package/dist/ui/components/Breadcrumbs.js +62 -0
- package/dist/ui/components/Breadcrumbs.js.map +1 -0
- package/dist/ui/components/CodeBlock.js +1 -1
- package/dist/ui/components/CodeBlock.js.map +1 -1
- package/dist/ui/components/DiffViewer.js +1 -1
- package/dist/ui/components/DiffViewer.js.map +1 -1
- package/dist/ui/components/FileViewerScreen.d.ts +14 -0
- package/dist/ui/components/FileViewerScreen.d.ts.map +1 -0
- package/dist/ui/components/FileViewerScreen.js +74 -0
- package/dist/ui/components/FileViewerScreen.js.map +1 -0
- package/dist/ui/components/InputBox.d.ts +2 -0
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +85 -41
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/MessageDisplay.d.ts.map +1 -1
- package/dist/ui/components/MessageDisplay.js +3 -28
- package/dist/ui/components/MessageDisplay.js.map +1 -1
- package/dist/ui/components/PasswordPrompt.d.ts +9 -0
- package/dist/ui/components/PasswordPrompt.d.ts.map +1 -0
- package/dist/ui/components/PasswordPrompt.js +20 -0
- package/dist/ui/components/PasswordPrompt.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +2 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -1
- package/dist/ui/components/StatusBar.js +36 -1
- package/dist/ui/components/StatusBar.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +13 -24
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/ui/components/VersionUpdatePrompt.d.ts +10 -0
- package/dist/ui/components/VersionUpdatePrompt.d.ts.map +1 -0
- package/dist/ui/components/VersionUpdatePrompt.js +41 -0
- package/dist/ui/components/VersionUpdatePrompt.js.map +1 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +38 -10
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/version-checker.d.ts +14 -0
- package/dist/utils/version-checker.d.ts.map +1 -0
- package/dist/utils/version-checker.js +63 -0
- package/dist/utils/version-checker.js.map +1 -0
- package/package.json +71 -69
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Manager - Central orchestrator for subshell state management
|
|
3
|
+
*/
|
|
4
|
+
import { SubshellContext, ConnectionState } from './types.js';
|
|
5
|
+
import { SubshellHandler, CommandResult, DirectoryEntry, SearchResult } from './subshell-handler.js';
|
|
6
|
+
/**
|
|
7
|
+
* Callback type for context change notifications
|
|
8
|
+
*/
|
|
9
|
+
export type ContextChangeCallback = (context: SubshellContext) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Callback type for user notifications
|
|
12
|
+
*/
|
|
13
|
+
export type UserNotificationCallback = (message: string, type: 'info' | 'warning' | 'error') => void;
|
|
14
|
+
/**
|
|
15
|
+
* Context Manager manages the execution context stack and routes commands
|
|
16
|
+
* to the appropriate handler (local or subshell)
|
|
17
|
+
*/
|
|
18
|
+
export declare class ContextManager {
|
|
19
|
+
private initialCwd;
|
|
20
|
+
private platform;
|
|
21
|
+
private contextStack;
|
|
22
|
+
private handlers;
|
|
23
|
+
private contextChangeCallbacks;
|
|
24
|
+
private userNotificationCallbacks;
|
|
25
|
+
constructor(initialCwd: string, platform: NodeJS.Platform);
|
|
26
|
+
/**
|
|
27
|
+
* Create a local context
|
|
28
|
+
*/
|
|
29
|
+
private createLocalContext;
|
|
30
|
+
/**
|
|
31
|
+
* Detect the local shell type
|
|
32
|
+
*/
|
|
33
|
+
private detectLocalShell;
|
|
34
|
+
/**
|
|
35
|
+
* Detect the local operating system
|
|
36
|
+
*/
|
|
37
|
+
private detectLocalOS;
|
|
38
|
+
/**
|
|
39
|
+
* Get the current execution context
|
|
40
|
+
*/
|
|
41
|
+
getCurrentContext(): SubshellContext;
|
|
42
|
+
/**
|
|
43
|
+
* Push a new context onto the stack
|
|
44
|
+
*/
|
|
45
|
+
pushContext(context: SubshellContext): void;
|
|
46
|
+
/**
|
|
47
|
+
* Pop the current context from the stack
|
|
48
|
+
* @returns The popped context, or null if only local context remains
|
|
49
|
+
*/
|
|
50
|
+
popContext(): SubshellContext | null;
|
|
51
|
+
/**
|
|
52
|
+
* Register a subshell handler
|
|
53
|
+
*/
|
|
54
|
+
registerHandler(type: string, handler: SubshellHandler): void;
|
|
55
|
+
/**
|
|
56
|
+
* Get a registered handler by type
|
|
57
|
+
*/
|
|
58
|
+
getHandler(type: string): SubshellHandler | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Get all registered handlers
|
|
61
|
+
*/
|
|
62
|
+
getAllHandlers(): SubshellHandler[];
|
|
63
|
+
/**
|
|
64
|
+
* Update the working directory of the current context
|
|
65
|
+
*/
|
|
66
|
+
updateWorkingDirectory(path: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Update the connection state of the current context
|
|
69
|
+
*/
|
|
70
|
+
updateConnectionState(state: ConnectionState): void;
|
|
71
|
+
/**
|
|
72
|
+
* Register a callback for context changes
|
|
73
|
+
*/
|
|
74
|
+
onContextChange(callback: ContextChangeCallback): void;
|
|
75
|
+
/**
|
|
76
|
+
* Register a callback for user notifications
|
|
77
|
+
*/
|
|
78
|
+
onUserNotification(callback: UserNotificationCallback): void;
|
|
79
|
+
/**
|
|
80
|
+
* Notify all registered callbacks of a context change
|
|
81
|
+
*/
|
|
82
|
+
private notifyContextChange;
|
|
83
|
+
/**
|
|
84
|
+
* Notify user with a message
|
|
85
|
+
*/
|
|
86
|
+
private notifyUser;
|
|
87
|
+
/**
|
|
88
|
+
* Execute a command in the current context with timeout
|
|
89
|
+
*/
|
|
90
|
+
executeCommand(command: string, timeoutMs?: number): Promise<CommandResult>;
|
|
91
|
+
/**
|
|
92
|
+
* Execute a command locally
|
|
93
|
+
*/
|
|
94
|
+
private executeLocalCommand;
|
|
95
|
+
/**
|
|
96
|
+
* Read a file in the current context with timeout
|
|
97
|
+
*/
|
|
98
|
+
readFile(path: string, timeoutMs?: number): Promise<string>;
|
|
99
|
+
/**
|
|
100
|
+
* Write a file in the current context with timeout
|
|
101
|
+
*/
|
|
102
|
+
writeFile(path: string, content: string, timeoutMs?: number): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* List directory contents in the current context with timeout
|
|
105
|
+
*/
|
|
106
|
+
listDirectory(path: string, timeoutMs?: number): Promise<DirectoryEntry[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Search for files in the current context with timeout
|
|
109
|
+
*/
|
|
110
|
+
searchFiles(pattern: string, directory: string, timeoutMs?: number): Promise<SearchResult[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Parse grep output into SearchResult array
|
|
113
|
+
*/
|
|
114
|
+
private parseGrepOutput;
|
|
115
|
+
/**
|
|
116
|
+
* Connect to a subshell with error handling
|
|
117
|
+
*/
|
|
118
|
+
connectToSubshell(handler: SubshellHandler, command: string): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Restore local context after connection failure
|
|
121
|
+
*/
|
|
122
|
+
private restoreLocalContext;
|
|
123
|
+
/**
|
|
124
|
+
* Attempt to reconnect to a subshell
|
|
125
|
+
*/
|
|
126
|
+
attemptReconnection(handler: SubshellHandler, command: string, maxAttempts?: number): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Utility method to sleep for a specified duration
|
|
129
|
+
*/
|
|
130
|
+
private sleep;
|
|
131
|
+
/**
|
|
132
|
+
* Execute an operation with a timeout
|
|
133
|
+
*/
|
|
134
|
+
executeWithTimeout<T>(operation: () => Promise<T>, timeoutMs: number, operationName: string): Promise<T>;
|
|
135
|
+
/**
|
|
136
|
+
* Reset to local context (for error recovery)
|
|
137
|
+
*/
|
|
138
|
+
resetToLocal(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Handle connection loss and attempt recovery
|
|
141
|
+
*/
|
|
142
|
+
handleConnectionLoss(error: Error): Promise<void>;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=context-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-manager.d.ts","sourceRoot":"","sources":["../../src/context/context-manager.ts"],"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AkB,CAAC,CAAC,EACxB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,CAAC,CAAC;IAYb;;OAEG;IACH,YAAY,IAAI,IAAI;IAmBpB;;OAEG;IACG,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;CA0BxD"}
|
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Manager - Central orchestrator for subshell state management
|
|
3
|
+
*/
|
|
4
|
+
import { randomUUID } from 'crypto';
|
|
5
|
+
import { SubshellConnectionError, SubshellExecutionError, } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Context Manager manages the execution context stack and routes commands
|
|
8
|
+
* to the appropriate handler (local or subshell)
|
|
9
|
+
*/
|
|
10
|
+
export class ContextManager {
|
|
11
|
+
initialCwd;
|
|
12
|
+
platform;
|
|
13
|
+
contextStack = [];
|
|
14
|
+
handlers = new Map();
|
|
15
|
+
contextChangeCallbacks = [];
|
|
16
|
+
userNotificationCallbacks = [];
|
|
17
|
+
constructor(initialCwd, platform) {
|
|
18
|
+
this.initialCwd = initialCwd;
|
|
19
|
+
this.platform = platform;
|
|
20
|
+
// Initialize with local context
|
|
21
|
+
this.contextStack.push(this.createLocalContext(initialCwd));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create a local context
|
|
25
|
+
*/
|
|
26
|
+
createLocalContext(cwd) {
|
|
27
|
+
return {
|
|
28
|
+
type: 'local',
|
|
29
|
+
metadata: {
|
|
30
|
+
workingDirectory: cwd,
|
|
31
|
+
shell: this.detectLocalShell(),
|
|
32
|
+
os: this.detectLocalOS(),
|
|
33
|
+
},
|
|
34
|
+
connectionState: 'connected',
|
|
35
|
+
sessionId: randomUUID(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Detect the local shell type
|
|
40
|
+
*/
|
|
41
|
+
detectLocalShell() {
|
|
42
|
+
const shell = process.env.SHELL || process.env.ComSpec || 'unknown';
|
|
43
|
+
if (shell.includes('bash'))
|
|
44
|
+
return 'bash';
|
|
45
|
+
if (shell.includes('zsh'))
|
|
46
|
+
return 'zsh';
|
|
47
|
+
if (shell.includes('fish'))
|
|
48
|
+
return 'fish';
|
|
49
|
+
if (shell.includes('cmd'))
|
|
50
|
+
return 'cmd';
|
|
51
|
+
if (shell.includes('powershell') || shell.includes('pwsh'))
|
|
52
|
+
return 'powershell';
|
|
53
|
+
return 'unknown';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Detect the local operating system
|
|
57
|
+
*/
|
|
58
|
+
detectLocalOS() {
|
|
59
|
+
switch (this.platform) {
|
|
60
|
+
case 'win32':
|
|
61
|
+
return 'windows';
|
|
62
|
+
case 'darwin':
|
|
63
|
+
return 'macos';
|
|
64
|
+
default:
|
|
65
|
+
return 'linux';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get the current execution context
|
|
70
|
+
*/
|
|
71
|
+
getCurrentContext() {
|
|
72
|
+
return this.contextStack[this.contextStack.length - 1];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Push a new context onto the stack
|
|
76
|
+
*/
|
|
77
|
+
pushContext(context) {
|
|
78
|
+
this.contextStack.push(context);
|
|
79
|
+
this.notifyContextChange();
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Pop the current context from the stack
|
|
83
|
+
* @returns The popped context, or null if only local context remains
|
|
84
|
+
*/
|
|
85
|
+
popContext() {
|
|
86
|
+
if (this.contextStack.length <= 1) {
|
|
87
|
+
// Don't pop the local context
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const popped = this.contextStack.pop();
|
|
91
|
+
this.notifyContextChange();
|
|
92
|
+
return popped;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Register a subshell handler
|
|
96
|
+
*/
|
|
97
|
+
registerHandler(type, handler) {
|
|
98
|
+
this.handlers.set(type, handler);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get a registered handler by type
|
|
102
|
+
*/
|
|
103
|
+
getHandler(type) {
|
|
104
|
+
return this.handlers.get(type);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get all registered handlers
|
|
108
|
+
*/
|
|
109
|
+
getAllHandlers() {
|
|
110
|
+
return Array.from(this.handlers.values());
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Update the working directory of the current context
|
|
114
|
+
*/
|
|
115
|
+
updateWorkingDirectory(path) {
|
|
116
|
+
const current = this.getCurrentContext();
|
|
117
|
+
current.metadata.workingDirectory = path;
|
|
118
|
+
this.notifyContextChange();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Update the connection state of the current context
|
|
122
|
+
*/
|
|
123
|
+
updateConnectionState(state) {
|
|
124
|
+
const current = this.getCurrentContext();
|
|
125
|
+
current.connectionState = state;
|
|
126
|
+
this.notifyContextChange();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Register a callback for context changes
|
|
130
|
+
*/
|
|
131
|
+
onContextChange(callback) {
|
|
132
|
+
this.contextChangeCallbacks.push(callback);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Register a callback for user notifications
|
|
136
|
+
*/
|
|
137
|
+
onUserNotification(callback) {
|
|
138
|
+
this.userNotificationCallbacks.push(callback);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Notify all registered callbacks of a context change
|
|
142
|
+
*/
|
|
143
|
+
notifyContextChange() {
|
|
144
|
+
const current = this.getCurrentContext();
|
|
145
|
+
this.contextChangeCallbacks.forEach(callback => {
|
|
146
|
+
try {
|
|
147
|
+
callback(current);
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
console.error('Error in context change callback:', error);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Notify user with a message
|
|
156
|
+
*/
|
|
157
|
+
notifyUser(message, type = 'info') {
|
|
158
|
+
this.userNotificationCallbacks.forEach(callback => {
|
|
159
|
+
try {
|
|
160
|
+
callback(message, type);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
console.error('Error in user notification callback:', error);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
// Fallback to console if no callbacks registered
|
|
167
|
+
if (this.userNotificationCallbacks.length === 0) {
|
|
168
|
+
const prefix = type === 'error' ? '❌' : type === 'warning' ? '⚠️' : 'ℹ️';
|
|
169
|
+
console.log(`${prefix} ${message}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Execute a command in the current context with timeout
|
|
174
|
+
*/
|
|
175
|
+
async executeCommand(command, timeoutMs = 30000) {
|
|
176
|
+
const context = this.getCurrentContext();
|
|
177
|
+
const startTime = Date.now();
|
|
178
|
+
try {
|
|
179
|
+
let result;
|
|
180
|
+
if (context.type === 'local') {
|
|
181
|
+
// Execute locally using Node.js child_process
|
|
182
|
+
result = await this.executeWithTimeout(() => this.executeLocalCommand(command, context.metadata.workingDirectory), timeoutMs, 'Command execution');
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
// Execute in subshell
|
|
186
|
+
if (!context.handler) {
|
|
187
|
+
throw new SubshellExecutionError(command, 'No handler available for current context', 1);
|
|
188
|
+
}
|
|
189
|
+
result = await this.executeWithTimeout(() => context.handler.executeCommand(command), timeoutMs, 'Command execution');
|
|
190
|
+
// Update working directory after command execution
|
|
191
|
+
const newCwd = await context.handler.getCurrentWorkingDirectory();
|
|
192
|
+
if (newCwd !== context.metadata.workingDirectory) {
|
|
193
|
+
context.metadata.workingDirectory = newCwd;
|
|
194
|
+
this.notifyContextChange();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// Check for latency warning
|
|
198
|
+
const executionTime = Date.now() - startTime;
|
|
199
|
+
if (executionTime > 2000) {
|
|
200
|
+
this.notifyUser(`Command took ${(executionTime / 1000).toFixed(1)}s to execute (high latency detected)`, 'warning');
|
|
201
|
+
}
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
if (error instanceof Error && error.message.includes('timed out')) {
|
|
206
|
+
this.notifyUser(`Command timed out after ${timeoutMs / 1000}s`, 'error');
|
|
207
|
+
throw new SubshellExecutionError(command, `Command timed out after ${timeoutMs / 1000}s`, 124 // Standard timeout exit code
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
throw new SubshellExecutionError(command, error instanceof Error ? error.message : String(error), 1);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Execute a command locally
|
|
215
|
+
*/
|
|
216
|
+
async executeLocalCommand(command, cwd) {
|
|
217
|
+
const { exec } = await import('child_process');
|
|
218
|
+
const { promisify } = await import('util');
|
|
219
|
+
const execAsync = promisify(exec);
|
|
220
|
+
try {
|
|
221
|
+
const { stdout, stderr } = await execAsync(command, { cwd });
|
|
222
|
+
return {
|
|
223
|
+
stdout: stdout || '',
|
|
224
|
+
stderr: stderr || '',
|
|
225
|
+
exitCode: 0,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
return {
|
|
230
|
+
stdout: error.stdout || '',
|
|
231
|
+
stderr: error.stderr || error.message || '',
|
|
232
|
+
exitCode: error.code || 1,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Read a file in the current context with timeout
|
|
238
|
+
*/
|
|
239
|
+
async readFile(path, timeoutMs = 10000) {
|
|
240
|
+
const context = this.getCurrentContext();
|
|
241
|
+
try {
|
|
242
|
+
if (context.type === 'local') {
|
|
243
|
+
const fs = await import('fs/promises');
|
|
244
|
+
return await this.executeWithTimeout(() => fs.readFile(path, 'utf-8'), timeoutMs, 'File read');
|
|
245
|
+
}
|
|
246
|
+
if (!context.handler) {
|
|
247
|
+
throw new Error('No handler available for current context');
|
|
248
|
+
}
|
|
249
|
+
return await this.executeWithTimeout(() => context.handler.readFile(path), timeoutMs, 'File read');
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
if (error instanceof Error && error.message.includes('timed out')) {
|
|
253
|
+
this.notifyUser(`File read timed out after ${timeoutMs / 1000}s`, 'error');
|
|
254
|
+
}
|
|
255
|
+
throw error;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Write a file in the current context with timeout
|
|
260
|
+
*/
|
|
261
|
+
async writeFile(path, content, timeoutMs = 10000) {
|
|
262
|
+
const context = this.getCurrentContext();
|
|
263
|
+
try {
|
|
264
|
+
if (context.type === 'local') {
|
|
265
|
+
const fs = await import('fs/promises');
|
|
266
|
+
await this.executeWithTimeout(() => fs.writeFile(path, content, 'utf-8'), timeoutMs, 'File write');
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (!context.handler) {
|
|
270
|
+
throw new Error('No handler available for current context');
|
|
271
|
+
}
|
|
272
|
+
await this.executeWithTimeout(() => context.handler.writeFile(path, content), timeoutMs, 'File write');
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
if (error instanceof Error && error.message.includes('timed out')) {
|
|
276
|
+
this.notifyUser(`File write timed out after ${timeoutMs / 1000}s`, 'error');
|
|
277
|
+
}
|
|
278
|
+
throw error;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* List directory contents in the current context with timeout
|
|
283
|
+
*/
|
|
284
|
+
async listDirectory(path, timeoutMs = 10000) {
|
|
285
|
+
const context = this.getCurrentContext();
|
|
286
|
+
try {
|
|
287
|
+
if (context.type === 'local') {
|
|
288
|
+
const fs = await import('fs/promises');
|
|
289
|
+
return await this.executeWithTimeout(async () => {
|
|
290
|
+
const entries = await fs.readdir(path, { withFileTypes: true });
|
|
291
|
+
return entries.map(entry => ({
|
|
292
|
+
name: entry.name,
|
|
293
|
+
type: entry.isDirectory() ? 'directory' : 'file',
|
|
294
|
+
}));
|
|
295
|
+
}, timeoutMs, 'Directory listing');
|
|
296
|
+
}
|
|
297
|
+
if (!context.handler) {
|
|
298
|
+
throw new Error('No handler available for current context');
|
|
299
|
+
}
|
|
300
|
+
return await this.executeWithTimeout(() => context.handler.listDirectory(path), timeoutMs, 'Directory listing');
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
if (error instanceof Error && error.message.includes('timed out')) {
|
|
304
|
+
this.notifyUser(`Directory listing timed out after ${timeoutMs / 1000}s`, 'error');
|
|
305
|
+
}
|
|
306
|
+
throw error;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Search for files in the current context with timeout
|
|
311
|
+
*/
|
|
312
|
+
async searchFiles(pattern, directory, timeoutMs = 30000) {
|
|
313
|
+
const context = this.getCurrentContext();
|
|
314
|
+
try {
|
|
315
|
+
if (context.type === 'local') {
|
|
316
|
+
// For local, we'll use grep via command execution
|
|
317
|
+
const result = await this.executeWithTimeout(() => this.executeLocalCommand(`grep -rn "${pattern}" "${directory}" 2>/dev/null || true`, context.metadata.workingDirectory), timeoutMs, 'File search');
|
|
318
|
+
return this.parseGrepOutput(result.stdout);
|
|
319
|
+
}
|
|
320
|
+
if (!context.handler) {
|
|
321
|
+
throw new Error('No handler available for current context');
|
|
322
|
+
}
|
|
323
|
+
return await this.executeWithTimeout(() => context.handler.searchFiles(pattern, directory), timeoutMs, 'File search');
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
if (error instanceof Error && error.message.includes('timed out')) {
|
|
327
|
+
this.notifyUser(`File search timed out after ${timeoutMs / 1000}s`, 'error');
|
|
328
|
+
}
|
|
329
|
+
throw error;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Parse grep output into SearchResult array
|
|
334
|
+
*/
|
|
335
|
+
parseGrepOutput(output) {
|
|
336
|
+
const results = [];
|
|
337
|
+
const lines = output.split('\n').filter(line => line.trim());
|
|
338
|
+
for (const line of lines) {
|
|
339
|
+
const match = line.match(/^([^:]+):(\d+):(.*)$/);
|
|
340
|
+
if (match) {
|
|
341
|
+
results.push({
|
|
342
|
+
file: match[1],
|
|
343
|
+
line: parseInt(match[2], 10),
|
|
344
|
+
content: match[3],
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return results;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Connect to a subshell with error handling
|
|
352
|
+
*/
|
|
353
|
+
async connectToSubshell(handler, command) {
|
|
354
|
+
try {
|
|
355
|
+
this.updateConnectionState('connecting');
|
|
356
|
+
this.notifyUser(`Connecting to ${handler.type}...`, 'info');
|
|
357
|
+
const cwd = this.getCurrentContext().metadata.workingDirectory;
|
|
358
|
+
const context = await handler.connect(command, cwd);
|
|
359
|
+
this.pushContext(context);
|
|
360
|
+
this.updateConnectionState('connected');
|
|
361
|
+
this.notifyUser(`Connected to ${handler.type} successfully`, 'info');
|
|
362
|
+
}
|
|
363
|
+
catch (error) {
|
|
364
|
+
this.updateConnectionState('error');
|
|
365
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
366
|
+
this.notifyUser(`Failed to connect: ${errorMessage}`, 'error');
|
|
367
|
+
// Check if error is recoverable
|
|
368
|
+
if (error instanceof SubshellConnectionError && error.recoverable) {
|
|
369
|
+
this.notifyUser('Attempting to reconnect...', 'info');
|
|
370
|
+
try {
|
|
371
|
+
await this.attemptReconnection(handler, command);
|
|
372
|
+
}
|
|
373
|
+
catch (reconnectError) {
|
|
374
|
+
const reconnectMsg = reconnectError instanceof Error ? reconnectError.message : String(reconnectError);
|
|
375
|
+
this.notifyUser(`Reconnection failed: ${reconnectMsg}`, 'error');
|
|
376
|
+
this.restoreLocalContext();
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
// Non-recoverable error, restore local context
|
|
381
|
+
this.restoreLocalContext();
|
|
382
|
+
}
|
|
383
|
+
throw error;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Restore local context after connection failure
|
|
388
|
+
*/
|
|
389
|
+
restoreLocalContext() {
|
|
390
|
+
// Pop all subshell contexts and return to local
|
|
391
|
+
while (this.contextStack.length > 1) {
|
|
392
|
+
const context = this.contextStack.pop();
|
|
393
|
+
if (context?.handler) {
|
|
394
|
+
context.handler.disconnect().catch((err) => {
|
|
395
|
+
console.error('Error disconnecting handler:', err);
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
this.updateConnectionState('connected');
|
|
400
|
+
this.notifyUser('Restored local context', 'info');
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Attempt to reconnect to a subshell
|
|
404
|
+
*/
|
|
405
|
+
async attemptReconnection(handler, command, maxAttempts = 3) {
|
|
406
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
407
|
+
const delay = Math.min(1000 * Math.pow(2, attempt - 1), 8000);
|
|
408
|
+
this.notifyUser(`Reconnection attempt ${attempt}/${maxAttempts}...`, 'info');
|
|
409
|
+
await this.sleep(delay);
|
|
410
|
+
try {
|
|
411
|
+
const cwd = this.getCurrentContext().metadata.workingDirectory;
|
|
412
|
+
const context = await handler.connect(command, cwd);
|
|
413
|
+
this.pushContext(context);
|
|
414
|
+
this.updateConnectionState('connected');
|
|
415
|
+
this.notifyUser('Reconnected successfully', 'info');
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
if (attempt === maxAttempts) {
|
|
420
|
+
throw new SubshellConnectionError(handler.type, 'Reconnection failed after maximum attempts', false);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Utility method to sleep for a specified duration
|
|
427
|
+
*/
|
|
428
|
+
sleep(ms) {
|
|
429
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Execute an operation with a timeout
|
|
433
|
+
*/
|
|
434
|
+
async executeWithTimeout(operation, timeoutMs, operationName) {
|
|
435
|
+
return Promise.race([
|
|
436
|
+
operation(),
|
|
437
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error(`${operationName} timed out after ${timeoutMs}ms`)), timeoutMs)),
|
|
438
|
+
]);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Reset to local context (for error recovery)
|
|
442
|
+
*/
|
|
443
|
+
resetToLocal() {
|
|
444
|
+
// Disconnect all subshells
|
|
445
|
+
const handlers = this.contextStack
|
|
446
|
+
.filter(ctx => ctx.handler)
|
|
447
|
+
.map(ctx => ctx.handler);
|
|
448
|
+
// Clear stack except local context
|
|
449
|
+
this.contextStack = [this.contextStack[0]];
|
|
450
|
+
// Disconnect handlers asynchronously
|
|
451
|
+
handlers.forEach(handler => {
|
|
452
|
+
handler.disconnect().catch((err) => {
|
|
453
|
+
console.error('Error disconnecting handler:', err);
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
this.notifyContextChange();
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Handle connection loss and attempt recovery
|
|
460
|
+
*/
|
|
461
|
+
async handleConnectionLoss(error) {
|
|
462
|
+
const context = this.getCurrentContext();
|
|
463
|
+
if (context.type === 'local') {
|
|
464
|
+
// Already in local context, nothing to do
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
this.updateConnectionState('error');
|
|
468
|
+
this.notifyUser(`Connection lost: ${error.message}`, 'error');
|
|
469
|
+
// Try to reconnect if handler is available
|
|
470
|
+
if (context.handler) {
|
|
471
|
+
try {
|
|
472
|
+
this.notifyUser('Attempting to reconnect...', 'info');
|
|
473
|
+
// We need the original command to reconnect, but we don't have it stored
|
|
474
|
+
// For now, we'll just restore local context
|
|
475
|
+
this.restoreLocalContext();
|
|
476
|
+
}
|
|
477
|
+
catch (reconnectError) {
|
|
478
|
+
this.notifyUser('Reconnection failed, restoring local context', 'error');
|
|
479
|
+
this.restoreLocalContext();
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
this.restoreLocalContext();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
//# sourceMappingURL=context-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-manager.js","sourceRoot":"","sources":["../../src/context/context-manager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAKL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAkBpB;;;GAGG;AACH,MAAM,OAAO,cAAc;IAML;IAA4B;IALxC,YAAY,GAAsB,EAAE,CAAC;IACrC,QAAQ,GAAiC,IAAI,GAAG,EAAE,CAAC;IACnD,sBAAsB,GAA4B,EAAE,CAAC;IACrD,yBAAyB,GAA+B,EAAE,CAAC;IAEnE,YAAoB,UAAkB,EAAU,QAAyB;QAArD,eAAU,GAAV,UAAU,CAAQ;QAAU,aAAQ,GAAR,QAAQ,CAAiB;QACvE,gCAAgC;QAChC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACK,kBAAkB,CAAC,GAAW;QACpC,OAAO;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE;gBACR,gBAAgB,EAAE,GAAG;gBACrB,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE;gBAC9B,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE;aACzB;YACD,eAAe,EAAE,WAAW;YAC5B,SAAS,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CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for Docker Handler
|
|
3
|
+
*
|
|
4
|
+
* Note: These tests require Docker to be installed and running for full integration testing.
|
|
5
|
+
* This file provides unit tests for the Docker Handler implementation.
|
|
6
|
+
*
|
|
7
|
+
* To run with a test framework, install jest or mocha:
|
|
8
|
+
* npm install --save-dev jest @types/jest ts-jest
|
|
9
|
+
*
|
|
10
|
+
* For now, this file serves as documentation and can be used with a test framework later.
|
|
11
|
+
*/
|
|
12
|
+
export declare function testDockerHandler(): void;
|
|
13
|
+
//# sourceMappingURL=docker-handler.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-handler.test.d.ts","sourceRoot":"","sources":["../../../../src/context/handlers/__tests__/docker-handler.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,wBAAgB,iBAAiB,SA4WhC"}
|