@uipath/ui-widgets-conversational-agent-chat 1.0.2 → 1.1.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.
Files changed (159) hide show
  1. package/README.md +63 -6
  2. package/dist/ConversationalAgentChat.css +18184 -7
  3. package/dist/ConversationalAgentChat.d.ts +1 -1
  4. package/dist/ConversationalAgentChat.d.ts.map +1 -1
  5. package/dist/ConversationalAgentChat.js +617 -139
  6. package/dist/ConversationalAgentChat.js.map +1 -1
  7. package/dist/ConversationalAgentChat.stories.d.ts +14 -1
  8. package/dist/ConversationalAgentChat.stories.d.ts.map +1 -1
  9. package/dist/ConversationalAgentChat.stories.js +5 -12
  10. package/dist/ConversationalAgentChat.stories.js.map +1 -1
  11. package/dist/ConversationalAgentPickerChat.d.ts +4 -0
  12. package/dist/ConversationalAgentPickerChat.d.ts.map +1 -0
  13. package/dist/ConversationalAgentPickerChat.js +113 -0
  14. package/dist/ConversationalAgentPickerChat.js.map +1 -0
  15. package/dist/ConversationalAgentPickerChat.stories.d.ts +96 -0
  16. package/dist/ConversationalAgentPickerChat.stories.d.ts.map +1 -0
  17. package/dist/ConversationalAgentPickerChat.stories.js +209 -0
  18. package/dist/ConversationalAgentPickerChat.stories.js.map +1 -0
  19. package/dist/components/AgentList.d.ts +10 -0
  20. package/dist/components/AgentList.d.ts.map +1 -0
  21. package/dist/components/AgentList.js +20 -0
  22. package/dist/components/AgentList.js.map +1 -0
  23. package/dist/components/AgentSchemaForm/AgentSchemaField.d.ts +26 -0
  24. package/dist/components/AgentSchemaForm/AgentSchemaField.d.ts.map +1 -0
  25. package/dist/components/AgentSchemaForm/AgentSchemaField.js +96 -0
  26. package/dist/components/AgentSchemaForm/AgentSchemaField.js.map +1 -0
  27. package/dist/components/AgentSchemaForm/AgentSchemaForm.d.ts +38 -0
  28. package/dist/components/AgentSchemaForm/AgentSchemaForm.d.ts.map +1 -0
  29. package/dist/components/AgentSchemaForm/AgentSchemaForm.js +105 -0
  30. package/dist/components/AgentSchemaForm/AgentSchemaForm.js.map +1 -0
  31. package/dist/components/AgentSchemaForm/AgentSchemaForm.stories.d.ts +30 -0
  32. package/dist/components/AgentSchemaForm/AgentSchemaForm.stories.d.ts.map +1 -0
  33. package/dist/components/AgentSchemaForm/AgentSchemaForm.stories.js +236 -0
  34. package/dist/components/AgentSchemaForm/AgentSchemaForm.stories.js.map +1 -0
  35. package/dist/components/AgentSchemaForm/FieldShell.d.ts +12 -0
  36. package/dist/components/AgentSchemaForm/FieldShell.d.ts.map +1 -0
  37. package/dist/components/AgentSchemaForm/FieldShell.js +4 -0
  38. package/dist/components/AgentSchemaForm/FieldShell.js.map +1 -0
  39. package/dist/components/AgentSchemaForm/index.d.ts +5 -0
  40. package/dist/components/AgentSchemaForm/index.d.ts.map +1 -0
  41. package/dist/components/AgentSchemaForm/index.js +2 -0
  42. package/dist/components/AgentSchemaForm/index.js.map +1 -0
  43. package/dist/components/AgentSchemaForm/inputs/ArrayField.d.ts +7 -0
  44. package/dist/components/AgentSchemaForm/inputs/ArrayField.d.ts.map +1 -0
  45. package/dist/components/AgentSchemaForm/inputs/ArrayField.js +28 -0
  46. package/dist/components/AgentSchemaForm/inputs/ArrayField.js.map +1 -0
  47. package/dist/components/AgentSchemaForm/inputs/ObjectField.d.ts +8 -0
  48. package/dist/components/AgentSchemaForm/inputs/ObjectField.d.ts.map +1 -0
  49. package/dist/components/AgentSchemaForm/inputs/ObjectField.js +75 -0
  50. package/dist/components/AgentSchemaForm/inputs/ObjectField.js.map +1 -0
  51. package/dist/components/AgentSchemaForm/inputs/validation.d.ts +10 -0
  52. package/dist/components/AgentSchemaForm/inputs/validation.d.ts.map +1 -0
  53. package/dist/components/AgentSchemaForm/inputs/validation.js +41 -0
  54. package/dist/components/AgentSchemaForm/inputs/validation.js.map +1 -0
  55. package/dist/components/AgentSchemaForm/resolveSchema.d.ts +7 -0
  56. package/dist/components/AgentSchemaForm/resolveSchema.d.ts.map +1 -0
  57. package/dist/components/AgentSchemaForm/resolveSchema.js +162 -0
  58. package/dist/components/AgentSchemaForm/resolveSchema.js.map +1 -0
  59. package/dist/components/AgentSchemaForm/types.d.ts +34 -0
  60. package/dist/components/AgentSchemaForm/types.d.ts.map +1 -0
  61. package/dist/components/AgentSchemaForm/types.js +8 -0
  62. package/dist/components/AgentSchemaForm/types.js.map +1 -0
  63. package/dist/components/FeedbackDialog.d.ts +2 -1
  64. package/dist/components/FeedbackDialog.d.ts.map +1 -1
  65. package/dist/components/FeedbackDialog.js +6 -2
  66. package/dist/components/FeedbackDialog.js.map +1 -1
  67. package/dist/components/InputsPage.d.ts +18 -0
  68. package/dist/components/InputsPage.d.ts.map +1 -0
  69. package/dist/components/InputsPage.js +32 -0
  70. package/dist/components/InputsPage.js.map +1 -0
  71. package/dist/components/Loader.d.ts +6 -0
  72. package/dist/components/Loader.d.ts.map +1 -0
  73. package/dist/components/Loader.js +6 -0
  74. package/dist/components/Loader.js.map +1 -0
  75. package/dist/components/SettingsDialog/InputsSection.d.ts +15 -0
  76. package/dist/components/SettingsDialog/InputsSection.d.ts.map +1 -0
  77. package/dist/components/SettingsDialog/InputsSection.js +29 -0
  78. package/dist/components/SettingsDialog/InputsSection.js.map +1 -0
  79. package/dist/components/SettingsDialog/ProfileSection.d.ts +7 -0
  80. package/dist/components/SettingsDialog/ProfileSection.d.ts.map +1 -0
  81. package/dist/components/SettingsDialog/ProfileSection.js +146 -0
  82. package/dist/components/SettingsDialog/ProfileSection.js.map +1 -0
  83. package/dist/components/SettingsDialog/SettingsDialog.d.ts +33 -0
  84. package/dist/components/SettingsDialog/SettingsDialog.d.ts.map +1 -0
  85. package/dist/components/SettingsDialog/SettingsDialog.js +18 -0
  86. package/dist/components/SettingsDialog/SettingsDialog.js.map +1 -0
  87. package/dist/components/SettingsDialog/index.d.ts +3 -0
  88. package/dist/components/SettingsDialog/index.d.ts.map +1 -0
  89. package/dist/components/SettingsDialog/index.js +2 -0
  90. package/dist/components/SettingsDialog/index.js.map +1 -0
  91. package/dist/components/ToolConfirmation.d.ts +20 -0
  92. package/dist/components/ToolConfirmation.d.ts.map +1 -0
  93. package/dist/components/ToolConfirmation.js +20 -0
  94. package/dist/components/ToolConfirmation.js.map +1 -0
  95. package/dist/components/ToolConfirmationRenderer.d.ts +15 -0
  96. package/dist/components/ToolConfirmationRenderer.d.ts.map +1 -0
  97. package/dist/components/ToolConfirmationRenderer.js +52 -0
  98. package/dist/components/ToolConfirmationRenderer.js.map +1 -0
  99. package/dist/components/agentUtils.d.ts +4 -0
  100. package/dist/components/agentUtils.d.ts.map +1 -0
  101. package/dist/components/agentUtils.js +24 -0
  102. package/dist/components/agentUtils.js.map +1 -0
  103. package/dist/components/useFavorites.d.ts +7 -0
  104. package/dist/components/useFavorites.d.ts.map +1 -0
  105. package/dist/components/useFavorites.js +47 -0
  106. package/dist/components/useFavorites.js.map +1 -0
  107. package/dist/constants/countries.d.ts +251 -0
  108. package/dist/constants/countries.d.ts.map +1 -0
  109. package/dist/constants/countries.js +250 -0
  110. package/dist/constants/countries.js.map +1 -0
  111. package/dist/hooks/useResolvedAgent.d.ts +34 -0
  112. package/dist/hooks/useResolvedAgent.d.ts.map +1 -0
  113. package/dist/hooks/useResolvedAgent.js +99 -0
  114. package/dist/hooks/useResolvedAgent.js.map +1 -0
  115. package/dist/i18n/i18n.config.d.ts +2 -0
  116. package/dist/i18n/i18n.config.d.ts.map +1 -0
  117. package/dist/i18n/i18n.config.js +24 -0
  118. package/dist/i18n/i18n.config.js.map +1 -0
  119. package/dist/i18n/index.d.ts +2 -0
  120. package/dist/i18n/index.d.ts.map +1 -0
  121. package/dist/i18n/index.js +2 -0
  122. package/dist/i18n/index.js.map +1 -0
  123. package/dist/i18n/locales/en/index.json +306 -0
  124. package/dist/i18n/locales/keys/index.json +306 -0
  125. package/dist/icons/ConversationalAgentIcon.d.ts +7 -0
  126. package/dist/icons/ConversationalAgentIcon.d.ts.map +1 -0
  127. package/dist/icons/ConversationalAgentIcon.js +8 -0
  128. package/dist/icons/ConversationalAgentIcon.js.map +1 -0
  129. package/dist/icons/TimeIcon.d.ts +2 -0
  130. package/dist/icons/TimeIcon.d.ts.map +1 -0
  131. package/dist/icons/TimeIcon.js +3 -0
  132. package/dist/icons/TimeIcon.js.map +1 -0
  133. package/dist/index.d.ts +10 -1
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +4 -0
  136. package/dist/index.js.map +1 -1
  137. package/dist/types.d.ts +90 -3
  138. package/dist/types.d.ts.map +1 -1
  139. package/dist/types.js +2 -0
  140. package/dist/types.js.map +1 -1
  141. package/dist/utils/normalizeValue.d.ts +7 -0
  142. package/dist/utils/normalizeValue.d.ts.map +1 -0
  143. package/dist/utils/normalizeValue.js +31 -0
  144. package/dist/utils/normalizeValue.js.map +1 -0
  145. package/dist/utils/resolveAgent.d.ts +17 -0
  146. package/dist/utils/resolveAgent.d.ts.map +1 -0
  147. package/dist/utils/resolveAgent.js +25 -0
  148. package/dist/utils/resolveAgent.js.map +1 -0
  149. package/dist/utils/telemetryUtils.d.ts +1 -1
  150. package/dist/utils/telemetryUtils.d.ts.map +1 -1
  151. package/dist/utils/telemetryUtils.js +2 -2
  152. package/dist/utils/telemetryUtils.js.map +1 -1
  153. package/dist/utils.d.ts +11 -3
  154. package/dist/utils.d.ts.map +1 -1
  155. package/dist/utils.js +36 -9
  156. package/dist/utils.js.map +1 -1
  157. package/dist/version.d.ts +1 -1
  158. package/dist/version.js +1 -1
  159. package/package.json +10 -5
@@ -0,0 +1,236 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState } from "react";
3
+ import { AgentSchemaForm } from "./AgentSchemaForm";
4
+ /**
5
+ * Wrapper that renders the form with a submit button and shows submitted data.
6
+ */
7
+ const FormDemo = ({ inputSchema, initialValues, disabled, collapsibleOptional, }) => {
8
+ const formRef = useRef(null);
9
+ const [submitted, setSubmitted] = useState(null);
10
+ return (_jsxs("div", { style: { maxWidth: 480 }, children: [_jsx(AgentSchemaForm, { inputSchema: inputSchema, initialValues: initialValues, disabled: disabled, collapsibleOptional: collapsibleOptional, formRef: formRef, onSubmit: (data) => setSubmitted(data) }), _jsx("button", { onClick: () => formRef.current?.submit(), disabled: disabled, style: { marginTop: 16, padding: "8px 20px", cursor: "pointer" }, children: "Submit" }), submitted && (_jsx("pre", { style: {
11
+ marginTop: 16,
12
+ fontSize: 12,
13
+ background: "#f5f5f5",
14
+ padding: 12,
15
+ borderRadius: 4,
16
+ }, children: JSON.stringify(submitted, null, 2) }))] }));
17
+ };
18
+ const meta = {
19
+ title: "Components/AgentSchemaForm",
20
+ component: FormDemo,
21
+ parameters: {
22
+ layout: "padded",
23
+ docs: {
24
+ description: {
25
+ component: "Schema-driven form for UiPath Conversational Agents. Renders input fields from a JSON Schema. Used by the inputs page (pre-conversation), settings panel, and tool call confirmation.",
26
+ },
27
+ },
28
+ },
29
+ tags: ["autodocs"],
30
+ };
31
+ export default meta;
32
+ export const AllFieldTypes = {
33
+ args: {
34
+ inputSchema: {
35
+ type: "object",
36
+ required: ["message", "priority"],
37
+ properties: {
38
+ message: { type: "string", title: "Message" },
39
+ count: { type: "integer", title: "Count" },
40
+ ratio: { type: "number", title: "Ratio" },
41
+ enabled: { type: "boolean", title: "Enabled" },
42
+ priority: {
43
+ type: "string",
44
+ title: "Priority",
45
+ enum: ["low", "normal", "high"],
46
+ },
47
+ startDate: { type: "string", format: "date", title: "Start Date" },
48
+ startTime: { type: "string", format: "time", title: "Start Time" },
49
+ deadline: { type: "string", format: "date-time", title: "Deadline" },
50
+ tags: { type: "array", title: "Tags", items: { type: "string" } },
51
+ },
52
+ },
53
+ },
54
+ parameters: {
55
+ docs: {
56
+ description: {
57
+ story: "Demonstrates every supported field type: text, integer, number, boolean, enum select, date, time, date-time, and array.",
58
+ },
59
+ },
60
+ },
61
+ };
62
+ export const NestedObject = {
63
+ args: {
64
+ inputSchema: {
65
+ type: "object",
66
+ required: ["recipient"],
67
+ properties: {
68
+ recipient: {
69
+ type: "object",
70
+ title: "Recipient",
71
+ required: ["email"],
72
+ properties: {
73
+ name: { type: "string", title: "Name" },
74
+ email: { type: "string", title: "Email" },
75
+ address: {
76
+ type: "object",
77
+ title: "Address",
78
+ properties: {
79
+ street: { type: "string", title: "Street" },
80
+ city: { type: "string", title: "City" },
81
+ },
82
+ },
83
+ },
84
+ },
85
+ subject: { type: "string", title: "Subject" },
86
+ },
87
+ },
88
+ },
89
+ parameters: {
90
+ docs: {
91
+ description: {
92
+ story: "Nested object fields with collapsible sections and deep required validation.",
93
+ },
94
+ },
95
+ },
96
+ };
97
+ export const EnumWithLabels = {
98
+ args: {
99
+ inputSchema: {
100
+ type: "object",
101
+ required: ["status"],
102
+ properties: {
103
+ status: {
104
+ type: "string",
105
+ title: "Status",
106
+ enum: ["active", "paused", "archived"],
107
+ oneOf: [
108
+ { const: "active", title: "Active — currently running" },
109
+ { const: "paused", title: "Paused — temporarily stopped" },
110
+ { const: "archived", title: "Archived — no longer in use" },
111
+ ],
112
+ },
113
+ },
114
+ },
115
+ },
116
+ parameters: {
117
+ docs: {
118
+ description: {
119
+ story: "Enum field with display labels from oneOf const patterns.",
120
+ },
121
+ },
122
+ },
123
+ };
124
+ export const CollapsibleOptional = {
125
+ args: {
126
+ inputSchema: {
127
+ type: "object",
128
+ required: ["name"],
129
+ properties: {
130
+ name: { type: "string", title: "Name" },
131
+ description: { type: "string", title: "Description" },
132
+ notes: { type: "string", title: "Notes" },
133
+ priority: {
134
+ type: "string",
135
+ title: "Priority",
136
+ enum: ["low", "normal", "high"],
137
+ },
138
+ },
139
+ },
140
+ collapsibleOptional: true,
141
+ },
142
+ parameters: {
143
+ docs: {
144
+ description: {
145
+ story: 'Optional fields hidden behind a "Show more" toggle, as used on the inputs page before a conversation starts.',
146
+ },
147
+ },
148
+ },
149
+ };
150
+ export const PrePopulated = {
151
+ args: {
152
+ inputSchema: {
153
+ type: "object",
154
+ required: ["to", "body"],
155
+ properties: {
156
+ to: { type: "string", title: "To" },
157
+ subject: { type: "string", title: "Subject" },
158
+ body: { type: "string", title: "Body" },
159
+ urgent: { type: "boolean", title: "Urgent" },
160
+ },
161
+ },
162
+ initialValues: {
163
+ to: "alice@example.com",
164
+ subject: "Follow-up",
165
+ body: "Just checking in on the status.",
166
+ urgent: false,
167
+ },
168
+ },
169
+ parameters: {
170
+ docs: {
171
+ description: {
172
+ story: "Form pre-populated with initial values, as seen in tool call confirmation where the agent proposes values the user can edit before confirming.",
173
+ },
174
+ },
175
+ },
176
+ };
177
+ export const Disabled = {
178
+ args: {
179
+ inputSchema: {
180
+ type: "object",
181
+ required: ["to"],
182
+ properties: {
183
+ to: { type: "string", title: "To" },
184
+ subject: { type: "string", title: "Subject" },
185
+ urgent: { type: "boolean", title: "Urgent" },
186
+ priority: {
187
+ type: "string",
188
+ title: "Priority",
189
+ enum: ["low", "normal", "high"],
190
+ },
191
+ },
192
+ },
193
+ initialValues: {
194
+ to: "alice@example.com",
195
+ subject: "Confirmed",
196
+ urgent: true,
197
+ priority: "high",
198
+ },
199
+ disabled: true,
200
+ },
201
+ parameters: {
202
+ docs: {
203
+ description: {
204
+ story: "All fields disabled. Used during submission to prevent edits while the action is in flight.",
205
+ },
206
+ },
207
+ },
208
+ };
209
+ export const RefAndNullableSchema = {
210
+ args: {
211
+ inputSchema: {
212
+ type: "object",
213
+ required: ["message"],
214
+ properties: {
215
+ message: { type: "string", title: "Message" },
216
+ priority: {
217
+ anyOf: [
218
+ { const: "high", title: "High" },
219
+ { const: "normal", title: "Normal" },
220
+ { const: "low", title: "Low" },
221
+ { type: "null" },
222
+ ],
223
+ title: "Priority",
224
+ },
225
+ },
226
+ },
227
+ },
228
+ parameters: {
229
+ docs: {
230
+ description: {
231
+ story: "Schema using anyOf nullable and const enum patterns, as commonly returned by UiPath agent tool schemas. resolveSchema normalizes these before rendering.",
232
+ },
233
+ },
234
+ },
235
+ };
236
+ //# sourceMappingURL=AgentSchemaForm.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentSchemaForm.stories.js","sourceRoot":"","sources":["../../../src/components/AgentSchemaForm/AgentSchemaForm.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,eAAe,EAA8B,MAAM,mBAAmB,CAAC;AAGhF;;GAEG;AACH,MAAM,QAAQ,GAAG,CAAC,EAChB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,mBAAmB,GAMpB,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACpD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CACxC,IAAI,CACL,CAAC;IAEF,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,aAC3B,KAAC,eAAe,IACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,GACtC,EACF,iBACE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EACxC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAGzD,EACR,SAAS,IAAI,CACZ,cACE,KAAK,EAAE;oBACL,SAAS,EAAE,EAAE;oBACb,QAAQ,EAAE,EAAE;oBACZ,UAAU,EAAE,SAAS;oBACrB,OAAO,EAAE,EAAE;oBACX,YAAY,EAAE,CAAC;iBAChB,YAEA,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,GAC/B,CACP,IACG,CACP,CA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AQ,EAAE,MAAM;SACjB;QACD,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,KAAK,EACH,6FAA6F;aAChG;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAU;IACzC,IAAI,EAAE;QACJ,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,SAAS,CAAC;YACrB,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;gBAC7C,QAAQ,EAAE;oBACR,KAAK,EAAE;wBACL,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;wBAChC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;wBACpC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;wBAC9B,EAAE,IAAI,EAAE,MAAM,EAAE;qBACjB;oBACD,KAAK,EAAE,UAAU;iBAClB;aACF;SACa;KACjB;IACD,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,KAAK,EACH,0JAA0J;aAC7J;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from "react";
2
+ interface FieldShellProps {
3
+ label: ReactNode;
4
+ children: ReactNode;
5
+ error?: boolean;
6
+ disabled?: boolean;
7
+ helperText?: ReactNode;
8
+ className?: string;
9
+ }
10
+ export declare const FieldShell: ({ label, children, error, disabled, helperText, className, }: FieldShellProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=FieldShell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldShell.d.ts","sourceRoot":"","sources":["../../../src/components/AgentSchemaForm/FieldShell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,eAAe;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,GAAI,8DAOxB,eAAe,4CA4BjB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Label, cn } from "@uipath/apollo-wind";
3
+ export const FieldShell = ({ label, children, error = false, disabled = false, helperText, className, }) => (_jsxs("div", { className: cn("flex w-full flex-col gap-2", disabled && "opacity-60", className), children: [_jsx(Label, { className: cn("text-sm font-semibold text-muted-foreground", error && "text-destructive"), children: label }), children, helperText && (_jsx("span", { className: cn("text-xs text-muted-foreground", error && "text-destructive"), children: helperText }))] }));
4
+ //# sourceMappingURL=FieldShell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldShell.js","sourceRoot":"","sources":["../../../src/components/AgentSchemaForm/FieldShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAYhD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,KAAK,GAAG,KAAK,EACb,QAAQ,GAAG,KAAK,EAChB,UAAU,EACV,SAAS,GACO,EAAE,EAAE,CAAC,CACrB,eACE,SAAS,EAAE,EAAE,CACX,4BAA4B,EAC5B,QAAQ,IAAI,YAAY,EACxB,SAAS,CACV,aAED,KAAC,KAAK,IACJ,SAAS,EAAE,EAAE,CACX,6CAA6C,EAC7C,KAAK,IAAI,kBAAkB,CAC5B,YAEA,KAAK,GACA,EACP,QAAQ,EACR,UAAU,IAAI,CACb,eACE,SAAS,EAAE,EAAE,CACX,+BAA+B,EAC/B,KAAK,IAAI,kBAAkB,CAC5B,YAEA,UAAU,GACN,CACR,IACG,CACP,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { AgentSchemaForm } from "./AgentSchemaForm";
2
+ export type { AgentSchemaFormProps, AgentSchemaFormHandle, } from "./AgentSchemaForm";
3
+ export type { InputSchemaProperty } from "./AgentSchemaField";
4
+ export type { InputSchema } from "./types";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AgentSchemaForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { AgentSchemaForm } from "./AgentSchemaForm";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AgentSchemaForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { AgentSchemaFieldProps } from "../AgentSchemaField";
2
+ interface ArrayFieldProps extends AgentSchemaFieldProps {
3
+ label: React.ReactNode;
4
+ }
5
+ export declare const ArrayField: ({ prop, value, onChange, error, disabled, label, }: ArrayFieldProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=ArrayField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../src/components/AgentSchemaForm/inputs/ArrayField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGjE,UAAU,eAAgB,SAAQ,qBAAqB;IACrD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,GAAI,oDAOxB,eAAe,4CA8DjB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Badge, Input, cn } from "@uipath/apollo-wind";
3
+ import { Close } from "@uipath/apollo-react/icons";
4
+ import { useState } from "react";
5
+ import { useTranslation } from "react-i18next";
6
+ import { FieldShell } from "../FieldShell";
7
+ export const ArrayField = ({ prop, value, onChange, error = false, disabled, label, }) => {
8
+ const { t } = useTranslation();
9
+ const chips = value ?? [];
10
+ const [inputValue, setInputValue] = useState("");
11
+ const addChip = () => {
12
+ const trimmed = inputValue.trim();
13
+ if (trimmed)
14
+ onChange([...chips, trimmed]);
15
+ setInputValue("");
16
+ };
17
+ const handleKeyDown = (e) => {
18
+ if (e.key === "Enter") {
19
+ e.preventDefault();
20
+ addChip();
21
+ }
22
+ else if (e.key === "Backspace" && inputValue === "") {
23
+ onChange(chips.slice(0, -1));
24
+ }
25
+ };
26
+ return (_jsx(FieldShell, { label: label, error: error, disabled: disabled, helperText: prop.description, children: _jsxs("div", { className: cn("flex min-h-9 w-full flex-wrap items-center gap-1 rounded-md border border-input bg-background px-3 py-1 text-sm", "focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2", error && "border-destructive focus-within:ring-destructive", disabled && "cursor-not-allowed opacity-50"), children: [chips.map((chip, i) => (_jsxs(Badge, { variant: "secondary", className: "gap-1 pr-1", children: [_jsx("span", { children: chip }), _jsx("button", { type: "button", "aria-label": t("agent_schema_remove_chip", { chip }), disabled: disabled, onClick: () => onChange(chips.filter((_, idx) => idx !== i)), className: "rounded px-1 text-muted-foreground hover:text-foreground disabled:pointer-events-none", children: _jsx(Close, { size: 10, "aria-hidden": "true" }) })] }, i))), _jsx(Input, { value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, onBlur: addChip, disabled: disabled, className: "h-6 min-w-16 flex-1 border-0 bg-transparent p-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0" })] }) }));
27
+ };
28
+ //# sourceMappingURL=ArrayField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrayField.js","sourceRoot":"","sources":["../../../../src/components/AgentSchemaForm/inputs/ArrayField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAoB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,GAAG,KAAK,EACb,QAAQ,EACR,KAAK,GACW,EAAE,EAAE;IACpB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAI,KAA8B,IAAI,EAAE,CAAC;IACpD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEjD,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,OAAO;YAAE,QAAQ,CAAC,CAAC,GAAG,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;QAC3C,aAAa,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,CAAwC,EAAE,EAAE;QACjE,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;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AE,aAAa,EACxB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,8GAA8G,GACxH,IACE,GACK,CACd,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import type { AgentSchemaFieldProps } from "../AgentSchemaField";
3
+ interface ObjectFieldProps extends AgentSchemaFieldProps {
4
+ label: React.ReactNode;
5
+ }
6
+ export declare const ObjectField: ({ prop, value, onChange, onValidationError, error, errorMap, disabled, label, }: ObjectFieldProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=ObjectField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectField.d.ts","sourceRoot":"","sources":["../../../../src/components/AgentSchemaForm/inputs/ObjectField.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,qBAAqB,CAAC;AAkB7B,UAAU,gBAAiB,SAAQ,qBAAqB;IACtD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,GAAI,iFASzB,gBAAgB,4CAmClB,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Collapsible, CollapsibleContent, CollapsibleTrigger, Textarea, cn, } from "@uipath/apollo-wind";
3
+ import { useState } from "react";
4
+ import { useTranslation } from "react-i18next";
5
+ import { AgentSchemaField } from "../AgentSchemaField";
6
+ import { ChevronDown, ChevronRight } from "@uipath/apollo-react/icons";
7
+ import { FieldShell } from "../FieldShell";
8
+ const getNestedErrorMap = (errorMap, nestedKey) => {
9
+ if (!errorMap)
10
+ return undefined;
11
+ const prefix = `${nestedKey}.`;
12
+ const result = {};
13
+ for (const [k, v] of Object.entries(errorMap)) {
14
+ if (k.startsWith(prefix))
15
+ result[k.slice(prefix.length)] = v;
16
+ }
17
+ return Object.keys(result).length > 0 ? result : undefined;
18
+ };
19
+ export const ObjectField = ({ prop, value, onChange, onValidationError, error = false, errorMap, disabled, label, }) => {
20
+ const nestedProperties = prop.properties;
21
+ const hasNestedProps = nestedProperties !== null &&
22
+ nestedProperties !== undefined &&
23
+ Object.keys(nestedProperties).length > 0;
24
+ if (hasNestedProps) {
25
+ return (_jsx(NestedObjectField, { prop: prop, nestedProperties: nestedProperties, value: value, onChange: onChange, onValidationError: onValidationError, errorMap: errorMap, disabled: disabled, label: label }));
26
+ }
27
+ return (_jsx(JsonObjectField, { value: value, onChange: onChange, onValidationError: onValidationError, error: error, disabled: disabled, label: label, description: prop.description }));
28
+ };
29
+ const NestedObjectField = ({ prop, nestedProperties, value, onChange, onValidationError, errorMap, disabled, label, }) => {
30
+ const [expanded, setExpanded] = useState(true);
31
+ const objectValue = (value === undefined || value === null ? {} : value);
32
+ const requiredFields = prop.required ?? [];
33
+ return (_jsxs(Collapsible, { open: expanded, onOpenChange: setExpanded, children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "h-6 w-6 text-muted-foreground", disabled: disabled, children: expanded ? _jsx(ChevronDown, { size: 18 }) : _jsx(ChevronRight, { size: 18 }) }) }), _jsx("span", { className: "text-sm font-semibold", children: label })] }), prop.description && (_jsx("p", { className: "ml-7 mt-1 text-xs text-muted-foreground", children: prop.description })), _jsx(CollapsibleContent, { children: _jsx("div", { className: "uipath-cas-schema-grid ml-3 mt-2 grid grid-cols-1 gap-4 border-l-2 border-border pl-4", children: Object.entries(nestedProperties).map(([nestedKey, nestedProp]) => {
34
+ const isFullSpan = nestedProp.type === "object" || nestedProp.type === "array";
35
+ return (_jsx("div", { className: isFullSpan ? "col-span-2" : "col-span-1", children: _jsx(AgentSchemaField, { prop: nestedProp, fieldKey: nestedKey, isRequired: requiredFields.includes(nestedKey), value: objectValue[nestedKey], onChange: (newVal) => onChange({ ...objectValue, [nestedKey]: newVal }), onValidationError: onValidationError, error: errorMap?.[nestedKey] ?? false, errorMap: getNestedErrorMap(errorMap, nestedKey), disabled: disabled }) }, nestedKey));
36
+ }) }) })] }));
37
+ };
38
+ const JsonObjectField = ({ value, onChange, onValidationError, error = false, disabled, label, description, }) => {
39
+ const { t } = useTranslation();
40
+ const [objectText, setObjectText] = useState(() => {
41
+ if (value === undefined || value === null)
42
+ return "{}";
43
+ return typeof value === "object"
44
+ ? JSON.stringify(value, null, 2)
45
+ : String(value);
46
+ });
47
+ const [jsonError, setJsonError] = useState(null);
48
+ const handleObjectChange = (e) => {
49
+ const text = e.target.value;
50
+ setObjectText(text);
51
+ try {
52
+ const parsed = JSON.parse(text);
53
+ if (typeof parsed !== "object" ||
54
+ Array.isArray(parsed) ||
55
+ parsed === null) {
56
+ setJsonError(t("agent_schema_error_json_object"));
57
+ onValidationError?.(true);
58
+ onChange(undefined);
59
+ }
60
+ else {
61
+ setJsonError(null);
62
+ onValidationError?.(false);
63
+ onChange(parsed);
64
+ }
65
+ }
66
+ catch {
67
+ setJsonError(t("agent_schema_error_json_syntax"));
68
+ onValidationError?.(true);
69
+ onChange(undefined);
70
+ }
71
+ };
72
+ const hasError = error || !!jsonError;
73
+ return (_jsx(FieldShell, { label: label, error: hasError, disabled: disabled, helperText: jsonError ?? description, children: _jsx(Textarea, { value: objectText, onChange: handleObjectChange, disabled: disabled, className: cn("min-h-14 resize-y bg-background", hasError && "border-destructive focus-visible:ring-destructive") }) }));
74
+ };
75
+ //# sourceMappingURL=ObjectField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectField.js","sourceRoot":"","sources":["../../../../src/components/AgentSchemaForm/inputs/ObjectField.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,EAAE,GACH,MAAM,qBAAqB,CAAC;AAC7B,OAAc,EAAE,QAAQ,E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CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,YAAY,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC;YAClD,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC;YAC1B,QAAQ,CAAC,SAAS,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,CAAC,SAAS,CAAC;IAEtC,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,SAAS,IAAI,WAAW,YAEpC,KAAC,QAAQ,IACP,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,kBAAkB,EAC5B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,iCAAiC,EACjC,QAAQ,IAAI,mDAAmD,CAChE,GACD,GACS,CACd,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { InputSchemaProperty } from "../types";
2
+ /**
3
+ * Returns true if a field value should be considered empty for required validation.
4
+ */
5
+ export declare const isFieldEmpty: (value: unknown) => boolean;
6
+ /**
7
+ * Recursively collects dot-notation paths for empty required fields within an object.
8
+ */
9
+ export declare const collectRequiredErrors: (value: unknown, prop: InputSchemaProperty, prefix: string, errors: Record<string, boolean>) => void;
10
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/components/AgentSchemaForm/inputs/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,OAG7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,OAAO,EACd,MAAM,mBAAmB,EACzB,QAAQ,MAAM,EACd,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,IAmCF,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Returns true if a field value should be considered empty for required validation.
3
+ */
4
+ export const isFieldEmpty = (value) => {
5
+ if (value == null || value === "")
6
+ return true;
7
+ return Array.isArray(value) && value.length === 0;
8
+ };
9
+ /**
10
+ * Recursively collects dot-notation paths for empty required fields within an object.
11
+ */
12
+ export const collectRequiredErrors = (value, prop, prefix, errors) => {
13
+ if (prop.type !== "object")
14
+ return;
15
+ const nestedProps = prop.properties;
16
+ if (!nestedProps || Object.keys(nestedProps).length === 0)
17
+ return;
18
+ const objectValue = (value === undefined || value === null ? {} : value);
19
+ const required = prop.required ?? [];
20
+ for (const [key, nestedProp] of Object.entries(nestedProps)) {
21
+ const fullPath = `${prefix}.${key}`;
22
+ const nestedValue = objectValue[key];
23
+ if (required.includes(key) && isFieldEmpty(nestedValue)) {
24
+ errors[fullPath] = true;
25
+ errors[prefix] = true;
26
+ }
27
+ if (nestedProp?.type === "object") {
28
+ const nestedHasProps = nestedProp.properties !== null &&
29
+ nestedProp.properties !== undefined &&
30
+ Object.keys(nestedProp.properties).length > 0;
31
+ if (nestedHasProps) {
32
+ collectRequiredErrors(nestedValue, nestedProp, fullPath, errors);
33
+ if (Object.keys(errors).some((k) => k.startsWith(`${fullPath}.`))) {
34
+ errors[fullPath] = true;
35
+ errors[prefix] = true;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ };
41
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/components/AgentSchemaForm/inputs/validation.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAc,EAAW,EAAE;IACtD,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CA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AAC,UAAoB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YAC1D,IAAI,cAAc,EAAE,CAAC;gBACnB,qBAAqB,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;gBACjE,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC;oBAClE,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;oBACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { InputSchema } from "./types";
2
+ /**
3
+ * Resolves a full JSON Schema (potentially with $defs, $ref, anyOf)
4
+ * into a flat InputSchema that AgentSchemaForm can render.
5
+ */
6
+ export declare function resolveSchema(raw: unknown): InputSchema;
7
+ //# sourceMappingURL=resolveSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveSchema.d.ts","sourceRoot":"","sources":["../../../src/components/AgentSchemaForm/resolveSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,SAAS,CAAC;AAkKhE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAmBvD"}