@gala-chain/launchpad-mcp-server 1.5.0 → 1.6.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 (89) hide show
  1. package/.eslintrc.json +9 -1
  2. package/dist/schemas/common-schemas.d.ts +121 -16
  3. package/dist/schemas/common-schemas.d.ts.map +1 -1
  4. package/dist/schemas/common-schemas.js +122 -17
  5. package/dist/schemas/common-schemas.js.map +1 -1
  6. package/dist/scripts/test-all-prompts.d.ts +6 -0
  7. package/dist/scripts/test-all-prompts.d.ts.map +1 -0
  8. package/dist/scripts/test-all-prompts.js +158 -0
  9. package/dist/scripts/test-all-prompts.js.map +1 -0
  10. package/dist/tools/balance/index.d.ts.map +1 -1
  11. package/dist/tools/balance/index.js +5 -4
  12. package/dist/tools/balance/index.js.map +1 -1
  13. package/dist/tools/creation/index.d.ts.map +1 -1
  14. package/dist/tools/creation/index.js +6 -11
  15. package/dist/tools/creation/index.js.map +1 -1
  16. package/dist/tools/index.d.ts +9 -2
  17. package/dist/tools/index.d.ts.map +1 -1
  18. package/dist/tools/index.js +58 -14
  19. package/dist/tools/index.js.map +1 -1
  20. package/dist/tools/pools/fetchPoolDetailsForCalculation.d.ts +2 -3
  21. package/dist/tools/pools/fetchPoolDetailsForCalculation.d.ts.map +1 -1
  22. package/dist/tools/pools/fetchPoolDetailsForCalculation.js +5 -17
  23. package/dist/tools/pools/fetchPoolDetailsForCalculation.js.map +1 -1
  24. package/dist/tools/pools/index.d.ts.map +1 -1
  25. package/dist/tools/pools/index.js +51 -137
  26. package/dist/tools/pools/index.js.map +1 -1
  27. package/dist/tools/social/index.d.ts.map +1 -1
  28. package/dist/tools/social/index.js +4 -3
  29. package/dist/tools/social/index.js.map +1 -1
  30. package/dist/tools/trading/index.d.ts.map +1 -1
  31. package/dist/tools/trading/index.js +7 -21
  32. package/dist/tools/trading/index.js.map +1 -1
  33. package/dist/tools/utils/clearCache.d.ts +9 -0
  34. package/dist/tools/utils/clearCache.d.ts.map +1 -0
  35. package/dist/tools/utils/clearCache.js +36 -0
  36. package/dist/tools/utils/clearCache.js.map +1 -0
  37. package/dist/tools/utils/createWallet.d.ts +2 -3
  38. package/dist/tools/utils/createWallet.d.ts.map +1 -1
  39. package/dist/tools/utils/createWallet.js +8 -13
  40. package/dist/tools/utils/createWallet.js.map +1 -1
  41. package/dist/tools/utils/getAddress.d.ts +2 -3
  42. package/dist/tools/utils/getAddress.d.ts.map +1 -1
  43. package/dist/tools/utils/getAddress.js +6 -13
  44. package/dist/tools/utils/getAddress.js.map +1 -1
  45. package/dist/tools/utils/getCacheInfo.d.ts +8 -0
  46. package/dist/tools/utils/getCacheInfo.d.ts.map +1 -0
  47. package/dist/tools/utils/getCacheInfo.js +16 -0
  48. package/dist/tools/utils/getCacheInfo.js.map +1 -0
  49. package/dist/tools/utils/getConfig.d.ts +2 -3
  50. package/dist/tools/utils/getConfig.d.ts.map +1 -1
  51. package/dist/tools/utils/getConfig.js +5 -13
  52. package/dist/tools/utils/getConfig.js.map +1 -1
  53. package/dist/tools/utils/getEthereumAddress.d.ts +2 -3
  54. package/dist/tools/utils/getEthereumAddress.d.ts.map +1 -1
  55. package/dist/tools/utils/getEthereumAddress.js +6 -13
  56. package/dist/tools/utils/getEthereumAddress.js.map +1 -1
  57. package/dist/tools/utils/getUrlByTokenName.d.ts +2 -3
  58. package/dist/tools/utils/getUrlByTokenName.d.ts.map +1 -1
  59. package/dist/tools/utils/getUrlByTokenName.js +6 -20
  60. package/dist/tools/utils/getUrlByTokenName.js.map +1 -1
  61. package/dist/tools/utils/index.d.ts.map +1 -1
  62. package/dist/tools/utils/index.js +4 -0
  63. package/dist/tools/utils/index.js.map +1 -1
  64. package/dist/tools/utils/isTokenGraduated.d.ts +2 -3
  65. package/dist/tools/utils/isTokenGraduated.d.ts.map +1 -1
  66. package/dist/tools/utils/isTokenGraduated.js +6 -17
  67. package/dist/tools/utils/isTokenGraduated.js.map +1 -1
  68. package/dist/utils/default-values.d.ts +147 -0
  69. package/dist/utils/default-values.d.ts.map +1 -0
  70. package/dist/utils/default-values.js +177 -0
  71. package/dist/utils/default-values.js.map +1 -0
  72. package/dist/utils/error-handler.d.ts +9 -2
  73. package/dist/utils/error-handler.d.ts.map +1 -1
  74. package/dist/utils/error-handler.js +14 -59
  75. package/dist/utils/error-handler.js.map +1 -1
  76. package/dist/utils/error-templates.d.ts +96 -0
  77. package/dist/utils/error-templates.d.ts.map +1 -0
  78. package/dist/utils/error-templates.js +244 -0
  79. package/dist/utils/error-templates.js.map +1 -0
  80. package/dist/utils/tool-factory.d.ts +154 -0
  81. package/dist/utils/tool-factory.d.ts.map +1 -0
  82. package/dist/utils/tool-factory.js +194 -0
  83. package/dist/utils/tool-factory.js.map +1 -0
  84. package/dist/utils/tool-registry.d.ts +92 -0
  85. package/dist/utils/tool-registry.d.ts.map +1 -0
  86. package/dist/utils/tool-registry.js +227 -0
  87. package/dist/utils/tool-registry.js.map +1 -0
  88. package/jest.integration.config.js +70 -0
  89. package/package.json +9 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCacheInfo.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/getCacheInfo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,gBAAgB,sCAI3B,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * Get Cache Info Tool
4
+ *
5
+ * Returns statistics about the token metadata cache for monitoring and debugging.
6
+ * The cache persists entire MCP server lifetime and accumulates metadata across conversations.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getCacheInfoTool = void 0;
10
+ const tool_factory_js_1 = require("../../utils/tool-factory.js");
11
+ exports.getCacheInfoTool = (0, tool_factory_js_1.createNoParamTool)({
12
+ name: 'gala_launchpad_get_cache_info',
13
+ description: 'Get token metadata cache statistics including total tokens cached, cache size in bytes, and timestamp of oldest entry. The cache persists for the entire MCP server lifetime.',
14
+ handler: (sdk) => sdk.getCacheInfo(),
15
+ });
16
+ //# sourceMappingURL=getCacheInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCacheInfo.js","sourceRoot":"","sources":["../../../src/tools/utils/getCacheInfo.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAAgE;AAEnD,QAAA,gBAAgB,GAAG,IAAA,mCAAiB,EAAC;IAChD,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,+KAA+K;IAC5L,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,EAAE;CACrC,CAAC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Get Config Tool
2
+ * Get Config Tool (45% code reduction via factory pattern)
3
3
  */
4
- import type { MCPTool } from '../../types/mcp.js';
5
- export declare const getConfigTool: MCPTool;
4
+ export declare const getConfigTool: import("../../types/mcp.js").MCPTool;
6
5
  //# sourceMappingURL=getConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getConfig.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/getConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIlD,eAAO,MAAM,aAAa,EAAE,OAW3B,CAAC"}
1
+ {"version":3,"file":"getConfig.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/getConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAO,MAAM,aAAa,sCAIxB,CAAC"}
@@ -1,21 +1,13 @@
1
1
  "use strict";
2
2
  /**
3
- * Get Config Tool
3
+ * Get Config Tool (45% code reduction via factory pattern)
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getConfigTool = void 0;
7
- const response_formatter_js_1 = require("../../utils/response-formatter.js");
8
- const error_handler_js_1 = require("../../utils/error-handler.js");
9
- exports.getConfigTool = {
7
+ const tool_factory_js_1 = require("../../utils/tool-factory.js");
8
+ exports.getConfigTool = (0, tool_factory_js_1.createNoParamTool)({
10
9
  name: 'gala_launchpad_get_config',
11
10
  description: 'Get the current SDK configuration including environment, base URLs, timeouts, feature flags, and effective slippage tolerance factors.',
12
- inputSchema: {
13
- type: 'object',
14
- properties: {},
15
- },
16
- handler: (0, error_handler_js_1.withErrorHandling)(async (sdk) => {
17
- const config = sdk.getConfig();
18
- return (0, response_formatter_js_1.formatSuccess)(config);
19
- }),
20
- };
11
+ handler: (sdk) => sdk.getConfig(),
12
+ });
21
13
  //# sourceMappingURL=getConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getConfig.js","sourceRoot":"","sources":["../../../src/tools/utils/getConfig.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,6EAAkE;AAClE,mEAAiE;AAEpD,QAAA,aAAa,GAAY;IACpC,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,wIAAwI;IACrJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;KACf;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACvC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAC/B,OAAO,IAAA,qCAAa,EAAC,MAAM,CAAC,CAAC;IAC/B,CAAC,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"getConfig.js","sourceRoot":"","sources":["../../../src/tools/utils/getConfig.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iEAAgE;AAEnD,QAAA,aAAa,GAAG,IAAA,mCAAiB,EAAC;IAC7C,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,wIAAwI;IACrJ,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE;CAClC,CAAC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Get Ethereum Address Tool
2
+ * Get Ethereum Address Tool (45% code reduction via factory pattern)
3
3
  */
4
- import type { MCPTool } from '../../types/mcp.js';
5
- export declare const getEthereumAddressTool: MCPTool;
4
+ export declare const getEthereumAddressTool: import("../../types/mcp.js").MCPTool;
6
5
  //# sourceMappingURL=getEthereumAddress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getEthereumAddress.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/getEthereumAddress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIlD,eAAO,MAAM,sBAAsB,EAAE,OAWpC,CAAC"}
1
+ {"version":3,"file":"getEthereumAddress.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/getEthereumAddress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAO,MAAM,sBAAsB,sCAKjC,CAAC"}
@@ -1,21 +1,14 @@
1
1
  "use strict";
2
2
  /**
3
- * Get Ethereum Address Tool
3
+ * Get Ethereum Address Tool (45% code reduction via factory pattern)
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getEthereumAddressTool = void 0;
7
- const response_formatter_js_1 = require("../../utils/response-formatter.js");
8
- const error_handler_js_1 = require("../../utils/error-handler.js");
9
- exports.getEthereumAddressTool = {
7
+ const tool_factory_js_1 = require("../../utils/tool-factory.js");
8
+ exports.getEthereumAddressTool = (0, tool_factory_js_1.createNoParamTool)({
10
9
  name: 'gala_launchpad_get_ethereum_address',
11
10
  description: 'Get the standard Ethereum address format (0x...) for the authenticated wallet.',
12
- inputSchema: {
13
- type: 'object',
14
- properties: {},
15
- },
16
- handler: (0, error_handler_js_1.withErrorHandling)(async (sdk) => {
17
- const address = sdk.getEthereumAddress();
18
- return (0, response_formatter_js_1.formatSuccess)({ address });
19
- }),
20
- };
11
+ handler: (sdk) => sdk.getEthereumAddress(),
12
+ resultKey: 'address',
13
+ });
21
14
  //# sourceMappingURL=getEthereumAddress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getEthereumAddress.js","sourceRoot":"","sources":["../../../src/tools/utils/getEthereumAddress.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,6EAAkE;AAClE,mEAAiE;AAEpD,QAAA,sBAAsB,GAAY;IAC7C,IAAI,EAAE,qCAAqC;IAC3C,WAAW,EAAE,gFAAgF;IAC7F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;KACf;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACvC,MAAM,OAAO,GAAG,GAAG,CAAC,kBAAkB,EAAE,CAAC;QACzC,OAAO,IAAA,qCAAa,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"getEthereumAddress.js","sourceRoot":"","sources":["../../../src/tools/utils/getEthereumAddress.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iEAAgE;AAEnD,QAAA,sBAAsB,GAAG,IAAA,mCAAiB,EAAC;IACtD,IAAI,EAAE,qCAAqC;IAC3C,WAAW,EAAE,gFAAgF;IAC7F,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,kBAAkB,EAAE;IAC1C,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Get URL by Token Name Tool
2
+ * Get URL by Token Name Tool (73% code reduction via factory pattern)
3
3
  */
4
- import type { MCPTool } from '../../types/mcp.js';
5
- export declare const getUrlByTokenNameTool: MCPTool;
4
+ export declare const getUrlByTokenNameTool: import("../../types/mcp.js").MCPTool;
6
5
  //# sourceMappingURL=getUrlByTokenName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getUrlByTokenName.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/getUrlByTokenName.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAKlD,eAAO,MAAM,qBAAqB,EAAE,OAiBnC,CAAC"}
1
+ {"version":3,"file":"getUrlByTokenName.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/getUrlByTokenName.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAO,MAAM,qBAAqB,sCAKhC,CAAC"}
@@ -1,28 +1,14 @@
1
1
  "use strict";
2
2
  /**
3
- * Get URL by Token Name Tool
3
+ * Get URL by Token Name Tool (73% code reduction via factory pattern)
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getUrlByTokenNameTool = void 0;
7
- const response_formatter_js_1 = require("../../utils/response-formatter.js");
8
- const error_handler_js_1 = require("../../utils/error-handler.js");
9
- const common_schemas_js_1 = require("../../schemas/common-schemas.js");
10
- exports.getUrlByTokenNameTool = {
7
+ const tool_factory_js_1 = require("../../utils/tool-factory.js");
8
+ exports.getUrlByTokenNameTool = (0, tool_factory_js_1.createResolutionTool)({
11
9
  name: 'gala_launchpad_get_url_by_token_name',
12
10
  description: 'Get the launchpad frontend URL for a specific token. Returns the complete URL for viewing/trading the token in the web interface.',
13
- inputSchema: {
14
- type: 'object',
15
- properties: {
16
- tokenName: {
17
- ...common_schemas_js_1.TOKEN_NAME_SCHEMA,
18
- description: 'Token name to generate URL for',
19
- },
20
- },
21
- required: ['tokenName'],
22
- },
23
- handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
24
- const url = sdk.getUrlByTokenName(args.tokenName);
25
- return (0, response_formatter_js_1.formatSuccess)({ url, tokenName: args.tokenName });
26
- }),
27
- };
11
+ resolver: async (sdk, tokenName) => sdk.getUrlByTokenName(tokenName),
12
+ resultKey: 'url',
13
+ });
28
14
  //# sourceMappingURL=getUrlByTokenName.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getUrlByTokenName.js","sourceRoot":"","sources":["../../../src/tools/utils/getUrlByTokenName.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,6EAAkE;AAClE,mEAAiE;AACjE,uEAAoE;AAEvD,QAAA,qBAAqB,GAAY;IAC5C,IAAI,EAAE,sCAAsC;IAC5C,WAAW,EAAE,mIAAmI;IAChJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,GAAG,qCAAiB;gBACpB,WAAW,EAAE,gCAAgC;aAC9C;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC7C,MAAM,GAAG,GAAG,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClD,OAAO,IAAA,qCAAa,EAAC,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"getUrlByTokenName.js","sourceRoot":"","sources":["../../../src/tools/utils/getUrlByTokenName.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iEAAmE;AAEtD,QAAA,qBAAqB,GAAG,IAAA,sCAAoB,EAAC;IACxD,IAAI,EAAE,sCAAsC;IAC5C,WAAW,EAAE,mIAAmI;IAChJ,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC;IACpE,SAAS,EAAE,KAAK;CACjB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,YAAY,wCAQxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,YAAY,wCAUxB,CAAC"}
@@ -11,6 +11,8 @@ const getConfig_js_1 = require("./getConfig.js");
11
11
  const getUrlByTokenName_js_1 = require("./getUrlByTokenName.js");
12
12
  const explainSdkUsage_js_1 = require("./explainSdkUsage.js");
13
13
  const isTokenGraduated_js_1 = require("./isTokenGraduated.js");
14
+ const getCacheInfo_js_1 = require("./getCacheInfo.js");
15
+ const clearCache_js_1 = require("./clearCache.js");
14
16
  exports.utilityTools = [
15
17
  createWallet_js_1.createWalletTool,
16
18
  getAddress_js_1.getAddressTool,
@@ -19,5 +21,7 @@ exports.utilityTools = [
19
21
  getUrlByTokenName_js_1.getUrlByTokenNameTool,
20
22
  explainSdkUsage_js_1.explainSdkUsageTool,
21
23
  isTokenGraduated_js_1.isTokenGraduatedTool,
24
+ getCacheInfo_js_1.getCacheInfoTool,
25
+ clearCache_js_1.clearCacheTool,
22
26
  ];
23
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAqD;AACrD,mDAAiD;AACjD,mEAAiE;AACjE,iDAA+C;AAC/C,iEAA+D;AAC/D,6DAA2D;AAC3D,+DAA6D;AAEhD,QAAA,YAAY,GAAG;IAC1B,kCAAgB;IAChB,8BAAc;IACd,8CAAsB;IACtB,4BAAa;IACb,4CAAqB;IACrB,wCAAmB;IACnB,0CAAoB;CACrB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAqD;AACrD,mDAAiD;AACjD,mEAAiE;AACjE,iDAA+C;AAC/C,iEAA+D;AAC/D,6DAA2D;AAC3D,+DAA6D;AAC7D,uDAAqD;AACrD,mDAAiD;AAEpC,QAAA,YAAY,GAAG;IAC1B,kCAAgB;IAChB,8BAAc;IACd,8CAAsB;IACtB,4BAAa;IACb,4CAAqB;IACrB,wCAAmB;IACnB,0CAAoB;IACpB,kCAAgB;IAChB,8BAAc;CACf,CAAC"}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Check if token has graduated from bonding curve
2
+ * Check if token has graduated from bonding curve (73% code reduction via factory pattern)
3
3
  */
4
- import type { MCPTool } from '../../types/mcp.js';
5
- export declare const isTokenGraduatedTool: MCPTool;
4
+ export declare const isTokenGraduatedTool: import("../../types/mcp.js").MCPTool;
6
5
  //# sourceMappingURL=isTokenGraduated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isTokenGraduated.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/isTokenGraduated.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAKlD,eAAO,MAAM,oBAAoB,EAAE,OAkBlC,CAAC"}
1
+ {"version":3,"file":"isTokenGraduated.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/isTokenGraduated.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAO,MAAM,oBAAoB,sCAS/B,CAAC"}
@@ -1,29 +1,18 @@
1
1
  "use strict";
2
2
  /**
3
- * Check if token has graduated from bonding curve
3
+ * Check if token has graduated from bonding curve (73% code reduction via factory pattern)
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.isTokenGraduatedTool = void 0;
7
- const response_formatter_js_1 = require("../../utils/response-formatter.js");
8
- const error_handler_js_1 = require("../../utils/error-handler.js");
9
- const common_schemas_js_1 = require("../../schemas/common-schemas.js");
10
- exports.isTokenGraduatedTool = {
7
+ const tool_factory_js_1 = require("../../utils/tool-factory.js");
8
+ exports.isTokenGraduatedTool = (0, tool_factory_js_1.createResolutionTool)({
11
9
  name: 'gala_launchpad_is_token_graduated',
12
10
  description: `Check if a token has completed the bonding curve phase and graduated to full DEX trading.
13
11
 
14
12
  RETURNS: Boolean indicating if pool saleStatus is "Completed"
15
13
 
16
14
  USAGE: Useful for conditional logic before attempting graduation or checking pool state.`,
17
- inputSchema: {
18
- type: 'object',
19
- properties: {
20
- tokenName: common_schemas_js_1.TOKEN_NAME_SCHEMA,
21
- },
22
- required: ['tokenName'],
23
- },
24
- handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
25
- const result = await sdk.isTokenGraduated(args.tokenName);
26
- return (0, response_formatter_js_1.formatSuccess)({ graduated: result });
27
- }),
28
- };
15
+ resolver: (sdk, tokenName) => sdk.isTokenGraduated(tokenName),
16
+ resultKey: 'graduated',
17
+ });
29
18
  //# sourceMappingURL=isTokenGraduated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isTokenGraduated.js","sourceRoot":"","sources":["../../../src/tools/utils/isTokenGraduated.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,6EAAkE;AAClE,mEAAiE;AACjE,uEAAoE;AAEvD,QAAA,oBAAoB,GAAY;IAC3C,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE;;;;yFAI0E;IACvF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE,qCAAiB;SAC7B;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1D,OAAO,IAAA,qCAAa,EAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"isTokenGraduated.js","sourceRoot":"","sources":["../../../src/tools/utils/isTokenGraduated.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iEAAmE;AAEtD,QAAA,oBAAoB,GAAG,IAAA,sCAAoB,EAAC;IACvD,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE;;;;yFAI0E;IACvF,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC,SAAS,CAAC;IAC7D,SAAS,EAAE,WAAW;CACvB,CAAC,CAAC"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Default Value Utilities
3
+ *
4
+ * Centralized default values for tool parameters to eliminate magic numbers
5
+ * and ensure consistency across 47 MCP tools.
6
+ *
7
+ * @see Phase 2.2 of refactoring plan
8
+ */
9
+ /**
10
+ * Default pagination configuration
11
+ */
12
+ export declare const DEFAULT_PAGINATION: {
13
+ readonly page: 1;
14
+ readonly limit: 20;
15
+ };
16
+ /**
17
+ * Operation-specific default limits
18
+ */
19
+ export declare const DEFAULT_LIMITS: {
20
+ readonly trade: 20;
21
+ readonly user: 20;
22
+ readonly pool: 20;
23
+ readonly comment: 20;
24
+ };
25
+ /**
26
+ * Maximum limits per operation type (from MCP_CONSTRAINTS)
27
+ */
28
+ export declare const MAX_LIMITS: {
29
+ readonly trade: 20;
30
+ readonly user: 20;
31
+ readonly pool: 100;
32
+ readonly comment: 50;
33
+ };
34
+ /**
35
+ * Default slippage tolerance (1%)
36
+ */
37
+ export declare const DEFAULT_SLIPPAGE_TOLERANCE = 0.01;
38
+ /**
39
+ * Default reverse bonding curve fee slippage tolerance (1%)
40
+ */
41
+ export declare const DEFAULT_RBC_FEE_SLIPPAGE = 0.01;
42
+ /**
43
+ * Default pool type for fetchPools
44
+ */
45
+ export declare const DEFAULT_POOL_TYPE = "recent";
46
+ /**
47
+ * Default sort order
48
+ */
49
+ export declare const DEFAULT_SORT_ORDER = "DESC";
50
+ /**
51
+ * Default resolution for volume data (1 hour)
52
+ */
53
+ export declare const DEFAULT_VOLUME_RESOLUTION = "1h";
54
+ /**
55
+ * Resolution mapping (string to seconds)
56
+ */
57
+ export declare const RESOLUTION_MAP: Record<string, number>;
58
+ /**
59
+ * Applies default pagination values to args object
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * const params = applyPaginationDefaults(args);
64
+ * // { page: 1, limit: 20, ...otherArgs }
65
+ * ```
66
+ */
67
+ export declare function applyPaginationDefaults<T extends Record<string, any>>(args: T, defaults?: {
68
+ page?: number;
69
+ limit?: number;
70
+ }): T & {
71
+ page: number;
72
+ limit: number;
73
+ };
74
+ /**
75
+ * Applies operation-specific pagination defaults
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * const params = applyOperationPaginationDefaults(args, 'pool');
80
+ * // Uses default limit of 20 for pool operations
81
+ * ```
82
+ */
83
+ export declare function applyOperationPaginationDefaults<T extends Record<string, any>>(args: T, operationType: keyof typeof DEFAULT_LIMITS): T & {
84
+ page: number;
85
+ limit: number;
86
+ };
87
+ /**
88
+ * Applies default slippage values to trading args
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * const params = applySlippageDefaults(args);
93
+ * // { slippageToleranceFactor: 0.01, maxAcceptableReverseBondingCurveFeeSlippageFactor: 0.01, ...args }
94
+ * ```
95
+ */
96
+ export declare function applySlippageDefaults<T extends Record<string, any>>(args: T, defaults?: {
97
+ slippageToleranceFactor?: number;
98
+ maxAcceptableReverseBondingCurveFeeSlippageFactor?: number;
99
+ }): T & {
100
+ slippageToleranceFactor: number;
101
+ maxAcceptableReverseBondingCurveFeeSlippageFactor: number;
102
+ };
103
+ /**
104
+ * Converts volume resolution string to seconds
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * const seconds = resolutionToSeconds('1h', '1h');
109
+ * // 3600
110
+ * ```
111
+ */
112
+ export declare function resolutionToSeconds(resolution: string | undefined, defaultResolution?: string): number;
113
+ /**
114
+ * Converts ISO 8601 date string to Unix timestamp (seconds)
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * const timestamp = dateToUnixTimestamp('2024-01-15T14:30:25Z');
119
+ * // 1705329025
120
+ * ```
121
+ */
122
+ export declare function dateToUnixTimestamp(isoDate: string | undefined): number | undefined;
123
+ export declare const defaultValues: {
124
+ pagination: {
125
+ readonly page: 1;
126
+ readonly limit: 20;
127
+ };
128
+ limits: {
129
+ readonly trade: 20;
130
+ readonly user: 20;
131
+ readonly pool: 20;
132
+ readonly comment: 20;
133
+ };
134
+ maxLimits: {
135
+ readonly trade: 20;
136
+ readonly user: 20;
137
+ readonly pool: 100;
138
+ readonly comment: 50;
139
+ };
140
+ slippageTolerance: number;
141
+ rbcFeeSlippage: number;
142
+ poolType: string;
143
+ sortOrder: string;
144
+ volumeResolution: string;
145
+ resolutionMap: Record<string, number>;
146
+ };
147
+ //# sourceMappingURL=default-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-values.d.ts","sourceRoot":"","sources":["../../src/utils/default-values.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAMX;;GAEG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAMzC;;GAEG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOxC,CAAC;AAMX;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnE,IAAI,EAAE,CAAC,EACP,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAuB,GAC/D,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAMrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5E,IAAI,EAAE,CAAC,EACP,aAAa,EAAE,MAAM,OAAO,cAAc,GACzC,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAKrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjE,IAAI,EAAE,CAAC,EACP,QAAQ,GAAE;IACR,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,iDAAiD,CAAC,EAAE,MAAM,CAAC;CACvD,GACL,CAAC,GAAG;IACL,uBAAuB,EAAE,MAAM,CAAC;IAChC,iDAAiD,EAAE,MAAM,CAAC;CAC3D,CAYA;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,iBAAiB,GAAE,MAAkC,GACpD,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGnF;AAMD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;CAUzB,CAAC"}
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ /**
3
+ * Default Value Utilities
4
+ *
5
+ * Centralized default values for tool parameters to eliminate magic numbers
6
+ * and ensure consistency across 47 MCP tools.
7
+ *
8
+ * @see Phase 2.2 of refactoring plan
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.defaultValues = exports.RESOLUTION_MAP = exports.DEFAULT_VOLUME_RESOLUTION = exports.DEFAULT_SORT_ORDER = exports.DEFAULT_POOL_TYPE = exports.DEFAULT_RBC_FEE_SLIPPAGE = exports.DEFAULT_SLIPPAGE_TOLERANCE = exports.MAX_LIMITS = exports.DEFAULT_LIMITS = exports.DEFAULT_PAGINATION = void 0;
12
+ exports.applyPaginationDefaults = applyPaginationDefaults;
13
+ exports.applyOperationPaginationDefaults = applyOperationPaginationDefaults;
14
+ exports.applySlippageDefaults = applySlippageDefaults;
15
+ exports.resolutionToSeconds = resolutionToSeconds;
16
+ exports.dateToUnixTimestamp = dateToUnixTimestamp;
17
+ const constraints_js_1 = require("./constraints.js");
18
+ // =============================================================================
19
+ // Pagination Defaults
20
+ // =============================================================================
21
+ /**
22
+ * Default pagination configuration
23
+ */
24
+ exports.DEFAULT_PAGINATION = {
25
+ page: 1,
26
+ limit: 20,
27
+ };
28
+ /**
29
+ * Operation-specific default limits
30
+ */
31
+ exports.DEFAULT_LIMITS = {
32
+ trade: 20,
33
+ user: 20,
34
+ pool: 20,
35
+ comment: 20,
36
+ };
37
+ /**
38
+ * Maximum limits per operation type (from MCP_CONSTRAINTS)
39
+ */
40
+ exports.MAX_LIMITS = {
41
+ trade: constraints_js_1.MCP_CONSTRAINTS.TRADE_LIMIT, // 20
42
+ user: constraints_js_1.MCP_CONSTRAINTS.USER_LIMIT, // 20
43
+ pool: constraints_js_1.MCP_CONSTRAINTS.POOL_LIMIT, // 100
44
+ comment: constraints_js_1.MCP_CONSTRAINTS.COMMENT_LIMIT, // 50
45
+ };
46
+ // =============================================================================
47
+ // Trading Defaults
48
+ // =============================================================================
49
+ /**
50
+ * Default slippage tolerance (1%)
51
+ */
52
+ exports.DEFAULT_SLIPPAGE_TOLERANCE = 0.01;
53
+ /**
54
+ * Default reverse bonding curve fee slippage tolerance (1%)
55
+ */
56
+ exports.DEFAULT_RBC_FEE_SLIPPAGE = 0.01;
57
+ /**
58
+ * Default pool type for fetchPools
59
+ */
60
+ exports.DEFAULT_POOL_TYPE = 'recent';
61
+ /**
62
+ * Default sort order
63
+ */
64
+ exports.DEFAULT_SORT_ORDER = 'DESC';
65
+ // =============================================================================
66
+ // Volume Data Defaults
67
+ // =============================================================================
68
+ /**
69
+ * Default resolution for volume data (1 hour)
70
+ */
71
+ exports.DEFAULT_VOLUME_RESOLUTION = '1h';
72
+ /**
73
+ * Resolution mapping (string to seconds)
74
+ */
75
+ exports.RESOLUTION_MAP = {
76
+ '1m': 60,
77
+ '5m': 300,
78
+ '15m': 900,
79
+ '1h': 3600,
80
+ '4h': 14400,
81
+ '1d': 86400,
82
+ };
83
+ // =============================================================================
84
+ // Utility Functions
85
+ // =============================================================================
86
+ /**
87
+ * Applies default pagination values to args object
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * const params = applyPaginationDefaults(args);
92
+ * // { page: 1, limit: 20, ...otherArgs }
93
+ * ```
94
+ */
95
+ function applyPaginationDefaults(args, defaults = exports.DEFAULT_PAGINATION) {
96
+ return {
97
+ ...args,
98
+ page: args.page ?? defaults.page ?? exports.DEFAULT_PAGINATION.page,
99
+ limit: args.limit ?? defaults.limit ?? exports.DEFAULT_PAGINATION.limit,
100
+ };
101
+ }
102
+ /**
103
+ * Applies operation-specific pagination defaults
104
+ *
105
+ * @example
106
+ * ```typescript
107
+ * const params = applyOperationPaginationDefaults(args, 'pool');
108
+ * // Uses default limit of 20 for pool operations
109
+ * ```
110
+ */
111
+ function applyOperationPaginationDefaults(args, operationType) {
112
+ return applyPaginationDefaults(args, {
113
+ page: exports.DEFAULT_PAGINATION.page,
114
+ limit: exports.DEFAULT_LIMITS[operationType],
115
+ });
116
+ }
117
+ /**
118
+ * Applies default slippage values to trading args
119
+ *
120
+ * @example
121
+ * ```typescript
122
+ * const params = applySlippageDefaults(args);
123
+ * // { slippageToleranceFactor: 0.01, maxAcceptableReverseBondingCurveFeeSlippageFactor: 0.01, ...args }
124
+ * ```
125
+ */
126
+ function applySlippageDefaults(args, defaults = {}) {
127
+ return {
128
+ ...args,
129
+ slippageToleranceFactor: args.slippageToleranceFactor ??
130
+ defaults.slippageToleranceFactor ??
131
+ exports.DEFAULT_SLIPPAGE_TOLERANCE,
132
+ maxAcceptableReverseBondingCurveFeeSlippageFactor: args.maxAcceptableReverseBondingCurveFeeSlippageFactor ??
133
+ defaults.maxAcceptableReverseBondingCurveFeeSlippageFactor ??
134
+ exports.DEFAULT_RBC_FEE_SLIPPAGE,
135
+ };
136
+ }
137
+ /**
138
+ * Converts volume resolution string to seconds
139
+ *
140
+ * @example
141
+ * ```typescript
142
+ * const seconds = resolutionToSeconds('1h', '1h');
143
+ * // 3600
144
+ * ```
145
+ */
146
+ function resolutionToSeconds(resolution, defaultResolution = exports.DEFAULT_VOLUME_RESOLUTION) {
147
+ return exports.RESOLUTION_MAP[resolution ?? defaultResolution] ?? exports.RESOLUTION_MAP[defaultResolution];
148
+ }
149
+ /**
150
+ * Converts ISO 8601 date string to Unix timestamp (seconds)
151
+ *
152
+ * @example
153
+ * ```typescript
154
+ * const timestamp = dateToUnixTimestamp('2024-01-15T14:30:25Z');
155
+ * // 1705329025
156
+ * ```
157
+ */
158
+ function dateToUnixTimestamp(isoDate) {
159
+ if (!isoDate)
160
+ return undefined;
161
+ return Math.floor(new Date(isoDate).getTime() / 1000);
162
+ }
163
+ // =============================================================================
164
+ // Export All
165
+ // =============================================================================
166
+ exports.defaultValues = {
167
+ pagination: exports.DEFAULT_PAGINATION,
168
+ limits: exports.DEFAULT_LIMITS,
169
+ maxLimits: exports.MAX_LIMITS,
170
+ slippageTolerance: exports.DEFAULT_SLIPPAGE_TOLERANCE,
171
+ rbcFeeSlippage: exports.DEFAULT_RBC_FEE_SLIPPAGE,
172
+ poolType: exports.DEFAULT_POOL_TYPE,
173
+ sortOrder: exports.DEFAULT_SORT_ORDER,
174
+ volumeResolution: exports.DEFAULT_VOLUME_RESOLUTION,
175
+ resolutionMap: exports.RESOLUTION_MAP,
176
+ };
177
+ //# sourceMappingURL=default-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-values.js","sourceRoot":"","sources":["../../src/utils/default-values.ts"],"names":[],"mappings":"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"}
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * Error Handler Utility
3
3
  *
4
- * Formats errors for MCP protocol responses
4
+ * Formats errors for MCP protocol responses with AI-friendly tips.
5
+ * Uses centralized error templates from error-templates.ts.
6
+ *
7
+ * @see src/utils/error-templates.ts
5
8
  */
6
9
  import type { MCPToolResponse } from '../types/mcp.js';
7
10
  /**
@@ -10,6 +13,10 @@ import type { MCPToolResponse } from '../types/mcp.js';
10
13
  export declare function formatError(error: unknown): MCPToolResponse;
11
14
  /**
12
15
  * Wrap handler with error handling
16
+ *
17
+ * @template TArgs - Array of argument types
18
+ * @param handler - Handler function to wrap with error handling
19
+ * @returns Wrapped handler with automatic error formatting
13
20
  */
14
- export declare function withErrorHandling<T extends (...args: any[]) => Promise<MCPToolResponse>>(handler: T): T;
21
+ export declare function withErrorHandling<TArgs extends unknown[]>(handler: (...args: TArgs) => Promise<MCPToolResponse>): (...args: TArgs) => Promise<MCPToolResponse>;
15
22
  //# sourceMappingURL=error-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAoB3D;AA+ED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,eAAe,CAAC,EACtF,OAAO,EAAE,CAAC,GACT,CAAC,CAQH"}
1
+ {"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAkB3D;AAkBD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,OAAO,EAAE,EACvD,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,eAAe,CAAC,GACpD,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,eAAe,CAAC,CAQ9C"}