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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { resolveBaseUrl } from "../../runtime/waygraph-config.js";
|
|
2
|
+
import { applyDemoDefaults, applyRunFlags, parseRunFlags, resolveProjectDir, resolveSpec } from "../flags.js";
|
|
3
|
+
import { runChain } from "../run-chain.js";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
6
|
+
import { envFlag, envString, setEnv } from "../../engine/env.js";
|
|
7
|
+
export async function runCase(args) {
|
|
8
|
+
const flags = parseRunFlags(args.slice(1), "run");
|
|
9
|
+
applyRunFlags(flags);
|
|
10
|
+
const spec = resolveSpec(flags);
|
|
11
|
+
if (!spec) {
|
|
12
|
+
console.error("waygraph run: missing flow/spec — e.g.\n" +
|
|
13
|
+
" waygraph run src/flows/shop.flow.ts\n" +
|
|
14
|
+
" waygraph run --blocks shopFlow\n" +
|
|
15
|
+
" waygraph list # file → export map\n" +
|
|
16
|
+
" Flags: --blocks --data --mem-stub --non-headless --video [dir] --step/--no-step");
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const proj = flags.blocks
|
|
20
|
+
? resolveProjectDir(flags, 0)
|
|
21
|
+
: resolve(flags.positionals[1] ?? process.cwd());
|
|
22
|
+
if (!existsSync(proj)) {
|
|
23
|
+
console.error(`waygraph: no such directory: ${proj}`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
if (!envString("WAYGRAPH_BASE_URL")) {
|
|
27
|
+
const resolved = await resolveBaseUrl(proj);
|
|
28
|
+
if (resolved)
|
|
29
|
+
setEnv("WAYGRAPH_BASE_URL", resolved);
|
|
30
|
+
}
|
|
31
|
+
await runChain(proj, spec);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
export async function demoCase(args) {
|
|
35
|
+
const flags = parseRunFlags(args.slice(1), "demo");
|
|
36
|
+
applyRunFlags(flags, { allowAutoPlayVideo: true, allowDemoUi: true });
|
|
37
|
+
const spec = resolveSpec(flags);
|
|
38
|
+
if (!spec) {
|
|
39
|
+
console.error("waygraph demo: missing flow/spec — e.g.\n" +
|
|
40
|
+
" waygraph demo src/flows/shop.flow.ts\n" +
|
|
41
|
+
" waygraph demo --blocks shopFlow\n" +
|
|
42
|
+
" Flags: --blocks --data --mem-stub --auto-next --fast --full --mini --ff-expand --ff-disabled --auto-play-video --title --base-url --video");
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
const proj = flags.blocks
|
|
46
|
+
? resolveProjectDir(flags, 0)
|
|
47
|
+
: resolve(flags.positionals[1] ?? process.cwd());
|
|
48
|
+
if (!existsSync(proj)) {
|
|
49
|
+
console.error(`waygraph: no such directory: ${proj}`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
if (flags.step === undefined && envString("WAYGRAPH_STEP") === undefined) {
|
|
53
|
+
setEnv("WAYGRAPH_STEP", "1");
|
|
54
|
+
}
|
|
55
|
+
await applyDemoDefaults(proj);
|
|
56
|
+
console.error(`waygraph demo: STEP=${envFlag("WAYGRAPH_STEP") ? "on" : "off"}` +
|
|
57
|
+
` AUTO_NEXT=${envFlag("WAYGRAPH_AUTOPLAY") ? "on" : "off"}` +
|
|
58
|
+
` HEADED=${envString("WAYGRAPH_HEADED") === "0" ? "off" : "on"}` +
|
|
59
|
+
` BASE_URL=${envString("WAYGRAPH_BASE_URL") ?? "(unset)"}` +
|
|
60
|
+
(envString("WAYGRAPH_VIDEO") ? ` VIDEO=${envString("WAYGRAPH_VIDEO")}` : "") +
|
|
61
|
+
(envString("WAYGRAPH_TITLE") ? ` TITLE=${JSON.stringify(envString("WAYGRAPH_TITLE"))}` : ""));
|
|
62
|
+
await runChain(proj, spec);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
@@ -1,25 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
import { printBrowserSessionsList, printBrowserUsage } from "../
|
|
3
|
-
import { applyRunFlags, looksLikeFlowFileRef, parseRunFlags
|
|
4
|
-
import { runChain } from "../
|
|
5
|
-
import { runChainAuto } from "
|
|
1
|
+
import { resolveBaseUrl } from "../../runtime/waygraph-config.js";
|
|
2
|
+
import { printBrowserSessionsList, printBrowserUsage } from "../usage.js";
|
|
3
|
+
import { applyRunFlags, looksLikeFlowFileRef, parseRunFlags } from "../flags.js";
|
|
4
|
+
import { runChain } from "../run-chain.js";
|
|
5
|
+
import { runChainAuto } from "../run-chain.js";
|
|
6
6
|
import { resolve } from "node:path";
|
|
7
|
-
import { browserStart
|
|
7
|
+
import { browserStart } from "../../live/auto-session/start.js";
|
|
8
|
+
import { listBrowserSessions, stopAllBrowserSessions, stopBrowserSession } from "../../live/auto-session/ipc.js";
|
|
8
9
|
import { existsSync, statSync } from "node:fs";
|
|
9
|
-
import { resolveInjectRoots } from "
|
|
10
|
-
import { requestSession, resolveSessionMeta, runAttachLoop, runAutoServeCommand
|
|
11
|
-
import { pilotAttach, pilotStart } from "
|
|
12
|
-
import { parseHighlightShorthand } from "
|
|
13
|
-
import { isFileSelectToken, parseBlocksSelect } from "
|
|
14
|
-
import { runAutoExplore } from "
|
|
15
|
-
import { discoverGraph, findOrphanBlocks, toMermaid } from "
|
|
10
|
+
import { resolveInjectRoots } from "../../manifest/roots.js";
|
|
11
|
+
import { requestSession, resolveSessionMeta, runAttachLoop, runAutoServeCommand } from "../../live/auto-session/ipc.js";
|
|
12
|
+
import { pilotAttach, pilotStart } from "../../live/pilot/pilot.js";
|
|
13
|
+
import { parseHighlightShorthand } from "../../demo/narration/shorthand.js";
|
|
14
|
+
import { isFileSelectToken, parseBlocksSelect } from "../../manifest/select.js";
|
|
15
|
+
import { runAutoExplore } from "../../live/auto/auto.js";
|
|
16
|
+
import { discoverGraph, findOrphanBlocks, toMermaid } from "../../analysis/graph.js";
|
|
17
|
+
import { envString, setEnv } from "../../engine/env.js";
|
|
18
|
+
import { parseCommand } from "../args.js";
|
|
19
|
+
const SEND_OPTIONS = {
|
|
20
|
+
timeout: { type: "string", value: "<ms>", help: "How long one Block may run (default 15000)" },
|
|
21
|
+
};
|
|
22
|
+
const DOM_OPTIONS = {
|
|
23
|
+
mode: { type: "string", value: "aria|full", help: "Accessibility tree (default) or the full DOM" },
|
|
24
|
+
selector: { type: "string", value: "<css>", help: "Only this element's subtree" },
|
|
25
|
+
depth: { type: "string", value: "N", help: "Levels to read" },
|
|
26
|
+
};
|
|
16
27
|
export async function sessionCase(args, command) {
|
|
17
28
|
if (command === "browser") {
|
|
18
29
|
const sub = args[1];
|
|
19
30
|
if (sub === "sessions") {
|
|
20
|
-
const
|
|
21
|
-
const json =
|
|
22
|
-
const positional = rest.filter((a) => a !== "--json");
|
|
31
|
+
const { values, positionals: positional } = parseCommand("sessions", { json: { type: "boolean", help: "Machine-readable JSON" } }, args.slice(2));
|
|
32
|
+
const json = values.json === true;
|
|
23
33
|
const proj = resolve(positional[0] ?? process.cwd());
|
|
24
34
|
const sessions = listBrowserSessions(proj);
|
|
25
35
|
if (json) {
|
|
@@ -55,14 +65,14 @@ export async function sessionCase(args, command) {
|
|
|
55
65
|
}
|
|
56
66
|
if (sub === "start" || sub.startsWith("-")) {
|
|
57
67
|
const flagArgs = sub === "start" ? args.slice(2) : args.slice(1);
|
|
58
|
-
const flags = parseRunFlags(flagArgs);
|
|
68
|
+
const flags = parseRunFlags(flagArgs, "browser");
|
|
59
69
|
applyRunFlags(flags);
|
|
60
70
|
const proj = resolve(flags.positionals[0] ?? process.cwd());
|
|
61
71
|
if (!existsSync(proj)) {
|
|
62
72
|
console.error(`waygraph browser: no such directory: ${proj}`);
|
|
63
73
|
process.exit(1);
|
|
64
74
|
}
|
|
65
|
-
const baseURL = flags.baseUrl ??
|
|
75
|
+
const baseURL = flags.baseUrl ?? envString("WAYGRAPH_BASE_URL") ?? (await resolveBaseUrl(proj));
|
|
66
76
|
try {
|
|
67
77
|
const inject = flags.inject?.length ? resolveInjectRoots(flags.inject, proj) : undefined;
|
|
68
78
|
const result = await browserStart({
|
|
@@ -111,9 +121,8 @@ export async function sessionCase(args, command) {
|
|
|
111
121
|
}
|
|
112
122
|
if (command === "pilot") {
|
|
113
123
|
if (args[1] === "sessions") {
|
|
114
|
-
const
|
|
115
|
-
const json =
|
|
116
|
-
const positional = rest.filter((a) => a !== "--json");
|
|
124
|
+
const { values, positionals: positional } = parseCommand("sessions", { json: { type: "boolean", help: "Machine-readable JSON" } }, args.slice(2));
|
|
125
|
+
const json = values.json === true;
|
|
117
126
|
const proj = resolve(positional[0] ?? process.cwd());
|
|
118
127
|
const sessions = listBrowserSessions(proj);
|
|
119
128
|
if (json) {
|
|
@@ -130,7 +139,7 @@ export async function sessionCase(args, command) {
|
|
|
130
139
|
console.error("waygraph pilot attach: usage: waygraph pilot attach <sessionId> [--inject …] [project]");
|
|
131
140
|
process.exit(1);
|
|
132
141
|
}
|
|
133
|
-
const flags = parseRunFlags(args.slice(3));
|
|
142
|
+
const flags = parseRunFlags(args.slice(3), "pilot");
|
|
134
143
|
const proj = resolve(flags.positionals[0] ?? process.cwd());
|
|
135
144
|
try {
|
|
136
145
|
const inject = flags.inject?.length ? resolveInjectRoots(flags.inject, proj) : undefined;
|
|
@@ -145,10 +154,10 @@ export async function sessionCase(args, command) {
|
|
|
145
154
|
}
|
|
146
155
|
if (args[1] === "start" || !args[1] || args[1].startsWith("-")) {
|
|
147
156
|
const flagArgs = args[1] === "start" ? args.slice(2) : args.slice(1);
|
|
148
|
-
const flags = parseRunFlags(flagArgs);
|
|
157
|
+
const flags = parseRunFlags(flagArgs, "pilot");
|
|
149
158
|
applyRunFlags(flags);
|
|
150
159
|
const proj = resolve(flags.positionals[0] ?? process.cwd());
|
|
151
|
-
const baseURL = flags.baseUrl ??
|
|
160
|
+
const baseURL = flags.baseUrl ?? envString("WAYGRAPH_BASE_URL") ?? (await resolveBaseUrl(proj));
|
|
152
161
|
try {
|
|
153
162
|
const result = await pilotStart({
|
|
154
163
|
projectDir: proj,
|
|
@@ -252,16 +261,14 @@ export async function sessionCase(args, command) {
|
|
|
252
261
|
// whether the ONE Block it's running is fast or slow, so this is
|
|
253
262
|
// opt-in via a flag rather than a raised default.
|
|
254
263
|
let timeoutMs;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
process.exit(1);
|
|
262
|
-
}
|
|
263
|
-
timeoutMs = n;
|
|
264
|
+
const raw = parseCommand("auto send", SEND_OPTIONS, args.slice(4)).values.timeout;
|
|
265
|
+
if (raw !== undefined) {
|
|
266
|
+
const n = Number(raw);
|
|
267
|
+
if (!Number.isFinite(n) || n <= 0) {
|
|
268
|
+
console.error(`waygraph auto send: --timeout must be a positive number of ms, got "${raw}"`);
|
|
269
|
+
process.exit(1);
|
|
264
270
|
}
|
|
271
|
+
timeoutMs = n;
|
|
265
272
|
}
|
|
266
273
|
const res = await requestSession(proj, sessionId, { op: "send", pick }, timeoutMs);
|
|
267
274
|
console.log(JSON.stringify(res));
|
|
@@ -274,32 +281,22 @@ export async function sessionCase(args, command) {
|
|
|
274
281
|
let mode;
|
|
275
282
|
let selector;
|
|
276
283
|
let depth;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
console.error(`waygraph auto dom: --mode must be "aria" or "full", got "${v}"`);
|
|
283
|
-
process.exit(1);
|
|
284
|
-
}
|
|
285
|
-
mode = v;
|
|
286
|
-
}
|
|
287
|
-
else if (a === "--selector" || a.startsWith("--selector=")) {
|
|
288
|
-
selector = a.startsWith("--selector=") ? a.slice("--selector=".length) : domArgs[++i];
|
|
289
|
-
}
|
|
290
|
-
else if (a === "--depth" || a.startsWith("--depth=")) {
|
|
291
|
-
const raw = a.startsWith("--depth=") ? a.slice("--depth=".length) : domArgs[++i];
|
|
292
|
-
const n = Number(raw);
|
|
293
|
-
if (!Number.isInteger(n) || n < 1) {
|
|
294
|
-
console.error(`waygraph auto dom: --depth must be a positive integer, got "${raw}"`);
|
|
295
|
-
process.exit(1);
|
|
296
|
-
}
|
|
297
|
-
depth = n;
|
|
284
|
+
const dom = parseCommand("auto dom", DOM_OPTIONS, domArgs).values;
|
|
285
|
+
if (dom.mode !== undefined) {
|
|
286
|
+
if (dom.mode !== "aria" && dom.mode !== "full") {
|
|
287
|
+
console.error(`waygraph auto dom: --mode must be "aria" or "full", got "${dom.mode}"`);
|
|
288
|
+
process.exit(1);
|
|
298
289
|
}
|
|
299
|
-
|
|
300
|
-
|
|
290
|
+
mode = dom.mode;
|
|
291
|
+
}
|
|
292
|
+
selector = dom.selector;
|
|
293
|
+
if (dom.depth !== undefined) {
|
|
294
|
+
const n = Number(dom.depth);
|
|
295
|
+
if (!Number.isInteger(n) || n < 1) {
|
|
296
|
+
console.error(`waygraph auto dom: --depth must be a positive integer, got "${dom.depth}"`);
|
|
301
297
|
process.exit(1);
|
|
302
298
|
}
|
|
299
|
+
depth = n;
|
|
303
300
|
}
|
|
304
301
|
const res = await requestSession(proj, sessionId, {
|
|
305
302
|
op: "dom",
|
|
@@ -468,7 +465,7 @@ export async function sessionCase(args, command) {
|
|
|
468
465
|
process.exitCode = 1;
|
|
469
466
|
return;
|
|
470
467
|
}
|
|
471
|
-
const flags = parseRunFlags(args.slice(1));
|
|
468
|
+
const flags = parseRunFlags(args.slice(1), command ?? "auto");
|
|
472
469
|
applyRunFlags(flags);
|
|
473
470
|
const mermaid = flags.mermaid === true;
|
|
474
471
|
const mapOnly = command === "graph" || flags.map === true;
|
|
@@ -482,10 +479,10 @@ export async function sessionCase(args, command) {
|
|
|
482
479
|
console.error(`waygraph: no such directory: ${proj}`);
|
|
483
480
|
process.exit(1);
|
|
484
481
|
}
|
|
485
|
-
if (!
|
|
482
|
+
if (!envString("WAYGRAPH_BASE_URL")) {
|
|
486
483
|
const resolved = await resolveBaseUrl(proj);
|
|
487
484
|
if (resolved)
|
|
488
|
-
|
|
485
|
+
setEnv("WAYGRAPH_BASE_URL", resolved);
|
|
489
486
|
}
|
|
490
487
|
await runChain(proj, firstPos);
|
|
491
488
|
return;
|
|
@@ -502,29 +499,6 @@ export async function sessionCase(args, command) {
|
|
|
502
499
|
" or path-find: waygraph auto --blocks LoginPage OrderComplete");
|
|
503
500
|
process.exit(1);
|
|
504
501
|
}
|
|
505
|
-
// auto --cli --detach: start the explore session as a background socket
|
|
506
|
-
// server instead of blocking in the interactive loop. Session control
|
|
507
|
-
// only applies to --cli (spec: "Headful mode is unaffected").
|
|
508
|
-
if (command === "auto" && flags.detach) {
|
|
509
|
-
if (!cliPicker) {
|
|
510
|
-
console.error("waygraph auto --detach requires --cli (headful has no session control)");
|
|
511
|
-
process.exit(1);
|
|
512
|
-
}
|
|
513
|
-
const baseURL = flags.baseUrl ?? process.env.WAYGRAPH_BASE_URL ?? (await resolveBaseUrl(proj));
|
|
514
|
-
try {
|
|
515
|
-
const meta = await spawnDetachedSession({
|
|
516
|
-
projectDir: proj,
|
|
517
|
-
...(baseURL ? { baseURL } : {}),
|
|
518
|
-
...(flags.nonHeadless ? { headless: false } : {}),
|
|
519
|
-
});
|
|
520
|
-
console.log(JSON.stringify({ sessionId: meta.sessionId, socketPath: meta.socketPath, headless: meta.headless }));
|
|
521
|
-
}
|
|
522
|
-
catch (err) {
|
|
523
|
-
console.error(`waygraph auto --detach: ${err instanceof Error ? err.message : String(err)}`);
|
|
524
|
-
process.exit(1);
|
|
525
|
-
}
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
502
|
// auto --blocks From To (graph path-find + run)
|
|
529
503
|
// auto --blocks '/regex/' or '**/*.block.ts' (Phase C file select → explore)
|
|
530
504
|
if (command === "auto" && (flags.blocksFromTo || flags.blocks)) {
|
|
@@ -535,7 +509,7 @@ export async function sessionCase(args, command) {
|
|
|
535
509
|
}
|
|
536
510
|
if (flags.blocks && isFileSelectToken(flags.blocks)) {
|
|
537
511
|
const blocksSelect = parseBlocksSelect(flags.blocks);
|
|
538
|
-
const baseURL = flags.baseUrl ??
|
|
512
|
+
const baseURL = flags.baseUrl ?? envString("WAYGRAPH_BASE_URL") ?? (await resolveBaseUrl(proj));
|
|
539
513
|
await runAutoExplore(proj, baseURL
|
|
540
514
|
? { cli: cliPicker, baseURL, blocksSelect }
|
|
541
515
|
: { cli: cliPicker, blocksSelect });
|
|
@@ -565,20 +539,19 @@ export async function sessionCase(args, command) {
|
|
|
565
539
|
}
|
|
566
540
|
return;
|
|
567
541
|
}
|
|
568
|
-
const baseURL = flags.baseUrl ??
|
|
542
|
+
const baseURL = flags.baseUrl ?? envString("WAYGRAPH_BASE_URL") ?? (await resolveBaseUrl(proj));
|
|
569
543
|
await runAutoExplore(proj, baseURL ? { cli: cliPicker, baseURL } : { cli: cliPicker });
|
|
570
544
|
return;
|
|
571
545
|
}
|
|
572
546
|
export async function autoServeCase(args) {
|
|
573
547
|
const proj = resolve(args[1] ?? process.cwd());
|
|
574
|
-
const flags = parseRunFlags(args.slice(2));
|
|
575
|
-
const
|
|
576
|
-
const sessionId = sessionIdIdx >= 0 ? args[sessionIdIdx + 1] : undefined;
|
|
548
|
+
const flags = parseRunFlags(args.slice(2), "__auto-serve");
|
|
549
|
+
const sessionId = flags.sessionId;
|
|
577
550
|
if (!sessionId) {
|
|
578
551
|
console.error("waygraph __auto-serve: missing --session-id");
|
|
579
552
|
process.exit(1);
|
|
580
553
|
}
|
|
581
|
-
const baseURL = flags.baseUrl ??
|
|
554
|
+
const baseURL = flags.baseUrl ?? envString("WAYGRAPH_BASE_URL") ?? (await resolveBaseUrl(proj));
|
|
582
555
|
const inject = flags.inject?.length ? resolveInjectRoots(flags.inject, proj) : undefined;
|
|
583
556
|
let headless;
|
|
584
557
|
if (flags.headlessBrowser)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { runInherited } from "../
|
|
1
|
+
import { configuredExtensions } from "../../runtime/waygraph-config.js";
|
|
2
|
+
import { defaultRunLogDir } from "../../runtime/run-log.js";
|
|
3
|
+
import { runInherited } from "../util.js";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
|
-
import { packageRoot } from "../
|
|
6
|
+
import { packageRoot } from "../util.js";
|
|
7
|
+
import { envString, setEnv } from "../../engine/env.js";
|
|
7
8
|
export async function testCase(args) {
|
|
8
9
|
const rest = args.slice(1);
|
|
9
10
|
const proj = process.cwd();
|
|
@@ -26,17 +27,13 @@ export async function testCase(args) {
|
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
const extensions = await configuredExtensions(proj);
|
|
30
|
+
if (envString("WAYGRAPH_RUN_LOG") === undefined)
|
|
31
|
+
setEnv("WAYGRAPH_RUN_LOG", defaultRunLogDir(proj));
|
|
29
32
|
if (extensions.length > 0)
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
console.error("waygraph: playwright.config is deprecated - move its settings into config/waygraph.config.ts");
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
process.env.WAYGRAPH_PROJECT_DIR = proj;
|
|
38
|
-
}
|
|
39
|
-
const configArgs = hasOwnConfig ? [] : ["-c", join(packageRoot(), "dist", "playwright.config.js")];
|
|
33
|
+
setEnv("WAYGRAPH_EXTENSIONS", extensions.join(","));
|
|
34
|
+
// The Playwright config is built from config/waygraph.config.ts; a project has none of its own.
|
|
35
|
+
setEnv("WAYGRAPH_PROJECT_DIR", proj);
|
|
36
|
+
const configArgs = ["-c", join(packageRoot(), "dist", "runtime", "playwright.config.js")];
|
|
40
37
|
const wantsUi = rest[0] === "ui" || rest.includes("--ui");
|
|
41
38
|
const forwarded = rest[0] === "ui" ? rest.slice(1) : rest;
|
|
42
39
|
const pwArgs = wantsUi && !forwarded.includes("--ui")
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { existsSync, statSync } from "node:fs";
|
|
3
|
+
import { parseBlocksSelect } from "../../manifest/select.js";
|
|
4
|
+
import { parseMinEdgeCoverage } from "../../live/traverse/coverage.js";
|
|
5
|
+
import { runTraverse } from "../../live/traverse/traverse.js";
|
|
6
|
+
import { helpLines, parseCommand } from "../args.js";
|
|
7
|
+
const OPTIONS = {
|
|
8
|
+
"blocks": { type: "string", value: "<glob|/regex/|substr>", help: "Phase C: filter *.block.ts discovery" },
|
|
9
|
+
"parallel": { type: "string", value: "N", help: "Phase D: N clone workers (default 1, max 4)" },
|
|
10
|
+
"session": { type: "string", value: "clone|inherit", help: "Phase D: default clone; inherit refused if parallel>1" },
|
|
11
|
+
"min-edge-coverage": { type: "string", value: "X", help: "Phase E: suite gate 0.8 | 80% | 80 (exit 2 if below)" },
|
|
12
|
+
"coverage-out": { type: "string", value: "PATH", help: "Phase E: write JSON (default .waygraph-traverse/coverage.json)" },
|
|
13
|
+
"no-coverage-report": { type: "boolean", help: "Phase E: print the Coverage line only (no JSON file)" },
|
|
14
|
+
"from": { type: "string", value: "<Checkpoint>", help: "Start checkpoint (optional)" },
|
|
15
|
+
"data": { type: "string", value: "'{...}'", help: "Mem seed JSON" },
|
|
16
|
+
"max-steps": { type: "string", value: "N", help: "Default 50 (per worker)" },
|
|
17
|
+
"max-visits": { type: "string", value: "N", help: "Per-node visit cap (default 2)" },
|
|
18
|
+
"max-visits-per-edge": { type: "string", value: "N", help: "Default 1" },
|
|
19
|
+
"non-headless": { type: "boolean", help: "Show the browser" },
|
|
20
|
+
"base-url": { type: "string", value: "<url>", help: "Base URL" },
|
|
21
|
+
"help": { type: "boolean", help: "This help" },
|
|
22
|
+
};
|
|
23
|
+
/** A number flag, or exit naming it. */
|
|
24
|
+
function numberFlag(name, raw) {
|
|
25
|
+
if (raw === undefined)
|
|
26
|
+
return undefined;
|
|
27
|
+
const n = Number(raw);
|
|
28
|
+
if (!Number.isFinite(n)) {
|
|
29
|
+
console.error(`waygraph traverse: --${name} needs a number (got ${JSON.stringify(raw)})`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
return n;
|
|
33
|
+
}
|
|
34
|
+
export async function traverseCase(args) {
|
|
35
|
+
const { values: v, positionals } = parseCommand("traverse", OPTIONS, args.slice(1));
|
|
36
|
+
if (v.help) {
|
|
37
|
+
console.log(`waygraph traverse [project] [flags]
|
|
38
|
+
|
|
39
|
+
Graph crawl (RFC Phase B-E). Walks unused legal edges until a leaf,
|
|
40
|
+
budget kill, or first broken edge. --parallel N uses session clone + edge leases.
|
|
41
|
+
|
|
42
|
+
${helpLines(OPTIONS)}
|
|
43
|
+
|
|
44
|
+
Examples:
|
|
45
|
+
waygraph traverse --blocks '**/mailpit/**/*.block.ts'
|
|
46
|
+
waygraph traverse --parallel 2 --session clone --max-steps 20
|
|
47
|
+
waygraph traverse --min-edge-coverage 80% --coverage-out ./cov.json
|
|
48
|
+
|
|
49
|
+
PASS: [Reached Leaf Node[traverse-1] at=... steps=N]
|
|
50
|
+
FAIL: [Broke at edge[traverse-1] block=... from=... to=...]
|
|
51
|
+
COVER: [Coverage edges=H/T ratio=R% min=M% PASS|FAIL]
|
|
52
|
+
`);
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
if (v.session !== undefined && v.session !== "clone" && v.session !== "inherit") {
|
|
56
|
+
console.error('waygraph traverse: --session must be "clone" or "inherit"');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
const session = v.session;
|
|
60
|
+
const projectDir = resolve(positionals[0] ?? process.cwd());
|
|
61
|
+
const from = v.from;
|
|
62
|
+
const data = v.data;
|
|
63
|
+
const maxSteps = numberFlag("max-steps", v["max-steps"]);
|
|
64
|
+
const maxVisits = numberFlag("max-visits", v["max-visits"]);
|
|
65
|
+
const maxEdge = numberFlag("max-visits-per-edge", v["max-visits-per-edge"]);
|
|
66
|
+
const parallel = numberFlag("parallel", v.parallel);
|
|
67
|
+
const headed = v["non-headless"] === true;
|
|
68
|
+
const baseUrl = v["base-url"];
|
|
69
|
+
const blocksFilter = v.blocks;
|
|
70
|
+
const minEdgeCoverageRaw = v["min-edge-coverage"];
|
|
71
|
+
const coverageOut = v["coverage-out"];
|
|
72
|
+
const noCoverageReport = v["no-coverage-report"] === true;
|
|
73
|
+
if (!existsSync(projectDir) || !statSync(projectDir).isDirectory()) {
|
|
74
|
+
console.error(`waygraph traverse: no such directory: ${projectDir}`);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
const blocksSelect = blocksFilter
|
|
78
|
+
? parseBlocksSelect(blocksFilter)
|
|
79
|
+
: undefined;
|
|
80
|
+
let minEdgeCoverage;
|
|
81
|
+
if (minEdgeCoverageRaw !== undefined) {
|
|
82
|
+
const parsed = parseMinEdgeCoverage(minEdgeCoverageRaw);
|
|
83
|
+
if (parsed === null) {
|
|
84
|
+
console.error(`waygraph traverse: --min-edge-coverage expects 0.8, 80%, or 80 (got ${JSON.stringify(minEdgeCoverageRaw)})`);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
minEdgeCoverage = parsed;
|
|
88
|
+
}
|
|
89
|
+
const code = await runTraverse(projectDir, {
|
|
90
|
+
...(from ? { from } : {}),
|
|
91
|
+
...(data ? { data } : {}),
|
|
92
|
+
...(maxSteps !== undefined ? { maxSteps } : {}),
|
|
93
|
+
...(maxVisits !== undefined ? { maxVisitsPerNode: maxVisits } : {}),
|
|
94
|
+
...(maxEdge !== undefined ? { maxVisitsPerEdge: maxEdge } : {}),
|
|
95
|
+
headed,
|
|
96
|
+
...(baseUrl ? { baseURL: baseUrl } : {}),
|
|
97
|
+
...(blocksSelect ? { blocksSelect } : {}),
|
|
98
|
+
...(parallel !== undefined ? { parallel } : {}),
|
|
99
|
+
...(session ? { session } : {}),
|
|
100
|
+
...(minEdgeCoverage !== undefined ? { minEdgeCoverage } : {}),
|
|
101
|
+
...(coverageOut ? { coverageOut: resolve(coverageOut) } : {}),
|
|
102
|
+
...(noCoverageReport ? { noCoverageReport: true } : {}),
|
|
103
|
+
});
|
|
104
|
+
process.exit(code);
|
|
105
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// Split out of the former 8,700-line cli.ts (see src/ARCHITECTURE.md). Behavior unchanged.
|
|
2
1
|
import { join } from "node:path";
|
|
3
2
|
import { cpSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
3
|
import { spawn } from "node:child_process";
|
|
5
|
-
import { packageRoot, runInherited } from "../
|
|
4
|
+
import { packageRoot, runInherited } from "../util.js";
|
|
6
5
|
import { tmpdir } from "node:os";
|
|
7
|
-
import { runChain } from "../
|
|
8
|
-
import { applyRunFlags, parseRunFlags } from "../
|
|
9
|
-
import { resolveVideoDir } from "
|
|
6
|
+
import { runChain } from "../run-chain.js";
|
|
7
|
+
import { applyRunFlags, parseRunFlags } from "../flags.js";
|
|
8
|
+
import { resolveVideoDir } from "../../runtime/video-dir.js";
|
|
9
|
+
import { envString, setEnv } from "../../engine/env.js";
|
|
10
10
|
/**
|
|
11
11
|
* Runs a throwaway probe script rooted at `projectDir` - the exact same
|
|
12
12
|
* directory the real demo files get copied into, so it resolves "waygraph"
|
|
@@ -167,7 +167,7 @@ async function prepareTryQuickstart(label) {
|
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
169
|
* `waygraph try demo` - copy a self-contained saucedemo project into a temp
|
|
170
|
-
* dir (never the caller's cwd), run a
|
|
170
|
+
* dir (never the caller's cwd), run a chained-flows step demo (Sign In + Shop +
|
|
171
171
|
* blocked Viewer), then run the headless Playwright test, and print where
|
|
172
172
|
* everything lives.
|
|
173
173
|
*/
|
|
@@ -175,26 +175,32 @@ async function runTryDemo() {
|
|
|
175
175
|
const destDir = await prepareTryQuickstart("waygraph-try-demo");
|
|
176
176
|
if (!destDir)
|
|
177
177
|
return;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
if (envString("WAYGRAPH_BASE_URL") === undefined)
|
|
179
|
+
setEnv("WAYGRAPH_BASE_URL", "https://www.saucedemo.com");
|
|
180
|
+
if (envString("WAYGRAPH_STEP") === undefined)
|
|
181
|
+
setEnv("WAYGRAPH_STEP", "1");
|
|
182
|
+
if (envString("WAYGRAPH_AUTOPLAY") === undefined)
|
|
183
|
+
setEnv("WAYGRAPH_AUTOPLAY", "0");
|
|
181
184
|
// Explicit --no-step --video = unattended headless .webm only (the
|
|
182
185
|
// documented cloud/CI recipe above) - nobody needs to watch a live
|
|
183
186
|
// window for Playwright's own recordVideo to capture the right thing.
|
|
184
187
|
// This must be decided BEFORE the headed default below, or the
|
|
185
188
|
// unconditional "??=" there always wins and the documented recipe never
|
|
186
189
|
// actually runs headless.
|
|
187
|
-
const unattendedVideo = Boolean(
|
|
190
|
+
const unattendedVideo = Boolean(envString("WAYGRAPH_VIDEO")) && envString("WAYGRAPH_STEP") === "0";
|
|
188
191
|
if (unattendedVideo) {
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
if (envString("WAYGRAPH_AUTOPLAY") === undefined)
|
|
193
|
+
setEnv("WAYGRAPH_AUTOPLAY", "1");
|
|
194
|
+
if (envString("WAYGRAPH_HEADED") === undefined)
|
|
195
|
+
setEnv("WAYGRAPH_HEADED", "0");
|
|
191
196
|
}
|
|
192
197
|
else {
|
|
193
198
|
// Default: headed stepper, manual Next. --video records that session
|
|
194
199
|
// too (not a headless rush) as long as --step is still on.
|
|
195
|
-
|
|
200
|
+
if (envString("WAYGRAPH_HEADED") === undefined)
|
|
201
|
+
setEnv("WAYGRAPH_HEADED", "1");
|
|
196
202
|
}
|
|
197
|
-
const videoTo =
|
|
203
|
+
const videoTo = envString("WAYGRAPH_VIDEO");
|
|
198
204
|
console.log(videoTo
|
|
199
205
|
? "waygraph try demo: step-through + record (Sign In -> Shop & Checkout -> blocked Viewer login) - click Next; video -> " +
|
|
200
206
|
(videoTo === "1" ? await resolveVideoDir(destDir) : videoTo)
|
|
@@ -202,7 +208,7 @@ async function runTryDemo() {
|
|
|
202
208
|
await runChain(destDir, TRY_DEMO_CHAIN);
|
|
203
209
|
if (process.exitCode)
|
|
204
210
|
return;
|
|
205
|
-
console.log("\nwaygraph try demo: running headless
|
|
211
|
+
console.log("\nwaygraph try demo: running headless chained-flows test ...");
|
|
206
212
|
const testCode = await runInherited("npm", ["test"], destDir);
|
|
207
213
|
if (testCode !== 0) {
|
|
208
214
|
process.exitCode = testCode;
|
|
@@ -219,13 +225,13 @@ async function runTryDemo() {
|
|
|
219
225
|
` ${loginFlowFile}\n` +
|
|
220
226
|
` ${shopFlowFile}\n` +
|
|
221
227
|
` ${viewerBlockedFlowFile}\n\n` +
|
|
222
|
-
"Headless
|
|
228
|
+
"Headless chained-flows test (automated - no clicking):\n" +
|
|
223
229
|
` ${testFile}\n\n` +
|
|
224
230
|
"Run again in that temp folder:\n" +
|
|
225
231
|
` cd ${destDir}\n` +
|
|
226
|
-
" npm run demo # step-through, manual Next (--step --no-
|
|
232
|
+
" npm run demo # step-through, manual Next (--step --no-auto-next)\n" +
|
|
227
233
|
" npm run auto # interactive explore (Effect Add/Remove, MemNav Open details)\n" +
|
|
228
|
-
" npm test # playwright
|
|
234
|
+
" npm test # playwright chained-flows test\n\n" +
|
|
229
235
|
"Permanent full example in this package: examples/saucedemo\n" +
|
|
230
236
|
"Keep a permanent scaffold in your tree: waygraph init my-app\n");
|
|
231
237
|
}
|
|
@@ -244,7 +250,8 @@ async function runTryAuto(opts = { cli: false }) {
|
|
|
244
250
|
const destDir = await prepareTryQuickstart("waygraph-try-auto");
|
|
245
251
|
if (!destDir)
|
|
246
252
|
return;
|
|
247
|
-
|
|
253
|
+
if (envString("WAYGRAPH_BASE_URL") === undefined)
|
|
254
|
+
setEnv("WAYGRAPH_BASE_URL", "https://www.saucedemo.com");
|
|
248
255
|
const cli = opts.cli === true;
|
|
249
256
|
console.log(cli
|
|
250
257
|
? "waygraph try auto: CLI explore on Sauce Demo (temp dir).\n" +
|
|
@@ -271,7 +278,7 @@ async function runTryAuto(opts = { cli: false }) {
|
|
|
271
278
|
"Docs: https://deviate-dv8.github.io/waygraph/auto.html\n");
|
|
272
279
|
}
|
|
273
280
|
export async function tryCase(args) {
|
|
274
|
-
const flags = parseRunFlags(args.slice(1));
|
|
281
|
+
const flags = parseRunFlags(args.slice(1), "try");
|
|
275
282
|
applyRunFlags(flags);
|
|
276
283
|
const modeRaw = (flags.positionals[0] ?? "demo").toLowerCase();
|
|
277
284
|
// auto:cli / --cli = CLI; bare try auto = headed panel
|
|
@@ -281,11 +288,8 @@ export async function tryCase(args) {
|
|
|
281
288
|
? "auto"
|
|
282
289
|
: modeRaw;
|
|
283
290
|
if (mode === "auto" || mode === "auto:cli") {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
: flags.headed === true || flags.nonHeadless === true
|
|
287
|
-
? false
|
|
288
|
-
: false; // try auto default = headed
|
|
291
|
+
// try auto opens the headed browser panel; auto:cli / --cli is the terminal menu.
|
|
292
|
+
const cli = mode === "auto:cli" || flags.cli === true;
|
|
289
293
|
await runTryAuto({ cli });
|
|
290
294
|
}
|
|
291
295
|
else if (mode === "demo" || mode === "") {
|