divy-mcp 0.1.1 → 0.1.2

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/dist/index.js CHANGED
@@ -6,6 +6,8 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
6
6
  import { z } from "zod";
7
7
  import { parseEther, parseUnits } from "viem";
8
8
  import { createDivy, DivyError, explorerTx } from "divy-sdk";
9
+ import { createRequire } from "module";
10
+ var { version } = createRequire(import.meta.url)("../package.json");
9
11
  var options = process.env.DIVY_PRIVATE_KEY ? { privateKey: process.env.DIVY_PRIVATE_KEY, rpcUrl: process.env.DIVY_RPC_URL, apiUrl: process.env.DIVY_API_URL } : process.env.DIVY_API_KEY ? { apiKey: process.env.DIVY_API_KEY, apiUrl: process.env.DIVY_API_URL } : { apiUrl: process.env.DIVY_API_URL };
10
12
  var divy = createDivy(options);
11
13
  var stringify = (value) => JSON.stringify(value, (_key, v) => typeof v === "bigint" ? v.toString() : v, 2);
@@ -26,7 +28,7 @@ var curveOrToken = {
26
28
  curve: addressSchema.optional().describe("The Pons curve contract address, if known"),
27
29
  token: addressSchema.optional().describe("The launched token address, used to look up its curve if curve is not known")
28
30
  };
29
- var server = new McpServer({ name: "divy-mcp", version: "0.1.0" });
31
+ var server = new McpServer({ name: "divy-mcp", version });
30
32
  server.registerTool(
31
33
  "divy_info",
32
34
  {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\nimport { parseEther, parseUnits } from 'viem';\nimport { createDivy, DivyError, explorerTx, type CreateDivyOptions } from 'divy-sdk';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\n\nconst options: CreateDivyOptions = process.env.DIVY_PRIVATE_KEY\n ? { privateKey: process.env.DIVY_PRIVATE_KEY as `0x${string}`, rpcUrl: process.env.DIVY_RPC_URL, apiUrl: process.env.DIVY_API_URL }\n : process.env.DIVY_API_KEY\n ? { apiKey: process.env.DIVY_API_KEY, apiUrl: process.env.DIVY_API_URL }\n : { apiUrl: process.env.DIVY_API_URL };\n\nlet divy = createDivy(options);\n\nconst stringify = (value: unknown): string =>\n JSON.stringify(value, (_key, v) => (typeof v === 'bigint' ? v.toString() : v), 2);\n\nasync function run(fn: () => Promise<unknown>): Promise<CallToolResult> {\n try {\n const result = await fn();\n return { content: [{ type: 'text', text: stringify(result) }] };\n } catch (e) {\n if (e instanceof DivyError) {\n return { content: [{ type: 'text', text: `${e.message} (HTTP ${e.status})` }], isError: true };\n }\n const message = e instanceof Error ? e.message : String(e);\n return { content: [{ type: 'text', text: message }], isError: true };\n }\n}\n\nconst addressSchema = z.string().regex(/^0x[0-9a-fA-F]{40}$/, 'must be a 0x-prefixed 20-byte address');\nconst curveOrToken = {\n curve: addressSchema.optional().describe('The Pons curve contract address, if known'),\n token: addressSchema.optional().describe('The launched token address, used to look up its curve if curve is not known'),\n};\n\nconst server = new McpServer({ name: 'divy-mcp', version: '0.1.0' });\n\nserver.registerTool(\n 'divy_info',\n {\n description: 'Get Divy\\'s chain, contract addresses, fee policy, current launch fee, and indexer status. '\n + 'Call this first to check hostedWallets, launchFee, and maxCreatorTaxBps before launching.',\n inputSchema: {},\n },\n async () => run(() => divy.info()),\n);\n\nserver.registerTool(\n 'divy_leaderboard',\n {\n description: 'List every registered Divy agent ranked by record (graduation rate weighted by holder retention), then fees earned. '\n + 'Use to see who is performing well or to look up an agent\\'s split address.',\n inputSchema: {},\n },\n async () => run(() => divy.leaderboard()),\n);\n\nserver.registerTool(\n 'divy_launches',\n {\n description: 'List the most recent token launches across all Divy agents, newest first.',\n inputSchema: { limit: z.number().int().min(1).max(200).optional().describe('Max rows to return, default 20, max 200') },\n },\n async ({ limit }) => run(() => divy.launches({ limit })),\n);\n\nserver.registerTool(\n 'divy_agent',\n {\n description: 'Get one agent\\'s record: split contract, launches, graduation score, fees earned. '\n + 'Omit address to look up the agent configured for this server (requires a credential).',\n inputSchema: { address: addressSchema.optional().describe('The agent\\'s wallet address; defaults to this server\\'s own agent') },\n },\n async ({ address }) => run(() => divy.agent(address as `0x${string}` | undefined)),\n);\n\nserver.registerTool(\n 'divy_quote',\n {\n description: 'Price a buy or sell on a Pons bonding curve without sending anything. '\n + 'Use before divy_buy/divy_sell to check amountOut and fees, or any time you just want a price.',\n inputSchema: {\n ...curveOrToken,\n side: z.enum(['buy', 'sell']).describe('\"buy\" spends the pair token for the launched token; \"sell\" is the reverse'),\n amount: z.string().describe('Amount to spend (buy) or sell (sell), as an integer string in base units (wei for the pair token, or the launched token\\'s smallest unit)'),\n recipient: addressSchema.optional().describe('Who would receive the trade; affects the snipe-tax quote in the first 3 seconds after launch'),\n },\n },\n async ({ curve, token, side, amount, recipient }) => run(() => divy.quote({\n curve: curve as `0x${string}` | undefined, token: token as `0x${string}` | undefined, side, amount, recipient: recipient as `0x${string}` | undefined,\n })),\n);\n\nserver.registerTool(\n 'divy_create_wallet',\n {\n description: 'Create a hosted wallet for this agent so it can launch without a human wallet. Needs no credential. '\n + 'Returns a one-time apiKey and the wallet address plus how much Robinhood Chain ETH to send it (fund.minEth). '\n + 'This server switches to that wallet immediately, so divy_launch, divy_buy, divy_sell and divy_harvest work in this session. '\n + 'Persist the apiKey and set DIVY_API_KEY to it for future sessions; it is shown once. '\n + 'Skip this if DIVY_PRIVATE_KEY or DIVY_API_KEY is already configured.',\n inputSchema: {\n payout: addressSchema.optional().describe('Wallet that harvested fees are swept to. Defaults to the hosted wallet itself.'),\n label: z.string().max(64).optional().describe('A name for this wallet, for your own bookkeeping'),\n },\n },\n async ({ payout, label }) => run(async () => {\n if (divy.mode !== 'read-only') {\n throw new Error(`this server already has a ${divy.mode} wallet configured; unset DIVY_PRIVATE_KEY / DIVY_API_KEY to create a new one`);\n }\n const created = await divy.createHostedAgent({ payout: payout as `0x${string}` | undefined, label });\n divy = createDivy({ apiKey: created.apiKey, apiUrl: process.env.DIVY_API_URL });\n return created;\n }),\n);\n\nserver.registerTool(\n 'divy_register',\n {\n description: 'Register this agent with Divy so it can launch tokens and earn fees. No-op if already registered. '\n + 'Hosted wallets are registered automatically by their first divy_launch, so this only reports status for them. '\n + 'Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: {},\n },\n async () => run(() => divy.register()),\n);\n\nserver.registerTool(\n 'divy_launch',\n {\n description: 'Launch a new token on Pons through this agent, paying the launch fee from its wallet. '\n + 'Register first with divy_register. Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: {\n name: z.string().min(1).describe('Token name, e.g. \"Halo\"'),\n symbol: z.string().min(1).describe('Token symbol, e.g. \"HALO\"'),\n description: z.string().optional(),\n creatorTaxBps: z.number().int().min(0).optional().describe('Extra creator tax in basis points, up to maxCreatorTaxBps from divy_info; paid to this agent in full'),\n pairToken: addressSchema.optional().describe('An approved ERC20 to pair against instead of native ETH'),\n },\n },\n async ({ name, symbol, description, creatorTaxBps, pairToken }) => run(async () => {\n const launch = await divy.launch({ name, symbol, description, creatorTaxBps, pairToken: pairToken as `0x${string}` | undefined });\n return { ...launch, explorer: explorerTx(launch.txHash) };\n }),\n);\n\nserver.registerTool(\n 'divy_buy',\n {\n description: 'Buy this agent\\'s launched token on its Pons curve, spending ETH (or the curve\\'s pair token). '\n + 'Sends an approval first when the pair token needs one. Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: { ...curveOrToken, amountEth: z.string().describe('Amount to spend, in ETH (or pair-token units), as a decimal string, e.g. \"0.001\"') },\n },\n async ({ curve, token, amountEth }) => run(async () => {\n const { txHash, amountOut } = await divy.buy({ curve: curve as `0x${string}` | undefined, token: token as `0x${string}` | undefined, amountWei: parseEther(amountEth) });\n return { txHash, amountOut: amountOut.toString(), explorer: explorerTx(txHash) };\n }),\n);\n\nserver.registerTool(\n 'divy_sell',\n {\n description: 'Sell this agent\\'s launched token back into its Pons curve. Sends an approval first. '\n + 'Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: { ...curveOrToken, amountTokens: z.string().describe('Amount of the launched token to sell, as a decimal string (18 decimals), e.g. \"1000\"') },\n },\n async ({ curve, token, amountTokens }) => run(async () => {\n const { txHash, amountOut } = await divy.sell({ curve: curve as `0x${string}` | undefined, token: token as `0x${string}` | undefined, amountTokens: parseUnits(amountTokens, 18) });\n return { txHash, amountOut: amountOut.toString(), explorer: explorerTx(txHash) };\n }),\n);\n\nserver.registerTool(\n 'divy_harvest',\n {\n description: 'Pull this agent\\'s pending fees through its split contract to its payout wallet right now, '\n + 'instead of waiting for Divy\\'s keeper (runs every ~30 minutes). Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: {},\n },\n async () => run(async () => {\n const { txHash } = await divy.harvest();\n return { txHash, explorer: explorerTx(txHash) };\n }),\n);\n\nserver.registerTool(\n 'divy_record',\n {\n description: 'Force the on-chain recordLaunch call for a token this agent launched. Self-custody only '\n + '(DIVY_PRIVATE_KEY) — hosted and read-only launches are recorded automatically by Divy\\'s keeper within about a minute.',\n inputSchema: { token: addressSchema.describe('The launched token address to record') },\n },\n async ({ token }) => run(async () => {\n const { txHash } = await divy.record(token as `0x${string}`);\n return { txHash, explorer: explorerTx(txHash) };\n }),\n);\n\nawait server.connect(new StdioServerTransport());\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAClB,SAAS,YAAY,kBAAkB;AACvC,SAAS,YAAY,WAAW,kBAA0C;AAG1E,IAAM,UAA6B,QAAQ,IAAI,mBAC3C,EAAE,YAAY,QAAQ,IAAI,kBAAmC,QAAQ,QAAQ,IAAI,cAAc,QAAQ,QAA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M,EAAE;AAAA,EAChD,CAAC;AACH;AAEA,MAAM,OAAO,QAAQ,IAAI,qBAAqB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\nimport { parseEther, parseUnits } from 'viem';\nimport { createDivy, DivyError, explorerTx, type CreateDivyOptions } from 'divy-sdk';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport { createRequire } from 'node:module';\n\nconst { version } = createRequire(import.meta.url)('../package.json') as { version: string };\n\nconst options: CreateDivyOptions = process.env.DIVY_PRIVATE_KEY\n ? { privateKey: process.env.DIVY_PRIVATE_KEY as `0x${string}`, rpcUrl: process.env.DIVY_RPC_URL, apiUrl: process.env.DIVY_API_URL }\n : process.env.DIVY_API_KEY\n ? { apiKey: process.env.DIVY_API_KEY, apiUrl: process.env.DIVY_API_URL }\n : { apiUrl: process.env.DIVY_API_URL };\n\nlet divy = createDivy(options);\n\nconst stringify = (value: unknown): string =>\n JSON.stringify(value, (_key, v) => (typeof v === 'bigint' ? v.toString() : v), 2);\n\nasync function run(fn: () => Promise<unknown>): Promise<CallToolResult> {\n try {\n const result = await fn();\n return { content: [{ type: 'text', text: stringify(result) }] };\n } catch (e) {\n if (e instanceof DivyError) {\n return { content: [{ type: 'text', text: `${e.message} (HTTP ${e.status})` }], isError: true };\n }\n const message = e instanceof Error ? e.message : String(e);\n return { content: [{ type: 'text', text: message }], isError: true };\n }\n}\n\nconst addressSchema = z.string().regex(/^0x[0-9a-fA-F]{40}$/, 'must be a 0x-prefixed 20-byte address');\nconst curveOrToken = {\n curve: addressSchema.optional().describe('The Pons curve contract address, if known'),\n token: addressSchema.optional().describe('The launched token address, used to look up its curve if curve is not known'),\n};\n\nconst server = new McpServer({ name: 'divy-mcp', version });\n\nserver.registerTool(\n 'divy_info',\n {\n description: 'Get Divy\\'s chain, contract addresses, fee policy, current launch fee, and indexer status. '\n + 'Call this first to check hostedWallets, launchFee, and maxCreatorTaxBps before launching.',\n inputSchema: {},\n },\n async () => run(() => divy.info()),\n);\n\nserver.registerTool(\n 'divy_leaderboard',\n {\n description: 'List every registered Divy agent ranked by record (graduation rate weighted by holder retention), then fees earned. '\n + 'Use to see who is performing well or to look up an agent\\'s split address.',\n inputSchema: {},\n },\n async () => run(() => divy.leaderboard()),\n);\n\nserver.registerTool(\n 'divy_launches',\n {\n description: 'List the most recent token launches across all Divy agents, newest first.',\n inputSchema: { limit: z.number().int().min(1).max(200).optional().describe('Max rows to return, default 20, max 200') },\n },\n async ({ limit }) => run(() => divy.launches({ limit })),\n);\n\nserver.registerTool(\n 'divy_agent',\n {\n description: 'Get one agent\\'s record: split contract, launches, graduation score, fees earned. '\n + 'Omit address to look up the agent configured for this server (requires a credential).',\n inputSchema: { address: addressSchema.optional().describe('The agent\\'s wallet address; defaults to this server\\'s own agent') },\n },\n async ({ address }) => run(() => divy.agent(address as `0x${string}` | undefined)),\n);\n\nserver.registerTool(\n 'divy_quote',\n {\n description: 'Price a buy or sell on a Pons bonding curve without sending anything. '\n + 'Use before divy_buy/divy_sell to check amountOut and fees, or any time you just want a price.',\n inputSchema: {\n ...curveOrToken,\n side: z.enum(['buy', 'sell']).describe('\"buy\" spends the pair token for the launched token; \"sell\" is the reverse'),\n amount: z.string().describe('Amount to spend (buy) or sell (sell), as an integer string in base units (wei for the pair token, or the launched token\\'s smallest unit)'),\n recipient: addressSchema.optional().describe('Who would receive the trade; affects the snipe-tax quote in the first 3 seconds after launch'),\n },\n },\n async ({ curve, token, side, amount, recipient }) => run(() => divy.quote({\n curve: curve as `0x${string}` | undefined, token: token as `0x${string}` | undefined, side, amount, recipient: recipient as `0x${string}` | undefined,\n })),\n);\n\nserver.registerTool(\n 'divy_create_wallet',\n {\n description: 'Create a hosted wallet for this agent so it can launch without a human wallet. Needs no credential. '\n + 'Returns a one-time apiKey and the wallet address plus how much Robinhood Chain ETH to send it (fund.minEth). '\n + 'This server switches to that wallet immediately, so divy_launch, divy_buy, divy_sell and divy_harvest work in this session. '\n + 'Persist the apiKey and set DIVY_API_KEY to it for future sessions; it is shown once. '\n + 'Skip this if DIVY_PRIVATE_KEY or DIVY_API_KEY is already configured.',\n inputSchema: {\n payout: addressSchema.optional().describe('Wallet that harvested fees are swept to. Defaults to the hosted wallet itself.'),\n label: z.string().max(64).optional().describe('A name for this wallet, for your own bookkeeping'),\n },\n },\n async ({ payout, label }) => run(async () => {\n if (divy.mode !== 'read-only') {\n throw new Error(`this server already has a ${divy.mode} wallet configured; unset DIVY_PRIVATE_KEY / DIVY_API_KEY to create a new one`);\n }\n const created = await divy.createHostedAgent({ payout: payout as `0x${string}` | undefined, label });\n divy = createDivy({ apiKey: created.apiKey, apiUrl: process.env.DIVY_API_URL });\n return created;\n }),\n);\n\nserver.registerTool(\n 'divy_register',\n {\n description: 'Register this agent with Divy so it can launch tokens and earn fees. No-op if already registered. '\n + 'Hosted wallets are registered automatically by their first divy_launch, so this only reports status for them. '\n + 'Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: {},\n },\n async () => run(() => divy.register()),\n);\n\nserver.registerTool(\n 'divy_launch',\n {\n description: 'Launch a new token on Pons through this agent, paying the launch fee from its wallet. '\n + 'Register first with divy_register. Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: {\n name: z.string().min(1).describe('Token name, e.g. \"Halo\"'),\n symbol: z.string().min(1).describe('Token symbol, e.g. \"HALO\"'),\n description: z.string().optional(),\n creatorTaxBps: z.number().int().min(0).optional().describe('Extra creator tax in basis points, up to maxCreatorTaxBps from divy_info; paid to this agent in full'),\n pairToken: addressSchema.optional().describe('An approved ERC20 to pair against instead of native ETH'),\n },\n },\n async ({ name, symbol, description, creatorTaxBps, pairToken }) => run(async () => {\n const launch = await divy.launch({ name, symbol, description, creatorTaxBps, pairToken: pairToken as `0x${string}` | undefined });\n return { ...launch, explorer: explorerTx(launch.txHash) };\n }),\n);\n\nserver.registerTool(\n 'divy_buy',\n {\n description: 'Buy this agent\\'s launched token on its Pons curve, spending ETH (or the curve\\'s pair token). '\n + 'Sends an approval first when the pair token needs one. Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: { ...curveOrToken, amountEth: z.string().describe('Amount to spend, in ETH (or pair-token units), as a decimal string, e.g. \"0.001\"') },\n },\n async ({ curve, token, amountEth }) => run(async () => {\n const { txHash, amountOut } = await divy.buy({ curve: curve as `0x${string}` | undefined, token: token as `0x${string}` | undefined, amountWei: parseEther(amountEth) });\n return { txHash, amountOut: amountOut.toString(), explorer: explorerTx(txHash) };\n }),\n);\n\nserver.registerTool(\n 'divy_sell',\n {\n description: 'Sell this agent\\'s launched token back into its Pons curve. Sends an approval first. '\n + 'Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: { ...curveOrToken, amountTokens: z.string().describe('Amount of the launched token to sell, as a decimal string (18 decimals), e.g. \"1000\"') },\n },\n async ({ curve, token, amountTokens }) => run(async () => {\n const { txHash, amountOut } = await divy.sell({ curve: curve as `0x${string}` | undefined, token: token as `0x${string}` | undefined, amountTokens: parseUnits(amountTokens, 18) });\n return { txHash, amountOut: amountOut.toString(), explorer: explorerTx(txHash) };\n }),\n);\n\nserver.registerTool(\n 'divy_harvest',\n {\n description: 'Pull this agent\\'s pending fees through its split contract to its payout wallet right now, '\n + 'instead of waiting for Divy\\'s keeper (runs every ~30 minutes). Requires DIVY_PRIVATE_KEY or DIVY_API_KEY, or a wallet from divy_create_wallet.',\n inputSchema: {},\n },\n async () => run(async () => {\n const { txHash } = await divy.harvest();\n return { txHash, explorer: explorerTx(txHash) };\n }),\n);\n\nserver.registerTool(\n 'divy_record',\n {\n description: 'Force the on-chain recordLaunch call for a token this agent launched. Self-custody only '\n + '(DIVY_PRIVATE_KEY) — hosted and read-only launches are recorded automatically by Divy\\'s keeper within about a minute.',\n inputSchema: { token: addressSchema.describe('The launched token address to record') },\n },\n async ({ token }) => run(async () => {\n const { txHash } = await divy.record(token as `0x${string}`);\n return { txHash, explorer: explorerTx(txHash) };\n }),\n);\n\nawait server.connect(new StdioServerTransport());\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAClB,SAAS,YAAY,kBAAkB;AACvC,SAAS,YAAY,WAAW,kBAA0C;AAE1E,SAAS,qBAAqB;AAE9B,IAAM,EAAE,QAAQ,IAAI,cAAc,YAAY,GAAG,EAAE,iBAAiB;AAEpE,IAAM,UAA6B,QAAQ,IAAI,mBAC3C,EAAE,YAAY,QAAQ,IAAI,kBAAmC,QAAQ,QAAQ,IAAI,cAAc,QAAQ,QAAQ,IAAI,aAAa,IAChI,QAAQ,IAAI,eACV,EAAE,QAAQ,QAAQ,IAAI,cAAc,QAAQ,QAAQ,IAAI,aAAa,IACrE,EAAE,QAAQ,QAAQ,IAAI,aAAa;AAEzC,IAAI,OAAO,WAAW,OAAO;AAE7B,IAAM,YAAY,CAAC,UACjB,KAAK,UAAU,OAAO,CAAC,MAAM,MAAO,OAAO,MAAM,WAAW,EAAE,SAAS,IAAI,GAAI,CAAC;AAElF,eAAe,IAAI,IAAqD;AACtE,MAAI;AACF,UAAM,SAAS,MAAM,GAAG;AACxB,WAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,UAAU,MAAM,EAAE,CAAC,EAAE;AAAA,EAChE,SAAS,GAAG;AACV,QAAI,aAAa,WAAW;AAC1B,aAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,GAAG,EAAE,OAAO,UAAU,EAAE,MAAM,IAAI,CAAC,GAAG,SAAS,KAAK;AAAA,IAC/F;AACA,UAAM,UAAU,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;AACzD,WA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U,WAAW,MAAM,EAAE;AAAA,EACjF,CAAC;AACH;AAEA,OAAO;AAAA,EACL;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IAEb,aAAa,CAAC;AAAA,EAChB;AAAA,EACA,YAAY,IAAI,YAAY;AAC1B,UAAM,EAAE,OAAO,IAAI,MAAM,KAAK,QAAQ;AACtC,WAAO,EAAE,QAAQ,UAAU,WAAW,MAAM,EAAE;AAAA,EAChD,CAAC;AACH;AAEA,OAAO;AAAA,EACL;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IAEb,aAAa,EAAE,OAAO,cAAc,SAAS,sCAAsC,EAAE;AAAA,EACvF;AAAA,EACA,OAAO,EAAE,MAAM,MAAM,IAAI,YAAY;AACnC,UAAM,EAAE,OAAO,IAAI,MAAM,KAAK,OAAO,KAAsB;AAC3D,WAAO,EAAE,QAAQ,UAAU,WAAW,MAAM,EAAE;AAAA,EAChD,CAAC;AACH;AAEA,MAAM,OAAO,QAAQ,IAAI,qBAAqB,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "divy-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "MCP server for Divy: register agents, launch tokens on Pons, trade, and harvest fees on Robinhood Chain, from any MCP client.",
5
5
  "license": "MIT",
6
6
  "type": "module",