@meistrari/chat-nuxt 1.1.2 → 1.2.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 (151) hide show
  1. package/README.md +95 -11
  2. package/dist/module.d.mts +5 -0
  3. package/dist/module.json +2 -2
  4. package/dist/module.mjs +96 -23
  5. package/dist/runtime/components/chat/conversation-list.d.vue.ts +1 -0
  6. package/dist/runtime/components/chat/conversation-list.vue +22 -2
  7. package/dist/runtime/components/chat/conversation-list.vue.d.ts +1 -0
  8. package/dist/runtime/components/chat/message-list.d.vue.ts +1 -0
  9. package/dist/runtime/components/chat/message-list.vue +23 -2
  10. package/dist/runtime/components/chat/message-list.vue.d.ts +1 -0
  11. package/dist/runtime/composables/useChat.d.ts +2 -1
  12. package/dist/runtime/composables/useChat.js +32 -3
  13. package/dist/runtime/composables/useChatApi.js +2 -1
  14. package/dist/runtime/composables/useConversations.d.ts +3 -2
  15. package/dist/runtime/composables/useConversations.js +99 -11
  16. package/dist/runtime/composables/useEmbedConfig.d.ts +11 -6
  17. package/dist/runtime/composables/useEmbedConfig.js +35 -7
  18. package/dist/runtime/composables/useIDB.js +4 -0
  19. package/dist/runtime/composables/usePdf.d.ts +840 -1
  20. package/dist/runtime/composables/usePdf.js +21 -3
  21. package/dist/runtime/composables/useWorkspaceContextFiles.d.ts +3 -3
  22. package/dist/runtime/composables/useWorkspaceContextFiles.js +19 -10
  23. package/dist/runtime/composables/useWorkspaceCredentials.d.ts +3 -3
  24. package/dist/runtime/composables/useWorkspaceExternalSkills.d.ts +1 -1
  25. package/dist/runtime/composables/useWorkspaceExternalSkills.js +5 -6
  26. package/dist/runtime/composables/useWorkspacePersonalization.d.ts +1 -1
  27. package/dist/runtime/composables/useWorkspacePersonalization.js +4 -5
  28. package/dist/runtime/composables/useWorkspaceSettings.js +12 -9
  29. package/dist/runtime/embed/components/ChatConfigurationModal.d.vue.ts +25 -0
  30. package/dist/runtime/embed/components/ChatConfigurationModal.vue +373 -0
  31. package/dist/runtime/embed/components/ChatConfigurationModal.vue.d.ts +25 -0
  32. package/dist/runtime/embed/components/ChatEmbed.vue +12 -1
  33. package/dist/runtime/embed/components/ChatEmbedInner.vue +31 -16
  34. package/dist/runtime/embed/components/configuration/ChatConfigurationContextFilesTab.d.vue.ts +22 -0
  35. package/dist/runtime/embed/components/configuration/ChatConfigurationContextFilesTab.vue +133 -0
  36. package/dist/runtime/embed/components/configuration/ChatConfigurationContextFilesTab.vue.d.ts +22 -0
  37. package/dist/runtime/embed/components/configuration/ChatConfigurationCredentialsTab.d.vue.ts +10 -0
  38. package/dist/runtime/embed/components/configuration/ChatConfigurationCredentialsTab.vue +220 -0
  39. package/dist/runtime/embed/components/configuration/ChatConfigurationCredentialsTab.vue.d.ts +10 -0
  40. package/dist/runtime/embed/components/configuration/ChatConfigurationExternalSkillsTab.d.vue.ts +32 -0
  41. package/dist/runtime/embed/components/configuration/ChatConfigurationExternalSkillsTab.vue +222 -0
  42. package/dist/runtime/embed/components/configuration/ChatConfigurationExternalSkillsTab.vue.d.ts +32 -0
  43. package/dist/runtime/embed/components/configuration/ChatConfigurationKnowledgeSourcesTab.d.vue.ts +18 -0
  44. package/dist/runtime/embed/components/configuration/ChatConfigurationKnowledgeSourcesTab.vue +142 -0
  45. package/dist/runtime/embed/components/configuration/ChatConfigurationKnowledgeSourcesTab.vue.d.ts +18 -0
  46. package/dist/runtime/embed/components/configuration/ChatConfigurationPersonalizationTab.d.vue.ts +10 -0
  47. package/dist/runtime/embed/components/configuration/ChatConfigurationPersonalizationTab.vue +37 -0
  48. package/dist/runtime/embed/components/configuration/ChatConfigurationPersonalizationTab.vue.d.ts +10 -0
  49. package/dist/runtime/embed/components/configuration/ChatConfigurationTelaToolsTab.d.vue.ts +20 -0
  50. package/dist/runtime/embed/components/configuration/ChatConfigurationTelaToolsTab.vue +146 -0
  51. package/dist/runtime/embed/components/configuration/ChatConfigurationTelaToolsTab.vue.d.ts +20 -0
  52. package/dist/runtime/server/api/admin/trigger-usage-report.post.d.ts +4 -1
  53. package/dist/runtime/server/api/admin/trigger-usage-report.post.js +2 -0
  54. package/dist/runtime/server/api/chat/workspace/settings.get.d.ts +1 -1
  55. package/dist/runtime/server/api/chat/workspace/settings.get.js +1 -0
  56. package/dist/runtime/server/api/conversations/[id]/cancel.post.d.ts +4 -1
  57. package/dist/runtime/server/api/conversations/[id]/cancel.post.js +1 -0
  58. package/dist/runtime/server/api/conversations/[id]/clear.post.d.ts +1 -1
  59. package/dist/runtime/server/api/conversations/[id]/clear.post.js +1 -0
  60. package/dist/runtime/server/api/conversations/[id]/duplicate.post.d.ts +1 -1
  61. package/dist/runtime/server/api/conversations/[id]/duplicate.post.js +46 -12
  62. package/dist/runtime/server/api/conversations/[id]/files.get.d.ts +1 -1
  63. package/dist/runtime/server/api/conversations/[id]/files.get.js +2 -0
  64. package/dist/runtime/server/api/conversations/[id]/index.delete.d.ts +3 -1
  65. package/dist/runtime/server/api/conversations/[id]/index.delete.js +1 -0
  66. package/dist/runtime/server/api/conversations/[id]/index.get.d.ts +1 -1
  67. package/dist/runtime/server/api/conversations/[id]/index.get.js +1 -0
  68. package/dist/runtime/server/api/conversations/[id]/index.patch.d.ts +1 -1
  69. package/dist/runtime/server/api/conversations/[id]/index.patch.js +1 -0
  70. package/dist/runtime/server/api/conversations/[id]/messages/[messageId]/retry.post.d.ts +1 -1
  71. package/dist/runtime/server/api/conversations/[id]/messages/[messageId]/retry.post.js +2 -0
  72. package/dist/runtime/server/api/conversations/[id]/messages/index.get.d.ts +14 -1
  73. package/dist/runtime/server/api/conversations/[id]/messages/index.get.js +2 -0
  74. package/dist/runtime/server/api/conversations/[id]/messages/index.post.d.ts +4 -1
  75. package/dist/runtime/server/api/conversations/[id]/messages/index.post.js +2 -0
  76. package/dist/runtime/server/api/conversations/[id]/usage.get.d.ts +1 -1
  77. package/dist/runtime/server/api/conversations/[id]/usage.get.js +1 -0
  78. package/dist/runtime/server/api/conversations/generate-title.post.d.ts +3 -1
  79. package/dist/runtime/server/api/conversations/generate-title.post.js +2 -0
  80. package/dist/runtime/server/api/conversations/index.get.d.ts +1 -1
  81. package/dist/runtime/server/api/conversations/index.get.js +1 -0
  82. package/dist/runtime/server/api/conversations/index.post.d.ts +1 -1
  83. package/dist/runtime/server/api/conversations/index.post.js +1 -0
  84. package/dist/runtime/server/api/external-skills/discover.post.d.ts +1 -1
  85. package/dist/runtime/server/api/external-skills/discover.post.js +2 -0
  86. package/dist/runtime/server/api/github/disconnect.post.d.ts +3 -1
  87. package/dist/runtime/server/api/github/disconnect.post.js +2 -0
  88. package/dist/runtime/server/api/github/status.get.d.ts +1 -1
  89. package/dist/runtime/server/api/github/status.get.js +2 -0
  90. package/dist/runtime/server/api/tela/canvas.get.d.ts +1 -1
  91. package/dist/runtime/server/api/tela/canvas.get.js +1 -0
  92. package/dist/runtime/server/api/tela/projects.get.d.ts +1 -1
  93. package/dist/runtime/server/api/tela/projects.get.js +1 -0
  94. package/dist/runtime/server/api/tela/workspaces.get.d.ts +1 -1
  95. package/dist/runtime/server/api/tela/workspaces.get.js +1 -0
  96. package/dist/runtime/server/api/tela/workstations.get.d.ts +1 -1
  97. package/dist/runtime/server/api/tela/workstations.get.js +1 -0
  98. package/dist/runtime/server/api/vault/permalink-metadata.post.d.ts +5 -1
  99. package/dist/runtime/server/api/vault/permalink-metadata.post.js +2 -0
  100. package/dist/runtime/server/api/vault/resolve.post.d.ts +9 -1
  101. package/dist/runtime/server/api/vault/resolve.post.js +2 -0
  102. package/dist/runtime/server/api/vault/upload.post.d.ts +6 -1
  103. package/dist/runtime/server/api/vault/upload.post.js +2 -0
  104. package/dist/runtime/server/api/workspace/credentials/[id].delete.d.ts +3 -1
  105. package/dist/runtime/server/api/workspace/credentials/[id].delete.js +1 -0
  106. package/dist/runtime/server/api/workspace/credentials/[id].put.d.ts +1 -1
  107. package/dist/runtime/server/api/workspace/credentials/[id].put.js +1 -0
  108. package/dist/runtime/server/api/workspace/credentials/index.get.d.ts +1 -1
  109. package/dist/runtime/server/api/workspace/credentials/index.get.js +1 -0
  110. package/dist/runtime/server/api/workspace/credentials/index.post.d.ts +1 -1
  111. package/dist/runtime/server/api/workspace/credentials/index.post.js +1 -0
  112. package/dist/runtime/server/api/workspace/settings.get.d.ts +1 -1
  113. package/dist/runtime/server/api/workspace/settings.get.js +1 -0
  114. package/dist/runtime/server/api/workspace/settings.patch.d.ts +1 -1
  115. package/dist/runtime/server/api/workspace/settings.patch.js +1 -0
  116. package/dist/runtime/server/api/workspace/usage.get.d.ts +1 -1
  117. package/dist/runtime/server/api/workspace/usage.get.js +1 -0
  118. package/dist/runtime/server/db/index.js +1 -0
  119. package/dist/runtime/server/middleware/domain-validation.d.ts +1 -1
  120. package/dist/runtime/server/middleware/domain-validation.js +2 -0
  121. package/dist/runtime/server/middleware/request-logger.d.ts +1 -1
  122. package/dist/runtime/server/middleware/request-logger.js +1 -0
  123. package/dist/runtime/server/tasks/send-daily-usage-report.d.ts +1 -1
  124. package/dist/runtime/server/tasks/send-daily-usage-report.js +1 -0
  125. package/dist/runtime/server/utils/agent-api.d.ts +1 -1
  126. package/dist/runtime/server/utils/agent-api.js +2 -0
  127. package/dist/runtime/server/utils/auth-api.js +2 -0
  128. package/dist/runtime/server/utils/auth.d.ts +1 -1
  129. package/dist/runtime/server/utils/auth.js +1 -0
  130. package/dist/runtime/server/utils/tela-api.d.ts +1 -1
  131. package/dist/runtime/server/utils/tela-api.js +2 -0
  132. package/dist/runtime/server/utils/workspace.js +1 -0
  133. package/dist/runtime/types/chat.d.ts +2 -1
  134. package/dist/runtime/types/workspace-settings.d.ts +3 -0
  135. package/dist/runtime/types/workspace-settings.js +0 -0
  136. package/dist/runtime/utils/conversation-list-skeleton.d.ts +31 -0
  137. package/dist/runtime/utils/conversation-list-skeleton.js +12 -0
  138. package/dist/runtime/utils/file.js +42 -42
  139. package/dist/types.d.mts +2 -0
  140. package/package.json +24 -12
  141. package/dist/runtime/composables/PageNavigation.d.ts +0 -13
  142. package/dist/runtime/composables/PageNavigation.js +0 -18
  143. /package/dist/runtime/components/{TelaChat.d.vue.ts → MeistrariChatEmbed.d.vue.ts} +0 -0
  144. /package/dist/runtime/components/{TelaChat.vue → MeistrariChatEmbed.vue} +0 -0
  145. /package/dist/runtime/components/{TelaChat.vue.d.ts → MeistrariChatEmbed.vue.d.ts} +0 -0
  146. /package/dist/runtime/components/{pdf-preview.d.vue.ts → pdf-preview.client.d.vue.ts} +0 -0
  147. /package/dist/runtime/components/{pdf-preview.vue → pdf-preview.client.vue} +0 -0
  148. /package/dist/runtime/components/{pdf-preview.vue.d.ts → pdf-preview.client.vue.d.ts} +0 -0
  149. /package/dist/runtime/components/{pdf-viewer.d.vue.ts → pdf-viewer.client.d.vue.ts} +0 -0
  150. /package/dist/runtime/components/{pdf-viewer.vue → pdf-viewer.client.vue} +0 -0
  151. /package/dist/runtime/components/{pdf-viewer.vue.d.ts → pdf-viewer.client.vue.d.ts} +0 -0
@@ -0,0 +1,32 @@
1
+ import type { ExternalSkill } from '../../../server/db/schema.js';
2
+ type __VLS_Props = {
3
+ searchQuery: string;
4
+ displayedSkills: readonly ExternalSkill[];
5
+ filteredSkills: readonly ExternalSkill[];
6
+ hasChanges: boolean;
7
+ isPending: (ref: string) => boolean;
8
+ skillModalOpen: boolean;
9
+ skillRefInput: string;
10
+ skillError: string;
11
+ discoveringSkills: boolean;
12
+ gitHubButtonText: string;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
+ "update:searchQuery": (value: string) => any;
16
+ "update:skillModalOpen": (value: boolean) => any;
17
+ "update:skillRefInput": (value: string) => any;
18
+ removeSkill: (ref: string) => any;
19
+ closeSkillModal: () => any;
20
+ handleAddSkillAndClose: () => any;
21
+ connectGitHub: () => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
+ "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
24
+ "onUpdate:skillModalOpen"?: ((value: boolean) => any) | undefined;
25
+ "onUpdate:skillRefInput"?: ((value: string) => any) | undefined;
26
+ onRemoveSkill?: ((ref: string) => any) | undefined;
27
+ onCloseSkillModal?: (() => any) | undefined;
28
+ onHandleAddSkillAndClose?: (() => any) | undefined;
29
+ onConnectGitHub?: (() => any) | undefined;
30
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import type { TelaWorkstation } from '../../../types/tela.js';
2
+ type __VLS_Props = {
3
+ searchQuery: string;
4
+ workstations: TelaWorkstation[];
5
+ loadingWorkstations: boolean;
6
+ filteredWorkstations: TelaWorkstation[];
7
+ selectedIds: Set<string>;
8
+ getProjectNameForWorkstation: (w: TelaWorkstation) => string;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ toggle: (sourceId: string) => any;
12
+ "update:searchQuery": (value: string) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onToggle?: ((sourceId: string) => any) | undefined;
15
+ "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
@@ -0,0 +1,142 @@
1
+ <script setup>
2
+ defineProps({
3
+ searchQuery: { type: String, required: true },
4
+ workstations: { type: Array, required: true },
5
+ loadingWorkstations: { type: Boolean, required: true },
6
+ filteredWorkstations: { type: Array, required: true },
7
+ selectedIds: { type: Set, required: true },
8
+ getProjectNameForWorkstation: { type: Function, required: true }
9
+ });
10
+ const emit = defineEmits(["update:searchQuery", "toggle"]);
11
+ </script>
12
+
13
+ <template>
14
+ <div mb-24px>
15
+ <h2 text-16px font-semibold text-primary tracking="-.2px" leading-20px>
16
+ Tela workstations
17
+ </h2>
18
+ <div h-px bg-gray-200 mt-24px />
19
+ </div>
20
+
21
+ <div v-if="workstations.length === 0 && !loadingWorkstations" flex="~ col" items-center justify-center h-400px gap-24px>
22
+ <div
23
+ w-88px h-64px rounded-10px bg-white b=".5px gray-100"
24
+ flex items-center justify-center
25
+ shadow-sm
26
+ >
27
+ <div i-ph-shapes text-32px style="color: #DFE3E7;" />
28
+ </div>
29
+ <div flex="~ col" gap-8px items-center text-center>
30
+ <p text-20px font-semibold text-primary tracking="-.5px" leading-24px max-w-239px>
31
+ Sua equipe ainda não criou automações
32
+ </p>
33
+ <p text-14px text-secondary tracking="-.15px" leading-18px max-w-264px>
34
+ Acesse <a href="https://tela.com" target="_blank" rel="noopener noreferrer" class="underline hover:text-primary transition">tela.com</a> para criar canvas e workflows
35
+ </p>
36
+ </div>
37
+ </div>
38
+
39
+ <template v-else>
40
+ <div
41
+ flex items-center gap-8px
42
+ w-240px pl-12px pr-8px py-4px mb-24px
43
+ bg-white b=".5px gray-200" rounded-10px
44
+ shadow-sm
45
+ >
46
+ <div i-ph-magnifying-glass text-12px text-gray-400 />
47
+ <input
48
+ :value="searchQuery"
49
+ type="text"
50
+ placeholder="Buscar"
51
+ :disabled="loadingWorkstations"
52
+ class="disabled:cursor-not-allowed"
53
+ text-14px text-primary placeholder:text-gray-400
54
+ bg-transparent border-none outline-none
55
+ flex-1 leading-18px tracking="-.15px"
56
+ @input="emit('update:searchQuery', $event.target.value)"
57
+ >
58
+ </div>
59
+
60
+ <template v-if="loadingWorkstations">
61
+ <div flex="~ 1 col" w-full gap-4px>
62
+ <TelaSkeleton v-for="(_, idx) in 3" :key="idx" h-48px bg-grey-120 />
63
+ </div>
64
+ </template>
65
+
66
+ <div v-else max-h-400px overflow-y-auto>
67
+ <TelaTable class="table-fixed" w-full>
68
+ <TelaTableHeader>
69
+ <TelaTableRow>
70
+ <TelaTableHead class="!p-0 !w-48px !min-w-48px">
71
+ <div flex items-center justify-center w-48px h-full />
72
+ </TelaTableHead>
73
+ <TelaTableHead class="!py-12px text-12px font-semibold text-primary leading-16px">
74
+ Nome
75
+ </TelaTableHead>
76
+ <TelaTableHead class="!py-12px !w-150px !min-w-150px text-12px font-semibold text-primary leading-16px">
77
+ Projeto
78
+ </TelaTableHead>
79
+ <TelaTableHead class="!py-12px !w-80px !min-w-80px text-12px font-semibold text-primary leading-16px">
80
+ Tarefas
81
+ </TelaTableHead>
82
+ </TelaTableRow>
83
+ </TelaTableHeader>
84
+ <TelaTableBody>
85
+ <TelaTableRow
86
+ v-for="item in filteredWorkstations"
87
+ :key="item.id"
88
+ hover:bg-gray-50 cursor-pointer transition
89
+ :class="{ 'bg-emerald-50': selectedIds.has(item.id) }"
90
+ @click="emit('toggle', item.id)"
91
+ >
92
+ <TelaTableCell class="!p-0 !w-48px !min-w-48px">
93
+ <div flex items-center justify-center w-48px h-full>
94
+ <TelaCheckbox
95
+ :model-value="selectedIds.has(item.id)"
96
+ @click.stop
97
+ @update:model-value="emit('toggle', item.id)"
98
+ />
99
+ </div>
100
+ </TelaTableCell>
101
+ <TelaTableCell>
102
+ <div flex="~ col" gap-2px>
103
+ <span text-14px text-gray-900 leading-18px tracking="-.15px" truncate>
104
+ {{ item.name }}
105
+ </span>
106
+ <span v-if="item.description" text-12px text-gray-500 truncate>
107
+ {{ item.description }}
108
+ </span>
109
+ </div>
110
+ </TelaTableCell>
111
+ <TelaTableCell class="!w-150px !min-w-150px">
112
+ <div
113
+ b=".5px gray-100" rounded-8px px-8px py-4px
114
+ flex items-center gap-5px max-w-full
115
+ >
116
+ <div i-ph-folder text-14px shrink-0 style="color: #767E88;" />
117
+ <span text-12px font-semibold truncate style="color: #767E88;">
118
+ {{ getProjectNameForWorkstation(item) }}
119
+ </span>
120
+ </div>
121
+ </TelaTableCell>
122
+ <TelaTableCell class="!w-80px !min-w-80px">
123
+ <span text-12px text-tertiary leading-16px>
124
+ {{ item.taskCount ?? 0 }}
125
+ </span>
126
+ </TelaTableCell>
127
+ </TelaTableRow>
128
+
129
+ <TelaTableRow v-if="filteredWorkstations.length === 0 && workstations.length > 0">
130
+ <TelaTableCell colspan="4">
131
+ <TelaTableEmpty :colspan="4">
132
+ <div text-center py-48px text-14px text-tertiary>
133
+ Nenhum resultado encontrado
134
+ </div>
135
+ </TelaTableEmpty>
136
+ </TelaTableCell>
137
+ </TelaTableRow>
138
+ </TelaTableBody>
139
+ </TelaTable>
140
+ </div>
141
+ </template>
142
+ </template>
@@ -0,0 +1,18 @@
1
+ import type { TelaWorkstation } from '../../../types/tela.js';
2
+ type __VLS_Props = {
3
+ searchQuery: string;
4
+ workstations: TelaWorkstation[];
5
+ loadingWorkstations: boolean;
6
+ filteredWorkstations: TelaWorkstation[];
7
+ selectedIds: Set<string>;
8
+ getProjectNameForWorkstation: (w: TelaWorkstation) => string;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ toggle: (sourceId: string) => any;
12
+ "update:searchQuery": (value: string) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onToggle?: ((sourceId: string) => any) | undefined;
15
+ "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
@@ -0,0 +1,10 @@
1
+ type __VLS_ModelProps = {
2
+ 'systemMessage': string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ "update:systemMessage": (value: string) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
7
+ "onUpdate:systemMessage"?: ((value: string) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,37 @@
1
+ <script setup>
2
+ const localSystemMessage = defineModel("systemMessage", { type: String, ...{ required: true } });
3
+ </script>
4
+
5
+ <template>
6
+ <div>
7
+ <div mb-24px>
8
+ <h2 text-16px font-semibold text-primary tracking="-.2px" leading-20px>
9
+ Personalização
10
+ </h2>
11
+ <div h-px bg-gray-200 mt-24px />
12
+ </div>
13
+
14
+ <div flex="~ col" gap-32px>
15
+ <div flex="~ col" gap-12px>
16
+ <label text-14px font-semibold text-primary tracking="-.15px" leading-16px>
17
+ Instruções personalizadas
18
+ </label>
19
+ <div flex="~ col" gap-4px>
20
+ <textarea
21
+ v-model="localSystemMessage"
22
+ placeholder="Ex: &quot;Sempre forneça fontes para conclusões importantes&quot;, &quot;Mantenha um tom profissional&quot;, ou &quot;Diferencie fatos de interpretações&quot;"
23
+ rows="20"
24
+ w-full px-16px py-14px rounded-10px b=".5px gray-200" text-16px
25
+ bg-white leading-20px tracking="-.2px"
26
+ text-primary placeholder:text-tertiary
27
+ focus:outline-none focus:b-gray-400
28
+ resize-none
29
+ />
30
+ <p text-12px text-secondary leading-16px>
31
+ Esta instrução será aplicada a todas as novas conversas do workspace
32
+ </p>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </template>
@@ -0,0 +1,10 @@
1
+ type __VLS_ModelProps = {
2
+ 'systemMessage': string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ "update:systemMessage": (value: string) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
7
+ "onUpdate:systemMessage"?: ((value: string) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import type { TelaCanvas } from '../../../types/tela.js';
2
+ type __VLS_Props = {
3
+ searchQuery: string;
4
+ canvas: TelaCanvas[];
5
+ filteredCanvasTools: TelaCanvas[];
6
+ selectedToolIds: Set<string>;
7
+ allToolsSelected: boolean;
8
+ getProjectName: (projectId: string) => string;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ "update:searchQuery": (value: string) => any;
12
+ toggleTool: (canvasId: string) => any;
13
+ toggleAll: (selected: boolean | "indeterminate") => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
16
+ onToggleTool?: ((canvasId: string) => any) | undefined;
17
+ onToggleAll?: ((selected: boolean | "indeterminate") => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -0,0 +1,146 @@
1
+ <script setup>
2
+ import { formatAbsoluteDate } from "../../../utils/format-time";
3
+ defineProps({
4
+ searchQuery: { type: String, required: true },
5
+ canvas: { type: Array, required: true },
6
+ filteredCanvasTools: { type: Array, required: true },
7
+ selectedToolIds: { type: Set, required: true },
8
+ allToolsSelected: { type: Boolean, required: true },
9
+ getProjectName: { type: Function, required: true }
10
+ });
11
+ const emit = defineEmits(["update:searchQuery", "toggleTool", "toggleAll"]);
12
+ </script>
13
+
14
+ <template>
15
+ <div mb-24px>
16
+ <h2 text-16px font-semibold text-primary tracking="-.2px" leading-20px>
17
+ Skills Tela
18
+ </h2>
19
+ <div h-px bg-gray-200 mt-24px />
20
+ </div>
21
+
22
+ <div v-if="canvas.length === 0" flex="~ col" items-center justify-center h-400px gap-24px>
23
+ <div
24
+ w-88px h-64px rounded-10px bg-white b=".5px gray-100"
25
+ flex items-center justify-center
26
+ shadow-sm
27
+ >
28
+ <div i-ph-shapes text-32px style="color: #DFE3E7;" />
29
+ </div>
30
+ <div flex="~ col" gap-8px items-center text-center>
31
+ <p text-20px font-semibold text-primary tracking="-.5px" leading-24px max-w-239px>
32
+ Sua equipe ainda não criou automações
33
+ </p>
34
+ <p text-14px text-secondary tracking="-.15px" leading-18px max-w-264px>
35
+ Acesse o Tela para criar canvas e workflows
36
+ </p>
37
+ </div>
38
+ </div>
39
+
40
+ <template v-else>
41
+ <div
42
+ flex items-center gap-8px
43
+ w-240px pl-12px pr-8px py-4px mb-24px
44
+ bg-white b=".5px gray-200" rounded-10px
45
+ shadow-sm
46
+ >
47
+ <div i-ph-magnifying-glass text-12px text-gray-400 />
48
+ <input
49
+ :value="searchQuery"
50
+ type="text"
51
+ placeholder="Buscar"
52
+ text-14px text-primary placeholder:text-gray-400
53
+ bg-transparent border-none outline-none
54
+ flex-1 leading-18px tracking="-.15px"
55
+ @input="emit('update:searchQuery', $event.target.value)"
56
+ >
57
+ </div>
58
+
59
+ <div max-h-400px overflow-y-auto>
60
+ <TelaTable class="table-fixed" w-full>
61
+ <TelaTableHeader>
62
+ <TelaTableRow>
63
+ <TelaTableHead class="!p-0 !w-48px !min-w-48px">
64
+ <div flex items-center justify-center w-48px h-full>
65
+ <TelaCheckbox
66
+ :model-value="allToolsSelected"
67
+ @update:model-value="emit('toggleAll', $event)"
68
+ />
69
+ </div>
70
+ </TelaTableHead>
71
+ <TelaTableHead class="!py-12px !w-287px text-12px font-semibold text-primary leading-16px">
72
+ Nome
73
+ </TelaTableHead>
74
+ <TelaTableHead class="!py-12px !w-125px !min-w-125px text-12px font-semibold text-primary leading-16px">
75
+ Projeto
76
+ </TelaTableHead>
77
+ <TelaTableHead class="!py-12px !w-125px !min-w-125px text-12px font-semibold text-primary leading-16px">
78
+ Última edição
79
+ </TelaTableHead>
80
+ </TelaTableRow>
81
+ </TelaTableHeader>
82
+ <TelaTableBody>
83
+ <TelaTableRow
84
+ v-for="item in filteredCanvasTools"
85
+ :key="item.id"
86
+ hover:bg-gray-50 cursor-pointer transition
87
+ :class="{ 'opacity-50': !item.promotedVersion }"
88
+ @click="item.promotedVersion && emit('toggleTool', item.id)"
89
+ >
90
+ <TelaTableCell class="!p-0 !w-48px !min-w-48px">
91
+ <div flex items-center justify-center w-48px h-full>
92
+ <TelaCheckbox
93
+ :model-value="selectedToolIds.has(item.id)"
94
+ :disabled="!item.promotedVersion"
95
+ @click.stop
96
+ @update:model-value="emit('toggleTool', item.id)"
97
+ />
98
+ </div>
99
+ </TelaTableCell>
100
+ <TelaTableCell class="!w-287px">
101
+ <div flex items-center gap-8px>
102
+ <span text-14px text-gray-900 leading-18px tracking="-.15px" truncate>
103
+ {{ item.title }}
104
+ </span>
105
+ <div
106
+ b=".5px gray-200" rounded-5px px-5px
107
+ flex items-center justify-center shrink-0
108
+ >
109
+ <span text-9px font-semibold uppercase tracking-wide style="color: #9DA2AA;">
110
+ {{ item.promotedVersion?.workflowSpec ? "Workflow" : "Canvas" }}
111
+ </span>
112
+ </div>
113
+ </div>
114
+ </TelaTableCell>
115
+ <TelaTableCell class="!w-125px !min-w-125px">
116
+ <div
117
+ b=".5px gray-100" rounded-8px px-8px py-4px
118
+ flex items-center gap-5px w-fit
119
+ >
120
+ <div i-ph-folder text-14px style="color: #767E88;" />
121
+ <span text-12px font-semibold style="color: #767E88;">
122
+ {{ getProjectName(item.projectId) }}
123
+ </span>
124
+ </div>
125
+ </TelaTableCell>
126
+ <TelaTableCell class="!w-125px !min-w-125px">
127
+ <span text-12px text-tertiary leading-16px>
128
+ {{ formatAbsoluteDate(item.updatedAt) }}
129
+ </span>
130
+ </TelaTableCell>
131
+ </TelaTableRow>
132
+
133
+ <TelaTableRow v-if="filteredCanvasTools.length === 0 && canvas.length > 0">
134
+ <TelaTableCell colspan="4">
135
+ <TelaTableEmpty :colspan="4">
136
+ <div text-center py-48px text-14px text-tertiary>
137
+ Nenhum resultado encontrado
138
+ </div>
139
+ </TelaTableEmpty>
140
+ </TelaTableCell>
141
+ </TelaTableRow>
142
+ </TelaTableBody>
143
+ </TelaTable>
144
+ </div>
145
+ </template>
146
+ </template>
@@ -0,0 +1,20 @@
1
+ import type { TelaCanvas } from '../../../types/tela.js';
2
+ type __VLS_Props = {
3
+ searchQuery: string;
4
+ canvas: TelaCanvas[];
5
+ filteredCanvasTools: TelaCanvas[];
6
+ selectedToolIds: Set<string>;
7
+ allToolsSelected: boolean;
8
+ getProjectName: (projectId: string) => string;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ "update:searchQuery": (value: string) => any;
12
+ toggleTool: (canvasId: string) => any;
13
+ toggleAll: (selected: boolean | "indeterminate") => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
16
+ onToggleTool?: ((canvasId: string) => any) | undefined;
17
+ onToggleAll?: ((selected: boolean | "indeterminate") => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -1,2 +1,5 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
+ success: boolean;
3
+ result: import("nitropack").TaskResult<unknown>;
4
+ }>>;
2
5
  export default _default;
@@ -1,3 +1,5 @@
1
+ import { createError, defineEventHandler } from "h3";
2
+ import { runTask } from "nitropack/runtime";
1
3
  import { requireUser } from "#chat-runtime/server/utils/auth";
2
4
  export default defineEventHandler(async (event) => {
3
5
  const session = requireUser(event);
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
2
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { defineEventHandler } from "h3";
1
2
  import { useDb } from "#chat-runtime/server/db";
2
3
  import { resolveChatContext } from "#chat-runtime/server/utils/chat-context";
3
4
  import { getWorkspaceSettingsUpdatedAt, resolveWorkspaceSettings } from "#chat-runtime/server/utils/chat-workspace-settings";
@@ -1,2 +1,5 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
+ success: boolean;
3
+ previousStatus: any;
4
+ }>>;
2
5
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { createError, defineEventHandler, getRouterParam } from "h3";
1
2
  import { eq, and } from "drizzle-orm";
2
3
  import { useDb, schema } from "#chat-runtime/server/db";
3
4
  import { resolveChatContext } from "#chat-runtime/server/utils/chat-context";
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
2
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { createError, defineEventHandler, getRouterParam } from "h3";
1
2
  import { eq, and } from "drizzle-orm";
2
3
  import { useDb, schema } from "#chat-runtime/server/db";
3
4
  import { resolveChatContext } from "#chat-runtime/server/utils/chat-context";
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
2
  export default _default;
@@ -1,4 +1,5 @@
1
- import { eq, and } from "drizzle-orm";
1
+ import { createError, defineEventHandler, getRouterParam } from "h3";
2
+ import { eq, and, asc } from "drizzle-orm";
2
3
  import { useDb, schema } from "#chat-runtime/server/db";
3
4
  import { resolveChatContext } from "#chat-runtime/server/utils/chat-context";
4
5
  import { getWorkspaceSettingsUpdatedAt, resolveWorkspaceSettings, serializeResolvedWorkspaceSettings } from "#chat-runtime/server/utils/chat-workspace-settings";
@@ -26,16 +27,49 @@ export default defineEventHandler(async (event) => {
26
27
  });
27
28
  }
28
29
  const trustedSettings = original.appliedSettingsSnapshot ? original.appliedSettingsSnapshot : await resolveWorkspaceSettings(event, context, db);
29
- const [duplicated] = await db.insert(schema.conversations).values({
30
- workspaceId: context.workspaceId,
31
- userId: context.user.id,
32
- title: `${original.title} (copy)`,
33
- createdBy: context.user.email,
34
- appliedSettingsAt: getWorkspaceSettingsUpdatedAt(trustedSettings),
35
- appliedSettingsSnapshot: serializeResolvedWorkspaceSettings(trustedSettings)
36
- }).returning();
37
- if (duplicated) {
38
- logger.info({ originalId: id, duplicatedId: duplicated.id, workspaceId: context.workspaceId }, "Conversation duplicated");
39
- }
30
+ const duplicated = await db.transaction(async (tx) => {
31
+ const [newConversation] = await tx.insert(schema.conversations).values({
32
+ workspaceId: context.workspaceId,
33
+ userId: context.user.id,
34
+ title: `${original.title} (copy)`,
35
+ createdBy: context.user.email,
36
+ model: original.model,
37
+ appliedSettingsAt: getWorkspaceSettingsUpdatedAt(trustedSettings),
38
+ appliedSettingsSnapshot: serializeResolvedWorkspaceSettings(trustedSettings)
39
+ }).returning();
40
+ if (!newConversation) {
41
+ throw createError({
42
+ statusCode: 500,
43
+ statusMessage: "Failed to duplicate conversation"
44
+ });
45
+ }
46
+ const originalMessages = await tx.select().from(schema.messages).where(eq(schema.messages.conversationId, original.id)).orderBy(asc(schema.messages.createdAt));
47
+ let duplicatedMessages = [];
48
+ if (originalMessages.length > 0) {
49
+ duplicatedMessages = await tx.insert(schema.messages).values(
50
+ originalMessages.map((message) => ({
51
+ conversationId: newConversation.id,
52
+ role: message.role,
53
+ content: message.content,
54
+ status: message.status,
55
+ reasoningData: message.reasoningData,
56
+ files: message.files,
57
+ externalUuid: null,
58
+ ttft: message.ttft,
59
+ createdBy: message.createdBy,
60
+ createdAt: message.createdAt,
61
+ updatedAt: message.updatedAt
62
+ }))
63
+ ).returning();
64
+ }
65
+ return {
66
+ ...newConversation,
67
+ messages: duplicatedMessages
68
+ };
69
+ });
70
+ logger.info(
71
+ { originalId: id, duplicatedId: duplicated.id, workspaceId: context.workspaceId },
72
+ "Conversation duplicated"
73
+ );
40
74
  return duplicated;
41
75
  });
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<ConversationFilesResponse>>;
2
2
  export default _default;
@@ -1,3 +1,5 @@
1
+ import { createError, defineEventHandler, getRouterParam } from "h3";
2
+ import { useRuntimeConfig } from "nitropack/runtime";
1
3
  import { and, asc, eq } from "drizzle-orm";
2
4
  import { useDb, schema } from "#chat-runtime/server/db";
3
5
  import { resolveChatContext } from "#chat-runtime/server/utils/chat-context";
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
+ success: boolean;
3
+ }>>;
2
4
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { createError, defineEventHandler, getRouterParam } from "h3";
1
2
  import { eq, and } from "drizzle-orm";
2
3
  import { useDb, schema } from "#chat-runtime/server/db";
3
4
  import { resolveChatContext } from "#chat-runtime/server/utils/chat-context";
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
2
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { createError, defineEventHandler, getRouterParam } from "h3";
1
2
  import { eq, and, asc } from "drizzle-orm";
2
3
  import { useDb, schema } from "#chat-runtime/server/db";
3
4
  import { resolveChatContext } from "#chat-runtime/server/utils/chat-context";
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
2
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { createError, defineEventHandler, getRouterParam, readBody } from "h3";
1
2
  import { eq, and } from "drizzle-orm";
2
3
  import { useDb, schema } from "#chat-runtime/server/db";
3
4
  import { resolveChatContext } from "#chat-runtime/server/utils/chat-context";