@acprompt/join 0.1.5 → 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.
|
|
18
|
+
.version("0.1.7");
|
|
19
19
|
program
|
|
20
20
|
.command("install")
|
|
21
21
|
.description("Interactive: detect harness, mint token, write config, verify.")
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { HarnessInstaller } from "./shared.js";
|
|
2
|
+
/**
|
|
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",...}`)
|
|
5
|
+
* and why the Bearer token goes through `env` instead of inline in args.
|
|
6
|
+
* Exported for unit testing.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildClaudeDesktopEntry(opts: {
|
|
9
|
+
mcpUrl: string;
|
|
10
|
+
token: string;
|
|
11
|
+
}): Record<string, unknown>;
|
|
2
12
|
export declare const claudeCodeInstaller: HarnessInstaller;
|
|
3
13
|
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/install/claude-code.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -8,10 +8,63 @@
|
|
|
8
8
|
//
|
|
9
9
|
// We always try (1) if a config path is known. If the user ALSO has the
|
|
10
10
|
// CLI, we print the CLI hint after the file write as a second option.
|
|
11
|
+
//
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Claude Desktop config-shape trap (F6 + F7, 2026-04-20)
|
|
14
|
+
// ============================================================================
|
|
15
|
+
// F6 — Claude Desktop (Electron app) does NOT support the native `{type:"http",
|
|
16
|
+
// url, headers}` MCP shape that Claude Code CLI accepts. As of Apr 2026 the
|
|
17
|
+
// Desktop app is stdio-only; remote HTTP MCP servers must go through the
|
|
18
|
+
// `mcp-remote` shim which the Desktop app spawns as a local child process.
|
|
19
|
+
//
|
|
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.
|
|
27
|
+
//
|
|
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.
|
|
36
|
+
//
|
|
37
|
+
// Other invariants:
|
|
38
|
+
// - Header separator is `:` with NO space before the value (mcp-remote
|
|
39
|
+
// matches `NAME:\s*VALUE` so either works, but omitting the space
|
|
40
|
+
// keeps the argv element whitespace-free as a secondary defense).
|
|
41
|
+
// - `-y` on npx auto-accepts the on-disk install prompt so first run
|
|
42
|
+
// doesn't hang waiting for stdin.
|
|
11
43
|
import pc from "picocolors";
|
|
12
44
|
import { promises as fs } from "node:fs";
|
|
13
45
|
import path from "node:path";
|
|
14
46
|
import { claudeDesktopConfigPath } from "../detect/claude-code.js";
|
|
47
|
+
/**
|
|
48
|
+
* Build the Claude-Desktop-compatible MCP server entry for ACPrompt. See
|
|
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.
|
|
51
|
+
* Exported for unit testing.
|
|
52
|
+
*/
|
|
53
|
+
export function buildClaudeDesktopEntry(opts) {
|
|
54
|
+
return {
|
|
55
|
+
command: "npx",
|
|
56
|
+
args: [
|
|
57
|
+
"-y",
|
|
58
|
+
"mcp-remote",
|
|
59
|
+
opts.mcpUrl,
|
|
60
|
+
"--header",
|
|
61
|
+
"Authorization:${ACP_MCP_AUTH}",
|
|
62
|
+
],
|
|
63
|
+
env: {
|
|
64
|
+
ACP_MCP_AUTH: `Bearer ${opts.token}`,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
15
68
|
async function mergeConfig(configPath, entry) {
|
|
16
69
|
let current = {};
|
|
17
70
|
try {
|
|
@@ -36,16 +89,14 @@ export const claudeCodeInstaller = async (ic) => {
|
|
|
36
89
|
platform: ic.platform,
|
|
37
90
|
env: process.env,
|
|
38
91
|
});
|
|
39
|
-
const entry = {
|
|
40
|
-
type: "http",
|
|
41
|
-
url: ic.mcpUrl,
|
|
42
|
-
headers: { Authorization: `Bearer ${ic.token}` },
|
|
43
|
-
};
|
|
92
|
+
const entry = buildClaudeDesktopEntry({ mcpUrl: ic.mcpUrl, token: ic.token });
|
|
44
93
|
if (!ic.dryRun) {
|
|
45
94
|
await mergeConfig(configPath, entry);
|
|
46
95
|
}
|
|
47
96
|
wrote.push(configPath);
|
|
48
97
|
console.log(pc.green(`Wrote ACPrompt MCP server entry to ${configPath}.`));
|
|
98
|
+
console.log(pc.dim(" Shape: mcp-remote stdio shim (Claude Desktop does not accept native HTTP MCP yet)."));
|
|
99
|
+
console.log(pc.dim(" Restart Claude Desktop to load the new server."));
|
|
49
100
|
const cliHit = (ic.detection.evidence ?? []).some((e) => e.includes("Claude Code CLI"));
|
|
50
101
|
if (cliHit) {
|
|
51
102
|
console.log("");
|
|
@@ -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,oEAAoE;AACpE,uEAAuE;AACvE,yEAAyE;AACzE,EAAE;AACF,wEAAwE;AACxE,sEAAsE;
|
|
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,oEAAoE;AACpE,uEAAuE;AACvE,yEAAyE;AACzE,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,yDAAyD;AACzD,+EAA+E;AAC/E,gFAAgF;AAChF,4EAA4E;AAC5E,yEAAyE;AACzE,2EAA2E;AAC3E,EAAE;AACF,2EAA2E;AAC3E,kEAAkE;AAClE,mEAAmE;AACnE,qEAAqE;AACrE,0EAA0E;AAC1E,yDAAyD;AACzD,sEAAsE;AACtE,EAAE;AACF,qEAAqE;AACrE,oEAAoE;AACpE,0EAA0E;AAC1E,uDAAuD;AACvD,wEAAwE;AACxE,uEAAuE;AACvE,wEAAwE;AACxE,uDAAuD;AACvD,EAAE;AACF,oBAAoB;AACpB,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