@ontos-ai/knowhere-sdk 2.4.2 → 2.6.0-beta.20261026172248
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/README.md +12 -0
- package/dist/chunk-FESTKAG6.mjs +1343 -0
- package/dist/index.d.mts +49 -3
- package/dist/index.d.ts +49 -3
- package/dist/index.js +1556 -482
- package/dist/index.mjs +145 -565
- package/dist/sequential-parsed-document-archive-YQ5U3VWM.mjs +143 -0
- package/package.json +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -428,6 +428,7 @@ interface ParsedDocumentObjectParams extends ParsedDocumentRevisionParams {
|
|
|
428
428
|
readonly path: string;
|
|
429
429
|
}
|
|
430
430
|
interface ParsedDocumentObjectHead extends ParsedDocumentObjectParams {
|
|
431
|
+
readonly entityTag?: string;
|
|
431
432
|
readonly contentType?: string;
|
|
432
433
|
readonly contentLength?: number;
|
|
433
434
|
readonly metadata?: Readonly<Record<string, string>>;
|
|
@@ -441,7 +442,15 @@ interface ParsedDocumentWriteObjectParams extends ParsedDocumentObjectParams {
|
|
|
441
442
|
readonly contentType: string;
|
|
442
443
|
readonly metadata?: Readonly<Record<string, string>>;
|
|
443
444
|
}
|
|
445
|
+
/** Stream sinks must consume the body before resolving and reject partial writes. */
|
|
446
|
+
interface ParsedDocumentWriteObjectStreamParams extends Omit<ParsedDocumentWriteObjectParams, 'body'> {
|
|
447
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
448
|
+
/** Expected uncompressed entry length, when supplied by the archive directory. */
|
|
449
|
+
readonly contentLength?: number;
|
|
450
|
+
readonly signal?: AbortSignal;
|
|
451
|
+
}
|
|
444
452
|
interface ParsedDocumentWriteObjectResult extends ParsedDocumentObjectParams {
|
|
453
|
+
readonly entityTag?: string;
|
|
445
454
|
readonly url?: string;
|
|
446
455
|
}
|
|
447
456
|
type ParsedDocumentCommitSource = 'resultZip' | 'remoteReconstruction';
|
|
@@ -456,23 +465,45 @@ interface ParsedDocumentSyncProgress {
|
|
|
456
465
|
readonly documentId: string;
|
|
457
466
|
readonly revisionKey: string;
|
|
458
467
|
readonly nextChunkPage?: number;
|
|
468
|
+
readonly pinnedRevisionKey?: string;
|
|
469
|
+
readonly archiveIdentity?: string;
|
|
470
|
+
/** Once true, later segments use the origin rather than retrying optional archive caching. */
|
|
471
|
+
readonly archiveCacheBypassed?: boolean;
|
|
472
|
+
readonly nextArchiveEntry?: number;
|
|
473
|
+
/** Content hashes for verifying a sequential retry without a strong HTTP validator. */
|
|
474
|
+
readonly archiveEntryHashes?: readonly string[];
|
|
459
475
|
readonly status: 'running' | 'completed' | 'failed';
|
|
460
476
|
readonly updatedAt: string;
|
|
461
477
|
readonly error?: string;
|
|
462
478
|
}
|
|
479
|
+
interface ParsedDocumentSyncProgressOptions {
|
|
480
|
+
readonly signal?: AbortSignal;
|
|
481
|
+
readonly isSegmentBoundary?: boolean;
|
|
482
|
+
}
|
|
463
483
|
interface ParsedDocumentStorage {
|
|
464
484
|
readObject(params: ParsedDocumentObjectParams): Promise<ParsedDocumentObject | null>;
|
|
465
485
|
writeObject(params: ParsedDocumentWriteObjectParams): Promise<ParsedDocumentWriteObjectResult>;
|
|
486
|
+
writeObjectStream?(params: ParsedDocumentWriteObjectStreamParams): Promise<ParsedDocumentWriteObjectResult>;
|
|
466
487
|
headObject?(params: ParsedDocumentObjectParams): Promise<ParsedDocumentObjectHead | null>;
|
|
467
488
|
getObjectUrl?(params: ParsedDocumentObjectParams): Promise<string | null>;
|
|
468
489
|
deletePrefix?(params: ParsedDocumentRevisionParams): Promise<void>;
|
|
469
490
|
readSyncProgress(params: ParsedDocumentRevisionParams): Promise<ParsedDocumentSyncProgress | null>;
|
|
470
|
-
writeSyncProgress(params: ParsedDocumentSyncProgress): Promise<void>;
|
|
491
|
+
writeSyncProgress(params: ParsedDocumentSyncProgress, options?: ParsedDocumentSyncProgressOptions): Promise<void>;
|
|
471
492
|
}
|
|
472
493
|
interface ParsedDocumentSyncScheduler {
|
|
473
494
|
schedule(task: () => Promise<void>): void | Promise<void>;
|
|
474
495
|
}
|
|
475
496
|
interface ParsedDocumentStorageLimits {
|
|
497
|
+
/** ZIP entries copied per invocation (default 100). */
|
|
498
|
+
readonly maxEntriesPerSync?: number;
|
|
499
|
+
/** Maximum concurrent entry writes for Range archives (default 1). */
|
|
500
|
+
readonly maxConcurrentFiles?: number;
|
|
501
|
+
/** Successful files between checkpoints (default 1). */
|
|
502
|
+
readonly checkpointFileInterval?: number;
|
|
503
|
+
/** Maximum scheduling interval between checkpoints (default 2000ms). */
|
|
504
|
+
readonly checkpointIntervalMs?: number;
|
|
505
|
+
/** ZIP copy budget checked between entries (default 120000ms). */
|
|
506
|
+
readonly archiveSyncDeadlineMs?: number;
|
|
476
507
|
readonly remotePageSize?: number;
|
|
477
508
|
readonly maxPagesPerSync?: number;
|
|
478
509
|
readonly syncDeadlineMs?: number;
|
|
@@ -1303,7 +1334,13 @@ interface KnowledgeDocumentReference {
|
|
|
1303
1334
|
revisionKey?: string;
|
|
1304
1335
|
}
|
|
1305
1336
|
type KnowledgeParsedStorageOptions = ParsedDocumentStorageConfig;
|
|
1306
|
-
|
|
1337
|
+
interface KnowledgeSyncParsedDocumentParams extends KnowledgeDocumentReference {
|
|
1338
|
+
readonly signal?: AbortSignal;
|
|
1339
|
+
/** Optionally retain the exact source ZIP as result.zip after committing the snapshot. */
|
|
1340
|
+
readonly retainResultArchive?: boolean;
|
|
1341
|
+
/** Optionally cache the source ZIP in storage before extracting its files. */
|
|
1342
|
+
readonly cacheResultArchive?: boolean;
|
|
1343
|
+
}
|
|
1307
1344
|
interface KnowledgeSyncParsedDocumentResponse {
|
|
1308
1345
|
documentId: string;
|
|
1309
1346
|
revisionKey: string;
|
|
@@ -1617,6 +1654,8 @@ declare function syncParseResultToParsedDocumentStorage(params: {
|
|
|
1617
1654
|
readonly documentId?: string;
|
|
1618
1655
|
readonly revisionKey?: string;
|
|
1619
1656
|
readonly source?: ParsedDocumentCommitSource;
|
|
1657
|
+
readonly signal?: AbortSignal;
|
|
1658
|
+
readonly beforeCommit?: () => Promise<void>;
|
|
1620
1659
|
}): Promise<{
|
|
1621
1660
|
readonly result: ParseResult;
|
|
1622
1661
|
readonly documentId: string;
|
|
@@ -1753,4 +1792,11 @@ declare class JobFailedError extends KnowhereError {
|
|
|
1753
1792
|
constructor(message: string, code: string, jobResult: JobResult);
|
|
1754
1793
|
}
|
|
1755
1794
|
|
|
1756
|
-
|
|
1795
|
+
/** The sequential ZIP fallback could not access its SDK-owned temporary storage. */
|
|
1796
|
+
declare class ParsedDocumentArchiveError extends KnowhereError {
|
|
1797
|
+
readonly code: "ARCHIVE_SPOOL_FAILED";
|
|
1798
|
+
readonly cause: unknown;
|
|
1799
|
+
constructor(cause: unknown);
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
export { APIError, type AuthTokenProvider, AuthenticationError, BadRequestError, type BaseChunk, ChecksumError, type Chunk, ConflictError, type CreateJobParams, DiskParsedDocumentStorage, type DocType, type Document, type DocumentChunk, type DocumentChunkGetParams, type DocumentChunkListParams, type DocumentChunkListResponse, type DocumentChunkPagination, type DocumentChunkResponse, type DocumentChunkType, type DocumentListPagination, type DocumentListParams, type DocumentListResponse, type DocumentMetadata, type DocumentPageCitationSource, Documents, type FileIndex, GatewayTimeoutError, type ImageChunk, InternalServerError, InvalidStateError, type Job, type JobError, JobFailedError, type JobResult, type JobStatus, Jobs, Knowhere, type KnowhereAssetStorageAdapter, type KnowhereAssetStorageBody, type KnowhereAssetStorageHead, type KnowhereAssetStorageObject, type KnowhereAssetStorageOptions, type KnowhereAssetStorageResult, type KnowhereAssetStorageWriteResult, KnowhereError, type KnowhereOptions, Knowledge, type KnowledgeAsyncJobStatusResponse, type KnowledgeAsyncParseParams, type KnowledgeAsyncParseResponse, type KnowledgeCacheDocumentParams, type KnowledgeCacheJobResultParams, type KnowledgeChunkType, type KnowledgeDocumentReference, type KnowledgeGrepMatch, type KnowledgeGrepParams, type KnowledgeGrepResponse, type KnowledgeImportJobResultParams, type KnowledgeJobResultResponse, type KnowledgeLoadJobResultParams, type KnowledgeOutline, type KnowledgeParseParams, type KnowledgeParsedStorageOptions, type KnowledgeReadChunk, type KnowledgeReadParams, type KnowledgeReadResponse, type KnowledgeSearchParams, type KnowledgeSearchReference, type KnowledgeSearchResponse, type KnowledgeSearchResult, type KnowledgeSection, type KnowledgeStartupRecoveryResponse, type KnowledgeSyncParsedDocumentParams, type KnowledgeSyncParsedDocumentResponse, type LlmConfig, type LlmModelsConfig, type LlmProviderConfig, type LoadOptions, type LocalKnowledgeDocument, type LocalKnowledgeParseResponse, LocalKnowledgeStore, type Manifest, NODE_SDK_DOCUMENT_METADATA_DEFAULTS, NetworkError, NotFoundError, type PageChunk, type PageCitationAsset, type PageCitationAssetContentType, type PageCitationAssetSource, type ParseParams, type ParseResult, ParsedDocumentArchiveError, type ParsedDocumentCommit, type ParsedDocumentCommitSource, type ParsedDocumentObject, type ParsedDocumentObjectHead, type ParsedDocumentObjectParams, type ParsedDocumentRevisionParams, type ParsedDocumentStorage, type ParsedDocumentStorageConfig, type ParsedDocumentStorageDocument, type ParsedDocumentStorageLimits, type ParsedDocumentSyncProgress, type ParsedDocumentSyncProgressOptions, type ParsedDocumentSyncScheduler, type ParsedDocumentWriteObjectParams, type ParsedDocumentWriteObjectResult, type ParsedDocumentWriteObjectStreamParams, type ParsingModel, type ParsingParams, PaymentRequiredError, PermissionDeniedError, type PollProgress, PollingTimeoutError, RateLimitError, Retrieval, type RetrievalChannel, type RetrievalChunkType, type RetrievalEvidencePart, type RetrievalFilterMode, type RetrievalQueryParams, type RetrievalQueryResponse, type RetrievalReferencedChunk, type RetrievalResult, type RetrievalSectionExclusion, type RetrievalSource, ServiceUnavailableError, type Statistics, type TableChunk, type TextChunk, TimeoutError, type UploadParams, type UploadProgress, VERSION, ValidationError, type WaitOptions, type WebhookConfig, Knowhere as default, mergeDocumentMetadataDefaults, storeParseResultAssets, syncParseResultToParsedDocumentStorage };
|
package/dist/index.d.ts
CHANGED
|
@@ -428,6 +428,7 @@ interface ParsedDocumentObjectParams extends ParsedDocumentRevisionParams {
|
|
|
428
428
|
readonly path: string;
|
|
429
429
|
}
|
|
430
430
|
interface ParsedDocumentObjectHead extends ParsedDocumentObjectParams {
|
|
431
|
+
readonly entityTag?: string;
|
|
431
432
|
readonly contentType?: string;
|
|
432
433
|
readonly contentLength?: number;
|
|
433
434
|
readonly metadata?: Readonly<Record<string, string>>;
|
|
@@ -441,7 +442,15 @@ interface ParsedDocumentWriteObjectParams extends ParsedDocumentObjectParams {
|
|
|
441
442
|
readonly contentType: string;
|
|
442
443
|
readonly metadata?: Readonly<Record<string, string>>;
|
|
443
444
|
}
|
|
445
|
+
/** Stream sinks must consume the body before resolving and reject partial writes. */
|
|
446
|
+
interface ParsedDocumentWriteObjectStreamParams extends Omit<ParsedDocumentWriteObjectParams, 'body'> {
|
|
447
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
448
|
+
/** Expected uncompressed entry length, when supplied by the archive directory. */
|
|
449
|
+
readonly contentLength?: number;
|
|
450
|
+
readonly signal?: AbortSignal;
|
|
451
|
+
}
|
|
444
452
|
interface ParsedDocumentWriteObjectResult extends ParsedDocumentObjectParams {
|
|
453
|
+
readonly entityTag?: string;
|
|
445
454
|
readonly url?: string;
|
|
446
455
|
}
|
|
447
456
|
type ParsedDocumentCommitSource = 'resultZip' | 'remoteReconstruction';
|
|
@@ -456,23 +465,45 @@ interface ParsedDocumentSyncProgress {
|
|
|
456
465
|
readonly documentId: string;
|
|
457
466
|
readonly revisionKey: string;
|
|
458
467
|
readonly nextChunkPage?: number;
|
|
468
|
+
readonly pinnedRevisionKey?: string;
|
|
469
|
+
readonly archiveIdentity?: string;
|
|
470
|
+
/** Once true, later segments use the origin rather than retrying optional archive caching. */
|
|
471
|
+
readonly archiveCacheBypassed?: boolean;
|
|
472
|
+
readonly nextArchiveEntry?: number;
|
|
473
|
+
/** Content hashes for verifying a sequential retry without a strong HTTP validator. */
|
|
474
|
+
readonly archiveEntryHashes?: readonly string[];
|
|
459
475
|
readonly status: 'running' | 'completed' | 'failed';
|
|
460
476
|
readonly updatedAt: string;
|
|
461
477
|
readonly error?: string;
|
|
462
478
|
}
|
|
479
|
+
interface ParsedDocumentSyncProgressOptions {
|
|
480
|
+
readonly signal?: AbortSignal;
|
|
481
|
+
readonly isSegmentBoundary?: boolean;
|
|
482
|
+
}
|
|
463
483
|
interface ParsedDocumentStorage {
|
|
464
484
|
readObject(params: ParsedDocumentObjectParams): Promise<ParsedDocumentObject | null>;
|
|
465
485
|
writeObject(params: ParsedDocumentWriteObjectParams): Promise<ParsedDocumentWriteObjectResult>;
|
|
486
|
+
writeObjectStream?(params: ParsedDocumentWriteObjectStreamParams): Promise<ParsedDocumentWriteObjectResult>;
|
|
466
487
|
headObject?(params: ParsedDocumentObjectParams): Promise<ParsedDocumentObjectHead | null>;
|
|
467
488
|
getObjectUrl?(params: ParsedDocumentObjectParams): Promise<string | null>;
|
|
468
489
|
deletePrefix?(params: ParsedDocumentRevisionParams): Promise<void>;
|
|
469
490
|
readSyncProgress(params: ParsedDocumentRevisionParams): Promise<ParsedDocumentSyncProgress | null>;
|
|
470
|
-
writeSyncProgress(params: ParsedDocumentSyncProgress): Promise<void>;
|
|
491
|
+
writeSyncProgress(params: ParsedDocumentSyncProgress, options?: ParsedDocumentSyncProgressOptions): Promise<void>;
|
|
471
492
|
}
|
|
472
493
|
interface ParsedDocumentSyncScheduler {
|
|
473
494
|
schedule(task: () => Promise<void>): void | Promise<void>;
|
|
474
495
|
}
|
|
475
496
|
interface ParsedDocumentStorageLimits {
|
|
497
|
+
/** ZIP entries copied per invocation (default 100). */
|
|
498
|
+
readonly maxEntriesPerSync?: number;
|
|
499
|
+
/** Maximum concurrent entry writes for Range archives (default 1). */
|
|
500
|
+
readonly maxConcurrentFiles?: number;
|
|
501
|
+
/** Successful files between checkpoints (default 1). */
|
|
502
|
+
readonly checkpointFileInterval?: number;
|
|
503
|
+
/** Maximum scheduling interval between checkpoints (default 2000ms). */
|
|
504
|
+
readonly checkpointIntervalMs?: number;
|
|
505
|
+
/** ZIP copy budget checked between entries (default 120000ms). */
|
|
506
|
+
readonly archiveSyncDeadlineMs?: number;
|
|
476
507
|
readonly remotePageSize?: number;
|
|
477
508
|
readonly maxPagesPerSync?: number;
|
|
478
509
|
readonly syncDeadlineMs?: number;
|
|
@@ -1303,7 +1334,13 @@ interface KnowledgeDocumentReference {
|
|
|
1303
1334
|
revisionKey?: string;
|
|
1304
1335
|
}
|
|
1305
1336
|
type KnowledgeParsedStorageOptions = ParsedDocumentStorageConfig;
|
|
1306
|
-
|
|
1337
|
+
interface KnowledgeSyncParsedDocumentParams extends KnowledgeDocumentReference {
|
|
1338
|
+
readonly signal?: AbortSignal;
|
|
1339
|
+
/** Optionally retain the exact source ZIP as result.zip after committing the snapshot. */
|
|
1340
|
+
readonly retainResultArchive?: boolean;
|
|
1341
|
+
/** Optionally cache the source ZIP in storage before extracting its files. */
|
|
1342
|
+
readonly cacheResultArchive?: boolean;
|
|
1343
|
+
}
|
|
1307
1344
|
interface KnowledgeSyncParsedDocumentResponse {
|
|
1308
1345
|
documentId: string;
|
|
1309
1346
|
revisionKey: string;
|
|
@@ -1617,6 +1654,8 @@ declare function syncParseResultToParsedDocumentStorage(params: {
|
|
|
1617
1654
|
readonly documentId?: string;
|
|
1618
1655
|
readonly revisionKey?: string;
|
|
1619
1656
|
readonly source?: ParsedDocumentCommitSource;
|
|
1657
|
+
readonly signal?: AbortSignal;
|
|
1658
|
+
readonly beforeCommit?: () => Promise<void>;
|
|
1620
1659
|
}): Promise<{
|
|
1621
1660
|
readonly result: ParseResult;
|
|
1622
1661
|
readonly documentId: string;
|
|
@@ -1753,4 +1792,11 @@ declare class JobFailedError extends KnowhereError {
|
|
|
1753
1792
|
constructor(message: string, code: string, jobResult: JobResult);
|
|
1754
1793
|
}
|
|
1755
1794
|
|
|
1756
|
-
|
|
1795
|
+
/** The sequential ZIP fallback could not access its SDK-owned temporary storage. */
|
|
1796
|
+
declare class ParsedDocumentArchiveError extends KnowhereError {
|
|
1797
|
+
readonly code: "ARCHIVE_SPOOL_FAILED";
|
|
1798
|
+
readonly cause: unknown;
|
|
1799
|
+
constructor(cause: unknown);
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
export { APIError, type AuthTokenProvider, AuthenticationError, BadRequestError, type BaseChunk, ChecksumError, type Chunk, ConflictError, type CreateJobParams, DiskParsedDocumentStorage, type DocType, type Document, type DocumentChunk, type DocumentChunkGetParams, type DocumentChunkListParams, type DocumentChunkListResponse, type DocumentChunkPagination, type DocumentChunkResponse, type DocumentChunkType, type DocumentListPagination, type DocumentListParams, type DocumentListResponse, type DocumentMetadata, type DocumentPageCitationSource, Documents, type FileIndex, GatewayTimeoutError, type ImageChunk, InternalServerError, InvalidStateError, type Job, type JobError, JobFailedError, type JobResult, type JobStatus, Jobs, Knowhere, type KnowhereAssetStorageAdapter, type KnowhereAssetStorageBody, type KnowhereAssetStorageHead, type KnowhereAssetStorageObject, type KnowhereAssetStorageOptions, type KnowhereAssetStorageResult, type KnowhereAssetStorageWriteResult, KnowhereError, type KnowhereOptions, Knowledge, type KnowledgeAsyncJobStatusResponse, type KnowledgeAsyncParseParams, type KnowledgeAsyncParseResponse, type KnowledgeCacheDocumentParams, type KnowledgeCacheJobResultParams, type KnowledgeChunkType, type KnowledgeDocumentReference, type KnowledgeGrepMatch, type KnowledgeGrepParams, type KnowledgeGrepResponse, type KnowledgeImportJobResultParams, type KnowledgeJobResultResponse, type KnowledgeLoadJobResultParams, type KnowledgeOutline, type KnowledgeParseParams, type KnowledgeParsedStorageOptions, type KnowledgeReadChunk, type KnowledgeReadParams, type KnowledgeReadResponse, type KnowledgeSearchParams, type KnowledgeSearchReference, type KnowledgeSearchResponse, type KnowledgeSearchResult, type KnowledgeSection, type KnowledgeStartupRecoveryResponse, type KnowledgeSyncParsedDocumentParams, type KnowledgeSyncParsedDocumentResponse, type LlmConfig, type LlmModelsConfig, type LlmProviderConfig, type LoadOptions, type LocalKnowledgeDocument, type LocalKnowledgeParseResponse, LocalKnowledgeStore, type Manifest, NODE_SDK_DOCUMENT_METADATA_DEFAULTS, NetworkError, NotFoundError, type PageChunk, type PageCitationAsset, type PageCitationAssetContentType, type PageCitationAssetSource, type ParseParams, type ParseResult, ParsedDocumentArchiveError, type ParsedDocumentCommit, type ParsedDocumentCommitSource, type ParsedDocumentObject, type ParsedDocumentObjectHead, type ParsedDocumentObjectParams, type ParsedDocumentRevisionParams, type ParsedDocumentStorage, type ParsedDocumentStorageConfig, type ParsedDocumentStorageDocument, type ParsedDocumentStorageLimits, type ParsedDocumentSyncProgress, type ParsedDocumentSyncProgressOptions, type ParsedDocumentSyncScheduler, type ParsedDocumentWriteObjectParams, type ParsedDocumentWriteObjectResult, type ParsedDocumentWriteObjectStreamParams, type ParsingModel, type ParsingParams, PaymentRequiredError, PermissionDeniedError, type PollProgress, PollingTimeoutError, RateLimitError, Retrieval, type RetrievalChannel, type RetrievalChunkType, type RetrievalEvidencePart, type RetrievalFilterMode, type RetrievalQueryParams, type RetrievalQueryResponse, type RetrievalReferencedChunk, type RetrievalResult, type RetrievalSectionExclusion, type RetrievalSource, ServiceUnavailableError, type Statistics, type TableChunk, type TextChunk, TimeoutError, type UploadParams, type UploadProgress, VERSION, ValidationError, type WaitOptions, type WebhookConfig, Knowhere as default, mergeDocumentMetadataDefaults, storeParseResultAssets, syncParseResultToParsedDocumentStorage };
|