@dev-blinq/bvt-playwright-js 1.0.0-dev.4.staging.111.1 → 1.0.0-dev.4.staging.124.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.d.mts +55 -0
  2. package/index.mjs +27300 -27167
  3. package/index.mjs.map +1 -1
  4. package/package.json +1 -1
package/index.d.mts CHANGED
@@ -8122,6 +8122,7 @@ type AgentObservabilityInput = AgentObservability | {
8122
8122
  metrics?: AgentMetrics | ObservabilityMetricsLike;
8123
8123
  events?: AgentEvents | ObservabilityEventsLike;
8124
8124
  } | AgentLoggerInput;
8125
+ type DecryptSecret = (value: string, context?: ResolutionContext) => Promise<string>;
8125
8126
  interface TestDataApiOptions {
8126
8127
  /**
8127
8128
  * Called after every successful write. Used by WorkerRuntime to fan out
@@ -8134,13 +8135,40 @@ interface TestDataApiOptions {
8134
8135
  * grepping for `provider.upsert`.
8135
8136
  */
8136
8137
  logger?: AgentLoggerInput;
8138
+ /**
8139
+ * Decrypt the stored value of `dataType: "secret"` entries. Mirrors the
8140
+ * resolver's `decryptSecret` so that `getScoped("apiToken")` from custom
8141
+ * code returns the same plaintext that `{{apiToken}}` would. If omitted, the
8142
+ * raw stored value is returned and the caller sees ciphertext for entries
8143
+ * persisted by services that encrypt at rest (server, execution-planner).
8144
+ */
8145
+ decryptSecret?: DecryptSecret;
8146
+ /**
8147
+ * Decrypt the stored TOTP seed. The accessor then runs `generateTOTP` so
8148
+ * callers get the current 6-digit code — matching `{{key}}` semantics.
8149
+ */
8150
+ decryptTotpSeed?: DecryptSecret;
8137
8151
  }
8138
8152
  declare class TestDataApi {
8139
8153
  private readonly provider;
8140
8154
  private readonly context;
8141
8155
  private readonly options;
8142
8156
  private readonly logger?;
8157
+ private readonly decryptSecret?;
8158
+ private readonly decryptTotpSeed?;
8143
8159
  constructor(provider: ITestDataProvider, context: ResolutionContext, options?: TestDataApiOptions);
8160
+ /**
8161
+ * Post-process the raw stored value into the plaintext a caller expects:
8162
+ * - "secret": decrypt with the configured callback (returns ciphertext as
8163
+ * a fallback when no callback is wired, matching legacy behavior).
8164
+ * - "totp": decrypt the seed and generate the current 6-digit code, so
8165
+ * callers see the same value `{{key}}` would resolve to.
8166
+ * - other types are returned verbatim (sessionState is plaintext in
8167
+ * memory by convention, JSON/string/boolean/number need no transform).
8168
+ * Decryption errors are logged and the raw value is returned — surfacing a
8169
+ * useless ciphertext is better than throwing from inside user custom code.
8170
+ */
8171
+ private postProcessValue;
8144
8172
  /**
8145
8173
  * Save a value to runtime test data.
8146
8174
  *
@@ -8980,6 +9008,20 @@ type RecoveryResult = {
8980
9008
  decision: RecoveryDecision$1;
8981
9009
  artifact: RecoveryArtifact | null;
8982
9010
  };
9011
+ type RecoveryArtifactAttemptLogEntry = {
9012
+ attemptNumber: number;
9013
+ scope: "single-command" | "whole-step";
9014
+ representation: "native" | "custom";
9015
+ action: string;
9016
+ outcome: "succeeded" | "failed" | "blocked";
9017
+ };
9018
+ type RecoveryArtifactGenerationInput = {
9019
+ decision: RecoveryDecision$1;
9020
+ failureContext: FailureContext$1;
9021
+ recoverySucceeded: boolean;
9022
+ stoppedReason: string;
9023
+ attemptLog: RecoveryArtifactAttemptLogEntry[];
9024
+ };
8983
9025
  type FailureContext$1 = {
8984
9026
  failedCommand: Command;
8985
9027
  stepDefinitionId: string;
@@ -8999,6 +9041,7 @@ type FailureContext$1 = {
8999
9041
  };
9000
9042
  interface RecoveryController {
9001
9043
  analyzeAndPropose(context: FailureContext$1): Promise<RecoveryResult>;
9044
+ generateRecoveryArtifact?(input: RecoveryArtifactGenerationInput): Promise<RecoveryArtifact | null>;
9002
9045
  }
9003
9046
  type TraceUploadRequestInput = {
9004
9047
  reportId: string;
@@ -9125,6 +9168,14 @@ type TesterOptions = {
9125
9168
  provider?: ITestDataProvider;
9126
9169
  context?: ResolutionContext;
9127
9170
  onTestDataChange?: () => void;
9171
+ /**
9172
+ * Forwarded to the {@link TestDataApi} that `tester.testDataApi` returns so
9173
+ * `context.testData.getScoped("apiToken")` from user custom code yields the
9174
+ * decrypted plaintext (mirroring the resolver's `{{apiToken}}` semantics).
9175
+ * Optional — leaving them unset keeps the legacy "return raw value" behavior.
9176
+ */
9177
+ decryptSecret?: DecryptSecret;
9178
+ decryptTotpSeed?: DecryptSecret;
9128
9179
  getApiFetchImpl?: () => typeof fetch;
9129
9180
  stepTraceChunkCallbacks?: StepTraceChunkCallbacks;
9130
9181
  /**
@@ -9194,6 +9245,8 @@ declare class Tester {
9194
9245
  private dataProvider?;
9195
9246
  private dataContext?;
9196
9247
  private readonly onTestDataChange?;
9248
+ private readonly decryptSecret?;
9249
+ private readonly decryptTotpSeed?;
9197
9250
  private readonly getAPIClient;
9198
9251
  private readonly obs;
9199
9252
  private readonly getApiFetchImpl?;
@@ -9242,6 +9295,8 @@ declare class Tester {
9242
9295
  private onTestCaseFail;
9243
9296
  private isBrowserDerivedCommand;
9244
9297
  private buildFailureContext;
9298
+ private generateRecoveryArtifactForOutcome;
9299
+ private buildStepRepairAttemptLog;
9245
9300
  private getCommandRecoverySelectors;
9246
9301
  private getRecorderStepIndex;
9247
9302
  private restoreAndReplayToStepStartForRepair;