experimental-ash 0.24.0 → 0.24.2

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.
Files changed (155) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/src/chunks/authored-module-loader-DcCfCiBm.js +4 -0
  3. package/dist/src/chunks/client-DLHAGI2g.js +4 -0
  4. package/dist/src/chunks/dev-authored-source-watcher-CBID_Dwh.js +1 -0
  5. package/dist/src/chunks/{errors-DsO9xmQL.js → errors-HYWjHxV6.js} +1 -1
  6. package/dist/src/chunks/{gray-matter-BxS7ZG-J.js → gray-matter-D-9jHwOT.js} +4 -4
  7. package/dist/src/chunks/host-zBy9FyyX.js +70 -0
  8. package/dist/src/chunks/{jsdist-M7JFZoA4.js → jsdist-BkeWZ7EZ.js} +61 -61
  9. package/dist/src/chunks/package-HUaeub_D.js +1 -0
  10. package/dist/src/chunks/paths-CebY5GCi.js +89 -0
  11. package/dist/src/chunks/{picocolors-Bq-tZK9u.js → picocolors-aAkqW4On.js} +1 -1
  12. package/dist/src/chunks/token-D98SQdvs.js +1 -0
  13. package/dist/src/chunks/{url-BVRhVE2O.js → url-JdCGA634.js} +1 -1
  14. package/dist/src/cli/commands/info.js +1 -1
  15. package/dist/src/cli/dev/environment.d.ts +16 -2
  16. package/dist/src/cli/dev/environment.js +1 -1
  17. package/dist/src/cli/dev/input-requests.js +1 -1
  18. package/dist/src/cli/dev/repl.js +3 -3
  19. package/dist/src/cli/dev/url.js +1 -1
  20. package/dist/src/cli/run.js +1 -1
  21. package/dist/src/cli/ui/output.js +1 -1
  22. package/dist/src/client/index.d.ts +1 -0
  23. package/dist/src/client/index.js +1 -0
  24. package/dist/src/compiled/.vendor-stamp.json +7 -6
  25. package/dist/src/compiled/@ai-sdk/anthropic/index.js +1 -1
  26. package/dist/src/compiled/@ai-sdk/google/index.js +1 -1
  27. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
  28. package/dist/src/compiled/@ai-sdk/openai/index.js +1 -1
  29. package/dist/src/compiled/@ai-sdk/otel/index.js +1 -1
  30. package/dist/src/compiled/@chat-adapter/slack/_slack-web-api.d.ts +7 -0
  31. package/dist/src/compiled/@chat-adapter/slack/index.d.ts +418 -109
  32. package/dist/src/compiled/@chat-adapter/slack/index.js +31 -27
  33. package/dist/src/compiled/@chat-adapter/slack/package.json +1 -1
  34. package/dist/src/compiled/@chat-adapter/state-memory/index.d.ts +8 -2
  35. package/dist/src/compiled/@chat-adapter/state-memory/index.js +1 -1
  36. package/dist/src/compiled/@chat-adapter/state-memory/package.json +1 -1
  37. package/dist/src/compiled/@opentelemetry/api/index.js +1 -1
  38. package/dist/src/compiled/@vercel/sandbox/index.js +19 -17
  39. package/dist/src/compiled/@vercel/sandbox/package.json +1 -1
  40. package/dist/src/compiled/@workflow/core/index.js +2 -2
  41. package/dist/src/compiled/@workflow/core/runtime.js +22 -22
  42. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  43. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  44. package/dist/src/compiled/_chunks/node/auth-ZhCJAHxl.js +2 -0
  45. package/dist/src/compiled/_chunks/node/{dist-BdWHjlRQ.js → dist-BQYUcBqu.js} +31 -31
  46. package/dist/src/compiled/_chunks/node/{chunk-Dd2tEFlW.js → dist-BdTs18CF.js} +1 -1
  47. package/dist/src/compiled/_chunks/node/retry-DkR2H1Y0.js +1 -0
  48. package/dist/src/compiled/_chunks/node/token-CoIbMZkq.js +1 -0
  49. package/dist/src/compiled/_chunks/node/{version-BMyZn3Y2.js → version-D4IYmfaS.js} +1 -1
  50. package/dist/src/compiled/_chunks/workflow/coerce-BhzIW-Hm.js +1 -0
  51. package/dist/src/compiled/_chunks/workflow/{compat-CIROS3w4.js → compat-DcEvieoj.js} +1 -1
  52. package/dist/src/compiled/_chunks/workflow/{core-DOVmxHH8.js → core-XWIi7wKc.js} +3 -3
  53. package/dist/src/compiled/_chunks/workflow/{dist-C7wPwOI9.js → dist-DO14ZaQj.js} +1 -1
  54. package/dist/src/compiled/_chunks/workflow/{dist-CpUQh3NH.js → dist-DZZY3Zyp.js} +1 -1
  55. package/dist/src/compiled/_chunks/workflow/resume-hook-DOMbNs-S.js +51 -0
  56. package/dist/src/compiled/_chunks/workflow/{schemas-DFZoEyCn.js → schemas-DmgDnhW3.js} +1 -1
  57. package/dist/src/compiled/_chunks/workflow/sleep-CRjce49s.js +1 -0
  58. package/dist/src/compiled/_chunks/workflow/{src-ClRYdO4-.js → src-B54rYDvB.js} +1 -1
  59. package/dist/src/compiled/_chunks/workflow/symbols-D8paKc8P.js +9 -0
  60. package/dist/src/compiled/_chunks/workflow/{token-CsNmv7KW.js → token-D9z1dMB6.js} +1 -1
  61. package/dist/src/compiled/_chunks/workflow/{token-j5Cl4rrs.js → token-DV7rQw_t.js} +1 -1
  62. package/dist/src/compiled/chat/index.d.ts +6 -3143
  63. package/dist/src/compiled/chat/index.js +1 -1
  64. package/dist/src/compiled/chat/{jsx-runtime-DxGwoLu2.d.ts → jsx-runtime-CFq1K_Ve.d.ts} +1 -1
  65. package/dist/src/compiled/chat/package.json +1 -1
  66. package/dist/src/compiled/jose/index.js +2 -2
  67. package/dist/src/compiled/jsonc-parser/LICENSE.md +21 -0
  68. package/dist/src/compiled/jsonc-parser/index.d.ts +13 -0
  69. package/dist/src/compiled/jsonc-parser/index.js +15 -0
  70. package/dist/src/compiled/jsonc-parser/package.json +7 -0
  71. package/dist/src/compiled/just-bash/index.js +773 -773
  72. package/dist/src/compiled/just-bash/package.json +1 -1
  73. package/dist/src/compiled/turndown/index.js +1 -1
  74. package/dist/src/compiled/zod/index.js +1 -1
  75. package/dist/src/compiled/zod-validation-error/index.js +1 -1
  76. package/dist/src/compiler/manifest.d.ts +36 -3
  77. package/dist/src/compiler/manifest.js +5 -1
  78. package/dist/src/compiler/module-map.js +8 -0
  79. package/dist/src/compiler/normalize-manifest.js +1 -0
  80. package/dist/src/compiler/normalize-subagent.d.ts +3 -2
  81. package/dist/src/compiler/normalize-subagent.js +112 -3
  82. package/dist/src/compiler/remote-agent-node.d.ts +20 -0
  83. package/dist/src/compiler/remote-agent-node.js +19 -0
  84. package/dist/src/discover/discover-subagent.js +35 -2
  85. package/dist/src/discover/grammar.d.ts +1 -0
  86. package/dist/src/discover/grammar.js +5 -0
  87. package/dist/src/evals/cli/eval.js +1 -1
  88. package/dist/src/evals/loaders/yaml.js +1 -1
  89. package/dist/src/evals/runner/discover.js +1 -1
  90. package/dist/src/evals/runner/execute-suite.js +1 -1
  91. package/dist/src/evals/runner/reporters/console.js +1 -1
  92. package/dist/src/evals/scorers/autoevals-client.js +1 -1
  93. package/dist/src/evals/scorers/autoevals.js +1 -1
  94. package/dist/src/evals/scorers/json.js +1 -1
  95. package/dist/src/evals/scorers/run.js +1 -1
  96. package/dist/src/evals/scorers/sql.js +1 -1
  97. package/dist/src/evals/scorers/text.js +1 -1
  98. package/dist/src/execution/connection-auth-steps.js +2 -0
  99. package/dist/src/internal/application/package.js +1 -1
  100. package/dist/src/internal/authored-asset-import-plugin.d.ts +5 -0
  101. package/dist/src/internal/authored-asset-import-plugin.js +141 -0
  102. package/dist/src/internal/authored-module-bundle.d.ts +4 -0
  103. package/dist/src/internal/authored-module-bundle.js +19 -0
  104. package/dist/src/internal/authored-module-loader.d.ts +6 -0
  105. package/dist/src/internal/authored-module-loader.js +114 -125
  106. package/dist/src/internal/authored-package-tsconfig-paths.d.ts +9 -0
  107. package/dist/src/internal/authored-package-tsconfig-paths.js +209 -0
  108. package/dist/src/internal/nitro/host/channel-routes.d.ts +9 -2
  109. package/dist/src/internal/nitro/host/dev-authored-source-watcher.d.ts +12 -1
  110. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +19 -3
  111. package/dist/src/internal/nitro/host/schedule-task-routes.d.ts +7 -3
  112. package/dist/src/internal/nitro/host/start-development-server.js +2 -0
  113. package/dist/src/internal/workflow-bundle/builder-support.js +1 -33
  114. package/dist/src/public/agents/auth.d.ts +30 -0
  115. package/dist/src/public/agents/auth.js +37 -0
  116. package/dist/src/public/definitions/remote-agent.d.ts +25 -0
  117. package/dist/src/public/definitions/remote-agent.js +11 -0
  118. package/dist/src/public/index.d.ts +1 -0
  119. package/dist/src/public/index.js +1 -0
  120. package/dist/src/public/next/index.d.ts +4 -4
  121. package/dist/src/public/next/index.js +16 -25
  122. package/dist/src/runtime/connections/mcp-client.js +3 -2
  123. package/dist/src/runtime/connections/types.d.ts +24 -0
  124. package/dist/src/runtime/resolve-agent-graph.js +57 -0
  125. package/dist/src/runtime/sessions/turn.d.ts +17 -5
  126. package/dist/src/runtime/subagents/registry.d.ts +6 -6
  127. package/dist/src/runtime/subagents/registry.js +1 -1
  128. package/dist/src/runtime/types.d.ts +20 -0
  129. package/package.json +22 -17
  130. package/dist/src/chunks/authored-module-loader-XcFLnl49.js +0 -2
  131. package/dist/src/chunks/client-nshDsWNF.js +0 -4
  132. package/dist/src/chunks/dev-authored-source-watcher-B4PaZGUr.js +0 -7
  133. package/dist/src/chunks/host-DsW72Q-w.js +0 -65
  134. package/dist/src/chunks/package-DmsQgn4v.js +0 -1
  135. package/dist/src/chunks/paths-OknjaYR8.js +0 -89
  136. package/dist/src/chunks/prewarm-B4YblQ5m.js +0 -6
  137. package/dist/src/chunks/token-DtoyQZy2.js +0 -1
  138. package/dist/src/chunks/token-util-CHjOk3A7.js +0 -1
  139. package/dist/src/compiled/_chunks/node/auth-vbe4XEEK.js +0 -2
  140. package/dist/src/compiled/_chunks/node/dist-DMSq2ehP.js +0 -1
  141. package/dist/src/compiled/_chunks/node/retry-BOcy5BbJ.js +0 -1
  142. package/dist/src/compiled/_chunks/node/token-D-BTJHoU.js +0 -1
  143. package/dist/src/compiled/_chunks/workflow/coerce-Dh0wa7P9.js +0 -1
  144. package/dist/src/compiled/_chunks/workflow/context-errors-Bbvvp-li.js +0 -6
  145. package/dist/src/compiled/_chunks/workflow/dist-C_oiE-l7.js +0 -40
  146. package/dist/src/compiled/_chunks/workflow/resume-hook-C3VWUPii.js +0 -12
  147. package/dist/src/compiled/_chunks/workflow/sleep-QTkC1VFe.js +0 -1
  148. package/dist/src/compiled/_chunks/workflow/symbols-QezhMuLg.js +0 -4
  149. package/dist/src/compiled/chat/_workflow-serde.d.ts +0 -5
  150. /package/dist/src/chunks/{chunk-8L7ocgPr.js → chunk-DSjMdhoD.js} +0 -0
  151. /package/dist/src/chunks/{guards-CjJ3lmju.js → guards-26p6sOw3.js} +0 -0
  152. /package/dist/src/chunks/{input-requests-BsBi7_5K.js → input-requests-DJiy6dG9.js} +0 -0
  153. /package/dist/src/chunks/{runtime-model-BWu6M_hq.js → runtime-model-Dh0Nz64z.js} +0 -0
  154. /package/dist/src/chunks/{types-MZUhN0Zy.js → types-DDA2QUED.js} +0 -0
  155. /package/dist/src/compiled/_chunks/workflow/{chunk-DHhdAPOb.js → chunk-DSjMdhoD.js} +0 -0
@@ -1 +1 @@
1
- import{n as e}from"../_chunks/workflow/chunk-DHhdAPOb.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-DOVmxHH8.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-DFZoEyCn.js";import{i as Sr,n as Cr,r as wr,t as Tr}from"../_chunks/workflow/compat-CIROS3w4.js";import{t as Er}from"../_chunks/workflow/coerce-Dh0wa7P9.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{n as e}from"../_chunks/workflow/chunk-DSjMdhoD.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-XWIi7wKc.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-DmgDnhW3.js";import{i as Sr,n as Cr,r as wr,t as Tr}from"../_chunks/workflow/compat-DcEvieoj.js";import{t as Er}from"../_chunks/workflow/coerce-BhzIW-Hm.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 +1 @@
1
- import{_i as e}from"../_chunks/workflow/core-DOVmxHH8.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/workflow/core-XWIi7wKc.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,5 +1,6 @@
1
1
  import { z } from "#compiled/zod/index.js";
2
2
  import { type DiscoverDiagnosticsSummary } from "#discover/diagnostics.js";
3
+ import { type CompiledRemoteAgentNode } from "#compiler/remote-agent-node.js";
3
4
  import type { ChannelMethod } from "#public/definitions/channel.js";
4
5
  import type { Node } from "#shared/node.js";
5
6
  import type { MarkdownSourceRef, ModuleSourceRef, SkillPackageSourceRef } from "#shared/source-ref.js";
@@ -17,7 +18,7 @@ export declare const ROOT_COMPILED_AGENT_NODE_ID = "__root__";
17
18
  /**
18
19
  * Current compiled manifest schema version.
19
20
  */
20
- export declare const COMPILED_AGENT_MANIFEST_VERSION = 22;
21
+ export declare const COMPILED_AGENT_MANIFEST_VERSION = 24;
21
22
  /**
22
23
  * Compiled channel entry preserved in the compiled manifest.
23
24
  */
@@ -139,6 +140,7 @@ export type CompiledSubagentNode = Readonly<ModuleSourceRef & Node & {
139
140
  name: string;
140
141
  rootPath: string;
141
142
  }>;
143
+ export type { CompiledRemoteAgentNode } from "#compiler/remote-agent-node.js";
142
144
  /**
143
145
  * Parent-child edge connecting two compiled agent nodes.
144
146
  */
@@ -243,6 +245,21 @@ export declare const compiledAgentNodeManifestSchema: z.ZodObject<{
243
245
  sourceId: z.ZodString;
244
246
  sourceKind: z.ZodUnion<readonly [z.ZodLiteral<"markdown">, z.ZodLiteral<"module">]>;
245
247
  }, z.core.$strict>>;
248
+ remoteAgents: z.ZodArray<z.ZodType<Readonly<ModuleSourceRef & Node & {
249
+ description: string;
250
+ entryPath: string;
251
+ name: string;
252
+ path: string;
253
+ rootPath: string;
254
+ url: string;
255
+ }>, unknown, z.core.$ZodTypeInternals<Readonly<ModuleSourceRef & Node & {
256
+ description: string;
257
+ entryPath: string;
258
+ name: string;
259
+ path: string;
260
+ rootPath: string;
261
+ url: string;
262
+ }>, unknown>>>;
246
263
  skills: z.ZodReadonly<z.ZodArray<z.ZodType<CompiledSkillDefinition, unknown, z.core.$ZodTypeInternals<CompiledSkillDefinition, unknown>>>>;
247
264
  instructions: z.ZodOptional<z.ZodObject<{
248
265
  name: z.ZodString;
@@ -292,6 +309,21 @@ export declare const compiledAgentManifestSchema: z.ZodObject<{
292
309
  disabledFrameworkTools: z.ZodReadonly<z.ZodArray<z.ZodString>>;
293
310
  hooks: z.ZodArray<z.ZodType<CompiledHookDefinition, unknown, z.core.$ZodTypeInternals<CompiledHookDefinition, unknown>>>;
294
311
  kind: z.ZodLiteral<"ash-agent-compiled-manifest">;
312
+ remoteAgents: z.ZodArray<z.ZodType<Readonly<ModuleSourceRef & Node & {
313
+ description: string;
314
+ entryPath: string;
315
+ name: string;
316
+ path: string;
317
+ rootPath: string;
318
+ url: string;
319
+ }>, unknown, z.core.$ZodTypeInternals<Readonly<ModuleSourceRef & Node & {
320
+ description: string;
321
+ entryPath: string;
322
+ name: string;
323
+ path: string;
324
+ rootPath: string;
325
+ url: string;
326
+ }>, unknown>>>;
295
327
  sandbox: z.ZodNullable<z.ZodObject<{
296
328
  description: z.ZodOptional<z.ZodString>;
297
329
  exportName: z.ZodOptional<z.ZodString>;
@@ -345,7 +377,7 @@ export declare const compiledAgentManifestSchema: z.ZodObject<{
345
377
  sourceId: z.ZodString;
346
378
  sourceKind: z.ZodLiteral<"module">;
347
379
  }, z.core.$strict>>;
348
- version: z.ZodLiteral<22>;
380
+ version: z.ZodLiteral<24>;
349
381
  workspaceResourceRoot: z.ZodObject<{
350
382
  logicalPath: z.ZodString;
351
383
  rootEntries: z.ZodReadonly<z.ZodArray<z.ZodString>>;
@@ -363,6 +395,7 @@ export declare function createCompiledAgentNodeManifest(input: {
363
395
  readonly diagnosticsSummary?: DiscoverDiagnosticsSummary;
364
396
  readonly disabledFrameworkTools?: readonly string[];
365
397
  readonly hooks?: readonly CompiledHookDefinition[];
398
+ readonly remoteAgents?: readonly CompiledRemoteAgentNode[];
366
399
  readonly sandbox?: CompiledSandboxDefinition | null;
367
400
  readonly sandboxWorkspaces?: readonly CompiledSandboxWorkspace[];
368
401
  readonly schedules?: readonly CompiledScheduleDefinition[];
@@ -400,6 +433,7 @@ export declare function createCompiledAgentManifest(input: {
400
433
  readonly diagnosticsSummary?: DiscoverDiagnosticsSummary;
401
434
  readonly disabledFrameworkTools?: readonly string[];
402
435
  readonly hooks?: readonly CompiledHookDefinition[];
436
+ readonly remoteAgents?: readonly CompiledRemoteAgentNode[];
403
437
  readonly sandbox?: CompiledSandboxDefinition | null;
404
438
  readonly sandboxWorkspaces?: readonly CompiledSandboxWorkspace[];
405
439
  readonly schedules?: readonly CompiledScheduleDefinition[];
@@ -409,4 +443,3 @@ export declare function createCompiledAgentManifest(input: {
409
443
  readonly instructions?: CompiledInstructions;
410
444
  readonly tools?: readonly CompiledToolDefinition[];
411
445
  }): CompiledAgentManifest;
412
- export {};
@@ -1,5 +1,6 @@
1
1
  import { z } from "#compiled/zod/index.js";
2
2
  import { discoverDiagnosticsSummarySchema, } from "#discover/diagnostics.js";
3
+ import { compiledRemoteAgentNodeSchema, } from "#compiler/remote-agent-node.js";
3
4
  import { jsonObjectSchema } from "#shared/json-schemas.js";
4
5
  /**
5
6
  * Stable manifest kind emitted by the compiler for runtime loading.
@@ -12,7 +13,7 @@ export const ROOT_COMPILED_AGENT_NODE_ID = "__root__";
12
13
  /**
13
14
  * Current compiled manifest schema version.
14
15
  */
15
- export const COMPILED_AGENT_MANIFEST_VERSION = 22;
16
+ export const COMPILED_AGENT_MANIFEST_VERSION = 24;
16
17
  const moduleSourceRefSchema = z
17
18
  .object({
18
19
  exportName: z.string().optional(),
@@ -221,6 +222,7 @@ export const compiledAgentNodeManifestSchema = z
221
222
  sandbox: compiledSandboxDefinitionSchema.nullable(),
222
223
  sandboxWorkspaces: z.array(compiledSandboxWorkspaceSchema),
223
224
  schedules: z.array(compiledScheduleDefinitionSchema),
225
+ remoteAgents: z.array(compiledRemoteAgentNodeSchema),
224
226
  skills: z.array(compiledSkillSourceSchema).readonly(),
225
227
  instructions: compiledInstructionsSchema.optional(),
226
228
  tools: z.array(compiledToolDefinitionSchema),
@@ -261,6 +263,7 @@ export const compiledAgentManifestSchema = z
261
263
  disabledFrameworkTools: z.array(z.string()).readonly(),
262
264
  hooks: z.array(compiledHookDefinitionSchema),
263
265
  kind: z.literal(COMPILED_AGENT_MANIFEST_KIND),
266
+ remoteAgents: z.array(compiledRemoteAgentNodeSchema),
264
267
  sandbox: compiledSandboxDefinitionSchema.nullable(),
265
268
  sandboxWorkspaces: z.array(compiledSandboxWorkspaceSchema),
266
269
  schedules: z.array(compiledScheduleDefinitionSchema),
@@ -314,6 +317,7 @@ export function createCompiledAgentNodeManifest(input) {
314
317
  },
315
318
  disabledFrameworkTools: [...(input.disabledFrameworkTools ?? [])],
316
319
  hooks: [...(input.hooks ?? [])],
320
+ remoteAgents: [...(input.remoteAgents ?? [])],
317
321
  sandbox: input.sandbox ?? null,
318
322
  sandboxWorkspaces: [...(input.sandboxWorkspaces ?? [])],
319
323
  schedules: [...(input.schedules ?? [])],
@@ -119,6 +119,14 @@ export function collectModuleRefsForManifest(manifest) {
119
119
  sourceId: tool.sourceId,
120
120
  });
121
121
  }
122
+ for (const remoteAgent of manifest.remoteAgents) {
123
+ moduleSourceRefs.set(remoteAgent.sourceId, {
124
+ exportName: remoteAgent.exportName,
125
+ sourceKind: "module",
126
+ logicalPath: remoteAgent.logicalPath,
127
+ sourceId: remoteAgent.sourceId,
128
+ });
129
+ }
122
130
  for (const hook of manifest.hooks) {
123
131
  moduleSourceRefs.set(hook.sourceId, {
124
132
  exportName: hook.exportName,
@@ -29,6 +29,7 @@ export async function compileAgentManifest(manifest) {
29
29
  ]);
30
30
  return createCompiledAgentManifest({
31
31
  ...compiledNode,
32
+ remoteAgents: subagentGraph.remoteAgents,
32
33
  subagentEdges: subagentGraph.edges,
33
34
  subagents: subagentGraph.nodes,
34
35
  });
@@ -1,5 +1,5 @@
1
- import type { AgentSourceManifest, LocalSubagentSourceRef } from "#discover/manifest.js";
2
- import { type CompiledAgentNodeManifest, type CompiledSubagentEdge, type CompiledSubagentNode } from "#compiler/manifest.js";
1
+ import { type AgentSourceManifest, type LocalSubagentSourceRef } from "#discover/manifest.js";
2
+ import { type CompiledAgentNodeManifest, type CompiledRemoteAgentNode, type CompiledSubagentEdge, type CompiledSubagentNode } from "#compiler/manifest.js";
3
3
  import { type ManifestCompileContext } from "#compiler/normalize-helpers.js";
4
4
  /**
5
5
  * Callback the subagent compiler uses to recurse into the per-node
@@ -25,4 +25,5 @@ export declare function compileSubagentGraph(input: {
25
25
  }): Promise<{
26
26
  readonly edges: readonly CompiledSubagentEdge[];
27
27
  readonly nodes: readonly CompiledSubagentNode[];
28
+ readonly remoteAgents: readonly CompiledRemoteAgentNode[];
28
29
  }>;
@@ -1,5 +1,8 @@
1
+ import { createPathDerivedSourceId, } from "#discover/manifest.js";
1
2
  import { createCompiledSubagentNodeId, } from "#compiler/manifest.js";
2
- import {} from "#compiler/normalize-helpers.js";
3
+ import { loadModuleBackedDefinition, } from "#compiler/normalize-helpers.js";
4
+ import { expectObjectRecord, expectOnlyKnownKeys, expectString, } from "#internal/authored-module.js";
5
+ import { ASH_CREATE_SESSION_ROUTE_PATH } from "#protocol/routes.js";
3
6
  /**
4
7
  * Compiles every local subagent reachable from one parent node into a
5
8
  * flat node list and the parent→child edges that connect them.
@@ -11,14 +14,19 @@ import {} from "#compiler/normalize-helpers.js";
11
14
  export async function compileSubagentGraph(input) {
12
15
  const compiledNodes = [];
13
16
  const compiledEdges = [];
17
+ const compiledRemoteAgents = [];
14
18
  for (const subagentSource of input.subagents) {
15
- const compiledSubagent = await compileSubagent({
19
+ const compiledSubagent = await compileSubagentDefinition({
16
20
  appRoot: input.appRoot,
17
21
  compileAgentNodeManifest: input.compileAgentNodeManifest,
18
22
  context: input.context,
19
23
  parentNodeId: input.parentNodeId,
20
24
  source: subagentSource,
21
25
  });
26
+ if (compiledSubagent.kind === "remote") {
27
+ compiledRemoteAgents.push(compiledSubagent.node);
28
+ continue;
29
+ }
22
30
  compiledNodes.push(compiledSubagent.node, ...compiledSubagent.descendants.nodes);
23
31
  compiledEdges.push({
24
32
  childNodeId: compiledSubagent.node.nodeId,
@@ -28,6 +36,31 @@ export async function compileSubagentGraph(input) {
28
36
  return {
29
37
  edges: compiledEdges,
30
38
  nodes: compiledNodes,
39
+ remoteAgents: compiledRemoteAgents,
40
+ };
41
+ }
42
+ async function compileSubagentDefinition(input) {
43
+ const configModule = input.source.manifest.configModule;
44
+ if (configModule === undefined) {
45
+ throw new Error(`Subagent "${input.source.logicalPath}" is missing an agent config module.`);
46
+ }
47
+ const definition = await loadModuleBackedDefinition({
48
+ agentRoot: input.source.manifest.agentRoot,
49
+ kind: "subagent config",
50
+ source: configModule,
51
+ });
52
+ if (readAgentDefinitionKind(definition) === "remote") {
53
+ return {
54
+ kind: "remote",
55
+ node: compileRemoteAgent({
56
+ source: input.source,
57
+ value: definition,
58
+ }),
59
+ };
60
+ }
61
+ return {
62
+ kind: "local",
63
+ ...(await compileLocalSubagent(input)),
31
64
  };
32
65
  }
33
66
  async function compileSubagent(input) {
@@ -51,7 +84,10 @@ async function compileSubagent(input) {
51
84
  return {
52
85
  descendants,
53
86
  node: {
54
- agent,
87
+ agent: {
88
+ ...agent,
89
+ remoteAgents: [...descendants.remoteAgents],
90
+ },
55
91
  description,
56
92
  entryPath: input.source.entryPath,
57
93
  logicalPath: input.source.logicalPath,
@@ -63,3 +99,76 @@ async function compileSubagent(input) {
63
99
  },
64
100
  };
65
101
  }
102
+ const compileLocalSubagent = compileSubagent;
103
+ function compileRemoteAgent(input) {
104
+ const configModule = input.source.manifest.configModule;
105
+ if (configModule === undefined) {
106
+ throw new Error(`Remote agent "${input.source.logicalPath}" is missing a config module.`);
107
+ }
108
+ assertRemoteAgentDefinitionHasNoLocalPackageEntries(input.source);
109
+ const definition = normalizeRemoteAgentDefinition(input.value, `Expected the remote agent config export "${configModule.exportName ?? "default"}" from "${configModule.logicalPath}" to match the public Ash shape.`);
110
+ const moduleSource = createRemoteAgentModuleSourceRef(input.source, configModule);
111
+ return {
112
+ ...moduleSource,
113
+ description: definition.description,
114
+ entryPath: input.source.entryPath,
115
+ name: input.source.subagentId,
116
+ nodeId: input.source.sourceId,
117
+ path: definition.path,
118
+ rootPath: input.source.rootPath,
119
+ url: definition.url,
120
+ };
121
+ }
122
+ function createRemoteAgentModuleSourceRef(source, configModule) {
123
+ const logicalPath = source.logicalPath === configModule.logicalPath
124
+ ? configModule.logicalPath
125
+ : `${source.logicalPath}/${configModule.logicalPath}`;
126
+ const moduleSource = {
127
+ logicalPath,
128
+ sourceId: createPathDerivedSourceId(logicalPath),
129
+ sourceKind: "module",
130
+ };
131
+ if (configModule.exportName !== undefined) {
132
+ moduleSource.exportName = configModule.exportName;
133
+ }
134
+ return moduleSource;
135
+ }
136
+ function readAgentDefinitionKind(value) {
137
+ if (value === null || typeof value !== "object") {
138
+ return "local";
139
+ }
140
+ return value.kind === "remote" ? "remote" : "local";
141
+ }
142
+ function normalizeRemoteAgentDefinition(value, message) {
143
+ const record = expectObjectRecord(value, message);
144
+ expectOnlyKnownKeys(record, ["auth", "description", "headers", "kind", "path", "url"], message);
145
+ if (record.kind !== "remote") {
146
+ throw new Error(`${message} Expected "kind" to be "remote".`);
147
+ }
148
+ return {
149
+ description: expectString(record.description, message),
150
+ path: record.path === undefined
151
+ ? ASH_CREATE_SESSION_ROUTE_PATH
152
+ : expectString(record.path, message),
153
+ url: expectString(record.url, message),
154
+ };
155
+ }
156
+ function assertRemoteAgentDefinitionHasNoLocalPackageEntries(source) {
157
+ const manifest = source.manifest;
158
+ const extraEntries = [
159
+ manifest.connections.length > 0 ? "connections/" : undefined,
160
+ manifest.hooks.length > 0 ? "hooks/" : undefined,
161
+ manifest.instructions !== undefined ? "instructions" : undefined,
162
+ manifest.lib.length > 0 ? "lib/" : undefined,
163
+ manifest.sandbox !== null ? "sandbox/" : undefined,
164
+ manifest.sandboxWorkspaces.length > 0 ? "sandbox/workspace/" : undefined,
165
+ manifest.schedules.length > 0 ? "schedules/" : undefined,
166
+ manifest.skills.length > 0 ? "skills/" : undefined,
167
+ manifest.subagents.length > 0 ? "subagents/" : undefined,
168
+ manifest.tools.length > 0 ? "tools/" : undefined,
169
+ ].filter((entry) => entry !== undefined);
170
+ if (extraEntries.length === 0) {
171
+ return;
172
+ }
173
+ throw new Error(`Remote subagent definition "${source.logicalPath}" cannot include local package entries. Remove unsupported entries: ${extraEntries.join(", ")}.`);
174
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from "#compiled/zod/index.js";
2
+ import type { Node } from "#shared/node.js";
3
+ import type { ModuleSourceRef } from "#shared/source-ref.js";
4
+ /**
5
+ * Remote subagent entry owned by one compiled agent node manifest. Like
6
+ * channels, remote subagents are node-local manifest entries rather than a
7
+ * separate graph-level list.
8
+ */
9
+ export type CompiledRemoteAgentNode = Readonly<ModuleSourceRef & Node & {
10
+ description: string;
11
+ entryPath: string;
12
+ name: string;
13
+ path: string;
14
+ rootPath: string;
15
+ url: string;
16
+ }>;
17
+ /**
18
+ * Zod schema for one compiled remote subagent entry.
19
+ */
20
+ export declare const compiledRemoteAgentNodeSchema: z.ZodType<CompiledRemoteAgentNode>;
@@ -0,0 +1,19 @@
1
+ import { z } from "#compiled/zod/index.js";
2
+ /**
3
+ * Zod schema for one compiled remote subagent entry.
4
+ */
5
+ export const compiledRemoteAgentNodeSchema = z
6
+ .object({
7
+ description: z.string(),
8
+ entryPath: z.string(),
9
+ exportName: z.string().optional(),
10
+ logicalPath: z.string(),
11
+ name: z.string(),
12
+ nodeId: z.string(),
13
+ path: z.string(),
14
+ rootPath: z.string(),
15
+ sourceId: z.string(),
16
+ sourceKind: z.literal("module"),
17
+ url: z.string(),
18
+ })
19
+ .strict();
@@ -1,11 +1,11 @@
1
1
  import { join, relative, resolve } from "node:path";
2
2
  import { discoverConnectionSources } from "#discover/connections.js";
3
3
  import { createDiscoverErrorDiagnostic } from "#discover/diagnostics.js";
4
- import { classifyLocalSubagentEntry, getDirectoryEntryType, normalizeLogicalPath, } from "#discover/filesystem.js";
4
+ import { classifyLocalSubagentEntry, getDirectoryEntryType, getSupportedModuleBaseName, normalizeLogicalPath, } from "#discover/filesystem.js";
5
5
  import { createHookNameDiagnostic, createToolNameDiagnostic, createUnsupportedRootDirectoryDiagnostics, DISCOVER_TOOLS_DIRECTORY_INVALID, discoverFlatModuleSource, discoverInstructionsSource, discoverNamedSourceDirectory, readSortedDirectoryEntries, } from "#discover/grammar.js";
6
6
  import { DISCOVER_HOOKS_DIRECTORY_INVALID } from "#discover/discover-agent.js";
7
7
  import { discoverLibSources } from "#discover/lib.js";
8
- import { createAgentSourceManifest, createLocalSubagentSourceRef, } from "#discover/manifest.js";
8
+ import { createAgentSourceManifest, createLocalSubagentSourceRef, createModuleSourceRef, } from "#discover/manifest.js";
9
9
  import { createDiskProjectSource, } from "#discover/project-source.js";
10
10
  import { discoverSandboxSource } from "#discover/sandbox.js";
11
11
  import { discoverSkills } from "#discover/skills.js";
@@ -47,6 +47,20 @@ export async function discoverSubagents(input) {
47
47
  const diagnostics = [];
48
48
  const subagents = [];
49
49
  for (const entry of entries) {
50
+ if (entry.isFile()) {
51
+ const subagentId = getSupportedModuleBaseName(entry.name);
52
+ if (subagentId === null) {
53
+ continue;
54
+ }
55
+ subagents.push(discoverSingleFileSubagent({
56
+ agentRoot,
57
+ appRoot: input.appRoot,
58
+ subagentId,
59
+ subagentLogicalPath: join(subagentsLogicalPath, entry.name),
60
+ subagentPath: join(subagentsDirectoryPath, entry.name),
61
+ }));
62
+ continue;
63
+ }
50
64
  if (!entry.isDirectory()) {
51
65
  continue;
52
66
  }
@@ -65,6 +79,24 @@ export async function discoverSubagents(input) {
65
79
  subagents,
66
80
  };
67
81
  }
82
+ function discoverSingleFileSubagent(input) {
83
+ const configModule = createModuleSourceRef({
84
+ logicalPath: input.subagentLogicalPath,
85
+ });
86
+ const manifest = createAgentSourceManifest({
87
+ agentId: input.subagentId,
88
+ agentRoot: input.agentRoot,
89
+ appRoot: input.appRoot,
90
+ configModule,
91
+ });
92
+ return createLocalSubagentSourceRef({
93
+ entryPath: input.subagentPath,
94
+ logicalPath: input.subagentLogicalPath,
95
+ manifest,
96
+ rootPath: input.agentRoot,
97
+ subagentId: input.subagentId,
98
+ });
99
+ }
68
100
  async function discoverLocalSubagentPackage(input) {
69
101
  const diagnostics = [];
70
102
  const rootEntries = await readSortedDirectoryEntries(input.source, input.subagentRoot);
@@ -77,6 +109,7 @@ async function discoverLocalSubagentPackage(input) {
77
109
  rootPath: input.subagentRoot,
78
110
  }));
79
111
  const instructionsResult = await discoverInstructionsSource({
112
+ required: false,
80
113
  rootEntries,
81
114
  rootPath: input.subagentRoot,
82
115
  source: input.source,
@@ -127,6 +127,7 @@ export declare function getPathType(source: ProjectSource, targetPath: string):
127
127
  * author to rename the file.
128
128
  */
129
129
  export declare function discoverInstructionsSource(input: {
130
+ required?: boolean;
130
131
  rootEntries: readonly ProjectSourceEntry[];
131
132
  rootPath: string;
132
133
  source: ProjectSource;
@@ -164,6 +164,11 @@ export async function discoverInstructionsSource(input) {
164
164
  diagnostics: legacyResult.diagnostics,
165
165
  };
166
166
  }
167
+ if (input.required === false) {
168
+ return {
169
+ diagnostics: [],
170
+ };
171
+ }
167
172
  return {
168
173
  diagnostics: [
169
174
  createDiscoverErrorDiagnostic({
@@ -1 +1 @@
1
- import{n as e}from"../../chunks/paths-OknjaYR8.js";import{loadDevelopmentEnvironmentFiles as t}from"../../cli/dev/environment.js";import{a as n,n as r,t as i}from"../../chunks/client-nshDsWNF.js";import{n as a}from"../../chunks/host-DsW72Q-w.js";import{discoverAndImportSuites as o,discoverSuiteFiles as s,importSuiteFile as c}from"../runner/discover.js";import{executeSuite as l}from"../runner/execute-suite.js";import{ConsoleReporter as u}from"../runner/reporters/console.js";var d=n();function f(e,t){e.command(`eval`).description(`Run eval suites against an Ash agent.`).option(`--suite <id...>`,`Suite IDs to run (repeatable)`).option(`--all`,`Run all discovered suites`).option(`--url <url>`,`Remote agent URL (skip local host startup)`).option(`--timeout <ms>`,`Per-case timeout in milliseconds`).option(`--max-concurrency <n>`,`Max concurrent case executions per suite`).option(`--json`,`Output results as JSON`).option(`--list-suites`,`List discovered suites and exit`).option(`--skip-report`,`Skip suite-defined reporters (e.g. Braintrust)`).action(async e=>{await p(e,t)})}async function p(n,r){let i=e();if(t(i),n.listSuites){await y(i,r);return}let s=n.suite,c=await o(i,s);if(c.length===0){s&&s.length>0?r.error(`No suites found matching: ${s.join(`, `)}`):r.error(`No eval suites found. Create suite files under evals/ with the *.eval.ts extension.`),process.exitCode=1;return}let u,d;n.url?d={kind:`remote`,url:n.url}:(u=await a(i,{host:`127.0.0.1`,port:0}),d={kind:`local`,url:u.url});let f=m(d);try{let e=[];for(let t of c){let r=_(t,n),a=v(r,{json:n.json===!0,skipReport:n.skipReport===!0}),o=await l({suite:r,target:d,reporters:a,appRoot:i,client:f});e.push(o)}n.json&&r.log(JSON.stringify(e,null,2)),e.some(e=>e.errored>0)&&(process.exitCode=1)}finally{u&&await u.close()}process.exit(process.exitCode??0)}function m(e){if(e.kind===`local`)return new i({host:e.url});let t={},n=process.env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();return n&&(t[r]=n),new i({auth:h(),headers:Object.keys(t).length>0?t:void 0,host:e.url})}function h(){let e=process.env.ASH_EVAL_AUTH_TOKEN?.trim();return e?{bearer:e}:{bearer:g}}async function g(){try{let e=(await(0,d.getVercelOidcToken)()).trim();if(e.length>0)return e}catch{}return process.env.VERCEL_OIDC_TOKEN?.trim()??``}function _(e,t){let n=t.maxConcurrency?Number.parseInt(t.maxConcurrency,10):void 0,r=t.timeout?Number.parseInt(t.timeout,10):void 0;if(n===void 0&&r===void 0)return e;let i={...e};return n!==void 0&&(i.maxConcurrency=n),r!==void 0&&(i.timeoutMs=r),i}function v(e,t){let n=t.json?[]:[new u];return!t.skipReport&&e.reporters&&n.push(...e.reporters),n}async function y(e,t){let n=await s(e);if(n.length===0){t.log(`No eval suites found.`);return}t.log(`Found ${n.length} eval suite file(s):\n`);for(let r of n){let n=await c(e,r);t.log(` ${n.id}${n.description?` - ${n.description}`:``}`)}}export{f as registerEvalCommand,p as runEvalCommand};
1
+ import{n as e}from"../../chunks/paths-CebY5GCi.js";import{loadDevelopmentEnvironmentFiles as t}from"../../cli/dev/environment.js";import{a as n,n as r,t as i}from"../../chunks/client-DLHAGI2g.js";import{n as a}from"../../chunks/host-zBy9FyyX.js";import{discoverAndImportSuites as o,discoverSuiteFiles as s,importSuiteFile as c}from"../runner/discover.js";import{executeSuite as l}from"../runner/execute-suite.js";import{ConsoleReporter as u}from"../runner/reporters/console.js";var d=n();function f(e,t){e.command(`eval`).description(`Run eval suites against an Ash agent.`).option(`--suite <id...>`,`Suite IDs to run (repeatable)`).option(`--all`,`Run all discovered suites`).option(`--url <url>`,`Remote agent URL (skip local host startup)`).option(`--timeout <ms>`,`Per-case timeout in milliseconds`).option(`--max-concurrency <n>`,`Max concurrent case executions per suite`).option(`--json`,`Output results as JSON`).option(`--list-suites`,`List discovered suites and exit`).option(`--skip-report`,`Skip suite-defined reporters (e.g. Braintrust)`).action(async e=>{await p(e,t)})}async function p(n,r){let i=e();if(t(i),n.listSuites){await y(i,r);return}let s=n.suite,c=await o(i,s);if(c.length===0){s&&s.length>0?r.error(`No suites found matching: ${s.join(`, `)}`):r.error(`No eval suites found. Create suite files under evals/ with the *.eval.ts extension.`),process.exitCode=1;return}let u,d;n.url?d={kind:`remote`,url:n.url}:(u=await a(i,{host:`127.0.0.1`,port:0}),d={kind:`local`,url:u.url});let f=m(d);try{let e=[];for(let t of c){let r=_(t,n),a=v(r,{json:n.json===!0,skipReport:n.skipReport===!0}),o=await l({suite:r,target:d,reporters:a,appRoot:i,client:f});e.push(o)}n.json&&r.log(JSON.stringify(e,null,2)),e.some(e=>e.errored>0)&&(process.exitCode=1)}finally{u&&await u.close()}process.exit(process.exitCode??0)}function m(e){if(e.kind===`local`)return new i({host:e.url});let t={},n=process.env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();return n&&(t[r]=n),new i({auth:h(),headers:Object.keys(t).length>0?t:void 0,host:e.url})}function h(){let e=process.env.ASH_EVAL_AUTH_TOKEN?.trim();return e?{bearer:e}:{bearer:g}}async function g(){try{let e=(await(0,d.getVercelOidcToken)()).trim();if(e.length>0)return e}catch{}return process.env.VERCEL_OIDC_TOKEN?.trim()??``}function _(e,t){let n=t.maxConcurrency?Number.parseInt(t.maxConcurrency,10):void 0,r=t.timeout?Number.parseInt(t.timeout,10):void 0;if(n===void 0&&r===void 0)return e;let i={...e};return n!==void 0&&(i.maxConcurrency=n),r!==void 0&&(i.timeoutMs=r),i}function v(e,t){let n=t.json?[]:[new u];return!t.skipReport&&e.reporters&&n.push(...e.reporters),n}async function y(e,t){let n=await s(e);if(n.length===0){t.log(`No eval suites found.`);return}t.log(`Found ${n.length} eval suite file(s):\n`);for(let r of n){let n=await c(e,r);t.log(` ${n.id}${n.description?` - ${n.description}`:``}`)}}export{f as registerEvalCommand,p as runEvalCommand};
@@ -1 +1 @@
1
- import{i as e}from"../../chunks/chunk-8L7ocgPr.js";import{t}from"../../chunks/gray-matter-BxS7ZG-J.js";import{isAbsolute as n,resolve as r}from"node:path";import{readFile as i}from"node:fs/promises";var a=e(t(),1);async function o(e){let t=await i(n(e)?e:r(process.cwd(),e),`utf-8`);return(0,a.default)(t.trimStart().startsWith(`---`)?t:`---\n${t}\n---`).data??{}}export{o as loadYaml};
1
+ import{i as e}from"../../chunks/chunk-DSjMdhoD.js";import{t}from"../../chunks/gray-matter-D-9jHwOT.js";import{isAbsolute as n,resolve as r}from"node:path";import{readFile as i}from"node:fs/promises";var a=e(t(),1);async function o(e){let t=await i(n(e)?e:r(process.cwd(),e),`utf-8`);return(0,a.default)(t.trimStart().startsWith(`---`)?t:`---\n${t}\n---`).data??{}}export{o as loadYaml};
@@ -1 +1 @@
1
- import{t as e}from"../../chunks/authored-module-loader-XcFLnl49.js";import{join as t,relative as n}from"node:path";import{readdir as r}from"node:fs/promises";const i=`.eval.ts`;async function a(e){let r=t(e,`evals`),i=[];try{await u(r,i)}catch(e){if(d(e))return[];throw e}return i.sort((e,t)=>n(r,e).localeCompare(n(r,t))),i}function o(e,r){let a=n(t(e,`evals`),r).split(/[\\/]/u).join(`/`);return a.endsWith(i)?a.slice(0,-8):a}async function s(t,n){let r=(await e(n)).default;if(!l(r))throw Error(`Suite file "${n}" does not export a valid AshEvalSuite as its default export. Use defineEvalSuite() to create the suite.`);return{...r,id:o(t,n)}}async function c(e,t){let n=await a(e);if(n.length===0)return[];let r=[];for(let i of n){let n=await s(e,i);(t===void 0||t.length===0||t.includes(n.id))&&r.push(n)}return r}function l(e){return typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`AshEvalSuite`}async function u(e,n){let a=await r(e,{withFileTypes:!0});for(let r of a){let a=t(e,r.name);r.isDirectory()?await u(a,n):r.isFile()&&r.name.endsWith(i)&&n.push(a)}}function d(e){return typeof e==`object`&&!!e&&`code`in e&&e.code===`ENOENT`}export{o as deriveSuiteId,c as discoverAndImportSuites,a as discoverSuiteFiles,s as importSuiteFile};
1
+ import{t as e}from"../../chunks/authored-module-loader-DcCfCiBm.js";import{join as t,relative as n}from"node:path";import{readdir as r}from"node:fs/promises";const i=`.eval.ts`;async function a(e){let r=t(e,`evals`),i=[];try{await u(r,i)}catch(e){if(d(e))return[];throw e}return i.sort((e,t)=>n(r,e).localeCompare(n(r,t))),i}function o(e,r){let a=n(t(e,`evals`),r).split(/[\\/]/u).join(`/`);return a.endsWith(i)?a.slice(0,-8):a}async function s(t,n){let r=(await e(n)).default;if(!l(r))throw Error(`Suite file "${n}" does not export a valid AshEvalSuite as its default export. Use defineEvalSuite() to create the suite.`);return{...r,id:o(t,n)}}async function c(e,t){let n=await a(e);if(n.length===0)return[];let r=[];for(let i of n){let n=await s(e,i);(t===void 0||t.length===0||t.includes(n.id))&&r.push(n)}return r}function l(e){return typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`AshEvalSuite`}async function u(e,n){let a=await r(e,{withFileTypes:!0});for(let r of a){let a=t(e,r.name);r.isDirectory()?await u(a,n):r.isFile()&&r.name.endsWith(i)&&n.push(a)}}function d(e){return typeof e==`object`&&!!e&&`code`in e&&e.code===`ENOENT`}export{o as deriveSuiteId,c as discoverAndImportSuites,a as discoverSuiteFiles,s as importSuiteFile};
@@ -1 +1 @@
1
- import{t as e}from"../../chunks/errors-DsO9xmQL.js";import{resolveArtifactDirectory as t,writeArtifacts as n}from"./artifacts.js";import{executeCase as r}from"./execute-case.js";async function i(e){let{suite:r,target:i,reporters:o,appRoot:c,client:l}=e,u=new Date().toISOString();for(let e of o)await e.onSuiteStart(r,i);let d=await r.load(),f=r.maxConcurrency??8,p=[],m=[...d],h=new Set;for(;m.length>0||h.size>0;){for(;m.length>0&&h.size<f;){let e=m.shift();if(e===void 0)break;let t=(async()=>{let t=await a(r,e,l);p.push(t);for(let e of o)await e.onCaseComplete(t)})().finally(()=>{h.delete(t)});h.add(t)}h.size>0&&await Promise.race(h)}let g=new Date().toISOString(),_={suite:r.id,target:i,cases:p,startedAt:u,completedAt:g,passed:p.filter(e=>!e.error&&e.scores.every(e=>s(e,r.thresholds))).length,errored:p.filter(e=>e.error!==void 0).length};await n(t(c,r.id),_);for(let e of o)await e.onSuiteComplete(_);return _}async function a(t,n,i){let a,s;try{a=await r({client:i,testCase:n,task:t.task,timeoutMs:t.timeoutMs})}catch(t){s=e(t),a={output:null,finalMessage:null,status:`failed`,events:[],derived:{toolCalls:[],toolCallCount:0,subagentCalls:[],subagentCallCount:0,messageCount:0,reasoningBlockCount:0}}}let c=await o(t,n,a);return{case:n,result:a,scores:c,error:s}}async function o(e,t,n){let r={input:typeof t.input==`string`?t.input:JSON.stringify(t.input),output:String(n.output??``),expected:t.expected===void 0?void 0:String(t.expected),model:e.model,modelOptions:e.modelOptions,case:t,result:n},i=[];for(let t of e.scores){let e=await t(r);e!==null&&i.push(e)}return i}function s(e,t){if(e.score===null)return!0;let n=t?.[e.name]??1;return e.score>=n}export{i as executeSuite};
1
+ import{t as e}from"../../chunks/errors-HYWjHxV6.js";import{resolveArtifactDirectory as t,writeArtifacts as n}from"./artifacts.js";import{executeCase as r}from"./execute-case.js";async function i(e){let{suite:r,target:i,reporters:o,appRoot:c,client:l}=e,u=new Date().toISOString();for(let e of o)await e.onSuiteStart(r,i);let d=await r.load(),f=r.maxConcurrency??8,p=[],m=[...d],h=new Set;for(;m.length>0||h.size>0;){for(;m.length>0&&h.size<f;){let e=m.shift();if(e===void 0)break;let t=(async()=>{let t=await a(r,e,l);p.push(t);for(let e of o)await e.onCaseComplete(t)})().finally(()=>{h.delete(t)});h.add(t)}h.size>0&&await Promise.race(h)}let g=new Date().toISOString(),_={suite:r.id,target:i,cases:p,startedAt:u,completedAt:g,passed:p.filter(e=>!e.error&&e.scores.every(e=>s(e,r.thresholds))).length,errored:p.filter(e=>e.error!==void 0).length};await n(t(c,r.id),_);for(let e of o)await e.onSuiteComplete(_);return _}async function a(t,n,i){let a,s;try{a=await r({client:i,testCase:n,task:t.task,timeoutMs:t.timeoutMs})}catch(t){s=e(t),a={output:null,finalMessage:null,status:`failed`,events:[],derived:{toolCalls:[],toolCallCount:0,subagentCalls:[],subagentCallCount:0,messageCount:0,reasoningBlockCount:0}}}let c=await o(t,n,a);return{case:n,result:a,scores:c,error:s}}async function o(e,t,n){let r={input:typeof t.input==`string`?t.input:JSON.stringify(t.input),output:String(n.output??``),expected:t.expected===void 0?void 0:String(t.expected),model:e.model,modelOptions:e.modelOptions,case:t,result:n},i=[];for(let t of e.scores){let e=await t(r);e!==null&&i.push(e)}return i}function s(e,t){if(e.score===null)return!0;let n=t?.[e.name]??1;return e.score>=n}export{i as executeSuite};