@adoptai/genui-components 0.1.59 → 0.1.61

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 (45) hide show
  1. package/dist/builders/BlockForm.d.ts +5 -1
  2. package/dist/builders/BlockForm.d.ts.map +1 -1
  3. package/dist/builders/BuilderForm.d.ts +22 -1
  4. package/dist/builders/BuilderForm.d.ts.map +1 -1
  5. package/dist/builders/index.d.ts +1 -1
  6. package/dist/builders/index.d.ts.map +1 -1
  7. package/dist/composites/decision-card/resolver.cjs +296 -17
  8. package/dist/composites/decision-card/resolver.cjs.map +1 -1
  9. package/dist/composites/decision-card/resolver.d.ts +9 -2
  10. package/dist/composites/decision-card/resolver.d.ts.map +1 -1
  11. package/dist/composites/decision-card/resolver.js +296 -18
  12. package/dist/composites/decision-card/resolver.js.map +1 -1
  13. package/dist/composites/decision-queue/resolver.d.ts +22 -0
  14. package/dist/composites/decision-queue/resolver.d.ts.map +1 -0
  15. package/dist/composites/workflow-stepper/resolver.cjs +2 -1
  16. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -1
  17. package/dist/composites/workflow-stepper/resolver.js +2 -1
  18. package/dist/composites/workflow-stepper/resolver.js.map +1 -1
  19. package/dist/index.cjs +881 -46
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.js +881 -46
  22. package/dist/index.js.map +1 -1
  23. package/dist/renderer.cjs +790 -28
  24. package/dist/renderer.cjs.map +1 -1
  25. package/dist/renderer.js +790 -28
  26. package/dist/renderer.js.map +1 -1
  27. package/dist/resolver.cjs +790 -28
  28. package/dist/resolver.cjs.map +1 -1
  29. package/dist/resolver.d.ts.map +1 -1
  30. package/dist/resolver.js +790 -28
  31. package/dist/resolver.js.map +1 -1
  32. package/dist/schemas/decision-card.d.ts +37 -0
  33. package/dist/schemas/decision-card.d.ts.map +1 -1
  34. package/dist/schemas/decision-queue.d.ts +227 -0
  35. package/dist/schemas/decision-queue.d.ts.map +1 -0
  36. package/dist/schemas/index.cjs +191 -5
  37. package/dist/schemas/index.cjs.map +1 -1
  38. package/dist/schemas/index.d.ts +264 -0
  39. package/dist/schemas/index.d.ts.map +1 -1
  40. package/dist/schemas/index.js +191 -5
  41. package/dist/schemas/index.js.map +1 -1
  42. package/dist/shared/InteractionContext.d.ts +10 -0
  43. package/dist/shared/InteractionContext.d.ts.map +1 -1
  44. package/dist/tool-definitions.json +236 -4
  45. package/package.json +1 -1
@@ -26,6 +26,13 @@ export declare const decisionCardSchema: z.ZodObject<{
26
26
  id: z.ZodOptional<z.ZodString>;
27
27
  label: z.ZodString;
28
28
  recommended: z.ZodOptional<z.ZodBoolean>;
29
+ value: z.ZodOptional<z.ZodNumber>;
30
+ adjust: z.ZodOptional<z.ZodObject<{
31
+ min: z.ZodNumber;
32
+ max: z.ZodNumber;
33
+ step: z.ZodOptional<z.ZodNumber>;
34
+ unit: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>>;
29
36
  }, z.core.$strip>>;
30
37
  source: z.ZodOptional<z.ZodObject<{
31
38
  label: z.ZodOptional<z.ZodString>;
@@ -33,6 +40,7 @@ export declare const decisionCardSchema: z.ZodObject<{
33
40
  }, z.core.$strip>>;
34
41
  resolved: z.ZodOptional<z.ZodObject<{
35
42
  option: z.ZodString;
43
+ value: z.ZodOptional<z.ZodNumber>;
36
44
  }, z.core.$strip>>;
37
45
  }, z.core.$strip>;
38
46
  export declare const decisionCardTool: {
@@ -116,6 +124,31 @@ export declare const decisionCardTool: {
116
124
  recommended: {
117
125
  type: string;
118
126
  };
127
+ value: {
128
+ type: string;
129
+ description: string;
130
+ };
131
+ adjust: {
132
+ type: string;
133
+ description: string;
134
+ properties: {
135
+ min: {
136
+ type: string;
137
+ };
138
+ max: {
139
+ type: string;
140
+ };
141
+ step: {
142
+ type: string;
143
+ description: string;
144
+ };
145
+ unit: {
146
+ type: string;
147
+ description: string;
148
+ };
149
+ };
150
+ required: string[];
151
+ };
119
152
  };
120
153
  required: string[];
121
154
  };
@@ -139,6 +172,10 @@ export declare const decisionCardTool: {
139
172
  option: {
140
173
  type: string;
141
174
  };
175
+ value: {
176
+ type: string;
177
+ description: string;
178
+ };
142
179
  };
143
180
  required: string[];
144
181
  };
@@ -1 +1 @@
1
- {"version":3,"file":"decision-card.d.ts","sourceRoot":"","sources":["../../src/schemas/decision-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyC7B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuE5B,CAAC"}
1
+ {"version":3,"file":"decision-card.d.ts","sourceRoot":"","sources":["../../src/schemas/decision-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmD7B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwF5B,CAAC"}
@@ -0,0 +1,227 @@
1
+ import { z } from "zod";
2
+ export declare const decisionQueueSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"decision-queue">;
4
+ id: z.ZodOptional<z.ZodString>;
5
+ title: z.ZodOptional<z.ZodString>;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ submit_label: z.ZodOptional<z.ZodString>;
8
+ items: z.ZodArray<z.ZodObject<{
9
+ id: z.ZodOptional<z.ZodString>;
10
+ decision_type: z.ZodOptional<z.ZodString>;
11
+ title: z.ZodString;
12
+ question: z.ZodString;
13
+ amount: z.ZodOptional<z.ZodNumber>;
14
+ currency: z.ZodOptional<z.ZodString>;
15
+ amount_label: z.ZodOptional<z.ZodString>;
16
+ severity: z.ZodOptional<z.ZodEnum<{
17
+ high: "high";
18
+ medium: "medium";
19
+ low: "low";
20
+ }>>;
21
+ flags: z.ZodOptional<z.ZodArray<z.ZodObject<{
22
+ field: z.ZodOptional<z.ZodString>;
23
+ issue: z.ZodString;
24
+ severity: z.ZodOptional<z.ZodEnum<{
25
+ high: "high";
26
+ medium: "medium";
27
+ low: "low";
28
+ }>>;
29
+ }, z.core.$strip>>>;
30
+ options: z.ZodArray<z.ZodObject<{
31
+ id: z.ZodOptional<z.ZodString>;
32
+ label: z.ZodString;
33
+ recommended: z.ZodOptional<z.ZodBoolean>;
34
+ value: z.ZodOptional<z.ZodNumber>;
35
+ adjust: z.ZodOptional<z.ZodObject<{
36
+ min: z.ZodNumber;
37
+ max: z.ZodNumber;
38
+ step: z.ZodOptional<z.ZodNumber>;
39
+ unit: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>>;
42
+ source: z.ZodOptional<z.ZodObject<{
43
+ label: z.ZodOptional<z.ZodString>;
44
+ url: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>;
46
+ }, z.core.$strip>>;
47
+ resolved: z.ZodOptional<z.ZodObject<{
48
+ decisions: z.ZodArray<z.ZodObject<{
49
+ id: z.ZodOptional<z.ZodString>;
50
+ title: z.ZodString;
51
+ option: z.ZodString;
52
+ value: z.ZodOptional<z.ZodNumber>;
53
+ }, z.core.$strip>>;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>;
56
+ export declare const decisionQueueTool: {
57
+ name: string;
58
+ description: string;
59
+ input_schema: {
60
+ type: "object";
61
+ properties: {
62
+ type: {
63
+ type: string;
64
+ enum: string[];
65
+ };
66
+ id: {
67
+ type: string;
68
+ description: string;
69
+ };
70
+ title: {
71
+ type: string;
72
+ description: string;
73
+ };
74
+ description: {
75
+ type: string;
76
+ description: string;
77
+ };
78
+ submit_label: {
79
+ type: string;
80
+ description: string;
81
+ };
82
+ items: {
83
+ type: string;
84
+ minItems: number;
85
+ maxItems: number;
86
+ description: string;
87
+ items: {
88
+ type: string;
89
+ properties: {
90
+ id: {
91
+ type: string;
92
+ };
93
+ decision_type: {
94
+ type: string;
95
+ description: string;
96
+ };
97
+ title: {
98
+ type: string;
99
+ };
100
+ question: {
101
+ type: string;
102
+ };
103
+ amount: {
104
+ type: string;
105
+ };
106
+ currency: {
107
+ type: string;
108
+ };
109
+ amount_label: {
110
+ type: string;
111
+ };
112
+ severity: {
113
+ type: string;
114
+ enum: string[];
115
+ };
116
+ flags: {
117
+ type: string;
118
+ maxItems: number;
119
+ items: {
120
+ type: string;
121
+ properties: {
122
+ field: {
123
+ type: string;
124
+ };
125
+ issue: {
126
+ type: string;
127
+ };
128
+ severity: {
129
+ type: string;
130
+ enum: string[];
131
+ };
132
+ };
133
+ required: string[];
134
+ };
135
+ };
136
+ options: {
137
+ type: string;
138
+ minItems: number;
139
+ maxItems: number;
140
+ items: {
141
+ type: string;
142
+ properties: {
143
+ id: {
144
+ type: string;
145
+ };
146
+ label: {
147
+ type: string;
148
+ };
149
+ recommended: {
150
+ type: string;
151
+ };
152
+ value: {
153
+ type: string;
154
+ description: string;
155
+ };
156
+ adjust: {
157
+ type: string;
158
+ description: string;
159
+ properties: {
160
+ min: {
161
+ type: string;
162
+ };
163
+ max: {
164
+ type: string;
165
+ };
166
+ step: {
167
+ type: string;
168
+ };
169
+ unit: {
170
+ type: string;
171
+ description: string;
172
+ };
173
+ };
174
+ required: string[];
175
+ };
176
+ };
177
+ required: string[];
178
+ };
179
+ };
180
+ source: {
181
+ type: string;
182
+ properties: {
183
+ label: {
184
+ type: string;
185
+ };
186
+ url: {
187
+ type: string;
188
+ };
189
+ };
190
+ };
191
+ };
192
+ required: string[];
193
+ };
194
+ };
195
+ resolved: {
196
+ type: string;
197
+ description: string;
198
+ properties: {
199
+ decisions: {
200
+ type: string;
201
+ items: {
202
+ type: string;
203
+ properties: {
204
+ id: {
205
+ type: string;
206
+ };
207
+ title: {
208
+ type: string;
209
+ };
210
+ option: {
211
+ type: string;
212
+ };
213
+ value: {
214
+ type: string;
215
+ };
216
+ };
217
+ required: string[];
218
+ };
219
+ };
220
+ };
221
+ required: string[];
222
+ };
223
+ };
224
+ required: string[];
225
+ };
226
+ };
227
+ //# sourceMappingURL=decision-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-queue.d.ts","sourceRoot":"","sources":["../../src/schemas/decision-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmDxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmB9B,CAAC;AA2BH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqF7B,CAAC"}
@@ -3703,7 +3703,14 @@ var decisionCardSchema = zod.z.object({
3703
3703
  zod.z.object({
3704
3704
  id: zod.z.string().optional(),
3705
3705
  label: zod.z.string(),
3706
- recommended: zod.z.boolean().optional()
3706
+ recommended: zod.z.boolean().optional(),
3707
+ value: zod.z.number().optional(),
3708
+ adjust: zod.z.object({
3709
+ min: zod.z.number(),
3710
+ max: zod.z.number(),
3711
+ step: zod.z.number().optional(),
3712
+ unit: zod.z.string().optional()
3713
+ }).optional()
3707
3714
  })
3708
3715
  ).min(1).max(5),
3709
3716
  source: zod.z.object({
@@ -3711,7 +3718,8 @@ var decisionCardSchema = zod.z.object({
3711
3718
  url: zod.z.string().optional()
3712
3719
  }).optional(),
3713
3720
  resolved: zod.z.object({
3714
- option: zod.z.string()
3721
+ option: zod.z.string(),
3722
+ value: zod.z.number().optional()
3715
3723
  }).optional()
3716
3724
  });
3717
3725
  var decisionCardTool = {
@@ -3754,13 +3762,28 @@ var decisionCardTool = {
3754
3762
  type: "array",
3755
3763
  minItems: 1,
3756
3764
  maxItems: 5,
3757
- description: "Mutually-exclusive resolution choices; mark one `recommended` to make it primary",
3765
+ description: "Mutually-exclusive resolution choices; mark one `recommended` to make it primary. An option that carries a numeric figure the user may want to tune (e.g. 'Book reserve' at 50 units) should set `value` (your suggested figure) and `adjust` ({min,max[,step,unit]}) \u2014 the card then lets the user fine-tune the number within that range before confirming.",
3758
3766
  items: {
3759
3767
  type: "object",
3760
3768
  properties: {
3761
3769
  id: { type: "string" },
3762
3770
  label: { type: "string" },
3763
- recommended: { type: "boolean" }
3771
+ recommended: { type: "boolean" },
3772
+ value: {
3773
+ type: "number",
3774
+ description: "Suggested numeric figure for this option (the starting point of the adjuster)"
3775
+ },
3776
+ adjust: {
3777
+ type: "object",
3778
+ description: "Allow the user to tune `value` within this inclusive range before resolving",
3779
+ properties: {
3780
+ min: { type: "number" },
3781
+ max: { type: "number" },
3782
+ step: { type: "number", description: "Increment granularity; defaults to a sensible step for the range" },
3783
+ unit: { type: "string", description: "Short unit suffix shown after the number, e.g. 'units', '%', 'hrs'" }
3784
+ },
3785
+ required: ["min", "max"]
3786
+ }
3764
3787
  },
3765
3788
  required: ["label"]
3766
3789
  }
@@ -3777,7 +3800,8 @@ var decisionCardTool = {
3777
3800
  type: "object",
3778
3801
  description: "Pre-resolved state for transcript replay",
3779
3802
  properties: {
3780
- option: { type: "string" }
3803
+ option: { type: "string" },
3804
+ value: { type: "number", description: "Adjusted figure the user confirmed, when the option was adjustable" }
3781
3805
  },
3782
3806
  required: ["option"]
3783
3807
  }
@@ -3785,6 +3809,167 @@ var decisionCardTool = {
3785
3809
  required: ["type", "title", "question", "options"]
3786
3810
  }
3787
3811
  };
3812
+ var decisionQueueItemSchema = zod.z.object({
3813
+ id: zod.z.string().optional(),
3814
+ decision_type: zod.z.string().optional(),
3815
+ title: zod.z.string(),
3816
+ question: zod.z.string(),
3817
+ amount: zod.z.number().optional(),
3818
+ currency: zod.z.string().optional(),
3819
+ amount_label: zod.z.string().optional(),
3820
+ severity: zod.z.enum(["low", "medium", "high"]).optional(),
3821
+ flags: zod.z.array(
3822
+ zod.z.object({
3823
+ field: zod.z.string().optional(),
3824
+ issue: zod.z.string(),
3825
+ severity: zod.z.enum(["low", "medium", "high"]).optional()
3826
+ })
3827
+ ).max(6).optional(),
3828
+ options: zod.z.array(
3829
+ zod.z.object({
3830
+ id: zod.z.string().optional(),
3831
+ label: zod.z.string(),
3832
+ recommended: zod.z.boolean().optional(),
3833
+ value: zod.z.number().optional(),
3834
+ adjust: zod.z.object({
3835
+ min: zod.z.number(),
3836
+ max: zod.z.number(),
3837
+ step: zod.z.number().optional(),
3838
+ unit: zod.z.string().optional()
3839
+ }).optional()
3840
+ })
3841
+ ).min(1).max(5),
3842
+ source: zod.z.object({
3843
+ label: zod.z.string().optional(),
3844
+ url: zod.z.string().optional()
3845
+ }).optional()
3846
+ });
3847
+ var decisionQueueSchema = zod.z.object({
3848
+ type: zod.z.literal("decision-queue"),
3849
+ id: zod.z.string().optional(),
3850
+ title: zod.z.string().optional(),
3851
+ description: zod.z.string().optional(),
3852
+ submit_label: zod.z.string().optional(),
3853
+ items: zod.z.array(decisionQueueItemSchema).min(2).max(12),
3854
+ resolved: zod.z.object({
3855
+ decisions: zod.z.array(
3856
+ zod.z.object({
3857
+ id: zod.z.string().optional(),
3858
+ title: zod.z.string(),
3859
+ option: zod.z.string(),
3860
+ value: zod.z.number().optional()
3861
+ })
3862
+ )
3863
+ }).optional()
3864
+ });
3865
+ var OPTION_ITEM_JSON = {
3866
+ type: "object",
3867
+ properties: {
3868
+ id: { type: "string" },
3869
+ label: { type: "string" },
3870
+ recommended: { type: "boolean" },
3871
+ value: {
3872
+ type: "number",
3873
+ description: "Suggested numeric figure for this option (starting point of the adjuster)"
3874
+ },
3875
+ adjust: {
3876
+ type: "object",
3877
+ description: "Allow the user to tune `value` within this inclusive range before deciding",
3878
+ properties: {
3879
+ min: { type: "number" },
3880
+ max: { type: "number" },
3881
+ step: { type: "number" },
3882
+ unit: { type: "string", description: "Short unit suffix, e.g. 'units', '%', 'hrs'" }
3883
+ },
3884
+ required: ["min", "max"]
3885
+ }
3886
+ },
3887
+ required: ["label"]
3888
+ };
3889
+ var decisionQueueTool = {
3890
+ name: "render_decision_queue",
3891
+ description: "Render a SEQUENTIAL QUEUE of 2-12 related human-in-the-loop judgments, decided one at a time at full decision-card richness (amount at stake, data-quality flags, adjustable figures, source links) and submitted TOGETHER as one reply. Use whenever MORE THAN ONE decision is pending in the same turn \u2014 never emit multiple loose decision-cards. Give deferrable items an explicit 'leave open'-style option so the user can always complete the queue. For a single judgment use decision-card; for typed field input (names, dates, uploads) use render_builder.",
3892
+ input_schema: {
3893
+ type: "object",
3894
+ properties: {
3895
+ type: { type: "string", enum: ["decision-queue"] },
3896
+ id: { type: "string", description: "Stable id for update-in-place rendering" },
3897
+ title: {
3898
+ type: "string",
3899
+ description: "Batch headline shown in the header, e.g. 'Reconciliation exceptions'"
3900
+ },
3901
+ description: { type: "string", description: "One-line context above the queue" },
3902
+ submit_label: { type: "string", description: "CTA label; defaults to 'Submit N decisions'" },
3903
+ items: {
3904
+ type: "array",
3905
+ minItems: 2,
3906
+ maxItems: 12,
3907
+ description: "The pending judgments, in the order the user should take them. Each is a full decision-card body (no `type`).",
3908
+ items: {
3909
+ type: "object",
3910
+ properties: {
3911
+ id: { type: "string" },
3912
+ decision_type: {
3913
+ type: "string",
3914
+ description: "Short category eyebrow, e.g. 'Duplicate', 'Capitalization'"
3915
+ },
3916
+ title: { type: "string" },
3917
+ question: { type: "string" },
3918
+ amount: { type: "number" },
3919
+ currency: { type: "string" },
3920
+ amount_label: { type: "string" },
3921
+ severity: { type: "string", enum: ["low", "medium", "high"] },
3922
+ flags: {
3923
+ type: "array",
3924
+ maxItems: 6,
3925
+ items: {
3926
+ type: "object",
3927
+ properties: {
3928
+ field: { type: "string" },
3929
+ issue: { type: "string" },
3930
+ severity: { type: "string", enum: ["low", "medium", "high"] }
3931
+ },
3932
+ required: ["issue"]
3933
+ }
3934
+ },
3935
+ options: {
3936
+ type: "array",
3937
+ minItems: 1,
3938
+ maxItems: 5,
3939
+ items: OPTION_ITEM_JSON
3940
+ },
3941
+ source: {
3942
+ type: "object",
3943
+ properties: { label: { type: "string" }, url: { type: "string" } }
3944
+ }
3945
+ },
3946
+ required: ["title", "question", "options"]
3947
+ }
3948
+ },
3949
+ resolved: {
3950
+ type: "object",
3951
+ description: "Pre-resolved state for transcript replay",
3952
+ properties: {
3953
+ decisions: {
3954
+ type: "array",
3955
+ items: {
3956
+ type: "object",
3957
+ properties: {
3958
+ id: { type: "string" },
3959
+ title: { type: "string" },
3960
+ option: { type: "string" },
3961
+ value: { type: "number" }
3962
+ },
3963
+ required: ["title", "option"]
3964
+ }
3965
+ }
3966
+ },
3967
+ required: ["decisions"]
3968
+ }
3969
+ },
3970
+ required: ["type", "items"]
3971
+ }
3972
+ };
3788
3973
  var tabbyAuthSchema = zod.z.object({
3789
3974
  type: zod.z.literal("tabby-auth"),
3790
3975
  app: zod.z.string(),
@@ -3936,6 +4121,7 @@ var schemaRegistry = {
3936
4121
  "workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool },
3937
4122
  "document-field-extraction": { schema: documentFieldExtractionSchema, tool: documentFieldExtractionTool },
3938
4123
  "decision-card": { schema: decisionCardSchema, tool: decisionCardTool },
4124
+ "decision-queue": { schema: decisionQueueSchema, tool: decisionQueueTool },
3939
4125
  "tabby-auth": { schema: tabbyAuthSchema, tool: tabbyAuthTool }
3940
4126
  };
3941
4127