Skip to content

Type Definitions

Common types used across both SPA and Fullstack modes.

RunStatus

ts
type RunStatus = 'pending' | 'leased' | 'completed' | 'failed' | 'cancelled'
StatusDescription
pendingJob is queued, waiting to be picked up by worker
leasedJob is currently executing
completedJob finished successfully
failedJob encountered an error
cancelledJob was cancelled before completion

Progress

ts
interface Progress {
  current: number
  total?: number
  message?: string
}
PropertyTypeDescription
currentnumberCurrent progress value
totalnumber | undefinedTotal expected value
messagestring | undefinedHuman-readable progress message

LogEntry

ts
interface LogEntry {
  id: string
  runId: string
  stepName: string | null
  level: 'info' | 'warn' | 'error'
  message: string
  data: unknown
  timestamp: string
}
PropertyTypeDescription
idstringUnique log entry ID
runIdstringAssociated run ID
stepNamestring | nullStep that created the log
level'info' | 'warn' | 'error'Log severity
messagestringLog message
dataunknownOptional structured data
timestampstringISO timestamp

ClientRun

A subset of the core Run type returned by HTTP endpoints. Internal fields (leaseOwner, leaseExpiresAt, idempotencyKey, concurrencyKey, updatedAt) are excluded.

ts
interface ClientRun {
  id: string
  jobName: string
  status: RunStatus
  input: unknown
  output: unknown
  error: string | null
  currentStepIndex: number
  completedStepCount: number
  progress: Progress | null
  labels: Record<string, string>
  startedAt: string | null
  completedAt: string | null
  createdAt: string
}
PropertyTypeDescription
idstringUnique run ID
jobNamestringName of the job
statusRunStatusCurrent status
inputunknownInput data
outputunknownJob output (when completed)
errorstring | nullError message (when failed)
currentStepIndexnumberIndex of the current step
completedStepCountnumberTotal number of completed steps
progressProgress | nullCurrent progress
labelsRecord<string, string>Labels set at trigger time
startedAtstring | nullISO timestamp of start
completedAtstring | nullISO timestamp of completion
createdAtstringISO timestamp of creation

StepRecord

ts
interface StepRecord {
  name: string
  status: 'completed' | 'failed' | 'cancelled'
  output: unknown
  error: string | null
  startedAt: string
  completedAt: string | null
}
PropertyTypeDescription
namestringStep name
status'completed' | 'failed' | 'cancelled'Step result
outputunknownStep return value
errorstring | nullError message (when failed)
startedAtstringISO timestamp of start
completedAtstring | nullISO timestamp of completion

Released under the MIT License.