ReferenceAsk
Remy Reference/agent/DataSourceJob
?

DataSourceJob

Type
One ingestion job as the SDK returns it: its state, cost plan, and progress.

One ingestion job as the SDK returns it from sync, jobs, and job: its state through the plan, approve, and run lifecycle, its cost plan, and its progress counts. It is the same job you operate from the CLI, surfaced in code so an app can show or drive ingestion itself.

DataSourceJob.ts
interface DataSourceJob {
  id: string
  dataSourceId: string
  state: DataSourceJobState
  plan: DataSourceJobPlan | null
  counts: { documentsDone: number; documentsFailed: number; chunks: number }
  estimatedDollars: number
  createdAt: string
  finishedAt: string | null
}
Fields
state
DataSourceJobState
planning, planned, running, paused, done, failed, or cancelled.
plan
DataSourceJobPlan | null
The cost projection a planned job waits on.
counts
object
Documents done and failed, and chunks embedded, so far.
React to a job's state
const job = await Docs.job(id);
if (job.state === 'done') console.log('ingested', job.counts.documentsDone);