@pickaxeproject/react 6.23.10 → 6.24.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/cjs/components/Pickaxe/Addons/Auth/hooks/useAuthBootstrap.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Document/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Document/hooks/useDocument.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeEmbedHead.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRender.js +1 -0
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.js +1 -0
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/VisualizationPart.js +1 -0
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/index.js +1 -1
- package/dist/cjs/components/Pickaxe/index.js +1 -1
- package/dist/cjs/hooks/pickaxe/usePickaxeAuth.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +1 -1
- package/dist/cjs/node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1 -1
- package/dist/cjs/src/components/Pickaxe/Provider.d.ts +3 -1
- package/dist/cjs/src/components/Pickaxe/common/PickaxeEmbedHead.d.ts +2 -1
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRender.d.ts +20 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.d.ts +116 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMessageParts/VisualizationPart.d.ts +15 -0
- package/dist/cjs/src/components/Pickaxe/index.d.ts +4 -1
- package/dist/cjs/src/hooks/pickaxe/usePickaxeAuth.d.ts +6 -0
- package/dist/cjs/src/hooks/pickaxe/usePickaxeContext.d.ts +2 -0
- package/dist/cjs/src/index.d.ts +1 -0
- package/dist/cjs/src/types/history.d.ts +30 -2
- package/dist/esm/components/Pickaxe/Addons/Auth/hooks/useAuthBootstrap.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Document/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Document/hooks/useDocument.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/esm/components/Pickaxe/Form/index.js +1 -1
- package/dist/esm/components/Pickaxe/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeEmbedHead.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRender.js +1 -0
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.js +1 -0
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/VisualizationPart.js +1 -0
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/index.js +1 -1
- package/dist/esm/components/Pickaxe/index.js +1 -1
- package/dist/esm/hooks/pickaxe/usePickaxeAuth.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +1 -1
- package/dist/esm/node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1 -1
- package/dist/esm/src/components/Pickaxe/Provider.d.ts +3 -1
- package/dist/esm/src/components/Pickaxe/common/PickaxeEmbedHead.d.ts +2 -1
- package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRender.d.ts +20 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.d.ts +116 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/VisualizationPart.d.ts +15 -0
- package/dist/esm/src/components/Pickaxe/index.d.ts +4 -1
- package/dist/esm/src/hooks/pickaxe/usePickaxeAuth.d.ts +6 -0
- package/dist/esm/src/hooks/pickaxe/usePickaxeContext.d.ts +2 -0
- package/dist/esm/src/index.d.ts +1 -0
- package/dist/esm/src/types/history.d.ts +30 -2
- package/package.json +4 -2
- package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +0 -1
- package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +0 -1
- package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +0 -1
- package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +0 -1
- package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +0 -1
- package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +0 -1
- package/dist/cjs/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +0 -1
- package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +0 -1
- package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +0 -1
- package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +0 -1
- package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +0 -1
- package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +0 -1
- package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +0 -1
- package/dist/esm/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{z as o}from"zod";const t=o.string().url().superRefine(((t,r)=>{if(!URL.canParse(t))return r.addIssue({code:o.ZodIssueCode.custom,message:"URL must be parseable",fatal:!0}),o.NEVER})).refine((o=>{const t=new URL(o);return"javascript:"!==t.protocol&&"data:"!==t.protocol&&"vbscript:"!==t.protocol}),{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),r=o.object({resource:o.string().url(),authorization_servers:o.array(t).optional(),jwks_uri:o.string().url().optional(),scopes_supported:o.array(o.string()).optional(),bearer_methods_supported:o.array(o.string()).optional(),resource_signing_alg_values_supported:o.array(o.string()).optional(),resource_name:o.string().optional(),resource_documentation:o.string().optional(),resource_policy_uri:o.string().url().optional(),resource_tos_uri:o.string().url().optional(),tls_client_certificate_bound_access_tokens:o.boolean().optional(),authorization_details_types_supported:o.array(o.string()).optional(),dpop_signing_alg_values_supported:o.array(o.string()).optional(),dpop_bound_access_tokens_required:o.boolean().optional()}).passthrough(),n=o.object({issuer:o.string(),authorization_endpoint:t,token_endpoint:t,registration_endpoint:t.optional(),scopes_supported:o.array(o.string()).optional(),response_types_supported:o.array(o.string()),response_modes_supported:o.array(o.string()).optional(),grant_types_supported:o.array(o.string()).optional(),token_endpoint_auth_methods_supported:o.array(o.string()).optional(),token_endpoint_auth_signing_alg_values_supported:o.array(o.string()).optional(),service_documentation:t.optional(),revocation_endpoint:t.optional(),revocation_endpoint_auth_methods_supported:o.array(o.string()).optional(),revocation_endpoint_auth_signing_alg_values_supported:o.array(o.string()).optional(),introspection_endpoint:o.string().optional(),introspection_endpoint_auth_methods_supported:o.array(o.string()).optional(),introspection_endpoint_auth_signing_alg_values_supported:o.array(o.string()).optional(),code_challenge_methods_supported:o.array(o.string()).optional()}).passthrough(),e=o.object({issuer:o.string(),authorization_endpoint:t,token_endpoint:t,userinfo_endpoint:t.optional(),jwks_uri:t,registration_endpoint:t.optional(),scopes_supported:o.array(o.string()).optional(),response_types_supported:o.array(o.string()),response_modes_supported:o.array(o.string()).optional(),grant_types_supported:o.array(o.string()).optional(),acr_values_supported:o.array(o.string()).optional(),subject_types_supported:o.array(o.string()),id_token_signing_alg_values_supported:o.array(o.string()),id_token_encryption_alg_values_supported:o.array(o.string()).optional(),id_token_encryption_enc_values_supported:o.array(o.string()).optional(),userinfo_signing_alg_values_supported:o.array(o.string()).optional(),userinfo_encryption_alg_values_supported:o.array(o.string()).optional(),userinfo_encryption_enc_values_supported:o.array(o.string()).optional(),request_object_signing_alg_values_supported:o.array(o.string()).optional(),request_object_encryption_alg_values_supported:o.array(o.string()).optional(),request_object_encryption_enc_values_supported:o.array(o.string()).optional(),token_endpoint_auth_methods_supported:o.array(o.string()).optional(),token_endpoint_auth_signing_alg_values_supported:o.array(o.string()).optional(),display_values_supported:o.array(o.string()).optional(),claim_types_supported:o.array(o.string()).optional(),claims_supported:o.array(o.string()).optional(),service_documentation:o.string().optional(),claims_locales_supported:o.array(o.string()).optional(),ui_locales_supported:o.array(o.string()).optional(),claims_parameter_supported:o.boolean().optional(),request_parameter_supported:o.boolean().optional(),request_uri_parameter_supported:o.boolean().optional(),require_request_uri_registration:o.boolean().optional(),op_policy_uri:t.optional(),op_tos_uri:t.optional()}).passthrough(),i=e.merge(n.pick({code_challenge_methods_supported:!0})),a=o.object({access_token:o.string(),id_token:o.string().optional(),token_type:o.string(),expires_in:o.number().optional(),scope:o.string().optional(),refresh_token:o.string().optional()}).strip(),s=o.object({error:o.string(),error_description:o.string().optional(),error_uri:o.string().optional()}),p=t.optional().or(o.literal("").transform((()=>{}))),_=o.object({redirect_uris:o.array(t),token_endpoint_auth_method:o.string().optional(),grant_types:o.array(o.string()).optional(),response_types:o.array(o.string()).optional(),client_name:o.string().optional(),client_uri:t.optional(),logo_uri:p,scope:o.string().optional(),contacts:o.array(o.string()).optional(),tos_uri:p,policy_uri:o.string().optional(),jwks_uri:t.optional(),jwks:o.any().optional(),software_id:o.string().optional(),software_version:o.string().optional(),software_statement:o.string().optional()}).strip(),l=o.object({client_id:o.string(),client_secret:o.string().optional(),client_id_issued_at:o.number().optional(),client_secret_expires_at:o.number().optional()}).strip(),u=_.merge(l);o.object({error:o.string(),error_description:o.string().optional()}).strip(),o.object({token:o.string(),token_type_hint:o.string().optional()}).strip();export{u as OAuthClientInformationFullSchema,l as OAuthClientInformationSchema,_ as OAuthClientMetadataSchema,s as OAuthErrorResponseSchema,n as OAuthMetadataSchema,r as OAuthProtectedResourceMetadataSchema,a as OAuthTokensSchema,i as OpenIdProviderDiscoveryMetadataSchema,e as OpenIdProviderMetadataSchema,p as OptionalSafeUrlSchema,t as SafeUrlSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{union as e,string as t,number as s,object as r,optional as o,literal as a,unknown as n,array as i,boolean as p,record as h,enum as d,discriminatedUnion as m}from"../../../../../../zod@3.25.76/node_modules/zod/v3/types.js";const u="2025-06-18",c=[u,"2025-03-26","2024-11-05","2024-10-07"],g="2.0",l=e([t(),s().int()]),x=t(),y=r({progressToken:o(l)}).passthrough(),f=r({_meta:o(y)}).passthrough(),b=r({method:t(),params:o(f)}),_=r({_meta:o(r({}).passthrough())}).passthrough(),v=r({method:t(),params:o(_)}),P=r({_meta:o(r({}).passthrough())}).passthrough(),T=e([t(),s().int()]),q=r({jsonrpc:a(g),id:T}).merge(b).strict(),C=e=>q.safeParse(e).success,I=r({jsonrpc:a(g)}).merge(v).strict(),j=e=>I.safeParse(e).success,E=r({jsonrpc:a(g),id:T,result:P}).strict(),S=e=>E.safeParse(e).success;var k;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(k||(k={}));const M=r({jsonrpc:a(g),id:T,error:r({code:s().int(),message:t(),data:o(n())})}).strict(),R=e=>M.safeParse(e).success,z=e([q,I,E,M]),H=P.strict(),w=v.extend({method:a("notifications/cancelled"),params:_.extend({requestId:T,reason:t().optional()})}),L=r({src:t(),mimeType:o(t()),sizes:o(i(t()))}).passthrough(),N=r({icons:i(L).optional()}).passthrough(),F=r({name:t(),title:o(t())}).passthrough(),U=F.extend({version:t(),websiteUrl:o(t())}).merge(N),V=r({experimental:o(r({}).passthrough()),sampling:o(r({}).passthrough()),elicitation:o(r({}).passthrough()),roots:o(r({listChanged:o(p())}).passthrough())}).passthrough(),W=b.extend({method:a("initialize"),params:f.extend({protocolVersion:t(),capabilities:V,clientInfo:U})}),$=r({experimental:o(r({}).passthrough()),logging:o(r({}).passthrough()),completions:o(r({}).passthrough()),prompts:o(r({listChanged:o(p())}).passthrough()),resources:o(r({subscribe:o(p()),listChanged:o(p())}).passthrough()),tools:o(r({listChanged:o(p())}).passthrough())}).passthrough(),B=P.extend({protocolVersion:t(),capabilities:$,serverInfo:U,instructions:o(t())}),O=v.extend({method:a("notifications/initialized")}),A=e=>O.safeParse(e).success,D=b.extend({method:a("ping")}),G=r({progress:s(),total:o(s()),message:o(t())}).passthrough(),J=v.extend({method:a("notifications/progress"),params:_.merge(G).extend({progressToken:l})}),K=b.extend({params:f.extend({cursor:o(x)}).optional()}),Q=P.extend({nextCursor:o(x)}),X=r({uri:t(),mimeType:o(t()),_meta:o(r({}).passthrough())}).passthrough(),Y=X.extend({text:t()}),Z=t().refine((e=>{try{return atob(e),!0}catch(e){return!1}}),{message:"Invalid Base64 string"}),ee=X.extend({blob:Z}),te=F.extend({uri:t(),description:o(t()),mimeType:o(t()),_meta:o(r({}).passthrough())}).merge(N),se=F.extend({uriTemplate:t(),description:o(t()),mimeType:o(t()),_meta:o(r({}).passthrough())}).merge(N),re=K.extend({method:a("resources/list")}),oe=Q.extend({resources:i(te)}),ae=K.extend({method:a("resources/templates/list")}),ne=Q.extend({resourceTemplates:i(se)}),ie=b.extend({method:a("resources/read"),params:f.extend({uri:t()})}),pe=P.extend({contents:i(e([Y,ee]))}),he=v.extend({method:a("notifications/resources/list_changed")}),de=b.extend({method:a("resources/subscribe"),params:f.extend({uri:t()})}),me=b.extend({method:a("resources/unsubscribe"),params:f.extend({uri:t()})}),ue=v.extend({method:a("notifications/resources/updated"),params:_.extend({uri:t()})}),ce=r({name:t(),description:o(t()),required:o(p())}).passthrough(),ge=F.extend({description:o(t()),arguments:o(i(ce)),_meta:o(r({}).passthrough())}).merge(N),le=K.extend({method:a("prompts/list")}),xe=Q.extend({prompts:i(ge)}),ye=b.extend({method:a("prompts/get"),params:f.extend({name:t(),arguments:o(h(t()))})}),fe=r({type:a("text"),text:t(),_meta:o(r({}).passthrough())}).passthrough(),be=r({type:a("image"),data:Z,mimeType:t(),_meta:o(r({}).passthrough())}).passthrough(),_e=r({type:a("audio"),data:Z,mimeType:t(),_meta:o(r({}).passthrough())}).passthrough(),ve=r({type:a("resource"),resource:e([Y,ee]),_meta:o(r({}).passthrough())}).passthrough(),Pe=te.extend({type:a("resource_link")}),Te=e([fe,be,_e,Pe,ve]),qe=r({role:d(["user","assistant"]),content:Te}).passthrough(),Ce=P.extend({description:o(t()),messages:i(qe)}),Ie=v.extend({method:a("notifications/prompts/list_changed")}),je=r({title:o(t()),readOnlyHint:o(p()),destructiveHint:o(p()),idempotentHint:o(p()),openWorldHint:o(p())}).passthrough(),Ee=F.extend({description:o(t()),inputSchema:r({type:a("object"),properties:o(r({}).passthrough()),required:o(i(t()))}).passthrough(),outputSchema:o(r({type:a("object"),properties:o(r({}).passthrough()),required:o(i(t()))}).passthrough()),annotations:o(je),_meta:o(r({}).passthrough())}).merge(N),Se=K.extend({method:a("tools/list")}),ke=Q.extend({tools:i(Ee)}),Me=P.extend({content:i(Te).default([]),structuredContent:r({}).passthrough().optional(),isError:o(p())});Me.or(P.extend({toolResult:n()}));const Re=b.extend({method:a("tools/call"),params:f.extend({name:t(),arguments:o(h(n()))})}),ze=v.extend({method:a("notifications/tools/list_changed")}),He=d(["debug","info","notice","warning","error","critical","alert","emergency"]),we=b.extend({method:a("logging/setLevel"),params:f.extend({level:He})}),Le=v.extend({method:a("notifications/message"),params:_.extend({level:He,logger:o(t()),data:n()})}),Ne=r({name:t().optional()}).passthrough(),Fe=r({hints:o(i(Ne)),costPriority:o(s().min(0).max(1)),speedPriority:o(s().min(0).max(1)),intelligencePriority:o(s().min(0).max(1))}).passthrough(),Ue=r({role:d(["user","assistant"]),content:e([fe,be,_e])}).passthrough(),Ve=b.extend({method:a("sampling/createMessage"),params:f.extend({messages:i(Ue),systemPrompt:o(t()),includeContext:o(d(["none","thisServer","allServers"])),temperature:o(s()),maxTokens:s().int(),stopSequences:o(i(t())),metadata:o(r({}).passthrough()),modelPreferences:o(Fe)})}),We=P.extend({model:t(),stopReason:o(d(["endTurn","stopSequence","maxTokens"]).or(t())),role:d(["user","assistant"]),content:m("type",[fe,be,_e])}),$e=r({type:a("boolean"),title:o(t()),description:o(t()),default:o(p())}).passthrough(),Be=r({type:a("string"),title:o(t()),description:o(t()),minLength:o(s()),maxLength:o(s()),format:o(d(["email","uri","date","date-time"]))}).passthrough(),Oe=r({type:d(["number","integer"]),title:o(t()),description:o(t()),minimum:o(s()),maximum:o(s())}).passthrough(),Ae=r({type:a("string"),title:o(t()),description:o(t()),enum:i(t()),enumNames:o(i(t()))}).passthrough(),De=e([$e,Be,Oe,Ae]),Ge=b.extend({method:a("elicitation/create"),params:f.extend({message:t(),requestedSchema:r({type:a("object"),properties:h(t(),De),required:o(i(t()))}).passthrough()})}),Je=P.extend({action:d(["accept","decline","cancel"]),content:o(h(t(),n()))}),Ke=r({type:a("ref/resource"),uri:t()}).passthrough(),Qe=r({type:a("ref/prompt"),name:t()}).passthrough(),Xe=b.extend({method:a("completion/complete"),params:f.extend({ref:e([Qe,Ke]),argument:r({name:t(),value:t()}).passthrough(),context:o(r({arguments:o(h(t(),t()))}))})}),Ye=P.extend({completion:r({values:i(t()).max(100),total:o(s().int()),hasMore:o(p())}).passthrough()}),Ze=r({uri:t().startsWith("file://"),name:o(t()),_meta:o(r({}).passthrough())}).passthrough(),et=b.extend({method:a("roots/list")}),tt=P.extend({roots:i(Ze)}),st=v.extend({method:a("notifications/roots/list_changed")});e([D,W,Xe,we,ye,le,re,ae,ie,de,me,Re,Se]),e([w,J,O,st]),e([H,We,Je,tt]),e([D,Ve,Ge,et]),e([w,J,Le,ue,he,ze,Ie]),e([H,B,Ye,Ce,xe,oe,ne,pe,Me,ke]);class rt extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`),this.code=e,this.data=s,this.name="McpError"}}export{_e as AudioContentSchema,F as BaseMetadataSchema,ee as BlobResourceContentsSchema,$e as BooleanSchemaSchema,Re as CallToolRequestSchema,Me as CallToolResultSchema,w as CancelledNotificationSchema,V as ClientCapabilitiesSchema,Xe as CompleteRequestSchema,Ye as CompleteResultSchema,Te as ContentBlockSchema,Ve as CreateMessageRequestSchema,We as CreateMessageResultSchema,x as CursorSchema,Ge as ElicitRequestSchema,Je as ElicitResultSchema,ve as EmbeddedResourceSchema,H as EmptyResultSchema,Ae as EnumSchemaSchema,k as ErrorCode,ye as GetPromptRequestSchema,Ce as GetPromptResultSchema,L as IconSchema,N as IconsSchema,be as ImageContentSchema,U as ImplementationSchema,W as InitializeRequestSchema,B as InitializeResultSchema,O as InitializedNotificationSchema,M as JSONRPCErrorSchema,z as JSONRPCMessageSchema,I as JSONRPCNotificationSchema,q as JSONRPCRequestSchema,E as JSONRPCResponseSchema,g as JSONRPC_VERSION,u as LATEST_PROTOCOL_VERSION,le as ListPromptsRequestSchema,xe as ListPromptsResultSchema,ae as ListResourceTemplatesRequestSchema,ne as ListResourceTemplatesResultSchema,re as ListResourcesRequestSchema,oe as ListResourcesResultSchema,et as ListRootsRequestSchema,tt as ListRootsResultSchema,Se as ListToolsRequestSchema,ke as ListToolsResultSchema,He as LoggingLevelSchema,Le as LoggingMessageNotificationSchema,rt as McpError,Ne as ModelHintSchema,Fe as ModelPreferencesSchema,v as NotificationSchema,Oe as NumberSchemaSchema,K as PaginatedRequestSchema,Q as PaginatedResultSchema,D as PingRequestSchema,De as PrimitiveSchemaDefinitionSchema,J as ProgressNotificationSchema,G as ProgressSchema,l as ProgressTokenSchema,ce as PromptArgumentSchema,Ie as PromptListChangedNotificationSchema,qe as PromptMessageSchema,Qe as PromptReferenceSchema,ge as PromptSchema,ie as ReadResourceRequestSchema,pe as ReadResourceResultSchema,T as RequestIdSchema,b as RequestSchema,X as ResourceContentsSchema,Pe as ResourceLinkSchema,he as ResourceListChangedNotificationSchema,te as ResourceSchema,Ke as ResourceTemplateReferenceSchema,se as ResourceTemplateSchema,ue as ResourceUpdatedNotificationSchema,P as ResultSchema,Ze as RootSchema,st as RootsListChangedNotificationSchema,c as SUPPORTED_PROTOCOL_VERSIONS,Ue as SamplingMessageSchema,$ as ServerCapabilitiesSchema,we as SetLevelRequestSchema,Be as StringSchemaSchema,de as SubscribeRequestSchema,fe as TextContentSchema,Y as TextResourceContentsSchema,je as ToolAnnotationsSchema,ze as ToolListChangedNotificationSchema,Ee as ToolSchema,me as UnsubscribeRequestSchema,A as isInitializedNotification,R as isJSONRPCError,j as isJSONRPCNotification,C as isJSONRPCRequest,S as isJSONRPCResponse};
|
|
1
|
+
import{z as t}from"zod";const e="2025-06-18",o=[e,"2025-03-26","2024-11-05","2024-10-07"],n="2.0",r=t.union([t.string(),t.number().int()]),a=t.string(),i=t.object({progressToken:t.optional(r)}).passthrough(),s=t.object({_meta:t.optional(i)}).passthrough(),l=t.object({method:t.string(),params:t.optional(s)}),p=t.object({_meta:t.optional(t.object({}).passthrough())}).passthrough(),c=t.object({method:t.string(),params:t.optional(p)}),u=t.object({_meta:t.optional(t.object({}).passthrough())}).passthrough(),g=t.union([t.string(),t.number().int()]),m=t.object({jsonrpc:t.literal(n),id:g}).merge(l).strict(),h=t=>m.safeParse(t).success,d=t.object({jsonrpc:t.literal(n)}).merge(c).strict(),b=t=>d.safeParse(t).success,x=t.object({jsonrpc:t.literal(n),id:g,result:u}).strict(),j=t=>x.safeParse(t).success;var y;!function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"}(y||(y={}));const f=t.object({jsonrpc:t.literal(n),id:g,error:t.object({code:t.number().int(),message:t.string(),data:t.optional(t.unknown())})}).strict(),_=t=>f.safeParse(t).success,v=t.union([m,d,x,f]),P=u.strict(),T=c.extend({method:t.literal("notifications/cancelled"),params:p.extend({requestId:g,reason:t.string().optional()})}),q=t.object({src:t.string(),mimeType:t.optional(t.string()),sizes:t.optional(t.array(t.string()))}).passthrough(),C=t.object({icons:t.array(q).optional()}).passthrough(),k=t.object({name:t.string(),title:t.optional(t.string())}).passthrough(),I=k.extend({version:t.string(),websiteUrl:t.optional(t.string())}).merge(C),w=t.object({experimental:t.optional(t.object({}).passthrough()),sampling:t.optional(t.object({}).passthrough()),elicitation:t.optional(t.object({}).passthrough()),roots:t.optional(t.object({listChanged:t.optional(t.boolean())}).passthrough())}).passthrough(),E=l.extend({method:t.literal("initialize"),params:s.extend({protocolVersion:t.string(),capabilities:w,clientInfo:I})}),S=t.object({experimental:t.optional(t.object({}).passthrough()),logging:t.optional(t.object({}).passthrough()),completions:t.optional(t.object({}).passthrough()),prompts:t.optional(t.object({listChanged:t.optional(t.boolean())}).passthrough()),resources:t.optional(t.object({subscribe:t.optional(t.boolean()),listChanged:t.optional(t.boolean())}).passthrough()),tools:t.optional(t.object({listChanged:t.optional(t.boolean())}).passthrough())}).passthrough(),M=u.extend({protocolVersion:t.string(),capabilities:S,serverInfo:I,instructions:t.optional(t.string())}),R=c.extend({method:t.literal("notifications/initialized")}),z=t=>R.safeParse(t).success,H=l.extend({method:t.literal("ping")}),L=t.object({progress:t.number(),total:t.optional(t.number()),message:t.optional(t.string())}).passthrough(),N=c.extend({method:t.literal("notifications/progress"),params:p.merge(L).extend({progressToken:r})}),F=l.extend({params:s.extend({cursor:t.optional(a)}).optional()}),U=u.extend({nextCursor:t.optional(a)}),V=t.object({uri:t.string(),mimeType:t.optional(t.string()),_meta:t.optional(t.object({}).passthrough())}).passthrough(),W=V.extend({text:t.string()}),$=t.string().refine((t=>{try{return atob(t),!0}catch(t){return!1}}),{message:"Invalid Base64 string"}),B=V.extend({blob:$}),O=k.extend({uri:t.string(),description:t.optional(t.string()),mimeType:t.optional(t.string()),_meta:t.optional(t.object({}).passthrough())}).merge(C),A=k.extend({uriTemplate:t.string(),description:t.optional(t.string()),mimeType:t.optional(t.string()),_meta:t.optional(t.object({}).passthrough())}).merge(C),D=F.extend({method:t.literal("resources/list")}),G=U.extend({resources:t.array(O)}),J=F.extend({method:t.literal("resources/templates/list")}),K=U.extend({resourceTemplates:t.array(A)}),Q=l.extend({method:t.literal("resources/read"),params:s.extend({uri:t.string()})}),X=u.extend({contents:t.array(t.union([W,B]))}),Y=c.extend({method:t.literal("notifications/resources/list_changed")}),Z=l.extend({method:t.literal("resources/subscribe"),params:s.extend({uri:t.string()})}),tt=l.extend({method:t.literal("resources/unsubscribe"),params:s.extend({uri:t.string()})}),et=c.extend({method:t.literal("notifications/resources/updated"),params:p.extend({uri:t.string()})}),ot=t.object({name:t.string(),description:t.optional(t.string()),required:t.optional(t.boolean())}).passthrough(),nt=k.extend({description:t.optional(t.string()),arguments:t.optional(t.array(ot)),_meta:t.optional(t.object({}).passthrough())}).merge(C),rt=F.extend({method:t.literal("prompts/list")}),at=U.extend({prompts:t.array(nt)}),it=l.extend({method:t.literal("prompts/get"),params:s.extend({name:t.string(),arguments:t.optional(t.record(t.string()))})}),st=t.object({type:t.literal("text"),text:t.string(),_meta:t.optional(t.object({}).passthrough())}).passthrough(),lt=t.object({type:t.literal("image"),data:$,mimeType:t.string(),_meta:t.optional(t.object({}).passthrough())}).passthrough(),pt=t.object({type:t.literal("audio"),data:$,mimeType:t.string(),_meta:t.optional(t.object({}).passthrough())}).passthrough(),ct=t.object({type:t.literal("resource"),resource:t.union([W,B]),_meta:t.optional(t.object({}).passthrough())}).passthrough(),ut=O.extend({type:t.literal("resource_link")}),gt=t.union([st,lt,pt,ut,ct]),mt=t.object({role:t.enum(["user","assistant"]),content:gt}).passthrough(),ht=u.extend({description:t.optional(t.string()),messages:t.array(mt)}),dt=c.extend({method:t.literal("notifications/prompts/list_changed")}),bt=t.object({title:t.optional(t.string()),readOnlyHint:t.optional(t.boolean()),destructiveHint:t.optional(t.boolean()),idempotentHint:t.optional(t.boolean()),openWorldHint:t.optional(t.boolean())}).passthrough(),xt=k.extend({description:t.optional(t.string()),inputSchema:t.object({type:t.literal("object"),properties:t.optional(t.object({}).passthrough()),required:t.optional(t.array(t.string()))}).passthrough(),outputSchema:t.optional(t.object({type:t.literal("object"),properties:t.optional(t.object({}).passthrough()),required:t.optional(t.array(t.string()))}).passthrough()),annotations:t.optional(bt),_meta:t.optional(t.object({}).passthrough())}).merge(C),jt=F.extend({method:t.literal("tools/list")}),yt=U.extend({tools:t.array(xt)}),ft=u.extend({content:t.array(gt).default([]),structuredContent:t.object({}).passthrough().optional(),isError:t.optional(t.boolean())});ft.or(u.extend({toolResult:t.unknown()}));const _t=l.extend({method:t.literal("tools/call"),params:s.extend({name:t.string(),arguments:t.optional(t.record(t.unknown()))})}),vt=c.extend({method:t.literal("notifications/tools/list_changed")}),Pt=t.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Tt=l.extend({method:t.literal("logging/setLevel"),params:s.extend({level:Pt})}),qt=c.extend({method:t.literal("notifications/message"),params:p.extend({level:Pt,logger:t.optional(t.string()),data:t.unknown()})}),Ct=t.object({name:t.string().optional()}).passthrough(),kt=t.object({hints:t.optional(t.array(Ct)),costPriority:t.optional(t.number().min(0).max(1)),speedPriority:t.optional(t.number().min(0).max(1)),intelligencePriority:t.optional(t.number().min(0).max(1))}).passthrough(),It=t.object({role:t.enum(["user","assistant"]),content:t.union([st,lt,pt])}).passthrough(),wt=l.extend({method:t.literal("sampling/createMessage"),params:s.extend({messages:t.array(It),systemPrompt:t.optional(t.string()),includeContext:t.optional(t.enum(["none","thisServer","allServers"])),temperature:t.optional(t.number()),maxTokens:t.number().int(),stopSequences:t.optional(t.array(t.string())),metadata:t.optional(t.object({}).passthrough()),modelPreferences:t.optional(kt)})}),Et=u.extend({model:t.string(),stopReason:t.optional(t.enum(["endTurn","stopSequence","maxTokens"]).or(t.string())),role:t.enum(["user","assistant"]),content:t.discriminatedUnion("type",[st,lt,pt])}),St=t.object({type:t.literal("boolean"),title:t.optional(t.string()),description:t.optional(t.string()),default:t.optional(t.boolean())}).passthrough(),Mt=t.object({type:t.literal("string"),title:t.optional(t.string()),description:t.optional(t.string()),minLength:t.optional(t.number()),maxLength:t.optional(t.number()),format:t.optional(t.enum(["email","uri","date","date-time"]))}).passthrough(),Rt=t.object({type:t.enum(["number","integer"]),title:t.optional(t.string()),description:t.optional(t.string()),minimum:t.optional(t.number()),maximum:t.optional(t.number())}).passthrough(),zt=t.object({type:t.literal("string"),title:t.optional(t.string()),description:t.optional(t.string()),enum:t.array(t.string()),enumNames:t.optional(t.array(t.string()))}).passthrough(),Ht=t.union([St,Mt,Rt,zt]),Lt=l.extend({method:t.literal("elicitation/create"),params:s.extend({message:t.string(),requestedSchema:t.object({type:t.literal("object"),properties:t.record(t.string(),Ht),required:t.optional(t.array(t.string()))}).passthrough()})}),Nt=u.extend({action:t.enum(["accept","decline","cancel"]),content:t.optional(t.record(t.string(),t.unknown()))}),Ft=t.object({type:t.literal("ref/resource"),uri:t.string()}).passthrough(),Ut=t.object({type:t.literal("ref/prompt"),name:t.string()}).passthrough(),Vt=l.extend({method:t.literal("completion/complete"),params:s.extend({ref:t.union([Ut,Ft]),argument:t.object({name:t.string(),value:t.string()}).passthrough(),context:t.optional(t.object({arguments:t.optional(t.record(t.string(),t.string()))}))})}),Wt=u.extend({completion:t.object({values:t.array(t.string()).max(100),total:t.optional(t.number().int()),hasMore:t.optional(t.boolean())}).passthrough()}),$t=t.object({uri:t.string().startsWith("file://"),name:t.optional(t.string()),_meta:t.optional(t.object({}).passthrough())}).passthrough(),Bt=l.extend({method:t.literal("roots/list")}),Ot=u.extend({roots:t.array($t)}),At=c.extend({method:t.literal("notifications/roots/list_changed")});t.union([H,E,Vt,Tt,it,rt,D,J,Q,Z,tt,_t,jt]),t.union([T,N,R,At]),t.union([P,Et,Nt,Ot]),t.union([H,wt,Lt,Bt]),t.union([T,N,qt,et,Y,vt,dt]),t.union([P,M,Wt,ht,at,G,K,X,ft,yt]);class Dt extends Error{constructor(t,e,o){super(`MCP error ${t}: ${e}`),this.code=t,this.data=o,this.name="McpError"}}export{pt as AudioContentSchema,k as BaseMetadataSchema,B as BlobResourceContentsSchema,St as BooleanSchemaSchema,_t as CallToolRequestSchema,ft as CallToolResultSchema,T as CancelledNotificationSchema,w as ClientCapabilitiesSchema,Vt as CompleteRequestSchema,Wt as CompleteResultSchema,gt as ContentBlockSchema,wt as CreateMessageRequestSchema,Et as CreateMessageResultSchema,a as CursorSchema,Lt as ElicitRequestSchema,Nt as ElicitResultSchema,ct as EmbeddedResourceSchema,P as EmptyResultSchema,zt as EnumSchemaSchema,y as ErrorCode,it as GetPromptRequestSchema,ht as GetPromptResultSchema,q as IconSchema,C as IconsSchema,lt as ImageContentSchema,I as ImplementationSchema,E as InitializeRequestSchema,M as InitializeResultSchema,R as InitializedNotificationSchema,f as JSONRPCErrorSchema,v as JSONRPCMessageSchema,d as JSONRPCNotificationSchema,m as JSONRPCRequestSchema,x as JSONRPCResponseSchema,n as JSONRPC_VERSION,e as LATEST_PROTOCOL_VERSION,rt as ListPromptsRequestSchema,at as ListPromptsResultSchema,J as ListResourceTemplatesRequestSchema,K as ListResourceTemplatesResultSchema,D as ListResourcesRequestSchema,G as ListResourcesResultSchema,Bt as ListRootsRequestSchema,Ot as ListRootsResultSchema,jt as ListToolsRequestSchema,yt as ListToolsResultSchema,Pt as LoggingLevelSchema,qt as LoggingMessageNotificationSchema,Dt as McpError,Ct as ModelHintSchema,kt as ModelPreferencesSchema,c as NotificationSchema,Rt as NumberSchemaSchema,F as PaginatedRequestSchema,U as PaginatedResultSchema,H as PingRequestSchema,Ht as PrimitiveSchemaDefinitionSchema,N as ProgressNotificationSchema,L as ProgressSchema,r as ProgressTokenSchema,ot as PromptArgumentSchema,dt as PromptListChangedNotificationSchema,mt as PromptMessageSchema,Ut as PromptReferenceSchema,nt as PromptSchema,Q as ReadResourceRequestSchema,X as ReadResourceResultSchema,g as RequestIdSchema,l as RequestSchema,V as ResourceContentsSchema,ut as ResourceLinkSchema,Y as ResourceListChangedNotificationSchema,O as ResourceSchema,Ft as ResourceTemplateReferenceSchema,A as ResourceTemplateSchema,et as ResourceUpdatedNotificationSchema,u as ResultSchema,$t as RootSchema,At as RootsListChangedNotificationSchema,o as SUPPORTED_PROTOCOL_VERSIONS,It as SamplingMessageSchema,S as ServerCapabilitiesSchema,Tt as SetLevelRequestSchema,Mt as StringSchemaSchema,Z as SubscribeRequestSchema,st as TextContentSchema,W as TextResourceContentsSchema,bt as ToolAnnotationsSchema,vt as ToolListChangedNotificationSchema,xt as ToolSchema,tt as UnsubscribeRequestSchema,z as isInitializedNotification,_ as isJSONRPCError,b as isJSONRPCNotification,h as isJSONRPCRequest,j as isJSONRPCResponse};
|
|
@@ -86,6 +86,7 @@ export type AccessGroup = {
|
|
|
86
86
|
};
|
|
87
87
|
type PickaxeContextType = {
|
|
88
88
|
renderResponseAction?: PickaxeResponseActionRenderer;
|
|
89
|
+
renderEmbedHeaderAction?: () => ReactNode;
|
|
89
90
|
origin: PickaxeHistoryOriginType;
|
|
90
91
|
contextId: string;
|
|
91
92
|
pickaxeId: string;
|
|
@@ -154,6 +155,7 @@ type PickaxeContextType = {
|
|
|
154
155
|
};
|
|
155
156
|
export interface IPickaxeProviderProps {
|
|
156
157
|
renderResponseAction?: PickaxeResponseActionRenderer;
|
|
158
|
+
renderEmbedHeaderAction?: () => ReactNode;
|
|
157
159
|
children: ReactNode;
|
|
158
160
|
origin: PickaxeHistoryOriginType;
|
|
159
161
|
sender?: string;
|
|
@@ -191,5 +193,5 @@ export interface IPickaxeProviderProps {
|
|
|
191
193
|
onSessionIdChange?: (sessionId: string) => void;
|
|
192
194
|
}
|
|
193
195
|
export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
|
|
194
|
-
export declare const PickaxeProvider: ({ children, renderResponseAction, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, mcpGuestId, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
196
|
+
export declare const PickaxeProvider: ({ children, renderResponseAction, renderEmbedHeaderAction, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, mcpGuestId, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
195
197
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
interface PickaxeEmbedHeadProps {
|
|
2
2
|
className?: string;
|
|
3
|
+
showHeaderAction?: boolean;
|
|
3
4
|
iconClassName?: string;
|
|
4
5
|
historyBtnTip?: string;
|
|
5
6
|
onIconClick?: () => void;
|
|
6
7
|
onHistoryClick?: () => void;
|
|
7
8
|
}
|
|
8
|
-
declare const PickaxeEmbedHead: ({ className, iconClassName, historyBtnTip, onIconClick, onHistoryClick, }: PickaxeEmbedHeadProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
declare const PickaxeEmbedHead: ({ className, showHeaderAction, iconClassName, historyBtnTip, onIconClick, onHistoryClick, }: PickaxeEmbedHeadProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
export default PickaxeEmbedHead;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type JsonRenderElement = {
|
|
2
|
+
type: string;
|
|
3
|
+
props: Record<string, unknown>;
|
|
4
|
+
children: string[];
|
|
5
|
+
visible?: unknown;
|
|
6
|
+
on?: Record<string, JsonRenderActionBinding>;
|
|
7
|
+
};
|
|
8
|
+
type JsonRenderActionBinding = {
|
|
9
|
+
action: "setState" | "pushState" | "removeState";
|
|
10
|
+
params: Record<string, unknown>;
|
|
11
|
+
};
|
|
12
|
+
export type JsonRenderSpec = {
|
|
13
|
+
root: string;
|
|
14
|
+
elements: Record<string, JsonRenderElement>;
|
|
15
|
+
state?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
export declare const PickaxeJsonRender: ({ spec }: {
|
|
18
|
+
spec: JsonRenderSpec;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
package/dist/esm/src/components/Pickaxe/common/PickaxeMessageParts/PickaxeJsonRenderCatalog.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export declare const PICKAXE_JSON_RENDER_CATALOG: {
|
|
2
|
+
readonly Column: {
|
|
3
|
+
readonly container: true;
|
|
4
|
+
readonly description: "Vertical stack layout";
|
|
5
|
+
};
|
|
6
|
+
readonly Row: {
|
|
7
|
+
readonly container: true;
|
|
8
|
+
readonly description: "Wrapping horizontal layout";
|
|
9
|
+
};
|
|
10
|
+
readonly Grid: {
|
|
11
|
+
readonly container: true;
|
|
12
|
+
readonly description: "Responsive grid layout";
|
|
13
|
+
};
|
|
14
|
+
readonly Card: {
|
|
15
|
+
readonly container: true;
|
|
16
|
+
readonly description: "Elevated content group";
|
|
17
|
+
};
|
|
18
|
+
readonly Section: {
|
|
19
|
+
readonly container: true;
|
|
20
|
+
readonly description: "Titled content section";
|
|
21
|
+
};
|
|
22
|
+
readonly Accordion: {
|
|
23
|
+
readonly container: true;
|
|
24
|
+
readonly description: "Collapsible content section";
|
|
25
|
+
};
|
|
26
|
+
readonly Text: {
|
|
27
|
+
readonly container: false;
|
|
28
|
+
readonly description: "Body or caption text";
|
|
29
|
+
};
|
|
30
|
+
readonly Heading: {
|
|
31
|
+
readonly container: false;
|
|
32
|
+
readonly description: "Semantic heading";
|
|
33
|
+
};
|
|
34
|
+
readonly Divider: {
|
|
35
|
+
readonly container: false;
|
|
36
|
+
readonly description: "Visual separator";
|
|
37
|
+
};
|
|
38
|
+
readonly Spacer: {
|
|
39
|
+
readonly container: false;
|
|
40
|
+
readonly description: "Responsive empty space";
|
|
41
|
+
};
|
|
42
|
+
readonly Badge: {
|
|
43
|
+
readonly container: false;
|
|
44
|
+
readonly description: "Compact status label";
|
|
45
|
+
};
|
|
46
|
+
readonly Alert: {
|
|
47
|
+
readonly container: false;
|
|
48
|
+
readonly description: "Highlighted message";
|
|
49
|
+
};
|
|
50
|
+
readonly Image: {
|
|
51
|
+
readonly container: false;
|
|
52
|
+
readonly description: "Remote image with alt text";
|
|
53
|
+
};
|
|
54
|
+
readonly Link: {
|
|
55
|
+
readonly container: false;
|
|
56
|
+
readonly description: "Safe external link";
|
|
57
|
+
};
|
|
58
|
+
readonly List: {
|
|
59
|
+
readonly container: false;
|
|
60
|
+
readonly description: "Ordered or unordered text list";
|
|
61
|
+
};
|
|
62
|
+
readonly Table: {
|
|
63
|
+
readonly container: false;
|
|
64
|
+
readonly description: "Tabular records with columns";
|
|
65
|
+
};
|
|
66
|
+
readonly NumberInput: {
|
|
67
|
+
readonly container: false;
|
|
68
|
+
readonly description: "Bound numeric input";
|
|
69
|
+
};
|
|
70
|
+
readonly Slider: {
|
|
71
|
+
readonly container: false;
|
|
72
|
+
readonly description: "Bound numeric range input";
|
|
73
|
+
};
|
|
74
|
+
readonly TextInput: {
|
|
75
|
+
readonly container: false;
|
|
76
|
+
readonly description: "Bound single-line text input";
|
|
77
|
+
};
|
|
78
|
+
readonly TextArea: {
|
|
79
|
+
readonly container: false;
|
|
80
|
+
readonly description: "Bound multiline text input";
|
|
81
|
+
};
|
|
82
|
+
readonly Select: {
|
|
83
|
+
readonly container: false;
|
|
84
|
+
readonly description: "Bound option selector";
|
|
85
|
+
};
|
|
86
|
+
readonly Checkbox: {
|
|
87
|
+
readonly container: false;
|
|
88
|
+
readonly description: "Bound boolean checkbox";
|
|
89
|
+
};
|
|
90
|
+
readonly Toggle: {
|
|
91
|
+
readonly container: false;
|
|
92
|
+
readonly description: "Bound boolean switch";
|
|
93
|
+
};
|
|
94
|
+
readonly Button: {
|
|
95
|
+
readonly container: false;
|
|
96
|
+
readonly description: "Local state action button";
|
|
97
|
+
};
|
|
98
|
+
readonly Tabs: {
|
|
99
|
+
readonly container: false;
|
|
100
|
+
readonly description: "Bound tab selector";
|
|
101
|
+
};
|
|
102
|
+
readonly Metric: {
|
|
103
|
+
readonly container: false;
|
|
104
|
+
readonly description: "Key performance indicator";
|
|
105
|
+
};
|
|
106
|
+
readonly ProgressBar: {
|
|
107
|
+
readonly container: false;
|
|
108
|
+
readonly description: "Progress toward a maximum";
|
|
109
|
+
};
|
|
110
|
+
readonly Chart: {
|
|
111
|
+
readonly container: false;
|
|
112
|
+
readonly description: "Bar, line, area, scatter, pie, or labeled ternary positioning chart";
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export type PickaxeJsonRenderComponentType = keyof typeof PICKAXE_JSON_RENDER_CATALOG;
|
|
116
|
+
export declare const PICKAXE_JSON_RENDER_COMPONENT_TYPES: Set<string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PickaxeVisualizationData } from "../../../../types/history";
|
|
2
|
+
type VisualizationResult = {
|
|
3
|
+
data: PickaxeVisualizationData;
|
|
4
|
+
error?: never;
|
|
5
|
+
} | {
|
|
6
|
+
data?: never;
|
|
7
|
+
error: string;
|
|
8
|
+
fallbackText: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const parseVisualizationPart: (content: string) => VisualizationResult;
|
|
12
|
+
declare const VisualizationPart: ({ content }: {
|
|
13
|
+
content: string;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default VisualizationPart;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
export interface PickaxeProps {
|
|
2
3
|
pickaxeId: string;
|
|
3
4
|
className?: string;
|
|
5
|
+
/** In-embed navigation content. The chat stays mounted while this view is shown. */
|
|
6
|
+
embedView?: ReactNode;
|
|
4
7
|
}
|
|
5
|
-
export declare const Pickaxe: ({ pickaxeId: _pickaxeId, className }: PickaxeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export declare const Pickaxe: ({ pickaxeId: _pickaxeId, className, embedView, }: PickaxeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const usePickaxeContext: () => {
|
|
2
3
|
renderResponseAction?: import("../../components/Pickaxe/Provider").PickaxeResponseActionRenderer | undefined;
|
|
4
|
+
renderEmbedHeaderAction?: (() => import("react").ReactNode) | undefined;
|
|
3
5
|
origin: import("../../types/history").PickaxeHistoryOriginType;
|
|
4
6
|
contextId: string;
|
|
5
7
|
pickaxeId: string;
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./hooks/pickaxe/useConversation";
|
|
|
15
15
|
export * from "./hooks/pickaxe/useHistory";
|
|
16
16
|
export * from "./hooks/pickaxe/usePickaxe";
|
|
17
17
|
export * from "./hooks/pickaxe/usePickaxeContext";
|
|
18
|
+
export * from "./hooks/pickaxe/usePickaxeAuth";
|
|
18
19
|
export * from "./hooks/pickaxe/useResponseContext";
|
|
19
20
|
export * from "./hooks/pickaxe/useDimensionContext";
|
|
20
21
|
export * from "./hooks/pickaxe/useSubmitDocument";
|
|
@@ -40,7 +40,7 @@ export type PickaxeHistoryMessage = {
|
|
|
40
40
|
createdAt: string;
|
|
41
41
|
area?: PickaxeHistoryMessageArea;
|
|
42
42
|
};
|
|
43
|
-
export type PickaxeHistoryMessagePartsType = "text" | "reasoning" | "data-action-tool-caption" | "data-reasoning-caption" | "data-tool-assets" | "data-action-approval";
|
|
43
|
+
export type PickaxeHistoryMessagePartsType = "text" | "reasoning" | "data-action-tool-caption" | "data-reasoning-caption" | "data-tool-assets" | "data-visualization" | "data-action-approval";
|
|
44
44
|
export type PickaxeHistoryMessagePart = {
|
|
45
45
|
type: PickaxeHistoryMessagePartsType;
|
|
46
46
|
content: string;
|
|
@@ -73,10 +73,38 @@ export type PickaxeHistoryStreamDataReasoningCaption = {
|
|
|
73
73
|
caption: string;
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
+
export type PickaxeVisualizationData = {
|
|
77
|
+
visualizationId: string;
|
|
78
|
+
title: string;
|
|
79
|
+
fallbackText: string;
|
|
80
|
+
protocol: "json-render";
|
|
81
|
+
protocolVersion: "0.21";
|
|
82
|
+
surfaceId: string;
|
|
83
|
+
status: "ready" | "error";
|
|
84
|
+
spec: {
|
|
85
|
+
root: string;
|
|
86
|
+
elements: Record<string, {
|
|
87
|
+
type: string;
|
|
88
|
+
props: Record<string, unknown>;
|
|
89
|
+
children: string[];
|
|
90
|
+
visible?: unknown;
|
|
91
|
+
}>;
|
|
92
|
+
state?: Record<string, unknown>;
|
|
93
|
+
};
|
|
94
|
+
errors?: Array<{
|
|
95
|
+
code: string;
|
|
96
|
+
path: string;
|
|
97
|
+
message: string;
|
|
98
|
+
}>;
|
|
99
|
+
};
|
|
100
|
+
export type PickaxeHistoryStreamDataVisualization = {
|
|
101
|
+
type: "data-visualization";
|
|
102
|
+
data: PickaxeVisualizationData;
|
|
103
|
+
};
|
|
76
104
|
export type PickaxeHistoryStreamDataActionApproval = {
|
|
77
105
|
type: "data-action-approval";
|
|
78
106
|
data: ActionApprovalData;
|
|
79
107
|
};
|
|
80
|
-
export type PickaxeHistoryStreamData = PickaxeHistoryStreamDataActionApproval | PickaxeHistoryStreamDataActionToolCaption | PickaxeHistoryStreamDataReasoningCaption;
|
|
108
|
+
export type PickaxeHistoryStreamData = PickaxeHistoryStreamDataActionApproval | PickaxeHistoryStreamDataActionToolCaption | PickaxeHistoryStreamDataReasoningCaption | PickaxeHistoryStreamDataVisualization;
|
|
81
109
|
export type PickaxeHistoryStream = PickaxeHistoryStreamPartStartEnd | PickaxeHistoryStreamPartDelta | PickaxeHistoryStreamFinish | PickaxeHistoryStreamData;
|
|
82
110
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pickaxeproject/react",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.24.0",
|
|
4
4
|
"description": "Client utility library for Pickaxe",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.20.7",
|
|
39
|
+
"@json-render/core": "0.1.0",
|
|
39
40
|
"@modelcontextprotocol/sdk": "1.20.2",
|
|
40
41
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
41
42
|
"franc-min": "^6.2.0",
|
|
@@ -43,7 +44,8 @@
|
|
|
43
44
|
"lucide-react": "^0.563.0",
|
|
44
45
|
"pkce-challenge": "3.0.0",
|
|
45
46
|
"remove-markdown": "^0.6.3",
|
|
46
|
-
"tldts": "^7.0.23"
|
|
47
|
+
"tldts": "^7.0.23",
|
|
48
|
+
"zod": "3.25.76"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
51
|
"@babel/core": "^7.20.12",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("./helpers/util.js");const e=s.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class t extends Error{get errors(){return this.issues}constructor(s){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=s}format(s){const e=s||function(s){return s.message},t={_errors:[]},r=s=>{for(const i of s.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)t._errors.push(e(i));else{let s=t,r=0;for(;r<i.path.length;){const t=i.path[r];r===i.path.length-1?(s[t]=s[t]||{_errors:[]},s[t]._errors.push(e(i))):s[t]=s[t]||{_errors:[]},s=s[t],r++}}};return r(this),t}static assert(s){if(!(s instanceof t))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(s=s=>s.message){const e={},t=[];for(const r of this.issues)if(r.path.length>0){const t=r.path[0];e[t]=e[t]||[],e[t].push(s(r))}else t.push(s(r));return{formErrors:t,fieldErrors:e}}get formErrors(){return this.flatten()}}t.create=s=>new t(s),exports.ZodError=t,exports.ZodIssueCode=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./locales/en.js");let r=e.default;exports.defaultErrorMap=e.default,exports.getErrorMap=function(){return r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.errorUtil=void 0,(e=exports.errorUtil||(exports.errorUtil={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../errors.js"),e=require("../locales/en.js");const s=t=>{const{data:e,path:s,errorMaps:a,issueData:r}=t,o=[...s,...r.path||[]],u={...r,path:o};if(void 0!==r.message)return{...r,path:o,message:r.message};let i="";const n=a.filter((t=>!!t)).slice().reverse();for(const t of n)i=t(u,{data:e,defaultError:i}).message;return{...r,path:o,message:i}};class a{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,e){const s=[];for(const a of e){if("aborted"===a.status)return r;"dirty"===a.status&&t.dirty(),s.push(a.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,e){const s=[];for(const t of e){const e=await t.key,a=await t.value;s.push({key:e,value:a})}return a.mergeObjectSync(t,s)}static mergeObjectSync(t,e){const s={};for(const a of e){const{key:e,value:o}=a;if("aborted"===e.status)return r;if("aborted"===o.status)return r;"dirty"===e.status&&t.dirty(),"dirty"===o.status&&t.dirty(),"__proto__"===e.value||void 0===o.value&&!a.alwaysSet||(s[e.value]=o.value)}return{status:t.value,value:s}}}const r=Object.freeze({status:"aborted"});exports.DIRTY=t=>({status:"dirty",value:t}),exports.INVALID=r,exports.OK=t=>({status:"valid",value:t}),exports.ParseStatus=a,exports.addIssueToContext=function(a,r){const o=t.getErrorMap(),u=s({issueData:r,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,o,o===e.default?void 0:e.default].filter((t=>!!t))});a.common.issues.push(u)},exports.isAborted=t=>"aborted"===t.status,exports.isAsync=t=>"undefined"!=typeof Promise&&t instanceof Promise,exports.isDirty=t=>"dirty"===t.status,exports.isValid=t=>"valid"===t.status,exports.makeIssue=s;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.util=void 0,(e=exports.util||(exports.util={})).assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,exports.objectUtil=void 0,(exports.objectUtil||(exports.objectUtil={})).mergeShapes=(e,t)=>({...e,...t});const t=exports.util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);exports.ZodParsedType=t,exports.getParsedType=e=>{switch(typeof e){case"undefined":return t.undefined;case"string":return t.string;case"number":return Number.isNaN(e)?t.nan:t.number;case"boolean":return t.boolean;case"function":return t.function;case"bigint":return t.bigint;case"symbol":return t.symbol;case"object":return Array.isArray(e)?t.array:null===e?t.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.promise:"undefined"!=typeof Map&&e instanceof Map?t.map:"undefined"!=typeof Set&&e instanceof Set?t.set:"undefined"!=typeof Date&&e instanceof Date?t.date:t.object;default:return t.unknown}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../ZodError.js"),t=require("../helpers/util.js");var a=(a,i)=>{let n;switch(a.code){case e.ZodIssueCode.invalid_type:n=a.received===t.ZodParsedType.undefined?"Required":`Expected ${a.expected}, received ${a.received}`;break;case e.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(a.expected,t.util.jsonStringifyReplacer)}`;break;case e.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${t.util.joinValues(a.keys,", ")}`;break;case e.ZodIssueCode.invalid_union:n="Invalid input";break;case e.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${t.util.joinValues(a.options)}`;break;case e.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${t.util.joinValues(a.options)}, received '${a.received}'`;break;case e.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case e.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case e.ZodIssueCode.invalid_date:n="Invalid date";break;case e.ZodIssueCode.invalid_string:"object"==typeof a.validation?"includes"in a.validation?(n=`Invalid input: must include "${a.validation.includes}"`,"number"==typeof a.validation.position&&(n=`${n} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?n=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?n=`Invalid input: must end with "${a.validation.endsWith}"`:t.util.assertNever(a.validation):n="regex"!==a.validation?`Invalid ${a.validation}`:"Invalid";break;case e.ZodIssueCode.too_small:n="array"===a.type?`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:"string"===a.type?`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:"number"===a.type||"bigint"===a.type?`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:"date"===a.type?`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:"Invalid input";break;case e.ZodIssueCode.too_big:n="array"===a.type?`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:"string"===a.type?`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:"number"===a.type?`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:"bigint"===a.type?`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:"date"===a.type?`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:"Invalid input";break;case e.ZodIssueCode.custom:n="Invalid input";break;case e.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case e.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${a.multipleOf}`;break;case e.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=i.defaultError,t.util.assertNever(a)}return{message:n}};exports.default=a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./ZodError.js"),t=require("./helpers/errorUtil.js"),s=require("./helpers/parseUtil.js"),r=require("./helpers/util.js");class a{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const i=(t,r)=>{if(s.isValid(r))return{success:!0,data:r.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new e.ZodError(t.common.issues);return this._error=s,this._error}}};function n(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:a}=e;if(t&&(s||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{const{message:i}=e;return"invalid_enum_value"===t.code?{message:i??a.defaultError}:void 0===a.data?{message:i??r??a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:i??s??a.defaultError}},description:a}}class d{get description(){return this._def.description}_getType(e){return r.getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:r.getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new s.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:r.getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(s.isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r.getParsedType(e)},a=this._parseSync({data:e,path:s.path,parent:s});return i(s,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r.getParsedType(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return s.isValid(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>s.isValid(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r.getParsedType(e)},n=this._parse({data:e,path:a.path,parent:a}),d=await(s.isAsync(n)?n:Promise.resolve(n));return i(a,d)}refine(t,s){const r=e=>"string"==typeof s||void 0===s?{message:s}:"function"==typeof s?s(e):s;return this._refinement(((s,a)=>{const i=t(s),n=()=>a.addIssue({code:e.ZodIssueCode.custom,...r(s)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(n(),!1))):!!i||(n(),!1)}))}refinement(e,t){return this._refinement(((s,r)=>!!e(s)||(r.addIssue("function"==typeof t?t(s,r):t),!1)))}_refinement(e){return new ne({schema:this,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return de.create(this,this._def)}nullable(){return oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return M.create(this)}promise(){return ie.create(this,this._def)}or(e){return B.create([this,e],this._def)}and(e){return H.create(this,e,this._def)}transform(e){return new ne({...n(this._def),schema:this,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ue({...n(this._def),innerType:this,defaultValue:t,typeName:exports.ZodFirstPartyTypeKind.ZodDefault})}brand(){return new le({typeName:exports.ZodFirstPartyTypeKind.ZodBranded,type:this,...n(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ce({...n(this._def),innerType:this,catchValue:t,typeName:exports.ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return he.create(this,e)}readonly(){return me.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const o=/^c[^\s-]{8,}$/i,u=/^[0-9a-z]+$/,c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,l=/^[a-z0-9_-]{21}$/i,h=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,m=/^[-+]?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)?)??$/,y=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let f;const _=/^(?:(?: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])$/,g=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,v=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,x=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,I="((\\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])))",C=new RegExp(`^${I}$`);function k(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function P(e){let t=`${I}T${k(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function b(e,t){if(!h.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(r));return"object"==typeof a&&null!==a&&((!("typ"in a)||"JWT"===a?.typ)&&(!!a.alg&&(!t||a.alg===t)))}catch{return!1}}function w(e,t){return!("v4"!==t&&t||!g.test(e))||!("v6"!==t&&t||!x.test(e))}class A extends d{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==r.ZodParsedType.string){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.string,received:a.parsedType}),s.INVALID}const a=new s.ParseStatus;let i;for(const h of this._def.checks)if("min"===h.kind)t.data.length<h.value&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if("max"===h.kind)t.data.length>h.value&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if("length"===h.kind){const r=t.data.length>h.value,n=t.data.length<h.value;(r||n)&&(i=this._getOrReturnCtx(t,i),r?s.addIssueToContext(i,{code:e.ZodIssueCode.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):n&&s.addIssueToContext(i,{code:e.ZodIssueCode.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if("email"===h.kind)y.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"email",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("emoji"===h.kind)f||(f=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),f.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"emoji",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("uuid"===h.kind)p.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"uuid",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("nanoid"===h.kind)l.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"nanoid",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("cuid"===h.kind)o.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"cuid",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("cuid2"===h.kind)u.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"cuid2",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("ulid"===h.kind)c.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"ulid",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty());else if("url"===h.kind)try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"url",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()}else if("regex"===h.kind){h.regex.lastIndex=0;h.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"regex",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty())}else if("trim"===h.kind)t.data=t.data.trim();else if("includes"===h.kind)t.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty());else if("toLowerCase"===h.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===h.kind)t.data=t.data.toUpperCase();else if("startsWith"===h.kind)t.data.startsWith(h.value)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty());else if("endsWith"===h.kind)t.data.endsWith(h.value)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty());else if("datetime"===h.kind){P(h).test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:"datetime",message:h.message}),a.dirty())}else if("date"===h.kind){C.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:"date",message:h.message}),a.dirty())}else if("time"===h.kind){new RegExp(`^${k(h)}$`).test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_string,validation:"time",message:h.message}),a.dirty())}else"duration"===h.kind?m.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"duration",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):"ip"===h.kind?(n=t.data,("v4"!==(d=h.version)&&d||!_.test(n))&&("v6"!==d&&d||!v.test(n))&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"ip",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty())):"jwt"===h.kind?b(t.data,h.alg)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"jwt",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):"cidr"===h.kind?w(t.data,h.version)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"cidr",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):"base64"===h.kind?Z.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"base64",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):"base64url"===h.kind?T.test(t.data)||(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{validation:"base64url",code:e.ZodIssueCode.invalid_string,message:h.message}),a.dirty()):r.util.assertNever(h);var n,d;return{status:a.value,value:t.data}}_regex(s,r,a){return this.refinement((e=>s.test(e)),{validation:r,code:e.ZodIssueCode.invalid_string,...t.errorUtil.errToObj(a)})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...t.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...t.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...t.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...t.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...t.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...t.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...t.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...t.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...t.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...t.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...t.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...t.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...t.errorUtil.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...t.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...t.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...t.errorUtil.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...t.errorUtil.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...t.errorUtil.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...t.errorUtil.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...t.errorUtil.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...t.errorUtil.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...t.errorUtil.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...t.errorUtil.errToObj(s)})}nonempty(e){return this.min(1,t.errorUtil.errToObj(e))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function N(e,t){const s=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=s>r?s:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}A.create=e=>new A({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodString,coerce:e?.coerce??!1,...n(e)});class O extends d{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==r.ZodParsedType.number){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.number,received:a.parsedType}),s.INVALID}let a;const i=new s.ParseStatus;for(const n of this._def.checks)if("int"===n.kind)r.util.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty());else if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty())}else"multipleOf"===n.kind?0!==N(t.data,n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):"finite"===n.kind?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.not_finite,message:n.message}),i.dirty()):r.util.assertNever(n);return{status:i.value,value:t.data}}gte(e,s){return this.setLimit("min",e,!0,t.errorUtil.toString(s))}gt(e,s){return this.setLimit("min",e,!1,t.errorUtil.toString(s))}lte(e,s){return this.setLimit("max",e,!0,t.errorUtil.toString(s))}lt(e,s){return this.setLimit("max",e,!1,t.errorUtil.toString(s))}setLimit(e,s,r,a){return new O({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:r,message:t.errorUtil.toString(a)}]})}_addCheck(e){return new O({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:t.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:t.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:t.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:t.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:t.errorUtil.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:t.errorUtil.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:t.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:t.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:t.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&r.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}O.create=e=>new O({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodNumber,coerce:e?.coerce||!1,...n(e)});class S extends d{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==r.ZodParsedType.bigint)return this._getInvalidInput(t);let a;const i=new s.ParseStatus;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty())}else"multipleOf"===n.kind?t.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),s.addIssueToContext(a,{code:e.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):r.util.assertNever(n);return{status:i.value,value:t.data}}_getInvalidInput(t){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.bigint,received:a.parsedType}),s.INVALID}gte(e,s){return this.setLimit("min",e,!0,t.errorUtil.toString(s))}gt(e,s){return this.setLimit("min",e,!1,t.errorUtil.toString(s))}lte(e,s){return this.setLimit("max",e,!0,t.errorUtil.toString(s))}lt(e,s){return this.setLimit("max",e,!1,t.errorUtil.toString(s))}setLimit(e,s,r,a){return new S({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:r,message:t.errorUtil.toString(a)}]})}_addCheck(e){return new S({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:t.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:t.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:t.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:t.errorUtil.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:t.errorUtil.toString(s)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}S.create=e=>new S({checks:[],typeName:exports.ZodFirstPartyTypeKind.ZodBigInt,coerce:e?.coerce??!1,...n(e)});class F extends d{_parse(t){this._def.coerce&&(t.data=Boolean(t.data));if(this._getType(t)!==r.ZodParsedType.boolean){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.boolean,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}F.create=e=>new F({typeName:exports.ZodFirstPartyTypeKind.ZodBoolean,coerce:e?.coerce||!1,...n(e)});class L extends d{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==r.ZodParsedType.date){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.date,received:a.parsedType}),s.INVALID}if(Number.isNaN(t.data.getTime())){const r=this._getOrReturnCtx(t);return s.addIssueToContext(r,{code:e.ZodIssueCode.invalid_date}),s.INVALID}const a=new s.ParseStatus;let i;for(const n of this._def.checks)"min"===n.kind?t.data.getTime()<n.value&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):"max"===n.kind?t.data.getTime()>n.value&&(i=this._getOrReturnCtx(t,i),s.addIssueToContext(i,{code:e.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):r.util.assertNever(n);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:t.errorUtil.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:t.errorUtil.toString(s)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}L.create=e=>new L({checks:[],coerce:e?.coerce||!1,typeName:exports.ZodFirstPartyTypeKind.ZodDate,...n(e)});class U extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.symbol){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.symbol,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}U.create=e=>new U({typeName:exports.ZodFirstPartyTypeKind.ZodSymbol,...n(e)});class D extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.undefined){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.undefined,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}D.create=e=>new D({typeName:exports.ZodFirstPartyTypeKind.ZodUndefined,...n(e)});class j extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.null){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.null,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}j.create=e=>new j({typeName:exports.ZodFirstPartyTypeKind.ZodNull,...n(e)});class K extends d{constructor(){super(...arguments),this._any=!0}_parse(e){return s.OK(e.data)}}K.create=e=>new K({typeName:exports.ZodFirstPartyTypeKind.ZodAny,...n(e)});class V extends d{constructor(){super(...arguments),this._unknown=!0}_parse(e){return s.OK(e.data)}}V.create=e=>new V({typeName:exports.ZodFirstPartyTypeKind.ZodUnknown,...n(e)});class R extends d{_parse(t){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.never,received:a.parsedType}),s.INVALID}}R.create=e=>new R({typeName:exports.ZodFirstPartyTypeKind.ZodNever,...n(e)});class E extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.undefined){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.void,received:a.parsedType}),s.INVALID}return s.OK(t.data)}}E.create=e=>new E({typeName:exports.ZodFirstPartyTypeKind.ZodVoid,...n(e)});class M extends d{_parse(t){const{ctx:i,status:n}=this._processInputParams(t),d=this._def;if(i.parsedType!==r.ZodParsedType.array)return s.addIssueToContext(i,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:i.parsedType}),s.INVALID;if(null!==d.exactLength){const t=i.data.length>d.exactLength.value,r=i.data.length<d.exactLength.value;(t||r)&&(s.addIssueToContext(i,{code:t?e.ZodIssueCode.too_big:e.ZodIssueCode.too_small,minimum:r?d.exactLength.value:void 0,maximum:t?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),n.dirty())}if(null!==d.minLength&&i.data.length<d.minLength.value&&(s.addIssueToContext(i,{code:e.ZodIssueCode.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),n.dirty()),null!==d.maxLength&&i.data.length>d.maxLength.value&&(s.addIssueToContext(i,{code:e.ZodIssueCode.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),n.dirty()),i.common.async)return Promise.all([...i.data].map(((e,t)=>d.type._parseAsync(new a(i,e,i.path,t))))).then((e=>s.ParseStatus.mergeArray(n,e)));const o=[...i.data].map(((e,t)=>d.type._parseSync(new a(i,e,i.path,t))));return s.ParseStatus.mergeArray(n,o)}get element(){return this._def.type}min(e,s){return new M({...this._def,minLength:{value:e,message:t.errorUtil.toString(s)}})}max(e,s){return new M({...this._def,maxLength:{value:e,message:t.errorUtil.toString(s)}})}length(e,s){return new M({...this._def,exactLength:{value:e,message:t.errorUtil.toString(s)}})}nonempty(e){return this.min(1,e)}}function $(e){if(e instanceof z){const t={};for(const s in e.shape){const r=e.shape[s];t[s]=de.create($(r))}return new z({...e._def,shape:()=>t})}return e instanceof M?new M({...e._def,type:$(e.element)}):e instanceof de?de.create($(e.unwrap())):e instanceof oe?oe.create($(e.unwrap())):e instanceof J?J.create(e.items.map((e=>$(e)))):e}M.create=(e,t)=>new M({type:e,minLength:null,maxLength:null,exactLength:null,typeName:exports.ZodFirstPartyTypeKind.ZodArray,...n(t)});class z extends d{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(t){if(this._getType(t)!==r.ZodParsedType.object){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:a.parsedType}),s.INVALID}const{status:i,ctx:n}=this._processInputParams(t),{shape:d,keys:o}=this._getCached(),u=[];if(!(this._def.catchall instanceof R&&"strip"===this._def.unknownKeys))for(const e in n.data)o.includes(e)||u.push(e);const c=[];for(const e of o){const t=d[e],s=n.data[e];c.push({key:{status:"valid",value:e},value:t._parse(new a(n,s,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof R){const t=this._def.unknownKeys;if("passthrough"===t)for(const e of u)c.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===t)u.length>0&&(s.addIssueToContext(n,{code:e.ZodIssueCode.unrecognized_keys,keys:u}),i.dirty());else if("strip"!==t)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of u){const s=n.data[t];c.push({key:{status:"valid",value:t},value:e._parse(new a(n,s,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of c){const s=await t.key,r=await t.value;e.push({key:s,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>s.ParseStatus.mergeObjectSync(i,e))):s.ParseStatus.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return t.errorUtil.errToObj,new z({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(s,r)=>{const a=this._def.errorMap?.(s,r).message??r.defaultError;return"unrecognized_keys"===s.code?{message:t.errorUtil.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new z({...this._def,unknownKeys:"strip"})}passthrough(){return new z({...this._def,unknownKeys:"passthrough"})}extend(e){return new z({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new z({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:exports.ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new z({...this._def,catchall:e})}pick(e){const t={};for(const s of r.util.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new z({...this._def,shape:()=>t})}omit(e){const t={};for(const s of r.util.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new z({...this._def,shape:()=>t})}deepPartial(){return $(this)}partial(e){const t={};for(const s of r.util.objectKeys(this.shape)){const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}return new z({...this._def,shape:()=>t})}required(e){const t={};for(const s of r.util.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof de;)e=e._def.innerType;t[s]=e}return new z({...this._def,shape:()=>t})}keyof(){return se(r.util.objectKeys(this.shape))}}z.create=(e,t)=>new z({shape:()=>e,unknownKeys:"strip",catchall:R.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...n(t)}),z.strictCreate=(e,t)=>new z({shape:()=>e,unknownKeys:"strict",catchall:R.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...n(t)}),z.lazycreate=(e,t)=>new z({shape:e,unknownKeys:"strip",catchall:R.create(),typeName:exports.ZodFirstPartyTypeKind.ZodObject,...n(t)});class B extends d{_parse(t){const{ctx:r}=this._processInputParams(t),a=this._def.options;if(r.common.async)return Promise.all(a.map((async e=>{const t={...r,common:{...r.common,issues:[]},parent:null};return{result:await e._parseAsync({data:r.data,path:r.path,parent:t}),ctx:t}}))).then((function(t){for(const e of t)if("valid"===e.result.status)return e.result;for(const e of t)if("dirty"===e.result.status)return r.common.issues.push(...e.ctx.common.issues),e.result;const a=t.map((t=>new e.ZodError(t.ctx.common.issues)));return s.addIssueToContext(r,{code:e.ZodIssueCode.invalid_union,unionErrors:a}),s.INVALID}));{let t;const i=[];for(const e of a){const s={...r,common:{...r.common,issues:[]},parent:null},a=e._parseSync({data:r.data,path:r.path,parent:s});if("valid"===a.status)return a;"dirty"!==a.status||t||(t={result:a,ctx:s}),s.common.issues.length&&i.push(s.common.issues)}if(t)return r.common.issues.push(...t.ctx.common.issues),t.result;const n=i.map((t=>new e.ZodError(t)));return s.addIssueToContext(r,{code:e.ZodIssueCode.invalid_union,unionErrors:n}),s.INVALID}}get options(){return this._def.options}}B.create=(e,t)=>new B({options:e,typeName:exports.ZodFirstPartyTypeKind.ZodUnion,...n(t)});const W=e=>e instanceof ee?W(e.schema):e instanceof ne?W(e.innerType()):e instanceof te?[e.value]:e instanceof re?e.options:e instanceof ae?r.util.objectValues(e.enum):e instanceof ue?W(e._def.innerType):e instanceof D?[void 0]:e instanceof j?[null]:e instanceof de?[void 0,...W(e.unwrap())]:e instanceof oe?[null,...W(e.unwrap())]:e instanceof le||e instanceof me?W(e.unwrap()):e instanceof ce?W(e._def.innerType):[];class q extends d{_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==r.ZodParsedType.object)return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:a.parsedType}),s.INVALID;const i=this.discriminator,n=a.data[i],d=this.optionsMap.get(n);return d?a.common.async?d._parseAsync({data:a.data,path:a.path,parent:a}):d._parseSync({data:a.data,path:a.path,parent:a}):(s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),s.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const r=new Map;for(const s of t){const t=W(s.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,s)}}return new q({typeName:exports.ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...n(s)})}}function Y(e,t){const s=r.getParsedType(e),a=r.getParsedType(t);if(e===t)return{valid:!0,data:e};if(s===r.ZodParsedType.object&&a===r.ZodParsedType.object){const s=r.util.objectKeys(t),a=r.util.objectKeys(e).filter((e=>-1!==s.indexOf(e))),i={...e,...t};for(const s of a){const r=Y(e[s],t[s]);if(!r.valid)return{valid:!1};i[s]=r.data}return{valid:!0,data:i}}if(s===r.ZodParsedType.array&&a===r.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let r=0;r<e.length;r++){const a=Y(e[r],t[r]);if(!a.valid)return{valid:!1};s.push(a.data)}return{valid:!0,data:s}}return s===r.ZodParsedType.date&&a===r.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class H extends d{_parse(t){const{status:r,ctx:a}=this._processInputParams(t),i=(t,i)=>{if(s.isAborted(t)||s.isAborted(i))return s.INVALID;const n=Y(t.value,i.value);return n.valid?((s.isDirty(t)||s.isDirty(i))&&r.dirty(),{status:r.value,value:n.data}):(s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_intersection_types}),s.INVALID)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}H.create=(e,t,s)=>new H({left:e,right:t,typeName:exports.ZodFirstPartyTypeKind.ZodIntersection,...n(s)});class J extends d{_parse(t){const{status:i,ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.array)return s.addIssueToContext(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:n.parsedType}),s.INVALID;if(n.data.length<this._def.items.length)return s.addIssueToContext(n,{code:e.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&(s.addIssueToContext(n,{code:e.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const d=[...n.data].map(((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new a(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(d).then((e=>s.ParseStatus.mergeArray(i,e))):s.ParseStatus.mergeArray(i,d)}get items(){return this._def.items}rest(e){return new J({...this._def,rest:e})}}J.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new J({items:e,typeName:exports.ZodFirstPartyTypeKind.ZodTuple,rest:null,...n(t)})};class G extends d{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.object)return s.addIssueToContext(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:n.parsedType}),s.INVALID;const d=[],o=this._def.keyType,u=this._def.valueType;for(const e in n.data)d.push({key:o._parse(new a(n,e,n.path,e)),value:u._parse(new a(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?s.ParseStatus.mergeObjectAsync(i,d):s.ParseStatus.mergeObjectSync(i,d)}get element(){return this._def.valueType}static create(e,t,s){return new G(t instanceof d?{keyType:e,valueType:t,typeName:exports.ZodFirstPartyTypeKind.ZodRecord,...n(s)}:{keyType:A.create(),valueType:e,typeName:exports.ZodFirstPartyTypeKind.ZodRecord,...n(t)})}}class X extends d{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.map)return s.addIssueToContext(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.map,received:n.parsedType}),s.INVALID;const d=this._def.keyType,o=this._def.valueType,u=[...n.data.entries()].map((([e,t],s)=>({key:d._parse(new a(n,e,n.path,[s,"key"])),value:o._parse(new a(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const t of u){const r=await t.key,a=await t.value;if("aborted"===r.status||"aborted"===a.status)return s.INVALID;"dirty"!==r.status&&"dirty"!==a.status||i.dirty(),e.set(r.value,a.value)}return{status:i.value,value:e}}))}{const e=new Map;for(const t of u){const r=t.key,a=t.value;if("aborted"===r.status||"aborted"===a.status)return s.INVALID;"dirty"!==r.status&&"dirty"!==a.status||i.dirty(),e.set(r.value,a.value)}return{status:i.value,value:e}}}}X.create=(e,t,s)=>new X({valueType:t,keyType:e,typeName:exports.ZodFirstPartyTypeKind.ZodMap,...n(s)});class Q extends d{_parse(t){const{status:i,ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.set)return s.addIssueToContext(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.set,received:n.parsedType}),s.INVALID;const d=this._def;null!==d.minSize&&n.data.size<d.minSize.value&&(s.addIssueToContext(n,{code:e.ZodIssueCode.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),i.dirty()),null!==d.maxSize&&n.data.size>d.maxSize.value&&(s.addIssueToContext(n,{code:e.ZodIssueCode.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),i.dirty());const o=this._def.valueType;function u(e){const t=new Set;for(const r of e){if("aborted"===r.status)return s.INVALID;"dirty"===r.status&&i.dirty(),t.add(r.value)}return{status:i.value,value:t}}const c=[...n.data.values()].map(((e,t)=>o._parse(new a(n,e,n.path,t))));return n.common.async?Promise.all(c).then((e=>u(e))):u(c)}min(e,s){return new Q({...this._def,minSize:{value:e,message:t.errorUtil.toString(s)}})}max(e,s){return new Q({...this._def,maxSize:{value:e,message:t.errorUtil.toString(s)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Q.create=(e,t)=>new Q({valueType:e,minSize:null,maxSize:null,typeName:exports.ZodFirstPartyTypeKind.ZodSet,...n(t)});class ee extends d{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ee.create=(e,t)=>new ee({getter:e,typeName:exports.ZodFirstPartyTypeKind.ZodLazy,...n(t)});class te extends d{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return s.addIssueToContext(r,{received:r.data,code:e.ZodIssueCode.invalid_literal,expected:this._def.value}),s.INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}function se(e,t){return new re({values:e,typeName:exports.ZodFirstPartyTypeKind.ZodEnum,...n(t)})}te.create=(e,t)=>new te({value:e,typeName:exports.ZodFirstPartyTypeKind.ZodLiteral,...n(t)});class re extends d{_parse(t){if("string"!=typeof t.data){const a=this._getOrReturnCtx(t),i=this._def.values;return s.addIssueToContext(a,{expected:r.util.joinValues(i),received:a.parsedType,code:e.ZodIssueCode.invalid_type}),s.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),a=this._def.values;return s.addIssueToContext(r,{received:r.data,code:e.ZodIssueCode.invalid_enum_value,options:a}),s.INVALID}return s.OK(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return re.create(e,{...this._def,...t})}exclude(e,t=this._def){return re.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}re.create=se;class ae extends d{_parse(t){const a=r.util.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==r.ZodParsedType.string&&i.parsedType!==r.ZodParsedType.number){const t=r.util.objectValues(a);return s.addIssueToContext(i,{expected:r.util.joinValues(t),received:i.parsedType,code:e.ZodIssueCode.invalid_type}),s.INVALID}if(this._cache||(this._cache=new Set(r.util.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=r.util.objectValues(a);return s.addIssueToContext(i,{received:i.data,code:e.ZodIssueCode.invalid_enum_value,options:t}),s.INVALID}return s.OK(t.data)}get enum(){return this._def.values}}ae.create=(e,t)=>new ae({values:e,typeName:exports.ZodFirstPartyTypeKind.ZodNativeEnum,...n(t)});class ie extends d{unwrap(){return this._def.type}_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==r.ZodParsedType.promise&&!1===a.common.async)return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.promise,received:a.parsedType}),s.INVALID;const i=a.parsedType===r.ZodParsedType.promise?a.data:Promise.resolve(a.data);return s.OK(i.then((e=>this._def.type.parseAsync(e,{path:a.path,errorMap:a.common.contextualErrorMap}))))}}ie.create=(e,t)=>new ie({type:e,typeName:exports.ZodFirstPartyTypeKind.ZodPromise,...n(t)});class ne extends d{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===exports.ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:e=>{s.addIssueToContext(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){const e=i.transform(a.data,n);if(a.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return s.INVALID;const r=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===r.status?s.INVALID:"dirty"===r.status||"dirty"===t.value?s.DIRTY(r.value):r}));{if("aborted"===t.value)return s.INVALID;const r=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===r.status?s.INVALID:"dirty"===r.status||"dirty"===t.value?s.DIRTY(r.value):r}}if("refinement"===i.type){const e=e=>{const t=i.refinement(e,n);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const r=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===r.status?s.INVALID:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((r=>"aborted"===r.status?s.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===i.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!s.isValid(e))return s.INVALID;const r=i.transform(e.value,n);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>s.isValid(e)?Promise.resolve(i.transform(e.value,n)).then((e=>({status:t.value,value:e}))):s.INVALID))}r.util.assertNever(i)}}ne.create=(e,t,s)=>new ne({schema:e,typeName:exports.ZodFirstPartyTypeKind.ZodEffects,effect:t,...n(s)}),ne.createWithPreprocess=(e,t,s)=>new ne({schema:t,effect:{type:"preprocess",transform:e},typeName:exports.ZodFirstPartyTypeKind.ZodEffects,...n(s)});class de extends d{_parse(e){return this._getType(e)===r.ZodParsedType.undefined?s.OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}de.create=(e,t)=>new de({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodOptional,...n(t)});class oe extends d{_parse(e){return this._getType(e)===r.ZodParsedType.null?s.OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}oe.create=(e,t)=>new oe({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodNullable,...n(t)});class ue extends d{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===r.ZodParsedType.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ue.create=(e,t)=>new ue({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...n(t)});class ce extends d{_parse(t){const{ctx:r}=this._processInputParams(t),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return s.isAsync(i)?i.then((t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new e.ZodError(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new e.ZodError(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ce.create=(e,t)=>new ce({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...n(t)});class pe extends d{_parse(t){if(this._getType(t)!==r.ZodParsedType.nan){const a=this._getOrReturnCtx(t);return s.addIssueToContext(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.nan,received:a.parsedType}),s.INVALID}return{status:"valid",value:t.data}}}pe.create=e=>new pe({typeName:exports.ZodFirstPartyTypeKind.ZodNaN,...n(e)});class le extends d{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class he extends d{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?s.INVALID:"dirty"===e.status?(t.dirty(),s.DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?s.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new he({in:e,out:t,typeName:exports.ZodFirstPartyTypeKind.ZodPipeline})}}class me extends d{_parse(e){const t=this._def.innerType._parse(e),r=e=>(s.isValid(e)&&(e.value=Object.freeze(e.value)),e);return s.isAsync(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}var ye;me.create=(e,t)=>new me({innerType:e,typeName:exports.ZodFirstPartyTypeKind.ZodReadonly,...n(t)}),z.lazycreate,exports.ZodFirstPartyTypeKind=void 0,(ye=exports.ZodFirstPartyTypeKind||(exports.ZodFirstPartyTypeKind={})).ZodString="ZodString",ye.ZodNumber="ZodNumber",ye.ZodNaN="ZodNaN",ye.ZodBigInt="ZodBigInt",ye.ZodBoolean="ZodBoolean",ye.ZodDate="ZodDate",ye.ZodSymbol="ZodSymbol",ye.ZodUndefined="ZodUndefined",ye.ZodNull="ZodNull",ye.ZodAny="ZodAny",ye.ZodUnknown="ZodUnknown",ye.ZodNever="ZodNever",ye.ZodVoid="ZodVoid",ye.ZodArray="ZodArray",ye.ZodObject="ZodObject",ye.ZodUnion="ZodUnion",ye.ZodDiscriminatedUnion="ZodDiscriminatedUnion",ye.ZodIntersection="ZodIntersection",ye.ZodTuple="ZodTuple",ye.ZodRecord="ZodRecord",ye.ZodMap="ZodMap",ye.ZodSet="ZodSet",ye.ZodFunction="ZodFunction",ye.ZodLazy="ZodLazy",ye.ZodLiteral="ZodLiteral",ye.ZodEnum="ZodEnum",ye.ZodEffects="ZodEffects",ye.ZodNativeEnum="ZodNativeEnum",ye.ZodOptional="ZodOptional",ye.ZodNullable="ZodNullable",ye.ZodDefault="ZodDefault",ye.ZodCatch="ZodCatch",ye.ZodPromise="ZodPromise",ye.ZodBranded="ZodBranded",ye.ZodPipeline="ZodPipeline",ye.ZodReadonly="ZodReadonly";const fe=A.create,_e=O.create;pe.create,S.create;const ge=F.create;L.create,U.create,D.create,j.create;const ve=K.create,xe=V.create;R.create,E.create;const Ze=M.create,Te=z.create;z.strictCreate;const Ie=B.create,Ce=q.create;H.create,J.create;const ke=G.create;X.create,Q.create,ee.create;const Pe=te.create,be=re.create;ae.create,ie.create,ne.create;const we=de.create;oe.create,ne.createWithPreprocess;const Ae=s.INVALID;exports.NEVER=Ae,exports.Schema=d,exports.ZodAny=K,exports.ZodArray=M,exports.ZodBigInt=S,exports.ZodBoolean=F,exports.ZodBranded=le,exports.ZodCatch=ce,exports.ZodDate=L,exports.ZodDefault=ue,exports.ZodDiscriminatedUnion=q,exports.ZodEffects=ne,exports.ZodEnum=re,exports.ZodIntersection=H,exports.ZodLazy=ee,exports.ZodLiteral=te,exports.ZodMap=X,exports.ZodNaN=pe,exports.ZodNativeEnum=ae,exports.ZodNever=R,exports.ZodNull=j,exports.ZodNullable=oe,exports.ZodNumber=O,exports.ZodObject=z,exports.ZodOptional=de,exports.ZodPipeline=he,exports.ZodPromise=ie,exports.ZodReadonly=me,exports.ZodRecord=G,exports.ZodSchema=d,exports.ZodSet=Q,exports.ZodString=A,exports.ZodSymbol=U,exports.ZodTransformer=ne,exports.ZodTuple=J,exports.ZodType=d,exports.ZodUndefined=D,exports.ZodUnion=B,exports.ZodUnknown=V,exports.ZodVoid=E,exports.any=ve,exports.array=Ze,exports.boolean=ge,exports.datetimeRegex=P,exports.discriminatedUnion=Ce,exports.enum=be,exports.literal=Pe,exports.number=_e,exports.object=Te,exports.optional=we,exports.record=ke,exports.string=fe,exports.union=Ie,exports.unknown=xe;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{util as s}from"./helpers/util.js";const t=s.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class e extends Error{get errors(){return this.issues}constructor(s){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=s}format(s){const t=s||function(s){return s.message},e={_errors:[]},r=s=>{for(const i of s.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)e._errors.push(t(i));else{let s=e,r=0;for(;r<i.path.length;){const e=i.path[r];r===i.path.length-1?(s[e]=s[e]||{_errors:[]},s[e]._errors.push(t(i))):s[e]=s[e]||{_errors:[]},s=s[e],r++}}};return r(this),e}static assert(s){if(!(s instanceof e))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(s=s=>s.message){const t={},e=[];for(const r of this.issues)if(r.path.length>0){const e=r.path[0];t[e]=t[e]||[],t[e].push(s(r))}else e.push(s(r));return{formErrors:e,fieldErrors:t}}get formErrors(){return this.flatten()}}e.create=s=>new e(s);export{e as ZodError,t as ZodIssueCode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./locales/en.js";export{default as defaultErrorMap}from"./locales/en.js";let r=e;function o(){return r}export{o as getErrorMap};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(e||(e={}));export{e as errorUtil};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getErrorMap as t}from"../errors.js";import a from"../locales/en.js";const e=t=>{const{data:a,path:e,errorMaps:s,issueData:r}=t,o=[...e,...r.path||[]],u={...r,path:o};if(void 0!==r.message)return{...r,path:o,message:r.message};let i="";const n=s.filter((t=>!!t)).slice().reverse();for(const t of n)i=t(u,{data:a,defaultError:i}).message;return{...r,path:o,message:i}};function s(s,r){const o=t(),u=e({issueData:r,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,o,o===a?void 0:a].filter((t=>!!t))});s.common.issues.push(u)}class r{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,a){const e=[];for(const s of a){if("aborted"===s.status)return o;"dirty"===s.status&&t.dirty(),e.push(s.value)}return{status:t.value,value:e}}static async mergeObjectAsync(t,a){const e=[];for(const t of a){const a=await t.key,s=await t.value;e.push({key:a,value:s})}return r.mergeObjectSync(t,e)}static mergeObjectSync(t,a){const e={};for(const s of a){const{key:a,value:r}=s;if("aborted"===a.status)return o;if("aborted"===r.status)return o;"dirty"===a.status&&t.dirty(),"dirty"===r.status&&t.dirty(),"__proto__"===a.value||void 0===r.value&&!s.alwaysSet||(e[a.value]=r.value)}return{status:t.value,value:e}}}const o=Object.freeze({status:"aborted"}),u=t=>({status:"dirty",value:t}),i=t=>({status:"valid",value:t}),n=t=>"aborted"===t.status,c=t=>"dirty"===t.status,l=t=>"valid"===t.status,d=t=>"undefined"!=typeof Promise&&t instanceof Promise;export{u as DIRTY,o as INVALID,i as OK,r as ParseStatus,s as addIssueToContext,n as isAborted,d as isAsync,c as isDirty,l as isValid,e as makeIssue};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e,n;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const n={};for(const t of e)n[t]=t;return n},e.getValidEnumValues=n=>{const t=e.objectKeys(n).filter((e=>"number"!=typeof n[n[e]])),r={};for(const e of t)r[e]=n[e];return e.objectValues(r)},e.objectValues=n=>e.objectKeys(n).map((function(e){return n[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const n=[];for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n},e.find=(e,n)=>{for(const t of e)if(n(t))return t},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,n=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(n)},e.jsonStringifyReplacer=(e,n)=>"bigint"==typeof n?n.toString():n}(e||(e={})),function(e){e.mergeShapes=(e,n)=>({...e,...n})}(n||(n={}));const t=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),r=e=>{switch(typeof e){case"undefined":return t.undefined;case"string":return t.string;case"number":return Number.isNaN(e)?t.nan:t.number;case"boolean":return t.boolean;case"function":return t.function;case"bigint":return t.bigint;case"symbol":return t.symbol;case"object":return Array.isArray(e)?t.array:null===e?t.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.promise:"undefined"!=typeof Map&&e instanceof Map?t.map:"undefined"!=typeof Set&&e instanceof Set?t.set:"undefined"!=typeof Date&&e instanceof Date?t.date:t.object;default:return t.unknown}};export{t as ZodParsedType,r as getParsedType,n as objectUtil,e as util};
|