Waits until the specified job finishes, then resolves with its result or throws if the job
fails. The thrown error is a JobError: check its errorType (e.g. 'AI_PROVIDER_ERROR')
to branch on the failure kind without parsing message.
A unique, private identifier for the job.
Do not reuse a jobId across clients—possessing the ID
allows anyone to inspect the job’s state.
Cancels a running server-executed job (e.g. an AI chat) so it stops spending resources. Allowed
with the API key, or for the client that started the job. The job ends as cancelled and
awaitJob rejects with a JobError whose errorType is 'JOB_CANCELLED'. No-op if it already finished.
The identifier of the job to cancel.
Resolves a job this client owns successfully with its result. A result that does not fit in 16MB with the job's metadata cannot be stored, so the job fails instead.
Resolves a job this client owns as failed with an error message.
Starts a long-running job under a caller-generated jobId. The client owns the job until it
resolves it via completeJob or failJob; while owned, the job is kept alive so
core does not fail it. The jobId must be globally unique and kept private.
Handles job subscriptions and notifications.
Important: Each
jobIdmust be globally unique and kept private. Anyone who knows a job’s ID can query its status or result.A job that Squid starts under an ID it builds itself (a knowledge base graph rebuild or re-upsert, an external-source check, an ontology generation, a relationship inference) can be read and awaited only with an API key. The prefixes of these IDs are reserved: a job ID you choose cannot start with
graph-rebuild-,reupsert-kb-,kb-external-source-,ontology-generation-orrelationship-inference-.