From ed63e35cc7d49856c562b9f519534cba6d6b9ee8 Mon Sep 17 00:00:00 2001 From: lyingbug Date: Sat, 26 Sep 2026 14:44:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(plugin):=20install=20declarative=20plugins?= =?UTF-8?q?=20=E2=80=94=20MCP=20servers,=20skills=20and=20model=20vendors?= =?UTF-8?q?=20(#3716)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(plugin): install declarative plugin packages across nodes * feat(plugin): serve installed plugins' MCP servers in each workspace * feat(plugin): let installed plugins contribute skills and model vendors * feat(plugin): register plugin skills into the workspace skill catalog * feat(frontend): manage installed plugins and their configuration * test(weaviate): read the class state before the probe barrier * fix(plugin): keep MCP tool directories reachable behind the plugin wrapper * test(plugin): wrap a long line --- frontend/src/api/mcp-service.ts | 4 + frontend/src/api/plugin.ts | 63 ++- frontend/src/api/system/plugins.ts | 110 +++++ frontend/src/config/settingsAccess.test.ts | 2 +- frontend/src/config/settingsAccess.ts | 1 + frontend/src/extensions/builtin/settings.ts | 2 + .../src/extensions/builtin/settingsCatalog.ts | 1 + frontend/src/i18n/locales/en-US.ts | 117 ++++- frontend/src/i18n/locales/ja-JP.ts | 117 ++++- frontend/src/i18n/locales/ko-KR.ts | 117 ++++- frontend/src/i18n/locales/ru-RU.ts | 117 ++++- frontend/src/i18n/locales/zh-CN.ts | 117 ++++- frontend/src/views/settings/McpSettings.vue | 25 +- frontend/src/views/settings/PluginCenter.vue | 112 ++++- frontend/src/views/settings/Settings.vue | 3 +- frontend/src/views/settings/SkillSettings.vue | 107 ++++- .../views/settings/pluginCenterState.test.ts | 28 +- .../src/views/settings/pluginCenterState.ts | 30 +- .../src/views/system/PluginManagement.vue | 263 +++++++++++ .../system/pluginManagementState.test.ts | 78 ++++ .../src/views/system/pluginManagementState.ts | 120 +++++ .../system/plugins/PluginDetailDrawer.vue | 327 ++++++++++++++ .../system/plugins/PluginInstallDrawer.vue | 401 +++++++++++++++++ internal/application/repository/plugin.go | 86 ++++ .../repository/plugin_tenant_setting.go | 25 +- .../application/repository/plugin_test.go | 95 ++++ .../retriever/weaviate/repository_test.go | 9 +- .../service/tenant_skill_catalog.go | 5 +- .../service/tenant_skill_service.go | 17 + .../service/tenant_skill_source.go | 25 +- .../service/tenant_skill_source_test.go | 38 ++ internal/container/container.go | 24 +- internal/container/plugin_runtime.go | 87 ++++ .../migration_sqlite_versioned_schema_test.go | 4 +- internal/handler/dto/mcp.go | 12 +- internal/handler/plugin.go | 81 ++++ internal/handler/plugin_admin.go | 288 ++++++++++++ internal/handler/plugin_test.go | 21 +- internal/handler/sandbox_skill.go | 5 +- internal/models/runtime/overlay.go | 44 +- internal/models/runtime/plugin.go | 80 ++++ internal/models/runtime/plugin_test.go | 57 +++ internal/models/runtime/registry.go | 2 + internal/plugin/activate/mcp.go | 422 ++++++++++++++++++ internal/plugin/activate/mcp_test.go | 237 ++++++++++ internal/plugin/activate/skills.go | 110 +++++ internal/plugin/activate/skills_test.go | 53 +++ internal/plugin/activate/vendors.go | 141 ++++++ internal/plugin/activate/vendors_test.go | 92 ++++ internal/plugin/configschema/secrets.go | 12 + internal/plugin/configschema/secrets_test.go | 28 ++ internal/plugin/install/config.go | 110 +++++ internal/plugin/install/install.go | 405 +++++++++++++++++ internal/plugin/install/install_test.go | 129 ++++++ internal/plugin/manifest/engines.go | 62 +++ internal/plugin/manifest/engines_test.go | 26 ++ internal/plugin/manifest/manifest.go | 85 ++++ internal/plugin/manifest/point.go | 18 +- internal/plugin/manifest/template.go | 64 +++ internal/plugin/manifest/template_test.go | 34 ++ internal/plugin/pkg/pkg.go | 280 ++++++++++++ internal/plugin/pkg/pkg_test.go | 140 ++++++ internal/plugin/plugintest/plugintest.go | 265 +++++++++++ internal/plugin/reconcile/nodes.go | 141 ++++++ internal/plugin/reconcile/nodes_test.go | 63 +++ internal/plugin/reconcile/reconcile.go | 382 ++++++++++++++++ internal/plugin/reconcile/reconcile_test.go | 130 ++++++ internal/plugin/reconcile/store.go | 52 +++ internal/plugin/registry/registry.go | 74 ++- internal/plugin/registry/registry_test.go | 52 +++ internal/plugin/tenancy/config.go | 128 ++++++ internal/plugin/tenancy/tenancy.go | 26 +- internal/plugin/tenancy/tenancy_test.go | 115 ++++- internal/router/router.go | 2 + internal/router/routes_plugin.go | 22 + internal/router/routes_plugin_test.go | 41 ++ internal/types/interfaces/plugin.go | 20 +- internal/types/mcp.go | 12 +- internal/types/plugin.go | 50 +++ migrations/sqlite/000035_plugins.down.sql | 2 + migrations/sqlite/000035_plugins.up.sql | 26 ++ migrations/versioned/000116_plugins.down.sql | 2 + migrations/versioned/000116_plugins.up.sql | 35 ++ 83 files changed, 7243 insertions(+), 112 deletions(-) create mode 100644 frontend/src/api/system/plugins.ts create mode 100644 frontend/src/views/system/PluginManagement.vue create mode 100644 frontend/src/views/system/pluginManagementState.test.ts create mode 100644 frontend/src/views/system/pluginManagementState.ts create mode 100644 frontend/src/views/system/plugins/PluginDetailDrawer.vue create mode 100644 frontend/src/views/system/plugins/PluginInstallDrawer.vue create mode 100644 internal/application/repository/plugin.go create mode 100644 internal/application/repository/plugin_test.go create mode 100644 internal/container/plugin_runtime.go create mode 100644 internal/handler/plugin_admin.go create mode 100644 internal/models/runtime/plugin.go create mode 100644 internal/models/runtime/plugin_test.go create mode 100644 internal/plugin/activate/mcp.go create mode 100644 internal/plugin/activate/mcp_test.go create mode 100644 internal/plugin/activate/skills.go create mode 100644 internal/plugin/activate/skills_test.go create mode 100644 internal/plugin/activate/vendors.go create mode 100644 internal/plugin/activate/vendors_test.go create mode 100644 internal/plugin/configschema/secrets_test.go create mode 100644 internal/plugin/install/config.go create mode 100644 internal/plugin/install/install.go create mode 100644 internal/plugin/install/install_test.go create mode 100644 internal/plugin/manifest/engines.go create mode 100644 internal/plugin/manifest/engines_test.go create mode 100644 internal/plugin/manifest/template.go create mode 100644 internal/plugin/manifest/template_test.go create mode 100644 internal/plugin/pkg/pkg.go create mode 100644 internal/plugin/pkg/pkg_test.go create mode 100644 internal/plugin/plugintest/plugintest.go create mode 100644 internal/plugin/reconcile/nodes.go create mode 100644 internal/plugin/reconcile/nodes_test.go create mode 100644 internal/plugin/reconcile/reconcile.go create mode 100644 internal/plugin/reconcile/reconcile_test.go create mode 100644 internal/plugin/reconcile/store.go create mode 100644 internal/plugin/tenancy/config.go create mode 100644 internal/router/routes_plugin_test.go create mode 100644 internal/types/plugin.go create mode 100644 migrations/sqlite/000035_plugins.down.sql create mode 100644 migrations/sqlite/000035_plugins.up.sql create mode 100644 migrations/versioned/000116_plugins.down.sql create mode 100644 migrations/versioned/000116_plugins.up.sql diff --git a/frontend/src/api/mcp-service.ts b/frontend/src/api/mcp-service.ts index 106446d8..2c94fc6f 100644 --- a/frontend/src/api/mcp-service.ts +++ b/frontend/src/api/mcp-service.ts @@ -41,6 +41,10 @@ export interface MCPService { } env_vars?: Record // Environment variables for stdio transport is_builtin?: boolean // Whether this is a builtin MCP service + /** Installed plugin providing the service (read-only, never stored). */ + plugin_id?: string + /** Why a plugin service is off, typically missing workspace configuration. */ + plugin_error?: string // Per-field "configured?" map embedded on the main response (server-side // dto.MCPServiceResponse.Credentials). Drives the CredentialResource card // without a follow-up GET. Absent for builtin services. diff --git a/frontend/src/api/plugin.ts b/frontend/src/api/plugin.ts index e2bb529e..d866a04b 100644 --- a/frontend/src/api/plugin.ts +++ b/frontend/src/api/plugin.ts @@ -1,10 +1,19 @@ import { get, put } from '@/utils/request' +import type { ConfigSchema, ConfigValue } from '@/components/schema-form/schema' import type { LocalizedText } from '@/utils/localizedText' export type { LocalizedText } from '@/utils/localizedText' -export type ExtensionPoint = 'modelVendors' | 'connectors' | 'imChannels' | 'webSearch' | 'tools' | 'parsers' +export type ExtensionPoint = + | 'modelVendors' + | 'connectors' + | 'imChannels' + | 'webSearch' + | 'tools' + | 'parsers' + | 'skills' + | 'mcpServers' export interface PluginContribution { id: string @@ -14,6 +23,16 @@ export interface PluginContribution { aliases?: string[] capabilities?: string[] order?: number + /** Package path of a skill directory or model vendor file. */ + path?: string + /** Remote MCP server an installed plugin contributes. */ + mcp?: { url: string; transport?: string; headers?: Record } +} + +export interface PluginPermissions { + egress?: string[] + hostApi?: string[] + events?: string[] } /** A plugin's manifest (internal/plugin/manifest.Manifest). */ @@ -25,9 +44,19 @@ export interface PluginManifest { description?: LocalizedText publisher: { id: string; name?: string; url?: string } icon?: string + homepage?: string + license?: string builtin?: boolean required?: boolean + engines?: { weknora?: string } runtime: { type: string } + permissions?: PluginPermissions + config?: { + system?: string + tenant?: string + systemSchema?: ConfigSchema + tenantSchema?: ConfigSchema + } contributes: Partial> } @@ -38,11 +67,43 @@ export interface TenantPlugin { updatedAt?: string } +/** One running instance of a plugin, for the detail view. */ +export interface PluginInstance { + node: string + version: string + state: 'starting' | 'ready' | 'degraded' | 'stopped' + error?: string + updatedAt: string +} + +/** A plugin configuration: its schema and values, secrets redacted. */ +export interface PluginConfig { + schema: ConfigSchema + values: ConfigValue + updatedAt?: string +} + export function listPlugins() { return get<{ data: TenantPlugin[] }>('/api/v1/plugins') } +export function getPlugin(id: string) { + return get<{ data: TenantPlugin & { instances: PluginInstance[]; instanceError?: string } }>( + `/api/v1/plugins/${encodeURIComponent(id)}`, + ) +} + /** Turns a plugin on or off for the current workspace (Admin+). */ export function setPluginEnabled(id: string, enabled: boolean) { return put<{ data: TenantPlugin }>(`/api/v1/plugins/${encodeURIComponent(id)}/enabled`, { enabled }) } + +/** The workspace's configuration of a plugin (Admin+). */ +export function getPluginConfig(id: string) { + return get<{ data: PluginConfig }>(`/api/v1/plugins/${encodeURIComponent(id)}/config`) +} + +/** Saves the workspace's configuration; "***" keeps a stored secret (Admin+). */ +export function updatePluginConfig(id: string, values: ConfigValue) { + return put<{ data: PluginConfig }>(`/api/v1/plugins/${encodeURIComponent(id)}/config`, { values }) +} diff --git a/frontend/src/api/system/plugins.ts b/frontend/src/api/system/plugins.ts new file mode 100644 index 00000000..633ee560 --- /dev/null +++ b/frontend/src/api/system/plugins.ts @@ -0,0 +1,110 @@ +// System-admin plugin installation (/api/v1/system/admin/plugins). +import { del, get, post, postUpload, put } from '@/utils/request' + +import type { ConfigValue } from '@/components/schema-form/schema' +import type { PluginConfig, PluginManifest } from '@/api/plugin' + +const BASE = '/api/v1/system/admin/plugins' +const PACKAGE_TIMEOUT = 5 * 60 * 1000 + +/** What installing a package would do. */ +export type InstallChange = 'install' | 'upgrade' | 'downgrade' | 'reinstall' + +export interface PluginPreview { + manifest: PluginManifest + digest: string + size: number + change: InstallChange + installedVersion?: string +} + +export interface PluginVersion { + plugin_id: string + version: string + digest: string + manifest: PluginManifest + size: number + created_by: string + created_at: string +} + +/** This node's report on an installed plugin. */ +export interface PluginNodeStatus { + version: string + state: 'ready' | 'failed' + error?: string + updatedAt: string +} + +export interface InstalledPlugin { + id: string + source: { kind: 'upload' | 'url'; url?: string } + active_version: string + desired_state: 'enabled' | 'disabled' + runtime: string + granted_perms: PluginManifest['permissions'] + created_by: string + created_at: string + updated_at: string + manifest?: PluginManifest + versions: PluginVersion[] + node?: PluginNodeStatus +} + +/** A package to inspect or install: an uploaded file or a URL. */ +export type PackageSource = { file: File } | { url: string } + +function packageForm(file: File, digest?: string) { + const form = new FormData() + form.append('file', file) + if (digest) form.append('digest', digest) + return form +} + +export function listInstalledPlugins() { + return get<{ data: InstalledPlugin[] }>(BASE) +} + +export function getInstalledPlugin(id: string) { + return get<{ data: InstalledPlugin }>(`${BASE}/${encodeURIComponent(id)}`) +} + +/** Reads a package and reports what installing it would do, changing nothing. */ +export function inspectPluginPackage(source: PackageSource) { + if ('file' in source) { + return postUpload(`${BASE}/inspect`, packageForm(source.file), undefined, { timeout: PACKAGE_TIMEOUT }) as Promise<{ + data: PluginPreview + }> + } + return post<{ data: PluginPreview }>(`${BASE}/inspect`, { url: source.url }, { timeout: PACKAGE_TIMEOUT }) +} + +/** Installs the package reviewed with inspect; digest pins it to that package. */ +export function installPluginPackage(source: PackageSource, digest: string) { + if ('file' in source) { + return postUpload(BASE, packageForm(source.file, digest), undefined, { timeout: PACKAGE_TIMEOUT }) as Promise<{ + data: InstalledPlugin + }> + } + return post<{ data: InstalledPlugin }>(BASE, { url: source.url, digest }, { timeout: PACKAGE_TIMEOUT }) +} + +export function setInstalledPluginEnabled(id: string, enabled: boolean) { + return put<{ data: InstalledPlugin }>(`${BASE}/${encodeURIComponent(id)}/enabled`, { enabled }) +} + +export function activatePluginVersion(id: string, version: string) { + return put<{ data: InstalledPlugin }>(`${BASE}/${encodeURIComponent(id)}/active-version`, { version }) +} + +export function uninstallPlugin(id: string) { + return del(`${BASE}/${encodeURIComponent(id)}`) +} + +export function getPluginSystemConfig(id: string) { + return get<{ data: PluginConfig }>(`${BASE}/${encodeURIComponent(id)}/config`) +} + +export function updatePluginSystemConfig(id: string, values: ConfigValue) { + return put<{ data: PluginConfig }>(`${BASE}/${encodeURIComponent(id)}/config`, { values }) +} diff --git a/frontend/src/config/settingsAccess.test.ts b/frontend/src/config/settingsAccess.test.ts index dbe44dc9..1ddc425b 100644 --- a/frontend/src/config/settingsAccess.test.ts +++ b/frontend/src/config/settingsAccess.test.ts @@ -34,6 +34,6 @@ test('personal skill environment variables are visible to every member', () => { test('system administration settings stay explicitly system-admin-only', () => { assert.deepEqual( [...SYSTEM_ADMIN_SETTINGS_SECTIONS], - ['system-global', 'model-catalog', 'runtime-queues', 'platform-api-keys', 'system-audit-log'], + ['system-global', 'model-catalog', 'runtime-queues', 'platform-api-keys', 'system-audit-log', 'plugin-admin'], ) }) diff --git a/frontend/src/config/settingsAccess.ts b/frontend/src/config/settingsAccess.ts index 5950c7c5..683bbedd 100644 --- a/frontend/src/config/settingsAccess.ts +++ b/frontend/src/config/settingsAccess.ts @@ -49,4 +49,5 @@ export const SYSTEM_ADMIN_SETTINGS_SECTIONS = new Set([ 'runtime-queues', 'platform-api-keys', 'system-audit-log', + 'plugin-admin', ]) diff --git a/frontend/src/extensions/builtin/settings.ts b/frontend/src/extensions/builtin/settings.ts index 90d1c175..582899c7 100644 --- a/frontend/src/extensions/builtin/settings.ts +++ b/frontend/src/extensions/builtin/settings.ts @@ -26,6 +26,7 @@ import WebSearchSettings from '@/views/settings/WebSearchSettings.vue' import WeKnoraCloudSettings from '@/views/settings/WeKnoraCloudSettings.vue' import ModelCatalog from '@/views/system/ModelCatalog.vue' import PlatformAPIKeys from '@/views/system/PlatformAPIKeys.vue' +import PluginManagement from '@/views/system/PluginManagement.vue' import RuntimeQueues from '@/views/system/RuntimeQueues.vue' import SystemAuditLog from '@/views/system/SystemAuditLog.vue' import SystemSettings from '@/views/system/SystemSettings.vue' @@ -56,6 +57,7 @@ const COMPONENTS: Record = { 'runtime-queues': RuntimeQueues, 'platform-api-keys': PlatformAPIKeys, 'system-audit-log': SystemAuditLog, + 'plugin-admin': PluginManagement, system: SystemInfo, } diff --git a/frontend/src/extensions/builtin/settingsCatalog.ts b/frontend/src/extensions/builtin/settingsCatalog.ts index 60305750..5e7a9e7f 100644 --- a/frontend/src/extensions/builtin/settingsCatalog.ts +++ b/frontend/src/extensions/builtin/settingsCatalog.ts @@ -100,6 +100,7 @@ const ROWS: Record = { { key: 'runtime-queues', label: 'settings.taskQueue', icon: icon('queue') }, { key: 'platform-api-keys', label: 'platformApiKeys.title', icon: icon('secured') }, { key: 'system-audit-log', label: 'system.globalSettings.audit.tabLabel', icon: icon('history') }, + { key: 'plugin-admin', label: 'pluginAdmin.title', icon: icon('app') }, ], platform: [ { key: 'system', label: 'settings.versionInfo', icon: icon('info-circle') }, diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index 814bfb73..c3247ec2 100755 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -1879,6 +1879,8 @@ export default { }, }, skills: { + pluginSection: 'From enabled plugins', + pluginSectionHint: 'Pick a skill a plugin provides to add it to the library; then install it into sandboxes like any other skill.', title: 'Skill Management', description: 'Skills live in the workspace catalog. Register them first, then install onto one or more sandboxes. An agent can only enable skills that are ready on its sandbox.', helpTooltip: 'A catalog skill does not have to be installed anywhere. Scripts only run after the skill is installed into the sandbox image the agent uses. Docker, Cube, and E2B images are not interchangeable — install once per sandbox.', @@ -2729,10 +2731,117 @@ export default { parseCurrentKnowledgeBaseFailed: 'Failed to parse current knowledge base' } }, + pluginAdmin: { + title: 'Plugin management', + description: 'Install and manage plugins for the whole platform. Every workspace sees an installed plugin, and each one enables it for itself; disabling a plugin here unloads it on every node.', + installButton: 'Install plugin', + empty: 'No plugins installed yet', + loadFailed: 'Failed to load installed plugins', + saveFailed: 'Failed to save', + enabledToast: 'Enabled platform-wide', + disabledToast: 'Disabled platform-wide', + platformSwitch: 'Enable or disable platform-wide', + publisher: 'Publisher', + contributions: 'What it adds', + permissions: 'Permissions and remote access', + state: { + running: 'Running', + failed: 'Failed to load', + disabled: 'Disabled', + pending: 'Loading' + }, + nodeState: { + ready: 'Ready', + starting: 'Starting', + degraded: 'Degraded', + stopped: 'Not loaded' + }, + source: { + upload: 'Upload', + url: 'URL' + }, + change: { + install: 'New install', + upgrade: 'Upgrade from v{from}', + downgrade: 'Downgrade from v{from}', + reinstall: 'Reinstall' + }, + permission: { + remote: 'Remote service', + egress: 'Network egress', + hostApi: 'WeKnora API', + events: 'Events' + }, + install: { + title: 'Install plugin', + description: 'Upload a .wkp package or give its download URL, review it, then install.', + sourceSection: 'Package', + mode: { + upload: 'Upload file', + url: 'From URL' + }, + fileLabel: 'Package file', + chooseFile: 'Choose file', + noFile: 'No file chosen', + fileHint: 'A .wkp file (a zip with plugin.yaml), up to 64 MB.', + urlLabel: 'Download URL', + urlHint: 'The server downloads this URL; private network addresses are refused.', + reviewSection: 'Review before installing', + noPermissions: 'This plugin asks for no extra permissions.', + configNotice: 'This plugin needs configuration: platform settings are in its details after installing, and workspace admins fill in workspace settings in Plugins.', + tenantNotice: 'Once installed the plugin is visible to every workspace but disabled until a workspace admin enables it.', + digest: 'Package digest', + inspect: 'Inspect package', + confirm: { + install: 'Install', + upgrade: 'Upgrade', + downgrade: 'Install older version', + reinstall: 'Reinstall' + }, + inspectFailed: 'Could not read the package', + failed: 'Install failed', + done: 'Installed {name}' + }, + detail: { + overview: 'Overview', + runtime: 'Runtime', + source: 'Source', + homepage: 'Homepage', + license: 'License', + engines: 'Compatible versions', + nodes: 'Nodes', + noNodes: 'No node has the plugin loaded', + versions: 'Versions', + active: 'Active', + activate: 'Switch to this version', + rollback: 'Roll back to this version', + activateConfirm: 'Make v{version} the active version? Every node reloads the plugin.', + activated: 'Switched to v{version}', + activateFailed: 'Failed to switch versions', + systemConfig: 'Platform settings', + systemConfigHint: 'Apply to every workspace, such as a service region or a platform-wide credential.', + configLoadFailed: 'Failed to load platform settings', + configSaved: 'Platform settings saved', + configSaveFailed: 'Failed to save platform settings', + danger: 'Uninstall', + uninstallHint: 'Removes the plugin and every stored version. Workspaces\' switches and settings are kept and come back if you reinstall.', + uninstall: 'Uninstall plugin', + uninstallConfirm: 'Uninstall? Every node unloads the plugin right away.', + uninstalled: 'Plugin uninstalled', + uninstallFailed: 'Uninstall failed' + } + }, pluginCenter: { + installed: 'Installed', + configure: 'Configure', + configTitle: 'Configure {name}', + configDescription: 'This workspace\'s settings for the plugin, such as its API key. Secrets are stored encrypted and never shown again.', + configLoadFailed: 'Failed to load the plugin configuration', + configSaved: 'Plugin configuration saved', + configSaveFailed: 'Failed to save the plugin configuration', navGroup: 'Extensions', title: 'Plugins', - description: 'Every plugin this deployment provides, builtins included. Enable or disable them for this workspace: a disabled plugin\'s integrations leave the type lists and cannot be created, while existing ones keep working.', + description: 'Every plugin this deployment provides: builtins and the ones a system administrator installed. Enable or disable them for this workspace: a disabled plugin\'s integrations leave the type lists and cannot be created, while existing ones keep working. Installed plugins start disabled until a workspace admin enables them.', searchPlaceholder: 'Search plugins, IDs or integrations', allPoints: 'All', empty: 'No matching plugins', @@ -2750,7 +2859,9 @@ export default { imChannels: 'IM channels', webSearch: 'Web search', tools: 'Agent tools', - parsers: 'Document parsing' + parsers: 'Document parsing', + skills: 'Skills', + mcpServers: 'MCP servers' } }, schemaForm: { @@ -5388,6 +5499,8 @@ export default { } }, mcpSettings: { + fromPlugin: 'Plugin', + pluginNotConfigured: 'The plugin is not configured yet; fill in its settings in Plugins to use it', addUsageInstructions: "Add usage instructions", noUsageInstructions: "No usage instructions yet", title: 'MCP Services', diff --git a/frontend/src/i18n/locales/ja-JP.ts b/frontend/src/i18n/locales/ja-JP.ts index aadd5cc7..a299aa85 100644 --- a/frontend/src/i18n/locales/ja-JP.ts +++ b/frontend/src/i18n/locales/ja-JP.ts @@ -1879,6 +1879,8 @@ export default { }, }, skills: { + pluginSection: '有効なプラグインから', + pluginSectionHint: 'プラグインが提供するスキルを選んでライブラリに追加し、他のスキルと同様にサンドボックスへインストールできます。', title: 'スキル管理', description: 'スキルはワークスペースのカタログに登録されます。まず登録し、その後1つ以上のサンドボックスにインストールしてください。エージェントは、自身のサンドボックスで準備完了しているスキルのみ有効化できます。', helpTooltip: 'カタログのスキルは、どこかにインストールされている必要はありません。スクリプトは、エージェントが使用するサンドボックスイメージにスキルがインストールされて初めて実行されます。Docker、Cube、E2Bのイメージには互換性がないため、サンドボックスごとにインストールしてください。', @@ -2729,10 +2731,117 @@ export default { parseCurrentKnowledgeBaseFailed: '現在のナレッジベースの解析に失敗しました' } }, + pluginAdmin: { + title: 'プラグイン管理', + description: 'プラットフォーム全体のプラグインをインストール・管理します。インストールしたプラグインはすべてのワークスペースに表示され、各ワークスペースで個別に有効化します。ここで無効にすると全ノードでアンロードされます。', + installButton: 'プラグインをインストール', + empty: 'インストール済みのプラグインはありません', + loadFailed: 'インストール済みプラグインの読み込みに失敗しました', + saveFailed: '保存に失敗しました', + enabledToast: 'プラットフォーム全体で有効にしました', + disabledToast: 'プラットフォーム全体で無効にしました', + platformSwitch: 'プラットフォーム全体で有効/無効', + publisher: '発行者', + contributions: '提供する機能', + permissions: '権限と外部アクセス', + state: { + running: '稼働中', + failed: '読み込み失敗', + disabled: '無効', + pending: '読み込み中' + }, + nodeState: { + ready: '準備完了', + starting: '起動中', + degraded: '異常', + stopped: '未読み込み' + }, + source: { + upload: 'アップロード', + url: 'URL' + }, + change: { + install: '新規インストール', + upgrade: 'v{from} からアップグレード', + downgrade: 'v{from} からダウングレード', + reinstall: '再インストール' + }, + permission: { + remote: 'リモートサービス', + egress: 'ネットワーク送信', + hostApi: 'WeKnora API', + events: 'イベント' + }, + install: { + title: 'プラグインをインストール', + description: '.wkp パッケージをアップロードするかダウンロード URL を指定し、確認してからインストールします。', + sourceSection: 'パッケージ', + mode: { + upload: 'ファイルをアップロード', + url: 'URL から' + }, + fileLabel: 'パッケージファイル', + chooseFile: 'ファイルを選択', + noFile: 'ファイル未選択', + fileHint: '.wkp ファイル(plugin.yaml を含む zip)、最大 64 MB。', + urlLabel: 'ダウンロード URL', + urlHint: 'サーバーがこの URL からダウンロードします。プライベートネットワークのアドレスは拒否されます。', + reviewSection: 'インストール前の確認', + noPermissions: 'このプラグインは追加の権限を要求しません。', + configNotice: 'このプラグインには設定が必要です。プラットフォーム設定はインストール後の詳細で、ワークスペース設定は各ワークスペース管理者がプラグインセンターで入力します。', + tenantNotice: 'インストール後、プラグインはすべてのワークスペースに表示されますが、ワークスペース管理者が有効にするまで無効です。', + digest: 'パッケージダイジェスト', + inspect: 'パッケージを確認', + confirm: { + install: 'インストール', + upgrade: 'アップグレード', + downgrade: '旧バージョンをインストール', + reinstall: '再インストール' + }, + inspectFailed: 'パッケージを読み込めませんでした', + failed: 'インストールに失敗しました', + done: '{name} をインストールしました' + }, + detail: { + overview: '概要', + runtime: 'ランタイム', + source: '取得元', + homepage: 'ホームページ', + license: 'ライセンス', + engines: '対応バージョン', + nodes: 'ノード', + noNodes: 'このプラグインを読み込んでいるノードはありません', + versions: 'バージョン', + active: '使用中', + activate: 'このバージョンに切り替え', + rollback: 'このバージョンにロールバック', + activateConfirm: 'v{version} を使用中のバージョンにしますか?すべてのノードで再読み込みされます。', + activated: 'v{version} に切り替えました', + activateFailed: 'バージョンの切り替えに失敗しました', + systemConfig: 'プラットフォーム設定', + systemConfigHint: 'すべてのワークスペースに適用されます(サービスリージョンや共通の認証情報など)。', + configLoadFailed: 'プラットフォーム設定の読み込みに失敗しました', + configSaved: 'プラットフォーム設定を保存しました', + configSaveFailed: 'プラットフォーム設定の保存に失敗しました', + danger: 'アンインストール', + uninstallHint: 'プラグインと保存済みの全バージョンを削除します。各ワークスペースのスイッチと設定は保持され、再インストールすると復元されます。', + uninstall: 'プラグインをアンインストール', + uninstallConfirm: 'アンインストールしますか?すべてのノードで直ちにアンロードされます。', + uninstalled: 'プラグインをアンインストールしました', + uninstallFailed: 'アンインストールに失敗しました' + } + }, pluginCenter: { + installed: 'インストール済み', + configure: '設定', + configTitle: '{name} の設定', + configDescription: 'このワークスペースでプラグインを使うための設定(API キーなど)。シークレットは暗号化して保存され、再表示されません。', + configLoadFailed: 'プラグイン設定の読み込みに失敗しました', + configSaved: 'プラグイン設定を保存しました', + configSaveFailed: 'プラグイン設定の保存に失敗しました', navGroup: '拡張', title: 'プラグイン', - description: 'このデプロイが提供するすべてのプラグイン(組み込みを含む)を表示し、このワークスペースで有効/無効にします。無効にしたプラグインの連携は種類一覧から消えて新規作成できなくなりますが、既存のものは引き続き動作します。', + description: 'このデプロイが提供するすべてのプラグイン(組み込みと、システム管理者がインストールしたもの)。このワークスペースで有効化・無効化できます。無効にしたプラグインの連携は種類一覧から外れ新規作成できなくなりますが、既存のものは引き続き動作します。インストールされたプラグインは、ワークスペース管理者が有効にするまで無効です。', searchPlaceholder: 'プラグイン名・ID・連携を検索', allPoints: 'すべて', empty: '一致するプラグインはありません', @@ -2750,7 +2859,9 @@ export default { imChannels: 'IM チャネル', webSearch: 'Web 検索', tools: 'エージェントツール', - parsers: 'ドキュメント解析' + parsers: 'ドキュメント解析', + skills: 'スキル', + mcpServers: 'MCP サーバー' } }, schemaForm: { @@ -5388,6 +5499,8 @@ export default { } }, mcpSettings: { + fromPlugin: 'プラグイン', + pluginNotConfigured: 'プラグインが未設定です。プラグインセンターで設定してから使用してください', addUsageInstructions: "使用方法を追加", noUsageInstructions: "使用方法は未入力です", title: 'MCPサービス', diff --git a/frontend/src/i18n/locales/ko-KR.ts b/frontend/src/i18n/locales/ko-KR.ts index 16604443..1b8e62b8 100755 --- a/frontend/src/i18n/locales/ko-KR.ts +++ b/frontend/src/i18n/locales/ko-KR.ts @@ -2663,6 +2663,8 @@ export default { } }, mcpSettings: { + fromPlugin: '플러그인', + pluginNotConfigured: '플러그인이 아직 설정되지 않았습니다. 플러그인 센터에서 설정한 뒤 사용하세요', addUsageInstructions: "사용 안내 추가", noUsageInstructions: "아직 사용 안내가 없습니다", title: 'MCP 서비스 관리', @@ -5249,10 +5251,117 @@ export default { belongsToOrg: '스페이스: ', noCompatibleKbForAgent: '현재 에이전트의 도구와 범위 내 지식베이스의 기능이 일치하지 않아 참조할 수 있는 지식베이스가 없습니다.' }, + pluginAdmin: { + title: '플러그인 관리', + description: '플랫폼 전체의 플러그인을 설치하고 관리합니다. 설치된 플러그인은 모든 워크스페이스에 보이며 각 워크스페이스가 직접 활성화합니다. 여기서 비활성화하면 모든 노드에서 언로드됩니다.', + installButton: '플러그인 설치', + empty: '설치된 플러그인이 없습니다', + loadFailed: '설치된 플러그인을 불러오지 못했습니다', + saveFailed: '저장하지 못했습니다', + enabledToast: '플랫폼 전체에서 활성화했습니다', + disabledToast: '플랫폼 전체에서 비활성화했습니다', + platformSwitch: '플랫폼 전체 활성화 / 비활성화', + publisher: '게시자', + contributions: '제공 기능', + permissions: '권한 및 외부 접근', + state: { + running: '실행 중', + failed: '로드 실패', + disabled: '비활성', + pending: '로드 중' + }, + nodeState: { + ready: '준비됨', + starting: '시작 중', + degraded: '이상', + stopped: '로드되지 않음' + }, + source: { + upload: '업로드', + url: 'URL' + }, + change: { + install: '새로 설치', + upgrade: 'v{from}에서 업그레이드', + downgrade: 'v{from}에서 다운그레이드', + reinstall: '재설치' + }, + permission: { + remote: '원격 서비스', + egress: '네트워크 송신', + hostApi: 'WeKnora API', + events: '이벤트' + }, + install: { + title: '플러그인 설치', + description: '.wkp 패키지를 업로드하거나 다운로드 URL을 입력하고, 검토한 뒤 설치합니다.', + sourceSection: '패키지', + mode: { + upload: '파일 업로드', + url: 'URL에서' + }, + fileLabel: '패키지 파일', + chooseFile: '파일 선택', + noFile: '선택된 파일 없음', + fileHint: '.wkp 파일(plugin.yaml이 포함된 zip), 최대 64 MB.', + urlLabel: '다운로드 URL', + urlHint: '서버가 이 URL에서 다운로드합니다. 사설 네트워크 주소는 거부됩니다.', + reviewSection: '설치 전 검토', + noPermissions: '이 플러그인은 추가 권한을 요청하지 않습니다.', + configNotice: '이 플러그인은 설정이 필요합니다. 플랫폼 설정은 설치 후 상세 화면에서, 워크스페이스 설정은 각 워크스페이스 관리자가 플러그인 센터에서 입력합니다.', + tenantNotice: '설치 후 플러그인은 모든 워크스페이스에 보이지만 워크스페이스 관리자가 활성화하기 전까지 비활성 상태입니다.', + digest: '패키지 다이제스트', + inspect: '패키지 검사', + confirm: { + install: '설치', + upgrade: '업그레이드', + downgrade: '이전 버전 설치', + reinstall: '재설치' + }, + inspectFailed: '패키지를 읽을 수 없습니다', + failed: '설치에 실패했습니다', + done: '{name}을(를) 설치했습니다' + }, + detail: { + overview: '개요', + runtime: '런타임', + source: '출처', + homepage: '홈페이지', + license: '라이선스', + engines: '호환 버전', + nodes: '노드', + noNodes: '이 플러그인을 로드한 노드가 없습니다', + versions: '버전', + active: '사용 중', + activate: '이 버전으로 전환', + rollback: '이 버전으로 롤백', + activateConfirm: 'v{version}을(를) 사용 중인 버전으로 할까요? 모든 노드가 플러그인을 다시 로드합니다.', + activated: 'v{version}(으)로 전환했습니다', + activateFailed: '버전을 전환하지 못했습니다', + systemConfig: '플랫폼 설정', + systemConfigHint: '모든 워크스페이스에 적용됩니다(예: 서비스 리전, 플랫폼 공용 자격 증명).', + configLoadFailed: '플랫폼 설정을 불러오지 못했습니다', + configSaved: '플랫폼 설정을 저장했습니다', + configSaveFailed: '플랫폼 설정을 저장하지 못했습니다', + danger: '제거', + uninstallHint: '플러그인과 저장된 모든 버전을 삭제합니다. 워크스페이스의 스위치와 설정은 유지되며 재설치하면 복원됩니다.', + uninstall: '플러그인 제거', + uninstallConfirm: '제거할까요? 모든 노드에서 즉시 언로드됩니다.', + uninstalled: '플러그인을 제거했습니다', + uninstallFailed: '제거하지 못했습니다' + } + }, pluginCenter: { + installed: '설치됨', + configure: '설정', + configTitle: '{name} 설정', + configDescription: '이 워크스페이스에서 플러그인을 사용하기 위한 설정(예: API 키). 비밀 값은 암호화되어 저장되며 다시 표시되지 않습니다.', + configLoadFailed: '플러그인 설정을 불러오지 못했습니다', + configSaved: '플러그인 설정을 저장했습니다', + configSaveFailed: '플러그인 설정을 저장하지 못했습니다', navGroup: '확장', title: '플러그인', - description: '이 배포가 제공하는 모든 플러그인(내장 포함)을 보고 이 워크스페이스에서 켜거나 끕니다. 끈 플러그인의 연동은 유형 목록에서 사라지고 새로 만들 수 없지만 기존 연동은 계속 동작합니다.', + description: '이 배포에서 제공하는 모든 플러그인(내장 플러그인과 시스템 관리자가 설치한 플러그인). 이 워크스페이스에서 활성화하거나 비활성화할 수 있습니다. 비활성화된 플러그인의 연동은 유형 목록에서 빠지고 새로 만들 수 없지만 기존 항목은 계속 동작합니다. 설치된 플러그인은 워크스페이스 관리자가 활성화하기 전까지 비활성 상태입니다.', searchPlaceholder: '플러그인 이름, ID 또는 연동 검색', allPoints: '전체', empty: '일치하는 플러그인이 없습니다', @@ -5270,7 +5379,9 @@ export default { imChannels: 'IM 채널', webSearch: '웹 검색', tools: '에이전트 도구', - parsers: '문서 파싱' + parsers: '문서 파싱', + skills: '스킬', + mcpServers: 'MCP 서버' } }, schemaForm: { @@ -6280,6 +6391,8 @@ export default { }, }, skills: { + pluginSection: '활성화된 플러그인에서', + pluginSectionHint: '플러그인이 제공하는 스킬을 선택해 라이브러리에 추가한 뒤, 다른 스킬처럼 샌드박스에 설치할 수 있습니다.', title: '스킬 관리', description: '스킬은 워크스페이스 카탈로그에 속합니다. 먼저 등록한 뒤 하나 이상의 샌드박스에 설치할 수 있습니다. 에이전트는 현재 샌드박스에서 준비된 스킬만 사용할 수 있습니다.', helpTooltip: '카탈로그 스킬은 아무 샌드박스에도 설치하지 않아도 됩니다. 스크립트를 실행하려면 에이전트가 쓰는 샌드박스 이미지에 설치해야 합니다. Docker, Cube, E2B 이미지는 호환되지 않으므로 샌드박스마다 따로 설치합니다.', diff --git a/frontend/src/i18n/locales/ru-RU.ts b/frontend/src/i18n/locales/ru-RU.ts index 080af655..c9a6e6a7 100755 --- a/frontend/src/i18n/locales/ru-RU.ts +++ b/frontend/src/i18n/locales/ru-RU.ts @@ -2663,6 +2663,8 @@ export default { } }, mcpSettings: { + fromPlugin: 'Плагин', + pluginNotConfigured: 'Плагин ещё не настроен; заполните его настройки в разделе «Плагины»', addUsageInstructions: "Добавить инструкции", noUsageInstructions: "Инструкции пока не добавлены", title: 'Сервисы MCP', @@ -5249,10 +5251,117 @@ export default { belongsToOrg: 'Пространство: ', noCompatibleKbForAgent: 'Инструменты текущего агента не соответствуют возможностям ни одной базы знаний в области видимости — нечего упомянуть.' }, + pluginAdmin: { + title: 'Управление плагинами', + description: 'Установка и управление плагинами всей платформы. Установленный плагин виден всем рабочим пространствам, и каждое включает его самостоятельно; отключение здесь выгружает плагин на всех узлах.', + installButton: 'Установить плагин', + empty: 'Плагины ещё не установлены', + loadFailed: 'Не удалось загрузить установленные плагины', + saveFailed: 'Не удалось сохранить', + enabledToast: 'Включён для всей платформы', + disabledToast: 'Отключён для всей платформы', + platformSwitch: 'Включить или отключить для всей платформы', + publisher: 'Издатель', + contributions: 'Что добавляет', + permissions: 'Разрешения и внешний доступ', + state: { + running: 'Работает', + failed: 'Ошибка загрузки', + disabled: 'Отключён', + pending: 'Загружается' + }, + nodeState: { + ready: 'Готов', + starting: 'Запускается', + degraded: 'Сбой', + stopped: 'Не загружен' + }, + source: { + upload: 'Загрузка', + url: 'URL' + }, + change: { + install: 'Новая установка', + upgrade: 'Обновление с v{from}', + downgrade: 'Откат с v{from}', + reinstall: 'Переустановка' + }, + permission: { + remote: 'Удалённый сервис', + egress: 'Исходящая сеть', + hostApi: 'API WeKnora', + events: 'События' + }, + install: { + title: 'Установка плагина', + description: 'Загрузите пакет .wkp или укажите URL для скачивания, проверьте и установите.', + sourceSection: 'Пакет', + mode: { + upload: 'Загрузить файл', + url: 'По URL' + }, + fileLabel: 'Файл пакета', + chooseFile: 'Выбрать файл', + noFile: 'Файл не выбран', + fileHint: 'Файл .wkp (zip с plugin.yaml), до 64 МБ.', + urlLabel: 'URL для скачивания', + urlHint: 'Сервер скачает этот URL; адреса частных сетей запрещены.', + reviewSection: 'Проверка перед установкой', + noPermissions: 'Плагин не запрашивает дополнительных разрешений.', + configNotice: 'Плагину нужны настройки: настройки платформы — в его карточке после установки, настройки рабочего пространства заполняют его администраторы в разделе «Плагины».', + tenantNotice: 'После установки плагин виден всем рабочим пространствам, но выключен, пока администратор пространства его не включит.', + digest: 'Дайджест пакета', + inspect: 'Проверить пакет', + confirm: { + install: 'Установить', + upgrade: 'Обновить', + downgrade: 'Установить старую версию', + reinstall: 'Переустановить' + }, + inspectFailed: 'Не удалось прочитать пакет', + failed: 'Не удалось установить', + done: 'Установлен {name}' + }, + detail: { + overview: 'Обзор', + runtime: 'Среда выполнения', + source: 'Источник', + homepage: 'Сайт', + license: 'Лицензия', + engines: 'Совместимые версии', + nodes: 'Узлы', + noNodes: 'Ни один узел не загрузил плагин', + versions: 'Версии', + active: 'Активная', + activate: 'Переключиться на эту версию', + rollback: 'Откатиться к этой версии', + activateConfirm: 'Сделать v{version} активной версией? Все узлы перезагрузят плагин.', + activated: 'Переключено на v{version}', + activateFailed: 'Не удалось переключить версию', + systemConfig: 'Настройки платформы', + systemConfigHint: 'Действуют во всех рабочих пространствах, например регион сервиса или общий ключ платформы.', + configLoadFailed: 'Не удалось загрузить настройки платформы', + configSaved: 'Настройки платформы сохранены', + configSaveFailed: 'Не удалось сохранить настройки платформы', + danger: 'Удаление', + uninstallHint: 'Удаляет плагин и все сохранённые версии. Переключатели и настройки рабочих пространств сохраняются и вернутся при повторной установке.', + uninstall: 'Удалить плагин', + uninstallConfirm: 'Удалить? Все узлы сразу выгрузят плагин.', + uninstalled: 'Плагин удалён', + uninstallFailed: 'Не удалось удалить' + } + }, pluginCenter: { + installed: 'Установлен', + configure: 'Настроить', + configTitle: 'Настройки: {name}', + configDescription: 'Настройки плагина для этого рабочего пространства, например API-ключ. Секреты хранятся в зашифрованном виде и больше не показываются.', + configLoadFailed: 'Не удалось загрузить настройки плагина', + configSaved: 'Настройки плагина сохранены', + configSaveFailed: 'Не удалось сохранить настройки плагина', navGroup: 'Расширения', title: 'Плагины', - description: 'Все плагины этого развертывания, включая встроенные. Включайте и отключайте их для рабочего пространства: интеграции отключенного плагина пропадают из списков типов и не создаются, а существующие продолжают работать.', + description: 'Все плагины этого развёртывания: встроенные и установленные системным администратором. Включайте и отключайте их для этого рабочего пространства: интеграции отключённого плагина исчезают из списков типов и не создаются, а существующие продолжают работать. Установленные плагины выключены, пока администратор рабочего пространства их не включит.', searchPlaceholder: 'Поиск по названию, ID или интеграции', allPoints: 'Все', empty: 'Подходящих плагинов нет', @@ -5270,7 +5379,9 @@ export default { imChannels: 'IM-каналы', webSearch: 'Веб-поиск', tools: 'Инструменты агента', - parsers: 'Разбор документов' + parsers: 'Разбор документов', + skills: 'Навыки', + mcpServers: 'MCP-серверы' } }, schemaForm: { @@ -6280,6 +6391,8 @@ export default { }, }, skills: { + pluginSection: 'Из включённых плагинов', + pluginSectionHint: 'Выберите навык, который предоставляет плагин, чтобы добавить его в библиотеку, а затем установите в песочницы, как любой другой навык.', title: 'Управление навыками', description: 'Навыки живут в каталоге пространства. Их можно только зарегистрировать или установить в одну или несколько песочниц. Агент включает только навыки, которые готовы в выбранной песочнице.', helpTooltip: 'Навык из каталога можно не устанавливать никуда. Скрипты запускаются только после установки в образ песочницы агента. Образы Docker, Cube и E2B несовместимы — устанавливайте отдельно в каждую песочницу.', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index 18f175df..e2376815 100755 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -2665,6 +2665,8 @@ export default { } }, mcpSettings: { + fromPlugin: '插件', + pluginNotConfigured: '插件尚未配置,请在插件中心填写配置后使用', addUsageInstructions: "添加使用说明", noUsageInstructions: "尚未填写使用说明", title: 'MCP 服务管理', @@ -5251,10 +5253,117 @@ export default { belongsToOrg: '所属空间:', noCompatibleKbForAgent: '当前智能体的工具与作用域内知识库的能力不匹配,暂无可引用的知识库。' }, + pluginAdmin: { + title: '插件管理', + description: '安装与管理本平台的插件。安装后所有空间都能看到,但每个空间需自行启用;停用会在所有节点卸载该插件。', + installButton: '安装插件', + empty: '还没有安装任何插件', + loadFailed: '加载已安装插件失败', + saveFailed: '保存失败', + enabledToast: '已在全平台启用', + disabledToast: '已在全平台停用', + platformSwitch: '全平台启用 / 停用', + publisher: '发布者', + contributions: '提供的能力', + permissions: '权限与外部访问', + state: { + running: '运行中', + failed: '加载失败', + disabled: '已停用', + pending: '加载中' + }, + nodeState: { + ready: '就绪', + starting: '启动中', + degraded: '异常', + stopped: '未加载' + }, + source: { + upload: '上传', + url: 'URL' + }, + change: { + install: '新安装', + upgrade: '从 v{from} 升级', + downgrade: '从 v{from} 降级', + reinstall: '重新安装' + }, + permission: { + remote: '访问远程服务', + egress: '网络出口', + hostApi: '调用 WeKnora API', + events: '订阅事件' + }, + install: { + title: '安装插件', + description: '上传 .wkp 插件包或填写下载地址,审阅后安装。', + sourceSection: '插件包', + mode: { + upload: '上传文件', + url: '从 URL 下载' + }, + fileLabel: '插件包文件', + chooseFile: '选择文件', + noFile: '未选择文件', + fileHint: '.wkp 文件(包含 plugin.yaml 的 zip),最大 64 MB。', + urlLabel: '下载地址', + urlHint: '服务端会下载该地址;不允许内网地址。', + reviewSection: '安装前审阅', + noPermissions: '该插件不申请任何额外权限。', + configNotice: '该插件需要配置:平台配置在安装后的详情中填写,空间配置由各空间管理员在插件中心填写。', + tenantNotice: '安装后插件对所有空间可见,但默认停用,由各空间管理员自行启用。', + digest: '包摘要', + inspect: '检查插件包', + confirm: { + install: '安装', + upgrade: '升级', + downgrade: '降级安装', + reinstall: '重新安装' + }, + inspectFailed: '无法读取插件包', + failed: '安装失败', + done: '已安装 {name}' + }, + detail: { + overview: '概览', + runtime: '运行方式', + source: '来源', + homepage: '主页', + license: '许可证', + engines: '兼容版本', + nodes: '节点状态', + noNodes: '当前没有节点加载该插件', + versions: '版本', + active: '当前版本', + activate: '切换到此版本', + rollback: '回滚到此版本', + activateConfirm: '将当前版本切换为 v{version}?所有节点会重新加载。', + activated: '已切换到 v{version}', + activateFailed: '切换版本失败', + systemConfig: '平台配置', + systemConfigHint: '对所有空间生效,例如服务区域或平台统一的凭证。', + configLoadFailed: '加载平台配置失败', + configSaved: '平台配置已保存', + configSaveFailed: '保存平台配置失败', + danger: '卸载', + uninstallHint: '删除插件及其全部版本;各空间的开关和配置会保留,重新安装后恢复。', + uninstall: '卸载插件', + uninstallConfirm: '确定卸载?所有节点会立即卸载该插件。', + uninstalled: '插件已卸载', + uninstallFailed: '卸载失败' + } + }, pluginCenter: { + installed: '已安装', + configure: '配置', + configTitle: '配置 {name}', + configDescription: '本空间使用该插件时的配置,例如 API 密钥。密钥加密保存,不会再次显示。', + configLoadFailed: '加载插件配置失败', + configSaved: '插件配置已保存', + configSaveFailed: '保存插件配置失败', navGroup: '扩展', title: '插件', - description: '查看当前部署提供的全部插件(含内置插件),并为本空间启用或停用。停用后,该插件的集成不再出现在类型列表中、不能新建,已有实例不受影响。', + description: '本部署提供的所有插件,含内置插件与平台管理员安装的插件。在这里为当前空间启用或停用:停用后其集成不再出现在类型列表中、不能新建,已有的照常工作。安装的插件默认停用,需空间管理员启用。', searchPlaceholder: '搜索插件名称、ID 或集成', allPoints: '全部', empty: '没有匹配的插件', @@ -5272,7 +5381,9 @@ export default { imChannels: 'IM 渠道', webSearch: '联网搜索', tools: 'Agent 工具', - parsers: '文档解析' + parsers: '文档解析', + skills: '技能', + mcpServers: 'MCP 服务' } }, schemaForm: { @@ -6282,6 +6393,8 @@ export default { }, }, skills: { + pluginSection: '来自已启用的插件', + pluginSectionHint: '选择一个插件提供的技能加入技能库,之后可像其他技能一样安装到沙箱。', title: '技能管理', description: '技能属于空间目录,可以只登记,也可以装到一份或多份沙箱。智能体只能启用当前沙箱里已就绪的技能。', helpTooltip: '目录里的技能可以不装任何沙箱。脚本要跑起来,必须装进智能体所用的那份沙箱镜像。Docker、Cube、E2B 互不通用,装到几份就要装几次。', diff --git a/frontend/src/views/settings/McpSettings.vue b/frontend/src/views/settings/McpSettings.vue index d6e5807b..507d8258 100644 --- a/frontend/src/views/settings/McpSettings.vue +++ b/frontend/src/views/settings/McpSettings.vue @@ -25,7 +25,10 @@

{{ service.name }}

- {{ $t('mcpSettings.builtin') }} + + {{ $t('mcpSettings.fromPlugin') }} + + {{ $t('mcpSettings.builtin') }}
+

+ + {{ $t('mcpSettings.pluginNotConfigured') }} +

{{ serviceUsage(service).replace(/\s+/g, ' ') }}

@@ -66,7 +73,7 @@ {{ getTransportTypeLabel(service.transport_type) }} @@ -136,6 +143,9 @@ const currentService = ref(null) const dialogInitialStep = ref<0 | 1>(0) const togglingIds = ref(new Set()) const serviceUsage = (service: MCPService) => service.usage_instructions?.trim() || service.description?.trim() || '' +// Builtin services are always on; a plugin service is on once the workspace +// has configured the plugin. +const isOn = (service: MCPService) => service.enabled || (!!service.is_builtin && !service.plugin_id) // Load MCP services const loadServices = async () => { @@ -390,6 +400,15 @@ defineExpose({ openAdd: handleAdd }) color: var(--td-text-color-placeholder); } +.service-card__plugin-error { + display: flex; + align-items: center; + gap: 4px; + margin: 0; + font-size: var(--app-text-sm); + color: var(--td-warning-color); +} + .service-card__type { flex-shrink: 0; font-size: var(--app-text-xs); diff --git a/frontend/src/views/settings/PluginCenter.vue b/frontend/src/views/settings/PluginCenter.vue index 87ad1936..40685ea7 100644 --- a/frontend/src/views/settings/PluginCenter.vue +++ b/frontend/src/views/settings/PluginCenter.vue @@ -37,6 +37,7 @@
{{ nameOf(p) }} {{ t('pluginCenter.builtin') }} + {{ t('pluginCenter.installed') }} {{ t('pluginCenter.required') }} @@ -49,16 +50,42 @@
- - - +
+ + + + + {{ t('pluginCenter.configure') }} + +
+ + +
+
+ +
+
@@ -67,11 +94,21 @@ import { computed, onMounted, ref } from 'vue' import { useI18n } from 'vue-i18n' import { MessagePlugin } from 'tdesign-vue-next' -import { listPlugins, setPluginEnabled, type ExtensionPoint, type TenantPlugin } from '@/api/plugin' +import { + getPluginConfig, + listPlugins, + setPluginEnabled, + updatePluginConfig, + type ExtensionPoint, + type TenantPlugin, +} from '@/api/plugin' +import SchemaForm from '@/components/schema-form/SchemaForm.vue' +import { validateConfig, type ConfigSchema, type ConfigValue, type FieldError } from '@/components/schema-form/schema' +import SettingDrawer from '@/components/settings/SettingDrawer.vue' import { useAuthStore } from '@/stores/auth' import { localizedText } from '@/utils/localizedText' -import { EXTENSION_POINTS, contributionSummary, filterPlugins } from './pluginCenterState' +import { EXTENSION_POINTS, contributionSummary, filterPlugins, hasTenantConfig } from './pluginCenterState' // Lists the plugins this deployment knows — builtins included — and lets an // admin turn them off for the workspace. A disabled plugin's integrations drop @@ -130,6 +167,53 @@ async function toggle(p: TenantPlugin, enabled: boolean) { } } +// Workspace configuration of an installed plugin, such as its API key. +const configOpen = ref(false) +const configPlugin = ref(null) +const configSchema = ref(null) +const configValues = ref({}) +const configErrors = ref([]) +const configLoading = ref(false) +const configSaving = ref(false) + +async function openConfig(p: TenantPlugin) { + configPlugin.value = p + configSchema.value = null + configValues.value = {} + configErrors.value = [] + configOpen.value = true + configLoading.value = true + try { + const res = await getPluginConfig(p.manifest.id) + configSchema.value = res.data.schema + configValues.value = res.data.values ?? {} + } catch (e: any) { + MessagePlugin.error(e?.message || t('pluginCenter.configLoadFailed')) + } finally { + configLoading.value = false + } +} + +async function saveConfig() { + const p = configPlugin.value + if (!p || !configSchema.value) return + configErrors.value = validateConfig(configSchema.value, configValues.value) + if (configErrors.value.length) return + configSaving.value = true + try { + const res = await updatePluginConfig(p.manifest.id, configValues.value) + configValues.value = res.data.values ?? {} + MessagePlugin.success(t('pluginCenter.configSaved')) + configOpen.value = false + } catch (e: any) { + const details = e?.error?.details + if (Array.isArray(details)) configErrors.value = details + MessagePlugin.error(e?.message || t('pluginCenter.configSaveFailed')) + } finally { + configSaving.value = false + } +} + onMounted(load) @@ -256,6 +340,14 @@ onMounted(load) margin-top: 4px; } +.plugin-card__actions { + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 6px; + flex: none; +} + .plugin-card__contrib { font-size: var(--app-text-xs); color: var(--td-text-color-secondary); diff --git a/frontend/src/views/settings/Settings.vue b/frontend/src/views/settings/Settings.vue index ff9e5d66..afb52ecf 100644 --- a/frontend/src/views/settings/Settings.vue +++ b/frontend/src/views/settings/Settings.vue @@ -73,6 +73,7 @@ import { type SettingsAccessContext, type SettingsSection, } from '@/extensions/settingsSections' +import { SYSTEM_ADMIN_SETTINGS_SECTIONS } from '@/config/settingsAccess' import { isToolboxSection, toolboxLocation } from '@/config/toolbox' import { buildSettingsRouteQuery, @@ -195,7 +196,7 @@ const handleClose = () => { // 如果当前路由是设置页,返回上一页 if (route.path === '/platform/settings') { const sec = route.query.section - if (sec === 'model-catalog' || sec === 'system-global' || sec === 'runtime-queues' || sec === 'platform-api-keys' || sec === 'system-audit-log') { + if (typeof sec === 'string' && SYSTEM_ADMIN_SETTINGS_SECTIONS.has(sec)) { router.push('/platform/knowledge-bases') } else { router.back() diff --git a/frontend/src/views/settings/SkillSettings.vue b/frontend/src/views/settings/SkillSettings.vue index 719bf4ca..222c9adc 100644 --- a/frontend/src/views/settings/SkillSettings.vue +++ b/frontend/src/views/settings/SkillSettings.vue @@ -188,6 +188,22 @@