@blokkli/editor 2.0.0-alpha.35 → 2.0.0-alpha.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/dist/global/types/blockOptions.d.ts +9 -2
  2. package/dist/global/types/definitions.d.ts +12 -5
  3. package/dist/module.d.mts +2 -2
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +56 -4
  6. package/dist/modules/agent/index.d.mts +1 -1
  7. package/dist/modules/agent/index.mjs +38 -20
  8. package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +2 -2
  9. package/dist/modules/agent/runtime/app/composables/agentProvider.js +3 -3
  10. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +34 -60
  11. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.d.vue.ts +8 -0
  12. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +138 -0
  13. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue.d.ts +8 -0
  14. package/dist/modules/agent/runtime/app/features/agent/index.vue +5 -1
  15. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +175 -0
  16. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +5 -0
  17. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +10 -1
  18. package/dist/modules/agent/runtime/app/tools/schemas.js +36 -23
  19. package/dist/modules/agent/runtime/server/Session.d.ts +4 -2
  20. package/dist/modules/agent/runtime/server/Session.js +61 -57
  21. package/dist/modules/agent/runtime/server/agentPrompt.d.ts +9 -1
  22. package/dist/modules/agent/runtime/server/agentPrompt.js +26 -0
  23. package/dist/modules/agent/runtime/shared/types.d.ts +35 -1
  24. package/dist/modules/charts/index.d.mts +35 -0
  25. package/dist/modules/charts/index.mjs +43 -0
  26. package/dist/modules/charts/runtime/blokkli/skills/charts.d.ts +2 -0
  27. package/dist/modules/charts/runtime/blokkli/skills/charts.js +42 -0
  28. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +63 -0
  29. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +98 -0
  30. package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.d.ts +2 -0
  31. package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.js +86 -0
  32. package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.d.ts +2 -0
  33. package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.js +74 -0
  34. package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.d.ts +2 -0
  35. package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.js +42 -0
  36. package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.d.ts +2 -0
  37. package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.js +101 -0
  38. package/dist/modules/charts/runtime/chartTypes/area.d.ts +2 -0
  39. package/dist/modules/charts/runtime/chartTypes/area.js +68 -0
  40. package/dist/modules/charts/runtime/chartTypes/bar.d.ts +2 -0
  41. package/dist/modules/charts/runtime/chartTypes/bar.js +76 -0
  42. package/dist/modules/charts/runtime/chartTypes/define.d.ts +2 -0
  43. package/dist/modules/charts/runtime/chartTypes/define.js +3 -0
  44. package/dist/modules/charts/runtime/chartTypes/donut.d.ts +2 -0
  45. package/dist/modules/charts/runtime/chartTypes/donut.js +45 -0
  46. package/dist/modules/charts/runtime/chartTypes/heatmap.d.ts +2 -0
  47. package/dist/modules/charts/runtime/chartTypes/heatmap.js +54 -0
  48. package/dist/modules/charts/runtime/chartTypes/index.d.ts +21 -0
  49. package/dist/modules/charts/runtime/chartTypes/index.js +47 -0
  50. package/dist/modules/charts/runtime/chartTypes/line.d.ts +2 -0
  51. package/dist/modules/charts/runtime/chartTypes/line.js +68 -0
  52. package/dist/modules/charts/runtime/chartTypes/pie.d.ts +2 -0
  53. package/dist/modules/charts/runtime/chartTypes/pie.js +28 -0
  54. package/dist/modules/charts/runtime/chartTypes/radar.d.ts +2 -0
  55. package/dist/modules/charts/runtime/chartTypes/radar.js +52 -0
  56. package/dist/modules/charts/runtime/chartTypes/radialBar.d.ts +2 -0
  57. package/dist/modules/charts/runtime/chartTypes/radialBar.js +44 -0
  58. package/dist/modules/charts/runtime/chartTypes/shared.d.ts +52 -0
  59. package/dist/modules/charts/runtime/chartTypes/shared.js +103 -0
  60. package/dist/modules/charts/runtime/chartTypes/types.d.ts +29 -0
  61. package/dist/modules/charts/runtime/chartTypes/types.js +0 -0
  62. package/dist/modules/charts/runtime/components/ChartRenderer/index.d.vue.ts +4 -0
  63. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +120 -0
  64. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue.d.ts +4 -0
  65. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.d.vue.ts +3 -0
  66. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.vue +29 -0
  67. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.vue.d.ts +3 -0
  68. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.d.vue.ts +15 -0
  69. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue +97 -0
  70. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue.d.ts +15 -0
  71. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.d.vue.ts +11 -0
  72. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue +34 -0
  73. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue.d.ts +11 -0
  74. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.d.vue.ts +12 -0
  75. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +49 -0
  76. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue.d.ts +12 -0
  77. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.d.vue.ts +19 -0
  78. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue +90 -0
  79. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue.d.ts +19 -0
  80. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.d.vue.ts +23 -0
  81. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +224 -0
  82. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue.d.ts +23 -0
  83. package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.d.vue.ts +10 -0
  84. package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue +61 -0
  85. package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue.d.ts +10 -0
  86. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.d.vue.ts +8 -0
  87. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue +23 -0
  88. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue.d.ts +8 -0
  89. package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +10 -0
  90. package/dist/modules/charts/runtime/features/charts/Editor/index.vue +243 -0
  91. package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +10 -0
  92. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +17 -0
  93. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.js +90 -0
  94. package/dist/modules/charts/runtime/features/charts/index.d.vue.ts +3 -0
  95. package/dist/modules/charts/runtime/features/charts/index.vue +72 -0
  96. package/dist/modules/charts/runtime/features/charts/index.vue.d.ts +3 -0
  97. package/dist/modules/charts/runtime/helpers/index.d.ts +1 -0
  98. package/dist/modules/charts/runtime/helpers/index.js +17 -0
  99. package/dist/modules/charts/runtime/types.d.ts +51 -0
  100. package/dist/modules/charts/runtime/types.js +64 -0
  101. package/dist/modules/drupal/graphql/features/fragments.graphql +2 -0
  102. package/dist/modules/drupal/index.d.mts +1 -1
  103. package/dist/modules/drupal/runtime/adapter/index.js +12 -8
  104. package/dist/modules/table-of-contents/index.d.mts +11 -0
  105. package/dist/modules/table-of-contents/index.mjs +24 -0
  106. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.d.vue.ts +44 -0
  107. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue +43 -0
  108. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue.d.ts +44 -0
  109. package/dist/modules/table-of-contents/runtime/types/index.d.ts +4 -0
  110. package/dist/modules/table-of-contents/runtime/types/index.js +0 -0
  111. package/dist/runtime/components/Blocks/Fragment/index.vue +6 -2
  112. package/dist/runtime/components/BlokkliItem.vue +8 -3
  113. package/dist/runtime/components/BlokkliProvider.d.vue.ts +7 -0
  114. package/dist/runtime/components/BlokkliProvider.vue +7 -1
  115. package/dist/runtime/components/BlokkliProvider.vue.d.ts +7 -0
  116. package/dist/runtime/composables/useBlokkliHelper.js +4 -2
  117. package/dist/runtime/editor/components/AnimationCanvas/index.vue +4 -20
  118. package/dist/runtime/editor/components/Banner/index.d.vue.ts +12 -2
  119. package/dist/runtime/editor/components/Banner/index.vue +4 -2
  120. package/dist/runtime/editor/components/Banner/index.vue.d.ts +12 -2
  121. package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +27 -0
  122. package/dist/runtime/editor/components/Dropdown/index.vue +107 -0
  123. package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +27 -0
  124. package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue +1 -1
  125. package/dist/runtime/editor/components/EditProvider.d.vue.ts +2 -0
  126. package/dist/runtime/editor/components/EditProvider.vue +4 -3
  127. package/dist/runtime/editor/components/EditProvider.vue.d.ts +2 -0
  128. package/dist/runtime/editor/components/Form/Radio/index.d.vue.ts +1 -0
  129. package/dist/runtime/editor/components/Form/Radio/index.vue +3 -2
  130. package/dist/runtime/editor/components/Form/Radio/index.vue.d.ts +1 -0
  131. package/dist/runtime/editor/components/ItemIcon/index.vue +10 -2
  132. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +13 -3
  133. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +15 -7
  134. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +13 -3
  135. package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +2 -0
  136. package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
  137. package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +2 -0
  138. package/dist/runtime/editor/components/ShortcutIndicator/index.vue +1 -1
  139. package/dist/runtime/editor/components/index.d.ts +3 -1
  140. package/dist/runtime/editor/components/index.js +4 -0
  141. package/dist/runtime/editor/composables/onElementResize.js +0 -1
  142. package/dist/runtime/editor/composables/useEditableFieldOverride.js +4 -5
  143. package/dist/runtime/editor/css/output.css +1 -1
  144. package/dist/runtime/editor/events/index.d.ts +7 -0
  145. package/dist/runtime/editor/features/add-list/Help/Item.vue +5 -2
  146. package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
  147. package/dist/runtime/editor/features/clipboard/index.vue +1 -1
  148. package/dist/runtime/editor/features/debug/index.vue +1 -1
  149. package/dist/runtime/editor/features/dev-mode/index.vue +86 -2
  150. package/dist/runtime/editor/features/edit/index.vue +20 -0
  151. package/dist/runtime/editor/features/fragments/types.d.ts +1 -0
  152. package/dist/runtime/editor/features/hover/Renderer/index.vue +30 -3
  153. package/dist/runtime/editor/features/hover/index.vue +1 -1
  154. package/dist/runtime/editor/features/options/Form/Checkbox/index.d.vue.ts +2 -2
  155. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +3 -3
  156. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue.d.ts +2 -2
  157. package/dist/runtime/editor/features/options/Form/Checkboxes/index.d.vue.ts +2 -2
  158. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +5 -5
  159. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue.d.ts +2 -2
  160. package/dist/runtime/editor/features/options/Form/Item.d.vue.ts +2 -2
  161. package/dist/runtime/editor/features/options/Form/Item.vue +14 -48
  162. package/dist/runtime/editor/features/options/Form/Item.vue.d.ts +2 -2
  163. package/dist/runtime/editor/features/options/Form/Number/index.d.vue.ts +3 -3
  164. package/dist/runtime/editor/features/options/Form/Number/index.vue +7 -17
  165. package/dist/runtime/editor/features/options/Form/Number/index.vue.d.ts +3 -3
  166. package/dist/runtime/editor/features/options/Form/Range/index.d.vue.ts +2 -2
  167. package/dist/runtime/editor/features/options/Form/Range/index.vue +4 -4
  168. package/dist/runtime/editor/features/options/Form/Range/index.vue.d.ts +2 -2
  169. package/dist/runtime/editor/features/options/Form/index.vue +10 -5
  170. package/dist/runtime/editor/features/selection/index.vue +2 -2
  171. package/dist/runtime/editor/features/transform/index.vue +1 -3
  172. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +1 -1
  173. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +1 -1
  174. package/dist/runtime/editor/providers/definition.d.ts +2 -2
  175. package/dist/runtime/editor/providers/definition.js +7 -1
  176. package/dist/runtime/editor/providers/dom.d.ts +5 -0
  177. package/dist/runtime/editor/providers/dom.js +11 -2
  178. package/dist/runtime/editor/providers/fields.d.ts +19 -1
  179. package/dist/runtime/editor/providers/fields.js +54 -2
  180. package/dist/runtime/editor/translations/de.json +269 -1
  181. package/dist/runtime/editor/translations/fr.json +269 -1
  182. package/dist/runtime/editor/translations/gsw_CH.json +269 -1
  183. package/dist/runtime/editor/translations/it.json +269 -1
  184. package/dist/runtime/helpers/imports/index.d.ts +8 -1
  185. package/dist/runtime/helpers/imports/index.js +15 -6
  186. package/dist/runtime/helpers/injections.d.ts +5 -1
  187. package/dist/runtime/helpers/injections.js +3 -0
  188. package/dist/runtime/helpers/runtimeHelpers/index.js +14 -0
  189. package/dist/runtime/types/definitions.d.ts +8 -5
  190. package/dist/runtime/types/provider.d.ts +2 -0
  191. package/dist/shared/editor.6D5vApr0.mjs +30 -0
  192. package/dist/shared/{editor.DMFfaLVE.mjs → editor.BFIzNSQM.mjs} +1 -30
  193. package/dist/shared/{editor.Iax3GCvt.d.mts → editor.CWQIFIEQ.d.mts} +22 -0
  194. package/dist/types.d.mts +1 -1
  195. package/package.json +17 -1
  196. package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +0 -104
  197. /package/dist/modules/agent/runtime/app/tools/{get_available_bundles → get_bundle_info}/index.d.ts +0 -0
  198. /package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.d.vue.ts +0 -0
  199. /package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue.d.ts +0 -0
@@ -0,0 +1,138 @@
1
+ <template>
2
+ <div class="bk-agent-transcript">
3
+ <section class="bk-agent-transcript-section">
4
+ <h3>System Prompts ({{ transcript.system.length }})</h3>
5
+ <details
6
+ v-for="prompt in transcript.system"
7
+ :key="prompt.id"
8
+ class="bk-agent-transcript-entry"
9
+ >
10
+ <summary>{{ prompt.name }}</summary>
11
+ <pre class="bk-agent-transcript-block">{{ prompt.content }}</pre>
12
+ </details>
13
+ </section>
14
+
15
+ <section class="bk-agent-transcript-section">
16
+ <h3>Tools ({{ transcript.tools.length }})</h3>
17
+ <details
18
+ v-for="tool in transcript.tools"
19
+ :key="tool.name"
20
+ class="bk-agent-transcript-entry"
21
+ >
22
+ <summary>{{ tool.name }}</summary>
23
+ <div class="bk-agent-transcript-block">
24
+ <p>{{ tool.description }}</p>
25
+ <pre>{{ JSON.stringify(tool.input_schema, null, 2) }}</pre>
26
+ </div>
27
+ </details>
28
+ </section>
29
+
30
+ <section class="bk-agent-transcript-section">
31
+ <h3>Messages ({{ transcript.messages.length }})</h3>
32
+ <div
33
+ v-for="(message, i) in transcript.messages"
34
+ :key="i"
35
+ class="bk-agent-transcript-message"
36
+ >
37
+ <div class="bk-agent-transcript-role">
38
+ {{ message.type === "agent" ? "AGENT" : "USER" }}
39
+ <span v-if="message.full" class="bk-agent-transcript-pruned"
40
+ >(pruned)</span
41
+ >
42
+ </div>
43
+ <div class="bk-agent-transcript-content">
44
+ <template v-if="typeof message.seen === 'string'">
45
+ <pre class="bk-agent-transcript-block">{{ message.seen }}</pre>
46
+ </template>
47
+ <template v-else>
48
+ <div
49
+ v-for="(block, j) in message.seen"
50
+ :key="j"
51
+ class="bk-agent-transcript-block"
52
+ >
53
+ <template v-if="block.type === 'text'">
54
+ <pre>{{ block.text }}</pre>
55
+ </template>
56
+ <template v-else-if="block.type === 'skill'">
57
+ <div class="bk-agent-transcript-label">
58
+ Skill: {{ block.name }}
59
+ </div>
60
+ <pre>{{ block.text }}</pre>
61
+ </template>
62
+ <template v-else-if="block.type === 'tool_use'">
63
+ <div class="bk-agent-transcript-label">
64
+ Tool Use: {{ block.name }} ({{ block.id }})
65
+ </div>
66
+ <pre>{{ JSON.stringify(block.input, null, 2) }}</pre>
67
+ </template>
68
+ <template v-else-if="block.type === 'tool_result'">
69
+ <div class="bk-agent-transcript-label">
70
+ Tool Result ({{ block.tool_use_id }})
71
+ <span v-if="block.is_error" class="bk-agent-transcript-error"
72
+ >ERROR</span
73
+ >
74
+ </div>
75
+ <pre>{{ block.content }}</pre>
76
+ </template>
77
+ </div>
78
+ </template>
79
+ </div>
80
+
81
+ <details v-if="message.full" class="bk-agent-transcript-entry">
82
+ <summary>Original (before pruning)</summary>
83
+ <div class="bk-agent-transcript-content">
84
+ <template v-if="typeof message.full === 'string'">
85
+ <pre class="bk-agent-transcript-block">{{ message.full }}</pre>
86
+ </template>
87
+ <template v-else>
88
+ <div
89
+ v-for="(block, j) in message.full"
90
+ :key="j"
91
+ class="bk-agent-transcript-block"
92
+ >
93
+ <template v-if="block.type === 'text'">
94
+ <pre>{{ block.text }}</pre>
95
+ </template>
96
+ <template v-else-if="block.type === 'skill'">
97
+ <div class="bk-agent-transcript-label">
98
+ Skill: {{ block.name }}
99
+ </div>
100
+ <pre>{{ block.text }}</pre>
101
+ </template>
102
+ <template v-else-if="block.type === 'tool_use'">
103
+ <div class="bk-agent-transcript-label">
104
+ Tool Use: {{ block.name }} ({{ block.id }})
105
+ </div>
106
+ <pre>{{ JSON.stringify(block.input, null, 2) }}</pre>
107
+ </template>
108
+ <template v-else-if="block.type === 'tool_result'">
109
+ <div class="bk-agent-transcript-label">
110
+ Tool Result ({{ block.tool_use_id }})
111
+ <span
112
+ v-if="block.is_error"
113
+ class="bk-agent-transcript-error"
114
+ >ERROR</span
115
+ >
116
+ </div>
117
+ <pre>{{ block.content }}</pre>
118
+ </template>
119
+ </div>
120
+ </template>
121
+ </div>
122
+ </details>
123
+ </div>
124
+ </section>
125
+ </div>
126
+ </template>
127
+
128
+ <script setup>
129
+ defineProps({
130
+ transcript: { type: Object, required: true }
131
+ });
132
+ </script>
133
+
134
+ <script>
135
+ export default {
136
+ name: "AgentTranscript"
137
+ };
138
+ </script>
@@ -0,0 +1,8 @@
1
+ import type { Transcript } from '#blokkli/agent/shared/types';
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ declare const __VLS_export: import("vue").DefineComponent<{
5
+ transcript: Transcript;
6
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
7
+ transcript: Transcript;
8
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -58,7 +58,10 @@
58
58
  full-screen
59
59
  @cancel="showTranscript = false"
60
60
  >
61
- <pre class="bk-agent-transcript">{{ transcriptContent }}</pre>
61
+ <AgentTranscript
62
+ v-if="transcriptContent"
63
+ :transcript="transcriptContent"
64
+ />
62
65
  </DialogModal>
63
66
  </BlokkliTransition>
64
67
  </Teleport>
@@ -71,6 +74,7 @@ import { DialogModal, BlokkliTransition } from "#blokkli/editor/components";
71
74
  import agentProvider from "#blokkli/agent/app/composables/agentProvider";
72
75
  import { agentPrompts, agentName } from "#blokkli-build/agent-client";
73
76
  import AgentPanel from "./Panel/index.vue";
77
+ import AgentTranscript from "./Transcript/index.vue";
74
78
  import { defineItemDropdownAction } from "#blokkli/editor/composables";
75
79
  const DEBUG_STYLING = false;
76
80
  const { adapter } = defineBlokkliFeature({
@@ -0,0 +1,175 @@
1
+ import { z } from "zod";
2
+ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
3
+ import { getAvailableOptions } from "#blokkli/editor/helpers/options";
4
+ import { getRuntimeOptionValue } from "#blokkli/runtime-helpers";
5
+ import { blockOptionsMapSchema, extractOptionLabels } from "../schemas.js";
6
+ const paramsSchema = z.object({
7
+ parentUuid: z.string().describe("The parent entity UUID"),
8
+ field: z.string().describe("The field name"),
9
+ bundles: z.array(z.string()).optional().describe(
10
+ "Optional list of bundle names to filter by. If omitted, returns all allowed bundles."
11
+ )
12
+ });
13
+ const bundleSchema = z.object({
14
+ bundle: z.string().describe("The paragraph type identifier"),
15
+ label: z.string().describe("Human-readable label"),
16
+ description: z.string().optional().describe("Bundle description if available"),
17
+ contentFields: z.record(
18
+ z.string(),
19
+ z.object({
20
+ type: z.string().describe("Field type: plain, markup, reference, or link")
21
+ })
22
+ ).describe(
23
+ "Content fields (text, media, links) on this bundle, keyed by field name"
24
+ ),
25
+ paragraphFields: z.record(
26
+ z.string(),
27
+ z.object({
28
+ label: z.string().describe("Human-readable label"),
29
+ allowedBundles: z.array(z.string()).describe("Paragraph types allowed in this field"),
30
+ cardinality: z.number().describe("Max paragraphs allowed (-1 = unlimited)")
31
+ })
32
+ ).describe(
33
+ "Paragraph fields (for nested paragraphs) on this bundle, keyed by field name"
34
+ ),
35
+ options: blockOptionsMapSchema.optional().describe(
36
+ "Available options for this bundle with their default values (only included when few bundles are returned)"
37
+ )
38
+ });
39
+ const resultSchema = z.object({
40
+ fieldLabel: z.string().describe("Human-readable field label"),
41
+ cardinality: z.number().describe("Max paragraphs allowed (-1 = unlimited)"),
42
+ currentCount: z.number().describe("Current number of paragraphs in the field"),
43
+ bundles: z.array(bundleSchema).describe("Available paragraph types"),
44
+ nestingInfo: z.string().optional().describe(
45
+ "Summary of which bundles have paragraph fields for nested paragraphs. Use get_child_paragraphs after adding these bundles to populate their nested fields."
46
+ )
47
+ });
48
+ export default defineBlokkliAgentTool({
49
+ name: "get_bundle_info",
50
+ description: "Get detailed information about which paragraph types can be added to a specific field, including their content fields and paragraph fields (for nested paragraphs).",
51
+ category: "query",
52
+ modes: ["readonly", "editing", "translating", "review"],
53
+ label($t) {
54
+ return $t("aiAgentGetBundleInfoRunning", "Getting bundle info...");
55
+ },
56
+ paramsSchema,
57
+ resultSchema,
58
+ execute(ctx, params) {
59
+ const { fields, types, state, definitions, $t } = ctx.app;
60
+ const label = $t(
61
+ "aiAgentGetBundleInfoDone",
62
+ "Got bundle info for @field"
63
+ ).replace("@field", params.field);
64
+ const field = fields.find(params.parentUuid, params.field);
65
+ if (!field) {
66
+ return {
67
+ label,
68
+ result: {
69
+ fieldLabel: params.field,
70
+ cardinality: -1,
71
+ currentCount: 0,
72
+ bundles: []
73
+ }
74
+ };
75
+ }
76
+ const fieldKey = `${params.parentUuid}:${params.field}`;
77
+ const currentCount = state.getFieldBlockCount(fieldKey);
78
+ const allowedBundles = params.bundles ? field.allowedBundles.filter((b) => params.bundles.includes(b)) : field.allowedBundles;
79
+ const includeOptions = allowedBundles.length < 3;
80
+ const bundles = allowedBundles.map((bundle) => {
81
+ const bundleDefinition = types.getBlockBundleDefinition(bundle);
82
+ const contentFields = {};
83
+ for (const c of types.editableFieldConfig.forEntityTypeAndBundle(ctx.itemEntityType, bundle).filter((c2) => c2.type !== "table")) {
84
+ contentFields[c.name] = {
85
+ type: c.type === "frame" || c.type === "markup" ? "markup" : "plain"
86
+ };
87
+ }
88
+ for (const c of types.droppableFieldConfig.forEntityTypeAndBundle(
89
+ ctx.itemEntityType,
90
+ bundle
91
+ )) {
92
+ contentFields[c.name] = { type: c.type };
93
+ }
94
+ const paragraphFields = {};
95
+ for (const c of types.fieldConfig.forEntityTypeAndBundle(
96
+ ctx.itemEntityType,
97
+ bundle
98
+ )) {
99
+ paragraphFields[c.name] = {
100
+ label: c.label,
101
+ allowedBundles: c.allowedBundles,
102
+ cardinality: c.cardinality
103
+ };
104
+ }
105
+ let options;
106
+ if (includeOptions) {
107
+ const definition = definitions.getBlockDefinition(bundle, "default");
108
+ if (definition) {
109
+ const availableOptions = getAvailableOptions(
110
+ definition.options,
111
+ definition.globalOptions,
112
+ definitions.globalOptions.value
113
+ );
114
+ if (availableOptions.length > 0) {
115
+ options = {};
116
+ for (const opt of availableOptions) {
117
+ const currentValue = getRuntimeOptionValue(
118
+ opt.option,
119
+ opt.option.default
120
+ );
121
+ const entry = {
122
+ type: opt.option.type,
123
+ label: opt.option.label,
124
+ currentValue
125
+ };
126
+ if (opt.option.description) {
127
+ entry.description = opt.option.description;
128
+ }
129
+ const labels = extractOptionLabels(opt.option);
130
+ if (labels) {
131
+ entry.options = labels;
132
+ }
133
+ if ("min" in opt.option) {
134
+ entry.min = opt.option.min;
135
+ }
136
+ if ("max" in opt.option) {
137
+ entry.max = opt.option.max;
138
+ }
139
+ if ("step" in opt.option && opt.option.type === "range") {
140
+ entry.step = opt.option.step;
141
+ }
142
+ options[opt.property] = entry;
143
+ }
144
+ }
145
+ }
146
+ }
147
+ return {
148
+ bundle,
149
+ label: bundleDefinition?.label ?? bundle,
150
+ description: bundleDefinition?.description,
151
+ contentFields,
152
+ paragraphFields,
153
+ options
154
+ };
155
+ });
156
+ const nestingBundles = bundles.filter(
157
+ (b) => Object.keys(b.paragraphFields).length > 0
158
+ );
159
+ const nestingInfo = nestingBundles.length ? nestingBundles.map(
160
+ (b) => `${b.bundle} has paragraph fields: ${Object.entries(
161
+ b.paragraphFields
162
+ ).map(([name, f]) => `${name} (${f.allowedBundles.join(", ")})`).join(", ")}`
163
+ ).join("; ") : void 0;
164
+ return {
165
+ label,
166
+ result: {
167
+ fieldLabel: field.label,
168
+ cardinality: field.cardinality,
169
+ currentCount,
170
+ bundles,
171
+ nestingInfo
172
+ }
173
+ };
174
+ }
175
+ });
@@ -6,6 +6,7 @@ import {
6
6
  buildBlockOptionsMap
7
7
  } from "../schemas.js";
8
8
  import { getAvailableOptions } from "#blokkli/editor/helpers/options";
9
+ import { fragmentBlockBundle } from "#blokkli-build/config";
9
10
  const paramsSchema = z.object({
10
11
  uuid: z.string().describe("The paragraph UUID"),
11
12
  includeParentChain: z.boolean().optional().default(true).describe("Include ancestor parent paragraphs up to the page"),
@@ -77,6 +78,7 @@ const resultSchema = z.object({
77
78
  uuid: z.string().describe("The paragraph UUID"),
78
79
  bundle: z.string().describe("The paragraph type"),
79
80
  label: z.string().describe("Human-readable paragraph label"),
81
+ fragmentName: z.string().optional().describe("The fragment name, if this paragraph is a fragment block"),
80
82
  nestingLevel: z.number().describe("Nesting depth (0 = root level)"),
81
83
  parent: parentSchema.nullable().describe("The parent entity containing this paragraph"),
82
84
  parentChain: z.array(parentChainItemSchema).optional().describe("Ancestor parent paragraphs from immediate parent to page"),
@@ -132,6 +134,9 @@ export default defineBlokkliAgentTool({
132
134
  nestingLevel: state.getNestingLevel(params.uuid),
133
135
  parent
134
136
  };
137
+ if (block.bundle === fragmentBlockBundle && block.fragment?.name) {
138
+ result.fragmentName = block.fragment.name;
139
+ }
135
140
  if (params.includeParentChain) {
136
141
  const parentChain = [];
137
142
  let currentUuid = state.getParentEntityUuid(params.uuid);
@@ -1,6 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import type { OptionItem } from '#blokkli/editor/helpers/options';
3
3
  import type { BlokkliApp } from '#blokkli/editor/types/app';
4
+ /**
5
+ * Extract a simple key→label map from the various radios/checkboxes option formats.
6
+ * Handles plain strings, icon objects, color objects, grid objects, etc.
7
+ */
8
+ export declare function extractOptionLabels(option: Record<string, unknown>): Record<string, string> | undefined;
4
9
  /**
5
10
  * Shared schema for a single block option with its current value.
6
11
  */
@@ -32,6 +37,10 @@ export type BlockOptionsMap = z.infer<typeof blockOptionsMapSchema>;
32
37
  * Build a block options map from available options and mutated state.
33
38
  */
34
39
  export declare function buildBlockOptionsMap(availableOptions: OptionItem[], mutatedOptions: Record<string, Record<string, string>>, uuid: string): BlockOptionsMap;
40
+ /**
41
+ * Build a block options map from option definitions, using defaults as current values.
42
+ */
43
+ export declare function buildBlockOptionsMapFromDefinitions(options: Record<string, Record<string, unknown>>): BlockOptionsMap;
35
44
  /**
36
45
  * Schema for a parent entity (the container of a block).
37
46
  * A parent is an entity + field combination where blocks can be placed.
@@ -50,9 +59,9 @@ export declare const mutationResultSchema: z.ZodUnion<readonly [z.ZodObject<{
50
59
  type: z.ZodEnum<{
51
60
  add: "add";
52
61
  delete: "delete";
53
- options: "options";
54
62
  move: "move";
55
63
  rewrite: "rewrite";
64
+ options: "options";
56
65
  }>;
57
66
  label: z.ZodString;
58
67
  }, z.core.$strip>, z.ZodObject<{
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { getMutatedOptionValue } from "#blokkli/editor/helpers/options";
3
3
  import { getRuntimeOptionValue } from "#blokkli/runtime-helpers";
4
- function extractOptionLabels(option) {
4
+ export function extractOptionLabels(option) {
5
5
  if (!("options" in option) || !option.options) return void 0;
6
6
  const raw = option.options;
7
7
  const labels = {};
@@ -42,31 +42,44 @@ export function buildBlockOptionsMap(availableOptions, mutatedOptions, uuid) {
42
42
  opt.option.default
43
43
  );
44
44
  const currentValue = getRuntimeOptionValue(opt.option, rawValue);
45
- const entry = {
46
- type: opt.option.type,
47
- label: opt.option.label,
48
- currentValue
49
- };
50
- if (opt.option.description) {
51
- entry.description = opt.option.description;
52
- }
53
- const labels = extractOptionLabels(opt.option);
54
- if (labels) {
55
- entry.options = labels;
56
- }
57
- if ("min" in opt.option) {
58
- entry.min = opt.option.min;
59
- }
60
- if ("max" in opt.option) {
61
- entry.max = opt.option.max;
62
- }
63
- if ("step" in opt.option && opt.option.type === "range") {
64
- entry.step = opt.option.step;
65
- }
66
- result[opt.property] = entry;
45
+ result[opt.property] = buildBlockOptionEntry(opt.option, currentValue);
67
46
  }
68
47
  return result;
69
48
  }
49
+ export function buildBlockOptionsMapFromDefinitions(options) {
50
+ const result = {};
51
+ for (const [key, opt] of Object.entries(options)) {
52
+ result[key] = buildBlockOptionEntry(
53
+ opt,
54
+ opt.default
55
+ );
56
+ }
57
+ return result;
58
+ }
59
+ function buildBlockOptionEntry(opt, currentValue) {
60
+ const entry = {
61
+ type: opt.type,
62
+ label: opt.label,
63
+ currentValue
64
+ };
65
+ if (opt.description) {
66
+ entry.description = opt.description;
67
+ }
68
+ const labels = extractOptionLabels(opt);
69
+ if (labels) {
70
+ entry.options = labels;
71
+ }
72
+ if ("min" in opt) {
73
+ entry.min = opt.min;
74
+ }
75
+ if ("max" in opt) {
76
+ entry.max = opt.max;
77
+ }
78
+ if ("step" in opt && opt.type === "range") {
79
+ entry.step = opt.step;
80
+ }
81
+ return entry;
82
+ }
70
83
  export const parentSchema = z.object({
71
84
  type: z.string().describe(
72
85
  "The entity type of the parent. Do NOT guess this - always use the parent object returned by get_child_paragraphs."
@@ -28,8 +28,10 @@ export declare class Session {
28
28
  pendingPlanApproval: {
29
29
  resolve: (approved: boolean) => void;
30
30
  } | null;
31
- /** Last tools payload sent to the provider (for transcript debugging) */
32
- private lastProviderTools;
31
+ /** Pre-pruned messages snapshot for transcript (captured before pruneMessages) */
32
+ private unprunedMessages;
33
+ /** Last generic tool definitions for transcript */
34
+ private lastTools;
33
35
  init(tools: ClientToolDefinition[], pageContext: PageContext): void;
34
36
  start(peer: Peer, prompt: string, apiKey: string, authSecret: string, selectedUuids?: string[]): void;
35
37
  resolveToolResult(callId: string, result: {