@adoptai/genui-components 0.1.56 → 0.1.57
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/dist/builders/BuilderForm.d.ts.map +1 -1
- package/dist/composites/decision-card/resolver.cjs +634 -0
- package/dist/composites/decision-card/resolver.cjs.map +1 -0
- package/dist/composites/decision-card/resolver.d.ts +13 -0
- package/dist/composites/decision-card/resolver.d.ts.map +1 -0
- package/dist/composites/decision-card/resolver.js +627 -0
- package/dist/composites/decision-card/resolver.js.map +1 -0
- package/dist/composites/workflow-stepper/resolver.cjs +4 -1
- package/dist/composites/workflow-stepper/resolver.cjs.map +1 -1
- package/dist/composites/workflow-stepper/resolver.js +4 -1
- package/dist/composites/workflow-stepper/resolver.js.map +1 -1
- package/dist/index.cjs +513 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +512 -12
- package/dist/index.js.map +1 -1
- package/dist/renderer.cjs +504 -8
- package/dist/renderer.cjs.map +1 -1
- package/dist/renderer.js +504 -8
- package/dist/renderer.js.map +1 -1
- package/dist/resolver.cjs +504 -8
- package/dist/resolver.cjs.map +1 -1
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +504 -8
- package/dist/resolver.js.map +1 -1
- package/dist/schemas/decision-card.d.ts +149 -0
- package/dist/schemas/decision-card.d.ts.map +1 -0
- package/dist/schemas/index.cjs +105 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.ts +149 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +105 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/shared/InteractionContext.d.ts +10 -0
- package/dist/shared/InteractionContext.d.ts.map +1 -1
- package/dist/tool-definitions.json +135 -3
- package/package.json +1 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const decisionCardSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"decision-card">;
|
|
4
|
+
id: z.ZodOptional<z.ZodString>;
|
|
5
|
+
decision_type: z.ZodOptional<z.ZodString>;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
question: z.ZodString;
|
|
8
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
10
|
+
amount_label: z.ZodOptional<z.ZodString>;
|
|
11
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
high: "high";
|
|
13
|
+
medium: "medium";
|
|
14
|
+
low: "low";
|
|
15
|
+
}>>;
|
|
16
|
+
flags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
17
|
+
field: z.ZodOptional<z.ZodString>;
|
|
18
|
+
issue: z.ZodString;
|
|
19
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
high: "high";
|
|
21
|
+
medium: "medium";
|
|
22
|
+
low: "low";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strip>>>;
|
|
25
|
+
options: z.ZodArray<z.ZodObject<{
|
|
26
|
+
id: z.ZodOptional<z.ZodString>;
|
|
27
|
+
label: z.ZodString;
|
|
28
|
+
recommended: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
label: z.ZodOptional<z.ZodString>;
|
|
32
|
+
url: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
resolved: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
option: z.ZodString;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const decisionCardTool: {
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
input_schema: {
|
|
42
|
+
type: "object";
|
|
43
|
+
properties: {
|
|
44
|
+
type: {
|
|
45
|
+
type: string;
|
|
46
|
+
enum: string[];
|
|
47
|
+
};
|
|
48
|
+
id: {
|
|
49
|
+
type: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
decision_type: {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
title: {
|
|
57
|
+
type: string;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
question: {
|
|
61
|
+
type: string;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
amount: {
|
|
65
|
+
type: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
currency: {
|
|
69
|
+
type: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
amount_label: {
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
severity: {
|
|
77
|
+
type: string;
|
|
78
|
+
enum: string[];
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
flags: {
|
|
82
|
+
type: string;
|
|
83
|
+
maxItems: number;
|
|
84
|
+
description: string;
|
|
85
|
+
items: {
|
|
86
|
+
type: string;
|
|
87
|
+
properties: {
|
|
88
|
+
field: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
issue: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
severity: {
|
|
95
|
+
type: string;
|
|
96
|
+
enum: string[];
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
required: string[];
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
options: {
|
|
103
|
+
type: string;
|
|
104
|
+
minItems: number;
|
|
105
|
+
maxItems: number;
|
|
106
|
+
description: string;
|
|
107
|
+
items: {
|
|
108
|
+
type: string;
|
|
109
|
+
properties: {
|
|
110
|
+
id: {
|
|
111
|
+
type: string;
|
|
112
|
+
};
|
|
113
|
+
label: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
recommended: {
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
required: string[];
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
source: {
|
|
124
|
+
type: string;
|
|
125
|
+
description: string;
|
|
126
|
+
properties: {
|
|
127
|
+
label: {
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
url: {
|
|
131
|
+
type: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
resolved: {
|
|
136
|
+
type: string;
|
|
137
|
+
description: string;
|
|
138
|
+
properties: {
|
|
139
|
+
option: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
required: string[];
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
required: string[];
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=decision-card.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/schemas/index.cjs
CHANGED
|
@@ -3455,6 +3455,109 @@ var workflowStepperTool = {
|
|
|
3455
3455
|
required: ["type", "title", "steps"]
|
|
3456
3456
|
}
|
|
3457
3457
|
};
|
|
3458
|
+
var decisionCardSchema = zod.z.object({
|
|
3459
|
+
type: zod.z.literal("decision-card"),
|
|
3460
|
+
id: zod.z.string().optional(),
|
|
3461
|
+
decision_type: zod.z.string().optional(),
|
|
3462
|
+
title: zod.z.string(),
|
|
3463
|
+
question: zod.z.string(),
|
|
3464
|
+
amount: zod.z.number().optional(),
|
|
3465
|
+
currency: zod.z.string().optional(),
|
|
3466
|
+
amount_label: zod.z.string().optional(),
|
|
3467
|
+
severity: zod.z.enum(["low", "medium", "high"]).optional(),
|
|
3468
|
+
flags: zod.z.array(
|
|
3469
|
+
zod.z.object({
|
|
3470
|
+
field: zod.z.string().optional(),
|
|
3471
|
+
issue: zod.z.string(),
|
|
3472
|
+
severity: zod.z.enum(["low", "medium", "high"]).optional()
|
|
3473
|
+
})
|
|
3474
|
+
).max(6).optional(),
|
|
3475
|
+
options: zod.z.array(
|
|
3476
|
+
zod.z.object({
|
|
3477
|
+
id: zod.z.string().optional(),
|
|
3478
|
+
label: zod.z.string(),
|
|
3479
|
+
recommended: zod.z.boolean().optional()
|
|
3480
|
+
})
|
|
3481
|
+
).min(1).max(5),
|
|
3482
|
+
source: zod.z.object({
|
|
3483
|
+
label: zod.z.string().optional(),
|
|
3484
|
+
url: zod.z.string().optional()
|
|
3485
|
+
}).optional(),
|
|
3486
|
+
resolved: zod.z.object({
|
|
3487
|
+
option: zod.z.string()
|
|
3488
|
+
}).optional()
|
|
3489
|
+
});
|
|
3490
|
+
var decisionCardTool = {
|
|
3491
|
+
name: "render_decision_card",
|
|
3492
|
+
description: "Render an inline human-in-the-loop (HITL) decision card \u2014 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).",
|
|
3493
|
+
input_schema: {
|
|
3494
|
+
type: "object",
|
|
3495
|
+
properties: {
|
|
3496
|
+
type: { type: "string", enum: ["decision-card"] },
|
|
3497
|
+
id: { type: "string", description: "Stable id for update-in-place rendering" },
|
|
3498
|
+
decision_type: {
|
|
3499
|
+
type: "string",
|
|
3500
|
+
description: "Short category shown in the eyebrow, e.g. 'Cross-check', 'Allocation', 'Reserve'"
|
|
3501
|
+
},
|
|
3502
|
+
title: { type: "string", description: "The decision headline, e.g. 'AR reserve adequacy'" },
|
|
3503
|
+
question: { type: "string", description: "The full question / context the user must judge" },
|
|
3504
|
+
amount: { type: "number", description: "Dollar value at stake, e.g. 27100" },
|
|
3505
|
+
currency: { type: "string", description: "ISO currency code; defaults to USD" },
|
|
3506
|
+
amount_label: { type: "string", description: "Caption above the amount, e.g. 'At stake'" },
|
|
3507
|
+
severity: {
|
|
3508
|
+
type: "string",
|
|
3509
|
+
enum: ["low", "medium", "high"],
|
|
3510
|
+
description: "Severity of the decision; tints the accent rail"
|
|
3511
|
+
},
|
|
3512
|
+
flags: {
|
|
3513
|
+
type: "array",
|
|
3514
|
+
maxItems: 6,
|
|
3515
|
+
description: "Optional data-quality flags surfaced on the card",
|
|
3516
|
+
items: {
|
|
3517
|
+
type: "object",
|
|
3518
|
+
properties: {
|
|
3519
|
+
field: { type: "string" },
|
|
3520
|
+
issue: { type: "string" },
|
|
3521
|
+
severity: { type: "string", enum: ["low", "medium", "high"] }
|
|
3522
|
+
},
|
|
3523
|
+
required: ["issue"]
|
|
3524
|
+
}
|
|
3525
|
+
},
|
|
3526
|
+
options: {
|
|
3527
|
+
type: "array",
|
|
3528
|
+
minItems: 1,
|
|
3529
|
+
maxItems: 5,
|
|
3530
|
+
description: "Mutually-exclusive resolution choices; mark one `recommended` to make it primary",
|
|
3531
|
+
items: {
|
|
3532
|
+
type: "object",
|
|
3533
|
+
properties: {
|
|
3534
|
+
id: { type: "string" },
|
|
3535
|
+
label: { type: "string" },
|
|
3536
|
+
recommended: { type: "boolean" }
|
|
3537
|
+
},
|
|
3538
|
+
required: ["label"]
|
|
3539
|
+
}
|
|
3540
|
+
},
|
|
3541
|
+
source: {
|
|
3542
|
+
type: "object",
|
|
3543
|
+
description: "Optional provenance link for the figure",
|
|
3544
|
+
properties: {
|
|
3545
|
+
label: { type: "string" },
|
|
3546
|
+
url: { type: "string" }
|
|
3547
|
+
}
|
|
3548
|
+
},
|
|
3549
|
+
resolved: {
|
|
3550
|
+
type: "object",
|
|
3551
|
+
description: "Pre-resolved state for transcript replay",
|
|
3552
|
+
properties: {
|
|
3553
|
+
option: { type: "string" }
|
|
3554
|
+
},
|
|
3555
|
+
required: ["option"]
|
|
3556
|
+
}
|
|
3557
|
+
},
|
|
3558
|
+
required: ["type", "title", "question", "options"]
|
|
3559
|
+
}
|
|
3560
|
+
};
|
|
3458
3561
|
|
|
3459
3562
|
// src/schemas/buildRenderUITool.ts
|
|
3460
3563
|
function buildRenderUITool(selectedSchemas) {
|
|
@@ -3573,7 +3676,8 @@ var schemaRegistry = {
|
|
|
3573
3676
|
"connect-integration": { schema: connectIntegrationSchema, tool: connectIntegrationTool },
|
|
3574
3677
|
"integrations-list": { schema: integrationsListSchema, tool: integrationsListTool },
|
|
3575
3678
|
"pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool },
|
|
3576
|
-
"workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool }
|
|
3679
|
+
"workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool },
|
|
3680
|
+
"decision-card": { schema: decisionCardSchema, tool: decisionCardTool }
|
|
3577
3681
|
};
|
|
3578
3682
|
|
|
3579
3683
|
exports.buildRenderUITool = buildRenderUITool;
|