import {Jobs} from '@fuzdev/zzz/jobs.svelte.js'; App-level collection of the account's jobs, mirroring the backend's: jobs
live in the daemon's memory, so this holds nothing of its own. job_changed
notifications keep it current (receive_changed), and each session
snapshot replaces it (reconcile) — after a daemon restart that's empty.
inheritance
Cell<typeof JobsJson>items
type IndexedCollection<Job>
newest_first
Jobs newest first, by when they were queued.
type Job[]
unfinished
Jobs that are queued or running.
type Job[]
constructor
type new (options: JobsOptions): Jobs
options
get_by_job_id
type (job_id: string & $brand<"Uuid">): Job | undefined
job_id
UuidJob | undefinedlatest_for_input
The newest job working on the file at path, if any — the one whose
state a view of that file shows.
type (path: string & $brand<"DiskfilePath">): Job | undefined
path
Job | undefinedreceive_changed
Applies a job_changed notification: adds the job, or updates it in place.
type (snapshot: { job_id: string & $brand<"Uuid">; kind: "transcription"; status: "failed" | "queued" | "running" | "succeeded" | "cancelled"; progress: number | null; input_path: string & $brand<...>; ... 6 more ...; stderr: string; }): Job
snapshot
receive_transcription_progress
Applies a transcription_progress notification: appends the segments to
the job's preview. Segments for a job this app hasn't heard of are
dropped — its job_changed always comes first.
type (job_id: string & $brand<"Uuid">, segments: readonly { start_ms: number | null; end_ms: number | null; text: string; words?: { start_ms: number; end_ms: number; text: string; p: number; }[] | undefined; }[]): void
job_id
Uuidsegments
readonly TranscriptSegment[]voidreconcile
Replaces the collection with a session snapshot's jobs: listed jobs are added or updated, and ones the backend no longer has — it restarted, or dropped them from its history — are removed.
type (snapshots: readonly { job_id: string & $brand<"Uuid">; kind: "transcription"; status: "failed" | "queued" | "running" | "succeeded" | "cancelled"; progress: number | null; input_path: string & $brand<...>; ... 6 more ...; stderr: string; }[]): void
snapshots
readonly JobSnapshot[]voidtranscribe
Queues a transcription of the audio file at path (transcription_create).
The job arrives through job_changed.
type (path: string & $brand<"DiskfilePath">, language?: string | undefined): Promise<Result<{ value: { job_id: string & $brand<"Uuid">; }; }, { error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message: string; data?: unknown; }; }>>
path
the audio file
language?
a language code, or omitted to detect it
stringPromise<Result>the job's id, or the RPC error
cancel
Cancels a job (job_cancel). Its job_changed carries the outcome.
type (job: Job): Promise<Result<{ value: null; }, { error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; }>>
job
Promise<Result>the RPC result — not_found when the backend no longer has it