Skip to content

jobs.start

Runs a shell command in the workspace folder as a job (DMN-080).

/** `jobs.start` params (DMN-080, DMN-215). */
export type StartJobParams = {
/** Run as `sh -c <command>` in the workspace folder. */
command: string;
/**
* A job of the same workspace the new one takes the place of: killed if it still runs, then forgotten (its
* topic is `not_found` for new subscribers); an unknown id is ignored.
*/
replaces?: string | null;
workspaceId: string;
};
/** A shell command the daemon runs for a workspace (DMN-080). */
export type JobInfo = {
/** Run as `sh -c <command>` in the workspace folder. */
command: string;
id: string;
startedAt: number;
status: JobStatus;
workspaceId: string;
};
/** A job's process state (DMN-080). */
export type JobStatus =
| {
state: "running";
}
/** The shell exited and both outputs closed. */
| {
/** Exit code; `null` when a signal ended it. */
code?: number | null;
endedAt: number;
/** The signal that ended it, if any. */
signal?: number | null;
state: "exited";
};