dsh-pdf-mineru 0.0.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/LICENSE +21 -0
- package/README.md +142 -0
- package/cordis.patch.yml +26 -0
- package/lib/client.js +1994 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +725 -0
- package/lib/index.js +15565 -0
- package/package.json +131 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
import { Readable } from "node:stream";
|
|
2
|
+
import z from "schemastery";
|
|
3
|
+
import { Context } from "cordis";
|
|
4
|
+
//#region src/domain/ids.d.ts
|
|
5
|
+
type Brand<T, Name extends string> = T & {
|
|
6
|
+
readonly __brand: Name;
|
|
7
|
+
};
|
|
8
|
+
type MinerUJobId = Brand<string, 'MinerUJobId'>;
|
|
9
|
+
type MinerUResultId = Brand<string, 'MinerUResultId'>;
|
|
10
|
+
type MinerUFileId = Brand<string, 'MinerUFileId'>;
|
|
11
|
+
type ProviderConfigId = Brand<string, 'ProviderConfigId'>;
|
|
12
|
+
type CacheKey = Brand<string, 'CacheKey'>;
|
|
13
|
+
type OperationId = Brand<string, 'OperationId'>;
|
|
14
|
+
type SessionId = Brand<string, 'SessionId'>;
|
|
15
|
+
declare function assertSafePathSegment(value: string, label: string): string;
|
|
16
|
+
declare const asJobId: (value: string) => MinerUJobId;
|
|
17
|
+
declare const asResultId: (value: string) => MinerUResultId;
|
|
18
|
+
declare const asFileId: (value: string) => MinerUFileId;
|
|
19
|
+
declare const asProviderConfigId: (value: string) => ProviderConfigId;
|
|
20
|
+
declare const asOperationId: (value: string) => OperationId;
|
|
21
|
+
declare function asSessionId(value: string): SessionId;
|
|
22
|
+
declare function asCacheKey(value: string): CacheKey;
|
|
23
|
+
declare const createJobId: () => MinerUJobId;
|
|
24
|
+
declare const createOperationId: () => OperationId;
|
|
25
|
+
declare function createFileId(sha256: string, index?: number): MinerUFileId;
|
|
26
|
+
declare function resultIdForCacheKey(cacheKey: CacheKey): MinerUResultId;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/domain/request.d.ts
|
|
29
|
+
declare const CANONICAL_PARSE_REQUEST_SCHEMA_VERSION: 1;
|
|
30
|
+
declare const CACHE_KEY_SPEC_VERSION: 1;
|
|
31
|
+
declare const RESULT_SCHEMA_VERSION: 1;
|
|
32
|
+
declare const ARTIFACT_KINDS: readonly ["markdown", "layout", "model-output", "content-list", "images"];
|
|
33
|
+
type ArtifactKind = typeof ARTIFACT_KINDS[number];
|
|
34
|
+
type MinerUModel = 'pipeline' | 'vlm';
|
|
35
|
+
type ParseMethod = 'auto' | 'txt' | 'ocr';
|
|
36
|
+
interface ParseSemantics {
|
|
37
|
+
readonly model: MinerUModel;
|
|
38
|
+
readonly ocr: boolean;
|
|
39
|
+
/** Preserves the self-hosted legacy txt/auto distinction in the cache key. */
|
|
40
|
+
readonly parseMethod: ParseMethod;
|
|
41
|
+
readonly language: string;
|
|
42
|
+
readonly formula: boolean;
|
|
43
|
+
readonly table: boolean;
|
|
44
|
+
readonly pages?: string;
|
|
45
|
+
}
|
|
46
|
+
interface CanonicalSourceFile {
|
|
47
|
+
readonly fileId: MinerUFileId;
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly bytes: number;
|
|
50
|
+
readonly sha256: string;
|
|
51
|
+
}
|
|
52
|
+
interface CanonicalParseRequest {
|
|
53
|
+
readonly schemaVersion: typeof CANONICAL_PARSE_REQUEST_SCHEMA_VERSION;
|
|
54
|
+
readonly files: readonly CanonicalSourceFile[];
|
|
55
|
+
readonly semantics: ParseSemantics;
|
|
56
|
+
readonly requiredArtifacts: readonly ArtifactKind[];
|
|
57
|
+
}
|
|
58
|
+
interface PreparedSourceFile extends CanonicalSourceFile {
|
|
59
|
+
/** Ephemeral execution input. This field is never persisted. */
|
|
60
|
+
readonly path: string;
|
|
61
|
+
readonly fingerprint: {
|
|
62
|
+
readonly size: number;
|
|
63
|
+
readonly mtimeMs: number;
|
|
64
|
+
readonly device: number;
|
|
65
|
+
readonly inode: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
interface PreparedParseRequest {
|
|
69
|
+
readonly request: CanonicalParseRequest;
|
|
70
|
+
readonly sources: readonly PreparedSourceFile[];
|
|
71
|
+
}
|
|
72
|
+
interface ParseRequestInput {
|
|
73
|
+
readonly file_paths?: readonly string[];
|
|
74
|
+
/** Compatibility alias through the next major release. */
|
|
75
|
+
readonly file_path?: string;
|
|
76
|
+
readonly model?: MinerUModel;
|
|
77
|
+
readonly ocr?: boolean;
|
|
78
|
+
readonly language?: string;
|
|
79
|
+
readonly formula?: boolean;
|
|
80
|
+
readonly table?: boolean;
|
|
81
|
+
readonly pages?: string;
|
|
82
|
+
readonly artifacts?: readonly ArtifactKind[];
|
|
83
|
+
readonly backend?: string;
|
|
84
|
+
readonly parse_method?: ParseMethod;
|
|
85
|
+
readonly lang_list?: readonly string[];
|
|
86
|
+
readonly formula_enable?: boolean;
|
|
87
|
+
readonly table_enable?: boolean;
|
|
88
|
+
readonly return_middle_json?: boolean;
|
|
89
|
+
readonly return_model_output?: boolean;
|
|
90
|
+
readonly return_content_list?: boolean;
|
|
91
|
+
readonly return_images?: boolean;
|
|
92
|
+
readonly start_page_id?: number;
|
|
93
|
+
readonly end_page_id?: number;
|
|
94
|
+
}
|
|
95
|
+
interface ParseDefaults {
|
|
96
|
+
readonly model: MinerUModel;
|
|
97
|
+
readonly ocr: boolean;
|
|
98
|
+
readonly parseMethod: ParseMethod;
|
|
99
|
+
readonly language: string;
|
|
100
|
+
readonly formula: boolean;
|
|
101
|
+
readonly table: boolean;
|
|
102
|
+
readonly artifacts: readonly ArtifactKind[];
|
|
103
|
+
}
|
|
104
|
+
declare function normalizeArtifactKinds(kinds: readonly ArtifactKind[]): readonly ArtifactKind[];
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/config.d.ts
|
|
107
|
+
interface SelfHostedV2Config {
|
|
108
|
+
readonly id: ProviderConfigId;
|
|
109
|
+
readonly type: 'self-hosted-v2';
|
|
110
|
+
readonly baseURL: string;
|
|
111
|
+
readonly apiKeyEnv?: string;
|
|
112
|
+
readonly modelMap: Readonly<Record<MinerUModel, string>>;
|
|
113
|
+
readonly configuredVersion?: string;
|
|
114
|
+
readonly allowInsecureHttp: boolean;
|
|
115
|
+
}
|
|
116
|
+
interface OfficialV4Config {
|
|
117
|
+
readonly id: ProviderConfigId;
|
|
118
|
+
readonly type: 'official-v4';
|
|
119
|
+
readonly baseURL: string;
|
|
120
|
+
readonly apiKeyEnv: string;
|
|
121
|
+
readonly models: readonly MinerUModel[];
|
|
122
|
+
readonly configuredVersion: 'v4';
|
|
123
|
+
}
|
|
124
|
+
type ProviderConfig = SelfHostedV2Config | OfficialV4Config;
|
|
125
|
+
interface StorageConfig {
|
|
126
|
+
readonly storageRoot: string;
|
|
127
|
+
readonly cacheEnabled: boolean;
|
|
128
|
+
readonly retainSources: false;
|
|
129
|
+
readonly stagingTtlMs: number;
|
|
130
|
+
}
|
|
131
|
+
interface PollingConfig {
|
|
132
|
+
readonly pollIntervalMs: number;
|
|
133
|
+
readonly pollTimeoutMs: number;
|
|
134
|
+
readonly requestTimeoutMs: number;
|
|
135
|
+
readonly operationTimeoutMs: number;
|
|
136
|
+
}
|
|
137
|
+
interface OutputConfig {
|
|
138
|
+
readonly maxInlineChars: number;
|
|
139
|
+
}
|
|
140
|
+
interface SecurityLimits {
|
|
141
|
+
readonly maxFilesPerRequest: number;
|
|
142
|
+
readonly maxFileBytes: number;
|
|
143
|
+
readonly maxApiResponseBytes: number;
|
|
144
|
+
readonly maxZipDownloadBytes: number;
|
|
145
|
+
readonly maxZipEntries: number;
|
|
146
|
+
readonly maxZipEntryBytes: number;
|
|
147
|
+
readonly maxZipTotalBytes: number;
|
|
148
|
+
readonly maxZipCompressionRatio: number;
|
|
149
|
+
}
|
|
150
|
+
interface MinerUConfig {
|
|
151
|
+
readonly schemaVersion: 1;
|
|
152
|
+
readonly activeProvider: ProviderConfigId;
|
|
153
|
+
readonly providers: readonly ProviderConfig[];
|
|
154
|
+
readonly defaults: ParseDefaults;
|
|
155
|
+
readonly storage: StorageConfig;
|
|
156
|
+
readonly polling: PollingConfig;
|
|
157
|
+
readonly output: OutputConfig;
|
|
158
|
+
readonly limits: SecurityLimits;
|
|
159
|
+
}
|
|
160
|
+
interface LegacyMinerUConfig {
|
|
161
|
+
readonly baseURL?: string;
|
|
162
|
+
readonly apiKeyEnv?: string;
|
|
163
|
+
readonly defaultBackend?: string;
|
|
164
|
+
readonly defaultParseMethod?: ParseMethod;
|
|
165
|
+
readonly defaultLang?: string;
|
|
166
|
+
readonly pollIntervalMs?: number;
|
|
167
|
+
readonly pollTimeoutMs?: number;
|
|
168
|
+
readonly requestTimeoutMs?: number;
|
|
169
|
+
readonly maxMdOutputChars?: number;
|
|
170
|
+
}
|
|
171
|
+
declare function defaultMinerUConfig(): MinerUConfig;
|
|
172
|
+
declare function migrateConfig(value: unknown): MinerUConfig;
|
|
173
|
+
declare function providerById(config: MinerUConfig, id: ProviderConfigId): ProviderConfig | undefined;
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/domain/errors.d.ts
|
|
176
|
+
type MinerUProviderId = 'self-hosted-v2' | 'official-v4';
|
|
177
|
+
type MinerUErrorCode = 'INVALID_REQUEST' | 'FILE_NOT_FOUND' | 'FILE_TOO_LARGE' | 'UNSUPPORTED_OPTION' | 'CREDENTIAL_MISSING' | 'AUTHENTICATION_FAILED' | 'PROVIDER_UNAVAILABLE' | 'PROVIDER_CONFIG_MISSING' | 'PROVIDER_RATE_LIMITED' | 'PROVIDER_QUOTA_EXHAUSTED' | 'UPLOAD_FAILED' | 'REMOTE_PARSE_FAILED' | 'RESULT_NOT_READY' | 'RESULT_DOWNLOAD_FAILED' | 'RESULT_ARCHIVE_INVALID' | 'RESULT_TOO_LARGE' | 'CACHE_CORRUPT' | 'CACHE_CONFLICT' | 'CACHE_EVICTED' | 'INTERRUPTED_UPLOAD' | 'POLL_TIMEOUT' | 'CANCELLED' | 'UNAUTHENTICATED_SESSION' | 'JOB_NOT_FOUND' | 'JOB_ACCESS_DENIED' | 'STORAGE_LOCKED';
|
|
178
|
+
interface MinerUFailure {
|
|
179
|
+
readonly code: MinerUErrorCode;
|
|
180
|
+
readonly message: string;
|
|
181
|
+
readonly retryable: boolean;
|
|
182
|
+
readonly provider?: MinerUProviderId;
|
|
183
|
+
readonly providerCode?: string;
|
|
184
|
+
readonly traceId?: string;
|
|
185
|
+
readonly fileId?: MinerUFileId;
|
|
186
|
+
}
|
|
187
|
+
declare class MinerUError extends Error {
|
|
188
|
+
readonly failure: MinerUFailure;
|
|
189
|
+
constructor(failure: MinerUFailure, options?: ErrorOptions);
|
|
190
|
+
}
|
|
191
|
+
declare function sanitizeDiagnostic(input: string): string;
|
|
192
|
+
declare function failure(code: MinerUErrorCode, message: string, retryable?: boolean, details?: Omit<MinerUFailure, 'code' | 'message' | 'retryable'>): MinerUFailure;
|
|
193
|
+
declare function toMinerUFailure(error: unknown, fallback?: MinerUErrorCode): MinerUFailure;
|
|
194
|
+
declare function throwMinerU(code: MinerUErrorCode, message: string, retryable?: boolean): never;
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/domain/result.d.ts
|
|
197
|
+
declare const MINERU_RESULT_MANIFEST_SCHEMA_VERSION: 1;
|
|
198
|
+
interface ArtifactRef {
|
|
199
|
+
readonly kind: ArtifactKind | 'manifest';
|
|
200
|
+
readonly relativePath: string;
|
|
201
|
+
readonly mediaType: string;
|
|
202
|
+
readonly bytes: number;
|
|
203
|
+
readonly sha256: string;
|
|
204
|
+
}
|
|
205
|
+
interface ParsedDocumentManifest {
|
|
206
|
+
readonly fileId: MinerUFileId;
|
|
207
|
+
readonly name: string;
|
|
208
|
+
readonly artifacts: readonly ArtifactRef[];
|
|
209
|
+
}
|
|
210
|
+
interface ResultProducer {
|
|
211
|
+
readonly providerId: MinerUProviderId;
|
|
212
|
+
readonly providerConfigId: ProviderConfigId;
|
|
213
|
+
readonly compatibilityKey: string;
|
|
214
|
+
}
|
|
215
|
+
/** A published manifest is one immutable source-file result. */
|
|
216
|
+
interface MinerUResultManifest {
|
|
217
|
+
readonly schemaVersion: typeof MINERU_RESULT_MANIFEST_SCHEMA_VERSION;
|
|
218
|
+
readonly id: MinerUResultId;
|
|
219
|
+
readonly cacheKey: CacheKey;
|
|
220
|
+
readonly sourceSha256: string;
|
|
221
|
+
readonly request: CanonicalParseRequest;
|
|
222
|
+
readonly producer: ResultProducer;
|
|
223
|
+
readonly files: readonly [ParsedDocumentManifest];
|
|
224
|
+
readonly createdAt: number;
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/providers/provider.d.ts
|
|
228
|
+
interface ProviderCapabilities {
|
|
229
|
+
readonly models: readonly MinerUModel[];
|
|
230
|
+
readonly parseMethods: readonly ParseMethod[];
|
|
231
|
+
readonly supportsOcr: boolean;
|
|
232
|
+
readonly supportsLanguage: boolean;
|
|
233
|
+
readonly supportsFormula: boolean;
|
|
234
|
+
readonly supportsTable: boolean;
|
|
235
|
+
readonly supportsPageRanges: boolean;
|
|
236
|
+
readonly supportedArtifacts: readonly ArtifactKind[];
|
|
237
|
+
readonly maxFilesPerSubmission: number;
|
|
238
|
+
readonly maxFileBytes?: number;
|
|
239
|
+
readonly maxPagesPerFile?: number;
|
|
240
|
+
}
|
|
241
|
+
interface ProviderCallLimits {
|
|
242
|
+
readonly maxApiResponseBytes: number;
|
|
243
|
+
readonly maxZipDownloadBytes: number;
|
|
244
|
+
readonly maxZipEntries: number;
|
|
245
|
+
readonly maxZipEntryBytes: number;
|
|
246
|
+
readonly maxZipTotalBytes: number;
|
|
247
|
+
readonly maxZipCompressionRatio: number;
|
|
248
|
+
}
|
|
249
|
+
interface ProviderCallContext {
|
|
250
|
+
readonly signal: AbortSignal;
|
|
251
|
+
readonly credential?: string;
|
|
252
|
+
readonly timeoutMs: number;
|
|
253
|
+
readonly limits: ProviderCallLimits;
|
|
254
|
+
}
|
|
255
|
+
interface ProviderCompatibilityContext {
|
|
256
|
+
readonly configuredVersion?: string;
|
|
257
|
+
}
|
|
258
|
+
interface ProviderProbeResult {
|
|
259
|
+
readonly available: boolean;
|
|
260
|
+
readonly provider: MinerUProviderId;
|
|
261
|
+
readonly authentication: 'valid' | 'invalid' | 'not-configured' | 'unknown';
|
|
262
|
+
readonly protocolVersion: string;
|
|
263
|
+
readonly serverVersion?: string;
|
|
264
|
+
readonly queue?: {
|
|
265
|
+
readonly queued?: number;
|
|
266
|
+
readonly processing?: number;
|
|
267
|
+
readonly completed?: number;
|
|
268
|
+
readonly failed?: number;
|
|
269
|
+
readonly maxConcurrent?: number;
|
|
270
|
+
};
|
|
271
|
+
readonly diagnostics?: string;
|
|
272
|
+
}
|
|
273
|
+
interface ProviderSubmittedFile {
|
|
274
|
+
readonly dataId: string;
|
|
275
|
+
readonly fileId: MinerUFileId;
|
|
276
|
+
readonly name: string;
|
|
277
|
+
}
|
|
278
|
+
type ProviderJobRef = {
|
|
279
|
+
readonly provider: 'self-hosted-v2';
|
|
280
|
+
readonly taskId: string;
|
|
281
|
+
readonly files: readonly ProviderSubmittedFile[];
|
|
282
|
+
} | {
|
|
283
|
+
readonly provider: 'official-v4';
|
|
284
|
+
readonly batchId: string;
|
|
285
|
+
readonly files: readonly ProviderSubmittedFile[];
|
|
286
|
+
};
|
|
287
|
+
interface ProviderSubmission {
|
|
288
|
+
readonly ref: ProviderJobRef;
|
|
289
|
+
readonly state: MinerUJobState;
|
|
290
|
+
readonly files: readonly ProviderFileSnapshot[];
|
|
291
|
+
}
|
|
292
|
+
interface ProviderFileSnapshot {
|
|
293
|
+
readonly fileId: MinerUFileId;
|
|
294
|
+
readonly state: MinerUFileState;
|
|
295
|
+
readonly rawState?: string;
|
|
296
|
+
readonly progress?: {
|
|
297
|
+
readonly completed: number;
|
|
298
|
+
readonly total: number;
|
|
299
|
+
};
|
|
300
|
+
readonly failure?: MinerUFailure;
|
|
301
|
+
}
|
|
302
|
+
interface ProviderJobSnapshot {
|
|
303
|
+
readonly state: MinerUJobState;
|
|
304
|
+
readonly files: readonly ProviderFileSnapshot[];
|
|
305
|
+
readonly rawState?: string;
|
|
306
|
+
readonly queuedAhead?: number;
|
|
307
|
+
}
|
|
308
|
+
type ArtifactInput = Readable | ReadableStream<Uint8Array> | Uint8Array | string;
|
|
309
|
+
interface ArtifactWriteOptions {
|
|
310
|
+
readonly mediaType: string;
|
|
311
|
+
readonly relativeName?: string;
|
|
312
|
+
readonly maxBytes?: number;
|
|
313
|
+
}
|
|
314
|
+
interface TemporaryArtifact {
|
|
315
|
+
readonly path: string;
|
|
316
|
+
readonly bytes: number;
|
|
317
|
+
readonly sha256: string;
|
|
318
|
+
}
|
|
319
|
+
interface ArtifactSink {
|
|
320
|
+
writeArtifact(fileId: MinerUFileId, kind: ArtifactKind, input: ArtifactInput, options: ArtifactWriteOptions): Promise<ArtifactRef>;
|
|
321
|
+
writeTemporary(name: string, input: ArtifactInput, maxBytes: number): Promise<TemporaryArtifact>;
|
|
322
|
+
}
|
|
323
|
+
interface ProviderCollectedFile {
|
|
324
|
+
readonly fileId: MinerUFileId;
|
|
325
|
+
readonly name: string;
|
|
326
|
+
readonly artifacts: readonly ArtifactRef[];
|
|
327
|
+
readonly failure?: MinerUFailure;
|
|
328
|
+
}
|
|
329
|
+
interface ProviderCollection {
|
|
330
|
+
readonly files: readonly ProviderCollectedFile[];
|
|
331
|
+
}
|
|
332
|
+
interface MinerUProvider {
|
|
333
|
+
readonly id: MinerUProviderId;
|
|
334
|
+
readonly capabilities: ProviderCapabilities;
|
|
335
|
+
probe(context: ProviderCallContext): Promise<ProviderProbeResult>;
|
|
336
|
+
compatibilityKey(request: CanonicalParseRequest, context: ProviderCompatibilityContext): Promise<string>;
|
|
337
|
+
submit(request: CanonicalParseRequest, sources: readonly PreparedSourceFile[], context: ProviderCallContext): Promise<ProviderSubmission>;
|
|
338
|
+
inspect(ref: ProviderJobRef, context: ProviderCallContext): Promise<ProviderJobSnapshot>;
|
|
339
|
+
collect(ref: ProviderJobRef, request: CanonicalParseRequest, sink: ArtifactSink, context: ProviderCallContext): Promise<ProviderCollection>;
|
|
340
|
+
}
|
|
341
|
+
declare function validateProviderCapabilities(request: CanonicalParseRequest, capabilities: ProviderCapabilities): void;
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region src/domain/job.d.ts
|
|
344
|
+
declare const MINERU_JOB_SCHEMA_VERSION: 1;
|
|
345
|
+
type MinerUFileState = 'queued' | 'uploading' | 'processing' | 'completed' | 'failed';
|
|
346
|
+
type MinerUJobState = MinerUFileState | 'collecting' | 'partially-completed';
|
|
347
|
+
type JobResolution = {
|
|
348
|
+
readonly kind: 'cache-hit';
|
|
349
|
+
} | {
|
|
350
|
+
readonly kind: 'shared-operation';
|
|
351
|
+
readonly operationId: OperationId;
|
|
352
|
+
readonly ref?: ProviderJobRef;
|
|
353
|
+
} | {
|
|
354
|
+
readonly kind: 'provider';
|
|
355
|
+
readonly ref?: ProviderJobRef;
|
|
356
|
+
};
|
|
357
|
+
interface JobSourceFile {
|
|
358
|
+
readonly fileId: MinerUFileId;
|
|
359
|
+
readonly name: string;
|
|
360
|
+
readonly bytes: number;
|
|
361
|
+
readonly sha256: string;
|
|
362
|
+
}
|
|
363
|
+
interface MinerUFileStatus {
|
|
364
|
+
readonly fileId: MinerUFileId;
|
|
365
|
+
readonly name: string;
|
|
366
|
+
readonly cacheKey: CacheKey;
|
|
367
|
+
readonly state: MinerUFileState;
|
|
368
|
+
readonly resultId?: MinerUResultId;
|
|
369
|
+
readonly failure?: MinerUFailure;
|
|
370
|
+
readonly progress?: {
|
|
371
|
+
readonly completed: number;
|
|
372
|
+
readonly total: number;
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
interface MinerUJobRecord {
|
|
376
|
+
readonly schemaVersion: typeof MINERU_JOB_SCHEMA_VERSION;
|
|
377
|
+
readonly id: MinerUJobId;
|
|
378
|
+
readonly sessionId: SessionId;
|
|
379
|
+
readonly providerId: MinerUProviderId;
|
|
380
|
+
readonly providerConfigId: ProviderConfigId;
|
|
381
|
+
readonly providerCompatibilityKey: string;
|
|
382
|
+
readonly sourceFiles: readonly JobSourceFile[];
|
|
383
|
+
readonly request: CanonicalParseRequest;
|
|
384
|
+
readonly cacheKey: CacheKey;
|
|
385
|
+
readonly state: MinerUJobState;
|
|
386
|
+
readonly resolution: JobResolution;
|
|
387
|
+
readonly files: readonly MinerUFileStatus[];
|
|
388
|
+
readonly resultId?: MinerUResultId;
|
|
389
|
+
readonly failure?: MinerUFailure;
|
|
390
|
+
readonly createdAt: number;
|
|
391
|
+
readonly updatedAt: number;
|
|
392
|
+
}
|
|
393
|
+
declare function isTerminalJobState(state: MinerUJobState): boolean;
|
|
394
|
+
declare function assertJobTransition(previous: MinerUJobState, next: MinerUJobState): void;
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/providers/self-hosted-v2.d.ts
|
|
397
|
+
interface SelfHostedV2ProviderConfig {
|
|
398
|
+
readonly id: ProviderConfigId;
|
|
399
|
+
readonly type: 'self-hosted-v2';
|
|
400
|
+
readonly baseURL: string;
|
|
401
|
+
readonly apiKeyEnv?: string;
|
|
402
|
+
readonly modelMap: Readonly<Partial<Record<MinerUModel, string>>>;
|
|
403
|
+
readonly configuredVersion?: string;
|
|
404
|
+
readonly allowInsecureHttp?: boolean;
|
|
405
|
+
}
|
|
406
|
+
interface SelfHostedHealthResponse {
|
|
407
|
+
readonly status: 'healthy' | 'unhealthy' | string;
|
|
408
|
+
readonly version?: string;
|
|
409
|
+
readonly protocol_version?: number;
|
|
410
|
+
readonly queued_tasks?: number;
|
|
411
|
+
readonly processing_tasks?: number;
|
|
412
|
+
readonly completed_tasks?: number;
|
|
413
|
+
readonly failed_tasks?: number;
|
|
414
|
+
readonly max_concurrent_requests?: number;
|
|
415
|
+
}
|
|
416
|
+
interface SelfHostedTaskSubmitResponse {
|
|
417
|
+
readonly task_id: string;
|
|
418
|
+
readonly status: string;
|
|
419
|
+
readonly backend?: string;
|
|
420
|
+
readonly file_names?: readonly string[];
|
|
421
|
+
readonly created_at?: string | null;
|
|
422
|
+
readonly started_at?: string | null;
|
|
423
|
+
readonly completed_at?: string | null;
|
|
424
|
+
readonly error?: string | null;
|
|
425
|
+
readonly status_url?: string;
|
|
426
|
+
readonly result_url?: string;
|
|
427
|
+
readonly queued_ahead?: number;
|
|
428
|
+
}
|
|
429
|
+
interface SelfHostedFileParseResult {
|
|
430
|
+
readonly md_content?: string | null;
|
|
431
|
+
readonly middle_json?: unknown;
|
|
432
|
+
readonly model_output?: unknown;
|
|
433
|
+
readonly content_list?: unknown;
|
|
434
|
+
readonly images?: Readonly<Record<string, string>> | null;
|
|
435
|
+
}
|
|
436
|
+
interface SelfHostedTaskResultResponse {
|
|
437
|
+
readonly backend?: string;
|
|
438
|
+
readonly version?: string;
|
|
439
|
+
readonly results?: Readonly<Record<string, SelfHostedFileParseResult>>;
|
|
440
|
+
}
|
|
441
|
+
declare class SelfHostedV2Provider implements MinerUProvider {
|
|
442
|
+
readonly id: "self-hosted-v2";
|
|
443
|
+
readonly config: SelfHostedV2ProviderConfig;
|
|
444
|
+
readonly capabilities: ProviderCapabilities;
|
|
445
|
+
private readonly parsedBaseUrl;
|
|
446
|
+
constructor(config: SelfHostedV2ProviderConfig);
|
|
447
|
+
compatibilityKey(request: CanonicalParseRequest, context: ProviderCompatibilityContext): Promise<string>;
|
|
448
|
+
probe(context: ProviderCallContext): Promise<ProviderProbeResult>;
|
|
449
|
+
submit(request: CanonicalParseRequest, sources: readonly PreparedSourceFile[], context: ProviderCallContext): Promise<ProviderSubmission>;
|
|
450
|
+
inspect(ref: ProviderJobRef, context: ProviderCallContext): Promise<ProviderJobSnapshot>;
|
|
451
|
+
collect(ref: ProviderJobRef, request: CanonicalParseRequest, sink: ArtifactSink, context: ProviderCallContext): Promise<ProviderCollection>;
|
|
452
|
+
private requestJson;
|
|
453
|
+
private readBoundedResponseBody;
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/providers/official-v4.d.ts
|
|
457
|
+
declare class OfficialV4Provider implements MinerUProvider {
|
|
458
|
+
readonly id: "official-v4";
|
|
459
|
+
readonly config: OfficialV4Config;
|
|
460
|
+
readonly capabilities: ProviderCapabilities;
|
|
461
|
+
private readonly parsedBaseUrl;
|
|
462
|
+
constructor(config: OfficialV4Config);
|
|
463
|
+
compatibilityKey(request: CanonicalParseRequest, context: ProviderCompatibilityContext): Promise<string>;
|
|
464
|
+
probe(context: ProviderCallContext): Promise<ProviderProbeResult>;
|
|
465
|
+
submit(request: CanonicalParseRequest, sources: readonly PreparedSourceFile[], context: ProviderCallContext): Promise<ProviderSubmission>;
|
|
466
|
+
inspect(ref: ProviderJobRef, context: ProviderCallContext): Promise<ProviderJobSnapshot>;
|
|
467
|
+
collect(ref: ProviderJobRef, request: CanonicalParseRequest, sink: ArtifactSink, context: ProviderCallContext): Promise<ProviderCollection>;
|
|
468
|
+
private requestJson;
|
|
469
|
+
private barePutStream;
|
|
470
|
+
private downloadZipToTemporary;
|
|
471
|
+
private readBoundedResponseBody;
|
|
472
|
+
}
|
|
473
|
+
//#endregion
|
|
474
|
+
//#region src/providers/registry.d.ts
|
|
475
|
+
interface ResolvedProvider {
|
|
476
|
+
readonly provider: MinerUProvider;
|
|
477
|
+
readonly config: ProviderConfig;
|
|
478
|
+
}
|
|
479
|
+
declare class ProviderRegistry {
|
|
480
|
+
private readonly getConfig;
|
|
481
|
+
constructor(getConfig: () => MinerUConfig);
|
|
482
|
+
active(): ResolvedProvider;
|
|
483
|
+
resolve(configId: ProviderConfigId): ResolvedProvider;
|
|
484
|
+
resolveForJob(job: MinerUJobRecord): Promise<ResolvedProvider>;
|
|
485
|
+
create(config: ProviderConfig): MinerUProvider;
|
|
486
|
+
}
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region src/service/shared-operations.d.ts
|
|
489
|
+
interface SharedWaiter {
|
|
490
|
+
readonly jobId: MinerUJobId;
|
|
491
|
+
readonly sessionId: SessionId;
|
|
492
|
+
readonly session: {
|
|
493
|
+
readonly header: {
|
|
494
|
+
readonly id: SessionId | string;
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
interface SharedSubmission {
|
|
499
|
+
readonly ref?: ProviderJobRef;
|
|
500
|
+
readonly state: MinerUJobState;
|
|
501
|
+
}
|
|
502
|
+
interface SharedOutcome {
|
|
503
|
+
readonly state: Extract<MinerUJobState, 'completed' | 'partially-completed' | 'failed'>;
|
|
504
|
+
readonly resultId?: MinerUResultId;
|
|
505
|
+
}
|
|
506
|
+
declare class SharedOperation {
|
|
507
|
+
readonly cacheKey: CacheKey;
|
|
508
|
+
readonly id: OperationId;
|
|
509
|
+
readonly waiters: Map<MinerUJobId, SharedWaiter>;
|
|
510
|
+
readonly controller: AbortController;
|
|
511
|
+
private readonly submission;
|
|
512
|
+
private readonly outcome;
|
|
513
|
+
private submitted;
|
|
514
|
+
private settled;
|
|
515
|
+
constructor(cacheKey: CacheKey);
|
|
516
|
+
attach(waiter: SharedWaiter): void;
|
|
517
|
+
markSubmitted(value: SharedSubmission): void;
|
|
518
|
+
resolve(value: SharedOutcome): void;
|
|
519
|
+
reject(error: unknown): void;
|
|
520
|
+
waitForSubmission(signal: AbortSignal): Promise<SharedSubmission>;
|
|
521
|
+
waitForOutcome(signal: AbortSignal): Promise<SharedOutcome>;
|
|
522
|
+
abort(reason: unknown): void;
|
|
523
|
+
}
|
|
524
|
+
declare class SharedOperationRegistry {
|
|
525
|
+
private readonly operations;
|
|
526
|
+
private disposed;
|
|
527
|
+
acquire(cacheKey: CacheKey, timeoutMs: number, runner: (operation: SharedOperation) => Promise<SharedOutcome>): {
|
|
528
|
+
readonly operation: SharedOperation;
|
|
529
|
+
readonly created: boolean;
|
|
530
|
+
};
|
|
531
|
+
get(cacheKey: CacheKey): SharedOperation | undefined;
|
|
532
|
+
activeOperationIds(): ReadonlySet<OperationId>;
|
|
533
|
+
dispose(): void;
|
|
534
|
+
}
|
|
535
|
+
//#endregion
|
|
536
|
+
//#region src/storage/paths.d.ts
|
|
537
|
+
declare class StoragePaths {
|
|
538
|
+
readonly root: string;
|
|
539
|
+
constructor(root?: string);
|
|
540
|
+
jobsDir(): string;
|
|
541
|
+
jobDir(sessionId: SessionId | string): string;
|
|
542
|
+
jobFile(sessionId: SessionId | string, jobId: MinerUJobId | string): string;
|
|
543
|
+
jobTempFile(sessionId: SessionId | string, jobId: MinerUJobId | string, token: string): string;
|
|
544
|
+
resultsDir(): string;
|
|
545
|
+
resultDir(cacheKey: CacheKey | string): string;
|
|
546
|
+
manifestFile(cacheKey: CacheKey | string): string;
|
|
547
|
+
filesDir(cacheKey: CacheKey | string): string;
|
|
548
|
+
fileDir(cacheKey: CacheKey | string, fileId: MinerUFileId | string): string;
|
|
549
|
+
stagingDir(operationId?: OperationId | string): string;
|
|
550
|
+
stagingFilesDir(operationId: OperationId | string): string;
|
|
551
|
+
stagingFileDir(operationId: OperationId | string, fileId: MinerUFileId | string): string;
|
|
552
|
+
stagingTempDir(operationId: OperationId | string): string;
|
|
553
|
+
stagingManifestFile(operationId: OperationId | string): string;
|
|
554
|
+
quarantineDir(name?: string): string;
|
|
555
|
+
processLockFile(): string;
|
|
556
|
+
resolveArtifactPath(cacheKey: CacheKey | string, relativePath: string): string;
|
|
557
|
+
resolveStagingArtifactPath(operationId: OperationId | string, relativePath: string): string;
|
|
558
|
+
}
|
|
559
|
+
//#endregion
|
|
560
|
+
//#region src/storage/job-repository.d.ts
|
|
561
|
+
interface SessionIdentifier {
|
|
562
|
+
readonly header: {
|
|
563
|
+
readonly id: SessionId | string;
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
declare class JobRepository {
|
|
567
|
+
readonly paths: StoragePaths;
|
|
568
|
+
private readonly mutex;
|
|
569
|
+
constructor(paths: StoragePaths);
|
|
570
|
+
create(session: SessionIdentifier, job: MinerUJobRecord): Promise<MinerUJobRecord>;
|
|
571
|
+
get(session: SessionIdentifier, jobId: MinerUJobId | string): Promise<MinerUJobRecord | undefined>;
|
|
572
|
+
require(session: SessionIdentifier, jobId: MinerUJobId | string): Promise<MinerUJobRecord>;
|
|
573
|
+
update(session: SessionIdentifier, jobId: MinerUJobId | string, mutator: (current: MinerUJobRecord) => MinerUJobRecord | Promise<MinerUJobRecord>): Promise<MinerUJobRecord>;
|
|
574
|
+
list(session: SessionIdentifier): Promise<readonly MinerUJobRecord[]>;
|
|
575
|
+
private atomicWrite;
|
|
576
|
+
}
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region src/storage/result-repository.d.ts
|
|
579
|
+
declare class ResultTransaction implements ArtifactSink {
|
|
580
|
+
readonly request: CanonicalParseRequest;
|
|
581
|
+
readonly producer: ResultProducer;
|
|
582
|
+
readonly paths: StoragePaths;
|
|
583
|
+
readonly operationId: OperationId;
|
|
584
|
+
readonly stagingDir: string;
|
|
585
|
+
private readonly sink;
|
|
586
|
+
constructor(operationId: OperationId | string, request: CanonicalParseRequest, producer: ResultProducer, paths: StoragePaths, signal?: AbortSignal, maxArtifactBytes?: number);
|
|
587
|
+
writeArtifact(fileId: MinerUFileId, kind: ArtifactKind, input: ArtifactInput, options: ArtifactWriteOptions): Promise<ArtifactRef>;
|
|
588
|
+
writeTemporary(name: string, input: ArtifactInput, maxBytes: number): Promise<TemporaryArtifact>;
|
|
589
|
+
buildManifest(file: CanonicalSourceFile, artifacts: readonly ArtifactRef[]): MinerUResultManifest;
|
|
590
|
+
abort(): Promise<void>;
|
|
591
|
+
}
|
|
592
|
+
interface ResultRepositoryOptions {
|
|
593
|
+
readonly maxJsonValidationBytes?: number;
|
|
594
|
+
readonly maxArtifactBytes?: number;
|
|
595
|
+
}
|
|
596
|
+
declare class ResultRepository {
|
|
597
|
+
readonly paths: StoragePaths;
|
|
598
|
+
private readonly maxJsonValidationBytes;
|
|
599
|
+
private readonly maxArtifactBytes;
|
|
600
|
+
constructor(paths: StoragePaths, options?: ResultRepositoryOptions);
|
|
601
|
+
beginTransaction(operationId: OperationId | string, request: CanonicalParseRequest, producer: ResultProducer, signal?: AbortSignal): ResultTransaction;
|
|
602
|
+
private assertManifestConsistency;
|
|
603
|
+
private verifyArtifact;
|
|
604
|
+
private verifyManifestArtifacts;
|
|
605
|
+
commitTransaction(tx: ResultTransaction, manifest: MinerUResultManifest, signal?: AbortSignal): Promise<{
|
|
606
|
+
resultId: MinerUResultId;
|
|
607
|
+
cacheKey: CacheKey;
|
|
608
|
+
manifest: MinerUResultManifest;
|
|
609
|
+
}>;
|
|
610
|
+
get(cacheKey: CacheKey | string, requiredArtifacts?: readonly ArtifactKind[], signal?: AbortSignal): Promise<MinerUResultManifest | undefined>;
|
|
611
|
+
resolveArtifactAbsolutePath(cacheKey: CacheKey | string, relativePath: string): string;
|
|
612
|
+
manifestAbsolutePath(cacheKey: CacheKey | string): string;
|
|
613
|
+
quarantine(sourcePath: string, reason?: string): Promise<string>;
|
|
614
|
+
cleanupStaging(ttlMs: number, activeOperationIds?: ReadonlySet<OperationId | string>, signal?: AbortSignal): Promise<number>;
|
|
615
|
+
}
|
|
616
|
+
//#endregion
|
|
617
|
+
//#region src/service/mineru-service.d.ts
|
|
618
|
+
interface ServiceSession extends SessionIdentifier {
|
|
619
|
+
readonly header: {
|
|
620
|
+
readonly id: SessionId | string;
|
|
621
|
+
readonly cwd?: string;
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
type CredentialResolver = (reference: string, signal: AbortSignal) => Promise<string | undefined>;
|
|
625
|
+
type SubmissionSource = 'cache' | 'shared-operation' | 'provider';
|
|
626
|
+
interface FileStatusView {
|
|
627
|
+
readonly file_id: string;
|
|
628
|
+
readonly name: string;
|
|
629
|
+
readonly state: string;
|
|
630
|
+
readonly progress?: {
|
|
631
|
+
readonly completed: number;
|
|
632
|
+
readonly total: number;
|
|
633
|
+
};
|
|
634
|
+
readonly failure?: MinerUFailure;
|
|
635
|
+
}
|
|
636
|
+
interface SubmitView {
|
|
637
|
+
readonly job_id: string;
|
|
638
|
+
readonly state: MinerUJobState;
|
|
639
|
+
readonly source: SubmissionSource;
|
|
640
|
+
readonly provider: MinerUProviderId;
|
|
641
|
+
readonly files: readonly FileStatusView[];
|
|
642
|
+
readonly result_available: boolean;
|
|
643
|
+
readonly failure?: MinerUFailure;
|
|
644
|
+
}
|
|
645
|
+
interface StatusView extends SubmitView {
|
|
646
|
+
readonly created_at: number;
|
|
647
|
+
readonly updated_at: number;
|
|
648
|
+
}
|
|
649
|
+
interface ArtifactView {
|
|
650
|
+
readonly kind: string;
|
|
651
|
+
readonly path: string;
|
|
652
|
+
readonly bytes: number;
|
|
653
|
+
}
|
|
654
|
+
interface ResultFileView {
|
|
655
|
+
readonly file_id: string;
|
|
656
|
+
readonly name: string;
|
|
657
|
+
readonly artifacts: readonly ArtifactView[];
|
|
658
|
+
readonly artifacts_truncated?: boolean;
|
|
659
|
+
}
|
|
660
|
+
interface ResultView {
|
|
661
|
+
readonly job_id: string;
|
|
662
|
+
readonly state: Extract<MinerUJobState, 'completed' | 'partially-completed'>;
|
|
663
|
+
readonly cache_hit: boolean;
|
|
664
|
+
readonly result_id: string;
|
|
665
|
+
readonly files: readonly ResultFileView[];
|
|
666
|
+
readonly markdown_preview?: string;
|
|
667
|
+
readonly preview_truncated: boolean;
|
|
668
|
+
readonly manifest_path: string;
|
|
669
|
+
readonly output_limit_chars: number;
|
|
670
|
+
}
|
|
671
|
+
interface ProbeView {
|
|
672
|
+
readonly available: boolean;
|
|
673
|
+
readonly provider: MinerUProviderId;
|
|
674
|
+
readonly authentication: 'valid' | 'invalid' | 'not-configured' | 'unknown';
|
|
675
|
+
readonly protocol_version: string;
|
|
676
|
+
readonly server_version?: string;
|
|
677
|
+
readonly queue?: {
|
|
678
|
+
readonly queued?: number;
|
|
679
|
+
readonly processing?: number;
|
|
680
|
+
readonly completed?: number;
|
|
681
|
+
readonly failed?: number;
|
|
682
|
+
readonly max_concurrent?: number;
|
|
683
|
+
};
|
|
684
|
+
readonly diagnostics?: string;
|
|
685
|
+
}
|
|
686
|
+
type ParseDocumentView = ResultView | (StatusView & {
|
|
687
|
+
readonly poll_timed_out?: true;
|
|
688
|
+
});
|
|
689
|
+
interface MinerUServiceOptions {
|
|
690
|
+
readonly getConfig: () => MinerUConfig;
|
|
691
|
+
readonly providers: ProviderRegistry;
|
|
692
|
+
readonly jobs: JobRepository;
|
|
693
|
+
readonly results: ResultRepository;
|
|
694
|
+
readonly operations: SharedOperationRegistry;
|
|
695
|
+
readonly resolveCredential: CredentialResolver;
|
|
696
|
+
}
|
|
697
|
+
declare class MinerUService {
|
|
698
|
+
private readonly options;
|
|
699
|
+
constructor(options: MinerUServiceOptions);
|
|
700
|
+
private config;
|
|
701
|
+
private callContext;
|
|
702
|
+
private legacyBackendModels;
|
|
703
|
+
probe(signal: AbortSignal, draft?: ProviderConfig): Promise<ProbeView>;
|
|
704
|
+
submit(session: ServiceSession, input: ParseRequestInput, signal: AbortSignal): Promise<SubmitView>;
|
|
705
|
+
private newJob;
|
|
706
|
+
private syncSubmission;
|
|
707
|
+
private updateWaiters;
|
|
708
|
+
private snapshotFiles;
|
|
709
|
+
private runOperation;
|
|
710
|
+
status(session: ServiceSession, jobId: string, signal: AbortSignal): Promise<StatusView>;
|
|
711
|
+
private markdownPreview;
|
|
712
|
+
private fitResult;
|
|
713
|
+
result(session: ServiceSession, jobId: string, signal: AbortSignal): Promise<ResultView>;
|
|
714
|
+
private projectResult;
|
|
715
|
+
parseDocument(session: ServiceSession, input: ParseRequestInput, signal: AbortSignal, pollTimeoutMs?: number): Promise<ParseDocumentView>;
|
|
716
|
+
}
|
|
717
|
+
//#endregion
|
|
718
|
+
//#region src/index.d.ts
|
|
719
|
+
declare const name = "dsh-pdf-mineru";
|
|
720
|
+
declare const inject: string[];
|
|
721
|
+
/** Entry schema accepts both the provider config and the legacy flat config. */
|
|
722
|
+
declare const Config: z<unknown>;
|
|
723
|
+
declare function apply(ctx: Context, entryConfig?: unknown): Promise<() => Promise<void>>;
|
|
724
|
+
//#endregion
|
|
725
|
+
export { ARTIFACT_KINDS, ArtifactInput, ArtifactKind, ArtifactRef, ArtifactSink, ArtifactView, ArtifactWriteOptions, CACHE_KEY_SPEC_VERSION, CANONICAL_PARSE_REQUEST_SCHEMA_VERSION, CacheKey, CanonicalParseRequest, CanonicalSourceFile, Config, CredentialResolver, FileStatusView, JobResolution, JobSourceFile, LegacyMinerUConfig, MINERU_JOB_SCHEMA_VERSION, MINERU_RESULT_MANIFEST_SCHEMA_VERSION, MinerUConfig, MinerUError, MinerUErrorCode, MinerUFailure, MinerUFileId, MinerUFileState, MinerUFileStatus, MinerUJobId, MinerUJobRecord, MinerUJobState, MinerUModel, MinerUProvider, MinerUProviderId, MinerUResultId, MinerUResultManifest, MinerUService, MinerUServiceOptions, OfficialV4Config, OfficialV4Provider, OperationId, OutputConfig, ParseDefaults, ParseDocumentView, ParseMethod, ParseRequestInput, ParseSemantics, ParsedDocumentManifest, PollingConfig, PreparedParseRequest, PreparedSourceFile, ProbeView, ProviderCallContext, ProviderCallLimits, ProviderCapabilities, ProviderCollectedFile, ProviderCollection, ProviderCompatibilityContext, ProviderConfig, ProviderConfigId, ProviderFileSnapshot, ProviderJobRef, ProviderJobSnapshot, ProviderProbeResult, ProviderSubmission, ProviderSubmittedFile, RESULT_SCHEMA_VERSION, ResultFileView, ResultProducer, ResultView, SecurityLimits, SelfHostedFileParseResult, SelfHostedHealthResponse, SelfHostedTaskResultResponse, SelfHostedTaskSubmitResponse, SelfHostedV2Config, SelfHostedV2Provider, SelfHostedV2ProviderConfig, ServiceSession, SessionId, StatusView, StorageConfig, SubmissionSource, SubmitView, TemporaryArtifact, apply, asCacheKey, asFileId, asJobId, asOperationId, asProviderConfigId, asResultId, asSessionId, assertJobTransition, assertSafePathSegment, createFileId, createJobId, createOperationId, defaultMinerUConfig, failure, inject, isTerminalJobState, migrateConfig, name, normalizeArtifactKinds, providerById, resultIdForCacheKey, sanitizeDiagnostic, throwMinerU, toMinerUFailure, validateProviderCapabilities };
|