@meistrari/chat-nuxt 1.3.0 → 1.5.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 (98) hide show
  1. package/README.md +51 -16
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +12 -8
  4. package/dist/runtime/components/MeistrariChatEmbed.d.vue.ts +5 -16
  5. package/dist/runtime/components/MeistrariChatEmbed.vue +28 -5
  6. package/dist/runtime/components/MeistrariChatEmbed.vue.d.ts +5 -16
  7. package/dist/runtime/components/app-markdown-render.d.vue.ts +3 -1
  8. package/dist/runtime/components/app-markdown-render.vue +15 -4
  9. package/dist/runtime/components/app-markdown-render.vue.d.ts +3 -1
  10. package/dist/runtime/components/chat/message-bubble.vue +10 -2
  11. package/dist/runtime/components/chat/message-input.d.vue.ts +30 -4
  12. package/dist/runtime/components/chat/message-input.vue +268 -24
  13. package/dist/runtime/components/chat/message-input.vue.d.ts +30 -4
  14. package/dist/runtime/composables/useChat.d.ts +3 -5
  15. package/dist/runtime/composables/useChat.js +24 -3
  16. package/dist/runtime/composables/useChatAction.d.ts +10 -0
  17. package/dist/runtime/composables/useChatAction.js +12 -0
  18. package/dist/runtime/composables/useChatApi.js +4 -0
  19. package/dist/runtime/composables/useConversations.js +8 -2
  20. package/dist/runtime/composables/useEmbedConfig.d.ts +12 -2
  21. package/dist/runtime/composables/useEmbedConfig.js +24 -3
  22. package/dist/runtime/composables/useFeatureFlags.d.ts +1 -2
  23. package/dist/runtime/composables/useTelaAgentMetadata.d.ts +8 -0
  24. package/dist/runtime/composables/useTelaAgentMetadata.js +65 -0
  25. package/dist/runtime/composables/useWorkspaceSettings.d.ts +1 -19
  26. package/dist/runtime/embed/components/ChatConfigurationModal.d.vue.ts +1 -1
  27. package/dist/runtime/embed/components/ChatConfigurationModal.vue.d.ts +1 -1
  28. package/dist/runtime/embed/components/ChatEmbed.d.vue.ts +6 -21
  29. package/dist/runtime/embed/components/ChatEmbed.vue +44 -11
  30. package/dist/runtime/embed/components/ChatEmbed.vue.d.ts +6 -21
  31. package/dist/runtime/embed/components/ChatEmbedInner.vue +36 -12
  32. package/dist/runtime/plugins/markstream.d.ts +1 -1
  33. package/dist/runtime/plugins/markstream.js +1 -1
  34. package/dist/runtime/server/api/conversations/[id]/cancel.post.d.ts +1 -1
  35. package/dist/runtime/server/api/conversations/[id]/cancel.post.js +37 -17
  36. package/dist/runtime/server/api/conversations/[id]/clear.post.js +28 -13
  37. package/dist/runtime/server/api/conversations/[id]/duplicate.post.js +11 -13
  38. package/dist/runtime/server/api/conversations/[id]/files.get.js +5 -7
  39. package/dist/runtime/server/api/conversations/[id]/index.delete.js +13 -12
  40. package/dist/runtime/server/api/conversations/[id]/index.get.js +6 -13
  41. package/dist/runtime/server/api/conversations/[id]/index.patch.js +11 -10
  42. package/dist/runtime/server/api/conversations/[id]/messages/[messageId]/retry.post.js +46 -80
  43. package/dist/runtime/server/api/conversations/[id]/messages/index.get.d.ts +1 -14
  44. package/dist/runtime/server/api/conversations/[id]/messages/index.get.js +81 -187
  45. package/dist/runtime/server/api/conversations/[id]/messages/index.post.js +68 -83
  46. package/dist/runtime/server/api/conversations/[id]/usage.get.js +4 -8
  47. package/dist/runtime/server/api/conversations/generate-title.post.js +4 -3
  48. package/dist/runtime/server/api/conversations/index.get.js +5 -4
  49. package/dist/runtime/server/api/conversations/index.post.js +5 -4
  50. package/dist/runtime/server/api/tela/agents/[id].get.d.ts +6 -0
  51. package/dist/runtime/server/api/tela/agents/[id].get.js +25 -0
  52. package/dist/runtime/server/api/workspace/settings.patch.js +1 -1
  53. package/dist/runtime/server/db/index.js +62 -0
  54. package/dist/runtime/server/db/schema/conversations.d.ts +17 -0
  55. package/dist/runtime/server/db/schema/conversations.js +3 -1
  56. package/dist/runtime/server/db/schema/workspace-settings.d.ts +1 -1
  57. package/dist/runtime/server/utils/agent-api.d.ts +1 -1
  58. package/dist/runtime/server/utils/agent-api.js +2 -5
  59. package/dist/runtime/server/utils/chat-context.d.ts +5 -0
  60. package/dist/runtime/server/utils/chat-context.js +20 -0
  61. package/dist/runtime/server/utils/chat-workspace-settings.d.ts +2 -1
  62. package/dist/runtime/server/utils/chat-workspace-settings.js +10 -1
  63. package/dist/runtime/server/utils/conversation-agent-turn.d.ts +39 -0
  64. package/dist/runtime/server/utils/conversation-agent-turn.js +170 -0
  65. package/dist/runtime/server/utils/conversation-message-files.d.ts +10 -0
  66. package/dist/runtime/server/utils/conversation-message-files.js +77 -0
  67. package/dist/runtime/server/utils/conversation-message-sync.d.ts +31 -0
  68. package/dist/runtime/server/utils/conversation-message-sync.js +132 -0
  69. package/dist/runtime/server/utils/conversation-scope.d.ts +2 -0
  70. package/dist/runtime/server/utils/conversation-scope.js +12 -0
  71. package/dist/runtime/server/utils/tela-agent-api.d.ts +29 -0
  72. package/dist/runtime/server/utils/tela-agent-api.js +107 -0
  73. package/dist/runtime/server/utils/tela-agent-session.d.ts +48 -0
  74. package/dist/runtime/server/utils/tela-agent-session.js +350 -0
  75. package/dist/runtime/types/embed.d.ts +29 -0
  76. package/dist/runtime/types/embed.js +0 -0
  77. package/dist/runtime/types/tela-agent.d.ts +243 -0
  78. package/dist/runtime/types/tela-agent.js +98 -0
  79. package/dist/runtime/types/workspace-settings-data.d.ts +19 -0
  80. package/dist/runtime/types/workspace-settings-data.js +0 -0
  81. package/dist/runtime/types/workspace-settings.d.ts +1 -1
  82. package/dist/runtime/utils/agent-input-readiness.d.ts +14 -0
  83. package/dist/runtime/utils/agent-input-readiness.js +15 -0
  84. package/dist/runtime/utils/custom-markdown-components.d.ts +9 -0
  85. package/dist/runtime/utils/custom-markdown-components.js +54 -0
  86. package/dist/runtime/utils/features.d.ts +9 -0
  87. package/dist/runtime/utils/features.js +5 -4
  88. package/dist/runtime/utils/file.js +46 -7
  89. package/dist/runtime/utils/markdown-nodes.d.ts +1 -0
  90. package/dist/runtime/utils/markdown-nodes.js +6 -0
  91. package/dist/runtime/utils/tela-chat.d.ts +6 -0
  92. package/dist/runtime/utils/tela-chat.js +12 -1
  93. package/drizzle/0014_faulty_lake.sql +2 -0
  94. package/drizzle/meta/0014_snapshot.json +732 -0
  95. package/drizzle/meta/_journal.json +7 -0
  96. package/package.json +1 -1
  97. package/dist/runtime/types/feature-flags.d.ts +0 -7
  98. package/dist/runtime/types/feature-flags.js +0 -6
@@ -5,10 +5,21 @@ export function normalizeConversationId(value) {
5
5
  const normalized = value?.trim();
6
6
  return normalized || null;
7
7
  }
8
+ export function normalizeTelaAgentId(value) {
9
+ const normalized = value?.trim();
10
+ return normalized || null;
11
+ }
12
+ export function resolveChatStateScope(workspaceId, telaAgentId) {
13
+ const normalizedWorkspaceId = workspaceId?.trim() || "default";
14
+ const normalizedTelaAgentId = normalizeTelaAgentId(telaAgentId);
15
+ return normalizedTelaAgentId ? `${normalizedWorkspaceId}:tela-agent:${normalizedTelaAgentId}` : `${normalizedWorkspaceId}:default-chat`;
16
+ }
8
17
  export function resolveChatFeatures(features) {
9
18
  return {
10
19
  showUsageTab: features?.showUsageTab ?? false,
11
- showDebugOption: features?.showDebugOption ?? false
20
+ showDebugOption: features?.showDebugOption ?? false,
21
+ showModelSelector: features?.showModelSelector ?? false,
22
+ showCancelButton: features?.showCancelButton ?? false
12
23
  };
13
24
  }
14
25
  export function resolveConversationCreator(conversationUserId, options) {
@@ -0,0 +1,2 @@
1
+ ALTER TABLE "chat"."conversations" ADD COLUMN "tela_agent_id" text;--> statement-breakpoint
2
+ CREATE INDEX "idx_conversations_workspace_tela_agent_updated" ON "chat"."conversations" USING btree ("workspace_id","tela_agent_id","updated_at");