maistro 1.0.390
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/LICENSE +15 -0
- package/README.md +107 -0
- package/dist/app.d.ts +247 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +4971 -0
- package/dist/app.js.map +1 -0
- package/dist/buildInfo.d.ts +5 -0
- package/dist/buildInfo.d.ts.map +1 -0
- package/dist/buildInfo.js +2 -0
- package/dist/buildInfo.js.map +1 -0
- package/dist/caffeinate.d.ts +72 -0
- package/dist/caffeinate.d.ts.map +1 -0
- package/dist/caffeinate.js +258 -0
- package/dist/caffeinate.js.map +1 -0
- package/dist/claudePath.d.ts +10 -0
- package/dist/claudePath.d.ts.map +1 -0
- package/dist/claudePath.js +34 -0
- package/dist/claudePath.js.map +1 -0
- package/dist/clipboard.d.ts +44 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +442 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/config.d.ts +211 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +933 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +50 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +81 -0
- package/dist/constants.js.map +1 -0
- package/dist/contextBuilder.d.ts +38 -0
- package/dist/contextBuilder.d.ts.map +1 -0
- package/dist/contextBuilder.js +113 -0
- package/dist/contextBuilder.js.map +1 -0
- package/dist/dependencyDetector.d.ts +57 -0
- package/dist/dependencyDetector.d.ts.map +1 -0
- package/dist/dependencyDetector.js +505 -0
- package/dist/dependencyDetector.js.map +1 -0
- package/dist/executor.d.ts +83 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +583 -0
- package/dist/executor.js.map +1 -0
- package/dist/git.d.ts +85 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +283 -0
- package/dist/git.js.map +1 -0
- package/dist/imageManager.d.ts +161 -0
- package/dist/imageManager.d.ts.map +1 -0
- package/dist/imageManager.js +674 -0
- package/dist/imageManager.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +437 -0
- package/dist/index.js.map +1 -0
- package/dist/input-visual-test.d.ts +9 -0
- package/dist/input-visual-test.d.ts.map +1 -0
- package/dist/input-visual-test.js +108 -0
- package/dist/input-visual-test.js.map +1 -0
- package/dist/inputBox.d.ts +228 -0
- package/dist/inputBox.d.ts.map +1 -0
- package/dist/inputBox.js +966 -0
- package/dist/inputBox.js.map +1 -0
- package/dist/logger.d.ts +136 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +347 -0
- package/dist/logger.js.map +1 -0
- package/dist/orchestrator.d.ts +149 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +821 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/planner.d.ts +86 -0
- package/dist/planner.d.ts.map +1 -0
- package/dist/planner.js +830 -0
- package/dist/planner.js.map +1 -0
- package/dist/pty-test-runner.d.ts +87 -0
- package/dist/pty-test-runner.d.ts.map +1 -0
- package/dist/pty-test-runner.js +721 -0
- package/dist/pty-test-runner.js.map +1 -0
- package/dist/screen.d.ts +44 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +152 -0
- package/dist/screen.js.map +1 -0
- package/dist/taskQueue.d.ts +70 -0
- package/dist/taskQueue.d.ts.map +1 -0
- package/dist/taskQueue.js +282 -0
- package/dist/taskQueue.js.map +1 -0
- package/dist/tui-test-harness.d.ts +216 -0
- package/dist/tui-test-harness.d.ts.map +1 -0
- package/dist/tui-test-harness.js +527 -0
- package/dist/tui-test-harness.js.map +1 -0
- package/dist/types.d.ts +257 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +46 -0
- package/dist/types.js.map +1 -0
- package/dist/ui-visual-test.d.ts +15 -0
- package/dist/ui-visual-test.d.ts.map +1 -0
- package/dist/ui-visual-test.js +141 -0
- package/dist/ui-visual-test.js.map +1 -0
- package/dist/ui.d.ts +272 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +1531 -0
- package/dist/ui.js.map +1 -0
- package/dist/validator.d.ts +53 -0
- package/dist/validator.d.ts.map +1 -0
- package/dist/validator.js +491 -0
- package/dist/validator.js.map +1 -0
- package/dist/versionCheck.d.ts +63 -0
- package/dist/versionCheck.d.ts.map +1 -0
- package/dist/versionCheck.js +261 -0
- package/dist/versionCheck.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clipboard utilities for accessing system clipboard data.
|
|
3
|
+
*
|
|
4
|
+
* This module provides cross-platform clipboard image access.
|
|
5
|
+
* - macOS: Uses osascript/AppleScript
|
|
6
|
+
* - Linux: Uses xclip if available
|
|
7
|
+
* - Windows: Uses PowerShell Get-Clipboard
|
|
8
|
+
*/
|
|
9
|
+
import { execSync, exec } from 'node:child_process';
|
|
10
|
+
import { existsSync, statSync, unlinkSync } from 'node:fs';
|
|
11
|
+
import { tmpdir } from 'node:os';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
/**
|
|
14
|
+
* Get the current platform for clipboard operations
|
|
15
|
+
*/
|
|
16
|
+
function getClipboardPlatform() {
|
|
17
|
+
const p = process.platform;
|
|
18
|
+
if (p === 'darwin' || p === 'linux' || p === 'win32') {
|
|
19
|
+
return p;
|
|
20
|
+
}
|
|
21
|
+
return 'unsupported';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if xclip is available on Linux
|
|
25
|
+
*/
|
|
26
|
+
function isXclipAvailable() {
|
|
27
|
+
try {
|
|
28
|
+
execSync('which xclip', { stdio: 'ignore' });
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generate a unique temp file path for clipboard image
|
|
37
|
+
*/
|
|
38
|
+
function getTempImagePath(format = 'png') {
|
|
39
|
+
const timestamp = Date.now();
|
|
40
|
+
const random = Math.random().toString(36).slice(2, 8);
|
|
41
|
+
return join(tmpdir(), `clipboard-${timestamp}-${random}.${format}`);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if clipboard image access is supported on the current platform
|
|
45
|
+
*/
|
|
46
|
+
export function isClipboardImageSupported() {
|
|
47
|
+
const platform = getClipboardPlatform();
|
|
48
|
+
if (platform === 'darwin')
|
|
49
|
+
return true;
|
|
50
|
+
if (platform === 'linux')
|
|
51
|
+
return isXclipAvailable();
|
|
52
|
+
if (platform === 'win32')
|
|
53
|
+
return true;
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if the system clipboard contains an image
|
|
58
|
+
* Cross-platform: macOS, Linux (with xclip), Windows
|
|
59
|
+
*/
|
|
60
|
+
export function hasClipboardImage() {
|
|
61
|
+
const platform = getClipboardPlatform();
|
|
62
|
+
try {
|
|
63
|
+
switch (platform) {
|
|
64
|
+
case 'darwin':
|
|
65
|
+
return hasClipboardImageMacOS();
|
|
66
|
+
case 'linux':
|
|
67
|
+
return hasClipboardImageLinux();
|
|
68
|
+
case 'win32':
|
|
69
|
+
return hasClipboardImageWindows();
|
|
70
|
+
default:
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function hasClipboardImageMacOS() {
|
|
79
|
+
try {
|
|
80
|
+
const result = execSync(`osascript -e 'clipboard info'`, {
|
|
81
|
+
encoding: 'utf-8',
|
|
82
|
+
timeout: 2000,
|
|
83
|
+
});
|
|
84
|
+
// Look for image-related classes
|
|
85
|
+
return result.includes('PNGf') ||
|
|
86
|
+
result.includes('TIFF') ||
|
|
87
|
+
result.includes('GIFf') ||
|
|
88
|
+
result.includes('JPEG') ||
|
|
89
|
+
result.includes('public.png') ||
|
|
90
|
+
result.includes('public.tiff');
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function hasClipboardImageLinux() {
|
|
97
|
+
if (!isXclipAvailable())
|
|
98
|
+
return false;
|
|
99
|
+
try {
|
|
100
|
+
// Check if clipboard contains image data
|
|
101
|
+
const result = execSync('xclip -selection clipboard -t TARGETS -o', {
|
|
102
|
+
encoding: 'utf-8',
|
|
103
|
+
timeout: 2000,
|
|
104
|
+
});
|
|
105
|
+
return result.includes('image/png') ||
|
|
106
|
+
result.includes('image/jpeg') ||
|
|
107
|
+
result.includes('image/gif') ||
|
|
108
|
+
result.includes('image/tiff');
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function hasClipboardImageWindows() {
|
|
115
|
+
try {
|
|
116
|
+
// PowerShell to check if clipboard contains an image
|
|
117
|
+
const script = `
|
|
118
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
119
|
+
$clipboard = [System.Windows.Forms.Clipboard]::ContainsImage()
|
|
120
|
+
Write-Output $clipboard
|
|
121
|
+
`.trim().replace(/\n/g, '; ');
|
|
122
|
+
const result = execSync(`powershell -Command "${script}"`, {
|
|
123
|
+
encoding: 'utf-8',
|
|
124
|
+
timeout: 3000,
|
|
125
|
+
});
|
|
126
|
+
return result.trim().toLowerCase() === 'true';
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get the image format from clipboard
|
|
134
|
+
* Cross-platform: macOS, Linux (with xclip), Windows
|
|
135
|
+
*/
|
|
136
|
+
export function getClipboardImageFormat() {
|
|
137
|
+
const platform = getClipboardPlatform();
|
|
138
|
+
try {
|
|
139
|
+
switch (platform) {
|
|
140
|
+
case 'darwin':
|
|
141
|
+
return getClipboardImageFormatMacOS();
|
|
142
|
+
case 'linux':
|
|
143
|
+
return getClipboardImageFormatLinux();
|
|
144
|
+
case 'win32':
|
|
145
|
+
// Windows clipboard images are typically PNG when accessed programmatically
|
|
146
|
+
return hasClipboardImageWindows() ? 'png' : null;
|
|
147
|
+
default:
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function getClipboardImageFormatMacOS() {
|
|
156
|
+
try {
|
|
157
|
+
const result = execSync(`osascript -e 'clipboard info'`, {
|
|
158
|
+
encoding: 'utf-8',
|
|
159
|
+
timeout: 2000,
|
|
160
|
+
});
|
|
161
|
+
// Check for specific format types (order matters - prefer PNG)
|
|
162
|
+
if (result.includes('PNGf') || result.includes('public.png')) {
|
|
163
|
+
return 'png';
|
|
164
|
+
}
|
|
165
|
+
if (result.includes('GIFf')) {
|
|
166
|
+
return 'gif';
|
|
167
|
+
}
|
|
168
|
+
if (result.includes('JPEG')) {
|
|
169
|
+
return 'jpeg';
|
|
170
|
+
}
|
|
171
|
+
if (result.includes('TIFF') || result.includes('public.tiff')) {
|
|
172
|
+
return 'tiff';
|
|
173
|
+
}
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function getClipboardImageFormatLinux() {
|
|
181
|
+
if (!isXclipAvailable())
|
|
182
|
+
return null;
|
|
183
|
+
try {
|
|
184
|
+
const result = execSync('xclip -selection clipboard -t TARGETS -o', {
|
|
185
|
+
encoding: 'utf-8',
|
|
186
|
+
timeout: 2000,
|
|
187
|
+
});
|
|
188
|
+
// Check for specific format types (prefer PNG)
|
|
189
|
+
if (result.includes('image/png'))
|
|
190
|
+
return 'png';
|
|
191
|
+
if (result.includes('image/gif'))
|
|
192
|
+
return 'gif';
|
|
193
|
+
if (result.includes('image/jpeg'))
|
|
194
|
+
return 'jpeg';
|
|
195
|
+
if (result.includes('image/tiff'))
|
|
196
|
+
return 'tiff';
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Save clipboard image to a temporary file
|
|
205
|
+
* Cross-platform: macOS, Linux (with xclip), Windows
|
|
206
|
+
*
|
|
207
|
+
* @returns ClipboardImageResult with tempFilePath if successful
|
|
208
|
+
*/
|
|
209
|
+
export async function saveClipboardImage() {
|
|
210
|
+
const platform = getClipboardPlatform();
|
|
211
|
+
if (platform === 'unsupported') {
|
|
212
|
+
return {
|
|
213
|
+
hasImage: false,
|
|
214
|
+
error: 'Clipboard image access is not supported on this platform',
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
// First check if clipboard has an image
|
|
218
|
+
const format = getClipboardImageFormat();
|
|
219
|
+
if (!format) {
|
|
220
|
+
return {
|
|
221
|
+
hasImage: false,
|
|
222
|
+
error: 'No image found in clipboard',
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
switch (platform) {
|
|
227
|
+
case 'darwin':
|
|
228
|
+
return await saveClipboardImageMacOS(format);
|
|
229
|
+
case 'linux':
|
|
230
|
+
return await saveClipboardImageLinux(format);
|
|
231
|
+
case 'win32':
|
|
232
|
+
return await saveClipboardImageWindows();
|
|
233
|
+
default:
|
|
234
|
+
return {
|
|
235
|
+
hasImage: false,
|
|
236
|
+
error: 'Clipboard image access is not supported on this platform',
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
return {
|
|
242
|
+
hasImage: false,
|
|
243
|
+
error: `Failed to save clipboard image: ${error instanceof Error ? error.message : String(error)}`,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function saveClipboardImageMacOS(format) {
|
|
248
|
+
const tempFilePath = getTempImagePath(format);
|
|
249
|
+
// AppleScript to save clipboard image to file
|
|
250
|
+
const script = `
|
|
251
|
+
try
|
|
252
|
+
set theFile to POSIX file "${tempFilePath}"
|
|
253
|
+
set imgData to the clipboard as «class PNGf»
|
|
254
|
+
set fileRef to open for access theFile with write permission
|
|
255
|
+
write imgData to fileRef
|
|
256
|
+
close access fileRef
|
|
257
|
+
return "success"
|
|
258
|
+
on error
|
|
259
|
+
try
|
|
260
|
+
set theFile to POSIX file "${tempFilePath}"
|
|
261
|
+
set imgData to the clipboard as «class TIFF»
|
|
262
|
+
set fileRef to open for access theFile with write permission
|
|
263
|
+
write imgData to fileRef
|
|
264
|
+
close access fileRef
|
|
265
|
+
return "success"
|
|
266
|
+
on error errMsg
|
|
267
|
+
return "error: " & errMsg
|
|
268
|
+
end try
|
|
269
|
+
end try
|
|
270
|
+
`.trim();
|
|
271
|
+
return new Promise((resolve) => {
|
|
272
|
+
exec(`osascript -e '${script.replace(/'/g, `'"'"'`)}'`, {
|
|
273
|
+
timeout: 5000,
|
|
274
|
+
}, (error, stdout, stderr) => {
|
|
275
|
+
if (error) {
|
|
276
|
+
resolve({
|
|
277
|
+
hasImage: false,
|
|
278
|
+
error: `Failed to save clipboard image: ${stderr || error.message}`,
|
|
279
|
+
});
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const result = stdout.trim();
|
|
283
|
+
if (result.startsWith('error:')) {
|
|
284
|
+
resolve({
|
|
285
|
+
hasImage: false,
|
|
286
|
+
error: result.slice(7),
|
|
287
|
+
});
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
// Verify the file was created
|
|
291
|
+
if (!existsSync(tempFilePath)) {
|
|
292
|
+
resolve({
|
|
293
|
+
hasImage: false,
|
|
294
|
+
error: 'Clipboard image file was not created',
|
|
295
|
+
});
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const stats = statSync(tempFilePath);
|
|
299
|
+
if (stats.size === 0) {
|
|
300
|
+
try {
|
|
301
|
+
unlinkSync(tempFilePath);
|
|
302
|
+
}
|
|
303
|
+
catch { }
|
|
304
|
+
resolve({
|
|
305
|
+
hasImage: false,
|
|
306
|
+
error: 'Clipboard image file is empty',
|
|
307
|
+
});
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
resolve({
|
|
311
|
+
hasImage: true,
|
|
312
|
+
tempFilePath,
|
|
313
|
+
format,
|
|
314
|
+
size: stats.size,
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
async function saveClipboardImageLinux(format) {
|
|
320
|
+
if (!isXclipAvailable()) {
|
|
321
|
+
return {
|
|
322
|
+
hasImage: false,
|
|
323
|
+
error: 'xclip is not installed. Install it with: sudo apt install xclip',
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
const tempFilePath = getTempImagePath(format);
|
|
327
|
+
const mimeType = format === 'jpeg' ? 'image/jpeg' : `image/${format}`;
|
|
328
|
+
return new Promise((resolve) => {
|
|
329
|
+
exec(`xclip -selection clipboard -t ${mimeType} -o > "${tempFilePath}"`, {
|
|
330
|
+
timeout: 5000,
|
|
331
|
+
}, (error, _stdout, stderr) => {
|
|
332
|
+
if (error) {
|
|
333
|
+
resolve({
|
|
334
|
+
hasImage: false,
|
|
335
|
+
error: `Failed to save clipboard image: ${stderr || error.message}`,
|
|
336
|
+
});
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
// Verify the file was created
|
|
340
|
+
if (!existsSync(tempFilePath)) {
|
|
341
|
+
resolve({
|
|
342
|
+
hasImage: false,
|
|
343
|
+
error: 'Clipboard image file was not created',
|
|
344
|
+
});
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
const stats = statSync(tempFilePath);
|
|
348
|
+
if (stats.size === 0) {
|
|
349
|
+
try {
|
|
350
|
+
unlinkSync(tempFilePath);
|
|
351
|
+
}
|
|
352
|
+
catch { }
|
|
353
|
+
resolve({
|
|
354
|
+
hasImage: false,
|
|
355
|
+
error: 'Clipboard image file is empty',
|
|
356
|
+
});
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
resolve({
|
|
360
|
+
hasImage: true,
|
|
361
|
+
tempFilePath,
|
|
362
|
+
format,
|
|
363
|
+
size: stats.size,
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
async function saveClipboardImageWindows() {
|
|
369
|
+
const tempFilePath = getTempImagePath('png');
|
|
370
|
+
// PowerShell script to save clipboard image
|
|
371
|
+
const script = `
|
|
372
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
373
|
+
$image = [System.Windows.Forms.Clipboard]::GetImage()
|
|
374
|
+
if ($image -ne $null) {
|
|
375
|
+
$image.Save('${tempFilePath.replace(/\\/g, '\\\\')}', [System.Drawing.Imaging.ImageFormat]::Png)
|
|
376
|
+
Write-Output 'success'
|
|
377
|
+
} else {
|
|
378
|
+
Write-Output 'error: No image in clipboard'
|
|
379
|
+
}
|
|
380
|
+
`.trim().replace(/\n/g, '; ');
|
|
381
|
+
return new Promise((resolve) => {
|
|
382
|
+
exec(`powershell -Command "${script}"`, {
|
|
383
|
+
timeout: 5000,
|
|
384
|
+
}, (error, stdout, stderr) => {
|
|
385
|
+
if (error) {
|
|
386
|
+
resolve({
|
|
387
|
+
hasImage: false,
|
|
388
|
+
error: `Failed to save clipboard image: ${stderr || error.message}`,
|
|
389
|
+
});
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
const result = stdout.trim();
|
|
393
|
+
if (result.startsWith('error:')) {
|
|
394
|
+
resolve({
|
|
395
|
+
hasImage: false,
|
|
396
|
+
error: result.slice(7).trim(),
|
|
397
|
+
});
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
// Verify the file was created
|
|
401
|
+
if (!existsSync(tempFilePath)) {
|
|
402
|
+
resolve({
|
|
403
|
+
hasImage: false,
|
|
404
|
+
error: 'Clipboard image file was not created',
|
|
405
|
+
});
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const stats = statSync(tempFilePath);
|
|
409
|
+
if (stats.size === 0) {
|
|
410
|
+
try {
|
|
411
|
+
unlinkSync(tempFilePath);
|
|
412
|
+
}
|
|
413
|
+
catch { }
|
|
414
|
+
resolve({
|
|
415
|
+
hasImage: false,
|
|
416
|
+
error: 'Clipboard image file is empty',
|
|
417
|
+
});
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
resolve({
|
|
421
|
+
hasImage: true,
|
|
422
|
+
tempFilePath,
|
|
423
|
+
format: 'png',
|
|
424
|
+
size: stats.size,
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Clean up a temporary clipboard image file
|
|
431
|
+
*/
|
|
432
|
+
export function cleanupTempImage(tempFilePath) {
|
|
433
|
+
try {
|
|
434
|
+
if (existsSync(tempFilePath)) {
|
|
435
|
+
unlinkSync(tempFilePath);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
catch {
|
|
439
|
+
// Ignore cleanup errors
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
//# sourceMappingURL=clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../src/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAiB,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAejC;;GAEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;IAC3B,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KA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AAM,CAAC,CAAA,CAAC;gBAC1C,OAAO,CAAC;oBACN,QAAQ,EAAE,KAAK;oBACf,KAAK,EAAE,+BAA+B;iBACvC,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;YAED,OAAO,CAAC;gBACN,QAAQ,EAAE,IAAI;gBACd,YAAY;gBACZ,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,YAAoB;IACnD,IAAI,CAAC;QACH,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAC7B,UAAU,CAAC,YAAY,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,wBAAwB;IAC1B,CAAC;AACH,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
export interface MaistroGlobalConfig {
|
|
2
|
+
claudeCodeValidated?: boolean;
|
|
3
|
+
lastValidated?: string;
|
|
4
|
+
/** Prevent system sleep during execution (macOS only, default: true) */
|
|
5
|
+
preventSleep?: boolean;
|
|
6
|
+
/** Terminal Shift+Enter setup has been shown/configured */
|
|
7
|
+
terminalSetupShown?: boolean;
|
|
8
|
+
/** Shift+Enter for newlines is enabled (terminal configured) */
|
|
9
|
+
shiftEnterEnabled?: boolean;
|
|
10
|
+
/** Cmd+V for clipboard paste is enabled (terminal configured) */
|
|
11
|
+
cmdVPasteEnabled?: boolean;
|
|
12
|
+
/** Timestamp of last version check against npm registry */
|
|
13
|
+
lastVersionCheck?: string;
|
|
14
|
+
/** Latest known version from npm registry */
|
|
15
|
+
latestKnownVersion?: string;
|
|
16
|
+
/** Whether to prompt user for updates (default: true) */
|
|
17
|
+
autoUpdatePrompt?: boolean;
|
|
18
|
+
/** Whether to auto-update without asking (default: false) */
|
|
19
|
+
autoUpdateEnabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Terminal detection result
|
|
23
|
+
*/
|
|
24
|
+
export interface TerminalInfo {
|
|
25
|
+
name: string;
|
|
26
|
+
program: string;
|
|
27
|
+
supportsShiftEnter: boolean;
|
|
28
|
+
configurable: boolean;
|
|
29
|
+
instructions?: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Default settings for new installations
|
|
33
|
+
*/
|
|
34
|
+
export declare const DEFAULT_SETTINGS: {
|
|
35
|
+
readonly preventSleep: true;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Load global configuration
|
|
39
|
+
*/
|
|
40
|
+
export declare function loadConfig(): MaistroGlobalConfig;
|
|
41
|
+
/**
|
|
42
|
+
* Save global configuration
|
|
43
|
+
*/
|
|
44
|
+
export declare function saveConfig(config: MaistroGlobalConfig): void;
|
|
45
|
+
/**
|
|
46
|
+
* Check if Claude Code CLI is installed
|
|
47
|
+
*/
|
|
48
|
+
export declare function isClaudeCodeInstalled(): Promise<{
|
|
49
|
+
installed: boolean;
|
|
50
|
+
version?: string;
|
|
51
|
+
error?: string;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Check if Claude Code is authenticated (can make API calls)
|
|
55
|
+
* Uses cached validation to avoid expensive API calls on every startup
|
|
56
|
+
*/
|
|
57
|
+
export declare function isClaudeCodeAuthenticated(forceCheck?: boolean): Promise<{
|
|
58
|
+
authenticated: boolean;
|
|
59
|
+
error?: string;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Test Claude Code interaction with tool use
|
|
63
|
+
* This catches API errors like rate limiting or concurrency issues
|
|
64
|
+
*/
|
|
65
|
+
export declare function testClaudeInteraction(): Promise<{
|
|
66
|
+
success: boolean;
|
|
67
|
+
error?: string;
|
|
68
|
+
output?: string;
|
|
69
|
+
tokenExpired?: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Launch Claude Code /login command interactively to re-authenticate
|
|
73
|
+
* Returns true if login was successful
|
|
74
|
+
*/
|
|
75
|
+
export declare function launchClaudeLogin(): Promise<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* Check if maistro is configured (Claude Code CLI is available and authenticated)
|
|
78
|
+
*/
|
|
79
|
+
export declare function isConfigured(): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Get config file path (for display)
|
|
82
|
+
*/
|
|
83
|
+
export declare function getConfigPath(): string;
|
|
84
|
+
/**
|
|
85
|
+
* Get the preventSleep setting (defaults to true)
|
|
86
|
+
*/
|
|
87
|
+
export declare function getPreventSleep(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Set the preventSleep setting
|
|
90
|
+
*/
|
|
91
|
+
export declare function setPreventSleep(value: boolean): void;
|
|
92
|
+
/**
|
|
93
|
+
* Detect the current terminal emulator
|
|
94
|
+
*/
|
|
95
|
+
export declare function detectTerminal(): TerminalInfo;
|
|
96
|
+
/**
|
|
97
|
+
* Check if terminal setup has been shown
|
|
98
|
+
*/
|
|
99
|
+
export declare function isTerminalSetupShown(): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Mark terminal setup as shown
|
|
102
|
+
*/
|
|
103
|
+
export declare function setTerminalSetupShown(value: boolean): void;
|
|
104
|
+
/**
|
|
105
|
+
* Get the shiftEnterEnabled setting
|
|
106
|
+
*/
|
|
107
|
+
export declare function getShiftEnterEnabled(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Set the shiftEnterEnabled setting
|
|
110
|
+
*/
|
|
111
|
+
export declare function setShiftEnterEnabled(value: boolean): void;
|
|
112
|
+
/**
|
|
113
|
+
* Get the cmdVPasteEnabled setting
|
|
114
|
+
*/
|
|
115
|
+
export declare function getCmdVPasteEnabled(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Set the cmdVPasteEnabled setting
|
|
118
|
+
*/
|
|
119
|
+
export declare function setCmdVPasteEnabled(value: boolean): void;
|
|
120
|
+
/**
|
|
121
|
+
* Check if VS Code Shift+Enter keybinding is already configured
|
|
122
|
+
*/
|
|
123
|
+
export declare function isVSCodeShiftEnterConfigured(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Configure VS Code Shift+Enter keybinding
|
|
126
|
+
* Returns { success, error?, backupPath? }
|
|
127
|
+
*/
|
|
128
|
+
export declare function configureVSCodeShiftEnter(): {
|
|
129
|
+
success: boolean;
|
|
130
|
+
error?: string;
|
|
131
|
+
backupPath?: string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Remove VS Code Shift+Enter keybinding
|
|
135
|
+
*/
|
|
136
|
+
export declare function removeVSCodeShiftEnter(): {
|
|
137
|
+
success: boolean;
|
|
138
|
+
error?: string;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Check if VS Code Cmd+V keybinding is already configured
|
|
142
|
+
*/
|
|
143
|
+
export declare function isVSCodeCmdVConfigured(): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Configure VS Code Cmd+V keybinding for clipboard paste
|
|
146
|
+
*/
|
|
147
|
+
export declare function configureVSCodeCmdV(): {
|
|
148
|
+
success: boolean;
|
|
149
|
+
error?: string;
|
|
150
|
+
backupPath?: string;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Remove VS Code Cmd+V keybinding
|
|
154
|
+
*/
|
|
155
|
+
export declare function removeVSCodeCmdV(): {
|
|
156
|
+
success: boolean;
|
|
157
|
+
error?: string;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Configure terminal for Cmd+V paste support
|
|
161
|
+
* Warning: VS Code keybindings with "terminalFocus" affect ALL terminals,
|
|
162
|
+
* which may interfere with other terminal apps like Claude Code.
|
|
163
|
+
*/
|
|
164
|
+
export declare function configureTerminalCmdVPaste(terminalInfo: TerminalInfo): {
|
|
165
|
+
success: boolean;
|
|
166
|
+
error?: string;
|
|
167
|
+
message?: string;
|
|
168
|
+
backupPath?: string;
|
|
169
|
+
warning?: string;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Remove terminal Cmd+V paste configuration
|
|
173
|
+
*/
|
|
174
|
+
export declare function removeTerminalCmdVPaste(terminalInfo: TerminalInfo): {
|
|
175
|
+
success: boolean;
|
|
176
|
+
error?: string;
|
|
177
|
+
message?: string;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Configure terminal for Shift+Enter support
|
|
181
|
+
* Returns result with success status and any messages
|
|
182
|
+
*/
|
|
183
|
+
export declare function configureTerminalShiftEnter(terminalInfo: TerminalInfo): {
|
|
184
|
+
success: boolean;
|
|
185
|
+
error?: string;
|
|
186
|
+
message?: string;
|
|
187
|
+
backupPath?: string;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Remove terminal Shift+Enter configuration
|
|
191
|
+
*/
|
|
192
|
+
export declare function removeTerminalShiftEnter(terminalInfo: TerminalInfo): {
|
|
193
|
+
success: boolean;
|
|
194
|
+
error?: string;
|
|
195
|
+
message?: string;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Get the appropriate newline hint based on terminal configuration
|
|
199
|
+
* Returns "Ctrl+J newline" or "Ctrl+J | Shift+Enter newline"
|
|
200
|
+
*/
|
|
201
|
+
export declare function getNewlineHint(): string;
|
|
202
|
+
/**
|
|
203
|
+
* Get terminal-specific instructions for configuring Cmd+V paste
|
|
204
|
+
* macOS terminals intercept Cmd+V for their own paste handling
|
|
205
|
+
* We need them to send an escape sequence we can detect
|
|
206
|
+
*/
|
|
207
|
+
export declare function getCmdVPasteInstructions(): {
|
|
208
|
+
terminal: string;
|
|
209
|
+
instructions: string[];
|
|
210
|
+
};
|
|
211
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC,mBAAmB,CAAC,EAAE,O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