mcpick 0.0.24 → 0.0.26

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +8 -2
  3. package/dist/{add-Qzd8i-5k.js → add-DwUPxD5U.js} +21 -35
  4. package/dist/{add-json-DGmsjB0O.js → add-json-Dk3C8QSR.js} +18 -34
  5. package/dist/atomic-write-9pfXia-x.js +22 -0
  6. package/dist/{backup-C7fvikFw.js → backup-Ber7st-_.js} +4 -5
  7. package/dist/{cache-D3jjh5dD.js → cache-BVNAOxqk.js} +4 -3
  8. package/dist/{cli-CZOlaqoZ.js → cli-Dfein2li.js} +22 -22
  9. package/dist/{clients-Bh93TGP4.js → clients-C1mWlnsn.js} +3 -3
  10. package/dist/{clone-MI8jJhTz.js → clone-BE904ik7.js} +3 -6
  11. package/dist/{dev-51esdZG9.js → dev-BW_2JDPM.js} +5 -6
  12. package/dist/{disable-csYAn2Vk.js → disable-CVwuJLhT.js} +18 -37
  13. package/dist/{enable-B5GbmhL-.js → enable-BEi8TUd1.js} +18 -37
  14. package/dist/{get-DacRZmwv.js → get-eDOm6sRK.js} +3 -3
  15. package/dist/{hooks-C_x49qap.js → hooks-DzGBYYId.js} +4 -3
  16. package/dist/index.js +752 -645
  17. package/dist/{list-BeBtsiae.js → list-CvpW_mNZ.js} +3 -5
  18. package/dist/{marketplace-BDC2YtvT.js → marketplace-BKGJ3UGr.js} +4 -4
  19. package/dist/mutation-BBMIFB8H.js +19 -0
  20. package/dist/{output-HtT5HCof.js → output-DGPi2IWN.js} +2 -2
  21. package/dist/{plugin-cache-DmLbh89d.js → plugin-cache-Dj-lS1mA.js} +177 -22
  22. package/dist/{plugins-Bkw-SKkZ.js → plugins-elIQYM38.js} +4 -4
  23. package/dist/profile-NVbTnJKI.js +163 -0
  24. package/dist/{reload-Bl1mYK1I.js → reload-BkVtWaf0.js} +2 -2
  25. package/dist/{remove-BSHgva79.js → remove-BC2vomi_.js} +18 -33
  26. package/dist/{reset-project-choices-BNLus9J9.js → reset-project-choices-DhJsWQx2.js} +3 -3
  27. package/dist/{restore-YisgARhc.js → restore-CeYSOFt8.js} +3 -5
  28. package/dist/{rollback-GR1RkpXW.js → rollback-g-WX6b3o.js} +3 -3
  29. package/dist/safe-apply-B5flt8QC.js +185 -0
  30. package/dist/{skills-rDTDqqZA.js → skills-zuQ5kCL1.js} +3 -3
  31. package/package.json +6 -6
  32. package/pnpm-workspace.yaml +1 -0
  33. package/dist/config-DE58Fik_.js +0 -176
  34. package/dist/dry-run-XQ32fxPT.js +0 -20
  35. package/dist/paths-BPISiJi4.js +0 -124
  36. package/dist/profile-DwJTVXiz.js +0 -161
  37. package/dist/redact-wBMtzbno.js +0 -88
  38. package/dist/rolldown-runtime-CiIaOW0V.js +0 -13
  39. package/dist/validation-xMlbgGCF.js +0 -44
@@ -0,0 +1,185 @@
1
+ import { access, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
2
+ import { basename, dirname, join } from "node:path";
3
+ import { createHash, randomUUID } from "node:crypto";
4
+ import { existsSync } from "node:fs";
5
+ import { homedir } from "node:os";
6
+ //#region src/utils/paths.ts
7
+ function get_base_dir() {
8
+ const configDir = process.env.CLAUDE_CONFIG_DIR;
9
+ if (configDir && configDir.length > 0 && existsSync(configDir)) return {
10
+ baseDir: configDir,
11
+ parentDir: dirname(configDir),
12
+ coLocatedConfig: true
13
+ };
14
+ const defaultDir = join(homedir(), ".claude");
15
+ return {
16
+ baseDir: defaultDir,
17
+ parentDir: dirname(defaultDir),
18
+ coLocatedConfig: false
19
+ };
20
+ }
21
+ function get_claude_config_path() {
22
+ const { baseDir, parentDir, coLocatedConfig } = get_base_dir();
23
+ if (coLocatedConfig) return join(baseDir, ".claude.json");
24
+ return join(parentDir, ".claude.json");
25
+ }
26
+ function get_claude_settings_path() {
27
+ return join(get_base_dir().baseDir, "settings.json");
28
+ }
29
+ function get_mcpick_dir() {
30
+ return join(get_base_dir().baseDir, "mcpick");
31
+ }
32
+ function get_dev_overrides_path() {
33
+ return join(get_mcpick_dir(), "dev-overrides.json");
34
+ }
35
+ function get_server_registry_path() {
36
+ return join(get_mcpick_dir(), "servers.json");
37
+ }
38
+ function get_backups_dir() {
39
+ return join(get_mcpick_dir(), "backups");
40
+ }
41
+ function get_profiles_dir() {
42
+ return join(get_mcpick_dir(), "profiles");
43
+ }
44
+ function get_profile_path(name) {
45
+ const filename = name.endsWith(".json") ? name : `${name}.json`;
46
+ return join(get_profiles_dir(), filename);
47
+ }
48
+ function format_backup_timestamp() {
49
+ const now = /* @__PURE__ */ new Date();
50
+ return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}-${String(now.getHours()).padStart(2, "0")}${String(now.getMinutes()).padStart(2, "0")}${String(now.getSeconds()).padStart(2, "0")}`;
51
+ }
52
+ function get_backup_filename() {
53
+ return `mcp-servers-${format_backup_timestamp()}.json`;
54
+ }
55
+ function get_plugin_backup_filename() {
56
+ return `plugins-${format_backup_timestamp()}.json`;
57
+ }
58
+ async function ensure_directory_exists(dir_path) {
59
+ try {
60
+ await access(dir_path);
61
+ } catch {
62
+ await mkdir(dir_path, { recursive: true });
63
+ }
64
+ }
65
+ /**
66
+ * Get the current working directory (project path)
67
+ */
68
+ function get_current_project_path() {
69
+ return process.cwd();
70
+ }
71
+ /**
72
+ * Get the path to .mcp.json in the current project directory (project scope)
73
+ */
74
+ function get_project_mcp_json_path() {
75
+ return join(get_current_project_path(), ".mcp.json");
76
+ }
77
+ function get_plugins_dir() {
78
+ return join(get_base_dir().baseDir, "plugins");
79
+ }
80
+ function get_installed_plugins_path() {
81
+ return join(get_plugins_dir(), "installed_plugins.json");
82
+ }
83
+ function get_known_marketplaces_path() {
84
+ return join(get_plugins_dir(), "known_marketplaces.json");
85
+ }
86
+ function get_plugin_cache_dir() {
87
+ return join(get_plugins_dir(), "cache");
88
+ }
89
+ function get_marketplaces_dir() {
90
+ return join(get_plugins_dir(), "marketplaces");
91
+ }
92
+ function get_disabled_hooks_path() {
93
+ return join(get_mcpick_dir(), "disabled-hooks.json");
94
+ }
95
+ function get_marketplace_manifest_path(name) {
96
+ return join(get_marketplaces_dir(), name, ".claude-plugin", "marketplace.json");
97
+ }
98
+ //#endregion
99
+ //#region src/utils/safe-apply.ts
100
+ async function file_exists(path) {
101
+ try {
102
+ await access(path);
103
+ return true;
104
+ } catch {
105
+ return false;
106
+ }
107
+ }
108
+ function backup_name(path) {
109
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z");
110
+ const hash = createHash("sha256").update(path).digest("hex").slice(0, 10);
111
+ return `config-${basename(path).replace(/[^A-Za-z0-9._-]/g, "_")}-${stamp}-${hash}.json`;
112
+ }
113
+ async function create_backup(path, content) {
114
+ const backups_dir = get_backups_dir();
115
+ await ensure_directory_exists(backups_dir);
116
+ const backup_path = join(backups_dir, backup_name(path));
117
+ await writeFile(backup_path, content, "utf-8");
118
+ await writeFile(`${backup_path}.meta.json`, JSON.stringify({
119
+ original_path: path,
120
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
121
+ }, null, 2), "utf-8");
122
+ return backup_path;
123
+ }
124
+ /**
125
+ * Safely replace a JSON file: backup existing content, write via temp+rename,
126
+ * verify the result parses, and restore the original content on failure.
127
+ */
128
+ async function safe_json_write(path, data, indent = 2) {
129
+ await mkdir(dirname(path), { recursive: true });
130
+ const original_content = await file_exists(path) ? await readFile(path, "utf-8") : void 0;
131
+ const backup_path = original_content !== void 0 ? await create_backup(path, original_content) : void 0;
132
+ const tmp_path = join(dirname(path), `.${basename(path)}.${process.pid}.${Date.now()}.${randomUUID()}.tmp`);
133
+ const next_content = JSON.stringify(data, null, indent);
134
+ try {
135
+ await writeFile(tmp_path, next_content, "utf-8");
136
+ await rename(tmp_path, path);
137
+ const written = await readFile(path, "utf-8");
138
+ JSON.parse(written);
139
+ return {
140
+ path,
141
+ ...backup_path ? { backup_path } : {}
142
+ };
143
+ } catch (error) {
144
+ await rm(tmp_path, { force: true }).catch(() => void 0);
145
+ if (original_content !== void 0) await writeFile(path, original_content, "utf-8");
146
+ else await rm(path, { force: true }).catch(() => void 0);
147
+ throw error;
148
+ }
149
+ }
150
+ async function list_config_backups() {
151
+ const backups_dir = get_backups_dir();
152
+ try {
153
+ const files = await readdir(backups_dir);
154
+ const backups = [];
155
+ for (const file of files) {
156
+ if (!file.startsWith("config-") || !file.endsWith(".json")) continue;
157
+ if (file.endsWith(".meta.json")) continue;
158
+ const backup_path = join(backups_dir, file);
159
+ try {
160
+ const meta = JSON.parse(await readFile(`${backup_path}.meta.json`, "utf-8"));
161
+ if (typeof meta.original_path !== "string" || typeof meta.created_at !== "string") continue;
162
+ backups.push({
163
+ path: backup_path,
164
+ original_path: meta.original_path,
165
+ created_at: meta.created_at
166
+ });
167
+ } catch {}
168
+ }
169
+ return backups.sort((a, b) => b.created_at.localeCompare(a.created_at));
170
+ } catch {
171
+ return [];
172
+ }
173
+ }
174
+ async function restore_config_backup(backup_path) {
175
+ const backup = (await list_config_backups()).find((candidate) => candidate.path === backup_path || basename(candidate.path) === backup_path);
176
+ if (!backup) throw new Error(`Config backup '${backup_path}' not found.`);
177
+ const content = await readFile(backup.path, "utf-8");
178
+ const parsed = JSON.parse(content);
179
+ await safe_json_write(backup.original_path, parsed);
180
+ return backup;
181
+ }
182
+ //#endregion
183
+ export { get_server_registry_path as S, get_plugin_backup_filename as _, get_backup_filename as a, get_profiles_dir as b, get_claude_settings_path as c, get_disabled_hooks_path as d, get_installed_plugins_path as f, get_mcpick_dir as g, get_marketplaces_dir as h, ensure_directory_exists as i, get_current_project_path as l, get_marketplace_manifest_path as m, restore_config_backup as n, get_backups_dir as o, get_known_marketplaces_path as p, safe_json_write as r, get_claude_config_path as s, list_config_backups as t, get_dev_overrides_path as u, get_plugin_cache_dir as v, get_project_mcp_json_path as x, get_profile_path as y };
184
+
185
+ //# sourceMappingURL=safe-apply-B5flt8QC.js.map
@@ -1,5 +1,5 @@
1
- import { a as run_skills_cli, o as split_cli_list } from "./index.js";
2
- import { n as output, t as error } from "./output-HtT5HCof.js";
1
+ import { o as run_skills_cli, s as split_cli_list } from "./index.js";
2
+ import { n as output, t as error } from "./output-DGPi2IWN.js";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/cli/commands/skills.ts
5
5
  function add_agent_args(cli_args, agent) {
@@ -213,4 +213,4 @@ var skills_default = defineCommand({
213
213
  //#endregion
214
214
  export { skills_default as default };
215
215
 
216
- //# sourceMappingURL=skills-rDTDqqZA.js.map
216
+ //# sourceMappingURL=skills-zuQ5kCL1.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcpick",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "Vendor-neutral MCP configuration manager with first-class Claude Code support",
5
5
  "keywords": [
6
6
  "claude",
@@ -31,15 +31,15 @@
31
31
  "type": "module",
32
32
  "main": "./dist/index.js",
33
33
  "dependencies": {
34
- "@clack/prompts": "^1.3.0",
34
+ "@clack/prompts": "^1.4.0",
35
35
  "citty": "^0.2.2",
36
- "valibot": "^1.3.1"
36
+ "valibot": "^1.4.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@changesets/cli": "^2.31.0",
40
- "@types/node": "^25.6.0",
41
- "vite-plus": "^0.1.20",
42
- "vitest": "^4.1.5"
40
+ "@types/node": "^25.9.0",
41
+ "vite-plus": "^0.2.0",
42
+ "vitest": "^4.1.6"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22.0.0"
@@ -0,0 +1 @@
1
+ minimumReleaseAge: 2880
@@ -1,176 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { i as get_claude_config_path, o as get_current_project_path, v as get_project_mcp_json_path } from "./paths-BPISiJi4.js";
3
- import { t as validate_claude_config } from "./validation-xMlbgGCF.js";
4
- import { et as atomic_json_write } from "./index.js";
5
- import { access, readFile } from "node:fs/promises";
6
- //#region src/core/config.ts
7
- var config_exports = /* @__PURE__ */ __exportAll({
8
- create_config_from_servers: () => create_config_from_servers,
9
- detect_server_scope: () => detect_server_scope,
10
- find_server_in_scope: () => find_server_in_scope,
11
- get_enabled_servers: () => get_enabled_servers,
12
- get_enabled_servers_for_scope: () => get_enabled_servers_for_scope,
13
- read_claude_config: () => read_claude_config,
14
- write_claude_config: () => write_claude_config
15
- });
16
- async function read_claude_config() {
17
- const config_path = get_claude_config_path();
18
- try {
19
- await access(config_path);
20
- const config_content = await readFile(config_path, "utf-8");
21
- return validate_claude_config(JSON.parse(config_content));
22
- } catch (error) {
23
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return { mcpServers: {} };
24
- throw error;
25
- }
26
- }
27
- async function write_claude_config(config) {
28
- await atomic_json_write(get_claude_config_path(), (existing) => {
29
- existing.mcpServers = config.mcpServers;
30
- return existing;
31
- });
32
- }
33
- function get_enabled_servers(config) {
34
- if (!config.mcpServers) return [];
35
- return Object.entries(config.mcpServers).map(([name, server]) => ({
36
- ...server,
37
- name
38
- }));
39
- }
40
- function create_config_from_servers(selected_servers) {
41
- const mcp_servers = {};
42
- selected_servers.forEach((server) => {
43
- const { name, ...server_config } = server;
44
- mcp_servers[name] = server_config;
45
- });
46
- return { mcpServers: mcp_servers };
47
- }
48
- /**
49
- * Find a server's full config in a specific scope.
50
- */
51
- async function find_server_in_scope(name, scope) {
52
- if (scope === "user" || scope === "local") {
53
- const config_path = get_claude_config_path();
54
- try {
55
- await access(config_path);
56
- const content = await readFile(config_path, "utf-8");
57
- const parsed = JSON.parse(content);
58
- if (scope === "user") {
59
- const server = parsed.mcpServers?.[name];
60
- if (server) return {
61
- server,
62
- scope: "user"
63
- };
64
- } else {
65
- const cwd = get_current_project_path();
66
- const server = parsed.projects?.[cwd]?.mcpServers?.[name];
67
- if (server) return {
68
- server,
69
- scope: "local"
70
- };
71
- }
72
- } catch {}
73
- } else if (scope === "project") {
74
- const mcp_path = get_project_mcp_json_path();
75
- try {
76
- await access(mcp_path);
77
- const content = await readFile(mcp_path, "utf-8");
78
- const server = JSON.parse(content).mcpServers?.[name];
79
- if (server) return {
80
- server,
81
- scope: "project"
82
- };
83
- } catch {}
84
- }
85
- return null;
86
- }
87
- /**
88
- * Auto-detect which scope a server lives in.
89
- * Searches local → project → user.
90
- */
91
- async function detect_server_scope(name) {
92
- for (const scope of [
93
- "local",
94
- "project",
95
- "user"
96
- ]) {
97
- const result = await find_server_in_scope(name, scope);
98
- if (result) return result;
99
- }
100
- return null;
101
- }
102
- /**
103
- * Read full Claude config including projects section
104
- */
105
- async function read_claude_config_full() {
106
- const config_path = get_claude_config_path();
107
- try {
108
- await access(config_path);
109
- const config_content = await readFile(config_path, "utf-8");
110
- return JSON.parse(config_content);
111
- } catch {
112
- return {
113
- mcpServers: {},
114
- projects: {}
115
- };
116
- }
117
- }
118
- /**
119
- * Read MCP servers for local scope (current project)
120
- * Stored in ~/.claude.json -> projects[cwd].mcpServers
121
- * Also searches parent directories since Claude CLI may store config at parent level
122
- */
123
- async function read_local_mcp_servers() {
124
- const { dirname } = await import("node:path");
125
- const { homedir } = await import("node:os");
126
- const full_config = await read_claude_config_full();
127
- const home = homedir();
128
- let current_dir = get_current_project_path();
129
- while (current_dir && current_dir !== "/" && current_dir.length >= home.length) {
130
- const project_config = full_config.projects?.[current_dir];
131
- if (project_config?.mcpServers && Object.keys(project_config.mcpServers).length > 0) return Object.keys(project_config.mcpServers);
132
- current_dir = dirname(current_dir);
133
- }
134
- return [];
135
- }
136
- /**
137
- * Read MCP servers from ~/.claude.json -> mcpServers (user scope)
138
- */
139
- async function read_user_mcp_servers() {
140
- const config = await read_claude_config();
141
- return Object.keys(config.mcpServers || {});
142
- }
143
- /**
144
- * Read MCP servers from .mcp.json files (project scope)
145
- * Searches current directory and parents for .mcp.json
146
- */
147
- async function find_and_read_project_mcp_json() {
148
- const { dirname } = await import("node:path");
149
- let current_dir = get_current_project_path();
150
- const home = (await import("node:os")).homedir();
151
- while (current_dir && current_dir !== "/" && current_dir.length >= home.length) {
152
- const mcp_path = `${current_dir}/.mcp.json`;
153
- try {
154
- await access(mcp_path);
155
- const content = await readFile(mcp_path, "utf-8");
156
- const servers = JSON.parse(content).mcpServers || {};
157
- return Object.keys(servers);
158
- } catch {}
159
- current_dir = dirname(current_dir);
160
- }
161
- return [];
162
- }
163
- /**
164
- * Get currently enabled server names for a specific scope
165
- */
166
- async function get_enabled_servers_for_scope(scope) {
167
- switch (scope) {
168
- case "local": return read_local_mcp_servers();
169
- case "project": return find_and_read_project_mcp_json();
170
- case "user": return read_user_mcp_servers();
171
- }
172
- }
173
- //#endregion
174
- export { get_enabled_servers as a, write_claude_config as c, find_server_in_scope as i, create_config_from_servers as n, get_enabled_servers_for_scope as o, detect_server_scope as r, read_claude_config as s, config_exports as t };
175
-
176
- //# sourceMappingURL=config-DE58Fik_.js.map
@@ -1,20 +0,0 @@
1
- import { n as output } from "./output-HtT5HCof.js";
2
- //#region src/cli/dry-run.ts
3
- function print_dry_run(preview, json) {
4
- if (json) {
5
- output(preview, true);
6
- return;
7
- }
8
- console.log(`Dry run: ${preview.operation} (${preview.client}:${preview.scope})`);
9
- console.log(`Target: ${preview.location}`);
10
- if ("command" in preview) {
11
- console.log(`Command: ${preview.command.join(" ")}`);
12
- return;
13
- }
14
- if (preview.diff) console.log(preview.diff);
15
- else console.log("No changes.");
16
- }
17
- //#endregion
18
- export { print_dry_run as t };
19
-
20
- //# sourceMappingURL=dry-run-XQ32fxPT.js.map
@@ -1,124 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { access, mkdir } from "node:fs/promises";
3
- import { dirname, join } from "node:path";
4
- import { existsSync } from "node:fs";
5
- import { homedir } from "node:os";
6
- //#region src/utils/paths.ts
7
- var paths_exports = /* @__PURE__ */ __exportAll({
8
- ensure_directory_exists: () => ensure_directory_exists,
9
- get_backup_filename: () => get_backup_filename,
10
- get_backups_dir: () => get_backups_dir,
11
- get_base_dir: () => get_base_dir,
12
- get_claude_config_path: () => get_claude_config_path,
13
- get_claude_settings_path: () => get_claude_settings_path,
14
- get_current_project_path: () => get_current_project_path,
15
- get_dev_overrides_path: () => get_dev_overrides_path,
16
- get_disabled_hooks_path: () => get_disabled_hooks_path,
17
- get_installed_plugins_path: () => get_installed_plugins_path,
18
- get_known_marketplaces_path: () => get_known_marketplaces_path,
19
- get_marketplace_manifest_path: () => get_marketplace_manifest_path,
20
- get_marketplaces_dir: () => get_marketplaces_dir,
21
- get_mcpick_dir: () => get_mcpick_dir,
22
- get_plugin_backup_filename: () => get_plugin_backup_filename,
23
- get_plugin_cache_dir: () => get_plugin_cache_dir,
24
- get_plugins_dir: () => get_plugins_dir,
25
- get_profile_path: () => get_profile_path,
26
- get_profiles_dir: () => get_profiles_dir,
27
- get_project_mcp_json_path: () => get_project_mcp_json_path,
28
- get_server_registry_path: () => get_server_registry_path
29
- });
30
- function get_base_dir() {
31
- const configDir = process.env.CLAUDE_CONFIG_DIR;
32
- if (configDir && configDir.length > 0 && existsSync(configDir)) return {
33
- baseDir: configDir,
34
- parentDir: dirname(configDir),
35
- coLocatedConfig: true
36
- };
37
- const defaultDir = join(homedir(), ".claude");
38
- return {
39
- baseDir: defaultDir,
40
- parentDir: dirname(defaultDir),
41
- coLocatedConfig: false
42
- };
43
- }
44
- function get_claude_config_path() {
45
- const { baseDir, parentDir, coLocatedConfig } = get_base_dir();
46
- if (coLocatedConfig) return join(baseDir, ".claude.json");
47
- return join(parentDir, ".claude.json");
48
- }
49
- function get_claude_settings_path() {
50
- return join(get_base_dir().baseDir, "settings.json");
51
- }
52
- function get_mcpick_dir() {
53
- return join(get_base_dir().baseDir, "mcpick");
54
- }
55
- function get_dev_overrides_path() {
56
- return join(get_mcpick_dir(), "dev-overrides.json");
57
- }
58
- function get_server_registry_path() {
59
- return join(get_mcpick_dir(), "servers.json");
60
- }
61
- function get_backups_dir() {
62
- return join(get_mcpick_dir(), "backups");
63
- }
64
- function get_profiles_dir() {
65
- return join(get_mcpick_dir(), "profiles");
66
- }
67
- function get_profile_path(name) {
68
- const filename = name.endsWith(".json") ? name : `${name}.json`;
69
- return join(get_profiles_dir(), filename);
70
- }
71
- function format_backup_timestamp() {
72
- const now = /* @__PURE__ */ new Date();
73
- return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}-${String(now.getHours()).padStart(2, "0")}${String(now.getMinutes()).padStart(2, "0")}${String(now.getSeconds()).padStart(2, "0")}`;
74
- }
75
- function get_backup_filename() {
76
- return `mcp-servers-${format_backup_timestamp()}.json`;
77
- }
78
- function get_plugin_backup_filename() {
79
- return `plugins-${format_backup_timestamp()}.json`;
80
- }
81
- async function ensure_directory_exists(dir_path) {
82
- try {
83
- await access(dir_path);
84
- } catch {
85
- await mkdir(dir_path, { recursive: true });
86
- }
87
- }
88
- /**
89
- * Get the current working directory (project path)
90
- */
91
- function get_current_project_path() {
92
- return process.cwd();
93
- }
94
- /**
95
- * Get the path to .mcp.json in the current project directory (project scope)
96
- */
97
- function get_project_mcp_json_path() {
98
- return join(get_current_project_path(), ".mcp.json");
99
- }
100
- function get_plugins_dir() {
101
- return join(get_base_dir().baseDir, "plugins");
102
- }
103
- function get_installed_plugins_path() {
104
- return join(get_plugins_dir(), "installed_plugins.json");
105
- }
106
- function get_known_marketplaces_path() {
107
- return join(get_plugins_dir(), "known_marketplaces.json");
108
- }
109
- function get_plugin_cache_dir() {
110
- return join(get_plugins_dir(), "cache");
111
- }
112
- function get_marketplaces_dir() {
113
- return join(get_plugins_dir(), "marketplaces");
114
- }
115
- function get_disabled_hooks_path() {
116
- return join(get_mcpick_dir(), "disabled-hooks.json");
117
- }
118
- function get_marketplace_manifest_path(name) {
119
- return join(get_marketplaces_dir(), name, ".claude-plugin", "marketplace.json");
120
- }
121
- //#endregion
122
- export { get_profiles_dir as _, get_claude_settings_path as a, paths_exports as b, get_disabled_hooks_path as c, get_marketplace_manifest_path as d, get_marketplaces_dir as f, get_profile_path as g, get_plugin_cache_dir as h, get_claude_config_path as i, get_installed_plugins_path as l, get_plugin_backup_filename as m, get_backup_filename as n, get_current_project_path as o, get_mcpick_dir as p, get_backups_dir as r, get_dev_overrides_path as s, ensure_directory_exists as t, get_known_marketplaces_path as u, get_project_mcp_json_path as v, get_server_registry_path as y };
123
-
124
- //# sourceMappingURL=paths-BPISiJi4.js.map