@meistrari/chat-nuxt 3.0.0 → 3.1.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/dist/module.d.mts +2 -1
- package/dist/module.json +1 -1
- package/dist/runtime/conversations/components/chat-conversation-creator-filter.d.vue.ts +1 -1
- package/dist/runtime/conversations/components/chat-conversation-creator-filter.vue.d.ts +1 -1
- package/dist/runtime/conversations/components/chat-conversation-item.d.vue.ts +3 -3
- package/dist/runtime/conversations/components/chat-conversation-item.vue.d.ts +3 -3
- package/dist/runtime/conversations/components/chat-conversation-list.d.vue.ts +1 -1
- package/dist/runtime/conversations/components/chat-conversation-list.vue.d.ts +1 -1
- package/dist/runtime/conversations/components/chat-conversation-new-group-button.d.vue.ts +1 -1
- package/dist/runtime/conversations/components/chat-conversation-new-group-button.vue.d.ts +1 -1
- package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.d.vue.ts +4 -4
- package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.vue.d.ts +4 -4
- package/dist/runtime/conversations/components/chat-conversation-search.d.vue.ts +3 -3
- package/dist/runtime/conversations/components/chat-conversation-search.vue.d.ts +3 -3
- package/dist/runtime/conversations/components/chat-new-conversation-modal.d.vue.ts +23 -5
- package/dist/runtime/conversations/components/chat-new-conversation-modal.vue.d.ts +23 -5
- package/dist/runtime/conversations/composables/conversation-list.d.ts +58 -1
- package/dist/runtime/embed/components/chat-configuration-modal.d.vue.ts +3 -3
- package/dist/runtime/embed/components/chat-configuration-modal.vue +59 -176
- package/dist/runtime/embed/components/chat-configuration-modal.vue.d.ts +3 -3
- package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +3 -3
- package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +3 -3
- package/dist/runtime/embed/components/chat-embed.d.vue.ts +3 -3
- package/dist/runtime/embed/components/chat-embed.vue.d.ts +3 -3
- package/dist/runtime/embed/components/chat-topbar.d.vue.ts +5 -5
- package/dist/runtime/embed/components/chat-topbar.vue.d.ts +5 -5
- 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/configuration/chat-configuration-credentials-tab.d.vue.ts +3 -3
- package/dist/runtime/embed/components/configuration/chat-configuration-credentials-tab.vue.d.ts +3 -3
- package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.d.vue.ts +5 -5
- package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.vue.d.ts +5 -5
- package/dist/runtime/embed/components/configuration/chat-configuration-mobile-shell.d.vue.ts +3 -3
- package/dist/runtime/embed/components/configuration/chat-configuration-mobile-shell.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-bottom-sheet.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-bottom-sheet.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-drawer.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-drawer.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-file-preview.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-file-preview.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-files-view.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-files-view.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-header.d.vue.ts +5 -5
- package/dist/runtime/embed/components/mobile/chat-mobile-header.vue.d.ts +5 -5
- package/dist/runtime/embed/components/mobile/chat-mobile-home-header.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-home-header.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-home-recents.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-home-recents.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-info-bubble.d.vue.ts +1 -1
- package/dist/runtime/embed/components/mobile/chat-mobile-info-bubble.vue.d.ts +1 -1
- package/dist/runtime/embed/components/mobile/chat-mobile-outdated-settings-sheet.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-outdated-settings-sheet.vue.d.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +41 -9
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +41 -9
- package/dist/runtime/embed/components/mobile/chat-mobile-usage-view.d.vue.ts +1 -1
- package/dist/runtime/embed/components/mobile/chat-mobile-usage-view.vue.d.ts +1 -1
- package/dist/runtime/embed/components/mobile/chat-mobile-workspace-sheet.d.vue.ts +3 -3
- package/dist/runtime/embed/components/mobile/chat-mobile-workspace-sheet.vue.d.ts +3 -3
- package/dist/runtime/embed/components/powered-by-tela.d.vue.ts +1 -1
- package/dist/runtime/embed/components/powered-by-tela.vue.d.ts +1 -1
- package/dist/runtime/files/components/audio-preview.d.vue.ts +3 -3
- package/dist/runtime/files/components/audio-preview.vue.d.ts +3 -3
- package/dist/runtime/files/components/chat-file-preview.d.vue.ts +1 -1
- package/dist/runtime/files/components/chat-file-preview.vue.d.ts +1 -1
- package/dist/runtime/files/components/chat-files-view.d.vue.ts +1 -1
- package/dist/runtime/files/components/chat-files-view.vue.d.ts +1 -1
- package/dist/runtime/files/components/chat-vault-link.d.vue.ts +1 -1
- package/dist/runtime/files/components/chat-vault-link.vue.d.ts +1 -1
- package/dist/runtime/files/components/conversation-files-panel.d.vue.ts +1 -1
- package/dist/runtime/files/components/conversation-files-panel.vue.d.ts +1 -1
- package/dist/runtime/files/components/csv-preview.d.vue.ts +3 -3
- package/dist/runtime/files/components/csv-preview.vue.d.ts +3 -3
- package/dist/runtime/files/components/file-preview-panel.d.vue.ts +1 -1
- package/dist/runtime/files/components/file-preview-panel.vue.d.ts +1 -1
- package/dist/runtime/files/components/file-uploader.d.vue.ts +3 -3
- package/dist/runtime/files/components/file-uploader.vue.d.ts +3 -3
- package/dist/runtime/files/components/image-preview.d.vue.ts +3 -3
- package/dist/runtime/files/components/image-preview.vue.d.ts +3 -3
- package/dist/runtime/files/components/pdf-preview.client.d.vue.ts +3 -3
- package/dist/runtime/files/components/pdf-preview.client.vue.d.ts +3 -3
- package/dist/runtime/files/components/pdf-viewer.client.d.vue.ts +1 -1
- package/dist/runtime/files/components/pdf-viewer.client.vue.d.ts +1 -1
- package/dist/runtime/files/components/text-preview.d.vue.ts +3 -3
- package/dist/runtime/files/components/text-preview.vue.d.ts +3 -3
- package/dist/runtime/files/components/video-preview.d.vue.ts +3 -3
- package/dist/runtime/files/components/video-preview.vue.d.ts +3 -3
- package/dist/runtime/files/composables/pdf.d.ts +248 -27
- 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-canvas-selector-modal.d.vue.ts +23 -5
- package/dist/runtime/messages/components/chat-canvas-selector-modal.vue.d.ts +23 -5
- package/dist/runtime/messages/components/chat-context-config.d.vue.ts +52 -10
- package/dist/runtime/messages/components/chat-context-config.vue +2 -2
- package/dist/runtime/messages/components/chat-context-config.vue.d.ts +52 -10
- package/dist/runtime/messages/components/chat-mention-dropdown.d.vue.ts +27 -5
- package/dist/runtime/messages/components/chat-mention-dropdown.vue.d.ts +27 -5
- package/dist/runtime/messages/components/chat-message-bubble.d.vue.ts +3 -3
- package/dist/runtime/messages/components/chat-message-bubble.vue.d.ts +3 -3
- package/dist/runtime/messages/components/chat-message-feedback.d.vue.ts +1 -1
- package/dist/runtime/messages/components/chat-message-feedback.vue.d.ts +1 -1
- package/dist/runtime/messages/components/chat-message-input.d.vue.ts +38 -6
- package/dist/runtime/messages/components/chat-message-input.vue +1 -1
- package/dist/runtime/messages/components/chat-message-input.vue.d.ts +38 -6
- package/dist/runtime/messages/components/chat-message-list.d.vue.ts +3 -3
- package/dist/runtime/messages/components/chat-message-list.vue.d.ts +3 -3
- package/dist/runtime/messages/components/chat-workstation-selector-modal.d.vue.ts +19 -5
- package/dist/runtime/messages/components/chat-workstation-selector-modal.vue.d.ts +19 -5
- package/dist/runtime/messages/components/reasoning/chat-reasoning-message.d.vue.ts +1 -1
- package/dist/runtime/messages/components/reasoning/chat-reasoning-message.vue.d.ts +1 -1
- package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.d.vue.ts +4 -4
- package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.vue.d.ts +4 -4
- package/dist/runtime/messages/components/reasoning/chat-reasoning-steps.d.vue.ts +2 -2
- package/dist/runtime/messages/components/reasoning/chat-reasoning-steps.vue.d.ts +2 -2
- package/dist/runtime/messages/components/reasoning/chat-reasoning-thought.d.vue.ts +1 -1
- package/dist/runtime/messages/components/reasoning/chat-reasoning-thought.vue.d.ts +1 -1
- package/dist/runtime/messages/components/reasoning/chat-thinking-indicator.d.vue.ts +1 -1
- package/dist/runtime/messages/components/reasoning/chat-thinking-indicator.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-bash-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-bash-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-doc-sdk-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-doc-sdk-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-generic-tool-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-generic-tool-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-grep-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-grep-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-read-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-read-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-tela-skill-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-tela-skill-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-thinking-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-thinking-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-web-search-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-web-search-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-workstation-query-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-workstation-query-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-write-widget.d.vue.ts +1 -1
- package/dist/runtime/messages/components/widgets/chat-write-widget.vue.d.ts +1 -1
- package/dist/runtime/messages/composables/chat.js +4 -3
- package/dist/runtime/rendering/components/app-markdown-render.d.vue.ts +2 -2
- package/dist/runtime/rendering/components/app-markdown-render.vue.d.ts +2 -2
- package/dist/runtime/rendering/components/renderers/artifact-display.d.vue.ts +3 -3
- package/dist/runtime/rendering/components/renderers/artifact-display.vue.d.ts +3 -3
- package/dist/runtime/rendering/components/renderers/audio-renderer.d.vue.ts +1 -1
- package/dist/runtime/rendering/components/renderers/audio-renderer.vue.d.ts +1 -1
- package/dist/runtime/rendering/components/renderers/csv-renderer.d.vue.ts +1 -1
- package/dist/runtime/rendering/components/renderers/csv-renderer.vue.d.ts +1 -1
- package/dist/runtime/rendering/components/renderers/image-renderer.d.vue.ts +1 -1
- package/dist/runtime/rendering/components/renderers/image-renderer.vue.d.ts +1 -1
- package/dist/runtime/rendering/components/renderers/markdown-renderer.d.vue.ts +1 -1
- package/dist/runtime/rendering/components/renderers/markdown-renderer.vue.d.ts +1 -1
- package/dist/runtime/rendering/components/renderers/mermaid-diagram.d.vue.ts +1 -1
- package/dist/runtime/rendering/components/renderers/mermaid-diagram.vue.d.ts +1 -1
- package/dist/runtime/rendering/components/renderers/text-renderer.d.vue.ts +1 -1
- package/dist/runtime/rendering/components/renderers/text-renderer.vue.d.ts +1 -1
- package/dist/runtime/rendering/components/renderers/video-renderer.d.vue.ts +1 -1
- package/dist/runtime/rendering/components/renderers/video-renderer.vue.d.ts +1 -1
- package/dist/runtime/shared/chat-api-error.d.ts +1 -0
- package/dist/runtime/shared/chat-api-error.js +5 -0
- package/dist/runtime/shared/components/app-status-toast.d.vue.ts +1 -1
- package/dist/runtime/shared/components/app-status-toast.vue.d.ts +1 -1
- package/dist/runtime/shared/components/icons/anthropic.d.vue.ts +1 -1
- package/dist/runtime/shared/components/icons/anthropic.vue.d.ts +1 -1
- package/dist/runtime/shared/components/icons/tela-chat.d.vue.ts +1 -1
- package/dist/runtime/shared/components/icons/tela-chat.vue.d.ts +1 -1
- package/dist/runtime/shared/components/icons/tela-wordmark.d.vue.ts +1 -1
- package/dist/runtime/shared/components/icons/tela-wordmark.vue.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/usage/components/chat-usage-view.d.vue.ts +1 -1
- package/dist/runtime/usage/components/chat-usage-view.vue.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/runtime/workspace/composables/workspace-settings.d.ts +42 -1
- package/package.json +15 -15
- 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
|
@@ -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
|
-
}
|