@starlens-app/cli 0.1.5 → 0.1.6
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/package.json +1 -1
- package/src/index.mjs +6 -3
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -1067,8 +1067,9 @@ async function writeMcpConfig(client, { apiBaseUrl, token, projectRoot, hosted }
|
|
|
1067
1067
|
|
|
1068
1068
|
if (client === "opencode") {
|
|
1069
1069
|
const opencodePath = join(home, ".config", "opencode", "opencode.json");
|
|
1070
|
+
// opencode schema: type must be "remote" for HTTP MCP (not "http")
|
|
1070
1071
|
const starlensEntry = hosted
|
|
1071
|
-
? { type: "
|
|
1072
|
+
? { type: "remote", url: `${apiBaseUrl}/mcp`, headers: { Authorization: `Bearer ${token || "stl_xxx"}` }, enabled: true }
|
|
1072
1073
|
: { type: "local", command: ["zsh", "-lc", `source "$HOME/.starlens/agent.env" && cd "${projectRoot}" && corepack pnpm mcp:start`], enabled: true, timeout: 10000 };
|
|
1073
1074
|
await mergeJson(opencodePath, (obj) => ({
|
|
1074
1075
|
...obj,
|
|
@@ -1079,9 +1080,11 @@ async function writeMcpConfig(client, { apiBaseUrl, token, projectRoot, hosted }
|
|
|
1079
1080
|
|
|
1080
1081
|
if (client === "codex") {
|
|
1081
1082
|
const codexPath = join(home, ".codex", "config.toml");
|
|
1083
|
+
// Codex TOML: transport inferred from keys (url = HTTP, command = stdio); no "type" field
|
|
1084
|
+
// HTTP auth uses http_headers inline table, not a [headers] sub-table
|
|
1082
1085
|
const content = hosted
|
|
1083
|
-
? `[mcp_servers.starlens]\
|
|
1084
|
-
: `[mcp_servers.starlens]\
|
|
1086
|
+
? `[mcp_servers.starlens]\nurl = "${apiBaseUrl}/mcp"\nhttp_headers = { Authorization = "Bearer ${token || "stl_xxx"}" }\nenabled = true\nstartup_timeout_sec = 30\ndefault_tools_approval_mode = "approve"`
|
|
1087
|
+
: `[mcp_servers.starlens]\ncommand = "zsh"\nargs = ["-lc", "source \\"$HOME/.starlens/agent.env\\" && cd \\"${projectRoot}\\" && corepack pnpm mcp:start"]\nenabled = true\nstartup_timeout_sec = 30\ndefault_tools_approval_mode = "approve"`;
|
|
1085
1088
|
const result = await appendTomlSection(codexPath, "mcp_servers.starlens", content);
|
|
1086
1089
|
return result.ok ? { ok: true, path: codexPath } : { ok: false, reason: result.reason };
|
|
1087
1090
|
}
|