@acprompt/join 0.1.6 → 0.1.7

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/dist/index.js CHANGED
@@ -15,7 +15,7 @@ const program = new Command();
15
15
  program
16
16
  .name("acprompt-join")
17
17
  .description("Smart installer for ACPrompt — wire any agent harness into the ACPrompt network via MCP.")
18
- .version("0.1.6");
18
+ .version("0.1.7");
19
19
  program
20
20
  .command("install")
21
21
  .description("Interactive: detect harness, mint token, write config, verify.")
@@ -1,7 +1,8 @@
1
1
  import type { HarnessInstaller } from "./shared.js";
2
2
  /**
3
3
  * Build the Claude-Desktop-compatible MCP server entry for ACPrompt. See
4
- * the file-top comment for why this shape (and not `{type:"http",...}`).
4
+ * the file-top comment for why this shape (and not `{type:"http",...}`)
5
+ * and why the Bearer token goes through `env` instead of inline in args.
5
6
  * Exported for unit testing.
6
7
  */
7
8
  export declare function buildClaudeDesktopEntry(opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/install/claude-code.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAW1B;AAmBD,eAAO,MAAM,mBAAmB,EAAE,gBA4CjC,CAAC"}
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/install/claude-code.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAc1B;AAmBD,eAAO,MAAM,mBAAmB,EAAE,gBA4CjC,CAAC"}
@@ -10,30 +10,34 @@
10
10
  // CLI, we print the CLI hint after the file write as a second option.
11
11
  //
12
12
  // ============================================================================
13
- // Claude Desktop config-shape trap (F6, 2026-04-20)
13
+ // Claude Desktop config-shape trap (F6 + F7, 2026-04-20)
14
14
  // ============================================================================
15
- // Claude Desktop (Electron app) does NOT support the native `{type:"http",
15
+ // F6 — Claude Desktop (Electron app) does NOT support the native `{type:"http",
16
16
  // url, headers}` MCP shape that Claude Code CLI accepts. As of Apr 2026 the
17
17
  // Desktop app is stdio-only; remote HTTP MCP servers must go through the
18
18
  // `mcp-remote` shim which the Desktop app spawns as a local child process.
19
19
  //
20
- // v0.1.0–v0.1.5 wrote the Claude Code CLI shape into the Desktop config and
21
- // Desktop silently skipped the entry with a dialog reading: "Some MCP
22
- // servers could not be loaded — The following entries in
23
- // claude_desktop_config.json are not valid MCP server configurations and
24
- // were skipped: acprompt". No MCP tools surfaced inside Claude Desktop.
20
+ // F7 — The obvious fix `--header "Authorization:Bearer <token>"` breaks on
21
+ // Windows. Node's child_process cannot spawn `.cmd` files without
22
+ // shell:true (Node 24 now hard-errors with EINVAL; Node 20–22 fail
23
+ // differently). shell:true routes the command through cmd.exe, which
24
+ // splits on whitespace and does NOT respect quoting inside the argv array
25
+ // — the token gets chopped off, mcp-remote receives just
26
+ // "Authorization:Bearer" as the header value, and every request 401s.
25
27
  //
26
- // Fix (v0.1.6): emit the `command: "npx"` + `args: [mcp-remote, url,
27
- // --header, "Authorization:Bearer <token>"]` shape.
28
+ // Fix (v0.1.7): put the whole `Bearer <token>` string (including its
29
+ // required space) in the `env` block, and reference it from args as
30
+ // `Authorization:${ACP_MCP_AUTH}`. mcp-remote supports `${VAR}` expansion
31
+ // internally on header values (parseCommandLineArgs in
32
+ // mcp-remote/dist/chunk-*.js). Argv elements now contain NO whitespace,
33
+ // so cmd.exe splitting is a non-issue. Empirically verified end-to-end
34
+ // via scripts/probe-mcp-remote.mjs: initialize + tools/list returns all
35
+ // 15 ACPrompt tools through the spawned child process.
28
36
  //
29
- // Windows-safety notes baked into this shape:
37
+ // Other invariants:
30
38
  // - Header separator is `:` with NO space before the value (mcp-remote
31
- // splits on first colon, then trims). A missing space doesn't break
32
- // HTTP parsing on the server side (RFC 7230 says OWS is optional).
33
- // - Token is inlined in `args`, not substituted via `${ENV}` — Claude
34
- // Desktop doesn't document env-var substitution in args, and relying on
35
- // mcp-remote's internal substitution would make the config brittle
36
- // across mcp-remote versions.
39
+ // matches `NAME:\s*VALUE` so either works, but omitting the space
40
+ // keeps the argv element whitespace-free as a secondary defense).
37
41
  // - `-y` on npx auto-accepts the on-disk install prompt so first run
38
42
  // doesn't hang waiting for stdin.
39
43
  import pc from "picocolors";
@@ -42,7 +46,8 @@ import path from "node:path";
42
46
  import { claudeDesktopConfigPath } from "../detect/claude-code.js";
43
47
  /**
44
48
  * Build the Claude-Desktop-compatible MCP server entry for ACPrompt. See
45
- * the file-top comment for why this shape (and not `{type:"http",...}`).
49
+ * the file-top comment for why this shape (and not `{type:"http",...}`)
50
+ * and why the Bearer token goes through `env` instead of inline in args.
46
51
  * Exported for unit testing.
47
52
  */
48
53
  export function buildClaudeDesktopEntry(opts) {
@@ -53,8 +58,11 @@ export function buildClaudeDesktopEntry(opts) {
53
58
  "mcp-remote",
54
59
  opts.mcpUrl,
55
60
  "--header",
56
- `Authorization:Bearer ${opts.token}`,
61
+ "Authorization:${ACP_MCP_AUTH}",
57
62
  ],
63
+ env: {
64
+ ACP_MCP_AUTH: `Bearer ${opts.token}`,
65
+ },
58
66
  };
59
67
  }
60
68
  async function mergeConfig(configPath, entry) {
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/install/claude-code.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,2BAA2B;AAC3B,8DAA8D;AAC9D,oEAAo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AAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CACT,EAAE,CAAC,GAAG,CACJ,6BAA6B,EAAE,CAAC,MAAM,sDAAsD,CAC7F,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acprompt/join",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Smart installer for ACPrompt — one-shot MCP config for any agent harness.",
5
5
  "keywords": [
6
6
  "acprompt",