@e2edev/e2e 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/dist/agent/act-validation.d.ts +27 -0
- package/dist/agent/act-validation.d.ts.map +1 -0
- package/dist/agent/act-validation.js +121 -0
- package/dist/agent/act-validation.js.map +1 -0
- package/dist/agent/act.d.ts +27 -0
- package/dist/agent/act.d.ts.map +1 -0
- package/dist/agent/act.js +775 -0
- package/dist/agent/act.js.map +1 -0
- package/dist/agent/actions.d.ts +66 -0
- package/dist/agent/actions.d.ts.map +1 -0
- package/dist/agent/actions.js +82 -0
- package/dist/agent/actions.js.map +1 -0
- package/dist/agent/ai-sdk.d.ts +16 -0
- package/dist/agent/ai-sdk.d.ts.map +1 -0
- package/dist/agent/ai-sdk.js +59 -0
- package/dist/agent/ai-sdk.js.map +1 -0
- package/dist/agent/call-options.d.ts +10 -0
- package/dist/agent/call-options.d.ts.map +1 -0
- package/dist/agent/call-options.js +28 -0
- package/dist/agent/call-options.js.map +1 -0
- package/dist/agent/default-agent.d.ts +22 -0
- package/dist/agent/default-agent.d.ts.map +1 -0
- package/dist/agent/default-agent.js +354 -0
- package/dist/agent/default-agent.js.map +1 -0
- package/dist/agent/error.d.ts +53 -0
- package/dist/agent/error.d.ts.map +1 -0
- package/dist/agent/error.js +94 -0
- package/dist/agent/error.js.map +1 -0
- package/dist/agent/executor.d.ts +238 -0
- package/dist/agent/executor.d.ts.map +1 -0
- package/dist/agent/executor.js +56 -0
- package/dist/agent/executor.js.map +1 -0
- package/dist/agent/index.d.ts +15 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +304 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/invocation.d.ts +194 -0
- package/dist/agent/invocation.d.ts.map +1 -0
- package/dist/agent/invocation.js +389 -0
- package/dist/agent/invocation.js.map +1 -0
- package/dist/agent/ledger.d.ts +24 -0
- package/dist/agent/ledger.d.ts.map +1 -0
- package/dist/agent/ledger.js +48 -0
- package/dist/agent/ledger.js.map +1 -0
- package/dist/agent/loop-guards.d.ts +35 -0
- package/dist/agent/loop-guards.d.ts.map +1 -0
- package/dist/agent/loop-guards.js +110 -0
- package/dist/agent/loop-guards.js.map +1 -0
- package/dist/agent/model/adapter.d.ts +97 -0
- package/dist/agent/model/adapter.d.ts.map +1 -0
- package/dist/agent/model/adapter.js +40 -0
- package/dist/agent/model/adapter.js.map +1 -0
- package/dist/agent/model/router.d.ts +36 -0
- package/dist/agent/model/router.d.ts.map +1 -0
- package/dist/agent/model/router.js +45 -0
- package/dist/agent/model/router.js.map +1 -0
- package/dist/agent/model/schema.d.ts +16 -0
- package/dist/agent/model/schema.d.ts.map +1 -0
- package/dist/agent/model/schema.js +37 -0
- package/dist/agent/model/schema.js.map +1 -0
- package/dist/agent/model/sdk.d.ts +28 -0
- package/dist/agent/model/sdk.d.ts.map +1 -0
- package/dist/agent/model/sdk.js +258 -0
- package/dist/agent/model/sdk.js.map +1 -0
- package/dist/agent/observation.d.ts +70 -0
- package/dist/agent/observation.d.ts.map +1 -0
- package/dist/agent/observation.js +174 -0
- package/dist/agent/observation.js.map +1 -0
- package/dist/agent/phases.d.ts +71 -0
- package/dist/agent/phases.d.ts.map +1 -0
- package/dist/agent/phases.js +124 -0
- package/dist/agent/phases.js.map +1 -0
- package/dist/agent/prompts.d.ts +40 -0
- package/dist/agent/prompts.d.ts.map +1 -0
- package/dist/agent/prompts.js +104 -0
- package/dist/agent/prompts.js.map +1 -0
- package/dist/agent/protocol.d.ts +31 -0
- package/dist/agent/protocol.d.ts.map +1 -0
- package/dist/agent/protocol.js +67 -0
- package/dist/agent/protocol.js.map +1 -0
- package/dist/agent/public.d.ts +12 -0
- package/dist/agent/public.d.ts.map +1 -0
- package/dist/agent/public.js +12 -0
- package/dist/agent/public.js.map +1 -0
- package/dist/agent/replay.d.ts +61 -0
- package/dist/agent/replay.d.ts.map +1 -0
- package/dist/agent/replay.js +185 -0
- package/dist/agent/replay.js.map +1 -0
- package/dist/agent/secrets.d.ts +22 -0
- package/dist/agent/secrets.d.ts.map +1 -0
- package/dist/agent/secrets.js +63 -0
- package/dist/agent/secrets.js.map +1 -0
- package/dist/agent/step-cache.d.ts +156 -0
- package/dist/agent/step-cache.d.ts.map +1 -0
- package/dist/agent/step-cache.js +301 -0
- package/dist/agent/step-cache.js.map +1 -0
- package/dist/agent/tool-loop.d.ts +51 -0
- package/dist/agent/tool-loop.d.ts.map +1 -0
- package/dist/agent/tool-loop.js +331 -0
- package/dist/agent/tool-loop.js.map +1 -0
- package/dist/agent/tool.d.ts +39 -0
- package/dist/agent/tool.d.ts.map +1 -0
- package/dist/agent/tool.js +52 -0
- package/dist/agent/tool.js.map +1 -0
- package/dist/backend/contract.d.ts +186 -0
- package/dist/backend/contract.d.ts.map +1 -0
- package/dist/backend/contract.js +65 -0
- package/dist/backend/contract.js.map +1 -0
- package/dist/backend/index.d.ts +316 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +219 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/session.d.ts +23 -0
- package/dist/backend/session.d.ts.map +1 -0
- package/dist/backend/session.js +213 -0
- package/dist/backend/session.js.map +1 -0
- package/dist/backend/surface.d.ts +83 -0
- package/dist/backend/surface.d.ts.map +1 -0
- package/dist/backend/surface.js +11 -0
- package/dist/backend/surface.js.map +1 -0
- package/dist/cache/anchors.d.ts +37 -0
- package/dist/cache/anchors.d.ts.map +1 -0
- package/dist/cache/anchors.js +89 -0
- package/dist/cache/anchors.js.map +1 -0
- package/dist/cache/context.d.ts +74 -0
- package/dist/cache/context.d.ts.map +1 -0
- package/dist/cache/context.js +82 -0
- package/dist/cache/context.js.map +1 -0
- package/dist/cache/decide.d.ts +42 -0
- package/dist/cache/decide.d.ts.map +1 -0
- package/dist/cache/decide.js +47 -0
- package/dist/cache/decide.js.map +1 -0
- package/dist/cache/identity.d.ts +113 -0
- package/dist/cache/identity.d.ts.map +1 -0
- package/dist/cache/identity.js +109 -0
- package/dist/cache/identity.js.map +1 -0
- package/dist/cache/recorder.d.ts +76 -0
- package/dist/cache/recorder.d.ts.map +1 -0
- package/dist/cache/recorder.js +143 -0
- package/dist/cache/recorder.js.map +1 -0
- package/dist/cache/relocate.d.ts +69 -0
- package/dist/cache/relocate.d.ts.map +1 -0
- package/dist/cache/relocate.js +125 -0
- package/dist/cache/relocate.js.map +1 -0
- package/dist/cache/store.d.ts +68 -0
- package/dist/cache/store.d.ts.map +1 -0
- package/dist/cache/store.js +106 -0
- package/dist/cache/store.js.map +1 -0
- package/dist/cache/trace.d.ts +146 -0
- package/dist/cache/trace.d.ts.map +1 -0
- package/dist/cache/trace.js +249 -0
- package/dist/cache/trace.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +4 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +108 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +6 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +101 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/collect/collect.d.ts +44 -0
- package/dist/collect/collect.d.ts.map +1 -0
- package/dist/collect/collect.js +89 -0
- package/dist/collect/collect.js.map +1 -0
- package/dist/collect/registry.d.ts +47 -0
- package/dist/collect/registry.d.ts.map +1 -0
- package/dist/collect/registry.js +262 -0
- package/dist/collect/registry.js.map +1 -0
- package/dist/collect/select.d.ts +54 -0
- package/dist/collect/select.d.ts.map +1 -0
- package/dist/collect/select.js +230 -0
- package/dist/collect/select.js.map +1 -0
- package/dist/config/agent.d.ts +91 -0
- package/dist/config/agent.d.ts.map +1 -0
- package/dist/config/agent.js +232 -0
- package/dist/config/agent.js.map +1 -0
- package/dist/config/load.d.ts +23 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +75 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/resolve.d.ts +94 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/resolve.js +500 -0
- package/dist/config/resolve.js.map +1 -0
- package/dist/config/validate.d.ts +6 -0
- package/dist/config/validate.d.ts.map +1 -0
- package/dist/config/validate.js +21 -0
- package/dist/config/validate.js.map +1 -0
- package/dist/credentials.d.ts +7 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +42 -0
- package/dist/credentials.js.map +1 -0
- package/dist/expect/async.d.ts +5 -0
- package/dist/expect/async.d.ts.map +1 -0
- package/dist/expect/async.js +186 -0
- package/dist/expect/async.js.map +1 -0
- package/dist/expect/index.d.ts +7 -0
- package/dist/expect/index.d.ts.map +1 -0
- package/dist/expect/index.js +23 -0
- package/dist/expect/index.js.map +1 -0
- package/dist/expect/values.d.ts +4 -0
- package/dist/expect/values.d.ts.map +1 -0
- package/dist/expect/values.js +108 -0
- package/dist/expect/values.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/ai-trace.d.ts +151 -0
- package/dist/internal/ai-trace.d.ts.map +1 -0
- package/dist/internal/ai-trace.js +360 -0
- package/dist/internal/ai-trace.js.map +1 -0
- package/dist/internal/brands.d.ts +9 -0
- package/dist/internal/brands.d.ts.map +1 -0
- package/dist/internal/brands.js +9 -0
- package/dist/internal/brands.js.map +1 -0
- package/dist/internal/debug.d.ts +43 -0
- package/dist/internal/debug.d.ts.map +1 -0
- package/dist/internal/debug.js +102 -0
- package/dist/internal/debug.js.map +1 -0
- package/dist/internal/errors.d.ts +98 -0
- package/dist/internal/errors.d.ts.map +1 -0
- package/dist/internal/errors.js +212 -0
- package/dist/internal/errors.js.map +1 -0
- package/dist/internal/globs.d.ts +29 -0
- package/dist/internal/globs.d.ts.map +1 -0
- package/dist/internal/globs.js +126 -0
- package/dist/internal/globs.js.map +1 -0
- package/dist/internal/ids.d.ts +32 -0
- package/dist/internal/ids.d.ts.map +1 -0
- package/dist/internal/ids.js +124 -0
- package/dist/internal/ids.js.map +1 -0
- package/dist/internal/json-value.d.ts +15 -0
- package/dist/internal/json-value.d.ts.map +1 -0
- package/dist/internal/json-value.js +61 -0
- package/dist/internal/json-value.js.map +1 -0
- package/dist/internal/package-version.d.ts +6 -0
- package/dist/internal/package-version.d.ts.map +1 -0
- package/dist/internal/package-version.js +14 -0
- package/dist/internal/package-version.js.map +1 -0
- package/dist/internal/realm-slot.d.ts +13 -0
- package/dist/internal/realm-slot.d.ts.map +1 -0
- package/dist/internal/realm-slot.js +23 -0
- package/dist/internal/realm-slot.js.map +1 -0
- package/dist/internal/redact.d.ts +33 -0
- package/dist/internal/redact.d.ts.map +1 -0
- package/dist/internal/redact.js +56 -0
- package/dist/internal/redact.js.map +1 -0
- package/dist/internal/regexp.d.ts +10 -0
- package/dist/internal/regexp.d.ts.map +1 -0
- package/dist/internal/regexp.js +27 -0
- package/dist/internal/regexp.js.map +1 -0
- package/dist/internal/text.d.ts +39 -0
- package/dist/internal/text.d.ts.map +1 -0
- package/dist/internal/text.js +66 -0
- package/dist/internal/text.js.map +1 -0
- package/dist/internal/time.d.ts +37 -0
- package/dist/internal/time.d.ts.map +1 -0
- package/dist/internal/time.js +91 -0
- package/dist/internal/time.js.map +1 -0
- package/dist/internal/trace.d.ts +18 -0
- package/dist/internal/trace.d.ts.map +1 -0
- package/dist/internal/trace.js +46 -0
- package/dist/internal/trace.js.map +1 -0
- package/dist/internal/urls.d.ts +31 -0
- package/dist/internal/urls.d.ts.map +1 -0
- package/dist/internal/urls.js +95 -0
- package/dist/internal/urls.js.map +1 -0
- package/dist/locator/engine.d.ts +65 -0
- package/dist/locator/engine.d.ts.map +1 -0
- package/dist/locator/engine.js +164 -0
- package/dist/locator/engine.js.map +1 -0
- package/dist/locator/expression.d.ts +19 -0
- package/dist/locator/expression.d.ts.map +1 -0
- package/dist/locator/expression.js +85 -0
- package/dist/locator/expression.js.map +1 -0
- package/dist/locator/screen.d.ts +36 -0
- package/dist/locator/screen.d.ts.map +1 -0
- package/dist/locator/screen.js +281 -0
- package/dist/locator/screen.js.map +1 -0
- package/dist/report/build.d.ts +214 -0
- package/dist/report/build.d.ts.map +1 -0
- package/dist/report/build.js +346 -0
- package/dist/report/build.js.map +1 -0
- package/dist/report/code-frame.d.ts +20 -0
- package/dist/report/code-frame.d.ts.map +1 -0
- package/dist/report/code-frame.js +73 -0
- package/dist/report/code-frame.js.map +1 -0
- package/dist/report/debug-steps.d.ts +14 -0
- package/dist/report/debug-steps.d.ts.map +1 -0
- package/dist/report/debug-steps.js +85 -0
- package/dist/report/debug-steps.js.map +1 -0
- package/dist/report/list.d.ts +80 -0
- package/dist/report/list.d.ts.map +1 -0
- package/dist/report/list.js +372 -0
- package/dist/report/list.js.map +1 -0
- package/dist/report/live-status.d.ts +51 -0
- package/dist/report/live-status.d.ts.map +1 -0
- package/dist/report/live-status.js +162 -0
- package/dist/report/live-status.js.map +1 -0
- package/dist/report/write.d.ts +4 -0
- package/dist/report/write.d.ts.map +1 -0
- package/dist/report/write.js +13 -0
- package/dist/report/write.js.map +1 -0
- package/dist/run/app-process.d.ts +18 -0
- package/dist/run/app-process.d.ts.map +1 -0
- package/dist/run/app-process.js +112 -0
- package/dist/run/app-process.js.map +1 -0
- package/dist/run/artifacts.d.ts +51 -0
- package/dist/run/artifacts.d.ts.map +1 -0
- package/dist/run/artifacts.js +114 -0
- package/dist/run/artifacts.js.map +1 -0
- package/dist/run/events.d.ts +100 -0
- package/dist/run/events.d.ts.map +1 -0
- package/dist/run/events.js +59 -0
- package/dist/run/events.js.map +1 -0
- package/dist/run/execute.d.ts +119 -0
- package/dist/run/execute.d.ts.map +1 -0
- package/dist/run/execute.js +555 -0
- package/dist/run/execute.js.map +1 -0
- package/dist/run/fixtures.d.ts +40 -0
- package/dist/run/fixtures.d.ts.map +1 -0
- package/dist/run/fixtures.js +408 -0
- package/dist/run/fixtures.js.map +1 -0
- package/dist/run/in-process.d.ts +24 -0
- package/dist/run/in-process.d.ts.map +1 -0
- package/dist/run/in-process.js +120 -0
- package/dist/run/in-process.js.map +1 -0
- package/dist/run/public.d.ts +19 -0
- package/dist/run/public.d.ts.map +1 -0
- package/dist/run/public.js +11 -0
- package/dist/run/public.js.map +1 -0
- package/dist/run/realm.d.ts +52 -0
- package/dist/run/realm.d.ts.map +1 -0
- package/dist/run/realm.js +101 -0
- package/dist/run/realm.js.map +1 -0
- package/dist/run/records.d.ts +87 -0
- package/dist/run/records.d.ts.map +1 -0
- package/dist/run/records.js +3 -0
- package/dist/run/records.js.map +1 -0
- package/dist/run/retry.d.ts +18 -0
- package/dist/run/retry.d.ts.map +1 -0
- package/dist/run/retry.js +33 -0
- package/dist/run/retry.js.map +1 -0
- package/dist/run/runner.d.ts +49 -0
- package/dist/run/runner.d.ts.map +1 -0
- package/dist/run/runner.js +375 -0
- package/dist/run/runner.js.map +1 -0
- package/dist/run/scheduler.d.ts +45 -0
- package/dist/run/scheduler.d.ts.map +1 -0
- package/dist/run/scheduler.js +512 -0
- package/dist/run/scheduler.js.map +1 -0
- package/dist/run/serial.d.ts +52 -0
- package/dist/run/serial.d.ts.map +1 -0
- package/dist/run/serial.js +247 -0
- package/dist/run/serial.js.map +1 -0
- package/dist/run/sessions.d.ts +54 -0
- package/dist/run/sessions.d.ts.map +1 -0
- package/dist/run/sessions.js +221 -0
- package/dist/run/sessions.js.map +1 -0
- package/dist/run/steps.d.ts +196 -0
- package/dist/run/steps.d.ts.map +1 -0
- package/dist/run/steps.js +151 -0
- package/dist/run/steps.js.map +1 -0
- package/dist/run/unit-runner.d.ts +30 -0
- package/dist/run/unit-runner.d.ts.map +1 -0
- package/dist/run/unit-runner.js +11 -0
- package/dist/run/unit-runner.js.map +1 -0
- package/dist/run/units.d.ts +50 -0
- package/dist/run/units.d.ts.map +1 -0
- package/dist/run/units.js +103 -0
- package/dist/run/units.js.map +1 -0
- package/dist/run/worker/entry.d.ts +8 -0
- package/dist/run/worker/entry.d.ts.map +1 -0
- package/dist/run/worker/entry.js +137 -0
- package/dist/run/worker/entry.js.map +1 -0
- package/dist/run/worker/handle.d.ts +10 -0
- package/dist/run/worker/handle.d.ts.map +1 -0
- package/dist/run/worker/handle.js +74 -0
- package/dist/run/worker/handle.js.map +1 -0
- package/dist/run/worker/protocol.d.ts +129 -0
- package/dist/run/worker/protocol.d.ts.map +1 -0
- package/dist/run/worker/protocol.js +18 -0
- package/dist/run/worker/protocol.js.map +1 -0
- package/dist/run/worker/session.d.ts +69 -0
- package/dist/run/worker/session.d.ts.map +1 -0
- package/dist/run/worker/session.js +123 -0
- package/dist/run/worker/session.js.map +1 -0
- package/dist/types.d.ts +630 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/internal/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACnD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACrC,IACE,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;YAC9B,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;YAC9B,CAAC,IAAI,IAAI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2
|
+
* The one JSON-safety walker. Anything crossing a boundary that demands plain
|
|
3
|
+
* JSON — fixture evaluation arguments and results, `agent.act` params — validates
|
|
4
|
+
* here, so cycle detection, plain-prototype checks, and secret rejection
|
|
5
|
+
* cannot drift between call sites.
|
|
6
|
+
*/
|
|
7
|
+
export interface JsonValueRules {
|
|
8
|
+
/** Raised on a Secret value; the default denies with POLICY_DENIED. */
|
|
9
|
+
readonly onSecret?: (label: string) => never;
|
|
10
|
+
/** Maximum object/array nesting depth; unlimited when omitted. */
|
|
11
|
+
readonly maxDepth?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Validates that a value is JSON-safe, throwing a labeled TestError otherwise. */
|
|
14
|
+
export declare function validateJsonValue(value: unknown, label: string, rules?: JsonValueRules): void;
|
|
15
|
+
//# sourceMappingURL=json-value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-value.d.ts","sourceRoot":"","sources":["../../src/internal/json-value.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC;IAC7C,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,cAAmB,GAAG,IAAI,CAqDjG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one JSON-safety walker. Anything crossing a boundary that demands plain
|
|
3
|
+
* JSON — fixture evaluation arguments and results, `agent.act` params — validates
|
|
4
|
+
* here, so cycle detection, plain-prototype checks, and secret rejection
|
|
5
|
+
* cannot drift between call sites.
|
|
6
|
+
*/
|
|
7
|
+
import { isSecret } from '../locator/screen.js';
|
|
8
|
+
import { ConfigurationError, TestError } from './errors.js';
|
|
9
|
+
/** Validates that a value is JSON-safe, throwing a labeled TestError otherwise. */
|
|
10
|
+
export function validateJsonValue(value, label, rules = {}) {
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
return;
|
|
13
|
+
const onSecret = rules.onSecret ??
|
|
14
|
+
((at) => {
|
|
15
|
+
throw new ConfigurationError('POLICY_DENIED', `${at} must not contain a Secret`);
|
|
16
|
+
});
|
|
17
|
+
// The ancestor path of the value being visited. Only an object that
|
|
18
|
+
// contains itself is a cycle; the same object reachable twice by different
|
|
19
|
+
// paths is an ordinary, serializable DAG.
|
|
20
|
+
const ancestors = new Set();
|
|
21
|
+
const visit = (item, depth = 0) => {
|
|
22
|
+
if (rules.maxDepth !== undefined && depth > rules.maxDepth) {
|
|
23
|
+
throw new TestError('INVALID_ARGUMENT', `${label} exceeds ${rules.maxDepth} levels of nesting`);
|
|
24
|
+
}
|
|
25
|
+
if (item === null)
|
|
26
|
+
return;
|
|
27
|
+
switch (typeof item) {
|
|
28
|
+
case 'string':
|
|
29
|
+
case 'boolean':
|
|
30
|
+
return;
|
|
31
|
+
case 'number':
|
|
32
|
+
if (!Number.isFinite(item)) {
|
|
33
|
+
throw new TestError('INVALID_ARGUMENT', `${label} contains a non-finite number`);
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
case 'object': {
|
|
37
|
+
if (isSecret(item)) {
|
|
38
|
+
onSecret(label);
|
|
39
|
+
}
|
|
40
|
+
if (ancestors.has(item)) {
|
|
41
|
+
throw new TestError('INVALID_ARGUMENT', `${label} contains a cycle`);
|
|
42
|
+
}
|
|
43
|
+
if (!Array.isArray(item) &&
|
|
44
|
+
Object.getPrototypeOf(item) !== Object.prototype &&
|
|
45
|
+
Object.getPrototypeOf(item) !== null) {
|
|
46
|
+
throw new TestError('INVALID_ARGUMENT', `${label} must be JSON-safe`);
|
|
47
|
+
}
|
|
48
|
+
ancestors.add(item);
|
|
49
|
+
const entries = Array.isArray(item) ? item : Object.values(item);
|
|
50
|
+
for (const entry of entries)
|
|
51
|
+
visit(entry, depth + 1);
|
|
52
|
+
ancestors.delete(item);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
default:
|
|
56
|
+
throw new TestError('INVALID_ARGUMENT', `${label} must be JSON-safe, found ${typeof item}`);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
visit(value);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=json-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-value.js","sourceRoot":"","sources":["../../src/internal/json-value.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS5D,mFAAmF;AACnF,MAAM,UAAU,iBAAiB,CAAC,KAAc,EAAE,KAAa,EAAE,KAAK,GAAmB,EAAE;IACzF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO;IAChC,MAAM,QAAQ,GACZ,KAAK,CAAC,QAAQ;QACd,CAAC,CAAC,EAAU,EAAS,EAAE;YACrB,MAAM,IAAI,kBAAkB,CAAC,eAAe,EAAE,GAAG,EAAE,4BAA4B,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,oEAAoE;IACpE,2EAA2E;IAC3E,0CAA0C;IAC1C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAW,CAAC;IACrC,MAAM,KAAK,GAAG,CAAC,IAAa,EAAE,KAAK,GAAG,CAAC,EAAQ,EAAE;QAC/C,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC3D,MAAM,IAAI,SAAS,CACjB,kBAAkB,EAClB,GAAG,KAAK,YAAY,KAAK,CAAC,QAAQ,oBAAoB,CACvD,CAAC;QACJ,CAAC;QACD,IAAI,IAA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AAC;YACD;gBACE,MAAM,IAAI,SAAS,CAAC,kBAAkB,EAAE,GAAG,KAAK,6BAA6B,OAAO,IAAI,EAAE,CAAC,CAAC;QAChG,CAAC;IACH,CAAC,CAAC;IACF,KAAK,CAAC,KAAK,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads a package.json version through require resolution relative to the
|
|
3
|
+
* caller's module URL, falling back when the package cannot be resolved.
|
|
4
|
+
*/
|
|
5
|
+
export declare function packageVersion(fromUrl: string, specifier: string, fallback: string): string;
|
|
6
|
+
//# sourceMappingURL=package-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-version.d.ts","sourceRoot":"","sources":["../../src/internal/package-version.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM3F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
/**
|
|
3
|
+
* Reads a package.json version through require resolution relative to the
|
|
4
|
+
* caller's module URL, falling back when the package cannot be resolved.
|
|
5
|
+
*/
|
|
6
|
+
export function packageVersion(fromUrl, specifier, fallback) {
|
|
7
|
+
try {
|
|
8
|
+
return createRequire(fromUrl)(specifier).version;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return fallback;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=package-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-version.js","sourceRoot":"","sources":["../../src/internal/package-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,SAAiB,EAAE,QAAgB;IACjF,IAAI,CAAC;QACH,OAAQ,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,CAAyB,CAAC,OAAO,CAAC;IAC5E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed accessor for a `Symbol.for` slot on a host object. Test modules load
|
|
3
|
+
* in isolated module realms (tsx), so runner-owned instances are shared
|
|
4
|
+
* through registry symbols instead of module state. All unsafe reads live
|
|
5
|
+
* here; call sites stay fully typed.
|
|
6
|
+
*/
|
|
7
|
+
export interface RealmSlot<T> {
|
|
8
|
+
set(host: object, value: T): void;
|
|
9
|
+
get(host: unknown): T | undefined;
|
|
10
|
+
delete(host: object): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function realmSlot<T>(key: string | symbol): RealmSlot<T>;
|
|
13
|
+
//# sourceMappingURL=realm-slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realm-slot.d.ts","sourceRoot":"","sources":["../../src/internal/realm-slot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAClC,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,CAAC,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAqB/D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function realmSlot(key) {
|
|
2
|
+
const symbol = typeof key === 'symbol' ? key : Symbol.for(key);
|
|
3
|
+
return {
|
|
4
|
+
set(host, value) {
|
|
5
|
+
Object.defineProperty(host, symbol, {
|
|
6
|
+
value,
|
|
7
|
+
enumerable: false,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: false,
|
|
10
|
+
});
|
|
11
|
+
},
|
|
12
|
+
get(host) {
|
|
13
|
+
if ((typeof host !== 'object' || host === null) && typeof host !== 'function') {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
return host[symbol];
|
|
17
|
+
},
|
|
18
|
+
delete(host) {
|
|
19
|
+
delete host[symbol];
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=realm-slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realm-slot.js","sourceRoot":"","sources":["../../src/internal/realm-slot.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,SAAS,CAAI,GAAoB;IAC/C,MAAM,MAAM,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/D,OAAO;QACL,GAAG,CAAC,IAAI,EAAE,KAAK;YACb,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;gBAClC,KAAK;gBACL,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,KAAK;aAChB,CAAC,CAAC;QACL,CAAC;QACD,GAAG,CAAC,IAAI;YACN,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;gBAC9E,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAQ,IAAqC,CAAC,MAAM,CAAkB,CAAC;QACzE,CAAC;QACD,MAAM,CAAC,IAAI;YACT,OAAQ,IAAqC,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Runner-side secret redaction (spec 14-security.md). */
|
|
2
|
+
/**
|
|
3
|
+
* Builds a redactor replacing every exact registered secret value with its
|
|
4
|
+
* stable secret name.
|
|
5
|
+
*
|
|
6
|
+
* Longer values are substituted first, so a secret that contains another secret
|
|
7
|
+
* is not left half-rewritten.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createRedactor(secrets: Iterable<readonly [string, string]>): (text: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* The attempt's registered secret values and their redactor, in one owner.
|
|
12
|
+
*
|
|
13
|
+
* Static credential passwords are known up front; a provider-backed value
|
|
14
|
+
* exists only once the resolver produces it at fill time. Registration
|
|
15
|
+
* invalidates the memoized redactor, so every consumer holding `redact` sees
|
|
16
|
+
* a value the moment it exists — liveness is structural, not a comment on a
|
|
17
|
+
* shared map.
|
|
18
|
+
*/
|
|
19
|
+
export declare class SecretLedger {
|
|
20
|
+
/**
|
|
21
|
+
* Every value ever registered, not just the newest per name: a rotating
|
|
22
|
+
* secret (a fresh TOTP per fill) leaves its earlier codes on screen and in
|
|
23
|
+
* captures, and an earlier value that stopped redacting would leak there.
|
|
24
|
+
*/
|
|
25
|
+
private readonly values;
|
|
26
|
+
private redactor;
|
|
27
|
+
constructor(initial?: Iterable<readonly [string, string]>);
|
|
28
|
+
/** Registers one resolved value; earlier values for the name keep redacting. */
|
|
29
|
+
register(name: string, value: string): void;
|
|
30
|
+
/** Bound so it can be handed out as a plain function. */
|
|
31
|
+
readonly redact: (text: string) => string;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/internal/redact.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC3C,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAU1B;AAED;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACvB;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IACjD,OAAO,CAAC,QAAQ,CAAyC;IAEzD,YAAY,OAAO,GAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,EAE5D;IAED,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAI1C;IAED,yDAAyD;IACzD,QAAQ,CAAC,MAAM,SAAU,MAAM,KAAG,MAAM,CAGtC;CACH"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Runner-side secret redaction (spec 14-security.md). */
|
|
2
|
+
/**
|
|
3
|
+
* Builds a redactor replacing every exact registered secret value with its
|
|
4
|
+
* stable secret name.
|
|
5
|
+
*
|
|
6
|
+
* Longer values are substituted first, so a secret that contains another secret
|
|
7
|
+
* is not left half-rewritten.
|
|
8
|
+
*/
|
|
9
|
+
export function createRedactor(secrets) {
|
|
10
|
+
const entries = [...secrets]
|
|
11
|
+
.filter(([, value]) => value.length > 0)
|
|
12
|
+
.toSorted((a, b) => b[1].length - a[1].length);
|
|
13
|
+
if (entries.length === 0)
|
|
14
|
+
return (text) => text;
|
|
15
|
+
return (text) => {
|
|
16
|
+
let out = text;
|
|
17
|
+
for (const [name, value] of entries)
|
|
18
|
+
out = out.split(value).join(`<secret:${name}>`);
|
|
19
|
+
return out;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The attempt's registered secret values and their redactor, in one owner.
|
|
24
|
+
*
|
|
25
|
+
* Static credential passwords are known up front; a provider-backed value
|
|
26
|
+
* exists only once the resolver produces it at fill time. Registration
|
|
27
|
+
* invalidates the memoized redactor, so every consumer holding `redact` sees
|
|
28
|
+
* a value the moment it exists — liveness is structural, not a comment on a
|
|
29
|
+
* shared map.
|
|
30
|
+
*/
|
|
31
|
+
export class SecretLedger {
|
|
32
|
+
/**
|
|
33
|
+
* Every value ever registered, not just the newest per name: a rotating
|
|
34
|
+
* secret (a fresh TOTP per fill) leaves its earlier codes on screen and in
|
|
35
|
+
* captures, and an earlier value that stopped redacting would leak there.
|
|
36
|
+
*/
|
|
37
|
+
values = [];
|
|
38
|
+
redactor;
|
|
39
|
+
constructor(initial = []) {
|
|
40
|
+
for (const [name, value] of initial)
|
|
41
|
+
this.register(name, value);
|
|
42
|
+
}
|
|
43
|
+
/** Registers one resolved value; earlier values for the name keep redacting. */
|
|
44
|
+
register(name, value) {
|
|
45
|
+
if (this.values.some(([n, v]) => n === name && v === value))
|
|
46
|
+
return;
|
|
47
|
+
this.values.push([name, value]);
|
|
48
|
+
this.redactor = undefined;
|
|
49
|
+
}
|
|
50
|
+
/** Bound so it can be handed out as a plain function. */
|
|
51
|
+
redact = (text) => {
|
|
52
|
+
this.redactor ??= createRedactor(this.values);
|
|
53
|
+
return this.redactor(text);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/internal/redact.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA4C;IAE5C,MAAM,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC;SACzB,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;SACvC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,OAAO,CAAC,MAAM,KAAK,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ular-expression plumbing for the glob, text, and URL matchers. */
|
|
2
|
+
/** Escapes one character for literal use inside a regexp source. */
|
|
3
|
+
export declare function escapeRegexpChar(ch: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Tests input against a wire regexp (source + flags). Compiled patterns are
|
|
6
|
+
* cached by source and flags; `lastIndex` is reset before every test, so
|
|
7
|
+
* sticky/global state can never leak between matches.
|
|
8
|
+
*/
|
|
9
|
+
export declare function testPattern(source: string, flags: string, input: string): boolean;
|
|
10
|
+
//# sourceMappingURL=regexp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexp.d.ts","sourceRoot":"","sources":["../../src/internal/regexp.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEnD;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAYjF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Shared regular-expression plumbing for the glob, text, and URL matchers. */
|
|
2
|
+
/** Escapes one character for literal use inside a regexp source. */
|
|
3
|
+
export function escapeRegexpChar(ch) {
|
|
4
|
+
return /[a-zA-Z0-9_-]/.test(ch) ? ch : `\\${ch}`;
|
|
5
|
+
}
|
|
6
|
+
/** Compiled wire patterns, bounded; assertion polls test the same pattern many times a second. */
|
|
7
|
+
const MAX_CACHED_PATTERNS = 256;
|
|
8
|
+
const compiled = new Map();
|
|
9
|
+
/**
|
|
10
|
+
* Tests input against a wire regexp (source + flags). Compiled patterns are
|
|
11
|
+
* cached by source and flags; `lastIndex` is reset before every test, so
|
|
12
|
+
* sticky/global state can never leak between matches.
|
|
13
|
+
*/
|
|
14
|
+
export function testPattern(source, flags, input) {
|
|
15
|
+
const key = `${flags}\n${source}`;
|
|
16
|
+
let pattern = compiled.get(key);
|
|
17
|
+
if (pattern === undefined) {
|
|
18
|
+
pattern = new RegExp(source, flags);
|
|
19
|
+
if (compiled.size >= MAX_CACHED_PATTERNS) {
|
|
20
|
+
compiled.delete(compiled.keys().next().value);
|
|
21
|
+
}
|
|
22
|
+
compiled.set(key, pattern);
|
|
23
|
+
}
|
|
24
|
+
pattern.lastIndex = 0;
|
|
25
|
+
return pattern.test(input);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=regexp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexp.js","sourceRoot":"","sources":["../../src/internal/regexp.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,oEAAoE;AACpE,MAAM,UAAU,gBAAgB,CAAC,EAAU;IACzC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;AACnD,CAAC;AAED,kGAAkG;AAClG,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE3C;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,KAAa,EAAE,KAAa;IACtE,MAAM,GAAG,GAAG,GAAG,KAAK,KAAK,MAAM,EAAE,CAAC;IAClC,IAAI,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACpC,IAAI,QAAQ,CAAC,IAAI,IAAI,mBAAmB,EAAE,CAAC;YACzC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAe,CAAC,CAAC;QAC1D,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC;IACtB,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Text normalization and matching rules (spec 03-assertions.md, 08-platforms.md). */
|
|
2
|
+
import type { TextMatch } from '../types.ts';
|
|
3
|
+
export type TextPattern = {
|
|
4
|
+
readonly kind: 'string';
|
|
5
|
+
readonly value: string;
|
|
6
|
+
readonly exact: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'regexp';
|
|
9
|
+
readonly source: string;
|
|
10
|
+
readonly flags: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Normalizes text by trimming leading/trailing whitespace and replacing every
|
|
14
|
+
* nonempty run of Unicode whitespace with one ASCII space.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeText(text: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Normalizes text that may carry control characters: sanitized first, then
|
|
19
|
+
* whitespace-collapsed. The one-line form of screen text that reaches models,
|
|
20
|
+
* trace descriptors, and terminals.
|
|
21
|
+
*/
|
|
22
|
+
export declare function collapseText(text: string): string;
|
|
23
|
+
/** Converts a public TextMatch plus options into the wire TextPattern form. */
|
|
24
|
+
export declare function toTextPattern(match: TextMatch, options?: {
|
|
25
|
+
exact?: boolean;
|
|
26
|
+
}): TextPattern;
|
|
27
|
+
/** Sorts and de-duplicates regexp flags into canonical d,g,i,m,s,u,v,y order. */
|
|
28
|
+
export declare function normalizeRegexpFlags(flags: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Matches normalized text against a pattern. String matching is exact by
|
|
31
|
+
* default; `exact: false` is case-insensitive substring matching. Regular
|
|
32
|
+
* expressions use ECMAScript semantics with lastIndex reset before every match.
|
|
33
|
+
*/
|
|
34
|
+
export declare function matchesText(actual: string, pattern: TextPattern): boolean;
|
|
35
|
+
/** Substring/regexp containment matching used by toContainText. */
|
|
36
|
+
export declare function containsText(actual: string, pattern: TextPattern): boolean;
|
|
37
|
+
/** Renders a pattern for diagnostics. */
|
|
38
|
+
export declare function describePattern(pattern: TextPattern): string;
|
|
39
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/internal/text.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC5E;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAGjF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,WAAW,CAK1F;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAEzE;AAED,mEAAmE;AACnE,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAE1E;AAkBD,yCAAyC;AACzC,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAG5D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** Text normalization and matching rules (spec 03-assertions.md, 08-platforms.md). */
|
|
2
|
+
import { sanitizeText } from './errors.js';
|
|
3
|
+
import { testPattern } from './regexp.js';
|
|
4
|
+
/**
|
|
5
|
+
* Normalizes text by trimming leading/trailing whitespace and replacing every
|
|
6
|
+
* nonempty run of Unicode whitespace with one ASCII space.
|
|
7
|
+
*/
|
|
8
|
+
export function normalizeText(text) {
|
|
9
|
+
return text.replace(/\s+/gu, ' ').trim();
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Normalizes text that may carry control characters: sanitized first, then
|
|
13
|
+
* whitespace-collapsed. The one-line form of screen text that reaches models,
|
|
14
|
+
* trace descriptors, and terminals.
|
|
15
|
+
*/
|
|
16
|
+
export function collapseText(text) {
|
|
17
|
+
return normalizeText(sanitizeText(text));
|
|
18
|
+
}
|
|
19
|
+
/** Converts a public TextMatch plus options into the wire TextPattern form. */
|
|
20
|
+
export function toTextPattern(match, options) {
|
|
21
|
+
if (typeof match === 'string') {
|
|
22
|
+
return { kind: 'string', value: match, exact: options?.exact ?? true };
|
|
23
|
+
}
|
|
24
|
+
return { kind: 'regexp', source: match.source, flags: normalizeRegexpFlags(match.flags) };
|
|
25
|
+
}
|
|
26
|
+
/** Sorts and de-duplicates regexp flags into canonical d,g,i,m,s,u,v,y order. */
|
|
27
|
+
export function normalizeRegexpFlags(flags) {
|
|
28
|
+
const order = ['d', 'g', 'i', 'm', 's', 'u', 'v', 'y'];
|
|
29
|
+
const present = new Set(flags.split(''));
|
|
30
|
+
return order.filter((flag) => present.has(flag)).join('');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Matches normalized text against a pattern. String matching is exact by
|
|
34
|
+
* default; `exact: false` is case-insensitive substring matching. Regular
|
|
35
|
+
* expressions use ECMAScript semantics with lastIndex reset before every match.
|
|
36
|
+
*/
|
|
37
|
+
export function matchesText(actual, pattern) {
|
|
38
|
+
return matchText(actual, pattern, 'equals');
|
|
39
|
+
}
|
|
40
|
+
/** Substring/regexp containment matching used by toContainText. */
|
|
41
|
+
export function containsText(actual, pattern) {
|
|
42
|
+
return matchText(actual, pattern, 'contains');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The one text-matching rule. `mode` applies only to exact string patterns:
|
|
46
|
+
* regexps and case-insensitive substrings read the same way in both matchers.
|
|
47
|
+
*/
|
|
48
|
+
function matchText(actual, pattern, mode) {
|
|
49
|
+
const normalizedActual = normalizeText(actual);
|
|
50
|
+
if (pattern.kind === 'regexp')
|
|
51
|
+
return testPattern(pattern.source, pattern.flags, normalizedActual);
|
|
52
|
+
const normalizedExpected = normalizeText(pattern.value);
|
|
53
|
+
if (!pattern.exact) {
|
|
54
|
+
return normalizedActual.toLowerCase().includes(normalizedExpected.toLowerCase());
|
|
55
|
+
}
|
|
56
|
+
return mode === 'equals'
|
|
57
|
+
? normalizedActual === normalizedExpected
|
|
58
|
+
: normalizedActual.includes(normalizedExpected);
|
|
59
|
+
}
|
|
60
|
+
/** Renders a pattern for diagnostics. */
|
|
61
|
+
export function describePattern(pattern) {
|
|
62
|
+
if (pattern.kind === 'string')
|
|
63
|
+
return JSON.stringify(pattern.value);
|
|
64
|
+
return `/${pattern.source}/${pattern.flags}`;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/internal/text.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAGtF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO1C;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC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,OAAoB;IAC/D,OAAO,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAChD,CAAC;AAED;;;GAGG;AACH,SAAS,SAAS,CAAC,MAAc,EAAE,OAAoB,EAAE,IAA2B;IAClF,MAAM,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACnG,MAAM,kBAAkB,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,gBAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC,WAAW,EAAE,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,IAAI,KAAK,QAAQ;QACtB,CAAC,CAAC,gBAAgB,KAAK,kBAAkB;QACzC,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AACpD,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,eAAe,CAAC,OAAoB;IAClD,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpE,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Deadline and cancellation helpers. */
|
|
2
|
+
export declare class Deadline {
|
|
3
|
+
readonly endsAt: number;
|
|
4
|
+
constructor(timeoutMs: number, now?: number);
|
|
5
|
+
/** Remaining budget in ms, never negative. */
|
|
6
|
+
remaining(now?: number): number;
|
|
7
|
+
expired(now?: number): boolean;
|
|
8
|
+
/** Returns a deadline capped by another deadline. */
|
|
9
|
+
static min(a: Deadline, b: Deadline): Deadline;
|
|
10
|
+
}
|
|
11
|
+
/** Sleeps for ms, rejecting early if the signal aborts. */
|
|
12
|
+
export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
13
|
+
/** Canonical polling cadence for locator and assertion loops. */
|
|
14
|
+
export declare const POLL_INTERVAL_MS = 100;
|
|
15
|
+
/** How long a negated assertion must hold before it passes. */
|
|
16
|
+
export declare const NEGATION_GRACE_MS = 1000;
|
|
17
|
+
export interface PollConditionOptions {
|
|
18
|
+
readonly deadline: Deadline;
|
|
19
|
+
readonly signal: AbortSignal;
|
|
20
|
+
readonly negated: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Evaluates the positive condition once. Returns undefined when the
|
|
23
|
+
* condition cannot be evaluated yet: the positive poll keeps waiting and
|
|
24
|
+
* the negation grace window resets.
|
|
25
|
+
*/
|
|
26
|
+
evaluate(): Promise<boolean | undefined>;
|
|
27
|
+
onTimeout(): Error | Promise<Error>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Polls a condition until it holds (or, when negated, until its negation has
|
|
31
|
+
* held continuously for the negation grace window), throwing the caller's
|
|
32
|
+
* error at the deadline.
|
|
33
|
+
*/
|
|
34
|
+
export declare function pollCondition(options: PollConditionOptions): Promise<void>;
|
|
35
|
+
/** Races a promise against a timeout; on timeout invokes onTimeout to build the error. */
|
|
36
|
+
export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, onTimeout: () => Error): Promise<T>;
|
|
37
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/internal/time.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAIzC,qBAAa,QAAQ;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,SAAS,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,EAEtD;IAED,8C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
this.endsAt = now + timeoutMs;
|
|
7
|
+
}
|
|
8
|
+
/** Remaining budget in ms, never negative. */
|
|
9
|
+
remaining(now = Date.now()) {
|
|
10
|
+
return Math.max(0, this.endsAt - now);
|
|
11
|
+
}
|
|
12
|
+
expired(now = Date.now()) {
|
|
13
|
+
return now >= this.endsAt;
|
|
14
|
+
}
|
|
15
|
+
/** Returns a deadline capped by another deadline. */
|
|
16
|
+
static min(a, b) {
|
|
17
|
+
return a.endsAt <= b.endsAt ? a : b;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** Sleeps for ms, rejecting early if the signal aborts. */
|
|
21
|
+
export function sleep(ms, signal) {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
if (signal?.aborted) {
|
|
24
|
+
reject(new E2EError('infrastructure', 'CANCELLED', 'operation cancelled'));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const timer = setTimeout(() => {
|
|
28
|
+
cleanup();
|
|
29
|
+
resolve();
|
|
30
|
+
}, ms);
|
|
31
|
+
const onAbort = () => {
|
|
32
|
+
cleanup();
|
|
33
|
+
reject(new E2EError('infrastructure', 'CANCELLED', 'operation cancelled'));
|
|
34
|
+
};
|
|
35
|
+
const cleanup = () => {
|
|
36
|
+
clearTimeout(timer);
|
|
37
|
+
signal?.removeEventListener('abort', onAbort);
|
|
38
|
+
};
|
|
39
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** Canonical polling cadence for locator and assertion loops. */
|
|
43
|
+
export const POLL_INTERVAL_MS = 100;
|
|
44
|
+
/** How long a negated assertion must hold before it passes. */
|
|
45
|
+
export const NEGATION_GRACE_MS = 1000;
|
|
46
|
+
/**
|
|
47
|
+
* Polls a condition until it holds (or, when negated, until its negation has
|
|
48
|
+
* held continuously for the negation grace window), throwing the caller's
|
|
49
|
+
* error at the deadline.
|
|
50
|
+
*/
|
|
51
|
+
export async function pollCondition(options) {
|
|
52
|
+
// A budget shorter than the grace window still has to be satisfiable: the
|
|
53
|
+
// negation then only needs to hold for the budget itself.
|
|
54
|
+
const grace = Math.min(NEGATION_GRACE_MS, Math.max(0, options.deadline.remaining()));
|
|
55
|
+
let negatedTrueSince;
|
|
56
|
+
for (;;) {
|
|
57
|
+
const value = await options.evaluate();
|
|
58
|
+
if (!options.negated) {
|
|
59
|
+
if (value === true)
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
else if (value === false) {
|
|
63
|
+
negatedTrueSince ??= Date.now();
|
|
64
|
+
if (Date.now() - negatedTrueSince >= grace)
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
negatedTrueSince = undefined;
|
|
69
|
+
}
|
|
70
|
+
if (options.deadline.expired())
|
|
71
|
+
throw await options.onTimeout();
|
|
72
|
+
await sleep(POLL_INTERVAL_MS, options.signal);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Races a promise against a timeout; on timeout invokes onTimeout to build the error. */
|
|
76
|
+
export async function withTimeout(promise, timeoutMs, onTimeout) {
|
|
77
|
+
let timer;
|
|
78
|
+
try {
|
|
79
|
+
return await Promise.race([
|
|
80
|
+
promise,
|
|
81
|
+
new Promise((_, reject) => {
|
|
82
|
+
timer = setTimeout(() => reject(onTimeout()), timeoutMs);
|
|
83
|
+
}),
|
|
84
|
+
]);
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
if (timer !== undefined)
|
|
88
|
+
clearTimeout(timer);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/internal/time.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,QAAQ;IACV,MAAM,CAAS;IAExB,YAAY,SAAiB,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AC;AAED,0FAA0F;AAC1F,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAmB,EACnB,SAAiB,EACjB,SAAsB;IAEtB,IAAI,KAAiC,CAAC;IACtC,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC;YACxB,OAAO;YACP,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;gBAC/B,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;YAC3D,CAAC,CAAC;SACH,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,IAAI,KAAK,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live agent tracing for iterating on agentic tests: `E2E_DEBUG=agent` streams
|
|
3
|
+
* every invocation phase, model selection, and locate-candidate outcome to
|
|
4
|
+
* stderr as it happens, from whichever process runs the attempt. This is a
|
|
5
|
+
* debugging aid, not telemetry: the report stays the canonical record.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Writes one bounded, sanitized trace line when agent tracing is on. Takes a
|
|
9
|
+
* thunk so call sites in polling loops pay nothing while tracing is off.
|
|
10
|
+
*/
|
|
11
|
+
export declare function agentTrace(message: () => string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Dumps one full observation as the model will receive it. The text is
|
|
14
|
+
* already redacted and size-bounded by the observation pipeline, so the dump
|
|
15
|
+
* needs no further truncation to stay safe.
|
|
16
|
+
*/
|
|
17
|
+
export declare function observationTrace(header: () => string, text: string): void;
|
|
18
|
+
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/internal/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6BH;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,MAAM,GAAG,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAGzE"}
|