@blokkli/editor 2.0.0-alpha.38 → 2.0.0-alpha.39

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 (108) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +2 -1
  3. package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +1 -0
  4. package/dist/modules/agent/runtime/app/composables/agentProvider.js +51 -7
  5. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewCode/index.d.vue.ts +6 -0
  6. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewCode/index.vue +9 -0
  7. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewCode/index.vue.d.ts +6 -0
  8. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewCsv/index.d.vue.ts +6 -0
  9. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewCsv/index.vue +31 -0
  10. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewCsv/index.vue.d.ts +6 -0
  11. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewHtml/index.d.vue.ts +6 -0
  12. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewHtml/index.vue +12 -0
  13. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewHtml/index.vue.d.ts +6 -0
  14. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewMarkdown/index.d.vue.ts +6 -0
  15. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewMarkdown/index.vue +17 -0
  16. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/PreviewMarkdown/index.vue.d.ts +6 -0
  17. package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.vue +31 -1
  18. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.d.vue.ts +1 -1
  19. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.vue +9 -7
  20. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.vue.d.ts +1 -1
  21. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.d.vue.ts +3 -0
  22. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.vue +31 -7
  23. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.vue.d.ts +3 -0
  24. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.d.vue.ts +1 -0
  25. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.vue +18 -2
  26. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.vue.d.ts +1 -0
  27. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.d.vue.ts +1 -0
  28. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.vue +5 -2
  29. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.vue.d.ts +1 -0
  30. package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +2 -1
  31. package/dist/modules/agent/runtime/app/features/agent/Panel/DropHandler/index.d.vue.ts +17 -0
  32. package/dist/modules/agent/runtime/app/features/agent/Panel/DropHandler/index.vue +230 -0
  33. package/dist/modules/agent/runtime/app/features/agent/Panel/DropHandler/index.vue.d.ts +17 -0
  34. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.d.vue.ts +4 -2
  35. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +5 -8
  36. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue.d.ts +4 -2
  37. package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.vue +1 -1
  38. package/dist/modules/agent/runtime/app/features/agent/Panel/index.d.vue.ts +1 -0
  39. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +26 -3
  40. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue.d.ts +1 -0
  41. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +34 -1
  42. package/dist/modules/agent/runtime/app/features/agent/index.vue +2 -0
  43. package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +8 -2
  44. package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +1 -0
  45. package/dist/modules/agent/runtime/app/tools/ask_question/index.js +9 -1
  46. package/dist/modules/agent/runtime/app/tools/check_readability/index.js +15 -16
  47. package/dist/modules/agent/runtime/app/tools/{analyze_content → get_readability_issues}/index.js +3 -2
  48. package/dist/modules/agent/runtime/app/tools/{batch_rewrite_text → update_text_fields}/Component.d.vue.ts +9 -0
  49. package/dist/modules/agent/runtime/app/tools/{batch_rewrite_text → update_text_fields}/Component.vue +80 -34
  50. package/dist/modules/agent/runtime/app/tools/{batch_rewrite_text → update_text_fields}/Component.vue.d.ts +9 -0
  51. package/dist/modules/agent/runtime/app/tools/update_text_fields/Details/index.d.vue.ts +6 -0
  52. package/dist/modules/agent/runtime/app/tools/update_text_fields/Details/index.vue +24 -0
  53. package/dist/modules/agent/runtime/app/tools/update_text_fields/Details/index.vue.d.ts +6 -0
  54. package/dist/modules/agent/runtime/app/tools/{batch_rewrite_text → update_text_fields}/Item.d.vue.ts +2 -0
  55. package/dist/modules/agent/runtime/app/tools/{batch_rewrite_text → update_text_fields}/Item.vue +9 -4
  56. package/dist/modules/agent/runtime/app/tools/{batch_rewrite_text → update_text_fields}/Item.vue.d.ts +2 -0
  57. package/dist/modules/agent/runtime/app/tools/update_text_fields/index.js +78 -0
  58. package/dist/modules/agent/runtime/app/types/index.d.ts +29 -2
  59. package/dist/modules/agent/runtime/app/types/index.js +3 -2
  60. package/dist/modules/agent/runtime/server/Session.d.ts +5 -1
  61. package/dist/modules/agent/runtime/server/Session.js +34 -6
  62. package/dist/modules/agent/runtime/server/default-skills/adding-new-paragraphs.js +1 -1
  63. package/dist/modules/agent/runtime/server/default-skills/fixReadability.js +3 -2
  64. package/dist/modules/agent/runtime/server/default-skills/pageReview.js +1 -1
  65. package/dist/modules/agent/runtime/server/default-skills/rewriteAndTranslate.js +2 -3
  66. package/dist/modules/agent/runtime/server/default-system-prompts/available-skills.js +1 -1
  67. package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +1 -2
  68. package/dist/modules/agent/runtime/server/default-system-prompts/introduction.js +2 -1
  69. package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +1 -1
  70. package/dist/modules/agent/runtime/server/default-system-prompts/workflow.js +1 -1
  71. package/dist/modules/agent/runtime/server/helpers.js +2 -1
  72. package/dist/modules/agent/runtime/server/providers/anthropic.js +7 -4
  73. package/dist/modules/agent/runtime/server/providers/openai.js +167 -12
  74. package/dist/modules/agent/runtime/server/providers/types.d.ts +7 -2
  75. package/dist/modules/agent/runtime/server/server-tools/complete_plan_step/index.js +15 -0
  76. package/dist/modules/agent/runtime/server/server-tools/index.d.ts +6 -0
  77. package/dist/modules/agent/runtime/server/server-tools/{load_skill → load_skills}/index.d.ts +2 -2
  78. package/dist/modules/agent/runtime/server/server-tools/load_skills/index.js +80 -0
  79. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +1 -0
  80. package/dist/modules/agent/runtime/server/skills/types.d.ts +4 -0
  81. package/dist/modules/agent/runtime/shared/types.d.ts +20 -2
  82. package/dist/modules/agent/runtime/shared/types.js +6 -0
  83. package/dist/modules/charts/runtime/blokkli/skills/charts.js +12 -3
  84. package/dist/runtime/editor/components/DiffViewer/DiffDisplay/index.d.vue.ts +9 -0
  85. package/dist/runtime/editor/components/DiffViewer/DiffDisplay/index.vue +31 -0
  86. package/dist/runtime/editor/components/DiffViewer/DiffDisplay/index.vue.d.ts +9 -0
  87. package/dist/runtime/editor/components/DiffViewer/DiffValue.vue +7 -4
  88. package/dist/runtime/editor/components/DiffViewer/State.vue +8 -30
  89. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -0
  90. package/dist/runtime/editor/components/FlexTextarea/index.vue +1 -1
  91. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -0
  92. package/dist/runtime/editor/components/index.d.ts +2 -1
  93. package/dist/runtime/editor/components/index.js +2 -0
  94. package/dist/runtime/editor/css/output.css +1 -1
  95. package/dist/runtime/editor/features/analyze/index.vue +1 -1
  96. package/dist/runtime/editor/features/edit/index.vue +20 -0
  97. package/dist/runtime/editor/providers/definition.d.ts +2 -1
  98. package/dist/runtime/editor/providers/definition.js +5 -1
  99. package/dist/runtime/editor/providers/storage.js +1 -1
  100. package/dist/runtime/editor/translations/de.json +4 -0
  101. package/dist/runtime/editor/translations/fr.json +4 -0
  102. package/dist/runtime/editor/translations/gsw_CH.json +4 -0
  103. package/dist/runtime/editor/translations/it.json +4 -0
  104. package/package.json +3 -2
  105. package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/index.js +0 -55
  106. package/dist/modules/agent/runtime/server/server-tools/load_skill/index.js +0 -58
  107. /package/dist/modules/agent/runtime/app/tools/{analyze_content → get_readability_issues}/index.d.ts +0 -0
  108. /package/dist/modules/agent/runtime/app/tools/{batch_rewrite_text → update_text_fields}/index.d.ts +0 -0
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blokkli/editor",
3
3
  "configKey": "blokkli",
4
- "version": "2.0.0-alpha.38",
4
+ "version": "2.0.0-alpha.39",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.15.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -18,7 +18,7 @@ import { d as defineCodeTemplate, a as defineFileTemplate, w as withHelper } fro
18
18
  import { defu, createDefu } from 'defu';
19
19
 
20
20
  const name = "@blokkli/editor";
21
- const version = "2.0.0-alpha.38";
21
+ const version = "2.0.0-alpha.39";
22
22
 
23
23
  function sortObjectKeys(obj) {
24
24
  if (Array.isArray(obj)) {
@@ -1555,6 +1555,7 @@ const USED_MATERIAL_ICONS = [
1555
1555
  "bk_mdi_info-fill",
1556
1556
  "bk_mdi_ink_selection",
1557
1557
  "bk_mdi_inventory",
1558
+ "bk_mdi_keyboard_arrow_down",
1558
1559
  "bk_mdi_keyboard_command_key",
1559
1560
  "bk_mdi_lists",
1560
1561
  "bk_mdi_logo_dev",
@@ -43,6 +43,7 @@ export type AgentProvider = {
43
43
  newConversation: () => void;
44
44
  getTranscript: () => void;
45
45
  onToolComponentDone: (result: unknown) => void;
46
+ toolDetails: Map<string, unknown>;
46
47
  transcriptContent: Ref<Transcript | null>;
47
48
  showTranscript: Ref<boolean>;
48
49
  conversationList: Ref<AgentConversationSummary[]>;
@@ -1,4 +1,4 @@
1
- import { ref, readonly, watch } from "#imports";
1
+ import { ref, readonly, reactive, watch } from "#imports";
2
2
  import {
3
3
  conversationItemSchema
4
4
  } from "#blokkli/agent/app/types";
@@ -21,7 +21,8 @@ export default function(app, adapter, agentName) {
21
21
  let ws = null;
22
22
  let reconnectTimeout = null;
23
23
  let pingInterval = null;
24
- let hasEverConnected = false;
24
+ let reconnectAttempts = 0;
25
+ const MAX_RECONNECT_ATTEMPTS = 10;
25
26
  const isConnected = ref(false);
26
27
  const isReady = ref(false);
27
28
  const hasBeenReady = ref(false);
@@ -43,6 +44,7 @@ export default function(app, adapter, agentName) {
43
44
  const activeConversationId = ref(null);
44
45
  const conversationList = ref([]);
45
46
  const showConversationList = ref(false);
47
+ const toolDetails = reactive(/* @__PURE__ */ new Map());
46
48
  async function saveCurrentConversation(serverState) {
47
49
  if (!adapter.agentConversations) return;
48
50
  if (!conversation.value.length) return;
@@ -177,15 +179,30 @@ export default function(app, adapter, agentName) {
177
179
  }
178
180
  function onWebSocketOpen() {
179
181
  isConnected.value = true;
182
+ reconnectAttempts = 0;
180
183
  pingInterval = window.setInterval(() => {
181
184
  send({ type: "ping" });
182
185
  }, 3e4);
183
186
  onConnect();
184
187
  }
185
188
  function onWebSocketClose() {
189
+ if (pingInterval) {
190
+ window.clearInterval(pingInterval);
191
+ pingInterval = null;
192
+ }
186
193
  isConnected.value = false;
187
194
  isReady.value = false;
188
195
  isProcessing.value = false;
196
+ reconnectAttempts++;
197
+ if (reconnectAttempts > MAX_RECONNECT_ATTEMPTS) {
198
+ conversation.value.push({
199
+ type: "error",
200
+ id: generateId(),
201
+ errorType: "connection",
202
+ timestamp: Date.now()
203
+ });
204
+ return;
205
+ }
189
206
  reconnectTimeout = window.setTimeout(() => {
190
207
  if (!isConnected.value) {
191
208
  connect();
@@ -204,8 +221,16 @@ export default function(app, adapter, agentName) {
204
221
  }
205
222
  }
206
223
  function connect() {
207
- if (hasEverConnected) return;
208
- hasEverConnected = true;
224
+ if (ws && (ws.readyState === WebSocket.OPEN || ws.readyState === WebSocket.CONNECTING)) {
225
+ return;
226
+ }
227
+ if (ws) {
228
+ ws.removeEventListener("open", onWebSocketOpen);
229
+ ws.removeEventListener("close", onWebSocketClose);
230
+ ws.removeEventListener("error", onWebSocketError);
231
+ ws.removeEventListener("message", onWebSocketMessage);
232
+ ws = null;
233
+ }
209
234
  const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
210
235
  const url = `${protocol}//${window.location.host}/api/blokkli/agent`;
211
236
  ws = new WebSocket(url);
@@ -584,13 +609,29 @@ export default function(app, adapter, agentName) {
584
609
  timestamp
585
610
  });
586
611
  activeItem.value = null;
612
+ if (toolDef.buildDetails) {
613
+ try {
614
+ const detailsSource = typeof result === "object" && result !== null && "_details" in result ? result._details : result;
615
+ const details = toolDef.buildDetails(detailsSource);
616
+ if (details != null) {
617
+ toolDetails.set(callId, details);
618
+ }
619
+ } catch {
620
+ }
621
+ }
587
622
  let resultForServer = result;
588
- if (toolDef.prunedSummary && typeof result === "object" && result !== null) {
623
+ if (typeof result === "object" && result !== null) {
624
+ if ("_details" in result) {
625
+ const { _details: _, ...rest } = result;
626
+ resultForServer = rest;
627
+ }
628
+ }
629
+ if (toolDef.prunedSummary && typeof resultForServer === "object" && resultForServer !== null) {
589
630
  try {
590
- const summary = toolDef.prunedSummary(result);
631
+ const summary = toolDef.prunedSummary(resultForServer);
591
632
  if (summary) {
592
633
  resultForServer = {
593
- ...result,
634
+ ...resultForServer,
594
635
  _summary: summary
595
636
  };
596
637
  }
@@ -834,6 +875,7 @@ export default function(app, adapter, agentName) {
834
875
  activeConversationId.value = null;
835
876
  plan.value = null;
836
877
  usageTurns.value = [];
878
+ toolDetails.clear();
837
879
  send({ type: "new_conversation" });
838
880
  }
839
881
  function getTranscript() {
@@ -878,6 +920,8 @@ export default function(app, adapter, agentName) {
878
920
  newConversation,
879
921
  getTranscript,
880
922
  onToolComponentDone,
923
+ // Tool details (ephemeral)
924
+ toolDetails,
881
925
  // Transcript dialog state
882
926
  transcriptContent,
883
927
  showTranscript,
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ content: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <pre class="bk-agent-attachment-code"><code>{{ content }}</code></pre>
3
+ </template>
4
+
5
+ <script setup>
6
+ defineProps({
7
+ content: { type: String, required: true }
8
+ });
9
+ </script>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ content: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ content: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <table class="bk-agent-attachment-table">
3
+ <thead>
4
+ <tr>
5
+ <th v-for="(cell, j) in headerRow" :key="j">{{ cell }}</th>
6
+ </tr>
7
+ </thead>
8
+ <tbody>
9
+ <tr v-for="(row, i) in bodyRows" :key="i">
10
+ <td v-for="(cell, j) in row" :key="j">{{ cell }}</td>
11
+ </tr>
12
+ </tbody>
13
+ </table>
14
+ </template>
15
+
16
+ <script setup>
17
+ import { computed } from "#imports";
18
+ const props = defineProps({
19
+ content: { type: String, required: true }
20
+ });
21
+ function parseRow(line) {
22
+ return line.split(",").map((cell) => cell.trim());
23
+ }
24
+ const headerRow = computed(() => {
25
+ const firstLine = props.content.trim().split("\n")[0];
26
+ return firstLine ? parseRow(firstLine) : [];
27
+ });
28
+ const bodyRows = computed(() => {
29
+ return props.content.trim().split("\n").slice(1).map(parseRow);
30
+ });
31
+ </script>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ content: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ content: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <div
3
+ class="bk-agent-attachment-rendered bk-agent-message-text"
4
+ v-html="content"
5
+ />
6
+ </template>
7
+
8
+ <script setup>
9
+ defineProps({
10
+ content: { type: String, required: true }
11
+ });
12
+ </script>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ content: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ content: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div
3
+ class="bk-agent-attachment-rendered bk-agent-message-text"
4
+ v-html="html"
5
+ />
6
+ </template>
7
+
8
+ <script setup>
9
+ import { computed } from "#imports";
10
+ import { marked } from "marked";
11
+ const props = defineProps({
12
+ content: { type: String, required: true }
13
+ });
14
+ const html = computed(() => {
15
+ return marked.parse(props.content, { gfm: true, breaks: true });
16
+ });
17
+ </script>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ content: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -30,7 +30,7 @@
30
30
  class="bk-agent-attachment-modal"
31
31
  @cancel="showAttachment = false"
32
32
  >
33
- <div>{{ attachment.content }}</div>
33
+ <component :is="previewComponent" :content="bodyContent" />
34
34
  </DialogModal>
35
35
  </BlokkliTransition>
36
36
  </Teleport>
@@ -43,6 +43,17 @@ import {
43
43
  BlokkliTransition,
44
44
  DialogModal
45
45
  } from "#blokkli/editor/components";
46
+ import PreviewMarkdown from "./PreviewMarkdown/index.vue";
47
+ import PreviewHtml from "./PreviewHtml/index.vue";
48
+ import PreviewCode from "./PreviewCode/index.vue";
49
+ import PreviewCsv from "./PreviewCsv/index.vue";
50
+ const PREVIEW_COMPONENTS = {
51
+ markdown: PreviewMarkdown,
52
+ html: PreviewHtml,
53
+ code: PreviewCode,
54
+ csv: PreviewCsv,
55
+ plaintext: PreviewCode
56
+ };
46
57
  const props = defineProps({
47
58
  attachment: { type: Object, required: true },
48
59
  removable: { type: Boolean, required: false }
@@ -50,12 +61,31 @@ const props = defineProps({
50
61
  defineEmits(["remove"]);
51
62
  const { $t, ui } = useBlokkli();
52
63
  const showAttachment = ref(false);
64
+ const FILE_PREFIX = "--- File: ";
53
65
  const title = computed(() => {
54
66
  if (props.attachment.type === "text") {
67
+ const content = props.attachment.content;
68
+ if (content.startsWith(FILE_PREFIX)) {
69
+ const endIndex = content.indexOf(" ---\n");
70
+ if (endIndex !== -1) {
71
+ return content.slice(FILE_PREFIX.length, endIndex);
72
+ }
73
+ }
55
74
  return $t("aiAgentPastedText", "Pasted text");
56
75
  }
57
76
  return "";
58
77
  });
78
+ const bodyContent = computed(() => {
79
+ const content = props.attachment.content;
80
+ const headerEnd = content.indexOf(" ---\n");
81
+ if (content.startsWith(FILE_PREFIX) && headerEnd !== -1) {
82
+ return content.slice(headerEnd + 5);
83
+ }
84
+ return content;
85
+ });
86
+ const previewComponent = computed(() => {
87
+ return PREVIEW_COMPONENTS[props.attachment.format];
88
+ });
59
89
  const preview = computed(() => {
60
90
  return props.attachment.content.replace(/\s+/g, " ").trim().slice(0, 200);
61
91
  });
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  id: string;
3
3
  timestamp: number;
4
4
  type: 'server_tool';
5
- tool: 'load_skill' | 'load_tools' | 'create_plan' | 'complete_plan_step' | 'plan_completed';
5
+ tool: 'load_skills' | 'load_tools' | 'create_plan' | 'complete_plan_step' | 'plan_completed';
6
6
  label: string;
7
7
  };
8
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <div class="bk-agent-assistant-bubble bk-is-tool bk-is-server-tool">
3
3
  <div class="bk-agent-tool-call bk-is-server-tool">
4
- <Icon
5
- :name="getServerSideToolIcon(tool)"
6
- class="bk-agent-tool-call-status"
7
- />
8
- <span>{{ serverToolLabel }}</span>
4
+ <div class="bk-agent-tool-call-inner">
5
+ <Icon
6
+ :name="getServerSideToolIcon(tool)"
7
+ class="bk-agent-tool-call-status"
8
+ />
9
+ <span>{{ serverToolLabel }}</span>
10
+ </div>
9
11
  </div>
10
12
  </div>
11
13
  </template>
@@ -22,7 +24,7 @@ const props = defineProps({
22
24
  });
23
25
  const { $t } = useBlokkli();
24
26
  const serverToolLabel = computed(() => {
25
- if (props.tool === "load_skill") {
27
+ if (props.tool === "load_skills") {
26
28
  return $t("aiAgentLoadSkill", 'Using skill "@label"').replace(
27
29
  "@label",
28
30
  props.label
@@ -55,7 +57,7 @@ const serverToolLabel = computed(() => {
55
57
  return props.label;
56
58
  });
57
59
  function getServerSideToolIcon(id) {
58
- if (id === "load_skill") {
60
+ if (id === "load_skills") {
59
61
  return "bk_mdi_book_2";
60
62
  }
61
63
  if (id === "create_plan") {
@@ -2,7 +2,7 @@ type __VLS_Props = {
2
2
  id: string;
3
3
  timestamp: number;
4
4
  type: 'server_tool';
5
- tool: 'load_skill' | 'load_tools' | 'create_plan' | 'complete_plan_step' | 'plan_completed';
5
+ tool: 'load_skills' | 'load_tools' | 'create_plan' | 'complete_plan_step' | 'plan_completed';
6
6
  label: string;
7
7
  };
8
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,3 +1,4 @@
1
+ import { type Component } from '#imports';
1
2
  type __VLS_Props = {
2
3
  id: string;
3
4
  timestamp: number;
@@ -7,6 +8,8 @@ type __VLS_Props = {
7
8
  label: string;
8
9
  status: 'active' | 'success' | 'error';
9
10
  isActive?: boolean;
11
+ details?: unknown;
12
+ detailsComponent?: Component;
10
13
  };
11
14
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
15
  declare const _default: typeof __VLS_export;
@@ -1,17 +1,38 @@
1
1
  <template>
2
2
  <div class="bk-agent-assistant-bubble bk-is-tool">
3
3
  <div class="bk-agent-tool-call" :class="toolStatusClass">
4
- <StatusIcon :status="toolStatus" />
5
- <span class="bk-agent-tool-call-name">{{
6
- label || formatToolName(tool)
7
- }}</span>
4
+ <div class="bk-agent-tool-call-inner">
5
+ <StatusIcon :status="toolStatus" />
6
+ <span class="bk-agent-tool-call-name">{{
7
+ label || formatToolName(tool)
8
+ }}</span>
9
+ <button
10
+ v-if="details != null && detailsComponent"
11
+ class="bk-agent-tool-details-toggle"
12
+ :class="{ 'bk-is-expanded': isExpanded }"
13
+ @click="isExpanded = !isExpanded"
14
+ >
15
+ <Icon name="bk_mdi_keyboard_arrow_down" />
16
+ </button>
17
+ </div>
18
+ <TransitionHeight
19
+ v-if="details != null && detailsComponent"
20
+ :duration="200"
21
+ opacity
22
+ >
23
+ <div v-if="isExpanded" class="bk-agent-tool-details">
24
+ <div class="bk-agent-tool-details-inner">
25
+ <component :is="detailsComponent" :details="details" />
26
+ </div>
27
+ </div>
28
+ </TransitionHeight>
8
29
  </div>
9
30
  </div>
10
31
  </template>
11
32
 
12
33
  <script setup>
13
- import { computed } from "#imports";
14
- import { StatusIcon } from "#blokkli/editor/components";
34
+ import { computed, ref } from "#imports";
35
+ import { StatusIcon, Icon, TransitionHeight } from "#blokkli/editor/components";
15
36
  const props = defineProps({
16
37
  id: { type: String, required: true },
17
38
  timestamp: { type: Number, required: true },
@@ -20,8 +41,11 @@ const props = defineProps({
20
41
  tool: { type: String, required: true },
21
42
  label: { type: String, required: true },
22
43
  status: { type: String, required: true },
23
- isActive: { type: Boolean, required: false }
44
+ isActive: { type: Boolean, required: false },
45
+ details: { type: null, required: false },
46
+ detailsComponent: { type: null, required: false }
24
47
  });
48
+ const isExpanded = ref(false);
25
49
  const toolStatus = computed(() => {
26
50
  if (props.isActive) return "active";
27
51
  return props.status;
@@ -1,3 +1,4 @@
1
+ import { type Component } from '#imports';
1
2
  type __VLS_Props = {
2
3
  id: string;
3
4
  timestamp: number;
@@ -7,6 +8,8 @@ type __VLS_Props = {
7
8
  label: string;
8
9
  status: 'active' | 'success' | 'error';
9
10
  isActive?: boolean;
11
+ details?: unknown;
12
+ detailsComponent?: Component;
10
13
  };
11
14
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
15
  declare const _default: typeof __VLS_export;
@@ -2,6 +2,7 @@ import type { ConversationItem } from '#blokkli/agent/app/types';
2
2
  type __VLS_Props = {
3
3
  item: ConversationItem;
4
4
  isActive?: boolean;
5
+ toolDetails: Map<string, unknown>;
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
8
  retry: () => any;
@@ -5,6 +5,8 @@
5
5
  v-else-if="item.type === 'tool'"
6
6
  v-bind="item"
7
7
  :is-active="isActive"
8
+ :details="toolItemDetails"
9
+ :details-component="toolItemDetailsComponent"
8
10
  />
9
11
  <ItemServerTool v-else-if="item.type === 'server_tool'" v-bind="item" />
10
12
  <ItemError
@@ -16,15 +18,29 @@
16
18
  </template>
17
19
 
18
20
  <script setup>
21
+ import { computed } from "#imports";
19
22
  import ItemUser from "./User/index.vue";
20
23
  import ItemAssistant from "./Assistant/index.vue";
21
24
  import ItemTool from "./Tool/index.vue";
22
25
  import ItemServerTool from "./ServerTool/index.vue";
23
26
  import ItemError from "./Error/index.vue";
24
27
  import ItemUnknown from "./Unknown/index.vue";
25
- defineProps({
28
+ import { mcpTools } from "#blokkli-build/agent-client";
29
+ const props = defineProps({
26
30
  item: { type: null, required: true },
27
- isActive: { type: Boolean, required: false }
31
+ isActive: { type: Boolean, required: false },
32
+ toolDetails: { type: Map, required: true }
28
33
  });
29
34
  const emit = defineEmits(["retry"]);
35
+ const toolItemDetails = computed(() => {
36
+ const item = props.item;
37
+ if (item.type !== "tool") return void 0;
38
+ return props.toolDetails.get(item.callId);
39
+ });
40
+ const toolItemDetailsComponent = computed(() => {
41
+ const item = props.item;
42
+ if (item.type !== "tool" || !toolItemDetails.value) return void 0;
43
+ const tool = mcpTools.find((t) => t.name === item.tool);
44
+ return tool?.detailsComponent;
45
+ });
30
46
  </script>
@@ -2,6 +2,7 @@ import type { ConversationItem } from '#blokkli/agent/app/types';
2
2
  type __VLS_Props = {
3
3
  item: ConversationItem;
4
4
  isActive?: boolean;
5
+ toolDetails: Map<string, unknown>;
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
8
  retry: () => any;
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  history: ConversationItem[];
4
4
  activeItem: ActiveItem | null;
5
5
  isThinking: boolean;
6
+ toolDetails: Map<string, unknown>;
6
7
  };
7
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
9
  retry: () => any;
@@ -4,12 +4,14 @@
4
4
  v-for="item in history"
5
5
  :key="item.id"
6
6
  :item="item"
7
+ :tool-details
7
8
  @retry="emit('retry')"
8
9
  />
9
10
  <ConversationItemComponent
10
11
  v-if="activeItem"
11
12
  :key="activeItem.id"
12
13
  :item="activeItem"
14
+ :tool-details
13
15
  is-active
14
16
  />
15
17
  <Thinking v-if="isThinking" />
@@ -20,10 +22,11 @@
20
22
  import ConversationItemComponent from "./Item/index.vue";
21
23
  import Thinking from "./Thinking/index.vue";
22
24
  import { useBlokkli } from "#imports";
23
- defineProps({
25
+ const _props = defineProps({
24
26
  history: { type: Array, required: true },
25
27
  activeItem: { type: null, required: true },
26
- isThinking: { type: Boolean, required: true }
28
+ isThinking: { type: Boolean, required: true },
29
+ toolDetails: { type: Map, required: true }
27
30
  });
28
31
  const emit = defineEmits(["retry"]);
29
32
  const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  history: ConversationItem[];
4
4
  activeItem: ActiveItem | null;
5
5
  isThinking: boolean;
6
+ toolDetails: Map<string, unknown>;
6
7
  };
7
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
9
  retry: () => any;
@@ -5,6 +5,7 @@
5
5
  :history="mockHistory"
6
6
  :active-item="mockActiveItem"
7
7
  :is-thinking="false"
8
+ :tool-details="/* @__PURE__ */ new Map()"
8
9
  />
9
10
 
10
11
  <h3>Pending Mutations</h3>
@@ -114,7 +115,7 @@ const mockHistory = [
114
115
  type: "tool",
115
116
  id: "call-4",
116
117
  callId: "call-4",
117
- tool: "batch_rewrite_text",
118
+ tool: "update_text_fields",
118
119
  label: "Rewrite text",
119
120
  status: "success",
120
121
  timestamp: Date.now() - 58e3
@@ -0,0 +1,17 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ drop: (attachments: Attachment[]) => any;
7
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
8
+ onDrop?: ((attachments: Attachment[]) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };