@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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.38.0 - 2026-11-05
4
+
5
+ - Expose optional extraction grounding, with field origins, page evidence and tool-call references.
6
+ - Export types for review locations keyed by item ID, using the existing conditional document request.
7
+
8
+ ## 0.37.0 - 2026-11-05
9
+
10
+ - Support upstream field and classification corrections through the existing `continue` decision.
11
+ The backend recalculates dependent steps and selects the next checkpoint.
12
+ - Type correction provenance (`origin`, `originalValue`), document downstream steps, and
13
+ dossier context and results. `reviews.get()` returns an empty `documents` array when a
14
+ decided review's held data has been released.
15
+
3
16
  ## 0.36.0 - 2026-10-30
4
17
 
5
18
  - Promote the additive review and execution-event client APIs to a stable release.
package/README.md CHANGED
@@ -524,6 +524,27 @@ user confirmation before submitting the same file with `confirmOverwrite: true`.
524
524
  `remove(id, options)` permanently deletes the formula and its authoring data;
525
525
  confirm that action with the user. Import and deletion do not use operation IDs.
526
526
 
527
+ ## Grounding
528
+
529
+ Consumer Edge may include `grounding` on an extraction result at
530
+ `documents[docKey].extractions[stepName]`. `DocmanaExtractionResult` exposes
531
+ this metadata separately from the extracted `data`. Each field has a JSON
532
+ Pointer into `data`, an origin, a nullable probability and its evidence.
533
+ One field can have several rectangles on one or more pages.
534
+
535
+ Rectangles are `[x0, y0, x1, y1]` in page fractions measured from the top left.
536
+ Result pages are one-based within the submitted file (within the generated PDF
537
+ for images grouped by Consumer Edge). A `DERIVED` value can point to document
538
+ evidence or to a tool name and zero-based call index. Tool-only values have
539
+ empty page evidence. Older Consumer versions can omit `tools`, and an extraction
540
+ can omit `grounding` entirely.
541
+
542
+ During human review, `reviews.document(executionId, docKey, "locations", options)`
543
+ returns a `Response` whose JSON body has type `ReviewLocationsResponse`. The
544
+ locations are keyed by review item ID and use one-based pages of the **reviewed
545
+ document**, matching the preview images. Items without page evidence are omitted.
546
+ Use `ifNoneMatch` with the response `ETag` and handle `304` before reading JSON.
547
+
527
548
  ## Human review of formula executions
528
549
 
529
550
  The native pending queue omits documents: load the selected task with `reviews.get()`
@@ -532,6 +553,19 @@ progress belongs to the execution. `ReviewDecision` also supports `confirmations
532
553
  per-correction `reason`, and `durationSeconds`. Conflict details identify an already
533
554
  submitted decision or the current version; no decision is retried automatically.
534
555
 
556
+ To correct an upstream result, read the current task and select the `itemId`
557
+ of a field or classification in `documents[].context`. Submit
558
+ `decision: "continue"` with the current review version and
559
+ `corrections: [{ itemId, value }]`. Confirmations name current `items` only.
560
+ DocMana API validates eligibility, recalculates dependent steps and selects the
561
+ next checkpoint. After the accepted response, read the current task again.
562
+
563
+ `documents[].downstream` and `dossierResults` expose read-only calculated steps.
564
+ `dossierContext` carries the captured JSON context. `origin` and `originalValue`
565
+ describe applied human changes. These fields are optional for older backends.
566
+ When the backend releases a decided task's held data, `reviews.get()` returns
567
+ `documents: []` with the remaining task metadata.
568
+
535
569
  Read calculation metadata repeatedly with
536
570
  `client.reviews.calculation(executionId, { organization })`. It returns
537
571
  `executionResultId`, normalized `executionStatus` and `calculation` (null for
package/dist/cli.mjs CHANGED
@@ -211,6 +211,11 @@ var Reviews = class {
211
211
  return this.http.requestJson("GET", `/executions/${segment(executionId)}/review`, {
212
212
  signal: options.signal,
213
213
  query: { organization: options.organization }
214
+ }).then((task) => {
215
+ if (typeof task?.status === "string" && task.status !== "pending" && task.documents === void 0) {
216
+ return { ...task, documents: [] };
217
+ }
218
+ return task;
214
219
  });
215
220
  }
216
221
  decide(executionId, decision, options) {