@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,49 @@
|
|
|
1
|
+
import type { PageContext, EditMode } from '../../shared/types.js';
|
|
2
|
+
import type { ResolvedSkill } from '../skills/types.js';
|
|
3
|
+
export type ActivePlanContext = {
|
|
4
|
+
title: string;
|
|
5
|
+
totalSteps: number;
|
|
6
|
+
completedSteps: number;
|
|
7
|
+
currentStep: {
|
|
8
|
+
label: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
remainingSteps: string[];
|
|
12
|
+
};
|
|
13
|
+
export type SystemPromptContext = {
|
|
14
|
+
pageContext: PageContext;
|
|
15
|
+
resolvedSkills: ResolvedSkill[];
|
|
16
|
+
lazyTools: {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}[];
|
|
20
|
+
isDebugMode: boolean;
|
|
21
|
+
activePlan?: ActivePlanContext;
|
|
22
|
+
loadedSkills: ReadonlySet<string>;
|
|
23
|
+
};
|
|
24
|
+
export type SystemPromptDefinition = {
|
|
25
|
+
id: string;
|
|
26
|
+
title: string;
|
|
27
|
+
weight: number;
|
|
28
|
+
modes?: EditMode[];
|
|
29
|
+
/**
|
|
30
|
+
* Cache group for prompt caching optimization.
|
|
31
|
+
* - 'static': Content never changes (cached indefinitely within TTL).
|
|
32
|
+
* - 'per-page': Content is stable across turns within a conversation (cached per page context).
|
|
33
|
+
* - Omit for per-turn content that changes every turn (e.g. plan progress).
|
|
34
|
+
*
|
|
35
|
+
* Prompts are sorted by cache group (static → per-page → per-turn), then by weight.
|
|
36
|
+
* This ensures stable prefixes for both Anthropic (explicit breakpoints) and OpenAI (automatic prefix caching).
|
|
37
|
+
*/
|
|
38
|
+
cacheGroup?: 'static' | 'per-page';
|
|
39
|
+
getPrompt: (context: Readonly<SystemPromptContext>) => string | null;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A single block in the structured system prompt.
|
|
43
|
+
* Providers use cacheHint to apply provider-specific caching strategies.
|
|
44
|
+
*/
|
|
45
|
+
export type SystemPromptBlock = {
|
|
46
|
+
text: string;
|
|
47
|
+
/** When set, signals that everything up to and including this block can be cached. */
|
|
48
|
+
cacheHint?: 'ephemeral';
|
|
49
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PLACEHOLDER_USER_NAME = "@BKUSERNAME";
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Defines an AI model with optional pricing for cost calculation.
|
|
4
|
+
*/
|
|
5
|
+
export type AgentModelDefinition = {
|
|
6
|
+
/** Model identifier passed to the AI provider (e.g. 'claude-haiku-4-5'). */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Human-readable label shown in the UI. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Whether this is the default model. The first model is used if none is marked. */
|
|
11
|
+
isDefault?: boolean;
|
|
12
|
+
/** Per-million-token pricing. When set, cost is computed and shown in the UI. */
|
|
13
|
+
pricing?: {
|
|
14
|
+
input: number;
|
|
15
|
+
cacheWrite: number;
|
|
16
|
+
cacheRead: number;
|
|
17
|
+
output: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Text content block in a message.
|
|
22
|
+
*/
|
|
23
|
+
export type GenericTextBlock = {
|
|
24
|
+
type: 'text';
|
|
25
|
+
text: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Skill content block - loaded skill guidelines injected into the conversation.
|
|
29
|
+
* Providers serialize this as a text block for the API.
|
|
30
|
+
*/
|
|
31
|
+
export type GenericSkillBlock = {
|
|
32
|
+
type: 'skill';
|
|
33
|
+
name: string;
|
|
34
|
+
text: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Tool use content block - assistant requesting tool execution.
|
|
38
|
+
*/
|
|
39
|
+
export type GenericToolUseBlock = {
|
|
40
|
+
type: 'tool_use';
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
input: unknown;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Tool result content block - result of tool execution.
|
|
47
|
+
*/
|
|
48
|
+
export type GenericToolResultBlock = {
|
|
49
|
+
type: 'tool_result';
|
|
50
|
+
tool_use_id: string;
|
|
51
|
+
content: string;
|
|
52
|
+
is_error?: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Content block in a message.
|
|
56
|
+
*/
|
|
57
|
+
export type GenericContentBlock = GenericTextBlock | GenericSkillBlock | GenericToolUseBlock | GenericToolResultBlock;
|
|
58
|
+
/**
|
|
59
|
+
* Generic message format used internally.
|
|
60
|
+
* Provider implementations convert to/from this format.
|
|
61
|
+
*/
|
|
62
|
+
export type GenericMessage = {
|
|
63
|
+
role: 'user' | 'assistant';
|
|
64
|
+
content: string | GenericContentBlock[];
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Snapshot of conversation state for persistence.
|
|
68
|
+
* Sent from server to client after each completed turn.
|
|
69
|
+
* The hash prevents client-side tampering.
|
|
70
|
+
*/
|
|
71
|
+
export type ConversationStateSnapshot = {
|
|
72
|
+
messages: GenericMessage[];
|
|
73
|
+
activatedLazyTools: string[];
|
|
74
|
+
hash: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Content field metadata for a block bundle.
|
|
78
|
+
* Unifies editable text fields and droppable reference/link fields.
|
|
79
|
+
*/
|
|
80
|
+
export type BlockBundleContentField = {
|
|
81
|
+
name: string;
|
|
82
|
+
label: string;
|
|
83
|
+
type: 'plain' | 'markup';
|
|
84
|
+
} | {
|
|
85
|
+
name: string;
|
|
86
|
+
label: string;
|
|
87
|
+
type: 'reference' | 'link';
|
|
88
|
+
allowed: {
|
|
89
|
+
type: string;
|
|
90
|
+
bundles: string[];
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Block field (nested blocks) metadata for a block bundle.
|
|
95
|
+
*/
|
|
96
|
+
export type BlockBundleBlockField = {
|
|
97
|
+
name: string;
|
|
98
|
+
label: string;
|
|
99
|
+
allowedBundles: string[];
|
|
100
|
+
cardinality: number;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Block bundle definition with field metadata.
|
|
104
|
+
*/
|
|
105
|
+
export type BlockBundle = {
|
|
106
|
+
id: string;
|
|
107
|
+
label: string;
|
|
108
|
+
description?: string;
|
|
109
|
+
contentFields: BlockBundleContentField[];
|
|
110
|
+
paragraphFields: BlockBundleBlockField[];
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Edit mode determines what actions the user is allowed to perform.
|
|
114
|
+
*/
|
|
115
|
+
export type EditMode = 'readonly' | 'editing' | 'translating' | 'review';
|
|
116
|
+
/**
|
|
117
|
+
* Fragment definition for reusable content blocks.
|
|
118
|
+
*/
|
|
119
|
+
export type Fragment = {
|
|
120
|
+
name: string;
|
|
121
|
+
label: string;
|
|
122
|
+
description?: string;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Page context sent from client to server on init.
|
|
126
|
+
* Provides the AI agent with knowledge of the page and available block types.
|
|
127
|
+
*/
|
|
128
|
+
export type PageContext = {
|
|
129
|
+
/** The page title */
|
|
130
|
+
title: string;
|
|
131
|
+
/** The page entity type (use this as parent.type when adding root-level blocks) */
|
|
132
|
+
entityType: string;
|
|
133
|
+
/** The page entity UUID (use this as parent.uuid when adding root-level blocks) */
|
|
134
|
+
entityUuid: string;
|
|
135
|
+
/** The page bundle machine name (e.g., "page", "article") */
|
|
136
|
+
entityBundle: string;
|
|
137
|
+
/** The page bundle label (e.g., "Article", "Landing Page") */
|
|
138
|
+
bundleLabel: string;
|
|
139
|
+
/** The item entity type for blocks */
|
|
140
|
+
itemEntityType: string;
|
|
141
|
+
/** Available block bundles */
|
|
142
|
+
bundles: BlockBundle[];
|
|
143
|
+
/** The UI/interface language code (e.g., "en", "de") */
|
|
144
|
+
interfaceLanguage: string;
|
|
145
|
+
/** The content/entity language code (e.g., "en", "de") */
|
|
146
|
+
entityLanguage: string;
|
|
147
|
+
/** Whether the entity is published or null if entity is not publishable */
|
|
148
|
+
isPublished: boolean | null;
|
|
149
|
+
/** The current edit mode - determines what actions are available */
|
|
150
|
+
editMode: EditMode;
|
|
151
|
+
/** Available fragments (reusable content blocks) */
|
|
152
|
+
fragments: Fragment[];
|
|
153
|
+
/** Content fields on the page entity itself (e.g., lead text, hero image) */
|
|
154
|
+
entityContentFields: BlockBundleContentField[];
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Classified error categories for AI provider errors.
|
|
158
|
+
* Both Anthropic and OpenAI SDKs map to these via HTTP status codes.
|
|
159
|
+
*/
|
|
160
|
+
export declare const agentErrorTypeSchema: z.ZodEnum<{
|
|
161
|
+
authentication: "authentication";
|
|
162
|
+
rate_limit: "rate_limit";
|
|
163
|
+
overloaded: "overloaded";
|
|
164
|
+
not_found: "not_found";
|
|
165
|
+
bad_request: "bad_request";
|
|
166
|
+
connection: "connection";
|
|
167
|
+
unauthorized: "unauthorized";
|
|
168
|
+
unknown: "unknown";
|
|
169
|
+
}>;
|
|
170
|
+
export type AgentErrorType = z.infer<typeof agentErrorTypeSchema>;
|
|
171
|
+
/**
|
|
172
|
+
* A single step in a plan as seen by the client (no description — that stays server-side).
|
|
173
|
+
*/
|
|
174
|
+
export type ClientPlanStep = {
|
|
175
|
+
label: string;
|
|
176
|
+
status: 'pending' | 'in_progress' | 'completed';
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Plan state sent to the client. Contains only labels and statuses,
|
|
180
|
+
* not the detailed descriptions that the LLM uses internally.
|
|
181
|
+
*/
|
|
182
|
+
export type ClientPlanState = {
|
|
183
|
+
title: string;
|
|
184
|
+
steps: ClientPlanStep[];
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Token pricing rates per million tokens, captured at the time of the turn.
|
|
188
|
+
*/
|
|
189
|
+
export type UsagePricing = {
|
|
190
|
+
input: number;
|
|
191
|
+
cacheWrite: number;
|
|
192
|
+
cacheRead: number;
|
|
193
|
+
output: number;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* A single usage turn as sent by the server and stored by the client.
|
|
197
|
+
* Contains raw token counts and the pricing that was active at the time,
|
|
198
|
+
* so cost can be computed correctly even after pricing changes.
|
|
199
|
+
*/
|
|
200
|
+
export type UsageTurn = {
|
|
201
|
+
inputTokens: number;
|
|
202
|
+
outputTokens: number;
|
|
203
|
+
cacheCreationInputTokens: number;
|
|
204
|
+
cacheReadInputTokens: number;
|
|
205
|
+
pricing: UsagePricing | null;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Tool definition sent from client to server on init.
|
|
209
|
+
*/
|
|
210
|
+
export type ClientToolDefinition = {
|
|
211
|
+
name: string;
|
|
212
|
+
description: string;
|
|
213
|
+
input_schema: Record<string, unknown>;
|
|
214
|
+
lazy?: boolean;
|
|
215
|
+
category?: 'query' | 'mutation';
|
|
216
|
+
volatile?: boolean;
|
|
217
|
+
};
|
|
218
|
+
export type PageStructureBlock = {
|
|
219
|
+
uuid: string;
|
|
220
|
+
bundle: string;
|
|
221
|
+
contentFields?: Record<string, string>;
|
|
222
|
+
fields?: Record<string, PageStructureBlock[]>;
|
|
223
|
+
};
|
|
224
|
+
export declare const pageStructureSchema: z.ZodObject<{
|
|
225
|
+
totalParagraphs: z.ZodNumber;
|
|
226
|
+
fields: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodType<PageStructureBlock, unknown, z.core.$ZodTypeInternals<PageStructureBlock, unknown>>>>;
|
|
227
|
+
entityContentFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
export type PageStructure = z.infer<typeof pageStructureSchema>;
|
|
230
|
+
export declare const clientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
231
|
+
type: z.ZodLiteral<"authenticate">;
|
|
232
|
+
authToken: z.ZodString;
|
|
233
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
234
|
+
type: z.ZodLiteral<"init">;
|
|
235
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
236
|
+
name: z.ZodString;
|
|
237
|
+
description: z.ZodString;
|
|
238
|
+
input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
239
|
+
lazy: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
241
|
+
query: "query";
|
|
242
|
+
mutation: "mutation";
|
|
243
|
+
}>>;
|
|
244
|
+
volatile: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
}, z.core.$strip>>;
|
|
246
|
+
pageContext: z.ZodObject<{
|
|
247
|
+
title: z.ZodString;
|
|
248
|
+
entityType: z.ZodString;
|
|
249
|
+
entityUuid: z.ZodString;
|
|
250
|
+
entityBundle: z.ZodString;
|
|
251
|
+
bundleLabel: z.ZodString;
|
|
252
|
+
itemEntityType: z.ZodString;
|
|
253
|
+
bundles: z.ZodArray<z.ZodObject<{
|
|
254
|
+
id: z.ZodString;
|
|
255
|
+
label: z.ZodString;
|
|
256
|
+
description: z.ZodOptional<z.ZodString>;
|
|
257
|
+
contentFields: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
258
|
+
name: z.ZodString;
|
|
259
|
+
label: z.ZodString;
|
|
260
|
+
type: z.ZodEnum<{
|
|
261
|
+
plain: "plain";
|
|
262
|
+
markup: "markup";
|
|
263
|
+
}>;
|
|
264
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
265
|
+
name: z.ZodString;
|
|
266
|
+
label: z.ZodString;
|
|
267
|
+
type: z.ZodEnum<{
|
|
268
|
+
reference: "reference";
|
|
269
|
+
link: "link";
|
|
270
|
+
}>;
|
|
271
|
+
allowed: z.ZodArray<z.ZodObject<{
|
|
272
|
+
type: z.ZodString;
|
|
273
|
+
bundles: z.ZodArray<z.ZodString>;
|
|
274
|
+
}, z.core.$strip>>;
|
|
275
|
+
}, z.core.$strip>]>>;
|
|
276
|
+
paragraphFields: z.ZodArray<z.ZodObject<{
|
|
277
|
+
name: z.ZodString;
|
|
278
|
+
label: z.ZodString;
|
|
279
|
+
allowedBundles: z.ZodArray<z.ZodString>;
|
|
280
|
+
cardinality: z.ZodNumber;
|
|
281
|
+
}, z.core.$strip>>;
|
|
282
|
+
}, z.core.$strip>>;
|
|
283
|
+
interfaceLanguage: z.ZodString;
|
|
284
|
+
entityLanguage: z.ZodString;
|
|
285
|
+
isPublished: z.ZodNullable<z.ZodBoolean>;
|
|
286
|
+
editMode: z.ZodEnum<{
|
|
287
|
+
readonly: "readonly";
|
|
288
|
+
editing: "editing";
|
|
289
|
+
translating: "translating";
|
|
290
|
+
review: "review";
|
|
291
|
+
}>;
|
|
292
|
+
fragments: z.ZodArray<z.ZodObject<{
|
|
293
|
+
name: z.ZodString;
|
|
294
|
+
label: z.ZodString;
|
|
295
|
+
description: z.ZodOptional<z.ZodString>;
|
|
296
|
+
}, z.core.$strip>>;
|
|
297
|
+
entityContentFields: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
298
|
+
name: z.ZodString;
|
|
299
|
+
label: z.ZodString;
|
|
300
|
+
type: z.ZodEnum<{
|
|
301
|
+
plain: "plain";
|
|
302
|
+
markup: "markup";
|
|
303
|
+
}>;
|
|
304
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
305
|
+
name: z.ZodString;
|
|
306
|
+
label: z.ZodString;
|
|
307
|
+
type: z.ZodEnum<{
|
|
308
|
+
reference: "reference";
|
|
309
|
+
link: "link";
|
|
310
|
+
}>;
|
|
311
|
+
allowed: z.ZodArray<z.ZodObject<{
|
|
312
|
+
type: z.ZodString;
|
|
313
|
+
bundles: z.ZodArray<z.ZodString>;
|
|
314
|
+
}, z.core.$strip>>;
|
|
315
|
+
}, z.core.$strip>]>>;
|
|
316
|
+
}, z.core.$strip>;
|
|
317
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
318
|
+
type: z.ZodLiteral<"start">;
|
|
319
|
+
prompt: z.ZodString;
|
|
320
|
+
selectedUuids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
321
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
322
|
+
type: z.ZodLiteral<"tool_result">;
|
|
323
|
+
callId: z.ZodString;
|
|
324
|
+
result: z.ZodUnknown;
|
|
325
|
+
error: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
327
|
+
type: z.ZodLiteral<"cancel">;
|
|
328
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
329
|
+
type: z.ZodLiteral<"accept">;
|
|
330
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
331
|
+
type: z.ZodLiteral<"reject">;
|
|
332
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
333
|
+
type: z.ZodLiteral<"get_transcript">;
|
|
334
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
335
|
+
type: z.ZodLiteral<"new_conversation">;
|
|
336
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
337
|
+
type: z.ZodLiteral<"restore_conversation">;
|
|
338
|
+
state: z.ZodObject<{
|
|
339
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
340
|
+
role: z.ZodEnum<{
|
|
341
|
+
user: "user";
|
|
342
|
+
assistant: "assistant";
|
|
343
|
+
}>;
|
|
344
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
345
|
+
type: z.ZodLiteral<"text">;
|
|
346
|
+
text: z.ZodString;
|
|
347
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
348
|
+
type: z.ZodLiteral<"skill">;
|
|
349
|
+
name: z.ZodString;
|
|
350
|
+
text: z.ZodString;
|
|
351
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
352
|
+
type: z.ZodLiteral<"tool_use">;
|
|
353
|
+
id: z.ZodString;
|
|
354
|
+
name: z.ZodString;
|
|
355
|
+
input: z.ZodUnknown;
|
|
356
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
357
|
+
type: z.ZodLiteral<"tool_result">;
|
|
358
|
+
tool_use_id: z.ZodString;
|
|
359
|
+
content: z.ZodString;
|
|
360
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
361
|
+
}, z.core.$strip>], "type">>]>;
|
|
362
|
+
}, z.core.$strip>>;
|
|
363
|
+
activatedLazyTools: z.ZodArray<z.ZodString>;
|
|
364
|
+
hash: z.ZodString;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
367
|
+
type: z.ZodLiteral<"plan_approve">;
|
|
368
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
369
|
+
type: z.ZodLiteral<"plan_reject">;
|
|
370
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
371
|
+
type: z.ZodLiteral<"ping">;
|
|
372
|
+
}, z.core.$strip>], "type">;
|
|
373
|
+
/**
|
|
374
|
+
* Messages sent from client to server over WebSocket.
|
|
375
|
+
*/
|
|
376
|
+
export type ClientMessage = z.infer<typeof clientMessageSchema>;
|
|
377
|
+
/**
|
|
378
|
+
* Messages sent from server to client over WebSocket.
|
|
379
|
+
*/
|
|
380
|
+
export type ServerMessage = {
|
|
381
|
+
type: 'authenticated';
|
|
382
|
+
} | {
|
|
383
|
+
type: 'tool_call';
|
|
384
|
+
callId: string;
|
|
385
|
+
tool: string;
|
|
386
|
+
params: Record<string, unknown>;
|
|
387
|
+
} | {
|
|
388
|
+
type: 'thinking';
|
|
389
|
+
content?: string;
|
|
390
|
+
} | {
|
|
391
|
+
type: 'text';
|
|
392
|
+
content: string;
|
|
393
|
+
} | {
|
|
394
|
+
type: 'text_delta';
|
|
395
|
+
content: string;
|
|
396
|
+
} | {
|
|
397
|
+
type: 'done';
|
|
398
|
+
message?: string;
|
|
399
|
+
} | {
|
|
400
|
+
type: 'error';
|
|
401
|
+
errorType: AgentErrorType;
|
|
402
|
+
message: string;
|
|
403
|
+
detail?: string;
|
|
404
|
+
retryable?: boolean;
|
|
405
|
+
} | {
|
|
406
|
+
type: 'transcript';
|
|
407
|
+
content: string;
|
|
408
|
+
} | {
|
|
409
|
+
type: 'server_tool_result';
|
|
410
|
+
tool: 'load_skill' | 'load_tools' | 'create_plan' | 'complete_plan_step';
|
|
411
|
+
label: string;
|
|
412
|
+
} | {
|
|
413
|
+
type: 'plan_update';
|
|
414
|
+
plan: ClientPlanState | null;
|
|
415
|
+
} | {
|
|
416
|
+
type: 'conversation_state';
|
|
417
|
+
state: ConversationStateSnapshot;
|
|
418
|
+
} | {
|
|
419
|
+
type: 'usage';
|
|
420
|
+
usage: UsageTurn;
|
|
421
|
+
} | {
|
|
422
|
+
type: 'conversation_restored';
|
|
423
|
+
} | {
|
|
424
|
+
type: 'conversation_restore_failed';
|
|
425
|
+
reason: string;
|
|
426
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const agentErrorTypeSchema = z.enum([
|
|
3
|
+
"authentication",
|
|
4
|
+
// 401 — bad API key
|
|
5
|
+
"rate_limit",
|
|
6
|
+
// 429 — too many requests
|
|
7
|
+
"overloaded",
|
|
8
|
+
// 529 (Anthropic) / 503 — service overloaded
|
|
9
|
+
"not_found",
|
|
10
|
+
// 404 — invalid model or endpoint
|
|
11
|
+
"bad_request",
|
|
12
|
+
// 400 — malformed request
|
|
13
|
+
"connection",
|
|
14
|
+
// Network/connection failure
|
|
15
|
+
"unauthorized",
|
|
16
|
+
// WebSocket auth token invalid or missing
|
|
17
|
+
"unknown"
|
|
18
|
+
// Anything else
|
|
19
|
+
]);
|
|
20
|
+
const blockBundleContentFieldSchema = z.union([
|
|
21
|
+
z.object({
|
|
22
|
+
name: z.string(),
|
|
23
|
+
label: z.string(),
|
|
24
|
+
type: z.enum(["plain", "markup"])
|
|
25
|
+
}),
|
|
26
|
+
z.object({
|
|
27
|
+
name: z.string(),
|
|
28
|
+
label: z.string(),
|
|
29
|
+
type: z.enum(["reference", "link"]),
|
|
30
|
+
allowed: z.array(
|
|
31
|
+
z.object({
|
|
32
|
+
type: z.string(),
|
|
33
|
+
bundles: z.array(z.string())
|
|
34
|
+
})
|
|
35
|
+
)
|
|
36
|
+
})
|
|
37
|
+
]);
|
|
38
|
+
const blockBundleBlockFieldSchema = z.object({
|
|
39
|
+
name: z.string(),
|
|
40
|
+
label: z.string(),
|
|
41
|
+
allowedBundles: z.array(z.string()),
|
|
42
|
+
cardinality: z.number()
|
|
43
|
+
});
|
|
44
|
+
const blockBundleSchema = z.object({
|
|
45
|
+
id: z.string(),
|
|
46
|
+
label: z.string(),
|
|
47
|
+
description: z.string().optional(),
|
|
48
|
+
contentFields: z.array(blockBundleContentFieldSchema),
|
|
49
|
+
paragraphFields: z.array(blockBundleBlockFieldSchema)
|
|
50
|
+
});
|
|
51
|
+
const fragmentSchema = z.object({
|
|
52
|
+
name: z.string(),
|
|
53
|
+
label: z.string(),
|
|
54
|
+
description: z.string().optional()
|
|
55
|
+
});
|
|
56
|
+
const pageContextSchema = z.object({
|
|
57
|
+
title: z.string(),
|
|
58
|
+
entityType: z.string(),
|
|
59
|
+
entityUuid: z.string(),
|
|
60
|
+
entityBundle: z.string(),
|
|
61
|
+
bundleLabel: z.string(),
|
|
62
|
+
itemEntityType: z.string(),
|
|
63
|
+
bundles: z.array(blockBundleSchema),
|
|
64
|
+
interfaceLanguage: z.string(),
|
|
65
|
+
entityLanguage: z.string(),
|
|
66
|
+
isPublished: z.boolean().nullable(),
|
|
67
|
+
editMode: z.enum(["readonly", "editing", "translating", "review"]),
|
|
68
|
+
fragments: z.array(fragmentSchema),
|
|
69
|
+
entityContentFields: z.array(blockBundleContentFieldSchema)
|
|
70
|
+
});
|
|
71
|
+
const pageStructureBlockSchema = z.lazy(
|
|
72
|
+
() => z.object({
|
|
73
|
+
uuid: z.string(),
|
|
74
|
+
bundle: z.string(),
|
|
75
|
+
contentFields: z.record(z.string(), z.string()).optional(),
|
|
76
|
+
fields: z.record(z.string(), z.array(pageStructureBlockSchema)).optional()
|
|
77
|
+
})
|
|
78
|
+
);
|
|
79
|
+
export const pageStructureSchema = z.object({
|
|
80
|
+
totalParagraphs: z.number(),
|
|
81
|
+
fields: z.record(z.string(), z.array(pageStructureBlockSchema)),
|
|
82
|
+
entityContentFields: z.record(z.string(), z.string()).optional()
|
|
83
|
+
});
|
|
84
|
+
const clientToolDefinitionSchema = z.object({
|
|
85
|
+
name: z.string(),
|
|
86
|
+
description: z.string(),
|
|
87
|
+
input_schema: z.record(z.string(), z.unknown()),
|
|
88
|
+
lazy: z.boolean().optional(),
|
|
89
|
+
category: z.enum(["query", "mutation"]).optional(),
|
|
90
|
+
volatile: z.boolean().optional()
|
|
91
|
+
});
|
|
92
|
+
const genericContentBlockSchema = z.discriminatedUnion("type", [
|
|
93
|
+
z.object({ type: z.literal("text"), text: z.string() }),
|
|
94
|
+
z.object({ type: z.literal("skill"), name: z.string(), text: z.string() }),
|
|
95
|
+
z.object({
|
|
96
|
+
type: z.literal("tool_use"),
|
|
97
|
+
id: z.string(),
|
|
98
|
+
name: z.string(),
|
|
99
|
+
input: z.unknown()
|
|
100
|
+
}),
|
|
101
|
+
z.object({
|
|
102
|
+
type: z.literal("tool_result"),
|
|
103
|
+
tool_use_id: z.string(),
|
|
104
|
+
content: z.string(),
|
|
105
|
+
is_error: z.boolean().optional()
|
|
106
|
+
})
|
|
107
|
+
]);
|
|
108
|
+
const genericMessageSchema = z.object({
|
|
109
|
+
role: z.enum(["user", "assistant"]),
|
|
110
|
+
content: z.union([z.string(), z.array(genericContentBlockSchema)])
|
|
111
|
+
});
|
|
112
|
+
const conversationStateSnapshotSchema = z.object({
|
|
113
|
+
messages: z.array(genericMessageSchema),
|
|
114
|
+
activatedLazyTools: z.array(z.string()),
|
|
115
|
+
hash: z.string()
|
|
116
|
+
});
|
|
117
|
+
export const clientMessageSchema = z.discriminatedUnion("type", [
|
|
118
|
+
z.object({ type: z.literal("authenticate"), authToken: z.string() }),
|
|
119
|
+
z.object({
|
|
120
|
+
type: z.literal("init"),
|
|
121
|
+
tools: z.array(clientToolDefinitionSchema),
|
|
122
|
+
pageContext: pageContextSchema
|
|
123
|
+
}),
|
|
124
|
+
z.object({
|
|
125
|
+
type: z.literal("start"),
|
|
126
|
+
prompt: z.string(),
|
|
127
|
+
selectedUuids: z.array(z.string()).optional()
|
|
128
|
+
}),
|
|
129
|
+
z.object({
|
|
130
|
+
type: z.literal("tool_result"),
|
|
131
|
+
callId: z.string(),
|
|
132
|
+
result: z.unknown(),
|
|
133
|
+
error: z.string().optional()
|
|
134
|
+
}),
|
|
135
|
+
z.object({ type: z.literal("cancel") }),
|
|
136
|
+
z.object({ type: z.literal("accept") }),
|
|
137
|
+
z.object({ type: z.literal("reject") }),
|
|
138
|
+
z.object({ type: z.literal("get_transcript") }),
|
|
139
|
+
z.object({ type: z.literal("new_conversation") }),
|
|
140
|
+
z.object({
|
|
141
|
+
type: z.literal("restore_conversation"),
|
|
142
|
+
state: conversationStateSnapshotSchema
|
|
143
|
+
}),
|
|
144
|
+
z.object({ type: z.literal("plan_approve") }),
|
|
145
|
+
z.object({ type: z.literal("plan_reject") }),
|
|
146
|
+
z.object({ type: z.literal("ping") })
|
|
147
|
+
]);
|
|
@@ -1,4 +1,26 @@
|
|
|
1
|
+
fragment paragraphsBlokkliUserPermissions on ParagraphsBlokkliUser {
|
|
2
|
+
use_blokkli: hasPermission(permission: "view paragraphs blokkli edit state")
|
|
3
|
+
take_ownership: hasPermission(
|
|
4
|
+
permission: "take ownership of paragraphs blokkli edit state"
|
|
5
|
+
)
|
|
6
|
+
create_library_item: hasPermission(
|
|
7
|
+
permission: "create paragraph library item"
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
edit_library_item: hasPermission(permission: "edit paragraph library item")
|
|
11
|
+
|
|
12
|
+
manage_default_templates: hasPermission(
|
|
13
|
+
permission: "manage default paragraph templates"
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
create_comments: hasPermission(permission: "post comments")
|
|
17
|
+
view_comments: hasPermission(permission: "access comments")
|
|
18
|
+
use_agent: hasPermission(permission: "use paragraphs blokkli agent")
|
|
19
|
+
}
|
|
1
20
|
query pbConfig($entityType: String!, $entityBundle: String!) {
|
|
21
|
+
userPermissions: paragraphsBlokkliGetUser {
|
|
22
|
+
...paragraphsBlokkliUserPermissions
|
|
23
|
+
}
|
|
2
24
|
clipboards: pbGetSupportedClipboards {
|
|
3
25
|
...paragraphsBlokkliSupportedClipboard
|
|
4
26
|
}
|
|
@@ -38,14 +60,17 @@ query pbConfig($entityType: String!, $entityBundle: String!) {
|
|
|
38
60
|
entityType: $entityType
|
|
39
61
|
entityBundle: $entityBundle
|
|
40
62
|
) {
|
|
63
|
+
type: fieldType
|
|
41
64
|
name
|
|
42
65
|
label
|
|
43
66
|
entityType
|
|
44
67
|
entityBundle
|
|
45
68
|
cardinality
|
|
46
69
|
canEdit
|
|
47
|
-
|
|
48
|
-
|
|
70
|
+
allowed {
|
|
71
|
+
type: entityType
|
|
72
|
+
bundles
|
|
73
|
+
}
|
|
49
74
|
required
|
|
50
75
|
}
|
|
51
76
|
|