@blokkli/editor 2.0.0-alpha.31 → 2.0.0-alpha.33

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 (480) hide show
  1. package/dist/global/constants/index.d.ts +1 -0
  2. package/dist/global/constants/index.js +1 -0
  3. package/dist/global/types/blockOptions.d.ts +16 -0
  4. package/dist/global/types/features.d.ts +4 -0
  5. package/dist/module.d.mts +1 -24
  6. package/dist/module.json +1 -1
  7. package/dist/module.mjs +453 -10828
  8. package/dist/modules/agent/index.d.mts +64 -0
  9. package/dist/modules/agent/index.mjs +407 -0
  10. package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +55 -0
  11. package/dist/modules/agent/runtime/app/composables/agentProvider.js +875 -0
  12. package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentPrompt.d.ts +32 -0
  13. package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentPrompt.js +6 -0
  14. package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.d.ts +65 -0
  15. package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.js +6 -0
  16. package/dist/modules/agent/runtime/app/composables/index.d.ts +4 -0
  17. package/dist/modules/agent/runtime/app/composables/index.js +2 -0
  18. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.d.vue.ts +12 -0
  19. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.vue +62 -0
  20. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.vue.d.ts +12 -0
  21. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.d.vue.ts +9 -0
  22. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue +38 -0
  23. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue.d.ts +9 -0
  24. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.d.vue.ts +14 -0
  25. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.vue +68 -0
  26. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.vue.d.ts +14 -0
  27. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.d.vue.ts +10 -0
  28. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.vue +72 -0
  29. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.vue.d.ts +10 -0
  30. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.d.vue.ts +13 -0
  31. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.vue +37 -0
  32. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.vue.d.ts +13 -0
  33. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.d.vue.ts +8 -0
  34. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.vue +17 -0
  35. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.vue.d.ts +8 -0
  36. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.d.vue.ts +11 -0
  37. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue +29 -0
  38. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue.d.ts +11 -0
  39. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.d.vue.ts +12 -0
  40. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.vue +30 -0
  41. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.vue.d.ts +12 -0
  42. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.d.vue.ts +3 -0
  43. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.vue +14 -0
  44. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.vue.d.ts +3 -0
  45. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.d.vue.ts +13 -0
  46. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.vue +46 -0
  47. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.vue.d.ts +13 -0
  48. package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.d.vue.ts +15 -0
  49. package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.vue +50 -0
  50. package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.vue.d.ts +15 -0
  51. package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.d.vue.ts +3 -0
  52. package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +160 -0
  53. package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue.d.ts +3 -0
  54. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.d.vue.ts +12 -0
  55. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.vue +15 -0
  56. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.vue.d.ts +12 -0
  57. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.d.vue.ts +7 -0
  58. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.vue +67 -0
  59. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.vue.d.ts +7 -0
  60. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.d.vue.ts +23 -0
  61. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +109 -0
  62. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue.d.ts +23 -0
  63. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.d.vue.ts +45 -0
  64. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +120 -0
  65. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue.d.ts +45 -0
  66. package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.d.vue.ts +15 -0
  67. package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.vue +47 -0
  68. package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.vue.d.ts +15 -0
  69. package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.d.vue.ts +14 -0
  70. package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.vue +55 -0
  71. package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.vue.d.ts +14 -0
  72. package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.d.vue.ts +25 -0
  73. package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.vue +36 -0
  74. package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.vue.d.ts +25 -0
  75. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/de.md +19 -0
  76. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/en.md +18 -0
  77. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.d.vue.ts +10 -0
  78. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +44 -0
  79. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue.d.ts +10 -0
  80. package/dist/modules/agent/runtime/app/features/agent/Panel/index.d.vue.ts +58 -0
  81. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +274 -0
  82. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue.d.ts +58 -0
  83. package/dist/modules/agent/runtime/app/features/agent/index.d.vue.ts +3 -0
  84. package/dist/modules/agent/runtime/app/features/agent/index.vue +162 -0
  85. package/dist/modules/agent/runtime/app/features/agent/index.vue.d.ts +3 -0
  86. package/dist/modules/agent/runtime/app/features/agent/types.d.ts +58 -0
  87. package/dist/modules/agent/runtime/app/features/agent/types.js +0 -0
  88. package/dist/modules/agent/runtime/app/helpers/index.d.ts +55 -0
  89. package/dist/modules/agent/runtime/app/helpers/index.js +88 -0
  90. package/dist/modules/agent/runtime/app/helpers/pageStructure.d.ts +5 -0
  91. package/dist/modules/agent/runtime/app/helpers/pageStructure.js +106 -0
  92. package/dist/modules/agent/runtime/app/helpers/validation.d.ts +35 -0
  93. package/dist/modules/agent/runtime/app/helpers/validation.js +77 -0
  94. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.d.ts +2 -0
  95. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.js +69 -0
  96. package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +2 -0
  97. package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +83 -0
  98. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +2 -0
  99. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +62 -0
  100. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +2 -0
  101. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +289 -0
  102. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +2 -0
  103. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +76 -0
  104. package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +2 -0
  105. package/dist/modules/agent/runtime/app/tools/add_template/index.js +58 -0
  106. package/dist/modules/agent/runtime/app/tools/ask_question/Component.d.vue.ts +19 -0
  107. package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +113 -0
  108. package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue.d.ts +19 -0
  109. package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +17 -0
  110. package/dist/modules/agent/runtime/app/tools/ask_question/index.js +54 -0
  111. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.d.vue.ts +29 -0
  112. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.vue +190 -0
  113. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.vue.d.ts +29 -0
  114. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.d.vue.ts +20 -0
  115. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.vue +90 -0
  116. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.vue.d.ts +20 -0
  117. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/index.d.ts +18 -0
  118. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/index.js +55 -0
  119. package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +2 -0
  120. package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.js +47 -0
  121. package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +2 -0
  122. package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.js +47 -0
  123. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +2 -0
  124. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +144 -0
  125. package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -0
  126. package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.js +180 -0
  127. package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.d.ts +2 -0
  128. package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.js +33 -0
  129. package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.d.ts +2 -0
  130. package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +93 -0
  131. package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.d.ts +2 -0
  132. package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +104 -0
  133. package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.d.ts +2 -0
  134. package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.js +108 -0
  135. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +2 -0
  136. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +192 -0
  137. package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.d.ts +2 -0
  138. package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.js +102 -0
  139. package/dist/modules/agent/runtime/app/tools/get_page_structure/index.d.ts +2 -0
  140. package/dist/modules/agent/runtime/app/tools/get_page_structure/index.js +113 -0
  141. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +2 -0
  142. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +275 -0
  143. package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.d.ts +2 -0
  144. package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +63 -0
  145. package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +2 -0
  146. package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.js +180 -0
  147. package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.d.ts +2 -0
  148. package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +46 -0
  149. package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +2 -0
  150. package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.js +54 -0
  151. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +2 -0
  152. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +69 -0
  153. package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +2 -0
  154. package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.js +95 -0
  155. package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +2 -0
  156. package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.js +80 -0
  157. package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +2 -0
  158. package/dist/modules/agent/runtime/app/tools/replace_media_field/index.js +85 -0
  159. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +128 -0
  160. package/dist/modules/agent/runtime/app/tools/schemas.js +242 -0
  161. package/dist/modules/agent/runtime/app/tools/search_content/index.d.ts +2 -0
  162. package/dist/modules/agent/runtime/app/tools/search_content/index.js +65 -0
  163. package/dist/modules/agent/runtime/app/tools/search_media/index.d.ts +14 -0
  164. package/dist/modules/agent/runtime/app/tools/search_media/index.js +60 -0
  165. package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.d.ts +2 -0
  166. package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.js +75 -0
  167. package/dist/modules/agent/runtime/app/tools/search_templates/index.d.ts +2 -0
  168. package/dist/modules/agent/runtime/app/tools/search_templates/index.js +51 -0
  169. package/dist/modules/agent/runtime/app/tools/search_text/index.d.ts +2 -0
  170. package/dist/modules/agent/runtime/app/tools/search_text/index.js +114 -0
  171. package/dist/modules/agent/runtime/app/tools/select_media/Component.d.vue.ts +29 -0
  172. package/dist/modules/agent/runtime/app/tools/select_media/Component.vue +70 -0
  173. package/dist/modules/agent/runtime/app/tools/select_media/Component.vue.d.ts +29 -0
  174. package/dist/modules/agent/runtime/app/tools/select_media/index.d.ts +30 -0
  175. package/dist/modules/agent/runtime/app/tools/select_media/index.js +74 -0
  176. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +2 -0
  177. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +109 -0
  178. package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +2 -0
  179. package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.js +74 -0
  180. package/dist/modules/agent/runtime/app/tools/web_fetch/index.d.ts +2 -0
  181. package/dist/modules/agent/runtime/app/tools/web_fetch/index.js +51 -0
  182. package/dist/modules/agent/runtime/app/types/index.d.ts +440 -0
  183. package/dist/modules/agent/runtime/app/types/index.js +51 -0
  184. package/dist/modules/agent/runtime/server/Session.d.ts +94 -0
  185. package/dist/modules/agent/runtime/server/Session.js +734 -0
  186. package/dist/modules/agent/runtime/server/SessionManager.d.ts +21 -0
  187. package/dist/modules/agent/runtime/server/SessionManager.js +80 -0
  188. package/dist/modules/agent/runtime/server/agent.d.ts +2 -0
  189. package/dist/modules/agent/runtime/server/agent.js +148 -0
  190. package/dist/modules/agent/runtime/server/agentPrompt.d.ts +22 -0
  191. package/dist/modules/agent/runtime/server/agentPrompt.js +53 -0
  192. package/dist/modules/agent/runtime/server/default-skills/adding-new-paragraphs.d.ts +2 -0
  193. package/dist/modules/agent/runtime/server/default-skills/adding-new-paragraphs.js +21 -0
  194. package/dist/modules/agent/runtime/server/default-skills/pageReview.d.ts +2 -0
  195. package/dist/modules/agent/runtime/server/default-skills/pageReview.js +28 -0
  196. package/dist/modules/agent/runtime/server/default-skills/reusable-paragraphs.d.ts +2 -0
  197. package/dist/modules/agent/runtime/server/default-skills/reusable-paragraphs.js +21 -0
  198. package/dist/modules/agent/runtime/server/default-skills/rewriteAndTranslate.d.ts +2 -0
  199. package/dist/modules/agent/runtime/server/default-skills/rewriteAndTranslate.js +14 -0
  200. package/dist/modules/agent/runtime/server/default-system-prompts/architecture.d.ts +2 -0
  201. package/dist/modules/agent/runtime/server/default-system-prompts/architecture.js +39 -0
  202. package/dist/modules/agent/runtime/server/default-system-prompts/available-skills.d.ts +2 -0
  203. package/dist/modules/agent/runtime/server/default-system-prompts/available-skills.js +18 -0
  204. package/dist/modules/agent/runtime/server/default-system-prompts/available-tools.d.ts +2 -0
  205. package/dist/modules/agent/runtime/server/default-system-prompts/available-tools.js +18 -0
  206. package/dist/modules/agent/runtime/server/default-system-prompts/fragments.d.ts +2 -0
  207. package/dist/modules/agent/runtime/server/default-system-prompts/fragments.js +19 -0
  208. package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.d.ts +2 -0
  209. package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +22 -0
  210. package/dist/modules/agent/runtime/server/default-system-prompts/interaction.d.ts +2 -0
  211. package/dist/modules/agent/runtime/server/default-system-prompts/interaction.js +20 -0
  212. package/dist/modules/agent/runtime/server/default-system-prompts/introduction.d.ts +2 -0
  213. package/dist/modules/agent/runtime/server/default-system-prompts/introduction.js +14 -0
  214. package/dist/modules/agent/runtime/server/default-system-prompts/page-context.d.ts +2 -0
  215. package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +60 -0
  216. package/dist/modules/agent/runtime/server/default-system-prompts/paragraph-bundles.d.ts +2 -0
  217. package/dist/modules/agent/runtime/server/default-system-prompts/paragraph-bundles.js +37 -0
  218. package/dist/modules/agent/runtime/server/default-system-prompts/plan-mode.d.ts +2 -0
  219. package/dist/modules/agent/runtime/server/default-system-prompts/plan-mode.js +36 -0
  220. package/dist/modules/agent/runtime/server/default-system-prompts/security.d.ts +2 -0
  221. package/dist/modules/agent/runtime/server/default-system-prompts/security.js +27 -0
  222. package/dist/modules/agent/runtime/server/default-system-prompts/workflow.d.ts +2 -0
  223. package/dist/modules/agent/runtime/server/default-system-prompts/workflow.js +22 -0
  224. package/dist/modules/agent/runtime/server/fetch.d.ts +2 -0
  225. package/dist/modules/agent/runtime/server/fetch.js +127 -0
  226. package/dist/modules/agent/runtime/server/helpers.d.ts +77 -0
  227. package/dist/modules/agent/runtime/server/helpers.js +352 -0
  228. package/dist/modules/agent/runtime/server/providers/anthropic.d.ts +12 -0
  229. package/dist/modules/agent/runtime/server/providers/anthropic.js +128 -0
  230. package/dist/modules/agent/runtime/server/providers/openai.d.ts +12 -0
  231. package/dist/modules/agent/runtime/server/providers/openai.js +165 -0
  232. package/dist/modules/agent/runtime/server/providers/types.d.ts +74 -0
  233. package/dist/modules/agent/runtime/server/providers/types.js +0 -0
  234. package/dist/modules/agent/runtime/server/server-tools/complete_plan_step/index.d.ts +3 -0
  235. package/dist/modules/agent/runtime/server/server-tools/complete_plan_step/index.js +79 -0
  236. package/dist/modules/agent/runtime/server/server-tools/create_plan/index.d.ts +9 -0
  237. package/dist/modules/agent/runtime/server/server-tools/create_plan/index.js +86 -0
  238. package/dist/modules/agent/runtime/server/server-tools/index.d.ts +86 -0
  239. package/dist/modules/agent/runtime/server/server-tools/index.js +30 -0
  240. package/dist/modules/agent/runtime/server/server-tools/load_skill/index.d.ts +7 -0
  241. package/dist/modules/agent/runtime/server/server-tools/load_skill/index.js +58 -0
  242. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.d.ts +7 -0
  243. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +43 -0
  244. package/dist/modules/agent/runtime/server/skills/defineBlokkliAgentSkill.d.ts +23 -0
  245. package/dist/modules/agent/runtime/server/skills/defineBlokkliAgentSkill.js +3 -0
  246. package/dist/modules/agent/runtime/server/skills/index.d.ts +2 -0
  247. package/dist/modules/agent/runtime/server/skills/index.js +1 -0
  248. package/dist/modules/agent/runtime/server/skills/types.d.ts +45 -0
  249. package/dist/modules/agent/runtime/server/skills/types.js +0 -0
  250. package/dist/modules/agent/runtime/server/system-prompts/defineBlokkliAgentSystemPrompt.d.ts +21 -0
  251. package/dist/modules/agent/runtime/server/system-prompts/defineBlokkliAgentSystemPrompt.js +3 -0
  252. package/dist/modules/agent/runtime/server/system-prompts/helpers.d.ts +20 -0
  253. package/dist/modules/agent/runtime/server/system-prompts/helpers.js +41 -0
  254. package/dist/modules/agent/runtime/server/system-prompts/index.d.ts +2 -0
  255. package/dist/modules/agent/runtime/server/system-prompts/index.js +1 -0
  256. package/dist/modules/agent/runtime/server/system-prompts/types.d.ts +49 -0
  257. package/dist/modules/agent/runtime/server/system-prompts/types.js +0 -0
  258. package/dist/modules/agent/runtime/shared/placeholders.d.ts +4 -0
  259. package/dist/modules/agent/runtime/shared/placeholders.js +1 -0
  260. package/dist/modules/agent/runtime/shared/types.d.ts +426 -0
  261. package/dist/modules/agent/runtime/shared/types.js +147 -0
  262. package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +27 -2
  263. package/dist/modules/drupal/graphql/features/agent.graphql +69 -0
  264. package/dist/modules/drupal/graphql/features/search.graphql +5 -0
  265. package/dist/modules/drupal/graphql/features/templates.graphql +36 -2
  266. package/dist/modules/drupal/graphql/mutations/add_multiple.graphql +25 -0
  267. package/dist/modules/drupal/graphql/mutations/bulk_update_field_values.graphql +15 -0
  268. package/dist/modules/drupal/graphql/mutations/rearrange.graphql +23 -0
  269. package/dist/modules/drupal/graphql/mutations/replace_entity_reference.graphql +25 -0
  270. package/dist/modules/drupal/graphql/mutations/swap.graphql +16 -0
  271. package/dist/modules/drupal/index.d.mts +18 -2
  272. package/dist/modules/drupal/index.mjs +60 -12
  273. package/dist/modules/drupal/runtime/adapter/index.js +246 -21
  274. package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.d.vue.ts +9 -0
  275. package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.vue +26 -0
  276. package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.vue.d.ts +9 -0
  277. package/dist/runtime/components/Blocks/Fragment/index.vue +11 -2
  278. package/dist/runtime/components/BlokkliItem.vue +3 -1
  279. package/dist/runtime/composables/defineBlokkli.js +1 -3
  280. package/dist/runtime/composables/defineBlokkliFeature.d.ts +5 -3
  281. package/dist/runtime/composables/defineBlokkliFeature.js +2 -1
  282. package/dist/runtime/composables/defineBlokkliProvider.js +1 -3
  283. package/dist/runtime/editor/adapter/index.d.ts +45 -4
  284. package/dist/runtime/editor/adapter/index.js +3 -0
  285. package/dist/runtime/editor/components/Actions/ItemDropdown.vue +6 -1
  286. package/dist/runtime/editor/components/Actions/index.vue +4 -1
  287. package/dist/runtime/editor/components/AddListItem/index.d.vue.ts +9 -1
  288. package/dist/runtime/editor/components/AddListItem/index.vue +36 -2
  289. package/dist/runtime/editor/components/AddListItem/index.vue.d.ts +9 -1
  290. package/dist/runtime/editor/components/AnimationCanvas/index.vue +17 -7
  291. package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +3 -1
  292. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +4 -3
  293. package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +3 -1
  294. package/dist/runtime/editor/components/AutoHeight/index.d.vue.ts +16 -0
  295. package/dist/runtime/editor/components/AutoHeight/index.vue +32 -0
  296. package/dist/runtime/editor/components/AutoHeight/index.vue.d.ts +16 -0
  297. package/dist/runtime/editor/components/BlockPreviewItem/index.d.vue.ts +5 -1
  298. package/dist/runtime/editor/components/BlockPreviewItem/index.vue +10 -7
  299. package/dist/runtime/editor/components/BlockPreviewItem/index.vue.d.ts +5 -1
  300. package/dist/runtime/editor/components/DiffViewer/DiffValue.d.vue.ts +7 -0
  301. package/dist/runtime/editor/components/DiffViewer/DiffValue.vue +21 -0
  302. package/dist/runtime/editor/components/DiffViewer/DiffValue.vue.d.ts +7 -0
  303. package/dist/runtime/editor/components/DiffViewer/State.vue +4 -9
  304. package/dist/runtime/editor/components/EditProvider.vue +25 -4
  305. package/dist/runtime/editor/components/FeaturesRenderer/index.vue +26 -8
  306. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +31 -0
  307. package/dist/runtime/editor/components/FlexTextarea/index.vue +179 -0
  308. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +31 -0
  309. package/dist/runtime/editor/components/Form/Text/index.vue +23 -11
  310. package/dist/runtime/editor/components/Form/Toggle/index.d.vue.ts +1 -0
  311. package/dist/runtime/editor/components/Form/Toggle/index.vue +7 -3
  312. package/dist/runtime/editor/components/Form/Toggle/index.vue.d.ts +1 -0
  313. package/dist/runtime/editor/components/Icon/index.vue +3 -1
  314. package/dist/runtime/editor/components/Indicators/index.vue +20 -10
  315. package/dist/runtime/editor/components/ItemIcon/index.d.vue.ts +3 -0
  316. package/dist/runtime/editor/components/ItemIcon/index.vue +3 -2
  317. package/dist/runtime/editor/components/ItemIcon/index.vue.d.ts +3 -0
  318. package/dist/runtime/editor/components/ItemIconBox/index.vue +4 -1
  319. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +3 -1
  320. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +150 -71
  321. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +3 -1
  322. package/dist/runtime/editor/components/PluginConfigForm/index.vue +6 -2
  323. package/dist/runtime/editor/components/RelativeTime/index.d.vue.ts +3 -2
  324. package/dist/runtime/editor/components/RelativeTime/index.vue +21 -7
  325. package/dist/runtime/editor/components/RelativeTime/index.vue.d.ts +3 -2
  326. package/dist/runtime/editor/components/StatusIcon/index.d.vue.ts +9 -0
  327. package/dist/runtime/editor/components/StatusIcon/index.vue +31 -0
  328. package/dist/runtime/editor/components/StatusIcon/index.vue.d.ts +9 -0
  329. package/dist/runtime/editor/components/SystemRequirements/index.vue +5 -1
  330. package/dist/runtime/editor/components/Transition/Height.vue +3 -2
  331. package/dist/runtime/editor/components/Transition/index.d.vue.ts +1 -1
  332. package/dist/runtime/editor/components/Transition/index.vue +2 -1
  333. package/dist/runtime/editor/components/Transition/index.vue.d.ts +1 -1
  334. package/dist/runtime/editor/components/index.d.ts +10 -6
  335. package/dist/runtime/editor/components/index.js +19 -11
  336. package/dist/runtime/editor/composables/index.d.ts +2 -0
  337. package/dist/runtime/editor/composables/index.js +2 -0
  338. package/dist/runtime/editor/composables/onElementResize.d.ts +3 -0
  339. package/dist/runtime/editor/composables/onElementResize.js +37 -0
  340. package/dist/runtime/editor/composables/useEditableFieldOverride.d.ts +24 -0
  341. package/dist/runtime/editor/composables/useEditableFieldOverride.js +130 -0
  342. package/dist/runtime/editor/composables/useStickyToolbar.d.ts +4 -3
  343. package/dist/runtime/editor/composables/useStickyToolbar.js +26 -10
  344. package/dist/runtime/editor/css/output.css +1 -1
  345. package/dist/runtime/editor/events/index.d.ts +31 -0
  346. package/dist/runtime/editor/features/add-list/Actions/Action.d.vue.ts +8 -1
  347. package/dist/runtime/editor/features/add-list/Actions/Action.vue +7 -1
  348. package/dist/runtime/editor/features/add-list/Actions/Action.vue.d.ts +8 -1
  349. package/dist/runtime/editor/features/add-list/Actions/index.d.vue.ts +11 -1
  350. package/dist/runtime/editor/features/add-list/Actions/index.vue +30 -10
  351. package/dist/runtime/editor/features/add-list/Actions/index.vue.d.ts +11 -1
  352. package/dist/runtime/editor/features/add-list/Blocks/index.d.vue.ts +11 -2
  353. package/dist/runtime/editor/features/add-list/Blocks/index.vue +27 -1
  354. package/dist/runtime/editor/features/add-list/Blocks/index.vue.d.ts +11 -2
  355. package/dist/runtime/editor/features/add-list/Help/Item.d.vue.ts +12 -0
  356. package/dist/runtime/editor/features/add-list/Help/Item.vue +186 -0
  357. package/dist/runtime/editor/features/add-list/Help/Item.vue.d.ts +12 -0
  358. package/dist/runtime/editor/features/add-list/Help/index.d.vue.ts +13 -0
  359. package/dist/runtime/editor/features/add-list/Help/index.vue +127 -0
  360. package/dist/runtime/editor/features/add-list/Help/index.vue.d.ts +13 -0
  361. package/dist/runtime/editor/features/add-list/docs.md +2 -2
  362. package/dist/runtime/editor/features/add-list/index.vue +108 -9
  363. package/dist/runtime/editor/features/add-list/types.d.ts +5 -0
  364. package/dist/runtime/editor/features/analyze/Main.vue +4 -1
  365. package/dist/runtime/editor/features/analyze/Summary/Chart.vue +9 -9
  366. package/dist/runtime/editor/features/analyze/index.vue +2 -14
  367. package/dist/runtime/editor/features/analyze/types.d.ts +4 -1
  368. package/dist/runtime/editor/features/artboard/Renderer.vue +43 -0
  369. package/dist/runtime/editor/features/assistant/docs.md +5 -5
  370. package/dist/runtime/editor/features/breadcrumbs/index.vue +4 -1
  371. package/dist/runtime/editor/features/clipboard/index.vue +6 -2
  372. package/dist/runtime/editor/features/comments/index.vue +1 -0
  373. package/dist/runtime/editor/features/comments/types.d.ts +6 -0
  374. package/dist/runtime/editor/features/dragging-overlay/DragItems/DragItem.d.vue.ts +1 -0
  375. package/dist/runtime/editor/features/dragging-overlay/DragItems/DragItem.vue +6 -31
  376. package/dist/runtime/editor/features/dragging-overlay/DragItems/DragItem.vue.d.ts +1 -0
  377. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.d.vue.ts +2 -1
  378. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +42 -18
  379. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue.d.ts +2 -1
  380. package/dist/runtime/editor/features/dragging-overlay/Renderer/fragment.glsl +77 -2
  381. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.d.vue.ts +1 -0
  382. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +143 -52
  383. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue.d.ts +1 -0
  384. package/dist/runtime/editor/features/dragging-overlay/Renderer/vertex.glsl +84 -31
  385. package/dist/runtime/editor/features/dragging-overlay/index.vue +3 -2
  386. package/dist/runtime/editor/features/edit/index.vue +7 -1
  387. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +13 -23
  388. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +10 -102
  389. package/dist/runtime/editor/features/editable-field/types.d.ts +12 -2
  390. package/dist/runtime/editor/features/entity-title/index.vue +7 -7
  391. package/dist/runtime/editor/features/fragments/index.vue +1 -1
  392. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +8 -13
  393. package/dist/runtime/editor/features/library/ReusableDialog/index.vue +6 -1
  394. package/dist/runtime/editor/features/library/index.vue +14 -5
  395. package/dist/runtime/editor/features/library/types.d.ts +6 -0
  396. package/dist/runtime/editor/features/media-library/Library/Item.d.vue.ts +2 -2
  397. package/dist/runtime/editor/features/media-library/Library/Item.vue +17 -1
  398. package/dist/runtime/editor/features/media-library/Library/Item.vue.d.ts +2 -2
  399. package/dist/runtime/editor/features/media-library/Library/index.vue +6 -1
  400. package/dist/runtime/editor/features/media-library/index.vue +4 -4
  401. package/dist/runtime/editor/features/options/Form/index.vue +11 -43
  402. package/dist/runtime/editor/features/ownership/Banner/index.d.vue.ts +6 -3
  403. package/dist/runtime/editor/features/ownership/Banner/index.vue +10 -1
  404. package/dist/runtime/editor/features/ownership/Banner/index.vue.d.ts +6 -3
  405. package/dist/runtime/editor/features/ownership/index.vue +18 -6
  406. package/dist/runtime/editor/features/ownership/types.d.ts +5 -0
  407. package/dist/runtime/editor/features/publish/index.vue +5 -1
  408. package/dist/runtime/editor/features/search/Overlay/index.vue +5 -2
  409. package/dist/runtime/editor/features/search/index.vue +64 -3
  410. package/dist/runtime/editor/features/search/types.d.ts +16 -1
  411. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -3
  412. package/dist/runtime/editor/features/selection/AddButtons/index.vue +24 -4
  413. package/dist/runtime/editor/features/selection/Renderer/index.vue +5 -1
  414. package/dist/runtime/editor/features/selection/index.vue +5 -1
  415. package/dist/runtime/editor/features/settings/Dialog/index.vue +3 -1
  416. package/dist/runtime/editor/features/settings/index.vue +4 -1
  417. package/dist/runtime/editor/features/templates/CreateDialog/index.vue +21 -2
  418. package/dist/runtime/editor/features/templates/Dialog/Item/index.d.vue.ts +1 -1
  419. package/dist/runtime/editor/features/templates/Dialog/Item/index.vue +3 -3
  420. package/dist/runtime/editor/features/templates/Dialog/Item/index.vue.d.ts +1 -1
  421. package/dist/runtime/editor/features/templates/Dialog/index.vue +21 -5
  422. package/dist/runtime/editor/features/templates/ManageDialog/Item.d.vue.ts +8 -0
  423. package/dist/runtime/editor/features/templates/ManageDialog/Item.vue +147 -0
  424. package/dist/runtime/editor/features/templates/ManageDialog/Item.vue.d.ts +8 -0
  425. package/dist/runtime/editor/features/templates/ManageDialog/index.vue +30 -107
  426. package/dist/runtime/editor/features/templates/index.vue +7 -5
  427. package/dist/runtime/editor/features/templates/types.d.ts +11 -2
  428. package/dist/runtime/editor/features/transform/Dialog/index.vue +6 -1
  429. package/dist/runtime/editor/features/transform/index.vue +25 -20
  430. package/dist/runtime/editor/features/transform/types.d.ts +6 -4
  431. package/dist/runtime/editor/features/validations/index.vue +6 -1
  432. package/dist/runtime/editor/helpers/date/index.d.ts +1 -0
  433. package/dist/runtime/editor/helpers/date/index.js +3 -0
  434. package/dist/runtime/editor/helpers/options/index.d.ts +20 -0
  435. package/dist/runtime/editor/helpers/options/index.js +60 -0
  436. package/dist/runtime/editor/helpers/webgl/index.d.ts +5 -1
  437. package/dist/runtime/editor/helpers/webgl/index.js +45 -13
  438. package/dist/runtime/editor/icons/svg/stars.svg +1 -0
  439. package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
  440. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +13 -10
  441. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
  442. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +3 -1
  443. package/dist/runtime/editor/plugins/Sidebar/index.vue +14 -2
  444. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +3 -1
  445. package/dist/runtime/editor/providers/adapters.d.ts +33 -0
  446. package/dist/runtime/editor/providers/adapters.js +88 -0
  447. package/dist/runtime/editor/providers/animation.js +3 -0
  448. package/dist/runtime/editor/providers/definition.d.ts +8 -1
  449. package/dist/runtime/editor/providers/definition.js +7 -3
  450. package/dist/runtime/editor/providers/dom.d.ts +7 -0
  451. package/dist/runtime/editor/providers/dom.js +12 -0
  452. package/dist/runtime/editor/providers/permissions.d.ts +6 -0
  453. package/dist/runtime/editor/providers/permissions.js +9 -0
  454. package/dist/runtime/editor/providers/plugin.d.ts +1 -0
  455. package/dist/runtime/editor/providers/state.js +1 -0
  456. package/dist/runtime/editor/providers/texts.js +20 -6
  457. package/dist/runtime/editor/providers/types.d.ts +7 -0
  458. package/dist/runtime/editor/providers/types.js +4 -0
  459. package/dist/runtime/editor/providers/ui.d.ts +40 -0
  460. package/dist/runtime/editor/providers/ui.js +27 -1
  461. package/dist/runtime/editor/translations/de.json +2738 -0
  462. package/dist/runtime/editor/translations/fr.json +2738 -0
  463. package/dist/runtime/editor/translations/gsw_CH.json +2738 -0
  464. package/dist/runtime/editor/translations/it.json +2738 -0
  465. package/dist/runtime/editor/types/app.d.ts +9 -2
  466. package/dist/runtime/editor/types/definitions.d.ts +5 -0
  467. package/dist/runtime/editor/types/features.d.ts +3 -1
  468. package/dist/runtime/editor/types/permissions.d.ts +17 -0
  469. package/dist/runtime/editor/types/permissions.js +0 -0
  470. package/dist/runtime/helpers/runtimeHelpers/index.d.ts +2 -1
  471. package/dist/runtime/helpers/runtimeHelpers/index.js +44 -6
  472. package/dist/runtime/types/index.d.ts +6 -0
  473. package/dist/shared/editor.CGf7C_0M.mjs +10 -0
  474. package/dist/shared/editor.DMFfaLVE.mjs +175 -0
  475. package/dist/shared/{editor.BKQCh70G.d.mts → editor.Iax3GCvt.d.mts} +94 -40
  476. package/dist/types.d.mts +7 -1
  477. package/package.json +29 -7
  478. package/dist/runtime/css/output.css +0 -1
  479. package/dist/runtime/material-icons/index.d.ts +0 -12
  480. package/dist/runtime/material-icons/index.js +0 -1
@@ -0,0 +1,85 @@
1
+ import { z } from "zod";
2
+ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
3
+ import { mutationResultSchema } from "../schemas.js";
4
+ const paramsSchema = z.object({
5
+ uuid: z.string().describe("The paragraph UUID or entity UUID containing the media field"),
6
+ field: z.string().describe("The content field name (reference type)"),
7
+ mediaId: z.string().describe("The media item ID (from search_media results)"),
8
+ mediaBundle: z.string().describe('The media bundle type (e.g., "image")')
9
+ });
10
+ export default defineBlokkliAgentTool({
11
+ name: "replace_media_field",
12
+ description: "Replace the media on an existing paragraph field. Use get_content_fields first to see available reference fields, then search_media to find media items.",
13
+ category: "mutation",
14
+ prunedSummary: (r) => r.success ? "replaced media" : "rejected",
15
+ modes: ["editing"],
16
+ lazy: true,
17
+ label($t) {
18
+ return $t("aiAgentReplaceMediaRunning", "Replacing media...");
19
+ },
20
+ paramsSchema,
21
+ resultSchema: mutationResultSchema,
22
+ requiredAdapterMethods: ["mediaLibraryReplaceMedia"],
23
+ execute(ctx, params) {
24
+ const { blocks, types, $t, context } = ctx.app;
25
+ const isEntity = params.uuid === context.value.entityUuid;
26
+ const block = !isEntity ? blocks.getBlock(params.uuid) : null;
27
+ if (!isEntity && !block) {
28
+ return { error: `Paragraph not found: ${params.uuid}` };
29
+ }
30
+ const entityType = isEntity ? context.value.entityType : ctx.itemEntityType;
31
+ const bundle = isEntity ? context.value.entityBundle : block.bundle;
32
+ const config = types.droppableFieldConfig.forName(
33
+ entityType,
34
+ bundle,
35
+ params.field
36
+ );
37
+ if (!config) {
38
+ return {
39
+ error: `Field "${params.field}" is not a reference content field on ${bundle}`
40
+ };
41
+ }
42
+ const allowedMedia = config.allowed.find((v) => v.type === "media");
43
+ if (!allowedMedia) {
44
+ return {
45
+ error: `Field "${params.field}" does not accept media items`
46
+ };
47
+ }
48
+ if (!allowedMedia.bundles.includes(params.mediaBundle)) {
49
+ return {
50
+ error: `Field "${params.field}" does not accept ${params.mediaBundle} media. Allowed: ${allowedMedia.bundles.join(", ")}`
51
+ };
52
+ }
53
+ return {
54
+ type: "rewrite",
55
+ label: $t("aiAgentReplaceMediaDone", "Replaced media on @field").replace(
56
+ "@field",
57
+ config.label
58
+ ),
59
+ apply: (adapter) => {
60
+ if (isEntity) {
61
+ if (!adapter.mediaLibraryReplaceEntityMedia) {
62
+ throw new Error("Entity media replacement not supported");
63
+ }
64
+ return adapter.mediaLibraryReplaceEntityMedia({
65
+ host: {
66
+ type: entityType,
67
+ uuid: params.uuid,
68
+ fieldName: params.field
69
+ },
70
+ mediaId: params.mediaId
71
+ });
72
+ }
73
+ return adapter.mediaLibraryReplaceMedia({
74
+ host: {
75
+ type: entityType,
76
+ uuid: params.uuid,
77
+ fieldName: params.field
78
+ },
79
+ mediaId: params.mediaId
80
+ });
81
+ },
82
+ affectedUuids: [params.uuid]
83
+ };
84
+ }
85
+ });
@@ -0,0 +1,128 @@
1
+ import { z } from 'zod';
2
+ import type { OptionItem } from '#blokkli/editor/helpers/options';
3
+ import type { BlokkliApp } from '#blokkli/editor/types/app';
4
+ /**
5
+ * Shared schema for a single block option with its current value.
6
+ */
7
+ export declare const blockOptionSchema: z.ZodObject<{
8
+ type: z.ZodString;
9
+ label: z.ZodString;
10
+ description: z.ZodOptional<z.ZodString>;
11
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
12
+ min: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
13
+ max: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
14
+ step: z.ZodOptional<z.ZodNumber>;
15
+ currentValue: z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodString>]>;
16
+ }, z.core.$strip>;
17
+ /**
18
+ * Shared schema for a record of block options keyed by property name.
19
+ */
20
+ export declare const blockOptionsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
21
+ type: z.ZodString;
22
+ label: z.ZodString;
23
+ description: z.ZodOptional<z.ZodString>;
24
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
25
+ min: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
26
+ max: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
27
+ step: z.ZodOptional<z.ZodNumber>;
28
+ currentValue: z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodString>]>;
29
+ }, z.core.$strip>>;
30
+ export type BlockOptionsMap = z.infer<typeof blockOptionsMapSchema>;
31
+ /**
32
+ * Build a block options map from available options and mutated state.
33
+ */
34
+ export declare function buildBlockOptionsMap(availableOptions: OptionItem[], mutatedOptions: Record<string, Record<string, string>>, uuid: string): BlockOptionsMap;
35
+ /**
36
+ * Schema for a parent entity (the container of a block).
37
+ * A parent is an entity + field combination where blocks can be placed.
38
+ * Used consistently across tools for specifying block locations.
39
+ */
40
+ export declare const parentSchema: z.ZodObject<{
41
+ type: z.ZodString;
42
+ uuid: z.ZodString;
43
+ field: z.ZodString;
44
+ }, z.core.$strip>;
45
+ /**
46
+ * Schema for mutation tool results.
47
+ * Mutation tools return either a MutationAction (handled by framework) or an error.
48
+ */
49
+ export declare const mutationResultSchema: z.ZodUnion<readonly [z.ZodObject<{
50
+ type: z.ZodEnum<{
51
+ add: "add";
52
+ delete: "delete";
53
+ move: "move";
54
+ rewrite: "rewrite";
55
+ options: "options";
56
+ }>;
57
+ label: z.ZodString;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ error: z.ZodString;
60
+ }, z.core.$strip>]>;
61
+ /**
62
+ * Shared schema for option values (used by add_blocks and set_block_options).
63
+ */
64
+ export declare const optionValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodString>]>;
65
+ /**
66
+ * Validate a single option value against its definition.
67
+ * Returns an error string or undefined if valid.
68
+ */
69
+ export declare function validateOptionValue(key: string, value: string | boolean | number | string[], optionDef: OptionItem): string | undefined;
70
+ /**
71
+ * Resolve an editable field config to its simplified type.
72
+ * Returns 'plain' for text fields, 'markup' for rich text/frame fields, null for unsupported.
73
+ */
74
+ export declare function getFieldType(app: BlokkliApp, entityType: string, bundle: string, fieldName: string): 'plain' | 'markup' | null;
75
+ /**
76
+ * Read the current value of an editable field on a block or entity.
77
+ * Tries the registered getValue() callback first, falls back to DOM element reading.
78
+ */
79
+ export declare function getEditableValue(app: BlokkliApp, entityType: string, uuid: string, bundle: string, fieldName: string, fieldType: 'plain' | 'markup'): string;
80
+ /**
81
+ * Get all child fields and their paragraphs for a given entity UUID.
82
+ * Walks mutatedFields to find fields belonging to the entity.
83
+ */
84
+ export declare function getParagraphChildren(app: BlokkliApp, uuid: string): {
85
+ fieldName: string;
86
+ paragraphs: {
87
+ uuid: string;
88
+ bundle: string;
89
+ }[];
90
+ }[];
91
+ /**
92
+ * Shared schema for the `position` parameter used by mutation tools that insert blocks.
93
+ *
94
+ * Values:
95
+ * - `"start"` — insert at the beginning of the field
96
+ * - `"end"` (default when omitted) — append at the end of the field
97
+ * - `"after:<UUID>"` — insert after the block with the given UUID
98
+ * - `"before:<UUID>"` — insert before the block with the given UUID
99
+ */
100
+ export declare const positionSchema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
101
+ /**
102
+ * Resolve a `position` string to the `afterUuid` value expected by adapter methods.
103
+ *
104
+ * Returns `{ afterUuid: string | null }` on success, or `{ error: string }` if
105
+ * the referenced UUID is not found in the target field.
106
+ */
107
+ export declare function resolvePosition(app: BlokkliApp, parentUuid: string, fieldName: string, position?: string): {
108
+ afterUuid: string | null;
109
+ } | {
110
+ error: string;
111
+ };
112
+ /**
113
+ * Schema for the success result sent back to the AI after mutation is applied.
114
+ */
115
+ export declare const mutationSuccessSchema: z.ZodUnion<readonly [z.ZodObject<{
116
+ success: z.ZodLiteral<true>;
117
+ newParagraphs: z.ZodOptional<z.ZodArray<z.ZodObject<{
118
+ uuid: z.ZodString;
119
+ bundle: z.ZodString;
120
+ paragraphFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
121
+ }, z.core.$strip>>>;
122
+ historyIndex: z.ZodNumber;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ success: z.ZodLiteral<false>;
125
+ rejected: z.ZodOptional<z.ZodLiteral<true>>;
126
+ }, z.core.$strip>, z.ZodObject<{
127
+ error: z.ZodString;
128
+ }, z.core.$strip>]>;
@@ -0,0 +1,242 @@
1
+ import { z } from "zod";
2
+ import { getMutatedOptionValue } from "#blokkli/editor/helpers/options";
3
+ import { getRuntimeOptionValue } from "#blokkli/runtime-helpers";
4
+ function extractOptionLabels(option) {
5
+ if (!("options" in option) || !option.options) return void 0;
6
+ const raw = option.options;
7
+ const labels = {};
8
+ for (const [key, value] of Object.entries(raw)) {
9
+ if (typeof value === "string") {
10
+ labels[key] = value;
11
+ } else if (typeof value === "object" && value !== null && "label" in value) {
12
+ labels[key] = String(value.label);
13
+ } else {
14
+ labels[key] = key;
15
+ }
16
+ }
17
+ return labels;
18
+ }
19
+ export const blockOptionSchema = z.object({
20
+ type: z.string().describe(
21
+ "The option type (checkbox, radios, checkboxes, text, number, range, color, datetime-local)"
22
+ ),
23
+ label: z.string().describe("The display label"),
24
+ description: z.string().optional().describe("Optional description"),
25
+ options: z.record(z.string(), z.string()).optional().describe("Available choices for radios/checkboxes (key \u2192 label)"),
26
+ min: z.union([z.number(), z.string()]).optional().describe("Minimum value for number/range/datetime-local types"),
27
+ max: z.union([z.number(), z.string()]).optional().describe("Maximum value for number/range/datetime-local types"),
28
+ step: z.number().optional().describe("Step increment for range type"),
29
+ currentValue: z.union([z.string(), z.boolean(), z.number(), z.array(z.string())]).describe("The current value")
30
+ });
31
+ export const blockOptionsMapSchema = z.record(
32
+ z.string().describe("Option property name"),
33
+ blockOptionSchema
34
+ );
35
+ export function buildBlockOptionsMap(availableOptions, mutatedOptions, uuid) {
36
+ const result = {};
37
+ for (const opt of availableOptions) {
38
+ const rawValue = getMutatedOptionValue(
39
+ mutatedOptions,
40
+ uuid,
41
+ opt.property,
42
+ opt.option.default
43
+ );
44
+ const currentValue = getRuntimeOptionValue(opt.option, rawValue);
45
+ const entry = {
46
+ type: opt.option.type,
47
+ label: opt.option.label,
48
+ currentValue
49
+ };
50
+ if (opt.option.description) {
51
+ entry.description = opt.option.description;
52
+ }
53
+ const labels = extractOptionLabels(opt.option);
54
+ if (labels) {
55
+ entry.options = labels;
56
+ }
57
+ if ("min" in opt.option) {
58
+ entry.min = opt.option.min;
59
+ }
60
+ if ("max" in opt.option) {
61
+ entry.max = opt.option.max;
62
+ }
63
+ if ("step" in opt.option && opt.option.type === "range") {
64
+ entry.step = opt.option.step;
65
+ }
66
+ result[opt.property] = entry;
67
+ }
68
+ return result;
69
+ }
70
+ export const parentSchema = z.object({
71
+ type: z.string().describe(
72
+ "The entity type of the parent. Do NOT guess this - always use the parent object returned by get_child_paragraphs."
73
+ ),
74
+ uuid: z.string().describe("The UUID of the parent entity or paragraph"),
75
+ field: z.string().describe(
76
+ "The field name on the parent. Do NOT guess this - always use the parent object returned by get_child_paragraphs."
77
+ )
78
+ });
79
+ export const mutationResultSchema = z.union([
80
+ z.object({
81
+ type: z.enum(["add", "delete", "move", "rewrite", "options"]).describe("Type of mutation"),
82
+ label: z.string().describe("Human-readable description")
83
+ }),
84
+ z.object({
85
+ error: z.string().describe("Error message if the mutation failed")
86
+ })
87
+ ]);
88
+ export const optionValueSchema = z.union([
89
+ z.string(),
90
+ z.boolean(),
91
+ z.number(),
92
+ z.array(z.string())
93
+ ]);
94
+ export function validateOptionValue(key, value, optionDef) {
95
+ const optionType = optionDef.option.type;
96
+ if (optionType === "checkbox") {
97
+ if (typeof value !== "boolean" && value !== "1" && value !== "0" && value !== "true" && value !== "false") {
98
+ return `Option "${key}" expects a boolean value`;
99
+ }
100
+ } else if (optionType === "radios") {
101
+ if (typeof value !== "string") {
102
+ return `Option "${key}" expects a string value`;
103
+ }
104
+ if ("options" in optionDef.option && optionDef.option.options) {
105
+ const allowedKeys = Object.keys(optionDef.option.options);
106
+ if (!allowedKeys.includes(value)) {
107
+ return `Option "${key}" value must be one of: ${allowedKeys.join(", ")}`;
108
+ }
109
+ }
110
+ } else if (optionType === "checkboxes") {
111
+ if (!Array.isArray(value) && typeof value !== "string") {
112
+ return `Option "${key}" expects an array of strings or comma-separated string`;
113
+ }
114
+ if ("options" in optionDef.option && optionDef.option.options) {
115
+ const allowedKeys = Object.keys(optionDef.option.options);
116
+ const values = Array.isArray(value) ? value : value.split(",");
117
+ for (const v of values) {
118
+ if (!allowedKeys.includes(v)) {
119
+ return `Option "${key}" value "${v}" is not allowed. Must be one of: ${allowedKeys.join(", ")}`;
120
+ }
121
+ }
122
+ }
123
+ } else if (optionType === "number" || optionType === "range") {
124
+ const numValue = typeof value === "number" ? value : Number.parseFloat(String(value));
125
+ if (Number.isNaN(numValue)) {
126
+ return `Option "${key}" expects a numeric value`;
127
+ }
128
+ if ("min" in optionDef.option && numValue < optionDef.option.min) {
129
+ return `Option "${key}" value must be >= ${optionDef.option.min}`;
130
+ }
131
+ if ("max" in optionDef.option && numValue > optionDef.option.max) {
132
+ return `Option "${key}" value must be <= ${optionDef.option.max}`;
133
+ }
134
+ }
135
+ return void 0;
136
+ }
137
+ export function getFieldType(app, entityType, bundle, fieldName) {
138
+ const config = app.types.editableFieldConfig.forName(
139
+ entityType,
140
+ bundle,
141
+ fieldName
142
+ );
143
+ if (!config) return null;
144
+ if (config.type === "table") return null;
145
+ if (config.type === "frame" || config.type === "markup") return "markup";
146
+ return "plain";
147
+ }
148
+ export function getEditableValue(app, entityType, uuid, bundle, fieldName, fieldType) {
149
+ const editables = app.directive.getEditablesForBlock(uuid);
150
+ const editable = editables.find((e) => e.fieldName === fieldName);
151
+ if (editable?.getValue) {
152
+ return editable.getValue();
153
+ }
154
+ const element = app.directive.findEditableElement(fieldName, {
155
+ type: entityType,
156
+ uuid,
157
+ bundle
158
+ });
159
+ if (element) {
160
+ return fieldType === "markup" ? element.innerHTML || "" : element.textContent || "";
161
+ }
162
+ return "";
163
+ }
164
+ export function getParagraphChildren(app, uuid) {
165
+ const result = [];
166
+ for (const field of app.state.mutatedFields.value) {
167
+ if (field.entityUuid === uuid && field.list.length > 0) {
168
+ result.push({
169
+ fieldName: field.name,
170
+ paragraphs: field.list.map((item) => ({
171
+ uuid: item.uuid,
172
+ bundle: item.bundle
173
+ }))
174
+ });
175
+ }
176
+ }
177
+ return result;
178
+ }
179
+ export const positionSchema = z.string().optional().default("end").describe(
180
+ 'Where to place the paragraph(s). "start" = beginning, "end" (default) = append at end, "after:<UUID>" = after a specific paragraph, "before:<UUID>" = before a specific paragraph.'
181
+ );
182
+ export function resolvePosition(app, parentUuid, fieldName, position) {
183
+ const fieldList = app.state.mutatedFields.value.find(
184
+ (f) => f.entityUuid === parentUuid && f.name === fieldName
185
+ );
186
+ const list = fieldList?.list ?? [];
187
+ if (position === void 0 || position === "end") {
188
+ const lastBlock = list.at(-1);
189
+ return { afterUuid: lastBlock?.uuid ?? null };
190
+ }
191
+ if (position === "start") {
192
+ return { afterUuid: null };
193
+ }
194
+ if (position.startsWith("after:")) {
195
+ const uuid = position.slice(6);
196
+ const found = list.find((b) => b.uuid === uuid);
197
+ if (!found) {
198
+ return {
199
+ error: `Position "after:${uuid}": paragraph not found in field "${fieldName}".`
200
+ };
201
+ }
202
+ return { afterUuid: uuid };
203
+ }
204
+ if (position.startsWith("before:")) {
205
+ const uuid = position.slice(7);
206
+ const index = list.findIndex((b) => b.uuid === uuid);
207
+ if (index === -1) {
208
+ return {
209
+ error: `Position "before:${uuid}": paragraph not found in field "${fieldName}".`
210
+ };
211
+ }
212
+ const preceding = index > 0 ? list[index - 1] : void 0;
213
+ return { afterUuid: preceding?.uuid ?? null };
214
+ }
215
+ return {
216
+ error: `Invalid position value: "${position}". Use "start", "end", "after:<UUID>", or "before:<UUID>".`
217
+ };
218
+ }
219
+ export const mutationSuccessSchema = z.union([
220
+ z.object({
221
+ success: z.literal(true),
222
+ newParagraphs: z.array(
223
+ z.object({
224
+ uuid: z.string(),
225
+ bundle: z.string(),
226
+ paragraphFields: z.array(z.string()).optional().describe(
227
+ "Paragraph fields on this new paragraph that can hold nested paragraphs. Call get_child_paragraphs with this paragraph's UUID to add paragraphs to these fields."
228
+ )
229
+ })
230
+ ).optional().describe(
231
+ "Paragraphs created by this mutation (for add/duplicate operations), with their UUIDs and bundle types"
232
+ ),
233
+ historyIndex: z.number().describe("Current position in mutation history (-1 = pristine)")
234
+ }),
235
+ z.object({
236
+ success: z.literal(false),
237
+ rejected: z.literal(true).optional().describe("True if user rejected the change")
238
+ }),
239
+ z.object({
240
+ error: z.string().describe("Error message")
241
+ })
242
+ ]);
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,65 @@
1
+ import { z } from "zod";
2
+ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
3
+ const resultSchema = z.array(
4
+ z.object({
5
+ id: z.string().describe("The unique ID of the content item"),
6
+ title: z.string().describe("The display title of the content item"),
7
+ entityType: z.string().describe("The entity type"),
8
+ entityBundle: z.string().describe("The entity bundle"),
9
+ targetBundles: z.array(z.string()).describe("Paragraph bundles that can be created from this content item"),
10
+ context: z.string().optional().describe("Additional context information"),
11
+ text: z.string().optional().describe("Description text"),
12
+ imageUrl: z.string().optional().describe("URL of the preview image")
13
+ })
14
+ );
15
+ export default defineBlokkliAgentTool({
16
+ resolve: async (ctx) => {
17
+ if (!ctx.adapter.getContentSearchTabs || !ctx.adapter.getContentSearchResults) {
18
+ return [];
19
+ }
20
+ const tabs = await ctx.adapter.getContentSearchTabs();
21
+ return tabs.map((tab) => {
22
+ const typesDescription = tab.types.map((type) => {
23
+ return `${type.type} (${type.bundles.join(", ")})`;
24
+ }).join(", ");
25
+ const description = `Content search for these entities: ${typesDescription}`;
26
+ return defineBlokkliAgentTool({
27
+ name: `search_content_${tab.id}`,
28
+ description,
29
+ category: "query",
30
+ lazy: true,
31
+ requiredAdapterMethods: [
32
+ "getContentSearchTabs",
33
+ "getContentSearchResults"
34
+ ],
35
+ modes: ["readonly", "editing", "translating", "review"],
36
+ label() {
37
+ return `Searching ${tab.title}...`;
38
+ },
39
+ paramsSchema: z.object({
40
+ query: z.string().describe(`Search query for ${tab.title}`)
41
+ }),
42
+ resultSchema,
43
+ async execute(toolCtx, params) {
44
+ const items = await toolCtx.adapter.getContentSearchResults(
45
+ tab.id,
46
+ params.query
47
+ );
48
+ return {
49
+ label: `Searched ${tab.title} for "${params.query}"`,
50
+ result: items.map((item) => ({
51
+ id: item.id,
52
+ title: item.title,
53
+ entityType: item.entityType,
54
+ entityBundle: item.entityBundle,
55
+ targetBundles: item.targetBundles,
56
+ context: item.context,
57
+ text: item.text,
58
+ imageUrl: item.imageUrl
59
+ }))
60
+ };
61
+ }
62
+ });
63
+ });
64
+ }
65
+ });
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ declare const resultSchema: z.ZodObject<{
3
+ items: z.ZodArray<z.ZodObject<{
4
+ mediaId: z.ZodString;
5
+ label: z.ZodString;
6
+ mediaBundle: z.ZodString;
7
+ thumbnail: z.ZodOptional<z.ZodString>;
8
+ targetBundles: z.ZodArray<z.ZodString>;
9
+ }, z.core.$strip>>;
10
+ total: z.ZodNumber;
11
+ }, z.core.$strip>;
12
+ export type SearchMediaResult = z.infer<typeof resultSchema>;
13
+ declare const _default: any;
14
+ export default _default;
@@ -0,0 +1,60 @@
1
+ import { z } from "zod";
2
+ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
3
+ const paramsSchema = z.object({
4
+ query: z.string().optional().describe(
5
+ "Search text to filter media items. Omit or leave empty to list all available media."
6
+ ),
7
+ bundle: z.string().optional().describe('Media bundle filter (e.g., "image", "video")')
8
+ });
9
+ const resultSchema = z.object({
10
+ items: z.array(
11
+ z.object({
12
+ mediaId: z.string().describe("The unique ID of the media item"),
13
+ label: z.string().describe("The display label/title of the media"),
14
+ mediaBundle: z.string().describe('The media type (e.g., "image", "video")'),
15
+ thumbnail: z.string().optional().describe("URL of the thumbnail image"),
16
+ targetBundles: z.array(z.string()).describe("Paragraph bundles that can be created from this media")
17
+ })
18
+ ),
19
+ total: z.number().describe("Total number of matching media items")
20
+ });
21
+ export default defineBlokkliAgentTool({
22
+ name: "search_media",
23
+ description: "Search the media library for images, videos, and other media. Returns media items that can be added to the page using add_media_paragraph. If more than one matching media is found: USE THE select_media TOOL TO LET THE USER PICK.",
24
+ category: "query",
25
+ lazy: true,
26
+ prunedSummary: (r) => `found ${r.total || 0} media items`,
27
+ modes: ["readonly", "editing", "translating", "review"],
28
+ label($t) {
29
+ return $t("aiAgentSearchMediaRunning", "Searching media...");
30
+ },
31
+ paramsSchema,
32
+ resultSchema,
33
+ requiredAdapterMethods: ["mediaLibraryGetResults"],
34
+ async execute(ctx, params) {
35
+ const { $t } = ctx.app;
36
+ const filters = {};
37
+ const query = (params.query ?? "").replaceAll("*", "").replaceAll("%", "");
38
+ if (query) filters.text = query;
39
+ if (params.bundle) filters.bundle = params.bundle;
40
+ const apiResult = await ctx.adapter.mediaLibraryGetResults({
41
+ filters,
42
+ page: 0
43
+ });
44
+ const result = {
45
+ items: apiResult.items.map((item) => ({
46
+ mediaId: item.mediaId,
47
+ label: item.label,
48
+ mediaBundle: item.mediaBundle || "",
49
+ thumbnail: item.thumbnail,
50
+ targetBundles: item.targetBundles
51
+ })),
52
+ total: apiResult.total
53
+ };
54
+ const label = query ? $t("aiAgentSearchMediaDone", "Searched media for '@query'").replace(
55
+ "@query",
56
+ query
57
+ ) : $t("aiAgentSearchMediaAllDone", "Searched all media");
58
+ return { label, result };
59
+ }
60
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,75 @@
1
+ import { z } from "zod";
2
+ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
3
+ import { parentSchema } from "../schemas.js";
4
+ import { fromLibraryBlockBundle, itemEntityType } from "#blokkli-build/config";
5
+ const paramsSchema = z.object({
6
+ parent: parentSchema.optional().describe(
7
+ "The parent entity where a reusable paragraph would be added. When provided, results are filtered to only include bundles allowed in this field."
8
+ )
9
+ });
10
+ const reusableParagraphSchema = z.object({
11
+ uuid: z.string().describe("The unique UUID of the reusable paragraph"),
12
+ label: z.string().describe("The display label"),
13
+ bundle: z.string().describe("The paragraph bundle type of the reusable paragraph")
14
+ });
15
+ const resultSchema = z.object({
16
+ items: z.array(reusableParagraphSchema).describe("Matching reusable paragraphs"),
17
+ total: z.number().describe("Total number of matching reusable paragraphs")
18
+ });
19
+ export default defineBlokkliAgentTool({
20
+ name: "search_reusable_paragraphs",
21
+ description: "Search for reusable paragraphs. These are pre-built paragraphs that can be placed on multiple pages. Unlike templates, reusable paragraphs stay linked: editing the reusable paragraph updates all pages using it. Use add_reusable_paragraph to add a result to the page.",
22
+ category: "query",
23
+ prunedSummary: (r) => `found ${r.total} reusable paragraphs`,
24
+ modes: ["readonly", "editing", "translating", "review"],
25
+ lazy: true,
26
+ label($t) {
27
+ return $t("aiAgentSearchLibraryRunning", "Searching reusable blocks...");
28
+ },
29
+ paramsSchema,
30
+ resultSchema,
31
+ requiredAdapterMethods: ["getLibraryItems"],
32
+ async execute(ctx, params) {
33
+ const { types, context, blocks, $t } = ctx.app;
34
+ let bundles = [];
35
+ if (params.parent) {
36
+ const isRootEntity = params.parent.uuid === context.value.entityUuid;
37
+ const parentEntityType = isRootEntity ? context.value.entityType : itemEntityType;
38
+ const parentBundle = isRootEntity ? context.value.entityBundle : blocks.getBlock(params.parent.uuid)?.bundle;
39
+ if (!parentBundle) {
40
+ return { error: `Parent not found: ${params.parent.uuid}` };
41
+ }
42
+ const field = types.getFieldConfig(
43
+ parentEntityType,
44
+ parentBundle,
45
+ params.parent.field
46
+ );
47
+ if (!field) {
48
+ return {
49
+ error: `Field "${params.parent.field}" not found on bundle "${parentBundle}".`
50
+ };
51
+ }
52
+ if (field.allowedBundles.length && !field.allowedBundles.includes(fromLibraryBlockBundle)) {
53
+ return {
54
+ error: `Field "${params.parent.field}" does not allow the from_library bundle.`
55
+ };
56
+ }
57
+ bundles = field.allowedBundles.filter((b) => b !== fromLibraryBlockBundle);
58
+ }
59
+ const apiResult = await ctx.adapter.getLibraryItems({
60
+ bundles,
61
+ page: 0,
62
+ filters: {}
63
+ });
64
+ const result = {
65
+ items: apiResult.items.map((item) => ({
66
+ uuid: item.uuid,
67
+ label: item.label || "",
68
+ bundle: item.bundle
69
+ })),
70
+ total: apiResult.total
71
+ };
72
+ const label = $t("aiAgentSearchLibraryDone", "Searched library");
73
+ return { label, result };
74
+ }
75
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;