@meistrari/chat-nuxt 4.2.0-rc.2 → 4.2.0-rc.3
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/README.md +2 -0
- package/dist/module.json +1 -1
- package/dist/runtime/citations/components/chat-citation.vue +63 -47
- package/dist/runtime/citations/label.d.ts +7 -0
- package/dist/runtime/citations/label.js +13 -0
- package/dist/runtime/conversations/components/chat-new-conversation-modal.d.vue.ts +1 -1
- package/dist/runtime/conversations/components/chat-new-conversation-modal.vue.d.ts +1 -1
- package/dist/runtime/conversations/composables/conversation-item.js +9 -1
- package/dist/runtime/embed/components/chat-configuration-modal.d.vue.ts +2 -2
- package/dist/runtime/embed/components/chat-configuration-modal.vue.d.ts +2 -2
- package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +1 -1
- package/dist/runtime/embed/components/chat-embed-inner.vue +1 -2
- package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +1 -1
- package/dist/runtime/embed/components/chat-embed.vue +4 -0
- package/dist/runtime/embed/components/chat-topbar.d.vue.ts +2 -2
- package/dist/runtime/embed/components/chat-topbar.vue.d.ts +2 -2
- package/dist/runtime/embed/components/meistrari-chat-embed.vue +4 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-header.d.vue.ts +6 -6
- package/dist/runtime/embed/components/mobile/chat-mobile-header.vue.d.ts +6 -6
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +9 -9
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +9 -9
- package/dist/runtime/embed/composables/embed-config.d.ts +5 -0
- package/dist/runtime/embed/composables/embed-config.js +8 -0
- package/dist/runtime/embed/types.d.ts +11 -0
- package/dist/runtime/messages/composables/chat.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,8 @@ Declared in `src/runtime/embed/types.ts`; prop, feature-flag, and event payload
|
|
|
73
73
|
| `conversationScope` | `string \| null` | `null` | Isolate conversation history by technical scope within the current workspace and runtime. Scoped embeds only see same-scope conversations; values are trimmed, blank becomes `null`, and the server accepts 1-200 chars from `A-Z`, `a-z`, `0-9`, `.`, `_`, `:`, `/`, `-` |
|
|
74
74
|
| `defaultConversationCreatorFilter` | `'all' \| 'mine'` | `'all'` | Initial sidebar creator filter: every conversation in scope, or only the current user's |
|
|
75
75
|
| `availableModels` | `AvailableChatModels` | Full catalog | Non-empty ordered list of models this embed may display and execute. A missing or invalid restored selection falls back to the first entry; an empty list fails fast |
|
|
76
|
+
| `defaultModel` | `ChatModel` | Package default | Initial model for untouched drafts. Explicit selections and existing conversations take precedence; `availableModels` still limits the selection |
|
|
77
|
+
| `defaultReasoningEffort` | `ChatReasoningEffort` | Automatic (`null`) | Initial reasoning effort for untouched drafts. Explicit user choices (including automatic) take precedence |
|
|
76
78
|
| `conversationCreatorFilter` | `'all' \| 'mine'` | — | Controlled sidebar creator filter; use with `v-model:conversation-creator-filter` when the host changes it at runtime |
|
|
77
79
|
| `hideConversationCreatorFilter` | `boolean` | `false` | Hide the creator selector without changing the active filter |
|
|
78
80
|
| `telaAgentId` | `string` | — | Use Tela agent mode for this embed |
|
package/dist/module.json
CHANGED
|
@@ -3,6 +3,7 @@ import { onClickOutside, useElementBounding, useWindowSize } from "@vueuse/core"
|
|
|
3
3
|
import { useEmbedConfig } from "../../embed/composables/embed-config";
|
|
4
4
|
import { useCitationPanel } from "../composables/citation-panel";
|
|
5
5
|
import { useCitations } from "../composables/citations";
|
|
6
|
+
import { stripMarkdownMarkers } from "../label";
|
|
6
7
|
const props = defineProps({
|
|
7
8
|
citation: { type: Object, required: true },
|
|
8
9
|
label: { type: String, required: false }
|
|
@@ -18,7 +19,10 @@ watchEffect(() => {
|
|
|
18
19
|
});
|
|
19
20
|
const status = computed(() => entry.value?.status.value ?? "loading");
|
|
20
21
|
const meta = computed(() => entry.value?.meta.value ?? null);
|
|
21
|
-
const displayLabel = computed(() =>
|
|
22
|
+
const displayLabel = computed(() => {
|
|
23
|
+
const label = props.label ? stripMarkdownMarkers(props.label) : "";
|
|
24
|
+
return label || meta.value?.identifier?.trim() || meta.value?.title?.trim() || "Documento";
|
|
25
|
+
});
|
|
22
26
|
const rootEl = ref(null);
|
|
23
27
|
const popoverEl = ref(null);
|
|
24
28
|
const popoverOpen = ref(false);
|
|
@@ -30,52 +34,64 @@ onClickOutside(rootEl, () => {
|
|
|
30
34
|
const POPOVER_WIDTH = 300;
|
|
31
35
|
const POPOVER_GAP = 6;
|
|
32
36
|
const VIEWPORT_PADDING = 8;
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
37
|
+
const popoverStyle = shallowRef({});
|
|
38
|
+
watch(popoverOpen, (open, _, onCleanup) => {
|
|
39
|
+
if (!open)
|
|
40
|
+
return;
|
|
41
|
+
const scope = effectScope();
|
|
42
|
+
scope.run(() => {
|
|
43
|
+
const triggerBounds = useElementBounding(rootEl);
|
|
44
|
+
const popoverBounds = useElementBounding(popoverEl);
|
|
45
|
+
const viewport = useWindowSize();
|
|
46
|
+
const style = computed(() => {
|
|
47
|
+
const maxHeight = Math.max(
|
|
48
|
+
0,
|
|
49
|
+
viewport.height.value - VIEWPORT_PADDING * 2
|
|
50
|
+
);
|
|
51
|
+
const maxLeft = Math.max(
|
|
52
|
+
VIEWPORT_PADDING,
|
|
53
|
+
viewport.width.value - POPOVER_WIDTH - VIEWPORT_PADDING
|
|
54
|
+
);
|
|
55
|
+
const left = Math.min(
|
|
56
|
+
Math.max(triggerBounds.left.value, VIEWPORT_PADDING),
|
|
57
|
+
maxLeft
|
|
58
|
+
);
|
|
59
|
+
const fitsAbove = triggerBounds.top.value >= popoverBounds.height.value + POPOVER_GAP + VIEWPORT_PADDING;
|
|
60
|
+
const fitsBelow = viewport.height.value - triggerBounds.bottom.value >= popoverBounds.height.value + POPOVER_GAP + VIEWPORT_PADDING;
|
|
61
|
+
const constrainedStyle = {
|
|
62
|
+
left: `${left}px`,
|
|
63
|
+
maxHeight: `${maxHeight}px`,
|
|
64
|
+
overflowY: "auto"
|
|
65
|
+
};
|
|
66
|
+
if (popoverBounds.height.value === 0) {
|
|
67
|
+
return {
|
|
68
|
+
...constrainedStyle,
|
|
69
|
+
top: `${VIEWPORT_PADDING}px`,
|
|
70
|
+
visibility: "hidden"
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (fitsAbove) {
|
|
74
|
+
return {
|
|
75
|
+
...constrainedStyle,
|
|
76
|
+
bottom: `${viewport.height.value - triggerBounds.top.value + POPOVER_GAP}px`
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if (fitsBelow) {
|
|
80
|
+
return {
|
|
81
|
+
...constrainedStyle,
|
|
82
|
+
top: `${triggerBounds.bottom.value + POPOVER_GAP}px`
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
...constrainedStyle,
|
|
87
|
+
top: `${VIEWPORT_PADDING}px`
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
watchEffect(() => {
|
|
91
|
+
popoverStyle.value = style.value;
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
onCleanup(() => scope.stop());
|
|
79
95
|
});
|
|
80
96
|
function togglePopover() {
|
|
81
97
|
if (status.value === "loading")
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A citation label is the visible text of `[label](cite://...)`, written by the
|
|
3
|
+
* model, which sometimes wraps it in inline markdown. The chip renders plain
|
|
4
|
+
* text, so the markers that wrap the whole label are removed; anything inside
|
|
5
|
+
* is kept, including markers that only appear in the middle.
|
|
6
|
+
*/
|
|
7
|
+
export declare function stripMarkdownMarkers(label: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const WRAPPING_MARKER = /^(\*\*|__|\*|_|`+)([\s\S]+)\1$/;
|
|
2
|
+
export function stripMarkdownMarkers(label) {
|
|
3
|
+
let stripped = label.trim();
|
|
4
|
+
let match = stripped.match(WRAPPING_MARKER);
|
|
5
|
+
while (match && !separatesText(match[2], match[1])) {
|
|
6
|
+
stripped = match[2].trim();
|
|
7
|
+
match = stripped.match(WRAPPING_MARKER);
|
|
8
|
+
}
|
|
9
|
+
return stripped;
|
|
10
|
+
}
|
|
11
|
+
function separatesText(inner, marker) {
|
|
12
|
+
return inner.includes(marker) && !(inner.startsWith(marker) && inner.endsWith(marker));
|
|
13
|
+
}
|
|
@@ -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
|
-
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
10
9
|
onCreate?: ((canvasTools: CanvasTool[]) => any) | undefined;
|
|
10
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => 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
|
-
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
10
9
|
onCreate?: ((canvasTools: CanvasTool[]) => any) | undefined;
|
|
10
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
11
11
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
declare const _default: typeof __VLS_export;
|
|
13
13
|
export default _default;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { resolveConversationRenameTitle } from "../title.js";
|
|
2
2
|
import { capitalizeFirst } from "../../shared/string.js";
|
|
3
3
|
export function useConversationItem(options, emit) {
|
|
4
|
+
const route = useRoute();
|
|
5
|
+
const router = useRouter();
|
|
4
6
|
const isRenamingInline = ref(false);
|
|
5
7
|
const renameTitle = ref("");
|
|
6
8
|
const renameInputRef = ref(null);
|
|
7
9
|
const isIgnoringInitialRenameBlur = ref(false);
|
|
8
10
|
const showDeleteModal = ref(false);
|
|
9
|
-
const conversationPath = computed(() =>
|
|
11
|
+
const conversationPath = computed(() => {
|
|
12
|
+
if (!options.selectConversation)
|
|
13
|
+
return `/${options.conversation.id}`;
|
|
14
|
+
const query = { ...route.query, conversationId: options.conversation.id };
|
|
15
|
+
delete query.conversation;
|
|
16
|
+
return router.resolve({ path: route.path, query, hash: route.hash }).href;
|
|
17
|
+
});
|
|
10
18
|
const displayTitle = computed(() => capitalizeFirst(options.conversation.title));
|
|
11
19
|
let renameBlurTimer = null;
|
|
12
20
|
const escapeCancellable = computed(() => isRenamingInline.value || showDeleteModal.value);
|
|
@@ -9,11 +9,11 @@ type __VLS_Props = {
|
|
|
9
9
|
showCredentialsTab?: boolean;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
-
"update:open": (value: boolean) => any;
|
|
13
12
|
save: (payload: ChatConfigurationSavePayload) => any;
|
|
13
|
+
"update:open": (value: boolean) => any;
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
16
15
|
onSave?: ((payload: ChatConfigurationSavePayload) => any) | undefined;
|
|
16
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
18
|
initialTab: ChatConfigurationTab;
|
|
19
19
|
saving: boolean;
|
|
@@ -9,11 +9,11 @@ type __VLS_Props = {
|
|
|
9
9
|
showCredentialsTab?: boolean;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
-
"update:open": (value: boolean) => any;
|
|
13
12
|
save: (payload: ChatConfigurationSavePayload) => any;
|
|
13
|
+
"update:open": (value: boolean) => any;
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
16
15
|
onSave?: ((payload: ChatConfigurationSavePayload) => any) | undefined;
|
|
16
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
18
|
initialTab: ChatConfigurationTab;
|
|
19
19
|
saving: boolean;
|
|
@@ -32,10 +32,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
32
32
|
"onUpdate:conversationTitle"?: ((value: string | null) => any) | undefined;
|
|
33
33
|
"onUpdate:conversationCreatorFilter"?: ((value: ConversationCreatorFilter) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
|
+
compact: boolean;
|
|
35
36
|
hideSettings: boolean;
|
|
36
37
|
hideSidebar: boolean;
|
|
37
38
|
initialConversationId: string | null;
|
|
38
|
-
compact: boolean;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
@@ -217,8 +217,7 @@ watch(chatError, (message) => {
|
|
|
217
217
|
if (message)
|
|
218
218
|
statusToast.update({ text: message, icon: "i-ph-warning" });
|
|
219
219
|
});
|
|
220
|
-
const
|
|
221
|
-
const { total, files: conversationFiles } = useConversationFiles(conversationIdRef);
|
|
220
|
+
const { total, files: conversationFiles } = useConversationFiles(activeConversationId);
|
|
222
221
|
function persistConversationModel(conversation, value, wakeAgent) {
|
|
223
222
|
const previousModel = conversation.model;
|
|
224
223
|
setConversationModel(value);
|
|
@@ -32,10 +32,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
32
32
|
"onUpdate:conversationTitle"?: ((value: string | null) => any) | undefined;
|
|
33
33
|
"onUpdate:conversationCreatorFilter"?: ((value: ConversationCreatorFilter) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
|
+
compact: boolean;
|
|
35
36
|
hideSettings: boolean;
|
|
36
37
|
hideSidebar: boolean;
|
|
37
38
|
initialConversationId: string | null;
|
|
38
|
-
compact: boolean;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
@@ -17,6 +17,8 @@ const props = defineProps({
|
|
|
17
17
|
conversationScope: { type: [String, null], required: false },
|
|
18
18
|
defaultConversationCreatorFilter: { type: null, required: false },
|
|
19
19
|
availableModels: { type: Array, required: false },
|
|
20
|
+
defaultModel: { type: null, required: false },
|
|
21
|
+
defaultReasoningEffort: { type: null, required: false },
|
|
20
22
|
conversationCreatorFilter: { type: null, required: false },
|
|
21
23
|
hideConversationCreatorFilter: { type: Boolean, required: false },
|
|
22
24
|
hideSidebar: { type: Boolean, required: false },
|
|
@@ -60,6 +62,8 @@ provideEmbedConfig({
|
|
|
60
62
|
conversationScope: normalizedConversationScope,
|
|
61
63
|
defaultConversationCreatorFilter: computed(() => props.defaultConversationCreatorFilter),
|
|
62
64
|
availableModels: computed(() => props.availableModels),
|
|
65
|
+
defaultModel: computed(() => props.defaultModel),
|
|
66
|
+
defaultReasoningEffort: computed(() => props.defaultReasoningEffort),
|
|
63
67
|
conversationCreatorFilter: computed(() => props.conversationCreatorFilter),
|
|
64
68
|
telaAgentInputs: computed(() => props.telaAgentInputs),
|
|
65
69
|
workspaceSettings: computed(() => props.workspaceSettings),
|
|
@@ -16,10 +16,10 @@ type __VLS_Props = {
|
|
|
16
16
|
};
|
|
17
17
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
18
18
|
delete: () => any;
|
|
19
|
+
copyLink: () => any;
|
|
19
20
|
rename: () => any;
|
|
20
21
|
duplicate: () => any;
|
|
21
22
|
export: () => any;
|
|
22
|
-
copyLink: () => any;
|
|
23
23
|
debug: () => any;
|
|
24
24
|
tabChange: (tab: TopbarTab) => any;
|
|
25
25
|
cancelEditing: () => any;
|
|
@@ -28,10 +28,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
28
28
|
"update:isEditing": (value: boolean) => any;
|
|
29
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
30
|
onDelete?: (() => any) | undefined;
|
|
31
|
+
onCopyLink?: (() => any) | undefined;
|
|
31
32
|
onRename?: (() => any) | undefined;
|
|
32
33
|
onDuplicate?: (() => any) | undefined;
|
|
33
34
|
onExport?: (() => any) | undefined;
|
|
34
|
-
onCopyLink?: (() => any) | undefined;
|
|
35
35
|
onDebug?: (() => any) | undefined;
|
|
36
36
|
onTabChange?: ((tab: TopbarTab) => any) | undefined;
|
|
37
37
|
onCancelEditing?: (() => any) | undefined;
|
|
@@ -16,10 +16,10 @@ type __VLS_Props = {
|
|
|
16
16
|
};
|
|
17
17
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
18
18
|
delete: () => any;
|
|
19
|
+
copyLink: () => any;
|
|
19
20
|
rename: () => any;
|
|
20
21
|
duplicate: () => any;
|
|
21
22
|
export: () => any;
|
|
22
|
-
copyLink: () => any;
|
|
23
23
|
debug: () => any;
|
|
24
24
|
tabChange: (tab: TopbarTab) => any;
|
|
25
25
|
cancelEditing: () => any;
|
|
@@ -28,10 +28,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
28
28
|
"update:isEditing": (value: boolean) => any;
|
|
29
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
30
|
onDelete?: (() => any) | undefined;
|
|
31
|
+
onCopyLink?: (() => any) | undefined;
|
|
31
32
|
onRename?: (() => any) | undefined;
|
|
32
33
|
onDuplicate?: (() => any) | undefined;
|
|
33
34
|
onExport?: (() => any) | undefined;
|
|
34
|
-
onCopyLink?: (() => any) | undefined;
|
|
35
35
|
onDebug?: (() => any) | undefined;
|
|
36
36
|
onTabChange?: ((tab: TopbarTab) => any) | undefined;
|
|
37
37
|
onCancelEditing?: (() => any) | undefined;
|
|
@@ -10,6 +10,8 @@ const { hideSidebar = void 0, ...props } = defineProps({
|
|
|
10
10
|
conversationScope: { type: [String, null], required: false },
|
|
11
11
|
defaultConversationCreatorFilter: { type: null, required: false },
|
|
12
12
|
availableModels: { type: Array, required: false },
|
|
13
|
+
defaultModel: { type: null, required: false },
|
|
14
|
+
defaultReasoningEffort: { type: null, required: false },
|
|
13
15
|
conversationCreatorFilter: { type: null, required: false },
|
|
14
16
|
hideConversationCreatorFilter: { type: Boolean, required: false },
|
|
15
17
|
hideSidebar: { type: Boolean, required: false },
|
|
@@ -71,6 +73,8 @@ const sharedEmbedProps = computed(() => ({
|
|
|
71
73
|
conversationScope: props.conversationScope,
|
|
72
74
|
defaultConversationCreatorFilter: props.defaultConversationCreatorFilter,
|
|
73
75
|
availableModels: props.availableModels,
|
|
76
|
+
defaultModel: props.defaultModel,
|
|
77
|
+
defaultReasoningEffort: props.defaultReasoningEffort,
|
|
74
78
|
conversationCreatorFilter: props.conversationCreatorFilter,
|
|
75
79
|
hideConversationCreatorFilter: props.hideConversationCreatorFilter,
|
|
76
80
|
hideSettings: hideSettings.value,
|
|
@@ -15,22 +15,22 @@ 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;
|
|
18
21
|
rename: () => any;
|
|
19
22
|
duplicate: () => any;
|
|
20
23
|
export: () => any;
|
|
21
|
-
copyLink: () => any;
|
|
22
|
-
openDrawer: () => any;
|
|
23
|
-
openOutdatedSettings: () => any;
|
|
24
24
|
debug: () => 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;
|
|
28
31
|
onRename?: (() => any) | undefined;
|
|
29
32
|
onDuplicate?: (() => any) | undefined;
|
|
30
33
|
onExport?: (() => any) | undefined;
|
|
31
|
-
onCopyLink?: (() => any) | undefined;
|
|
32
|
-
onOpenDrawer?: (() => any) | undefined;
|
|
33
|
-
onOpenOutdatedSettings?: (() => any) | undefined;
|
|
34
34
|
onDebug?: (() => any) | undefined;
|
|
35
35
|
onTabChange?: ((tab: TopbarTab) => any) | undefined;
|
|
36
36
|
}>, {
|
|
@@ -15,22 +15,22 @@ 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;
|
|
18
21
|
rename: () => any;
|
|
19
22
|
duplicate: () => any;
|
|
20
23
|
export: () => any;
|
|
21
|
-
copyLink: () => any;
|
|
22
|
-
openDrawer: () => any;
|
|
23
|
-
openOutdatedSettings: () => any;
|
|
24
24
|
debug: () => 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;
|
|
28
31
|
onRename?: (() => any) | undefined;
|
|
29
32
|
onDuplicate?: (() => any) | undefined;
|
|
30
33
|
onExport?: (() => any) | undefined;
|
|
31
|
-
onCopyLink?: (() => any) | undefined;
|
|
32
|
-
onOpenDrawer?: (() => any) | undefined;
|
|
33
|
-
onOpenOutdatedSettings?: (() => any) | undefined;
|
|
34
34
|
onDebug?: (() => any) | undefined;
|
|
35
35
|
onTabChange?: ((tab: TopbarTab) => any) | undefined;
|
|
36
36
|
}>, {
|
|
@@ -61,13 +61,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
61
61
|
} & {
|
|
62
62
|
delete: () => any;
|
|
63
63
|
cancel: () => any;
|
|
64
|
+
settings: () => any;
|
|
65
|
+
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
66
|
+
copyLink: () => any;
|
|
64
67
|
rename: () => any;
|
|
65
68
|
duplicate: () => any;
|
|
66
69
|
export: () => any;
|
|
67
|
-
copyLink: () => any;
|
|
68
|
-
selectConversation: (id: string) => any;
|
|
69
|
-
settings: () => any;
|
|
70
|
-
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
71
70
|
debug: () => any;
|
|
72
71
|
tabChange: (tab: TopbarTab) => any;
|
|
73
72
|
newConversation: (groupId?: string | null | undefined) => any;
|
|
@@ -76,21 +75,21 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
76
75
|
cancelEditing: () => any;
|
|
77
76
|
dismissOutdatedBanner: () => any;
|
|
78
77
|
saveTitle: () => any;
|
|
78
|
+
selectConversation: (id: string) => any;
|
|
79
79
|
"update:drawerOpen": (value: boolean) => any;
|
|
80
80
|
"update:editTitle": (value: string) => any;
|
|
81
81
|
"update:workspaceSheetOpen": (value: boolean) => any;
|
|
82
82
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
83
83
|
onDelete?: (() => any) | undefined;
|
|
84
84
|
onCancel?: (() => any) | undefined;
|
|
85
|
-
onRename?: (() => any) | undefined;
|
|
86
|
-
onDuplicate?: (() => any) | undefined;
|
|
87
|
-
onExport?: (() => any) | undefined;
|
|
88
|
-
onCopyLink?: (() => any) | undefined;
|
|
89
|
-
onSelectConversation?: ((id: string) => any) | undefined;
|
|
90
85
|
onSettings?: (() => any) | undefined;
|
|
91
86
|
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
92
87
|
"onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
|
|
93
88
|
"onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
|
|
89
|
+
onCopyLink?: (() => any) | undefined;
|
|
90
|
+
onRename?: (() => any) | undefined;
|
|
91
|
+
onDuplicate?: (() => any) | undefined;
|
|
92
|
+
onExport?: (() => any) | undefined;
|
|
94
93
|
onDebug?: (() => any) | undefined;
|
|
95
94
|
onTabChange?: ((tab: TopbarTab) => any) | undefined;
|
|
96
95
|
onNewConversation?: ((groupId?: string | null | undefined) => any) | undefined;
|
|
@@ -99,6 +98,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
99
98
|
onCancelEditing?: (() => any) | undefined;
|
|
100
99
|
onDismissOutdatedBanner?: (() => any) | undefined;
|
|
101
100
|
onSaveTitle?: (() => any) | undefined;
|
|
101
|
+
onSelectConversation?: ((id: string) => any) | undefined;
|
|
102
102
|
"onUpdate:drawerOpen"?: ((value: boolean) => any) | undefined;
|
|
103
103
|
"onUpdate:editTitle"?: ((value: string) => any) | undefined;
|
|
104
104
|
"onUpdate:workspaceSheetOpen"?: ((value: boolean) => any) | undefined;
|
|
@@ -61,13 +61,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
61
61
|
} & {
|
|
62
62
|
delete: () => any;
|
|
63
63
|
cancel: () => any;
|
|
64
|
+
settings: () => any;
|
|
65
|
+
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
66
|
+
copyLink: () => any;
|
|
64
67
|
rename: () => any;
|
|
65
68
|
duplicate: () => any;
|
|
66
69
|
export: () => any;
|
|
67
|
-
copyLink: () => any;
|
|
68
|
-
selectConversation: (id: string) => any;
|
|
69
|
-
settings: () => any;
|
|
70
|
-
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
71
70
|
debug: () => any;
|
|
72
71
|
tabChange: (tab: TopbarTab) => any;
|
|
73
72
|
newConversation: (groupId?: string | null | undefined) => any;
|
|
@@ -76,21 +75,21 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
76
75
|
cancelEditing: () => any;
|
|
77
76
|
dismissOutdatedBanner: () => any;
|
|
78
77
|
saveTitle: () => any;
|
|
78
|
+
selectConversation: (id: string) => any;
|
|
79
79
|
"update:drawerOpen": (value: boolean) => any;
|
|
80
80
|
"update:editTitle": (value: string) => any;
|
|
81
81
|
"update:workspaceSheetOpen": (value: boolean) => any;
|
|
82
82
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
83
83
|
onDelete?: (() => any) | undefined;
|
|
84
84
|
onCancel?: (() => any) | undefined;
|
|
85
|
-
onRename?: (() => any) | undefined;
|
|
86
|
-
onDuplicate?: (() => any) | undefined;
|
|
87
|
-
onExport?: (() => any) | undefined;
|
|
88
|
-
onCopyLink?: (() => any) | undefined;
|
|
89
|
-
onSelectConversation?: ((id: string) => any) | undefined;
|
|
90
85
|
onSettings?: (() => any) | undefined;
|
|
91
86
|
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
92
87
|
"onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
|
|
93
88
|
"onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
|
|
89
|
+
onCopyLink?: (() => any) | undefined;
|
|
90
|
+
onRename?: (() => any) | undefined;
|
|
91
|
+
onDuplicate?: (() => any) | undefined;
|
|
92
|
+
onExport?: (() => any) | undefined;
|
|
94
93
|
onDebug?: (() => any) | undefined;
|
|
95
94
|
onTabChange?: ((tab: TopbarTab) => any) | undefined;
|
|
96
95
|
onNewConversation?: ((groupId?: string | null | undefined) => any) | undefined;
|
|
@@ -99,6 +98,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
99
98
|
onCancelEditing?: (() => any) | undefined;
|
|
100
99
|
onDismissOutdatedBanner?: (() => any) | undefined;
|
|
101
100
|
onSaveTitle?: (() => any) | undefined;
|
|
101
|
+
onSelectConversation?: ((id: string) => any) | undefined;
|
|
102
102
|
"onUpdate:drawerOpen"?: ((value: boolean) => any) | undefined;
|
|
103
103
|
"onUpdate:editTitle"?: ((value: string) => any) | undefined;
|
|
104
104
|
"onUpdate:workspaceSheetOpen"?: ((value: boolean) => any) | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChatModel, ChatReasoningEffort } from '../../types/schemas/chat/models.js';
|
|
1
2
|
import type { Component, DeepReadonly, MaybeRefOrGetter, Ref } from 'vue';
|
|
2
3
|
import type { ConversationCreatorFilter } from '../../types/schemas/chat/primitives.js';
|
|
3
4
|
import type { WorkspaceSettingsResponse as WorkspaceSettings } from '../../types/schemas/chat/workspace-settings.js';
|
|
@@ -15,6 +16,8 @@ export type EmbedConfig = {
|
|
|
15
16
|
conversationScope: Ref<string | null>;
|
|
16
17
|
defaultConversationCreatorFilter: Ref<ConversationCreatorFilter>;
|
|
17
18
|
availableModels: Ref<AvailableChatModels | undefined>;
|
|
19
|
+
defaultModel: Ref<ChatModel | undefined>;
|
|
20
|
+
defaultReasoningEffort: Ref<ChatReasoningEffort | undefined>;
|
|
18
21
|
conversationCreatorFilter: Ref<ConversationCreatorFilter | undefined>;
|
|
19
22
|
telaAgentInputs: Ref<ConfiguredTelaAgentInputs>;
|
|
20
23
|
workspaceSettings: Ref<DeepReadonly<WorkspaceSettings> | WorkspaceSettings | null | undefined>;
|
|
@@ -36,6 +39,8 @@ type EmbedConfigInput = {
|
|
|
36
39
|
conversationScope?: MaybeRefOrGetter<string | null | undefined>;
|
|
37
40
|
defaultConversationCreatorFilter?: MaybeRefOrGetter<ConversationCreatorFilter | null | undefined>;
|
|
38
41
|
availableModels?: MaybeRefOrGetter<AvailableChatModels | undefined>;
|
|
42
|
+
defaultModel?: MaybeRefOrGetter<ChatModel | undefined>;
|
|
43
|
+
defaultReasoningEffort?: MaybeRefOrGetter<ChatReasoningEffort | undefined>;
|
|
39
44
|
conversationCreatorFilter?: MaybeRefOrGetter<ConversationCreatorFilter | undefined>;
|
|
40
45
|
telaAgentInputs?: MaybeRefOrGetter<ConfiguredTelaAgentInputs>;
|
|
41
46
|
workspaceSettings?: MaybeRefOrGetter<DeepReadonly<WorkspaceSettings> | WorkspaceSettings | null | undefined>;
|
|
@@ -23,6 +23,8 @@ function useGlobalEmbedConfigState() {
|
|
|
23
23
|
conversationScope: useState("chat-embed-config-conversation-scope", () => null),
|
|
24
24
|
defaultConversationCreatorFilter: useState("chat-embed-config-default-conversation-creator-filter", () => void 0),
|
|
25
25
|
availableModels: useState("chat-embed-config-available-models", () => void 0),
|
|
26
|
+
defaultModel: useState("chat-embed-config-default-model", () => void 0),
|
|
27
|
+
defaultReasoningEffort: useState("chat-embed-config-default-reasoning-effort", () => void 0),
|
|
26
28
|
conversationCreatorFilter: useState("chat-embed-config-conversation-creator-filter", () => void 0),
|
|
27
29
|
telaAgentInputs: useState("chat-embed-config-tela-agent-inputs", () => void 0),
|
|
28
30
|
workspaceSettings: useState("chat-embed-config-workspace-settings", () => void 0),
|
|
@@ -46,6 +48,8 @@ export function provideEmbedConfig(input, options = {}) {
|
|
|
46
48
|
conversationScope: computed(() => normalizeConversationScope(toValue(input.conversationScope))),
|
|
47
49
|
defaultConversationCreatorFilter: computed(() => toValue(input.defaultConversationCreatorFilter) ?? "all"),
|
|
48
50
|
availableModels: computed(() => toValue(input.availableModels)),
|
|
51
|
+
defaultModel: computed(() => toValue(input.defaultModel)),
|
|
52
|
+
defaultReasoningEffort: computed(() => toValue(input.defaultReasoningEffort)),
|
|
49
53
|
conversationCreatorFilter: computed(() => toValue(input.conversationCreatorFilter)),
|
|
50
54
|
telaAgentInputs: computed(() => toValue(input.telaAgentInputs)),
|
|
51
55
|
workspaceSettings: computed(() => toValue(input.workspaceSettings)),
|
|
@@ -70,6 +74,8 @@ export function provideEmbedConfig(input, options = {}) {
|
|
|
70
74
|
globalConfig.conversationScope.value = config.conversationScope.value;
|
|
71
75
|
globalConfig.defaultConversationCreatorFilter.value = config.defaultConversationCreatorFilter.value;
|
|
72
76
|
globalConfig.availableModels.value = config.availableModels.value;
|
|
77
|
+
globalConfig.defaultModel.value = config.defaultModel.value;
|
|
78
|
+
globalConfig.defaultReasoningEffort.value = config.defaultReasoningEffort.value;
|
|
73
79
|
globalConfig.conversationCreatorFilter.value = config.conversationCreatorFilter.value;
|
|
74
80
|
globalConfig.telaAgentInputs.value = config.telaAgentInputs.value;
|
|
75
81
|
globalConfig.workspaceSettings.value = config.workspaceSettings.value;
|
|
@@ -101,6 +107,8 @@ export function useEmbedConfig() {
|
|
|
101
107
|
conversationScope: computed(() => globalConfig.conversationScope.value),
|
|
102
108
|
defaultConversationCreatorFilter: computed(() => globalConfig.defaultConversationCreatorFilter.value ?? "all"),
|
|
103
109
|
availableModels: computed(() => globalConfig.availableModels.value),
|
|
110
|
+
defaultModel: computed(() => globalConfig.defaultModel.value),
|
|
111
|
+
defaultReasoningEffort: computed(() => globalConfig.defaultReasoningEffort.value),
|
|
104
112
|
conversationCreatorFilter: computed(() => globalConfig.conversationCreatorFilter.value),
|
|
105
113
|
telaAgentInputs: computed(() => globalConfig.telaAgentInputs.value),
|
|
106
114
|
workspaceSettings: computed(() => globalConfig.workspaceSettings.value),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChatModel, ChatReasoningEffort } from '../types/schemas/chat/models.js';
|
|
1
2
|
import type { Component, DeepReadonly } from 'vue';
|
|
2
3
|
import type { ConversationEvent } from '../types/schemas/chat/conversations.js';
|
|
3
4
|
import type { WorkspaceSettingsResponse as WorkspaceSettings } from '../types/schemas/chat/workspace-settings.js';
|
|
@@ -76,6 +77,16 @@ export type ChatEmbedSharedProps = {
|
|
|
76
77
|
* used when a new or restored selection is not allowed by this list.
|
|
77
78
|
*/
|
|
78
79
|
availableModels?: AvailableChatModels;
|
|
80
|
+
/**
|
|
81
|
+
* Initial model for untouched drafts. Existing conversations and explicit selections take precedence.
|
|
82
|
+
* When excluded by availableModels, the first allowed model is used.
|
|
83
|
+
*/
|
|
84
|
+
defaultModel?: ChatModel;
|
|
85
|
+
/**
|
|
86
|
+
* Initial effort for untouched drafts. Omission preserves automatic reasoning;
|
|
87
|
+
* an explicit user selection (including null) takes precedence.
|
|
88
|
+
*/
|
|
89
|
+
defaultReasoningEffort?: ChatReasoningEffort;
|
|
79
90
|
/** Controlled creator filter. Use with `v-model:conversation-creator-filter` when the host changes it at runtime. */
|
|
80
91
|
conversationCreatorFilter?: ConversationCreatorFilter;
|
|
81
92
|
/** Hide the conversation creator filter while preserving its active value. */
|
|
@@ -377,7 +377,7 @@ export function useChat(options = {}) {
|
|
|
377
377
|
const pendingModelSelection = computed({
|
|
378
378
|
get: () => {
|
|
379
379
|
const buckets = pendingModelBuckets.value;
|
|
380
|
-
return chatScope.value in buckets ? buckets[chatScope.value] ?? null : defaultChatModel;
|
|
380
|
+
return chatScope.value in buckets ? buckets[chatScope.value] ?? null : embedConfig?.defaultModel?.value ?? defaultChatModel;
|
|
381
381
|
},
|
|
382
382
|
set: (value) => {
|
|
383
383
|
pendingModelBuckets.value = {
|
|
@@ -394,7 +394,7 @@ export function useChat(options = {}) {
|
|
|
394
394
|
};
|
|
395
395
|
const pendingReasoningEffortBuckets = useState("chat-pending-reasoning-effort-selection", () => ({}));
|
|
396
396
|
const pendingReasoningEffortSelection = computed({
|
|
397
|
-
get: () => pendingReasoningEffortBuckets.value[chatScope.value] ?? null,
|
|
397
|
+
get: () => chatScope.value in pendingReasoningEffortBuckets.value ? pendingReasoningEffortBuckets.value[chatScope.value] ?? null : embedConfig?.defaultReasoningEffort?.value ?? null,
|
|
398
398
|
set: (value) => {
|
|
399
399
|
pendingReasoningEffortBuckets.value = {
|
|
400
400
|
...pendingReasoningEffortBuckets.value,
|