waygraph 0.15.47 → 0.15.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/graph.js +2 -2
- package/dist/auto-session/session.js +2 -2
- package/dist/cli/discover.d.ts +1 -1
- package/dist/cli/discover.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/{agent-dive.js → commands/agent-dive-scaffold.js} +2 -2
- package/dist/commands/agent-dive.js +1 -1
- package/dist/{engine/core.js → core/block.js} +6 -6
- package/dist/core/blocks/api.d.ts +54 -0
- package/dist/core/blocks/api.js +75 -0
- package/dist/{engine → core}/blocks/effect.d.ts +1 -1
- package/dist/{engine → core}/blocks/effect.js +1 -1
- package/dist/{engine → core}/blocks/method.d.ts +1 -1
- package/dist/{engine → core}/blocks/method.js +1 -1
- package/dist/{engine → core}/blocks/nav.js +1 -1
- package/dist/{engine → core}/blocks/page.js +1 -1
- package/dist/{engine → core}/branch-regression.js +2 -3
- package/dist/{engine → core}/compose.js +4 -4
- package/dist/{engine/engine-class.d.ts → core/engine.d.ts} +2 -133
- package/dist/core/engine.js +50 -0
- package/dist/{engine → core}/flow.js +5 -5
- package/dist/core/map-builder.d.ts +171 -0
- package/dist/{engine/engine-class.js → core/map-builder.js} +82 -98
- package/dist/{engine → core}/run-graph.js +4 -6
- package/dist/core.d.ts +14 -0
- package/dist/core.js +15 -0
- package/dist/errors.d.ts +54 -20
- package/dist/errors.js +67 -20
- package/dist/highlights/run-phase.js +15 -2
- package/dist/highlights/stub-ctx.js +16 -0
- package/dist/highlights/types.d.ts +38 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -1
- package/dist/mem-page.js +2 -2
- package/dist/mem-stub.d.ts +1 -1
- package/dist/pilot-overlay/fixtures.js +42 -10
- package/dist/pilot-overlay/shell.js +23 -10
- package/dist/runner/banner-log.js +1 -0
- package/dist/runner/device-stage.js +35 -15
- package/dist/runner/inpage/banner.d.ts +9 -1
- package/dist/runner/inpage/banner.js +27 -2
- package/dist/runner/inpage/caption.d.ts +3 -0
- package/dist/runner/inpage/caption.js +23 -0
- package/dist/runner/inpage/core.js +32 -9
- package/dist/runner/inpage/network.d.ts +15 -0
- package/dist/runner/inpage/network.js +217 -0
- package/dist/runner/inpage/panel-chrome.js +41 -1
- package/dist/runner/inpage/swipe-zoom.js +1 -1
- package/dist/runner/inpage/todos.js +6 -1
- package/dist/runner/main.js +9 -2
- package/dist/runner/network-capture.d.ts +9 -0
- package/dist/runner/network-capture.js +126 -0
- package/dist/runner/overlay-css.js +71 -7
- package/dist/runner/overlay-install.js +39 -2
- package/dist/runner/overlay-stage.js +5 -0
- package/dist/runner/rings.js +69 -45
- package/dist/runner/slides.js +14 -8
- package/dist/runner/step-mode.js +12 -0
- package/dist/runner/step-panels.js +9 -3
- package/dist/runner/teardown.js +16 -9
- package/dist/session/auto-explore-run.d.ts +1 -1
- package/dist/session/auto-explore-run.js +47 -10
- package/dist/{step-overlay.d.ts → session/step-overlay.d.ts} +1 -1
- package/dist/{step-overlay.js → session/step-overlay.js} +1 -1
- package/dist/trait.d.ts +1 -0
- package/dist/trait.js +15 -0
- package/dist/traverse/run.js +1 -1
- package/dist/ui/components/ring.js +4 -2
- package/dist/ui/overlay.css +36 -3
- package/examples/saucedemo/.waygraph-auto/00d147d1.log +21 -0
- package/examples/saucedemo/.waygraph-auto/0402cfcf.log +6 -0
- package/examples/saucedemo/.waygraph-auto/062b581f.log +20 -0
- package/examples/saucedemo/.waygraph-auto/0681582b.log +6 -0
- package/examples/saucedemo/.waygraph-auto/07f3e964.log +6 -0
- package/examples/saucedemo/.waygraph-auto/0868ae4d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/0924ddaa.log +22 -0
- package/examples/saucedemo/.waygraph-auto/092d6173.log +5 -0
- package/examples/saucedemo/.waygraph-auto/09924510.log +0 -0
- package/examples/saucedemo/.waygraph-auto/0998c941.log +21 -0
- package/examples/saucedemo/.waygraph-auto/0bf74300.log +21 -0
- package/examples/saucedemo/.waygraph-auto/0c01fd29.log +4 -0
- package/examples/saucedemo/.waygraph-auto/0c302590.log +0 -0
- package/examples/saucedemo/.waygraph-auto/0dee62d6.log +5 -0
- package/examples/saucedemo/.waygraph-auto/0eb4c081.log +5 -0
- package/examples/saucedemo/.waygraph-auto/10fd431c.log +0 -0
- package/examples/saucedemo/.waygraph-auto/13c6fe3c.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1581b677.log +0 -0
- package/examples/saucedemo/.waygraph-auto/164761a5.log +6 -0
- package/examples/saucedemo/.waygraph-auto/1905ceb2.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1b1d55c6.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1b80fd24.log +6 -0
- package/examples/saucedemo/.waygraph-auto/1c30a3c2.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1d90aa9a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1de7d889.log +0 -0
- package/examples/saucedemo/.waygraph-auto/1f233a4c.log +6 -0
- package/examples/saucedemo/.waygraph-auto/20e66801.log +0 -0
- package/examples/saucedemo/.waygraph-auto/20ffdb77.log +0 -0
- package/examples/saucedemo/.waygraph-auto/22f1a704.log +5 -0
- package/examples/saucedemo/.waygraph-auto/239cced3.log +20 -0
- package/examples/saucedemo/.waygraph-auto/25204b46.log +4 -0
- package/examples/saucedemo/.waygraph-auto/25e2e90f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/2708455e.log +22 -0
- package/examples/saucedemo/.waygraph-auto/272a96fd.log +20 -0
- package/examples/saucedemo/.waygraph-auto/28d7be5d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/2a6a8266.log +6 -0
- package/examples/saucedemo/.waygraph-auto/2b3401cf.log +20 -0
- package/examples/saucedemo/.waygraph-auto/2ceccd6d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/2f1b0c13.log +6 -0
- package/examples/saucedemo/.waygraph-auto/2f8d4073.log +6 -0
- package/examples/saucedemo/.waygraph-auto/30739278.log +6 -0
- package/examples/saucedemo/.waygraph-auto/31cb2e80.log +0 -0
- package/examples/saucedemo/.waygraph-auto/322d63cd.log +0 -0
- package/examples/saucedemo/.waygraph-auto/3239aa8a.log +6 -0
- package/examples/saucedemo/.waygraph-auto/326d87b7.log +6 -0
- package/examples/saucedemo/.waygraph-auto/3351c0b6.log +0 -0
- package/examples/saucedemo/.waygraph-auto/33df0770.log +0 -0
- package/examples/saucedemo/.waygraph-auto/340d624d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/36367ccf.log +0 -0
- package/examples/saucedemo/.waygraph-auto/372536a5.log +6 -0
- package/examples/saucedemo/.waygraph-auto/3a412f3c.log +0 -0
- package/examples/saucedemo/.waygraph-auto/3a859bd7.log +0 -0
- package/examples/saucedemo/.waygraph-auto/3cb0add7.log +0 -0
- package/examples/saucedemo/.waygraph-auto/3e42f0d8.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4144071d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4176a3c6.log +0 -0
- package/examples/saucedemo/.waygraph-auto/41d0793d.log +4 -0
- package/examples/saucedemo/.waygraph-auto/424b4d5d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/43253aba.log +0 -0
- package/examples/saucedemo/.waygraph-auto/438c6c53.log +22 -0
- package/examples/saucedemo/.waygraph-auto/4477db12.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4a1258b7.log +0 -0
- package/examples/saucedemo/.waygraph-auto/4adcd179.log +20 -0
- package/examples/saucedemo/.waygraph-auto/4c9d9b16.log +21 -0
- package/examples/saucedemo/.waygraph-auto/4da39c36.log +6 -0
- package/examples/saucedemo/.waygraph-auto/4dbefa7e.log +5 -0
- package/examples/saucedemo/.waygraph-auto/4efa7035.log +6 -0
- package/examples/saucedemo/.waygraph-auto/505affdc.log +4 -0
- package/examples/saucedemo/.waygraph-auto/51bcb60a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/5291bc78.log +22 -0
- package/examples/saucedemo/.waygraph-auto/54274c39.log +5 -0
- package/examples/saucedemo/.waygraph-auto/5440ce7e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/5738175f.log +22 -0
- package/examples/saucedemo/.waygraph-auto/57ce5643.log +22 -0
- package/examples/saucedemo/.waygraph-auto/5984426b.log +6 -0
- package/examples/saucedemo/.waygraph-auto/5a682e7c.log +22 -0
- package/examples/saucedemo/.waygraph-auto/5b79320c.log +21 -0
- package/examples/saucedemo/.waygraph-auto/5c55aaac.log +21 -0
- package/examples/saucedemo/.waygraph-auto/5ed00b16.log +4 -0
- package/examples/saucedemo/.waygraph-auto/60b9c066.log +6 -0
- package/examples/saucedemo/.waygraph-auto/610dd127.log +0 -0
- package/examples/saucedemo/.waygraph-auto/61105500.log +5 -0
- package/examples/saucedemo/.waygraph-auto/6134afe8.log +20 -0
- package/examples/saucedemo/.waygraph-auto/62a0bdc9.log +22 -0
- package/examples/saucedemo/.waygraph-auto/6376fc15.log +0 -0
- package/examples/saucedemo/.waygraph-auto/6599cbca.log +22 -0
- package/examples/saucedemo/.waygraph-auto/67aaca30.log +0 -0
- package/examples/saucedemo/.waygraph-auto/68b10298.log +0 -0
- package/examples/saucedemo/.waygraph-auto/68be5e12.log +0 -0
- package/examples/saucedemo/.waygraph-auto/68df05a6.log +22 -0
- package/examples/saucedemo/.waygraph-auto/693f67c4.log +20 -0
- package/examples/saucedemo/.waygraph-auto/69ae030a.log +6 -0
- package/examples/saucedemo/.waygraph-auto/69e73f35.log +6 -0
- package/examples/saucedemo/.waygraph-auto/6b2333b0.log +5 -0
- package/examples/saucedemo/.waygraph-auto/6c4c3817.log +0 -0
- package/examples/saucedemo/.waygraph-auto/6c954911.log +0 -0
- package/examples/saucedemo/.waygraph-auto/6d65a439.log +5 -0
- package/examples/saucedemo/.waygraph-auto/6d700055.log +0 -0
- package/examples/saucedemo/.waygraph-auto/6ead848f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/72675b2d.log +6 -0
- package/examples/saucedemo/.waygraph-auto/733dd260.log +5 -0
- package/examples/saucedemo/.waygraph-auto/75016486.log +0 -0
- package/examples/saucedemo/.waygraph-auto/752b01c6.log +22 -0
- package/examples/saucedemo/.waygraph-auto/75675227.log +6 -0
- package/examples/saucedemo/.waygraph-auto/75e2e658.log +0 -0
- package/examples/saucedemo/.waygraph-auto/76ac1a86.log +0 -0
- package/examples/saucedemo/.waygraph-auto/77605295.log +0 -0
- package/examples/saucedemo/.waygraph-auto/792671f4.log +22 -0
- package/examples/saucedemo/.waygraph-auto/79915adb.log +20 -0
- package/examples/saucedemo/.waygraph-auto/7a398774.log +6 -0
- package/examples/saucedemo/.waygraph-auto/7a72f66e.log +6 -0
- package/examples/saucedemo/.waygraph-auto/7a984334.log +4 -0
- package/examples/saucedemo/.waygraph-auto/7c6ee793.log +20 -0
- package/examples/saucedemo/.waygraph-auto/7c726dc4.log +22 -0
- package/examples/saucedemo/.waygraph-auto/7c72e8a5.log +4 -0
- package/examples/saucedemo/.waygraph-auto/7dbee625.log +22 -0
- package/examples/saucedemo/.waygraph-auto/7df66956.log +0 -0
- package/examples/saucedemo/.waygraph-auto/7e053160.log +0 -0
- package/examples/saucedemo/.waygraph-auto/802a0b5b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/80322e0b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/80a4978e.log +6 -0
- package/examples/saucedemo/.waygraph-auto/81cfe480.log +22 -0
- package/examples/saucedemo/.waygraph-auto/832f5add.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8337b6ad.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8493928e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/853bde43.log +0 -0
- package/examples/saucedemo/.waygraph-auto/86350ea6.log +22 -0
- package/examples/saucedemo/.waygraph-auto/86bb598a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/86d09876.log +22 -0
- package/examples/saucedemo/.waygraph-auto/878ad01b.log +4 -0
- package/examples/saucedemo/.waygraph-auto/87c88ba5.log +0 -0
- package/examples/saucedemo/.waygraph-auto/87cb80ff.log +0 -0
- package/examples/saucedemo/.waygraph-auto/880b2e78.log +6 -0
- package/examples/saucedemo/.waygraph-auto/88527936.log +5 -0
- package/examples/saucedemo/.waygraph-auto/893023ea.log +5 -0
- package/examples/saucedemo/.waygraph-auto/89416718.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8996a857.log +6 -0
- package/examples/saucedemo/.waygraph-auto/8a64ba0f.log +6 -0
- package/examples/saucedemo/.waygraph-auto/8b1cc2aa.log +6 -0
- package/examples/saucedemo/.waygraph-auto/8b73d13e.log +6 -0
- package/examples/saucedemo/.waygraph-auto/8d9e5cd2.log +21 -0
- package/examples/saucedemo/.waygraph-auto/8ec7d260.log +0 -0
- package/examples/saucedemo/.waygraph-auto/8ed43279.log +0 -0
- package/examples/saucedemo/.waygraph-auto/93acae32.log +5 -0
- package/examples/saucedemo/.waygraph-auto/96321a08.log +0 -0
- package/examples/saucedemo/.waygraph-auto/9742b6c2.log +6 -0
- package/examples/saucedemo/.waygraph-auto/99cc93eb.log +6 -0
- package/examples/saucedemo/.waygraph-auto/9cbfbedc.log +0 -0
- package/examples/saucedemo/.waygraph-auto/9dc147d2.log +22 -0
- package/examples/saucedemo/.waygraph-auto/a215a395.log +22 -0
- package/examples/saucedemo/.waygraph-auto/a23b7086.log +4 -0
- package/examples/saucedemo/.waygraph-auto/a35bd5ec.log +0 -0
- package/examples/saucedemo/.waygraph-auto/a68995e9.log +22 -0
- package/examples/saucedemo/.waygraph-auto/a6e4f936.log +22 -0
- package/examples/saucedemo/.waygraph-auto/a7da862b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/a82e2a48.log +0 -0
- package/examples/saucedemo/.waygraph-auto/a952eb91.log +0 -0
- package/examples/saucedemo/.waygraph-auto/a9559653.log +5 -0
- package/examples/saucedemo/.waygraph-auto/aa478de2.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ac350fc7.log +20 -0
- package/examples/saucedemo/.waygraph-auto/acc1b63a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ad12d191.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b04638f4.log +6 -0
- package/examples/saucedemo/.waygraph-auto/b48863e5.log +22 -0
- package/examples/saucedemo/.waygraph-auto/b56968e1.log +6 -0
- package/examples/saucedemo/.waygraph-auto/b64e0620.log +20 -0
- package/examples/saucedemo/.waygraph-auto/b86a6218.log +6 -0
- package/examples/saucedemo/.waygraph-auto/b8e9e956.log +22 -0
- package/examples/saucedemo/.waygraph-auto/b9b310ff.log +21 -0
- package/examples/saucedemo/.waygraph-auto/bc111745.log +22 -0
- package/examples/saucedemo/.waygraph-auto/bf7a77a2.log +0 -0
- package/examples/saucedemo/.waygraph-auto/c0d6f353.log +21 -0
- package/examples/saucedemo/.waygraph-auto/c0febcf2.log +20 -0
- package/examples/saucedemo/.waygraph-auto/c4c52998.log +6 -0
- package/examples/saucedemo/.waygraph-auto/c809ceb4.log +22 -0
- package/examples/saucedemo/.waygraph-auto/ca6de7e7.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ca8561bc.log +0 -0
- package/examples/saucedemo/.waygraph-auto/cb86d45b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/cb9a1978.log +6 -0
- package/examples/saucedemo/.waygraph-auto/cbbc689c.log +6 -0
- package/examples/saucedemo/.waygraph-auto/cd88364b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/cd919e1d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/cfff9eef.log +20 -0
- package/examples/saucedemo/.waygraph-auto/d0f59b21.log +4 -0
- package/examples/saucedemo/.waygraph-auto/d1195079.log +20 -0
- package/examples/saucedemo/.waygraph-auto/d2ef067a.log +5 -0
- package/examples/saucedemo/.waygraph-auto/d425471f.log +6 -0
- package/examples/saucedemo/.waygraph-auto/d5293921.log +0 -0
- package/examples/saucedemo/.waygraph-auto/d62a22c2.log +21 -0
- package/examples/saucedemo/.waygraph-auto/d6d1761f.log +22 -0
- package/examples/saucedemo/.waygraph-auto/d6d5f411.log +22 -0
- package/examples/saucedemo/.waygraph-auto/d6df2771.log +6 -0
- package/examples/saucedemo/.waygraph-auto/d7075012.log +21 -0
- package/examples/saucedemo/.waygraph-auto/d9ddc297.log +0 -0
- package/examples/saucedemo/.waygraph-auto/db4ac845.log +0 -0
- package/examples/saucedemo/.waygraph-auto/db6d7774.log +0 -0
- package/examples/saucedemo/.waygraph-auto/db839827.log +5 -0
- package/examples/saucedemo/.waygraph-auto/dde5e859.log +22 -0
- package/examples/saucedemo/.waygraph-auto/de8cac58.log +0 -0
- package/examples/saucedemo/.waygraph-auto/dedfcb18.log +0 -0
- package/examples/saucedemo/.waygraph-auto/def4d9b1.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e1549e40.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e1b0676d.log +21 -0
- package/examples/saucedemo/.waygraph-auto/e5111463.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e5fc1d7c.log +5 -0
- package/examples/saucedemo/.waygraph-auto/e6fd2202.log +0 -0
- package/examples/saucedemo/.waygraph-auto/edaa806d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/edaf33de.log +0 -0
- package/examples/saucedemo/.waygraph-auto/edd40cbb.log +20 -0
- package/examples/saucedemo/.waygraph-auto/eddfbffc.log +6 -0
- package/examples/saucedemo/.waygraph-auto/ee9fa1ad.log +5 -0
- package/examples/saucedemo/.waygraph-auto/ef319474.log +22 -0
- package/examples/saucedemo/.waygraph-auto/f28eee8d.log +0 -0
- package/examples/saucedemo/.waygraph-auto/f33bde90.log +0 -0
- package/examples/saucedemo/.waygraph-auto/f6ba7cb4.log +6 -0
- package/examples/saucedemo/.waygraph-auto/f7ac4d62.log +20 -0
- package/examples/saucedemo/.waygraph-auto/f929bb79.log +0 -0
- package/examples/saucedemo/.waygraph-auto/f92d4c6c.log +22 -0
- package/examples/saucedemo/.waygraph-auto/f92faf40.log +5 -0
- package/examples/saucedemo/.waygraph-auto/fa784369.log +21 -0
- package/examples/saucedemo/.waygraph-auto/fb55f723.log +20 -0
- package/examples/saucedemo/.waygraph-auto/fba3b738.log +0 -0
- package/examples/saucedemo/.waygraph-auto/ffdf2854.log +6 -0
- package/examples/saucedemo/README.md +13 -2
- package/examples/saucedemo/package.json +4 -0
- package/examples/saucedemo/src/flows/api-demo.flow.ts +37 -0
- package/examples/saucedemo/src/flows/checkout.flow.ts +34 -11
- package/package.json +5 -3
- package/dist/auto-explore-run.d.ts +0 -37
- package/dist/auto-explore-run.js +0 -670
- package/dist/auto-explore.d.ts +0 -57
- package/dist/auto-explore.js +0 -376
- package/dist/auto-session-ipc.d.ts +0 -150
- package/dist/auto-session-ipc.js +0 -497
- package/dist/block-inject.d.ts +0 -15
- package/dist/block-inject.js +0 -91
- package/dist/browser.d.ts +0 -15
- package/dist/browser.js +0 -29
- package/dist/coverage-gap.d.ts +0 -11
- package/dist/coverage-gap.js +0 -119
- package/dist/engine.d.ts +0 -12
- package/dist/engine.js +0 -13
- package/dist/graph.d.ts +0 -92
- package/dist/graph.js +0 -467
- package/dist/highlight-shorthand.d.ts +0 -24
- package/dist/highlight-shorthand.js +0 -30
- package/dist/map-check.d.ts +0 -18
- package/dist/map-check.js +0 -140
- package/dist/overlay-beacon.d.ts +0 -44
- package/dist/overlay-beacon.js +0 -85
- package/dist/pilot.d.ts +0 -54
- package/dist/pilot.js +0 -80
- package/dist/practices-check.d.ts +0 -14
- package/dist/practices-check.js +0 -195
- package/dist/traverse-coverage.d.ts +0 -59
- package/dist/traverse-coverage.js +0 -127
- package/dist/traverse-lease.d.ts +0 -18
- package/dist/traverse-lease.js +0 -62
- package/dist/traverse-run.d.ts +0 -47
- package/dist/traverse-run.js +0 -439
- package/dist/ui/compose.d.ts +0 -4
- package/dist/ui/compose.js +0 -7
- /package/dist/{verbose-log.d.ts → auto-session/verbose-log.d.ts} +0 -0
- /package/dist/{verbose-log.js → auto-session/verbose-log.js} +0 -0
- /package/dist/{agent-dive.d.ts → commands/agent-dive-scaffold.d.ts} +0 -0
- /package/dist/{engine/core.d.ts → core/block.d.ts} +0 -0
- /package/dist/{engine → core}/blocks/nav.d.ts +0 -0
- /package/dist/{engine → core}/blocks/page.d.ts +0 -0
- /package/dist/{engine → core}/branch-regression.d.ts +0 -0
- /package/dist/{engine → core}/compose.d.ts +0 -0
- /package/dist/{engine → core}/config.d.ts +0 -0
- /package/dist/{engine → core}/config.js +0 -0
- /package/dist/{engine → core}/flow.d.ts +0 -0
- /package/dist/{engine → core}/locate.d.ts +0 -0
- /package/dist/{engine → core}/locate.js +0 -0
- /package/dist/{engine → core}/run-graph.d.ts +0 -0
package/dist/auto-session-ipc.js
DELETED
|
@@ -1,497 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unix-socket transport for `waygraph auto --cli --detach` / `send` / `status` /
|
|
3
|
-
* `attach`. Session identity lives under a per-project `.waygraph-auto/`
|
|
4
|
-
* directory, mirroring the existing `.waygraph-traverse/` dotdir convention.
|
|
5
|
-
* See openspec/changes/waygraph-auto-cli-session-control.
|
|
6
|
-
*/
|
|
7
|
-
import { createServer, connect } from "node:net";
|
|
8
|
-
import { spawn } from "node:child_process";
|
|
9
|
-
import { createRequire } from "node:module";
|
|
10
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, rmSync, openSync, } from "node:fs";
|
|
11
|
-
import { join, dirname } from "node:path";
|
|
12
|
-
import { tmpdir } from "node:os";
|
|
13
|
-
import { fileURLToPath } from "node:url";
|
|
14
|
-
import { randomBytes } from "node:crypto";
|
|
15
|
-
import { createInterface } from "node:readline/promises";
|
|
16
|
-
import { stdin as input, stdout as output } from "node:process";
|
|
17
|
-
import { AutoSession, } from "./auto-session.js";
|
|
18
|
-
function sessionDir(projectDir) {
|
|
19
|
-
return join(projectDir, ".waygraph-auto");
|
|
20
|
-
}
|
|
21
|
-
function metaPath(projectDir, sessionId) {
|
|
22
|
-
return join(sessionDir(projectDir), `${sessionId}.json`);
|
|
23
|
-
}
|
|
24
|
-
/** Global index so session control works even when cwd ≠ the project that spawned the session. */
|
|
25
|
-
function globalMetaPath(sessionId) {
|
|
26
|
-
return join(socketDir(), `${sessionId}.meta.json`);
|
|
27
|
-
}
|
|
28
|
-
function isPidAlive(pid) {
|
|
29
|
-
try {
|
|
30
|
-
process.kill(pid, 0);
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Deliberately NOT under the project directory (unlike meta/log files) -
|
|
39
|
-
* a real bug found while proving out openspec/changes/waygraph-map's own
|
|
40
|
-
* "waypack" loading claim: a project loaded through a consumer's own deeply
|
|
41
|
-
* nested `node_modules/<pkg>` path can push the socket's absolute path past
|
|
42
|
-
* the OS's AF_UNIX `sun_path` limit (~108 bytes on Linux), failing with
|
|
43
|
-
* `listen EINVAL`. A short, fixed-location directory sidesteps this
|
|
44
|
-
* regardless of how deep `projectDir` itself is nested. `sessionId` alone
|
|
45
|
-
* (8 hex chars, `generateSessionId()`) is enough to keep this collision-safe
|
|
46
|
-
* across every project on the machine sharing this one flat directory - the
|
|
47
|
-
* same randomness space this package already relied on per-project.
|
|
48
|
-
*/
|
|
49
|
-
function socketDir() {
|
|
50
|
-
return join(tmpdir(), "waygraph-auto");
|
|
51
|
-
}
|
|
52
|
-
function socketPathFor(sessionId) {
|
|
53
|
-
return join(socketDir(), `${sessionId}.sock`);
|
|
54
|
-
}
|
|
55
|
-
function logPathFor(projectDir, sessionId) {
|
|
56
|
-
return join(sessionDir(projectDir), `${sessionId}.log`);
|
|
57
|
-
}
|
|
58
|
-
function generateSessionId() {
|
|
59
|
-
return randomBytes(4).toString("hex");
|
|
60
|
-
}
|
|
61
|
-
export function readSessionMeta(projectDir, sessionId) {
|
|
62
|
-
const p = metaPath(projectDir, sessionId);
|
|
63
|
-
if (!existsSync(p))
|
|
64
|
-
return null;
|
|
65
|
-
try {
|
|
66
|
-
return JSON.parse(readFileSync(p, "utf-8"));
|
|
67
|
-
}
|
|
68
|
-
catch {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Resolve session metadata from a project hint (cwd) or the global registry.
|
|
74
|
-
* Fixes "session unreachable" when the agent calls status/send from a different
|
|
75
|
-
* directory or pane than the one that ran `pilot start`.
|
|
76
|
-
*/
|
|
77
|
-
export function resolveSessionMeta(sessionId, projectDirHint) {
|
|
78
|
-
if (projectDirHint) {
|
|
79
|
-
const local = readSessionMeta(projectDirHint, sessionId);
|
|
80
|
-
if (local)
|
|
81
|
-
return local;
|
|
82
|
-
}
|
|
83
|
-
const globalPath = globalMetaPath(sessionId);
|
|
84
|
-
if (existsSync(globalPath)) {
|
|
85
|
-
try {
|
|
86
|
-
return JSON.parse(readFileSync(globalPath, "utf-8"));
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
function writeGlobalSessionMeta(meta) {
|
|
95
|
-
mkdirSync(socketDir(), { recursive: true });
|
|
96
|
-
writeFileSync(globalMetaPath(meta.sessionId), JSON.stringify(meta, null, 2));
|
|
97
|
-
}
|
|
98
|
-
function removeSessionFiles(projectDir, sessionId) {
|
|
99
|
-
for (const p of [
|
|
100
|
-
metaPath(projectDir, sessionId),
|
|
101
|
-
globalMetaPath(sessionId),
|
|
102
|
-
socketPathFor(sessionId),
|
|
103
|
-
]) {
|
|
104
|
-
try {
|
|
105
|
-
rmSync(p, { force: true });
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
/* ignore */
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/** Reads newline-delimited JSON off a socket, one message at a time. */
|
|
113
|
-
function readOneMessage(sock, timeoutMs) {
|
|
114
|
-
return new Promise((resolvePromise, reject) => {
|
|
115
|
-
let buf = "";
|
|
116
|
-
const timer = setTimeout(() => {
|
|
117
|
-
cleanup();
|
|
118
|
-
reject(new Error(`timed out after ${timeoutMs}ms waiting for a response`));
|
|
119
|
-
}, timeoutMs);
|
|
120
|
-
const onData = (chunk) => {
|
|
121
|
-
buf += chunk.toString("utf-8");
|
|
122
|
-
const nl = buf.indexOf("\n");
|
|
123
|
-
if (nl === -1)
|
|
124
|
-
return;
|
|
125
|
-
const line = buf.slice(0, nl);
|
|
126
|
-
cleanup();
|
|
127
|
-
try {
|
|
128
|
-
resolvePromise(JSON.parse(line));
|
|
129
|
-
}
|
|
130
|
-
catch (err) {
|
|
131
|
-
reject(new Error(`malformed response: ${err instanceof Error ? err.message : String(err)}`));
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
const onError = (err) => {
|
|
135
|
-
cleanup();
|
|
136
|
-
reject(err);
|
|
137
|
-
};
|
|
138
|
-
const onClose = () => {
|
|
139
|
-
cleanup();
|
|
140
|
-
reject(new Error("connection closed before a response arrived"));
|
|
141
|
-
};
|
|
142
|
-
function cleanup() {
|
|
143
|
-
clearTimeout(timer);
|
|
144
|
-
sock.off("data", onData);
|
|
145
|
-
sock.off("error", onError);
|
|
146
|
-
sock.off("close", onClose);
|
|
147
|
-
}
|
|
148
|
-
sock.on("data", onData);
|
|
149
|
-
sock.on("error", onError);
|
|
150
|
-
sock.on("close", onClose);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
export async function requestSession(projectDir, sessionId, request, timeoutMs = 15_000) {
|
|
154
|
-
const meta = resolveSessionMeta(sessionId, projectDir);
|
|
155
|
-
if (!meta) {
|
|
156
|
-
return {
|
|
157
|
-
ok: false,
|
|
158
|
-
error: `no such session "${sessionId}" (no metadata under ${projectDir}/.waygraph-auto/ or global registry) — ` +
|
|
159
|
-
"run from the project that started the session, or `waygraph pilot sessions` to list live ids",
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
if (!isPidAlive(meta.pid)) {
|
|
163
|
-
removeSessionFiles(meta.projectDir, sessionId);
|
|
164
|
-
return {
|
|
165
|
-
ok: false,
|
|
166
|
-
error: `session "${sessionId}" is not running (pid ${meta.pid} exited) — start a new session with pilot/browser start`,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
return new Promise((resolvePromise) => {
|
|
170
|
-
const sock = connect(meta.socketPath);
|
|
171
|
-
const connectTimer = setTimeout(() => {
|
|
172
|
-
sock.destroy();
|
|
173
|
-
resolvePromise({ ok: false, error: `session "${sessionId}" is unreachable (socket did not respond)` });
|
|
174
|
-
}, timeoutMs);
|
|
175
|
-
sock.on("connect", () => {
|
|
176
|
-
sock.write(JSON.stringify(request) + "\n");
|
|
177
|
-
});
|
|
178
|
-
sock.on("error", () => {
|
|
179
|
-
clearTimeout(connectTimer);
|
|
180
|
-
resolvePromise({
|
|
181
|
-
ok: false,
|
|
182
|
-
error: `session "${sessionId}" is unreachable (stale socket - the process may have crashed)`,
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
readOneMessage(sock, timeoutMs)
|
|
186
|
-
.then((res) => {
|
|
187
|
-
clearTimeout(connectTimer);
|
|
188
|
-
resolvePromise(res);
|
|
189
|
-
})
|
|
190
|
-
.catch((err) => {
|
|
191
|
-
clearTimeout(connectTimer);
|
|
192
|
-
resolvePromise({ ok: false, error: err instanceof Error ? err.message : String(err) });
|
|
193
|
-
})
|
|
194
|
-
.finally(() => sock.end());
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Server-side: runs `session` behind a unix socket at
|
|
199
|
-
* `.waygraph-auto/<sessionId>.sock`, writing session metadata only once the
|
|
200
|
-
* socket is actually listening (the metadata file's existence is the
|
|
201
|
-
* "session is ready" signal a spawning parent polls for). Requests are
|
|
202
|
-
* processed one at a time via a queue - Node's single-threaded event loop
|
|
203
|
-
* already prevents true parallelism, but two overlapping `await`-heavy
|
|
204
|
-
* handlers could still interleave against the same page/mem.
|
|
205
|
-
*/
|
|
206
|
-
export async function serveSession(session, projectDir, sessionId, headless = true) {
|
|
207
|
-
mkdirSync(sessionDir(projectDir), { recursive: true });
|
|
208
|
-
mkdirSync(socketDir(), { recursive: true });
|
|
209
|
-
const socketPath = socketPathFor(sessionId);
|
|
210
|
-
rmSync(socketPath, { force: true });
|
|
211
|
-
let queue = Promise.resolve();
|
|
212
|
-
const enqueue = (fn) => {
|
|
213
|
-
const next = queue.then(fn, fn);
|
|
214
|
-
queue = next.catch(() => { });
|
|
215
|
-
return next;
|
|
216
|
-
};
|
|
217
|
-
const server = createServer((sock) => {
|
|
218
|
-
let buf = "";
|
|
219
|
-
sock.on("data", (chunk) => {
|
|
220
|
-
buf += chunk.toString("utf-8");
|
|
221
|
-
let nl;
|
|
222
|
-
while ((nl = buf.indexOf("\n")) !== -1) {
|
|
223
|
-
const line = buf.slice(0, nl);
|
|
224
|
-
buf = buf.slice(nl + 1);
|
|
225
|
-
void handleLine(line, sock);
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
async function handleLine(line, sock) {
|
|
230
|
-
let request;
|
|
231
|
-
try {
|
|
232
|
-
request = JSON.parse(line);
|
|
233
|
-
}
|
|
234
|
-
catch {
|
|
235
|
-
sock.write(JSON.stringify({ ok: false, error: "malformed request (invalid JSON)" }) + "\n");
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
await enqueue(async () => {
|
|
239
|
-
let response;
|
|
240
|
-
let shouldQuit = false;
|
|
241
|
-
try {
|
|
242
|
-
if (request.op === "status") {
|
|
243
|
-
response = { ok: true, snapshot: await session.currentSnapshot(), quit: false };
|
|
244
|
-
}
|
|
245
|
-
else if (request.op === "send") {
|
|
246
|
-
const result = await session.applyPick(request.pick);
|
|
247
|
-
response = result.ok
|
|
248
|
-
? { ok: true, snapshot: result.snapshot, quit: result.quit }
|
|
249
|
-
: { ok: false, error: result.error };
|
|
250
|
-
shouldQuit = result.ok && result.quit;
|
|
251
|
-
}
|
|
252
|
-
else if (request.op === "dom") {
|
|
253
|
-
const { op: _op, ...domOpts } = request;
|
|
254
|
-
response = await session.inspectDom(domOpts);
|
|
255
|
-
}
|
|
256
|
-
else if (request.op === "trace") {
|
|
257
|
-
response = { ok: true, trace: session.getTrace() };
|
|
258
|
-
}
|
|
259
|
-
else if (request.op === "console") {
|
|
260
|
-
response = { ok: true, consoleLog: session.getConsoleLog() };
|
|
261
|
-
}
|
|
262
|
-
else if (request.op === "storage") {
|
|
263
|
-
response = { ok: true, ...(await session.inspectStorage()) };
|
|
264
|
-
}
|
|
265
|
-
else if (request.op === "upload") {
|
|
266
|
-
response = await session.rawUpload(request.selector, request.stub);
|
|
267
|
-
}
|
|
268
|
-
else if (request.op === "click") {
|
|
269
|
-
response = await session.rawClick(request.selector);
|
|
270
|
-
}
|
|
271
|
-
else if (request.op === "type") {
|
|
272
|
-
response = await session.rawType(request.selector, request.text);
|
|
273
|
-
}
|
|
274
|
-
else if (request.op === "press") {
|
|
275
|
-
response = await session.rawPress(request.selector, request.key);
|
|
276
|
-
}
|
|
277
|
-
else if (request.op === "goto") {
|
|
278
|
-
response = await session.rawGoto(request.url);
|
|
279
|
-
}
|
|
280
|
-
else if (request.op === "reload") {
|
|
281
|
-
await session.reloadLibrary();
|
|
282
|
-
response = { ok: true, snapshot: await session.currentSnapshot(), quit: false };
|
|
283
|
-
}
|
|
284
|
-
else if (request.op === "reach") {
|
|
285
|
-
response = await session.applyPath(request.checkpoint);
|
|
286
|
-
}
|
|
287
|
-
else if (request.op === "resync") {
|
|
288
|
-
response = await session.resync();
|
|
289
|
-
}
|
|
290
|
-
else if (request.op === "highlight") {
|
|
291
|
-
const { op: _op, ...fixtures } = request;
|
|
292
|
-
response = await session.applyHighlight(fixtures);
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
response = { ok: false, error: `unknown op "${request.op}"` };
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
catch (err) {
|
|
299
|
-
// Real, confirmed bug this fixes: an uncaught rejection here (e.g. a
|
|
300
|
-
// Playwright locator timing out because the element it found a
|
|
301
|
-
// moment ago - via `.count()`, which does NOT auto-wait - is gone by
|
|
302
|
-
// the time a slower call like `.evaluate()` re-resolves it, which
|
|
303
|
-
// DOES auto-wait) used to escape `handleLine`'s returned promise
|
|
304
|
-
// uncaught, crashing the whole detached session process on a single
|
|
305
|
-
// bad request. One request failing must never take the rest of the
|
|
306
|
-
// still-live session (browser/page/socket) down with it.
|
|
307
|
-
response = { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
308
|
-
}
|
|
309
|
-
sock.write(JSON.stringify(response) + "\n");
|
|
310
|
-
if (shouldQuit) {
|
|
311
|
-
setImmediate(() => void shutdown());
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
let shuttingDown = false;
|
|
316
|
-
async function shutdown() {
|
|
317
|
-
if (shuttingDown)
|
|
318
|
-
return;
|
|
319
|
-
shuttingDown = true;
|
|
320
|
-
server.close();
|
|
321
|
-
await session.close().catch(() => { });
|
|
322
|
-
removeSessionFiles(projectDir, sessionId);
|
|
323
|
-
process.exit(0);
|
|
324
|
-
}
|
|
325
|
-
await new Promise((resolvePromise, reject) => {
|
|
326
|
-
server.on("error", reject);
|
|
327
|
-
server.listen(socketPath, resolvePromise);
|
|
328
|
-
});
|
|
329
|
-
const meta = {
|
|
330
|
-
sessionId,
|
|
331
|
-
socketPath,
|
|
332
|
-
pid: process.pid,
|
|
333
|
-
projectDir,
|
|
334
|
-
startedAt: new Date().toISOString(),
|
|
335
|
-
headless,
|
|
336
|
-
};
|
|
337
|
-
writeFileSync(metaPath(projectDir, sessionId), JSON.stringify(meta, null, 2));
|
|
338
|
-
writeGlobalSessionMeta(meta);
|
|
339
|
-
process.on("SIGTERM", () => void shutdown());
|
|
340
|
-
process.on("SIGINT", () => void shutdown());
|
|
341
|
-
}
|
|
342
|
-
/** Entry point for the hidden `__auto-serve` CLI command (runs in the detached child). */
|
|
343
|
-
export async function runAutoServeCommand(init, sessionId) {
|
|
344
|
-
const session = await AutoSession.start({ ...init, sessionId });
|
|
345
|
-
await serveSession(session, init.projectDir, sessionId, init.headless ?? true);
|
|
346
|
-
// Keep the event loop alive - the listening server already does this,
|
|
347
|
-
// but await forever here documents the intent for a reader.
|
|
348
|
-
await new Promise(() => { });
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Parent-side: spawns a detached background process running the same
|
|
352
|
-
* explore session as a socket server, waits for it to signal readiness (its
|
|
353
|
-
* metadata file appearing), and returns its identity. Recurses through the
|
|
354
|
-
* existing `bin/waygraph` launcher (same tsx/esm registration every other
|
|
355
|
-
* invocation already gets) with the hidden `__auto-serve` command, rather
|
|
356
|
-
* than re-implementing that resolution here.
|
|
357
|
-
*/
|
|
358
|
-
export async function spawnDetachedSession(init, readyTimeoutMs = 20_000) {
|
|
359
|
-
const sessionId = generateSessionId();
|
|
360
|
-
mkdirSync(sessionDir(init.projectDir), { recursive: true });
|
|
361
|
-
const pkgRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
362
|
-
const require = createRequire(join(pkgRoot, "package.json"));
|
|
363
|
-
const tsxEsm = require.resolve("tsx/esm");
|
|
364
|
-
const cli = join(pkgRoot, "dist", "cli.js");
|
|
365
|
-
const logFd = openSync(logPathFor(init.projectDir, sessionId), "a");
|
|
366
|
-
const args = ["--import", tsxEsm, cli, "__auto-serve", init.projectDir, "--session-id", sessionId];
|
|
367
|
-
if (init.baseURL)
|
|
368
|
-
args.push("--base-url", init.baseURL);
|
|
369
|
-
if (init.startUrl)
|
|
370
|
-
args.push("--goto", init.startUrl);
|
|
371
|
-
if (init.skipInitialNavigation)
|
|
372
|
-
args.push("--blank");
|
|
373
|
-
if (init.headless === false)
|
|
374
|
-
args.push("--non-headless");
|
|
375
|
-
if (init.headless === true)
|
|
376
|
-
args.push("--headless");
|
|
377
|
-
for (const p of init.inject ?? []) {
|
|
378
|
-
args.push("--inject", p);
|
|
379
|
-
}
|
|
380
|
-
// Spawn cli.js directly — not bin/waygraph (which would fork a second Node).
|
|
381
|
-
const child = spawn(process.execPath, args, {
|
|
382
|
-
detached: true,
|
|
383
|
-
stdio: ["ignore", logFd, logFd],
|
|
384
|
-
windowsHide: true,
|
|
385
|
-
env: process.env,
|
|
386
|
-
});
|
|
387
|
-
child.unref();
|
|
388
|
-
const deadline = Date.now() + readyTimeoutMs;
|
|
389
|
-
while (Date.now() < deadline) {
|
|
390
|
-
const meta = readSessionMeta(init.projectDir, sessionId);
|
|
391
|
-
if (meta)
|
|
392
|
-
return meta;
|
|
393
|
-
await new Promise((r) => setTimeout(r, 150));
|
|
394
|
-
}
|
|
395
|
-
throw new Error(`session "${sessionId}" did not become ready within ${readyTimeoutMs}ms - ` +
|
|
396
|
-
`check ${logPathFor(init.projectDir, sessionId)} for errors`);
|
|
397
|
-
}
|
|
398
|
-
/** Stop one detached session (SIGTERM + cleanup metadata/socket). */
|
|
399
|
-
export function stopBrowserSession(projectDir, sessionId) {
|
|
400
|
-
const meta = resolveSessionMeta(sessionId, projectDir);
|
|
401
|
-
if (!meta)
|
|
402
|
-
return false;
|
|
403
|
-
try {
|
|
404
|
-
process.kill(meta.pid, "SIGTERM");
|
|
405
|
-
}
|
|
406
|
-
catch {
|
|
407
|
-
/* already gone */
|
|
408
|
-
}
|
|
409
|
-
removeSessionFiles(meta.projectDir, sessionId);
|
|
410
|
-
return true;
|
|
411
|
-
}
|
|
412
|
-
/** Stop every live session registered for a project. */
|
|
413
|
-
export function stopAllBrowserSessions(projectDir) {
|
|
414
|
-
const sessions = listBrowserSessions(projectDir);
|
|
415
|
-
for (const meta of sessions) {
|
|
416
|
-
stopBrowserSession(meta.projectDir, meta.sessionId);
|
|
417
|
-
}
|
|
418
|
-
return sessions.length;
|
|
419
|
-
}
|
|
420
|
-
/** Live browser sessions for a project (metadata + socket + pid still present). */
|
|
421
|
-
export function listBrowserSessions(projectDir) {
|
|
422
|
-
const dir = sessionDir(projectDir);
|
|
423
|
-
if (!existsSync(dir))
|
|
424
|
-
return [];
|
|
425
|
-
const out = [];
|
|
426
|
-
for (const f of readdirSync(dir)) {
|
|
427
|
-
if (!f.endsWith(".json"))
|
|
428
|
-
continue;
|
|
429
|
-
const id = f.slice(0, -".json".length);
|
|
430
|
-
const meta = readSessionMeta(projectDir, id);
|
|
431
|
-
if (!meta)
|
|
432
|
-
continue;
|
|
433
|
-
if (!existsSync(socketPathFor(id)))
|
|
434
|
-
continue;
|
|
435
|
-
if (!isPidAlive(meta.pid)) {
|
|
436
|
-
removeSessionFiles(projectDir, id);
|
|
437
|
-
continue;
|
|
438
|
-
}
|
|
439
|
-
out.push(meta);
|
|
440
|
-
}
|
|
441
|
-
return out.sort((a, b) => a.startedAt.localeCompare(b.startedAt));
|
|
442
|
-
}
|
|
443
|
-
function printSnapshotMenu(snapshot) {
|
|
444
|
-
console.log("");
|
|
445
|
-
console.log(`You are here: ${snapshot.here ?? "Unknown (pick Start here)"}`);
|
|
446
|
-
if (snapshot.lastRunNote)
|
|
447
|
-
console.log(snapshot.lastRunNote);
|
|
448
|
-
console.log("");
|
|
449
|
-
if (snapshot.done) {
|
|
450
|
-
console.log(" (no moves available on this page)");
|
|
451
|
-
}
|
|
452
|
-
for (const section of snapshot.sections) {
|
|
453
|
-
console.log(` -- ${section.title} --`);
|
|
454
|
-
for (const edge of section.edges) {
|
|
455
|
-
if (edge.label) {
|
|
456
|
-
console.log(` [${edge.index}] ${edge.label}`);
|
|
457
|
-
}
|
|
458
|
-
else {
|
|
459
|
-
const desc = edge.description ? ` - ${edge.description}` : "";
|
|
460
|
-
console.log(` [${edge.index}] ${edge.block} (${edge.kind}) -> ${edge.to}${desc}`);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
console.log(" [q] quit");
|
|
465
|
-
console.log("");
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Client-only interactive loop against a running detached session - reopens
|
|
469
|
-
* the same rendering/parsing the foreground `--cli` loop uses, driven purely
|
|
470
|
-
* through `status`/`send`. No server-side support beyond those two ops.
|
|
471
|
-
*/
|
|
472
|
-
export async function runAttachLoop(projectDir, sessionId) {
|
|
473
|
-
const rl = createInterface({ input, output });
|
|
474
|
-
try {
|
|
475
|
-
for (;;) {
|
|
476
|
-
const statusRes = await requestSession(projectDir, sessionId, { op: "status" });
|
|
477
|
-
if (!statusRes.ok) {
|
|
478
|
-
console.error(`waygraph auto attach: ${statusRes.error}`);
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
printSnapshotMenu(statusRes.snapshot);
|
|
482
|
-
const ans = await rl.question("Choose: ");
|
|
483
|
-
const sendRes = await requestSession(projectDir, sessionId, { op: "send", pick: ans });
|
|
484
|
-
if (!sendRes.ok) {
|
|
485
|
-
console.error(`waygraph auto attach: ${sendRes.error}`);
|
|
486
|
-
continue;
|
|
487
|
-
}
|
|
488
|
-
if (sendRes.quit) {
|
|
489
|
-
console.error("waygraph auto attach: session quit.");
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
finally {
|
|
495
|
-
rl.close();
|
|
496
|
-
}
|
|
497
|
-
}
|
package/dist/block-inject.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare function packageRoot(): string;
|
|
2
|
-
/** Human label for an injected root (used in merged `file` paths). */
|
|
3
|
-
export declare function injectLabel(root: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* Display path for a Block discovered under an inject root (not the host cwd).
|
|
6
|
-
* Primary project files stay relative as-is; injected ones are tagged `@label/...`.
|
|
7
|
-
*/
|
|
8
|
-
export declare function injectTaggedFile(hostDir: string, root: string, relFile: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Resolve one `--inject` token to an absolute directory (preset name or path).
|
|
11
|
-
*/
|
|
12
|
-
export declare function resolveInjectRoot(token: string, cwd?: string): string;
|
|
13
|
-
export declare function resolveInjectRoots(tokens: string[], cwd?: string): string[];
|
|
14
|
-
/** Roots to scan: host project first, then each inject path (deduped). */
|
|
15
|
-
export declare function exploreRoots(projectDir: string, inject?: string[]): string[];
|
package/dist/block-inject.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Merge Block libraries / graphs from extra project roots into a host session
|
|
3
|
-
* (waygraph browser `--inject`). Presets name bundled or well-known checkouts.
|
|
4
|
-
*/
|
|
5
|
-
import { existsSync } from "node:fs";
|
|
6
|
-
import { basename, dirname, join, resolve } from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { homedir } from "node:os";
|
|
9
|
-
export function packageRoot() {
|
|
10
|
-
return resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
11
|
-
}
|
|
12
|
-
/** Human label for an injected root (used in merged `file` paths). */
|
|
13
|
-
export function injectLabel(root) {
|
|
14
|
-
return basename(root.replace(/\/$/, ""));
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Display path for a Block discovered under an inject root (not the host cwd).
|
|
18
|
-
* Primary project files stay relative as-is; injected ones are tagged `@label/...`.
|
|
19
|
-
*/
|
|
20
|
-
export function injectTaggedFile(hostDir, root, relFile) {
|
|
21
|
-
const host = resolve(hostDir);
|
|
22
|
-
const r = resolve(root);
|
|
23
|
-
if (r === host)
|
|
24
|
-
return relFile.replace(/\\/g, "/");
|
|
25
|
-
return `@${injectLabel(r)}/${relFile.replace(/\\/g, "/")}`;
|
|
26
|
-
}
|
|
27
|
-
const PRESETS = {
|
|
28
|
-
saucedemo: () => join(packageRoot(), "examples", "saucedemo"),
|
|
29
|
-
demosauce: () => join(packageRoot(), "examples", "saucedemo"),
|
|
30
|
-
veciro: () => {
|
|
31
|
-
if (process.env.WAYGRAPH_INJECT_VECIRO) {
|
|
32
|
-
return resolve(process.env.WAYGRAPH_INJECT_VECIRO);
|
|
33
|
-
}
|
|
34
|
-
for (const c of [
|
|
35
|
-
join(homedir(), "Desktop", "Work", "veciro-waygraph"),
|
|
36
|
-
join(homedir(), "Desktop", "Projects", "veciro-waygraph"),
|
|
37
|
-
]) {
|
|
38
|
-
if (existsSync(c))
|
|
39
|
-
return c;
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Resolve one `--inject` token to an absolute directory (preset name or path).
|
|
46
|
-
*/
|
|
47
|
-
export function resolveInjectRoot(token, cwd = process.cwd()) {
|
|
48
|
-
const raw = token.trim();
|
|
49
|
-
if (!raw)
|
|
50
|
-
throw new Error("waygraph inject: empty --inject value");
|
|
51
|
-
const preset = PRESETS[raw.toLowerCase()];
|
|
52
|
-
if (preset) {
|
|
53
|
-
const dir = preset();
|
|
54
|
-
if (!dir || !existsSync(dir)) {
|
|
55
|
-
throw new Error(`waygraph inject: preset "${raw}" not found on disk (pass an absolute path to the Block library root)`);
|
|
56
|
-
}
|
|
57
|
-
return resolve(dir);
|
|
58
|
-
}
|
|
59
|
-
const abs = resolve(cwd, raw);
|
|
60
|
-
if (!existsSync(abs)) {
|
|
61
|
-
throw new Error(`waygraph inject: no such directory: ${abs}`);
|
|
62
|
-
}
|
|
63
|
-
return abs;
|
|
64
|
-
}
|
|
65
|
-
export function resolveInjectRoots(tokens, cwd = process.cwd()) {
|
|
66
|
-
const seen = new Set();
|
|
67
|
-
const out = [];
|
|
68
|
-
for (const t of tokens) {
|
|
69
|
-
const abs = resolveInjectRoot(t, cwd);
|
|
70
|
-
if (seen.has(abs))
|
|
71
|
-
continue;
|
|
72
|
-
seen.add(abs);
|
|
73
|
-
out.push(abs);
|
|
74
|
-
}
|
|
75
|
-
return out;
|
|
76
|
-
}
|
|
77
|
-
/** Roots to scan: host project first, then each inject path (deduped). */
|
|
78
|
-
export function exploreRoots(projectDir, inject) {
|
|
79
|
-
const host = resolve(projectDir);
|
|
80
|
-
const extra = inject ?? [];
|
|
81
|
-
const seen = new Set([host]);
|
|
82
|
-
const roots = [host];
|
|
83
|
-
for (const r of extra) {
|
|
84
|
-
const abs = resolve(r);
|
|
85
|
-
if (seen.has(abs))
|
|
86
|
-
continue;
|
|
87
|
-
seen.add(abs);
|
|
88
|
-
roots.push(abs);
|
|
89
|
-
}
|
|
90
|
-
return roots;
|
|
91
|
-
}
|
package/dist/browser.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { AutoSessionInit } from "./auto-session.js";
|
|
2
|
-
export interface BrowserStartInit extends AutoSessionInit {
|
|
3
|
-
/** Preset names or paths; resolved before spawn. */
|
|
4
|
-
injectTokens?: string[];
|
|
5
|
-
}
|
|
6
|
-
export interface BrowserStartResult {
|
|
7
|
-
sessionId: string;
|
|
8
|
-
socketPath: string;
|
|
9
|
-
headless: boolean;
|
|
10
|
-
/** Resolved inject roots merged into this session (host project excluded). */
|
|
11
|
-
inject: string[];
|
|
12
|
-
}
|
|
13
|
-
/** Always spawns a new detached session — does not stop or reuse existing ones. */
|
|
14
|
-
export declare function browserStart(init: BrowserStartInit): Promise<BrowserStartResult>;
|
|
15
|
-
export { listBrowserSessions, stopBrowserSession, stopAllBrowserSessions, type SessionMeta, } from "./auto-session-ipc.js";
|
package/dist/browser.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `waygraph browser` — persistent Playwright session with the project's Block
|
|
3
|
-
* library loaded (and optional `--inject` roots). Pilot drives these sessions
|
|
4
|
-
* via `browser send|status|highlight|…`; it does not spawn its own browser.
|
|
5
|
-
*
|
|
6
|
-
* Session lifecycle is explicit: `browser sessions` lists what's live;
|
|
7
|
-
* `browser start` always opens another; `browser attach` / `browser stop` pick one up or shut it down.
|
|
8
|
-
*/
|
|
9
|
-
import { spawnDetachedSession } from "./auto-session-ipc.js";
|
|
10
|
-
import { resolveInjectRoots } from "./block-inject.js";
|
|
11
|
-
/** Always spawns a new detached session — does not stop or reuse existing ones. */
|
|
12
|
-
export async function browserStart(init) {
|
|
13
|
-
const inject = init.inject ??
|
|
14
|
-
(init.injectTokens?.length ? resolveInjectRoots(init.injectTokens, init.projectDir) : []);
|
|
15
|
-
const headless = init.headless ?? false;
|
|
16
|
-
const meta = await spawnDetachedSession({
|
|
17
|
-
...init,
|
|
18
|
-
inject,
|
|
19
|
-
headless,
|
|
20
|
-
skipInitialNavigation: init.skipInitialNavigation ?? true,
|
|
21
|
-
});
|
|
22
|
-
return {
|
|
23
|
-
sessionId: meta.sessionId,
|
|
24
|
-
socketPath: meta.socketPath,
|
|
25
|
-
headless: meta.headless,
|
|
26
|
-
inject,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export { listBrowserSessions, stopBrowserSession, stopAllBrowserSessions, } from "./auto-session-ipc.js";
|
package/dist/coverage-gap.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { BlockEntry } from "./auto-explore.js";
|
|
2
|
-
/** Collect selector strings from NavClick blocks and Block/*Sel source files. */
|
|
3
|
-
export declare function collectKnownInteractionSelectors(projectDir: string, library: {
|
|
4
|
-
navBlocks: BlockEntry[];
|
|
5
|
-
}, inject?: string[]): string[];
|
|
6
|
-
export interface UnmappedInteractionPayload {
|
|
7
|
-
knownPathnames: string[];
|
|
8
|
-
knownSelectors: string[];
|
|
9
|
-
}
|
|
10
|
-
/** Page-side: warn once per unmapped same-origin href or visible button. */
|
|
11
|
-
export declare function unmappedInteractionsPageScript(payload: UnmappedInteractionPayload): void;
|