mcpocket 0.1.0 → 0.2.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/CHANGELOG.md +30 -0
- package/LICENSE +1 -1
- package/README.md +309 -37
- package/dist/cli.js +30 -9
- package/dist/cli.js.map +1 -1
- package/dist/clients/antigravity.d.ts +5 -0
- package/dist/clients/antigravity.d.ts.map +1 -0
- package/dist/clients/antigravity.js +94 -0
- package/dist/clients/antigravity.js.map +1 -0
- package/dist/clients/claude-code.js +2 -2
- package/dist/clients/claude-desktop.js +2 -2
- package/dist/clients/codex.d.ts +5 -0
- package/dist/clients/codex.d.ts.map +1 -0
- package/dist/clients/codex.js +78 -0
- package/dist/clients/codex.js.map +1 -0
- package/dist/clients/copilot-cli.d.ts +5 -0
- package/dist/clients/copilot-cli.d.ts.map +1 -0
- package/dist/clients/copilot-cli.js +90 -0
- package/dist/clients/copilot-cli.js.map +1 -0
- package/dist/clients/cursor.d.ts +5 -0
- package/dist/clients/cursor.d.ts.map +1 -0
- package/dist/clients/cursor.js +77 -0
- package/dist/clients/cursor.js.map +1 -0
- package/dist/clients/opencode.js +2 -2
- package/dist/clients/providers.d.ts +7 -0
- package/dist/clients/providers.d.ts.map +1 -0
- package/dist/clients/providers.js +80 -0
- package/dist/clients/providers.js.map +1 -0
- package/dist/clients/types.d.ts +27 -1
- package/dist/clients/types.d.ts.map +1 -1
- package/dist/commands/dedupe.d.ts +2 -0
- package/dist/commands/dedupe.d.ts.map +1 -0
- package/dist/commands/dedupe.js +114 -0
- package/dist/commands/dedupe.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +111 -43
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/provider-options.d.ts +18 -0
- package/dist/commands/provider-options.d.ts.map +1 -0
- package/dist/commands/provider-options.js +34 -0
- package/dist/commands/provider-options.js.map +1 -0
- package/dist/commands/pull.d.ts +2 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +101 -72
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.d.ts +2 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +107 -51
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +38 -23
- package/dist/commands/status.js.map +1 -1
- package/dist/config.d.ts +11 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -9
- package/dist/config.js.map +1 -1
- package/dist/storage/gist.d.ts +21 -0
- package/dist/storage/gist.d.ts.map +1 -0
- package/dist/storage/gist.js +149 -0
- package/dist/storage/gist.js.map +1 -0
- package/dist/storage/github.d.ts +1 -1
- package/dist/storage/github.js +8 -8
- package/dist/sync/agents.d.ts +6 -2
- package/dist/sync/agents.d.ts.map +1 -1
- package/dist/sync/agents.js +35 -33
- package/dist/sync/agents.js.map +1 -1
- package/dist/sync/mcp.d.ts.map +1 -1
- package/dist/sync/mcp.js +75 -9
- package/dist/sync/mcp.js.map +1 -1
- package/dist/sync/plugins.d.ts +5 -1
- package/dist/sync/plugins.d.ts.map +1 -1
- package/dist/sync/plugins.js +16 -2
- package/dist/sync/plugins.js.map +1 -1
- package/dist/sync/pocket.d.ts +3 -0
- package/dist/sync/pocket.d.ts.map +1 -0
- package/dist/sync/pocket.js +16 -0
- package/dist/sync/pocket.js.map +1 -0
- package/dist/sync/skills.d.ts +3 -2
- package/dist/sync/skills.d.ts.map +1 -1
- package/dist/sync/skills.js +28 -18
- package/dist/sync/skills.js.map +1 -1
- package/dist/utils/crypto.d.ts +12 -1
- package/dist/utils/crypto.d.ts.map +1 -1
- package/dist/utils/crypto.js +19 -5
- package/dist/utils/crypto.js.map +1 -1
- package/dist/utils/files.d.ts +16 -0
- package/dist/utils/files.d.ts.map +1 -0
- package/dist/utils/files.js +168 -0
- package/dist/utils/files.js.map +1 -0
- package/dist/utils/paths.d.ts +20 -4
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +46 -11
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/sparkle.d.ts +60 -0
- package/dist/utils/sparkle.d.ts.map +1 -0
- package/dist/utils/sparkle.js +131 -0
- package/dist/utils/sparkle.js.map +1 -0
- package/package.json +6 -4
package/dist/utils/crypto.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare function encrypt(plaintext: string, passphrase: string): string;
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function decrypt(encryptedValue: string, passphrase: string): string;
|
|
12
12
|
/**
|
|
13
|
-
* Returns true if the value is an encrypted
|
|
13
|
+
* Returns true if the value is an encrypted mcpocket secret.
|
|
14
14
|
*/
|
|
15
15
|
export declare function isEncrypted(value: string): boolean;
|
|
16
16
|
/**
|
|
@@ -21,8 +21,19 @@ export declare function encryptEnv(env: Record<string, string>, passphrase: stri
|
|
|
21
21
|
encrypted: Record<string, string>;
|
|
22
22
|
encryptedKeys: string[];
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Encrypt all string values in a string map.
|
|
26
|
+
*/
|
|
27
|
+
export declare function encryptStringMap(values: Record<string, string>, passphrase: string): {
|
|
28
|
+
encrypted: Record<string, string>;
|
|
29
|
+
encryptedKeys: string[];
|
|
30
|
+
};
|
|
24
31
|
/**
|
|
25
32
|
* Decrypt all encrypted values in an env object.
|
|
26
33
|
*/
|
|
27
34
|
export declare function decryptEnv(env: Record<string, string>, passphrase: string): Record<string, string>;
|
|
35
|
+
/**
|
|
36
|
+
* Decrypt all encrypted values in a string map.
|
|
37
|
+
*/
|
|
38
|
+
export declare function decryptStringMap(values: Record<string, string>, passphrase: string): Record<string, string>;
|
|
28
39
|
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/utils/crypto.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,UAA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,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,UAAU,EAAE,MAAM,GACjB;IAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAchE;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB"}
|
package/dist/utils/crypto.js
CHANGED
|
@@ -37,8 +37,10 @@ exports.encrypt = encrypt;
|
|
|
37
37
|
exports.decrypt = decrypt;
|
|
38
38
|
exports.isEncrypted = isEncrypted;
|
|
39
39
|
exports.encryptEnv = encryptEnv;
|
|
40
|
+
exports.encryptStringMap = encryptStringMap;
|
|
40
41
|
exports.decryptEnv = decryptEnv;
|
|
41
|
-
|
|
42
|
+
exports.decryptStringMap = decryptStringMap;
|
|
43
|
+
const crypto = __importStar(require("node:crypto"));
|
|
42
44
|
const ENCRYPTED_PREFIX = 'ENCRYPTED:';
|
|
43
45
|
const ALGORITHM = 'aes-256-gcm';
|
|
44
46
|
const KEY_LEN = 32;
|
|
@@ -68,7 +70,7 @@ function encrypt(plaintext, passphrase) {
|
|
|
68
70
|
*/
|
|
69
71
|
function decrypt(encryptedValue, passphrase) {
|
|
70
72
|
if (!encryptedValue.startsWith(ENCRYPTED_PREFIX)) {
|
|
71
|
-
throw new Error('Value is not an encrypted
|
|
73
|
+
throw new Error('Value is not an encrypted mcpocket secret');
|
|
72
74
|
}
|
|
73
75
|
const parts = encryptedValue.slice(ENCRYPTED_PREFIX.length).split(':');
|
|
74
76
|
if (parts.length !== 4) {
|
|
@@ -91,7 +93,7 @@ function decrypt(encryptedValue, passphrase) {
|
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
/**
|
|
94
|
-
* Returns true if the value is an encrypted
|
|
96
|
+
* Returns true if the value is an encrypted mcpocket secret.
|
|
95
97
|
*/
|
|
96
98
|
function isEncrypted(value) {
|
|
97
99
|
return typeof value === 'string' && value.startsWith(ENCRYPTED_PREFIX);
|
|
@@ -101,9 +103,15 @@ function isEncrypted(value) {
|
|
|
101
103
|
* Returns the encrypted env and a list of key names that were encrypted.
|
|
102
104
|
*/
|
|
103
105
|
function encryptEnv(env, passphrase) {
|
|
106
|
+
return encryptStringMap(env, passphrase);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Encrypt all string values in a string map.
|
|
110
|
+
*/
|
|
111
|
+
function encryptStringMap(values, passphrase) {
|
|
104
112
|
const encrypted = {};
|
|
105
113
|
const encryptedKeys = [];
|
|
106
|
-
for (const [key, value] of Object.entries(
|
|
114
|
+
for (const [key, value] of Object.entries(values)) {
|
|
107
115
|
if (value && !isEncrypted(value)) {
|
|
108
116
|
encrypted[key] = encrypt(value, passphrase);
|
|
109
117
|
encryptedKeys.push(key);
|
|
@@ -118,8 +126,14 @@ function encryptEnv(env, passphrase) {
|
|
|
118
126
|
* Decrypt all encrypted values in an env object.
|
|
119
127
|
*/
|
|
120
128
|
function decryptEnv(env, passphrase) {
|
|
129
|
+
return decryptStringMap(env, passphrase);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Decrypt all encrypted values in a string map.
|
|
133
|
+
*/
|
|
134
|
+
function decryptStringMap(values, passphrase) {
|
|
121
135
|
const decrypted = {};
|
|
122
|
-
for (const [key, value] of Object.entries(
|
|
136
|
+
for (const [key, value] of Object.entries(values)) {
|
|
123
137
|
if (isEncrypted(value)) {
|
|
124
138
|
decrypted[key] = decrypt(value, passphrase);
|
|
125
139
|
}
|
package/dist/utils/crypto.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/utils/crypto.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,0BAgBC;AAOD,0BA0BC;AAKD,kCAEC;AAMD,
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/utils/crypto.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,0BAgBC;AAOD,0BA0BC;AAKD,kCAEC;AAMD,gCAKC;AAKD,4CAiBC;AAKD,gCAKC;AAKD,4CAeC;AAnID,oDAAsC;AAEtC,MAAM,gBAAgB,GAAG,YAAY,CAAC;AACtC,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB,EAAE,UAAkB;IAC3D,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACpF,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAEpC,OAAO,CACL,gBAAgB;QAChB,E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AEG;AACH,SAAgB,UAAU,CACxB,GAA2B,EAC3B,UAAkB;IAElB,OAAO,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,MAA8B,EAC9B,UAAkB;IAElB,MAAM,SAAS,GAA2B,EAAE,CAAC;IAE7C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,SAAS,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface MirrorStats {
|
|
2
|
+
synced: number;
|
|
3
|
+
removed: number;
|
|
4
|
+
}
|
|
5
|
+
interface MirrorOptions {
|
|
6
|
+
includeFile?: (relPath: string) => boolean;
|
|
7
|
+
includeDirectory?: (relPath: string) => boolean;
|
|
8
|
+
}
|
|
9
|
+
interface FileMapOptions {
|
|
10
|
+
protectedTopLevelNames?: ReadonlySet<string>;
|
|
11
|
+
}
|
|
12
|
+
export declare function mirrorDirectory(sourceDir: string, destDir: string, options?: MirrorOptions): MirrorStats;
|
|
13
|
+
export declare function mirrorFileMapToDir(dir: string, files: Record<string, string>, options?: FileMapOptions): MirrorStats;
|
|
14
|
+
export declare function pruneDirectoryTopLevel(dir: string, keepNames: ReadonlySet<string>): number;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/utils/files.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,aAAa;IACrB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;CACjD;AAED,UAAU,cAAc;IACtB,sBAAsB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,aAAkB,GAC1B,WAAW,CAgCb;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,GAAE,cAAmB,GAC3B,WAAW,CAgCb;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,GAC7B,MAAM,CAcR"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.mirrorDirectory = mirrorDirectory;
|
|
37
|
+
exports.mirrorFileMapToDir = mirrorFileMapToDir;
|
|
38
|
+
exports.pruneDirectoryTopLevel = pruneDirectoryTopLevel;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
function mirrorDirectory(sourceDir, destDir, options = {}) {
|
|
42
|
+
const includeFile = options.includeFile ?? (() => true);
|
|
43
|
+
const includeDirectory = options.includeDirectory ?? (() => true);
|
|
44
|
+
const sourceFiles = new Map();
|
|
45
|
+
collectSourceFiles(sourceDir, '', sourceFiles, includeFile, includeDirectory);
|
|
46
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
47
|
+
let synced = 0;
|
|
48
|
+
for (const [relPath, fullPath] of sourceFiles) {
|
|
49
|
+
const destPath = path.join(destDir, relPath);
|
|
50
|
+
fs.mkdirSync(path.dirname(destPath), { recursive: true });
|
|
51
|
+
fs.copyFileSync(fullPath, destPath);
|
|
52
|
+
synced++;
|
|
53
|
+
}
|
|
54
|
+
const destFiles = listFiles(destDir);
|
|
55
|
+
let removed = 0;
|
|
56
|
+
for (const relPath of destFiles) {
|
|
57
|
+
if (!includeFile(relPath)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (!sourceFiles.has(relPath)) {
|
|
61
|
+
fs.rmSync(path.join(destDir, relPath), { force: true });
|
|
62
|
+
removed++;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
removeEmptyDirs(destDir);
|
|
66
|
+
return { synced, removed };
|
|
67
|
+
}
|
|
68
|
+
function mirrorFileMapToDir(dir, files, options = {}) {
|
|
69
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
70
|
+
const normalizedFiles = new Map();
|
|
71
|
+
for (const [relPath, content] of Object.entries(files)) {
|
|
72
|
+
const normalized = normalizeRelPath(relPath);
|
|
73
|
+
normalizedFiles.set(normalized, content);
|
|
74
|
+
}
|
|
75
|
+
let synced = 0;
|
|
76
|
+
for (const [relPath, content] of normalizedFiles) {
|
|
77
|
+
const fullPath = path.join(dir, relPath);
|
|
78
|
+
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
79
|
+
fs.writeFileSync(fullPath, content, 'utf8');
|
|
80
|
+
synced++;
|
|
81
|
+
}
|
|
82
|
+
const protectedTopLevelNames = options.protectedTopLevelNames ?? new Set();
|
|
83
|
+
let removed = 0;
|
|
84
|
+
for (const relPath of listFiles(dir)) {
|
|
85
|
+
if (protectedTopLevelNames.has(firstPathSegment(relPath))) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (!normalizedFiles.has(normalizeRelPath(relPath))) {
|
|
89
|
+
fs.rmSync(path.join(dir, relPath), { force: true });
|
|
90
|
+
removed++;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
removeEmptyDirs(dir, protectedTopLevelNames);
|
|
94
|
+
return { synced, removed };
|
|
95
|
+
}
|
|
96
|
+
function pruneDirectoryTopLevel(dir, keepNames) {
|
|
97
|
+
if (!fs.existsSync(dir)) {
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
let removed = 0;
|
|
101
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
102
|
+
if (keepNames.has(entry.name)) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
fs.rmSync(path.join(dir, entry.name), { recursive: true, force: true });
|
|
106
|
+
removed++;
|
|
107
|
+
}
|
|
108
|
+
return removed;
|
|
109
|
+
}
|
|
110
|
+
function collectSourceFiles(dir, prefix, files, includeFile, includeDirectory) {
|
|
111
|
+
if (!fs.existsSync(dir)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
115
|
+
const relPath = prefix ? path.join(prefix, entry.name) : entry.name;
|
|
116
|
+
if (entry.isDirectory()) {
|
|
117
|
+
if (!includeDirectory(relPath)) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
collectSourceFiles(path.join(dir, entry.name), relPath, files, includeFile, includeDirectory);
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (entry.isFile() && includeFile(relPath)) {
|
|
124
|
+
files.set(normalizeRelPath(relPath), path.join(dir, entry.name));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function listFiles(dir, prefix = '') {
|
|
129
|
+
if (!fs.existsSync(dir)) {
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
const files = [];
|
|
133
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
134
|
+
const relPath = prefix ? path.join(prefix, entry.name) : entry.name;
|
|
135
|
+
if (entry.isDirectory()) {
|
|
136
|
+
files.push(...listFiles(path.join(dir, entry.name), relPath));
|
|
137
|
+
}
|
|
138
|
+
else if (entry.isFile()) {
|
|
139
|
+
files.push(normalizeRelPath(relPath));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return files;
|
|
143
|
+
}
|
|
144
|
+
function removeEmptyDirs(dir, protectedTopLevelNames = new Set(), isRoot = true) {
|
|
145
|
+
if (!fs.existsSync(dir)) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
149
|
+
if (!entry.isDirectory()) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const fullPath = path.join(dir, entry.name);
|
|
153
|
+
removeEmptyDirs(fullPath, protectedTopLevelNames, false);
|
|
154
|
+
if (isRoot && protectedTopLevelNames.has(entry.name)) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (fs.existsSync(fullPath) && fs.readdirSync(fullPath).length === 0) {
|
|
158
|
+
fs.rmdirSync(fullPath);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function firstPathSegment(relPath) {
|
|
163
|
+
return normalizeRelPath(relPath).split('/')[0] ?? relPath;
|
|
164
|
+
}
|
|
165
|
+
function normalizeRelPath(relPath) {
|
|
166
|
+
return relPath.replace(/\\/g, '/');
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/utils/files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,0CAoCC;AAED,gDAoCC;AAED,wDAiBC;AA9GD,uCAAyB;AACzB,2CAA6B;AAgB7B,SAAgB,eAAe,CAC7B,SAAiB,EACjB,OAAe,EACf,UAAyB,EAAE;IAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI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AAO,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/utils/paths.d.ts
CHANGED
|
@@ -47,11 +47,27 @@ export declare function getClaudeHomeDir(): string;
|
|
|
47
47
|
*/
|
|
48
48
|
export declare function getOpenCodeConfigPath(): string;
|
|
49
49
|
/**
|
|
50
|
-
* Get the
|
|
50
|
+
* Get the Cursor global MCP config path
|
|
51
51
|
*/
|
|
52
|
-
export declare function
|
|
52
|
+
export declare function getCursorConfigPath(): string;
|
|
53
53
|
/**
|
|
54
|
-
* Get the
|
|
54
|
+
* Get the Codex config path
|
|
55
55
|
*/
|
|
56
|
-
export declare function
|
|
56
|
+
export declare function getCodexConfigPath(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Get the Antigravity MCP config path
|
|
59
|
+
*/
|
|
60
|
+
export declare function getAntigravityConfigPath(): string;
|
|
61
|
+
/**
|
|
62
|
+
* Get the VS Code user MCP config path used by Copilot tools.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getCopilotCliConfigPath(): string;
|
|
65
|
+
/**
|
|
66
|
+
* Get the mcpocket config directory
|
|
67
|
+
*/
|
|
68
|
+
export declare function getMcpocketConfigDir(): string;
|
|
69
|
+
/**
|
|
70
|
+
* Get the mcpocket config file path
|
|
71
|
+
*/
|
|
72
|
+
export declare function getMcpocketConfigPath(): string;
|
|
57
73
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAS/C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAU5C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED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D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAM9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAShD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C"}
|
package/dist/utils/paths.js
CHANGED
|
@@ -43,10 +43,14 @@ exports.getClaudeDesktopConfigPath = getClaudeDesktopConfigPath;
|
|
|
43
43
|
exports.getClaudeCodeSettingsPath = getClaudeCodeSettingsPath;
|
|
44
44
|
exports.getClaudeHomeDir = getClaudeHomeDir;
|
|
45
45
|
exports.getOpenCodeConfigPath = getOpenCodeConfigPath;
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
exports.getCursorConfigPath = getCursorConfigPath;
|
|
47
|
+
exports.getCodexConfigPath = getCodexConfigPath;
|
|
48
|
+
exports.getAntigravityConfigPath = getAntigravityConfigPath;
|
|
49
|
+
exports.getCopilotCliConfigPath = getCopilotCliConfigPath;
|
|
50
|
+
exports.getMcpocketConfigDir = getMcpocketConfigDir;
|
|
51
|
+
exports.getMcpocketConfigPath = getMcpocketConfigPath;
|
|
52
|
+
const os = __importStar(require("node:os"));
|
|
53
|
+
const path = __importStar(require("node:path"));
|
|
50
54
|
const HOME = os.homedir();
|
|
51
55
|
/**
|
|
52
56
|
* Normalize an absolute path to a portable format:
|
|
@@ -101,7 +105,7 @@ function expandCommand(cmd) {
|
|
|
101
105
|
function normalizeArgs(args) {
|
|
102
106
|
return args.map(arg => {
|
|
103
107
|
// If the arg looks like an absolute path (starts with / or X:\), normalize it
|
|
104
|
-
if (/^[a-zA-Z]:[
|
|
108
|
+
if (/^[a-zA-Z]:[\\/]/.test(arg) || arg.startsWith('/')) {
|
|
105
109
|
return normalizePath(arg);
|
|
106
110
|
}
|
|
107
111
|
return arg;
|
|
@@ -155,15 +159,46 @@ function getOpenCodeConfigPath() {
|
|
|
155
159
|
return path.join(HOME, '.config', 'opencode', 'config.json');
|
|
156
160
|
}
|
|
157
161
|
/**
|
|
158
|
-
* Get the
|
|
162
|
+
* Get the Cursor global MCP config path
|
|
159
163
|
*/
|
|
160
|
-
function
|
|
161
|
-
return path.join(HOME, '.
|
|
164
|
+
function getCursorConfigPath() {
|
|
165
|
+
return path.join(HOME, '.cursor', 'mcp.json');
|
|
162
166
|
}
|
|
163
167
|
/**
|
|
164
|
-
* Get the
|
|
168
|
+
* Get the Codex config path
|
|
165
169
|
*/
|
|
166
|
-
function
|
|
167
|
-
return path.join(
|
|
170
|
+
function getCodexConfigPath() {
|
|
171
|
+
return path.join(HOME, '.codex', 'config.toml');
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Get the Antigravity MCP config path
|
|
175
|
+
*/
|
|
176
|
+
function getAntigravityConfigPath() {
|
|
177
|
+
return path.join(HOME, '.gemini', 'antigravity', 'mcp_config.json');
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get the VS Code user MCP config path used by Copilot tools.
|
|
181
|
+
*/
|
|
182
|
+
function getCopilotCliConfigPath() {
|
|
183
|
+
if (process.platform === 'win32') {
|
|
184
|
+
const appData = process.env['APPDATA'] || path.join(HOME, 'AppData', 'Roaming');
|
|
185
|
+
return path.join(appData, 'Code', 'User', 'mcp.json');
|
|
186
|
+
}
|
|
187
|
+
if (process.platform === 'darwin') {
|
|
188
|
+
return path.join(HOME, 'Library', 'Application Support', 'Code', 'User', 'mcp.json');
|
|
189
|
+
}
|
|
190
|
+
return path.join(HOME, '.config', 'Code', 'User', 'mcp.json');
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get the mcpocket config directory
|
|
194
|
+
*/
|
|
195
|
+
function getMcpocketConfigDir() {
|
|
196
|
+
return path.join(HOME, '.mcpocket');
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get the mcpocket config file path
|
|
200
|
+
*/
|
|
201
|
+
function getMcpocketConfigPath() {
|
|
202
|
+
return path.join(getMcpocketConfigDir(), 'config.json');
|
|
168
203
|
}
|
|
169
204
|
//# sourceMappingURL=paths.js.map
|
package/dist/utils/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,sCASC;AAOD,gCAUC;AAMD,4CAEC;AAOD,sCAEC;AAKD,sCAQC;AAKD,gCAOC;AAKD,gEAUC;AAKD,8DAEC;AAKD,4CAEC;AAKD,sDAMC;AAKD,kDAEC;AAKD,oDAEC;
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,sCASC;AAOD,gCAUC;AAMD,4CAEC;AAOD,sCAEC;AAKD,sCAQC;AAKD,gCAOC;AAKD,gEAUC;AAKD,8DAEC;AAKD,4CAEC;AAKD,sDAMC;AAKD,kDAEC;AAKD,gDAEC;AAKD,4DAEC;AAKD,0DASC;AAKD,oDAEC;AAKD,sDAEC;AAxKD,4CAA8B;AAC9B,gDAAkC;AAElC,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;AAE1B;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,CAAS;IACrC,uCAAuC;IACvC,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,U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AU,CAAC,CAAC;AAChE,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB;IAClC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,SAAgB,qBAAqB;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,aAAa,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whimsical CLI animations & personality for mcpocket.
|
|
3
|
+
* Because syncing your AI setup should feel like magic, not homework.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Print the mcpocket ASCII art banner — a friendly hello.
|
|
7
|
+
*/
|
|
8
|
+
export declare function printBanner(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Animated spinner that returns a stop() function.
|
|
11
|
+
* Call stop() when your async work is done.
|
|
12
|
+
*/
|
|
13
|
+
export declare function spinner(message: string): {
|
|
14
|
+
stop: (finalMsg?: string) => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Sparkle trail effect — prints a cascade of sparkles, then your message.
|
|
18
|
+
*/
|
|
19
|
+
export declare function sparkle(message: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* Print a success celebration.
|
|
22
|
+
*/
|
|
23
|
+
export declare function celebrate(message: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Print a whimsical section header with a decorative line.
|
|
26
|
+
*/
|
|
27
|
+
export declare function section(title: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Print a friendly stat line (for summaries).
|
|
30
|
+
*/
|
|
31
|
+
export declare function stat(label: string, value: string | number): void;
|
|
32
|
+
/**
|
|
33
|
+
* Print a warm, friendly error — problems happen, we're chill about it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function oops(message: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Print a gentle warning.
|
|
38
|
+
*/
|
|
39
|
+
export declare function heads_up(message: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Witty progress messages for different operations.
|
|
42
|
+
*/
|
|
43
|
+
export declare const WITTY: {
|
|
44
|
+
readonly pulling: "Reaching into the cloud pocket...";
|
|
45
|
+
readonly pushing: "Tucking your setup into the pocket...";
|
|
46
|
+
readonly encrypting: "Wrapping secrets in tinfoil...";
|
|
47
|
+
readonly decrypting: "Unwrapping the secret sauce...";
|
|
48
|
+
readonly cloning: "Setting up your secret stash...";
|
|
49
|
+
readonly verifying: "Checking your credentials (no judgment)...";
|
|
50
|
+
readonly readingMCP: "Rounding up your MCP servers...";
|
|
51
|
+
readonly readingPlugins: "Collecting plugin souvenirs...";
|
|
52
|
+
readonly readingAgents: "Gathering your agent squad...";
|
|
53
|
+
readonly readingSkills: "Packing up your skill tree...";
|
|
54
|
+
readonly done: "All pocketed!";
|
|
55
|
+
readonly nothingNew: "Already in sync — you're living in the future.";
|
|
56
|
+
readonly pushDone: "Your setup is safe in the cloud pocket!";
|
|
57
|
+
readonly pullDone: "Your setup landed safely! Welcome back.";
|
|
58
|
+
readonly initDone: "mcpocket is ready to roll!";
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=sparkle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparkle.d.ts","sourceRoot":"","sources":["../../src/utils/sparkle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6BH;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CAiB9E;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAG7C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAG/C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAG3C;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEhE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;CAgBR,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Whimsical CLI animations & personality for mcpocket.
|
|
4
|
+
* Because syncing your AI setup should feel like magic, not homework.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.WITTY = void 0;
|
|
8
|
+
exports.printBanner = printBanner;
|
|
9
|
+
exports.spinner = spinner;
|
|
10
|
+
exports.sparkle = sparkle;
|
|
11
|
+
exports.celebrate = celebrate;
|
|
12
|
+
exports.section = section;
|
|
13
|
+
exports.stat = stat;
|
|
14
|
+
exports.oops = oops;
|
|
15
|
+
exports.heads_up = heads_up;
|
|
16
|
+
const BANNER_LINES = [
|
|
17
|
+
{ color: 36, text: ' .------------------------.' },
|
|
18
|
+
{ color: 36, text: String.raw ` .---/ .------------------. \---.` },
|
|
19
|
+
{ color: 35, text: String.raw ` .-' / / .-''''''-. \ \ '-.` },
|
|
20
|
+
{ color: 35, text: String.raw ` .' / / / .--. \ \ \ '.` },
|
|
21
|
+
{ color: 36, text: String.raw ` / / / | / /\ \ | \ \ \ ` },
|
|
22
|
+
{ color: 36, text: ' ; | | | | | | | | | | ;' },
|
|
23
|
+
{ color: 33, text: String.raw ` | | | | | /\/ | | /\ | | |` },
|
|
24
|
+
{ color: 33, text: String.raw ` ; | | | | \/ | | /__\ | | ;` },
|
|
25
|
+
{ color: 36, text: String.raw ` \ \ \ | \____/ / / / /` },
|
|
26
|
+
{ color: 35, text: String.raw ` '. \ \ '-._____.-' / / .'` },
|
|
27
|
+
{ color: 35, text: String.raw ` '-. \ '----------------' / .-'` },
|
|
28
|
+
{ color: 36, text: String.raw ` '---\____________________/---'` },
|
|
29
|
+
{ color: 34, text: '' },
|
|
30
|
+
{ color: 34, text: ' __ __ ____ ____ ___ ____ _ _______ _____ ' },
|
|
31
|
+
{ color: 34, text: String.raw `| \/ |/ ___| _ \ / _ \ / ___| |/ / ____|_ _|` },
|
|
32
|
+
{ color: 34, text: String.raw `| |\/| | | | |_) | | | | | | ' /| _| | | ` },
|
|
33
|
+
{ color: 34, text: String.raw `| | | | |___| __/| |_| | |___| . \| |___ | | ` },
|
|
34
|
+
{ color: 34, text: String.raw `|_| |_|\____|_| \___/ \____|_|\_\_____| |_| ` },
|
|
35
|
+
{ color: 37, text: '' },
|
|
36
|
+
{ color: 37, text: ' Your AI setup. Every pocket.' },
|
|
37
|
+
];
|
|
38
|
+
const FRAMES_SYNC = ['◐', '◓', '◑', '◒'];
|
|
39
|
+
const FRAMES_SPARKLE = ['✦', '✧', '✦', '★', '✧', '⋆'];
|
|
40
|
+
const FRAMES_ROCKET = ['🚀', '🌟', '✨', '💫'];
|
|
41
|
+
/**
|
|
42
|
+
* Print the mcpocket ASCII art banner — a friendly hello.
|
|
43
|
+
*/
|
|
44
|
+
function printBanner() {
|
|
45
|
+
console.log('');
|
|
46
|
+
for (const line of BANNER_LINES) {
|
|
47
|
+
console.log(`\x1b[${line.color}m${line.text}\x1b[0m`);
|
|
48
|
+
}
|
|
49
|
+
console.log('');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Animated spinner that returns a stop() function.
|
|
53
|
+
* Call stop() when your async work is done.
|
|
54
|
+
*/
|
|
55
|
+
function spinner(message) {
|
|
56
|
+
let i = 0;
|
|
57
|
+
const interval = setInterval(() => {
|
|
58
|
+
const frame = FRAMES_SYNC[i % FRAMES_SYNC.length];
|
|
59
|
+
process.stdout.write(`\r ${frame} ${message}`);
|
|
60
|
+
i++;
|
|
61
|
+
}, 120);
|
|
62
|
+
return {
|
|
63
|
+
stop(finalMsg) {
|
|
64
|
+
clearInterval(interval);
|
|
65
|
+
process.stdout.write('\r' + ' '.repeat(message.length + 10) + '\r');
|
|
66
|
+
if (finalMsg) {
|
|
67
|
+
console.log(` ${finalMsg}`);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Sparkle trail effect — prints a cascade of sparkles, then your message.
|
|
74
|
+
*/
|
|
75
|
+
function sparkle(message) {
|
|
76
|
+
const frame = FRAMES_SPARKLE[Math.floor(Math.random() * FRAMES_SPARKLE.length)];
|
|
77
|
+
console.log(` ${frame} ${message}`);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Print a success celebration.
|
|
81
|
+
*/
|
|
82
|
+
function celebrate(message) {
|
|
83
|
+
const frame = FRAMES_ROCKET[Math.floor(Math.random() * FRAMES_ROCKET.length)];
|
|
84
|
+
console.log(`\n ${frame} \x1b[32m${message}\x1b[0m ${frame}`);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Print a whimsical section header with a decorative line.
|
|
88
|
+
*/
|
|
89
|
+
function section(title) {
|
|
90
|
+
const line = '─'.repeat(Math.max(0, 44 - title.length));
|
|
91
|
+
console.log(`\n \x1b[36m── ${title} ${line}\x1b[0m`);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Print a friendly stat line (for summaries).
|
|
95
|
+
*/
|
|
96
|
+
function stat(label, value) {
|
|
97
|
+
console.log(` \x1b[33m${label}\x1b[0m ${value}`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Print a warm, friendly error — problems happen, we're chill about it.
|
|
101
|
+
*/
|
|
102
|
+
function oops(message) {
|
|
103
|
+
console.error(`\n \x1b[31m✗ Oops!\x1b[0m ${message}`);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Print a gentle warning.
|
|
107
|
+
*/
|
|
108
|
+
function heads_up(message) {
|
|
109
|
+
console.log(` \x1b[33m⚡\x1b[0m ${message}`);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Witty progress messages for different operations.
|
|
113
|
+
*/
|
|
114
|
+
exports.WITTY = {
|
|
115
|
+
pulling: 'Reaching into the cloud pocket...',
|
|
116
|
+
pushing: 'Tucking your setup into the pocket...',
|
|
117
|
+
encrypting: 'Wrapping secrets in tinfoil...',
|
|
118
|
+
decrypting: 'Unwrapping the secret sauce...',
|
|
119
|
+
cloning: 'Setting up your secret stash...',
|
|
120
|
+
verifying: 'Checking your credentials (no judgment)...',
|
|
121
|
+
readingMCP: 'Rounding up your MCP servers...',
|
|
122
|
+
readingPlugins: 'Collecting plugin souvenirs...',
|
|
123
|
+
readingAgents: 'Gathering your agent squad...',
|
|
124
|
+
readingSkills: 'Packing up your skill tree...',
|
|
125
|
+
done: 'All pocketed!',
|
|
126
|
+
nothingNew: 'Already in sync — you\'re living in the future.',
|
|
127
|
+
pushDone: 'Your setup is safe in the cloud pocket!',
|
|
128
|
+
pullDone: 'Your setup landed safely! Welcome back.',
|
|
129
|
+
initDone: 'mcpocket is ready to roll!',
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=sparkle.js.map
|