pluriply 0.1.0 → 0.3.0
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/README.md +28 -10
- package/bin/pluriply.js +122 -34
- package/package.json +1 -1
- package/src/hub/index.js +10 -7
- package/src/setup/clients.js +400 -32
- package/src/setup/hook-stop.js +157 -0
- package/src/setup/hooks.js +233 -0
- package/src/setup/run-setup.js +309 -41
- package/src/setup/toml-lite.js +87 -0
- package/src/shared/config.js +102 -0
- package/src/shared/identity.js +13 -2
- package/src/shared/lock.js +20 -0
- package/src/shared/mcp-register.js +25 -67
|
@@ -1,79 +1,37 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
|
-
import {
|
|
2
|
+
import { CLIENTS, MCP_REGISTRARS, makeEnv } from "../setup/clients.js";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
* claude-code 는 워커 템플릿이 --mcp-config 로 인라인 등록하므로 여기 없다.
|
|
7
|
-
* @type {Record<string, {label: string, list: string[], add: (node: string, bin: string) => string[], hint: (bin: string) => string}>}
|
|
8
|
-
*/
|
|
9
|
-
export const MCP_REGISTRARS = {
|
|
10
|
-
codex: {
|
|
11
|
-
label: "Codex",
|
|
12
|
-
list: ["codex", "mcp", "list"],
|
|
13
|
-
add: (node, bin) => [
|
|
14
|
-
"codex",
|
|
15
|
-
"mcp",
|
|
16
|
-
"add",
|
|
17
|
-
"pluriply",
|
|
18
|
-
"--",
|
|
19
|
-
node,
|
|
20
|
-
bin,
|
|
21
|
-
"connector",
|
|
22
|
-
"--agent",
|
|
23
|
-
"codex",
|
|
24
|
-
],
|
|
25
|
-
hint: (bin) =>
|
|
26
|
-
`codex mcp add pluriply -- node "${bin}" connector --agent codex`,
|
|
27
|
-
},
|
|
28
|
-
antigravity: {
|
|
29
|
-
label: "Antigravity CLI",
|
|
30
|
-
// agy mcp add 는 user 스코프가 기본이다. `--` 는 필수: 뒤의 명령·인자가 `-` 로 시작할 수
|
|
31
|
-
// 있고(--agent), 플래그는 <name> 앞에만 올 수 있다(agy mcp add --help).
|
|
32
|
-
list: [agyCommand(), "mcp", "list"],
|
|
33
|
-
add: (node, bin) => [
|
|
34
|
-
agyCommand(),
|
|
35
|
-
"mcp",
|
|
36
|
-
"add",
|
|
37
|
-
"pluriply",
|
|
38
|
-
"--",
|
|
39
|
-
node,
|
|
40
|
-
bin,
|
|
41
|
-
"connector",
|
|
42
|
-
"--agent",
|
|
43
|
-
"antigravity",
|
|
44
|
-
],
|
|
45
|
-
hint: (bin) =>
|
|
46
|
-
`agy mcp add pluriply -- node "${bin}" connector --agent antigravity`,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
4
|
+
/** 등록 명령표는 src/setup/clients.js 로 옮겼다. 기존 import 경로를 위해 재수출한다. */
|
|
5
|
+
export { MCP_REGISTRARS };
|
|
49
6
|
|
|
50
7
|
/**
|
|
51
8
|
* `pluriply worker enable <agent>` 가 부른다. 실패해도 던지지 않는다(enable 자체는 성공).
|
|
9
|
+
* 실제 등록(타임아웃 쓰기 포함)은 `pluriply setup` 과 같은 어댑터가 한다. claude-code 는 워커
|
|
10
|
+
* 템플릿이 --mcp-config 로 인라인 등록하므로 여기서는 "none".
|
|
52
11
|
* @param {string} agent
|
|
53
|
-
* @param {{binPath: string, exec?: typeof execFileSync, log?: (msg: string) => void, env?: NodeJS.ProcessEnv}} deps
|
|
12
|
+
* @param {{binPath: string, exec?: typeof execFileSync, log?: (msg: string) => void, env?: NodeJS.ProcessEnv, homeDir?: string}} deps
|
|
54
13
|
* @returns {"registered"|"present"|"skipped"|"failed"|"none"}
|
|
55
14
|
*/
|
|
56
15
|
export function registerMcpServer(
|
|
57
16
|
agent,
|
|
58
|
-
{
|
|
17
|
+
{
|
|
18
|
+
binPath,
|
|
19
|
+
exec = execFileSync,
|
|
20
|
+
log = console.log,
|
|
21
|
+
env = process.env,
|
|
22
|
+
homeDir,
|
|
23
|
+
},
|
|
59
24
|
) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return "registered";
|
|
73
|
-
} catch {
|
|
74
|
-
log(
|
|
75
|
-
`hint: make sure ${r.label} has pluriply registered: ${r.hint(binPath)}`,
|
|
76
|
-
);
|
|
77
|
-
return "failed";
|
|
78
|
-
}
|
|
25
|
+
if (!MCP_REGISTRARS[agent]) return "none";
|
|
26
|
+
const client = CLIENTS.find((c) => c.agent === agent);
|
|
27
|
+
const r = client.register(
|
|
28
|
+
makeEnv({
|
|
29
|
+
binPath,
|
|
30
|
+
exec,
|
|
31
|
+
log,
|
|
32
|
+
processEnv: env,
|
|
33
|
+
...(homeDir ? { homeDir } : {}),
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
return r.startsWith("failed") ? "failed" : r;
|
|
79
37
|
}
|