@mcp-z/cli 1.0.4 → 1.0.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.
@@ -1,93 +0,0 @@
1
- /**
2
- * find-config.ts
3
- *
4
- * Find .mcp.json config file by searching up the directory tree.
5
- * Searches from cwd up to home directory (like Claude Code).
6
- */ "use strict";
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- Object.defineProperty(exports, "findConfigPath", {
11
- enumerable: true,
12
- get: function() {
13
- return findConfigPath;
14
- }
15
- });
16
- var _fs = /*#__PURE__*/ _interop_require_wildcard(require("fs"));
17
- var _modulerootsync = /*#__PURE__*/ _interop_require_default(require("module-root-sync"));
18
- var _os = /*#__PURE__*/ _interop_require_wildcard(require("os"));
19
- var _path = /*#__PURE__*/ _interop_require_wildcard(require("path"));
20
- function _interop_require_default(obj) {
21
- return obj && obj.__esModule ? obj : {
22
- default: obj
23
- };
24
- }
25
- function _getRequireWildcardCache(nodeInterop) {
26
- if (typeof WeakMap !== "function") return null;
27
- var cacheBabelInterop = new WeakMap();
28
- var cacheNodeInterop = new WeakMap();
29
- return (_getRequireWildcardCache = function(nodeInterop) {
30
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
31
- })(nodeInterop);
32
- }
33
- function _interop_require_wildcard(obj, nodeInterop) {
34
- if (!nodeInterop && obj && obj.__esModule) {
35
- return obj;
36
- }
37
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
38
- return {
39
- default: obj
40
- };
41
- }
42
- var cache = _getRequireWildcardCache(nodeInterop);
43
- if (cache && cache.has(obj)) {
44
- return cache.get(obj);
45
- }
46
- var newObj = {
47
- __proto__: null
48
- };
49
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
50
- for(var key in obj){
51
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
52
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
53
- if (desc && (desc.get || desc.set)) {
54
- Object.defineProperty(newObj, key, desc);
55
- } else {
56
- newObj[key] = obj[key];
57
- }
58
- }
59
- }
60
- newObj.default = obj;
61
- if (cache) {
62
- cache.set(obj, newObj);
63
- }
64
- return newObj;
65
- }
66
- var CONFIG_NAME = '.mcp.json';
67
- function findConfigPath(explicitPath) {
68
- // If explicit path provided, validate it exists
69
- if (explicitPath) {
70
- var resolvedPath = _path.resolve(explicitPath);
71
- if (!_fs.existsSync(resolvedPath)) {
72
- throw new Error("Config file not found: ".concat(resolvedPath));
73
- }
74
- return resolvedPath;
75
- }
76
- var cwd = process.cwd();
77
- var homeDir = _os.homedir();
78
- // Use module-root-sync with custom file name to search up
79
- try {
80
- var configDir = (0, _modulerootsync.default)(cwd, {
81
- name: CONFIG_NAME
82
- });
83
- var configPath = _path.join(configDir, CONFIG_NAME);
84
- // Ensure we haven't gone above home directory
85
- if (!configPath.startsWith(homeDir)) {
86
- throw new Error("Config file not found in directory tree (searched from ".concat(cwd, " to ").concat(homeDir, ")"));
87
- }
88
- return configPath;
89
- } catch (_) {
90
- throw new Error("Config file not found: ".concat(CONFIG_NAME, "\n\nSearched from ").concat(cwd, " up to ").concat(homeDir));
91
- }
92
- }
93
- /* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/Projects/mcp-z/cli/src/lib/find-config.ts"],"sourcesContent":["/**\n * find-config.ts\n *\n * Find .mcp.json config file by searching up the directory tree.\n * Searches from cwd up to home directory (like Claude Code).\n */\n\nimport * as fs from 'fs';\nimport moduleRoot from 'module-root-sync';\nimport * as os from 'os';\nimport * as path from 'path';\n\nconst CONFIG_NAME = '.mcp.json';\n\n/**\n * Find .mcp.json by searching up directory tree from cwd to home directory.\n *\n * @param explicitPath - If provided, validates and returns this path (for --config flag)\n * @returns The resolved path to the config file\n * @throws Error if config file not found\n */\nexport function findConfigPath(explicitPath?: string): string {\n // If explicit path provided, validate it exists\n if (explicitPath) {\n const resolvedPath = path.resolve(explicitPath);\n if (!fs.existsSync(resolvedPath)) {\n throw new Error(`Config file not found: ${resolvedPath}`);\n }\n return resolvedPath;\n }\n\n const cwd = process.cwd();\n const homeDir = os.homedir();\n\n // Use module-root-sync with custom file name to search up\n try {\n const configDir = moduleRoot(cwd, { name: CONFIG_NAME });\n const configPath = path.join(configDir, CONFIG_NAME);\n\n // Ensure we haven't gone above home directory\n if (!configPath.startsWith(homeDir)) {\n throw new Error(`Config file not found in directory tree (searched from ${cwd} to ${homeDir})`);\n }\n\n return configPath;\n } catch (_) {\n throw new Error(`Config file not found: ${CONFIG_NAME}\\n\\nSearched from ${cwd} up to ${homeDir}`);\n }\n}\n"],"names":["findConfigPath","CONFIG_NAME","explicitPath","resolvedPath","path","resolve","fs","existsSync","Error","cwd","process","homeDir","os","homedir","configDir","moduleRoot","name","configPath","join","startsWith","_"],"mappings":"AAAA;;;;;CAKC;;;;+BAgBeA;;;eAAAA;;;0DAdI;qEACG;0DACH;4DACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtB,IAAMC,cAAc;AASb,SAASD,eAAeE,YAAqB;IAClD,gDAAgD;IAChD,IAAIA,cAAc;QAChB,IAAMC,eAAeC,MAAKC,OAAO,CAACH;QAClC,IAAI,CAACI,IAAGC,UAAU,CAACJ,eAAe;YAChC,MAAM,IAAIK,MAAM,AAAC,0BAAsC,OAAbL;QAC5C;QACA,OAAOA;IACT;IAEA,IAAMM,MAAMC,QAAQD,GAAG;IACvB,IAAME,UAAUC,IAAGC,OAAO;IAE1B,0DAA0D;IAC1D,IAAI;QACF,IAAMC,YAAYC,IAAAA,uBAAU,EAACN,KAAK;YAAEO,MAAMf;QAAY;QACtD,IAAMgB,aAAab,MAAKc,IAAI,CAACJ,WAAWb;QAExC,8CAA8C;QAC9C,IAAI,CAACgB,WAAWE,UAAU,CAACR,UAAU;YACnC,MAAM,IAAIH,MAAM,AAAC,0DAAmEG,OAAVF,KAAI,QAAc,OAARE,SAAQ;QAC9F;QAEA,OAAOM;IACT,EAAE,OAAOG,GAAG;QACV,MAAM,IAAIZ,MAAM,AAAC,0BAAyDC,OAAhCR,aAAY,sBAAiCU,OAAbF,KAAI,WAAiB,OAARE;IACzF;AACF"}
@@ -1,14 +0,0 @@
1
- /**
2
- * find-config.ts
3
- *
4
- * Find .mcp.json config file by searching up the directory tree.
5
- * Searches from cwd up to home directory (like Claude Code).
6
- */
7
- /**
8
- * Find .mcp.json by searching up directory tree from cwd to home directory.
9
- *
10
- * @param explicitPath - If provided, validates and returns this path (for --config flag)
11
- * @returns The resolved path to the config file
12
- * @throws Error if config file not found
13
- */
14
- export declare function findConfigPath(explicitPath?: string): string;
@@ -1,42 +0,0 @@
1
- /**
2
- * find-config.ts
3
- *
4
- * Find .mcp.json config file by searching up the directory tree.
5
- * Searches from cwd up to home directory (like Claude Code).
6
- */ import * as fs from 'fs';
7
- import moduleRoot from 'module-root-sync';
8
- import * as os from 'os';
9
- import * as path from 'path';
10
- const CONFIG_NAME = '.mcp.json';
11
- /**
12
- * Find .mcp.json by searching up directory tree from cwd to home directory.
13
- *
14
- * @param explicitPath - If provided, validates and returns this path (for --config flag)
15
- * @returns The resolved path to the config file
16
- * @throws Error if config file not found
17
- */ export function findConfigPath(explicitPath) {
18
- // If explicit path provided, validate it exists
19
- if (explicitPath) {
20
- const resolvedPath = path.resolve(explicitPath);
21
- if (!fs.existsSync(resolvedPath)) {
22
- throw new Error(`Config file not found: ${resolvedPath}`);
23
- }
24
- return resolvedPath;
25
- }
26
- const cwd = process.cwd();
27
- const homeDir = os.homedir();
28
- // Use module-root-sync with custom file name to search up
29
- try {
30
- const configDir = moduleRoot(cwd, {
31
- name: CONFIG_NAME
32
- });
33
- const configPath = path.join(configDir, CONFIG_NAME);
34
- // Ensure we haven't gone above home directory
35
- if (!configPath.startsWith(homeDir)) {
36
- throw new Error(`Config file not found in directory tree (searched from ${cwd} to ${homeDir})`);
37
- }
38
- return configPath;
39
- } catch (_) {
40
- throw new Error(`Config file not found: ${CONFIG_NAME}\n\nSearched from ${cwd} up to ${homeDir}`);
41
- }
42
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/Projects/mcp-z/cli/src/lib/find-config.ts"],"sourcesContent":["/**\n * find-config.ts\n *\n * Find .mcp.json config file by searching up the directory tree.\n * Searches from cwd up to home directory (like Claude Code).\n */\n\nimport * as fs from 'fs';\nimport moduleRoot from 'module-root-sync';\nimport * as os from 'os';\nimport * as path from 'path';\n\nconst CONFIG_NAME = '.mcp.json';\n\n/**\n * Find .mcp.json by searching up directory tree from cwd to home directory.\n *\n * @param explicitPath - If provided, validates and returns this path (for --config flag)\n * @returns The resolved path to the config file\n * @throws Error if config file not found\n */\nexport function findConfigPath(explicitPath?: string): string {\n // If explicit path provided, validate it exists\n if (explicitPath) {\n const resolvedPath = path.resolve(explicitPath);\n if (!fs.existsSync(resolvedPath)) {\n throw new Error(`Config file not found: ${resolvedPath}`);\n }\n return resolvedPath;\n }\n\n const cwd = process.cwd();\n const homeDir = os.homedir();\n\n // Use module-root-sync with custom file name to search up\n try {\n const configDir = moduleRoot(cwd, { name: CONFIG_NAME });\n const configPath = path.join(configDir, CONFIG_NAME);\n\n // Ensure we haven't gone above home directory\n if (!configPath.startsWith(homeDir)) {\n throw new Error(`Config file not found in directory tree (searched from ${cwd} to ${homeDir})`);\n }\n\n return configPath;\n } catch (_) {\n throw new Error(`Config file not found: ${CONFIG_NAME}\\n\\nSearched from ${cwd} up to ${homeDir}`);\n }\n}\n"],"names":["fs","moduleRoot","os","path","CONFIG_NAME","findConfigPath","explicitPath","resolvedPath","resolve","existsSync","Error","cwd","process","homeDir","homedir","configDir","name","configPath","join","startsWith","_"],"mappings":"AAAA;;;;;CAKC,GAED,YAAYA,QAAQ,KAAK;AACzB,OAAOC,gBAAgB,mBAAmB;AAC1C,YAAYC,QAAQ,KAAK;AACzB,YAAYC,UAAU,OAAO;AAE7B,MAAMC,cAAc;AAEpB;;;;;;CAMC,GACD,OAAO,SAASC,eAAeC,YAAqB;IAClD,gDAAgD;IAChD,IAAIA,cAAc;QAChB,MAAMC,eAAeJ,KAAKK,OAAO,CAACF;QAClC,IAAI,CAACN,GAAGS,UAAU,CAACF,eAAe;YAChC,MAAM,IAAIG,MAAM,CAAC,uBAAuB,EAAEH,cAAc;QAC1D;QACA,OAAOA;IACT;IAEA,MAAMI,MAAMC,QAAQD,GAAG;IACvB,MAAME,UAAUX,GAAGY,OAAO;IAE1B,0DAA0D;IAC1D,IAAI;QACF,MAAMC,YAAYd,WAAWU,KAAK;YAAEK,MAAMZ;QAAY;QACtD,MAAMa,aAAad,KAAKe,IAAI,CAACH,WAAWX;QAExC,8CAA8C;QAC9C,IAAI,CAACa,WAAWE,UAAU,CAACN,UAAU;YACnC,MAAM,IAAIH,MAAM,CAAC,uDAAuD,EAAEC,IAAI,IAAI,EAAEE,QAAQ,CAAC,CAAC;QAChG;QAEA,OAAOI;IACT,EAAE,OAAOG,GAAG;QACV,MAAM,IAAIV,MAAM,CAAC,uBAAuB,EAAEN,YAAY,kBAAkB,EAAEO,IAAI,OAAO,EAAEE,SAAS;IAClG;AACF"}