@vellumai/assistant 0.10.7-dev.202607091922.eeb94f9 → 0.10.7-dev.202607091938.bdf217a

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.
@@ -44,7 +44,9 @@ const ALLOWED_PREFIXES = {
44
44
  // before issuing IPC calls (e.g. email, domain).
45
45
  "../../config/env",
46
46
  // Browser command's operation metadata (drives subcommand generation).
47
- "../../browser/operations",
47
+ // Deliberately the meta-only module: `../../browser/operations` would
48
+ // pull the Playwright-backed execution stack into every CLI start.
49
+ "../../browser/operation-meta",
48
50
  ],
49
51
  local: [
50
52
  "node:",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/assistant",
3
- "version": "0.10.7-dev.202607091922.eeb94f9",
3
+ "version": "0.10.7-dev.202607091938.bdf217a",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -0,0 +1,493 @@
1
+ /**
2
+ * Kept free of execution imports so CLI command registration does not load
3
+ * the Playwright-backed browser stack.
4
+ */
5
+
6
+ import type { BrowserOperationMeta } from "./types.js";
7
+
8
+ /**
9
+ * Metadata for every browser operation, describing fields, types, and
10
+ * constraints. Used by the CLI command builder to generate subcommands.
11
+ *
12
+ * The `browser_mode` field is handled as a shared parent-level option
13
+ * on the `assistant browser` command (--browser-mode), not as a
14
+ * per-operation field. The `activity` field is omitted because it is
15
+ * an internal execution concern, not a user-facing parameter.
16
+ */
17
+ export const BROWSER_OPERATION_META: readonly BrowserOperationMeta[] = [
18
+ {
19
+ operation: "navigate",
20
+ description: "Navigate the browser to a URL and return the page title.",
21
+ fields: [
22
+ {
23
+ name: "url",
24
+ type: "string",
25
+ description: "The URL to navigate to.",
26
+ required: true,
27
+ },
28
+ {
29
+ name: "allow_private_network",
30
+ type: "boolean",
31
+ description: "Allow navigation to localhost/private-network hosts.",
32
+ required: false,
33
+ },
34
+ {
35
+ name: "new_tab",
36
+ type: "boolean",
37
+ description:
38
+ "Force a brand-new browser tab even when this session already has a dedicated tab, and pin subsequent operations to it. Extension backend only; ignored on other backends.",
39
+ required: false,
40
+ },
41
+ {
42
+ name: "use_active_tab",
43
+ type: "boolean",
44
+ description:
45
+ "Navigate the currently-active browser tab instead of a dedicated tab. Extension backend only; ignored on other backends.",
46
+ required: false,
47
+ },
48
+ ],
49
+ helpText: `Loads the given URL and waits for the page to reach a stable state.
50
+ Returns the page title on success.
51
+
52
+ On the Chrome extension backend, navigate opens a dedicated tab the
53
+ first time it runs in a conversation and pins this session's
54
+ subsequent operations to it, so browsing never disturbs the tab
55
+ you're on (often the tab you're chatting with the assistant from).
56
+ Later navigates reuse that pinned tab.
57
+
58
+ Pass --new-tab to force a fresh tab even when one is already pinned,
59
+ or --use-active-tab to navigate the currently-active tab instead.
60
+
61
+ Examples:
62
+ $ assistant browser navigate --url https://example.com
63
+ $ assistant browser navigate --url http://localhost:3000 --allow-private-network
64
+ $ assistant browser navigate --url https://github.com --new-tab
65
+ $ assistant browser navigate --url https://github.com --use-active-tab
66
+ $ assistant browser --session s1 navigate --url https://github.com`,
67
+ },
68
+ {
69
+ operation: "snapshot",
70
+ description:
71
+ "List interactive elements on the current page with unique IDs.",
72
+ fields: [],
73
+ helpText: `Returns a structured list of interactive elements (buttons, links,
74
+ inputs, etc.) with stable element IDs that can be passed to click,
75
+ type, and other element-targeting commands.
76
+
77
+ Examples:
78
+ $ assistant browser snapshot
79
+ $ assistant browser --json snapshot`,
80
+ },
81
+ {
82
+ operation: "screenshot",
83
+ description: "Take a visual screenshot of the current page.",
84
+ fields: [
85
+ {
86
+ name: "full_page",
87
+ type: "boolean",
88
+ description:
89
+ "Capture the full scrollable page instead of just the viewport.",
90
+ required: false,
91
+ },
92
+ ],
93
+ helpText: `Captures a JPEG screenshot. Use --output to save to a file, or
94
+ --json to receive base64-encoded image data in the output.
95
+
96
+ Examples:
97
+ $ assistant browser screenshot --output page.jpg
98
+ $ assistant browser screenshot --full-page --output full.jpg
99
+ $ assistant browser --json screenshot`,
100
+ },
101
+ {
102
+ operation: "close",
103
+ description: "Close the browser page for the current conversation.",
104
+ fields: [
105
+ {
106
+ name: "close_all_pages",
107
+ type: "boolean",
108
+ description: "Close all browser pages and the browser context.",
109
+ required: false,
110
+ },
111
+ ],
112
+ helpText: `Closes the browser page for the current session. Use --close-all-pages
113
+ to tear down the entire browser context including all pages.
114
+
115
+ Examples:
116
+ $ assistant browser close
117
+ $ assistant browser close --close-all-pages
118
+ $ assistant browser --session s1 close`,
119
+ },
120
+ {
121
+ operation: "attach",
122
+ description: "Attach the Chrome debugger to the active browser tab.",
123
+ fields: [],
124
+ helpText: `Connects the assistant to a running Chrome instance via the Chrome
125
+ DevTools Protocol. Required before interacting with Chrome-attached tabs.
126
+
127
+ Examples:
128
+ $ assistant browser attach
129
+ $ assistant browser --session s1 attach`,
130
+ },
131
+ {
132
+ operation: "detach",
133
+ description: "Detach the Chrome debugger from the active browser tab.",
134
+ fields: [],
135
+ helpText: `Disconnects the assistant from the Chrome DevTools Protocol session.
136
+ The browser tab continues running but is no longer controlled.
137
+
138
+ Examples:
139
+ $ assistant browser detach
140
+ $ assistant browser --session s1 detach`,
141
+ },
142
+ {
143
+ operation: "click",
144
+ description: "Click an element on the page.",
145
+ fields: [
146
+ {
147
+ name: "element_id",
148
+ type: "string",
149
+ description: "Element ID from a previous browser snapshot.",
150
+ required: false,
151
+ },
152
+ {
153
+ name: "selector",
154
+ type: "string",
155
+ description: "CSS selector to target.",
156
+ required: false,
157
+ },
158
+ ],
159
+ helpText: `Clicks an element identified by element ID (from snapshot) or CSS
160
+ selector. Provide at least one of --element-id or --selector.
161
+
162
+ Examples:
163
+ $ assistant browser click --element-id e14
164
+ $ assistant browser click --selector "#login-button"
165
+ $ assistant browser click --selector "a.nav-link"`,
166
+ },
167
+ {
168
+ operation: "type",
169
+ description: "Type text into an input element.",
170
+ fields: [
171
+ {
172
+ name: "text",
173
+ type: "string",
174
+ description: "The text to type into the element.",
175
+ required: true,
176
+ },
177
+ {
178
+ name: "element_id",
179
+ type: "string",
180
+ description: "Element ID from a previous browser snapshot.",
181
+ required: false,
182
+ },
183
+ {
184
+ name: "selector",
185
+ type: "string",
186
+ description: "CSS selector to target.",
187
+ required: false,
188
+ },
189
+ {
190
+ name: "clear_first",
191
+ type: "boolean",
192
+ description: "Clear existing content before typing. Default: true.",
193
+ required: false,
194
+ },
195
+ {
196
+ name: "press_enter",
197
+ type: "boolean",
198
+ description: "Press Enter after typing the text.",
199
+ required: false,
200
+ },
201
+ ],
202
+ helpText: `Types text into the focused or targeted element. By default, existing
203
+ content is cleared first (--clear-first). Use --no-clear-first to
204
+ append to existing content. Use --press-enter to submit after typing.
205
+
206
+ Examples:
207
+ $ assistant browser type --text "hello world" --element-id e14
208
+ $ assistant browser type --text "search query" --selector "#search" --press-enter
209
+ $ assistant browser type --text "append this" --no-clear-first`,
210
+ },
211
+ {
212
+ operation: "press_key",
213
+ description: "Press a keyboard key, optionally targeting an element.",
214
+ fields: [
215
+ {
216
+ name: "key",
217
+ type: "string",
218
+ description:
219
+ 'The key to press (e.g. "Enter", "Escape", "Tab", "ArrowDown").',
220
+ required: true,
221
+ },
222
+ {
223
+ name: "element_id",
224
+ type: "string",
225
+ description: "Optional element ID from browser snapshot.",
226
+ required: false,
227
+ },
228
+ {
229
+ name: "selector",
230
+ type: "string",
231
+ description: "Optional CSS selector to target.",
232
+ required: false,
233
+ },
234
+ ],
235
+ helpText: `Sends a keyboard key press. If --element-id or --selector is given,
236
+ the key is dispatched to that element; otherwise to the focused element.
237
+
238
+ Examples:
239
+ $ assistant browser press-key --key Enter
240
+ $ assistant browser press-key --key Tab --element-id e5
241
+ $ assistant browser press-key --key Escape`,
242
+ },
243
+ {
244
+ operation: "scroll",
245
+ description: "Scroll the page or a specific element.",
246
+ fields: [
247
+ {
248
+ name: "direction",
249
+ type: "string",
250
+ description: "The direction to scroll.",
251
+ required: true,
252
+ enum: ["up", "down", "left", "right"],
253
+ },
254
+ {
255
+ name: "amount",
256
+ type: "number",
257
+ description: "The number of pixels to scroll. Default: 500.",
258
+ required: false,
259
+ },
260
+ {
261
+ name: "element_id",
262
+ type: "string",
263
+ description: "Optional element ID to scroll within.",
264
+ required: false,
265
+ },
266
+ {
267
+ name: "selector",
268
+ type: "string",
269
+ description: "Optional CSS selector of element to scroll within.",
270
+ required: false,
271
+ },
272
+ ],
273
+ helpText: `Scrolls the page or a specific scrollable element. Direction is
274
+ required; amount defaults to 500 pixels.
275
+
276
+ Examples:
277
+ $ assistant browser scroll --direction down
278
+ $ assistant browser scroll --direction up --amount 1000
279
+ $ assistant browser scroll --direction down --element-id e8`,
280
+ },
281
+ {
282
+ operation: "select_option",
283
+ description: "Select an option from a native <select> element.",
284
+ fields: [
285
+ {
286
+ name: "element_id",
287
+ type: "string",
288
+ description: "Element ID of the <select> from browser snapshot.",
289
+ required: false,
290
+ },
291
+ {
292
+ name: "selector",
293
+ type: "string",
294
+ description: "CSS selector for the <select> element.",
295
+ required: false,
296
+ },
297
+ {
298
+ name: "value",
299
+ type: "string",
300
+ description: "The value attribute of the <option> to select.",
301
+ required: false,
302
+ },
303
+ {
304
+ name: "label",
305
+ type: "string",
306
+ description: "The visible text of the <option> to select.",
307
+ required: false,
308
+ },
309
+ {
310
+ name: "index",
311
+ type: "number",
312
+ description: "The zero-based index of the <option> to select.",
313
+ required: false,
314
+ },
315
+ ],
316
+ helpText: `Selects an option in a <select> element by value, label, or index.
317
+ Provide at least one of --value, --label, or --index to identify
318
+ the option, and --element-id or --selector to identify the <select>.
319
+
320
+ Examples:
321
+ $ assistant browser select-option --element-id e12 --label "United States"
322
+ $ assistant browser select-option --selector "#country" --value "us"
323
+ $ assistant browser select-option --element-id e12 --index 3`,
324
+ },
325
+ {
326
+ operation: "hover",
327
+ description: "Hover over an element on the page.",
328
+ fields: [
329
+ {
330
+ name: "element_id",
331
+ type: "string",
332
+ description: "Element ID from a previous browser snapshot.",
333
+ required: false,
334
+ },
335
+ {
336
+ name: "selector",
337
+ type: "string",
338
+ description: "CSS selector to target.",
339
+ required: false,
340
+ },
341
+ ],
342
+ helpText: `Moves the mouse cursor over an element to trigger hover effects
343
+ (tooltips, dropdowns, etc.). Provide --element-id or --selector.
344
+
345
+ Examples:
346
+ $ assistant browser hover --element-id e7
347
+ $ assistant browser hover --selector ".dropdown-trigger"`,
348
+ },
349
+ {
350
+ operation: "wait_for",
351
+ description:
352
+ "Wait for a condition: a CSS selector, text, or fixed duration.",
353
+ fields: [
354
+ {
355
+ name: "selector",
356
+ type: "string",
357
+ description: "Wait for an element matching this CSS selector.",
358
+ required: false,
359
+ },
360
+ {
361
+ name: "text",
362
+ type: "string",
363
+ description: "Wait for this text to appear on the page.",
364
+ required: false,
365
+ },
366
+ {
367
+ name: "duration",
368
+ type: "number",
369
+ description: "Wait for this many milliseconds.",
370
+ required: false,
371
+ },
372
+ {
373
+ name: "timeout",
374
+ type: "number",
375
+ description:
376
+ "Maximum wait time in milliseconds. Default and max: 30000.",
377
+ required: false,
378
+ },
379
+ ],
380
+ helpText: `Blocks until a condition is met: an element appears (--selector),
381
+ text appears (--text), or a fixed duration elapses (--duration).
382
+ Provide exactly one condition. --timeout caps the overall wait.
383
+
384
+ Examples:
385
+ $ assistant browser wait-for --selector ".results-loaded"
386
+ $ assistant browser wait-for --text "Success"
387
+ $ assistant browser wait-for --duration 2000`,
388
+ },
389
+ {
390
+ operation: "extract",
391
+ description: "Extract the text content of the current page.",
392
+ fields: [
393
+ {
394
+ name: "include_links",
395
+ type: "boolean",
396
+ description: "Include a list of links found on the page.",
397
+ required: false,
398
+ },
399
+ ],
400
+ helpText: `Extracts the visible text content of the current page. Optionally
401
+ includes a list of all links found on the page.
402
+
403
+ Examples:
404
+ $ assistant browser extract
405
+ $ assistant browser extract --include-links
406
+ $ assistant browser --json extract`,
407
+ },
408
+ {
409
+ operation: "wait_for_download",
410
+ description: "Wait for a file download to complete on the current page.",
411
+ allowedModes: ["auto", "local"],
412
+ fields: [
413
+ {
414
+ name: "timeout",
415
+ type: "number",
416
+ description:
417
+ "Maximum wait time in milliseconds. Default: 30000, max: 120000.",
418
+ required: false,
419
+ },
420
+ ],
421
+ helpText: `Waits for an in-progress file download to complete and returns the
422
+ filename and path. Only supported in "auto" and "local" browser modes.
423
+
424
+ Examples:
425
+ $ assistant browser wait-for-download
426
+ $ assistant browser wait-for-download --timeout 60000`,
427
+ },
428
+ {
429
+ operation: "fill_credential",
430
+ description:
431
+ "Fill a stored credential into a form field without exposing the value.",
432
+ fields: [
433
+ {
434
+ name: "service",
435
+ type: "string",
436
+ description: "Credential vault service name.",
437
+ required: true,
438
+ },
439
+ {
440
+ name: "field",
441
+ type: "string",
442
+ description: "Credential vault field name.",
443
+ required: true,
444
+ },
445
+ {
446
+ name: "element_id",
447
+ type: "string",
448
+ description: "Element ID from browser snapshot.",
449
+ required: false,
450
+ },
451
+ {
452
+ name: "selector",
453
+ type: "string",
454
+ description: "CSS selector for target element.",
455
+ required: false,
456
+ },
457
+ {
458
+ name: "press_enter",
459
+ type: "boolean",
460
+ description: "Press Enter after filling.",
461
+ required: false,
462
+ },
463
+ ],
464
+ helpText: `Fills a credential from the assistant's credential vault into a form
465
+ field. The credential value is never exposed in CLI output. Use
466
+ 'assistant credentials list' to see available service:field pairs.
467
+
468
+ Examples:
469
+ $ assistant browser fill-credential --service github --field token --element-id e9
470
+ $ assistant browser fill-credential --service github --field password --selector "#password" --press-enter`,
471
+ },
472
+ {
473
+ operation: "status",
474
+ description: "Check browser backend readiness and remediation guidance.",
475
+ fields: [
476
+ {
477
+ name: "check_local_launch",
478
+ type: "boolean",
479
+ description:
480
+ "Run an active local Playwright launch probe. Default: false.",
481
+ required: false,
482
+ },
483
+ ],
484
+ helpText: `Reports the readiness of available browser backends (local Playwright,
485
+ Chrome extension). Includes remediation steps if a backend is not ready.
486
+ Use --check-local-launch for an active Playwright launch probe (slower).
487
+
488
+ Examples:
489
+ $ assistant browser status
490
+ $ assistant browser status --check-local-launch
491
+ $ assistant browser --json status`,
492
+ },
493
+ ];