@blokkli/editor 2.0.0-alpha.32 → 2.0.0-alpha.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1 -24
- package/dist/module.json +1 -1
- package/dist/module.mjs +432 -10825
- 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 +7 -1
- package/package.json +29 -7
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { B as BlokkliModule } from '../../shared/editor.Iax3GCvt.mjs';
|
|
2
|
+
import 'nuxt/schema';
|
|
3
|
+
import 'consola';
|
|
4
|
+
import '../../../dist/global/types/definitions.js';
|
|
5
|
+
import '../../../dist/global/types/theme.js';
|
|
6
|
+
import '@nuxt/kit';
|
|
7
|
+
import '../../../dist/global/types/features.js';
|
|
8
|
+
|
|
9
|
+
type AgentProvider = 'anthropic' | 'openai';
|
|
10
|
+
type AgentModelDefinition = {
|
|
11
|
+
name: string;
|
|
12
|
+
label: string;
|
|
13
|
+
isDefault?: boolean;
|
|
14
|
+
pricing?: {
|
|
15
|
+
input: number;
|
|
16
|
+
cacheWrite: number;
|
|
17
|
+
cacheRead: number;
|
|
18
|
+
output: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
type AgentModuleOptions = {
|
|
22
|
+
/**
|
|
23
|
+
* Allowed origins for the fetch endpoint.
|
|
24
|
+
* URLs that the agent is allowed to fetch content from.
|
|
25
|
+
*/
|
|
26
|
+
allowedFetchOrigins?: string[];
|
|
27
|
+
/**
|
|
28
|
+
* AI provider to use.
|
|
29
|
+
* - 'anthropic': Uses Anthropic's Claude models (default)
|
|
30
|
+
* - 'openai': Uses OpenAI's GPT models (requires openai npm package)
|
|
31
|
+
*
|
|
32
|
+
* NOTE: The API key needs to be provided at runtime via runtime config:
|
|
33
|
+
*
|
|
34
|
+
* NUXT_BLOKKLI_AGENT_API_KEY=hunter2
|
|
35
|
+
*/
|
|
36
|
+
provider: AgentProvider;
|
|
37
|
+
/**
|
|
38
|
+
* Available models for the AI provider.
|
|
39
|
+
*
|
|
40
|
+
* At least one model must be defined. The model marked with `isDefault: true`
|
|
41
|
+
* (or the first model if none is marked) is used for conversations.
|
|
42
|
+
*/
|
|
43
|
+
models: AgentModelDefinition[];
|
|
44
|
+
/**
|
|
45
|
+
* Debug the system prompt.
|
|
46
|
+
*
|
|
47
|
+
* If true (and only during dev mode), the system prompt is adjusted to explicitly allow asking about internals (such as available MCP tools, the system prompt itself, etc.).
|
|
48
|
+
*/
|
|
49
|
+
debugPrompt?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Default prompt suggestions shown in the welcome screen.
|
|
52
|
+
*
|
|
53
|
+
* These are displayed as clickable buttons when the conversation is empty.
|
|
54
|
+
*/
|
|
55
|
+
defaultPrompts?: string[];
|
|
56
|
+
/**
|
|
57
|
+
* The name of the agent as shown to the user.
|
|
58
|
+
*/
|
|
59
|
+
agentName?: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
declare const _default: (options: AgentModuleOptions) => BlokkliModule<AgentModuleOptions>;
|
|
63
|
+
|
|
64
|
+
export { _default as default };
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { resolveFiles, createResolver, addServerHandler } from '@nuxt/kit';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { d as defineBlokkliModule } from '../../shared/editor.CGf7C_0M.mjs';
|
|
5
|
+
import * as fs from 'node:fs';
|
|
6
|
+
import { C as Collector, a as CollectedFile, d as defineCodeTemplate } from '../../shared/editor.DMFfaLVE.mjs';
|
|
7
|
+
|
|
8
|
+
function toImportName(prefix, fileName) {
|
|
9
|
+
const name = fileName.split(/[-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
10
|
+
return `${prefix}${name}`;
|
|
11
|
+
}
|
|
12
|
+
class CollectedAgentFile extends CollectedFile {
|
|
13
|
+
constructor(filePath, fileContents, composable, importPrefix) {
|
|
14
|
+
super(filePath, fileContents);
|
|
15
|
+
this.composable = composable;
|
|
16
|
+
this.importPrefix = importPrefix;
|
|
17
|
+
}
|
|
18
|
+
item = null;
|
|
19
|
+
async handleChange() {
|
|
20
|
+
if (!this.fileContents.includes(this.composable)) {
|
|
21
|
+
this.item = null;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
const ext = path.extname(this.filePath);
|
|
25
|
+
const fileName = path.basename(this.filePath, ext);
|
|
26
|
+
const baseName = fileName === "index" ? path.basename(path.dirname(this.filePath)) : fileName;
|
|
27
|
+
const importName = toImportName(this.importPrefix, baseName);
|
|
28
|
+
this.item = {
|
|
29
|
+
filePath: this.filePath,
|
|
30
|
+
importName
|
|
31
|
+
};
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
getItem() {
|
|
35
|
+
return this.item;
|
|
36
|
+
}
|
|
37
|
+
isValid() {
|
|
38
|
+
return this.item !== null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
class AgentCollector extends Collector {
|
|
42
|
+
needsFileContents = true;
|
|
43
|
+
options;
|
|
44
|
+
constructor(helper, options) {
|
|
45
|
+
super(helper);
|
|
46
|
+
this.options = options;
|
|
47
|
+
}
|
|
48
|
+
async init() {
|
|
49
|
+
for (const dir of this.options.dirs) {
|
|
50
|
+
try {
|
|
51
|
+
await fs.promises.access(dir);
|
|
52
|
+
} catch {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const files = (await resolveFiles(dir, ["**/*.ts", "**/*.js"], {
|
|
56
|
+
followSymbolicLinks: false
|
|
57
|
+
})).filter((f) => !f.endsWith(".d.ts"));
|
|
58
|
+
for (const filePath of files) {
|
|
59
|
+
await this.addFile(filePath);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
runHooks() {
|
|
64
|
+
return Promise.resolve();
|
|
65
|
+
}
|
|
66
|
+
async applies(filePath) {
|
|
67
|
+
const isInDir = this.options.dirs.some((dir) => filePath.startsWith(dir));
|
|
68
|
+
if (filePath.endsWith(".d.ts")) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const hasValidExtension = filePath.endsWith(".ts") || filePath.endsWith(".js");
|
|
72
|
+
return isInDir && hasValidExtension;
|
|
73
|
+
}
|
|
74
|
+
createCollectedFile(filePath, fileContents) {
|
|
75
|
+
return new CollectedAgentFile(
|
|
76
|
+
filePath,
|
|
77
|
+
fileContents,
|
|
78
|
+
this.options.composable,
|
|
79
|
+
this.options.importPrefix
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
getDependencyTypes() {
|
|
83
|
+
return [this.options.dependency];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get all collected items that are valid (contain the composable).
|
|
87
|
+
*/
|
|
88
|
+
getItems() {
|
|
89
|
+
return [...this.files.values()].filter((v) => v.isValid()).map((v) => v.getItem());
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function createClientTemplate(toolCollector, promptCollector, defaultPrompts, models, agentName) {
|
|
94
|
+
return defineCodeTemplate(
|
|
95
|
+
"agent-client",
|
|
96
|
+
(ctx) => {
|
|
97
|
+
const rel = (p) => ctx.helper.toModuleBuildRelative(p).replace(/\.ts$/, "");
|
|
98
|
+
const tools = toolCollector.getItems();
|
|
99
|
+
const prompts = promptCollector.getItems();
|
|
100
|
+
const imports = [];
|
|
101
|
+
const exports$1 = [];
|
|
102
|
+
for (const tool of tools) {
|
|
103
|
+
imports.push(`import ${tool.importName} from '${rel(tool.filePath)}'`);
|
|
104
|
+
}
|
|
105
|
+
if (tools.length === 0) {
|
|
106
|
+
exports$1.push("export const mcpTools = []");
|
|
107
|
+
} else {
|
|
108
|
+
exports$1.push(
|
|
109
|
+
`export const mcpTools = [
|
|
110
|
+
${tools.map((t) => t.importName).join(",\n ")}
|
|
111
|
+
]`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
for (const prompt of prompts) {
|
|
115
|
+
imports.push(
|
|
116
|
+
`import ${prompt.importName} from '${rel(prompt.filePath)}'`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
if (prompts.length === 0) {
|
|
120
|
+
exports$1.push("export const agentPrompts = []");
|
|
121
|
+
} else {
|
|
122
|
+
exports$1.push(
|
|
123
|
+
`export const agentPrompts = [
|
|
124
|
+
${prompts.map((p) => p.importName).join(",\n ")}
|
|
125
|
+
]`
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
exports$1.push(
|
|
129
|
+
`export const defaultPrompts = ${JSON.stringify(defaultPrompts)}`
|
|
130
|
+
);
|
|
131
|
+
exports$1.push(`export const models = ${JSON.stringify(models)}`);
|
|
132
|
+
exports$1.push(`export const agentName = ${JSON.stringify(agentName)}`);
|
|
133
|
+
const parts = [];
|
|
134
|
+
if (imports.length > 0) {
|
|
135
|
+
parts.push(imports.join("\n"));
|
|
136
|
+
}
|
|
137
|
+
parts.push(exports$1.join("\n"));
|
|
138
|
+
return parts.join("\n\n") + "\n";
|
|
139
|
+
},
|
|
140
|
+
() => {
|
|
141
|
+
return `import type { McpToolItem, AgentPromptItem } from '#blokkli/agent/app/types'
|
|
142
|
+
import type { AgentModelDefinition } from '#blokkli/agent/shared/types'
|
|
143
|
+
|
|
144
|
+
export const mcpTools: McpToolItem[]
|
|
145
|
+
export const agentPrompts: AgentPromptItem[]
|
|
146
|
+
export const defaultPrompts: string[]
|
|
147
|
+
export const agentName: string
|
|
148
|
+
export const models: AgentModelDefinition[]
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function createServerTemplate(options) {
|
|
155
|
+
const {
|
|
156
|
+
moduleOptions,
|
|
157
|
+
providersPath,
|
|
158
|
+
sharedTypesPath,
|
|
159
|
+
skillsCollector,
|
|
160
|
+
skillsTypesPath,
|
|
161
|
+
systemPromptCollector,
|
|
162
|
+
systemPromptTypesPath
|
|
163
|
+
} = options;
|
|
164
|
+
const { allowedFetchOrigins, provider, models } = moduleOptions;
|
|
165
|
+
return defineCodeTemplate(
|
|
166
|
+
"agent-server",
|
|
167
|
+
(ctx) => {
|
|
168
|
+
const rel = (p) => ctx.helper.toModuleBuildRelative(p).replace(/\.ts$/, "");
|
|
169
|
+
const imports = [];
|
|
170
|
+
if (provider === "openai") {
|
|
171
|
+
imports.push(
|
|
172
|
+
`import { createOpenAIProvider } from '${rel(providersPath)}/openai'`
|
|
173
|
+
);
|
|
174
|
+
} else {
|
|
175
|
+
imports.push(
|
|
176
|
+
`import { createAnthropicProvider } from '${rel(providersPath)}/anthropic'`
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
const providerCreate = provider === "openai" ? "createOpenAIProvider()" : "createAnthropicProvider()";
|
|
180
|
+
const skills = skillsCollector.getItems();
|
|
181
|
+
for (const skill of skills) {
|
|
182
|
+
imports.push(`import ${skill.importName} from '${rel(skill.filePath)}'`);
|
|
183
|
+
}
|
|
184
|
+
const skillsExport = skills.length === 0 ? `export const skills = []` : `export const skills = [
|
|
185
|
+
${skills.map((s) => s.importName).join(",\n ")}
|
|
186
|
+
]`;
|
|
187
|
+
const systemPrompts = systemPromptCollector.getItems();
|
|
188
|
+
for (const sp of systemPrompts) {
|
|
189
|
+
imports.push(`import ${sp.importName} from '${rel(sp.filePath)}'`);
|
|
190
|
+
}
|
|
191
|
+
const systemPromptsExport = systemPrompts.length === 0 ? `export const systemPrompts = []` : `export const systemPrompts = [
|
|
192
|
+
${systemPrompts.map((sp) => sp.importName).join(",\n ")}
|
|
193
|
+
]`;
|
|
194
|
+
const originsJson = JSON.stringify(allowedFetchOrigins, null, 2);
|
|
195
|
+
return `${imports.join("\n")}
|
|
196
|
+
|
|
197
|
+
export const allowedFetchOrigins = ${originsJson}
|
|
198
|
+
|
|
199
|
+
export const provider = ${providerCreate}
|
|
200
|
+
|
|
201
|
+
export const models = ${JSON.stringify(models)}
|
|
202
|
+
export const debugPrompt = ${!!moduleOptions.debugPrompt}
|
|
203
|
+
|
|
204
|
+
${skillsExport}
|
|
205
|
+
|
|
206
|
+
${systemPromptsExport}
|
|
207
|
+
`;
|
|
208
|
+
},
|
|
209
|
+
(ctx) => {
|
|
210
|
+
const rel = (p) => ctx.helper.toModuleBuildRelative(p).replace(/\.ts$/, "");
|
|
211
|
+
return `import type { AIProvider } from '${rel(providersPath)}/types'
|
|
212
|
+
import type { SkillDefinition } from '${rel(skillsTypesPath)}'
|
|
213
|
+
import type { SystemPromptDefinition } from '${rel(systemPromptTypesPath)}'
|
|
214
|
+
import type { AgentModelDefinition } from '${rel(sharedTypesPath)}'
|
|
215
|
+
|
|
216
|
+
export const allowedFetchOrigins: string[]
|
|
217
|
+
export const provider: AIProvider
|
|
218
|
+
export const models: AgentModelDefinition[]
|
|
219
|
+
export const debugPrompt: boolean
|
|
220
|
+
export const skills: SkillDefinition[]
|
|
221
|
+
export const systemPrompts: SystemPromptDefinition[]
|
|
222
|
+
`;
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
context: "server",
|
|
226
|
+
write: true
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const AGENT_ROUTE = "/api/blokkli/agent";
|
|
232
|
+
const FETCH_ROUTE = "/api/blokkli/agent/fetch";
|
|
233
|
+
const index = defineBlokkliModule({
|
|
234
|
+
alterOptions: (options) => {
|
|
235
|
+
options.featureImports ||= [];
|
|
236
|
+
const moduleResolver = createResolver(
|
|
237
|
+
fileURLToPath(new URL("./", import.meta.url))
|
|
238
|
+
);
|
|
239
|
+
const featurePath = moduleResolver.resolve(
|
|
240
|
+
"./runtime/app/features/agent/index.vue"
|
|
241
|
+
);
|
|
242
|
+
options.featureImports.push(featurePath);
|
|
243
|
+
},
|
|
244
|
+
async setup(ctx, options) {
|
|
245
|
+
if (!options.models?.length) {
|
|
246
|
+
throw new Error(
|
|
247
|
+
'Missing bl\xF6kkli agent option "models". At least one model must be defined.'
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
if (!options.provider) {
|
|
251
|
+
throw new Error('Missing bl\xF6kkli agent option "provider".');
|
|
252
|
+
}
|
|
253
|
+
if (!ctx.helper.nuxt.options.nitro?.experimental?.websocket) {
|
|
254
|
+
ctx.helper.logger.error(`Nitro experimental WebSocket support is not enabled.
|
|
255
|
+
|
|
256
|
+
export default defineNuxtConfig({
|
|
257
|
+
nitro: {
|
|
258
|
+
experimental: {
|
|
259
|
+
websocket: true
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
})
|
|
263
|
+
`);
|
|
264
|
+
throw new Error("Experimental WebSocket support of Nitro is not enabled.");
|
|
265
|
+
}
|
|
266
|
+
const nuxt = ctx.helper.nuxt;
|
|
267
|
+
const moduleResolver = createResolver(
|
|
268
|
+
fileURLToPath(new URL("./", import.meta.url))
|
|
269
|
+
);
|
|
270
|
+
ctx.helper.nuxt.options.runtimeConfig.blokkli ||= {};
|
|
271
|
+
ctx.helper.nuxt.options.runtimeConfig.blokkli.agent ||= {};
|
|
272
|
+
ctx.helper.nuxt.options.runtimeConfig.blokkli.agent.apiKey ||= "";
|
|
273
|
+
ctx.helper.nuxt.options.runtimeConfig.blokkli.agent.authSecret ||= "";
|
|
274
|
+
ctx.helper.addAlias(
|
|
275
|
+
"#blokkli/agent/app",
|
|
276
|
+
moduleResolver.resolve("./runtime/app")
|
|
277
|
+
);
|
|
278
|
+
ctx.helper.addAlias(
|
|
279
|
+
"#blokkli/agent/shared",
|
|
280
|
+
moduleResolver.resolve("./runtime/shared")
|
|
281
|
+
);
|
|
282
|
+
ctx.helper.addAlias(
|
|
283
|
+
"#blokkli/agent/server",
|
|
284
|
+
moduleResolver.resolve("./runtime/server")
|
|
285
|
+
);
|
|
286
|
+
const moduleToolsDir = moduleResolver.resolve("./runtime/app/tools");
|
|
287
|
+
const projectToolsDir = path.resolve(nuxt.options.rootDir, "blokkli/tools");
|
|
288
|
+
const mcpTools = new AgentCollector(ctx.helper, {
|
|
289
|
+
composable: "defineBlokkliAgentTool",
|
|
290
|
+
importPrefix: "tool",
|
|
291
|
+
dependency: "agent-mcp-tools",
|
|
292
|
+
dirs: [moduleToolsDir, projectToolsDir]
|
|
293
|
+
});
|
|
294
|
+
await mcpTools.init();
|
|
295
|
+
ctx.context.addCollector(mcpTools);
|
|
296
|
+
const projectPromptsDir = path.resolve(
|
|
297
|
+
nuxt.options.rootDir,
|
|
298
|
+
"blokkli/prompts"
|
|
299
|
+
);
|
|
300
|
+
const promptsCollector = new AgentCollector(ctx.helper, {
|
|
301
|
+
composable: "defineBlokkliAgentPrompt",
|
|
302
|
+
importPrefix: "prompt",
|
|
303
|
+
dependency: "agent-prompts",
|
|
304
|
+
dirs: [projectPromptsDir]
|
|
305
|
+
});
|
|
306
|
+
await promptsCollector.init();
|
|
307
|
+
ctx.context.addCollector(promptsCollector);
|
|
308
|
+
ctx.context.addTemplate(
|
|
309
|
+
createClientTemplate(
|
|
310
|
+
mcpTools,
|
|
311
|
+
promptsCollector,
|
|
312
|
+
options.defaultPrompts || [],
|
|
313
|
+
options.models,
|
|
314
|
+
options.agentName ?? "Blocki"
|
|
315
|
+
)
|
|
316
|
+
);
|
|
317
|
+
const relativeToolsDir = path.relative(
|
|
318
|
+
nuxt.options.buildDir,
|
|
319
|
+
projectToolsDir
|
|
320
|
+
);
|
|
321
|
+
nuxt.options.typescript.tsConfig ||= {};
|
|
322
|
+
nuxt.options.typescript.tsConfig.include ||= [];
|
|
323
|
+
nuxt.options.typescript.tsConfig.include.push(relativeToolsDir);
|
|
324
|
+
const relativePromptsDir = path.relative(
|
|
325
|
+
nuxt.options.buildDir,
|
|
326
|
+
projectPromptsDir
|
|
327
|
+
);
|
|
328
|
+
nuxt.options.typescript.tsConfig.include.push(relativePromptsDir);
|
|
329
|
+
const moduleSkillsDir = moduleResolver.resolve(
|
|
330
|
+
"./runtime/server/default-skills"
|
|
331
|
+
);
|
|
332
|
+
const projectSkillsDir = path.resolve(
|
|
333
|
+
nuxt.options.rootDir,
|
|
334
|
+
"blokkli/skills"
|
|
335
|
+
);
|
|
336
|
+
const skillsCollector = new AgentCollector(ctx.helper, {
|
|
337
|
+
composable: "defineBlokkliAgentSkill",
|
|
338
|
+
importPrefix: "skill",
|
|
339
|
+
dependency: "agent-server",
|
|
340
|
+
dirs: [moduleSkillsDir, projectSkillsDir]
|
|
341
|
+
});
|
|
342
|
+
await skillsCollector.init();
|
|
343
|
+
ctx.context.addCollector(skillsCollector);
|
|
344
|
+
const moduleSystemPromptsDir = moduleResolver.resolve(
|
|
345
|
+
"./runtime/server/default-system-prompts"
|
|
346
|
+
);
|
|
347
|
+
const projectSystemPromptsDir = path.resolve(
|
|
348
|
+
nuxt.options.rootDir,
|
|
349
|
+
"blokkli/system-prompts"
|
|
350
|
+
);
|
|
351
|
+
const systemPromptCollector = new AgentCollector(ctx.helper, {
|
|
352
|
+
composable: "defineBlokkliAgentSystemPrompt",
|
|
353
|
+
importPrefix: "systemPrompt",
|
|
354
|
+
dependency: "agent-server",
|
|
355
|
+
dirs: [moduleSystemPromptsDir, projectSystemPromptsDir]
|
|
356
|
+
});
|
|
357
|
+
await systemPromptCollector.init();
|
|
358
|
+
ctx.context.addCollector(systemPromptCollector);
|
|
359
|
+
ctx.context.addTemplate(
|
|
360
|
+
createServerTemplate({
|
|
361
|
+
moduleOptions: options,
|
|
362
|
+
providersPath: moduleResolver.resolve("./runtime/server/providers"),
|
|
363
|
+
sharedTypesPath: moduleResolver.resolve("./runtime/shared/types"),
|
|
364
|
+
skillsCollector,
|
|
365
|
+
skillsTypesPath: moduleResolver.resolve(
|
|
366
|
+
"./runtime/server/skills/types"
|
|
367
|
+
),
|
|
368
|
+
systemPromptCollector,
|
|
369
|
+
systemPromptTypesPath: moduleResolver.resolve(
|
|
370
|
+
"./runtime/server/system-prompts/types"
|
|
371
|
+
)
|
|
372
|
+
})
|
|
373
|
+
);
|
|
374
|
+
addServerHandler({
|
|
375
|
+
route: AGENT_ROUTE,
|
|
376
|
+
handler: moduleResolver.resolve("./runtime/server/agent"),
|
|
377
|
+
lazy: true
|
|
378
|
+
});
|
|
379
|
+
addServerHandler({
|
|
380
|
+
route: FETCH_ROUTE,
|
|
381
|
+
handler: moduleResolver.resolve("./runtime/server/fetch")
|
|
382
|
+
});
|
|
383
|
+
const relativeSkillsDir = path.relative(
|
|
384
|
+
nuxt.options.buildDir,
|
|
385
|
+
projectSkillsDir
|
|
386
|
+
);
|
|
387
|
+
const relativeSystemPromptsDir = path.relative(
|
|
388
|
+
nuxt.options.buildDir,
|
|
389
|
+
projectSystemPromptsDir
|
|
390
|
+
);
|
|
391
|
+
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
392
|
+
nitroConfig.typescript ||= {};
|
|
393
|
+
nitroConfig.typescript.tsConfig ||= {};
|
|
394
|
+
nitroConfig.typescript.tsConfig.include ||= [];
|
|
395
|
+
nitroConfig.typescript.tsConfig.include.push(relativeSkillsDir);
|
|
396
|
+
nitroConfig.typescript.tsConfig.include.push(relativeSystemPromptsDir);
|
|
397
|
+
});
|
|
398
|
+
nuxt.hook("nitro:init", (nitro) => {
|
|
399
|
+
nitro.hooks.hook("types:extend", (types) => {
|
|
400
|
+
Reflect.deleteProperty(types.routes, AGENT_ROUTE);
|
|
401
|
+
Reflect.deleteProperty(types.routes, FETCH_ROUTE);
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
export { index as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Ref } from '#imports';
|
|
2
|
+
import { type Attachment, type ConversationItem, type ActiveItem, type MutationAction } from '#blokkli/agent/app/types';
|
|
3
|
+
import type { ClientPlanState, UsageTurn } from '#blokkli/agent/shared/types';
|
|
4
|
+
import type { AgentConversationSummary } from '#blokkli/agent/app/features/agent/types';
|
|
5
|
+
import type { BlokkliApp } from '#blokkli/editor/types/app';
|
|
6
|
+
import type { FullBlokkliAdapter } from '#blokkli/editor/adapter';
|
|
7
|
+
export type PendingMutationState = {
|
|
8
|
+
action: MutationAction;
|
|
9
|
+
resolve: (approved: boolean) => void;
|
|
10
|
+
};
|
|
11
|
+
export type PendingToolCall = {
|
|
12
|
+
toolName: string;
|
|
13
|
+
params: Record<string, unknown>;
|
|
14
|
+
};
|
|
15
|
+
export type AgentProviderOptions = {
|
|
16
|
+
app: BlokkliApp;
|
|
17
|
+
adapter: FullBlokkliAdapter<any>;
|
|
18
|
+
itemEntityType: string;
|
|
19
|
+
};
|
|
20
|
+
export type AgentProvider = {
|
|
21
|
+
isConnected: Readonly<Ref<boolean>>;
|
|
22
|
+
isReady: Readonly<Ref<boolean>>;
|
|
23
|
+
hasBeenReady: Readonly<Ref<boolean>>;
|
|
24
|
+
connect: () => void;
|
|
25
|
+
disconnect: () => void;
|
|
26
|
+
conversation: Ref<ConversationItem[]>;
|
|
27
|
+
activeItem: Ref<ActiveItem | null>;
|
|
28
|
+
isProcessing: Ref<boolean>;
|
|
29
|
+
isThinking: Ref<boolean>;
|
|
30
|
+
autoApprove: Ref<boolean>;
|
|
31
|
+
pendingMutation: Ref<PendingMutationState | null>;
|
|
32
|
+
pendingToolCall: Ref<PendingToolCall | null>;
|
|
33
|
+
plan: Ref<ClientPlanState | null>;
|
|
34
|
+
approvePlan: () => void;
|
|
35
|
+
rejectPlan: () => void;
|
|
36
|
+
usageTurns: Ref<UsageTurn[]>;
|
|
37
|
+
sendPrompt: (text: string, displayPrompt?: string, selectedUuids?: string[], attachments?: Attachment[]) => void;
|
|
38
|
+
retry: () => void;
|
|
39
|
+
approve: () => void;
|
|
40
|
+
reject: () => void;
|
|
41
|
+
setAutoApprove: (value: boolean) => void;
|
|
42
|
+
cancel: () => void;
|
|
43
|
+
newConversation: () => void;
|
|
44
|
+
getTranscript: () => void;
|
|
45
|
+
onToolComponentDone: (result: unknown) => void;
|
|
46
|
+
transcriptContent: Ref<string>;
|
|
47
|
+
showTranscript: Ref<boolean>;
|
|
48
|
+
conversationList: Ref<AgentConversationSummary[]>;
|
|
49
|
+
showConversationList: Ref<boolean>;
|
|
50
|
+
activeConversationId: Readonly<Ref<string | null>>;
|
|
51
|
+
switchConversation: (id: string) => void;
|
|
52
|
+
deleteConversation: (id: string) => void;
|
|
53
|
+
refreshConversationList: () => Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
export default function (app: BlokkliApp, adapter: FullBlokkliAdapter<any>, agentName: string): AgentProvider;
|