@meistrari/chat-nuxt 1.14.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +7 -9
  2. package/dist/module.d.mts +1 -1
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +0 -39
  5. package/dist/runtime/conversations/composables/conversations.d.ts +1 -4
  6. package/dist/runtime/conversations/composables/conversations.js +3 -6
  7. package/dist/runtime/embed/components/chat-embed-inner.vue +4 -35
  8. package/dist/runtime/embed/components/chat-embed.d.vue.ts +3 -0
  9. package/dist/runtime/embed/components/chat-embed.vue +10 -2
  10. package/dist/runtime/embed/components/chat-embed.vue.d.ts +3 -0
  11. package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.d.vue.ts +2 -2
  12. package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.vue.d.ts +2 -2
  13. package/dist/runtime/embed/components/meistrari-chat-embed.vue +9 -1
  14. package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +2 -8
  15. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +2 -12
  16. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +2 -8
  17. package/dist/runtime/embed/composables/embed-config.d.ts +6 -0
  18. package/dist/runtime/embed/composables/embed-config.js +11 -3
  19. package/dist/runtime/embed/feature-config.d.ts +0 -2
  20. package/dist/runtime/embed/feature-config.js +0 -1
  21. package/dist/runtime/embed/types.d.ts +14 -0
  22. package/dist/runtime/messages/components/chat-message-bubble.vue +8 -4
  23. package/dist/runtime/messages/components/chat-message-feedback.d.vue.ts +7 -0
  24. package/dist/runtime/messages/components/chat-message-feedback.vue +251 -0
  25. package/dist/runtime/messages/components/chat-message-feedback.vue.d.ts +7 -0
  26. package/dist/runtime/messages/components/chat-message-input.d.vue.ts +5 -15
  27. package/dist/runtime/messages/components/chat-message-input.vue +0 -7
  28. package/dist/runtime/messages/components/chat-message-input.vue.d.ts +5 -15
  29. package/dist/runtime/messages/composables/chat-feedback.d.ts +21 -0
  30. package/dist/runtime/messages/composables/chat-feedback.js +12 -0
  31. package/dist/runtime/messages/composables/chat.d.ts +1 -1
  32. package/dist/runtime/messages/composables/chat.js +34 -12
  33. package/dist/runtime/messages/message-state.d.ts +3 -0
  34. package/dist/runtime/messages/message-state.js +13 -0
  35. package/dist/runtime/types/embed.d.ts +1 -0
  36. package/dist/runtime/types/schemas/chat/conversations.d.ts +2 -3
  37. package/dist/runtime/types/schemas/chat/conversations.js +2 -3
  38. package/dist/runtime/types/schemas/chat/messages.d.ts +6 -48
  39. package/dist/runtime/types/schemas/chat/messages.js +5 -4
  40. package/dist/runtime/types/schemas/chat/workspace-settings.d.ts +0 -47
  41. package/dist/runtime/types/schemas/chat/workspace-settings.js +0 -1
  42. package/dist/runtime/types/schemas/integrations/tela-agent-api.d.ts +34 -0
  43. package/dist/runtime/types/schemas/integrations/tela-agent-api.js +3 -0
  44. package/dist/types.d.mts +1 -1
  45. package/package.json +1 -1
  46. package/dist/runtime/internal/agent-environment-resolver.stub.d.ts +0 -2
  47. package/dist/runtime/internal/agent-environment-resolver.stub.js +0 -1
  48. package/dist/runtime/messages/components/chat-model-selector.d.vue.ts +0 -15
  49. package/dist/runtime/messages/components/chat-model-selector.vue +0 -42
  50. package/dist/runtime/messages/components/chat-model-selector.vue.d.ts +0 -15
  51. package/dist/runtime/messages/composables/selected-model.d.ts +0 -4
  52. package/dist/runtime/messages/composables/selected-model.js +0 -48
  53. package/dist/runtime/types/chat-agent-environment-resolver.d.ts +0 -4
package/README.md CHANGED
@@ -120,14 +120,14 @@ The chat workspace is resolved from the authenticated `activeOrganization` provi
120
120
 
121
121
  `<MeistrariChatEmbed />` has two mutually exclusive runtimes:
122
122
 
123
- - **Default chat mode** uses the Agent API, workspace settings, model selection, optional feature flags, and the authenticated workspace.
123
+ - **Default chat mode** uses the Chat API and the workspace's configured Tela agent. Runtime configuration, entitlements, and workspace-specific agent selection are owned by `@meistrari/chat-api`.
124
124
  - **Tela agent mode** uses a configured Tela agent directly. Pass `telaAgentId`; the embed sends user messages to `POST /agent/:id/run`, polls `GET /agent/sessions/:sessionId`, and ends sessions with `DELETE /agent/sessions/:sessionId`.
125
125
 
126
126
  ```vue
127
127
  <MeistrariChatEmbed tela-agent-id="agent_123" />
128
128
  ```
129
129
 
130
- `conversationScope` works in both runtimes. In default chat mode, it isolates conversations inside the authenticated workspace without requiring a Tela agent:
130
+ `conversationScope` works in both runtimes. In default chat mode, it isolates conversations inside the authenticated workspace while the Chat API resolves the correct Tela agent:
131
131
 
132
132
  ```vue
133
133
  <MeistrariChatEmbed :conversation-scope="`user:${userId}`" />
@@ -145,7 +145,7 @@ Host apps can also provide Tela agent inputs directly. When `telaAgentInputs` is
145
145
  />
146
146
  ```
147
147
 
148
- In Tela agent mode, `workspaceSettings` and `user` are not accepted by the public prop contract the Tela agent owns runtime configuration and identity for execution. `features` is still accepted, but model selection and the usage/debug UI surfaces stay hidden because the Tela agent owns execution.
148
+ In Tela agent mode, `workspaceSettings` and `user` are not accepted by the public prop contract - the Tela agent owns runtime configuration and identity for execution. `features` is still accepted for shared UI controls.
149
149
 
150
150
  ## Embedding in Your Layout
151
151
 
@@ -227,13 +227,12 @@ Scoped embeds only see conversations created with the same scope. Unscoped embed
227
227
 
228
228
  ## Optional: Feature Flags
229
229
 
230
- `<MeistrariChatEmbed>` accepts a `:features` prop with four optional toggles. All default to `false`. The host owns the policy hardcode them, gate by user role, or wire them through a feature-flag provider of your choice.
230
+ `<MeistrariChatEmbed>` accepts a `:features` prop with three optional toggles. All default to `false`. The host owns the policy - hardcode them, gate by user role, or wire them through a feature-flag provider of your choice.
231
231
 
232
232
  | Flag | Effect |
233
233
  |------|--------|
234
234
  | `showUsageTab` | Usage tab in the chat topbar (per-conversation token/cost stats) |
235
235
  | `showDebugOption` | Debug entry in the topbar overflow menu |
236
- | `showModelSelector` | Model picker inside the message input |
237
236
  | `showCancelButton` | "Stop generation" button while a response streams |
238
237
 
239
238
  Static example:
@@ -292,7 +291,6 @@ const { isFeatureEnabled } = useFeatureFlags()
292
291
  const features = computed(() => ({
293
292
  showUsageTab: isFeatureEnabled('enable-usage-tab'),
294
293
  showDebugOption: isFeatureEnabled('enable-debug-mode'),
295
- showModelSelector: isFeatureEnabled('enable-model-selector'),
296
294
  showCancelButton: isFeatureEnabled('enable-cancel-generation'),
297
295
  }))
298
296
  </script>
@@ -325,11 +323,11 @@ To override them, pass settings directly from your host app:
325
323
 
326
324
  The `server/chat/resolve-workspace-settings.ts` host resolver from earlier versions is no longer invoked: the module proxies chat requests to the Chat API, which owns workspace settings resolution.
327
325
 
328
- ## Agent API Environment Variables
326
+ ## Agent Runtime Configuration
329
327
 
330
- `chat-nuxt` proxies chat requests to `@meistrari/chat-api`; it no longer starts Agent API sessions directly. Agent API `environmentVariables` are resolved inside `chat-api` when it creates a new default Agent API session. Host apps should configure server-only Agent API environment behavior in `chat-api`, not through `server/chat/resolve-agent-environment.*` files in the Nuxt app.
328
+ `chat-nuxt` proxies chat requests to `@meistrari/chat-api`; it does not start agent sessions directly or resolve runtime environment variables. Agent runtime configuration, entitlements, and Tela agent selection are owned by `chat-api` and the Tela agent configuration. Host apps do not need Nuxt-side agent environment resolver files for this module.
331
329
 
332
- `chat-nuxt` only transports these variables to Agent API. A skill that calls a host backend must implement its own callback contract with the host backend. In short, callback authorization belongs to the skill and host backend, not `chat-nuxt`. The host backend remains responsible for validating invocation grants, allowed tools, schemas, replay protection, confirmation for writes, and audit logging.
330
+ A skill that calls a host backend must implement its own callback contract with the host backend. In short, callback authorization belongs to the skill and host backend, not `chat-nuxt`. The host backend remains responsible for validating invocation grants, allowed tools, schemas, replay protection, confirmation for writes, and audit logging.
333
331
 
334
332
  ## `<ChatConfigurationModal>`
335
333
 
package/dist/module.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { ChatActionPayload, ChatActor, ChatEmbedSharedProps, ChatFeatureConfig, DefaultChatEmbedProps, MeistrariChatEmbedProps, TelaAgentChatEmbedProps, TelaAgentExecutionInput } from '../dist/runtime/types/embed.js';
1
+ export { ChatActionPayload, ChatActor, ChatEmbedSharedProps, ChatFeatureConfig, DefaultChatEmbedProps, MeistrariChatEmbedProps, MessageFeedbackConfig, MessageFeedbackPayload, MessageFeedbackRating, TelaAgentChatEmbedProps, TelaAgentExecutionInput } from '../dist/runtime/types/embed.js';
2
2
 
3
3
  type ChatNuxtConfigValidationMode = false | 'warn' | 'error';
4
4
 
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "1.14.0",
4
+ "version": "3.0.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -3,32 +3,6 @@ import { createRequire } from 'node:module';
3
3
  import { join, dirname } from 'node:path';
4
4
  import { defineNuxtModule, createResolver, addTemplate, addTypeTemplate, addPlugin, addImportsDir, addComponent, addComponentsDir } from 'nuxt/kit';
5
5
 
6
- const agentEnvironmentResolverCandidates = [
7
- "server/chat/resolve-agent-environment.ts",
8
- "server/chat/resolve-agent-environment.mts",
9
- "server/chat/resolve-agent-environment.mjs",
10
- "server/chat/resolve-agent-environment.js"
11
- ];
12
- const stubExtensions$1 = [".ts", ".mjs", ".js"];
13
- function resolveAgentEnvironmentResolverEntry(srcDir, fallbackResolverBase) {
14
- for (const relativePath of agentEnvironmentResolverCandidates) {
15
- const candidate = join(srcDir, relativePath);
16
- if (existsSync(candidate)) {
17
- return candidate;
18
- }
19
- }
20
- for (const ext of stubExtensions$1) {
21
- const candidate = fallbackResolverBase + ext;
22
- if (existsSync(candidate)) {
23
- return candidate;
24
- }
25
- }
26
- const attempted = stubExtensions$1.map((ext) => fallbackResolverBase + ext).join(", ");
27
- throw new Error(
28
- `[@meistrari/chat-nuxt] Unable to resolve agent-environment stub. Tried: ${attempted}. This indicates a packaging bug - please report it.`
29
- );
30
- }
31
-
32
6
  const localRequire = createRequire(import.meta.url);
33
7
  const runtimeAliasPackages = [
34
8
  "vue",
@@ -340,10 +314,6 @@ const module$1 = defineNuxtModule({
340
314
  nuxt.options.srcDir,
341
315
  join(runtimeDir, "internal/workspace-settings-resolver.stub")
342
316
  );
343
- const agentEnvironmentResolverEntry = resolveAgentEnvironmentResolverEntry(
344
- nuxt.options.srcDir,
345
- join(runtimeDir, "internal/agent-environment-resolver.stub")
346
- );
347
317
  const telaBuildPath = resolveTelaBuildLayer();
348
318
  const runtimeAliases = resolveRuntimeAliases(telaBuildPath);
349
319
  const chatAuthMode = resolveChatAuthMode(nuxt.options.runtimeConfig);
@@ -355,13 +325,6 @@ const module$1 = defineNuxtModule({
355
325
  filename: "chat-nuxt/chat-auth.d.ts",
356
326
  src: join(runtimeDir, "types/chat-auth.d.ts")
357
327
  });
358
- addTypeTemplate({
359
- filename: "chat-nuxt/chat-agent-environment-resolver.d.ts",
360
- src: join(runtimeDir, "types/chat-agent-environment-resolver.d.ts")
361
- }, {
362
- nitro: true,
363
- nuxt: true
364
- });
365
328
  nuxt.hook("prepare:types", ({ tsConfig }) => {
366
329
  tsConfig.compilerOptions ||= {};
367
330
  tsConfig.compilerOptions.paths ||= {};
@@ -376,7 +339,6 @@ const module$1 = defineNuxtModule({
376
339
  nuxt.options.alias = {
377
340
  ...nuxt.options.alias,
378
341
  "#chat-auth": chatAuthTemplate.dst,
379
- "#chat-agent-environment-resolver": agentEnvironmentResolverEntry,
380
342
  "#chat-workspace-settings-resolver": workspaceSettingsResolverEntry,
381
343
  "#chat-runtime": runtimeDir,
382
344
  "@iconify-json/ph": resolvePackageRoot("@iconify-json/ph")
@@ -475,7 +437,6 @@ export default globalThis.ELK;
475
437
  nitroConfig.alias = {
476
438
  ...nitroConfig.alias,
477
439
  "#chat-auth": chatAuthTemplate.dst,
478
- "#chat-agent-environment-resolver": agentEnvironmentResolverEntry,
479
440
  "#chat-runtime": runtimeDir,
480
441
  "#chat-workspace-settings-resolver": workspaceSettingsResolverEntry
481
442
  };
@@ -1,6 +1,5 @@
1
1
  import type { DeepReadonly } from 'vue';
2
2
  import type { Conversation, ConversationWithMessages } from '../../types/schemas/chat/conversations.js';
3
- import type { ChatModel } from '../../types/schemas/chat/models.js';
4
3
  export declare function mergeFetchedConversations(fetchedConversations: Conversation[], localConversations: readonly Conversation[], deletedConversationIds?: readonly string[], locallyMutatedConversationIds?: readonly string[]): Conversation[];
5
4
  export declare function useConversations(): {
6
5
  conversations: any;
@@ -9,9 +8,7 @@ export declare function useConversations(): {
9
8
  fetchConversations: (options?: {
10
9
  force?: boolean;
11
10
  }) => Promise<void>;
12
- createConversation: (options?: {
13
- model?: ChatModel | null;
14
- }) => Promise<Conversation | null>;
11
+ createConversation: () => Promise<Conversation | null>;
15
12
  deleteConversation: (id: string) => Promise<boolean>;
16
13
  renameConversation: (id: string, title: string) => Promise<boolean>;
17
14
  moveConversationToGroup: (id: string, groupId: string | null) => Promise<boolean>;
@@ -1,6 +1,5 @@
1
1
  import { useChatAuth } from "#chat-auth";
2
2
  import * as Sentry from "@sentry/nuxt";
3
- import { defaultChatModel } from "../../types/schemas/chat/models.js";
4
3
  import { resolveChatStateScope } from "../scope.js";
5
4
  import { useChatApi } from "../../shared/composables/chat-api.js";
6
5
  import { useEmbedConfig } from "../../embed/composables/embed-config.js";
@@ -73,7 +72,6 @@ export function useConversations() {
73
72
  "conversation-creator-filter",
74
73
  () => embedConfig?.defaultConversationCreatorFilter?.value ?? "all"
75
74
  );
76
- const isTelaAgentMode = computed(() => !!embedConfig?.telaAgentId.value);
77
75
  const runtimeScope = computed(() => resolveChatStateScope(
78
76
  embedConfig?.workspaceId.value || activeOrganization.value?.id,
79
77
  embedConfig?.telaAgentId.value,
@@ -293,7 +291,7 @@ export function useConversations() {
293
291
  setBucketValue(loadingBuckets, requestScope, false);
294
292
  }
295
293
  };
296
- const createConversation = async (options) => {
294
+ const createConversation = async () => {
297
295
  error.value = null;
298
296
  const requestRuntimeScope = runtimeScope.value;
299
297
  const metadataSnapshot = snapshotConversationMetadata(requestRuntimeScope);
@@ -305,7 +303,7 @@ export function useConversations() {
305
303
  userId: authUser.value?.id ?? "",
306
304
  title: "Nova conversa",
307
305
  threadSessionId: null,
308
- model: isTelaAgentMode.value ? null : options?.model ?? defaultChatModel,
306
+ model: null,
309
307
  appliedSettingsAt: null,
310
308
  appliedSettingsSnapshot: null,
311
309
  telaAgentId: embedConfig?.telaAgentId.value ?? null,
@@ -320,8 +318,7 @@ export function useConversations() {
320
318
  const conversation = await $fetch(
321
319
  chatApi.path("/conversations"),
322
320
  chatApi.withChatHeaders({
323
- method: "POST",
324
- body: !isTelaAgentMode.value && options?.model ? { model: options.model } : void 0
321
+ method: "POST"
325
322
  })
326
323
  );
327
324
  upsertConversationInLoadedBuckets(conversation, requestRuntimeScope, optimisticConversation.id);
@@ -18,7 +18,6 @@ import { useEmbedConfig } from "../composables/embed-config";
18
18
  import { useFileDrop } from "../../files/composables/file-drop";
19
19
  import { useFilePreviewPanel } from "../../files/composables/file-preview-panel";
20
20
  import { usePendingConversationGroup } from "../../conversations/composables/pending-conversation-group";
21
- import { useSelectedModel } from "../../messages/composables/selected-model";
22
21
  import { useStatusToast } from "../../shared/composables/status-toast";
23
22
  import { useTelaAgentMetadata } from "../composables/tela-agent-metadata";
24
23
  import { useWorkspaceMembers } from "../../workspace/composables/workspace-members";
@@ -93,15 +92,6 @@ const {
93
92
  startPolling,
94
93
  clearConversation
95
94
  } = useChat();
96
- const conversationModelTarget = computed(() => {
97
- if (!currentConversation.value)
98
- return null;
99
- return {
100
- id: currentConversation.value.id,
101
- model: currentConversation.value.model
102
- };
103
- });
104
- const selectedModel = useSelectedModel(conversationModelTarget);
105
95
  const conversationIdRef = computed(() => currentConversation.value?.id ?? null);
106
96
  const { total, files: conversationFiles } = useConversationFiles(conversationIdRef);
107
97
  const filesCount = computed(() => total.value);
@@ -289,10 +279,10 @@ const conversationCreator = computed(
289
279
  getMember
290
280
  })
291
281
  );
292
- async function handleSend(content, files, model, agentInputs) {
282
+ async function handleSend(content, files, agentInputs) {
293
283
  let createdConversationId = null;
294
284
  if (!activeConversationId.value || !currentConversation.value) {
295
- const conversation = await createConversation(isTelaAgentMode.value ? void 0 : { model: model ?? selectedModel.value });
285
+ const conversation = await createConversation();
296
286
  if (!conversation)
297
287
  return;
298
288
  const groupId = pendingConversationGroupId.value;
@@ -307,7 +297,7 @@ async function handleSend(content, files, model, agentInputs) {
307
297
  }
308
298
  if (!currentConversation.value)
309
299
  return;
310
- const sendPromise = sendMessage(content, files.length > 0 ? files : void 0, model, agentInputs);
300
+ const sendPromise = sendMessage(content, files.length > 0 ? files : void 0, agentInputs);
311
301
  if (createdConversationId) {
312
302
  updateConversationId(createdConversationId);
313
303
  }
@@ -475,7 +465,6 @@ async function handleDelete() {
475
465
  v-if="isMobile"
476
466
  v-model:drawer-open="drawerOpen"
477
467
  v-model:edit-title="editTitle"
478
- v-model:model="selectedModel"
479
468
  v-model:workspace-sheet-open="workspaceSheetOpen"
480
469
  :current-conversation="currentConversation"
481
470
  :display-title="displayTitle"
@@ -495,10 +484,8 @@ async function handleDelete() {
495
484
  :is-editing="isEditing"
496
485
  :loading="loading"
497
486
  :messages="messages"
498
- :allow-model-selection="!isTelaAgentMode"
499
487
  :agent-input-schema="visibleTelaAgentInputSchema"
500
488
  :agent-input-schema-loading="visibleTelaAgentInputSchemaLoading"
501
- :show-model-selector="resolvedFeatures.showModelSelector"
502
489
  :show-cancel-button="resolvedFeatures.showCancelButton"
503
490
  :show-debug-option="resolvedFeatures.showDebugOption"
504
491
  :show-outdated-badge="showOutdatedBadge"
@@ -531,12 +518,9 @@ async function handleDelete() {
531
518
  loading
532
519
  />
533
520
  <ChatMessageInput
534
- v-model:model="selectedModel"
535
521
  :disabled="true"
536
- :allow-model-selection="!isTelaAgentMode"
537
522
  :agent-input-schema="visibleTelaAgentInputSchema"
538
523
  :agent-input-schema-loading="visibleTelaAgentInputSchemaLoading"
539
- :show-model-selector="resolvedFeatures.showModelSelector"
540
524
  :show-cancel-button="resolvedFeatures.showCancelButton"
541
525
  />
542
526
  </template>
@@ -556,7 +540,6 @@ async function handleDelete() {
556
540
  </div>
557
541
  <ChatMessageInput
558
542
  ref="messageInputRef"
559
- v-model:model="selectedModel"
560
543
  :disabled="hasPendingMessage"
561
544
  :loading="hasPendingMessage"
562
545
  :creator-name="currentUser?.name ?? void 0"
@@ -565,10 +548,8 @@ async function handleDelete() {
565
548
  :messages="messages"
566
549
  :conversation-files="conversationFiles"
567
550
  :workspace-settings="effectiveWorkspaceSettings"
568
- :allow-model-selection="!isTelaAgentMode"
569
551
  :agent-input-schema="visibleTelaAgentInputSchema"
570
552
  :agent-input-schema-loading="visibleTelaAgentInputSchemaLoading"
571
- :show-model-selector="resolvedFeatures.showModelSelector"
572
553
  :show-cancel-button="resolvedFeatures.showCancelButton"
573
554
  centered
574
555
  @send="handleSend"
@@ -583,7 +564,6 @@ async function handleDelete() {
583
564
  />
584
565
  <ChatMessageInput
585
566
  ref="messageInputRef"
586
- v-model:model="selectedModel"
587
567
  :disabled="hasPendingMessage"
588
568
  :loading="hasPendingMessage"
589
569
  :creator-name="currentUser?.name ?? void 0"
@@ -592,10 +572,8 @@ async function handleDelete() {
592
572
  :messages="messages"
593
573
  :conversation-files="conversationFiles"
594
574
  :workspace-settings="effectiveWorkspaceSettings"
595
- :allow-model-selection="!isTelaAgentMode"
596
575
  :agent-input-schema="visibleTelaAgentInputSchema"
597
576
  :agent-input-schema-loading="visibleTelaAgentInputSchemaLoading"
598
- :show-model-selector="resolvedFeatures.showModelSelector"
599
577
  :show-cancel-button="resolvedFeatures.showCancelButton"
600
578
  has-disclaimer
601
579
  @send="handleSend"
@@ -685,12 +663,9 @@ async function handleDelete() {
685
663
  loading
686
664
  />
687
665
  <ChatMessageInput
688
- v-model:model="selectedModel"
689
666
  :disabled="true"
690
- :allow-model-selection="!isTelaAgentMode"
691
667
  :agent-input-schema="visibleTelaAgentInputSchema"
692
668
  :agent-input-schema-loading="visibleTelaAgentInputSchemaLoading"
693
- :show-model-selector="resolvedFeatures.showModelSelector"
694
669
  :show-cancel-button="resolvedFeatures.showCancelButton"
695
670
  />
696
671
  </template>
@@ -710,7 +685,6 @@ async function handleDelete() {
710
685
  </div>
711
686
  <ChatMessageInput
712
687
  ref="messageInputRef"
713
- v-model:model="selectedModel"
714
688
  :disabled="hasPendingMessage"
715
689
  :loading="hasPendingMessage"
716
690
  :creator-name="currentUser?.name ?? void 0"
@@ -719,10 +693,8 @@ async function handleDelete() {
719
693
  :messages="messages"
720
694
  :conversation-files="conversationFiles"
721
695
  :workspace-settings="effectiveWorkspaceSettings"
722
- :allow-model-selection="!isTelaAgentMode"
723
696
  :agent-input-schema="visibleTelaAgentInputSchema"
724
697
  :agent-input-schema-loading="visibleTelaAgentInputSchemaLoading"
725
- :show-model-selector="resolvedFeatures.showModelSelector"
726
698
  :show-cancel-button="resolvedFeatures.showCancelButton"
727
699
  centered
728
700
  @send="handleSend"
@@ -738,7 +710,6 @@ async function handleDelete() {
738
710
  />
739
711
  <ChatMessageInput
740
712
  ref="messageInputRef"
741
- v-model:model="selectedModel"
742
713
  :disabled="hasPendingMessage"
743
714
  :loading="hasPendingMessage"
744
715
  :creator-name="currentUser?.name ?? void 0"
@@ -747,10 +718,8 @@ async function handleDelete() {
747
718
  :messages="messages"
748
719
  :conversation-files="conversationFiles"
749
720
  :workspace-settings="effectiveWorkspaceSettings"
750
- :allow-model-selection="!isTelaAgentMode"
751
721
  :agent-input-schema="visibleTelaAgentInputSchema"
752
722
  :agent-input-schema-loading="visibleTelaAgentInputSchemaLoading"
753
- :show-model-selector="resolvedFeatures.showModelSelector"
754
723
  :show-cancel-button="resolvedFeatures.showCancelButton"
755
724
  has-disclaimer
756
725
  @send="handleSend"
@@ -826,7 +795,7 @@ async function handleDelete() {
826
795
  </div>
827
796
  <div flex="~ col" gap-4px w-full>
828
797
  <p text-14px font-580 text-gray-700 leading-18px>
829
- Thread Session Id (Agent API)
798
+ Thread Session Id
830
799
  </p>
831
800
  <div
832
801
  px-12px py-10px
@@ -1,9 +1,12 @@
1
1
  import { type ChatActionPayload } from '../../messages/composables/chat-action.js';
2
+ import { type MessageFeedbackPayload } from '../../messages/composables/chat-feedback.js';
2
3
  declare const __VLS_export: import("vue").DefineComponent<import("../types.js").DefaultChatEmbedProps | import("../types.js").TelaAgentChatEmbedProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
4
  "update:conversationId": (value: string | null) => any;
5
+ messageFeedback: (payload: MessageFeedbackPayload) => any;
4
6
  action: (payload: ChatActionPayload) => any;
5
7
  }, string, import("vue").PublicProps, Readonly<import("../types.js").DefaultChatEmbedProps | import("../types.js").TelaAgentChatEmbedProps> & Readonly<{
6
8
  "onUpdate:conversationId"?: ((value: string | null) => any) | undefined;
9
+ onMessageFeedback?: ((payload: MessageFeedbackPayload) => any) | undefined;
7
10
  onAction?: ((payload: ChatActionPayload) => any) | undefined;
8
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
12
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { useChatAuth } from "#chat-auth";
3
3
  import { provideChatAction } from "../../messages/composables/chat-action";
4
+ import { provideMessageFeedback } from "../../messages/composables/chat-feedback";
4
5
  import { provideChatRequestContext } from "../../shared/composables/chat-request-context";
5
6
  import { provideEmbedConfig, useEmbedConfig } from "../composables/embed-config";
6
7
  import { normalizeConversationScope, normalizeTelaAgentId, resolveConversationScopeKeySegment } from "../../conversations/scope";
@@ -16,13 +17,15 @@ const props = defineProps({
16
17
  loadingMessagesMode: { type: [String, null], required: false },
17
18
  customComponents: { type: Object, required: false },
18
19
  customHtmlTags: { type: Array, required: false },
20
+ feedbackConfig: { type: [Object, null], required: false },
21
+ messageFeedback: { type: [Object, null], required: false },
19
22
  telaAgentId: { type: null, required: false },
20
23
  telaAgentInputs: { type: null, required: false },
21
24
  workspaceSettings: { type: null, required: false },
22
25
  user: { type: null, required: false },
23
26
  features: { type: Object, required: false }
24
27
  });
25
- const emit = defineEmits(["update:conversationId", "action"]);
28
+ const emit = defineEmits(["update:conversationId", "action", "messageFeedback"]);
26
29
  const parentEmbedConfig = useEmbedConfig();
27
30
  const { activeOrganization } = useChatAuth();
28
31
  const workspaceId = computed(() => activeOrganization.value?.id?.trim() ?? "");
@@ -42,7 +45,9 @@ provideEmbedConfig({
42
45
  loadingMessages: computed(() => props.loadingMessages),
43
46
  loadingMessagesMode: computed(() => props.loadingMessagesMode),
44
47
  customComponents: computed(() => props.customComponents),
45
- customHtmlTags: computed(() => props.customHtmlTags)
48
+ customHtmlTags: computed(() => props.customHtmlTags),
49
+ feedbackConfig: computed(() => props.feedbackConfig),
50
+ messageFeedback: computed(() => props.messageFeedback)
46
51
  }, { syncGlobal: !parentEmbedConfig });
47
52
  provideChatRequestContext({
48
53
  workspaceId,
@@ -71,6 +76,9 @@ if (import.meta.dev) {
71
76
  provideChatAction((payload) => {
72
77
  emit("action", payload);
73
78
  });
79
+ provideMessageFeedback((payload) => {
80
+ emit("messageFeedback", payload);
81
+ });
74
82
  </script>
75
83
 
76
84
  <template>
@@ -1,9 +1,12 @@
1
1
  import { type ChatActionPayload } from '../../messages/composables/chat-action.js';
2
+ import { type MessageFeedbackPayload } from '../../messages/composables/chat-feedback.js';
2
3
  declare const __VLS_export: import("vue").DefineComponent<import("../types.js").DefaultChatEmbedProps | import("../types.js").TelaAgentChatEmbedProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
4
  "update:conversationId": (value: string | null) => any;
5
+ messageFeedback: (payload: MessageFeedbackPayload) => any;
4
6
  action: (payload: ChatActionPayload) => any;
5
7
  }, string, import("vue").PublicProps, Readonly<import("../types.js").DefaultChatEmbedProps | import("../types.js").TelaAgentChatEmbedProps> & Readonly<{
6
8
  "onUpdate:conversationId"?: ((value: string | null) => any) | undefined;
9
+ onMessageFeedback?: ((payload: MessageFeedbackPayload) => any) | undefined;
7
10
  onAction?: ((payload: ChatActionPayload) => any) | undefined;
8
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
12
  declare const _default: typeof __VLS_export;
@@ -8,11 +8,11 @@ type __VLS_Props = {
8
8
  getProjectNameForWorkstation: (w: TelaWorkstation) => string;
9
9
  };
10
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
- toggle: (sourceId: string) => any;
12
11
  "update:searchQuery": (value: string) => any;
12
+ toggle: (sourceId: string) => any;
13
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
- onToggle?: ((sourceId: string) => any) | undefined;
15
14
  "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
15
+ onToggle?: ((sourceId: string) => any) | undefined;
16
16
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
17
  declare const _default: typeof __VLS_export;
18
18
  export default _default;
@@ -8,11 +8,11 @@ type __VLS_Props = {
8
8
  getProjectNameForWorkstation: (w: TelaWorkstation) => string;
9
9
  };
10
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
- toggle: (sourceId: string) => any;
12
11
  "update:searchQuery": (value: string) => any;
12
+ toggle: (sourceId: string) => any;
13
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
- onToggle?: ((sourceId: string) => any) | undefined;
15
14
  "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
15
+ onToggle?: ((sourceId: string) => any) | undefined;
16
16
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
17
  declare const _default: typeof __VLS_export;
18
18
  export default _default;
@@ -11,13 +11,15 @@ const props = defineProps({
11
11
  loadingMessagesMode: { type: [String, null], required: false },
12
12
  customComponents: { type: Object, required: false },
13
13
  customHtmlTags: { type: Array, required: false },
14
+ feedbackConfig: { type: [Object, null], required: false },
15
+ messageFeedback: { type: [Object, null], required: false },
14
16
  telaAgentId: { type: null, required: false },
15
17
  telaAgentInputs: { type: null, required: false },
16
18
  workspaceSettings: { type: null, required: false },
17
19
  user: { type: null, required: false },
18
20
  features: { type: Object, required: false }
19
21
  });
20
- defineEmits(["update:conversationId", "action"]);
22
+ defineEmits(["update:conversationId", "action", "messageFeedback"]);
21
23
  const hideSettings = computed(() => props.hideSettings ?? false);
22
24
  </script>
23
25
 
@@ -37,8 +39,11 @@ const hideSettings = computed(() => props.hideSettings ?? false);
37
39
  :loading-messages-mode="loadingMessagesMode"
38
40
  :custom-components="customComponents"
39
41
  :custom-html-tags="customHtmlTags"
42
+ :feedback-config="feedbackConfig"
43
+ :message-feedback="messageFeedback"
40
44
  @update:conversation-id="$emit('update:conversationId', $event)"
41
45
  @action="$emit('action', $event)"
46
+ @message-feedback="$emit('messageFeedback', $event)"
42
47
  />
43
48
  <ChatEmbed
44
49
  v-else
@@ -55,7 +60,10 @@ const hideSettings = computed(() => props.hideSettings ?? false);
55
60
  :loading-messages-mode="loadingMessagesMode"
56
61
  :custom-components="customComponents"
57
62
  :custom-html-tags="customHtmlTags"
63
+ :feedback-config="feedbackConfig"
64
+ :message-feedback="messageFeedback"
58
65
  @update:conversation-id="$emit('update:conversationId', $event)"
59
66
  @action="$emit('action', $event)"
67
+ @message-feedback="$emit('messageFeedback', $event)"
60
68
  />
61
69
  </template>
@@ -1,7 +1,6 @@
1
1
  import type { DeepReadonly } from 'vue';
2
2
  import type { Conversation, ConversationWithMessages, Message } from '../../../types/schemas/chat/conversations.js';
3
3
  import type { ConversationFile } from '../../../types/schemas/chat/files.js';
4
- import type { ChatModel } from '../../../types/schemas/chat/models.js';
5
4
  import type { TopbarTab } from '../../../types/schemas/chat/ui.js';
6
5
  import type { WorkspaceSettingsResponse as WorkspaceSettings } from '../../../types/schemas/chat/workspace-settings.js';
7
6
  import type { TelaAgentInputVariable } from '../../../types/schemas/integrations/tela-agent-api.js';
@@ -13,7 +12,6 @@ type __VLS_Props = {
13
12
  currentUser?: ChatActor | null;
14
13
  activeTab: TopbarTab;
15
14
  activeConversationId: string | null;
16
- allowModelSelection?: boolean;
17
15
  agentInputSchema?: readonly TelaAgentInputVariable[] | null;
18
16
  agentInputSchemaLoading?: boolean;
19
17
  conversations: DeepReadonly<Conversation[]>;
@@ -30,10 +28,8 @@ type __VLS_Props = {
30
28
  isEditing: boolean;
31
29
  loading?: boolean;
32
30
  messages: Message[];
33
- model: ChatModel;
34
31
  showCancelButton?: boolean;
35
32
  showDebugOption?: boolean;
36
- showModelSelector?: boolean;
37
33
  showOutdatedBadge?: boolean;
38
34
  showOutdatedBanner?: boolean;
39
35
  showUsageTab?: boolean;
@@ -58,9 +54,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
58
54
  copyLink: () => any;
59
55
  selectConversation: (id: string) => any;
60
56
  cancel: () => any;
61
- send: (content: string, files: FileUploadInput[], model?: any, agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
62
57
  settings: () => any;
63
- "update:model": (value: ChatModel) => any;
58
+ send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
64
59
  debug: () => any;
65
60
  tabChange: (tab: TopbarTab) => any;
66
61
  newConversation: (groupId?: string | null | undefined) => any;
@@ -80,9 +75,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
80
75
  onCopyLink?: (() => any) | undefined;
81
76
  onSelectConversation?: ((id: string) => any) | undefined;
82
77
  onCancel?: (() => any) | undefined;
83
- onSend?: ((content: string, files: FileUploadInput[], model?: any, agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
84
78
  onSettings?: (() => any) | undefined;
85
- "onUpdate:model"?: ((value: ChatModel) => any) | undefined;
79
+ onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
86
80
  onDebug?: (() => any) | undefined;
87
81
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
88
82
  onNewConversation?: ((groupId?: string | null | undefined) => any) | undefined;
@@ -17,7 +17,6 @@ const props = defineProps({
17
17
  currentUser: { type: [Object, null], required: false },
18
18
  activeTab: { type: null, required: true },
19
19
  activeConversationId: { type: [String, null], required: true },
20
- allowModelSelection: { type: Boolean, required: false },
21
20
  agentInputSchema: { type: [Array, null], required: false },
22
21
  agentInputSchemaLoading: { type: Boolean, required: false },
23
22
  conversations: { type: null, required: true },
@@ -34,10 +33,8 @@ const props = defineProps({
34
33
  isEditing: { type: Boolean, required: true },
35
34
  loading: { type: Boolean, required: false },
36
35
  messages: { type: Array, required: true },
37
- model: { type: null, required: true },
38
36
  showCancelButton: { type: Boolean, required: false },
39
37
  showDebugOption: { type: Boolean, required: false },
40
- showModelSelector: { type: Boolean, required: false },
41
38
  showOutdatedBadge: { type: Boolean, required: false },
42
39
  showOutdatedBanner: { type: Boolean, required: false },
43
40
  showUsageTab: { type: Boolean, required: false },
@@ -46,7 +43,7 @@ const props = defineProps({
46
43
  workspaceSettings: { type: null, required: false },
47
44
  workspaceSheetOpen: { type: Boolean, required: true }
48
45
  });
49
- const emit = defineEmits(["cancel", "cancelEditing", "copyLink", "debug", "delete", "dismissOutdatedBanner", "duplicate", "export", "newConversation", "rename", "saveTitle", "selectConversation", "send", "settings", "signout", "switchWorkspace", "tabChange", "update:drawerOpen", "update:editTitle", "update:model", "update:workspaceSheetOpen"]);
46
+ const emit = defineEmits(["cancel", "cancelEditing", "copyLink", "debug", "delete", "dismissOutdatedBanner", "duplicate", "export", "newConversation", "rename", "saveTitle", "selectConversation", "send", "settings", "signout", "switchWorkspace", "tabChange", "update:drawerOpen", "update:editTitle", "update:workspaceSheetOpen"]);
50
47
  const renameInputRef = ref(null);
51
48
  const homeInputRef = ref(null);
52
49
  const outdatedSettingsSheetOpen = ref(false);
@@ -56,10 +53,6 @@ const editTitleModel = computed({
56
53
  get: () => props.editTitle,
57
54
  set: (value) => emit("update:editTitle", value)
58
55
  });
59
- const selectedModel = computed({
60
- get: () => props.model,
61
- set: (value) => emit("update:model", value)
62
- });
63
56
  watch(() => props.isEditing, async (editing) => {
64
57
  if (!editing)
65
58
  return;
@@ -227,7 +220,6 @@ function startNewConversationFromOutdatedSettings() {
227
220
  <div px-14px pb-12px>
228
221
  <ChatMessageInput
229
222
  ref="homeInputRef"
230
- v-model:model="selectedModel"
231
223
  :disabled="hasPendingMessage"
232
224
  :loading="hasPendingMessage"
233
225
  :creator-name="currentUser?.name ?? void 0"
@@ -236,13 +228,11 @@ function startNewConversationFromOutdatedSettings() {
236
228
  :messages="messages"
237
229
  :conversation-files="conversationFiles"
238
230
  :workspace-settings="workspaceSettings"
239
- :allow-model-selection="allowModelSelection"
240
231
  :agent-input-schema="agentInputSchema"
241
232
  :agent-input-schema-loading="agentInputSchemaLoading"
242
- :show-model-selector="showModelSelector"
243
233
  :show-cancel-button="showCancelButton"
244
234
  centered
245
- @send="(content, files, model, agentInputs) => emit('send', content, files, model, agentInputs)"
235
+ @send="(content, files, agentInputs) => emit('send', content, files, agentInputs)"
246
236
  @cancel="emit('cancel')"
247
237
  />
248
238
  </div>