@docmana/sdk 0.46.0 → 0.47.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.
@@ -0,0 +1,81 @@
1
+ export declare const EXECUTION_PROGRESS_TYPE: "execution.progress";
2
+ export declare const PROGRESS_MESSAGE_KEYS: readonly ["resume.running", "resume.awaitingReview", "resume.completed", "resume.rejected", "resume.failed", "node.pending", "node.running", "node.done", "node.failed", "node.reused", "node.skipped", "item.pending", "item.running", "item.llmCall", "item.llmCallRetry", "item.subagent", "item.subagentBatch", "item.ocrCall", "item.done", "item.failed", "item.reused", "item.skippedAncestorFailed", "item.skippedBranchNotTaken"];
3
+ export type ResumeProgressStatus = "pending" | "running" | "done" | "failed" | "skipped" | "reused";
4
+ export interface ProgressMessage {
5
+ key: (typeof PROGRESS_MESSAGE_KEYS)[number];
6
+ params: {
7
+ nodeId?: string;
8
+ docKey?: string;
9
+ branchId?: string | null;
10
+ done?: number;
11
+ total?: number;
12
+ attempt?: number;
13
+ batch?: number;
14
+ batches?: number;
15
+ };
16
+ }
17
+ export interface ResumeProgressItem {
18
+ documentKey: string;
19
+ branchId: string | null;
20
+ status: ResumeProgressStatus;
21
+ startedAt: string | null;
22
+ endedAt: string | null;
23
+ activity: null | {
24
+ kind: "llm_call" | "subagent" | "ocr_call";
25
+ attempt: number | null;
26
+ batch: number | null;
27
+ batches: number | null;
28
+ };
29
+ message: ProgressMessage;
30
+ }
31
+ export interface ResumeProgressNode {
32
+ nodeId: string;
33
+ nodeType: string;
34
+ status: ResumeProgressStatus;
35
+ /** Work items, including branches; not a count of unique physical documents. */
36
+ documents: {
37
+ total: number;
38
+ pending: number;
39
+ running: number;
40
+ done: number;
41
+ failed: number;
42
+ skipped: number;
43
+ reused: number;
44
+ };
45
+ message: ProgressMessage;
46
+ items: ResumeProgressItem[];
47
+ }
48
+ export interface ExecutionResumeProgress {
49
+ schemaVersion: 1;
50
+ eventId: string;
51
+ type: typeof EXECUTION_PROGRESS_TYPE;
52
+ organization: string;
53
+ executionResultId: string;
54
+ flowId: string;
55
+ flowVersion: number | null;
56
+ reviewId: string;
57
+ /** Opaque resume-attempt timestamp. Order snapshots using stateVersion only. */
58
+ revision: string;
59
+ stateVersion: number;
60
+ phase: "running" | "awaiting_review" | "completed" | "rejected" | "failed";
61
+ message: ProgressMessage;
62
+ updatedAt: string;
63
+ publishedAt?: string;
64
+ itemsTruncated: boolean;
65
+ nodesTruncated: boolean;
66
+ nodes: ResumeProgressNode[];
67
+ }
68
+ export interface ResumeProgressLabels {
69
+ nodes: Record<string, {
70
+ name: string | null;
71
+ type: string;
72
+ }>;
73
+ documents: Record<string, string | null>;
74
+ branches: Record<string, string | null>;
75
+ }
76
+ export interface ResumeProgressResponse extends ExecutionResumeProgress {
77
+ labels: ResumeProgressLabels;
78
+ }
79
+ /** Validates and projects the closed public callback contract. Never returns output values or labels. */
80
+ export declare function parseExecutionProgress(value: unknown): ExecutionResumeProgress;
81
+ export declare function parseResumeProgressResponse(value: unknown): ResumeProgressResponse;
package/dist/reviews.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { HttpClient } from "./http/http-client.js";
2
+ import { type ResumeProgressResponse } from "./resume-progress.js";
2
3
  import type { GroundingBox, GroundingOrigin } from "./models/docmana-extraction-result.model.js";
3
4
  import type { ExecutionStatus } from "./models/execution-status.enum.js";
4
5
  export type ReviewExecutionSort = "createdAt" | "executionResultId" | "flowId" | "executionStatus";
@@ -88,7 +89,8 @@ export interface DocumentPreviewManifest {
88
89
  }
89
90
  export interface ReviewItem {
90
91
  itemId: string;
91
- kind: "field" | "classification" | "status";
92
+ /** Native Receivability verdict: field __decision__, accepted/rejected; independent of formula fields. */
93
+ kind: "field" | "classification" | "status" | "verdict";
92
94
  nodeId: string | null;
93
95
  nodeName: string;
94
96
  field: string;
@@ -168,6 +170,8 @@ export interface ReviewTask extends ReviewSummary {
168
170
  submittedAt?: string | null;
169
171
  resumingAt?: string | null;
170
172
  closedAt?: string | null;
173
+ /** Human business outcome of an approved conclusion, distinct from technical execution status. */
174
+ outcome?: "accepted" | "refused";
171
175
  }
172
176
  export interface ReviewFinding {
173
177
  id: string;
@@ -191,7 +195,7 @@ export interface ReviewDecision {
191
195
  */
192
196
  reviewer?: ReviewReviewerIdentity | string;
193
197
  version: number;
194
- /** Current items or upstream context fields/classifications, never downstream/status items. */
198
+ /** Current/upstream fields, classifications or native verdicts; never downstream/status items. */
195
199
  corrections?: Array<{
196
200
  itemId: string;
197
201
  value: unknown;
@@ -210,7 +214,10 @@ export interface ReviewDecision {
210
214
  excludedDocuments?: string[];
211
215
  rerunDocuments?: string[];
212
216
  hint?: string;
217
+ /** Required for a final outcome or technical rejection; optional for exclusion. */
213
218
  reason?: string;
219
+ /** Finish only: continue with reason and no corrections, without recomputing calculated values. */
220
+ outcome?: "accepted" | "refused";
214
221
  }
215
222
  export interface ReviewReadOptions {
216
223
  organization: string;
@@ -240,6 +247,8 @@ export interface ReviewLocationsResponse {
240
247
  /** Human review of a formula execution. Independent of pipelines and final callbacks. */
241
248
  export declare class Reviews {
242
249
  private readonly http;
250
+ /** One non-consuming snapshot read for opening/reconnecting a view. No polling. */
251
+ progress(executionId: string, options: ReviewReadOptions): Promise<ResumeProgressResponse>;
243
252
  constructor(http: HttpClient);
244
253
  /** Read a page of HITL execution metadata without consuming any result. */
245
254
  listExecutions(options: ReviewExecutionListOptions): Promise<ReviewExecutionPage>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docmana/sdk",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "Official Docmana SDK — run document-analysis flows with a single call.",
5
5
  "license": "MIT",
6
6
  "type": "module",