@gala-chain/launchpad-mcp-server 1.23.0 → 1.23.1

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 (131) hide show
  1. package/DRY_REFACTORING_GUIDE.md +272 -0
  2. package/dist/generated/version.d.ts +1 -1
  3. package/dist/generated/version.js +1 -1
  4. package/dist/prompts/analysis.d.ts.map +1 -1
  5. package/dist/prompts/analysis.js +14 -63
  6. package/dist/prompts/analysis.js.map +1 -1
  7. package/dist/prompts/balances.d.ts.map +1 -1
  8. package/dist/prompts/balances.js +46 -70
  9. package/dist/prompts/balances.js.map +1 -1
  10. package/dist/prompts/creation-utils.d.ts.map +1 -1
  11. package/dist/prompts/creation-utils.js +27 -50
  12. package/dist/prompts/creation-utils.js.map +1 -1
  13. package/dist/prompts/liquidity-positions.d.ts.map +1 -1
  14. package/dist/prompts/liquidity-positions.js +9 -44
  15. package/dist/prompts/liquidity-positions.js.map +1 -1
  16. package/dist/prompts/pools.d.ts.map +1 -1
  17. package/dist/prompts/pools.js +125 -228
  18. package/dist/prompts/pools.js.map +1 -1
  19. package/dist/prompts/portfolio.d.ts.map +1 -1
  20. package/dist/prompts/portfolio.js +13 -48
  21. package/dist/prompts/portfolio.js.map +1 -1
  22. package/dist/prompts/social.d.ts.map +1 -1
  23. package/dist/prompts/social.js +21 -31
  24. package/dist/prompts/social.js.map +1 -1
  25. package/dist/prompts/trading-calculations.d.ts.map +1 -1
  26. package/dist/prompts/trading-calculations.js +37 -126
  27. package/dist/prompts/trading-calculations.js.map +1 -1
  28. package/dist/prompts/trading.d.ts.map +1 -1
  29. package/dist/prompts/trading.js +23 -60
  30. package/dist/prompts/trading.js.map +1 -1
  31. package/dist/prompts/transfers.d.ts.map +1 -1
  32. package/dist/prompts/transfers.js +21 -31
  33. package/dist/prompts/transfers.js.map +1 -1
  34. package/dist/prompts/utility-tools.d.ts.map +1 -1
  35. package/dist/prompts/utility-tools.js +83 -202
  36. package/dist/prompts/utility-tools.js.map +1 -1
  37. package/dist/prompts/utility.d.ts.map +1 -1
  38. package/dist/prompts/utility.js +5 -20
  39. package/dist/prompts/utility.js.map +1 -1
  40. package/dist/prompts/utils/handlerHelpers.d.ts +35 -0
  41. package/dist/prompts/utils/handlerHelpers.d.ts.map +1 -0
  42. package/dist/prompts/utils/handlerHelpers.js +53 -0
  43. package/dist/prompts/utils/handlerHelpers.js.map +1 -0
  44. package/dist/prompts/utils/textTemplates.d.ts +42 -0
  45. package/dist/prompts/utils/textTemplates.d.ts.map +1 -0
  46. package/dist/prompts/utils/textTemplates.js +51 -0
  47. package/dist/prompts/utils/textTemplates.js.map +1 -0
  48. package/dist/utils/validation.d.ts +38 -0
  49. package/dist/utils/validation.d.ts.map +1 -1
  50. package/dist/utils/validation.js +52 -0
  51. package/dist/utils/validation.js.map +1 -1
  52. package/package.json +2 -2
  53. package/docs/AI-AGENT-PATTERNS.md +0 -555
  54. package/docs/CONSTRAINTS-REFERENCE.md +0 -454
  55. package/docs/PROMPT-TOOL-MAPPING.md +0 -352
  56. package/docs/examples/default-values-pattern.md +0 -240
  57. package/docs/examples/tool-factory-pattern.md +0 -217
  58. package/jest.config.js +0 -94
  59. package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +0 -258
  60. package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
  61. package/src/__tests__/server.test.ts +0 -256
  62. package/src/constants/mcpToolNames.ts +0 -181
  63. package/src/index.ts +0 -19
  64. package/src/prompts/__tests__/promptStructure.test.ts +0 -137
  65. package/src/prompts/__tests__/registry.test.ts +0 -359
  66. package/src/prompts/analysis.ts +0 -429
  67. package/src/prompts/balances.ts +0 -198
  68. package/src/prompts/create-token.ts +0 -123
  69. package/src/prompts/creation-utils.ts +0 -118
  70. package/src/prompts/dex-trading.ts +0 -86
  71. package/src/prompts/discover-tokens.ts +0 -86
  72. package/src/prompts/index.ts +0 -175
  73. package/src/prompts/liquidity-positions.ts +0 -270
  74. package/src/prompts/pools.ts +0 -571
  75. package/src/prompts/portfolio.ts +0 -242
  76. package/src/prompts/social.ts +0 -100
  77. package/src/prompts/trading-calculations.ts +0 -499
  78. package/src/prompts/trading.ts +0 -191
  79. package/src/prompts/transfers.ts +0 -103
  80. package/src/prompts/utility-tools.ts +0 -349
  81. package/src/prompts/utility.ts +0 -92
  82. package/src/prompts/utils/workflowTemplates.ts +0 -511
  83. package/src/schemas/common-schemas.ts +0 -393
  84. package/src/scripts/test-all-prompts.ts +0 -184
  85. package/src/server.ts +0 -367
  86. package/src/tools/__tests__/dex-tools.test.ts +0 -562
  87. package/src/tools/__tests__/liquidity-positions.test.ts +0 -673
  88. package/src/tools/balance/index.ts +0 -174
  89. package/src/tools/creation/index.ts +0 -182
  90. package/src/tools/dex/index.ts +0 -226
  91. package/src/tools/dex/liquidity-positions.ts +0 -547
  92. package/src/tools/index.ts +0 -94
  93. package/src/tools/pools/fetchAllPools.ts +0 -47
  94. package/src/tools/pools/fetchAllPriceHistory.ts +0 -119
  95. package/src/tools/pools/fetchPoolDetails.ts +0 -27
  96. package/src/tools/pools/fetchPoolDetailsForCalculation.ts +0 -22
  97. package/src/tools/pools/fetchPools.ts +0 -47
  98. package/src/tools/pools/fetchPriceHistory.ts +0 -124
  99. package/src/tools/pools/fetchTokenDetails.ts +0 -77
  100. package/src/tools/pools/index.ts +0 -284
  101. package/src/tools/social/index.ts +0 -64
  102. package/src/tools/trading/index.ts +0 -605
  103. package/src/tools/transfers/index.ts +0 -75
  104. package/src/tools/utils/clearCache.ts +0 -36
  105. package/src/tools/utils/createWallet.ts +0 -19
  106. package/src/tools/utils/explainSdkUsage.ts +0 -1446
  107. package/src/tools/utils/getAddress.ts +0 -12
  108. package/src/tools/utils/getCacheInfo.ts +0 -14
  109. package/src/tools/utils/getConfig.ts +0 -21
  110. package/src/tools/utils/getEnvironment.ts +0 -17
  111. package/src/tools/utils/getEthereumAddress.ts +0 -12
  112. package/src/tools/utils/getUrlByTokenName.ts +0 -12
  113. package/src/tools/utils/getVersion.ts +0 -25
  114. package/src/tools/utils/getWallet.ts +0 -25
  115. package/src/tools/utils/hasWallet.ts +0 -15
  116. package/src/tools/utils/index.ts +0 -37
  117. package/src/tools/utils/isTokenGraduated.ts +0 -16
  118. package/src/tools/utils/setWallet.ts +0 -41
  119. package/src/tools/utils/switchEnvironment.ts +0 -28
  120. package/src/types/mcp.ts +0 -72
  121. package/src/utils/__tests__/validation.test.ts +0 -147
  122. package/src/utils/constraints.ts +0 -155
  123. package/src/utils/default-values.ts +0 -208
  124. package/src/utils/error-handler.ts +0 -69
  125. package/src/utils/error-templates.ts +0 -273
  126. package/src/utils/response-formatter.ts +0 -51
  127. package/src/utils/tool-factory.ts +0 -303
  128. package/src/utils/tool-registry.ts +0 -296
  129. package/src/utils/validation.ts +0 -371
  130. package/tests/wallet-management-integration.test.ts +0 -284
  131. package/tsconfig.json +0 -23
@@ -1,137 +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
- return {}; // For prompts with no required args (portfolio, balance, my-positions, version, etc.)
54
- }
55
-
56
- describe('MCP Protocol Compliance', () => {
57
- it.each(prompts)('$name should have required fields', (prompt) => {
58
- expect(prompt).toHaveProperty('name');
59
- expect(prompt).toHaveProperty('description');
60
- expect(prompt).toHaveProperty('handler');
61
- expect(typeof prompt.name).toBe('string');
62
- expect(typeof prompt.description).toBe('string');
63
- expect(typeof prompt.handler).toBe('function');
64
- });
65
-
66
- it.each(prompts)('$name should have valid argument structure', (prompt) => {
67
- if (prompt.arguments) {
68
- expect(Array.isArray(prompt.arguments)).toBe(true);
69
- prompt.arguments.forEach((arg) => {
70
- expect(arg).toHaveProperty('name');
71
- expect(arg).toHaveProperty('description');
72
- expect(arg).toHaveProperty('required');
73
- expect(typeof arg.name).toBe('string');
74
- expect(typeof arg.description).toBe('string');
75
- expect(typeof arg.required).toBe('boolean');
76
- });
77
- }
78
- });
79
-
80
- it.each(prompts)('$name handler should return PromptMessage array', (prompt) => {
81
- const args = getValidArgsForPrompt(prompt.name);
82
- const messages = prompt.handler(args);
83
- expect(Array.isArray(messages)).toBe(true);
84
- expect(messages.length).toBeGreaterThan(0);
85
- });
86
-
87
- it.each(prompts)('$name messages should have valid structure', (prompt) => {
88
- const args = getValidArgsForPrompt(prompt.name);
89
- const messages = prompt.handler(args);
90
- messages.forEach((msg) => {
91
- expect(msg).toHaveProperty('role');
92
- expect(msg).toHaveProperty('content');
93
- expect(['user', 'assistant']).toContain(msg.role);
94
- expect(msg.content).toHaveProperty('type');
95
- expect(['text', 'image', 'resource']).toContain(msg.content.type);
96
- });
97
- });
98
- });
99
-
100
- describe('Handler Execution', () => {
101
- it('analyze-token handler should accept tokenName', () => {
102
- const prompt = prompts.find((p) => p.name === 'galachain-launchpad:analyze-token');
103
- expect(() => prompt?.handler({ tokenName: 'anime' })).not.toThrow();
104
- });
105
-
106
- it('buy-tokens handler should accept required args', () => {
107
- const prompt = prompts.find((p) => p.name === 'galachain-launchpad:buy-tokens');
108
- expect(() => prompt?.handler({ tokenName: 'anime', galaAmount: '100' })).not.toThrow();
109
- });
110
-
111
- it('graduate-token handler should accept optional slippage', () => {
112
- const prompt = prompts.find((p) => p.name === 'galachain-launchpad:graduate-token');
113
- expect(() => prompt?.handler({ tokenName: 'anime', slippage: '2' })).not.toThrow();
114
- });
115
- });
116
-
117
- describe('Message Content', () => {
118
- it.each(prompts)('$name should generate non-empty text content', (prompt) => {
119
- const args = getValidArgsForPrompt(prompt.name);
120
- const messages = prompt.handler(args);
121
- messages.forEach((msg) => {
122
- if (msg.content.type === 'text') {
123
- expect(msg.content.text).toBeDefined();
124
- expect(msg.content.text!.length).toBeGreaterThan(10);
125
- }
126
- });
127
- });
128
-
129
- it.each(prompts)('$name should reference MCP tools in instructions', (prompt) => {
130
- const args = getValidArgsForPrompt(prompt.name);
131
- const messages = prompt.handler(args);
132
- const text = messages[0].content.text || '';
133
- // Should contain at least one tool reference
134
- expect(text).toMatch(/gala_launchpad_/);
135
- });
136
- });
137
- });
@@ -1,359 +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 72 prompts (1:1 tool-to-command mapping)', () => {
20
- expect(prompts).toHaveLength(72);
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(72);
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 72 prompt names', () => {
184
- const names = getPromptNames();
185
- expect(names).toHaveLength(72);
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 48 new prompts for complete 1:1 mapping', () => {
223
- const names = getPromptNames();
224
- const newPrompts = [
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
- // Creation utilities (2)
257
- 'galachain-launchpad:upload-profile-image',
258
- 'galachain-launchpad:fetch-launch-token-fee',
259
- // Social (2)
260
- 'galachain-launchpad:post-comment',
261
- 'galachain-launchpad:fetch-comments',
262
- // Transfers (2)
263
- 'galachain-launchpad:transfer-gala',
264
- 'galachain-launchpad:transfer-token',
265
- // Utility tools (13)
266
- 'galachain-launchpad:create-wallet',
267
- 'galachain-launchpad:get-address',
268
- 'galachain-launchpad:get-ethereum-address',
269
- 'galachain-launchpad:get-config',
270
- 'galachain-launchpad:get-url-by-token-name',
271
- 'galachain-launchpad:explain-sdk-usage',
272
- 'galachain-launchpad:get-cache-info',
273
- 'galachain-launchpad:clear-cache',
274
- 'galachain-launchpad:has-wallet',
275
- 'galachain-launchpad:get-wallet',
276
- 'galachain-launchpad:set-wallet',
277
- 'galachain-launchpad:get-environment',
278
- ];
279
-
280
- expect(newPrompts).toHaveLength(48);
281
- newPrompts.forEach((name) => {
282
- expect(names).toContain(name);
283
- });
284
- });
285
-
286
- it('should return names in consistent order', () => {
287
- const names1 = getPromptNames();
288
- const names2 = getPromptNames();
289
- expect(names1).toEqual(names2);
290
- });
291
- });
292
-
293
- describe('hasPrompt()', () => {
294
- it('should return true for existing prompts', () => {
295
- expect(hasPrompt('galachain-launchpad:analyze-token')).toBe(true);
296
- expect(hasPrompt('galachain-launchpad:buy-tokens')).toBe(true);
297
- expect(hasPrompt('galachain-launchpad:calculate-buy-amount')).toBe(true);
298
- expect(hasPrompt('galachain-launchpad:fetch-pools')).toBe(true);
299
- });
300
-
301
- it('should return false for non-existent prompts', () => {
302
- expect(hasPrompt('invalid-prompt')).toBe(false);
303
- expect(hasPrompt('')).toBe(false);
304
- });
305
- });
306
-
307
- describe('getPromptsByCategory()', () => {
308
- it('should return trading prompts (4 original)', () => {
309
- const trading = getPromptsByCategory('trading');
310
- expect(trading.length).toBeGreaterThanOrEqual(4);
311
- });
312
-
313
- it('should return portfolio prompts (5)', () => {
314
- const portfolio = getPromptsByCategory('portfolio');
315
- expect(portfolio).toHaveLength(5);
316
- });
317
-
318
- it('should return analysis prompts (6)', () => {
319
- const analysis = getPromptsByCategory('analysis');
320
- expect(analysis).toHaveLength(6);
321
- });
322
-
323
- it('should return creation prompts (1 original + 2 new = 3)', () => {
324
- const creation = getPromptsByCategory('creation');
325
- expect(creation).toHaveLength(3);
326
- });
327
-
328
- it('should return discovery prompts (1)', () => {
329
- const discovery = getPromptsByCategory('discovery');
330
- expect(discovery).toHaveLength(1);
331
- });
332
-
333
- it('should return dex trading prompts (1)', () => {
334
- const dex = getPromptsByCategory('dex');
335
- expect(dex).toHaveLength(1);
336
- });
337
-
338
- it('should return liquidity position prompts (4)', () => {
339
- const liquidity = getPromptsByCategory('liquidity');
340
- expect(liquidity).toHaveLength(4);
341
- });
342
-
343
- it('should return utility prompts (2 original + 12 new = 14)', () => {
344
- const utility = getPromptsByCategory('utility');
345
- expect(utility).toHaveLength(14);
346
- });
347
-
348
- it('should return empty array for invalid category', () => {
349
- const result = getPromptsByCategory('invalid' as any);
350
- expect(result).toEqual([]);
351
- });
352
- });
353
-
354
- describe('getPromptCount()', () => {
355
- it('should return 72 (1:1 tool-to-command mapping)', () => {
356
- expect(getPromptCount()).toBe(72);
357
- });
358
- });
359
- });