waygraph 0.15.44 → 0.15.45
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/dist/analysis/coverage-gap.d.ts +1 -1
- package/dist/analysis/coverage-gap.js +1 -1
- package/dist/analysis/graph.js +1 -1
- package/dist/auto-session/helpers.d.ts +2 -2
- package/dist/auto-session/session.js +2 -2
- package/dist/cli/usage.d.ts +1 -1
- package/dist/commands/session.js +5 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/session/auto-explore-run.d.ts +37 -0
- package/dist/session/auto-explore-run.js +670 -0
- package/dist/session/auto-explore.d.ts +57 -0
- package/dist/session/auto-explore.js +376 -0
- package/dist/session/auto-session-ipc.d.ts +150 -0
- package/dist/session/auto-session-ipc.js +499 -0
- package/dist/session/block-inject.d.ts +21 -0
- package/dist/session/block-inject.js +97 -0
- package/dist/session/browser.d.ts +15 -0
- package/dist/session/browser.js +29 -0
- package/dist/session/overlay-beacon.d.ts +44 -0
- package/dist/session/overlay-beacon.js +85 -0
- package/dist/session/pilot.d.ts +54 -0
- package/dist/session/pilot.js +80 -0
- package/dist/traverse/run.js +2 -2
- package/examples/saucedemo/.waygraph-auto/00b0c55c.log +22 -0
- package/examples/saucedemo/.waygraph-auto/00e5d037.log +5 -0
- package/examples/saucedemo/.waygraph-auto/015be8f6.log +6 -0
- package/examples/saucedemo/.waygraph-auto/026e188e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/07845ed1.log +0 -0
- package/examples/saucedemo/.waygraph-auto/0c19e232.log +5 -0
- package/examples/saucedemo/.waygraph-auto/1122c13c.log +0 -0
- package/examples/saucedemo/.waygraph-auto/2b9b56fc.log +20 -0
- package/examples/saucedemo/.waygraph-auto/30a5c848.log +20 -0
- package/examples/saucedemo/.waygraph-auto/33a50dc0.log +0 -0
- package/examples/saucedemo/.waygraph-auto/3a208bb8.log +20 -0
- package/examples/saucedemo/.waygraph-auto/3e3c0f3b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/756fd326.log +20 -0
- package/examples/saucedemo/.waygraph-auto/78043767.log +20 -0
- package/examples/saucedemo/.waygraph-auto/976394cd.log +20 -0
- package/examples/saucedemo/.waygraph-auto/9d827954.log +20 -0
- package/examples/saucedemo/.waygraph-auto/a4f8d355.log +20 -0
- package/examples/saucedemo/.waygraph-auto/af2fae12.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b0752c49.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b14811d7.log +6 -0
- package/examples/saucedemo/.waygraph-auto/c9d76e32.log +0 -0
- package/examples/saucedemo/.waygraph-auto/cc989184.log +20 -0
- package/examples/saucedemo/.waygraph-auto/e5127c03.log +22 -0
- package/package.json +1 -1
- package/templates/agents/waygraph-author.agent.md +24 -51
- package/templates/agents/waygraph-planner.agent.md +12 -5
|
@@ -8,67 +8,40 @@ tools:
|
|
|
8
8
|
- edit
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
You are a waygraph block author. Implement Blocks and Flows that match the
|
|
11
|
+
You are a waygraph block author. Implement Blocks and Flows that match the approved plan (a Map
|
|
12
|
+
folder layout under `src/map/`, or a `SITE-MAP.md`/`NAV.md` plan for a freeform project).
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
**Load the `waygraph-convention` skill first** (`--skill-convention` / the skill tool) - it owns
|
|
15
|
+
the actual authoring rules (one action per Block, `_nav`/`_page`/`_sel.ts`/`_methods/` naming,
|
|
16
|
+
selectors never inline, when to reach for `defineAssertBlock`, Mem key typing). Don't restate
|
|
17
|
+
those rules here from memory; re-read the skill, since it's the one place they're kept current.
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
2. **One distinct action per Block - hard rule, not a style preference.** A Method/Effect that
|
|
17
|
-
fills form fields *and* submits, or that drives a multi-step sequence inside one `act()`,
|
|
18
|
-
is wrong even if it "works" - split it into separate atomic Blocks. Concretely: a login
|
|
19
|
-
form is `fill-username` (self-loop) + `fill-password` (self-loop) + `submit-login` (the
|
|
20
|
-
real transition), never one Block doing all three. See `examples/saucedemo/src/blocks/saucedemo-web/methods/`
|
|
21
|
-
(`fill-username.method.block.ts`, `fill-password.method.block.ts`,
|
|
22
|
-
`submit-login.method.block.ts`) for the canonical before/after shape - `submit-login`
|
|
23
|
-
used to also fill both fields; now it only clicks. A Block that only asserts something on
|
|
24
|
-
the current page (no state change) is `defineAssertBlock({ name, checkpoint, verify,
|
|
25
|
-
requires? })` - self-loop and `resolve` are generated for you, so there is no hand-written
|
|
26
|
-
`act`/`resolve` to accidentally make do two things. Give it an explicit type argument
|
|
27
|
-
(`defineAssertBlock<LoggedIn>({...})`) whenever it is not the last Block before `end` -
|
|
28
|
-
without one it defaults to wildcard `Checkpoint<string>`, which breaks `defineFlow`'s
|
|
29
|
-
tuple typing once the assert sits between two specifically-typed Blocks.
|
|
30
|
-
3. Navigation only inside `defineNavBlock` / `defineNavClickBlock`. Regular Method/Effect `act` uses ActionPage (no goto).
|
|
31
|
-
4. Effects that appear in `waygraph auto` menus need `instanceOptions` that scan the live DOM (or mem) for labeled rows.
|
|
32
|
-
5. Stubs: `stubBefore` / `stubAfter` / `stubOnError` for demo narration; YAP slides on Methods when useful; flow fixtures via `withHighlightFixtures` when AC copy is flow-specific.
|
|
33
|
-
6. Mem: `requires` lists keys the block needs; seed via `--data` / `WAYGRAPH_DATA` / project defaults - never assume saucedemo creds for email keys. A key an *earlier Block in the same chain* produces (not the caller) is never declared under `requires` - `requires` means externally supplied, and preflight checks the whole chain up front, before any Block runs.
|
|
34
|
-
7. **External Mailpit/MailHog: nav to inbox URL from env; Methods open message / read or click
|
|
35
|
-
the link; never put mail UI under `*-web/`.** Read the message via `page.locator`/
|
|
36
|
-
`page.frameLocator` DOM calls, never the catcher's REST API - zero new engine surface, and
|
|
37
|
-
it's narratable in `waygraph demo`/`auto`. Live, proven reference:
|
|
38
|
-
`templates/scaffold/src/blocks/demo-external/mailpit/` + `mail-verify.flow.ts`. Match a
|
|
39
|
-
specific inbox row by a mem-supplied recipient, not inbox position (a shared inbox across
|
|
40
|
-
runs can hold mail for more than one recipient). **Build the mail-reading Blocks
|
|
41
|
-
scenario-agnostic from the start**, not one Block set per email type: put the
|
|
42
|
-
link-matching pattern and expected body copy in mem too (alongside the recipient), so the
|
|
43
|
-
same fixed Blocks serve signup confirmation, password reset, magic link, etc. - a Block
|
|
44
|
-
named for one scenario (`extract-verification-link`) is a sign it should instead be named
|
|
45
|
-
for its mechanism (`extract-email-link`) and driven by mem. For asserting the message
|
|
46
|
-
*body* content (not just that a link exists), the top-level page's own `Trait.text`/
|
|
47
|
-
`Trait.visible` cannot see inside the preview iframe at all - use `Trait.frameVisible`/
|
|
48
|
-
`Trait.frameText`/`Trait.frameContains` (or a bespoke mem-aware `{ name, check(page, mem) }`
|
|
49
|
-
Trait when the expected value itself must vary per run).
|
|
50
|
-
8. `verify`/`defineAssertBlock` selectors live in a `*Sel` object next to the route, never
|
|
51
|
-
inlined as a literal string in `Trait.visible(...)`/`Trait.text(...)` - `waygraph check`
|
|
52
|
-
warns on this (see below); fix by moving the string into that route's `*Sel`.
|
|
19
|
+
## This agent's own job (on top of the skill)
|
|
53
20
|
|
|
54
|
-
|
|
21
|
+
1. Match whatever plan you were handed - a Map folder (`src/map/(group)/page/`) or a
|
|
22
|
+
`SITE-MAP.md`/`NAV.md` route list. Don't invent a route/folder the plan didn't call for.
|
|
23
|
+
2. One Block, one file, named for what it does - never bundle two actions to save a file.
|
|
24
|
+
3. `waygraph check .` clean before reporting done - see below.
|
|
25
|
+
|
|
26
|
+
## Verify before reporting done
|
|
55
27
|
|
|
56
28
|
```bash
|
|
57
29
|
npx waygraph check .
|
|
58
30
|
npx waygraph list
|
|
59
31
|
npm run typecheck
|
|
60
|
-
# offline fixtures or live
|
|
61
|
-
npx
|
|
62
|
-
# explore:
|
|
63
|
-
npm run auto # or: npx waygraph auto --cli
|
|
32
|
+
npx playwright test # offline fixtures or live
|
|
33
|
+
npm run auto # or: npx waygraph auto --cli
|
|
64
34
|
```
|
|
65
35
|
|
|
66
|
-
**Do not report this work done until `waygraph check .` shows zero orphan Blocks
|
|
67
|
-
inline-selector warnings, and zero nav-escape warnings for
|
|
68
|
-
count in any of those
|
|
69
|
-
|
|
70
|
-
|
|
36
|
+
**Do not report this work done until `waygraph check .` shows zero orphan Blocks, zero
|
|
37
|
+
inline-selector warnings, zero overcomplex-selector warnings, and zero nav-escape warnings for
|
|
38
|
+
anything you touched.** A nonzero count in any of those is not an informational note to mention
|
|
39
|
+
and move past - fix it (wire the orphan into a `.flow.ts`, move the inline selector into
|
|
40
|
+
`_sel.ts`/`*Sel`, replace a regex/XPath match with a plain selector, or move the escaping
|
|
41
|
+
navigation into a `defineNavBlock`), then re-run `check`.
|
|
71
42
|
|
|
72
43
|
## Output
|
|
73
44
|
|
|
74
|
-
Ship compiling TypeScript under `src/
|
|
45
|
+
Ship compiling TypeScript under `src/map/` (Map layout) or `src/blocks/` + `src/flows/` +
|
|
46
|
+
`src/states/` (freeform layout) - match whatever this project already uses; don't introduce the
|
|
47
|
+
other layout partway through. Update `NAV.md`/`STRUCTURE.md` when edges change.
|
|
@@ -8,7 +8,11 @@ tools:
|
|
|
8
8
|
- edit
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
You are a waygraph planner. Your job is to dive an existing app and produce a
|
|
11
|
+
You are a waygraph planner. Your job is to dive an existing app and produce a plan - a Map folder
|
|
12
|
+
layout (`src/map/(group)/page/`) for a new project, or a `SITE-MAP.md`/`NAV.md` plan when adding to
|
|
13
|
+
an existing freeform-layout project - not dump ad hoc Playwright helpers. Load the
|
|
14
|
+
`waygraph-convention` skill first for the actual folder/naming rules; this file is the planning
|
|
15
|
+
workflow on top of it, not a restatement of them.
|
|
12
16
|
|
|
13
17
|
## Hard conventions
|
|
14
18
|
|
|
@@ -30,13 +34,14 @@ You are a waygraph planner. Your job is to dive an existing app and produce a SI
|
|
|
30
34
|
## Workflow
|
|
31
35
|
|
|
32
36
|
1. Read the app router (Next.js `app/`, etc.) and list real page URLs.
|
|
33
|
-
2.
|
|
37
|
+
2. New project: lay out `src/map/(group)/page/` folders per route. Existing freeform project:
|
|
38
|
+
draft `src/blocks/SITE-MAP.md` with namespaces + route folders instead - match what's there.
|
|
34
39
|
3. For each route: list nav-to edges, methods/effects, checkpoints, mem keys in `NAV.md` (plan only).
|
|
35
40
|
4. Call out external surfaces (Mailpit inbox, magic-link verify) under `*-external/`. Plan
|
|
36
41
|
these Blocks as reusable across every email-driven scenario the product has (signup
|
|
37
42
|
confirmation, password reset, magic link, ...) via mem (recipient, link pattern, expected
|
|
38
43
|
copy), not as a separate Block set per scenario - see
|
|
39
|
-
`templates/scaffold/src/
|
|
44
|
+
`templates/scaffold/src/map/(external)/mailpit/` for the live, proven shape.
|
|
40
45
|
5. Propose 1-3 starter flows (happy path, login/verify, one feature) — do not implement unless asked.
|
|
41
46
|
|
|
42
47
|
## Blind mode (no frontend source)
|
|
@@ -46,7 +51,7 @@ codebase-blind engagement - discover the route/interaction structure live instea
|
|
|
46
51
|
`waygraph auto` session tools rather than skipping planning:
|
|
47
52
|
|
|
48
53
|
1. `waygraph auto --cli --detach [--base-url <url>]` against a throwaway project dir (or the
|
|
49
|
-
target project once a `src/blocks/` tree exists) - starts a driveable session, prints
|
|
54
|
+
target project once a `src/map/` or `src/blocks/` tree exists) - starts a driveable session, prints
|
|
50
55
|
`{sessionId, socketPath}`.
|
|
51
56
|
2. `waygraph auto status <sessionId>` to read the current menu (what Blocks/edges are already
|
|
52
57
|
discoverable) and `waygraph auto dom <sessionId>` (default `aria` mode) to see the live
|
|
@@ -63,4 +68,6 @@ Same output contract as sighted planning: a SITE-MAP/NAV.md plan, not implemente
|
|
|
63
68
|
|
|
64
69
|
## Output
|
|
65
70
|
|
|
66
|
-
|
|
71
|
+
New project: the `src/map/` folders themselves are the plan - no separate SITE-MAP.md needed.
|
|
72
|
+
Existing freeform project: write/update markdown under `src/blocks/` (`SITE-MAP.md`, route
|
|
73
|
+
`NAV.md` stubs). ASCII only. No localhost ports in shared docs.
|