@cloakely/mcp 0.4.0 → 0.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.
package/dist/server.d.ts CHANGED
@@ -3,7 +3,7 @@ import { type Prover } from "@cloakely/sdk";
3
3
  import type { Settings } from "./config.js";
4
4
  export { loadSettings, type Settings, type Limits } from "./config.js";
5
5
  export { Spending } from "./limits.js";
6
- export declare const VERSION = "0.4.0";
6
+ export declare const VERSION = "0.6.0";
7
7
  export declare const HOSTED_URL = "https://cloak.boblabs.tech/mcp";
8
8
  /** Turn an SDK or chain error into one plain sentence an agent can act on. */
9
9
  export declare function explain(e: unknown): string;
package/dist/server.js CHANGED
@@ -4,11 +4,11 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
4
  import { z } from "zod";
5
5
  import { createPublicClient, createWalletClient, erc20Abi, formatEther, formatUnits, http, isAddress, parseEther, parseUnits, zeroAddress, } from "viem";
6
6
  import { privateKeyToAccount } from "viem/accounts";
7
- import { Cloak, CloakPrivate, cloakAuctionAbi, cloakPairAbi, cloakVaultsAbi, createProver, loadProver, privateRouterAbi, relayerSubmitter, shieldedPoolAbi, } from "@cloakely/sdk";
7
+ import { Cloak, CloakPrivate, cloakAuctionAbi, cloakPairAbi, cloakVaultsAbi, legacyFactories, createProver, loadProver, privateRouterAbi, relayerSubmitter, shieldedPoolAbi, } from "@cloakely/sdk";
8
8
  import { Spending } from "./limits.js";
9
9
  export { loadSettings } from "./config.js";
10
10
  export { Spending } from "./limits.js";
11
- export const VERSION = "0.4.0";
11
+ export const VERSION = "0.6.0";
12
12
  export const HOSTED_URL = "https://cloak.boblabs.tech/mcp";
13
13
  const INSTRUCTIONS = `Cloak: sealed-bid token launches and private trading on Kinetiq's Elysium (HYPE is the gas and base currency).
14
14
 
@@ -79,10 +79,11 @@ export function createCloakServer(settings, opts = {}) {
79
79
  const account = settings.privateKey ? privateKeyToAccount(settings.privateKey) : undefined;
80
80
  const wallet = account ? createWalletClient({ chain: settings.chain, transport: http(settings.rpcUrl), account }) : undefined;
81
81
  // earlier deployments' launches still list, settle and pay out
82
- const cloak = new Cloak(pub, wallet, d.factory, (d.previous ?? []).map((p) => p.factory));
83
- /** Where to start scanning a launch's bids: the current factory's deploy block, or the start for an older launch. */
84
- const bidsFrom = async (auction) => (await pub.readContract({ address: auction, abi: [{ type: "function", name: "factory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] }], functionName: "factory" }).catch(() => zeroAddress)).toLowerCase() === d.factory.toLowerCase()
85
- ? settings.launchesFromBlock
82
+ const cloak = new Cloak(pub, wallet, d.factory, legacyFactories(d));
83
+ /** Where to start scanning a launch's bids: this deployment's first factory block, or the start for an older launch. */
84
+ const ours = new Set([d.factory, ...(d.earlierFactories ?? [])].map((f) => f.toLowerCase()));
85
+ const bidsFrom = async (auction) => ours.has((await pub.readContract({ address: auction, abi: [{ type: "function", name: "factory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] }], functionName: "factory" }).catch(() => zeroAddress)).toLowerCase())
86
+ ? (d.firstFactoryBlock !== undefined && d.firstFactoryBlock < settings.launchesFromBlock ? d.firstFactoryBlock : settings.launchesFromBlock)
86
87
  : 0n;
87
88
  const spending = account ? new Spending(settings.limits, settings.stateDir, account.address) : undefined;
88
89
  const submit = relayerSubmitter(d.relayerUrl);
@@ -226,7 +227,7 @@ export function createCloakServer(settings, opts = {}) {
226
227
  ...(s.settled
227
228
  ? { clearingPrice: `${formatEther(s.clearingPrice)} HYPE per token`, sold: formatEther(s.sold), raised: hype(s.raised), pool: s.pair }
228
229
  : {}),
229
- liquidity: `${s.lpBps / 100}% of the raise seeds the pool at the clearing price; LP ${s.lpLockUntil === 0 ? "burned" : `locked until ${iso(s.lpLockUntil)}`}`,
230
+ liquidity: `${s.lpBps / 100}% of the raise seeds the pool at the clearing price; LP ${s.lpLockUntil === 0 ? "burned" : s.creatorFees || s.lpLockUntil >= 2 ** 63 ? "locked forever, trading fees to the creator" : `locked until ${iso(s.lpLockUntil)}`}`,
230
231
  noRevealPenalty: `${s.noRevealPenaltyBps / 100}%`,
231
232
  launchFee: `${s.launchFeeBps / 100}% of a successful raise`,
232
233
  caps: { perBid: s.bidCap ? hype(s.bidCap) : "none", total: s.depositCap ? hype(s.depositCap) : "none" },
@@ -385,7 +386,7 @@ export function createCloakServer(settings, opts = {}) {
385
386
  ifCreatedNow: { biddingEnds: iso(commitEnd), revealsEnd: iso(revealEnd) },
386
387
  priceRange: `${formatEther(min)} to ${formatEther(top)} HYPE per token, ${ticks} ticks`,
387
388
  raiseIfFullySold: { atLowestPrice: hype(raise(min)), atHighestPrice: hype(raise(top)) },
388
- toPool: `${lp}% of the raise, paired with tokens at the clearing price; the LP is burned unless you lock it`,
389
+ toPool: `${lp}% of the raise, paired with tokens at the clearing price in a Uniswap V2 pool; the LP is locked forever and its 0.3% trading fees go to you (or burned, or locked for a set time)`,
389
390
  launchFee: "1.5% of a successful raise; nothing if the launch doesn't fill",
390
391
  caps: "During the beta a bid can be at most 100 HYPE and an auction can take at most 10,000 HYPE.",
391
392
  create: { onTheSite: "https://cloak.boblabs.tech/app/create", withAnAgent: "the local server's create_launch tool (see connect_full_agent)" },
@@ -419,7 +420,8 @@ export function createCloakServer(settings, opts = {}) {
419
420
  reveal_minutes: z.number().min(1).max(60 * 24).optional().describe("Time for bids to open after bidding closes (default 10)"),
420
421
  lp_percent: z.number().min(0).max(100).optional().describe("Share of the raise that seeds the pool (default 50)"),
421
422
  lp_tokens: amt("Tokens paired with that HYPE (default: same as sale_supply)").optional(),
422
- lp_lock_days: z.number().min(0).optional().describe("Lock the LP for this many days instead of burning it (default: burn)"),
423
+ lp_lock_days: z.number().min(0).optional().describe("Lock the LP for this many days, after which the creator can take it (overrides creator_fees)"),
424
+ creator_fees: z.boolean().optional().describe("Lock the LP forever and pay the pool's 0.3% trading fees to the creator (default true; false burns the LP)"),
423
425
  creator_share: amt("Tokens for the creator, at most 20% of supply, vesting linearly").optional(),
424
426
  vest_days: z.number().min(30).optional().describe("Vesting length for the creator share (default 90)"),
425
427
  metadata_uri: z.string().optional(),
@@ -444,7 +446,7 @@ export function createCloakServer(settings, opts = {}) {
444
446
  commitEnd,
445
447
  revealEnd,
446
448
  lpBps: Math.round((p.lp_percent ?? 50) * 100),
447
- lpLockUntil: p.lp_lock_days ? now + Math.round(p.lp_lock_days * 86400) : "burn",
449
+ lpLockUntil: p.lp_lock_days ? revealEnd + Math.round(p.lp_lock_days * 86400) : p.creator_fees === false ? "burn" : "fees",
448
450
  metadataURI: p.metadata_uri,
449
451
  };
450
452
  spending.check("launches", 1n);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloakely/mcp",
3
3
  "mcpName": "io.github.NECOKIZZ/cloak",
4
- "version": "0.4.0",
4
+ "version": "0.6.0",
5
5
  "description": "Cloak's MCP server: let an AI agent launch tokens with sealed bids and trade them privately on Elysium, with spending limits, testnet by default and a local signer.",
6
6
  "keywords": [
7
7
  "mcp",
@@ -47,7 +47,7 @@
47
47
  "@modelcontextprotocol/sdk": "1.32.1",
48
48
  "viem": "2.21.54",
49
49
  "zod": "4.6.7",
50
- "@cloakely/sdk": "^0.4.0"
50
+ "@cloakely/sdk": "^0.6.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "22.10.2",