@meistrari/chat-nuxt 4.2.0-rc.2 → 4.2.0-rc.4
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.d.mts +2 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -0
- 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/composables/conversation-item.js +9 -1
- 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/meistrari-chat-embed.vue +4 -0
- 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/dist/runtime/server/utils/chat-api-proxy.js +4 -1
- package/dist/runtime/types/schemas/chat/chat-config.d.ts +1 -0
- package/dist/runtime/types/schemas/chat/chat-config.js +1 -0
- 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.d.mts
CHANGED
|
@@ -41,6 +41,8 @@ interface ChatNuxtModuleOptions {
|
|
|
41
41
|
* to `false`; also settable via `NUXT_CHAT_NUXT_AGENT_API_V5`.
|
|
42
42
|
*/
|
|
43
43
|
agentApiV5?: boolean;
|
|
44
|
+
/** Opt in to the 24-hour server-side pre-wake lookup cache. Defaults to false. */
|
|
45
|
+
preWakeCache?: boolean;
|
|
44
46
|
}
|
|
45
47
|
declare const _default: any;
|
|
46
48
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -454,6 +454,7 @@ const module$1 = defineNuxtModule({
|
|
|
454
454
|
// Explicit boolean default keeps the key in runtime config so the
|
|
455
455
|
// NUXT_CHAT_NUXT_SECRETLESS_EXECUTION env override can apply.
|
|
456
456
|
secretlessExecution: options.secretlessExecution ?? existingChatNuxtRuntimeConfig?.secretlessExecution ?? false,
|
|
457
|
+
preWakeCache: options.preWakeCache ?? existingChatNuxtRuntimeConfig?.preWakeCache ?? false,
|
|
457
458
|
agentApiV5: options.agentApiV5 ?? existingChatNuxtRuntimeConfig?.agentApiV5 ?? false
|
|
458
459
|
};
|
|
459
460
|
if (hostAuthComposablePath && !rc.chatNuxt.authTokenCookie) {
|
|
@@ -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
|
+
}
|
|
@@ -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);
|
|
@@ -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),
|
|
@@ -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,
|
|
@@ -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,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AGENT_API_V5_CONFIG_KEY, CONVERSATION_V2_CONFIG_KEY, PREPARED_AGENT_RUNTIME_CONFIG_KEY, SECRETLESS_EXECUTION_CONFIG_KEY } from "../../types/schemas/chat/chat-config.js";
|
|
1
|
+
import { AGENT_API_V5_CONFIG_KEY, PRE_WAKE_CACHE_CONFIG_KEY, CONVERSATION_V2_CONFIG_KEY, PREPARED_AGENT_RUNTIME_CONFIG_KEY, SECRETLESS_EXECUTION_CONFIG_KEY } from "../../types/schemas/chat/chat-config.js";
|
|
2
2
|
import { createError, defineEventHandler, getHeader, getRequestURL, getRouterParam, proxyRequest } from "h3";
|
|
3
3
|
import { useRuntimeConfig } from "nitropack/runtime";
|
|
4
4
|
import { resolveAuthToken } from "./auth-token.js";
|
|
@@ -77,6 +77,9 @@ function buildProxyHeaders(event) {
|
|
|
77
77
|
if (config.chatNuxt?.secretlessExecution) {
|
|
78
78
|
chatConfig[SECRETLESS_EXECUTION_CONFIG_KEY] = true;
|
|
79
79
|
}
|
|
80
|
+
if (config.chatNuxt?.preWakeCache === true) {
|
|
81
|
+
chatConfig[PRE_WAKE_CACHE_CONFIG_KEY] = true;
|
|
82
|
+
}
|
|
80
83
|
if (config.chatNuxt?.agentApiV5) {
|
|
81
84
|
chatConfig[AGENT_API_V5_CONFIG_KEY] = true;
|
|
82
85
|
}
|
|
@@ -2,3 +2,4 @@ export declare const PREPARED_AGENT_RUNTIME_CONFIG_KEY = "prepared-agent-runtime
|
|
|
2
2
|
export declare const SECRETLESS_EXECUTION_CONFIG_KEY = "secretless-execution";
|
|
3
3
|
export declare const AGENT_API_V5_CONFIG_KEY = "agent-api-v5";
|
|
4
4
|
export declare const CONVERSATION_V2_CONFIG_KEY = "conversation-v2";
|
|
5
|
+
export declare const PRE_WAKE_CACHE_CONFIG_KEY = "pre-wake-cache";
|
|
@@ -2,3 +2,4 @@ export const PREPARED_AGENT_RUNTIME_CONFIG_KEY = 'prepared-agent-runtime';
|
|
|
2
2
|
export const SECRETLESS_EXECUTION_CONFIG_KEY = 'secretless-execution';
|
|
3
3
|
export const AGENT_API_V5_CONFIG_KEY = 'agent-api-v5';
|
|
4
4
|
export const CONVERSATION_V2_CONFIG_KEY = 'conversation-v2';
|
|
5
|
+
export const PRE_WAKE_CACHE_CONFIG_KEY = 'pre-wake-cache';
|