import { $ as DaemonError } from "./sdk-contracts.js";
import { E as SnapshotDiagnosticsSummary } from "./cloud-artifacts.js";
//#region packages/contracts/src/recording-export-quality.d.ts
declare const RECORDING_EXPORT_QUALITIES: readonly ['medium', 'high'];
type RecordingExportQuality = (typeof RECORDING_EXPORT_QUALITIES)[number];
//#endregion
//#region packages/contracts/src/recording-scope.d.ts
declare const RECORDING_SCOPE_VALUES: readonly ['app', 'device', 'system'];
type RecordingScope = (typeof RECORDING_SCOPE_VALUES)[number];
//#endregion
//#region packages/contracts/src/replay.d.ts
type ReplayCommandResult = {
  replayed: number;
  healed: number;
  session: string;
  /**
   * True iff `session` still exists in the daemon's session store when the
   * response is built. This remains true when replay suppresses an authored
   * terminal `close` for an explicit live-session handoff. The client uses
   * this, not script parsing, to decide whether an owned one-shot daemon must
   * stay alive so the caller can keep addressing this session.
   */
  sessionActive: boolean;
  artifactPaths: string[];
  warnings?: string[];
  snapshotDiagnostics?: SnapshotDiagnosticsSummary;
  message: string;
};
type ReplaySuiteTestSkipReason = 'skipped-by-filter';
type ReplaySuiteAttemptFailure = {
  attempt: number;
  message: string;
  durationMs?: number;
};
type ReplaySuiteTestPassed = {
  file: string;
  title?: string;
  session: string;
  status: 'passed';
  durationMs: number;
  finalAttemptDurationMs?: number;
  attempts: number;
  artifactsDir?: string;
  replayed: number;
  healed: number;
  warnings?: string[];
  attemptFailures?: ReplaySuiteAttemptFailure[];
  shardIndex?: number;
  shardCount?: number;
  deviceId?: string;
  deviceName?: string;
  snapshotDiagnostics?: SnapshotDiagnosticsSummary;
};
type ReplaySuiteTestFailed = {
  file: string;
  title?: string;
  session: string;
  status: 'failed';
  durationMs: number;
  attempts: number;
  artifactsDir?: string;
  error: DaemonError;
  /** Warnings accumulated before the failing step (skipped `optional` steps, capture degradations). */
  warnings?: string[];
  /** Present when the owning runtime classified the failure as device/runner infrastructure. */
  infrastructure?: true;
  shardIndex?: number;
  shardCount?: number;
  deviceId?: string;
  deviceName?: string;
  snapshotDiagnostics?: SnapshotDiagnosticsSummary;
};
type ReplaySuiteTestSkipped = {
  file: string;
  title?: string;
  status: 'skipped';
  durationMs: 0;
  reason: ReplaySuiteTestSkipReason;
  message: string;
};
type ReplaySuiteTestResult = ReplaySuiteTestPassed | ReplaySuiteTestFailed | ReplaySuiteTestSkipped;
type ReplaySuiteResult = {
  total: number;
  executed: number;
  passed: number;
  failed: number;
  skipped: number;
  notRun: number;
  durationMs: number;
  failures: ReplaySuiteTestFailed[];
  tests: ReplaySuiteTestResult[];
  /**
   * The suite's own artifacts root (the parent of every test's `artifactsDir`), as resolved on
   * the host that ran the suite. Absent when the suite produced no attempt (e.g. every source
   * was filtered out). #2246: a remote daemon rewrites this to the caller-local path once the
   * directory has been transferred back, so it always names a path the caller can open.
   */
  artifactsDir?: string;
  snapshotDiagnostics?: SnapshotDiagnosticsSummary;
};
/**
 * A **replay script source bundle**: every script file one replay run needs,
 * read and resolved by the CALLER and shipped with the request.
 *
 * `replay <path>` used to send only the path, which the daemon then opened on
 * ITS filesystem. That works only while caller and daemon share a disk; against
 * a remote daemon it fails with `ENOENT` on a path the caller can read (#1802).
 * The bundle removes the class: the daemon never resolves a caller path, so a
 * local run and a remote run read exactly the same bytes.
 *
 * `entry` is the caller-resolved absolute path of the script that was invoked —
 * it is also the display path every error and line reference is stated in,
 * and it is always a key of `files`.
 * `files` maps each caller-resolved absolute path to that file's text: one
 * entry for a native `.ad` script, plus one per transitively included flow for
 * Maestro YAML `runFlow`.
 */
type ReplayScriptSourceBundle = Readonly<{
  entry: string;
  files: Readonly<Record<string, string>>;
}>;
//#endregion
export { RecordingExportQuality as a, RecordingScope as i, ReplayScriptSourceBundle as n, ReplaySuiteResult as r, ReplayCommandResult as t };