From a595081c4cd62b4a9220c2dcc5ae6df6eda66977 Mon Sep 17 00:00:00 2001 From: voson Date: Sat, 21 Mar 2026 09:23:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20OpenCode=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E5=B1=82=20mcp=20=E5=8C=85=E8=A3=B9=EF=BC=9Bbump=20se?= =?UTF-8?q?crets-mcp=200.1.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- Cargo.lock | 2 +- crates/secrets-mcp/Cargo.toml | 2 +- crates/secrets-mcp/templates/dashboard.html | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e83e90d..61f1cb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1949,7 +1949,7 @@ dependencies = [ [[package]] name = "secrets-mcp" -version = "0.1.4" +version = "0.1.5" dependencies = [ "anyhow", "askama", diff --git a/crates/secrets-mcp/Cargo.toml b/crates/secrets-mcp/Cargo.toml index e903ec5..c776749 100644 --- a/crates/secrets-mcp/Cargo.toml +++ b/crates/secrets-mcp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "secrets-mcp" -version = "0.1.4" +version = "0.1.5" edition.workspace = true [[bin]] diff --git a/crates/secrets-mcp/templates/dashboard.html b/crates/secrets-mcp/templates/dashboard.html index 04be739..c6e50d6 100644 --- a/crates/secrets-mcp/templates/dashboard.html +++ b/crates/secrets-mcp/templates/dashboard.html @@ -535,12 +535,14 @@ function buildOpencodeEntry(apiKey, encKey) { }; } +/** Full OpenCode config: MCP servers live under top-level `mcp`. */ function buildOpencodeConfigText(apiKey, encKey) { - return JSON.stringify({ secrets: buildOpencodeEntry(apiKey, encKey) }, null, 2); + return JSON.stringify({ mcp: { secrets: buildOpencodeEntry(apiKey, encKey) } }, null, 2); } +/** Strip outer `{` `}` so user can paste `secrets` under an existing `mcp` object. */ function buildOpencodeMergeSnippet(apiKey, encKey) { - const wrapped = buildOpencodeConfigText(apiKey, encKey); + const wrapped = JSON.stringify({ secrets: buildOpencodeEntry(apiKey, encKey) }, null, 2); const lines = wrapped.split('\n'); return lines.length < 3 ? wrapped : lines.slice(1, -1).join('\n'); }