Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs(packages): replace invented endpoints and params in MCP and SDK examples with real ones
nirholas0f9511f5706e
diff --git a/packages/audio-mcp/README.md b/packages/audio-mcp/README.mdindex fcb7b5670..a924750f2 100644--- a/packages/audio-mcp/README.md+++ b/packages/audio-mcp/README.md@@ -87,14 +87,14 @@ All five tools are read-only: they transform input (synthesize/recognize/animate```jsonc// text_to_speech-> { "text": "Hello — I'm your three.ws agent.", "voice": "nova" }+> { "text": "Hello, I'm your three.ws agent.", "voice": "nova" }{"ok": true,- "voice": "Magpie-Nova",+ "voice": "Magpie-Multilingual.EN-US.Aria","model": "magpie-tts-multilingual","format": "wav","mime": "audio/wav",- "sizeBytes": 84210,+ "sizeBytes": 274476,"audio": "data:audio/wav;base64,UklGR…"}```diff --git a/packages/notifications-mcp/README.md b/packages/notifications-mcp/README.mdindex 31405d559..713587eee 100644--- a/packages/notifications-mcp/README.md+++ b/packages/notifications-mcp/README.md@@ -189,7 +189,7 @@ Read the resolved delivery matrix — for each category, which channels deliver}```-The six categories are `sales`, `purchases`, `social`, `irl`, `alerts`, `account`; the four channels are `in_app`, `push`, `email`, `telegram`. `prefs.categories` is the effective matrix with the user's sparse overrides already merged onto platform defaults.+The seven categories are `sales`, `purchases`, `social`, `irl`, `alerts`, `creations`, `account`; the four channels are `in_app`, `push`, `email`, `telegram`. `prefs.categories` is the effective matrix with the user's sparse overrides already merged onto platform defaults. A category may also carry `lockedChannels`: `account` locks `in_app` on, so security and withdrawal notices always reach the bell inbox.### `set_preferences`@@ -197,7 +197,7 @@ Patch the delivery matrix. Wraps `PUT /api/notifications/preferences`. Provide a| Arg | Type | Required | Notes ||---|---|---|---|-| `categories` | `object` | at least one | Outer keys: `sales`, `purchases`, `social`, `irl`, `alerts`, `account`. Inner keys: `in_app`, `push`, `email`, `telegram` → boolean. |+| `categories` | `object` | at least one | Outer keys: `sales`, `purchases`, `social`, `irl`, `alerts`, `creations`, `account`. Inner keys: `in_app`, `push`, `email`, `telegram` → boolean. `account`'s `in_app` is locked on and a `false` for it is ignored. || `telegram_chat_id` | `string` | at least one | Numeric Telegram chat id to deliver the `telegram` channel to, or `""` to unlink. ≤ 24 chars. |```jsonc@@ -297,7 +297,7 @@ Reads are always safe to retry. The writes are idempotent by design (`mark_read`- Homepage: https://three.ws- Changelog: https://three.ws/changelog- Issues: https://github.com/nirholas/three.ws/issues-- License: Apache-2.0 — see [LICENSE](./LICENSE)+- License: proprietary, all rights reserved. See [LICENSE](./LICENSE).---diff --git a/packages/notifications-mcp/src/lib/api.js b/packages/notifications-mcp/src/lib/api.jsindex db5876c11..f08b38f87 100644--- a/packages/notifications-mcp/src/lib/api.js+++ b/packages/notifications-mcp/src/lib/api.js@@ -1,4 +1,4 @@-// Real HTTP access to the three.ws autopilot API. No mocks, no fixtures — every+// Real HTTP access to the three.ws notifications API. No mocks, no fixtures: every// call is a live, authenticated request to THREE_WS_BASE. The agent's Bearer// credential is attached here (single HTTP client, single auth path); errors are// normalized into one shape so tool handlers can surface a clean message +@@ -6,14 +6,14 @@import { THREE_WS_BASE, HTTP_TIMEOUT_MS, USER_AGENT, THREE_WS_API_KEY } from '../config.js';-// Thrown before any request when the server has no credential. Every autopilot-// route is owner-only, so a missing key is a config error, not an upstream 401.+// Thrown before any request when the server has no credential. Every notification+// route is account-scoped, so a missing key is a config error, not an upstream 401.export class MissingCredentialError extends Error {constructor() {super('No three.ws credential configured. Set THREE_WS_API_KEY to a three.ws API key ' +- '(sk_live_… / sk_test_…) or OAuth access token for the agent owner — every autopilot ' +- 'endpoint is owner-scoped and rejects unauthenticated requests.',+ '(sk_live_… / sk_test_…) or OAuth access token for the account owner. Every notification ' ++ 'endpoint is account-scoped and rejects unauthenticated requests.',);this.code = 'missing_credential';this.status = 401;@@ -21,11 +21,11 @@ export class MissingCredentialError extends Error {}/**- * Call a three.ws autopilot endpoint and return its parsed JSON body. The+ * Call a three.ws notifications endpoint and return its parsed JSON body. The* Authorization: Bearer header is added here from THREE_WS_API_KEY. Bearer auth* is exempt from CSRF server-side, so writes work without a CSRF token.*- * @param {string} path Endpoint path beginning with `/` (e.g. `/api/autopilot/config`).+ * @param {string} path Endpoint path beginning with `/` (e.g. `/api/notifications`).* @param {{ method?: string, query?: Record<string, unknown>, body?: unknown }} [opts]* @returns {Promise<any>} Parsed JSON response.* @throws {MissingCredentialError} when no credential is configured.diff --git a/packages/provenance-mcp/README.md b/packages/provenance-mcp/README.mdindex 264de3b9d..90c74ffc3 100644--- a/packages/provenance-mcp/README.md+++ b/packages/provenance-mcp/README.md@@ -75,11 +75,11 @@ THREE_WS_TOKEN=sk_live_… npx -y @modelcontextprotocol/inspector npx @three-ws/### Input parameters-**`list_agent_actions`** — `agent_id` (required), `limit` (1–200, default 50), `cursor` (numeric, from a previous `next_cursor`).+**`list_agent_actions`**: `agent_id` (required, the agent identity's uuid), `limit` (1 to 200, default 50), `cursor` (numeric, from a previous `next_cursor`).-**`query_action`** — `agent_id` (required), `id` (required, numeric action id).+**`query_action`**: `agent_id` (required, the agent identity's uuid), `id` (required, numeric action id).-**`append_agent_action`** — `agent_id` (required), `type` (required, ≤64 chars), `payload` (object, optional), `source_skill` (optional), `signer_key` (optional 0x EVM key, overrides `THREE_WS_SIGNER_KEY` for this call).+**`append_agent_action`**: `agent_id` (required, the agent identity's uuid), `type` (required, ≤64 chars), `payload` (object, optional), `source_skill` (optional), `signer_key` (optional 0x EVM key, overrides `THREE_WS_SIGNER_KEY` for this call).## How signing & verification work@@ -97,12 +97,12 @@ This is the same primitive three.ws uses server-side for its Portable & Verifiab```jsonc// append_agent_action-> { "agent_id": "agent_42", "type": "launch", "payload": { "mint": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump", "name": "$THREE" }, "source_skill": "pump-launch" }+> { "agent_id": "6a7d0f2c-1b3e-4a55-9c88-2d41b0f7e913", "type": "launch", "payload": { "mint": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump", "name": "$THREE" }, "source_skill": "pump-launch" }{"ok": true,"action": {"id": "10482",- "agent_id": "agent_42",+ "agent_id": "6a7d0f2c-1b3e-4a55-9c88-2d41b0f7e913","type": "launch","payload": { "mint": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump", "name": "$THREE" },"source_skill": "pump-launch",@@ -116,7 +116,7 @@ This is the same primitive three.ws uses server-side for its Portable & Verifiab```jsonc// query_action → verify it independently-> { "agent_id": "agent_42", "id": "10482" }+> { "agent_id": "6a7d0f2c-1b3e-4a55-9c88-2d41b0f7e913", "id": "10482" }{"ok": true,"action": { "id": "10482", "type": "launch", "signature": "0x…", "signer_address": "0xAbC…", /* … */ },@@ -144,7 +144,7 @@ This is the same primitive three.ws uses server-side for its Portable & Verifiab- Homepage: https://three.ws- Changelog: https://three.ws/changelog- Issues: https://github.com/nirholas/three.ws/issues-- License: Apache-2.0 — see [LICENSE](./LICENSE)+- License: proprietary, all rights reserved. See [LICENSE](./LICENSE).---diff --git a/packages/provenance-mcp/src/tools/append-agent-action.js b/packages/provenance-mcp/src/tools/append-agent-action.jsindex cf174f3cf..532c8fc8a 100644--- a/packages/provenance-mcp/src/tools/append-agent-action.js+++ b/packages/provenance-mcp/src/tools/append-agent-action.js@@ -28,7 +28,7 @@ export const def = {agent_id: z.string().min(1)- .describe('The agent identity id to record the action under. Your token must own it.'),+ .describe('The agent identity uuid to record the action under. Your token must own it.'),type: z.string().min(1)diff --git a/packages/provenance-mcp/src/tools/list-agent-actions.js b/packages/provenance-mcp/src/tools/list-agent-actions.jsindex 86c7b1131..a47326fb5 100644--- a/packages/provenance-mcp/src/tools/list-agent-actions.js+++ b/packages/provenance-mcp/src/tools/list-agent-actions.js@@ -21,7 +21,7 @@ export const def = {agent_id: z.string().min(1)- .describe('The agent identity id whose provenance trail to read. Your token must own it.'),+ .describe('The agent identity uuid whose provenance trail to read. Your token must own it.'),limit: z.number().int()diff --git a/packages/provenance-mcp/src/tools/query-action.js b/packages/provenance-mcp/src/tools/query-action.jsindex 6ea5e4c70..057f26018 100644--- a/packages/provenance-mcp/src/tools/query-action.js+++ b/packages/provenance-mcp/src/tools/query-action.js@@ -21,7 +21,7 @@ export const def = {agent_id: z.string().min(1)- .describe('The agent identity id that owns the action. Your token must own this agent.'),+ .describe('The agent identity uuid that owns the action. Your token must own this agent.'),id: z.string().regex(/^\d+$/)diff --git a/packages/threews-avatar-mcp/README.md b/packages/threews-avatar-mcp/README.mdindex 401a76230..93d35688b 100644--- a/packages/threews-avatar-mcp/README.md+++ b/packages/threews-avatar-mcp/README.md@@ -76,7 +76,11 @@ npx -y @modelcontextprotocol/inspector npx -y @three-ws/avatar-mcpOnce connected, ask your client in plain language:-> Render the avatar for @nirholas in the chat, dark background, auto-rotating.+> Render avatar bf58f7fc-64b3-4a92-8c27-dd472fc04b58 in the chat, dark background, auto-rotating.++(That UUID is a real public avatar. Any avatar's id is the last path segment of+its three.ws URL, and `GET https://three.ws/api/avatars/public` lists more. A+`@handle` works too, for any three.ws user who has published a public avatar.)`render_avatar` returns three things so it looks great in every client:@@ -86,7 +90,7 @@ Once connected, ask your client in plain language:## Tools-All three tools are free, read-only, and annotated (`readOnlyHint`, `idempotentHint`, `openWorldHint`) so hosts can run them without confirmation prompts. There is no x402 charge. Identify an avatar by **`id`** (UUID), **`handle`** (`nirholas` or `@nirholas`), or a raw **`model`** GLB URL.+All three tools are free, read-only, and annotated (`readOnlyHint`, `idempotentHint`, `openWorldHint`) so hosts can run them without confirmation prompts. There is no x402 charge. Identify an avatar by **`id`** (UUID), **`handle`** (a three.ws username, with or without the `@`, that has a public avatar), or a raw **`model`** GLB URL.| Tool | Selectors | What it does || ------------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |@@ -102,13 +106,26 @@ All three tools are free, read-only, and annotated (`readOnlyHint`, `idempotentH```jsonc// render_avatar — live, rotatable avatar in chat-{ "handle": "nirholas", "background": "dark", "auto_rotate": true }+{ "id": "bf58f7fc-64b3-4a92-8c27-dd472fc04b58", "background": "dark", "auto_rotate": true }// avatar_embed_code — paste into any website-{ "id": "c3d4e5f6-a7b8-9c0d-1e2f-3a4b5c6d7e8f", "height": 560 }+{ "id": "bf58f7fc-64b3-4a92-8c27-dd472fc04b58", "height": 560 }++// get_avatar: metadata, by @handle instead of id+{ "handle": "@your-handle" }+```++`get_avatar` on that id returns, live:-// get_avatar — metadata-{ "handle": "@nirholas" }+```json+{+ "id": "bf58f7fc-64b3-4a92-8c27-dd472fc04b58",+ "name": "Jade",+ "slug": "jade-fe1a51",+ "model_url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/u/299bdfa7-d848-4865-bdb1-0db23fc3b431/jade-fe1a51.glb",+ "thumbnail": null,+ "visibility": "public"+}```Every tool also advertises an `outputSchema` describing its `structuredContent`, so typed clients can consume results without re-parsing the text blocks.diff --git a/packages/threews-avatar-mcp/app/build.mjs b/packages/threews-avatar-mcp/app/build.mjsindex 81b4161ac..3dc9e4c59 100644--- a/packages/threews-avatar-mcp/app/build.mjs+++ b/packages/threews-avatar-mcp/app/build.mjs@@ -52,9 +52,11 @@ const html = `<!doctype html><model-viewer id="viewer"camera-controlsauto-rotate- shadow-intensity="1"- exposure="1"+ shadow-intensity="1.0"+ shadow-softness="0.9"+ exposure="1.5"tone-mapping="aces"+ environment-image="neutral"camera-orbit="0deg 80deg 2m"ar ar-modes="webxr scene-viewer quick-look"alt="three.ws avatar"></model-viewer>diff --git a/packages/threews-avatar-mcp/src/avatar-app.html b/packages/threews-avatar-mcp/src/avatar-app.htmlindex c9c440d4f..1377a8cc5 100644--- a/packages/threews-avatar-mcp/src/avatar-app.html+++ b/packages/threews-avatar-mcp/src/avatar-app.html@@ -31,7 +31,7 @@<div id="name"></div><div id="status">Loading avatar…</div></div>-<script>"use strict";(()=>{var Uc=Object.defineProperty;var od=(t,r,n)=>r in t?Uc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n;var Pe=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,n)=>(typeof require<"u"?require:r)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var k=(t,r)=>()=>(t&&(r=t(t=0)),r);var $e=(t,r)=>{for(var n in r)Uc(t,n,{get:r[n],enumerable:!0})};var A=(t,r,n)=>od(t,typeof r!="symbol"?r+"":r,n);function u(t,r,n){function i(c,d){var h;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(h=c._zod).traits??(h.traits=new Set),c._zod.traits.add(t),r(c,d);for(let g in a.prototype)g in c||Object.defineProperty(c,g,{value:a.prototype[g].bind(c)});c._zod.constr=a,c._zod.def=d}let e=n?.Parent??Object;class o extends e{}Object.defineProperty(o,"name",{value:t});function a(c){var d;let h=n?.Parent?new o:this;i(h,c),(d=h._zod).deferred??(d.deferred=[]);for(let g of h._zod.deferred)g();return h}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}function B(t){return t&&Object.assign(zt,t),zt}var br,_r,de,zt,Le=k(()=>{br=Object.freeze({status:"aborted"});_r=Symbol("zod_brand"),de=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},zt={}});var y={};$e(y,{BIGINT_FORMAT_RANGES:()=>Po,Class:()=>$o,NUMBER_FORMAT_RANGES:()=>jo,aborted:()=>Oe,allowsEval:()=>So,assert:()=>ud,assertEqual:()=>id,assertIs:()=>sd,assertNever:()=>cd,assertNotEqual:()=>ad,assignProp:()=>ko,cached:()=>wt,captureStackTrace:()=>yr,cleanEnum:()=>xd,cleanRegex:()=>It,clone:()=>ne,createTransparentProxy:()=>gd,defineLazy:()=>D,esc:()=>Te,escapeRegex:()=>be,extend:()=>bd,finalizeIssue:()=>ae,floatSafeRemainder:()=>zo,getElementAtPath:()=>ld,getEnumValues:()=>St,getLengthableOrigin:()=>Tt,getParsedType:()=>fd,getSizableOrigin:()=>Pt,isObject:()=>qe,isPlainObject:()=>Ve,issue:()=>To,joinValues:()=>f,jsonStringifyReplacer:()=>xo,merge:()=>_d,normalizeParams:()=>v,nullish:()=>xe,numKeys:()=>pd,omit:()=>vd,optionalKeys:()=>Io,partial:()=>yd,pick:()=>hd,prefixIssues:()=>oe,primitiveTypes:()=>wo,promiseAllObject:()=>md,propertyKeyTypes:()=>jt,randomString:()=>dd,required:()=>$d,stringifyPrimitive:()=>_,unwrapMessage:()=>kt});function id(t){return t}function ad(t){return t}function sd(t){}function cd(t){throw new Error}function ud(t){}function St(t){let r=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,e])=>r.indexOf(+i)===-1).map(([i,e])=>e)}function f(t,r="|"){return t.map(n=>_(n)).join(r)}function xo(t,r){return typeof r=="bigint"?r.toString():r}function wt(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function xe(t){return t==null}function It(t){let r=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(r,n)}function zo(t,r){let n=(t.toString().split(".")[1]||"").length,i=(r.toString().split(".")[1]||"").length,e=n>i?n:i,o=Number.parseInt(t.toFixed(e).replace(".","")),a=Number.parseInt(r.toFixed(e).replace(".",""));return o%a/10**e}function D(t,r,n){Object.defineProperty(t,r,{get(){{let e=n();return t[r]=e,e}throw new Error("cached value already set")},set(e){Object.defineProperty(t,r,{value:e})},configurable:!0})}function ko(t,r,n){Object.defineProperty(t,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ld(t,r){return r?r.reduce((n,i)=>n?.[i],t):t}function md(t){let r=Object.keys(t),n=r.map(i=>t[i]);return Promise.all(n).then(i=>{let e={};for(let o=0;o<r.length;o++)e[r[o]]=i[o];return e})}function dd(t=10){let r="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=r[Math.floor(Math.random()*r.length)];return n}function Te(t){return JSON.stringify(t)}function qe(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ve(t){if(qe(t)===!1)return!1;let r=t.constructor;if(r===void 0)return!0;let n=r.prototype;return!(qe(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function pd(t){let r=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r++;return r}function be(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ne(t,r,n){let i=new t._zod.constr(r??t._zod.def);return(!r||n?.parent)&&(i._zod.parent=t),i}function v(t){let r=t;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function gd(t){let r;return new Proxy({},{get(n,i,e){return r??(r=t()),Reflect.get(r,i,e)},set(n,i,e,o){return r??(r=t()),Reflect.set(r,i,e,o)},has(n,i){return r??(r=t()),Reflect.has(r,i)},deleteProperty(n,i){return r??(r=t()),Reflect.deleteProperty(r,i)},ownKeys(n){return r??(r=t()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(n,i){return r??(r=t()),Reflect.getOwnPropertyDescriptor(r,i)},defineProperty(n,i,e){return r??(r=t()),Reflect.defineProperty(r,i,e)}})}function _(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Io(t){return Object.keys(t).filter(r=>t[r]._zod.optin==="optional"&&t[r]._zod.optout==="optional")}function hd(t,r){let n={},i=t._zod.def;for(let e in r){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=i.shape[e])}return ne(t,{...t._zod.def,shape:n,checks:[]})}function vd(t,r){let n={...t._zod.def.shape},i=t._zod.def;for(let e in r){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);r[e]&&delete n[e]}return ne(t,{...t._zod.def,shape:n,checks:[]})}function bd(t,r){if(!Ve(r))throw new Error("Invalid input to extend: expected a plain object");let n={...t._zod.def,get shape(){let i={...t._zod.def.shape,...r};return ko(this,"shape",i),i},checks:[]};return ne(t,n)}function _d(t,r){return ne(t,{...t._zod.def,get shape(){let n={...t._zod.def.shape,...r._zod.def.shape};return ko(this,"shape",n),n},catchall:r._zod.def.catchall,checks:[]})}function yd(t,r,n){let i=r._zod.def.shape,e={...i};if(n)for(let o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(e[o]=t?new t({type:"optional",innerType:i[o]}):i[o])}else for(let o in i)e[o]=t?new t({type:"optional",innerType:i[o]}):i[o];return ne(r,{...r._zod.def,shape:e,checks:[]})}function $d(t,r,n){let i=r._zod.def.shape,e={...i};if(n)for(let o in n){if(!(o in e))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(e[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)e[o]=new t({type:"nonoptional",innerType:i[o]});return ne(r,{...r._zod.def,shape:e,checks:[]})}function Oe(t,r=0){for(let n=r;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function oe(t,r){return r.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function kt(t){return typeof t=="string"?t:t?.message}function ae(t,r,n){let i={...t,path:t.path??[]};if(!t.message){let e=kt(t.inst?._zod.def?.error?.(t))??kt(r?.error?.(t))??kt(n.customError?.(t))??kt(n.localeError?.(t))??"Invalid input";i.message=e}return delete i.inst,delete i.continue,r?.reportInput||delete i.input,i}function Pt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Tt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function To(...t){let[r,n,i]=t;return typeof r=="string"?{message:r,code:"custom",input:n,inst:i}:{...r}}function xd(t){return Object.entries(t).filter(([r,n])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}var yr,So,fd,jt,wo,jo,Po,$o,P=k(()=>{yr=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};So=wt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});fd=t=>{let r=typeof t;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},jt=new Set(["string","number","symbol"]),wo=new Set(["string","number","bigint","boolean","symbol","undefined"]);jo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Po={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};$o=class{constructor(...r){}}});function He(t,r=n=>n.message){let n={},i=[];for(let e of t.issues)e.path.length>0?(n[e.path[0]]=n[e.path[0]]||[],n[e.path[0]].push(r(e))):i.push(r(e));return{formErrors:i,fieldErrors:n}}function Je(t,r){let n=r||function(o){return o.message},i={_errors:[]},e=o=>{for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>e({issues:c}));else if(a.code==="invalid_key")e({issues:a.issues});else if(a.code==="invalid_element")e({issues:a.issues});else if(a.path.length===0)i._errors.push(n(a));else{let c=i,d=0;for(;d<a.path.length;){let h=a.path[d];d===a.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(n(a))):c[h]=c[h]||{_errors:[]},c=c[h],d++}}};return e(t),i}function $r(t,r){let n=r||function(o){return o.message},i={errors:[]},e=(o,a=[])=>{var c,d;for(let h of o.issues)if(h.code==="invalid_union"&&h.errors.length)h.errors.map(g=>e({issues:g},h.path));else if(h.code==="invalid_key")e({issues:h.issues},h.path);else if(h.code==="invalid_element")e({issues:h.issues},h.path);else{let g=[...a,...h.path];if(g.length===0){i.errors.push(n(h));continue}let l=i,$=0;for(;$<g.length;){let b=g[$],p=$===g.length-1;typeof b=="string"?(l.properties??(l.properties={}),(c=l.properties)[b]??(c[b]={errors:[]}),l=l.properties[b]):(l.items??(l.items=[]),(d=l.items)[b]??(d[b]={errors:[]}),l=l.items[b]),p&&l.errors.push(n(h)),$++}}};return e(t),i}function Zc(t){let r=[];for(let n of t)typeof n=="number"?r.push(`[${n}]`):typeof n=="symbol"?r.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?r.push(`[${JSON.stringify(n)}]`):(r.length&&r.push("."),r.push(n));return r.join("")}function xr(t){let r=[],n=[...t.issues].sort((i,e)=>i.path.length-e.path.length);for(let i of n)r.push(`\u2716 ${i.message}`),i.path?.length&&r.push(` \u2192 at ${Zc(i.path)}`);return r.join(`+<script>"use strict";(()=>{var Uc=Object.defineProperty;var od=(t,r,n)=>r in t?Uc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n;var Pe=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,n)=>(typeof require<"u"?require:r)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var k=(t,r,n)=>()=>{if(n)throw n[0];try{return t&&(r=t(t=0)),r}catch(i){throw n=[i],i}};var $e=(t,r)=>{for(var n in r)Uc(t,n,{get:r[n],enumerable:!0})};var A=(t,r,n)=>od(t,typeof r!="symbol"?r+"":r,n);function u(t,r,n){function i(c,d){var h;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(h=c._zod).traits??(h.traits=new Set),c._zod.traits.add(t),r(c,d);for(let g in a.prototype)g in c||Object.defineProperty(c,g,{value:a.prototype[g].bind(c)});c._zod.constr=a,c._zod.def=d}let e=n?.Parent??Object;class o extends e{}Object.defineProperty(o,"name",{value:t});function a(c){var d;let h=n?.Parent?new o:this;i(h,c),(d=h._zod).deferred??(d.deferred=[]);for(let g of h._zod.deferred)g();return h}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}function B(t){return t&&Object.assign(zt,t),zt}var br,_r,de,zt,Le=k(()=>{br=Object.freeze({status:"aborted"});_r=Symbol("zod_brand"),de=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},zt={}});var y={};$e(y,{BIGINT_FORMAT_RANGES:()=>Po,Class:()=>$o,NUMBER_FORMAT_RANGES:()=>jo,aborted:()=>Oe,allowsEval:()=>So,assert:()=>ud,assertEqual:()=>id,assertIs:()=>sd,assertNever:()=>cd,assertNotEqual:()=>ad,assignProp:()=>ko,cached:()=>wt,captureStackTrace:()=>yr,cleanEnum:()=>xd,cleanRegex:()=>It,clone:()=>ne,createTransparentProxy:()=>gd,defineLazy:()=>D,esc:()=>Te,escapeRegex:()=>be,extend:()=>bd,finalizeIssue:()=>ae,floatSafeRemainder:()=>zo,getElementAtPath:()=>ld,getEnumValues:()=>St,getLengthableOrigin:()=>Tt,getParsedType:()=>fd,getSizableOrigin:()=>Pt,isObject:()=>qe,isPlainObject:()=>Ve,issue:()=>To,joinValues:()=>f,jsonStringifyReplacer:()=>xo,merge:()=>_d,normalizeParams:()=>v,nullish:()=>xe,numKeys:()=>pd,omit:()=>vd,optionalKeys:()=>Io,partial:()=>yd,pick:()=>hd,prefixIssues:()=>oe,primitiveTypes:()=>wo,promiseAllObject:()=>md,propertyKeyTypes:()=>jt,randomString:()=>dd,required:()=>$d,stringifyPrimitive:()=>_,unwrapMessage:()=>kt});function id(t){return t}function ad(t){return t}function sd(t){}function cd(t){throw new Error}function ud(t){}function St(t){let r=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,e])=>r.indexOf(+i)===-1).map(([i,e])=>e)}function f(t,r="|"){return t.map(n=>_(n)).join(r)}function xo(t,r){return typeof r=="bigint"?r.toString():r}function wt(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function xe(t){return t==null}function It(t){let r=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(r,n)}function zo(t,r){let n=(t.toString().split(".")[1]||"").length,i=(r.toString().split(".")[1]||"").length,e=n>i?n:i,o=Number.parseInt(t.toFixed(e).replace(".","")),a=Number.parseInt(r.toFixed(e).replace(".",""));return o%a/10**e}function D(t,r,n){Object.defineProperty(t,r,{get(){{let e=n();return t[r]=e,e}throw new Error("cached value already set")},set(e){Object.defineProperty(t,r,{value:e})},configurable:!0})}function ko(t,r,n){Object.defineProperty(t,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ld(t,r){return r?r.reduce((n,i)=>n?.[i],t):t}function md(t){let r=Object.keys(t),n=r.map(i=>t[i]);return Promise.all(n).then(i=>{let e={};for(let o=0;o<r.length;o++)e[r[o]]=i[o];return e})}function dd(t=10){let r="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=r[Math.floor(Math.random()*r.length)];return n}function Te(t){return JSON.stringify(t)}function qe(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ve(t){if(qe(t)===!1)return!1;let r=t.constructor;if(r===void 0)return!0;let n=r.prototype;return!(qe(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function pd(t){let r=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r++;return r}function be(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ne(t,r,n){let i=new t._zod.constr(r??t._zod.def);return(!r||n?.parent)&&(i._zod.parent=t),i}function v(t){let r=t;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function gd(t){let r;return new Proxy({},{get(n,i,e){return r??(r=t()),Reflect.get(r,i,e)},set(n,i,e,o){return r??(r=t()),Reflect.set(r,i,e,o)},has(n,i){return r??(r=t()),Reflect.has(r,i)},deleteProperty(n,i){return r??(r=t()),Reflect.deleteProperty(r,i)},ownKeys(n){return r??(r=t()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(n,i){return r??(r=t()),Reflect.getOwnPropertyDescriptor(r,i)},defineProperty(n,i,e){return r??(r=t()),Reflect.defineProperty(r,i,e)}})}function _(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Io(t){return Object.keys(t).filter(r=>t[r]._zod.optin==="optional"&&t[r]._zod.optout==="optional")}function hd(t,r){let n={},i=t._zod.def;for(let e in r){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=i.shape[e])}return ne(t,{...t._zod.def,shape:n,checks:[]})}function vd(t,r){let n={...t._zod.def.shape},i=t._zod.def;for(let e in r){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);r[e]&&delete n[e]}return ne(t,{...t._zod.def,shape:n,checks:[]})}function bd(t,r){if(!Ve(r))throw new Error("Invalid input to extend: expected a plain object");let n={...t._zod.def,get shape(){let i={...t._zod.def.shape,...r};return ko(this,"shape",i),i},checks:[]};return ne(t,n)}function _d(t,r){return ne(t,{...t._zod.def,get shape(){let n={...t._zod.def.shape,...r._zod.def.shape};return ko(this,"shape",n),n},catchall:r._zod.def.catchall,checks:[]})}function yd(t,r,n){let i=r._zod.def.shape,e={...i};if(n)for(let o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(e[o]=t?new t({type:"optional",innerType:i[o]}):i[o])}else for(let o in i)e[o]=t?new t({type:"optional",innerType:i[o]}):i[o];return ne(r,{...r._zod.def,shape:e,checks:[]})}function $d(t,r,n){let i=r._zod.def.shape,e={...i};if(n)for(let o in n){if(!(o in e))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(e[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)e[o]=new t({type:"nonoptional",innerType:i[o]});return ne(r,{...r._zod.def,shape:e,checks:[]})}function Oe(t,r=0){for(let n=r;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function oe(t,r){return r.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function kt(t){return typeof t=="string"?t:t?.message}function ae(t,r,n){let i={...t,path:t.path??[]};if(!t.message){let e=kt(t.inst?._zod.def?.error?.(t))??kt(r?.error?.(t))??kt(n.customError?.(t))??kt(n.localeError?.(t))??"Invalid input";i.message=e}return delete i.inst,delete i.continue,r?.reportInput||delete i.input,i}function Pt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Tt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function To(...t){let[r,n,i]=t;return typeof r=="string"?{message:r,code:"custom",input:n,inst:i}:{...r}}function xd(t){return Object.entries(t).filter(([r,n])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}var yr,So,fd,jt,wo,jo,Po,$o,P=k(()=>{yr=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};So=wt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});fd=t=>{let r=typeof t;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},jt=new Set(["string","number","symbol"]),wo=new Set(["string","number","bigint","boolean","symbol","undefined"]);jo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Po={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};$o=class{constructor(...r){}}});function He(t,r=n=>n.message){let n={},i=[];for(let e of t.issues)e.path.length>0?(n[e.path[0]]=n[e.path[0]]||[],n[e.path[0]].push(r(e))):i.push(r(e));return{formErrors:i,fieldErrors:n}}function Je(t,r){let n=r||function(o){return o.message},i={_errors:[]},e=o=>{for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>e({issues:c}));else if(a.code==="invalid_key")e({issues:a.issues});else if(a.code==="invalid_element")e({issues:a.issues});else if(a.path.length===0)i._errors.push(n(a));else{let c=i,d=0;for(;d<a.path.length;){let h=a.path[d];d===a.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(n(a))):c[h]=c[h]||{_errors:[]},c=c[h],d++}}};return e(t),i}function $r(t,r){let n=r||function(o){return o.message},i={errors:[]},e=(o,a=[])=>{var c,d;for(let h of o.issues)if(h.code==="invalid_union"&&h.errors.length)h.errors.map(g=>e({issues:g},h.path));else if(h.code==="invalid_key")e({issues:h.issues},h.path);else if(h.code==="invalid_element")e({issues:h.issues},h.path);else{let g=[...a,...h.path];if(g.length===0){i.errors.push(n(h));continue}let l=i,$=0;for(;$<g.length;){let b=g[$],p=$===g.length-1;typeof b=="string"?(l.properties??(l.properties={}),(c=l.properties)[b]??(c[b]={errors:[]}),l=l.properties[b]):(l.items??(l.items=[]),(d=l.items)[b]??(d[b]={errors:[]}),l=l.items[b]),p&&l.errors.push(n(h)),$++}}};return e(t),i}function Zc(t){let r=[];for(let n of t)typeof n=="number"?r.push(`[${n}]`):typeof n=="symbol"?r.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?r.push(`[${JSON.stringify(n)}]`):(r.length&&r.push("."),r.push(n));return r.join("")}function xr(t){let r=[],n=[...t.issues].sort((i,e)=>i.path.length-e.path.length);for(let i of n)r.push(`\u2716 ${i.message}`),i.path?.length&&r.push(` \u2192 at ${Zc(i.path)}`);return r.join(``)}var Ec,Ot,Fe,Oo=k(()=>{Le();P();Ec=(t,r)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:r,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(r,xo,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Ot=u("$ZodError",Ec),Fe=u("$ZodError",Ec,{Parent:Error})});var zr,Nt,kr,Ut,Sr,Be,wr,Et,Ir=k(()=>{Le();Oo();P();zr=t=>(r,n,i,e)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=r._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new de;if(a.issues.length){let c=new(e?.Err??t)(a.issues.map(d=>ae(d,o,B())));throw yr(c,e?.callee),c}return a.value},Nt=zr(Fe),kr=t=>async(r,n,i,e)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=r._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(e?.Err??t)(a.issues.map(d=>ae(d,o,B())));throw yr(c,e?.callee),c}return a.value},Ut=kr(Fe),Sr=t=>(r,n,i)=>{let e=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},e);if(o instanceof Promise)throw new de;return o.issues.length?{success:!1,error:new(t??Ot)(o.issues.map(a=>ae(a,e,B())))}:{success:!0,data:o.value}},Be=Sr(Fe),wr=t=>async(r,n,i)=>{let e=i?Object.assign(i,{async:!0}):{async:!0},o=r._zod.run({value:n,issues:[]},e);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(a=>ae(a,e,B())))}:{success:!0,data:o.value}},Et=wr(Fe)});var ze={};$e(ze,{_emoji:()=>Dc,base64:()=>Jo,base64url:()=>jr,bigint:()=>Xo,boolean:()=>ri,browserEmail:()=>Od,cidrv4:()=>Fo,cidrv6:()=>Ho,cuid:()=>No,cuid2:()=>Uo,date:()=>Ko,datetime:()=>Qo,domain:()=>Nd,duration:()=>Ao,e164:()=>Wo,email:()=>Mo,emoji:()=>Lo,extendedDuration:()=>kd,guid:()=>Co,hostname:()=>Bo,html5Email:()=>jd,integer:()=>ei,ipv4:()=>qo,ipv6:()=>Vo,ksuid:()=>Do,lowercase:()=>ii,nanoid:()=>Ro,null:()=>ni,number:()=>ti,rfc5322Email:()=>Pd,string:()=>Yo,time:()=>Go,ulid:()=>Eo,undefined:()=>oi,unicodeEmail:()=>Td,uppercase:()=>ai,uuid:()=>Ne,uuid4:()=>Sd,uuid6:()=>wd,uuid7:()=>Id,xid:()=>Zo});function Lo(){return new RegExp(Dc,"u")}function Ac(t){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${r}`:t.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${t.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Go(t){return new RegExp(`^${Ac(t)}$`)}function Qo(t){let r=Ac({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");let i=`${r}(?:${n.join("|")})`;return new RegExp(`^${Rc}T(?:${i})$`)}var No,Uo,Eo,Zo,Do,Ro,Ao,kd,Co,Ne,Sd,wd,Id,Mo,jd,Pd,Td,Od,Dc,qo,Vo,Fo,Ho,Jo,jr,Bo,Nd,Wo,Rc,Ko,Yo,Xo,ei,ti,ri,ni,oi,ii,ai,Pr=k(()=>{No=/^[cC][^\s-]{8,}$/,Uo=/^[0-9a-z]+$/,Eo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zo=/^[0-9a-vA-V]{20}$/,Do=/^[A-Za-z0-9]{27}$/,Ro=/^[a-zA-Z0-9_-]{21}$/,Ao=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kd=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Co=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ne=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Sd=Ne(4),wd=Ne(6),Id=Ne(7),Mo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jd=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Pd=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Td=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Od=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Dc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";qo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Fo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ho=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Jo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,jr=/^[A-Za-z0-9_-]*$/,Bo=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Nd=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wo=/^\+(?:[0-9]){6,14}[0-9]$/,Rc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ko=new RegExp(`^${Rc}$`);Yo=t=>{let r=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},Xo=/^\d+n?$/,ei=/^\d+$/,ti=/^-?\d+(?:\.\d+)?/i,ri=/true|false/i,ni=/null/i,oi=/undefined/i,ii=/^[^A-Z]*$/,ai=/^[^a-z]*$/});function Cc(t,r,n){t.issues.length&&r.issues.push(...oe(n,t.issues))}var J,Mc,Tr,Or,si,ci,ui,li,mi,di,pi,fi,gi,We,hi,vi,bi,_i,yi,$i,xi,zi,ki,Nr=k(()=>{Le();Pr();P();J=u("$ZodCheck",(t,r)=>{var n;t._zod??(t._zod={}),t._zod.def=r,(n=t._zod).onattach??(n.onattach=[])}),Mc={number:"number",bigint:"bigint",object:"date"},Tr=u("$ZodCheckLessThan",(t,r)=>{J.init(t,r);let n=Mc[typeof r.value];t._zod.onattach.push(i=>{let e=i._zod.bag,o=(r.inclusive?e.maximum:e.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<o&&(r.inclusive?e.maximum=r.value:e.exclusiveMaximum=r.value)}),t._zod.check=i=>{(r.inclusive?i.value<=r.value:i.value<r.value)||i.issues.push({origin:n,code:"too_big",maximum:r.value,input:i.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),Or=u("$ZodCheckGreaterThan",(t,r)=>{J.init(t,r);let n=Mc[typeof r.value];t._zod.onattach.push(i=>{let e=i._zod.bag,o=(r.inclusive?e.minimum:e.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>o&&(r.inclusive?e.minimum=r.value:e.exclusiveMinimum=r.value)}),t._zod.check=i=>{(r.inclusive?i.value>=r.value:i.value>r.value)||i.issues.push({origin:n,code:"too_small",minimum:r.value,input:i.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),si=u("$ZodCheckMultipleOf",(t,r)=>{J.init(t,r),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=r.value)}),t._zod.check=n=>{if(typeof n.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%r.value===BigInt(0):zo(n.value,r.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:r.value,input:n.value,inst:t,continue:!r.abort})}}),ci=u("$ZodCheckNumberFormat",(t,r)=>{J.init(t,r),r.format=r.format||"float64";let n=r.format?.includes("int"),i=n?"int":"number",[e,o]=jo[r.format];t._zod.onattach.push(a=>{let c=a._zod.bag;c.format=r.format,c.minimum=e,c.maximum=o,n&&(c.pattern=ei)}),t._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:i,format:r.format,code:"invalid_type",input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!r.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!r.abort});return}}c<e&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:e,inclusive:!0,inst:t,continue:!r.abort}),c>o&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inst:t})}}),ui=u("$ZodCheckBigIntFormat",(t,r)=>{J.init(t,r);let[n,i]=Po[r.format];t._zod.onattach.push(e=>{let o=e._zod.bag;o.format=r.format,o.minimum=n,o.maximum=i}),t._zod.check=e=>{let o=e.value;o<n&&e.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!r.abort}),o>i&&e.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:t})}}),li=u("$ZodCheckMaxSize",(t,r)=>{var n;J.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!xe(e)&&e.size!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<e&&(i._zod.bag.maximum=r.maximum)}),t._zod.check=i=>{let e=i.value;e.size<=r.maximum||i.issues.push({origin:Pt(e),code:"too_big",maximum:r.maximum,input:e,inst:t,continue:!r.abort})}}),mi=u("$ZodCheckMinSize",(t,r)=>{var n;J.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!xe(e)&&e.size!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>e&&(i._zod.bag.minimum=r.minimum)}),t._zod.check=i=>{let e=i.value;e.size>=r.minimum||i.issues.push({origin:Pt(e),code:"too_small",minimum:r.minimum,input:e,inst:t,continue:!r.abort})}}),di=u("$ZodCheckSizeEquals",(t,r)=>{var n;J.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!xe(e)&&e.size!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag;e.minimum=r.size,e.maximum=r.size,e.size=r.size}),t._zod.check=i=>{let e=i.value,o=e.size;if(o===r.size)return;let a=o>r.size;i.issues.push({origin:Pt(e),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!r.abort})}}),pi=u("$ZodCheckMaxLength",(t,r)=>{var n;J.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!xe(e)&&e.length!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<e&&(i._zod.bag.maximum=r.maximum)}),t._zod.check=i=>{let e=i.value;if(e.length<=r.maximum)return;let a=Tt(e);i.issues.push({origin:a,code:"too_big",maximum:r.maximum,inclusive:!0,input:e,inst:t,continue:!r.abort})}}),fi=u("$ZodCheckMinLength",(t,r)=>{var n;J.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!xe(e)&&e.length!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>e&&(i._zod.bag.minimum=r.minimum)}),t._zod.check=i=>{let e=i.value;if(e.length>=r.minimum)return;let a=Tt(e);i.issues.push({origin:a,code:"too_small",minimum:r.minimum,inclusive:!0,input:e,inst:t,continue:!r.abort})}}),gi=u("$ZodCheckLengthEquals",(t,r)=>{var n;J.init(t,r),(n=t._zod.def).when??(n.when=i=>{let e=i.value;return!xe(e)&&e.length!==void 0}),t._zod.onattach.push(i=>{let e=i._zod.bag;e.minimum=r.length,e.maximum=r.length,e.length=r.length}),t._zod.check=i=>{let e=i.value,o=e.length;if(o===r.length)return;let a=Tt(e),c=o>r.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!r.abort})}}),We=u("$ZodCheckStringFormat",(t,r)=>{var n,i;J.init(t,r),t._zod.onattach.push(e=>{let o=e._zod.bag;o.format=r.format,r.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(r.pattern))}),r.pattern?(n=t._zod).check??(n.check=e=>{r.pattern.lastIndex=0,!r.pattern.test(e.value)&&e.issues.push({origin:"string",code:"invalid_format",format:r.format,input:e.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:t,continue:!r.abort})}):(i=t._zod).check??(i.check=()=>{})}),hi=u("$ZodCheckRegex",(t,r)=>{We.init(t,r),t._zod.check=n=>{r.pattern.lastIndex=0,!r.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:r.pattern.toString(),inst:t,continue:!r.abort})}}),vi=u("$ZodCheckLowerCase",(t,r)=>{r.pattern??(r.pattern=ii),We.init(t,r)}),bi=u("$ZodCheckUpperCase",(t,r)=>{r.pattern??(r.pattern=ai),We.init(t,r)}),_i=u("$ZodCheckIncludes",(t,r)=>{J.init(t,r);let n=be(r.includes),i=new RegExp(typeof r.position=="number"?`^.{${r.position}}${n}`:n);r.pattern=i,t._zod.onattach.push(e=>{let o=e._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=e=>{e.value.includes(r.includes,r.position)||e.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:e.value,inst:t,continue:!r.abort})}}),yi=u("$ZodCheckStartsWith",(t,r)=>{J.init(t,r);let n=new RegExp(`^${be(r.prefix)}.*`);r.pattern??(r.pattern=n),t._zod.onattach.push(i=>{let e=i._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(r.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:i.value,inst:t,continue:!r.abort})}}),$i=u("$ZodCheckEndsWith",(t,r)=>{J.init(t,r);let n=new RegExp(`.*${be(r.suffix)}$`);r.pattern??(r.pattern=n),t._zod.onattach.push(i=>{let e=i._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(r.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:i.value,inst:t,continue:!r.abort})}});xi=u("$ZodCheckProperty",(t,r)=>{J.init(t,r),t._zod.check=n=>{let i=r.schema._zod.run({value:n.value[r.property],issues:[]},{});if(i instanceof Promise)return i.then(e=>Cc(e,n,r.property));Cc(i,n,r.property)}}),zi=u("$ZodCheckMimeType",(t,r)=>{J.init(t,r);let n=new Set(r.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=r.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:r.mime,input:i.value.type,inst:t})}}),ki=u("$ZodCheckOverwrite",(t,r)=>{J.init(t,r),t._zod.check=n=>{n.value=r.tx(n.value)}})});var Zt,Si=k(()=>{Zt=class{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let i=r.split(``).filter(a=>a),e=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(e)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let r=Function,n=this?.args,e=[...(this?.content??[""]).map(o=>` ${o}`)];return new r(...n,e.join(``))}}});var wi,Ii=k(()=>{wi={major:4,minor:0,patch:0}});function Wi(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Xc(t){if(!jr.test(t))return!1;let r=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=r.padEnd(Math.ceil(r.length/4)*4,"=");return Wi(n)}function eu(t,r=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let e=JSON.parse(atob(i));return!("typ"in e&&e?.typ!=="JWT"||!e.alg||r&&(!("alg"in e)||e.alg!==r))}catch{return!1}}function qc(t,r,n){t.issues.length&&r.issues.push(...oe(n,t.issues)),r.value[n]=t.value}function Ur(t,r,n){t.issues.length&&r.issues.push(...oe(n,t.issues)),r.value[n]=t.value}function Vc(t,r,n,i){t.issues.length?i[n]===void 0?n in i?r.value[n]=void 0:r.value[n]=t.value:r.issues.push(...oe(n,t.issues)):t.value===void 0?n in i&&(r.value[n]=void 0):r.value[n]=t.value}function Fc(t,r,n,i){for(let e of t)if(e.issues.length===0)return r.value=e.value,r;return r.issues.push({code:"invalid_union",input:r.value,inst:n,errors:t.map(e=>e.issues.map(o=>ae(o,i,B())))}),r}function ji(t,r){if(t===r)return{valid:!0,data:t};if(t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(Ve(t)&&Ve(r)){let n=Object.keys(r),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),e={...t,...r};for(let o of i){let a=ji(t[o],r[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};e[o]=a.data}return{valid:!0,data:e}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let e=t[i],o=r[i],a=ji(e,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Hc(t,r,n){if(r.issues.length&&t.issues.push(...r.issues),n.issues.length&&t.issues.push(...n.issues),Oe(t))return t;let i=ji(r.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}function Er(t,r,n){t.issues.length&&r.issues.push(...oe(n,t.issues)),r.value[n]=t.value}function Jc(t,r,n,i,e,o,a){t.issues.length&&(jt.has(typeof i)?n.issues.push(...oe(i,t.issues)):n.issues.push({origin:"map",code:"invalid_key",input:e,inst:o,issues:t.issues.map(c=>ae(c,a,B()))})),r.issues.length&&(jt.has(typeof i)?n.issues.push(...oe(i,r.issues)):n.issues.push({origin:"map",code:"invalid_element",input:e,inst:o,key:i,issues:r.issues.map(c=>ae(c,a,B()))})),n.value.set(t.value,r.value)}function Bc(t,r){t.issues.length&&r.issues.push(...t.issues),r.value.add(t.value)}function Wc(t,r){return t.value===void 0&&(t.value=r.defaultValue),t}function Kc(t,r){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:r}),t}function Gc(t,r,n){return Oe(t)?t:r.out._zod.run({value:t.value,issues:t.issues},n)}function Qc(t){return t.value=Object.freeze(t.value),t}function Yc(t,r,n,i){if(!t){let e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),r.issues.push(To(e))}}var T,Ue,q,Pi,Ti,Oi,Ni,Ui,Ei,Zi,Di,Ri,Ai,Ci,Mi,Li,qi,Vi,Fi,Hi,Ji,Bi,Ki,Gi,Qi,Yi,Xi,Zr,ea,Dt,Dr,ta,ra,na,oa,ia,Ke,aa,sa,ca,Rt,ua,Rr,la,ma,Ee,da,pa,fa,ga,ha,va,At,ba,_a,ya,$a,xa,za,ka,Sa,Ct,wa,Ia,ja,Pa,Ta,Mt=k(()=>{Nr();Le();Si();Ir();Pr();P();Ii();P();T=u("$ZodType",(t,r)=>{var n;t??(t={}),t._zod.def=r,t._zod.bag=t._zod.bag||{},t._zod.version=wi;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let e of i)for(let o of e._zod.onattach)o(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let e=(o,a,c)=>{let d=Oe(o),h;for(let g of a){if(g._zod.def.when){if(!g._zod.def.when(o))continue}else if(d)continue;let l=o.issues.length,$=g._zod.check(o);if($ instanceof Promise&&c?.async===!1)throw new de;if(h||$ instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await $,o.issues.length!==l&&(d||(d=Oe(o,l)))});else{if(o.issues.length===l)continue;d||(d=Oe(o,l))}}return h?h.then(()=>o):o};t._zod.run=(o,a)=>{let c=t._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new de;return c.then(d=>e(d,i,a))}return e(c,i,a)}}t["~standard"]={validate:e=>{try{let o=Be(t,e);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Et(t,e).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Ue=u("$ZodString",(t,r)=>{T.init(t,r),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Yo(t._zod.bag),t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),q=u("$ZodStringFormat",(t,r)=>{We.init(t,r),Ue.init(t,r)}),Pi=u("$ZodGUID",(t,r)=>{r.pattern??(r.pattern=Co),q.init(t,r)}),Ti=u("$ZodUUID",(t,r)=>{if(r.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(i===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=Ne(i))}else r.pattern??(r.pattern=Ne());q.init(t,r)}),Oi=u("$ZodEmail",(t,r)=>{r.pattern??(r.pattern=Mo),q.init(t,r)}),Ni=u("$ZodURL",(t,r)=>{q.init(t,r),t._zod.check=n=>{try{let i=n.value,e=new URL(i),o=e.href;r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(e.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Bo.source,input:n.value,inst:t,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:n.value,inst:t,continue:!r.abort})),!i.endsWith("/")&&o.endsWith("/")?n.value=o.slice(0,-1):n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!r.abort})}}}),Ui=u("$ZodEmoji",(t,r)=>{r.pattern??(r.pattern=Lo()),q.init(t,r)}),Ei=u("$ZodNanoID",(t,r)=>{r.pattern??(r.pattern=Ro),q.init(t,r)}),Zi=u("$ZodCUID",(t,r)=>{r.pattern??(r.pattern=No),q.init(t,r)}),Di=u("$ZodCUID2",(t,r)=>{r.pattern??(r.pattern=Uo),q.init(t,r)}),Ri=u("$ZodULID",(t,r)=>{r.pattern??(r.pattern=Eo),q.init(t,r)}),Ai=u("$ZodXID",(t,r)=>{r.pattern??(r.pattern=Zo),q.init(t,r)}),Ci=u("$ZodKSUID",(t,r)=>{r.pattern??(r.pattern=Do),q.init(t,r)}),Mi=u("$ZodISODateTime",(t,r)=>{r.pattern??(r.pattern=Qo(r)),q.init(t,r)}),Li=u("$ZodISODate",(t,r)=>{r.pattern??(r.pattern=Ko),q.init(t,r)}),qi=u("$ZodISOTime",(t,r)=>{r.pattern??(r.pattern=Go(r)),q.init(t,r)}),Vi=u("$ZodISODuration",(t,r)=>{r.pattern??(r.pattern=Ao),q.init(t,r)}),Fi=u("$ZodIPv4",(t,r)=>{r.pattern??(r.pattern=qo),q.init(t,r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv4"})}),Hi=u("$ZodIPv6",(t,r)=>{r.pattern??(r.pattern=Vo),q.init(t,r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv6"}),t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!r.abort})}}}),Ji=u("$ZodCIDRv4",(t,r)=>{r.pattern??(r.pattern=Fo),q.init(t,r)}),Bi=u("$ZodCIDRv6",(t,r)=>{r.pattern??(r.pattern=Ho),q.init(t,r),t._zod.check=n=>{let[i,e]=n.value.split("/");try{if(!e)throw new Error;let o=Number(e);if(`${o}`!==e)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!r.abort})}}});Ki=u("$ZodBase64",(t,r)=>{r.pattern??(r.pattern=Jo),q.init(t,r),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),t._zod.check=n=>{Wi(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!r.abort})}});Gi=u("$ZodBase64URL",(t,r)=>{r.pattern??(r.pattern=jr),q.init(t,r),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),t._zod.check=n=>{Xc(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!r.abort})}}),Qi=u("$ZodE164",(t,r)=>{r.pattern??(r.pattern=Wo),q.init(t,r)});Yi=u("$ZodJWT",(t,r)=>{q.init(t,r),t._zod.check=n=>{eu(n.value,r.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!r.abort})}}),Xi=u("$ZodCustomStringFormat",(t,r)=>{q.init(t,r),t._zod.check=n=>{r.fn(n.value)||n.issues.push({code:"invalid_format",format:r.format,input:n.value,inst:t,continue:!r.abort})}}),Zr=u("$ZodNumber",(t,r)=>{T.init(t,r),t._zod.pattern=t._zod.bag.pattern??ti,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=Number(n.value)}catch{}let e=n.value;if(typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e))return n;let o=typeof e=="number"?Number.isNaN(e)?"NaN":Number.isFinite(e)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:e,inst:t,...o?{received:o}:{}}),n}}),ea=u("$ZodNumber",(t,r)=>{ci.init(t,r),Zr.init(t,r)}),Dt=u("$ZodBoolean",(t,r)=>{T.init(t,r),t._zod.pattern=ri,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=!!n.value}catch{}let e=n.value;return typeof e=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:e,inst:t}),n}}),Dr=u("$ZodBigInt",(t,r)=>{T.init(t,r),t._zod.pattern=Xo,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),ta=u("$ZodBigInt",(t,r)=>{ui.init(t,r),Dr.init(t,r)}),ra=u("$ZodSymbol",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;return typeof e=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:e,inst:t}),n}}),na=u("$ZodUndefined",(t,r)=>{T.init(t,r),t._zod.pattern=oi,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(n,i)=>{let e=n.value;return typeof e>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:e,inst:t}),n}}),oa=u("$ZodNull",(t,r)=>{T.init(t,r),t._zod.pattern=ni,t._zod.values=new Set([null]),t._zod.parse=(n,i)=>{let e=n.value;return e===null||n.issues.push({expected:"null",code:"invalid_type",input:e,inst:t}),n}}),ia=u("$ZodAny",(t,r)=>{T.init(t,r),t._zod.parse=n=>n}),Ke=u("$ZodUnknown",(t,r)=>{T.init(t,r),t._zod.parse=n=>n}),aa=u("$ZodNever",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),sa=u("$ZodVoid",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;return typeof e>"u"||n.issues.push({expected:"void",code:"invalid_type",input:e,inst:t}),n}}),ca=u("$ZodDate",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=new Date(n.value)}catch{}let e=n.value,o=e instanceof Date;return o&&!Number.isNaN(e.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:e,...o?{received:"Invalid Date"}:{},inst:t}),n}});Rt=u("$ZodArray",(t,r)=>{T.init(t,r),t._zod.parse=(n,i)=>{let e=n.value;if(!Array.isArray(e))return n.issues.push({expected:"array",code:"invalid_type",input:e,inst:t}),n;n.value=Array(e.length);let o=[];for(let a=0;a<e.length;a++){let c=e[a],d=r.element._zod.run({value:c,issues:[]},i);d instanceof Promise?o.push(d.then(h=>qc(h,n,a))):qc(d,n,a)}return o.length?Promise.all(o).then(()=>n):n}});ua=u("$ZodObject",(t,r)=>{T.init(t,r);let n=wt(()=>{let l=Object.keys(r.shape);for(let b of l)if(!(r.shape[b]instanceof T))throw new Error(`Invalid element at key "${b}": expected a Zod schema`);let $=Io(r.shape);return{shape:r.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set($)}});D(t._zod,"propValues",()=>{let l=r.shape,$={};for(let b in l){let p=l[b]._zod;if(p.values){$[b]??($[b]=new Set);for(let x of p.values)$[b].add(x)}}return $});let i=l=>{let $=new Zt(["shape","payload","ctx"]),b=n.value,p=w=>{let j=Te(w);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};$.write("const input = payload.value;");let x=Object.create(null),S=0;for(let w of b.keys)x[w]=`key_${S++}`;$.write("const newResult = {}");for(let w of b.keys)if(b.optionalKeys.has(w)){let j=x[w];$.write(`const ${j} = ${p(w)};`);let U=Te(w);$.write(`diff --git a/packages/threews-avatar-mcp/src/threews.js b/packages/threews-avatar-mcp/src/threews.jsindex 73389fd27..dfe7e532b 100644--- a/packages/threews-avatar-mcp/src/threews.js+++ b/packages/threews-avatar-mcp/src/threews.js@@ -209,9 +209,11 @@ export function modelViewerHtml({ model_url, name = 'Avatar', background = 'tranalt="${escapeHtml(name)}"camera-controls${autoRotate ? 'auto-rotate' : ''}- shadow-intensity="1"- exposure="1"+ shadow-intensity="1.0"+ shadow-softness="0.9"+ exposure="1.5"tone-mapping="aces"+ environment-image="neutral"camera-orbit="${escapeHtml(cameraOrbit)}"ar ar-modes="webxr scene-viewer quick-look"></model-viewer>diff --git a/packages/tool-sdk/src/define-executor.js b/packages/tool-sdk/src/define-executor.jsindex f3764f065..500b59d00 100644--- a/packages/tool-sdk/src/define-executor.js+++ b/packages/tool-sdk/src/define-executor.js@@ -45,17 +45,17 @@ import { createRateLimiter } from './permissions.js';* @example* ```js* import { defineExecutor } from '@three-ws/tool-sdk';- * import { priceTool } from './index.js';+ * import { quoteTool } from './index.js';*- * export const executor = defineExecutor(priceTool, {- * async getPrice({ symbol }) {- * const res = await fetch(`https://api.example.com/v1/price/${symbol}`);+ * export const executor = defineExecutor(quoteTool, {+ * async getQuote({ prefix }) {+ * const res = await fetch(`https://three.ws/api/vanity/bounties?view=quote&prefix=${prefix}`);* const data = await res.json();- * return { symbol, price: data.price }; // wrapped into { success: true, content, state }+ * return { prefix, tier: data.difficulty.tierLabel }; // wrapped into { success: true, content, state }* },* });*- * const result = await executor.invoke('getPrice', { symbol: 'ETH' });+ * const result = await executor.invoke('getQuote', { prefix: 'THREE' });* ```*/export function defineExecutor(tool, implementation) {diff --git a/packages/tool-sdk/src/define-tool.js b/packages/tool-sdk/src/define-tool.jsindex e8dbb4d21..e4f4201de 100644--- a/packages/tool-sdk/src/define-tool.js+++ b/packages/tool-sdk/src/define-tool.js@@ -57,16 +57,16 @@ import { normalizePermissions } from './permissions.js';* ```js* import { defineTool, z } from '@three-ws/tool-sdk';*- * export const priceTool = defineTool({- * id: 'my-org-price-feed',- * title: 'My Price Feed',- * description: 'Fetches token prices from My API.',+ * export const quoteTool = defineTool({+ * id: 'three-ws-vanity-quote',+ * title: 'Vanity Quote',+ * description: 'Prices how hard a Solana vanity address pattern is to grind.',* version: '1.0.0',- * permissions: { network: ['api.example.com'] },+ * permissions: { network: ['three.ws'] },* apis: [{- * name: 'getPrice',- * description: 'Get the current USD price for a token symbol.',- * parameters: z.object({ symbol: z.string().describe('Token ticker, e.g. "ETH"') }),+ * name: 'getQuote',+ * description: 'Quote the difficulty and suggested USDC bounty for a Base58 prefix.',+ * parameters: z.object({ prefix: z.string().describe('Base58 prefix, e.g. "THREE"') }),* }],* });* ```diff --git a/packages/tool-sdk/src/index.js b/packages/tool-sdk/src/index.jsindex 5f8cd7c72..e20156f68 100644--- a/packages/tool-sdk/src/index.js+++ b/packages/tool-sdk/src/index.js@@ -10,28 +10,28 @@* ```js* import { defineTool, defineExecutor, toMcpTools, z } from '@three-ws/tool-sdk';*- * export const priceTool = defineTool({- * id: 'my-org-price-feed',- * title: 'My Price Feed',- * description: 'Fetches live token prices.',+ * export const quoteTool = defineTool({+ * id: 'three-ws-vanity-quote',+ * title: 'Vanity Quote',+ * description: 'Prices how hard a Solana vanity address pattern is to grind.',* version: '1.0.0',- * permissions: { network: ['api.example.com'], rateLimit: { calls: 30, perSeconds: 60 } },+ * permissions: { network: ['three.ws'], rateLimit: { calls: 30, perSeconds: 60 } },* apis: [{- * name: 'getPrice',- * description: 'Get the current USD price for a token symbol.',- * parameters: z.object({ symbol: z.string() }),+ * name: 'getQuote',+ * description: 'Quote the difficulty and suggested USDC bounty for a Base58 prefix.',+ * parameters: z.object({ prefix: z.string() }),* }],* });*- * export const priceExecutor = defineExecutor(priceTool, {- * async getPrice({ symbol }) {- * const res = await fetch(`https://api.example.com/v1/price/${symbol}`);+ * export const quoteExecutor = defineExecutor(quoteTool, {+ * async getQuote({ prefix }) {+ * const res = await fetch(`https://three.ws/api/vanity/bounties?view=quote&prefix=${prefix}`);* const data = await res.json();- * return { symbol, price: data.price };+ * return { prefix, tier: data.difficulty.tierLabel };* },* });*- * export const mcpTools = toMcpTools(priceTool, priceExecutor);+ * export const mcpTools = toMcpTools(quoteTool, quoteExecutor);* ```** See `README.md` in this package for the full API reference, permissiondiff --git a/packages/vanity/README.md b/packages/vanity/README.mdindex 2465bc4e4..a4ccb2701 100644--- a/packages/vanity/README.md+++ b/packages/vanity/README.md@@ -38,11 +38,11 @@Vanity grinding is embarrassingly parallel keypair generation: make an Ed25519keypair, Base58-encode the public key, check the prefix/suffix, repeat until a-hit. Keygen dominates the loop, and a single Node thread sustains roughly a-thousand keypairs per second on a typical cloud vCPU. A 4-char prefix expects-~11M attempts, which is hours at that rate, so the difficulty model matters as-much as the hot loop: you need to know what a pattern costs before you start,-not after.+hit. Keygen dominates the loop, and a single Node thread sustains a couple of+thousand keypairs per second (1,730/s measured on an idle cloud container). A+4-char prefix expects ~11M attempts, which is hours at that rate, so the+difficulty model matters as much as the hot loop: you need to know what a+pattern costs before you start, not after.`@three-ws/vanity` is that, done once:@@ -100,7 +100,9 @@ A fuller run — suffix, case-insensitive, live progress + ETA, cancellable:import { grind, expectedAttempts } from '@three-ws/vanity';const controller = new AbortController();-console.log('expected attempts:', expectedAttempts({ prefix: 'ag', suffix: 'nt' }));+// Quote the SAME options you are about to grind: ignoreCase changes the answer+// (here it divides the case-sensitive 11,316,496 by 16).+console.log('expected attempts:', expectedAttempts({ prefix: 'ag', suffix: 'nt', ignoreCase: true }));const result = await grind({prefix: 'ag',@@ -245,10 +247,10 @@ once, then the same batched hot loop runs on either.the event loop, so an `AbortSignal` lands within one batch and `onProgress`fires on a ~250ms wall-clock cadence.- **Single-threaded by design.** The local path runs on the calling thread;- `GrindResult.workers` is always `1`, and one thread sustains on the order of- a thousand keypairs per second (measured on a 2-core cloud container; a- desktop CPU does better). For long patterns, run several `grind()` calls in- your own worker threads or processes if you need parallelism. The hosted x402 endpoint caps patterns at 3 chars because it+ `GrindResult.workers` is always `1`, and one thread sustains roughly+ 1,000-4,000 keypairs per second depending on how busy the host is (1,730/s+ measured idle). For long patterns, run several `grind()` calls in your own+ worker threads or processes if you need parallelism. The hosted x402 endpoint caps patterns at 3 chars because itgrinds under a server-side wall-clock budget.## Securitydiff --git a/packages/vanity/src/index.js b/packages/vanity/src/index.jsindex 2dd7ccad2..bcd79796f 100644--- a/packages/vanity/src/index.js+++ b/packages/vanity/src/index.js@@ -427,7 +427,7 @@ const CLIENT_OPTION_KEYS = ['fetch', 'baseUrl', 'apiKey'];* (`fetch`, `baseUrl`, `apiKey`), in which case a client bound to those is* built for this call. Pass an x402-wrapped `fetch` to settle the 402.*- * @param {GrindViaApiOptions} params+ * @param {GrindViaApiStandaloneOptions} params* @returns {Promise<ApiResult>}*/export function grindViaApi(params = {}) {diff --git a/packages/x402-fetch/examples/discover.mjs b/packages/x402-fetch/examples/discover.mjsindex 2d777d2b3..b968883b4 100644--- a/packages/x402-fetch/examples/discover.mjs+++ b/packages/x402-fetch/examples/discover.mjs@@ -33,14 +33,19 @@ console.log(`\naccepts[] (${challenge.accepts.length} payment rails):\n`);for (const accept of challenge.accepts) {const decimals = Number(accept.extra?.decimals ?? 6);- const usd = Number(accept.amount) / 10 ** decimals;+ const token = accept.extra?.name ?? 'unknown';+ const units = Number(accept.amount) / 10 ** decimals;+ // Only a dollar-pegged stablecoin's atomic units convert straight to USD; a+ // non-stable accept (e.g. $THREE) is priced in its own token, so printing a+ // "$" in front of it would be a lie about what the call costs.+ const priced = /^usd/i.test(token) ? `$${units}` : `${units} ${token}`;const method =accept.extra?.assetTransferMethod ||(String(accept.network).startsWith('eip155:') ? 'eip3009 (default)' : 'native to network');console.log(` scheme: ${accept.scheme}`);console.log(` network: ${accept.network}`);- console.log(` asset: ${accept.asset} (${accept.extra?.name ?? 'unknown'})`);- console.log(` amount: ${accept.amount} atomic units = $${usd} (${decimals} decimals)`);+ console.log(` asset: ${accept.asset} (${token})`);+ console.log(` amount: ${accept.amount} atomic units = ${priced} (${decimals} decimals)`);console.log(` payTo: ${accept.payTo}`);console.log(` method: ${method}`);console.log('');diff --git a/public/mcp-catalog.json b/public/mcp-catalog.jsonindex 4a452e889..ff3ba3ae1 100644--- a/public/mcp-catalog.json+++ b/public/mcp-catalog.json@@ -7312,7 +7312,7 @@"agent_id": {"type": "string","minLength": 1,- "description": "The agent identity id to record the action under. Your token must own it."+ "description": "The agent identity uuid to record the action under. Your token must own it."},"type": {"type": "string",@@ -7371,7 +7371,7 @@"agent_id": {"type": "string","minLength": 1,- "description": "The agent identity id whose provenance trail to read. Your token must own it."+ "description": "The agent identity uuid whose provenance trail to read. Your token must own it."},"limit": {"type": "integer",@@ -7421,7 +7421,7 @@"agent_id": {"type": "string","minLength": 1,- "description": "The agent identity id that owns the action. Your token must own this agent."+ "description": "The agent identity uuid that owns the action. Your token must own this agent."},"id": {"type": "string",