@truecarry/mcp 0.1.3 → 0.1.4
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/cli.js +328 -1512
- package/dist/factory.d.ts +35 -21
- package/dist/factory.d.ts.map +1 -1
- package/dist/index.cjs +455 -4113
- package/dist/index.d.ts +5 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +455 -4100
- package/dist/services/McpWalletService.d.ts +25 -129
- package/dist/services/McpWalletService.d.ts.map +1 -1
- package/dist/tools/balance-tools.d.ts +61 -0
- package/dist/tools/balance-tools.d.ts.map +1 -0
- package/dist/tools/index.d.ts +3 -7
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/{swap.d.ts → swap-tools.d.ts} +6 -49
- package/dist/tools/swap-tools.d.ts.map +1 -0
- package/dist/tools/transfer-tools.d.ts +79 -0
- package/dist/tools/transfer-tools.d.ts.map +1 -0
- package/dist/tools/types.d.ts +21 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/types/config.d.ts +12 -36
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/adapters/InMemoryStorageAdapter.d.ts +0 -49
- package/dist/adapters/InMemoryStorageAdapter.d.ts.map +0 -1
- package/dist/adapters/LocalSignerAdapter.d.ts +0 -107
- package/dist/adapters/LocalSignerAdapter.d.ts.map +0 -1
- package/dist/adapters/SqliteSignerAdapter.d.ts +0 -119
- package/dist/adapters/SqliteSignerAdapter.d.ts.map +0 -1
- package/dist/adapters/SqliteStorageAdapter.d.ts +0 -81
- package/dist/adapters/SqliteStorageAdapter.d.ts.map +0 -1
- package/dist/adapters/TelegramUserContextProvider.d.ts +0 -70
- package/dist/adapters/TelegramUserContextProvider.d.ts.map +0 -1
- package/dist/adapters/index.d.ts +0 -19
- package/dist/adapters/index.d.ts.map +0 -1
- package/dist/core/LimitsManager.d.ts +0 -59
- package/dist/core/LimitsManager.d.ts.map +0 -1
- package/dist/core/PendingTransactionManager.d.ts +0 -122
- package/dist/core/PendingTransactionManager.d.ts.map +0 -1
- package/dist/core/UserScopedSigner.d.ts +0 -96
- package/dist/core/UserScopedSigner.d.ts.map +0 -1
- package/dist/core/UserScopedStorage.d.ts +0 -59
- package/dist/core/UserScopedStorage.d.ts.map +0 -1
- package/dist/core/index.d.ts +0 -15
- package/dist/core/index.d.ts.map +0 -1
- package/dist/services/WalletService.d.ts +0 -144
- package/dist/services/WalletService.d.ts.map +0 -1
- package/dist/storage/SecureStorage.d.ts +0 -79
- package/dist/storage/SecureStorage.d.ts.map +0 -1
- package/dist/tools/balance.d.ts +0 -167
- package/dist/tools/balance.d.ts.map +0 -1
- package/dist/tools/mcp-tools.d.ts +0 -439
- package/dist/tools/mcp-tools.d.ts.map +0 -1
- package/dist/tools/swap.d.ts.map +0 -1
- package/dist/tools/transfer.d.ts +0 -146
- package/dist/tools/transfer.d.ts.map +0 -1
- package/dist/tools/wallet.d.ts +0 -138
- package/dist/tools/wallet.d.ts.map +0 -1
- package/dist/types/signer.d.ts +0 -120
- package/dist/types/signer.d.ts.map +0 -1
- package/dist/types/storage.d.ts +0 -41
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/user-context.d.ts +0 -48
- package/dist/types/user-context.d.ts.map +0 -1
package/dist/tools/wallet.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) TonTech.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Wallet management MCP tools
|
|
10
|
-
*/
|
|
11
|
-
import { z } from 'zod';
|
|
12
|
-
import type { WalletService } from '../services/WalletService.js';
|
|
13
|
-
export declare const createWalletSchema: z.ZodObject<{
|
|
14
|
-
name: z.ZodString;
|
|
15
|
-
version: z.ZodOptional<z.ZodEnum<["v5r1", "v4r2"]>>;
|
|
16
|
-
network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
|
|
17
|
-
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
name: string;
|
|
19
|
-
version?: "v5r1" | "v4r2" | undefined;
|
|
20
|
-
network?: "mainnet" | "testnet" | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
name: string;
|
|
23
|
-
version?: "v5r1" | "v4r2" | undefined;
|
|
24
|
-
network?: "mainnet" | "testnet" | undefined;
|
|
25
|
-
}>;
|
|
26
|
-
export declare const importWalletSchema: z.ZodObject<{
|
|
27
|
-
name: z.ZodString;
|
|
28
|
-
mnemonic: z.ZodString;
|
|
29
|
-
version: z.ZodOptional<z.ZodEnum<["v5r1", "v4r2"]>>;
|
|
30
|
-
network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
|
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
name: string;
|
|
33
|
-
mnemonic: string;
|
|
34
|
-
version?: "v5r1" | "v4r2" | undefined;
|
|
35
|
-
network?: "mainnet" | "testnet" | undefined;
|
|
36
|
-
}, {
|
|
37
|
-
name: string;
|
|
38
|
-
mnemonic: string;
|
|
39
|
-
version?: "v5r1" | "v4r2" | undefined;
|
|
40
|
-
network?: "mainnet" | "testnet" | undefined;
|
|
41
|
-
}>;
|
|
42
|
-
export declare const removeWalletSchema: z.ZodObject<{
|
|
43
|
-
name: z.ZodString;
|
|
44
|
-
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
name: string;
|
|
46
|
-
}, {
|
|
47
|
-
name: string;
|
|
48
|
-
}>;
|
|
49
|
-
export declare function createWalletTools(walletService: WalletService): {
|
|
50
|
-
create_wallet: {
|
|
51
|
-
description: string;
|
|
52
|
-
inputSchema: z.ZodObject<{
|
|
53
|
-
name: z.ZodString;
|
|
54
|
-
version: z.ZodOptional<z.ZodEnum<["v5r1", "v4r2"]>>;
|
|
55
|
-
network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
|
|
56
|
-
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
name: string;
|
|
58
|
-
version?: "v5r1" | "v4r2" | undefined;
|
|
59
|
-
network?: "mainnet" | "testnet" | undefined;
|
|
60
|
-
}, {
|
|
61
|
-
name: string;
|
|
62
|
-
version?: "v5r1" | "v4r2" | undefined;
|
|
63
|
-
network?: "mainnet" | "testnet" | undefined;
|
|
64
|
-
}>;
|
|
65
|
-
handler: (args: z.infer<typeof createWalletSchema>) => Promise<{
|
|
66
|
-
content: {
|
|
67
|
-
type: "text";
|
|
68
|
-
text: string;
|
|
69
|
-
}[];
|
|
70
|
-
}>;
|
|
71
|
-
};
|
|
72
|
-
import_wallet: {
|
|
73
|
-
description: string;
|
|
74
|
-
inputSchema: z.ZodObject<{
|
|
75
|
-
name: z.ZodString;
|
|
76
|
-
mnemonic: z.ZodString;
|
|
77
|
-
version: z.ZodOptional<z.ZodEnum<["v5r1", "v4r2"]>>;
|
|
78
|
-
network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
|
|
79
|
-
}, "strip", z.ZodTypeAny, {
|
|
80
|
-
name: string;
|
|
81
|
-
mnemonic: string;
|
|
82
|
-
version?: "v5r1" | "v4r2" | undefined;
|
|
83
|
-
network?: "mainnet" | "testnet" | undefined;
|
|
84
|
-
}, {
|
|
85
|
-
name: string;
|
|
86
|
-
mnemonic: string;
|
|
87
|
-
version?: "v5r1" | "v4r2" | undefined;
|
|
88
|
-
network?: "mainnet" | "testnet" | undefined;
|
|
89
|
-
}>;
|
|
90
|
-
handler: (args: z.infer<typeof importWalletSchema>) => Promise<{
|
|
91
|
-
content: {
|
|
92
|
-
type: "text";
|
|
93
|
-
text: string;
|
|
94
|
-
}[];
|
|
95
|
-
isError: boolean;
|
|
96
|
-
} | {
|
|
97
|
-
content: {
|
|
98
|
-
type: "text";
|
|
99
|
-
text: string;
|
|
100
|
-
}[];
|
|
101
|
-
isError?: undefined;
|
|
102
|
-
}>;
|
|
103
|
-
};
|
|
104
|
-
list_wallets: {
|
|
105
|
-
description: string;
|
|
106
|
-
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
107
|
-
handler: () => Promise<{
|
|
108
|
-
content: {
|
|
109
|
-
type: "text";
|
|
110
|
-
text: string;
|
|
111
|
-
}[];
|
|
112
|
-
}>;
|
|
113
|
-
};
|
|
114
|
-
remove_wallet: {
|
|
115
|
-
description: string;
|
|
116
|
-
inputSchema: z.ZodObject<{
|
|
117
|
-
name: z.ZodString;
|
|
118
|
-
}, "strip", z.ZodTypeAny, {
|
|
119
|
-
name: string;
|
|
120
|
-
}, {
|
|
121
|
-
name: string;
|
|
122
|
-
}>;
|
|
123
|
-
handler: (args: z.infer<typeof removeWalletSchema>) => Promise<{
|
|
124
|
-
content: {
|
|
125
|
-
type: "text";
|
|
126
|
-
text: string;
|
|
127
|
-
}[];
|
|
128
|
-
isError: boolean;
|
|
129
|
-
} | {
|
|
130
|
-
content: {
|
|
131
|
-
type: "text";
|
|
132
|
-
text: string;
|
|
133
|
-
}[];
|
|
134
|
-
isError?: undefined;
|
|
135
|
-
}>;
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/tools/wallet.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAU7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAW7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa;;;;;;;;;;;;;;;;wBAM5B,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;wBA8BlC,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0ElC,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC;;;;;;;;;;;;;;EA8BnE"}
|
package/dist/types/signer.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) TonTech.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* ISignerAdapter - Interface for secure key management and signing operations
|
|
10
|
-
*
|
|
11
|
-
* Critical: This adapter NEVER returns private keys or seed phrases.
|
|
12
|
-
* Seed phrases are accepted as input but stored securely by the adapter implementation.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Wallet information returned by signer operations.
|
|
16
|
-
* Contains only public data - no private keys or seed phrases.
|
|
17
|
-
*/
|
|
18
|
-
export interface WalletInfo {
|
|
19
|
-
/** Internal wallet ID (may be user-prefixed internally by the adapter) */
|
|
20
|
-
walletId: string;
|
|
21
|
-
/** Hex-encoded public key */
|
|
22
|
-
publicKey: string;
|
|
23
|
-
/** TON address (user-friendly format) */
|
|
24
|
-
address: string;
|
|
25
|
-
/** Network the wallet is configured for */
|
|
26
|
-
network: 'mainnet' | 'testnet';
|
|
27
|
-
/** Wallet contract version */
|
|
28
|
-
version: 'v5r1' | 'v4r2';
|
|
29
|
-
/** ISO timestamp when wallet was created */
|
|
30
|
-
createdAt: string;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Parameters for creating a new wallet
|
|
34
|
-
*/
|
|
35
|
-
export interface CreateWalletParams {
|
|
36
|
-
/** Unique wallet ID (should be user-scoped externally) */
|
|
37
|
-
walletId: string;
|
|
38
|
-
/** Wallet contract version */
|
|
39
|
-
version: 'v5r1' | 'v4r2';
|
|
40
|
-
/** Network to create the wallet on */
|
|
41
|
-
network: 'mainnet' | 'testnet';
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Parameters for importing a wallet from mnemonic
|
|
45
|
-
*/
|
|
46
|
-
export interface ImportWalletParams {
|
|
47
|
-
/** Unique wallet ID (should be user-scoped externally) */
|
|
48
|
-
walletId: string;
|
|
49
|
-
/** 24-word mnemonic phrase (stored securely, never returned) */
|
|
50
|
-
mnemonic: string[];
|
|
51
|
-
/** Wallet contract version */
|
|
52
|
-
version: 'v5r1' | 'v4r2';
|
|
53
|
-
/** Network to import the wallet on */
|
|
54
|
-
network: 'mainnet' | 'testnet';
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Interface for secure key management and signing operations.
|
|
58
|
-
*
|
|
59
|
-
* Implementations should:
|
|
60
|
-
* - Store keys encrypted (e.g., AES-256-GCM with master key derived via PBKDF2/Argon2)
|
|
61
|
-
* - Never expose private keys or seed phrases through any method
|
|
62
|
-
* - Support user isolation if operating in multi-tenant mode
|
|
63
|
-
*/
|
|
64
|
-
export interface ISignerAdapter {
|
|
65
|
-
/**
|
|
66
|
-
* Create a new wallet with generated keys.
|
|
67
|
-
* The mnemonic is generated and stored securely - NEVER returned.
|
|
68
|
-
*
|
|
69
|
-
* @param params - Wallet creation parameters
|
|
70
|
-
* @returns Wallet info (address, public key) - NO private data
|
|
71
|
-
*/
|
|
72
|
-
createWallet(params: CreateWalletParams): Promise<WalletInfo>;
|
|
73
|
-
/**
|
|
74
|
-
* Import a wallet from mnemonic.
|
|
75
|
-
* The mnemonic is stored securely by the adapter - NEVER returned.
|
|
76
|
-
*
|
|
77
|
-
* @param params - Import parameters including mnemonic
|
|
78
|
-
* @returns Wallet info (address, public key) - NO private data
|
|
79
|
-
*/
|
|
80
|
-
importWallet(params: ImportWalletParams): Promise<WalletInfo>;
|
|
81
|
-
/**
|
|
82
|
-
* Get wallet info by ID.
|
|
83
|
-
*
|
|
84
|
-
* @param walletId - The wallet ID
|
|
85
|
-
* @returns Wallet info or null if not found
|
|
86
|
-
*/
|
|
87
|
-
getWallet(walletId: string): Promise<WalletInfo | null>;
|
|
88
|
-
/**
|
|
89
|
-
* List all wallet IDs managed by this adapter.
|
|
90
|
-
* For user isolation, the wrapper should filter by user prefix.
|
|
91
|
-
*
|
|
92
|
-
* @returns Array of wallet IDs
|
|
93
|
-
*/
|
|
94
|
-
listWalletIds(): Promise<string[]>;
|
|
95
|
-
/**
|
|
96
|
-
* Delete a wallet and its keys.
|
|
97
|
-
*
|
|
98
|
-
* @param walletId - The wallet ID to delete
|
|
99
|
-
* @returns true if deleted, false if not found
|
|
100
|
-
*/
|
|
101
|
-
deleteWallet(walletId: string): Promise<boolean>;
|
|
102
|
-
/**
|
|
103
|
-
* Sign a transaction.
|
|
104
|
-
* The adapter loads the private key internally and signs.
|
|
105
|
-
*
|
|
106
|
-
* @param walletId - The wallet ID to sign with
|
|
107
|
-
* @param unsignedBoc - Base64-encoded unsigned transaction BOC
|
|
108
|
-
* @returns Base64-encoded signed transaction BOC
|
|
109
|
-
*/
|
|
110
|
-
signTransaction(walletId: string, unsignedBoc: string): Promise<string>;
|
|
111
|
-
/**
|
|
112
|
-
* Sign an arbitrary message.
|
|
113
|
-
*
|
|
114
|
-
* @param walletId - The wallet ID to sign with
|
|
115
|
-
* @param message - The message bytes to sign
|
|
116
|
-
* @returns The signature bytes
|
|
117
|
-
*/
|
|
118
|
-
signMessage(walletId: string, message: Buffer): Promise<Buffer>;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=signer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/types/signer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACvB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,sCAAsC;IACtC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,sCAAsC;IACtC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;;;OAMG;IACH,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9D;;;;;;OAMG;IACH,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9D;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAExD;;;;;OAKG;IACH,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjD;;;;;;;OAOG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAExE;;;;;;OAMG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE"}
|
package/dist/types/storage.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) TonTech.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* IStorageAdapter - Interface for persistent key-value storage
|
|
10
|
-
*
|
|
11
|
-
* Purpose: Store wallet metadata, contacts, transaction history, pending transactions.
|
|
12
|
-
* Does NOT store: private keys, seed phrases (that's ISignerAdapter's responsibility)
|
|
13
|
-
*/
|
|
14
|
-
export interface IStorageAdapter {
|
|
15
|
-
/**
|
|
16
|
-
* Get a value by key
|
|
17
|
-
* @param key - The storage key
|
|
18
|
-
* @returns The stored value or null if not found
|
|
19
|
-
*/
|
|
20
|
-
get<T>(key: string): Promise<T | null>;
|
|
21
|
-
/**
|
|
22
|
-
* Set a value with optional TTL
|
|
23
|
-
* @param key - The storage key
|
|
24
|
-
* @param value - The value to store
|
|
25
|
-
* @param ttlSeconds - Optional time-to-live in seconds (for pending transactions, etc.)
|
|
26
|
-
*/
|
|
27
|
-
set<T>(key: string, value: T, ttlSeconds?: number): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Delete a key
|
|
30
|
-
* @param key - The storage key
|
|
31
|
-
* @returns true if the key existed and was deleted, false otherwise
|
|
32
|
-
*/
|
|
33
|
-
delete(key: string): Promise<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* List all keys matching a prefix
|
|
36
|
-
* @param prefix - The key prefix to match
|
|
37
|
-
* @returns Array of matching keys
|
|
38
|
-
*/
|
|
39
|
-
list(prefix: string): Promise<string[]>;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/types/storage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAEvC;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElE;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtC;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAC3C"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) TonTech.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* IUserContextProvider - Interface for extracting authenticated user identity
|
|
10
|
-
*
|
|
11
|
-
* Purpose: Identify the current user from MCP request context.
|
|
12
|
-
* Returns null if user cannot be authenticated (request should be rejected).
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Request context passed to the user context provider.
|
|
16
|
-
* Contains headers and metadata from the MCP request.
|
|
17
|
-
*/
|
|
18
|
-
export interface RequestContext {
|
|
19
|
-
/** HTTP headers (e.g., x-telegram-user-id, authorization) */
|
|
20
|
-
headers?: Record<string, string>;
|
|
21
|
-
/** Additional metadata from the transport */
|
|
22
|
-
metadata?: Record<string, unknown>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Interface for extracting user identity from request context.
|
|
26
|
-
*
|
|
27
|
-
* Implementations should:
|
|
28
|
-
* - Extract user ID from appropriate header or metadata
|
|
29
|
-
* - Return null if user cannot be authenticated
|
|
30
|
-
* - Optionally provide user metadata for auditing
|
|
31
|
-
*/
|
|
32
|
-
export interface IUserContextProvider {
|
|
33
|
-
/**
|
|
34
|
-
* Extract user ID from request context.
|
|
35
|
-
*
|
|
36
|
-
* @param context - The request context with headers and metadata
|
|
37
|
-
* @returns User ID string or null if unauthenticated
|
|
38
|
-
*/
|
|
39
|
-
getUserId(context: RequestContext): Promise<string | null>;
|
|
40
|
-
/**
|
|
41
|
-
* Optional: Get additional user metadata for logging/auditing.
|
|
42
|
-
*
|
|
43
|
-
* @param userId - The user ID
|
|
44
|
-
* @returns User metadata or null if not available
|
|
45
|
-
*/
|
|
46
|
-
getUserMetadata?(userId: string): Promise<Record<string, unknown> | null>;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=user-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-context.d.ts","sourceRoot":"","sources":["../../src/types/user-context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE3D;;;;;OAKG;IACH,eAAe,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;CAC7E"}
|