@blokkli/editor 2.0.0-alpha.53 → 2.0.0-alpha.55

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 (218) hide show
  1. package/dist/global/constants/index.d.ts +1 -1
  2. package/dist/global/constants/index.js +1 -1
  3. package/dist/global/types/features.d.ts +5 -9
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +28 -35
  6. package/dist/modules/agent/index.mjs +46 -29
  7. package/dist/modules/agent/runtime/app/composables/agentProvider.js +2 -1
  8. package/dist/modules/agent/runtime/app/features/agent/Container.d.vue.ts +19 -0
  9. package/dist/modules/agent/runtime/app/features/agent/Container.vue +195 -0
  10. package/dist/modules/agent/runtime/app/features/agent/Container.vue.d.ts +19 -0
  11. package/dist/modules/agent/runtime/app/features/agent/index.vue +18 -164
  12. package/dist/modules/agent/runtime/app/features/agent/types.d.ts +9 -0
  13. package/dist/modules/agent/runtime/app/helpers/index.d.ts +7 -3
  14. package/dist/modules/agent/runtime/app/helpers/index.js +9 -3
  15. package/dist/modules/agent/runtime/app/prompts/fixReadability.js +51 -44
  16. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -1
  17. package/dist/modules/agent/runtime/app/tools/check_readability/index.js +1 -0
  18. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +1 -1
  19. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +6 -1
  20. package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.js +1 -0
  21. package/dist/modules/agent/runtime/app/types/index.d.ts +12 -0
  22. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +34 -18
  23. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +7 -0
  24. package/dist/modules/drupal/graphql/features/droppable-field-items.graphql +22 -0
  25. package/dist/modules/drupal/graphql/features/import-existing.graphql +0 -25
  26. package/dist/modules/drupal/graphql/features/workspace.graphql +9 -2
  27. package/dist/modules/drupal/graphql/mutations/update_droppable_field.graphql +21 -0
  28. package/dist/modules/drupal/index.mjs +6 -2
  29. package/dist/modules/drupal/runtime/adapter/index.js +75 -39
  30. package/dist/modules/readability/index.d.mts +11 -0
  31. package/dist/modules/readability/index.mjs +17 -0
  32. package/dist/modules/readability/runtime/adapter-extension.d.ts +2 -0
  33. package/dist/modules/readability/runtime/adapter-extension.js +5 -0
  34. package/dist/modules/readability/runtime/analyzers/builtin.d.ts +10 -0
  35. package/dist/modules/readability/runtime/analyzers/builtin.js +340 -0
  36. package/dist/runtime/components/BlokkliEditable.vue +10 -90
  37. package/dist/runtime/components/BlokkliItem.vue +2 -2
  38. package/dist/runtime/components/BlokkliProvider.vue +11 -5
  39. package/dist/runtime/composables/defineBlokkli.js +3 -1
  40. package/dist/runtime/composables/defineBlokkliFeature.d.ts +2 -3
  41. package/dist/runtime/editor/components/Actions/index.vue +1 -1
  42. package/dist/runtime/editor/components/AnimationCanvas/index.vue +41 -6
  43. package/dist/runtime/editor/components/AppMenu/Inner.d.vue.ts +7 -0
  44. package/dist/runtime/editor/components/AppMenu/Inner.vue +83 -0
  45. package/dist/runtime/editor/components/AppMenu/Inner.vue.d.ts +7 -0
  46. package/dist/runtime/editor/components/AppMenu/index.vue +5 -79
  47. package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
  48. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +9 -1
  49. package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
  50. package/dist/runtime/editor/components/BlockPreviewItem/index.vue +12 -6
  51. package/dist/runtime/editor/components/BlokkliEditableEdit.d.vue.ts +23 -0
  52. package/dist/runtime/editor/components/BlokkliEditableEdit.vue +95 -0
  53. package/dist/runtime/editor/components/BlokkliEditableEdit.vue.d.ts +23 -0
  54. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.d.vue.ts +4 -1
  55. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +4 -1
  56. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue.d.ts +4 -1
  57. package/dist/runtime/editor/components/BundleSelector/index.vue +10 -5
  58. package/dist/runtime/editor/components/Dialog/index.vue +0 -77
  59. package/dist/runtime/editor/components/EditIndicator.d.vue.ts +1 -0
  60. package/dist/runtime/editor/components/EditIndicator.vue +3 -2
  61. package/dist/runtime/editor/components/EditIndicator.vue.d.ts +1 -0
  62. package/dist/runtime/editor/components/EditProvider.d.vue.ts +3 -1
  63. package/dist/runtime/editor/components/EditProvider.vue +13 -4
  64. package/dist/runtime/editor/components/EditProvider.vue.d.ts +3 -1
  65. package/dist/runtime/editor/components/FeaturesRenderer/index.vue +1 -4
  66. package/dist/runtime/editor/components/Form/Text/index.d.vue.ts +5 -0
  67. package/dist/runtime/editor/components/Form/Text/index.vue +10 -4
  68. package/dist/runtime/editor/components/Form/Text/index.vue.d.ts +5 -0
  69. package/dist/runtime/editor/components/FormOverlay/index.vue +0 -24
  70. package/dist/runtime/editor/components/GrowOnly/index.d.vue.ts +10 -0
  71. package/dist/runtime/editor/components/GrowOnly/index.vue +34 -0
  72. package/dist/runtime/editor/components/GrowOnly/index.vue.d.ts +10 -0
  73. package/dist/runtime/editor/components/Konami/Game/index.vue +120 -0
  74. package/dist/runtime/editor/components/Konami/index.vue +7 -124
  75. package/dist/runtime/editor/components/Loading/index.vue +1 -1
  76. package/dist/runtime/editor/components/PluginConfigForm/Text/index.vue +1 -0
  77. package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -0
  78. package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +3 -1
  79. package/dist/runtime/editor/components/PreviewProvider.vue +6 -1
  80. package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +3 -1
  81. package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
  82. package/dist/runtime/editor/components/index.d.ts +11 -10
  83. package/dist/runtime/editor/components/index.js +32 -10
  84. package/dist/runtime/editor/composables/defineRenderer.d.ts +2 -2
  85. package/dist/runtime/editor/composables/defineRenderer.js +8 -3
  86. package/dist/runtime/editor/css/output.css +1 -1
  87. package/dist/runtime/editor/events/index.d.ts +6 -0
  88. package/dist/runtime/editor/features/analyze/Main.d.vue.ts +1 -0
  89. package/dist/runtime/editor/features/analyze/Main.vue +9 -8
  90. package/dist/runtime/editor/features/analyze/Main.vue.d.ts +1 -0
  91. package/dist/runtime/editor/features/analyze/Results/ResultsItem.vue +7 -15
  92. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +4 -2
  93. package/dist/runtime/editor/features/analyze/analyzers/axe.js +9 -9
  94. package/dist/runtime/editor/features/analyze/analyzers/readability.js +7 -7
  95. package/dist/runtime/editor/features/analyze/index.vue +26 -26
  96. package/dist/runtime/editor/features/analyze/readability/types.d.ts +18 -14
  97. package/dist/runtime/editor/features/anchors/index.vue +6 -2
  98. package/dist/runtime/editor/features/artboard/Renderer.vue +3 -2
  99. package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +78 -0
  100. package/dist/runtime/editor/features/block-scheduler/index.vue +34 -89
  101. package/dist/runtime/editor/features/breadcrumbs/index.vue +2 -2
  102. package/dist/runtime/editor/features/changelog/changelog.json +8 -0
  103. package/dist/runtime/editor/features/changelog/index.vue +10 -8
  104. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +152 -0
  105. package/dist/runtime/editor/features/clipboard/index.vue +13 -159
  106. package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -28
  107. package/dist/runtime/editor/features/command-palette/Palette/index.vue +17 -6
  108. package/dist/runtime/editor/features/command-palette/index.vue +7 -2
  109. package/dist/runtime/editor/features/comments/index.vue +6 -3
  110. package/dist/runtime/editor/features/debug/Main.vue +168 -0
  111. package/dist/runtime/editor/features/debug/Section/Features.vue +1 -2
  112. package/dist/runtime/editor/features/debug/index.vue +6 -170
  113. package/dist/runtime/editor/features/dev-mode/index.vue +2 -1
  114. package/dist/runtime/editor/features/diff/index.vue +6 -2
  115. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +15 -16
  116. package/dist/runtime/editor/features/dragging-overlay/index.vue +4 -3
  117. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.d.vue.ts +15 -0
  118. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +547 -0
  119. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue.d.ts +15 -0
  120. package/dist/runtime/editor/features/droppable-field-edit/index.d.vue.ts +3 -0
  121. package/dist/runtime/editor/features/droppable-field-edit/index.vue +231 -0
  122. package/dist/runtime/editor/features/droppable-field-edit/index.vue.d.ts +3 -0
  123. package/dist/runtime/editor/features/droppable-field-edit/types.d.ts +70 -0
  124. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.d.vue.ts +1 -0
  125. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +34 -21
  126. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue.d.ts +1 -0
  127. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +2 -2
  128. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +2 -2
  129. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
  130. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +6 -13
  131. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +4 -4
  132. package/dist/runtime/editor/features/fragments/index.vue +9 -4
  133. package/dist/runtime/editor/features/help/index.vue +7 -2
  134. package/dist/runtime/editor/features/highlights/Renderer/index.vue +11 -17
  135. package/dist/runtime/editor/features/history/index.vue +3 -2
  136. package/dist/runtime/editor/features/hover/Renderer/index.vue +87 -36
  137. package/dist/runtime/editor/features/hover/Renderer/vertex.glsl +5 -5
  138. package/dist/runtime/editor/features/hover/index.vue +1 -1
  139. package/dist/runtime/editor/features/import-existing/Dialog/Item.d.vue.ts +5 -0
  140. package/dist/runtime/editor/features/import-existing/Dialog/Item.vue +55 -0
  141. package/dist/runtime/editor/features/import-existing/Dialog/Item.vue.d.ts +5 -0
  142. package/dist/runtime/editor/features/import-existing/Dialog/index.d.vue.ts +7 -3
  143. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +107 -65
  144. package/dist/runtime/editor/features/import-existing/Dialog/index.vue.d.ts +7 -3
  145. package/dist/runtime/editor/features/import-existing/index.vue +19 -6
  146. package/dist/runtime/editor/features/import-existing/types.d.ts +0 -11
  147. package/dist/runtime/editor/features/library/ReusableDialog/index.vue +7 -33
  148. package/dist/runtime/editor/features/library/index.vue +14 -5
  149. package/dist/runtime/editor/features/media-library/Library/index.vue +3 -1
  150. package/dist/runtime/editor/features/media-library/index.vue +9 -2
  151. package/dist/runtime/editor/features/media-library/types.d.ts +2 -0
  152. package/dist/runtime/editor/features/multi-select/Renderer/index.vue +16 -15
  153. package/dist/runtime/editor/features/multi-select/index.vue +9 -3
  154. package/dist/runtime/editor/features/options/Form/Radios/index.vue +4 -8
  155. package/dist/runtime/editor/features/options/index.vue +7 -2
  156. package/dist/runtime/editor/features/preview-grant/index.vue +8 -2
  157. package/dist/runtime/editor/features/publish/index.vue +3 -2
  158. package/dist/runtime/editor/features/referenced-entities/index.vue +7 -2
  159. package/dist/runtime/editor/features/responsive-preview/index.vue +13 -11
  160. package/dist/runtime/editor/features/search/index.vue +6 -2
  161. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +6 -11
  162. package/dist/runtime/editor/features/selection/Renderer/index.vue +9 -14
  163. package/dist/runtime/editor/features/selection/index.vue +7 -4
  164. package/dist/runtime/editor/features/settings/index.vue +8 -3
  165. package/dist/runtime/editor/features/structure/index.vue +3 -2
  166. package/dist/runtime/editor/features/templates/CreateDialog/index.vue +1 -0
  167. package/dist/runtime/editor/features/templates/index.vue +14 -6
  168. package/dist/runtime/editor/features/theme/index.vue +2 -1
  169. package/dist/runtime/editor/features/tour/index.vue +6 -2
  170. package/dist/runtime/editor/features/translations/index.vue +7 -4
  171. package/dist/runtime/editor/features/workspace/Overlay/Item.d.vue.ts +3 -0
  172. package/dist/runtime/editor/features/workspace/Overlay/Item.vue +49 -0
  173. package/dist/runtime/editor/features/workspace/Overlay/Item.vue.d.ts +3 -0
  174. package/dist/runtime/editor/features/workspace/Overlay/index.vue +16 -104
  175. package/dist/runtime/editor/features/workspace/index.vue +6 -2
  176. package/dist/runtime/editor/helpers/webgl/index.d.ts +3 -2
  177. package/dist/runtime/editor/helpers/webgl/index.js +2 -3
  178. package/dist/runtime/editor/libraries/fzf.d.ts +3 -0
  179. package/dist/runtime/editor/libraries/fzf.js +7 -0
  180. package/dist/runtime/editor/libraries/twgl.d.ts +10 -0
  181. package/dist/runtime/editor/libraries/twgl.js +14 -0
  182. package/dist/runtime/editor/plugins/DebugOverlay/index.vue +3 -1
  183. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +39 -18
  184. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -0
  185. package/dist/runtime/editor/plugins/Sidebar/index.vue +12 -4
  186. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -0
  187. package/dist/runtime/editor/providers/animation.d.ts +5 -10
  188. package/dist/runtime/editor/providers/animation.js +10 -8
  189. package/dist/runtime/editor/providers/directive.d.ts +11 -0
  190. package/dist/runtime/editor/providers/directive.js +16 -0
  191. package/dist/runtime/editor/providers/features.d.ts +3 -3
  192. package/dist/runtime/editor/providers/features.js +1 -1
  193. package/dist/runtime/editor/providers/fieldValue.d.ts +27 -0
  194. package/dist/runtime/editor/providers/fieldValue.js +21 -1
  195. package/dist/runtime/editor/providers/keyboard.js +6 -3
  196. package/dist/runtime/editor/providers/readability.d.ts +28 -4
  197. package/dist/runtime/editor/providers/readability.js +30 -46
  198. package/dist/runtime/editor/providers/selection.d.ts +8 -0
  199. package/dist/runtime/editor/providers/selection.js +6 -0
  200. package/dist/runtime/editor/providers/texts.d.ts +1 -3
  201. package/dist/runtime/editor/providers/texts.js +34 -37
  202. package/dist/runtime/editor/providers/workspaces.d.ts +93 -0
  203. package/dist/runtime/editor/providers/workspaces.js +76 -0
  204. package/dist/runtime/editor/translations/de.json +918 -3616
  205. package/dist/runtime/editor/translations/fr.json +250 -3616
  206. package/dist/runtime/editor/translations/gsw_CH.json +918 -3616
  207. package/dist/runtime/editor/translations/it.json +250 -3616
  208. package/dist/runtime/editor/types/app.d.ts +2 -0
  209. package/dist/runtime/editor/types/features.d.ts +1 -1
  210. package/dist/runtime/editor/types/state.d.ts +7 -0
  211. package/dist/runtime/helpers/injections.d.ts +6 -0
  212. package/dist/runtime/helpers/injections.js +3 -0
  213. package/dist/runtime/types/definitions.d.ts +4 -0
  214. package/package.json +14 -4
  215. package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.d.ts +0 -6
  216. package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.js +0 -216
  217. package/dist/runtime/editor/features/workspace/types.d.ts +0 -59
  218. /package/dist/runtime/editor/features/{workspace → droppable-field-edit}/types.js +0 -0
@@ -16,67 +16,19 @@
16
16
  <template #icon>
17
17
  <Icon name="stars" class="bk-is-animated" />
18
18
  </template>
19
- <template #default="{ isShown }">
20
- <AgentPanel
19
+ <template #default="{ isShown, shouldRender }">
20
+ <AgentContainer
21
+ v-if="shouldRender"
21
22
  :is-shown
22
23
  :agent-name
23
- :conversation
24
- :active-item
25
- :is-thinking
26
- :is-processing
27
- :is-connected
28
- :has-been-ready
29
- :pending-tool-call
30
- :pending-mutation
31
- :auto-approve
32
- :conversation-list
33
- :show-conversation-list
34
- :plan
35
- :tool-details
36
- :usage-turns="usageTurns"
37
- :page-context="pageContext"
38
- :supports-feedback="!!adapter.submitConversationFeedback"
39
- :feedback-item-ids="feedbackItemIds"
40
- @connect="connect"
41
- @send-prompt="sendPrompt"
42
- @retry="retry"
43
- @cancel="cancel"
44
- @approve="approve"
45
- @reject="reject"
46
- @set-auto-approve="setAutoApprove"
47
- @new-conversation="newConversation"
48
- @get-transcript="getTranscript"
49
- @tool-component-done="onToolComponentDone"
50
- @switch-conversation="switchConversation"
51
- @delete-conversation="deleteConversation"
52
- @submit-feedback="onSubmitFeedback"
53
- @feedback-done="onFeedbackDone"
54
- @show-conversations="onShowConversations"
55
- @hide-conversations="onHideConversations"
56
- @approve-plan="approvePlan"
57
- @reject-plan="rejectPlan"
24
+ :adapter
25
+ :pending-prompt-request="pendingPromptRequest"
26
+ @consumed="pendingPromptRequest = null"
58
27
  />
59
28
  </template>
60
29
  </PluginSidebar>
61
30
 
62
31
  <Teleport :to="ui.mainLayoutElement.value">
63
- <BlokkliTransition name="slide-up">
64
- <DialogModal
65
- v-if="showTranscript"
66
- id="agent-transcript"
67
- title="Agent Transcript"
68
- :width="900"
69
- hide-buttons
70
- full-screen
71
- @cancel="showTranscript = false"
72
- >
73
- <AgentTranscript
74
- v-if="transcriptContent"
75
- :transcript="transcriptContent"
76
- />
77
- </DialogModal>
78
- </BlokkliTransition>
79
-
80
32
  <Popup
81
33
  id="agent"
82
34
  ref="popup"
@@ -96,22 +48,16 @@
96
48
  import {
97
49
  useBlokkli,
98
50
  defineBlokkliFeature,
99
- onBeforeUnmount,
100
51
  computed,
101
- useTemplateRef
52
+ shallowRef,
53
+ useTemplateRef,
54
+ defineAsyncComponent
102
55
  } from "#imports";
103
56
  import { PluginSidebar } from "#blokkli/editor/plugins";
104
- import {
105
- DialogModal,
106
- BlokkliTransition,
107
- Icon,
108
- Popup
109
- } from "#blokkli/editor/components";
110
- import agentProvider from "#blokkli/agent/app/composables/agentProvider";
111
- import { agentPrompts, agentName } from "#blokkli-build/agent-client";
112
- import AgentPanel from "./Panel/index.vue";
113
- import AgentTranscript from "./Transcript/index.vue";
57
+ import { Icon, Popup } from "#blokkli/editor/components";
58
+ import { agentPrompts, agentName } from "#blokkli-build/agent-prompts";
114
59
  import { defineItemDropdownAction } from "#blokkli/editor/composables";
60
+ const AgentContainer = defineAsyncComponent(() => import("./Container.vue"));
115
61
  const { adapter } = defineBlokkliFeature({
116
62
  id: "agent",
117
63
  icon: "stars",
@@ -128,6 +74,7 @@ const { adapter } = defineBlokkliFeature({
128
74
  const app = useBlokkli();
129
75
  const { $t, ui } = app;
130
76
  const popup = useTemplateRef("popup");
77
+ const pendingPromptRequest = shallowRef(null);
131
78
  function closeAgentPopup() {
132
79
  if (popup.value) {
133
80
  popup.value.closePopup();
@@ -148,84 +95,11 @@ const tooltipTitle = computed(() => {
148
95
  agentName
149
96
  );
150
97
  });
151
- const {
152
- isConnected,
153
- hasBeenReady,
154
- connect,
155
- disconnect,
156
- conversation,
157
- activeItem,
158
- isProcessing,
159
- isThinking,
160
- autoApprove,
161
- pendingMutation,
162
- pendingToolCall,
163
- plan,
164
- approvePlan,
165
- rejectPlan,
166
- usageTurns,
167
- sendPrompt,
168
- runToolForPrompt,
169
- retry,
170
- approve,
171
- reject,
172
- setAutoApprove,
173
- cancel,
174
- newConversation,
175
- getTranscript,
176
- onToolComponentDone,
177
- transcriptContent,
178
- showTranscript,
179
- toolDetails,
180
- conversationList,
181
- showConversationList,
182
- switchConversation,
183
- deleteConversation,
184
- refreshConversationList,
185
- activeConversationId,
186
- feedbackItemIds,
187
- pageContext
188
- } = agentProvider(app, adapter, agentName);
189
- async function onSubmitFeedback(rating, comment) {
190
- if (!adapter.submitConversationFeedback) return;
191
- const conversationId = activeConversationId.value;
192
- if (!conversationId) return;
193
- const lastItem = conversation.value[conversation.value.length - 1];
194
- if (!lastItem) return;
195
- try {
196
- await adapter.submitConversationFeedback({
197
- conversationId,
198
- rating,
199
- lastItemId: lastItem.id,
200
- comment
201
- });
202
- } catch (e) {
203
- console.warn("[blokkli agent] Failed to submit feedback:", e);
204
- }
205
- }
206
- function onFeedbackDone() {
207
- const lastItem = conversation.value[conversation.value.length - 1];
208
- if (lastItem) {
209
- feedbackItemIds.value.add(lastItem.id);
210
- }
211
- }
212
- async function onShowConversations() {
213
- await refreshConversationList();
214
- showConversationList.value = true;
215
- }
216
- function onHideConversations() {
217
- showConversationList.value = false;
218
- }
219
- onBeforeUnmount(() => {
220
- disconnect();
221
- });
222
98
  defineItemDropdownAction(() => {
223
99
  return agentPrompts.flatMap((promptFactory) => {
224
100
  const promptsResult = "__factory" in promptFactory ? promptFactory.resolve(app) : promptFactory;
225
101
  const prompts = Array.isArray(promptsResult) ? promptsResult : [promptsResult];
226
102
  return prompts.map((prompt) => {
227
- const promptText = prompt.getPrompt(app);
228
- const userPromptText = prompt.getUserPrompt?.(app);
229
103
  return {
230
104
  id: "agent:prompt:" + prompt.id,
231
105
  label: prompt.getLabel(app),
@@ -233,32 +107,12 @@ defineItemDropdownAction(() => {
233
107
  group: "agent",
234
108
  variant: "agent",
235
109
  weight: -900,
236
- callback: async () => {
110
+ callback: () => {
237
111
  app.eventBus.emit("sidebar:open", "agent");
238
- const selectedUuids = [...app.selection.uuids.value];
239
- let preSeededResults = void 0;
240
- let autoExecuteTools = void 0;
241
- if (prompt.preExecute) {
242
- const preResult = await prompt.preExecute({
243
- app,
244
- selectedUuids,
245
- runTool: runToolForPrompt
246
- });
247
- if (preResult) {
248
- preSeededResults = preResult.preSeededResults;
249
- autoExecuteTools = preResult.autoExecuteTools;
250
- }
251
- }
252
- sendPrompt(
253
- promptText,
254
- userPromptText,
255
- selectedUuids,
256
- void 0,
257
- prompt.tools,
258
- prompt.skills,
259
- preSeededResults,
260
- autoExecuteTools
261
- );
112
+ pendingPromptRequest.value = {
113
+ prompt,
114
+ selectedUuids: [...app.selection.uuids.value]
115
+ };
262
116
  }
263
117
  };
264
118
  });
@@ -1,3 +1,12 @@
1
+ import type { AgentPromptDefinition } from '#blokkli/agent/app/types';
2
+ /**
3
+ * A pending request from the outer feature's item-dropdown action that the
4
+ * inner container consumes on mount (or on change if already mounted).
5
+ */
6
+ export type PendingPromptRequest = {
7
+ prompt: AgentPromptDefinition;
8
+ selectedUuids: string[];
9
+ };
1
10
  export type AgentConversationData = {
2
11
  uuid: string;
3
12
  title: string;
@@ -1,5 +1,6 @@
1
1
  import type { McpToolDefinition, McpToolContext, McpToolCategory, MutationAction, QueryResult, ToolError } from '#blokkli/agent/app/types';
2
2
  import type { BlokkliAdapter } from '#blokkli/editor/adapter';
3
+ import type { BlokkliApp } from '#blokkli/editor/types/app';
3
4
  import type { EditMode } from '#blokkli/editor/types/state';
4
5
  /**
5
6
  * Create a map of tool name to tool definition for quick lookup.
@@ -7,10 +8,13 @@ import type { EditMode } from '#blokkli/editor/types/state';
7
8
  export declare function createToolMap(tools: McpToolDefinition[]): Record<string, McpToolDefinition>;
8
9
  /**
9
10
  * Get tool names for the server.
10
- * Filters by edit mode and adapter methods if provided.
11
- * All tools are static and resolved from bundled metadata on the server.
11
+ *
12
+ * Applies three filters in order:
13
+ * 1. `tool.modes` must include the current edit mode.
14
+ * 2. `tool.requiredAdapterMethods` (if any) must all exist on the adapter.
15
+ * 3. `tool.isAvailable(app)` (if defined) must return (or resolve to) true.
12
16
  */
13
- export declare function getToolInfoForServer(tools: McpToolDefinition[], editMode: EditMode, adapter?: BlokkliAdapter<unknown>): string[];
17
+ export declare function getToolInfoForServer(tools: McpToolDefinition[], editMode: EditMode, app: BlokkliApp, adapter?: BlokkliAdapter<unknown>): Promise<string[]>;
14
18
  /**
15
19
  * Coerce stringified JSON values back to their actual types.
16
20
  *
@@ -1,15 +1,21 @@
1
1
  export function createToolMap(tools) {
2
2
  return Object.fromEntries(tools.map((t) => [t.name, t]));
3
3
  }
4
- export function getToolInfoForServer(tools, editMode, adapter) {
5
- return tools.filter((tool) => {
4
+ export async function getToolInfoForServer(tools, editMode, app, adapter) {
5
+ const staticFiltered = tools.filter((tool) => {
6
6
  if (!tool.modes.includes(editMode)) return false;
7
7
  if (!tool.requiredAdapterMethods) return true;
8
8
  if (!adapter) return true;
9
9
  return tool.requiredAdapterMethods.every(
10
10
  (method) => typeof adapter[method] === "function"
11
11
  );
12
- }).map((t) => t.name);
12
+ });
13
+ const availability = await Promise.all(
14
+ staticFiltered.map(
15
+ (tool) => tool.isAvailable ? Promise.resolve(tool.isAvailable(app)) : true
16
+ )
17
+ );
18
+ return staticFiltered.filter((_, index) => availability[index]).map((t) => t.name);
13
19
  }
14
20
  export function coerceStringifiedParams(params) {
15
21
  const result = {};
@@ -1,49 +1,56 @@
1
1
  import { defineBlokkliAgentPrompt } from "#blokkli/agent/app/composables";
2
2
  export default defineBlokkliAgentPrompt({
3
- id: "fix_readability",
4
- skills: ["rewrite-and-translate", "asses-and-fix-readability"],
5
- tools: [
6
- "get_readability_issues",
7
- "check_readability_for_texts",
8
- "delegate_text_rewrite"
9
- ],
10
- getLabel: ({ $t }) => {
11
- return $t("agentPromptReadabilityLabel", "Fix readability...");
12
- },
13
- getPrompt: ({ $t }) => {
14
- return $t(
15
- "agentPromptReadabilityPrompt",
16
- "The readability issues have already been analyzed and the fix has been applied. Do not call any more tools. Just very briefly confirm that you are done."
17
- );
18
- },
19
- getUserPrompt: ({ $t }) => {
20
- return $t(
21
- "agentPromptReadabilityUserPrompt",
22
- "Fix the readability of the selected paragraphs."
23
- );
24
- },
25
- async preExecute({ selectedUuids, runTool }) {
26
- const readability = await runTool(
27
- "get_readability_issues",
28
- selectedUuids.length ? {
29
- uuids: selectedUuids
30
- } : {}
31
- );
32
- const fields = Object.entries(readability.result).flatMap(
33
- ([uuid, fieldMap]) => Object.keys(fieldMap).map((fieldName) => ({ uuid, fieldName }))
34
- );
35
- return {
36
- preSeededResults: [readability],
37
- autoExecuteTools: fields.length > 0 ? [
38
- {
39
- toolName: "delegate_text_rewrite",
40
- params: {
41
- template: "fix_readability",
42
- templateParams: {},
43
- fields
44
- }
3
+ resolve: (app) => {
4
+ if (!app.readability.isAvailable.value) return [];
5
+ return [
6
+ {
7
+ id: "fix_readability",
8
+ skills: ["rewrite-and-translate", "asses-and-fix-readability"],
9
+ tools: [
10
+ "get_readability_issues",
11
+ "check_readability_for_texts",
12
+ "delegate_text_rewrite"
13
+ ],
14
+ getLabel: ({ $t }) => {
15
+ return $t("agentPromptReadabilityLabel", "Fix readability...");
16
+ },
17
+ getPrompt: ({ $t }) => {
18
+ return $t(
19
+ "agentPromptReadabilityPrompt",
20
+ "The readability issues have already been analyzed and the fix has been applied. Do not call any more tools. Just very briefly confirm that you are done."
21
+ );
22
+ },
23
+ getUserPrompt: ({ $t }) => {
24
+ return $t(
25
+ "agentPromptReadabilityUserPrompt",
26
+ "Fix the readability of the selected paragraphs."
27
+ );
28
+ },
29
+ async preExecute({ selectedUuids, runTool }) {
30
+ const readability = await runTool(
31
+ "get_readability_issues",
32
+ selectedUuids.length ? {
33
+ uuids: selectedUuids
34
+ } : {}
35
+ );
36
+ const fields = Object.entries(readability.result).flatMap(
37
+ ([uuid, fieldMap]) => Object.keys(fieldMap).map((fieldName) => ({ uuid, fieldName }))
38
+ );
39
+ return {
40
+ preSeededResults: [readability],
41
+ autoExecuteTools: fields.length > 0 ? [
42
+ {
43
+ toolName: "delegate_text_rewrite",
44
+ params: {
45
+ template: "fix_readability",
46
+ templateParams: {},
47
+ fields
48
+ }
49
+ }
50
+ ] : void 0
51
+ };
45
52
  }
46
- ] : void 0
47
- };
53
+ }
54
+ ];
48
55
  }
49
56
  });
@@ -43,7 +43,8 @@ export default defineBlokkliAgentTool({
43
43
  mediaId: params.mediaId,
44
44
  mediaBundle: params.mediaBundle,
45
45
  itemBundles: [params.targetBundle],
46
- element: () => document.createElement("div")
46
+ element: () => document.createElement("div"),
47
+ label: params.mediaId
47
48
  };
48
49
  const resolved = resolvePosition(
49
50
  ctx.app,
@@ -25,6 +25,7 @@ export default defineBlokkliAgentTool({
25
25
  lazy: true,
26
26
  modes: ["readonly", "editing", "translating", "review"],
27
27
  requiredAdapterMethods: ["getAnalyzers"],
28
+ isAvailable: (app) => app.readability.isAvailable.value,
28
29
  label($t) {
29
30
  return $t("aiAgentCheckReadabilityRunning", "Checking readability...");
30
31
  },
@@ -510,7 +510,7 @@ async function readabilityRetryLoop(authToken) {
510
510
  }
511
511
  const retrySuccess = await fetchStream(retryToken, retryFields, {
512
512
  issues: retryIssues,
513
- scoreLabel: props.context.app.readability.analyzer.value.scoreLabel,
513
+ scoreLabel: props.context.app.readability.scoreLabel.value,
514
514
  scoreReference: props.context.app.readability.getAgentContext(),
515
515
  retryFields: retryFieldsData,
516
516
  passingFields: passingFieldsData
@@ -107,6 +107,11 @@ export default defineBlokkliAgentTool({
107
107
  }
108
108
  let templateParams = params.templateParams;
109
109
  if (params.template === "fix_readability") {
110
+ if (!ctx.app.readability.isAvailable.value) {
111
+ return {
112
+ error: "Readability analyzer is not configured for this project. The fix_readability template requires it."
113
+ };
114
+ }
110
115
  const analysisResult = await runReadabilityAnalysis(ctx.app);
111
116
  const issues = [];
112
117
  for (let i = 0; i < resolvedFields.length; i++) {
@@ -124,7 +129,7 @@ export default defineBlokkliAgentTool({
124
129
  }
125
130
  templateParams = {
126
131
  issues,
127
- scoreLabel: ctx.app.readability.analyzer.value.scoreLabel,
132
+ scoreLabel: ctx.app.readability.scoreLabel.value,
128
133
  scoreReference: ctx.app.readability.getAgentContext()
129
134
  };
130
135
  }
@@ -27,6 +27,7 @@ export default defineBlokkliAgentTool({
27
27
  lazy: true,
28
28
  modes: ["readonly", "editing", "translating", "review"],
29
29
  requiredAdapterMethods: ["getAnalyzers"],
30
+ isAvailable: (app) => app.readability.isAvailable.value,
30
31
  label($t) {
31
32
  return $t("aiAgentAnalyzeContentRunning", "Analyzing content...");
32
33
  },
@@ -175,6 +175,18 @@ export type McpToolDefinition<TParamsSchema extends z.ZodType = z.ZodType, TResu
175
175
  * LLM knows they exist and can load them on demand.
176
176
  */
177
177
  lazy?: boolean;
178
+ /**
179
+ * Runtime predicate that gates tool availability.
180
+ *
181
+ * Called once at connection time; the tool is excluded from the list sent
182
+ * to the LLM when this returns (or resolves to) `false`. Receives the full
183
+ * `BlokkliApp` so it can inspect provider state — e.g. a tool that relies
184
+ * on readability can return `app.readability.isAvailable.value`.
185
+ *
186
+ * Use this for capabilities that may be switched off at the project level.
187
+ * For static dependencies on adapter methods, prefer `requiredAdapterMethods`.
188
+ */
189
+ isAvailable?: (app: BlokkliApp) => boolean | Promise<boolean>;
178
190
  /**
179
191
  * Whether results become stale after any mutation.
180
192
  * When true, old results from this tool are marked as stale during pruning.
@@ -1,21 +1,23 @@
1
1
  <template>
2
2
  <div ref="rootEl">
3
- <component
4
- :is="ApexChart"
5
- v-if="ApexChart"
6
- :type="type"
7
- :options="chartOptions"
8
- :series="chartSeries"
9
- height="350"
10
- />
11
- <ol v-if="footnotes?.length" class="bk-chart-footnotes">
12
- <li v-for="(note, i) in footnotes" :key="i">
13
- <span class="bk-chart-footnote-marker">{{
14
- superscriptFor(i + 1)
15
- }}</span>
16
- {{ note }}
17
- </li>
18
- </ol>
3
+ <ClientOnly>
4
+ <component
5
+ :is="ApexChart"
6
+ v-if="ApexChart"
7
+ :type="type"
8
+ :options="chartOptions"
9
+ :series="chartSeries"
10
+ height="350"
11
+ />
12
+ <ol v-if="footnotes?.length" class="bk-chart-footnotes">
13
+ <li v-for="(note, i) in footnotes" :key="i">
14
+ <span class="bk-chart-footnote-marker">{{
15
+ superscriptFor(i + 1)
16
+ }}</span>
17
+ {{ note }}
18
+ </li>
19
+ </ol>
20
+ </ClientOnly>
19
21
  </div>
20
22
  </template>
21
23
 
@@ -24,7 +26,7 @@ import { computed, defineAsyncComponent, useTemplateRef } from "#imports";
24
26
  import { resolveChartColor, applyFootnotes, SUPERSCRIPTS } from "../../helpers";
25
27
  import { getChartTypeRuntime, getDefaultTypeOptions } from "../../chartTypes";
26
28
  import { COLORS } from "#blokkli-build/charts-config";
27
- const ApexChart = defineAsyncComponent(() => import("vue3-apexcharts"));
29
+ const ApexChart = import.meta.client ? defineAsyncComponent(() => import("vue3-apexcharts")) : void 0;
28
30
  const props = defineProps({
29
31
  title: { type: String, required: true },
30
32
  categories: { type: Array, required: true },
@@ -35,8 +37,13 @@ const props = defineProps({
35
37
  typeOptions: { type: Object, required: false }
36
38
  });
37
39
  const rootEl = useTemplateRef("rootEl");
38
- const chartDef = computed(() => getChartTypeRuntime(props.type));
40
+ const chartDef = computed(
41
+ () => import.meta.client ? getChartTypeRuntime(props.type) : void 0
42
+ );
39
43
  function superscriptFor(n) {
44
+ if (import.meta.server) {
45
+ return "";
46
+ }
40
47
  return String(n).split("").map((d) => SUPERSCRIPTS[d] || d).join("");
41
48
  }
42
49
  function deepMerge(target, source) {
@@ -51,6 +58,9 @@ function deepMerge(target, source) {
51
58
  return result;
52
59
  }
53
60
  const resolvedColors = computed(() => {
61
+ if (import.meta.server) {
62
+ return [];
63
+ }
54
64
  const def = chartDef.value;
55
65
  if (!def) return [];
56
66
  if (def.hasCategoryColors) {
@@ -66,6 +76,9 @@ const resolvedColors = computed(() => {
66
76
  return [];
67
77
  });
68
78
  const chartOptions = computed(() => {
79
+ if (import.meta.server) {
80
+ return {};
81
+ }
69
82
  const def = chartDef.value;
70
83
  if (!def) return {};
71
84
  const base = {
@@ -98,6 +111,9 @@ const chartOptions = computed(() => {
98
111
  return deepMerge(base, typeOpts);
99
112
  });
100
113
  const chartSeries = computed(() => {
114
+ if (import.meta.server) {
115
+ return [];
116
+ }
101
117
  const def = chartDef.value;
102
118
  if (!def) return [];
103
119
  const ctx = {
@@ -17,6 +17,13 @@ fragment paragraphsBlokkliEditState on ParagraphsBlokkliEditState {
17
17
  entityType
18
18
  entityBundle
19
19
  }
20
+ droppableFieldValues {
21
+ uuid
22
+ fieldName
23
+ ids
24
+ entityType
25
+ entityBundle
26
+ }
20
27
 
21
28
  mutatedState {
22
29
  fields(langcode: $langcode) {
@@ -0,0 +1,22 @@
1
+ query pbDroppableFieldItems(
2
+ $entityType: EntityType!
3
+ $entityUuid: String!
4
+ $langcode: String!
5
+ $paragraphUuid: String
6
+ $fieldName: String!
7
+ ) {
8
+ state: getParagraphsEditState(
9
+ entityType: $entityType
10
+ entityUuid: $entityUuid
11
+ langcode: $langcode
12
+ ) {
13
+ droppableFieldItems(paragraphUuid: $paragraphUuid, fieldName: $fieldName) {
14
+ id
15
+ entityType
16
+ bundle
17
+ label
18
+ thumbnailSrc
19
+ targetBundles
20
+ }
21
+ }
22
+ }
@@ -1,28 +1,3 @@
1
- query pbGetImportSourceEntities(
2
- $entityType: String!
3
- $entityUuid: String!
4
- $filters: [ParagraphsBlokkliUserConfigInput]
5
- $page: Int
6
- ) {
7
- pbGetImportSourceEntities(
8
- entityType: $entityType
9
- entityUuid: $entityUuid
10
- filters: $filters
11
- page: $page
12
- ) {
13
- total
14
- perPage
15
- filters {
16
- ...paragraphsBlokkliConfigInput
17
- }
18
- items {
19
- uuid
20
- label
21
- description
22
- }
23
- }
24
- }
25
-
26
1
  mutation pbCopyFromExisting(
27
2
  $entityType: EntityType!
28
3
  $entityUuid: String!
@@ -7,8 +7,6 @@ query pbEntitiesSearch {
7
7
  bundle
8
8
  label
9
9
  url
10
- lastChanged
11
- uid
12
10
  context
13
11
  }
14
12
  bundleLabels {
@@ -21,3 +19,12 @@ query pbEntitiesSearch {
21
19
  }
22
20
  }
23
21
  }
22
+
23
+ query pbEditStatesSummary {
24
+ paragraphsBlokkliEditStatesSummary {
25
+ hostEntityType
26
+ hostEntityUuid
27
+ lastChanged
28
+ uid
29
+ }
30
+ }