@gala-chain/launchpad-mcp-server 1.24.1 → 1.25.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/generated/version.d.ts +1 -1
  3. package/dist/generated/version.js +1 -1
  4. package/dist/tools/index.d.ts +2 -2
  5. package/dist/tools/index.js +3 -3
  6. package/dist/tools/pools/index.d.ts.map +1 -1
  7. package/dist/tools/pools/index.js +4 -0
  8. package/dist/tools/pools/index.js.map +1 -1
  9. package/dist/tools/pools/onDexPoolCreation.d.ts +6 -0
  10. package/dist/tools/pools/onDexPoolCreation.d.ts.map +1 -0
  11. package/dist/tools/pools/onDexPoolCreation.js +60 -0
  12. package/dist/tools/pools/onDexPoolCreation.js.map +1 -0
  13. package/dist/tools/pools/onLaunchpadTokenCreation.d.ts +6 -0
  14. package/dist/tools/pools/onLaunchpadTokenCreation.d.ts.map +1 -0
  15. package/dist/tools/pools/onLaunchpadTokenCreation.js +54 -0
  16. package/dist/tools/pools/onLaunchpadTokenCreation.js.map +1 -0
  17. package/package.json +2 -2
  18. package/docs/AI-AGENT-PATTERNS.md +0 -555
  19. package/docs/CONSTRAINTS-REFERENCE.md +0 -454
  20. package/docs/PROMPT-TOOL-MAPPING.md +0 -352
  21. package/docs/examples/default-values-pattern.md +0 -240
  22. package/docs/examples/tool-factory-pattern.md +0 -217
  23. package/jest.config.js +0 -94
  24. package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +0 -258
  25. package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
  26. package/src/__tests__/server.test.ts +0 -255
  27. package/src/constants/mcpToolNames.ts +0 -183
  28. package/src/index.ts +0 -19
  29. package/src/prompts/__tests__/promptStructure.test.ts +0 -187
  30. package/src/prompts/__tests__/registry.test.ts +0 -349
  31. package/src/prompts/analysis.ts +0 -380
  32. package/src/prompts/balances.ts +0 -182
  33. package/src/prompts/create-token.ts +0 -123
  34. package/src/prompts/creation-utils.ts +0 -103
  35. package/src/prompts/dex-trading.ts +0 -86
  36. package/src/prompts/discover-tokens.ts +0 -86
  37. package/src/prompts/explore-dex-pools.ts +0 -138
  38. package/src/prompts/index.ts +0 -178
  39. package/src/prompts/liquidity-positions.ts +0 -237
  40. package/src/prompts/pools.ts +0 -496
  41. package/src/prompts/portfolio.ts +0 -208
  42. package/src/prompts/social.ts +0 -94
  43. package/src/prompts/trading-calculations.ts +0 -414
  44. package/src/prompts/trading.ts +0 -160
  45. package/src/prompts/transfers.ts +0 -97
  46. package/src/prompts/utility-tools.ts +0 -266
  47. package/src/prompts/utility.ts +0 -77
  48. package/src/prompts/utils/handlerHelpers.ts +0 -55
  49. package/src/prompts/utils/textTemplates.ts +0 -73
  50. package/src/prompts/utils/workflowTemplates.ts +0 -511
  51. package/src/schemas/common-schemas.ts +0 -393
  52. package/src/scripts/test-all-prompts.ts +0 -184
  53. package/src/server.ts +0 -367
  54. package/src/tools/__tests__/dex-tools.test.ts +0 -562
  55. package/src/tools/__tests__/liquidity-positions.test.ts +0 -673
  56. package/src/tools/balance/index.ts +0 -174
  57. package/src/tools/creation/index.ts +0 -182
  58. package/src/tools/dex/fetchAllDexPools.ts +0 -45
  59. package/src/tools/dex/fetchDexPools.ts +0 -58
  60. package/src/tools/dex/index.ts +0 -231
  61. package/src/tools/dex/liquidity-positions.ts +0 -547
  62. package/src/tools/index.ts +0 -94
  63. package/src/tools/pools/fetchAllPools.ts +0 -47
  64. package/src/tools/pools/fetchAllPriceHistory.ts +0 -119
  65. package/src/tools/pools/fetchPoolDetails.ts +0 -27
  66. package/src/tools/pools/fetchPoolDetailsForCalculation.ts +0 -22
  67. package/src/tools/pools/fetchPools.ts +0 -47
  68. package/src/tools/pools/fetchPriceHistory.ts +0 -124
  69. package/src/tools/pools/fetchTokenDetails.ts +0 -77
  70. package/src/tools/pools/index.ts +0 -284
  71. package/src/tools/social/index.ts +0 -64
  72. package/src/tools/trading/index.ts +0 -605
  73. package/src/tools/transfers/index.ts +0 -75
  74. package/src/tools/utils/clearCache.ts +0 -36
  75. package/src/tools/utils/createWallet.ts +0 -19
  76. package/src/tools/utils/explainSdkUsage.ts +0 -1446
  77. package/src/tools/utils/getAddress.ts +0 -12
  78. package/src/tools/utils/getCacheInfo.ts +0 -14
  79. package/src/tools/utils/getConfig.ts +0 -21
  80. package/src/tools/utils/getEnvironment.ts +0 -17
  81. package/src/tools/utils/getEthereumAddress.ts +0 -12
  82. package/src/tools/utils/getUrlByTokenName.ts +0 -12
  83. package/src/tools/utils/getVersion.ts +0 -25
  84. package/src/tools/utils/getWallet.ts +0 -25
  85. package/src/tools/utils/hasWallet.ts +0 -15
  86. package/src/tools/utils/index.ts +0 -37
  87. package/src/tools/utils/isTokenGraduated.ts +0 -16
  88. package/src/tools/utils/setWallet.ts +0 -41
  89. package/src/tools/utils/switchEnvironment.ts +0 -28
  90. package/src/types/mcp.ts +0 -72
  91. package/src/utils/__tests__/validation.test.ts +0 -147
  92. package/src/utils/constraints.ts +0 -155
  93. package/src/utils/default-values.ts +0 -208
  94. package/src/utils/error-handler.ts +0 -69
  95. package/src/utils/error-templates.ts +0 -273
  96. package/src/utils/response-formatter.ts +0 -51
  97. package/src/utils/tool-factory.ts +0 -303
  98. package/src/utils/tool-registry.ts +0 -296
  99. package/src/utils/validation.ts +0 -429
  100. package/tests/wallet-management-integration.test.ts +0 -284
  101. package/tsconfig.json +0 -23
@@ -1,187 +0,0 @@
1
- /**
2
- * Prompt Structure Tests
3
- *
4
- * Validates that all prompts conform to MCP protocol specification
5
- */
6
-
7
- import { prompts } from '../index';
8
-
9
- describe('Prompt Structure', () => {
10
- // Helper to generate valid args for each prompt type
11
- function getValidArgsForPrompt(promptName: string): Record<string, string> {
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('create-token')) {
25
- return {
26
- tokenName: 'mytoken',
27
- tokenSymbol: 'MTK',
28
- description: 'Test token description',
29
- websiteUrl: 'https://example.com',
30
- };
31
- }
32
- if (promptName.includes('discover-tokens')) {
33
- return { type: 'recent', limit: '10' };
34
- }
35
- if (promptName.includes('compare-tokens')) {
36
- return { token1: 'anime', token2: 'test' };
37
- }
38
- if (promptName.includes('graduation-status') || promptName.includes('spot-prices')) {
39
- return { tokens: 'anime,test,dragon' };
40
- }
41
- if (promptName.includes('dex-swap')) {
42
- return { fromToken: 'GALA', toToken: 'GUSDC', amount: '100' };
43
- }
44
- if (promptName.includes('add-liquidity')) {
45
- return { token0: 'GALA', token1: 'GUSDC', amount0: '1000', amount1: '1000' };
46
- }
47
- if (promptName.includes('remove-liquidity')) {
48
- return { positionId: 'position-123', amount0: '500', amount1: '500' };
49
- }
50
- if (promptName.includes('collect-fees')) {
51
- return { positionId: 'position-123' };
52
- }
53
- // Pool prompts requiring tokenName
54
- if (promptName.includes('token-distribution') ||
55
- promptName.includes('token-badges') ||
56
- promptName.includes('volume-data') ||
57
- promptName.includes('token-spot-price') ||
58
- promptName.includes('check-token-name') ||
59
- promptName.includes('resolve-vault-address') ||
60
- promptName.includes('resolve-token-class-key') ||
61
- promptName.includes('upload-token-image') ||
62
- promptName.includes('post-comment') ||
63
- promptName.includes('fetch-comments')) {
64
- return { tokenName: 'anime' };
65
- }
66
- // Trading calculation prompts
67
- if (promptName.includes('calculate-buy-amount') ||
68
- promptName.includes('calculate-sell-amount') ||
69
- promptName.includes('calculate-graduation-cost') ||
70
- promptName.includes('is-token-graduated')) {
71
- return { tokenName: 'anime', amount: '100' };
72
- }
73
- if (promptName.includes('calculate-initial-buy')) {
74
- return { tokenName: 'anime', amount: '100', priceUsd: '1.0' };
75
- }
76
- // Balance prompts
77
- if (promptName.includes('token-balance') || promptName.includes('tokens-created')) {
78
- return { address: 'eth|0x1234567890123456789012345678901234567890', tokenName: 'anime' };
79
- }
80
- // Transfer prompts
81
- if (promptName.includes('transfer-gala')) {
82
- return { recipientAddress: 'eth|0x1234567890123456789012345678901234567890', amount: '100' };
83
- }
84
- if (promptName.includes('transfer-token')) {
85
- return { to: 'eth|0x1234567890123456789012345678901234567890', tokenName: 'anime', amount: '100' };
86
- }
87
- // Wallet prompts
88
- if (promptName.includes('set-wallet')) {
89
- return { privateKey: '0x1234567890123456789012345678901234567890123456789012345678901234' };
90
- }
91
- if (promptName.includes('get-url-by-token-name')) {
92
- return { tokenName: 'anime' };
93
- }
94
- if (promptName.includes('explain-sdk-usage')) {
95
- return { topic: 'buy-tokens' };
96
- }
97
- if (promptName.includes('fetch-price-history') || promptName.includes('fetch-all-price-history')) {
98
- return { tokenId: 'Token|Unit|GUSDC|eth:0x1234567890123456789012345678901234567890' };
99
- }
100
- if (promptName.includes('fetch-token-details')) {
101
- return { tokenId: 'Token|Unit|GUSDC|eth:0x1234567890123456789012345678901234567890' };
102
- }
103
- return {}; // For prompts with no required args (portfolio, balance, my-positions, version, etc.)
104
- }
105
-
106
- describe('MCP Protocol Compliance', () => {
107
- it.each(prompts)('$name should have required fields', (prompt) => {
108
- expect(prompt).toHaveProperty('name');
109
- expect(prompt).toHaveProperty('description');
110
- expect(prompt).toHaveProperty('handler');
111
- expect(typeof prompt.name).toBe('string');
112
- expect(typeof prompt.description).toBe('string');
113
- expect(typeof prompt.handler).toBe('function');
114
- });
115
-
116
- it.each(prompts)('$name should have valid argument structure', (prompt) => {
117
- if (prompt.arguments) {
118
- expect(Array.isArray(prompt.arguments)).toBe(true);
119
- prompt.arguments.forEach((arg) => {
120
- expect(arg).toHaveProperty('name');
121
- expect(arg).toHaveProperty('description');
122
- expect(arg).toHaveProperty('required');
123
- expect(typeof arg.name).toBe('string');
124
- expect(typeof arg.description).toBe('string');
125
- expect(typeof arg.required).toBe('boolean');
126
- });
127
- }
128
- });
129
-
130
- it.each(prompts)('$name handler should return PromptMessage array', (prompt) => {
131
- const args = getValidArgsForPrompt(prompt.name);
132
- const messages = prompt.handler(args);
133
- expect(Array.isArray(messages)).toBe(true);
134
- expect(messages.length).toBeGreaterThan(0);
135
- });
136
-
137
- it.each(prompts)('$name messages should have valid structure', (prompt) => {
138
- const args = getValidArgsForPrompt(prompt.name);
139
- const messages = prompt.handler(args);
140
- messages.forEach((msg) => {
141
- expect(msg).toHaveProperty('role');
142
- expect(msg).toHaveProperty('content');
143
- expect(['user', 'assistant']).toContain(msg.role);
144
- expect(msg.content).toHaveProperty('type');
145
- expect(['text', 'image', 'resource']).toContain(msg.content.type);
146
- });
147
- });
148
- });
149
-
150
- describe('Handler Execution', () => {
151
- it('analyze-token handler should accept tokenName', () => {
152
- const prompt = prompts.find((p) => p.name === 'galachain-launchpad:analyze-token');
153
- expect(() => prompt?.handler({ tokenName: 'anime' })).not.toThrow();
154
- });
155
-
156
- it('buy-tokens handler should accept required args', () => {
157
- const prompt = prompts.find((p) => p.name === 'galachain-launchpad:buy-tokens');
158
- expect(() => prompt?.handler({ tokenName: 'anime', galaAmount: '100' })).not.toThrow();
159
- });
160
-
161
- it('graduate-token handler should accept optional slippage', () => {
162
- const prompt = prompts.find((p) => p.name === 'galachain-launchpad:graduate-token');
163
- expect(() => prompt?.handler({ tokenName: 'anime', slippage: '2' })).not.toThrow();
164
- });
165
- });
166
-
167
- describe('Message Content', () => {
168
- it.each(prompts)('$name should generate non-empty text content', (prompt) => {
169
- const args = getValidArgsForPrompt(prompt.name);
170
- const messages = prompt.handler(args);
171
- messages.forEach((msg) => {
172
- if (msg.content.type === 'text') {
173
- expect(msg.content.text).toBeDefined();
174
- expect(msg.content.text!.length).toBeGreaterThan(10);
175
- }
176
- });
177
- });
178
-
179
- it.each(prompts)('$name should reference MCP tools in instructions', (prompt) => {
180
- const args = getValidArgsForPrompt(prompt.name);
181
- const messages = prompt.handler(args);
182
- const text = messages[0].content.text || '';
183
- // Should contain at least one tool reference
184
- expect(text).toMatch(/gala_launchpad_/);
185
- });
186
- });
187
- });
@@ -1,349 +0,0 @@
1
- /**
2
- * Prompt Registry Tests
3
- *
4
- * Tests for prompt registration, lookup, and utility functions
5
- * Updated to validate 72 total slash commands with 1:1 tool mapping
6
- */
7
-
8
- import {
9
- prompts,
10
- getPrompt,
11
- getPromptNames,
12
- hasPrompt,
13
- getPromptsByCategory,
14
- getPromptCount,
15
- } from '../index';
16
-
17
- describe('Prompt Registry', () => {
18
- describe('prompts array', () => {
19
- it('should contain exactly 74 prompts (1:1 tool-to-command mapping)', () => {
20
- expect(prompts).toHaveLength(74);
21
- });
22
-
23
- it('should have all unique prompt names', () => {
24
- const names = prompts.map((p) => p.name);
25
- const uniqueNames = new Set(names);
26
- expect(uniqueNames.size).toBe(names.length);
27
- expect(uniqueNames.size).toBe(74);
28
- });
29
-
30
- it('should have all prompts with galachain-launchpad prefix', () => {
31
- prompts.forEach((prompt) => {
32
- expect(prompt.name).toMatch(/^galachain-launchpad:/);
33
- });
34
- });
35
- });
36
-
37
- describe('getPrompt()', () => {
38
- it('should return prompt for valid name', () => {
39
- const prompt = getPrompt('galachain-launchpad:analyze-token');
40
- expect(prompt).toBeDefined();
41
- expect(prompt?.name).toBe('galachain-launchpad:analyze-token');
42
- });
43
-
44
- it('should return undefined for invalid name', () => {
45
- const prompt = getPrompt('non-existent-prompt');
46
- expect(prompt).toBeUndefined();
47
- });
48
-
49
- it('should find new trading calculation prompts', () => {
50
- const calculationPrompts = [
51
- 'galachain-launchpad:calculate-buy-amount',
52
- 'galachain-launchpad:calculate-sell-amount',
53
- 'galachain-launchpad:calculate-graduation-cost',
54
- 'galachain-launchpad:calculate-buy-amount-local',
55
- 'galachain-launchpad:calculate-buy-amount-external',
56
- 'galachain-launchpad:calculate-sell-amount-local',
57
- 'galachain-launchpad:calculate-sell-amount-external',
58
- ];
59
-
60
- calculationPrompts.forEach((name) => {
61
- const prompt = getPrompt(name);
62
- expect(prompt).toBeDefined();
63
- expect(prompt?.name).toBe(name);
64
- });
65
- });
66
-
67
- it('should find new pool management prompts', () => {
68
- const poolPrompts = [
69
- 'galachain-launchpad:fetch-pools',
70
- 'galachain-launchpad:fetch-pool-details-for-calculation',
71
- 'galachain-launchpad:fetch-token-details',
72
- 'galachain-launchpad:fetch-token-distribution',
73
- 'galachain-launchpad:fetch-token-badges',
74
- 'galachain-launchpad:fetch-volume-data',
75
- 'galachain-launchpad:fetch-gala-spot-price',
76
- 'galachain-launchpad:fetch-price-history',
77
- 'galachain-launchpad:fetch-all-price-history',
78
- 'galachain-launchpad:check-token-name',
79
- 'galachain-launchpad:check-token-symbol',
80
- 'galachain-launchpad:resolve-vault-address',
81
- 'galachain-launchpad:resolve-token-class-key',
82
- ];
83
-
84
- poolPrompts.forEach((name) => {
85
- const prompt = getPrompt(name);
86
- expect(prompt).toBeDefined();
87
- expect(prompt?.name).toBe(name);
88
- });
89
- });
90
-
91
- it('should find new balance prompts', () => {
92
- const balancePrompts = [
93
- 'galachain-launchpad:fetch-gala-balance',
94
- 'galachain-launchpad:fetch-token-balance',
95
- 'galachain-launchpad:fetch-tokens-created',
96
- 'galachain-launchpad:update-profile',
97
- ];
98
-
99
- balancePrompts.forEach((name) => {
100
- const prompt = getPrompt(name);
101
- expect(prompt).toBeDefined();
102
- expect(prompt?.name).toBe(name);
103
- });
104
- });
105
-
106
- it('should find new utility tool prompts', () => {
107
- const utilityPrompts = [
108
- 'galachain-launchpad:create-wallet',
109
- 'galachain-launchpad:get-address',
110
- 'galachain-launchpad:get-ethereum-address',
111
- 'galachain-launchpad:get-config',
112
- 'galachain-launchpad:get-url-by-token-name',
113
- 'galachain-launchpad:explain-sdk-usage',
114
- 'galachain-launchpad:get-cache-info',
115
- 'galachain-launchpad:clear-cache',
116
- 'galachain-launchpad:has-wallet',
117
- 'galachain-launchpad:get-wallet',
118
- 'galachain-launchpad:set-wallet',
119
- 'galachain-launchpad:get-environment',
120
- ];
121
-
122
- utilityPrompts.forEach((name) => {
123
- const prompt = getPrompt(name);
124
- expect(prompt).toBeDefined();
125
- expect(prompt?.name).toBe(name);
126
- });
127
- });
128
-
129
- it('should find new social prompts', () => {
130
- const socialPrompts = [
131
- 'galachain-launchpad:post-comment',
132
- 'galachain-launchpad:fetch-comments',
133
- ];
134
-
135
- socialPrompts.forEach((name) => {
136
- const prompt = getPrompt(name);
137
- expect(prompt).toBeDefined();
138
- expect(prompt?.name).toBe(name);
139
- });
140
- });
141
-
142
- it('should find new transfer prompts', () => {
143
- const transferPrompts = [
144
- 'galachain-launchpad:transfer-gala',
145
- 'galachain-launchpad:transfer-token',
146
- ];
147
-
148
- transferPrompts.forEach((name) => {
149
- const prompt = getPrompt(name);
150
- expect(prompt).toBeDefined();
151
- expect(prompt?.name).toBe(name);
152
- });
153
- });
154
-
155
- it('should find new creation utility prompts', () => {
156
- const creationPrompts = [
157
- 'galachain-launchpad:upload-profile-image',
158
- 'galachain-launchpad:fetch-launch-token-fee',
159
- ];
160
-
161
- creationPrompts.forEach((name) => {
162
- const prompt = getPrompt(name);
163
- expect(prompt).toBeDefined();
164
- expect(prompt?.name).toBe(name);
165
- });
166
- });
167
-
168
- it('should use O(1) Map lookup (performance test)', () => {
169
- const iterations = 10000;
170
- const start = Date.now();
171
-
172
- for (let i = 0; i < iterations; i++) {
173
- getPrompt('galachain-launchpad:analyze-token');
174
- }
175
-
176
- const duration = Date.now() - start;
177
- // Should complete 10k lookups in under 100ms (Map is O(1))
178
- expect(duration).toBeLessThan(100);
179
- });
180
- });
181
-
182
- describe('getPromptNames()', () => {
183
- it('should return array of 74 prompt names', () => {
184
- const names = getPromptNames();
185
- expect(names).toHaveLength(74);
186
- });
187
-
188
- it('should contain all original 24 prompts', () => {
189
- const names = getPromptNames();
190
- const originalPrompts = [
191
- 'galachain-launchpad:analyze-token',
192
- 'galachain-launchpad:buy-tokens',
193
- 'galachain-launchpad:sell-tokens',
194
- 'galachain-launchpad:graduate-token',
195
- 'galachain-launchpad:portfolio',
196
- 'galachain-launchpad:tokens-held',
197
- 'galachain-launchpad:tokens-created',
198
- 'galachain-launchpad:balance',
199
- 'galachain-launchpad:profile',
200
- 'galachain-launchpad:compare-tokens',
201
- 'galachain-launchpad:graduation-status',
202
- 'galachain-launchpad:spot-prices',
203
- 'galachain-launchpad:pool-details',
204
- 'galachain-launchpad:trade-history',
205
- 'galachain-launchpad:fetch-all-pools',
206
- 'galachain-launchpad:create-token',
207
- 'galachain-launchpad:discover-tokens',
208
- 'galachain-launchpad:dex-swap',
209
- 'galachain-launchpad:my-positions',
210
- 'galachain-launchpad:add-liquidity',
211
- 'galachain-launchpad:remove-liquidity',
212
- 'galachain-launchpad:collect-fees',
213
- 'galachain-launchpad:version',
214
- 'galachain-launchpad:switch-environment',
215
- ];
216
-
217
- originalPrompts.forEach((name) => {
218
- expect(names).toContain(name);
219
- });
220
- });
221
-
222
- it('should contain all pool management and trading prompts', () => {
223
- const names = getPromptNames();
224
- const poolManagementPrompts = [
225
- // Pool management (14)
226
- 'galachain-launchpad:fetch-pools',
227
- 'galachain-launchpad:fetch-pool-details-for-calculation',
228
- 'galachain-launchpad:fetch-token-details',
229
- 'galachain-launchpad:fetch-token-distribution',
230
- 'galachain-launchpad:fetch-token-badges',
231
- 'galachain-launchpad:fetch-volume-data',
232
- 'galachain-launchpad:fetch-gala-spot-price',
233
- 'galachain-launchpad:fetch-price-history',
234
- 'galachain-launchpad:fetch-all-price-history',
235
- 'galachain-launchpad:check-token-name',
236
- 'galachain-launchpad:check-token-symbol',
237
- 'galachain-launchpad:resolve-vault-address',
238
- 'galachain-launchpad:resolve-token-class-key',
239
- // Trading calculations (11)
240
- 'galachain-launchpad:calculate-buy-amount',
241
- 'galachain-launchpad:calculate-sell-amount',
242
- 'galachain-launchpad:fetch-trades',
243
- 'galachain-launchpad:calculate-initial-buy',
244
- 'galachain-launchpad:get-bundler-transaction-result',
245
- 'galachain-launchpad:calculate-graduation-cost',
246
- 'galachain-launchpad:calculate-buy-amount-local',
247
- 'galachain-launchpad:calculate-buy-amount-external',
248
- 'galachain-launchpad:calculate-sell-amount-local',
249
- 'galachain-launchpad:calculate-sell-amount-external',
250
- 'galachain-launchpad:is-token-graduated',
251
- // Balance queries (4)
252
- 'galachain-launchpad:fetch-gala-balance',
253
- 'galachain-launchpad:fetch-token-balance',
254
- 'galachain-launchpad:fetch-tokens-created',
255
- 'galachain-launchpad:update-profile',
256
- // Social (2)
257
- 'galachain-launchpad:post-comment',
258
- 'galachain-launchpad:fetch-comments',
259
- // Transfers (2)
260
- 'galachain-launchpad:transfer-gala',
261
- 'galachain-launchpad:transfer-token',
262
- // DEX Pool Discovery (2) - NEW
263
- 'galachain-launchpad:fetch-dex-pools',
264
- 'galachain-launchpad:fetch-all-dex-pools',
265
- ];
266
-
267
- poolManagementPrompts.forEach((name) => {
268
- expect(names).toContain(name);
269
- });
270
- });
271
-
272
- it('should return names in consistent order', () => {
273
- const names1 = getPromptNames();
274
- const names2 = getPromptNames();
275
- expect(names1).toEqual(names2);
276
- });
277
- });
278
-
279
- describe('hasPrompt()', () => {
280
- it('should return true for existing prompts', () => {
281
- expect(hasPrompt('galachain-launchpad:analyze-token')).toBe(true);
282
- expect(hasPrompt('galachain-launchpad:buy-tokens')).toBe(true);
283
- expect(hasPrompt('galachain-launchpad:calculate-buy-amount')).toBe(true);
284
- expect(hasPrompt('galachain-launchpad:fetch-pools')).toBe(true);
285
- });
286
-
287
- it('should return false for non-existent prompts', () => {
288
- expect(hasPrompt('invalid-prompt')).toBe(false);
289
- expect(hasPrompt('')).toBe(false);
290
- });
291
- });
292
-
293
- describe('getPromptsByCategory()', () => {
294
- it('should return trading prompts (4 original)', () => {
295
- const trading = getPromptsByCategory('trading');
296
- expect(trading.length).toBeGreaterThanOrEqual(4);
297
- });
298
-
299
- it('should return portfolio prompts (5)', () => {
300
- const portfolio = getPromptsByCategory('portfolio');
301
- expect(portfolio).toHaveLength(5);
302
- });
303
-
304
- it('should return analysis prompts (6)', () => {
305
- const analysis = getPromptsByCategory('analysis');
306
- expect(analysis).toHaveLength(6);
307
- });
308
-
309
- it('should return creation prompts (1 - create-token)', () => {
310
- const creation = getPromptsByCategory('creation');
311
- expect(creation).toHaveLength(1);
312
- expect(creation[0]?.name).toBe('galachain-launchpad:create-token');
313
- });
314
-
315
- it('should return discovery prompts (1 original + 2 new = 3)', () => {
316
- const discovery = getPromptsByCategory('discovery');
317
- expect(discovery).toHaveLength(3);
318
- });
319
-
320
- it('should return dex trading prompts (1)', () => {
321
- const dex = getPromptsByCategory('dex');
322
- expect(dex).toHaveLength(1);
323
- });
324
-
325
- it('should return liquidity position prompts (4)', () => {
326
- const liquidity = getPromptsByCategory('liquidity');
327
- expect(liquidity).toHaveLength(4);
328
- });
329
-
330
- it('should return utility prompts (version + switch-environment)', () => {
331
- const utility = getPromptsByCategory('utility');
332
- expect(utility).toHaveLength(2);
333
- const utilityNames = utility.map(u => u.name);
334
- expect(utilityNames).toContain('galachain-launchpad:version');
335
- expect(utilityNames).toContain('galachain-launchpad:switch-environment');
336
- });
337
-
338
- it('should return empty array for invalid category', () => {
339
- const result = getPromptsByCategory('invalid' as any);
340
- expect(result).toEqual([]);
341
- });
342
- });
343
-
344
- describe('getPromptCount()', () => {
345
- it('should return 74 (1:1 tool-to-command mapping)', () => {
346
- expect(getPromptCount()).toBe(74);
347
- });
348
- });
349
- });