@meistrari/chat-nuxt 3.14.2-rc.1 → 3.14.2-rc.2
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/conversations/components/chat-conversation-creator-filter.vue +6 -11
- package/dist/runtime/conversations/composables/conversation-creator-filter-state.d.ts +12 -0
- package/dist/runtime/conversations/composables/conversation-creator-filter-state.js +31 -0
- package/dist/runtime/conversations/composables/conversations.js +13 -1
- package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +2 -0
- package/dist/runtime/embed/components/chat-embed-inner.vue +8 -2
- package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +2 -0
- package/dist/runtime/embed/components/chat-embed.d.vue.ts +4 -2
- package/dist/runtime/embed/components/chat-embed.vue +11 -1
- package/dist/runtime/embed/components/chat-embed.vue.d.ts +4 -2
- package/dist/runtime/embed/components/meistrari-chat-embed.d.vue.ts +2 -0
- package/dist/runtime/embed/components/meistrari-chat-embed.vue +13 -1
- package/dist/runtime/embed/components/meistrari-chat-embed.vue.d.ts +2 -0
- package/dist/runtime/embed/composables/embed-config.d.ts +4 -0
- package/dist/runtime/embed/composables/embed-config.js +8 -0
- package/dist/runtime/embed/types.d.ts +4 -0
- package/dist/runtime/messages/components/widgets/chat-tool-section.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-tool-section.vue.d.ts +1 -1
- package/dist/runtime/types/embed.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,6 +55,8 @@ Declared in `src/runtime/embed/types.ts`; prop, feature-flag, and event payload
|
|
|
55
55
|
| `initialConversationId` | `string \| null` | `null` | Conversation to open once on mount when `conversationId` is uncontrolled |
|
|
56
56
|
| `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`, `.`, `_`, `:`, `/`, `-` |
|
|
57
57
|
| `defaultConversationCreatorFilter` | `'all' \| 'mine'` | `'all'` | Initial sidebar creator filter: every conversation in scope, or only the current user's |
|
|
58
|
+
| `conversationCreatorFilter` | `'all' \| 'mine'` | — | Controlled sidebar creator filter; use with `v-model:conversation-creator-filter` when the host changes it at runtime |
|
|
59
|
+
| `hideConversationCreatorFilter` | `boolean` | `false` | Hide the creator selector without changing the active filter |
|
|
58
60
|
| `telaAgentId` | `string` | — | Use Tela agent mode for this embed |
|
|
59
61
|
| `telaAgentInputs` | `TelaAgentExecutionInput[] \| null` | `undefined` | Inputs sent with each Tela agent run; hides the variables panel when non-null |
|
|
60
62
|
| `workspaceSettings` | `WorkspaceSettings \| null` | `null` | Override settings from host app; not accepted in Tela agent mode |
|
package/dist/module.json
CHANGED
|
@@ -2,28 +2,23 @@
|
|
|
2
2
|
import { useConversations } from "../composables/conversations";
|
|
3
3
|
import { conversationCreatorFilterOptions } from "../../types/schemas/chat/ui.js";
|
|
4
4
|
import { hasConversationCreatorFilterResults } from "../creator-filter";
|
|
5
|
-
|
|
6
|
-
const
|
|
5
|
+
import { useEmbedConfig } from "../../embed/composables/embed-config";
|
|
6
|
+
const embedConfig = useEmbedConfig();
|
|
7
|
+
const { conversationCreatorFilter, conversationCreatorFilterCounts } = useConversations();
|
|
7
8
|
const filterOptions = computed(() => conversationCreatorFilterOptions.map((option) => ({
|
|
8
9
|
value: option.value,
|
|
9
10
|
label: `${option.label} ${conversationCreatorFilterCounts.value[option.value]}`
|
|
10
11
|
})));
|
|
11
12
|
const showConversationCreatorFilter = computed(
|
|
12
|
-
() => hasConversationCreatorFilterResults(conversationCreatorFilterCounts.value)
|
|
13
|
+
() => !embedConfig?.hideConversationCreatorFilter.value && hasConversationCreatorFilterResults(conversationCreatorFilterCounts.value)
|
|
13
14
|
);
|
|
14
15
|
function isConversationCreatorFilter(value) {
|
|
15
16
|
return value === "all" || value === "mine";
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
if (
|
|
18
|
+
function handleFilterUpdate(value) {
|
|
19
|
+
if (!isConversationCreatorFilter(value) || value === conversationCreatorFilter.value)
|
|
19
20
|
return;
|
|
20
21
|
conversationCreatorFilter.value = value;
|
|
21
|
-
isUpdating.value = true;
|
|
22
|
-
try {
|
|
23
|
-
await fetchConversations({ force: true });
|
|
24
|
-
} finally {
|
|
25
|
-
isUpdating.value = false;
|
|
26
|
-
}
|
|
27
22
|
}
|
|
28
23
|
</script>
|
|
29
24
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import type { ConversationCreatorFilter } from '../../types/schemas/chat/primitives.js';
|
|
3
|
+
type ConversationCreatorFilterStateInput = {
|
|
4
|
+
defaultConversationCreatorFilter?: MaybeRefOrGetter<ConversationCreatorFilter | null | undefined>;
|
|
5
|
+
conversationCreatorFilter?: MaybeRefOrGetter<ConversationCreatorFilter | undefined>;
|
|
6
|
+
};
|
|
7
|
+
type ProvideConversationCreatorFilterStateOptions = {
|
|
8
|
+
reuseParent?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function provideConversationCreatorFilterState(input: ConversationCreatorFilterStateInput, options?: ProvideConversationCreatorFilterStateOptions): Ref<ConversationCreatorFilter>;
|
|
11
|
+
export declare function useProvidedConversationCreatorFilterState(): Ref<ConversationCreatorFilter> | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getCurrentInstance, inject, provide, ref, toValue, watch } from "vue";
|
|
2
|
+
const CONVERSATION_CREATOR_FILTER_STATE_KEY = Symbol("conversation-creator-filter-state");
|
|
3
|
+
export function provideConversationCreatorFilterState(input, options = {}) {
|
|
4
|
+
const inheritedState = options.reuseParent ? inject(
|
|
5
|
+
CONVERSATION_CREATOR_FILTER_STATE_KEY,
|
|
6
|
+
null
|
|
7
|
+
) : null;
|
|
8
|
+
if (inheritedState)
|
|
9
|
+
return inheritedState;
|
|
10
|
+
const state = ref(
|
|
11
|
+
toValue(input.conversationCreatorFilter) ?? toValue(input.defaultConversationCreatorFilter) ?? "all"
|
|
12
|
+
);
|
|
13
|
+
watch(
|
|
14
|
+
() => toValue(input.conversationCreatorFilter),
|
|
15
|
+
(controlledFilter) => {
|
|
16
|
+
if (controlledFilter !== void 0)
|
|
17
|
+
state.value = controlledFilter;
|
|
18
|
+
},
|
|
19
|
+
{ flush: "sync" }
|
|
20
|
+
);
|
|
21
|
+
provide(CONVERSATION_CREATOR_FILTER_STATE_KEY, state);
|
|
22
|
+
return state;
|
|
23
|
+
}
|
|
24
|
+
export function useProvidedConversationCreatorFilterState() {
|
|
25
|
+
if (!getCurrentInstance())
|
|
26
|
+
return null;
|
|
27
|
+
return inject(
|
|
28
|
+
CONVERSATION_CREATOR_FILTER_STATE_KEY,
|
|
29
|
+
null
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useChatAuth } from "#chat-auth";
|
|
2
2
|
import * as Sentry from "@sentry/nuxt";
|
|
3
3
|
import { resolveChatStateScope } from "../scope.js";
|
|
4
|
+
import { useProvidedConversationCreatorFilterState } from "./conversation-creator-filter-state.js";
|
|
4
5
|
import { useChatApi } from "../../shared/composables/chat-api.js";
|
|
5
6
|
import { useEmbedConfig } from "../../embed/composables/embed-config.js";
|
|
6
7
|
import { useStatusToast } from "../../shared/composables/status-toast.js";
|
|
@@ -68,10 +69,21 @@ export function useConversations() {
|
|
|
68
69
|
const metadataBuckets = useState("conversations-metadata", () => ({}));
|
|
69
70
|
const metadataLoadingBuckets = useState("conversations-metadata-loading", () => ({}));
|
|
70
71
|
const metadataFetchedBuckets = useState("conversations-metadata-fetched", () => ({}));
|
|
71
|
-
const
|
|
72
|
+
const providedConversationCreatorFilter = useProvidedConversationCreatorFilterState();
|
|
73
|
+
const conversationCreatorFilter = providedConversationCreatorFilter ?? useState(
|
|
72
74
|
"conversation-creator-filter",
|
|
73
75
|
() => embedConfig?.defaultConversationCreatorFilter?.value ?? "all"
|
|
74
76
|
);
|
|
77
|
+
if (!providedConversationCreatorFilter) {
|
|
78
|
+
watch(
|
|
79
|
+
() => embedConfig?.conversationCreatorFilter?.value,
|
|
80
|
+
(controlledFilter) => {
|
|
81
|
+
if (controlledFilter !== void 0)
|
|
82
|
+
conversationCreatorFilter.value = controlledFilter;
|
|
83
|
+
},
|
|
84
|
+
{ flush: "sync", immediate: true }
|
|
85
|
+
);
|
|
86
|
+
}
|
|
75
87
|
const runtimeScope = computed(() => resolveChatStateScope(
|
|
76
88
|
embedConfig?.workspaceId.value || activeOrganization.value?.id,
|
|
77
89
|
embedConfig?.telaAgentId.value,
|
|
@@ -19,9 +19,11 @@ type __VLS_Slots = {} & {
|
|
|
19
19
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
20
|
"update:conversationId": (value: string | null) => any;
|
|
21
21
|
"update:conversationTitle": (value: string | null) => any;
|
|
22
|
+
"update:conversationCreatorFilter": (value: ConversationCreatorFilter) => any;
|
|
22
23
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
24
|
"onUpdate:conversationId"?: ((value: string | null) => any) | undefined;
|
|
24
25
|
"onUpdate:conversationTitle"?: ((value: string | null) => any) | undefined;
|
|
26
|
+
"onUpdate:conversationCreatorFilter"?: ((value: ConversationCreatorFilter) => any) | undefined;
|
|
25
27
|
}>, {
|
|
26
28
|
hideSettings: boolean;
|
|
27
29
|
hideSidebar: boolean;
|
|
@@ -42,7 +42,7 @@ const props = defineProps({
|
|
|
42
42
|
user: { type: [Object, null], required: false },
|
|
43
43
|
features: { type: Object, required: false }
|
|
44
44
|
});
|
|
45
|
-
const emit = defineEmits(["update:conversationId", "update:conversationTitle"]);
|
|
45
|
+
const emit = defineEmits(["update:conversationId", "update:conversationTitle", "update:conversationCreatorFilter"]);
|
|
46
46
|
const sidebarPosition = computed(() => props.sidebar?.position ?? "left");
|
|
47
47
|
const sidebarWidth = computed(() => props.sidebar?.width ?? 240);
|
|
48
48
|
const sidebarBottomHeight = computed(
|
|
@@ -77,7 +77,8 @@ const {
|
|
|
77
77
|
updateConversationModel,
|
|
78
78
|
duplicateConversation,
|
|
79
79
|
moveConversationToGroup,
|
|
80
|
-
updateConversationInList
|
|
80
|
+
updateConversationInList,
|
|
81
|
+
conversationCreatorFilter
|
|
81
82
|
} = useConversations();
|
|
82
83
|
const { settings: workspaceSettingsState, fetchSettings } = useWorkspaceSettings();
|
|
83
84
|
const {
|
|
@@ -126,6 +127,11 @@ const activeConversationId = ref(
|
|
|
126
127
|
);
|
|
127
128
|
const loadingConversationId = ref(null);
|
|
128
129
|
const isReady = ref(false);
|
|
130
|
+
watch(conversationCreatorFilter, (filter) => {
|
|
131
|
+
emit("update:conversationCreatorFilter", filter);
|
|
132
|
+
if (isReady.value)
|
|
133
|
+
void fetchConversations({ force: true });
|
|
134
|
+
});
|
|
129
135
|
const {
|
|
130
136
|
pendingConversationGroupId,
|
|
131
137
|
setPendingConversationGroup,
|
|
@@ -19,9 +19,11 @@ type __VLS_Slots = {} & {
|
|
|
19
19
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
20
|
"update:conversationId": (value: string | null) => any;
|
|
21
21
|
"update:conversationTitle": (value: string | null) => any;
|
|
22
|
+
"update:conversationCreatorFilter": (value: ConversationCreatorFilter) => any;
|
|
22
23
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
24
|
"onUpdate:conversationId"?: ((value: string | null) => any) | undefined;
|
|
24
25
|
"onUpdate:conversationTitle"?: ((value: string | null) => any) | undefined;
|
|
26
|
+
"onUpdate:conversationCreatorFilter"?: ((value: ConversationCreatorFilter) => any) | undefined;
|
|
25
27
|
}>, {
|
|
26
28
|
hideSettings: boolean;
|
|
27
29
|
hideSidebar: boolean;
|
|
@@ -2,9 +2,9 @@ import { useChatAuth } from '#chat-auth';
|
|
|
2
2
|
import { type ChatActionPayload } from '../../messages/composables/chat-action.js';
|
|
3
3
|
import { type MessageFeedbackPayload } from '../../messages/composables/chat-feedback.js';
|
|
4
4
|
import { type ChatMessageTerminalPayload } from '../../messages/composables/chat-message-terminal.js';
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_13: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
'sidebar-bottom'?: (props: typeof
|
|
7
|
+
'sidebar-bottom'?: (props: typeof __VLS_13) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<(import("../types.js").ChatEmbedSharedProps & {
|
|
10
10
|
telaAgentId?: undefined;
|
|
@@ -21,6 +21,7 @@ declare const __VLS_base: import("vue").DefineComponent<(import("../types.js").C
|
|
|
21
21
|
} & import("../types.js").ChatEmbedVariantProps), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
22
|
"update:conversationId": (value: string | null) => any;
|
|
23
23
|
"update:conversationTitle": (value: string | null) => any;
|
|
24
|
+
"update:conversationCreatorFilter": (value: "all" | "mine") => any;
|
|
24
25
|
messageFeedback: (payload: MessageFeedbackPayload) => any;
|
|
25
26
|
action: (payload: ChatActionPayload) => any;
|
|
26
27
|
messageTerminal: (payload: ChatMessageTerminalPayload) => any;
|
|
@@ -39,6 +40,7 @@ declare const __VLS_base: import("vue").DefineComponent<(import("../types.js").C
|
|
|
39
40
|
} & import("../types.js").ChatEmbedVariantProps)> & Readonly<{
|
|
40
41
|
"onUpdate:conversationId"?: ((value: string | null) => any) | undefined;
|
|
41
42
|
"onUpdate:conversationTitle"?: ((value: string | null) => any) | undefined;
|
|
43
|
+
"onUpdate:conversationCreatorFilter"?: ((value: "all" | "mine") => any) | undefined;
|
|
42
44
|
onMessageFeedback?: ((payload: MessageFeedbackPayload) => any) | undefined;
|
|
43
45
|
onAction?: ((payload: ChatActionPayload) => any) | undefined;
|
|
44
46
|
onMessageTerminal?: ((payload: ChatMessageTerminalPayload) => any) | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useChatAuth } from "#chat-auth";
|
|
3
|
+
import { provideConversationCreatorFilterState } from "../../conversations/composables/conversation-creator-filter-state";
|
|
3
4
|
import { provideChatAction } from "../../messages/composables/chat-action";
|
|
4
5
|
import { provideMessageFeedback } from "../../messages/composables/chat-feedback";
|
|
5
6
|
import { provideChatMessageTerminal } from "../../messages/composables/chat-message-terminal";
|
|
@@ -12,6 +13,8 @@ const props = defineProps({
|
|
|
12
13
|
initialConversationId: { type: [String, null], required: false },
|
|
13
14
|
conversationScope: { type: [String, null], required: false },
|
|
14
15
|
defaultConversationCreatorFilter: { type: null, required: false },
|
|
16
|
+
conversationCreatorFilter: { type: null, required: false },
|
|
17
|
+
hideConversationCreatorFilter: { type: Boolean, required: false },
|
|
15
18
|
hideSidebar: { type: Boolean, required: false },
|
|
16
19
|
sidebar: { type: Object, required: false },
|
|
17
20
|
hideSettings: { type: Boolean, required: false },
|
|
@@ -33,7 +36,7 @@ const props = defineProps({
|
|
|
33
36
|
defaultOpen: { type: Boolean, required: false },
|
|
34
37
|
launcherLabel: { type: String, required: false }
|
|
35
38
|
});
|
|
36
|
-
const emit = defineEmits(["update:conversationId", "update:conversationTitle", "action", "messageFeedback", "messageTerminal"]);
|
|
39
|
+
const emit = defineEmits(["update:conversationId", "update:conversationTitle", "update:conversationCreatorFilter", "action", "messageFeedback", "messageTerminal"]);
|
|
37
40
|
const parentEmbedConfig = useEmbedConfig();
|
|
38
41
|
const { activeOrganization } = useChatAuth();
|
|
39
42
|
const workspaceId = computed(() => activeOrganization.value?.id?.trim() ?? "");
|
|
@@ -41,14 +44,20 @@ const normalizedTelaAgentId = computed(() => normalizeTelaAgentId(props.telaAgen
|
|
|
41
44
|
const normalizedConversationScope = computed(() => normalizeConversationScope(props.conversationScope));
|
|
42
45
|
const hideSettings = computed(() => props.hideSettings ?? false);
|
|
43
46
|
const ignoredPropsWarningKey = ref(null);
|
|
47
|
+
provideConversationCreatorFilterState({
|
|
48
|
+
defaultConversationCreatorFilter: () => props.defaultConversationCreatorFilter,
|
|
49
|
+
conversationCreatorFilter: () => props.conversationCreatorFilter
|
|
50
|
+
}, { reuseParent: true });
|
|
44
51
|
provideEmbedConfig({
|
|
45
52
|
workspaceId,
|
|
46
53
|
telaAgentId: normalizedTelaAgentId,
|
|
47
54
|
conversationScope: normalizedConversationScope,
|
|
48
55
|
defaultConversationCreatorFilter: computed(() => props.defaultConversationCreatorFilter),
|
|
56
|
+
conversationCreatorFilter: computed(() => props.conversationCreatorFilter),
|
|
49
57
|
telaAgentInputs: computed(() => props.telaAgentInputs),
|
|
50
58
|
workspaceSettings: computed(() => props.workspaceSettings),
|
|
51
59
|
hideSidebar: computed(() => props.hideSidebar),
|
|
60
|
+
hideConversationCreatorFilter: computed(() => props.hideConversationCreatorFilter),
|
|
52
61
|
hideSettings,
|
|
53
62
|
loadingMessages: computed(() => props.loadingMessages),
|
|
54
63
|
loadingMessagesMode: computed(() => props.loadingMessagesMode),
|
|
@@ -108,6 +117,7 @@ provideChatMessageTerminal((payload) => {
|
|
|
108
117
|
:features="features"
|
|
109
118
|
@update:conversation-id="$emit('update:conversationId', $event)"
|
|
110
119
|
@update:conversation-title="$emit('update:conversationTitle', $event)"
|
|
120
|
+
@update:conversation-creator-filter="$emit('update:conversationCreatorFilter', $event)"
|
|
111
121
|
>
|
|
112
122
|
<template v-if="$slots['sidebar-bottom']" #sidebar-bottom>
|
|
113
123
|
<slot name="sidebar-bottom" />
|
|
@@ -2,9 +2,9 @@ import { useChatAuth } from '#chat-auth';
|
|
|
2
2
|
import { type ChatActionPayload } from '../../messages/composables/chat-action.js';
|
|
3
3
|
import { type MessageFeedbackPayload } from '../../messages/composables/chat-feedback.js';
|
|
4
4
|
import { type ChatMessageTerminalPayload } from '../../messages/composables/chat-message-terminal.js';
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_13: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
'sidebar-bottom'?: (props: typeof
|
|
7
|
+
'sidebar-bottom'?: (props: typeof __VLS_13) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<(import("../types.js").ChatEmbedSharedProps & {
|
|
10
10
|
telaAgentId?: undefined;
|
|
@@ -21,6 +21,7 @@ declare const __VLS_base: import("vue").DefineComponent<(import("../types.js").C
|
|
|
21
21
|
} & import("../types.js").ChatEmbedVariantProps), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
22
|
"update:conversationId": (value: string | null) => any;
|
|
23
23
|
"update:conversationTitle": (value: string | null) => any;
|
|
24
|
+
"update:conversationCreatorFilter": (value: "all" | "mine") => any;
|
|
24
25
|
messageFeedback: (payload: MessageFeedbackPayload) => any;
|
|
25
26
|
action: (payload: ChatActionPayload) => any;
|
|
26
27
|
messageTerminal: (payload: ChatMessageTerminalPayload) => any;
|
|
@@ -39,6 +40,7 @@ declare const __VLS_base: import("vue").DefineComponent<(import("../types.js").C
|
|
|
39
40
|
} & import("../types.js").ChatEmbedVariantProps)> & Readonly<{
|
|
40
41
|
"onUpdate:conversationId"?: ((value: string | null) => any) | undefined;
|
|
41
42
|
"onUpdate:conversationTitle"?: ((value: string | null) => any) | undefined;
|
|
43
|
+
"onUpdate:conversationCreatorFilter"?: ((value: "all" | "mine") => any) | undefined;
|
|
42
44
|
onMessageFeedback?: ((payload: MessageFeedbackPayload) => any) | undefined;
|
|
43
45
|
onAction?: ((payload: ChatActionPayload) => any) | undefined;
|
|
44
46
|
onMessageTerminal?: ((payload: ChatMessageTerminalPayload) => any) | undefined;
|
|
@@ -8,6 +8,8 @@ import type { ChatEmbedVariant, ChatEmbedVariantProps, ChatSidebarConfig, ChatSu
|
|
|
8
8
|
type MeistrariChatEmbedEmits = {
|
|
9
9
|
/** Fired when the active conversation changes. Pairs with `v-model:conversation-id`. */
|
|
10
10
|
'update:conversationId': (value: string | null) => any;
|
|
11
|
+
/** Fired when the active conversation creator filter changes. Pairs with `v-model:conversation-creator-filter`. */
|
|
12
|
+
'update:conversationCreatorFilter': (value: 'all' | 'mine') => any;
|
|
11
13
|
/** Fired when the floating widget window opens or closes. Widget variants only. */
|
|
12
14
|
'update:open': (value: boolean) => any;
|
|
13
15
|
/** Fired when an assistant message triggers a host-handled action. */
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, ref, watch } from "vue";
|
|
3
|
+
import { provideConversationCreatorFilterState } from "../../conversations/composables/conversation-creator-filter-state";
|
|
3
4
|
const { hideSidebar = void 0, ...props } = defineProps({
|
|
4
5
|
conversationId: { type: [String, null], required: false },
|
|
5
6
|
initialConversationId: { type: [String, null], required: false },
|
|
6
7
|
conversationScope: { type: [String, null], required: false },
|
|
7
8
|
defaultConversationCreatorFilter: { type: null, required: false },
|
|
9
|
+
conversationCreatorFilter: { type: null, required: false },
|
|
10
|
+
hideConversationCreatorFilter: { type: Boolean, required: false },
|
|
8
11
|
hideSidebar: { type: Boolean, required: false },
|
|
9
12
|
sidebar: { type: Object, required: false },
|
|
10
13
|
hideSettings: { type: Boolean, required: false },
|
|
@@ -26,8 +29,12 @@ const { hideSidebar = void 0, ...props } = defineProps({
|
|
|
26
29
|
defaultOpen: { type: Boolean, required: false },
|
|
27
30
|
launcherLabel: { type: String, required: false }
|
|
28
31
|
});
|
|
29
|
-
const emit = defineEmits(["update:conversationId", "update:open", "action", "messageFeedback", "messageTerminal"]);
|
|
32
|
+
const emit = defineEmits(["update:conversationId", "update:conversationCreatorFilter", "update:open", "action", "messageFeedback", "messageTerminal"]);
|
|
30
33
|
defineSlots();
|
|
34
|
+
provideConversationCreatorFilterState({
|
|
35
|
+
defaultConversationCreatorFilter: () => props.defaultConversationCreatorFilter,
|
|
36
|
+
conversationCreatorFilter: () => props.conversationCreatorFilter
|
|
37
|
+
});
|
|
31
38
|
const hideSettings = computed(() => props.hideSettings ?? false);
|
|
32
39
|
const variant = computed(() => props.variant ?? "page");
|
|
33
40
|
const isOpen = ref(props.defaultOpen ?? false);
|
|
@@ -55,6 +62,8 @@ const sharedEmbedProps = computed(() => ({
|
|
|
55
62
|
initialConversationId: props.initialConversationId,
|
|
56
63
|
conversationScope: props.conversationScope,
|
|
57
64
|
defaultConversationCreatorFilter: props.defaultConversationCreatorFilter,
|
|
65
|
+
conversationCreatorFilter: props.conversationCreatorFilter,
|
|
66
|
+
hideConversationCreatorFilter: props.hideConversationCreatorFilter,
|
|
58
67
|
hideSettings: hideSettings.value,
|
|
59
68
|
suggestions: props.suggestions,
|
|
60
69
|
features: props.features,
|
|
@@ -84,6 +93,7 @@ const widgetEmbedProps = computed(() => ({
|
|
|
84
93
|
v-if="variant === 'page'"
|
|
85
94
|
v-bind="pageEmbedProps"
|
|
86
95
|
@update:conversation-id="emit('update:conversationId', $event)"
|
|
96
|
+
@update:conversation-creator-filter="emit('update:conversationCreatorFilter', $event)"
|
|
87
97
|
@action="emit('action', $event)"
|
|
88
98
|
@message-feedback="emit('messageFeedback', $event)"
|
|
89
99
|
@message-terminal="emit('messageTerminal', $event)"
|
|
@@ -115,6 +125,7 @@ const widgetEmbedProps = computed(() => ({
|
|
|
115
125
|
v-bind="widgetEmbedProps"
|
|
116
126
|
compact
|
|
117
127
|
@update:conversation-id="handleWidgetConversationIdChange"
|
|
128
|
+
@update:conversation-creator-filter="emit('update:conversationCreatorFilter', $event)"
|
|
118
129
|
@update:conversation-title="widgetConversationTitle = $event"
|
|
119
130
|
@action="emit('action', $event)"
|
|
120
131
|
@message-feedback="emit('messageFeedback', $event)"
|
|
@@ -139,6 +150,7 @@ const widgetEmbedProps = computed(() => ({
|
|
|
139
150
|
v-bind="widgetEmbedProps"
|
|
140
151
|
compact
|
|
141
152
|
@update:conversation-id="handleWidgetConversationIdChange"
|
|
153
|
+
@update:conversation-creator-filter="emit('update:conversationCreatorFilter', $event)"
|
|
142
154
|
@update:conversation-title="widgetConversationTitle = $event"
|
|
143
155
|
@action="emit('action', $event)"
|
|
144
156
|
@message-feedback="emit('messageFeedback', $event)"
|
|
@@ -8,6 +8,8 @@ import type { ChatEmbedVariant, ChatEmbedVariantProps, ChatSidebarConfig, ChatSu
|
|
|
8
8
|
type MeistrariChatEmbedEmits = {
|
|
9
9
|
/** Fired when the active conversation changes. Pairs with `v-model:conversation-id`. */
|
|
10
10
|
'update:conversationId': (value: string | null) => any;
|
|
11
|
+
/** Fired when the active conversation creator filter changes. Pairs with `v-model:conversation-creator-filter`. */
|
|
12
|
+
'update:conversationCreatorFilter': (value: 'all' | 'mine') => any;
|
|
11
13
|
/** Fired when the floating widget window opens or closes. Widget variants only. */
|
|
12
14
|
'update:open': (value: boolean) => any;
|
|
13
15
|
/** Fired when an assistant message triggers a host-handled action. */
|
|
@@ -12,9 +12,11 @@ export type EmbedConfig = {
|
|
|
12
12
|
telaAgentId: Ref<string | null>;
|
|
13
13
|
conversationScope: Ref<string | null>;
|
|
14
14
|
defaultConversationCreatorFilter: Ref<ConversationCreatorFilter>;
|
|
15
|
+
conversationCreatorFilter: Ref<ConversationCreatorFilter | undefined>;
|
|
15
16
|
telaAgentInputs: Ref<ConfiguredTelaAgentInputs>;
|
|
16
17
|
workspaceSettings: Ref<DeepReadonly<WorkspaceSettings> | WorkspaceSettings | null | undefined>;
|
|
17
18
|
hideSidebar: Ref<boolean>;
|
|
19
|
+
hideConversationCreatorFilter: Ref<boolean>;
|
|
18
20
|
hideSettings: Ref<boolean>;
|
|
19
21
|
loadingMessages: Ref<readonly string[] | null | undefined>;
|
|
20
22
|
loadingMessagesMode: Ref<ChatLoadingMessageMode | null | undefined>;
|
|
@@ -29,9 +31,11 @@ type EmbedConfigInput = {
|
|
|
29
31
|
telaAgentId?: MaybeRefOrGetter<string | null | undefined>;
|
|
30
32
|
conversationScope?: MaybeRefOrGetter<string | null | undefined>;
|
|
31
33
|
defaultConversationCreatorFilter?: MaybeRefOrGetter<ConversationCreatorFilter | null | undefined>;
|
|
34
|
+
conversationCreatorFilter?: MaybeRefOrGetter<ConversationCreatorFilter | undefined>;
|
|
32
35
|
telaAgentInputs?: MaybeRefOrGetter<ConfiguredTelaAgentInputs>;
|
|
33
36
|
workspaceSettings?: MaybeRefOrGetter<DeepReadonly<WorkspaceSettings> | WorkspaceSettings | null | undefined>;
|
|
34
37
|
hideSidebar?: MaybeRefOrGetter<boolean | undefined>;
|
|
38
|
+
hideConversationCreatorFilter?: MaybeRefOrGetter<boolean | undefined>;
|
|
35
39
|
hideSettings?: MaybeRefOrGetter<boolean | undefined>;
|
|
36
40
|
loadingMessages?: MaybeRefOrGetter<readonly string[] | null | undefined>;
|
|
37
41
|
loadingMessagesMode?: MaybeRefOrGetter<ChatLoadingMessageMode | null | undefined>;
|
|
@@ -22,9 +22,11 @@ function useGlobalEmbedConfigState() {
|
|
|
22
22
|
telaAgentId: useState("chat-embed-config-tela-agent-id", () => null),
|
|
23
23
|
conversationScope: useState("chat-embed-config-conversation-scope", () => null),
|
|
24
24
|
defaultConversationCreatorFilter: useState("chat-embed-config-default-conversation-creator-filter", () => void 0),
|
|
25
|
+
conversationCreatorFilter: useState("chat-embed-config-conversation-creator-filter", () => void 0),
|
|
25
26
|
telaAgentInputs: useState("chat-embed-config-tela-agent-inputs", () => void 0),
|
|
26
27
|
workspaceSettings: useState("chat-embed-config-workspace-settings", () => void 0),
|
|
27
28
|
hideSidebar: useState("chat-embed-config-hide-sidebar", () => void 0),
|
|
29
|
+
hideConversationCreatorFilter: useState("chat-embed-config-hide-conversation-creator-filter", () => void 0),
|
|
28
30
|
hideSettings: useState("chat-embed-config-hide-settings", () => void 0),
|
|
29
31
|
loadingMessages: useState("chat-embed-config-loading-messages", () => void 0),
|
|
30
32
|
loadingMessagesMode: useState("chat-embed-config-loading-messages-mode", () => void 0),
|
|
@@ -41,9 +43,11 @@ export function provideEmbedConfig(input, options = {}) {
|
|
|
41
43
|
telaAgentId: computed(() => toValue(input.telaAgentId) ?? null),
|
|
42
44
|
conversationScope: computed(() => normalizeConversationScope(toValue(input.conversationScope))),
|
|
43
45
|
defaultConversationCreatorFilter: computed(() => toValue(input.defaultConversationCreatorFilter) ?? "all"),
|
|
46
|
+
conversationCreatorFilter: computed(() => toValue(input.conversationCreatorFilter)),
|
|
44
47
|
telaAgentInputs: computed(() => toValue(input.telaAgentInputs)),
|
|
45
48
|
workspaceSettings: computed(() => toValue(input.workspaceSettings)),
|
|
46
49
|
hideSidebar: computed(() => toValue(input.hideSidebar) ?? true),
|
|
50
|
+
hideConversationCreatorFilter: computed(() => toValue(input.hideConversationCreatorFilter) ?? false),
|
|
47
51
|
hideSettings: computed(() => toValue(input.hideSettings) ?? false),
|
|
48
52
|
loadingMessages: computed(() => toValue(input.loadingMessages)),
|
|
49
53
|
loadingMessagesMode: computed(() => toValue(input.loadingMessagesMode)),
|
|
@@ -61,9 +65,11 @@ export function provideEmbedConfig(input, options = {}) {
|
|
|
61
65
|
globalConfig.telaAgentId.value = config.telaAgentId.value;
|
|
62
66
|
globalConfig.conversationScope.value = config.conversationScope.value;
|
|
63
67
|
globalConfig.defaultConversationCreatorFilter.value = config.defaultConversationCreatorFilter.value;
|
|
68
|
+
globalConfig.conversationCreatorFilter.value = config.conversationCreatorFilter.value;
|
|
64
69
|
globalConfig.telaAgentInputs.value = config.telaAgentInputs.value;
|
|
65
70
|
globalConfig.workspaceSettings.value = config.workspaceSettings.value;
|
|
66
71
|
globalConfig.hideSidebar.value = config.hideSidebar.value;
|
|
72
|
+
globalConfig.hideConversationCreatorFilter.value = config.hideConversationCreatorFilter.value;
|
|
67
73
|
globalConfig.hideSettings.value = config.hideSettings.value;
|
|
68
74
|
globalConfig.loadingMessages.value = config.loadingMessages.value;
|
|
69
75
|
globalConfig.loadingMessagesMode.value = config.loadingMessagesMode.value;
|
|
@@ -88,9 +94,11 @@ export function useEmbedConfig() {
|
|
|
88
94
|
telaAgentId: computed(() => globalConfig.telaAgentId.value),
|
|
89
95
|
conversationScope: computed(() => globalConfig.conversationScope.value),
|
|
90
96
|
defaultConversationCreatorFilter: computed(() => globalConfig.defaultConversationCreatorFilter.value ?? "all"),
|
|
97
|
+
conversationCreatorFilter: computed(() => globalConfig.conversationCreatorFilter.value),
|
|
91
98
|
telaAgentInputs: computed(() => globalConfig.telaAgentInputs.value),
|
|
92
99
|
workspaceSettings: computed(() => globalConfig.workspaceSettings.value),
|
|
93
100
|
hideSidebar: computed(() => globalConfig.hideSidebar.value ?? true),
|
|
101
|
+
hideConversationCreatorFilter: computed(() => globalConfig.hideConversationCreatorFilter.value ?? false),
|
|
94
102
|
hideSettings: computed(() => globalConfig.hideSettings.value ?? false),
|
|
95
103
|
loadingMessages: computed(() => globalConfig.loadingMessages.value),
|
|
96
104
|
loadingMessagesMode: computed(() => globalConfig.loadingMessagesMode.value),
|
|
@@ -55,6 +55,10 @@ export type ChatEmbedSharedProps = {
|
|
|
55
55
|
* conversation in scope, `'mine'` shows only those created by the current user.
|
|
56
56
|
*/
|
|
57
57
|
defaultConversationCreatorFilter?: ConversationCreatorFilter;
|
|
58
|
+
/** Controlled creator filter. Use with `v-model:conversation-creator-filter` when the host changes it at runtime. */
|
|
59
|
+
conversationCreatorFilter?: ConversationCreatorFilter;
|
|
60
|
+
/** Hide the conversation creator filter while preserving its active value. */
|
|
61
|
+
hideConversationCreatorFilter?: boolean;
|
|
58
62
|
/** Hide the conversation list and render only the active chat surface. */
|
|
59
63
|
hideSidebar?: boolean;
|
|
60
64
|
/** Layout options for the conversation sidebar (edge and `sidebar-bottom` split). */
|
|
@@ -9,9 +9,9 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_1) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
flush: boolean;
|
|
12
13
|
limit: "input" | "output" | "none";
|
|
13
14
|
tone: "mono" | "prose" | "error";
|
|
14
|
-
flush: boolean;
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
17
|
declare const _default: typeof __VLS_export;
|
|
@@ -9,9 +9,9 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_1) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
flush: boolean;
|
|
12
13
|
limit: "input" | "output" | "none";
|
|
13
14
|
tone: "mono" | "prose" | "error";
|
|
14
|
-
flush: boolean;
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
17
|
declare const _default: typeof __VLS_export;
|
|
@@ -6,4 +6,5 @@ export type { MessageFeedbackConfig, MessageFeedbackPayload, MessageFeedbackRati
|
|
|
6
6
|
export { ChatMessageStatus } from '../messages/composables/chat-message-terminal.js';
|
|
7
7
|
export type { ChatMessageTerminalPayload } from '../messages/composables/chat-message-terminal.js';
|
|
8
8
|
export type { MessageOverviewResponse } from './schemas/chat/messages.js';
|
|
9
|
+
export type { ConversationCreatorFilter } from './schemas/chat/primitives.js';
|
|
9
10
|
export type { TelaAgentExecutionInput } from './schemas/integrations/tela-agent-api.js';
|