@cg3/equip 0.2.22 → 0.4.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/LICENSE +1 -1
- package/README.md +26 -10
- package/bin/equip.js +159 -68
- package/demo/README.md +1 -1
- package/dist/index.d.ts +74 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +175 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cli.d.ts +22 -0
- package/dist/lib/cli.d.ts.map +1 -0
- package/dist/lib/cli.js +148 -0
- package/dist/lib/cli.js.map +1 -0
- package/dist/lib/commands/doctor.d.ts +2 -0
- package/dist/lib/commands/doctor.d.ts.map +1 -0
- package/dist/lib/commands/doctor.js +162 -0
- package/dist/lib/commands/doctor.js.map +1 -0
- package/dist/lib/commands/status.d.ts +2 -0
- package/dist/lib/commands/status.d.ts.map +1 -0
- package/dist/lib/commands/status.js +134 -0
- package/dist/lib/commands/status.js.map +1 -0
- package/dist/lib/commands/update.d.ts +2 -0
- package/dist/lib/commands/update.d.ts.map +1 -0
- package/dist/lib/commands/update.js +93 -0
- package/dist/lib/commands/update.js.map +1 -0
- package/dist/lib/detect.d.ts +12 -0
- package/dist/lib/detect.d.ts.map +1 -0
- package/dist/lib/detect.js +109 -0
- package/dist/lib/detect.js.map +1 -0
- package/dist/lib/hooks.d.ts +40 -0
- package/dist/lib/hooks.d.ts.map +1 -0
- package/dist/lib/hooks.js +226 -0
- package/dist/lib/hooks.js.map +1 -0
- package/dist/lib/mcp.d.ts +73 -0
- package/dist/lib/mcp.d.ts.map +1 -0
- package/dist/lib/mcp.js +418 -0
- package/dist/lib/mcp.js.map +1 -0
- package/dist/lib/platforms.d.ts +67 -0
- package/dist/lib/platforms.d.ts.map +1 -0
- package/dist/lib/platforms.js +353 -0
- package/dist/lib/platforms.js.map +1 -0
- package/dist/lib/rules.d.ts +35 -0
- package/dist/lib/rules.d.ts.map +1 -0
- package/dist/lib/rules.js +161 -0
- package/dist/lib/rules.js.map +1 -0
- package/dist/lib/state.d.ts +33 -0
- package/dist/lib/state.d.ts.map +1 -0
- package/dist/lib/state.js +130 -0
- package/dist/lib/state.js.map +1 -0
- package/package.json +19 -13
- package/registry.json +9 -0
- package/index.js +0 -244
- package/lib/cli.js +0 -99
- package/lib/detect.js +0 -242
- package/lib/hooks.js +0 -238
- package/lib/mcp.js +0 -503
- package/lib/platforms.js +0 -184
- package/lib/rules.js +0 -170
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Universal MCP server + behavioral rules installer for AI coding agents.
|
|
4
4
|
|
|
5
|
+
[Join the Discord](https://discord.gg/bBcRHT4J) — bug reports, feedback, share what you're building.
|
|
6
|
+
|
|
5
7
|
Equip handles the hard part of distributing your MCP tool: detecting which AI coding platforms are installed, writing the correct config format for each one, and managing versioned behavioral rules — all with zero dependencies.
|
|
6
8
|
|
|
7
9
|
## Run the Demo
|
|
@@ -28,7 +30,7 @@ These platforms get both MCP server config *and* auto-installed behavioral rules
|
|
|
28
30
|
| Platform | MCP Config | Rules |
|
|
29
31
|
|---|---|---|
|
|
30
32
|
| Claude Code | `~/.claude.json` (JSON, `mcpServers`) | `~/.claude/CLAUDE.md` (append) |
|
|
31
|
-
| Windsurf | `~/.codeium/windsurf/mcp_config.json` (JSON, `mcpServers`) |
|
|
33
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` (JSON, `mcpServers`, `serverUrl`) | `~/.codeium/windsurf/memories/global_rules.md` (append) |
|
|
32
34
|
| Cline | `globalStorage/.../cline_mcp_settings.json` (JSON, `mcpServers`) | `~/Documents/Cline/Rules/` (standalone file) |
|
|
33
35
|
| Roo Code | `globalStorage/.../cline_mcp_settings.json` (JSON, `mcpServers`) | `~/.roo/rules/` (standalone file) |
|
|
34
36
|
| Codex | `~/.codex/config.toml` (TOML, `mcp_servers`) | `~/.codex/AGENTS.md` (append) |
|
|
@@ -40,13 +42,13 @@ These platforms get MCP server config but don't have a writable global rules fil
|
|
|
40
42
|
|
|
41
43
|
| Platform | MCP Config |
|
|
42
44
|
|---|---|
|
|
43
|
-
| Cursor | `~/.cursor/mcp.json` (JSON, `mcpServers`) |
|
|
45
|
+
| Cursor | `~/.cursor/mcp.json` (JSON, `mcpServers`, `type: "streamable-http"`) |
|
|
44
46
|
| VS Code | `Code/User/mcp.json` (JSON, `servers`, `type: "http"`) |
|
|
45
47
|
| Junie (JetBrains) | `~/.junie/mcp/mcp.json` (JSON, `mcpServers`) |
|
|
46
48
|
| Copilot (JetBrains) | `~/.config/github-copilot/intellij/mcp.json` (JSON, `mcpServers`) |
|
|
47
49
|
| Copilot CLI | `~/.copilot/mcp-config.json` (JSON, `mcpServers`) |
|
|
48
50
|
|
|
49
|
-
For these platforms, `installRules()` returns `{ action: "clipboard" }` if the platform is in the configurable `clipboardPlatforms` list (default: `["cursor", "vscode"]`)
|
|
51
|
+
For these platforms, `installRules()` returns `{ action: "clipboard" }` if the platform is in the configurable `clipboardPlatforms` list (default: `["cursor", "vscode"]`) and automatically copies the rules content to the system clipboard. For platforms with no rules path and not in `clipboardPlatforms`, it returns `{ action: "skipped" }`.
|
|
50
52
|
|
|
51
53
|
### Hooks — Structural Enforcement
|
|
52
54
|
|
|
@@ -54,7 +56,7 @@ Some platforms support **lifecycle hooks** — scripts that run automatically at
|
|
|
54
56
|
|
|
55
57
|
| Platform | Hooks Support | Events |
|
|
56
58
|
|---|---|---|
|
|
57
|
-
| Claude Code | ✅ | `PostToolUseFailure`, `Stop`, `
|
|
59
|
+
| Claude Code | ✅ | `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `Stop`, `SessionStart`, `SessionEnd`, `UserPromptSubmit`, `Notification`, `SubagentStart`, `SubagentStop`, `PreCompact`, `TaskCompleted` |
|
|
58
60
|
| All others | ❌ | — |
|
|
59
61
|
|
|
60
62
|
When hooks are supported, equip writes the consumer-provided scripts to a configurable directory (default: `~/.${name}/hooks/`) and registers them in the platform's settings. Hooks are a **silent enhancement** — if the platform doesn't support them, equip installs only MCP + rules without any error or warning.
|
|
@@ -85,7 +87,7 @@ The CLI runs `npx -y <package>@latest <command>` with any extra args forwarded (
|
|
|
85
87
|
|
|
86
88
|
### Shorthand Registry
|
|
87
89
|
|
|
88
|
-
Registered shorthands save typing. Open a PR to `
|
|
90
|
+
Registered shorthands save typing. Open a PR to [`registry.json`](./registry.json) to add yours:
|
|
89
91
|
|
|
90
92
|
| Shorthand | Expands to |
|
|
91
93
|
|---|---|
|
|
@@ -137,6 +139,12 @@ for (const p of platforms) {
|
|
|
137
139
|
- `clipboardPlatforms` — Platform IDs that use clipboard (default: `["cursor", "vscode"]`)
|
|
138
140
|
- `config.stdio` — Stdio transport config (optional, alternative to HTTP)
|
|
139
141
|
- `command`, `args`, `envKey`
|
|
142
|
+
- `config.hooks` — Lifecycle hook definitions (optional, array)
|
|
143
|
+
- `event` — Hook event name (e.g., `"PostToolUseFailure"`)
|
|
144
|
+
- `matcher` — Regex matcher for event filtering (optional, e.g., `"Bash"`)
|
|
145
|
+
- `script` — Hook script content (Node.js)
|
|
146
|
+
- `name` — Script filename (without `.js` extension)
|
|
147
|
+
- `config.hookDir` — Directory for hook scripts (default: `~/.${name}/hooks/`)
|
|
140
148
|
|
|
141
149
|
### Instance Methods
|
|
142
150
|
|
|
@@ -153,14 +161,22 @@ for (const p of platforms) {
|
|
|
153
161
|
- `equip.hasHooks(platform, options?)` — Check if hooks are installed
|
|
154
162
|
- `equip.supportsHooks(platform)` — Check if platform supports hooks
|
|
155
163
|
|
|
156
|
-
###
|
|
157
|
-
|
|
158
|
-
All internal functions are also exported for advanced usage:
|
|
164
|
+
### Utilities
|
|
159
165
|
|
|
160
166
|
```js
|
|
161
|
-
const {
|
|
167
|
+
const { createManualPlatform, platformName, resolvePlatformId, parseRulesVersion, markerPatterns, cli, KNOWN_PLATFORMS, PLATFORM_REGISTRY, getPlatform } = require("@cg3/equip");
|
|
162
168
|
```
|
|
163
169
|
|
|
170
|
+
- `createManualPlatform(id)` — Create a platform object for a specific platform ID (bypasses detection)
|
|
171
|
+
- `platformName(id)` — Human-readable display name for a platform ID
|
|
172
|
+
- `resolvePlatformId(input)` — Resolve a friendly name or alias to a canonical platform ID (e.g., `"claude"` → `"claude-code"`, `"roo"` → `"roo-code"`)
|
|
173
|
+
- `parseRulesVersion(content, marker)` — Extract version from a marker block in content
|
|
174
|
+
- `markerPatterns(marker)` — Get regex patterns for a marker name
|
|
175
|
+
- `KNOWN_PLATFORMS` — Array of all supported platform IDs
|
|
176
|
+
- `PLATFORM_REGISTRY` — Map of platform definitions (for advanced use)
|
|
177
|
+
- `getPlatform(id)` — Get a platform definition by ID (throws if unknown)
|
|
178
|
+
- `cli` — Output helpers: `log`, `ok`, `fail`, `warn`, `info`, `step`, `prompt`, `copyToClipboard`, color constants
|
|
179
|
+
|
|
164
180
|
## Key Features
|
|
165
181
|
|
|
166
182
|
- **Zero dependencies** — Pure Node.js, works with Node 18+
|
|
@@ -189,4 +205,4 @@ No layer is a silver bullet. Together, they give you the best coverage available
|
|
|
189
205
|
|
|
190
206
|
## License
|
|
191
207
|
|
|
192
|
-
MIT —
|
|
208
|
+
MIT — Charles Mulic
|
package/bin/equip.js
CHANGED
|
@@ -1,78 +1,155 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @cg3/equip CLI — universal
|
|
3
|
-
// Usage:
|
|
4
|
-
// e.g. npx @cg3/equip prior --dry-run
|
|
2
|
+
// @cg3/equip CLI — universal MCP tool installer and configuration manager.
|
|
3
|
+
// Usage: equip <command> [args...]
|
|
5
4
|
|
|
6
5
|
"use strict";
|
|
7
6
|
|
|
8
|
-
const { spawn } = require("child_process");
|
|
7
|
+
const { spawn, execSync } = require("child_process");
|
|
9
8
|
const path = require("path");
|
|
9
|
+
const fs = require("fs");
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
).version;
|
|
11
|
+
const PKG = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf-8"));
|
|
12
|
+
const EQUIP_VERSION = PKG.version;
|
|
14
13
|
|
|
15
|
-
// ───
|
|
14
|
+
// ─── Registry ───────────────────────────────────────────────
|
|
16
15
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
16
|
+
const REGISTRY = JSON.parse(
|
|
17
|
+
fs.readFileSync(path.join(__dirname, "..", "registry.json"), "utf-8")
|
|
18
|
+
);
|
|
19
|
+
const TOOLS = {};
|
|
20
|
+
for (const [key, value] of Object.entries(REGISTRY)) {
|
|
21
|
+
if (!key.startsWith("$")) TOOLS[key] = value;
|
|
22
|
+
}
|
|
21
23
|
|
|
22
|
-
// ───
|
|
24
|
+
// ─── Built-in Commands ──────────────────────────────────────
|
|
23
25
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
+
const BUILTIN_COMMANDS = new Set(["status", "doctor", "update", "list", "demo", "--help", "-h", "--version", "-v"]);
|
|
27
|
+
|
|
28
|
+
function isBuiltin(cmd) {
|
|
29
|
+
return BUILTIN_COMMANDS.has(cmd);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ─── Stale Version Nudge ────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
function checkStaleVersion() {
|
|
35
|
+
try {
|
|
36
|
+
const { readState } = require("../dist/lib/state");
|
|
37
|
+
const state = readState();
|
|
38
|
+
if (state.lastUpdated) {
|
|
39
|
+
const daysSince = (Date.now() - new Date(state.lastUpdated).getTime()) / (1000 * 60 * 60 * 24);
|
|
40
|
+
if (daysSince > 14) {
|
|
41
|
+
const { YELLOW, RESET, DIM } = require("../dist/lib/cli");
|
|
42
|
+
process.stderr.write(` ${YELLOW}equip v${EQUIP_VERSION} is ${Math.floor(daysSince)} days old${RESET} ${DIM}— run "equip update" for platform fixes${RESET}\n\n`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
} catch {}
|
|
46
|
+
}
|
|
26
47
|
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
// ─── Command: --version ─────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
function cmdVersion() {
|
|
51
|
+
console.log(`equip v${EQUIP_VERSION}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ─── Command: --help ────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
function cmdHelp() {
|
|
57
|
+
console.log(`equip v${EQUIP_VERSION} — universal MCP tool installer`);
|
|
29
58
|
console.log("");
|
|
30
|
-
console.log("
|
|
59
|
+
console.log("Usage: equip <command> [options]");
|
|
60
|
+
console.log("");
|
|
61
|
+
console.log("Commands:");
|
|
62
|
+
console.log(" <tool> Install an MCP tool (e.g. equip prior)");
|
|
63
|
+
console.log(" status Show all MCP servers across all platforms");
|
|
64
|
+
console.log(" doctor Validate config integrity and detect drift");
|
|
65
|
+
console.log(" update Update equip and migrate configs");
|
|
66
|
+
console.log(" list Show registered tools");
|
|
67
|
+
console.log(" demo Run the built-in demo");
|
|
68
|
+
console.log("");
|
|
69
|
+
console.log("Registered tools:");
|
|
31
70
|
for (const [name, info] of Object.entries(TOOLS)) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} else {
|
|
35
|
-
console.log(` ${name} → ${info.package} ${info.command}`);
|
|
36
|
-
}
|
|
71
|
+
const desc = info.description ? ` — ${info.description}` : "";
|
|
72
|
+
console.log(` ${name}${desc}`);
|
|
37
73
|
}
|
|
38
74
|
console.log("");
|
|
39
|
-
console.log("Options
|
|
40
|
-
|
|
75
|
+
console.log("Options:");
|
|
76
|
+
console.log(" --help, -h Show this help");
|
|
77
|
+
console.log(" --version, -v Show version");
|
|
78
|
+
console.log("");
|
|
79
|
+
console.log("Tool options are forwarded (e.g. equip prior --dry-run --platform codex)");
|
|
41
80
|
}
|
|
42
81
|
|
|
43
|
-
|
|
82
|
+
// ─── Command: list ──────────────────────────────────────────
|
|
44
83
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
env: { ...process.env, EQUIP_VERSION },
|
|
52
|
-
});
|
|
53
|
-
child.on("close", (code) => process.exit(code || 0));
|
|
54
|
-
child.on("error", (err) => {
|
|
55
|
-
console.error(`Failed to run demo: ${err.message}`);
|
|
56
|
-
process.exit(1);
|
|
57
|
-
});
|
|
58
|
-
return;
|
|
84
|
+
function cmdList() {
|
|
85
|
+
const { GREEN, DIM, RESET, BOLD } = require("../dist/lib/cli");
|
|
86
|
+
console.log(`\n${BOLD}Registered tools${RESET}\n`);
|
|
87
|
+
for (const [name, info] of Object.entries(TOOLS)) {
|
|
88
|
+
const desc = info.description ? ` ${DIM}${info.description}${RESET}` : "";
|
|
89
|
+
console.log(` ${GREEN}${name}${RESET} → ${info.package} ${info.command}${desc}`);
|
|
59
90
|
}
|
|
91
|
+
console.log(`\n ${DIM}Install: equip <tool>${RESET}`);
|
|
92
|
+
console.log(` ${DIM}Add yours: PR to registry.json at github.com/CharlesMulic/equip${RESET}\n`);
|
|
60
93
|
}
|
|
61
94
|
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
95
|
+
// ─── Command: demo ──────────────────────────────────────────
|
|
96
|
+
|
|
97
|
+
function cmdDemo(extraArgs) {
|
|
98
|
+
const demoPath = path.join(__dirname, "..", "demo", "setup.js");
|
|
99
|
+
const child = spawn(process.execPath, [demoPath, ...extraArgs], {
|
|
100
|
+
stdio: "inherit",
|
|
101
|
+
env: { ...process.env, EQUIP_VERSION },
|
|
102
|
+
});
|
|
103
|
+
child.on("close", (code) => process.exit(code || 0));
|
|
104
|
+
child.on("error", (err) => {
|
|
105
|
+
console.error(`Failed to run demo: ${err.message}`);
|
|
74
106
|
process.exit(1);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// ─── Command: status ────────────────────────────────────────
|
|
111
|
+
|
|
112
|
+
function cmdStatus() {
|
|
113
|
+
const { runStatus } = require("../dist/lib/commands/status");
|
|
114
|
+
runStatus();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ─── Command: doctor ────────────────────────────────────────
|
|
118
|
+
|
|
119
|
+
function cmdDoctor() {
|
|
120
|
+
const { runDoctor } = require("../dist/lib/commands/doctor");
|
|
121
|
+
runDoctor();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ─── Command: update ────────────────────────────────────────
|
|
125
|
+
|
|
126
|
+
function cmdUpdate() {
|
|
127
|
+
const { runUpdate } = require("../dist/lib/commands/update");
|
|
128
|
+
runUpdate();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ─── Tool Dispatch ──────────────────────────────────────────
|
|
132
|
+
|
|
133
|
+
function dispatchTool(alias, extraArgs) {
|
|
134
|
+
const entry = TOOLS[alias];
|
|
135
|
+
|
|
136
|
+
if (!entry) {
|
|
137
|
+
// No registry match — treat as a package name (e.g. "equip @scope/pkg setup")
|
|
138
|
+
const pkg = alias;
|
|
139
|
+
const command = extraArgs.shift();
|
|
140
|
+
if (!command) {
|
|
141
|
+
console.error(`Unknown command: ${alias}`);
|
|
142
|
+
console.error(`Run "equip --help" for usage.`);
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
spawnTool(pkg, command, extraArgs);
|
|
146
|
+
return;
|
|
75
147
|
}
|
|
148
|
+
|
|
149
|
+
spawnTool(entry.package, entry.command, extraArgs);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function spawnTool(pkg, command, extraArgs) {
|
|
76
153
|
const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
77
154
|
const child = spawn(npxCmd, ["-y", `${pkg}@latest`, command, ...extraArgs], {
|
|
78
155
|
stdio: "inherit",
|
|
@@ -84,19 +161,33 @@ if (!entry) {
|
|
|
84
161
|
console.error(`Failed to run ${pkg}: ${err.message}`);
|
|
85
162
|
process.exit(1);
|
|
86
163
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
process.exit(
|
|
102
|
-
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ─── Main ───────────────────────────────────────────────────
|
|
167
|
+
|
|
168
|
+
const cmd = process.argv[2];
|
|
169
|
+
const extraArgs = process.argv.slice(3);
|
|
170
|
+
|
|
171
|
+
if (!cmd || cmd === "--help" || cmd === "-h") {
|
|
172
|
+
cmdHelp();
|
|
173
|
+
process.exit(0);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (cmd === "--version" || cmd === "-v") {
|
|
177
|
+
cmdVersion();
|
|
178
|
+
process.exit(0);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Stale version check for non-trivial commands
|
|
182
|
+
if (cmd !== "update" && cmd !== "--version" && cmd !== "-v") {
|
|
183
|
+
checkStaleVersion();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
switch (cmd) {
|
|
187
|
+
case "status": cmdStatus(); break;
|
|
188
|
+
case "doctor": cmdDoctor(); break;
|
|
189
|
+
case "update": cmdUpdate(); break;
|
|
190
|
+
case "list": cmdList(); break;
|
|
191
|
+
case "demo": cmdDemo(extraArgs); break;
|
|
192
|
+
default: dispatchTool(cmd, extraArgs); break;
|
|
193
|
+
}
|
package/demo/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The demo runs in **dry-run mode by default** — it shows exactly what would hap
|
|
|
15
15
|
|
|
16
16
|
## What it does
|
|
17
17
|
|
|
18
|
-
The demo installs a fictional MCP tool called `
|
|
18
|
+
The demo installs a fictional MCP tool called `acme-docs` across all detected AI coding platforms. It walks through the core equip operations:
|
|
19
19
|
|
|
20
20
|
1. **Detect** — scan for installed AI tools (Claude Code, Cursor, VS Code, etc.)
|
|
21
21
|
2. **API key** — prompt for or configure authentication
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { parseRulesVersion, markerPatterns } from "./lib/rules";
|
|
2
|
+
import { type HookDefinition } from "./lib/hooks";
|
|
3
|
+
import { createManualPlatform, platformName, resolvePlatformId, KNOWN_PLATFORMS, PLATFORM_REGISTRY, getPlatform, type DetectedPlatform, type PlatformDefinition, type PlatformHttpShape, type PlatformHookCapabilities } from "./lib/platforms";
|
|
4
|
+
import * as cli from "./lib/cli";
|
|
5
|
+
export interface EquipConfig {
|
|
6
|
+
name: string;
|
|
7
|
+
serverUrl?: string;
|
|
8
|
+
rules?: {
|
|
9
|
+
content: string;
|
|
10
|
+
version: string;
|
|
11
|
+
marker: string;
|
|
12
|
+
fileName?: string;
|
|
13
|
+
clipboardPlatforms?: string[];
|
|
14
|
+
};
|
|
15
|
+
stdio?: {
|
|
16
|
+
command: string;
|
|
17
|
+
args: string[];
|
|
18
|
+
envKey: string;
|
|
19
|
+
};
|
|
20
|
+
hooks?: HookDefinition[];
|
|
21
|
+
hookDir?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Equip — configure AI coding tools with your MCP server and behavioral rules.
|
|
25
|
+
*/
|
|
26
|
+
declare class Equip {
|
|
27
|
+
name: string;
|
|
28
|
+
serverUrl?: string;
|
|
29
|
+
rules: EquipConfig["rules"] | null;
|
|
30
|
+
stdio: EquipConfig["stdio"] | null;
|
|
31
|
+
hookDefs: HookDefinition[] | null;
|
|
32
|
+
hookDir: string;
|
|
33
|
+
constructor(config: EquipConfig);
|
|
34
|
+
detect(): DetectedPlatform[];
|
|
35
|
+
buildConfig(platformId: string, apiKey: string, transport?: string): Record<string, unknown>;
|
|
36
|
+
installMcp(platform: DetectedPlatform, apiKey: string, options?: {
|
|
37
|
+
transport?: string;
|
|
38
|
+
dryRun?: boolean;
|
|
39
|
+
}): {
|
|
40
|
+
success: boolean;
|
|
41
|
+
method: string;
|
|
42
|
+
};
|
|
43
|
+
uninstallMcp(platform: DetectedPlatform, dryRun?: boolean): boolean;
|
|
44
|
+
updateMcpKey(platform: DetectedPlatform, apiKey: string, transport?: string): {
|
|
45
|
+
success: boolean;
|
|
46
|
+
method: string;
|
|
47
|
+
};
|
|
48
|
+
installRules(platform: DetectedPlatform, options?: {
|
|
49
|
+
dryRun?: boolean;
|
|
50
|
+
}): {
|
|
51
|
+
action: string;
|
|
52
|
+
};
|
|
53
|
+
uninstallRules(platform: DetectedPlatform, dryRun?: boolean): boolean;
|
|
54
|
+
readMcp(platform: DetectedPlatform): Record<string, unknown> | null;
|
|
55
|
+
installHooks(platform: DetectedPlatform, options?: {
|
|
56
|
+
hookDir?: string;
|
|
57
|
+
dryRun?: boolean;
|
|
58
|
+
}): {
|
|
59
|
+
installed: boolean;
|
|
60
|
+
scripts: string[];
|
|
61
|
+
hookDir: string;
|
|
62
|
+
} | null;
|
|
63
|
+
uninstallHooks(platform: DetectedPlatform, options?: {
|
|
64
|
+
hookDir?: string;
|
|
65
|
+
dryRun?: boolean;
|
|
66
|
+
}): boolean;
|
|
67
|
+
hasHooks(platform: DetectedPlatform, options?: {
|
|
68
|
+
hookDir?: string;
|
|
69
|
+
}): boolean;
|
|
70
|
+
supportsHooks(platform: DetectedPlatform): boolean;
|
|
71
|
+
}
|
|
72
|
+
export { Equip, createManualPlatform, platformName, resolvePlatformId, KNOWN_PLATFORMS, PLATFORM_REGISTRY, getPlatform, parseRulesVersion, markerPatterns, cli, };
|
|
73
|
+
export type { DetectedPlatform, PlatformDefinition, PlatformHttpShape, PlatformHookCapabilities, HookDefinition };
|
|
74
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAgC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,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO;IAOzG,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO;IAOjF,aAAa,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO;CAGnD;AAID,OAAO,EACL,KAAK,EAEL,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,WAAW,EAEX,iBAAiB,EACjB,cAAc,EAEd,GAAG,GACJ,CAAC;AAGF,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @cg3/equip — Universal MCP + behavioral rules installer for AI coding agents.
|
|
3
|
+
// Zero dependencies. Works with Claude Code, Cursor, Windsurf, VS Code, Cline, Roo Code, Codex, Gemini CLI.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.cli = exports.markerPatterns = exports.parseRulesVersion = exports.getPlatform = exports.PLATFORM_REGISTRY = exports.KNOWN_PLATFORMS = exports.resolvePlatformId = exports.platformName = exports.createManualPlatform = exports.Equip = void 0;
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const os = __importStar(require("os"));
|
|
41
|
+
const detect_1 = require("./lib/detect");
|
|
42
|
+
const mcp_1 = require("./lib/mcp");
|
|
43
|
+
const rules_1 = require("./lib/rules");
|
|
44
|
+
Object.defineProperty(exports, "parseRulesVersion", { enumerable: true, get: function () { return rules_1.parseRulesVersion; } });
|
|
45
|
+
Object.defineProperty(exports, "markerPatterns", { enumerable: true, get: function () { return rules_1.markerPatterns; } });
|
|
46
|
+
const hooks_1 = require("./lib/hooks");
|
|
47
|
+
const platforms_1 = require("./lib/platforms");
|
|
48
|
+
Object.defineProperty(exports, "createManualPlatform", { enumerable: true, get: function () { return platforms_1.createManualPlatform; } });
|
|
49
|
+
Object.defineProperty(exports, "platformName", { enumerable: true, get: function () { return platforms_1.platformName; } });
|
|
50
|
+
Object.defineProperty(exports, "resolvePlatformId", { enumerable: true, get: function () { return platforms_1.resolvePlatformId; } });
|
|
51
|
+
Object.defineProperty(exports, "KNOWN_PLATFORMS", { enumerable: true, get: function () { return platforms_1.KNOWN_PLATFORMS; } });
|
|
52
|
+
Object.defineProperty(exports, "PLATFORM_REGISTRY", { enumerable: true, get: function () { return platforms_1.PLATFORM_REGISTRY; } });
|
|
53
|
+
Object.defineProperty(exports, "getPlatform", { enumerable: true, get: function () { return platforms_1.getPlatform; } });
|
|
54
|
+
const cli = __importStar(require("./lib/cli"));
|
|
55
|
+
exports.cli = cli;
|
|
56
|
+
const state_1 = require("./lib/state");
|
|
57
|
+
/**
|
|
58
|
+
* Equip — configure AI coding tools with your MCP server and behavioral rules.
|
|
59
|
+
*/
|
|
60
|
+
class Equip {
|
|
61
|
+
name;
|
|
62
|
+
serverUrl;
|
|
63
|
+
rules;
|
|
64
|
+
stdio;
|
|
65
|
+
hookDefs;
|
|
66
|
+
hookDir;
|
|
67
|
+
constructor(config) {
|
|
68
|
+
if (!config.name)
|
|
69
|
+
throw new Error("Equip: name is required");
|
|
70
|
+
if (!config.serverUrl && !config.stdio)
|
|
71
|
+
throw new Error("Equip: serverUrl or stdio is required");
|
|
72
|
+
this.name = config.name;
|
|
73
|
+
this.serverUrl = config.serverUrl;
|
|
74
|
+
this.rules = config.rules || null;
|
|
75
|
+
this.stdio = config.stdio || null;
|
|
76
|
+
this.hookDefs = config.hooks || null;
|
|
77
|
+
this.hookDir = config.hookDir || path.join(os.homedir(), `.${config.name}`, "hooks");
|
|
78
|
+
}
|
|
79
|
+
detect() {
|
|
80
|
+
return (0, detect_1.detectPlatforms)(this.name);
|
|
81
|
+
}
|
|
82
|
+
buildConfig(platformId, apiKey, transport = "http") {
|
|
83
|
+
if (transport === "stdio" && this.stdio) {
|
|
84
|
+
const env = { [this.stdio.envKey]: apiKey };
|
|
85
|
+
return (0, mcp_1.buildStdioConfig)(this.stdio.command, this.stdio.args, env);
|
|
86
|
+
}
|
|
87
|
+
return (0, mcp_1.buildHttpConfigWithAuth)(this.serverUrl, apiKey, platformId);
|
|
88
|
+
}
|
|
89
|
+
installMcp(platform, apiKey, options = {}) {
|
|
90
|
+
const { transport = "http", dryRun = false } = options;
|
|
91
|
+
const config = this.buildConfig(platform.platform, apiKey, transport);
|
|
92
|
+
const result = (0, mcp_1.installMcp)(platform, this.name, config, { dryRun, serverUrl: this.serverUrl });
|
|
93
|
+
if (result.success && !dryRun) {
|
|
94
|
+
try {
|
|
95
|
+
(0, state_1.trackInstall)(this.name, `@cg3/${this.name}`, platform.platform, {
|
|
96
|
+
transport,
|
|
97
|
+
configPath: platform.configPath,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
catch { /* state tracking is best-effort */ }
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
uninstallMcp(platform, dryRun = false) {
|
|
105
|
+
const removed = (0, mcp_1.uninstallMcp)(platform, this.name, dryRun);
|
|
106
|
+
if (removed && !dryRun) {
|
|
107
|
+
try {
|
|
108
|
+
(0, state_1.trackUninstall)(this.name, platform.platform);
|
|
109
|
+
}
|
|
110
|
+
catch { }
|
|
111
|
+
}
|
|
112
|
+
return removed;
|
|
113
|
+
}
|
|
114
|
+
updateMcpKey(platform, apiKey, transport = "http") {
|
|
115
|
+
const config = this.buildConfig(platform.platform, apiKey, transport);
|
|
116
|
+
return (0, mcp_1.updateMcpKey)(platform, this.name, config);
|
|
117
|
+
}
|
|
118
|
+
installRules(platform, options = {}) {
|
|
119
|
+
if (!this.rules)
|
|
120
|
+
return { action: "skipped" };
|
|
121
|
+
const result = (0, rules_1.installRules)(platform, { ...this.rules, dryRun: options.dryRun || false });
|
|
122
|
+
if ((result.action === "created" || result.action === "updated") && !options.dryRun) {
|
|
123
|
+
try {
|
|
124
|
+
(0, state_1.trackInstall)(this.name, `@cg3/${this.name}`, platform.platform, {
|
|
125
|
+
transport: "http",
|
|
126
|
+
rulesVersion: this.rules.version,
|
|
127
|
+
configPath: platform.configPath,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
catch { }
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
uninstallRules(platform, dryRun = false) {
|
|
135
|
+
if (!this.rules)
|
|
136
|
+
return false;
|
|
137
|
+
return (0, rules_1.uninstallRules)(platform, {
|
|
138
|
+
marker: this.rules.marker,
|
|
139
|
+
fileName: this.rules.fileName,
|
|
140
|
+
dryRun,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
readMcp(platform) {
|
|
144
|
+
return (0, mcp_1.readMcpEntry)(platform.configPath, platform.rootKey, this.name, platform.configFormat || "json");
|
|
145
|
+
}
|
|
146
|
+
installHooks(platform, options = {}) {
|
|
147
|
+
if (!this.hookDefs)
|
|
148
|
+
return null;
|
|
149
|
+
const opts = { ...options };
|
|
150
|
+
if (this.hookDir && !opts.hookDir)
|
|
151
|
+
opts.hookDir = this.hookDir;
|
|
152
|
+
return (0, hooks_1.installHooks)(platform, this.hookDefs, opts);
|
|
153
|
+
}
|
|
154
|
+
uninstallHooks(platform, options = {}) {
|
|
155
|
+
if (!this.hookDefs)
|
|
156
|
+
return false;
|
|
157
|
+
const opts = { ...options };
|
|
158
|
+
if (this.hookDir && !opts.hookDir)
|
|
159
|
+
opts.hookDir = this.hookDir;
|
|
160
|
+
return (0, hooks_1.uninstallHooks)(platform, this.hookDefs, opts);
|
|
161
|
+
}
|
|
162
|
+
hasHooks(platform, options = {}) {
|
|
163
|
+
if (!this.hookDefs)
|
|
164
|
+
return false;
|
|
165
|
+
const opts = { ...options };
|
|
166
|
+
if (this.hookDir && !opts.hookDir)
|
|
167
|
+
opts.hookDir = this.hookDir;
|
|
168
|
+
return (0, hooks_1.hasHooks)(platform, this.hookDefs, opts);
|
|
169
|
+
}
|
|
170
|
+
supportsHooks(platform) {
|
|
171
|
+
return !!this.hookDefs && this.hookDefs.length > 0 && !!(0, hooks_1.getHookCapabilities)(platform.platform);
|
|
172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