waygraph 0.15.54 → 0.16.1
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 +10 -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/cli/commands/browser.d.ts +2 -0
- package/dist/cli/commands/browser.js +109 -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/cli/commands/pilot.d.ts +2 -0
- package/dist/cli/commands/pilot.js +102 -0
- package/dist/{commands → cli/commands}/run.d.ts +0 -1
- package/dist/cli/commands/run.js +64 -0
- package/dist/cli/commands/session-ops.d.ts +3 -0
- package/dist/cli/commands/session-ops.js +257 -0
- package/dist/cli/commands/session.js +132 -0
- 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 +4 -12
- package/dist/{highlights → demo/narration}/demo-pace.js +5 -11
- package/dist/{highlights → demo/narration}/device.d.ts +4 -4
- package/dist/{highlights → demo/narration}/device.js +1 -1
- package/dist/demo/narration/merge.d.ts +10 -0
- package/dist/demo/narration/merge.js +67 -0
- package/dist/demo/narration/narration.d.ts +39 -0
- 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 +8 -8
- 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/demo/overlay/cursor.d.ts +19 -0
- package/dist/demo/overlay/cursor.js +142 -0
- package/dist/demo/overlay/device-stage.d.ts +26 -0
- package/dist/demo/overlay/device-stage.js +396 -0
- package/dist/demo/overlay/inpage/banner.d.ts +2 -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 +2 -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 +10 -0
- package/dist/demo/overlay/inpage/network.js +189 -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 +2 -0
- package/dist/demo/overlay/inpage/todos.js +293 -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 +31 -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 +61 -0
- package/dist/demo/overlay/rings.js +422 -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 +103 -0
- package/dist/demo/stepper/banner-log.d.ts +35 -0
- package/dist/demo/stepper/banner-log.js +65 -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 +48 -0
- package/dist/demo/stepper/demo-log.js +292 -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 +4 -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/panel-after.d.ts +17 -0
- package/dist/demo/stepper/panel-after.js +166 -0
- package/dist/demo/stepper/panel-before.d.ts +12 -0
- package/dist/demo/stepper/panel-before.js +241 -0
- package/dist/demo/stepper/slides.d.ts +23 -0
- package/dist/demo/stepper/slides.js +233 -0
- package/dist/demo/stepper/step-panels.d.ts +69 -0
- package/dist/demo/stepper/step-panels.js +172 -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 +47 -0
- package/dist/demo/stepper/teardown.js +178 -0
- package/dist/demo/stepper/todo-advance.d.ts +15 -0
- package/dist/demo/stepper/todo-advance.js +110 -0
- package/dist/demo/stepper/view.d.ts +58 -0
- package/dist/demo/stepper/view.js +31 -0
- package/dist/demo/types.d.ts +85 -0
- package/dist/demo/verbose-log.js +15 -0
- package/dist/engine/block/action-page.d.ts +53 -0
- package/dist/engine/block/action-page.js +1 -0
- package/dist/{types.d.ts → engine/block/block.d.ts} +102 -142
- package/dist/{core → engine/block}/block.js +12 -130
- package/dist/engine/block/branch.d.ts +17 -0
- package/dist/engine/block/branch.js +40 -0
- package/dist/{core → engine/block}/compose.d.ts +9 -7
- package/dist/{core → engine/block}/compose.js +1 -1
- package/dist/engine/block/dialog.d.ts +13 -0
- package/dist/engine/block/dialog.js +37 -0
- package/dist/{core/blocks → engine/block/kinds}/api.d.ts +16 -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 +17 -29
- package/dist/{core/blocks → engine/block/kinds}/method.js +6 -21
- package/dist/{core/blocks → engine/block/kinds}/nav.d.ts +21 -31
- package/dist/{core/blocks → engine/block/kinds}/nav.js +6 -12
- package/dist/{core/blocks → engine/block/kinds}/page.d.ts +14 -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} +22 -22
- package/dist/{errors.js → engine/errors.js} +22 -22
- package/dist/{core → engine/flow}/branch-regression.d.ts +7 -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/engine/flow/map-branch.d.ts +9 -0
- package/dist/engine/flow/map-branch.js +57 -0
- package/dist/{core → engine/flow}/map-builder.d.ts +34 -54
- package/dist/engine/flow/map-builder.js +242 -0
- package/dist/engine/flow/map-steps.d.ts +30 -0
- package/dist/engine/flow/map-steps.js +87 -0
- 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} +8 -12
- package/dist/{core/run-graph.js → engine/run/run.js} +22 -12
- 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/{trait.js → engine/trait/trait.js} +1 -1
- package/dist/index.d.ts +88 -36
- package/dist/index.js +46 -19
- package/dist/live/auto/auto.d.ts +22 -0
- package/dist/live/auto/auto.js +207 -0
- 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/live/auto/mem.d.ts +11 -0
- package/dist/live/auto/mem.js +85 -0
- package/dist/live/auto/menu.d.ts +30 -0
- package/dist/live/auto/menu.js +335 -0
- package/dist/live/auto-session/auto-session.d.ts +113 -0
- package/dist/live/auto-session/auto-session.js +452 -0
- package/dist/live/auto-session/console.d.ts +4 -0
- package/dist/live/auto-session/console.js +41 -0
- package/dist/live/auto-session/files.d.ts +44 -0
- package/dist/live/auto-session/files.js +145 -0
- package/dist/{auto-session → live/auto-session}/helpers.d.ts +9 -5
- package/dist/{auto-session → live/auto-session}/helpers.js +18 -1
- package/dist/live/auto-session/inspect.d.ts +4 -0
- package/dist/live/auto-session/inspect.js +75 -0
- package/dist/{session/auto-session-ipc.d.ts → live/auto-session/ipc.d.ts} +8 -25
- package/dist/{session/auto-session-ipc.js → live/auto-session/ipc.js} +36 -161
- package/dist/live/auto-session/open-browser.d.ts +6 -0
- package/dist/live/auto-session/open-browser.js +47 -0
- 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 +3 -3
- package/dist/{session → live/pilot}/pilot.js +5 -4
- package/dist/{traverse/run.d.ts → live/traverse/traverse.d.ts} +1 -1
- package/dist/live/traverse/traverse.js +212 -0
- package/dist/live/traverse/worker.d.ts +37 -0
- package/dist/live/traverse/worker.js +200 -0
- 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/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} +1 -5
- package/dist/{extensions.js → runtime/extensions.js} +2 -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} +6 -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 +1 -2
- 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/docs/CONVENTION.md +4 -5
- package/examples/saucedemo/docs/HELPERS.md +11 -11
- 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 -3
- 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 +5 -8
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/inventory.page.block.ts +3 -3
- 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 +35 -43
- 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 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +4 -5
- 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 +12 -10
- package/examples/saucedemo/src/states/checkout.states.ts +21 -11
- package/examples/saucedemo/src/stubs/device-showcase.ts +8 -10
- package/examples/saucedemo/tests/auto-graph.spec.ts +4 -12
- package/package.json +14 -6
- package/templates/agents/waygraph-planner.agent.md +2 -2
- package/templates/quickstart/docs/CONVENTION.md +4 -4
- package/templates/quickstart/docs/HELPERS.md +10 -8
- package/templates/quickstart/package.json +0 -3
- package/templates/quickstart/src/blocks/SITE-MAP.md +0 -1
- package/templates/quickstart/src/blocks/saucedemo-web/NAV.md +1 -5
- package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-cart.block.ts +3 -3
- 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 +5 -8
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/inventory.page.block.ts +3 -3
- 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 +35 -43
- 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 -4
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +4 -5
- 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 +12 -10
- package/templates/quickstart/src/states/checkout.states.ts +21 -11
- package/templates/quickstart/src/stubs/device-showcase.ts +8 -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/session.d.ts +0 -193
- package/dist/auto-session/session.js +0 -719
- 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/session.js +0 -600
- 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 -294
- package/dist/core/flow.js +0 -432
- package/dist/core/map-builder.js +0 -383
- 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/run-phase.d.ts +0 -43
- package/dist/highlights/stub-ctx.d.ts +0 -10
- package/dist/highlights/stub-ctx.js +0 -331
- package/dist/highlights/types.d.ts +0 -613
- 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/auto-explore-run.d.ts +0 -40
- package/dist/session/auto-explore-run.js +0 -707
- package/dist/session/step-overlay.d.ts +0 -37
- package/dist/session/step-overlay.js +0 -244
- package/dist/traverse/run.js +0 -423
- package/examples/routed-demo/playwright.config.ts +0 -21
- package/examples/saucedemo/src/blocks/saucedemo-web/ff-owner-auth.block.ts +0 -22
- 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/{session/overlay-beacon.d.ts → demo/overlay/beacon.d.ts} +0 -0
- /package/dist/{session/overlay-beacon.js → demo/overlay/beacon.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/{traverse → live/traverse}/coverage.d.ts +0 -0
- /package/dist/{traverse → live/traverse}/coverage.js +0 -0
- /package/dist/{traverse → live/traverse}/lease.d.ts +0 -0
- /package/dist/{traverse → live/traverse}/lease.js +0 -0
- /package/dist/{session/block-inject.d.ts → manifest/roots.d.ts} +0 -0
- /package/dist/{blocks-select.d.ts → manifest/select.d.ts} +0 -0
- /package/dist/{blocks-select.js → manifest/select.js} +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,257 @@
|
|
|
1
|
+
// Session ops against a running session by id: `waygraph auto|browser|pilot <op> <sessionId> ...` (send, status,
|
|
2
|
+
// attach, dom, trace, console, storage, click, type, press, goto, upload, reload, reach, resync, highlight).
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { parseHighlightShorthand } from "../../demo/narration/shorthand.js";
|
|
5
|
+
import { resolveSessionMeta } from "../../live/auto-session/files.js";
|
|
6
|
+
import { requestSession, runAttachLoop } from "../../live/auto-session/ipc.js";
|
|
7
|
+
import { parseCommand } from "../args.js";
|
|
8
|
+
const SEND_OPTIONS = {
|
|
9
|
+
timeout: { type: "string", value: "<ms>", help: "How long one Block may run (default 15000)" },
|
|
10
|
+
};
|
|
11
|
+
const DOM_OPTIONS = {
|
|
12
|
+
mode: { type: "string", value: "aria|full", help: "Accessibility tree (default) or the full DOM" },
|
|
13
|
+
selector: { type: "string", value: "<css>", help: "Only this element's subtree" },
|
|
14
|
+
depth: { type: "string", value: "N", help: "Levels to read" },
|
|
15
|
+
};
|
|
16
|
+
const OPS = new Set(["send", "status", "attach", "dom", "trace", "console", "storage", "upload", "click", "type", "press", "goto", "reload", "reach", "resync", "highlight"]);
|
|
17
|
+
/** Whether `sub` is a session op (`attach` is pilot's own subcommand, not an op, under `pilot`). */
|
|
18
|
+
export function isSessionOp(command, sub) {
|
|
19
|
+
return sub !== undefined && OPS.has(sub) && !(sub === "attach" && command === "pilot");
|
|
20
|
+
}
|
|
21
|
+
export async function sessionOpCase(args, command) {
|
|
22
|
+
const sub = args[1];
|
|
23
|
+
const sessionId = args[2];
|
|
24
|
+
if (!sessionId) {
|
|
25
|
+
console.error(`waygraph ${command} ${sub}: missing <sessionId>`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
const projHint = resolve(process.cwd());
|
|
29
|
+
const meta = resolveSessionMeta(sessionId, projHint);
|
|
30
|
+
if (!meta) {
|
|
31
|
+
console.error(`waygraph ${command} ${sub}: no such session "${sessionId}" — ` +
|
|
32
|
+
"wrong directory? run `waygraph pilot sessions` from the project that started it");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
const proj = meta.projectDir;
|
|
36
|
+
if (sub === "attach") {
|
|
37
|
+
await runAttachLoop(proj, sessionId);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (sub === "send") {
|
|
41
|
+
const pick = args[3];
|
|
42
|
+
if (pick === undefined) {
|
|
43
|
+
console.error('waygraph auto send: usage: waygraph auto send <sessionId> "<pick>" [--timeout <ms>]');
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
// Real, direct need found live: a single Block can legitimately
|
|
47
|
+
// run a genuinely slow real interaction (e.g. a multi-step mouse
|
|
48
|
+
// drag) that exceeds the 15s default - same reasoning `auto
|
|
49
|
+
// reach` already gets a 90s default for (multiple Blocks in one
|
|
50
|
+
// call). Unlike reach, send has no way to know ahead of time
|
|
51
|
+
// whether the ONE Block it's running is fast or slow, so this is
|
|
52
|
+
// opt-in via a flag rather than a raised default.
|
|
53
|
+
let timeoutMs;
|
|
54
|
+
const raw = parseCommand("auto send", SEND_OPTIONS, args.slice(4)).values.timeout;
|
|
55
|
+
if (raw !== undefined) {
|
|
56
|
+
const n = Number(raw);
|
|
57
|
+
if (!Number.isFinite(n) || n <= 0) {
|
|
58
|
+
console.error(`waygraph auto send: --timeout must be a positive number of ms, got "${raw}"`);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
timeoutMs = n;
|
|
62
|
+
}
|
|
63
|
+
const res = await requestSession(proj, sessionId, { op: "send", pick }, timeoutMs);
|
|
64
|
+
console.log(JSON.stringify(res));
|
|
65
|
+
if (!res.ok)
|
|
66
|
+
process.exitCode = 1;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (sub === "dom") {
|
|
70
|
+
const domArgs = args.slice(3);
|
|
71
|
+
let mode;
|
|
72
|
+
let selector;
|
|
73
|
+
let depth;
|
|
74
|
+
const dom = parseCommand("auto dom", DOM_OPTIONS, domArgs).values;
|
|
75
|
+
if (dom.mode !== undefined) {
|
|
76
|
+
if (dom.mode !== "aria" && dom.mode !== "full") {
|
|
77
|
+
console.error(`waygraph auto dom: --mode must be "aria" or "full", got "${dom.mode}"`);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
mode = dom.mode;
|
|
81
|
+
}
|
|
82
|
+
selector = dom.selector;
|
|
83
|
+
if (dom.depth !== undefined) {
|
|
84
|
+
const n = Number(dom.depth);
|
|
85
|
+
if (!Number.isInteger(n) || n < 1) {
|
|
86
|
+
console.error(`waygraph auto dom: --depth must be a positive integer, got "${dom.depth}"`);
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
depth = n;
|
|
90
|
+
}
|
|
91
|
+
const res = await requestSession(proj, sessionId, {
|
|
92
|
+
op: "dom",
|
|
93
|
+
...(mode ? { mode } : {}),
|
|
94
|
+
...(selector ? { selector } : {}),
|
|
95
|
+
...(depth !== undefined ? { depth } : {}),
|
|
96
|
+
});
|
|
97
|
+
console.log(JSON.stringify(res));
|
|
98
|
+
if (!res.ok)
|
|
99
|
+
process.exitCode = 1;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (sub === "trace") {
|
|
103
|
+
const res = await requestSession(proj, sessionId, { op: "trace" });
|
|
104
|
+
console.log(JSON.stringify(res));
|
|
105
|
+
if (!res.ok)
|
|
106
|
+
process.exitCode = 1;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (sub === "console") {
|
|
110
|
+
const res = await requestSession(proj, sessionId, { op: "console" });
|
|
111
|
+
console.log(JSON.stringify(res));
|
|
112
|
+
if (!res.ok)
|
|
113
|
+
process.exitCode = 1;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (sub === "storage") {
|
|
117
|
+
const res = await requestSession(proj, sessionId, { op: "storage" });
|
|
118
|
+
console.log(JSON.stringify(res));
|
|
119
|
+
if (!res.ok)
|
|
120
|
+
process.exitCode = 1;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (sub === "click") {
|
|
124
|
+
const selector = args[3];
|
|
125
|
+
if (selector === undefined) {
|
|
126
|
+
console.error('waygraph auto click: usage: waygraph auto click <sessionId> "<selector>"');
|
|
127
|
+
process.exit(1);
|
|
128
|
+
}
|
|
129
|
+
const res = await requestSession(proj, sessionId, { op: "click", selector });
|
|
130
|
+
console.log(JSON.stringify(res));
|
|
131
|
+
if (!res.ok)
|
|
132
|
+
process.exitCode = 1;
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (sub === "type") {
|
|
136
|
+
const selector = args[3];
|
|
137
|
+
const text = args[4];
|
|
138
|
+
if (selector === undefined || text === undefined) {
|
|
139
|
+
console.error('waygraph auto type: usage: waygraph auto type <sessionId> "<selector>" "<text>"');
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
const res = await requestSession(proj, sessionId, { op: "type", selector, text });
|
|
143
|
+
console.log(JSON.stringify(res));
|
|
144
|
+
if (!res.ok)
|
|
145
|
+
process.exitCode = 1;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (sub === "press") {
|
|
149
|
+
const selector = args[3];
|
|
150
|
+
const key = args[4];
|
|
151
|
+
if (selector === undefined || key === undefined) {
|
|
152
|
+
console.error('waygraph auto press: usage: waygraph auto press <sessionId> "<selector>" <key>');
|
|
153
|
+
process.exit(1);
|
|
154
|
+
}
|
|
155
|
+
const res = await requestSession(proj, sessionId, { op: "press", selector, key });
|
|
156
|
+
console.log(JSON.stringify(res));
|
|
157
|
+
if (!res.ok)
|
|
158
|
+
process.exitCode = 1;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (sub === "goto") {
|
|
162
|
+
const url = args[3];
|
|
163
|
+
if (url === undefined) {
|
|
164
|
+
console.error("waygraph auto goto: usage: waygraph auto goto <sessionId> <url>");
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
const res = await requestSession(proj, sessionId, { op: "goto", url });
|
|
168
|
+
console.log(JSON.stringify(res));
|
|
169
|
+
if (!res.ok)
|
|
170
|
+
process.exitCode = 1;
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (sub === "upload") {
|
|
174
|
+
const selector = args[3];
|
|
175
|
+
const kindOrPath = args[4];
|
|
176
|
+
if (selector === undefined || kindOrPath === undefined) {
|
|
177
|
+
console.error('waygraph auto upload: usage: waygraph auto upload <sessionId> "<selector>" <image|pdf|video|path-to-file>');
|
|
178
|
+
process.exit(1);
|
|
179
|
+
}
|
|
180
|
+
const stub = kindOrPath === "image" || kindOrPath === "pdf" || kindOrPath === "video"
|
|
181
|
+
? { selector, stub: kindOrPath }
|
|
182
|
+
: { selector, stub: { filePath: resolve(process.cwd(), kindOrPath) } };
|
|
183
|
+
const res = await requestSession(proj, sessionId, { op: "upload", ...stub });
|
|
184
|
+
console.log(JSON.stringify(res));
|
|
185
|
+
if (!res.ok)
|
|
186
|
+
process.exitCode = 1;
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (sub === "reload") {
|
|
190
|
+
const res = await requestSession(proj, sessionId, { op: "reload" });
|
|
191
|
+
console.log(JSON.stringify(res));
|
|
192
|
+
if (!res.ok)
|
|
193
|
+
process.exitCode = 1;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (sub === "reach") {
|
|
197
|
+
const checkpoint = args[3];
|
|
198
|
+
if (checkpoint === undefined) {
|
|
199
|
+
console.error("waygraph auto reach: usage: waygraph auto reach <sessionId> <Checkpoint>");
|
|
200
|
+
process.exit(1);
|
|
201
|
+
}
|
|
202
|
+
// Longer than every other op's default (15s): a real multi-step
|
|
203
|
+
// route runs several real Blocks in sequence server-side before
|
|
204
|
+
// responding - a legitimately slow single request, not a hang.
|
|
205
|
+
const res = await requestSession(proj, sessionId, { op: "reach", checkpoint }, 90_000);
|
|
206
|
+
console.log(JSON.stringify(res));
|
|
207
|
+
if (!res.ok)
|
|
208
|
+
process.exitCode = 1;
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (sub === "resync") {
|
|
212
|
+
const res = await requestSession(proj, sessionId, { op: "resync" });
|
|
213
|
+
console.log(JSON.stringify(res));
|
|
214
|
+
if (!res.ok)
|
|
215
|
+
process.exitCode = 1;
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (sub === "highlight") {
|
|
219
|
+
const raw = args[3];
|
|
220
|
+
if (raw === undefined) {
|
|
221
|
+
console.error(`waygraph ${command} highlight: usage:\n` +
|
|
222
|
+
` waygraph ${command} highlight <sessionId> '{"rings":[{"selector":"#x","label":"X"}]}'\n` +
|
|
223
|
+
` waygraph ${command} highlight <sessionId> "#x|X" (shorthand: <selector>|<label>[|<tone>], rings separated by ";")`);
|
|
224
|
+
process.exit(1);
|
|
225
|
+
}
|
|
226
|
+
let fixtures;
|
|
227
|
+
try {
|
|
228
|
+
fixtures = JSON.parse(raw);
|
|
229
|
+
}
|
|
230
|
+
catch (jsonErr) {
|
|
231
|
+
const shorthand = parseHighlightShorthand(raw);
|
|
232
|
+
if (shorthand.type === "error") {
|
|
233
|
+
console.error(`waygraph ${command} highlight: body is neither valid JSON (${jsonErr instanceof Error ? jsonErr.message : String(jsonErr)}) nor valid shorthand (${shorthand.reason})`);
|
|
234
|
+
process.exit(1);
|
|
235
|
+
}
|
|
236
|
+
fixtures = shorthand.fixtures;
|
|
237
|
+
}
|
|
238
|
+
if (fixtures.op !== undefined && fixtures.op !== "highlight") {
|
|
239
|
+
console.error(`waygraph ${command} highlight: do not set "op" (or set it to "highlight")`);
|
|
240
|
+
process.exit(1);
|
|
241
|
+
}
|
|
242
|
+
const { op: _ignore, ...rest } = fixtures;
|
|
243
|
+
const res = await requestSession(proj, sessionId, {
|
|
244
|
+
op: "highlight",
|
|
245
|
+
...rest,
|
|
246
|
+
});
|
|
247
|
+
console.log(JSON.stringify(res));
|
|
248
|
+
if (!res.ok)
|
|
249
|
+
process.exitCode = 1;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const res = await requestSession(proj, sessionId, { op: "status" });
|
|
253
|
+
console.log(JSON.stringify(res));
|
|
254
|
+
if (!res.ok)
|
|
255
|
+
process.exitCode = 1;
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// `waygraph auto` / `graph` / `browser` / `pilot`: hands `browser` and `pilot` subcommands and session ops to their
|
|
2
|
+
// files, then runs the interactive explore (or the graph print) for a project; `__auto-serve` is the session child.
|
|
3
|
+
import { existsSync, statSync } from "node:fs";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { discoverGraph, findOrphanBlocks, toMermaid } from "../../analysis/graph.js";
|
|
6
|
+
import { envString, setEnv } from "../../engine/env.js";
|
|
7
|
+
import { runAutoServeCommand } from "../../live/auto-session/ipc.js";
|
|
8
|
+
import { runAutoExplore } from "../../live/auto/auto.js";
|
|
9
|
+
import { resolveInjectRoots } from "../../manifest/roots.js";
|
|
10
|
+
import { isFileSelectToken, parseBlocksSelect } from "../../manifest/select.js";
|
|
11
|
+
import { resolveBaseUrl } from "../../runtime/waygraph-config.js";
|
|
12
|
+
import { applyRunFlags, looksLikeFlowFileRef, parseRunFlags } from "../flags.js";
|
|
13
|
+
import { runChain, runChainAuto } from "../run-chain.js";
|
|
14
|
+
import { browserCase } from "./browser.js";
|
|
15
|
+
import { pilotCase } from "./pilot.js";
|
|
16
|
+
import { isSessionOp, sessionOpCase } from "./session-ops.js";
|
|
17
|
+
export async function sessionCase(args, command) {
|
|
18
|
+
if (command === "browser" && (await browserCase(args)))
|
|
19
|
+
return;
|
|
20
|
+
if (command === "pilot" && (await pilotCase(args)))
|
|
21
|
+
return;
|
|
22
|
+
// A session op (`auto|browser|pilot send <sessionId> ...`) runs against a running session, before any project path.
|
|
23
|
+
if ((command === "auto" || command === "browser" || command === "pilot") && isSessionOp(command, args[1])) {
|
|
24
|
+
await sessionOpCase(args, command);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const flags = parseRunFlags(args.slice(1), command ?? "auto");
|
|
28
|
+
applyRunFlags(flags);
|
|
29
|
+
const mermaid = flags.mermaid === true;
|
|
30
|
+
const mapOnly = command === "graph" || flags.map === true;
|
|
31
|
+
const cliPicker = flags.cli === true;
|
|
32
|
+
const firstPos = flags.positionals[0];
|
|
33
|
+
// auto src/flows/shop.flow.ts → run that flow (same as `run`). Do not
|
|
34
|
+
// treat a .flow.ts path as a project directory (existsSync is true for files).
|
|
35
|
+
if (command === "auto" && firstPos && looksLikeFlowFileRef(firstPos) && !flags.blocksFromTo) {
|
|
36
|
+
const proj = resolve(process.cwd());
|
|
37
|
+
if (!existsSync(proj) || !statSync(proj).isDirectory()) {
|
|
38
|
+
console.error(`waygraph: no such directory: ${proj}`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
if (!envString("WAYGRAPH_BASE_URL")) {
|
|
42
|
+
const resolved = await resolveBaseUrl(proj);
|
|
43
|
+
if (resolved)
|
|
44
|
+
setEnv("WAYGRAPH_BASE_URL", resolved);
|
|
45
|
+
}
|
|
46
|
+
await runChain(proj, firstPos);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const proj = resolve(firstPos ?? process.cwd());
|
|
50
|
+
if (!existsSync(proj)) {
|
|
51
|
+
console.error(`waygraph: no such directory: ${proj}`);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
if (!statSync(proj).isDirectory()) {
|
|
55
|
+
console.error(`waygraph ${command}: "${firstPos}" is a file, not a project directory\n` +
|
|
56
|
+
" run a flow: waygraph auto src/flows/shop.flow.ts\n" +
|
|
57
|
+
" or explore: waygraph auto\n" +
|
|
58
|
+
" or path-find: waygraph auto --blocks LoginPage OrderComplete");
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
// auto --blocks From To (graph path-find + run)
|
|
62
|
+
// auto --blocks '/regex/' or '**/*.block.ts' (Phase C file select → explore)
|
|
63
|
+
if (command === "auto" && (flags.blocksFromTo || flags.blocks)) {
|
|
64
|
+
if (flags.blocksFromTo) {
|
|
65
|
+
const [fromTag, toTag] = flags.blocksFromTo;
|
|
66
|
+
await runChainAuto(proj, fromTag, toTag);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (flags.blocks && isFileSelectToken(flags.blocks)) {
|
|
70
|
+
const blocksSelect = parseBlocksSelect(flags.blocks);
|
|
71
|
+
const baseURL = flags.baseUrl ?? envString("WAYGRAPH_BASE_URL") ?? (await resolveBaseUrl(proj));
|
|
72
|
+
await runAutoExplore(proj, baseURL
|
|
73
|
+
? { cli: cliPicker, baseURL, blocksSelect }
|
|
74
|
+
: { cli: cliPicker, blocksSelect });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
console.error("waygraph auto --blocks expects <fromCheckpoint> <toCheckpoint>\n" +
|
|
78
|
+
" or file select: --blocks '**/mailpit/**/*.block.ts' / --blocks '/mailpit/'\n" +
|
|
79
|
+
' e.g. waygraph auto --blocks LoginPage OrderComplete\n' +
|
|
80
|
+
' for a hand-named chain use: waygraph run --blocks "a then b"\n' +
|
|
81
|
+
" or: waygraph auto src/flows/shop.flow.ts");
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
if (mapOnly || mermaid) {
|
|
85
|
+
const orphans = await findOrphanBlocks(proj);
|
|
86
|
+
const graph = await discoverGraph(proj);
|
|
87
|
+
if (mermaid) {
|
|
88
|
+
console.log(toMermaid(graph));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.log(JSON.stringify({ ...graph, orphans }, null, 2));
|
|
92
|
+
}
|
|
93
|
+
console.error(`waygraph graph: ${graph.nodes.length} node(s), ${graph.edges.length} edge(s), ` +
|
|
94
|
+
`${graph.skipped.length} Block(s) skipped (Out not resolvable), ` +
|
|
95
|
+
`${orphans.length} orphan Block(s)`);
|
|
96
|
+
if (orphans.length > 0) {
|
|
97
|
+
console.error("waygraph graph: orphan Blocks block auto --blocks path-find - wire each into a .flow.ts (waygraph check)");
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const baseURL = flags.baseUrl ?? envString("WAYGRAPH_BASE_URL") ?? (await resolveBaseUrl(proj));
|
|
102
|
+
await runAutoExplore(proj, baseURL ? { cli: cliPicker, baseURL } : { cli: cliPicker });
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
export async function autoServeCase(args) {
|
|
106
|
+
const proj = resolve(args[1] ?? process.cwd());
|
|
107
|
+
const flags = parseRunFlags(args.slice(2), "__auto-serve");
|
|
108
|
+
const sessionId = flags.sessionId;
|
|
109
|
+
if (!sessionId) {
|
|
110
|
+
console.error("waygraph __auto-serve: missing --session-id");
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
const baseURL = flags.baseUrl ?? envString("WAYGRAPH_BASE_URL") ?? (await resolveBaseUrl(proj));
|
|
114
|
+
const inject = flags.inject?.length ? resolveInjectRoots(flags.inject, proj) : undefined;
|
|
115
|
+
let headless;
|
|
116
|
+
if (flags.headlessBrowser)
|
|
117
|
+
headless = true;
|
|
118
|
+
else if (flags.nonHeadless)
|
|
119
|
+
headless = false;
|
|
120
|
+
await runAutoServeCommand({
|
|
121
|
+
projectDir: proj,
|
|
122
|
+
...(baseURL ? { baseURL } : {}),
|
|
123
|
+
...(flags.goto
|
|
124
|
+
? { startUrl: flags.goto, skipInitialNavigation: false }
|
|
125
|
+
: flags.blank === true
|
|
126
|
+
? { skipInitialNavigation: true }
|
|
127
|
+
: {}),
|
|
128
|
+
...(headless !== undefined ? { headless } : {}),
|
|
129
|
+
...(inject?.length ? { inject } : {}),
|
|
130
|
+
}, sessionId);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
@@ -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 === "") {
|