@vellumai/assistant 0.4.21 → 0.4.23
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/package.json +1 -1
- package/scripts/ipc/check-swift-decoder-drift.ts +55 -44
- package/src/__tests__/__snapshots__/ipc-snapshot.test.ts.snap +0 -75
- package/src/__tests__/headless-browser-interactions.test.ts +0 -4
- package/src/__tests__/ipc-snapshot.test.ts +0 -54
- package/src/__tests__/resolve-guardian-trust-class.test.ts +61 -0
- package/src/__tests__/session-init.benchmark.test.ts +0 -4
- package/src/config/system-prompt.ts +1 -0
- package/src/config/templates/BOOTSTRAP.md +21 -31
- package/src/config/templates/SOUL.md +19 -9
- package/src/daemon/computer-use-session.ts +5 -3
- package/src/daemon/daemon-control.ts +3 -0
- package/src/daemon/handlers/browser.ts +2 -48
- package/src/daemon/handlers/config-voice.ts +155 -33
- package/src/daemon/handlers/dictation.ts +361 -214
- package/src/daemon/ipc-contract/browser.ts +4 -74
- package/src/daemon/ipc-contract/surfaces.ts +51 -48
- package/src/daemon/ipc-contract-inventory.json +0 -7
- package/src/daemon/session-agent-loop.ts +2 -1
- package/src/daemon/session-runtime-assembly.ts +477 -247
- package/src/daemon/session-surfaces.ts +5 -3
- package/src/daemon/session-tool-setup.ts +27 -13
- package/src/memory/migrations/102-alter-table-columns.ts +254 -37
- package/src/memory/schema.ts +1227 -1035
- package/src/tools/browser/browser-execution.ts +314 -331
- package/src/tools/browser/browser-handoff.ts +11 -37
- package/src/tools/browser/browser-manager.ts +271 -264
- package/src/tools/browser/browser-screencast.ts +19 -75
|
@@ -1,71 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { isScreencastActive } from './browser-screencast.js';
|
|
1
|
+
import { getLogger } from "../../util/logger.js";
|
|
2
|
+
import { browserManager } from "./browser-manager.js";
|
|
3
|
+
import { isScreencastActive } from "./browser-screencast.js";
|
|
5
4
|
|
|
6
|
-
const log = getLogger(
|
|
5
|
+
const log = getLogger("browser-handoff");
|
|
7
6
|
|
|
8
7
|
export interface HandoffOptions {
|
|
9
|
-
reason:
|
|
8
|
+
reason: "auth" | "checkout" | "captcha" | "custom";
|
|
10
9
|
message: string;
|
|
11
10
|
bringToFront?: boolean;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Hand control to the user by enabling interactive mode and waiting for them to finish.
|
|
15
|
+
* The browser window is brought to the front, and we wait for the user to complete
|
|
16
|
+
* the action (detected via URL change) or a 5-minute timeout.
|
|
16
17
|
*/
|
|
17
18
|
export async function startHandoff(
|
|
18
19
|
sessionId: string,
|
|
19
|
-
sendToClient: (msg: ServerMessage) => void,
|
|
20
20
|
options: HandoffOptions,
|
|
21
21
|
): Promise<void> {
|
|
22
|
-
|
|
23
|
-
if (browserManager.browserMode === 'headless') {
|
|
24
|
-
log.info({ sessionId, reason: options.reason }, 'Skipping handoff in headless mode — no visible browser');
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
log.info({ sessionId, reason: options.reason }, 'Starting handoff to user');
|
|
22
|
+
log.info({ sessionId, reason: options.reason }, "Starting handoff to user");
|
|
29
23
|
|
|
30
24
|
// Bring Chrome to the front so the user can interact directly.
|
|
31
|
-
// The window is already sized/positioned in top-right via positionWindowSidebar(),
|
|
32
|
-
// so no repositioning needed.
|
|
33
25
|
if (options.bringToFront) {
|
|
34
26
|
try {
|
|
35
27
|
const page = await browserManager.getOrCreateSessionPage(sessionId);
|
|
36
28
|
await page.bringToFront();
|
|
37
29
|
} catch (err) {
|
|
38
|
-
log.warn({ err, sessionId },
|
|
30
|
+
log.warn({ err, sessionId }, "Failed to bring browser to front");
|
|
39
31
|
}
|
|
40
32
|
}
|
|
41
33
|
|
|
42
34
|
if (!isScreencastActive(sessionId)) {
|
|
43
|
-
log.warn({ sessionId },
|
|
35
|
+
log.warn({ sessionId }, "No active browser session for handoff");
|
|
44
36
|
return;
|
|
45
37
|
}
|
|
46
38
|
|
|
47
|
-
// Send interactive mode change with reason and message.
|
|
48
|
-
// surfaceId uses sessionId as a stable identifier since PiP surfaces are removed.
|
|
49
|
-
sendToClient({
|
|
50
|
-
type: 'browser_interactive_mode_changed',
|
|
51
|
-
sessionId,
|
|
52
|
-
surfaceId: sessionId,
|
|
53
|
-
enabled: true,
|
|
54
|
-
reason: options.reason,
|
|
55
|
-
message: options.message,
|
|
56
|
-
} as ServerMessage);
|
|
57
|
-
|
|
58
39
|
browserManager.setInteractiveMode(sessionId, true);
|
|
59
40
|
|
|
60
41
|
// Wait for user to hand back control (5 min timeout, or auto-detect URL change)
|
|
61
42
|
await browserManager.waitForHandoffComplete(sessionId);
|
|
62
43
|
|
|
63
|
-
|
|
64
|
-
type: 'browser_interactive_mode_changed',
|
|
65
|
-
sessionId,
|
|
66
|
-
surfaceId: sessionId,
|
|
67
|
-
enabled: false,
|
|
68
|
-
} as ServerMessage);
|
|
69
|
-
|
|
70
|
-
log.info({ sessionId }, 'Handoff complete, agent resuming');
|
|
44
|
+
log.info({ sessionId }, "Handoff complete, agent resuming");
|
|
71
45
|
}
|