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:81

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:85
jobType JobType The operation to run. src/contexts/TaskContext.tsx:83
model? string LLM model selector (fix_srt). src/contexts/TaskContext.tsx:89
opts? Record\<string, unknown> Operation options (transcription / conversion args). src/contexts/TaskContext.tsx:87
sysMsg? string LLM system message (fix_srt). src/contexts/TaskContext.tsx:91

TaskContextType

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

Properties

Property Type Description Defined in
busy boolean Whether anything is in flight (uploading or an active job). src/contexts/TaskContext.tsx:98
cancel (id) => Promise\<void> Cancels a queued or running job. src/contexts/TaskContext.tsx:113
cancelUpload (id) => void Aborts an in-flight upload by its tray id. src/contexts/TaskContext.tsx:115
deleteJob (id) => Promise\<void> Permanently deletes a finished job (server-side) and drops it locally. src/contexts/TaskContext.tsx:117
dismiss (id) => void Removes a finished job or a failed upload from the tray. src/contexts/TaskContext.tsx:119
forgetUploaded (fileIds) => void Forgets the cached profile file ids for the given ids. src/contexts/TaskContext.tsx:121
jobs Job[] - src/contexts/TaskContext.tsx:95
refresh () => Promise\<void> Re-fetches the active jobs immediately. src/contexts/TaskContext.tsx:123
submit (req) => Promise\<Job | null> Submits a job against an already-uploaded file. src/contexts/TaskContext.tsx:102
submitBatch (req) => Promise\<Job | null> Submits a batch job over several already-uploaded files. src/contexts/TaskContext.tsx:104
uploadAndSubmit (file, options) => Promise\<Job | null> Uploads a file then submits a job against it, tracking both phases. src/contexts/TaskContext.tsx:100
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:109
uploads UploadTask[] - src/contexts/TaskContext.tsx:96
waitFor (id) => Promise\<Job> Resolves once the given job reaches a terminal state (polls it). src/contexts/TaskContext.tsx:111

UploadTask

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

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

Properties

Property Type Description Defined in
cancellable? boolean Whether this upload can still be cancelled. src/contexts/TaskContext.tsx:77
error? string Failure message when status is error. src/contexts/TaskContext.tsx:75
id string Client-generated id (distinct from server job ids). src/contexts/TaskContext.tsx:65
jobType? JobType The job that will be submitted once the upload finishes, if any. src/contexts/TaskContext.tsx:69
name string Display name (the uploaded file name, or a folder / file count). src/contexts/TaskContext.tsx:67
progress number Upload progress in [0, 100]. src/contexts/TaskContext.tsx:71
status "error" | "uploading" uploading while in flight, error if the upload failed. src/contexts/TaskContext.tsx:73

Variables

TaskProvider

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

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

The TaskProvider component.

Param

props

The provider children.

Returns

The provider.

Functions

useTasks()

function useTasks(): TaskContextType;

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

Hook for consuming the task context.

Returns

TaskContextType

The task context.