job.svelte.ts

view source

Declarations
#

4 declarations

Job
#

job.svelte.ts view source

import {Job} from '@fuzdev/zzz/job.svelte.js';

A job on the backend: long-running work on a file — a transcription — that outlives the request that started it. Mirrors the backend's state: every job_changed notification replaces these fields (Jobs.receive_changed).

inheritance

extends: Cell<typeof JobJson>

job_id

type string & $brand<"Uuid">

$state.raw

kind

type "transcription"

$state.raw

status

type JobStatus

$state.raw

progress

type number | null

$state.raw

input_path

type DiskfilePath

$state.raw

output_path

type DiskfilePath | null

$state.raw

commands

type string[]

$state.raw

queued_at

type number

$state.raw

started_at

type number | null

$state.raw

ended_at

type number | null

$state.raw

error

type string | null

$state.raw

stderr

type string

$state.raw

live_segments

The segments a running transcription has decoded so far — a preview, in the order they arrived. Not part of the job's state on the backend: a reload starts it empty, and the transcript file is the result.

type TranscriptSegment[]

$state.raw

finished

type boolean

readonly $derived

cancellable

Whether the job can still be cancelled.

type boolean

readonly $derived

run_duration

How long the job ran, in milliseconds — null until it has ended.

type number | null

readonly $derived

constructor

type new (options: JobOptions): Job

options

JobJson
#

job.svelte.ts view source

value + type

{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; job_id: string & $brand<"Uuid">; ... 10 more ...; stderr: string; } import {JobJson} from '@fuzdev/zzz/job.svelte.js';

A JobSnapshot as a cell. What identifies a job — its id, kind, input, and when it was queued — stays required; the rest defaults to a job that hasn't started.

id

type string & $brand<"Uuid">

created

type string & $brand<"Datetime">

updated

Required and initially equal to created.

type string & $brand<"Datetime">

job_id

type string & $brand<"Uuid">

kind

type "transcription"

input_path

type string & $brand<"DiskfilePath">

queued_at

type number

status

type "failed" | "queued" | "running" | "succeeded" | "cancelled"

progress

type number | null

output_path

type (string & $brand<"DiskfilePath">) | null

commands

type string[]

started_at

type number | null

ended_at

type number | null

error

type string | null

stderr

type string

JobJsonInput
#

job.svelte.ts view source

{ job_id: string; kind: "transcription"; input_path: string; queued_at: number; id?: string | undefined; created?: string | undefined; updated?: string | undefined; status?: "failed" | "queued" | "running" | "succeeded" | "cancelled" | undefined; ... 6 more ...; stderr?: string | undefined; } import type {JobJsonInput} from '@fuzdev/zzz/job.svelte.js';

job_id

type string

kind

type "transcription"

input_path

type string

queued_at

type number

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

status?

type "failed" | "queued" | "running" | "succeeded" | "cancelled"

progress?

type number | null

output_path?

type string | null

commands?

type string[]

started_at?

type number | null

ended_at?

type number | null

error?

type string | null

stderr?

type string

JobOptions
#

job.svelte.ts view source

JobOptions import type {JobOptions} from '@fuzdev/zzz/job.svelte.js';

inheritance

extends: CellOptions<typeof JobJson>

Depends on
#

Imported by
#