@cloakely/mcp 0.8.2 → 0.8.4

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.8.2";
6
+ export declare const VERSION = "0.8.4";
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, legacyFactories, createProver, loadProver, createSharedProver, loadSharedProver, privateRouterAbi, relayerSubmitter, sharedRelayerSubmitter, sharedVaultAbi, SharedVaultClient, shieldedPoolAbi, buildClaimLink, buildRequestLink, linkAddress, linkCheck, linkKeys, openLinkKeys, newLinkSecret, parseClaimLink, parseRequestLink, LINK_SHARES_MAX, CloakDrops, CloakSpots, } from "@cloakely/sdk";
7
+ import { Cloak, CloakPrivate, cloakAuctionAbi, cloakPairAbi, cloakVaultsAbi, legacyFactories, createProver, loadProver, createSharedProver, loadSharedProver, privateRouterAbi, relayerSubmitter, sharedRelayerSubmitter, sharedVaultAbi, SharedVaultClient, shieldedPoolAbi, buildClaimLink, buildRequestLink, linkAddress, linkCheck, linkKeys, openLinkKeys, newLinkSecret, parseClaimLink, parseRequestLink, LINK_SHARES_MAX, CloakDrops, CloakSpots, resolveRecipient, CIRCUITS_CDN, } 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.8.2";
11
+ export const VERSION = "0.8.4";
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
 
@@ -97,11 +97,11 @@ export function createCloakServer(settings, opts = {}) {
97
97
  const prover = opts.prover ??
98
98
  (() => (proverP ??= settings.circuitsDir
99
99
  ? Promise.resolve(createProver(readFileSync(join(settings.circuitsDir, "transaction2x2.wasm")), readFileSync(join(settings.circuitsDir, "transaction2x2_final.zkey"))))
100
- : loadProver(d.circuitsUrl)));
100
+ : loadProver([CIRCUITS_CDN, d.circuitsUrl])));
101
101
  let sharedProverP;
102
102
  const sharedProver = () => (sharedProverP ??= settings.circuitsDir
103
103
  ? Promise.resolve(createSharedProver(readFileSync(join(settings.circuitsDir, "transactionMA2x2.wasm")), readFileSync(join(settings.circuitsDir, "transactionMA2x2_final.zkey"))))
104
- : loadSharedProver(d.circuitsUrl));
104
+ : loadSharedProver([CIRCUITS_CDN, d.circuitsUrl]));
105
105
  let sharedC;
106
106
  /** The shared launch-token vault (new Uniswap launches keep their private balances there). */
107
107
  async function shared() {
@@ -399,7 +399,7 @@ export function createCloakServer(settings, opts = {}) {
399
399
  const dropsFor = (w) => {
400
400
  if (!d.dropFactory)
401
401
  throw new Error("NFT drops aren't deployed on this network yet.");
402
- return new CloakDrops(pub, w, d.dropFactory, d.dropFactoryBlock ?? 0n);
402
+ return new CloakDrops(pub, w, d.dropFactory, d.dropFactoryBlock ?? 0n, d.escrowDropFactory);
403
403
  };
404
404
  const spotsFor = (w) => (d.spotBook ? new CloakSpots(dropsFor(w), d.spotBook) : null);
405
405
  const dropPhase = (s) => (s.failed ? "ended with no sale (every bid refunded)" : s.phase === "gtd" ? "gtd (guaranteed list minting; bidding opens after)" : s.phase === "settle" || s.phase === "numbering" ? "settling" : s.phase);
@@ -410,7 +410,8 @@ export function createCloakServer(settings, opts = {}) {
410
410
  drop: s.address,
411
411
  name: s.name,
412
412
  symbol: s.symbol,
413
- kind: sale ? `WL spot sale for ${sale.partner}` : "NFT drop",
413
+ kind: sale ? `WL spot sale for ${sale.partner}` : s.escrow ? "auction of existing NFTs" : "NFT drop",
414
+ ...(s.escrow ? { collection: s.escrow.collection, tokenIds: s.escrow.tokenIds.map(String), heldInEscrow: `${s.escrow.held} of ${s.supply}` } : {}),
414
415
  phase: dropPhase(s),
415
416
  ...(s.phase === "gtd" ? { biddingOpens: iso(s.gtdEnd) } : {}),
416
417
  biddingEnds: iso(s.commitEnd),
@@ -456,7 +457,7 @@ export function createCloakServer(settings, opts = {}) {
456
457
  }));
457
458
  server.registerTool("get_drop", {
458
459
  title: "Drop details",
459
- description: "One NFT drop or WL spot sale: phase, timing, floor, WL boost, results once settled, whether a wallet is on its GTD list or WL, and for a spot sale the whitelist so far.",
460
+ description: "One NFT drop, WL spot sale or auction of existing NFTs: phase, timing, floor, WL boost, results once settled, whether a wallet is on its GTD list or WL, and for a spot sale the whitelist so far.",
460
461
  inputSchema: { drop: addr, wallet: addr.optional().describe("A wallet to check against the drop's GTD list and WL") },
461
462
  annotations: READ,
462
463
  }, safe(async ({ drop, wallet: w }) => {
@@ -834,13 +835,14 @@ export function createCloakServer(settings, opts = {}) {
834
835
  }));
835
836
  server.registerTool("withdraw", {
836
837
  title: "Withdraw to an address",
837
- description: "Move funds from the private balance to a normal 0x address (public on purpose). A brand-new address keeps the most privacy. Cloak keeps 0.25%, and the relayer takes a small fee for gas.",
838
- inputSchema: { asset: z.string().describe('"HYPE", "USDC" or a launch token'), to: addr, amount: amt('Amount, or "max"'), dry_run: dry },
838
+ description: "Move funds from the private balance to a normal 0x address or .ely name (public on purpose). A brand-new address keeps the most privacy. Cloak keeps 0.25%, and the relayer takes a small fee for gas.",
839
+ inputSchema: { asset: z.string().describe('"HYPE", "USDC" or a launch token'), to: z.string().describe("0x address or a .ely name (looked up when sending)"), amount: amt('Amount, or "max"'), dry_run: dry },
839
840
  annotations: WRITE,
840
841
  }, safe(async ({ asset, to, amount, dry_run }) => {
841
842
  const { spending } = needWallet();
842
- if (!isAddress(to))
843
- throw new Error("`to` must be a 0x address.");
843
+ const dest = await resolveRecipient(pub, to); // a .ely name resolves now: names expire and change hands
844
+ const named = dest.name ? `${dest.name} (${dest.address})` : dest.address;
845
+ to = dest.address;
844
846
  const a = await resolve(asset);
845
847
  const p = await priv();
846
848
  const kind = a.kind === "hype" ? "unshieldHype" : "transact";
@@ -852,12 +854,12 @@ export function createCloakServer(settings, opts = {}) {
852
854
  spending.check(c.budget, c.value);
853
855
  const arrives = await pub.readContract({ address: a.pool, abi: shieldedPoolAbi, functionName: "afterFee", args: [x] });
854
856
  if (isDry(dry_run))
855
- return { dryRun: true, wouldWithdraw: fmtAmt(a, x), arrives: fmtAmt(a, arrives), to };
857
+ return { dryRun: true, wouldWithdraw: fmtAmt(a, x), arrives: fmtAmt(a, arrives), to: named };
856
858
  return exclusive(async () => {
857
859
  const h = a.kind === "hype" ? await p.unshieldHype(to, x) : sharedTok ? await (await shared()).unshield(a.token, x, to) : await p.unshieldToken(a.token, to, x);
858
860
  await receipt(h);
859
861
  spending.record(c.budget, c.value);
860
- return { withdrew: fmtAmt(a, x), arrived: fmtAmt(a, arrives), to, privateBalance: fmtAmt(a, await balanceOf(a)), tx: link(h) };
862
+ return { withdrew: fmtAmt(a, x), arrived: fmtAmt(a, arrives), to: named, privateBalance: fmtAmt(a, await balanceOf(a)), tx: link(h) };
861
863
  });
862
864
  }));
863
865
  // ───────────── payment links ─────────────
@@ -967,13 +969,13 @@ export function createCloakServer(settings, opts = {}) {
967
969
  server.registerTool("claim_payment_link", {
968
970
  title: "Claim a payment link",
969
971
  description: "Claim the money in a claim link: into this account's private balance (default), or out to any 0x address. Also how a sender takes back a link nobody claimed. The relayer submits it and takes its fee from the link, so no gas is needed. On a link split into shares, it claims one share.",
970
- inputSchema: { link: z.string().describe("The claim link"), passcode: z.string().optional(), to: z.string().optional().describe('"private" (default) or a 0x address'), dry_run: dry },
972
+ inputSchema: { link: z.string().describe("The claim link"), passcode: z.string().optional(), to: z.string().optional().describe('"private" (default), a 0x address or a .ely name'), dry_run: dry },
971
973
  annotations: WRITE,
972
974
  }, safe(async ({ link: url, passcode, to, dry_run }) => {
973
975
  const { l, c } = await linkClient(url, passcode);
974
976
  const out = to && to !== "private";
975
- if (out && !isAddress(to))
976
- throw new Error('`to` must be "private" or a 0x address.');
977
+ if (out)
978
+ to = (await resolveRecipient(pub, to)).address; // a 0x address, or a .ely name resolved now
977
979
  const held = [];
978
980
  let spent = 0;
979
981
  for (const sym of ["HYPE", "USDC"]) {
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.8.2",
4
+ "version": "0.8.4",
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.8.2"
50
+ "@cloakely/sdk": "^0.8.4"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "22.10.2",