@descryy/mcp 0.11.4 → 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 +7 -7
- 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 -591
- 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 -1518
- 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 -151
- 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 -39
- package/dist/capped.d.ts.map +0 -1
- package/dist/capped.js +0 -43
- 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 -327
- package/dist/registry.js.map +0 -1
- package/dist/render.d.ts +0 -623
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -968
- 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 -651
- package/dist/server.js.map +0 -1
- package/dist/session.d.ts +0 -356
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -779
- 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 -225
- 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 -640
- 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 -444
- 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 -370
- 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 -307
- 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 -385
- 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 -106
- 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 -262
- package/dist/tools/observe-runtime.d.ts.map +0 -1
- package/dist/tools/observe-runtime.js +0 -1901
- 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 -374
- 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 -123
- 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 -217
- 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 -203
- 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 -520
- 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
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One journey format, projected both ways — `DEC-NEXT-runtime-journey-is-one-declared-format`.
|
|
3
|
-
*
|
|
4
|
-
* ## The problem this closes
|
|
5
|
-
*
|
|
6
|
-
* The MCP `Scenario` (this directory) and the desktop's `BrowserStep`
|
|
7
|
-
* (`descry-desktop/packages/session/src/pipeline/browser-drive.ts`) are two
|
|
8
|
-
* step vocabularies that both describe "things a browser does in order", and
|
|
9
|
-
* until now nothing turned one into the other. A `Scenario`'s
|
|
10
|
-
* `TargetDescriptor` — role, name **and** selector together — is the bridge:
|
|
11
|
-
* `BrowserStep`'s verbs are selector-only, a strict narrowing of what a
|
|
12
|
-
* `TargetDescriptor` carries, so a saved scenario is projectable onto a
|
|
13
|
-
* driveable plan without inventing anything.
|
|
14
|
-
*
|
|
15
|
-
* ## Why the projected type is not `BrowserStep` itself
|
|
16
|
-
*
|
|
17
|
-
* This package (`descry-core`) cannot depend on `descry-desktop`, and
|
|
18
|
-
* `BrowserStep` carries only a `selector`, not the full descriptor. A
|
|
19
|
-
* consumer that needs to *drive* a browser (the desktop's
|
|
20
|
-
* `browser-adapter.ts`) reads `ProjectedStep.target.selector` and discards
|
|
21
|
-
* the rest — that narrowing is the desktop's own, documented where it
|
|
22
|
-
* happens. A consumer that needs to go the other way (turn a driven plan
|
|
23
|
-
* back into a committed scenario) needs the full descriptor, which a bare
|
|
24
|
-
* selector cannot supply — recovering a role and a name from a selector
|
|
25
|
-
* alone would be exactly the kind of guess rule 2 forbids. So the
|
|
26
|
-
* projection's own carrier (`ProjectedStep`) is deliberately richer than
|
|
27
|
-
* `BrowserStep`: it is the one shape both directions can be exact about.
|
|
28
|
-
*
|
|
29
|
-
* ## What is and is not projectable
|
|
30
|
-
*
|
|
31
|
-
* Total, both directions: `navigate`, `click`, `type`, `select`, `submit`,
|
|
32
|
-
* and the two assertion kinds that are about one element —
|
|
33
|
-
* `elementVisible` ⇄ `assertVisible`, `textEquals` ⇄ `assertText`.
|
|
34
|
-
*
|
|
35
|
-
* Refused by name, forward (`Scenario` → plan): `fill` — `BrowserStep` has
|
|
36
|
-
* only `type`, and `type` fires real keystrokes while `fill` sets the value
|
|
37
|
-
* directly with none; collapsing one into the other would silently change
|
|
38
|
-
* what the driven browser does. `urlEquals`, `noConsoleErrors`,
|
|
39
|
-
* `noFailedRequests` — assertions about the whole page or the run, not
|
|
40
|
-
* about an element `BrowserStep` can act on or assert against.
|
|
41
|
-
*
|
|
42
|
-
* Refused by name, reverse (a driven step list → `Scenario`): any kind
|
|
43
|
-
* outside the seven above — `waitFor` and `screenshot` are the desktop's
|
|
44
|
-
* own verbs with no `Scenario` counterpart at all.
|
|
45
|
-
*
|
|
46
|
-
* A step whose stored `text` is a secret reference (`${env:VAR}`) or a
|
|
47
|
-
* credential reference (`${credential:NAME}`) is resolved before the plan
|
|
48
|
-
* is built, never carried through unresolved — a plan is something about to
|
|
49
|
-
* be driven, and driving an unresolved reference would type its literal
|
|
50
|
-
* characters into the page (see `secret-ref.ts`/`credential-ref.ts`). A
|
|
51
|
-
* `${credential:NAME}` is resolved against the `credentials` map a caller
|
|
52
|
-
* passes in — this module has no store of its own (RG-1/"signin": the
|
|
53
|
-
* desktop resolves names against its own App-configuration secret store, an
|
|
54
|
-
* MCP server against `Session.credentialStore`; the caller already knows
|
|
55
|
-
* which, and does the async lookup before calling this synchronous
|
|
56
|
-
* function — see `resolveEitherRef` for why the two schemes are resolved by
|
|
57
|
-
* the same two-step shape, name first, value second, everywhere else in
|
|
58
|
-
* this package). An unresolved reference — of either scheme — is reported
|
|
59
|
-
* as a refusal
|
|
60
|
-
* naming the step's action and index, not as a defect in the application.
|
|
61
|
-
*
|
|
62
|
-
* ## The round trip
|
|
63
|
-
*
|
|
64
|
-
* `projectScenarioToRunPlan` then `projectRunPlanToScenario` on a scenario
|
|
65
|
-
* that uses only the projectable verbs reproduces the original steps and
|
|
66
|
-
* assertions exactly — see `browser-run-plan-projection.test.ts`. The
|
|
67
|
-
* `anchor` field on an assertion-kind `ProjectedStep` is what makes the
|
|
68
|
-
* reverse direction exact rather than a guess: it is carried straight
|
|
69
|
-
* through from `ScenarioAssertion.afterStep`, never recomputed from
|
|
70
|
-
* position, because a null-anchored (end-of-scenario) assertion and one
|
|
71
|
-
* anchored at the final step are otherwise indistinguishable by position
|
|
72
|
-
* alone once both are the last things a plan does.
|
|
73
|
-
*/
|
|
74
|
-
import { resolveSecretText } from "./secret-ref.js";
|
|
75
|
-
import { readCredentialRef } from "./credential-ref.js";
|
|
76
|
-
import { SCENARIO_SCHEMA_VERSION } from "./scenario.js";
|
|
77
|
-
const PROJECTED_KINDS = ["navigate", "click", "type", "select", "submit", "assertVisible", "assertText"];
|
|
78
|
-
function refuse(verb, index, reason) {
|
|
79
|
-
return { ok: false, verb, index, reason };
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* `Scenario` → a driveable plan. `env` resolves any `${env:VAR}` text the
|
|
83
|
-
* same way `replayScenario` does — defaulted to `process.env` so every
|
|
84
|
-
* caller that does not inject one behaves like driving the browser
|
|
85
|
-
* directly, and injectable so a test never has to mutate the process.
|
|
86
|
-
*
|
|
87
|
-
* `credentials` resolves any `${credential:NAME}` text — a plain, already-resolved
|
|
88
|
-
* name-to-value map rather than a live `CredentialStoreLike`, because this function is
|
|
89
|
-
* synchronous and a real store's `retrieve()` is not: the caller (an MCP tool against
|
|
90
|
-
* `Session.credentialStore`, the desktop against its own App-configuration secret store)
|
|
91
|
-
* does the async lookup for every name `referencedCredentials` finds before calling this,
|
|
92
|
-
* the same "resolve, then build" order `resolveEitherRef` uses everywhere else in this
|
|
93
|
-
* package. Defaulted to `{}` — every caller before RG-1/"signin" passed none, and a
|
|
94
|
-
* scenario using only `${env:...}` behaves exactly as before.
|
|
95
|
-
*/
|
|
96
|
-
export function projectScenarioToRunPlan(scenario, env = process.env, credentials = {}) {
|
|
97
|
-
// One pass builds the real-step projections, keyed by their scenario index,
|
|
98
|
-
// so assertions anchored at that index can be spliced in right after it —
|
|
99
|
-
// mirroring `replayScenario`'s own `evaluateAnchored(index, ...)` timing.
|
|
100
|
-
const realSteps = new Map();
|
|
101
|
-
for (const [index, step] of scenario.steps.entries()) {
|
|
102
|
-
const projected = projectStep(step, index, env, credentials);
|
|
103
|
-
if (!projected.ok)
|
|
104
|
-
return projected;
|
|
105
|
-
realSteps.set(index, projected.step);
|
|
106
|
-
}
|
|
107
|
-
const immediateAssertions = new Map();
|
|
108
|
-
const endAssertions = [];
|
|
109
|
-
for (const [index, assertion] of scenario.assertions.entries()) {
|
|
110
|
-
const projected = projectAssertion(assertion, index);
|
|
111
|
-
if (!projected.ok)
|
|
112
|
-
return projected;
|
|
113
|
-
if (assertion.afterStep === null) {
|
|
114
|
-
endAssertions.push(projected.step);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
const bucket = immediateAssertions.get(assertion.afterStep) ?? [];
|
|
118
|
-
bucket.push(projected.step);
|
|
119
|
-
immediateAssertions.set(assertion.afterStep, bucket);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
const steps = [];
|
|
123
|
-
scenario.steps.forEach((_, index) => {
|
|
124
|
-
steps.push(realSteps.get(index));
|
|
125
|
-
steps.push(...(immediateAssertions.get(index) ?? []));
|
|
126
|
-
});
|
|
127
|
-
steps.push(...endAssertions);
|
|
128
|
-
return { ok: true, plan: { startUrl: scenario.targetUrl, steps } };
|
|
129
|
-
}
|
|
130
|
-
function projectStep(step, index, env, credentials) {
|
|
131
|
-
if (step.action === "fill") {
|
|
132
|
-
return refuse("fill", index, `step ${index}: "fill" has no counterpart in the driveable step vocabulary — that vocabulary has only "type", ` +
|
|
133
|
-
"which fires real keystrokes, while fill sets the value directly and fires none. Collapsing one into the " +
|
|
134
|
-
"other would drive the browser differently from what the scenario declared, so this step is refused rather " +
|
|
135
|
-
"than silently narrowed.");
|
|
136
|
-
}
|
|
137
|
-
if (step.action === "navigate") {
|
|
138
|
-
return { ok: true, step: { kind: "navigate", target: null, url: step.url, text: null, anchor: null } };
|
|
139
|
-
}
|
|
140
|
-
const target = step.target;
|
|
141
|
-
if (target === null) {
|
|
142
|
-
return refuse(step.action, index, `step ${index}: "${step.action}" acts on an element and carries no target to project.`);
|
|
143
|
-
}
|
|
144
|
-
if (step.action === "type" || step.action === "select") {
|
|
145
|
-
const raw = step.text ?? "";
|
|
146
|
-
// `${credential:NAME}` is this scheme's own shape and nothing else recognises it —
|
|
147
|
-
// checked first, exactly as `resolveEitherRef` orders the two, so a well-formed
|
|
148
|
-
// credential reference is never misreported as a malformed `${env:...}` one.
|
|
149
|
-
const credentialRef = readCredentialRef(raw);
|
|
150
|
-
if (credentialRef.kind === "ref") {
|
|
151
|
-
const value = credentials[credentialRef.name];
|
|
152
|
-
if (value === undefined || value === "") {
|
|
153
|
-
return refuse(step.action, index, `step ${index}: this step needs the credential "${credentialRef.name}", and nothing was resolved for ` +
|
|
154
|
-
"it. Nothing was typed and the projection stopped here: a step that types the literal text of its " +
|
|
155
|
-
"own reference would fail against the application and be reported as the application's defect.");
|
|
156
|
-
}
|
|
157
|
-
return { ok: true, step: { kind: step.action, target, url: null, text: value, anchor: null } };
|
|
158
|
-
}
|
|
159
|
-
if (credentialRef.kind === "malformed") {
|
|
160
|
-
return refuse(step.action, index, `step ${index}: ${credentialRef.message}`);
|
|
161
|
-
}
|
|
162
|
-
const resolved = resolveSecretText(raw, env);
|
|
163
|
-
if (!resolved.resolved)
|
|
164
|
-
return refuse(step.action, index, `step ${index}: ${resolved.reason}`);
|
|
165
|
-
return { ok: true, step: { kind: step.action, target, url: null, text: resolved.value, anchor: null } };
|
|
166
|
-
}
|
|
167
|
-
// click, submit
|
|
168
|
-
return { ok: true, step: { kind: step.action, target, url: null, text: null, anchor: null } };
|
|
169
|
-
}
|
|
170
|
-
function projectAssertion(assertion, index) {
|
|
171
|
-
const anchor = assertion.afterStep === null ? "end" : "immediate";
|
|
172
|
-
if (assertion.kind === "elementVisible") {
|
|
173
|
-
if (assertion.target === null) {
|
|
174
|
-
return refuse("elementVisible", index, `assertion ${index}: elementVisible names no element to project.`);
|
|
175
|
-
}
|
|
176
|
-
return { ok: true, step: { kind: "assertVisible", target: assertion.target, url: null, text: null, anchor } };
|
|
177
|
-
}
|
|
178
|
-
if (assertion.kind === "textEquals") {
|
|
179
|
-
if (assertion.target === null || assertion.expected === null) {
|
|
180
|
-
return refuse("textEquals", index, `assertion ${index}: textEquals needs both an element and an expected value to project.`);
|
|
181
|
-
}
|
|
182
|
-
return { ok: true, step: { kind: "assertText", target: assertion.target, url: null, text: assertion.expected, anchor } };
|
|
183
|
-
}
|
|
184
|
-
return refuse(assertion.kind, index, `assertion ${index}: "${assertion.kind}" has no counterpart in the driveable step vocabulary — that vocabulary ` +
|
|
185
|
-
"has no step that asserts about the whole page or the run rather than about one element, so this assertion " +
|
|
186
|
-
"is refused rather than dropped.");
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* A driveable plan → `Scenario`. Total for the seven shared verbs; refuses
|
|
190
|
-
* by name for anything else (`waitFor`, `screenshot`, or any unrecognised
|
|
191
|
-
* kind a caller hands in).
|
|
192
|
-
*/
|
|
193
|
-
export function projectRunPlanToScenario(plan, meta) {
|
|
194
|
-
const steps = [];
|
|
195
|
-
const assertions = [];
|
|
196
|
-
let lastStepIndex = -1;
|
|
197
|
-
for (const [index, raw] of plan.steps.entries()) {
|
|
198
|
-
if (!PROJECTED_KINDS.includes(raw.kind)) {
|
|
199
|
-
return refuse(raw.kind, index, `plan step ${index}: "${raw.kind}" has no counterpart in the scenario format — the scenario format has no ` +
|
|
200
|
-
"verb for it, so this step is refused rather than dropped.");
|
|
201
|
-
}
|
|
202
|
-
const kind = raw.kind;
|
|
203
|
-
if (kind === "assertVisible" || kind === "assertText") {
|
|
204
|
-
if (raw.anchor === null) {
|
|
205
|
-
return refuse(kind, index, `plan step ${index}: an assertion step carries no anchor to project.`);
|
|
206
|
-
}
|
|
207
|
-
if (raw.anchor === "immediate" && lastStepIndex === -1) {
|
|
208
|
-
return refuse(kind, index, `plan step ${index}: this assertion is anchored immediately after a step, and no step precedes it — a ` +
|
|
209
|
-
"scenario assertion can only anchor after a real step, or after the whole scenario. Refused rather " +
|
|
210
|
-
"than guessing an anchor.");
|
|
211
|
-
}
|
|
212
|
-
if (raw.target === null) {
|
|
213
|
-
return refuse(kind, index, `plan step ${index}: "${kind}" carries no target to project.`);
|
|
214
|
-
}
|
|
215
|
-
const afterStep = raw.anchor === "end" ? null : lastStepIndex;
|
|
216
|
-
if (kind === "assertVisible") {
|
|
217
|
-
assertions.push({ kind: "elementVisible", afterStep, target: raw.target, expected: null });
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
if (raw.text === null) {
|
|
221
|
-
return refuse(kind, index, `plan step ${index}: "assertText" carries no expected text to project.`);
|
|
222
|
-
}
|
|
223
|
-
assertions.push({ kind: "textEquals", afterStep, target: raw.target, expected: raw.text });
|
|
224
|
-
}
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
if (kind === "navigate") {
|
|
228
|
-
if (raw.url === null)
|
|
229
|
-
return refuse("navigate", index, `plan step ${index}: "navigate" carries no url to project.`);
|
|
230
|
-
steps.push({ action: "navigate", target: null, url: raw.url, text: null });
|
|
231
|
-
lastStepIndex += 1;
|
|
232
|
-
continue;
|
|
233
|
-
}
|
|
234
|
-
if (raw.target === null)
|
|
235
|
-
return refuse(kind, index, `plan step ${index}: "${kind}" carries no target to project.`);
|
|
236
|
-
if (kind === "type" || kind === "select") {
|
|
237
|
-
if (raw.text === null)
|
|
238
|
-
return refuse(kind, index, `plan step ${index}: "${kind}" carries no text to project.`);
|
|
239
|
-
steps.push({ action: kind, target: raw.target, url: null, text: raw.text });
|
|
240
|
-
lastStepIndex += 1;
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
// click, submit
|
|
244
|
-
steps.push({ action: kind, target: raw.target, url: null, text: null });
|
|
245
|
-
lastStepIndex += 1;
|
|
246
|
-
}
|
|
247
|
-
if (steps.length === 0) {
|
|
248
|
-
return refuse("(none)", null, "the plan has no driveable steps to project — a scenario needs at least one step.");
|
|
249
|
-
}
|
|
250
|
-
return {
|
|
251
|
-
ok: true,
|
|
252
|
-
scenario: {
|
|
253
|
-
schemaVersion: SCENARIO_SCHEMA_VERSION,
|
|
254
|
-
name: meta.name,
|
|
255
|
-
description: meta.description,
|
|
256
|
-
targetUrl: plan.startUrl,
|
|
257
|
-
savedAt: meta.savedAt,
|
|
258
|
-
savedAtCommit: meta.savedAtCommit,
|
|
259
|
-
steps,
|
|
260
|
-
assertions,
|
|
261
|
-
},
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
//# sourceMappingURL=browser-run-plan-projection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-run-plan-projection.js","sourceRoot":"","sources":["../../src/scenarios/browser-run-plan-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAE,iBAAiB,EAA0B,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAmF,MAAM,eAAe,CAAC;AAKzI,MAAM,eAAe,GAAiC,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;AA2CvI,SAAS,MAAM,CAAC,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I;QACR,QAAQ,EAAE;YACR,aAAa,EAAE,uBAAuB;YACtC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,KAAK;YACL,UAAU;SACX;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `${credential:NAME}` — a scenario step names a stored credential by
|
|
3
|
-
* reference; the credential store holds the value. Lane A1, item 4 of
|
|
4
|
-
* `documents/plans/runtime-gap-closure.md` ("Sign-in as a first-class
|
|
5
|
-
* step"). Appended to `DEC-NEXT-scenario-format-needs-a-secret-reference.md`
|
|
6
|
-
* rather than rewriting it — see that file's own note.
|
|
7
|
-
*
|
|
8
|
-
* ## Why a second module, not a second branch inside `secret-ref.ts`
|
|
9
|
-
*
|
|
10
|
-
* `secret-ref.ts`'s own header already reserves this extension point:
|
|
11
|
-
* *"A keychain becomes a second scheme with its own prefix and its own
|
|
12
|
-
* refusal, not a fallback behind the first one. Nothing about the stored
|
|
13
|
-
* file changes when it arrives."* This module is that second scheme,
|
|
14
|
-
* `credential:` rather than `keychain:` because the store it resolves
|
|
15
|
-
* against (`descry-runtime`'s `CredentialStore`, an at-rest encrypted file
|
|
16
|
-
* store today, a real OS keychain later behind the same three-method
|
|
17
|
-
* interface) is named for what it is, not for today's backend. Kept in its
|
|
18
|
-
* own file rather than added as a branch inside `readSecretRef` so the two
|
|
19
|
-
* schemes stay independently resolvable — a caller that only has an
|
|
20
|
-
* environment map (`resolveSecretText`) and one that only has a credential
|
|
21
|
-
* store (`resolveCredentialText`, here) each fail closed on the scheme they
|
|
22
|
-
* cannot serve, rather than one function silently depending on both.
|
|
23
|
-
*
|
|
24
|
-
* ## What this does not attempt
|
|
25
|
-
*
|
|
26
|
-
* A step naming `${credential:NAME}` still types the resolved value into a
|
|
27
|
-
* field with `type`/`fill`/`select` — the same verbs, the same replay path,
|
|
28
|
-
* the same "whole field or none of it" and "empty is refused" rules as
|
|
29
|
-
* `secret-ref.ts`. It does **not** add a session-seeding step that logs a
|
|
30
|
-
* whole browser context in via a saved storage state mid-replay — that
|
|
31
|
-
* would need a driver-level primitive (`packages/mcp/src/browser/driver.ts`,
|
|
32
|
-
* `playwright-driver.ts`) to inject cookies into a session already in
|
|
33
|
-
* progress, and this lane does not own those files. `auth.ts`'s
|
|
34
|
-
* `loadStorageStateFile` already seeds a **new** session at
|
|
35
|
-
* `browser_start_session` time; wiring a credential-store-backed profile
|
|
36
|
-
* into that call is a smaller, real gap, and is recorded as a handoff in
|
|
37
|
-
* `DEC-NEXT-scenario-format-needs-a-secret-reference.md` rather than built
|
|
38
|
-
* here by touching a port this lane does not own.
|
|
39
|
-
*
|
|
40
|
-
* Rule 1: an environment variable is a fact about a process; a credential
|
|
41
|
-
* reference is a fact about a name a person chose. Neither module needs to
|
|
42
|
-
* know what kind of secret it resolves to.
|
|
43
|
-
*/
|
|
44
|
-
import { type SecretEnvironment } from "./secret-ref.ts";
|
|
45
|
-
export type CredentialRef = {
|
|
46
|
-
readonly kind: "literal";
|
|
47
|
-
readonly text: string;
|
|
48
|
-
} | {
|
|
49
|
-
readonly kind: "ref";
|
|
50
|
-
readonly name: string;
|
|
51
|
-
} | {
|
|
52
|
-
readonly kind: "malformed";
|
|
53
|
-
readonly message: string;
|
|
54
|
-
};
|
|
55
|
-
/** Reads one stored `text` field for the `credential:` scheme alone. A `${env:...}` reference is
|
|
56
|
-
* a literal as far as this function is concerned — `secret-ref.ts`'s `readSecretRef` is what
|
|
57
|
-
* resolves that scheme, and a caller resolving both composes the two (see `resolveEitherRef`). */
|
|
58
|
-
export declare function readCredentialRef(text: string): CredentialRef;
|
|
59
|
-
export declare function isCredentialRef(text: string): boolean;
|
|
60
|
-
/** What to write into a file so `name` is resolved from the credential store at replay. */
|
|
61
|
-
export declare function credentialRefFor(name: string): string;
|
|
62
|
-
/**
|
|
63
|
-
* The minimal shape this module needs from a credential store — structurally
|
|
64
|
-
* the same three-method interface as `descry-runtime`'s `CredentialStore`
|
|
65
|
-
* (`packages/environment-profile/src/credential-store.ts`), restated rather
|
|
66
|
-
* than imported: this package does not depend on `descry-runtime` (see
|
|
67
|
-
* `descry-core`'s `CLAUDE.md`, "Repo split"), and a structural interface is
|
|
68
|
-
* enough — any store satisfying it, real or a test double, resolves here.
|
|
69
|
-
*/
|
|
70
|
-
export interface CredentialStoreLike {
|
|
71
|
-
retrieve(credentialRef: string): Promise<string | null>;
|
|
72
|
-
}
|
|
73
|
-
export type CredentialResolution = {
|
|
74
|
-
readonly resolved: true;
|
|
75
|
-
readonly value: string;
|
|
76
|
-
} | {
|
|
77
|
-
readonly resolved: false;
|
|
78
|
-
readonly reason: string;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Turns one stored `text` into the string to type, or says why it cannot —
|
|
82
|
-
* `secret-ref.ts`'s `resolveSecretText`, restated against a credential store
|
|
83
|
-
* instead of an environment map. An unset name and an empty stored value are
|
|
84
|
-
* both refusals, for the same reason `resolveSecretText` refuses an empty
|
|
85
|
-
* environment variable: an empty password produces a failed login that
|
|
86
|
-
* reads exactly like a broken application.
|
|
87
|
-
*/
|
|
88
|
-
export declare function resolveCredentialText(text: string, store: CredentialStoreLike): Promise<CredentialResolution>;
|
|
89
|
-
/** Every credential name a scenario's steps reference, in order, deduplicated — the `${credential:...}` counterpart to `secret-ref.ts`'s `referencedVariables`. */
|
|
90
|
-
export declare function referencedCredentials(texts: readonly (string | null)[]): readonly string[];
|
|
91
|
-
/**
|
|
92
|
-
* Resolves a step's stored text against **both** schemes: `${credential:NAME}` checked first
|
|
93
|
-
* (this module owns that shape and nothing else recognises it), `${env:VAR}` and plain literals
|
|
94
|
-
* delegated to `resolveSecretText` otherwise. One entry point so a caller (`scenario-runner.ts`)
|
|
95
|
-
* never has to decide which resolver a given step's text needs — the reference's own prefix
|
|
96
|
-
* decides. `store` is optional: a scenario naming `${credential:NAME}` with no store configured
|
|
97
|
-
* refuses by name rather than falling through to `resolveSecretText`, which would report it as a
|
|
98
|
-
* malformed `${env:...}` reference — a true statement about that resolver and a confusing one
|
|
99
|
-
* about this file's own scheme.
|
|
100
|
-
*/
|
|
101
|
-
export declare function resolveEitherRef(text: string, env: SecretEnvironment, store: CredentialStoreLike | undefined): Promise<CredentialResolution>;
|
|
102
|
-
//# sourceMappingURL=credential-ref.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"credential-ref.d.ts","sourceRoot":"","sources":["../../src/scenarios/credential-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAS5E,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D;;mGAEmG;AACnG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAgB7D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACzD;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA0BnH;AAED,mKAAmK;AACnK,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,MAAM,EAAE,CAQ1F;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,mBAAmB,GAAG,SAAS,GACrC,OAAO,CAAC,oBAAoB,CAAC,CAiB/B"}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `${credential:NAME}` — a scenario step names a stored credential by
|
|
3
|
-
* reference; the credential store holds the value. Lane A1, item 4 of
|
|
4
|
-
* `documents/plans/runtime-gap-closure.md` ("Sign-in as a first-class
|
|
5
|
-
* step"). Appended to `DEC-NEXT-scenario-format-needs-a-secret-reference.md`
|
|
6
|
-
* rather than rewriting it — see that file's own note.
|
|
7
|
-
*
|
|
8
|
-
* ## Why a second module, not a second branch inside `secret-ref.ts`
|
|
9
|
-
*
|
|
10
|
-
* `secret-ref.ts`'s own header already reserves this extension point:
|
|
11
|
-
* *"A keychain becomes a second scheme with its own prefix and its own
|
|
12
|
-
* refusal, not a fallback behind the first one. Nothing about the stored
|
|
13
|
-
* file changes when it arrives."* This module is that second scheme,
|
|
14
|
-
* `credential:` rather than `keychain:` because the store it resolves
|
|
15
|
-
* against (`descry-runtime`'s `CredentialStore`, an at-rest encrypted file
|
|
16
|
-
* store today, a real OS keychain later behind the same three-method
|
|
17
|
-
* interface) is named for what it is, not for today's backend. Kept in its
|
|
18
|
-
* own file rather than added as a branch inside `readSecretRef` so the two
|
|
19
|
-
* schemes stay independently resolvable — a caller that only has an
|
|
20
|
-
* environment map (`resolveSecretText`) and one that only has a credential
|
|
21
|
-
* store (`resolveCredentialText`, here) each fail closed on the scheme they
|
|
22
|
-
* cannot serve, rather than one function silently depending on both.
|
|
23
|
-
*
|
|
24
|
-
* ## What this does not attempt
|
|
25
|
-
*
|
|
26
|
-
* A step naming `${credential:NAME}` still types the resolved value into a
|
|
27
|
-
* field with `type`/`fill`/`select` — the same verbs, the same replay path,
|
|
28
|
-
* the same "whole field or none of it" and "empty is refused" rules as
|
|
29
|
-
* `secret-ref.ts`. It does **not** add a session-seeding step that logs a
|
|
30
|
-
* whole browser context in via a saved storage state mid-replay — that
|
|
31
|
-
* would need a driver-level primitive (`packages/mcp/src/browser/driver.ts`,
|
|
32
|
-
* `playwright-driver.ts`) to inject cookies into a session already in
|
|
33
|
-
* progress, and this lane does not own those files. `auth.ts`'s
|
|
34
|
-
* `loadStorageStateFile` already seeds a **new** session at
|
|
35
|
-
* `browser_start_session` time; wiring a credential-store-backed profile
|
|
36
|
-
* into that call is a smaller, real gap, and is recorded as a handoff in
|
|
37
|
-
* `DEC-NEXT-scenario-format-needs-a-secret-reference.md` rather than built
|
|
38
|
-
* here by touching a port this lane does not own.
|
|
39
|
-
*
|
|
40
|
-
* Rule 1: an environment variable is a fact about a process; a credential
|
|
41
|
-
* reference is a fact about a name a person chose. Neither module needs to
|
|
42
|
-
* know what kind of secret it resolves to.
|
|
43
|
-
*/
|
|
44
|
-
import { resolveSecretText } from "./secret-ref.js";
|
|
45
|
-
/** `${credential:NAME}` — the credential name is deliberately permissive
|
|
46
|
-
* (letters, digits, `-`, `_`, `.`) because a credential ref is a name a
|
|
47
|
-
* person or a store assigns, not a POSIX environment variable. */
|
|
48
|
-
const REFERENCE = /^\$\{credential:([A-Za-z0-9_.-]+)\}$/;
|
|
49
|
-
const LOOKS_LIKE_REFERENCE = /^\$\{credential:[^}]*\}$/;
|
|
50
|
-
/** Reads one stored `text` field for the `credential:` scheme alone. A `${env:...}` reference is
|
|
51
|
-
* a literal as far as this function is concerned — `secret-ref.ts`'s `readSecretRef` is what
|
|
52
|
-
* resolves that scheme, and a caller resolving both composes the two (see `resolveEitherRef`). */
|
|
53
|
-
export function readCredentialRef(text) {
|
|
54
|
-
const matched = REFERENCE.exec(text);
|
|
55
|
-
if (matched !== null)
|
|
56
|
-
return { kind: "ref", name: matched[1] };
|
|
57
|
-
if (LOOKS_LIKE_REFERENCE.test(text)) {
|
|
58
|
-
return {
|
|
59
|
-
kind: "malformed",
|
|
60
|
-
message: `${JSON.stringify(text)} is written like a credential reference and is not one. The only form is ` +
|
|
61
|
-
'"${credential:NAME}", whole field, with the name made of letters, digits, "-", "_" or ".", no other ' +
|
|
62
|
-
"text around it. It is refused rather than stored as text on purpose, for the same reason a malformed " +
|
|
63
|
-
"${env:...} reference is: typed verbatim into a login form, it would be reported as the application's defect.",
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
return { kind: "literal", text };
|
|
67
|
-
}
|
|
68
|
-
export function isCredentialRef(text) {
|
|
69
|
-
return readCredentialRef(text).kind === "ref";
|
|
70
|
-
}
|
|
71
|
-
/** What to write into a file so `name` is resolved from the credential store at replay. */
|
|
72
|
-
export function credentialRefFor(name) {
|
|
73
|
-
return `\${credential:${name}}`;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Turns one stored `text` into the string to type, or says why it cannot —
|
|
77
|
-
* `secret-ref.ts`'s `resolveSecretText`, restated against a credential store
|
|
78
|
-
* instead of an environment map. An unset name and an empty stored value are
|
|
79
|
-
* both refusals, for the same reason `resolveSecretText` refuses an empty
|
|
80
|
-
* environment variable: an empty password produces a failed login that
|
|
81
|
-
* reads exactly like a broken application.
|
|
82
|
-
*/
|
|
83
|
-
export async function resolveCredentialText(text, store) {
|
|
84
|
-
const ref = readCredentialRef(text);
|
|
85
|
-
if (ref.kind === "literal")
|
|
86
|
-
return { resolved: true, value: ref.text };
|
|
87
|
-
if (ref.kind === "malformed")
|
|
88
|
-
return { resolved: false, reason: ref.message };
|
|
89
|
-
const value = await store.retrieve(ref.name);
|
|
90
|
-
if (value === null) {
|
|
91
|
-
return {
|
|
92
|
-
resolved: false,
|
|
93
|
-
reason: `this step needs the credential "${ref.name}", and nothing is stored under that name. The scenario was ` +
|
|
94
|
-
"saved with a reference instead of the value on purpose — the value is a credential and a scenario is a " +
|
|
95
|
-
`committed file. Store it under "${ref.name}" before replaying. Nothing was typed and the replay stopped ` +
|
|
96
|
-
"here: a step that types the literal text of its own reference would fail against the application and be " +
|
|
97
|
-
"reported as the application's defect.",
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
if (value === "") {
|
|
101
|
-
return {
|
|
102
|
-
resolved: false,
|
|
103
|
-
reason: `the credential "${ref.name}" is stored and empty. An empty value is refused rather than typed: an empty ` +
|
|
104
|
-
"password produces a failed login that reads exactly like a broken application.",
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
return { resolved: true, value };
|
|
108
|
-
}
|
|
109
|
-
/** Every credential name a scenario's steps reference, in order, deduplicated — the `${credential:...}` counterpart to `secret-ref.ts`'s `referencedVariables`. */
|
|
110
|
-
export function referencedCredentials(texts) {
|
|
111
|
-
const out = [];
|
|
112
|
-
for (const text of texts) {
|
|
113
|
-
if (text === null)
|
|
114
|
-
continue;
|
|
115
|
-
const ref = readCredentialRef(text);
|
|
116
|
-
if (ref.kind === "ref" && !out.includes(ref.name))
|
|
117
|
-
out.push(ref.name);
|
|
118
|
-
}
|
|
119
|
-
return out;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Resolves a step's stored text against **both** schemes: `${credential:NAME}` checked first
|
|
123
|
-
* (this module owns that shape and nothing else recognises it), `${env:VAR}` and plain literals
|
|
124
|
-
* delegated to `resolveSecretText` otherwise. One entry point so a caller (`scenario-runner.ts`)
|
|
125
|
-
* never has to decide which resolver a given step's text needs — the reference's own prefix
|
|
126
|
-
* decides. `store` is optional: a scenario naming `${credential:NAME}` with no store configured
|
|
127
|
-
* refuses by name rather than falling through to `resolveSecretText`, which would report it as a
|
|
128
|
-
* malformed `${env:...}` reference — a true statement about that resolver and a confusing one
|
|
129
|
-
* about this file's own scheme.
|
|
130
|
-
*/
|
|
131
|
-
export async function resolveEitherRef(text, env, store) {
|
|
132
|
-
const asCredential = readCredentialRef(text);
|
|
133
|
-
if (asCredential.kind === "ref") {
|
|
134
|
-
if (store === undefined) {
|
|
135
|
-
return {
|
|
136
|
-
resolved: false,
|
|
137
|
-
reason: `this step needs the credential "${asCredential.name}", and no credential store is configured for this ` +
|
|
138
|
-
"replay. Sign-in-as-profile steps need a credential store wired in by the caller (browser_run_scenario's " +
|
|
139
|
-
"own runner); nothing was typed.",
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
return resolveCredentialText(text, store);
|
|
143
|
-
}
|
|
144
|
-
if (asCredential.kind === "malformed")
|
|
145
|
-
return { resolved: false, reason: asCredential.message };
|
|
146
|
-
return resolveSecretText(text, env);
|
|
147
|
-
}
|
|
148
|
-
//# sourceMappingURL=credential-ref.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"credential-ref.js","sourceRoot":"","sources":["../../src/scenarios/credential-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,iBAAiB,EAA0B,MAAM,iBAAiB,CAAC;AAE5E;;mEAEmE;AACnE,MAAM,SAAS,GAAG,sCAAsC,CAAC;AAEzD,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAOxD;;mGAEmG;AACnG,MAAM,UAAU,iBAAiB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AY,CAAC,IAAI,oDAAoD;oBACxG,0GAA0G;oBAC1G,iCAAiC;aACpC,CAAC;QACJ,CAAC;QACD,OAAO,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,YAAY,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC;IAEhG,OAAO,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { MIN_READABLE_SCHEMA_VERSION, SCENARIO_SCHEMA_VERSION, isUnverifying, type Scenario, type ScenarioStep, type ScenarioAssertion, type ScenarioAssertionKind, type ScenarioActionKind, type TargetDescriptor, } from "./scenario.ts";
|
|
2
|
-
export { parseScenario, serializeScenario, type ScenarioParseResult } from "./parse.ts";
|
|
3
|
-
export { isSecretRef, readSecretRef, referencedVariables, resolveSecretText, secretRefFor, type SecretEnvironment, type SecretRef, type SecretResolution, } from "./secret-ref.ts";
|
|
4
|
-
export { scenariosDirectory, scenarioPath, listScenarios, ScenarioListError, readScenario, writeScenario, } from "./storage.ts";
|
|
5
|
-
export { readCredentialRef, isCredentialRef, credentialRefFor, resolveCredentialText, resolveEitherRef, referencedCredentials, type CredentialRef, type CredentialStoreLike, type CredentialResolution, } from "./credential-ref.ts";
|
|
6
|
-
export { projectScenarioToRunPlan, projectRunPlanToScenario, type ProjectedStep, type ProjectedStepKind, type ProjectedBrowserRunPlan, type ProjectionRefusal, type ScenarioProjection, type PlanProjection, type RawProjectedStep, type ScenarioMeta, } from "./browser-run-plan-projection.ts";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scenarios/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,EACL,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,kCAAkC,CAAC"}
|
package/dist/scenarios/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { MIN_READABLE_SCHEMA_VERSION, SCENARIO_SCHEMA_VERSION, isUnverifying, } from "./scenario.js";
|
|
2
|
-
export { parseScenario, serializeScenario } from "./parse.js";
|
|
3
|
-
export { isSecretRef, readSecretRef, referencedVariables, resolveSecretText, secretRefFor, } from "./secret-ref.js";
|
|
4
|
-
export { scenariosDirectory, scenarioPath, listScenarios, ScenarioListError, readScenario, writeScenario, } from "./storage.js";
|
|
5
|
-
export { readCredentialRef, isCredentialRef, credentialRefFor, resolveCredentialText, resolveEitherRef, referencedCredentials, } from "./credential-ref.js";
|
|
6
|
-
export { projectScenarioToRunPlan, projectRunPlanToScenario, } from "./browser-run-plan-projection.js";
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scenarios/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,aAAa,GAOd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAA4B,MAAM,YAAY,CAAC;AACxF,OAAO,EACL,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,GAIb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,GAItB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GASzB,MAAM,kCAAkC,CAAC"}
|
|
@@ -1,18 +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 { type Scenario } from "./scenario.ts";
|
|
7
|
-
export type ScenarioParseResult = {
|
|
8
|
-
readonly valid: true;
|
|
9
|
-
readonly scenario: Scenario;
|
|
10
|
-
} | {
|
|
11
|
-
readonly valid: false;
|
|
12
|
-
readonly problems: readonly string[];
|
|
13
|
-
};
|
|
14
|
-
/** 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. */
|
|
15
|
-
export declare function parseScenario(raw: unknown): ScenarioParseResult;
|
|
16
|
-
/** Newline-terminated and two-space indented, so a saved scenario reads as a reviewable diff rather than one long line. */
|
|
17
|
-
export declare function serializeScenario(scenario: Scenario): string;
|
|
18
|
-
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/scenarios/parse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAGL,KAAK,QAAQ,EAMd,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAgJpE,qNAAqN;AACrN,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CAwE/D;AAED,2HAA2H;AAC3H,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE5D"}
|