@eigenpal/cli 0.10.25 → 0.10.26
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/CHANGELOG.md +6 -0
- package/dist/cli.js +726 -5
- package/dist/skill/reference/step-types.md +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @eigenpal/cli
|
|
2
2
|
|
|
3
|
+
## 0.10.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f72e9e8: The step catalog now documents grounded extraction as the default: extract steps ship per-field confidence and source spans under the `_grounding` output key unless `grounded: false` is set.
|
|
8
|
+
|
|
3
9
|
## 0.10.24
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cli.js
CHANGED
|
@@ -62355,15 +62355,15 @@ var init_step_configs = __esm(() => {
|
|
|
62355
62355
|
provider: exports_external.string().optional().describe('Provider ID (e.g., "openai-gpt4o")'),
|
|
62356
62356
|
model: exports_external.string().optional().describe("Model override"),
|
|
62357
62357
|
maxInputTokens: exports_external.number().int().optional().describe("Max input tokens. Truncates input text and logs a warning when exceeded. Omit for no limit."),
|
|
62358
|
-
grounded: exports_external.boolean().optional().describe("
|
|
62359
|
-
groundingModel: exports_external.string().optional().describe("Provider/model for the grounding pass. Defaults to the workspace default LLM.
|
|
62358
|
+
grounded: exports_external.boolean().optional().describe("Grounding is ON by default: each schema field gets a source span + confidence (high=verbatim, medium=fuzzy, low=ungrounded) under a reserved `_grounding` output key, and fields whose value cannot be located in the source are flagged for human review. Values stay the reliable schema-typed ones. The pass runs through the workspace LLM (any provider) and chunks long documents automatically. Tri-state: unset (default) = on, degrading gracefully to deterministic text alignment (`_grounding._degraded: true`) if no grounding model is available; `true` = strict, the step fails when the grounding model cannot be resolved; `false` = off, no `_grounding` key at all."),
|
|
62359
|
+
groundingModel: exports_external.string().optional().describe("Provider/model for the grounding pass. Defaults to the workspace default LLM. Any configured provider works; the pass only fails the step when `grounded: true` is set explicitly and no model resolves."),
|
|
62360
62360
|
groundingExamples: exports_external.array(exports_external.object({
|
|
62361
62361
|
text: exports_external.string(),
|
|
62362
62362
|
extractions: exports_external.array(exports_external.object({ field: exports_external.string(), text: exports_external.string() }))
|
|
62363
62363
|
})).optional().describe("Optional few-shot examples pinning grounding to verbatim source text per field."),
|
|
62364
|
-
reviewOn: exports_external.enum(["medium_or_low", "low_only"]).optional().describe("Which grounding confidences
|
|
62364
|
+
reviewOn: exports_external.enum(["medium_or_low", "low_only"]).optional().describe("Which grounding confidences set needsReview on a field. Default: low_only (only fields whose value could not be located in the source). Use medium_or_low to also flag approximate and derived matches.")
|
|
62365
62365
|
});
|
|
62366
|
-
AiExtractOutputSchema = exports_external.record(exports_external.string(), exports_external.unknown()).describe("Extracted structured data matching the provided schema");
|
|
62366
|
+
AiExtractOutputSchema = exports_external.record(exports_external.string(), exports_external.unknown()).describe("Extracted structured data matching the provided schema. Unless grounding is disabled (grounded: false), the output also carries a reserved `_grounding` map keyed by field name: `_grounding.<field> = { confidence: high|medium|low, needsReview, reason?, source_span: { start, end, text, alignment } | null }`, plus reserved `_degraded: true` / `_reason` markers when the grounding LLM pass could not run.");
|
|
62367
62367
|
AiSplitConfigSchema = exports_external.object({
|
|
62368
62368
|
input: exports_external.string().describe('Template expression resolving to ai.parse output, e.g. "{{ steps.parse.output }}"'),
|
|
62369
62369
|
sections: exports_external.array(exports_external.object({
|
|
@@ -66252,6 +66252,663 @@ var init_webhooks = __esm(() => {
|
|
|
66252
66252
|
});
|
|
66253
66253
|
});
|
|
66254
66254
|
|
|
66255
|
+
// ../types/src/ocr/parsed-document.ts
|
|
66256
|
+
var BoundingBoxSchema, PointSchema2, PolygonSchema, PAGE_BLOCK_KINDS, PageBlockKindSchema, PageBlockSchema, REGION_TYPES, RegionTypeSchema, RegionSchema, CONTENT_KINDS, ContentKindSchema, RegionContentSchema, Sha256HexSchema, ChunkProvenanceSpanSchema, ExtractionChunkSchema, ParsedDocumentSchema;
|
|
66257
|
+
var init_parsed_document = __esm(() => {
|
|
66258
|
+
init_zod();
|
|
66259
|
+
BoundingBoxSchema = exports_external.object({
|
|
66260
|
+
left: exports_external.number().int().min(0),
|
|
66261
|
+
top: exports_external.number().int().min(0),
|
|
66262
|
+
right: exports_external.number().int().positive(),
|
|
66263
|
+
bottom: exports_external.number().int().positive()
|
|
66264
|
+
}).strict().superRefine((box, ctx) => {
|
|
66265
|
+
if (box.right <= box.left || box.bottom <= box.top) {
|
|
66266
|
+
ctx.addIssue({
|
|
66267
|
+
code: "custom",
|
|
66268
|
+
message: "bounding box must have positive area"
|
|
66269
|
+
});
|
|
66270
|
+
}
|
|
66271
|
+
});
|
|
66272
|
+
PointSchema2 = exports_external.object({
|
|
66273
|
+
x: exports_external.number().min(0),
|
|
66274
|
+
y: exports_external.number().min(0)
|
|
66275
|
+
}).strict();
|
|
66276
|
+
PolygonSchema = exports_external.array(PointSchema2).min(3);
|
|
66277
|
+
PAGE_BLOCK_KINDS = ["text", "table", "figure"];
|
|
66278
|
+
PageBlockKindSchema = exports_external.enum(PAGE_BLOCK_KINDS);
|
|
66279
|
+
PageBlockSchema = exports_external.object({
|
|
66280
|
+
index: exports_external.number().int().min(0),
|
|
66281
|
+
page_number: exports_external.number().int().min(1),
|
|
66282
|
+
kind: PageBlockKindSchema,
|
|
66283
|
+
text: exports_external.string().nullable().optional(),
|
|
66284
|
+
table_html: exports_external.string().nullable().optional(),
|
|
66285
|
+
figure_uri: exports_external.string().nullable().optional(),
|
|
66286
|
+
bbox: BoundingBoxSchema.nullable().optional(),
|
|
66287
|
+
polygon: PolygonSchema.nullable().optional(),
|
|
66288
|
+
confidence: exports_external.number().min(0).max(1).nullable().optional(),
|
|
66289
|
+
source_label: exports_external.string().min(1).nullable().optional(),
|
|
66290
|
+
region_id: exports_external.string().min(1).nullable().optional(),
|
|
66291
|
+
coordinate_width: exports_external.number().int().positive().nullable().optional(),
|
|
66292
|
+
coordinate_height: exports_external.number().int().positive().nullable().optional()
|
|
66293
|
+
}).strict().superRefine((block, ctx) => {
|
|
66294
|
+
const widthNull = block.coordinate_width == null;
|
|
66295
|
+
const heightNull = block.coordinate_height == null;
|
|
66296
|
+
if (widthNull !== heightNull) {
|
|
66297
|
+
ctx.addIssue({
|
|
66298
|
+
code: "custom",
|
|
66299
|
+
message: "block coordinate dimensions must be provided together",
|
|
66300
|
+
path: ["coordinate_width"]
|
|
66301
|
+
});
|
|
66302
|
+
}
|
|
66303
|
+
if (block.kind === "text" && block.text == null) {
|
|
66304
|
+
ctx.addIssue({ code: "custom", message: "text blocks require text", path: ["text"] });
|
|
66305
|
+
}
|
|
66306
|
+
if (block.kind === "table" && block.table_html == null) {
|
|
66307
|
+
ctx.addIssue({
|
|
66308
|
+
code: "custom",
|
|
66309
|
+
message: "table blocks require table_html",
|
|
66310
|
+
path: ["table_html"]
|
|
66311
|
+
});
|
|
66312
|
+
}
|
|
66313
|
+
if (block.kind === "figure" && block.figure_uri == null) {
|
|
66314
|
+
ctx.addIssue({
|
|
66315
|
+
code: "custom",
|
|
66316
|
+
message: "figure blocks require figure_uri",
|
|
66317
|
+
path: ["figure_uri"]
|
|
66318
|
+
});
|
|
66319
|
+
}
|
|
66320
|
+
});
|
|
66321
|
+
REGION_TYPES = [
|
|
66322
|
+
"text",
|
|
66323
|
+
"heading",
|
|
66324
|
+
"table",
|
|
66325
|
+
"key_value",
|
|
66326
|
+
"figure",
|
|
66327
|
+
"checkbox",
|
|
66328
|
+
"signature",
|
|
66329
|
+
"barcode",
|
|
66330
|
+
"formula",
|
|
66331
|
+
"header_footer"
|
|
66332
|
+
];
|
|
66333
|
+
RegionTypeSchema = exports_external.enum(REGION_TYPES);
|
|
66334
|
+
RegionSchema = exports_external.object({
|
|
66335
|
+
id: exports_external.string().min(1),
|
|
66336
|
+
page_number: exports_external.number().int().min(1),
|
|
66337
|
+
type: RegionTypeSchema,
|
|
66338
|
+
bbox: BoundingBoxSchema,
|
|
66339
|
+
polygon: PolygonSchema.nullable().optional(),
|
|
66340
|
+
coordinate_width: exports_external.number().int().positive().nullable().optional(),
|
|
66341
|
+
coordinate_height: exports_external.number().int().positive().nullable().optional(),
|
|
66342
|
+
confidence: exports_external.number().min(0).max(1).nullable().optional(),
|
|
66343
|
+
source_label: exports_external.string().min(1).nullable().optional()
|
|
66344
|
+
}).strict().superRefine((region, ctx) => {
|
|
66345
|
+
if (region.coordinate_width == null !== (region.coordinate_height == null)) {
|
|
66346
|
+
ctx.addIssue({
|
|
66347
|
+
code: "custom",
|
|
66348
|
+
message: "region coordinate dimensions must be provided together",
|
|
66349
|
+
path: ["coordinate_width"]
|
|
66350
|
+
});
|
|
66351
|
+
}
|
|
66352
|
+
});
|
|
66353
|
+
CONTENT_KINDS = ["text", "table", "state", "figure"];
|
|
66354
|
+
ContentKindSchema = exports_external.enum(CONTENT_KINDS);
|
|
66355
|
+
RegionContentSchema = exports_external.object({
|
|
66356
|
+
region_id: exports_external.string().min(1),
|
|
66357
|
+
kind: ContentKindSchema,
|
|
66358
|
+
text: exports_external.string().nullable().optional(),
|
|
66359
|
+
table_html: exports_external.string().nullable().optional(),
|
|
66360
|
+
detected_state: exports_external.boolean().nullable().optional(),
|
|
66361
|
+
confidence: exports_external.number().min(0).max(1).nullable().optional()
|
|
66362
|
+
}).strict().superRefine((content, ctx) => {
|
|
66363
|
+
if (content.text == null && content.table_html == null && content.detected_state == null) {
|
|
66364
|
+
ctx.addIssue({
|
|
66365
|
+
code: "custom",
|
|
66366
|
+
message: "region content must contain a payload"
|
|
66367
|
+
});
|
|
66368
|
+
}
|
|
66369
|
+
if (content.kind === "table" && content.table_html == null) {
|
|
66370
|
+
ctx.addIssue({
|
|
66371
|
+
code: "custom",
|
|
66372
|
+
message: "table content requires table_html",
|
|
66373
|
+
path: ["table_html"]
|
|
66374
|
+
});
|
|
66375
|
+
}
|
|
66376
|
+
if (content.kind === "state" && content.detected_state == null) {
|
|
66377
|
+
ctx.addIssue({
|
|
66378
|
+
code: "custom",
|
|
66379
|
+
message: "state content requires detected_state",
|
|
66380
|
+
path: ["detected_state"]
|
|
66381
|
+
});
|
|
66382
|
+
}
|
|
66383
|
+
});
|
|
66384
|
+
Sha256HexSchema = exports_external.string().regex(/^[0-9a-f]{64}$/);
|
|
66385
|
+
ChunkProvenanceSpanSchema = exports_external.object({
|
|
66386
|
+
start_char: exports_external.number().int().min(0),
|
|
66387
|
+
end_char: exports_external.number().int().positive(),
|
|
66388
|
+
page_number: exports_external.number().int().min(1),
|
|
66389
|
+
bbox: BoundingBoxSchema,
|
|
66390
|
+
region_id: exports_external.string().min(1)
|
|
66391
|
+
}).strict().superRefine((span, ctx) => {
|
|
66392
|
+
if (span.end_char <= span.start_char) {
|
|
66393
|
+
ctx.addIssue({
|
|
66394
|
+
code: "custom",
|
|
66395
|
+
message: "chunk provenance span must have positive length"
|
|
66396
|
+
});
|
|
66397
|
+
}
|
|
66398
|
+
});
|
|
66399
|
+
ExtractionChunkSchema = exports_external.object({
|
|
66400
|
+
id: Sha256HexSchema,
|
|
66401
|
+
index: exports_external.number().int().min(0),
|
|
66402
|
+
document_id: exports_external.string().min(1),
|
|
66403
|
+
text: exports_external.string().min(1),
|
|
66404
|
+
content_sha256: Sha256HexSchema,
|
|
66405
|
+
page_numbers: exports_external.array(exports_external.number().int().min(1)).optional().default([]),
|
|
66406
|
+
page_start: exports_external.number().int().min(1).nullable().optional(),
|
|
66407
|
+
page_end: exports_external.number().int().min(1).nullable().optional(),
|
|
66408
|
+
region_ids: exports_external.array(exports_external.string().min(1)).optional().default([]),
|
|
66409
|
+
provenance_spans: exports_external.array(ChunkProvenanceSpanSchema).optional().default([])
|
|
66410
|
+
}).strict().superRefine((chunk, ctx) => {
|
|
66411
|
+
if (chunk.page_start == null !== (chunk.page_end == null)) {
|
|
66412
|
+
ctx.addIssue({
|
|
66413
|
+
code: "custom",
|
|
66414
|
+
message: "page_start and page_end must be provided together",
|
|
66415
|
+
path: ["page_start"]
|
|
66416
|
+
});
|
|
66417
|
+
}
|
|
66418
|
+
});
|
|
66419
|
+
ParsedDocumentSchema = exports_external.object({
|
|
66420
|
+
output_format: exports_external.literal("openparser@1"),
|
|
66421
|
+
document_id: exports_external.string().min(1),
|
|
66422
|
+
page_count: exports_external.number().int().min(0),
|
|
66423
|
+
markdown: exports_external.string(),
|
|
66424
|
+
blocks: exports_external.array(PageBlockSchema).min(1),
|
|
66425
|
+
regions: exports_external.array(RegionSchema).default([]),
|
|
66426
|
+
contents: exports_external.array(RegionContentSchema).default([]),
|
|
66427
|
+
chunks: exports_external.array(ExtractionChunkSchema).default([])
|
|
66428
|
+
}).strict().superRefine((doc2, ctx) => {
|
|
66429
|
+
const indexes = doc2.blocks.map((block) => block.index);
|
|
66430
|
+
for (let i = 0;i < indexes.length; i++) {
|
|
66431
|
+
if (indexes[i] !== i) {
|
|
66432
|
+
ctx.addIssue({
|
|
66433
|
+
code: "custom",
|
|
66434
|
+
message: "block indexes must be contiguous and zero-based",
|
|
66435
|
+
path: ["blocks", i, "index"]
|
|
66436
|
+
});
|
|
66437
|
+
break;
|
|
66438
|
+
}
|
|
66439
|
+
}
|
|
66440
|
+
for (const [i, block] of doc2.blocks.entries()) {
|
|
66441
|
+
if (block.page_number > doc2.page_count) {
|
|
66442
|
+
ctx.addIssue({
|
|
66443
|
+
code: "custom",
|
|
66444
|
+
message: "block page exceeds page_count",
|
|
66445
|
+
path: ["blocks", i, "page_number"]
|
|
66446
|
+
});
|
|
66447
|
+
}
|
|
66448
|
+
}
|
|
66449
|
+
for (const [i, region] of doc2.regions.entries()) {
|
|
66450
|
+
if (region.page_number > doc2.page_count) {
|
|
66451
|
+
ctx.addIssue({
|
|
66452
|
+
code: "custom",
|
|
66453
|
+
message: "region page exceeds page_count",
|
|
66454
|
+
path: ["regions", i, "page_number"]
|
|
66455
|
+
});
|
|
66456
|
+
}
|
|
66457
|
+
}
|
|
66458
|
+
});
|
|
66459
|
+
});
|
|
66460
|
+
|
|
66461
|
+
// ../types/src/ocr/extraction.ts
|
|
66462
|
+
var EXTRACTION_ATTEMPT_KINDS, ExtractionAttemptKindSchema, EXTRACTION_ATTEMPT_STATUSES, ExtractionAttemptStatusSchema, LlmModelSchema, ExtractionAttemptSchema, ExtractionUsageTotalsSchema, ExtractionTerminalResultSchema;
|
|
66463
|
+
var init_extraction = __esm(() => {
|
|
66464
|
+
init_zod();
|
|
66465
|
+
init_parsed_document();
|
|
66466
|
+
EXTRACTION_ATTEMPT_KINDS = ["primary", "repair"];
|
|
66467
|
+
ExtractionAttemptKindSchema = exports_external.enum(EXTRACTION_ATTEMPT_KINDS);
|
|
66468
|
+
EXTRACTION_ATTEMPT_STATUSES = ["succeeded", "failed", "indeterminate"];
|
|
66469
|
+
ExtractionAttemptStatusSchema = exports_external.enum(EXTRACTION_ATTEMPT_STATUSES);
|
|
66470
|
+
LlmModelSchema = exports_external.string().min(1).max(200);
|
|
66471
|
+
ExtractionAttemptSchema = exports_external.object({
|
|
66472
|
+
index: exports_external.number().int().min(0),
|
|
66473
|
+
kind: ExtractionAttemptKindSchema,
|
|
66474
|
+
llm_model: LlmModelSchema,
|
|
66475
|
+
status: ExtractionAttemptStatusSchema,
|
|
66476
|
+
input_tokens: exports_external.number().int().min(0).optional(),
|
|
66477
|
+
output_tokens: exports_external.number().int().min(0).optional(),
|
|
66478
|
+
cost_usd: exports_external.number().min(0).optional()
|
|
66479
|
+
}).strict();
|
|
66480
|
+
ExtractionUsageTotalsSchema = exports_external.object({
|
|
66481
|
+
input_tokens: exports_external.number().int().min(0).optional(),
|
|
66482
|
+
output_tokens: exports_external.number().int().min(0).optional(),
|
|
66483
|
+
cost_usd: exports_external.number().min(0).optional()
|
|
66484
|
+
}).strict();
|
|
66485
|
+
ExtractionTerminalResultSchema = exports_external.object({
|
|
66486
|
+
output: exports_external.unknown(),
|
|
66487
|
+
parsed_document: ParsedDocumentSchema,
|
|
66488
|
+
llm_model: LlmModelSchema,
|
|
66489
|
+
attempts: exports_external.array(ExtractionAttemptSchema).min(1),
|
|
66490
|
+
usage: ExtractionUsageTotalsSchema.optional()
|
|
66491
|
+
}).strict();
|
|
66492
|
+
});
|
|
66493
|
+
|
|
66494
|
+
// ../types/src/ocr/raw-result.ts
|
|
66495
|
+
var OCR_OUTPUT_FORMATS, OcrOutputFormatSchema, PaddleRawProfileSchema, RawParseResultSchema;
|
|
66496
|
+
var init_raw_result = __esm(() => {
|
|
66497
|
+
init_zod();
|
|
66498
|
+
OCR_OUTPUT_FORMATS = ["openparser@1", "raw"];
|
|
66499
|
+
OcrOutputFormatSchema = exports_external.enum(OCR_OUTPUT_FORMATS);
|
|
66500
|
+
PaddleRawProfileSchema = exports_external.object({
|
|
66501
|
+
name: exports_external.literal("eigenpal-paddle-layout-v1"),
|
|
66502
|
+
options: exports_external.object({
|
|
66503
|
+
format_block_content: exports_external.literal(true),
|
|
66504
|
+
use_chart_recognition: exports_external.literal(true),
|
|
66505
|
+
return_markdown_images: exports_external.literal(false),
|
|
66506
|
+
visualize: exports_external.literal(false)
|
|
66507
|
+
}).strict()
|
|
66508
|
+
}).strict();
|
|
66509
|
+
RawParseResultSchema = exports_external.object({
|
|
66510
|
+
output_format: exports_external.literal("raw"),
|
|
66511
|
+
provider: exports_external.literal("paddle"),
|
|
66512
|
+
model: exports_external.literal("paddleocr-vl-1.6"),
|
|
66513
|
+
profile: PaddleRawProfileSchema,
|
|
66514
|
+
result: exports_external.record(exports_external.string(), exports_external.unknown())
|
|
66515
|
+
}).strict();
|
|
66516
|
+
});
|
|
66517
|
+
|
|
66518
|
+
// ../types/src/ocr/jobs.ts
|
|
66519
|
+
var OCR_OPENAPI_RELATIVE_PATH = "docs/OCR_API_OPENAPI.yaml", OCR_JOB_STATUSES, JobStatusSchema, OCR_JOB_OPERATIONS, JobOperationSchema, JobIdSchema, JobFailureSchema, JobAcceptedSchema, BatchJobAcceptedSchema, BatchChildSummarySchema, BatchChildPageSchema, BatchSummaryCountsSchema, JobProgressSchema, JobSchema, ErrorBodySchema, ErrorResponseSchema, OCR_SYNC_STATUS_CODES;
|
|
66520
|
+
var init_jobs = __esm(() => {
|
|
66521
|
+
init_zod();
|
|
66522
|
+
init_extraction();
|
|
66523
|
+
init_parsed_document();
|
|
66524
|
+
init_raw_result();
|
|
66525
|
+
OCR_JOB_STATUSES = [
|
|
66526
|
+
"queued",
|
|
66527
|
+
"running",
|
|
66528
|
+
"succeeded",
|
|
66529
|
+
"failed",
|
|
66530
|
+
"indeterminate"
|
|
66531
|
+
];
|
|
66532
|
+
JobStatusSchema = exports_external.enum(OCR_JOB_STATUSES);
|
|
66533
|
+
OCR_JOB_OPERATIONS = ["parse", "extract", "parse_batch", "extract_batch"];
|
|
66534
|
+
JobOperationSchema = exports_external.enum(OCR_JOB_OPERATIONS);
|
|
66535
|
+
JobIdSchema = exports_external.string().uuid();
|
|
66536
|
+
JobFailureSchema = exports_external.object({
|
|
66537
|
+
code: exports_external.string().min(1),
|
|
66538
|
+
message: exports_external.string().min(1),
|
|
66539
|
+
retryable: exports_external.boolean(),
|
|
66540
|
+
details: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
66541
|
+
}).strict();
|
|
66542
|
+
JobAcceptedSchema = exports_external.object({
|
|
66543
|
+
id: JobIdSchema,
|
|
66544
|
+
operation: exports_external.enum(["parse", "extract"]),
|
|
66545
|
+
status: JobStatusSchema,
|
|
66546
|
+
output_format: OcrOutputFormatSchema,
|
|
66547
|
+
created_at: exports_external.string().datetime(),
|
|
66548
|
+
updated_at: exports_external.string().datetime()
|
|
66549
|
+
}).strict();
|
|
66550
|
+
BatchJobAcceptedSchema = exports_external.object({
|
|
66551
|
+
id: JobIdSchema,
|
|
66552
|
+
operation: exports_external.enum(["parse_batch", "extract_batch"]),
|
|
66553
|
+
status: JobStatusSchema,
|
|
66554
|
+
output_format: OcrOutputFormatSchema,
|
|
66555
|
+
created_at: exports_external.string().datetime(),
|
|
66556
|
+
updated_at: exports_external.string().datetime(),
|
|
66557
|
+
child_count: exports_external.number().int().min(1).max(20)
|
|
66558
|
+
}).strict();
|
|
66559
|
+
BatchChildSummarySchema = exports_external.object({
|
|
66560
|
+
client_item_id: exports_external.string().min(1).max(128),
|
|
66561
|
+
job_id: JobIdSchema,
|
|
66562
|
+
file_index: exports_external.number().int().min(0),
|
|
66563
|
+
status: JobStatusSchema,
|
|
66564
|
+
output_format: OcrOutputFormatSchema,
|
|
66565
|
+
error: JobFailureSchema.optional(),
|
|
66566
|
+
result: exports_external.union([ParsedDocumentSchema, RawParseResultSchema, ExtractionTerminalResultSchema]).optional()
|
|
66567
|
+
}).strict();
|
|
66568
|
+
BatchChildPageSchema = exports_external.object({
|
|
66569
|
+
items: exports_external.array(BatchChildSummarySchema),
|
|
66570
|
+
next_cursor: exports_external.string().nullable().optional()
|
|
66571
|
+
}).strict();
|
|
66572
|
+
BatchSummaryCountsSchema = exports_external.object({
|
|
66573
|
+
total: exports_external.number().int().min(0),
|
|
66574
|
+
queued: exports_external.number().int().min(0),
|
|
66575
|
+
running: exports_external.number().int().min(0),
|
|
66576
|
+
succeeded: exports_external.number().int().min(0),
|
|
66577
|
+
failed: exports_external.number().int().min(0),
|
|
66578
|
+
indeterminate: exports_external.number().int().min(0)
|
|
66579
|
+
}).strict();
|
|
66580
|
+
JobProgressSchema = exports_external.object({
|
|
66581
|
+
completed: exports_external.number().int().min(0).optional(),
|
|
66582
|
+
total: exports_external.number().int().min(0).optional()
|
|
66583
|
+
}).strict();
|
|
66584
|
+
JobSchema = exports_external.object({
|
|
66585
|
+
id: JobIdSchema,
|
|
66586
|
+
operation: JobOperationSchema,
|
|
66587
|
+
status: JobStatusSchema,
|
|
66588
|
+
output_format: OcrOutputFormatSchema,
|
|
66589
|
+
created_at: exports_external.string().datetime(),
|
|
66590
|
+
updated_at: exports_external.string().datetime(),
|
|
66591
|
+
progress: JobProgressSchema.optional(),
|
|
66592
|
+
error: JobFailureSchema.optional(),
|
|
66593
|
+
result: exports_external.union([ParsedDocumentSchema, RawParseResultSchema, ExtractionTerminalResultSchema]).optional(),
|
|
66594
|
+
summary: BatchSummaryCountsSchema.optional(),
|
|
66595
|
+
children: BatchChildPageSchema.optional()
|
|
66596
|
+
}).strict();
|
|
66597
|
+
ErrorBodySchema = exports_external.object({
|
|
66598
|
+
code: exports_external.string().min(1),
|
|
66599
|
+
message: exports_external.string().min(1),
|
|
66600
|
+
request_id: exports_external.string().min(1),
|
|
66601
|
+
retryable: exports_external.boolean(),
|
|
66602
|
+
details: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
66603
|
+
}).strict();
|
|
66604
|
+
ErrorResponseSchema = exports_external.object({
|
|
66605
|
+
error: ErrorBodySchema
|
|
66606
|
+
}).strict();
|
|
66607
|
+
OCR_SYNC_STATUS_CODES = {
|
|
66608
|
+
success: 200,
|
|
66609
|
+
accepted: 202,
|
|
66610
|
+
failed: 422,
|
|
66611
|
+
indeterminate: 504
|
|
66612
|
+
};
|
|
66613
|
+
});
|
|
66614
|
+
|
|
66615
|
+
// ../types/src/ocr/contracts.ts
|
|
66616
|
+
function requireExactlyOneSource(item, ctx) {
|
|
66617
|
+
const hasIndex = item.file_index !== undefined;
|
|
66618
|
+
const hasFileId = item.file_id !== undefined;
|
|
66619
|
+
if (hasIndex === hasFileId) {
|
|
66620
|
+
ctx.addIssue({
|
|
66621
|
+
code: "custom",
|
|
66622
|
+
message: "each batch item requires exactly one of file_index or file_id",
|
|
66623
|
+
path: hasIndex ? ["file_id"] : ["file_index"]
|
|
66624
|
+
});
|
|
66625
|
+
}
|
|
66626
|
+
}
|
|
66627
|
+
function getOpenParserRoute(method, path) {
|
|
66628
|
+
const normalizedMethod = method.toLowerCase();
|
|
66629
|
+
return OPENPARSER_ROUTE_MANIFEST.find((route) => {
|
|
66630
|
+
if (route.method !== normalizedMethod)
|
|
66631
|
+
return false;
|
|
66632
|
+
const pattern = route.path.replace(/\{[^/]+\}/g, "[^/]+");
|
|
66633
|
+
return new RegExp(`^${pattern}$`).test(path);
|
|
66634
|
+
});
|
|
66635
|
+
}
|
|
66636
|
+
var OCR_MODELS, OcrModelSchema, OcrFileIdSchema, RepairAttemptsSchema, ExtractionJsonSchemaObjectSchema, ParseRequestSchema, ExtractRequestSchema, ParseBatchItemSchema, ExtractBatchItemSchema, ParseBatchRequestSchema, ExtractBatchRequestSchema, PublicFileSchema, DeleteFileResponseSchema, OpenParserParseResultSchema, OPENPARSER_COMPONENT_SCHEMAS, admissionErrors, OPENPARSER_ROUTE_MANIFEST;
|
|
66637
|
+
var init_contracts = __esm(() => {
|
|
66638
|
+
init_zod();
|
|
66639
|
+
init_extraction();
|
|
66640
|
+
init_jobs();
|
|
66641
|
+
init_parsed_document();
|
|
66642
|
+
init_raw_result();
|
|
66643
|
+
OCR_MODELS = ["paddleocr-vl-1.6"];
|
|
66644
|
+
OcrModelSchema = exports_external.string().min(1).max(128);
|
|
66645
|
+
OcrFileIdSchema = exports_external.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/, "file_id must be a valid Eigenpal file id");
|
|
66646
|
+
RepairAttemptsSchema = exports_external.number().int().min(0).max(2).default(0);
|
|
66647
|
+
ExtractionJsonSchemaObjectSchema = exports_external.record(exports_external.string(), exports_external.unknown());
|
|
66648
|
+
ParseRequestSchema = exports_external.object({
|
|
66649
|
+
ocr_model: OcrModelSchema,
|
|
66650
|
+
file_id: OcrFileIdSchema.optional(),
|
|
66651
|
+
output_format: OcrOutputFormatSchema.default("openparser@1")
|
|
66652
|
+
}).strict();
|
|
66653
|
+
ExtractRequestSchema = exports_external.object({
|
|
66654
|
+
ocr_model: OcrModelSchema,
|
|
66655
|
+
llm_model: LlmModelSchema,
|
|
66656
|
+
schema: ExtractionJsonSchemaObjectSchema,
|
|
66657
|
+
repair_attempts: RepairAttemptsSchema,
|
|
66658
|
+
file_id: OcrFileIdSchema.optional(),
|
|
66659
|
+
output_format: OcrOutputFormatSchema.default("openparser@1")
|
|
66660
|
+
}).strict();
|
|
66661
|
+
ParseBatchItemSchema = exports_external.object({
|
|
66662
|
+
client_item_id: exports_external.string().min(1).max(128),
|
|
66663
|
+
file_index: exports_external.number().int().min(0).optional(),
|
|
66664
|
+
file_id: OcrFileIdSchema.optional(),
|
|
66665
|
+
ocr_model: OcrModelSchema
|
|
66666
|
+
}).strict().superRefine(requireExactlyOneSource);
|
|
66667
|
+
ExtractBatchItemSchema = exports_external.object({
|
|
66668
|
+
client_item_id: exports_external.string().min(1).max(128),
|
|
66669
|
+
file_index: exports_external.number().int().min(0).optional(),
|
|
66670
|
+
file_id: OcrFileIdSchema.optional(),
|
|
66671
|
+
ocr_model: OcrModelSchema,
|
|
66672
|
+
llm_model: LlmModelSchema,
|
|
66673
|
+
schema: ExtractionJsonSchemaObjectSchema,
|
|
66674
|
+
repair_attempts: RepairAttemptsSchema
|
|
66675
|
+
}).strict().superRefine(requireExactlyOneSource);
|
|
66676
|
+
ParseBatchRequestSchema = exports_external.object({
|
|
66677
|
+
items: exports_external.array(ParseBatchItemSchema).min(1).max(20),
|
|
66678
|
+
output_format: OcrOutputFormatSchema.default("openparser@1")
|
|
66679
|
+
}).strict();
|
|
66680
|
+
ExtractBatchRequestSchema = exports_external.object({
|
|
66681
|
+
items: exports_external.array(ExtractBatchItemSchema).min(1).max(20),
|
|
66682
|
+
output_format: OcrOutputFormatSchema.default("openparser@1")
|
|
66683
|
+
}).strict();
|
|
66684
|
+
PublicFileSchema = exports_external.object({
|
|
66685
|
+
id: exports_external.string(),
|
|
66686
|
+
filename: exports_external.string(),
|
|
66687
|
+
contentType: exports_external.string().nullable(),
|
|
66688
|
+
size: exports_external.number().int().min(0).nullable(),
|
|
66689
|
+
purpose: exports_external.null(),
|
|
66690
|
+
createdAt: exports_external.string().datetime()
|
|
66691
|
+
}).strict();
|
|
66692
|
+
DeleteFileResponseSchema = exports_external.object({ deleted: exports_external.literal(true) }).strict();
|
|
66693
|
+
OpenParserParseResultSchema = exports_external.union([ParsedDocumentSchema, RawParseResultSchema]);
|
|
66694
|
+
OPENPARSER_COMPONENT_SCHEMAS = {
|
|
66695
|
+
PublicFile: PublicFileSchema,
|
|
66696
|
+
JobId: JobIdSchema,
|
|
66697
|
+
OcrModel: OcrModelSchema,
|
|
66698
|
+
LlmModel: LlmModelSchema,
|
|
66699
|
+
RepairAttempts: RepairAttemptsSchema,
|
|
66700
|
+
JsonSchemaObject: ExtractionJsonSchemaObjectSchema,
|
|
66701
|
+
FileId: OcrFileIdSchema,
|
|
66702
|
+
ParseRequest: ParseRequestSchema,
|
|
66703
|
+
ExtractRequest: ExtractRequestSchema,
|
|
66704
|
+
ParseBatchItem: ParseBatchItemSchema,
|
|
66705
|
+
ExtractBatchItem: ExtractBatchItemSchema,
|
|
66706
|
+
ParseBatchRequest: ParseBatchRequestSchema,
|
|
66707
|
+
ExtractBatchRequest: ExtractBatchRequestSchema,
|
|
66708
|
+
OcrOutputFormat: OcrOutputFormatSchema,
|
|
66709
|
+
PaddleRawProfile: PaddleRawProfileSchema,
|
|
66710
|
+
RawParseResult: RawParseResultSchema,
|
|
66711
|
+
ParseResult: OpenParserParseResultSchema,
|
|
66712
|
+
JobStatus: JobStatusSchema,
|
|
66713
|
+
JobOperation: JobOperationSchema,
|
|
66714
|
+
JobAccepted: JobAcceptedSchema,
|
|
66715
|
+
BatchJobAccepted: BatchJobAcceptedSchema,
|
|
66716
|
+
BoundingBox: BoundingBoxSchema,
|
|
66717
|
+
PageBlock: PageBlockSchema,
|
|
66718
|
+
RegionType: RegionTypeSchema,
|
|
66719
|
+
Region: RegionSchema,
|
|
66720
|
+
ContentKind: ContentKindSchema,
|
|
66721
|
+
RegionContent: RegionContentSchema,
|
|
66722
|
+
ChunkProvenanceSpan: ChunkProvenanceSpanSchema,
|
|
66723
|
+
ExtractionChunk: ExtractionChunkSchema,
|
|
66724
|
+
ParsedDocument: ParsedDocumentSchema,
|
|
66725
|
+
ExtractionAttemptKind: ExtractionAttemptKindSchema,
|
|
66726
|
+
ExtractionAttemptStatus: ExtractionAttemptStatusSchema,
|
|
66727
|
+
ExtractionAttempt: ExtractionAttemptSchema,
|
|
66728
|
+
ExtractionUsageTotals: ExtractionUsageTotalsSchema,
|
|
66729
|
+
ExtractionTerminalResult: ExtractionTerminalResultSchema,
|
|
66730
|
+
JobFailure: JobFailureSchema,
|
|
66731
|
+
BatchChildSummary: BatchChildSummarySchema,
|
|
66732
|
+
BatchChildPage: BatchChildPageSchema,
|
|
66733
|
+
BatchSummaryCounts: BatchSummaryCountsSchema,
|
|
66734
|
+
Job: JobSchema,
|
|
66735
|
+
ErrorBody: ErrorBodySchema,
|
|
66736
|
+
ErrorResponse: ErrorResponseSchema,
|
|
66737
|
+
DeleteFileResponse: DeleteFileResponseSchema
|
|
66738
|
+
};
|
|
66739
|
+
admissionErrors = {
|
|
66740
|
+
400: { component: "MalformedRequest" },
|
|
66741
|
+
401: { component: "Unauthorized" },
|
|
66742
|
+
402: { component: "InsufficientCredits" },
|
|
66743
|
+
403: { component: "Forbidden" },
|
|
66744
|
+
409: { component: "IdempotencyConflict" },
|
|
66745
|
+
413: { component: "LimitExceeded" },
|
|
66746
|
+
415: { component: "UnsupportedMediaType" },
|
|
66747
|
+
429: { component: "RateLimited" },
|
|
66748
|
+
503: { component: "ServiceUnavailable" }
|
|
66749
|
+
};
|
|
66750
|
+
OPENPARSER_ROUTE_MANIFEST = [
|
|
66751
|
+
{
|
|
66752
|
+
operationId: "parseSync",
|
|
66753
|
+
method: "post",
|
|
66754
|
+
path: "/parse",
|
|
66755
|
+
tag: "parse",
|
|
66756
|
+
requestBody: "ParseSingleUpload",
|
|
66757
|
+
parameters: ["IdempotencyKey"],
|
|
66758
|
+
responses: {
|
|
66759
|
+
200: { schema: "ParseResult" },
|
|
66760
|
+
202: { component: "JobAccepted" },
|
|
66761
|
+
...admissionErrors,
|
|
66762
|
+
422: { component: "UnprocessableOrSyncFailed" },
|
|
66763
|
+
504: { component: "SyncTerminalIndeterminate" }
|
|
66764
|
+
}
|
|
66765
|
+
},
|
|
66766
|
+
{
|
|
66767
|
+
operationId: "parseAsync",
|
|
66768
|
+
method: "post",
|
|
66769
|
+
path: "/parse/async",
|
|
66770
|
+
tag: "parse",
|
|
66771
|
+
requestBody: "ParseSingleUpload",
|
|
66772
|
+
parameters: ["IdempotencyKey"],
|
|
66773
|
+
responses: {
|
|
66774
|
+
202: { component: "JobAccepted" },
|
|
66775
|
+
...admissionErrors,
|
|
66776
|
+
422: { component: "UnprocessableConfig" }
|
|
66777
|
+
}
|
|
66778
|
+
},
|
|
66779
|
+
{
|
|
66780
|
+
operationId: "parseBatch",
|
|
66781
|
+
method: "post",
|
|
66782
|
+
path: "/parse/batch",
|
|
66783
|
+
tag: "parse",
|
|
66784
|
+
requestBody: "ParseBatchUpload",
|
|
66785
|
+
parameters: ["IdempotencyKey"],
|
|
66786
|
+
responses: {
|
|
66787
|
+
202: { component: "BatchJobAccepted" },
|
|
66788
|
+
...admissionErrors,
|
|
66789
|
+
422: { component: "UnprocessableConfig" }
|
|
66790
|
+
}
|
|
66791
|
+
},
|
|
66792
|
+
{
|
|
66793
|
+
operationId: "extractSync",
|
|
66794
|
+
method: "post",
|
|
66795
|
+
path: "/extract",
|
|
66796
|
+
tag: "extract",
|
|
66797
|
+
requestBody: "ExtractSingleUpload",
|
|
66798
|
+
parameters: ["IdempotencyKey"],
|
|
66799
|
+
responses: {
|
|
66800
|
+
200: { schema: "ExtractionTerminalResult" },
|
|
66801
|
+
202: { component: "JobAccepted" },
|
|
66802
|
+
...admissionErrors,
|
|
66803
|
+
422: { component: "UnprocessableOrSyncFailed" },
|
|
66804
|
+
504: { component: "SyncTerminalIndeterminate" }
|
|
66805
|
+
}
|
|
66806
|
+
},
|
|
66807
|
+
{
|
|
66808
|
+
operationId: "extractAsync",
|
|
66809
|
+
method: "post",
|
|
66810
|
+
path: "/extract/async",
|
|
66811
|
+
tag: "extract",
|
|
66812
|
+
requestBody: "ExtractSingleUpload",
|
|
66813
|
+
parameters: ["IdempotencyKey"],
|
|
66814
|
+
responses: {
|
|
66815
|
+
202: { component: "JobAccepted" },
|
|
66816
|
+
...admissionErrors,
|
|
66817
|
+
422: { component: "UnprocessableConfig" }
|
|
66818
|
+
}
|
|
66819
|
+
},
|
|
66820
|
+
{
|
|
66821
|
+
operationId: "extractBatch",
|
|
66822
|
+
method: "post",
|
|
66823
|
+
path: "/extract/batch",
|
|
66824
|
+
tag: "extract",
|
|
66825
|
+
requestBody: "ExtractBatchUpload",
|
|
66826
|
+
parameters: ["IdempotencyKey"],
|
|
66827
|
+
responses: {
|
|
66828
|
+
202: { component: "BatchJobAccepted" },
|
|
66829
|
+
...admissionErrors,
|
|
66830
|
+
422: { component: "UnprocessableConfig" }
|
|
66831
|
+
}
|
|
66832
|
+
},
|
|
66833
|
+
{
|
|
66834
|
+
operationId: "getJob",
|
|
66835
|
+
method: "get",
|
|
66836
|
+
path: "/jobs/{id}",
|
|
66837
|
+
tag: "jobs",
|
|
66838
|
+
parameters: ["JobId", "ChildCursor", "ChildLimit"],
|
|
66839
|
+
responses: {
|
|
66840
|
+
200: { schema: "Job" },
|
|
66841
|
+
401: { component: "Unauthorized" },
|
|
66842
|
+
403: { component: "Forbidden" },
|
|
66843
|
+
404: { component: "JobNotFound" }
|
|
66844
|
+
}
|
|
66845
|
+
},
|
|
66846
|
+
{
|
|
66847
|
+
operationId: "createFile",
|
|
66848
|
+
method: "post",
|
|
66849
|
+
path: "/files",
|
|
66850
|
+
tag: "files",
|
|
66851
|
+
requestBody: "CreateFileUpload",
|
|
66852
|
+
responses: {
|
|
66853
|
+
200: { schema: "PublicFile" },
|
|
66854
|
+
400: { component: "MalformedRequest" },
|
|
66855
|
+
401: { component: "Unauthorized" },
|
|
66856
|
+
403: { component: "Forbidden" },
|
|
66857
|
+
413: { component: "LimitExceeded" },
|
|
66858
|
+
415: { component: "UnsupportedMediaType" }
|
|
66859
|
+
}
|
|
66860
|
+
},
|
|
66861
|
+
{
|
|
66862
|
+
operationId: "getFile",
|
|
66863
|
+
method: "get",
|
|
66864
|
+
path: "/files/{id}",
|
|
66865
|
+
tag: "files",
|
|
66866
|
+
parameters: ["FileId"],
|
|
66867
|
+
responses: {
|
|
66868
|
+
200: { schema: "PublicFile" },
|
|
66869
|
+
401: { component: "Unauthorized" },
|
|
66870
|
+
403: { component: "Forbidden" },
|
|
66871
|
+
404: { component: "FileNotFound" }
|
|
66872
|
+
}
|
|
66873
|
+
},
|
|
66874
|
+
{
|
|
66875
|
+
operationId: "deleteFile",
|
|
66876
|
+
method: "delete",
|
|
66877
|
+
path: "/files/{id}",
|
|
66878
|
+
tag: "files",
|
|
66879
|
+
parameters: ["FileId"],
|
|
66880
|
+
responses: {
|
|
66881
|
+
200: { schema: "DeleteFileResponse" },
|
|
66882
|
+
401: { component: "Unauthorized" },
|
|
66883
|
+
403: { component: "Forbidden" },
|
|
66884
|
+
404: { component: "FileNotFound" }
|
|
66885
|
+
}
|
|
66886
|
+
},
|
|
66887
|
+
{
|
|
66888
|
+
operationId: "getFileContent",
|
|
66889
|
+
method: "get",
|
|
66890
|
+
path: "/files/{id}/content",
|
|
66891
|
+
tag: "files",
|
|
66892
|
+
parameters: ["FileId"],
|
|
66893
|
+
responses: {
|
|
66894
|
+
200: { binary: true },
|
|
66895
|
+
401: { component: "Unauthorized" },
|
|
66896
|
+
403: { component: "Forbidden" },
|
|
66897
|
+
404: { component: "FileNotFound" }
|
|
66898
|
+
}
|
|
66899
|
+
}
|
|
66900
|
+
];
|
|
66901
|
+
});
|
|
66902
|
+
|
|
66903
|
+
// ../types/src/ocr/index.ts
|
|
66904
|
+
var init_ocr = __esm(() => {
|
|
66905
|
+
init_parsed_document();
|
|
66906
|
+
init_contracts();
|
|
66907
|
+
init_raw_result();
|
|
66908
|
+
init_extraction();
|
|
66909
|
+
init_jobs();
|
|
66910
|
+
});
|
|
66911
|
+
|
|
66255
66912
|
// ../types/src/storage/s3-paths.ts
|
|
66256
66913
|
function assertSegment(name, value) {
|
|
66257
66914
|
if (!value || !SEGMENT_RX.test(value)) {
|
|
@@ -66621,6 +67278,7 @@ __export(exports_src, {
|
|
|
66621
67278
|
suppressRequiredMissingErrorsForSchemaFileFields: () => suppressRequiredMissingErrorsForSchemaFileFields,
|
|
66622
67279
|
suggestWorkflowName: () => suggestWorkflowName,
|
|
66623
67280
|
stripTenantPrefix: () => stripTenantPrefix,
|
|
67281
|
+
stripGroundingMetadata: () => stripGroundingMetadata,
|
|
66624
67282
|
stringToUnitInterval: () => stringToUnitInterval,
|
|
66625
67283
|
sourceLockfileInputHash: () => sourceLockfileInputHash,
|
|
66626
67284
|
serializeWebhookEvent: () => serializeWebhookEvent,
|
|
@@ -66656,6 +67314,7 @@ __export(exports_src, {
|
|
|
66656
67314
|
parseAutomationTarget: () => parseAutomationTarget,
|
|
66657
67315
|
parseAgentRerunVersion: () => parseAgentRerunVersion,
|
|
66658
67316
|
normalizeLegacyFileIdInput: () => normalizeLegacyFileIdInput,
|
|
67317
|
+
normalizeExtractInputToText: () => normalizeExtractInputToText,
|
|
66659
67318
|
noopTracingContext: () => noopTracingContext,
|
|
66660
67319
|
mimeTypeForExtension: () => mimeTypeForExtension,
|
|
66661
67320
|
matchS3Path: () => matchS3Path,
|
|
@@ -66703,6 +67362,7 @@ __export(exports_src, {
|
|
|
66703
67362
|
getRequiredOutputKeys: () => getRequiredOutputKeys,
|
|
66704
67363
|
getProcessorSchemas: () => getProcessorSchemas,
|
|
66705
67364
|
getParserCategory: () => getParserCategory,
|
|
67365
|
+
getOpenParserRoute: () => getOpenParserRoute,
|
|
66706
67366
|
getInvokeWorkflowRef: () => getInvokeWorkflowRef,
|
|
66707
67367
|
getInvokeExecutionMode: () => getInvokeExecutionMode,
|
|
66708
67368
|
getConfigSchema: () => getConfigSchema,
|
|
@@ -66722,6 +67382,7 @@ __export(exports_src, {
|
|
|
66722
67382
|
fileReferenceKind: () => fileReferenceKind,
|
|
66723
67383
|
fileFieldNamesFromJsonSchema: () => fileFieldNamesFromJsonSchema,
|
|
66724
67384
|
fieldStemFromGoldenName: () => fieldStemFromGoldenName,
|
|
67385
|
+
extractSourceTextFromResolvedConfig: () => extractSourceTextFromResolvedConfig,
|
|
66725
67386
|
extractFieldMetadata: () => extractFieldMetadata,
|
|
66726
67387
|
extensionForMimeType: () => extensionForMimeType,
|
|
66727
67388
|
executionWallClockMs: () => executionWallClockMs,
|
|
@@ -66900,18 +67561,26 @@ __export(exports_src, {
|
|
|
66900
67561
|
RetryCategorySchema: () => RetryCategorySchema,
|
|
66901
67562
|
ResolvedRetryPolicySchema: () => ResolvedRetryPolicySchema,
|
|
66902
67563
|
ResolvedProcessorFileSchema: () => ResolvedProcessorFileSchema,
|
|
67564
|
+
RepairAttemptsSchema: () => RepairAttemptsSchema,
|
|
66903
67565
|
ReleaseTagSchema: () => ReleaseTagSchema,
|
|
67566
|
+
RegionTypeSchema: () => RegionTypeSchema,
|
|
67567
|
+
RegionSchema: () => RegionSchema,
|
|
67568
|
+
RegionContentSchema: () => RegionContentSchema,
|
|
66904
67569
|
RedactedWebhookCustomHeaderSchema: () => RedactedWebhookCustomHeaderSchema,
|
|
67570
|
+
RawParseResultSchema: () => RawParseResultSchema,
|
|
66905
67571
|
RUN_TARGET_SEGMENT_PATTERN: () => RUN_TARGET_SEGMENT_PATTERN,
|
|
66906
67572
|
RUN_EXPAND_SECTIONS: () => RUN_EXPAND_SECTIONS,
|
|
66907
67573
|
RUN_DETAIL_EXPAND_PRESET: () => RUN_DETAIL_EXPAND_PRESET,
|
|
66908
67574
|
RUNS_TRIGGERED_BY_SYSTEM: () => RUNS_TRIGGERED_BY_SYSTEM,
|
|
66909
67575
|
RERUN_ORIGINAL_VERSION: () => RERUN_ORIGINAL_VERSION,
|
|
67576
|
+
REGION_TYPES: () => REGION_TYPES,
|
|
66910
67577
|
PublicWebhookRunSchema: () => PublicWebhookRunSchema,
|
|
67578
|
+
PublicFileSchema: () => PublicFileSchema,
|
|
66911
67579
|
ProcessorPortSchema: () => ProcessorPortSchema,
|
|
66912
67580
|
ProcessorExecutionContextSchema: () => ProcessorExecutionContextSchema,
|
|
66913
67581
|
ProcessorDefinitionSchema: () => ProcessorDefinitionSchema,
|
|
66914
67582
|
PositionedTextSchema: () => PositionedTextSchema,
|
|
67583
|
+
PolygonSchema: () => PolygonSchema,
|
|
66915
67584
|
PointSchema: () => PointSchema,
|
|
66916
67585
|
PdfEmbedderOutputSchema: () => PdfEmbedderOutputSchema,
|
|
66917
67586
|
PdfEmbedderInputSchema: () => PdfEmbedderInputSchema,
|
|
@@ -66919,21 +67588,41 @@ __export(exports_src, {
|
|
|
66919
67588
|
ParserTypeSchema: () => ParserTypeSchema,
|
|
66920
67589
|
ParserInputSchema: () => ParserInputSchema,
|
|
66921
67590
|
ParserCategory: () => ParserCategory,
|
|
67591
|
+
ParsedDocumentSchema: () => ParsedDocumentSchema,
|
|
66922
67592
|
ParseUsageSchema: () => ParseUsageSchema,
|
|
66923
67593
|
ParseResultSchema: () => ParseResultSchema,
|
|
67594
|
+
ParseRequestSchema: () => ParseRequestSchema,
|
|
66924
67595
|
ParseOptionsSchema: () => ParseOptionsSchema,
|
|
67596
|
+
ParseBatchRequestSchema: () => ParseBatchRequestSchema,
|
|
67597
|
+
ParseBatchItemSchema: () => ParseBatchItemSchema,
|
|
66925
67598
|
ParallelStepSchema: () => ParallelStepSchema,
|
|
66926
67599
|
ParallelMapStepSchema: () => ParallelMapStepSchema,
|
|
66927
67600
|
ParallelBranchSchema: () => ParallelBranchSchema,
|
|
66928
67601
|
PaginationParamsSchema: () => PaginationParamsSchema,
|
|
66929
67602
|
PageResultSchema: () => PageResultSchema,
|
|
67603
|
+
PageBlockSchema: () => PageBlockSchema,
|
|
67604
|
+
PageBlockKindSchema: () => PageBlockKindSchema,
|
|
67605
|
+
PaddleRawProfileSchema: () => PaddleRawProfileSchema,
|
|
66930
67606
|
PROCESSOR_SCHEMAS: () => PROCESSOR_SCHEMAS,
|
|
66931
67607
|
PROCESSOR_IDS: () => PROCESSOR_IDS,
|
|
66932
67608
|
PENDING_FILE_REF: () => PENDING_FILE_REF,
|
|
66933
67609
|
PARSER_IDS: () => PARSER_IDS,
|
|
67610
|
+
PAGE_BLOCK_KINDS: () => PAGE_BLOCK_KINDS,
|
|
67611
|
+
OpenParserParseResultSchema: () => OpenParserParseResultSchema,
|
|
66934
67612
|
OpenInferenceSpanKinds: () => OpenInferenceSpanKinds,
|
|
66935
67613
|
OpenInference: () => OpenInference,
|
|
67614
|
+
OcrOutputFormatSchema: () => OcrOutputFormatSchema,
|
|
67615
|
+
OcrModelSchema: () => OcrModelSchema,
|
|
67616
|
+
OcrFileIdSchema: () => OcrFileIdSchema,
|
|
67617
|
+
OPENPARSER_ROUTE_MANIFEST: () => OPENPARSER_ROUTE_MANIFEST,
|
|
67618
|
+
OPENPARSER_COMPONENT_SCHEMAS: () => OPENPARSER_COMPONENT_SCHEMAS,
|
|
66936
67619
|
OFFICE_MIME_TYPES: () => OFFICE_MIME_TYPES,
|
|
67620
|
+
OCR_SYNC_STATUS_CODES: () => OCR_SYNC_STATUS_CODES,
|
|
67621
|
+
OCR_OUTPUT_FORMATS: () => OCR_OUTPUT_FORMATS,
|
|
67622
|
+
OCR_OPENAPI_RELATIVE_PATH: () => OCR_OPENAPI_RELATIVE_PATH,
|
|
67623
|
+
OCR_MODELS: () => OCR_MODELS,
|
|
67624
|
+
OCR_JOB_STATUSES: () => OCR_JOB_STATUSES,
|
|
67625
|
+
OCR_JOB_OPERATIONS: () => OCR_JOB_OPERATIONS,
|
|
66937
67626
|
NON_SUCCESS_TERMINAL_EXECUTION_STATUSES: () => NON_SUCCESS_TERMINAL_EXECUTION_STATUSES,
|
|
66938
67627
|
MergeOutputSchema: () => MergeOutputSchema,
|
|
66939
67628
|
MergeInputSchema: () => MergeInputSchema,
|
|
@@ -66944,6 +67633,7 @@ __export(exports_src, {
|
|
|
66944
67633
|
LocalEvaluatorReferenceSchema: () => LocalEvaluatorReferenceSchema,
|
|
66945
67634
|
LocalEvaluatorCompositionItemSchema: () => LocalEvaluatorCompositionItemSchema,
|
|
66946
67635
|
LocalAgentResourceDirectorySchema: () => LocalAgentResourceDirectorySchema,
|
|
67636
|
+
LlmModelSchema: () => LlmModelSchema,
|
|
66947
67637
|
LlmJudgeConfigSchema: () => LlmJudgeConfigSchema,
|
|
66948
67638
|
LegacyFileIdInputSchema: () => LegacyFileIdInputSchema,
|
|
66949
67639
|
LegacyBlockStepSchema: () => LegacyBlockStepSchema,
|
|
@@ -66954,6 +67644,13 @@ __export(exports_src, {
|
|
|
66954
67644
|
LEGACY_FILE_REF_COMPATIBILITY: () => LEGACY_FILE_REF_COMPATIBILITY,
|
|
66955
67645
|
JudgeModeSchema: () => JudgeModeSchema,
|
|
66956
67646
|
JsonSchemaSchema: () => JsonSchemaSchema,
|
|
67647
|
+
JobStatusSchema: () => JobStatusSchema,
|
|
67648
|
+
JobSchema: () => JobSchema,
|
|
67649
|
+
JobProgressSchema: () => JobProgressSchema,
|
|
67650
|
+
JobOperationSchema: () => JobOperationSchema,
|
|
67651
|
+
JobIdSchema: () => JobIdSchema,
|
|
67652
|
+
JobFailureSchema: () => JobFailureSchema,
|
|
67653
|
+
JobAcceptedSchema: () => JobAcceptedSchema,
|
|
66957
67654
|
InlineFileRefSchema: () => InlineFileRefSchema,
|
|
66958
67655
|
InlineFileIngressRefSchema: () => InlineFileIngressRefSchema,
|
|
66959
67656
|
InlineFileIngressPayloadSchema: () => InlineFileIngressPayloadSchema,
|
|
@@ -66971,10 +67668,20 @@ __export(exports_src, {
|
|
|
66971
67668
|
FileIngressRefSchema: () => FileIngressRefSchema,
|
|
66972
67669
|
FileIdIngressRefSchema: () => FileIdIngressRefSchema,
|
|
66973
67670
|
FailStepSchema: () => FailStepSchema,
|
|
67671
|
+
ExtractionUsageTotalsSchema: () => ExtractionUsageTotalsSchema,
|
|
67672
|
+
ExtractionTerminalResultSchema: () => ExtractionTerminalResultSchema,
|
|
67673
|
+
ExtractionJsonSchemaObjectSchema: () => ExtractionJsonSchemaObjectSchema,
|
|
67674
|
+
ExtractionChunkSchema: () => ExtractionChunkSchema,
|
|
67675
|
+
ExtractionAttemptStatusSchema: () => ExtractionAttemptStatusSchema,
|
|
67676
|
+
ExtractionAttemptSchema: () => ExtractionAttemptSchema,
|
|
67677
|
+
ExtractionAttemptKindSchema: () => ExtractionAttemptKindSchema,
|
|
66974
67678
|
ExtractedTableSchema: () => ExtractedTableSchema,
|
|
67679
|
+
ExtractRequestSchema: () => ExtractRequestSchema,
|
|
66975
67680
|
ExtractOutputSchema: () => ExtractOutputSchema,
|
|
66976
67681
|
ExtractInputSchema: () => ExtractInputSchema,
|
|
66977
67682
|
ExtractConfigSchema: () => ExtractConfigSchema,
|
|
67683
|
+
ExtractBatchRequestSchema: () => ExtractBatchRequestSchema,
|
|
67684
|
+
ExtractBatchItemSchema: () => ExtractBatchItemSchema,
|
|
66978
67685
|
ExperimentExportQuerySchema: () => ExperimentExportQuerySchema,
|
|
66979
67686
|
ExperimentExportAllQuerySchema: () => ExperimentExportAllQuerySchema,
|
|
66980
67687
|
ExpectedOutputSchema: () => ExpectedOutputSchema,
|
|
@@ -67003,9 +67710,13 @@ __export(exports_src, {
|
|
|
67003
67710
|
EvalOverridesSchema: () => EvalOverridesSchema,
|
|
67004
67711
|
EvalExampleMetaSchema: () => EvalExampleMetaSchema,
|
|
67005
67712
|
EvalConfigYamlSchema: () => EvalConfigYamlSchema,
|
|
67713
|
+
ErrorResponseSchema: () => ErrorResponseSchema,
|
|
67714
|
+
ErrorBodySchema: () => ErrorBodySchema,
|
|
67006
67715
|
EncryptedSecretValueSchema: () => EncryptedSecretValueSchema,
|
|
67007
67716
|
EmailTriggerMethodSchema: () => EmailTriggerMethodSchema,
|
|
67008
67717
|
Eigenpal: () => Eigenpal,
|
|
67718
|
+
EXTRACTION_ATTEMPT_STATUSES: () => EXTRACTION_ATTEMPT_STATUSES,
|
|
67719
|
+
EXTRACTION_ATTEMPT_KINDS: () => EXTRACTION_ATTEMPT_KINDS,
|
|
67009
67720
|
EXECUTION_TYPES: () => EXECUTION_TYPES,
|
|
67010
67721
|
EXECUTION_STATUSES: () => EXECUTION_STATUSES,
|
|
67011
67722
|
EXECUTION_SHARED_CANCEL_REQUESTABLE_STATUSES: () => EXECUTION_SHARED_CANCEL_REQUESTABLE_STATUSES,
|
|
@@ -67028,6 +67739,7 @@ __export(exports_src, {
|
|
|
67028
67739
|
DocumentParserInputSchema: () => DocumentParserInputSchema,
|
|
67029
67740
|
DocumentParserConfigSchema: () => DocumentParserConfigSchema,
|
|
67030
67741
|
DocumentMetadataSchema: () => DocumentMetadataSchema,
|
|
67742
|
+
DeleteFileResponseSchema: () => DeleteFileResponseSchema,
|
|
67031
67743
|
DbFileRefSchema: () => DbFileRefSchema,
|
|
67032
67744
|
DatasetNameSchema: () => DatasetNameSchema,
|
|
67033
67745
|
DatasetMetaSchema: () => DatasetMetaSchema,
|
|
@@ -67055,16 +67767,24 @@ __export(exports_src, {
|
|
|
67055
67767
|
ControlForeachConfigSchema: () => ControlForeachConfigSchema,
|
|
67056
67768
|
ControlFailOutputSchema: () => ControlFailOutputSchema,
|
|
67057
67769
|
ControlFailConfigSchema: () => ControlFailConfigSchema,
|
|
67770
|
+
ContentKindSchema: () => ContentKindSchema,
|
|
67058
67771
|
ConnectorSchema: () => ConnectorSchema,
|
|
67059
67772
|
ClassifyOutputSchema: () => ClassifyOutputSchema,
|
|
67060
67773
|
ClassifyLabelSchema: () => ClassifyLabelSchema,
|
|
67061
67774
|
ClassifyInputSchema: () => ClassifyInputSchema,
|
|
67062
67775
|
ClassifyConfigSchema: () => ClassifyConfigSchema,
|
|
67776
|
+
ChunkProvenanceSpanSchema: () => ChunkProvenanceSpanSchema,
|
|
67063
67777
|
CUSTOM_SCRIPT_MAX_TIMEOUT_MS: () => CUSTOM_SCRIPT_MAX_TIMEOUT_MS,
|
|
67064
67778
|
CUSTOM_SCRIPT_MAX_MEMORY_MB: () => CUSTOM_SCRIPT_MAX_MEMORY_MB,
|
|
67065
67779
|
CUSTOM_SCRIPT_MAX_BYTES: () => CUSTOM_SCRIPT_MAX_BYTES,
|
|
67066
67780
|
CUSTOM_SCRIPT_CONTRACT: () => CUSTOM_SCRIPT_CONTRACT,
|
|
67781
|
+
CONTENT_KINDS: () => CONTENT_KINDS,
|
|
67067
67782
|
BoundingRegionSchema: () => BoundingRegionSchema,
|
|
67783
|
+
BoundingBoxSchema: () => BoundingBoxSchema,
|
|
67784
|
+
BatchSummaryCountsSchema: () => BatchSummaryCountsSchema,
|
|
67785
|
+
BatchJobAcceptedSchema: () => BatchJobAcceptedSchema,
|
|
67786
|
+
BatchChildSummarySchema: () => BatchChildSummarySchema,
|
|
67787
|
+
BatchChildPageSchema: () => BatchChildPageSchema,
|
|
67068
67788
|
BaseEntitySchema: () => BaseEntitySchema,
|
|
67069
67789
|
BUILTIN_FILE_SOURCE_DESCRIPTORS: () => BUILTIN_FILE_SOURCE_DESCRIPTORS,
|
|
67070
67790
|
AutomationTargetSchema: () => AutomationTargetSchema,
|
|
@@ -67104,6 +67824,7 @@ var init_src = __esm(() => {
|
|
|
67104
67824
|
init_git_source();
|
|
67105
67825
|
init_triggers();
|
|
67106
67826
|
init_webhooks();
|
|
67827
|
+
init_ocr();
|
|
67107
67828
|
init_typed_script();
|
|
67108
67829
|
});
|
|
67109
67830
|
|
|
@@ -181820,7 +182541,7 @@ import { fileURLToPath as fileURLToPath9 } from "url";
|
|
|
181820
182541
|
// package.json
|
|
181821
182542
|
var package_default = {
|
|
181822
182543
|
name: "@eigenpal/cli",
|
|
181823
|
-
version: "0.10.
|
|
182544
|
+
version: "0.10.26",
|
|
181824
182545
|
description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
|
|
181825
182546
|
keywords: [
|
|
181826
182547
|
"eigenpal",
|
|
@@ -400,14 +400,14 @@ Extract structured data from text using AI with a JSON schema
|
|
|
400
400
|
| `provider` | string | no | | Provider ID (e.g., "openai-gpt4o") |
|
|
401
401
|
| `model` | string | no | | Model override |
|
|
402
402
|
| `maxInputTokens` | integer | no | | Max input tokens. Truncates input text and logs a warning when exceeded. Omit for no limit. |
|
|
403
|
-
| `grounded` | boolean | no | |
|
|
404
|
-
| `groundingModel` | string | no | | Provider/model for the grounding pass. Defaults to the workspace default LLM.
|
|
403
|
+
| `grounded` | boolean | no | | Grounding is ON by default: each schema field gets a source span + confidence (high=verbatim, medium=fuzzy, low=ungrounded) under a reserved `_grounding` output key, and fields whose value cannot be located in the source are flagged for human review. Values stay the reliable schema-typed ones. The pass runs through the workspace LLM (any provider) and chunks long documents automatically. Tri-state: unset (default) = on, degrading gracefully to deterministic text alignment (`_grounding._degraded: true`) if no grounding model is available; `true` = strict, the step fails when the grounding model cannot be resolved; `false` = off, no `_grounding` key at all. |
|
|
404
|
+
| `groundingModel` | string | no | | Provider/model for the grounding pass. Defaults to the workspace default LLM. Any configured provider works; the pass only fails the step when `grounded: true` is set explicitly and no model resolves. |
|
|
405
405
|
| `groundingExamples` | array<object> | no | | Optional few-shot examples pinning grounding to verbatim source text per field. |
|
|
406
|
-
| `reviewOn` | `"medium_or_low"` \| `"low_only"` | no | | Which grounding confidences
|
|
406
|
+
| `reviewOn` | `"medium_or_low"` \| `"low_only"` | no | | Which grounding confidences set needsReview on a field. Default: low_only (only fields whose value could not be located in the source). Use medium_or_low to also flag approximate and derived matches. |
|
|
407
407
|
|
|
408
408
|
**Output:** `record<string, unknown>`
|
|
409
409
|
|
|
410
|
-
> Extracted structured data matching the provided schema
|
|
410
|
+
> Extracted structured data matching the provided schema. Unless grounding is disabled (grounded: false), the output also carries a reserved `_grounding` map keyed by field name: `_grounding.<field> = { confidence: high|medium|low, needsReview, reason?, source_span: { start, end, text, alignment } | null }`, plus reserved `_degraded: true` / `_reason` markers when the grounding LLM pass could not run.
|
|
411
411
|
|
|
412
412
|
#### `ai.split` — Split Document
|
|
413
413
|
|