@docmana/sdk 0.36.0 → 0.38.0
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 +13 -0
- package/README.md +34 -0
- package/dist/cli.mjs +5 -0
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/models/docmana-extraction-result.model.d.ts +30 -1
- package/dist/reviews.d.ts +32 -0
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
import { DocmanaNodeResult } from "./docmana-node-result.model.js";
|
|
1
|
+
import type { DocmanaNodeResult } from "./docmana-node-result.model.js";
|
|
2
|
+
export type GroundingOrigin = "LITERAL" | "DERIVED" | "INFERRED" | "UNSUPPORTED" | "UNVERIFIED" | "HUMAN_CORRECTED";
|
|
3
|
+
/** Page fractions, measured from the top left. */
|
|
4
|
+
export type GroundingBox = [x0: number, y0: number, x1: number, y1: number];
|
|
5
|
+
export interface DocmanaGroundingEvidence {
|
|
6
|
+
/** One-based page of the submitted file, or of the PDF generated for grouped images. */
|
|
7
|
+
page: number;
|
|
8
|
+
boxes: GroundingBox[];
|
|
9
|
+
}
|
|
10
|
+
export interface DocmanaGroundingTool {
|
|
11
|
+
tool: string;
|
|
12
|
+
/** Zero-based call index within the extraction step. */
|
|
13
|
+
call: number;
|
|
14
|
+
}
|
|
15
|
+
export interface DocmanaGroundingField {
|
|
16
|
+
/** JSON Pointer into the extraction step's data. */
|
|
17
|
+
path: string;
|
|
18
|
+
origin: GroundingOrigin;
|
|
19
|
+
probability: number | null;
|
|
20
|
+
evidence: DocmanaGroundingEvidence[];
|
|
21
|
+
/** Absent on older servers. A tool-only value can have no page evidence. */
|
|
22
|
+
tools?: DocmanaGroundingTool[];
|
|
23
|
+
}
|
|
24
|
+
export interface DocmanaGrounding {
|
|
25
|
+
version: number;
|
|
26
|
+
error: string | null;
|
|
27
|
+
fields: DocmanaGroundingField[];
|
|
28
|
+
}
|
|
2
29
|
export interface DocmanaExtractionResult extends DocmanaNodeResult {
|
|
30
|
+
/** Present when the server produced grounding for this extraction step. */
|
|
31
|
+
grounding?: DocmanaGrounding;
|
|
3
32
|
}
|
package/dist/reviews.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from "./http/http-client.js";
|
|
2
|
+
import type { GroundingBox, GroundingOrigin } from "./models/docmana-extraction-result.model.js";
|
|
2
3
|
import type { ExecutionStatus } from "./models/execution-status.enum.js";
|
|
3
4
|
export interface ReviewCalculation {
|
|
4
5
|
executionResultId: string;
|
|
@@ -62,6 +63,18 @@ export interface ReviewItem {
|
|
|
62
63
|
nodeName: string;
|
|
63
64
|
field: string;
|
|
64
65
|
value: unknown;
|
|
66
|
+
origin?: "proposed" | "confirmed" | "corrected";
|
|
67
|
+
originalValue?: unknown;
|
|
68
|
+
}
|
|
69
|
+
/** Captured node outputs. Downstream and dossier results are read-only. */
|
|
70
|
+
export interface ReviewStep {
|
|
71
|
+
nodeId: string;
|
|
72
|
+
nodeName: string | null;
|
|
73
|
+
nodeType: string;
|
|
74
|
+
documentType?: string;
|
|
75
|
+
status: "provisional" | "failed" | "notExecuted";
|
|
76
|
+
score?: number;
|
|
77
|
+
items?: ReviewItem[];
|
|
65
78
|
}
|
|
66
79
|
export interface ReviewDocument {
|
|
67
80
|
docKey: string;
|
|
@@ -78,7 +91,9 @@ export interface ReviewDocument {
|
|
|
78
91
|
pagesComplete?: boolean;
|
|
79
92
|
contentUrl?: string;
|
|
80
93
|
items?: ReviewItem[];
|
|
94
|
+
/** Upstream fields/classifications may be corrected via continue; Core validates eligibility. */
|
|
81
95
|
context?: ReviewItem[];
|
|
96
|
+
downstream?: ReviewStep[];
|
|
82
97
|
/** Read-only evidence from the frozen pause; absent on older backends. */
|
|
83
98
|
assessments?: ReviewAssessment[];
|
|
84
99
|
}
|
|
@@ -115,6 +130,8 @@ export interface ReviewSummary {
|
|
|
115
130
|
}
|
|
116
131
|
export interface ReviewTask extends ReviewSummary {
|
|
117
132
|
documents: ReviewDocument[];
|
|
133
|
+
dossierContext?: Record<string, unknown>;
|
|
134
|
+
dossierResults?: ReviewStep[];
|
|
118
135
|
/** Explicit frozen field signals. Missing/empty keeps legacy UI and global confirmation. */
|
|
119
136
|
findings?: ReviewFinding[];
|
|
120
137
|
/** Native lifecycle timestamps, absent on older backends; never inferred from callbacks. */
|
|
@@ -134,11 +151,13 @@ export interface ReviewDecision {
|
|
|
134
151
|
decision: "continue" | "exclude" | "rerun" | "reject";
|
|
135
152
|
reviewer: string;
|
|
136
153
|
version: number;
|
|
154
|
+
/** Current items or upstream context fields/classifications, never downstream/status items. */
|
|
137
155
|
corrections?: Array<{
|
|
138
156
|
itemId: string;
|
|
139
157
|
value: unknown;
|
|
140
158
|
reason?: string;
|
|
141
159
|
}>;
|
|
160
|
+
/** Confirmations are limited to the current node's items. */
|
|
142
161
|
confirmations?: string[];
|
|
143
162
|
durationSeconds?: number;
|
|
144
163
|
excludedDocuments?: string[];
|
|
@@ -158,6 +177,19 @@ export interface ReviewDocumentOptions extends ReviewReadOptions {
|
|
|
158
177
|
ifNoneMatch?: string;
|
|
159
178
|
ifModifiedSince?: string;
|
|
160
179
|
}
|
|
180
|
+
export interface ReviewLocation {
|
|
181
|
+
/** JSON Pointer relative to the item value, or empty for the value itself. */
|
|
182
|
+
path: string;
|
|
183
|
+
origin: Exclude<GroundingOrigin, "HUMAN_CORRECTED">;
|
|
184
|
+
probability: number | null;
|
|
185
|
+
/** One-based page of the reviewed document, as used by the preview images. */
|
|
186
|
+
page: number;
|
|
187
|
+
boxes: GroundingBox[];
|
|
188
|
+
}
|
|
189
|
+
export interface ReviewLocationsResponse {
|
|
190
|
+
/** Locations keyed by review item ID. Items without page evidence are omitted. */
|
|
191
|
+
locations: Record<string, ReviewLocation[]>;
|
|
192
|
+
}
|
|
161
193
|
/** Human review of a formula execution. Independent of pipelines and final callbacks. */
|
|
162
194
|
export declare class Reviews {
|
|
163
195
|
private readonly http;
|
package/dist/types.d.ts
CHANGED
|
@@ -277,7 +277,7 @@ export type { DocmanaCrossValidationResult } from "./models/docmana-cross-valida
|
|
|
277
277
|
export type { DocmanaConclusionResult } from "./models/docmana-conclusion-result.model.js";
|
|
278
278
|
export type { DocmanaClassificationResult } from "./models/docmana-classification-result.model.js";
|
|
279
279
|
export type { DocmanaMetadataExtractionResult } from "./models/docmana-metadata-extraction-result.model.js";
|
|
280
|
-
export type { DocmanaExtractionResult } from "./models/docmana-extraction-result.model.js";
|
|
280
|
+
export type { DocmanaExtractionResult, DocmanaGrounding, DocmanaGroundingEvidence, DocmanaGroundingField, DocmanaGroundingTool, GroundingBox, GroundingOrigin, } from "./models/docmana-extraction-result.model.js";
|
|
281
281
|
export type { DocmanaValidationResult } from "./models/docmana-validation-result.model.js";
|
|
282
282
|
export type { DocmanaPreprocessingResult } from "./models/docmana-preprocessing-result.model.js";
|
|
283
283
|
export type { PartialExecutionFlowVersion, PartialExecutionMetadata, PartialExecutionScope, } from "./models/partial-execution-metadata.model.js";
|