@super-hands/connect 0.1.4 → 0.1.5
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/client.mjs +17 -5
- package/package.json +1 -1
package/client.mjs
CHANGED
|
@@ -32,7 +32,7 @@ function codexConfigBlock(args) {
|
|
|
32
32
|
return [
|
|
33
33
|
`[mcp_servers.${MCP_SERVER_KEY}]`,
|
|
34
34
|
`url = "${args.endpoint}"`,
|
|
35
|
-
`
|
|
35
|
+
`http_headers = { "Authorization" = "${mcpAuthorizationHeader(args.token)}" }`
|
|
36
36
|
].join("\n");
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -120,12 +120,22 @@ function mergedCursorConfig(existing, args) {
|
|
|
120
120
|
`, replaced };
|
|
121
121
|
}
|
|
122
122
|
function appendedCodexConfig(existing, args) {
|
|
123
|
+
const staleOwnBlock = new RegExp(
|
|
124
|
+
`\\[mcp_servers\\.${MCP_SERVER_KEY}\\]\\nurl = "[^"\\n]*"\\nbearer_token = "[^"\\n]*"`
|
|
125
|
+
);
|
|
126
|
+
if (staleOwnBlock.test(existing)) {
|
|
127
|
+
return {
|
|
128
|
+
text: existing.replace(staleOwnBlock, codexConfigBlock(args)),
|
|
129
|
+
alreadyPresent: false,
|
|
130
|
+
repaired: true
|
|
131
|
+
};
|
|
132
|
+
}
|
|
123
133
|
if (existing.includes(`[mcp_servers.${MCP_SERVER_KEY}]`)) {
|
|
124
|
-
return { text: existing, alreadyPresent: true };
|
|
134
|
+
return { text: existing, alreadyPresent: true, repaired: false };
|
|
125
135
|
}
|
|
126
136
|
const sep = existing === "" || existing.endsWith("\n\n") ? "" : existing.endsWith("\n") ? "\n" : "\n\n";
|
|
127
137
|
return { text: `${existing}${sep}${codexConfigBlock(args)}
|
|
128
|
-
`, alreadyPresent: false };
|
|
138
|
+
`, alreadyPresent: false, repaired: false };
|
|
129
139
|
}
|
|
130
140
|
function writeSkill(clientDir) {
|
|
131
141
|
const skillPath = join(clientDir, "skills", CONNECT_SKILL_DIR, CONNECT_SKILL_FILENAME);
|
|
@@ -255,13 +265,15 @@ async function main() {
|
|
|
255
265
|
const result = appendedCodexConfig(existing, { endpoint, token });
|
|
256
266
|
if (result.alreadyPresent) {
|
|
257
267
|
say(`Codex \u2014 ${configPath} already names a ${MCP_SERVER_KEY} server, so it was left as it is.`);
|
|
258
|
-
say(" If that connection is stale, update
|
|
268
|
+
say(" If that connection is stale, update the http_headers Authorization value there by hand.");
|
|
259
269
|
writeSkill(codexDir);
|
|
260
270
|
connected += 1;
|
|
261
271
|
} else {
|
|
262
272
|
mkdirSync(dirname(configPath), { recursive: true });
|
|
263
273
|
writeFileSync(configPath, result.text);
|
|
264
|
-
say(
|
|
274
|
+
say(
|
|
275
|
+
result.repaired ? `Codex \u2014 replaced the ${MCP_SERVER_KEY} entry in ${configPath}: its old bearer_token spelling makes current Codex reject the whole config.` : `Codex \u2014 added the ${MCP_SERVER_KEY} server to ${configPath}.`
|
|
276
|
+
);
|
|
265
277
|
say(" The app and the CLI both read this config \u2014 open either and it connects when a session starts.");
|
|
266
278
|
writeSkill(codexDir);
|
|
267
279
|
connected += 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@super-hands/connect",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Connect the coding agents on this machine to your team's Superhands MCP server. Writes each client's own config; reads no repository, uploads nothing.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superhands-connect": "client.mjs"
|