mcpick 0.0.22 → 0.0.24

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 (45) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +4 -0
  3. package/dist/add-Qzd8i-5k.js +184 -0
  4. package/dist/add-json-DGmsjB0O.js +115 -0
  5. package/dist/{backup-bdg6dvsb.js → backup-C7fvikFw.js} +5 -5
  6. package/dist/{cache-CSUcGdZP.js → cache-D3jjh5dD.js} +3 -3
  7. package/dist/{cli-avr5R1LO.js → cli-CZOlaqoZ.js} +22 -21
  8. package/dist/{clients-CSQgqHzb.js → clients-Bh93TGP4.js} +3 -3
  9. package/dist/{clone-CQ0skkT6.js → clone-MI8jJhTz.js} +6 -6
  10. package/dist/{config-BhX4eAgg.js → config-DE58Fik_.js} +4 -4
  11. package/dist/{dev-CTDg5g-c.js → dev-51esdZG9.js} +6 -6
  12. package/dist/disable-csYAn2Vk.js +106 -0
  13. package/dist/dry-run-XQ32fxPT.js +20 -0
  14. package/dist/enable-B5GbmhL-.js +107 -0
  15. package/dist/{get-l-eAJhBy.js → get-DacRZmwv.js} +3 -3
  16. package/dist/{hooks-BWZ_Kgx3.js → hooks-C_x49qap.js} +3 -4
  17. package/dist/index.js +717 -116
  18. package/dist/{list-By--kltj.js → list-BeBtsiae.js} +5 -5
  19. package/dist/{marketplace-DdiKDDKK.js → marketplace-BDC2YtvT.js} +4 -4
  20. package/dist/{output-BgN9Uuxf.js → output-HtT5HCof.js} +2 -2
  21. package/dist/{paths-6wrIM8yh.js → paths-BPISiJi4.js} +1 -1
  22. package/dist/{plugin-cache-DKcW8LGV.js → plugin-cache-DmLbh89d.js} +35 -16
  23. package/dist/{plugins-CsXE8AH4.js → plugins-Bkw-SKkZ.js} +4 -5
  24. package/dist/profile-DwJTVXiz.js +161 -0
  25. package/dist/{redact-Dltz2gde.js → redact-wBMtzbno.js} +1 -1
  26. package/dist/{reload-C29-vuvy.js → reload-Bl1mYK1I.js} +2 -2
  27. package/dist/remove-BSHgva79.js +107 -0
  28. package/dist/{reset-project-choices-Dhh4CxIC.js → reset-project-choices-BNLus9J9.js} +3 -3
  29. package/dist/{restore-BI8aiszM.js → restore-YisgARhc.js} +5 -6
  30. package/dist/rollback-GR1RkpXW.js +55 -0
  31. package/dist/{skills-DPBDmION.js → skills-rDTDqqZA.js} +3 -3
  32. package/dist/{validation-qWlF51fw.js → validation-xMlbgGCF.js} +1 -1
  33. package/package.json +4 -4
  34. package/.github/copilot-instructions.md +0 -50
  35. package/.github/workflows/ci.yml +0 -26
  36. package/.vscode/settings.json +0 -5
  37. package/CONTEXT.md +0 -49
  38. package/dist/add-Bok0qbXi.js +0 -112
  39. package/dist/add-json-C44vy2A_.js +0 -58
  40. package/dist/atomic-write-4lANmzsO.js +0 -26
  41. package/dist/disable-DLlOj7sc.js +0 -38
  42. package/dist/enable-CGFYYC2A.js +0 -39
  43. package/dist/profile-DzGPsdsl.js +0 -120
  44. package/dist/remove-B5q4rQRU.js +0 -30
  45. package/dist/settings-CZR8bVfh.js +0 -201
@@ -1,201 +0,0 @@
1
- import { t as atomic_json_write } from "./atomic-write-4lANmzsO.js";
2
- import { a as get_claude_settings_path } from "./paths-6wrIM8yh.js";
3
- import { access, readFile } from "node:fs/promises";
4
- import { join, resolve } from "node:path";
5
- //#region src/core/settings.ts
6
- async function read_claude_settings() {
7
- const settings_path = get_claude_settings_path();
8
- try {
9
- await access(settings_path);
10
- const content = await readFile(settings_path, "utf-8");
11
- return JSON.parse(content);
12
- } catch (error) {
13
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return {};
14
- throw error;
15
- }
16
- }
17
- async function write_claude_settings(updates) {
18
- await atomic_json_write(get_claude_settings_path(), (existing) => {
19
- for (const [key, value] of Object.entries(updates)) existing[key] = value;
20
- return existing;
21
- });
22
- }
23
- /**
24
- * Parse enabledPlugins into structured list.
25
- * Keys are in format "plugin-name@marketplace-name"
26
- */
27
- function get_all_plugins(settings) {
28
- const enabled_plugins = settings.enabledPlugins || {};
29
- return Object.entries(enabled_plugins).map(([key, enabled]) => {
30
- const at_index = key.lastIndexOf("@");
31
- return {
32
- name: at_index > 0 ? key.substring(0, at_index) : key,
33
- marketplace: at_index > 0 ? key.substring(at_index + 1) : "unknown",
34
- enabled
35
- };
36
- });
37
- }
38
- /**
39
- * Build the enabledPlugins record from a list of PluginInfo
40
- */
41
- function build_enabled_plugins(plugins) {
42
- const result = {};
43
- for (const plugin of plugins) {
44
- const key = `${plugin.name}@${plugin.marketplace}`;
45
- result[key] = plugin.enabled;
46
- }
47
- return result;
48
- }
49
- async function read_settings_file(path) {
50
- try {
51
- await access(path);
52
- const content = await readFile(path, "utf-8");
53
- return JSON.parse(content);
54
- } catch {
55
- return {};
56
- }
57
- }
58
- function get_settings_paths() {
59
- return [
60
- {
61
- scope: "user",
62
- path: resolve(process.env.HOME || process.env.USERPROFILE || "", ".claude", "settings.json")
63
- },
64
- {
65
- scope: "project",
66
- path: resolve(process.cwd(), ".claude", "settings.json")
67
- },
68
- {
69
- scope: "project-local",
70
- path: resolve(process.cwd(), ".claude", "settings.local.json")
71
- }
72
- ];
73
- }
74
- /**
75
- * Read all hooks across all scopes (settings + plugins), flattened for display.
76
- */
77
- async function get_all_hooks() {
78
- const entries = [];
79
- for (const { scope, path } of get_settings_paths()) {
80
- const hooks = (await read_settings_file(path)).hooks;
81
- if (!hooks) continue;
82
- for (const [event, matchers] of Object.entries(hooks)) {
83
- if (!Array.isArray(matchers)) continue;
84
- for (let mi = 0; mi < matchers.length; mi++) {
85
- const m = matchers[mi];
86
- if (!m.hooks?.length) continue;
87
- for (let hi = 0; hi < m.hooks.length; hi++) entries.push({
88
- event,
89
- matcher: m.matcher,
90
- handler: m.hooks[hi],
91
- scope,
92
- source: scope,
93
- matcher_index: mi,
94
- hook_index: hi
95
- });
96
- }
97
- }
98
- }
99
- const plugin_hooks = await get_all_plugin_hooks();
100
- entries.push(...plugin_hooks);
101
- return entries;
102
- }
103
- /**
104
- * Scan all installed plugins for hooks.json and return flattened hook entries.
105
- * Checks both cache and marketplace source paths since Claude Code reads from both.
106
- */
107
- async function get_all_plugin_hooks() {
108
- const { read_installed_plugins } = await import("./plugin-cache-DKcW8LGV.js").then((n) => n.s);
109
- const { get_marketplaces_dir } = await import("./paths-6wrIM8yh.js").then((n) => n.b);
110
- const installed = await read_installed_plugins();
111
- const entries = [];
112
- const seen_hooks = /* @__PURE__ */ new Set();
113
- for (const [plugin_key, installs] of Object.entries(installed.plugins)) {
114
- if (!installs?.length) continue;
115
- const install = installs[0];
116
- const at_index = plugin_key.lastIndexOf("@");
117
- const plugin_name = at_index > 0 ? plugin_key.substring(0, at_index) : plugin_key;
118
- const marketplace_name = at_index > 0 ? plugin_key.substring(at_index + 1) : "";
119
- const hooks_paths = [join(install.installPath, "hooks", "hooks.json")];
120
- if (marketplace_name) hooks_paths.push(join(get_marketplaces_dir(), marketplace_name, "plugins", plugin_name, "hooks", "hooks.json"));
121
- for (const hooks_path of hooks_paths) {
122
- let hooks_data;
123
- try {
124
- const content = await readFile(hooks_path, "utf-8");
125
- hooks_data = JSON.parse(content);
126
- } catch {
127
- continue;
128
- }
129
- const hooks = hooks_data.hooks || hooks_data;
130
- for (const [event, matchers] of Object.entries(hooks)) {
131
- if (!Array.isArray(matchers)) continue;
132
- for (let mi = 0; mi < matchers.length; mi++) {
133
- const m = matchers[mi];
134
- if (!m.hooks?.length) continue;
135
- for (let hi = 0; hi < m.hooks.length; hi++) {
136
- const h = m.hooks[hi];
137
- const dedup_key = `${plugin_key}:${event}:${h.type}:${h.command || h.url || h.prompt}`;
138
- if (seen_hooks.has(dedup_key)) continue;
139
- seen_hooks.add(dedup_key);
140
- entries.push({
141
- event,
142
- matcher: m.matcher,
143
- handler: h,
144
- scope: "user",
145
- source: "plugin",
146
- matcher_index: mi,
147
- hook_index: hi,
148
- plugin_key,
149
- hooks_json_path: hooks_path
150
- });
151
- }
152
- }
153
- }
154
- }
155
- }
156
- return entries;
157
- }
158
- /**
159
- * Remove a specific hook entry by scope/event/indices.
160
- */
161
- async function remove_hook(entry) {
162
- const scope_path = get_settings_paths().find((s) => s.scope === entry.scope);
163
- if (!scope_path) throw new Error(`Unknown scope: ${entry.scope}`);
164
- await atomic_json_write(scope_path.path, (existing) => {
165
- const hooks = existing.hooks;
166
- if (!hooks) return existing;
167
- const matchers = hooks[entry.event];
168
- if (!matchers?.[entry.matcher_index]) return existing;
169
- const matcher = matchers[entry.matcher_index];
170
- matcher.hooks.splice(entry.hook_index, 1);
171
- if (matcher.hooks.length === 0) matchers.splice(entry.matcher_index, 1);
172
- if (matchers.length === 0) delete hooks[entry.event];
173
- if (Object.keys(hooks).length === 0) delete existing.hooks;
174
- return existing;
175
- });
176
- }
177
- /**
178
- * Add a hook to a specific scope.
179
- */
180
- async function add_hook(scope, event, matcher, handler) {
181
- const scope_path = get_settings_paths().find((s) => s.scope === scope);
182
- if (!scope_path) throw new Error(`Unknown scope: ${scope}`);
183
- await atomic_json_write(scope_path.path, (existing) => {
184
- if (!existing.hooks) existing.hooks = {};
185
- const hooks = existing.hooks;
186
- if (!hooks[event]) hooks[event] = [];
187
- const matchers = hooks[event];
188
- const existing_matcher = matchers.find((m) => (m.matcher || void 0) === matcher);
189
- if (existing_matcher) existing_matcher.hooks.push(handler);
190
- else {
191
- const new_matcher = { hooks: [handler] };
192
- if (matcher) new_matcher.matcher = matcher;
193
- matchers.push(new_matcher);
194
- }
195
- return existing;
196
- });
197
- }
198
- //#endregion
199
- export { read_claude_settings as a, get_all_plugins as i, build_enabled_plugins as n, remove_hook as o, get_all_hooks as r, write_claude_settings as s, add_hook as t };
200
-
201
- //# sourceMappingURL=settings-CZR8bVfh.js.map