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