job¶
Operations for creating, updating, completing, canceling and inspecting long-running background jobs shown in Curio's progress toasts. All operations target the application (Target: App) and require library.read. Mutating job operations (job.start, job.update, job.finish, job.cancel) are restricted to plugins and the desktop host; job.list and job.get are shared across web, MCP and plugin callers.
job.start¶
Register a new tracked background job shown in Curio's progress toast area with a Cancel button.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
title |
string |
Yes | — | Job title displayed to the user. |
total |
number |
No | 0 |
Total work units (0 for indeterminate spinner). |
Returns { job: string }.
Example request
Example response
Events and errors Emits job.started. Returns 403 not_allowed outside plugin or window callers.
job.update¶
Update progress counters and status text on a running job, and check whether the user clicked Cancel.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
job |
string |
Yes | — | Job ID from job.start. |
done |
number |
No | — | Completed units so far. |
total |
number |
No | — | Updated total units. |
text |
string |
No | — | Status line text. |
Returns { cancelled: boolean }. Stop working when cancelled === true.
Example request
Example response
Events and errors Emits job.progress. Returns 403 not_allowed outside plugin or window callers, or 404 not_found if job does not exist or belongs to another plugin.
job.finish¶
Mark a job complete with an optional result payload (retained for 10 minutes), or failed with an error message.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
job |
string |
Yes | — | Job ID. |
result |
unknown |
No | null |
Structured completion payload retrievable via job.get. |
error |
string |
No | — | Non-empty error message marks the job failed. |
Returns Done.
Example request
Example response
Events and errors Emits job.finished. Returns 403 not_allowed outside plugin or window callers, or 404 not_found if job does not exist or belongs to another plugin.
job.cancel¶
Cancel a running job. If the job was started by process.run, Curio terminates the child process and its entire process tree immediately.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
job |
string |
Yes | — | Job ID to cancel. |
Returns Done.
Example request
Example response
Events and errors Emits job.finished (state: "cancelled"). Returns 403 not_allowed outside plugin or window callers, or 404 not_found if job does not exist or belongs to another plugin.
job.list¶
List all currently running jobs plus jobs that ended within the last 10 minutes. Plugins see only their own jobs; web/MCP callers see all jobs.
Parameters None ({}).
Returns Job[].
Example request
Example response
[
{ "id": "dup-8c21a4", "plugin": null, "title": "Finding duplicates", "done": 140, "total": 500, "text": "Hashing files", "state": "running", "result": null, "error": null, "started": 1763941000000, "ended": null }
]
Events and errors Read-only. Returns 401 unauthorized without a valid token or 403 not_allowed without library.read.
job.get¶
Inspect one job's live progress or final result/error (available for 10 minutes after completion).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
job |
string |
Yes | — | Job ID. |
Returns Job.
Example request
Example response
{ "id": "dup-8c21a4", "plugin": null, "title": "Finding duplicates", "done": 500, "total": 500, "text": "", "state": "done", "result": { "groups": [] }, "error": null, "started": 1763941000000, "ended": 1763941012400 }
Events and errors Read-only. Returns 401 unauthorized without a valid token, 403 not_allowed without library.read or 404 not_found if the job does not exist, belongs to another plugin or has expired.