@meistrari/chat-nuxt 4.13.0-rc.10 → 4.13.0-rc.12

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "4.13.0-rc.10",
4
+ "version": "4.13.0-rc.12",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -6,8 +6,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
6
6
  } & {
7
7
  create: (canvasTools: CanvasTool[]) => any;
8
8
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
9
- onCreate?: ((canvasTools: CanvasTool[]) => any) | undefined;
10
9
  "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
10
+ onCreate?: ((canvasTools: CanvasTool[]) => any) | undefined;
11
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
@@ -6,8 +6,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
6
6
  } & {
7
7
  create: (canvasTools: CanvasTool[]) => any;
8
8
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
9
- onCreate?: ((canvasTools: CanvasTool[]) => any) | undefined;
10
9
  "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
10
+ onCreate?: ((canvasTools: CanvasTool[]) => any) | undefined;
11
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
@@ -15,23 +15,23 @@ type __VLS_Props = {
15
15
  };
16
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
17
  delete: () => any;
18
- openDrawer: () => any;
19
- copyLink: () => any;
20
- openOutdatedSettings: () => any;
21
18
  rename: () => any;
22
19
  duplicate: () => any;
23
20
  export: () => any;
21
+ copyLink: () => any;
24
22
  debug: () => any;
23
+ openDrawer: () => any;
24
+ openOutdatedSettings: () => any;
25
25
  tabChange: (tab: TopbarTab) => any;
26
26
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
27
  onDelete?: (() => any) | undefined;
28
- onOpenDrawer?: (() => any) | undefined;
29
- onCopyLink?: (() => any) | undefined;
30
- onOpenOutdatedSettings?: (() => any) | undefined;
31
28
  onRename?: (() => any) | undefined;
32
29
  onDuplicate?: (() => any) | undefined;
33
30
  onExport?: (() => any) | undefined;
31
+ onCopyLink?: (() => any) | undefined;
34
32
  onDebug?: (() => any) | undefined;
33
+ onOpenDrawer?: (() => any) | undefined;
34
+ onOpenOutdatedSettings?: (() => any) | undefined;
35
35
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
36
36
  }>, {
37
37
  showDrawerButton: boolean;
@@ -15,23 +15,23 @@ type __VLS_Props = {
15
15
  };
16
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
17
  delete: () => any;
18
- openDrawer: () => any;
19
- copyLink: () => any;
20
- openOutdatedSettings: () => any;
21
18
  rename: () => any;
22
19
  duplicate: () => any;
23
20
  export: () => any;
21
+ copyLink: () => any;
24
22
  debug: () => any;
23
+ openDrawer: () => any;
24
+ openOutdatedSettings: () => any;
25
25
  tabChange: (tab: TopbarTab) => any;
26
26
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
27
  onDelete?: (() => any) | undefined;
28
- onOpenDrawer?: (() => any) | undefined;
29
- onCopyLink?: (() => any) | undefined;
30
- onOpenOutdatedSettings?: (() => any) | undefined;
31
28
  onRename?: (() => any) | undefined;
32
29
  onDuplicate?: (() => any) | undefined;
33
30
  onExport?: (() => any) | undefined;
31
+ onCopyLink?: (() => any) | undefined;
34
32
  onDebug?: (() => any) | undefined;
33
+ onOpenDrawer?: (() => any) | undefined;
34
+ onOpenOutdatedSettings?: (() => any) | undefined;
35
35
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
36
36
  }>, {
37
37
  showDrawerButton: boolean;
@@ -66,46 +66,46 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
66
66
  } & {
67
67
  delete: () => any;
68
68
  cancel: () => any;
69
- settings: () => any;
70
- send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
71
- newConversation: (groupId?: string | null | undefined) => any;
72
- selectExecutionProfile: (profile: ChatExecutionProfile) => any;
73
- copyLink: () => any;
74
69
  rename: () => any;
75
70
  duplicate: () => any;
76
71
  export: () => any;
72
+ copyLink: () => any;
77
73
  debug: () => any;
74
+ selectConversation: (id: string) => any;
75
+ send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
76
+ settings: () => any;
77
+ newConversation: (groupId?: string | null | undefined) => any;
78
+ selectExecutionProfile: (profile: ChatExecutionProfile) => any;
78
79
  tabChange: (tab: TopbarTab) => any;
79
80
  switchWorkspace: () => any;
80
81
  signout: () => any;
81
82
  cancelEditing: () => any;
82
83
  dismissOutdatedBanner: () => any;
83
84
  saveTitle: () => any;
84
- selectConversation: (id: string) => any;
85
85
  "update:drawerOpen": (value: boolean) => any;
86
86
  "update:editTitle": (value: string) => any;
87
87
  "update:workspaceSheetOpen": (value: boolean) => any;
88
88
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
89
89
  onDelete?: (() => any) | undefined;
90
90
  onCancel?: (() => any) | undefined;
91
- onSettings?: (() => any) | undefined;
91
+ onRename?: (() => any) | undefined;
92
+ onDuplicate?: (() => any) | undefined;
93
+ onExport?: (() => any) | undefined;
94
+ onCopyLink?: (() => any) | undefined;
95
+ onDebug?: (() => any) | undefined;
96
+ onSelectConversation?: ((id: string) => any) | undefined;
92
97
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
98
+ onSettings?: (() => any) | undefined;
93
99
  onNewConversation?: ((groupId?: string | null | undefined) => any) | undefined;
94
100
  onSelectExecutionProfile?: ((profile: ChatExecutionProfile) => any) | undefined;
95
101
  "onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
96
102
  "onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
97
- onCopyLink?: (() => any) | undefined;
98
- onRename?: (() => any) | undefined;
99
- onDuplicate?: (() => any) | undefined;
100
- onExport?: (() => any) | undefined;
101
- onDebug?: (() => any) | undefined;
102
103
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
103
104
  onSwitchWorkspace?: (() => any) | undefined;
104
105
  onSignout?: (() => any) | undefined;
105
106
  onCancelEditing?: (() => any) | undefined;
106
107
  onDismissOutdatedBanner?: (() => any) | undefined;
107
108
  onSaveTitle?: (() => any) | undefined;
108
- onSelectConversation?: ((id: string) => any) | undefined;
109
109
  "onUpdate:drawerOpen"?: ((value: boolean) => any) | undefined;
110
110
  "onUpdate:editTitle"?: ((value: string) => any) | undefined;
111
111
  "onUpdate:workspaceSheetOpen"?: ((value: boolean) => any) | undefined;
@@ -66,46 +66,46 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
66
66
  } & {
67
67
  delete: () => any;
68
68
  cancel: () => any;
69
- settings: () => any;
70
- send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
71
- newConversation: (groupId?: string | null | undefined) => any;
72
- selectExecutionProfile: (profile: ChatExecutionProfile) => any;
73
- copyLink: () => any;
74
69
  rename: () => any;
75
70
  duplicate: () => any;
76
71
  export: () => any;
72
+ copyLink: () => any;
77
73
  debug: () => any;
74
+ selectConversation: (id: string) => any;
75
+ send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
76
+ settings: () => any;
77
+ newConversation: (groupId?: string | null | undefined) => any;
78
+ selectExecutionProfile: (profile: ChatExecutionProfile) => any;
78
79
  tabChange: (tab: TopbarTab) => any;
79
80
  switchWorkspace: () => any;
80
81
  signout: () => any;
81
82
  cancelEditing: () => any;
82
83
  dismissOutdatedBanner: () => any;
83
84
  saveTitle: () => any;
84
- selectConversation: (id: string) => any;
85
85
  "update:drawerOpen": (value: boolean) => any;
86
86
  "update:editTitle": (value: string) => any;
87
87
  "update:workspaceSheetOpen": (value: boolean) => any;
88
88
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
89
89
  onDelete?: (() => any) | undefined;
90
90
  onCancel?: (() => any) | undefined;
91
- onSettings?: (() => any) | undefined;
91
+ onRename?: (() => any) | undefined;
92
+ onDuplicate?: (() => any) | undefined;
93
+ onExport?: (() => any) | undefined;
94
+ onCopyLink?: (() => any) | undefined;
95
+ onDebug?: (() => any) | undefined;
96
+ onSelectConversation?: ((id: string) => any) | undefined;
92
97
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
98
+ onSettings?: (() => any) | undefined;
93
99
  onNewConversation?: ((groupId?: string | null | undefined) => any) | undefined;
94
100
  onSelectExecutionProfile?: ((profile: ChatExecutionProfile) => any) | undefined;
95
101
  "onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
96
102
  "onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
97
- onCopyLink?: (() => any) | undefined;
98
- onRename?: (() => any) | undefined;
99
- onDuplicate?: (() => any) | undefined;
100
- onExport?: (() => any) | undefined;
101
- onDebug?: (() => any) | undefined;
102
103
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
103
104
  onSwitchWorkspace?: (() => any) | undefined;
104
105
  onSignout?: (() => any) | undefined;
105
106
  onCancelEditing?: (() => any) | undefined;
106
107
  onDismissOutdatedBanner?: (() => any) | undefined;
107
108
  onSaveTitle?: (() => any) | undefined;
108
- onSelectConversation?: ((id: string) => any) | undefined;
109
109
  "onUpdate:drawerOpen"?: ((value: boolean) => any) | undefined;
110
110
  "onUpdate:editTitle"?: ((value: string) => any) | undefined;
111
111
  "onUpdate:workspaceSheetOpen"?: ((value: boolean) => any) | undefined;
@@ -1,8 +1,8 @@
1
1
  <script setup>
2
2
  import { useFilePreviewPanel } from "../composables/file-preview-panel";
3
3
  import { useVault } from "../composables/vault";
4
+ import { fileReferenceMimeType } from "../file-reference";
4
5
  import { getFileIcon } from "../icons";
5
- import { normalizeMimeType } from "../mime";
6
6
  import { isVaultPermalink } from "../vault-links";
7
7
  const props = defineProps({
8
8
  file: { type: Object, required: true },
@@ -11,7 +11,10 @@ const props = defineProps({
11
11
  const { openPreview, updatePreview, setError, currentFile } = useFilePreviewPanel();
12
12
  const { getFileInfo, isVaultReference } = useVault();
13
13
  const fileName = computed(() => props.file.hashParams?.filename ?? props.file.name);
14
- const iconSrc = computed(() => props.file.mimeType === "unknown" ? null : getFileIcon(normalizeMimeType(props.file.mimeType)));
14
+ const iconSrc = computed(() => {
15
+ const mimeType = fileReferenceMimeType(props.file);
16
+ return mimeType ? getFileIcon(mimeType) : null;
17
+ });
15
18
  const open = ref(false);
16
19
  async function resolveFile() {
17
20
  const reference = props.file.reference;
@@ -1,3 +1,4 @@
1
+ import type { DetectedFile } from './content-detection.js';
1
2
  /** A markdown link whose text the author wrote, as opposed to an autolink that shows its own address. */
2
3
  export declare function isLabelledFileLink(label: string, href: string): boolean;
3
4
  type TextTreeNode = {
@@ -11,4 +12,10 @@ type TextTreeNode = {
11
12
  * out on purpose, so the answer does not change while a file card swaps in or still loads.
12
13
  */
13
14
  export declare function hasTextOutside(block: TextTreeNode, inner: TextTreeNode): boolean;
15
+ /**
16
+ * The type a file reference can show before anything is fetched. A permalink is detected with
17
+ * an unknown type, since its address says nothing about the file; the name the link was
18
+ * written with usually does.
19
+ */
20
+ export declare function fileReferenceMimeType(file: Pick<DetectedFile, 'mimeType' | 'name' | 'hashParams'>): string | null;
14
21
  export {};
@@ -1,3 +1,4 @@
1
+ import { getMimeTypeFromExtension, normalizeMimeType } from "./mime.js";
1
2
  export function isLabelledFileLink(label, href) {
2
3
  const text = label.trim();
3
4
  return text !== "" && text !== href.trim();
@@ -12,3 +13,10 @@ export function hasTextOutside(block, inner) {
12
13
  }
13
14
  return false;
14
15
  }
16
+ export function fileReferenceMimeType(file) {
17
+ if (file.mimeType !== "unknown")
18
+ return normalizeMimeType(file.mimeType);
19
+ const extension = /\.([a-z0-9]+)$/i.exec(file.hashParams?.filename ?? file.name)?.[1]?.toLowerCase();
20
+ const mimeType = extension ? getMimeTypeFromExtension(extension) : "unknown";
21
+ return mimeType === "unknown" ? null : mimeType;
22
+ }
@@ -2,7 +2,8 @@
2
2
  import { provideEmbedConfig } from "../../embed/composables/embed-config";
3
3
  import ChatVaultLink from "../../files/components/chat-vault-link.vue";
4
4
  import OpenuiBlock from "../../rendering/components/openui-block.vue";
5
- import { buildSlackPreview, groupWidgetStories } from "../../rendering/debug/widget-gallery";
5
+ import { UI_LANG_FENCE } from "@meistrari/chat-ui-lang";
6
+ import { buildSlackPreview, groupWidgetStories, widgetAnswer } from "../../rendering/debug/widget-gallery";
6
7
  import { OPENUI_ERROR_REPORTER_KEY, OPENUI_MARKDOWN_COMPONENTS_KEY } from "../../rendering/openui/context";
7
8
  import { CHAT_MESSAGE_CONTEXT_KEY, CHAT_MESSAGE_SEND_KEY } from "../../types/messages";
8
9
  import { createChatDebugCitationsConfig } from "../debug/chat-debug-citations";
@@ -24,6 +25,8 @@ const viewportOptions = [
24
25
  const streamedCharacters = ref(null);
25
26
  const streaming = computed(() => streamedCharacters.value !== null);
26
27
  const visibleCode = computed(() => streamedCharacters.value === null ? code.value : code.value.slice(0, streamedCharacters.value));
28
+ const answer = computed(() => widgetAnswer(visibleCode.value, streaming.value));
29
+ const markdownComponents = { link: ChatVaultLink, [UI_LANG_FENCE]: OpenuiBlock };
27
30
  let streamTimer = null;
28
31
  const mountRevision = ref(0);
29
32
  const sentMessages = ref([]);
@@ -48,7 +51,7 @@ provide(CHAT_MESSAGE_SEND_KEY, async (content) => {
48
51
  provide(OPENUI_ERROR_REPORTER_KEY, (errors) => {
49
52
  widgetErrors.value = errors.map((error) => `${error.code}: ${error.message}`);
50
53
  });
51
- provide(OPENUI_MARKDOWN_COMPONENTS_KEY, ref({ link: ChatVaultLink }));
54
+ provide(OPENUI_MARKDOWN_COMPONENTS_KEY, ref(markdownComponents));
52
55
  function stopStream() {
53
56
  if (streamTimer)
54
57
  clearInterval(streamTimer);
@@ -156,7 +159,14 @@ onBeforeUnmount(stopStream);
156
159
 
157
160
  <div min-h-0 grow overflow-y-auto px-24px pb-24px>
158
161
  <div class="widget-under-test" :class="`widget-under-test--${viewportWidth}`" data-gallery="web">
159
- <OpenuiBlock :key="mountRevision" :node="{ type: 'code_block', raw: visibleCode, code: visibleCode }" :loading="streaming" />
162
+ <AppMarkdownRender
163
+ :key="mountRevision"
164
+ :content="answer"
165
+ :custom-components="markdownComponents"
166
+ :final="!streaming"
167
+ :typewriter="false"
168
+ mode="chat"
169
+ />
160
170
  </div>
161
171
 
162
172
  <div class="widget-under-test" :class="`widget-under-test--${viewportWidth}`" mt-24px>
@@ -11,6 +11,8 @@ export type WidgetGalleryGroup = {
11
11
  stories: WidgetGalleryStory[];
12
12
  };
13
13
  export declare function groupWidgetStories(stories: readonly WidgetGalleryStory[]): WidgetGalleryGroup[];
14
+ /** The program as the answer of a message carries it: inside its fence, which stays open while the block streams. */
15
+ export declare function widgetAnswer(code: string, streaming: boolean): string;
14
16
  export type SlackPreview = {
15
17
  blocks: SlackBlock[];
16
18
  /** The answer written out, which Slack uses for notifications. */
@@ -5,6 +5,10 @@ export function groupWidgetStories(stories) {
5
5
  groups.set(story.group, [...groups.get(story.group) ?? [], story]);
6
6
  return [...groups].map(([name, grouped]) => ({ name, stories: grouped }));
7
7
  }
8
+ export function widgetAnswer(code, streaming) {
9
+ return `\`\`\`${UI_LANG_FENCE}
10
+ ${code}${streaming ? "" : "\n```"}`;
11
+ }
8
12
  const BLOCK_KIT_BUILDER_URL = "https://app.slack.com/block-kit-builder/";
9
13
  const PREVIEW_THREAD_TS = "1700000000.000100";
10
14
  const PREVIEW_MAX_BLOCKS = 40;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.13.0-rc.10",
3
+ "version": "4.13.0-rc.12",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -52,7 +52,7 @@
52
52
  "@iconify-json/ph": "^1.2.2",
53
53
  "@iconify/vue": "^5.0.0",
54
54
  "@meistrari/auth-nuxt": "3.31.0",
55
- "@meistrari/chat-ui-lang": "0.8.1-rc.0",
55
+ "@meistrari/chat-ui-lang": "0.8.1-rc.1",
56
56
  "@meistrari/logger": "^2.1.3",
57
57
  "@meistrari/tela-build": "^1.79.0",
58
58
  "@openuidev/lang-core": "1.0.0",