@eigenpal/cli 0.10.42 → 0.10.44
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/cli.js +115 -1908
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -69074,1630 +69074,6 @@ var init_webhooks = __esm(() => {
|
|
|
69074
69074
|
});
|
|
69075
69075
|
});
|
|
69076
69076
|
|
|
69077
|
-
// ../openparser-schema/dist/index.js
|
|
69078
|
-
function applyPaddleOcrOptionDefaults(requested) {
|
|
69079
|
-
const source = requested && typeof requested === "object" ? requested : undefined;
|
|
69080
|
-
return {
|
|
69081
|
-
image_block_ocr: typeof source?.image_block_ocr === "boolean" ? source.image_block_ocr : PADDLE_OCR_OPTION_DEFAULTS.image_block_ocr,
|
|
69082
|
-
chart_recognition: typeof source?.chart_recognition === "boolean" ? source.chart_recognition : PADDLE_OCR_OPTION_DEFAULTS.chart_recognition,
|
|
69083
|
-
merge_layout_blocks: typeof source?.merge_layout_blocks === "boolean" ? source.merge_layout_blocks : PADDLE_OCR_OPTION_DEFAULTS.merge_layout_blocks
|
|
69084
|
-
};
|
|
69085
|
-
}
|
|
69086
|
-
function isPlainObject3(value) {
|
|
69087
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
69088
|
-
}
|
|
69089
|
-
function typeList(schema) {
|
|
69090
|
-
if (typeof schema.type === "string")
|
|
69091
|
-
return [schema.type];
|
|
69092
|
-
if (Array.isArray(schema.type)) {
|
|
69093
|
-
return schema.type.filter((t) => typeof t === "string");
|
|
69094
|
-
}
|
|
69095
|
-
return [];
|
|
69096
|
-
}
|
|
69097
|
-
function isObjectRootSchema(schema) {
|
|
69098
|
-
const types = typeList(schema);
|
|
69099
|
-
if (types.includes("object"))
|
|
69100
|
-
return true;
|
|
69101
|
-
return types.length === 0 && isPlainObject3(schema.properties);
|
|
69102
|
-
}
|
|
69103
|
-
function pipelineExtractionSchemaRootPropertyCount(schema) {
|
|
69104
|
-
if (!isPlainObject3(schema))
|
|
69105
|
-
return null;
|
|
69106
|
-
if (!isObjectRootSchema(schema))
|
|
69107
|
-
return null;
|
|
69108
|
-
if (!isPlainObject3(schema.properties))
|
|
69109
|
-
return null;
|
|
69110
|
-
return Object.keys(schema.properties).length;
|
|
69111
|
-
}
|
|
69112
|
-
function hasPipelineExtractionSchemaProperties(schema) {
|
|
69113
|
-
const count = pipelineExtractionSchemaRootPropertyCount(schema);
|
|
69114
|
-
return count !== null && count > 0;
|
|
69115
|
-
}
|
|
69116
|
-
function refinePipelineExtractionSchema(schema, ctx, path = ["schema"]) {
|
|
69117
|
-
if (!isPlainObject3(schema)) {
|
|
69118
|
-
ctx.addIssue({
|
|
69119
|
-
code: "custom",
|
|
69120
|
-
message: "schema must be an object",
|
|
69121
|
-
path
|
|
69122
|
-
});
|
|
69123
|
-
return;
|
|
69124
|
-
}
|
|
69125
|
-
const count = pipelineExtractionSchemaRootPropertyCount(schema);
|
|
69126
|
-
if (count === null) {
|
|
69127
|
-
ctx.addIssue({
|
|
69128
|
-
code: "custom",
|
|
69129
|
-
message: "schema root must be an object schema with explicit properties",
|
|
69130
|
-
path
|
|
69131
|
-
});
|
|
69132
|
-
return;
|
|
69133
|
-
}
|
|
69134
|
-
if (count === 0) {
|
|
69135
|
-
ctx.addIssue({
|
|
69136
|
-
code: "custom",
|
|
69137
|
-
message: PIPELINE_EXTRACTION_SCHEMA_EMPTY_PROPERTIES_MESSAGE,
|
|
69138
|
-
path
|
|
69139
|
-
});
|
|
69140
|
-
}
|
|
69141
|
-
}
|
|
69142
|
-
function refineExtractPipelineXor(value, ctx, options) {
|
|
69143
|
-
const hasPipeline = value.pipeline_id !== undefined;
|
|
69144
|
-
const presentInline = EXTRACT_INLINE_CONFIG_KEYS.filter((key) => value[key] !== undefined);
|
|
69145
|
-
const requireOcrModel = options?.requireOcrModel !== false;
|
|
69146
|
-
if (hasPipeline && presentInline.length > 0) {
|
|
69147
|
-
ctx.addIssue({
|
|
69148
|
-
code: "custom",
|
|
69149
|
-
message: "pipeline_inline_conflict",
|
|
69150
|
-
path: ["pipeline_id"]
|
|
69151
|
-
});
|
|
69152
|
-
return;
|
|
69153
|
-
}
|
|
69154
|
-
if (hasPipeline)
|
|
69155
|
-
return;
|
|
69156
|
-
if (requireOcrModel && value.ocr_model === undefined) {
|
|
69157
|
-
ctx.addIssue({ code: "custom", message: "Required", path: ["ocr_model"] });
|
|
69158
|
-
}
|
|
69159
|
-
if (value.llm_model === undefined) {
|
|
69160
|
-
ctx.addIssue({ code: "custom", message: "Required", path: ["llm_model"] });
|
|
69161
|
-
}
|
|
69162
|
-
if (value.schema === undefined) {
|
|
69163
|
-
ctx.addIssue({ code: "custom", message: "Required", path: ["schema"] });
|
|
69164
|
-
}
|
|
69165
|
-
}
|
|
69166
|
-
function migratedOcrJobIdFromUuid(uuid3) {
|
|
69167
|
-
return `opj_${uuid3.toLowerCase().replace(/-/g, "")}`;
|
|
69168
|
-
}
|
|
69169
|
-
function normalizeOcrJobIdInput(id) {
|
|
69170
|
-
const trimmed = id.trim();
|
|
69171
|
-
if (LEGACY_OCR_JOB_UUID_PATTERN.test(trimmed)) {
|
|
69172
|
-
return migratedOcrJobIdFromUuid(trimmed);
|
|
69173
|
-
}
|
|
69174
|
-
return trimmed;
|
|
69175
|
-
}
|
|
69176
|
-
function isOcrJobIdInput(id) {
|
|
69177
|
-
return JobIdInputSchema.safeParse(id).success;
|
|
69178
|
-
}
|
|
69179
|
-
function isPreferredOcrJobId(id) {
|
|
69180
|
-
return OCR_JOB_ID_PATTERN.test(id);
|
|
69181
|
-
}
|
|
69182
|
-
function normalizeOcrPipelineIdInput(id) {
|
|
69183
|
-
const trimmed = id.trim();
|
|
69184
|
-
if (trimmed.startsWith(LEGACY_OCR_PIPELINE_ID_PREFIX)) {
|
|
69185
|
-
return `oppl_${trimmed.slice(LEGACY_OCR_PIPELINE_ID_PREFIX.length)}`;
|
|
69186
|
-
}
|
|
69187
|
-
return trimmed;
|
|
69188
|
-
}
|
|
69189
|
-
function getDefaultOcrModelId() {
|
|
69190
|
-
const defaults = OCR_MODEL_CATALOG.filter((entry) => entry.is_default);
|
|
69191
|
-
if (defaults.length !== 1) {
|
|
69192
|
-
throw new Error("OCR_MODEL_CATALOG must declare exactly one default model");
|
|
69193
|
-
}
|
|
69194
|
-
return defaults[0].id;
|
|
69195
|
-
}
|
|
69196
|
-
function getOcrModelUsdPerPage(modelId) {
|
|
69197
|
-
const entry = OCR_MODEL_CATALOG.find((model) => model.id === modelId);
|
|
69198
|
-
const usd = entry?.pricing.usd_per_page;
|
|
69199
|
-
if (usd == null || !Number.isFinite(usd) || usd < 0)
|
|
69200
|
-
return null;
|
|
69201
|
-
return usd;
|
|
69202
|
-
}
|
|
69203
|
-
function requireOcrModelUsdPerPage(modelId) {
|
|
69204
|
-
const usd = getOcrModelUsdPerPage(modelId);
|
|
69205
|
-
if (usd == null) {
|
|
69206
|
-
throw new Error(`OCR model ${modelId} is missing customer retail page pricing`);
|
|
69207
|
-
}
|
|
69208
|
-
return usd;
|
|
69209
|
-
}
|
|
69210
|
-
function requireExactlyOneSource(item, ctx) {
|
|
69211
|
-
const hasIndex = item.file_index !== undefined;
|
|
69212
|
-
const hasFileId = item.file_id !== undefined;
|
|
69213
|
-
if (hasIndex === hasFileId) {
|
|
69214
|
-
ctx.addIssue({
|
|
69215
|
-
code: "custom",
|
|
69216
|
-
message: "each batch item requires exactly one of file_index or file_id",
|
|
69217
|
-
path: hasIndex ? ["file_id"] : ["file_index"]
|
|
69218
|
-
});
|
|
69219
|
-
}
|
|
69220
|
-
}
|
|
69221
|
-
function getOpenParserRoute(method, path) {
|
|
69222
|
-
const normalizedMethod = method.toLowerCase();
|
|
69223
|
-
return OPENPARSER_ROUTE_MANIFEST.find((route) => {
|
|
69224
|
-
if (route.method !== normalizedMethod)
|
|
69225
|
-
return false;
|
|
69226
|
-
const pattern = route.path.replace(/\{[^/]+\}/g, "[^/]+");
|
|
69227
|
-
return new RegExp(`^${pattern}$`).test(path);
|
|
69228
|
-
});
|
|
69229
|
-
}
|
|
69230
|
-
function canonicalParseRequestExample() {
|
|
69231
|
-
return {
|
|
69232
|
-
ocr_model: getDefaultOcrModelId(),
|
|
69233
|
-
output_format: OPENPARSER_DEFAULT_OUTPUT_FORMAT
|
|
69234
|
-
};
|
|
69235
|
-
}
|
|
69236
|
-
function shellSingleQuote(value) {
|
|
69237
|
-
return `'${value.replaceAll("'", `'"'"'`)}'`;
|
|
69238
|
-
}
|
|
69239
|
-
function serializeOpenParserMultipartRequest(body) {
|
|
69240
|
-
return `request=${JSON.stringify(body)};type=application/json`;
|
|
69241
|
-
}
|
|
69242
|
-
function buildOpenParserMultipartCurl(input) {
|
|
69243
|
-
const baseUrl = input.baseUrl.replace(/\/$/, "");
|
|
69244
|
-
const filePath = input.filePath ?? "./document.pdf";
|
|
69245
|
-
return [
|
|
69246
|
-
`curl -X POST ${shellSingleQuote(`${baseUrl}${input.path}`)} \\`,
|
|
69247
|
-
` -H ${shellSingleQuote(`Authorization: Bearer ${OPENPARSER_CURL_API_KEY_PLACEHOLDER}`)} \\`,
|
|
69248
|
-
` -H "Idempotency-Key: ${OPENPARSER_CURL_IDEMPOTENCY_KEY_EXPR}" \\`,
|
|
69249
|
-
` -F ${shellSingleQuote(serializeOpenParserMultipartRequest(input.requestBody))} \\`,
|
|
69250
|
-
` -F ${shellSingleQuote(`file=@${filePath}`)}`
|
|
69251
|
-
].join(`
|
|
69252
|
-
`);
|
|
69253
|
-
}
|
|
69254
|
-
function buildParseCurl(input) {
|
|
69255
|
-
return buildOpenParserMultipartCurl({
|
|
69256
|
-
baseUrl: input.baseUrl,
|
|
69257
|
-
path: input.path ?? "/parse",
|
|
69258
|
-
requestBody: canonicalParseRequestExample(),
|
|
69259
|
-
filePath: input.filePath
|
|
69260
|
-
});
|
|
69261
|
-
}
|
|
69262
|
-
function buildExtractPipelineCurl(input) {
|
|
69263
|
-
return buildOpenParserMultipartCurl({
|
|
69264
|
-
baseUrl: input.baseUrl,
|
|
69265
|
-
path: "/extract/async",
|
|
69266
|
-
requestBody: { pipeline_id: input.pipelineId },
|
|
69267
|
-
filePath: input.filePath
|
|
69268
|
-
});
|
|
69269
|
-
}
|
|
69270
|
-
var BoundingBoxSchema, PointSchema2, PolygonSchema, PAGE_BLOCK_KINDS, PageBlockKindSchema, PageBlockSchema, REGION_TYPES, RegionTypeSchema, RegionSchema, CONTENT_KINDS, ContentKindSchema, RegionContentSchema, Sha256HexSchema, ChunkProvenanceSpanSchema, ExtractionChunkSchema, ParsedDocumentSchema, OCR_JOB_ID_PREFIX = "opj", OCR_JOB_ID_PATTERN, JobIdSchema, EXTRACTION_GROUNDING_MODES, ExtractionGroundingModeSchema, EXTRACTION_CITATION_GRANULARITIES, ExtractionCitationGranularitySchema, CitationSourceTypeSchema, ExtractionCitationSchema, ExtractionGroundingFieldSchema, ExtractionGroundingResultSchema, OCR_LLM_REASONING_EFFORTS, OcrLlmReasoningEffortSchema, OcrLlmReasoningEffortRequestSchema, OcrLlmRecommendationTierSchema, OcrLlmPublicPricingBasisSchema, OcrLlmModelPricingSchema, OcrLlmModelReasoningSchema, OcrLlmModelCatalogEntrySchema, OcrLlmModelsListModeSchema, OcrLlmModelsQuerySchema, OcrLlmModelsResponseSchema, EXTRACTION_ATTEMPT_KINDS, ExtractionAttemptKindSchema, EXTRACTION_ATTEMPT_STATUSES, ExtractionAttemptStatusSchema, LlmModelSchema, ExtractionAttemptSchema, ExtractionUsageTotalsSchema, ExtractionTerminalResultSchema, PaddleOcrOptionsRequestSchema, PaddleOcrOptionsEffectiveSchema, PADDLE_OCR_OPTION_DEFAULTS, OcrOptionsRequestSchema, OcrOptionsEffectiveSchema, LlmOptionsRequestSchema, LlmOptionsStoredSchema, OcrModelOptionCapabilitySchema, PIPELINE_EXTRACTION_SCHEMA_EMPTY_PROPERTIES_MESSAGE = "extraction pipeline schema must include at least one named property", ExtractionPipelineIdSchema, ExtractionPipelineNameSchema, ExtractionPipelineSlugSchema, PipelineExtractionSchemaObjectSchema, PipelineConfigFields, CreateExtractionPipelineRequestSchema, UpdateExtractionPipelineRequestSchema, ExtractionPipelineSchema, ExtractionPipelineListResponseSchema, DeleteExtractionPipelineResponseSchema, EXTRACT_INLINE_CONFIG_KEYS, LEGACY_OCR_JOB_UUID_PATTERN, JobIdInputSchema, LEGACY_OCR_PIPELINE_ID_PREFIX = "oep_", ExtractionPipelineIdInputSchema, OCR_OUTPUT_FORMATS, OcrOutputFormatSchema, PaddleRawProfileSchema, RawParseResultSchema, SUGGEST_SCHEMA_HINT_MAX_CHARS = 500, SUGGEST_SCHEMA_PREVIEW_MAX_PAGES = 2, SUGGEST_SCHEMA_PREVIEW_MAX_CHARS = 24000, SuggestSchemaHintSchema, SuggestSchemaRequestSchema, SuggestSchemaResponseSchema, SuggestSchemaPreviewMetaSchema, SuggestSchemaTerminalResultSchema, OCR_OPENAPI_RELATIVE_PATH = "docs/OCR_API_OPENAPI.yaml", OCR_JOB_STATUSES, JobStatusSchema, OCR_JOB_OPERATIONS, JobOperationSchema, OCR_JOB_HISTORY_OPERATIONS, JobHistoryOperationSchema, JobFailureSchema, JobAcceptedSchema, BatchJobAcceptedSchema, BatchChildSummarySchema, BatchChildPageSchema, BatchSummaryCountsSchema, JobProgressSchema, RelatedExtractionSummarySchema, JobSchema, OCR_JOB_LIST_DEFAULT_LIMIT = 25, OCR_JOB_LIST_MAX_LIMIT = 100, JobSummarySchema, JobListResponseSchema, JobListQuerySchema, ErrorBodySchema, ErrorResponseSchema, OCR_SYNC_STATUS_CODES, OCR_MODELS, OcrModelAvailabilitySchema, OcrModelPricingBasisSchema, OcrModelPricingSchema, PADDLE_OCR_USD_PER_PAGE = 0.001, OcrModelCatalogEntrySchema, OcrModelsResponseSchema, PADDLE_OPTION_CAPABILITIES, OCR_MODEL_CATALOG, OcrModelSchema, OcrFileIdSchema, RepairAttemptsSchema, ExtractionJsonSchemaObjectSchema, ParseRequestSchema, ExtractRequestSchema, ParseBatchItemSchema, ExtractBatchItemSchema, ParseBatchRequestSchema, ExtractBatchRequestSchema, PublicFileSchema, DeleteFileResponseSchema, OpenParserParseResultSchema, OPENPARSER_COMPONENT_SCHEMAS, admissionErrors, OPENPARSER_ROUTE_MANIFEST, OPENPARSER_DEFAULT_OUTPUT_FORMAT = "openparser@1", OPENPARSER_CURL_API_KEY_PLACEHOLDER = "YOUR_API_KEY", OPENPARSER_CURL_IDEMPOTENCY_KEY_EXPR = "$(uuidgen 2>/dev/null || openssl rand -hex 16)", OPENPARSER_IDEMPOTENCY_KEY_GUIDANCE = "Use a unique Idempotency-Key for each distinct request body. Reuse the same key only when retrying an identical admission.";
|
|
69271
|
-
var init_dist = __esm(() => {
|
|
69272
|
-
init_zod();
|
|
69273
|
-
init_zod();
|
|
69274
|
-
init_zod();
|
|
69275
|
-
init_zod();
|
|
69276
|
-
init_zod();
|
|
69277
|
-
init_zod();
|
|
69278
|
-
init_zod();
|
|
69279
|
-
init_zod();
|
|
69280
|
-
init_zod();
|
|
69281
|
-
init_zod();
|
|
69282
|
-
init_zod();
|
|
69283
|
-
init_zod();
|
|
69284
|
-
init_zod();
|
|
69285
|
-
BoundingBoxSchema = exports_external.object({
|
|
69286
|
-
left: exports_external.number().int().min(0),
|
|
69287
|
-
top: exports_external.number().int().min(0),
|
|
69288
|
-
right: exports_external.number().int().positive(),
|
|
69289
|
-
bottom: exports_external.number().int().positive()
|
|
69290
|
-
}).strict().superRefine((box, ctx) => {
|
|
69291
|
-
if (box.right <= box.left || box.bottom <= box.top) {
|
|
69292
|
-
ctx.addIssue({
|
|
69293
|
-
code: "custom",
|
|
69294
|
-
message: "bounding box must have positive area"
|
|
69295
|
-
});
|
|
69296
|
-
}
|
|
69297
|
-
});
|
|
69298
|
-
PointSchema2 = exports_external.object({
|
|
69299
|
-
x: exports_external.number().min(0),
|
|
69300
|
-
y: exports_external.number().min(0)
|
|
69301
|
-
}).strict();
|
|
69302
|
-
PolygonSchema = exports_external.array(PointSchema2).min(3);
|
|
69303
|
-
PAGE_BLOCK_KINDS = ["text", "table", "figure"];
|
|
69304
|
-
PageBlockKindSchema = exports_external.enum(PAGE_BLOCK_KINDS);
|
|
69305
|
-
PageBlockSchema = exports_external.object({
|
|
69306
|
-
index: exports_external.number().int().min(0),
|
|
69307
|
-
page_number: exports_external.number().int().min(1),
|
|
69308
|
-
kind: PageBlockKindSchema,
|
|
69309
|
-
text: exports_external.string().nullable().optional(),
|
|
69310
|
-
table_html: exports_external.string().nullable().optional(),
|
|
69311
|
-
figure_uri: exports_external.string().nullable().optional(),
|
|
69312
|
-
bbox: BoundingBoxSchema.nullable().optional(),
|
|
69313
|
-
polygon: PolygonSchema.nullable().optional(),
|
|
69314
|
-
confidence: exports_external.number().min(0).max(1).nullable().optional(),
|
|
69315
|
-
source_label: exports_external.string().min(1).nullable().optional(),
|
|
69316
|
-
region_id: exports_external.string().min(1).nullable().optional(),
|
|
69317
|
-
coordinate_width: exports_external.number().int().positive().nullable().optional(),
|
|
69318
|
-
coordinate_height: exports_external.number().int().positive().nullable().optional()
|
|
69319
|
-
}).strict().superRefine((block, ctx) => {
|
|
69320
|
-
const widthNull = block.coordinate_width == null;
|
|
69321
|
-
const heightNull = block.coordinate_height == null;
|
|
69322
|
-
if (widthNull !== heightNull) {
|
|
69323
|
-
ctx.addIssue({
|
|
69324
|
-
code: "custom",
|
|
69325
|
-
message: "block coordinate dimensions must be provided together",
|
|
69326
|
-
path: ["coordinate_width"]
|
|
69327
|
-
});
|
|
69328
|
-
}
|
|
69329
|
-
if (block.kind === "text" && block.text == null) {
|
|
69330
|
-
ctx.addIssue({ code: "custom", message: "text blocks require text", path: ["text"] });
|
|
69331
|
-
}
|
|
69332
|
-
if (block.kind === "table" && block.table_html == null) {
|
|
69333
|
-
ctx.addIssue({
|
|
69334
|
-
code: "custom",
|
|
69335
|
-
message: "table blocks require table_html",
|
|
69336
|
-
path: ["table_html"]
|
|
69337
|
-
});
|
|
69338
|
-
}
|
|
69339
|
-
});
|
|
69340
|
-
REGION_TYPES = [
|
|
69341
|
-
"text",
|
|
69342
|
-
"heading",
|
|
69343
|
-
"table",
|
|
69344
|
-
"key_value",
|
|
69345
|
-
"figure",
|
|
69346
|
-
"checkbox",
|
|
69347
|
-
"signature",
|
|
69348
|
-
"barcode",
|
|
69349
|
-
"formula",
|
|
69350
|
-
"header_footer"
|
|
69351
|
-
];
|
|
69352
|
-
RegionTypeSchema = exports_external.enum(REGION_TYPES);
|
|
69353
|
-
RegionSchema = exports_external.object({
|
|
69354
|
-
id: exports_external.string().min(1),
|
|
69355
|
-
page_number: exports_external.number().int().min(1),
|
|
69356
|
-
type: RegionTypeSchema,
|
|
69357
|
-
bbox: BoundingBoxSchema,
|
|
69358
|
-
polygon: PolygonSchema.nullable().optional(),
|
|
69359
|
-
coordinate_width: exports_external.number().int().positive().nullable().optional(),
|
|
69360
|
-
coordinate_height: exports_external.number().int().positive().nullable().optional(),
|
|
69361
|
-
confidence: exports_external.number().min(0).max(1).nullable().optional(),
|
|
69362
|
-
source_label: exports_external.string().min(1).nullable().optional()
|
|
69363
|
-
}).strict().superRefine((region, ctx) => {
|
|
69364
|
-
if (region.coordinate_width == null !== (region.coordinate_height == null)) {
|
|
69365
|
-
ctx.addIssue({
|
|
69366
|
-
code: "custom",
|
|
69367
|
-
message: "region coordinate dimensions must be provided together",
|
|
69368
|
-
path: ["coordinate_width"]
|
|
69369
|
-
});
|
|
69370
|
-
}
|
|
69371
|
-
});
|
|
69372
|
-
CONTENT_KINDS = ["text", "table", "state", "figure"];
|
|
69373
|
-
ContentKindSchema = exports_external.enum(CONTENT_KINDS);
|
|
69374
|
-
RegionContentSchema = exports_external.object({
|
|
69375
|
-
region_id: exports_external.string().min(1),
|
|
69376
|
-
kind: ContentKindSchema,
|
|
69377
|
-
text: exports_external.string().nullable().optional(),
|
|
69378
|
-
table_html: exports_external.string().nullable().optional(),
|
|
69379
|
-
detected_state: exports_external.boolean().nullable().optional(),
|
|
69380
|
-
confidence: exports_external.number().min(0).max(1).nullable().optional()
|
|
69381
|
-
}).strict().superRefine((content, ctx) => {
|
|
69382
|
-
if (content.text == null && content.table_html == null && content.detected_state == null) {
|
|
69383
|
-
ctx.addIssue({
|
|
69384
|
-
code: "custom",
|
|
69385
|
-
message: "region content must contain a payload"
|
|
69386
|
-
});
|
|
69387
|
-
}
|
|
69388
|
-
if (content.kind === "table" && content.table_html == null) {
|
|
69389
|
-
ctx.addIssue({
|
|
69390
|
-
code: "custom",
|
|
69391
|
-
message: "table content requires table_html",
|
|
69392
|
-
path: ["table_html"]
|
|
69393
|
-
});
|
|
69394
|
-
}
|
|
69395
|
-
if (content.kind === "state" && content.detected_state == null) {
|
|
69396
|
-
ctx.addIssue({
|
|
69397
|
-
code: "custom",
|
|
69398
|
-
message: "state content requires detected_state",
|
|
69399
|
-
path: ["detected_state"]
|
|
69400
|
-
});
|
|
69401
|
-
}
|
|
69402
|
-
});
|
|
69403
|
-
Sha256HexSchema = exports_external.string().regex(/^[0-9a-f]{64}$/);
|
|
69404
|
-
ChunkProvenanceSpanSchema = exports_external.object({
|
|
69405
|
-
start_char: exports_external.number().int().min(0),
|
|
69406
|
-
end_char: exports_external.number().int().positive(),
|
|
69407
|
-
page_number: exports_external.number().int().min(1),
|
|
69408
|
-
bbox: BoundingBoxSchema,
|
|
69409
|
-
region_id: exports_external.string().min(1)
|
|
69410
|
-
}).strict().superRefine((span, ctx) => {
|
|
69411
|
-
if (span.end_char <= span.start_char) {
|
|
69412
|
-
ctx.addIssue({
|
|
69413
|
-
code: "custom",
|
|
69414
|
-
message: "chunk provenance span must have positive length"
|
|
69415
|
-
});
|
|
69416
|
-
}
|
|
69417
|
-
});
|
|
69418
|
-
ExtractionChunkSchema = exports_external.object({
|
|
69419
|
-
id: Sha256HexSchema,
|
|
69420
|
-
index: exports_external.number().int().min(0),
|
|
69421
|
-
document_id: exports_external.string().min(1),
|
|
69422
|
-
text: exports_external.string().min(1),
|
|
69423
|
-
content_sha256: Sha256HexSchema,
|
|
69424
|
-
page_numbers: exports_external.array(exports_external.number().int().min(1)).optional().default([]),
|
|
69425
|
-
page_start: exports_external.number().int().min(1).nullable().optional(),
|
|
69426
|
-
page_end: exports_external.number().int().min(1).nullable().optional(),
|
|
69427
|
-
region_ids: exports_external.array(exports_external.string().min(1)).optional().default([]),
|
|
69428
|
-
provenance_spans: exports_external.array(ChunkProvenanceSpanSchema).optional().default([])
|
|
69429
|
-
}).strict().superRefine((chunk, ctx) => {
|
|
69430
|
-
if (chunk.page_start == null !== (chunk.page_end == null)) {
|
|
69431
|
-
ctx.addIssue({
|
|
69432
|
-
code: "custom",
|
|
69433
|
-
message: "page_start and page_end must be provided together",
|
|
69434
|
-
path: ["page_start"]
|
|
69435
|
-
});
|
|
69436
|
-
}
|
|
69437
|
-
});
|
|
69438
|
-
ParsedDocumentSchema = exports_external.object({
|
|
69439
|
-
output_format: exports_external.literal("openparser@1"),
|
|
69440
|
-
document_id: exports_external.string().min(1),
|
|
69441
|
-
page_count: exports_external.number().int().min(0),
|
|
69442
|
-
markdown: exports_external.string(),
|
|
69443
|
-
blocks: exports_external.array(PageBlockSchema).min(1),
|
|
69444
|
-
regions: exports_external.array(RegionSchema).default([]),
|
|
69445
|
-
contents: exports_external.array(RegionContentSchema).default([]),
|
|
69446
|
-
chunks: exports_external.array(ExtractionChunkSchema).default([])
|
|
69447
|
-
}).strict().superRefine((doc2, ctx) => {
|
|
69448
|
-
const indexes = doc2.blocks.map((block) => block.index);
|
|
69449
|
-
for (let i = 0;i < indexes.length; i++) {
|
|
69450
|
-
if (indexes[i] !== i) {
|
|
69451
|
-
ctx.addIssue({
|
|
69452
|
-
code: "custom",
|
|
69453
|
-
message: "block indexes must be contiguous and zero-based",
|
|
69454
|
-
path: ["blocks", i, "index"]
|
|
69455
|
-
});
|
|
69456
|
-
break;
|
|
69457
|
-
}
|
|
69458
|
-
}
|
|
69459
|
-
for (const [i, block] of doc2.blocks.entries()) {
|
|
69460
|
-
if (block.page_number > doc2.page_count) {
|
|
69461
|
-
ctx.addIssue({
|
|
69462
|
-
code: "custom",
|
|
69463
|
-
message: "block page exceeds page_count",
|
|
69464
|
-
path: ["blocks", i, "page_number"]
|
|
69465
|
-
});
|
|
69466
|
-
}
|
|
69467
|
-
}
|
|
69468
|
-
for (const [i, region] of doc2.regions.entries()) {
|
|
69469
|
-
if (region.page_number > doc2.page_count) {
|
|
69470
|
-
ctx.addIssue({
|
|
69471
|
-
code: "custom",
|
|
69472
|
-
message: "region page exceeds page_count",
|
|
69473
|
-
path: ["regions", i, "page_number"]
|
|
69474
|
-
});
|
|
69475
|
-
}
|
|
69476
|
-
}
|
|
69477
|
-
});
|
|
69478
|
-
OCR_JOB_ID_PATTERN = /^opj_[A-Za-z0-9_-]+$/;
|
|
69479
|
-
JobIdSchema = exports_external.string().regex(OCR_JOB_ID_PATTERN, "job id must be an opj_… id").max(128);
|
|
69480
|
-
EXTRACTION_GROUNDING_MODES = ["none", "field"];
|
|
69481
|
-
ExtractionGroundingModeSchema = exports_external.enum(EXTRACTION_GROUNDING_MODES);
|
|
69482
|
-
EXTRACTION_CITATION_GRANULARITIES = ["block", "region"];
|
|
69483
|
-
ExtractionCitationGranularitySchema = exports_external.enum(EXTRACTION_CITATION_GRANULARITIES);
|
|
69484
|
-
CitationSourceTypeSchema = exports_external.enum([...PAGE_BLOCK_KINDS, ...REGION_TYPES]);
|
|
69485
|
-
ExtractionCitationSchema = exports_external.object({
|
|
69486
|
-
block_index: exports_external.number().int().min(0),
|
|
69487
|
-
region_id: exports_external.string().min(1).optional(),
|
|
69488
|
-
page_number: exports_external.number().int().min(1),
|
|
69489
|
-
bbox: BoundingBoxSchema,
|
|
69490
|
-
coordinate_width: exports_external.number().int().positive().nullable().optional(),
|
|
69491
|
-
coordinate_height: exports_external.number().int().positive().nullable().optional(),
|
|
69492
|
-
source_type: CitationSourceTypeSchema,
|
|
69493
|
-
granularity: ExtractionCitationGranularitySchema,
|
|
69494
|
-
confidence: exports_external.number().min(0).max(1).optional()
|
|
69495
|
-
}).strict();
|
|
69496
|
-
ExtractionGroundingFieldSchema = exports_external.object({
|
|
69497
|
-
path: exports_external.string().min(1),
|
|
69498
|
-
citations: exports_external.array(ExtractionCitationSchema),
|
|
69499
|
-
dropped_source_ids: exports_external.array(exports_external.string().min(1)).optional()
|
|
69500
|
-
}).strict();
|
|
69501
|
-
ExtractionGroundingResultSchema = exports_external.object({
|
|
69502
|
-
mode: exports_external.literal("field"),
|
|
69503
|
-
fields: exports_external.array(ExtractionGroundingFieldSchema)
|
|
69504
|
-
}).strict();
|
|
69505
|
-
OCR_LLM_REASONING_EFFORTS = [
|
|
69506
|
-
"none",
|
|
69507
|
-
"minimal",
|
|
69508
|
-
"low",
|
|
69509
|
-
"medium",
|
|
69510
|
-
"high",
|
|
69511
|
-
"xhigh",
|
|
69512
|
-
"max"
|
|
69513
|
-
];
|
|
69514
|
-
OcrLlmReasoningEffortSchema = exports_external.enum(OCR_LLM_REASONING_EFFORTS);
|
|
69515
|
-
OcrLlmReasoningEffortRequestSchema = exports_external.union([
|
|
69516
|
-
exports_external.literal("auto"),
|
|
69517
|
-
OcrLlmReasoningEffortSchema
|
|
69518
|
-
]);
|
|
69519
|
-
OcrLlmRecommendationTierSchema = exports_external.enum(["suggested", "compatible"]);
|
|
69520
|
-
OcrLlmPublicPricingBasisSchema = exports_external.literal("customer_retail");
|
|
69521
|
-
OcrLlmModelPricingSchema = exports_external.object({
|
|
69522
|
-
prompt_usd_per_1m: exports_external.number().finite().nonnegative(),
|
|
69523
|
-
completion_usd_per_1m: exports_external.number().finite().nonnegative(),
|
|
69524
|
-
basis: OcrLlmPublicPricingBasisSchema
|
|
69525
|
-
}).strict();
|
|
69526
|
-
OcrLlmModelReasoningSchema = exports_external.object({
|
|
69527
|
-
supported_efforts: exports_external.array(OcrLlmReasoningEffortSchema).nullable(),
|
|
69528
|
-
default_effort: OcrLlmReasoningEffortSchema.nullable(),
|
|
69529
|
-
mandatory: exports_external.boolean(),
|
|
69530
|
-
supports_max_tokens: exports_external.boolean()
|
|
69531
|
-
}).strict();
|
|
69532
|
-
OcrLlmModelCatalogEntrySchema = exports_external.object({
|
|
69533
|
-
id: exports_external.string().min(1).max(200),
|
|
69534
|
-
label: exports_external.string().min(1).max(120),
|
|
69535
|
-
provider: exports_external.string().min(1).max(64),
|
|
69536
|
-
created_at: exports_external.string().datetime().nullable(),
|
|
69537
|
-
context_length: exports_external.number().int().positive().nullable(),
|
|
69538
|
-
recommendation: OcrLlmRecommendationTierSchema,
|
|
69539
|
-
is_default: exports_external.boolean(),
|
|
69540
|
-
certified_grounding: exports_external.boolean(),
|
|
69541
|
-
certified_suggest: exports_external.boolean(),
|
|
69542
|
-
supports_grounding: exports_external.boolean(),
|
|
69543
|
-
supports_suggest: exports_external.boolean(),
|
|
69544
|
-
pricing_known: exports_external.literal(true),
|
|
69545
|
-
reasoning: OcrLlmModelReasoningSchema.nullable(),
|
|
69546
|
-
deprecated_at: exports_external.string().datetime().nullable(),
|
|
69547
|
-
pricing: OcrLlmModelPricingSchema
|
|
69548
|
-
}).strict();
|
|
69549
|
-
OcrLlmModelsListModeSchema = exports_external.enum(["suggested", "search"]);
|
|
69550
|
-
OcrLlmModelsQuerySchema = exports_external.object({
|
|
69551
|
-
mode: OcrLlmModelsListModeSchema.default("suggested"),
|
|
69552
|
-
q: exports_external.string().max(200).optional(),
|
|
69553
|
-
page: exports_external.coerce.number().int().min(1).default(1),
|
|
69554
|
-
limit: exports_external.coerce.number().int().min(1).max(100).default(25)
|
|
69555
|
-
}).strict();
|
|
69556
|
-
OcrLlmModelsResponseSchema = exports_external.object({
|
|
69557
|
-
mode: OcrLlmModelsListModeSchema,
|
|
69558
|
-
catalog_version: exports_external.string().min(1),
|
|
69559
|
-
fetched_at: exports_external.string().datetime(),
|
|
69560
|
-
stale: exports_external.boolean(),
|
|
69561
|
-
data: exports_external.array(OcrLlmModelCatalogEntrySchema),
|
|
69562
|
-
page: exports_external.number().int().min(1),
|
|
69563
|
-
limit: exports_external.number().int().min(1).max(100),
|
|
69564
|
-
total: exports_external.number().int().min(0),
|
|
69565
|
-
has_more: exports_external.boolean()
|
|
69566
|
-
}).strict();
|
|
69567
|
-
EXTRACTION_ATTEMPT_KINDS = ["primary", "repair"];
|
|
69568
|
-
ExtractionAttemptKindSchema = exports_external.enum(EXTRACTION_ATTEMPT_KINDS);
|
|
69569
|
-
EXTRACTION_ATTEMPT_STATUSES = ["succeeded", "failed", "indeterminate"];
|
|
69570
|
-
ExtractionAttemptStatusSchema = exports_external.enum(EXTRACTION_ATTEMPT_STATUSES);
|
|
69571
|
-
LlmModelSchema = exports_external.string().min(1).max(200);
|
|
69572
|
-
ExtractionAttemptSchema = exports_external.object({
|
|
69573
|
-
index: exports_external.number().int().min(0),
|
|
69574
|
-
kind: ExtractionAttemptKindSchema,
|
|
69575
|
-
llm_model: LlmModelSchema,
|
|
69576
|
-
status: ExtractionAttemptStatusSchema,
|
|
69577
|
-
input_tokens: exports_external.number().int().min(0).optional(),
|
|
69578
|
-
output_tokens: exports_external.number().int().min(0).optional(),
|
|
69579
|
-
cost_usd: exports_external.number().min(0).optional()
|
|
69580
|
-
}).strict();
|
|
69581
|
-
ExtractionUsageTotalsSchema = exports_external.object({
|
|
69582
|
-
input_tokens: exports_external.number().int().min(0).optional(),
|
|
69583
|
-
output_tokens: exports_external.number().int().min(0).optional(),
|
|
69584
|
-
cost_usd: exports_external.number().min(0).optional()
|
|
69585
|
-
}).strict();
|
|
69586
|
-
ExtractionTerminalResultSchema = exports_external.object({
|
|
69587
|
-
output: exports_external.unknown(),
|
|
69588
|
-
parsed_document: ParsedDocumentSchema,
|
|
69589
|
-
llm_model: LlmModelSchema,
|
|
69590
|
-
parse_job_id: JobIdSchema.optional(),
|
|
69591
|
-
reasoning_effort: OcrLlmReasoningEffortSchema.nullable().optional(),
|
|
69592
|
-
attempts: exports_external.array(ExtractionAttemptSchema).min(1),
|
|
69593
|
-
usage: ExtractionUsageTotalsSchema.optional(),
|
|
69594
|
-
grounding: ExtractionGroundingResultSchema.optional()
|
|
69595
|
-
}).strict();
|
|
69596
|
-
PaddleOcrOptionsRequestSchema = exports_external.object({
|
|
69597
|
-
image_block_ocr: exports_external.boolean().optional(),
|
|
69598
|
-
chart_recognition: exports_external.boolean().optional(),
|
|
69599
|
-
merge_layout_blocks: exports_external.boolean().optional().describe("Merge nearby cross-column or staggered text regions before recognition. Defaults to false to preserve one-to-one text and bounding-box alignment.")
|
|
69600
|
-
}).strict();
|
|
69601
|
-
PaddleOcrOptionsEffectiveSchema = exports_external.object({
|
|
69602
|
-
image_block_ocr: exports_external.boolean(),
|
|
69603
|
-
chart_recognition: exports_external.boolean(),
|
|
69604
|
-
merge_layout_blocks: exports_external.boolean()
|
|
69605
|
-
}).strict();
|
|
69606
|
-
PADDLE_OCR_OPTION_DEFAULTS = {
|
|
69607
|
-
image_block_ocr: false,
|
|
69608
|
-
chart_recognition: true,
|
|
69609
|
-
merge_layout_blocks: false
|
|
69610
|
-
};
|
|
69611
|
-
OcrOptionsRequestSchema = PaddleOcrOptionsRequestSchema;
|
|
69612
|
-
OcrOptionsEffectiveSchema = PaddleOcrOptionsEffectiveSchema;
|
|
69613
|
-
LlmOptionsRequestSchema = exports_external.object({ reasoning_effort: OcrLlmReasoningEffortRequestSchema.optional() }).strict();
|
|
69614
|
-
LlmOptionsStoredSchema = exports_external.object({ reasoning_effort: OcrLlmReasoningEffortRequestSchema.nullable() }).strict();
|
|
69615
|
-
OcrModelOptionCapabilitySchema = exports_external.object({
|
|
69616
|
-
image_block_ocr: exports_external.boolean(),
|
|
69617
|
-
chart_recognition: exports_external.boolean(),
|
|
69618
|
-
merge_layout_blocks: exports_external.boolean()
|
|
69619
|
-
}).strict();
|
|
69620
|
-
ExtractionPipelineIdSchema = exports_external.string().regex(/^oppl_[A-Za-z0-9_-]+$/, "pipeline_id must be an oppl_… id").max(128);
|
|
69621
|
-
ExtractionPipelineNameSchema = exports_external.string().trim().min(1).max(128);
|
|
69622
|
-
ExtractionPipelineSlugSchema = exports_external.string().trim().min(1).max(128).regex(/^[a-z0-9][a-z0-9_-]*$/, "slug must be lowercase alphanumeric with _ or -");
|
|
69623
|
-
PipelineExtractionSchemaObjectSchema = exports_external.record(exports_external.string(), exports_external.unknown()).superRefine((schema, ctx) => refinePipelineExtractionSchema(schema, ctx));
|
|
69624
|
-
PipelineConfigFields = {
|
|
69625
|
-
ocr_model: exports_external.string().min(1).max(128),
|
|
69626
|
-
ocr_options: OcrOptionsRequestSchema.optional(),
|
|
69627
|
-
llm_model: LlmModelSchema,
|
|
69628
|
-
llm_options: LlmOptionsRequestSchema.optional(),
|
|
69629
|
-
schema: PipelineExtractionSchemaObjectSchema,
|
|
69630
|
-
repair_attempts: exports_external.number().int().min(0).max(2).optional(),
|
|
69631
|
-
grounding: ExtractionGroundingModeSchema.optional()
|
|
69632
|
-
};
|
|
69633
|
-
CreateExtractionPipelineRequestSchema = exports_external.object({
|
|
69634
|
-
name: ExtractionPipelineNameSchema,
|
|
69635
|
-
slug: ExtractionPipelineSlugSchema.optional(),
|
|
69636
|
-
...PipelineConfigFields
|
|
69637
|
-
}).strict();
|
|
69638
|
-
UpdateExtractionPipelineRequestSchema = exports_external.object({
|
|
69639
|
-
name: ExtractionPipelineNameSchema.optional(),
|
|
69640
|
-
slug: ExtractionPipelineSlugSchema.nullable().optional(),
|
|
69641
|
-
ocr_model: PipelineConfigFields.ocr_model.optional(),
|
|
69642
|
-
ocr_options: OcrOptionsRequestSchema.nullable().optional(),
|
|
69643
|
-
llm_model: PipelineConfigFields.llm_model.optional(),
|
|
69644
|
-
llm_options: LlmOptionsRequestSchema.nullable().optional(),
|
|
69645
|
-
schema: PipelineExtractionSchemaObjectSchema.optional(),
|
|
69646
|
-
repair_attempts: exports_external.number().int().min(0).max(2).optional(),
|
|
69647
|
-
grounding: ExtractionGroundingModeSchema.optional()
|
|
69648
|
-
}).strict().superRefine((value, ctx) => {
|
|
69649
|
-
if (Object.keys(value).length === 0) {
|
|
69650
|
-
ctx.addIssue({
|
|
69651
|
-
code: "custom",
|
|
69652
|
-
message: "at least one field is required"
|
|
69653
|
-
});
|
|
69654
|
-
}
|
|
69655
|
-
});
|
|
69656
|
-
ExtractionPipelineSchema = exports_external.object({
|
|
69657
|
-
id: ExtractionPipelineIdSchema,
|
|
69658
|
-
name: ExtractionPipelineNameSchema,
|
|
69659
|
-
slug: ExtractionPipelineSlugSchema.nullable(),
|
|
69660
|
-
version: exports_external.number().int().min(1),
|
|
69661
|
-
ocr_model: exports_external.string().min(1).max(128),
|
|
69662
|
-
ocr_options: OcrOptionsEffectiveSchema,
|
|
69663
|
-
llm_model: LlmModelSchema,
|
|
69664
|
-
llm_options: LlmOptionsStoredSchema,
|
|
69665
|
-
schema: PipelineExtractionSchemaObjectSchema,
|
|
69666
|
-
repair_attempts: exports_external.number().int().min(0).max(2),
|
|
69667
|
-
grounding: ExtractionGroundingModeSchema,
|
|
69668
|
-
created_at: exports_external.string().datetime(),
|
|
69669
|
-
updated_at: exports_external.string().datetime()
|
|
69670
|
-
}).strict();
|
|
69671
|
-
ExtractionPipelineListResponseSchema = exports_external.object({
|
|
69672
|
-
items: exports_external.array(ExtractionPipelineSchema)
|
|
69673
|
-
}).strict();
|
|
69674
|
-
DeleteExtractionPipelineResponseSchema = exports_external.object({
|
|
69675
|
-
deleted: exports_external.literal(true),
|
|
69676
|
-
id: ExtractionPipelineIdSchema
|
|
69677
|
-
}).strict();
|
|
69678
|
-
EXTRACT_INLINE_CONFIG_KEYS = [
|
|
69679
|
-
"ocr_model",
|
|
69680
|
-
"ocr_options",
|
|
69681
|
-
"llm_model",
|
|
69682
|
-
"llm_options",
|
|
69683
|
-
"schema",
|
|
69684
|
-
"repair_attempts",
|
|
69685
|
-
"grounding"
|
|
69686
|
-
];
|
|
69687
|
-
LEGACY_OCR_JOB_UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
69688
|
-
JobIdInputSchema = exports_external.string().max(128).transform((value, ctx) => {
|
|
69689
|
-
const normalized = normalizeOcrJobIdInput(value);
|
|
69690
|
-
if (!OCR_JOB_ID_PATTERN.test(normalized)) {
|
|
69691
|
-
ctx.addIssue({
|
|
69692
|
-
code: "custom",
|
|
69693
|
-
message: "job id must be an opj_… id"
|
|
69694
|
-
});
|
|
69695
|
-
return exports_external.NEVER;
|
|
69696
|
-
}
|
|
69697
|
-
return normalized;
|
|
69698
|
-
});
|
|
69699
|
-
ExtractionPipelineIdInputSchema = exports_external.string().max(128).transform((value, ctx) => {
|
|
69700
|
-
const normalized = normalizeOcrPipelineIdInput(value);
|
|
69701
|
-
const parsed = ExtractionPipelineIdSchema.safeParse(normalized);
|
|
69702
|
-
if (!parsed.success) {
|
|
69703
|
-
ctx.addIssue({
|
|
69704
|
-
code: "custom",
|
|
69705
|
-
message: "pipeline_id must be an oppl_… id"
|
|
69706
|
-
});
|
|
69707
|
-
return exports_external.NEVER;
|
|
69708
|
-
}
|
|
69709
|
-
return parsed.data;
|
|
69710
|
-
});
|
|
69711
|
-
OCR_OUTPUT_FORMATS = ["openparser@1", "raw"];
|
|
69712
|
-
OcrOutputFormatSchema = exports_external.enum(OCR_OUTPUT_FORMATS);
|
|
69713
|
-
PaddleRawProfileSchema = exports_external.object({
|
|
69714
|
-
name: exports_external.literal("eigenpal-paddle-layout-v1"),
|
|
69715
|
-
options: exports_external.object({
|
|
69716
|
-
format_block_content: exports_external.literal(true),
|
|
69717
|
-
use_chart_recognition: exports_external.boolean(),
|
|
69718
|
-
use_ocr_for_image_block: exports_external.boolean(),
|
|
69719
|
-
return_markdown_images: exports_external.boolean(),
|
|
69720
|
-
visualize: exports_external.literal(false),
|
|
69721
|
-
image_block_ocr: exports_external.boolean(),
|
|
69722
|
-
chart_recognition: exports_external.boolean(),
|
|
69723
|
-
merge_layout_blocks: exports_external.boolean().optional()
|
|
69724
|
-
}).strict()
|
|
69725
|
-
}).strict();
|
|
69726
|
-
RawParseResultSchema = exports_external.object({
|
|
69727
|
-
output_format: exports_external.literal("raw"),
|
|
69728
|
-
provider: exports_external.literal("paddle"),
|
|
69729
|
-
model: exports_external.literal("paddleocr-vl-1.6"),
|
|
69730
|
-
profile: PaddleRawProfileSchema,
|
|
69731
|
-
result: exports_external.record(exports_external.string(), exports_external.unknown())
|
|
69732
|
-
}).strict();
|
|
69733
|
-
SuggestSchemaHintSchema = exports_external.string().min(1).max(SUGGEST_SCHEMA_HINT_MAX_CHARS);
|
|
69734
|
-
SuggestSchemaRequestSchema = exports_external.object({
|
|
69735
|
-
parse_job_id: JobIdInputSchema,
|
|
69736
|
-
hint: SuggestSchemaHintSchema.optional()
|
|
69737
|
-
}).strict();
|
|
69738
|
-
SuggestSchemaResponseSchema = exports_external.object({
|
|
69739
|
-
name: exports_external.string().min(1).max(200),
|
|
69740
|
-
schema: exports_external.record(exports_external.string(), exports_external.unknown())
|
|
69741
|
-
}).strict();
|
|
69742
|
-
SuggestSchemaPreviewMetaSchema = exports_external.object({
|
|
69743
|
-
max_pages: exports_external.literal(SUGGEST_SCHEMA_PREVIEW_MAX_PAGES),
|
|
69744
|
-
max_chars: exports_external.literal(SUGGEST_SCHEMA_PREVIEW_MAX_CHARS),
|
|
69745
|
-
truncated: exports_external.boolean(),
|
|
69746
|
-
char_count: exports_external.number().int().min(0).max(SUGGEST_SCHEMA_PREVIEW_MAX_CHARS)
|
|
69747
|
-
}).strict();
|
|
69748
|
-
SuggestSchemaTerminalResultSchema = exports_external.object({
|
|
69749
|
-
name: exports_external.string().min(1).max(200),
|
|
69750
|
-
schema: exports_external.record(exports_external.string(), exports_external.unknown()),
|
|
69751
|
-
parse_job_id: JobIdSchema,
|
|
69752
|
-
llm_model: LlmModelSchema,
|
|
69753
|
-
reasoning_effort: OcrLlmReasoningEffortSchema.nullable().optional(),
|
|
69754
|
-
hint: SuggestSchemaHintSchema.optional(),
|
|
69755
|
-
preview: SuggestSchemaPreviewMetaSchema,
|
|
69756
|
-
attempts: exports_external.array(ExtractionAttemptSchema).min(1),
|
|
69757
|
-
usage: ExtractionUsageTotalsSchema.optional()
|
|
69758
|
-
}).strict();
|
|
69759
|
-
OCR_JOB_STATUSES = [
|
|
69760
|
-
"queued",
|
|
69761
|
-
"running",
|
|
69762
|
-
"succeeded",
|
|
69763
|
-
"failed",
|
|
69764
|
-
"indeterminate"
|
|
69765
|
-
];
|
|
69766
|
-
JobStatusSchema = exports_external.enum(OCR_JOB_STATUSES);
|
|
69767
|
-
OCR_JOB_OPERATIONS = [
|
|
69768
|
-
"parse",
|
|
69769
|
-
"extract",
|
|
69770
|
-
"suggest_schema",
|
|
69771
|
-
"parse_batch",
|
|
69772
|
-
"extract_batch"
|
|
69773
|
-
];
|
|
69774
|
-
JobOperationSchema = exports_external.enum(OCR_JOB_OPERATIONS);
|
|
69775
|
-
OCR_JOB_HISTORY_OPERATIONS = [
|
|
69776
|
-
"parse",
|
|
69777
|
-
"extract",
|
|
69778
|
-
"parse_batch",
|
|
69779
|
-
"extract_batch"
|
|
69780
|
-
];
|
|
69781
|
-
JobHistoryOperationSchema = exports_external.enum(OCR_JOB_HISTORY_OPERATIONS);
|
|
69782
|
-
JobFailureSchema = exports_external.object({
|
|
69783
|
-
code: exports_external.string().min(1),
|
|
69784
|
-
message: exports_external.string().min(1),
|
|
69785
|
-
retryable: exports_external.boolean(),
|
|
69786
|
-
details: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
69787
|
-
}).strict();
|
|
69788
|
-
JobAcceptedSchema = exports_external.object({
|
|
69789
|
-
id: JobIdSchema,
|
|
69790
|
-
operation: exports_external.enum(["parse", "extract"]),
|
|
69791
|
-
status: JobStatusSchema,
|
|
69792
|
-
output_format: OcrOutputFormatSchema,
|
|
69793
|
-
created_at: exports_external.string().datetime(),
|
|
69794
|
-
updated_at: exports_external.string().datetime()
|
|
69795
|
-
}).strict();
|
|
69796
|
-
BatchJobAcceptedSchema = exports_external.object({
|
|
69797
|
-
id: JobIdSchema,
|
|
69798
|
-
operation: exports_external.enum(["parse_batch", "extract_batch"]),
|
|
69799
|
-
status: JobStatusSchema,
|
|
69800
|
-
output_format: OcrOutputFormatSchema,
|
|
69801
|
-
created_at: exports_external.string().datetime(),
|
|
69802
|
-
updated_at: exports_external.string().datetime(),
|
|
69803
|
-
child_count: exports_external.number().int().min(1).max(100)
|
|
69804
|
-
}).strict();
|
|
69805
|
-
BatchChildSummarySchema = exports_external.object({
|
|
69806
|
-
client_item_id: exports_external.string().min(1).max(128),
|
|
69807
|
-
job_id: JobIdSchema,
|
|
69808
|
-
file_index: exports_external.number().int().min(0),
|
|
69809
|
-
status: JobStatusSchema,
|
|
69810
|
-
output_format: OcrOutputFormatSchema,
|
|
69811
|
-
error: JobFailureSchema.optional(),
|
|
69812
|
-
result: exports_external.union([ParsedDocumentSchema, RawParseResultSchema, ExtractionTerminalResultSchema]).optional()
|
|
69813
|
-
}).strict();
|
|
69814
|
-
BatchChildPageSchema = exports_external.object({
|
|
69815
|
-
items: exports_external.array(BatchChildSummarySchema),
|
|
69816
|
-
next_cursor: exports_external.string().nullable().optional()
|
|
69817
|
-
}).strict();
|
|
69818
|
-
BatchSummaryCountsSchema = exports_external.object({
|
|
69819
|
-
total: exports_external.number().int().min(0),
|
|
69820
|
-
queued: exports_external.number().int().min(0),
|
|
69821
|
-
running: exports_external.number().int().min(0),
|
|
69822
|
-
succeeded: exports_external.number().int().min(0),
|
|
69823
|
-
failed: exports_external.number().int().min(0),
|
|
69824
|
-
indeterminate: exports_external.number().int().min(0)
|
|
69825
|
-
}).strict();
|
|
69826
|
-
JobProgressSchema = exports_external.object({
|
|
69827
|
-
completed: exports_external.number().int().min(0).optional(),
|
|
69828
|
-
total: exports_external.number().int().min(0).optional()
|
|
69829
|
-
}).strict();
|
|
69830
|
-
RelatedExtractionSummarySchema = exports_external.object({
|
|
69831
|
-
id: JobIdSchema,
|
|
69832
|
-
status: JobStatusSchema,
|
|
69833
|
-
created_at: exports_external.string().datetime(),
|
|
69834
|
-
updated_at: exports_external.string().datetime(),
|
|
69835
|
-
llm_model: exports_external.string().min(1).nullable().optional(),
|
|
69836
|
-
has_result: exports_external.boolean(),
|
|
69837
|
-
url: exports_external.string().min(1)
|
|
69838
|
-
}).strict();
|
|
69839
|
-
JobSchema = exports_external.object({
|
|
69840
|
-
id: JobIdSchema,
|
|
69841
|
-
operation: JobOperationSchema,
|
|
69842
|
-
status: JobStatusSchema,
|
|
69843
|
-
output_format: OcrOutputFormatSchema,
|
|
69844
|
-
created_at: exports_external.string().datetime(),
|
|
69845
|
-
updated_at: exports_external.string().datetime(),
|
|
69846
|
-
progress: JobProgressSchema.optional(),
|
|
69847
|
-
error: JobFailureSchema.optional(),
|
|
69848
|
-
result: exports_external.union([
|
|
69849
|
-
ParsedDocumentSchema,
|
|
69850
|
-
RawParseResultSchema,
|
|
69851
|
-
ExtractionTerminalResultSchema,
|
|
69852
|
-
SuggestSchemaTerminalResultSchema
|
|
69853
|
-
]).optional(),
|
|
69854
|
-
summary: BatchSummaryCountsSchema.optional(),
|
|
69855
|
-
children: BatchChildPageSchema.optional(),
|
|
69856
|
-
has_source: exports_external.boolean().optional(),
|
|
69857
|
-
source_media_type: exports_external.string().min(1).nullable().optional(),
|
|
69858
|
-
source_parse_job_id: JobIdSchema.nullable().optional(),
|
|
69859
|
-
related_extractions: exports_external.array(RelatedExtractionSummarySchema).optional(),
|
|
69860
|
-
extraction_schema: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
69861
|
-
ocr_model: exports_external.string().min(1).nullable().optional(),
|
|
69862
|
-
pipeline_id: ExtractionPipelineIdSchema.nullable(),
|
|
69863
|
-
pipeline_version: exports_external.number().int().min(1).nullable()
|
|
69864
|
-
}).strict();
|
|
69865
|
-
JobSummarySchema = exports_external.object({
|
|
69866
|
-
id: JobIdSchema,
|
|
69867
|
-
operation: JobHistoryOperationSchema,
|
|
69868
|
-
status: JobStatusSchema,
|
|
69869
|
-
output_format: OcrOutputFormatSchema,
|
|
69870
|
-
ocr_model: exports_external.string().min(1).nullable().optional(),
|
|
69871
|
-
llm_model: exports_external.string().min(1).nullable().optional(),
|
|
69872
|
-
page_count: exports_external.number().int().min(0),
|
|
69873
|
-
created_at: exports_external.string().datetime(),
|
|
69874
|
-
updated_at: exports_external.string().datetime(),
|
|
69875
|
-
error: JobFailureSchema.optional(),
|
|
69876
|
-
has_result: exports_external.boolean(),
|
|
69877
|
-
url: exports_external.string().min(1),
|
|
69878
|
-
has_source: exports_external.boolean().optional(),
|
|
69879
|
-
pipeline_id: ExtractionPipelineIdSchema.nullable(),
|
|
69880
|
-
pipeline_version: exports_external.number().int().min(1).nullable()
|
|
69881
|
-
}).strict();
|
|
69882
|
-
JobListResponseSchema = exports_external.object({
|
|
69883
|
-
data: exports_external.array(JobSummarySchema),
|
|
69884
|
-
next_cursor: exports_external.string().nullable()
|
|
69885
|
-
}).strict();
|
|
69886
|
-
JobListQuerySchema = exports_external.object({
|
|
69887
|
-
cursor: exports_external.string().min(1).optional(),
|
|
69888
|
-
limit: exports_external.coerce.number().int().min(1).max(OCR_JOB_LIST_MAX_LIMIT).optional().default(OCR_JOB_LIST_DEFAULT_LIMIT),
|
|
69889
|
-
status: JobStatusSchema.optional(),
|
|
69890
|
-
operation: JobHistoryOperationSchema.optional()
|
|
69891
|
-
}).strict();
|
|
69892
|
-
ErrorBodySchema = exports_external.object({
|
|
69893
|
-
code: exports_external.string().min(1),
|
|
69894
|
-
message: exports_external.string().min(1),
|
|
69895
|
-
request_id: exports_external.string().min(1),
|
|
69896
|
-
retryable: exports_external.boolean(),
|
|
69897
|
-
details: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
69898
|
-
}).strict();
|
|
69899
|
-
ErrorResponseSchema = exports_external.object({
|
|
69900
|
-
error: ErrorBodySchema
|
|
69901
|
-
}).strict();
|
|
69902
|
-
OCR_SYNC_STATUS_CODES = {
|
|
69903
|
-
success: 200,
|
|
69904
|
-
accepted: 202,
|
|
69905
|
-
failed: 422,
|
|
69906
|
-
indeterminate: 504
|
|
69907
|
-
};
|
|
69908
|
-
OCR_MODELS = ["paddleocr-vl-1.6"];
|
|
69909
|
-
OcrModelAvailabilitySchema = exports_external.enum(["available", "degraded", "unavailable"]);
|
|
69910
|
-
OcrModelPricingBasisSchema = exports_external.literal("customer_retail");
|
|
69911
|
-
OcrModelPricingSchema = exports_external.object({
|
|
69912
|
-
usd_per_page: exports_external.number().finite().nonnegative(),
|
|
69913
|
-
basis: OcrModelPricingBasisSchema
|
|
69914
|
-
}).strict();
|
|
69915
|
-
OcrModelCatalogEntrySchema = exports_external.object({
|
|
69916
|
-
id: exports_external.string().min(1).max(128),
|
|
69917
|
-
label: exports_external.string().min(1).max(120),
|
|
69918
|
-
is_default: exports_external.boolean(),
|
|
69919
|
-
capabilities: exports_external.object({
|
|
69920
|
-
parse: exports_external.boolean(),
|
|
69921
|
-
extract_source: exports_external.boolean(),
|
|
69922
|
-
markdown: exports_external.boolean(),
|
|
69923
|
-
regions: exports_external.boolean(),
|
|
69924
|
-
options: OcrModelOptionCapabilitySchema
|
|
69925
|
-
}).strict(),
|
|
69926
|
-
option_defaults: exports_external.object({
|
|
69927
|
-
image_block_ocr: exports_external.boolean(),
|
|
69928
|
-
chart_recognition: exports_external.boolean(),
|
|
69929
|
-
merge_layout_blocks: exports_external.boolean()
|
|
69930
|
-
}).strict(),
|
|
69931
|
-
pricing: OcrModelPricingSchema,
|
|
69932
|
-
availability: OcrModelAvailabilitySchema
|
|
69933
|
-
}).strict();
|
|
69934
|
-
OcrModelsResponseSchema = exports_external.object({ data: exports_external.array(OcrModelCatalogEntrySchema).min(1) }).strict();
|
|
69935
|
-
PADDLE_OPTION_CAPABILITIES = {
|
|
69936
|
-
image_block_ocr: true,
|
|
69937
|
-
chart_recognition: true,
|
|
69938
|
-
merge_layout_blocks: true
|
|
69939
|
-
};
|
|
69940
|
-
OCR_MODEL_CATALOG = [
|
|
69941
|
-
{
|
|
69942
|
-
id: "paddleocr-vl-1.6",
|
|
69943
|
-
label: "PaddleOCR-VL 1.6",
|
|
69944
|
-
is_default: true,
|
|
69945
|
-
capabilities: {
|
|
69946
|
-
parse: true,
|
|
69947
|
-
extract_source: true,
|
|
69948
|
-
markdown: true,
|
|
69949
|
-
regions: true,
|
|
69950
|
-
options: PADDLE_OPTION_CAPABILITIES
|
|
69951
|
-
},
|
|
69952
|
-
option_defaults: { ...PADDLE_OCR_OPTION_DEFAULTS },
|
|
69953
|
-
pricing: {
|
|
69954
|
-
usd_per_page: PADDLE_OCR_USD_PER_PAGE,
|
|
69955
|
-
basis: "customer_retail"
|
|
69956
|
-
},
|
|
69957
|
-
availability: "available"
|
|
69958
|
-
}
|
|
69959
|
-
];
|
|
69960
|
-
OcrModelSchema = exports_external.string().min(1).max(128);
|
|
69961
|
-
OcrFileIdSchema = exports_external.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/, "file_id must be a valid OpenParser file id");
|
|
69962
|
-
RepairAttemptsSchema = exports_external.number().int().min(0).max(2).default(0);
|
|
69963
|
-
ExtractionJsonSchemaObjectSchema = exports_external.record(exports_external.string(), exports_external.unknown());
|
|
69964
|
-
ParseRequestSchema = exports_external.object({
|
|
69965
|
-
ocr_model: OcrModelSchema,
|
|
69966
|
-
ocr_options: OcrOptionsRequestSchema.optional(),
|
|
69967
|
-
file_id: OcrFileIdSchema.optional(),
|
|
69968
|
-
output_format: OcrOutputFormatSchema.default("openparser@1")
|
|
69969
|
-
}).strict();
|
|
69970
|
-
ExtractRequestSchema = exports_external.object({
|
|
69971
|
-
pipeline_id: ExtractionPipelineIdInputSchema.optional(),
|
|
69972
|
-
ocr_model: OcrModelSchema.optional(),
|
|
69973
|
-
ocr_options: OcrOptionsRequestSchema.optional(),
|
|
69974
|
-
llm_model: LlmModelSchema.optional(),
|
|
69975
|
-
llm_options: LlmOptionsRequestSchema.optional(),
|
|
69976
|
-
schema: ExtractionJsonSchemaObjectSchema.optional(),
|
|
69977
|
-
repair_attempts: exports_external.number().int().min(0).max(2).optional(),
|
|
69978
|
-
grounding: ExtractionGroundingModeSchema.optional(),
|
|
69979
|
-
file_id: OcrFileIdSchema.optional(),
|
|
69980
|
-
parse_job_id: JobIdInputSchema.optional(),
|
|
69981
|
-
output_format: OcrOutputFormatSchema.default("openparser@1")
|
|
69982
|
-
}).strict().superRefine((value, ctx) => {
|
|
69983
|
-
if (value.file_id !== undefined && value.parse_job_id !== undefined) {
|
|
69984
|
-
ctx.addIssue({
|
|
69985
|
-
code: "custom",
|
|
69986
|
-
message: "provide exactly one of file_id or parse_job_id",
|
|
69987
|
-
path: ["parse_job_id"]
|
|
69988
|
-
});
|
|
69989
|
-
}
|
|
69990
|
-
if (value.parse_job_id !== undefined) {
|
|
69991
|
-
if (value.ocr_model !== undefined) {
|
|
69992
|
-
ctx.addIssue({
|
|
69993
|
-
code: "custom",
|
|
69994
|
-
message: "ocr_model is not allowed when parse_job_id is set",
|
|
69995
|
-
path: ["ocr_model"]
|
|
69996
|
-
});
|
|
69997
|
-
}
|
|
69998
|
-
if (value.ocr_options !== undefined) {
|
|
69999
|
-
ctx.addIssue({
|
|
70000
|
-
code: "custom",
|
|
70001
|
-
message: "ocr_options is not allowed when parse_job_id is set",
|
|
70002
|
-
path: ["ocr_options"]
|
|
70003
|
-
});
|
|
70004
|
-
}
|
|
70005
|
-
}
|
|
70006
|
-
refineExtractPipelineXor(value, ctx, { requireOcrModel: value.parse_job_id === undefined });
|
|
70007
|
-
}).transform((value) => {
|
|
70008
|
-
const source = {
|
|
70009
|
-
file_id: value.file_id,
|
|
70010
|
-
parse_job_id: value.parse_job_id,
|
|
70011
|
-
output_format: value.output_format
|
|
70012
|
-
};
|
|
70013
|
-
if (value.pipeline_id !== undefined)
|
|
70014
|
-
return { pipeline_id: value.pipeline_id, ...source };
|
|
70015
|
-
return {
|
|
70016
|
-
...value.ocr_model !== undefined ? { ocr_model: value.ocr_model } : {},
|
|
70017
|
-
...value.ocr_options !== undefined ? { ocr_options: value.ocr_options } : {},
|
|
70018
|
-
llm_model: value.llm_model,
|
|
70019
|
-
...value.llm_options !== undefined ? { llm_options: value.llm_options } : {},
|
|
70020
|
-
schema: value.schema,
|
|
70021
|
-
repair_attempts: value.repair_attempts ?? 0,
|
|
70022
|
-
grounding: value.grounding ?? "none",
|
|
70023
|
-
...source
|
|
70024
|
-
};
|
|
70025
|
-
});
|
|
70026
|
-
ParseBatchItemSchema = exports_external.object({
|
|
70027
|
-
client_item_id: exports_external.string().min(1).max(128),
|
|
70028
|
-
file_index: exports_external.number().int().min(0).optional(),
|
|
70029
|
-
file_id: OcrFileIdSchema.optional(),
|
|
70030
|
-
ocr_model: OcrModelSchema,
|
|
70031
|
-
ocr_options: OcrOptionsRequestSchema.optional()
|
|
70032
|
-
}).strict().superRefine(requireExactlyOneSource);
|
|
70033
|
-
ExtractBatchItemSchema = exports_external.object({
|
|
70034
|
-
client_item_id: exports_external.string().min(1).max(128),
|
|
70035
|
-
file_index: exports_external.number().int().min(0).optional(),
|
|
70036
|
-
file_id: OcrFileIdSchema.optional(),
|
|
70037
|
-
pipeline_id: ExtractionPipelineIdInputSchema.optional(),
|
|
70038
|
-
ocr_model: OcrModelSchema.optional(),
|
|
70039
|
-
ocr_options: OcrOptionsRequestSchema.optional(),
|
|
70040
|
-
llm_model: LlmModelSchema.optional(),
|
|
70041
|
-
llm_options: LlmOptionsRequestSchema.optional(),
|
|
70042
|
-
schema: ExtractionJsonSchemaObjectSchema.optional(),
|
|
70043
|
-
repair_attempts: exports_external.number().int().min(0).max(2).optional(),
|
|
70044
|
-
grounding: ExtractionGroundingModeSchema.optional()
|
|
70045
|
-
}).strict().superRefine((value, ctx) => {
|
|
70046
|
-
requireExactlyOneSource(value, ctx);
|
|
70047
|
-
refineExtractPipelineXor(value, ctx);
|
|
70048
|
-
}).transform((value) => {
|
|
70049
|
-
const base = {
|
|
70050
|
-
client_item_id: value.client_item_id,
|
|
70051
|
-
file_index: value.file_index,
|
|
70052
|
-
file_id: value.file_id
|
|
70053
|
-
};
|
|
70054
|
-
if (value.pipeline_id !== undefined) {
|
|
70055
|
-
return { ...base, pipeline_id: value.pipeline_id };
|
|
70056
|
-
}
|
|
70057
|
-
return {
|
|
70058
|
-
...base,
|
|
70059
|
-
ocr_model: value.ocr_model,
|
|
70060
|
-
...value.ocr_options !== undefined ? { ocr_options: value.ocr_options } : {},
|
|
70061
|
-
llm_model: value.llm_model,
|
|
70062
|
-
...value.llm_options !== undefined ? { llm_options: value.llm_options } : {},
|
|
70063
|
-
schema: value.schema,
|
|
70064
|
-
repair_attempts: value.repair_attempts ?? 0,
|
|
70065
|
-
grounding: value.grounding ?? "none"
|
|
70066
|
-
};
|
|
70067
|
-
});
|
|
70068
|
-
ParseBatchRequestSchema = exports_external.object({
|
|
70069
|
-
items: exports_external.array(ParseBatchItemSchema).min(1).max(100),
|
|
70070
|
-
output_format: OcrOutputFormatSchema.default("openparser@1")
|
|
70071
|
-
}).strict();
|
|
70072
|
-
ExtractBatchRequestSchema = exports_external.object({
|
|
70073
|
-
items: exports_external.array(ExtractBatchItemSchema).min(1).max(100),
|
|
70074
|
-
output_format: OcrOutputFormatSchema.default("openparser@1")
|
|
70075
|
-
}).strict();
|
|
70076
|
-
PublicFileSchema = exports_external.object({
|
|
70077
|
-
id: exports_external.string(),
|
|
70078
|
-
filename: exports_external.string(),
|
|
70079
|
-
contentType: exports_external.string().nullable(),
|
|
70080
|
-
size: exports_external.number().int().min(0).nullable(),
|
|
70081
|
-
purpose: exports_external.null(),
|
|
70082
|
-
createdAt: exports_external.string().datetime()
|
|
70083
|
-
}).strict();
|
|
70084
|
-
DeleteFileResponseSchema = exports_external.object({ deleted: exports_external.literal(true) }).strict();
|
|
70085
|
-
OpenParserParseResultSchema = exports_external.union([ParsedDocumentSchema, RawParseResultSchema]);
|
|
70086
|
-
OPENPARSER_COMPONENT_SCHEMAS = {
|
|
70087
|
-
PublicFile: PublicFileSchema,
|
|
70088
|
-
JobId: JobIdSchema,
|
|
70089
|
-
OcrModel: OcrModelSchema,
|
|
70090
|
-
LlmModel: LlmModelSchema,
|
|
70091
|
-
RepairAttempts: RepairAttemptsSchema,
|
|
70092
|
-
JsonSchemaObject: ExtractionJsonSchemaObjectSchema,
|
|
70093
|
-
FileId: OcrFileIdSchema,
|
|
70094
|
-
ParseRequest: ParseRequestSchema,
|
|
70095
|
-
ExtractRequest: ExtractRequestSchema,
|
|
70096
|
-
SuggestSchemaRequest: SuggestSchemaRequestSchema,
|
|
70097
|
-
CreateExtractionPipelineRequest: CreateExtractionPipelineRequestSchema,
|
|
70098
|
-
UpdateExtractionPipelineRequest: UpdateExtractionPipelineRequestSchema,
|
|
70099
|
-
ExtractionPipeline: ExtractionPipelineSchema,
|
|
70100
|
-
ExtractionPipelineListResponse: ExtractionPipelineListResponseSchema,
|
|
70101
|
-
DeleteExtractionPipelineResponse: DeleteExtractionPipelineResponseSchema,
|
|
70102
|
-
ExtractionPipelineId: ExtractionPipelineIdSchema,
|
|
70103
|
-
ParseBatchItem: ParseBatchItemSchema,
|
|
70104
|
-
ExtractBatchItem: ExtractBatchItemSchema,
|
|
70105
|
-
ParseBatchRequest: ParseBatchRequestSchema,
|
|
70106
|
-
ExtractBatchRequest: ExtractBatchRequestSchema,
|
|
70107
|
-
OcrOutputFormat: OcrOutputFormatSchema,
|
|
70108
|
-
PaddleRawProfile: PaddleRawProfileSchema,
|
|
70109
|
-
RawParseResult: RawParseResultSchema,
|
|
70110
|
-
ParseResult: OpenParserParseResultSchema,
|
|
70111
|
-
JobStatus: JobStatusSchema,
|
|
70112
|
-
JobOperation: JobHistoryOperationSchema,
|
|
70113
|
-
JobAccepted: JobAcceptedSchema,
|
|
70114
|
-
BatchJobAccepted: BatchJobAcceptedSchema,
|
|
70115
|
-
BoundingBox: BoundingBoxSchema,
|
|
70116
|
-
PageBlock: PageBlockSchema,
|
|
70117
|
-
RegionType: RegionTypeSchema,
|
|
70118
|
-
Region: RegionSchema,
|
|
70119
|
-
ContentKind: ContentKindSchema,
|
|
70120
|
-
RegionContent: RegionContentSchema,
|
|
70121
|
-
ChunkProvenanceSpan: ChunkProvenanceSpanSchema,
|
|
70122
|
-
ExtractionChunk: ExtractionChunkSchema,
|
|
70123
|
-
ParsedDocument: ParsedDocumentSchema,
|
|
70124
|
-
ExtractionAttemptKind: ExtractionAttemptKindSchema,
|
|
70125
|
-
ExtractionAttemptStatus: ExtractionAttemptStatusSchema,
|
|
70126
|
-
ExtractionAttempt: ExtractionAttemptSchema,
|
|
70127
|
-
ExtractionUsageTotals: ExtractionUsageTotalsSchema,
|
|
70128
|
-
ExtractionGroundingMode: ExtractionGroundingModeSchema,
|
|
70129
|
-
ExtractionCitationGranularity: ExtractionCitationGranularitySchema,
|
|
70130
|
-
ExtractionCitation: ExtractionCitationSchema,
|
|
70131
|
-
ExtractionGroundingField: ExtractionGroundingFieldSchema,
|
|
70132
|
-
ExtractionGroundingResult: ExtractionGroundingResultSchema,
|
|
70133
|
-
ExtractionTerminalResult: ExtractionTerminalResultSchema,
|
|
70134
|
-
SuggestSchemaResponse: SuggestSchemaResponseSchema,
|
|
70135
|
-
JobFailure: JobFailureSchema,
|
|
70136
|
-
BatchChildSummary: BatchChildSummarySchema,
|
|
70137
|
-
BatchChildPage: BatchChildPageSchema,
|
|
70138
|
-
BatchSummaryCounts: BatchSummaryCountsSchema,
|
|
70139
|
-
Job: JobSchema.extend({
|
|
70140
|
-
operation: JobHistoryOperationSchema,
|
|
70141
|
-
result: exports_external.union([ParsedDocumentSchema, RawParseResultSchema, ExtractionTerminalResultSchema]).optional()
|
|
70142
|
-
}),
|
|
70143
|
-
JobSummary: JobSummarySchema,
|
|
70144
|
-
JobListResponse: JobListResponseSchema,
|
|
70145
|
-
ErrorBody: ErrorBodySchema,
|
|
70146
|
-
ErrorResponse: ErrorResponseSchema,
|
|
70147
|
-
DeleteFileResponse: DeleteFileResponseSchema,
|
|
70148
|
-
OcrModelCatalogEntry: OcrModelCatalogEntrySchema,
|
|
70149
|
-
OcrModelsResponse: OcrModelsResponseSchema,
|
|
70150
|
-
OcrLlmModelCatalogEntry: OcrLlmModelCatalogEntrySchema,
|
|
70151
|
-
OcrLlmModelsResponse: OcrLlmModelsResponseSchema
|
|
70152
|
-
};
|
|
70153
|
-
admissionErrors = {
|
|
70154
|
-
400: { component: "MalformedRequest" },
|
|
70155
|
-
401: { component: "Unauthorized" },
|
|
70156
|
-
402: { component: "InsufficientCredits" },
|
|
70157
|
-
403: { component: "Forbidden" },
|
|
70158
|
-
409: { component: "IdempotencyConflict" },
|
|
70159
|
-
413: { component: "LimitExceeded" },
|
|
70160
|
-
415: { component: "UnsupportedMediaType" },
|
|
70161
|
-
429: { component: "RateLimited" },
|
|
70162
|
-
503: { component: "ServiceUnavailable" }
|
|
70163
|
-
};
|
|
70164
|
-
OPENPARSER_ROUTE_MANIFEST = [
|
|
70165
|
-
{
|
|
70166
|
-
operationId: "listOcrModels",
|
|
70167
|
-
method: "get",
|
|
70168
|
-
path: "/models/ocr",
|
|
70169
|
-
tag: "models",
|
|
70170
|
-
responses: {
|
|
70171
|
-
200: { schema: "OcrModelsResponse" },
|
|
70172
|
-
401: { component: "Unauthorized" },
|
|
70173
|
-
403: { component: "Forbidden" },
|
|
70174
|
-
429: { component: "RateLimited" }
|
|
70175
|
-
}
|
|
70176
|
-
},
|
|
70177
|
-
{
|
|
70178
|
-
operationId: "listLlmModels",
|
|
70179
|
-
method: "get",
|
|
70180
|
-
path: "/models/llm",
|
|
70181
|
-
tag: "models",
|
|
70182
|
-
parameters: ["LlmModelsMode", "LlmModelsQuery", "LlmModelsPage", "LlmModelsLimit"],
|
|
70183
|
-
responses: {
|
|
70184
|
-
200: { schema: "OcrLlmModelsResponse" },
|
|
70185
|
-
401: { component: "Unauthorized" },
|
|
70186
|
-
403: { component: "Forbidden" },
|
|
70187
|
-
429: { component: "RateLimited" }
|
|
70188
|
-
}
|
|
70189
|
-
},
|
|
70190
|
-
{
|
|
70191
|
-
operationId: "parseSync",
|
|
70192
|
-
method: "post",
|
|
70193
|
-
path: "/parse",
|
|
70194
|
-
tag: "parse",
|
|
70195
|
-
requestBody: "ParseSingleUpload",
|
|
70196
|
-
parameters: ["IdempotencyKey"],
|
|
70197
|
-
responses: {
|
|
70198
|
-
200: { schema: "ParseResult" },
|
|
70199
|
-
202: { component: "JobAccepted" },
|
|
70200
|
-
...admissionErrors,
|
|
70201
|
-
422: { component: "UnprocessableOrSyncFailed" },
|
|
70202
|
-
504: { component: "SyncTerminalIndeterminate" }
|
|
70203
|
-
}
|
|
70204
|
-
},
|
|
70205
|
-
{
|
|
70206
|
-
operationId: "parseAsync",
|
|
70207
|
-
method: "post",
|
|
70208
|
-
path: "/parse/async",
|
|
70209
|
-
tag: "parse",
|
|
70210
|
-
requestBody: "ParseSingleUpload",
|
|
70211
|
-
parameters: ["IdempotencyKey"],
|
|
70212
|
-
responses: {
|
|
70213
|
-
202: { component: "JobAccepted" },
|
|
70214
|
-
...admissionErrors,
|
|
70215
|
-
422: { component: "UnprocessableConfig" }
|
|
70216
|
-
}
|
|
70217
|
-
},
|
|
70218
|
-
{
|
|
70219
|
-
operationId: "parseBatch",
|
|
70220
|
-
method: "post",
|
|
70221
|
-
path: "/parse/batch",
|
|
70222
|
-
tag: "parse",
|
|
70223
|
-
requestBody: "ParseBatchUpload",
|
|
70224
|
-
parameters: ["IdempotencyKey"],
|
|
70225
|
-
responses: {
|
|
70226
|
-
202: { component: "BatchJobAccepted" },
|
|
70227
|
-
...admissionErrors,
|
|
70228
|
-
422: { component: "UnprocessableConfig" }
|
|
70229
|
-
}
|
|
70230
|
-
},
|
|
70231
|
-
{
|
|
70232
|
-
operationId: "extractSync",
|
|
70233
|
-
method: "post",
|
|
70234
|
-
path: "/extract",
|
|
70235
|
-
tag: "extract",
|
|
70236
|
-
requestBody: "ExtractSingleUpload",
|
|
70237
|
-
parameters: ["IdempotencyKey"],
|
|
70238
|
-
responses: {
|
|
70239
|
-
200: { schema: "ExtractionTerminalResult" },
|
|
70240
|
-
202: { component: "JobAccepted" },
|
|
70241
|
-
...admissionErrors,
|
|
70242
|
-
422: { component: "UnprocessableOrSyncFailed" },
|
|
70243
|
-
504: { component: "SyncTerminalIndeterminate" }
|
|
70244
|
-
}
|
|
70245
|
-
},
|
|
70246
|
-
{
|
|
70247
|
-
operationId: "extractAsync",
|
|
70248
|
-
method: "post",
|
|
70249
|
-
path: "/extract/async",
|
|
70250
|
-
tag: "extract",
|
|
70251
|
-
requestBody: "ExtractSingleUpload",
|
|
70252
|
-
parameters: ["IdempotencyKey"],
|
|
70253
|
-
responses: {
|
|
70254
|
-
202: { component: "JobAccepted" },
|
|
70255
|
-
...admissionErrors,
|
|
70256
|
-
422: { component: "UnprocessableConfig" }
|
|
70257
|
-
}
|
|
70258
|
-
},
|
|
70259
|
-
{
|
|
70260
|
-
operationId: "extractBatch",
|
|
70261
|
-
method: "post",
|
|
70262
|
-
path: "/extract/batch",
|
|
70263
|
-
tag: "extract",
|
|
70264
|
-
requestBody: "ExtractBatchUpload",
|
|
70265
|
-
parameters: ["IdempotencyKey"],
|
|
70266
|
-
responses: {
|
|
70267
|
-
202: { component: "BatchJobAccepted" },
|
|
70268
|
-
...admissionErrors,
|
|
70269
|
-
422: { component: "UnprocessableConfig" }
|
|
70270
|
-
}
|
|
70271
|
-
},
|
|
70272
|
-
{
|
|
70273
|
-
operationId: "suggestSchema",
|
|
70274
|
-
method: "post",
|
|
70275
|
-
path: "/suggest-schema",
|
|
70276
|
-
tag: "extract",
|
|
70277
|
-
requestBody: "SuggestSchemaRequest",
|
|
70278
|
-
responses: {
|
|
70279
|
-
200: { schema: "SuggestSchemaResponse" },
|
|
70280
|
-
400: { component: "MalformedRequest" },
|
|
70281
|
-
401: { component: "Unauthorized" },
|
|
70282
|
-
403: { component: "Forbidden" },
|
|
70283
|
-
404: { component: "JobNotFound" },
|
|
70284
|
-
422: { component: "UnprocessableOrSyncFailed" },
|
|
70285
|
-
429: { component: "RateLimited" },
|
|
70286
|
-
503: { component: "ServiceUnavailable" },
|
|
70287
|
-
504: { component: "SyncTerminalIndeterminate" }
|
|
70288
|
-
}
|
|
70289
|
-
},
|
|
70290
|
-
{
|
|
70291
|
-
operationId: "listJobs",
|
|
70292
|
-
method: "get",
|
|
70293
|
-
path: "/jobs",
|
|
70294
|
-
tag: "jobs",
|
|
70295
|
-
parameters: ["JobListCursor", "JobListLimit", "JobListStatus", "JobListOperation"],
|
|
70296
|
-
responses: {
|
|
70297
|
-
200: { schema: "JobListResponse" },
|
|
70298
|
-
400: { component: "MalformedRequest" },
|
|
70299
|
-
401: { component: "Unauthorized" },
|
|
70300
|
-
403: { component: "Forbidden" },
|
|
70301
|
-
429: { component: "RateLimited" }
|
|
70302
|
-
}
|
|
70303
|
-
},
|
|
70304
|
-
{
|
|
70305
|
-
operationId: "getJob",
|
|
70306
|
-
method: "get",
|
|
70307
|
-
path: "/jobs/{id}",
|
|
70308
|
-
tag: "jobs",
|
|
70309
|
-
parameters: ["JobId", "ChildCursor", "ChildLimit"],
|
|
70310
|
-
responses: {
|
|
70311
|
-
200: { schema: "Job" },
|
|
70312
|
-
401: { component: "Unauthorized" },
|
|
70313
|
-
403: { component: "Forbidden" },
|
|
70314
|
-
404: { component: "JobNotFound" },
|
|
70315
|
-
429: { component: "RateLimited" }
|
|
70316
|
-
}
|
|
70317
|
-
},
|
|
70318
|
-
{
|
|
70319
|
-
operationId: "getJobResult",
|
|
70320
|
-
method: "get",
|
|
70321
|
-
path: "/jobs/{id}/result",
|
|
70322
|
-
tag: "jobs",
|
|
70323
|
-
parameters: ["JobId", "ParseResultFormat"],
|
|
70324
|
-
responses: {
|
|
70325
|
-
200: { schema: "ParseResult" },
|
|
70326
|
-
400: { component: "MalformedRequest" },
|
|
70327
|
-
401: { component: "Unauthorized" },
|
|
70328
|
-
403: { component: "Forbidden" },
|
|
70329
|
-
404: { component: "JobNotFound" },
|
|
70330
|
-
409: { component: "JobNotTerminal" },
|
|
70331
|
-
422: { component: "ParseResultUnavailable" },
|
|
70332
|
-
429: { component: "RateLimited" },
|
|
70333
|
-
504: { component: "SyncTerminalIndeterminate" }
|
|
70334
|
-
}
|
|
70335
|
-
},
|
|
70336
|
-
{
|
|
70337
|
-
operationId: "getJobSource",
|
|
70338
|
-
method: "get",
|
|
70339
|
-
path: "/jobs/{id}/source",
|
|
70340
|
-
tag: "jobs",
|
|
70341
|
-
parameters: ["JobId"],
|
|
70342
|
-
responses: {
|
|
70343
|
-
200: { binary: true },
|
|
70344
|
-
206: { component: "PartialContent" },
|
|
70345
|
-
401: { component: "Unauthorized" },
|
|
70346
|
-
403: { component: "Forbidden" },
|
|
70347
|
-
404: { component: "JobSourceUnavailable" },
|
|
70348
|
-
416: { component: "RangeNotSatisfiable" },
|
|
70349
|
-
429: { component: "RateLimited" }
|
|
70350
|
-
}
|
|
70351
|
-
},
|
|
70352
|
-
{
|
|
70353
|
-
operationId: "createFile",
|
|
70354
|
-
method: "post",
|
|
70355
|
-
path: "/files",
|
|
70356
|
-
tag: "files",
|
|
70357
|
-
requestBody: "CreateFileUpload",
|
|
70358
|
-
responses: {
|
|
70359
|
-
200: { schema: "PublicFile" },
|
|
70360
|
-
400: { component: "MalformedRequest" },
|
|
70361
|
-
401: { component: "Unauthorized" },
|
|
70362
|
-
403: { component: "Forbidden" },
|
|
70363
|
-
413: { component: "LimitExceeded" },
|
|
70364
|
-
415: { component: "UnsupportedMediaType" },
|
|
70365
|
-
429: { component: "RateLimited" }
|
|
70366
|
-
}
|
|
70367
|
-
},
|
|
70368
|
-
{
|
|
70369
|
-
operationId: "getFile",
|
|
70370
|
-
method: "get",
|
|
70371
|
-
path: "/files/{id}",
|
|
70372
|
-
tag: "files",
|
|
70373
|
-
parameters: ["FileId"],
|
|
70374
|
-
responses: {
|
|
70375
|
-
200: { schema: "PublicFile" },
|
|
70376
|
-
401: { component: "Unauthorized" },
|
|
70377
|
-
403: { component: "Forbidden" },
|
|
70378
|
-
404: { component: "FileNotFound" },
|
|
70379
|
-
429: { component: "RateLimited" }
|
|
70380
|
-
}
|
|
70381
|
-
},
|
|
70382
|
-
{
|
|
70383
|
-
operationId: "deleteFile",
|
|
70384
|
-
method: "delete",
|
|
70385
|
-
path: "/files/{id}",
|
|
70386
|
-
tag: "files",
|
|
70387
|
-
parameters: ["FileId"],
|
|
70388
|
-
responses: {
|
|
70389
|
-
200: { schema: "DeleteFileResponse" },
|
|
70390
|
-
401: { component: "Unauthorized" },
|
|
70391
|
-
403: { component: "Forbidden" },
|
|
70392
|
-
404: { component: "FileNotFound" },
|
|
70393
|
-
429: { component: "RateLimited" }
|
|
70394
|
-
}
|
|
70395
|
-
},
|
|
70396
|
-
{
|
|
70397
|
-
operationId: "getFileContent",
|
|
70398
|
-
method: "get",
|
|
70399
|
-
path: "/files/{id}/content",
|
|
70400
|
-
tag: "files",
|
|
70401
|
-
parameters: ["FileId"],
|
|
70402
|
-
responses: {
|
|
70403
|
-
200: { binary: true },
|
|
70404
|
-
401: { component: "Unauthorized" },
|
|
70405
|
-
403: { component: "Forbidden" },
|
|
70406
|
-
404: { component: "FileNotFound" },
|
|
70407
|
-
429: { component: "RateLimited" }
|
|
70408
|
-
}
|
|
70409
|
-
},
|
|
70410
|
-
{
|
|
70411
|
-
operationId: "createExtractionPipeline",
|
|
70412
|
-
method: "post",
|
|
70413
|
-
path: "/pipelines",
|
|
70414
|
-
tag: "pipelines",
|
|
70415
|
-
requestBody: "CreateExtractionPipelineRequest",
|
|
70416
|
-
responses: {
|
|
70417
|
-
200: { schema: "ExtractionPipeline" },
|
|
70418
|
-
400: { component: "MalformedRequest" },
|
|
70419
|
-
401: { component: "Unauthorized" },
|
|
70420
|
-
403: { component: "Forbidden" },
|
|
70421
|
-
409: { component: "PipelineNameConflict" },
|
|
70422
|
-
422: { component: "UnprocessableConfig" },
|
|
70423
|
-
429: { component: "RateLimited" }
|
|
70424
|
-
}
|
|
70425
|
-
},
|
|
70426
|
-
{
|
|
70427
|
-
operationId: "listExtractionPipelines",
|
|
70428
|
-
method: "get",
|
|
70429
|
-
path: "/pipelines",
|
|
70430
|
-
tag: "pipelines",
|
|
70431
|
-
responses: {
|
|
70432
|
-
200: { schema: "ExtractionPipelineListResponse" },
|
|
70433
|
-
401: { component: "Unauthorized" },
|
|
70434
|
-
403: { component: "Forbidden" },
|
|
70435
|
-
429: { component: "RateLimited" }
|
|
70436
|
-
}
|
|
70437
|
-
},
|
|
70438
|
-
{
|
|
70439
|
-
operationId: "getExtractionPipeline",
|
|
70440
|
-
method: "get",
|
|
70441
|
-
path: "/pipelines/{id}",
|
|
70442
|
-
tag: "pipelines",
|
|
70443
|
-
parameters: ["PipelineId"],
|
|
70444
|
-
responses: {
|
|
70445
|
-
200: { schema: "ExtractionPipeline" },
|
|
70446
|
-
401: { component: "Unauthorized" },
|
|
70447
|
-
403: { component: "Forbidden" },
|
|
70448
|
-
404: { component: "PipelineNotFound" },
|
|
70449
|
-
429: { component: "RateLimited" }
|
|
70450
|
-
}
|
|
70451
|
-
},
|
|
70452
|
-
{
|
|
70453
|
-
operationId: "updateExtractionPipeline",
|
|
70454
|
-
method: "patch",
|
|
70455
|
-
path: "/pipelines/{id}",
|
|
70456
|
-
tag: "pipelines",
|
|
70457
|
-
parameters: ["PipelineId"],
|
|
70458
|
-
requestBody: "UpdateExtractionPipelineRequest",
|
|
70459
|
-
responses: {
|
|
70460
|
-
200: { schema: "ExtractionPipeline" },
|
|
70461
|
-
400: { component: "MalformedRequest" },
|
|
70462
|
-
401: { component: "Unauthorized" },
|
|
70463
|
-
403: { component: "Forbidden" },
|
|
70464
|
-
404: { component: "PipelineNotFound" },
|
|
70465
|
-
409: { component: "PipelineNameConflict" },
|
|
70466
|
-
422: { component: "UnprocessableConfig" },
|
|
70467
|
-
429: { component: "RateLimited" }
|
|
70468
|
-
}
|
|
70469
|
-
},
|
|
70470
|
-
{
|
|
70471
|
-
operationId: "deleteExtractionPipeline",
|
|
70472
|
-
method: "delete",
|
|
70473
|
-
path: "/pipelines/{id}",
|
|
70474
|
-
tag: "pipelines",
|
|
70475
|
-
parameters: ["PipelineId"],
|
|
70476
|
-
responses: {
|
|
70477
|
-
200: { schema: "DeleteExtractionPipelineResponse" },
|
|
70478
|
-
401: { component: "Unauthorized" },
|
|
70479
|
-
403: { component: "Forbidden" },
|
|
70480
|
-
404: { component: "PipelineNotFound" },
|
|
70481
|
-
429: { component: "RateLimited" }
|
|
70482
|
-
}
|
|
70483
|
-
}
|
|
70484
|
-
];
|
|
70485
|
-
});
|
|
70486
|
-
|
|
70487
|
-
// ../types/src/private/ocr-figure-assets.ts
|
|
70488
|
-
var OcrFigureAssetsModeSchema;
|
|
70489
|
-
var init_ocr_figure_assets = __esm(() => {
|
|
70490
|
-
init_zod();
|
|
70491
|
-
OcrFigureAssetsModeSchema = exports_external.enum(["none", "stored"]);
|
|
70492
|
-
});
|
|
70493
|
-
|
|
70494
|
-
// ../types/src/private/ocr-id-lookup.ts
|
|
70495
|
-
function legacyUuidFromMigratedOcrJobId(jobId) {
|
|
70496
|
-
const match = /^opj_([0-9a-f]{32})$/.exec(jobId);
|
|
70497
|
-
if (!match)
|
|
70498
|
-
return null;
|
|
70499
|
-
const hex3 = match[1];
|
|
70500
|
-
return `${hex3.slice(0, 8)}-${hex3.slice(8, 12)}-${hex3.slice(12, 16)}-${hex3.slice(16, 20)}-${hex3.slice(20)}`;
|
|
70501
|
-
}
|
|
70502
|
-
function ocrJobIdLookupCandidates(id) {
|
|
70503
|
-
const trimmed = id.trim();
|
|
70504
|
-
const canonical = normalizeOcrJobIdInput(trimmed);
|
|
70505
|
-
const out = new Set;
|
|
70506
|
-
if (trimmed.length > 0)
|
|
70507
|
-
out.add(trimmed);
|
|
70508
|
-
if (canonical.length > 0)
|
|
70509
|
-
out.add(canonical);
|
|
70510
|
-
const legacy = legacyUuidFromMigratedOcrJobId(canonical);
|
|
70511
|
-
if (legacy)
|
|
70512
|
-
out.add(legacy);
|
|
70513
|
-
return [...out];
|
|
70514
|
-
}
|
|
70515
|
-
function legacyOepFromMigratedOcrPipelineId(pipelineId) {
|
|
70516
|
-
if (!pipelineId.startsWith("oppl_"))
|
|
70517
|
-
return null;
|
|
70518
|
-
return `${LEGACY_OCR_PIPELINE_ID_PREFIX}${pipelineId.slice("oppl_".length)}`;
|
|
70519
|
-
}
|
|
70520
|
-
function ocrPipelineIdLookupCandidates(id) {
|
|
70521
|
-
const trimmed = id.trim();
|
|
70522
|
-
const canonical = normalizeOcrPipelineIdInput(trimmed);
|
|
70523
|
-
const out = new Set;
|
|
70524
|
-
if (trimmed.length > 0)
|
|
70525
|
-
out.add(trimmed);
|
|
70526
|
-
if (canonical.length > 0)
|
|
70527
|
-
out.add(canonical);
|
|
70528
|
-
const legacy = legacyOepFromMigratedOcrPipelineId(canonical);
|
|
70529
|
-
if (legacy)
|
|
70530
|
-
out.add(legacy);
|
|
70531
|
-
return [...out];
|
|
70532
|
-
}
|
|
70533
|
-
var init_ocr_id_lookup = __esm(() => {
|
|
70534
|
-
init_dist();
|
|
70535
|
-
});
|
|
70536
|
-
|
|
70537
|
-
// ../types/src/private/ocr-llm.ts
|
|
70538
|
-
function getDefaultOcrLlmModelId() {
|
|
70539
|
-
const defaults = OCR_LLM_EMERGENCY_CATALOG.filter((entry) => entry.is_default);
|
|
70540
|
-
if (defaults.length !== 1) {
|
|
70541
|
-
throw new Error("OCR_LLM_EMERGENCY_CATALOG must declare exactly one default model");
|
|
70542
|
-
}
|
|
70543
|
-
return defaults[0].id;
|
|
70544
|
-
}
|
|
70545
|
-
function toCustomerRetailCatalogEntry(entry, markup = OCR_LLM_RETAIL_MARKUP) {
|
|
70546
|
-
if (entry.pricing.basis === "customer_retail") {
|
|
70547
|
-
return entry;
|
|
70548
|
-
}
|
|
70549
|
-
if (!Number.isFinite(markup) || markup <= 0) {
|
|
70550
|
-
throw new Error("OCR retail markup must be a positive finite number");
|
|
70551
|
-
}
|
|
70552
|
-
return {
|
|
70553
|
-
...entry,
|
|
70554
|
-
pricing: {
|
|
70555
|
-
prompt_usd_per_1m: entry.pricing.prompt_usd_per_1m * markup,
|
|
70556
|
-
completion_usd_per_1m: entry.pricing.completion_usd_per_1m * markup,
|
|
70557
|
-
basis: "customer_retail"
|
|
70558
|
-
}
|
|
70559
|
-
};
|
|
70560
|
-
}
|
|
70561
|
-
function toOcrLlmRequestSnapshot(input) {
|
|
70562
|
-
if (input.entry.pricing.basis !== "provider_list") {
|
|
70563
|
-
throw new Error("OCR LLM request snapshot requires provider_list pricing (refuse retail rates to avoid double markup)");
|
|
70564
|
-
}
|
|
70565
|
-
return {
|
|
70566
|
-
catalog_version: input.catalogVersion,
|
|
70567
|
-
model_id: input.entry.id,
|
|
70568
|
-
pricing: {
|
|
70569
|
-
prompt_usd_per_token: input.entry.pricing.prompt_usd_per_1m / 1e6,
|
|
70570
|
-
completion_usd_per_token: input.entry.pricing.completion_usd_per_1m / 1e6,
|
|
70571
|
-
source: "openrouter_provider_list"
|
|
70572
|
-
},
|
|
70573
|
-
reasoning_effort_requested: input.reasoningEffortRequested,
|
|
70574
|
-
reasoning_effort_resolved: input.reasoningEffortResolved
|
|
70575
|
-
};
|
|
70576
|
-
}
|
|
70577
|
-
var SUGGEST_SCHEMA_LLM_MODEL = "anthropic/claude-haiku-4.5", OcrLlmProviderListPricingBasisSchema, OcrLlmPricingBasisSchema, OCR_LLM_RETAIL_MARKUP = 2, OcrLlmProviderListPricingSchema, OcrLlmProviderCatalogEntrySchema, OcrLlmRequestSnapshotSchema, OCR_LLM_EMERGENCY_CATALOG, OCR_LLM_CATALOG, OCR_LLM_MODEL_IDS, OCR_LLM_CERTIFIED_MODEL_IDS, OCR_LLM_SUGGESTED_PROVIDERS, OCR_LLM_SUGGESTED_MAX_AGE_DAYS = 90;
|
|
70578
|
-
var init_ocr_llm = __esm(() => {
|
|
70579
|
-
init_dist();
|
|
70580
|
-
init_zod();
|
|
70581
|
-
OcrLlmProviderListPricingBasisSchema = exports_external.literal("provider_list");
|
|
70582
|
-
OcrLlmPricingBasisSchema = exports_external.enum(["customer_retail", "provider_list"]);
|
|
70583
|
-
OcrLlmProviderListPricingSchema = exports_external.object({
|
|
70584
|
-
prompt_usd_per_1m: exports_external.number().finite().nonnegative(),
|
|
70585
|
-
completion_usd_per_1m: exports_external.number().finite().nonnegative(),
|
|
70586
|
-
basis: OcrLlmProviderListPricingBasisSchema
|
|
70587
|
-
}).strict();
|
|
70588
|
-
OcrLlmProviderCatalogEntrySchema = OcrLlmModelCatalogEntrySchema.omit({
|
|
70589
|
-
pricing: true
|
|
70590
|
-
}).extend({
|
|
70591
|
-
pricing: OcrLlmProviderListPricingSchema
|
|
70592
|
-
});
|
|
70593
|
-
OcrLlmRequestSnapshotSchema = exports_external.object({
|
|
70594
|
-
catalog_version: exports_external.string().min(1),
|
|
70595
|
-
model_id: exports_external.string().min(1).max(200),
|
|
70596
|
-
pricing: exports_external.object({
|
|
70597
|
-
prompt_usd_per_token: exports_external.number().finite().nonnegative(),
|
|
70598
|
-
completion_usd_per_token: exports_external.number().finite().nonnegative(),
|
|
70599
|
-
source: exports_external.literal("openrouter_provider_list")
|
|
70600
|
-
}).strict(),
|
|
70601
|
-
reasoning_effort_requested: OcrLlmReasoningEffortRequestSchema.nullable(),
|
|
70602
|
-
reasoning_effort_resolved: OcrLlmReasoningEffortSchema.nullable()
|
|
70603
|
-
}).strict();
|
|
70604
|
-
OCR_LLM_EMERGENCY_CATALOG = [
|
|
70605
|
-
{
|
|
70606
|
-
id: "openai/gpt-5.6-terra",
|
|
70607
|
-
label: "GPT-5.6 Terra",
|
|
70608
|
-
provider: "openai",
|
|
70609
|
-
created_at: null,
|
|
70610
|
-
context_length: 1050000,
|
|
70611
|
-
pricing: {
|
|
70612
|
-
prompt_usd_per_1m: 2.5,
|
|
70613
|
-
completion_usd_per_1m: 15,
|
|
70614
|
-
basis: "provider_list"
|
|
70615
|
-
},
|
|
70616
|
-
recommendation: "suggested",
|
|
70617
|
-
is_default: true,
|
|
70618
|
-
certified_grounding: true,
|
|
70619
|
-
certified_suggest: true,
|
|
70620
|
-
supports_grounding: true,
|
|
70621
|
-
supports_suggest: true,
|
|
70622
|
-
pricing_known: true,
|
|
70623
|
-
reasoning: {
|
|
70624
|
-
supported_efforts: [
|
|
70625
|
-
"none",
|
|
70626
|
-
"low",
|
|
70627
|
-
"medium",
|
|
70628
|
-
"high",
|
|
70629
|
-
"xhigh",
|
|
70630
|
-
"max"
|
|
70631
|
-
],
|
|
70632
|
-
default_effort: "medium",
|
|
70633
|
-
mandatory: false,
|
|
70634
|
-
supports_max_tokens: false
|
|
70635
|
-
},
|
|
70636
|
-
deprecated_at: null
|
|
70637
|
-
},
|
|
70638
|
-
{
|
|
70639
|
-
id: "openai/gpt-4.1-mini",
|
|
70640
|
-
label: "GPT-4.1 Mini",
|
|
70641
|
-
provider: "openai",
|
|
70642
|
-
created_at: null,
|
|
70643
|
-
context_length: 1047576,
|
|
70644
|
-
pricing: {
|
|
70645
|
-
prompt_usd_per_1m: 0.4,
|
|
70646
|
-
completion_usd_per_1m: 1.6,
|
|
70647
|
-
basis: "provider_list"
|
|
70648
|
-
},
|
|
70649
|
-
recommendation: "suggested",
|
|
70650
|
-
is_default: false,
|
|
70651
|
-
certified_grounding: true,
|
|
70652
|
-
certified_suggest: true,
|
|
70653
|
-
supports_grounding: true,
|
|
70654
|
-
supports_suggest: true,
|
|
70655
|
-
pricing_known: true,
|
|
70656
|
-
reasoning: null,
|
|
70657
|
-
deprecated_at: null
|
|
70658
|
-
},
|
|
70659
|
-
{
|
|
70660
|
-
id: "openai/gpt-4.1",
|
|
70661
|
-
label: "GPT-4.1",
|
|
70662
|
-
provider: "openai",
|
|
70663
|
-
created_at: null,
|
|
70664
|
-
context_length: 1047576,
|
|
70665
|
-
pricing: {
|
|
70666
|
-
prompt_usd_per_1m: 2,
|
|
70667
|
-
completion_usd_per_1m: 8,
|
|
70668
|
-
basis: "provider_list"
|
|
70669
|
-
},
|
|
70670
|
-
recommendation: "suggested",
|
|
70671
|
-
is_default: false,
|
|
70672
|
-
certified_grounding: true,
|
|
70673
|
-
certified_suggest: true,
|
|
70674
|
-
supports_grounding: true,
|
|
70675
|
-
supports_suggest: true,
|
|
70676
|
-
pricing_known: true,
|
|
70677
|
-
reasoning: null,
|
|
70678
|
-
deprecated_at: null
|
|
70679
|
-
}
|
|
70680
|
-
];
|
|
70681
|
-
OCR_LLM_CATALOG = OCR_LLM_EMERGENCY_CATALOG;
|
|
70682
|
-
OCR_LLM_MODEL_IDS = OCR_LLM_EMERGENCY_CATALOG.map((entry) => entry.id);
|
|
70683
|
-
OCR_LLM_CERTIFIED_MODEL_IDS = OCR_LLM_EMERGENCY_CATALOG.filter((entry) => entry.certified_grounding || entry.certified_suggest).map((entry) => entry.id);
|
|
70684
|
-
OCR_LLM_SUGGESTED_PROVIDERS = [
|
|
70685
|
-
"openai",
|
|
70686
|
-
"anthropic",
|
|
70687
|
-
"google",
|
|
70688
|
-
"x-ai",
|
|
70689
|
-
"moonshotai"
|
|
70690
|
-
];
|
|
70691
|
-
});
|
|
70692
|
-
|
|
70693
|
-
// ../types/src/ocr/index.ts
|
|
70694
|
-
var init_ocr = __esm(() => {
|
|
70695
|
-
init_dist();
|
|
70696
|
-
init_ocr_figure_assets();
|
|
70697
|
-
init_ocr_id_lookup();
|
|
70698
|
-
init_ocr_llm();
|
|
70699
|
-
});
|
|
70700
|
-
|
|
70701
69077
|
// ../types/src/storage/s3-paths.ts
|
|
70702
69078
|
function assertSegment(name, value) {
|
|
70703
69079
|
if (!value || !SEGMENT_RX.test(value)) {
|
|
@@ -71068,18 +69444,14 @@ __export(exports_src, {
|
|
|
71068
69444
|
triggersFromWorkflowDefinition: () => triggersFromWorkflowDefinition,
|
|
71069
69445
|
triggersFromGitManifest: () => triggersFromGitManifest,
|
|
71070
69446
|
triggersFromAgentConfig: () => triggersFromAgentConfig,
|
|
71071
|
-
toOcrLlmRequestSnapshot: () => toOcrLlmRequestSnapshot,
|
|
71072
69447
|
toJsonSchema: () => toJsonSchema,
|
|
71073
|
-
toCustomerRetailCatalogEntry: () => toCustomerRetailCatalogEntry,
|
|
71074
69448
|
suppressRequiredMissingErrorsForSchemaFileFields: () => suppressRequiredMissingErrorsForSchemaFileFields,
|
|
71075
69449
|
suggestWorkflowName: () => suggestWorkflowName,
|
|
71076
69450
|
stripTenantPrefix: () => stripTenantPrefix,
|
|
71077
69451
|
stripGroundingMetadata: () => stripGroundingMetadata,
|
|
71078
69452
|
stringToUnitInterval: () => stringToUnitInterval,
|
|
71079
69453
|
sourceLockfileInputHash: () => sourceLockfileInputHash,
|
|
71080
|
-
shellSingleQuote: () => shellSingleQuote,
|
|
71081
69454
|
serializeWebhookEvent: () => serializeWebhookEvent,
|
|
71082
|
-
serializeOpenParserMultipartRequest: () => serializeOpenParserMultipartRequest,
|
|
71083
69455
|
scriptParamTypeAlias: () => scriptParamTypeAlias,
|
|
71084
69456
|
schemaFileUploadMatchesField: () => schemaFileUploadMatchesField,
|
|
71085
69457
|
s3PathFilename: () => s3PathFilename,
|
|
@@ -71097,13 +69469,9 @@ __export(exports_src, {
|
|
|
71097
69469
|
resolveEffectiveMimeType: () => resolveEffectiveMimeType,
|
|
71098
69470
|
resolveAgentOriginalSourceRef: () => resolveAgentOriginalSourceRef,
|
|
71099
69471
|
requiresSpecializedParser: () => requiresSpecializedParser,
|
|
71100
|
-
requireOcrModelUsdPerPage: () => requireOcrModelUsdPerPage,
|
|
71101
|
-
refinePipelineExtractionSchema: () => refinePipelineExtractionSchema,
|
|
71102
|
-
refineExtractPipelineXor: () => refineExtractPipelineXor,
|
|
71103
69472
|
redactFileSourceSecrets: () => redactFileSourceSecrets,
|
|
71104
69473
|
publicExecutionFailure: () => publicExecutionFailure,
|
|
71105
69474
|
projectAgentInputFiles: () => projectAgentInputFiles,
|
|
71106
|
-
pipelineExtractionSchemaRootPropertyCount: () => pipelineExtractionSchemaRootPropertyCount,
|
|
71107
69475
|
pathToDottedPackageName: () => pathToDottedPackageName,
|
|
71108
69476
|
parseWorkflowRerunVersion: () => parseWorkflowRerunVersion,
|
|
71109
69477
|
parseStepType: () => parseStepType,
|
|
@@ -71115,15 +69483,10 @@ __export(exports_src, {
|
|
|
71115
69483
|
parseFailureEnvelope: () => parseFailureEnvelope,
|
|
71116
69484
|
parseAutomationTarget: () => parseAutomationTarget,
|
|
71117
69485
|
parseAgentRerunVersion: () => parseAgentRerunVersion,
|
|
71118
|
-
ocrPipelineIdLookupCandidates: () => ocrPipelineIdLookupCandidates,
|
|
71119
|
-
ocrJobIdLookupCandidates: () => ocrJobIdLookupCandidates,
|
|
71120
|
-
normalizeOcrPipelineIdInput: () => normalizeOcrPipelineIdInput,
|
|
71121
|
-
normalizeOcrJobIdInput: () => normalizeOcrJobIdInput,
|
|
71122
69486
|
normalizeLegacyFileIdInput: () => normalizeLegacyFileIdInput,
|
|
71123
69487
|
normalizeExtractInputToText: () => normalizeExtractInputToText,
|
|
71124
69488
|
noopTracingContext: () => noopTracingContext,
|
|
71125
69489
|
mimeTypeForExtension: () => mimeTypeForExtension,
|
|
71126
|
-
migratedOcrJobIdFromUuid: () => migratedOcrJobIdFromUuid,
|
|
71127
69490
|
matchS3Path: () => matchS3Path,
|
|
71128
69491
|
mapOCRAttributes: () => mapOCRAttributes,
|
|
71129
69492
|
mapLLMAttributes: () => mapLLMAttributes,
|
|
@@ -71131,8 +69494,6 @@ __export(exports_src, {
|
|
|
71131
69494
|
listStepTypesByCategory: () => listStepTypesByCategory,
|
|
71132
69495
|
listStepTypes: () => listStepTypes,
|
|
71133
69496
|
listProcessorIds: () => listProcessorIds,
|
|
71134
|
-
legacyUuidFromMigratedOcrJobId: () => legacyUuidFromMigratedOcrJobId,
|
|
71135
|
-
legacyOepFromMigratedOcrPipelineId: () => legacyOepFromMigratedOcrPipelineId,
|
|
71136
69497
|
judgeScoreJson: () => judgeScoreJson,
|
|
71137
69498
|
judgeLabelJson: () => judgeLabelJson,
|
|
71138
69499
|
isWorkflowResult: () => isWorkflowResult,
|
|
@@ -71145,9 +69506,7 @@ __export(exports_src, {
|
|
|
71145
69506
|
isRunInSampleRank: () => isRunInSampleRank,
|
|
71146
69507
|
isRunExpandSection: () => isRunExpandSection,
|
|
71147
69508
|
isResolvedProcessorFile: () => isResolvedProcessorFile,
|
|
71148
|
-
isPreferredOcrJobId: () => isPreferredOcrJobId,
|
|
71149
69509
|
isOutputSchemaUnknown: () => isOutputSchemaUnknown,
|
|
71150
|
-
isOcrJobIdInput: () => isOcrJobIdInput,
|
|
71151
69510
|
isNonSuccessTerminalExecutionStatus: () => isNonSuccessTerminalExecutionStatus,
|
|
71152
69511
|
isManualTriggerEnabled: () => isManualTriggerEnabled,
|
|
71153
69512
|
isLocalAgentResourcePath: () => isLocalAgentResourcePath,
|
|
@@ -71161,7 +69520,6 @@ __export(exports_src, {
|
|
|
71161
69520
|
isAgentEmailExplicitlyDisabled: () => isAgentEmailExplicitlyDisabled,
|
|
71162
69521
|
inputsWithSource: () => inputsWithSource,
|
|
71163
69522
|
hasTriggerMethod: () => hasTriggerMethod,
|
|
71164
|
-
hasPipelineExtractionSchemaProperties: () => hasPipelineExtractionSchemaProperties,
|
|
71165
69523
|
hasDeclaredOutput: () => hasDeclaredOutput,
|
|
71166
69524
|
goldenFileSatisfiedInResult: () => goldenFileSatisfiedInResult,
|
|
71167
69525
|
getWebhookDestinationUrlError: () => getWebhookDestinationUrlError,
|
|
@@ -71174,12 +69532,8 @@ __export(exports_src, {
|
|
|
71174
69532
|
getRequiredOutputKeys: () => getRequiredOutputKeys,
|
|
71175
69533
|
getProcessorSchemas: () => getProcessorSchemas,
|
|
71176
69534
|
getParserCategory: () => getParserCategory,
|
|
71177
|
-
getOpenParserRoute: () => getOpenParserRoute,
|
|
71178
|
-
getOcrModelUsdPerPage: () => getOcrModelUsdPerPage,
|
|
71179
69535
|
getInvokeWorkflowRef: () => getInvokeWorkflowRef,
|
|
71180
69536
|
getInvokeExecutionMode: () => getInvokeExecutionMode,
|
|
71181
|
-
getDefaultOcrModelId: () => getDefaultOcrModelId,
|
|
71182
|
-
getDefaultOcrLlmModelId: () => getDefaultOcrLlmModelId,
|
|
71183
69537
|
getConfigSchema: () => getConfigSchema,
|
|
71184
69538
|
getConfigFieldMetadata: () => getConfigFieldMetadata,
|
|
71185
69539
|
getConfigDefaults: () => getConfigDefaults,
|
|
@@ -71222,19 +69576,14 @@ __export(exports_src, {
|
|
|
71222
69576
|
collectInvokeWorkflowTargetIds: () => collectInvokeWorkflowTargetIds,
|
|
71223
69577
|
collectFileReferenceSentinels: () => collectFileReferenceSentinels,
|
|
71224
69578
|
coerceInput: () => coerceInput,
|
|
71225
|
-
canonicalParseRequestExample: () => canonicalParseRequestExample,
|
|
71226
69579
|
buildWorkflowOutputContractSchema: () => buildWorkflowOutputContractSchema,
|
|
71227
69580
|
buildWorkflowInputsJsonSchema: () => buildWorkflowInputsJsonSchema,
|
|
71228
69581
|
buildS3PathSuffix: () => buildS3PathSuffix,
|
|
71229
69582
|
buildS3Path: () => buildS3Path,
|
|
71230
|
-
buildParseCurl: () => buildParseCurl,
|
|
71231
|
-
buildOpenParserMultipartCurl: () => buildOpenParserMultipartCurl,
|
|
71232
|
-
buildExtractPipelineCurl: () => buildExtractPipelineCurl,
|
|
71233
69583
|
buildDiscreteJudgeSystemPrompt: () => buildDiscreteJudgeSystemPrompt,
|
|
71234
69584
|
buildContinuousJudgeSystemPrompt: () => buildContinuousJudgeSystemPrompt,
|
|
71235
69585
|
boundWebhookEventOutput: () => boundWebhookEventOutput,
|
|
71236
69586
|
assertS3PathSegment: () => assertS3PathSegment,
|
|
71237
|
-
applyPaddleOcrOptionDefaults: () => applyPaddleOcrOptionDefaults,
|
|
71238
69587
|
aliasReplyConfigSchema: () => aliasReplyConfigSchema,
|
|
71239
69588
|
aggregateEvaluatorCompositionScore: () => aggregateEvaluatorCompositionScore,
|
|
71240
69589
|
addEigenpalContext: () => addEigenpalContext,
|
|
@@ -71281,7 +69630,6 @@ __export(exports_src, {
|
|
|
71281
69630
|
WEBHOOK_DELIVERY_STATES: () => WEBHOOK_DELIVERY_STATES,
|
|
71282
69631
|
WEBHOOK_API_VERSION: () => WEBHOOK_API_VERSION,
|
|
71283
69632
|
UpdateWebhookEndpointSchema: () => UpdateWebhookEndpointSchema,
|
|
71284
|
-
UpdateExtractionPipelineRequestSchema: () => UpdateExtractionPipelineRequestSchema,
|
|
71285
69633
|
UNSUPPORTED_SOURCE_MANIFEST_FILENAME: () => UNSUPPORTED_SOURCE_MANIFEST_FILENAME,
|
|
71286
69634
|
TriggerTypeValue: () => TriggerTypeValue,
|
|
71287
69635
|
TriggerTypeSchema: () => TriggerTypeSchema,
|
|
@@ -71316,11 +69664,6 @@ __export(exports_src, {
|
|
|
71316
69664
|
TRIGGER_TYPES: () => TRIGGER_TYPES,
|
|
71317
69665
|
TERMINAL_EXECUTION_STATUSES: () => TERMINAL_EXECUTION_STATUSES,
|
|
71318
69666
|
SwitchStepSchema: () => SwitchStepSchema,
|
|
71319
|
-
SuggestSchemaTerminalResultSchema: () => SuggestSchemaTerminalResultSchema,
|
|
71320
|
-
SuggestSchemaResponseSchema: () => SuggestSchemaResponseSchema,
|
|
71321
|
-
SuggestSchemaRequestSchema: () => SuggestSchemaRequestSchema,
|
|
71322
|
-
SuggestSchemaPreviewMetaSchema: () => SuggestSchemaPreviewMetaSchema,
|
|
71323
|
-
SuggestSchemaHintSchema: () => SuggestSchemaHintSchema,
|
|
71324
69667
|
StoredWorkflowDefinitionSchema: () => StoredWorkflowDefinitionSchema,
|
|
71325
69668
|
StepTypeValue: () => StepTypeValue,
|
|
71326
69669
|
StepTypeSchema: () => StepTypeSchema,
|
|
@@ -71360,10 +69703,6 @@ __export(exports_src, {
|
|
|
71360
69703
|
ScopeStackSchema: () => ScopeStackSchema,
|
|
71361
69704
|
ScopeEntryTypeSchema: () => ScopeEntryTypeSchema,
|
|
71362
69705
|
ScopeEntrySchema: () => ScopeEntrySchema,
|
|
71363
|
-
SUGGEST_SCHEMA_PREVIEW_MAX_PAGES: () => SUGGEST_SCHEMA_PREVIEW_MAX_PAGES,
|
|
71364
|
-
SUGGEST_SCHEMA_PREVIEW_MAX_CHARS: () => SUGGEST_SCHEMA_PREVIEW_MAX_CHARS,
|
|
71365
|
-
SUGGEST_SCHEMA_LLM_MODEL: () => SUGGEST_SCHEMA_LLM_MODEL,
|
|
71366
|
-
SUGGEST_SCHEMA_HINT_MAX_CHARS: () => SUGGEST_SCHEMA_HINT_MAX_CHARS,
|
|
71367
69706
|
STEP_TYPES: () => STEP_TYPES,
|
|
71368
69707
|
STEP_SCHEMAS: () => STEP_SCHEMAS,
|
|
71369
69708
|
STEP_RETRY_CAPABILITIES: () => STEP_RETRY_CAPABILITIES,
|
|
@@ -71392,27 +69731,18 @@ __export(exports_src, {
|
|
|
71392
69731
|
RetryCategorySchema: () => RetryCategorySchema,
|
|
71393
69732
|
ResolvedRetryPolicySchema: () => ResolvedRetryPolicySchema,
|
|
71394
69733
|
ResolvedProcessorFileSchema: () => ResolvedProcessorFileSchema,
|
|
71395
|
-
RepairAttemptsSchema: () => RepairAttemptsSchema,
|
|
71396
69734
|
ReleaseTagSchema: () => ReleaseTagSchema,
|
|
71397
|
-
RelatedExtractionSummarySchema: () => RelatedExtractionSummarySchema,
|
|
71398
|
-
RegionTypeSchema: () => RegionTypeSchema,
|
|
71399
|
-
RegionSchema: () => RegionSchema,
|
|
71400
|
-
RegionContentSchema: () => RegionContentSchema,
|
|
71401
69735
|
RedactedWebhookCustomHeaderSchema: () => RedactedWebhookCustomHeaderSchema,
|
|
71402
|
-
RawParseResultSchema: () => RawParseResultSchema,
|
|
71403
69736
|
RUN_TARGET_SEGMENT_PATTERN: () => RUN_TARGET_SEGMENT_PATTERN,
|
|
71404
69737
|
RUN_EXPAND_SECTIONS: () => RUN_EXPAND_SECTIONS,
|
|
71405
69738
|
RUN_DETAIL_EXPAND_PRESET: () => RUN_DETAIL_EXPAND_PRESET,
|
|
71406
69739
|
RUNS_TRIGGERED_BY_SYSTEM: () => RUNS_TRIGGERED_BY_SYSTEM,
|
|
71407
69740
|
RERUN_ORIGINAL_VERSION: () => RERUN_ORIGINAL_VERSION,
|
|
71408
|
-
REGION_TYPES: () => REGION_TYPES,
|
|
71409
69741
|
PublicWebhookRunSchema: () => PublicWebhookRunSchema,
|
|
71410
|
-
PublicFileSchema: () => PublicFileSchema,
|
|
71411
69742
|
ProcessorPortSchema: () => ProcessorPortSchema,
|
|
71412
69743
|
ProcessorExecutionContextSchema: () => ProcessorExecutionContextSchema,
|
|
71413
69744
|
ProcessorDefinitionSchema: () => ProcessorDefinitionSchema,
|
|
71414
69745
|
PositionedTextSchema: () => PositionedTextSchema,
|
|
71415
|
-
PolygonSchema: () => PolygonSchema,
|
|
71416
69746
|
PointSchema: () => PointSchema,
|
|
71417
69747
|
PdfEmbedderOutputSchema: () => PdfEmbedderOutputSchema,
|
|
71418
69748
|
PdfEmbedderInputSchema: () => PdfEmbedderInputSchema,
|
|
@@ -71420,88 +69750,22 @@ __export(exports_src, {
|
|
|
71420
69750
|
ParserTypeSchema: () => ParserTypeSchema,
|
|
71421
69751
|
ParserInputSchema: () => ParserInputSchema,
|
|
71422
69752
|
ParserCategory: () => ParserCategory,
|
|
71423
|
-
ParsedDocumentSchema: () => ParsedDocumentSchema,
|
|
71424
69753
|
ParseUsageSchema: () => ParseUsageSchema,
|
|
71425
69754
|
ParseResultSchema: () => ParseResultSchema,
|
|
71426
|
-
ParseRequestSchema: () => ParseRequestSchema,
|
|
71427
69755
|
ParseOptionsSchema: () => ParseOptionsSchema,
|
|
71428
|
-
ParseBatchRequestSchema: () => ParseBatchRequestSchema,
|
|
71429
|
-
ParseBatchItemSchema: () => ParseBatchItemSchema,
|
|
71430
69756
|
ParallelStepSchema: () => ParallelStepSchema,
|
|
71431
69757
|
ParallelMapStepSchema: () => ParallelMapStepSchema,
|
|
71432
69758
|
ParallelBranchSchema: () => ParallelBranchSchema,
|
|
71433
69759
|
PaginationParamsSchema: () => PaginationParamsSchema,
|
|
71434
69760
|
PageResultSchema: () => PageResultSchema,
|
|
71435
|
-
PageBlockSchema: () => PageBlockSchema,
|
|
71436
|
-
PageBlockKindSchema: () => PageBlockKindSchema,
|
|
71437
|
-
PaddleRawProfileSchema: () => PaddleRawProfileSchema,
|
|
71438
|
-
PaddleOcrOptionsRequestSchema: () => PaddleOcrOptionsRequestSchema,
|
|
71439
|
-
PaddleOcrOptionsEffectiveSchema: () => PaddleOcrOptionsEffectiveSchema,
|
|
71440
69761
|
PROVIDER_LOGO_DATA: () => PROVIDER_LOGO_DATA,
|
|
71441
69762
|
PROCESSOR_SCHEMAS: () => PROCESSOR_SCHEMAS,
|
|
71442
69763
|
PROCESSOR_IDS: () => PROCESSOR_IDS,
|
|
71443
|
-
PIPELINE_EXTRACTION_SCHEMA_EMPTY_PROPERTIES_MESSAGE: () => PIPELINE_EXTRACTION_SCHEMA_EMPTY_PROPERTIES_MESSAGE,
|
|
71444
69764
|
PENDING_FILE_REF: () => PENDING_FILE_REF,
|
|
71445
69765
|
PARSER_IDS: () => PARSER_IDS,
|
|
71446
|
-
PAGE_BLOCK_KINDS: () => PAGE_BLOCK_KINDS,
|
|
71447
|
-
PADDLE_OCR_USD_PER_PAGE: () => PADDLE_OCR_USD_PER_PAGE,
|
|
71448
|
-
PADDLE_OCR_OPTION_DEFAULTS: () => PADDLE_OCR_OPTION_DEFAULTS,
|
|
71449
|
-
OpenParserParseResultSchema: () => OpenParserParseResultSchema,
|
|
71450
69766
|
OpenInferenceSpanKinds: () => OpenInferenceSpanKinds,
|
|
71451
69767
|
OpenInference: () => OpenInference,
|
|
71452
|
-
OcrOutputFormatSchema: () => OcrOutputFormatSchema,
|
|
71453
|
-
OcrOptionsRequestSchema: () => OcrOptionsRequestSchema,
|
|
71454
|
-
OcrOptionsEffectiveSchema: () => OcrOptionsEffectiveSchema,
|
|
71455
|
-
OcrModelsResponseSchema: () => OcrModelsResponseSchema,
|
|
71456
|
-
OcrModelSchema: () => OcrModelSchema,
|
|
71457
|
-
OcrModelPricingSchema: () => OcrModelPricingSchema,
|
|
71458
|
-
OcrModelOptionCapabilitySchema: () => OcrModelOptionCapabilitySchema,
|
|
71459
|
-
OcrModelCatalogEntrySchema: () => OcrModelCatalogEntrySchema,
|
|
71460
|
-
OcrModelAvailabilitySchema: () => OcrModelAvailabilitySchema,
|
|
71461
|
-
OcrLlmRequestSnapshotSchema: () => OcrLlmRequestSnapshotSchema,
|
|
71462
|
-
OcrLlmRecommendationTierSchema: () => OcrLlmRecommendationTierSchema,
|
|
71463
|
-
OcrLlmReasoningEffortSchema: () => OcrLlmReasoningEffortSchema,
|
|
71464
|
-
OcrLlmReasoningEffortRequestSchema: () => OcrLlmReasoningEffortRequestSchema,
|
|
71465
|
-
OcrLlmPublicPricingBasisSchema: () => OcrLlmPublicPricingBasisSchema,
|
|
71466
|
-
OcrLlmProviderListPricingSchema: () => OcrLlmProviderListPricingSchema,
|
|
71467
|
-
OcrLlmProviderListPricingBasisSchema: () => OcrLlmProviderListPricingBasisSchema,
|
|
71468
|
-
OcrLlmProviderCatalogEntrySchema: () => OcrLlmProviderCatalogEntrySchema,
|
|
71469
|
-
OcrLlmPricingBasisSchema: () => OcrLlmPricingBasisSchema,
|
|
71470
|
-
OcrLlmModelsResponseSchema: () => OcrLlmModelsResponseSchema,
|
|
71471
|
-
OcrLlmModelsQuerySchema: () => OcrLlmModelsQuerySchema,
|
|
71472
|
-
OcrLlmModelsListModeSchema: () => OcrLlmModelsListModeSchema,
|
|
71473
|
-
OcrLlmModelReasoningSchema: () => OcrLlmModelReasoningSchema,
|
|
71474
|
-
OcrLlmModelPricingSchema: () => OcrLlmModelPricingSchema,
|
|
71475
|
-
OcrLlmModelCatalogEntrySchema: () => OcrLlmModelCatalogEntrySchema,
|
|
71476
|
-
OcrFileIdSchema: () => OcrFileIdSchema,
|
|
71477
|
-
OcrFigureAssetsModeSchema: () => OcrFigureAssetsModeSchema,
|
|
71478
|
-
OPENPARSER_ROUTE_MANIFEST: () => OPENPARSER_ROUTE_MANIFEST,
|
|
71479
|
-
OPENPARSER_IDEMPOTENCY_KEY_GUIDANCE: () => OPENPARSER_IDEMPOTENCY_KEY_GUIDANCE,
|
|
71480
|
-
OPENPARSER_DEFAULT_OUTPUT_FORMAT: () => OPENPARSER_DEFAULT_OUTPUT_FORMAT,
|
|
71481
|
-
OPENPARSER_CURL_IDEMPOTENCY_KEY_EXPR: () => OPENPARSER_CURL_IDEMPOTENCY_KEY_EXPR,
|
|
71482
|
-
OPENPARSER_CURL_API_KEY_PLACEHOLDER: () => OPENPARSER_CURL_API_KEY_PLACEHOLDER,
|
|
71483
|
-
OPENPARSER_COMPONENT_SCHEMAS: () => OPENPARSER_COMPONENT_SCHEMAS,
|
|
71484
69768
|
OFFICE_MIME_TYPES: () => OFFICE_MIME_TYPES,
|
|
71485
|
-
OCR_SYNC_STATUS_CODES: () => OCR_SYNC_STATUS_CODES,
|
|
71486
|
-
OCR_OUTPUT_FORMATS: () => OCR_OUTPUT_FORMATS,
|
|
71487
|
-
OCR_OPENAPI_RELATIVE_PATH: () => OCR_OPENAPI_RELATIVE_PATH,
|
|
71488
|
-
OCR_MODEL_CATALOG: () => OCR_MODEL_CATALOG,
|
|
71489
|
-
OCR_MODELS: () => OCR_MODELS,
|
|
71490
|
-
OCR_LLM_SUGGESTED_PROVIDERS: () => OCR_LLM_SUGGESTED_PROVIDERS,
|
|
71491
|
-
OCR_LLM_SUGGESTED_MAX_AGE_DAYS: () => OCR_LLM_SUGGESTED_MAX_AGE_DAYS,
|
|
71492
|
-
OCR_LLM_RETAIL_MARKUP: () => OCR_LLM_RETAIL_MARKUP,
|
|
71493
|
-
OCR_LLM_REASONING_EFFORTS: () => OCR_LLM_REASONING_EFFORTS,
|
|
71494
|
-
OCR_LLM_MODEL_IDS: () => OCR_LLM_MODEL_IDS,
|
|
71495
|
-
OCR_LLM_EMERGENCY_CATALOG: () => OCR_LLM_EMERGENCY_CATALOG,
|
|
71496
|
-
OCR_LLM_CERTIFIED_MODEL_IDS: () => OCR_LLM_CERTIFIED_MODEL_IDS,
|
|
71497
|
-
OCR_LLM_CATALOG: () => OCR_LLM_CATALOG,
|
|
71498
|
-
OCR_JOB_STATUSES: () => OCR_JOB_STATUSES,
|
|
71499
|
-
OCR_JOB_OPERATIONS: () => OCR_JOB_OPERATIONS,
|
|
71500
|
-
OCR_JOB_LIST_MAX_LIMIT: () => OCR_JOB_LIST_MAX_LIMIT,
|
|
71501
|
-
OCR_JOB_LIST_DEFAULT_LIMIT: () => OCR_JOB_LIST_DEFAULT_LIMIT,
|
|
71502
|
-
OCR_JOB_ID_PREFIX: () => OCR_JOB_ID_PREFIX,
|
|
71503
|
-
OCR_JOB_ID_PATTERN: () => OCR_JOB_ID_PATTERN,
|
|
71504
|
-
OCR_JOB_HISTORY_OPERATIONS: () => OCR_JOB_HISTORY_OPERATIONS,
|
|
71505
69769
|
NON_SUCCESS_TERMINAL_EXECUTION_STATUSES: () => NON_SUCCESS_TERMINAL_EXECUTION_STATUSES,
|
|
71506
69770
|
MergeOutputSchema: () => MergeOutputSchema,
|
|
71507
69771
|
MergeInputSchema: () => MergeInputSchema,
|
|
@@ -71512,9 +69776,6 @@ __export(exports_src, {
|
|
|
71512
69776
|
LocalEvaluatorReferenceSchema: () => LocalEvaluatorReferenceSchema,
|
|
71513
69777
|
LocalEvaluatorCompositionItemSchema: () => LocalEvaluatorCompositionItemSchema,
|
|
71514
69778
|
LocalAgentResourceDirectorySchema: () => LocalAgentResourceDirectorySchema,
|
|
71515
|
-
LlmOptionsStoredSchema: () => LlmOptionsStoredSchema,
|
|
71516
|
-
LlmOptionsRequestSchema: () => LlmOptionsRequestSchema,
|
|
71517
|
-
LlmModelSchema: () => LlmModelSchema,
|
|
71518
69779
|
LlmJudgeConfigSchema: () => LlmJudgeConfigSchema,
|
|
71519
69780
|
LegacyFileIdInputSchema: () => LegacyFileIdInputSchema,
|
|
71520
69781
|
LegacyBlockStepSchema: () => LegacyBlockStepSchema,
|
|
@@ -71522,23 +69783,9 @@ __export(exports_src, {
|
|
|
71522
69783
|
LayoutElementSchema: () => LayoutElementSchema,
|
|
71523
69784
|
LLM_JUDGE_PROMPT_MIN_LENGTH: () => LLM_JUDGE_PROMPT_MIN_LENGTH,
|
|
71524
69785
|
LEGACY_RUN_EXPAND_MIGRATION: () => LEGACY_RUN_EXPAND_MIGRATION,
|
|
71525
|
-
LEGACY_OCR_PIPELINE_ID_PREFIX: () => LEGACY_OCR_PIPELINE_ID_PREFIX,
|
|
71526
|
-
LEGACY_OCR_JOB_UUID_PATTERN: () => LEGACY_OCR_JOB_UUID_PATTERN,
|
|
71527
69786
|
LEGACY_FILE_REF_COMPATIBILITY: () => LEGACY_FILE_REF_COMPATIBILITY,
|
|
71528
69787
|
JudgeModeSchema: () => JudgeModeSchema,
|
|
71529
69788
|
JsonSchemaSchema: () => JsonSchemaSchema,
|
|
71530
|
-
JobSummarySchema: () => JobSummarySchema,
|
|
71531
|
-
JobStatusSchema: () => JobStatusSchema,
|
|
71532
|
-
JobSchema: () => JobSchema,
|
|
71533
|
-
JobProgressSchema: () => JobProgressSchema,
|
|
71534
|
-
JobOperationSchema: () => JobOperationSchema,
|
|
71535
|
-
JobListResponseSchema: () => JobListResponseSchema,
|
|
71536
|
-
JobListQuerySchema: () => JobListQuerySchema,
|
|
71537
|
-
JobIdSchema: () => JobIdSchema,
|
|
71538
|
-
JobIdInputSchema: () => JobIdInputSchema,
|
|
71539
|
-
JobHistoryOperationSchema: () => JobHistoryOperationSchema,
|
|
71540
|
-
JobFailureSchema: () => JobFailureSchema,
|
|
71541
|
-
JobAcceptedSchema: () => JobAcceptedSchema,
|
|
71542
69789
|
InlineFileRefSchema: () => InlineFileRefSchema,
|
|
71543
69790
|
InlineFileIngressRefSchema: () => InlineFileIngressRefSchema,
|
|
71544
69791
|
InlineFileIngressPayloadSchema: () => InlineFileIngressPayloadSchema,
|
|
@@ -71556,31 +69803,10 @@ __export(exports_src, {
|
|
|
71556
69803
|
FileIngressRefSchema: () => FileIngressRefSchema,
|
|
71557
69804
|
FileIdIngressRefSchema: () => FileIdIngressRefSchema,
|
|
71558
69805
|
FailStepSchema: () => FailStepSchema,
|
|
71559
|
-
ExtractionUsageTotalsSchema: () => ExtractionUsageTotalsSchema,
|
|
71560
|
-
ExtractionTerminalResultSchema: () => ExtractionTerminalResultSchema,
|
|
71561
|
-
ExtractionPipelineSlugSchema: () => ExtractionPipelineSlugSchema,
|
|
71562
|
-
ExtractionPipelineSchema: () => ExtractionPipelineSchema,
|
|
71563
|
-
ExtractionPipelineNameSchema: () => ExtractionPipelineNameSchema,
|
|
71564
|
-
ExtractionPipelineListResponseSchema: () => ExtractionPipelineListResponseSchema,
|
|
71565
|
-
ExtractionPipelineIdSchema: () => ExtractionPipelineIdSchema,
|
|
71566
|
-
ExtractionPipelineIdInputSchema: () => ExtractionPipelineIdInputSchema,
|
|
71567
|
-
ExtractionJsonSchemaObjectSchema: () => ExtractionJsonSchemaObjectSchema,
|
|
71568
|
-
ExtractionGroundingResultSchema: () => ExtractionGroundingResultSchema,
|
|
71569
|
-
ExtractionGroundingModeSchema: () => ExtractionGroundingModeSchema,
|
|
71570
|
-
ExtractionGroundingFieldSchema: () => ExtractionGroundingFieldSchema,
|
|
71571
|
-
ExtractionCitationSchema: () => ExtractionCitationSchema,
|
|
71572
|
-
ExtractionCitationGranularitySchema: () => ExtractionCitationGranularitySchema,
|
|
71573
|
-
ExtractionChunkSchema: () => ExtractionChunkSchema,
|
|
71574
|
-
ExtractionAttemptStatusSchema: () => ExtractionAttemptStatusSchema,
|
|
71575
|
-
ExtractionAttemptSchema: () => ExtractionAttemptSchema,
|
|
71576
|
-
ExtractionAttemptKindSchema: () => ExtractionAttemptKindSchema,
|
|
71577
69806
|
ExtractedTableSchema: () => ExtractedTableSchema,
|
|
71578
|
-
ExtractRequestSchema: () => ExtractRequestSchema,
|
|
71579
69807
|
ExtractOutputSchema: () => ExtractOutputSchema,
|
|
71580
69808
|
ExtractInputSchema: () => ExtractInputSchema,
|
|
71581
69809
|
ExtractConfigSchema: () => ExtractConfigSchema,
|
|
71582
|
-
ExtractBatchRequestSchema: () => ExtractBatchRequestSchema,
|
|
71583
|
-
ExtractBatchItemSchema: () => ExtractBatchItemSchema,
|
|
71584
69810
|
ExperimentExportQuerySchema: () => ExperimentExportQuerySchema,
|
|
71585
69811
|
ExperimentExportAllQuerySchema: () => ExperimentExportAllQuerySchema,
|
|
71586
69812
|
ExpectedOutputSchema: () => ExpectedOutputSchema,
|
|
@@ -71609,16 +69835,9 @@ __export(exports_src, {
|
|
|
71609
69835
|
EvalOverridesSchema: () => EvalOverridesSchema,
|
|
71610
69836
|
EvalExampleMetaSchema: () => EvalExampleMetaSchema,
|
|
71611
69837
|
EvalConfigYamlSchema: () => EvalConfigYamlSchema,
|
|
71612
|
-
ErrorResponseSchema: () => ErrorResponseSchema,
|
|
71613
|
-
ErrorBodySchema: () => ErrorBodySchema,
|
|
71614
69838
|
EncryptedSecretValueSchema: () => EncryptedSecretValueSchema,
|
|
71615
69839
|
EmailTriggerMethodSchema: () => EmailTriggerMethodSchema,
|
|
71616
69840
|
Eigenpal: () => Eigenpal,
|
|
71617
|
-
EXTRACT_INLINE_CONFIG_KEYS: () => EXTRACT_INLINE_CONFIG_KEYS,
|
|
71618
|
-
EXTRACTION_GROUNDING_MODES: () => EXTRACTION_GROUNDING_MODES,
|
|
71619
|
-
EXTRACTION_CITATION_GRANULARITIES: () => EXTRACTION_CITATION_GRANULARITIES,
|
|
71620
|
-
EXTRACTION_ATTEMPT_STATUSES: () => EXTRACTION_ATTEMPT_STATUSES,
|
|
71621
|
-
EXTRACTION_ATTEMPT_KINDS: () => EXTRACTION_ATTEMPT_KINDS,
|
|
71622
69841
|
EXECUTION_TYPES: () => EXECUTION_TYPES,
|
|
71623
69842
|
EXECUTION_STATUSES: () => EXECUTION_STATUSES,
|
|
71624
69843
|
EXECUTION_SHARED_CANCEL_REQUESTABLE_STATUSES: () => EXECUTION_SHARED_CANCEL_REQUESTABLE_STATUSES,
|
|
@@ -71641,8 +69860,6 @@ __export(exports_src, {
|
|
|
71641
69860
|
DocumentParserInputSchema: () => DocumentParserInputSchema,
|
|
71642
69861
|
DocumentParserConfigSchema: () => DocumentParserConfigSchema,
|
|
71643
69862
|
DocumentMetadataSchema: () => DocumentMetadataSchema,
|
|
71644
|
-
DeleteFileResponseSchema: () => DeleteFileResponseSchema,
|
|
71645
|
-
DeleteExtractionPipelineResponseSchema: () => DeleteExtractionPipelineResponseSchema,
|
|
71646
69863
|
DbFileRefSchema: () => DbFileRefSchema,
|
|
71647
69864
|
DatasetNameSchema: () => DatasetNameSchema,
|
|
71648
69865
|
DatasetMetaSchema: () => DatasetMetaSchema,
|
|
@@ -71657,7 +69874,6 @@ __export(exports_src, {
|
|
|
71657
69874
|
CreateWorkflowDefinitionSchema: () => CreateWorkflowDefinitionSchema,
|
|
71658
69875
|
CreateWebhookEndpointSchema: () => CreateWebhookEndpointSchema,
|
|
71659
69876
|
CreateWebhookEndpointResponseSchema: () => CreateWebhookEndpointResponseSchema,
|
|
71660
|
-
CreateExtractionPipelineRequestSchema: () => CreateExtractionPipelineRequestSchema,
|
|
71661
69877
|
CoordinateUnitSchema: () => CoordinateUnitSchema,
|
|
71662
69878
|
ControlWaitOutputSchema: () => ControlWaitOutputSchema,
|
|
71663
69879
|
ControlWaitConfigSchema: () => ControlWaitConfigSchema,
|
|
@@ -71671,7 +69887,6 @@ __export(exports_src, {
|
|
|
71671
69887
|
ControlForeachConfigSchema: () => ControlForeachConfigSchema,
|
|
71672
69888
|
ControlFailOutputSchema: () => ControlFailOutputSchema,
|
|
71673
69889
|
ControlFailConfigSchema: () => ControlFailConfigSchema,
|
|
71674
|
-
ContentKindSchema: () => ContentKindSchema,
|
|
71675
69890
|
ConnectorSchema: () => ConnectorSchema,
|
|
71676
69891
|
ClassifyPagesOutputSchema: () => ClassifyPagesOutputSchema,
|
|
71677
69892
|
ClassifyPagesLabelSchema: () => ClassifyPagesLabelSchema,
|
|
@@ -71681,18 +69896,11 @@ __export(exports_src, {
|
|
|
71681
69896
|
ClassifyLabelSchema: () => ClassifyLabelSchema,
|
|
71682
69897
|
ClassifyInputSchema: () => ClassifyInputSchema,
|
|
71683
69898
|
ClassifyConfigSchema: () => ClassifyConfigSchema,
|
|
71684
|
-
ChunkProvenanceSpanSchema: () => ChunkProvenanceSpanSchema,
|
|
71685
69899
|
CUSTOM_SCRIPT_MAX_TIMEOUT_MS: () => CUSTOM_SCRIPT_MAX_TIMEOUT_MS,
|
|
71686
69900
|
CUSTOM_SCRIPT_MAX_MEMORY_MB: () => CUSTOM_SCRIPT_MAX_MEMORY_MB,
|
|
71687
69901
|
CUSTOM_SCRIPT_MAX_BYTES: () => CUSTOM_SCRIPT_MAX_BYTES,
|
|
71688
69902
|
CUSTOM_SCRIPT_CONTRACT: () => CUSTOM_SCRIPT_CONTRACT,
|
|
71689
|
-
CONTENT_KINDS: () => CONTENT_KINDS,
|
|
71690
69903
|
BoundingRegionSchema: () => BoundingRegionSchema,
|
|
71691
|
-
BoundingBoxSchema: () => BoundingBoxSchema,
|
|
71692
|
-
BatchSummaryCountsSchema: () => BatchSummaryCountsSchema,
|
|
71693
|
-
BatchJobAcceptedSchema: () => BatchJobAcceptedSchema,
|
|
71694
|
-
BatchChildSummarySchema: () => BatchChildSummarySchema,
|
|
71695
|
-
BatchChildPageSchema: () => BatchChildPageSchema,
|
|
71696
69904
|
BaseEntitySchema: () => BaseEntitySchema,
|
|
71697
69905
|
BUILTIN_FILE_SOURCE_DESCRIPTORS: () => BUILTIN_FILE_SOURCE_DESCRIPTORS,
|
|
71698
69906
|
AutomationTargetSchema: () => AutomationTargetSchema,
|
|
@@ -71733,7 +69941,6 @@ var init_src = __esm(() => {
|
|
|
71733
69941
|
init_git_source();
|
|
71734
69942
|
init_triggers();
|
|
71735
69943
|
init_webhooks();
|
|
71736
|
-
init_ocr();
|
|
71737
69944
|
init_typed_script();
|
|
71738
69945
|
});
|
|
71739
69946
|
|
|
@@ -72438,7 +70645,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
72438
70645
|
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
|
|
72439
70646
|
value = value.valueOf();
|
|
72440
70647
|
}
|
|
72441
|
-
const { aliasDuplicateObjects, onAnchor, onTagObj, schema
|
|
70648
|
+
const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;
|
|
72442
70649
|
let ref = undefined;
|
|
72443
70650
|
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
72444
70651
|
ref = sourceObjects.get(value);
|
|
@@ -72452,7 +70659,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
72452
70659
|
}
|
|
72453
70660
|
if (tagName?.startsWith("!!"))
|
|
72454
70661
|
tagName = defaultTagPrefix + tagName.slice(2);
|
|
72455
|
-
let tagObj = findTagObject(value, tagName,
|
|
70662
|
+
let tagObj = findTagObject(value, tagName, schema.tags);
|
|
72456
70663
|
if (!tagObj) {
|
|
72457
70664
|
if (value && typeof value.toJSON === "function") {
|
|
72458
70665
|
value = value.toJSON();
|
|
@@ -72463,7 +70670,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
72463
70670
|
ref.node = node2;
|
|
72464
70671
|
return node2;
|
|
72465
70672
|
}
|
|
72466
|
-
tagObj = value instanceof Map ?
|
|
70673
|
+
tagObj = value instanceof Map ? schema[identity.MAP] : (Symbol.iterator in Object(value)) ? schema[identity.SEQ] : schema[identity.MAP];
|
|
72467
70674
|
}
|
|
72468
70675
|
if (onTagObj) {
|
|
72469
70676
|
onTagObj(tagObj);
|
|
@@ -72486,7 +70693,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
72486
70693
|
var createNode = require_createNode();
|
|
72487
70694
|
var identity = require_identity();
|
|
72488
70695
|
var Node = require_Node();
|
|
72489
|
-
function collectionFromPath(
|
|
70696
|
+
function collectionFromPath(schema, path, value) {
|
|
72490
70697
|
let v = value;
|
|
72491
70698
|
for (let i = path.length - 1;i >= 0; --i) {
|
|
72492
70699
|
const k = path[i];
|
|
@@ -72504,27 +70711,27 @@ var require_Collection = __commonJS((exports) => {
|
|
|
72504
70711
|
onAnchor: () => {
|
|
72505
70712
|
throw new Error("This should not happen, please report a bug.");
|
|
72506
70713
|
},
|
|
72507
|
-
schema
|
|
70714
|
+
schema,
|
|
72508
70715
|
sourceObjects: new Map
|
|
72509
70716
|
});
|
|
72510
70717
|
}
|
|
72511
70718
|
var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done;
|
|
72512
70719
|
|
|
72513
70720
|
class Collection extends Node.NodeBase {
|
|
72514
|
-
constructor(type,
|
|
70721
|
+
constructor(type, schema) {
|
|
72515
70722
|
super(type);
|
|
72516
70723
|
Object.defineProperty(this, "schema", {
|
|
72517
|
-
value:
|
|
70724
|
+
value: schema,
|
|
72518
70725
|
configurable: true,
|
|
72519
70726
|
enumerable: false,
|
|
72520
70727
|
writable: true
|
|
72521
70728
|
});
|
|
72522
70729
|
}
|
|
72523
|
-
clone(
|
|
70730
|
+
clone(schema) {
|
|
72524
70731
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
72525
|
-
if (
|
|
72526
|
-
copy.schema =
|
|
72527
|
-
copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(
|
|
70732
|
+
if (schema)
|
|
70733
|
+
copy.schema = schema;
|
|
70734
|
+
copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);
|
|
72528
70735
|
if (this.range)
|
|
72529
70736
|
copy.range = this.range.slice();
|
|
72530
70737
|
return copy;
|
|
@@ -73460,12 +71667,12 @@ var require_Pair = __commonJS((exports) => {
|
|
|
73460
71667
|
this.key = key;
|
|
73461
71668
|
this.value = value;
|
|
73462
71669
|
}
|
|
73463
|
-
clone(
|
|
71670
|
+
clone(schema) {
|
|
73464
71671
|
let { key, value } = this;
|
|
73465
71672
|
if (identity.isNode(key))
|
|
73466
|
-
key = key.clone(
|
|
71673
|
+
key = key.clone(schema);
|
|
73467
71674
|
if (identity.isNode(value))
|
|
73468
|
-
value = value.clone(
|
|
71675
|
+
value = value.clone(schema);
|
|
73469
71676
|
return new Pair(key, value);
|
|
73470
71677
|
}
|
|
73471
71678
|
toJSON(_, ctx) {
|
|
@@ -73657,13 +71864,13 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
73657
71864
|
static get tagName() {
|
|
73658
71865
|
return "tag:yaml.org,2002:map";
|
|
73659
71866
|
}
|
|
73660
|
-
constructor(
|
|
73661
|
-
super(identity.MAP,
|
|
71867
|
+
constructor(schema) {
|
|
71868
|
+
super(identity.MAP, schema);
|
|
73662
71869
|
this.items = [];
|
|
73663
71870
|
}
|
|
73664
|
-
static from(
|
|
71871
|
+
static from(schema, obj, ctx) {
|
|
73665
71872
|
const { keepUndefined, replacer } = ctx;
|
|
73666
|
-
const map2 = new this(
|
|
71873
|
+
const map2 = new this(schema);
|
|
73667
71874
|
const add2 = (key, value) => {
|
|
73668
71875
|
if (typeof replacer === "function")
|
|
73669
71876
|
value = replacer.call(obj, key, value);
|
|
@@ -73679,8 +71886,8 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
73679
71886
|
for (const key of Object.keys(obj))
|
|
73680
71887
|
add2(key, obj[key]);
|
|
73681
71888
|
}
|
|
73682
|
-
if (typeof
|
|
73683
|
-
map2.items.sort(
|
|
71889
|
+
if (typeof schema.sortMapEntries === "function") {
|
|
71890
|
+
map2.items.sort(schema.sortMapEntries);
|
|
73684
71891
|
}
|
|
73685
71892
|
return map2;
|
|
73686
71893
|
}
|
|
@@ -73773,7 +71980,7 @@ var require_map = __commonJS((exports) => {
|
|
|
73773
71980
|
onError("Expected a mapping for this tag");
|
|
73774
71981
|
return map3;
|
|
73775
71982
|
},
|
|
73776
|
-
createNode: (
|
|
71983
|
+
createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
|
|
73777
71984
|
};
|
|
73778
71985
|
exports.map = map2;
|
|
73779
71986
|
});
|
|
@@ -73791,8 +71998,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
73791
71998
|
static get tagName() {
|
|
73792
71999
|
return "tag:yaml.org,2002:seq";
|
|
73793
72000
|
}
|
|
73794
|
-
constructor(
|
|
73795
|
-
super(identity.SEQ,
|
|
72001
|
+
constructor(schema) {
|
|
72002
|
+
super(identity.SEQ, schema);
|
|
73796
72003
|
this.items = [];
|
|
73797
72004
|
}
|
|
73798
72005
|
add(value) {
|
|
@@ -73846,9 +72053,9 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
73846
72053
|
onComment
|
|
73847
72054
|
});
|
|
73848
72055
|
}
|
|
73849
|
-
static from(
|
|
72056
|
+
static from(schema, obj, ctx) {
|
|
73850
72057
|
const { replacer } = ctx;
|
|
73851
|
-
const seq = new this(
|
|
72058
|
+
const seq = new this(schema);
|
|
73852
72059
|
if (obj && Symbol.iterator in Object(obj)) {
|
|
73853
72060
|
let i = 0;
|
|
73854
72061
|
for (let it of obj) {
|
|
@@ -73885,7 +72092,7 @@ var require_seq = __commonJS((exports) => {
|
|
|
73885
72092
|
onError("Expected a sequence for this tag");
|
|
73886
72093
|
return seq2;
|
|
73887
72094
|
},
|
|
73888
|
-
createNode: (
|
|
72095
|
+
createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)
|
|
73889
72096
|
};
|
|
73890
72097
|
exports.seq = seq;
|
|
73891
72098
|
});
|
|
@@ -74060,7 +72267,7 @@ var require_schema = __commonJS((exports) => {
|
|
|
74060
72267
|
var bool = require_bool();
|
|
74061
72268
|
var float = require_float();
|
|
74062
72269
|
var int2 = require_int();
|
|
74063
|
-
var
|
|
72270
|
+
var schema = [
|
|
74064
72271
|
map2.map,
|
|
74065
72272
|
seq.seq,
|
|
74066
72273
|
string4.string,
|
|
@@ -74073,7 +72280,7 @@ var require_schema = __commonJS((exports) => {
|
|
|
74073
72280
|
float.floatExp,
|
|
74074
72281
|
float.float
|
|
74075
72282
|
];
|
|
74076
|
-
exports.schema =
|
|
72283
|
+
exports.schema = schema;
|
|
74077
72284
|
});
|
|
74078
72285
|
|
|
74079
72286
|
// ../../node_modules/yaml/dist/schema/json/schema.js
|
|
@@ -74136,8 +72343,8 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
74136
72343
|
return str;
|
|
74137
72344
|
}
|
|
74138
72345
|
};
|
|
74139
|
-
var
|
|
74140
|
-
exports.schema =
|
|
72346
|
+
var schema = [map2.map, seq.seq].concat(jsonScalars, jsonError);
|
|
72347
|
+
exports.schema = schema;
|
|
74141
72348
|
});
|
|
74142
72349
|
|
|
74143
72350
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
@@ -74227,9 +72434,9 @@ ${cn.comment}` : item.comment;
|
|
|
74227
72434
|
onError("Expected a sequence for this tag");
|
|
74228
72435
|
return seq;
|
|
74229
72436
|
}
|
|
74230
|
-
function createPairs(
|
|
72437
|
+
function createPairs(schema, iterable, ctx) {
|
|
74231
72438
|
const { replacer } = ctx;
|
|
74232
|
-
const pairs2 = new YAMLSeq.YAMLSeq(
|
|
72439
|
+
const pairs2 = new YAMLSeq.YAMLSeq(schema);
|
|
74233
72440
|
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
74234
72441
|
let i = 0;
|
|
74235
72442
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
@@ -74308,8 +72515,8 @@ var require_omap = __commonJS((exports) => {
|
|
|
74308
72515
|
}
|
|
74309
72516
|
return map2;
|
|
74310
72517
|
}
|
|
74311
|
-
static from(
|
|
74312
|
-
const pairs$1 = pairs.createPairs(
|
|
72518
|
+
static from(schema, iterable, ctx) {
|
|
72519
|
+
const pairs$1 = pairs.createPairs(schema, iterable, ctx);
|
|
74313
72520
|
const omap2 = new this;
|
|
74314
72521
|
omap2.items = pairs$1.items;
|
|
74315
72522
|
return omap2;
|
|
@@ -74336,7 +72543,7 @@ var require_omap = __commonJS((exports) => {
|
|
|
74336
72543
|
}
|
|
74337
72544
|
return Object.assign(new YAMLOMap, pairs$1);
|
|
74338
72545
|
},
|
|
74339
|
-
createNode: (
|
|
72546
|
+
createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
|
|
74340
72547
|
};
|
|
74341
72548
|
exports.YAMLOMap = YAMLOMap;
|
|
74342
72549
|
exports.omap = omap;
|
|
@@ -74500,8 +72707,8 @@ var require_set = __commonJS((exports) => {
|
|
|
74500
72707
|
var YAMLMap = require_YAMLMap();
|
|
74501
72708
|
|
|
74502
72709
|
class YAMLSet extends YAMLMap.YAMLMap {
|
|
74503
|
-
constructor(
|
|
74504
|
-
super(
|
|
72710
|
+
constructor(schema) {
|
|
72711
|
+
super(schema);
|
|
74505
72712
|
this.tag = YAMLSet.tag;
|
|
74506
72713
|
}
|
|
74507
72714
|
add(key) {
|
|
@@ -74541,9 +72748,9 @@ var require_set = __commonJS((exports) => {
|
|
|
74541
72748
|
else
|
|
74542
72749
|
throw new Error("Set items must all have null values");
|
|
74543
72750
|
}
|
|
74544
|
-
static from(
|
|
72751
|
+
static from(schema, iterable, ctx) {
|
|
74545
72752
|
const { replacer } = ctx;
|
|
74546
|
-
const set3 = new this(
|
|
72753
|
+
const set3 = new this(schema);
|
|
74547
72754
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
74548
72755
|
for (let value of iterable) {
|
|
74549
72756
|
if (typeof replacer === "function")
|
|
@@ -74560,7 +72767,7 @@ var require_set = __commonJS((exports) => {
|
|
|
74560
72767
|
nodeClass: YAMLSet,
|
|
74561
72768
|
default: false,
|
|
74562
72769
|
tag: "tag:yaml.org,2002:set",
|
|
74563
|
-
createNode: (
|
|
72770
|
+
createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
|
|
74564
72771
|
resolve(map2, onError) {
|
|
74565
72772
|
if (identity.isMap(map2)) {
|
|
74566
72773
|
if (map2.hasAllNullValues(true))
|
|
@@ -74673,7 +72880,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
74673
72880
|
var pairs = require_pairs();
|
|
74674
72881
|
var set2 = require_set();
|
|
74675
72882
|
var timestamp = require_timestamp();
|
|
74676
|
-
var
|
|
72883
|
+
var schema = [
|
|
74677
72884
|
map2.map,
|
|
74678
72885
|
seq.seq,
|
|
74679
72886
|
string4.string,
|
|
@@ -74696,7 +72903,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
74696
72903
|
timestamp.floatTime,
|
|
74697
72904
|
timestamp.timestamp
|
|
74698
72905
|
];
|
|
74699
|
-
exports.schema =
|
|
72906
|
+
exports.schema = schema;
|
|
74700
72907
|
});
|
|
74701
72908
|
|
|
74702
72909
|
// ../../node_modules/yaml/dist/schema/tags.js
|
|
@@ -74708,7 +72915,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
74708
72915
|
var bool = require_bool();
|
|
74709
72916
|
var float = require_float();
|
|
74710
72917
|
var int2 = require_int();
|
|
74711
|
-
var
|
|
72918
|
+
var schema = require_schema();
|
|
74712
72919
|
var schema$1 = require_schema2();
|
|
74713
72920
|
var binary = require_binary();
|
|
74714
72921
|
var merge3 = require_merge();
|
|
@@ -74718,7 +72925,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
74718
72925
|
var set2 = require_set();
|
|
74719
72926
|
var timestamp = require_timestamp();
|
|
74720
72927
|
var schemas3 = new Map([
|
|
74721
|
-
["core",
|
|
72928
|
+
["core", schema.schema],
|
|
74722
72929
|
["failsafe", [map2.map, seq.seq, string4.string]],
|
|
74723
72930
|
["json", schema$1.schema],
|
|
74724
72931
|
["yaml11", schema$2.schema],
|
|
@@ -74800,9 +73007,9 @@ var require_Schema = __commonJS((exports) => {
|
|
|
74800
73007
|
var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
74801
73008
|
|
|
74802
73009
|
class Schema {
|
|
74803
|
-
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema
|
|
73010
|
+
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
|
|
74804
73011
|
this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
|
|
74805
|
-
this.name = typeof
|
|
73012
|
+
this.name = typeof schema === "string" && schema || "core";
|
|
74806
73013
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
74807
73014
|
this.tags = tags.getTags(customTags, this.name, merge3);
|
|
74808
73015
|
this.toStringOptions = toStringDefaults ?? null;
|
|
@@ -76295,11 +74502,11 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
76295
74502
|
scalar.comment = comment;
|
|
76296
74503
|
return scalar;
|
|
76297
74504
|
}
|
|
76298
|
-
function findScalarTagByName(
|
|
74505
|
+
function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
|
76299
74506
|
if (tagName === "!")
|
|
76300
|
-
return
|
|
74507
|
+
return schema[identity.SCALAR];
|
|
76301
74508
|
const matchWithTest = [];
|
|
76302
|
-
for (const tag of
|
|
74509
|
+
for (const tag of schema.tags) {
|
|
76303
74510
|
if (!tag.collection && tag.tag === tagName) {
|
|
76304
74511
|
if (tag.default && tag.test)
|
|
76305
74512
|
matchWithTest.push(tag);
|
|
@@ -76310,18 +74517,18 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
76310
74517
|
for (const tag of matchWithTest)
|
|
76311
74518
|
if (tag.test?.test(value))
|
|
76312
74519
|
return tag;
|
|
76313
|
-
const kt =
|
|
74520
|
+
const kt = schema.knownTags[tagName];
|
|
76314
74521
|
if (kt && !kt.collection) {
|
|
76315
|
-
|
|
74522
|
+
schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));
|
|
76316
74523
|
return kt;
|
|
76317
74524
|
}
|
|
76318
74525
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
76319
|
-
return
|
|
74526
|
+
return schema[identity.SCALAR];
|
|
76320
74527
|
}
|
|
76321
|
-
function findScalarTagByTest({ atKey, directives, schema
|
|
76322
|
-
const tag =
|
|
76323
|
-
if (
|
|
76324
|
-
const compat2 =
|
|
74528
|
+
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
74529
|
+
const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity.SCALAR];
|
|
74530
|
+
if (schema.compat) {
|
|
74531
|
+
const compat2 = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR];
|
|
76325
74532
|
if (tag.tag !== compat2.tag) {
|
|
76326
74533
|
const ts = directives.tagString(tag.tag);
|
|
76327
74534
|
const cs = directives.tagString(compat2.tag);
|
|
@@ -78816,7 +77023,7 @@ var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE,
|
|
|
78816
77023
|
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
78817
77024
|
};
|
|
78818
77025
|
}, dist_default;
|
|
78819
|
-
var
|
|
77026
|
+
var init_dist = __esm(() => {
|
|
78820
77027
|
init_utils2();
|
|
78821
77028
|
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
78822
77029
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
@@ -78833,8 +77040,8 @@ var init_dist2 = __esm(() => {
|
|
|
78833
77040
|
var NO_TRUNCATION2, fastStringWidth = (input, options = {}) => {
|
|
78834
77041
|
return dist_default(input, NO_TRUNCATION2, options).width;
|
|
78835
77042
|
}, dist_default2;
|
|
78836
|
-
var
|
|
78837
|
-
|
|
77043
|
+
var init_dist2 = __esm(() => {
|
|
77044
|
+
init_dist();
|
|
78838
77045
|
NO_TRUNCATION2 = {
|
|
78839
77046
|
limit: Infinity,
|
|
78840
77047
|
ellipsis: "",
|
|
@@ -79040,7 +77247,7 @@ var ESC = "\x1B", CSI = "", END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI
|
|
|
79040
77247
|
return returnValue;
|
|
79041
77248
|
}, CRLF_OR_LF;
|
|
79042
77249
|
var init_main = __esm(() => {
|
|
79043
|
-
|
|
77250
|
+
init_dist2();
|
|
79044
77251
|
ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
79045
77252
|
GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
79046
77253
|
CRLF_OR_LF = /\r?\n/;
|
|
@@ -79388,7 +77595,7 @@ var import_sisteransi, G, K, h, Y, k, A = (r) => ("columns" in r) && typeof r.co
|
|
|
79388
77595
|
}
|
|
79389
77596
|
}
|
|
79390
77597
|
}, Q, X, Z, et, it, rt, nt, ot, ut, at, ht;
|
|
79391
|
-
var
|
|
77598
|
+
var init_dist3 = __esm(() => {
|
|
79392
77599
|
init_main();
|
|
79393
77600
|
import_sisteransi = __toESM(require_src2(), 1);
|
|
79394
77601
|
G = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
@@ -80728,11 +78935,11 @@ ${c2}
|
|
|
80728
78935
|
}
|
|
80729
78936
|
}
|
|
80730
78937
|
} }).prompt();
|
|
80731
|
-
var
|
|
80732
|
-
|
|
80733
|
-
init_dist4();
|
|
80734
|
-
init_main();
|
|
78938
|
+
var init_dist4 = __esm(() => {
|
|
78939
|
+
init_dist3();
|
|
80735
78940
|
init_dist3();
|
|
78941
|
+
init_main();
|
|
78942
|
+
init_dist2();
|
|
80736
78943
|
import_sisteransi2 = __toESM(require_src2(), 1);
|
|
80737
78944
|
tt2 = te();
|
|
80738
78945
|
_t = w2("◆", "*");
|
|
@@ -169586,11 +167793,11 @@ function chooseDescription(descriptions, printWidth) {
|
|
|
169586
167793
|
return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
|
|
169587
167794
|
}
|
|
169588
167795
|
function createSchema(SchemaConstructor, parameters) {
|
|
169589
|
-
const
|
|
169590
|
-
const subSchema = Object.create(
|
|
167796
|
+
const schema = new SchemaConstructor(parameters);
|
|
167797
|
+
const subSchema = Object.create(schema);
|
|
169591
167798
|
for (const handlerKey of HANDLER_KEYS) {
|
|
169592
167799
|
if (handlerKey in parameters) {
|
|
169593
|
-
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey],
|
|
167800
|
+
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema, Schema.prototype[handlerKey].length);
|
|
169594
167801
|
}
|
|
169595
167802
|
}
|
|
169596
167803
|
return subSchema;
|
|
@@ -172930,9 +171137,9 @@ function optionInfoToSchema(optionInfo, {
|
|
|
172930
171137
|
throw new Error(`Unexpected type ${optionInfo.type}`);
|
|
172931
171138
|
}
|
|
172932
171139
|
if (optionInfo.exception) {
|
|
172933
|
-
parameters.validate = (value,
|
|
171140
|
+
parameters.validate = (value, schema, utils2) => optionInfo.exception(value) || schema.validate(value, utils2);
|
|
172934
171141
|
} else {
|
|
172935
|
-
parameters.validate = (value,
|
|
171142
|
+
parameters.validate = (value, schema, utils2) => value === undefined || schema.validate(value, utils2);
|
|
172936
171143
|
}
|
|
172937
171144
|
if (optionInfo.redirect) {
|
|
172938
171145
|
handlers.redirect = (value) => !value ? undefined : {
|
|
@@ -172947,7 +171154,7 @@ function optionInfoToSchema(optionInfo, {
|
|
|
172947
171154
|
}
|
|
172948
171155
|
if (isCLI && !optionInfo.array) {
|
|
172949
171156
|
const originalPreprocess = parameters.preprocess || ((x10) => x10);
|
|
172950
|
-
parameters.preprocess = (value,
|
|
171157
|
+
parameters.preprocess = (value, schema, utils2) => schema.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils2);
|
|
172951
171158
|
}
|
|
172952
171159
|
return optionInfo.array ? ArraySchema.create({
|
|
172953
171160
|
...isCLI ? {
|
|
@@ -174524,9 +172731,9 @@ var require3, __filename2, __dirname2, __create2, __defProp3, __getOwnPropDesc,
|
|
|
174524
172731
|
};
|
|
174525
172732
|
applyNormalization();
|
|
174526
172733
|
for (const key2 of Object.keys(this._utils.schemas)) {
|
|
174527
|
-
const
|
|
172734
|
+
const schema = this._utils.schemas[key2];
|
|
174528
172735
|
if (!(key2 in newOptions)) {
|
|
174529
|
-
const defaultResult = normalizeDefaultResult(
|
|
172736
|
+
const defaultResult = normalizeDefaultResult(schema.default(this._utils));
|
|
174530
172737
|
if ("value" in defaultResult) {
|
|
174531
172738
|
restOptionsArray.push({ [key2]: defaultResult.value });
|
|
174532
172739
|
}
|
|
@@ -174537,13 +172744,13 @@ var require3, __filename2, __dirname2, __create2, __defProp3, __getOwnPropDesc,
|
|
|
174537
172744
|
if (!(key2 in newOptions)) {
|
|
174538
172745
|
continue;
|
|
174539
172746
|
}
|
|
174540
|
-
const
|
|
172747
|
+
const schema = this._utils.schemas[key2];
|
|
174541
172748
|
const value = newOptions[key2];
|
|
174542
|
-
const newValue =
|
|
172749
|
+
const newValue = schema.postprocess(value, this._utils);
|
|
174543
172750
|
if (newValue === VALUE_UNCHANGED) {
|
|
174544
172751
|
continue;
|
|
174545
172752
|
}
|
|
174546
|
-
this._applyValidation(newValue, key2,
|
|
172753
|
+
this._applyValidation(newValue, key2, schema);
|
|
174547
172754
|
newOptions[key2] = newValue;
|
|
174548
172755
|
}
|
|
174549
172756
|
this._applyPostprocess(newOptions);
|
|
@@ -174554,14 +172761,14 @@ var require3, __filename2, __dirname2, __create2, __defProp3, __getOwnPropDesc,
|
|
|
174554
172761
|
const transferredOptionsArray = [];
|
|
174555
172762
|
const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
|
|
174556
172763
|
for (const key2 of knownKeys) {
|
|
174557
|
-
const
|
|
174558
|
-
const value =
|
|
174559
|
-
this._applyValidation(value, key2,
|
|
172764
|
+
const schema = this._utils.schemas[key2];
|
|
172765
|
+
const value = schema.preprocess(options8[key2], this._utils);
|
|
172766
|
+
this._applyValidation(value, key2, schema);
|
|
174560
172767
|
const appendTransferredOptions = ({ from, to: to5 }) => {
|
|
174561
172768
|
transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
|
|
174562
172769
|
};
|
|
174563
172770
|
const warnDeprecated = ({ value: currentValue, redirectTo }) => {
|
|
174564
|
-
const deprecatedResult = normalizeDeprecatedResult(
|
|
172771
|
+
const deprecatedResult = normalizeDeprecatedResult(schema.deprecated(currentValue, this._utils), value, true);
|
|
174565
172772
|
if (deprecatedResult === false) {
|
|
174566
172773
|
return;
|
|
174567
172774
|
}
|
|
@@ -174579,13 +172786,13 @@ var require3, __filename2, __dirname2, __create2, __defProp3, __getOwnPropDesc,
|
|
|
174579
172786
|
}
|
|
174580
172787
|
}
|
|
174581
172788
|
};
|
|
174582
|
-
const forwardResult = normalizeForwardResult(
|
|
172789
|
+
const forwardResult = normalizeForwardResult(schema.forward(value, this._utils), value);
|
|
174583
172790
|
forwardResult.forEach(appendTransferredOptions);
|
|
174584
|
-
const redirectResult = normalizeRedirectResult(
|
|
172791
|
+
const redirectResult = normalizeRedirectResult(schema.redirect(value, this._utils), value);
|
|
174585
172792
|
redirectResult.redirect.forEach(appendTransferredOptions);
|
|
174586
172793
|
if ("remain" in redirectResult) {
|
|
174587
172794
|
const remainingValue = redirectResult.remain;
|
|
174588
|
-
newOptions[key2] = key2 in newOptions ?
|
|
172795
|
+
newOptions[key2] = key2 in newOptions ? schema.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
|
|
174589
172796
|
warnDeprecated({ value: remainingValue });
|
|
174590
172797
|
}
|
|
174591
172798
|
for (const { from, to: to5 } of redirectResult.redirect) {
|
|
@@ -174613,8 +172820,8 @@ var require3, __filename2, __dirname2, __create2, __defProp3, __getOwnPropDesc,
|
|
|
174613
172820
|
const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
|
|
174614
172821
|
return { knownKeys, unknownKeys };
|
|
174615
172822
|
}
|
|
174616
|
-
_applyValidation(value, key2,
|
|
174617
|
-
const validateResult = normalizeValidateResult(
|
|
172823
|
+
_applyValidation(value, key2, schema) {
|
|
172824
|
+
const validateResult = normalizeValidateResult(schema.validate(value, this._utils), value);
|
|
174618
172825
|
if (validateResult !== true) {
|
|
174619
172826
|
throw this._invalidHandler(key2, validateResult.value, this._utils);
|
|
174620
172827
|
}
|
|
@@ -174656,8 +172863,8 @@ var require3, __filename2, __dirname2, __create2, __defProp3, __getOwnPropDesc,
|
|
|
174656
172863
|
for (const key2 of unknownKeys) {
|
|
174657
172864
|
const value = postprocessed.override[key2];
|
|
174658
172865
|
this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
|
|
174659
|
-
const
|
|
174660
|
-
this._applyValidation(knownResultValue, knownResultKey,
|
|
172866
|
+
const schema = this._utils.schemas[knownResultKey];
|
|
172867
|
+
this._applyValidation(knownResultValue, knownResultKey, schema);
|
|
174661
172868
|
options8[knownResultKey] = knownResultValue;
|
|
174662
172869
|
});
|
|
174663
172870
|
}
|
|
@@ -186450,7 +184657,7 @@ import { fileURLToPath as fileURLToPath9 } from "url";
|
|
|
186450
184657
|
// package.json
|
|
186451
184658
|
var package_default = {
|
|
186452
184659
|
name: "@eigenpal/cli",
|
|
186453
|
-
version: "0.10.
|
|
184660
|
+
version: "0.10.44",
|
|
186454
184661
|
description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
|
|
186455
184662
|
keywords: [
|
|
186456
184663
|
"eigenpal",
|
|
@@ -188145,7 +186352,7 @@ async function readSecretInput(opts) {
|
|
|
188145
186352
|
if (opts.valueFile)
|
|
188146
186353
|
return readFileSync5(opts.valueFile, "utf8").replace(/\n$/, "");
|
|
188147
186354
|
if (process.stdin.isTTY && process.stdout.isTTY) {
|
|
188148
|
-
const { password, isCancel, cancel } = await Promise.resolve().then(() => (
|
|
186355
|
+
const { password, isCancel, cancel } = await Promise.resolve().then(() => (init_dist4(), exports_dist));
|
|
188149
186356
|
const answer = await password({ message: "Secret value" });
|
|
188150
186357
|
if (isCancel(answer)) {
|
|
188151
186358
|
cancel("Cancelled");
|
|
@@ -190119,8 +188326,8 @@ async function loadOptionalWorkspaceSchema(agentDir, filename, errors3) {
|
|
|
190119
188326
|
return null;
|
|
190120
188327
|
return JSON.parse(raw);
|
|
190121
188328
|
}
|
|
190122
|
-
function schemaProperties(
|
|
190123
|
-
const props =
|
|
188329
|
+
function schemaProperties(schema) {
|
|
188330
|
+
const props = schema.properties;
|
|
190124
188331
|
if (!props || typeof props !== "object" || Array.isArray(props))
|
|
190125
188332
|
return {};
|
|
190126
188333
|
return props;
|
|
@@ -190155,8 +188362,8 @@ function allowFileRefsInSchema(node) {
|
|
|
190155
188362
|
out[key] = allowFileRefsInSchema(value);
|
|
190156
188363
|
return out;
|
|
190157
188364
|
}
|
|
190158
|
-
function validateValuesAgainstSchemaProps(data,
|
|
190159
|
-
const props = schemaProperties(
|
|
188365
|
+
function validateValuesAgainstSchemaProps(data, schema, label) {
|
|
188366
|
+
const props = schemaProperties(schema);
|
|
190160
188367
|
const errors3 = [];
|
|
190161
188368
|
for (const [key, value] of Object.entries(data)) {
|
|
190162
188369
|
const propSchema = props[key];
|
|
@@ -190170,9 +188377,9 @@ function validateValuesAgainstSchemaProps(data, schema2, label) {
|
|
|
190170
188377
|
}
|
|
190171
188378
|
return errors3;
|
|
190172
188379
|
}
|
|
190173
|
-
function validateValueAgainstSchema(value,
|
|
188380
|
+
function validateValueAgainstSchema(value, schema, label) {
|
|
190174
188381
|
try {
|
|
190175
|
-
const validate = eigenpalAjv.compile(
|
|
188382
|
+
const validate = eigenpalAjv.compile(schema);
|
|
190176
188383
|
if (validate(value))
|
|
190177
188384
|
return [];
|
|
190178
188385
|
return (validate.errors ?? []).map((err2) => {
|
|
@@ -191356,7 +189563,7 @@ function preview(value) {
|
|
|
191356
189563
|
text = String(value);
|
|
191357
189564
|
return text.length > MAX_VALUE_LEN ? `${text.slice(0, MAX_VALUE_LEN)}…` : text;
|
|
191358
189565
|
}
|
|
191359
|
-
function
|
|
189566
|
+
function isPlainObject3(value) {
|
|
191360
189567
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
191361
189568
|
}
|
|
191362
189569
|
function joinPath(path15, key2) {
|
|
@@ -191377,8 +189584,8 @@ function walk(expected, actual, path15, diffs) {
|
|
|
191377
189584
|
}
|
|
191378
189585
|
return;
|
|
191379
189586
|
}
|
|
191380
|
-
if (
|
|
191381
|
-
if (!
|
|
189587
|
+
if (isPlainObject3(expected)) {
|
|
189588
|
+
if (!isPlainObject3(actual)) {
|
|
191382
189589
|
diffs.push(`${path15 || "(root)"}: expected object, got ${preview(actual)}`);
|
|
191383
189590
|
return;
|
|
191384
189591
|
}
|
|
@@ -192937,7 +191144,7 @@ async function validateAgentCommand(dir = ".", opts) {
|
|
|
192937
191144
|
}
|
|
192938
191145
|
|
|
192939
191146
|
// src/commands/auth/index.ts
|
|
192940
|
-
|
|
191147
|
+
init_dist4();
|
|
192941
191148
|
import { exec as exec2 } from "child_process";
|
|
192942
191149
|
var CLOUD_BASE_URL = "https://studio.eigenpal.com";
|
|
192943
191150
|
function openBrowser(url3) {
|
|
@@ -193386,7 +191593,7 @@ async function completion(shell, program2) {
|
|
|
193386
191593
|
}
|
|
193387
191594
|
|
|
193388
191595
|
// src/commands/init/index.ts
|
|
193389
|
-
|
|
191596
|
+
init_dist4();
|
|
193390
191597
|
import {
|
|
193391
191598
|
copyFileSync,
|
|
193392
191599
|
existsSync as existsSync13,
|
|
@@ -193730,7 +191937,7 @@ async function rerunTarget(runId, opts) {
|
|
|
193730
191937
|
}
|
|
193731
191938
|
|
|
193732
191939
|
// src/commands/skill/index.ts
|
|
193733
|
-
|
|
191940
|
+
init_dist4();
|
|
193734
191941
|
import { createHash as createHash4 } from "node:crypto";
|
|
193735
191942
|
import {
|
|
193736
191943
|
existsSync as existsSync15,
|
|
@@ -195009,9 +193216,9 @@ function scanValue(value, path16, inScope, out) {
|
|
|
195009
193216
|
}
|
|
195010
193217
|
function walkStep(step, basePath, out) {
|
|
195011
193218
|
if (step.type === "ai.extract") {
|
|
195012
|
-
const
|
|
195013
|
-
if (
|
|
195014
|
-
walkSchema(
|
|
193219
|
+
const schema = step.with?.schema;
|
|
193220
|
+
if (schema && typeof schema === "object") {
|
|
193221
|
+
walkSchema(schema, `${basePath}.with.schema`, out);
|
|
195015
193222
|
}
|
|
195016
193223
|
return;
|
|
195017
193224
|
}
|
|
@@ -195034,8 +193241,8 @@ function walkStep(step, basePath, out) {
|
|
|
195034
193241
|
});
|
|
195035
193242
|
}
|
|
195036
193243
|
}
|
|
195037
|
-
const
|
|
195038
|
-
if (
|
|
193244
|
+
const schema = compiled.result.returnSchema;
|
|
193245
|
+
if (schema.type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0) && schema.additionalProperties !== false) {
|
|
195039
193246
|
out.push({
|
|
195040
193247
|
code: "untyped-object",
|
|
195041
193248
|
field: `${basePath}.with.function`,
|
|
@@ -195068,9 +193275,9 @@ function walkStep(step, basePath, out) {
|
|
|
195068
193275
|
}
|
|
195069
193276
|
}
|
|
195070
193277
|
}
|
|
195071
|
-
function walkSchema(
|
|
195072
|
-
const type =
|
|
195073
|
-
if (type === "object" && (!
|
|
193278
|
+
function walkSchema(schema, basePath, out) {
|
|
193279
|
+
const type = schema.type;
|
|
193280
|
+
if (type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0) && schema.additionalProperties !== false) {
|
|
195074
193281
|
out.push({
|
|
195075
193282
|
code: "untyped-object",
|
|
195076
193283
|
field: basePath,
|
|
@@ -195078,7 +193285,7 @@ function walkSchema(schema2, basePath, out) {
|
|
|
195078
193285
|
hint: "Add concrete fields under `properties`, or set `additionalProperties: false` if the object is intentionally open."
|
|
195079
193286
|
});
|
|
195080
193287
|
}
|
|
195081
|
-
if (type === "array" && (
|
|
193288
|
+
if (type === "array" && (schema.items === undefined || isEmptyObject(schema.items))) {
|
|
195082
193289
|
out.push({
|
|
195083
193290
|
code: "untyped-array-items",
|
|
195084
193291
|
field: basePath,
|
|
@@ -195086,8 +193293,8 @@ function walkSchema(schema2, basePath, out) {
|
|
|
195086
193293
|
hint: "Add an `items:` block describing the element type, e.g. `items: { type: object, properties: { ... } }`."
|
|
195087
193294
|
});
|
|
195088
193295
|
}
|
|
195089
|
-
if (
|
|
195090
|
-
for (const [name, raw] of Object.entries(
|
|
193296
|
+
if (schema.properties && typeof schema.properties === "object") {
|
|
193297
|
+
for (const [name, raw] of Object.entries(schema.properties)) {
|
|
195091
193298
|
if (!raw || typeof raw !== "object")
|
|
195092
193299
|
continue;
|
|
195093
193300
|
const prop = raw;
|
|
@@ -195109,8 +193316,8 @@ function walkSchema(schema2, basePath, out) {
|
|
|
195109
193316
|
walkSchema(prop, `${basePath}.properties.${name}`, out);
|
|
195110
193317
|
}
|
|
195111
193318
|
}
|
|
195112
|
-
if (
|
|
195113
|
-
walkSchema(
|
|
193319
|
+
if (schema.items && typeof schema.items === "object" && !Array.isArray(schema.items)) {
|
|
193320
|
+
walkSchema(schema.items, `${basePath}.items`, out);
|
|
195114
193321
|
}
|
|
195115
193322
|
}
|
|
195116
193323
|
function isEmptyObject(v11) {
|
|
@@ -195725,7 +193932,7 @@ flag would otherwise shadow it. Validation failures come back as
|
|
|
195725
193932
|
let filePath = opts.file;
|
|
195726
193933
|
if (!filePath) {
|
|
195727
193934
|
if (process.stdout.isTTY && process.stdin.isTTY) {
|
|
195728
|
-
const { text, isCancel, cancel } = await Promise.resolve().then(() => (
|
|
193935
|
+
const { text, isCancel, cancel } = await Promise.resolve().then(() => (init_dist4(), exports_dist));
|
|
195729
193936
|
const answer = await text({
|
|
195730
193937
|
message: "Path to workflow YAML",
|
|
195731
193938
|
placeholder: "workflow.yaml",
|