@blokkli/editor 2.0.0-alpha.32 → 2.0.0-alpha.34
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.
- package/dist/global/constants/index.d.ts +1 -0
- package/dist/global/constants/index.js +1 -0
- package/dist/global/types/features.d.ts +4 -0
- package/dist/module.d.mts +5 -27
- package/dist/module.json +1 -1
- package/dist/module.mjs +430 -10823
- package/dist/modules/agent/index.d.mts +64 -0
- package/dist/modules/agent/index.mjs +407 -0
- package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +55 -0
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +875 -0
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentPrompt.d.ts +32 -0
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentPrompt.js +6 -0
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.d.ts +65 -0
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.js +6 -0
- package/dist/modules/agent/runtime/app/composables/index.d.ts +4 -0
- package/dist/modules/agent/runtime/app/composables/index.js +2 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.d.vue.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.vue +62 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.vue.d.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.d.vue.ts +9 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue +38 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue.d.ts +9 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.d.vue.ts +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.vue +68 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.vue.d.ts +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.d.vue.ts +10 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.vue +72 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.vue.d.ts +10 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.d.vue.ts +13 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.vue +37 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.vue.d.ts +13 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.d.vue.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.vue +17 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.vue.d.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.d.vue.ts +11 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue +29 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue.d.ts +11 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.d.vue.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.vue +30 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.vue.d.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.d.vue.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.vue +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.vue.d.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.d.vue.ts +13 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.vue +46 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.vue.d.ts +13 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.d.vue.ts +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.vue +50 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.vue.d.ts +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.d.vue.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +160 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue.d.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.d.vue.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.vue +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.vue.d.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.d.vue.ts +7 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.vue +67 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.vue.d.ts +7 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.d.vue.ts +23 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +109 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue.d.ts +23 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.d.vue.ts +45 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +120 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue.d.ts +45 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.d.vue.ts +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.vue +47 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.vue.d.ts +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.d.vue.ts +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.vue +55 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.vue.d.ts +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.d.vue.ts +25 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.vue +36 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.vue.d.ts +25 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/de.md +19 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/en.md +18 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.d.vue.ts +10 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +44 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue.d.ts +10 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.d.vue.ts +58 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +274 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue.d.ts +58 -0
- package/dist/modules/agent/runtime/app/features/agent/index.d.vue.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue +162 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue.d.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/types.d.ts +58 -0
- package/dist/modules/agent/runtime/app/features/agent/types.js +0 -0
- package/dist/modules/agent/runtime/app/helpers/index.d.ts +55 -0
- package/dist/modules/agent/runtime/app/helpers/index.js +88 -0
- package/dist/modules/agent/runtime/app/helpers/pageStructure.d.ts +5 -0
- package/dist/modules/agent/runtime/app/helpers/pageStructure.js +106 -0
- package/dist/modules/agent/runtime/app/helpers/validation.d.ts +35 -0
- package/dist/modules/agent/runtime/app/helpers/validation.js +77 -0
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.js +69 -0
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +83 -0
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +62 -0
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +289 -0
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +76 -0
- package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_template/index.js +58 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.d.vue.ts +19 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +113 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue.d.ts +19 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +17 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/index.js +54 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.d.vue.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.vue +190 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.vue.d.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.d.vue.ts +20 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.vue +90 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.vue.d.ts +20 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/index.d.ts +18 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/index.js +55 -0
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.js +47 -0
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.js +47 -0
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +144 -0
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.js +180 -0
- package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.js +33 -0
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +93 -0
- package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +104 -0
- package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.js +108 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +192 -0
- package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.js +102 -0
- package/dist/modules/agent/runtime/app/tools/get_page_structure/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_page_structure/index.js +113 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +275 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +63 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.js +180 -0
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +46 -0
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.js +54 -0
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +69 -0
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.js +95 -0
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.js +80 -0
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.js +85 -0
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +128 -0
- package/dist/modules/agent/runtime/app/tools/schemas.js +242 -0
- package/dist/modules/agent/runtime/app/tools/search_content/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/search_content/index.js +65 -0
- package/dist/modules/agent/runtime/app/tools/search_media/index.d.ts +14 -0
- package/dist/modules/agent/runtime/app/tools/search_media/index.js +60 -0
- package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.js +75 -0
- package/dist/modules/agent/runtime/app/tools/search_templates/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/search_templates/index.js +51 -0
- package/dist/modules/agent/runtime/app/tools/search_text/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/search_text/index.js +114 -0
- package/dist/modules/agent/runtime/app/tools/select_media/Component.d.vue.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/select_media/Component.vue +70 -0
- package/dist/modules/agent/runtime/app/tools/select_media/Component.vue.d.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/select_media/index.d.ts +30 -0
- package/dist/modules/agent/runtime/app/tools/select_media/index.js +74 -0
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +109 -0
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.js +74 -0
- package/dist/modules/agent/runtime/app/tools/web_fetch/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/web_fetch/index.js +51 -0
- package/dist/modules/agent/runtime/app/types/index.d.ts +440 -0
- package/dist/modules/agent/runtime/app/types/index.js +51 -0
- package/dist/modules/agent/runtime/server/Session.d.ts +94 -0
- package/dist/modules/agent/runtime/server/Session.js +734 -0
- package/dist/modules/agent/runtime/server/SessionManager.d.ts +21 -0
- package/dist/modules/agent/runtime/server/SessionManager.js +80 -0
- package/dist/modules/agent/runtime/server/agent.d.ts +2 -0
- package/dist/modules/agent/runtime/server/agent.js +148 -0
- package/dist/modules/agent/runtime/server/agentPrompt.d.ts +22 -0
- package/dist/modules/agent/runtime/server/agentPrompt.js +53 -0
- package/dist/modules/agent/runtime/server/default-skills/adding-new-paragraphs.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/adding-new-paragraphs.js +21 -0
- package/dist/modules/agent/runtime/server/default-skills/pageReview.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/pageReview.js +28 -0
- package/dist/modules/agent/runtime/server/default-skills/reusable-paragraphs.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/reusable-paragraphs.js +21 -0
- package/dist/modules/agent/runtime/server/default-skills/rewriteAndTranslate.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/rewriteAndTranslate.js +14 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/architecture.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/architecture.js +39 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/available-skills.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/available-skills.js +18 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/available-tools.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/available-tools.js +18 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/fragments.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/fragments.js +19 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +22 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/interaction.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/interaction.js +20 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/introduction.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/introduction.js +14 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/page-context.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +60 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/paragraph-bundles.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/paragraph-bundles.js +37 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/plan-mode.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/plan-mode.js +36 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/security.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/security.js +27 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/workflow.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/workflow.js +22 -0
- package/dist/modules/agent/runtime/server/fetch.d.ts +2 -0
- package/dist/modules/agent/runtime/server/fetch.js +127 -0
- package/dist/modules/agent/runtime/server/helpers.d.ts +77 -0
- package/dist/modules/agent/runtime/server/helpers.js +352 -0
- package/dist/modules/agent/runtime/server/providers/anthropic.d.ts +12 -0
- package/dist/modules/agent/runtime/server/providers/anthropic.js +128 -0
- package/dist/modules/agent/runtime/server/providers/openai.d.ts +12 -0
- package/dist/modules/agent/runtime/server/providers/openai.js +165 -0
- package/dist/modules/agent/runtime/server/providers/types.d.ts +74 -0
- package/dist/modules/agent/runtime/server/providers/types.js +0 -0
- package/dist/modules/agent/runtime/server/server-tools/complete_plan_step/index.d.ts +3 -0
- package/dist/modules/agent/runtime/server/server-tools/complete_plan_step/index.js +79 -0
- package/dist/modules/agent/runtime/server/server-tools/create_plan/index.d.ts +9 -0
- package/dist/modules/agent/runtime/server/server-tools/create_plan/index.js +86 -0
- package/dist/modules/agent/runtime/server/server-tools/index.d.ts +86 -0
- package/dist/modules/agent/runtime/server/server-tools/index.js +30 -0
- package/dist/modules/agent/runtime/server/server-tools/load_skill/index.d.ts +7 -0
- package/dist/modules/agent/runtime/server/server-tools/load_skill/index.js +58 -0
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.d.ts +7 -0
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +43 -0
- package/dist/modules/agent/runtime/server/skills/defineBlokkliAgentSkill.d.ts +23 -0
- package/dist/modules/agent/runtime/server/skills/defineBlokkliAgentSkill.js +3 -0
- package/dist/modules/agent/runtime/server/skills/index.d.ts +2 -0
- package/dist/modules/agent/runtime/server/skills/index.js +1 -0
- package/dist/modules/agent/runtime/server/skills/types.d.ts +45 -0
- package/dist/modules/agent/runtime/server/skills/types.js +0 -0
- package/dist/modules/agent/runtime/server/system-prompts/defineBlokkliAgentSystemPrompt.d.ts +21 -0
- package/dist/modules/agent/runtime/server/system-prompts/defineBlokkliAgentSystemPrompt.js +3 -0
- package/dist/modules/agent/runtime/server/system-prompts/helpers.d.ts +20 -0
- package/dist/modules/agent/runtime/server/system-prompts/helpers.js +41 -0
- package/dist/modules/agent/runtime/server/system-prompts/index.d.ts +2 -0
- package/dist/modules/agent/runtime/server/system-prompts/index.js +1 -0
- package/dist/modules/agent/runtime/server/system-prompts/types.d.ts +49 -0
- package/dist/modules/agent/runtime/server/system-prompts/types.js +0 -0
- package/dist/modules/agent/runtime/shared/placeholders.d.ts +4 -0
- package/dist/modules/agent/runtime/shared/placeholders.js +1 -0
- package/dist/modules/agent/runtime/shared/types.d.ts +426 -0
- package/dist/modules/agent/runtime/shared/types.js +147 -0
- package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +27 -2
- package/dist/modules/drupal/graphql/features/agent.graphql +69 -0
- package/dist/modules/drupal/graphql/features/search.graphql +5 -0
- package/dist/modules/drupal/graphql/features/templates.graphql +36 -2
- package/dist/modules/drupal/graphql/mutations/add_multiple.graphql +25 -0
- package/dist/modules/drupal/graphql/mutations/bulk_update_field_values.graphql +15 -0
- package/dist/modules/drupal/graphql/mutations/rearrange.graphql +23 -0
- package/dist/modules/drupal/graphql/mutations/replace_entity_reference.graphql +25 -0
- package/dist/modules/drupal/graphql/mutations/swap.graphql +16 -0
- package/dist/modules/drupal/index.d.mts +18 -2
- package/dist/modules/drupal/index.mjs +60 -12
- package/dist/modules/drupal/runtime/adapter/index.js +246 -21
- package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.d.vue.ts +9 -0
- package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.vue +26 -0
- package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.vue.d.ts +9 -0
- package/dist/runtime/components/Blocks/Fragment/index.vue +11 -2
- package/dist/runtime/components/BlokkliItem.vue +3 -1
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +5 -3
- package/dist/runtime/composables/defineBlokkliFeature.js +2 -1
- package/dist/runtime/editor/adapter/index.d.ts +45 -4
- package/dist/runtime/editor/adapter/index.js +3 -0
- package/dist/runtime/editor/components/Actions/ItemDropdown.vue +6 -1
- package/dist/runtime/editor/components/Actions/index.vue +4 -1
- package/dist/runtime/editor/components/AddListItem/index.d.vue.ts +9 -1
- package/dist/runtime/editor/components/AddListItem/index.vue +36 -2
- package/dist/runtime/editor/components/AddListItem/index.vue.d.ts +9 -1
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +17 -7
- package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +3 -1
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue +4 -3
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +3 -1
- package/dist/runtime/editor/components/AutoHeight/index.d.vue.ts +16 -0
- package/dist/runtime/editor/components/AutoHeight/index.vue +32 -0
- package/dist/runtime/editor/components/AutoHeight/index.vue.d.ts +16 -0
- package/dist/runtime/editor/components/BlockPreviewItem/index.d.vue.ts +5 -1
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue +10 -7
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue.d.ts +5 -1
- package/dist/runtime/editor/components/BlockPreviewRenderer/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Dialog/index.d.vue.ts +2 -2
- package/dist/runtime/editor/components/Dialog/index.vue.d.ts +2 -2
- package/dist/runtime/editor/components/DiffViewer/DiffValue.d.vue.ts +7 -0
- package/dist/runtime/editor/components/DiffViewer/DiffValue.vue +21 -0
- package/dist/runtime/editor/components/DiffViewer/DiffValue.vue.d.ts +7 -0
- package/dist/runtime/editor/components/DiffViewer/State.vue +4 -9
- package/dist/runtime/editor/components/EditProvider.vue +25 -4
- package/dist/runtime/editor/components/FeaturesRenderer/index.vue +26 -8
- package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +31 -0
- package/dist/runtime/editor/components/FlexTextarea/index.vue +179 -0
- package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +31 -0
- package/dist/runtime/editor/components/Form/Text/index.vue +23 -11
- package/dist/runtime/editor/components/Form/Toggle/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Toggle/index.vue +7 -3
- package/dist/runtime/editor/components/Form/Toggle/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/Icon/index.vue +3 -1
- package/dist/runtime/editor/components/Indicators/index.vue +20 -10
- package/dist/runtime/editor/components/ItemIcon/index.d.vue.ts +3 -0
- package/dist/runtime/editor/components/ItemIcon/index.vue +3 -2
- package/dist/runtime/editor/components/ItemIcon/index.vue.d.ts +3 -0
- package/dist/runtime/editor/components/ItemIconBox/index.vue +4 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +3 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +150 -71
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +3 -1
- package/dist/runtime/editor/components/PluginConfigForm/index.vue +6 -2
- package/dist/runtime/editor/components/RelativeTime/index.d.vue.ts +3 -2
- package/dist/runtime/editor/components/RelativeTime/index.vue +21 -7
- package/dist/runtime/editor/components/RelativeTime/index.vue.d.ts +3 -2
- package/dist/runtime/editor/components/StatusIcon/index.d.vue.ts +9 -0
- package/dist/runtime/editor/components/StatusIcon/index.vue +31 -0
- package/dist/runtime/editor/components/StatusIcon/index.vue.d.ts +9 -0
- package/dist/runtime/editor/components/SystemRequirements/index.vue +5 -1
- package/dist/runtime/editor/components/Transition/Height.vue +3 -2
- package/dist/runtime/editor/components/Transition/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Transition/index.vue +2 -1
- package/dist/runtime/editor/components/Transition/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/index.d.ts +10 -6
- package/dist/runtime/editor/components/index.js +19 -11
- package/dist/runtime/editor/composables/index.d.ts +2 -0
- package/dist/runtime/editor/composables/index.js +2 -0
- package/dist/runtime/editor/composables/onElementResize.d.ts +3 -0
- package/dist/runtime/editor/composables/onElementResize.js +37 -0
- package/dist/runtime/editor/composables/useEditableFieldOverride.d.ts +24 -0
- package/dist/runtime/editor/composables/useEditableFieldOverride.js +130 -0
- package/dist/runtime/editor/composables/useStickyToolbar.d.ts +4 -3
- package/dist/runtime/editor/composables/useStickyToolbar.js +26 -10
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +31 -0
- package/dist/runtime/editor/features/add-list/Actions/Action.d.vue.ts +8 -1
- package/dist/runtime/editor/features/add-list/Actions/Action.vue +7 -1
- package/dist/runtime/editor/features/add-list/Actions/Action.vue.d.ts +8 -1
- package/dist/runtime/editor/features/add-list/Actions/index.d.vue.ts +11 -1
- package/dist/runtime/editor/features/add-list/Actions/index.vue +29 -8
- package/dist/runtime/editor/features/add-list/Actions/index.vue.d.ts +11 -1
- package/dist/runtime/editor/features/add-list/Blocks/index.d.vue.ts +11 -2
- package/dist/runtime/editor/features/add-list/Blocks/index.vue +27 -1
- package/dist/runtime/editor/features/add-list/Blocks/index.vue.d.ts +11 -2
- package/dist/runtime/editor/features/add-list/Help/Item.d.vue.ts +12 -0
- package/dist/runtime/editor/features/add-list/Help/Item.vue +186 -0
- package/dist/runtime/editor/features/add-list/Help/Item.vue.d.ts +12 -0
- package/dist/runtime/editor/features/add-list/Help/index.d.vue.ts +13 -0
- package/dist/runtime/editor/features/add-list/Help/index.vue +127 -0
- package/dist/runtime/editor/features/add-list/Help/index.vue.d.ts +13 -0
- package/dist/runtime/editor/features/add-list/docs.md +2 -2
- package/dist/runtime/editor/features/add-list/index.vue +108 -9
- package/dist/runtime/editor/features/add-list/types.d.ts +5 -0
- package/dist/runtime/editor/features/analyze/Main.vue +4 -1
- package/dist/runtime/editor/features/analyze/Summary/Chart.vue +9 -9
- package/dist/runtime/editor/features/analyze/index.vue +2 -14
- package/dist/runtime/editor/features/analyze/types.d.ts +4 -1
- package/dist/runtime/editor/features/artboard/Renderer.vue +43 -0
- package/dist/runtime/editor/features/assistant/docs.md +5 -5
- package/dist/runtime/editor/features/breadcrumbs/index.vue +4 -1
- package/dist/runtime/editor/features/clipboard/index.vue +6 -2
- package/dist/runtime/editor/features/comments/index.vue +1 -0
- package/dist/runtime/editor/features/comments/types.d.ts +6 -0
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.d.vue.ts +2 -1
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +32 -13
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue.d.ts +2 -1
- package/dist/runtime/editor/features/dragging-overlay/Renderer/fragment.glsl +77 -2
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.d.vue.ts +1 -0
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +143 -52
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue.d.ts +1 -0
- package/dist/runtime/editor/features/dragging-overlay/Renderer/vertex.glsl +84 -31
- package/dist/runtime/editor/features/dragging-overlay/index.vue +3 -2
- package/dist/runtime/editor/features/edit/index.vue +7 -1
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +13 -23
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +10 -102
- package/dist/runtime/editor/features/editable-field/types.d.ts +12 -2
- package/dist/runtime/editor/features/entity-title/index.vue +7 -7
- package/dist/runtime/editor/features/fragments/index.vue +1 -1
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue +8 -13
- package/dist/runtime/editor/features/library/ReusableDialog/index.vue +6 -1
- package/dist/runtime/editor/features/library/index.vue +14 -5
- package/dist/runtime/editor/features/library/types.d.ts +6 -0
- package/dist/runtime/editor/features/media-library/Library/Item.d.vue.ts +2 -2
- package/dist/runtime/editor/features/media-library/Library/Item.vue +17 -1
- package/dist/runtime/editor/features/media-library/Library/Item.vue.d.ts +2 -2
- package/dist/runtime/editor/features/media-library/Library/index.vue +6 -1
- package/dist/runtime/editor/features/media-library/index.vue +4 -4
- package/dist/runtime/editor/features/options/Form/index.vue +11 -43
- package/dist/runtime/editor/features/ownership/Banner/index.d.vue.ts +6 -3
- package/dist/runtime/editor/features/ownership/Banner/index.vue +10 -1
- package/dist/runtime/editor/features/ownership/Banner/index.vue.d.ts +6 -3
- package/dist/runtime/editor/features/ownership/index.vue +18 -6
- package/dist/runtime/editor/features/ownership/types.d.ts +5 -0
- package/dist/runtime/editor/features/publish/index.vue +5 -1
- package/dist/runtime/editor/features/search/Overlay/index.vue +5 -2
- package/dist/runtime/editor/features/search/index.vue +64 -3
- package/dist/runtime/editor/features/search/types.d.ts +16 -1
- package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -3
- package/dist/runtime/editor/features/selection/AddButtons/index.vue +24 -4
- package/dist/runtime/editor/features/selection/Renderer/index.vue +5 -1
- package/dist/runtime/editor/features/selection/index.vue +5 -1
- package/dist/runtime/editor/features/settings/Dialog/index.vue +3 -1
- package/dist/runtime/editor/features/settings/index.vue +4 -1
- package/dist/runtime/editor/features/templates/CreateDialog/index.vue +21 -2
- package/dist/runtime/editor/features/templates/Dialog/Item/index.d.vue.ts +1 -1
- package/dist/runtime/editor/features/templates/Dialog/Item/index.vue +3 -3
- package/dist/runtime/editor/features/templates/Dialog/Item/index.vue.d.ts +1 -1
- package/dist/runtime/editor/features/templates/Dialog/index.vue +21 -5
- package/dist/runtime/editor/features/templates/ManageDialog/Item.d.vue.ts +8 -0
- package/dist/runtime/editor/features/templates/ManageDialog/Item.vue +147 -0
- package/dist/runtime/editor/features/templates/ManageDialog/Item.vue.d.ts +8 -0
- package/dist/runtime/editor/features/templates/ManageDialog/index.vue +30 -107
- package/dist/runtime/editor/features/templates/index.vue +7 -5
- package/dist/runtime/editor/features/templates/types.d.ts +11 -2
- package/dist/runtime/editor/features/transform/Dialog/index.vue +6 -1
- package/dist/runtime/editor/features/transform/index.vue +25 -20
- package/dist/runtime/editor/features/transform/types.d.ts +6 -4
- package/dist/runtime/editor/features/validations/index.vue +6 -1
- package/dist/runtime/editor/helpers/date/index.d.ts +1 -0
- package/dist/runtime/editor/helpers/date/index.js +3 -0
- package/dist/runtime/editor/helpers/options/index.d.ts +20 -0
- package/dist/runtime/editor/helpers/options/index.js +60 -0
- package/dist/runtime/editor/helpers/webgl/index.d.ts +5 -1
- package/dist/runtime/editor/helpers/webgl/index.js +45 -13
- package/dist/runtime/editor/icons/svg/stars.svg +1 -0
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +13 -10
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +3 -1
- package/dist/runtime/editor/plugins/Sidebar/index.vue +14 -2
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +3 -1
- package/dist/runtime/editor/providers/adapters.d.ts +33 -0
- package/dist/runtime/editor/providers/adapters.js +88 -0
- package/dist/runtime/editor/providers/animation.js +3 -0
- package/dist/runtime/editor/providers/definition.d.ts +7 -0
- package/dist/runtime/editor/providers/definition.js +6 -0
- package/dist/runtime/editor/providers/dom.d.ts +7 -0
- package/dist/runtime/editor/providers/dom.js +12 -0
- package/dist/runtime/editor/providers/permissions.d.ts +6 -0
- package/dist/runtime/editor/providers/permissions.js +9 -0
- package/dist/runtime/editor/providers/plugin.d.ts +1 -0
- package/dist/runtime/editor/providers/state.js +1 -0
- package/dist/runtime/editor/providers/texts.js +20 -6
- package/dist/runtime/editor/providers/types.d.ts +7 -0
- package/dist/runtime/editor/providers/types.js +4 -0
- package/dist/runtime/editor/providers/ui.d.ts +40 -0
- package/dist/runtime/editor/providers/ui.js +27 -1
- package/dist/runtime/editor/translations/de.json +2738 -0
- package/dist/runtime/editor/translations/fr.json +2738 -0
- package/dist/runtime/editor/translations/gsw_CH.json +2738 -0
- package/dist/runtime/editor/translations/it.json +2738 -0
- package/dist/runtime/editor/types/app.d.ts +9 -2
- package/dist/runtime/editor/types/definitions.d.ts +5 -0
- package/dist/runtime/editor/types/features.d.ts +3 -1
- package/dist/runtime/editor/types/permissions.d.ts +17 -0
- package/dist/runtime/editor/types/permissions.js +0 -0
- package/dist/runtime/types/index.d.ts +6 -0
- package/dist/shared/editor.CGf7C_0M.mjs +10 -0
- package/dist/shared/editor.DMFfaLVE.mjs +175 -0
- package/dist/shared/{editor.BKQCh70G.d.mts → editor.Iax3GCvt.d.mts} +94 -40
- package/dist/types.d.mts +8 -2
- package/package.json +29 -7
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
import { parentSchema } from "../schemas.js";
|
|
4
|
+
import {
|
|
5
|
+
getAvailableOptions,
|
|
6
|
+
getMutatedOptionValue,
|
|
7
|
+
optionValueToStorable
|
|
8
|
+
} from "#blokkli/editor/helpers/options";
|
|
9
|
+
const paramsSchema = z.object({
|
|
10
|
+
// Bundle filters
|
|
11
|
+
bundle: z.string().optional().describe("Filter by exact bundle name"),
|
|
12
|
+
bundles: z.array(z.string()).optional().describe("Filter by any of these bundles"),
|
|
13
|
+
// Structure filters
|
|
14
|
+
hasChildren: z.boolean().optional().describe("Filter by whether paragraph has child paragraphs"),
|
|
15
|
+
isRootLevel: z.boolean().optional().describe("Filter to root level paragraphs (nesting 0)"),
|
|
16
|
+
nestingLevel: z.number().optional().describe("Filter to exact nesting level"),
|
|
17
|
+
parentBundle: z.string().optional().describe("Filter to paragraphs whose parent is this bundle"),
|
|
18
|
+
inField: z.string().optional().describe("Filter to paragraphs in a field with this name"),
|
|
19
|
+
// Content filters
|
|
20
|
+
containsText: z.string().optional().describe("Filter to paragraphs containing this text (case-insensitive)"),
|
|
21
|
+
// Option filters
|
|
22
|
+
optionEquals: z.object({
|
|
23
|
+
key: z.string().describe("Option key to check"),
|
|
24
|
+
value: z.union([z.string(), z.boolean(), z.number()]).describe("Expected option value")
|
|
25
|
+
}).optional().describe("Filter to paragraphs where an option equals a value"),
|
|
26
|
+
// Pagination
|
|
27
|
+
limit: z.number().optional().default(50).describe("Maximum number of results to return (default: 50)")
|
|
28
|
+
});
|
|
29
|
+
const paragraphResultSchema = z.object({
|
|
30
|
+
uuid: z.string().describe("The paragraph UUID"),
|
|
31
|
+
bundle: z.string().describe("The paragraph type"),
|
|
32
|
+
label: z.string().describe("Human-readable paragraph label"),
|
|
33
|
+
nestingLevel: z.number().describe("Nesting depth (0 = root level)"),
|
|
34
|
+
parent: parentSchema.describe("The parent entity containing this paragraph")
|
|
35
|
+
});
|
|
36
|
+
const resultSchema = z.object({
|
|
37
|
+
paragraphs: z.array(paragraphResultSchema).describe("paragraphs matching the filters"),
|
|
38
|
+
total: z.number().describe("Total number of matches before pagination"),
|
|
39
|
+
hasMore: z.boolean().describe("Whether there are more results beyond the limit")
|
|
40
|
+
});
|
|
41
|
+
export default defineBlokkliAgentTool({
|
|
42
|
+
name: "find_paragraphs",
|
|
43
|
+
description: "Find paragraphs matching multiple filter criteria. Supports filtering by bundle, structure (nesting, parent, field), content, and options. Returns paginated results. containsText does simple case-insensitive substring matching. For regex or match snippets, use search_text instead.",
|
|
44
|
+
category: "query",
|
|
45
|
+
volatile: true,
|
|
46
|
+
lazy: true,
|
|
47
|
+
prunedSummary: (r) => `found ${r.total || 0} paragraphs${r.hasMore ? " (more available)" : ""}`,
|
|
48
|
+
modes: ["readonly", "editing", "translating", "review"],
|
|
49
|
+
label($t) {
|
|
50
|
+
return $t("aiAgentFindBlocksRunning", "Finding blocks...");
|
|
51
|
+
},
|
|
52
|
+
paramsSchema,
|
|
53
|
+
resultSchema,
|
|
54
|
+
execute(ctx, params) {
|
|
55
|
+
const { blocks, state, context, types, dom, definitions, $t } = ctx.app;
|
|
56
|
+
const limit = params.limit ?? 50;
|
|
57
|
+
let candidates = blocks.getAllBlocks();
|
|
58
|
+
if (params.bundle) {
|
|
59
|
+
candidates = candidates.filter((block) => block.bundle === params.bundle);
|
|
60
|
+
}
|
|
61
|
+
if (params.bundles && params.bundles.length > 0) {
|
|
62
|
+
const bundleSet = new Set(params.bundles);
|
|
63
|
+
candidates = candidates.filter((block) => bundleSet.has(block.bundle));
|
|
64
|
+
}
|
|
65
|
+
if (params.isRootLevel === true) {
|
|
66
|
+
candidates = candidates.filter(
|
|
67
|
+
(block) => state.getNestingLevel(block.uuid) === 0
|
|
68
|
+
);
|
|
69
|
+
} else if (params.isRootLevel === false) {
|
|
70
|
+
candidates = candidates.filter(
|
|
71
|
+
(block) => state.getNestingLevel(block.uuid) > 0
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
if (params.nestingLevel !== void 0) {
|
|
75
|
+
candidates = candidates.filter(
|
|
76
|
+
(block) => state.getNestingLevel(block.uuid) === params.nestingLevel
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (params.inField) {
|
|
80
|
+
candidates = candidates.filter((block) => {
|
|
81
|
+
const fieldList = state.getFieldListForBlock(block.uuid);
|
|
82
|
+
return fieldList?.name === params.inField;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (params.parentBundle) {
|
|
86
|
+
candidates = candidates.filter((block) => {
|
|
87
|
+
const parentUuid = state.getParentEntityUuid(block.uuid);
|
|
88
|
+
if (!parentUuid || parentUuid === context.value.entityUuid) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
const parentBlock = blocks.getBlock(parentUuid);
|
|
92
|
+
return parentBlock?.bundle === params.parentBundle;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (params.hasChildren !== void 0) {
|
|
96
|
+
const mutatedFields = state.mutatedFields.value;
|
|
97
|
+
candidates = candidates.filter((block) => {
|
|
98
|
+
const hasChildFields = mutatedFields.some(
|
|
99
|
+
(field) => field.entityUuid === block.uuid && field.list.length > 0
|
|
100
|
+
);
|
|
101
|
+
return params.hasChildren ? hasChildFields : !hasChildFields;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (params.optionEquals) {
|
|
105
|
+
const { key, value } = params.optionEquals;
|
|
106
|
+
candidates = candidates.filter((block) => {
|
|
107
|
+
const definition = definitions.getBlockDefinition(
|
|
108
|
+
block.bundle,
|
|
109
|
+
block.fieldListType,
|
|
110
|
+
block.parentBlockBundle
|
|
111
|
+
);
|
|
112
|
+
if (!definition) return false;
|
|
113
|
+
const availableOptions = getAvailableOptions(
|
|
114
|
+
definition.options,
|
|
115
|
+
definition.globalOptions,
|
|
116
|
+
definitions.globalOptions.value
|
|
117
|
+
);
|
|
118
|
+
const optionDef = availableOptions.find((o) => o.property === key);
|
|
119
|
+
if (!optionDef) return false;
|
|
120
|
+
const currentValue = getMutatedOptionValue(
|
|
121
|
+
state.mutatedOptions,
|
|
122
|
+
block.uuid,
|
|
123
|
+
key,
|
|
124
|
+
optionDef.option.default
|
|
125
|
+
);
|
|
126
|
+
const storableQueryValue = optionValueToStorable(
|
|
127
|
+
optionDef.option,
|
|
128
|
+
value
|
|
129
|
+
);
|
|
130
|
+
const storableCurrentValue = optionValueToStorable(
|
|
131
|
+
optionDef.option,
|
|
132
|
+
currentValue
|
|
133
|
+
);
|
|
134
|
+
return storableCurrentValue === storableQueryValue;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (params.containsText) {
|
|
138
|
+
const searchText = params.containsText.toLowerCase();
|
|
139
|
+
candidates = candidates.filter((block) => {
|
|
140
|
+
const el = dom.getDragElement(block);
|
|
141
|
+
if (!el) return false;
|
|
142
|
+
const text = el.textContent?.toLowerCase() || "";
|
|
143
|
+
return text.includes(searchText);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const total = candidates.length;
|
|
147
|
+
const hasMore = total > limit;
|
|
148
|
+
const limitedCandidates = candidates.slice(0, limit);
|
|
149
|
+
const resultBlocks = [];
|
|
150
|
+
for (const block of limitedCandidates) {
|
|
151
|
+
const fieldList = state.getFieldListForBlock(block.uuid);
|
|
152
|
+
if (!fieldList) continue;
|
|
153
|
+
const parentType = fieldList.entityUuid === context.value.entityUuid ? context.value.entityType : ctx.itemEntityType;
|
|
154
|
+
resultBlocks.push({
|
|
155
|
+
uuid: block.uuid,
|
|
156
|
+
bundle: block.bundle,
|
|
157
|
+
label: types.getBlockLabel(block.bundle),
|
|
158
|
+
nestingLevel: state.getNestingLevel(block.uuid),
|
|
159
|
+
parent: {
|
|
160
|
+
type: parentType,
|
|
161
|
+
uuid: fieldList.entityUuid,
|
|
162
|
+
field: fieldList.name
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
label: $t("aiAgentFindBlocksDone", "Found @count blocks").replace(
|
|
168
|
+
"@count",
|
|
169
|
+
String(total)
|
|
170
|
+
),
|
|
171
|
+
result: {
|
|
172
|
+
paragraphs: resultBlocks,
|
|
173
|
+
total,
|
|
174
|
+
hasMore
|
|
175
|
+
},
|
|
176
|
+
// Select blocks if there's only one match
|
|
177
|
+
affectedUuids: resultBlocks.length === 1 ? [resultBlocks[0].uuid] : void 0
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
const fragmentSchema = z.object({
|
|
4
|
+
name: z.string().describe("The unique fragment identifier"),
|
|
5
|
+
label: z.string().describe("The display label"),
|
|
6
|
+
description: z.string().optional().describe("A short description of the fragment")
|
|
7
|
+
});
|
|
8
|
+
const paramsSchema = z.object({});
|
|
9
|
+
const resultSchema = z.array(fragmentSchema).describe("All available fragments");
|
|
10
|
+
export default defineBlokkliAgentTool({
|
|
11
|
+
name: "get_all_fragments",
|
|
12
|
+
description: "Get all available fragments that can be added to the page",
|
|
13
|
+
category: "query",
|
|
14
|
+
modes: ["readonly", "editing", "translating", "review"],
|
|
15
|
+
lazy: true,
|
|
16
|
+
label($t) {
|
|
17
|
+
return $t("aiAgentGetAllFragments", "Get all fragments");
|
|
18
|
+
},
|
|
19
|
+
paramsSchema,
|
|
20
|
+
resultSchema,
|
|
21
|
+
execute(ctx) {
|
|
22
|
+
const { definitions, $t } = ctx.app;
|
|
23
|
+
const result = definitions.fragmentDefinitions.value.map((fragment) => ({
|
|
24
|
+
name: fragment.name,
|
|
25
|
+
label: fragment.label,
|
|
26
|
+
description: fragment.description
|
|
27
|
+
}));
|
|
28
|
+
return {
|
|
29
|
+
label: $t("aiAgentGetAllFragmentsDone", "Got all fragments"),
|
|
30
|
+
result
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
import { getFieldType, getEditableValue } from "../schemas.js";
|
|
4
|
+
const paramsSchema = z.object({});
|
|
5
|
+
const blockContentSchema = z.object({
|
|
6
|
+
uuid: z.string().describe("The paragraph UUID"),
|
|
7
|
+
bundle: z.string().describe("The paragraph type"),
|
|
8
|
+
text: z.string().describe("All text content from this paragraph concatenated"),
|
|
9
|
+
referenceFields: z.array(z.string()).optional().describe(
|
|
10
|
+
"Names of reference/link content fields on this paragraph (e.g., media fields)"
|
|
11
|
+
)
|
|
12
|
+
});
|
|
13
|
+
const resultSchema = z.object({
|
|
14
|
+
content: z.array(blockContentSchema).describe("All paragraphs with their text content, flattened")
|
|
15
|
+
});
|
|
16
|
+
export default defineBlokkliAgentTool({
|
|
17
|
+
name: "get_all_page_content",
|
|
18
|
+
description: "Get all text content from the entire page in a single call. Returns a flat list of all paragraphs with their concatenated text. Use this as the first tool when reviewing or analyzing page content.",
|
|
19
|
+
category: "query",
|
|
20
|
+
volatile: true,
|
|
21
|
+
prunedSummary: (r) => `${r.content?.length || 0} paragraphs`,
|
|
22
|
+
modes: ["readonly", "editing", "translating", "review"],
|
|
23
|
+
label($t) {
|
|
24
|
+
return $t("aiAgentGetAllPageContentRunning", "Getting all page content...");
|
|
25
|
+
},
|
|
26
|
+
paramsSchema,
|
|
27
|
+
resultSchema,
|
|
28
|
+
execute(ctx) {
|
|
29
|
+
const { blocks, state, $t } = ctx.app;
|
|
30
|
+
const content = [];
|
|
31
|
+
function processBlock(blockUuid) {
|
|
32
|
+
const block = blocks.getBlock(blockUuid);
|
|
33
|
+
if (!block) return;
|
|
34
|
+
const editables = ctx.app.directive.getEditablesForBlock(blockUuid);
|
|
35
|
+
const textParts = [];
|
|
36
|
+
for (const editable of editables) {
|
|
37
|
+
const fieldType = getFieldType(
|
|
38
|
+
ctx.app,
|
|
39
|
+
ctx.itemEntityType,
|
|
40
|
+
block.bundle,
|
|
41
|
+
editable.fieldName
|
|
42
|
+
);
|
|
43
|
+
if (!fieldType) continue;
|
|
44
|
+
const value = getEditableValue(
|
|
45
|
+
ctx.app,
|
|
46
|
+
ctx.itemEntityType,
|
|
47
|
+
blockUuid,
|
|
48
|
+
block.bundle,
|
|
49
|
+
editable.fieldName,
|
|
50
|
+
fieldType
|
|
51
|
+
);
|
|
52
|
+
if (value.trim()) {
|
|
53
|
+
textParts.push(value.trim());
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const droppableFields = ctx.app.types.droppableFieldConfig.forEntityTypeAndBundle(ctx.itemEntityType, block.bundle).map((f) => f.name);
|
|
57
|
+
if (textParts.length > 0 || droppableFields.length > 0) {
|
|
58
|
+
content.push({
|
|
59
|
+
uuid: blockUuid,
|
|
60
|
+
bundle: block.bundle,
|
|
61
|
+
text: textParts.join("\n\n"),
|
|
62
|
+
referenceFields: droppableFields.length ? droppableFields : void 0
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const mutatedFields2 = state.mutatedFields.value;
|
|
66
|
+
for (const field of mutatedFields2) {
|
|
67
|
+
if (field.entityUuid === blockUuid) {
|
|
68
|
+
for (const child of field.list) {
|
|
69
|
+
processBlock(child.uuid);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const pageUuid = ctx.app.context.value.entityUuid;
|
|
75
|
+
const mutatedFields = state.mutatedFields.value;
|
|
76
|
+
for (const field of mutatedFields) {
|
|
77
|
+
if (field.entityUuid === pageUuid) {
|
|
78
|
+
for (const item of field.list) {
|
|
79
|
+
processBlock(item.uuid);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
label: $t(
|
|
85
|
+
"aiAgentGetAllPageContentDone",
|
|
86
|
+
"Got content from @count blocks"
|
|
87
|
+
).replace("@count", String(content.length)),
|
|
88
|
+
result: {
|
|
89
|
+
content
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
const paramsSchema = z.object({
|
|
4
|
+
parentUuid: z.string().describe("The parent entity UUID"),
|
|
5
|
+
field: z.string().describe("The field name")
|
|
6
|
+
});
|
|
7
|
+
const bundleSchema = z.object({
|
|
8
|
+
bundle: z.string().describe("The paragraph type identifier"),
|
|
9
|
+
label: z.string().describe("Human-readable label"),
|
|
10
|
+
description: z.string().optional().describe("Bundle description if available"),
|
|
11
|
+
contentFields: z.array(
|
|
12
|
+
z.object({
|
|
13
|
+
name: z.string().describe("The field name"),
|
|
14
|
+
type: z.string().describe("Field type: plain, markup, reference, or link")
|
|
15
|
+
})
|
|
16
|
+
).describe("Content fields (text, media, links) on this bundle"),
|
|
17
|
+
paragraphFields: z.array(
|
|
18
|
+
z.object({
|
|
19
|
+
name: z.string().describe("The field name"),
|
|
20
|
+
label: z.string().describe("Human-readable label"),
|
|
21
|
+
allowedBundles: z.array(z.string()).describe("Paragraph types allowed in this field"),
|
|
22
|
+
cardinality: z.number().describe("Max paragraphs allowed (-1 = unlimited)")
|
|
23
|
+
})
|
|
24
|
+
).describe("Paragraph fields (for nested paragraphs) on this bundle")
|
|
25
|
+
});
|
|
26
|
+
const resultSchema = z.object({
|
|
27
|
+
fieldLabel: z.string().describe("Human-readable field label"),
|
|
28
|
+
cardinality: z.number().describe("Max paragraphs allowed (-1 = unlimited)"),
|
|
29
|
+
currentCount: z.number().describe("Current number of paragraphs in the field"),
|
|
30
|
+
bundles: z.array(bundleSchema).describe("Available paragraph types"),
|
|
31
|
+
nestingInfo: z.string().optional().describe(
|
|
32
|
+
"Summary of which bundles have paragraph fields for nested paragraphs. Use get_child_paragraphs after adding these bundles to populate their nested fields."
|
|
33
|
+
)
|
|
34
|
+
});
|
|
35
|
+
export default defineBlokkliAgentTool({
|
|
36
|
+
name: "get_bundle_info",
|
|
37
|
+
description: "Get detailed information about which paragraph types can be added to a specific field, including their content fields and paragraph fields (for nested paragraphs).",
|
|
38
|
+
category: "query",
|
|
39
|
+
modes: ["readonly", "editing", "translating", "review"],
|
|
40
|
+
label($t) {
|
|
41
|
+
return $t("aiAgentGetBundleInfoRunning", "Getting bundle info...");
|
|
42
|
+
},
|
|
43
|
+
paramsSchema,
|
|
44
|
+
resultSchema,
|
|
45
|
+
execute(ctx, params) {
|
|
46
|
+
const { fields, types, state, $t } = ctx.app;
|
|
47
|
+
const label = $t(
|
|
48
|
+
"aiAgentGetBundleInfoDone",
|
|
49
|
+
"Got bundle info for @field"
|
|
50
|
+
).replace("@field", params.field);
|
|
51
|
+
const field = fields.find(params.parentUuid, params.field);
|
|
52
|
+
if (!field) {
|
|
53
|
+
return {
|
|
54
|
+
label,
|
|
55
|
+
result: {
|
|
56
|
+
fieldLabel: params.field,
|
|
57
|
+
cardinality: -1,
|
|
58
|
+
currentCount: 0,
|
|
59
|
+
bundles: []
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const fieldKey = `${params.parentUuid}:${params.field}`;
|
|
64
|
+
const currentCount = state.getFieldBlockCount(fieldKey);
|
|
65
|
+
const bundles = field.allowedBundles.map((bundle) => {
|
|
66
|
+
const bundleDefinition = types.getBlockBundleDefinition(bundle);
|
|
67
|
+
const editableConfigs = types.editableFieldConfig.forEntityTypeAndBundle(ctx.itemEntityType, bundle).filter((c) => c.type !== "table").map((c) => ({
|
|
68
|
+
name: c.name,
|
|
69
|
+
type: c.type === "frame" || c.type === "markup" ? "markup" : "plain"
|
|
70
|
+
}));
|
|
71
|
+
const droppableConfigs = types.droppableFieldConfig.forEntityTypeAndBundle(ctx.itemEntityType, bundle).map((c) => ({
|
|
72
|
+
name: c.name,
|
|
73
|
+
type: c.type
|
|
74
|
+
}));
|
|
75
|
+
const blockFieldConfigs = types.fieldConfig.forEntityTypeAndBundle(ctx.itemEntityType, bundle).map((c) => ({
|
|
76
|
+
name: c.name,
|
|
77
|
+
label: c.label,
|
|
78
|
+
allowedBundles: c.allowedBundles,
|
|
79
|
+
cardinality: c.cardinality
|
|
80
|
+
}));
|
|
81
|
+
return {
|
|
82
|
+
bundle,
|
|
83
|
+
label: bundleDefinition?.label ?? bundle,
|
|
84
|
+
description: bundleDefinition?.description,
|
|
85
|
+
contentFields: [...editableConfigs, ...droppableConfigs],
|
|
86
|
+
paragraphFields: blockFieldConfigs
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
const nestingBundles = bundles.filter((b) => b.paragraphFields.length > 0);
|
|
90
|
+
const nestingInfo = nestingBundles.length ? nestingBundles.map(
|
|
91
|
+
(b) => `${b.bundle} has paragraph fields: ${b.paragraphFields.map((f) => `${f.name} (${f.allowedBundles.join(", ")})`).join(", ")}`
|
|
92
|
+
).join("; ") : void 0;
|
|
93
|
+
return {
|
|
94
|
+
label,
|
|
95
|
+
result: {
|
|
96
|
+
fieldLabel: field.label,
|
|
97
|
+
cardinality: field.cardinality,
|
|
98
|
+
currentCount,
|
|
99
|
+
bundles,
|
|
100
|
+
nestingInfo
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
import { parentSchema } from "../schemas.js";
|
|
4
|
+
const paramsSchema = z.object({
|
|
5
|
+
uuid: z.string().optional().describe(
|
|
6
|
+
"Paragraph UUID to get children for. If not provided, returns page-level paragraphs."
|
|
7
|
+
)
|
|
8
|
+
});
|
|
9
|
+
const paragraphSchema = z.object({
|
|
10
|
+
uuid: z.string().describe("The paragraph UUID"),
|
|
11
|
+
bundle: z.string().describe("The paragraph type")
|
|
12
|
+
});
|
|
13
|
+
const fieldWithParagraphsSchema = z.object({
|
|
14
|
+
label: z.string().describe("Human-readable field label"),
|
|
15
|
+
cardinality: z.number().describe("Max paragraphs allowed (-1 = unlimited)"),
|
|
16
|
+
parent: parentSchema.describe(
|
|
17
|
+
"Parent object to use when adding paragraphs to this field"
|
|
18
|
+
),
|
|
19
|
+
paragraphs: z.array(paragraphSchema).describe("Paragraphs in this field")
|
|
20
|
+
});
|
|
21
|
+
const resultSchema = z.object({
|
|
22
|
+
parentBundle: z.string().describe("The bundle type of the parent (page or paragraph)"),
|
|
23
|
+
fields: z.record(z.string().describe("Field name"), fieldWithParagraphsSchema).describe("Fields keyed by name, each with parent object and paragraphs")
|
|
24
|
+
});
|
|
25
|
+
export default defineBlokkliAgentTool({
|
|
26
|
+
name: "get_child_paragraphs",
|
|
27
|
+
description: "Get all child fields and paragraphs for the page or a paragraph. Returns parent objects ready for use with add_paragraphs. Use this to understand structure before adding paragraphs.",
|
|
28
|
+
category: "query",
|
|
29
|
+
volatile: true,
|
|
30
|
+
prunedSummary: (r) => {
|
|
31
|
+
const fieldCount = Object.keys(r.fields).length;
|
|
32
|
+
const paragraphCount = Object.values(r.fields).reduce(
|
|
33
|
+
(s, f) => s + f.paragraphs.length,
|
|
34
|
+
0
|
|
35
|
+
);
|
|
36
|
+
return `${paragraphCount} paragraphs across ${fieldCount} fields`;
|
|
37
|
+
},
|
|
38
|
+
modes: ["readonly", "editing", "translating", "review"],
|
|
39
|
+
label($t) {
|
|
40
|
+
return $t("aiAgentGetChildBlocks", "Get child blocks");
|
|
41
|
+
},
|
|
42
|
+
paramsSchema,
|
|
43
|
+
resultSchema,
|
|
44
|
+
execute(ctx, params) {
|
|
45
|
+
const { context, state, $t, blocks, types } = ctx.app;
|
|
46
|
+
const parentUuid = params.uuid || context.value.entityUuid;
|
|
47
|
+
const isPage = !params.uuid;
|
|
48
|
+
let parentBundle;
|
|
49
|
+
let parentEntityType;
|
|
50
|
+
if (isPage) {
|
|
51
|
+
parentBundle = context.value.entityBundle;
|
|
52
|
+
parentEntityType = context.value.entityType;
|
|
53
|
+
} else {
|
|
54
|
+
const block = blocks.getBlock(parentUuid);
|
|
55
|
+
if (!block) {
|
|
56
|
+
return {
|
|
57
|
+
label: $t("aiAgentBlockNotFound", "Block not found"),
|
|
58
|
+
result: { parentBundle: "unknown", fields: {} }
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
parentBundle = block.bundle;
|
|
62
|
+
parentEntityType = ctx.itemEntityType;
|
|
63
|
+
}
|
|
64
|
+
const fieldConfigs = types.fieldConfig.forEntityTypeAndBundle(
|
|
65
|
+
parentEntityType,
|
|
66
|
+
parentBundle
|
|
67
|
+
);
|
|
68
|
+
if (fieldConfigs.length === 0 && !isPage && params.uuid) {
|
|
69
|
+
return {
|
|
70
|
+
label: $t(
|
|
71
|
+
"aiAgentGetChildBlocksNone",
|
|
72
|
+
"@bundle has no child fields"
|
|
73
|
+
).replace("@bundle", types.getBlockLabel(parentBundle)),
|
|
74
|
+
result: { parentBundle, fields: {} },
|
|
75
|
+
affectedUuids: [params.uuid]
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const mutatedFieldsMap = new Map(
|
|
79
|
+
state.mutatedFields.value.filter((field) => field.entityUuid === parentUuid).map((field) => [field.name, field.list])
|
|
80
|
+
);
|
|
81
|
+
const fields = {};
|
|
82
|
+
for (const fieldConfig of fieldConfigs) {
|
|
83
|
+
const blockList = mutatedFieldsMap.get(fieldConfig.name) || [];
|
|
84
|
+
fields[fieldConfig.name] = {
|
|
85
|
+
label: fieldConfig.label,
|
|
86
|
+
cardinality: fieldConfig.cardinality,
|
|
87
|
+
parent: {
|
|
88
|
+
type: parentEntityType,
|
|
89
|
+
uuid: parentUuid,
|
|
90
|
+
field: fieldConfig.name
|
|
91
|
+
},
|
|
92
|
+
paragraphs: blockList.map((item) => ({
|
|
93
|
+
uuid: item.uuid,
|
|
94
|
+
bundle: item.bundle
|
|
95
|
+
}))
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const bundleLabel = isPage ? context.value.entityBundle : types.getBlockLabel(parentBundle);
|
|
99
|
+
return {
|
|
100
|
+
label: $t("aiAgentGetChildBlocksDone", "Got children of @bundle").replace(
|
|
101
|
+
"@bundle",
|
|
102
|
+
bundleLabel
|
|
103
|
+
),
|
|
104
|
+
result: { parentBundle, fields },
|
|
105
|
+
affectedUuids: params.uuid ? [params.uuid] : void 0
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
});
|