@vpxa/aikit 0.1.341 → 0.1.343

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.
Files changed (40) hide show
  1. package/bin/postinstall-managed-launcher.mjs +86 -0
  2. package/package.json +2 -1
  3. package/packages/blocks-core/dist/index.mjs +3 -1
  4. package/packages/browser/dist/index.js +4 -3
  5. package/packages/cli/dist/index.js +16 -16
  6. package/packages/flows/dist/index.d.ts +1 -1
  7. package/packages/flows/dist/index.js +2 -2
  8. package/packages/server/dist/bin.js +1 -1
  9. package/packages/server/dist/index.js +1 -1
  10. package/packages/server/dist/prelude-CYbX3SD5.js +1 -0
  11. package/packages/server/dist/prelude-SM1mxlBF.js +2 -0
  12. package/packages/server/dist/{server-LFvVKN0j.js → server-QHpy3Vo9.js} +56 -70
  13. package/packages/server/dist/{server-DU6Jsp0h.js → server-WTo9MN4i.js} +56 -70
  14. package/packages/server/dist/{server-http-DhxqJtr-.js → server-http-Cxq-Bg3K.js} +1 -1
  15. package/packages/server/dist/{server-http-BNooFgZY.js → server-http-fvgPEVn5.js} +1 -1
  16. package/packages/server/dist/{server-stdio-yLODmHTh.js → server-stdio-DiT0r0Q3.js} +1 -1
  17. package/packages/server/dist/{server-stdio-qlRhmE4f.js → server-stdio-vC20j-3j.js} +1 -1
  18. package/packages/server/dist/version-check-2-tfmCnt.js +2 -0
  19. package/packages/server/dist/version-check-BKtLrLhw.js +1 -0
  20. package/packages/server/viewers/architecture-static.html +802 -789
  21. package/packages/server/viewers/c4-viewer.html +27 -27
  22. package/packages/server/viewers/canvas.html +83 -83
  23. package/packages/server/viewers/process-flow-static.html +13 -2
  24. package/packages/server/viewers/task-plan-static.html +7 -7
  25. package/packages/server/viewers/tour-viewer.html +3 -3
  26. package/scaffold/dist/adapters/_shared.mjs +2 -1
  27. package/scaffold/dist/adapters/claude-code.mjs +7 -10
  28. package/scaffold/dist/adapters/copilot.mjs +14 -16
  29. package/scaffold/dist/adapters/gemini.mjs +6 -8
  30. package/scaffold/dist/adapters/hermes-agent.mjs +14 -16
  31. package/scaffold/dist/adapters/hermes.mjs +5 -7
  32. package/scaffold/dist/adapters/opencode.mjs +7 -9
  33. package/scaffold/dist/definitions/flows.mjs +84 -138
  34. package/scaffold/dist/definitions/skills/browser-use.mjs +63 -33
  35. package/scaffold/dist/definitions/skills/c4-architecture.mjs +1 -1
  36. package/scaffold/dist/definitions/skills/docs.mjs +1 -1
  37. package/packages/server/dist/prelude-CQibCk9Y.js +0 -1
  38. package/packages/server/dist/prelude-ClS2lMwX.js +0 -2
  39. package/packages/server/dist/version-check-Bx7ump1d.js +0 -1
  40. package/packages/server/dist/version-check-obaVU70k.js +0 -2
@@ -16,7 +16,7 @@ argument-hint: "URL or browser task description"
16
16
 
17
17
  Use AI Kit browser for JS-rendered pages, auth barriers, forms, screenshots, network capture, storage/cookies, and web app verification.
18
18
 
19
- > **Token efficiency**: agent-browser snapshots use ~200-400 tokens vs ~3000-5000 for full DOM. Always prefer read mode 'snapshot' over raw DOM or screenshots when the page content is sufficient.
19
+ > **Token efficiency**: agent-browser snapshots use ~200-400 tokens vs ~3000-5000 for full DOM. Always prefer read mode 'snapshot' over raw DOM or screenshots when the page content is sufficient. \`includeSnapshot\` on open/navigate auto-returns the ARIA tree, saving one \`read\` round-trip.
20
20
 
21
21
  ## Tool Choice
22
22
 
@@ -28,18 +28,33 @@ Start with web_fetch/http for static content. Use browser when:
28
28
 
29
29
  Use headless by default. Use UI only for user-visible auth or visual debugging. Do not use system browser for agent-visible evidence.
30
30
 
31
+ ## Capabilities
32
+
33
+ | Enhancement | Action | How it works |
34
+ |---|---|---|
35
+ | **Auto-return snapshot** | \`open\`, \`navigate\` | Default \`includeSnapshot: true\` — response includes ARIA tree, saving one \`read\` call. Set \`false\` for speed. |
36
+ | **Annotated screenshots** | \`screenshot\` | Add \`annotate: true\` — overlays numbered \`[N]\` labels matching snapshot ref IDs. Bridges ARIA tree to visual. |
37
+ | **Console + eval hybrid** | \`console\` | Add \`expression: 'document.title'\` to console.get — evaluates JS alongside console entries in one round-trip. |
38
+ | **Ref ID snapshot format** | \`open\`, \`navigate\` | Accessibility tree shows \`[BUTTON] [e5] Sign In\` — prominent ref markers for agent targeting. |
39
+
31
40
  ## Recipes
32
41
 
33
42
  Open/read:
34
- 1. browser open with url and waitUntil.
35
- 2. browser read snapshot/text/markdown.
36
- 3. Use eval only for data unavailable through accessibility/DOM reads.
43
+ 1. \`browser({ action: 'open', url, includeSnapshot: true })\` — opens page, auto-returns ARIA tree with ref IDs.
44
+ 2. Use \`browser read\` only when you need a different readMode (dom/markdown/text) or after the first auto-snapshot.
45
+ 3. Use \`eval\` only for data unavailable through accessibility/DOM reads.
37
46
 
38
47
  Interact:
39
- 1. Read snapshot.
40
- 2. Act by stable role/name/ref/selector.
48
+ 1. Read snapshot (or use auto-returned snapshot from open/navigate).
49
+ 2. Act by stable ref (e.g., \`[e5]\`), selector, or label.
41
50
  3. Re-read or diff.
42
- 4. Capture screenshot when visual result matters.
51
+ 4. Capture annotated screenshot with \`annotate: true\` — numbered labels match snapshot ref IDs, bridging tree to visual.
52
+
53
+ Console + Eval:
54
+ 1. \`browser({ action: 'console', consoleSubAction: 'enable' })\` to start capture.
55
+ 2. Perform page actions.
56
+ 3. \`browser({ action: 'console', consoleSubAction: 'get', expression: 'document.title' })\` — gets console entries AND evaluates JS in one round-trip.
57
+ 4. Use \`expression\` for quick page state queries without a separate eval call.
43
58
 
44
59
  Auth:
45
60
  1. Detect login/SSO/CAPTCHA.
@@ -84,16 +99,14 @@ Each recipe step declares:
84
99
  ### 1. Form Login
85
100
 
86
101
  ~~~text
87
- Step 1: Open login page
88
- Action: browser({ action: 'open', url: '<login-url>', mode: 'ui' })
89
- Verify: Page contains login form (read snapshot, check for username/password fields)
102
+ Step 1: Open login page (auto-returns snapshot)
103
+ Action: browser({ action: 'open', url: '<login-url>', mode: 'ui', includeSnapshot: true })
104
+ Verify: Page contains login form (check auto-returned snapshot for username/password fields)
90
105
  On Failure: URL may have changed — check redirects
91
- Extract: pageId
106
+ Extract: pageId, snapshot (auto-returned with ref IDs like [TEXTFIELD] [e3] [BUTTON] [e5])
92
107
 
93
- Step 2: Read form structure
94
- Action: browser({ action: 'read', pageId, readMode: 'snapshot' })
95
- Verify: Found username field, password field, submit button
96
- On Failure: Try readMode 'dom' for hidden fields
108
+ Step 2: Inspect form structure (from auto-returned snapshot)
109
+ Note: Snapshot already returned in Step 1 — no separate read needed unless different mode
97
110
  Extract: field refs (@username, @password, @submit)
98
111
 
99
112
  Step 3: Enter credentials
@@ -148,10 +161,10 @@ Step 5: Export session (optional)
148
161
  ### 3. Data Extraction
149
162
 
150
163
  ~~~text
151
- Step 1: Navigate to data page
152
- Action: browser({ action: 'open', url: '<data-url>', mode: 'headless' })
153
- Verify: Page loaded successfully
154
- Extract: pageId
164
+ Step 1: Navigate to data page (auto-returns snapshot)
165
+ Action: browser({ action: 'open', url: '<data-url>', mode: 'headless', includeSnapshot: true })
166
+ Verify: Page loaded successfully (check auto-returned snapshot)
167
+ Extract: pageId, snapshot
155
168
 
156
169
  Step 2: Wait for dynamic content
157
170
  Action: browser({ action: 'navigate', pageId, type: 'waitFor', selector: '<data-container>' })
@@ -159,7 +172,10 @@ Step 2: Wait for dynamic content
159
172
  On Failure: Increase timeout, check if JS is needed
160
173
 
161
174
  Step 3: Extract structured data
175
+ # Option A: standalone eval
162
176
  Action: browser({ action: 'eval', pageId, code: 'document.querySelectorAll("<selector>").map(...)' })
177
+ # Option B: console + eval hybrid (single round-trip)
178
+ Action: browser({ action: 'console', consoleSubAction: 'get', pageId, expression: 'JSON.stringify(dataObjects)' })
163
179
  Verify: Got expected data structure
164
180
  On Failure: Try different selector, use read(dom) to inspect structure
165
181
  Extract: structured data
@@ -244,9 +260,10 @@ Step 3: Check console for JS errors
244
260
  Verify: No critical JS errors
245
261
  Extract: error list (if any)
246
262
 
247
- Step 4: Screenshot for visual regression
248
- Action: browser({ action: 'screenshot', pageId, fullPage: true })
249
- Extract: screenshot for comparison
263
+ Step 4: Annotated screenshot for visual regression
264
+ Action: browser({ action: 'screenshot', pageId, fullPage: true, annotate: true })
265
+ Note: Annotated screenshot overlays numbered [N] labels matching snapshot ref IDs
266
+ Extract: screenshot for visual comparison
250
267
  ~~~
251
268
 
252
269
  ### 7. Local File Preview
@@ -325,9 +342,9 @@ Browser-based authentication strategies for different auth mechanisms.
325
342
  **When:** Simple username/password form without SSO.
326
343
 
327
344
  **Steps:**
328
- 1. \`open\` login page
329
- 2. \`read\` snapshot to find form fields
330
- 3. \`act\` type credentials (ask user for input via terminal)
345
+ 1. \`open\` login page with \`includeSnapshot: true\` — auto-returns ARIA tree with form field ref IDs
346
+ 2. Inspect auto-returned snapshot for form fields (ref IDs like \`[TEXTFIELD] [e3]\`)
347
+ 3. \`act\` type credentials (ask user for input)
331
348
  4. \`act\` click submit
332
349
  5. \`read\` to verify authenticated state
333
350
 
@@ -422,22 +439,26 @@ browser({ action: 'eval', pageId, code: 'localStorage.getItem("authToken")' })
422
439
  ## Quick Reference
423
440
 
424
441
  | Need | Action | Key params |
425
- |---|---|---|
426
- | Open a page | \`open\` | url, mode (ui/headless) |
442
+ |---|---|---|---|
443
+ | Open a page (with auto-snapshot) | \`open\` | url, mode, includeSnapshot (default true) |
427
444
  | Read page content | \`read\` | readMode: snapshot/dom/markdown/text |
428
445
  | Click/type/interact | \`act\` | kind: click/type/press/hover/select |
429
- | Wait for something | \`navigate\` | type: waitFor, selector |
446
+ | Wait for something | \`navigate\` | type: waitFor, selector, includeSnapshot (default true) |
430
447
  | Check network calls | \`network\` | subAction: enable -> get |
431
448
  | Get cookies/storage | \`session\` | sessionAction: cookies/get-storage |
432
- | Take screenshot | \`screenshot\` | fullPage, selector |
449
+ | Take screenshot (annotated) | \`screenshot\` | fullPage, selector, annotate (adds numbered labels) |
450
+ | Console + eval hybrid | \`console\` | consoleSubAction: get, expression (evaluates JS) |
433
451
  | Compare changes | \`diff\` | (compares to previous snapshot) |
434
452
 
435
453
  For full parameter details: \`describe_tool('browser')\`
436
454
 
437
455
  ## Principles
438
456
 
457
+ - Prefer \`includeSnapshot: true\` (default on open/navigate) — auto-returns ARIA tree, saves one round-trip vs explicit \`read\`.
439
458
  - Prefer \`read\` over \`screenshot\` — snapshots are structured (ARIA tree), searchable, token-efficient.
440
- - Always \`read\` after \`act\`actions don't return page state.
459
+ - Prefer \`annotate: true\` on screenshotsnumbered labels match snapshot ref IDs, bridging tree to visual.
460
+ - Prefer console + eval hybrid (\`console.get\` with \`expression\`) over separate \`console.get\` then \`eval\` — single round-trip.
461
+ - Always \`read\` or use \`includeSnapshot\` after \`act\` — actions don't return page state.
441
462
  - Use \`diff\` instead of re-reading after an action — shows only what changed.
442
463
  - Network capture BEFORE navigation — enable then navigate. Captures start from enable time.
443
464
  - One page = one task — fresh pages avoid state contamination.
@@ -456,11 +477,17 @@ Always read(snapshot) first to get refs before interacting.
456
477
  Direct sequential browser() calls for one-off tasks and debugging:
457
478
 
458
479
  \`\`\`
459
- // Open -> Read -> Act -> Read loop
480
+ // Open (with auto-snapshot) -> Act -> Read/Console
460
481
  browser({ action: 'open', url, mode: 'headless' })
461
- browser({ action: 'read', pageId })
482
+ // snapshot auto-returned — no separate read needed unless different mode
462
483
  browser({ action: 'act', pageId, kind: 'click', ref: '@login-button' })
463
484
  browser({ action: 'read', pageId }) // verify state changed
485
+
486
+ // Console + eval hybrid pattern:
487
+ browser({ action: 'console', consoleSubAction: 'enable' })
488
+ browser({ action: 'act', pageId, kind: 'click', ref: '@submit' })
489
+ browser({ action: 'console', consoleSubAction: 'get', expression: 'document.title' })
490
+ // returns console entries AND evaluated title in one response
464
491
  \`\`\`
465
492
 
466
493
  **Network Intelligence pattern:**
@@ -471,11 +498,14 @@ browser({ action: 'network', pageId, subAction: 'get' })
471
498
  browser({ action: 'network', pageId, subAction: 'export-har' })
472
499
  \`\`\`
473
500
 
474
- **Console capture:**
501
+ **Console capture (with optional eval):**
475
502
  \`\`\`
476
503
  browser({ action: 'console', pageId, consoleSubAction: 'enable' })
477
504
  // ... trigger page actions ...
505
+ // Get console entries only:
478
506
  browser({ action: 'console', pageId, consoleSubAction: 'get', level: 'error' })
507
+ // Get console entries + evaluate JS (single round-trip):
508
+ browser({ action: 'console', pageId, consoleSubAction: 'get', expression: 'JSON.stringify(window.__DATA__)' })
479
509
  \`\`\`
480
510
 
481
511
  ## Session Management