@gala-chain/launchpad-mcp-server 1.22.4 → 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.
- package/CHANGELOG.md +118 -0
- package/DRY_REFACTORING_GUIDE.md +272 -0
- package/README.md +83 -8
- package/dist/constants/mcpToolNames.d.ts +69 -11
- package/dist/constants/mcpToolNames.d.ts.map +1 -1
- package/dist/constants/mcpToolNames.js +47 -9
- package/dist/constants/mcpToolNames.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/prompts/analysis.d.ts.map +1 -1
- package/dist/prompts/analysis.js +14 -63
- package/dist/prompts/analysis.js.map +1 -1
- package/dist/prompts/balances.d.ts +24 -0
- package/dist/prompts/balances.d.ts.map +1 -0
- package/dist/prompts/balances.js +167 -0
- package/dist/prompts/balances.js.map +1 -0
- package/dist/prompts/creation-utils.d.ts +20 -0
- package/dist/prompts/creation-utils.d.ts.map +1 -0
- package/dist/prompts/creation-utils.js +92 -0
- package/dist/prompts/creation-utils.js.map +1 -0
- package/dist/prompts/index.d.ts +9 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +23 -2
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/liquidity-positions.d.ts.map +1 -1
- package/dist/prompts/liquidity-positions.js +9 -44
- package/dist/prompts/liquidity-positions.js.map +1 -1
- package/dist/prompts/pools.d.ts +64 -0
- package/dist/prompts/pools.d.ts.map +1 -0
- package/dist/prompts/pools.js +445 -0
- package/dist/prompts/pools.js.map +1 -0
- package/dist/prompts/portfolio.d.ts.map +1 -1
- package/dist/prompts/portfolio.js +13 -48
- package/dist/prompts/portfolio.js.map +1 -1
- package/dist/prompts/social.d.ts +16 -0
- package/dist/prompts/social.d.ts.map +1 -0
- package/dist/prompts/social.js +87 -0
- package/dist/prompts/social.js.map +1 -0
- package/dist/prompts/trading-calculations.d.ts +52 -0
- package/dist/prompts/trading-calculations.d.ts.map +1 -0
- package/dist/prompts/trading-calculations.js +390 -0
- package/dist/prompts/trading-calculations.js.map +1 -0
- package/dist/prompts/trading.d.ts.map +1 -1
- package/dist/prompts/trading.js +23 -60
- package/dist/prompts/trading.js.map +1 -1
- package/dist/prompts/transfers.d.ts +16 -0
- package/dist/prompts/transfers.d.ts.map +1 -0
- package/dist/prompts/transfers.js +90 -0
- package/dist/prompts/transfers.js.map +1 -0
- package/dist/prompts/utility-tools.d.ts +56 -0
- package/dist/prompts/utility-tools.d.ts.map +1 -0
- package/dist/prompts/utility-tools.js +219 -0
- package/dist/prompts/utility-tools.js.map +1 -0
- package/dist/prompts/utility.d.ts.map +1 -1
- package/dist/prompts/utility.js +5 -20
- package/dist/prompts/utility.js.map +1 -1
- package/dist/prompts/utils/handlerHelpers.d.ts +35 -0
- package/dist/prompts/utils/handlerHelpers.d.ts.map +1 -0
- package/dist/prompts/utils/handlerHelpers.js +53 -0
- package/dist/prompts/utils/handlerHelpers.js.map +1 -0
- package/dist/prompts/utils/textTemplates.d.ts +42 -0
- package/dist/prompts/utils/textTemplates.d.ts.map +1 -0
- package/dist/prompts/utils/textTemplates.js +51 -0
- package/dist/prompts/utils/textTemplates.js.map +1 -0
- package/dist/utils/validation.d.ts +38 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +52 -0
- package/dist/utils/validation.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trading.js","sourceRoot":"","sources":["../../src/prompts/trading.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,uEAGsC;AACtC,
|
|
1
|
+
{"version":3,"file":"trading.js","sourceRoot":"","sources":["../../src/prompts/trading.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,uEAGsC;AACtC,0DAA4G;AAC5G,iEAAiE;AAEjE;;GAEG;AACU,QAAA,kBAAkB,GAAc;IAC3C,IAAI,EAAE,mCAAmC;IACzC,WAAW,E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AAC,CAAC;QAClC,IAAA,wCAAwB,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,IAAA,wCAAoB,EACzB,IAAA,4CAAqB,EAAC;YACpB,SAAS,EAAE,UAAU;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,GAAG;SAC/B,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,cAAc,GAAgB;IACzC,0BAAkB;IAClB,uBAAe;IACf,wBAAgB;IAChB,2BAAmB;CACpB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Transfer Prompts
|
|
3
|
+
*
|
|
4
|
+
* Slash commands for transferring tokens and GALA
|
|
5
|
+
*/
|
|
6
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
7
|
+
/**
|
|
8
|
+
* Transfer GALA - GALA token transfer
|
|
9
|
+
*/
|
|
10
|
+
export declare const transferGalaPrompt: MCPPrompt;
|
|
11
|
+
/**
|
|
12
|
+
* Transfer Token - Launchpad token transfer
|
|
13
|
+
*/
|
|
14
|
+
export declare const transferTokenPrompt: MCPPrompt;
|
|
15
|
+
export declare const transferPrompts: MCPPrompt[];
|
|
16
|
+
//# sourceMappingURL=transfers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfers.d.ts","sourceRoot":"","sources":["../../src/prompts/transfers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAMjD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAgChC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAuCjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,EAGtC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Token Transfer Prompts
|
|
4
|
+
*
|
|
5
|
+
* Slash commands for transferring tokens and GALA
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.transferPrompts = exports.transferTokenPrompt = exports.transferGalaPrompt = void 0;
|
|
9
|
+
const mcpToolNames_js_1 = require("../constants/mcpToolNames.js");
|
|
10
|
+
const validation_js_1 = require("../utils/validation.js");
|
|
11
|
+
const handlerHelpers_js_1 = require("./utils/handlerHelpers.js");
|
|
12
|
+
const textTemplates_js_1 = require("./utils/textTemplates.js");
|
|
13
|
+
/**
|
|
14
|
+
* Transfer GALA - GALA token transfer
|
|
15
|
+
*/
|
|
16
|
+
exports.transferGalaPrompt = {
|
|
17
|
+
name: 'galachain-launchpad:transfer-gala',
|
|
18
|
+
description: 'Transfer GALA tokens to another wallet',
|
|
19
|
+
arguments: [
|
|
20
|
+
{
|
|
21
|
+
name: 'recipientAddress',
|
|
22
|
+
description: 'Recipient wallet address',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'amount',
|
|
27
|
+
description: 'Amount of GALA to transfer',
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
handler: (args) => {
|
|
32
|
+
(0, validation_js_1.validateAddress)(args.recipientAddress, 'recipientAddress');
|
|
33
|
+
(0, validation_js_1.validateNumericAmount)(args.amount, 'amount');
|
|
34
|
+
return (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
35
|
+
operation: 'Transfer GALA tokens.',
|
|
36
|
+
parameters: {
|
|
37
|
+
recipient: `Recipient: ${args.recipientAddress}`,
|
|
38
|
+
amount: `Amount: ${args.amount} GALA`,
|
|
39
|
+
},
|
|
40
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.TRANSFER_GALA,
|
|
41
|
+
actionDescription: 'execute the transfer',
|
|
42
|
+
displayFormat: 'Display the transaction details and confirmation.',
|
|
43
|
+
}));
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Transfer Token - Launchpad token transfer
|
|
48
|
+
*/
|
|
49
|
+
exports.transferTokenPrompt = {
|
|
50
|
+
name: 'galachain-launchpad:transfer-token',
|
|
51
|
+
description: 'Transfer launchpad tokens to another wallet',
|
|
52
|
+
arguments: [
|
|
53
|
+
{
|
|
54
|
+
name: 'to',
|
|
55
|
+
description: 'Recipient wallet address',
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'tokenName',
|
|
60
|
+
description: 'Token name (e.g., anime)',
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'amount',
|
|
65
|
+
description: 'Token amount to transfer',
|
|
66
|
+
required: true,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
handler: (args) => {
|
|
70
|
+
(0, validation_js_1.validateAddress)(args.to, 'to');
|
|
71
|
+
(0, validation_js_1.validateTokenName)(args.tokenName, 'tokenName');
|
|
72
|
+
(0, validation_js_1.validateNumericAmount)(args.amount, 'amount');
|
|
73
|
+
return (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
74
|
+
operation: 'Transfer launchpad tokens.',
|
|
75
|
+
parameters: {
|
|
76
|
+
recipient: `Recipient: ${args.to}`,
|
|
77
|
+
token: `Token: ${args.tokenName}`,
|
|
78
|
+
amount: `Amount: ${args.amount}`,
|
|
79
|
+
},
|
|
80
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.TRANSFER_TOKEN,
|
|
81
|
+
actionDescription: 'execute the transfer',
|
|
82
|
+
displayFormat: 'Display the transaction details and confirmation.',
|
|
83
|
+
}));
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
exports.transferPrompts = [
|
|
87
|
+
exports.transferGalaPrompt,
|
|
88
|
+
exports.transferTokenPrompt,
|
|
89
|
+
];
|
|
90
|
+
//# sourceMappingURL=transfers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfers.js","sourceRoot":"","sources":["../../src/prompts/transfers.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,kEAAyD;AACzD,0DAAmG;AACnG,iEAAiE;AACjE,+DAAqE;AAErE;;GAEG;AACU,QAAA,kBAAkB,GAAc;IAC3C,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,wCAAwC;IACrD,SAAS,EAAE;QACT;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,IAAA,+BAAe,EAAC,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAC3D,IAAA,qCAAqB,EAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAE7C,OAAO,IAAA,wCAAoB,EACzB,IAAA,4CAAyB,EAAC;YACxB,SAAS,EAAE,uBAAuB;YAClC,UAAU,EAAE;gBACV,SAAS,EAAE,cAAc,IAAI,CAAC,gBAAgB,EAAE;gBAChD,MAAM,EAAE,WAAW,IAAI,CAAC,MAAM,OAAO;aACtC;YACD,QAAQ,EAAE,2BAAS,CAAC,aAAa;YACjC,iBAAiB,EAAE,sBAAsB;YACzC,aAAa,EAAE,mDAAmD;SACnE,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,mBAAmB,GAAc;IAC5C,IAAI,EAAE,oCAAoC;IAC1C,WAAW,EAAE,6CAA6C;IAC1D,SAAS,EAAE;QACT;YACE,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,IAAA,+BAAe,EAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC/B,IAAA,iCAAiB,EAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAC/C,IAAA,qCAAqB,EAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAE7C,OAAO,IAAA,wCAAoB,EACzB,IAAA,4CAAyB,EAAC;YACxB,SAAS,EAAE,4BAA4B;YACvC,UAAU,EAAE;gBACV,SAAS,EAAE,cAAc,IAAI,CAAC,EAAE,EAAE;gBAClC,KAAK,EAAE,UAAU,IAAI,CAAC,SAAS,EAAE;gBACjC,MAAM,EAAE,WAAW,IAAI,CAAC,MAAM,EAAE;aACjC;YACD,QAAQ,EAAE,2BAAS,CAAC,cAAc;YAClC,iBAAiB,EAAE,sBAAsB;YACzC,aAAa,EAAE,mDAAmD;SACnE,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC;AAEW,QAAA,eAAe,GAAgB;IAC1C,0BAAkB;IAClB,2BAAmB;CACpB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility Tools Prompts
|
|
3
|
+
*
|
|
4
|
+
* Slash commands for utility and system operations
|
|
5
|
+
*/
|
|
6
|
+
import type { MCPPrompt } from '../types/mcp.js';
|
|
7
|
+
/**
|
|
8
|
+
* Create Wallet - Generate new wallet
|
|
9
|
+
*/
|
|
10
|
+
export declare const createWalletPrompt: MCPPrompt;
|
|
11
|
+
/**
|
|
12
|
+
* Get Address - Get GalaChain address
|
|
13
|
+
*/
|
|
14
|
+
export declare const getAddressPrompt: MCPPrompt;
|
|
15
|
+
/**
|
|
16
|
+
* Get Ethereum Address - Get Ethereum address
|
|
17
|
+
*/
|
|
18
|
+
export declare const getEthereumAddressPrompt: MCPPrompt;
|
|
19
|
+
/**
|
|
20
|
+
* Get Config - View SDK configuration
|
|
21
|
+
*/
|
|
22
|
+
export declare const getConfigPrompt: MCPPrompt;
|
|
23
|
+
/**
|
|
24
|
+
* Get URL by Token Name - Generate launchpad URL
|
|
25
|
+
*/
|
|
26
|
+
export declare const getUrlByTokenNamePrompt: MCPPrompt;
|
|
27
|
+
/**
|
|
28
|
+
* Explain SDK Usage - SDK documentation helper
|
|
29
|
+
*/
|
|
30
|
+
export declare const explainSdkUsagePrompt: MCPPrompt;
|
|
31
|
+
/**
|
|
32
|
+
* Get Cache Info - Cache statistics
|
|
33
|
+
*/
|
|
34
|
+
export declare const getCacheInfoPrompt: MCPPrompt;
|
|
35
|
+
/**
|
|
36
|
+
* Clear Cache - Cache management
|
|
37
|
+
*/
|
|
38
|
+
export declare const clearCachePrompt: MCPPrompt;
|
|
39
|
+
/**
|
|
40
|
+
* Has Wallet - Check wallet status
|
|
41
|
+
*/
|
|
42
|
+
export declare const hasWalletPrompt: MCPPrompt;
|
|
43
|
+
/**
|
|
44
|
+
* Get Wallet - Get wallet instance
|
|
45
|
+
*/
|
|
46
|
+
export declare const getWalletPrompt: MCPPrompt;
|
|
47
|
+
/**
|
|
48
|
+
* Set Wallet - Configure wallet
|
|
49
|
+
*/
|
|
50
|
+
export declare const setWalletPrompt: MCPPrompt;
|
|
51
|
+
/**
|
|
52
|
+
* Get Environment - Current environment query
|
|
53
|
+
*/
|
|
54
|
+
export declare const getEnvironmentPrompt: MCPPrompt;
|
|
55
|
+
export declare const utilityToolPrompts: MCPPrompt[];
|
|
56
|
+
//# sourceMappingURL=utility-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility-tools.d.ts","sourceRoot":"","sources":["../../src/prompts/utility-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAYhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAY9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAYtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAY7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAsBrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAmBnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAYhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAsB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAY7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAY7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAsB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAYlC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAAS,EAazC,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Utility Tools Prompts
|
|
4
|
+
*
|
|
5
|
+
* Slash commands for utility and system operations
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.utilityToolPrompts = exports.getEnvironmentPrompt = exports.setWalletPrompt = exports.getWalletPrompt = exports.hasWalletPrompt = exports.clearCachePrompt = exports.getCacheInfoPrompt = exports.explainSdkUsagePrompt = exports.getUrlByTokenNamePrompt = exports.getConfigPrompt = exports.getEthereumAddressPrompt = exports.getAddressPrompt = exports.createWalletPrompt = void 0;
|
|
9
|
+
const mcpToolNames_js_1 = require("../constants/mcpToolNames.js");
|
|
10
|
+
const handlerHelpers_js_1 = require("./utils/handlerHelpers.js");
|
|
11
|
+
const textTemplates_js_1 = require("./utils/textTemplates.js");
|
|
12
|
+
/**
|
|
13
|
+
* Create Wallet - Generate new wallet
|
|
14
|
+
*/
|
|
15
|
+
exports.createWalletPrompt = {
|
|
16
|
+
name: 'galachain-launchpad:create-wallet',
|
|
17
|
+
description: 'Generate a new wallet with random private key',
|
|
18
|
+
handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
19
|
+
operation: 'Create a new wallet with random private key.',
|
|
20
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.CREATE_WALLET,
|
|
21
|
+
actionDescription: 'generate new wallet address, random private key, and wallet credentials for authentication',
|
|
22
|
+
displayFormat: 'Display the wallet details with a security warning about private key storage.',
|
|
23
|
+
})),
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Get Address - Get GalaChain address
|
|
27
|
+
*/
|
|
28
|
+
exports.getAddressPrompt = {
|
|
29
|
+
name: 'galachain-launchpad:get-address',
|
|
30
|
+
description: 'Get the GalaChain address format of authenticated wallet',
|
|
31
|
+
handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
32
|
+
operation: 'Get the GalaChain format address of the authenticated wallet.',
|
|
33
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.GET_ADDRESS,
|
|
34
|
+
actionDescription: 'retrieve the address in GalaChain format (eth|0x...)',
|
|
35
|
+
displayFormat: 'Display the wallet address.',
|
|
36
|
+
})),
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Get Ethereum Address - Get Ethereum address
|
|
40
|
+
*/
|
|
41
|
+
exports.getEthereumAddressPrompt = {
|
|
42
|
+
name: 'galachain-launchpad:get-ethereum-address',
|
|
43
|
+
description: 'Get the standard Ethereum address format of authenticated wallet',
|
|
44
|
+
handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
45
|
+
operation: 'Get the standard Ethereum format address of the authenticated wallet.',
|
|
46
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.GET_ETHEREUM_ADDRESS,
|
|
47
|
+
actionDescription: 'retrieve the address in Ethereum format (0x...)',
|
|
48
|
+
displayFormat: 'Display the wallet address.',
|
|
49
|
+
})),
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Get Config - View SDK configuration
|
|
53
|
+
*/
|
|
54
|
+
exports.getConfigPrompt = {
|
|
55
|
+
name: 'galachain-launchpad:get-config',
|
|
56
|
+
description: 'View current SDK and MCP server configuration',
|
|
57
|
+
handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
58
|
+
operation: 'Get the current SDK and MCP server configuration.',
|
|
59
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.GET_CONFIG,
|
|
60
|
+
actionDescription: 'retrieve environment, base URLs, timeout settings, feature flags, effective slippage tolerance factors, and current MCP server state',
|
|
61
|
+
displayFormat: 'Display the configuration in a readable format.',
|
|
62
|
+
})),
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Get URL by Token Name - Generate launchpad URL
|
|
66
|
+
*/
|
|
67
|
+
exports.getUrlByTokenNamePrompt = {
|
|
68
|
+
name: 'galachain-launchpad:get-url-by-token-name',
|
|
69
|
+
description: 'Get the launchpad frontend URL for a token',
|
|
70
|
+
arguments: [
|
|
71
|
+
{
|
|
72
|
+
name: 'tokenName',
|
|
73
|
+
description: 'Token name (e.g., anime)',
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
handler: (args) => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
78
|
+
operation: 'Get the launchpad frontend URL for a token.',
|
|
79
|
+
parameters: {
|
|
80
|
+
token_name: `Token: ${args.tokenName}`,
|
|
81
|
+
},
|
|
82
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.GET_URL_BY_TOKEN_NAME,
|
|
83
|
+
actionDescription: 'generate the URL',
|
|
84
|
+
displayFormat: 'Display the complete launchpad URL for viewing/trading the token.',
|
|
85
|
+
})),
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Explain SDK Usage - SDK documentation helper
|
|
89
|
+
*/
|
|
90
|
+
exports.explainSdkUsagePrompt = {
|
|
91
|
+
name: 'galachain-launchpad:explain-sdk-usage',
|
|
92
|
+
description: 'Get detailed SDK usage examples for a topic',
|
|
93
|
+
arguments: [
|
|
94
|
+
{
|
|
95
|
+
name: 'topic',
|
|
96
|
+
description: 'Topic: buy-tokens, sell-tokens, pool-graduation, fetch-pools, balances, dex-trading, liquidity-positions, price-history, token-details, token-distribution, token-creation, profile-management, multi-wallet, transfers, error-handling, installation, local-calculations, mcp-to-sdk-mapping',
|
|
97
|
+
required: true,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
handler: (args) => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
101
|
+
operation: `Get detailed SDK usage examples for topic: ${args.topic}.`,
|
|
102
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.EXPLAIN_SDK_USAGE,
|
|
103
|
+
actionDescription: 'retrieve complete runnable code examples',
|
|
104
|
+
displayFormat: 'Display the examples with explanations for integrating the SDK directly.',
|
|
105
|
+
})),
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Get Cache Info - Cache statistics
|
|
109
|
+
*/
|
|
110
|
+
exports.getCacheInfoPrompt = {
|
|
111
|
+
name: 'galachain-launchpad:get-cache-info',
|
|
112
|
+
description: 'Get token metadata cache statistics',
|
|
113
|
+
handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
114
|
+
operation: 'Get token metadata cache statistics.',
|
|
115
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.GET_CACHE_INFO,
|
|
116
|
+
actionDescription: 'retrieve total tokens cached, cache size in bytes, and timestamp of oldest entry',
|
|
117
|
+
displayFormat: 'Display the cache information.',
|
|
118
|
+
})),
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Clear Cache - Cache management
|
|
122
|
+
*/
|
|
123
|
+
exports.clearCachePrompt = {
|
|
124
|
+
name: 'galachain-launchpad:clear-cache',
|
|
125
|
+
description: 'Clear token metadata cache',
|
|
126
|
+
arguments: [
|
|
127
|
+
{
|
|
128
|
+
name: 'tokenName',
|
|
129
|
+
description: 'Token name to clear (optional, clears all if not provided)',
|
|
130
|
+
required: false,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
handler: (args) => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
134
|
+
operation: 'Clear token metadata cache.',
|
|
135
|
+
parameters: {
|
|
136
|
+
token_name: args.tokenName ? `Token: ${args.tokenName}` : 'Clearing entire cache',
|
|
137
|
+
},
|
|
138
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.CLEAR_CACHE,
|
|
139
|
+
actionDescription: 'clear the cache',
|
|
140
|
+
displayFormat: 'Display confirmation of cache clearing.',
|
|
141
|
+
})),
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Has Wallet - Check wallet status
|
|
145
|
+
*/
|
|
146
|
+
exports.hasWalletPrompt = {
|
|
147
|
+
name: 'galachain-launchpad:has-wallet',
|
|
148
|
+
description: 'Check if a wallet is configured in the MCP server',
|
|
149
|
+
handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
150
|
+
operation: 'Check wallet configuration status.',
|
|
151
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.HAS_WALLET,
|
|
152
|
+
actionDescription: 'determine whether a wallet is configured and whether MCP server is in full-access or read-only mode',
|
|
153
|
+
displayFormat: 'Display the wallet status clearly.',
|
|
154
|
+
})),
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Get Wallet - Get wallet instance
|
|
158
|
+
*/
|
|
159
|
+
exports.getWalletPrompt = {
|
|
160
|
+
name: 'galachain-launchpad:get-wallet',
|
|
161
|
+
description: 'Get the currently configured wallet instance',
|
|
162
|
+
handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
163
|
+
operation: 'Get the currently configured wallet instance.',
|
|
164
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.GET_WALLET,
|
|
165
|
+
actionDescription: 'retrieve wallet object if available (null if in read-only mode)',
|
|
166
|
+
displayFormat: 'Display the wallet information.',
|
|
167
|
+
})),
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Set Wallet - Configure wallet
|
|
171
|
+
*/
|
|
172
|
+
exports.setWalletPrompt = {
|
|
173
|
+
name: 'galachain-launchpad:set-wallet',
|
|
174
|
+
description: 'Configure a wallet for signing operations',
|
|
175
|
+
arguments: [
|
|
176
|
+
{
|
|
177
|
+
name: 'privateKey',
|
|
178
|
+
description: 'Private key in hex format (0x + 64 hex characters)',
|
|
179
|
+
required: true,
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
handler: (args) => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
183
|
+
operation: 'Configure wallet for signing operations.',
|
|
184
|
+
parameters: {
|
|
185
|
+
private_key: `Private Key: ${args.privateKey.substring(0, 10)}...${args.privateKey.substring(60)}`,
|
|
186
|
+
},
|
|
187
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.SET_WALLET,
|
|
188
|
+
actionDescription: 'configure the wallet',
|
|
189
|
+
displayFormat: 'Display confirmation that wallet is configured for full-access mode.',
|
|
190
|
+
})),
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Get Environment - Current environment query
|
|
194
|
+
*/
|
|
195
|
+
exports.getEnvironmentPrompt = {
|
|
196
|
+
name: 'galachain-launchpad:get-environment',
|
|
197
|
+
description: 'Get the current MCP server environment',
|
|
198
|
+
handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({
|
|
199
|
+
operation: 'Get the current MCP server environment.',
|
|
200
|
+
toolName: mcpToolNames_js_1.MCP_TOOLS.GET_ENVIRONMENT,
|
|
201
|
+
actionDescription: 'retrieve the active environment',
|
|
202
|
+
displayFormat: 'Display the current environment (production, development, or testing).',
|
|
203
|
+
})),
|
|
204
|
+
};
|
|
205
|
+
exports.utilityToolPrompts = [
|
|
206
|
+
exports.createWalletPrompt,
|
|
207
|
+
exports.getAddressPrompt,
|
|
208
|
+
exports.getEthereumAddressPrompt,
|
|
209
|
+
exports.getConfigPrompt,
|
|
210
|
+
exports.getUrlByTokenNamePrompt,
|
|
211
|
+
exports.explainSdkUsagePrompt,
|
|
212
|
+
exports.getCacheInfoPrompt,
|
|
213
|
+
exports.clearCachePrompt,
|
|
214
|
+
exports.hasWalletPrompt,
|
|
215
|
+
exports.getWalletPrompt,
|
|
216
|
+
exports.setWalletPrompt,
|
|
217
|
+
exports.getEnvironmentPrompt,
|
|
218
|
+
];
|
|
219
|
+
//# sourceMappingURL=utility-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility-tools.js","sourceRoot":"","sources":["../../src/prompts/utility-tools.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,kEAAyD;AACzD,iEAAiE;AACjE,+DAAqE;AAErE;;GAEG;AACU,QAAA,kBAAkB,GAAc;IAC3C,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,+CAA+C;IAC5D,OAAO,EAAE,GAAG,EAAE,CACZ,IAAA,wCAAoB,EAClB,IAAA,4CAAyB,E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|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/prompts/utility.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAe9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAgCrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,EAAgD,CAAC"}
|
package/dist/prompts/utility.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.utilityPrompts = exports.switchEnvironmentPrompt = exports.getVersionPrompt = void 0;
|
|
9
|
+
const handlerHelpers_js_1 = require("./utils/handlerHelpers.js");
|
|
9
10
|
/**
|
|
10
11
|
* Get Version - Display SDK and MCP server version information
|
|
11
12
|
*
|
|
@@ -16,12 +17,7 @@ exports.getVersionPrompt = {
|
|
|
16
17
|
name: 'galachain-launchpad:version',
|
|
17
18
|
description: 'Get SDK and MCP server version information',
|
|
18
19
|
handler: () => {
|
|
19
|
-
return
|
|
20
|
-
{
|
|
21
|
-
role: 'user',
|
|
22
|
-
content: {
|
|
23
|
-
type: 'text',
|
|
24
|
-
text: `Get version information for the Gala Launchpad SDK and MCP server.
|
|
20
|
+
return (0, handlerHelpers_js_1.createPromptResponse)(`Get version information for the Gala Launchpad SDK and MCP server.
|
|
25
21
|
|
|
26
22
|
Use the gala_launchpad_get_version tool to fetch the version details.
|
|
27
23
|
|
|
@@ -30,10 +26,7 @@ Display the results in a clear, formatted response showing:
|
|
|
30
26
|
2. MCP Server Version
|
|
31
27
|
3. Timestamp
|
|
32
28
|
|
|
33
|
-
This is helpful for debugging version compatibility issues or confirming installed versions
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
];
|
|
29
|
+
This is helpful for debugging version compatibility issues or confirming installed versions.`);
|
|
37
30
|
},
|
|
38
31
|
};
|
|
39
32
|
/**
|
|
@@ -57,12 +50,7 @@ exports.switchEnvironmentPrompt = {
|
|
|
57
50
|
const targetEnv = args.environment?.toLowerCase() || '';
|
|
58
51
|
const validEnvs = ['production', 'development', 'testing'];
|
|
59
52
|
const isValidEnv = validEnvs.includes(targetEnv);
|
|
60
|
-
return
|
|
61
|
-
{
|
|
62
|
-
role: 'user',
|
|
63
|
-
content: {
|
|
64
|
-
type: 'text',
|
|
65
|
-
text: `Switch the Gala Launchpad MCP server to a different environment.
|
|
53
|
+
return (0, handlerHelpers_js_1.createPromptResponse)(`Switch the Gala Launchpad MCP server to a different environment.
|
|
66
54
|
|
|
67
55
|
Current task: Switch to the ${isValidEnv ? targetEnv : 'specified'} environment
|
|
68
56
|
|
|
@@ -77,10 +65,7 @@ Available environments:
|
|
|
77
65
|
- development: Development environment for testing features
|
|
78
66
|
- testing: Testing environment for local/staging tests
|
|
79
67
|
|
|
80
|
-
Wallet Preservation: The wallet configuration will be preserved during the switch, maintaining your current signing capabilities if configured
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
];
|
|
68
|
+
Wallet Preservation: The wallet configuration will be preserved during the switch, maintaining your current signing capabilities if configured.`);
|
|
84
69
|
},
|
|
85
70
|
};
|
|
86
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../src/prompts/utility.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;
|
|
1
|
+
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../src/prompts/utility.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,iEAAiE;AAEjE;;;;;GAKG;AACU,QAAA,gBAAgB,GAAc;IACzC,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,4CAA4C;IACzD,OAAO,EAAE,GAAG,EAAE;QACZ,OAAO,IAAA,wCAAoB,EAAC;;;;;;;;;6FAS6D,CAAC,CAAC;IAC7F,CAAC;CACF,CAAC;AAEF;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAc;IAChD,IAAI,EAAE,wCAAwC;IAC9C,WAAW,EAAE,wFAAwF;IACrG,SAAS,EAAE;QACT;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QACxD,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QAC3D,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAEjD,OAAO,IAAA,wCAAoB,EAAC;;8BAEF,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;;;;8FAI4B,SAAS,IAAI,YAAY;;;;;;;;;gJASyB,CAAC,CAAC;IAChJ,CAAC;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,cAAc,GAAgB,CAAC,wBAAgB,EAAE,+BAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handler Helper Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides reusable utilities for creating MCP prompt handlers with
|
|
5
|
+
* standardized response formatting and validation patterns.
|
|
6
|
+
*/
|
|
7
|
+
import type { PromptMessage } from '../../types/mcp.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a standard MCP prompt response with user role
|
|
10
|
+
*
|
|
11
|
+
* @param text - The prompt text to send to the user
|
|
12
|
+
* @returns Array containing formatted MCP message
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* handler: (args) => {
|
|
16
|
+
* validateTokenName(args.tokenName);
|
|
17
|
+
* return createPromptResponse(`Fetch token ${args.tokenName}...`);
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export declare function createPromptResponse(text: string): PromptMessage[];
|
|
21
|
+
/**
|
|
22
|
+
* Create a handler function that validates arguments and returns a prompt response
|
|
23
|
+
*
|
|
24
|
+
* @param validator - Function to validate the arguments
|
|
25
|
+
* @param textGenerator - Function that generates the prompt text from arguments
|
|
26
|
+
* @returns A handler function ready to use in a prompt definition
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* handler: createValidatedHandler(
|
|
30
|
+
* (args) => validateTokenName(args.tokenName),
|
|
31
|
+
* (args) => `Fetch token ${args.tokenName}...`
|
|
32
|
+
* )
|
|
33
|
+
*/
|
|
34
|
+
export declare function createValidatedHandler<T>(validator: (args: T) => void, textGenerator: (args: T) => string): (args: T) => PromptMessage[];
|
|
35
|
+
//# sourceMappingURL=handlerHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlerHelpers.d.ts","sourceRoot":"","sources":["../../../src/prompts/utils/handlerHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAUlE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,EAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GACjC,CAAC,IAAI,EAAE,CAAC,KAAK,aAAa,EAAE,CAK9B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Handler Helper Utilities
|
|
4
|
+
*
|
|
5
|
+
* Provides reusable utilities for creating MCP prompt handlers with
|
|
6
|
+
* standardized response formatting and validation patterns.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.createPromptResponse = createPromptResponse;
|
|
10
|
+
exports.createValidatedHandler = createValidatedHandler;
|
|
11
|
+
/**
|
|
12
|
+
* Create a standard MCP prompt response with user role
|
|
13
|
+
*
|
|
14
|
+
* @param text - The prompt text to send to the user
|
|
15
|
+
* @returns Array containing formatted MCP message
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* handler: (args) => {
|
|
19
|
+
* validateTokenName(args.tokenName);
|
|
20
|
+
* return createPromptResponse(`Fetch token ${args.tokenName}...`);
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
function createPromptResponse(text) {
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
role: 'user',
|
|
27
|
+
content: {
|
|
28
|
+
type: 'text',
|
|
29
|
+
text,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create a handler function that validates arguments and returns a prompt response
|
|
36
|
+
*
|
|
37
|
+
* @param validator - Function to validate the arguments
|
|
38
|
+
* @param textGenerator - Function that generates the prompt text from arguments
|
|
39
|
+
* @returns A handler function ready to use in a prompt definition
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* handler: createValidatedHandler(
|
|
43
|
+
* (args) => validateTokenName(args.tokenName),
|
|
44
|
+
* (args) => `Fetch token ${args.tokenName}...`
|
|
45
|
+
* )
|
|
46
|
+
*/
|
|
47
|
+
function createValidatedHandler(validator, textGenerator) {
|
|
48
|
+
return (args) => {
|
|
49
|
+
validator(args);
|
|
50
|
+
return createPromptResponse(textGenerator(args));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=handlerHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlerHelpers.js","sourceRoot":"","sources":["../../../src/prompts/utils/handlerHelpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAgBH,oDAUC;AAeD,wDAQC;AA7CD;;;;;;;;;;;GAWG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,OAAO;QACL;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI;aACL;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,sBAAsB,CACpC,SAA4B,EAC5B,aAAkC;IAElC,OAAO,CAAC,IAAO,EAAE,EAAE;QACjB,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,OAAO,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Text Templates
|
|
3
|
+
*
|
|
4
|
+
* Provides reusable template generators for common MCP prompt patterns.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for simple operation prompts
|
|
8
|
+
*/
|
|
9
|
+
export interface SimpleOperationConfig {
|
|
10
|
+
/** Operation description (e.g., "Fetch GALA balance for wallet.") */
|
|
11
|
+
operation: string;
|
|
12
|
+
/** Parameter descriptions as key-value pairs (optional) */
|
|
13
|
+
parameters?: Record<string, string | undefined>;
|
|
14
|
+
/** MCP tool name (e.g., MCP_TOOLS.FETCH_GALA_BALANCE) */
|
|
15
|
+
toolName: string;
|
|
16
|
+
/** Description of what the tool does (e.g., "retrieve the GALA balance") */
|
|
17
|
+
actionDescription: string;
|
|
18
|
+
/** Optional display format instructions */
|
|
19
|
+
displayFormat?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generate text for simple operation prompts
|
|
23
|
+
*
|
|
24
|
+
* Creates a standardized prompt text with operation, parameters, tool usage,
|
|
25
|
+
* and optional display format instructions.
|
|
26
|
+
*
|
|
27
|
+
* @param config - Configuration for the operation
|
|
28
|
+
* @returns Formatted prompt text
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* text: createSimpleOperationText({
|
|
32
|
+
* operation: 'Get GALA balance for wallet.',
|
|
33
|
+
* parameters: {
|
|
34
|
+
* address: args.address ? `Address: ${args.address}` : 'Using default wallet'
|
|
35
|
+
* },
|
|
36
|
+
* toolName: MCP_TOOLS.FETCH_GALA_BALANCE,
|
|
37
|
+
* actionDescription: 'retrieve the GALA balance',
|
|
38
|
+
* displayFormat: 'Display the balance in a clear format.'
|
|
39
|
+
* })
|
|
40
|
+
*/
|
|
41
|
+
export declare function createSimpleOperationText(config: SimpleOperationConfig): string;
|
|
42
|
+
//# sourceMappingURL=textTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textTemplates.d.ts","sourceRoot":"","sources":["../../../src/prompts/utils/textTemplates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAElB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAEhD,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IAEjB,4EAA4E;IAC5E,iBAAiB,EAAE,MAAM,CAAC;IAE1B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CA0B/E"}
|