pairai 0.1.1 → 0.1.2
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/pairai-channel.ts +18 -34
package/package.json
CHANGED
package/pairai-channel.ts
CHANGED
|
@@ -67,39 +67,23 @@ if (command === "setup") {
|
|
|
67
67
|
writeFileSync(keyPath, privateKey, { mode: 0o600 });
|
|
68
68
|
console.log(` Private key: ${keyPath}\n`);
|
|
69
69
|
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
JSON.stringify(
|
|
88
|
-
{
|
|
89
|
-
mcpServers: {
|
|
90
|
-
"pairai-channel": {
|
|
91
|
-
command: "npx",
|
|
92
|
-
args: ["pairai", "serve"],
|
|
93
|
-
env: { PAIRAI_API_KEY: apiKey, PAIRAI_URL: hubUrl, PAIRAI_PRIVATE_KEY_PATH: keyPath },
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
null,
|
|
98
|
-
2
|
|
99
|
-
)
|
|
100
|
-
);
|
|
101
|
-
console.log(`\n Then: claude --dangerously-load-development-channels server:pairai-channel\n`);
|
|
102
|
-
}
|
|
70
|
+
// Write .mcp.json directly (claude mcp add --env puts env vars in args, which breaks)
|
|
71
|
+
const mcpConfig = {
|
|
72
|
+
mcpServers: {
|
|
73
|
+
"pairai-channel": {
|
|
74
|
+
command: "npx",
|
|
75
|
+
args: ["pairai", "serve"],
|
|
76
|
+
env: { PAIRAI_API_KEY: apiKey, PAIRAI_URL: hubUrl, PAIRAI_PRIVATE_KEY_PATH: keyPath },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const cwd = process.cwd();
|
|
82
|
+
const mcpJsonPath = join(cwd, ".mcp.json");
|
|
83
|
+
writeFileSync(mcpJsonPath, JSON.stringify(mcpConfig, null, 2) + "\n");
|
|
84
|
+
console.log(` MCP config: ${mcpJsonPath}\n`);
|
|
85
|
+
console.log(` Done! Start Claude Code with:\n`);
|
|
86
|
+
console.log(` claude --dangerously-load-development-channels server:pairai-channel\n`);
|
|
103
87
|
|
|
104
88
|
process.exit(0);
|
|
105
89
|
}
|
|
@@ -144,7 +128,7 @@ async function hubGet(path: string) {
|
|
|
144
128
|
async function hubPost(path: string, body?: unknown) {
|
|
145
129
|
const res = await fetch(`${HUB_URL}${path}`, {
|
|
146
130
|
method: "POST",
|
|
147
|
-
headers,
|
|
131
|
+
headers: body ? headers : { Authorization: headers.Authorization },
|
|
148
132
|
body: body ? JSON.stringify(body) : undefined,
|
|
149
133
|
});
|
|
150
134
|
if (!res.ok) throw new Error(`POST ${path}: ${res.status}`);
|