@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.
- package/README.md +99 -14
- package/dist/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/embed/components/chat-configuration-modal.vue +59 -176
- package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +13 -2
- package/dist/runtime/embed/components/chat-embed-inner.vue +22 -3
- package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +13 -2
- package/dist/runtime/embed/components/chat-embed.d.vue.ts +11 -1
- package/dist/runtime/embed/components/chat-embed.vue +7 -1
- package/dist/runtime/embed/components/chat-embed.vue.d.ts +11 -1
- package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.d.vue.ts +13 -0
- package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.vue +167 -0
- package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.vue.d.ts +13 -0
- package/dist/runtime/embed/components/meistrari-chat-embed.d.vue.ts +9 -4
- package/dist/runtime/embed/components/meistrari-chat-embed.vue +14 -2
- package/dist/runtime/embed/components/meistrari-chat-embed.vue.d.ts +9 -4
- package/dist/runtime/embed/types.d.ts +14 -0
- package/dist/runtime/files/file-limits.d.ts +2 -0
- package/dist/runtime/files/file-limits.js +2 -0
- package/dist/runtime/messages/components/chat-context-config.vue +2 -2
- package/dist/runtime/messages/components/chat-message-input.vue +1 -1
- package/dist/runtime/messages/composables/chat.js +4 -3
- package/dist/runtime/shared/chat-api-error.d.ts +1 -0
- package/dist/runtime/shared/chat-api-error.js +5 -0
- package/dist/runtime/types/embed.d.ts +1 -1
- package/dist/runtime/types/schemas/chat/workspace-agent.d.ts +33 -0
- package/dist/runtime/types/schemas/chat/workspace-agent.js +12 -0
- package/dist/runtime/types/schemas/index.d.ts +1 -0
- package/dist/runtime/types/schemas/index.js +1 -0
- package/dist/runtime/types/workspace-settings.d.ts +1 -1
- package/dist/runtime/workspace/composables/github-skills-callback.js +1 -1
- package/dist/runtime/workspace/composables/workspace-agent.d.ts +8 -0
- package/dist/runtime/workspace/composables/workspace-agent.js +89 -0
- package/dist/types.d.mts +1 -1
- package/package.json +1 -1
- package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.d.vue.ts +0 -22
- package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.vue +0 -133
- package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.vue.d.ts +0 -22
- package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.d.vue.ts +0 -32
- package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.vue +0 -222
- package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.vue.d.ts +0 -32
- package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.d.vue.ts +0 -10
- package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue +0 -37
- package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue.d.ts +0 -10
- package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.d.vue.ts +0 -20
- package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue +0 -146
- package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue.d.ts +0 -20
- package/dist/runtime/workspace/composables/workspace-context-files.d.ts +0 -19
- package/dist/runtime/workspace/composables/workspace-context-files.js +0 -83
- package/dist/runtime/workspace/composables/workspace-external-skills.d.ts +0 -22
- package/dist/runtime/workspace/composables/workspace-external-skills.js +0 -137
- package/dist/runtime/workspace/composables/workspace-personalization.d.ts +0 -6
- package/dist/runtime/workspace/composables/workspace-personalization.js +0 -18
- package/dist/runtime/workspace/composables/workspace-tela-tools.d.ts +0 -13
- package/dist/runtime/workspace/composables/workspace-tela-tools.js +0 -91
package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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: "Sempre forneça fontes para conclusões importantes", "Mantenha um tom profissional", ou "Diferencie fatos de interpretações""
|
|
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>
|
package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue.d.ts
DELETED
|
@@ -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;
|
package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.d.vue.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { TelaCanvas } from '../../../types/schemas/integrations/tela-api.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,146 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { formatAbsoluteDate } from "../../../shared/date-formatting";
|
|
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>
|
package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { TelaCanvas } from '../../../types/schemas/integrations/tela-api.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,19 +0,0 @@
|
|
|
1
|
-
import type { ContextFile } from '../../types/schemas/chat/files.js';
|
|
2
|
-
export declare const MAX_FILES = 10;
|
|
3
|
-
export declare const MAX_FILE_SIZE: number;
|
|
4
|
-
export declare function useWorkspaceContextFiles(searchQuery: Ref<string>, currentContextFiles: Ref<readonly ContextFile[] | null | undefined> | ComputedRef<readonly ContextFile[] | null | undefined>): {
|
|
5
|
-
pendingFiles: any;
|
|
6
|
-
filteredContextFiles: any;
|
|
7
|
-
filteredPendingFiles: any;
|
|
8
|
-
currentFileCount: any;
|
|
9
|
-
hasChanges: any;
|
|
10
|
-
maxFiles: number;
|
|
11
|
-
handleFileSelect: (event: Event) => void;
|
|
12
|
-
removePendingFile: (file: File) => void;
|
|
13
|
-
removeContextFile: (url: string) => void;
|
|
14
|
-
getFileType: (fileName: string) => string;
|
|
15
|
-
initialize: () => void;
|
|
16
|
-
getPendingFiles: () => File[];
|
|
17
|
-
getKeptContextFiles: () => ContextFile[];
|
|
18
|
-
clearPendingFiles: () => void;
|
|
19
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
export const MAX_FILES = 10;
|
|
2
|
-
export const MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
3
|
-
export function useWorkspaceContextFiles(searchQuery, currentContextFiles) {
|
|
4
|
-
const pendingFiles = ref([]);
|
|
5
|
-
const removedUrls = ref(/* @__PURE__ */ new Set());
|
|
6
|
-
const effectiveContextFiles = computed(
|
|
7
|
-
() => (currentContextFiles.value ?? []).filter((file) => !removedUrls.value.has(file.url))
|
|
8
|
-
);
|
|
9
|
-
const filteredContextFiles = computed(() => {
|
|
10
|
-
if (!searchQuery.value.trim())
|
|
11
|
-
return effectiveContextFiles.value;
|
|
12
|
-
const query = searchQuery.value.toLowerCase();
|
|
13
|
-
return effectiveContextFiles.value.filter(
|
|
14
|
-
(file) => file.name.toLowerCase().includes(query)
|
|
15
|
-
);
|
|
16
|
-
});
|
|
17
|
-
const filteredPendingFiles = computed(() => {
|
|
18
|
-
if (!searchQuery.value.trim())
|
|
19
|
-
return pendingFiles.value;
|
|
20
|
-
const query = searchQuery.value.toLowerCase();
|
|
21
|
-
return pendingFiles.value.filter(
|
|
22
|
-
(file) => file.name.toLowerCase().includes(query)
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
const currentFileCount = computed(
|
|
26
|
-
() => effectiveContextFiles.value.length + pendingFiles.value.length
|
|
27
|
-
);
|
|
28
|
-
const hasChanges = computed(
|
|
29
|
-
() => pendingFiles.value.length > 0 || removedUrls.value.size > 0
|
|
30
|
-
);
|
|
31
|
-
function handleFileSelect(event) {
|
|
32
|
-
const target = event.target;
|
|
33
|
-
if (!target.files)
|
|
34
|
-
return;
|
|
35
|
-
const newFiles = Array.from(target.files).filter((file) => file.size <= MAX_FILE_SIZE);
|
|
36
|
-
const availableSlots = MAX_FILES - currentFileCount.value;
|
|
37
|
-
pendingFiles.value = [...pendingFiles.value, ...newFiles.slice(0, availableSlots)];
|
|
38
|
-
target.value = "";
|
|
39
|
-
}
|
|
40
|
-
function removePendingFile(file) {
|
|
41
|
-
const idx = pendingFiles.value.indexOf(file);
|
|
42
|
-
if (idx !== -1)
|
|
43
|
-
pendingFiles.value = pendingFiles.value.filter((_, i) => i !== idx);
|
|
44
|
-
}
|
|
45
|
-
function removeContextFile(url) {
|
|
46
|
-
const next = new Set(removedUrls.value);
|
|
47
|
-
next.add(url);
|
|
48
|
-
removedUrls.value = next;
|
|
49
|
-
}
|
|
50
|
-
function getFileType(fileName) {
|
|
51
|
-
return fileName.split(".").pop()?.toUpperCase() ?? "";
|
|
52
|
-
}
|
|
53
|
-
function initialize() {
|
|
54
|
-
pendingFiles.value = [];
|
|
55
|
-
removedUrls.value = /* @__PURE__ */ new Set();
|
|
56
|
-
}
|
|
57
|
-
function getPendingFiles() {
|
|
58
|
-
return [...pendingFiles.value];
|
|
59
|
-
}
|
|
60
|
-
function getKeptContextFiles() {
|
|
61
|
-
return [...effectiveContextFiles.value];
|
|
62
|
-
}
|
|
63
|
-
function clearPendingFiles() {
|
|
64
|
-
pendingFiles.value = [];
|
|
65
|
-
removedUrls.value = /* @__PURE__ */ new Set();
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
pendingFiles: readonly(pendingFiles),
|
|
69
|
-
filteredContextFiles,
|
|
70
|
-
filteredPendingFiles,
|
|
71
|
-
currentFileCount,
|
|
72
|
-
hasChanges,
|
|
73
|
-
maxFiles: MAX_FILES,
|
|
74
|
-
handleFileSelect,
|
|
75
|
-
removePendingFile,
|
|
76
|
-
removeContextFile,
|
|
77
|
-
getFileType,
|
|
78
|
-
initialize,
|
|
79
|
-
getPendingFiles,
|
|
80
|
-
getKeptContextFiles,
|
|
81
|
-
clearPendingFiles
|
|
82
|
-
};
|
|
83
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ExternalSkill } from '../../types/schemas/chat/workspace-settings.js';
|
|
2
|
-
export declare function useWorkspaceExternalSkills(currentExternalSkills: Ref<readonly ExternalSkill[] | null | undefined> | ComputedRef<readonly ExternalSkill[] | null | undefined>, searchQuery?: Ref<string>): {
|
|
3
|
-
displayedSkills: any;
|
|
4
|
-
filteredSkills: any;
|
|
5
|
-
hasChanges: any;
|
|
6
|
-
isPending: (ref: string) => boolean;
|
|
7
|
-
addSkill: (skill: ExternalSkill) => void;
|
|
8
|
-
removeSkill: (ref: string) => void;
|
|
9
|
-
buildExternalSkills: () => ExternalSkill[] | null;
|
|
10
|
-
initialize: () => void;
|
|
11
|
-
skillModalOpen: any;
|
|
12
|
-
skillRefInput: any;
|
|
13
|
-
skillError: any;
|
|
14
|
-
discoveringSkills: any;
|
|
15
|
-
handleAddSkill: () => Promise<void>;
|
|
16
|
-
closeSkillModal: () => void;
|
|
17
|
-
handleAddSkillAndClose: () => Promise<void>;
|
|
18
|
-
getGitHubButtonText: () => string;
|
|
19
|
-
skillsConnection: any;
|
|
20
|
-
fetchGitHubConnection: () => Promise<void>;
|
|
21
|
-
connectGitHub: () => void;
|
|
22
|
-
};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { useChatAuth } from "#chat-auth";
|
|
2
|
-
import { getChatApiErrorMessage } from "../../shared/chat-api-error.js";
|
|
3
|
-
import { useGitHubSkills } from "./github-skills.js";
|
|
4
|
-
export function useWorkspaceExternalSkills(currentExternalSkills, searchQuery) {
|
|
5
|
-
const { user } = useChatAuth();
|
|
6
|
-
const { connection: skillsConnection, fetchConnection: fetchGitHubConnection, connect: connectGitHub } = useGitHubSkills();
|
|
7
|
-
const pendingSkills = ref([]);
|
|
8
|
-
const removedRefs = ref([]);
|
|
9
|
-
const skillModalOpen = ref(false);
|
|
10
|
-
const skillRefInput = ref("");
|
|
11
|
-
const skillError = ref("");
|
|
12
|
-
const discoveringSkills = ref(false);
|
|
13
|
-
const displayedSkills = computed(() => {
|
|
14
|
-
const current = (currentExternalSkills.value ?? []).filter((s) => !removedRefs.value.includes(s.ref));
|
|
15
|
-
return [...current, ...pendingSkills.value];
|
|
16
|
-
});
|
|
17
|
-
const filteredSkills = computed(() => {
|
|
18
|
-
const query = searchQuery?.value?.trim().toLowerCase();
|
|
19
|
-
if (!query)
|
|
20
|
-
return displayedSkills.value;
|
|
21
|
-
return displayedSkills.value.filter(
|
|
22
|
-
(skill) => skill.name.toLowerCase().includes(query) || skill.ref.toLowerCase().includes(query)
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
const hasChanges = computed(() => {
|
|
26
|
-
return pendingSkills.value.length > 0 || removedRefs.value.length > 0;
|
|
27
|
-
});
|
|
28
|
-
function isPending(ref2) {
|
|
29
|
-
return pendingSkills.value.some((s) => s.ref === ref2);
|
|
30
|
-
}
|
|
31
|
-
function addSkill(skill) {
|
|
32
|
-
pendingSkills.value = [...pendingSkills.value, skill];
|
|
33
|
-
}
|
|
34
|
-
function removeSkill(ref2) {
|
|
35
|
-
const pendingIndex = pendingSkills.value.findIndex((s) => s.ref === ref2);
|
|
36
|
-
if (pendingIndex !== -1) {
|
|
37
|
-
pendingSkills.value = pendingSkills.value.filter((_, i) => i !== pendingIndex);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
removedRefs.value = [...removedRefs.value, ref2];
|
|
41
|
-
}
|
|
42
|
-
function buildExternalSkills() {
|
|
43
|
-
const currentSkills = (currentExternalSkills.value ?? []).filter((s) => !removedRefs.value.includes(s.ref)).map((s) => ({
|
|
44
|
-
...s,
|
|
45
|
-
allowedTools: [...s.allowedTools],
|
|
46
|
-
addedBy: { ...s.addedBy }
|
|
47
|
-
}));
|
|
48
|
-
const finalSkills = [...currentSkills, ...pendingSkills.value];
|
|
49
|
-
return finalSkills.length > 0 ? finalSkills : null;
|
|
50
|
-
}
|
|
51
|
-
async function handleAddSkill() {
|
|
52
|
-
const inputRef = skillRefInput.value.trim();
|
|
53
|
-
if (!inputRef || discoveringSkills.value)
|
|
54
|
-
return;
|
|
55
|
-
skillError.value = "";
|
|
56
|
-
discoveringSkills.value = true;
|
|
57
|
-
try {
|
|
58
|
-
const metadata = await $fetch("/api/external-skills/discover", {
|
|
59
|
-
method: "POST",
|
|
60
|
-
body: { ref: inputRef }
|
|
61
|
-
});
|
|
62
|
-
const canonicalRef = metadata.ref;
|
|
63
|
-
if (displayedSkills.value.some((s) => s.ref === canonicalRef)) {
|
|
64
|
-
skillError.value = "Esta skill j\xE1 foi adicionada";
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const newSkill = {
|
|
68
|
-
ref: canonicalRef,
|
|
69
|
-
name: metadata.name,
|
|
70
|
-
description: metadata.description || "",
|
|
71
|
-
runtime: metadata.runtime || "unknown",
|
|
72
|
-
allowedTools: metadata.allowedTools || [],
|
|
73
|
-
isPublic: metadata.isPublic,
|
|
74
|
-
addedBy: {
|
|
75
|
-
userId: user.value?.id || "",
|
|
76
|
-
username: user.value?.name || skillsConnection.value.accountName || ""
|
|
77
|
-
},
|
|
78
|
-
addedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
79
|
-
};
|
|
80
|
-
addSkill(newSkill);
|
|
81
|
-
skillRefInput.value = "";
|
|
82
|
-
} catch (error) {
|
|
83
|
-
if (error.statusCode === 401)
|
|
84
|
-
skillError.value = "Reposit\xF3rio privado. Conecte um provedor para acessar.";
|
|
85
|
-
else if (error.statusCode === 404)
|
|
86
|
-
skillError.value = "Skill n\xE3o encontrada. Verifique se o caminho cont\xE9m um arquivo SKILL.md";
|
|
87
|
-
else
|
|
88
|
-
skillError.value = getChatApiErrorMessage(error) ?? "Erro ao buscar skill";
|
|
89
|
-
} finally {
|
|
90
|
-
discoveringSkills.value = false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function closeSkillModal() {
|
|
94
|
-
skillModalOpen.value = false;
|
|
95
|
-
skillRefInput.value = "";
|
|
96
|
-
skillError.value = "";
|
|
97
|
-
}
|
|
98
|
-
async function handleAddSkillAndClose() {
|
|
99
|
-
await handleAddSkill();
|
|
100
|
-
if (!skillError.value)
|
|
101
|
-
closeSkillModal();
|
|
102
|
-
}
|
|
103
|
-
function getGitHubButtonText() {
|
|
104
|
-
if (skillsConnection.value.connected)
|
|
105
|
-
return "Gerenciar GitHub";
|
|
106
|
-
return "Conectar GitHub";
|
|
107
|
-
}
|
|
108
|
-
function initialize() {
|
|
109
|
-
pendingSkills.value = [];
|
|
110
|
-
removedRefs.value = [];
|
|
111
|
-
skillModalOpen.value = false;
|
|
112
|
-
skillRefInput.value = "";
|
|
113
|
-
skillError.value = "";
|
|
114
|
-
discoveringSkills.value = false;
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
displayedSkills,
|
|
118
|
-
filteredSkills,
|
|
119
|
-
hasChanges,
|
|
120
|
-
isPending,
|
|
121
|
-
addSkill,
|
|
122
|
-
removeSkill,
|
|
123
|
-
buildExternalSkills,
|
|
124
|
-
initialize,
|
|
125
|
-
skillModalOpen,
|
|
126
|
-
skillRefInput,
|
|
127
|
-
skillError,
|
|
128
|
-
discoveringSkills,
|
|
129
|
-
handleAddSkill,
|
|
130
|
-
closeSkillModal,
|
|
131
|
-
handleAddSkillAndClose,
|
|
132
|
-
getGitHubButtonText,
|
|
133
|
-
skillsConnection,
|
|
134
|
-
fetchGitHubConnection,
|
|
135
|
-
connectGitHub
|
|
136
|
-
};
|
|
137
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function useWorkspacePersonalization(currentSystemMessage) {
|
|
2
|
-
const localSystemMessage = ref("");
|
|
3
|
-
const hasChanges = computed(
|
|
4
|
-
() => localSystemMessage.value !== (currentSystemMessage.value ?? "")
|
|
5
|
-
);
|
|
6
|
-
function getSystemMessage() {
|
|
7
|
-
return localSystemMessage.value.trim() || null;
|
|
8
|
-
}
|
|
9
|
-
function initialize() {
|
|
10
|
-
localSystemMessage.value = currentSystemMessage.value ?? "";
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
localSystemMessage,
|
|
14
|
-
hasChanges,
|
|
15
|
-
getSystemMessage,
|
|
16
|
-
initialize
|
|
17
|
-
};
|
|
18
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TelaCanvas, TelaProject } from '../../types/schemas/integrations/tela-api.js';
|
|
2
|
-
import type { CanvasTool } from '../../types/schemas/tools/canvas.js';
|
|
3
|
-
export declare function useWorkspaceTelaTools(canvas: Ref<TelaCanvas[]> | ComputedRef<TelaCanvas[]>, projects: Ref<TelaProject[]> | ComputedRef<TelaProject[]>, searchQuery: Ref<string>, currentCanvasTools: Ref<readonly CanvasTool[] | null | undefined> | ComputedRef<readonly CanvasTool[] | null | undefined>): {
|
|
4
|
-
selectedToolIds: any;
|
|
5
|
-
filteredCanvasTools: any;
|
|
6
|
-
allToolsSelected: any;
|
|
7
|
-
hasChanges: any;
|
|
8
|
-
toggleCanvasTool: (canvasId: string) => void;
|
|
9
|
-
toggleAllTools: (selected: boolean | "indeterminate") => void;
|
|
10
|
-
getProjectName: (projectId: string) => string;
|
|
11
|
-
buildCanvasTools: () => CanvasTool[];
|
|
12
|
-
initialize: () => void;
|
|
13
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
export function useWorkspaceTelaTools(canvas, projects, searchQuery, currentCanvasTools) {
|
|
2
|
-
const selectedToolIds = ref(/* @__PURE__ */ new Set());
|
|
3
|
-
const filteredCanvasTools = computed(() => {
|
|
4
|
-
if (!searchQuery.value.trim())
|
|
5
|
-
return canvas.value;
|
|
6
|
-
const query = searchQuery.value.toLowerCase();
|
|
7
|
-
const matchingProjectIds = new Set(
|
|
8
|
-
projects.value.filter((p) => p.title.toLowerCase().includes(query)).map((p) => p.id)
|
|
9
|
-
);
|
|
10
|
-
return canvas.value.filter(
|
|
11
|
-
(c) => c.title.toLowerCase().includes(query) || matchingProjectIds.has(c.projectId)
|
|
12
|
-
);
|
|
13
|
-
});
|
|
14
|
-
const allToolsSelected = computed(() => {
|
|
15
|
-
const availableTools = filteredCanvasTools.value.filter((c) => c.promotedVersion);
|
|
16
|
-
if (availableTools.length === 0)
|
|
17
|
-
return false;
|
|
18
|
-
return availableTools.every((c) => selectedToolIds.value.has(c.id));
|
|
19
|
-
});
|
|
20
|
-
const hasChanges = computed(() => {
|
|
21
|
-
const currentIds = new Set(currentCanvasTools.value?.map((t) => t.canvasId) ?? []);
|
|
22
|
-
if (currentIds.size !== selectedToolIds.value.size)
|
|
23
|
-
return true;
|
|
24
|
-
for (const id of currentIds) {
|
|
25
|
-
if (!selectedToolIds.value.has(id))
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
29
|
-
});
|
|
30
|
-
function toggleCanvasTool(canvasId) {
|
|
31
|
-
const newSet = new Set(selectedToolIds.value);
|
|
32
|
-
if (newSet.has(canvasId))
|
|
33
|
-
newSet.delete(canvasId);
|
|
34
|
-
else
|
|
35
|
-
newSet.add(canvasId);
|
|
36
|
-
selectedToolIds.value = newSet;
|
|
37
|
-
}
|
|
38
|
-
function toggleAllTools(selected) {
|
|
39
|
-
if (selected === "indeterminate")
|
|
40
|
-
return;
|
|
41
|
-
const newSet = new Set(selectedToolIds.value);
|
|
42
|
-
const availableTools = filteredCanvasTools.value.filter((c) => c.promotedVersion);
|
|
43
|
-
if (selected)
|
|
44
|
-
availableTools.forEach((c) => newSet.add(c.id));
|
|
45
|
-
else
|
|
46
|
-
availableTools.forEach((c) => newSet.delete(c.id));
|
|
47
|
-
selectedToolIds.value = newSet;
|
|
48
|
-
}
|
|
49
|
-
function getProjectName(projectId) {
|
|
50
|
-
const project = projects.value.find((p) => p.id === projectId);
|
|
51
|
-
return project?.title ?? "Sem projeto";
|
|
52
|
-
}
|
|
53
|
-
function buildCanvasTools() {
|
|
54
|
-
const tools = [];
|
|
55
|
-
for (const canvasId of selectedToolIds.value) {
|
|
56
|
-
const item = canvas.value.find((c) => c.id === canvasId);
|
|
57
|
-
if (!item)
|
|
58
|
-
continue;
|
|
59
|
-
const name = item.title.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "");
|
|
60
|
-
const variables = item.promotedVersion?.variables?.reduce((acc, v) => {
|
|
61
|
-
acc[v.name] = {
|
|
62
|
-
name: v.name,
|
|
63
|
-
description: v.description ?? v.name,
|
|
64
|
-
type: v.type
|
|
65
|
-
};
|
|
66
|
-
return acc;
|
|
67
|
-
}, {});
|
|
68
|
-
tools.push({
|
|
69
|
-
canvasId,
|
|
70
|
-
name,
|
|
71
|
-
description: item.title,
|
|
72
|
-
variables: variables && Object.keys(variables).length > 0 ? variables : void 0
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
return tools;
|
|
76
|
-
}
|
|
77
|
-
function initialize() {
|
|
78
|
-
selectedToolIds.value = new Set(currentCanvasTools.value?.map((t) => t.canvasId) ?? []);
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
selectedToolIds,
|
|
82
|
-
filteredCanvasTools,
|
|
83
|
-
allToolsSelected,
|
|
84
|
-
hasChanges,
|
|
85
|
-
toggleCanvasTool,
|
|
86
|
-
toggleAllTools,
|
|
87
|
-
getProjectName,
|
|
88
|
-
buildCanvasTools,
|
|
89
|
-
initialize
|
|
90
|
-
};
|
|
91
|
-
}
|