@descryy/mcp 0.11.3 → 0.11.5
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/package.json +20 -20
- package/dist/action-handshake.d.ts +0 -38
- package/dist/action-handshake.d.ts.map +0 -1
- package/dist/action-handshake.js +0 -127
- package/dist/action-handshake.js.map +0 -1
- package/dist/bin/descry-mcp.d.ts +0 -7
- package/dist/bin/descry-mcp.d.ts.map +0 -1
- package/dist/bin/descry-mcp.js +0 -72
- package/dist/bin/descry-mcp.js.map +0 -1
- package/dist/browser/auth.d.ts +0 -84
- package/dist/browser/auth.d.ts.map +0 -1
- package/dist/browser/auth.js +0 -233
- package/dist/browser/auth.js.map +0 -1
- package/dist/browser/capability-probe.d.ts +0 -109
- package/dist/browser/capability-probe.d.ts.map +0 -1
- package/dist/browser/capability-probe.js +0 -201
- package/dist/browser/capability-probe.js.map +0 -1
- package/dist/browser/driver.d.ts +0 -570
- package/dist/browser/driver.d.ts.map +0 -1
- package/dist/browser/driver.js +0 -116
- package/dist/browser/driver.js.map +0 -1
- package/dist/browser/evidence.d.ts +0 -28
- package/dist/browser/evidence.d.ts.map +0 -1
- package/dist/browser/evidence.js +0 -82
- package/dist/browser/evidence.js.map +0 -1
- package/dist/browser/fake-driver.d.ts +0 -116
- package/dist/browser/fake-driver.d.ts.map +0 -1
- package/dist/browser/fake-driver.js +0 -416
- package/dist/browser/fake-driver.js.map +0 -1
- package/dist/browser/fault-attribution.d.ts +0 -178
- package/dist/browser/fault-attribution.d.ts.map +0 -1
- package/dist/browser/fault-attribution.js +0 -266
- package/dist/browser/fault-attribution.js.map +0 -1
- package/dist/browser/graph-write.d.ts +0 -45
- package/dist/browser/graph-write.d.ts.map +0 -1
- package/dist/browser/graph-write.js +0 -103
- package/dist/browser/graph-write.js.map +0 -1
- package/dist/browser/identity-graph-write.d.ts +0 -55
- package/dist/browser/identity-graph-write.d.ts.map +0 -1
- package/dist/browser/identity-graph-write.js +0 -45
- package/dist/browser/identity-graph-write.js.map +0 -1
- package/dist/browser/page-probe.d.ts +0 -81
- package/dist/browser/page-probe.d.ts.map +0 -1
- package/dist/browser/page-probe.js +0 -202
- package/dist/browser/page-probe.js.map +0 -1
- package/dist/browser/playwright-driver.d.ts +0 -114
- package/dist/browser/playwright-driver.d.ts.map +0 -1
- package/dist/browser/playwright-driver.js +0 -1479
- package/dist/browser/playwright-driver.js.map +0 -1
- package/dist/browser/provider.d.ts +0 -26
- package/dist/browser/provider.d.ts.map +0 -1
- package/dist/browser/provider.js +0 -14
- package/dist/browser/provider.js.map +0 -1
- package/dist/browser/reach-recording-session.d.ts +0 -44
- package/dist/browser/reach-recording-session.d.ts.map +0 -1
- package/dist/browser/reach-recording-session.js +0 -143
- package/dist/browser/reach-recording-session.js.map +0 -1
- package/dist/browser/reachability.d.ts +0 -168
- package/dist/browser/reachability.d.ts.map +0 -1
- package/dist/browser/reachability.js +0 -294
- package/dist/browser/reachability.js.map +0 -1
- package/dist/browser/registry.d.ts +0 -126
- package/dist/browser/registry.d.ts.map +0 -1
- package/dist/browser/registry.js +0 -177
- package/dist/browser/registry.js.map +0 -1
- package/dist/browser/scenario-provenance.d.ts +0 -23
- package/dist/browser/scenario-provenance.d.ts.map +0 -1
- package/dist/browser/scenario-provenance.js +0 -73
- package/dist/browser/scenario-provenance.js.map +0 -1
- package/dist/browser/scenario-resolve.d.ts +0 -28
- package/dist/browser/scenario-resolve.d.ts.map +0 -1
- package/dist/browser/scenario-resolve.js +0 -96
- package/dist/browser/scenario-resolve.js.map +0 -1
- package/dist/browser/scenario-runner.d.ts +0 -72
- package/dist/browser/scenario-runner.d.ts.map +0 -1
- package/dist/browser/scenario-runner.js +0 -353
- package/dist/browser/scenario-runner.js.map +0 -1
- package/dist/browser/stack-parser.d.ts +0 -19
- package/dist/browser/stack-parser.d.ts.map +0 -1
- package/dist/browser/stack-parser.js +0 -85
- package/dist/browser/stack-parser.js.map +0 -1
- package/dist/browser/tool-support.d.ts +0 -71
- package/dist/browser/tool-support.d.ts.map +0 -1
- package/dist/browser/tool-support.js +0 -216
- package/dist/browser/tool-support.js.map +0 -1
- package/dist/browser/url-scheme.d.ts +0 -14
- package/dist/browser/url-scheme.d.ts.map +0 -1
- package/dist/browser/url-scheme.js +0 -38
- package/dist/browser/url-scheme.js.map +0 -1
- package/dist/browser/wait-target.d.ts +0 -37
- package/dist/browser/wait-target.d.ts.map +0 -1
- package/dist/browser/wait-target.js +0 -54
- package/dist/browser/wait-target.js.map +0 -1
- package/dist/cancellation.d.ts +0 -20
- package/dist/cancellation.d.ts.map +0 -1
- package/dist/cancellation.js +0 -41
- package/dist/cancellation.js.map +0 -1
- package/dist/capped.d.ts +0 -17
- package/dist/capped.d.ts.map +0 -1
- package/dist/capped.js +0 -15
- package/dist/capped.js.map +0 -1
- package/dist/credential-store.d.ts +0 -22
- package/dist/credential-store.d.ts.map +0 -1
- package/dist/credential-store.js +0 -33
- package/dist/credential-store.js.map +0 -1
- package/dist/disclosure-ledger.d.ts +0 -14
- package/dist/disclosure-ledger.d.ts.map +0 -1
- package/dist/disclosure-ledger.js +0 -18
- package/dist/disclosure-ledger.js.map +0 -1
- package/dist/evidence/observed-route-evidence.d.ts +0 -25
- package/dist/evidence/observed-route-evidence.d.ts.map +0 -1
- package/dist/evidence/observed-route-evidence.js +0 -76
- package/dist/evidence/observed-route-evidence.js.map +0 -1
- package/dist/heap.d.ts +0 -61
- package/dist/heap.d.ts.map +0 -1
- package/dist/heap.js +0 -82
- package/dist/heap.js.map +0 -1
- package/dist/heartbeat.d.ts +0 -46
- package/dist/heartbeat.d.ts.map +0 -1
- package/dist/heartbeat.js +0 -66
- package/dist/heartbeat.js.map +0 -1
- package/dist/index.d.ts +0 -32
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
- package/dist/module-trust.d.ts +0 -37
- package/dist/module-trust.d.ts.map +0 -1
- package/dist/module-trust.js +0 -77
- package/dist/module-trust.js.map +0 -1
- package/dist/path-confinement.d.ts +0 -31
- package/dist/path-confinement.d.ts.map +0 -1
- package/dist/path-confinement.js +0 -44
- package/dist/path-confinement.js.map +0 -1
- package/dist/planner/predict-then-propose.d.ts +0 -134
- package/dist/planner/predict-then-propose.d.ts.map +0 -1
- package/dist/planner/predict-then-propose.js +0 -138
- package/dist/planner/predict-then-propose.js.map +0 -1
- package/dist/planner/propose-journey.d.ts +0 -75
- package/dist/planner/propose-journey.d.ts.map +0 -1
- package/dist/planner/propose-journey.js +0 -96
- package/dist/planner/propose-journey.js.map +0 -1
- package/dist/protocol.d.ts +0 -57
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js +0 -90
- package/dist/protocol.js.map +0 -1
- package/dist/registry.d.ts +0 -103
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -319
- package/dist/registry.js.map +0 -1
- package/dist/render.d.ts +0 -580
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -867
- package/dist/render.js.map +0 -1
- package/dist/runtime-registry.d.ts +0 -22
- package/dist/runtime-registry.d.ts.map +0 -1
- package/dist/runtime-registry.js +0 -142
- package/dist/runtime-registry.js.map +0 -1
- package/dist/sandbox-defaults.d.ts +0 -41
- package/dist/sandbox-defaults.d.ts.map +0 -1
- package/dist/sandbox-defaults.js +0 -14
- package/dist/sandbox-defaults.js.map +0 -1
- package/dist/scenarios/browser-run-plan-projection.d.ts +0 -161
- package/dist/scenarios/browser-run-plan-projection.d.ts.map +0 -1
- package/dist/scenarios/browser-run-plan-projection.js +0 -264
- package/dist/scenarios/browser-run-plan-projection.js.map +0 -1
- package/dist/scenarios/credential-ref.d.ts +0 -102
- package/dist/scenarios/credential-ref.d.ts.map +0 -1
- package/dist/scenarios/credential-ref.js +0 -148
- package/dist/scenarios/credential-ref.js.map +0 -1
- package/dist/scenarios/index.d.ts +0 -7
- package/dist/scenarios/index.d.ts.map +0 -1
- package/dist/scenarios/index.js +0 -7
- package/dist/scenarios/index.js.map +0 -1
- package/dist/scenarios/parse.d.ts +0 -18
- package/dist/scenarios/parse.d.ts.map +0 -1
- package/dist/scenarios/parse.js +0 -212
- package/dist/scenarios/parse.js.map +0 -1
- package/dist/scenarios/scenario.d.ts +0 -93
- package/dist/scenarios/scenario.d.ts.map +0 -1
- package/dist/scenarios/scenario.js +0 -27
- package/dist/scenarios/scenario.js.map +0 -1
- package/dist/scenarios/secret-ref.d.ts +0 -86
- package/dist/scenarios/secret-ref.d.ts.map +0 -1
- package/dist/scenarios/secret-ref.js +0 -125
- package/dist/scenarios/secret-ref.js.map +0 -1
- package/dist/scenarios/storage.d.ts +0 -21
- package/dist/scenarios/storage.d.ts.map +0 -1
- package/dist/scenarios/storage.js +0 -103
- package/dist/scenarios/storage.js.map +0 -1
- package/dist/server.d.ts +0 -61
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -541
- package/dist/server.js.map +0 -1
- package/dist/session.d.ts +0 -243
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -602
- package/dist/session.js.map +0 -1
- package/dist/tools/alias-kit.d.ts +0 -29
- package/dist/tools/alias-kit.d.ts.map +0 -1
- package/dist/tools/alias-kit.js +0 -21
- package/dist/tools/alias-kit.js.map +0 -1
- package/dist/tools/aliases.d.ts +0 -42
- package/dist/tools/aliases.d.ts.map +0 -1
- package/dist/tools/aliases.js +0 -52
- package/dist/tools/aliases.js.map +0 -1
- package/dist/tools/analyze-workspace.d.ts +0 -52
- package/dist/tools/analyze-workspace.d.ts.map +0 -1
- package/dist/tools/analyze-workspace.js +0 -207
- package/dist/tools/analyze-workspace.js.map +0 -1
- package/dist/tools/analyze.d.ts +0 -163
- package/dist/tools/analyze.d.ts.map +0 -1
- package/dist/tools/analyze.js +0 -724
- package/dist/tools/analyze.js.map +0 -1
- package/dist/tools/browser-click.d.ts +0 -18
- package/dist/tools/browser-click.d.ts.map +0 -1
- package/dist/tools/browser-click.js +0 -110
- package/dist/tools/browser-click.js.map +0 -1
- package/dist/tools/browser-close-session.d.ts +0 -39
- package/dist/tools/browser-close-session.d.ts.map +0 -1
- package/dist/tools/browser-close-session.js +0 -120
- package/dist/tools/browser-close-session.js.map +0 -1
- package/dist/tools/browser-fill.d.ts +0 -18
- package/dist/tools/browser-fill.d.ts.map +0 -1
- package/dist/tools/browser-fill.js +0 -117
- package/dist/tools/browser-fill.js.map +0 -1
- package/dist/tools/browser-navigate.d.ts +0 -15
- package/dist/tools/browser-navigate.d.ts.map +0 -1
- package/dist/tools/browser-navigate.js +0 -104
- package/dist/tools/browser-navigate.js.map +0 -1
- package/dist/tools/browser-read.d.ts +0 -33
- package/dist/tools/browser-read.d.ts.map +0 -1
- package/dist/tools/browser-read.js +0 -113
- package/dist/tools/browser-read.js.map +0 -1
- package/dist/tools/browser-run-scenario.d.ts +0 -28
- package/dist/tools/browser-run-scenario.d.ts.map +0 -1
- package/dist/tools/browser-run-scenario.js +0 -206
- package/dist/tools/browser-run-scenario.js.map +0 -1
- package/dist/tools/browser-save-scenario.d.ts +0 -19
- package/dist/tools/browser-save-scenario.d.ts.map +0 -1
- package/dist/tools/browser-save-scenario.js +0 -447
- package/dist/tools/browser-save-scenario.js.map +0 -1
- package/dist/tools/browser-select.d.ts +0 -20
- package/dist/tools/browser-select.d.ts.map +0 -1
- package/dist/tools/browser-select.js +0 -120
- package/dist/tools/browser-select.js.map +0 -1
- package/dist/tools/browser-snapshot.d.ts +0 -46
- package/dist/tools/browser-snapshot.d.ts.map +0 -1
- package/dist/tools/browser-snapshot.js +0 -127
- package/dist/tools/browser-snapshot.js.map +0 -1
- package/dist/tools/browser-start-session.d.ts +0 -24
- package/dist/tools/browser-start-session.d.ts.map +0 -1
- package/dist/tools/browser-start-session.js +0 -622
- package/dist/tools/browser-start-session.js.map +0 -1
- package/dist/tools/browser-submit.d.ts +0 -18
- package/dist/tools/browser-submit.d.ts.map +0 -1
- package/dist/tools/browser-submit.js +0 -106
- package/dist/tools/browser-submit.js.map +0 -1
- package/dist/tools/browser-type.d.ts +0 -18
- package/dist/tools/browser-type.d.ts.map +0 -1
- package/dist/tools/browser-type.js +0 -115
- package/dist/tools/browser-type.js.map +0 -1
- package/dist/tools/browser-wait-for.d.ts +0 -45
- package/dist/tools/browser-wait-for.d.ts.map +0 -1
- package/dist/tools/browser-wait-for.js +0 -150
- package/dist/tools/browser-wait-for.js.map +0 -1
- package/dist/tools/browser.d.ts +0 -69
- package/dist/tools/browser.d.ts.map +0 -1
- package/dist/tools/browser.js +0 -386
- package/dist/tools/browser.js.map +0 -1
- package/dist/tools/chain.d.ts +0 -41
- package/dist/tools/chain.d.ts.map +0 -1
- package/dist/tools/chain.js +0 -105
- package/dist/tools/chain.js.map +0 -1
- package/dist/tools/change-scope.d.ts +0 -25
- package/dist/tools/change-scope.d.ts.map +0 -1
- package/dist/tools/change-scope.js +0 -110
- package/dist/tools/change-scope.js.map +0 -1
- package/dist/tools/code-context.d.ts +0 -83
- package/dist/tools/code-context.d.ts.map +0 -1
- package/dist/tools/code-context.js +0 -416
- package/dist/tools/code-context.js.map +0 -1
- package/dist/tools/contracts.d.ts +0 -74
- package/dist/tools/contracts.d.ts.map +0 -1
- package/dist/tools/contracts.js +0 -196
- package/dist/tools/contracts.js.map +0 -1
- package/dist/tools/cross-pr.d.ts +0 -178
- package/dist/tools/cross-pr.d.ts.map +0 -1
- package/dist/tools/cross-pr.js +0 -321
- package/dist/tools/cross-pr.js.map +0 -1
- package/dist/tools/disclosure.d.ts +0 -75
- package/dist/tools/disclosure.d.ts.map +0 -1
- package/dist/tools/disclosure.js +0 -288
- package/dist/tools/disclosure.js.map +0 -1
- package/dist/tools/draw-conclusion.d.ts +0 -55
- package/dist/tools/draw-conclusion.d.ts.map +0 -1
- package/dist/tools/draw-conclusion.js +0 -259
- package/dist/tools/draw-conclusion.js.map +0 -1
- package/dist/tools/git-context.d.ts +0 -39
- package/dist/tools/git-context.d.ts.map +0 -1
- package/dist/tools/git-context.js +0 -364
- package/dist/tools/git-context.js.map +0 -1
- package/dist/tools/git-diff.d.ts +0 -45
- package/dist/tools/git-diff.d.ts.map +0 -1
- package/dist/tools/git-diff.js +0 -338
- package/dist/tools/git-diff.js.map +0 -1
- package/dist/tools/git-history.d.ts +0 -16
- package/dist/tools/git-history.d.ts.map +0 -1
- package/dist/tools/git-history.js +0 -86
- package/dist/tools/git-history.js.map +0 -1
- package/dist/tools/history.d.ts +0 -34
- package/dist/tools/history.d.ts.map +0 -1
- package/dist/tools/history.js +0 -121
- package/dist/tools/history.js.map +0 -1
- package/dist/tools/impact.d.ts +0 -46
- package/dist/tools/impact.d.ts.map +0 -1
- package/dist/tools/impact.js +0 -225
- package/dist/tools/impact.js.map +0 -1
- package/dist/tools/index.d.ts +0 -59
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -70
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/kit.d.ts +0 -165
- package/dist/tools/kit.d.ts.map +0 -1
- package/dist/tools/kit.js +0 -153
- package/dist/tools/kit.js.map +0 -1
- package/dist/tools/link-workspace.d.ts +0 -24
- package/dist/tools/link-workspace.d.ts.map +0 -1
- package/dist/tools/link-workspace.js +0 -131
- package/dist/tools/link-workspace.js.map +0 -1
- package/dist/tools/lookup.d.ts +0 -19
- package/dist/tools/lookup.d.ts.map +0 -1
- package/dist/tools/lookup.js +0 -63
- package/dist/tools/lookup.js.map +0 -1
- package/dist/tools/mark-incident.d.ts +0 -28
- package/dist/tools/mark-incident.d.ts.map +0 -1
- package/dist/tools/mark-incident.js +0 -188
- package/dist/tools/mark-incident.js.map +0 -1
- package/dist/tools/merged-browser.d.ts +0 -11
- package/dist/tools/merged-browser.d.ts.map +0 -1
- package/dist/tools/merged-browser.js +0 -20
- package/dist/tools/merged-browser.js.map +0 -1
- package/dist/tools/merged-context.d.ts +0 -11
- package/dist/tools/merged-context.d.ts.map +0 -1
- package/dist/tools/merged-context.js +0 -21
- package/dist/tools/merged-context.js.map +0 -1
- package/dist/tools/merged-observe.d.ts +0 -13
- package/dist/tools/merged-observe.d.ts.map +0 -1
- package/dist/tools/merged-observe.js +0 -21
- package/dist/tools/merged-observe.js.map +0 -1
- package/dist/tools/merged-workspace.d.ts +0 -14
- package/dist/tools/merged-workspace.d.ts.map +0 -1
- package/dist/tools/merged-workspace.js +0 -21
- package/dist/tools/merged-workspace.js.map +0 -1
- package/dist/tools/observe-runtime.d.ts +0 -250
- package/dist/tools/observe-runtime.d.ts.map +0 -1
- package/dist/tools/observe-runtime.js +0 -1753
- package/dist/tools/observe-runtime.js.map +0 -1
- package/dist/tools/observe-tests.d.ts +0 -57
- package/dist/tools/observe-tests.d.ts.map +0 -1
- package/dist/tools/observe-tests.js +0 -368
- package/dist/tools/observe-tests.js.map +0 -1
- package/dist/tools/observe.d.ts +0 -28
- package/dist/tools/observe.d.ts.map +0 -1
- package/dist/tools/observe.js +0 -330
- package/dist/tools/observe.js.map +0 -1
- package/dist/tools/pr-analysis.d.ts +0 -189
- package/dist/tools/pr-analysis.d.ts.map +0 -1
- package/dist/tools/pr-analysis.js +0 -299
- package/dist/tools/pr-analysis.js.map +0 -1
- package/dist/tools/pre-push.d.ts +0 -168
- package/dist/tools/pre-push.d.ts.map +0 -1
- package/dist/tools/pre-push.js +0 -416
- package/dist/tools/pre-push.js.map +0 -1
- package/dist/tools/predict-reach.d.ts +0 -57
- package/dist/tools/predict-reach.d.ts.map +0 -1
- package/dist/tools/predict-reach.js +0 -159
- package/dist/tools/predict-reach.js.map +0 -1
- package/dist/tools/propagation.d.ts +0 -37
- package/dist/tools/propagation.d.ts.map +0 -1
- package/dist/tools/propagation.js +0 -162
- package/dist/tools/propagation.js.map +0 -1
- package/dist/tools/propose-journey.d.ts +0 -16
- package/dist/tools/propose-journey.d.ts.map +0 -1
- package/dist/tools/propose-journey.js +0 -121
- package/dist/tools/propose-journey.js.map +0 -1
- package/dist/tools/prove-reach.d.ts +0 -74
- package/dist/tools/prove-reach.d.ts.map +0 -1
- package/dist/tools/prove-reach.js +0 -286
- package/dist/tools/prove-reach.js.map +0 -1
- package/dist/tools/questions.d.ts +0 -30
- package/dist/tools/questions.d.ts.map +0 -1
- package/dist/tools/questions.js +0 -232
- package/dist/tools/questions.js.map +0 -1
- package/dist/tools/refusal-fetch.d.ts +0 -35
- package/dist/tools/refusal-fetch.d.ts.map +0 -1
- package/dist/tools/refusal-fetch.js +0 -103
- package/dist/tools/refusal-fetch.js.map +0 -1
- package/dist/tools/runtime-incident.d.ts +0 -33
- package/dist/tools/runtime-incident.d.ts.map +0 -1
- package/dist/tools/runtime-incident.js +0 -67
- package/dist/tools/runtime-incident.js.map +0 -1
- package/dist/tools/runtime-journey-drive.d.ts +0 -102
- package/dist/tools/runtime-journey-drive.d.ts.map +0 -1
- package/dist/tools/runtime-journey-drive.js +0 -247
- package/dist/tools/runtime-journey-drive.js.map +0 -1
- package/dist/tools/scope.d.ts +0 -45
- package/dist/tools/scope.d.ts.map +0 -1
- package/dist/tools/scope.js +0 -186
- package/dist/tools/scope.js.map +0 -1
- package/dist/tools/similar-incidents.d.ts +0 -43
- package/dist/tools/similar-incidents.d.ts.map +0 -1
- package/dist/tools/similar-incidents.js +0 -179
- package/dist/tools/similar-incidents.js.map +0 -1
- package/dist/tools/validate.d.ts +0 -133
- package/dist/tools/validate.d.ts.map +0 -1
- package/dist/tools/validate.js +0 -442
- package/dist/tools/validate.js.map +0 -1
- package/dist/tools/verb.d.ts +0 -46
- package/dist/tools/verb.d.ts.map +0 -1
- package/dist/tools/verb.js +0 -78
- package/dist/tools/verb.js.map +0 -1
- package/dist/tools/verification-status.d.ts +0 -38
- package/dist/tools/verification-status.d.ts.map +0 -1
- package/dist/tools/verification-status.js +0 -203
- package/dist/tools/verification-status.js.map +0 -1
- package/dist/tools/verify-claim.d.ts +0 -29
- package/dist/tools/verify-claim.d.ts.map +0 -1
- package/dist/tools/verify-claim.js +0 -220
- package/dist/tools/verify-claim.js.map +0 -1
- package/dist/tools/workspace.d.ts +0 -28
- package/dist/tools/workspace.d.ts.map +0 -1
- package/dist/tools/workspace.js +0 -101
- package/dist/tools/workspace.js.map +0 -1
- package/dist/transport.d.ts +0 -32
- package/dist/transport.d.ts.map +0 -1
- package/dist/transport.js +0 -85
- package/dist/transport.js.map +0 -1
- package/dist/workspace-index.d.ts +0 -164
- package/dist/workspace-index.d.ts.map +0 -1
- package/dist/workspace-index.js +0 -381
- package/dist/workspace-index.js.map +0 -1
package/dist/scenarios/parse.js
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reading a stored scenario — validation, and the refusals that are the
|
|
3
|
-
* point. Refuses rather than repairs: coercing a missing field to a default
|
|
4
|
-
* would let a scenario keep loading after it stopped describing the app, silently, in CI where nobody's watching. Problems collect in one pass, not one throw at a time.
|
|
5
|
-
*/
|
|
6
|
-
import { readSecretRef } from "./secret-ref.js";
|
|
7
|
-
import { readCredentialRef } from "./credential-ref.js";
|
|
8
|
-
import { MIN_READABLE_SCHEMA_VERSION, SCENARIO_SCHEMA_VERSION, } from "./scenario.js";
|
|
9
|
-
const ACTIONS = ["navigate", "click", "type", "fill", "select", "submit"];
|
|
10
|
-
const ASSERTION_KINDS = [
|
|
11
|
-
"elementVisible",
|
|
12
|
-
"textEquals",
|
|
13
|
-
"urlEquals",
|
|
14
|
-
"noConsoleErrors",
|
|
15
|
-
"noFailedRequests",
|
|
16
|
-
];
|
|
17
|
-
/** Actions that act on an element, and therefore require a target. `navigate` acts on the page. */
|
|
18
|
-
const ELEMENT_ACTIONS = ["click", "type", "fill", "select", "submit"];
|
|
19
|
-
/** Actions that carry a value in `text`, and therefore require one. `select` is here because the
|
|
20
|
-
* option it chooses is the same kind of stored string as typed text — see `ScenarioStep.text`.
|
|
21
|
-
* `submit` is not: it acts on a form through the form's own submit control and names nothing. */
|
|
22
|
-
const TEXT_ACTIONS = ["type", "fill", "select"];
|
|
23
|
-
function isRecord(value) {
|
|
24
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25
|
-
}
|
|
26
|
-
function readTarget(raw, where, problems) {
|
|
27
|
-
if (raw === null || raw === undefined)
|
|
28
|
-
return null;
|
|
29
|
-
if (!isRecord(raw)) {
|
|
30
|
-
problems.push(`${where}: target must be an object with role, name and selector`);
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
// All three, named individually: a descriptor missing one would fall back
|
|
34
|
-
// to the others to resolve, and a fallback chain substitutes quietly.
|
|
35
|
-
const missing = ["role", "name", "selector"].filter((field) => typeof raw[field] !== "string");
|
|
36
|
-
if (missing.length > 0) {
|
|
37
|
-
problems.push(`${where}: target is missing ${missing.join(", ")} — all three of role, name and selector are required together`);
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return { role: raw["role"], name: raw["name"], selector: raw["selector"] };
|
|
41
|
-
}
|
|
42
|
-
function readStep(raw, index, problems) {
|
|
43
|
-
const where = `step ${index}`;
|
|
44
|
-
if (!isRecord(raw)) {
|
|
45
|
-
problems.push(`${where}: not an object`);
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
// Ref refusal, enforced not documented: a stored ref is scoped to a
|
|
49
|
-
// snapshot that no longer exists, so a scenario carrying one is already
|
|
50
|
-
// broken — it just wouldn't say so until replay resolved it to nothing.
|
|
51
|
-
if ("ref" in raw) {
|
|
52
|
-
problems.push(`${where}: carries a ref, which cannot be stored — a ref is scoped to the snapshot that issued it and means nothing in a later session. Store role, name and selector instead.`);
|
|
53
|
-
}
|
|
54
|
-
const action = raw["action"];
|
|
55
|
-
if (typeof action !== "string" || !ACTIONS.includes(action)) {
|
|
56
|
-
problems.push(`${where}: action must be one of ${ACTIONS.join(", ")}`);
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
const kind = action;
|
|
60
|
-
const target = readTarget(raw["target"], where, problems);
|
|
61
|
-
if (ELEMENT_ACTIONS.includes(kind) && target === null) {
|
|
62
|
-
problems.push(`${where}: ${kind} acts on an element and needs a target to resolve`);
|
|
63
|
-
}
|
|
64
|
-
if (!ELEMENT_ACTIONS.includes(kind) && target !== null) {
|
|
65
|
-
problems.push(`${where}: ${kind} acts on the page, not on an element, so it must not carry a target`);
|
|
66
|
-
}
|
|
67
|
-
const url = raw["url"] ?? null;
|
|
68
|
-
if (kind === "navigate" && typeof url !== "string") {
|
|
69
|
-
problems.push(`${where}: navigate needs a url`);
|
|
70
|
-
}
|
|
71
|
-
if (kind !== "navigate" && url !== null) {
|
|
72
|
-
problems.push(`${where}: only navigate carries a url`);
|
|
73
|
-
}
|
|
74
|
-
const text = raw["text"] ?? null;
|
|
75
|
-
if (TEXT_ACTIONS.includes(kind) && typeof text !== "string") {
|
|
76
|
-
problems.push(kind === "select"
|
|
77
|
-
? `${where}: select chooses an option and needs its value stored in text`
|
|
78
|
-
: `${where}: ${kind} enters text and needs it stored`);
|
|
79
|
-
}
|
|
80
|
-
if (!TEXT_ACTIONS.includes(kind) && text !== null) {
|
|
81
|
-
problems.push(`${where}: only ${TEXT_ACTIONS.join(", ")} carry text`);
|
|
82
|
-
}
|
|
83
|
-
// A secret or credential reference with a typo in it is refused here rather than at replay.
|
|
84
|
-
// Stored text is typed verbatim, so `${ENV:PASSWORD}` or `${credential:NAME }` would reach the
|
|
85
|
-
// login form as those characters and the page's rejection of them would be reported as the
|
|
86
|
-
// application's defect. `credential:` is checked first — a well-formed credential reference
|
|
87
|
-
// (`credential-ref.ts`, RG-1(4) / lane "delivery") must never be flagged malformed by a
|
|
88
|
-
// validator that only knew the `env:` scheme when it was written; `readSecretRef`'s own
|
|
89
|
-
// `LOOKS_LIKE_REFERENCE` matches any `${...}` shape generically, so without this check first,
|
|
90
|
-
// every valid `${credential:NAME}` step failed here before a scenario could ever be read.
|
|
91
|
-
if (typeof text === "string") {
|
|
92
|
-
const credentialRef = readCredentialRef(text);
|
|
93
|
-
if (credentialRef.kind === "malformed") {
|
|
94
|
-
problems.push(`${where}: ${credentialRef.message}`);
|
|
95
|
-
}
|
|
96
|
-
else if (credentialRef.kind === "literal") {
|
|
97
|
-
const ref = readSecretRef(text);
|
|
98
|
-
if (ref.kind === "malformed")
|
|
99
|
-
problems.push(`${where}: ${ref.message}`);
|
|
100
|
-
}
|
|
101
|
-
// credentialRef.kind === "ref": a well-formed ${credential:NAME}, nothing to flag.
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
action: kind,
|
|
105
|
-
target,
|
|
106
|
-
url: typeof url === "string" ? url : null,
|
|
107
|
-
text: typeof text === "string" ? text : null,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function readAssertion(raw, index, stepCount, problems) {
|
|
111
|
-
const where = `assertion ${index}`;
|
|
112
|
-
if (!isRecord(raw)) {
|
|
113
|
-
problems.push(`${where}: not an object`);
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
const kind = raw["kind"];
|
|
117
|
-
if (typeof kind !== "string" || !ASSERTION_KINDS.includes(kind)) {
|
|
118
|
-
problems.push(`${where}: kind must be one of ${ASSERTION_KINDS.join(", ")}`);
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
const afterStep = raw["afterStep"] ?? null;
|
|
122
|
-
if (afterStep !== null) {
|
|
123
|
-
// An assertion anchored past the end would never run and never say so —
|
|
124
|
-
// the same false negative the assertions field exists to prevent.
|
|
125
|
-
if (typeof afterStep !== "number" || !Number.isInteger(afterStep) || afterStep < 0 || afterStep >= stepCount) {
|
|
126
|
-
problems.push(`${where}: afterStep must be null (end of scenario) or the index of a real step (0..${stepCount - 1}), got ${String(afterStep)}`);
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
kind: kind,
|
|
132
|
-
afterStep: afterStep === null ? null : afterStep,
|
|
133
|
-
target: readTarget(raw["target"], where, problems),
|
|
134
|
-
expected: typeof raw["expected"] === "string" ? raw["expected"] : null,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
/** Validates an already-decoded value as a scenario. Version check runs first and short-circuits — reporting field problems against an unsupported schema would be noise about a shape never meant to satisfy it. */
|
|
138
|
-
export function parseScenario(raw) {
|
|
139
|
-
const problems = [];
|
|
140
|
-
if (!isRecord(raw))
|
|
141
|
-
return { valid: false, problems: ["not an object"] };
|
|
142
|
-
const schemaVersion = raw["schemaVersion"];
|
|
143
|
-
if (typeof schemaVersion !== "number" || !Number.isInteger(schemaVersion)) {
|
|
144
|
-
problems.push(`schemaVersion is required and must be an integer (this reader understands ${SCENARIO_SCHEMA_VERSION})`);
|
|
145
|
-
return { valid: false, problems };
|
|
146
|
-
}
|
|
147
|
-
if (schemaVersion > SCENARIO_SCHEMA_VERSION) {
|
|
148
|
-
// Refused by number, never parsed optimistically — best-effort parsing a future schema would silently ignore a field added because it mattered.
|
|
149
|
-
return {
|
|
150
|
-
valid: false,
|
|
151
|
-
problems: [
|
|
152
|
-
`schemaVersion ${schemaVersion} is newer than this reader understands (${SCENARIO_SCHEMA_VERSION}). Upgrade Descry rather than editing the file.`,
|
|
153
|
-
],
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if (schemaVersion < MIN_READABLE_SCHEMA_VERSION) {
|
|
157
|
-
return {
|
|
158
|
-
valid: false,
|
|
159
|
-
problems: [
|
|
160
|
-
`schemaVersion ${schemaVersion} is older than ${MIN_READABLE_SCHEMA_VERSION}, the oldest this reader still accepts, and no migration exists — re-save the scenario.`,
|
|
161
|
-
],
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
// Between MIN_READABLE and current: read as-is. Version 1 is a strict subset of 2 — every
|
|
165
|
-
// field means what it meant — so the migration is the identity and a scenario saved before the
|
|
166
|
-
// `select`/`submit` verbs and the secret reference existed keeps replaying untouched. The
|
|
167
|
-
// stored number is kept rather than rewritten to the current one: it is provenance for which
|
|
168
|
-
// reader wrote the file, and a re-save is what updates it.
|
|
169
|
-
for (const field of ["name", "targetUrl", "savedAt", "savedAtCommit"]) {
|
|
170
|
-
if (typeof raw[field] !== "string")
|
|
171
|
-
problems.push(`${field} is required`);
|
|
172
|
-
}
|
|
173
|
-
const description = raw["description"];
|
|
174
|
-
if (description !== null && description !== undefined && typeof description !== "string") {
|
|
175
|
-
problems.push("description must be a string or null");
|
|
176
|
-
}
|
|
177
|
-
const rawSteps = raw["steps"];
|
|
178
|
-
if (!Array.isArray(rawSteps) || rawSteps.length === 0) {
|
|
179
|
-
problems.push("steps is required and must hold at least one step");
|
|
180
|
-
}
|
|
181
|
-
const steps = Array.isArray(rawSteps) ? rawSteps.map((step, i) => readStep(step, i, problems)) : [];
|
|
182
|
-
// Required, may be empty — absent is a different statement than empty.
|
|
183
|
-
// Empty says "checks nothing" (honest); absent would let a pre-field
|
|
184
|
-
// scenario read as if it had been considered.
|
|
185
|
-
const rawAssertions = raw["assertions"];
|
|
186
|
-
if (!Array.isArray(rawAssertions)) {
|
|
187
|
-
problems.push("assertions is required — use [] for a scenario that asserts nothing, which replays as unverified rather than passed");
|
|
188
|
-
}
|
|
189
|
-
const assertions = Array.isArray(rawAssertions)
|
|
190
|
-
? rawAssertions.map((a, i) => readAssertion(a, i, Array.isArray(rawSteps) ? rawSteps.length : 0, problems))
|
|
191
|
-
: [];
|
|
192
|
-
if (problems.length > 0)
|
|
193
|
-
return { valid: false, problems };
|
|
194
|
-
return {
|
|
195
|
-
valid: true,
|
|
196
|
-
scenario: {
|
|
197
|
-
schemaVersion,
|
|
198
|
-
name: raw["name"],
|
|
199
|
-
description: typeof description === "string" ? description : null,
|
|
200
|
-
targetUrl: raw["targetUrl"],
|
|
201
|
-
savedAt: raw["savedAt"],
|
|
202
|
-
savedAtCommit: raw["savedAtCommit"],
|
|
203
|
-
steps: steps.filter((s) => s !== null),
|
|
204
|
-
assertions: assertions.filter((a) => a !== null),
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
/** Newline-terminated and two-space indented, so a saved scenario reads as a reviewable diff rather than one long line. */
|
|
209
|
-
export function serializeScenario(scenario) {
|
|
210
|
-
return `${JSON.stringify(scenario, null, 2)}\n`;
|
|
211
|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AE,QAAQ,EAAE,CAAC;IAE3D,OAAO;QACL,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE;YACR,aAAa;YACb,IAAI,EAAE,GAAG,CAAC,MAAM,CAAW;YAC3B,WAAW,EAAE,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;YACjE,SAAS,EAAE,GAAG,CAAC,WAAW,CAAW;YACrC,OAAO,EAAE,GAAG,CAAC,SAAS,CAAW;YACjC,aAAa,EAAE,GAAG,CAAC,eAAe,CAAW;YAC7C,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAqB,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC;YACzD,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAA0B,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC;SACzE;KACF,CAAC;AACJ,CAAC;AAED,2HAA2H;AAC3H,MAAM,UAAU,iBAAiB,CAAC,QAAkB;IAClD,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a saved scenario is (DEC-383's schema half). No browser import — replayability
|
|
3
|
-
* is the runner's separate question. A step stores a `TargetDescriptor`, never a `ref`
|
|
4
|
-
* (refs are snapshot-scoped, stale by replay). All 3 descriptor fields are required
|
|
5
|
-
* together — a fallback chain would quietly substitute a match instead of disagreeing. */
|
|
6
|
-
/** Bumped when a stored scenario's shape changes. An integer, never semver: one repository, one reader, nothing to argue about.
|
|
7
|
-
*
|
|
8
|
-
* 2 adds the `select` and `submit` verbs and the `${env:VAR}` secret reference. The bump is
|
|
9
|
-
* about the *reference*, not the verbs: an older reader meeting an unknown verb already refuses
|
|
10
|
-
* it by name, but an older reader meeting `${env:PASSWORD}` in a `text` field would type that
|
|
11
|
-
* literal string into a login form and report the resulting failure as the application's. Rule
|
|
12
|
-
* 7 forbids that, so the version gate is what stops it — a version 2 file is refused whole by a
|
|
13
|
-
* version 1 reader, with a message that says to upgrade. */
|
|
14
|
-
export declare const SCENARIO_SCHEMA_VERSION = 2;
|
|
15
|
-
/** The oldest stored version this reader still accepts. Version 1 is a strict subset of 2 —
|
|
16
|
-
* every field means what it meant, so the migration is the identity and a scenario saved before
|
|
17
|
-
* this change keeps replaying untouched. Read in the other direction from
|
|
18
|
-
* `SCENARIO_SCHEMA_VERSION`: that one stops a new file being misread by an old reader, this one
|
|
19
|
-
* stops an old file being refused by a new one for no reason. */
|
|
20
|
-
export declare const MIN_READABLE_SCHEMA_VERSION = 1;
|
|
21
|
-
/** How a step names its element. Re-resolved at replay against a fresh snapshot,
|
|
22
|
-
* must match exactly one — zero/ambiguous/partial each refuse, naming what disagreed. */
|
|
23
|
-
export interface TargetDescriptor {
|
|
24
|
-
readonly role: string;
|
|
25
|
-
readonly name: string;
|
|
26
|
-
readonly selector: string;
|
|
27
|
-
}
|
|
28
|
-
/** Mirrors the port's `BrowserActionKind`, restated rather than imported: the format must be
|
|
29
|
-
* readable without a browser in the process. `waitFor` is absent from both for the same reason —
|
|
30
|
-
* it performs nothing. */
|
|
31
|
-
export type ScenarioActionKind = "navigate" | "click" | "type" | "fill" | "select" | "submit";
|
|
32
|
-
export interface ScenarioStep {
|
|
33
|
-
readonly action: ScenarioActionKind;
|
|
34
|
-
/** The element to act on. Null for `navigate`, which acts on the page — and required for everything else, because a step with nothing to resolve cannot be replayed. */
|
|
35
|
-
readonly target: TargetDescriptor | null;
|
|
36
|
-
/** Where to go. Present for `navigate` alone. */
|
|
37
|
-
readonly url: string | null;
|
|
38
|
-
/** What to enter, or for `select` which option to choose. Present for `type`, `fill` and
|
|
39
|
-
* `select` alone — `submit` acts on a form through its own submit control and carries nothing,
|
|
40
|
-
* and `navigate` acts on the page.
|
|
41
|
-
*
|
|
42
|
-
* `type` appends, `fill` replaces — the runtime's two text verbs, kept distinct here because
|
|
43
|
-
* the stored artifact must say which one a replay should perform.
|
|
44
|
-
*
|
|
45
|
-
* For `select` this is the option's **stored value**, not the label a person reads. Three
|
|
46
|
-
* reasons, in order of weight. (1) The driver already records `matched.value` in
|
|
47
|
-
* `PerformedStep`, so a scenario storing the label could never match its own session's
|
|
48
|
-
* provenance record and every saved `select` would fall back to a later snapshot check.
|
|
49
|
-
* (2) A label changes when copy changes — a rewording, a translation — and a scenario that
|
|
50
|
-
* breaks on a rewording is a scenario a team turns off. A value changes when the backend's
|
|
51
|
-
* option set changes, and a scenario breaking *then* is the scenario doing its job. (3) The
|
|
52
|
-
* replay verb matches by value first and label second, exactly as the live verb does, so a
|
|
53
|
-
* stored value that has since become a label still resolves rather than refusing. That
|
|
54
|
-
* fallback is inside the option matcher and is not the descriptor fallback rule 2 forbids: it
|
|
55
|
-
* never substitutes a *different* element, only recognises the same option named the other way.
|
|
56
|
-
*
|
|
57
|
-
* May carry a secret reference — `${env:VAR}` — instead of a literal. See `secret-ref.ts`. */
|
|
58
|
-
readonly text: string | null;
|
|
59
|
-
}
|
|
60
|
-
/** What the scenario claims. Kept small, derived only from what a snapshot/run
|
|
61
|
-
* can observe — an assertion the runner can't evaluate is a promise it can't keep.
|
|
62
|
-
* DEC-384: an *observed* console error/failed request doesn't block; an *asserted* one does. */
|
|
63
|
-
export type ScenarioAssertionKind = "elementVisible" | "textEquals" | "urlEquals" | "noConsoleErrors" | "noFailedRequests";
|
|
64
|
-
export interface ScenarioAssertion {
|
|
65
|
-
readonly kind: ScenarioAssertionKind;
|
|
66
|
-
/** Which step this runs after, by index. `null` means after the whole scenario. An index past the end is refused: an assertion that never runs is worse than one that fails. */
|
|
67
|
-
readonly afterStep: number | null;
|
|
68
|
-
/** The element this is about, for the kinds that are about one. Null otherwise. */
|
|
69
|
-
readonly target: TargetDescriptor | null;
|
|
70
|
-
/** The expected value, for the kinds that compare one. Null otherwise. */
|
|
71
|
-
readonly expected: string | null;
|
|
72
|
-
}
|
|
73
|
-
export interface Scenario {
|
|
74
|
-
readonly schemaVersion: number;
|
|
75
|
-
readonly name: string;
|
|
76
|
-
readonly description: string | null;
|
|
77
|
-
readonly targetUrl: string;
|
|
78
|
-
/** When saved + commit authored against. Neither expires nor is checked at replay —
|
|
79
|
-
* exists to explain "written against a different revision" failures. DEC-223 §7's
|
|
80
|
-
* disclosed-non-detection choice: no expiry machinery until real scenarios exist. */
|
|
81
|
-
readonly savedAt: string;
|
|
82
|
-
readonly savedAtCommit: string;
|
|
83
|
-
readonly steps: readonly ScenarioStep[];
|
|
84
|
-
/** Required, may be empty. The runner can't invent assertions at replay — a
|
|
85
|
-
* successful click-through of a broken page with none stored would be a
|
|
86
|
-
* confident false negative. Empty is storable (exploration); never `passed`. */
|
|
87
|
-
readonly assertions: readonly ScenarioAssertion[];
|
|
88
|
-
}
|
|
89
|
-
/** True when a scenario claims nothing, so verifies nothing. A clean replay still
|
|
90
|
-
* proves the steps resolve — real info, not "the app is behaving". Reported as
|
|
91
|
-
* `unverified`. */
|
|
92
|
-
export declare function isUnverifying(scenario: Scenario): boolean;
|
|
93
|
-
//# sourceMappingURL=scenario.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../../src/scenarios/scenario.ts"],"names":[],"mappings":"AAAA;;;;0FAI0F;AAE1F;;;;;;;6DAO6D;AAC7D,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;;kEAIkE;AAClE,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C;0FAC0F;AAC1F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;2BAE2B;AAC3B,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,OAAO,GAAG,MA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EoB;AACpB,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEzD"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a saved scenario is (DEC-383's schema half). No browser import — replayability
|
|
3
|
-
* is the runner's separate question. A step stores a `TargetDescriptor`, never a `ref`
|
|
4
|
-
* (refs are snapshot-scoped, stale by replay). All 3 descriptor fields are required
|
|
5
|
-
* together — a fallback chain would quietly substitute a match instead of disagreeing. */
|
|
6
|
-
/** Bumped when a stored scenario's shape changes. An integer, never semver: one repository, one reader, nothing to argue about.
|
|
7
|
-
*
|
|
8
|
-
* 2 adds the `select` and `submit` verbs and the `${env:VAR}` secret reference. The bump is
|
|
9
|
-
* about the *reference*, not the verbs: an older reader meeting an unknown verb already refuses
|
|
10
|
-
* it by name, but an older reader meeting `${env:PASSWORD}` in a `text` field would type that
|
|
11
|
-
* literal string into a login form and report the resulting failure as the application's. Rule
|
|
12
|
-
* 7 forbids that, so the version gate is what stops it — a version 2 file is refused whole by a
|
|
13
|
-
* version 1 reader, with a message that says to upgrade. */
|
|
14
|
-
export const SCENARIO_SCHEMA_VERSION = 2;
|
|
15
|
-
/** The oldest stored version this reader still accepts. Version 1 is a strict subset of 2 —
|
|
16
|
-
* every field means what it meant, so the migration is the identity and a scenario saved before
|
|
17
|
-
* this change keeps replaying untouched. Read in the other direction from
|
|
18
|
-
* `SCENARIO_SCHEMA_VERSION`: that one stops a new file being misread by an old reader, this one
|
|
19
|
-
* stops an old file being refused by a new one for no reason. */
|
|
20
|
-
export const MIN_READABLE_SCHEMA_VERSION = 1;
|
|
21
|
-
/** True when a scenario claims nothing, so verifies nothing. A clean replay still
|
|
22
|
-
* proves the steps resolve — real info, not "the app is behaving". Reported as
|
|
23
|
-
* `unverified`. */
|
|
24
|
-
export function isUnverifying(scenario) {
|
|
25
|
-
return scenario.assertions.length === 0;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=scenario.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scenario.js","sourceRoot":"","sources":["../../src/scenarios/scenario.ts"],"names":[],"mappings":"AAAA;;;;0FAI0F;AAE1F;;;;;;;6DAO6D;AAC7D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC;;;;kEAIkE;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAiF7C;;oBAEoB;AACpB,MAAM,UAAU,aAAa,CAAC,QAAkB;IAC9C,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A step's text without the secret in it — `${env:VAR}` in place of a literal, resolved from
|
|
3
|
-
* the environment at replay.
|
|
4
|
-
*
|
|
5
|
-
* ## Why the format needs this at all
|
|
6
|
-
*
|
|
7
|
-
* A saved scenario is a committed file. `ScenarioStep.text` stores what was typed. Logging in
|
|
8
|
-
* by hand once and saving the session is the documented way to reach a gated screen, and the
|
|
9
|
-
* act of logging in is the act of typing a password — so the format's ordinary, intended use
|
|
10
|
-
* writes a credential into git. The guard that existed before this catches only a value the
|
|
11
|
-
* session was *also* seeded with, because that is the only value a session can prove is a
|
|
12
|
-
* credential; a password the agent simply typed was still written.
|
|
13
|
-
*
|
|
14
|
-
* ## Why there is no detector
|
|
15
|
-
*
|
|
16
|
-
* Nothing at the moment of typing distinguishes a password from a fixture value. `type="password"`
|
|
17
|
-
* is a hint: plenty of credential fields are not typed that way, and plenty of password fields
|
|
18
|
-
* hold throwaway values that are *useful* committed. A heuristic wrong in one direction commits a
|
|
19
|
-
* credential; wrong in the other it silently breaks a scenario somebody wrote on purpose. So a
|
|
20
|
-
* value is a secret because it is written as a reference, and for no other reason.
|
|
21
|
-
*
|
|
22
|
-
* ## Whole field, never embedded
|
|
23
|
-
*
|
|
24
|
-
* A reference is the entire `text` or none of it. `"Bearer ${env:TOKEN}"` is refused rather than
|
|
25
|
-
* interpolated. A partially-resolved string is the failure this module exists to prevent wearing
|
|
26
|
-
* a different hat: half of it came from the environment and half of it is in the file, and
|
|
27
|
-
* nothing in the artifact says which half. If a page needs a prefix, put the prefix in the
|
|
28
|
-
* variable.
|
|
29
|
-
*
|
|
30
|
-
* ## Escaping
|
|
31
|
-
*
|
|
32
|
-
* `$${env:X}` is the literal text `${env:X}`. A form that legitimately takes that string — a
|
|
33
|
-
* template editor, a config field — must stay writable, and an escape is cheaper than a special
|
|
34
|
-
* case later.
|
|
35
|
-
*
|
|
36
|
-
* Rule 1: an environment variable is a fact about a process, not about a language.
|
|
37
|
-
*/
|
|
38
|
-
export type SecretRef =
|
|
39
|
-
/** Store and type this exactly. `text` is already unescaped. */
|
|
40
|
-
{
|
|
41
|
-
readonly kind: "literal";
|
|
42
|
-
readonly text: string;
|
|
43
|
-
}
|
|
44
|
-
/** Resolve `variable` from the environment at replay; never store its value. */
|
|
45
|
-
| {
|
|
46
|
-
readonly kind: "ref";
|
|
47
|
-
readonly variable: string;
|
|
48
|
-
}
|
|
49
|
-
/** Meant as a reference and is not one. Refused at parse, save and replay alike. */
|
|
50
|
-
| {
|
|
51
|
-
readonly kind: "malformed";
|
|
52
|
-
readonly message: string;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Reads one stored `text` field. Never throws and never resolves — resolution is a separate
|
|
56
|
-
* call, so the format module stays readable with no environment in the process.
|
|
57
|
-
*/
|
|
58
|
-
export declare function readSecretRef(text: string): SecretRef;
|
|
59
|
-
/** True when this stored text would be resolved rather than typed. Cheap enough to call anywhere. */
|
|
60
|
-
export declare function isSecretRef(text: string): boolean;
|
|
61
|
-
/** What to write into a file so `variable` is resolved at replay. The one place the syntax is built. */
|
|
62
|
-
export declare function secretRefFor(variable: string): string;
|
|
63
|
-
export type SecretResolution = {
|
|
64
|
-
readonly resolved: true;
|
|
65
|
-
readonly value: string;
|
|
66
|
-
}
|
|
67
|
-
/** `reason` is already a whole sentence for a person, and never carries a value. */
|
|
68
|
-
| {
|
|
69
|
-
readonly resolved: false;
|
|
70
|
-
readonly reason: string;
|
|
71
|
-
};
|
|
72
|
-
/** Where a reference resolves from. A map, not `process.env` directly, so a replay can be given
|
|
73
|
-
* one — and so this file names no process global that a test would then have to mutate. */
|
|
74
|
-
export type SecretEnvironment = Readonly<Record<string, string | undefined>>;
|
|
75
|
-
/**
|
|
76
|
-
* Turns one stored `text` into the string to type, or says why it cannot.
|
|
77
|
-
*
|
|
78
|
-
* An unset variable and an empty one are both refusals. An empty variable is the shape a
|
|
79
|
-
* mistyped export takes — `PASSWORD=` in a `.env` that was never filled in — and typing an empty
|
|
80
|
-
* string into a login form produces a failed login that reads exactly like a broken application.
|
|
81
|
-
*/
|
|
82
|
-
export declare function resolveSecretText(text: string, env: SecretEnvironment): SecretResolution;
|
|
83
|
-
/** Every variable a scenario's steps reference, in order, deduplicated. What a preflight names
|
|
84
|
-
* to a developer, and what a runner checks before it opens a browser it will not be able to use. */
|
|
85
|
-
export declare function referencedVariables(texts: readonly (string | null)[]): readonly string[];
|
|
86
|
-
//# sourceMappingURL=secret-ref.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secret-ref.d.ts","sourceRoot":"","sources":["../../src/scenarios/secret-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAaH,MAAM,MAAM,SAAS;AACnB,gEAAgE;AAC9D;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACrD,gFAAgF;GAC9E;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AACrD,oFAAoF;GAClF;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAsBrD;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wGAAwG;AACxG,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AACrD,oFAAoF;GAClF;IAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D;4FAC4F;AAC5F,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAE7E;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,gBAAgB,CA2BxF;AAED;qGACqG;AACrG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,MAAM,EAAE,CAQxF"}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A step's text without the secret in it — `${env:VAR}` in place of a literal, resolved from
|
|
3
|
-
* the environment at replay.
|
|
4
|
-
*
|
|
5
|
-
* ## Why the format needs this at all
|
|
6
|
-
*
|
|
7
|
-
* A saved scenario is a committed file. `ScenarioStep.text` stores what was typed. Logging in
|
|
8
|
-
* by hand once and saving the session is the documented way to reach a gated screen, and the
|
|
9
|
-
* act of logging in is the act of typing a password — so the format's ordinary, intended use
|
|
10
|
-
* writes a credential into git. The guard that existed before this catches only a value the
|
|
11
|
-
* session was *also* seeded with, because that is the only value a session can prove is a
|
|
12
|
-
* credential; a password the agent simply typed was still written.
|
|
13
|
-
*
|
|
14
|
-
* ## Why there is no detector
|
|
15
|
-
*
|
|
16
|
-
* Nothing at the moment of typing distinguishes a password from a fixture value. `type="password"`
|
|
17
|
-
* is a hint: plenty of credential fields are not typed that way, and plenty of password fields
|
|
18
|
-
* hold throwaway values that are *useful* committed. A heuristic wrong in one direction commits a
|
|
19
|
-
* credential; wrong in the other it silently breaks a scenario somebody wrote on purpose. So a
|
|
20
|
-
* value is a secret because it is written as a reference, and for no other reason.
|
|
21
|
-
*
|
|
22
|
-
* ## Whole field, never embedded
|
|
23
|
-
*
|
|
24
|
-
* A reference is the entire `text` or none of it. `"Bearer ${env:TOKEN}"` is refused rather than
|
|
25
|
-
* interpolated. A partially-resolved string is the failure this module exists to prevent wearing
|
|
26
|
-
* a different hat: half of it came from the environment and half of it is in the file, and
|
|
27
|
-
* nothing in the artifact says which half. If a page needs a prefix, put the prefix in the
|
|
28
|
-
* variable.
|
|
29
|
-
*
|
|
30
|
-
* ## Escaping
|
|
31
|
-
*
|
|
32
|
-
* `$${env:X}` is the literal text `${env:X}`. A form that legitimately takes that string — a
|
|
33
|
-
* template editor, a config field — must stay writable, and an escape is cheaper than a special
|
|
34
|
-
* case later.
|
|
35
|
-
*
|
|
36
|
-
* Rule 1: an environment variable is a fact about a process, not about a language.
|
|
37
|
-
*/
|
|
38
|
-
/** `${env:VAR}` and nothing else. The variable name is the POSIX-portable set: a leading letter
|
|
39
|
-
* or underscore, then letters, digits and underscores. Anything else is malformed rather than
|
|
40
|
-
* accepted, because a name this cannot resolve is a name that would have been typed literally. */
|
|
41
|
-
const REFERENCE = /^\$\{env:([A-Za-z_][A-Za-z0-9_]*)\}$/;
|
|
42
|
-
/** Anything that opens with `${` — used to tell "a reference with a typo in it" from "text that
|
|
43
|
-
* happens to contain a brace". The first must be refused; the second must be left alone. */
|
|
44
|
-
const LOOKS_LIKE_REFERENCE = /^\$\{[^}]*\}$/;
|
|
45
|
-
const ESCAPED = /^\$\$\{/;
|
|
46
|
-
/**
|
|
47
|
-
* Reads one stored `text` field. Never throws and never resolves — resolution is a separate
|
|
48
|
-
* call, so the format module stays readable with no environment in the process.
|
|
49
|
-
*/
|
|
50
|
-
export function readSecretRef(text) {
|
|
51
|
-
const matched = REFERENCE.exec(text);
|
|
52
|
-
if (matched !== null)
|
|
53
|
-
return { kind: "ref", variable: matched[1] };
|
|
54
|
-
if (ESCAPED.test(text)) {
|
|
55
|
-
// `$${env:X}` → `${env:X}`. Only the leading `$$` is consumed; everything after it is text.
|
|
56
|
-
return { kind: "literal", text: text.slice(1) };
|
|
57
|
-
}
|
|
58
|
-
if (LOOKS_LIKE_REFERENCE.test(text)) {
|
|
59
|
-
return {
|
|
60
|
-
kind: "malformed",
|
|
61
|
-
message: `${JSON.stringify(text)} is written like a secret reference and is not one. The only form is ` +
|
|
62
|
-
'"${env:VARIABLE_NAME}", whole field, with the name in capitals, letters, digits and underscores — ' +
|
|
63
|
-
'no other scheme, no text around it. Write "$${...}" if you meant that string literally. It is ' +
|
|
64
|
-
"refused rather than stored as text on purpose: a reference with a typo in it would be typed into " +
|
|
65
|
-
"the field verbatim, and the page's rejection of it would be reported as the application's defect.",
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return { kind: "literal", text };
|
|
69
|
-
}
|
|
70
|
-
/** True when this stored text would be resolved rather than typed. Cheap enough to call anywhere. */
|
|
71
|
-
export function isSecretRef(text) {
|
|
72
|
-
return readSecretRef(text).kind === "ref";
|
|
73
|
-
}
|
|
74
|
-
/** What to write into a file so `variable` is resolved at replay. The one place the syntax is built. */
|
|
75
|
-
export function secretRefFor(variable) {
|
|
76
|
-
return `\${env:${variable}}`;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Turns one stored `text` into the string to type, or says why it cannot.
|
|
80
|
-
*
|
|
81
|
-
* An unset variable and an empty one are both refusals. An empty variable is the shape a
|
|
82
|
-
* mistyped export takes — `PASSWORD=` in a `.env` that was never filled in — and typing an empty
|
|
83
|
-
* string into a login form produces a failed login that reads exactly like a broken application.
|
|
84
|
-
*/
|
|
85
|
-
export function resolveSecretText(text, env) {
|
|
86
|
-
const ref = readSecretRef(text);
|
|
87
|
-
if (ref.kind === "literal")
|
|
88
|
-
return { resolved: true, value: ref.text };
|
|
89
|
-
if (ref.kind === "malformed")
|
|
90
|
-
return { resolved: false, reason: ref.message };
|
|
91
|
-
const value = env[ref.variable];
|
|
92
|
-
if (value === undefined) {
|
|
93
|
-
return {
|
|
94
|
-
resolved: false,
|
|
95
|
-
reason: `this step needs the environment variable ${ref.variable}, and it is not set. The scenario was ` +
|
|
96
|
-
"saved with a reference instead of the value on purpose — the value is a credential and a scenario " +
|
|
97
|
-
`is a committed file. Set ${ref.variable} in the environment this check runs in. Nothing was typed ` +
|
|
98
|
-
"and the replay stopped here: a step that types the literal text of its own reference would fail " +
|
|
99
|
-
"against the application and be reported as the application's defect.",
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
if (value === "") {
|
|
103
|
-
return {
|
|
104
|
-
resolved: false,
|
|
105
|
-
reason: `the environment variable ${ref.variable} is set and empty, which is what a half-written .env looks ` +
|
|
106
|
-
"like. An empty value is refused rather than typed: an empty password produces a failed login that " +
|
|
107
|
-
"reads exactly like a broken application.",
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return { resolved: true, value };
|
|
111
|
-
}
|
|
112
|
-
/** Every variable a scenario's steps reference, in order, deduplicated. What a preflight names
|
|
113
|
-
* to a developer, and what a runner checks before it opens a browser it will not be able to use. */
|
|
114
|
-
export function referencedVariables(texts) {
|
|
115
|
-
const out = [];
|
|
116
|
-
for (const text of texts) {
|
|
117
|
-
if (text === null)
|
|
118
|
-
continue;
|
|
119
|
-
const ref = readSecretRef(text);
|
|
120
|
-
if (ref.kind === "ref" && !out.includes(ref.variable))
|
|
121
|
-
out.push(ref.variable);
|
|
122
|
-
}
|
|
123
|
-
return out;
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=secret-ref.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secret-ref.js","sourceRoot":"","sources":["../../src/scenarios/secret-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;mGAEmG;AACnG,MAAM,SAAS,GAAG,sCAAsC,CAAC;AAEzD;6FAC6F;AAC7F,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAE7C,MAAM,OAAO,GAAG,SAAS,CAAC;AAU1B;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAE,EAAE,CAAC;IAEpE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,4FAA4F;QAC5F,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAClD,CAAC;IAED,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO;YACL,IAAI,EAAE,WAAW;YACjB,OAAO,EACL,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,uEAAuE;gBAC9F,oGAAoG;gBACpG,gGAAgG;gBAChG,mGAAmG;gBACnG,mGAAmG;SACtG,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACnC,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,aAAa,CAAC,IAAI,CAAC,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QACzB,IAAI,IAAI,KAAK,IAAI;YAAE,SAAS;QAC5B,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scenario storage — `DEC-383` §1. Lives in committed `descry/scenarios/`,
|
|
3
|
-
* never `.descry/` (gitignored, regenerable): §7 needs agent-free runs on
|
|
4
|
-
* a fresh CI checkout, where `.descry/` would vanish and fail silently. One file per scenario avoids merge conflicts.
|
|
5
|
-
*/
|
|
6
|
-
import { type ScenarioParseResult } from "./parse.ts";
|
|
7
|
-
import type { Scenario } from "./scenario.ts";
|
|
8
|
-
export declare function scenariosDirectory(repoPath: string): string;
|
|
9
|
-
/** Not the disk-safe path — `readScenario`/`writeScenario` go through `confinedScenarioPath` below. This one is for display messages naming even a refused name. */
|
|
10
|
-
export declare function scenarioPath(repoPath: string, name: string): string;
|
|
11
|
-
/** Thrown when the scenarios directory exists but can't be read (permission error, not-a-directory, ...) — a fact about Descry's ability to look, never about count. Must not collapse to `[]` (C-F2): that would teach a false "nothing saved". */
|
|
12
|
-
export declare class ScenarioListError extends Error {
|
|
13
|
-
constructor(dir: string, cause: unknown);
|
|
14
|
-
}
|
|
15
|
-
/** Every saved scenario's name. ENOENT means "nothing has ever been saved" → `[]`; any other read error (permission, not-a-directory) throws `ScenarioListError` instead — the five-reply-states distinction, one layer down. */
|
|
16
|
-
export declare function listScenarios(repoPath: string): Promise<readonly string[]>;
|
|
17
|
-
/** Reads one scenario; never throws — missing file, unreadable text, malformed document are all refusals carrying the path, so a CI replay can report which file was wrong rather than die on the first. */
|
|
18
|
-
export declare function readScenario(repoPath: string, name: string): Promise<ScenarioParseResult>;
|
|
19
|
-
/** Writes one scenario, refusing anything this reader couldn't read back. Validating on the way out isn't redundant — a fault saved today surfaces during a push check, long after the session that could explain it is gone. */
|
|
20
|
-
export declare function writeScenario(repoPath: string, scenario: Scenario): Promise<void>;
|
|
21
|
-
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/scenarios/storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAoC,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI9C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,oKAAoK;AACpK,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,oPAAoP;AACpP,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAMxC;AA4BD,iOAAiO;AACjO,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAUhF;AAED,4MAA4M;AAC5M,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAwB/F;AAED,iOAAiO;AACjO,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAQvF"}
|