@vailent/pulse-mcp 1.0.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.
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __commonJS = (cb, mod) => function __require2() {
15
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ };
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, { get: all[name], enumerable: true });
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
+ // If the importer is in node compatibility mode or this is not an ESM
31
+ // file that has been converted to a CommonJS file using a Babel-
32
+ // compatible transform (i.e. "__esModule" has not been set), then set
33
+ // "default" to the CommonJS "module.exports" for node compatibility.
34
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
+ mod
36
+ ));
37
+
38
+ export {
39
+ __require,
40
+ __commonJS,
41
+ __export,
42
+ __toESM
43
+ };
@@ -0,0 +1,459 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ __commonJS,
4
+ __require
5
+ } from "./chunk-77HVPD4G.js";
6
+
7
+ // ../../node_modules/dotenv/package.json
8
+ var require_package = __commonJS({
9
+ "../../node_modules/dotenv/package.json"(exports, module) {
10
+ module.exports = {
11
+ name: "dotenv",
12
+ version: "17.3.1",
13
+ description: "Loads environment variables from .env file",
14
+ main: "lib/main.js",
15
+ types: "lib/main.d.ts",
16
+ exports: {
17
+ ".": {
18
+ types: "./lib/main.d.ts",
19
+ require: "./lib/main.js",
20
+ default: "./lib/main.js"
21
+ },
22
+ "./config": "./config.js",
23
+ "./config.js": "./config.js",
24
+ "./lib/env-options": "./lib/env-options.js",
25
+ "./lib/env-options.js": "./lib/env-options.js",
26
+ "./lib/cli-options": "./lib/cli-options.js",
27
+ "./lib/cli-options.js": "./lib/cli-options.js",
28
+ "./package.json": "./package.json"
29
+ },
30
+ scripts: {
31
+ "dts-check": "tsc --project tests/types/tsconfig.json",
32
+ lint: "standard",
33
+ pretest: "npm run lint && npm run dts-check",
34
+ test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
35
+ "test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
36
+ prerelease: "npm test",
37
+ release: "standard-version"
38
+ },
39
+ repository: {
40
+ type: "git",
41
+ url: "git://github.com/motdotla/dotenv.git"
42
+ },
43
+ homepage: "https://github.com/motdotla/dotenv#readme",
44
+ funding: "https://dotenvx.com",
45
+ keywords: [
46
+ "dotenv",
47
+ "env",
48
+ ".env",
49
+ "environment",
50
+ "variables",
51
+ "config",
52
+ "settings"
53
+ ],
54
+ readmeFilename: "README.md",
55
+ license: "BSD-2-Clause",
56
+ devDependencies: {
57
+ "@types/node": "^18.11.3",
58
+ decache: "^4.6.2",
59
+ sinon: "^14.0.1",
60
+ standard: "^17.0.0",
61
+ "standard-version": "^9.5.0",
62
+ tap: "^19.2.0",
63
+ typescript: "^4.8.4"
64
+ },
65
+ engines: {
66
+ node: ">=12"
67
+ },
68
+ browser: {
69
+ fs: false
70
+ }
71
+ };
72
+ }
73
+ });
74
+
75
+ // ../../node_modules/dotenv/lib/main.js
76
+ var require_main = __commonJS({
77
+ "../../node_modules/dotenv/lib/main.js"(exports, module) {
78
+ "use strict";
79
+ var fs = __require("fs");
80
+ var path = __require("path");
81
+ var os = __require("os");
82
+ var crypto = __require("crypto");
83
+ var packageJson = require_package();
84
+ var version = packageJson.version;
85
+ var TIPS = [
86
+ "\u{1F510} encrypt with Dotenvx: https://dotenvx.com",
87
+ "\u{1F510} prevent committing .env to code: https://dotenvx.com/precommit",
88
+ "\u{1F510} prevent building .env in docker: https://dotenvx.com/prebuild",
89
+ "\u{1F916} agentic secret storage: https://dotenvx.com/as2",
90
+ "\u26A1\uFE0F secrets for agents: https://dotenvx.com/as2",
91
+ "\u{1F6E1}\uFE0F auth for agents: https://vestauth.com",
92
+ "\u{1F6E0}\uFE0F run anywhere with `dotenvx run -- yourcommand`",
93
+ "\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }",
94
+ "\u2699\uFE0F enable debug logging with { debug: true }",
95
+ "\u2699\uFE0F override existing env vars with { override: true }",
96
+ "\u2699\uFE0F suppress all logs with { quiet: true }",
97
+ "\u2699\uFE0F write to custom object with { processEnv: myObject }",
98
+ "\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }"
99
+ ];
100
+ function _getRandomTip() {
101
+ return TIPS[Math.floor(Math.random() * TIPS.length)];
102
+ }
103
+ function parseBoolean(value) {
104
+ if (typeof value === "string") {
105
+ return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
106
+ }
107
+ return Boolean(value);
108
+ }
109
+ function supportsAnsi() {
110
+ return process.stdout.isTTY;
111
+ }
112
+ function dim(text) {
113
+ return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
114
+ }
115
+ var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
116
+ function parse(src) {
117
+ const obj = {};
118
+ let lines = src.toString();
119
+ lines = lines.replace(/\r\n?/mg, "\n");
120
+ let match;
121
+ while ((match = LINE.exec(lines)) != null) {
122
+ const key = match[1];
123
+ let value = match[2] || "";
124
+ value = value.trim();
125
+ const maybeQuote = value[0];
126
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
127
+ if (maybeQuote === '"') {
128
+ value = value.replace(/\\n/g, "\n");
129
+ value = value.replace(/\\r/g, "\r");
130
+ }
131
+ obj[key] = value;
132
+ }
133
+ return obj;
134
+ }
135
+ function _parseVault(options) {
136
+ options = options || {};
137
+ const vaultPath = _vaultPath(options);
138
+ options.path = vaultPath;
139
+ const result = DotenvModule.configDotenv(options);
140
+ if (!result.parsed) {
141
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
142
+ err.code = "MISSING_DATA";
143
+ throw err;
144
+ }
145
+ const keys = _dotenvKey(options).split(",");
146
+ const length = keys.length;
147
+ let decrypted;
148
+ for (let i = 0; i < length; i++) {
149
+ try {
150
+ const key = keys[i].trim();
151
+ const attrs = _instructions(result, key);
152
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
153
+ break;
154
+ } catch (error) {
155
+ if (i + 1 >= length) {
156
+ throw error;
157
+ }
158
+ }
159
+ }
160
+ return DotenvModule.parse(decrypted);
161
+ }
162
+ function _warn(message) {
163
+ console.error(`[dotenv@${version}][WARN] ${message}`);
164
+ }
165
+ function _debug(message) {
166
+ console.log(`[dotenv@${version}][DEBUG] ${message}`);
167
+ }
168
+ function _log(message) {
169
+ console.log(`[dotenv@${version}] ${message}`);
170
+ }
171
+ function _dotenvKey(options) {
172
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
173
+ return options.DOTENV_KEY;
174
+ }
175
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
176
+ return process.env.DOTENV_KEY;
177
+ }
178
+ return "";
179
+ }
180
+ function _instructions(result, dotenvKey) {
181
+ let uri;
182
+ try {
183
+ uri = new URL(dotenvKey);
184
+ } catch (error) {
185
+ if (error.code === "ERR_INVALID_URL") {
186
+ const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
187
+ err.code = "INVALID_DOTENV_KEY";
188
+ throw err;
189
+ }
190
+ throw error;
191
+ }
192
+ const key = uri.password;
193
+ if (!key) {
194
+ const err = new Error("INVALID_DOTENV_KEY: Missing key part");
195
+ err.code = "INVALID_DOTENV_KEY";
196
+ throw err;
197
+ }
198
+ const environment = uri.searchParams.get("environment");
199
+ if (!environment) {
200
+ const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
201
+ err.code = "INVALID_DOTENV_KEY";
202
+ throw err;
203
+ }
204
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
205
+ const ciphertext = result.parsed[environmentKey];
206
+ if (!ciphertext) {
207
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
208
+ err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
209
+ throw err;
210
+ }
211
+ return { ciphertext, key };
212
+ }
213
+ function _vaultPath(options) {
214
+ let possibleVaultPath = null;
215
+ if (options && options.path && options.path.length > 0) {
216
+ if (Array.isArray(options.path)) {
217
+ for (const filepath of options.path) {
218
+ if (fs.existsSync(filepath)) {
219
+ possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
220
+ }
221
+ }
222
+ } else {
223
+ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
224
+ }
225
+ } else {
226
+ possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
227
+ }
228
+ if (fs.existsSync(possibleVaultPath)) {
229
+ return possibleVaultPath;
230
+ }
231
+ return null;
232
+ }
233
+ function _resolveHome(envPath) {
234
+ return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
235
+ }
236
+ function _configVault(options) {
237
+ const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
238
+ const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
239
+ if (debug || !quiet) {
240
+ _log("Loading env from encrypted .env.vault");
241
+ }
242
+ const parsed = DotenvModule._parseVault(options);
243
+ let processEnv = process.env;
244
+ if (options && options.processEnv != null) {
245
+ processEnv = options.processEnv;
246
+ }
247
+ DotenvModule.populate(processEnv, parsed, options);
248
+ return { parsed };
249
+ }
250
+ function configDotenv(options) {
251
+ const dotenvPath = path.resolve(process.cwd(), ".env");
252
+ let encoding = "utf8";
253
+ let processEnv = process.env;
254
+ if (options && options.processEnv != null) {
255
+ processEnv = options.processEnv;
256
+ }
257
+ let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
258
+ let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
259
+ if (options && options.encoding) {
260
+ encoding = options.encoding;
261
+ } else {
262
+ if (debug) {
263
+ _debug("No encoding is specified. UTF-8 is used by default");
264
+ }
265
+ }
266
+ let optionPaths = [dotenvPath];
267
+ if (options && options.path) {
268
+ if (!Array.isArray(options.path)) {
269
+ optionPaths = [_resolveHome(options.path)];
270
+ } else {
271
+ optionPaths = [];
272
+ for (const filepath of options.path) {
273
+ optionPaths.push(_resolveHome(filepath));
274
+ }
275
+ }
276
+ }
277
+ let lastError;
278
+ const parsedAll = {};
279
+ for (const path2 of optionPaths) {
280
+ try {
281
+ const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding }));
282
+ DotenvModule.populate(parsedAll, parsed, options);
283
+ } catch (e) {
284
+ if (debug) {
285
+ _debug(`Failed to load ${path2} ${e.message}`);
286
+ }
287
+ lastError = e;
288
+ }
289
+ }
290
+ const populated = DotenvModule.populate(processEnv, parsedAll, options);
291
+ debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
292
+ quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
293
+ if (debug || !quiet) {
294
+ const keysCount = Object.keys(populated).length;
295
+ const shortPaths = [];
296
+ for (const filePath of optionPaths) {
297
+ try {
298
+ const relative = path.relative(process.cwd(), filePath);
299
+ shortPaths.push(relative);
300
+ } catch (e) {
301
+ if (debug) {
302
+ _debug(`Failed to load ${filePath} ${e.message}`);
303
+ }
304
+ lastError = e;
305
+ }
306
+ }
307
+ _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
308
+ }
309
+ if (lastError) {
310
+ return { parsed: parsedAll, error: lastError };
311
+ } else {
312
+ return { parsed: parsedAll };
313
+ }
314
+ }
315
+ function config(options) {
316
+ if (_dotenvKey(options).length === 0) {
317
+ return DotenvModule.configDotenv(options);
318
+ }
319
+ const vaultPath = _vaultPath(options);
320
+ if (!vaultPath) {
321
+ _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
322
+ return DotenvModule.configDotenv(options);
323
+ }
324
+ return DotenvModule._configVault(options);
325
+ }
326
+ function decrypt(encrypted, keyStr) {
327
+ const key = Buffer.from(keyStr.slice(-64), "hex");
328
+ let ciphertext = Buffer.from(encrypted, "base64");
329
+ const nonce = ciphertext.subarray(0, 12);
330
+ const authTag = ciphertext.subarray(-16);
331
+ ciphertext = ciphertext.subarray(12, -16);
332
+ try {
333
+ const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
334
+ aesgcm.setAuthTag(authTag);
335
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
336
+ } catch (error) {
337
+ const isRange = error instanceof RangeError;
338
+ const invalidKeyLength = error.message === "Invalid key length";
339
+ const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
340
+ if (isRange || invalidKeyLength) {
341
+ const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
342
+ err.code = "INVALID_DOTENV_KEY";
343
+ throw err;
344
+ } else if (decryptionFailed) {
345
+ const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
346
+ err.code = "DECRYPTION_FAILED";
347
+ throw err;
348
+ } else {
349
+ throw error;
350
+ }
351
+ }
352
+ }
353
+ function populate(processEnv, parsed, options = {}) {
354
+ const debug = Boolean(options && options.debug);
355
+ const override = Boolean(options && options.override);
356
+ const populated = {};
357
+ if (typeof parsed !== "object") {
358
+ const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
359
+ err.code = "OBJECT_REQUIRED";
360
+ throw err;
361
+ }
362
+ for (const key of Object.keys(parsed)) {
363
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
364
+ if (override === true) {
365
+ processEnv[key] = parsed[key];
366
+ populated[key] = parsed[key];
367
+ }
368
+ if (debug) {
369
+ if (override === true) {
370
+ _debug(`"${key}" is already defined and WAS overwritten`);
371
+ } else {
372
+ _debug(`"${key}" is already defined and was NOT overwritten`);
373
+ }
374
+ }
375
+ } else {
376
+ processEnv[key] = parsed[key];
377
+ populated[key] = parsed[key];
378
+ }
379
+ }
380
+ return populated;
381
+ }
382
+ var DotenvModule = {
383
+ configDotenv,
384
+ _configVault,
385
+ _parseVault,
386
+ config,
387
+ decrypt,
388
+ parse,
389
+ populate
390
+ };
391
+ module.exports.configDotenv = DotenvModule.configDotenv;
392
+ module.exports._configVault = DotenvModule._configVault;
393
+ module.exports._parseVault = DotenvModule._parseVault;
394
+ module.exports.config = DotenvModule.config;
395
+ module.exports.decrypt = DotenvModule.decrypt;
396
+ module.exports.parse = DotenvModule.parse;
397
+ module.exports.populate = DotenvModule.populate;
398
+ module.exports = DotenvModule;
399
+ }
400
+ });
401
+
402
+ // ../../node_modules/dotenv/lib/env-options.js
403
+ var require_env_options = __commonJS({
404
+ "../../node_modules/dotenv/lib/env-options.js"(exports, module) {
405
+ "use strict";
406
+ var options = {};
407
+ if (process.env.DOTENV_CONFIG_ENCODING != null) {
408
+ options.encoding = process.env.DOTENV_CONFIG_ENCODING;
409
+ }
410
+ if (process.env.DOTENV_CONFIG_PATH != null) {
411
+ options.path = process.env.DOTENV_CONFIG_PATH;
412
+ }
413
+ if (process.env.DOTENV_CONFIG_QUIET != null) {
414
+ options.quiet = process.env.DOTENV_CONFIG_QUIET;
415
+ }
416
+ if (process.env.DOTENV_CONFIG_DEBUG != null) {
417
+ options.debug = process.env.DOTENV_CONFIG_DEBUG;
418
+ }
419
+ if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
420
+ options.override = process.env.DOTENV_CONFIG_OVERRIDE;
421
+ }
422
+ if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
423
+ options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;
424
+ }
425
+ module.exports = options;
426
+ }
427
+ });
428
+
429
+ // ../../node_modules/dotenv/lib/cli-options.js
430
+ var require_cli_options = __commonJS({
431
+ "../../node_modules/dotenv/lib/cli-options.js"(exports, module) {
432
+ "use strict";
433
+ var re = /^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/;
434
+ module.exports = function optionMatcher(args) {
435
+ const options = args.reduce(function(acc, cur) {
436
+ const matches = cur.match(re);
437
+ if (matches) {
438
+ acc[matches[1]] = matches[2];
439
+ }
440
+ return acc;
441
+ }, {});
442
+ if (!("quiet" in options)) {
443
+ options.quiet = "true";
444
+ }
445
+ return options;
446
+ };
447
+ }
448
+ });
449
+
450
+ // ../../node_modules/dotenv/config.js
451
+ (function() {
452
+ require_main().config(
453
+ Object.assign(
454
+ {},
455
+ require_env_options(),
456
+ require_cli_options()(process.argv)
457
+ )
458
+ );
459
+ })();