@meistrari/chat-nuxt 3.0.0 → 3.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 (55) hide show
  1. package/README.md +99 -14
  2. package/dist/module.d.mts +1 -1
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/embed/components/chat-configuration-modal.vue +59 -176
  5. package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +13 -2
  6. package/dist/runtime/embed/components/chat-embed-inner.vue +22 -3
  7. package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +13 -2
  8. package/dist/runtime/embed/components/chat-embed.d.vue.ts +11 -1
  9. package/dist/runtime/embed/components/chat-embed.vue +7 -1
  10. package/dist/runtime/embed/components/chat-embed.vue.d.ts +11 -1
  11. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.d.vue.ts +13 -0
  12. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.vue +167 -0
  13. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.vue.d.ts +13 -0
  14. package/dist/runtime/embed/components/meistrari-chat-embed.d.vue.ts +9 -4
  15. package/dist/runtime/embed/components/meistrari-chat-embed.vue +14 -2
  16. package/dist/runtime/embed/components/meistrari-chat-embed.vue.d.ts +9 -4
  17. package/dist/runtime/embed/types.d.ts +14 -0
  18. package/dist/runtime/files/file-limits.d.ts +2 -0
  19. package/dist/runtime/files/file-limits.js +2 -0
  20. package/dist/runtime/messages/components/chat-context-config.vue +2 -2
  21. package/dist/runtime/messages/components/chat-message-input.vue +1 -1
  22. package/dist/runtime/messages/composables/chat.js +4 -3
  23. package/dist/runtime/shared/chat-api-error.d.ts +1 -0
  24. package/dist/runtime/shared/chat-api-error.js +5 -0
  25. package/dist/runtime/types/embed.d.ts +1 -1
  26. package/dist/runtime/types/schemas/chat/workspace-agent.d.ts +33 -0
  27. package/dist/runtime/types/schemas/chat/workspace-agent.js +12 -0
  28. package/dist/runtime/types/schemas/index.d.ts +1 -0
  29. package/dist/runtime/types/schemas/index.js +1 -0
  30. package/dist/runtime/types/workspace-settings.d.ts +1 -1
  31. package/dist/runtime/workspace/composables/github-skills-callback.js +1 -1
  32. package/dist/runtime/workspace/composables/workspace-agent.d.ts +8 -0
  33. package/dist/runtime/workspace/composables/workspace-agent.js +89 -0
  34. package/dist/types.d.mts +1 -1
  35. package/package.json +1 -1
  36. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.d.vue.ts +0 -22
  37. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.vue +0 -133
  38. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.vue.d.ts +0 -22
  39. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.d.vue.ts +0 -32
  40. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.vue +0 -222
  41. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.vue.d.ts +0 -32
  42. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.d.vue.ts +0 -10
  43. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue +0 -37
  44. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue.d.ts +0 -10
  45. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.d.vue.ts +0 -20
  46. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue +0 -146
  47. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue.d.ts +0 -20
  48. package/dist/runtime/workspace/composables/workspace-context-files.d.ts +0 -19
  49. package/dist/runtime/workspace/composables/workspace-context-files.js +0 -83
  50. package/dist/runtime/workspace/composables/workspace-external-skills.d.ts +0 -22
  51. package/dist/runtime/workspace/composables/workspace-external-skills.js +0 -137
  52. package/dist/runtime/workspace/composables/workspace-personalization.d.ts +0 -6
  53. package/dist/runtime/workspace/composables/workspace-personalization.js +0 -18
  54. package/dist/runtime/workspace/composables/workspace-tela-tools.d.ts +0 -13
  55. package/dist/runtime/workspace/composables/workspace-tela-tools.js +0 -91
@@ -10,6 +10,7 @@ export * from './chat/primitives';
10
10
  export * from './chat/titles';
11
11
  export * from './chat/ui';
12
12
  export * from './chat/usage';
13
+ export * from './chat/workspace-agent';
13
14
  export * from './chat/workspace-settings';
14
15
  export * from './integrations/agent-api';
15
16
  export * from './integrations/tela-agent-api';
@@ -10,6 +10,7 @@ export * from './chat/primitives';
10
10
  export * from './chat/titles';
11
11
  export * from './chat/ui';
12
12
  export * from './chat/usage';
13
+ export * from './chat/workspace-agent';
13
14
  export * from './chat/workspace-settings';
14
15
  export * from './integrations/agent-api';
15
16
  export * from './integrations/tela-agent-api';
@@ -1,5 +1,5 @@
1
1
  import type { WorkspaceSettingsUpdate } from './schemas/chat/workspace-settings.js';
2
- export type ChatConfigurationTab = 'personalization' | 'context-files' | 'knowledge-sources' | 'tela-tools' | 'external-skills' | 'credentials';
2
+ export type ChatConfigurationTab = 'agent' | 'knowledge-sources' | 'credentials';
3
3
  export type ChatConfigurationSavePayload = {
4
4
  updates: WorkspaceSettingsUpdate;
5
5
  onSaved: () => void;
@@ -16,7 +16,7 @@ export function useGitHubSkillsCallback() {
16
16
  text: `GitHub conectado: ${account}`,
17
17
  icon: "i-ph-check-circle"
18
18
  });
19
- openModal("external-skills");
19
+ openModal();
20
20
  } else if (status === "cancelled") {
21
21
  statusToast.update({
22
22
  text: "Conex\xE3o cancelada",
@@ -0,0 +1,8 @@
1
+ import type { WorkspaceAgentStatusResponse } from '../../types/schemas/chat/workspace-agent.js';
2
+ export declare function useWorkspaceAgent(): {
3
+ status: any;
4
+ loading: any;
5
+ creating: any;
6
+ fetchStatus: () => Promise<WorkspaceAgentStatusResponse>;
7
+ createAgent: () => Promise<WorkspaceAgentStatusResponse | null>;
8
+ };
@@ -0,0 +1,89 @@
1
+ import * as Sentry from "@sentry/nuxt";
2
+ import { workspaceAgentStatusResponseSchema } from "../../types/schemas/chat/workspace-agent.js";
3
+ import { useChatAuth } from "#chat-auth";
4
+ import { useChatApi } from "../../shared/composables/chat-api.js";
5
+ import { useEmbedConfig } from "../../embed/composables/embed-config.js";
6
+ function assertWorkspaceAgentStatusResponse(value) {
7
+ const parsed = workspaceAgentStatusResponseSchema.safeParse(value);
8
+ if (!parsed.success)
9
+ throw new Error("Invalid workspace agent status response");
10
+ return parsed.data;
11
+ }
12
+ export function useWorkspaceAgent() {
13
+ const chatApi = useChatApi();
14
+ const embedConfig = useEmbedConfig();
15
+ const { activeOrganization } = useChatAuth();
16
+ const workspaceScope = computed(() => embedConfig?.workspaceId.value.trim() || activeOrganization.value?.id?.trim() || "default");
17
+ const statusBuckets = useState("workspace-agent-status", () => ({}));
18
+ const loadingBuckets = useState("workspace-agent-loading", () => ({}));
19
+ const creatingBuckets = useState("workspace-agent-creating", () => ({}));
20
+ const status = computed({
21
+ get: () => statusBuckets.value[workspaceScope.value] ?? null,
22
+ set: (value) => {
23
+ statusBuckets.value = {
24
+ ...statusBuckets.value,
25
+ [workspaceScope.value]: value
26
+ };
27
+ }
28
+ });
29
+ const loading = computed({
30
+ get: () => loadingBuckets.value[workspaceScope.value] ?? false,
31
+ set: (value) => {
32
+ loadingBuckets.value = {
33
+ ...loadingBuckets.value,
34
+ [workspaceScope.value]: value
35
+ };
36
+ }
37
+ });
38
+ const creating = computed({
39
+ get: () => creatingBuckets.value[workspaceScope.value] ?? false,
40
+ set: (value) => {
41
+ creatingBuckets.value = {
42
+ ...creatingBuckets.value,
43
+ [workspaceScope.value]: value
44
+ };
45
+ }
46
+ });
47
+ function requestArgs(options) {
48
+ if (embedConfig !== null)
49
+ return [chatApi.path("/workspace/agent"), chatApi.withChatHeaders(options)];
50
+ return ["/api/workspace/agent", options];
51
+ }
52
+ async function fetchStatus() {
53
+ loading.value = true;
54
+ try {
55
+ const [path, options] = requestArgs();
56
+ const data = assertWorkspaceAgentStatusResponse(await $fetch(path, options));
57
+ status.value = data;
58
+ return data;
59
+ } catch (e) {
60
+ Sentry.captureException(e);
61
+ throw e;
62
+ } finally {
63
+ loading.value = false;
64
+ }
65
+ }
66
+ async function createAgent() {
67
+ if (creating.value)
68
+ return null;
69
+ creating.value = true;
70
+ try {
71
+ const [path, options] = requestArgs({ method: "POST" });
72
+ const data = assertWorkspaceAgentStatusResponse(await $fetch(path, options));
73
+ status.value = data;
74
+ return data;
75
+ } catch (e) {
76
+ Sentry.captureException(e);
77
+ throw e;
78
+ } finally {
79
+ creating.value = false;
80
+ }
81
+ }
82
+ return {
83
+ status: readonly(status),
84
+ loading: readonly(loading),
85
+ creating: readonly(creating),
86
+ fetchStatus,
87
+ createAgent
88
+ };
89
+ }
package/dist/types.d.mts CHANGED
@@ -4,7 +4,7 @@ import type { default as Module } from './module.mjs'
4
4
 
5
5
  export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
6
 
7
- export { type ChatActionPayload, type ChatActor, type ChatEmbedSharedProps, type ChatFeatureConfig, type DefaultChatEmbedProps, type MeistrariChatEmbedProps, type MessageFeedbackConfig, type MessageFeedbackPayload, type MessageFeedbackRating, type TelaAgentChatEmbedProps, type TelaAgentExecutionInput } from '../dist/runtime/types/embed.js'
7
+ export { type ChatActionPayload, type ChatActor, type ChatEmbedSharedProps, type ChatFeatureConfig, type ChatSidebarConfig, type DefaultChatEmbedProps, type MeistrariChatEmbedProps, type MessageFeedbackConfig, type MessageFeedbackPayload, type MessageFeedbackRating, type TelaAgentChatEmbedProps, type TelaAgentExecutionInput } from '../dist/runtime/types/embed.js'
8
8
 
9
9
  export { default } from './module.mjs'
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,22 +0,0 @@
1
- import type { ContextFile } from '../../../types/schemas/chat/files.js';
2
- type __VLS_Props = {
3
- searchQuery: string;
4
- filteredContextFiles: readonly ContextFile[];
5
- filteredPendingFiles: readonly File[];
6
- currentFileCount: number;
7
- maxFiles: number;
8
- getFileType: (fileName: 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
- handleFileSelect: (event: Event) => any;
13
- removePendingFile: (file: File) => any;
14
- removeContextFile: (url: string) => any;
15
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
- "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
17
- onHandleFileSelect?: ((event: Event) => any) | undefined;
18
- onRemovePendingFile?: ((file: File) => any) | undefined;
19
- onRemoveContextFile?: ((url: string) => any) | undefined;
20
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
- declare const _default: typeof __VLS_export;
22
- export default _default;
@@ -1,133 +0,0 @@
1
- <script setup>
2
- defineProps({
3
- searchQuery: { type: String, required: true },
4
- filteredContextFiles: { type: Array, required: true },
5
- filteredPendingFiles: { type: Array, required: true },
6
- currentFileCount: { type: Number, required: true },
7
- maxFiles: { type: Number, required: true },
8
- getFileType: { type: Function, required: true }
9
- });
10
- const emit = defineEmits(["update:searchQuery", "handleFileSelect", "removePendingFile", "removeContextFile"]);
11
- const fileInputRef = ref(null);
12
- function openFileDialog() {
13
- fileInputRef.value?.click();
14
- }
15
- function onFileChange(event) {
16
- emit("handleFileSelect", event);
17
- }
18
- </script>
19
-
20
- <template>
21
- <div mb-24px>
22
- <h2 text-16px font-semibold text-primary tracking="-.2px" leading-20px>
23
- Arquivos de contexto
24
- </h2>
25
- <div h-px bg-gray-200 mt-24px />
26
- </div>
27
-
28
- <input ref="fileInputRef" type="file" multiple hidden @change="onFileChange">
29
-
30
- <div flex items-center justify-between mb-24px>
31
- <div
32
- flex items-center gap-8px
33
- w-240px pl-12px pr-8px py-4px
34
- bg-white b=".5px gray-200" rounded-10px
35
- shadow-sm
36
- >
37
- <div i-ph-magnifying-glass text-12px text-gray-400 />
38
- <input
39
- :value="searchQuery"
40
- type="text"
41
- placeholder="Buscar"
42
- text-14px text-primary placeholder:text-gray-400
43
- bg-transparent border-none outline-none
44
- flex-1 leading-18px tracking="-.15px"
45
- @input="emit('update:searchQuery', $event.target.value)"
46
- >
47
- </div>
48
- <button
49
- px-16px py-10px
50
- bg-white b=".5px gray-200" rounded-12px
51
- text-16px font-semibold text-gray-900
52
- cursor-pointer hover:bg-gray-50 transition
53
- :disabled="currentFileCount >= maxFiles"
54
- :class="{ 'opacity-50 cursor-not-allowed': currentFileCount >= maxFiles }"
55
- @click="openFileDialog"
56
- >
57
- Enviar
58
- </button>
59
- </div>
60
-
61
- <div w-full>
62
- <div flex items-center b-y=".5px gray-200" bg-white>
63
- <div flex-1 px-20px py-12px>
64
- <span text-12px font-semibold text-primary leading-16px>Nome</span>
65
- </div>
66
- <div w-100px px-20px py-12px>
67
- <span text-12px font-semibold text-primary leading-16px>Tipo</span>
68
- </div>
69
- <div w-40px />
70
- </div>
71
-
72
- <div>
73
- <div
74
- v-for="file in filteredContextFiles"
75
- :key="`existing-${file.url}`"
76
- flex items-center b-b=".5px gray-100" bg-white
77
- >
78
- <div flex items-center gap-8px flex-1 h-48px px-20px py-12px>
79
- <div i-ph-file-pdf text-16px text-red-500 shrink-0 />
80
- <span text-14px text-gray-900 leading-18px tracking="-.15px" truncate>
81
- {{ file.name }}
82
- </span>
83
- </div>
84
- <div w-100px h-48px px-20px py-12px flex items-center>
85
- <span text-12px text-tertiary leading-16px>
86
- {{ getFileType(file.name) }}
87
- </span>
88
- </div>
89
- <div w-40px px-8px py-12px>
90
- <button
91
- p-4px rounded-6px hover:bg-gray-100 transition cursor-pointer
92
- @click="emit('removeContextFile', file.url)"
93
- >
94
- <div i-ph-x text-16px text-primary />
95
- </button>
96
- </div>
97
- </div>
98
-
99
- <div
100
- v-for="file in filteredPendingFiles"
101
- :key="`pending-${file.name}-${file.size}-${file.lastModified}`"
102
- flex items-center b-b=".5px blue-200" bg-blue-50
103
- >
104
- <div flex items-center gap-8px flex-1 h-48px px-20px py-12px>
105
- <div i-ph-file-pdf text-16px text-blue-500 shrink-0 />
106
- <span text-14px text-blue-900 leading-18px tracking="-.15px" truncate>
107
- {{ file.name }}
108
- </span>
109
- </div>
110
- <div w-100px h-48px px-20px py-12px flex items-center>
111
- <span text-12px text-blue-500 leading-16px>
112
- {{ getFileType(file.name) }}
113
- </span>
114
- </div>
115
- <div w-40px px-8px py-12px>
116
- <button
117
- p-4px rounded-6px hover:bg-blue-100 transition cursor-pointer
118
- @click="emit('removePendingFile', file)"
119
- >
120
- <div i-ph-x text-16px text-blue-500 />
121
- </button>
122
- </div>
123
- </div>
124
-
125
- <div
126
- v-if="filteredContextFiles.length === 0 && filteredPendingFiles.length === 0"
127
- flex items-center justify-center py-48px text-14px text-tertiary
128
- >
129
- Nenhum arquivo adicionado ainda
130
- </div>
131
- </div>
132
- </div>
133
- </template>
@@ -1,22 +0,0 @@
1
- import type { ContextFile } from '../../../types/schemas/chat/files.js';
2
- type __VLS_Props = {
3
- searchQuery: string;
4
- filteredContextFiles: readonly ContextFile[];
5
- filteredPendingFiles: readonly File[];
6
- currentFileCount: number;
7
- maxFiles: number;
8
- getFileType: (fileName: 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
- handleFileSelect: (event: Event) => any;
13
- removePendingFile: (file: File) => any;
14
- removeContextFile: (url: string) => any;
15
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
- "onUpdate:searchQuery"?: ((value: string) => any) | undefined;
17
- onHandleFileSelect?: ((event: Event) => any) | undefined;
18
- onRemovePendingFile?: ((file: File) => any) | undefined;
19
- onRemoveContextFile?: ((url: string) => any) | undefined;
20
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
- declare const _default: typeof __VLS_export;
22
- export default _default;
@@ -1,32 +0,0 @@
1
- import type { ExternalSkill } from '../../../types/schemas/chat/workspace-settings.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;
@@ -1,222 +0,0 @@
1
- <script setup>
2
- defineProps({
3
- searchQuery: { type: String, required: true },
4
- displayedSkills: { type: Array, required: true },
5
- filteredSkills: { type: Array, required: true },
6
- hasChanges: { type: Boolean, required: true },
7
- isPending: { type: Function, required: true },
8
- skillModalOpen: { type: Boolean, required: true },
9
- skillRefInput: { type: String, required: true },
10
- skillError: { type: String, required: true },
11
- discoveringSkills: { type: Boolean, required: true },
12
- gitHubButtonText: { type: String, required: true }
13
- });
14
- const emit = defineEmits(["update:searchQuery", "update:skillModalOpen", "update:skillRefInput", "removeSkill", "closeSkillModal", "handleAddSkillAndClose", "connectGitHub"]);
15
- const gitHubIconUrl = "/chat-assets/github.svg";
16
- </script>
17
-
18
- <template>
19
- <div mb-24px>
20
- <h2 text-16px font-semibold text-primary tracking="-.2px" leading-20px>
21
- Skills Externas
22
- </h2>
23
- <div h-px bg-gray-200 mt-24px />
24
- </div>
25
-
26
- <div v-if="displayedSkills.length === 0 && !hasChanges" flex="~ col" items-center justify-center h-400px gap-24px>
27
- <div
28
- w-88px h-64px rounded-10px bg-white b=".5px gray-100"
29
- flex items-center justify-center
30
- shadow-sm
31
- >
32
- <div i-ph-wrench text-32px style="color: #DFE3E7;" />
33
- </div>
34
- <p text-20px font-semibold text-primary tracking="-.5px" leading-24px text-center>
35
- Sua equipe ainda não<br>adicionou skills externas
36
- </p>
37
- <div flex items-center gap-12px>
38
- <TelaButton
39
- variant="primary"
40
- @click="emit('update:skillModalOpen', true)"
41
- >
42
- <div i-ph-plus text-16px />
43
- <span>Adicionar Skill</span>
44
- </TelaButton>
45
- <TelaButton
46
- variant="secondary"
47
- @click="emit('connectGitHub')"
48
- >
49
- <img :src="gitHubIconUrl">
50
- <span>{{ gitHubButtonText }}</span>
51
- </TelaButton>
52
- </div>
53
- </div>
54
-
55
- <template v-else>
56
- <div flex items-center justify-between mb-24px>
57
- <div
58
- flex items-center gap-8px
59
- w-240px pl-12px
60
- bg-white b=".5px gray-200" rounded-10px
61
- shadow-sm
62
- >
63
- <div i-ph-magnifying-glass text-12px text-gray-400 />
64
- <input
65
- :value="searchQuery"
66
- type="text"
67
- placeholder="Buscar skills"
68
- text-14px text-primary placeholder:text-gray-400 h-32px
69
- bg-transparent border-none outline-none
70
- flex-1 leading-18px tracking="-.15px"
71
- @input="emit('update:searchQuery', $event.target.value)"
72
- >
73
- </div>
74
-
75
- <div flex items-center gap-8px>
76
- <TelaButton
77
- variant="secondary"
78
- @click="emit('update:skillModalOpen', true)"
79
- >
80
- <div i-ph-plus text-16px />
81
- <span>Adicionar Skill</span>
82
- </TelaButton>
83
- <TelaButton
84
- variant="secondary"
85
- @click="emit('connectGitHub')"
86
- >
87
- <img :src="gitHubIconUrl">
88
- <span>{{ gitHubButtonText }}</span>
89
- </TelaButton>
90
- </div>
91
- </div>
92
-
93
- <div max-h-400px overflow-y-auto>
94
- <TelaTable class="table-fixed" w-full>
95
- <TelaTableHeader>
96
- <TelaTableRow>
97
- <TelaTableHead class="!py-12px text-12px font-semibold text-primary leading-16px w-160px!">
98
- Skill
99
- </TelaTableHead>
100
- <TelaTableHead class="!py-12px !w-280px text-12px font-semibold text-primary leading-16px">
101
- Fonte
102
- </TelaTableHead>
103
- <TelaTableHead class="!py-12px !w-48px" />
104
- </TelaTableRow>
105
- </TelaTableHeader>
106
- <TelaTableBody>
107
- <TelaTableRow
108
- v-for="skill in filteredSkills"
109
- :key="skill.ref"
110
- hover:bg-gray-50 transition
111
- :class="{
112
- 'bg-blue-50': isPending(skill.ref)
113
- }"
114
- >
115
- <TelaTableCell>
116
- <div flex="~ col" gap-2px>
117
- <span text-14px text-gray-900 tracking="-.15px" truncate>
118
- {{ skill.name }}
119
- </span>
120
- </div>
121
- </TelaTableCell>
122
- <TelaTableCell>
123
- <div flex items-center gap-8px>
124
- <span text-12px text-tertiary truncate font-mono>
125
- {{ skill.ref }}
126
- </span>
127
- <TelaBadge v-if="!skill.isPublic">
128
- Privado
129
- </TelaBadge>
130
- </div>
131
- </TelaTableCell>
132
- <TelaTableCell class="!w-48px">
133
- <TelaDropdownMenu
134
- :items="[
135
- {
136
- label: 'Excluir',
137
- icon: 'i-ph-trash',
138
- color: 'negative',
139
- click: () => emit('removeSkill', skill.ref)
140
- }
141
- ]"
142
- align="end"
143
- >
144
- <button
145
- p-4px rounded-6px text-gray-400
146
- hover:text-gray-600 hover:bg-gray-100
147
- cursor-pointer transition
148
- >
149
- <div i-ph-dots-three text-16px />
150
- </button>
151
- </TelaDropdownMenu>
152
- </TelaTableCell>
153
- </TelaTableRow>
154
- </TelaTableBody>
155
- </TelaTable>
156
- </div>
157
- </template>
158
-
159
- <TelaModal
160
- :model-value="skillModalOpen"
161
- !w-420px
162
- !p-20px
163
- hide-header
164
- @update:model-value="(v) => {
165
- if (!v) emit('closeSkillModal');
166
- }"
167
- >
168
- <div flex="~ col" w-full>
169
- <div flex items-center justify-between mb-16px>
170
- <span text-12px font-460 leading-16px text-black-500>
171
- Adicionar Skill
172
- </span>
173
- <button
174
- p-4px rounded-8px
175
- hover:bg-gray-100
176
- transition cursor-pointer
177
- @click="emit('closeSkillModal')"
178
- >
179
- <div i-ph-x text-20px />
180
- </button>
181
- </div>
182
-
183
- <div flex="~ col" gap-8px>
184
- <label text-14px font-580 leading-16px tracking="-.15px" text-primary>
185
- Referência da Skill
186
- </label>
187
- <TelaInput
188
- :model-value="skillRefInput"
189
- type="text"
190
- size="sm"
191
- placeholder="github.com/owner/repo/tree/main/path"
192
- :disabled="discoveringSkills"
193
- @update:model-value="(v) => emit('update:skillRefInput', v)"
194
- />
195
- <p v-if="skillError" text-12px text-red-500>
196
- {{ skillError }}
197
- </p>
198
- <p v-else text-12px font-400 leading-16px text-secondary>
199
- Cole a URL do repositório ou a referência gh:owner/repo/path
200
- </p>
201
- </div>
202
-
203
- <div flex justify-end gap-12px mt-24px>
204
- <TelaButton
205
- variant="secondary"
206
- :disabled="discoveringSkills"
207
- @click="emit('closeSkillModal')"
208
- >
209
- Cancelar
210
- </TelaButton>
211
- <TelaButton
212
- variant="primary"
213
- :disabled="discoveringSkills"
214
- @click="emit('handleAddSkillAndClose')"
215
- >
216
- <div v-if="discoveringSkills" i-ph-spinner animate-spin text-14px />
217
- <span>{{ discoveringSkills ? "Buscando..." : "Adicionar" }}</span>
218
- </TelaButton>
219
- </div>
220
- </div>
221
- </TelaModal>
222
- </template>
@@ -1,32 +0,0 @@
1
- import type { ExternalSkill } from '../../../types/schemas/chat/workspace-settings.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;
@@ -1,10 +0,0 @@
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;