@flowdrop/flowdrop 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/CHANGELOG.md +233 -0
  2. package/dist/adapters/agentspec/autoLayout.d.ts +18 -36
  3. package/dist/adapters/agentspec/autoLayout.js +75 -93
  4. package/dist/chat/activity.d.ts +49 -0
  5. package/dist/chat/activity.js +65 -0
  6. package/dist/chat/commandClassifier.js +2 -1
  7. package/dist/commands/executor.js +186 -27
  8. package/dist/commands/index.d.ts +2 -1
  9. package/dist/commands/index.js +2 -0
  10. package/dist/commands/parser.js +43 -3
  11. package/dist/commands/session.d.ts +60 -0
  12. package/dist/commands/session.js +332 -0
  13. package/dist/commands/storeIntegration.svelte.js +18 -1
  14. package/dist/commands/types.d.ts +77 -4
  15. package/dist/components/App.svelte +976 -226
  16. package/dist/components/App.svelte.d.ts +34 -2
  17. package/dist/components/BindablePortListbox.svelte +68 -369
  18. package/dist/components/Button.svelte +17 -14
  19. package/dist/components/Button.svelte.d.ts +2 -2
  20. package/dist/components/CanvasContextMenu.svelte +31 -10
  21. package/dist/components/CanvasController.svelte +146 -3
  22. package/dist/components/CanvasController.svelte.d.ts +25 -33
  23. package/dist/components/CanvasIconButton.svelte +6 -6
  24. package/dist/components/CanvasToolbar.svelte +103 -0
  25. package/dist/components/CanvasToolbar.svelte.d.ts +23 -0
  26. package/dist/components/CanvasZoomControls.svelte +122 -0
  27. package/dist/components/CanvasZoomControls.svelte.d.ts +15 -0
  28. package/dist/components/ConfigForm.svelte +159 -121
  29. package/dist/components/ConfigModal.svelte +11 -54
  30. package/dist/components/ConfigPanel.svelte +98 -228
  31. package/dist/components/ConfigPanel.svelte.d.ts +2 -2
  32. package/dist/components/ConnectPortPicker.svelte +153 -0
  33. package/dist/components/ConnectPortPicker.svelte.d.ts +22 -0
  34. package/dist/components/DoctorMenu.svelte +422 -0
  35. package/dist/components/DoctorMenu.svelte.d.ts +7 -0
  36. package/dist/components/ExternalLinkRow.svelte +82 -0
  37. package/dist/components/ExternalLinkRow.svelte.d.ts +14 -0
  38. package/dist/components/FlowDropEdge.svelte +52 -2
  39. package/dist/components/FlowDropEdge.svelte.d.ts +5 -1
  40. package/dist/components/InterfaceNameInput.svelte +103 -0
  41. package/dist/components/InterfaceNameInput.svelte.d.ts +13 -0
  42. package/dist/components/InterfaceTag.svelte +215 -0
  43. package/dist/components/InterfaceTag.svelte.d.ts +20 -0
  44. package/dist/components/InterfaceTagAnchor.svelte +103 -0
  45. package/dist/components/InterfaceTagAnchor.svelte.d.ts +12 -0
  46. package/dist/components/InterfaceTagLayer.svelte +314 -0
  47. package/dist/components/InterfaceTagLayer.svelte.d.ts +28 -0
  48. package/dist/components/LogsSidebar.svelte +43 -43
  49. package/dist/components/LoopbackLanes.svelte +54 -0
  50. package/dist/components/LoopbackLanes.svelte.d.ts +8 -0
  51. package/dist/components/Navbar.svelte +539 -169
  52. package/dist/components/Navbar.svelte.d.ts +20 -1
  53. package/dist/components/NodeInspector.svelte +153 -0
  54. package/dist/components/NodeInspector.svelte.d.ts +19 -0
  55. package/dist/components/NodeLastRun.svelte +212 -0
  56. package/dist/components/NodeLastRun.svelte.d.ts +13 -0
  57. package/dist/components/NodeSidebar.svelte +279 -23
  58. package/dist/components/NodeSidebar.svelte.d.ts +11 -0
  59. package/dist/components/NodeStatusOverlay.svelte +144 -353
  60. package/dist/components/NodeStatusOverlay.svelte.d.ts +4 -1
  61. package/dist/components/PortMappingRow.svelte +28 -44
  62. package/dist/components/PortPickerListbox.svelte +475 -0
  63. package/dist/components/PortPickerListbox.svelte.d.ts +73 -0
  64. package/dist/components/ReadOnlyDetails.svelte +52 -89
  65. package/dist/components/RunBar.svelte +222 -0
  66. package/dist/components/RunBar.svelte.d.ts +20 -0
  67. package/dist/components/RunsMenu.svelte +649 -0
  68. package/dist/components/RunsMenu.svelte.d.ts +14 -0
  69. package/dist/components/SettingsModal.svelte +27 -59
  70. package/dist/components/SettingsPanel.svelte +515 -241
  71. package/dist/components/StraightGuides.svelte +46 -0
  72. package/dist/components/StraightGuides.svelte.d.ts +7 -0
  73. package/dist/components/ThemeToggle.svelte +14 -4
  74. package/dist/components/UniversalNode.svelte +152 -51
  75. package/dist/components/WebMCPBridgeMenu.svelte +336 -0
  76. package/dist/components/WebMCPBridgeMenu.svelte.d.ts +3 -0
  77. package/dist/components/WorkflowEditor.svelte +789 -136
  78. package/dist/components/WorkflowEditor.svelte.d.ts +43 -1
  79. package/dist/components/WorkflowInterfaceEditor.svelte +63 -92
  80. package/dist/components/WorkflowInterfaceEntryCard.svelte +478 -549
  81. package/dist/components/WorkflowInterfaceEntryComposer.svelte +23 -67
  82. package/dist/components/WorkflowPlaygroundSettings.svelte +48 -85
  83. package/dist/components/WorkflowSettingsPanel.svelte +311 -0
  84. package/dist/components/WorkflowSettingsPanel.svelte.d.ts +20 -0
  85. package/dist/components/ZoomTier.svelte +56 -0
  86. package/dist/components/ZoomTier.svelte.d.ts +4 -0
  87. package/dist/components/chat/AIChatPanel.svelte +463 -312
  88. package/dist/components/chat/ActivityList.svelte +130 -0
  89. package/dist/components/chat/ActivityList.svelte.d.ts +11 -0
  90. package/dist/components/chat/ActivityRow.svelte +179 -0
  91. package/dist/components/chat/ActivityRow.svelte.d.ts +16 -0
  92. package/dist/components/chat/CommandPreview.svelte +42 -64
  93. package/dist/components/console/CommandConsole.svelte +106 -41
  94. package/dist/components/console/CommandConsole.svelte.d.ts +2 -0
  95. package/dist/components/console/ConsoleAutocomplete.svelte +14 -13
  96. package/dist/components/console/ConsoleInput.svelte +60 -27
  97. package/dist/components/console/ConsoleOutput.svelte +86 -24
  98. package/dist/components/console/ConsoleStrip.svelte +80 -0
  99. package/dist/components/console/ConsoleStrip.svelte.d.ts +13 -0
  100. package/dist/components/form/FieldFactory.svelte +30 -4
  101. package/dist/components/form/FormArray.svelte +306 -339
  102. package/dist/components/form/FormArray.svelte.d.ts +10 -0
  103. package/dist/components/form/FormArrayRows.svelte +443 -0
  104. package/dist/components/form/FormArrayRows.svelte.d.ts +18 -0
  105. package/dist/components/form/FormAutocomplete.svelte +2 -2
  106. package/dist/components/form/FormCheckboxGroup.svelte +10 -85
  107. package/dist/components/form/FormCodeEditor.svelte +3 -3
  108. package/dist/components/form/FormFieldWrapper.svelte +98 -18
  109. package/dist/components/form/FormFieldWrapper.svelte.d.ts +10 -0
  110. package/dist/components/form/FormFieldset.svelte +44 -28
  111. package/dist/components/form/FormMarkdownEditor.svelte +6 -6
  112. package/dist/components/form/FormPorts.svelte +437 -141
  113. package/dist/components/form/FormSelect.svelte +1 -1
  114. package/dist/components/form/FormTemplateEditor.svelte +22 -26
  115. package/dist/components/form/FormToggle.svelte +15 -106
  116. package/dist/components/form/FormToggle.svelte.d.ts +3 -2
  117. package/dist/components/form/FormUISchemaRenderer.svelte +38 -3
  118. package/dist/components/form/humanizeKey.d.ts +7 -0
  119. package/dist/components/form/humanizeKey.js +21 -0
  120. package/dist/components/form/types.d.ts +6 -0
  121. package/dist/components/icons/MenuOpenIcon.svelte +8 -1
  122. package/dist/components/interrupt/ChoicePrompt.svelte +51 -152
  123. package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +0 -2
  124. package/dist/components/interrupt/ConfirmationPrompt.svelte +18 -201
  125. package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +0 -4
  126. package/dist/components/interrupt/FormPrompt.svelte +22 -147
  127. package/dist/components/interrupt/FormPrompt.svelte.d.ts +0 -4
  128. package/dist/components/interrupt/InterruptBubble.svelte +198 -355
  129. package/dist/components/interrupt/InterruptBubble.svelte.d.ts +0 -2
  130. package/dist/components/interrupt/ReviewPrompt.svelte +0 -10
  131. package/dist/components/interrupt/TextInputPrompt.svelte +23 -120
  132. package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +0 -2
  133. package/dist/components/layouts/MainLayout.svelte +110 -75
  134. package/dist/components/layouts/MainLayout.svelte.d.ts +17 -0
  135. package/dist/components/nodes/CaptionNode.svelte +7 -0
  136. package/dist/components/nodes/GatewayNode.svelte +66 -431
  137. package/dist/components/nodes/IdeaNode.svelte +6 -5
  138. package/dist/components/nodes/NodeCard.svelte +1051 -0
  139. package/dist/components/nodes/NodeCard.svelte.d.ts +30 -0
  140. package/dist/components/nodes/NodeConfigButton.svelte +28 -9
  141. package/dist/components/nodes/NodeProblemMark.svelte +113 -0
  142. package/dist/components/nodes/NodeProblemMark.svelte.d.ts +8 -0
  143. package/dist/components/nodes/NodeTip.svelte +104 -0
  144. package/dist/components/nodes/NodeTip.svelte.d.ts +15 -0
  145. package/dist/components/nodes/NotesNode.svelte +183 -150
  146. package/dist/components/nodes/SimpleNode.svelte +176 -44
  147. package/dist/components/nodes/SquareNode.svelte +127 -34
  148. package/dist/components/nodes/TerminalNode.svelte +232 -88
  149. package/dist/components/nodes/ToolNode.svelte +49 -381
  150. package/dist/components/nodes/WorkflowNode.svelte +40 -399
  151. package/dist/components/playground/ChatBubble.svelte +248 -62
  152. package/dist/components/playground/ChatInput.svelte +134 -297
  153. package/dist/components/playground/ChatInput.svelte.d.ts +17 -0
  154. package/dist/components/playground/ControlPanel.svelte +290 -190
  155. package/dist/components/playground/ControlPanel.svelte.d.ts +10 -2
  156. package/dist/components/playground/DockedPlayground.svelte +82 -0
  157. package/dist/components/playground/DockedPlayground.svelte.d.ts +30 -0
  158. package/dist/components/playground/ExecutionConsole.svelte +54 -36
  159. package/dist/components/playground/ExecutionConsole.svelte.d.ts +12 -0
  160. package/dist/components/playground/ExecutionLogs.svelte +4 -0
  161. package/dist/components/playground/HeaderMenu.svelte +170 -0
  162. package/dist/components/playground/HeaderMenu.svelte.d.ts +22 -0
  163. package/dist/components/playground/InputCollector.svelte +8 -32
  164. package/dist/components/playground/InputFields.svelte +246 -0
  165. package/dist/components/playground/InputFields.svelte.d.ts +16 -0
  166. package/dist/components/playground/InterfaceInputForm.svelte +285 -30
  167. package/dist/components/playground/InterfaceInputForm.svelte.d.ts +20 -0
  168. package/dist/components/playground/InterfaceJsonInput.svelte +92 -0
  169. package/dist/components/playground/InterfaceJsonInput.svelte.d.ts +10 -0
  170. package/dist/components/playground/LogRow.svelte +12 -12
  171. package/dist/components/playground/MessageMarkdown.svelte +11 -11
  172. package/dist/components/playground/MessageStream.svelte +154 -182
  173. package/dist/components/playground/Playground.svelte +17 -1139
  174. package/dist/components/playground/PlaygroundApp.svelte +12 -2
  175. package/dist/components/playground/PlaygroundApp.svelte.d.ts +2 -1
  176. package/dist/components/playground/PlaygroundHeader.svelte +309 -0
  177. package/dist/components/playground/PlaygroundHeader.svelte.d.ts +22 -0
  178. package/dist/components/playground/PlaygroundModal.svelte +6 -0
  179. package/dist/components/playground/PlaygroundStudio.svelte +30 -32
  180. package/dist/components/playground/PlaygroundSurface.svelte +648 -0
  181. package/dist/components/playground/PlaygroundSurface.svelte.d.ts +79 -0
  182. package/dist/components/playground/StepsSummary.svelte +312 -0
  183. package/dist/components/playground/StepsSummary.svelte.d.ts +11 -0
  184. package/dist/components/playground/messageDisplay.d.ts +9 -0
  185. package/dist/components/playground/messageDisplay.js +24 -2
  186. package/dist/components/playground/stepSummary.d.ts +71 -0
  187. package/dist/components/playground/stepSummary.js +152 -0
  188. package/dist/components/ports/PortTypeBadge.svelte +13 -1
  189. package/dist/components/primitives/Button.svelte +226 -0
  190. package/dist/components/primitives/Button.svelte.d.ts +31 -0
  191. package/dist/components/primitives/Card.svelte +110 -0
  192. package/dist/components/primitives/Card.svelte.d.ts +20 -0
  193. package/dist/components/primitives/Checkbox.svelte +126 -0
  194. package/dist/components/primitives/Checkbox.svelte.d.ts +15 -0
  195. package/dist/components/primitives/Chip.svelte +143 -0
  196. package/dist/components/primitives/Chip.svelte.d.ts +22 -0
  197. package/dist/components/primitives/Combobox.svelte +444 -0
  198. package/dist/components/primitives/Combobox.svelte.d.ts +22 -0
  199. package/dist/components/primitives/Composer.svelte +293 -0
  200. package/dist/components/primitives/Composer.svelte.d.ts +47 -0
  201. package/dist/components/primitives/EmptyState.svelte +113 -0
  202. package/dist/components/primitives/EmptyState.svelte.d.ts +18 -0
  203. package/dist/components/primitives/Field.svelte +178 -0
  204. package/dist/components/primitives/Field.svelte.d.ts +30 -0
  205. package/dist/components/primitives/IconButton.svelte +156 -0
  206. package/dist/components/primitives/IconButton.svelte.d.ts +27 -0
  207. package/dist/components/primitives/Menu.svelte +435 -0
  208. package/dist/components/primitives/Menu.svelte.d.ts +61 -0
  209. package/dist/components/primitives/Notice.svelte +161 -0
  210. package/dist/components/primitives/Notice.svelte.d.ts +22 -0
  211. package/dist/components/primitives/PanelHeader.svelte +134 -0
  212. package/dist/components/primitives/PanelHeader.svelte.d.ts +23 -0
  213. package/dist/components/primitives/Segmented.svelte +198 -0
  214. package/dist/components/primitives/Segmented.svelte.d.ts +32 -0
  215. package/dist/components/primitives/Select.svelte +130 -0
  216. package/dist/components/primitives/Select.svelte.d.ts +26 -0
  217. package/dist/components/primitives/StatusPill.svelte +218 -0
  218. package/dist/components/primitives/StatusPill.svelte.d.ts +24 -0
  219. package/dist/components/primitives/Switch.svelte +113 -0
  220. package/dist/components/primitives/Switch.svelte.d.ts +14 -0
  221. package/dist/components/primitives/Tabs.svelte +209 -0
  222. package/dist/components/primitives/Tabs.svelte.d.ts +32 -0
  223. package/dist/components/primitives/Toolbar.svelte +94 -0
  224. package/dist/components/primitives/Toolbar.svelte.d.ts +14 -0
  225. package/dist/components/primitives/ToolbarSeparator.svelte +40 -0
  226. package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +7 -0
  227. package/dist/components/surfaces/SurfaceOverlay.svelte +10 -40
  228. package/dist/components/surfaces/TabbedSurface.svelte +49 -39
  229. package/dist/components/surfaces/TabbedSurface.svelte.d.ts +8 -0
  230. package/dist/components/toast/DismissibleToast.svelte +94 -32
  231. package/dist/components/toast/DismissibleToast.svelte.d.ts +17 -7
  232. package/dist/config/endpoints.d.ts +43 -1
  233. package/dist/config/endpoints.js +21 -3
  234. package/dist/core/index.d.ts +8 -5
  235. package/dist/core/index.js +1 -1
  236. package/dist/editor/connectCandidates.d.ts +56 -0
  237. package/dist/editor/connectCandidates.js +131 -0
  238. package/dist/editor/contextMenu.d.ts +31 -2
  239. package/dist/editor/contextMenu.js +96 -9
  240. package/dist/editor/index.d.ts +4 -1
  241. package/dist/editor/index.js +1 -0
  242. package/dist/editor/interfaceMenu.d.ts +35 -0
  243. package/dist/editor/interfaceMenu.js +47 -0
  244. package/dist/editor/portMenu.d.ts +23 -0
  245. package/dist/editor/portMenu.js +34 -0
  246. package/dist/editor/tidy.d.ts +30 -0
  247. package/dist/editor/tidy.js +66 -0
  248. package/dist/helpers/workflowEditorHelper.d.ts +3 -0
  249. package/dist/helpers/workflowEditorHelper.js +8 -3
  250. package/dist/layout/fromWorkflow.d.ts +42 -0
  251. package/dist/layout/fromWorkflow.js +135 -0
  252. package/dist/layout/geometry.d.ts +102 -0
  253. package/dist/layout/geometry.js +317 -0
  254. package/dist/layout/index.d.ts +21 -0
  255. package/dist/layout/index.js +14 -0
  256. package/dist/layout/inspect.d.ts +18 -0
  257. package/dist/layout/inspect.js +81 -0
  258. package/dist/layout/lanePath.d.ts +23 -0
  259. package/dist/layout/lanePath.js +47 -0
  260. package/dist/layout/measure.d.ts +141 -0
  261. package/dist/layout/measure.js +477 -0
  262. package/dist/layout/primitives.d.ts +124 -0
  263. package/dist/layout/primitives.js +461 -0
  264. package/dist/layout/sweep.d.ts +59 -0
  265. package/dist/layout/sweep.js +257 -0
  266. package/dist/layout/toWorkflow.d.ts +43 -0
  267. package/dist/layout/toWorkflow.js +131 -0
  268. package/dist/layout/types.d.ts +93 -0
  269. package/dist/layout/types.js +35 -0
  270. package/dist/messages/defaults.d.ts +641 -26
  271. package/dist/messages/defaults.js +578 -25
  272. package/dist/messages/types.d.ts +21 -1
  273. package/dist/openapi/v1/openapi.yaml +109 -0
  274. package/dist/playground/index.d.ts +28 -1
  275. package/dist/playground/index.js +29 -0
  276. package/dist/playground/mount.d.ts +28 -2
  277. package/dist/playground/mount.js +41 -15
  278. package/dist/playground/runAction.d.ts +29 -0
  279. package/dist/playground/runAction.js +38 -0
  280. package/dist/services/doctorService.d.ts +52 -0
  281. package/dist/services/doctorService.js +113 -0
  282. package/dist/services/globalSave.js +12 -29
  283. package/dist/services/nodeExecutionService.d.ts +12 -1
  284. package/dist/services/nodeExecutionService.js +58 -58
  285. package/dist/services/playgroundService.d.ts +17 -2
  286. package/dist/services/playgroundService.js +48 -5
  287. package/dist/services/runsService.d.ts +42 -0
  288. package/dist/services/runsService.js +87 -0
  289. package/dist/services/toastQueue.d.ts +33 -0
  290. package/dist/services/toastQueue.js +38 -0
  291. package/dist/services/toastService.d.ts +30 -9
  292. package/dist/services/toastService.js +81 -46
  293. package/dist/settings/index.d.ts +1 -0
  294. package/dist/skins/graphite.d.ts +26 -0
  295. package/dist/skins/graphite.js +473 -0
  296. package/dist/skins/index.d.ts +2 -1
  297. package/dist/skins/index.js +4 -2
  298. package/dist/skins/slate.js +4 -4
  299. package/dist/stores/attachedRunStore.svelte.d.ts +35 -0
  300. package/dist/stores/attachedRunStore.svelte.js +47 -0
  301. package/dist/stores/connectDragStore.svelte.d.ts +39 -0
  302. package/dist/stores/connectDragStore.svelte.js +42 -0
  303. package/dist/stores/doctorStore.svelte.d.ts +79 -0
  304. package/dist/stores/doctorStore.svelte.js +244 -0
  305. package/dist/stores/editedNodesStore.svelte.d.ts +42 -0
  306. package/dist/stores/editedNodesStore.svelte.js +84 -0
  307. package/dist/stores/editorModeStore.svelte.d.ts +34 -0
  308. package/dist/stores/editorModeStore.svelte.js +55 -0
  309. package/dist/stores/instanceContainer.svelte.d.ts +53 -0
  310. package/dist/stores/instanceContainer.svelte.js +38 -1
  311. package/dist/stores/loopbackLanesStore.svelte.d.ts +18 -0
  312. package/dist/stores/loopbackLanesStore.svelte.js +25 -0
  313. package/dist/stores/nodeHighlightStore.svelte.d.ts +34 -0
  314. package/dist/stores/nodeHighlightStore.svelte.js +56 -0
  315. package/dist/stores/playgroundStore.svelte.d.ts +66 -2
  316. package/dist/stores/playgroundStore.svelte.js +164 -2
  317. package/dist/stores/runController.svelte.d.ts +382 -0
  318. package/dist/stores/runController.svelte.js +1217 -0
  319. package/dist/stores/settingsStore.svelte.d.ts +80 -18
  320. package/dist/stores/settingsStore.svelte.js +180 -62
  321. package/dist/stores/workflowStore.svelte.d.ts +14 -0
  322. package/dist/stores/workflowStore.svelte.js +22 -1
  323. package/dist/styles/base.css +286 -25
  324. package/dist/styles/fonts/Inter-LICENSE.txt +93 -0
  325. package/dist/styles/fonts/inter-latin-wght-normal.woff2 +0 -0
  326. package/dist/styles/fonts/inter.css +19 -0
  327. package/dist/styles/toast.css +100 -20
  328. package/dist/styles/tokenAliases.js +118 -1
  329. package/dist/styles/tokens.css +586 -14
  330. package/dist/svelte-app.d.ts +47 -5
  331. package/dist/svelte-app.js +15 -3
  332. package/dist/themes/graphite.d.ts +2 -0
  333. package/dist/themes/graphite.js +15 -0
  334. package/dist/themes/index.d.ts +2 -1
  335. package/dist/themes/index.js +22 -3
  336. package/dist/themes/minimal.js +10 -0
  337. package/dist/themes/scopedSkinCss.d.ts +22 -5
  338. package/dist/themes/scopedSkinCss.js +136 -11
  339. package/dist/types/chat.d.ts +6 -0
  340. package/dist/types/doctor.d.ts +82 -0
  341. package/dist/types/doctor.js +11 -0
  342. package/dist/types/events.d.ts +35 -0
  343. package/dist/types/events.js +4 -1
  344. package/dist/types/index.d.ts +17 -2
  345. package/dist/types/navbar.d.ts +36 -0
  346. package/dist/types/playground.d.ts +75 -0
  347. package/dist/types/settings.d.ts +120 -7
  348. package/dist/types/settings.js +35 -3
  349. package/dist/types/skin.d.ts +21 -8
  350. package/dist/types/theme.d.ts +40 -2
  351. package/dist/utils/appearance.d.ts +19 -0
  352. package/dist/utils/appearance.js +13 -0
  353. package/dist/utils/canvasFit.d.ts +41 -0
  354. package/dist/utils/canvasFit.js +44 -0
  355. package/dist/utils/chipTitles.d.ts +9 -0
  356. package/dist/utils/chipTitles.js +19 -0
  357. package/dist/utils/connections.js +8 -0
  358. package/dist/utils/consoleHighlight.d.ts +28 -0
  359. package/dist/utils/consoleHighlight.js +269 -0
  360. package/dist/utils/deprecation.d.ts +17 -0
  361. package/dist/utils/deprecation.js +29 -0
  362. package/dist/utils/doctorOperations.d.ts +40 -0
  363. package/dist/utils/doctorOperations.js +237 -0
  364. package/dist/utils/duration.d.ts +13 -0
  365. package/dist/utils/duration.js +40 -0
  366. package/dist/utils/inspectorContext.d.ts +19 -0
  367. package/dist/utils/inspectorContext.js +12 -0
  368. package/dist/utils/inspectorSections.d.ts +20 -0
  369. package/dist/utils/inspectorSections.js +44 -0
  370. package/dist/utils/inspectorSurface.d.ts +46 -0
  371. package/dist/utils/inspectorSurface.js +51 -0
  372. package/dist/utils/interfaceTags.d.ts +102 -0
  373. package/dist/utils/interfaceTags.js +211 -0
  374. package/dist/utils/itemRef.d.ts +86 -0
  375. package/dist/utils/itemRef.js +106 -0
  376. package/dist/utils/lastRun.d.ts +35 -0
  377. package/dist/utils/lastRun.js +73 -0
  378. package/dist/utils/messageNodeLink.d.ts +17 -0
  379. package/dist/utils/messageNodeLink.js +16 -0
  380. package/dist/utils/minimapVisibility.d.ts +28 -0
  381. package/dist/utils/minimapVisibility.js +34 -0
  382. package/dist/utils/nodeAriaLabel.d.ts +12 -0
  383. package/dist/utils/nodeAriaLabel.js +17 -0
  384. package/dist/utils/nodeFingerprint.d.ts +27 -0
  385. package/dist/utils/nodeFingerprint.js +66 -0
  386. package/dist/utils/nodeFormSchema.d.ts +10 -0
  387. package/dist/utils/nodeFormSchema.js +2 -2
  388. package/dist/utils/nodeGeometry.d.ts +168 -0
  389. package/dist/utils/nodeGeometry.js +204 -0
  390. package/dist/utils/nodeProblem.d.ts +19 -0
  391. package/dist/utils/nodeProblem.js +9 -0
  392. package/dist/utils/nodeStatus.d.ts +38 -3
  393. package/dist/utils/nodeStatus.js +67 -39
  394. package/dist/utils/nodeSwap.js +9 -1
  395. package/dist/utils/nodeWrapper.d.ts +1 -0
  396. package/dist/utils/playgroundHistory.d.ts +48 -0
  397. package/dist/utils/playgroundHistory.js +38 -0
  398. package/dist/utils/playgroundInputRuns.d.ts +26 -0
  399. package/dist/utils/playgroundInputRuns.js +50 -0
  400. package/dist/utils/portExposure.d.ts +49 -0
  401. package/dist/utils/portExposure.js +122 -0
  402. package/dist/utils/portUtils.d.ts +16 -0
  403. package/dist/utils/portUtils.js +37 -0
  404. package/dist/utils/portal.d.ts +0 -19
  405. package/dist/utils/portal.js +8 -1
  406. package/dist/utils/reservedPorts.d.ts +59 -0
  407. package/dist/utils/reservedPorts.js +60 -0
  408. package/dist/utils/runEdges.d.ts +24 -0
  409. package/dist/utils/runEdges.js +35 -0
  410. package/dist/utils/runsList.d.ts +69 -0
  411. package/dist/utils/runsList.js +134 -0
  412. package/dist/utils/selectOptions.d.ts +62 -0
  413. package/dist/utils/selectOptions.js +137 -0
  414. package/dist/utils/sessionRuns.d.ts +62 -0
  415. package/dist/utils/sessionRuns.js +123 -0
  416. package/dist/utils/sheetWidths.d.ts +29 -0
  417. package/dist/utils/sheetWidths.js +41 -0
  418. package/dist/utils/sidebarWidths.d.ts +34 -0
  419. package/dist/utils/sidebarWidths.js +47 -0
  420. package/dist/utils/straightWires.d.ts +73 -0
  421. package/dist/utils/straightWires.js +99 -0
  422. package/dist/utils/themeScope.svelte.d.ts +10 -0
  423. package/dist/utils/themeScope.svelte.js +80 -0
  424. package/dist/utils/wiredHandles.d.ts +10 -0
  425. package/dist/utils/wiredHandles.js +14 -0
  426. package/dist/utils/workflowDraft.d.ts +9 -0
  427. package/dist/utils/workflowDraft.js +39 -0
  428. package/dist/utils/workflowInterface.d.ts +40 -7
  429. package/dist/utils/workflowInterface.js +66 -16
  430. package/dist/utils/zoomTier.d.ts +43 -0
  431. package/dist/utils/zoomTier.js +107 -0
  432. package/dist/utils/zoomTierRows.d.ts +41 -0
  433. package/dist/utils/zoomTierRows.js +103 -0
  434. package/dist/webmcp/WebMCPConfirm.svelte +1 -1
  435. package/dist/webmcp/bridge.d.ts +5 -0
  436. package/dist/webmcp/bridge.js +8 -0
  437. package/dist/webmcp/bridgeController.svelte.d.ts +84 -0
  438. package/dist/webmcp/bridgeController.svelte.js +224 -0
  439. package/dist/webmcp/descriptors.d.ts +1 -1
  440. package/dist/webmcp/descriptors.js +66 -5
  441. package/dist/webmcp/fakeWidget.d.ts +34 -0
  442. package/dist/webmcp/fakeWidget.js +75 -0
  443. package/dist/webmcp/gate.js +4 -0
  444. package/dist/webmcp/index.d.ts +2 -0
  445. package/dist/webmcp/index.js +1 -0
  446. package/dist/webmcp/runtime.js +4 -1
  447. package/dist/webmcp/types.d.ts +2 -0
  448. package/dist/webmcp/validate.js +5 -1
  449. package/package.json +8 -2
  450. package/dist/components/Select.svelte +0 -53
  451. package/dist/components/Select.svelte.d.ts +0 -15
  452. package/dist/components/icons/CommandLineIcon.svelte +0 -15
  453. package/dist/components/icons/CommandLineIcon.svelte.d.ts +0 -26
  454. package/dist/components/toast/WarningIcon.svelte +0 -28
  455. package/dist/components/toast/WarningIcon.svelte.d.ts +0 -26
@@ -10,6 +10,10 @@
10
10
  parseCommand,
11
11
  executeCommand,
12
12
  executeBatch,
13
+ parseSessionCommand,
14
+ executeSessionCommand,
15
+ isSessionLine,
16
+ SESSION_HELP,
13
17
  type UIAction,
14
18
  type CommandContext,
15
19
  type CommandResultOk,
@@ -24,6 +28,7 @@
24
28
  import { createStoreCommandContext } from '../../commands/storeIntegration.svelte.js';
25
29
  import { getInstance } from '../../stores/getInstance.svelte.js';
26
30
  import { updateSettings, getUiSettings } from '../../stores/settingsStore.svelte.js';
31
+ import Button from '../primitives/Button.svelte';
27
32
  import ConsoleInput from './ConsoleInput.svelte';
28
33
  import ConsoleOutput, { type ConsoleEntry } from './ConsoleOutput.svelte';
29
34
  import { m } from '../../messages/index.js';
@@ -37,14 +42,24 @@
37
42
  formatHelp
38
43
  } from './formatters.js';
39
44
 
45
+ const SESSION_HEADING = 'Session (editor Console only):';
46
+
40
47
  interface Props {
41
48
  /** Available node types for command execution */
42
49
  nodeTypes: NodeMetadata[];
43
50
  /** Callback for UI actions (open config, select node) */
44
51
  onUIAction?: (action: UIAction) => void;
52
+ /** Id of the panel element, so the toggle strip can point `aria-controls` at it */
53
+ id?: string;
45
54
  }
46
55
 
47
- let { nodeTypes, onUIAction }: Props = $props();
56
+ let { nodeTypes, onUIAction, id }: Props = $props();
57
+
58
+ /**
59
+ * Commands the empty state offers. Read-only on purpose: a click runs them,
60
+ * and none of them can change the workflow.
61
+ */
62
+ const EXAMPLE_COMMANDS = ['list nodes', 'list types', 'help'] as const;
48
63
 
49
64
  const fd = getInstance();
50
65
 
@@ -86,6 +101,23 @@
86
101
  updateSettings({ ui: { consoleOpen: false } });
87
102
  }
88
103
 
104
+ /**
105
+ * Run a `session …` line. These are asynchronous and talk to the backend, so
106
+ * they have their own lane: the input stays usable while one is in flight and
107
+ * its result is added when it lands.
108
+ */
109
+ async function handleSessionSubmit(line: string) {
110
+ const parsed = parseSessionCommand(line);
111
+ if (!parsed.ok) {
112
+ outputEntries.push({ type: 'error', text: parsed.error });
113
+ return;
114
+ }
115
+ const result = await executeSessionCommand(parsed.command, fd.runs);
116
+ outputEntries.push(
117
+ result.ok ? { type: 'success', text: result.message } : { type: 'error', text: result.error }
118
+ );
119
+ }
120
+
89
121
  function handleCommandSubmit(value: string) {
90
122
  const trimmed = value.trim();
91
123
  if (!trimmed) return;
@@ -99,6 +131,18 @@
99
131
  return;
100
132
  }
101
133
 
134
+ // `help session` is answered here: the editing DSL does not know the verb.
135
+ if (/^help\s+session$/i.test(trimmed)) {
136
+ outputEntries.push({ type: 'formatted', text: formatHelp({ commands: SESSION_HELP }) });
137
+ return;
138
+ }
139
+
140
+ // Session commands run in their own, asynchronous lane.
141
+ if (isSessionLine(trimmed)) {
142
+ void handleSessionSubmit(trimmed);
143
+ return;
144
+ }
145
+
102
146
  // Parse the command
103
147
  const parseResult = parseCommand(trimmed);
104
148
  if (!parseResult.ok) {
@@ -121,12 +165,30 @@
121
165
  } else {
122
166
  outputEntries.push({ type: 'success', text: result.message });
123
167
  }
168
+ // The Console also knows the session commands; `help` lists them too.
169
+ if (parseResult.command.type === 'help' && !parseResult.command.command) {
170
+ outputEntries.push({
171
+ type: 'formatted',
172
+ text: `${SESSION_HEADING}\n${formatHelp({ commands: SESSION_HELP })}`
173
+ });
174
+ }
124
175
  } else {
125
176
  outputEntries.push({ type: 'error', text: result.error });
126
177
  }
127
178
  }
128
179
 
129
180
  function handleBatchSubmit(lines: string[]) {
181
+ // A batch is all-or-nothing and synchronous; a run is neither. Refuse
182
+ // before anything executes.
183
+ if (lines.some(isSessionLine)) {
184
+ for (const line of lines) outputEntries.push({ type: 'input', text: line });
185
+ outputEntries.push({
186
+ type: 'error',
187
+ text: 'session commands cannot be part of a batch. Nothing was run; send them one at a time.'
188
+ });
189
+ return;
190
+ }
191
+
130
192
  if (!commandContext) {
131
193
  outputEntries.push({ type: 'error', text: 'No workflow loaded' });
132
194
  return;
@@ -197,19 +259,24 @@
197
259
  }
198
260
  </script>
199
261
 
200
- <div class="command-console" role="region" aria-label={m().layout.commandConsole}>
201
- <div class="command-console__header">
202
- <h2 class="command-console__title">{m().navigation.bottomPanel.console}</h2>
203
- <button
204
- class="command-console__close"
205
- onclick={closeConsole}
206
- aria-label={m().layout.closeConsole}
207
- type="button"
208
- >
209
- &times;
210
- </button>
211
- </div>
262
+ <div class="command-console" {id} role="region" aria-label={m().layout.commandConsole}>
212
263
  <div class="command-console__content">
264
+ {#if outputEntries.length === 0}
265
+ <div class="command-console__examples" data-testid="console-examples">
266
+ <span class="command-console__examples-label">{m().layout.consoleExamplesLabel}</span>
267
+ {#each EXAMPLE_COMMANDS as example (example)}
268
+ <Button
269
+ variant="ghost"
270
+ size="sm"
271
+ class="command-console__example"
272
+ onclick={() => handleCommandSubmit(example)}
273
+ >
274
+ <span aria-hidden="true">›</span>
275
+ {example}
276
+ </Button>
277
+ {/each}
278
+ </div>
279
+ {/if}
213
280
  <ConsoleOutput entries={outputEntries} />
214
281
  </div>
215
282
  <ConsoleInput
@@ -226,43 +293,41 @@
226
293
  height: 100%;
227
294
  display: flex;
228
295
  flex-direction: column;
229
- background-color: var(--fd-background);
296
+ /* Terminal surface: ink in every app theme and colour scheme. The strip above stays chrome. */
297
+ background-color: var(--fd-console-bg);
298
+ color: var(--fd-console-fg);
299
+ color-scheme: dark;
300
+ font-family: var(--fd-font-mono);
230
301
  }
231
302
 
232
- .command-console__header {
303
+ .command-console__examples {
233
304
  display: flex;
234
- justify-content: space-between;
235
- align-items: center;
236
- padding: 0.5rem 1rem;
237
- border-bottom: 1px solid var(--fd-border);
238
- background-color: var(--fd-muted);
239
- flex-shrink: 0;
305
+ flex-direction: column;
306
+ align-items: flex-start;
307
+ gap: var(--fd-space-3xs);
308
+ padding: var(--fd-space-xs) var(--fd-space-md) 0;
309
+ font-family: var(--fd-font-mono);
310
+ font-size: var(--fd-text-sm);
311
+ color: var(--fd-console-muted);
240
312
  }
241
313
 
242
- .command-console__title {
243
- margin: 0;
244
- font-size: 0.875rem;
245
- font-weight: 600;
246
- color: var(--fd-foreground);
314
+ .command-console__examples-label {
315
+ font-family: var(--fd-font-sans);
316
+ font-size: var(--fd-text-meta);
247
317
  }
248
318
 
249
- .command-console__close {
250
- background: none;
251
- border: none;
252
- font-size: 1.25rem;
253
- line-height: 1;
254
- cursor: pointer;
255
- color: var(--fd-muted-foreground);
256
- padding: 0.25rem;
257
- border-radius: var(--fd-radius-sm);
258
- transition:
259
- color var(--fd-transition-fast),
260
- background-color var(--fd-transition-fast);
319
+ .command-console__examples :global(.command-console__example) {
320
+ height: auto;
321
+ padding: 0 var(--fd-space-3xs);
322
+ font-family: inherit;
323
+ font-size: inherit;
324
+ font-weight: normal;
325
+ color: var(--fd-console-arg);
261
326
  }
262
327
 
263
- .command-console__close:hover {
264
- color: var(--fd-foreground);
265
- background-color: var(--fd-subtle);
328
+ .command-console__examples :global(.command-console__example:hover) {
329
+ background-color: var(--fd-console-hover);
330
+ color: var(--fd-console-verb);
266
331
  }
267
332
 
268
333
  .command-console__content {
@@ -5,6 +5,8 @@ interface Props {
5
5
  nodeTypes: NodeMetadata[];
6
6
  /** Callback for UI actions (open config, select node) */
7
7
  onUIAction?: (action: UIAction) => void;
8
+ /** Id of the panel element, so the toggle strip can point `aria-controls` at it */
9
+ id?: string;
8
10
  }
9
11
  declare const CommandConsole: import("svelte").Component<Props, {}, "">;
10
12
  type CommandConsole = ReturnType<typeof CommandConsole>;
@@ -78,14 +78,14 @@
78
78
  right: 0;
79
79
  max-height: calc(8 * 2rem);
80
80
  overflow-y: auto;
81
- background-color: var(--fd-card);
82
- border: 1px solid var(--fd-border);
81
+ background-color: var(--fd-console-raised);
82
+ border: 1px solid var(--fd-console-line);
83
83
  border-bottom: none;
84
84
  border-radius: var(--fd-radius-sm) var(--fd-radius-sm) 0 0;
85
85
  z-index: 10;
86
86
 
87
87
  scrollbar-width: thin;
88
- scrollbar-color: var(--fd-scrollbar-thumb) var(--fd-scrollbar-track);
88
+ scrollbar-color: var(--fd-console-scroll-thumb) transparent;
89
89
  }
90
90
 
91
91
  .console-autocomplete::-webkit-scrollbar {
@@ -93,11 +93,11 @@
93
93
  }
94
94
 
95
95
  .console-autocomplete::-webkit-scrollbar-track {
96
- background: var(--fd-scrollbar-track);
96
+ background: transparent;
97
97
  }
98
98
 
99
99
  .console-autocomplete::-webkit-scrollbar-thumb {
100
- background: var(--fd-scrollbar-thumb);
100
+ background: var(--fd-console-scroll-thumb);
101
101
  border-radius: var(--fd-scrollbar-radius);
102
102
  }
103
103
 
@@ -108,21 +108,22 @@
108
108
  padding: 0.25rem 1rem;
109
109
  height: 2rem;
110
110
  cursor: pointer;
111
- font-family: monospace;
112
- font-size: 0.875rem;
113
- color: var(--fd-foreground);
111
+ font-family: var(--fd-font-mono);
112
+ font-size: var(--fd-text-sm);
113
+ color: var(--fd-console-arg);
114
114
  }
115
115
 
116
116
  .console-autocomplete__item:hover {
117
- background-color: var(--fd-accent);
117
+ background-color: var(--fd-console-hover);
118
118
  }
119
119
 
120
120
  .console-autocomplete__item--selected {
121
- background-color: var(--fd-primary-muted);
121
+ background-color: var(--fd-console-selected);
122
+ color: var(--fd-console-verb);
122
123
  }
123
124
 
124
125
  .console-autocomplete__item--selected:hover {
125
- background-color: var(--fd-primary-muted);
126
+ background-color: var(--fd-console-selected);
126
127
  }
127
128
 
128
129
  .console-autocomplete__label {
@@ -132,8 +133,8 @@
132
133
  }
133
134
 
134
135
  .console-autocomplete__detail {
135
- color: var(--fd-muted-foreground);
136
- font-size: 0.75rem;
136
+ color: var(--fd-console-muted);
137
+ font-size: var(--fd-text-xs);
137
138
  margin-left: 1rem;
138
139
  white-space: nowrap;
139
140
  flex-shrink: 0;
@@ -74,7 +74,8 @@
74
74
  'swap',
75
75
  'move',
76
76
  'layout',
77
- 'canvas'
77
+ 'canvas',
78
+ 'session'
78
79
  ];
79
80
 
80
81
  /** Verbs that take a nodeId as their first argument */
@@ -288,13 +289,20 @@
288
289
  const SUBCOMMAND_MAP: Record<string, Array<{ value: string; detail?: string }>> = {
289
290
  layout: [
290
291
  { value: 'auto', detail: 'Re-arrange all nodes from scratch' },
291
- { value: 'beautify', detail: 'Normalize spacing, preserve arrangement' }
292
+ { value: 'beautify', detail: 'Tidy: columns, no overlaps, straight wires' }
292
293
  ],
293
294
  list: [
294
295
  { value: 'nodes', detail: 'List all workflow nodes' },
295
296
  { value: 'edges', detail: 'List all connections' },
296
297
  { value: 'types', detail: 'List available node types' }
297
298
  ],
299
+ session: [
300
+ { value: 'send', detail: 'Send a chat turn to the test session' },
301
+ { value: 'run', detail: 'Run the workflow (session run key=value …)' },
302
+ { value: 'stop', detail: 'Stop the running test session' },
303
+ { value: 'new', detail: 'Start a fresh test session' },
304
+ { value: 'status', detail: 'Show the session, its status and latest reply' }
305
+ ],
298
306
  canvas: [
299
307
  { value: 'fitview', detail: 'Fit all nodes into the viewport' },
300
308
  { value: 'zoom in', detail: 'Zoom in on the canvas' },
@@ -517,7 +525,7 @@
517
525
  if (!text || !text.includes('\n')) return;
518
526
 
519
527
  // If already typing a set command, treat multiline paste as the value
520
- const setMatch = inputValue.match(/^(set\s+\S+?:\S+)\s*(.*)$/i);
528
+ const setMatch = inputValue.match(/^(set\s+\S+?:\S+|session\s+send\b)\s*(.*)$/i);
521
529
  if (setMatch) {
522
530
  event.preventDefault();
523
531
  enterMultilineMode(setMatch[1], (setMatch[2] ? setMatch[2] + '\n' : '') + text);
@@ -587,7 +595,7 @@
587
595
 
588
596
  if (event.key === 'Enter' && event.shiftKey) {
589
597
  // Shift+Enter on a set command → expand to multiline textarea
590
- const setMatch = inputValue.match(/^(set\s+\S+?:\S+)\s*(.*)$/i);
598
+ const setMatch = inputValue.match(/^(set\s+\S+?:\S+|session\s+send\b)\s*(.*)$/i);
591
599
  if (setMatch) {
592
600
  event.preventDefault();
593
601
  enterMultilineMode(setMatch[1], setMatch[2]);
@@ -691,25 +699,40 @@
691
699
  </div>
692
700
 
693
701
  <style>
702
+ /*
703
+ Same frame as primitives/Composer (40px row, border, large radius, focus
704
+ ring). The console keeps its own input rather than hosting Composer: it is
705
+ a command line (history on Up/Down, Tab-accepted autocomplete, a multiline
706
+ mode behind Shift+Enter, paste handling) and has no send button.
707
+ */
694
708
  .console-input {
695
709
  display: flex;
696
710
  align-items: center;
697
- padding: 0.5rem 1rem;
698
- border-top: 1px solid var(--fd-border-muted);
699
- background-color: var(--fd-background);
711
+ box-sizing: border-box;
712
+ margin: var(--fd-space-xs) var(--fd-space-sm) var(--fd-space-sm);
713
+ padding: calc(var(--fd-space-3xs) - 1px) var(--fd-space-sm);
714
+ border: 1px solid var(--fd-console-line);
715
+ border-radius: var(--fd-radius-lg);
716
+ background-color: transparent;
700
717
  flex-shrink: 0;
701
718
  }
702
719
 
720
+ .console-input:focus-within {
721
+ border-color: var(--fd-console-focus);
722
+ }
723
+
703
724
  .console-input__prompt {
704
- font-family: monospace;
705
- font-size: 0.875rem;
706
- color: var(--fd-muted-foreground);
707
- margin-right: 0.5rem;
725
+ font-family: var(--fd-font-mono);
726
+ font-size: var(--fd-text-sm);
727
+ color: var(--fd-console-prompt);
728
+ margin-right: var(--fd-space-xs);
708
729
  user-select: none;
709
730
  }
710
731
 
711
732
  .console-input__wrapper {
712
733
  flex: 1;
734
+ /* A flex child will not shrink below its content: let a long placeholder clip. */
735
+ min-width: 0;
713
736
  position: relative;
714
737
  }
715
738
 
@@ -718,16 +741,20 @@
718
741
  background: none;
719
742
  border: none;
720
743
  outline: none;
721
- font-family: monospace;
722
- font-size: 0.875rem;
723
- color: var(--fd-foreground);
744
+ font-family: var(--fd-font-mono);
745
+ font-size: var(--fd-text-sm);
746
+ color: var(--fd-console-verb);
747
+ caret-color: var(--fd-console-caret);
724
748
  padding: 0;
725
749
  line-height: 1.5;
750
+ min-width: 0;
751
+ min-height: var(--fd-control-lg);
752
+ text-overflow: ellipsis;
726
753
  }
727
754
 
728
755
  .console-input__field::placeholder {
729
- color: var(--fd-muted-foreground);
730
- opacity: 0.6;
756
+ color: var(--fd-console-muted);
757
+ opacity: 0.8;
731
758
  }
732
759
 
733
760
  .console-input--multiline {
@@ -746,28 +773,29 @@
746
773
  }
747
774
 
748
775
  .console-input__multiline-label {
749
- font-family: monospace;
750
- font-size: 0.875rem;
751
- color: var(--fd-foreground);
776
+ font-family: var(--fd-font-mono);
777
+ font-size: var(--fd-text-sm);
778
+ color: var(--fd-console-arg);
752
779
  font-weight: 500;
753
780
  }
754
781
 
755
782
  .console-input__multiline-hint {
756
- font-family: monospace;
757
- font-size: 0.75rem;
758
- color: var(--fd-muted-foreground);
783
+ font-family: var(--fd-font-mono);
784
+ font-size: var(--fd-text-xs);
785
+ color: var(--fd-console-muted);
759
786
  opacity: 0.7;
760
787
  }
761
788
 
762
789
  .console-input__textarea {
763
790
  width: 100%;
764
791
  background: none;
765
- border: 1px solid var(--fd-border-muted);
792
+ border: 1px solid var(--fd-console-line);
766
793
  border-radius: var(--fd-radius-sm);
767
794
  outline: none;
768
- font-family: monospace;
769
- font-size: 0.875rem;
770
- color: var(--fd-foreground);
795
+ font-family: var(--fd-font-mono);
796
+ font-size: var(--fd-text-sm);
797
+ color: var(--fd-console-verb);
798
+ caret-color: var(--fd-console-caret);
771
799
  padding: 0.375rem 0.5rem;
772
800
  line-height: 1.5;
773
801
  resize: vertical;
@@ -775,6 +803,11 @@
775
803
  }
776
804
 
777
805
  .console-input__textarea:focus {
778
- border-color: var(--fd-border);
806
+ border-color: var(--fd-console-focus);
807
+ }
808
+
809
+ .console-input ::selection {
810
+ background: var(--fd-console-selection);
811
+ color: inherit;
779
812
  }
780
813
  </style>
@@ -6,6 +6,7 @@
6
6
 
7
7
  <script lang="ts">
8
8
  import { tick } from 'svelte';
9
+ import { highlightConsoleEntry } from '../../utils/consoleHighlight.js';
9
10
 
10
11
  export interface ConsoleEntry {
11
12
  type: 'input' | 'success' | 'error' | 'formatted';
@@ -34,32 +35,40 @@
34
35
 
35
36
  <div class="console-output" bind:this={outputElement} role="log" aria-live="polite">
36
37
  <!-- Append-only log without stable IDs — index is the identity -->
38
+ <!-- Segments are presentation only: their text joins back to the entry text exactly. -->
37
39
  {#each entries as entry, i (i)}
38
40
  <div class="console-output__entry console-output__entry--{entry.type}">
39
41
  {#if entry.type === 'input'}
40
- <span class="console-output__prefix">&gt;</span>
41
- <span class="console-output__text">{entry.text}</span>
42
+ <span class="console-output__prefix console-output__tok--prompt">&gt;</span>
43
+ <span class="console-output__text">{@render tokens(entry)}</span>
42
44
  {:else if entry.type === 'formatted'}
43
- <pre class="console-output__pre">{entry.text}</pre>
45
+ <pre class="console-output__pre">{@render tokens(entry)}</pre>
44
46
  {:else}
45
- <span class="console-output__text">{entry.text}</span>
47
+ <span class="console-output__text">{@render tokens(entry)}</span>
46
48
  {/if}
47
49
  </div>
48
50
  {/each}
49
51
  </div>
50
52
 
53
+ {#snippet tokens(
54
+ entry: ConsoleEntry
55
+ )}{#each highlightConsoleEntry(entry) as seg, j (j)}{#if seg.role}<span
56
+ class="console-output__tok--{seg.role}">{seg.text}</span
57
+ >{:else}{seg.text}{/if}{/each}{/snippet}
58
+
51
59
  <style>
60
+ /* The terminal surface: monospace on the ink panel, colours from --fd-console-* tokens. */
52
61
  .console-output {
53
62
  flex: 1;
54
63
  overflow-y: auto;
55
- padding: 0.5rem 1rem;
56
- font-family: monospace;
57
- font-size: 0.875rem;
64
+ padding: var(--fd-space-xs) var(--fd-space-md);
65
+ font-family: var(--fd-font-mono);
66
+ font-size: var(--fd-text-sm);
58
67
  line-height: 1.6;
68
+ color: var(--fd-console-fg);
59
69
 
60
- /* Custom scrollbar styling matching MainLayout pattern */
61
70
  scrollbar-width: thin;
62
- scrollbar-color: var(--fd-scrollbar-thumb) var(--fd-scrollbar-track);
71
+ scrollbar-color: var(--fd-console-scroll-thumb) transparent;
63
72
  }
64
73
 
65
74
  .console-output::-webkit-scrollbar {
@@ -67,17 +76,21 @@
67
76
  }
68
77
 
69
78
  .console-output::-webkit-scrollbar-track {
70
- background: var(--fd-scrollbar-track);
71
- border-radius: var(--fd-scrollbar-radius);
79
+ background: transparent;
72
80
  }
73
81
 
74
82
  .console-output::-webkit-scrollbar-thumb {
75
- background: var(--fd-scrollbar-thumb);
83
+ background: var(--fd-console-scroll-thumb);
76
84
  border-radius: var(--fd-scrollbar-radius);
77
85
  }
78
86
 
79
87
  .console-output::-webkit-scrollbar-thumb:hover {
80
- background: var(--fd-scrollbar-thumb-hover);
88
+ background: var(--fd-console-scroll-thumb-hover);
89
+ }
90
+
91
+ .console-output ::selection {
92
+ background: var(--fd-console-selection);
93
+ color: inherit;
81
94
  }
82
95
 
83
96
  .console-output__entry {
@@ -85,20 +98,13 @@
85
98
  word-break: break-word;
86
99
  }
87
100
 
88
- .console-output__entry--input {
89
- color: var(--fd-muted-foreground);
90
- }
91
-
92
- .console-output__entry--success {
93
- color: var(--fd-success);
101
+ /* A command starts a new exchange: a little air before it, except at the top. */
102
+ .console-output__entry--input:not(:first-child) {
103
+ margin-top: var(--fd-console-entry-gap);
94
104
  }
95
105
 
96
106
  .console-output__entry--error {
97
- color: var(--fd-error);
98
- }
99
-
100
- .console-output__entry--formatted {
101
- color: var(--fd-foreground);
107
+ color: var(--fd-console-error);
102
108
  }
103
109
 
104
110
  .console-output__pre {
@@ -108,10 +114,66 @@
108
114
  line-height: inherit;
109
115
  white-space: pre;
110
116
  overflow-x: auto;
117
+ scrollbar-width: thin;
118
+ scrollbar-color: var(--fd-console-scroll-thumb) transparent;
111
119
  }
112
120
 
113
121
  .console-output__prefix {
114
122
  margin-right: 0.5rem;
115
123
  user-select: none;
116
124
  }
125
+
126
+ /* Roles. Colour only (plus the verb's weight): no role changes layout or text. */
127
+ .console-output__tok--prompt {
128
+ color: var(--fd-console-prompt);
129
+ }
130
+
131
+ .console-output__tok--verb {
132
+ color: var(--fd-console-verb);
133
+ font-weight: 600;
134
+ }
135
+
136
+ .console-output__tok--arg {
137
+ color: var(--fd-console-arg);
138
+ }
139
+
140
+ .console-output__tok--id {
141
+ color: var(--fd-console-id);
142
+ }
143
+
144
+ .console-output__tok--header {
145
+ color: var(--fd-console-header);
146
+ }
147
+
148
+ .console-output__tok--rule {
149
+ color: var(--fd-console-rule);
150
+ }
151
+
152
+ .console-output__tok--key {
153
+ color: var(--fd-console-key);
154
+ }
155
+
156
+ .console-output__tok--eq {
157
+ color: var(--fd-console-eq);
158
+ }
159
+
160
+ .console-output__tok--string {
161
+ color: var(--fd-console-string);
162
+ }
163
+
164
+ .console-output__tok--number {
165
+ color: var(--fd-console-number);
166
+ }
167
+
168
+ .console-output__tok--punct {
169
+ color: var(--fd-console-punct);
170
+ }
171
+
172
+ .console-output__tok--error {
173
+ color: var(--fd-console-error);
174
+ }
175
+
176
+ .console-output__tok--muted {
177
+ color: var(--fd-console-muted);
178
+ }
117
179
  </style>