@blokkli/editor 2.0.0-alpha.35 → 2.0.0-alpha.37

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 (320) hide show
  1. package/dist/global/types/blockOptions.d.ts +10 -2
  2. package/dist/global/types/definitions.d.ts +12 -5
  3. package/dist/module.d.mts +2 -2
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +126 -7
  6. package/dist/modules/agent/index.d.mts +1 -1
  7. package/dist/modules/agent/index.mjs +273 -25
  8. package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +2 -2
  9. package/dist/modules/agent/runtime/app/composables/agentProvider.js +34 -17
  10. package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.d.ts +2 -20
  11. package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.js +0 -3
  12. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue +2 -2
  13. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue +1 -2
  14. package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +1 -2
  15. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.d.vue.ts +1 -0
  16. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +67 -86
  17. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue.d.ts +1 -0
  18. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +10 -12
  19. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/de.md +2 -2
  20. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/en.md +2 -2
  21. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +1 -5
  22. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.d.vue.ts +8 -0
  23. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +138 -0
  24. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue.d.ts +8 -0
  25. package/dist/modules/agent/runtime/app/features/agent/index.vue +94 -38
  26. package/dist/modules/agent/runtime/app/helpers/index.d.ts +16 -19
  27. package/dist/modules/agent/runtime/app/helpers/index.js +22 -46
  28. package/dist/modules/agent/runtime/app/helpers/pageStructure.js +1 -1
  29. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.js +5 -9
  30. package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +2 -6
  31. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -6
  32. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +2 -3
  33. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +2 -6
  34. package/dist/modules/agent/runtime/app/tools/add_template/index.js +2 -6
  35. package/dist/modules/agent/runtime/app/tools/analyze_content/index.js +120 -0
  36. package/dist/modules/agent/runtime/app/tools/check_readability/index.d.ts +2 -0
  37. package/dist/modules/agent/runtime/app/tools/check_readability/index.js +57 -0
  38. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +2 -6
  39. package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +1 -1
  40. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.d.ts +2 -0
  41. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +176 -0
  42. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +1 -1
  43. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +7 -5
  44. package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +2 -1
  45. package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +2 -3
  46. package/dist/modules/agent/runtime/app/tools/helpers.d.ts +53 -0
  47. package/dist/modules/agent/runtime/app/tools/helpers.js +187 -0
  48. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +2 -6
  49. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +1 -44
  50. package/dist/modules/agent/runtime/app/tools/schemas.js +0 -174
  51. package/dist/modules/agent/runtime/app/tools/search_content/index.js +40 -47
  52. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +2 -5
  53. package/dist/modules/agent/runtime/app/types/index.d.ts +0 -61
  54. package/dist/modules/agent/runtime/server/Session.d.ts +29 -8
  55. package/dist/modules/agent/runtime/server/Session.js +168 -85
  56. package/dist/modules/agent/runtime/server/SessionManager.d.ts +3 -0
  57. package/dist/modules/agent/runtime/server/SessionManager.js +4 -1
  58. package/dist/modules/agent/runtime/server/agent.js +3 -2
  59. package/dist/modules/agent/runtime/server/agentPrompt.d.ts +9 -1
  60. package/dist/modules/agent/runtime/server/agentPrompt.js +26 -0
  61. package/dist/modules/agent/runtime/server/default-skills/fixReadability.d.ts +2 -0
  62. package/dist/modules/agent/runtime/server/default-skills/fixReadability.js +69 -0
  63. package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +28 -0
  64. package/dist/modules/agent/runtime/server/server-tools/index.d.ts +10 -2
  65. package/dist/modules/agent/runtime/server/server-tools/index.js +1 -1
  66. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +1 -1
  67. package/dist/modules/agent/runtime/shared/types.d.ts +81 -12
  68. package/dist/modules/agent/runtime/shared/types.js +22 -10
  69. package/dist/modules/charts/index.d.mts +35 -0
  70. package/dist/modules/charts/index.mjs +57 -0
  71. package/dist/modules/charts/runtime/blokkli/skills/charts.d.ts +2 -0
  72. package/dist/modules/charts/runtime/blokkli/skills/charts.js +42 -0
  73. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +86 -0
  74. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +136 -0
  75. package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.d.ts +2 -0
  76. package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.js +93 -0
  77. package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.d.ts +2 -0
  78. package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.js +66 -0
  79. package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.d.ts +2 -0
  80. package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.js +40 -0
  81. package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.d.ts +2 -0
  82. package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.js +89 -0
  83. package/dist/modules/charts/runtime/chartTypes/area.d.ts +7 -0
  84. package/dist/modules/charts/runtime/chartTypes/area.js +68 -0
  85. package/dist/modules/charts/runtime/chartTypes/bar.d.ts +8 -0
  86. package/dist/modules/charts/runtime/chartTypes/bar.js +76 -0
  87. package/dist/modules/charts/runtime/chartTypes/define.d.ts +2 -0
  88. package/dist/modules/charts/runtime/chartTypes/define.js +3 -0
  89. package/dist/modules/charts/runtime/chartTypes/donut.d.ts +6 -0
  90. package/dist/modules/charts/runtime/chartTypes/donut.js +45 -0
  91. package/dist/modules/charts/runtime/chartTypes/heatmap.d.ts +4 -0
  92. package/dist/modules/charts/runtime/chartTypes/heatmap.js +54 -0
  93. package/dist/modules/charts/runtime/chartTypes/index.d.ts +39 -0
  94. package/dist/modules/charts/runtime/chartTypes/index.js +47 -0
  95. package/dist/modules/charts/runtime/chartTypes/line.d.ts +7 -0
  96. package/dist/modules/charts/runtime/chartTypes/line.js +68 -0
  97. package/dist/modules/charts/runtime/chartTypes/pie.d.ts +5 -0
  98. package/dist/modules/charts/runtime/chartTypes/pie.js +28 -0
  99. package/dist/modules/charts/runtime/chartTypes/radar.d.ts +7 -0
  100. package/dist/modules/charts/runtime/chartTypes/radar.js +52 -0
  101. package/dist/modules/charts/runtime/chartTypes/radialBar.d.ts +6 -0
  102. package/dist/modules/charts/runtime/chartTypes/radialBar.js +44 -0
  103. package/dist/modules/charts/runtime/chartTypes/shared.d.ts +67 -0
  104. package/dist/modules/charts/runtime/chartTypes/shared.js +103 -0
  105. package/dist/modules/charts/runtime/chartTypes/types.d.ts +29 -0
  106. package/dist/modules/charts/runtime/chartTypes/types.js +0 -0
  107. package/dist/modules/charts/runtime/components/ChartRenderer/index.d.vue.ts +147 -0
  108. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +120 -0
  109. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue.d.ts +147 -0
  110. package/dist/modules/charts/runtime/components/index.d.ts +1 -0
  111. package/dist/modules/charts/runtime/components/index.js +1 -0
  112. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.d.vue.ts +16 -0
  113. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue +97 -0
  114. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue.d.ts +16 -0
  115. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.d.vue.ts +11 -0
  116. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue +34 -0
  117. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue.d.ts +11 -0
  118. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.d.vue.ts +12 -0
  119. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +49 -0
  120. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue.d.ts +12 -0
  121. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.d.vue.ts +19 -0
  122. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue +89 -0
  123. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue.d.ts +19 -0
  124. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.d.vue.ts +23 -0
  125. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +224 -0
  126. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue.d.ts +23 -0
  127. package/dist/{runtime/editor/features/clipboard/List → modules/charts/runtime/features/charts/Editor/FootnoteEditor}/index.d.vue.ts +4 -5
  128. package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue +61 -0
  129. package/dist/{runtime/editor/features/clipboard/List → modules/charts/runtime/features/charts/Editor/FootnoteEditor}/index.vue.d.ts +4 -5
  130. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.d.vue.ts +10 -0
  131. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue +45 -0
  132. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue.d.ts +10 -0
  133. package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +11 -0
  134. package/dist/modules/charts/runtime/features/charts/Editor/index.vue +249 -0
  135. package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +11 -0
  136. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +17 -0
  137. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.js +90 -0
  138. package/dist/modules/charts/runtime/features/charts/index.d.vue.ts +3 -0
  139. package/dist/modules/charts/runtime/features/charts/index.vue +72 -0
  140. package/dist/modules/charts/runtime/features/charts/index.vue.d.ts +3 -0
  141. package/dist/modules/charts/runtime/helpers/index.d.ts +26 -0
  142. package/dist/modules/charts/runtime/helpers/index.js +80 -0
  143. package/dist/modules/charts/runtime/types.d.ts +33 -0
  144. package/dist/modules/charts/runtime/types.js +0 -0
  145. package/dist/modules/drupal/graphql/features/fragments.graphql +2 -0
  146. package/dist/modules/drupal/index.d.mts +1 -1
  147. package/dist/modules/drupal/runtime/adapter/index.d.ts +3 -1
  148. package/dist/modules/drupal/runtime/adapter/index.js +16 -12
  149. package/dist/modules/table-of-contents/index.d.mts +11 -0
  150. package/dist/modules/table-of-contents/index.mjs +24 -0
  151. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.d.vue.ts +44 -0
  152. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue +43 -0
  153. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue.d.ts +44 -0
  154. package/dist/modules/table-of-contents/runtime/types/index.d.ts +4 -0
  155. package/dist/modules/table-of-contents/runtime/types/index.js +0 -0
  156. package/dist/runtime/components/Blocks/Fragment/index.vue +6 -2
  157. package/dist/runtime/components/BlokkliItem.vue +9 -4
  158. package/dist/runtime/components/BlokkliProvider.d.vue.ts +7 -0
  159. package/dist/runtime/components/BlokkliProvider.vue +7 -1
  160. package/dist/runtime/components/BlokkliProvider.vue.d.ts +7 -0
  161. package/dist/runtime/composables/defineBlokkli.js +1 -1
  162. package/dist/runtime/composables/useBlokkliHelper.js +4 -2
  163. package/dist/runtime/editor/components/AnimationCanvas/index.vue +17 -27
  164. package/dist/runtime/editor/components/Banner/index.d.vue.ts +13 -2
  165. package/dist/runtime/editor/components/Banner/index.vue +4 -2
  166. package/dist/runtime/editor/components/Banner/index.vue.d.ts +13 -2
  167. package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +27 -0
  168. package/dist/runtime/editor/components/Dropdown/index.vue +107 -0
  169. package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +27 -0
  170. package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.d.vue.ts +1 -0
  171. package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue +3 -2
  172. package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue.d.ts +1 -0
  173. package/dist/runtime/editor/components/EditProvider.d.vue.ts +2 -0
  174. package/dist/runtime/editor/components/EditProvider.vue +11 -7
  175. package/dist/runtime/editor/components/EditProvider.vue.d.ts +2 -0
  176. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +5 -1
  177. package/dist/runtime/editor/components/FlexTextarea/index.vue +24 -101
  178. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +5 -1
  179. package/dist/runtime/editor/components/Form/Radio/index.d.vue.ts +1 -0
  180. package/dist/runtime/editor/components/Form/Radio/index.vue +3 -2
  181. package/dist/runtime/editor/components/Form/Radio/index.vue.d.ts +1 -0
  182. package/dist/runtime/editor/components/ItemIcon/index.vue +10 -2
  183. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +13 -3
  184. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +43 -16
  185. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +13 -3
  186. package/dist/runtime/editor/components/Popup/index.d.vue.ts +30 -0
  187. package/dist/runtime/editor/components/Popup/index.vue +82 -0
  188. package/dist/runtime/editor/components/Popup/index.vue.d.ts +30 -0
  189. package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +2 -0
  190. package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
  191. package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +2 -0
  192. package/dist/runtime/editor/components/Resizable/index.vue +4 -1
  193. package/dist/runtime/editor/components/ShortcutIndicator/index.vue +1 -1
  194. package/dist/runtime/editor/components/Toolbar/index.vue +107 -6
  195. package/dist/runtime/editor/components/index.d.ts +4 -1
  196. package/dist/runtime/editor/components/index.js +6 -0
  197. package/dist/runtime/editor/composables/defineDropAreas.js +3 -3
  198. package/dist/runtime/editor/composables/defineDropHandler.d.ts +3 -0
  199. package/dist/runtime/editor/composables/defineDropHandler.js +10 -0
  200. package/dist/runtime/editor/composables/index.d.ts +1 -0
  201. package/dist/runtime/editor/composables/index.js +1 -0
  202. package/dist/runtime/editor/composables/onElementResize.js +0 -1
  203. package/dist/runtime/editor/composables/useEditableFieldOverride.js +4 -5
  204. package/dist/runtime/editor/css/output.css +1 -1
  205. package/dist/runtime/editor/events/index.d.ts +16 -0
  206. package/dist/runtime/editor/features/add-list/Help/Item.vue +5 -2
  207. package/dist/runtime/editor/features/add-list/index.vue +58 -1
  208. package/dist/runtime/editor/features/analyze/Main.d.vue.ts +3 -2
  209. package/dist/runtime/editor/features/analyze/Main.vue +28 -44
  210. package/dist/runtime/editor/features/analyze/Main.vue.d.ts +3 -2
  211. package/dist/runtime/editor/features/analyze/analyzers/readability.js +65 -0
  212. package/dist/runtime/editor/features/analyze/analyzers/types.d.ts +19 -0
  213. package/dist/runtime/editor/features/analyze/index.vue +18 -15
  214. package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
  215. package/dist/runtime/editor/features/clipboard/DropElement/Video.d.vue.ts +8 -0
  216. package/dist/runtime/editor/features/clipboard/{List/Item → DropElement}/Video.vue +1 -5
  217. package/dist/runtime/editor/features/clipboard/DropElement/Video.vue.d.ts +8 -0
  218. package/dist/runtime/editor/features/clipboard/DropElement/helpers.d.ts +1 -0
  219. package/dist/runtime/editor/features/clipboard/DropElement/helpers.js +14 -0
  220. package/dist/runtime/editor/features/clipboard/DropElement/index.d.vue.ts +16 -0
  221. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +97 -0
  222. package/dist/runtime/editor/features/clipboard/DropElement/index.vue.d.ts +16 -0
  223. package/dist/runtime/editor/features/clipboard/helpers.d.ts +15 -0
  224. package/dist/runtime/editor/features/clipboard/helpers.js +62 -0
  225. package/dist/runtime/editor/features/clipboard/index.vue +586 -338
  226. package/dist/runtime/editor/features/clipboard/types.d.ts +14 -2
  227. package/dist/runtime/editor/features/debug/index.vue +1 -1
  228. package/dist/runtime/editor/features/dev-mode/index.vue +86 -2
  229. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +17 -5
  230. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +2 -2
  231. package/dist/runtime/editor/features/dragging-overlay/index.vue +125 -219
  232. package/dist/runtime/editor/features/edit/index.vue +20 -0
  233. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +4 -4
  234. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +6 -0
  235. package/dist/runtime/editor/features/fragments/types.d.ts +1 -0
  236. package/dist/runtime/editor/features/hover/Renderer/index.vue +30 -3
  237. package/dist/runtime/editor/features/hover/index.vue +1 -1
  238. package/dist/runtime/editor/features/library/index.vue +14 -0
  239. package/dist/runtime/editor/features/media-library/index.vue +32 -1
  240. package/dist/runtime/editor/features/options/Form/Checkbox/index.d.vue.ts +2 -2
  241. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +3 -3
  242. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue.d.ts +2 -2
  243. package/dist/runtime/editor/features/options/Form/Checkboxes/index.d.vue.ts +2 -2
  244. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +5 -5
  245. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue.d.ts +2 -2
  246. package/dist/runtime/editor/features/options/Form/ComplexType/index.d.vue.ts +11 -0
  247. package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +36 -0
  248. package/dist/runtime/editor/features/options/Form/ComplexType/index.vue.d.ts +11 -0
  249. package/dist/runtime/editor/features/options/Form/Item.d.vue.ts +5 -4
  250. package/dist/runtime/editor/features/options/Form/Item.vue +24 -50
  251. package/dist/runtime/editor/features/options/Form/Item.vue.d.ts +5 -4
  252. package/dist/runtime/editor/features/options/Form/Number/index.d.vue.ts +3 -3
  253. package/dist/runtime/editor/features/options/Form/Number/index.vue +7 -17
  254. package/dist/runtime/editor/features/options/Form/Number/index.vue.d.ts +3 -3
  255. package/dist/runtime/editor/features/options/Form/Range/index.d.vue.ts +2 -2
  256. package/dist/runtime/editor/features/options/Form/Range/index.vue +4 -4
  257. package/dist/runtime/editor/features/options/Form/Range/index.vue.d.ts +2 -2
  258. package/dist/runtime/editor/features/options/Form/index.vue +15 -5
  259. package/dist/runtime/editor/features/search/index.vue +25 -1
  260. package/dist/runtime/editor/features/selection/index.vue +2 -2
  261. package/dist/runtime/editor/features/structure/index.vue +25 -1
  262. package/dist/runtime/editor/features/tour/index.vue +22 -12
  263. package/dist/runtime/editor/features/transform/index.vue +1 -3
  264. package/dist/runtime/editor/helpers/clipboardData/index.d.ts +11 -0
  265. package/dist/runtime/editor/helpers/clipboardData/index.js +157 -0
  266. package/dist/runtime/editor/helpers/options/index.js +5 -0
  267. package/dist/runtime/editor/icons/svg/stars.svg +5 -1
  268. package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
  269. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
  270. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +15 -4
  271. package/dist/runtime/editor/plugins/Sidebar/index.vue +4 -2
  272. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +15 -4
  273. package/dist/runtime/editor/providers/analyze.d.ts +43 -0
  274. package/dist/runtime/editor/providers/analyze.js +78 -0
  275. package/dist/runtime/editor/providers/animation.d.ts +4 -0
  276. package/dist/runtime/editor/providers/animation.js +6 -0
  277. package/dist/runtime/editor/providers/definition.d.ts +2 -2
  278. package/dist/runtime/editor/providers/definition.js +7 -1
  279. package/dist/runtime/editor/providers/dom.d.ts +5 -0
  280. package/dist/runtime/editor/providers/dom.js +11 -2
  281. package/dist/runtime/editor/providers/dragdrop.d.ts +55 -0
  282. package/dist/runtime/editor/providers/dragdrop.js +37 -0
  283. package/dist/runtime/editor/providers/fields.d.ts +19 -1
  284. package/dist/runtime/editor/providers/fields.js +54 -2
  285. package/dist/runtime/editor/providers/storage.js +15 -0
  286. package/dist/runtime/editor/providers/ui.d.ts +6 -0
  287. package/dist/runtime/editor/providers/ui.js +19 -0
  288. package/dist/runtime/editor/translations/de.json +338 -58
  289. package/dist/runtime/editor/translations/fr.json +331 -51
  290. package/dist/runtime/editor/translations/gsw_CH.json +336 -56
  291. package/dist/runtime/editor/translations/it.json +331 -51
  292. package/dist/runtime/editor/types/app.d.ts +4 -2
  293. package/dist/runtime/editor/types/draggable.d.ts +1 -0
  294. package/dist/runtime/editor/types/ui.d.ts +1 -1
  295. package/dist/runtime/helpers/imports/index.d.ts +8 -1
  296. package/dist/runtime/helpers/imports/index.js +15 -6
  297. package/dist/runtime/helpers/injections.d.ts +6 -2
  298. package/dist/runtime/helpers/injections.js +3 -0
  299. package/dist/runtime/helpers/runtimeHelpers/index.js +14 -0
  300. package/dist/runtime/types/blockOptions.d.ts +2 -1
  301. package/dist/runtime/types/definitions.d.ts +12 -5
  302. package/dist/runtime/types/provider.d.ts +2 -0
  303. package/dist/shared/editor.6D5vApr0.mjs +30 -0
  304. package/dist/shared/{editor.DMFfaLVE.mjs → editor.BFIzNSQM.mjs} +1 -30
  305. package/dist/shared/{editor.Iax3GCvt.d.mts → editor.BdBm1Z7C.d.mts} +34 -0
  306. package/dist/types.d.mts +1 -1
  307. package/package.json +21 -3
  308. package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +0 -104
  309. package/dist/runtime/editor/features/clipboard/List/Item/File.d.vue.ts +0 -4
  310. package/dist/runtime/editor/features/clipboard/List/Item/File.vue +0 -60
  311. package/dist/runtime/editor/features/clipboard/List/Item/File.vue.d.ts +0 -4
  312. package/dist/runtime/editor/features/clipboard/List/Item/Video.d.vue.ts +0 -4
  313. package/dist/runtime/editor/features/clipboard/List/Item/Video.vue.d.ts +0 -4
  314. package/dist/runtime/editor/features/clipboard/List/index.vue +0 -72
  315. package/dist/runtime/editor/features/tour/Popup/index.d.vue.ts +0 -9
  316. package/dist/runtime/editor/features/tour/Popup/index.vue +0 -34
  317. package/dist/runtime/editor/features/tour/Popup/index.vue.d.ts +0 -9
  318. package/dist/runtime/editor/providers/dropArea.d.ts +0 -48
  319. package/dist/runtime/editor/providers/dropArea.js +0 -22
  320. /package/dist/modules/agent/runtime/app/tools/{get_available_bundles → analyze_content}/index.d.ts +0 -0
@@ -3,7 +3,12 @@ import { fileURLToPath } from 'node:url';
3
3
  import * as path from 'node:path';
4
4
  import { d as defineBlokkliModule } from '../../shared/editor.CGf7C_0M.mjs';
5
5
  import * as fs from 'node:fs';
6
- import { C as Collector, a as CollectedFile, d as defineCodeTemplate } from '../../shared/editor.DMFfaLVE.mjs';
6
+ import { C as Collector, a as CollectedFile } from '../../shared/editor.BFIzNSQM.mjs';
7
+ import { d as defineCodeTemplate } from '../../shared/editor.6D5vApr0.mjs';
8
+ import MagicString from 'magic-string';
9
+ import { parse } from 'acorn';
10
+ import { walk } from 'estree-walker-ts';
11
+ import { transformSync } from 'esbuild';
7
12
 
8
13
  function toImportName(prefix, fileName) {
9
14
  const name = fileName.split(/[-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
@@ -90,7 +95,7 @@ class AgentCollector extends Collector {
90
95
  }
91
96
  }
92
97
 
93
- function createClientTemplate(toolCollector, promptCollector, defaultPrompts, models, agentName) {
98
+ function createClientTemplate(toolCollector, promptCollector, options) {
94
99
  return defineCodeTemplate(
95
100
  "agent-client",
96
101
  (ctx) => {
@@ -126,10 +131,15 @@ function createClientTemplate(toolCollector, promptCollector, defaultPrompts, mo
126
131
  );
127
132
  }
128
133
  exports$1.push(
129
- `export const defaultPrompts = ${JSON.stringify(defaultPrompts)}`
134
+ `export const defaultPrompts = ${JSON.stringify(options.defaultPrompts ?? [])}`
135
+ );
136
+ exports$1.push(`export const models = ${JSON.stringify(options.models)}`);
137
+ exports$1.push(
138
+ `export const agentName = ${JSON.stringify(options.agentName ?? "Superbl\xF6kkli")}`
139
+ );
140
+ exports$1.push(
141
+ `export const hasWebFetch = ${JSON.stringify(!!options.allowedFetchOrigins)}`
130
142
  );
131
- exports$1.push(`export const models = ${JSON.stringify(models)}`);
132
- exports$1.push(`export const agentName = ${JSON.stringify(agentName)}`);
133
143
  const parts = [];
134
144
  if (imports.length > 0) {
135
145
  parts.push(imports.join("\n"));
@@ -138,14 +148,15 @@ function createClientTemplate(toolCollector, promptCollector, defaultPrompts, mo
138
148
  return parts.join("\n\n") + "\n";
139
149
  },
140
150
  () => {
141
- return `import type { McpToolItem, AgentPromptItem } from '#blokkli/agent/app/types'
151
+ return `import type { McpToolDefinition, AgentPromptItem } from '#blokkli/agent/app/types'
142
152
  import type { AgentModelDefinition } from '#blokkli/agent/shared/types'
143
153
 
144
- export const mcpTools: McpToolItem[]
154
+ export const mcpTools: McpToolDefinition[]
145
155
  export const agentPrompts: AgentPromptItem[]
146
156
  export const defaultPrompts: string[]
147
157
  export const agentName: string
148
158
  export const models: AgentModelDefinition[]
159
+ export const hasWebFetch: boolean
149
160
  `;
150
161
  }
151
162
  );
@@ -159,7 +170,8 @@ function createServerTemplate(options) {
159
170
  skillsCollector,
160
171
  skillsTypesPath,
161
172
  systemPromptCollector,
162
- systemPromptTypesPath
173
+ systemPromptTypesPath,
174
+ mcpToolsCollector
163
175
  } = options;
164
176
  const { allowedFetchOrigins, provider, models } = moduleOptions;
165
177
  return defineCodeTemplate(
@@ -191,6 +203,15 @@ function createServerTemplate(options) {
191
203
  const systemPromptsExport = systemPrompts.length === 0 ? `export const systemPrompts = []` : `export const systemPrompts = [
192
204
  ${systemPrompts.map((sp) => sp.importName).join(",\n ")}
193
205
  ]`;
206
+ const tools = mcpToolsCollector.getItems();
207
+ for (const tool of tools) {
208
+ imports.push(
209
+ `import ${tool.importName} from '${rel(tool.filePath)}?blokkliAgentTool'`
210
+ );
211
+ }
212
+ const toolDefinitionsExport = tools.length === 0 ? `export const toolDefinitions = []` : `export const toolDefinitions = [
213
+ ${tools.map((t) => t.importName).join(",\n ")},
214
+ ].filter(v => v !== null)`;
194
215
  const originsJson = JSON.stringify(allowedFetchOrigins, null, 2);
195
216
  return `${imports.join("\n")}
196
217
 
@@ -204,6 +225,8 @@ export const debugPrompt = ${!!moduleOptions.debugPrompt}
204
225
  ${skillsExport}
205
226
 
206
227
  ${systemPromptsExport}
228
+
229
+ ${toolDefinitionsExport}
207
230
  `;
208
231
  },
209
232
  (ctx) => {
@@ -211,7 +234,7 @@ ${systemPromptsExport}
211
234
  return `import type { AIProvider } from '${rel(providersPath)}/types'
212
235
  import type { SkillDefinition } from '${rel(skillsTypesPath)}'
213
236
  import type { SystemPromptDefinition } from '${rel(systemPromptTypesPath)}'
214
- import type { AgentModelDefinition } from '${rel(sharedTypesPath)}'
237
+ import type { AgentModelDefinition, ServerToolMetadata } from '${rel(sharedTypesPath)}'
215
238
 
216
239
  export const allowedFetchOrigins: string[]
217
240
  export const provider: AIProvider
@@ -219,6 +242,7 @@ export const models: AgentModelDefinition[]
219
242
  export const debugPrompt: boolean
220
243
  export const skills: SkillDefinition[]
221
244
  export const systemPrompts: SystemPromptDefinition[]
245
+ export const toolDefinitions: ServerToolMetadata[]
222
246
  `;
223
247
  },
224
248
  {
@@ -228,6 +252,206 @@ export const systemPrompts: SystemPromptDefinition[]
228
252
  );
229
253
  }
230
254
 
255
+ const QUERY = "?blokkliAgentTool";
256
+ const PROPERTIES_TO_REMOVE = /* @__PURE__ */ new Set([
257
+ "execute",
258
+ "resultSchema",
259
+ "component",
260
+ "label",
261
+ "prunedSummary",
262
+ "mockParams",
263
+ "mockParamsVariants",
264
+ "requiresApproval",
265
+ "icon"
266
+ ]);
267
+ const SERVER_SAFE_IMPORTS = /* @__PURE__ */ new Set([
268
+ "zod",
269
+ "../schemas",
270
+ "#blokkli/agent/app/tools/schemas",
271
+ "../chart_schemas",
272
+ "#blokkli-build/charts-config"
273
+ ]);
274
+ function isServerSafeImport(source) {
275
+ return SERVER_SAFE_IMPORTS.has(source);
276
+ }
277
+ function agentToolStripPlugin() {
278
+ return {
279
+ name: "blokkli:agent-tool-strip",
280
+ resolveId(source, importer) {
281
+ if (!source.includes(QUERY)) return null;
282
+ const cleanPath = source.replace(QUERY, "");
283
+ let resolved;
284
+ if (importer && (cleanPath.startsWith(".") || cleanPath.startsWith("/"))) {
285
+ const importerDir = path.dirname(importer);
286
+ resolved = path.resolve(importerDir, cleanPath);
287
+ } else {
288
+ resolved = cleanPath;
289
+ }
290
+ if (!fs.existsSync(resolved) && fs.existsSync(resolved + ".ts")) {
291
+ resolved = resolved + ".ts";
292
+ }
293
+ return resolved + QUERY;
294
+ },
295
+ load(id) {
296
+ if (!id.includes(QUERY)) return null;
297
+ const filePath = id.replace(QUERY, "");
298
+ let rawSource;
299
+ try {
300
+ rawSource = fs.readFileSync(filePath, "utf-8");
301
+ } catch {
302
+ this.error(`Cannot read agent tool file: ${filePath}`);
303
+ }
304
+ const { code: jsSource } = transformSync(rawSource, {
305
+ loader: "ts",
306
+ format: "esm",
307
+ target: "esnext"
308
+ });
309
+ return transformToolSource(jsSource, filePath);
310
+ }
311
+ };
312
+ }
313
+ function findToolExport(ast) {
314
+ let result = null;
315
+ walk(ast, {
316
+ enter(node) {
317
+ if (result) return;
318
+ let callExpr = null;
319
+ if (node.type === "ExportDefaultDeclaration") {
320
+ const decl = node.declaration;
321
+ if (decl?.type === "CallExpression" && decl.callee?.type === "Identifier" && decl.callee.name === "defineBlokkliAgentTool") {
322
+ callExpr = decl;
323
+ }
324
+ }
325
+ if (node.type === "VariableDeclarator") {
326
+ const init = node.init;
327
+ if (init?.type === "CallExpression" && init.callee?.type === "Identifier" && init.callee.name === "defineBlokkliAgentTool") {
328
+ callExpr = init;
329
+ }
330
+ }
331
+ if (!callExpr) return;
332
+ const arg = callExpr.arguments[0];
333
+ if (arg?.type !== "ObjectExpression") return;
334
+ const toolObject = arg;
335
+ result = { toolObject, call: callExpr };
336
+ },
337
+ leave() {
338
+ }
339
+ });
340
+ return result;
341
+ }
342
+ const REQUIRED_PROPERTIES = /* @__PURE__ */ new Set([
343
+ "name",
344
+ "description",
345
+ "category",
346
+ "paramsSchema"
347
+ ]);
348
+ function validateTransformedOutput(output, filePath) {
349
+ let ast;
350
+ try {
351
+ ast = parse(output, {
352
+ sourceType: "module",
353
+ ecmaVersion: "latest"
354
+ });
355
+ } catch (e) {
356
+ return `Transformed output is not valid JavaScript${filePath ? ` (${filePath})` : ""}: ${e}`;
357
+ }
358
+ let exportedObject = null;
359
+ walk(ast, {
360
+ enter(node) {
361
+ if (exportedObject) return;
362
+ if (node.type === "ExportDefaultDeclaration") {
363
+ const decl = node.declaration;
364
+ if (decl?.type === "ObjectExpression") {
365
+ exportedObject = decl;
366
+ }
367
+ }
368
+ if (node.type === "VariableDeclarator") {
369
+ const id = node.id;
370
+ const init = node.init;
371
+ if (id?.type === "Identifier" && id.name === "stdin_default" && init?.type === "ObjectExpression") {
372
+ exportedObject = init;
373
+ }
374
+ }
375
+ },
376
+ leave() {
377
+ }
378
+ });
379
+ if (!exportedObject) {
380
+ return `No default-exported object found in transformed output${filePath ? ` (${filePath})` : ""}`;
381
+ }
382
+ const foundProps = /* @__PURE__ */ new Set();
383
+ for (const prop of exportedObject.properties) {
384
+ if (prop.type !== "Property") continue;
385
+ const key = prop.key;
386
+ if (key.type === "Identifier") {
387
+ foundProps.add(key.name);
388
+ } else if (key.type === "Literal" && typeof key.value === "string") {
389
+ foundProps.add(key.value);
390
+ }
391
+ }
392
+ const missing = [...REQUIRED_PROPERTIES].filter((p) => !foundProps.has(p));
393
+ if (missing.length > 0) {
394
+ return `Transformed tool output is missing required properties: ${missing.join(", ")}${filePath ? ` (${filePath})` : ""}`;
395
+ }
396
+ return null;
397
+ }
398
+ function transformToolSource(source, filePath) {
399
+ const ast = parse(source, {
400
+ sourceType: "module",
401
+ ecmaVersion: "latest"
402
+ });
403
+ const exportInfo = findToolExport(ast);
404
+ if (!exportInfo) {
405
+ return source;
406
+ }
407
+ const s = new MagicString(source);
408
+ const { toolObject, call } = exportInfo;
409
+ walk(ast, {
410
+ enter(node) {
411
+ if (node.type !== "ImportDeclaration") return;
412
+ const importDecl = node;
413
+ const importSource = importDecl.source.value;
414
+ if (!isServerSafeImport(importSource)) {
415
+ let removeEnd = importDecl.end;
416
+ if (source[removeEnd] === "\n") {
417
+ removeEnd++;
418
+ }
419
+ s.remove(importDecl.start, removeEnd);
420
+ }
421
+ },
422
+ leave() {
423
+ }
424
+ });
425
+ for (const prop of toolObject.properties) {
426
+ if (prop.type !== "Property") continue;
427
+ const key = prop.key;
428
+ let name = null;
429
+ if (key.type === "Identifier") {
430
+ name = key.name;
431
+ } else if (key.type === "Literal" && typeof key.value === "string") {
432
+ name = key.value;
433
+ }
434
+ if (name && PROPERTIES_TO_REMOVE.has(name)) {
435
+ const propNode = prop;
436
+ let removeEnd = propNode.end;
437
+ const afterProp = source.substring(removeEnd);
438
+ const commaMatch = afterProp.match(/^\s*,/);
439
+ if (commaMatch) {
440
+ removeEnd += commaMatch[0].length;
441
+ }
442
+ s.remove(propNode.start, removeEnd);
443
+ }
444
+ }
445
+ s.overwrite(call.start, toolObject.start, "");
446
+ s.overwrite(toolObject.end, call.end, "");
447
+ const result = s.toString();
448
+ const error = validateTransformedOutput(result, filePath);
449
+ if (error) {
450
+ throw new Error(error);
451
+ }
452
+ return result;
453
+ }
454
+
231
455
  const AGENT_ROUTE = "/api/blokkli/agent";
232
456
  const FETCH_ROUTE = "/api/blokkli/agent/fetch";
233
457
  const index = defineBlokkliModule({
@@ -283,15 +507,19 @@ export default defineNuxtConfig({
283
507
  "#blokkli/agent/server",
284
508
  moduleResolver.resolve("./runtime/server")
285
509
  );
510
+ const moduleBlokkliDirs = ctx.helper.options.blokkliDirs || [];
286
511
  const moduleToolsDir = moduleResolver.resolve("./runtime/app/tools");
287
512
  const projectToolsDir = path.resolve(nuxt.options.rootDir, "blokkli/tools");
288
513
  const mcpTools = new AgentCollector(ctx.helper, {
289
514
  composable: "defineBlokkliAgentTool",
290
515
  importPrefix: "tool",
291
516
  dependency: "agent-mcp-tools",
292
- dirs: [moduleToolsDir, projectToolsDir]
517
+ dirs: [
518
+ moduleToolsDir,
519
+ projectToolsDir,
520
+ ...moduleBlokkliDirs.map((d) => path.join(d, "tools"))
521
+ ]
293
522
  });
294
- await mcpTools.init();
295
523
  ctx.context.addCollector(mcpTools);
296
524
  const projectPromptsDir = path.resolve(
297
525
  nuxt.options.rootDir,
@@ -301,18 +529,14 @@ export default defineNuxtConfig({
301
529
  composable: "defineBlokkliAgentPrompt",
302
530
  importPrefix: "prompt",
303
531
  dependency: "agent-prompts",
304
- dirs: [projectPromptsDir]
532
+ dirs: [
533
+ projectPromptsDir,
534
+ ...moduleBlokkliDirs.map((d) => path.join(d, "prompts"))
535
+ ]
305
536
  });
306
- await promptsCollector.init();
307
537
  ctx.context.addCollector(promptsCollector);
308
538
  ctx.context.addTemplate(
309
- createClientTemplate(
310
- mcpTools,
311
- promptsCollector,
312
- options.defaultPrompts || [],
313
- options.models,
314
- options.agentName ?? "Blocki"
315
- )
539
+ createClientTemplate(mcpTools, promptsCollector, options)
316
540
  );
317
541
  const relativeToolsDir = path.relative(
318
542
  nuxt.options.buildDir,
@@ -326,6 +550,11 @@ export default defineNuxtConfig({
326
550
  projectPromptsDir
327
551
  );
328
552
  nuxt.options.typescript.tsConfig.include.push(relativePromptsDir);
553
+ for (const dir of moduleBlokkliDirs) {
554
+ const toolsDir = path.join(dir, "tools");
555
+ const relDir = path.relative(nuxt.options.buildDir, toolsDir);
556
+ nuxt.options.typescript.tsConfig.include.push(relDir);
557
+ }
329
558
  const moduleSkillsDir = moduleResolver.resolve(
330
559
  "./runtime/server/default-skills"
331
560
  );
@@ -337,9 +566,12 @@ export default defineNuxtConfig({
337
566
  composable: "defineBlokkliAgentSkill",
338
567
  importPrefix: "skill",
339
568
  dependency: "agent-server",
340
- dirs: [moduleSkillsDir, projectSkillsDir]
569
+ dirs: [
570
+ moduleSkillsDir,
571
+ projectSkillsDir,
572
+ ...moduleBlokkliDirs.map((d) => path.join(d, "skills"))
573
+ ]
341
574
  });
342
- await skillsCollector.init();
343
575
  ctx.context.addCollector(skillsCollector);
344
576
  const moduleSystemPromptsDir = moduleResolver.resolve(
345
577
  "./runtime/server/default-system-prompts"
@@ -352,9 +584,12 @@ export default defineNuxtConfig({
352
584
  composable: "defineBlokkliAgentSystemPrompt",
353
585
  importPrefix: "systemPrompt",
354
586
  dependency: "agent-server",
355
- dirs: [moduleSystemPromptsDir, projectSystemPromptsDir]
587
+ dirs: [
588
+ moduleSystemPromptsDir,
589
+ projectSystemPromptsDir,
590
+ ...moduleBlokkliDirs.map((d) => path.join(d, "system-prompts"))
591
+ ]
356
592
  });
357
- await systemPromptCollector.init();
358
593
  ctx.context.addCollector(systemPromptCollector);
359
594
  ctx.context.addTemplate(
360
595
  createServerTemplate({
@@ -368,7 +603,8 @@ export default defineNuxtConfig({
368
603
  systemPromptCollector,
369
604
  systemPromptTypesPath: moduleResolver.resolve(
370
605
  "./runtime/server/system-prompts/types"
371
- )
606
+ ),
607
+ mcpToolsCollector: mcpTools
372
608
  })
373
609
  );
374
610
  addServerHandler({
@@ -394,6 +630,18 @@ export default defineNuxtConfig({
394
630
  nitroConfig.typescript.tsConfig.include ||= [];
395
631
  nitroConfig.typescript.tsConfig.include.push(relativeSkillsDir);
396
632
  nitroConfig.typescript.tsConfig.include.push(relativeSystemPromptsDir);
633
+ nitroConfig.rollupConfig ||= {};
634
+ nitroConfig.rollupConfig.plugins ||= [];
635
+ nitroConfig.rollupConfig.plugins.push(
636
+ agentToolStripPlugin()
637
+ );
638
+ nitroConfig.alias ||= {};
639
+ nitroConfig.alias["#blokkli/agent/app/tools/schemas"] = moduleResolver.resolve("./runtime/app/tools/schemas");
640
+ for (const [key, value] of Object.entries(nuxt.options.alias)) {
641
+ if (key.startsWith("#blokkli/") && !nitroConfig.alias[key]) {
642
+ nitroConfig.alias[key] = value;
643
+ }
644
+ }
397
645
  });
398
646
  nuxt.hook("nitro:init", (nitro) => {
399
647
  nitro.hooks.hook("types:extend", (types) => {
@@ -1,6 +1,6 @@
1
1
  import { type Ref } from '#imports';
2
2
  import { type Attachment, type ConversationItem, type ActiveItem, type MutationAction } from '#blokkli/agent/app/types';
3
- import type { ClientPlanState, UsageTurn } from '#blokkli/agent/shared/types';
3
+ import type { ClientPlanState, UsageTurn, Transcript } from '#blokkli/agent/shared/types';
4
4
  import type { AgentConversationSummary } from '#blokkli/agent/app/features/agent/types';
5
5
  import type { BlokkliApp } from '#blokkli/editor/types/app';
6
6
  import type { FullBlokkliAdapter } from '#blokkli/editor/adapter';
@@ -43,7 +43,7 @@ export type AgentProvider = {
43
43
  newConversation: () => void;
44
44
  getTranscript: () => void;
45
45
  onToolComponentDone: (result: unknown) => void;
46
- transcriptContent: Ref<string>;
46
+ transcriptContent: Ref<Transcript | null>;
47
47
  showTranscript: Ref<boolean>;
48
48
  conversationList: Ref<AgentConversationSummary[]>;
49
49
  showConversationList: Ref<boolean>;
@@ -6,7 +6,7 @@ import {
6
6
  createToolMap,
7
7
  executeTool,
8
8
  getToolCategory,
9
- getToolsForServer,
9
+ getToolInfoForServer,
10
10
  getToolDefinition,
11
11
  isMutationAction,
12
12
  isQueryResult,
@@ -38,7 +38,7 @@ export default function(app, adapter, agentName) {
38
38
  const pendingToolCall = ref(null);
39
39
  let pendingToolCallResolve = null;
40
40
  const plan = ref(null);
41
- const transcriptContent = ref("");
41
+ const transcriptContent = ref(null);
42
42
  const showTranscript = ref(false);
43
43
  const activeConversationId = ref(null);
44
44
  const conversationList = ref([]);
@@ -251,6 +251,19 @@ export default function(app, adapter, agentName) {
251
251
  const ctx = createToolContext();
252
252
  const resolved = await resolveTools(mcpTools, ctx);
253
253
  toolMap = createToolMap(resolved);
254
+ const toolNames = getToolInfoForServer(
255
+ resolved,
256
+ state.editMode.value,
257
+ adapter
258
+ );
259
+ let contentSearchTabs;
260
+ if (adapter.getContentSearchTabs) {
261
+ try {
262
+ contentSearchTabs = await adapter.getContentSearchTabs();
263
+ } catch (e) {
264
+ console.warn("[blokkli agent] Failed to fetch content search tabs:", e);
265
+ }
266
+ }
254
267
  if (adapter.getAgentAuthToken) {
255
268
  try {
256
269
  const authToken = await adapter.getAgentAuthToken();
@@ -264,26 +277,21 @@ export default function(app, adapter, agentName) {
264
277
  disconnect();
265
278
  return;
266
279
  }
280
+ const pageContext = await buildPageContext(contentSearchTabs);
281
+ pendingInit = { toolNames, pageContext };
267
282
  send({ type: "authenticate", authToken });
268
- pendingInit = {
269
- tools: getToolsForServer(resolved, state.editMode.value, adapter),
270
- pageContext: buildPageContext()
271
- };
272
283
  return;
273
284
  } catch (e) {
274
285
  console.error("Failed to obtain agent auth token:", e);
275
286
  }
276
287
  }
277
- sendInit(
278
- getToolsForServer(resolved, state.editMode.value, adapter),
279
- buildPageContext()
280
- );
288
+ sendInit(toolNames, await buildPageContext(contentSearchTabs));
281
289
  }
282
- async function sendInit(tools, pageContext) {
283
- send({ type: "init", tools, pageContext });
290
+ async function sendInit(toolNames, pageContext) {
291
+ send({ type: "init", toolNames, pageContext });
284
292
  isReady.value = true;
285
293
  hasBeenReady.value = true;
286
- if (adapter.agentConversations) {
294
+ if (adapter.agentConversations && !pendingPrompt) {
287
295
  try {
288
296
  const latest = await adapter.agentConversations.loadLatest();
289
297
  if (latest) {
@@ -305,7 +313,7 @@ export default function(app, adapter, agentName) {
305
313
  sendPrompt(prompt, displayPrompt, selectedUuids, attachments);
306
314
  }
307
315
  }
308
- function buildPageContext() {
316
+ async function buildPageContext(contentSearchTabs) {
309
317
  const { types, definitions } = app;
310
318
  const bundles = [];
311
319
  for (const bundle of types.generallyAvailableBundles) {
@@ -360,6 +368,13 @@ export default function(app, adapter, agentName) {
360
368
  allowed: f.allowed
361
369
  }))
362
370
  ];
371
+ await app.analyze.ensureInitialized();
372
+ const analyzersList = app.analyze.analyzers.value.filter((a) => !a.requireRawPage).map((a) => ({
373
+ id: a.id,
374
+ type: a.type,
375
+ label: typeof a.label === "function" ? a.label(context.value.language) : a.label,
376
+ description: typeof a.description === "function" ? a.description(context.value.language) : a.description
377
+ }));
363
378
  const pageContext = {
364
379
  title: state.entity.value.label || "",
365
380
  entityType: context.value.entityType,
@@ -373,7 +388,9 @@ export default function(app, adapter, agentName) {
373
388
  isPublished: state.entity.value.status ?? null,
374
389
  editMode: state.editMode.value,
375
390
  fragments,
376
- entityContentFields
391
+ entityContentFields,
392
+ ...contentSearchTabs?.length ? { contentSearchTabs } : {},
393
+ ...analyzersList.length ? { analyzers: analyzersList } : {}
377
394
  };
378
395
  return pageContext;
379
396
  }
@@ -412,7 +429,7 @@ export default function(app, adapter, agentName) {
412
429
  switch (data.type) {
413
430
  case "authenticated":
414
431
  if (pendingInit) {
415
- sendInit(pendingInit.tools, pendingInit.pageContext);
432
+ sendInit(pendingInit.toolNames, pendingInit.pageContext);
416
433
  pendingInit = null;
417
434
  }
418
435
  break;
@@ -492,7 +509,7 @@ export default function(app, adapter, agentName) {
492
509
  }
493
510
  break;
494
511
  case "transcript":
495
- transcriptContent.value = data.content;
512
+ transcriptContent.value = data.transcript;
496
513
  showTranscript.value = true;
497
514
  break;
498
515
  case "conversation_state":
@@ -1,4 +1,4 @@
1
- import type { McpToolDefinition, McpToolCategory, McpToolFactoryInput, McpToolFactory } from '#blokkli/agent/app/types';
1
+ import type { McpToolDefinition, McpToolCategory } from '#blokkli/agent/app/types';
2
2
  import type { AdapterMethods } from '#blokkli/editor/adapter';
3
3
  import type { z } from 'zod';
4
4
  import type { Component } from 'vue';
@@ -7,7 +7,7 @@ import type { Component } from 'vue';
7
7
  *
8
8
  * Tools are defined once and compiled into two bundles:
9
9
  * - Client bundle: Full definition with execute function (for Vue component)
10
- * - Server bundle: Tools are sent dynamically via WebSocket on init
10
+ * - Server bundle: Static metadata extracted at build time
11
11
  *
12
12
  * The Zod schemas provide:
13
13
  * - Type-safe parameter and result definitions with TypeScript inference
@@ -43,23 +43,5 @@ import type { Component } from 'vue';
43
43
  * },
44
44
  * })
45
45
  * ```
46
- *
47
- * @example Factory pattern for dynamic tools:
48
- * ```typescript
49
- * export default defineBlokkliAgentTool({
50
- * resolve: async (ctx) => {
51
- * if (!ctx.adapter.getContentSearchTabs) return []
52
- * const tabs = await ctx.adapter.getContentSearchTabs()
53
- * return Object.entries(tabs).map(([id, label]) =>
54
- * defineBlokkliAgentTool({
55
- * name: `search_${id}`,
56
- * requiredAdapterMethods: ['getContentSearchResults'],
57
- * // ... each tool has full type safety
58
- * })
59
- * )
60
- * },
61
- * })
62
- * ```
63
46
  */
64
47
  export declare function defineBlokkliAgentTool<TParamsSchema extends z.ZodType, TResultSchema extends z.ZodType, const TMethods extends readonly AdapterMethods[] = readonly [], TComponent extends Component | undefined = undefined, TCategory extends McpToolCategory = McpToolCategory>(options: McpToolDefinition<TParamsSchema, TResultSchema, TMethods, TComponent, TCategory>): McpToolDefinition<TParamsSchema, TResultSchema, TMethods, TComponent, TCategory>;
65
- export declare function defineBlokkliAgentTool(options: McpToolFactoryInput): McpToolFactory;
@@ -1,6 +1,3 @@
1
1
  export function defineBlokkliAgentTool(options) {
2
- if ("resolve" in options) {
3
- return { ...options, __factory: true };
4
- }
5
2
  return options;
6
3
  }
@@ -16,13 +16,13 @@ const props = defineProps({
16
16
  });
17
17
  const { state } = useBlokkli();
18
18
  const contentEl = ref();
19
- marked.setOptions({ gfm: true, breaks: true });
20
19
  function renderContent(content) {
21
20
  const container = contentEl.value;
22
21
  if (!container) return;
23
22
  const ownerName = state.owner.value?.name || "";
24
23
  container.innerHTML = marked.parse(
25
- content.replaceAll(PLACEHOLDER_USER_NAME, ownerName)
24
+ content.replaceAll(PLACEHOLDER_USER_NAME, ownerName),
25
+ { gfm: true, breaks: true }
26
26
  );
27
27
  }
28
28
  watch(
@@ -22,8 +22,7 @@ const props = defineProps({
22
22
  content: { type: String, required: true },
23
23
  attachments: { type: Array, required: false }
24
24
  });
25
- marked.setOptions({ gfm: true, breaks: true });
26
25
  const html = computed(() => {
27
- return props.content ? marked.parse(props.content) : "";
26
+ return props.content ? marked.parse(props.content, { gfm: true, breaks: true }) : "";
28
27
  });
29
28
  </script>
@@ -47,7 +47,6 @@ import { computed } from "#imports";
47
47
  import Conversation from "../Conversation/index.vue";
48
48
  import PendingMutation from "../PendingMutation/index.vue";
49
49
  import { mcpTools } from "#blokkli-build/agent-client";
50
- import { isToolDefinition } from "#blokkli/agent/app/helpers";
51
50
  const mockContext = {
52
51
  app: null,
53
52
  itemEntityType: "paragraph",
@@ -153,7 +152,7 @@ const mockMutations = [
153
152
  }
154
153
  ];
155
154
  const toolsWithMockParams = computed(
156
- () => mcpTools.filter(isToolDefinition).filter(
155
+ () => mcpTools.filter(
157
156
  (tool) => !!tool.component && !!tool.mockParams
158
157
  )
159
158
  );
@@ -4,6 +4,7 @@ type __VLS_Props = {
4
4
  isConnected: boolean;
5
5
  canSubmit: boolean;
6
6
  hasText: boolean;
7
+ hasConversation: boolean;
7
8
  usageTurns: UsageTurn[];
8
9
  };
9
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {