@uipath/apollo-react 4.0.0 → 4.1.1

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 (247) hide show
  1. package/dist/canvas/components/AddNodePanel/AddNodePreview.cjs +4 -4
  2. package/dist/canvas/components/AddNodePanel/AddNodePreview.js +4 -4
  3. package/dist/canvas/components/AgentCanvas/AgentFlow.cjs +4 -4
  4. package/dist/canvas/components/AgentCanvas/AgentFlow.js +4 -4
  5. package/dist/canvas/components/AgentCanvas/components/PaneContextMenu.cjs +3 -3
  6. package/dist/canvas/components/AgentCanvas/components/PaneContextMenu.js +3 -3
  7. package/dist/canvas/components/AgentCanvas/components/SuggestionGroupPanel.cjs +6 -6
  8. package/dist/canvas/components/AgentCanvas/components/SuggestionGroupPanel.d.ts.map +1 -1
  9. package/dist/canvas/components/AgentCanvas/components/SuggestionGroupPanel.js +6 -6
  10. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.cjs +14 -14
  11. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.js +14 -14
  12. package/dist/canvas/components/AgentCanvas/edges/StaticEdge.cjs +8 -8
  13. package/dist/canvas/components/AgentCanvas/edges/StaticEdge.js +8 -8
  14. package/dist/canvas/components/AgentCanvas/nodes/AgentNode.cjs +12 -12
  15. package/dist/canvas/components/AgentCanvas/nodes/AgentNode.js +12 -12
  16. package/dist/canvas/components/AgentCanvas/nodes/AgentNode.styles.cjs +18 -18
  17. package/dist/canvas/components/AgentCanvas/nodes/AgentNode.styles.js +18 -18
  18. package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.cjs +12 -12
  19. package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.d.ts.map +1 -1
  20. package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.js +12 -12
  21. package/dist/canvas/components/BaseCanvas/BaseCanvas.constants.cjs +2 -2
  22. package/dist/canvas/components/BaseCanvas/BaseCanvas.constants.d.ts +2 -2
  23. package/dist/canvas/components/BaseCanvas/BaseCanvas.constants.js +2 -2
  24. package/dist/canvas/components/BaseCanvas/PanShortcutTeachingUI.cjs +2 -2
  25. package/dist/canvas/components/BaseCanvas/PanShortcutTeachingUI.js +2 -2
  26. package/dist/canvas/components/BaseNode/BaseNode.cjs +2 -2
  27. package/dist/canvas/components/BaseNode/BaseNode.js +2 -2
  28. package/dist/canvas/components/BaseNode/BaseNode.styles.cjs +24 -24
  29. package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts.map +1 -1
  30. package/dist/canvas/components/BaseNode/BaseNode.styles.js +24 -24
  31. package/dist/canvas/components/BlankCanvasNode/BlankCanvasNode.cjs +1 -1
  32. package/dist/canvas/components/BlankCanvasNode/BlankCanvasNode.js +1 -1
  33. package/dist/canvas/components/BlankCanvasNode/BlankCanvasNode.styles.cjs +6 -6
  34. package/dist/canvas/components/BlankCanvasNode/BlankCanvasNode.styles.js +6 -6
  35. package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +1 -1
  36. package/dist/canvas/components/ButtonHandle/ButtonHandle.js +1 -1
  37. package/dist/canvas/components/ButtonHandle/ButtonHandle.styles.cjs +11 -11
  38. package/dist/canvas/components/ButtonHandle/ButtonHandle.styles.js +11 -11
  39. package/dist/canvas/components/ButtonHandle/SmartHandle.cjs +1 -1
  40. package/dist/canvas/components/ButtonHandle/SmartHandle.d.ts.map +1 -1
  41. package/dist/canvas/components/ButtonHandle/SmartHandle.js +1 -1
  42. package/dist/canvas/components/CodedAgent/CodedAgentFlow.cjs +6 -6
  43. package/dist/canvas/components/CodedAgent/CodedAgentFlow.d.ts.map +1 -1
  44. package/dist/canvas/components/CodedAgent/CodedAgentFlow.js +6 -6
  45. package/dist/canvas/components/Edges/EdgeUtils.cjs +14 -14
  46. package/dist/canvas/components/Edges/EdgeUtils.js +14 -14
  47. package/dist/canvas/components/Edges/SequenceEdge.cjs +11 -11
  48. package/dist/canvas/components/Edges/SequenceEdge.js +11 -11
  49. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.cjs +4 -4
  50. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts.map +1 -1
  51. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.js +4 -4
  52. package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.cjs +5 -5
  53. package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.js +5 -5
  54. package/dist/canvas/components/GroupNode/GroupNode.styles.cjs +19 -19
  55. package/dist/canvas/components/GroupNode/GroupNode.styles.js +19 -19
  56. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +2 -2
  57. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +2 -2
  58. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.cjs +3 -3
  59. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.js +3 -3
  60. package/dist/canvas/components/MiniCanvasNavigator/MiniCanvasNavigator.cjs +2 -2
  61. package/dist/canvas/components/MiniCanvasNavigator/MiniCanvasNavigator.js +2 -2
  62. package/dist/canvas/components/NodeInspector.cjs +4 -4
  63. package/dist/canvas/components/NodeInspector.js +4 -4
  64. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.styles.cjs +30 -30
  65. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.styles.js +30 -30
  66. package/dist/canvas/components/StageNode/StageConnectionEdge.cjs +1 -1
  67. package/dist/canvas/components/StageNode/StageConnectionEdge.js +1 -1
  68. package/dist/canvas/components/StageNode/StageEdge.cjs +7 -7
  69. package/dist/canvas/components/StageNode/StageEdge.js +7 -7
  70. package/dist/canvas/components/StageNode/StageNode.styles.cjs +34 -34
  71. package/dist/canvas/components/StageNode/StageNode.styles.js +34 -34
  72. package/dist/canvas/components/StageNode/TaskContent.cjs +1 -1
  73. package/dist/canvas/components/StageNode/TaskContent.js +1 -1
  74. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.cjs +20 -20
  75. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.d.ts.map +1 -1
  76. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.js +20 -20
  77. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.types.cjs +1 -1
  78. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.types.d.ts +1 -1
  79. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.types.js +1 -1
  80. package/dist/canvas/components/TaskIcon/TaskIcon.styles.cjs +1 -1
  81. package/dist/canvas/components/TaskIcon/TaskIcon.styles.js +1 -1
  82. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.cjs +2 -2
  83. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.js +2 -2
  84. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.cjs +9 -9
  85. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.js +9 -9
  86. package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.cjs +3 -3
  87. package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.js +3 -3
  88. package/dist/canvas/components/Toolbox/ListView.cjs +3 -3
  89. package/dist/canvas/components/Toolbox/ListView.js +3 -3
  90. package/dist/canvas/components/Toolbox/ListView.styles.cjs +7 -7
  91. package/dist/canvas/components/Toolbox/ListView.styles.js +7 -7
  92. package/dist/canvas/components/Toolbox/SearchBox.styles.cjs +8 -8
  93. package/dist/canvas/components/Toolbox/SearchBox.styles.js +8 -8
  94. package/dist/canvas/components/Toolbox/Toolbox.styles.cjs +2 -2
  95. package/dist/canvas/components/Toolbox/Toolbox.styles.js +2 -2
  96. package/dist/canvas/components/TriggerNode/TriggerNode.styles.cjs +15 -15
  97. package/dist/canvas/components/TriggerNode/TriggerNode.styles.js +15 -15
  98. package/dist/canvas/styles/execution-status.cjs +10 -10
  99. package/dist/canvas/styles/execution-status.js +10 -10
  100. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  101. package/dist/canvas/styles/variables.css +67 -32
  102. package/dist/canvas/utils/adornment-resolver.cjs +2 -2
  103. package/dist/canvas/utils/adornment-resolver.js +2 -2
  104. package/dist/canvas/utils/coded-agents/mermaid-parser.cjs +1 -1
  105. package/dist/canvas/utils/coded-agents/mermaid-parser.js +1 -1
  106. package/dist/canvas/utils/createPreviewNode.cjs +1 -1
  107. package/dist/canvas/utils/createPreviewNode.js +1 -1
  108. package/dist/canvas/utils/export-canvas.cjs +1 -1
  109. package/dist/canvas/utils/export-canvas.d.ts.map +1 -1
  110. package/dist/canvas/utils/export-canvas.js +1 -1
  111. package/package.json +2 -2
  112. package/dist/canvas/components/AddNodePanel/AddNodePanel.stories.cjs +0 -429
  113. package/dist/canvas/components/AddNodePanel/AddNodePanel.stories.d.ts +0 -11
  114. package/dist/canvas/components/AddNodePanel/AddNodePanel.stories.d.ts.map +0 -1
  115. package/dist/canvas/components/AddNodePanel/AddNodePanel.stories.js +0 -380
  116. package/dist/canvas/components/AgentCanvas/AgentFlow.stories.cjs +0 -2209
  117. package/dist/canvas/components/AgentCanvas/AgentFlow.stories.d.ts +0 -11
  118. package/dist/canvas/components/AgentCanvas/AgentFlow.stories.d.ts.map +0 -1
  119. package/dist/canvas/components/AgentCanvas/AgentFlow.stories.js +0 -2160
  120. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.stories.cjs +0 -246
  121. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.stories.d.ts +0 -10
  122. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.stories.d.ts.map +0 -1
  123. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.stories.js +0 -200
  124. package/dist/canvas/components/BaseCanvas/BaseCanvas.stories.cjs +0 -981
  125. package/dist/canvas/components/BaseCanvas/BaseCanvas.stories.d.ts +0 -12
  126. package/dist/canvas/components/BaseCanvas/BaseCanvas.stories.d.ts.map +0 -1
  127. package/dist/canvas/components/BaseCanvas/BaseCanvas.stories.js +0 -929
  128. package/dist/canvas/components/BaseNode/BaseNode.stories.cjs +0 -1150
  129. package/dist/canvas/components/BaseNode/BaseNode.stories.d.ts +0 -11
  130. package/dist/canvas/components/BaseNode/BaseNode.stories.d.ts.map +0 -1
  131. package/dist/canvas/components/BaseNode/BaseNode.stories.js +0 -1101
  132. package/dist/canvas/components/ButtonHandle/ButtonHandle.stories.cjs +0 -969
  133. package/dist/canvas/components/ButtonHandle/ButtonHandle.stories.d.ts +0 -9
  134. package/dist/canvas/components/ButtonHandle/ButtonHandle.stories.d.ts.map +0 -1
  135. package/dist/canvas/components/ButtonHandle/ButtonHandle.stories.js +0 -926
  136. package/dist/canvas/components/ButtonHandle/SmartHandle.stories.cjs +0 -608
  137. package/dist/canvas/components/ButtonHandle/SmartHandle.stories.d.ts +0 -8
  138. package/dist/canvas/components/ButtonHandle/SmartHandle.stories.d.ts.map +0 -1
  139. package/dist/canvas/components/ButtonHandle/SmartHandle.stories.js +0 -568
  140. package/dist/canvas/components/CanvasPerformance.stories.cjs +0 -349
  141. package/dist/canvas/components/CanvasPerformance.stories.d.ts +0 -6
  142. package/dist/canvas/components/CanvasPerformance.stories.d.ts.map +0 -1
  143. package/dist/canvas/components/CanvasPerformance.stories.js +0 -312
  144. package/dist/canvas/components/CodedAgent/CodedAgentFlow.stories.cjs +0 -119
  145. package/dist/canvas/components/CodedAgent/CodedAgentFlow.stories.d.ts +0 -10
  146. package/dist/canvas/components/CodedAgent/CodedAgentFlow.stories.d.ts.map +0 -1
  147. package/dist/canvas/components/CodedAgent/CodedAgentFlow.stories.js +0 -73
  148. package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.cjs +0 -518
  149. package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.d.ts +0 -6
  150. package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.d.ts.map +0 -1
  151. package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.js +0 -481
  152. package/dist/canvas/components/Edges/SequenceEdge.stories.cjs +0 -1073
  153. package/dist/canvas/components/Edges/SequenceEdge.stories.d.ts +0 -10
  154. package/dist/canvas/components/Edges/SequenceEdge.stories.d.ts.map +0 -1
  155. package/dist/canvas/components/Edges/SequenceEdge.stories.js +0 -1024
  156. package/dist/canvas/components/Edges/XyFlowEdgeComparison.stories.cjs +0 -796
  157. package/dist/canvas/components/Edges/XyFlowEdgeComparison.stories.d.ts +0 -7
  158. package/dist/canvas/components/Edges/XyFlowEdgeComparison.stories.d.ts.map +0 -1
  159. package/dist/canvas/components/Edges/XyFlowEdgeComparison.stories.js +0 -756
  160. package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.stories.cjs +0 -245
  161. package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.stories.d.ts +0 -30
  162. package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.stories.d.ts.map +0 -1
  163. package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.stories.js +0 -208
  164. package/dist/canvas/components/Flow.stories.cjs +0 -778
  165. package/dist/canvas/components/Flow.stories.d.ts +0 -11
  166. package/dist/canvas/components/Flow.stories.d.ts.map +0 -1
  167. package/dist/canvas/components/Flow.stories.js +0 -725
  168. package/dist/canvas/components/GroupNode/GroupNode.stories.cjs +0 -837
  169. package/dist/canvas/components/GroupNode/GroupNode.stories.d.ts +0 -12
  170. package/dist/canvas/components/GroupNode/GroupNode.stories.d.ts.map +0 -1
  171. package/dist/canvas/components/GroupNode/GroupNode.stories.js +0 -782
  172. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.stories.cjs +0 -88
  173. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.stories.d.ts +0 -7
  174. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.stories.d.ts.map +0 -1
  175. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.stories.js +0 -51
  176. package/dist/canvas/components/NodeInspector.stories.cjs +0 -229
  177. package/dist/canvas/components/NodeInspector.stories.d.ts +0 -20
  178. package/dist/canvas/components/NodeInspector.stories.d.ts.map +0 -1
  179. package/dist/canvas/components/NodeInspector.stories.js +0 -192
  180. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.cjs +0 -122
  181. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.d.ts +0 -7
  182. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.d.ts.map +0 -1
  183. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.js +0 -85
  184. package/dist/canvas/components/StageNode/StageNode.stories.cjs +0 -2690
  185. package/dist/canvas/components/StageNode/StageNode.stories.d.ts +0 -17
  186. package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +0 -1
  187. package/dist/canvas/components/StageNode/StageNode.stories.js +0 -2623
  188. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.stories.cjs +0 -552
  189. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.stories.d.ts +0 -8
  190. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.stories.d.ts.map +0 -1
  191. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.stories.js +0 -509
  192. package/dist/canvas/components/TaskIcon/TaskIcon.stories.cjs +0 -109
  193. package/dist/canvas/components/TaskIcon/TaskIcon.stories.d.ts +0 -10
  194. package/dist/canvas/components/TaskIcon/TaskIcon.stories.d.ts.map +0 -1
  195. package/dist/canvas/components/TaskIcon/TaskIcon.stories.js +0 -72
  196. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.stories.cjs +0 -283
  197. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.stories.d.ts +0 -7
  198. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.stories.d.ts.map +0 -1
  199. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.stories.js +0 -243
  200. package/dist/canvas/components/TriggerNode/TriggerNode.stories.cjs +0 -270
  201. package/dist/canvas/components/TriggerNode/TriggerNode.stories.d.ts +0 -16
  202. package/dist/canvas/components/TriggerNode/TriggerNode.stories.d.ts.map +0 -1
  203. package/dist/canvas/components/TriggerNode/TriggerNode.stories.js +0 -233
  204. package/dist/canvas/controls/Breadcrumb/Breadcrumb.stories.cjs +0 -76
  205. package/dist/canvas/controls/Breadcrumb/Breadcrumb.stories.d.ts +0 -7
  206. package/dist/canvas/controls/Breadcrumb/Breadcrumb.stories.d.ts.map +0 -1
  207. package/dist/canvas/controls/Breadcrumb/Breadcrumb.stories.js +0 -39
  208. package/dist/canvas/icons/Icons.stories.cjs +0 -207
  209. package/dist/canvas/icons/Icons.stories.d.ts +0 -6
  210. package/dist/canvas/icons/Icons.stories.d.ts.map +0 -1
  211. package/dist/canvas/icons/Icons.stories.js +0 -167
  212. package/dist/canvas/layouts/Column.stories.cjs +0 -716
  213. package/dist/canvas/layouts/Column.stories.d.ts +0 -14
  214. package/dist/canvas/layouts/Column.stories.d.ts.map +0 -1
  215. package/dist/canvas/layouts/Column.stories.js +0 -658
  216. package/dist/canvas/layouts/Grid.stories.cjs +0 -1033
  217. package/dist/canvas/layouts/Grid.stories.d.ts +0 -19
  218. package/dist/canvas/layouts/Grid.stories.d.ts.map +0 -1
  219. package/dist/canvas/layouts/Grid.stories.js +0 -960
  220. package/dist/canvas/layouts/Row.stories.cjs +0 -687
  221. package/dist/canvas/layouts/Row.stories.d.ts +0 -14
  222. package/dist/canvas/layouts/Row.stories.d.ts.map +0 -1
  223. package/dist/canvas/layouts/Row.stories.js +0 -629
  224. package/dist/canvas/storybook-utils/components/StoryInfoPanel.cjs +0 -100
  225. package/dist/canvas/storybook-utils/components/StoryInfoPanel.js +0 -66
  226. package/dist/canvas/storybook-utils/components/index.cjs +0 -58
  227. package/dist/canvas/storybook-utils/components/index.js +0 -1
  228. package/dist/canvas/storybook-utils/decorators.cjs +0 -101
  229. package/dist/canvas/storybook-utils/decorators.js +0 -64
  230. package/dist/canvas/storybook-utils/hooks/index.cjs +0 -58
  231. package/dist/canvas/storybook-utils/hooks/index.js +0 -1
  232. package/dist/canvas/storybook-utils/hooks/useCanvasStory.cjs +0 -118
  233. package/dist/canvas/storybook-utils/hooks/useCanvasStory.js +0 -81
  234. package/dist/canvas/storybook-utils/index.cjs +0 -86
  235. package/dist/canvas/storybook-utils/index.js +0 -5
  236. package/dist/canvas/storybook-utils/manifests/category-definitions.cjs +0 -220
  237. package/dist/canvas/storybook-utils/manifests/category-definitions.js +0 -186
  238. package/dist/canvas/storybook-utils/manifests/index.cjs +0 -82
  239. package/dist/canvas/storybook-utils/manifests/index.js +0 -10
  240. package/dist/canvas/storybook-utils/manifests/node-definitions.cjs +0 -1133
  241. package/dist/canvas/storybook-utils/manifests/node-definitions.js +0 -1099
  242. package/dist/canvas/storybook-utils/mocks/index.cjs +0 -65
  243. package/dist/canvas/storybook-utils/mocks/index.js +0 -2
  244. package/dist/canvas/storybook-utils/mocks/nodes.cjs +0 -237
  245. package/dist/canvas/storybook-utils/mocks/nodes.js +0 -191
  246. package/dist/canvas/storybook-utils/mocks/resources.cjs +0 -296
  247. package/dist/canvas/storybook-utils/mocks/resources.js +0 -238
@@ -1,2160 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { Column, Row } from "../../layouts/index.js";
3
- import { ReactFlowProvider } from "../../xyflow/react.js";
4
- import { FontVariantToken } from "@uipath/apollo-react/core";
5
- import { ApButton, ApTypography } from "../../../material/index.js";
6
- import { useCallback, useState } from "react";
7
- import { StoryInfoPanel } from "../../storybook-utils/index.js";
8
- import { ProjectType, createPlaceholderSuggestion } from "../../types.js";
9
- import { AgentFlow } from "./AgentFlow.js";
10
- const meta = {
11
- title: 'Canvas/AgentFlow',
12
- component: AgentFlow,
13
- decorators: [
14
- (Story)=>/*#__PURE__*/ jsx("div", {
15
- style: {
16
- position: 'absolute',
17
- top: 0,
18
- left: 0,
19
- width: '100%',
20
- height: '100%'
21
- },
22
- children: /*#__PURE__*/ jsx(Story, {})
23
- })
24
- ]
25
- };
26
- const AgentFlow_stories = meta;
27
- const generateResourceId = ()=>`resource-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
28
- const sampleContexts = [
29
- {
30
- name: 'User Profile',
31
- description: 'Information about the current user'
32
- },
33
- {
34
- name: 'Session Context',
35
- description: 'Current session information'
36
- },
37
- {
38
- name: 'Organization Settings',
39
- description: 'Organization configuration'
40
- },
41
- {
42
- name: 'Environment Variables',
43
- description: 'System environment settings'
44
- }
45
- ];
46
- const sampleTools = [
47
- {
48
- name: 'Send Email',
49
- description: 'Email Service',
50
- projectType: ProjectType.Internal
51
- },
52
- {
53
- name: 'Broken Icon Tool',
54
- description: 'Automation',
55
- projectType: ProjectType.Internal,
56
- iconUrl: 'https://testtest.broken/blah/blah'
57
- },
58
- {
59
- name: 'Query Database',
60
- description: 'Database',
61
- projectType: ProjectType.Internal
62
- },
63
- {
64
- name: 'Call API',
65
- description: 'REST API',
66
- projectType: ProjectType.Api
67
- },
68
- {
69
- name: 'Process Document',
70
- description: 'Document AI',
71
- projectType: ProjectType.Internal
72
- },
73
- {
74
- name: 'Run Automation',
75
- description: 'Automation',
76
- projectType: ProjectType.Internal
77
- }
78
- ];
79
- const sampleEscalations = [
80
- {
81
- name: 'Manager Approval',
82
- description: 'Escalate to manager'
83
- },
84
- {
85
- name: 'Amount Exceeded',
86
- description: 'Transaction limit exceeded'
87
- },
88
- {
89
- name: 'Security Alert',
90
- description: 'Suspicious activity detected'
91
- },
92
- {
93
- name: 'Manual Review',
94
- description: 'Requires human review'
95
- }
96
- ];
97
- const sampleMcp = [
98
- {
99
- name: 'File parser',
100
- description: 'Parse files in the workspace'
101
- },
102
- {
103
- name: 'Budget Assistant RPC',
104
- description: 'Using RPC to connect to a budget assistant server API'
105
- }
106
- ];
107
- const sampleA2aAgents = [
108
- {
109
- name: 'Billing Agent',
110
- description: 'Handles billing inquiries via A2A'
111
- },
112
- {
113
- name: 'Support Agent',
114
- description: 'Customer support agent via A2A protocol'
115
- }
116
- ];
117
- let contextIndex = 0;
118
- let toolIndex = 0;
119
- let escalationIndex = 0;
120
- let mcpIndex = 0;
121
- let a2aIndex = 0;
122
- const createSampleContext = ()=>{
123
- const sample = sampleContexts[contextIndex % sampleContexts.length];
124
- contextIndex++;
125
- return {
126
- id: generateResourceId(),
127
- type: 'context',
128
- name: sample.name,
129
- hasBreakpoint: false,
130
- hasGuardrails: false,
131
- description: sample.description
132
- };
133
- };
134
- const createSampleTool = ()=>{
135
- const sample = sampleTools[toolIndex % sampleTools.length];
136
- toolIndex++;
137
- return {
138
- id: generateResourceId(),
139
- type: 'tool',
140
- name: sample.name,
141
- description: sample.description,
142
- iconUrl: sample.iconUrl ?? '',
143
- hasBreakpoint: false,
144
- hasGuardrails: false,
145
- projectType: sample.projectType
146
- };
147
- };
148
- const createSampleEscalation = ()=>{
149
- const sample = sampleEscalations[escalationIndex % sampleEscalations.length];
150
- escalationIndex++;
151
- return {
152
- id: generateResourceId(),
153
- type: 'escalation',
154
- name: sample.name,
155
- hasBreakpoint: false,
156
- hasGuardrails: false,
157
- description: sample.description
158
- };
159
- };
160
- const createSampleMcp = ()=>{
161
- const sample = sampleMcp[mcpIndex % sampleMcp.length];
162
- mcpIndex++;
163
- return {
164
- id: generateResourceId(),
165
- type: 'mcp',
166
- name: sample.name,
167
- slug: '',
168
- folderPath: '',
169
- availableTools: [],
170
- description: sample.description,
171
- hasBreakpoint: false,
172
- hasGuardrails: false
173
- };
174
- };
175
- const createSampleMemorySpace = ()=>({
176
- id: generateResourceId(),
177
- type: 'memorySpace',
178
- name: 'Agent Memory Space',
179
- description: 'Memory space for the agent'
180
- });
181
- const createSampleA2a = ()=>{
182
- const sample = sampleA2aAgents[a2aIndex % sampleA2aAgents.length];
183
- a2aIndex++;
184
- return {
185
- id: generateResourceId(),
186
- type: 'a2a',
187
- name: sample.name,
188
- description: sample.description,
189
- hasBreakpoint: false,
190
- hasGuardrails: false
191
- };
192
- };
193
- const sampleResources = [
194
- {
195
- id: 'tool-slack',
196
- type: 'tool',
197
- name: 'Send message',
198
- description: 'Slack',
199
- iconUrl: '',
200
- hasBreakpoint: false,
201
- isCurrentBreakpoint: false,
202
- hasGuardrails: false,
203
- projectType: ProjectType.Internal,
204
- isDisabled: false
205
- },
206
- {
207
- id: 'tool-ixp',
208
- type: 'tool',
209
- name: 'Extract data',
210
- description: 'IXP',
211
- iconUrl: '',
212
- hasBreakpoint: false,
213
- isCurrentBreakpoint: false,
214
- hasGuardrails: false,
215
- projectType: ProjectType.IXP,
216
- isDisabled: false
217
- },
218
- {
219
- id: 'tool-claim',
220
- type: 'tool',
221
- name: 'Validate claim',
222
- description: 'Automation',
223
- iconUrl: '',
224
- hasBreakpoint: false,
225
- isCurrentBreakpoint: false,
226
- hasGuardrails: false,
227
- projectType: ProjectType.Internal,
228
- isDisabled: false
229
- },
230
- {
231
- id: 'context-user-profile',
232
- type: 'context',
233
- name: 'User Profile',
234
- description: 'Information about the current user',
235
- hasBreakpoint: false,
236
- isCurrentBreakpoint: false
237
- },
238
- {
239
- id: 'escalation-amount-exceeded',
240
- type: 'escalation',
241
- name: 'Amount exceeded',
242
- description: 'Claim form',
243
- hasBreakpoint: false,
244
- isCurrentBreakpoint: false
245
- },
246
- {
247
- id: 'mcp-file-parser',
248
- type: 'mcp',
249
- name: 'File Parser',
250
- description: 'File Parser',
251
- hasBreakpoint: false,
252
- isCurrentBreakpoint: false,
253
- hasGuardrails: false,
254
- slug: 'file-parser',
255
- folderPath: 'file-parser',
256
- availableTools: []
257
- }
258
- ];
259
- const sampleAgentDefinition = {
260
- name: 'Test Agent',
261
- version: '1.0',
262
- settings: {
263
- model: 'gpt-4o-2024-11-20',
264
- engine: 'test-engine',
265
- temperature: 0,
266
- maxTokens: 16384,
267
- maxIterations: 10
268
- },
269
- tools: [],
270
- resources: []
271
- };
272
- const sampleSpans = [
273
- {
274
- Id: 'span1',
275
- TraceId: 'trace1',
276
- ParentId: 'parent1',
277
- Name: 'agentRun',
278
- StartTime: '2021-01-01T00:00:00Z',
279
- EndTime: '2021-01-01T00:00:30Z',
280
- Status: 1,
281
- CreatedAt: '2021-01-01T00:00:00Z',
282
- UpdatedAt: '2021-01-01T00:00:00Z',
283
- SpanType: 'agentRun',
284
- Attributes: JSON.stringify({
285
- type: 'agentRun'
286
- }),
287
- OrganizationId: 'org1',
288
- TenantId: 'tenant1',
289
- Source: 1
290
- },
291
- {
292
- Id: 'span2',
293
- TraceId: 'trace1',
294
- ParentId: 'span1',
295
- Name: 'contextLoad',
296
- StartTime: '2021-01-01T00:00:31Z',
297
- EndTime: '2021-01-01T00:01:00Z',
298
- Status: 1,
299
- CreatedAt: '2021-01-01T00:00:00Z',
300
- UpdatedAt: '2021-01-01T00:00:00Z',
301
- SpanType: 'contextLoad',
302
- Attributes: JSON.stringify({
303
- type: 'contextLoad',
304
- contextName: 'test_context'
305
- }),
306
- OrganizationId: 'org1',
307
- TenantId: 'tenant1',
308
- Source: 1
309
- },
310
- {
311
- Id: 'span3',
312
- TraceId: 'trace1',
313
- ParentId: 'span2',
314
- Name: 'completion',
315
- StartTime: '2021-01-01T00:01:01Z',
316
- EndTime: '2021-01-01T00:03:00Z',
317
- Status: 1,
318
- CreatedAt: '2021-01-01T00:00:00Z',
319
- UpdatedAt: '2021-01-01T00:00:00Z',
320
- SpanType: 'completion',
321
- Attributes: JSON.stringify({
322
- type: 'completion'
323
- }),
324
- OrganizationId: 'org1',
325
- TenantId: 'tenant1',
326
- Source: 1
327
- }
328
- ];
329
- const sampleStickyNotes = [
330
- {
331
- id: 'sticky-1',
332
- content: '## Welcome!\nThis is a **markdown** sticky note.\n\n- Supports lists\n- And formatting',
333
- position: {
334
- x: -150,
335
- y: -450
336
- },
337
- size: {
338
- width: 320,
339
- height: 300
340
- },
341
- color: 'yellow'
342
- },
343
- {
344
- id: 'sticky-2',
345
- content: 'Remember to test:\n\n1. Dragging\n2. Resizing\n3. Color changes\n4. Content editing',
346
- position: {
347
- x: 380,
348
- y: 0
349
- },
350
- size: {
351
- width: 500,
352
- height: 450
353
- },
354
- color: 'blue'
355
- },
356
- {
357
- id: 'sticky-3',
358
- content: 'Quick note: Press Delete to remove selected notes',
359
- position: {
360
- x: -220,
361
- y: 220
362
- },
363
- size: {
364
- width: 300,
365
- height: 230
366
- },
367
- color: 'pink'
368
- }
369
- ];
370
- const AgentFlowWrapper = ({ mode, initialResources = sampleResources, initialStickyNotes = [], activeResourceIds, spans = sampleSpans, definition = sampleAgentDefinition, enableTimelinePlayer = true, enableMemory = true, enableStickyNotes = true, enableInstructions = false, healthScore, onHealthScoreClick, allowDragging = false, agentNodePosition, onAgentNodePositionChange = ()=>{}, instructions })=>{
371
- const [resources, setResources] = useState(initialResources);
372
- const [selectedResourceId, setSelectedResourceId] = useState(null);
373
- const [_sidebarMode, setSidebarMode] = useState('properties');
374
- const [stickyNotes, setStickyNotes] = useState(initialStickyNotes);
375
- const handleAddStickyNote = useCallback((data)=>{
376
- setStickyNotes((prev)=>[
377
- ...prev,
378
- data
379
- ]);
380
- }, []);
381
- const handleUpdateStickyNote = useCallback((id, updates)=>{
382
- setStickyNotes((prev)=>prev.map((note)=>note.id === id ? {
383
- ...note,
384
- ...updates
385
- } : note));
386
- }, []);
387
- const handleRemoveStickyNote = useCallback((id)=>{
388
- setStickyNotes((prev)=>prev.filter((note)=>note.id !== id));
389
- }, []);
390
- const handleSelectResource = useCallback((resourceId)=>{
391
- setSelectedResourceId(resourceId);
392
- setSidebarMode('properties');
393
- }, []);
394
- const handleAddResourceRequest = useCallback((type)=>{
395
- let newResource;
396
- switch(type){
397
- case 'context':
398
- newResource = createSampleContext();
399
- break;
400
- case 'tool':
401
- newResource = createSampleTool();
402
- break;
403
- case 'escalation':
404
- newResource = createSampleEscalation();
405
- break;
406
- case 'mcp':
407
- newResource = createSampleMcp();
408
- break;
409
- case 'memorySpace':
410
- newResource = createSampleMemorySpace();
411
- break;
412
- case 'a2a':
413
- newResource = createSampleA2a();
414
- break;
415
- default:
416
- return;
417
- }
418
- setResources((prev)=>[
419
- ...prev,
420
- newResource
421
- ]);
422
- setSelectedResourceId(newResource.id);
423
- setSidebarMode('properties');
424
- }, []);
425
- const handleRemoveResource = useCallback((resource)=>{
426
- setResources((prev)=>prev.filter((r)=>r.id !== resource.id));
427
- if (selectedResourceId === resource.id) setSelectedResourceId(null);
428
- }, [
429
- selectedResourceId
430
- ]);
431
- const handleEnable = useCallback((resourceId, resource)=>{
432
- setResources((prev)=>prev.map((r)=>({
433
- ...r,
434
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
435
- isDisabled: false
436
- }
437
- })));
438
- }, []);
439
- const handleDisable = useCallback((resourceId, resource)=>{
440
- setResources((prev)=>prev.map((r)=>({
441
- ...r,
442
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
443
- isDisabled: true
444
- }
445
- })));
446
- }, []);
447
- const handleAddBreakpoint = useCallback((resourceId, resource)=>{
448
- setResources((prev)=>prev.map((r)=>({
449
- ...r,
450
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
451
- hasBreakpoint: true
452
- }
453
- })));
454
- }, []);
455
- const handleRemoveBreakpoint = useCallback((resourceId, resource)=>{
456
- setResources((prev)=>prev.map((r)=>({
457
- ...r,
458
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
459
- hasBreakpoint: false
460
- }
461
- })));
462
- }, []);
463
- const handleAddGuardrail = useCallback((resourceId, resource)=>{
464
- setResources((prev)=>prev.map((r)=>({
465
- ...r,
466
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
467
- hasGuardrails: true
468
- }
469
- })));
470
- }, []);
471
- const setSpanForSelectedNode = useCallback((_node)=>{}, []);
472
- const getNodeFromSelectedSpan = useCallback((_nodes)=>null, []);
473
- const renderSidebar = ()=>{
474
- if ('design' !== mode) return null;
475
- return /*#__PURE__*/ jsxs(Column, {
476
- w: 300,
477
- p: 16,
478
- gap: 16,
479
- style: {
480
- backgroundColor: 'var(--uix-canvas-background-secondary)',
481
- borderLeft: '1px solid var(--uix-canvas-border-de-emp)',
482
- overflowY: 'auto',
483
- color: 'var(--uix-canvas-foreground)'
484
- },
485
- children: [
486
- /*#__PURE__*/ jsx("h3", {
487
- style: {
488
- margin: 0
489
- },
490
- children: "Design Mode"
491
- }),
492
- selectedResourceId && /*#__PURE__*/ jsxs("div", {
493
- children: [
494
- /*#__PURE__*/ jsx("strong", {
495
- children: "Selected:"
496
- }),
497
- " ",
498
- selectedResourceId
499
- ]
500
- }),
501
- /*#__PURE__*/ jsxs("div", {
502
- children: [
503
- /*#__PURE__*/ jsx("strong", {
504
- children: "Resources:"
505
- }),
506
- " ",
507
- resources.length
508
- ]
509
- }),
510
- enableStickyNotes && /*#__PURE__*/ jsxs("div", {
511
- children: [
512
- /*#__PURE__*/ jsx("strong", {
513
- children: "Sticky Notes:"
514
- }),
515
- " ",
516
- stickyNotes.length
517
- ]
518
- }),
519
- allowDragging && agentNodePosition && /*#__PURE__*/ jsxs("div", {
520
- style: {
521
- padding: '12px',
522
- backgroundColor: 'var(--uix-canvas-background)',
523
- borderRadius: '4px',
524
- border: '1px solid var(--uix-canvas-border-de-emp)'
525
- },
526
- children: [
527
- /*#__PURE__*/ jsx("div", {
528
- style: {
529
- fontWeight: 'bold',
530
- marginBottom: '8px'
531
- },
532
- children: "Agent Node Position"
533
- }),
534
- /*#__PURE__*/ jsxs("div", {
535
- style: {
536
- fontSize: '0.875rem',
537
- fontFamily: 'monospace'
538
- },
539
- children: [
540
- /*#__PURE__*/ jsxs("div", {
541
- children: [
542
- /*#__PURE__*/ jsx("strong", {
543
- children: "X:"
544
- }),
545
- " ",
546
- agentNodePosition.x.toFixed(2)
547
- ]
548
- }),
549
- /*#__PURE__*/ jsxs("div", {
550
- children: [
551
- /*#__PURE__*/ jsx("strong", {
552
- children: "Y:"
553
- }),
554
- " ",
555
- agentNodePosition.y.toFixed(2)
556
- ]
557
- })
558
- ]
559
- })
560
- ]
561
- }),
562
- /*#__PURE__*/ jsxs("div", {
563
- style: {
564
- fontSize: '0.875rem',
565
- color: 'var(--uix-canvas-foreground-de-emp)'
566
- },
567
- children: [
568
- /*#__PURE__*/ jsx("p", {
569
- children: "Click the + buttons on the agent node to add:"
570
- }),
571
- /*#__PURE__*/ jsxs("ul", {
572
- children: [
573
- /*#__PURE__*/ jsx("li", {
574
- children: "Memory (top)"
575
- }),
576
- /*#__PURE__*/ jsx("li", {
577
- children: "Context (bottom-left)"
578
- }),
579
- /*#__PURE__*/ jsx("li", {
580
- children: "Escalations (bottom-center)"
581
- }),
582
- /*#__PURE__*/ jsx("li", {
583
- children: "Tools & MCPs (bottom-right)"
584
- })
585
- ]
586
- }),
587
- enableStickyNotes && /*#__PURE__*/ jsxs(Fragment, {
588
- children: [
589
- /*#__PURE__*/ jsx("p", {
590
- style: {
591
- marginTop: '12px'
592
- },
593
- children: "Use the sticky note button at the bottom to add notes."
594
- }),
595
- /*#__PURE__*/ jsx("p", {
596
- children: "Press Delete/Backspace to remove selected notes."
597
- })
598
- ]
599
- })
600
- ]
601
- })
602
- ]
603
- });
604
- };
605
- return /*#__PURE__*/ jsx(ReactFlowProvider, {
606
- children: /*#__PURE__*/ jsxs(Row, {
607
- w: "100%",
608
- h: "100%",
609
- style: {
610
- position: 'relative'
611
- },
612
- children: [
613
- /*#__PURE__*/ jsx("div", {
614
- style: {
615
- flex: 1,
616
- position: 'relative'
617
- },
618
- children: /*#__PURE__*/ jsx(AgentFlow, {
619
- allowDragging: allowDragging,
620
- agentNodePosition: agentNodePosition,
621
- onAgentNodePositionChange: onAgentNodePositionChange,
622
- definition: definition,
623
- spans: 'view' === mode ? spans : [],
624
- name: "Test Agent",
625
- description: "Test Description",
626
- mode: mode,
627
- resources: resources,
628
- activeResourceIds: activeResourceIds,
629
- setSpanForSelectedNode: setSpanForSelectedNode,
630
- getNodeFromSelectedSpan: getNodeFromSelectedSpan,
631
- onEnable: handleEnable,
632
- onDisable: handleDisable,
633
- onAddBreakpoint: handleAddBreakpoint,
634
- onRemoveBreakpoint: handleRemoveBreakpoint,
635
- onAddGuardrail: handleAddGuardrail,
636
- onAddResource: handleAddResourceRequest,
637
- onRemoveResource: handleRemoveResource,
638
- onSelectResource: handleSelectResource,
639
- enableTimelinePlayer: 'view' === mode && enableTimelinePlayer,
640
- enableMemory: enableMemory,
641
- enableStickyNotes: enableStickyNotes,
642
- enableInstructions: enableInstructions,
643
- stickyNotes: stickyNotes,
644
- onAddStickyNote: handleAddStickyNote,
645
- onUpdateStickyNote: handleUpdateStickyNote,
646
- onRemoveStickyNote: handleRemoveStickyNote,
647
- healthScore: healthScore,
648
- onHealthScoreClick: onHealthScoreClick,
649
- instructions: instructions
650
- })
651
- }),
652
- renderSidebar()
653
- ]
654
- })
655
- });
656
- };
657
- const DesignModePlayground = ()=>{
658
- const [hasResources, setHasResources] = useState(true);
659
- const [suggestionMode, setSuggestionMode] = useState('off');
660
- const [enableStickyNotes, setEnableStickyNotes] = useState(true);
661
- const [enableDragging, setEnableDragging] = useState(true);
662
- const [hasInstructions, setHasInstructions] = useState(false);
663
- const [systemPrompt, setSystemPrompt] = useState('');
664
- const [userPrompt, setUserPrompt] = useState('');
665
- const [resources, setResources] = useState(sampleResources);
666
- const [suggestionGroup, setSuggestionGroup] = useState(null);
667
- const [pendingStandalonePlaceholderId, setPendingStandalonePlaceholderId] = useState(null);
668
- const [openModalType, setOpenModalType] = useState(null);
669
- const [placeholderBeingConfigured, setPlaceholderBeingConfigured] = useState(null);
670
- const [stickyNotes, setStickyNotes] = useState([]);
671
- const [agentNodePosition, setAgentNodePosition] = useState(void 0);
672
- const [resourceNodePositions, setResourceNodePositions] = useState({});
673
- const [zoomLevel, setZoomLevel] = useState(1);
674
- const [selectedResourceId, setSelectedResourceId] = useState(null);
675
- const instructions = hasInstructions ? {
676
- system: systemPrompt || void 0,
677
- user: userPrompt || void 0
678
- } : void 0;
679
- const stateKey = `${hasResources}-${suggestionMode}-${enableStickyNotes}-${enableDragging}-${hasInstructions}`;
680
- const handleSelectResource = useCallback((resourceId)=>{
681
- setSelectedResourceId(resourceId);
682
- if ('pane' === resourceId && pendingStandalonePlaceholderId && suggestionGroup) {
683
- const pendingSuggestion = suggestionGroup.suggestions.find((s)=>s.id === pendingStandalonePlaceholderId);
684
- if (pendingSuggestion?.isStandalone) {
685
- const remaining = suggestionGroup.suggestions.filter((s)=>s.id !== pendingStandalonePlaceholderId);
686
- setSuggestionGroup(remaining.length > 0 ? {
687
- ...suggestionGroup,
688
- suggestions: remaining
689
- } : null);
690
- }
691
- setPendingStandalonePlaceholderId(null);
692
- setOpenModalType(null);
693
- setPlaceholderBeingConfigured(null);
694
- }
695
- }, [
696
- pendingStandalonePlaceholderId,
697
- suggestionGroup
698
- ]);
699
- const handleAddResourceDirect = useCallback((type)=>{
700
- let newResource;
701
- switch(type){
702
- case 'context':
703
- newResource = createSampleContext();
704
- break;
705
- case 'tool':
706
- newResource = createSampleTool();
707
- break;
708
- case 'escalation':
709
- newResource = createSampleEscalation();
710
- break;
711
- case 'mcp':
712
- newResource = createSampleMcp();
713
- break;
714
- case 'memorySpace':
715
- newResource = createSampleMemorySpace();
716
- break;
717
- case 'a2a':
718
- newResource = createSampleA2a();
719
- break;
720
- default:
721
- return;
722
- }
723
- setResources((prev)=>[
724
- ...prev,
725
- newResource
726
- ]);
727
- setSelectedResourceId(newResource.id);
728
- }, []);
729
- const handleRemoveResource = useCallback((resource)=>{
730
- setResources((prev)=>prev.filter((r)=>r.id !== resource.id));
731
- if (selectedResourceId === resource.id) setSelectedResourceId(null);
732
- }, [
733
- selectedResourceId
734
- ]);
735
- const handleEnable = useCallback((resourceId, resource)=>{
736
- setResources((prev)=>prev.map((r)=>({
737
- ...r,
738
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
739
- isDisabled: false
740
- }
741
- })));
742
- }, []);
743
- const handleDisable = useCallback((resourceId, resource)=>{
744
- setResources((prev)=>prev.map((r)=>({
745
- ...r,
746
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
747
- isDisabled: true
748
- }
749
- })));
750
- }, []);
751
- const handleAddBreakpoint = useCallback((resourceId, resource)=>{
752
- setResources((prev)=>prev.map((r)=>({
753
- ...r,
754
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
755
- hasBreakpoint: true
756
- }
757
- })));
758
- }, []);
759
- const handleRemoveBreakpoint = useCallback((resourceId, resource)=>{
760
- setResources((prev)=>prev.map((r)=>({
761
- ...r,
762
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
763
- hasBreakpoint: false
764
- }
765
- })));
766
- }, []);
767
- const handleAddGuardrail = useCallback((resourceId, resource)=>{
768
- setResources((prev)=>prev.map((r)=>({
769
- ...r,
770
- ...`${resource.parentNodeId}=>${r.name}:${r.id}` === resourceId && {
771
- hasGuardrails: true
772
- }
773
- })));
774
- }, []);
775
- const handleRequestPlaceholder = useCallback((type, cleanedSuggestionGroup)=>{
776
- if ('placeholders' !== suggestionMode) return null;
777
- if ('escalation' === type) return null;
778
- const placeholder = {
779
- id: `placeholder-${type}-${Date.now()}`,
780
- type,
781
- name: `New ${type.charAt(0).toUpperCase() + type.slice(1)}`,
782
- description: `Configure this ${type}...`
783
- };
784
- if ('tool' === type) {
785
- placeholder.iconUrl = '';
786
- placeholder.projectType = ProjectType.Internal;
787
- } else if ('mcp' === type) {
788
- placeholder.slug = '';
789
- placeholder.folderPath = '';
790
- placeholder.availableTools = [];
791
- }
792
- const updated = createPlaceholderSuggestion(placeholder, cleanedSuggestionGroup, {
793
- isStandalone: true
794
- });
795
- setSuggestionGroup(updated);
796
- const newSuggestion = updated.suggestions[updated.suggestions.length - 1];
797
- if (newSuggestion) setPendingStandalonePlaceholderId(newSuggestion.id);
798
- setOpenModalType(type);
799
- return placeholder;
800
- }, [
801
- suggestionMode
802
- ]);
803
- const handlePlaceholderNodeClick = useCallback((resourceType, placeholderData)=>{
804
- setOpenModalType(resourceType);
805
- setPlaceholderBeingConfigured(placeholderData);
806
- }, []);
807
- const handleActOnSuggestion = useCallback((suggestionId, action)=>{
808
- if (!suggestionGroup) return;
809
- const suggestion = suggestionGroup.suggestions.find((s)=>s.id === suggestionId);
810
- const remaining = suggestionGroup.suggestions.filter((s)=>s.id !== suggestionId);
811
- if (suggestion?.isStandalone && suggestionId === pendingStandalonePlaceholderId) {
812
- setPendingStandalonePlaceholderId(null);
813
- setOpenModalType(null);
814
- setPlaceholderBeingConfigured(null);
815
- }
816
- if ('reject' === action) return void setSuggestionGroup(remaining.length > 0 ? {
817
- ...suggestionGroup,
818
- suggestions: remaining
819
- } : null);
820
- if (suggestion) {
821
- if ('add' === suggestion.type && suggestion.resource) setResources((prev)=>[
822
- ...prev,
823
- suggestion.resource
824
- ]);
825
- else if ('update' === suggestion.type && suggestion.resourceId && suggestion.updatedFields) setResources((prev)=>prev.map((r)=>r.id === suggestion.resourceId ? {
826
- ...r,
827
- ...suggestion.updatedFields
828
- } : r));
829
- else if ('delete' === suggestion.type && suggestion.resourceIdToDelete) setResources((prev)=>prev.filter((r)=>r.id !== suggestion.resourceIdToDelete));
830
- }
831
- setSuggestionGroup(remaining.length > 0 ? {
832
- ...suggestionGroup,
833
- suggestions: remaining
834
- } : null);
835
- }, [
836
- suggestionGroup,
837
- pendingStandalonePlaceholderId
838
- ]);
839
- const handleActOnSuggestionGroup = useCallback((_groupId, action)=>{
840
- if (!suggestionGroup) return;
841
- const nonStandalone = suggestionGroup.suggestions.filter((s)=>!s.isStandalone);
842
- const standalone = suggestionGroup.suggestions.filter((s)=>s.isStandalone);
843
- if ('reject' === action) return void setSuggestionGroup(standalone.length > 0 ? {
844
- ...suggestionGroup,
845
- suggestions: standalone
846
- } : null);
847
- setResources((prev)=>{
848
- let updated = [
849
- ...prev
850
- ];
851
- nonStandalone.forEach((s)=>{
852
- if ('add' === s.type && s.resource) updated.push(s.resource);
853
- else if ('update' === s.type && s.resourceId && s.updatedFields) updated = updated.map((r)=>r.id === s.resourceId ? {
854
- ...r,
855
- ...s.updatedFields
856
- } : r);
857
- else if ('delete' === s.type && s.resourceIdToDelete) updated = updated.filter((r)=>r.id !== s.resourceIdToDelete);
858
- });
859
- return updated;
860
- });
861
- setSuggestionGroup(standalone.length > 0 ? {
862
- ...suggestionGroup,
863
- suggestions: standalone
864
- } : null);
865
- }, [
866
- suggestionGroup
867
- ]);
868
- const handleConfirmModal = useCallback(()=>{
869
- if (pendingStandalonePlaceholderId) handleActOnSuggestion(pendingStandalonePlaceholderId, 'accept');
870
- setOpenModalType(null);
871
- setPlaceholderBeingConfigured(null);
872
- }, [
873
- pendingStandalonePlaceholderId,
874
- handleActOnSuggestion
875
- ]);
876
- const handleCancelModal = useCallback(()=>{
877
- if (pendingStandalonePlaceholderId) handleActOnSuggestion(pendingStandalonePlaceholderId, 'reject');
878
- setOpenModalType(null);
879
- setPlaceholderBeingConfigured(null);
880
- }, [
881
- pendingStandalonePlaceholderId,
882
- handleActOnSuggestion
883
- ]);
884
- const createInsertSuggestions = useCallback(()=>{
885
- const timestamp = Date.now();
886
- setSuggestionGroup({
887
- id: `group-${timestamp}`,
888
- suggestions: [
889
- {
890
- id: `add-1-${timestamp}`,
891
- type: 'add',
892
- resource: {
893
- id: `tool-${timestamp}`,
894
- type: 'tool',
895
- name: 'Email Service',
896
- description: 'Send emails',
897
- iconUrl: '',
898
- hasBreakpoint: false,
899
- hasGuardrails: false,
900
- projectType: ProjectType.Internal
901
- }
902
- },
903
- {
904
- id: `add-2-${timestamp}`,
905
- type: 'add',
906
- resource: {
907
- id: `ctx-${timestamp}`,
908
- type: 'context',
909
- name: 'User Preferences',
910
- description: 'User prefs',
911
- hasBreakpoint: false
912
- }
913
- }
914
- ],
915
- metadata: {
916
- title: 'Add Suggestions'
917
- }
918
- });
919
- }, []);
920
- const createDeleteSuggestions = useCallback(()=>{
921
- const timestamp = Date.now();
922
- const toDelete = resources.slice(0, 2);
923
- setSuggestionGroup({
924
- id: `group-${timestamp}`,
925
- suggestions: toDelete.map((r, i)=>({
926
- id: `del-${i}-${timestamp}`,
927
- type: 'delete',
928
- resourceIdToDelete: r.id
929
- })),
930
- metadata: {
931
- title: 'Delete Suggestions'
932
- }
933
- });
934
- }, [
935
- resources
936
- ]);
937
- const createUpdateSuggestions = useCallback(()=>{
938
- const timestamp = Date.now();
939
- const toUpdate = resources.slice(0, 2);
940
- setSuggestionGroup({
941
- id: `group-${timestamp}`,
942
- suggestions: toUpdate.map((r, i)=>({
943
- id: `upd-${i}-${timestamp}`,
944
- type: 'update',
945
- resourceId: r.id,
946
- updatedFields: {
947
- name: `${r.name} (Updated)`
948
- }
949
- })),
950
- metadata: {
951
- title: 'Update Suggestions'
952
- }
953
- });
954
- }, [
955
- resources
956
- ]);
957
- const createMixedSuggestions = useCallback(()=>{
958
- const timestamp = Date.now();
959
- const existing = resources.slice(0, 2);
960
- setSuggestionGroup({
961
- id: `group-${timestamp}`,
962
- suggestions: [
963
- {
964
- id: `add-${timestamp}`,
965
- type: 'add',
966
- resource: {
967
- id: `tool-${timestamp}`,
968
- type: 'tool',
969
- name: 'New Tool',
970
- description: 'Added tool',
971
- iconUrl: '',
972
- hasBreakpoint: false,
973
- hasGuardrails: false,
974
- projectType: ProjectType.Internal
975
- }
976
- },
977
- ...existing[0] ? [
978
- {
979
- id: `upd-${timestamp}`,
980
- type: 'update',
981
- resourceId: existing[0].id,
982
- updatedFields: {
983
- name: `${existing[0].name} (Updated)`
984
- }
985
- }
986
- ] : [],
987
- ...existing[1] ? [
988
- {
989
- id: `del-${timestamp}`,
990
- type: 'delete',
991
- resourceIdToDelete: existing[1].id
992
- }
993
- ] : []
994
- ],
995
- metadata: {
996
- title: 'Mixed Suggestions'
997
- }
998
- });
999
- }, [
1000
- resources
1001
- ]);
1002
- const handleAddStickyNote = useCallback((data)=>{
1003
- setStickyNotes((prev)=>[
1004
- ...prev,
1005
- data
1006
- ]);
1007
- }, []);
1008
- const handleUpdateStickyNote = useCallback((id, updates)=>{
1009
- setStickyNotes((prev)=>prev.map((n)=>n.id === id ? {
1010
- ...n,
1011
- ...updates
1012
- } : n));
1013
- }, []);
1014
- const handleRemoveStickyNote = useCallback((id)=>{
1015
- setStickyNotes((prev)=>prev.filter((n)=>n.id !== id));
1016
- }, []);
1017
- const handleOrganize = useCallback(()=>{
1018
- setAgentNodePosition(void 0);
1019
- setResourceNodePositions({});
1020
- }, []);
1021
- const handleToggleResources = useCallback((value)=>{
1022
- setHasResources(value);
1023
- setResources(value ? sampleResources : []);
1024
- setSuggestionGroup(null);
1025
- setAgentNodePosition(void 0);
1026
- setResourceNodePositions({});
1027
- }, []);
1028
- const handleToggleSuggestionMode = useCallback((mode)=>{
1029
- setSuggestionMode(mode);
1030
- setSuggestionGroup(null);
1031
- setPendingStandalonePlaceholderId(null);
1032
- setOpenModalType(null);
1033
- }, []);
1034
- const renderSidebar = ()=>/*#__PURE__*/ jsxs(Column, {
1035
- w: 280,
1036
- p: 16,
1037
- gap: 12,
1038
- style: {
1039
- backgroundColor: 'var(--uix-canvas-background-secondary)',
1040
- borderLeft: '1px solid var(--uix-canvas-border-de-emp)',
1041
- overflowY: 'auto',
1042
- color: 'var(--uix-canvas-foreground)'
1043
- },
1044
- children: [
1045
- /*#__PURE__*/ jsx("h3", {
1046
- style: {
1047
- margin: 0
1048
- },
1049
- children: "Current State"
1050
- }),
1051
- /*#__PURE__*/ jsxs("div", {
1052
- children: [
1053
- /*#__PURE__*/ jsx("strong", {
1054
- children: "Selected:"
1055
- }),
1056
- " ",
1057
- selectedResourceId || 'None'
1058
- ]
1059
- }),
1060
- /*#__PURE__*/ jsxs("div", {
1061
- children: [
1062
- /*#__PURE__*/ jsx("strong", {
1063
- children: "Resources:"
1064
- }),
1065
- " ",
1066
- resources.length
1067
- ]
1068
- }),
1069
- enableStickyNotes && /*#__PURE__*/ jsxs("div", {
1070
- children: [
1071
- /*#__PURE__*/ jsx("strong", {
1072
- children: "Sticky Notes:"
1073
- }),
1074
- " ",
1075
- stickyNotes.length
1076
- ]
1077
- }),
1078
- suggestionGroup && /*#__PURE__*/ jsxs("div", {
1079
- style: {
1080
- padding: '12px',
1081
- backgroundColor: 'var(--uix-canvas-background)',
1082
- borderRadius: '4px',
1083
- border: '1px solid var(--uix-canvas-border-de-emp)'
1084
- },
1085
- children: [
1086
- /*#__PURE__*/ jsx("div", {
1087
- style: {
1088
- fontWeight: 'bold',
1089
- marginBottom: '8px'
1090
- },
1091
- children: "Active Suggestions"
1092
- }),
1093
- /*#__PURE__*/ jsxs("div", {
1094
- style: {
1095
- fontSize: '0.875rem'
1096
- },
1097
- children: [
1098
- /*#__PURE__*/ jsxs("div", {
1099
- children: [
1100
- /*#__PURE__*/ jsx("strong", {
1101
- children: "Count:"
1102
- }),
1103
- " ",
1104
- suggestionGroup.suggestions.length
1105
- ]
1106
- }),
1107
- /*#__PURE__*/ jsxs("div", {
1108
- children: [
1109
- /*#__PURE__*/ jsx("strong", {
1110
- children: "Type:"
1111
- }),
1112
- " ",
1113
- suggestionMode
1114
- ]
1115
- })
1116
- ]
1117
- })
1118
- ]
1119
- }),
1120
- enableDragging && /*#__PURE__*/ jsxs("div", {
1121
- style: {
1122
- padding: '12px',
1123
- backgroundColor: 'var(--uix-canvas-background)',
1124
- borderRadius: '4px',
1125
- border: '1px solid var(--uix-canvas-border-de-emp)'
1126
- },
1127
- children: [
1128
- /*#__PURE__*/ jsx("div", {
1129
- style: {
1130
- fontWeight: 'bold',
1131
- marginBottom: '8px'
1132
- },
1133
- children: "Position Tracking"
1134
- }),
1135
- /*#__PURE__*/ jsxs("div", {
1136
- style: {
1137
- fontSize: '0.875rem',
1138
- fontFamily: 'monospace'
1139
- },
1140
- children: [
1141
- /*#__PURE__*/ jsxs("div", {
1142
- children: [
1143
- /*#__PURE__*/ jsx("strong", {
1144
- children: "Zoom:"
1145
- }),
1146
- " ",
1147
- (100 * zoomLevel).toFixed(0),
1148
- "%"
1149
- ]
1150
- }),
1151
- agentNodePosition && /*#__PURE__*/ jsxs(Fragment, {
1152
- children: [
1153
- /*#__PURE__*/ jsx("div", {
1154
- style: {
1155
- marginTop: '8px',
1156
- fontWeight: 'bold'
1157
- },
1158
- children: "Agent Node:"
1159
- }),
1160
- /*#__PURE__*/ jsxs("div", {
1161
- children: [
1162
- "X: ",
1163
- agentNodePosition.x.toFixed(2)
1164
- ]
1165
- }),
1166
- /*#__PURE__*/ jsxs("div", {
1167
- children: [
1168
- "Y: ",
1169
- agentNodePosition.y.toFixed(2)
1170
- ]
1171
- })
1172
- ]
1173
- }),
1174
- Object.keys(resourceNodePositions).length > 0 && /*#__PURE__*/ jsxs(Fragment, {
1175
- children: [
1176
- /*#__PURE__*/ jsx("div", {
1177
- style: {
1178
- marginTop: '8px',
1179
- fontWeight: 'bold'
1180
- },
1181
- children: "Resource Positions:"
1182
- }),
1183
- Object.entries(resourceNodePositions).map(([id, pos])=>/*#__PURE__*/ jsxs("div", {
1184
- style: {
1185
- marginLeft: '8px',
1186
- fontSize: '0.75rem'
1187
- },
1188
- children: [
1189
- id.split('=>').pop()?.split(':')[0],
1190
- ": (",
1191
- pos.x.toFixed(0),
1192
- ", ",
1193
- pos.y.toFixed(0),
1194
- ")"
1195
- ]
1196
- }, id))
1197
- ]
1198
- })
1199
- ]
1200
- })
1201
- ]
1202
- }),
1203
- /*#__PURE__*/ jsxs("div", {
1204
- style: {
1205
- fontSize: '0.875rem',
1206
- color: 'var(--uix-canvas-foreground-de-emp)',
1207
- marginTop: '8px'
1208
- },
1209
- children: [
1210
- /*#__PURE__*/ jsx("p", {
1211
- style: {
1212
- margin: '0 0 8px 0'
1213
- },
1214
- children: "Click the + buttons on the agent node to add:"
1215
- }),
1216
- /*#__PURE__*/ jsxs("ul", {
1217
- style: {
1218
- margin: 0,
1219
- paddingLeft: '20px'
1220
- },
1221
- children: [
1222
- /*#__PURE__*/ jsx("li", {
1223
- children: "Memory (top)"
1224
- }),
1225
- /*#__PURE__*/ jsx("li", {
1226
- children: "Context (bottom-left)"
1227
- }),
1228
- /*#__PURE__*/ jsx("li", {
1229
- children: "Escalations (bottom-center)"
1230
- }),
1231
- /*#__PURE__*/ jsx("li", {
1232
- children: "Tools & MCPs (bottom-right)"
1233
- })
1234
- ]
1235
- }),
1236
- enableStickyNotes && /*#__PURE__*/ jsx("p", {
1237
- style: {
1238
- marginTop: '12px',
1239
- marginBottom: 0
1240
- },
1241
- children: "Use the sticky note button at the bottom to add notes. Press Delete to remove."
1242
- }),
1243
- enableDragging && /*#__PURE__*/ jsx("p", {
1244
- style: {
1245
- marginTop: '12px',
1246
- marginBottom: 0
1247
- },
1248
- children: "Drag nodes to reposition. Use Organize button to reset positions."
1249
- }),
1250
- 'placeholders' === suggestionMode && /*#__PURE__*/ jsx("p", {
1251
- style: {
1252
- marginTop: '12px',
1253
- marginBottom: 0
1254
- },
1255
- children: "Placeholders appear when clicking +. Click them to configure, or click away to cancel."
1256
- }),
1257
- 'autopilot' === suggestionMode && /*#__PURE__*/ jsx("p", {
1258
- style: {
1259
- marginTop: '12px',
1260
- marginBottom: 0
1261
- },
1262
- children: "Use suggestion buttons in controls to create batches. Accept/Reject individually or all at once."
1263
- })
1264
- ]
1265
- })
1266
- ]
1267
- });
1268
- const renderControlPanel = ()=>/*#__PURE__*/ jsx(StoryInfoPanel, {
1269
- title: "Design Mode Playground",
1270
- collapsible: true,
1271
- defaultCollapsed: false,
1272
- position: "top-right",
1273
- children: /*#__PURE__*/ jsxs(Column, {
1274
- mt: 12,
1275
- gap: 12,
1276
- children: [
1277
- /*#__PURE__*/ jsxs(Column, {
1278
- gap: 4,
1279
- children: [
1280
- /*#__PURE__*/ jsx(ApTypography, {
1281
- variant: FontVariantToken.fontSizeS,
1282
- style: {
1283
- fontWeight: 600
1284
- },
1285
- children: "Resources:"
1286
- }),
1287
- /*#__PURE__*/ jsxs(Row, {
1288
- gap: 4,
1289
- children: [
1290
- /*#__PURE__*/ jsx(ApButton, {
1291
- size: "small",
1292
- variant: hasResources ? 'primary' : 'secondary',
1293
- label: "With",
1294
- onClick: ()=>handleToggleResources(true)
1295
- }),
1296
- /*#__PURE__*/ jsx(ApButton, {
1297
- size: "small",
1298
- variant: hasResources ? 'secondary' : 'primary',
1299
- label: "Empty",
1300
- onClick: ()=>handleToggleResources(false)
1301
- })
1302
- ]
1303
- })
1304
- ]
1305
- }),
1306
- /*#__PURE__*/ jsxs(Column, {
1307
- gap: 4,
1308
- children: [
1309
- /*#__PURE__*/ jsx(ApTypography, {
1310
- variant: FontVariantToken.fontSizeS,
1311
- style: {
1312
- fontWeight: 600
1313
- },
1314
- children: "Suggestions:"
1315
- }),
1316
- /*#__PURE__*/ jsxs(Row, {
1317
- gap: 4,
1318
- style: {
1319
- flexWrap: 'wrap'
1320
- },
1321
- children: [
1322
- /*#__PURE__*/ jsx(ApButton, {
1323
- size: "small",
1324
- variant: 'off' === suggestionMode ? 'primary' : 'secondary',
1325
- label: "Off",
1326
- onClick: ()=>handleToggleSuggestionMode('off')
1327
- }),
1328
- /*#__PURE__*/ jsx(ApButton, {
1329
- size: "small",
1330
- variant: 'placeholders' === suggestionMode ? 'primary' : 'secondary',
1331
- label: "Placeholders",
1332
- onClick: ()=>handleToggleSuggestionMode('placeholders')
1333
- }),
1334
- /*#__PURE__*/ jsx(ApButton, {
1335
- size: "small",
1336
- variant: 'autopilot' === suggestionMode ? 'primary' : 'secondary',
1337
- label: "Autopilot",
1338
- onClick: ()=>handleToggleSuggestionMode('autopilot')
1339
- })
1340
- ]
1341
- })
1342
- ]
1343
- }),
1344
- 'autopilot' === suggestionMode && /*#__PURE__*/ jsxs(Column, {
1345
- gap: 4,
1346
- children: [
1347
- /*#__PURE__*/ jsx(ApTypography, {
1348
- variant: FontVariantToken.fontSizeS,
1349
- style: {
1350
- color: 'var(--uix-canvas-foreground-de-emp)'
1351
- },
1352
- children: "Create suggestions:"
1353
- }),
1354
- /*#__PURE__*/ jsxs(Row, {
1355
- gap: 4,
1356
- style: {
1357
- flexWrap: 'wrap'
1358
- },
1359
- children: [
1360
- /*#__PURE__*/ jsx(ApButton, {
1361
- size: "small",
1362
- variant: "secondary",
1363
- label: "Inserts",
1364
- onClick: createInsertSuggestions
1365
- }),
1366
- /*#__PURE__*/ jsx(ApButton, {
1367
- size: "small",
1368
- variant: "secondary",
1369
- label: "Deletes",
1370
- onClick: createDeleteSuggestions
1371
- }),
1372
- /*#__PURE__*/ jsx(ApButton, {
1373
- size: "small",
1374
- variant: "secondary",
1375
- label: "Updates",
1376
- onClick: createUpdateSuggestions
1377
- }),
1378
- /*#__PURE__*/ jsx(ApButton, {
1379
- size: "small",
1380
- variant: "secondary",
1381
- label: "Mixed",
1382
- onClick: createMixedSuggestions
1383
- })
1384
- ]
1385
- })
1386
- ]
1387
- }),
1388
- /*#__PURE__*/ jsxs(Column, {
1389
- gap: 4,
1390
- children: [
1391
- /*#__PURE__*/ jsx(ApTypography, {
1392
- variant: FontVariantToken.fontSizeS,
1393
- style: {
1394
- fontWeight: 600
1395
- },
1396
- children: "Sticky Notes:"
1397
- }),
1398
- /*#__PURE__*/ jsxs(Row, {
1399
- gap: 4,
1400
- children: [
1401
- /*#__PURE__*/ jsx(ApButton, {
1402
- size: "small",
1403
- variant: enableStickyNotes ? 'primary' : 'secondary',
1404
- label: "On",
1405
- onClick: ()=>setEnableStickyNotes(true)
1406
- }),
1407
- /*#__PURE__*/ jsx(ApButton, {
1408
- size: "small",
1409
- variant: enableStickyNotes ? 'secondary' : 'primary',
1410
- label: "Off",
1411
- onClick: ()=>setEnableStickyNotes(false)
1412
- })
1413
- ]
1414
- }),
1415
- enableStickyNotes && /*#__PURE__*/ jsxs(Row, {
1416
- gap: 4,
1417
- children: [
1418
- /*#__PURE__*/ jsx(ApButton, {
1419
- size: "small",
1420
- variant: "secondary",
1421
- label: "Load Samples",
1422
- onClick: ()=>setStickyNotes(sampleStickyNotes)
1423
- }),
1424
- /*#__PURE__*/ jsx(ApButton, {
1425
- size: "small",
1426
- variant: "secondary",
1427
- label: "Clear",
1428
- onClick: ()=>setStickyNotes([])
1429
- })
1430
- ]
1431
- })
1432
- ]
1433
- }),
1434
- /*#__PURE__*/ jsxs(Column, {
1435
- gap: 4,
1436
- children: [
1437
- /*#__PURE__*/ jsx(ApTypography, {
1438
- variant: FontVariantToken.fontSizeS,
1439
- style: {
1440
- fontWeight: 600
1441
- },
1442
- children: "Dragging:"
1443
- }),
1444
- /*#__PURE__*/ jsxs(Row, {
1445
- gap: 4,
1446
- children: [
1447
- /*#__PURE__*/ jsx(ApButton, {
1448
- size: "small",
1449
- variant: enableDragging ? 'primary' : 'secondary',
1450
- label: "On",
1451
- onClick: ()=>setEnableDragging(true)
1452
- }),
1453
- /*#__PURE__*/ jsx(ApButton, {
1454
- size: "small",
1455
- variant: enableDragging ? 'secondary' : 'primary',
1456
- label: "Off",
1457
- onClick: ()=>setEnableDragging(false)
1458
- })
1459
- ]
1460
- })
1461
- ]
1462
- }),
1463
- /*#__PURE__*/ jsxs(Column, {
1464
- gap: 4,
1465
- children: [
1466
- /*#__PURE__*/ jsx(ApTypography, {
1467
- variant: FontVariantToken.fontSizeS,
1468
- style: {
1469
- fontWeight: 600
1470
- },
1471
- children: "Instructions:"
1472
- }),
1473
- /*#__PURE__*/ jsxs(Row, {
1474
- gap: 4,
1475
- children: [
1476
- /*#__PURE__*/ jsx(ApButton, {
1477
- size: "small",
1478
- variant: hasInstructions ? 'primary' : 'secondary',
1479
- label: "With",
1480
- onClick: ()=>setHasInstructions(true)
1481
- }),
1482
- /*#__PURE__*/ jsx(ApButton, {
1483
- size: "small",
1484
- variant: hasInstructions ? 'secondary' : 'primary',
1485
- label: "Without",
1486
- onClick: ()=>setHasInstructions(false)
1487
- })
1488
- ]
1489
- }),
1490
- hasInstructions && /*#__PURE__*/ jsxs(Column, {
1491
- gap: 8,
1492
- style: {
1493
- marginTop: 8
1494
- },
1495
- children: [
1496
- /*#__PURE__*/ jsxs(Column, {
1497
- gap: 2,
1498
- children: [
1499
- /*#__PURE__*/ jsx(ApTypography, {
1500
- variant: FontVariantToken.fontSizeXs,
1501
- style: {
1502
- color: 'var(--uix-canvas-foreground-de-emp)'
1503
- },
1504
- children: "System prompt:"
1505
- }),
1506
- /*#__PURE__*/ jsx("textarea", {
1507
- value: systemPrompt,
1508
- onChange: (e)=>setSystemPrompt(e.target.value),
1509
- placeholder: "Enter system prompt...",
1510
- style: {
1511
- width: '100%',
1512
- minHeight: 60,
1513
- padding: 8,
1514
- fontSize: 12,
1515
- borderRadius: 4,
1516
- border: '1px solid var(--uix-canvas-border-de-emp)',
1517
- backgroundColor: 'var(--uix-canvas-background)',
1518
- color: 'var(--uix-canvas-foreground)',
1519
- resize: 'vertical',
1520
- fontFamily: 'inherit'
1521
- }
1522
- })
1523
- ]
1524
- }),
1525
- /*#__PURE__*/ jsxs(Column, {
1526
- gap: 2,
1527
- children: [
1528
- /*#__PURE__*/ jsx(ApTypography, {
1529
- variant: FontVariantToken.fontSizeXs,
1530
- style: {
1531
- color: 'var(--uix-canvas-foreground-de-emp)'
1532
- },
1533
- children: "User prompt:"
1534
- }),
1535
- /*#__PURE__*/ jsx("textarea", {
1536
- value: userPrompt,
1537
- onChange: (e)=>setUserPrompt(e.target.value),
1538
- placeholder: "Enter user prompt...",
1539
- style: {
1540
- width: '100%',
1541
- minHeight: 60,
1542
- padding: 8,
1543
- fontSize: 12,
1544
- borderRadius: 4,
1545
- border: '1px solid var(--uix-canvas-border-de-emp)',
1546
- backgroundColor: 'var(--uix-canvas-background)',
1547
- color: 'var(--uix-canvas-foreground)',
1548
- resize: 'vertical',
1549
- fontFamily: 'inherit'
1550
- }
1551
- })
1552
- ]
1553
- })
1554
- ]
1555
- })
1556
- ]
1557
- }),
1558
- /*#__PURE__*/ jsx(Column, {
1559
- gap: 2,
1560
- style: {
1561
- borderTop: '1px solid var(--uix-canvas-border-de-emp)',
1562
- paddingTop: 8
1563
- },
1564
- children: /*#__PURE__*/ jsxs(ApTypography, {
1565
- variant: FontVariantToken.fontSizeS,
1566
- style: {
1567
- color: 'var(--uix-canvas-foreground-de-emp)'
1568
- },
1569
- children: [
1570
- "Resources: ",
1571
- resources.length,
1572
- " | Notes: ",
1573
- stickyNotes.length,
1574
- " | Zoom:",
1575
- ' ',
1576
- (100 * zoomLevel).toFixed(0),
1577
- "%"
1578
- ]
1579
- })
1580
- })
1581
- ]
1582
- })
1583
- });
1584
- return /*#__PURE__*/ jsx(ReactFlowProvider, {
1585
- children: /*#__PURE__*/ jsxs(Row, {
1586
- w: "100%",
1587
- h: "100%",
1588
- style: {
1589
- position: 'relative'
1590
- },
1591
- children: [
1592
- /*#__PURE__*/ jsxs("div", {
1593
- style: {
1594
- flex: 1,
1595
- position: 'relative'
1596
- },
1597
- children: [
1598
- /*#__PURE__*/ jsx(AgentFlow, {
1599
- allowDragging: enableDragging,
1600
- agentNodePosition: enableDragging ? agentNodePosition : void 0,
1601
- onAgentNodePositionChange: setAgentNodePosition,
1602
- resourceNodePositions: enableDragging ? resourceNodePositions : void 0,
1603
- onResourceNodePositionChange: (id, pos)=>setResourceNodePositions((prev)=>({
1604
- ...prev,
1605
- [id]: pos
1606
- })),
1607
- zoomLevel: zoomLevel,
1608
- onZoomLevelChange: setZoomLevel,
1609
- definition: sampleAgentDefinition,
1610
- spans: [],
1611
- name: "Test Agent",
1612
- description: "Test Description",
1613
- mode: "design",
1614
- resources: resources,
1615
- onEnable: handleEnable,
1616
- onDisable: handleDisable,
1617
- onAddBreakpoint: handleAddBreakpoint,
1618
- onRemoveBreakpoint: handleRemoveBreakpoint,
1619
- onAddGuardrail: handleAddGuardrail,
1620
- onAddResource: handleAddResourceDirect,
1621
- onRemoveResource: handleRemoveResource,
1622
- onSelectResource: handleSelectResource,
1623
- enableTimelinePlayer: false,
1624
- enableMemory: true,
1625
- enableInstructions: hasInstructions,
1626
- enableStickyNotes: enableStickyNotes,
1627
- stickyNotes: stickyNotes,
1628
- onAddStickyNote: handleAddStickyNote,
1629
- onUpdateStickyNote: handleUpdateStickyNote,
1630
- onRemoveStickyNote: handleRemoveStickyNote,
1631
- onOrganize: handleOrganize,
1632
- onRequestResourcePlaceholder: 'placeholders' === suggestionMode ? handleRequestPlaceholder : void 0,
1633
- onPlaceholderNodeClick: 'placeholders' === suggestionMode ? handlePlaceholderNodeClick : void 0,
1634
- suggestionGroup: suggestionGroup,
1635
- onActOnSuggestion: handleActOnSuggestion,
1636
- onActOnSuggestionGroup: handleActOnSuggestionGroup,
1637
- instructions: instructions
1638
- }),
1639
- renderControlPanel(),
1640
- openModalType && /*#__PURE__*/ jsxs(Fragment, {
1641
- children: [
1642
- /*#__PURE__*/ jsx("div", {
1643
- style: {
1644
- position: 'absolute',
1645
- top: 0,
1646
- left: 0,
1647
- right: 0,
1648
- bottom: 0,
1649
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
1650
- zIndex: 999
1651
- },
1652
- onClick: handleCancelModal
1653
- }),
1654
- /*#__PURE__*/ jsxs("div", {
1655
- style: {
1656
- position: 'absolute',
1657
- top: '50%',
1658
- left: '50%',
1659
- transform: 'translate(-50%, -50%)',
1660
- backgroundColor: 'var(--uix-canvas-background-raised)',
1661
- border: '1px solid var(--uix-canvas-border)',
1662
- borderRadius: 8,
1663
- padding: 24,
1664
- minWidth: 400,
1665
- boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',
1666
- zIndex: 1000
1667
- },
1668
- children: [
1669
- /*#__PURE__*/ jsxs("h3", {
1670
- style: {
1671
- margin: '0 0 16px 0',
1672
- color: 'var(--uix-canvas-foreground)'
1673
- },
1674
- children: [
1675
- "Configure ",
1676
- openModalType.charAt(0).toUpperCase() + openModalType.slice(1)
1677
- ]
1678
- }),
1679
- /*#__PURE__*/ jsxs("p", {
1680
- style: {
1681
- margin: '0 0 24px 0',
1682
- color: 'var(--uix-canvas-foreground-de-emp)',
1683
- fontSize: '0.875rem'
1684
- },
1685
- children: [
1686
- "This is a simulated configuration modal.",
1687
- placeholderBeingConfigured && /*#__PURE__*/ jsxs(Fragment, {
1688
- children: [
1689
- /*#__PURE__*/ jsx("br", {}),
1690
- /*#__PURE__*/ jsx("br", {}),
1691
- "Placeholder: ",
1692
- /*#__PURE__*/ jsx("strong", {
1693
- children: placeholderBeingConfigured.name
1694
- })
1695
- ]
1696
- })
1697
- ]
1698
- }),
1699
- /*#__PURE__*/ jsxs(Row, {
1700
- gap: 8,
1701
- style: {
1702
- justifyContent: 'flex-end'
1703
- },
1704
- children: [
1705
- /*#__PURE__*/ jsx(ApButton, {
1706
- size: "small",
1707
- variant: "secondary",
1708
- label: "Cancel",
1709
- onClick: handleCancelModal
1710
- }),
1711
- /*#__PURE__*/ jsx(ApButton, {
1712
- size: "small",
1713
- variant: "primary",
1714
- label: "Confirm",
1715
- onClick: handleConfirmModal
1716
- })
1717
- ]
1718
- })
1719
- ]
1720
- })
1721
- ]
1722
- })
1723
- ]
1724
- }),
1725
- renderSidebar()
1726
- ]
1727
- })
1728
- }, stateKey);
1729
- };
1730
- const DesignMode = {
1731
- args: {
1732
- mode: 'design'
1733
- },
1734
- render: ()=>/*#__PURE__*/ jsx(DesignModePlayground, {}),
1735
- parameters: {
1736
- docs: {
1737
- description: {
1738
- story: "Comprehensive design mode playground. Toggle any combination of features:\n\n• **Resources**: With sample resources or empty canvas\n• **Suggestions**: Off, Placeholders (click + buttons), or Autopilot (batch suggestions)\n• **Sticky Notes**: Enable/disable with sample loading\n• **Dragging**: Enable/disable position control\n• **Instructions**: Toggle instruction prompts (system/user) on the agent node\n• **Hover Preview**: Hover over the agent node for 0.5s to see settings preview\n\nTest features in isolation or combine them to verify interactions."
1739
- }
1740
- }
1741
- }
1742
- };
1743
- const ViewModeWrapper = ()=>{
1744
- const [hasTimelinePlayer, setHasTimelinePlayer] = useState(false);
1745
- const [hasInstructions, setHasInstructions] = useState(true);
1746
- const instructions = hasInstructions ? {
1747
- system: 'You are a helpful assistant that helps users with their tasks.',
1748
- user: 'Please help me complete my work efficiently.'
1749
- } : void 0;
1750
- const renderControlPanel = ()=>/*#__PURE__*/ jsx(StoryInfoPanel, {
1751
- title: "View Mode Controls",
1752
- children: /*#__PURE__*/ jsxs(Column, {
1753
- mt: 12,
1754
- gap: 12,
1755
- children: [
1756
- /*#__PURE__*/ jsxs(Column, {
1757
- gap: 4,
1758
- children: [
1759
- /*#__PURE__*/ jsx(ApTypography, {
1760
- variant: FontVariantToken.fontSizeS,
1761
- style: {
1762
- fontWeight: 600
1763
- },
1764
- children: "Timeline player:"
1765
- }),
1766
- /*#__PURE__*/ jsxs(Row, {
1767
- gap: 8,
1768
- children: [
1769
- /*#__PURE__*/ jsx(ApButton, {
1770
- size: "small",
1771
- variant: hasTimelinePlayer ? 'secondary' : 'primary',
1772
- label: "Off",
1773
- onClick: ()=>setHasTimelinePlayer(false)
1774
- }),
1775
- /*#__PURE__*/ jsx(ApButton, {
1776
- size: "small",
1777
- variant: hasTimelinePlayer ? 'primary' : 'secondary',
1778
- label: "With Spans",
1779
- onClick: ()=>setHasTimelinePlayer(true)
1780
- })
1781
- ]
1782
- })
1783
- ]
1784
- }),
1785
- /*#__PURE__*/ jsxs(Column, {
1786
- gap: 4,
1787
- children: [
1788
- /*#__PURE__*/ jsx(ApTypography, {
1789
- variant: FontVariantToken.fontSizeS,
1790
- style: {
1791
- fontWeight: 600
1792
- },
1793
- children: "Instructions:"
1794
- }),
1795
- /*#__PURE__*/ jsxs(Row, {
1796
- gap: 8,
1797
- children: [
1798
- /*#__PURE__*/ jsx(ApButton, {
1799
- size: "small",
1800
- variant: hasInstructions ? 'primary' : 'secondary',
1801
- label: "With",
1802
- onClick: ()=>setHasInstructions(true)
1803
- }),
1804
- /*#__PURE__*/ jsx(ApButton, {
1805
- size: "small",
1806
- variant: hasInstructions ? 'secondary' : 'primary',
1807
- label: "Without",
1808
- onClick: ()=>setHasInstructions(false)
1809
- })
1810
- ]
1811
- })
1812
- ]
1813
- })
1814
- ]
1815
- })
1816
- });
1817
- return /*#__PURE__*/ jsxs(ReactFlowProvider, {
1818
- children: [
1819
- /*#__PURE__*/ jsx(AgentFlowWrapper, {
1820
- mode: "view",
1821
- initialResources: sampleResources,
1822
- activeResourceIds: [],
1823
- spans: hasTimelinePlayer ? sampleSpans : [],
1824
- definition: sampleAgentDefinition,
1825
- enableTimelinePlayer: hasTimelinePlayer,
1826
- enableInstructions: hasInstructions,
1827
- instructions: instructions
1828
- }),
1829
- renderControlPanel()
1830
- ]
1831
- }, `${hasTimelinePlayer}-${hasInstructions}`);
1832
- };
1833
- const ViewMode = {
1834
- args: {
1835
- mode: 'view'
1836
- },
1837
- render: ()=>/*#__PURE__*/ jsx(ViewModeWrapper, {}),
1838
- parameters: {
1839
- docs: {
1840
- description: {
1841
- story: "Interactive view mode demo. Use the control panel to toggle:\n\n• **Timeline player**: Show/hide the timeline with spans\n• **Instructions**: Show/hide instruction prompts preview on the agent node\n• **Hover Preview**: Hover over the agent node for 0.5s to see full settings preview"
1842
- }
1843
- }
1844
- }
1845
- };
1846
- const HealthScoreWrapper = ({ mode, initialResources = sampleResources })=>{
1847
- const [healthScore, setHealthScore] = useState(95);
1848
- const handleHealthScoreClick = useCallback(()=>{
1849
- alert('Health score clicked! This would open a panel with health score details.');
1850
- }, []);
1851
- const renderControlPanel = ()=>/*#__PURE__*/ jsx(StoryInfoPanel, {
1852
- title: "Health Score Controls",
1853
- children: /*#__PURE__*/ jsxs(Column, {
1854
- mt: 12,
1855
- gap: 8,
1856
- children: [
1857
- /*#__PURE__*/ jsx(ApTypography, {
1858
- variant: FontVariantToken.fontSizeM,
1859
- children: "Set health score:"
1860
- }),
1861
- /*#__PURE__*/ jsxs(Row, {
1862
- gap: 8,
1863
- style: {
1864
- flexWrap: 'wrap'
1865
- },
1866
- children: [
1867
- /*#__PURE__*/ jsx(ApButton, {
1868
- size: "small",
1869
- variant: void 0 === healthScore ? 'primary' : 'secondary',
1870
- label: "None",
1871
- onClick: ()=>setHealthScore(void 0)
1872
- }),
1873
- /*#__PURE__*/ jsx(ApButton, {
1874
- size: "small",
1875
- variant: 0 === healthScore ? 'primary' : 'secondary',
1876
- label: "0",
1877
- onClick: ()=>setHealthScore(0)
1878
- }),
1879
- /*#__PURE__*/ jsx(ApButton, {
1880
- size: "small",
1881
- variant: 50 === healthScore ? 'primary' : 'secondary',
1882
- label: "50",
1883
- onClick: ()=>setHealthScore(50)
1884
- }),
1885
- /*#__PURE__*/ jsx(ApButton, {
1886
- size: "small",
1887
- variant: 95 === healthScore ? 'primary' : 'secondary',
1888
- label: "95",
1889
- onClick: ()=>setHealthScore(95)
1890
- }),
1891
- /*#__PURE__*/ jsx(ApButton, {
1892
- size: "small",
1893
- variant: 100 === healthScore ? 'primary' : 'secondary',
1894
- label: "100",
1895
- onClick: ()=>setHealthScore(100)
1896
- })
1897
- ]
1898
- }),
1899
- /*#__PURE__*/ jsxs(ApTypography, {
1900
- variant: FontVariantToken.fontSizeS,
1901
- style: {
1902
- color: 'var(--uix-canvas-foreground-de-emp)'
1903
- },
1904
- children: [
1905
- "Current: ",
1906
- void 0 === healthScore ? 'Not set' : healthScore
1907
- ]
1908
- })
1909
- ]
1910
- })
1911
- });
1912
- return /*#__PURE__*/ jsxs(ReactFlowProvider, {
1913
- children: [
1914
- /*#__PURE__*/ jsx(AgentFlow, {
1915
- allowDragging: true,
1916
- definition: sampleAgentDefinition,
1917
- spans: [],
1918
- name: "Test Agent",
1919
- description: "Test Description",
1920
- mode: mode,
1921
- resources: initialResources,
1922
- enableMemory: true,
1923
- enableInstructions: true,
1924
- healthScore: healthScore,
1925
- onHealthScoreClick: handleHealthScoreClick,
1926
- instructions: {
1927
- system: 'You are a helpful assistant.',
1928
- user: 'Help me with my task.'
1929
- }
1930
- }),
1931
- renderControlPanel()
1932
- ]
1933
- });
1934
- };
1935
- const HealthScore = {
1936
- args: {
1937
- mode: 'design'
1938
- },
1939
- render: (args)=>/*#__PURE__*/ jsx(HealthScoreWrapper, {
1940
- mode: args.mode,
1941
- initialResources: sampleResources
1942
- }),
1943
- parameters: {
1944
- docs: {
1945
- description: {
1946
- story: 'Interactive health score demo. Use the control panel to toggle between different health score values (None, 0, 50, 95, 100). The health score badge appears below the agent name and is clickable.'
1947
- }
1948
- }
1949
- }
1950
- };
1951
- const conversationalAgentDefinition = {
1952
- ...sampleAgentDefinition,
1953
- name: 'Conversational Agent',
1954
- metadata: {
1955
- isConversational: true
1956
- }
1957
- };
1958
- const ConversationalAgentWrapper = ()=>/*#__PURE__*/ jsxs(ReactFlowProvider, {
1959
- children: [
1960
- /*#__PURE__*/ jsx(AgentFlow, {
1961
- allowDragging: true,
1962
- definition: conversationalAgentDefinition,
1963
- spans: [],
1964
- name: "Conversational Agent",
1965
- description: "A conversational agent that does not have a user prompt",
1966
- mode: "design",
1967
- resources: sampleResources,
1968
- enableMemory: true,
1969
- enableInstructions: true,
1970
- instructions: {
1971
- system: 'You are a helpful conversational assistant. Engage with users naturally.'
1972
- }
1973
- }),
1974
- /*#__PURE__*/ jsx(StoryInfoPanel, {
1975
- title: "Conversational Agent",
1976
- position: "top-right",
1977
- children: /*#__PURE__*/ jsxs(Column, {
1978
- mt: 12,
1979
- gap: 8,
1980
- children: [
1981
- /*#__PURE__*/ jsxs(ApTypography, {
1982
- variant: FontVariantToken.fontSizeS,
1983
- children: [
1984
- "This agent has ",
1985
- /*#__PURE__*/ jsx("strong", {
1986
- children: "isConversational: true"
1987
- }),
1988
- " in its metadata."
1989
- ]
1990
- }),
1991
- /*#__PURE__*/ jsxs(ApTypography, {
1992
- variant: FontVariantToken.fontSizeS,
1993
- style: {
1994
- color: 'var(--uix-canvas-foreground-de-emp)'
1995
- },
1996
- children: [
1997
- "Hover over the agent node to see the settings preview. Notice that the",
1998
- ' ',
1999
- /*#__PURE__*/ jsx("strong", {
2000
- children: "User Prompt"
2001
- }),
2002
- " section is hidden for conversational agents."
2003
- ]
2004
- })
2005
- ]
2006
- })
2007
- })
2008
- ]
2009
- });
2010
- const ConversationalAgent = {
2011
- args: {
2012
- mode: 'design'
2013
- },
2014
- render: ()=>/*#__PURE__*/ jsx(ConversationalAgentWrapper, {}),
2015
- parameters: {
2016
- docs: {
2017
- description: {
2018
- story: 'Conversational agent demo. When `definition.metadata.isConversational` is true, the User Prompt section is hidden in the settings preview panel. Hover over the agent node to see this behavior.'
2019
- }
2020
- }
2021
- }
2022
- };
2023
- const resourcesWithErrorCta = [
2024
- {
2025
- id: 'tool-broken',
2026
- type: 'tool',
2027
- name: 'Broken Tool',
2028
- description: 'This tool has an error',
2029
- iconUrl: '',
2030
- hasBreakpoint: false,
2031
- hasGuardrails: false,
2032
- projectType: ProjectType.Internal,
2033
- errorAction: {
2034
- icon: 'refresh',
2035
- label: 'Retry Connection'
2036
- }
2037
- },
2038
- {
2039
- id: 'tool-config-error',
2040
- type: 'tool',
2041
- name: 'Misconfigured Tool',
2042
- description: 'Configuration error detected',
2043
- iconUrl: '',
2044
- hasBreakpoint: false,
2045
- hasGuardrails: false,
2046
- projectType: ProjectType.Api,
2047
- errorAction: {
2048
- icon: 'settings',
2049
- label: 'Fix Configuration'
2050
- }
2051
- },
2052
- {
2053
- id: 'context-error',
2054
- type: 'context',
2055
- name: 'Invalid Context',
2056
- description: 'Context validation failed',
2057
- hasBreakpoint: false,
2058
- errorAction: {
2059
- icon: 'warning',
2060
- label: 'Review Issues'
2061
- }
2062
- },
2063
- {
2064
- id: 'tool-working',
2065
- type: 'tool',
2066
- name: 'Working Tool',
2067
- description: 'This tool is functioning normally (no error CTA)',
2068
- iconUrl: '',
2069
- hasBreakpoint: false,
2070
- hasGuardrails: false,
2071
- projectType: ProjectType.Internal
2072
- }
2073
- ];
2074
- const ResourceWithErrorCTAWrapper = ()=>{
2075
- const handleErrorAction = useCallback((_resourceId, resource)=>{
2076
- console.log(resource);
2077
- const resourceName = resource.name;
2078
- switch(resourceName){
2079
- case 'Broken Tool':
2080
- alert(`Retry action triggered for: ${resourceName}`);
2081
- break;
2082
- case 'Misconfigured Tool':
2083
- alert(`Fix configuration action triggered for: ${resourceName}`);
2084
- break;
2085
- case 'Invalid Context':
2086
- alert(`Review issues action triggered for: ${resourceName}`);
2087
- break;
2088
- default:
2089
- alert(`Error action triggered for: ${resourceName}`);
2090
- }
2091
- }, []);
2092
- return /*#__PURE__*/ jsxs(ReactFlowProvider, {
2093
- children: [
2094
- /*#__PURE__*/ jsx(AgentFlow, {
2095
- allowDragging: true,
2096
- definition: sampleAgentDefinition,
2097
- spans: [],
2098
- name: "Test Agent",
2099
- description: "Testing error CTA on resources",
2100
- mode: "design",
2101
- resources: resourcesWithErrorCta,
2102
- enableMemory: true,
2103
- enableInstructions: true,
2104
- onErrorAction: handleErrorAction,
2105
- instructions: {
2106
- system: 'System instructions here',
2107
- user: 'User instructions here'
2108
- }
2109
- }),
2110
- /*#__PURE__*/ jsx(StoryInfoPanel, {
2111
- title: "Error CTA Demo",
2112
- position: "top-right",
2113
- children: /*#__PURE__*/ jsxs(Column, {
2114
- mt: 12,
2115
- gap: 8,
2116
- children: [
2117
- /*#__PURE__*/ jsxs(ApTypography, {
2118
- variant: FontVariantToken.fontSizeS,
2119
- children: [
2120
- "Resources with ",
2121
- /*#__PURE__*/ jsx("strong", {
2122
- children: "errorAction"
2123
- }),
2124
- " defined will show an error action button in their toolbar."
2125
- ]
2126
- }),
2127
- /*#__PURE__*/ jsx(ApTypography, {
2128
- variant: FontVariantToken.fontSizeS,
2129
- style: {
2130
- color: 'var(--uix-canvas-foreground-de-emp)'
2131
- },
2132
- children: "Click the error action buttons (Retry, Fix Configuration, Review Issues) to trigger the custom actions."
2133
- }),
2134
- /*#__PURE__*/ jsx(ApTypography, {
2135
- variant: FontVariantToken.fontSizeS,
2136
- style: {
2137
- color: 'var(--uix-canvas-foreground-de-emp)'
2138
- },
2139
- children: 'The "Working Tool" has no error action and shows the normal toolbar.'
2140
- })
2141
- ]
2142
- })
2143
- })
2144
- ]
2145
- });
2146
- };
2147
- const ResourceWithErrorCTA = {
2148
- args: {
2149
- mode: 'design'
2150
- },
2151
- render: ()=>/*#__PURE__*/ jsx(ResourceWithErrorCTAWrapper, {}),
2152
- parameters: {
2153
- docs: {
2154
- description: {
2155
- story: 'Demonstrates error call-to-action buttons on resource nodes. Resources can define an `errorAction` field with icon and label, and handle the action via the `onErrorAction` callback. The button appears next to the remove button in the toolbar. The consumer provides routing logic to handle different error actions for each resource. Hover or click on the resource nodes to see the error CTA buttons.'
2156
- }
2157
- }
2158
- }
2159
- };
2160
- export { ConversationalAgent, DesignMode, HealthScore, ResourceWithErrorCTA, ViewMode, AgentFlow_stories as default };