dsh-agent-plugins-market 0.6.0 → 0.6.1
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/client/client.js +20 -3
- package/client/client.js.map +1 -1
- package/lib/runtime/lsp-mounts.js +6 -6
- package/lib/runtime/mcp-config.js +10 -6
- package/lib/runtime/mcp-mounts.js +13 -5
- package/lib/runtime/mcp-status.js +3 -4
- package/lib/types/contracts/mcp-status.d.ts +1 -1
- package/lib/types/runtime/mcp-config.d.ts +11 -5
- package/lib/types/runtime/mcp-status.d.ts +1 -1
- package/package.json +2 -2
package/client/client.js
CHANGED
|
@@ -314,6 +314,7 @@ const zh = {
|
|
|
314
314
|
mcpCardReadonly: "当前环境设置文档只读,无法切换。",
|
|
315
315
|
mcpForeign: "已由其他客户端挂载",
|
|
316
316
|
mcpForeignHint: "该服务器已通过其他途径(原生配置或另一插件)挂载了同名 MCP,市场已跳过以避免重复挂载。如需由市场接管,请先停用另一来源的该服务器;若确认是残留挂载,重启宿主即可清除。",
|
|
317
|
+
mcpDuplicateHint: "另一来源已挂载了相同的服务器,本副本未注册——同一服务器挂载两份对模型没有额外意义。卸载另一来源的套件后,本副本会在下次刷新时自动接管。",
|
|
317
318
|
regionLabel: "下载区域",
|
|
318
319
|
regionHint: "中国大陆走镜像线路,仅影响下载线路。",
|
|
319
320
|
regionGlobal: "全球",
|
|
@@ -550,6 +551,7 @@ const en = {
|
|
|
550
551
|
mcpCardReadonly: "The settings document is read-only in this environment; the switch is unavailable.",
|
|
551
552
|
mcpForeign: "Mounted elsewhere",
|
|
552
553
|
mcpForeignHint: "This server is already mounted through another path (native config or another plugin); the market skipped it to avoid a duplicate. To let the market take over, disable the other source first. If it is a leftover mount, a Host restart clears it.",
|
|
554
|
+
mcpDuplicateHint: "Another source already mounted this server, so this copy was not registered — mounting the same server twice adds nothing for the model. Uninstall the other source's suite and this copy takes over on the next refresh.",
|
|
553
555
|
regionLabel: "Download region",
|
|
554
556
|
regionHint: "China mainland routes through a mirror. Affects the download route only.",
|
|
555
557
|
regionGlobal: "Global",
|
|
@@ -1157,6 +1159,20 @@ async function unsetCredential(api, ref) {
|
|
|
1157
1159
|
const response = await api.unset({ ref });
|
|
1158
1160
|
if (response.result?.ok !== true) throw new Error(response.result?.error?.message ?? "credential removal failed");
|
|
1159
1161
|
}
|
|
1162
|
+
/** Adapt the current Host service to the credential editor's wire contract. */
|
|
1163
|
+
function credentialApi(remote) {
|
|
1164
|
+
return {
|
|
1165
|
+
describe: async ({ refs }) => {
|
|
1166
|
+
const result = await remote.describe(refs);
|
|
1167
|
+
return { result: result.ok ? {
|
|
1168
|
+
ok: true,
|
|
1169
|
+
value: { credentials: result.value }
|
|
1170
|
+
} : result };
|
|
1171
|
+
},
|
|
1172
|
+
set: async ({ ref, value }) => ({ result: await remote.set(ref, value) }),
|
|
1173
|
+
unset: async ({ ref }) => ({ result: await remote.unset(ref) })
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1160
1176
|
//#endregion
|
|
1161
1177
|
//#region src/client/mcp-credential.module.css
|
|
1162
1178
|
var mcp_credential_module_default = {
|
|
@@ -2493,7 +2509,7 @@ function McpDetailModal({ entry, t, credentials, onClose, onRetry, onReauthorize
|
|
|
2493
2509
|
children: (0, react.createElement)("div", { className: mcp_status_module_default.detail }, (0, react.createElement)("div", { className: mcp_status_module_default.detailHero }, (0, react.createElement)("span", {
|
|
2494
2510
|
className: `${mcp_status_module_default.statusDot} ${mcp_status_module_default[`status${entry.state}`]}`,
|
|
2495
2511
|
"aria-hidden": true
|
|
2496
|
-
}), (0, react.createElement)("div", { className: mcp_status_module_default.detailHeroText }, entry.endpoint === void 0 ? null : (0, react.createElement)("p", { className: mcp_status_module_default.detailEndpoint }, entry.endpoint), (0, react.createElement)("p", { className: mcp_status_module_default.detailEndpoint }, [entry.kind === "plugin" ? `${t("mcpPlugin")}: ${entry.source ?? "—"}` : t("mcpDirect"), entry.transport].join(" · ")))), entry.state === "foreign" ? (0, react.createElement)("div", { className: mcp_status_module_default.reasonBox }, (0, react.createElement)("span", { className: mcp_status_module_default.reasonLabel }, t("mcpReasonLabel")), (0, react.createElement)("p", { className: mcp_status_module_default.reasonText }, t("mcpForeignHint")), entry.reason === void 0 ? null : (0, react.createElement)("p", { className: mcp_status_module_default.reasonRaw }, entry.reason)) : entry.reason === void 0 ? null : (0, react.createElement)("div", { className: mcp_status_module_default.reasonBox }, (0, react.createElement)("span", { className: mcp_status_module_default.reasonLabel }, t("mcpReasonLabel")), (0, react.createElement)("p", { className: mcp_status_module_default.reasonText }, entry.reason)), entry.kind === "direct" ? (0, react.createElement)("div", { className: mcp_status_module_default.reasonBox }, (0, react.createElement)("p", { className: mcp_status_module_default.reasonText }, t("mcpDirectBoundary"))) : null, entry.credentialRefs?.length === 0 || entry.credentialRefs === void 0 ? null : (0, react.createElement)(McpCredentialEditor, {
|
|
2512
|
+
}), (0, react.createElement)("div", { className: mcp_status_module_default.detailHeroText }, entry.endpoint === void 0 ? null : (0, react.createElement)("p", { className: mcp_status_module_default.detailEndpoint }, entry.endpoint), (0, react.createElement)("p", { className: mcp_status_module_default.detailEndpoint }, [entry.kind === "plugin" ? `${t("mcpPlugin")}: ${entry.source ?? "—"}` : t("mcpDirect"), entry.transport].join(" · ")))), entry.state === "foreign" ? (0, react.createElement)("div", { className: mcp_status_module_default.reasonBox }, (0, react.createElement)("span", { className: mcp_status_module_default.reasonLabel }, t("mcpReasonLabel")), (0, react.createElement)("p", { className: mcp_status_module_default.reasonText }, entry.code === "duplicate-mount" ? t("mcpDuplicateHint") : t("mcpForeignHint")), entry.reason === void 0 ? null : (0, react.createElement)("p", { className: mcp_status_module_default.reasonRaw }, entry.reason)) : entry.reason === void 0 ? null : (0, react.createElement)("div", { className: mcp_status_module_default.reasonBox }, (0, react.createElement)("span", { className: mcp_status_module_default.reasonLabel }, t("mcpReasonLabel")), (0, react.createElement)("p", { className: mcp_status_module_default.reasonText }, entry.reason)), entry.kind === "direct" ? (0, react.createElement)("div", { className: mcp_status_module_default.reasonBox }, (0, react.createElement)("p", { className: mcp_status_module_default.reasonText }, t("mcpDirectBoundary"))) : null, entry.credentialRefs?.length === 0 || entry.credentialRefs === void 0 ? null : (0, react.createElement)(McpCredentialEditor, {
|
|
2497
2513
|
t,
|
|
2498
2514
|
api: credentials,
|
|
2499
2515
|
refs: entry.credentialRefs
|
|
@@ -3170,7 +3186,8 @@ const name = "dsh-agent-plugins-market";
|
|
|
3170
3186
|
const inject = [
|
|
3171
3187
|
"slots",
|
|
3172
3188
|
"locale",
|
|
3173
|
-
"
|
|
3189
|
+
"remote",
|
|
3190
|
+
"remote.credentials"
|
|
3174
3191
|
];
|
|
3175
3192
|
const REQUIRED_PRIMITIVES = [
|
|
3176
3193
|
"Button",
|
|
@@ -3195,7 +3212,7 @@ function apply(ctx) {
|
|
|
3195
3212
|
en
|
|
3196
3213
|
}), "dsh-agent-plugins: dictionaries");
|
|
3197
3214
|
const t = ctx.locale.bind(NS);
|
|
3198
|
-
const credentials = ctx.
|
|
3215
|
+
const credentials = credentialApi(ctx.remote.credentials);
|
|
3199
3216
|
const gaps = missingPrimitives(_deepseek_ai_dsh_client_ui_primitives);
|
|
3200
3217
|
if (gaps.length > 0) {
|
|
3201
3218
|
console.warn(`[dsh-agent-plugins-market] host ui-primitives missing ${gaps.join(", ")} — Agent Plugins Market section disabled (dsh web >= 0.1.0-rc.6 required)`);
|