import { WorkflowDivergenceDiagnosticJson, WorkflowRunDetailsJson, WorkflowRunJson, WorkflowSummaryJson, WorkflowSyncResultJson, WorkflowVersionJson } from "@hexclave/shared/dist/interface/workflows"; //#region src/lib/hexclave-app/workflows.d.ts type AdminWorkflowTrigger = { type: "event"; eventType: string; } | { type: "schedule"; cron: string; timezone: string; }; type AdminWorkflow = { id: string; displayName: string; latestVersion: number; triggers: AdminWorkflowTrigger[]; /** Paused workflows create no new runs; their in-flight runs keep going. */ isPaused: boolean; pausedAtMillis: number | null; stats: { activeRuns: number; sleepingRuns: number; failed7d: number; runVolume14d: number[]; }; createdAtMillis: number; lastDeployedAtMillis: number; }; type AdminWorkflowRunState = "queued" | "running" | "sleeping" | "completed" | "failed" | "canceled"; type AdminWorkflowDivergenceDiagnostic = { reason: WorkflowDivergenceDiagnosticJson["reason"]; suspendedStepKey: string | null; foundStepKey: string | null; consumedStepKeys: string[]; unconsumedStepKeys: string[]; details: string; }; type AdminWorkflowRun = { id: string; workflowId: string; runKey: string | null; state: AdminWorkflowRunState; version: number; triggerType: string; triggerSummary: string; currentStepId: string | null; stepsRecorded: number; errorSummary: string | null; failureKind: "user" | "platform" | null; lastUpgradeDivergence: AdminWorkflowDivergenceDiagnostic | null; createdAtMillis: number; completedAtMillis: number | null; nextWakeAtMillis: number | null; }; type AdminWorkflowStep = { stepKey: string; stepId: string; kind: "run" | "sleep"; result: unknown; resultSizeBytes: number; attempts: number; executedAtVersion: number; elapsedMs: number | null; createdAtMillis: number; }; type AdminWorkflowStepAttempt = { stepKey: string; stepId: string; /** 0 for the original execution; incremented by each manual retry of the run. */ retryEpoch: number; attempt: number; outcome: "succeeded" | "failed"; error: { name: string; message: string; stack?: string; } | null; failureKind: "user" | "platform" | null; logs: string | null; startedAtMillis: number; finishedAtMillis: number; }; type AdminWorkflowRunDetails = AdminWorkflowRun & { triggerPayload: unknown; steps: AdminWorkflowStep[]; stepAttempts: AdminWorkflowStepAttempt[]; }; type AdminWorkflowVersion = { workflowId: string; version: number; sourceHash: string; source: string; runtimeEnvVersion: string; isLatest: boolean; inFlightRuns: number; createdAtMillis: number; }; type AdminWorkflowSyncResult = { workflowId: string; version: number; created: boolean; inFlightRunsOnOlderVersions: number; }; type AdminWorkflowUpgradeResult = { upgradedCount: number; skipped: { runId: string; runKey: string | null; fromVersion: number; diagnostic: AdminWorkflowDivergenceDiagnostic; }[]; }; type AdminWorkflowRunsFilter = { state?: AdminWorkflowRunState; version?: number; runKey?: string; cursor?: string; limit?: number; /** Include each run's memoized steps and attempt history. */ includeState?: boolean; }; declare function adminWorkflowFromCrud(crud: WorkflowSummaryJson): AdminWorkflow; declare function adminWorkflowRunFromCrud(crud: WorkflowRunJson): AdminWorkflowRun; declare function isWorkflowRunDetailsJson(crud: WorkflowRunJson): crud is WorkflowRunDetailsJson; declare function adminWorkflowRunDetailsFromCrud(crud: WorkflowRunDetailsJson): AdminWorkflowRunDetails; declare function adminWorkflowVersionFromCrud(crud: WorkflowVersionJson): AdminWorkflowVersion; declare function adminWorkflowSyncResultFromCrud(crud: WorkflowSyncResultJson): AdminWorkflowSyncResult; //#endregion export { AdminWorkflow, AdminWorkflowDivergenceDiagnostic, AdminWorkflowRun, AdminWorkflowRunDetails, AdminWorkflowRunState, AdminWorkflowRunsFilter, AdminWorkflowStep, AdminWorkflowStepAttempt, AdminWorkflowSyncResult, AdminWorkflowTrigger, AdminWorkflowUpgradeResult, AdminWorkflowVersion, adminWorkflowFromCrud, adminWorkflowRunDetailsFromCrud, adminWorkflowRunFromCrud, adminWorkflowSyncResultFromCrud, adminWorkflowVersionFromCrud, isWorkflowRunDetailsJson }; //# sourceMappingURL=workflows.d.ts.map