feat(mcp): opt-in plugin tools on external server and built-in AI
This commit is contained in:
1 parent
b3bffe8c71
commit
f61f64f727
36 files changed
+2181
-81
No files matched your search
@@ -15,7 +15,9 @@ import type { PluginToolPreview } from "@/types/pluginAiTools";
|
||||
/**
|
||||
* Plugin Center controls for what a plugin may reach beyond its own UI:
|
||||
* built-in AI access to its MCP tools, and the connections it may read
|
||||
* through `host.data:read`. Both are off until the user turns them on.
|
||||
* through `host.data:read`. AI tool access is opt-in — off until the user
|
||||
* turns it on, and the choice survives restarts and plugin updates. Data
|
||||
* reads are off until the user consents.
|
||||
*/
|
||||
const props = defineProps<{ plugin: InstalledPlugin }>();
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "Məlumat girişi sorğusu",
|
||||
aiTools: {
|
||||
title: "Daxili süni intellekt alətləri",
|
||||
description: "DBX süni intellekt köməkçisinin (Agent rejimi) açıq olan plagin bağlantılarında bu plaginin alətlərini çağırmasına icazə verir. Yalnız oxuma kimi elan edilməyən alətlər hər çağırışdan əvvəl təsdiqinizi istəyir və alət nəticəsi süni intellekt modelinizə göndərilir.",
|
||||
description: "Standart olaraq söndürüldü: DBX süni intellekt köməkçisi (Agent rejimi) yalnız bu açar yanık olduqda açıq plagin bağlantılarında bu plaginin alətlərini çağıra bilər. Salt oxunan olmayan alətlər hər çağrıda təsdiq istəyir.",
|
||||
preview: "Alətləri göstər",
|
||||
previewHint: "Plagin işləmirsə, onu başladır.",
|
||||
previewFailed: "Alətlərin siyahısı alınmadı: {message}",
|
||||
@@ -8278,6 +8278,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "Əlaqəni çıxar",
|
||||
mcpToolOpenTable: "Cədvəli DBX-də aç",
|
||||
mcpToolExecuteAndShow: "İcra et və DBX-də göstər",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
supportInfoTitle: "Dəstək məlumatları",
|
||||
supportInfoDescription: "Problem bildirərkən və ya kömək istəyərkən bu mühit təfərrüatlarını kopyalayın.",
|
||||
supportInfoCopy: "Dəstək məlumatlarını kopyala",
|
||||
|
||||
@@ -172,7 +172,7 @@ export default {
|
||||
dataAccessConsentTitle: "Data Access Request",
|
||||
aiTools: {
|
||||
title: "Built-in AI tools",
|
||||
description: "Let the DBX AI assistant (Agent mode) call this plugin's tools on the plugin connections you have open. Tools that are not declared read-only ask for your approval before every call, and tool output is sent to your AI model.",
|
||||
description: "Off by default: the DBX AI assistant (Agent mode) can call this plugin's tools on its open connections only while this switch is on. Tools that are not declared read-only still ask for your approval before every call.",
|
||||
preview: "Show tools",
|
||||
previewHint: "Starts the plugin if it is not running.",
|
||||
previewFailed: "Could not list tools: {message}",
|
||||
@@ -9012,6 +9012,9 @@ export default {
|
||||
mcpToolRemoveConnection: "Remove connection",
|
||||
mcpToolOpenTable: "Open table in DBX",
|
||||
mcpToolExecuteAndShow: "Execute and show in DBX",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
supportInfoTitle: "Support information",
|
||||
supportInfoDescription: "Copy these environment details when filing issues or asking for help.",
|
||||
supportInfoCopy: "Copy support info",
|
||||
|
||||
@@ -175,7 +175,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "Solicitud de acceso a datos",
|
||||
aiTools: {
|
||||
title: "Herramientas de IA integradas",
|
||||
description: "Permite que el asistente de IA de DBX (modo Agent) use las herramientas de este plugin en las conexiones del plugin que tengas abiertas. Las herramientas no declaradas de solo lectura piden tu aprobación antes de cada llamada, y su resultado se envía a tu modelo de IA.",
|
||||
description: "Desactivado por defecto: el asistente de IA de DBX (modo Agent) solo puede usar las herramientas de este plugin en sus conexiones abiertas mientras el interruptor esté encendido. Las herramientas no declaradas de solo lectura seguirán pidiendo aprobación en cada llamada.",
|
||||
preview: "Ver herramientas",
|
||||
previewHint: "Inicia el plugin si no está en ejecución.",
|
||||
previewFailed: "No se pudieron listar las herramientas: {message}",
|
||||
@@ -8301,6 +8301,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "Eliminar conexión",
|
||||
mcpToolOpenTable: "Abrir tabla en DBX",
|
||||
mcpToolExecuteAndShow: "Ejecutar y mostrar en DBX",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
supportInfoTitle: "Información de soporte",
|
||||
supportInfoDescription: "Copia estos datos del entorno al crear issues o pedir ayuda.",
|
||||
supportInfoCopy: "Copiar información",
|
||||
|
||||
@@ -174,8 +174,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "Richiesta di accesso ai dati",
|
||||
aiTools: {
|
||||
title: "Strumenti IA integrati",
|
||||
description:
|
||||
"Consente all'assistente IA di DBX (modalità Agent) di usare gli strumenti di questo plugin sulle connessioni del plugin che hai aperto. Gli strumenti non dichiarati di sola lettura chiedono la tua approvazione prima di ogni chiamata e il loro output viene inviato al tuo modello IA.",
|
||||
description: "Disattivato per impostazione predefinita: l'assistente IA di DBX (modalità Agent) può usare gli strumenti di questo plugin sulle connessioni aperte solo con l'interruttore acceso. Gli strumenti non di sola lettura chiederanno comunque approvazione a ogni chiamata.",
|
||||
preview: "Mostra strumenti",
|
||||
previewHint: "Avvia il plugin se non è in esecuzione.",
|
||||
previewFailed: "Impossibile elencare gli strumenti: {message}",
|
||||
@@ -8226,6 +8225,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "Rimuovi connessione",
|
||||
mcpToolOpenTable: "Apri tabella in DBX",
|
||||
mcpToolExecuteAndShow: "Esegui e mostra in DBX",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
supportInfoTitle: "Informazioni di supporto",
|
||||
supportInfoDescription: "Copia questi dettagli dell'ambiente quando apri issue o chiedi aiuto.",
|
||||
supportInfoCopy: "Copia informazioni",
|
||||
|
||||
@@ -175,7 +175,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "データアクセスの要求",
|
||||
aiTools: {
|
||||
title: "組み込み AI ツール",
|
||||
description: "DBX AI アシスタント(Agent モード)が、開いているこのプラグインの接続でプラグインのツールを呼び出せるようにします。読み取り専用と宣言されていないツールは呼び出しのたびに承認を求め、ツールの出力は設定した AI モデルに送信されます。",
|
||||
description: "デフォルトはオフです:このスイッチが有効な間のみ、DBX AIアシスタント(Agentモード)が開いているこのプラグインの接続でツールを呼び出せます。読み取り専用以外のツールは毎回承認を求めます。",
|
||||
preview: "ツールを表示",
|
||||
previewHint: "プラグインが実行されていない場合は起動します。",
|
||||
previewFailed: "ツール一覧を取得できませんでした: {message}",
|
||||
@@ -8222,6 +8222,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "接続を削除",
|
||||
mcpToolOpenTable: "DBX でテーブルを開く",
|
||||
mcpToolExecuteAndShow: "DBX で実行して表示",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
updateDownloadSource: "アップデートのダウンロード元",
|
||||
updateDownloadSourceDescription: "アプリ内アップデートのインストーラーのダウンロード元を選択します。公式ソース推奨。中国本土ではCNBの方が高速な場合があります。",
|
||||
updateDownloadSourceOfficial: "公式ソース(推奨)",
|
||||
|
||||
@@ -174,7 +174,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "데이터 액세스 요청",
|
||||
aiTools: {
|
||||
title: "내장 AI 도구",
|
||||
description: "DBX AI 어시스턴트(Agent 모드)가 열려 있는 이 플러그인의 연결에서 플러그인 도구를 호출하도록 허용합니다. 읽기 전용으로 선언되지 않은 도구는 호출할 때마다 승인을 요청하며, 도구 출력은 설정한 AI 모델로 전송됩니다.",
|
||||
description: "기본값은 꺼짐입니다: 이 스위치가 켜져 있는 동안에만 DBX AI 어시스턴트(Agent 모드)가 열려 있는 이 플러그인의 연결에서 도구를 호출할 수 있습니다. 읽기 전용이 아닌 도구는 호출할 때마다 승인을 요청합니다.",
|
||||
preview: "도구 보기",
|
||||
previewHint: "플러그인이 실행 중이 아니면 시작합니다.",
|
||||
previewFailed: "도구 목록을 가져올 수 없습니다: {message}",
|
||||
@@ -8009,6 +8009,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "연결 삭제",
|
||||
mcpToolOpenTable: "DBX에서 테이블 열기",
|
||||
mcpToolExecuteAndShow: "DBX에서 실행 및 표시",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
supportInfoTitle: "지원 정보",
|
||||
supportInfoDescription: "이슈를 등록하거나 도움을 요청할 때 이 환경 세부 정보를 복사하세요.",
|
||||
supportInfoCopy: "지원 정보 복사",
|
||||
|
||||
@@ -175,7 +175,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "Solicitação de acesso a dados",
|
||||
aiTools: {
|
||||
title: "Ferramentas de IA integradas",
|
||||
description: "Permite que o assistente de IA do DBX (modo Agent) use as ferramentas deste plugin nas conexões do plugin que você tem abertas. Ferramentas não declaradas como somente leitura pedem sua aprovação antes de cada chamada, e a saída delas é enviada ao seu modelo de IA.",
|
||||
description: "Desativado por padrão: o assistente de IA do DBX (modo Agent) só pode usar as ferramentas deste plugin nas conexões abertas enquanto o interruptor estiver ligado. Ferramentas não somente leitura continuarão pedindo aprovação a cada chamada.",
|
||||
preview: "Ver ferramentas",
|
||||
previewHint: "Inicia o plugin se ele não estiver em execução.",
|
||||
previewFailed: "Não foi possível listar as ferramentas: {message}",
|
||||
@@ -8227,6 +8227,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "Remover conexão",
|
||||
mcpToolOpenTable: "Abrir tabela no DBX",
|
||||
mcpToolExecuteAndShow: "Executar e mostrar no DBX",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
supportInfoTitle: "Informações de suporte",
|
||||
supportInfoDescription: "Copie estes detalhes do ambiente ao abrir issues ou pedir ajuda.",
|
||||
supportInfoCopy: "Copiar informações",
|
||||
|
||||
@@ -122,7 +122,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "Запрос доступа к данным",
|
||||
aiTools: {
|
||||
title: "Встроенные инструменты ИИ",
|
||||
description: "Разрешает ИИ-ассистенту DBX (режим Agent) вызывать инструменты этого плагина на открытых подключениях плагина. Инструменты, не объявленные как только для чтения, запрашивают ваше подтверждение перед каждым вызовом, а их вывод отправляется вашей модели ИИ.",
|
||||
description: "По умолчанию выключено: ИИ-ассистент DBX (режим Agent) может вызывать инструменты этого плагина в открытых подключениях, только пока переключатель включён. Инструменты без признака «только чтение» по-прежнему требуют подтверждения каждого вызова.",
|
||||
preview: "Показать инструменты",
|
||||
previewHint: "Запускает плагин, если он не работает.",
|
||||
previewFailed: "Не удалось получить список инструментов: {message}",
|
||||
@@ -9499,6 +9499,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "Удалить подключение",
|
||||
mcpToolOpenTable: "Открыть таблицу в DBX",
|
||||
mcpToolExecuteAndShow: "Выполнить и показать в DBX",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
supportInfoTitle: "Информация для поддержки",
|
||||
supportInfoDescription: "Скопируйте эти сведения о среде при создании обращений или запросе помощи.",
|
||||
supportInfoCopy: "Скопировать информацию для поддержки",
|
||||
|
||||
@@ -88,7 +88,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "Veri Erişim İsteği",
|
||||
aiTools: {
|
||||
title: "Yerleşik yapay zekâ araçları",
|
||||
description: "DBX yapay zekâ asistanının (Agent modu) açık olan eklenti bağlantılarında bu eklentinin araçlarını çağırmasına izin verir. Salt okunur olarak bildirilmeyen araçlar her çağrıdan önce onayınızı ister ve araç çıktısı yapay zekâ modelinize gönderilir.",
|
||||
description: "Varsayılan olarak kapalıdır: DBX yapay zekâ asistanı (Agent modu), yalnızca bu düğme açıkken açık eklenti bağlantılarında bu eklentinin araçlarını çağırabilir. Salt okunur olmayan araçlar her çağrıda onay ister.",
|
||||
preview: "Araçları göster",
|
||||
previewHint: "Eklenti çalışmıyorsa başlatılır.",
|
||||
previewFailed: "Araçlar listelenemedi: {message}",
|
||||
@@ -8176,6 +8176,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "Bağlantıyı kaldır",
|
||||
mcpToolOpenTable: "Tabloyu DBX'te aç",
|
||||
mcpToolExecuteAndShow: "Çalıştır ve DBX'te göster",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
supportInfoTitle: "Destek bilgileri",
|
||||
supportInfoDescription: "Sorun bildirirken ya da yardım isterken bu ortam ayrıntılarını kopyalayın.",
|
||||
supportInfoCopy: "Destek bilgilerini kopyala",
|
||||
|
||||
@@ -97,7 +97,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "数据访问请求",
|
||||
aiTools: {
|
||||
title: "内置 AI 工具",
|
||||
description: "允许 DBX AI 助手(Agent 模式)在你已打开的该插件连接上调用插件工具。未声明为只读的工具每次调用前都会请求你确认,工具输出会发送给你配置的 AI 模型。",
|
||||
description: "默认关闭:仅在此开关开启期间,DBX AI 助手(Agent 模式)才能在你已打开的该插件连接上调用其工具。未声明为只读的工具每次调用前仍会请求你确认,工具输出会发送给你配置的 AI 模型。",
|
||||
preview: "查看工具",
|
||||
previewHint: "插件未运行时会先启动它。",
|
||||
previewFailed: "无法获取工具列表:{message}",
|
||||
@@ -8979,6 +8979,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "删除连接",
|
||||
mcpToolOpenTable: "在 DBX 中打开表",
|
||||
mcpToolExecuteAndShow: "在 DBX 中执行并展示",
|
||||
mcpToolPluginList: "插件目录",
|
||||
mcpToolPluginTools: "插件工具清单",
|
||||
mcpToolPluginCall: "调用插件工具",
|
||||
supportInfoTitle: "支持信息",
|
||||
supportInfoDescription: "提交 issue 或寻求帮助时,可复制这些环境信息。",
|
||||
supportInfoCopy: "复制支持信息",
|
||||
|
||||
@@ -175,7 +175,7 @@ export default withEnglishFallback({
|
||||
dataAccessConsentTitle: "資料存取請求",
|
||||
aiTools: {
|
||||
title: "內建 AI 工具",
|
||||
description: "允許 DBX AI 助理(Agent 模式)在你已開啟的此外掛連線上呼叫外掛工具。未宣告為唯讀的工具每次呼叫前都會請求你確認,工具輸出會傳送給你設定的 AI 模型。",
|
||||
description: "預設關閉:僅在此開關開啟期間,DBX AI 助理(Agent 模式)才能在你已開啟的此外掛連線上呼叫其工具。未宣告為唯讀的工具每次呼叫前仍會請求你確認,工具輸出會傳送給你設定的 AI 模型。",
|
||||
preview: "檢視工具",
|
||||
previewHint: "外掛未執行時會先啟動它。",
|
||||
previewFailed: "無法取得工具清單:{message}",
|
||||
@@ -7595,6 +7595,9 @@ export default withEnglishFallback({
|
||||
mcpToolRemoveConnection: "刪除連線",
|
||||
mcpToolOpenTable: "在 DBX 中開啟資料表",
|
||||
mcpToolExecuteAndShow: "在 DBX 中執行並顯示",
|
||||
mcpToolPluginList: "Plugin catalog",
|
||||
mcpToolPluginTools: "Plugin tool listing",
|
||||
mcpToolPluginCall: "Call plugin tools",
|
||||
updateDownloadSource: "更新下載來源",
|
||||
updateDownloadSourceDescription: "選擇應用程式內更新安裝程式的下載來源。建議使用官方來源;CNB 在中國大陸網路環境下可能更快。",
|
||||
updateDownloadSourceOfficial: "官方來源(建議)",
|
||||
|
||||
@@ -47,6 +47,9 @@ export const MCP_TOOL_OPTIONS = [
|
||||
{ name: "dbx_remove_connection", labelKey: "settings.mcpToolRemoveConnection" },
|
||||
{ name: "dbx_open_table", labelKey: "settings.mcpToolOpenTable" },
|
||||
{ name: "dbx_execute_and_show", labelKey: "settings.mcpToolExecuteAndShow" },
|
||||
{ name: "dbx_plugin_list", labelKey: "settings.mcpToolPluginList" },
|
||||
{ name: "dbx_plugin_tools", labelKey: "settings.mcpToolPluginTools" },
|
||||
{ name: "dbx_plugin_call", labelKey: "settings.mcpToolPluginCall" },
|
||||
] as const;
|
||||
|
||||
export interface McpExecutionPolicyFields {
|
||||
|
||||
@@ -366,8 +366,13 @@ function localizePluginMetadata(plugin: InstalledPlugin, localization?: PluginMa
|
||||
|
||||
function localizeContribution(contribution: PluginContribution, localization: PluginContributionLocalization | undefined, pluginName: string): PluginContribution {
|
||||
// Menus entries carry no display text of their own — labels come from the
|
||||
// referenced commands, so they pass through localization untouched.
|
||||
// referenced commands, so they pass through localization untouched. The
|
||||
// `mcp` declaration is host-surface metadata without a label either; only
|
||||
// its optional description localizes.
|
||||
if (contribution.type === "menus") return contribution;
|
||||
if (contribution.type === "mcp") {
|
||||
return { ...contribution, description: localizedOptionalText(contribution.description, localization?.description) };
|
||||
}
|
||||
const fallbackLabel = contribution.type === "connection-provider" ? optionalTrimmed(contribution.label) || optionalTrimmed(pluginName) || contribution.id : contribution.label;
|
||||
const localized = {
|
||||
...contribution,
|
||||
|
||||
@@ -582,6 +582,20 @@ export interface PluginMenusContribution {
|
||||
items: PluginMenuItem[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares that the plugin sidecar speaks the optional MCP tool bridge
|
||||
* (`mcp/tools` + `mcp/call`) and opts its tools into the host's automatic
|
||||
* surfaces: the built-in AI agent and the external `dbx` MCP server. Both
|
||||
* default to true; the Plugin Center switch still overrides the AI surface.
|
||||
*/
|
||||
export interface PluginMcpContribution {
|
||||
type: "mcp";
|
||||
id: string;
|
||||
description?: string;
|
||||
ai_tools?: boolean;
|
||||
external_tools?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contribution types the host renders through the plugin's own UI entrypoint in
|
||||
* a plugin tab. A `workbench` is launched from the sidebar, the plugin center,
|
||||
@@ -592,7 +606,7 @@ export interface PluginMenusContribution {
|
||||
*/
|
||||
export type PluginUiContribution = PluginWorkbenchContribution | PluginResultViewContribution;
|
||||
|
||||
export type PluginContribution = PluginConnectionProviderContribution | PluginWorkbenchContribution | PluginFilesystemProviderContribution | PluginContextMenuContribution | PluginResultViewContribution | PluginCommandContribution | PluginMenusContribution;
|
||||
export type PluginContribution = PluginConnectionProviderContribution | PluginWorkbenchContribution | PluginFilesystemProviderContribution | PluginContextMenuContribution | PluginResultViewContribution | PluginCommandContribution | PluginMenusContribution | PluginMcpContribution;
|
||||
|
||||
export interface PluginEngines {
|
||||
dbx: string;
|
||||
|
||||
Reference in new issue
Block a user