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,590 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WSL Handler for Windows Subsystem for Linux
|
|
3
|
+
*/
|
|
4
|
+
import { exec, spawn } from 'child_process';
|
|
5
|
+
import { promisify } from 'util';
|
|
6
|
+
import { SubshellConnectionError, SubshellExecutionError } from '../types.js';
|
|
7
|
+
import { randomBytes } from 'crypto';
|
|
8
|
+
import * as os from 'os';
|
|
9
|
+
const execAsync = promisify(exec);
|
|
10
|
+
/**
|
|
11
|
+
* WSL Handler implementation
|
|
12
|
+
*/
|
|
13
|
+
export class WSLHandler {
|
|
14
|
+
type = 'wsl';
|
|
15
|
+
detectionPatterns = [
|
|
16
|
+
/^wsl$/,
|
|
17
|
+
/^wsl\s+/,
|
|
18
|
+
/^wsl\.exe\s+/,
|
|
19
|
+
];
|
|
20
|
+
config = null;
|
|
21
|
+
currentWorkingDirectory = '~';
|
|
22
|
+
shellType = 'bash';
|
|
23
|
+
sessionId = '';
|
|
24
|
+
shellProcess = null;
|
|
25
|
+
commandQueue = [];
|
|
26
|
+
currentOutput = '';
|
|
27
|
+
currentError = '';
|
|
28
|
+
/**
|
|
29
|
+
* Detect if a command should trigger this handler
|
|
30
|
+
*/
|
|
31
|
+
detect(command) {
|
|
32
|
+
return this.detectionPatterns.some(pattern => pattern.test(command));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Connect to the WSL environment
|
|
36
|
+
*/
|
|
37
|
+
async connect(command, cwd) {
|
|
38
|
+
this.sessionId = randomBytes(16).toString('hex');
|
|
39
|
+
try {
|
|
40
|
+
// Verify WSL is available (Windows only)
|
|
41
|
+
this.verifyWSLAvailable();
|
|
42
|
+
// Parse WSL command to extract distribution
|
|
43
|
+
this.config = await this.parseWSLCommand(command);
|
|
44
|
+
// Spawn interactive shell
|
|
45
|
+
await this.spawnInteractiveShell();
|
|
46
|
+
// Detect shell type
|
|
47
|
+
this.shellType = await this.detectShellType();
|
|
48
|
+
// Get initial working directory
|
|
49
|
+
this.currentWorkingDirectory = await this.getCurrentWorkingDirectory();
|
|
50
|
+
return {
|
|
51
|
+
type: 'wsl',
|
|
52
|
+
handler: this,
|
|
53
|
+
metadata: {
|
|
54
|
+
workingDirectory: this.currentWorkingDirectory,
|
|
55
|
+
shell: this.shellType,
|
|
56
|
+
os: 'linux',
|
|
57
|
+
distroName: this.config.distribution,
|
|
58
|
+
},
|
|
59
|
+
connectionState: 'connected',
|
|
60
|
+
sessionId: this.sessionId,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
throw new SubshellConnectionError('wsl', error instanceof Error ? error.message : 'Unknown error', false);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Spawn an interactive shell process
|
|
69
|
+
*/
|
|
70
|
+
async spawnInteractiveShell() {
|
|
71
|
+
if (!this.config) {
|
|
72
|
+
throw new Error('Config not initialized');
|
|
73
|
+
}
|
|
74
|
+
const distro = this.config.distribution.trim().replace(/\0/g, '');
|
|
75
|
+
return new Promise((resolve, reject) => {
|
|
76
|
+
// Spawn wsl.exe with the distribution
|
|
77
|
+
this.shellProcess = spawn('wsl.exe', ['-d', distro], {
|
|
78
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
79
|
+
shell: false,
|
|
80
|
+
});
|
|
81
|
+
if (!this.shellProcess.stdout || !this.shellProcess.stderr || !this.shellProcess.stdin) {
|
|
82
|
+
reject(new Error('Failed to create shell process streams'));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let hasResolved = false;
|
|
86
|
+
let errorOutput = '';
|
|
87
|
+
let initCommandSent = false;
|
|
88
|
+
// Set up output handlers
|
|
89
|
+
this.shellProcess.stdout.on('data', (data) => {
|
|
90
|
+
this.currentOutput += data.toString();
|
|
91
|
+
// If we get any output, the shell is working
|
|
92
|
+
if (!hasResolved) {
|
|
93
|
+
hasResolved = true;
|
|
94
|
+
resolve();
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
this.shellProcess.stderr.on('data', (data) => {
|
|
98
|
+
const text = data.toString();
|
|
99
|
+
this.currentError += text;
|
|
100
|
+
errorOutput += text;
|
|
101
|
+
});
|
|
102
|
+
this.shellProcess.on('exit', (code) => {
|
|
103
|
+
if (!hasResolved) {
|
|
104
|
+
hasResolved = true;
|
|
105
|
+
// Check for common WSL errors
|
|
106
|
+
if (errorOutput.includes('HCS_E_SERVICE_NOT_AVAILABLE')) {
|
|
107
|
+
reject(new Error('WSL service is not running. Try running "wsl --shutdown" and then try again, or restart your computer.'));
|
|
108
|
+
}
|
|
109
|
+
else if (errorOutput.includes('required feature is not installed')) {
|
|
110
|
+
reject(new Error('WSL is not properly installed or enabled. Please ensure WSL 2 is installed and the Virtual Machine Platform feature is enabled.'));
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
reject(new Error(`WSL process exited with code ${code}. Error: ${errorOutput || 'No error output'}`));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
this.shellProcess = null;
|
|
117
|
+
});
|
|
118
|
+
this.shellProcess.on('error', (error) => {
|
|
119
|
+
if (!hasResolved) {
|
|
120
|
+
hasResolved = true;
|
|
121
|
+
reject(new Error(`Failed to spawn WSL process: ${error.message}`));
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
// Wait for stdin to be ready, then send initialization command
|
|
125
|
+
const sendInitCommand = () => {
|
|
126
|
+
if (!initCommandSent && this.shellProcess && this.shellProcess.stdin && !this.shellProcess.stdin.destroyed) {
|
|
127
|
+
initCommandSent = true;
|
|
128
|
+
this.shellProcess.stdin.write('echo "CENTAURUS_READY"\n');
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
// Try to send command immediately if stdin is already writable
|
|
132
|
+
if (this.shellProcess.stdin.writable) {
|
|
133
|
+
sendInitCommand();
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// Otherwise wait for the 'ready' event on stdin
|
|
137
|
+
this.shellProcess.stdin.once('ready', sendInitCommand);
|
|
138
|
+
}
|
|
139
|
+
// Fallback: also try after a small delay in case ready event doesn't fire
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
sendInitCommand();
|
|
142
|
+
}, 200);
|
|
143
|
+
// Timeout if we don't get a response
|
|
144
|
+
setTimeout(() => {
|
|
145
|
+
if (!hasResolved) {
|
|
146
|
+
hasResolved = true;
|
|
147
|
+
reject(new Error(`WSL shell initialization timed out. Error: ${errorOutput || 'No error output'}`));
|
|
148
|
+
}
|
|
149
|
+
}, 5000);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Disconnect from the WSL environment
|
|
154
|
+
*/
|
|
155
|
+
async disconnect() {
|
|
156
|
+
if (this.shellProcess) {
|
|
157
|
+
this.shellProcess.kill();
|
|
158
|
+
this.shellProcess = null;
|
|
159
|
+
}
|
|
160
|
+
this.config = null;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Execute a command in the WSL environment
|
|
164
|
+
*/
|
|
165
|
+
async executeCommand(command) {
|
|
166
|
+
if (!this.config) {
|
|
167
|
+
throw new SubshellExecutionError(command, 'Not connected to WSL - config is null');
|
|
168
|
+
}
|
|
169
|
+
if (!this.shellProcess) {
|
|
170
|
+
throw new SubshellExecutionError(command, 'Not connected to WSL - shell process is null');
|
|
171
|
+
}
|
|
172
|
+
if (!this.shellProcess.stdin) {
|
|
173
|
+
throw new SubshellExecutionError(command, 'Not connected to WSL - stdin is null');
|
|
174
|
+
}
|
|
175
|
+
if (this.shellProcess.killed || this.shellProcess.exitCode !== null) {
|
|
176
|
+
throw new SubshellExecutionError(command, 'Not connected to WSL - shell process has exited');
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
// Clear previous output
|
|
180
|
+
this.currentOutput = '';
|
|
181
|
+
this.currentError = '';
|
|
182
|
+
// Build command with pwd tracking
|
|
183
|
+
let commandWithPwd;
|
|
184
|
+
const trimmedCommand = command.trim();
|
|
185
|
+
// Check if this is a cd command
|
|
186
|
+
if (trimmedCommand.startsWith('cd ') || trimmedCommand === 'cd') {
|
|
187
|
+
// For cd commands, execute directly without prepending current directory
|
|
188
|
+
// The shell maintains its own state
|
|
189
|
+
commandWithPwd = `${command}; echo "__CENTAURUS_PWD__:$(pwd)"\n`;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// For other commands, ensure we're in the right directory first
|
|
193
|
+
commandWithPwd = `cd ${this.currentWorkingDirectory} && ${command}; echo "__CENTAURUS_PWD__:$(pwd)"\n`;
|
|
194
|
+
}
|
|
195
|
+
// Send command to shell
|
|
196
|
+
this.shellProcess.stdin.write(commandWithPwd);
|
|
197
|
+
// Wait for command to complete (look for the pwd marker)
|
|
198
|
+
const result = await this.executeWithTimeout(() => this.waitForCommandCompletion(), 30000, 'Command execution');
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
return {
|
|
203
|
+
stdout: '',
|
|
204
|
+
stderr: error.message || 'Command execution failed',
|
|
205
|
+
exitCode: 1,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Wait for command completion by monitoring output
|
|
211
|
+
*/
|
|
212
|
+
async waitForCommandCompletion() {
|
|
213
|
+
return new Promise((resolve) => {
|
|
214
|
+
const checkInterval = setInterval(() => {
|
|
215
|
+
const pwdMatch = this.currentOutput.match(/__CENTAURUS_PWD__:(.+)$/m);
|
|
216
|
+
if (pwdMatch) {
|
|
217
|
+
clearInterval(checkInterval);
|
|
218
|
+
// Extract working directory
|
|
219
|
+
const newCwd = pwdMatch[1].trim();
|
|
220
|
+
this.currentWorkingDirectory = newCwd;
|
|
221
|
+
// Clean output
|
|
222
|
+
const cleanStdout = this.currentOutput
|
|
223
|
+
.replace(/__CENTAURUS_PWD__:.+$/m, '')
|
|
224
|
+
.trim();
|
|
225
|
+
resolve({
|
|
226
|
+
stdout: cleanStdout,
|
|
227
|
+
stderr: this.currentError,
|
|
228
|
+
exitCode: 0,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}, 100);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Read a file from the WSL filesystem
|
|
236
|
+
*/
|
|
237
|
+
async readFile(path) {
|
|
238
|
+
if (!this.config) {
|
|
239
|
+
throw new Error('Not connected to WSL');
|
|
240
|
+
}
|
|
241
|
+
const distro = this.config.distribution.trim().replace(/\0/g, '');
|
|
242
|
+
const wslPath = this.resolveWSLPath(path);
|
|
243
|
+
// Use base64 to avoid encoding issues and binary-safe transfer
|
|
244
|
+
const command = `wsl.exe -d ${distro} -- bash -c "base64 '${wslPath}' 2>/dev/null || cat '${wslPath}' | base64"`;
|
|
245
|
+
try {
|
|
246
|
+
const { stdout } = await execAsync(command);
|
|
247
|
+
const b64 = stdout.replace(/\s+/g, '');
|
|
248
|
+
return Buffer.from(b64, 'base64').toString('utf-8');
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
throw new Error(`Failed to read file ${path}: ${error.message}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Write a file to the WSL filesystem
|
|
256
|
+
*/
|
|
257
|
+
async writeFile(path, content) {
|
|
258
|
+
if (!this.config) {
|
|
259
|
+
throw new Error('Not connected to WSL');
|
|
260
|
+
}
|
|
261
|
+
const distro = this.config.distribution.trim().replace(/\0/g, '');
|
|
262
|
+
const wslPath = this.resolveWSLPath(path);
|
|
263
|
+
// Use base64-encoded, chunked writes to avoid shell arg/command length limits
|
|
264
|
+
const base64Content = Buffer.from(content, 'utf-8').toString('base64');
|
|
265
|
+
const CHUNK_SIZE = 32000; // conservative size per command
|
|
266
|
+
try {
|
|
267
|
+
// Truncate/initialize file
|
|
268
|
+
const truncateCmd = `wsl.exe -d ${distro} -- bash -c ": > '${wslPath}'"`;
|
|
269
|
+
await execAsync(truncateCmd);
|
|
270
|
+
// Write in chunks
|
|
271
|
+
for (let i = 0; i < base64Content.length; i += CHUNK_SIZE) {
|
|
272
|
+
const chunk = base64Content.slice(i, i + CHUNK_SIZE);
|
|
273
|
+
const writeCmd = `wsl.exe -d ${distro} -- bash -c "echo '${chunk}' | base64 -d >> '${wslPath}'"`;
|
|
274
|
+
await execAsync(writeCmd);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
throw new Error(`Failed to write file ${path}: ${error.message}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* List directory contents in WSL
|
|
283
|
+
*/
|
|
284
|
+
async listDirectory(path) {
|
|
285
|
+
if (!this.config) {
|
|
286
|
+
throw new Error('Not connected to WSL');
|
|
287
|
+
}
|
|
288
|
+
const distro = this.config.distribution.trim().replace(/\0/g, '');
|
|
289
|
+
const wslPath = this.resolveWSLPath(path);
|
|
290
|
+
const command = `wsl.exe -d ${distro} -- ls -la "${wslPath}"`;
|
|
291
|
+
try {
|
|
292
|
+
const { stdout } = await execAsync(command);
|
|
293
|
+
return this.parseDirectoryListing(stdout);
|
|
294
|
+
}
|
|
295
|
+
catch (error) {
|
|
296
|
+
throw new Error(`Failed to list directory ${path}: ${error.message}`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Search for files matching a pattern in WSL
|
|
301
|
+
*/
|
|
302
|
+
async searchFiles(pattern, directory) {
|
|
303
|
+
if (!this.config) {
|
|
304
|
+
throw new Error('Not connected to WSL');
|
|
305
|
+
}
|
|
306
|
+
const distro = this.config.distribution.trim().replace(/\0/g, '');
|
|
307
|
+
const wslPath = this.resolveWSLPath(directory);
|
|
308
|
+
const escapedPattern = pattern.replace(/'/g, "'\\''");
|
|
309
|
+
const command = `wsl.exe -d ${distro} -- bash -c "grep -rn '${escapedPattern}' '${wslPath}' 2>/dev/null || true"`;
|
|
310
|
+
try {
|
|
311
|
+
const { stdout } = await execAsync(command);
|
|
312
|
+
return this.parseSearchResults(stdout);
|
|
313
|
+
}
|
|
314
|
+
catch (error) {
|
|
315
|
+
// grep returns non-zero if no matches, which is not an error
|
|
316
|
+
return [];
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Get the current working directory in WSL
|
|
321
|
+
*/
|
|
322
|
+
async getCurrentWorkingDirectory() {
|
|
323
|
+
if (!this.config || !this.shellProcess || !this.shellProcess.stdin) {
|
|
324
|
+
return '~';
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
// Clear output
|
|
328
|
+
this.currentOutput = '';
|
|
329
|
+
// Send pwd command
|
|
330
|
+
this.shellProcess.stdin.write('pwd\n');
|
|
331
|
+
// Wait for output
|
|
332
|
+
await new Promise(resolve => setTimeout(resolve, 300));
|
|
333
|
+
const lines = this.currentOutput.trim().split('\n');
|
|
334
|
+
const path = lines[lines.length - 1].trim();
|
|
335
|
+
return path || '~';
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
return '~';
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Get the shell type
|
|
343
|
+
*/
|
|
344
|
+
async getShellType() {
|
|
345
|
+
return this.shellType;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Get the operating system type (always linux for WSL)
|
|
349
|
+
*/
|
|
350
|
+
async getOSType() {
|
|
351
|
+
return 'linux';
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Get breadcrumb information for the UI
|
|
355
|
+
*/
|
|
356
|
+
getBreadcrumbs() {
|
|
357
|
+
if (!this.config) {
|
|
358
|
+
return [];
|
|
359
|
+
}
|
|
360
|
+
return [
|
|
361
|
+
{
|
|
362
|
+
label: 'wsl',
|
|
363
|
+
color: 'yellow',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
label: this.config.distribution,
|
|
367
|
+
color: 'yellow',
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
}
|
|
371
|
+
// Private helper methods
|
|
372
|
+
/**
|
|
373
|
+
* Verify that WSL is available on the system
|
|
374
|
+
*/
|
|
375
|
+
verifyWSLAvailable() {
|
|
376
|
+
if (os.platform() !== 'win32') {
|
|
377
|
+
throw new Error('WSL is only available on Windows');
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Parse WSL command to extract distribution name
|
|
382
|
+
*/
|
|
383
|
+
async parseWSLCommand(command) {
|
|
384
|
+
const parts = command.trim().split(/\s+/);
|
|
385
|
+
let distribution = '';
|
|
386
|
+
// Look for -d or --distribution flag
|
|
387
|
+
for (let i = 1; i < parts.length; i++) {
|
|
388
|
+
const part = parts[i];
|
|
389
|
+
if ((part === '-d' || part === '--distribution') && i + 1 < parts.length) {
|
|
390
|
+
distribution = parts[i + 1];
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
// If no distribution specified, get the default
|
|
395
|
+
if (!distribution) {
|
|
396
|
+
distribution = await this.getDefaultDistribution();
|
|
397
|
+
}
|
|
398
|
+
return {
|
|
399
|
+
distribution,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Get the default WSL distribution
|
|
404
|
+
*/
|
|
405
|
+
async getDefaultDistribution() {
|
|
406
|
+
try {
|
|
407
|
+
const { stdout } = await execAsync('wsl.exe --list --verbose');
|
|
408
|
+
// Remove BOM and null bytes from output
|
|
409
|
+
const cleanOutput = stdout.replace(/^\uFEFF/, '').replace(/\0/g, '');
|
|
410
|
+
const lines = cleanOutput.split('\n');
|
|
411
|
+
// Find the line with * (default distribution)
|
|
412
|
+
for (const line of lines) {
|
|
413
|
+
if (line.includes('*')) {
|
|
414
|
+
const match = line.match(/\*\s+(\S+)/);
|
|
415
|
+
if (match) {
|
|
416
|
+
const distro = match[1].trim().replace(/\0/g, '');
|
|
417
|
+
if (distro) {
|
|
418
|
+
return distro;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
// If no default found, return the first distribution
|
|
424
|
+
for (const line of lines) {
|
|
425
|
+
const match = line.match(/^\s+(\S+)/);
|
|
426
|
+
if (match && !match[1].includes('NAME')) {
|
|
427
|
+
const distro = match[1].trim().replace(/\0/g, '');
|
|
428
|
+
if (distro) {
|
|
429
|
+
return distro;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
throw new Error('No WSL distributions found');
|
|
434
|
+
}
|
|
435
|
+
catch (error) {
|
|
436
|
+
throw new Error('Failed to detect WSL distribution');
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Detect the shell type in WSL
|
|
441
|
+
*/
|
|
442
|
+
async detectShellType() {
|
|
443
|
+
if (!this.config || !this.shellProcess || !this.shellProcess.stdin) {
|
|
444
|
+
return 'bash';
|
|
445
|
+
}
|
|
446
|
+
try {
|
|
447
|
+
// Clear output
|
|
448
|
+
this.currentOutput = '';
|
|
449
|
+
// Send command to detect shell
|
|
450
|
+
this.shellProcess.stdin.write('echo $SHELL\n');
|
|
451
|
+
// Wait for output
|
|
452
|
+
await new Promise(resolve => setTimeout(resolve, 300));
|
|
453
|
+
const shellPath = this.currentOutput.trim();
|
|
454
|
+
if (shellPath.includes('bash'))
|
|
455
|
+
return 'bash';
|
|
456
|
+
if (shellPath.includes('zsh'))
|
|
457
|
+
return 'zsh';
|
|
458
|
+
if (shellPath.includes('fish'))
|
|
459
|
+
return 'fish';
|
|
460
|
+
return 'bash';
|
|
461
|
+
}
|
|
462
|
+
catch {
|
|
463
|
+
return 'bash';
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Build a WSL command with working directory context
|
|
468
|
+
*/
|
|
469
|
+
buildWSLCommand(command) {
|
|
470
|
+
if (!this.config) {
|
|
471
|
+
throw new Error('Not connected to WSL');
|
|
472
|
+
}
|
|
473
|
+
// Validate distribution name
|
|
474
|
+
const distro = this.config.distribution.trim().replace(/\0/g, '');
|
|
475
|
+
if (!distro) {
|
|
476
|
+
throw new Error('Invalid WSL distribution name');
|
|
477
|
+
}
|
|
478
|
+
// Determine the directory to cd into
|
|
479
|
+
const targetDir = this.currentWorkingDirectory === '~' || this.currentWorkingDirectory === ''
|
|
480
|
+
? '~'
|
|
481
|
+
: this.currentWorkingDirectory;
|
|
482
|
+
// Build the command with pwd tracking
|
|
483
|
+
// Use single quotes to avoid escaping issues with $
|
|
484
|
+
const bashScript = `cd ${targetDir} && ${command}; echo "__CENTAURUS_PWD__:$(pwd)"`;
|
|
485
|
+
// Use wsl.exe with bash -c and single quotes
|
|
486
|
+
return `wsl.exe -d ${distro} -- bash -c '${bashScript.replace(/'/g, "'\\''")}'`;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Convert Windows path to WSL path
|
|
490
|
+
*/
|
|
491
|
+
static windowsToWSLPath(windowsPath) {
|
|
492
|
+
// Convert C:\Users\... to /mnt/c/Users/...
|
|
493
|
+
const match = windowsPath.match(/^([A-Za-z]):(\\|\/)/);
|
|
494
|
+
if (match) {
|
|
495
|
+
const drive = match[1].toLowerCase();
|
|
496
|
+
const rest = windowsPath.substring(2).replace(/\\/g, '/');
|
|
497
|
+
return `/mnt/${drive}${rest}`;
|
|
498
|
+
}
|
|
499
|
+
// Already a Unix path
|
|
500
|
+
return windowsPath.replace(/\\/g, '/');
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Convert WSL path to Windows path
|
|
504
|
+
*/
|
|
505
|
+
static wslToWindowsPath(wslPath) {
|
|
506
|
+
// Convert /mnt/c/Users/... to C:\Users\...
|
|
507
|
+
const match = wslPath.match(/^\/mnt\/([a-z])(\/.*)?$/);
|
|
508
|
+
if (match) {
|
|
509
|
+
const drive = match[1].toUpperCase();
|
|
510
|
+
const rest = (match[2] || '').replace(/\//g, '\\');
|
|
511
|
+
return `${drive}:${rest}`;
|
|
512
|
+
}
|
|
513
|
+
// Not a /mnt path, return as-is
|
|
514
|
+
return wslPath;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Resolve a path to a WSL path
|
|
518
|
+
*/
|
|
519
|
+
resolveWSLPath(path) {
|
|
520
|
+
// If it's already an absolute Unix path, use it
|
|
521
|
+
if (path.startsWith('/')) {
|
|
522
|
+
return path;
|
|
523
|
+
}
|
|
524
|
+
// If it starts with ~, use it
|
|
525
|
+
if (path.startsWith('~')) {
|
|
526
|
+
return path;
|
|
527
|
+
}
|
|
528
|
+
// If it's a Windows path, convert it
|
|
529
|
+
if (path.match(/^[A-Za-z]:/)) {
|
|
530
|
+
return WSLHandler.windowsToWSLPath(path);
|
|
531
|
+
}
|
|
532
|
+
// Otherwise, treat as relative to current working directory
|
|
533
|
+
return `${this.currentWorkingDirectory}/${path}`;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Parse directory listing output
|
|
537
|
+
*/
|
|
538
|
+
parseDirectoryListing(output) {
|
|
539
|
+
const entries = [];
|
|
540
|
+
const lines = output.split('\n').filter(line => line.trim());
|
|
541
|
+
for (const line of lines) {
|
|
542
|
+
// Skip total line and current/parent directory
|
|
543
|
+
if (line.startsWith('total') || line.endsWith(' .') || line.endsWith(' ..')) {
|
|
544
|
+
continue;
|
|
545
|
+
}
|
|
546
|
+
// Parse ls -la output: permissions links owner group size date time name
|
|
547
|
+
const match = line.match(/^([drwx-]+)\s+\d+\s+\S+\s+\S+\s+(\d+)\s+\S+\s+\S+\s+\S+\s+(.+)$/);
|
|
548
|
+
if (match) {
|
|
549
|
+
const permissions = match[1];
|
|
550
|
+
const size = parseInt(match[2], 10);
|
|
551
|
+
const name = match[3];
|
|
552
|
+
entries.push({
|
|
553
|
+
name,
|
|
554
|
+
type: permissions.startsWith('d') ? 'directory' : 'file',
|
|
555
|
+
size,
|
|
556
|
+
permissions,
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return entries;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Parse search results from grep output
|
|
564
|
+
*/
|
|
565
|
+
parseSearchResults(output) {
|
|
566
|
+
const results = [];
|
|
567
|
+
const lines = output.split('\n').filter(line => line.trim());
|
|
568
|
+
for (const line of lines) {
|
|
569
|
+
const match = line.match(/^(.+?):(\d+):(.+)$/);
|
|
570
|
+
if (match) {
|
|
571
|
+
results.push({
|
|
572
|
+
file: match[1],
|
|
573
|
+
line: parseInt(match[2], 10),
|
|
574
|
+
content: match[3],
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return results;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Execute a promise with a timeout
|
|
582
|
+
*/
|
|
583
|
+
async executeWithTimeout(operation, timeoutMs, operationName) {
|
|
584
|
+
return Promise.race([
|
|
585
|
+
operation(),
|
|
586
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error(`${operationName} timed out after ${timeoutMs}ms`)), timeoutMs)),
|
|
587
|
+
]);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
//# sourceMappingURL=wsl-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wsl-handler.js","sourceRoot":"","sources":["../../../src/context/handlers/wsl-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAmB,uBAAuB,EAAE,sBAAsB,EAAU,MAAM,aAAa,CAAC;AACvG,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAUlC;;GAEG;AACH,MAAM,OAAO,UAAU;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shellMetadata, SubshellType, ConnectionState, OSType, SubshellConnectionError, SubshellExecutionError, } from './types';
|
|
5
|
+
export { SubshellHandler, BreadcrumbInfo, CommandResult, DirectoryEntry, SearchResult, } from './subshell-handler';
|
|
6
|
+
export { ContextManager, ContextChangeCallback, } from './context-manager';
|
|
7
|
+
export { CommandDetector, DetectionResult, } from './command-detector';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,MAAM,EACN,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,eAAe,EACf,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,cAAc,EACd,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,eAAe,EACf,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context management system exports
|
|
3
|
+
*/
|
|
4
|
+
export { SubshellConnectionError, SubshellExecutionError, } from './types';
|
|
5
|
+
export { ContextManager, } from './context-manager';
|
|
6
|
+
export { CommandDetector, } from './command-detector';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAML,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AAUjB,OAAO,EACL,cAAc,GAEf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,eAAe,GAEhB,MAAM,oBAAoB,CAAC"}
|