/** * Copyright (c) 2025 Elara AI Pty Ltd * Licensed under BSL 1.1. See LICENSE for details. */ import { type LockHolderInfo } from './errors.js'; import type { StorageBackend } from './storage/interfaces.js'; /** * Status of a dataset in the workspace. */ export type DatasetStatus = { type: 'unset'; } | { type: 'stale'; } | { type: 'up-to-date'; }; /** * Status of a task in the workspace. */ export type TaskStatus = { type: 'up-to-date'; cached: boolean; } | { type: 'ready'; } | { type: 'waiting'; reason: string; } | { type: 'in-progress'; pid?: number; startedAt?: string; } | { type: 'failed'; exitCode: number; completedAt?: string; } | { type: 'error'; message: string; completedAt?: string; } | { type: 'stale-running'; pid?: number; startedAt?: string; }; /** * Information about a dataset in the status report. */ export interface DatasetStatusInfo { /** Dataset path (e.g., "inputs.sales_data") */ path: string; /** Current status */ status: DatasetStatus; /** Hash of current value (if set) */ hash: string | null; /** True if this is a task output */ isTaskOutput: boolean; /** Name of task that produces this (if any) */ producedBy: string | null; } /** * Information about a task in the status report. */ export interface TaskStatusInfo { /** Task name */ name: string; /** Task hash */ hash: string; /** Current status */ status: TaskStatus; /** Input dataset paths */ inputs: string[]; /** Output dataset path */ output: string; /** Tasks this one depends on */ dependsOn: string[]; } /** * Complete workspace status report. */ export interface WorkspaceStatusResult { /** Workspace name */ workspace: string; /** Lock status - null if not locked */ lock: LockHolderInfo | null; /** Status of all datasets */ datasets: DatasetStatusInfo[]; /** Status of all tasks */ tasks: TaskStatusInfo[]; /** Summary counts */ summary: { datasets: { total: number; unset: number; stale: number; upToDate: number; }; tasks: { total: number; upToDate: number; ready: number; waiting: number; inProgress: number; failed: number; error: number; staleRunning: number; }; }; } /** * Get comprehensive status of a workspace. * * Performs a dry-run analysis of the workspace to determine: * - Whether the workspace is locked (and by whom) * - Status of each dataset (unset, stale, up-to-date) * - Status of each task (up-to-date, ready, waiting, in-progress) * * This is a read-only operation that does not modify workspace state * and does not require acquiring a lock. * * @param storage - Storage backend * @param repo - Repository identifier (for local storage, the path to e3 repository directory) * @param ws - Workspace name * @returns Complete status report * @throws {WorkspaceNotFoundError} If workspace doesn't exist * @throws {WorkspaceNotDeployedError} If workspace has no package deployed */ export declare function workspaceStatus(storage: StorageBackend, repo: string, ws: string): Promise; //# sourceMappingURL=workspaceStatus.d.ts.map