OXYGENHUB

0.1.2: one Spectra entry per client for every folder (spectra mcp --auto) 06699bcc6e2e

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Andy McCall @andymccall <[email protected]>
via
agent agent:claude@andymccall <[email protected]> · keyless, under your grant for changes,refs,seal · key f78687b34bd0
When
· 2026-11-03 18:21 UTC
Signature
◈ sealed by agent:claude@andymccall
Hash
06699bcc6e2e3e21d06ff51271df722223afe0f6d7c396eac6bee0f6fd81686a
Depends on
17556ca229a9 ff39a5e808da
Depended on by
9a80f3825237
In bookmarks
main
Receipts
✔ check passed in 7.3 s · signed by plex-1 job 14830 · download
✔ package passed in 3.6 s · signed by plex-1 job 14831 · download
Edits
9 atoms, 0 tree operations, 3 files

Browse the tree at this change

modified CHANGELOG.md +3 −0
…
1 unchanged lines
2 2
3 3
## Unreleased
4 4
5 +
## 0.1.2
6 +
7 +
- **Changed: one Spectra entry per client for every folder.** Connecting Claude Code (or Antigravity) adds `spectra mcp --auto` once, for your user, and it speaks for the agent of whichever folder a session starts in; adding an agent for another folder needs no client setup at all. Kimi Code is still connected per folder.
5 8
## 0.1.1
6 9
7 10
- **Fixed: Add Agent did not connect Claude Code or Kimi Code** when VS Code's PATH lacks `~/.local/bin` (VS Code from a snap): the extension now looks there itself, and says plainly, with the command to copy, when it cannot connect a client.
…
7 unchanged lines
modified package.json +1 −1
…
1 unchanged lines
2 2
  "name": "spectra-vscode",
3 3
  "displayName": "Spectra",
4 4
  "description": "Spectra in the editor: set up your AI agents, chat with them, and give them their briefs, without the command line",
5 -
  "version": "0.1.1",
5 +
  "version": "0.1.2",
6 6
  "publisher": "andymccall",
7 7
  "license": "MIT OR Apache-2.0",
8 8
  "repository": {
…
291 unchanged lines
modified src/setup.ts +23 −8
…
273 unchanged lines
274 274
    return;
275 275
  }
276 276
  const cwd = folder()?.uri.fsPath;
277 +
  // One entry per client for every folder (spectra mcp --auto): the shim
278 +
  // speaks for the agent of whichever folder a session starts in.
279 +
  const auto = ["mcp", "--auto", "--kind", kind];
277 280
  try {
278 -
    if (kind === "claude-code" || kind === "kimi-code") {
279 -
      const name = kind === "claude-code" ? "claude" : "kimi";
280 -
      const tool = cli.program(name);
281 -
      if (!tool) throw new Error(`${name} was not found on PATH or in ~/.local/bin`);
281 +
    if (kind === "claude-code") {
282 +
      const tool = cli.program("claude");
283 +
      if (!tool) throw new Error("claude was not found on PATH or in ~/.local/bin");
284 +
      const list = await new Promise<string>((resolve) => cp.execFile(tool, ["mcp", "get", "spectra"], { cwd }, (_e, out) => resolve(String(out))));
285 +
      if (!list.includes("--auto")) {
286 +
        await new Promise<void>((resolve) => cp.execFile(tool, ["mcp", "remove", "--scope", "user", "spectra"], () => resolve()));
287 +
        await new Promise<void>((resolve, reject) =>
288 +
          cp.execFile(tool, ["mcp", "add", "--scope", "user", "spectra", "--", bin, ...auto], (err, _o, stderr) => (err ? reject(new Error(stderr.trim() || err.message)) : resolve())),
289 +
        );
290 +
      }
291 +
      // A per-folder entry would override the shared one: remove it.
292 +
      await new Promise<void>((resolve) => cp.execFile(tool, ["mcp", "remove", "--scope", "local", "spectra"], { cwd }, () => resolve()));
293 +
      void vscode.window.showInformationMessage(`Claude Code connects to Spectra as ${agent} in this folder. Start a new Claude Code session here to pick it up: one already open does not get it.`);
294 +
    } else if (kind === "kimi-code") {
295 +
      const tool = cli.program("kimi");
296 +
      if (!tool) throw new Error("kimi was not found on PATH or in ~/.local/bin");
282 297
      await new Promise<void>((resolve) => cp.execFile(tool, ["mcp", "remove", "spectra"], { cwd }, () => resolve()));
283 298
      await new Promise<void>((resolve, reject) =>
284 -
        cp.execFile(tool, ["mcp", "add", "spectra", "--", bin, ...args], { cwd }, (err, _o, stderr) => (err ? reject(new Error(stderr.trim() || err.message)) : resolve())),
299 +
        cp.execFile(tool, ["mcp", "add", "spectra", "--", bin, ...auto], { cwd }, (err, _o, stderr) => (err ? reject(new Error(stderr.trim() || err.message)) : resolve())),
285 300
      );
286 -
      void vscode.window.showInformationMessage(`${which} in this folder now connects to Spectra as ${agent}. Start a new ${which} session here to pick it up: one already open does not get it.`);
301 +
      void vscode.window.showInformationMessage(`Kimi Code connects to Spectra as ${agent} in this folder: start a new session here to pick it up.`);
287 302
    } else if (kind === "antigravity") {
288 303
      const file = path.join(os.homedir(), ".gemini", "config", "mcp_config.json");
289 304
      const before = fs.existsSync(file) ? fs.readFileSync(file, "utf8") : "";
290 305
      if (before) fs.copyFileSync(file, file + ".bak");
291 306
      fs.mkdirSync(path.dirname(file), { recursive: true });
292 -
      fs.writeFileSync(file, mergeMcpConfig(before, bin, args));
293 -
      void vscode.window.showInformationMessage(`Antigravity now connects to Spectra as ${agent} (${file}${before ? ", previous copy kept as .bak" : ""}): restart it to pick it up.`);
307 +
      fs.writeFileSync(file, mergeMcpConfig(before, bin, auto));
308 +
      void vscode.window.showInformationMessage(`Antigravity connects to Spectra as ${agent} in this folder (${file}${before ? ", previous copy kept as .bak" : ""}): restart it to pick it up.`);
294 309
    } else {
295 310
      await vscode.env.clipboard.writeText(line);
296 311
      void vscode.window.showInformationMessage(`Copied the command for ${which}'s MCP settings: ${line}`);
…
19 unchanged lines