mcpocket 0.1.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/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +35 -0
- package/dist/cli.js.map +1 -0
- package/dist/clients/claude-code.d.ts +6 -0
- package/dist/clients/claude-code.d.ts.map +1 -0
- package/dist/clients/claude-code.js +80 -0
- package/dist/clients/claude-code.js.map +1 -0
- package/dist/clients/claude-desktop.d.ts +5 -0
- package/dist/clients/claude-desktop.d.ts.map +1 -0
- package/dist/clients/claude-desktop.js +78 -0
- package/dist/clients/claude-desktop.js.map +1 -0
- package/dist/clients/opencode.d.ts +5 -0
- package/dist/clients/opencode.d.ts.map +1 -0
- package/dist/clients/opencode.js +79 -0
- package/dist/clients/opencode.js.map +1 -0
- package/dist/clients/types.d.ts +29 -0
- package/dist/clients/types.d.ts.map +1 -0
- package/dist/clients/types.js +3 -0
- package/dist/clients/types.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +71 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/pull.d.ts +2 -0
- package/dist/commands/pull.d.ts.map +1 -0
- package/dist/commands/pull.js +143 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/push.d.ts +2 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +112 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +128 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +67 -0
- package/dist/config.js.map +1 -0
- package/dist/storage/github.d.ts +19 -0
- package/dist/storage/github.d.ts.map +1 -0
- package/dist/storage/github.js +168 -0
- package/dist/storage/github.js.map +1 -0
- package/dist/sync/agents.d.ts +5 -0
- package/dist/sync/agents.d.ts.map +1 -0
- package/dist/sync/agents.js +97 -0
- package/dist/sync/agents.js.map +1 -0
- package/dist/sync/mcp.d.ts +41 -0
- package/dist/sync/mcp.d.ts.map +1 -0
- package/dist/sync/mcp.js +102 -0
- package/dist/sync/mcp.js.map +1 -0
- package/dist/sync/plugins.d.ts +18 -0
- package/dist/sync/plugins.d.ts.map +1 -0
- package/dist/sync/plugins.js +126 -0
- package/dist/sync/plugins.js.map +1 -0
- package/dist/sync/skills.d.ts +5 -0
- package/dist/sync/skills.d.ts.map +1 -0
- package/dist/sync/skills.js +94 -0
- package/dist/sync/skills.js.map +1 -0
- package/dist/utils/crypto.d.ts +28 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/crypto.js +132 -0
- package/dist/utils/crypto.js.map +1 -0
- package/dist/utils/paths.d.ts +57 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +169 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/prompt.d.ts +5 -0
- package/dist/utils/prompt.d.ts.map +1 -0
- package/dist/utils/prompt.js +85 -0
- package/dist/utils/prompt.js.map +1 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 davidsmorais
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# carry-on
|
|
2
|
+
|
|
3
|
+
> Your AI setup. Everywhere you work.
|
|
4
|
+
|
|
5
|
+
`carry-on` syncs your Claude Code agents, skills, plugins, and MCP server configurations across machines — so your full AI loadout follows you everywhere.
|
|
6
|
+
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
You install 8 MCP servers, configure your Claude Code plugins, and build up a library of agents on your Linux machine. Then you switch to Windows and have nothing. `carry-on` fixes that with two commands.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g mcpocket
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### 1. Initialize (once per machine)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
carry-on init
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Connects to GitHub, creates a private `carry-on-sync` repo, and clones it locally. Requires a [GitHub personal access token](https://github.com/settings/tokens/new) with `repo` scope.
|
|
26
|
+
|
|
27
|
+
### 2. Push your setup
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
carry-on push
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Reads MCP configs, plugin manifests, agents, and skills from your current machine. Encrypts any secrets (API keys in MCP env vars) with a passphrase you choose, then commits and pushes to your private GitHub repo.
|
|
34
|
+
|
|
35
|
+
### 3. Pull on a new machine
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
carry-on pull
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Pulls your config from GitHub, decrypts secrets with your passphrase, and writes everything to:
|
|
42
|
+
- **Claude Desktop** — `claude_desktop_config.json`
|
|
43
|
+
- **Claude Code** — `~/.claude/settings.json`
|
|
44
|
+
- **OpenCode** — `~/.config/opencode/config.json`
|
|
45
|
+
|
|
46
|
+
Then restart Claude Desktop to apply MCP changes.
|
|
47
|
+
|
|
48
|
+
### Check sync status
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
carry-on status
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Shows which MCP servers, plugins, agents, and skills are synced vs. local-only vs. remote-only.
|
|
55
|
+
|
|
56
|
+
## What Gets Synced
|
|
57
|
+
|
|
58
|
+
| What | Where |
|
|
59
|
+
|---|---|
|
|
60
|
+
| MCP server configs | All clients — Claude Desktop, Claude Code, OpenCode |
|
|
61
|
+
| Plugin manifests | `installed_plugins.json`, `blocklist.json`, `known_marketplaces.json` |
|
|
62
|
+
| Agents | `~/.claude/agents/**/*.md` |
|
|
63
|
+
| Skills | `~/.claude/skills/**` (excluding `node_modules`) |
|
|
64
|
+
|
|
65
|
+
**Never synced:** `.credentials.json`, `plugins/cache/`, sessions, telemetry.
|
|
66
|
+
|
|
67
|
+
## Security
|
|
68
|
+
|
|
69
|
+
- Secrets (MCP `env` vars) are encrypted with AES-256-GCM before upload
|
|
70
|
+
- Your passphrase is never stored anywhere
|
|
71
|
+
- Config repo is always private
|
|
72
|
+
- GitHub token is stored in `~/.carry-on/config.json` (chmod 600 on Linux/Mac)
|
|
73
|
+
|
|
74
|
+
## Path Handling
|
|
75
|
+
|
|
76
|
+
`carry-on` normalizes paths on push (`/home/user/...` → `~/...`) and expands them for the current platform on pull. Windows and Linux absolute paths round-trip correctly.
|
|
77
|
+
|
|
78
|
+
## Requirements
|
|
79
|
+
|
|
80
|
+
- Node.js 18+
|
|
81
|
+
- Git (must be in PATH)
|
|
82
|
+
- A GitHub account
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const init_js_1 = require("./commands/init.js");
|
|
6
|
+
const push_js_1 = require("./commands/push.js");
|
|
7
|
+
const pull_js_1 = require("./commands/pull.js");
|
|
8
|
+
const status_js_1 = require("./commands/status.js");
|
|
9
|
+
const program = new commander_1.Command();
|
|
10
|
+
program
|
|
11
|
+
.name('carry-on')
|
|
12
|
+
.description('Your AI setup. Everywhere you work.\nSyncs Claude Code agents, skills, plugins, and MCPs across machines.')
|
|
13
|
+
.version('0.1.0');
|
|
14
|
+
program
|
|
15
|
+
.command('init')
|
|
16
|
+
.description('Set up carry-on: connect GitHub, create sync repo')
|
|
17
|
+
.action(() => (0, init_js_1.initCommand)().catch(die));
|
|
18
|
+
program
|
|
19
|
+
.command('push')
|
|
20
|
+
.description('Upload your current AI setup to the cloud')
|
|
21
|
+
.action(() => (0, push_js_1.pushCommand)().catch(die));
|
|
22
|
+
program
|
|
23
|
+
.command('pull')
|
|
24
|
+
.description('Restore your AI setup from the cloud')
|
|
25
|
+
.action(() => (0, pull_js_1.pullCommand)().catch(die));
|
|
26
|
+
program
|
|
27
|
+
.command('status')
|
|
28
|
+
.description('Show what\'s synced vs. local-only vs. remote-only')
|
|
29
|
+
.action(() => (0, status_js_1.statusCommand)().catch(die));
|
|
30
|
+
program.parse();
|
|
31
|
+
function die(err) {
|
|
32
|
+
console.error(`\nError: ${err.message}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,gDAAiD;AACjD,gDAAiD;AACjD,gDAAiD;AACjD,oDAAqD;AAErD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,2GAA2G,CAAC;KACxH,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,mDAAmD,CAAC;KAChE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,qBAAW,GAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1C,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,2CAA2C,CAAC;KACxD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,qBAAW,GAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1C,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,qBAAW,GAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1C,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,oDAAoD,CAAC;KACjE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yBAAa,GAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE5C,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,SAAS,GAAG,CAAC,GAAU;IACrB,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ClaudeCodeSettings, McpServersMap } from './types.js';
|
|
2
|
+
export declare function readClaudeCodeSettings(): ClaudeCodeSettings;
|
|
3
|
+
export declare function readClaudeCodeMcpServers(): McpServersMap;
|
|
4
|
+
export declare function writeClaudeCodeMcpServers(servers: McpServersMap): void;
|
|
5
|
+
export declare function getSettingsPath(): string;
|
|
6
|
+
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/clients/claude-code.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpE,wBAAgB,sBAAsB,IAAI,kBAAkB,CAW3D;AAED,wBAAgB,wBAAwB,IAAI,aAAa,CAExD;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAiBtE;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.readClaudeCodeSettings = readClaudeCodeSettings;
|
|
37
|
+
exports.readClaudeCodeMcpServers = readClaudeCodeMcpServers;
|
|
38
|
+
exports.writeClaudeCodeMcpServers = writeClaudeCodeMcpServers;
|
|
39
|
+
exports.getSettingsPath = getSettingsPath;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const paths_js_1 = require("../utils/paths.js");
|
|
43
|
+
function readClaudeCodeSettings() {
|
|
44
|
+
const settingsPath = (0, paths_js_1.getClaudeCodeSettingsPath)();
|
|
45
|
+
if (!fs.existsSync(settingsPath)) {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
return JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
console.warn(`[carry-on] Could not read Claude Code settings at ${settingsPath}`);
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function readClaudeCodeMcpServers() {
|
|
57
|
+
return readClaudeCodeSettings().mcpServers ?? {};
|
|
58
|
+
}
|
|
59
|
+
function writeClaudeCodeMcpServers(servers) {
|
|
60
|
+
const settingsPath = (0, paths_js_1.getClaudeCodeSettingsPath)();
|
|
61
|
+
const dir = path.dirname(settingsPath);
|
|
62
|
+
let settings = {};
|
|
63
|
+
if (fs.existsSync(settingsPath)) {
|
|
64
|
+
try {
|
|
65
|
+
settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
console.warn(`[carry-on] Could not parse existing Claude Code settings, will overwrite mcpServers only`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
73
|
+
}
|
|
74
|
+
settings.mcpServers = { ...(settings.mcpServers ?? {}), ...servers };
|
|
75
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf8');
|
|
76
|
+
}
|
|
77
|
+
function getSettingsPath() {
|
|
78
|
+
return (0, paths_js_1.getClaudeCodeSettingsPath)();
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=claude-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/clients/claude-code.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wDAWC;AAED,4DAEC;AAED,8DAiBC;AAED,0CAEC;AA3CD,uCAAyB;AACzB,2CAA6B;AAC7B,gDAA8D;AAG9D,SAAgB,sBAAsB;IACpC,MAAM,YAAY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AS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC5E,CAAC;AAED,SAAgB,eAAe;IAC7B,OAAO,IAAA,oCAAyB,GAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { McpServersMap } from './types.js';
|
|
2
|
+
export declare function readClaudeDesktopMcpServers(): McpServersMap;
|
|
3
|
+
export declare function writeClaudeDesktopMcpServers(servers: McpServersMap): void;
|
|
4
|
+
export declare function getConfigPath(): string;
|
|
5
|
+
//# sourceMappingURL=claude-desktop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-desktop.d.ts","sourceRoot":"","sources":["../../src/clients/claude-desktop.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAuB,aAAa,EAAE,MAAM,YAAY,CAAC;AAErE,wBAAgB,2BAA2B,IAAI,aAAa,CAa3D;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAiBzE;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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.readClaudeDesktopMcpServers = readClaudeDesktopMcpServers;
|
|
37
|
+
exports.writeClaudeDesktopMcpServers = writeClaudeDesktopMcpServers;
|
|
38
|
+
exports.getConfigPath = getConfigPath;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const paths_js_1 = require("../utils/paths.js");
|
|
42
|
+
function readClaudeDesktopMcpServers() {
|
|
43
|
+
const configPath = (0, paths_js_1.getClaudeDesktopConfigPath)();
|
|
44
|
+
if (!fs.existsSync(configPath)) {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const raw = fs.readFileSync(configPath, 'utf8');
|
|
49
|
+
const config = JSON.parse(raw);
|
|
50
|
+
return config.mcpServers ?? {};
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
console.warn(`[carry-on] Could not read Claude Desktop config at ${configPath}`);
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function writeClaudeDesktopMcpServers(servers) {
|
|
58
|
+
const configPath = (0, paths_js_1.getClaudeDesktopConfigPath)();
|
|
59
|
+
const dir = path.dirname(configPath);
|
|
60
|
+
let config = {};
|
|
61
|
+
if (fs.existsSync(configPath)) {
|
|
62
|
+
try {
|
|
63
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
console.warn(`[carry-on] Could not parse existing Claude Desktop config, will overwrite mcpServers only`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
71
|
+
}
|
|
72
|
+
config.mcpServers = { ...(config.mcpServers ?? {}), ...servers };
|
|
73
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
|
|
74
|
+
}
|
|
75
|
+
function getConfigPath() {
|
|
76
|
+
return (0, paths_js_1.getClaudeDesktopConfigPath)();
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=claude-desktop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-desktop.js","sourceRoot":"","sources":["../../src/clients/claude-desktop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,kEAaC;AAED,oEAiBC;AAED,sCAEC;AAzCD,uCAAyB;AACzB,2CAA6B;AAC7B,gDAA+D;AAG/D,SAAgB,2BAA2B;IACzC,MAAM,UAAU,GAAG,IAAA,qCAA0B,GAAE,CAAC;IAChD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,GAAwB,IAAI,CAAC,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+
export declare function writeOpenCodeMcpServers(servers: McpServersMap): void;
|
|
4
|
+
export declare function getConfigPath(): string;
|
|
5
|
+
//# sourceMappingURL=opencode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/clients/opencode.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhE,wBAAgB,sBAAsB,IAAI,aAAa,CAYtD;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAkBpE;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.readOpenCodeMcpServers = readOpenCodeMcpServers;
|
|
37
|
+
exports.writeOpenCodeMcpServers = writeOpenCodeMcpServers;
|
|
38
|
+
exports.getConfigPath = getConfigPath;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const paths_js_1 = require("../utils/paths.js");
|
|
42
|
+
function readOpenCodeMcpServers() {
|
|
43
|
+
const configPath = (0, paths_js_1.getOpenCodeConfigPath)();
|
|
44
|
+
if (!fs.existsSync(configPath)) {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
49
|
+
return config.mcp?.servers ?? {};
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
console.warn(`[carry-on] Could not read OpenCode config at ${configPath}`);
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function writeOpenCodeMcpServers(servers) {
|
|
57
|
+
const configPath = (0, paths_js_1.getOpenCodeConfigPath)();
|
|
58
|
+
const dir = path.dirname(configPath);
|
|
59
|
+
let config = {};
|
|
60
|
+
if (fs.existsSync(configPath)) {
|
|
61
|
+
try {
|
|
62
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
console.warn(`[carry-on] Could not parse existing OpenCode config, will overwrite mcp.servers only`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
70
|
+
}
|
|
71
|
+
if (!config.mcp)
|
|
72
|
+
config.mcp = {};
|
|
73
|
+
config.mcp.servers = { ...(config.mcp.servers ?? {}), ...servers };
|
|
74
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
|
|
75
|
+
}
|
|
76
|
+
function getConfigPath() {
|
|
77
|
+
return (0, paths_js_1.getOpenCodeConfigPath)();
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=opencode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/clients/opencode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wDAYC;AAED,0DAkBC;AAED,sCAEC;AAzCD,uCAAyB;AACzB,2CAA6B;AAC7B,gDAA0D;AAG1D,SAAgB,sBAAsB;IACpC,MAAM,UAAU,GAAG,IAAA,gCAAqB,GAAE,CAAC;IAC3C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAmB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;QAC/E,OAAO,MAAM,CAAC,GAAG,EAAE,OAAO,IAAI,EAAE,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,gDAAgD,UAAU,EAAE,CAAC,CAAC;QAC3E,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAgB,uBAAuB,CAAC,OAAsB;IAC5D,MAAM,UAAU,GAAG,IAAA,gCAAqB,GAAE,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAErC,IAAI,MAAM,GAAmB,EAAE,CAAC;IAChC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;QAC3D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,sFAAsF,CAAC,CAAC;QACvG,CAAC;IACH,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,GAAG;QAAE,MAAM,CAAC,GAAG,GAAG,EAAE,CAAC;IACjC,MAAM,CAAC,GAAG,CAAC,OAAO,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;IACnE,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACxE,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO,IAAA,gCAAqB,GAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface McpServerConfig {
|
|
2
|
+
command: string;
|
|
3
|
+
args?: string[];
|
|
4
|
+
env?: Record<string, string>;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface McpServersMap {
|
|
8
|
+
[serverName: string]: McpServerConfig;
|
|
9
|
+
}
|
|
10
|
+
/** Subset of claude_desktop_config.json we care about */
|
|
11
|
+
export interface ClaudeDesktopConfig {
|
|
12
|
+
mcpServers?: McpServersMap;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
/** Subset of ~/.claude/settings.json we care about */
|
|
16
|
+
export interface ClaudeCodeSettings {
|
|
17
|
+
mcpServers?: McpServersMap;
|
|
18
|
+
enabledPlugins?: string[];
|
|
19
|
+
env?: Record<string, string>;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/** Subset of opencode config.json */
|
|
23
|
+
export interface OpenCodeConfig {
|
|
24
|
+
mcp?: {
|
|
25
|
+
servers?: McpServersMap;
|
|
26
|
+
};
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/clients/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAAC;CACvC;AAED,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,sDAAsD;AACtD,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE;QACJ,OAAO,CAAC,EAAE,aAAa,CAAC;KACzB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/clients/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAIA,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAoEjD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initCommand = initCommand;
|
|
4
|
+
const github_js_1 = require("../storage/github.js");
|
|
5
|
+
const config_js_1 = require("../config.js");
|
|
6
|
+
const prompt_js_1 = require("../utils/prompt.js");
|
|
7
|
+
async function initCommand() {
|
|
8
|
+
console.log('carry-on init\n');
|
|
9
|
+
if ((0, config_js_1.configExists)()) {
|
|
10
|
+
const overwrite = await (0, prompt_js_1.ask)('carry-on is already initialized. Re-initialize? [y/N] ');
|
|
11
|
+
if (overwrite.toLowerCase() !== 'y') {
|
|
12
|
+
console.log('Aborted.');
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// Get GitHub token
|
|
17
|
+
console.log('Enter your GitHub personal access token.');
|
|
18
|
+
console.log('Required scopes: repo (full control of private repositories)\n');
|
|
19
|
+
console.log('Create one at: https://github.com/settings/tokens/new\n');
|
|
20
|
+
const token = await (0, prompt_js_1.askSecret)('GitHub token: ');
|
|
21
|
+
if (!token) {
|
|
22
|
+
console.error('Error: token cannot be empty.');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
// Verify token and get username
|
|
26
|
+
console.log('\nVerifying token...');
|
|
27
|
+
let owner = '';
|
|
28
|
+
try {
|
|
29
|
+
owner = await (0, github_js_1.getAuthenticatedUser)(token);
|
|
30
|
+
console.log(`✓ Authenticated as ${owner}`);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
console.error(`Error: ${err.message}`);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
// Create repo
|
|
37
|
+
console.log('\nCreating private repo carry-on-sync...');
|
|
38
|
+
let repoInfo;
|
|
39
|
+
try {
|
|
40
|
+
repoInfo = await (0, github_js_1.createRepo)(token, owner);
|
|
41
|
+
console.log(`✓ Repo ready: ${repoInfo.htmlUrl}`);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
console.error(`Error: ${err.message}`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
// Clone repo locally
|
|
48
|
+
const localDir = (0, config_js_1.getLocalRepoDir)();
|
|
49
|
+
console.log(`\nCloning to ${localDir}...`);
|
|
50
|
+
try {
|
|
51
|
+
(0, github_js_1.cloneRepo)(repoInfo.cloneUrl, token, localDir);
|
|
52
|
+
(0, github_js_1.ensureGitConfig)(localDir);
|
|
53
|
+
console.log('✓ Repo cloned');
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
console.error(`Error: ${err.message}`);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
// Save config
|
|
60
|
+
(0, config_js_1.writeConfig)({
|
|
61
|
+
githubToken: token,
|
|
62
|
+
repoFullName: repoInfo.fullName,
|
|
63
|
+
repoCloneUrl: repoInfo.cloneUrl,
|
|
64
|
+
repoHtmlUrl: repoInfo.htmlUrl,
|
|
65
|
+
});
|
|
66
|
+
console.log('\n✓ carry-on initialized!');
|
|
67
|
+
console.log('\nNext steps:');
|
|
68
|
+
console.log(' carry-on push — sync this machine\'s setup to the cloud');
|
|
69
|
+
console.log(' carry-on pull — restore your setup on a new machine');
|
|
70
|
+
}
|
|
71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