@gala-chain/launchpad-mcp-server 1.3.0 → 1.5.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/README.md +128 -0
- package/dist/constants/mcpToolNames.d.ts +159 -0
- package/dist/constants/mcpToolNames.d.ts.map +1 -0
- package/dist/constants/mcpToolNames.js +131 -0
- package/dist/constants/mcpToolNames.js.map +1 -0
- package/dist/prompts/__tests__/promptStructure.test.d.ts +7 -0
- package/dist/prompts/__tests__/promptStructure.test.d.ts.map +1 -0
- package/dist/prompts/__tests__/promptStructure.test.js +106 -0
- package/dist/prompts/__tests__/promptStructure.test.js.map +1 -0
- package/dist/prompts/__tests__/registry.test.d.ts +7 -0
- package/dist/prompts/__tests__/registry.test.d.ts.map +1 -0
- package/dist/prompts/__tests__/registry.test.js +119 -0
- package/dist/prompts/__tests__/registry.test.js.map +1 -0
- package/dist/prompts/analysis.d.ts +31 -0
- package/dist/prompts/analysis.d.ts.map +1 -0
- package/dist/prompts/analysis.js +342 -0
- package/dist/prompts/analysis.js.map +1 -0
- package/dist/prompts/index.d.ts +83 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +117 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/portfolio.d.ts +31 -0
- package/dist/prompts/portfolio.d.ts.map +1 -0
- package/dist/prompts/portfolio.js +233 -0
- package/dist/prompts/portfolio.js.map +1 -0
- package/dist/prompts/trading.d.ts +27 -0
- package/dist/prompts/trading.d.ts.map +1 -0
- package/dist/prompts/trading.js +179 -0
- package/dist/prompts/trading.js.map +1 -0
- package/dist/prompts/utils/workflowTemplates.d.ts +103 -0
- package/dist/prompts/utils/workflowTemplates.d.ts.map +1 -0
- package/dist/prompts/utils/workflowTemplates.js +315 -0
- package/dist/prompts/utils/workflowTemplates.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +51 -1
- package/dist/server.js.map +1 -1
- package/dist/types/mcp.d.ts +29 -0
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/utils/__tests__/validation.test.d.ts +7 -0
- package/dist/utils/__tests__/validation.test.d.ts.map +1 -0
- package/dist/utils/__tests__/validation.test.js +122 -0
- package/dist/utils/__tests__/validation.test.js.map +1 -0
- package/dist/utils/validation.d.ts +162 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +276 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,10 +5,12 @@ MCP (Model Context Protocol) server for Gala Launchpad SDK - Enables AI agents t
|
|
|
5
5
|
## 🚀 Features
|
|
6
6
|
|
|
7
7
|
- **47 AI-accessible tools** for complete Gala Launchpad integration
|
|
8
|
+
- **14 slash commands** (prompts) for quick access to common workflows
|
|
8
9
|
- **Type-safe** - Full TypeScript support with validated inputs
|
|
9
10
|
- **Production-ready** - Built on [@gala-chain/launchpad-sdk ](https://www.npmjs.com/package/@gala-chain/launchpad-sdk)
|
|
10
11
|
- **Easy setup** - Works with Claude Desktop and other MCP clients
|
|
11
12
|
- **Comprehensive** - Pool management, trading, balances, token creation, comments, transfers
|
|
13
|
+
- **Optimized** - Local bonding curve calculations for instant results
|
|
12
14
|
|
|
13
15
|
## 📦 Installation
|
|
14
16
|
|
|
@@ -229,6 +231,132 @@ Ask Claude (or your AI assistant):
|
|
|
229
231
|
|
|
230
232
|
> "Show me all tokens I'm holding"
|
|
231
233
|
|
|
234
|
+
## ⚡ Slash Commands (Prompts)
|
|
235
|
+
|
|
236
|
+
The MCP server exposes **14 slash commands** that provide quick access to common Launchpad workflows. These appear as `/galachain-launchpad:<<method>>` in Claude Desktop.
|
|
237
|
+
|
|
238
|
+
### Trading Commands (4 commands)
|
|
239
|
+
|
|
240
|
+
**`/galachain-launchpad:analyze-token`**
|
|
241
|
+
- Comprehensive token analysis (pool details, spot price, graduation cost)
|
|
242
|
+
- **Arguments**: `tokenName` (required)
|
|
243
|
+
- **Example**: `/galachain-launchpad:analyze-token tokenName=anime`
|
|
244
|
+
- Uses optimized LOCAL calculations for speed
|
|
245
|
+
|
|
246
|
+
**`/galachain-launchpad:buy-tokens`**
|
|
247
|
+
- Guided token purchase with slippage protection
|
|
248
|
+
- **Arguments**: `tokenName` (required), `galaAmount` (required), `slippage` (optional, default 1%)
|
|
249
|
+
- **Example**: `/galachain-launchpad:buy-tokens tokenName=anime galaAmount=100 slippage=2`
|
|
250
|
+
- Shows breakdown and asks for confirmation before executing
|
|
251
|
+
|
|
252
|
+
**`/galachain-launchpad:sell-tokens`**
|
|
253
|
+
- Guided token sale with slippage protection
|
|
254
|
+
- **Arguments**: `tokenName` (required), `tokenAmount` (required), `slippage` (optional, default 1%)
|
|
255
|
+
- **Example**: `/galachain-launchpad:sell-tokens tokenName=anime tokenAmount=1000`
|
|
256
|
+
- Checks balance and shows breakdown before executing
|
|
257
|
+
|
|
258
|
+
**`/galachain-launchpad:graduate-token`**
|
|
259
|
+
- One-step pool graduation workflow
|
|
260
|
+
- **Arguments**: `tokenName` (required), `slippage` (optional, default 1%)
|
|
261
|
+
- **Example**: `/galachain-launchpad:graduate-token tokenName=anime`
|
|
262
|
+
- Checks if already graduated, calculates cost, and executes with confirmation
|
|
263
|
+
|
|
264
|
+
### Portfolio Commands (5 commands)
|
|
265
|
+
|
|
266
|
+
**`/galachain-launchpad:portfolio`**
|
|
267
|
+
- Complete portfolio analysis with USD values
|
|
268
|
+
- **Arguments**: None
|
|
269
|
+
- Shows GALA balance, all token holdings, total portfolio value, and top holdings
|
|
270
|
+
|
|
271
|
+
**`/galachain-launchpad:tokens-held`**
|
|
272
|
+
- List all tokens currently held
|
|
273
|
+
- **Arguments**: `search` (optional fuzzy filter), `limit` (optional, default 20)
|
|
274
|
+
- **Example**: `/galachain-launchpad:tokens-held search=dragon limit=10`
|
|
275
|
+
|
|
276
|
+
**`/galachain-launchpad:tokens-created`**
|
|
277
|
+
- Show tokens created by the user with status
|
|
278
|
+
- **Arguments**: `search` (optional), `limit` (optional, default 20)
|
|
279
|
+
- Shows graduation status and progress for each token
|
|
280
|
+
|
|
281
|
+
**`/galachain-launchpad:balance`**
|
|
282
|
+
- Check GALA and optional token balance
|
|
283
|
+
- **Arguments**: `tokenName` (optional)
|
|
284
|
+
- **Example**: `/galachain-launchpad:balance tokenName=anime`
|
|
285
|
+
- Displays both token amounts and USD values
|
|
286
|
+
|
|
287
|
+
**`/galachain-launchpad:profile`**
|
|
288
|
+
- Show user profile and activity summary
|
|
289
|
+
- **Arguments**: None
|
|
290
|
+
- Displays profile info, wallet addresses, activity metrics, and current balance
|
|
291
|
+
|
|
292
|
+
### Analysis Commands (5 commands)
|
|
293
|
+
|
|
294
|
+
**`/galachain-launchpad:compare-tokens`**
|
|
295
|
+
- Side-by-side comparison of two tokens
|
|
296
|
+
- **Arguments**: `token1` (required), `token2` (required)
|
|
297
|
+
- **Example**: `/galachain-launchpad:compare-tokens token1=anime token2=test216253`
|
|
298
|
+
- Shows comparison table with metrics, holders, and investment analysis
|
|
299
|
+
|
|
300
|
+
**`/galachain-launchpad:graduation-status`**
|
|
301
|
+
- Check graduation readiness for multiple tokens
|
|
302
|
+
- **Arguments**: `tokens` (required, comma-separated)
|
|
303
|
+
- **Example**: `/galachain-launchpad:graduation-status tokens=anime,test216253,dragnrkti`
|
|
304
|
+
- Shows progress table and identifies graduation opportunities
|
|
305
|
+
|
|
306
|
+
**`/galachain-launchpad:spot-prices`**
|
|
307
|
+
- Batch spot price lookup for multiple tokens
|
|
308
|
+
- **Arguments**: `tokens` (required, comma-separated)
|
|
309
|
+
- **Example**: `/galachain-launchpad:spot-prices tokens=anime,test216253`
|
|
310
|
+
- Uses optimized LOCAL calculations for instant results
|
|
311
|
+
|
|
312
|
+
**`/galachain-launchpad:pool-details`**
|
|
313
|
+
- Comprehensive pool information with badges and distribution
|
|
314
|
+
- **Arguments**: `tokenName` (required)
|
|
315
|
+
- **Example**: `/galachain-launchpad:pool-details tokenName=anime`
|
|
316
|
+
- Shows complete pool metrics, achievements, and recent activity
|
|
317
|
+
|
|
318
|
+
**`/galachain-launchpad:trade-history`**
|
|
319
|
+
- View recent trades with filtering
|
|
320
|
+
- **Arguments**: `tokenName` (optional), `userAddress` (optional), `tradeType` (optional: BUY/SELL), `limit` (optional, default 20)
|
|
321
|
+
- **Example**: `/galachain-launchpad:trade-history tokenName=anime tradeType=BUY limit=10`
|
|
322
|
+
|
|
323
|
+
### Slash Command Benefits
|
|
324
|
+
|
|
325
|
+
✅ **Quick access** - Type `/galachain-launchpad:` to see all available commands
|
|
326
|
+
✅ **Guided workflows** - Each command provides step-by-step execution
|
|
327
|
+
✅ **Optimized** - Uses LOCAL calculations for maximum performance
|
|
328
|
+
✅ **Safe** - Asks for confirmation before executing transactions
|
|
329
|
+
✅ **Educational** - Shows what MCP tools are being used behind the scenes
|
|
330
|
+
|
|
331
|
+
### Example Slash Command Usage
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
User: /galachain-launchpad:analyze-token tokenName=anime
|
|
335
|
+
|
|
336
|
+
Claude: I'll analyze the token "anime" using the Gala Launchpad MCP server:
|
|
337
|
+
|
|
338
|
+
1. Fetching optimized pool details...
|
|
339
|
+
✅ Current supply: 510,379.79
|
|
340
|
+
✅ Remaining tokens: 9,489,620.21
|
|
341
|
+
✅ Max supply: 10,000,000
|
|
342
|
+
|
|
343
|
+
2. Calculating USD spot price (LOCAL mode - instant!)...
|
|
344
|
+
✅ Spot price: $0.000153
|
|
345
|
+
|
|
346
|
+
3. Calculating graduation cost (LOCAL mode - instant!)...
|
|
347
|
+
✅ GALA required: 1,640,974.33 GALA
|
|
348
|
+
✅ Transaction fee: 1,640.97 GALA
|
|
349
|
+
✅ Total cost: 1,642,615.30 GALA
|
|
350
|
+
|
|
351
|
+
4. Pool progress: 5.10% complete
|
|
352
|
+
|
|
353
|
+
Analysis:
|
|
354
|
+
- Current price is relatively low (early stage token)
|
|
355
|
+
- Requires significant GALA (~1.6M) to graduate
|
|
356
|
+
- Only 5% through bonding curve - high risk, high potential reward
|
|
357
|
+
- Good opportunity for early entry if you believe in the project
|
|
358
|
+
```
|
|
359
|
+
|
|
232
360
|
## 📚 SDK Usage Reference
|
|
233
361
|
|
|
234
362
|
The MCP server includes a built-in SDK documentation tool that provides complete, runnable code examples for using the SDK directly instead of through MCP tools. This is perfect for developers who want to integrate the SDK into their applications.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tool Name Constants
|
|
3
|
+
*
|
|
4
|
+
* Centralized constants for all Gala Launchpad MCP tool names.
|
|
5
|
+
* Use these constants instead of hardcoded strings to prevent typos
|
|
6
|
+
* and enable IDE autocomplete.
|
|
7
|
+
*
|
|
8
|
+
* Total: 47 tools across 7 categories
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Pool Management & Pricing Tools (12 tools)
|
|
12
|
+
*/
|
|
13
|
+
export declare const POOL_TOOLS: {
|
|
14
|
+
readonly FETCH_POOLS: "gala_launchpad_fetch_pools";
|
|
15
|
+
readonly FETCH_POOL_DETAILS: "gala_launchpad_fetch_pool_details";
|
|
16
|
+
readonly FETCH_POOL_DETAILS_FOR_CALCULATION: "gala_launchpad_fetch_pool_details_for_calculation";
|
|
17
|
+
readonly FETCH_TOKEN_DISTRIBUTION: "gala_launchpad_fetch_token_distribution";
|
|
18
|
+
readonly FETCH_TOKEN_BADGES: "gala_launchpad_fetch_token_badges";
|
|
19
|
+
readonly FETCH_VOLUME_DATA: "gala_launchpad_fetch_volume_data";
|
|
20
|
+
readonly FETCH_GALA_SPOT_PRICE: "gala_launchpad_fetch_gala_spot_price";
|
|
21
|
+
readonly FETCH_TOKEN_SPOT_PRICE: "gala_launchpad_fetch_token_spot_price";
|
|
22
|
+
readonly FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE: "gala_launchpad_fetch_launchpad_token_spot_price";
|
|
23
|
+
readonly CHECK_TOKEN_NAME: "gala_launchpad_check_token_name";
|
|
24
|
+
readonly CHECK_TOKEN_SYMBOL: "gala_launchpad_check_token_symbol";
|
|
25
|
+
readonly IS_TOKEN_GRADUATED: "gala_launchpad_is_token_graduated";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Trading Operations Tools (9 tools)
|
|
29
|
+
*/
|
|
30
|
+
export declare const TRADING_TOOLS: {
|
|
31
|
+
readonly CALCULATE_BUY_AMOUNT: "gala_launchpad_calculate_buy_amount";
|
|
32
|
+
readonly CALCULATE_BUY_AMOUNT_LOCAL: "gala_launchpad_calculate_buy_amount_local";
|
|
33
|
+
readonly CALCULATE_BUY_AMOUNT_EXTERNAL: "gala_launchpad_calculate_buy_amount_external";
|
|
34
|
+
readonly CALCULATE_SELL_AMOUNT: "gala_launchpad_calculate_sell_amount";
|
|
35
|
+
readonly CALCULATE_SELL_AMOUNT_LOCAL: "gala_launchpad_calculate_sell_amount_local";
|
|
36
|
+
readonly CALCULATE_SELL_AMOUNT_EXTERNAL: "gala_launchpad_calculate_sell_amount_external";
|
|
37
|
+
readonly CALCULATE_BUY_AMOUNT_FOR_GRADUATION: "gala_launchpad_calculate_buy_amount_for_graduation";
|
|
38
|
+
readonly BUY_TOKENS: "gala_launchpad_buy_tokens";
|
|
39
|
+
readonly SELL_TOKENS: "gala_launchpad_sell_tokens";
|
|
40
|
+
readonly GRADUATE_TOKEN: "gala_launchpad_graduate_token";
|
|
41
|
+
readonly FETCH_TRADES: "gala_launchpad_fetch_trades";
|
|
42
|
+
readonly GET_BUNDLER_TRANSACTION_RESULT: "gala_launchpad_get_bundler_transaction_result";
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Balance & Portfolio Tools (6 tools)
|
|
46
|
+
*/
|
|
47
|
+
export declare const BALANCE_TOOLS: {
|
|
48
|
+
readonly FETCH_GALA_BALANCE: "gala_launchpad_fetch_gala_balance";
|
|
49
|
+
readonly FETCH_TOKEN_BALANCE: "gala_launchpad_fetch_token_balance";
|
|
50
|
+
readonly FETCH_TOKENS_HELD: "gala_launchpad_fetch_tokens_held";
|
|
51
|
+
readonly FETCH_TOKENS_CREATED: "gala_launchpad_fetch_tokens_created";
|
|
52
|
+
readonly FETCH_PROFILE: "gala_launchpad_fetch_profile";
|
|
53
|
+
readonly UPDATE_PROFILE: "gala_launchpad_update_profile";
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Token Creation Tools (4 tools)
|
|
57
|
+
*/
|
|
58
|
+
export declare const CREATION_TOOLS: {
|
|
59
|
+
readonly LAUNCH_TOKEN: "gala_launchpad_launch_token";
|
|
60
|
+
readonly UPLOAD_TOKEN_IMAGE: "gala_launchpad_upload_token_image";
|
|
61
|
+
readonly UPLOAD_PROFILE_IMAGE: "gala_launchpad_upload_profile_image";
|
|
62
|
+
readonly FETCH_LAUNCH_TOKEN_FEE: "gala_launchpad_fetch_launch_token_fee";
|
|
63
|
+
readonly CALCULATE_INITIAL_BUY: "gala_launchpad_calculate_initial_buy";
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Social & Comments Tools (2 tools)
|
|
67
|
+
*/
|
|
68
|
+
export declare const SOCIAL_TOOLS: {
|
|
69
|
+
readonly POST_COMMENT: "gala_launchpad_post_comment";
|
|
70
|
+
readonly FETCH_COMMENTS: "gala_launchpad_fetch_comments";
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Token Transfer Tools (2 tools)
|
|
74
|
+
*/
|
|
75
|
+
export declare const TRANSFER_TOOLS: {
|
|
76
|
+
readonly TRANSFER_GALA: "gala_launchpad_transfer_gala";
|
|
77
|
+
readonly TRANSFER_TOKEN: "gala_launchpad_transfer_token";
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Utility Tools (6 tools)
|
|
81
|
+
*/
|
|
82
|
+
export declare const UTILITY_TOOLS: {
|
|
83
|
+
readonly CREATE_WALLET: "gala_launchpad_create_wallet";
|
|
84
|
+
readonly GET_ADDRESS: "gala_launchpad_get_address";
|
|
85
|
+
readonly GET_ETHEREUM_ADDRESS: "gala_launchpad_get_ethereum_address";
|
|
86
|
+
readonly GET_CONFIG: "gala_launchpad_get_config";
|
|
87
|
+
readonly GET_URL_BY_TOKEN_NAME: "gala_launchpad_get_url_by_token_name";
|
|
88
|
+
readonly RESOLVE_TOKEN_CLASS_KEY: "gala_launchpad_resolve_token_class_key";
|
|
89
|
+
readonly RESOLVE_VAULT_ADDRESS: "gala_launchpad_resolve_vault_address";
|
|
90
|
+
readonly EXPLAIN_SDK_USAGE: "gala_launchpad_explain_sdk_usage";
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* All MCP Tools - Flat structure for easy access
|
|
94
|
+
*
|
|
95
|
+
* Use specific category constants above for better organization,
|
|
96
|
+
* or use this flat object for backwards compatibility.
|
|
97
|
+
*/
|
|
98
|
+
export declare const MCP_TOOLS: {
|
|
99
|
+
readonly CREATE_WALLET: "gala_launchpad_create_wallet";
|
|
100
|
+
readonly GET_ADDRESS: "gala_launchpad_get_address";
|
|
101
|
+
readonly GET_ETHEREUM_ADDRESS: "gala_launchpad_get_ethereum_address";
|
|
102
|
+
readonly GET_CONFIG: "gala_launchpad_get_config";
|
|
103
|
+
readonly GET_URL_BY_TOKEN_NAME: "gala_launchpad_get_url_by_token_name";
|
|
104
|
+
readonly RESOLVE_TOKEN_CLASS_KEY: "gala_launchpad_resolve_token_class_key";
|
|
105
|
+
readonly RESOLVE_VAULT_ADDRESS: "gala_launchpad_resolve_vault_address";
|
|
106
|
+
readonly EXPLAIN_SDK_USAGE: "gala_launchpad_explain_sdk_usage";
|
|
107
|
+
readonly TRANSFER_GALA: "gala_launchpad_transfer_gala";
|
|
108
|
+
readonly TRANSFER_TOKEN: "gala_launchpad_transfer_token";
|
|
109
|
+
readonly POST_COMMENT: "gala_launchpad_post_comment";
|
|
110
|
+
readonly FETCH_COMMENTS: "gala_launchpad_fetch_comments";
|
|
111
|
+
readonly LAUNCH_TOKEN: "gala_launchpad_launch_token";
|
|
112
|
+
readonly UPLOAD_TOKEN_IMAGE: "gala_launchpad_upload_token_image";
|
|
113
|
+
readonly UPLOAD_PROFILE_IMAGE: "gala_launchpad_upload_profile_image";
|
|
114
|
+
readonly FETCH_LAUNCH_TOKEN_FEE: "gala_launchpad_fetch_launch_token_fee";
|
|
115
|
+
readonly CALCULATE_INITIAL_BUY: "gala_launchpad_calculate_initial_buy";
|
|
116
|
+
readonly FETCH_GALA_BALANCE: "gala_launchpad_fetch_gala_balance";
|
|
117
|
+
readonly FETCH_TOKEN_BALANCE: "gala_launchpad_fetch_token_balance";
|
|
118
|
+
readonly FETCH_TOKENS_HELD: "gala_launchpad_fetch_tokens_held";
|
|
119
|
+
readonly FETCH_TOKENS_CREATED: "gala_launchpad_fetch_tokens_created";
|
|
120
|
+
readonly FETCH_PROFILE: "gala_launchpad_fetch_profile";
|
|
121
|
+
readonly UPDATE_PROFILE: "gala_launchpad_update_profile";
|
|
122
|
+
readonly CALCULATE_BUY_AMOUNT: "gala_launchpad_calculate_buy_amount";
|
|
123
|
+
readonly CALCULATE_BUY_AMOUNT_LOCAL: "gala_launchpad_calculate_buy_amount_local";
|
|
124
|
+
readonly CALCULATE_BUY_AMOUNT_EXTERNAL: "gala_launchpad_calculate_buy_amount_external";
|
|
125
|
+
readonly CALCULATE_SELL_AMOUNT: "gala_launchpad_calculate_sell_amount";
|
|
126
|
+
readonly CALCULATE_SELL_AMOUNT_LOCAL: "gala_launchpad_calculate_sell_amount_local";
|
|
127
|
+
readonly CALCULATE_SELL_AMOUNT_EXTERNAL: "gala_launchpad_calculate_sell_amount_external";
|
|
128
|
+
readonly CALCULATE_BUY_AMOUNT_FOR_GRADUATION: "gala_launchpad_calculate_buy_amount_for_graduation";
|
|
129
|
+
readonly BUY_TOKENS: "gala_launchpad_buy_tokens";
|
|
130
|
+
readonly SELL_TOKENS: "gala_launchpad_sell_tokens";
|
|
131
|
+
readonly GRADUATE_TOKEN: "gala_launchpad_graduate_token";
|
|
132
|
+
readonly FETCH_TRADES: "gala_launchpad_fetch_trades";
|
|
133
|
+
readonly GET_BUNDLER_TRANSACTION_RESULT: "gala_launchpad_get_bundler_transaction_result";
|
|
134
|
+
readonly FETCH_POOLS: "gala_launchpad_fetch_pools";
|
|
135
|
+
readonly FETCH_POOL_DETAILS: "gala_launchpad_fetch_pool_details";
|
|
136
|
+
readonly FETCH_POOL_DETAILS_FOR_CALCULATION: "gala_launchpad_fetch_pool_details_for_calculation";
|
|
137
|
+
readonly FETCH_TOKEN_DISTRIBUTION: "gala_launchpad_fetch_token_distribution";
|
|
138
|
+
readonly FETCH_TOKEN_BADGES: "gala_launchpad_fetch_token_badges";
|
|
139
|
+
readonly FETCH_VOLUME_DATA: "gala_launchpad_fetch_volume_data";
|
|
140
|
+
readonly FETCH_GALA_SPOT_PRICE: "gala_launchpad_fetch_gala_spot_price";
|
|
141
|
+
readonly FETCH_TOKEN_SPOT_PRICE: "gala_launchpad_fetch_token_spot_price";
|
|
142
|
+
readonly FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE: "gala_launchpad_fetch_launchpad_token_spot_price";
|
|
143
|
+
readonly CHECK_TOKEN_NAME: "gala_launchpad_check_token_name";
|
|
144
|
+
readonly CHECK_TOKEN_SYMBOL: "gala_launchpad_check_token_symbol";
|
|
145
|
+
readonly IS_TOKEN_GRADUATED: "gala_launchpad_is_token_graduated";
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Type helper for tool names
|
|
149
|
+
*/
|
|
150
|
+
export type MCPToolName = (typeof MCP_TOOLS)[keyof typeof MCP_TOOLS];
|
|
151
|
+
/**
|
|
152
|
+
* Get all tool names as an array
|
|
153
|
+
*/
|
|
154
|
+
export declare function getAllToolNames(): string[];
|
|
155
|
+
/**
|
|
156
|
+
* Check if a string is a valid MCP tool name
|
|
157
|
+
*/
|
|
158
|
+
export declare function isValidToolName(name: string): name is MCPToolName;
|
|
159
|
+
//# sourceMappingURL=mcpToolNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpToolNames.d.ts","sourceRoot":"","sources":["../../src/constants/mcpToolNames.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAab,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAahB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;CAShB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAeZ,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAErE;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,WAAW,CAEjE"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Tool Name Constants
|
|
4
|
+
*
|
|
5
|
+
* Centralized constants for all Gala Launchpad MCP tool names.
|
|
6
|
+
* Use these constants instead of hardcoded strings to prevent typos
|
|
7
|
+
* and enable IDE autocomplete.
|
|
8
|
+
*
|
|
9
|
+
* Total: 47 tools across 7 categories
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MCP_TOOLS = exports.UTILITY_TOOLS = exports.TRANSFER_TOOLS = exports.SOCIAL_TOOLS = exports.CREATION_TOOLS = exports.BALANCE_TOOLS = exports.TRADING_TOOLS = exports.POOL_TOOLS = void 0;
|
|
13
|
+
exports.getAllToolNames = getAllToolNames;
|
|
14
|
+
exports.isValidToolName = isValidToolName;
|
|
15
|
+
/**
|
|
16
|
+
* Pool Management & Pricing Tools (12 tools)
|
|
17
|
+
*/
|
|
18
|
+
exports.POOL_TOOLS = {
|
|
19
|
+
FETCH_POOLS: 'gala_launchpad_fetch_pools',
|
|
20
|
+
FETCH_POOL_DETAILS: 'gala_launchpad_fetch_pool_details',
|
|
21
|
+
FETCH_POOL_DETAILS_FOR_CALCULATION: 'gala_launchpad_fetch_pool_details_for_calculation',
|
|
22
|
+
FETCH_TOKEN_DISTRIBUTION: 'gala_launchpad_fetch_token_distribution',
|
|
23
|
+
FETCH_TOKEN_BADGES: 'gala_launchpad_fetch_token_badges',
|
|
24
|
+
FETCH_VOLUME_DATA: 'gala_launchpad_fetch_volume_data',
|
|
25
|
+
FETCH_GALA_SPOT_PRICE: 'gala_launchpad_fetch_gala_spot_price',
|
|
26
|
+
FETCH_TOKEN_SPOT_PRICE: 'gala_launchpad_fetch_token_spot_price',
|
|
27
|
+
FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE: 'gala_launchpad_fetch_launchpad_token_spot_price',
|
|
28
|
+
CHECK_TOKEN_NAME: 'gala_launchpad_check_token_name',
|
|
29
|
+
CHECK_TOKEN_SYMBOL: 'gala_launchpad_check_token_symbol',
|
|
30
|
+
IS_TOKEN_GRADUATED: 'gala_launchpad_is_token_graduated',
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Trading Operations Tools (9 tools)
|
|
34
|
+
*/
|
|
35
|
+
exports.TRADING_TOOLS = {
|
|
36
|
+
CALCULATE_BUY_AMOUNT: 'gala_launchpad_calculate_buy_amount',
|
|
37
|
+
CALCULATE_BUY_AMOUNT_LOCAL: 'gala_launchpad_calculate_buy_amount_local',
|
|
38
|
+
CALCULATE_BUY_AMOUNT_EXTERNAL: 'gala_launchpad_calculate_buy_amount_external',
|
|
39
|
+
CALCULATE_SELL_AMOUNT: 'gala_launchpad_calculate_sell_amount',
|
|
40
|
+
CALCULATE_SELL_AMOUNT_LOCAL: 'gala_launchpad_calculate_sell_amount_local',
|
|
41
|
+
CALCULATE_SELL_AMOUNT_EXTERNAL: 'gala_launchpad_calculate_sell_amount_external',
|
|
42
|
+
CALCULATE_BUY_AMOUNT_FOR_GRADUATION: 'gala_launchpad_calculate_buy_amount_for_graduation',
|
|
43
|
+
BUY_TOKENS: 'gala_launchpad_buy_tokens',
|
|
44
|
+
SELL_TOKENS: 'gala_launchpad_sell_tokens',
|
|
45
|
+
GRADUATE_TOKEN: 'gala_launchpad_graduate_token',
|
|
46
|
+
FETCH_TRADES: 'gala_launchpad_fetch_trades',
|
|
47
|
+
GET_BUNDLER_TRANSACTION_RESULT: 'gala_launchpad_get_bundler_transaction_result',
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Balance & Portfolio Tools (6 tools)
|
|
51
|
+
*/
|
|
52
|
+
exports.BALANCE_TOOLS = {
|
|
53
|
+
FETCH_GALA_BALANCE: 'gala_launchpad_fetch_gala_balance',
|
|
54
|
+
FETCH_TOKEN_BALANCE: 'gala_launchpad_fetch_token_balance',
|
|
55
|
+
FETCH_TOKENS_HELD: 'gala_launchpad_fetch_tokens_held',
|
|
56
|
+
FETCH_TOKENS_CREATED: 'gala_launchpad_fetch_tokens_created',
|
|
57
|
+
FETCH_PROFILE: 'gala_launchpad_fetch_profile',
|
|
58
|
+
UPDATE_PROFILE: 'gala_launchpad_update_profile',
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Token Creation Tools (4 tools)
|
|
62
|
+
*/
|
|
63
|
+
exports.CREATION_TOOLS = {
|
|
64
|
+
LAUNCH_TOKEN: 'gala_launchpad_launch_token',
|
|
65
|
+
UPLOAD_TOKEN_IMAGE: 'gala_launchpad_upload_token_image',
|
|
66
|
+
UPLOAD_PROFILE_IMAGE: 'gala_launchpad_upload_profile_image',
|
|
67
|
+
FETCH_LAUNCH_TOKEN_FEE: 'gala_launchpad_fetch_launch_token_fee',
|
|
68
|
+
CALCULATE_INITIAL_BUY: 'gala_launchpad_calculate_initial_buy',
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Social & Comments Tools (2 tools)
|
|
72
|
+
*/
|
|
73
|
+
exports.SOCIAL_TOOLS = {
|
|
74
|
+
POST_COMMENT: 'gala_launchpad_post_comment',
|
|
75
|
+
FETCH_COMMENTS: 'gala_launchpad_fetch_comments',
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Token Transfer Tools (2 tools)
|
|
79
|
+
*/
|
|
80
|
+
exports.TRANSFER_TOOLS = {
|
|
81
|
+
TRANSFER_GALA: 'gala_launchpad_transfer_gala',
|
|
82
|
+
TRANSFER_TOKEN: 'gala_launchpad_transfer_token',
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Utility Tools (6 tools)
|
|
86
|
+
*/
|
|
87
|
+
exports.UTILITY_TOOLS = {
|
|
88
|
+
CREATE_WALLET: 'gala_launchpad_create_wallet',
|
|
89
|
+
GET_ADDRESS: 'gala_launchpad_get_address',
|
|
90
|
+
GET_ETHEREUM_ADDRESS: 'gala_launchpad_get_ethereum_address',
|
|
91
|
+
GET_CONFIG: 'gala_launchpad_get_config',
|
|
92
|
+
GET_URL_BY_TOKEN_NAME: 'gala_launchpad_get_url_by_token_name',
|
|
93
|
+
RESOLVE_TOKEN_CLASS_KEY: 'gala_launchpad_resolve_token_class_key',
|
|
94
|
+
RESOLVE_VAULT_ADDRESS: 'gala_launchpad_resolve_vault_address',
|
|
95
|
+
EXPLAIN_SDK_USAGE: 'gala_launchpad_explain_sdk_usage',
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* All MCP Tools - Flat structure for easy access
|
|
99
|
+
*
|
|
100
|
+
* Use specific category constants above for better organization,
|
|
101
|
+
* or use this flat object for backwards compatibility.
|
|
102
|
+
*/
|
|
103
|
+
exports.MCP_TOOLS = {
|
|
104
|
+
// Pool Management & Pricing
|
|
105
|
+
...exports.POOL_TOOLS,
|
|
106
|
+
// Trading Operations
|
|
107
|
+
...exports.TRADING_TOOLS,
|
|
108
|
+
// Balance & Portfolio
|
|
109
|
+
...exports.BALANCE_TOOLS,
|
|
110
|
+
// Token Creation
|
|
111
|
+
...exports.CREATION_TOOLS,
|
|
112
|
+
// Social & Comments
|
|
113
|
+
...exports.SOCIAL_TOOLS,
|
|
114
|
+
// Token Transfers
|
|
115
|
+
...exports.TRANSFER_TOOLS,
|
|
116
|
+
// Utilities
|
|
117
|
+
...exports.UTILITY_TOOLS,
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Get all tool names as an array
|
|
121
|
+
*/
|
|
122
|
+
function getAllToolNames() {
|
|
123
|
+
return Object.values(exports.MCP_TOOLS);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Check if a string is a valid MCP tool name
|
|
127
|
+
*/
|
|
128
|
+
function isValidToolName(name) {
|
|
129
|
+
return getAllToolNames().includes(name);
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=mcpToolNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpToolNames.js","sourceRoot":"","sources":["../../src/constants/mcpToolNames.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA0HH,0CAEC;AAKD,0CAEC;AAjID;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,WAAW,EAAE,4BAA4B;IACzC,kBAAkB,EAAE,mCAAmC;IACvD,kCAAkC,EAAE,mDAAmD;IACvF,wBAAwB,EAAE,yCAAyC;IACnE,kBAAkB,EAAE,mCAAmC;IACvD,iBAAiB,EAAE,kCAAkC;IACrD,qBAAqB,EAAE,sCAAsC;IAC7D,sBAAsB,EAAE,uCAAuC;IAC/D,gC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,oBAAoB,EAAE,qCAAqC;IAC3D,UAAU,EAAE,2BAA2B;IACvC,qBAAqB,EAAE,sCAAsC;IAC7D,uBAAuB,EAAE,wCAAwC;IACjE,qBAAqB,EAAE,sCAAsC;IAC7D,iBAAiB,EAAE,kCAAkC;CAC7C,CAAC;AAEX;;;;;GAKG;AACU,QAAA,SAAS,GAAG;IACvB,4BAA4B;IAC5B,GAAG,kBAAU;IACb,qBAAqB;IACrB,GAAG,qBAAa;IAChB,sBAAsB;IACtB,GAAG,qBAAa;IAChB,iBAAiB;IACjB,GAAG,sBAAc;IACjB,oBAAoB;IACpB,GAAG,oBAAY;IACf,kBAAkB;IAClB,GAAG,sBAAc;IACjB,YAAY;IACZ,GAAG,qBAAa;CACR,CAAC;AAOX;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAS,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,eAAe,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptStructure.test.d.ts","sourceRoot":"","sources":["../../../src/prompts/__tests__/promptStructure.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Prompt Structure Tests
|
|
4
|
+
*
|
|
5
|
+
* Validates that all prompts conform to MCP protocol specification
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const index_1 = require("../index");
|
|
9
|
+
describe('Prompt Structure', () => {
|
|
10
|
+
// Helper to generate valid args for each prompt type
|
|
11
|
+
function getValidArgsForPrompt(promptName) {
|
|
12
|
+
if (promptName.includes('analyze-token') || promptName.includes('pool-details')) {
|
|
13
|
+
return { tokenName: 'anime' };
|
|
14
|
+
}
|
|
15
|
+
if (promptName.includes('buy-tokens')) {
|
|
16
|
+
return { tokenName: 'anime', galaAmount: '100' };
|
|
17
|
+
}
|
|
18
|
+
if (promptName.includes('sell-tokens')) {
|
|
19
|
+
return { tokenName: 'anime', tokenAmount: '1000' };
|
|
20
|
+
}
|
|
21
|
+
if (promptName.includes('graduate-token')) {
|
|
22
|
+
return { tokenName: 'anime' };
|
|
23
|
+
}
|
|
24
|
+
if (promptName.includes('compare-tokens')) {
|
|
25
|
+
return { token1: 'anime', token2: 'test' };
|
|
26
|
+
}
|
|
27
|
+
if (promptName.includes('graduation-status') || promptName.includes('spot-prices')) {
|
|
28
|
+
return { tokens: 'anime,test,dragon' };
|
|
29
|
+
}
|
|
30
|
+
return {}; // For prompts with no required args (portfolio, balance, etc.)
|
|
31
|
+
}
|
|
32
|
+
describe('MCP Protocol Compliance', () => {
|
|
33
|
+
it.each(index_1.prompts)('$name should have required fields', (prompt) => {
|
|
34
|
+
expect(prompt).toHaveProperty('name');
|
|
35
|
+
expect(prompt).toHaveProperty('description');
|
|
36
|
+
expect(prompt).toHaveProperty('handler');
|
|
37
|
+
expect(typeof prompt.name).toBe('string');
|
|
38
|
+
expect(typeof prompt.description).toBe('string');
|
|
39
|
+
expect(typeof prompt.handler).toBe('function');
|
|
40
|
+
});
|
|
41
|
+
it.each(index_1.prompts)('$name should have valid argument structure', (prompt) => {
|
|
42
|
+
if (prompt.arguments) {
|
|
43
|
+
expect(Array.isArray(prompt.arguments)).toBe(true);
|
|
44
|
+
prompt.arguments.forEach((arg) => {
|
|
45
|
+
expect(arg).toHaveProperty('name');
|
|
46
|
+
expect(arg).toHaveProperty('description');
|
|
47
|
+
expect(arg).toHaveProperty('required');
|
|
48
|
+
expect(typeof arg.name).toBe('string');
|
|
49
|
+
expect(typeof arg.description).toBe('string');
|
|
50
|
+
expect(typeof arg.required).toBe('boolean');
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
it.each(index_1.prompts)('$name handler should return PromptMessage array', (prompt) => {
|
|
55
|
+
const args = getValidArgsForPrompt(prompt.name);
|
|
56
|
+
const messages = prompt.handler(args);
|
|
57
|
+
expect(Array.isArray(messages)).toBe(true);
|
|
58
|
+
expect(messages.length).toBeGreaterThan(0);
|
|
59
|
+
});
|
|
60
|
+
it.each(index_1.prompts)('$name messages should have valid structure', (prompt) => {
|
|
61
|
+
const args = getValidArgsForPrompt(prompt.name);
|
|
62
|
+
const messages = prompt.handler(args);
|
|
63
|
+
messages.forEach((msg) => {
|
|
64
|
+
expect(msg).toHaveProperty('role');
|
|
65
|
+
expect(msg).toHaveProperty('content');
|
|
66
|
+
expect(['user', 'assistant']).toContain(msg.role);
|
|
67
|
+
expect(msg.content).toHaveProperty('type');
|
|
68
|
+
expect(['text', 'image', 'resource']).toContain(msg.content.type);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe('Handler Execution', () => {
|
|
73
|
+
it('analyze-token handler should accept tokenName', () => {
|
|
74
|
+
const prompt = index_1.prompts.find((p) => p.name === 'galachain-launchpad:analyze-token');
|
|
75
|
+
expect(() => prompt?.handler({ tokenName: 'anime' })).not.toThrow();
|
|
76
|
+
});
|
|
77
|
+
it('buy-tokens handler should accept required args', () => {
|
|
78
|
+
const prompt = index_1.prompts.find((p) => p.name === 'galachain-launchpad:buy-tokens');
|
|
79
|
+
expect(() => prompt?.handler({ tokenName: 'anime', galaAmount: '100' })).not.toThrow();
|
|
80
|
+
});
|
|
81
|
+
it('graduate-token handler should accept optional slippage', () => {
|
|
82
|
+
const prompt = index_1.prompts.find((p) => p.name === 'galachain-launchpad:graduate-token');
|
|
83
|
+
expect(() => prompt?.handler({ tokenName: 'anime', slippage: '2' })).not.toThrow();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
describe('Message Content', () => {
|
|
87
|
+
it.each(index_1.prompts)('$name should generate non-empty text content', (prompt) => {
|
|
88
|
+
const args = getValidArgsForPrompt(prompt.name);
|
|
89
|
+
const messages = prompt.handler(args);
|
|
90
|
+
messages.forEach((msg) => {
|
|
91
|
+
if (msg.content.type === 'text') {
|
|
92
|
+
expect(msg.content.text).toBeDefined();
|
|
93
|
+
expect(msg.content.text.length).toBeGreaterThan(10);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
it.each(index_1.prompts)('$name should reference MCP tools in instructions', (prompt) => {
|
|
98
|
+
const args = getValidArgsForPrompt(prompt.name);
|
|
99
|
+
const messages = prompt.handler(args);
|
|
100
|
+
const text = messages[0].content.text || '';
|
|
101
|
+
// Should contain at least one tool reference
|
|
102
|
+
expect(text).toMatch(/gala_launchpad_/);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=promptStructure.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptStructure.test.js","sourceRoot":"","sources":["../../../src/prompts/__tests__/promptStructure.test.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,oCAAmC;AAEnC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,qDAAqD;IACrD,SAAS,qBAAqB,CAAC,UAAkB;QAC/C,IAAI,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YAChF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;QAChC,CAAC;QACD,IAAI,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACtC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;QACnD,CAAC;QACD,IAAI,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YACvC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;QACrD,CAAC;QACD,IAAI,UAAU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