@tuskydp/cli 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/dist/bin/tuskydp.d.ts +3 -0
- package/dist/bin/tuskydp.d.ts.map +1 -0
- package/dist/bin/tuskydp.js +3 -0
- package/dist/bin/tuskydp.js.map +1 -0
- package/dist/src/client.d.ts +120 -0
- package/dist/src/client.d.ts.map +1 -0
- package/dist/src/client.js +152 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/commands/account.d.ts +3 -0
- package/dist/src/commands/account.d.ts.map +1 -0
- package/dist/src/commands/account.js +66 -0
- package/dist/src/commands/account.js.map +1 -0
- package/dist/src/commands/auth.d.ts +3 -0
- package/dist/src/commands/auth.d.ts.map +1 -0
- package/dist/src/commands/auth.js +171 -0
- package/dist/src/commands/auth.js.map +1 -0
- package/dist/src/commands/decrypt.d.ts +15 -0
- package/dist/src/commands/decrypt.d.ts.map +1 -0
- package/dist/src/commands/decrypt.js +224 -0
- package/dist/src/commands/decrypt.js.map +1 -0
- package/dist/src/commands/download.d.ts +5 -0
- package/dist/src/commands/download.d.ts.map +1 -0
- package/dist/src/commands/download.js +67 -0
- package/dist/src/commands/download.js.map +1 -0
- package/dist/src/commands/encryption.d.ts +3 -0
- package/dist/src/commands/encryption.d.ts.map +1 -0
- package/dist/src/commands/encryption.js +254 -0
- package/dist/src/commands/encryption.js.map +1 -0
- package/dist/src/commands/export.d.ts +70 -0
- package/dist/src/commands/export.d.ts.map +1 -0
- package/dist/src/commands/export.js +178 -0
- package/dist/src/commands/export.js.map +1 -0
- package/dist/src/commands/files.d.ts +3 -0
- package/dist/src/commands/files.d.ts.map +1 -0
- package/dist/src/commands/files.js +179 -0
- package/dist/src/commands/files.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +8 -0
- package/dist/src/commands/mcp.d.ts.map +1 -0
- package/dist/src/commands/mcp.js +178 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/commands/rehydrate.d.ts +5 -0
- package/dist/src/commands/rehydrate.d.ts.map +1 -0
- package/dist/src/commands/rehydrate.js +27 -0
- package/dist/src/commands/rehydrate.js.map +1 -0
- package/dist/src/commands/tui.d.ts +3 -0
- package/dist/src/commands/tui.d.ts.map +1 -0
- package/dist/src/commands/tui.js +10 -0
- package/dist/src/commands/tui.js.map +1 -0
- package/dist/src/commands/upload.d.ts +6 -0
- package/dist/src/commands/upload.d.ts.map +1 -0
- package/dist/src/commands/upload.js +121 -0
- package/dist/src/commands/upload.js.map +1 -0
- package/dist/src/commands/vault.d.ts +3 -0
- package/dist/src/commands/vault.d.ts.map +1 -0
- package/dist/src/commands/vault.js +118 -0
- package/dist/src/commands/vault.js.map +1 -0
- package/dist/src/config.d.ts +15 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +26 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/crypto.d.ts +16 -0
- package/dist/src/crypto.d.ts.map +1 -0
- package/dist/src/crypto.js +95 -0
- package/dist/src/crypto.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +59 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/keyring.d.ts +4 -0
- package/dist/src/lib/keyring.d.ts.map +1 -0
- package/dist/src/lib/keyring.js +51 -0
- package/dist/src/lib/keyring.js.map +1 -0
- package/dist/src/lib/output.d.ts +6 -0
- package/dist/src/lib/output.d.ts.map +1 -0
- package/dist/src/lib/output.js +37 -0
- package/dist/src/lib/output.js.map +1 -0
- package/dist/src/lib/progress.d.ts +2 -0
- package/dist/src/lib/progress.d.ts.map +1 -0
- package/dist/src/lib/progress.js +5 -0
- package/dist/src/lib/progress.js.map +1 -0
- package/dist/src/lib/resolve.d.ts +3 -0
- package/dist/src/lib/resolve.d.ts.map +1 -0
- package/dist/src/lib/resolve.js +25 -0
- package/dist/src/lib/resolve.js.map +1 -0
- package/dist/src/mcp/context.d.ts +19 -0
- package/dist/src/mcp/context.d.ts.map +1 -0
- package/dist/src/mcp/context.js +8 -0
- package/dist/src/mcp/context.js.map +1 -0
- package/dist/src/mcp/server.d.ts +13 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +113 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/tools/account.d.ts +7 -0
- package/dist/src/mcp/tools/account.d.ts.map +1 -0
- package/dist/src/mcp/tools/account.js +31 -0
- package/dist/src/mcp/tools/account.js.map +1 -0
- package/dist/src/mcp/tools/files.d.ts +10 -0
- package/dist/src/mcp/tools/files.d.ts.map +1 -0
- package/dist/src/mcp/tools/files.js +310 -0
- package/dist/src/mcp/tools/files.js.map +1 -0
- package/dist/src/mcp/tools/folders.d.ts +7 -0
- package/dist/src/mcp/tools/folders.d.ts.map +1 -0
- package/dist/src/mcp/tools/folders.js +67 -0
- package/dist/src/mcp/tools/folders.js.map +1 -0
- package/dist/src/mcp/tools/helpers.d.ts +15 -0
- package/dist/src/mcp/tools/helpers.d.ts.map +1 -0
- package/dist/src/mcp/tools/helpers.js +25 -0
- package/dist/src/mcp/tools/helpers.js.map +1 -0
- package/dist/src/mcp/tools/trash.d.ts +7 -0
- package/dist/src/mcp/tools/trash.d.ts.map +1 -0
- package/dist/src/mcp/tools/trash.js +46 -0
- package/dist/src/mcp/tools/trash.js.map +1 -0
- package/dist/src/mcp/tools/vaults.d.ts +7 -0
- package/dist/src/mcp/tools/vaults.d.ts.map +1 -0
- package/dist/src/mcp/tools/vaults.js +85 -0
- package/dist/src/mcp/tools/vaults.js.map +1 -0
- package/dist/src/sdk.d.ts +53 -0
- package/dist/src/sdk.d.ts.map +1 -0
- package/dist/src/sdk.js +88 -0
- package/dist/src/sdk.js.map +1 -0
- package/dist/src/tui/auth-screen.d.ts +6 -0
- package/dist/src/tui/auth-screen.d.ts.map +1 -0
- package/dist/src/tui/auth-screen.js +165 -0
- package/dist/src/tui/auth-screen.js.map +1 -0
- package/dist/src/tui/dialogs.d.ts +10 -0
- package/dist/src/tui/dialogs.d.ts.map +1 -0
- package/dist/src/tui/dialogs.js +303 -0
- package/dist/src/tui/dialogs.js.map +1 -0
- package/dist/src/tui/files-panel.d.ts +34 -0
- package/dist/src/tui/files-panel.d.ts.map +1 -0
- package/dist/src/tui/files-panel.js +135 -0
- package/dist/src/tui/files-panel.js.map +1 -0
- package/dist/src/tui/helpers.d.ts +38 -0
- package/dist/src/tui/helpers.d.ts.map +1 -0
- package/dist/src/tui/helpers.js +187 -0
- package/dist/src/tui/helpers.js.map +1 -0
- package/dist/src/tui/index.d.ts +2 -0
- package/dist/src/tui/index.d.ts.map +1 -0
- package/dist/src/tui/index.js +382 -0
- package/dist/src/tui/index.js.map +1 -0
- package/dist/src/tui/overview.d.ts +4 -0
- package/dist/src/tui/overview.d.ts.map +1 -0
- package/dist/src/tui/overview.js +136 -0
- package/dist/src/tui/overview.js.map +1 -0
- package/dist/src/tui/status-bar.d.ts +18 -0
- package/dist/src/tui/status-bar.d.ts.map +1 -0
- package/dist/src/tui/status-bar.js +54 -0
- package/dist/src/tui/status-bar.js.map +1 -0
- package/dist/src/tui/vaults-panel.d.ts +26 -0
- package/dist/src/tui/vaults-panel.d.ts.map +1 -0
- package/dist/src/tui/vaults-panel.js +118 -0
- package/dist/src/tui/vaults-panel.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring.d.ts","sourceRoot":"","sources":["../../../src/lib/keyring.ts"],"names":[],"mappings":"AAcA,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAStD;AAED,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAc7C;AAED,wBAAgB,YAAY,IAAI,IAAI,CAUnC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { homedir } from 'os';
|
|
4
|
+
import { createCipheriv, createDecipheriv, randomBytes, createHash } from 'crypto';
|
|
5
|
+
const SESSION_DIR = join(homedir(), '.tusky');
|
|
6
|
+
const SESSION_FILE = join(SESSION_DIR, 'session.enc');
|
|
7
|
+
// Derive a machine-specific key from hostname + user
|
|
8
|
+
function getMachineKey() {
|
|
9
|
+
const machineId = `${homedir()}-tusky-session-key`;
|
|
10
|
+
return createHash('sha256').update(machineId).digest();
|
|
11
|
+
}
|
|
12
|
+
export function storeMasterKey(masterKey) {
|
|
13
|
+
mkdirSync(SESSION_DIR, { recursive: true });
|
|
14
|
+
const key = getMachineKey();
|
|
15
|
+
const iv = randomBytes(12);
|
|
16
|
+
const cipher = createCipheriv('aes-256-gcm', key, iv);
|
|
17
|
+
const encrypted = Buffer.concat([cipher.update(masterKey), cipher.final()]);
|
|
18
|
+
const tag = cipher.getAuthTag();
|
|
19
|
+
const data = Buffer.concat([iv, tag, encrypted]);
|
|
20
|
+
writeFileSync(SESSION_FILE, data);
|
|
21
|
+
}
|
|
22
|
+
export function loadMasterKey() {
|
|
23
|
+
if (!existsSync(SESSION_FILE))
|
|
24
|
+
return null;
|
|
25
|
+
try {
|
|
26
|
+
const data = readFileSync(SESSION_FILE);
|
|
27
|
+
const key = getMachineKey();
|
|
28
|
+
const iv = data.subarray(0, 12);
|
|
29
|
+
const tag = data.subarray(12, 28);
|
|
30
|
+
const encrypted = data.subarray(28);
|
|
31
|
+
const decipher = createDecipheriv('aes-256-gcm', key, iv);
|
|
32
|
+
decipher.setAuthTag(tag);
|
|
33
|
+
return Buffer.concat([decipher.update(encrypted), decipher.final()]);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function clearSession() {
|
|
40
|
+
try {
|
|
41
|
+
if (existsSync(SESSION_FILE)) {
|
|
42
|
+
writeFileSync(SESSION_FILE, '');
|
|
43
|
+
const { unlinkSync } = require('fs');
|
|
44
|
+
un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AC,CAAC;YACrC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import Table from 'cli-table3';
|
|
2
|
+
export declare function formatBytes(bytes: number): string;
|
|
3
|
+
export declare function createTable(head: string[]): Table.Table;
|
|
4
|
+
export declare function formatDate(date: string | Date): string;
|
|
5
|
+
export declare function shortId(id: string): string;
|
|
6
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/lib/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAG/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAKvD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAatD;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE1C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Table from 'cli-table3';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
export function formatBytes(bytes) {
|
|
4
|
+
if (bytes === 0)
|
|
5
|
+
return '0 B';
|
|
6
|
+
const k = 1024;
|
|
7
|
+
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
8
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
9
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`;
|
|
10
|
+
}
|
|
11
|
+
export function createTable(head) {
|
|
12
|
+
return new Table({
|
|
13
|
+
head: head.map(h => chalk.cyan(h)),
|
|
14
|
+
style: { head: [] },
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function formatDate(date) {
|
|
18
|
+
const d = new Date(date);
|
|
19
|
+
const now = new Date();
|
|
20
|
+
const diffMs = now.getTime() - d.getTime();
|
|
21
|
+
const diffMins = Math.floor(diffMs / 60000);
|
|
22
|
+
const diffHours = Math.floor(diffMs / 3600000);
|
|
23
|
+
const diffDays = Math.floor(diffMs / 86400000);
|
|
24
|
+
if (diffMins < 1)
|
|
25
|
+
return 'just now';
|
|
26
|
+
if (diffMins < 60)
|
|
27
|
+
return `${diffMins} min ago`;
|
|
28
|
+
if (diffHours < 24)
|
|
29
|
+
return `${diffHours}h ago`;
|
|
30
|
+
if (diffDays < 7)
|
|
31
|
+
return `${diffDays}d ago`;
|
|
32
|
+
return d.toLocaleDateString();
|
|
33
|
+
}
|
|
34
|
+
export function shortId(id) {
|
|
35
|
+
return id.slice(0, 8) + '...';
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/lib/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9B,MAAM,CAAC,GAAG,IAAI,CAAC;IACf,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,OAAO,GAAG,UAAU,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CA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AG,KAAK,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/lib/progress.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,qBAEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/lib/progress.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/lib/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,wBAAsB,YAAY,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBvF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cliConfig } from '../config.js';
|
|
2
|
+
export async function resolveVault(sdk, vaultRef) {
|
|
3
|
+
// If no vault specified, use the configured default
|
|
4
|
+
if (!vaultRef) {
|
|
5
|
+
const defaultVault = cliConfig.get('defaultVault');
|
|
6
|
+
if (defaultVault)
|
|
7
|
+
return defaultVault;
|
|
8
|
+
// Fall back to the user's default vault
|
|
9
|
+
const vaults = await sdk.vaults.list();
|
|
10
|
+
const defaultV = vaults.find((v) => v.isDefault);
|
|
11
|
+
if (defaultV)
|
|
12
|
+
return defaultV.id;
|
|
13
|
+
throw new Error('No default vault found. Create one with: tusky vault create <name>');
|
|
14
|
+
}
|
|
15
|
+
// If it looks like a UUID, use it directly
|
|
16
|
+
if (vaultRef.match(/^[0-9a-f]{8}-/))
|
|
17
|
+
return vaultRef;
|
|
18
|
+
// Otherwise, treat it as a slug and look it up
|
|
19
|
+
const vaults = await sdk.vaults.list();
|
|
20
|
+
const match = vaults.find((v) => v.slug === vaultRef || v.name === vaultRef);
|
|
21
|
+
if (!match)
|
|
22
|
+
throw new Error(`Vault "${vaultRef}" not found`);
|
|
23
|
+
return match.id;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/lib/resolve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAgB,EAAE,QAAiB;IACpE,oDAAoD;IACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,YAAY;YAAE,OAAO,YAAY,CAAC;QAEtC,wCAAwC;QACxC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC,EAAE,CAAC;QAEjC,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IAED,2CAA2C;IAC3C,IAAI,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC;QAAE,OAAO,QAAQ,CAAC;IAErD,+CAA+C;IAC/C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IAC7E,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,UAAU,QAAQ,aAAa,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared context for MCP tool handlers.
|
|
3
|
+
*
|
|
4
|
+
* Holds the authenticated SDK client and (optionally) the unlocked
|
|
5
|
+
* master key for client-side encryption/decryption of private vault files.
|
|
6
|
+
*/
|
|
7
|
+
import type { TuskyClient } from '@tuskydp/sdk';
|
|
8
|
+
export interface McpContext {
|
|
9
|
+
/** Authenticated Tusky SDK client. */
|
|
10
|
+
sdk: TuskyClient;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the in-memory master key, or null if encryption was not
|
|
13
|
+
* unlocked (i.e. TUSKYDP_PASSWORD was not provided or setup is incomplete).
|
|
14
|
+
*/
|
|
15
|
+
getMasterKey(): Buffer | null;
|
|
16
|
+
/** True when the master key is available for encrypt/decrypt operations. */
|
|
17
|
+
isEncryptionReady(): boolean;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/mcp/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,UAAU;IACzB,sCAAsC;IACtC,GAAG,EAAE,WAAW,CAAC;IAEjB;;;OAGG;IACH,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAE9B,4EAA4E;IAC5E,iBAAiB,IAAI,OAAO,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/mcp/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server for Tusky — exposes Tusky storage as tools over stdio.
|
|
3
|
+
*
|
|
4
|
+
* Agents (Claude Code, Cursor, etc.) spawn this process and communicate
|
|
5
|
+
* via JSON-RPC over stdin/stdout. All human-readable logging goes to
|
|
6
|
+
* stderr because stdout is reserved for the MCP protocol.
|
|
7
|
+
*/
|
|
8
|
+
export interface McpServerOptions {
|
|
9
|
+
apiKey: string;
|
|
10
|
+
apiUrl: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function startMcpServer(options: McpServerOptions): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA4EH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoD7E"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server for Tusky — exposes Tusky storage as tools over stdio.
|
|
3
|
+
*
|
|
4
|
+
* Agents (Claude Code, Cursor, etc.) spawn this process and communicate
|
|
5
|
+
* via JSON-RPC over stdin/stdout. All human-readable logging goes to
|
|
6
|
+
* stderr because stdout is reserved for the MCP protocol.
|
|
7
|
+
*/
|
|
8
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
10
|
+
import { TuskyClient, TuskyError } from '@tuskydp/sdk';
|
|
11
|
+
import { deriveMasterKey, verifyPassphrase, unwrapMasterKey, } from '../crypto.js';
|
|
12
|
+
import { loadMasterKey } from '../lib/keyring.js';
|
|
13
|
+
// Tool registrars
|
|
14
|
+
import { registerAccountTools } from './tools/account.js';
|
|
15
|
+
import { registerVaultTools } from './tools/vaults.js';
|
|
16
|
+
import { registerFolderTools } from './tools/folders.js';
|
|
17
|
+
import { registerFileTools } from './tools/files.js';
|
|
18
|
+
import { registerTrashTools } from './tools/trash.js';
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Encryption bootstrap
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
/**
|
|
23
|
+
* Attempt to unlock the master key using (in order):
|
|
24
|
+
* 1. TUSKYDP_PASSWORD env var → derive wrapping key → unwrap master key
|
|
25
|
+
* 2. Existing session file (~/.tusky/session.enc)
|
|
26
|
+
*
|
|
27
|
+
* Returns the master key Buffer, or null if neither method works.
|
|
28
|
+
*/
|
|
29
|
+
async function unlockMasterKey(sdk) {
|
|
30
|
+
const password = process.env.TUSKYDP_PASSWORD;
|
|
31
|
+
if (password) {
|
|
32
|
+
try {
|
|
33
|
+
const params = await sdk.account.getEncryptionParams();
|
|
34
|
+
if (!params.setupComplete) {
|
|
35
|
+
console.error('[tusky-mcp] Encryption not set up on this account. Skipping encryption unlock.');
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const salt = Buffer.from(params.salt, 'base64');
|
|
39
|
+
const verifier = Buffer.from(params.verifier, 'base64');
|
|
40
|
+
const wrappingKey = deriveMasterKey(password, salt);
|
|
41
|
+
if (!verifyPassphrase(wrappingKey, verifier)) {
|
|
42
|
+
console.error('[tusky-mcp] TUSKYDP_PASSWORD is incorrect. Encryption will be unavailable.');
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
if (params.encryptedMasterKey) {
|
|
46
|
+
return unwrapMasterKey(Buffer.from(params.encryptedMasterKey, 'base64'), wrappingKey);
|
|
47
|
+
}
|
|
48
|
+
// Legacy accounts where wrapping key IS the master key
|
|
49
|
+
return wrappingKey;
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
console.error(`[tusky-mcp] Failed to unlock encryption: ${err.message}`);
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Fallback: try existing session file
|
|
57
|
+
const sessionKey = loadMasterKey();
|
|
58
|
+
if (sessionKey) {
|
|
59
|
+
console.error('[tusky-mcp] Using encryption key from existing session.');
|
|
60
|
+
return sessionKey;
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
export async function startMcpServer(options) {
|
|
65
|
+
const { apiKey, apiUrl } = options;
|
|
66
|
+
// Create SDK client
|
|
67
|
+
const sdk = new TuskyClient({ apiKey, baseUrl: apiUrl });
|
|
68
|
+
// Validate connection by fetching account info
|
|
69
|
+
try {
|
|
70
|
+
const account = await sdk.account.get();
|
|
71
|
+
console.error(`[tusky-mcp] Authenticated as ${account.email} (${account.planName})`);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
if (err instanceof TuskyError) {
|
|
75
|
+
console.error(`[tusky-mcp] Authentication failed: ${err.message}`);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
console.error(`[tusky-mcp] Cannot reach Tusky API at ${apiUrl}: ${err.message}`);
|
|
79
|
+
}
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
// Unlock encryption (best effort)
|
|
83
|
+
const masterKey = await unlockMasterKey(sdk);
|
|
84
|
+
if (masterKey) {
|
|
85
|
+
console.error('[tusky-mcp] Encryption unlocked — private vault operations are available.');
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
console.error('[tusky-mcp] Encryption not unlocked — private vault encrypt/decrypt unavailable.');
|
|
89
|
+
console.error('[tusky-mcp] Set TUSKYDP_PASSWORD env var or run `tusky encryption unlock` first.');
|
|
90
|
+
}
|
|
91
|
+
// Build context
|
|
92
|
+
const ctx = {
|
|
93
|
+
sdk,
|
|
94
|
+
getMasterKey: () => masterKey,
|
|
95
|
+
isEncryptionReady: () => masterKey !== null,
|
|
96
|
+
};
|
|
97
|
+
// Create MCP server
|
|
98
|
+
const server = new McpServer({
|
|
99
|
+
name: 'tusky',
|
|
100
|
+
version: '0.1.0',
|
|
101
|
+
});
|
|
102
|
+
// Register all tools
|
|
103
|
+
registerAccountTools(server, ctx);
|
|
104
|
+
registerVaultTools(server, ctx);
|
|
105
|
+
registerFolderTools(server, ctx);
|
|
106
|
+
registerFileTools(server, ctx);
|
|
107
|
+
registerTrashTools(server, ctx);
|
|
108
|
+
// Connect via stdio transport
|
|
109
|
+
const transport = new StdioServerTransport();
|
|
110
|
+
await server.connect(transport);
|
|
111
|
+
console.error('[tusky-mcp] MCP server running on stdio');
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,kBAAkB;AAClB,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,8EAA8E;AA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AgB;IAChB,MAAM,GAAG,GAAe;QACtB,GAAG;QACH,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS;QAC7B,iBAAiB,EAAE,GAAG,EAAE,CAAC,SAAS,KAAK,IAAI;KAC5C,CAAC;IAEF,oBAAoB;IACpB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,qBAAqB;IACrB,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC,8BAA8B;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tools — Account
|
|
3
|
+
*/
|
|
4
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
+
import type { McpContext } from '../context.js';
|
|
6
|
+
export declare function registerAccountTools(server: McpServer, ctx: McpContext): void;
|
|
7
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/account.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,QA+BtE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tools — Account
|
|
3
|
+
*/
|
|
4
|
+
import { wrapToolError } from './helpers.js';
|
|
5
|
+
export function registerAccountTools(server, ctx) {
|
|
6
|
+
server.tool('tusky_account_info', 'Get account information including email, plan, storage usage, and encryption status', {}, async () => {
|
|
7
|
+
try {
|
|
8
|
+
const account = await ctx.sdk.account.get();
|
|
9
|
+
const info = {
|
|
10
|
+
id: account.id,
|
|
11
|
+
email: account.email,
|
|
12
|
+
plan: account.planName,
|
|
13
|
+
planTier: account.planTier,
|
|
14
|
+
storageUsed: account.storageUsedFormatted,
|
|
15
|
+
storageLimit: account.storageLimitFormatted,
|
|
16
|
+
storageUsedBytes: account.storageUsedBytes,
|
|
17
|
+
storageLimitBytes: account.storageLimitBytes,
|
|
18
|
+
encryptionSetup: account.encryptionSetupComplete,
|
|
19
|
+
encryptionUnlocked: ctx.isEncryptionReady(),
|
|
20
|
+
createdAt: account.createdAt,
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
content: [{ type: 'text', text: JSON.stringify(info, null, 2) }],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
return wrapToolError(err);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../src/mcp/tools/account.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,GAAe;IACrE,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,qFAAqF,EACrF,EAAE,EACF,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YAE5C,MAAM,IAAI,GAAG;gBACX,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,IAAI,EAAE,OAAO,CAAC,QAAQ;gBACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,WAAW,EAAE,OAAO,CAAC,oBAAoB;gBACzC,YAAY,EAAE,OAAO,CAAC,qBAAqB;gBAC3C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;gBAC1C,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;gBAC5C,eAAe,EAAE,OAAO,CAAC,uBAAuB;gBAChD,kBAAkB,EAAE,GAAG,CAAC,iBAAiB,EAAE;gBAC3C,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC1E,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tools — File operations
|
|
3
|
+
*
|
|
4
|
+
* Handles upload with client-side encryption for private vaults,
|
|
5
|
+
* download with decryption and rehydration polling for cold files.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
|
+
import type { McpContext } from '../context.js';
|
|
9
|
+
export declare function registerFileTools(server: McpServer, ctx: McpContext): void;
|
|
10
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/files.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAkKhD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,QAoOnE"}
|