@docmana/sdk 0.45.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.47.0 - 2026-11-21
4
+
5
+ - Add review item kind `verdict` for explicit native Receivability `__decision__` corrections (`accepted`/`rejected`), independent of formula-defined properties. Requires DOC-2786-compatible Document API and Consumer Edge; no new endpoint.
6
+
7
+ - Add signed `execution.progress` callbacks, the closed 23-message catalogue and `reviews.progress()` for one scoped recovery snapshot with labels. Order by `stateVersion` across resume attempts; current review/terminal execution state remains authoritative. No polling or consuming result read.
8
+
9
+ - Add optional `ReviewDecision.outcome` and approved `ReviewTask.outcome` for a final human acceptance/refusal with a required reason, without recalculating the conclusion. Requires DOC-2782-compatible Document API and Consumer Edge.
10
+ - Document optional correction reasons when changing Receivability from false to true; existing validation derogations still require a reason.
11
+
12
+ ## 0.46.0 - 2026-11-20
13
+
14
+ - Add `reviews.listExecutions` for sortable, offset-paginated HITL execution metadata, including runs submitted directly to DocMana.
15
+
3
16
  ## 0.45.0 - 2026-11-19
4
17
 
5
18
  - Add optional `callbackUrl` to `detectFraudAsync` for file and URL jobs. Consumer Edge delivers the terminal `FraudDetectionResult` by POST. Applications can check `supportsFraudCallbacks` when running against multiple SDK versions.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @docmana/sdk
2
2
 
3
+ DOC-2786 adds review items of kind `verdict`, field `__decision__`, on executed Receivability nodes. Submit the returned opaque `itemId` through `reviews.decide()` with value `accepted` or `rejected`; an optional reason is allowed for rejected-to-accepted overrides. This native verdict is independent of formula-defined boolean properties, which an application may correct separately in the same decision. Node status and downstream routing follow the human verdict without rejudging the corrected node. Requires compatible Document API and Consumer Edge; downstream items and `status` items stay read-only.
4
+
3
5
  The HITL pilot uses the explicit prerelease `0.36.0-hitl.2` and the npm `hitl`
4
6
  distribution tag. Install the exact version for reproducible pilot builds:
5
7
 
@@ -581,6 +583,15 @@ evidence or to a tool name and zero-based call index. Tool-only values have
581
583
  empty page evidence. Older Consumer versions can omit `tools`, and an extraction
582
584
  can omit `grounding` entirely.
583
585
 
586
+ With DOC-2782-compatible Document API and Consumer Edge, a Receivability
587
+ `false` → `true` correction accepts an optional per-correction `reason`.
588
+ To record a final human decision on a `Finish` review, send `decision: "continue"`,
589
+ `outcome: "accepted"` or `"refused"`, a nonblank `reason`, and no value corrections.
590
+ This closes the existing review without recalculating the conclusion; a refused
591
+ business outcome does not technically reject the execution. The approved task's
592
+ optional `outcome` and protected history/final review block retain the decision.
593
+ Deploy Document API, then Consumer compatibility before using this additive field.
594
+
584
595
  `reviews.decide()` accepts optional `pageReassignments`, for example
585
596
  `[{ docKey: "receipt", page: 2, documentType: "payment_proof", group: "payment" }]`.
586
597
  Pages are one-based and each moved page has one target type. The optional group
@@ -596,6 +607,19 @@ Use `ifNoneMatch` with the response `ETag` and handle `304` before reading JSON.
596
607
 
597
608
  ## Human review of formula executions
598
609
 
610
+ `reviews.listExecutions` lists active and terminal HITL executions in one organization, including runs submitted outside Arcana. It returns `{ items, limit, offset, total }` and leaves final results available for retrieval. Use `flowId` or `executionId` to narrow the list. The default is 50 rows (maximum 100), offset zero, newest first.
611
+
612
+ ```typescript
613
+ const page = await docmana.reviews.listExecutions({
614
+ organization: "my-org",
615
+ flowId: "my-formula",
616
+ limit: 20,
617
+ offset: 20,
618
+ sortBy: "createdAt",
619
+ sortDirection: "desc",
620
+ });
621
+ ```
622
+
599
623
  The native pending queue omits documents: load the selected task with `reviews.get()`
600
624
  before displaying its values and documents. Decided tasks leave this queue; resume
601
625
  progress belongs to the execution. `ReviewDecision` also supports `confirmations`,
@@ -780,3 +804,15 @@ stable review-scoped `id`, `code`, `message`, resolved `itemIds`, and optional
780
804
  explanation text. Missing or empty findings preserve the existing presentation.
781
805
  These are frozen evidence, not per-field decisions; editing a value does not
782
806
  erase its finding. Continue using the same global, versioned decision call.
807
+
808
+ ### Resume progress callbacks
809
+
810
+ `verifyExecutionEventCallback` also validates `execution.progress`: opaque `revision`,
811
+ monotonic `stateVersion`, phase, node/item counters and the closed `PROGRESS_MESSAGE_KEYS`.
812
+ Order by `stateVersion` across attempts; deduplicate equal/lower snapshots. Callback
813
+ payloads contain identifiers and codes only. Resolve display labels with one
814
+ `client.reviews.progress(executionId, { organization, signal })` read when opening
815
+ or reconnecting; this never polls or consumes the result. Progress describes a
816
+ resume after a correction, not initial execution or human confirmation. Missing
817
+ or partial snapshots are possible. The current pending task and terminal execution
818
+ status override an older running progress snapshot.