@meistrari/chat-nuxt 3.9.1 → 3.10.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 (87) hide show
  1. package/README.md +50 -440
  2. package/dist/module.d.mts +1 -1
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +56 -3
  5. package/dist/runtime/assets/css/markstream.css +1 -1
  6. package/dist/runtime/conversations/components/chat-conversation-creator-filter.vue +11 -67
  7. package/dist/runtime/conversations/components/chat-conversation-item.d.vue.ts +2 -1
  8. package/dist/runtime/conversations/components/chat-conversation-item.vue +29 -33
  9. package/dist/runtime/conversations/components/chat-conversation-item.vue.d.ts +2 -1
  10. package/dist/runtime/conversations/components/chat-conversation-list.d.vue.ts +0 -1
  11. package/dist/runtime/conversations/components/chat-conversation-list.vue +117 -158
  12. package/dist/runtime/conversations/components/chat-conversation-list.vue.d.ts +0 -1
  13. package/dist/runtime/conversations/components/chat-conversation-new-group-button.vue +34 -73
  14. package/dist/runtime/conversations/components/chat-conversation-search.vue +1 -21
  15. package/dist/runtime/conversations/components/chat-widget-history-list.d.vue.ts +12 -0
  16. package/dist/runtime/conversations/components/chat-widget-history-list.vue +27 -0
  17. package/dist/runtime/conversations/components/chat-widget-history-list.vue.d.ts +12 -0
  18. package/dist/runtime/conversations/composables/conversation-groups.d.ts +1 -0
  19. package/dist/runtime/conversations/composables/conversation-groups.js +2 -0
  20. package/dist/runtime/conversations/composables/conversation-item.js +4 -4
  21. package/dist/runtime/conversations/composables/conversation-list.js +14 -5
  22. package/dist/runtime/embed/components/chat-configuration-modal.d.vue.ts +3 -3
  23. package/dist/runtime/embed/components/chat-configuration-modal.vue.d.ts +3 -3
  24. package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +6 -3
  25. package/dist/runtime/embed/components/chat-embed-inner.vue +365 -152
  26. package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +6 -3
  27. package/dist/runtime/embed/components/chat-embed.d.vue.ts +31 -4
  28. package/dist/runtime/embed/components/chat-embed.vue +10 -4
  29. package/dist/runtime/embed/components/chat-embed.vue.d.ts +31 -4
  30. package/dist/runtime/embed/components/chat-topbar.vue +83 -85
  31. package/dist/runtime/embed/components/meistrari-chat-embed.d.vue.ts +5 -3
  32. package/dist/runtime/embed/components/meistrari-chat-embed.vue +118 -57
  33. package/dist/runtime/embed/components/meistrari-chat-embed.vue.d.ts +5 -3
  34. package/dist/runtime/embed/components/mobile/chat-mobile-drawer.d.vue.ts +0 -1
  35. package/dist/runtime/embed/components/mobile/chat-mobile-drawer.vue +2 -45
  36. package/dist/runtime/embed/components/mobile/chat-mobile-drawer.vue.d.ts +0 -1
  37. package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.d.vue.ts +9 -5
  38. package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.vue +14 -25
  39. package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.vue.d.ts +9 -5
  40. package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +6 -6
  41. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +2 -3
  42. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +6 -6
  43. package/dist/runtime/embed/feature-config.d.ts +7 -0
  44. package/dist/runtime/embed/types.d.ts +47 -8
  45. package/dist/runtime/files/icons.d.ts +1 -1
  46. package/dist/runtime/files/icons.js +1 -1
  47. package/dist/runtime/messages/components/chat-mention-dropdown.d.vue.ts +6 -1
  48. package/dist/runtime/messages/components/chat-mention-dropdown.vue +46 -22
  49. package/dist/runtime/messages/components/chat-mention-dropdown.vue.d.ts +6 -1
  50. package/dist/runtime/messages/components/chat-message-bubble.vue +53 -71
  51. package/dist/runtime/messages/components/chat-message-feedback.vue +25 -229
  52. package/dist/runtime/messages/components/chat-message-input.vue +176 -134
  53. package/dist/runtime/messages/components/chat-message-list.d.vue.ts +6 -0
  54. package/dist/runtime/messages/components/chat-message-list.vue +27 -23
  55. package/dist/runtime/messages/components/chat-message-list.vue.d.ts +6 -0
  56. package/dist/runtime/messages/components/chat-model-selector.vue +10 -22
  57. package/dist/runtime/messages/components/reasoning/chat-reasoning-message.vue +2 -3
  58. package/dist/runtime/messages/components/reasoning/chat-reasoning-thought.vue +60 -69
  59. package/dist/runtime/messages/components/reasoning/chat-thinking-indicator.vue +3 -9
  60. package/dist/runtime/messages/components/widgets/chat-bash-widget.vue +3 -12
  61. package/dist/runtime/messages/components/widgets/chat-doc-sdk-widget.vue +3 -12
  62. package/dist/runtime/messages/components/widgets/chat-generic-tool-widget.vue +3 -12
  63. package/dist/runtime/messages/components/widgets/chat-grep-widget.vue +7 -17
  64. package/dist/runtime/messages/components/widgets/chat-read-widget.vue +7 -17
  65. package/dist/runtime/messages/components/widgets/chat-tela-skill-widget.vue +4 -13
  66. package/dist/runtime/messages/components/widgets/chat-thinking-widget.vue +11 -22
  67. package/dist/runtime/messages/components/widgets/chat-web-search-widget.vue +13 -40
  68. package/dist/runtime/messages/components/widgets/chat-workstation-query-widget.vue +52 -65
  69. package/dist/runtime/messages/components/widgets/chat-write-widget.vue +8 -18
  70. package/dist/runtime/messages/composables/mention-autocomplete.js +4 -0
  71. package/dist/runtime/messages/message-reasoning.js +4 -0
  72. package/dist/runtime/messages/message-state.js +1 -0
  73. package/dist/runtime/public/files/generic.svg +2 -5
  74. package/dist/runtime/public/files/image.svg +2 -1
  75. package/dist/runtime/types/embed.d.ts +1 -1
  76. package/dist/runtime/types/schemas/chat/conversations.d.ts +2 -0
  77. package/dist/runtime/types/schemas/chat/conversations.js +3 -0
  78. package/dist/runtime/types/schemas/chat/messages.d.ts +4 -0
  79. package/dist/runtime/types/schemas/chat/messages.js +7 -0
  80. package/dist/types.d.mts +1 -1
  81. package/package.json +5 -4
  82. package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.d.vue.ts +0 -23
  83. package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.vue +0 -75
  84. package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.vue.d.ts +0 -23
  85. package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.d.vue.ts +0 -37
  86. package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.vue +0 -125
  87. package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.vue.d.ts +0 -37
@@ -90,23 +90,13 @@ const hasMoreLines = computed(() => {
90
90
  </script>
91
91
 
92
92
  <template>
93
- <div class="bg-subtle rounded-16px border border-gray-200">
94
- <!-- Header -->
95
- <div class="px-16px py-16px flex items-center justify-between">
96
- <div class="flex-1 min-w-0">
97
- <h3 class="text-16px font-580 leading-20px tracking-[-0.3px] text-primary truncate">
98
- Write
99
- </h3>
100
- <p class="text-12px text-secondary truncate mt-2px">
101
- {{ fileName }}
102
- <span v-if="parentDir" class="opacity-60">em {{ parentDir }}</span>
103
- </p>
104
- </div>
105
- <TelaStatus :variant="statusVariant" :label="statusLabel" />
106
- </div>
93
+ <TelaChatWidgetCard title="Write" :status-variant="statusVariant" :status-label="statusLabel">
94
+ <template #subtitle>
95
+ {{ fileName }}
96
+ <span v-if="parentDir" class="opacity-60">em {{ parentDir }}</span>
97
+ </template>
107
98
 
108
- <!-- Content -->
109
- <div v-if="toolResult" class="px-16px pb-16px space-y-16px">
99
+ <template v-if="toolResult">
110
100
  <!-- File path section -->
111
101
  <div>
112
102
  <div class="text-14px font-580 leading-16px tracking-[-0.15px] text-gray-700 mb-2">
@@ -156,8 +146,8 @@ const hasMoreLines = computed(() => {
156
146
  </p>
157
147
  </div>
158
148
  </div>
159
- </div>
160
- </div>
149
+ </template>
150
+ </TelaChatWidgetCard>
161
151
  </template>
162
152
 
163
153
  <style scoped>
@@ -27,6 +27,7 @@ export function useMentionAutocomplete(options) {
27
27
  const query = ref("");
28
28
  const highlightedIndex = ref(-1);
29
29
  const lastQuery = ref("");
30
+ const triggerCaretRect = ref(null);
30
31
  let triggerTextOffset = -1;
31
32
  const isOpen = computed(() => activeTrigger.value !== null);
32
33
  const filteredItems = computed(() => {
@@ -89,10 +90,12 @@ export function useMentionAutocomplete(options) {
89
90
  const mentionTrigger = findMentionTrigger(getTextBeforeCursor());
90
91
  if (!mentionTrigger) {
91
92
  activeTrigger.value = null;
93
+ triggerCaretRect.value = null;
92
94
  return;
93
95
  }
94
96
  activeTrigger.value = mentionTrigger.trigger;
95
97
  triggerTextOffset = mentionTrigger.offset;
98
+ triggerCaretRect.value = getCaretRangeAtOffset(triggerTextOffset)?.getBoundingClientRect() ?? null;
96
99
  if (mentionTrigger.query !== lastQuery.value) {
97
100
  highlightedIndex.value = -1;
98
101
  lastQuery.value = mentionTrigger.query;
@@ -314,6 +317,7 @@ ${varLines}
314
317
  isOpen,
315
318
  activeTrigger: readonly(activeTrigger),
316
319
  query: readonly(query),
320
+ triggerCaretRect: readonly(triggerCaretRect),
317
321
  filteredItems,
318
322
  highlightedIndex,
319
323
  handleKeydown,
@@ -54,6 +54,10 @@ function getParsedReasoningSteps(cache, messageId, reasoningData) {
54
54
  let parsedSteps = cache.bySignature.get(cacheKey);
55
55
  if (!parsedSteps) {
56
56
  parsedSteps = parseReasoningFromPolling(reasoningData);
57
+ for (const staleKey of cache.bySignature.keys()) {
58
+ if (staleKey.startsWith(`${messageId}:`))
59
+ cache.bySignature.delete(staleKey);
60
+ }
57
61
  cache.bySignature.set(cacheKey, parsedSteps);
58
62
  }
59
63
  cache.byReference.set(reasoningData, { messageId, parsedSteps });
@@ -36,6 +36,7 @@ export function beginAssistantMessageRetry(messages, messageId) {
36
36
  ...message,
37
37
  content: "",
38
38
  status: "pending",
39
+ failReason: null,
39
40
  reasoningData: null
40
41
  };
41
42
  })
@@ -1,7 +1,4 @@
1
1
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M0 8C0 5.19974 0 3.79961 0.544967 2.73005C1.02433 1.78924 1.78924 1.02433 2.73005 0.544967C3.79961 0 5.19974 0 8 0C10.8003 0 12.2004 0 13.27 0.544967C14.2108 1.02433 14.9757 1.78924 15.455 2.73005C16 3.79961 16 5.19974 16 8C16 10.8003 16 12.2004 15.455 13.27C14.9757 14.2108 14.2108 14.9757 13.27 15.455C12.2004 16 10.8003 16 8 16C5.19974 16 3.79961 16 2.73005 15.455C1.78924 14.9757 1.02433 14.2108 0.544967 13.27C0 12.2004 0 10.8003 0 8Z" fill="#DFE3E7"/>
3
- <rect x="3" y="4" width="10" height="1.2" rx="0.6" fill="#8B9399"/>
4
- <rect x="3" y="6.4" width="7" height="1.2" rx="0.6" fill="#8B9399" fill-opacity="0.7"/>
5
- <rect x="3" y="8.8" width="9" height="1.2" rx="0.6" fill="#8B9399" fill-opacity="0.5"/>
6
- <rect x="3" y="11.2" width="5" height="1.2" rx="0.6" fill="#8B9399" fill-opacity="0.3"/>
2
+ <path d="M0 8C0 5.19974 0 3.79961 0.544967 2.73005C1.02433 1.78924 1.78924 1.02433 2.73005 0.544967C3.79961 0 5.19974 0 8 0C10.8003 0 12.2004 0 13.27 0.544967C14.2108 1.02433 14.9757 1.78924 15.455 2.73005C16 3.79961 16 5.19974 16 8C16 10.8003 16 12.2004 15.455 13.27C14.9757 14.2108 14.2108 14.9757 13.27 15.455C12.2004 16 10.8003 16 8 16C5.19974 16 3.79961 16 2.73005 15.455C1.78924 14.9757 1.02433 14.2108 0.544967 13.27C0 12.2004 0 10.8003 0 8Z" fill="#A3A3A3"/>
3
+ <path d="M8.9375 3.8877L9.00781 3.89453C9.03116 3.89913 9.05407 3.90591 9.07617 3.91504C9.12018 3.93323 9.16065 3.95951 9.19434 3.99316L11.3818 6.18066C11.4155 6.21435 11.4418 6.25482 11.46 6.29883C11.4781 6.34281 11.4873 6.38991 11.4873 6.4375V11.4375C11.4873 11.6165 11.4166 11.7885 11.29 11.915C11.1635 12.0416 10.9915 12.1123 10.8125 12.1123H5.1875C5.00848 12.1123 4.83655 12.0416 4.70996 11.915C4.58337 11.7885 4.5127 11.6165 4.5127 11.4375V4.5625C4.5127 4.38348 4.58337 4.21155 4.70996 4.08496C4.83655 3.95837 5.00848 3.8877 5.1875 3.8877H8.9375ZM5.2373 11.3877H10.7627V6.7998H8.9375C8.84136 6.7998 8.74962 6.76134 8.68164 6.69336C8.61366 6.62538 8.5752 6.53364 8.5752 6.4375V4.6123H5.2373V11.3877ZM9.2998 6.0752H10.25L9.2998 5.125V6.0752Z" fill="white" stroke="white" stroke-width="0.1"/>
7
4
  </svg>
@@ -1,3 +1,4 @@
1
1
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M9 6C9 5.80222 9.05865 5.60888 9.16853 5.44443C9.27841 5.27998 9.43459 5.15181 9.61732 5.07612C9.80004 5.00043 10.0011 4.98063 10.1951 5.01921C10.3891 5.0578 10.5673 5.15304 10.7071 5.29289C10.847 5.43275 10.9422 5.61093 10.9808 5.80491C11.0194 5.99889 10.9996 6.19996 10.9239 6.38268C10.8482 6.56541 10.72 6.72159 10.5556 6.83147C10.3911 6.94135 10.1978 7 10 7C9.73478 7 9.48043 6.89464 9.29289 6.70711C9.10536 6.51957 9 6.26522 9 6ZM14.75 3.5V12.5C14.75 12.8315 14.6183 13.1495 14.3839 13.3839C14.1495 13.6183 13.8315 13.75 13.5 13.75H2.5C2.16848 13.75 1.85054 13.6183 1.61612 13.3839C1.3817 13.1495 1.25 12.8315 1.25 12.5V3.5C1.25 3.16848 1.3817 2.85054 1.61612 2.61612C1.85054 2.3817 2.16848 2.25 2.5 2.25H13.5C13.8315 2.25 14.1495 2.3817 14.3839 2.61612C14.6183 2.85054 14.75 3.16848 14.75 3.5ZM2.75 3.75V8.7325L4.86625 6.61625C5.10066 6.38191 5.41854 6.25027 5.75 6.25027C6.08146 6.25027 6.39934 6.38191 6.63375 6.61625L9.20687 9.1875L10.2806 8.11438C10.515 7.88004 10.8329 7.74839 11.1644 7.74839C11.4958 7.74839 11.8137 7.88004 12.0481 8.11438L13.25 9.31812V3.75H2.75ZM2.75 12.25H10.1462L5.75 7.85375L2.75 10.8538V12.25ZM13.25 12.25V11.4375L11.1644 9.35188L10.2675 10.25L12.2675 12.25H13.25Z" fill="#4E535A"/>
2
+ <path d="M0 8C0 5.19974 0 3.79961 0.544967 2.73005C1.02433 1.78924 1.78924 1.02433 2.73005 0.544967C3.79961 0 5.19974 0 8 0C10.8003 0 12.2004 0 13.27 0.544967C14.2108 1.02433 14.9757 1.78924 15.455 2.73005C16 3.79961 16 5.19974 16 8C16 10.8003 16 12.2004 15.455 13.27C14.9757 14.2108 14.2108 14.9757 13.27 15.455C12.2004 16 10.8003 16 8 16C5.19974 16 3.79961 16 2.73005 15.455C1.78924 14.9757 1.02433 14.2108 0.544967 13.27C0 12.2004 0 10.8003 0 8Z" fill="#46A1E3"/>
3
+ <path d="M11.4375 3.875H4.5625C4.38016 3.875 4.2053 3.94743 4.07636 4.07636C3.94743 4.2053 3.875 4.38016 3.875 4.5625V11.4375C3.875 11.6198 3.94743 11.7947 4.07636 11.9236C4.2053 12.0526 4.38016 12.125 4.5625 12.125H11.4375C11.6198 12.125 11.7947 12.0526 11.9236 11.9236C12.0526 11.7947 12.125 11.6198 12.125 11.4375V4.5625C12.125 4.38016 12.0526 4.2053 11.9236 4.07636C11.7947 3.94743 11.6198 3.875 11.4375 3.875ZM4.5625 4.5625H11.4375V7.88742L10.3766 6.82609C10.2477 6.69726 10.0729 6.62489 9.89062 6.62489C9.70837 6.62489 9.53357 6.69726 9.40465 6.82609L4.79324 11.4375H4.5625V4.5625ZM11.4375 11.4375H5.76562L9.89062 7.3125L11.4375 8.85938V11.4375ZM6.625 7.65625C6.82896 7.65625 7.02834 7.59577 7.19793 7.48245C7.36752 7.36914 7.4997 7.20808 7.57775 7.01964C7.6558 6.83121 7.67623 6.62386 7.63643 6.42381C7.59664 6.22377 7.49843 6.04002 7.3542 5.8958C7.20998 5.75157 7.02623 5.65336 6.82619 5.61357C6.62614 5.57377 6.41879 5.5942 6.23036 5.67225C6.04192 5.7503 5.88086 5.88248 5.76755 6.05207C5.65423 6.22166 5.59375 6.42104 5.59375 6.625C5.59375 6.8985 5.7024 7.16081 5.8958 7.3542C6.08919 7.5476 6.3515 7.65625 6.625 7.65625ZM6.625 6.28125C6.69299 6.28125 6.75945 6.30141 6.81598 6.33918C6.87251 6.37695 6.91657 6.43064 6.94258 6.49345C6.9686 6.55626 6.97541 6.62538 6.96214 6.69206C6.94888 6.75874 6.91614 6.81999 6.86807 6.86807C6.81999 6.91614 6.75874 6.94888 6.69206 6.96214C6.62538 6.97541 6.55626 6.9686 6.49345 6.94258C6.43064 6.91657 6.37695 6.87251 6.33918 6.81598C6.30141 6.75945 6.28125 6.69299 6.28125 6.625C6.28125 6.53383 6.31747 6.4464 6.38193 6.38193C6.4464 6.31747 6.53383 6.28125 6.625 6.28125Z" fill="white"/>
3
4
  </svg>
@@ -1,6 +1,6 @@
1
1
  export type { ChatCitationsConfig, CitationMeta, CitationRef, } from '../citations/types.js';
2
2
  export type { ChatFeatureConfig } from '../embed/feature-config.js';
3
- export type { ChatActor, ChatEmbedSharedProps, ChatSidebarConfig, DefaultChatEmbedProps, MeistrariChatEmbedProps, TelaAgentChatEmbedProps, } from '../embed/types.js';
3
+ export type { ChatActor, ChatEmbedSharedProps, ChatEmbedVariant, ChatEmbedVariantProps, ChatSidebarConfig, ChatSuggestion, DefaultChatEmbedProps, MeistrariChatEmbedProps, TelaAgentChatEmbedProps, } from '../embed/types.js';
4
4
  export type { ChatActionPayload } from '../messages/composables/chat-action.js';
5
5
  export type { MessageFeedbackConfig, MessageFeedbackPayload, MessageFeedbackRating, } from '../messages/composables/chat-feedback.js';
6
6
  export { ChatMessageStatus } from '../messages/composables/chat-message-terminal.js';
@@ -85,6 +85,7 @@ export declare const messageSchema: z.ZodObject<{
85
85
  completed: "completed";
86
86
  failed: "failed";
87
87
  }>>;
88
+ failReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
89
  reasoningData: z.ZodUnknown;
89
90
  files: z.ZodNullable<z.ZodArray<z.ZodObject<{
90
91
  url: z.ZodString;
@@ -189,6 +190,7 @@ export declare const conversationWithMessagesSchema: z.ZodObject<{
189
190
  completed: "completed";
190
191
  failed: "failed";
191
192
  }>>;
193
+ failReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
192
194
  reasoningData: z.ZodUnknown;
193
195
  files: z.ZodNullable<z.ZodArray<z.ZodObject<{
194
196
  url: z.ZodString;
@@ -36,6 +36,9 @@ export const messageSchema = z.object({
36
36
  role: messageRoleSchema,
37
37
  content: z.string(),
38
38
  status: messageStatusSchema.nullable(),
39
+ // Optional so a newer chat-nuxt keeps working against a chat-api that
40
+ // predates the column.
41
+ failReason: z.string().nullable().optional(),
39
42
  reasoningData: z.unknown(),
40
43
  files: z.array(messageFileSchema).nullable(),
41
44
  externalUuid: z.string().nullable(),
@@ -66,6 +66,7 @@ export declare const sendMessageResponseSchema: z.ZodObject<{
66
66
  completed: "completed";
67
67
  failed: "failed";
68
68
  }>>;
69
+ failReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
70
  reasoningData: z.ZodUnknown;
70
71
  files: z.ZodNullable<z.ZodArray<z.ZodObject<{
71
72
  url: z.ZodString;
@@ -97,6 +98,7 @@ export declare const sendMessageResponseSchema: z.ZodObject<{
97
98
  completed: "completed";
98
99
  failed: "failed";
99
100
  }>>;
101
+ failReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
100
102
  reasoningData: z.ZodUnknown;
101
103
  files: z.ZodNullable<z.ZodArray<z.ZodObject<{
102
104
  url: z.ZodString;
@@ -131,6 +133,7 @@ export declare const messagePollResponseSchema: z.ZodObject<{
131
133
  completed: "completed";
132
134
  failed: "failed";
133
135
  }>>;
136
+ failReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
137
  reasoningData: z.ZodUnknown;
135
138
  files: z.ZodNullable<z.ZodArray<z.ZodObject<{
136
139
  url: z.ZodString;
@@ -167,3 +170,4 @@ export declare const cancelConversationResponseSchema: z.ZodObject<{
167
170
  cancelled: z.ZodBoolean;
168
171
  }, z.core.$strip>;
169
172
  export type CancelConversationResponse = z.infer<typeof cancelConversationResponseSchema>;
173
+ export declare function isPromptTooLongFailure(failReason: string | null | undefined): boolean;
@@ -43,3 +43,10 @@ export const cancelConversationResponseSchema = z.object({
43
43
  success: z.literal(true),
44
44
  cancelled: z.boolean(),
45
45
  });
46
+ // agent-api reports this failure as free text (e.g. "Prompt is too long"), so
47
+ // the match lives here — next to the wire contract — instead of being
48
+ // re-derived by each consumer.
49
+ const PROMPT_TOO_LONG_PATTERN = /prompt is too long/i;
50
+ export function isPromptTooLongFailure(failReason) {
51
+ return failReason != null && PROMPT_TOO_LONG_PATTERN.test(failReason);
52
+ }
package/dist/types.d.mts CHANGED
@@ -6,7 +6,7 @@ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<
6
6
 
7
7
  export { ChatMessageStatus } from '../dist/runtime/messages/composables/chat-message-terminal.js'
8
8
 
9
- export { type ChatActionPayload, type ChatActor, type ChatEmbedSharedProps, type ChatFeatureConfig, type ChatMessageTerminalPayload, type ChatSidebarConfig, type DefaultChatEmbedProps, type MeistrariChatEmbedProps, type MessageFeedbackConfig, type MessageFeedbackPayload, type MessageFeedbackRating, type MessageOverviewResponse, type TelaAgentChatEmbedProps, type TelaAgentExecutionInput } from '../dist/runtime/types/embed.js'
9
+ export { type ChatActionPayload, type ChatActor, type ChatEmbedSharedProps, type ChatEmbedVariant, type ChatEmbedVariantProps, type ChatFeatureConfig, type ChatMessageTerminalPayload, type ChatSidebarConfig, type ChatSuggestion, type DefaultChatEmbedProps, type MeistrariChatEmbedProps, type MessageFeedbackConfig, type MessageFeedbackPayload, type MessageFeedbackRating, type MessageOverviewResponse, type TelaAgentChatEmbedProps, type TelaAgentExecutionInput } from '../dist/runtime/types/embed.js'
10
10
 
11
11
  export { default } from './module.mjs'
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "3.9.1",
3
+ "version": "3.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -22,6 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "scripts": {
25
+ "postinstall": "nuxi prepare",
25
26
  "build": "mkdir -p .nuxt && { [ -f .nuxt/tsconfig.json ] || printf '{}' > .nuxt/tsconfig.json; } && { [ -f .nuxt/tsconfig.server.json ] || printf '{}' > .nuxt/tsconfig.server.json; } && nuxt-module-build build && node ./scripts/embed-local-schemas.mjs && node ./scripts/polish-embed-declarations.mjs",
26
27
  "dev:prepare": "nuxt-module-build build --stub",
27
28
  "test:types": "pnpm build && tsc -p tsconfig.type-tests.json --noEmit",
@@ -33,7 +34,7 @@
33
34
  "typecheck": "cd ../.. && TYPECHECK_CWD=packages/chat-app ./scripts/typecheck.sh"
34
35
  },
35
36
  "peerDependencies": {
36
- "nuxt": "^3.17.0",
37
+ "nuxt": "^3.17.0 || ^4.0.0",
37
38
  "vue": "^3.5.0"
38
39
  },
39
40
  "dependencies": {
@@ -41,7 +42,7 @@
41
42
  "@iconify/vue": "^5.0.0",
42
43
  "@meistrari/auth-nuxt": "3.5.0",
43
44
  "@meistrari/logger": "^2.1.3",
44
- "@meistrari/tela-build": "^1.30.0",
45
+ "@meistrari/tela-build": "^1.59.2",
45
46
  "@sentry/nuxt": "^10.0.0",
46
47
  "@vueuse/components": "^12.8.0",
47
48
  "@vueuse/core": "^12.8.0",
@@ -66,7 +67,7 @@
66
67
  "@types/node": "^20.19.0",
67
68
  "dotenv-cli": "^11.0.0",
68
69
  "eslint": "9.16.0",
69
- "nuxt": "3.17.7",
70
+ "nuxt": "4.4.8",
70
71
  "pino": "^10.3.1",
71
72
  "pino-pretty": "^13.1.3",
72
73
  "playwright": "^1.61.0",
@@ -1,23 +0,0 @@
1
- type __VLS_Props = {
2
- errorMessage?: string | null;
3
- saving?: boolean;
4
- };
5
- declare function focusInput(): void;
6
- type __VLS_ModelProps = {
7
- modelValue: string;
8
- };
9
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
11
- focusInput: typeof focusInput;
12
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
- "update:modelValue": (value: string) => any;
14
- } & {
15
- submit: () => any;
16
- cancel: () => any;
17
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
- onSubmit?: (() => any) | undefined;
19
- onCancel?: (() => any) | undefined;
20
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
21
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
- declare const _default: typeof __VLS_export;
23
- export default _default;
@@ -1,75 +0,0 @@
1
- <script setup>
2
- defineProps({
3
- errorMessage: { type: [String, null], required: false },
4
- saving: { type: Boolean, required: false }
5
- });
6
- const emit = defineEmits(["submit", "cancel"]);
7
- const groupName = defineModel({ type: String, ...{ required: true } });
8
- const inputRef = ref(null);
9
- function focusInput() {
10
- inputRef.value?.focus();
11
- }
12
- defineExpose({
13
- focusInput
14
- });
15
- </script>
16
-
17
- <template>
18
- <TelaPopoverContent
19
- align="end"
20
- :side-offset="4"
21
- data-chat-sidebar-floating
22
- class="!w-auto !rounded-12px !border-neutral-200 !bg-white !p-0 !text-neutral-900 !shadow-lg"
23
- >
24
- <form w-236px p-8px flex="~ col" gap-8px @submit.prevent="emit('submit')">
25
- <input
26
- ref="inputRef"
27
- v-model="groupName"
28
- type="text"
29
- autocomplete="off"
30
- maxlength="80"
31
- placeholder="Nome da pasta"
32
- aria-label="Nome da pasta"
33
- h-32px w-full
34
- px-10px
35
- rounded-8px
36
- b=".5px neutral-300"
37
- bg-white
38
- outline-none
39
- text-14px text-neutral-900 leading-18px
40
- focus:b-neutral-900
41
- @keydown.escape.prevent.stop="emit('cancel')"
42
- >
43
- <p
44
- v-if="errorMessage"
45
- text-12px text-red-600 leading-16px
46
- aria-live="polite"
47
- >
48
- {{ errorMessage }}
49
- </p>
50
- <div flex justify-end gap-6px>
51
- <button
52
- type="button"
53
- h-28px px-10px rounded-8px
54
- text-13px font-medium text-neutral-700
55
- hover:bg-neutral-100
56
- transition-colors
57
- @click="emit('cancel')"
58
- >
59
- Cancelar
60
- </button>
61
- <button
62
- type="submit"
63
- h-28px px-10px rounded-8px
64
- bg-neutral-900 text-white
65
- text-13px font-medium
66
- transition-opacity
67
- :disabled="!groupName.trim() || saving"
68
- :class="(!groupName.trim() || saving) && 'opacity-40 cursor-not-allowed'"
69
- >
70
- Criar
71
- </button>
72
- </div>
73
- </form>
74
- </TelaPopoverContent>
75
- </template>
@@ -1,23 +0,0 @@
1
- type __VLS_Props = {
2
- errorMessage?: string | null;
3
- saving?: boolean;
4
- };
5
- declare function focusInput(): void;
6
- type __VLS_ModelProps = {
7
- modelValue: string;
8
- };
9
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
11
- focusInput: typeof focusInput;
12
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
- "update:modelValue": (value: string) => any;
14
- } & {
15
- submit: () => any;
16
- cancel: () => any;
17
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
- onSubmit?: (() => any) | undefined;
19
- onCancel?: (() => any) | undefined;
20
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
21
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
- declare const _default: typeof __VLS_export;
23
- export default _default;
@@ -1,37 +0,0 @@
1
- interface Props {
2
- title: string;
3
- icon?: string;
4
- isLast?: boolean;
5
- isFirst?: boolean;
6
- defaultExpanded?: boolean;
7
- hasResult?: boolean;
8
- isError?: boolean;
9
- isTextStep?: boolean;
10
- hideExpand?: boolean;
11
- isActive?: boolean;
12
- completed?: boolean;
13
- }
14
- declare var __VLS_7: {};
15
- type __VLS_Slots = {} & {
16
- default?: (props: typeof __VLS_7) => any;
17
- };
18
- declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
19
- isError: boolean;
20
- completed: boolean;
21
- isActive: boolean;
22
- icon: string;
23
- isLast: boolean;
24
- isFirst: boolean;
25
- defaultExpanded: boolean;
26
- hasResult: boolean;
27
- isTextStep: boolean;
28
- hideExpand: boolean;
29
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
- declare const _default: typeof __VLS_export;
32
- export default _default;
33
- type __VLS_WithSlots<T, S> = T & {
34
- new (): {
35
- $slots: S;
36
- };
37
- };
@@ -1,125 +0,0 @@
1
- <script setup>
2
- const props = defineProps({
3
- title: { type: String, required: true },
4
- icon: { type: String, required: false, default: "i-ph-info" },
5
- isLast: { type: Boolean, required: false, default: false },
6
- isFirst: { type: Boolean, required: false, default: false },
7
- defaultExpanded: { type: Boolean, required: false, default: false },
8
- hasResult: { type: Boolean, required: false, default: false },
9
- isError: { type: Boolean, required: false, default: false },
10
- isTextStep: { type: Boolean, required: false, default: false },
11
- hideExpand: { type: Boolean, required: false, default: false },
12
- isActive: { type: Boolean, required: false, default: false },
13
- completed: { type: Boolean, required: false, default: false }
14
- });
15
- const isWaitingForNext = computed(() => {
16
- return props.isLast && props.hasResult && !props.completed;
17
- });
18
- const isExpanded = ref(props.defaultExpanded);
19
- watch(() => props.defaultExpanded, (newVal) => {
20
- isExpanded.value = newVal;
21
- });
22
- function toggle() {
23
- isExpanded.value = !isExpanded.value;
24
- }
25
- </script>
26
-
27
- <template>
28
- <div class="relative flex gap-12px group/step">
29
- <!-- Status Icon -->
30
- <div class="flex flex-col items-center flex-shrink-0" :class="{ 'pb-8px': !isLast || !completed }">
31
- <div class="flex items-center justify-center w-24px h-24px group-hover/step:text-gray-700 transition-colors">
32
- <!-- COMPLETED STATE: Show specific type icons -->
33
- <template v-if="completed">
34
- <!-- Show error icon if there's an error -->
35
- <div
36
- v-if="isError"
37
- class="text-14px text-tertiary i-ph-x-circle"
38
- />
39
- <!-- Show specific icon for the step type -->
40
- <div
41
- v-else
42
- class="text-14px text-tertiary"
43
- :class="icon"
44
- />
45
- </template>
46
-
47
- <!-- EXECUTING STATE: Show loading/check icons -->
48
- <template v-else>
49
- <!-- Active step: loading spinner -->
50
- <div
51
- v-if="isActive || isWaitingForNext"
52
- class="text-14px text-tertiary animate-spin i-ph-circle-notch"
53
- />
54
- <!-- Tool without result yet: loading spinner -->
55
- <div
56
- v-else-if="!isTextStep && !hasResult"
57
- class="text-14px text-tertiary animate-spin i-ph-circle-notch"
58
- />
59
- <!-- Text step completed: check icon -->
60
- <div
61
- v-else-if="isTextStep"
62
- class="text-14px text-tertiary i-ph-check-circle"
63
- />
64
- <!-- Tool completed with error: x icon -->
65
- <div
66
- v-else-if="isError"
67
- class="text-14px text-tertiary i-ph-x-circle"
68
- />
69
- <!-- Tool completed successfully: check icon -->
70
- <div
71
- v-else
72
- class="text-14px text-tertiary i-ph-check-circle"
73
- />
74
- </template>
75
- </div>
76
- </div>
77
-
78
- <!-- Content Area -->
79
- <div class="flex-1 min-w-0" :class="{ 'pb-8px': !isLast || !completed }">
80
- <!-- Non-expandable title (when content is same as title) -->
81
- <div v-if="hideExpand" class="h-24px flex items-center">
82
- <span class="text-14px font-medium text-tertiary leading-18px">
83
- {{ title }}
84
- </span>
85
- </div>
86
-
87
- <!-- Expandable title (default) -->
88
- <template v-else>
89
- <!-- Trigger (Header) -->
90
- <button
91
- type="button"
92
- class="h-24px flex items-center gap-4px w-full text-left focus:outline-none group/title"
93
- @click="toggle"
94
- >
95
- <span class="text-14px font-medium text-tertiary group-hover/title:text-gray-700 transition-colors truncate leading-18px">
96
- {{ title }}
97
- </span>
98
- <div
99
- i-ph-caret-right
100
- class="text-12px text-tertiary group-hover/title:text-gray-700 transition-all duration-200 flex-shrink-0"
101
- :class="{ 'rotate-90': isExpanded }"
102
- />
103
- </button>
104
-
105
- <!-- Content (Body) -->
106
- <Transition
107
- enter-active-class="transition-all duration-300 ease-out"
108
- leave-active-class="transition-all duration-200 ease-in"
109
- enter-from-class="opacity-0 -translate-y-4px"
110
- leave-to-class="opacity-0 -translate-y-4px"
111
- >
112
- <div v-if="isExpanded" class="mt-8px overflow-hidden">
113
- <div class="text-14px text-tertiary leading-relaxed">
114
- <slot />
115
- </div>
116
- </div>
117
- </Transition>
118
- </template>
119
- </div>
120
- </div>
121
- </template>
122
-
123
- <style scoped>
124
- .v-enter-active,.v-leave-active{transition:opacity .3s ease,transform .3s ease}.v-enter-from,.v-leave-to{opacity:0;transform:translateY(-4px)}
125
- </style>
@@ -1,37 +0,0 @@
1
- interface Props {
2
- title: string;
3
- icon?: string;
4
- isLast?: boolean;
5
- isFirst?: boolean;
6
- defaultExpanded?: boolean;
7
- hasResult?: boolean;
8
- isError?: boolean;
9
- isTextStep?: boolean;
10
- hideExpand?: boolean;
11
- isActive?: boolean;
12
- completed?: boolean;
13
- }
14
- declare var __VLS_7: {};
15
- type __VLS_Slots = {} & {
16
- default?: (props: typeof __VLS_7) => any;
17
- };
18
- declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
19
- isError: boolean;
20
- completed: boolean;
21
- isActive: boolean;
22
- icon: string;
23
- isLast: boolean;
24
- isFirst: boolean;
25
- defaultExpanded: boolean;
26
- hasResult: boolean;
27
- isTextStep: boolean;
28
- hideExpand: boolean;
29
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
- declare const _default: typeof __VLS_export;
32
- export default _default;
33
- type __VLS_WithSlots<T, S> = T & {
34
- new (): {
35
- $slots: S;
36
- };
37
- };