@adoptai/genui-components 0.1.56 → 0.1.58

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.
Files changed (52) hide show
  1. package/dist/builders/BuilderForm.d.ts.map +1 -1
  2. package/dist/composites/decision-card/resolver.cjs +634 -0
  3. package/dist/composites/decision-card/resolver.cjs.map +1 -0
  4. package/dist/composites/decision-card/resolver.d.ts +13 -0
  5. package/dist/composites/decision-card/resolver.d.ts.map +1 -0
  6. package/dist/composites/decision-card/resolver.js +627 -0
  7. package/dist/composites/decision-card/resolver.js.map +1 -0
  8. package/dist/composites/document-field-extraction/FieldAuditLog.d.ts +27 -0
  9. package/dist/composites/document-field-extraction/FieldAuditLog.d.ts.map +1 -0
  10. package/dist/composites/document-field-extraction/FieldDetail.d.ts +22 -0
  11. package/dist/composites/document-field-extraction/FieldDetail.d.ts.map +1 -0
  12. package/dist/composites/document-field-extraction/FieldDetails.d.ts +18 -0
  13. package/dist/composites/document-field-extraction/FieldDetails.d.ts.map +1 -0
  14. package/dist/composites/document-field-extraction/bboxTransform.d.ts +25 -0
  15. package/dist/composites/document-field-extraction/bboxTransform.d.ts.map +1 -0
  16. package/dist/composites/document-field-extraction/fieldLabels.d.ts +2 -0
  17. package/dist/composites/document-field-extraction/fieldLabels.d.ts.map +1 -0
  18. package/dist/composites/document-field-extraction/resolver.d.ts +16 -0
  19. package/dist/composites/document-field-extraction/resolver.d.ts.map +1 -0
  20. package/dist/composites/workflow-stepper/resolver.cjs +4 -1
  21. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -1
  22. package/dist/composites/workflow-stepper/resolver.js +4 -1
  23. package/dist/composites/workflow-stepper/resolver.js.map +1 -1
  24. package/dist/index.cjs +2735 -382
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.ts +7 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2530 -183
  29. package/dist/index.js.map +1 -1
  30. package/dist/renderer.cjs +2410 -178
  31. package/dist/renderer.cjs.map +1 -1
  32. package/dist/renderer.js +2267 -35
  33. package/dist/renderer.js.map +1 -1
  34. package/dist/resolver.cjs +2409 -177
  35. package/dist/resolver.cjs.map +1 -1
  36. package/dist/resolver.d.ts.map +1 -1
  37. package/dist/resolver.js +2267 -35
  38. package/dist/resolver.js.map +1 -1
  39. package/dist/schemas/decision-card.d.ts +149 -0
  40. package/dist/schemas/decision-card.d.ts.map +1 -0
  41. package/dist/schemas/document-field-extraction.d.ts +258 -0
  42. package/dist/schemas/document-field-extraction.d.ts.map +1 -0
  43. package/dist/schemas/index.cjs +283 -1
  44. package/dist/schemas/index.cjs.map +1 -1
  45. package/dist/schemas/index.d.ts +407 -0
  46. package/dist/schemas/index.d.ts.map +1 -1
  47. package/dist/schemas/index.js +283 -1
  48. package/dist/schemas/index.js.map +1 -1
  49. package/dist/shared/InteractionContext.d.ts +10 -0
  50. package/dist/shared/InteractionContext.d.ts.map +1 -1
  51. package/dist/tool-definitions.json +359 -3
  52. package/package.json +1 -1
@@ -9,6 +9,16 @@ import React from "react";
9
9
  export interface GenUIInteraction {
10
10
  selectedStepId: string | null;
11
11
  onStepSelect?: (stepId: string | null) => void;
12
+ /** Decision-card resolutions, keyed by decision id, so a resolved card
13
+ * re-renders locked from host state (transcript replay). */
14
+ resolvedDecisions?: Record<string, string>;
15
+ /** Host callback when a decision-card option is chosen. */
16
+ onDecisionResolve?: (decisionId: string, option: string) => void;
17
+ /** Host callback when a decision-card "view source" link is activated. */
18
+ onDecisionSource?: (decisionId: string, source?: {
19
+ url?: string;
20
+ label?: string;
21
+ }) => void;
12
22
  }
13
23
  export declare const DEFAULT_INTERACTION: GenUIInteraction;
14
24
  export interface GenUIInteractionProviderProps {
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionContext.d.ts","sourceRoot":"","sources":["../../src/shared/InteractionContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD;;;;;;GAMG;AACH,MAA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AAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,6BAA6B,2CAM1F;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD"}
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "0.1.56",
3
- "generated_at": "2026-06-18T18:59:47.732Z",
4
- "schema_count": 57,
2
+ "version": "0.1.58",
3
+ "generated_at": "2026-06-24T15:47:16.404Z",
4
+ "schema_count": 59,
5
5
  "schemas": {
6
6
  "data-table": {
7
7
  "name": "render_data_table",
@@ -4736,6 +4736,362 @@
4736
4736
  "steps"
4737
4737
  ]
4738
4738
  }
4739
+ },
4740
+ "document-field-extraction": {
4741
+ "name": "render_document_field_extraction",
4742
+ "description": "Render extracted document fields as an interactive overlay on the page image(s) — colored bounding boxes per field plus a synced field-card list. Use after the extract_document tool returns; pass the returned payload_ref (the host expands it). For invoices, statements, tax forms, receipts, KYC/loan docs, POs where the user wants to SEE where each value sits on the page.",
4743
+ "input_schema": {
4744
+ "type": "object",
4745
+ "properties": {
4746
+ "type": {
4747
+ "type": "string",
4748
+ "enum": [
4749
+ "document-field-extraction"
4750
+ ]
4751
+ },
4752
+ "doc_type": {
4753
+ "type": "string"
4754
+ },
4755
+ "file_name": {
4756
+ "type": "string",
4757
+ "description": "Original uploaded filename; shown as the card title."
4758
+ },
4759
+ "payload_ref": {
4760
+ "type": "string",
4761
+ "description": "Durable store key returned by extract_document; the GenUI host expands it into pages/fields at render time. Pass this verbatim — do NOT hand-build pages/fields."
4762
+ },
4763
+ "store_id": {
4764
+ "type": "string",
4765
+ "description": "Docstore store id; present for persisted workstream docs. The host uses this to open the editable viewer."
4766
+ },
4767
+ "doc_id": {
4768
+ "type": "string",
4769
+ "description": "Docstore document id; present for persisted workstream docs. Required for the editable viewer."
4770
+ },
4771
+ "pages": {
4772
+ "type": "array",
4773
+ "items": {
4774
+ "type": "object",
4775
+ "properties": {
4776
+ "page": {
4777
+ "type": "number",
4778
+ "description": "0-indexed page number"
4779
+ },
4780
+ "imageUrl": {
4781
+ "type": "string"
4782
+ },
4783
+ "width_pt": {
4784
+ "type": "number"
4785
+ },
4786
+ "height_pt": {
4787
+ "type": "number"
4788
+ }
4789
+ },
4790
+ "required": [
4791
+ "page",
4792
+ "width_pt",
4793
+ "height_pt"
4794
+ ]
4795
+ }
4796
+ },
4797
+ "fields": {
4798
+ "type": "array",
4799
+ "items": {
4800
+ "type": "object",
4801
+ "properties": {
4802
+ "field_key": {
4803
+ "type": "string"
4804
+ },
4805
+ "label": {
4806
+ "type": "string"
4807
+ },
4808
+ "value": {
4809
+ "type": "string"
4810
+ },
4811
+ "page": {
4812
+ "type": "number",
4813
+ "description": "0-indexed page number"
4814
+ },
4815
+ "bbox": {
4816
+ "type": "array",
4817
+ "items": {
4818
+ "type": "number"
4819
+ },
4820
+ "description": "[x0,y0,x1,y1] PDF points, origin bottom-left; null if unlocated"
4821
+ },
4822
+ "confidence": {
4823
+ "type": "number"
4824
+ },
4825
+ "confidence_tier": {
4826
+ "type": "string",
4827
+ "enum": [
4828
+ "green",
4829
+ "amber",
4830
+ "red"
4831
+ ]
4832
+ },
4833
+ "badge": {
4834
+ "type": "string",
4835
+ "enum": [
4836
+ "SC",
4837
+ "CN",
4838
+ "AB",
4839
+ "SW"
4840
+ ]
4841
+ },
4842
+ "state": {
4843
+ "type": "string",
4844
+ "enum": [
4845
+ "ok",
4846
+ "corrected",
4847
+ "missing",
4848
+ "warn"
4849
+ ]
4850
+ },
4851
+ "entity_type": {
4852
+ "type": "string"
4853
+ },
4854
+ "is_primary": {
4855
+ "type": "boolean"
4856
+ }
4857
+ },
4858
+ "required": [
4859
+ "field_key",
4860
+ "label",
4861
+ "value",
4862
+ "page"
4863
+ ]
4864
+ }
4865
+ },
4866
+ "page_count": {
4867
+ "type": "number"
4868
+ },
4869
+ "pages_processed": {
4870
+ "type": "number"
4871
+ },
4872
+ "summary": {
4873
+ "type": "object",
4874
+ "description": "Deterministic document summary for the Details tab (display_name, organization, domain, stats, facts, tags). Produced by the extractor — pass through verbatim.",
4875
+ "properties": {
4876
+ "display_name": {
4877
+ "type": "string"
4878
+ },
4879
+ "short_name": {
4880
+ "type": "string"
4881
+ },
4882
+ "organization": {
4883
+ "type": "string"
4884
+ },
4885
+ "domain": {
4886
+ "type": "string"
4887
+ },
4888
+ "domain_group": {
4889
+ "type": "string"
4890
+ },
4891
+ "tax_year": {
4892
+ "type": "string"
4893
+ },
4894
+ "crumbs": {
4895
+ "type": "array",
4896
+ "items": {
4897
+ "type": "string"
4898
+ }
4899
+ },
4900
+ "tags": {
4901
+ "type": "array",
4902
+ "items": {
4903
+ "type": "string"
4904
+ }
4905
+ },
4906
+ "stats": {
4907
+ "type": "array",
4908
+ "items": {
4909
+ "type": "object",
4910
+ "properties": {
4911
+ "field_key": {
4912
+ "type": "string"
4913
+ },
4914
+ "label": {
4915
+ "type": "string"
4916
+ },
4917
+ "value": {
4918
+ "type": "string"
4919
+ },
4920
+ "caption": {
4921
+ "type": "string"
4922
+ }
4923
+ },
4924
+ "required": [
4925
+ "field_key",
4926
+ "label",
4927
+ "value"
4928
+ ]
4929
+ }
4930
+ },
4931
+ "facts": {
4932
+ "type": "array",
4933
+ "items": {
4934
+ "type": "object",
4935
+ "properties": {
4936
+ "field_key": {
4937
+ "type": "string"
4938
+ },
4939
+ "label": {
4940
+ "type": "string"
4941
+ },
4942
+ "value": {
4943
+ "type": "string"
4944
+ },
4945
+ "badge": {
4946
+ "type": "string"
4947
+ }
4948
+ },
4949
+ "required": [
4950
+ "field_key",
4951
+ "label",
4952
+ "value"
4953
+ ]
4954
+ }
4955
+ }
4956
+ }
4957
+ }
4958
+ },
4959
+ "required": [
4960
+ "type"
4961
+ ]
4962
+ }
4963
+ },
4964
+ "decision-card": {
4965
+ "name": "render_decision_card",
4966
+ "description": "Render an inline human-in-the-loop (HITL) decision card — a single judgment the agent needs from the user, resolved in-thread. Shows a titled question with an optional dollar amount at stake, optional data-quality flags, and 2-5 mutually-exclusive resolution options (the first or `recommended` one renders as the primary action), plus an optional 'view source' link. Use for inline approve/choose decisions the user resolves directly in the conversation. NOT for handing off to an external review portal (use escalation-card) and NOT for collecting multiple typed fields (use render_builder).",
4967
+ "input_schema": {
4968
+ "type": "object",
4969
+ "properties": {
4970
+ "type": {
4971
+ "type": "string",
4972
+ "enum": [
4973
+ "decision-card"
4974
+ ]
4975
+ },
4976
+ "id": {
4977
+ "type": "string",
4978
+ "description": "Stable id for update-in-place rendering"
4979
+ },
4980
+ "decision_type": {
4981
+ "type": "string",
4982
+ "description": "Short category shown in the eyebrow, e.g. 'Cross-check', 'Allocation', 'Reserve'"
4983
+ },
4984
+ "title": {
4985
+ "type": "string",
4986
+ "description": "The decision headline, e.g. 'AR reserve adequacy'"
4987
+ },
4988
+ "question": {
4989
+ "type": "string",
4990
+ "description": "The full question / context the user must judge"
4991
+ },
4992
+ "amount": {
4993
+ "type": "number",
4994
+ "description": "Dollar value at stake, e.g. 27100"
4995
+ },
4996
+ "currency": {
4997
+ "type": "string",
4998
+ "description": "ISO currency code; defaults to USD"
4999
+ },
5000
+ "amount_label": {
5001
+ "type": "string",
5002
+ "description": "Caption above the amount, e.g. 'At stake'"
5003
+ },
5004
+ "severity": {
5005
+ "type": "string",
5006
+ "enum": [
5007
+ "low",
5008
+ "medium",
5009
+ "high"
5010
+ ],
5011
+ "description": "Severity of the decision; tints the accent rail"
5012
+ },
5013
+ "flags": {
5014
+ "type": "array",
5015
+ "maxItems": 6,
5016
+ "description": "Optional data-quality flags surfaced on the card",
5017
+ "items": {
5018
+ "type": "object",
5019
+ "properties": {
5020
+ "field": {
5021
+ "type": "string"
5022
+ },
5023
+ "issue": {
5024
+ "type": "string"
5025
+ },
5026
+ "severity": {
5027
+ "type": "string",
5028
+ "enum": [
5029
+ "low",
5030
+ "medium",
5031
+ "high"
5032
+ ]
5033
+ }
5034
+ },
5035
+ "required": [
5036
+ "issue"
5037
+ ]
5038
+ }
5039
+ },
5040
+ "options": {
5041
+ "type": "array",
5042
+ "minItems": 1,
5043
+ "maxItems": 5,
5044
+ "description": "Mutually-exclusive resolution choices; mark one `recommended` to make it primary",
5045
+ "items": {
5046
+ "type": "object",
5047
+ "properties": {
5048
+ "id": {
5049
+ "type": "string"
5050
+ },
5051
+ "label": {
5052
+ "type": "string"
5053
+ },
5054
+ "recommended": {
5055
+ "type": "boolean"
5056
+ }
5057
+ },
5058
+ "required": [
5059
+ "label"
5060
+ ]
5061
+ }
5062
+ },
5063
+ "source": {
5064
+ "type": "object",
5065
+ "description": "Optional provenance link for the figure",
5066
+ "properties": {
5067
+ "label": {
5068
+ "type": "string"
5069
+ },
5070
+ "url": {
5071
+ "type": "string"
5072
+ }
5073
+ }
5074
+ },
5075
+ "resolved": {
5076
+ "type": "object",
5077
+ "description": "Pre-resolved state for transcript replay",
5078
+ "properties": {
5079
+ "option": {
5080
+ "type": "string"
5081
+ }
5082
+ },
5083
+ "required": [
5084
+ "option"
5085
+ ]
5086
+ }
5087
+ },
5088
+ "required": [
5089
+ "type",
5090
+ "title",
5091
+ "question",
5092
+ "options"
5093
+ ]
5094
+ }
4739
5095
  }
4740
5096
  }
4741
5097
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adoptai/genui-components",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "description": "Schema-driven generative UI components for Adopt agents",
5
5
  "private": false,
6
6
  "license": "UNLICENSED",