superbased 1.5.0 → 1.6.1
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/SUPERBASED_SKILL.md +38 -2
- package/dist/electron/core/platform.d.ts +2 -0
- package/dist/electron/core/platform.d.ts.map +1 -1
- package/dist/electron/main.js +95 -13
- package/dist/electron/modules/active-window.d.ts.map +1 -1
- package/dist/electron/modules/active-window.js +8 -0
- package/dist/electron/modules/active-window.js.map +1 -1
- package/dist/electron/modules/api-server.d.ts.map +1 -1
- package/dist/electron/modules/api-server.js +232 -4
- package/dist/electron/modules/api-server.js.map +1 -1
- package/dist/electron/modules/azure-speech-realtime.d.ts +13 -3
- package/dist/electron/modules/azure-speech-realtime.d.ts.map +1 -1
- package/dist/electron/modules/azure-speech-realtime.js +187 -54
- package/dist/electron/modules/azure-speech-realtime.js.map +1 -1
- package/dist/electron/modules/capture.d.ts.map +1 -1
- package/dist/electron/modules/capture.js +27 -8
- package/dist/electron/modules/capture.js.map +1 -1
- package/dist/electron/modules/dictation.d.ts +2 -0
- package/dist/electron/modules/dictation.d.ts.map +1 -1
- package/dist/electron/modules/dictation.js +145 -20
- package/dist/electron/modules/dictation.js.map +1 -1
- package/dist/electron/modules/ocr.d.ts.map +1 -1
- package/dist/electron/modules/ocr.js +15 -3
- package/dist/electron/modules/ocr.js.map +1 -1
- package/dist/electron/modules/recording/capture-queue.d.ts.map +1 -1
- package/dist/electron/modules/recording/capture-queue.js +43 -10
- package/dist/electron/modules/recording/capture-queue.js.map +1 -1
- package/dist/electron/modules/recording/index.d.ts.map +1 -1
- package/dist/electron/modules/recording/index.js +12 -6
- package/dist/electron/modules/recording/index.js.map +1 -1
- package/dist/electron/modules/recording/monitor-analyzer.d.ts +40 -0
- package/dist/electron/modules/recording/monitor-analyzer.d.ts.map +1 -0
- package/dist/electron/modules/recording/monitor-analyzer.js +220 -0
- package/dist/electron/modules/recording/monitor-analyzer.js.map +1 -0
- package/dist/electron/modules/recording/providers/change-detect-provider.d.ts +28 -0
- package/dist/electron/modules/recording/providers/change-detect-provider.d.ts.map +1 -0
- package/dist/electron/modules/recording/providers/change-detect-provider.js +181 -0
- package/dist/electron/modules/recording/providers/change-detect-provider.js.map +1 -0
- package/dist/electron/modules/recording/providers/provider-factory.d.ts +8 -2
- package/dist/electron/modules/recording/providers/provider-factory.d.ts.map +1 -1
- package/dist/electron/modules/recording/providers/provider-factory.js +33 -12
- package/dist/electron/modules/recording/providers/provider-factory.js.map +1 -1
- package/dist/electron/modules/recording/providers/uiohook-provider.d.ts.map +1 -1
- package/dist/electron/modules/recording/providers/uiohook-provider.js +9 -5
- package/dist/electron/modules/recording/providers/uiohook-provider.js.map +1 -1
- package/dist/electron/modules/recording/recording-session.d.ts +5 -1
- package/dist/electron/modules/recording/recording-session.d.ts.map +1 -1
- package/dist/electron/modules/recording/recording-session.js +78 -6
- package/dist/electron/modules/recording/recording-session.js.map +1 -1
- package/dist/electron/modules/recording/trigger-engine.d.ts.map +1 -1
- package/dist/electron/modules/recording/trigger-engine.js +10 -3
- package/dist/electron/modules/recording/trigger-engine.js.map +1 -1
- package/dist/electron/modules/store.js +2 -2
- package/dist/electron/modules/store.js.map +1 -1
- package/dist/electron/modules/uiohook-manager.d.ts +19 -0
- package/dist/electron/modules/uiohook-manager.d.ts.map +1 -0
- package/dist/electron/modules/uiohook-manager.js +101 -0
- package/dist/electron/modules/uiohook-manager.js.map +1 -0
- package/dist/headless/mic-capture.d.ts +21 -1
- package/dist/headless/mic-capture.d.ts.map +1 -1
- package/dist/headless/mic-capture.js +95 -1
- package/dist/headless/mic-capture.js.map +1 -1
- package/dist/shared/constants.d.ts +1 -1
- package/dist/shared/constants.js +1 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/shared/recording-types.d.ts +12 -0
- package/dist/shared/recording-types.d.ts.map +1 -1
- package/mcp-server/dist/api-client.js +9 -0
- package/mcp-server/dist/index.js +87 -2
- package/package.json +2 -2
package/SUPERBASED_SKILL.md
CHANGED
|
@@ -217,14 +217,31 @@ Query past voice transcriptions.
|
|
|
217
217
|
### Recording & Visual QA
|
|
218
218
|
|
|
219
219
|
#### superbased_recording
|
|
220
|
-
Control automated screenshot recording sessions.
|
|
220
|
+
Control automated screenshot recording sessions. Supports 4 modes: interaction (desktop input hooks), periodic (fixed interval), smart (change detection — headless default), and monitor (smart + AI analysis loop).
|
|
221
221
|
|
|
222
222
|
| Parameter | Type | Description |
|
|
223
223
|
|-----------|------|-------------|
|
|
224
|
-
| `action` | `start` / `stop` / `pause` / `resume` / `status` / `capture` | Recording action |
|
|
224
|
+
| `action` | `start` / `stop` / `pause` / `resume` / `status` / `capture` / `get_analysis` | Recording action |
|
|
225
225
|
| `name` | string | Session name |
|
|
226
226
|
| `profile` | `automated_test` / `bug_report` / `user_journey` / `compliance` | Recording profile |
|
|
227
227
|
| `targetApp` | string | Process name to scope to |
|
|
228
|
+
| `mode` | `interaction` / `periodic` / `smart` / `monitor` | Recording mode (default: smart for headless, interaction for desktop) |
|
|
229
|
+
| `interval` | number | Capture interval in seconds (default: 3 for smart, 5 for monitor) |
|
|
230
|
+
| `changeThreshold` | number | 0-1, minimum visual change to trigger capture (default: 0.05 = 5%) |
|
|
231
|
+
| `analysisPrompt` | string | Custom AI instruction for monitor mode (e.g. "Flag any errors or test failures") |
|
|
232
|
+
| `analyzeEvery` | number | AI analysis every N significant frames (monitor mode, default: 5) |
|
|
233
|
+
| `analyzeInterval` | number | Minimum seconds between AI analyses (monitor mode, default: 30) |
|
|
234
|
+
| `analysisDetail` | `low` / `high` | Image resolution for AI: low=512px, high=1024px (monitor mode, default: low) |
|
|
235
|
+
| `sessionId` | string | Session ID (for `get_analysis` action) |
|
|
236
|
+
| `since` | number | Only analyses after frame N (for `get_analysis` action) |
|
|
237
|
+
|
|
238
|
+
**Recording modes:**
|
|
239
|
+
- **`smart`** (recommended for headless/MCP): Captures at interval, but only saves frames when the screen visually changes by more than the threshold. Efficient — no redundant frames.
|
|
240
|
+
- **`monitor`**: Like smart, but periodically sends captured frames to AI for analysis. AI flags errors, warnings, or unexpected states. Alerts are sent as MCP notifications and stored on frames. Use `get_analysis` to retrieve all AI analyses for a session.
|
|
241
|
+
- **`periodic`**: Captures every N seconds regardless of changes. Simple time-lapse.
|
|
242
|
+
- **`interaction`**: Desktop only — captures on clicks, keystrokes, scrolls (requires input hooks).
|
|
243
|
+
|
|
244
|
+
**Monitor mode token budget:** Control AI costs with `analyzeEvery` (frames between AI calls) and `analyzeInterval` (minimum seconds between AI calls). Use `analysisDetail=low` to send 512px images (fewer tokens).
|
|
228
245
|
|
|
229
246
|
#### superbased_sessions
|
|
230
247
|
List past recording sessions and their frames.
|
|
@@ -364,6 +381,22 @@ superbased_dictate mic=true duration=15
|
|
|
364
381
|
```
|
|
365
382
|
Records from the microphone for 15 seconds, transcribes with cleanup.
|
|
366
383
|
|
|
384
|
+
### Smart screen recording (change detection)
|
|
385
|
+
```
|
|
386
|
+
superbased_recording action=start name="Testing checkout" mode=smart interval=2
|
|
387
|
+
(do things on screen — only visual changes are captured)
|
|
388
|
+
superbased_recording action=stop
|
|
389
|
+
superbased_sessions action=frames sessionId=<id>
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Proactive screen monitoring
|
|
393
|
+
```
|
|
394
|
+
superbased_recording action=start mode=monitor name="Deploy watch" analysisPrompt="Flag any errors, failed health checks, or red status indicators" analyzeEvery=3 analyzeInterval=20
|
|
395
|
+
(AI will analyze frames and alert via MCP notifications)
|
|
396
|
+
superbased_recording action=get_analysis sessionId=<id>
|
|
397
|
+
superbased_recording action=stop
|
|
398
|
+
```
|
|
399
|
+
|
|
367
400
|
### Visual regression testing
|
|
368
401
|
```
|
|
369
402
|
1. superbased_recording action=start name="Before: login flow" profile=automated_test
|
|
@@ -406,6 +439,9 @@ superbased_compress_text text="<large text content>" preset=compact theme=dark
|
|
|
406
439
|
- **Redact before sharing** — use `superbased_redact` to remove API keys and PII
|
|
407
440
|
- **Mic dictation** — `superbased_dictate mic=true` records live audio, no file needed
|
|
408
441
|
- **Visual QA workflow**: record -> change -> record -> diff -> report
|
|
442
|
+
- **Smart recording** — use `mode=smart` to only capture when the screen changes (no redundant frames)
|
|
443
|
+
- **Monitor mode** — use `mode=monitor` for proactive AI screen watching; the AI will flag errors and unexpected states
|
|
444
|
+
- **Monitor token control** — set `analyzeEvery=10 analyzeInterval=60` to reduce AI calls during long monitoring sessions
|
|
409
445
|
- **Clipboard image** — `superbased_clipboard action=readImage` shows whatever image the user copied
|
|
410
446
|
|
|
411
447
|
## Troubleshooting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../electron/core/platform.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,QAAQ;IACvB,UAAU,IAAI,MAAM,CAAC;IACrB,UAAU,IAAI,MAAM,CAAC;IACrB,UAAU,IAAI,MAAM,CAAC;IACrB,aAAa,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,gBAAgB,IAAI,MAAM,CAAC;IAC3B,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../electron/core/platform.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,QAAQ;IACvB,UAAU,IAAI,MAAM,CAAC;IACrB,UAAU,IAAI,MAAM,CAAC;IACrB,UAAU,IAAI,MAAM,CAAC;IACrB,aAAa,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,gBAAgB,IAAI,MAAM,CAAC;IAC3B,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC,CAAC;IAC3F,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,IAAI,OAAO,CAAC;CACvB;AAID,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,CAE7C;AAED,wBAAgB,WAAW,IAAI,QAAQ,CAGtC"}
|
package/dist/electron/main.js
CHANGED
|
@@ -159,7 +159,7 @@ function framelessWindowOptions() {
|
|
|
159
159
|
return {
|
|
160
160
|
titleBarStyle: 'hidden',
|
|
161
161
|
trafficLightPosition: { x: 12, y: 12 },
|
|
162
|
-
fullscreenable:
|
|
162
|
+
fullscreenable: true,
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
return { frame: false, icon: getAppIcon() };
|
|
@@ -226,10 +226,21 @@ function attachCrashHandlers(win, windowName) {
|
|
|
226
226
|
}
|
|
227
227
|
function isPathSafe(filePath) {
|
|
228
228
|
const resolved = path.resolve(filePath);
|
|
229
|
+
if (resolved.includes('..'))
|
|
230
|
+
return false;
|
|
229
231
|
const capturesDir = getCapturesDir();
|
|
230
232
|
const userDataDir = electron_1.app.getPath('userData');
|
|
231
233
|
const tempDir = electron_1.app.getPath('temp');
|
|
232
|
-
|
|
234
|
+
if (resolved.startsWith(capturesDir) || resolved.startsWith(userDataDir) || resolved.startsWith(tempDir)) {
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
// Allow project-specific MCP captures: {projectDir}/.superbased/captures/
|
|
238
|
+
const sep = path.sep;
|
|
239
|
+
const marker = `${sep}.superbased${sep}captures${sep}`;
|
|
240
|
+
if (resolved.includes(marker) && path.isAbsolute(resolved) && fs.existsSync(resolved)) {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
return false;
|
|
233
244
|
}
|
|
234
245
|
function getCapturesDir() {
|
|
235
246
|
const custom = (0, store_1.getSetting)('screenshotFolder');
|
|
@@ -355,6 +366,13 @@ async function createSelectionWindowInner() {
|
|
|
355
366
|
selectionWindow.setAlwaysOnTop(true, 'screen-saver');
|
|
356
367
|
selectionWindow.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
|
|
357
368
|
}
|
|
369
|
+
// Fallback Escape key handler at the main-process level (macOS simpleFullscreen
|
|
370
|
+
// can sometimes swallow renderer keyboard events)
|
|
371
|
+
selectionWindow.webContents.on('before-input-event', (_event, input) => {
|
|
372
|
+
if (input.key === 'Escape' && input.type === 'keyDown') {
|
|
373
|
+
closeSelectionWindow();
|
|
374
|
+
}
|
|
375
|
+
});
|
|
358
376
|
attachCrashHandlers(selectionWindow, 'selection');
|
|
359
377
|
selectionWindow.loadFile(path.join(__dirname, '../renderer/selection.html'));
|
|
360
378
|
selectionWindow.setIgnoreMouseEvents(false);
|
|
@@ -441,7 +459,20 @@ function createOverlayWindow(initData, region) {
|
|
|
441
459
|
// Show on all workspaces so overlay appears on fullscreen app spaces
|
|
442
460
|
overlayWindow.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
|
|
443
461
|
}
|
|
444
|
-
|
|
462
|
+
// Bring overlay above other app windows (e.g. gallery) on creation
|
|
463
|
+
overlayWindow.once('ready-to-show', () => {
|
|
464
|
+
if (overlayWindow && !overlayWindow.isDestroyed()) {
|
|
465
|
+
overlayWindow.show();
|
|
466
|
+
overlayWindow.setAlwaysOnTop(true);
|
|
467
|
+
overlayWindow.focus();
|
|
468
|
+
// Drop back to normal z-order after a tick so it doesn't stay permanently on top
|
|
469
|
+
setTimeout(() => {
|
|
470
|
+
if (overlayWindow && !overlayWindow.isDestroyed()) {
|
|
471
|
+
overlayWindow.setAlwaysOnTop(false);
|
|
472
|
+
}
|
|
473
|
+
}, 300);
|
|
474
|
+
}
|
|
475
|
+
});
|
|
445
476
|
overlayWindow.loadFile(path.join(__dirname, '../renderer/overlay.html'));
|
|
446
477
|
overlayWindow.webContents.on('did-finish-load', () => {
|
|
447
478
|
logger_1.default.info(`[Overlay] did-finish-load, sending init: screenshotPath=${initData.screenshotPath}, regionScreenshots=${(initData.regionScreenshots || []).length}`);
|
|
@@ -832,6 +863,7 @@ function setupIpcHandlers() {
|
|
|
832
863
|
// Show overlay again and notify it of the new screenshot
|
|
833
864
|
if (overlayWindow && !overlayWindow.isDestroyed()) {
|
|
834
865
|
overlayWindow.show();
|
|
866
|
+
overlayWindow.focus();
|
|
835
867
|
overlayWindow.webContents.send('capture:screenshot-added', filepath);
|
|
836
868
|
}
|
|
837
869
|
return { success: true, filepath };
|
|
@@ -994,7 +1026,7 @@ function setupIpcHandlers() {
|
|
|
994
1026
|
createSelectionWindow();
|
|
995
1027
|
return { success: true };
|
|
996
1028
|
});
|
|
997
|
-
electron_1.ipcMain.handle('ai:process', async (
|
|
1029
|
+
electron_1.ipcMain.handle('ai:process', async (event, data) => {
|
|
998
1030
|
// Require authentication for AI features
|
|
999
1031
|
if (!(0, auth_1.isAuthenticated)()) {
|
|
1000
1032
|
return { success: false, error: 'Please sign in to use AI features.' };
|
|
@@ -1037,8 +1069,8 @@ function setupIpcHandlers() {
|
|
|
1037
1069
|
const megapixels = sizeBytes / (3 * 1024 * 1024);
|
|
1038
1070
|
totalEstTokens += Math.max(1600, Math.round(megapixels * 1600));
|
|
1039
1071
|
}
|
|
1040
|
-
if (totalEstTokens > 80000 &&
|
|
1041
|
-
|
|
1072
|
+
if (totalEstTokens > 80000 && !event.sender.isDestroyed()) {
|
|
1073
|
+
event.sender.send('ai:token-warning', {
|
|
1042
1074
|
estimatedTokens: totalEstTokens,
|
|
1043
1075
|
imageCount: imagesBase64.length,
|
|
1044
1076
|
});
|
|
@@ -1063,15 +1095,15 @@ function setupIpcHandlers() {
|
|
|
1063
1095
|
})) {
|
|
1064
1096
|
fullResponse += chunk;
|
|
1065
1097
|
chunksSent++;
|
|
1066
|
-
if (
|
|
1067
|
-
|
|
1098
|
+
if (!event.sender.isDestroyed()) {
|
|
1099
|
+
event.sender.send('ai:stream-chunk', chunk);
|
|
1068
1100
|
}
|
|
1069
1101
|
}
|
|
1070
1102
|
logger_1.default.info(`[AI] Stream finished. Chunks sent: ${chunksSent}, Response length: ${fullResponse.length}`);
|
|
1071
1103
|
logger_1.default.info(`[AI] First 200 chars: ${fullResponse.slice(0, 200)}`);
|
|
1072
|
-
if (
|
|
1073
|
-
|
|
1074
|
-
logger_1.default.info('[AI] Sent stream-complete to
|
|
1104
|
+
if (!event.sender.isDestroyed()) {
|
|
1105
|
+
event.sender.send('ai:stream-complete');
|
|
1106
|
+
logger_1.default.info('[AI] Sent stream-complete to sender');
|
|
1075
1107
|
}
|
|
1076
1108
|
(0, database_1.updateCapture)(data.captureId, {
|
|
1077
1109
|
aiResponse: fullResponse,
|
|
@@ -1083,8 +1115,8 @@ function setupIpcHandlers() {
|
|
|
1083
1115
|
}
|
|
1084
1116
|
catch (error) {
|
|
1085
1117
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
1086
|
-
if (
|
|
1087
|
-
|
|
1118
|
+
if (!event.sender.isDestroyed()) {
|
|
1119
|
+
event.sender.send('ai:stream-error', errorMsg);
|
|
1088
1120
|
}
|
|
1089
1121
|
return { success: false, error: errorMsg };
|
|
1090
1122
|
}
|
|
@@ -1707,6 +1739,42 @@ function setupIpcHandlers() {
|
|
|
1707
1739
|
return { success: false, error: String(error) };
|
|
1708
1740
|
}
|
|
1709
1741
|
});
|
|
1742
|
+
// Merge multiple screenshots into a single image file and return its path
|
|
1743
|
+
electron_1.ipcMain.handle('overlay:merge-to-file', async (_event, filepaths) => {
|
|
1744
|
+
try {
|
|
1745
|
+
if (filepaths.length <= 1) {
|
|
1746
|
+
return { success: true, path: filepaths[0] };
|
|
1747
|
+
}
|
|
1748
|
+
const sharp = require('sharp');
|
|
1749
|
+
const metas = await Promise.all(filepaths.map(async (fp) => {
|
|
1750
|
+
const meta = await sharp(fp).metadata();
|
|
1751
|
+
return { path: fp, width: meta.width || 200, height: meta.height || 200 };
|
|
1752
|
+
}));
|
|
1753
|
+
const gap = 4;
|
|
1754
|
+
const totalWidth = metas.reduce((sum, m) => sum + m.width, 0) + gap * (metas.length - 1);
|
|
1755
|
+
const maxHeight = Math.max(...metas.map((m) => m.height));
|
|
1756
|
+
const compositeInputs = [];
|
|
1757
|
+
let xOffset = 0;
|
|
1758
|
+
for (const m of metas) {
|
|
1759
|
+
compositeInputs.push({ input: m.path, left: xOffset, top: Math.round((maxHeight - m.height) / 2) });
|
|
1760
|
+
xOffset += m.width + gap;
|
|
1761
|
+
}
|
|
1762
|
+
const exportDir = getCapturesDir();
|
|
1763
|
+
ensureCapturesDir();
|
|
1764
|
+
const mergedPath = path.join(exportDir, `merged-${Date.now()}.png`);
|
|
1765
|
+
await sharp({
|
|
1766
|
+
create: { width: totalWidth, height: maxHeight, channels: 4, background: { r: 0, g: 0, b: 0, alpha: 0 } },
|
|
1767
|
+
})
|
|
1768
|
+
.composite(compositeInputs)
|
|
1769
|
+
.png()
|
|
1770
|
+
.toFile(mergedPath);
|
|
1771
|
+
return { success: true, path: mergedPath };
|
|
1772
|
+
}
|
|
1773
|
+
catch (err) {
|
|
1774
|
+
logger_1.default.error('[Copy] Merge-to-file failed:', err);
|
|
1775
|
+
return { success: false, error: err instanceof Error ? err.message : String(err) };
|
|
1776
|
+
}
|
|
1777
|
+
});
|
|
1710
1778
|
// Export screenshots to user's folder and copy file paths to clipboard
|
|
1711
1779
|
// mode: 'files' = copy as file drop list, 'paths' = copy paths as text
|
|
1712
1780
|
electron_1.ipcMain.handle('overlay:export-screenshots', async (_event, data) => {
|
|
@@ -2007,6 +2075,20 @@ function setupIpcHandlers() {
|
|
|
2007
2075
|
return { success: false, error: err instanceof Error ? err.message : String(err) };
|
|
2008
2076
|
}
|
|
2009
2077
|
});
|
|
2078
|
+
// Show file in OS file manager (Finder on macOS, Explorer on Windows)
|
|
2079
|
+
electron_1.ipcMain.handle('shell:show-in-folder', async (_event, filepath) => {
|
|
2080
|
+
try {
|
|
2081
|
+
if (!isPathSafe(filepath)) {
|
|
2082
|
+
return { success: false, error: 'Invalid file path' };
|
|
2083
|
+
}
|
|
2084
|
+
const { shell } = require('electron');
|
|
2085
|
+
shell.showItemInFolder(filepath);
|
|
2086
|
+
return { success: true };
|
|
2087
|
+
}
|
|
2088
|
+
catch (err) {
|
|
2089
|
+
return { success: false, error: err instanceof Error ? err.message : String(err) };
|
|
2090
|
+
}
|
|
2091
|
+
});
|
|
2010
2092
|
// Thumbnail cache: generate 256px thumbnails for gallery
|
|
2011
2093
|
// thumbnailCache is declared at module level above
|
|
2012
2094
|
electron_1.ipcMain.handle('capture:get-thumbnail', async (_event, imagePath) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-window.d.ts","sourceRoot":"","sources":["../../../electron/modules/active-window.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"active-window.d.ts","sourceRoot":"","sources":["../../../electron/modules/active-window.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAID,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CA+BrE"}
|
|
@@ -39,8 +39,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.getActiveWindowInfo = getActiveWindowInfo;
|
|
40
40
|
// Detects the currently active window for capture metadata
|
|
41
41
|
const logger_1 = __importDefault(require("../logger"));
|
|
42
|
+
const platform_1 = require("../core/platform");
|
|
42
43
|
let activeWinErrorLogged = false;
|
|
43
44
|
async function getActiveWindowInfo() {
|
|
45
|
+
// active-win is a native module compiled for Electron's Node.js.
|
|
46
|
+
// In headless mode (system Node.js), loading the native binding crashes
|
|
47
|
+
// at the C++ level (NODE_MODULE_VERSION mismatch) which can't be caught
|
|
48
|
+
// by try/catch. Skip it entirely outside Electron.
|
|
49
|
+
if (!(0, platform_1.getPlatform)().isElectron()) {
|
|
50
|
+
return { appName: null, windowTitle: null };
|
|
51
|
+
}
|
|
44
52
|
try {
|
|
45
53
|
// active-win is ESM-only, use dynamic import
|
|
46
54
|
const activeWin = await Promise.resolve().then(() => __importStar(require('active-win')));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-window.js","sourceRoot":"","sources":["../../../electron/modules/active-window.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"active-window.js","sourceRoot":"","sources":["../../../electron/modules/active-window.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,kDA+BC;AA1CD,2DAA2D;AAC3D,uDAA4B;AAC5B,+CAA+C;AAO/C,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAE1B,KAAK,UAAU,mBAAmB;IACvC,iEAAiE;IACjE,wEAAwE;IACxE,wEAAwE;IACxE,mDAAmD;IACnD,IAAI,CAAC,IAAA,sBAAW,GAAE,CAAC,UAAU,EAAE,EAAE,CAAC;QAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;IAED,IAAI,CAAC;QACH,6CAA6C;QAC7C,MAAM,SAAS,GAAG,wDAAa,YAAY,GAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC;QACzC,IAAI,MAAM,EAAE,CAAC;YACX,oBAAoB,GAAG,KAAK,CAAC,CAAC,mBAAmB;YACjD,OAAO;gBACL,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,IAAI;gBACnC,WAAW,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI;aAClC,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4EAA4E;QAC5E,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,gBAAG,CAAC,IAAI,CAAC,6DAA6D,EAAE,KAAK,CAAC,CAAC;YAC/E,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;gBAClC,gBAAG,CAAC,IAAI,CAAC,6GAA6G,CAAC,CAAC;YAC1H,CAAC;YACD,oBAAoB,GAAG,IAAI,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-server.d.ts","sourceRoot":"","sources":["../../../electron/modules/api-server.ts"],"names":[],"mappings":"AAIA,OAAgB,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AA2oBjF,wBAAgB,+BAA+B,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"api-server.d.ts","sourceRoot":"","sources":["../../../electron/modules/api-server.ts"],"names":[],"mappings":"AAIA,OAAgB,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AA2oBjF,wBAAgB,+BAA+B,IAAI,IAAI,CA6StD;AAgrBD,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAmCpD;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAOnD;AAED,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,YAAY,IAAI,eAAe,GAAG,IAAI,CAErD;AAED,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
|
|
@@ -641,9 +641,21 @@ function registerRecordingRoutesOnServer() {
|
|
|
641
641
|
targetProcessName: body.targetProcessName,
|
|
642
642
|
targetWindowTitle: body.targetWindowTitle,
|
|
643
643
|
showInGallery: body.showInGallery !== false,
|
|
644
|
+
mode: body.mode,
|
|
645
|
+
interval: body.interval,
|
|
646
|
+
changeThreshold: body.changeThreshold,
|
|
644
647
|
};
|
|
648
|
+
// Monitor mode settings
|
|
649
|
+
if (body.mode === 'monitor') {
|
|
650
|
+
options.monitor = {
|
|
651
|
+
analysisPrompt: body.analysisPrompt || 'Describe what changed on screen. Flag any errors, warnings, unexpected states, or UI issues.',
|
|
652
|
+
analyzeEvery: body.analyzeEvery ?? 5,
|
|
653
|
+
analyzeInterval: body.analyzeInterval ?? 30,
|
|
654
|
+
analysisDetail: body.analysisDetail || 'low',
|
|
655
|
+
};
|
|
656
|
+
}
|
|
645
657
|
const session = await startSession(options);
|
|
646
|
-
return reply.code(200).send({ sessionId: session.id, status: 'recording' });
|
|
658
|
+
return reply.code(200).send({ sessionId: session.id, status: 'recording', mode: session.mode });
|
|
647
659
|
}
|
|
648
660
|
catch (err) {
|
|
649
661
|
return reply.code(400).send({ error: err instanceof Error ? err.message : String(err) });
|
|
@@ -698,6 +710,7 @@ function registerRecordingRoutesOnServer() {
|
|
|
698
710
|
sessionId: session.id,
|
|
699
711
|
frameCount: session.frameCount,
|
|
700
712
|
duration: Date.now() - session.startedAt,
|
|
713
|
+
mode: session.mode,
|
|
701
714
|
});
|
|
702
715
|
});
|
|
703
716
|
// POST /api/recording/capture
|
|
@@ -709,6 +722,87 @@ function registerRecordingRoutesOnServer() {
|
|
|
709
722
|
triggerManualCapture();
|
|
710
723
|
return reply.code(200).send({ success: true, message: 'Manual capture triggered' });
|
|
711
724
|
});
|
|
725
|
+
// GET /api/recording/analysis — get AI analysis results for a session
|
|
726
|
+
s.get('/api/recording/analysis', async (request, reply) => {
|
|
727
|
+
try {
|
|
728
|
+
const query = request.query;
|
|
729
|
+
if (!query.sessionId) {
|
|
730
|
+
return reply.code(400).send({ error: 'sessionId query param required' });
|
|
731
|
+
}
|
|
732
|
+
const { getDatabase } = await Promise.resolve().then(() => __importStar(require('../db/database')));
|
|
733
|
+
const db = getDatabase();
|
|
734
|
+
const sinceFrame = query.since ? parseInt(query.since, 10) : 0;
|
|
735
|
+
const rows = db.prepare(`SELECT id, frame_number, timestamp, ai_response
|
|
736
|
+
FROM captures
|
|
737
|
+
WHERE session_id = ? AND ai_response IS NOT NULL AND ai_response != '' AND frame_number > ?
|
|
738
|
+
ORDER BY frame_number ASC`).all(query.sessionId, sinceFrame);
|
|
739
|
+
const analyses = rows.map((r) => ({
|
|
740
|
+
frameId: r.id,
|
|
741
|
+
frameNumber: r.frame_number,
|
|
742
|
+
timestamp: r.timestamp,
|
|
743
|
+
analysis: r.ai_response,
|
|
744
|
+
}));
|
|
745
|
+
return reply.code(200).send({ sessionId: query.sessionId, analyses });
|
|
746
|
+
}
|
|
747
|
+
catch (err) {
|
|
748
|
+
return reply.code(500).send({ error: err instanceof Error ? err.message : String(err) });
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
// GET /api/recording/monitor/status — monitor mode status
|
|
752
|
+
s.get('/api/recording/monitor/status', async (_request, reply) => {
|
|
753
|
+
const session = getCurrentSession();
|
|
754
|
+
if (!session || session.mode !== 'monitor') {
|
|
755
|
+
return reply.code(200).send({ status: 'inactive' });
|
|
756
|
+
}
|
|
757
|
+
const { getMonitorAnalyzer } = await Promise.resolve().then(() => __importStar(require('./recording/recording-session')));
|
|
758
|
+
const analyzer = getMonitorAnalyzer();
|
|
759
|
+
return reply.code(200).send({
|
|
760
|
+
status: 'monitoring',
|
|
761
|
+
sessionId: session.id,
|
|
762
|
+
mode: session.mode,
|
|
763
|
+
frameCount: session.frameCount,
|
|
764
|
+
alertCount: analyzer?.getAlertCount() || 0,
|
|
765
|
+
lastAnalysis: analyzer?.getLastAnalysis() || null,
|
|
766
|
+
});
|
|
767
|
+
});
|
|
768
|
+
// GET /api/recording/monitor/stream — SSE stream of monitor alerts
|
|
769
|
+
s.get('/api/recording/monitor/stream', async (request, reply) => {
|
|
770
|
+
const session = getCurrentSession();
|
|
771
|
+
if (!session || session.mode !== 'monitor') {
|
|
772
|
+
return reply.code(400).send({ error: 'No active monitor session' });
|
|
773
|
+
}
|
|
774
|
+
// Set up SSE headers
|
|
775
|
+
reply.raw.writeHead(200, {
|
|
776
|
+
'Content-Type': 'text/event-stream',
|
|
777
|
+
'Cache-Control': 'no-cache',
|
|
778
|
+
'Connection': 'keep-alive',
|
|
779
|
+
'X-Accel-Buffering': 'no',
|
|
780
|
+
});
|
|
781
|
+
reply.raw.write('event: connected\ndata: {"sessionId":"' + session.id + '"}\n\n');
|
|
782
|
+
// Register alert callback
|
|
783
|
+
const { setMonitorAlertCallback } = await Promise.resolve().then(() => __importStar(require('./recording/recording-session')));
|
|
784
|
+
const alertHandler = (alert) => {
|
|
785
|
+
const data = JSON.stringify(alert);
|
|
786
|
+
reply.raw.write(`event: alert\ndata: ${data}\n\n`);
|
|
787
|
+
};
|
|
788
|
+
setMonitorAlertCallback(alertHandler);
|
|
789
|
+
// Send keepalive every 15 seconds
|
|
790
|
+
const keepalive = setInterval(() => {
|
|
791
|
+
try {
|
|
792
|
+
reply.raw.write(':keepalive\n\n');
|
|
793
|
+
}
|
|
794
|
+
catch {
|
|
795
|
+
clearInterval(keepalive);
|
|
796
|
+
}
|
|
797
|
+
}, 15000);
|
|
798
|
+
// Cleanup on client disconnect
|
|
799
|
+
request.raw.on('close', () => {
|
|
800
|
+
clearInterval(keepalive);
|
|
801
|
+
setMonitorAlertCallback(() => { }); // Remove handler
|
|
802
|
+
});
|
|
803
|
+
// Don't send reply body — SSE uses raw stream
|
|
804
|
+
return reply;
|
|
805
|
+
});
|
|
712
806
|
// GET /api/sessions
|
|
713
807
|
s.get('/api/sessions', async (_request, reply) => {
|
|
714
808
|
const sessions = getRecordingSessions(100);
|
|
@@ -837,8 +931,9 @@ function registerExpandedRoutes(server) {
|
|
|
837
931
|
if (body.projectDir && !isValidProjectDir(body.projectDir)) {
|
|
838
932
|
return reply.code(400).send({ error: 'Invalid projectDir' });
|
|
839
933
|
}
|
|
840
|
-
// Window targeting: find matching window
|
|
934
|
+
// Window targeting: find matching window, bring to foreground, then capture
|
|
841
935
|
let windowInfo = null;
|
|
936
|
+
let buffer = null;
|
|
842
937
|
if (body.window) {
|
|
843
938
|
const sources = await (0, platform_1.getPlatform)().listWindows();
|
|
844
939
|
const match = sources.find((s) => s.name.toLowerCase().includes(body.window.toLowerCase()));
|
|
@@ -846,8 +941,139 @@ function registerExpandedRoutes(server) {
|
|
|
846
941
|
return reply.code(404).send({ error: `No window matching "${body.window}"`, availableWindows: sources.map((s) => s.name) });
|
|
847
942
|
}
|
|
848
943
|
windowInfo = { appName: match.name, windowTitle: match.name };
|
|
944
|
+
// Bring target window to foreground, capture, then restore original window.
|
|
945
|
+
// Uses a temp .ps1 script with Win32 P/Invoke to handle minimized windows
|
|
946
|
+
// and bypass SetForegroundWindow restrictions (AttachThreadInput trick).
|
|
947
|
+
const { execSync: execSyncCapture } = require('child_process');
|
|
948
|
+
const osMod = require('os');
|
|
949
|
+
const pathMod = require('path');
|
|
950
|
+
const fsMod = require('fs');
|
|
951
|
+
try {
|
|
952
|
+
if (process.platform === 'win32') {
|
|
953
|
+
const hwnd = match.hwnd;
|
|
954
|
+
let previousHwnd = null;
|
|
955
|
+
if (hwnd) {
|
|
956
|
+
const activateScript = pathMod.join(osMod.tmpdir(), 'superbased-activate.ps1');
|
|
957
|
+
fsMod.writeFileSync(activateScript, `
|
|
958
|
+
param([long]$TargetHwnd)
|
|
959
|
+
Add-Type -TypeDefinition @'
|
|
960
|
+
using System; using System.Runtime.InteropServices;
|
|
961
|
+
public class WinActivate {
|
|
962
|
+
[DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow();
|
|
963
|
+
[DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr h, int c);
|
|
964
|
+
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr h);
|
|
965
|
+
[DllImport("user32.dll")] public static extern bool BringWindowToTop(IntPtr h);
|
|
966
|
+
[DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr h, out uint pid);
|
|
967
|
+
[DllImport("kernel32.dll")] public static extern uint GetCurrentThreadId();
|
|
968
|
+
[DllImport("user32.dll")] public static extern bool AttachThreadInput(uint a, uint b, bool attach);
|
|
969
|
+
[DllImport("user32.dll")] public static extern void keybd_event(byte vk, byte scan, uint flags, UIntPtr extra);
|
|
970
|
+
public static IntPtr Activate(IntPtr target) {
|
|
971
|
+
IntPtr prev = GetForegroundWindow();
|
|
972
|
+
uint dummy;
|
|
973
|
+
uint fgThread = GetWindowThreadProcessId(prev, out dummy);
|
|
974
|
+
uint curThread = GetCurrentThreadId();
|
|
975
|
+
AttachThreadInput(curThread, fgThread, true);
|
|
976
|
+
ShowWindow(target, 9);
|
|
977
|
+
keybd_event(0x12, 0, 1, UIntPtr.Zero);
|
|
978
|
+
keybd_event(0x12, 0, 3, UIntPtr.Zero);
|
|
979
|
+
SetForegroundWindow(target);
|
|
980
|
+
BringWindowToTop(target);
|
|
981
|
+
AttachThreadInput(curThread, fgThread, false);
|
|
982
|
+
return prev;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
'@
|
|
986
|
+
$h = [IntPtr]::new($TargetHwnd)
|
|
987
|
+
$prev = [WinActivate]::Activate($h)
|
|
988
|
+
$prev.ToInt64()
|
|
989
|
+
`);
|
|
990
|
+
try {
|
|
991
|
+
previousHwnd = execSyncCapture(`powershell -ExecutionPolicy Bypass -File "${activateScript}" -TargetHwnd ${hwnd}`, { encoding: 'utf-8', timeout: 5000, stdio: 'pipe' }).trim();
|
|
992
|
+
}
|
|
993
|
+
catch { /* ignore */ }
|
|
994
|
+
try {
|
|
995
|
+
fsMod.unlinkSync(activateScript);
|
|
996
|
+
}
|
|
997
|
+
catch { /* cleanup */ }
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
// Fallback: use AppActivate by title
|
|
1001
|
+
const escapedTitle = match.name.replace(/'/g, "''");
|
|
1002
|
+
execSyncCapture(`powershell -command "(New-Object -ComObject WScript.Shell).AppActivate('${escapedTitle}')"`, { timeout: 3000, stdio: 'pipe' });
|
|
1003
|
+
}
|
|
1004
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
1005
|
+
// Capture while target is in foreground
|
|
1006
|
+
buffer = await (0, capture_1.captureScreen)();
|
|
1007
|
+
// Restore the original window
|
|
1008
|
+
if (previousHwnd && previousHwnd !== '0' && hwnd) {
|
|
1009
|
+
const restoreScript = pathMod.join(osMod.tmpdir(), 'superbased-restore.ps1');
|
|
1010
|
+
fsMod.writeFileSync(restoreScript, `
|
|
1011
|
+
param([long]$Hwnd)
|
|
1012
|
+
Add-Type -TypeDefinition @'
|
|
1013
|
+
using System; using System.Runtime.InteropServices;
|
|
1014
|
+
public class WinRestore {
|
|
1015
|
+
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr h);
|
|
1016
|
+
[DllImport("user32.dll")] public static extern void keybd_event(byte vk, byte scan, uint flags, UIntPtr extra);
|
|
1017
|
+
public static void Restore(IntPtr target) {
|
|
1018
|
+
keybd_event(0x12, 0, 1, UIntPtr.Zero);
|
|
1019
|
+
keybd_event(0x12, 0, 3, UIntPtr.Zero);
|
|
1020
|
+
SetForegroundWindow(target);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
'@
|
|
1024
|
+
[WinRestore]::Restore([IntPtr]::new($Hwnd))
|
|
1025
|
+
`);
|
|
1026
|
+
try {
|
|
1027
|
+
execSyncCapture(`powershell -ExecutionPolicy Bypass -File "${restoreScript}" -Hwnd ${previousHwnd}`, { timeout: 3000, stdio: 'pipe' });
|
|
1028
|
+
}
|
|
1029
|
+
catch { /* ignore */ }
|
|
1030
|
+
try {
|
|
1031
|
+
fsMod.unlinkSync(restoreScript);
|
|
1032
|
+
}
|
|
1033
|
+
catch { /* cleanup */ }
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
else if (process.platform === 'darwin') {
|
|
1037
|
+
// macOS: use AppleScript to get frontmost app, activate target, capture, restore
|
|
1038
|
+
let previousApp = null;
|
|
1039
|
+
try {
|
|
1040
|
+
previousApp = execSyncCapture('osascript -e \'tell application "System Events" to get name of first process whose frontmost is true\'', { encoding: 'utf-8', timeout: 3000, stdio: 'pipe' }).trim();
|
|
1041
|
+
}
|
|
1042
|
+
catch { /* ignore */ }
|
|
1043
|
+
// Extract app name from window title (format: "AppName - WindowTitle")
|
|
1044
|
+
const dashIdx = match.name.indexOf(' - ');
|
|
1045
|
+
const appName = dashIdx !== -1 ? match.name.substring(0, dashIdx) : match.name;
|
|
1046
|
+
const windowTitle = dashIdx !== -1 ? match.name.substring(dashIdx + 3) : '';
|
|
1047
|
+
// Activate the target window
|
|
1048
|
+
const escapedApp = appName.replace(/"/g, '\\"');
|
|
1049
|
+
try {
|
|
1050
|
+
if (windowTitle) {
|
|
1051
|
+
execSyncCapture(`osascript -e 'tell application "${escapedApp}" to activate' -e 'delay 0.2' -e 'tell application "System Events" to tell process "${escapedApp}" to set frontmost to true'`, { timeout: 3000, stdio: 'pipe' });
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
execSyncCapture(`osascript -e 'tell application "${escapedApp}" to activate'`, { timeout: 3000, stdio: 'pipe' });
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
catch { /* ignore */ }
|
|
1058
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
1059
|
+
// Capture while target is in foreground
|
|
1060
|
+
buffer = await (0, capture_1.captureScreen)();
|
|
1061
|
+
// Restore the previous app
|
|
1062
|
+
if (previousApp) {
|
|
1063
|
+
try {
|
|
1064
|
+
const escapedPrev = previousApp.replace(/"/g, '\\"');
|
|
1065
|
+
execSyncCapture(`osascript -e 'tell application "${escapedPrev}" to activate'`, { timeout: 3000, stdio: 'pipe' });
|
|
1066
|
+
}
|
|
1067
|
+
catch { /* ignore */ }
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
catch {
|
|
1072
|
+
// Window activation failed — capture will get whatever is on screen
|
|
1073
|
+
}
|
|
849
1074
|
}
|
|
850
|
-
|
|
1075
|
+
if (!buffer)
|
|
1076
|
+
buffer = await (0, capture_1.captureScreen)();
|
|
851
1077
|
// Auto-redact if enabled
|
|
852
1078
|
const redactSecrets = !!(0, store_1.getSetting)('autoRedactSecrets');
|
|
853
1079
|
const redactPII = !!(0, store_1.getSetting)('autoRedactPII');
|
|
@@ -950,7 +1176,9 @@ function registerExpandedRoutes(server) {
|
|
|
950
1176
|
windows: sources.map((s) => ({
|
|
951
1177
|
id: s.id,
|
|
952
1178
|
name: s.name,
|
|
953
|
-
|
|
1179
|
+
hwnd: s.hwnd,
|
|
1180
|
+
minimized: s.minimized,
|
|
1181
|
+
isActive: active.windowTitle ? s.name === active.windowTitle : false,
|
|
954
1182
|
})),
|
|
955
1183
|
activeWindow: active,
|
|
956
1184
|
});
|