waygraph 0.15.53 → 0.16.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 +8 -3
- package/bin/waygraph +2 -2
- package/dist/analysis/check.d.ts +38 -0
- package/dist/analysis/check.js +87 -0
- package/dist/analysis/coverage-gap.d.ts +1 -1
- package/dist/analysis/coverage-gap.js +14 -37
- package/dist/analysis/flow-source.d.ts +9 -0
- package/dist/analysis/flow-source.js +25 -0
- package/dist/analysis/graph.d.ts +13 -14
- package/dist/analysis/graph.js +48 -371
- package/dist/analysis/map-check.js +4 -39
- package/dist/analysis/practices-check.d.ts +1 -1
- package/dist/analysis/practices-check.js +24 -45
- package/dist/cli/args.d.ts +23 -0
- package/dist/cli/args.js +20 -0
- package/dist/{cli.d.ts → cli/cli.d.ts} +0 -1
- package/dist/{cli.js → cli/cli.js} +10 -9
- package/dist/{commands → cli/commands}/agent-dive-scaffold.js +35 -64
- package/dist/cli/commands/agent-dive.js +42 -0
- package/dist/{commands → cli/commands}/check.d.ts +0 -1
- package/dist/cli/commands/check.js +104 -0
- package/dist/cli/commands/codemod-checkpoints.d.ts +18 -0
- package/dist/cli/commands/codemod-checkpoints.js +186 -0
- package/dist/cli/commands/codemod-flows.d.ts +18 -0
- package/dist/cli/commands/codemod-flows.js +284 -0
- package/dist/cli/commands/codemod-stubs.d.ts +10 -0
- package/dist/cli/commands/codemod-stubs.js +187 -0
- package/dist/{commands → cli/commands}/extensions.js +5 -4
- package/dist/{commands → cli/commands}/init.js +1 -2
- package/dist/{commands → cli/commands}/list.js +9 -7
- package/dist/cli/commands/manifest.d.ts +2 -0
- package/dist/cli/commands/manifest.js +20 -0
- package/dist/cli/commands/map.js +57 -0
- package/dist/{commands → cli/commands}/run.d.ts +0 -1
- package/dist/cli/commands/run.js +64 -0
- package/dist/{commands → cli/commands}/session.js +61 -88
- package/dist/{commands → cli/commands}/test.js +11 -14
- package/dist/cli/commands/traverse.js +105 -0
- package/dist/{commands → cli/commands}/try.js +29 -25
- package/dist/{commands → cli/commands}/upgrade.js +40 -4
- package/dist/cli/flags.d.ts +193 -16
- package/dist/cli/flags.js +179 -234
- package/dist/cli/run-chain.d.ts +1 -0
- package/dist/cli/run-chain.js +42 -7
- package/dist/cli/usage.d.ts +1 -1
- package/dist/cli/usage.js +21 -53
- package/dist/cli/util.d.ts +2 -2
- package/dist/cli/util.js +2 -3
- package/dist/{highlights → demo/narration}/css.d.ts +1 -1
- package/dist/{highlights → demo/narration}/css.js +2 -3
- package/dist/{highlights → demo/narration}/demo-pace.d.ts +7 -11
- package/dist/{highlights → demo/narration}/demo-pace.js +9 -11
- package/dist/{highlights → demo/narration}/device.d.ts +4 -2
- package/dist/{highlights → demo/narration}/device.js +3 -1
- package/dist/demo/narration/merge.d.ts +8 -0
- package/dist/demo/narration/merge.js +71 -0
- package/dist/{highlights/run-phase.d.ts → demo/narration/narration.d.ts} +10 -14
- package/dist/{highlights/run-phase.js → demo/narration/narration.js} +25 -94
- package/dist/{highlights → demo/narration}/shorthand.d.ts +1 -1
- package/dist/demo/narration/stub-ctx.d.ts +8 -0
- package/dist/demo/narration/stub-ctx.js +164 -0
- package/dist/{highlights → demo/narration}/style.d.ts +1 -7
- package/dist/{highlights → demo/narration}/style.js +1 -41
- package/dist/{highlights → demo/narration}/todo-dock.d.ts +3 -3
- package/dist/{highlights → demo/narration}/todo-dock.js +13 -30
- package/dist/demo/overlay/auto-chrome.d.ts +7 -0
- package/dist/demo/overlay/auto-chrome.js +97 -0
- package/dist/{session/overlay-beacon.d.ts → demo/overlay/beacon.d.ts} +7 -0
- package/dist/{session/overlay-beacon.js → demo/overlay/beacon.js} +5 -0
- package/dist/demo/overlay/cursor.d.ts +12 -0
- package/dist/demo/overlay/cursor.js +142 -0
- package/dist/demo/overlay/device-stage.d.ts +13 -0
- package/dist/demo/overlay/device-stage.js +396 -0
- package/dist/demo/overlay/inpage/banner.d.ts +1 -0
- package/dist/demo/overlay/inpage/banner.js +160 -0
- package/dist/demo/overlay/inpage/caption.d.ts +2 -0
- package/dist/demo/overlay/inpage/caption.js +24 -0
- package/dist/demo/overlay/inpage/core.d.ts +1 -0
- package/dist/demo/overlay/inpage/core.js +345 -0
- package/dist/demo/overlay/inpage/device-chip.d.ts +1 -0
- package/dist/demo/overlay/inpage/device-chip.js +191 -0
- package/dist/demo/overlay/inpage/network.d.ts +9 -0
- package/dist/demo/overlay/inpage/network.js +200 -0
- package/dist/demo/overlay/inpage/panel-chrome.d.ts +1 -0
- package/dist/demo/overlay/inpage/panel-chrome.js +203 -0
- package/dist/demo/overlay/inpage/stamp.d.ts +1 -0
- package/dist/demo/overlay/inpage/stamp.js +46 -0
- package/dist/demo/overlay/inpage/swipe-zoom.d.ts +1 -0
- package/dist/demo/overlay/inpage/swipe-zoom.js +220 -0
- package/dist/demo/overlay/inpage/todos.d.ts +1 -0
- package/dist/demo/overlay/inpage/todos.js +294 -0
- package/dist/demo/overlay/locator-theater.d.ts +25 -0
- package/dist/demo/overlay/locator-theater.js +76 -0
- package/dist/demo/overlay/network-capture.d.ts +22 -0
- package/dist/demo/overlay/network-capture.js +127 -0
- package/dist/demo/overlay/overlay-css.d.ts +3 -0
- package/dist/demo/overlay/overlay-css.js +369 -0
- package/dist/demo/overlay/overlay-stage.d.ts +23 -0
- package/dist/demo/overlay/overlay-stage.js +106 -0
- package/dist/demo/overlay/overlay.d.ts +10 -0
- package/dist/demo/overlay/overlay.js +89 -0
- package/dist/{pilot-overlay/overlay-fixtures.d.ts → demo/overlay/phase-fixtures.d.ts} +2 -2
- package/dist/{pilot-overlay/overlay-fixtures.js → demo/overlay/phase-fixtures.js} +2 -2
- package/dist/{pilot-overlay/action-ring.js → demo/overlay/pilot/actions.js} +2 -1
- package/dist/{pilot-overlay → demo/overlay/pilot}/fixtures.d.ts +6 -5
- package/dist/{pilot-overlay → demo/overlay/pilot}/fixtures.js +19 -18
- package/dist/{pilot-overlay → demo/overlay/pilot}/shell.d.ts +2 -2
- package/dist/{pilot-overlay → demo/overlay/pilot}/shell.js +13 -22
- package/dist/demo/overlay/reattach.d.ts +7 -0
- package/dist/demo/overlay/reattach.js +23 -0
- package/dist/demo/overlay/rings.d.ts +33 -0
- package/dist/demo/overlay/rings.js +448 -0
- package/dist/{ui → demo/overlay/ui}/components/ring.js +2 -2
- package/dist/{ui → demo/overlay/ui}/overlay.css +4 -4
- package/dist/{ui → demo/overlay/ui}/shadow.d.ts +1 -1
- package/dist/{ui → demo/overlay/ui}/shadow.js +39 -2
- package/dist/demo/stepper/after.d.ts +3 -0
- package/dist/demo/stepper/after.js +113 -0
- package/dist/demo/stepper/banner-log.d.ts +37 -0
- package/dist/demo/stepper/banner-log.js +63 -0
- package/dist/demo/stepper/before.d.ts +4 -0
- package/dist/demo/stepper/before.js +110 -0
- package/dist/demo/stepper/demo-log.d.ts +31 -0
- package/dist/demo/stepper/demo-log.js +309 -0
- package/dist/demo/stepper/gate.d.ts +11 -0
- package/dist/demo/stepper/gate.js +78 -0
- package/dist/demo/stepper/interaction-patch.d.ts +3 -0
- package/dist/demo/stepper/interaction-patch.js +323 -0
- package/dist/demo/stepper/pacing.d.ts +21 -0
- package/dist/demo/stepper/pacing.js +23 -0
- package/dist/demo/stepper/slides.d.ts +11 -0
- package/dist/demo/stepper/slides.js +233 -0
- package/dist/demo/stepper/step-panels.d.ts +21 -0
- package/dist/demo/stepper/step-panels.js +589 -0
- package/dist/demo/stepper/stepper.d.ts +24 -0
- package/dist/demo/stepper/stepper.js +122 -0
- package/dist/demo/stepper/teardown.d.ts +48 -0
- package/dist/demo/stepper/teardown.js +179 -0
- package/dist/demo/stepper/todo-advance.d.ts +14 -0
- package/dist/demo/stepper/todo-advance.js +110 -0
- package/dist/demo/stepper/view.d.ts +68 -0
- package/dist/demo/stepper/view.js +31 -0
- package/dist/demo/types.d.ts +17 -0
- package/dist/demo/verbose-log.js +15 -0
- package/dist/{types.d.ts → engine/block/block.d.ts} +106 -91
- package/dist/{core → engine/block}/block.js +10 -53
- package/dist/{core → engine/block}/compose.d.ts +10 -7
- package/dist/{core → engine/block}/compose.js +1 -1
- package/dist/{core/blocks → engine/block/kinds}/api.d.ts +17 -12
- package/dist/{core/blocks → engine/block/kinds}/api.js +26 -18
- package/dist/{core/blocks → engine/block/kinds}/effect.d.ts +13 -18
- package/dist/engine/block/kinds/effect.js +17 -0
- package/dist/{core/blocks → engine/block/kinds}/method.d.ts +19 -29
- package/dist/{core/blocks → engine/block/kinds}/method.js +7 -21
- package/dist/{core/blocks → engine/block/kinds}/nav.d.ts +22 -31
- package/dist/{core/blocks → engine/block/kinds}/nav.js +6 -12
- package/dist/{core/blocks → engine/block/kinds}/page.d.ts +15 -20
- package/dist/{core/blocks → engine/block/kinds}/page.js +5 -7
- package/dist/engine/checkpoint/checkpoint.d.ts +22 -0
- package/dist/engine/checkpoint/checkpoint.js +8 -0
- package/dist/engine/checkpoint/route.d.ts +28 -0
- package/dist/engine/checkpoint/route.js +28 -0
- package/dist/{core → engine}/config.d.ts +7 -2
- package/dist/engine/config.js +6 -0
- package/dist/engine/engine.d.ts +45 -0
- package/dist/{core → engine}/engine.js +6 -10
- package/dist/engine/env.d.ts +59 -0
- package/dist/engine/env.js +83 -0
- package/dist/{errors.d.ts → engine/errors.d.ts} +23 -22
- package/dist/{errors.js → engine/errors.js} +22 -22
- package/dist/{core → engine/flow}/branch-regression.d.ts +8 -7
- package/dist/{core → engine/flow}/branch-regression.js +4 -3
- package/dist/engine/flow/flow.d.ts +162 -0
- package/dist/engine/flow/flow.js +244 -0
- package/dist/{core → engine/flow}/map-builder.d.ts +42 -40
- package/dist/{core → engine/flow}/map-builder.js +46 -48
- package/dist/{core → engine}/locate.d.ts +1 -1
- package/dist/{core → engine}/locate.js +1 -2
- package/dist/{mem-stub.d.ts → engine/mem/mem-stub.d.ts} +9 -8
- package/dist/{mem-stub.js → engine/mem/mem-stub.js} +2 -2
- package/dist/{mem-page.d.ts → engine/mem/mem.d.ts} +1 -1
- package/dist/{mem-page.js → engine/mem/mem.js} +2 -1
- package/dist/engine/page-gone.d.ts +5 -0
- package/dist/engine/page-gone.js +20 -0
- package/dist/engine/run/connect.d.ts +28 -0
- package/dist/{types.js → engine/run/connect.js} +11 -10
- package/dist/engine/run/events.d.ts +67 -0
- package/dist/engine/run/events.js +90 -0
- package/dist/engine/run/hooks.d.ts +16 -0
- package/dist/engine/run/hooks.js +8 -0
- package/dist/engine/run/launch.d.ts +13 -0
- package/dist/engine/run/launch.js +27 -0
- package/dist/{core/run-graph.d.ts → engine/run/run.d.ts} +9 -11
- package/dist/{core/run-graph.js → engine/run/run.js} +22 -11
- package/dist/engine/stub/pace.d.ts +12 -0
- package/dist/engine/stub/pace.js +2 -0
- package/dist/engine/stub/ring.d.ts +130 -0
- package/dist/engine/stub/ring.js +41 -0
- package/dist/engine/stub/stub.d.ts +268 -0
- package/dist/engine/stub/stub.js +1 -0
- package/dist/engine/stub/todos.d.ts +104 -0
- package/dist/engine/stub/todos.js +2 -0
- package/dist/engine/stub/viewport.d.ts +26 -0
- package/dist/engine/stub/viewport.js +2 -0
- package/dist/{trait.d.ts → engine/trait/trait.d.ts} +1 -1
- package/dist/index.d.ts +84 -36
- package/dist/index.js +44 -19
- package/dist/{session/auto-explore-run.d.ts → live/auto/auto.d.ts} +10 -16
- package/dist/{session/auto-explore-run.js → live/auto/auto.js} +164 -248
- package/dist/{session/auto-explore.d.ts → live/auto/explore.d.ts} +4 -14
- package/dist/{session/auto-explore.js → live/auto/explore.js} +21 -127
- package/dist/{auto-session/session.d.ts → live/auto-session/auto-session.d.ts} +1 -1
- package/dist/{auto-session/session.js → live/auto-session/auto-session.js} +27 -24
- package/dist/{auto-session → live/auto-session}/helpers.d.ts +16 -5
- package/dist/{auto-session → live/auto-session}/helpers.js +1 -1
- package/dist/{session/auto-session-ipc.d.ts → live/auto-session/ipc.d.ts} +7 -5
- package/dist/{session/auto-session-ipc.js → live/auto-session/ipc.js} +31 -16
- package/dist/{session/browser.d.ts → live/auto-session/start.d.ts} +1 -2
- package/dist/{session/browser.js → live/auto-session/start.js} +2 -3
- package/dist/{pilot-overlay → live/pilot}/panel.d.ts +1 -1
- package/dist/{pilot-overlay → live/pilot}/panel.js +23 -31
- package/dist/{session → live/pilot}/pilot.d.ts +4 -3
- package/dist/{session → live/pilot}/pilot.js +4 -4
- package/dist/{traverse → live/traverse}/coverage.d.ts +4 -0
- package/dist/{traverse → live/traverse}/coverage.js +3 -0
- package/dist/{traverse → live/traverse}/lease.d.ts +1 -0
- package/dist/{traverse → live/traverse}/lease.js +1 -0
- package/dist/{traverse/run.d.ts → live/traverse/traverse.d.ts} +4 -1
- package/dist/{traverse/run.js → live/traverse/traverse.js} +26 -43
- package/dist/manifest/manifest.d.ts +52 -0
- package/dist/manifest/manifest.js +93 -0
- package/dist/manifest/map-imports.d.ts +7 -0
- package/dist/manifest/map-imports.js +22 -0
- package/dist/manifest/maps.d.ts +33 -0
- package/dist/manifest/maps.js +62 -0
- package/dist/manifest/pack.d.ts +21 -0
- package/dist/manifest/pack.js +109 -0
- package/dist/manifest/project.d.ts +60 -0
- package/dist/manifest/project.js +101 -0
- package/dist/{session/block-inject.js → manifest/roots.js} +1 -18
- package/dist/manifest/scan.d.ts +19 -0
- package/dist/manifest/scan.js +57 -0
- package/dist/{blocks-select.d.ts → manifest/select.d.ts} +3 -0
- package/dist/{blocks-select.js → manifest/select.js} +2 -0
- package/dist/manifest/source.d.ts +23 -0
- package/dist/manifest/source.js +86 -0
- package/dist/runner/mode.d.ts +71 -0
- package/dist/runner/mode.js +1 -0
- package/dist/runner/modes/branches.d.ts +5 -0
- package/dist/runner/modes/branches.js +37 -0
- package/dist/runner/modes/demo.d.ts +3 -0
- package/dist/runner/modes/demo.js +13 -0
- package/dist/runner/modes/report.d.ts +2 -0
- package/dist/runner/modes/report.js +54 -0
- package/dist/runner/modes/run.d.ts +2 -0
- package/dist/runner/modes/run.js +3 -0
- package/dist/runner/options.d.ts +31 -0
- package/dist/runner/options.js +42 -0
- package/dist/runner/plan/find.d.ts +18 -0
- package/dist/runner/plan/find.js +65 -0
- package/dist/runner/plan/plan.d.ts +11 -0
- package/dist/runner/plan/plan.js +97 -0
- package/dist/runner/plan/seed-mem.d.ts +12 -0
- package/dist/runner/plan/seed-mem.js +98 -0
- package/dist/runner/plan/spec.d.ts +5 -0
- package/dist/runner/plan/spec.js +17 -0
- package/dist/runner/play-steps.d.ts +2 -0
- package/dist/runner/play-steps.js +59 -0
- package/dist/runner/runner.d.ts +4 -0
- package/dist/runner/runner.js +64 -0
- package/dist/runner/session.d.ts +9 -0
- package/dist/runner/session.js +87 -0
- package/dist/{browser.js → runtime/browser.js} +4 -2
- package/dist/{env-file.js → runtime/env-file.js} +7 -12
- package/dist/{extensions.d.ts → runtime/extensions.d.ts} +2 -5
- package/dist/{extensions.js → runtime/extensions.js} +3 -1
- package/dist/runtime/full-launch.d.ts +1 -0
- package/dist/runtime/full-launch.js +34 -0
- package/dist/runtime/global-flag.d.ts +5 -0
- package/dist/runtime/global-flag.js +18 -0
- package/dist/{playwright-config.d.ts → runtime/playwright-config.d.ts} +1 -1
- package/dist/{playwright.config.js → runtime/playwright.config.js} +3 -2
- package/dist/runtime/run-log.d.ts +2 -0
- package/dist/runtime/run-log.js +17 -0
- package/dist/{video-dir.js → runtime/video-dir.js} +3 -2
- package/dist/{config.d.ts → runtime/waygraph-config.d.ts} +8 -9
- package/dist/{config.js → runtime/waygraph-config.js} +21 -51
- package/dist/{webserver.js → runtime/webserver.js} +5 -30
- package/examples/routed-demo/config/waygraph.config.ts +20 -0
- package/examples/routed-demo/package.json +1 -4
- package/examples/routed-demo/scripts/fixture-server.mjs +1 -1
- package/examples/routed-demo/src/flows/routed-demo-map.flow.ts +2 -4
- package/examples/routed-demo/src/flows/routed-demo.flow.ts +2 -3
- package/examples/routed-demo/src/map/(app_base)/dashboard/_methods/click-widget.block.ts +5 -4
- package/examples/routed-demo/src/map/(app_base)/dashboard/_nav.block.ts +3 -3
- package/examples/routed-demo/src/map/(app_base)/dashboard/_page.block.ts +3 -3
- package/examples/routed-demo/src/map/(external)/docs/_nav.block.ts +3 -3
- package/examples/routed-demo/src/map/(external)/docs/_page.block.ts +3 -3
- package/examples/routed-demo/src/states/routed-demo.states.ts +5 -3
- package/examples/routed-demo/tests/routed-demo.spec.ts +4 -4
- package/examples/routed-demo/tsconfig.json +1 -1
- package/examples/saucedemo/README.md +11 -12
- package/examples/saucedemo/config/waygraph.config.ts +17 -0
- package/examples/saucedemo/docs/CONVENTION.md +5 -7
- package/examples/saucedemo/docs/HELPERS.md +12 -12
- package/examples/saucedemo/package-lock.json +10 -3
- package/examples/saucedemo/package.json +12 -29
- package/examples/saucedemo/src/blocks/SITE-MAP.md +0 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/NAV.md +1 -5
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-cart.block.ts +3 -52
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-checkout-info.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-first-name.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-last-name.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-postal-code.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/submit-checkout-info.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +21 -27
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/inventory.page.block.ts +3 -9
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/add-all-to-cart.method.block.ts +4 -6
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +10 -76
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/remove-all-from-cart.method.block.ts +4 -6
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/remove-from-cart.effect.block.ts +4 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/nav-item-detail.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-back-to-inventory.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-back-to-products.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-continue-shopping.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +5 -29
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +5 -48
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +13 -77
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-logout.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/nav-login.block.ts +3 -3
- package/examples/saucedemo/src/flows/api-demo.flow.ts +26 -18
- package/examples/saucedemo/src/flows/cart-bulk.flow.ts +19 -14
- package/examples/saucedemo/src/flows/cart-continue.flow.ts +10 -8
- package/examples/saucedemo/src/flows/cart-mem.flow.ts +7 -7
- package/examples/saucedemo/src/flows/catalog-logout.flow.ts +13 -8
- package/examples/saucedemo/src/flows/checkout-then-browse-again.flow.ts +26 -48
- package/examples/saucedemo/src/flows/checkout.flow.ts +70 -86
- package/examples/saucedemo/src/flows/device-showcase.flow.ts +24 -25
- package/examples/saucedemo/src/flows/login.flow.ts +11 -18
- package/examples/saucedemo/src/flows/mem-stub-demo.flow.ts +9 -20
- package/examples/saucedemo/src/flows/shop.flow.ts +15 -20
- package/examples/saucedemo/src/flows/smoke.flow.ts +12 -27
- package/examples/saucedemo/src/flows/stub-on-error.flow.ts +24 -43
- package/examples/saucedemo/src/flows/viewer-blocked.flow.ts +26 -34
- package/examples/saucedemo/src/states/checkout.mem-stubs.ts +11 -0
- package/examples/saucedemo/src/states/checkout.states.ts +21 -11
- package/examples/saucedemo/src/stubs/device-showcase.ts +191 -0
- package/examples/saucedemo/src/stubs/login.ts +37 -0
- package/examples/saucedemo/tests/auto-graph.spec.ts +4 -12
- package/examples/saucedemo/tests/chain-flow-episodes.spec.ts +7 -9
- package/examples/saucedemo/tests/submit-login-branch.spec.ts +18 -5
- package/package.json +12 -7
- package/templates/agents/waygraph-planner.agent.md +2 -2
- package/templates/quickstart/README.md +4 -7
- package/templates/quickstart/config/waygraph.config.ts +17 -0
- package/templates/quickstart/docs/CONVENTION.md +5 -6
- package/templates/quickstart/docs/HELPERS.md +11 -9
- package/templates/quickstart/package.json +14 -17
- package/templates/quickstart/src/blocks/SITE-MAP.md +13 -3
- package/templates/quickstart/src/blocks/saucedemo-web/NAV.md +1 -5
- package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-cart.block.ts +3 -52
- package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-checkout-info.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-first-name.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-last-name.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-postal-code.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/submit-checkout-info.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +21 -27
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/inventory.page.block.ts +3 -9
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/add-all-to-cart.method.block.ts +4 -6
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +10 -76
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/remove-all-from-cart.method.block.ts +4 -6
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/remove-from-cart.effect.block.ts +4 -3
- 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-back-to-inventory.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-back-to-products.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-continue-shopping.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +5 -29
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +5 -48
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +13 -77
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-logout.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/nav-login.block.ts +3 -3
- package/templates/quickstart/src/flows/api-demo.flow.ts +45 -0
- package/templates/quickstart/src/flows/cart-bulk.flow.ts +19 -14
- package/templates/quickstart/src/flows/cart-continue.flow.ts +10 -8
- package/templates/quickstart/src/flows/cart-mem.flow.ts +7 -7
- package/templates/quickstart/src/flows/catalog-logout.flow.ts +13 -8
- package/templates/quickstart/src/flows/checkout-then-browse-again.flow.ts +26 -48
- package/templates/quickstart/src/flows/checkout.flow.ts +70 -63
- package/templates/quickstart/src/flows/device-showcase.flow.ts +24 -25
- package/templates/quickstart/src/flows/login.flow.ts +11 -18
- package/templates/quickstart/src/flows/mem-stub-demo.flow.ts +12 -0
- package/templates/quickstart/src/flows/shop.flow.ts +15 -20
- package/templates/quickstart/src/flows/smoke.flow.ts +12 -27
- package/templates/quickstart/src/flows/stub-on-error.flow.ts +31 -0
- package/templates/quickstart/src/flows/viewer-blocked.flow.ts +26 -34
- package/templates/quickstart/src/states/checkout.mem-stubs.ts +11 -0
- package/templates/quickstart/src/states/checkout.states.ts +21 -11
- package/templates/quickstart/src/stubs/device-showcase.ts +191 -0
- package/templates/quickstart/src/stubs/login.ts +37 -0
- package/templates/quickstart/tests/chain-flow.spec.ts +7 -10
- package/templates/scaffold/README.md +2 -1
- package/templates/scaffold/STRUCTURE.md +5 -4
- package/templates/scaffold/config/waygraph.config.ts +1 -0
- package/templates/scaffold/gitignore +1 -0
- package/templates/scaffold/src/flows/README.md +2 -2
- package/templates/scaffold/src/map/(app_base)/docs/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/docs/_page.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/_methods/add-item.effect.block.ts +4 -4
- package/templates/scaffold/src/map/(app_base)/home/_methods/assert-hello.method.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/_methods/assert-item-added.method.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/_methods/clear-cart.method.block.ts +5 -4
- package/templates/scaffold/src/map/(app_base)/home/_methods/remove-item.effect.block.ts +4 -4
- package/templates/scaffold/src/map/(app_base)/home/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/_page.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/nav-verification-link.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_keys.ts +21 -0
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/assert-response-body.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/assert-response-header.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/assert-status.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/pick-extension-interceptor.method.block.ts +5 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/read-response-body.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/read-response-headers.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/send-request.method.block.ts +5 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-bearer-token.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-headers.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-json-body.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-method.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-query-params.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-url.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/hoppscotch/_page.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/hoppscotch/_states.ts +6 -0
- package/templates/scaffold/src/map/(external)/hoppscotch/settings/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/mailpit/_keys.ts +13 -0
- package/templates/scaffold/src/map/(external)/mailpit/_methods/assert-email-content.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/mailpit/_methods/assert-email-received.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/mailpit/_methods/extract-email-link.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/mailpit/_methods/open-message.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/mailpit/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/mailpit/_page.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/mailpit/_states.ts +9 -0
- package/templates/scaffold/src/map/README.md +7 -0
- package/templates/scaffold/src/states/README.md +4 -1
- package/templates/scaffold/src/states/demo.mem-keys.ts +1 -29
- package/templates/scaffold/src/states/demo.states.ts +14 -20
- package/templates/scaffold/tests/hoppscotch.spec.ts +1 -11
- package/templates/scaffold/tests/mail-verify.spec.ts +2 -2
- package/templates/skills/waygraph-blind-pilot.skill.md +2 -6
- package/templates/skills/waygraph-convention.skill.md +23 -14
- package/templates/skills/waygraph-pilot.skill.md +7 -4
- package/dist/auto-session/verbose-log.js +0 -16
- package/dist/auto-session.d.ts +0 -2
- package/dist/auto-session.js +0 -3
- package/dist/cli/discover.d.ts +0 -40
- package/dist/cli/discover.js +0 -148
- package/dist/commands/agent-dive.js +0 -52
- package/dist/commands/check.js +0 -192
- package/dist/commands/map.js +0 -29
- package/dist/commands/run.js +0 -104
- package/dist/commands/traverse.js +0 -177
- package/dist/core/block.d.ts +0 -109
- package/dist/core/blocks/effect.js +0 -23
- package/dist/core/config.js +0 -17
- package/dist/core/engine.d.ts +0 -198
- package/dist/core/flow.d.ts +0 -293
- package/dist/core/flow.js +0 -432
- package/dist/core.d.ts +0 -14
- package/dist/core.js +0 -15
- package/dist/highlights/merge.d.ts +0 -8
- package/dist/highlights/merge.js +0 -173
- package/dist/highlights/stub-ctx.d.ts +0 -10
- package/dist/highlights/stub-ctx.js +0 -331
- package/dist/highlights/types.d.ts +0 -607
- package/dist/highlights.d.ts +0 -9
- package/dist/highlights.js +0 -10
- package/dist/pilot-overlay.d.ts +0 -5
- package/dist/pilot-overlay.js +0 -6
- package/dist/runner/banner-log.js +0 -63
- package/dist/runner/chain-run.js +0 -102
- package/dist/runner/cursor.js +0 -140
- package/dist/runner/demo-log.js +0 -316
- package/dist/runner/device-stage.d.ts +0 -9
- package/dist/runner/device-stage.js +0 -420
- package/dist/runner/discovery.js +0 -105
- package/dist/runner/index.js +0 -2
- package/dist/runner/inpage/banner.d.ts +0 -21
- package/dist/runner/inpage/banner.js +0 -156
- package/dist/runner/inpage/caption.d.ts +0 -3
- package/dist/runner/inpage/caption.js +0 -23
- package/dist/runner/inpage/core.d.ts +0 -4
- package/dist/runner/inpage/core.js +0 -316
- package/dist/runner/inpage/device.d.ts +0 -3
- package/dist/runner/inpage/device.js +0 -211
- package/dist/runner/inpage/network.d.ts +0 -15
- package/dist/runner/inpage/network.js +0 -217
- package/dist/runner/inpage/panel-chrome.js +0 -192
- package/dist/runner/inpage/stamp.js +0 -46
- package/dist/runner/inpage/swipe-zoom.js +0 -220
- package/dist/runner/inpage/todos.js +0 -337
- package/dist/runner/interaction-patch.js +0 -384
- package/dist/runner/main.js +0 -469
- package/dist/runner/network-capture.d.ts +0 -9
- package/dist/runner/network-capture.js +0 -126
- package/dist/runner/overlay-css.d.ts +0 -3
- package/dist/runner/overlay-css.js +0 -377
- package/dist/runner/overlay-install.js +0 -90
- package/dist/runner/overlay-stage.js +0 -110
- package/dist/runner/rings.js +0 -514
- package/dist/runner/seed-mem.js +0 -110
- package/dist/runner/slides.js +0 -278
- package/dist/runner/step-mode.js +0 -703
- package/dist/runner/step-panels.js +0 -729
- package/dist/runner/teardown.js +0 -202
- package/dist/runner/todo-dock.js +0 -142
- package/dist/session/step-overlay.d.ts +0 -37
- package/dist/session/step-overlay.js +0 -244
- package/examples/routed-demo/playwright.config.ts +0 -21
- package/examples/saucedemo/playwright.config.ts +0 -19
- package/examples/saucedemo/scripts/drive-auto-cli.mjs +0 -93
- package/examples/saucedemo/scripts/prove-add-to-cart-menu.mjs +0 -126
- package/examples/saucedemo/scripts/prove-auto-graph.mjs +0 -92
- package/examples/saucedemo/scripts/prove-wrong-login-runtime.mjs +0 -63
- package/examples/saucedemo/src/blocks/saucedemo-web/ff-owner-auth.block.ts +0 -22
- package/templates/quickstart/playwright.config.ts +0 -14
- package/templates/quickstart/scripts/drive-auto-cli.mjs +0 -93
- package/templates/quickstart/src/blocks/saucedemo-web/ff-owner-auth.block.ts +0 -22
- /package/dist/{commands → cli/commands}/agent-dive-scaffold.d.ts +0 -0
- /package/dist/{commands → cli/commands}/agent-dive.d.ts +0 -0
- /package/dist/{commands → cli/commands}/extensions.d.ts +0 -0
- /package/dist/{commands → cli/commands}/init.d.ts +0 -0
- /package/dist/{commands → cli/commands}/list.d.ts +0 -0
- /package/dist/{commands → cli/commands}/map.d.ts +0 -0
- /package/dist/{commands → cli/commands}/session.d.ts +0 -0
- /package/dist/{commands → cli/commands}/test.d.ts +0 -0
- /package/dist/{commands → cli/commands}/traverse.d.ts +0 -0
- /package/dist/{commands → cli/commands}/try.d.ts +0 -0
- /package/dist/{commands → cli/commands}/upgrade.d.ts +0 -0
- /package/dist/{highlights → demo/narration}/shorthand.js +0 -0
- /package/dist/{pilot-overlay/action-ring.d.ts → demo/overlay/pilot/actions.d.ts} +0 -0
- /package/dist/{ui → demo/overlay/ui}/components/ring.d.ts +0 -0
- /package/dist/{ui → demo/overlay/ui}/stylesheet.d.ts +0 -0
- /package/dist/{ui → demo/overlay/ui}/stylesheet.js +0 -0
- /package/dist/{ui → demo/overlay/ui}/tokens.d.ts +0 -0
- /package/dist/{ui → demo/overlay/ui}/tokens.js +0 -0
- /package/dist/{highlights → demo}/types.js +0 -0
- /package/dist/{auto-session → demo}/verbose-log.d.ts +0 -0
- /package/dist/{selector.d.ts → engine/trait/selector.d.ts} +0 -0
- /package/dist/{selector.js → engine/trait/selector.js} +0 -0
- /package/dist/{trait.js → engine/trait/trait.js} +0 -0
- /package/dist/{session/block-inject.d.ts → manifest/roots.d.ts} +0 -0
- /package/dist/{browser.d.ts → runtime/browser.d.ts} +0 -0
- /package/dist/{env-file.d.ts → runtime/env-file.d.ts} +0 -0
- /package/dist/{playwright-config.js → runtime/playwright-config.js} +0 -0
- /package/dist/{playwright.config.d.ts → runtime/playwright.config.d.ts} +0 -0
- /package/dist/{video-dir.d.ts → runtime/video-dir.d.ts} +0 -0
- /package/dist/{webserver.d.ts → runtime/webserver.d.ts} +0 -0
package/dist/cli/usage.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { optionHelp } from "./flags.js";
|
|
1
2
|
export function printBrowserUsage() {
|
|
2
3
|
console.log(`waygraph browser — persistent Playwright sessions (headful by default)
|
|
3
4
|
|
|
@@ -36,26 +37,22 @@ export function usage() {
|
|
|
36
37
|
Primary (less is more):
|
|
37
38
|
waygraph auto [project|.flow.ts] Interactive explore (picker)
|
|
38
39
|
--cli Terminal menu instead of browser panel
|
|
39
|
-
--cli --detach Run the --cli session as a background socket
|
|
40
|
-
server; prints {sessionId, socketPath} and exits
|
|
41
40
|
--blocks <From> <To> Graph path-find From->To, then run
|
|
42
41
|
--data '{...}' Mem seed (same as demo/run)
|
|
43
42
|
(pass a .flow.ts to run that flow - same as run)
|
|
44
|
-
|
|
45
|
-
(same --non-headless flag run/demo already use)
|
|
46
|
-
waygraph auto send <sessionId> "<pick>" Send one pick to a --detach session, print
|
|
43
|
+
waygraph auto send <sessionId> "<pick>" Send one pick to a session (browser start / pilot start), print
|
|
47
44
|
the resulting state as JSON (no TTY needed).
|
|
48
45
|
<pick> is a 1-based menu index, a Block name
|
|
49
46
|
(exact match; ambiguous names refuse rather than
|
|
50
47
|
guess), or "q"/"quit". Same command as
|
|
51
48
|
browser send <sessionId> "<pick>" (prefer that
|
|
52
|
-
prefix for a
|
|
49
|
+
prefix for a persistent session).
|
|
53
50
|
--timeout <ms> Override the 15s default wait for this one call -
|
|
54
51
|
a single Block can legitimately run a slow real
|
|
55
52
|
interaction (e.g. a multi-step mouse drag)
|
|
56
|
-
waygraph auto status <sessionId> Read a
|
|
53
|
+
waygraph auto status <sessionId> Read a session's state (no side effects)
|
|
57
54
|
waygraph auto attach <sessionId> Reopen an interactive terminal against a
|
|
58
|
-
running
|
|
55
|
+
running session
|
|
59
56
|
waygraph auto dom <sessionId> Read the live page's structure (no side effects)
|
|
60
57
|
--mode aria|full Default aria (Playwright ariaSnapshotJSON, AI mode);
|
|
61
58
|
full = bounded raw DOM walk (tag/attrs/text/children)
|
|
@@ -114,8 +111,8 @@ Primary (less is more):
|
|
|
114
111
|
todoTitle?, holdMs? (0=until next), clear:true.
|
|
115
112
|
Missing selectors listed in response, not fatal.
|
|
116
113
|
Same command as browser highlight <sessionId>
|
|
117
|
-
'<json>' (prefer that prefix for a
|
|
118
|
-
|
|
114
|
+
'<json>' (prefer that prefix for a persistent
|
|
115
|
+
session).
|
|
119
116
|
<selector>|<label>[|<tone>] Shorthand for 1-3 rings, no JSON braces/quotes
|
|
120
117
|
to escape - rings separated by ";", e.g.
|
|
121
118
|
"#x|Login button|warning; .err|Error banner|danger".
|
|
@@ -124,11 +121,7 @@ Primary (less is more):
|
|
|
124
121
|
form above.
|
|
125
122
|
waygraph browser Show browser subcommands
|
|
126
123
|
waygraph browser start Open a new session (headful by default, about:blank)
|
|
127
|
-
|
|
128
|
-
--goto <url> Navigate on start (disables blank page)
|
|
129
|
-
--blank Force about:blank on start (default)
|
|
130
|
-
--headless Headless session (default is visible browser)
|
|
131
|
-
--cli After start, open the terminal picker (auto attach)
|
|
124
|
+
${optionHelp("session")}
|
|
132
125
|
waygraph browser sessions [project] List live browser sessions (attach/status/stop by id)
|
|
133
126
|
waygraph browser send|status|attach|… Same session control as auto (see auto send/status/…)
|
|
134
127
|
waygraph pilot start Bootstrap: browser session + whole-project graph +
|
|
@@ -140,40 +133,9 @@ Primary (less is more):
|
|
|
140
133
|
waygraph auto Interactive explore (picker) — NOT the persistent browser
|
|
141
134
|
layer; use browser/pilot for agent-driven sessions.
|
|
142
135
|
waygraph demo [--blocks <flow|file|spec>] Watch with step overlay (QA path)
|
|
143
|
-
|
|
144
|
-
--mem-stub Fill any requires key --data didn't cover from
|
|
145
|
-
registerMemStub's registry (needs the key
|
|
146
|
-
registered, or the flow's own withMemStub - a
|
|
147
|
-
key with neither still fails preflight)
|
|
148
|
-
--auto-next Auto-advance steps (alias: --autoplay)
|
|
149
|
-
--fast Shorter auto-next / Next gates (keeps smooth cursor)
|
|
150
|
-
--full Classic wrap-all block chips (default: carousel)
|
|
151
|
-
--mini Force compact mini panel (Hide pill + Next); alias --stepper-mini
|
|
152
|
-
--todo-left|--todo-right Floating checklist dock side (also ctx.todoPos / WAYGRAPH_TODO_POS)
|
|
153
|
-
--todo-full Opt out: full checklist, no compact/collision/behind-ring
|
|
154
|
-
--todo-smart Opt in: compact + collision + behind-ring (default)
|
|
155
|
-
--ff-expand Expand fastForwardComposeBlock inners as separate steps
|
|
156
|
-
--ff-disabled Dispute: expand FF (alias --no-ff); blitz kept on those inners
|
|
157
|
-
--auto-play-video Unattended + recorded: --auto-next + --video (+ step); headless
|
|
158
|
-
--auto-play-video-head Same, but keep the browser visible (--non-headless)
|
|
159
|
-
--video [dir] Record .webm (demo: headless unless --non-headless);
|
|
160
|
-
default folder ~/Downloads/waygraph-videos/<project>,
|
|
161
|
-
or video.dir in the config / WAYGRAPH_VIDEO_DIR
|
|
162
|
-
--video-viewport WxH Recording size (default demo: 1920x1080)
|
|
163
|
-
--title / --base-url
|
|
136
|
+
${optionHelp("demo")}
|
|
164
137
|
waygraph run [--blocks <flow|file|spec>] Execute (no overlay unless --step)
|
|
165
|
-
|
|
166
|
-
--mem-stub Same as demo's --mem-stub
|
|
167
|
-
--all-branches Bare Flow ref only: explore every MapBuilder.branch()
|
|
168
|
-
path, cloning the session (storageState+URL) at each
|
|
169
|
-
branch point - see runBranchRegression()
|
|
170
|
-
--shared-session With --all-branches: one shared session instead of
|
|
171
|
-
cloning (follows only the live-dispatch path)
|
|
172
|
-
--non-headless Show browser
|
|
173
|
-
--video [dir] Record .webm
|
|
174
|
-
--video-viewport WxH Recording size (default run: 1280x720)
|
|
175
|
-
--ff-expand Same as demo (expand FFCompose inners)
|
|
176
|
-
--ff-disabled Same as demo (dispute: expand FF)
|
|
138
|
+
${optionHelp("run")}
|
|
177
139
|
waygraph test Runs the project's @playwright/test suite (cwd) -
|
|
178
140
|
thin wrapper: forwards to the local playwright
|
|
179
141
|
binary (or npx playwright as a fallback)
|
|
@@ -186,6 +148,11 @@ Primary (less is more):
|
|
|
186
148
|
has a trace - test report opens it.
|
|
187
149
|
|
|
188
150
|
Also:
|
|
151
|
+
waygraph manifest [project] [--out <file>]
|
|
152
|
+
Every Block (kind, route from -> to, requires, map
|
|
153
|
+
group), Flow (use case, steps, settings) and
|
|
154
|
+
Checkpoint of the project, as JSON - what Waygraph UI
|
|
155
|
+
and map packages read.
|
|
189
156
|
--config <name|file> (any command) use another config instead of waygraph.config.ts, e.g.
|
|
190
157
|
waygraph test --config staging (config/waygraph.staging.config.ts)
|
|
191
158
|
--env <mode> (any command) load .env.<mode> / .env.<mode>.local on top of .env, e.g.
|
|
@@ -196,6 +163,8 @@ Also:
|
|
|
196
163
|
dependency. Dry run unless --apply; only the paths you
|
|
197
164
|
name are copied, differing files only with --overwrite.
|
|
198
165
|
--skills refreshes .agents/skills to this waygraph's.
|
|
166
|
+
--codemod checkpoints rewrites tag strings and <In, Out>
|
|
167
|
+
to Checkpoint values (checkpoint: Home, from/to).
|
|
199
168
|
waygraph extensions install [project] [--update]
|
|
200
169
|
Download the browser extensions listed in
|
|
201
170
|
waygraph.config.* (extensions: ["hoppscotch"]) into
|
|
@@ -208,6 +177,9 @@ Also:
|
|
|
208
177
|
violation, unlike check's warnings-only stance. A
|
|
209
178
|
no-op (exit 0, informational) if the project has no
|
|
210
179
|
src/map/ directory at all.
|
|
180
|
+
waygraph map pack <group> [project] Pack a src/map/ group that owns its _states.ts into
|
|
181
|
+
--out <dir> --name <pkg> a package (.waygraph/packages/<group>); installed
|
|
182
|
+
--version <x.y.z> elsewhere, its Blocks join the scan
|
|
211
183
|
waygraph traverse [project] Graph crawl (Phase B-E)
|
|
212
184
|
--blocks <glob|/re/|sub> Phase C: filter *.block.ts discovery
|
|
213
185
|
--parallel N Phase D: N clone workers (max 4)
|
|
@@ -222,7 +194,6 @@ Also:
|
|
|
222
194
|
waygraph try [demo|auto|auto:cli] One-shot saucedemo in a temp dir
|
|
223
195
|
try auto Headed browser panel (default)
|
|
224
196
|
try auto:cli / --cli Terminal menu instead
|
|
225
|
-
try auto --headed Same as try auto (compat)
|
|
226
197
|
|
|
227
198
|
Skills (print packaged skill markdown to stdout - for agents / paste):
|
|
228
199
|
waygraph --skill List available skills
|
|
@@ -246,10 +217,7 @@ Examples:
|
|
|
246
217
|
waygraph traverse --parallel 2 --session clone # Phase D clone workers
|
|
247
218
|
waygraph run --blocks "loginFlow then add-all-to-cart" --data '{...}' --video
|
|
248
219
|
|
|
249
|
-
|
|
250
|
-
--autoplay -> --auto-next. Prefer the primary verbs above.
|
|
251
|
-
|
|
252
|
-
Project path optional (defaults to cwd). Flags beat WAYGRAPH_* env.
|
|
220
|
+
Project path optional (defaults to cwd). Flags beat WAYGRAPH_* env. \`waygraph <command> --help\`: that command's flags.
|
|
253
221
|
\`run\`/\`demo\`/\`auto\`: Flow export, .flow.ts path, or "a then b" chain (auto also explores).
|
|
254
222
|
Hide stepper = compact "N / M · block" pill. Collapses while a step runs (clicks hit the page). Video mode stays compact.
|
|
255
223
|
`);
|
package/dist/cli/util.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* This package's own installed root (contains `templates/`, sibling to `dist/`) - this file
|
|
3
3
|
* compiles to `dist/cli/util.js`, so it's TWO levels up, not one. Real regression once, from the
|
|
4
4
|
* 0.15.24 cli.ts split: this function was copied verbatim from its old top-level `src/cli.ts`
|
|
5
|
-
* location (one level: `dist/cli.js` -> `..`) into `src/cli/util.ts` (compiles one level deeper)
|
|
5
|
+
* location (one level: `dist/cli/cli.js` -> `..`) into `src/cli/util.ts` (compiles one level deeper)
|
|
6
6
|
* without adjusting the path math - silently broke `waygraph init`/`try` (no build-level test
|
|
7
|
-
* caught it, since tests never ran the actual compiled dist/cli.js for these two commands).
|
|
7
|
+
* caught it, since tests never ran the actual compiled dist/cli/cli.js for these two commands).
|
|
8
8
|
*/
|
|
9
9
|
export declare function packageRoot(): string;
|
|
10
10
|
/** Spawns with inherited stdio (the real npm/playwright output, visible) and resolves to its exit code. */
|
package/dist/cli/util.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Split out of the former 8,700-line cli.ts (see src/ARCHITECTURE.md). Behavior unchanged.
|
|
2
1
|
import { dirname, resolve } from "node:path";
|
|
3
2
|
import { fileURLToPath } from "node:url";
|
|
4
3
|
import { spawn } from "node:child_process";
|
|
@@ -14,9 +13,9 @@ import { spawn } from "node:child_process";
|
|
|
14
13
|
* This package's own installed root (contains `templates/`, sibling to `dist/`) - this file
|
|
15
14
|
* compiles to `dist/cli/util.js`, so it's TWO levels up, not one. Real regression once, from the
|
|
16
15
|
* 0.15.24 cli.ts split: this function was copied verbatim from its old top-level `src/cli.ts`
|
|
17
|
-
* location (one level: `dist/cli.js` -> `..`) into `src/cli/util.ts` (compiles one level deeper)
|
|
16
|
+
* location (one level: `dist/cli/cli.js` -> `..`) into `src/cli/util.ts` (compiles one level deeper)
|
|
18
17
|
* without adjusting the path math - silently broke `waygraph init`/`try` (no build-level test
|
|
19
|
-
* caught it, since tests never ran the actual compiled dist/cli.js for these two commands).
|
|
18
|
+
* caught it, since tests never ran the actual compiled dist/cli/cli.js for these two commands).
|
|
20
19
|
*/
|
|
21
20
|
export function packageRoot() {
|
|
22
21
|
return resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* SAME "waygraph vision" ring can import pure CSS text, not the rendering
|
|
6
6
|
* engine around it - `cli.ts` runs `main().catch(...)` unconditionally at
|
|
7
7
|
* module load with no `import.meta.url` guard, so importing anything from it
|
|
8
|
-
* is unsafe as a library dependency (see `pilot-
|
|
8
|
+
* is unsafe as a library dependency (see `overlay/pilot-shell.ts`'s own doc
|
|
9
9
|
* comment for the same reasoning re: the badge/panel). This file has always
|
|
10
10
|
* been the pure, side-effect-free home for tone/size/weight - the CSS that
|
|
11
11
|
* renders them belongs alongside it for the same reason. `cli.ts` imports
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ringCss } from "../ui/components/ring.js";
|
|
2
|
-
// Split out of the former 2,100-line highlights.ts (see src/ARCHITECTURE.md). Behavior unchanged.
|
|
1
|
+
import { ringCss } from "../overlay/ui/components/ring.js";
|
|
3
2
|
/**
|
|
4
3
|
* The `#wg-ring` / `#wg-ring-label` CSS (tone/size/weight variants) - the
|
|
5
4
|
* actual visual language `cli.ts`'s own demo stepper paints with. Extracted
|
|
@@ -7,7 +6,7 @@ import { ringCss } from "../ui/components/ring.js";
|
|
|
7
6
|
* SAME "waygraph vision" ring can import pure CSS text, not the rendering
|
|
8
7
|
* engine around it - `cli.ts` runs `main().catch(...)` unconditionally at
|
|
9
8
|
* module load with no `import.meta.url` guard, so importing anything from it
|
|
10
|
-
* is unsafe as a library dependency (see `pilot-
|
|
9
|
+
* is unsafe as a library dependency (see `overlay/pilot-shell.ts`'s own doc
|
|
11
10
|
* comment for the same reasoning re: the badge/panel). This file has always
|
|
12
11
|
* been the pure, side-effect-free home for tone/size/weight - the CSS that
|
|
13
12
|
* renders them belongs alongside it for the same reason. `cli.ts` imports
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import type { DemoPace
|
|
1
|
+
import type { DemoPace } from "../../engine/stub/pace.js";
|
|
2
|
+
import type { FixtureDurationFields } from "../../engine/stub/ring.js";
|
|
2
3
|
/** Default fixture dwell when `duration: true`. */
|
|
3
4
|
export declare const FIXTURE_DURATION_MS_DEFAULT = 2000;
|
|
4
5
|
/** Default fixture dwell under `--fast` when duration is enabled. */
|
|
5
6
|
export declare const FIXTURE_DURATION_FAST_MS_DEFAULT = 600;
|
|
6
7
|
/** Default fixture dwell under demo pace `slow` (gaps / wrongs review). */
|
|
7
8
|
export declare const FIXTURE_DURATION_SLOW_MS_DEFAULT = 4000;
|
|
8
|
-
/**
|
|
9
|
-
export declare const SLIDE_DURATION_MS_DEFAULT = 2000;
|
|
10
|
-
/** @deprecated Prefer FIXTURE_DURATION_FAST_MS_DEFAULT */
|
|
11
|
-
export declare const SLIDE_DURATION_FAST_MS_DEFAULT = 600;
|
|
9
|
+
/** Turns any accepted pace spelling into a `DemoPace`; unknown values mean normal. */
|
|
12
10
|
export declare function normalizeDemoPace(raw: unknown): DemoPace;
|
|
11
|
+
/** The multiplier a pace applies to dwell and gate time (1 = normal); `demo.speeds` redefines the named ones. */
|
|
13
12
|
export declare function demoPaceScale(pace: DemoPace): number;
|
|
13
|
+
/** True when a pace is blitz: no cursor, ring pop or typing animation. */
|
|
14
14
|
export declare function demoPaceIsBlitz(pace: DemoPace): boolean;
|
|
15
15
|
/** True when pace should use the short-gate / fast fixture path (not slow authored). */
|
|
16
16
|
export declare function demoPaceIsFast(pace: DemoPace): boolean;
|
|
17
|
+
/** True when a pace lengthens dwell and gates. */
|
|
17
18
|
export declare function demoPaceIsSlow(pace: DemoPace): boolean;
|
|
18
19
|
/** Autoplay / Next-gate ms for this pace (base is WAYGRAPH_AUTOPLAY_MS or 1800). */
|
|
19
20
|
export declare function demoPaceGateMs(pace: DemoPace, baseAutoplayMs: number): number;
|
|
@@ -29,7 +30,7 @@ export declare function formatDemoPaceBadge(pace: DemoPace, baseAutoplayMs?: num
|
|
|
29
30
|
export declare function formatDemoPaceLabel(pace: DemoPace, baseAutoplayMs?: number): string;
|
|
30
31
|
/**
|
|
31
32
|
* Resolve min dwell ms for any fixture (stub / flow fixture / yap slide),
|
|
32
|
-
* or `null` when duration is unset (caller keeps
|
|
33
|
+
* or `null` when duration is unset (caller keeps its default timing).
|
|
33
34
|
*
|
|
34
35
|
* Authoring wins: an explicit slow/numeric pace is not crushed by CLI `--fast`
|
|
35
36
|
* (`gatesFast`). `--fast` only shortens when pace is unset/normal.
|
|
@@ -38,11 +39,6 @@ export declare function resolveFixtureDwellMs(fixture: FixtureDurationFields, op
|
|
|
38
39
|
gatesFast?: boolean;
|
|
39
40
|
pace?: DemoPace;
|
|
40
41
|
}): number | null;
|
|
41
|
-
/** @deprecated Prefer {@link resolveFixtureDwellMs} */
|
|
42
|
-
export declare function resolveSlideDwellMs(slide: FixtureDurationFields, opts?: {
|
|
43
|
-
gatesFast?: boolean;
|
|
44
|
-
pace?: DemoPace;
|
|
45
|
-
}): number | null;
|
|
46
42
|
/**
|
|
47
43
|
* Effective demo pace for a step: block override > flow episode > normal.
|
|
48
44
|
* Opaque FF / wasFastForward always win as blitz.
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import { envString } from "../../engine/env.js";
|
|
1
2
|
/** Default fixture dwell when `duration: true`. */
|
|
2
3
|
export const FIXTURE_DURATION_MS_DEFAULT = 2000;
|
|
3
4
|
/** Default fixture dwell under `--fast` when duration is enabled. */
|
|
4
5
|
export const FIXTURE_DURATION_FAST_MS_DEFAULT = 600;
|
|
5
6
|
/** Default fixture dwell under demo pace `slow` (gaps / wrongs review). */
|
|
6
7
|
export const FIXTURE_DURATION_SLOW_MS_DEFAULT = 4000;
|
|
7
|
-
/**
|
|
8
|
-
export const SLIDE_DURATION_MS_DEFAULT = FIXTURE_DURATION_MS_DEFAULT;
|
|
9
|
-
/** @deprecated Prefer FIXTURE_DURATION_FAST_MS_DEFAULT */
|
|
10
|
-
export const SLIDE_DURATION_FAST_MS_DEFAULT = FIXTURE_DURATION_FAST_MS_DEFAULT;
|
|
8
|
+
/** Turns any accepted pace spelling into a `DemoPace`; unknown values mean normal. */
|
|
11
9
|
export function normalizeDemoPace(raw) {
|
|
12
10
|
if (typeof raw === "number" && Number.isFinite(raw) && raw > 0)
|
|
13
11
|
return raw;
|
|
@@ -41,7 +39,8 @@ export function normalizeDemoPace(raw) {
|
|
|
41
39
|
function paceSpeeds() {
|
|
42
40
|
const out = { blitz: 0.05, fast: 0.33, slow: 2 };
|
|
43
41
|
try {
|
|
44
|
-
const
|
|
42
|
+
const speeds = envString("WAYGRAPH_PACE_SPEEDS");
|
|
43
|
+
const raw = speeds ? JSON.parse(speeds) : {};
|
|
45
44
|
for (const k of ["blitz", "fast", "slow"]) {
|
|
46
45
|
if (typeof raw[k] === "number" && raw[k] > 0)
|
|
47
46
|
out[k] = Math.min(10, raw[k]);
|
|
@@ -52,6 +51,7 @@ function paceSpeeds() {
|
|
|
52
51
|
}
|
|
53
52
|
return out;
|
|
54
53
|
}
|
|
54
|
+
/** The multiplier a pace applies to dwell and gate time (1 = normal); `demo.speeds` redefines the named ones. */
|
|
55
55
|
export function demoPaceScale(pace) {
|
|
56
56
|
if (typeof pace === "number") {
|
|
57
57
|
if (pace > 20)
|
|
@@ -66,6 +66,7 @@ export function demoPaceScale(pace) {
|
|
|
66
66
|
return paceSpeeds().slow;
|
|
67
67
|
return 1;
|
|
68
68
|
}
|
|
69
|
+
/** True when a pace is blitz: no cursor, ring pop or typing animation. */
|
|
69
70
|
export function demoPaceIsBlitz(pace) {
|
|
70
71
|
return pace === "blitz" || (typeof pace === "number" && pace > 0 && pace <= 0.1);
|
|
71
72
|
}
|
|
@@ -79,6 +80,7 @@ export function demoPaceIsFast(pace) {
|
|
|
79
80
|
return pace < 0.75;
|
|
80
81
|
return false;
|
|
81
82
|
}
|
|
83
|
+
/** True when a pace lengthens dwell and gates. */
|
|
82
84
|
export function demoPaceIsSlow(pace) {
|
|
83
85
|
if (pace === "slow")
|
|
84
86
|
return true;
|
|
@@ -91,7 +93,7 @@ export function demoPaceIsSlow(pace) {
|
|
|
91
93
|
}
|
|
92
94
|
/** Autoplay / Next-gate ms for this pace (base is WAYGRAPH_AUTOPLAY_MS or 1800). */
|
|
93
95
|
export function demoPaceGateMs(pace, baseAutoplayMs) {
|
|
94
|
-
if (pace === "blitz" &&
|
|
96
|
+
if (pace === "blitz" && envString("WAYGRAPH_PACE_SPEEDS")) {
|
|
95
97
|
return Math.min(30000, Math.max(20, Math.round(baseAutoplayMs * paceSpeeds().blitz)));
|
|
96
98
|
}
|
|
97
99
|
if (demoPaceIsBlitz(pace))
|
|
@@ -149,7 +151,7 @@ export function formatDemoPaceLabel(pace, baseAutoplayMs = 1800) {
|
|
|
149
151
|
}
|
|
150
152
|
/**
|
|
151
153
|
* Resolve min dwell ms for any fixture (stub / flow fixture / yap slide),
|
|
152
|
-
* or `null` when duration is unset (caller keeps
|
|
154
|
+
* or `null` when duration is unset (caller keeps its default timing).
|
|
153
155
|
*
|
|
154
156
|
* Authoring wins: an explicit slow/numeric pace is not crushed by CLI `--fast`
|
|
155
157
|
* (`gatesFast`). `--fast` only shortens when pace is unset/normal.
|
|
@@ -184,10 +186,6 @@ export function resolveFixtureDwellMs(fixture, opts) {
|
|
|
184
186
|
return Math.max(normalMs, FIXTURE_DURATION_SLOW_MS_DEFAULT);
|
|
185
187
|
return normalMs;
|
|
186
188
|
}
|
|
187
|
-
/** @deprecated Prefer {@link resolveFixtureDwellMs} */
|
|
188
|
-
export function resolveSlideDwellMs(slide, opts) {
|
|
189
|
-
return resolveFixtureDwellMs(slide, opts);
|
|
190
|
-
}
|
|
191
189
|
/**
|
|
192
190
|
* Effective demo pace for a step: block override > flow episode > normal.
|
|
193
191
|
* Opaque FF / wasFastForward always win as blitz.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { DeviceOrientation, DevicePreset, DeviceState, DeviceViewport } from "
|
|
1
|
+
import type { DeviceOrientation, DevicePreset, DeviceState, DeviceViewport } from "../../engine/stub/viewport.js";
|
|
2
2
|
/** Built-in preset sizes (CSS pixels) — stored in portrait for mobile/tablet. */
|
|
3
3
|
export declare const DEVICE_PRESETS: Record<DevicePreset, Omit<DeviceState, "touchMode"> & {
|
|
4
4
|
touchMode?: boolean;
|
|
5
5
|
}>;
|
|
6
|
+
/** Turns a device name (`mobile`, `tablet`, ...) into a known preset. */
|
|
6
7
|
export declare function normalizeDevicePreset(raw: unknown): DevicePreset | undefined;
|
|
8
|
+
/** Turns `portrait` / `landscape` spellings into a device orientation. */
|
|
7
9
|
export declare function normalizeDeviceOrientation(raw: unknown): DeviceOrientation | undefined;
|
|
8
10
|
/** Infer orientation from box (square counts as landscape). */
|
|
9
11
|
export declare function orientationFromViewport(vp: DeviceViewport): DeviceOrientation;
|
|
@@ -16,7 +18,7 @@ export declare function applyOrientation(state: DeviceState, orientation: Device
|
|
|
16
18
|
export declare function resolveDeviceState(input: DevicePreset | DeviceState | DeviceViewport | undefined, touchOverride?: boolean, orientationOverride?: DeviceOrientation): DeviceState | undefined;
|
|
17
19
|
/**
|
|
18
20
|
* Carry-forward for device fixtures (mirror {@link applyTodoPhase}).
|
|
19
|
-
* - clear: hideDevice /
|
|
21
|
+
* - clear: hideDevice / device("desktop") with clear intent
|
|
20
22
|
* - set: author set device/viewport/touch this phase
|
|
21
23
|
* - keep: omit - preserve previous (whole episode remain)
|
|
22
24
|
*/
|
|
@@ -25,6 +25,7 @@ export const DEVICE_PRESETS = {
|
|
|
25
25
|
orientation: "landscape",
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
|
+
/** Turns a device name (`mobile`, `tablet`, ...) into a known preset. */
|
|
28
29
|
export function normalizeDevicePreset(raw) {
|
|
29
30
|
const s = String(raw ?? "")
|
|
30
31
|
.trim()
|
|
@@ -37,6 +38,7 @@ export function normalizeDevicePreset(raw) {
|
|
|
37
38
|
return "desktop";
|
|
38
39
|
return undefined;
|
|
39
40
|
}
|
|
41
|
+
/** Turns `portrait` / `landscape` spellings into a device orientation. */
|
|
40
42
|
export function normalizeDeviceOrientation(raw) {
|
|
41
43
|
const s = String(raw ?? "")
|
|
42
44
|
.trim()
|
|
@@ -152,7 +154,7 @@ export function resolveDeviceState(input, touchOverride, orientationOverride) {
|
|
|
152
154
|
}
|
|
153
155
|
/**
|
|
154
156
|
* Carry-forward for device fixtures (mirror {@link applyTodoPhase}).
|
|
155
|
-
* - clear: hideDevice /
|
|
157
|
+
* - clear: hideDevice / device("desktop") with clear intent
|
|
156
158
|
* - set: author set device/viewport/touch this phase
|
|
157
159
|
* - keep: omit - preserve previous (whole episode remain)
|
|
158
160
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HighlightStubPhase, ResolvedHighlight } from "../../engine/stub/ring.js";
|
|
2
|
+
import type { HighlightStubPhaseName, StubLifecycleFn } from "../../engine/stub/stub.js";
|
|
3
|
+
import type { Block } from "../../engine/block/block.js";
|
|
4
|
+
export declare function applyDefaultZoom(slots: ResolvedHighlight[], defaultZoom?: number): ResolvedHighlight[];
|
|
5
|
+
export declare function applyDefaultZoomOut(slots: ResolvedHighlight[], defaultZoomOut?: boolean): ResolvedHighlight[];
|
|
6
|
+
/** A stub phase's slot map as an ordered list of resolved highlights. */
|
|
7
|
+
export declare function resolvePhaseMap(phaseMap: HighlightStubPhase): ResolvedHighlight[];
|
|
8
|
+
export declare function readStubRaw(block: Block<any, any>, phase: HighlightStubPhaseName): StubLifecycleFn<any> | undefined;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { normalizeHighlightSize, normalizeHighlightTone, normalizeHighlightWeight } from "../../engine/stub/ring.js";
|
|
2
|
+
function zoomOf(slot) {
|
|
3
|
+
return slot.zoom !== undefined && Number.isFinite(slot.zoom) && slot.zoom > 0 ? { zoom: slot.zoom } : {};
|
|
4
|
+
}
|
|
5
|
+
function fxOf(slot) {
|
|
6
|
+
const out = {};
|
|
7
|
+
if (slot.focus !== undefined)
|
|
8
|
+
out.focus = !!slot.focus;
|
|
9
|
+
if (slot.color !== undefined && String(slot.color).trim())
|
|
10
|
+
out.color = String(slot.color).trim();
|
|
11
|
+
if (slot.cursor !== undefined)
|
|
12
|
+
out.cursor = !!slot.cursor;
|
|
13
|
+
if (slot.todo !== undefined && String(slot.todo).trim())
|
|
14
|
+
out.todo = String(slot.todo).trim();
|
|
15
|
+
if (slot.gesture === "tap" || slot.gesture === "hold" || slot.gesture === "click" || slot.gesture === "swipe") {
|
|
16
|
+
out.gesture = slot.gesture;
|
|
17
|
+
}
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
/** A Block's own stub slot with its style fields normalized. */
|
|
21
|
+
function normalizeSlot(slot) {
|
|
22
|
+
if (!slot)
|
|
23
|
+
return null;
|
|
24
|
+
return {
|
|
25
|
+
...slot,
|
|
26
|
+
...(slot.tone ? { tone: normalizeHighlightTone(slot.tone) } : {}),
|
|
27
|
+
...(slot.size ? { size: normalizeHighlightSize(slot.size) } : {}),
|
|
28
|
+
...(slot.weight ? { weight: normalizeHighlightWeight(slot.weight) } : {}),
|
|
29
|
+
...zoomOf(slot),
|
|
30
|
+
...fxOf(slot),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function applyDefaultZoom(slots, defaultZoom) {
|
|
34
|
+
if (defaultZoom === undefined || !(defaultZoom > 0))
|
|
35
|
+
return slots;
|
|
36
|
+
return slots.map((h) => (h.zoom !== undefined && h.zoom > 0 ? h : { ...h, zoom: defaultZoom }));
|
|
37
|
+
}
|
|
38
|
+
export function applyDefaultZoomOut(slots, defaultZoomOut) {
|
|
39
|
+
if (defaultZoomOut === undefined)
|
|
40
|
+
return slots;
|
|
41
|
+
return slots.map((h) => h.zoomOut !== undefined ? h : { ...h, zoomOut: defaultZoomOut });
|
|
42
|
+
}
|
|
43
|
+
/** A stub phase's slot map as an ordered list of resolved highlights. */
|
|
44
|
+
export function resolvePhaseMap(phaseMap) {
|
|
45
|
+
const phaseKeys = Object.keys(phaseMap);
|
|
46
|
+
const allNumeric = phaseKeys.length > 0 && phaseKeys.every((k) => Number.isFinite(Number(k)) && String(Number(k)) === k);
|
|
47
|
+
// Numeric stub ids ("0", "1") sort by number. Named stubs keep author
|
|
48
|
+
// insertion order - localeCompare used to reorder password/submit/username
|
|
49
|
+
// and advance the wrong todo index on fill.
|
|
50
|
+
const ordered = allNumeric ? [...phaseKeys].sort((a, b) => Number(a) - Number(b)) : phaseKeys;
|
|
51
|
+
const resolved = [];
|
|
52
|
+
for (const id of ordered) {
|
|
53
|
+
const merged = normalizeSlot(phaseMap[id]);
|
|
54
|
+
if (merged) {
|
|
55
|
+
resolved.push({
|
|
56
|
+
...merged,
|
|
57
|
+
slotId: id,
|
|
58
|
+
...(merged.todo ? { todo: merged.todo } : {}),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return resolved;
|
|
63
|
+
}
|
|
64
|
+
export function readStubRaw(block, phase) {
|
|
65
|
+
const instr = block.instruction;
|
|
66
|
+
if (phase === "stubBefore")
|
|
67
|
+
return instr.stubBefore;
|
|
68
|
+
if (phase === "stubAfter")
|
|
69
|
+
return instr.stubAfter;
|
|
70
|
+
return instr.stubOnError;
|
|
71
|
+
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { HighlightStubPhaseName, StubPhaseResult } from "../../engine/stub/stub.js";
|
|
2
|
+
import type { ResolvedHighlight, WaygraphSlide } from "../../engine/stub/ring.js";
|
|
3
|
+
import type { Block } from "../../engine/block/block.js";
|
|
4
|
+
import type { Checkpoint } from "../../engine/checkpoint/checkpoint.js";
|
|
5
|
+
import type { MemPage } from "../../engine/mem/mem.js";
|
|
4
6
|
/**
|
|
5
7
|
* Run an open stub lifecycle (preferred) or resolve a static slot map.
|
|
6
8
|
* Returns rings + episode fixtures (todos / todoIndex / zoom).
|
|
7
9
|
*
|
|
8
10
|
* @example
|
|
9
|
-
* const before = await runStubPhase(block, "stubBefore", {
|
|
11
|
+
* const before = await runStubPhase(block, "stubBefore", { mem });
|
|
10
12
|
* // before.todos, before.highlights
|
|
11
13
|
*/
|
|
12
14
|
export declare function runStubPhase(block: Block<any, any>, phase: HighlightStubPhaseName, opts?: {
|
|
13
15
|
out?: Checkpoint<string>;
|
|
14
16
|
error?: unknown;
|
|
15
17
|
mem?: MemPage;
|
|
16
|
-
fixtures?: HighlightFixtureMap;
|
|
17
18
|
}): Promise<StubPhaseResult>;
|
|
18
19
|
/**
|
|
19
20
|
* Sync resolve of highlight slots. Prefer {@link runStubPhase} for open
|
|
@@ -21,23 +22,18 @@ export declare function runStubPhase(block: Block<any, any>, phase: HighlightStu
|
|
|
21
22
|
*/
|
|
22
23
|
export declare function resolveHighlightSlots(block: Block<any, any>, phase: HighlightStubPhaseName, opts?: {
|
|
23
24
|
out?: Checkpoint<string>;
|
|
24
|
-
fixtures?: HighlightFixtureMap;
|
|
25
25
|
}): ResolvedHighlight[];
|
|
26
|
-
/**
|
|
27
|
-
* Resolve multi-step yap slides: flow fixture `slides` wins when present,
|
|
28
|
-
* else `instruction.slides` (function form allowed).
|
|
29
|
-
*/
|
|
26
|
+
/** Resolve multi-step yap slides from `instruction.slides` (function form allowed). */
|
|
30
27
|
export declare function resolveSlides(block: Block<any, any>, opts?: {
|
|
31
28
|
out?: Checkpoint<string>;
|
|
32
|
-
fixtures?: HighlightFixtureMap;
|
|
33
29
|
}): WaygraphSlide[];
|
|
34
30
|
/**
|
|
35
|
-
* True when the block authored stubAfter (lifecycle fn
|
|
31
|
+
* True when the block authored stubAfter (lifecycle fn or slots).
|
|
36
32
|
* When true, demo should not use verify-trait fallback.
|
|
37
33
|
*/
|
|
38
|
-
export declare function hasAuthoredStubAfter(block: Block<any, any>, out?: Checkpoint<string
|
|
34
|
+
export declare function hasAuthoredStubAfter(block: Block<any, any>, out?: Checkpoint<string>): boolean;
|
|
39
35
|
/**
|
|
40
36
|
* True when stubOnError is authored (lifecycle fn and/or rings).
|
|
41
37
|
* Demo fail path only - success never consults this.
|
|
42
38
|
*/
|
|
43
|
-
export declare function hasAuthoredStubOnError(block: Block<any, any
|
|
39
|
+
export declare function hasAuthoredStubOnError(block: Block<any, any>): boolean;
|