Reference
Remy Reference/agent/dataSources.documents
?

dataSources.documents

Lists every document in the corpus with its ingest status: processing, done, or error.
DataSource.documents() → DataSourceDocument[]

Lists the corpus's documents, each with its ingest status, chunk and page counts, metadata, and any parse error. It is how a UI shows ingest progress and surfaces the documents that failed, and how you poll after add until a document reaches done.

Check processing state
const docs = await Policies.documents();
const pending = docs.filter((d) => d.status === 'processing');
const failed = docs.filter((d) => d.status === 'error');