@kortexya/reasoninglayer 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +309 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +610 -168
- package/dist/index.d.ts +610 -168
- package/dist/index.js +308 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -109,7 +109,7 @@ type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | object;
|
|
|
109
109
|
* This is the single source of truth for the version constant.
|
|
110
110
|
* The `scripts/release.sh` script updates this value alongside `package.json`.
|
|
111
111
|
*/
|
|
112
|
-
declare const SDK_VERSION = "0.
|
|
112
|
+
declare const SDK_VERSION = "0.12.1";
|
|
113
113
|
/**
|
|
114
114
|
* Configuration for the Reasoning Layer client.
|
|
115
115
|
*
|
|
@@ -4306,7 +4306,7 @@ interface DocumentParseStatsDto$1 {
|
|
|
4306
4306
|
/** Available document parsers */
|
|
4307
4307
|
type DocumentParser$1 = "docling" | "dotsocr" | "olmocr" | "auto";
|
|
4308
4308
|
/** Live progress snapshot for a single document being ingested. */
|
|
4309
|
-
interface DocumentProgressDto {
|
|
4309
|
+
interface DocumentProgressDto$1 {
|
|
4310
4310
|
/**
|
|
4311
4311
|
* Number of chunks that failed.
|
|
4312
4312
|
* @min 0
|
|
@@ -4449,7 +4449,7 @@ interface DocumentProgressDto {
|
|
|
4449
4449
|
/** When ingestion started (ISO 8601). */
|
|
4450
4450
|
started_at: string;
|
|
4451
4451
|
/** Chronological log of pipeline events. */
|
|
4452
|
-
step_log: StepLogEntryDto[];
|
|
4452
|
+
step_log: StepLogEntryDto$1[];
|
|
4453
4453
|
/**
|
|
4454
4454
|
* Total input tokens consumed.
|
|
4455
4455
|
* @min 0
|
|
@@ -4480,7 +4480,7 @@ type DocumentSource$1 = {
|
|
|
4480
4480
|
url: string;
|
|
4481
4481
|
};
|
|
4482
4482
|
/** Stats for a single document within a session */
|
|
4483
|
-
interface DocumentStatsDto {
|
|
4483
|
+
interface DocumentStatsDto$1 {
|
|
4484
4484
|
/**
|
|
4485
4485
|
* Number of chunks successfully processed
|
|
4486
4486
|
* @min 0
|
|
@@ -13409,9 +13409,9 @@ interface SendMessageResponse$1 {
|
|
|
13409
13409
|
timestamp: string;
|
|
13410
13410
|
}
|
|
13411
13411
|
/** Response containing live progress for all documents in a session. */
|
|
13412
|
-
interface SessionProgressResponse {
|
|
13412
|
+
interface SessionProgressResponse$1 {
|
|
13413
13413
|
/** Documents currently being processed (with live progress). */
|
|
13414
|
-
documents: DocumentProgressDto[];
|
|
13414
|
+
documents: DocumentProgressDto$1[];
|
|
13415
13415
|
/**
|
|
13416
13416
|
* Session ID.
|
|
13417
13417
|
* @format uuid
|
|
@@ -13419,9 +13419,9 @@ interface SessionProgressResponse {
|
|
|
13419
13419
|
session_id: string;
|
|
13420
13420
|
}
|
|
13421
13421
|
/** Response for GET /api/v1/ingest/sessions/{session_id}/stats */
|
|
13422
|
-
interface SessionStatsResponse {
|
|
13422
|
+
interface SessionStatsResponse$1 {
|
|
13423
13423
|
/** Stats per document (only completed documents included) */
|
|
13424
|
-
documents: DocumentStatsDto[];
|
|
13424
|
+
documents: DocumentStatsDto$1[];
|
|
13425
13425
|
/**
|
|
13426
13426
|
* Session identifier
|
|
13427
13427
|
* @format uuid
|
|
@@ -14303,7 +14303,7 @@ interface StatisticalSuccessResponse$1 {
|
|
|
14303
14303
|
success: boolean;
|
|
14304
14304
|
}
|
|
14305
14305
|
/** A timestamped log entry from a pipeline step. */
|
|
14306
|
-
interface StepLogEntryDto {
|
|
14306
|
+
interface StepLogEntryDto$1 {
|
|
14307
14307
|
/** Human-readable description of what happened. */
|
|
14308
14308
|
message: string;
|
|
14309
14309
|
/** Pipeline step that produced this event. */
|
|
@@ -24523,7 +24523,7 @@ declare class Execution<SecurityDataType = unknown> {
|
|
|
24523
24523
|
* @request GET:/api/v1/execution/stats
|
|
24524
24524
|
* @secure
|
|
24525
24525
|
*/
|
|
24526
|
-
getSessionStats: (params?: RequestParams) => Promise<HttpResponse<SessionStatsResponse, void>>;
|
|
24526
|
+
getSessionStats: (params?: RequestParams) => Promise<HttpResponse<SessionStatsResponse$1, void>>;
|
|
24527
24527
|
/**
|
|
24528
24528
|
* No description
|
|
24529
24529
|
*
|
|
@@ -25969,7 +25969,7 @@ declare class Ingestion<SecurityDataType = unknown> {
|
|
|
25969
25969
|
* @request GET:/api/v1/ingest/sessions/{session_id}/progress
|
|
25970
25970
|
* @secure
|
|
25971
25971
|
*/
|
|
25972
|
-
getIngestionProgress: (sessionId: string, params?: RequestParams) => Promise<HttpResponse<SessionProgressResponse, void>>;
|
|
25972
|
+
getIngestionProgress: (sessionId: string, params?: RequestParams) => Promise<HttpResponse<SessionProgressResponse$1, void>>;
|
|
25973
25973
|
/**
|
|
25974
25974
|
* @description GET /api/v1/ingest/sessions/{session_id} Returns details of a specific ingestion session. # Path Parameters - `session_id`: UUID of the session # Headers - `X-Tenant-Id`: Tenant ID for multi-tenancy isolation (required) # Response - Session details including status and progress
|
|
25975
25975
|
*
|
|
@@ -25989,7 +25989,7 @@ declare class Ingestion<SecurityDataType = unknown> {
|
|
|
25989
25989
|
* @request GET:/api/v1/ingest/sessions/{session_id}/stats
|
|
25990
25990
|
* @secure
|
|
25991
25991
|
*/
|
|
25992
|
-
getIngestionSessionStats: (sessionId: string, params?: RequestParams) => Promise<HttpResponse<SessionStatsResponse, void>>;
|
|
25992
|
+
getIngestionSessionStats: (sessionId: string, params?: RequestParams) => Promise<HttpResponse<SessionStatsResponse$1, void>>;
|
|
25993
25993
|
/**
|
|
25994
25994
|
* @description Returns current queue depth, document counts by status, circuit breaker state, and worker count.
|
|
25995
25995
|
*
|
|
@@ -26143,6 +26143,177 @@ declare class Ingestion<SecurityDataType = unknown> {
|
|
|
26143
26143
|
startIngestionSession: (data: StartIngestionSessionRequest$1, params?: RequestParams) => Promise<HttpResponse<IngestionSessionResponse$1, void>>;
|
|
26144
26144
|
}
|
|
26145
26145
|
|
|
26146
|
+
/**
|
|
26147
|
+
* Response from async ingestion (sync=false). Returned with HTTP 202.
|
|
26148
|
+
*
|
|
26149
|
+
* @remarks
|
|
26150
|
+
* The backend returns this when `sync=false` is passed as a query parameter.
|
|
26151
|
+
* Use the `sessionId` to poll for progress and stats via the session endpoints.
|
|
26152
|
+
*/
|
|
26153
|
+
interface AsyncIngestionResponse {
|
|
26154
|
+
/** Document ID assigned by the backend (UUID). */
|
|
26155
|
+
documentId: string;
|
|
26156
|
+
/** Session ID for tracking (UUID). */
|
|
26157
|
+
sessionId: string;
|
|
26158
|
+
/** Initial status — always `"pending"` on creation. */
|
|
26159
|
+
status: string;
|
|
26160
|
+
/** URL path to check session status. */
|
|
26161
|
+
statusUrl: string;
|
|
26162
|
+
}
|
|
26163
|
+
/**
|
|
26164
|
+
* A chronological log entry from the ingestion pipeline.
|
|
26165
|
+
*/
|
|
26166
|
+
interface StepLogEntryDto {
|
|
26167
|
+
/** Human-readable description of what happened. */
|
|
26168
|
+
message: string;
|
|
26169
|
+
/** Pipeline step that produced this event. */
|
|
26170
|
+
step: string;
|
|
26171
|
+
/** When this event occurred (ISO 8601). */
|
|
26172
|
+
timestamp: string;
|
|
26173
|
+
}
|
|
26174
|
+
/**
|
|
26175
|
+
* Live progress snapshot for a single document being ingested.
|
|
26176
|
+
*
|
|
26177
|
+
* @remarks
|
|
26178
|
+
* Returned by `GET /api/v1/ingest/sessions/{session_id}/progress`.
|
|
26179
|
+
* Provides real-time counters and pipeline step information.
|
|
26180
|
+
*/
|
|
26181
|
+
interface DocumentProgressDto {
|
|
26182
|
+
/** Number of chunks that failed. */
|
|
26183
|
+
chunksFailed: number;
|
|
26184
|
+
/** Number of chunks fully processed. */
|
|
26185
|
+
chunksProcessed: number;
|
|
26186
|
+
/** Current chunk index (0-based). */
|
|
26187
|
+
currentChunk: number;
|
|
26188
|
+
/** Preview of the chunk currently being processed. */
|
|
26189
|
+
currentChunkPreview?: string | null;
|
|
26190
|
+
/** Current pipeline step (e.g., "chunking", "llm_extraction", "sort_reconciliation"). */
|
|
26191
|
+
currentStep: string;
|
|
26192
|
+
/** Human-readable label for the current step. */
|
|
26193
|
+
currentStepLabel: string;
|
|
26194
|
+
/** Entity types discovered during schema discovery. */
|
|
26195
|
+
discoveredEntityTypes?: string[];
|
|
26196
|
+
/** Relation types discovered during schema discovery. */
|
|
26197
|
+
discoveredRelationTypes?: string[];
|
|
26198
|
+
/** Document ID (UUID). */
|
|
26199
|
+
documentId: string;
|
|
26200
|
+
/** Domain summary from schema discovery. */
|
|
26201
|
+
domainSummary?: string | null;
|
|
26202
|
+
/** Elapsed seconds since start. */
|
|
26203
|
+
elapsedSeconds: number;
|
|
26204
|
+
/** New entities created. */
|
|
26205
|
+
entitiesCreated: number;
|
|
26206
|
+
/** Entities extracted so far. */
|
|
26207
|
+
entitiesExtracted: number;
|
|
26208
|
+
/** Entities filtered out by validation. */
|
|
26209
|
+
entitiesFiltered: number;
|
|
26210
|
+
/** Entities merged via deduplication. */
|
|
26211
|
+
entitiesMerged: number;
|
|
26212
|
+
/** Entities pending review. */
|
|
26213
|
+
entitiesPendingReview: number;
|
|
26214
|
+
/** Estimated USD cost. */
|
|
26215
|
+
estimatedCostUsd?: number | null;
|
|
26216
|
+
/** Extraction strategy ("llm", "local_ner", "hybrid", "schema_guided", "adaptive"). */
|
|
26217
|
+
extractionStrategy: string;
|
|
26218
|
+
/** Inference rules applied. */
|
|
26219
|
+
inferenceRulesApplied: number;
|
|
26220
|
+
/** LLM model name (if applicable). */
|
|
26221
|
+
modelName?: string | null;
|
|
26222
|
+
/** OSF residuations created. */
|
|
26223
|
+
osfResiduationsCreated: number;
|
|
26224
|
+
/** OSF residuations resumed. */
|
|
26225
|
+
osfResiduationsResumed: number;
|
|
26226
|
+
/** References resolved. */
|
|
26227
|
+
referencesResolved: number;
|
|
26228
|
+
/** Unresolved references. */
|
|
26229
|
+
referencesUnresolved: number;
|
|
26230
|
+
/** Relations extracted so far. */
|
|
26231
|
+
relationsExtracted: number;
|
|
26232
|
+
/** Relations from inference rules. */
|
|
26233
|
+
relationsFromInference: number;
|
|
26234
|
+
/** Relations integrated as OSF features. */
|
|
26235
|
+
relationsIntegrated: number;
|
|
26236
|
+
/** Reviews persisted. */
|
|
26237
|
+
reviewsPersisted: number;
|
|
26238
|
+
/** Sort names created or reused. */
|
|
26239
|
+
sortNames?: string[];
|
|
26240
|
+
/** New sorts created. */
|
|
26241
|
+
sortsCreated: number;
|
|
26242
|
+
/** Existing sorts reused (exact match). */
|
|
26243
|
+
sortsReused: number;
|
|
26244
|
+
/** Sorts reused via GLB/feature matching. */
|
|
26245
|
+
sortsReusedGlb: number;
|
|
26246
|
+
/** Sorts reused via semantic matching. */
|
|
26247
|
+
sortsReusedSemantic: number;
|
|
26248
|
+
/** When ingestion started (ISO 8601). */
|
|
26249
|
+
startedAt: string;
|
|
26250
|
+
/** Chronological log of pipeline events. */
|
|
26251
|
+
stepLog: StepLogEntryDto[];
|
|
26252
|
+
/** Total input tokens consumed. */
|
|
26253
|
+
tokensInput: number;
|
|
26254
|
+
/** Total output tokens consumed. */
|
|
26255
|
+
tokensOutput: number;
|
|
26256
|
+
/** Total number of chunks in the document. */
|
|
26257
|
+
totalChunks: number;
|
|
26258
|
+
/** Last progress update (ISO 8601). */
|
|
26259
|
+
updatedAt: string;
|
|
26260
|
+
}
|
|
26261
|
+
/**
|
|
26262
|
+
* Response containing live progress for all documents in a session.
|
|
26263
|
+
*/
|
|
26264
|
+
interface SessionProgressResponse {
|
|
26265
|
+
/** Documents currently being processed (with live progress). */
|
|
26266
|
+
documents: DocumentProgressDto[];
|
|
26267
|
+
/** Session ID (UUID). */
|
|
26268
|
+
sessionId: string;
|
|
26269
|
+
}
|
|
26270
|
+
/**
|
|
26271
|
+
* Stats for a single completed document within a session.
|
|
26272
|
+
*/
|
|
26273
|
+
interface DocumentStatsDto {
|
|
26274
|
+
/** Number of chunks successfully processed. */
|
|
26275
|
+
chunksProcessed: number;
|
|
26276
|
+
/** When ingestion completed (ISO 8601). */
|
|
26277
|
+
completedAt?: string | null;
|
|
26278
|
+
/** Document identifier (UUID). */
|
|
26279
|
+
documentId: string;
|
|
26280
|
+
/** Number of entities extracted from text. */
|
|
26281
|
+
entitiesExtracted: number;
|
|
26282
|
+
/** Processing time in milliseconds. */
|
|
26283
|
+
processingTimeMs: number;
|
|
26284
|
+
/** Number of relations extracted from text. */
|
|
26285
|
+
relationsExtracted: number;
|
|
26286
|
+
/** Names of sorts created/reused. */
|
|
26287
|
+
sortNames: string[];
|
|
26288
|
+
/** IDs of terms created/updated during ingestion. */
|
|
26289
|
+
termIds: string[];
|
|
26290
|
+
/** Total tokens consumed across all LLM calls. */
|
|
26291
|
+
totalTokens: number;
|
|
26292
|
+
}
|
|
26293
|
+
/**
|
|
26294
|
+
* Response for session-level stats (all completed documents).
|
|
26295
|
+
*/
|
|
26296
|
+
interface SessionStatsResponse {
|
|
26297
|
+
/** Stats per document (only completed documents included). */
|
|
26298
|
+
documents: DocumentStatsDto[];
|
|
26299
|
+
/** Session identifier (UUID). */
|
|
26300
|
+
sessionId: string;
|
|
26301
|
+
/** Total number of documents with stats. */
|
|
26302
|
+
total: number;
|
|
26303
|
+
}
|
|
26304
|
+
/**
|
|
26305
|
+
* Options for polling an async ingestion session to completion.
|
|
26306
|
+
*/
|
|
26307
|
+
interface IngestionPollOptions {
|
|
26308
|
+
/** Abort signal to cancel polling. */
|
|
26309
|
+
signal?: AbortSignal;
|
|
26310
|
+
/** Interval between polls in milliseconds. @defaultValue 2000 */
|
|
26311
|
+
pollIntervalMs?: number;
|
|
26312
|
+
/** Maximum time to wait before throwing a timeout error, in milliseconds. @defaultValue 300000 */
|
|
26313
|
+
timeoutMs?: number;
|
|
26314
|
+
/** Optional callback invoked with progress data on each poll cycle. */
|
|
26315
|
+
onProgress?: (progress: SessionProgressResponse) => void;
|
|
26316
|
+
}
|
|
26146
26317
|
/**
|
|
26147
26318
|
* Ingestion session status.
|
|
26148
26319
|
*/
|
|
@@ -26740,6 +26911,7 @@ interface ResumeDocumentIngestionResponse {
|
|
|
26740
26911
|
success: boolean;
|
|
26741
26912
|
}
|
|
26742
26913
|
|
|
26914
|
+
type ingestion_AsyncIngestionResponse = AsyncIngestionResponse;
|
|
26743
26915
|
type ingestion_CandidateMatchDto = CandidateMatchDto;
|
|
26744
26916
|
type ingestion_ChunkFailureDto = ChunkFailureDto;
|
|
26745
26917
|
type ingestion_CommunityStatsDto = CommunityStatsDto;
|
|
@@ -26748,7 +26920,9 @@ type ingestion_DocumentBatchResultDto = DocumentBatchResultDto;
|
|
|
26748
26920
|
type ingestion_DocumentMetadataDto = DocumentMetadataDto;
|
|
26749
26921
|
type ingestion_DocumentParseStatsDto = DocumentParseStatsDto;
|
|
26750
26922
|
type ingestion_DocumentParser = DocumentParser;
|
|
26923
|
+
type ingestion_DocumentProgressDto = DocumentProgressDto;
|
|
26751
26924
|
type ingestion_DocumentSource = DocumentSource;
|
|
26925
|
+
type ingestion_DocumentStatsDto = DocumentStatsDto;
|
|
26752
26926
|
type ingestion_DocumentType = DocumentType;
|
|
26753
26927
|
type ingestion_GroundingStatsDto = GroundingStatsDto;
|
|
26754
26928
|
type ingestion_IncompleteDocumentDto = IncompleteDocumentDto;
|
|
@@ -26762,6 +26936,7 @@ type ingestion_IngestMarkdownResponse = IngestMarkdownResponse;
|
|
|
26762
26936
|
type ingestion_IngestRdfRequest = IngestRdfRequest;
|
|
26763
26937
|
type ingestion_IngestRdfResponse = IngestRdfResponse;
|
|
26764
26938
|
type ingestion_IngestionConfigDto = IngestionConfigDto;
|
|
26939
|
+
type ingestion_IngestionPollOptions = IngestionPollOptions;
|
|
26765
26940
|
type ingestion_IngestionSessionResponse = IngestionSessionResponse;
|
|
26766
26941
|
type ingestion_IngestionSessionStatusDto = IngestionSessionStatusDto;
|
|
26767
26942
|
type ingestion_IngestionStatsDto = IngestionStatsDto;
|
|
@@ -26775,12 +26950,289 @@ type ingestion_PipelineQualityStatsDto = PipelineQualityStatsDto;
|
|
|
26775
26950
|
type ingestion_RdfFormatDto = RdfFormatDto;
|
|
26776
26951
|
type ingestion_ResumeDocumentIngestionRequest = ResumeDocumentIngestionRequest;
|
|
26777
26952
|
type ingestion_ResumeDocumentIngestionResponse = ResumeDocumentIngestionResponse;
|
|
26953
|
+
type ingestion_SessionProgressResponse = SessionProgressResponse;
|
|
26954
|
+
type ingestion_SessionStatsResponse = SessionStatsResponse;
|
|
26778
26955
|
type ingestion_StartIngestionSessionRequest = StartIngestionSessionRequest;
|
|
26956
|
+
type ingestion_StepLogEntryDto = StepLogEntryDto;
|
|
26779
26957
|
type ingestion_TokenUsageDto = TokenUsageDto;
|
|
26780
26958
|
declare namespace ingestion {
|
|
26781
|
-
export type { ingestion_CandidateMatchDto as CandidateMatchDto, ingestion_ChunkFailureDto as ChunkFailureDto, ingestion_CommunityStatsDto as CommunityStatsDto, ingestion_DocumentBatchItem as DocumentBatchItem, ingestion_DocumentBatchResultDto as DocumentBatchResultDto, ingestion_DocumentMetadataDto as DocumentMetadataDto, ingestion_DocumentParseStatsDto as DocumentParseStatsDto, ingestion_DocumentParser as DocumentParser, ingestion_DocumentSource as DocumentSource, ingestion_DocumentType as DocumentType, ingestion_GroundingStatsDto as GroundingStatsDto, ingestion_IncompleteDocumentDto as IncompleteDocumentDto, ingestion_IngestDocumentBatchRequest as IngestDocumentBatchRequest, ingestion_IngestDocumentBatchResponse as IngestDocumentBatchResponse, ingestion_IngestDocumentRequest as IngestDocumentRequest, ingestion_IngestDocumentResponse as IngestDocumentResponse, ingestion_IngestMarkdownBatchRequest as IngestMarkdownBatchRequest, ingestion_IngestMarkdownRequest as IngestMarkdownRequest, ingestion_IngestMarkdownResponse as IngestMarkdownResponse, ingestion_IngestRdfRequest as IngestRdfRequest, ingestion_IngestRdfResponse as IngestRdfResponse, ingestion_IngestionConfigDto as IngestionConfigDto, ingestion_IngestionSessionResponse as IngestionSessionResponse, ingestion_IngestionSessionStatusDto as IngestionSessionStatusDto, ingestion_IngestionStatsDto as IngestionStatsDto, ingestion_ListIncompleteDocumentsResponse as ListIncompleteDocumentsResponse, ingestion_ListIngestionSessionsResponse as ListIngestionSessionsResponse, ingestion_MarkdownDocumentDto as MarkdownDocumentDto, ingestion_OcrConfigDto as OcrConfigDto, ingestion_ParsedDocumentMetadataDto as ParsedDocumentMetadataDto, ingestion_PendingReviewDto as PendingReviewDto, ingestion_PipelineQualityStatsDto as PipelineQualityStatsDto, ingestion_RdfFormatDto as RdfFormatDto, ingestion_ResumeDocumentIngestionRequest as ResumeDocumentIngestionRequest, ingestion_ResumeDocumentIngestionResponse as ResumeDocumentIngestionResponse, ingestion_StartIngestionSessionRequest as StartIngestionSessionRequest, ingestion_TokenUsageDto as TokenUsageDto };
|
|
26959
|
+
export type { ingestion_AsyncIngestionResponse as AsyncIngestionResponse, ingestion_CandidateMatchDto as CandidateMatchDto, ingestion_ChunkFailureDto as ChunkFailureDto, ingestion_CommunityStatsDto as CommunityStatsDto, ingestion_DocumentBatchItem as DocumentBatchItem, ingestion_DocumentBatchResultDto as DocumentBatchResultDto, ingestion_DocumentMetadataDto as DocumentMetadataDto, ingestion_DocumentParseStatsDto as DocumentParseStatsDto, ingestion_DocumentParser as DocumentParser, ingestion_DocumentProgressDto as DocumentProgressDto, ingestion_DocumentSource as DocumentSource, ingestion_DocumentStatsDto as DocumentStatsDto, ingestion_DocumentType as DocumentType, ingestion_GroundingStatsDto as GroundingStatsDto, ingestion_IncompleteDocumentDto as IncompleteDocumentDto, ingestion_IngestDocumentBatchRequest as IngestDocumentBatchRequest, ingestion_IngestDocumentBatchResponse as IngestDocumentBatchResponse, ingestion_IngestDocumentRequest as IngestDocumentRequest, ingestion_IngestDocumentResponse as IngestDocumentResponse, ingestion_IngestMarkdownBatchRequest as IngestMarkdownBatchRequest, ingestion_IngestMarkdownRequest as IngestMarkdownRequest, ingestion_IngestMarkdownResponse as IngestMarkdownResponse, ingestion_IngestRdfRequest as IngestRdfRequest, ingestion_IngestRdfResponse as IngestRdfResponse, ingestion_IngestionConfigDto as IngestionConfigDto, ingestion_IngestionPollOptions as IngestionPollOptions, ingestion_IngestionSessionResponse as IngestionSessionResponse, ingestion_IngestionSessionStatusDto as IngestionSessionStatusDto, ingestion_IngestionStatsDto as IngestionStatsDto, ingestion_ListIncompleteDocumentsResponse as ListIncompleteDocumentsResponse, ingestion_ListIngestionSessionsResponse as ListIngestionSessionsResponse, ingestion_MarkdownDocumentDto as MarkdownDocumentDto, ingestion_OcrConfigDto as OcrConfigDto, ingestion_ParsedDocumentMetadataDto as ParsedDocumentMetadataDto, ingestion_PendingReviewDto as PendingReviewDto, ingestion_PipelineQualityStatsDto as PipelineQualityStatsDto, ingestion_RdfFormatDto as RdfFormatDto, ingestion_ResumeDocumentIngestionRequest as ResumeDocumentIngestionRequest, ingestion_ResumeDocumentIngestionResponse as ResumeDocumentIngestionResponse, ingestion_SessionProgressResponse as SessionProgressResponse, ingestion_SessionStatsResponse as SessionStatsResponse, ingestion_StartIngestionSessionRequest as StartIngestionSessionRequest, ingestion_StepLogEntryDto as StepLogEntryDto, ingestion_TokenUsageDto as TokenUsageDto };
|
|
26960
|
+
}
|
|
26961
|
+
|
|
26962
|
+
/**
|
|
26963
|
+
* Base error class for all Reasoning Layer SDK errors.
|
|
26964
|
+
*
|
|
26965
|
+
* All errors thrown by the SDK extend this class, enabling catch-all handling:
|
|
26966
|
+
* ```typescript
|
|
26967
|
+
* try { ... } catch (e) {
|
|
26968
|
+
* if (e instanceof ReasoningLayerError) { ... }
|
|
26969
|
+
* }
|
|
26970
|
+
* ```
|
|
26971
|
+
*/
|
|
26972
|
+
declare class ReasoningLayerError extends Error {
|
|
26973
|
+
name: string;
|
|
26974
|
+
constructor(message: string, options?: {
|
|
26975
|
+
cause?: Error;
|
|
26976
|
+
});
|
|
26977
|
+
}
|
|
26978
|
+
/**
|
|
26979
|
+
* HTTP API error (4xx/5xx response from the backend).
|
|
26980
|
+
*
|
|
26981
|
+
* Carries the HTTP status code, parsed response body, and response headers.
|
|
26982
|
+
*/
|
|
26983
|
+
declare class ApiError extends ReasoningLayerError {
|
|
26984
|
+
name: string;
|
|
26985
|
+
/** HTTP status code. */
|
|
26986
|
+
readonly status: number;
|
|
26987
|
+
/** Backend error code (from response body `error` field), if present. */
|
|
26988
|
+
readonly errorCode: string | undefined;
|
|
26989
|
+
/** Parsed response body. */
|
|
26990
|
+
readonly body: unknown;
|
|
26991
|
+
/** Response headers. */
|
|
26992
|
+
readonly headers: Headers;
|
|
26993
|
+
constructor(message: string, status: number, body: unknown, headers: Headers, errorCode?: string);
|
|
26994
|
+
}
|
|
26995
|
+
/**
|
|
26996
|
+
* Bad request error (HTTP 400).
|
|
26997
|
+
*
|
|
26998
|
+
* The request was malformed or contained invalid parameters.
|
|
26999
|
+
*/
|
|
27000
|
+
declare class BadRequestError extends ApiError {
|
|
27001
|
+
name: string;
|
|
27002
|
+
constructor(message: string, body: unknown, headers: Headers, errorCode?: string);
|
|
27003
|
+
}
|
|
27004
|
+
/**
|
|
27005
|
+
* Authentication error (HTTP 401).
|
|
27006
|
+
*
|
|
27007
|
+
* The request lacked valid authentication credentials.
|
|
27008
|
+
*/
|
|
27009
|
+
declare class AuthenticationError extends ApiError {
|
|
27010
|
+
name: string;
|
|
27011
|
+
constructor(message: string, body: unknown, headers: Headers, errorCode?: string);
|
|
27012
|
+
}
|
|
27013
|
+
/**
|
|
27014
|
+
* Forbidden error (HTTP 403).
|
|
27015
|
+
*
|
|
27016
|
+
* The authenticated user does not have permission to perform the requested action.
|
|
27017
|
+
*/
|
|
27018
|
+
declare class ForbiddenError extends ApiError {
|
|
27019
|
+
name: string;
|
|
27020
|
+
constructor(message: string, body: unknown, headers: Headers, errorCode?: string);
|
|
27021
|
+
}
|
|
27022
|
+
/**
|
|
27023
|
+
* Not found error (HTTP 404).
|
|
27024
|
+
*
|
|
27025
|
+
* The requested resource does not exist.
|
|
27026
|
+
*/
|
|
27027
|
+
declare class NotFoundError extends ApiError {
|
|
27028
|
+
name: string;
|
|
27029
|
+
constructor(message: string, body: unknown, headers: Headers, errorCode?: string);
|
|
27030
|
+
}
|
|
27031
|
+
/**
|
|
27032
|
+
* Constraint violation error (HTTP 409).
|
|
27033
|
+
*
|
|
27034
|
+
* A type constraint or uniqueness constraint was violated.
|
|
27035
|
+
* Carries structured information about which term, feature, and constraint failed.
|
|
27036
|
+
*/
|
|
27037
|
+
declare class ConstraintViolationError extends ApiError {
|
|
27038
|
+
name: string;
|
|
27039
|
+
/** Term ID that violated the constraint, if available. */
|
|
27040
|
+
readonly termId: string | undefined;
|
|
27041
|
+
/** Feature name that violated the constraint, if available. */
|
|
27042
|
+
readonly feature: string | undefined;
|
|
27043
|
+
/** Constraint description, if available. */
|
|
27044
|
+
readonly constraint: string | undefined;
|
|
27045
|
+
constructor(message: string, body: unknown, headers: Headers, errorCode?: string, termId?: string, feature?: string, constraint?: string);
|
|
27046
|
+
}
|
|
27047
|
+
/**
|
|
27048
|
+
* Rate limit error (HTTP 429).
|
|
27049
|
+
*
|
|
27050
|
+
* The request was rate-limited. Carries rate limit metadata from response headers.
|
|
27051
|
+
*/
|
|
27052
|
+
declare class RateLimitError extends ApiError {
|
|
27053
|
+
name: string;
|
|
27054
|
+
/** Seconds to wait before retrying, or null if not specified. */
|
|
27055
|
+
readonly retryAfter: number | null;
|
|
27056
|
+
/** Maximum requests allowed in the current window, or null if not specified. */
|
|
27057
|
+
readonly limit: number | null;
|
|
27058
|
+
/** Requests remaining in the current window, or null if not specified. */
|
|
27059
|
+
readonly remaining: number | null;
|
|
27060
|
+
constructor(message: string, body: unknown, headers: Headers, errorCode?: string, retryAfter?: number | null, limit?: number | null, remaining?: number | null);
|
|
27061
|
+
}
|
|
27062
|
+
/**
|
|
27063
|
+
* Internal server error (HTTP 500+).
|
|
27064
|
+
*
|
|
27065
|
+
* An unexpected error occurred on the backend.
|
|
27066
|
+
*/
|
|
27067
|
+
declare class InternalServerError extends ApiError {
|
|
27068
|
+
name: string;
|
|
27069
|
+
constructor(message: string, status: number, body: unknown, headers: Headers, errorCode?: string);
|
|
27070
|
+
}
|
|
27071
|
+
/**
|
|
27072
|
+
* Timeout error.
|
|
27073
|
+
*
|
|
27074
|
+
* The request exceeded the configured timeout duration.
|
|
27075
|
+
*/
|
|
27076
|
+
declare class TimeoutError extends ReasoningLayerError {
|
|
27077
|
+
name: string;
|
|
27078
|
+
/** The timeout duration in milliseconds that was exceeded. */
|
|
27079
|
+
readonly timeoutMs: number;
|
|
27080
|
+
constructor(timeoutMs: number);
|
|
27081
|
+
}
|
|
27082
|
+
/**
|
|
27083
|
+
* Client-side validation error.
|
|
27084
|
+
*
|
|
27085
|
+
* Thrown before a request is sent when input fails client-side validation.
|
|
27086
|
+
*/
|
|
27087
|
+
declare class ValidationError extends ReasoningLayerError {
|
|
27088
|
+
name: string;
|
|
27089
|
+
/** The field that failed validation, if applicable. */
|
|
27090
|
+
readonly field: string | undefined;
|
|
27091
|
+
constructor(message: string, field?: string);
|
|
27092
|
+
}
|
|
27093
|
+
/**
|
|
27094
|
+
* Network error.
|
|
27095
|
+
*
|
|
27096
|
+
* Wraps `fetch` connection failures (DNS resolution, connection refused, etc.).
|
|
27097
|
+
*/
|
|
27098
|
+
declare class NetworkError extends ReasoningLayerError {
|
|
27099
|
+
name: string;
|
|
27100
|
+
constructor(message: string, cause?: Error);
|
|
27101
|
+
}
|
|
27102
|
+
|
|
27103
|
+
/**
|
|
27104
|
+
* Error thrown when an async ingestion session fails on the backend.
|
|
27105
|
+
*
|
|
27106
|
+
* @remarks
|
|
27107
|
+
* Detected during polling when the session status transitions to `"failed"`.
|
|
27108
|
+
*/
|
|
27109
|
+
declare class IngestionFailedError extends ReasoningLayerError {
|
|
27110
|
+
name: string;
|
|
27111
|
+
/** The session ID that failed. */
|
|
27112
|
+
readonly sessionId: string;
|
|
27113
|
+
/** The last known session state. */
|
|
27114
|
+
readonly session: IngestionSessionResponse;
|
|
27115
|
+
constructor(session: IngestionSessionResponse);
|
|
27116
|
+
}
|
|
27117
|
+
/**
|
|
27118
|
+
* Handle for an async ingestion session, returned when `sync: false`.
|
|
27119
|
+
*
|
|
27120
|
+
* Provides methods to poll for completion, check progress, and retrieve
|
|
27121
|
+
* final stats. Wraps the session tracking endpoints.
|
|
27122
|
+
*
|
|
27123
|
+
* @example
|
|
27124
|
+
* ```ts
|
|
27125
|
+
* const session = await client.ingestion.ingestMarkdown(request, { sync: false });
|
|
27126
|
+
* console.log(session.sessionId); // UUID
|
|
27127
|
+
*
|
|
27128
|
+
* // Poll until done (with optional progress callback)
|
|
27129
|
+
* const stats = await session.waitForCompletion({
|
|
27130
|
+
* onProgress: (p) => console.log(p.documents[0]?.currentStepLabel),
|
|
27131
|
+
* pollIntervalMs: 3000,
|
|
27132
|
+
* });
|
|
27133
|
+
*
|
|
27134
|
+
* // Or check manually
|
|
27135
|
+
* const progress = await session.getProgress();
|
|
27136
|
+
* const sessionInfo = await session.getSession();
|
|
27137
|
+
* ```
|
|
27138
|
+
*
|
|
27139
|
+
* @remarks
|
|
27140
|
+
* The session handle does not hold an open connection. All methods
|
|
27141
|
+
* are independent HTTP requests using the session endpoints.
|
|
27142
|
+
*/
|
|
27143
|
+
declare class IngestionSession {
|
|
27144
|
+
/** The session ID (UUID). */
|
|
27145
|
+
readonly sessionId: string;
|
|
27146
|
+
/** The document ID (UUID). */
|
|
27147
|
+
readonly documentId: string;
|
|
27148
|
+
/** The initial status (always `"pending"` on creation). */
|
|
27149
|
+
readonly status: string;
|
|
27150
|
+
/** URL path to check session status. */
|
|
27151
|
+
readonly statusUrl: string;
|
|
27152
|
+
/** @internal */
|
|
27153
|
+
private readonly api;
|
|
27154
|
+
/** @internal */
|
|
27155
|
+
constructor(api: Ingestion, response: AsyncIngestionResponse);
|
|
27156
|
+
/**
|
|
27157
|
+
* Get the current session details (status, document counts).
|
|
27158
|
+
*
|
|
27159
|
+
* @returns The session information.
|
|
27160
|
+
*
|
|
27161
|
+
* @remarks
|
|
27162
|
+
* Maps to `GET /api/v1/ingest/sessions/{session_id}`.
|
|
27163
|
+
*/
|
|
27164
|
+
getSession(): Promise<IngestionSessionResponse>;
|
|
27165
|
+
/**
|
|
27166
|
+
* Get live pipeline progress for all documents in the session.
|
|
27167
|
+
*
|
|
27168
|
+
* @returns Progress snapshots for each document being processed.
|
|
27169
|
+
*
|
|
27170
|
+
* @remarks
|
|
27171
|
+
* Maps to `GET /api/v1/ingest/sessions/{session_id}/progress`.
|
|
27172
|
+
* Returns real-time counters, current pipeline step, and step log.
|
|
27173
|
+
*/
|
|
27174
|
+
getProgress(): Promise<SessionProgressResponse>;
|
|
27175
|
+
/**
|
|
27176
|
+
* Get stats for all completed documents in the session.
|
|
27177
|
+
*
|
|
27178
|
+
* @returns Per-document stats (term IDs, sort names, token usage, etc.).
|
|
27179
|
+
*
|
|
27180
|
+
* @remarks
|
|
27181
|
+
* Maps to `GET /api/v1/ingest/sessions/{session_id}/stats`.
|
|
27182
|
+
* May be empty if no documents have completed yet.
|
|
27183
|
+
*/
|
|
27184
|
+
getStats(): Promise<SessionStatsResponse>;
|
|
27185
|
+
/**
|
|
27186
|
+
* Poll the session until it completes or fails, then return final stats.
|
|
27187
|
+
*
|
|
27188
|
+
* @param options - Polling configuration (interval, timeout, progress callback, abort signal).
|
|
27189
|
+
* @returns Final session stats once all documents are complete.
|
|
27190
|
+
* @throws {@link IngestionFailedError} If the session status becomes `"failed"`.
|
|
27191
|
+
* @throws {@link TimeoutError} If `timeoutMs` is exceeded.
|
|
27192
|
+
* @throws {@link ReasoningLayerError} If the abort signal is triggered.
|
|
27193
|
+
*
|
|
27194
|
+
* @example
|
|
27195
|
+
* ```ts
|
|
27196
|
+
* const stats = await session.waitForCompletion({
|
|
27197
|
+
* pollIntervalMs: 2000,
|
|
27198
|
+
* timeoutMs: 300_000,
|
|
27199
|
+
* onProgress: (p) => {
|
|
27200
|
+
* const doc = p.documents[0];
|
|
27201
|
+
* if (doc) console.log(`${doc.currentStepLabel} — chunk ${doc.chunksProcessed}/${doc.totalChunks}`);
|
|
27202
|
+
* },
|
|
27203
|
+
* });
|
|
27204
|
+
* console.log(`Created ${stats.documents[0]?.termIds.length} terms`);
|
|
27205
|
+
* ```
|
|
27206
|
+
*
|
|
27207
|
+
* @remarks
|
|
27208
|
+
* Polls `getSession()` to check status, and calls `onProgress` with live
|
|
27209
|
+
* progress data between checks. Terminal states are `"complete"` and `"failed"`.
|
|
27210
|
+
*/
|
|
27211
|
+
waitForCompletion(options?: IngestionPollOptions): Promise<SessionStatsResponse>;
|
|
27212
|
+
/** @internal */
|
|
27213
|
+
private sleep;
|
|
26782
27214
|
}
|
|
26783
27215
|
|
|
27216
|
+
/**
|
|
27217
|
+
* Options controlling synchronous vs asynchronous ingestion.
|
|
27218
|
+
*
|
|
27219
|
+
* @remarks
|
|
27220
|
+
* When `sync` is `true` (default), the request blocks until LLM extraction
|
|
27221
|
+
* completes and returns the full result. When `sync` is `false`, the backend
|
|
27222
|
+
* returns immediately with HTTP 202 and an {@link IngestionSession} handle
|
|
27223
|
+
* for polling progress.
|
|
27224
|
+
*/
|
|
27225
|
+
interface IngestionSyncOptions {
|
|
27226
|
+
/**
|
|
27227
|
+
* Whether to process synchronously.
|
|
27228
|
+
*
|
|
27229
|
+
* - `true` (default): blocks until complete, returns full result.
|
|
27230
|
+
* - `false`: returns immediately with an {@link IngestionSession} handle.
|
|
27231
|
+
*
|
|
27232
|
+
* @defaultValue true
|
|
27233
|
+
*/
|
|
27234
|
+
sync?: boolean;
|
|
27235
|
+
}
|
|
26784
27236
|
/**
|
|
26785
27237
|
* Resource client for document, markdown, and RDF ingestion.
|
|
26786
27238
|
*
|
|
@@ -26790,6 +27242,10 @@ declare namespace ingestion {
|
|
|
26790
27242
|
* tracking with resumption for incomplete documents.
|
|
26791
27243
|
* Uses normalizers to convert between camelCase (SDK surface) and
|
|
26792
27244
|
* snake_case (wire format) at the boundary.
|
|
27245
|
+
*
|
|
27246
|
+
* All ingestion methods that support the `sync` query parameter accept
|
|
27247
|
+
* an optional `{ sync: false }` option to enable async mode, returning
|
|
27248
|
+
* an {@link IngestionSession} handle instead of blocking for the result.
|
|
26793
27249
|
*/
|
|
26794
27250
|
declare class IngestionClient {
|
|
26795
27251
|
/** @internal */
|
|
@@ -26797,30 +27253,57 @@ declare class IngestionClient {
|
|
|
26797
27253
|
/** @internal */
|
|
26798
27254
|
constructor(api: Ingestion);
|
|
26799
27255
|
/**
|
|
26800
|
-
* Ingest
|
|
27256
|
+
* Ingest markdown content synchronously (default).
|
|
26801
27257
|
*
|
|
26802
|
-
* @param request -
|
|
26803
|
-
* @returns Ingestion
|
|
27258
|
+
* @param request - Markdown ingestion request with content and owner.
|
|
27259
|
+
* @returns Ingestion statistics and review items.
|
|
26804
27260
|
*/
|
|
26805
|
-
|
|
27261
|
+
ingestMarkdown(request: IngestMarkdownRequest): Promise<IngestMarkdownResponse>;
|
|
26806
27262
|
/**
|
|
26807
|
-
* Ingest
|
|
27263
|
+
* Ingest markdown content synchronously.
|
|
26808
27264
|
*
|
|
26809
|
-
* @param request -
|
|
26810
|
-
* @
|
|
27265
|
+
* @param request - Markdown ingestion request with content and owner.
|
|
27266
|
+
* @param options - Options with `sync: true`.
|
|
27267
|
+
* @returns Ingestion statistics and review items.
|
|
26811
27268
|
*/
|
|
26812
|
-
|
|
27269
|
+
ingestMarkdown(request: IngestMarkdownRequest, options: {
|
|
27270
|
+
sync: true;
|
|
27271
|
+
}): Promise<IngestMarkdownResponse>;
|
|
26813
27272
|
/**
|
|
26814
|
-
* Ingest markdown content.
|
|
27273
|
+
* Ingest markdown content asynchronously.
|
|
26815
27274
|
*
|
|
26816
27275
|
* @param request - Markdown ingestion request with content and owner.
|
|
26817
|
-
* @
|
|
27276
|
+
* @param options - Options with `sync: false`.
|
|
27277
|
+
* @returns An {@link IngestionSession} handle for polling progress and retrieving stats.
|
|
27278
|
+
*
|
|
27279
|
+
* @example
|
|
27280
|
+
* ```ts
|
|
27281
|
+
* // Fire-and-forget with polling
|
|
27282
|
+
* const session = await client.ingestion.ingestMarkdown(request, { sync: false });
|
|
27283
|
+
* const stats = await session.waitForCompletion({
|
|
27284
|
+
* onProgress: (p) => console.log(p.documents[0]?.currentStepLabel),
|
|
27285
|
+
* });
|
|
27286
|
+
*
|
|
27287
|
+
* // Or check manually
|
|
27288
|
+
* const progress = await session.getProgress();
|
|
27289
|
+
* ```
|
|
26818
27290
|
*
|
|
26819
27291
|
* @remarks
|
|
26820
|
-
*
|
|
26821
|
-
*
|
|
27292
|
+
* The backend returns HTTP 202 with a session ID. Use the returned
|
|
27293
|
+
* {@link IngestionSession} to poll for completion, check progress,
|
|
27294
|
+
* or retrieve final stats. The session supports `AbortSignal` for cancellation.
|
|
26822
27295
|
*/
|
|
26823
|
-
ingestMarkdown(request: IngestMarkdownRequest
|
|
27296
|
+
ingestMarkdown(request: IngestMarkdownRequest, options: {
|
|
27297
|
+
sync: false;
|
|
27298
|
+
}): Promise<IngestionSession>;
|
|
27299
|
+
/**
|
|
27300
|
+
* Ingest markdown content with configurable sync/async mode.
|
|
27301
|
+
*
|
|
27302
|
+
* @param request - Markdown ingestion request with content and owner.
|
|
27303
|
+
* @param options - Options with `sync` flag.
|
|
27304
|
+
* @returns Either the full result (sync) or an {@link IngestionSession} handle (async).
|
|
27305
|
+
*/
|
|
27306
|
+
ingestMarkdown(request: IngestMarkdownRequest, options: IngestionSyncOptions): Promise<IngestMarkdownResponse | IngestionSession>;
|
|
26824
27307
|
/**
|
|
26825
27308
|
* Ingest a batch of markdown documents.
|
|
26826
27309
|
*
|
|
@@ -26831,6 +27314,84 @@ declare class IngestionClient {
|
|
|
26831
27314
|
* The generated endpoint returns void; we use a fallback to get the typed response.
|
|
26832
27315
|
*/
|
|
26833
27316
|
ingestMarkdownBatch(request: IngestMarkdownBatchRequest): Promise<IngestMarkdownResponse>;
|
|
27317
|
+
/**
|
|
27318
|
+
* Ingest a single document synchronously (default).
|
|
27319
|
+
*
|
|
27320
|
+
* @param request - Document ingestion request with source, config, and owner.
|
|
27321
|
+
* @returns Ingestion result with stats, metadata, and parse info.
|
|
27322
|
+
*/
|
|
27323
|
+
ingestDocument(request: IngestDocumentRequest): Promise<IngestDocumentResponse>;
|
|
27324
|
+
/**
|
|
27325
|
+
* Ingest a single document synchronously.
|
|
27326
|
+
*
|
|
27327
|
+
* @param request - Document ingestion request with source, config, and owner.
|
|
27328
|
+
* @param options - Options with `sync: true`.
|
|
27329
|
+
* @returns Ingestion result with stats, metadata, and parse info.
|
|
27330
|
+
*/
|
|
27331
|
+
ingestDocument(request: IngestDocumentRequest, options: {
|
|
27332
|
+
sync: true;
|
|
27333
|
+
}): Promise<IngestDocumentResponse>;
|
|
27334
|
+
/**
|
|
27335
|
+
* Ingest a single document asynchronously.
|
|
27336
|
+
*
|
|
27337
|
+
* @param request - Document ingestion request with source, config, and owner.
|
|
27338
|
+
* @param options - Options with `sync: false`.
|
|
27339
|
+
* @returns An {@link IngestionSession} handle for polling progress and retrieving stats.
|
|
27340
|
+
*
|
|
27341
|
+
* @remarks
|
|
27342
|
+
* The backend returns HTTP 202 with a session ID. Use the returned
|
|
27343
|
+
* {@link IngestionSession} to poll for completion.
|
|
27344
|
+
*/
|
|
27345
|
+
ingestDocument(request: IngestDocumentRequest, options: {
|
|
27346
|
+
sync: false;
|
|
27347
|
+
}): Promise<IngestionSession>;
|
|
27348
|
+
/**
|
|
27349
|
+
* Ingest a single document with configurable sync/async mode.
|
|
27350
|
+
*
|
|
27351
|
+
* @param request - Document ingestion request with source, config, and owner.
|
|
27352
|
+
* @param options - Options with `sync` flag.
|
|
27353
|
+
* @returns Either the full result (sync) or an {@link IngestionSession} handle (async).
|
|
27354
|
+
*/
|
|
27355
|
+
ingestDocument(request: IngestDocumentRequest, options: IngestionSyncOptions): Promise<IngestDocumentResponse | IngestionSession>;
|
|
27356
|
+
/**
|
|
27357
|
+
* Ingest a batch of documents synchronously (default).
|
|
27358
|
+
*
|
|
27359
|
+
* @param request - Batch ingestion request with documents, config, and owner.
|
|
27360
|
+
* @returns Batch results with per-document status.
|
|
27361
|
+
*/
|
|
27362
|
+
ingestDocumentBatch(request: IngestDocumentBatchRequest): Promise<IngestDocumentBatchResponse>;
|
|
27363
|
+
/**
|
|
27364
|
+
* Ingest a batch of documents synchronously.
|
|
27365
|
+
*
|
|
27366
|
+
* @param request - Batch ingestion request with documents, config, and owner.
|
|
27367
|
+
* @param options - Options with `sync: true`.
|
|
27368
|
+
* @returns Batch results with per-document status.
|
|
27369
|
+
*/
|
|
27370
|
+
ingestDocumentBatch(request: IngestDocumentBatchRequest, options: {
|
|
27371
|
+
sync: true;
|
|
27372
|
+
}): Promise<IngestDocumentBatchResponse>;
|
|
27373
|
+
/**
|
|
27374
|
+
* Ingest a batch of documents asynchronously.
|
|
27375
|
+
*
|
|
27376
|
+
* @param request - Batch ingestion request with documents, config, and owner.
|
|
27377
|
+
* @param options - Options with `sync: false`.
|
|
27378
|
+
* @returns An {@link IngestionSession} handle for polling progress and retrieving stats.
|
|
27379
|
+
*
|
|
27380
|
+
* @remarks
|
|
27381
|
+
* The backend returns HTTP 202 with a session ID. Use the returned
|
|
27382
|
+
* {@link IngestionSession} to poll for completion.
|
|
27383
|
+
*/
|
|
27384
|
+
ingestDocumentBatch(request: IngestDocumentBatchRequest, options: {
|
|
27385
|
+
sync: false;
|
|
27386
|
+
}): Promise<IngestionSession>;
|
|
27387
|
+
/**
|
|
27388
|
+
* Ingest a batch of documents with configurable sync/async mode.
|
|
27389
|
+
*
|
|
27390
|
+
* @param request - Batch ingestion request with documents, config, and owner.
|
|
27391
|
+
* @param options - Options with `sync` flag.
|
|
27392
|
+
* @returns Either the full result (sync) or an {@link IngestionSession} handle (async).
|
|
27393
|
+
*/
|
|
27394
|
+
ingestDocumentBatch(request: IngestDocumentBatchRequest, options: IngestionSyncOptions): Promise<IngestDocumentBatchResponse | IngestionSession>;
|
|
26834
27395
|
/**
|
|
26835
27396
|
* Ingest RDF content (Turtle, N-Triples, RDF/XML, or JSON-LD).
|
|
26836
27397
|
*
|
|
@@ -26864,6 +27425,28 @@ declare class IngestionClient {
|
|
|
26864
27425
|
* @param sessionId - Session UUID.
|
|
26865
27426
|
*/
|
|
26866
27427
|
deleteSession(sessionId: string): Promise<void>;
|
|
27428
|
+
/**
|
|
27429
|
+
* Get live pipeline progress for all documents in a session.
|
|
27430
|
+
*
|
|
27431
|
+
* @param sessionId - Session UUID.
|
|
27432
|
+
* @returns Progress snapshots for each document being processed.
|
|
27433
|
+
*
|
|
27434
|
+
* @remarks
|
|
27435
|
+
* Maps to `GET /api/v1/ingest/sessions/{session_id}/progress`.
|
|
27436
|
+
* Returns real-time counters, current pipeline step, and step log.
|
|
27437
|
+
*/
|
|
27438
|
+
getSessionProgress(sessionId: string): Promise<SessionProgressResponse>;
|
|
27439
|
+
/**
|
|
27440
|
+
* Get stats for all completed documents in a session.
|
|
27441
|
+
*
|
|
27442
|
+
* @param sessionId - Session UUID.
|
|
27443
|
+
* @returns Per-document stats (term IDs, sort names, token usage, etc.).
|
|
27444
|
+
*
|
|
27445
|
+
* @remarks
|
|
27446
|
+
* Maps to `GET /api/v1/ingest/sessions/{session_id}/stats`.
|
|
27447
|
+
* May be empty if no documents have completed yet.
|
|
27448
|
+
*/
|
|
27449
|
+
getSessionStats(sessionId: string): Promise<SessionStatsResponse>;
|
|
26867
27450
|
/**
|
|
26868
27451
|
* List incomplete documents in a session that can be resumed.
|
|
26869
27452
|
*
|
|
@@ -39532,147 +40115,6 @@ declare class ReasoningLayerClient {
|
|
|
39532
40115
|
constructor(config: ClientConfig);
|
|
39533
40116
|
}
|
|
39534
40117
|
|
|
39535
|
-
/**
|
|
39536
|
-
* Base error class for all Reasoning Layer SDK errors.
|
|
39537
|
-
*
|
|
39538
|
-
* All errors thrown by the SDK extend this class, enabling catch-all handling:
|
|
39539
|
-
* ```typescript
|
|
39540
|
-
* try { ... } catch (e) {
|
|
39541
|
-
* if (e instanceof ReasoningLayerError) { ... }
|
|
39542
|
-
* }
|
|
39543
|
-
* ```
|
|
39544
|
-
*/
|
|
39545
|
-
declare class ReasoningLayerError extends Error {
|
|
39546
|
-
name: string;
|
|
39547
|
-
constructor(message: string, options?: {
|
|
39548
|
-
cause?: Error;
|
|
39549
|
-
});
|
|
39550
|
-
}
|
|
39551
|
-
/**
|
|
39552
|
-
* HTTP API error (4xx/5xx response from the backend).
|
|
39553
|
-
*
|
|
39554
|
-
* Carries the HTTP status code, parsed response body, and response headers.
|
|
39555
|
-
*/
|
|
39556
|
-
declare class ApiError extends ReasoningLayerError {
|
|
39557
|
-
name: string;
|
|
39558
|
-
/** HTTP status code. */
|
|
39559
|
-
readonly status: number;
|
|
39560
|
-
/** Backend error code (from response body `error` field), if present. */
|
|
39561
|
-
readonly errorCode: string | undefined;
|
|
39562
|
-
/** Parsed response body. */
|
|
39563
|
-
readonly body: unknown;
|
|
39564
|
-
/** Response headers. */
|
|
39565
|
-
readonly headers: Headers;
|
|
39566
|
-
constructor(message: string, status: number, body: unknown, headers: Headers, errorCode?: string);
|
|
39567
|
-
}
|
|
39568
|
-
/**
|
|
39569
|
-
* Bad request error (HTTP 400).
|
|
39570
|
-
*
|
|
39571
|
-
* The request was malformed or contained invalid parameters.
|
|
39572
|
-
*/
|
|
39573
|
-
declare class BadRequestError extends ApiError {
|
|
39574
|
-
name: string;
|
|
39575
|
-
constructor(message: string, body: unknown, headers: Headers, errorCode?: string);
|
|
39576
|
-
}
|
|
39577
|
-
/**
|
|
39578
|
-
* Authentication error (HTTP 401).
|
|
39579
|
-
*
|
|
39580
|
-
* The request lacked valid authentication credentials.
|
|
39581
|
-
*/
|
|
39582
|
-
declare class AuthenticationError extends ApiError {
|
|
39583
|
-
name: string;
|
|
39584
|
-
constructor(message: string, body: unknown, headers: Headers, errorCode?: string);
|
|
39585
|
-
}
|
|
39586
|
-
/**
|
|
39587
|
-
* Forbidden error (HTTP 403).
|
|
39588
|
-
*
|
|
39589
|
-
* The authenticated user does not have permission to perform the requested action.
|
|
39590
|
-
*/
|
|
39591
|
-
declare class ForbiddenError extends ApiError {
|
|
39592
|
-
name: string;
|
|
39593
|
-
constructor(message: string, body: unknown, headers: Headers, errorCode?: string);
|
|
39594
|
-
}
|
|
39595
|
-
/**
|
|
39596
|
-
* Not found error (HTTP 404).
|
|
39597
|
-
*
|
|
39598
|
-
* The requested resource does not exist.
|
|
39599
|
-
*/
|
|
39600
|
-
declare class NotFoundError extends ApiError {
|
|
39601
|
-
name: string;
|
|
39602
|
-
constructor(message: string, body: unknown, headers: Headers, errorCode?: string);
|
|
39603
|
-
}
|
|
39604
|
-
/**
|
|
39605
|
-
* Constraint violation error (HTTP 409).
|
|
39606
|
-
*
|
|
39607
|
-
* A type constraint or uniqueness constraint was violated.
|
|
39608
|
-
* Carries structured information about which term, feature, and constraint failed.
|
|
39609
|
-
*/
|
|
39610
|
-
declare class ConstraintViolationError extends ApiError {
|
|
39611
|
-
name: string;
|
|
39612
|
-
/** Term ID that violated the constraint, if available. */
|
|
39613
|
-
readonly termId: string | undefined;
|
|
39614
|
-
/** Feature name that violated the constraint, if available. */
|
|
39615
|
-
readonly feature: string | undefined;
|
|
39616
|
-
/** Constraint description, if available. */
|
|
39617
|
-
readonly constraint: string | undefined;
|
|
39618
|
-
constructor(message: string, body: unknown, headers: Headers, errorCode?: string, termId?: string, feature?: string, constraint?: string);
|
|
39619
|
-
}
|
|
39620
|
-
/**
|
|
39621
|
-
* Rate limit error (HTTP 429).
|
|
39622
|
-
*
|
|
39623
|
-
* The request was rate-limited. Carries rate limit metadata from response headers.
|
|
39624
|
-
*/
|
|
39625
|
-
declare class RateLimitError extends ApiError {
|
|
39626
|
-
name: string;
|
|
39627
|
-
/** Seconds to wait before retrying, or null if not specified. */
|
|
39628
|
-
readonly retryAfter: number | null;
|
|
39629
|
-
/** Maximum requests allowed in the current window, or null if not specified. */
|
|
39630
|
-
readonly limit: number | null;
|
|
39631
|
-
/** Requests remaining in the current window, or null if not specified. */
|
|
39632
|
-
readonly remaining: number | null;
|
|
39633
|
-
constructor(message: string, body: unknown, headers: Headers, errorCode?: string, retryAfter?: number | null, limit?: number | null, remaining?: number | null);
|
|
39634
|
-
}
|
|
39635
|
-
/**
|
|
39636
|
-
* Internal server error (HTTP 500+).
|
|
39637
|
-
*
|
|
39638
|
-
* An unexpected error occurred on the backend.
|
|
39639
|
-
*/
|
|
39640
|
-
declare class InternalServerError extends ApiError {
|
|
39641
|
-
name: string;
|
|
39642
|
-
constructor(message: string, status: number, body: unknown, headers: Headers, errorCode?: string);
|
|
39643
|
-
}
|
|
39644
|
-
/**
|
|
39645
|
-
* Timeout error.
|
|
39646
|
-
*
|
|
39647
|
-
* The request exceeded the configured timeout duration.
|
|
39648
|
-
*/
|
|
39649
|
-
declare class TimeoutError extends ReasoningLayerError {
|
|
39650
|
-
name: string;
|
|
39651
|
-
/** The timeout duration in milliseconds that was exceeded. */
|
|
39652
|
-
readonly timeoutMs: number;
|
|
39653
|
-
constructor(timeoutMs: number);
|
|
39654
|
-
}
|
|
39655
|
-
/**
|
|
39656
|
-
* Client-side validation error.
|
|
39657
|
-
*
|
|
39658
|
-
* Thrown before a request is sent when input fails client-side validation.
|
|
39659
|
-
*/
|
|
39660
|
-
declare class ValidationError extends ReasoningLayerError {
|
|
39661
|
-
name: string;
|
|
39662
|
-
/** The field that failed validation, if applicable. */
|
|
39663
|
-
readonly field: string | undefined;
|
|
39664
|
-
constructor(message: string, field?: string);
|
|
39665
|
-
}
|
|
39666
|
-
/**
|
|
39667
|
-
* Network error.
|
|
39668
|
-
*
|
|
39669
|
-
* Wraps `fetch` connection failures (DNS resolution, connection refused, etc.).
|
|
39670
|
-
*/
|
|
39671
|
-
declare class NetworkError extends ReasoningLayerError {
|
|
39672
|
-
name: string;
|
|
39673
|
-
constructor(message: string, cause?: Error);
|
|
39674
|
-
}
|
|
39675
|
-
|
|
39676
40118
|
/**
|
|
39677
40119
|
* Builder namespace for complex tagged `ValueDto` values that have no plain JS equivalent.
|
|
39678
40120
|
*
|
|
@@ -40708,4 +41150,4 @@ declare function toUntaggedFeatures(features: PlainFeatureMap): Record<string, F
|
|
|
40708
41150
|
*/
|
|
40709
41151
|
declare function toTermInputDto(input: PsiTermInput | TermInputDto): TermInputDto;
|
|
40710
41152
|
|
|
40711
|
-
export { actionReviews as ActionReviews, type AddFactRequest, type AddFactResponse, type AddRuleRequest, type AddRuleResponse, admin as Admin, type AiGroup, analysis as Analysis, type AnalysisGroup, ApiError, type ApiResponse, AuthenticationError, type BackwardChainRequest, type BackwardChainResponse, BadRequestError, type BulkAddTermsRequest, type BulkAddTermsResponse, type BulkCreateSortsRequest, type BulkCreateSortsResponse, cdl as CDL, causal as Causal, type ClearTermsResponse, type ClientConfig, cognitive as Cognitive, collections as Collections, communities as Communities, type ConstrainedPlainVar, ConstraintViolationError, constraints as Constraints, control as Control, conversation as Conversation, type ConversationMessageRequest, type ConversationMessageResponse, type ConversationSummaryDto, type ConversationTurnsResponse, type CoreGroup, type CreateResearchSessionRequest, type CreateResearchSessionResponse, type CreateSortRequest, type CreateTermRequest, type DataGroup, discovery as Discovery, type ErrorResponse$1 as ErrorResponse, execution as Execution, extract as Extract, type FeatureInputValueDto, type FeatureValueDto, ForbiddenError, type ForwardChainRequest, type ForwardChainResponse, functions as Functions, fuzzy as Fuzzy, FuzzyShape, type FuzzyShapeDto, generation as Generation, type GlbRequest, type GlbResponse, health as Health, homoiconic as Homoiconic, ilp as ILP, imageExtraction as ImageExtraction, inference as Inference, type IngestPaperRequest, type IngestPaperResponse, ingestion as Ingestion, type Interceptor, InternalServerError, type JsonValue$1 as JsonValue, LP, type ListConversationsResponse, type LubRequest, type LubResponse, namespaces as Namespaces, NetworkError, neuroSymbolic as NeuroSymbolic, NotFoundError, ontology as Ontology, optimize as Optimize, type OsfSearchRequest, type OsfSearchResponse, osfql as Osfql, type OsfqlRequest, type OsfqlResponse, type OsfqlValue, oversight as Oversight, type PaginationParams, type PaperMetadataDto, type PaperSource, type PlainFeatureMap, type PlainFeatureValue, plainValues as PlainValues, preferences as Preferences, proofEngine as ProofEngine, type PsiTermDto, type PsiTermInput, query as Query, rag as RAG, RateLimitError, type RateLimitInfo, reasoning as Reasoning, type ReasoningGroup, ReasoningLayerClient, ReasoningLayerError, type RequestOptions, research as Research, type ResearchContradictionsResponse, type ResearchCycleResponse, type ResearchFindingsResponse, type ResearchGapsResponse, type ResearchReportResponse, type ResearchSessionResponse, reviews as Reviews, row as Row, SDK_VERSION, scenarios as Scenarios, type SearchPapersRequest, type SearchPapersResponse, SortBuilder, type SortDto, type SortInfoDto, sorts as Sorts, sources as Sources, spaces as Spaces, statistical as Statistical, synthetic as Synthetic, type SystemGroup, type TermDto, type TermInputArg, type TermInputDto, type TermListResponse, type TermPatternDto, type TermResponse, terms as Terms, TimeoutError, type TurnDto, type UpdateTermRequest, utilities as Utilities, ValidationError, Value, type ValueDto, values as Values, type VerifyClaimRequest, type VerifyClaimResponse, visualization as Visualization, WebSocketClient, WebSocketConnection, webhookActions as WebhookActions, type WorkflowGroup, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
|
|
41153
|
+
export { actionReviews as ActionReviews, type AddFactRequest, type AddFactResponse, type AddRuleRequest, type AddRuleResponse, admin as Admin, type AiGroup, analysis as Analysis, type AnalysisGroup, ApiError, type ApiResponse, AuthenticationError, type BackwardChainRequest, type BackwardChainResponse, BadRequestError, type BulkAddTermsRequest, type BulkAddTermsResponse, type BulkCreateSortsRequest, type BulkCreateSortsResponse, cdl as CDL, causal as Causal, type ClearTermsResponse, type ClientConfig, cognitive as Cognitive, collections as Collections, communities as Communities, type ConstrainedPlainVar, ConstraintViolationError, constraints as Constraints, control as Control, conversation as Conversation, type ConversationMessageRequest, type ConversationMessageResponse, type ConversationSummaryDto, type ConversationTurnsResponse, type CoreGroup, type CreateResearchSessionRequest, type CreateResearchSessionResponse, type CreateSortRequest, type CreateTermRequest, type DataGroup, discovery as Discovery, type ErrorResponse$1 as ErrorResponse, execution as Execution, extract as Extract, type FeatureInputValueDto, type FeatureValueDto, ForbiddenError, type ForwardChainRequest, type ForwardChainResponse, functions as Functions, fuzzy as Fuzzy, FuzzyShape, type FuzzyShapeDto, generation as Generation, type GlbRequest, type GlbResponse, health as Health, homoiconic as Homoiconic, ilp as ILP, imageExtraction as ImageExtraction, inference as Inference, type IngestPaperRequest, type IngestPaperResponse, ingestion as Ingestion, IngestionFailedError, IngestionSession, type IngestionSyncOptions, type Interceptor, InternalServerError, type JsonValue$1 as JsonValue, LP, type ListConversationsResponse, type LubRequest, type LubResponse, namespaces as Namespaces, NetworkError, neuroSymbolic as NeuroSymbolic, NotFoundError, ontology as Ontology, optimize as Optimize, type OsfSearchRequest, type OsfSearchResponse, osfql as Osfql, type OsfqlRequest, type OsfqlResponse, type OsfqlValue, oversight as Oversight, type PaginationParams, type PaperMetadataDto, type PaperSource, type PlainFeatureMap, type PlainFeatureValue, plainValues as PlainValues, preferences as Preferences, proofEngine as ProofEngine, type PsiTermDto, type PsiTermInput, query as Query, rag as RAG, RateLimitError, type RateLimitInfo, reasoning as Reasoning, type ReasoningGroup, ReasoningLayerClient, ReasoningLayerError, type RequestOptions, research as Research, type ResearchContradictionsResponse, type ResearchCycleResponse, type ResearchFindingsResponse, type ResearchGapsResponse, type ResearchReportResponse, type ResearchSessionResponse, reviews as Reviews, row as Row, SDK_VERSION, scenarios as Scenarios, type SearchPapersRequest, type SearchPapersResponse, SortBuilder, type SortDto, type SortInfoDto, sorts as Sorts, sources as Sources, spaces as Spaces, statistical as Statistical, synthetic as Synthetic, type SystemGroup, type TermDto, type TermInputArg, type TermInputDto, type TermListResponse, type TermPatternDto, type TermResponse, terms as Terms, TimeoutError, type TurnDto, type UpdateTermRequest, utilities as Utilities, ValidationError, Value, type ValueDto, values as Values, type VerifyClaimRequest, type VerifyClaimResponse, visualization as Visualization, WebSocketClient, WebSocketConnection, webhookActions as WebhookActions, type WorkflowGroup, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
|