eve 0.13.2 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/src/chunks/use-eve-agent-BLv-Mj5g.js +1512 -0
- package/dist/src/chunks/use-eve-agent-C8UVUMA4.js +1542 -0
- package/dist/src/client/agent-info-schema.d.ts +1 -1
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +6 -6
- package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/google/index.js +6 -6
- package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/index.js +2 -2
- package/dist/src/compiled/@chat-adapter/slack/_slack-web-api.d.ts +1 -0
- package/dist/src/compiled/@chat-adapter/slack/blocks.d.ts +160 -0
- package/dist/src/compiled/@chat-adapter/slack/blocks.js +8 -0
- package/dist/src/compiled/@chat-adapter/slack/index.d.ts +28 -3
- package/dist/src/compiled/@chat-adapter/slack/index.js +26 -26
- package/dist/src/compiled/@workflow/core/create-hook.d.ts +3 -1
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +9 -0
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/logger.d.ts +1 -0
- package/dist/src/compiled/@workflow/core/private.d.ts +35 -2
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +73 -0
- package/dist/src/compiled/@workflow/core/runtime/get-port-lazy.d.ts +15 -0
- package/dist/src/compiled/@workflow/core/runtime/run-id-time.d.ts +10 -0
- package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +61 -1
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +38 -2
- package/dist/src/compiled/@workflow/core/runtime.d.ts +1 -0
- package/dist/src/compiled/@workflow/core/runtime.js +28 -28
- package/dist/src/compiled/@workflow/core/source-map.d.ts +5 -0
- package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +27 -0
- package/dist/src/compiled/@workflow/core/step-hydration-cache.d.ts +148 -0
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +28 -0
- package/dist/src/compiled/@workflow/core/telemetry.d.ts +9 -6
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/vm/script-cache.d.ts +28 -0
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/events.d.ts +78 -3
- package/dist/src/compiled/@workflow/world/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +11 -1
- package/dist/src/compiled/_chunks/{workflow/core-CXJbIkCL.js → client/core-Bm8azZA6.js} +5 -5
- package/dist/src/compiled/_chunks/node/chunk-AYN7QRWH-Csu8sG38.js +1 -0
- package/dist/src/compiled/_chunks/node/{dist-BQYUcBqu.js → dist-W8yle6rh.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-Bi5DLT8S.js → attribute-changes-DUxG-Gic.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/dist-C9PV_vnE.js +77 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-CUCPW67D.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{run-XM8dTRAo.js → run-CVlF84yI.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/sleep-Dxuzj5to.js +1 -0
- package/dist/src/compiled/chat/index.d.ts +4 -4
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiled/chat/{jsx-runtime-CFq1K_Ve.d.ts → jsx-runtime-CzthIo1o.d.ts} +6 -1
- package/dist/src/compiled/zod/index.js +1 -1
- package/dist/src/compiled/zod-validation-error/index.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/authorization.d.ts +1 -0
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/internal/application/optional-package-install.js +15 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/public/channels/slack/blocks.d.ts +3 -41
- package/dist/src/public/channels/slack/blocks.js +2 -3
- package/dist/src/public/channels/slack/defaults.js +3 -3
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/guides/instrumentation.md +1 -1
- package/package.json +7 -7
- package/dist/src/chunks/use-eve-agent-B18LYpfZ.js +0 -5765
- package/dist/src/chunks/use-eve-agent-BPI1nbo5.js +0 -5795
- package/dist/src/compiled/_chunks/workflow/coerce-B-Ro4Nfe.js +0 -1
- package/dist/src/compiled/_chunks/workflow/compat-DLpWymPP.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-DTchiX0N.js +0 -14
- package/dist/src/compiled/_chunks/workflow/resume-hook-CKTw-lb5.js +0 -1
- package/dist/src/compiled/_chunks/workflow/schemas-iG9Z4s4o.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-DPjVkRY-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,Mt as v,N as y,Nt as b,O as x,Ot as S,P as C,Q as w,R as T,S as E,St as D,T as O,Tt as k,U as A,V as j,W as M,X as N,Y as P,Z as F,_ as I,_t as L,a as R,at as z,b as B,bt as V,c as H,ct as U,d as W,dt as G,et as K,f as q,ft as J,g as Y,gt as X,h as Z,ht as Q,i as $,it as ee,j as te,jt as ne,k as re,kt as ie,l as ae,lt as oe,m as se,mt as ce,n as le,nt as ue,o as de,ot as fe,p as pe,pt as me,q as he,r as ge,rt as _e,s as ve,st as ye,t as be,tt as xe,u as Se,ut as Ce,v as we,vt as Te,w as Ee,wt as De,x as Oe,xt as ke,y as Ae,yt as je,z as Me}from"../_chunks/node/dist-
|
|
1
|
+
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,Mt as v,N as y,Nt as b,O as x,Ot as S,P as C,Q as w,R as T,S as E,St as D,T as O,Tt as k,U as A,V as j,W as M,X as N,Y as P,Z as F,_ as I,_t as L,a as R,at as z,b as B,bt as V,c as H,ct as U,d as W,dt as G,et as K,f as q,ft as J,g as Y,gt as X,h as Z,ht as Q,i as $,it as ee,j as te,jt as ne,k as re,kt as ie,l as ae,lt as oe,m as se,mt as ce,n as le,nt as ue,o as de,ot as fe,p as pe,pt as me,q as he,r as ge,rt as _e,s as ve,st as ye,t as be,tt as xe,u as Se,ut as Ce,v as we,vt as Te,w as Ee,wt as De,x as Oe,xt as ke,y as Ae,yt as je,z as Me}from"../_chunks/node/dist-W8yle6rh.js";export{be as Actions,K as BaseFormatConverter,le as Button,ge as Card,$ as CardLink,R as CardText,de as ChannelImpl,ve as Chat,H as ChatError,ae as ConsoleLogger,Se as DEFAULT_EMOJI_MAP,W as Divider,q as EmojiResolver,pe as ExternalSelect,se as Field,Z as Fields,Y as Image,I as LinkButton,we as LockError,Ae as Message,B as MessageHistoryCache,Oe as Modal,E as NotImplementedError,i as Plan,Ee as RadioSelect,O as RateLimitError,c as Section,o as Select,x as SelectOption,re as StreamingMarkdownRenderer,t as StreamingPlan,te as THREAD_STATE_TTL_MS,_ as Table,y as TextInput,C as ThreadHistoryCache,u as ThreadImpl,xe as blockquote,p as cardChildToFallbackText,ue as codeBlock,g as convertEmojiPlaceholders,T as createEmoji,Me as defaultEmojiResolver,r as deriveChannelId,j as emoji,_e as emphasis,f as fromFullStream,A as fromReactElement,M as fromReactModalElement,d as getEmoji,ee as getNodeChildren,z as getNodeValue,fe as inlineCode,ye as isBlockquoteNode,h as isCardElement,U as isCodeNode,oe as isDeleteNode,Ce as isEmphasisNode,G as isInlineCodeNode,he as isJSX,J as isLinkNode,me as isListItemNode,ce as isListNode,m as isModalElement,Q as isParagraphNode,P as isPostableObject,X as isStrongNode,L as isTableCellNode,Te as isTableNode,je as isTableRowNode,V as isTextNode,ke as link,D as markdownToPlainText,a as paragraph,De as parseMarkdown,N as reviver,k as root,l as strikethrough,s as stringifyMarkdown,S as strong,ie as tableElementToAscii,n as tableToAscii,ne as text,e as toAiMessages,F as toCardElement,w as toModalElement,v as toPlainText,b as walkAst};
|
|
@@ -68,6 +68,8 @@ interface ButtonElement {
|
|
|
68
68
|
}
|
|
69
69
|
/** Link button element that opens a URL */
|
|
70
70
|
interface LinkButtonElement {
|
|
71
|
+
/** Optional action identifier emitted by platforms that report link clicks */
|
|
72
|
+
id?: string;
|
|
71
73
|
/** Button label text */
|
|
72
74
|
label: string;
|
|
73
75
|
/** Visual style */
|
|
@@ -268,6 +270,8 @@ interface ButtonOptions {
|
|
|
268
270
|
declare function Button(options: ButtonOptions): ButtonElement;
|
|
269
271
|
/** Options for LinkButton */
|
|
270
272
|
interface LinkButtonOptions {
|
|
273
|
+
/** Optional action identifier emitted by platforms that report link clicks */
|
|
274
|
+
id?: string;
|
|
271
275
|
/** Button label text */
|
|
272
276
|
label: string;
|
|
273
277
|
/** Visual style */
|
|
@@ -546,6 +550,7 @@ interface ButtonProps {
|
|
|
546
550
|
/** Props for LinkButton component in JSX */
|
|
547
551
|
interface LinkButtonProps {
|
|
548
552
|
children?: string | number | (string | number | undefined)[];
|
|
553
|
+
id?: string;
|
|
549
554
|
label?: string;
|
|
550
555
|
style?: ButtonStyle;
|
|
551
556
|
url: string;
|
|
@@ -779,4 +784,4 @@ declare namespace JSX {
|
|
|
779
784
|
}
|
|
780
785
|
}
|
|
781
786
|
|
|
782
|
-
export { type
|
|
787
|
+
export { type SelectOptionElement as $, type ActionsComponent as A, type ButtonComponent as B, type CardChild as C, type DividerComponent as D, type ExternalSelectComponent as E, type FieldComponent as F, type ImageProps as G, type LinkButtonElement as H, type ImageComponent as I, JSX as J, type LinkButtonOptions as K, type LinkButtonComponent as L, type LinkButtonProps as M, type LinkElement as N, type ModalChild as O, type ModalComponent as P, type ModalElement as Q, type ModalOptions as R, type ModalProps as S, type RadioSelectComponent as T, type RadioSelectElement as U, type RadioSelectOptions as V, type SectionComponent as W, type SectionElement as X, type SelectComponent as Y, type SelectElement as Z, type SelectOptionComponent as _, type ActionsElement as a, type SelectOptionProps as a0, type SelectOptions as a1, type SelectProps as a2, Table as a3, type TableAlignment as a4, type TableComponent as a5, type TableElement as a6, type TableOptions as a7, type TableProps as a8, type TextComponent as a9, type TextElement as aa, type TextInputComponent as ab, type TextInputElement as ac, type TextInputOptions as ad, type TextInputProps as ae, type TextProps as af, type TextStyle as ag, cardChildToFallbackText as ah, fromReactElement as ai, fromReactModalElement as aj, isCardElement as ak, isCardLinkProps as al, isJSX as am, isModalElement as an, jsx as ao, jsxDEV as ap, jsxs as aq, toCardElement as ar, toModalElement as as, type ButtonElement as b, type ButtonOptions as c, type ButtonProps as d, type ButtonStyle as e, type CardComponent as f, type CardElement as g, type CardJSXElement as h, type CardJSXProps as i, type CardLinkComponent as j, type CardLinkProps as k, type CardOptions as l, type CardProps as m, type ChatElement as n, type ContainerProps as o, type DividerElement as p, type DividerProps as q, type ExternalSelectElement as r, type ExternalSelectOptions as s, type ExternalSelectProps as t, type FieldElement as u, type FieldProps as v, type FieldsComponent as w, type FieldsElement as x, Fragment as y, type ImageElement as z };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"../_chunks/workflow/chunk-BHKSVoKr.js";import{An as t,At as n,Bi as r,Bt as i,Dn as a,F as o,Ft as s,Gt as c,Ii as l,It as ee,Kt as te,Lt as ne,Mn as re,Mt as ie,Nt as ae,On as u,Qt as d,Ri as f,Rt as p,Si as m,Ut as h,Vi as g,W as _,Xt as v,Zt as y,_n as b,bi as x,dn as S,dt as C,en as w,gt as T,ht as E,jn as D,jt as O,kn as k,ln as A,nn as j,qt as M,ri as N,rn as P,t as F,tn as I,un as L,vi as R,vt as z,xi as B,yi as V,zt as H}from"../_chunks/workflow/core-CXJbIkCL.js";import{$ as U,$n as W,$t as G,A as K,An as q,At as J,B as oe,Bn as se,Bt as ce,C as le,Cn as ue,Cr as Y,Ct as de,D as fe,Dn as pe,Dt as me,E as he,En as ge,Et as _e,F as ve,Fn as ye,Ft as be,G as xe,Gn as Se,Gt as Ce,H as we,Hn as Te,Ht as Ee,I as De,In as Oe,It as ke,J as Ae,Jn as je,Jt as Me,K as Ne,Kn as Pe,Kt as Fe,L as Ie,Ln as Le,Lt as Re,M as ze,Mn as Be,Mt as Ve,N as He,Nn as Ue,Nt as We,O as Ge,On as Ke,Ot as qe,P as Je,Pn as Ye,Pt as Xe,Q as Ze,Qn as Qe,Qt as $e,R as et,Rn as tt,Rt as nt,S as rt,Sn as it,Sr as at,St as ot,T as st,Tn as ct,Tt as lt,U as ut,Un as dt,Ut as ft,V as pt,Vn as mt,Vt as ht,W as gt,Wn as _t,Wt as vt,X as yt,Xn as bt,Xt as xt,Y as St,Yn as Ct,Yt as wt,Z as Tt,Zn as Et,Zt as Dt,_ as Ot,_n as kt,_r as At,_t as jt,a as X,an as Mt,ar as Nt,at as Pt,b as Ft,bn as It,br as Lt,bt as Z,c as Rt,cn as zt,cr as Bt,ct as Vt,d as Ht,dn as Ut,dr as Wt,dt as Gt,en as Kt,er as qt,et as Jt,f as Yt,fn as Xt,fr as Zt,ft as Qt,g as $t,gn as en,gr as tn,gt as nn,h as rn,hn as an,hr as on,ht as sn,i as cn,in as ln,ir as un,it as dn,j as fn,jn as pn,jt as mn,k as hn,kn as gn,kt as _n,l as vn,ln as yn,lr as bn,lt as xn,m as Sn,mn as Cn,mr as wn,mt as Tn,n as En,nn as Dn,nr as On,nt as kn,o as An,on as jn,or as Mn,ot as Nn,p as Pn,pn as Fn,pr as In,pt as Ln,q as Rn,qn as zn,qt as Bn,r as Vn,rn as Hn,rr as Un,rt as Wn,s as Gn,sn as Kn,sr as qn,st as Jn,t as Yn,tn as Xn,tr as Zn,tt as Qn,u as $n,un as er,ur as tr,ut as nr,v as rr,vn as ir,vr as ar,vt as or,w as sr,wn as cr,wr as lr,wt as ur,x as dr,xn as fr,xr as pr,xt as mr,y as hr,yn as gr,yr as _r,yt as vr,z as yr,zn as br,zt as xr}from"../_chunks/workflow/schemas-iG9Z4s4o.js";import{i as Sr,n as Cr,r as wr,t as Tr}from"../_chunks/workflow/compat-DLpWymPP.js";import{t as Er}from"../_chunks/workflow/coerce-B-Ro4Nfe.js";const Q={...ye,...lr,iso:Y},Dr=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function Or(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function kr(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Ar(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return Q.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Q.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=$(kr(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return Q.null();if(n.length===0)return Q.never();if(n.length===1)return Q.literal(n[0]);if(n.every(e=>typeof e==`string`))return Q.enum(n);let r=n.map(e=>Q.literal(e));return r.length<2?r[0]:Q.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return Q.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>Ar({...e,type:n},t));return r.length===0?Q.never():r.length===1?r[0]:Q.union(r)}if(!n)return Q.any();let r;switch(n){case`string`:{let t=Q.string();if(e.format){let n=e.format;n===`email`?t=t.check(Q.email()):n===`uri`||n===`uri-reference`?t=t.check(Q.url()):n===`uuid`||n===`guid`?t=t.check(Q.uuid()):n===`date-time`?t=t.check(Q.iso.datetime()):n===`date`?t=t.check(Q.iso.date()):n===`time`?t=t.check(Q.iso.time()):n===`duration`?t=t.check(Q.iso.duration()):n===`ipv4`?t=t.check(Q.ipv4()):n===`ipv6`?t=t.check(Q.ipv6()):n===`mac`?t=t.check(Q.mac()):n===`cidr`?t=t.check(Q.cidrv4()):n===`cidr-v6`?t=t.check(Q.cidrv6()):n===`base64`?t=t.check(Q.base64()):n===`base64url`?t=t.check(Q.base64url()):n===`e164`?t=t.check(Q.e164()):n===`jwt`?t=t.check(Q.jwt()):n===`emoji`?t=t.check(Q.emoji()):n===`nanoid`?t=t.check(Q.nanoid()):n===`cuid`?t=t.check(Q.cuid()):n===`cuid2`?t=t.check(Q.cuid2()):n===`ulid`?t=t.check(Q.ulid()):n===`xid`?t=t.check(Q.xid()):n===`ksuid`&&(t=t.check(Q.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?Q.number().int():Q.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=Q.boolean();break;case`null`:r=Q.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=$(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=$(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?$(e.additionalProperties,t):Q.any();if(Object.keys(n).length===0){r=Q.record(i,a);break}let o=Q.object(n).passthrough(),s=Q.looseRecord(i,a);r=Q.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=$(i[e],t),r=Q.string().regex(new RegExp(e));o.push(Q.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(Q.object(n).passthrough()),s.push(...o),s.length===0)r=Q.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=Q.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=Q.intersection(e,s[t]);r=e}break}let o=Q.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall($(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>$(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?$(i,t):void 0;r=o?Q.tuple(a).rest(o):Q.tuple(a),typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>$(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?$(e.additionalItems,t):void 0;r=a?Q.tuple(n).rest(a):Q.tuple(n),typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(i!==void 0){let n=$(i,t),a=Q.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=Q.array(Q.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function $(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n=Ar(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>$(e,t)),a=Q.union(i);n=r?Q.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>$(e,t)),a=Q.xor(i);n=r?Q.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:Q.any();else{let i=r?n:$(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=Q.intersection(i,$(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=Q.nullable(n)),e.readOnly===!0&&(n=Q.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))Dr.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function jr(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:Or(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??k};return $(n,r)}var Mr=e({$brand:()=>f,$input:()=>a,$output:()=>u,NEVER:()=>r,TimePrecision:()=>_,ZodAny:()=>Yn,ZodArray:()=>En,ZodBase64:()=>Vn,ZodBase64URL:()=>cn,ZodBigInt:()=>X,ZodBigIntFormat:()=>An,ZodBoolean:()=>Gn,ZodCIDRv4:()=>Rt,ZodCIDRv6:()=>vn,ZodCUID:()=>$n,ZodCUID2:()=>Ht,ZodCatch:()=>Yt,ZodCodec:()=>Pn,ZodCustom:()=>Sn,ZodCustomStringFormat:()=>rn,ZodDate:()=>$t,ZodDefault:()=>Ot,ZodDiscriminatedUnion:()=>rr,ZodE164:()=>hr,ZodEmail:()=>Ft,ZodEmoji:()=>dr,ZodEnum:()=>rt,ZodError:()=>At,ZodExactOptional:()=>le,ZodFile:()=>sr,ZodFirstPartyTypeKind:()=>Tr,ZodFunction:()=>st,ZodGUID:()=>he,ZodIPv4:()=>fe,ZodIPv6:()=>Ge,ZodISODate:()=>_r,ZodISODateTime:()=>Lt,ZodISODuration:()=>pr,ZodISOTime:()=>at,ZodIntersection:()=>hn,ZodIssueCode:()=>Cr,ZodJWT:()=>K,ZodKSUID:()=>fn,ZodLazy:()=>ze,ZodLiteral:()=>He,ZodMAC:()=>Je,ZodMap:()=>ve,ZodNaN:()=>De,ZodNanoID:()=>Ie,ZodNever:()=>et,ZodNonOptional:()=>yr,ZodNull:()=>oe,ZodNullable:()=>pt,ZodNumber:()=>we,ZodNumberFormat:()=>ut,ZodObject:()=>gt,ZodOptional:()=>xe,ZodPipe:()=>Ne,ZodPrefault:()=>Rn,ZodPreprocess:()=>Ae,ZodPromise:()=>St,ZodReadonly:()=>yt,ZodRealError:()=>ar,ZodRecord:()=>Tt,ZodSet:()=>Ze,ZodString:()=>U,ZodStringFormat:()=>Jt,ZodSuccess:()=>Qn,ZodSymbol:()=>kn,ZodTemplateLiteral:()=>Wn,ZodTransform:()=>dn,ZodTuple:()=>Pt,ZodType:()=>Nn,ZodULID:()=>Jn,ZodURL:()=>Vt,ZodUUID:()=>xn,ZodUndefined:()=>nr,ZodUnion:()=>Gt,ZodUnknown:()=>Qt,ZodVoid:()=>Ln,ZodXID:()=>Tn,ZodXor:()=>sn,_ZodString:()=>nn,_default:()=>or,_function:()=>Z,any:()=>lt,array:()=>_e,base64:()=>me,base64url:()=>qe,bigint:()=>_n,boolean:()=>J,catch:()=>jt,check:()=>mn,cidrv4:()=>Ve,cidrv6:()=>We,clone:()=>m,codec:()=>Xe,coerce:()=>Er,config:()=>g,core:()=>F,cuid:()=>be,cuid2:()=>ke,custom:()=>Re,date:()=>nt,decode:()=>Nt,decodeAsync:()=>Mn,describe:()=>xr,discriminatedUnion:()=>ce,e164:()=>ht,email:()=>Ee,emoji:()=>ft,encode:()=>qn,encodeAsync:()=>Bt,endsWith:()=>C,enum:()=>vr,exactOptional:()=>vt,file:()=>Ce,flattenError:()=>R,float32:()=>Fe,float64:()=>Bn,formatError:()=>V,fromJSONSchema:()=>jr,function:()=>Z,getErrorMap:()=>wr,globalRegistry:()=>k,gt:()=>E,gte:()=>T,guid:()=>Me,hash:()=>wt,hex:()=>xt,hostname:()=>Dt,httpUrl:()=>$e,includes:()=>z,instanceof:()=>mr,int:()=>G,int32:()=>Kt,int64:()=>Xn,intersection:()=>Dn,invertCodec:()=>Hn,ipv4:()=>ln,ipv6:()=>Mt,iso:()=>Y,json:()=>jn,jwt:()=>Kn,keyof:()=>zt,ksuid:()=>yn,lazy:()=>er,length:()=>n,literal:()=>Ut,locales:()=>D,looseObject:()=>Xt,looseRecord:()=>Fn,lowercase:()=>O,lt:()=>ie,lte:()=>ae,mac:()=>Cn,map:()=>an,maxLength:()=>s,maxSize:()=>ee,meta:()=>en,mime:()=>ne,minLength:()=>p,minSize:()=>H,multipleOf:()=>i,nan:()=>kt,nanoid:()=>ir,nativeEnum:()=>gr,negative:()=>h,never:()=>It,nonnegative:()=>c,nonoptional:()=>fr,nonpositive:()=>te,normalize:()=>M,null:()=>ot,nullable:()=>it,nullish:()=>ue,number:()=>cr,object:()=>ct,optional:()=>ge,overwrite:()=>v,parse:()=>bn,parseAsync:()=>tr,partialRecord:()=>pe,pipe:()=>Ke,positive:()=>y,prefault:()=>gn,preprocess:()=>q,prettifyError:()=>x,promise:()=>pn,property:()=>d,readonly:()=>Be,record:()=>Ue,refine:()=>Ye,regex:()=>w,regexes:()=>N,registry:()=>t,safeDecode:()=>Wt,safeDecodeAsync:()=>Zt,safeEncode:()=>In,safeEncodeAsync:()=>wn,safeParse:()=>on,safeParseAsync:()=>tn,set:()=>Oe,setErrorMap:()=>Sr,size:()=>I,slugify:()=>j,startsWith:()=>P,strictObject:()=>Le,string:()=>tt,stringFormat:()=>br,stringbool:()=>se,success:()=>mt,superRefine:()=>Te,symbol:()=>dt,templateLiteral:()=>_t,toJSONSchema:()=>o,toLowerCase:()=>A,toUpperCase:()=>L,transform:()=>Se,treeifyError:()=>B,trim:()=>S,tuple:()=>Pe,uint32:()=>zn,uint64:()=>je,ulid:()=>Ct,undefined:()=>de,union:()=>bt,unknown:()=>Et,uppercase:()=>b,url:()=>Qe,util:()=>l,uuid:()=>W,uuidv4:()=>qt,uuidv6:()=>Zn,uuidv7:()=>On,void:()=>ur,xid:()=>Un,xor:()=>un});g(re());var Nr=Mr;export{f as $brand,a as $input,u as $output,r as NEVER,_ as TimePrecision,Yn as ZodAny,En as ZodArray,Vn as ZodBase64,cn as ZodBase64URL,X as ZodBigInt,An as ZodBigIntFormat,Gn as ZodBoolean,Rt as ZodCIDRv4,vn as ZodCIDRv6,$n as ZodCUID,Ht as ZodCUID2,Yt as ZodCatch,Pn as ZodCodec,Sn as ZodCustom,rn as ZodCustomStringFormat,$t as ZodDate,Ot as ZodDefault,rr as ZodDiscriminatedUnion,hr as ZodE164,Ft as ZodEmail,dr as ZodEmoji,rt as ZodEnum,At as ZodError,le as ZodExactOptional,sr as ZodFile,Tr as ZodFirstPartyTypeKind,st as ZodFunction,he as ZodGUID,fe as ZodIPv4,Ge as ZodIPv6,_r as ZodISODate,Lt as ZodISODateTime,pr as ZodISODuration,at as ZodISOTime,hn as ZodIntersection,Cr as ZodIssueCode,K as ZodJWT,fn as ZodKSUID,ze as ZodLazy,He as ZodLiteral,Je as ZodMAC,ve as ZodMap,De as ZodNaN,Ie as ZodNanoID,et as ZodNever,yr as ZodNonOptional,oe as ZodNull,pt as ZodNullable,we as ZodNumber,ut as ZodNumberFormat,gt as ZodObject,xe as ZodOptional,Ne as ZodPipe,Rn as ZodPrefault,Ae as ZodPreprocess,St as ZodPromise,yt as ZodReadonly,ar as ZodRealError,Tt as ZodRecord,Ze as ZodSet,U as ZodString,Jt as ZodStringFormat,Qn as ZodSuccess,kn as ZodSymbol,Wn as ZodTemplateLiteral,dn as ZodTransform,Pt as ZodTuple,Nn as ZodType,Jn as ZodULID,Vt as ZodURL,xn as ZodUUID,nr as ZodUndefined,Gt as ZodUnion,Qt as ZodUnknown,Ln as ZodVoid,Tn as ZodXID,sn as ZodXor,nn as _ZodString,or as _default,Z as _function,Z as function,lt as any,_e as array,me as base64,qe as base64url,_n as bigint,J as boolean,jt as catch,mn as check,Ve as cidrv4,We as cidrv6,m as clone,Xe as codec,Er as coerce,g as config,F as core,be as cuid,ke as cuid2,Re as custom,nt as date,Nt as decode,Mn as decodeAsync,Nr as default,xr as describe,ce as discriminatedUnion,ht as e164,Ee as email,ft as emoji,qn as encode,Bt as encodeAsync,C as endsWith,vr as enum,vt as exactOptional,Ce as file,R as flattenError,Fe as float32,Bn as float64,V as formatError,jr as fromJSONSchema,wr as getErrorMap,k as globalRegistry,E as gt,T as gte,Me as guid,wt as hash,xt as hex,Dt as hostname,$e as httpUrl,z as includes,mr as instanceof,G as int,Kt as int32,Xn as int64,Dn as intersection,Hn as invertCodec,ln as ipv4,Mt as ipv6,Y as iso,jn as json,Kn as jwt,zt as keyof,yn as ksuid,er as lazy,n as length,Ut as literal,D as locales,Xt as looseObject,Fn as looseRecord,O as lowercase,ie as lt,ae as lte,Cn as mac,an as map,s as maxLength,ee as maxSize,en as meta,ne as mime,p as minLength,H as minSize,i as multipleOf,kt as nan,ir as nanoid,gr as nativeEnum,h as negative,It as never,c as nonnegative,fr as nonoptional,te as nonpositive,M as normalize,ot as null,it as nullable,ue as nullish,cr as number,ct as object,ge as optional,v as overwrite,bn as parse,tr as parseAsync,pe as partialRecord,Ke as pipe,y as positive,gn as prefault,q as preprocess,x as prettifyError,pn as promise,d as property,Be as readonly,Ue as record,Ye as refine,w as regex,N as regexes,t as registry,Wt as safeDecode,Zt as safeDecodeAsync,In as safeEncode,wn as safeEncodeAsync,on as safeParse,tn as safeParseAsync,Oe as set,Sr as setErrorMap,I as size,j as slugify,P as startsWith,Le as strictObject,tt as string,br as stringFormat,se as stringbool,mt as success,Te as superRefine,dt as symbol,_t as templateLiteral,o as toJSONSchema,A as toLowerCase,L as toUpperCase,Se as transform,B as treeifyError,S as trim,Pe as tuple,zn as uint32,je as uint64,Ct as ulid,de as undefined,bt as union,Et as unknown,b as uppercase,Qe as url,l as util,W as uuid,qt as uuidv4,Zn as uuidv6,On as uuidv7,ur as void,Un as xid,un as xor,Mr as z};
|
|
1
|
+
import{$ as e,$n as t,$r as n,$t as r,A as i,Ai as a,An as o,Ar as s,At as ee,B as te,Bi as ne,Bn as re,Br as ie,Bt as c,C as ae,Ci as oe,Cn as se,Cr as ce,Ct as le,D as ue,Di as de,Dn as fe,Dr as pe,Dt as me,E as he,Ei as ge,En as _e,Er as ve,Et as ye,F as be,Fi as xe,Fn as Se,Fr as Ce,Ft as l,G as we,Gn as Te,Gr as Ee,Gt as De,H as Oe,Hi as ke,Hn as Ae,Hr as je,Ht as Me,I as Ne,Ii as Pe,In as Fe,Ir as Ie,It as u,J as Le,Jn as Re,Jr as ze,Jt as Be,K as Ve,Kn as He,Kr as Ue,Kt as We,L as Ge,Li as Ke,Ln as qe,Lr as Je,Lt as Ye,M as Xe,Mi as Ze,Mn as Qe,Mr as $e,Mt as d,N as et,Ni as tt,Nn as nt,Nr as rt,Nt as f,O as it,Oi as at,On as ot,Or as st,Ot as ct,P as lt,Pi as ut,Pn as dt,Pr as ft,Pt as pt,Q as mt,Qn as ht,Qr as gt,Qt as _t,R as vt,Ri as yt,Rn as bt,Rr as xt,Rt as p,S as St,Si as Ct,Sn as wt,Sr as Tt,St as Et,T as Dt,Ti as Ot,Tn as kt,Tr as At,Tt as jt,U as Mt,Un as Nt,Ur as Pt,Ut as Ft,V as It,Vi as Lt,Vn as Rt,Vr as zt,Vt as Bt,W as Vt,Wn as Ht,Wr as Ut,Wt,X as Gt,Xn as Kt,Xr as qt,Xt as Jt,Y as Yt,Yn as Xt,Yr as Zt,Yt as Qt,Z as $t,Zn as en,Zr as tn,Zt as nn,_ as rn,_n as an,_r as on,_t as sn,a as cn,ai as ln,an as un,ar as dn,at as fn,b as pn,bi as mn,bn as hn,br as gn,bt as _n,c as vn,ci as yn,cn as bn,cr as xn,ct as Sn,d as Cn,di as wn,dn as Tn,dr as En,dt as Dn,ei as On,en as kn,er as An,et as jn,f as Mn,fi as Nn,fn as Pn,fr as Fn,ft as In,g as Ln,gi as Rn,gn as zn,gr as Bn,gt as m,h as Vn,hi as Hn,hn as Un,hr as Wn,ht as h,i as Gn,ii as Kn,in as qn,ir as Jn,it as Yn,j as Xn,ji as Zn,jn as Qn,jr as $n,jt as er,k as tr,ki as g,kn as _,kr as nr,kt as rr,l as ir,li as ar,ln as or,lr as sr,lt as cr,m as lr,mi as ur,mn as dr,mr as fr,mt as pr,n as mr,ni as hr,nn as gr,nr as _r,nt as vr,o as yr,oi as br,on as xr,or as Sr,ot as Cr,p as wr,pi as Tr,pn as Er,pr as Dr,pt as Or,q as kr,qn as Ar,qr as jr,qt as Mr,r as Nr,ri as Pr,rn as Fr,rr as Ir,rt as Lr,s as Rr,si as zr,sn as Br,sr as Vr,st as Hr,t as Ur,ti as Wr,tn as Gr,tr as Kr,tt as qr,u as Jr,ui as Yr,un as Xr,ur as Zr,ut as Qr,v as $r,vi as ei,vn as ti,vr as ni,vt as ri,w as ii,wi as ai,wn as oi,wr as si,wt as ci,x as li,xi as ui,xn as di,xr as fi,xt as pi,y as mi,yi as hi,yn as gi,yr as _i,yt as vi,z as yi,zi as v,zn as bi,zr as xi,zt as y}from"../_chunks/client/core-Bm8azZA6.js";var Si=ke({endsWith:()=>Dn,gt:()=>h,gte:()=>m,includes:()=>ri,length:()=>ee,lowercase:()=>er,lt:()=>d,lte:()=>f,maxLength:()=>l,maxSize:()=>u,mime:()=>Ye,minLength:()=>p,minSize:()=>y,multipleOf:()=>c,negative:()=>Ft,nonnegative:()=>De,nonpositive:()=>We,normalize:()=>Mr,overwrite:()=>Jt,positive:()=>nn,property:()=>_t,regex:()=>kn,size:()=>Gr,slugify:()=>gr,startsWith:()=>Fr,toLowerCase:()=>or,toUpperCase:()=>Xr,trim:()=>Tn,uppercase:()=>an}),Ci=ke({ZodISODate:()=>Ei,ZodISODateTime:()=>wi,ZodISODuration:()=>Ai,ZodISOTime:()=>Oi,date:()=>Di,datetime:()=>Ti,duration:()=>ji,time:()=>ki});const wi=v(`ZodISODateTime`,(e,t)=>{xn.init(e,t),T.init(e,t)});function Ti(e){return jt(wi,e)}const Ei=v(`ZodISODate`,(e,t)=>{Vr.init(e,t),T.init(e,t)});function Di(e){return ci(Ei,e)}const Oi=v(`ZodISOTime`,(e,t)=>{Zr.init(e,t),T.init(e,t)});function ki(e){return me(Oi,e)}const Ai=v(`ZodISODuration`,(e,t)=>{sr.init(e,t),T.init(e,t)});function ji(e){return ye(Ai,e)}const Mi=(e,t)=>{Rn.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>hi(e,t)},flatten:{value:t=>ei(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ge,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ge,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ni=v(`ZodError`,Mi),b=v(`ZodError`,Mi,{Parent:Error}),Pi=yn(b),Fi=ar(b),Ii=ur(b),Li=Hn(b),Ri=br(b),zi=Kn(b),Bi=zr(b),Vi=ln(b),Hi=Nn(b),Ui=Yr(b),Wi=Tr(b),Gi=wn(b);var Ki=ke({ZodAny:()=>Qa,ZodArray:()=>oo,ZodBase64:()=>Ca,ZodBase64URL:()=>Ta,ZodBigInt:()=>R,ZodBigIntFormat:()=>Ua,ZodBoolean:()=>L,ZodCIDRv4:()=>ya,ZodCIDRv6:()=>xa,ZodCUID:()=>M,ZodCUID2:()=>N,ZodCatch:()=>Yo,ZodCodec:()=>Y,ZodCustom:()=>Z,ZodCustomStringFormat:()=>P,ZodDate:()=>io,ZodDefault:()=>Vo,ZodDiscriminatedUnion:()=>ho,ZodE164:()=>Da,ZodEmail:()=>E,ZodEmoji:()=>A,ZodEnum:()=>G,ZodExactOptional:()=>Lo,ZodFile:()=>Mo,ZodFunction:()=>ds,ZodGUID:()=>D,ZodIPv4:()=>pa,ZodIPv6:()=>_a,ZodIntersection:()=>_o,ZodJWT:()=>ka,ZodKSUID:()=>da,ZodLazy:()=>ss,ZodLiteral:()=>Ao,ZodMAC:()=>ha,ZodMap:()=>wo,ZodNaN:()=>Zo,ZodNanoID:()=>j,ZodNever:()=>to,ZodNonOptional:()=>Go,ZodNull:()=>Xa,ZodNullable:()=>zo,ZodNumber:()=>F,ZodNumberFormat:()=>I,ZodObject:()=>H,ZodOptional:()=>Io,ZodPipe:()=>J,ZodPrefault:()=>Uo,ZodPreprocess:()=>ns,ZodPromise:()=>ls,ZodReadonly:()=>rs,ZodRecord:()=>W,ZodSet:()=>Eo,ZodString:()=>C,ZodStringFormat:()=>T,ZodSuccess:()=>qo,ZodSymbol:()=>Ka,ZodTemplateLiteral:()=>as,ZodTransform:()=>Po,ZodTuple:()=>yo,ZodType:()=>x,ZodULID:()=>sa,ZodURL:()=>k,ZodUUID:()=>O,ZodUndefined:()=>Ja,ZodUnion:()=>U,ZodUnknown:()=>eo,ZodVoid:()=>no,ZodXID:()=>la,ZodXor:()=>po,_ZodString:()=>S,_default:()=>Ho,_function:()=>X,any:()=>$a,array:()=>V,base64:()=>wa,base64url:()=>Ea,bigint:()=>Ha,boolean:()=>Va,catch:()=>Xo,check:()=>fs,cidrv4:()=>ba,cidrv6:()=>Sa,codec:()=>es,cuid:()=>aa,cuid2:()=>oa,custom:()=>ps,date:()=>ao,describe:()=>gs,discriminatedUnion:()=>go,e164:()=>Oa,email:()=>Yi,emoji:()=>ra,enum:()=>Oo,exactOptional:()=>Ro,file:()=>No,float32:()=>La,float64:()=>Ra,function:()=>X,guid:()=>Xi,hash:()=>Pa,hex:()=>Na,hostname:()=>Ma,httpUrl:()=>na,instanceof:()=>vs,int:()=>Ia,int32:()=>za,int64:()=>Wa,intersection:()=>vo,invertCodec:()=>ts,ipv4:()=>ma,ipv6:()=>va,json:()=>bs,jwt:()=>Aa,keyof:()=>so,ksuid:()=>fa,lazy:()=>cs,literal:()=>jo,looseObject:()=>uo,looseRecord:()=>Co,mac:()=>ga,map:()=>To,meta:()=>_s,nan:()=>Qo,nanoid:()=>ia,nativeEnum:()=>ko,never:()=>B,nonoptional:()=>Ko,null:()=>Za,nullable:()=>q,nullish:()=>Bo,number:()=>Fa,object:()=>co,optional:()=>K,partialRecord:()=>So,pipe:()=>$o,prefault:()=>Wo,preprocess:()=>xs,promise:()=>us,readonly:()=>is,record:()=>xo,refine:()=>ms,set:()=>Do,strictObject:()=>lo,string:()=>w,stringFormat:()=>ja,stringbool:()=>ys,success:()=>Jo,superRefine:()=>hs,symbol:()=>qa,templateLiteral:()=>os,transform:()=>Fo,tuple:()=>bo,uint32:()=>Ba,uint64:()=>Ga,ulid:()=>ca,undefined:()=>Ya,union:()=>fo,unknown:()=>z,url:()=>ta,uuid:()=>Zi,uuidv4:()=>Qi,uuidv6:()=>$i,uuidv7:()=>ea,void:()=>ro,xid:()=>ua,xor:()=>mo});const qi=new WeakMap;function Ji(e,t,n){let r=Object.getPrototypeOf(e),i=qi.get(r);if(i||(i=new Set,qi.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const x=v(`ZodType`,(e,t)=>(je.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Oe(e,`input`),output:Oe(e,`output`)}}),e.toJSONSchema=Mt(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Pi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ii(e,t,n),e.parseAsync=async(t,n)=>Fi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Li(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ri(e,t,n),e.decode=(t,n)=>zi(e,t,n),e.encodeAsync=async(t,n)=>Bi(e,t,n),e.decodeAsync=async(t,n)=>Vi(e,t,n),e.safeEncode=(t,n)=>Hi(e,t,n),e.safeDecode=(t,n)=>Ui(e,t,n),e.safeEncodeAsync=async(t,n)=>Wi(e,t,n),e.safeDecodeAsync=async(t,n)=>Gi(e,t,n),Ji(e,`ZodType`,{check(...e){let t=this.def;return this.clone(at(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ct(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ms(e,t))},superRefine(e,t){return this.check(hs(e,t))},overwrite(e){return this.check(Jt(e))},optional(){return K(this)},exactOptional(){return Ro(this)},nullable(){return q(this)},nullish(){return K(q(this))},nonoptional(e){return Ko(this,e)},array(){return V(this)},or(e){return fo([this,e])},and(e){return vo(this,e)},transform(e){return $o(this,Fo(e))},default(e){return Ho(this,e)},prefault(e){return Wo(this,e)},catch(e){return Xo(this,e)},pipe(e){return $o(this,e)},readonly(){return is(this)},describe(e){let t=this.clone();return _.add(t,{description:e}),t},meta(...e){if(e.length===0)return _.get(this);let t=this.clone();return _.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return _.get(e)?.description},configurable:!0}),e)),S=v(`_ZodString`,(e,t)=>{Ce.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xn(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Ji(e,`_ZodString`,{regex(...e){return this.check(kn(...e))},includes(...e){return this.check(ri(...e))},startsWith(...e){return this.check(Fr(...e))},endsWith(...e){return this.check(Dn(...e))},min(...e){return this.check(p(...e))},max(...e){return this.check(l(...e))},length(...e){return this.check(ee(...e))},nonempty(...e){return this.check(p(1,...e))},lowercase(e){return this.check(er(e))},uppercase(e){return this.check(an(e))},trim(){return this.check(Tn())},normalize(...e){return this.check(Mr(...e))},toLowerCase(){return this.check(or())},toUpperCase(){return this.check(Xr())},slugify(){return this.check(gr())}})}),C=v(`ZodString`,(e,t)=>{Ce.init(e,t),S.init(e,t),e.email=t=>e.check(cr(E,t)),e.url=t=>e.check(ti(k,t)),e.jwt=t=>e.check(ct(ka,t)),e.emoji=t=>e.check(Qr(A,t)),e.guid=t=>e.check(sn(D,t)),e.uuid=t=>e.check(gi(O,t)),e.uuidv4=t=>e.check(hn(O,t)),e.uuidv6=t=>e.check(di(O,t)),e.uuidv7=t=>e.check(wt(O,t)),e.nanoid=t=>e.check(Me(j,t)),e.guid=t=>e.check(sn(D,t)),e.cuid=t=>e.check(Yn(M,t)),e.cuid2=t=>e.check(fn(N,t)),e.ulid=t=>e.check(dr(sa,t)),e.base64=t=>e.check(kr(Ca,t)),e.base64url=t=>e.check(Le(Ta,t)),e.xid=t=>e.check(oi(la,t)),e.ksuid=t=>e.check(rr(da,t)),e.ipv4=t=>e.check(Et(pa,t)),e.ipv6=t=>e.check(le(_a,t)),e.cidrv4=t=>e.check($t(ya,t)),e.cidrv6=t=>e.check(mt(xa,t)),e.e164=t=>e.check(Sn(Da,t)),e.datetime=t=>e.check(Ti(t)),e.date=t=>e.check(Di(t)),e.time=t=>e.check(ki(t)),e.duration=t=>e.check(ji(t))});function w(e){return qn(C,e)}const T=v(`ZodStringFormat`,(e,t)=>{Ie.init(e,t),S.init(e,t)}),E=v(`ZodEmail`,(e,t)=>{ht.init(e,t),T.init(e,t)});function Yi(e){return cr(E,e)}const D=v(`ZodGUID`,(e,t)=>{Jn.init(e,t),T.init(e,t)});function Xi(e){return sn(D,e)}const O=v(`ZodUUID`,(e,t)=>{Ee.init(e,t),T.init(e,t)});function Zi(e){return gi(O,e)}function Qi(e){return hn(O,e)}function $i(e){return di(O,e)}function ea(e){return wt(O,e)}const k=v(`ZodURL`,(e,t)=>{Ut.init(e,t),T.init(e,t)});function ta(e){return ti(k,e)}function na(e){return ti(k,{protocol:hr,hostname:n,...g(e)})}const A=v(`ZodEmoji`,(e,n)=>{t.init(e,n),T.init(e,n)});function ra(e){return Qr(A,e)}const j=v(`ZodNanoID`,(e,t)=>{_i.init(e,t),T.init(e,t)});function ia(e){return Me(j,e)}const M=v(`ZodCUID`,(e,t)=>{Ae.init(e,t),T.init(e,t)});function aa(e){return Yn(M,e)}const N=v(`ZodCUID2`,(e,t)=>{Nt.init(e,t),T.init(e,t)});function oa(e){return fn(N,e)}const sa=v(`ZodULID`,(e,t)=>{Pt.init(e,t),T.init(e,t)});function ca(e){return dr(sa,e)}const la=v(`ZodXID`,(e,t)=>{qt.init(e,t),T.init(e,t)});function ua(e){return oi(la,e)}const da=v(`ZodKSUID`,(e,t)=>{Dr.init(e,t),T.init(e,t)});function fa(e){return rr(da,e)}const pa=v(`ZodIPv4`,(e,t)=>{dn.init(e,t),T.init(e,t)});function ma(e){return Et(pa,e)}const ha=v(`ZodMAC`,(e,t)=>{Bn.init(e,t),T.init(e,t)});function ga(e){return pt(ha,e)}const _a=v(`ZodIPv6`,(e,t)=>{Sr.init(e,t),T.init(e,t)});function va(e){return le(_a,e)}const ya=v(`ZodCIDRv4`,(e,t)=>{re.init(e,t),T.init(e,t)});function ba(e){return $t(ya,e)}const xa=v(`ZodCIDRv6`,(e,t)=>{Rt.init(e,t),T.init(e,t)});function Sa(e){return mt(xa,e)}const Ca=v(`ZodBase64`,(e,t)=>{Se.init(e,t),T.init(e,t)});function wa(e){return kr(Ca,e)}const Ta=v(`ZodBase64URL`,(e,t)=>{Fe.init(e,t),T.init(e,t)});function Ea(e){return Le(Ta,e)}const Da=v(`ZodE164`,(e,t)=>{en.init(e,t),T.init(e,t)});function Oa(e){return Sn(Da,e)}const ka=v(`ZodJWT`,(e,t)=>{Fn.init(e,t),T.init(e,t)});function Aa(e){return ct(ka,e)}const P=v(`ZodCustomStringFormat`,(e,t)=>{Ar.init(e,t),T.init(e,t)});function ja(e,t,n={}){return un(P,e,t,n)}function Ma(e){return un(P,`hostname`,Wr,e)}function Na(e){return un(P,`hex`,On,e)}function Pa(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Pr[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return un(P,n,r,t)}const F=v(`ZodNumber`,(e,t)=>{si.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>St(e,t,n,r),Ji(e,`ZodNumber`,{gt(e,t){return this.check(h(e,t))},gte(e,t){return this.check(m(e,t))},min(e,t){return this.check(m(e,t))},lt(e,t){return this.check(d(e,t))},lte(e,t){return this.check(f(e,t))},max(e,t){return this.check(f(e,t))},int(e){return this.check(Ia(e))},safe(e){return this.check(Ia(e))},positive(e){return this.check(h(0,e))},nonnegative(e){return this.check(m(0,e))},negative(e){return this.check(d(0,e))},nonpositive(e){return this.check(f(0,e))},multipleOf(e,t){return this.check(c(e,t))},step(e,t){return this.check(c(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Fa(e){return Qt(F,e)}const I=v(`ZodNumberFormat`,(e,t)=>{At.init(e,t),F.init(e,t)});function Ia(e){return vi(I,e)}function La(e){return Or(I,e)}function Ra(e){return pr(I,e)}function za(e){return _n(I,e)}function Ba(e){return Pn(I,e)}const L=v(`ZodBoolean`,(e,t)=>{bi.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cn(e,t,n,r)});function Va(e){return Gt(L,e)}const R=v(`ZodBigInt`,(e,t)=>{qe.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gn(e,t,n,r),e.gte=(t,n)=>e.check(m(t,n)),e.min=(t,n)=>e.check(m(t,n)),e.gt=(t,n)=>e.check(h(t,n)),e.gte=(t,n)=>e.check(m(t,n)),e.min=(t,n)=>e.check(m(t,n)),e.lt=(t,n)=>e.check(d(t,n)),e.lte=(t,n)=>e.check(f(t,n)),e.max=(t,n)=>e.check(f(t,n)),e.positive=t=>e.check(h(BigInt(0),t)),e.negative=t=>e.check(d(BigInt(0),t)),e.nonpositive=t=>e.check(f(BigInt(0),t)),e.nonnegative=t=>e.check(m(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(c(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Ha(e){return Yt(R,e)}const Ua=v(`ZodBigIntFormat`,(e,t)=>{bt.init(e,t),R.init(e,t)});function Wa(e){return pi(Ua,e)}function Ga(e){return Er(Ua,e)}const Ka=v(`ZodSymbol`,(e,t)=>{xt.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>et(e,t,n,r)});function qa(e){return bn(Ka,e)}const Ja=v(`ZodUndefined`,(e,t)=>{Ue.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vt(e,t,n,r)});function Ya(e){return Un(Ja,e)}const Xa=v(`ZodNull`,(e,t)=>{Tt.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pn(e,t,n,r)});function Za(e){return Be(Xa,e)}const Qa=v(`ZodAny`,(e,t)=>{nt.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mr(e,t,n,r)});function $a(){return we(Qa)}const eo=v(`ZodUnknown`,(e,t)=>{ze.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>te(e,t,n,r)});function z(){return zn(eo)}const to=v(`ZodNever`,(e,t)=>{gn.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$r(e,t,n,r)});function B(e){return Wt(to,e)}const no=v(`ZodVoid`,(e,t)=>{Zt.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>It(e,t,n,r)});function ro(e){return se(no,e)}const io=v(`ZodDate`,(e,t)=>{Re.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vn(e,t,n,r),e.min=(t,n)=>e.check(m(t,n)),e.max=(t,n)=>e.check(f(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function ao(e){return Hr(io,e)}const oo=v(`ZodArray`,(e,t)=>{dt.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nr(e,t,n,r),e.element=t.element,Ji(e,`ZodArray`,{min(e,t){return this.check(p(e,t))},nonempty(e){return this.check(p(1,e))},max(e,t){return this.check(l(e,t))},length(e,t){return this.check(ee(e,t))},unwrap(){return this.element}})});function V(e,t){return Ve(oo,e,t)}function so(e){let t=e._zod.def.shape;return Oo(Object.keys(t))}const H=v(`ZodObject`,(e,t)=>{ve.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ae(e,t,n,r),oe(e,`shape`,()=>t.shape),Ji(e,`ZodObject`,{keyof(){return Oo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:z()})},loose(){return this.clone({...this._zod.def,catchall:z()})},strict(){return this.clone({...this._zod.def,catchall:B()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ai(this,e)},safeExtend(e){return ut(this,e)},merge(e){return de(this,e)},pick(e){return Ze(this,e)},omit(e){return a(this,e)},partial(...e){return Zn(Io,this,e[0])},required(...e){return tt(Go,this,e[0])}})});function co(e,t){return new H({type:`object`,shape:e??{},...g(t)})}function lo(e,t){return new H({type:`object`,shape:e,catchall:B(),...g(t)})}function uo(e,t){return new H({type:`object`,shape:e,catchall:z(),...g(t)})}const U=v(`ZodUnion`,(e,t)=>{jr.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.options=t.options});function fo(e,t){return new U({type:`union`,options:e,...g(t)})}const po=v(`ZodXor`,(e,t)=>{U.init(e,t),tn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.options=t.options});function mo(e,t){return new po({type:`union`,options:e,inclusive:!1,...g(t)})}const ho=v(`ZodDiscriminatedUnion`,(e,t)=>{U.init(e,t),Kt.init(e,t)});function go(e,t,n){return new ho({type:`union`,options:t,discriminator:e,...g(n)})}const _o=v(`ZodIntersection`,(e,t)=>{En.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wr(e,t,n,r)});function vo(e,t){return new _o({type:`intersection`,left:e,right:t})}const yo=v(`ZodTuple`,(e,t)=>{zt.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ge(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function bo(e,t,n){let r=t instanceof je;return new yo({type:`tuple`,items:e,rest:r?t:null,...g(r?n:t)})}const W=v(`ZodRecord`,(e,t)=>{rt.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tr(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function xo(e,t,n){return!t||!t._zod?new W({type:`record`,keyType:w(),valueType:e,...g(t)}):new W({type:`record`,keyType:e,valueType:t,...g(n)})}function So(e,t,n){let r=Ct(e);return r._zod.values=void 0,new W({type:`record`,keyType:r,valueType:t,...g(n)})}function Co(e,t,n){return new W({type:`record`,keyType:e,valueType:t,mode:`loose`,...g(n)})}const wo=v(`ZodMap`,(e,t)=>{on.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ln(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(y(...t)),e.nonempty=t=>e.check(y(1,t)),e.max=(...t)=>e.check(u(...t)),e.size=(...t)=>e.check(Gr(...t))});function To(e,t,n){return new wo({type:`map`,keyType:e,valueType:t,...g(n)})}const Eo=v(`ZodSet`,(e,t)=>{ft.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i(e,t,n,r),e.min=(...t)=>e.check(y(...t)),e.nonempty=t=>e.check(y(1,t)),e.max=(...t)=>e.check(u(...t)),e.size=(...t)=>e.check(Gr(...t))});function Do(e,t){return new Eo({type:`set`,valueType:e,...g(t)})}const G=v(`ZodEnum`,(e,t)=>{An.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jr(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new G({...t,checks:[],...g(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new G({...t,checks:[],...g(r),entries:i})}});function Oo(e,t){return new G({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...g(t)})}function ko(e,t){return new G({type:`enum`,entries:e,...g(t)})}const Ao=v(`ZodLiteral`,(e,t)=>{Wn.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vn(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function jo(e,t){return new Ao({type:`literal`,values:Array.isArray(e)?e:[e],...g(t)})}const Mo=v(`ZodFile`,(e,t)=>{_r.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cn(e,t,n,r),e.min=(t,n)=>e.check(y(t,n)),e.max=(t,n)=>e.check(u(t,n)),e.mime=(t,n)=>e.check(Ye(Array.isArray(t)?t:[t],n))});function No(e){return In(Mo,e)}const Po=v(`ZodTransform`,(e,t)=>{ie.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ne(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ke(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ot(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Ot(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Fo(e){return new Po({type:`transform`,transform:e})}const Io=v(`ZodOptional`,(e,t)=>{pe.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function K(e){return new Io({type:`optional`,innerType:e})}const Lo=v(`ZodExactOptional`,(e,t)=>{Kr.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ro(e){return new Lo({type:`optional`,innerType:e})}const zo=v(`ZodNullable`,(e,t)=>{ce.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function q(e){return new zo({type:`nullable`,innerType:e})}function Bo(e){return K(q(e))}const Vo=v(`ZodDefault`,(e,t)=>{Xt.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ir(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ho(e,t){return new Vo({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():xe(t)}})}const Uo=v(`ZodPrefault`,(e,t)=>{nr.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>he(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wo(e,t){return new Uo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():xe(t)}})}const Go=v(`ZodNonOptional`,(e,t)=>{fi.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ko(e,t){return new Go({type:`nonoptional`,innerType:e,...g(t)})}const qo=v(`ZodSuccess`,(e,t)=>{Je.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xe(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jo(e){return new qo({type:`success`,innerType:e})}const Yo=v(`ZodCatch`,(e,t)=>{Ht.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Xo(e,t){return new Yo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Zo=v(`ZodNaN`,(e,t)=>{ni.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rn(e,t,n,r)});function Qo(e){return Bt(Zo,e)}const J=v(`ZodPipe`,(e,t)=>{st.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dt(e,t,n,r),e.in=t.in,e.out=t.out});function $o(e,t){return new J({type:`pipe`,in:e,out:t})}const Y=v(`ZodCodec`,(e,t)=>{J.init(e,t),Te.init(e,t)});function es(e,t,n){return new Y({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function ts(e){let t=e._zod.def;return new Y({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}const ns=v(`ZodPreprocess`,(e,t)=>{J.init(e,t),s.init(e,t)}),rs=v(`ZodReadonly`,(e,t)=>{$e.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>it(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function is(e){return new rs({type:`readonly`,innerType:e})}const as=v(`ZodTemplateLiteral`,(e,t)=>{xi.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lt(e,t,n,r)});function os(e,t){return new as({type:`template_literal`,parts:e,...g(t)})}const ss=v(`ZodLazy`,(e,t)=>{fr.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lr(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function cs(e){return new ss({type:`lazy`,getter:e})}const ls=v(`ZodPromise`,(e,t)=>{$n.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ue(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function us(e){return new ls({type:`promise`,innerType:e})}const ds=v(`ZodFunction`,(e,t)=>{Ir.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mn(e,t,n,r)});function X(e){return new ds({type:`function`,input:Array.isArray(e?.input)?bo(e?.input):e?.input??V(z()),output:e?.output??z()})}const Z=v(`ZodCustom`,(e,t)=>{He.init(e,t),x.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rr(e,t,n,r)});function fs(e){let t=new gt({check:`custom`});return t._zod.check=e,t}function ps(e,t){return Cr(Z,e??(()=>!0),t)}function ms(e,t={}){return r(Z,e,t)}function hs(e,t){return Br(e,t)}const gs=kt,_s=_e;function vs(e,t={}){let n=new Z({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...g(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const ys=(...e)=>xr({Codec:Y,Boolean:L,String:C},...e);function bs(e){let t=cs(()=>fo([w(e),Fa(),Va(),Za(),V(t),xo(w(),t)]));return t}function xs(e,t){return new ns({type:`pipe`,in:Fo(e),out:t})}const Ss={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function Cs(e){Lt({customError:e})}function ws(){return Lt().customError}var Ts;Ts||={};const Q={...Ki,...Si,iso:Ci},Es=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function Ds(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function Os(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function ks(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return Q.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Q.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=$(Os(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return Q.null();if(n.length===0)return Q.never();if(n.length===1)return Q.literal(n[0]);if(n.every(e=>typeof e==`string`))return Q.enum(n);let r=n.map(e=>Q.literal(e));return r.length<2?r[0]:Q.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return Q.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>ks({...e,type:n},t));return r.length===0?Q.never():r.length===1?r[0]:Q.union(r)}if(!n)return Q.any();let r;switch(n){case`string`:{let t=Q.string();if(e.format){let n=e.format;n===`email`?t=t.check(Q.email()):n===`uri`||n===`uri-reference`?t=t.check(Q.url()):n===`uuid`||n===`guid`?t=t.check(Q.uuid()):n===`date-time`?t=t.check(Q.iso.datetime()):n===`date`?t=t.check(Q.iso.date()):n===`time`?t=t.check(Q.iso.time()):n===`duration`?t=t.check(Q.iso.duration()):n===`ipv4`?t=t.check(Q.ipv4()):n===`ipv6`?t=t.check(Q.ipv6()):n===`mac`?t=t.check(Q.mac()):n===`cidr`?t=t.check(Q.cidrv4()):n===`cidr-v6`?t=t.check(Q.cidrv6()):n===`base64`?t=t.check(Q.base64()):n===`base64url`?t=t.check(Q.base64url()):n===`e164`?t=t.check(Q.e164()):n===`jwt`?t=t.check(Q.jwt()):n===`emoji`?t=t.check(Q.emoji()):n===`nanoid`?t=t.check(Q.nanoid()):n===`cuid`?t=t.check(Q.cuid()):n===`cuid2`?t=t.check(Q.cuid2()):n===`ulid`?t=t.check(Q.ulid()):n===`xid`?t=t.check(Q.xid()):n===`ksuid`&&(t=t.check(Q.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?Q.number().int():Q.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=Q.boolean();break;case`null`:r=Q.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=$(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=$(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?$(e.additionalProperties,t):Q.any();if(Object.keys(n).length===0){r=Q.record(i,a);break}let o=Q.object(n).passthrough(),s=Q.looseRecord(i,a);r=Q.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=$(i[e],t),r=Q.string().regex(new RegExp(e));o.push(Q.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(Q.object(n).passthrough()),s.push(...o),s.length===0)r=Q.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=Q.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=Q.intersection(e,s[t]);r=e}break}let o=Q.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall($(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>$(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?$(i,t):void 0;r=o?Q.tuple(a).rest(o):Q.tuple(a),typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>$(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?$(e.additionalItems,t):void 0;r=a?Q.tuple(n).rest(a):Q.tuple(n),typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(i!==void 0){let n=$(i,t),a=Q.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=Q.array(Q.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function $(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n=ks(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>$(e,t)),a=Q.union(i);n=r?Q.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>$(e,t)),a=Q.xor(i);n=r?Q.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:Q.any();else{let i=r?n:$(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=Q.intersection(i,$(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=Q.nullable(n)),e.readOnly===!0&&(n=Q.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))Es.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function As(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:Ds(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??_};return $(n,r)}var js=ke({bigint:()=>Fs,boolean:()=>Ps,date:()=>Is,number:()=>Ns,string:()=>Ms});function Ms(e){return Lr(C,e)}function Ns(e){return vr(F,e)}function Ps(e){return jn(L,e)}function Fs(t){return e(R,t)}function Is(e){return qr(io,e)}var Ls=ke({$brand:()=>yt,$input:()=>fe,$output:()=>ot,NEVER:()=>ne,TimePrecision:()=>Vt,ZodAny:()=>Qa,ZodArray:()=>oo,ZodBase64:()=>Ca,ZodBase64URL:()=>Ta,ZodBigInt:()=>R,ZodBigIntFormat:()=>Ua,ZodBoolean:()=>L,ZodCIDRv4:()=>ya,ZodCIDRv6:()=>xa,ZodCUID:()=>M,ZodCUID2:()=>N,ZodCatch:()=>Yo,ZodCodec:()=>Y,ZodCustom:()=>Z,ZodCustomStringFormat:()=>P,ZodDate:()=>io,ZodDefault:()=>Vo,ZodDiscriminatedUnion:()=>ho,ZodE164:()=>Da,ZodEmail:()=>E,ZodEmoji:()=>A,ZodEnum:()=>G,ZodError:()=>Ni,ZodExactOptional:()=>Lo,ZodFile:()=>Mo,ZodFirstPartyTypeKind:()=>Ts,ZodFunction:()=>ds,ZodGUID:()=>D,ZodIPv4:()=>pa,ZodIPv6:()=>_a,ZodISODate:()=>Ei,ZodISODateTime:()=>wi,ZodISODuration:()=>Ai,ZodISOTime:()=>Oi,ZodIntersection:()=>_o,ZodIssueCode:()=>Ss,ZodJWT:()=>ka,ZodKSUID:()=>da,ZodLazy:()=>ss,ZodLiteral:()=>Ao,ZodMAC:()=>ha,ZodMap:()=>wo,ZodNaN:()=>Zo,ZodNanoID:()=>j,ZodNever:()=>to,ZodNonOptional:()=>Go,ZodNull:()=>Xa,ZodNullable:()=>zo,ZodNumber:()=>F,ZodNumberFormat:()=>I,ZodObject:()=>H,ZodOptional:()=>Io,ZodPipe:()=>J,ZodPrefault:()=>Uo,ZodPreprocess:()=>ns,ZodPromise:()=>ls,ZodReadonly:()=>rs,ZodRealError:()=>b,ZodRecord:()=>W,ZodSet:()=>Eo,ZodString:()=>C,ZodStringFormat:()=>T,ZodSuccess:()=>qo,ZodSymbol:()=>Ka,ZodTemplateLiteral:()=>as,ZodTransform:()=>Po,ZodTuple:()=>yo,ZodType:()=>x,ZodULID:()=>sa,ZodURL:()=>k,ZodUUID:()=>O,ZodUndefined:()=>Ja,ZodUnion:()=>U,ZodUnknown:()=>eo,ZodVoid:()=>no,ZodXID:()=>la,ZodXor:()=>po,_ZodString:()=>S,_default:()=>Ho,_function:()=>X,any:()=>$a,array:()=>V,base64:()=>wa,base64url:()=>Ea,bigint:()=>Ha,boolean:()=>Va,catch:()=>Xo,check:()=>fs,cidrv4:()=>ba,cidrv6:()=>Sa,clone:()=>Ct,codec:()=>es,coerce:()=>js,config:()=>Lt,core:()=>Ur,cuid:()=>aa,cuid2:()=>oa,custom:()=>ps,date:()=>ao,decode:()=>zi,decodeAsync:()=>Vi,describe:()=>gs,discriminatedUnion:()=>go,e164:()=>Oa,email:()=>Yi,emoji:()=>ra,encode:()=>Ri,encodeAsync:()=>Bi,endsWith:()=>Dn,enum:()=>Oo,exactOptional:()=>Ro,file:()=>No,flattenError:()=>ei,float32:()=>La,float64:()=>Ra,formatError:()=>hi,fromJSONSchema:()=>As,function:()=>X,getErrorMap:()=>ws,globalRegistry:()=>_,gt:()=>h,gte:()=>m,guid:()=>Xi,hash:()=>Pa,hex:()=>Na,hostname:()=>Ma,httpUrl:()=>na,includes:()=>ri,instanceof:()=>vs,int:()=>Ia,int32:()=>za,int64:()=>Wa,intersection:()=>vo,invertCodec:()=>ts,ipv4:()=>ma,ipv6:()=>va,iso:()=>Ci,json:()=>bs,jwt:()=>Aa,keyof:()=>so,ksuid:()=>fa,lazy:()=>cs,length:()=>ee,literal:()=>jo,locales:()=>Qn,looseObject:()=>uo,looseRecord:()=>Co,lowercase:()=>er,lt:()=>d,lte:()=>f,mac:()=>ga,map:()=>To,maxLength:()=>l,maxSize:()=>u,meta:()=>_s,mime:()=>Ye,minLength:()=>p,minSize:()=>y,multipleOf:()=>c,nan:()=>Qo,nanoid:()=>ia,nativeEnum:()=>ko,negative:()=>Ft,never:()=>B,nonnegative:()=>De,nonoptional:()=>Ko,nonpositive:()=>We,normalize:()=>Mr,null:()=>Za,nullable:()=>q,nullish:()=>Bo,number:()=>Fa,object:()=>co,optional:()=>K,overwrite:()=>Jt,parse:()=>Pi,parseAsync:()=>Fi,partialRecord:()=>So,pipe:()=>$o,positive:()=>nn,prefault:()=>Wo,preprocess:()=>xs,prettifyError:()=>mn,promise:()=>us,property:()=>_t,readonly:()=>is,record:()=>xo,refine:()=>ms,regex:()=>kn,regexes:()=>Pr,registry:()=>o,safeDecode:()=>Ui,safeDecodeAsync:()=>Gi,safeEncode:()=>Hi,safeEncodeAsync:()=>Wi,safeParse:()=>Ii,safeParseAsync:()=>Li,set:()=>Do,setErrorMap:()=>Cs,size:()=>Gr,slugify:()=>gr,startsWith:()=>Fr,strictObject:()=>lo,string:()=>w,stringFormat:()=>ja,stringbool:()=>ys,success:()=>Jo,superRefine:()=>hs,symbol:()=>qa,templateLiteral:()=>os,toJSONSchema:()=>be,toLowerCase:()=>or,toUpperCase:()=>Xr,transform:()=>Fo,treeifyError:()=>ui,trim:()=>Tn,tuple:()=>bo,uint32:()=>Ba,uint64:()=>Ga,ulid:()=>ca,undefined:()=>Ya,union:()=>fo,unknown:()=>z,uppercase:()=>an,url:()=>ta,util:()=>Pe,uuid:()=>Zi,uuidv4:()=>Qi,uuidv6:()=>$i,uuidv7:()=>ea,void:()=>ro,xid:()=>ua,xor:()=>mo});Lt(Qe());var Rs=Ls;export{yt as $brand,fe as $input,ot as $output,ne as NEVER,Vt as TimePrecision,Qa as ZodAny,oo as ZodArray,Ca as ZodBase64,Ta as ZodBase64URL,R as ZodBigInt,Ua as ZodBigIntFormat,L as ZodBoolean,ya as ZodCIDRv4,xa as ZodCIDRv6,M as ZodCUID,N as ZodCUID2,Yo as ZodCatch,Y as ZodCodec,Z as ZodCustom,P as ZodCustomStringFormat,io as ZodDate,Vo as ZodDefault,ho as ZodDiscriminatedUnion,Da as ZodE164,E as ZodEmail,A as ZodEmoji,G as ZodEnum,Ni as ZodError,Lo as ZodExactOptional,Mo as ZodFile,Ts as ZodFirstPartyTypeKind,ds as ZodFunction,D as ZodGUID,pa as ZodIPv4,_a as ZodIPv6,Ei as ZodISODate,wi as ZodISODateTime,Ai as ZodISODuration,Oi as ZodISOTime,_o as ZodIntersection,Ss as ZodIssueCode,ka as ZodJWT,da as ZodKSUID,ss as ZodLazy,Ao as ZodLiteral,ha as ZodMAC,wo as ZodMap,Zo as ZodNaN,j as ZodNanoID,to as ZodNever,Go as ZodNonOptional,Xa as ZodNull,zo as ZodNullable,F as ZodNumber,I as ZodNumberFormat,H as ZodObject,Io as ZodOptional,J as ZodPipe,Uo as ZodPrefault,ns as ZodPreprocess,ls as ZodPromise,rs as ZodReadonly,b as ZodRealError,W as ZodRecord,Eo as ZodSet,C as ZodString,T as ZodStringFormat,qo as ZodSuccess,Ka as ZodSymbol,as as ZodTemplateLiteral,Po as ZodTransform,yo as ZodTuple,x as ZodType,sa as ZodULID,k as ZodURL,O as ZodUUID,Ja as ZodUndefined,U as ZodUnion,eo as ZodUnknown,no as ZodVoid,la as ZodXID,po as ZodXor,S as _ZodString,Ho as _default,X as _function,X as function,$a as any,V as array,wa as base64,Ea as base64url,Ha as bigint,Va as boolean,Xo as catch,fs as check,ba as cidrv4,Sa as cidrv6,Ct as clone,es as codec,js as coerce,Lt as config,Ur as core,aa as cuid,oa as cuid2,ps as custom,ao as date,zi as decode,Vi as decodeAsync,Rs as default,gs as describe,go as discriminatedUnion,Oa as e164,Yi as email,ra as emoji,Ri as encode,Bi as encodeAsync,Dn as endsWith,Oo as enum,Ro as exactOptional,No as file,ei as flattenError,La as float32,Ra as float64,hi as formatError,As as fromJSONSchema,ws as getErrorMap,_ as globalRegistry,h as gt,m as gte,Xi as guid,Pa as hash,Na as hex,Ma as hostname,na as httpUrl,ri as includes,vs as instanceof,Ia as int,za as int32,Wa as int64,vo as intersection,ts as invertCodec,ma as ipv4,va as ipv6,Ci as iso,bs as json,Aa as jwt,so as keyof,fa as ksuid,cs as lazy,ee as length,jo as literal,Qn as locales,uo as looseObject,Co as looseRecord,er as lowercase,d as lt,f as lte,ga as mac,To as map,l as maxLength,u as maxSize,_s as meta,Ye as mime,p as minLength,y as minSize,c as multipleOf,Qo as nan,ia as nanoid,ko as nativeEnum,Ft as negative,B as never,De as nonnegative,Ko as nonoptional,We as nonpositive,Mr as normalize,Za as null,q as nullable,Bo as nullish,Fa as number,co as object,K as optional,Jt as overwrite,Pi as parse,Fi as parseAsync,So as partialRecord,$o as pipe,nn as positive,Wo as prefault,xs as preprocess,mn as prettifyError,us as promise,_t as property,is as readonly,xo as record,ms as refine,kn as regex,Pr as regexes,o as registry,Ui as safeDecode,Gi as safeDecodeAsync,Hi as safeEncode,Wi as safeEncodeAsync,Ii as safeParse,Li as safeParseAsync,Do as set,Cs as setErrorMap,Gr as size,gr as slugify,Fr as startsWith,lo as strictObject,w as string,ja as stringFormat,ys as stringbool,Jo as success,hs as superRefine,qa as symbol,os as templateLiteral,be as toJSONSchema,or as toLowerCase,Xr as toUpperCase,Fo as transform,ui as treeifyError,Tn as trim,bo as tuple,Ba as uint32,Ga as uint64,ca as ulid,Ya as undefined,fo as union,z as unknown,an as uppercase,ta as url,Pe as util,Zi as uuid,Qi as uuidv4,$i as uuidv6,ea as uuidv7,ro as void,ua as xid,mo as xor,Ls as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_i as e}from"../_chunks/workflow/core-CXJbIkCL.js";function t(e){return e instanceof Object&&`name`in e&&(e.name===`ZodError`||e.name===`$ZodError`)&&`issues`in e&&Array.isArray(e.issues)}var n=`ZodValidationError`,r=class extends Error{name;details;constructor(e,t){super(e,t),this.name=n,this.details=i(t)}toString(){return this.message}};function i(e){if(e){let n=e.cause;if(t(n))return n.issues}return[]}function a(e){return e instanceof r}function o(e){return e instanceof Error&&e.name===n}function s(e){return{type:e.code,path:e.path,message:e.message??`Invalid input`}}function c(e){return{type:e.code,path:e.path,message:`unexpected element in ${e.origin}`}}function l(e){return{type:e.code,path:e.path,message:`unexpected key in ${e.origin}`}}var u=new Set([`a`,`e`,`i`,`o`,`u`,`h`]);function d(e){let t=e.charAt(0).toLowerCase();return[u.has(t)?`an`:`a`,e].join(` `)}function f(e){return e.description??``}function p(e,t={}){switch(typeof e){case`symbol`:return f(e);case`bigint`:case`number`:switch(t.localization){case!0:return e.toLocaleString();case!1:return e.toString();default:return e.toLocaleString(t.localization)}case`string`:return t.wrapStringValueInQuote?`"${e}"`:e;default:if(e instanceof Date)switch(t.localization){case!0:return e.toLocaleString();case!1:return e.toISOString();default:return e.toLocaleString(t.localization)}return String(e)}}function m(e,t){let n=``;switch(e.format){case`lowercase`:case`uppercase`:n+=`expected ${e.format} string`;break;case`starts_with`:n+=`expected string to start with "${e.prefix}"`;break;case`ends_with`:n+=`expected string to end with "${e.suffix}"`;break;case`includes`:n+=`expected string to include "${e.includes}"`;break;case`regex`:n+=`expected string to match pattern`,t.displayInvalidFormatDetails&&(n+=` "${e.pattern}"`);break;case`jwt`:n+=`expected a jwt`,t.displayInvalidFormatDetails&&e.inst&&`alg`in e.inst._zod.def&&(n+=`/${e.inst._zod.def.alg}`),n+=` token`;break;case`email`:n+=`expected an email address`;break;case`url`:case`uuid`:case`guid`:case`cuid`:case`cuid2`:case`ulid`:case`xid`:case`ksuid`:n+=`expected a ${e.format.toUpperCase()}`,e.inst&&`version`in e.inst._zod.def&&(n+=` ${e.inst._zod.def.version}`);break;case`date`:case`datetime`:case`time`:case`duration`:n+=`expected an ISO ${e.format}`;break;case`ipv4`:case`ipv6`:n+=`expected an ${e.format.slice(0,2).toUpperCase()}${e.format.slice(2)} address`;break;case`cidrv4`:case`cidrv6`:n+=`expected a ${e.format.slice(0,4).toUpperCase()}${e.format.slice(4)} address range`;break;case`base64`:case`base64url`:n+=`expected a ${e.format} encoded string`;break;case`e164`:n+=`expected an E.164 formatted phone number`;break;default:if(e.format.startsWith(`sha`)||e.format.startsWith(`md5`)){let[t,r]=e.format.split(`_`);n+=`expected a ${t.toUpperCase()}`,r&&(n+=` ${r}-encoded`),n+=` hash`;break}n+=`expected ${d(e.format)}`}if(`input`in e&&t.reportInput===`typeAndValue`){let r=p(e.input,{wrapStringValueInQuote:!0,localization:t.numberLocalization});n+=`, received ${r}`}return{type:e.code,path:e.path,message:n}}function h(e){if(e===null)return!0;switch(typeof e){case`string`:case`number`:case`bigint`:case`boolean`:case`symbol`:case`undefined`:return!0;default:return!1}}function g(e,t){let n=`expected ${e.expected}`;if(`input`in e&&t.reportInput!==!1){let r=e.input;if(n+=`, received ${_(r)}`,t.reportInput===`typeAndValue`){if(h(r)){let e=p(r,{wrapStringValueInQuote:!0,localization:t.numberLocalization});n+=` (${e})`}else if(r instanceof Date){let e=p(r,{localization:t.dateLocalization});n+=` (${e})`}}}return{type:e.code,path:e.path,message:n}}function _(e){return typeof e==`object`?e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:e instanceof Date?`date`:e instanceof RegExp?`regexp`:e instanceof Map?`map`:e instanceof Set?`set`:e instanceof Error?`error`:e instanceof Function?`function`:`object`:typeof e}function v(e){return{type:e.code,path:e.path,message:e.message??`Invalid input`}}function y(e,t){let n=(t.maxValuesToDisplay?e.slice(0,t.maxValuesToDisplay):e).map(e=>p(e,{wrapStringValueInQuote:t.wrapStringValuesInQuote}));return n.length<e.length&&n.push(`${e.length-n.length} more value(s)`),n.reduce((e,r,i)=>(i>0&&(i===n.length-1&&t.lastSeparator?e+=t.lastSeparator:e+=t.separator),e+=r,e),``)}function b(e,t){let n;if(n=e.expected===`stringbool`?`expected boolean as string`:e.values.length===0?`invalid value`:e.values.length===1?`expected value to be ${p(e.values[0],{wrapStringValueInQuote:!0})}`:`expected value to be one of ${y(e.values,{separator:t.allowedValuesSeparator,lastSeparator:t.allowedValuesLastSeparator,wrapStringValuesInQuote:t.wrapAllowedValuesInQuote,maxValuesToDisplay:t.maxAllowedValuesToDisplay})}`,`input`in e&&t.reportInput===`typeAndValue`){if(h(e.input)){let r=p(e.input,{wrapStringValueInQuote:!0,localization:t.numberLocalization});n+=`, received ${r}`}else if(e.input instanceof Date){let r=p(e.input,{localization:t.dateLocalization});n+=`, received ${r}`}}return{type:e.code,path:e.path,message:n}}function x(e,t){let n=`expected multiple of ${e.divisor}`;if(`input`in e&&t.reportInput===`typeAndValue`){let r=p(e.input,{wrapStringValueInQuote:!0,localization:t.numberLocalization});n+=`, received ${r}`}return{type:e.code,path:e.path,message:n}}function S(e,t){let n=e.origin===`date`?p(new Date(e.maximum),{localization:t.dateLocalization}):p(e.maximum,{localization:t.numberLocalization}),r=``;switch(e.origin){case`number`:case`int`:case`bigint`:r+=`expected number to be less than${e.inclusive?` or equal to`:``} ${n}`;break;case`string`:r+=`expected string to contain at most ${n} character(s)`;break;case`date`:r+=`expected date to be prior ${e.inclusive?`or equal to`:`to`} "${n}"`;break;case`array`:r+=`expected array to contain at most ${n} item(s)`;break;case`set`:r+=`expected set to contain at most ${n} item(s)`;break;case`file`:r+=`expected file to not exceed ${n} byte(s) in size`;break;default:r+=`expected value to be less than${e.inclusive?` or equal to`:``} ${n}`}if(`input`in e&&t.reportInput===`typeAndValue`){let n=e.input;if(h(n)){let e=p(n,{wrapStringValueInQuote:!0,localization:t.numberLocalization});r+=`, received ${e}`}else if(n instanceof Date){let e=p(n,{localization:t.dateLocalization});r+=`, received ${e}`}}return{type:e.code,path:e.path,message:r}}function C(e,t){let n=e.origin===`date`?p(new Date(e.minimum),{localization:t.dateLocalization}):p(e.minimum,{localization:t.numberLocalization}),r=``;switch(e.origin){case`number`:case`int`:case`bigint`:r+=`expected number to be greater than${e.inclusive?` or equal to`:``} ${n}`;break;case`date`:r+=`expected date to be ${e.inclusive?`later or equal to`:`later to`} "${n}"`;break;case`string`:r+=`expected string to contain at least ${n} character(s)`;break;case`array`:r+=`expected array to contain at least ${n} item(s)`;break;case`set`:r+=`expected set to contain at least ${n} item(s)`;break;case`file`:r+=`expected file to be at least ${n} byte(s) in size`;break;default:r+=`expected value to be greater than${e.inclusive?` or equal to`:``} ${n}`}if(`input`in e&&t.reportInput===`typeAndValue`){let n=e.input;if(h(n)){let e=p(n,{wrapStringValueInQuote:!0,localization:t.numberLocalization});r+=`, received ${e}`}else if(n instanceof Date){let e=p(n,{localization:t.dateLocalization});r+=`, received ${e}`}}return{type:e.code,path:e.path,message:r}}function w(e,t){let n=y(e.keys,{separator:t.unrecognizedKeysSeparator,lastSeparator:t.unrecognizedKeysLastSeparator,wrapStringValuesInQuote:t.wrapUnrecognizedKeysInQuote,maxValuesToDisplay:t.maxUnrecognizedKeysToDisplay});return{type:e.code,path:e.path,message:`unrecognized key(s) ${n} in object`}}var T={invalid_type:g,too_big:S,too_small:C,invalid_format:m,invalid_value:b,invalid_element:c,not_multiple_of:x,unrecognized_keys:w,invalid_key:l,custom:s,invalid_union:v},E={reportInput:`type`,displayInvalidFormatDetails:!1,allowedValuesSeparator:`, `,allowedValuesLastSeparator:` or `,wrapAllowedValuesInQuote:!0,maxAllowedValuesToDisplay:10,unrecognizedKeysSeparator:`, `,unrecognizedKeysLastSeparator:` and `,wrapUnrecognizedKeysInQuote:!0,maxUnrecognizedKeysToDisplay:5,dateLocalization:!0,numberLocalization:!0};function D(e={}){let t={...E,...e};return e=>{if(e.code===void 0)return`Not supported issue type`;let n=T[e.code];return n(e,t).message}}function O(e){return e.length!==0}var k=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function A(e){if(e.length===1){let t=e[0];return typeof t==`symbol`&&(t=f(t)),t.toString()||`""`}return e.reduce((e,t)=>typeof t==`number`?e+`[`+t.toString()+`]`:(typeof t==`symbol`&&(t=f(t)),t.includes(`"`)?e+`["`+j(t)+`"]`:k.test(t)?e+(e.length===0?``:`.`)+t:e+`["`+t+`"]`),``)}function j(e){return e.replace(/"/g,`\\"`)}function M(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}var N={prefix:`Validation error`,prefixSeparator:`: `,maxIssuesInMessage:99,unionSeparator:` or `,issueSeparator:`; `,includePath:!0,forceTitleCase:!0};function P(e={}){let t={...N,...e};return function(e){return I(e.slice(0,t.maxIssuesInMessage).map(e=>F(e,t)).join(t.issueSeparator),t)}}function F(e,t){if(e.code===`invalid_union`&&O(e.errors)){let n=e.errors.map(n=>n.map(n=>F({...n,path:e.path.concat(n.path)},t)).join(t.issueSeparator));return Array.from(new Set(n)).join(t.unionSeparator)}let n=[];t.forceTitleCase?n.push(M(e.message)):n.push(e.message);pathCondition:if(t.includePath&&e.path!==void 0&&O(e.path)){if(e.path.length===1){let t=e.path[0];if(typeof t==`number`){n.push(` at index ${t}`);break pathCondition}}n.push(` at "${A(e.path)}"`)}return n.join(``)}function I(e,t){return t.prefix==null?e.length>0?e:N.prefix:e.length>0?[t.prefix,e].join(t.prefixSeparator):t.prefix}function L(e,n={}){if(!t(e))throw TypeError(`Invalid zodError param; expected instance of ZodError. Did you mean to use the "${V.name}" method instead?`);return R(e,n)}function R(e,t={}){let n=e.issues,i;return i=O(n)?z(t)(n):e.message,new r(i,{cause:e})}function z(e){return`messageBuilder`in e?e.messageBuilder:P(e)}var B=(e={})=>n=>t(n)?R(n,e):n instanceof Error?new r(n.message,{cause:n}):new r(`Unknown error`);function V(e,t={}){return B(t)(e)}function H(t,n={}){return new r(U(n)([t]),{cause:new e([t])})}function U(e){return`messageBuilder`in e?e.messageBuilder:P(e)}export{r as ValidationError,D as createErrorMap,P as createMessageBuilder,V as fromError,L as fromZodError,H as fromZodIssue,a as isValidationError,o as isValidationErrorLike,t as isZodErrorLike,B as toValidationError};
|
|
1
|
+
import{_i as e}from"../_chunks/client/core-Bm8azZA6.js";function t(e){return e instanceof Object&&`name`in e&&(e.name===`ZodError`||e.name===`$ZodError`)&&`issues`in e&&Array.isArray(e.issues)}var n=`ZodValidationError`,r=class extends Error{name;details;constructor(e,t){super(e,t),this.name=n,this.details=i(t)}toString(){return this.message}};function i(e){if(e){let n=e.cause;if(t(n))return n.issues}return[]}function a(e){return e instanceof r}function o(e){return e instanceof Error&&e.name===n}function s(e){return{type:e.code,path:e.path,message:e.message??`Invalid input`}}function c(e){return{type:e.code,path:e.path,message:`unexpected element in ${e.origin}`}}function l(e){return{type:e.code,path:e.path,message:`unexpected key in ${e.origin}`}}var u=new Set([`a`,`e`,`i`,`o`,`u`,`h`]);function d(e){let t=e.charAt(0).toLowerCase();return[u.has(t)?`an`:`a`,e].join(` `)}function f(e){return e.description??``}function p(e,t={}){switch(typeof e){case`symbol`:return f(e);case`bigint`:case`number`:switch(t.localization){case!0:return e.toLocaleString();case!1:return e.toString();default:return e.toLocaleString(t.localization)}case`string`:return t.wrapStringValueInQuote?`"${e}"`:e;default:if(e instanceof Date)switch(t.localization){case!0:return e.toLocaleString();case!1:return e.toISOString();default:return e.toLocaleString(t.localization)}return String(e)}}function m(e,t){let n=``;switch(e.format){case`lowercase`:case`uppercase`:n+=`expected ${e.format} string`;break;case`starts_with`:n+=`expected string to start with "${e.prefix}"`;break;case`ends_with`:n+=`expected string to end with "${e.suffix}"`;break;case`includes`:n+=`expected string to include "${e.includes}"`;break;case`regex`:n+=`expected string to match pattern`,t.displayInvalidFormatDetails&&(n+=` "${e.pattern}"`);break;case`jwt`:n+=`expected a jwt`,t.displayInvalidFormatDetails&&e.inst&&`alg`in e.inst._zod.def&&(n+=`/${e.inst._zod.def.alg}`),n+=` token`;break;case`email`:n+=`expected an email address`;break;case`url`:case`uuid`:case`guid`:case`cuid`:case`cuid2`:case`ulid`:case`xid`:case`ksuid`:n+=`expected a ${e.format.toUpperCase()}`,e.inst&&`version`in e.inst._zod.def&&(n+=` ${e.inst._zod.def.version}`);break;case`date`:case`datetime`:case`time`:case`duration`:n+=`expected an ISO ${e.format}`;break;case`ipv4`:case`ipv6`:n+=`expected an ${e.format.slice(0,2).toUpperCase()}${e.format.slice(2)} address`;break;case`cidrv4`:case`cidrv6`:n+=`expected a ${e.format.slice(0,4).toUpperCase()}${e.format.slice(4)} address range`;break;case`base64`:case`base64url`:n+=`expected a ${e.format} encoded string`;break;case`e164`:n+=`expected an E.164 formatted phone number`;break;default:if(e.format.startsWith(`sha`)||e.format.startsWith(`md5`)){let[t,r]=e.format.split(`_`);n+=`expected a ${t.toUpperCase()}`,r&&(n+=` ${r}-encoded`),n+=` hash`;break}n+=`expected ${d(e.format)}`}if(`input`in e&&t.reportInput===`typeAndValue`){let r=p(e.input,{wrapStringValueInQuote:!0,localization:t.numberLocalization});n+=`, received ${r}`}return{type:e.code,path:e.path,message:n}}function h(e){if(e===null)return!0;switch(typeof e){case`string`:case`number`:case`bigint`:case`boolean`:case`symbol`:case`undefined`:return!0;default:return!1}}function g(e,t){let n=`expected ${e.expected}`;if(`input`in e&&t.reportInput!==!1){let r=e.input;if(n+=`, received ${_(r)}`,t.reportInput===`typeAndValue`){if(h(r)){let e=p(r,{wrapStringValueInQuote:!0,localization:t.numberLocalization});n+=` (${e})`}else if(r instanceof Date){let e=p(r,{localization:t.dateLocalization});n+=` (${e})`}}}return{type:e.code,path:e.path,message:n}}function _(e){return typeof e==`object`?e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:e instanceof Date?`date`:e instanceof RegExp?`regexp`:e instanceof Map?`map`:e instanceof Set?`set`:e instanceof Error?`error`:e instanceof Function?`function`:`object`:typeof e}function v(e){return{type:e.code,path:e.path,message:e.message??`Invalid input`}}function y(e,t){let n=(t.maxValuesToDisplay?e.slice(0,t.maxValuesToDisplay):e).map(e=>p(e,{wrapStringValueInQuote:t.wrapStringValuesInQuote}));return n.length<e.length&&n.push(`${e.length-n.length} more value(s)`),n.reduce((e,r,i)=>(i>0&&(i===n.length-1&&t.lastSeparator?e+=t.lastSeparator:e+=t.separator),e+=r,e),``)}function b(e,t){let n;if(n=e.expected===`stringbool`?`expected boolean as string`:e.values.length===0?`invalid value`:e.values.length===1?`expected value to be ${p(e.values[0],{wrapStringValueInQuote:!0})}`:`expected value to be one of ${y(e.values,{separator:t.allowedValuesSeparator,lastSeparator:t.allowedValuesLastSeparator,wrapStringValuesInQuote:t.wrapAllowedValuesInQuote,maxValuesToDisplay:t.maxAllowedValuesToDisplay})}`,`input`in e&&t.reportInput===`typeAndValue`){if(h(e.input)){let r=p(e.input,{wrapStringValueInQuote:!0,localization:t.numberLocalization});n+=`, received ${r}`}else if(e.input instanceof Date){let r=p(e.input,{localization:t.dateLocalization});n+=`, received ${r}`}}return{type:e.code,path:e.path,message:n}}function x(e,t){let n=`expected multiple of ${e.divisor}`;if(`input`in e&&t.reportInput===`typeAndValue`){let r=p(e.input,{wrapStringValueInQuote:!0,localization:t.numberLocalization});n+=`, received ${r}`}return{type:e.code,path:e.path,message:n}}function S(e,t){let n=e.origin===`date`?p(new Date(e.maximum),{localization:t.dateLocalization}):p(e.maximum,{localization:t.numberLocalization}),r=``;switch(e.origin){case`number`:case`int`:case`bigint`:r+=`expected number to be less than${e.inclusive?` or equal to`:``} ${n}`;break;case`string`:r+=`expected string to contain at most ${n} character(s)`;break;case`date`:r+=`expected date to be prior ${e.inclusive?`or equal to`:`to`} "${n}"`;break;case`array`:r+=`expected array to contain at most ${n} item(s)`;break;case`set`:r+=`expected set to contain at most ${n} item(s)`;break;case`file`:r+=`expected file to not exceed ${n} byte(s) in size`;break;default:r+=`expected value to be less than${e.inclusive?` or equal to`:``} ${n}`}if(`input`in e&&t.reportInput===`typeAndValue`){let n=e.input;if(h(n)){let e=p(n,{wrapStringValueInQuote:!0,localization:t.numberLocalization});r+=`, received ${e}`}else if(n instanceof Date){let e=p(n,{localization:t.dateLocalization});r+=`, received ${e}`}}return{type:e.code,path:e.path,message:r}}function C(e,t){let n=e.origin===`date`?p(new Date(e.minimum),{localization:t.dateLocalization}):p(e.minimum,{localization:t.numberLocalization}),r=``;switch(e.origin){case`number`:case`int`:case`bigint`:r+=`expected number to be greater than${e.inclusive?` or equal to`:``} ${n}`;break;case`date`:r+=`expected date to be ${e.inclusive?`later or equal to`:`later to`} "${n}"`;break;case`string`:r+=`expected string to contain at least ${n} character(s)`;break;case`array`:r+=`expected array to contain at least ${n} item(s)`;break;case`set`:r+=`expected set to contain at least ${n} item(s)`;break;case`file`:r+=`expected file to be at least ${n} byte(s) in size`;break;default:r+=`expected value to be greater than${e.inclusive?` or equal to`:``} ${n}`}if(`input`in e&&t.reportInput===`typeAndValue`){let n=e.input;if(h(n)){let e=p(n,{wrapStringValueInQuote:!0,localization:t.numberLocalization});r+=`, received ${e}`}else if(n instanceof Date){let e=p(n,{localization:t.dateLocalization});r+=`, received ${e}`}}return{type:e.code,path:e.path,message:r}}function w(e,t){let n=y(e.keys,{separator:t.unrecognizedKeysSeparator,lastSeparator:t.unrecognizedKeysLastSeparator,wrapStringValuesInQuote:t.wrapUnrecognizedKeysInQuote,maxValuesToDisplay:t.maxUnrecognizedKeysToDisplay});return{type:e.code,path:e.path,message:`unrecognized key(s) ${n} in object`}}var T={invalid_type:g,too_big:S,too_small:C,invalid_format:m,invalid_value:b,invalid_element:c,not_multiple_of:x,unrecognized_keys:w,invalid_key:l,custom:s,invalid_union:v},E={reportInput:`type`,displayInvalidFormatDetails:!1,allowedValuesSeparator:`, `,allowedValuesLastSeparator:` or `,wrapAllowedValuesInQuote:!0,maxAllowedValuesToDisplay:10,unrecognizedKeysSeparator:`, `,unrecognizedKeysLastSeparator:` and `,wrapUnrecognizedKeysInQuote:!0,maxUnrecognizedKeysToDisplay:5,dateLocalization:!0,numberLocalization:!0};function D(e={}){let t={...E,...e};return e=>{if(e.code===void 0)return`Not supported issue type`;let n=T[e.code];return n(e,t).message}}function O(e){return e.length!==0}var k=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function A(e){if(e.length===1){let t=e[0];return typeof t==`symbol`&&(t=f(t)),t.toString()||`""`}return e.reduce((e,t)=>typeof t==`number`?e+`[`+t.toString()+`]`:(typeof t==`symbol`&&(t=f(t)),t.includes(`"`)?e+`["`+j(t)+`"]`:k.test(t)?e+(e.length===0?``:`.`)+t:e+`["`+t+`"]`),``)}function j(e){return e.replace(/"/g,`\\"`)}function M(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}var N={prefix:`Validation error`,prefixSeparator:`: `,maxIssuesInMessage:99,unionSeparator:` or `,issueSeparator:`; `,includePath:!0,forceTitleCase:!0};function P(e={}){let t={...N,...e};return function(e){return I(e.slice(0,t.maxIssuesInMessage).map(e=>F(e,t)).join(t.issueSeparator),t)}}function F(e,t){if(e.code===`invalid_union`&&O(e.errors)){let n=e.errors.map(n=>n.map(n=>F({...n,path:e.path.concat(n.path)},t)).join(t.issueSeparator));return Array.from(new Set(n)).join(t.unionSeparator)}let n=[];t.forceTitleCase?n.push(M(e.message)):n.push(e.message);pathCondition:if(t.includePath&&e.path!==void 0&&O(e.path)){if(e.path.length===1){let t=e.path[0];if(typeof t==`number`){n.push(` at index ${t}`);break pathCondition}}n.push(` at "${A(e.path)}"`)}return n.join(``)}function I(e,t){return t.prefix==null?e.length>0?e:N.prefix:e.length>0?[t.prefix,e].join(t.prefixSeparator):t.prefix}function L(e,n={}){if(!t(e))throw TypeError(`Invalid zodError param; expected instance of ZodError. Did you mean to use the "${V.name}" method instead?`);return R(e,n)}function R(e,t={}){let n=e.issues,i;return i=O(n)?z(t)(n):e.message,new r(i,{cause:e})}function z(e){return`messageBuilder`in e?e.messageBuilder:P(e)}var B=(e={})=>n=>t(n)?R(n,e):n instanceof Error?new r(n.message,{cause:n}):new r(`Unknown error`);function V(e,t={}){return B(t)(e)}function H(t,n={}){return new r(U(n)([t]),{cause:new e([t])})}function U(e){return`messageBuilder`in e?e.messageBuilder:P(e)}export{r as ValidationError,D as createErrorMap,P as createMessageBuilder,V as fromError,L as fromZodError,H as fromZodIssue,a as isValidationError,o as isValidationErrorLike,t as isZodErrorLike,B as toValidationError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger,formatError}from"#internal/logging.js";import{callAdapterEventHandler,defaultDeliverResult}from"#channel/adapter.js";import{AuthKey,CapabilitiesKey,ContinuationTokenKey,ModeKey}from"#context/keys.js";import{createAuthorizationCompletedEvent,createSessionFailedEvent,encodeMessageStreamEvent,timestampHandleMessageStreamEvent}from"#protocol/message.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{getHarnessEmissionState}from"#harness/emission.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{hydrateDurableSession,refreshSessionFromTurnAgent}from"#execution/session.js";import{buildTurnAttributes,readRootSessionId}from"#execution/eve-workflow-attributes.js";import{setEveAttributes}from"#runtime/attributes/emit.js";import{deserializeContext,serializeContext}from"#context/serialize.js";import{getRuntimeActionKeyFromInterrupt,isCodeModeRuntimeActionInterrupt}from"#harness/code-mode-runtime-action-state.js";import{getPendingCodeModeInterrupt}from"#harness/code-mode-interrupt-state.js";import{getPendingRuntimeActionBatch}from"#harness/runtime-actions.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{createWorkflowRuntime,startWorkflowPreferLatest}from"#execution/workflow-runtime.js";import{upsertProxyInputRequests}from"#harness/proxy-input-requests.js";import{setChannelContext}from"#execution/channel-context.js";import{CallbackBaseUrlKey,PendingAuthorizationResultKey,getPendingAuthorization}from"#harness/authorization.js";import{createTurnWorkflowInput}from"#execution/durable-session-migrations/turn-workflow.js";import{coalesceTurnInputs}from"#harness/messages.js";import{dispatchStreamEventHooks}from"#context/hook-lifecycle.js";import{dispatchDynamicInstructionEvent}from"#context/dynamic-instruction-lifecycle.js";import{dispatchDynamicSkillEvent}from"#context/dynamic-skill-lifecycle.js";import{dispatchDynamicToolEvent}from"#context/dynamic-tool-lifecycle.js";import{runStep,withContextScope}from"#context/run-step.js";import{hasPendingInputBatch}from"#harness/input-requests.js";import{getRuntimeActionRequestKey}from"#runtime/actions/keys.js";import{createExecutionNodeStep}from"#execution/node-step.js";import{emitProxiedInputRequest,routeDeliverPayload}from"#execution/subagent-hitl-proxy.js";import{turnWorkflow}from"#execution/turn-workflow.js";async function turnStep(e){"use step";let t=e;await setEveAttributes(buildTurnAttributes({parentSessionId:t.sessionState.sessionId,rootSessionId:readRootSessionId(t.serializedContext)??t.sessionState.sessionId}));let o=await readDurableSession(t.sessionState),l=await deserializeContext(t.serializedContext),f=l.require(ChannelKey),p=l.require(BundleKey),m=hydrateDurableSession({compactionOverrides:{thresholdPercent:p.resolvedAgent.config.compaction?.thresholdPercent},durable:o,turnAgent:p.turnAgent});try{let{getWorkflowMetadata:e}=await import(`#compiled/@workflow/core/index.js`),t=e();typeof t.url==`string`&&l.set(CallbackBaseUrlKey,t.url.replace(/\/$/,``))}catch{}let h=getPendingAuthorization(o.state),g;if(h&&t.input?.kind===`deliver`){let e=[],n=[],r=[];for(let i of t.input.payloads){let t=i.authorizationCallback;if(t){let r=h.challenges.find(e=>e.name===t.connectionName);r&&(e.push({name:r.name,resume:r.resume,callback:t.callback,hookUrl:r.hookUrl}),n.push({name:r.name,authorization:r.challenge}))}else r.push(i)}e.length>0&&(l.set(PendingAuthorizationResultKey,e),g=n,t=r.length>0?{...t,input:{...t.input,payloads:r}}:{...t,input:void 0})}t.input?.kind===`deliver`&&t.input.auth!==void 0&&l.set(AuthKey,t.input.auth??null);let _=buildAdapterContext(f,l),v;if(t.input?.kind===`deliver`){let e=[];for(let n of t.input.payloads){let t=f.deliver?await f.deliver(n,_):defaultDeliverResult(n);t!=null&&e.push(t)}v=e.length===0?void 0:e.reduce(coalesceTurnInputs)}else t.input?.kind===`runtime-action-result`&&(v={runtimeActionResults:t.input.results});if(t.input?.kind===`deliver`&&setChannelContext(l,{...f,state:{..._.state}}),t.input?.kind===`deliver`&&v===void 0){let e=reconcileSessionContinuationToken(l,m),n=serializeContext(l),r=e===m?t.sessionState:createDurableSessionState({session:e});return{action:`park`,...derivePendingState(e),serializedContext:n,sessionState:r}}let y=t.parentWritable.getWriter(),b=p.hookRegistry,x=p.resolvedAgent.dynamicInstructionsResolvers??[],S=p.resolvedAgent.dynamicSkillResolvers??[],C=p.resolvedAgent.dynamicToolResolvers??[],emit=async e=>{let t=await callAdapterEventHandler(f,e,_);return setChannelContext(l,{...f,state:{..._.state}}),await y.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(t))),t},handleEvent=async(e,t)=>{let n=await emit(e);await dispatchStreamEventHooks({ctx:l,registry:b,event:n}),await dispatchDynamicToolEvent({ctx:l,resolvers:C,event:n,messages:t??[]}),await dispatchDynamicSkillEvent({ctx:l,resolvers:S,event:n,messages:t??[]}),await dispatchDynamicInstructionEvent({ctx:l,resolvers:x,event:n,messages:t??[]})},w=l.require(ModeKey),T=await runStep(l,m,async e=>{let t=resolveEffectiveOutputSchema({agentOutputSchema:p.turnAgent.outputSchema,input:v,mode:w,session:e});if(g){let e=getHarnessEmissionState(t.state);for(let{name:t,authorization:n}of g)await handleEvent(createAuthorizationCompletedEvent({authorization:n,name:t,outcome:`authorized`,sequence:e.sequence,stepIndex:e.stepIndex,turnId:e.turnId}))}let n=l.get(CapabilitiesKey);return(async(e,t)=>{let r=refreshSessionFromTurnAgent({compactionOverrides:{thresholdPercent:p.resolvedAgent.config.compaction?.thresholdPercent},session:e,turnAgent:p.turnAgent});return createExecutionNodeStep({capabilities:n,createRuntime:createWorkflowRuntime,handleEvent,mode:w,modelResolutionScope:{moduleMap:p.moduleMap,nodeId:p.nodeId},node:p.graph.root})(r,t)})(t,v)}),E=reconcileSessionContinuationToken(l,T.session),D=serializeContext(l);T={...T,session:E};let O=createDurableSessionState({session:T.session});if(T.next!==null&&typeof T.next==`object`&&`done`in T.next)return await y.close(),{action:`done`,output:T.next.output,isError:T.next.isError,serializedContext:D,sessionState:O};if(T.next===null){y.releaseLock();let e=getPendingCodeModeInterrupt(T.session.state);return e!==void 0&&isCodeModeRuntimeActionInterrupt(e.interrupt)?{action:`dispatch-code-mode-runtime-actions`,pendingRuntimeActionKeys:[getRuntimeActionKeyFromInterrupt(e.interrupt)],serializedContext:D,sessionState:O}:{action:`park`,...derivePendingState(T.session),serializedContext:D,sessionState:O}}return y.releaseLock(),{action:`continue`,serializedContext:D,sessionState:O}}function derivePendingState(e){let t=getPendingRuntimeActionBatch(e.state),n=getPendingAuthorization(e.state),r={authorizationNames:n?.challenges.map(e=>e.name),hasPendingAuthorization:n!==void 0,hasPendingInputBatch:hasPendingInputBatch(e.state)};return t===void 0?r:{...r,pendingRuntimeActionKeys:t.actions.map(e=>getRuntimeActionRequestKey(e))}}function reconcileSessionContinuationToken(e,t){let n=e.get(ContinuationTokenKey);return n===void 0||n===t.continuationToken?t:{...t,continuationToken:n}}function resolveEffectiveOutputSchema(e){let{agentOutputSchema:t,input:n,mode:r,session:i}=e;return n?.outputSchema===void 0?r===`task`&&i.outputSchema===void 0&&t!==void 0?{...i,outputSchema:t}:i:{...i,outputSchema:n.outputSchema}}const log=createLogger(`execution.workflow-entry`);async function emitTerminalSessionFailureStep(e){"use step";let r=formatError(e.error),i=typeof r.name==`string`?r.name:`WORKFLOW_EXECUTION_FAILED`,a=typeof r.message==`string`?r.message:String(e.error),o=e.serializedContext[`eve.sessionId`]??``;log.error(`workflow loop threw — emitting terminal session.failed`,{sessionId:o,errorId:typeof r.errorId==`string`?r.errorId:void 0,code:i,message:a,detail:typeof r.detail==`string`?r.detail:void 0});let s=createSessionFailedEvent({code:i,details:r,message:a,sessionId:o});try{let t=await deserializeContext(e.serializedContext),r=t.get(ChannelKey);r!==void 0&&await callAdapterEventHandler(r,s,buildAdapterContext(r,t))}catch(e){log.error(`adapter failed to handle terminal session.failed event`,{errorId:typeof r.errorId==`string`?r.errorId:void 0,sessionId:o,error:e})}try{let t=e.parentWritable.getWriter();try{await t.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(s)))}finally{t.releaseLock()}}catch(e){log.error(`failed to write terminal session.failed event to durable stream`,{errorId:typeof r.errorId==`string`?r.errorId:void 0,sessionId:o,error:e})}}async function runProxyInputRequestStep(e){"use step";let t=await readDurableSession(e.sessionState),r=await deserializeContext(e.serializedContext),i=r.require(ChannelKey),a=buildAdapterContext(i,r),o=r.require(ModeKey),c=r.require(BundleKey),l=hydrateDurableSession({compactionOverrides:{thresholdPercent:c.resolvedAgent.config.compaction?.thresholdPercent},durable:t,turnAgent:c.turnAgent}),u=e.parentWritable.getWriter(),d;try{let emit=async e=>{let t=await callAdapterEventHandler(i,e,a);await u.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(t)))};d=await withContextScope(r,l,async t=>{let n=await emitProxiedInputRequest({emit,hookPayload:e.hookPayload,mode:o,session:t});return{result:n.entries,session:n.session}})}finally{u.releaseLock()}return setChannelContext(r,{...i,state:{...a.state}}),{serializedContext:serializeContext(r),sessionState:createDurableSessionState({session:reconcileSessionContinuationToken(r,upsertProxyInputRequests({entries:d.result,forChildContinuationToken:e.hookPayload.childContinuationToken,session:d.session}))})}}async function routeProxiedDeliverStep(e){"use step";let t=await readDurableSession(e.sessionState),n=routeDeliverPayload({payload:e.payload,state:t.state}),{resumeHook:r}=await import(`#compiled/@workflow/core/runtime.js`);process.env.WORKFLOW_QUEUE_NAMESPACE=`eve`;for(let t of n.forChildren)await r(t.childContinuationToken,{auth:e.auth,kind:`deliver`,payloads:[t.payload]});return{remainder:n.forSelf}}async function dispatchTurnStep(e){"use step";return{runId:(await startWorkflowPreferLatest(turnWorkflow,[createTurnWorkflowInput(e)])).runId}}export{dispatchTurnStep,emitTerminalSessionFailureStep,reconcileSessionContinuationToken,resolveEffectiveOutputSchema,routeProxiedDeliverStep,runProxyInputRequestStep,turnStep};
|
|
1
|
+
import{createLogger,formatError}from"#internal/logging.js";import{callAdapterEventHandler,defaultDeliverResult}from"#channel/adapter.js";import{AuthKey,CapabilitiesKey,ContinuationTokenKey,ModeKey}from"#context/keys.js";import{createAuthorizationCompletedEvent,createSessionFailedEvent,encodeMessageStreamEvent,timestampHandleMessageStreamEvent}from"#protocol/message.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{getHarnessEmissionState}from"#harness/emission.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{hydrateDurableSession,refreshSessionFromTurnAgent}from"#execution/session.js";import{buildTurnAttributes,readRootSessionId}from"#execution/eve-workflow-attributes.js";import{setEveAttributes}from"#runtime/attributes/emit.js";import{deserializeContext,serializeContext}from"#context/serialize.js";import{getRuntimeActionKeyFromInterrupt,isCodeModeRuntimeActionInterrupt}from"#harness/code-mode-runtime-action-state.js";import{getPendingCodeModeInterrupt}from"#harness/code-mode-interrupt-state.js";import{getPendingRuntimeActionBatch}from"#harness/runtime-actions.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{createWorkflowRuntime,startWorkflowPreferLatest}from"#execution/workflow-runtime.js";import{upsertProxyInputRequests}from"#harness/proxy-input-requests.js";import{setChannelContext}from"#execution/channel-context.js";import{CallbackBaseUrlKey,PendingAuthorizationResultKey,clearPendingAuthorization,getPendingAuthorization}from"#harness/authorization.js";import{createTurnWorkflowInput}from"#execution/durable-session-migrations/turn-workflow.js";import{coalesceTurnInputs}from"#harness/messages.js";import{dispatchStreamEventHooks}from"#context/hook-lifecycle.js";import{dispatchDynamicInstructionEvent}from"#context/dynamic-instruction-lifecycle.js";import{dispatchDynamicSkillEvent}from"#context/dynamic-skill-lifecycle.js";import{dispatchDynamicToolEvent}from"#context/dynamic-tool-lifecycle.js";import{runStep,withContextScope}from"#context/run-step.js";import{hasPendingInputBatch}from"#harness/input-requests.js";import{getRuntimeActionRequestKey}from"#runtime/actions/keys.js";import{createExecutionNodeStep}from"#execution/node-step.js";import{emitProxiedInputRequest,routeDeliverPayload}from"#execution/subagent-hitl-proxy.js";import{turnWorkflow}from"#execution/turn-workflow.js";async function turnStep(e){"use step";let t=e;await setEveAttributes(buildTurnAttributes({parentSessionId:t.sessionState.sessionId,rootSessionId:readRootSessionId(t.serializedContext)??t.sessionState.sessionId}));let o=await readDurableSession(t.sessionState),l=await deserializeContext(t.serializedContext),f=l.require(ChannelKey),p=l.require(BundleKey);try{let{getWorkflowMetadata:e}=await import(`#compiled/@workflow/core/index.js`),t=e();typeof t.url==`string`&&l.set(CallbackBaseUrlKey,t.url.replace(/\/$/,``))}catch{}let m=getPendingAuthorization(o.state),h;if(m&&t.input?.kind===`deliver`){let e=[],n=[],r=[];for(let i of t.input.payloads){let t=i.authorizationCallback;if(t){let r=m.challenges.find(e=>e.name===t.connectionName);r&&(e.push({name:r.name,resume:r.resume,callback:t.callback,hookUrl:r.hookUrl}),n.push({name:r.name,authorization:r.challenge}))}else r.push(i)}e.length>0&&(l.set(PendingAuthorizationResultKey,e),o={...o,state:clearPendingAuthorization(o.state,e.map(e=>e.name))},h=n,t=r.length>0?{...t,input:{...t.input,payloads:r}}:{...t,input:void 0})}t.input?.kind===`deliver`&&t.input.auth!==void 0&&l.set(AuthKey,t.input.auth??null);let g=hydrateDurableSession({compactionOverrides:{thresholdPercent:p.resolvedAgent.config.compaction?.thresholdPercent},durable:o,turnAgent:p.turnAgent}),_=buildAdapterContext(f,l),v;if(t.input?.kind===`deliver`){let e=[];for(let n of t.input.payloads){let t=f.deliver?await f.deliver(n,_):defaultDeliverResult(n);t!=null&&e.push(t)}v=e.length===0?void 0:e.reduce(coalesceTurnInputs)}else t.input?.kind===`runtime-action-result`&&(v={runtimeActionResults:t.input.results});if(t.input?.kind===`deliver`&&setChannelContext(l,{...f,state:{..._.state}}),t.input?.kind===`deliver`&&v===void 0){let e=reconcileSessionContinuationToken(l,g),n=serializeContext(l),r=e===g?t.sessionState:createDurableSessionState({session:e});return{action:`park`,...derivePendingState(e),serializedContext:n,sessionState:r}}let y=t.parentWritable.getWriter(),b=p.hookRegistry,x=p.resolvedAgent.dynamicInstructionsResolvers??[],S=p.resolvedAgent.dynamicSkillResolvers??[],C=p.resolvedAgent.dynamicToolResolvers??[],emit=async e=>{let t=await callAdapterEventHandler(f,e,_);return setChannelContext(l,{...f,state:{..._.state}}),await y.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(t))),t},handleEvent=async(e,t)=>{let n=await emit(e);await dispatchStreamEventHooks({ctx:l,registry:b,event:n}),await dispatchDynamicToolEvent({ctx:l,resolvers:C,event:n,messages:t??[]}),await dispatchDynamicSkillEvent({ctx:l,resolvers:S,event:n,messages:t??[]}),await dispatchDynamicInstructionEvent({ctx:l,resolvers:x,event:n,messages:t??[]})},w=l.require(ModeKey),T=await runStep(l,g,async e=>{let t=resolveEffectiveOutputSchema({agentOutputSchema:p.turnAgent.outputSchema,input:v,mode:w,session:e});if(h){let e=getHarnessEmissionState(t.state);for(let{name:t,authorization:n}of h)await handleEvent(createAuthorizationCompletedEvent({authorization:n,name:t,outcome:`authorized`,sequence:e.sequence,stepIndex:e.stepIndex,turnId:e.turnId}))}let n=l.get(CapabilitiesKey);return(async(e,t)=>{let r=refreshSessionFromTurnAgent({compactionOverrides:{thresholdPercent:p.resolvedAgent.config.compaction?.thresholdPercent},session:e,turnAgent:p.turnAgent});return createExecutionNodeStep({capabilities:n,createRuntime:createWorkflowRuntime,handleEvent,mode:w,modelResolutionScope:{moduleMap:p.moduleMap,nodeId:p.nodeId},node:p.graph.root})(r,t)})(t,v)}),E=reconcileSessionContinuationToken(l,T.session),D=serializeContext(l);T={...T,session:E};let O=createDurableSessionState({session:T.session});if(T.next!==null&&typeof T.next==`object`&&`done`in T.next)return await y.close(),{action:`done`,output:T.next.output,isError:T.next.isError,serializedContext:D,sessionState:O};if(T.next===null){y.releaseLock();let e=getPendingCodeModeInterrupt(T.session.state);return e!==void 0&&isCodeModeRuntimeActionInterrupt(e.interrupt)?{action:`dispatch-code-mode-runtime-actions`,pendingRuntimeActionKeys:[getRuntimeActionKeyFromInterrupt(e.interrupt)],serializedContext:D,sessionState:O}:{action:`park`,...derivePendingState(T.session),serializedContext:D,sessionState:O}}return y.releaseLock(),{action:`continue`,serializedContext:D,sessionState:O}}function derivePendingState(e){let t=getPendingRuntimeActionBatch(e.state),n=getPendingAuthorization(e.state),r={authorizationNames:n?.challenges.map(e=>e.name),hasPendingAuthorization:n!==void 0,hasPendingInputBatch:hasPendingInputBatch(e.state)};return t===void 0?r:{...r,pendingRuntimeActionKeys:t.actions.map(e=>getRuntimeActionRequestKey(e))}}function reconcileSessionContinuationToken(e,t){let n=e.get(ContinuationTokenKey);return n===void 0||n===t.continuationToken?t:{...t,continuationToken:n}}function resolveEffectiveOutputSchema(e){let{agentOutputSchema:t,input:n,mode:r,session:i}=e;return n?.outputSchema===void 0?r===`task`&&i.outputSchema===void 0&&t!==void 0?{...i,outputSchema:t}:i:{...i,outputSchema:n.outputSchema}}const log=createLogger(`execution.workflow-entry`);async function emitTerminalSessionFailureStep(e){"use step";let r=formatError(e.error),i=typeof r.name==`string`?r.name:`WORKFLOW_EXECUTION_FAILED`,a=typeof r.message==`string`?r.message:String(e.error),o=e.serializedContext[`eve.sessionId`]??``;log.error(`workflow loop threw — emitting terminal session.failed`,{sessionId:o,errorId:typeof r.errorId==`string`?r.errorId:void 0,code:i,message:a,detail:typeof r.detail==`string`?r.detail:void 0});let s=createSessionFailedEvent({code:i,details:r,message:a,sessionId:o});try{let t=await deserializeContext(e.serializedContext),r=t.get(ChannelKey);r!==void 0&&await callAdapterEventHandler(r,s,buildAdapterContext(r,t))}catch(e){log.error(`adapter failed to handle terminal session.failed event`,{errorId:typeof r.errorId==`string`?r.errorId:void 0,sessionId:o,error:e})}try{let t=e.parentWritable.getWriter();try{await t.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(s)))}finally{t.releaseLock()}}catch(e){log.error(`failed to write terminal session.failed event to durable stream`,{errorId:typeof r.errorId==`string`?r.errorId:void 0,sessionId:o,error:e})}}async function runProxyInputRequestStep(e){"use step";let t=await readDurableSession(e.sessionState),r=await deserializeContext(e.serializedContext),i=r.require(ChannelKey),a=buildAdapterContext(i,r),o=r.require(ModeKey),c=r.require(BundleKey),l=hydrateDurableSession({compactionOverrides:{thresholdPercent:c.resolvedAgent.config.compaction?.thresholdPercent},durable:t,turnAgent:c.turnAgent}),u=e.parentWritable.getWriter(),d;try{let emit=async e=>{let t=await callAdapterEventHandler(i,e,a);await u.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(t)))};d=await withContextScope(r,l,async t=>{let n=await emitProxiedInputRequest({emit,hookPayload:e.hookPayload,mode:o,session:t});return{result:n.entries,session:n.session}})}finally{u.releaseLock()}return setChannelContext(r,{...i,state:{...a.state}}),{serializedContext:serializeContext(r),sessionState:createDurableSessionState({session:reconcileSessionContinuationToken(r,upsertProxyInputRequests({entries:d.result,forChildContinuationToken:e.hookPayload.childContinuationToken,session:d.session}))})}}async function routeProxiedDeliverStep(e){"use step";let t=await readDurableSession(e.sessionState),n=routeDeliverPayload({payload:e.payload,state:t.state}),{resumeHook:r}=await import(`#compiled/@workflow/core/runtime.js`);process.env.WORKFLOW_QUEUE_NAMESPACE=`eve`;for(let t of n.forChildren)await r(t.childContinuationToken,{auth:e.auth,kind:`deliver`,payloads:[t.payload]});return{remainder:n.forSelf}}async function dispatchTurnStep(e){"use step";return{runId:(await startWorkflowPreferLatest(turnWorkflow,[createTurnWorkflowInput(e)])).runId}}export{dispatchTurnStep,emitTerminalSessionFailureStep,reconcileSessionContinuationToken,resolveEffectiveOutputSchema,routeProxiedDeliverStep,runProxyInputRequestStep,turnStep};
|
|
@@ -137,6 +137,7 @@ export interface PendingAuthorizationState {
|
|
|
137
137
|
readonly challenges: readonly AuthorizationChallenge[];
|
|
138
138
|
}
|
|
139
139
|
export declare function setPendingAuthorization(sessionState: Record<string, unknown> | undefined, value: PendingAuthorizationState): Record<string, unknown>;
|
|
140
|
+
export declare function clearPendingAuthorization(sessionState: Record<string, unknown> | undefined, names?: readonly string[]): Record<string, unknown> | undefined;
|
|
140
141
|
export declare function getPendingAuthorization(sessionState: Record<string, unknown> | undefined): PendingAuthorizationState | undefined;
|
|
141
142
|
export declare function hasPendingAuthorization(sessionState: Record<string, unknown> | undefined): boolean;
|
|
142
143
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createEveConnectionCallbackRoutePath}from"#protocol/routes.js";import{SessionIdKey}from"#context/keys.js";import{loadContext}from"#context/container.js";import{ContextKey}from"#context/key.js";const AUTHORIZATION_BRAND=`__eveAuthorization`,AUTHORIZATION_PENDING_BRAND=`__eveAuthorizationPending`;function requestAuthorization(e){return{[AUTHORIZATION_BRAND]:!0,challenges:e}}function redactSignalResume(e){return requestAuthorization(e.challenges.map(e=>({name:e.name,challenge:e.challenge,hookUrl:e.hookUrl})))}function getAuthorizationResult(e){let t=loadContext().get(PendingAuthorizationResultKey);if(!(!t||t.length===0))return e===void 0?t[0]:t.find(t=>t.name===e)}function getHookUrl(
|
|
1
|
+
import{createEveConnectionCallbackRoutePath}from"#protocol/routes.js";import{SessionIdKey}from"#context/keys.js";import{loadContext}from"#context/container.js";import{ContextKey}from"#context/key.js";const AUTHORIZATION_BRAND=`__eveAuthorization`,AUTHORIZATION_PENDING_BRAND=`__eveAuthorizationPending`;function requestAuthorization(e){return{[AUTHORIZATION_BRAND]:!0,challenges:e}}function redactSignalResume(e){return requestAuthorization(e.challenges.map(e=>({name:e.name,challenge:e.challenge,hookUrl:e.hookUrl})))}function getAuthorizationResult(e){let t=loadContext().get(PendingAuthorizationResultKey);if(!(!t||t.length===0))return e===void 0?t[0]:t.find(t=>t.name===e)}function getHookUrl(r){let i=loadContext(),a=i.get(SessionIdKey),o=i.get(CallbackBaseUrlKey);return!a||!o?void 0:`${o}${createEveConnectionCallbackRoutePath(r,authHookToken(a))}`}function isAuthorizationSignal(e){return typeof e!=`object`||!e?!1:e[AUTHORIZATION_BRAND]===!0}function isAuthorizationPendingModelOutput(e){return typeof e!=`object`||!e?!1:e[AUTHORIZATION_PENDING_BRAND]===!0}function authorizationPendingAsJsonObject(e){return{[AUTHORIZATION_PENDING_BRAND]:!0,connections:[...e.connections]}}function modelFacingAuthorizationOutput(e){return authorizationPendingAsJsonObject({connections:e.challenges.map(e=>e.name)})}function authorizationPendingModelText(e){return e.length===0?`Authorization required. Waiting for the user to sign in.`:e.length===1?`Authorization required for ${e[0]}. Waiting for the user to sign in.`:`Authorization required for ${e.join(`, `)}. Waiting for the user to sign in.`}function isPendingAuthorizationToolOutput(e){return isAuthorizationPendingModelOutput(e)||isAuthorizationSignal(e)}function authHookToken(e){return`${e}:auth`}const PendingAuthorizationResultKey=new ContextKey(`eve.pendingAuthorizationResult`),CallbackBaseUrlKey=new ContextKey(`eve.callbackBaseUrl`),PENDING_AUTHORIZATION_KEY=`eve.runtime.pendingAuthorization`;function setPendingAuthorization(e,t){return{...e,[PENDING_AUTHORIZATION_KEY]:t}}function clearPendingAuthorization(e,t){if(e===void 0||e[PENDING_AUTHORIZATION_KEY]===void 0)return e;if(t!==void 0){if(t.length===0)return e;let n=getPendingAuthorization(e);if(n!==void 0){let r=new Set(t),i=n.challenges.filter(e=>!r.has(e.name));if(i.length>0)return{...e,[PENDING_AUTHORIZATION_KEY]:{challenges:i}}}}let n={...e};return delete n[PENDING_AUTHORIZATION_KEY],Object.keys(n).length>0?n:void 0}function getPendingAuthorization(e){if(!e)return;let t=e[PENDING_AUTHORIZATION_KEY];if(!(typeof t!=`object`||!t))return t}function hasPendingAuthorization(e){return getPendingAuthorization(e)!==void 0}export{CallbackBaseUrlKey,PendingAuthorizationResultKey,authHookToken,authorizationPendingAsJsonObject,authorizationPendingModelText,clearPendingAuthorization,getAuthorizationResult,getHookUrl,getPendingAuthorization,hasPendingAuthorization,isAuthorizationPendingModelOutput,isAuthorizationSignal,isPendingAuthorizationToolOutput,modelFacingAuthorizationOutput,redactSignalResume,requestAuthorization,setPendingAuthorization};
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import{existsSync}from"node:fs";import{dirname,join}from"node:path";import{spawn}from"node:child_process";import{mkdir,readFile,rm,stat,writeFile}from"node:fs/promises";import{pathToFileURL}from"node:url";const EVE_DEV_ENV_FLAG=`EVE_DEV`;function isEveDevEnvironment(){return process.env[EVE_DEV_ENV_FLAG]===`1`}function detectProjectPackageManager(r){let i=r;for(;;){if(existsSync(join(i,`pnpm-lock.yaml`))||existsSync(join(i,`pnpm-workspace.yaml`)))return`pnpm`;if(existsSync(join(i,`yarn.lock`)))return`yarn`;if(existsSync(join(i,`bun.lock`))||existsSync(join(i,`bun.lockb`)))return`bun`;if(existsSync(join(i,`package-lock.json`)))return`npm`;let r=dirname(i);if(r===i)return`npm`;i=r}}const INSTALL_ARGUMENTS={bun:[`add`,`--dev`],npm:[`install`,`--save-dev`],pnpm:[`add`,`-D`],yarn:[`add`,`-D`]},OPTIONAL_PACKAGE_LOCK_TIMEOUT_MS=600*1e3,pendingOptionalPackageInstalls=new Map;async function installPackageIntoProject(e){let t=detectProjectPackageManager(e.appRoot),n=[...INSTALL_ARGUMENTS[t],e.packageName];console.info(`[eve:dev] installing optional dependency "${e.packageName}" via \`${t} ${n.join(` `)}\`...`);let i=spawn(t,n,{cwd:e.appRoot,shell:shouldSpawnPackageManagerWithShell(),stdio:[`ignore`,`pipe`,`pipe`]}),a=[];i.stdout?.on(`data`,e=>a.push(e)),i.stderr?.on(`data`,e=>a.push(e));let o=await new Promise((e,t)=>{i.on(`error`,t),i.on(`close`,t=>e(t??1))});if(o!==0){let n=Buffer.concat(a).toString(`utf8`).trim();throw Error(`Failed to install "${e.packageName}" with ${t} (exit ${o}).`+(n.length>0?`\n${n.slice(-2e3)}`:``))}console.info(`[eve:dev] installed "${e.packageName}".`)}async function loadOptionalEnginePackage(e){try{return await e.importModule()}catch(t){if(!e.autoInstall||!isEveDevEnvironment())throw Error(e.missingMessage,{cause:t});let n=e.importInstalledModule??(async()=>await importInstalledEnginePackage({appRoot:e.appRoot,packageName:e.packageName}))
|
|
1
|
+
import{existsSync}from"node:fs";import{dirname,join}from"node:path";import{spawn}from"node:child_process";import{mkdir,readFile,rm,stat,writeFile}from"node:fs/promises";import{pathToFileURL}from"node:url";import{Worker}from"node:worker_threads";const EVE_DEV_ENV_FLAG=`EVE_DEV`;function isEveDevEnvironment(){return process.env[EVE_DEV_ENV_FLAG]===`1`}function detectProjectPackageManager(r){let i=r;for(;;){if(existsSync(join(i,`pnpm-lock.yaml`))||existsSync(join(i,`pnpm-workspace.yaml`)))return`pnpm`;if(existsSync(join(i,`yarn.lock`)))return`yarn`;if(existsSync(join(i,`bun.lock`))||existsSync(join(i,`bun.lockb`)))return`bun`;if(existsSync(join(i,`package-lock.json`)))return`npm`;let r=dirname(i);if(r===i)return`npm`;i=r}}const INSTALL_ARGUMENTS={bun:[`add`,`--dev`],npm:[`install`,`--save-dev`],pnpm:[`add`,`-D`],yarn:[`add`,`-D`]},OPTIONAL_PACKAGE_LOCK_TIMEOUT_MS=600*1e3,pendingOptionalPackageInstalls=new Map;async function installPackageIntoProject(e){let t=detectProjectPackageManager(e.appRoot),n=[...INSTALL_ARGUMENTS[t],e.packageName];console.info(`[eve:dev] installing optional dependency "${e.packageName}" via \`${t} ${n.join(` `)}\`...`);let i=spawn(t,n,{cwd:e.appRoot,shell:shouldSpawnPackageManagerWithShell(),stdio:[`ignore`,`pipe`,`pipe`]}),a=[];i.stdout?.on(`data`,e=>a.push(e)),i.stderr?.on(`data`,e=>a.push(e));let o=await new Promise((e,t)=>{i.on(`error`,t),i.on(`close`,t=>e(t??1))});if(o!==0){let n=Buffer.concat(a).toString(`utf8`).trim();throw Error(`Failed to install "${e.packageName}" with ${t} (exit ${o}).`+(n.length>0?`\n${n.slice(-2e3)}`:``))}console.info(`[eve:dev] installed "${e.packageName}".`)}async function loadOptionalEnginePackage(e){try{return await e.importModule()}catch(t){if(!e.autoInstall||!isEveDevEnvironment())throw Error(e.missingMessage,{cause:t});let n=e.importInstalledModule??(async()=>await importInstalledEnginePackage({appRoot:e.appRoot,packageName:e.packageName})),r=e.importInstalledModule===void 0?async()=>await isInstalledEnginePackageLoadable(e):async()=>{try{return await n(),!0}catch{return!1}};try{await withOptionalPackageInstallLock(e,async()=>{await r()||await installPackageIntoProject({appRoot:e.appRoot,packageName:e.packageName})})}catch(t){throw Error(`${e.missingMessage} Automatic installation failed: ${toMessage(t)}`,{cause:t})}try{return await n()}catch(t){throw Error(`${e.missingMessage} Automatic installation completed, but "${e.packageName}" still could not be loaded from "${e.appRoot}". This usually means the package manager installed into a different workspace, node_modules is unavailable, or the Node/package-manager environment changed while eve dev was running. Last load error: ${toMessage(t)}`,{cause:t})}}}async function importInstalledEnginePackage(e){return await import(await resolveInstalledEnginePackageEntrypointHref(e))}async function isInstalledEnginePackageLoadable(e){try{return await importEntrypointInWorker(await resolveInstalledEnginePackageEntrypointHref(e)),!0}catch{return!1}}async function resolveInstalledEnginePackageEntrypointHref(e){let t=findInstalledPackageRoot(e),r=join(t,`package.json`),i=resolvePackageEntryPoint(JSON.parse(await readFile(r,`utf8`)));if(i.startsWith(`/`))throw Error(`Invalid absolute entrypoint for optional package "${e.packageName}".`);return pathToFileURL(join(t,i)).href}async function importEntrypointInWorker(e){let t=new Worker(`
|
|
2
|
+
const { parentPort, workerData } = require("node:worker_threads");
|
|
3
|
+
|
|
4
|
+
(async () => {
|
|
5
|
+
try {
|
|
6
|
+
await import(workerData.entrypointHref);
|
|
7
|
+
parentPort.postMessage({ ok: true });
|
|
8
|
+
} catch (error) {
|
|
9
|
+
parentPort.postMessage({
|
|
10
|
+
ok: false,
|
|
11
|
+
message: error instanceof Error ? error.message : String(error),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
})();
|
|
15
|
+
`,{eval:!0,workerData:{entrypointHref:e}});await new Promise((e,n)=>{let r=!1,settle=e=>{r||(r=!0,t.off(`error`,handleError),t.off(`exit`,handleExit),t.off(`message`,handleMessage),t.terminate().catch(()=>{}),e())},handleError=e=>settle(()=>n(e)),handleExit=e=>{e!==0&&settle(()=>n(Error(`Optional dependency worker exited before loading module (code ${e}).`)))},handleMessage=t=>{let r=t;settle(()=>{if(r.ok===!0){e();return}n(Error(typeof r.message==`string`?r.message:`Optional dependency worker failed to load module.`))})};t.once(`error`,handleError),t.once(`exit`,handleExit),t.once(`message`,handleMessage)})}function findInstalledPackageRoot(r){let i=r.packageName.split(`/`),a=[],o=r.appRoot;for(;;){let s=join(o,`node_modules`,...i);if(a.push(s),existsSync(join(s,`package.json`)))return s;let c=dirname(o);if(c===o)throw Error(`Could not find installed optional dependency "${r.packageName}". Checked: ${a.join(`, `)}`);o=c}}function resolvePackageEntryPoint(e){let t=readDotExport(e.exports);return t===void 0?typeof e.module==`string`&&e.module.length>0?e.module:typeof e.main==`string`&&e.main.length>0?e.main:`index.js`:t}function readDotExport(e){if(typeof e==`string`&&e.length>0)return e;if(typeof e!=`object`||!e)return;let t=`.`in e?e[`.`]:e;if(typeof t==`string`&&t.length>0)return t;if(typeof t!=`object`||!t)return;let n=t;if(typeof n.import==`string`&&n.import.length>0)return n.import;if(typeof n.default==`string`&&n.default.length>0)return n.default}async function withOptionalPackageInstallLock(e,t){let n=`${e.appRoot}:${e.packageName}`,r=pendingOptionalPackageInstalls.get(n);if(r!==void 0){await r;return}let i=withOptionalPackageInstallFileLock(e,t).finally(()=>{pendingOptionalPackageInstalls.delete(n)});pendingOptionalPackageInstalls.set(n,i),await i}async function withOptionalPackageInstallFileLock(e,t){let r=join(e.appRoot,`.eve`,`optional-package-locks`,`${sanitizeLockName(e.packageName)}.lock`);await acquireLock(r);try{await t()}finally{await rm(r,{force:!0,recursive:!0}).catch(()=>{})}}async function acquireLock(e){let r=Date.now();for(;;){await mkdir(dirname(e),{recursive:!0});try{await mkdir(e),await writeFile(join(e,`owner.json`),`${JSON.stringify({createdAt:new Date().toISOString(),pid:process.pid})}\n`);return}catch(t){if(!isFileExistsError(t))throw t;await waitForExistingLock(e,r)}}}async function waitForExistingLock(e,t){let n=await stat(e).catch(e=>{if(isNotFoundError(e))return null;throw e});if(n!==null){if(Date.now()-n.mtimeMs>18e5){await rm(e,{force:!0,recursive:!0}).catch(()=>{});return}if(Date.now()-t>OPTIONAL_PACKAGE_LOCK_TIMEOUT_MS)throw Error(`Timed out waiting for optional package install lock "${e}" after ${OPTIONAL_PACKAGE_LOCK_TIMEOUT_MS}ms.`);await new Promise(e=>setTimeout(e,250))}}function sanitizeLockName(e){return e.replaceAll(/[^a-zA-Z0-9._-]+/g,`-`)}function shouldSpawnPackageManagerWithShell(e=process.platform){return e===`win32`}function isFileExistsError(e){return typeof e==`object`&&!!e&&`code`in e&&e.code===`EEXIST`}function isNotFoundError(e){return typeof e==`object`&&!!e&&`code`in e&&e.code===`ENOENT`}function toMessage(e){return e instanceof Error?e.message:String(e)}export{EVE_DEV_ENV_FLAG,detectProjectPackageManager,installPackageIntoProject,isEveDevEnvironment,loadOptionalEnginePackage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire}from"node:module";import{existsSync,readFileSync,realpathSync}from"node:fs";import{basename,dirname,join}from"node:path";import{EVE_PACKAGE_NAME}from"#internal/package-name.js";import{fileURLToPath}from"node:url";let cachedPackageInfo;const BUNDLED_FALLBACK_PACKAGE_VERSION=`0.13.
|
|
1
|
+
import{createRequire}from"node:module";import{existsSync,readFileSync,realpathSync}from"node:fs";import{basename,dirname,join}from"node:path";import{EVE_PACKAGE_NAME}from"#internal/package-name.js";import{fileURLToPath}from"node:url";let cachedPackageInfo;const BUNDLED_FALLBACK_PACKAGE_VERSION=`0.13.4`,WORKFLOW_MODULE_ALIASES={"workflow/api":`src/compiled/@workflow/core/runtime.js`,"workflow/errors":`src/compiled/@workflow/errors/index.js`,"workflow/internal/private":`src/compiled/@workflow/core/private.js`,"workflow/runtime":`src/compiled/@workflow/core/runtime.js`};function resolveFallbackPackageVersion(){return BUNDLED_FALLBACK_PACKAGE_VERSION.startsWith(`__`)?`0.0.0`:BUNDLED_FALLBACK_PACKAGE_VERSION}const FALLBACK_PACKAGE_INFO={name:EVE_PACKAGE_NAME,version:resolveFallbackPackageVersion()};function resolveCurrentModulePath(){return typeof __filename==`string`?__filename:resolveCurrentModulePathFromStack()}function resolveCurrentModulePathFromStack(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error().stack?.[0]?.getFileName();if(typeof e!=`string`||e.length===0)throw Error(`Failed to resolve the current module path from the stack trace.`);return e.startsWith(`file:`)?fileURLToPath(e):e}finally{Error.prepareStackTrace=e}}const require=createRequire(resolveCurrentModulePath());function isBuildOutputPackageRoot(e){return basename(e)===`dist`&&existsSync(join(dirname(e),`package.json`))}function resolvePackageBuildRoot(){let e=dirname(realpathSync(resolveCurrentModulePath()));for(;;){if(isBuildOutputPackageRoot(e))return e;let t=dirname(e);if(t===e)return null;e=t}}function findNearestPackageRoot(e){let n=e;for(;;){if(existsSync(join(n,`package.json`))&&!isBuildOutputPackageRoot(n))return n;let r=dirname(n);if(r===n)throw Error(`Failed to resolve package root from "${e}".`);n=r}}function resolvePackageRoot(){return findNearestPackageRoot(dirname(realpathSync(resolveCurrentModulePath())))}function tryResolvePackageRoot(){try{return resolvePackageRoot()}catch{return}}function rewriteSourceFilePathForBuild(e){return e.replace(/\.[cm]?tsx?$/,`.js`)}function resolvePackageSourceFilePath(e){let t=resolvePackageBuildRoot();return t===null?join(resolvePackageRoot(),e):join(t,rewriteSourceFilePathForBuild(e))}function resolvePackageSourceDirectoryPath(e){let t=resolvePackageBuildRoot();return join(t===null?resolvePackageRoot():t,e)}function resolvePackageDependencyPath(e){return require.resolve(e)}function resolvePackageCompiledFilePath(e){let t=resolvePackageBuildRoot();return t===null?join(resolvePackageRoot(),`.generated`,`compiled`,e.replace(/^src\/compiled\//,``)):join(t,e)}function normalizeInstalledPackageInfo(e){let t=e;if(!(typeof t.name!=`string`||typeof t.version!=`string`))return{name:t.name,version:t.version}}function tryReadInstalledPackageInfo(e,t){let r=normalizeInstalledPackageInfo(JSON.parse(readFileSync(e,`utf8`)));if(r?.name===t)return r}function resolveInstalledPackageInfo(){if(cachedPackageInfo)return cachedPackageInfo;let e=tryResolvePackageRoot(),t=e===void 0?void 0:tryReadInstalledPackageInfo(join(e,`package.json`),EVE_PACKAGE_NAME);if(t)return cachedPackageInfo=t,cachedPackageInfo;try{let e=tryReadInstalledPackageInfo(require.resolve(`${EVE_PACKAGE_NAME}/package.json`),EVE_PACKAGE_NAME);if(e)return cachedPackageInfo=e,cachedPackageInfo}catch{}return cachedPackageInfo={...FALLBACK_PACKAGE_INFO},cachedPackageInfo}function resolveWorkflowModulePath(e){if(e===`workflow`)return resolvePackageSourceFilePath(`src/internal/workflow/index.ts`);if(e===`workflow/internal/builtins`)return resolvePackageSourceFilePath(`src/internal/workflow/builtins.ts`);let t=WORKFLOW_MODULE_ALIASES[e];return t===void 0?require.resolve(e):resolvePackageCompiledFilePath(t)}export{resolveInstalledPackageInfo,resolvePackageDependencyPath,resolvePackageRoot,resolvePackageSourceDirectoryPath,resolvePackageSourceFilePath,resolveWorkflowModulePath};
|
|
@@ -1,45 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Card → Slack Block Kit converter.
|
|
3
|
-
*
|
|
4
|
-
* The chat SDK's Slack adapter used to walk the cross-platform
|
|
5
|
-
* `CardElement` AST (the data shape produced by `Card({...})`,
|
|
6
|
-
* `Actions([...])`, `Button({...})`, etc.) and emit Slack Block Kit
|
|
7
|
-
* JSON for `chat.postMessage`. We replicate just that conversion here
|
|
8
|
-
* so authors can keep using the ergonomic card builders without the
|
|
9
|
-
* `@chat-adapter/slack` runtime.
|
|
10
|
-
*
|
|
11
|
-
* Supported shapes:
|
|
12
|
-
* Card → header + context + image header + children blocks
|
|
13
|
-
* TextElement → `section`/`context` (style: plain | bold | muted)
|
|
14
|
-
* ImageElement → `image` block
|
|
15
|
-
* DividerElement → `divider`
|
|
16
|
-
* ActionsElement → `actions` with buttons / link buttons /
|
|
17
|
-
* static_select / radio_buttons
|
|
18
|
-
* SectionElement → recurses into a sequence of blocks
|
|
19
|
-
* FieldsElement → `section` with fields
|
|
20
|
-
* LinkElement → `section` with a `<url|label>` mrkdwn
|
|
21
|
-
* TableElement → `section` with a mrkdwn approximation
|
|
22
|
-
* ButtonElement → `button` action element
|
|
23
|
-
* LinkButtonElement → `button` action element with `url`
|
|
24
|
-
*
|
|
25
|
-
* Anything else falls back to the chat SDK's
|
|
26
|
-
* `cardChildToFallbackText` (a string description) wrapped in a
|
|
27
|
-
* section block so the message is never silently dropped.
|
|
28
|
-
*/
|
|
29
1
|
import { type CardElement } from "#compiled/chat/index.js";
|
|
30
|
-
/**
|
|
31
|
-
* One Slack Block Kit block. Slack accepts a wide enum and adds new
|
|
32
|
-
* block types over time, so this type stays open-ended.
|
|
33
|
-
*/
|
|
2
|
+
/** A Slack Block Kit block emitted by {@link cardToBlocks}. */
|
|
34
3
|
export type BlockKitBlock = Record<string, unknown>;
|
|
35
|
-
/**
|
|
36
|
-
* Converts a {@link CardElement} into a list of Slack Block Kit blocks
|
|
37
|
-
* ready to pass to `chat.postMessage`'s `blocks` parameter.
|
|
38
|
-
*/
|
|
4
|
+
/** Converts a Chat SDK card into Slack Block Kit blocks. */
|
|
39
5
|
export declare function cardToBlocks(card: CardElement): BlockKitBlock[];
|
|
40
|
-
/**
|
|
41
|
-
* Best-effort fallback text for a card. `chat.postMessage` sends this
|
|
42
|
-
* as the `text` field so notifications and accessibility readers still
|
|
43
|
-
* see something meaningful.
|
|
44
|
-
*/
|
|
6
|
+
/** Creates the plain-text fallback used for notifications and accessibility. */
|
|
45
7
|
export declare function cardToFallbackText(card: CardElement): string;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import{cardChildToFallbackText}from"#compiled/chat/index.js";import{
|
|
2
|
-
`).trim()}function
|
|
3
|
-
`)}}}export{cardToBlocks,cardToFallbackText};
|
|
1
|
+
import{cardChildToFallbackText}from"#compiled/chat/index.js";import{cardToSlackBlocks}from"#compiled/@chat-adapter/slack/blocks.js";function cardToBlocks(e){return cardToSlackBlocks({...e,children:e.children.map(preserveLinkActionId)})}function cardToFallbackText(t){let n=[];t.title&&n.push(t.title),t.subtitle&&n.push(t.subtitle);for(let r of t.children){let t=cardChildToFallbackText(r);t&&n.push(t)}return n.join(`
|
|
2
|
+
`).trim()}function preserveLinkActionId(e){return e.type===`section`?{...e,children:e.children.map(preserveLinkActionId)}:e.type===`actions`?{...e,children:e.children.map(e=>e.type===`link-button`&&e.id===void 0?{...e,id:`link:${e.url}`}:e)}:e}export{cardToBlocks,cardToFallbackText};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createLogger,extractErrorId,formatErrorHint}from"#internal/logging.js";import{
|
|
2
|
-
`));await t.thread.post({blocks:e.requests.flatMap(renderInputRequestBlocks),text:
|
|
1
|
+
import{createLogger,extractErrorId,formatErrorHint}from"#internal/logging.js";import{buildSlackAuthContext}from"#public/channels/slack/auth.js";import{buildAuthCompletedText,buildAuthEphemeralBlocks,buildAuthRequiredPublicText,formatConnectionDisplayName}from"#public/channels/slack/connections.js";import{renderInputRequestBlocks}from"#public/channels/slack/hitl.js";import{truncateMessageText,truncateTypingStatus}from"#public/channels/slack/limits.js";const log=createLogger(`slack.defaults`);function defaultSlackAuth(e,t){let n=e.author;return n?buildSlackAuthContext({channelId:t.slack.channelId,fullName:n.fullName,isBot:n.isBot,teamId:e.teamId,threadTs:t.slack.threadTs,userId:n.userId,userName:n.userName}):null}async function defaultOnAppMention(e,t){return await e.thread.startTyping(`Thinking...`),{auth:defaultSlackAuth(t,e)}}async function defaultOnDirectMessage(e,t){return await e.thread.startTyping(`Thinking...`),{auth:defaultSlackAuth(t,e)}}function firstNonEmptyLine(e){for(let t of e.split(/\r?\n/u)){let e=t.trim();if(e.length>0)return e}}function defaultInputRequestedHandler(){return async(e,t,n)=>{if(e.requests.length===0)return;let r=truncateMessageText(e.requests.map(e=>e.prompt).join(`
|
|
2
|
+
`));await t.thread.post({blocks:e.requests.flatMap(renderInputRequestBlocks),text:r})}}const defaultEvents={async"turn.started"(e,t,n){t.state.pendingToolCallMessage=null,t.state.lastReasoningTypingAtMs=null,t.state.lastReasoningTypingStatus=null,await t.thread.startTyping(`Working...`)},async"reasoning.appended"(e,t,n){let r=firstNonEmptyLine(e.reasoningSoFar);if(r===void 0)return;let i=truncateTypingStatus(r),a=t.state.lastReasoningTypingStatus,o=a!=null&&i.startsWith(a)&&i.length>=a.length+4,s=Date.now(),c=t.state.lastReasoningTypingAtMs;if(!o&&c!=null){let e=s-c;if(e>=0&&e<5e3)return}await t.thread.startTyping(i),t.state.lastReasoningTypingAtMs=s,t.state.lastReasoningTypingStatus=i},async"actions.requested"(e,t,n){let r=t.state.pendingToolCallMessage;if(t.state.pendingToolCallMessage=null,r){await t.thread.startTyping(truncateTypingStatus(r));return}let i=e.actions.map(e=>e.kind===`tool-call`?e.toolName:e.kind);await t.thread.startTyping(truncateTypingStatus(`Running ${i.join(`, `)}...`))},async"message.completed"(e,t,n){if(e.finishReason===`tool-calls`){t.state.pendingToolCallMessage=e.message?firstNonEmptyLine(e.message)??null:null;return}t.state.pendingToolCallMessage=null,e.message&&await t.thread.post(e.message)},async"turn.failed"(e,r,i){let a=formatErrorHint(e),o=extractErrorId(e.details);await r.thread.post([`I hit an error while handling your request${a}.`,``,`Please try again, rephrase, or reach out if it keeps failing.`,...o?[``,`_Error id: \`${o}\`_`]:[]].join(`
|
|
3
3
|
`))},async"session.failed"(e,r){let i=formatErrorHint(e),a=extractErrorId(e.details);await r.thread.post([`This session couldn't recover from an error${i}.`,``,`Start a new thread to continue — I can't pick this one back up.`,...a?[``,`_Error id: \`${a}\`_`]:[]].join(`
|
|
4
|
-
`))},async"authorization.required"(e,t,n){let r=e.authorization?.displayName??formatConnectionDisplayName(e.name),i=t.state.triggeringUserId??null,
|
|
4
|
+
`))},async"authorization.required"(e,t,n){let r=e.authorization?.displayName??formatConnectionDisplayName(e.name),i=t.state.triggeringUserId??null,c=e.authorization?.url,l=t.state.pendingAuthMessageTs??{};if(l[e.name]===void 0){let n=buildAuthRequiredPublicText({displayName:r,hasUser:i!==null});try{let r=await t.thread.post(n);r.id&&(t.state.pendingAuthMessageTs={...l,[e.name]:r.id})}catch(t){log.error(`Slack auth public message delivery failed`,{name:e.name,error:t})}}if(i&&c){let n=e.authorization?.userCode;try{await t.thread.postEphemeral(i,{blocks:buildAuthEphemeralBlocks({displayName:r,url:c,userCode:n}),text:n?`Sign in with ${r}: ${c} (code: ${n})`:`Sign in with ${r}: ${c}`})}catch(t){log.error(`Slack auth ephemeral delivery failed`,{name:e.name,error:t})}}},async"authorization.completed"(e,t,n){let r=t.state.pendingAuthMessageTs??{},a=r[e.name];if(a===void 0)return;let o=buildAuthCompletedText({displayName:e.authorization?.displayName??formatConnectionDisplayName(e.name),outcome:e.outcome,reason:e.reason});try{await t.slack.request(`chat.update`,{channel:t.slack.channelId,ts:a,text:o})}catch(t){log.error(`Slack auth status edit failed`,{name:e.name,error:t})}let c={...r};delete c[e.name],t.state.pendingAuthMessageTs=c}};export{defaultEvents,defaultInputRequestedHandler,defaultOnAppMention,defaultOnDirectMessage,defaultSlackAuth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_AI_PACKAGE_VERSION=`7.0.0-beta.178`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.13.
|
|
1
|
+
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_AI_PACKAGE_VERSION=`7.0.0-beta.178`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.13.4`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e){return{"agent/agent.ts":BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
|
|
2
2
|
|
|
3
3
|
export default defineAgent({
|
|
4
4
|
model: "__EVE_INIT_MODEL__",
|
package/dist/src/svelte/index.js
CHANGED
package/dist/src/vue/index.js
CHANGED
|
@@ -44,7 +44,7 @@ Export the result of `defineInstrumentation` as the default export.
|
|
|
44
44
|
|
|
45
45
|
Use the `setup` callback to register your OTel provider (for example `registerOTel` from `@vercel/otel`). The framework invokes it at server startup with the resolved agent name. `context.agentName` is resolved at compile time from your project (the package's `name`, falling back to the app directory name), so you never hard-code a service name.
|
|
46
46
|
|
|
47
|
-
Any OTel-compatible backend works (Braintrust, Honeycomb, Datadog, Jaeger). Install the exporter package you need and configure it in the callback.
|
|
47
|
+
Any OTel-compatible backend works (Braintrust, Raindrop, Arize, Honeycomb, Datadog, Jaeger). Install the exporter package you need and configure it in the callback.
|
|
48
48
|
|
|
49
49
|
Three more fields control what the AI SDK records inside those spans (see the AI SDK's [telemetry reference](https://ai-sdk.dev/docs/ai-sdk-core/telemetry)):
|
|
50
50
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
|
|
6
6
|
"keywords": [
|
|
@@ -273,8 +273,8 @@
|
|
|
273
273
|
"@ai-sdk/openai": "4.0.0-beta.74",
|
|
274
274
|
"@ai-sdk/otel": "1.0.0-beta.124",
|
|
275
275
|
"@ai-sdk/provider": "4.0.0-beta.19",
|
|
276
|
-
"@chat-adapter/slack": "4.
|
|
277
|
-
"@chat-adapter/state-memory": "4.
|
|
276
|
+
"@chat-adapter/slack": "4.31.0",
|
|
277
|
+
"@chat-adapter/state-memory": "4.31.0",
|
|
278
278
|
"@clack/core": "1.3.1",
|
|
279
279
|
"@nuxt/kit": "^4.0.0",
|
|
280
280
|
"@standard-schema/spec": "1.1.0",
|
|
@@ -286,13 +286,13 @@
|
|
|
286
286
|
"@vercel/oidc": "3.5.0",
|
|
287
287
|
"@vercel/sandbox": "2.2.1",
|
|
288
288
|
"@vercel/sdk": "1.28.1",
|
|
289
|
-
"@workflow/core": "5.0.0-beta.
|
|
289
|
+
"@workflow/core": "5.0.0-beta.24",
|
|
290
290
|
"@workflow/errors": "5.0.0-beta.8",
|
|
291
|
-
"@workflow/world": "5.0.0-beta.
|
|
292
|
-
"@workflow/world-local": "5.0.0-beta.
|
|
291
|
+
"@workflow/world": "5.0.0-beta.13",
|
|
292
|
+
"@workflow/world-local": "5.0.0-beta.21",
|
|
293
293
|
"ai": "7.0.0-beta.178",
|
|
294
294
|
"autoevals": "0.0.132",
|
|
295
|
-
"chat": "4.
|
|
295
|
+
"chat": "4.31.0",
|
|
296
296
|
"chokidar": "5.0.0",
|
|
297
297
|
"commander": "14.0.3",
|
|
298
298
|
"emulate": "^0.6.0",
|