code-ai-installer 4.0.1-a → 4.0.1-b

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.
@@ -22,10 +22,12 @@ const CodeAiConfigSchema = z.object({
22
22
  * file at all) behaves exactly as before this field existed.
23
23
  */
24
24
  domain: DomainId.default("development"),
25
- /** Override the binary name for the MemPalace MCP server. */
26
- mempalace_command: z.string().min(1).default("mempalace"),
27
- /** Optional extra args appended after the `mcp` subcommand. */
28
- mempalace_args: z.array(z.string()).default(["mcp"]),
25
+ /** Override the binary for the MemPalace MCP server (dedicated stdio bin). */
26
+ mempalace_command: z.string().min(1).default("mempalace-mcp"),
27
+ /** Args for the MemPalace MCP server. The dedicated `mempalace-mcp` bin needs
28
+ * none; the old `mempalace mcp` subcommand pollutes stdout and breaks the
29
+ * stdio MCP handshake, so it is no longer the default. */
30
+ mempalace_args: z.array(z.string()).default([]),
29
31
  /** Auditor self-improvement controls (ADR-DEV-124). */
30
32
  auditor: z
31
33
  .object({
@@ -41,8 +43,8 @@ const CodeAiConfigSchema = z.object({
41
43
  /** Empty config defaults — returned when the file is missing or unreadable. */
42
44
  const DEFAULT_CONFIG = {
43
45
  decision_store: "jsonl",
44
- mempalace_command: "mempalace",
45
- mempalace_args: ["mcp"],
46
+ mempalace_command: "mempalace-mcp",
47
+ mempalace_args: [],
46
48
  auditor: { approval_gate: true },
47
49
  domain: "development",
48
50
  };
@@ -5,7 +5,7 @@ import type { DomainId } from "./shared/index.js";
5
5
  * Two responsibilities (ADR-DEV-099):
6
6
  * 1. Detect / install MemPalace as an opt-in mirror for decision storage.
7
7
  * 2. Write project-level `.mcp.json` registering `code-ai-mcp` (always) and
8
- * `mempalace` (when accepted) so Claude Code picks them up automatically.
8
+ * `mempalace-mcp` (when accepted) so Claude Code picks them up automatically.
9
9
  * 3. Write `.code-ai/config.json` so `code-ai-mcp` knows which backend to use.
10
10
  *
11
11
  * Non-Claude targets skip this whole flow — MCP is Claude-specific.
@@ -53,8 +53,11 @@ export interface McpSetupReport {
53
53
  notices: string[];
54
54
  }
55
55
  /**
56
- * Try `mempalace --help`. Resolves true on exit code 0, false otherwise
57
- * (including ENOENT binary not on PATH).
56
+ * Try `mempalace-mcp --help` the dedicated MCP-server bin, which is exactly
57
+ * what we register in `.mcp.json`. Resolves true on exit code 0, false otherwise
58
+ * (including ENOENT — bin not on PATH). Probing the actual server bin (not the
59
+ * `mempalace` CLI) means a stale MemPalace without `mempalace-mcp` triggers a
60
+ * (re)install instead of writing a config that can't launch.
58
61
  */
59
62
  export declare function detectMemPalace(): Promise<boolean>;
60
63
  /**
package/dist/mcp_setup.js CHANGED
@@ -2,11 +2,14 @@ import { spawn } from "node:child_process";
2
2
  import { mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  /**
5
- * Try `mempalace --help`. Resolves true on exit code 0, false otherwise
6
- * (including ENOENT binary not on PATH).
5
+ * Try `mempalace-mcp --help` the dedicated MCP-server bin, which is exactly
6
+ * what we register in `.mcp.json`. Resolves true on exit code 0, false otherwise
7
+ * (including ENOENT — bin not on PATH). Probing the actual server bin (not the
8
+ * `mempalace` CLI) means a stale MemPalace without `mempalace-mcp` triggers a
9
+ * (re)install instead of writing a config that can't launch.
7
10
  */
8
11
  export async function detectMemPalace() {
9
- return spawnExitZero("mempalace", ["--help"]);
12
+ return spawnExitZero("mempalace-mcp", ["--help"]);
10
13
  }
11
14
  /**
12
15
  * Find the first available Python install runtime, in preference order:
@@ -151,9 +154,12 @@ export async function setupMcp(opts) {
151
154
  },
152
155
  };
153
156
  if (mempalaceUsed) {
157
+ // Use the dedicated `mempalace-mcp` stdio server bin (NOT `mempalace mcp`):
158
+ // the full CLI subcommand can emit to stdout before the MCP handshake and
159
+ // corrupt the JSON-RPC stream, so Claude Code fails to launch it.
154
160
  servers["mempalace"] = {
155
- command: "mempalace",
156
- args: ["mcp"],
161
+ command: "mempalace-mcp",
162
+ args: [],
157
163
  };
158
164
  }
159
165
  const mcp = await mergeMcpJson(opts.destinationDir, servers, opts.dryRun);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-ai-installer",
3
- "version": "4.0.1-a",
3
+ "version": "4.0.1-b",
4
4
  "description": "Production-ready CLI to install code-ai agents and skills for multiple AI coding assistants. Bundles the code-ai-mcp MCP server for Claude Code.",
5
5
  "license": "MIT",
6
6
  "author": "Denis Harchenko",