Skip to content

TaskContext

Global task tracking: holds the active profile's jobs (server-side) and in-flight uploads (client-side), polls running jobs, and exposes submit / cancel / dismiss for the task tray and the features that enqueue work. The server is the source of truth, so active jobs survive navigation and reload (re-seeded on mount).

Interfaces

SubmitOptions

Defined in: src/contexts/TaskContext.tsx:62

Everything a submitted job needs beyond the uploaded file reference.

Properties

Property Type Description Defined in
fileType? string Optional file-type tag stored on the uploaded file. src/contexts/TaskContext.tsx:66
jobType JobType The operation to run. src/contexts/TaskContext.tsx:64
model? string LLM model selector (fix_srt). src/contexts/TaskContext.tsx:70
opts? Record\<string, unknown> Operation options (transcription / conversion args). src/contexts/TaskContext.tsx:68
sysMsg? string LLM system message (fix_srt). src/contexts/TaskContext.tsx:72

TaskContextType

Defined in: src/contexts/TaskContext.tsx:75

Properties

Property Type Description Defined in
busy boolean Whether anything is in flight (uploading or an active job). src/contexts/TaskContext.tsx:79
cancel (id) => Promise\<void> Cancels a queued or running job. src/contexts/TaskContext.tsx:94
deleteJob (id) => Promise\<void> Permanently deletes a finished job (server-side) and drops it locally. src/contexts/TaskContext.tsx:96
dismiss (id) => void Removes a finished job or a failed upload from the tray. src/contexts/TaskContext.tsx:98
jobs Job[] - src/contexts/TaskContext.tsx:76
refresh () => Promise\<void> Re-fetches the active jobs immediately. src/contexts/TaskContext.tsx:100
submit (req) => Promise\<Job | null> Submits a job against an already-uploaded file. src/contexts/TaskContext.tsx:83
submitBatch (req) => Promise\<Job | null> Submits a batch job over several already-uploaded files. src/contexts/TaskContext.tsx:85
uploadAndSubmit (file, options) => Promise\<Job | null> Uploads a file then submits a job against it, tracking both phases. src/contexts/TaskContext.tsx:81
uploadFiles (files, folder?) => Promise\<number> Uploads several files into the profile (no job), tracked in the tray as a single aggregate task. Returns how many uploaded successfully. src/contexts/TaskContext.tsx:90
uploads UploadTask[] - src/contexts/TaskContext.tsx:77
waitFor (id) => Promise\<Job> Resolves once the given job reaches a terminal state (polls it). src/contexts/TaskContext.tsx:92

UploadTask

Defined in: src/contexts/TaskContext.tsx:46

A client-side upload, shown in the tray during its upload.

Properties

Property Type Description Defined in
error? string Failure message when status is error. src/contexts/TaskContext.tsx:58
id string Client-generated id (distinct from server job ids). src/contexts/TaskContext.tsx:48
jobType? JobType The job that will be submitted once the upload finishes, if any. src/contexts/TaskContext.tsx:52
name string Display name (the uploaded file name, or a folder / file count). src/contexts/TaskContext.tsx:50
progress number Upload progress in [0, 100]. src/contexts/TaskContext.tsx:54
status "error" | "uploading" uploading while in flight, error if the upload failed. src/contexts/TaskContext.tsx:56

Variables

TaskProvider

const TaskProvider: React.FC<{
  children: ReactNode;
}>;

Defined in: src/contexts/TaskContext.tsx:119

The TaskProvider component.

Param

props

The provider children.

Returns

The provider.

Functions

useTasks()

function useTasks(): TaskContextType;

Defined in: src/contexts/TaskContext.tsx:361

Hook for consuming the task context.

Returns

TaskContextType

The task context.