import "./index-ChIfeWzk.js";
import { X as TestSuiteRunStatus, Y as TestCaseRunStatus, y as JsonValue, z as RunStatus } from "./ItemsInputNormalizer-CFkfNMLt.js";
import { a as CredentialInstanceWithSecretsDto, c as UpsertCredentialBindingRequest, i as CredentialInstanceDto, l as WorkflowCredentialHealthDto, n as AppsResponse, o as CredentialOAuth2ConnectionDto, r as CreateCredentialInstanceRequest, s as UpdateCredentialInstanceRequest, t as AppGalleryEntry, u as WorkflowCredentialHealthSlotDto } from "./CredentialContractsRegistry-Dgu-rEXi.js";
import { a as TelemetrySpanStatus } from "./TelemetryContracts-DpZEODQM.js";
import { i as WorkflowSummary, n as WorkflowEdgeDto, r as WorkflowNodeDto, t as WorkflowDto } from "./WorkflowViewContracts-B7aFQcIw.js";
import { _ as withInviteUserResponseLoginMethodsDefaults, a as CollectionSummaryDto, c as AcceptUserInviteRequestDto, d as UpdateUserAccountStatusRequestDto, f as UpsertLocalBootstrapUserResultDto, g as VerifyUserInviteResponseDto, h as UserAccountStatus, i as CollectionRowDto, l as InviteUserRequestDto, m as UserAccountDtoInput, n as CollectionFieldDto, o as ListCollectionRowsResponseDto, p as UserAccountDto, r as CollectionIndexDto, s as SyncCollectionsResponseDto, t as CollectionDetailDto, u as InviteUserResponseDto, v as withUserAccountLoginMethodsDefaults } from "./CollectionContracts.types-DDyFYT_D.js";

//#region src/application/contracts/TelemetryDashboardContracts.d.ts
type TelemetryDashboardBucketIntervalDto = "minute_5" | "minute_15" | "hour" | "day" | "week";
type TelemetryDashboardRunOriginDto = "triggered" | "manual";
interface TelemetryDashboardFiltersDto {
  readonly workflowIds?: ReadonlyArray<string>;
  readonly statuses?: ReadonlyArray<TelemetrySpanStatus>;
  readonly runOrigins?: ReadonlyArray<TelemetryDashboardRunOriginDto>;
  readonly modelNames?: ReadonlyArray<string>;
  readonly startTimeGte?: string;
  readonly endTimeLte?: string;
}
interface TelemetryDashboardRunAggregateDto {
  readonly totalRuns: number;
  readonly completedRuns: number;
  readonly failedRuns: number;
  readonly runningRuns: number;
  readonly averageDurationMs: number;
}
interface TelemetryDashboardAiAggregateDto {
  readonly inputTokens: number;
  readonly outputTokens: number;
  readonly totalTokens: number;
  readonly cachedInputTokens: number;
  readonly reasoningTokens: number;
}
interface TelemetryDashboardCostKeyTotalDto {
  readonly costKey: string;
  readonly estimatedCostMinor: number;
}
interface TelemetryDashboardCostCurrencyTotalDto {
  readonly currency: string;
  readonly currencyScale: number;
  readonly estimatedCostMinor: number;
  readonly averageCostPerRunMinor: number;
  readonly costKeys: ReadonlyArray<TelemetryDashboardCostKeyTotalDto>;
}
interface TelemetryDashboardCostAggregateDto {
  readonly currencies: ReadonlyArray<TelemetryDashboardCostCurrencyTotalDto>;
}
interface TelemetryDashboardSummaryDto {
  readonly runs: TelemetryDashboardRunAggregateDto;
  readonly ai: TelemetryDashboardAiAggregateDto;
  readonly costs: TelemetryDashboardCostAggregateDto;
}
interface TelemetryDashboardBucketCostDto {
  readonly currency: string;
  readonly currencyScale: number;
  readonly estimatedCostMinor: number;
  readonly component?: string;
  readonly costKey?: string;
}
interface TelemetryDashboardTimeseriesBucketDto {
  readonly bucketStartIso: string;
  readonly bucketEndIso: string;
  readonly totalRuns: number;
  readonly completedRuns: number;
  readonly failedRuns: number;
  readonly runningRuns: number;
  readonly averageDurationMs: number;
  readonly inputTokens: number;
  readonly outputTokens: number;
  readonly totalTokens: number;
  readonly cachedInputTokens: number;
  readonly reasoningTokens: number;
  readonly costs: ReadonlyArray<TelemetryDashboardBucketCostDto>;
}
interface TelemetryDashboardTimeseriesDto {
  readonly interval: TelemetryDashboardBucketIntervalDto;
  readonly buckets: ReadonlyArray<TelemetryDashboardTimeseriesBucketDto>;
}
interface TelemetryDashboardDimensionsDto {
  readonly modelNames: ReadonlyArray<string>;
}
interface TelemetryDashboardTimeseriesRequestDto {
  readonly filters: TelemetryDashboardFiltersDto;
  readonly interval: TelemetryDashboardBucketIntervalDto;
}
interface TelemetryDashboardRunsRequestDto {
  readonly filters: TelemetryDashboardFiltersDto;
  readonly page: number;
  readonly pageSize: number;
}
interface TelemetryDashboardRunListItemDto {
  readonly runId: string;
  readonly workflowId: string;
  readonly status: TelemetrySpanStatus;
  readonly origin: TelemetryDashboardRunOriginDto;
  readonly startedAt: string;
  readonly finishedAt?: string;
  readonly costs?: ReadonlyArray<TelemetryDashboardBucketCostDto>;
}
interface TelemetryDashboardRunsDto {
  readonly items: ReadonlyArray<TelemetryDashboardRunListItemDto>;
  readonly totalCount: number;
  readonly page: number;
  readonly pageSize: number;
}
//#endregion
//#region src/application/contracts/TestingContracts.d.ts
/** Body of `POST /api/workflows/:workflowId/test-suite-runs`. */
interface StartTestSuiteRunRequest {
  readonly triggerNodeId: string;
  readonly concurrency?: number;
}
/**
 * Response of `POST /api/workflows/:workflowId/test-suite-runs`. Returned **early** (before the
 * suite finishes) — the orchestrator runs in the background and the UI tracks progress via
 * realtime websocket events. So the response is just enough to navigate to the detail view.
 */
interface StartTestSuiteRunResponse {
  readonly testSuiteRunId: string;
  readonly status: TestSuiteRunStatus | "running";
}
/**
 * One child run inside a TestSuiteRun, as returned by `GET /api/test-suite-runs/:id/runs`.
 * The Tests-tab tree-table renders one row per item even when no assertions have been emitted
 * yet — so users can see all queued / running / completed / failed cases as they progress.
 */
interface TestSuiteChildRunDto {
  readonly runId: string;
  readonly testSuiteRunId: string;
  readonly testCaseIndex: number;
  readonly testCaseLabel?: string;
  /**
   * Engine-level run status (`pending` / `running` / `completed` / `failed`). For UI display
   * prefer {@link testCaseStatus} when present — the engine reports `completed` even for
   * cases whose assertions failed, since the workflow itself didn't throw.
   */
  readonly status: RunStatus;
  /**
   * Test-case status: the assertion-rollup-corrected status the suite-detail UI should show.
   * `running` while the case is in flight, then `succeeded` / `failed` / `errored` /
   * `cancelled`. Optional only because legacy rows persisted before the engine started
   * stamping it at row creation may have it as null — new rows always have it set.
   */
  readonly testCaseStatus?: TestCaseRunStatus;
  readonly startedAt: string;
  readonly finishedAt?: string;
}
/** Row shape returned by the suite list endpoint (compact: omits coverage/error details). */
interface TestSuiteRunSummaryDto {
  readonly id: string;
  readonly workflowId: string;
  readonly triggerNodeId: string;
  readonly triggerNodeName?: string;
  readonly status: TestSuiteRunStatus | "running";
  readonly startedAt: string;
  readonly finishedAt?: string;
  readonly totalCases: number;
  readonly passedCases: number;
  readonly failedCases: number;
}
/** Full record returned by the suite-detail endpoint. */
interface TestSuiteRunDetailDto extends TestSuiteRunSummaryDto {
  readonly concurrency: number;
  readonly nodeCoverage?: ReadonlyArray<string>;
  readonly errorMessage?: string;
  readonly updatedAt: string;
}
/**
 * One per-suite-run aggregation point inside an {@link AssertionMetricTrendDto}: the mean score
 * of all rows whose `name` matches, scoped to a specific suite run. `sampleCount` is the number
 * of underlying assertion rows that contributed (useful as a tooltip hint and for filtering out
 * single-sample noise).
 */
interface AssertionMetricTrendPointDto {
  readonly testSuiteRunId: string;
  readonly startedAt: string;
  readonly meanScore: number;
  readonly sampleCount: number;
}
/**
 * Trend of one assertion-metric (`name`) across the workflow's recent test-suite runs. Returned
 * by `GET /api/workflows/:workflowId/assertion-metric-trends`. `perSuiteRun` is sorted oldest →
 * newest by `startedAt` so chart code can render it directly without re-sorting.
 *
 * When the endpoint is hit *without* a `?names=` filter, every distinct assertion name on the
 * workflow is returned; with a filter, only the requested subset (still listing all the names
 * even if some have zero data points yet, so the UI can render placeholder lines).
 */
interface AssertionMetricTrendDto {
  readonly name: string;
  readonly perSuiteRun: ReadonlyArray<AssertionMetricTrendPointDto>;
}
/**
 * One row returned from the per-run assertions endpoint. The pass/fail decision is **derived**
 * from `score >= (passThreshold ?? 0.5)` (or hard-fail when `errored` is true) — UIs should call
 * `deriveAssertionPassed` from `@codemation/core/contracts` rather than store/recompute it here.
 */
interface TestAssertionDto {
  readonly id: string;
  readonly runId: string;
  readonly testSuiteRunId: string;
  readonly workflowId: string;
  readonly nodeId: string;
  readonly iterationId?: string;
  readonly itemIndex?: number;
  readonly name: string;
  readonly score: number;
  readonly passThreshold?: number;
  readonly errored?: true;
  readonly expected?: JsonValue;
  readonly actual?: JsonValue;
  readonly message?: string;
  readonly details?: Readonly<Record<string, JsonValue>>;
  readonly createdAt: string;
}
//#endregion
export { type AcceptUserInviteRequestDto, type AppGalleryEntry, type AppsResponse, type AssertionMetricTrendDto, type AssertionMetricTrendPointDto, type CollectionDetailDto, type CollectionFieldDto, type CollectionIndexDto, type CollectionRowDto, type CollectionSummaryDto, type CreateCredentialInstanceRequest, type CredentialInstanceDto, type CredentialInstanceWithSecretsDto, type CredentialOAuth2ConnectionDto, type InviteUserRequestDto, type InviteUserResponseDto, type ListCollectionRowsResponseDto, type StartTestSuiteRunRequest, type StartTestSuiteRunResponse, type SyncCollectionsResponseDto, type TelemetryDashboardAiAggregateDto, type TelemetryDashboardBucketCostDto, type TelemetryDashboardBucketIntervalDto, type TelemetryDashboardCostAggregateDto, type TelemetryDashboardCostCurrencyTotalDto, type TelemetryDashboardCostKeyTotalDto, type TelemetryDashboardDimensionsDto, type TelemetryDashboardFiltersDto, type TelemetryDashboardRunAggregateDto, type TelemetryDashboardRunListItemDto, type TelemetryDashboardRunOriginDto, type TelemetryDashboardRunsDto, type TelemetryDashboardRunsRequestDto, type TelemetryDashboardSummaryDto, type TelemetryDashboardTimeseriesBucketDto, type TelemetryDashboardTimeseriesDto, type TelemetryDashboardTimeseriesRequestDto, type TestAssertionDto, type TestSuiteChildRunDto, type TestSuiteRunDetailDto, type TestSuiteRunSummaryDto, type UpdateCredentialInstanceRequest, type UpdateUserAccountStatusRequestDto, type UpsertCredentialBindingRequest, type UpsertLocalBootstrapUserResultDto, type UserAccountDto, type UserAccountDtoInput, type UserAccountStatus, type VerifyUserInviteResponseDto, type WorkflowCredentialHealthDto, type WorkflowCredentialHealthSlotDto, type WorkflowDto, type WorkflowEdgeDto, type WorkflowNodeDto, type WorkflowSummary, withInviteUserResponseLoginMethodsDefaults, withUserAccountLoginMethodsDefaults };
//# sourceMappingURL=dto.d.ts.map