@blokkli/editor 2.0.0-alpha.35 → 2.0.0-alpha.37
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/types/blockOptions.d.ts +10 -2
- package/dist/global/types/definitions.d.ts +12 -5
- package/dist/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +126 -7
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +273 -25
- package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +2 -2
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +34 -17
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.d.ts +2 -20
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.js +0 -3
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue +1 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +1 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.d.vue.ts +1 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +67 -86
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue.d.ts +1 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +10 -12
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/de.md +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/en.md +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +1 -5
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.d.vue.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +138 -0
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue.d.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue +94 -38
- package/dist/modules/agent/runtime/app/helpers/index.d.ts +16 -19
- package/dist/modules/agent/runtime/app/helpers/index.js +22 -46
- package/dist/modules/agent/runtime/app/helpers/pageStructure.js +1 -1
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.js +5 -9
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +2 -3
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_template/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/analyze_content/index.js +120 -0
- package/dist/modules/agent/runtime/app/tools/check_readability/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/check_readability/index.js +57 -0
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +1 -1
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +176 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +1 -1
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +7 -5
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +2 -1
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +2 -3
- package/dist/modules/agent/runtime/app/tools/helpers.d.ts +53 -0
- package/dist/modules/agent/runtime/app/tools/helpers.js +187 -0
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +1 -44
- package/dist/modules/agent/runtime/app/tools/schemas.js +0 -174
- package/dist/modules/agent/runtime/app/tools/search_content/index.js +40 -47
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +2 -5
- package/dist/modules/agent/runtime/app/types/index.d.ts +0 -61
- package/dist/modules/agent/runtime/server/Session.d.ts +29 -8
- package/dist/modules/agent/runtime/server/Session.js +168 -85
- package/dist/modules/agent/runtime/server/SessionManager.d.ts +3 -0
- package/dist/modules/agent/runtime/server/SessionManager.js +4 -1
- package/dist/modules/agent/runtime/server/agent.js +3 -2
- package/dist/modules/agent/runtime/server/agentPrompt.d.ts +9 -1
- package/dist/modules/agent/runtime/server/agentPrompt.js +26 -0
- package/dist/modules/agent/runtime/server/default-skills/fixReadability.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/fixReadability.js +69 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +28 -0
- package/dist/modules/agent/runtime/server/server-tools/index.d.ts +10 -2
- package/dist/modules/agent/runtime/server/server-tools/index.js +1 -1
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +1 -1
- package/dist/modules/agent/runtime/shared/types.d.ts +81 -12
- package/dist/modules/agent/runtime/shared/types.js +22 -10
- package/dist/modules/charts/index.d.mts +35 -0
- package/dist/modules/charts/index.mjs +57 -0
- package/dist/modules/charts/runtime/blokkli/skills/charts.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/skills/charts.js +42 -0
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +86 -0
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +136 -0
- package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.js +93 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.js +66 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.js +40 -0
- package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.js +89 -0
- package/dist/modules/charts/runtime/chartTypes/area.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/area.js +68 -0
- package/dist/modules/charts/runtime/chartTypes/bar.d.ts +8 -0
- package/dist/modules/charts/runtime/chartTypes/bar.js +76 -0
- package/dist/modules/charts/runtime/chartTypes/define.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/define.js +3 -0
- package/dist/modules/charts/runtime/chartTypes/donut.d.ts +6 -0
- package/dist/modules/charts/runtime/chartTypes/donut.js +45 -0
- package/dist/modules/charts/runtime/chartTypes/heatmap.d.ts +4 -0
- package/dist/modules/charts/runtime/chartTypes/heatmap.js +54 -0
- package/dist/modules/charts/runtime/chartTypes/index.d.ts +39 -0
- package/dist/modules/charts/runtime/chartTypes/index.js +47 -0
- package/dist/modules/charts/runtime/chartTypes/line.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/line.js +68 -0
- package/dist/modules/charts/runtime/chartTypes/pie.d.ts +5 -0
- package/dist/modules/charts/runtime/chartTypes/pie.js +28 -0
- package/dist/modules/charts/runtime/chartTypes/radar.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/radar.js +52 -0
- package/dist/modules/charts/runtime/chartTypes/radialBar.d.ts +6 -0
- package/dist/modules/charts/runtime/chartTypes/radialBar.js +44 -0
- package/dist/modules/charts/runtime/chartTypes/shared.d.ts +67 -0
- package/dist/modules/charts/runtime/chartTypes/shared.js +103 -0
- package/dist/modules/charts/runtime/chartTypes/types.d.ts +29 -0
- package/dist/modules/charts/runtime/chartTypes/types.js +0 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.d.vue.ts +147 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +120 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue.d.ts +147 -0
- package/dist/modules/charts/runtime/components/index.d.ts +1 -0
- package/dist/modules/charts/runtime/components/index.js +1 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.d.vue.ts +16 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue +97 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue.d.ts +16 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.d.vue.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue +34 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue.d.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.d.vue.ts +12 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +49 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue.d.ts +12 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.d.vue.ts +19 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue +89 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue.d.ts +19 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.d.vue.ts +23 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +224 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue.d.ts +23 -0
- package/dist/{runtime/editor/features/clipboard/List → modules/charts/runtime/features/charts/Editor/FootnoteEditor}/index.d.vue.ts +4 -5
- package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue +61 -0
- package/dist/{runtime/editor/features/clipboard/List → modules/charts/runtime/features/charts/Editor/FootnoteEditor}/index.vue.d.ts +4 -5
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.d.vue.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue +45 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue.d.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +249 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +17 -0
- package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.js +90 -0
- package/dist/modules/charts/runtime/features/charts/index.d.vue.ts +3 -0
- package/dist/modules/charts/runtime/features/charts/index.vue +72 -0
- package/dist/modules/charts/runtime/features/charts/index.vue.d.ts +3 -0
- package/dist/modules/charts/runtime/helpers/index.d.ts +26 -0
- package/dist/modules/charts/runtime/helpers/index.js +80 -0
- package/dist/modules/charts/runtime/types.d.ts +33 -0
- package/dist/modules/charts/runtime/types.js +0 -0
- package/dist/modules/drupal/graphql/features/fragments.graphql +2 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/runtime/adapter/index.d.ts +3 -1
- package/dist/modules/drupal/runtime/adapter/index.js +16 -12
- package/dist/modules/table-of-contents/index.d.mts +11 -0
- package/dist/modules/table-of-contents/index.mjs +24 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.d.vue.ts +44 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue +43 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue.d.ts +44 -0
- package/dist/modules/table-of-contents/runtime/types/index.d.ts +4 -0
- package/dist/modules/table-of-contents/runtime/types/index.js +0 -0
- package/dist/runtime/components/Blocks/Fragment/index.vue +6 -2
- package/dist/runtime/components/BlokkliItem.vue +9 -4
- package/dist/runtime/components/BlokkliProvider.d.vue.ts +7 -0
- package/dist/runtime/components/BlokkliProvider.vue +7 -1
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +7 -0
- package/dist/runtime/composables/defineBlokkli.js +1 -1
- package/dist/runtime/composables/useBlokkliHelper.js +4 -2
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +17 -27
- package/dist/runtime/editor/components/Banner/index.d.vue.ts +13 -2
- package/dist/runtime/editor/components/Banner/index.vue +4 -2
- package/dist/runtime/editor/components/Banner/index.vue.d.ts +13 -2
- package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +27 -0
- package/dist/runtime/editor/components/Dropdown/index.vue +107 -0
- package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +27 -0
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.d.vue.ts +1 -0
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue +3 -2
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/EditProvider.d.vue.ts +2 -0
- package/dist/runtime/editor/components/EditProvider.vue +11 -7
- package/dist/runtime/editor/components/EditProvider.vue.d.ts +2 -0
- package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +5 -1
- package/dist/runtime/editor/components/FlexTextarea/index.vue +24 -101
- package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +5 -1
- package/dist/runtime/editor/components/Form/Radio/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Radio/index.vue +3 -2
- package/dist/runtime/editor/components/Form/Radio/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/ItemIcon/index.vue +10 -2
- package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +13 -3
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +43 -16
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +13 -3
- package/dist/runtime/editor/components/Popup/index.d.vue.ts +30 -0
- package/dist/runtime/editor/components/Popup/index.vue +82 -0
- package/dist/runtime/editor/components/Popup/index.vue.d.ts +30 -0
- package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +2 -0
- package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
- package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +2 -0
- package/dist/runtime/editor/components/Resizable/index.vue +4 -1
- package/dist/runtime/editor/components/ShortcutIndicator/index.vue +1 -1
- package/dist/runtime/editor/components/Toolbar/index.vue +107 -6
- package/dist/runtime/editor/components/index.d.ts +4 -1
- package/dist/runtime/editor/components/index.js +6 -0
- package/dist/runtime/editor/composables/defineDropAreas.js +3 -3
- package/dist/runtime/editor/composables/defineDropHandler.d.ts +3 -0
- package/dist/runtime/editor/composables/defineDropHandler.js +10 -0
- package/dist/runtime/editor/composables/index.d.ts +1 -0
- package/dist/runtime/editor/composables/index.js +1 -0
- package/dist/runtime/editor/composables/onElementResize.js +0 -1
- package/dist/runtime/editor/composables/useEditableFieldOverride.js +4 -5
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +16 -0
- package/dist/runtime/editor/features/add-list/Help/Item.vue +5 -2
- package/dist/runtime/editor/features/add-list/index.vue +58 -1
- package/dist/runtime/editor/features/analyze/Main.d.vue.ts +3 -2
- package/dist/runtime/editor/features/analyze/Main.vue +28 -44
- package/dist/runtime/editor/features/analyze/Main.vue.d.ts +3 -2
- package/dist/runtime/editor/features/analyze/analyzers/readability.js +65 -0
- package/dist/runtime/editor/features/analyze/analyzers/types.d.ts +19 -0
- package/dist/runtime/editor/features/analyze/index.vue +18 -15
- package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
- package/dist/runtime/editor/features/clipboard/DropElement/Video.d.vue.ts +8 -0
- package/dist/runtime/editor/features/clipboard/{List/Item → DropElement}/Video.vue +1 -5
- package/dist/runtime/editor/features/clipboard/DropElement/Video.vue.d.ts +8 -0
- package/dist/runtime/editor/features/clipboard/DropElement/helpers.d.ts +1 -0
- package/dist/runtime/editor/features/clipboard/DropElement/helpers.js +14 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.d.vue.ts +16 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue +97 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue.d.ts +16 -0
- package/dist/runtime/editor/features/clipboard/helpers.d.ts +15 -0
- package/dist/runtime/editor/features/clipboard/helpers.js +62 -0
- package/dist/runtime/editor/features/clipboard/index.vue +586 -338
- package/dist/runtime/editor/features/clipboard/types.d.ts +14 -2
- package/dist/runtime/editor/features/debug/index.vue +1 -1
- package/dist/runtime/editor/features/dev-mode/index.vue +86 -2
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +17 -5
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +2 -2
- package/dist/runtime/editor/features/dragging-overlay/index.vue +125 -219
- package/dist/runtime/editor/features/edit/index.vue +20 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +4 -4
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +6 -0
- package/dist/runtime/editor/features/fragments/types.d.ts +1 -0
- package/dist/runtime/editor/features/hover/Renderer/index.vue +30 -3
- package/dist/runtime/editor/features/hover/index.vue +1 -1
- package/dist/runtime/editor/features/library/index.vue +14 -0
- package/dist/runtime/editor/features/media-library/index.vue +32 -1
- package/dist/runtime/editor/features/options/Form/Checkbox/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +3 -3
- package/dist/runtime/editor/features/options/Form/Checkbox/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +5 -5
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/ComplexType/index.d.vue.ts +11 -0
- package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +36 -0
- package/dist/runtime/editor/features/options/Form/ComplexType/index.vue.d.ts +11 -0
- package/dist/runtime/editor/features/options/Form/Item.d.vue.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Item.vue +24 -50
- package/dist/runtime/editor/features/options/Form/Item.vue.d.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Number/index.d.vue.ts +3 -3
- package/dist/runtime/editor/features/options/Form/Number/index.vue +7 -17
- package/dist/runtime/editor/features/options/Form/Number/index.vue.d.ts +3 -3
- package/dist/runtime/editor/features/options/Form/Range/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Range/index.vue +4 -4
- package/dist/runtime/editor/features/options/Form/Range/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/index.vue +15 -5
- package/dist/runtime/editor/features/search/index.vue +25 -1
- package/dist/runtime/editor/features/selection/index.vue +2 -2
- package/dist/runtime/editor/features/structure/index.vue +25 -1
- package/dist/runtime/editor/features/tour/index.vue +22 -12
- package/dist/runtime/editor/features/transform/index.vue +1 -3
- package/dist/runtime/editor/helpers/clipboardData/index.d.ts +11 -0
- package/dist/runtime/editor/helpers/clipboardData/index.js +157 -0
- package/dist/runtime/editor/helpers/options/index.js +5 -0
- package/dist/runtime/editor/icons/svg/stars.svg +5 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +15 -4
- package/dist/runtime/editor/plugins/Sidebar/index.vue +4 -2
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +15 -4
- package/dist/runtime/editor/providers/analyze.d.ts +43 -0
- package/dist/runtime/editor/providers/analyze.js +78 -0
- package/dist/runtime/editor/providers/animation.d.ts +4 -0
- package/dist/runtime/editor/providers/animation.js +6 -0
- package/dist/runtime/editor/providers/definition.d.ts +2 -2
- package/dist/runtime/editor/providers/definition.js +7 -1
- package/dist/runtime/editor/providers/dom.d.ts +5 -0
- package/dist/runtime/editor/providers/dom.js +11 -2
- package/dist/runtime/editor/providers/dragdrop.d.ts +55 -0
- package/dist/runtime/editor/providers/dragdrop.js +37 -0
- package/dist/runtime/editor/providers/fields.d.ts +19 -1
- package/dist/runtime/editor/providers/fields.js +54 -2
- package/dist/runtime/editor/providers/storage.js +15 -0
- package/dist/runtime/editor/providers/ui.d.ts +6 -0
- package/dist/runtime/editor/providers/ui.js +19 -0
- package/dist/runtime/editor/translations/de.json +338 -58
- package/dist/runtime/editor/translations/fr.json +331 -51
- package/dist/runtime/editor/translations/gsw_CH.json +336 -56
- package/dist/runtime/editor/translations/it.json +331 -51
- package/dist/runtime/editor/types/app.d.ts +4 -2
- package/dist/runtime/editor/types/draggable.d.ts +1 -0
- package/dist/runtime/editor/types/ui.d.ts +1 -1
- package/dist/runtime/helpers/imports/index.d.ts +8 -1
- package/dist/runtime/helpers/imports/index.js +15 -6
- package/dist/runtime/helpers/injections.d.ts +6 -2
- package/dist/runtime/helpers/injections.js +3 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +14 -0
- package/dist/runtime/types/blockOptions.d.ts +2 -1
- package/dist/runtime/types/definitions.d.ts +12 -5
- package/dist/runtime/types/provider.d.ts +2 -0
- package/dist/shared/editor.6D5vApr0.mjs +30 -0
- package/dist/shared/{editor.DMFfaLVE.mjs → editor.BFIzNSQM.mjs} +1 -30
- package/dist/shared/{editor.Iax3GCvt.d.mts → editor.BdBm1Z7C.d.mts} +34 -0
- package/dist/types.d.mts +1 -1
- package/package.json +21 -3
- package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +0 -104
- package/dist/runtime/editor/features/clipboard/List/Item/File.d.vue.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/File.vue +0 -60
- package/dist/runtime/editor/features/clipboard/List/Item/File.vue.d.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/Video.d.vue.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/Video.vue.d.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/index.vue +0 -72
- package/dist/runtime/editor/features/tour/Popup/index.d.vue.ts +0 -9
- package/dist/runtime/editor/features/tour/Popup/index.vue +0 -34
- package/dist/runtime/editor/features/tour/Popup/index.vue.d.ts +0 -9
- package/dist/runtime/editor/providers/dropArea.d.ts +0 -48
- package/dist/runtime/editor/providers/dropArea.js +0 -22
- /package/dist/modules/agent/runtime/app/tools/{get_available_bundles → analyze_content}/index.d.ts +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineBlokkliAgentSkill } from "../skills/index.js";
|
|
2
|
+
export default defineBlokkliAgentSkill({
|
|
3
|
+
name: "fix-readability",
|
|
4
|
+
label: { en: "Fix Readability", de: "Lesbarkeit verbessern" },
|
|
5
|
+
description: "Load this skill when asked to check, fix, or improve readability of texts on the page.",
|
|
6
|
+
getContents: () => `
|
|
7
|
+
# Fix Readability - Iterative Workflow
|
|
8
|
+
|
|
9
|
+
Fixing readability is an **iterative process**. You must verify your rewrites actually improved the scores before moving on.
|
|
10
|
+
|
|
11
|
+
## Step 1: Analyze
|
|
12
|
+
|
|
13
|
+
Call \`get_readability_issues\` to get current issues.
|
|
14
|
+
|
|
15
|
+
The result is an object keyed by paragraph UUID, then by field name:
|
|
16
|
+
\`\`\`
|
|
17
|
+
{
|
|
18
|
+
"<uuid>": {
|
|
19
|
+
"<fieldName>": {
|
|
20
|
+
"fieldValue": "current text",
|
|
21
|
+
"issues": [
|
|
22
|
+
{ "text": "flagged segment", "impact": "critical", "scores": { "lix": 85 } }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
- \`fieldValue\` is the full editable field content.
|
|
30
|
+
- Each issue is a text segment within the field that was flagged, with its own scores.
|
|
31
|
+
- A field can have multiple issues (e.g. a rich text field with several hard-to-read paragraphs).
|
|
32
|
+
|
|
33
|
+
## Step 2: Pre-check with \`check_readability_for_texts\`
|
|
34
|
+
|
|
35
|
+
Before applying a rewrite, use \`check_readability_for_texts\` to verify your rewritten text actually scores better. Pass the proposed new text and check that the scores improved compared to the original.
|
|
36
|
+
|
|
37
|
+
This is cheap and fast \u2014 use it to iterate on your wording before committing a rewrite.
|
|
38
|
+
|
|
39
|
+
## Step 3: Rewrite
|
|
40
|
+
|
|
41
|
+
Use \`batch_rewrite_text\` to apply the improved texts. The UUID and field name from the analyze result map directly to the batch_rewrite_text input:
|
|
42
|
+
\`\`\`
|
|
43
|
+
{ "uuids": { "<uuid>": { "<fieldName>": "improved text" } } }
|
|
44
|
+
\`\`\`
|
|
45
|
+
|
|
46
|
+
When rewriting:
|
|
47
|
+
- Use shorter sentences and simpler words.
|
|
48
|
+
- Keep the original meaning and tone.
|
|
49
|
+
- Focus on fields with "critical" and "serious" impact first.
|
|
50
|
+
|
|
51
|
+
## Step 4: Verify
|
|
52
|
+
|
|
53
|
+
After the rewrites are applied, call \`get_readability_issues\` **again** to check if the issues are resolved.
|
|
54
|
+
|
|
55
|
+
- If issues remain: rewrite again with different wording.
|
|
56
|
+
- If new issues appeared: fix those too.
|
|
57
|
+
- Repeat until no more readability issues are reported.
|
|
58
|
+
|
|
59
|
+
**Do NOT skip the verification step.** A rewrite can easily make readability worse if sentences become longer or more complex.
|
|
60
|
+
|
|
61
|
+
## Important
|
|
62
|
+
|
|
63
|
+
- Always pre-check with \`check_readability_for_texts\` before applying rewrites.
|
|
64
|
+
- Always verify with \`get_readability_issues\` after applying rewrites.
|
|
65
|
+
- Never assume a rewrite fixed the issue.
|
|
66
|
+
- The scores (LIX, CLI, ARI) measure sentence length and word complexity. Lower is easier to read.
|
|
67
|
+
- LIX above 60 is flagged. Above 70 is critical.
|
|
68
|
+
`
|
|
69
|
+
});
|
|
@@ -51,6 +51,34 @@ export default defineBlokkliAgentSystemPrompt({
|
|
|
51
51
|
lines.push(formatContentField(field));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
if (pageContext.contentSearchTabs?.length) {
|
|
55
|
+
lines.push(
|
|
56
|
+
"",
|
|
57
|
+
"## Content Search Tabs",
|
|
58
|
+
"",
|
|
59
|
+
"Use the `search_content` tool with one of these tab IDs to search for content:",
|
|
60
|
+
""
|
|
61
|
+
);
|
|
62
|
+
for (const tab of pageContext.contentSearchTabs) {
|
|
63
|
+
const typesDescription = tab.types.map((t) => `${t.type} (${t.bundles.join(", ")})`).join(", ");
|
|
64
|
+
lines.push(`- **\`${tab.id}\`** \u2014 ${tab.title}: ${typesDescription}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (pageContext.analyzers?.length) {
|
|
68
|
+
lines.push(
|
|
69
|
+
"",
|
|
70
|
+
"## Available Analyzers",
|
|
71
|
+
"",
|
|
72
|
+
"Use `get_readability_issues` to run all readability analyzers. The following analyzers are available:",
|
|
73
|
+
""
|
|
74
|
+
);
|
|
75
|
+
for (const a of pageContext.analyzers) {
|
|
76
|
+
const parts = [`- **\`${a.id}\`**`];
|
|
77
|
+
if (a.label) parts.push(`\u2014 ${a.label}`);
|
|
78
|
+
if (a.description) parts.push(`: ${a.description}`);
|
|
79
|
+
lines.push(parts.join(""));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
54
82
|
const editModeDescription = getEditModeDescription(pageContext.editMode);
|
|
55
83
|
if (editModeDescription) {
|
|
56
84
|
lines.push("", "## Edit Mode", "", editModeDescription);
|
|
@@ -23,7 +23,10 @@ export type ToolResultEntry = {
|
|
|
23
23
|
export type ToolDefinitionContext = {
|
|
24
24
|
resolvedSkills: ResolvedSkill[];
|
|
25
25
|
plan: ServerPlan | null;
|
|
26
|
-
unloadedLazyTools:
|
|
26
|
+
unloadedLazyTools: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
}[];
|
|
27
30
|
};
|
|
28
31
|
/**
|
|
29
32
|
* Context passed to `handle()` — provides access to session state
|
|
@@ -33,7 +36,7 @@ export type ServerToolContext = {
|
|
|
33
36
|
toolUseId: string;
|
|
34
37
|
send: (message: ServerMessage) => void;
|
|
35
38
|
resolvedSkills: ResolvedSkill[];
|
|
36
|
-
|
|
39
|
+
lazyToolNames: string[];
|
|
37
40
|
activatedLazyTools: Set<string>;
|
|
38
41
|
loadedSkills: Set<string>;
|
|
39
42
|
plan: ServerPlan | null;
|
|
@@ -79,6 +82,11 @@ export type ServerSideTool<T extends z.ZodType = z.ZodType> = {
|
|
|
79
82
|
* Identity function for type inference when defining a server-side tool.
|
|
80
83
|
*/
|
|
81
84
|
export declare function defineServerSideTool<T extends z.ZodType>(tool: ServerSideTool<T>): ServerSideTool<T>;
|
|
85
|
+
/**
|
|
86
|
+
* Recursively strip $schema and additionalProperties from a JSON Schema object.
|
|
87
|
+
* These are unnecessary for the LLM and waste context window tokens.
|
|
88
|
+
*/
|
|
89
|
+
export declare function stripSchemaOverhead(obj: unknown): unknown;
|
|
82
90
|
/**
|
|
83
91
|
* Build a ClientToolDefinition from a ServerSideTool for a given context.
|
|
84
92
|
* Returns null when the tool should not be offered this turn.
|
|
@@ -18,7 +18,7 @@ export default defineServerSideTool({
|
|
|
18
18
|
handle(ctx, input) {
|
|
19
19
|
const loaded = [];
|
|
20
20
|
for (const name of input.tools) {
|
|
21
|
-
if (ctx.
|
|
21
|
+
if (ctx.lazyToolNames.includes(name)) {
|
|
22
22
|
ctx.activatedLazyTools.add(name);
|
|
23
23
|
loaded.push(name);
|
|
24
24
|
}
|
|
@@ -113,6 +113,21 @@ export type BlockBundle = {
|
|
|
113
113
|
* Edit mode determines what actions the user is allowed to perform.
|
|
114
114
|
*/
|
|
115
115
|
export type EditMode = 'readonly' | 'editing' | 'translating' | 'review';
|
|
116
|
+
/**
|
|
117
|
+
* Server-side tool metadata extracted at build time.
|
|
118
|
+
* Contains only static properties needed by the server — no execute(), label(),
|
|
119
|
+
* component, or other runtime-only fields.
|
|
120
|
+
*/
|
|
121
|
+
export type ServerToolMetadata = {
|
|
122
|
+
name: string;
|
|
123
|
+
description: string;
|
|
124
|
+
category: 'query' | 'mutation';
|
|
125
|
+
modes: EditMode[];
|
|
126
|
+
paramsSchema: z.ZodType;
|
|
127
|
+
lazy?: boolean;
|
|
128
|
+
volatile?: boolean;
|
|
129
|
+
requiredAdapterMethods?: string[];
|
|
130
|
+
};
|
|
116
131
|
/**
|
|
117
132
|
* Fragment definition for reusable content blocks.
|
|
118
133
|
*/
|
|
@@ -152,6 +167,22 @@ export type PageContext = {
|
|
|
152
167
|
fragments: Fragment[];
|
|
153
168
|
/** Content fields on the page entity itself (e.g., lead text, hero image) */
|
|
154
169
|
entityContentFields: BlockBundleContentField[];
|
|
170
|
+
/** Available content search tabs (for the search_content tool) */
|
|
171
|
+
contentSearchTabs?: {
|
|
172
|
+
id: string;
|
|
173
|
+
title: string;
|
|
174
|
+
types: {
|
|
175
|
+
type: string;
|
|
176
|
+
bundles: string[];
|
|
177
|
+
}[];
|
|
178
|
+
}[];
|
|
179
|
+
/** Available content analyzers (for the get_readability_issues tool) */
|
|
180
|
+
analyzers?: {
|
|
181
|
+
id: string;
|
|
182
|
+
type?: string;
|
|
183
|
+
label?: string;
|
|
184
|
+
description?: string;
|
|
185
|
+
}[];
|
|
155
186
|
};
|
|
156
187
|
/**
|
|
157
188
|
* Classified error categories for AI provider errors.
|
|
@@ -204,6 +235,40 @@ export type UsageTurn = {
|
|
|
204
235
|
cacheReadInputTokens: number;
|
|
205
236
|
pricing: UsagePricing | null;
|
|
206
237
|
};
|
|
238
|
+
/**
|
|
239
|
+
* A single system prompt entry in the structured transcript.
|
|
240
|
+
*/
|
|
241
|
+
export type TranscriptSystemPrompt = {
|
|
242
|
+
id: string;
|
|
243
|
+
name: string;
|
|
244
|
+
content: string;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* A single message in the structured transcript.
|
|
248
|
+
* `seen` is the pruned content actually sent to the LLM.
|
|
249
|
+
* `full` is the pre-pruned content, omitted when identical to `seen`.
|
|
250
|
+
*/
|
|
251
|
+
export type TranscriptMessage = {
|
|
252
|
+
type: 'agent' | 'user';
|
|
253
|
+
seen: string | GenericContentBlock[];
|
|
254
|
+
full?: string | GenericContentBlock[];
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Tool definition as included in the transcript.
|
|
258
|
+
*/
|
|
259
|
+
export type TranscriptToolDefinition = {
|
|
260
|
+
name: string;
|
|
261
|
+
description: string;
|
|
262
|
+
input_schema: Record<string, unknown>;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Structured transcript of the current conversation state.
|
|
266
|
+
*/
|
|
267
|
+
export type Transcript = {
|
|
268
|
+
system: TranscriptSystemPrompt[];
|
|
269
|
+
messages: TranscriptMessage[];
|
|
270
|
+
tools: TranscriptToolDefinition[];
|
|
271
|
+
};
|
|
207
272
|
/**
|
|
208
273
|
* Tool definition sent from client to server on init.
|
|
209
274
|
*/
|
|
@@ -232,17 +297,7 @@ export declare const clientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
232
297
|
authToken: z.ZodString;
|
|
233
298
|
}, z.core.$strip>, z.ZodObject<{
|
|
234
299
|
type: z.ZodLiteral<"init">;
|
|
235
|
-
|
|
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>>;
|
|
300
|
+
toolNames: z.ZodArray<z.ZodString>;
|
|
246
301
|
pageContext: z.ZodObject<{
|
|
247
302
|
title: z.ZodString;
|
|
248
303
|
entityType: z.ZodString;
|
|
@@ -313,6 +368,20 @@ export declare const clientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
313
368
|
bundles: z.ZodArray<z.ZodString>;
|
|
314
369
|
}, z.core.$strip>>;
|
|
315
370
|
}, z.core.$strip>]>>;
|
|
371
|
+
contentSearchTabs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
372
|
+
id: z.ZodString;
|
|
373
|
+
title: z.ZodString;
|
|
374
|
+
types: z.ZodArray<z.ZodObject<{
|
|
375
|
+
type: z.ZodString;
|
|
376
|
+
bundles: z.ZodArray<z.ZodString>;
|
|
377
|
+
}, z.core.$strip>>;
|
|
378
|
+
}, z.core.$strip>>>;
|
|
379
|
+
analyzers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
380
|
+
id: z.ZodString;
|
|
381
|
+
type: z.ZodOptional<z.ZodString>;
|
|
382
|
+
label: z.ZodOptional<z.ZodString>;
|
|
383
|
+
description: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, z.core.$strip>>>;
|
|
316
385
|
}, z.core.$strip>;
|
|
317
386
|
}, z.core.$strip>, z.ZodObject<{
|
|
318
387
|
type: z.ZodLiteral<"start">;
|
|
@@ -404,7 +473,7 @@ export type ServerMessage = {
|
|
|
404
473
|
retryable?: boolean;
|
|
405
474
|
} | {
|
|
406
475
|
type: 'transcript';
|
|
407
|
-
|
|
476
|
+
transcript: Transcript;
|
|
408
477
|
} | {
|
|
409
478
|
type: 'server_tool_result';
|
|
410
479
|
tool: 'load_skill' | 'load_tools' | 'create_plan' | 'complete_plan_step';
|
|
@@ -66,7 +66,27 @@ const pageContextSchema = z.object({
|
|
|
66
66
|
isPublished: z.boolean().nullable(),
|
|
67
67
|
editMode: z.enum(["readonly", "editing", "translating", "review"]),
|
|
68
68
|
fragments: z.array(fragmentSchema),
|
|
69
|
-
entityContentFields: z.array(blockBundleContentFieldSchema)
|
|
69
|
+
entityContentFields: z.array(blockBundleContentFieldSchema),
|
|
70
|
+
contentSearchTabs: z.array(
|
|
71
|
+
z.object({
|
|
72
|
+
id: z.string(),
|
|
73
|
+
title: z.string(),
|
|
74
|
+
types: z.array(
|
|
75
|
+
z.object({
|
|
76
|
+
type: z.string(),
|
|
77
|
+
bundles: z.array(z.string())
|
|
78
|
+
})
|
|
79
|
+
)
|
|
80
|
+
})
|
|
81
|
+
).optional(),
|
|
82
|
+
analyzers: z.array(
|
|
83
|
+
z.object({
|
|
84
|
+
id: z.string(),
|
|
85
|
+
type: z.string().optional(),
|
|
86
|
+
label: z.string().optional(),
|
|
87
|
+
description: z.string().optional()
|
|
88
|
+
})
|
|
89
|
+
).optional()
|
|
70
90
|
});
|
|
71
91
|
const pageStructureBlockSchema = z.lazy(
|
|
72
92
|
() => z.object({
|
|
@@ -81,14 +101,6 @@ export const pageStructureSchema = z.object({
|
|
|
81
101
|
fields: z.record(z.string(), z.array(pageStructureBlockSchema)),
|
|
82
102
|
entityContentFields: z.record(z.string(), z.string()).optional()
|
|
83
103
|
});
|
|
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
104
|
const genericContentBlockSchema = z.discriminatedUnion("type", [
|
|
93
105
|
z.object({ type: z.literal("text"), text: z.string() }),
|
|
94
106
|
z.object({ type: z.literal("skill"), name: z.string(), text: z.string() }),
|
|
@@ -118,7 +130,7 @@ export const clientMessageSchema = z.discriminatedUnion("type", [
|
|
|
118
130
|
z.object({ type: z.literal("authenticate"), authToken: z.string() }),
|
|
119
131
|
z.object({
|
|
120
132
|
type: z.literal("init"),
|
|
121
|
-
|
|
133
|
+
toolNames: z.array(z.string()),
|
|
122
134
|
pageContext: pageContextSchema
|
|
123
135
|
}),
|
|
124
136
|
z.object({
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { B as BlokkliModule } from '../../shared/editor.BdBm1Z7C.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 ChartColor = {
|
|
10
|
+
/**
|
|
11
|
+
* A valid CSS color value, e.g. '#ff0000', 'rgb(255, 0, 0)',
|
|
12
|
+
* or 'rgb(var(--theme-color-primary))' for CSS custom properties.
|
|
13
|
+
*/
|
|
14
|
+
color: string;
|
|
15
|
+
/**
|
|
16
|
+
* The label of the color.
|
|
17
|
+
*/
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
20
|
+
type ChartsModuleOptions = {
|
|
21
|
+
/**
|
|
22
|
+
* Provide the path to a custom component to render charts.
|
|
23
|
+
*
|
|
24
|
+
* @todo not yet implemented
|
|
25
|
+
*/
|
|
26
|
+
chartRenderComponent?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The available chart colors.
|
|
29
|
+
*/
|
|
30
|
+
colors: Record<string, ChartColor>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
declare const _default: (options: ChartsModuleOptions) => BlokkliModule<ChartsModuleOptions>;
|
|
34
|
+
|
|
35
|
+
export { _default as default };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createResolver } from '@nuxt/kit';
|
|
2
|
+
import { d as defineBlokkliModule } from '../../shared/editor.CGf7C_0M.mjs';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { d as defineCodeTemplate } from '../../shared/editor.6D5vApr0.mjs';
|
|
5
|
+
|
|
6
|
+
function chartsConfigTemplate(options) {
|
|
7
|
+
return defineCodeTemplate(
|
|
8
|
+
"charts-config",
|
|
9
|
+
() => {
|
|
10
|
+
return `
|
|
11
|
+
export const COLORS = ${JSON.stringify(options.colors)}
|
|
12
|
+
`;
|
|
13
|
+
},
|
|
14
|
+
() => {
|
|
15
|
+
return `
|
|
16
|
+
import type { ChartColor } from '#blokkli/charts/types'
|
|
17
|
+
|
|
18
|
+
export const COLORS: Record<string, ChartColor>
|
|
19
|
+
`;
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
context: "both",
|
|
23
|
+
write: true
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const resolve = createResolver(
|
|
29
|
+
fileURLToPath(new URL("./", import.meta.url))
|
|
30
|
+
).resolve;
|
|
31
|
+
const index = defineBlokkliModule({
|
|
32
|
+
alterOptions(options) {
|
|
33
|
+
options.blokkliDirs ??= [];
|
|
34
|
+
options.blokkliDirs.push(resolve("./runtime/blokkli"));
|
|
35
|
+
},
|
|
36
|
+
setup({ context, helper, $t }, options) {
|
|
37
|
+
context.features.addFile(resolve("./runtime/features/charts/index.vue"));
|
|
38
|
+
context.addTemplate(chartsConfigTemplate(options));
|
|
39
|
+
helper.addAlias("#blokkli/charts/types", resolve("./runtime/types"));
|
|
40
|
+
helper.addAlias(
|
|
41
|
+
"#blokkli/charts/components",
|
|
42
|
+
resolve("./runtime/components")
|
|
43
|
+
);
|
|
44
|
+
context.registerComplexOptionType({
|
|
45
|
+
id: "chart",
|
|
46
|
+
typeName: "BlokkliChartData",
|
|
47
|
+
typePath: resolve("./runtime/types"),
|
|
48
|
+
editorComponentPath: resolve(
|
|
49
|
+
"./runtime/features/charts/Editor/index.vue"
|
|
50
|
+
),
|
|
51
|
+
editorButtonLabel: $t("chartsEditButton", "Edit chart..."),
|
|
52
|
+
editorIcon: "bk_mdi_area_chart"
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export { index as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineBlokkliAgentSkill } from "#blokkli/agent/server/skills";
|
|
2
|
+
export default defineBlokkliAgentSkill({
|
|
3
|
+
name: "charts",
|
|
4
|
+
label: { en: "Working with charts", de: "Arbeiten mit Diagrammen" },
|
|
5
|
+
description: "How charts work in bl\xF6kkli. LOAD THIS when the user asks about charts or when you need to create or update a chart!",
|
|
6
|
+
getContents: () => `
|
|
7
|
+
# Charts
|
|
8
|
+
|
|
9
|
+
Charts are NOT a specific block bundle. Instead, charts are a **complex option type**: any block can have a JSON option with \`dataType: 'chart'\`. The chart data is stored as a JSON string in that option. The option key can be anything (e.g. "data", "chart", etc.) \u2014 the tools detect it automatically.
|
|
10
|
+
|
|
11
|
+
## Key concept
|
|
12
|
+
|
|
13
|
+
A "chart block" is any block whose definition has a JSON option with \`dataType: 'chart'\`. The chart tools automatically detect which option holds chart data, so you don't need to know the option key or bundle name.
|
|
14
|
+
|
|
15
|
+
## Available tools
|
|
16
|
+
|
|
17
|
+
- **get_chart_data**: Read the current chart data (type, categories, series, colors, typeOptions). Always call this first when modifying an existing chart!
|
|
18
|
+
- **create_chart**: Create a new chart. Requires chart data (type, categories, series). The tool automatically finds which bundle in the target field has a chart option.
|
|
19
|
+
- **update_chart**: Update an existing chart. Pass the block's UUID and only the properties you want to change (title, type, categories, series, categoryColors, footnotes, typeOptions).
|
|
20
|
+
- **get_chart_type_options**: Get available typeOptions for a chart type. Call this to discover which rendering options exist (e.g. stacked, horizontal for bar charts) before setting typeOptions.
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
1. To **read** a chart's current state: use get_chart_data with the paragraph UUID.
|
|
25
|
+
2. To **create** a chart: use create_chart with the data. The tool finds the right bundle automatically from the target field's allowed bundles.
|
|
26
|
+
3. To **modify** a chart: first call get_chart_data to see the current state, then use update_chart with only the properties you want to change.
|
|
27
|
+
4. To **change rendering options** (e.g. stacked bars, smooth lines, grid lines): first call get_chart_type_options with the chart type to see available options, then use update_chart with the typeOptions property.
|
|
28
|
+
|
|
29
|
+
## Chart types
|
|
30
|
+
|
|
31
|
+
bar, line, pie, area, donut, heatmap, radialBar, radar.
|
|
32
|
+
|
|
33
|
+
- pie, donut, radialBar: Single-series charts where each category gets its own color (categoryColors).
|
|
34
|
+
- bar, line, area, heatmap, radar: Multi-series charts where each series has its own color.
|
|
35
|
+
|
|
36
|
+
Each chart type has different options!
|
|
37
|
+
|
|
38
|
+
## Colors
|
|
39
|
+
|
|
40
|
+
Series colors and category colors use color IDs defined in the project configuration. They are auto-assigned if omitted. The valid color IDs are part of the tool schemas (enum values).
|
|
41
|
+
`
|
|
42
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BlokkliChartData, ChartColor } from '#blokkli/charts/types';
|
|
3
|
+
import type { McpToolContext } from '#blokkli/agent/app/types';
|
|
4
|
+
export declare const chartTypeEnum: z.ZodEnum<{
|
|
5
|
+
bar: "bar";
|
|
6
|
+
line: "line";
|
|
7
|
+
area: "area";
|
|
8
|
+
pie: "pie";
|
|
9
|
+
donut: "donut";
|
|
10
|
+
heatmap: "heatmap";
|
|
11
|
+
radialBar: "radialBar";
|
|
12
|
+
radar: "radar";
|
|
13
|
+
}>;
|
|
14
|
+
export declare const chartColorEnum: z.ZodEnum<{
|
|
15
|
+
[x: string]: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const chartSeriesSchema: z.ZodObject<{
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
[x: string]: string;
|
|
21
|
+
}>>;
|
|
22
|
+
data: z.ZodArray<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const chartDataSchema: z.ZodObject<{
|
|
25
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
26
|
+
type: z.ZodEnum<{
|
|
27
|
+
bar: "bar";
|
|
28
|
+
line: "line";
|
|
29
|
+
area: "area";
|
|
30
|
+
pie: "pie";
|
|
31
|
+
donut: "donut";
|
|
32
|
+
heatmap: "heatmap";
|
|
33
|
+
radialBar: "radialBar";
|
|
34
|
+
radar: "radar";
|
|
35
|
+
}>;
|
|
36
|
+
categories: z.ZodArray<z.ZodString>;
|
|
37
|
+
series: z.ZodArray<z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
[x: string]: string;
|
|
41
|
+
}>>;
|
|
42
|
+
data: z.ZodArray<z.ZodNumber>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
categoryColors: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
45
|
+
[x: string]: string;
|
|
46
|
+
}>>>;
|
|
47
|
+
footnotes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
48
|
+
typeOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber]>>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
/**
|
|
51
|
+
* Validate and normalize chart data.
|
|
52
|
+
*
|
|
53
|
+
* - Checks series data length matches categories length
|
|
54
|
+
* - Auto-assigns missing series colors
|
|
55
|
+
* - Auto-assigns categoryColors for pie/donut/radialBar
|
|
56
|
+
* - Validates color IDs exist in the provided colors map
|
|
57
|
+
* - Validates typeOptions keys against the chart type definition
|
|
58
|
+
* - Fills typeOptions defaults
|
|
59
|
+
*/
|
|
60
|
+
export declare function validateChartData(data: BlokkliChartData, colors: Record<string, ChartColor>): {
|
|
61
|
+
error: string;
|
|
62
|
+
} | {
|
|
63
|
+
data: BlokkliChartData;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Find the option key for a chart option on a block.
|
|
67
|
+
*
|
|
68
|
+
* Charts are stored as a JSON option with `dataType: 'chart'` on any block.
|
|
69
|
+
* This helper looks up the block's definition and returns the option key.
|
|
70
|
+
*/
|
|
71
|
+
export declare function findChartOptionKey(ctx: McpToolContext, uuid: string): {
|
|
72
|
+
key: string;
|
|
73
|
+
} | {
|
|
74
|
+
error: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Find a bundle that has a chart option among a field's allowed bundles.
|
|
78
|
+
*
|
|
79
|
+
* Returns the bundle name and the option key for the chart data.
|
|
80
|
+
*/
|
|
81
|
+
export declare function findChartBundle(ctx: McpToolContext, allowedBundles: string[]): {
|
|
82
|
+
bundle: string;
|
|
83
|
+
key: string;
|
|
84
|
+
} | {
|
|
85
|
+
error: string;
|
|
86
|
+
};
|