waygraph 0.13.6 → 0.14.0
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/README.md +820 -232
- package/assets/stubs/stub.mp4 +0 -0
- package/assets/stubs/stub.pdf +32 -0
- package/assets/stubs/stub.png +0 -0
- package/dist/agent-dive.d.ts +9 -0
- package/dist/agent-dive.js +32 -0
- package/dist/auto-explore-run.d.ts +20 -2
- package/dist/auto-explore-run.js +9 -8
- package/dist/auto-explore.js +22 -2
- package/dist/auto-session-ipc.d.ts +123 -0
- package/dist/auto-session-ipc.js +381 -0
- package/dist/auto-session.d.ts +342 -0
- package/dist/auto-session.js +760 -0
- package/dist/cli.js +417 -51
- package/dist/engine.d.ts +40 -1
- package/dist/engine.js +82 -0
- package/dist/graph.d.ts +18 -0
- package/dist/graph.js +65 -2
- package/dist/highlights.d.ts +20 -1
- package/dist/highlights.js +60 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +5 -3
- package/dist/pilot-overlay.d.ts +88 -0
- package/dist/pilot-overlay.js +363 -0
- package/dist/pilot.d.ts +49 -0
- package/dist/pilot.js +53 -0
- package/dist/trait.d.ts +22 -0
- package/dist/trait.js +60 -3
- package/examples/routed-demo/package.json +26 -0
- package/examples/routed-demo/playwright.config.ts +20 -0
- package/examples/routed-demo/scripts/fixture-server.mjs +37 -0
- package/examples/routed-demo/scripts/with-fixture.mjs +70 -0
- package/examples/routed-demo/src/flows/routed-demo.flow.ts +12 -0
- package/examples/routed-demo/src/pages/dashboard.html +10 -0
- package/examples/routed-demo/src/pages/docs.html +8 -0
- package/examples/routed-demo/src/routes/(base_app)/dashboard/dashboard.sel.ts +10 -0
- package/examples/routed-demo/src/routes/(base_app)/dashboard/methods/click-widget.block.ts +23 -0
- package/examples/routed-demo/src/routes/(base_app)/dashboard/nav.block.ts +18 -0
- package/examples/routed-demo/src/routes/(base_app)/dashboard/page.block.ts +22 -0
- package/examples/routed-demo/src/routes/(external)/docs/docs.sel.ts +7 -0
- package/examples/routed-demo/src/routes/(external)/docs/nav.block.ts +21 -0
- package/examples/routed-demo/src/routes/(external)/docs/page.block.ts +15 -0
- package/examples/routed-demo/src/states/routed-demo.states.ts +10 -0
- package/examples/routed-demo/tests/routed-demo.spec.ts +75 -0
- package/examples/routed-demo/tsconfig.json +18 -0
- package/examples/routed-demo-consumer/package.json +18 -0
- package/examples/saucedemo/.waygraph-auto/010dd92b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/011ad671.log +0 -0
- package/examples/saucedemo/.waygraph-auto/01b45645.log +0 -0
- package/examples/saucedemo/.waygraph-auto/03764153.log +0 -0
- package/examples/saucedemo/.waygraph-auto/0593587e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/06d12823.log +0 -0
- package/examples/saucedemo/.waygraph-auto/0b1f5b26.json +8 -0
- package/examples/saucedemo/.waygraph-auto/0c00f25f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/0e480591.log +0 -0
- package/examples/saucedemo/.waygraph-auto/110958b8.log +0 -0
- package/examples/saucedemo/.waygraph-auto/138107c1.log +0 -0
- package/examples/saucedemo/.waygraph-auto/159d541b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/16aa2c01.log +0 -0
- package/examples/saucedemo/.waygraph-auto/16c35dd5.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1706547d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/17537e42.log +0 -0
- package/examples/saucedemo/.waygraph-auto/17ede493.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1fe2414f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1fe2e3b8.log +0 -0
- package/examples/saucedemo/.waygraph-auto/25f68ada.log +0 -0
- package/examples/saucedemo/.waygraph-auto/26ca9cd8.log +0 -0
- package/examples/saucedemo/.waygraph-auto/2bb6c4e8.log +0 -0
- package/examples/saucedemo/.waygraph-auto/2d425004.log +0 -0
- package/examples/saucedemo/.waygraph-auto/2f5b3ea6.log +0 -0
- package/examples/saucedemo/.waygraph-auto/31bb303d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/31f2042f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/36551ec1.log +0 -0
- package/examples/saucedemo/.waygraph-auto/36a1c274.log +0 -0
- package/examples/saucedemo/.waygraph-auto/381aa338.log +0 -0
- package/examples/saucedemo/.waygraph-auto/3882bce1.log +0 -0
- package/examples/saucedemo/.waygraph-auto/38acd1dc.log +0 -0
- package/examples/saucedemo/.waygraph-auto/3b8b77b9.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4028d2a2.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4168b208.log +0 -0
- package/examples/saucedemo/.waygraph-auto/43ab66ce.log +0 -0
- package/examples/saucedemo/.waygraph-auto/43f66838.log +0 -0
- package/examples/saucedemo/.waygraph-auto/442171d4.log +0 -0
- package/examples/saucedemo/.waygraph-auto/453b1ce1.log +0 -0
- package/examples/saucedemo/.waygraph-auto/457322bd.log +0 -0
- package/examples/saucedemo/.waygraph-auto/46197027.log +0 -0
- package/examples/saucedemo/.waygraph-auto/46889468.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4890da1c.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4893a63b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4af71440.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4f7496d1.log +0 -0
- package/examples/saucedemo/.waygraph-auto/50e8baaa.log +0 -0
- package/examples/saucedemo/.waygraph-auto/52b3a455.log +0 -0
- package/examples/saucedemo/.waygraph-auto/532dd9b8.log +0 -0
- package/examples/saucedemo/.waygraph-auto/5391ce40.log +0 -0
- package/examples/saucedemo/.waygraph-auto/57dbddb3.log +0 -0
- package/examples/saucedemo/.waygraph-auto/5897f501.log +0 -0
- package/examples/saucedemo/.waygraph-auto/59c0b57d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/5b511794.log +0 -0
- package/examples/saucedemo/.waygraph-auto/5c47910f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/5eda8273.log +0 -0
- package/examples/saucedemo/.waygraph-auto/621518ad.log +0 -0
- package/examples/saucedemo/.waygraph-auto/632b7118.log +0 -0
- package/examples/saucedemo/.waygraph-auto/64314c2b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/66516213.log +0 -0
- package/examples/saucedemo/.waygraph-auto/66c17079.log +0 -0
- package/examples/saucedemo/.waygraph-auto/69bf0b80.log +0 -0
- package/examples/saucedemo/.waygraph-auto/69c2347a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/6d22bdb0.log +0 -0
- package/examples/saucedemo/.waygraph-auto/7103bebb.log +0 -0
- package/examples/saucedemo/.waygraph-auto/740c9faa.log +0 -0
- package/examples/saucedemo/.waygraph-auto/74872fc5.log +0 -0
- package/examples/saucedemo/.waygraph-auto/75846ca9.log +0 -0
- package/examples/saucedemo/.waygraph-auto/7626c85b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/76308eec.log +0 -0
- package/examples/saucedemo/.waygraph-auto/76c1650e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/7861f38f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/7af224ed.log +0 -0
- package/examples/saucedemo/.waygraph-auto/7c3be585.log +0 -0
- package/examples/saucedemo/.waygraph-auto/7ed55a2c.log +0 -0
- package/examples/saucedemo/.waygraph-auto/80086ba2.log +0 -0
- package/examples/saucedemo/.waygraph-auto/80206369.log +0 -0
- package/examples/saucedemo/.waygraph-auto/847f1092.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8581abfa.log +0 -0
- package/examples/saucedemo/.waygraph-auto/87b7e0fd.log +0 -0
- package/examples/saucedemo/.waygraph-auto/87c79256.log +0 -0
- package/examples/saucedemo/.waygraph-auto/88af2495.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8c04a403.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8c9ab09e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8cc5db51.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8ea3a69c.log +0 -0
- package/examples/saucedemo/.waygraph-auto/9150f913.log +0 -0
- package/examples/saucedemo/.waygraph-auto/929a4313.log +0 -0
- package/examples/saucedemo/.waygraph-auto/95a599e4.log +0 -0
- package/examples/saucedemo/.waygraph-auto/96c45350.log +0 -0
- package/examples/saucedemo/.waygraph-auto/986030e6.log +0 -0
- package/examples/saucedemo/.waygraph-auto/99787abb.log +0 -0
- package/examples/saucedemo/.waygraph-auto/99ddb62c.log +0 -0
- package/examples/saucedemo/.waygraph-auto/a63a2d20.log +0 -0
- package/examples/saucedemo/.waygraph-auto/a78befb7.log +0 -0
- package/examples/saucedemo/.waygraph-auto/a84d9b79.log +0 -0
- package/examples/saucedemo/.waygraph-auto/a9270890.log +0 -0
- package/examples/saucedemo/.waygraph-auto/aa440153.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ab7561e0.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ac19ae60.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ae21ad8e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/af09042f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b1684126.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b21e9d12.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b5a838be.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b603549d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b83e6259.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b9cb2796.log +0 -0
- package/examples/saucedemo/.waygraph-auto/bb0a0018.log +0 -0
- package/examples/saucedemo/.waygraph-auto/bc0bdd0e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/bc7d4a83.log +0 -0
- package/examples/saucedemo/.waygraph-auto/bd8e082a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/bea0c93e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/bf35201a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/bffa3a7a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/c4afb8bc.log +0 -0
- package/examples/saucedemo/.waygraph-auto/c916a654.log +0 -0
- package/examples/saucedemo/.waygraph-auto/c9b8d69e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/d02e5e7e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/d09aff71.log +0 -0
- package/examples/saucedemo/.waygraph-auto/d0e41396.log +0 -0
- package/examples/saucedemo/.waygraph-auto/d1370d76.log +0 -0
- package/examples/saucedemo/.waygraph-auto/d3714ae4.log +0 -0
- package/examples/saucedemo/.waygraph-auto/da0685dc.log +0 -0
- package/examples/saucedemo/.waygraph-auto/da894ad8.log +0 -0
- package/examples/saucedemo/.waygraph-auto/daa2f922.log +0 -0
- package/examples/saucedemo/.waygraph-auto/daefb614.log +0 -0
- package/examples/saucedemo/.waygraph-auto/db97e833.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e101d19a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e207c989.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e633e545.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e69aec68.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e70e2d06.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ebad3410.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ecbb0966.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ecdee753.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ed888783.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ed931dac.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ef655a3f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/f3c29b21.log +0 -0
- package/examples/saucedemo/.waygraph-auto/f53f7cfc.log +0 -0
- package/examples/saucedemo/.waygraph-auto/f5ad5830.log +0 -0
- package/examples/saucedemo/.waygraph-auto/faed36dd.log +0 -0
- package/examples/saucedemo/docs/CONVENTION.md +25 -5
- package/examples/saucedemo/docs/HELPERS.md +15 -4
- package/examples/saucedemo/scripts/capture-wrong-login.mjs +8 -2
- package/examples/saucedemo/scripts/prove-wrong-login-runtime.mjs +8 -2
- package/examples/saucedemo/src/blocks/SITE-MAP.md +14 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/NAV.md +15 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/NAV.md +1 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/cart.sel.ts +9 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-cart.block.ts +3 -2
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-checkout-info.block.ts +2 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/NAV.md +6 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/checkout-info.sel.ts +11 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-first-name.method.block.ts +22 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-last-name.method.block.ts +21 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-postal-code.method.block.ts +21 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/submit-checkout-info.method.block.ts +6 -7
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/NAV.md +2 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/checkout-overview.sel.ts +9 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +7 -6
- package/examples/saucedemo/src/blocks/saucedemo-web/ff-owner-auth.block.ts +7 -2
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/NAV.md +1 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/item-detail.sel.ts +9 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-back-to-inventory.block.ts +2 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-back-to-products.block.ts +2 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-continue-shopping.block.ts +2 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +51 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +69 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/login.sel.ts +13 -0
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login-for-flow.ts +4 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +13 -51
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-logout.method.block.ts +4 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/nav-login.block.ts +14 -6
- package/examples/saucedemo/src/flows/checkout-then-browse-again.flow.ts +15 -0
- package/examples/saucedemo/src/flows/checkout.flow.ts +20 -2
- package/examples/saucedemo/src/flows/device-showcase.flow.ts +4 -0
- package/examples/saucedemo/src/flows/login.flow.ts +3 -1
- package/examples/saucedemo/src/flows/shop.flow.ts +6 -0
- package/examples/saucedemo/src/flows/smoke.flow.ts +13 -7
- package/examples/saucedemo/src/flows/stub-on-error.flow.ts +4 -2
- package/examples/saucedemo/src/flows/viewer-blocked.flow.ts +6 -2
- package/examples/saucedemo/tests/flow-block-verify.spec.ts +3 -3
- package/examples/saucedemo/tests/submit-login-branch.spec.ts +5 -3
- package/package.json +2 -1
- package/templates/agents/waygraph-author.agent.md +43 -5
- package/templates/agents/waygraph-planner.agent.md +33 -2
- package/templates/quickstart/src/blocks/saucedemo-web/NAV.md +15 -1
- package/templates/quickstart/src/blocks/saucedemo-web/cart/NAV.md +1 -0
- package/templates/quickstart/src/blocks/saucedemo-web/cart/cart.sel.ts +9 -0
- package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-cart.block.ts +19 -15
- package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-checkout-info.block.ts +2 -1
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/NAV.md +6 -1
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/checkout-info.sel.ts +11 -0
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-first-name.method.block.ts +22 -0
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-last-name.method.block.ts +21 -0
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-postal-code.method.block.ts +21 -0
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/submit-checkout-info.method.block.ts +6 -7
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/NAV.md +2 -0
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/checkout-overview.sel.ts +9 -0
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +7 -6
- package/templates/quickstart/src/blocks/saucedemo-web/ff-owner-auth.block.ts +7 -2
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +24 -16
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/nav-item-detail.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/NAV.md +1 -0
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/item-detail.sel.ts +9 -0
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-back-to-inventory.block.ts +2 -1
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-back-to-products.block.ts +2 -1
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-continue-shopping.block.ts +2 -1
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +51 -0
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +69 -0
- package/templates/quickstart/src/blocks/saucedemo-web/methods/login.sel.ts +13 -0
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login-for-flow.ts +4 -4
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +35 -63
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-logout.method.block.ts +4 -3
- package/templates/quickstart/src/blocks/saucedemo-web/nav-login.block.ts +14 -6
- package/templates/quickstart/src/flows/checkout-then-browse-again.flow.ts +15 -0
- package/templates/quickstart/src/flows/checkout.flow.ts +29 -2
- package/templates/quickstart/src/flows/device-showcase.flow.ts +4 -0
- package/templates/quickstart/src/flows/login.flow.ts +3 -1
- package/templates/quickstart/src/flows/shop.flow.ts +6 -0
- package/templates/quickstart/src/flows/smoke.flow.ts +13 -7
- package/templates/quickstart/src/flows/viewer-blocked.flow.ts +6 -2
- package/templates/quickstart/tests/chain-flow.spec.ts +8 -1
- package/templates/scaffold/STRUCTURE.md +23 -3
- package/templates/scaffold/src/blocks/demo-external/mailpit/mailpit-inbox.page.block.ts +30 -0
- package/templates/scaffold/src/blocks/demo-external/mailpit/mailpit-sel.ts +5 -0
- package/templates/scaffold/src/blocks/demo-external/mailpit/methods/assert-email-content.method.block.ts +48 -0
- package/templates/scaffold/src/blocks/demo-external/mailpit/methods/assert-email-received.method.block.ts +49 -0
- package/templates/scaffold/src/blocks/demo-external/mailpit/methods/extract-email-link.method.block.ts +41 -0
- package/templates/scaffold/src/blocks/demo-external/mailpit/methods/open-message.method.block.ts +39 -0
- package/templates/scaffold/src/blocks/demo-external/mailpit/nav-mailpit-inbox.block.ts +20 -0
- package/templates/scaffold/src/blocks/demo-web/demo-sel.ts +1 -0
- package/templates/scaffold/src/blocks/demo-web/docs.html +8 -0
- package/templates/scaffold/src/blocks/demo-web/home.html +4 -0
- package/templates/scaffold/src/blocks/demo-web/methods/assert-hello.method.block.ts +34 -38
- package/templates/scaffold/src/blocks/demo-web/methods/assert-item-added.method.block.ts +38 -0
- package/templates/scaffold/src/blocks/demo-web/nav-verification-link.block.ts +34 -0
- package/templates/scaffold/src/flows/mail-verify.flow.ts +85 -0
- package/templates/scaffold/src/flows/routes-demo.flow.ts +14 -0
- package/templates/scaffold/src/flows/shop.flow.ts +19 -2
- package/templates/scaffold/src/routes/(external)/docs/docs.sel.ts +7 -0
- package/templates/scaffold/src/routes/(external)/docs/nav.block.ts +21 -0
- package/templates/scaffold/src/routes/(external)/docs/page.block.ts +15 -0
- package/templates/scaffold/src/states/demo.mem-keys.ts +25 -1
- package/templates/scaffold/src/states/demo.states.ts +13 -0
- package/templates/scaffold/test-results/.last-run.json +4 -0
- package/templates/scaffold/tests/mail-verify.spec.ts +191 -0
- package/templates/skills/waygraph-blind-pilot.skill.md +61 -0
- package/templates/skills/waygraph-pilot.skill.md +108 -0
- package/templates/quickstart/README-saucedemo-commands.md +0 -72
package/dist/engine.js
CHANGED
|
@@ -797,6 +797,20 @@ export function defineNavBlock(options) {
|
|
|
797
797
|
configurable: false,
|
|
798
798
|
});
|
|
799
799
|
}
|
|
800
|
+
// Same idea, for the url case - only when it's a plain string (a
|
|
801
|
+
// function URL is mem-dependent/dynamic, can't be compared statically
|
|
802
|
+
// without running it). Real, direct request this responds to: an agent
|
|
803
|
+
// driving Blind Pilot had no structured way to ask "which of the links
|
|
804
|
+
// on THIS page are already covered by a NavBlock" without re-parsing
|
|
805
|
+
// every nav.block.ts's own source - this is what `AutoSession` now reads
|
|
806
|
+
// to warn about real, unmapped nav links found live on the page.
|
|
807
|
+
if (typeof options.url === "string") {
|
|
808
|
+
Object.defineProperty(built, "__waygraphNavUrl", {
|
|
809
|
+
value: options.url,
|
|
810
|
+
enumerable: false,
|
|
811
|
+
configurable: false,
|
|
812
|
+
});
|
|
813
|
+
}
|
|
800
814
|
return built;
|
|
801
815
|
}
|
|
802
816
|
/** @see {@link NavClickBlockOptions} */
|
|
@@ -826,6 +840,60 @@ export function defineMethodBlock(base) {
|
|
|
826
840
|
}
|
|
827
841
|
/** @deprecated Prefer {@link defineMethodBlock} - identical helper (0.7 name). */
|
|
828
842
|
export const defineActionBlock = defineMethodBlock;
|
|
843
|
+
/**
|
|
844
|
+
* Sugar for a self-loop-only "pure assertion" Block: no hand-written
|
|
845
|
+
* `act`/`resolve`, just a name, a `checkpoint` tag, and a `verify` array.
|
|
846
|
+
* `resolve` is generated from the one `checkpoint` field given, closing the
|
|
847
|
+
* copy/rename footgun where a hand-restated checkpoint string can silently
|
|
848
|
+
* drift wrong across a copy/pasted file. Mirrors `definePageBlock`'s own
|
|
849
|
+
* construction pattern (flat options in, `defineBlock` built internally).
|
|
850
|
+
* See openspec/changes/waygraph-agent-skill-hardening/spec.md.
|
|
851
|
+
* @example
|
|
852
|
+
* defineAssertBlock({
|
|
853
|
+
* name: "assert-raw-materials-table",
|
|
854
|
+
* checkpoint: "RawMaterials",
|
|
855
|
+
* waitForHeading: "Raw Materials & Lead Times",
|
|
856
|
+
* verify: [Trait.visible(RawMaterialsSel.reorderBadge)],
|
|
857
|
+
* });
|
|
858
|
+
*/
|
|
859
|
+
export function defineAssertBlock(options) {
|
|
860
|
+
const built = defineMethodBlock({
|
|
861
|
+
name: options.name,
|
|
862
|
+
...(options.description ? { description: options.description } : {}),
|
|
863
|
+
...(options.requires ? { requires: options.requires } : {}),
|
|
864
|
+
instruction: {
|
|
865
|
+
async act(page) {
|
|
866
|
+
if (options.waitForHeading !== undefined) {
|
|
867
|
+
await page.getByRole("heading", { name: options.waitForHeading }).waitFor();
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
resolve: () => checkpoint(options.checkpoint),
|
|
871
|
+
verify: options.verify,
|
|
872
|
+
...(options.stubBefore ? { stubBefore: options.stubBefore } : {}),
|
|
873
|
+
...(options.stubAfter ? { stubAfter: options.stubAfter } : {}),
|
|
874
|
+
...(options.stubOnError ? { stubOnError: options.stubOnError } : {}),
|
|
875
|
+
...(options.slides ? { slides: options.slides } : {}),
|
|
876
|
+
},
|
|
877
|
+
});
|
|
878
|
+
// Real bug this closes: `waygraph graph`'s static discovery only knows
|
|
879
|
+
// how to read a Block's Checkpoint tags from an EXPLICIT `<In, Out>`
|
|
880
|
+
// generic written in the source text (or, for Nav/Page Blocks, by calling
|
|
881
|
+
// their own input-independent `resolve()` directly). `defineAssertBlock`'s
|
|
882
|
+
// whole point is skipping that generic - called exactly as documented
|
|
883
|
+
// (`defineAssertBlock({ name, checkpoint, verify })`, no generics), it was
|
|
884
|
+
// silently invisible to both `waygraph graph` and the live Pilot menu
|
|
885
|
+
// ("2 Block(s) skipped (Out not resolvable)", confirmed live against a
|
|
886
|
+
// real veciro-waygraph session). `resolve()` here is ALSO input-
|
|
887
|
+
// independent (always `checkpoint(options.checkpoint)`), so the same
|
|
888
|
+
// resolve()-calling path Nav/Page Blocks already use is reused via this
|
|
889
|
+
// marker instead of requiring authors to write generics just to be found.
|
|
890
|
+
Object.defineProperty(built, "__waygraphKind", {
|
|
891
|
+
value: "assert",
|
|
892
|
+
enumerable: false,
|
|
893
|
+
configurable: false,
|
|
894
|
+
});
|
|
895
|
+
return built;
|
|
896
|
+
}
|
|
829
897
|
function resolvePageMethods(methods) {
|
|
830
898
|
if (!methods)
|
|
831
899
|
return [];
|
|
@@ -884,6 +952,20 @@ export function definePageBlock(options) {
|
|
|
884
952
|
enumerable: false,
|
|
885
953
|
configurable: false,
|
|
886
954
|
});
|
|
955
|
+
// Same marker `defineNavBlock` sets, same reason - a page hub with a
|
|
956
|
+
// `url` (deep-link) is exactly as "known, coverable" as a plain
|
|
957
|
+
// `defineNavBlock`, and in practice most real projects' own nav Blocks
|
|
958
|
+
// ARE page hubs (methods hanging off them), not bare NavBlocks - the real
|
|
959
|
+
// saucedemo fixture this whole package tests against uses definePageBlock
|
|
960
|
+
// for every one of its own nav-* Blocks. Missing this here meant the
|
|
961
|
+
// marker existed but was never actually set on any real project's Blocks.
|
|
962
|
+
if (typeof options.url === "string") {
|
|
963
|
+
Object.defineProperty(built, "__waygraphNavUrl", {
|
|
964
|
+
value: options.url,
|
|
965
|
+
enumerable: false,
|
|
966
|
+
configurable: false,
|
|
967
|
+
});
|
|
968
|
+
}
|
|
887
969
|
if (options.url !== undefined || options.click !== undefined) {
|
|
888
970
|
Object.defineProperty(built, "__waygraphPageDeepLink", {
|
|
889
971
|
value: true,
|
package/dist/graph.d.ts
CHANGED
|
@@ -58,6 +58,24 @@ export declare function findOrphanBlocks(projectDir: string): Promise<OrphanBloc
|
|
|
58
58
|
* edges. NavBlocks (`from: "*"`) count from any state.
|
|
59
59
|
*/
|
|
60
60
|
export declare function findBlockPath(graph: WaygraphGraph, fromTag: string, toTag: string): string[] | null;
|
|
61
|
+
export interface BlockPathStep {
|
|
62
|
+
block: string;
|
|
63
|
+
/** The specific Checkpoint this hop's edge targets - NOT re-derivable by
|
|
64
|
+
* looking up `block` by name afterward, since a union-Out Block (e.g.
|
|
65
|
+
* "Union Out tags create duplicate edges for the same Block", see
|
|
66
|
+
* `discoverGraph`'s own comment above) can have several edges with the
|
|
67
|
+
* same `block` name but different `to` tags; only the specific edge BFS
|
|
68
|
+
* actually routed through here is correct. */
|
|
69
|
+
to: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Same BFS as `findBlockPath`, but returns each hop's specific edge (block
|
|
73
|
+
* name + the Checkpoint it targets), not just the block name - needed by any
|
|
74
|
+
* caller that must verify a step actually landed where the route intended,
|
|
75
|
+
* not just re-guess it afterward. `findBlockPath` itself is unchanged and
|
|
76
|
+
* still used wherever only the block-name sequence matters.
|
|
77
|
+
*/
|
|
78
|
+
export declare function findBlockPathDetailed(graph: WaygraphGraph, fromTag: string, toTag: string): BlockPathStep[] | null;
|
|
61
79
|
/**
|
|
62
80
|
* Walks every `*.block.ts` file under `projectDir` and builds the app's own
|
|
63
81
|
* state graph. Shares the same in-process-import limitation `waygraph
|
package/dist/graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
2
2
|
import { join, dirname, relative, resolve } from "node:path";
|
|
3
3
|
import { matchBlocksSelect, } from "./blocks-select.js";
|
|
4
4
|
/**
|
|
@@ -174,8 +174,49 @@ export function findBlockPath(graph, fromTag, toTag) {
|
|
|
174
174
|
}
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Same BFS as `findBlockPath`, but returns each hop's specific edge (block
|
|
179
|
+
* name + the Checkpoint it targets), not just the block name - needed by any
|
|
180
|
+
* caller that must verify a step actually landed where the route intended,
|
|
181
|
+
* not just re-guess it afterward. `findBlockPath` itself is unchanged and
|
|
182
|
+
* still used wherever only the block-name sequence matters.
|
|
183
|
+
*/
|
|
184
|
+
export function findBlockPathDetailed(graph, fromTag, toTag) {
|
|
185
|
+
if (fromTag === toTag)
|
|
186
|
+
return [];
|
|
187
|
+
const queue = [{ tag: fromTag, path: [] }];
|
|
188
|
+
const visited = new Set([fromTag]);
|
|
189
|
+
while (queue.length > 0) {
|
|
190
|
+
const { tag, path } = queue.shift();
|
|
191
|
+
for (const edge of graph.edges) {
|
|
192
|
+
if (edge.from !== tag && edge.from !== "*")
|
|
193
|
+
continue;
|
|
194
|
+
const nextPath = [...path, { block: edge.block, to: edge.to }];
|
|
195
|
+
if (edge.to === toTag)
|
|
196
|
+
return nextPath;
|
|
197
|
+
if (!visited.has(edge.to)) {
|
|
198
|
+
visited.add(edge.to);
|
|
199
|
+
queue.push({ tag: edge.to, path: nextPath });
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Same real, confirmed reload-caching bug `auto-explore.ts`'s own copy of
|
|
207
|
+
* this function fixes (see its own comment) - `discoverGraph` (used for
|
|
208
|
+
* `this.graph`/path-finding) and `loadBlockLibrary` (used for `this.library`/
|
|
209
|
+
* the live menu) are two independent importers, each with their own
|
|
210
|
+
* duplicate `importModule`, so each needed the same mtime-based cache-bust
|
|
211
|
+
* fix separately - fixing only one left the other still serving a session's
|
|
212
|
+
* `reloadLibrary()` a stale (or, for a brand-new file only ever discovered
|
|
213
|
+
* through THIS path, silently absent) graph.
|
|
214
|
+
*/
|
|
177
215
|
async function importModule(filePath) {
|
|
178
|
-
const
|
|
216
|
+
const resolved = resolve(filePath);
|
|
217
|
+
const url = new URL(`file://${resolved}`);
|
|
218
|
+
const mtimeMs = statSync(resolved).mtimeMs;
|
|
219
|
+
url.searchParams.set("t", String(mtimeMs));
|
|
179
220
|
return (await import(url.href));
|
|
180
221
|
}
|
|
181
222
|
function isBlockLike(val) {
|
|
@@ -192,6 +233,10 @@ function isNavBlockMarked(val) {
|
|
|
192
233
|
const kind = val.__waygraphKind;
|
|
193
234
|
return kind === "nav" || kind === "page";
|
|
194
235
|
}
|
|
236
|
+
/** Set by `defineAssertBlock` (non-enumerable) - see src/engine.ts. */
|
|
237
|
+
function isAssertBlockMarked(val) {
|
|
238
|
+
return val.__waygraphKind === "assert";
|
|
239
|
+
}
|
|
195
240
|
/**
|
|
196
241
|
* Resolves `typeName` to every literal Checkpoint tag it can mean, within
|
|
197
242
|
* one `*.states.ts` file's own source text - `type X = Checkpoint<"Tag">`
|
|
@@ -341,6 +386,24 @@ export async function discoverGraph(projectDir, opts) {
|
|
|
341
386
|
})) {
|
|
342
387
|
continue;
|
|
343
388
|
}
|
|
389
|
+
if (isAssertBlockMarked(exported)) {
|
|
390
|
+
try {
|
|
391
|
+
// Same input-independent resolve() shape Nav/Page Blocks already
|
|
392
|
+
// get this shortcut for - defineAssertBlock's own resolve() is
|
|
393
|
+
// always `() => checkpoint(options.checkpoint)`, so no <In, Out>
|
|
394
|
+
// generic needs to appear in source text for this to be found.
|
|
395
|
+
const resolveFn = exported.instruction.resolve;
|
|
396
|
+
const resolved = await resolveFn(undefined);
|
|
397
|
+
const to = resolved.__state;
|
|
398
|
+
nodeTags.add(to);
|
|
399
|
+
// Self-loop by construction (defineAssertBlock is self-loop-only).
|
|
400
|
+
edges.push({ block: blockName, file: relFile, from: to, to, kind: "action" });
|
|
401
|
+
}
|
|
402
|
+
catch {
|
|
403
|
+
skipped.push({ block: blockName, file: relFile, reason: "assertBlock resolve() threw" });
|
|
404
|
+
}
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
344
407
|
if (isNavBlockMarked(exported)) {
|
|
345
408
|
try {
|
|
346
409
|
// NavBlock / PageBlock resolve() ignores input - always checkpoint(tag).
|
package/dist/highlights.d.ts
CHANGED
|
@@ -200,6 +200,20 @@ export declare function applyDevicePhase(prev: DeviceState | undefined, phase: {
|
|
|
200
200
|
device: DeviceState | undefined;
|
|
201
201
|
sync: "set" | "clear" | "keep";
|
|
202
202
|
};
|
|
203
|
+
/**
|
|
204
|
+
* The `#wg-ring` / `#wg-ring-label` CSS (tone/size/weight variants) - the
|
|
205
|
+
* actual visual language `cli.ts`'s own demo stepper paints with. Extracted
|
|
206
|
+
* here (not left as a private `cli.ts` constant) so anything else wanting the
|
|
207
|
+
* SAME "waygraph vision" ring can import pure CSS text, not the rendering
|
|
208
|
+
* engine around it - `cli.ts` runs `main().catch(...)` unconditionally at
|
|
209
|
+
* module load with no `import.meta.url` guard, so importing anything from it
|
|
210
|
+
* is unsafe as a library dependency (see `pilot-overlay.ts`'s own doc
|
|
211
|
+
* comment for the same reasoning re: the badge/panel). This file has always
|
|
212
|
+
* been the pure, side-effect-free home for tone/size/weight - the CSS that
|
|
213
|
+
* renders them belongs alongside it for the same reason. `cli.ts` imports
|
|
214
|
+
* this constant instead of keeping its own duplicate copy.
|
|
215
|
+
*/
|
|
216
|
+
export declare const WAYGRAPH_RING_CSS: string;
|
|
203
217
|
/** One named highlight slot on a block (selector + caption). */
|
|
204
218
|
export interface WaygraphHighlightStub extends FixtureDurationFields {
|
|
205
219
|
selector: string;
|
|
@@ -445,8 +459,13 @@ export interface WaygraphSlide extends FixtureDurationFields {
|
|
|
445
459
|
/**
|
|
446
460
|
* Demo ring tones (iconified).
|
|
447
461
|
* Automation (`auto`) is gray so authored planned/info/warning/danger/success stand out.
|
|
462
|
+
* `orange` added for Blind Pilot's own real, direct user request: a visible
|
|
463
|
+
* color distinction between a real Playwright-driven action (a Block run,
|
|
464
|
+
* or a raw click/type/upload - `auto` gray, already meant exactly this) and
|
|
465
|
+
* a pure DOM inspection (`auto dom` - orange, new) - "gray is waygraph
|
|
466
|
+
* playwright run. orange is dom check."
|
|
448
467
|
*/
|
|
449
|
-
export type HighlightTone = "planned" | "auto" | "info" | "warning" | "danger" | "success";
|
|
468
|
+
export type HighlightTone = "planned" | "auto" | "info" | "warning" | "danger" | "success" | "orange";
|
|
450
469
|
/** Ring + label scale. */
|
|
451
470
|
export type HighlightSize = "sm" | "md" | "lg";
|
|
452
471
|
/** Label font weight. */
|
package/dist/highlights.js
CHANGED
|
@@ -183,6 +183,63 @@ export function applyDevicePhase(prev, phase) {
|
|
|
183
183
|
}
|
|
184
184
|
return { device: prev, sync: "keep" };
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* The `#wg-ring` / `#wg-ring-label` CSS (tone/size/weight variants) - the
|
|
188
|
+
* actual visual language `cli.ts`'s own demo stepper paints with. Extracted
|
|
189
|
+
* here (not left as a private `cli.ts` constant) so anything else wanting the
|
|
190
|
+
* SAME "waygraph vision" ring can import pure CSS text, not the rendering
|
|
191
|
+
* engine around it - `cli.ts` runs `main().catch(...)` unconditionally at
|
|
192
|
+
* module load with no `import.meta.url` guard, so importing anything from it
|
|
193
|
+
* is unsafe as a library dependency (see `pilot-overlay.ts`'s own doc
|
|
194
|
+
* comment for the same reasoning re: the badge/panel). This file has always
|
|
195
|
+
* been the pure, side-effect-free home for tone/size/weight - the CSS that
|
|
196
|
+
* renders them belongs alongside it for the same reason. `cli.ts` imports
|
|
197
|
+
* this constant instead of keeping its own duplicate copy.
|
|
198
|
+
*/
|
|
199
|
+
export const WAYGRAPH_RING_CSS = "#wg-ring{position:fixed;z-index:2147483646;pointer-events:none;opacity:0;" +
|
|
200
|
+
"border:2.5px solid #7C3AED;border-radius:10px;" +
|
|
201
|
+
// Opacity fade only - NEVER transition border-color/box-shadow. Tone swaps
|
|
202
|
+
// (auto gray -> planned purple -> warning yellow) must snap instantly;
|
|
203
|
+
// color transitions read as a muddy gray/purple/yellow morph on ring 2+.
|
|
204
|
+
"box-shadow:0 0 0 4px rgba(124,58,237,.16);transition:opacity .3s ease;}" +
|
|
205
|
+
// Planned (stubs / fixtures / YAP / instruction.highlights) = purple.
|
|
206
|
+
// Automation (verify fallback, unmatched fill/click) = gray - operators
|
|
207
|
+
// can ignore engine checks and watch purple + semantic tones.
|
|
208
|
+
"#wg-ring[data-tone=planned]{border-color:#7C3AED;box-shadow:0 0 0 4px rgba(124,58,237,.16);}" +
|
|
209
|
+
"#wg-ring[data-tone=auto]{border-color:#9CA3AF;box-shadow:0 0 0 4px rgba(156,163,175,.28);}" +
|
|
210
|
+
"#wg-ring[data-tone=info]{border-color:#3B82F6;box-shadow:0 0 0 4px rgba(59,130,246,.22);}" +
|
|
211
|
+
"#wg-ring[data-tone=warning]{border-color:#EAB308;box-shadow:0 0 0 4px rgba(234,179,8,.22);}" +
|
|
212
|
+
"#wg-ring[data-tone=danger]{border-color:#EF4444;box-shadow:0 0 0 4px rgba(239,68,68,.22);}" +
|
|
213
|
+
"#wg-ring[data-tone=success]{border-color:#22C55E;box-shadow:0 0 0 4px rgba(34,197,94,.22);}" +
|
|
214
|
+
// Real, direct user request: a visible color distinction between a real
|
|
215
|
+
// Playwright-driven action (auto gray, unchanged) and a pure DOM
|
|
216
|
+
// inspection (this - orange).
|
|
217
|
+
"#wg-ring[data-tone=orange]{border-color:#F97316;box-shadow:0 0 0 4px rgba(249,115,22,.22);}" +
|
|
218
|
+
// A real element, not a ::after pseudo-element - a pseudo-element's
|
|
219
|
+
// position is CSS-relative to the ring's own box (left:0 always meant
|
|
220
|
+
// "the ring's own left edge"), so it had no way to be clamped back onto
|
|
221
|
+
// screen when that box sat near a viewport edge - the label's text just
|
|
222
|
+
// ran off, invisibly, with no overflow guard at all. A real sibling can
|
|
223
|
+
// be measured (its actual rendered width) and repositioned in JS -
|
|
224
|
+
// pushed back onto screen, same width, never shrunk. See
|
|
225
|
+
// window.__wgPositionRing in cli.ts's own installOverlay.
|
|
226
|
+
"#wg-ring-label{position:fixed;z-index:2147483646;pointer-events:none;opacity:0;" +
|
|
227
|
+
"max-width:min(360px,70vw);white-space:normal;padding:6px 10px;border-radius:7px;background:#7C3AED;color:#fff;" +
|
|
228
|
+
"font:600 12px/1.35 system-ui,sans-serif;transition:opacity .3s ease;}" +
|
|
229
|
+
"#wg-ring-label[data-tone=planned]{background:#7C3AED;color:#fff;}" +
|
|
230
|
+
"#wg-ring-label[data-tone=auto]{background:#6B7280;color:#fff;}" +
|
|
231
|
+
"#wg-ring-label[data-tone=info]{background:#2563EB;color:#fff;}" +
|
|
232
|
+
"#wg-ring-label[data-tone=warning]{background:#EAB308;color:#1c1917;}" +
|
|
233
|
+
"#wg-ring-label[data-tone=danger]{background:#DC2626;color:#fff;}" +
|
|
234
|
+
"#wg-ring-label[data-tone=success]{background:#16A34A;color:#fff;}" +
|
|
235
|
+
"#wg-ring-label[data-tone=orange]{background:#EA580C;color:#fff;}" +
|
|
236
|
+
// size: ring pad + label font; weight: label boldness
|
|
237
|
+
"#wg-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}" +
|
|
238
|
+
"#wg-ring[data-size=lg]{border-width:4px;border-radius:12px;}" +
|
|
239
|
+
"#wg-ring-label[data-size=sm]{font-size:10px;line-height:1.25;padding:4px 7px;border-radius:5px;}" +
|
|
240
|
+
"#wg-ring-label[data-size=lg]{font-size:16px;line-height:1.35;padding:8px 14px;border-radius:9px;max-width:min(480px,85vw);}" +
|
|
241
|
+
"#wg-ring-label[data-weight=bold]{font-weight:800;}" +
|
|
242
|
+
"#wg-ring-label[data-weight=normal]{font-weight:600;}";
|
|
186
243
|
/** Apply Flow defaults under per-slot authored values (slot wins when set). */
|
|
187
244
|
export function applyHighlightStyleDefaults(slot, defaults) {
|
|
188
245
|
const tone = slot.tone !== undefined && slot.tone !== ""
|
|
@@ -209,6 +266,7 @@ const TONE_ICONS = {
|
|
|
209
266
|
warning: "!",
|
|
210
267
|
danger: "x",
|
|
211
268
|
success: "+",
|
|
269
|
+
orange: "",
|
|
212
270
|
};
|
|
213
271
|
/** Map author aliases (`error` -> danger) to a canonical tone. */
|
|
214
272
|
export function normalizeHighlightTone(raw) {
|
|
@@ -225,6 +283,8 @@ export function normalizeHighlightTone(raw) {
|
|
|
225
283
|
return "danger";
|
|
226
284
|
if (t === "success" || t === "ok" || t === "green")
|
|
227
285
|
return "success";
|
|
286
|
+
if (t === "orange" || t === "amber" || t === "dom" || t === "inspect")
|
|
287
|
+
return "orange";
|
|
228
288
|
if (t === "planned" || t === "purple" || t === "authored")
|
|
229
289
|
return "planned";
|
|
230
290
|
return "planned";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export type { Checkpoint, Instruction, Block, DefinedBlock, Start, WaygraphInstanceOption } from "./types.js";
|
|
2
2
|
export { connect, checkpoint } from "./types.js";
|
|
3
3
|
export { MemKey, MemPage, key, keyGroup } from "./mem-page.js";
|
|
4
|
-
export { Trait, urlMatches, textEquals, visible } from "./trait.js";
|
|
5
|
-
export { runGraph, spawnTab, narrate, Engine, start, end, branch, withVerify, modVerify, modVerifyAll, defineBlock, defineNavBlock, defineNavClickBlock, defineMethodBlock, defineActionBlock, definePageBlock, defineEffectBlock, defineMemEffectBlock, defineMemNavBlock, locate, composeBlock, fastForwardComposeBlock, isFastForwardBlock, preflight, withSessionReset, withTitle, withDemoPace, withBlockPace, withHighlightStyle, withExpectedFailure, withHighlightFixtures, chainFlow, } from "./engine.js";
|
|
6
|
-
export { resolveHighlightSlots, resolveSlides, runStubPhase, resolveFixtureDwellMs, resolveSlideDwellMs, formatHighlightCaption, hasAuthoredStubAfter, hasAuthoredStubOnError, normalizeHighlightTone, normalizeDemoPace, normalizeHighlightSize, normalizeHighlightWeight, applyHighlightStyleDefaults, toneIconPrefix, resolveStepDemoPace, demoPaceScale, demoPaceIsBlitz, demoPaceIsFast, demoPaceIsSlow, demoPaceGateMs, formatDemoPaceBadge, formatDemoPaceLabel, normalizeTodos, normalizeTodoPos, normalizeTodoStyle, buildTodoDock, applyTodoPhase, advanceTodoDock, completeSequentialTodoDock, applyDevicePhase, resolveDeviceState, normalizeDevicePreset, normalizeDeviceOrientation, applyOrientation, orientationFromViewport, DEVICE_PRESETS, FIXTURE_DURATION_MS_DEFAULT, FIXTURE_DURATION_FAST_MS_DEFAULT, FIXTURE_DURATION_SLOW_MS_DEFAULT, SLIDE_DURATION_MS_DEFAULT, SLIDE_DURATION_FAST_MS_DEFAULT, } from "./highlights.js";
|
|
4
|
+
export { Trait, urlMatches, textEquals, visible, frameVisible, frameTextEquals, frameContainsText } from "./trait.js";
|
|
5
|
+
export { runGraph, spawnTab, narrate, Engine, start, end, branch, withVerify, modVerify, modVerifyAll, defineBlock, defineNavBlock, defineNavClickBlock, defineMethodBlock, defineActionBlock, defineAssertBlock, definePageBlock, defineEffectBlock, defineMemEffectBlock, defineMemNavBlock, locate, composeBlock, fastForwardComposeBlock, isFastForwardBlock, preflight, withSessionReset, withTitle, withDemoPace, withBlockPace, withHighlightStyle, withExpectedFailure, withHighlightFixtures, chainFlow, } from "./engine.js";
|
|
6
|
+
export { resolveHighlightSlots, resolveSlides, runStubPhase, resolveFixtureDwellMs, resolveSlideDwellMs, formatHighlightCaption, hasAuthoredStubAfter, hasAuthoredStubOnError, normalizeHighlightTone, normalizeDemoPace, normalizeHighlightSize, normalizeHighlightWeight, applyHighlightStyleDefaults, toneIconPrefix, resolveStepDemoPace, demoPaceScale, demoPaceIsBlitz, demoPaceIsFast, demoPaceIsSlow, demoPaceGateMs, formatDemoPaceBadge, formatDemoPaceLabel, normalizeTodos, normalizeTodoPos, normalizeTodoStyle, buildTodoDock, applyTodoPhase, advanceTodoDock, completeSequentialTodoDock, applyDevicePhase, resolveDeviceState, normalizeDevicePreset, normalizeDeviceOrientation, applyOrientation, orientationFromViewport, DEVICE_PRESETS, FIXTURE_DURATION_MS_DEFAULT, FIXTURE_DURATION_FAST_MS_DEFAULT, FIXTURE_DURATION_SLOW_MS_DEFAULT, SLIDE_DURATION_MS_DEFAULT, SLIDE_DURATION_FAST_MS_DEFAULT, WAYGRAPH_RING_CSS, } from "./highlights.js";
|
|
7
7
|
export type { WaygraphHighlightStub, WaygraphHighlightFixture, WaygraphSlide, WaygraphTodoItem, WaygraphTodoInput, WaygraphTodoGroup, WaygraphTodoGroupInput, WaygraphTodosOpts, TodoDockState, TodoListStyle, FixtureDurationFields, HighlightStubPhase, HighlightStubPhaseName, HighlightFixtureMap, ResolvedHighlight, WaygraphHighlight, HighlightTone, HighlightSize, HighlightWeight, HighlightStyleDefaults, DemoPace, DemoPaceName, StubCtx, StubLifecycleFn, StubPhaseResult, StubPhaseFixtures, DevicePreset, DeviceViewport, DeviceState, DeviceOrientation, } from "./highlights.js";
|
|
8
|
-
export type { Flow, EngineConfig, ComposedBlock, FastForwardComposedBlock, RunGraphOptions, BlockInfo, NavBlock, NavBlockOptions, NavClickBlock, NavClickBlockOptions, MethodBlock, ActionBlock, PageBlock, PageBlockOptions, PageMethodEntry, EffectBlock, MemEffectBlock, MemNavBlock, } from "./engine.js";
|
|
8
|
+
export type { Flow, EngineConfig, ComposedBlock, FastForwardComposedBlock, RunGraphOptions, BlockInfo, NavBlock, NavBlockOptions, NavClickBlock, NavClickBlockOptions, MethodBlock, ActionBlock, AssertBlockOptions, PageBlock, PageBlockOptions, PageMethodEntry, EffectBlock, MemEffectBlock, MemNavBlock, } from "./engine.js";
|
|
9
9
|
export type { ActionPage } from "./types.js";
|
|
10
10
|
export { discoverGraph, toMermaid, findOrphanBlocks, findBlockPath } from "./graph.js";
|
|
11
11
|
export type { WaygraphGraph, WaygraphNode, WaygraphEdge, SkippedBlock, OrphanBlock } from "./graph.js";
|
|
@@ -18,3 +18,7 @@ export { buildCoverageReport, collectGraphEdgeKeys, defaultCoverageOutPath, form
|
|
|
18
18
|
export type { TraverseCoverageReport } from "./traverse-coverage.js";
|
|
19
19
|
export { WG_UI_SEL, WG_READY_PANEL_SEL, WG_READY_AUTO_SEL, WG_READY_BANNER_SEL, readWgOverlayBeacon, readWgOverlayBeaconInPage, assertWgOverlayReady, } from "./overlay-beacon.js";
|
|
20
20
|
export type { WgModalKind, WgBeaconRow } from "./overlay-beacon.js";
|
|
21
|
+
export { AutoSession, stubFilePath } from "./auto-session.js";
|
|
22
|
+
export type { AutoSessionInit, SessionSnapshot, SessionSnapshotEdge, SessionSnapshotSection, ApplyPickResult, ApplyPathResult, TraceStep, ConsoleLogEntry, StorageSnapshot, ServiceWorkerRegistrationInfo, CookieInfo, StubFileKind, } from "./auto-session.js";
|
|
23
|
+
export { pilotStart } from "./pilot.js";
|
|
24
|
+
export type { PilotStartResult } from "./pilot.js";
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export { connect, checkpoint } from "./types.js";
|
|
2
2
|
export { MemKey, MemPage, key, keyGroup } from "./mem-page.js";
|
|
3
|
-
export { Trait, urlMatches, textEquals, visible } from "./trait.js";
|
|
4
|
-
export { runGraph, spawnTab, narrate, Engine, start, end, branch, withVerify, modVerify, modVerifyAll, defineBlock, defineNavBlock, defineNavClickBlock, defineMethodBlock, defineActionBlock, definePageBlock, defineEffectBlock, defineMemEffectBlock, defineMemNavBlock, locate, composeBlock, fastForwardComposeBlock, isFastForwardBlock, preflight, withSessionReset, withTitle, withDemoPace, withBlockPace, withHighlightStyle, withExpectedFailure, withHighlightFixtures, chainFlow, } from "./engine.js";
|
|
5
|
-
export { resolveHighlightSlots, resolveSlides, runStubPhase, resolveFixtureDwellMs, resolveSlideDwellMs, formatHighlightCaption, hasAuthoredStubAfter, hasAuthoredStubOnError, normalizeHighlightTone, normalizeDemoPace, normalizeHighlightSize, normalizeHighlightWeight, applyHighlightStyleDefaults, toneIconPrefix, resolveStepDemoPace, demoPaceScale, demoPaceIsBlitz, demoPaceIsFast, demoPaceIsSlow, demoPaceGateMs, formatDemoPaceBadge, formatDemoPaceLabel, normalizeTodos, normalizeTodoPos, normalizeTodoStyle, buildTodoDock, applyTodoPhase, advanceTodoDock, completeSequentialTodoDock, applyDevicePhase, resolveDeviceState, normalizeDevicePreset, normalizeDeviceOrientation, applyOrientation, orientationFromViewport, DEVICE_PRESETS, FIXTURE_DURATION_MS_DEFAULT, FIXTURE_DURATION_FAST_MS_DEFAULT, FIXTURE_DURATION_SLOW_MS_DEFAULT, SLIDE_DURATION_MS_DEFAULT, SLIDE_DURATION_FAST_MS_DEFAULT, } from "./highlights.js";
|
|
3
|
+
export { Trait, urlMatches, textEquals, visible, frameVisible, frameTextEquals, frameContainsText } from "./trait.js";
|
|
4
|
+
export { runGraph, spawnTab, narrate, Engine, start, end, branch, withVerify, modVerify, modVerifyAll, defineBlock, defineNavBlock, defineNavClickBlock, defineMethodBlock, defineActionBlock, defineAssertBlock, definePageBlock, defineEffectBlock, defineMemEffectBlock, defineMemNavBlock, locate, composeBlock, fastForwardComposeBlock, isFastForwardBlock, preflight, withSessionReset, withTitle, withDemoPace, withBlockPace, withHighlightStyle, withExpectedFailure, withHighlightFixtures, chainFlow, } from "./engine.js";
|
|
5
|
+
export { resolveHighlightSlots, resolveSlides, runStubPhase, resolveFixtureDwellMs, resolveSlideDwellMs, formatHighlightCaption, hasAuthoredStubAfter, hasAuthoredStubOnError, normalizeHighlightTone, normalizeDemoPace, normalizeHighlightSize, normalizeHighlightWeight, applyHighlightStyleDefaults, toneIconPrefix, resolveStepDemoPace, demoPaceScale, demoPaceIsBlitz, demoPaceIsFast, demoPaceIsSlow, demoPaceGateMs, formatDemoPaceBadge, formatDemoPaceLabel, normalizeTodos, normalizeTodoPos, normalizeTodoStyle, buildTodoDock, applyTodoPhase, advanceTodoDock, completeSequentialTodoDock, applyDevicePhase, resolveDeviceState, normalizeDevicePreset, normalizeDeviceOrientation, applyOrientation, orientationFromViewport, DEVICE_PRESETS, FIXTURE_DURATION_MS_DEFAULT, FIXTURE_DURATION_FAST_MS_DEFAULT, FIXTURE_DURATION_SLOW_MS_DEFAULT, SLIDE_DURATION_MS_DEFAULT, SLIDE_DURATION_FAST_MS_DEFAULT, WAYGRAPH_RING_CSS, } from "./highlights.js";
|
|
6
6
|
export { discoverGraph, toMermaid, findOrphanBlocks, findBlockPath } from "./graph.js";
|
|
7
7
|
export { isFileSelectToken, parseBlocksSelect, matchBlocksSelect, globToRegExp, } from "./blocks-select.js";
|
|
8
8
|
export { EdgeLeaseCoordinator } from "./traverse-lease.js";
|
|
9
9
|
export { runTraverse } from "./traverse-run.js";
|
|
10
10
|
export { buildCoverageReport, collectGraphEdgeKeys, defaultCoverageOutPath, formatCoverageLine, normalizeHitKey, parseMinEdgeCoverage, writeCoverageReport, } from "./traverse-coverage.js";
|
|
11
11
|
export { WG_UI_SEL, WG_READY_PANEL_SEL, WG_READY_AUTO_SEL, WG_READY_BANNER_SEL, readWgOverlayBeacon, readWgOverlayBeaconInPage, assertWgOverlayReady, } from "./overlay-beacon.js";
|
|
12
|
+
export { AutoSession, stubFilePath } from "./auto-session.js";
|
|
13
|
+
export { pilotStart } from "./pilot.js";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small, self-contained on-page indicator for a live AutoSession -
|
|
3
|
+
* "this browser is being driven by Waygraph," plus an expandable panel
|
|
4
|
+
* showing the session's own current live menu. Real, direct user request:
|
|
5
|
+
* a headful Pilot session looks like an ordinary browser tab with no
|
|
6
|
+
* indication anything is driving it, which matters once a human might be
|
|
7
|
+
* co-driving the same visible session (see `AutoSession.resync()`'s own
|
|
8
|
+
* doc comment for the related state-desync problem that scenario causes).
|
|
9
|
+
*
|
|
10
|
+
* Deliberately NOT built on `src/cli.ts`'s own demo-panel/banner overlay
|
|
11
|
+
* system, for the same reason `pilot-v1`'s narrate-mode ring renderer
|
|
12
|
+
* wasn't either (see the git history at tag
|
|
13
|
+
* `waygraph-pilot-v1-logs-prettified`): `cli.ts` runs `main().catch(...)`
|
|
14
|
+
* unconditionally at module load with no `import.meta.url` guard, so
|
|
15
|
+
* importing anything from it here would trigger the whole CLI's argument
|
|
16
|
+
* dispatch as a side effect of loading a library module - unsafe. This
|
|
17
|
+
* ships its own small, purpose-built badge + panel instead.
|
|
18
|
+
*/
|
|
19
|
+
import type { Page } from "@playwright/test";
|
|
20
|
+
import type { SessionSnapshot } from "./auto-session.js";
|
|
21
|
+
import { type HighlightTone } from "./highlights.js";
|
|
22
|
+
/**
|
|
23
|
+
* Bottom-left transient toast, separate from the persistent bottom-right
|
|
24
|
+
* badge - real, direct user request: something that visibly flags "a
|
|
25
|
+
* command is running" / "the map just changed" distinct from the
|
|
26
|
+
* always-on Checkpoint badge. Self-clearing (CSS fade after a timeout),
|
|
27
|
+
* not tied to the next `currentMenu()` snapshot the way the badge is,
|
|
28
|
+
* since some callers (rawClick/rawType/rawGoto/reloadLibrary/applyPick)
|
|
29
|
+
* only call `currentMenu()` again once the whole operation - including
|
|
30
|
+
* this toast's own lifetime - should already be over.
|
|
31
|
+
*/
|
|
32
|
+
export declare function showPilotActivity(page: Page, text: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* "browser-use"-style vision box: a ring drawn around the exact element
|
|
35
|
+
* `auto dom --selector <sel>` just inspected, so a human watching a headful
|
|
36
|
+
* Pilot session can see what the agent is actually looking at, not just a
|
|
37
|
+
* JSON blob in a terminal. Real, direct user request.
|
|
38
|
+
*
|
|
39
|
+
* Reuses the real `#wg-ring`/`#wg-ring-label` elements + `WAYGRAPH_RING_CSS`
|
|
40
|
+
* (see `highlights.ts`) - the exact same visual language `cli.ts`'s own demo
|
|
41
|
+
* stepper paints rings with, not a separate look-alike. Still a purpose-built
|
|
42
|
+
* renderer here (position/show/hide only, via plain `getBoundingClientRect` -
|
|
43
|
+
* no camera zoom/spotlight/todo-dock/pacing), since that whole engine still
|
|
44
|
+
* lives in `cli.ts`, which this file continues to avoid importing (see this
|
|
45
|
+
* file's own header). Auto-fades a few real seconds after showing (or
|
|
46
|
+
* sooner if explicitly replaced/hidden first) - tuned live twice: an
|
|
47
|
+
* original 2.5s fade read as gone before it could be seen, a since-tried
|
|
48
|
+
* "stay up indefinitely" alternative read as lingering clutter instead.
|
|
49
|
+
*
|
|
50
|
+
* `tone` defaults to "auto" (gray) - real, direct user request: "gray is
|
|
51
|
+
* waygraph playwright run. orange is dom check" - a real Block run or a
|
|
52
|
+
* raw click/type/upload IS a real Playwright-driven action (`auto` was
|
|
53
|
+
* always documented as meaning exactly that), while a pure `auto dom` read
|
|
54
|
+
* touches nothing, so it gets its own "orange" tone instead.
|
|
55
|
+
*/
|
|
56
|
+
export declare function showPilotVision(page: Page, selector: string, label: string, tone?: HighlightTone): Promise<void>;
|
|
57
|
+
/** Minimal shape needed to render the graph tree - matches WaygraphGraph. */
|
|
58
|
+
export interface PilotOverlayGraph {
|
|
59
|
+
nodes: readonly {
|
|
60
|
+
checkpoint: string;
|
|
61
|
+
}[];
|
|
62
|
+
edges: readonly {
|
|
63
|
+
block: string;
|
|
64
|
+
from: string;
|
|
65
|
+
to: string;
|
|
66
|
+
kind: "nav" | "action";
|
|
67
|
+
}[];
|
|
68
|
+
}
|
|
69
|
+
export interface PilotOverlayInfo {
|
|
70
|
+
sessionId: string | undefined;
|
|
71
|
+
snapshot: SessionSnapshot;
|
|
72
|
+
/**
|
|
73
|
+
* The WHOLE project's graph, not just what's reachable from the current
|
|
74
|
+
* page - real, direct user request: "i have a button where it shows all
|
|
75
|
+
* the nodes like a node tree stuff". Optional so a caller that doesn't
|
|
76
|
+
* have it handy (or doesn't want the extra payload every call) can omit
|
|
77
|
+
* it; the "All nodes" tab just shows nothing until one arrives.
|
|
78
|
+
*/
|
|
79
|
+
graph?: PilotOverlayGraph;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Refreshes the badge text and the (possibly-collapsed) panel's two tabs
|
|
83
|
+
* ("Here" - current live menu; "All nodes" - whole project graph as a
|
|
84
|
+
* tree). Never throws - a page mid-navigation when this fires is a real,
|
|
85
|
+
* expected timing case, not an error worth failing the caller's own real
|
|
86
|
+
* operation over.
|
|
87
|
+
*/
|
|
88
|
+
export declare function updatePilotOverlay(page: Page, info: PilotOverlayInfo): Promise<void>;
|