sliccy 5.84.1 → 5.85.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/{account-store-Dg-88ChJ.js → account-store-Bk0b9NNs.js} +1 -1
- package/dist/ui/assets/{account-store-CIBUpBw2.js → account-store-CsBhRflH.js} +1 -1
- package/dist/ui/assets/{adobe-DAu9m3li.js → adobe-BGZkhFf2.js} +1 -1
- package/dist/ui/assets/{adobe-CVUX352o.js → adobe-Cx_KcqS7.js} +1 -1
- package/dist/ui/assets/{apps-xHXbN2GJ.js → apps-Cu97llYd.js} +1 -1
- package/dist/ui/assets/{azure-openai-BRzd21eO.js → azure-openai-BAm3cDne.js} +1 -1
- package/dist/ui/assets/{azure-openai-Cj6dde55.js → azure-openai-GFt6bSin.js} +1 -1
- package/dist/ui/assets/{bedrock-camp-CVignIdH.js → bedrock-camp-CJY4i7di.js} +1 -1
- package/dist/ui/assets/{bedrock-camp-BO4bvAKs.js → bedrock-camp-DS0ilb3O.js} +1 -1
- package/dist/ui/assets/{cdp-BvZO3XX0.js → cdp-BEmpfM7z.js} +3 -3
- package/dist/ui/assets/{cerebras-DEHTb-Jp.js → cerebras-BdTrAltR.js} +1 -1
- package/dist/ui/assets/{cerebras-CSw0virw.js → cerebras-u2VrvWCg.js} +1 -1
- package/dist/ui/assets/{compat-aVSWLlYQ.js → compat-CkpNnFQS.js} +2 -2
- package/dist/ui/assets/completionchunk-CP7I4h3f.js +65 -0
- package/dist/ui/assets/completionchunk-JDMithrI.js +65 -0
- package/dist/ui/assets/{connect-surface-B3wGdqfR.js → connect-surface-B96uOALu.js} +1 -1
- package/dist/ui/assets/{context-compaction-_UkD06XB.js → context-compaction-C3e7rcEG.js} +1 -1
- package/dist/ui/assets/{fs-VwSXMsmq.js → fs-BQWc6Z05.js} +1 -1
- package/dist/ui/assets/{fs-g_oZbQ21.js → fs-kONhSqSK.js} +2 -2
- package/dist/ui/assets/{github-CyRcWzgO.js → github-BI5DkpcT.js} +1 -1
- package/dist/ui/assets/{github-copilot-CdLypAPy.js → github-copilot-Cta-8OE1.js} +1 -1
- package/dist/ui/assets/{github-copilot-BsgIQbuu.js → github-copilot-Ph5jEo5J.js} +1 -1
- package/dist/ui/assets/{github-DjZvupYV.js → github-hk9FJt_e.js} +2 -2
- package/dist/ui/assets/{kernel-worker-O-LVJQ2M.js → kernel-worker-DEYYnmZR.js} +437 -434
- package/dist/ui/assets/{legacy-api-aliases-IllWZ-uu.js → legacy-api-aliases-BWm3gxUe.js} +1 -1
- package/dist/ui/assets/{legacy-api-aliases-sqlB2uHc.js → legacy-api-aliases-YuuBU-he.js} +1 -1
- package/dist/ui/assets/{local-llm-Bo1kGMdi.js → local-llm-DtW9XFUO.js} +1 -1
- package/dist/ui/assets/{local-llm-C0t8US-G.js → local-llm-MwQVvzDf.js} +1 -1
- package/dist/ui/assets/{main-DiIgQpU7.js → main-DOvIDR_a.js} +3 -3
- package/dist/ui/assets/{main-cherry-CQ53lnqT.js → main-cherry-DCIO_2RP.js} +1 -1
- package/dist/ui/assets/{mistral-conversations-C57IiFrP.js → mistral-conversations-CIMZoDT4.js} +2 -2
- package/dist/ui/assets/{mistral-conversations-CzEm7KNl.js → mistral-conversations-CKK59QJS.js} +1 -1
- package/dist/ui/assets/{mount-D3ittikV.js → mount-28699D0M.js} +1 -1
- package/dist/ui/assets/{mount-OjhGugIM.js → mount-DABeOJmG.js} +2 -2
- package/dist/ui/assets/{mount-recovery-xwx3blgR.js → mount-recovery-DltEGR2O.js} +1 -1
- package/dist/ui/assets/{new-session-CM_drdQb.js → new-session-VQsGUTpx.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-CksCYB3j.js → oauth-bootstrap-E6pWsJ74.js} +2 -2
- package/dist/ui/assets/{openai-codex-CqUAR4bA.js → openai-codex-Bu3_z5H4.js} +1 -1
- package/dist/ui/assets/{openai-codex-BngX1JyO.js → openai-codex-E2ahulS6.js} +1 -1
- package/dist/ui/assets/{openrouter-BPw5Sadh.js → openrouter-Bcf97CqM.js} +1 -1
- package/dist/ui/assets/{openrouter-DuuXMYpn.js → openrouter-IR6bjwZs.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-BZGhluYu.js → openrouter-oauth-D2JDfVVh.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-D8PeRKGv.js → openrouter-oauth-r-JJqWWo.js} +1 -1
- package/dist/ui/assets/{otel-joHgpnL_.js → otel-BJT2f71U.js} +1 -1
- package/dist/ui/assets/{otel-C1NYdIbe.js → otel-DHVJhmnv.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-Bo8vrbSN.js → panel-rpc-handlers-BjQ7aZ4J.js} +2 -2
- package/dist/ui/assets/{provider-BGfZxYoy.js → provider-BIKweYVv.js} +1 -1
- package/dist/ui/assets/{provider-CE7DxoOs.js → provider-Ci-sMWNb.js} +2 -2
- package/dist/ui/assets/{provider-settings-DpKLVtWv.js → provider-settings-DMA4IYKn.js} +1 -1
- package/dist/ui/assets/{provider-settings-BlX2WDPs.js → provider-settings-onyoJBmZ.js} +1 -1
- package/dist/ui/assets/{provider-store-access-DMG7bO02.js → provider-store-access-CUma_NmZ.js} +2 -2
- package/dist/ui/assets/provider-store-access-D1zmsZC2.js +1 -0
- package/dist/ui/assets/{providers-Bf8LGL3R.js → providers-Bb9FFUf2.js} +1 -1
- package/dist/ui/assets/{providers-DtodZfUb.js → providers-DHt2mtgL.js} +2 -2
- package/dist/ui/assets/{quick-llm-CeEUNaq_.js → quick-llm-BNgArafa.js} +1 -1
- package/dist/ui/assets/{session-freezer-BWXlNuLZ.js → session-freezer-BxOqNgNy.js} +3 -3
- package/dist/ui/assets/{setup-standalone-prelude-B3IfFCKC.js → setup-standalone-prelude-BIyuLmhj.js} +2 -2
- package/dist/ui/assets/{setup-sudo-COdRfoNx.js → setup-sudo-kMkEApFT.js} +2 -2
- package/dist/ui/assets/{skills-C0KYnRNq.js → skills-Da4EzDso.js} +1 -1
- package/dist/ui/assets/{store-BkJEbwIV.js → store-F71gCibD.js} +1 -1
- package/dist/ui/assets/{sudo-C14xgLpR.js → sudo-BpkAFF9G.js} +1 -1
- package/dist/ui/assets/synthetic-cdp-transport-CtfKyiws.js +1 -0
- package/dist/ui/assets/{upgrade-detection-7iVU0rhN.js → upgrade-detection-CJ0TQg6r.js} +1 -1
- package/dist/ui/assets/{wc-extension-D51Vv0vp.js → wc-extension-OhzrnYpd.js} +2 -2
- package/dist/ui/assets/wc-floatbar-online-B6M0vf6K.js +5 -0
- package/dist/ui/assets/{wc-follower-c5fHMODp.js → wc-follower-DZUXv1tI.js} +3 -3
- package/dist/ui/assets/{wc-live-C9XjDjJF.js → wc-live-CvPOrtDy.js} +3 -3
- package/dist/ui/assets/{wc-nav-lsahpZ4D.js → wc-nav-v3ePVEaG.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-Cv35SFqQ.js → wc-onboarding-CKqWd2Kf.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-CVW34MdT.js → wc-placeholder-O8hlZSYg.js} +2 -2
- package/dist/ui/assets/{wc-settings-hY2enRpj.js → wc-settings-BYnJ8pmJ.js} +2 -2
- package/dist/ui/assets/{wc-shell-sWdEFmce.js → wc-shell-BS2MhiHQ.js} +2 -2
- package/dist/ui/assets/{wc-sprinkles-eo_EqzP6.js → wc-sprinkles-BGz-e1Ll.js} +2 -2
- package/dist/ui/assets/wc-tray-DlDL4ryR.js +2 -0
- package/dist/ui/assets/{xai-grok-QqXg9_fn.js → xai-grok-D6oOTqN5.js} +1 -1
- package/dist/ui/assets/{xai-grok-Cx13gJC8.js → xai-grok-DC9ObfPf.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/dist/ui/packages/webapp/index.html +9 -9
- package/package.json +1 -1
- package/dist/ui/assets/completionchunk-BsT4qCtf.js +0 -40
- package/dist/ui/assets/completionchunk-D8ek1SQ-.js +0 -40
- package/dist/ui/assets/provider-store-access-D5wBiefF.js +0 -1
- package/dist/ui/assets/synthetic-cdp-transport-DLIt5SkY.js +0 -1
- package/dist/ui/assets/wc-floatbar-online-0Dg_sFmu.js +0 -5
- package/dist/ui/assets/wc-tray-CIccOKgS.js +0 -2
package/dist/ui/assets/{mistral-conversations-C57IiFrP.js → mistral-conversations-CIMZoDT4.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/otel-
|
|
2
|
-
import{t as e}from"./event-stream-qbAZIAKV.js";import{n as t,t as n}from"./models-Bnh9VDA1.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{n as i}from"./json-parse-rb7sUwcH.js";import{r as a,t as o}from"./transform-messages-wECJwtH0.js";import{t as s}from"./sanitize-unicode-DmIE6hZJ.js";import{a as c}from"./constrained-sampling-DafcjXU6.js";import{t as l}from"./hash-yQufAZII.js";import{$ as u,A as d,B as f,C as p,D as m,E as h,F as g,G as _,H as v,I as y,J as b,K as x,L as S,M as ee,N as te,O as ne,P as re,Q as ie,R as C,S as ae,T as w,U as T,V as E,W as D,X as O,Y as oe,Z as se,_ as ce,a as le,b as ue,c as de,d as fe,et as pe,f as me,g as he,h as ge,i as _e,j as k,k as A,l as ve,m as ye,nt as be,o as xe,p as Se,q as j,r as Ce,rt as M,s as we,t as Te,tt as Ee,u as De,v as Oe,w as ke,x as Ae,y as je,z as Me}from"./completionchunk-BsT4qCtf.js";var Ne=Object.prototype.hasOwnProperty;function N(e,t){let n=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(r={}){return e.replace(n,function(e,n){if(!Ne.call(r,n))throw Error(`Parameter '${n}' is required`);let i=r[n];if(typeof i!=`string`&&typeof i!=`number`)throw Error(`Parameter '${n}' must be a string or number`);return t?.charEncoding===`percent`?encodeURIComponent(`${i}`):`${i}`}).replace(/^\/+/,``)}}var Pe={eu:`https://api.mistral.ai`};function Fe(e){let t=e.serverURL,n={};t||=Pe[e.server??`eu`]||``;let r=N(t)(n);return new URL(r)}var Ie={language:`typescript`,openapiDocVersion:`1.0.0`,sdkVersion:`2.2.6`,genVersion:`2.884.13`,userAgent:`speakeasy-sdk/typescript 2.2.6 2.884.13 1.0.0 @mistralai/mistralai`};async function Le(e){let t=e.getReader(),n=[],r=0,i=!1;for(;!i;){let{value:e,done:a}=await t.read();a?i=!0:(n.push(e),r+=e.length)}let a=new Uint8Array(r),o=0;for(let e of n)a.set(e,o),o+=e.length;return a.buffer}function Re(e){if(!e)return null;let t=e.toLowerCase().split(`.`).pop();return t&&{json:`application/json`,xml:`application/xml`,html:`text/html`,htm:`text/html`,txt:`text/plain`,csv:`text/csv`,pdf:`application/pdf`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,svg:`image/svg+xml`,js:`application/javascript`,css:`text/css`,zip:`application/zip`,tar:`application/x-tar`,gz:`application/gzip`,mp4:`video/mp4`,mp3:`audio/mpeg`,wav:`audio/wav`,webp:`image/webp`,ico:`image/x-icon`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`}[t]||null}function ze(e,t){return e instanceof Uint8Array?new Blob([new Uint8Array(e)],{type:t}):new Blob([e],{type:t})}var Be=(e,t)=>t==null?fetch(e):fetch(e,t),Ve=class e{options;fetcher;requestHooks=[];requestErrorHooks=[];responseHooks=[];constructor(e={}){this.options=e,this.fetcher=e.fetcher||Be}async request(e){let t=e;for(let e of this.requestHooks){let n=await e(t);n&&(t=n)}try{let e=await this.fetcher(t);for(let n of this.responseHooks)await n(e,t);return e}catch(e){for(let n of this.requestErrorHooks)await n(e,t);throw e}}addHook(...e){if(e[0]===`beforeRequest`)this.requestHooks.push(e[1]);else if(e[0]===`requestError`)this.requestErrorHooks.push(e[1]);else if(e[0]===`response`)this.responseHooks.push(e[1]);else throw Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let t;if(e[0]===`beforeRequest`)t=this.requestHooks;else if(e[0]===`requestError`)t=this.requestErrorHooks;else if(e[0]===`response`)t=this.responseHooks;else throw Error(`Invalid hook type: ${e[0]}`);let n=t.findIndex(t=>t===e[1]);return n>=0&&t.splice(n,1),this}clone(){let t=new e(this.options);return t.requestHooks=this.requestHooks.slice(),t.requestErrorHooks=this.requestErrorHooks.slice(),t.responseHooks=this.responseHooks.slice(),t}},He=/\s*;\s*/g;function Ue(e,t){if(t===`*`)return!0;let n=e.headers.get(`content-type`)?.trim()||`application/octet-stream`;n=n.toLowerCase();let[r=``,...i]=t.toLowerCase().trim().split(He);if(r.split(`/`).length!==2)return!1;let[a=``,...o]=n.split(He),[s=``,c=``]=a.split(`/`);if(!s||!c||r!==`*/*`&&a!==r&&`${s}/*`!==r&&`*/${c}`!==r||o.length<i.length)return!1;let l=new Set(o);for(let e of i)if(!l.has(e))return!1;return!0}var We=RegExp(`^[0-9]xx$`,`i`);function P(e,t){let n=`${e.status}`,r=Array.isArray(t)?t:[t];return r.length?r.some(e=>{let t=`${e}`;if(t==="default")return!0;if(!We.test(`${t}`))return t===n;let r=t.charAt(0);if(!r)throw Error(`Invalid status code range`);let i=n.charAt(0);if(!i)throw Error(`Invalid response status code: ${n}`);return i===r}):!1}function Ge(e,t,n){return P(e,t)&&Ue(e,n)}function Ke(e){if(typeof e!=`object`||!e)return!1;let t=e instanceof TypeError&&e.message.toLowerCase().startsWith(`failed to fetch`),n=e instanceof TypeError&&e.message.toLowerCase().startsWith(`fetch failed`),r=`name`in e&&e.name===`ConnectionError`,i=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnreset`;return t||n||i||r}function qe(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`TimeoutError`,n=`code`in e&&e.code===23,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}function Je(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`AbortError`,n=`code`in e&&e.code===20,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}var Ye=class{beforeRequest(e,t){let n=`mistral-client-typescript/${Ie.sdkVersion}`;return t.headers.set(`user-agent`,n),t.headers.get(`user-agent`)||t.headers.set(`x-mistral-user-agent`,n),t}},Xe=`x-model-deprecation-timestamp`,Ze=class{afterSuccess(e,t){return t.headers.has(Xe)&&t.clone().json().then(e=>{let n=e.model;console.warn(`WARNING: The model ${n} is deprecated and will be removed on ${t.headers.get(Xe)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}).catch(()=>{}),t}},Qe;async function $e(){if(Qe!==void 0)return Qe;try{Qe=await r(()=>import(`./otel-C1NYdIbe.js`),__vite__mapDeps([0,1,2]))}catch{Qe=null}return Qe}var et=`_tracingSpan`,tt=`_tracingBody`,nt=`_tracingTracer`,rt=class e extends Ve{wrappedClient;requestContexts;constructor(e,t){super(),this.wrappedClient=e,this.requestContexts=t}async request(e){let t=this.requestContexts.get(e);if(!t)return this.wrappedClient.request(e);let n=null;try{return n=await $e(),n?await n.runWithContext(t,()=>this.wrappedClient.request(e)):await this.wrappedClient.request(e)}catch(e){throw n&&await n.recordRequestError(t,e),e}finally{this.requestContexts.delete(e)}}clone(){return new e(this.wrappedClient.clone(),this.requestContexts)}},it=class{#e=new WeakMap;sdkInit(e){return{...e,client:new rt(e.client,this.#e)}}async beforeRequest(e,t){let n=e,r=await $e();if(!r)return t;let i=r.getOrCreateOtelTracer(),{request:a,span:o,body:s}=await r.getTracedRequestAndSpan(i,e.operationID,t);return n[nt]=i,n[et]=o,n[tt]=s,this.#e.set(a,r.getSpanContext(o)),a}async afterSuccess(e,t){let n=e,r=n[et],i=n[nt];if(!r||!i)return t;let a=await $e();return a?a.getTracedResponse(i,r,e.operationID,t):t}async afterError(e,t,n){let r=e[et];if(!r)return{response:t,error:n};let i=await $e();return i?i.getResponseAndError(r,t,n):{response:t,error:n}}};function at(e){let t=new Ye;e.registerBeforeRequestHook(t);let n=new Ze;e.registerAfterSuccessHook(n);let r=new it;e.registerBeforeRequestHook(r),e.registerAfterSuccessHook(r),e.registerAfterErrorHook(r),e.registerSDKInitHook(r)}var ot=class{sdkInitHooks=[];beforeCreateRequestHooks=[];beforeRequestHooks=[];afterSuccessHooks=[];afterErrorHooks=[];constructor(){for(let e of[])`sdkInit`in e&&this.registerSDKInitHook(e),`beforeCreateRequest`in e&&this.registerBeforeCreateRequestHook(e),`beforeRequest`in e&&this.registerBeforeRequestHook(e),`afterSuccess`in e&&this.registerAfterSuccessHook(e),`afterError`in e&&this.registerAfterErrorHook(e);at(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((e,t)=>t.sdkInit(e),e)}beforeCreateRequest(e,t){let n=t;for(let t of this.beforeCreateRequestHooks)n=t.beforeCreateRequest(e,n);return n}async beforeRequest(e,t){let n=t;for(let t of this.beforeRequestHooks)n=await t.beforeRequest(e,n);return n}async afterSuccess(e,t){let n=t;for(let t of this.afterSuccessHooks)n=await t.afterSuccess(e,n);return n}async afterError(e,t,n){let r=t,i=n;for(let t of this.afterErrorHooks){let n=await t.afterError(e,r,i);r=n.response,i=n.error}return{response:r,error:i}}},st=class extends Error{cause;name=`HTTPClientError`;constructor(e,t){let n=e;t?.cause&&(n+=`: ${t.cause}`),super(n,t),this.cause===void 0&&(this.cause=t?.cause)}},ct=class extends st{name=`UnexpectedClientError`},lt=class extends st{name=`InvalidRequestError`},ut=class extends st{name=`RequestAbortedError`},dt=class extends st{name=`RequestTimeoutError`},ft=class extends st{name=`ConnectionError`};function pt(e){return ie(te,e)}function mt(e){return btoa(String.fromCodePoint(...e))}function ht(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function gt(e){return new TextEncoder().encode(e)}function _t(e){return mt(gt(e))}Me(e=>e instanceof Uint8Array).or(b().transform(gt)),Me(e=>e instanceof Uint8Array).or(b().transform(ht));function vt(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var yt=class extends Error{constructor(e){super(e),this.name=`EncodingError`}};function bt(e){return(t,n,r)=>{let i=``,a=r?.explode?Ct(t,n):[[t,n]];if(a.every(([e,t])=>t==null))return;let o=e=>r?.charEncoding===`percent`?encodeURIComponent(e):e,s=e=>o(wt(e)),c=o(e);return a.forEach(([e,t])=>{let n=``,r=null;t!=null&&(r=Array.isArray(t)?Et(t,e=>`${s(e)}`)?.join(c):vt(t)?Dt(Object.entries(t),([e,t])=>`${o(e)}${c}${s(t)}`)?.join(c):`${s(t)}`,r!=null&&(n=`${o(e)}=${r}`,!(!n||n===`=`)&&(i+=`&${n}`)))}),i.slice(1)}}var xt=bt(`,`);function St(e,t,n){if(t==null)return;let r=``,i=e=>n?.charEncoding===`percent`?encodeURIComponent(e):e;if(!vt(t))throw new yt(`Expected parameter '${e}' to be an object.`);return Object.entries(t).forEach(([t,a])=>{if(a==null)return;let o=`${e}[${t}]`;if(vt(a)){let e=St(o,a,n);r+=e==null?``:`&${e}`;return}let s=Et(Array.isArray(a)?a:[a],e=>`${i(o)}=${i(wt(e))}`)?.join(`&`);r+=s==null?``:`&${s}`}),r.slice(1)}function F(e,t,n){if(t===void 0)return;let r=e=>n?.charEncoding===`percent`?encodeURIComponent(e):e,i=r(JSON.stringify(t,Tt));return n?.explode?i:`${r(e)}=${i}`}var I=(e,t,n)=>{let r=``,i=n?.explode?Ct(e,t):[[e,t]];if(i.every(([e,t])=>t==null))return;let a=e=>n?.charEncoding===`percent`?encodeURIComponent(e):e,o=e=>a(wt(e));return i.forEach(([e,i])=>{let s=``;i!=null&&(s=Array.isArray(i)?Et(i,e=>`${o(e)}`)?.join(`,`):vt(i)?Dt(Object.entries(i),([e,t])=>`,${a(e)},${o(t)}`)?.join(``).slice(1):`${n?.explode&&vt(t)?`${e}=`:``}${o(i)}`,r+=s?`,${s}`:``)}),r.slice(1)};function Ct(e,t){return Array.isArray(t)?t.map(t=>[e,t]):vt(t)?Object.entries(t??{}).map(([e,t])=>[e,t]):[[e,t]]}function wt(e){return e==null?``:e instanceof Date?e.toISOString():e instanceof Uint8Array?mt(e):typeof e==`object`?JSON.stringify(e,Tt):`${e}`}function Tt(e,t){return t instanceof Uint8Array?mt(t):t}function Et(e,t){let n=e.reduce((e,n)=>{if(n==null)return e;let r=t(n);return r==null||e.push(r),e},[]);return n.length?n:null}function Dt(e,t){let n=[];for(let[r,i]of e){if(i==null)continue;let e=t([r,i]);e!=null&&n.push(e)}return n.length?n:null}function Ot(...e){return e.filter(Boolean).join(`&`)}function kt(e){return function(t,n){let r={...n,explode:n?.explode??!0,charEncoding:n?.charEncoding??`percent`},i=new Set(n?.allowEmptyValue??[]);return Ot(...Object.entries(t).map(([t,n])=>i.has(t)&&(n==null||n===``||Array.isArray(n)&&n.length===0)?`${encodeURIComponent(t)}=`:e(t,n,r)))}}var At=kt(F),L=kt(xt);function jt(e){if(e instanceof Blob)return!0;if(typeof e!=`object`||!e||!(Symbol.toStringTag in e))return!1;let t=e[Symbol.toStringTag];return t!==`Blob`&&t!==`File`?!1:`stream`in e&&typeof e.stream==`function`}function Mt(e,t,n,r){n!=null&&(jt(n)?r?e.append(t,n,r):e.append(t,n):Array.isArray(n)?n.forEach(n=>{Mt(e,t,n)}):e.append(t,String(n)))}async function Nt(e){return e instanceof Blob?e:new Blob([await e.arrayBuffer()],{type:e.type})}function Pt(e,t,n,r,i){for(t=Array.isArray(t)?t:t.split(`.`),r=0;r<t.length;r++){let n=t[r];e=n!=null&&e?e[n]:i}return e===i?n:e}var Ft=x({MISTRAL_API_KEY:b().optional(),MISTRAL_DEBUG:pt().optional()});function It(){return`Deno`in globalThis}var Lt=void 0;function Rt(){if(Lt)return Lt;let e={};return e=It()?globalThis.Deno?.env?.toObject?.()??{}:Pt(globalThis,`process.env`)??{},Lt=Ft.parse(e),Lt}var zt={initialInterval:500,maxInterval:6e4,exponent:1.5,maxElapsedTime:36e5},Bt=class e extends Error{cause;constructor(t,n){let r=t;n?.cause&&(r+=`: ${n.cause}`),super(r,n),this.name=`PermanentError`,this.cause===void 0&&(this.cause=n?.cause),Object.setPrototypeOf(this,e.prototype)}},Vt=class e extends Error{response;constructor(t,n){super(t),this.response=n,this.name=`TemporaryError`,Object.setPrototypeOf(this,e.prototype)}};async function Ht(e,t){switch(t.config.strategy){case`backoff`:return Kt(Ut(e,{statusCodes:t.statusCodes,retryConnectionErrors:!!t.config.retryConnectionErrors}),t.config.backoff??zt);default:return await e()}}function Ut(e,t){return async()=>{try{let n=await e();if(Gt(n,t.statusCodes))throw new Vt(`Response failed with retryable status code`,n);return n}catch(e){throw e instanceof Vt||t.retryConnectionErrors&&(qe(e)||Ke(e))?e:new Bt(`Permanent error`,{cause:e})}}}var Wt=RegExp(`^[0-9]xx$`,`i`);function Gt(e,t){let n=`${e.status}`;return t.some(e=>{if(!Wt.test(e))return e===n;let t=e.charAt(0);if(!t)throw Error(`Invalid status code range`);let r=n.charAt(0);if(!r)throw Error(`Invalid response status code: ${n}`);return r===t})}async function Kt(e,t){let{maxElapsedTime:n,initialInterval:r,exponent:i,maxInterval:a}=t,o=Date.now(),s=0;for(;;)try{return await e()}catch(e){if(e instanceof Bt)throw e.cause;if(Date.now()-o>n){if(e instanceof Vt)return e.response;throw e}let t=0;e instanceof Vt&&(t=qt(e.response)),t<=0&&(t=r*s**+i+Math.random()*1e3),await Jt(Math.min(t,a)),s++}}function qt(e){let t=e.headers.get(`retry-after`)||``;if(!t)return 0;let n=Number(t);if(Number.isInteger(n))return n*1e3;let r=Date.parse(t);if(Number.isInteger(r)){let e=r-Date.now();return e>0?Math.ceil(e):0}return 0}async function Jt(e){return new Promise(t=>setTimeout(t,e))}var Yt=typeof globalThis>`u`?null:globalThis,Xt=typeof Yt==`object`&&!!Yt&&`importScripts`in Yt&&typeof Yt.importScripts==`function`||typeof navigator<`u`&&`serviceWorker`in navigator||typeof window==`object`&&window.document!==void 0,R=class{#e;#t;#n;_baseURL;_options;constructor(e={}){let t=e;typeof t==`object`&&t&&`hooks`in t&&t.hooks instanceof ot?this.#t=t.hooks:this.#t=new ot;let n=Fe(e);n&&(n.pathname=n.pathname.replace(/\/+$/,``)+`/`);let{baseURL:r,client:i}=this.#t.sdkInit({baseURL:n,client:e.httpClient||new Ve});this._baseURL=r,this.#e=i,this._options={...e,hooks:this.#t},this.#n=this._options.debugLogger,!this.#n&&Rt().MISTRAL_DEBUG&&(this.#n=console)}_createRequest(e,t,n){let{method:r,path:i,query:a,headers:o,security:s}=t,c=t.baseURL??this._baseURL;if(!c)return Ee(new lt(`No base URL provided for operation`));let l=new URL(c),u;i?(l.pathname=l.pathname.replace(/\/+$/,``)+`/`,u=new URL(i,l)):u=l,u.hash=``;let d=a||``,f=[];for(let[e,t]of Object.entries(s?.queryParams||{})){let n=xt(e,t,{charEncoding:`percent`});n!==void 0&&f.push(n)}if(f.length&&(d+=`&${f.join(`&`)}`),d){let e=d.startsWith(`&`)?d.slice(1):d;u.search=`?${e}`}let p=new Headers(o),m=s?.basic.username,h=s?.basic.password;if(m!=null||h!=null){let e=_t([m||``,h||``].join(`:`));p.set(`Authorization`,`Basic ${e}`)}let g=new Headers(s?.headers||{});for(let[e,t]of g)p.set(e,t);let _=p.get(`cookie`)||``;for(let[e,t]of Object.entries(s?.cookies||{}))_+=`; ${e}=${t}`;_=_.startsWith(`; `)?_.slice(2):_,p.set(`cookie`,_);let v=new Headers(n?.headers??n?.fetchOptions?.headers);for(let[e,t]of v)p.set(e,t);Xt||p.set(t.uaHeader??`user-agent`,t.userAgent??Ie.userAgent);let y={...n?.fetchOptions,...n};!y?.signal&&t.timeoutMs&&t.timeoutMs>0&&(y.signal=AbortSignal.timeout(t.timeoutMs)),t.body instanceof ReadableStream&&Object.assign(y,{duplex:`half`});let b;try{b=this.#t.beforeCreateRequest(e,{url:u,options:{...y,body:t.body??null,headers:p,method:r}})}catch(e){return Ee(new ct(`Create request hook failed to execute`,{cause:e}))}return be(new Request(b.url,b.options))}async _do(e,t){let{context:n,isErrorStatusCode:r}=t;return Ht(async()=>{let t=await this.#t.beforeRequest(n,e.clone());await $t(this.#n,t).catch(e=>this.#n?.log(`Failed to log request:`,e));let i=await this.#e.request(t);try{if(r(i.status)){let e=await this.#t.afterError(n,i,null);if(e.error)throw e.error;i=e.response||i}else i=await this.#t.afterSuccess(n,i)}finally{await en(this.#n,i,t).catch(e=>this.#n?.log(`Failed to log response:`,e))}return i},{config:t.retryConfig,statusCodes:t.retryCodes}).then(e=>be(e),e=>{switch(!0){case Je(e):return Ee(new ut(`Request aborted by client`,{cause:e}));case qe(e):return Ee(new dt(`Request timed out`,{cause:e}));case Ke(e):return Ee(new ft(`Unable to make request`,{cause:e}));default:return Ee(new ct(`Unexpected HTTP client error`,{cause:e}))}})}},Zt=/^(application|text)\/([^+]+\+)*json.*/,Qt=/^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;async function $t(e,t){if(!e)return;let n=t.headers.get(`content-type`),r=n?.split(`;`)[0]||``;e.group(`> Request: ${t.method} ${t.url}`),e.group(`Headers:`);for(let[n,r]of t.headers.entries())e.log(`${n}: ${r}`);switch(e.groupEnd(),e.group(`Body:`),!0){case Zt.test(r):e.log(await t.clone().json());break;case r.startsWith(`text/`):e.log(await t.clone().text());break;case r===`multipart/form-data`:{let n=await t.clone().formData();for(let[t,r]of n){let n=r instanceof Blob?`<Blob>`:r;e.log(`${t}: ${n}`)}break}default:e.log(`<${n}>`);break}e.groupEnd(),e.groupEnd()}async function en(e,t,n){if(!e)return;let r=t.headers.get(`content-type`),i=r?.split(`;`)[0]||``;e.group(`< Response: ${n.method} ${n.url}`),e.log(`Status Code:`,t.status,t.statusText),e.group(`Headers:`);for(let[n,r]of t.headers.entries())e.log(`${n}: ${r}`);switch(e.groupEnd(),e.group(`Body:`),!0){case Ue(t,`application/json`)||Zt.test(i)&&!Qt.test(i):e.log(await t.clone().json());break;case Ue(t,`application/jsonl`)||Qt.test(i):case Ue(t,`text/event-stream`):e.log(`<${r}>`);break;case Ue(t,`text/*`):e.log(await t.clone().text());break;case Ue(t,`multipart/form-data`):{let n=await t.clone().formData();for(let[t,r]of n){let n=r instanceof Blob?`<Blob>`:r;e.log(`${t}: ${n}`)}break}default:e.log(`<${r}>`);break}e.groupEnd(),e.groupEnd()}var tn=class extends Error{statusCode;body;headers;contentType;rawResponse;constructor(e,t){super(e),this.statusCode=t.response.status,this.body=t.body,this.headers=t.response.headers,this.contentType=t.response.headers.get(`content-type`)||``,this.rawResponse=t.response,this.name=`MistralError`}},nn=class extends tn{rawValue;rawMessage;constructor(e,t){super(e,t),this.name=`ResponseValidationError`,this.cause=t.cause,this.rawValue=t.rawValue,this.rawMessage=t.rawMessage}pretty(){return this.cause instanceof u?`${this.rawMessage}\n${ee(this.cause)}`:this.toString()}},rn=class extends tn{constructor(e,t){e&&(e+=`: `),e+=`Status ${t.response.status}`;let n=t.response.headers.get(`content-type`)||`""`;n!==`application/json`&&(e+=` Content-Type ${n.includes(` `)?`"${n}"`:n}`);let r=t.body||`""`;e+=r.length>100?`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/otel-DHVJhmnv.js","assets/rolldown-runtime-aKtaBQYM.js","assets/completionchunk-JDMithrI.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./event-stream-qbAZIAKV.js";import{n as t,t as n}from"./models-Bnh9VDA1.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{n as i}from"./json-parse-rb7sUwcH.js";import{r as a,t as o}from"./transform-messages-wECJwtH0.js";import{t as s}from"./sanitize-unicode-DmIE6hZJ.js";import{a as c}from"./constrained-sampling-DafcjXU6.js";import{t as l}from"./hash-yQufAZII.js";import{$ as u,A as d,B as f,C as p,D as m,E as h,F as g,G as _,H as v,I as y,J as b,K as x,L as S,M as ee,N as te,O as ne,P as re,Q as ie,R as C,S as ae,T as w,U as T,V as E,W as D,X as O,Y as oe,Z as se,_ as ce,a as le,b as ue,c as de,d as fe,et as pe,f as me,g as he,h as ge,i as _e,j as k,k as A,l as ve,m as ye,nt as be,o as xe,p as Se,q as j,r as Ce,rt as M,s as we,t as Te,tt as Ee,u as De,v as Oe,w as ke,x as Ae,y as je,z as Me}from"./completionchunk-JDMithrI.js";var Ne=Object.prototype.hasOwnProperty;function N(e,t){let n=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(r={}){return e.replace(n,function(e,n){if(!Ne.call(r,n))throw Error(`Parameter '${n}' is required`);let i=r[n];if(typeof i!=`string`&&typeof i!=`number`)throw Error(`Parameter '${n}' must be a string or number`);return t?.charEncoding===`percent`?encodeURIComponent(`${i}`):`${i}`}).replace(/^\/+/,``)}}var Pe={eu:`https://api.mistral.ai`};function Fe(e){let t=e.serverURL,n={};t||=Pe[e.server??`eu`]||``;let r=N(t)(n);return new URL(r)}var Ie={language:`typescript`,openapiDocVersion:`1.0.0`,sdkVersion:`2.2.6`,genVersion:`2.884.13`,userAgent:`speakeasy-sdk/typescript 2.2.6 2.884.13 1.0.0 @mistralai/mistralai`};async function Le(e){let t=e.getReader(),n=[],r=0,i=!1;for(;!i;){let{value:e,done:a}=await t.read();a?i=!0:(n.push(e),r+=e.length)}let a=new Uint8Array(r),o=0;for(let e of n)a.set(e,o),o+=e.length;return a.buffer}function Re(e){if(!e)return null;let t=e.toLowerCase().split(`.`).pop();return t&&{json:`application/json`,xml:`application/xml`,html:`text/html`,htm:`text/html`,txt:`text/plain`,csv:`text/csv`,pdf:`application/pdf`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,svg:`image/svg+xml`,js:`application/javascript`,css:`text/css`,zip:`application/zip`,tar:`application/x-tar`,gz:`application/gzip`,mp4:`video/mp4`,mp3:`audio/mpeg`,wav:`audio/wav`,webp:`image/webp`,ico:`image/x-icon`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`}[t]||null}function ze(e,t){return e instanceof Uint8Array?new Blob([new Uint8Array(e)],{type:t}):new Blob([e],{type:t})}var Be=(e,t)=>t==null?fetch(e):fetch(e,t),Ve=class e{options;fetcher;requestHooks=[];requestErrorHooks=[];responseHooks=[];constructor(e={}){this.options=e,this.fetcher=e.fetcher||Be}async request(e){let t=e;for(let e of this.requestHooks){let n=await e(t);n&&(t=n)}try{let e=await this.fetcher(t);for(let n of this.responseHooks)await n(e,t);return e}catch(e){for(let n of this.requestErrorHooks)await n(e,t);throw e}}addHook(...e){if(e[0]===`beforeRequest`)this.requestHooks.push(e[1]);else if(e[0]===`requestError`)this.requestErrorHooks.push(e[1]);else if(e[0]===`response`)this.responseHooks.push(e[1]);else throw Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let t;if(e[0]===`beforeRequest`)t=this.requestHooks;else if(e[0]===`requestError`)t=this.requestErrorHooks;else if(e[0]===`response`)t=this.responseHooks;else throw Error(`Invalid hook type: ${e[0]}`);let n=t.findIndex(t=>t===e[1]);return n>=0&&t.splice(n,1),this}clone(){let t=new e(this.options);return t.requestHooks=this.requestHooks.slice(),t.requestErrorHooks=this.requestErrorHooks.slice(),t.responseHooks=this.responseHooks.slice(),t}},He=/\s*;\s*/g;function Ue(e,t){if(t===`*`)return!0;let n=e.headers.get(`content-type`)?.trim()||`application/octet-stream`;n=n.toLowerCase();let[r=``,...i]=t.toLowerCase().trim().split(He);if(r.split(`/`).length!==2)return!1;let[a=``,...o]=n.split(He),[s=``,c=``]=a.split(`/`);if(!s||!c||r!==`*/*`&&a!==r&&`${s}/*`!==r&&`*/${c}`!==r||o.length<i.length)return!1;let l=new Set(o);for(let e of i)if(!l.has(e))return!1;return!0}var We=RegExp(`^[0-9]xx$`,`i`);function P(e,t){let n=`${e.status}`,r=Array.isArray(t)?t:[t];return r.length?r.some(e=>{let t=`${e}`;if(t==="default")return!0;if(!We.test(`${t}`))return t===n;let r=t.charAt(0);if(!r)throw Error(`Invalid status code range`);let i=n.charAt(0);if(!i)throw Error(`Invalid response status code: ${n}`);return i===r}):!1}function Ge(e,t,n){return P(e,t)&&Ue(e,n)}function Ke(e){if(typeof e!=`object`||!e)return!1;let t=e instanceof TypeError&&e.message.toLowerCase().startsWith(`failed to fetch`),n=e instanceof TypeError&&e.message.toLowerCase().startsWith(`fetch failed`),r=`name`in e&&e.name===`ConnectionError`,i=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnreset`;return t||n||i||r}function qe(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`TimeoutError`,n=`code`in e&&e.code===23,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}function Je(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`AbortError`,n=`code`in e&&e.code===20,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}var Ye=class{beforeRequest(e,t){let n=`mistral-client-typescript/${Ie.sdkVersion}`;return t.headers.set(`user-agent`,n),t.headers.get(`user-agent`)||t.headers.set(`x-mistral-user-agent`,n),t}},Xe=`x-model-deprecation-timestamp`,Ze=class{afterSuccess(e,t){return t.headers.has(Xe)&&t.clone().json().then(e=>{let n=e.model;console.warn(`WARNING: The model ${n} is deprecated and will be removed on ${t.headers.get(Xe)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}).catch(()=>{}),t}},Qe;async function $e(){if(Qe!==void 0)return Qe;try{Qe=await r(()=>import(`./otel-DHVJhmnv.js`),__vite__mapDeps([0,1,2]))}catch{Qe=null}return Qe}var et=`_tracingSpan`,tt=`_tracingBody`,nt=`_tracingTracer`,rt=class e extends Ve{wrappedClient;requestContexts;constructor(e,t){super(),this.wrappedClient=e,this.requestContexts=t}async request(e){let t=this.requestContexts.get(e);if(!t)return this.wrappedClient.request(e);let n=null;try{return n=await $e(),n?await n.runWithContext(t,()=>this.wrappedClient.request(e)):await this.wrappedClient.request(e)}catch(e){throw n&&await n.recordRequestError(t,e),e}finally{this.requestContexts.delete(e)}}clone(){return new e(this.wrappedClient.clone(),this.requestContexts)}},it=class{#e=new WeakMap;sdkInit(e){return{...e,client:new rt(e.client,this.#e)}}async beforeRequest(e,t){let n=e,r=await $e();if(!r)return t;let i=r.getOrCreateOtelTracer(),{request:a,span:o,body:s}=await r.getTracedRequestAndSpan(i,e.operationID,t);return n[nt]=i,n[et]=o,n[tt]=s,this.#e.set(a,r.getSpanContext(o)),a}async afterSuccess(e,t){let n=e,r=n[et],i=n[nt];if(!r||!i)return t;let a=await $e();return a?a.getTracedResponse(i,r,e.operationID,t):t}async afterError(e,t,n){let r=e[et];if(!r)return{response:t,error:n};let i=await $e();return i?i.getResponseAndError(r,t,n):{response:t,error:n}}};function at(e){let t=new Ye;e.registerBeforeRequestHook(t);let n=new Ze;e.registerAfterSuccessHook(n);let r=new it;e.registerBeforeRequestHook(r),e.registerAfterSuccessHook(r),e.registerAfterErrorHook(r),e.registerSDKInitHook(r)}var ot=class{sdkInitHooks=[];beforeCreateRequestHooks=[];beforeRequestHooks=[];afterSuccessHooks=[];afterErrorHooks=[];constructor(){for(let e of[])`sdkInit`in e&&this.registerSDKInitHook(e),`beforeCreateRequest`in e&&this.registerBeforeCreateRequestHook(e),`beforeRequest`in e&&this.registerBeforeRequestHook(e),`afterSuccess`in e&&this.registerAfterSuccessHook(e),`afterError`in e&&this.registerAfterErrorHook(e);at(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((e,t)=>t.sdkInit(e),e)}beforeCreateRequest(e,t){let n=t;for(let t of this.beforeCreateRequestHooks)n=t.beforeCreateRequest(e,n);return n}async beforeRequest(e,t){let n=t;for(let t of this.beforeRequestHooks)n=await t.beforeRequest(e,n);return n}async afterSuccess(e,t){let n=t;for(let t of this.afterSuccessHooks)n=await t.afterSuccess(e,n);return n}async afterError(e,t,n){let r=t,i=n;for(let t of this.afterErrorHooks){let n=await t.afterError(e,r,i);r=n.response,i=n.error}return{response:r,error:i}}},st=class extends Error{cause;name=`HTTPClientError`;constructor(e,t){let n=e;t?.cause&&(n+=`: ${t.cause}`),super(n,t),this.cause===void 0&&(this.cause=t?.cause)}},ct=class extends st{name=`UnexpectedClientError`},lt=class extends st{name=`InvalidRequestError`},ut=class extends st{name=`RequestAbortedError`},dt=class extends st{name=`RequestTimeoutError`},ft=class extends st{name=`ConnectionError`};function pt(e){return ie(te,e)}function mt(e){return btoa(String.fromCodePoint(...e))}function ht(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function gt(e){return new TextEncoder().encode(e)}function _t(e){return mt(gt(e))}Me(e=>e instanceof Uint8Array).or(b().transform(gt)),Me(e=>e instanceof Uint8Array).or(b().transform(ht));function vt(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var yt=class extends Error{constructor(e){super(e),this.name=`EncodingError`}};function bt(e){return(t,n,r)=>{let i=``,a=r?.explode?Ct(t,n):[[t,n]];if(a.every(([e,t])=>t==null))return;let o=e=>r?.charEncoding===`percent`?encodeURIComponent(e):e,s=e=>o(wt(e)),c=o(e);return a.forEach(([e,t])=>{let n=``,r=null;t!=null&&(r=Array.isArray(t)?Et(t,e=>`${s(e)}`)?.join(c):vt(t)?Dt(Object.entries(t),([e,t])=>`${o(e)}${c}${s(t)}`)?.join(c):`${s(t)}`,r!=null&&(n=`${o(e)}=${r}`,!(!n||n===`=`)&&(i+=`&${n}`)))}),i.slice(1)}}var xt=bt(`,`);function St(e,t,n){if(t==null)return;let r=``,i=e=>n?.charEncoding===`percent`?encodeURIComponent(e):e;if(!vt(t))throw new yt(`Expected parameter '${e}' to be an object.`);return Object.entries(t).forEach(([t,a])=>{if(a==null)return;let o=`${e}[${t}]`;if(vt(a)){let e=St(o,a,n);r+=e==null?``:`&${e}`;return}let s=Et(Array.isArray(a)?a:[a],e=>`${i(o)}=${i(wt(e))}`)?.join(`&`);r+=s==null?``:`&${s}`}),r.slice(1)}function F(e,t,n){if(t===void 0)return;let r=e=>n?.charEncoding===`percent`?encodeURIComponent(e):e,i=r(JSON.stringify(t,Tt));return n?.explode?i:`${r(e)}=${i}`}var I=(e,t,n)=>{let r=``,i=n?.explode?Ct(e,t):[[e,t]];if(i.every(([e,t])=>t==null))return;let a=e=>n?.charEncoding===`percent`?encodeURIComponent(e):e,o=e=>a(wt(e));return i.forEach(([e,i])=>{let s=``;i!=null&&(s=Array.isArray(i)?Et(i,e=>`${o(e)}`)?.join(`,`):vt(i)?Dt(Object.entries(i),([e,t])=>`,${a(e)},${o(t)}`)?.join(``).slice(1):`${n?.explode&&vt(t)?`${e}=`:``}${o(i)}`,r+=s?`,${s}`:``)}),r.slice(1)};function Ct(e,t){return Array.isArray(t)?t.map(t=>[e,t]):vt(t)?Object.entries(t??{}).map(([e,t])=>[e,t]):[[e,t]]}function wt(e){return e==null?``:e instanceof Date?e.toISOString():e instanceof Uint8Array?mt(e):typeof e==`object`?JSON.stringify(e,Tt):`${e}`}function Tt(e,t){return t instanceof Uint8Array?mt(t):t}function Et(e,t){let n=e.reduce((e,n)=>{if(n==null)return e;let r=t(n);return r==null||e.push(r),e},[]);return n.length?n:null}function Dt(e,t){let n=[];for(let[r,i]of e){if(i==null)continue;let e=t([r,i]);e!=null&&n.push(e)}return n.length?n:null}function Ot(...e){return e.filter(Boolean).join(`&`)}function kt(e){return function(t,n){let r={...n,explode:n?.explode??!0,charEncoding:n?.charEncoding??`percent`},i=new Set(n?.allowEmptyValue??[]);return Ot(...Object.entries(t).map(([t,n])=>i.has(t)&&(n==null||n===``||Array.isArray(n)&&n.length===0)?`${encodeURIComponent(t)}=`:e(t,n,r)))}}var At=kt(F),L=kt(xt);function jt(e){if(e instanceof Blob)return!0;if(typeof e!=`object`||!e||!(Symbol.toStringTag in e))return!1;let t=e[Symbol.toStringTag];return t!==`Blob`&&t!==`File`?!1:`stream`in e&&typeof e.stream==`function`}function Mt(e,t,n,r){n!=null&&(jt(n)?r?e.append(t,n,r):e.append(t,n):Array.isArray(n)?n.forEach(n=>{Mt(e,t,n)}):e.append(t,String(n)))}async function Nt(e){return e instanceof Blob?e:new Blob([await e.arrayBuffer()],{type:e.type})}function Pt(e,t,n,r,i){for(t=Array.isArray(t)?t:t.split(`.`),r=0;r<t.length;r++){let n=t[r];e=n!=null&&e?e[n]:i}return e===i?n:e}var Ft=x({MISTRAL_API_KEY:b().optional(),MISTRAL_DEBUG:pt().optional()});function It(){return`Deno`in globalThis}var Lt=void 0;function Rt(){if(Lt)return Lt;let e={};return e=It()?globalThis.Deno?.env?.toObject?.()??{}:Pt(globalThis,`process.env`)??{},Lt=Ft.parse(e),Lt}var zt={initialInterval:500,maxInterval:6e4,exponent:1.5,maxElapsedTime:36e5},Bt=class e extends Error{cause;constructor(t,n){let r=t;n?.cause&&(r+=`: ${n.cause}`),super(r,n),this.name=`PermanentError`,this.cause===void 0&&(this.cause=n?.cause),Object.setPrototypeOf(this,e.prototype)}},Vt=class e extends Error{response;constructor(t,n){super(t),this.response=n,this.name=`TemporaryError`,Object.setPrototypeOf(this,e.prototype)}};async function Ht(e,t){switch(t.config.strategy){case`backoff`:return Kt(Ut(e,{statusCodes:t.statusCodes,retryConnectionErrors:!!t.config.retryConnectionErrors}),t.config.backoff??zt);default:return await e()}}function Ut(e,t){return async()=>{try{let n=await e();if(Gt(n,t.statusCodes))throw new Vt(`Response failed with retryable status code`,n);return n}catch(e){throw e instanceof Vt||t.retryConnectionErrors&&(qe(e)||Ke(e))?e:new Bt(`Permanent error`,{cause:e})}}}var Wt=RegExp(`^[0-9]xx$`,`i`);function Gt(e,t){let n=`${e.status}`;return t.some(e=>{if(!Wt.test(e))return e===n;let t=e.charAt(0);if(!t)throw Error(`Invalid status code range`);let r=n.charAt(0);if(!r)throw Error(`Invalid response status code: ${n}`);return r===t})}async function Kt(e,t){let{maxElapsedTime:n,initialInterval:r,exponent:i,maxInterval:a}=t,o=Date.now(),s=0;for(;;)try{return await e()}catch(e){if(e instanceof Bt)throw e.cause;if(Date.now()-o>n){if(e instanceof Vt)return e.response;throw e}let t=0;e instanceof Vt&&(t=qt(e.response)),t<=0&&(t=r*s**+i+Math.random()*1e3),await Jt(Math.min(t,a)),s++}}function qt(e){let t=e.headers.get(`retry-after`)||``;if(!t)return 0;let n=Number(t);if(Number.isInteger(n))return n*1e3;let r=Date.parse(t);if(Number.isInteger(r)){let e=r-Date.now();return e>0?Math.ceil(e):0}return 0}async function Jt(e){return new Promise(t=>setTimeout(t,e))}var Yt=typeof globalThis>`u`?null:globalThis,Xt=typeof Yt==`object`&&!!Yt&&`importScripts`in Yt&&typeof Yt.importScripts==`function`||typeof navigator<`u`&&`serviceWorker`in navigator||typeof window==`object`&&window.document!==void 0,R=class{#e;#t;#n;_baseURL;_options;constructor(e={}){let t=e;typeof t==`object`&&t&&`hooks`in t&&t.hooks instanceof ot?this.#t=t.hooks:this.#t=new ot;let n=Fe(e);n&&(n.pathname=n.pathname.replace(/\/+$/,``)+`/`);let{baseURL:r,client:i}=this.#t.sdkInit({baseURL:n,client:e.httpClient||new Ve});this._baseURL=r,this.#e=i,this._options={...e,hooks:this.#t},this.#n=this._options.debugLogger,!this.#n&&Rt().MISTRAL_DEBUG&&(this.#n=console)}_createRequest(e,t,n){let{method:r,path:i,query:a,headers:o,security:s}=t,c=t.baseURL??this._baseURL;if(!c)return Ee(new lt(`No base URL provided for operation`));let l=new URL(c),u;i?(l.pathname=l.pathname.replace(/\/+$/,``)+`/`,u=new URL(i,l)):u=l,u.hash=``;let d=a||``,f=[];for(let[e,t]of Object.entries(s?.queryParams||{})){let n=xt(e,t,{charEncoding:`percent`});n!==void 0&&f.push(n)}if(f.length&&(d+=`&${f.join(`&`)}`),d){let e=d.startsWith(`&`)?d.slice(1):d;u.search=`?${e}`}let p=new Headers(o),m=s?.basic.username,h=s?.basic.password;if(m!=null||h!=null){let e=_t([m||``,h||``].join(`:`));p.set(`Authorization`,`Basic ${e}`)}let g=new Headers(s?.headers||{});for(let[e,t]of g)p.set(e,t);let _=p.get(`cookie`)||``;for(let[e,t]of Object.entries(s?.cookies||{}))_+=`; ${e}=${t}`;_=_.startsWith(`; `)?_.slice(2):_,p.set(`cookie`,_);let v=new Headers(n?.headers??n?.fetchOptions?.headers);for(let[e,t]of v)p.set(e,t);Xt||p.set(t.uaHeader??`user-agent`,t.userAgent??Ie.userAgent);let y={...n?.fetchOptions,...n};!y?.signal&&t.timeoutMs&&t.timeoutMs>0&&(y.signal=AbortSignal.timeout(t.timeoutMs)),t.body instanceof ReadableStream&&Object.assign(y,{duplex:`half`});let b;try{b=this.#t.beforeCreateRequest(e,{url:u,options:{...y,body:t.body??null,headers:p,method:r}})}catch(e){return Ee(new ct(`Create request hook failed to execute`,{cause:e}))}return be(new Request(b.url,b.options))}async _do(e,t){let{context:n,isErrorStatusCode:r}=t;return Ht(async()=>{let t=await this.#t.beforeRequest(n,e.clone());await $t(this.#n,t).catch(e=>this.#n?.log(`Failed to log request:`,e));let i=await this.#e.request(t);try{if(r(i.status)){let e=await this.#t.afterError(n,i,null);if(e.error)throw e.error;i=e.response||i}else i=await this.#t.afterSuccess(n,i)}finally{await en(this.#n,i,t).catch(e=>this.#n?.log(`Failed to log response:`,e))}return i},{config:t.retryConfig,statusCodes:t.retryCodes}).then(e=>be(e),e=>{switch(!0){case Je(e):return Ee(new ut(`Request aborted by client`,{cause:e}));case qe(e):return Ee(new dt(`Request timed out`,{cause:e}));case Ke(e):return Ee(new ft(`Unable to make request`,{cause:e}));default:return Ee(new ct(`Unexpected HTTP client error`,{cause:e}))}})}},Zt=/^(application|text)\/([^+]+\+)*json.*/,Qt=/^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;async function $t(e,t){if(!e)return;let n=t.headers.get(`content-type`),r=n?.split(`;`)[0]||``;e.group(`> Request: ${t.method} ${t.url}`),e.group(`Headers:`);for(let[n,r]of t.headers.entries())e.log(`${n}: ${r}`);switch(e.groupEnd(),e.group(`Body:`),!0){case Zt.test(r):e.log(await t.clone().json());break;case r.startsWith(`text/`):e.log(await t.clone().text());break;case r===`multipart/form-data`:{let n=await t.clone().formData();for(let[t,r]of n){let n=r instanceof Blob?`<Blob>`:r;e.log(`${t}: ${n}`)}break}default:e.log(`<${n}>`);break}e.groupEnd(),e.groupEnd()}async function en(e,t,n){if(!e)return;let r=t.headers.get(`content-type`),i=r?.split(`;`)[0]||``;e.group(`< Response: ${n.method} ${n.url}`),e.log(`Status Code:`,t.status,t.statusText),e.group(`Headers:`);for(let[n,r]of t.headers.entries())e.log(`${n}: ${r}`);switch(e.groupEnd(),e.group(`Body:`),!0){case Ue(t,`application/json`)||Zt.test(i)&&!Qt.test(i):e.log(await t.clone().json());break;case Ue(t,`application/jsonl`)||Qt.test(i):case Ue(t,`text/event-stream`):e.log(`<${r}>`);break;case Ue(t,`text/*`):e.log(await t.clone().text());break;case Ue(t,`multipart/form-data`):{let n=await t.clone().formData();for(let[t,r]of n){let n=r instanceof Blob?`<Blob>`:r;e.log(`${t}: ${n}`)}break}default:e.log(`<${r}>`);break}e.groupEnd(),e.groupEnd()}var tn=class extends Error{statusCode;body;headers;contentType;rawResponse;constructor(e,t){super(e),this.statusCode=t.response.status,this.body=t.body,this.headers=t.response.headers,this.contentType=t.response.headers.get(`content-type`)||``,this.rawResponse=t.response,this.name=`MistralError`}},nn=class extends tn{rawValue;rawMessage;constructor(e,t){super(e,t),this.name=`ResponseValidationError`,this.cause=t.cause,this.rawValue=t.rawValue,this.rawMessage=t.rawMessage}pretty(){return this.cause instanceof u?`${this.rawMessage}\n${ee(this.cause)}`:this.toString()}},rn=class extends tn{constructor(e,t){e&&(e+=`: `),e+=`Status ${t.response.status}`;let n=t.response.headers.get(`content-type`)||`""`;n!==`application/json`&&(e+=` Content-Type ${n.includes(` `)?`"${n}"`:n}`);let r=t.body||`""`;e+=r.length>100?`
|
|
3
3
|
`:`. `;let i=r;r.length>1e4&&(i=`${r.substring(0,1e4)}...and ${r.length-1e4} more chars`),e+=`Body: ${i}`,e=e.trim(),super(e,t),this.name=`SDKError`}},an={jsonl:`application/jsonl`,json:`application/json`,text:`text/plain`,bytes:`application/octet-stream`,stream:`application/octet-stream`,sse:`text/event-stream`,nil:`*`,fail:`*`};function z(e,t,n){return{...n,err:!0,enc:`json`,codes:e,schema:t}}function B(e,t,n){return{...n,enc:`json`,codes:e,schema:t}}function on(e,t,n){return{...n,enc:`stream`,codes:e,schema:t}}function sn(e,t,n){return{...n,enc:`sse`,codes:e,schema:t}}function cn(e,t,n){return{...n,enc:`nil`,codes:e,schema:t}}function V(e){return{enc:`fail`,codes:e}}function H(...e){return async function(t,n,r){let i,a;for(let n of e){let{codes:e}=n,r=`ctype`in n?n.ctype:an[n.enc];if(r&&Ge(t,e,r)){a=n;break}else if(!r&&P(t,e)){a=n;break}}if(!a)return[{ok:!1,error:new rn(`Unexpected Status or Content-Type`,{response:t,request:n,body:await t.text().catch(()=>``)})},i];let o=a.enc,s=``;switch(o){case`json`:s=await t.text(),i=JSON.parse(s);break;case`jsonl`:i=t.body;break;case`bytes`:i=new Uint8Array(await t.arrayBuffer());break;case`stream`:i=t.body;break;case`text`:s=await t.text(),i=s;break;case`sse`:i=t.body;break;case`nil`:s=await t.text(),i=void 0;break;case`fail`:s=await t.text(),i=s;break;default:throw Error(`Unsupported response type: ${o}`)}if(a.enc===`fail`)return[{ok:!1,error:new rn(`API error occurred`,{request:n,response:t,body:s})},i];let c=a.key||r?.resultKey,l;if(l=`err`in a?{...r?.extraFields,...a.hdrs?{Headers:un(t.headers)}:null,...vt(i)?i:null,request$:n,response$:t,body$:s}:c?{...r?.extraFields,...a.hdrs?{Headers:un(t.headers)}:null,[c]:i}:a.hdrs?{...r?.extraFields,...a.hdrs?{Headers:un(t.headers)}:null,...vt(i)?i:null}:i,`err`in a){let e=dn(l,e=>a.schema.parse(e),`Response validation failed`,{request:n,response:t,body:s});return[e.ok?{ok:!1,error:e.value}:e,i]}else return[dn(l,e=>a.schema.parse(e),`Response validation failed`,{request:n,response:t,body:s}),i]}}var ln=/, */;function un(e){let t={};for(let[n,r]of e.entries())t[n]=r.split(ln);return t}function dn(e,t,n,r){try{return be(t(e))}catch(t){return Ee(new nn(n,{cause:t,rawValue:e,rawMessage:n,...r}))}}var fn;(function(e){e.Incomplete=`incomplete`,e.UnrecognisedSecurityType=`unrecognized_security_type`})(fn||={});var pn=class e extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`SecurityError`}static incomplete(){return new e(fn.Incomplete,`Security requirements not met in order to perform the operation`)}static unrecognizedType(t){return new e(fn.UnrecognisedSecurityType,`Unrecognised security type: ${t}`)}};function mn(...e){let t={basic:{},headers:{},queryParams:{},cookies:{},oauth2:{type:`none`}},n=e.find(e=>e.every(e=>{if(e.value==null)return!1;if(e.type===`http:basic`)return e.value.username!=null||e.value.password!=null;if(e.type===`http:custom`)return null;if(e.type===`oauth2:password`)return typeof e.value==`string`&&!!e.value;if(e.type===`oauth2:client_credentials`)return typeof e.value==`string`?!!e.value:e.value.clientID!=null||e.value.clientSecret!=null;if(typeof e.value==`string`)return!!e.value;throw Error(`Unrecognized security type: ${e.type} (value type: ${typeof e.value})`)}));return n==null?null:(n.forEach(e=>{if(e.value==null)return;let{type:n}=e;switch(n){case`apiKey:header`:t.headers[e.fieldName]=e.value;break;case`apiKey:query`:t.queryParams[e.fieldName]=e.value;break;case`apiKey:cookie`:t.cookies[e.fieldName]=e.value;break;case`http:basic`:hn(t,e);break;case`http:custom`:break;case`http:bearer`:gn(t,e);break;case`oauth2`:gn(t,e);break;case`oauth2:password`:gn(t,e);break;case`oauth2:client_credentials`:break;case`openIdConnect`:gn(t,e);break;default:throw pn.unrecognizedType(n)}}),t)}function hn(e,t){t.value!=null&&(e.basic=t.value)}function gn(e,t){if(typeof t.value!=`string`||!t.value)return;let n=t.value;n.slice(0,7).toLowerCase()!==`bearer `&&(n=`Bearer ${n}`),t.fieldName!==void 0&&(e.headers[t.fieldName]=n)}function U(e,t){let n=[[{fieldName:`Authorization`,type:`http:bearer`,value:e?.apiKey??Rt().MISTRAL_API_KEY}]];return t&&(n=t.map(e=>{if(e<0||e>=n.length)throw RangeError(`invalid allowedFields index ${e}`);return n[e]})),mn(...n)}async function W(e){if(e!=null)return typeof e==`function`?e():e}var _n={Offloaded:`offloaded`,Encrypted:`encrypted`,EncryptedPartial:`encrypted-partial`,Compressed:`compressed`},vn=w(_n),yn=m(_n),bn=x({type:T(`json`).default(`json`),value:y(),encoding_options:D(S(vn)).optional()}).transform(e=>k(e,{encoding_options:`encodingOptions`})),xn=x({task_id:b(),activity_name:b(),result:bn}).transform(e=>k(e,{task_id:`taskId`,activity_name:`activityName`})),Sn=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`ACTIVITY_TASK_COMPLETED`).default(`ACTIVITY_TASK_COMPLETED`),attributes:xn}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Cn=x({message:b()}),wn=x({task_id:b(),activity_name:b(),attempt:E(),failure:Cn}).transform(e=>k(e,{task_id:`taskId`,activity_name:`activityName`})),Tn=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`ACTIVITY_TASK_FAILED`).default(`ACTIVITY_TASK_FAILED`),attributes:wn}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),En=x({task_id:b(),activity_name:b(),attempt:E(),failure:Cn}).transform(e=>k(e,{task_id:`taskId`,activity_name:`activityName`})),Dn=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`ACTIVITY_TASK_RETRYING`).default(`ACTIVITY_TASK_RETRYING`),attributes:En}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),On=x({task_id:b(),activity_name:b(),input:bn}).transform(e=>k(e,{task_id:`taskId`,activity_name:`activityName`})),kn=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`ACTIVITY_TASK_STARTED`).default(`ACTIVITY_TASK_STARTED`),attributes:On}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),An=x({exclude:D(S(b())).optional(),include:D(S(b())).optional(),requires_confirmation:D(S(b())).optional()}).transform(e=>k(e,{requires_confirmation:`requiresConfirmation`})),jn=x({exclude:D(S(b())).optional(),include:D(S(b())).optional(),requiresConfirmation:D(S(b())).optional()}).transform(e=>k(e,{requiresConfirmation:`requires_confirmation`})),Mn=x({tool_configuration:D(An).optional(),type:T(`code_interpreter`)}).transform(e=>k(e,{tool_configuration:`toolConfiguration`})),Nn=x({toolConfiguration:D(jn).optional(),type:T(`code_interpreter`)}).transform(e=>k(e,{toolConfiguration:`tool_configuration`})),Pn=p([b(),S(b())]),Fn=p([b(),S(b())]),In=x({type:T(`content`).default(`content`),content:b().default(``)}),Ln=x({type:T(`content`).default(`content`),content:b().default(``)}),Rn={None:`none`,Minimal:`minimal`,Low:`low`,Medium:`medium`,High:`high`,Xhigh:`xhigh`},zn=w(Rn),Bn=m(Rn),Vn=x({name:b(),description:D(b()).optional(),schema:j(b(),y()),strict:C().optional()}).transform(e=>k(e,{schema:`schemaDefinition`})),Hn=x({name:b(),description:D(b()).optional(),schemaDefinition:j(b(),y()),strict:C().optional()}).transform(e=>k(e,{schemaDefinition:`schema`})),Un={Text:`text`,JsonObject:`json_object`,JsonSchema:`json_schema`},Wn=w(Un),Gn=m(Un),Kn=x({type:Wn.optional(),json_schema:D(Vn).optional()}).transform(e=>k(e,{json_schema:`jsonSchema`})),qn=x({type:Gn.optional(),jsonSchema:D(Hn).optional()}).transform(e=>k(e,{jsonSchema:`json_schema`})),Jn={Auto:`auto`,None:`none`,Any:`any`,Required:`required`},Yn=w(Jn),Xn=m(Jn),Zn=x({stop:D(Pn).optional(),presence_penalty:D(_()).optional(),frequency_penalty:D(_()).optional(),temperature:D(_()).optional(),top_p:D(_()).optional(),max_tokens:D(E()).optional(),random_seed:D(E()).optional(),prediction:D(In).optional(),response_format:D(Kn).optional(),tool_choice:Yn.optional(),reasoning_effort:D(zn).optional()}).transform(e=>k(e,{presence_penalty:`presencePenalty`,frequency_penalty:`frequencyPenalty`,top_p:`topP`,max_tokens:`maxTokens`,random_seed:`randomSeed`,response_format:`responseFormat`,tool_choice:`toolChoice`,reasoning_effort:`reasoningEffort`})),Qn=x({stop:D(Fn).optional(),presencePenalty:D(_()).optional(),frequencyPenalty:D(_()).optional(),temperature:D(_()).optional(),topP:D(_()).optional(),maxTokens:D(E()).optional(),randomSeed:D(E()).optional(),prediction:D(Ln).optional(),responseFormat:D(qn).optional(),toolChoice:Xn.optional(),reasoningEffort:D(Bn).optional()}).transform(e=>k(e,{presencePenalty:`presence_penalty`,frequencyPenalty:`frequency_penalty`,topP:`top_p`,maxTokens:`max_tokens`,randomSeed:`random_seed`,responseFormat:`response_format`,toolChoice:`tool_choice`,reasoningEffort:`reasoning_effort`})),$n=x({type:T(`api-key`),value:b()}),er=x({type:T(`api-key`),value:b()}),tr=x({type:T(`oauth2-token`),value:b()}),nr=x({type:T(`oauth2-token`),value:b()});ke(`type`,{"api-key":$n,"oauth2-token":tr}),oe([er,nr]);var rr=x({type:T(`connector`),connector_id:b(),authorization:D(ke(`type`,{"api-key":$n,"oauth2-token":tr})).optional(),tool_configuration:D(An).optional()}).transform(e=>k(e,{connector_id:`connectorId`,tool_configuration:`toolConfiguration`})),ir=x({type:T(`connector`),connectorId:b(),authorization:D(oe([er,nr])).optional(),toolConfiguration:D(jn).optional()}).transform(e=>k(e,{connectorId:`connector_id`,toolConfiguration:`tool_configuration`})),ar=x({tool_configuration:D(An).optional(),type:T(`document_library`),library_ids:S(b())}).transform(e=>k(e,{tool_configuration:`toolConfiguration`,library_ids:`libraryIds`})),or=x({toolConfiguration:D(jn).optional(),type:T(`document_library`),libraryIds:S(b())}).transform(e=>k(e,{toolConfiguration:`tool_configuration`,libraryIds:`library_ids`})),sr=x({name:b(),description:b().optional(),strict:C().optional(),parameters:j(b(),y())}),cr=x({name:b(),description:b().optional(),strict:C().optional(),parameters:j(b(),y())}),lr=x({type:T(`function`),function:sr}),ur=x({type:T(`function`),function:cr}),dr={None:`none`,Block:`block`},fr=w(dr),pr=m(dr),mr=x({sexual:D(_()).optional(),hate_and_discrimination:D(_()).optional(),violence_and_threats:D(_()).optional(),dangerous_and_criminal_content:D(_()).optional(),selfharm:D(_()).optional(),health:D(_()).optional(),financial:D(_()).optional(),law:D(_()).optional(),pii:D(_()).optional()}).transform(e=>k(e,{hate_and_discrimination:`hateAndDiscrimination`,violence_and_threats:`violenceAndThreats`,dangerous_and_criminal_content:`dangerousAndCriminalContent`})),hr=x({sexual:D(_()).optional(),hateAndDiscrimination:D(_()).optional(),violenceAndThreats:D(_()).optional(),dangerousAndCriminalContent:D(_()).optional(),selfharm:D(_()).optional(),health:D(_()).optional(),financial:D(_()).optional(),law:D(_()).optional(),pii:D(_()).optional()}).transform(e=>k(e,{hateAndDiscrimination:`hate_and_discrimination`,violenceAndThreats:`violence_and_threats`,dangerousAndCriminalContent:`dangerous_and_criminal_content`})),gr=x({model_name:b().default(`mistral-moderation-2411`),custom_category_thresholds:D(mr).optional(),ignore_other_categories:C().default(!1),action:fr.optional()}).transform(e=>k(e,{model_name:`modelName`,custom_category_thresholds:`customCategoryThresholds`,ignore_other_categories:`ignoreOtherCategories`})),_r=x({modelName:b().default(`mistral-moderation-2411`),customCategoryThresholds:D(hr).optional(),ignoreOtherCategories:C().default(!1),action:pr.optional()}).transform(e=>k(e,{modelName:`model_name`,customCategoryThresholds:`custom_category_thresholds`,ignoreOtherCategories:`ignore_other_categories`})),vr=x({sexual:D(_()).optional(),hate_and_discrimination:D(_()).optional(),violence_and_threats:D(_()).optional(),dangerous:D(_()).optional(),criminal:D(_()).optional(),selfharm:D(_()).optional(),health:D(_()).optional(),financial:D(_()).optional(),law:D(_()).optional(),pii:D(_()).optional(),jailbreaking:D(_()).optional()}).transform(e=>k(e,{hate_and_discrimination:`hateAndDiscrimination`,violence_and_threats:`violenceAndThreats`})),yr=x({sexual:D(_()).optional(),hateAndDiscrimination:D(_()).optional(),violenceAndThreats:D(_()).optional(),dangerous:D(_()).optional(),criminal:D(_()).optional(),selfharm:D(_()).optional(),health:D(_()).optional(),financial:D(_()).optional(),law:D(_()).optional(),pii:D(_()).optional(),jailbreaking:D(_()).optional()}).transform(e=>k(e,{hateAndDiscrimination:`hate_and_discrimination`,violenceAndThreats:`violence_and_threats`})),br=x({model_name:b().default(`mistral-moderation-2603`),custom_category_thresholds:D(vr).optional(),ignore_other_categories:C().default(!1),action:fr.optional()}).transform(e=>k(e,{model_name:`modelName`,custom_category_thresholds:`customCategoryThresholds`,ignore_other_categories:`ignoreOtherCategories`})),xr=x({modelName:b().default(`mistral-moderation-2603`),customCategoryThresholds:D(yr).optional(),ignoreOtherCategories:C().default(!1),action:pr.optional()}).transform(e=>k(e,{modelName:`model_name`,customCategoryThresholds:`custom_category_thresholds`,ignoreOtherCategories:`ignore_other_categories`})),Sr=x({block_on_error:C().default(!1),moderation_llm_v1:D(gr).optional(),moderation_llm_v2:D(br).optional()}).transform(e=>k(e,{block_on_error:`blockOnError`,moderation_llm_v1:`moderationLlmV1`,moderation_llm_v2:`moderationLlmV2`})),Cr=x({blockOnError:C().default(!1),moderationLlmV1:D(_r).optional(),moderationLlmV2:D(xr).optional()}).transform(e=>k(e,{blockOnError:`block_on_error`,moderationLlmV1:`moderation_llm_v1`,moderationLlmV2:`moderation_llm_v2`})),wr=x({tool_configuration:D(An).optional(),type:T(`image_generation`)}).transform(e=>k(e,{tool_configuration:`toolConfiguration`})),Tr=x({toolConfiguration:D(jn).optional(),type:T(`image_generation`)}).transform(e=>k(e,{toolConfiguration:`tool_configuration`})),Er=x({tool_configuration:D(An).optional(),type:T(`web_search_premium`)}).transform(e=>k(e,{tool_configuration:`toolConfiguration`})),Dr=x({toolConfiguration:D(jn).optional(),type:T(`web_search_premium`)}).transform(e=>k(e,{toolConfiguration:`tool_configuration`})),Or=x({tool_configuration:D(An).optional(),type:T(`web_search`)}).transform(e=>k(e,{tool_configuration:`toolConfiguration`})),kr=x({toolConfiguration:D(jn).optional(),type:T(`web_search`)}).transform(e=>k(e,{toolConfiguration:`tool_configuration`}));ke(`type`,{code_interpreter:Mn,connector:rr,document_library:ar,function:lr,image_generation:wr,web_search:Or,web_search_premium:Er});var Ar=x({instructions:D(b()).optional(),tools:S(ke(`type`,{code_interpreter:Mn,connector:rr,document_library:ar,function:lr,image_generation:wr,web_search:Or,web_search_premium:Er})).optional(),completion_args:Zn.optional(),guardrails:D(S(Sr)).optional(),model:b(),name:b(),description:D(b()).optional(),handoffs:D(S(b())).optional(),metadata:D(j(b(),y())).optional(),object:T(`agent`).default(`agent`),id:b(),version:E(),versions:S(E()),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),deployment_chat:C(),source:b(),version_message:D(b()).optional()}).transform(e=>k(e,{completion_args:`completionArgs`,created_at:`createdAt`,updated_at:`updatedAt`,deployment_chat:`deploymentChat`,version_message:`versionMessage`})),jr=x({alias:b(),version:E(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e))}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`}));p([b(),E()]);var Mr=x({name:D(b()).optional(),description:D(b()).optional(),metadata:D(j(b(),y())).optional(),object:T(`conversation`).default(`conversation`),id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),agent_id:b(),agent_version:D(p([b(),E()])).optional()}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,agent_id:`agentId`,agent_version:`agentVersion`})),Nr=x({type:T(`agent.handoff.done`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),output_index:E().default(0),id:b(),next_agent_id:b(),next_agent_name:b()}).transform(e=>k(e,{created_at:`createdAt`,output_index:`outputIndex`,next_agent_id:`nextAgentId`,next_agent_name:`nextAgentName`})),Pr=x({object:T(`entry`).default(`entry`),type:T(`agent.handoff`).default(`agent.handoff`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),completed_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),id:b().optional(),previous_agent_id:b(),previous_agent_name:b(),next_agent_id:b(),next_agent_name:b()}).transform(e=>k(e,{created_at:`createdAt`,completed_at:`completedAt`,previous_agent_id:`previousAgentId`,previous_agent_name:`previousAgentName`,next_agent_id:`nextAgentId`,next_agent_name:`nextAgentName`})),Fr=x({object:T(`entry`).default(`entry`),type:T(`agent.handoff`).default(`agent.handoff`),createdAt:f().transform(e=>e.toISOString()).optional(),completedAt:D(f().transform(e=>e.toISOString())).optional(),id:b().optional(),previousAgentId:b(),previousAgentName:b(),nextAgentId:b(),nextAgentName:b()}).transform(e=>k(e,{createdAt:`created_at`,completedAt:`completed_at`,previousAgentId:`previous_agent_id`,previousAgentName:`previous_agent_name`,nextAgentId:`next_agent_id`,nextAgentName:`next_agent_name`})),Ir=x({type:T(`agent.handoff.started`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),output_index:E().default(0),id:b(),previous_agent_id:b(),previous_agent_name:b()}).transform(e=>k(e,{created_at:`createdAt`,output_index:`outputIndex`,previous_agent_id:`previousAgentId`,previous_agent_name:`previousAgentName`}));p([b(),S(de)]),p([b(),S(ve)]);var Lr=x({role:T(`assistant`).default(`assistant`),content:D(p([b(),S(de)])).optional(),tool_calls:D(S(xe)).optional(),prefix:C().default(!1)}).transform(e=>k(e,{tool_calls:`toolCalls`})),Rr=x({role:T(`assistant`).default(`assistant`),content:D(p([b(),S(ve)])).optional(),toolCalls:D(S(we)).optional(),prefix:C().default(!1)}).transform(e=>k(e,{toolCalls:`tool_calls`})),zr=m({Reasoning:`reasoning`}),Br=oe([ce.and(x({type:T(`text`)})),fe.and(x({type:T(`thinking`)}))]);p([b(),S(Br)]);var Vr=x({role:T(`system`),content:p([b(),S(Br)])}),Hr=x({type:T(`function`),function:cr}),Ur=x({name:b()}),Wr=x({type:b().optional(),function:Ur});p([b(),S(ve)]);var Gr=x({role:T(`tool`),content:D(p([b(),S(ve)])),toolCallId:D(b()).optional(),name:D(b()).optional()}).transform(e=>k(e,{toolCallId:`tool_call_id`}));p([b(),S(ve)]);var Kr=x({role:T(`user`),content:D(p([b(),S(ve)]))});p([b(),S(b())]),oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr]),oe([Hr,kr,Dr,Nn,Tr,or,ir]),p([Wr,Xn]);var qr=x({maxTokens:D(E()).optional(),stream:C().default(!1),stop:D(p([b(),S(b())])).optional(),randomSeed:D(E()).optional(),metadata:D(j(b(),y())).optional(),messages:S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr])),responseFormat:qn.optional(),tools:D(S(oe([Hr,kr,Dr,Nn,Tr,or,ir]))).optional(),toolChoice:p([Wr,Xn]).optional(),presencePenalty:D(_()).optional(),frequencyPenalty:D(_()).optional(),n:D(E()).optional(),prediction:Ln.optional(),parallelToolCalls:C().optional(),reasoningEffort:D(Bn).optional(),promptMode:D(zr).optional(),guardrails:D(S(Cr)).optional(),promptCacheKey:D(b()).optional(),agentId:b()}).transform(e=>k(e,{maxTokens:`max_tokens`,randomSeed:`random_seed`,responseFormat:`response_format`,toolChoice:`tool_choice`,presencePenalty:`presence_penalty`,frequencyPenalty:`frequency_penalty`,parallelToolCalls:`parallel_tool_calls`,reasoningEffort:`reasoning_effort`,promptMode:`prompt_mode`,promptCacheKey:`prompt_cache_key`,agentId:`agent_id`}));p([b(),S(b())]),oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr]),oe([Hr,kr,Dr,Nn,Tr,or,ir]),p([Wr,Xn]);var Jr=x({maxTokens:D(E()).optional(),stream:C().default(!0),stop:D(p([b(),S(b())])).optional(),randomSeed:D(E()).optional(),metadata:D(j(b(),y())).optional(),messages:S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr])),responseFormat:qn.optional(),tools:D(S(oe([Hr,kr,Dr,Nn,Tr,or,ir]))).optional(),toolChoice:p([Wr,Xn]).optional(),presencePenalty:D(_()).optional(),frequencyPenalty:D(_()).optional(),n:D(E()).optional(),prediction:Ln.optional(),parallelToolCalls:C().optional(),reasoningEffort:D(Bn).optional(),promptMode:D(zr).optional(),guardrails:D(S(Cr)).optional(),promptCacheKey:D(b()).optional(),agentId:b()}).transform(e=>k(e,{maxTokens:`max_tokens`,randomSeed:`random_seed`,responseFormat:`response_format`,toolChoice:`tool_choice`,presencePenalty:`presence_penalty`,frequencyPenalty:`frequency_penalty`,parallelToolCalls:`parallel_tool_calls`,reasoningEffort:`reasoning_effort`,promptMode:`prompt_mode`,promptCacheKey:`prompt_cache_key`,agentId:`agent_id`})),Yr=x({audience:D(S(w({User:`user`,Assistant:`assistant`}))).optional(),priority:D(_()).optional()}).catchall(y()),Xr=m({RootV1ChatCompletions:`/v1/chat/completions`,RootV1Embeddings:`/v1/embeddings`,RootV1FimCompletions:`/v1/fim/completions`,RootV1Moderations:`/v1/moderations`,RootV1ChatModerations:`/v1/chat/moderations`,RootV1Ocr:`/v1/ocr`,RootV1Classifications:`/v1/classifications`,RootV1ChatClassifications:`/v1/chat/classifications`,RootV1Conversations:`/v1/conversations`,RootV1AudioTranscriptions:`/v1/audio/transcriptions`}),Zr=x({id:b(),object:T(`model`).default(`model`),archived:C().default(!0)}),Qr=x({type:T(`audio`),data:b(),mimeType:b(),annotations:D(Yr).optional(),_meta:D(j(b(),y())).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),$r=Me(ei,{message:`expected a Blob, File or Blob-like object`,abort:!0});function ei(e){if(e instanceof Blob)return!0;if(typeof e!=`object`||!e||!(Symbol.toStringTag in e))return!1;let t=e[Symbol.toStringTag];return typeof t!=`string`||t!==`Blob`&&t!==`File`?!1:`stream`in e&&typeof e.stream==`function`}var ti=x({fileName:b(),content:oe([Me(e=>e instanceof ReadableStream),Me(e=>e instanceof Blob),Me(e=>e instanceof ArrayBuffer),Me(e=>e instanceof Uint8Array)])}),ni=re({Segment:`segment`,Word:`word`}),ri=x({model:b(),file:ti.or($r).optional(),fileUrl:D(b()).optional(),fileId:D(b()).optional(),language:D(b()).optional(),temperature:D(_()).optional(),stream:T(!1).default(!1),diarize:C().default(!1),contextBias:S(b()).optional(),timestampGranularities:S(ni).optional()}).transform(e=>k(e,{fileUrl:`file_url`,fileId:`file_id`,contextBias:`context_bias`,timestampGranularities:`timestamp_granularities`})),ii=x({model:b(),file:ti.or($r).optional(),fileUrl:D(b()).optional(),fileId:D(b()).optional(),language:D(b()).optional(),temperature:D(_()).optional(),stream:T(!0).default(!0),diarize:C().default(!1),contextBias:S(b()).optional(),timestampGranularities:S(ni).optional()}).transform(e=>k(e,{fileUrl:`file_url`,fileId:`file_id`,contextBias:`context_bias`,timestampGranularities:`timestamp_granularities`})),ai=x({clientId:b(),clientSecret:D(b()).optional()}).transform(e=>k(e,{clientId:`client_id`,clientSecret:`client_secret`})),oi=w({User:`user`,Org:`org`,Workspace:`workspace`,System:`system`}),si=w({Valid:`valid`,Invalid:`invalid`,Error:`error`}),ci=h({OneHundred:100,OneHundredAndOne:101,OneHundredAndTwo:102,OneHundredAndThree:103,TwoHundred:200,TwoHundredAndOne:201,TwoHundredAndTwo:202,TwoHundredAndThree:203,TwoHundredAndFour:204,TwoHundredAndFive:205,TwoHundredAndSix:206,TwoHundredAndSeven:207,TwoHundredAndEight:208,TwoHundredAndTwentySix:226,ThreeHundred:300,ThreeHundredAndOne:301,ThreeHundredAndTwo:302,ThreeHundredAndThree:303,ThreeHundredAndFour:304,ThreeHundredAndFive:305,ThreeHundredAndSeven:307,ThreeHundredAndEight:308,FourHundred:400,FourHundredAndOne:401,FourHundredAndTwo:402,FourHundredAndThree:403,FourHundredAndFour:404,FourHundredAndFive:405,FourHundredAndSix:406,FourHundredAndSeven:407,FourHundredAndEight:408,FourHundredAndNine:409,FourHundredAndTen:410,FourHundredAndEleven:411,FourHundredAndTwelve:412,FourHundredAndThirteen:413,FourHundredAndFourteen:414,FourHundredAndFifteen:415,FourHundredAndSixteen:416,FourHundredAndSeventeen:417,FourHundredAndEighteen:418,FourHundredAndTwentyOne:421,FourHundredAndTwentyTwo:422,FourHundredAndTwentyThree:423,FourHundredAndTwentyFour:424,FourHundredAndTwentyFive:425,FourHundredAndTwentySix:426,FourHundredAndTwentyEight:428,FourHundredAndTwentyNine:429,FourHundredAndThirtyOne:431,FourHundredAndFiftyOne:451,FiveHundred:500,FiveHundredAndOne:501,FiveHundredAndTwo:502,FiveHundredAndThree:503,FiveHundredAndFour:504,FiveHundredAndFive:505,FiveHundredAndSix:506,FiveHundredAndSeven:507,FiveHundredAndEight:508,FiveHundredAndTen:510,FiveHundredAndEleven:511}),li=x({status_type:si,last_checked_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),error_http_code:D(ci).optional(),error_message:D(b()).optional()}).transform(e=>k(e,{status_type:`statusType`,last_checked_at:`lastCheckedAt`,error_http_code:`errorHttpCode`,error_message:`errorMessage`})),ui={Oauth2:`oauth2`,Bearer:`bearer`,None:`none`,GithubApp:`github_app`,SlackApp:`slack_app`},di=w(ui),fi=m(ui),pi=x({name:b(),authentication_type:di,scope:oi,status:D(li).optional(),is_default:C().default(!1)}).transform(e=>k(e,{authentication_type:`authenticationType`,is_default:`isDefault`})),mi=x({auth_url:b(),ttl:E()}).transform(e=>k(e,{auth_url:`authUrl`})),hi={Enum:`ENUM`,Text:`TEXT`,Int:`INT`,Float:`FLOAT`,Bool:`BOOL`,Timestamp:`TIMESTAMP`,Array:`ARRAY`,Map:`MAP`},gi={Lt:`lt`,Lte:`lte`,Gt:`gt`,Gte:`gte`,Startswith:`startswith`,Istartswith:`istartswith`,Endswith:`endswith`,Iendswith:`iendswith`,Contains:`contains`,Icontains:`icontains`,Matches:`matches`,Notcontains:`notcontains`,Inotcontains:`inotcontains`,Eq:`eq`,Neq:`neq`,Isnull:`isnull`,Includes:`includes`,Excludes:`excludes`,LenEq:`len_eq`},_i=w(hi),vi=w(gi),yi=x({name:b(),label:b(),type:_i,group:D(b()).optional(),supported_operators:S(vi)}).transform(e=>k(e,{supported_operators:`supportedOperators`})),bi=x({completion_chat:C().default(!1),function_calling:C().default(!1),reasoning:C().default(!1),completion_fim:C().default(!1),fine_tuning:C().default(!1),vision:C().default(!1),ocr:C().default(!1),classification:C().default(!1),moderation:C().default(!1),audio:C().default(!1),audio_transcription:C().default(!1),audio_transcription_realtime:C().default(!1),audio_speech:C().default(!1)}).transform(e=>k(e,{completion_chat:`completionChat`,function_calling:`functionCalling`,completion_fim:`completionFim`,fine_tuning:`fineTuning`,audio_transcription:`audioTranscription`,audio_transcription_realtime:`audioTranscriptionRealtime`,audio_speech:`audioSpeech`})),xi=x({id:b(),object:b().default(`model`),created:E().optional(),owned_by:b().default(`mistralai`),capabilities:bi,name:D(b()).optional(),description:D(b()).optional(),max_context_length:E().default(32768),aliases:S(b()).optional(),deprecation:D(O({offset:!0}).transform(e=>new Date(e))).optional(),deprecation_replacement_model:D(b()).optional(),default_model_temperature:D(_()).optional(),type:T(`base`)}).transform(e=>k(e,{owned_by:`ownedBy`,max_context_length:`maxContextLength`,deprecation_replacement_model:`deprecationReplacementModel`,default_model_temperature:`defaultModelTemperature`})),Si=w({Running:`RUNNING`,Completed:`COMPLETED`,Failed:`FAILED`,Canceled:`CANCELED`,Terminated:`TERMINATED`,ContinuedAsNew:`CONTINUED_AS_NEW`,TimedOut:`TIMED_OUT`,Unknown:`UNKNOWN`}),Ci=x({message:b(),count:E().default(1)}),wi=x({executionIds:S(b())}).transform(e=>k(e,{executionIds:`execution_ids`})),Ti=x({status:b(),error:D(b()).optional()}),Ei=x({results:j(b(),Ti).optional()}),Di={Queued:`QUEUED`,Running:`RUNNING`,Success:`SUCCESS`,Failed:`FAILED`,TimeoutExceeded:`TIMEOUT_EXCEEDED`,CancellationRequested:`CANCELLATION_REQUESTED`,Cancelled:`CANCELLED`},Oi=w(Di),ki=m(Di),Ai=x({id:b(),object:T(`batch`).default(`batch`),input_files:S(b()),metadata:D(j(b(),y())).optional(),endpoint:b(),model:D(b()).optional(),agent_id:D(b()).optional(),output_file:D(b()).optional(),error_file:D(b()).optional(),errors:S(Ci),outputs:D(S(j(b(),y()))).optional(),status:Oi,created_at:E(),total_requests:E(),completed_requests:E(),succeeded_requests:E(),failed_requests:E(),started_at:D(E()).optional(),completed_at:D(E()).optional()}).transform(e=>k(e,{input_files:`inputFiles`,agent_id:`agentId`,output_file:`outputFile`,error_file:`errorFile`,created_at:`createdAt`,total_requests:`totalRequests`,completed_requests:`completedRequests`,succeeded_requests:`succeededRequests`,failed_requests:`failedRequests`,started_at:`startedAt`,completed_at:`completedAt`})),ji=x({customId:D(b()).optional(),body:j(b(),y())}).transform(e=>k(e,{customId:`custom_id`})),Mi=x({uri:b(),mimeType:D(b()).optional(),_meta:D(j(b(),y())).optional(),blob:b()}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),Ni={Lt:`lt`,Lte:`lte`,Gt:`gt`,Gte:`gte`,Startswith:`startswith`,Istartswith:`istartswith`,Endswith:`endswith`,Iendswith:`iendswith`,Contains:`contains`,Icontains:`icontains`,Matches:`matches`,Notcontains:`notcontains`,Inotcontains:`inotcontains`,Eq:`eq`,Neq:`neq`,Isnull:`isnull`,Includes:`includes`,Excludes:`excludes`,LenEq:`len_eq`},Pi=w(Ni),Fi=m(Ni),Ii=x({field:b(),op:Pi,value:y()}),Li=x({field:b(),op:Fi,value:y()});p([Ii,v(()=>Ri)]),p([Li,v(()=>zi)]);var Ri=x({AND:D(S(p([Ii,v(()=>Ri)]))).optional(),OR:D(S(p([Ii,v(()=>Ri)]))).optional()}).transform(e=>k(e,{AND:`and`,OR:`or`})),zi=x({and:D(S(p([Li,v(()=>zi)]))).optional(),or:D(S(p([Li,v(()=>zi)]))).optional()}).transform(e=>k(e,{and:`AND`,or:`OR`}));p([Ii,v(()=>Ri)]),p([Li,v(()=>zi)]),p([Ii,Ri]),p([Li,zi]);var Bi=x({filters:D(p([Ii,Ri]))}),Vi=x({filters:D(p([Li,zi]))}),Hi=x({value:b(),description:b()}),Ui=x({value:b(),description:b()}),Wi=x({type:T(`CLASSIFICATION`),options:S(Hi)}),Gi=x({type:T(`CLASSIFICATION`),options:S(Ui)}),Ki=x({type:T(`REGRESSION`),min:_().default(0),min_description:b(),max:_().default(1),max_description:b()}).transform(e=>k(e,{min_description:`minDescription`,max_description:`maxDescription`})),qi=x({type:T(`REGRESSION`),min:_().default(0),minDescription:b(),max:_().default(1),maxDescription:b()}).transform(e=>k(e,{minDescription:`min_description`,maxDescription:`max_description`}));ke(`type`,{CLASSIFICATION:Wi,REGRESSION:Ki});var Ji=x({id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),deleted_at:D(O({offset:!0}).transform(e=>new Date(e))),owner_id:b(),workspace_id:b(),name:b(),description:b(),model_name:b(),output:ke(`type`,{CLASSIFICATION:Wi,REGRESSION:Ki}),instructions:b(),tools:S(b()),up_revision:D(b()).optional(),down_revision:D(b()).optional(),base_revision:D(b()).optional()}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,deleted_at:`deletedAt`,owner_id:`ownerId`,workspace_id:`workspaceId`,model_name:`modelName`,up_revision:`upRevision`,down_revision:`downRevision`,base_revision:`baseRevision`})),Yi=x({id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),deleted_at:D(O({offset:!0}).transform(e=>new Date(e))),name:b(),owner_id:b(),workspace_id:b(),description:b(),max_nb_events:E(),search_params:Bi,judge:Ji}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,deleted_at:`deletedAt`,owner_id:`ownerId`,workspace_id:`workspaceId`,max_nb_events:`maxNbEvents`,search_params:`searchParams`}));oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr]);var Xi=x({messages:S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr]))}),Zi=p([Xi,S(Xi)]),Qi=x({model:b(),input:Zi}),$i=w({Stop:`stop`,Length:`length`,ModelLength:`model_length`,Error:`error`,ToolCalls:`tool_calls`}),ea=x({index:E(),message:Lr.optional(),messages:S(le).optional(),finish_reason:$i}).transform(e=>k(e,{finish_reason:`finishReason`})),ta=x({audio_url:b(),model:b(),response_message:j(b(),y())}).transform(e=>k(e,{audio_url:`audioUrl`,response_message:`responseMessage`}));p([C(),E(),_(),b(),O({offset:!0}).transform(e=>new Date(e)),S(b()),j(b(),b())]);var na=x({event_id:b(),correlation_id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),extra_fields:j(b(),D(p([C(),E(),_(),b(),O({offset:!0}).transform(e=>new Date(e)),S(b()),j(b(),b())]))),nb_input_tokens:E(),nb_output_tokens:E(),enabled_tools:S(j(b(),y())),request_messages:S(j(b(),y())),response_messages:S(j(b(),y())),nb_messages:E(),chat_transcription_events:S(ta)}).transform(e=>k(e,{event_id:`eventId`,correlation_id:`correlationId`,created_at:`createdAt`,extra_fields:`extraFields`,nb_input_tokens:`nbInputTokens`,nb_output_tokens:`nbOutputTokens`,enabled_tools:`enabledTools`,request_messages:`requestMessages`,response_messages:`responseMessages`,nb_messages:`nbMessages`,chat_transcription_events:`chatTranscriptionEvents`}));p([C(),E(),_(),b(),O({offset:!0}).transform(e=>new Date(e)),S(b()),j(b(),b())]);var ra=x({event_id:b(),correlation_id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),extra_fields:j(b(),D(p([C(),E(),_(),b(),O({offset:!0}).transform(e=>new Date(e)),S(b()),j(b(),b())]))),nb_input_tokens:E(),nb_output_tokens:E()}).transform(e=>k(e,{event_id:`eventId`,correlation_id:`correlationId`,created_at:`createdAt`,extra_fields:`extraFields`,nb_input_tokens:`nbInputTokens`,nb_output_tokens:`nbOutputTokens`}));p([b(),S(b())]),oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr]),oe([Hr,kr,Dr,Nn,Tr,or,ir]),p([Wr,Xn]);var ia=x({model:b(),temperature:D(_()).optional(),topP:D(_()).optional(),maxTokens:D(E()).optional(),stream:C().default(!1),stop:D(p([b(),S(b())])).optional(),randomSeed:D(E()).optional(),metadata:D(j(b(),y())).optional(),messages:S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr])),responseFormat:qn.optional(),tools:D(S(oe([Hr,kr,Dr,Nn,Tr,or,ir]))).optional(),toolChoice:p([Wr,Xn]).optional(),presencePenalty:D(_()).optional(),frequencyPenalty:D(_()).optional(),n:D(E()).optional(),prediction:Ln.optional(),parallelToolCalls:C().optional(),reasoningEffort:D(Bn).optional(),promptMode:D(zr).optional(),guardrails:D(S(Cr)).optional(),promptCacheKey:D(b()).optional(),safePrompt:C().optional()}).transform(e=>k(e,{topP:`top_p`,maxTokens:`max_tokens`,randomSeed:`random_seed`,responseFormat:`response_format`,toolChoice:`tool_choice`,presencePenalty:`presence_penalty`,frequencyPenalty:`frequency_penalty`,parallelToolCalls:`parallel_tool_calls`,reasoningEffort:`reasoning_effort`,promptMode:`prompt_mode`,promptCacheKey:`prompt_cache_key`,safePrompt:`safe_prompt`})),aa=x({id:b(),object:b(),model:b(),usage:Ce,created:E(),choices:S(ea)});p([b(),S(b())]),oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr]),oe([Hr,kr,Dr,Nn,Tr,or,ir]),p([Wr,Xn]);var oa=x({model:b(),temperature:D(_()).optional(),topP:D(_()).optional(),maxTokens:D(E()).optional(),stream:C().default(!0),stop:D(p([b(),S(b())])).optional(),randomSeed:D(E()).optional(),metadata:D(j(b(),y())).optional(),messages:S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr])),responseFormat:qn.optional(),tools:D(S(oe([Hr,kr,Dr,Nn,Tr,or,ir]))).optional(),toolChoice:p([Wr,Xn]).optional(),presencePenalty:D(_()).optional(),frequencyPenalty:D(_()).optional(),n:D(E()).optional(),prediction:Ln.optional(),parallelToolCalls:C().optional(),reasoningEffort:D(Bn).optional(),promptMode:D(zr).optional(),guardrails:D(S(Cr)).optional(),promptCacheKey:D(b()).optional(),safePrompt:C().optional()}).transform(e=>k(e,{topP:`top_p`,maxTokens:`max_tokens`,randomSeed:`random_seed`,responseFormat:`response_format`,toolChoice:`tool_choice`,presencePenalty:`presence_penalty`,frequencyPenalty:`frequency_penalty`,parallelToolCalls:`parallel_tool_calls`,reasoningEffort:`reasoning_effort`,promptMode:`prompt_mode`,promptCacheKey:`prompt_cache_key`,safePrompt:`safe_prompt`}));oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr]),oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr]),p([S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr])),S(S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr])))]);var sa=x({inputs:p([S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr])),S(S(oe([Rr.and(x({role:T(`assistant`)})),Vr,Gr,Kr])))]),model:b()}).transform(e=>k(e,{inputs:`input`})),ca=x({metrics:x({train_loss:D(_()).optional(),valid_loss:D(_()).optional(),valid_mean_token_accuracy:D(_()).optional()}).transform(e=>k(e,{train_loss:`trainLoss`,valid_loss:`validLoss`,valid_mean_token_accuracy:`validMeanTokenAccuracy`})),step_number:E(),created_at:E()}).transform(e=>k(e,{step_number:`stepNumber`,created_at:`createdAt`}));p([b(),S(b())]);var la=x({model:b(),metadata:D(j(b(),y())).optional(),inputs:p([b(),S(b())])}).transform(e=>k(e,{inputs:`input`})),ua=x({scores:j(b(),_())}),da=x({id:b(),model:b(),results:S(j(b(),ua))}),fa={SingleClass:`single_class`,MultiClass:`multi_class`},pa=w(fa),ma=m(fa),ha=x({name:b(),labels:S(b()),weight:_(),loss_function:pa}).transform(e=>k(e,{loss_function:`lossFunction`})),ga=x({completion_chat:C().default(!0),completion_fim:C().default(!1),function_calling:C().default(!1),fine_tuning:C().default(!1),classification:C().default(!1)}).transform(e=>k(e,{completion_chat:`completionChat`,completion_fim:`completionFim`,function_calling:`functionCalling`,fine_tuning:`fineTuning`})),_a=x({id:b(),object:T(`model`).default(`model`),created:E(),owned_by:b(),workspace_id:b(),root:b(),root_version:b(),archived:C(),name:D(b()).optional(),description:D(b()).optional(),capabilities:ga,max_context_length:E().default(32768),aliases:S(b()).optional(),job:D(b()).optional(),classifier_targets:S(ha),model_type:T(`classifier`)}).transform(e=>k(e,{owned_by:`ownedBy`,workspace_id:`workspaceId`,root_version:`rootVersion`,max_context_length:`maxContextLength`,classifier_targets:`classifierTargets`,model_type:`modelType`})),va=x({training_steps:D(E()).optional(),learning_rate:_().default(1e-4),weight_decay:D(_()).optional(),warmup_fraction:D(_()).optional(),epochs:D(_()).optional(),seq_len:D(E()).optional()}).transform(e=>k(e,{training_steps:`trainingSteps`,learning_rate:`learningRate`,weight_decay:`weightDecay`,warmup_fraction:`warmupFraction`,seq_len:`seqLen`})),ya=x({trainingSteps:D(E()).optional(),learningRate:_().default(1e-4),weightDecay:D(_()).optional(),warmupFraction:D(_()).optional(),epochs:D(_()).optional(),seqLen:D(E()).optional()}).transform(e=>k(e,{trainingSteps:`training_steps`,learningRate:`learning_rate`,weightDecay:`weight_decay`,warmupFraction:`warmup_fraction`,seqLen:`seq_len`})),ba=x({expected_duration_seconds:D(E()).optional(),cost:D(_()).optional(),cost_currency:D(b()).optional(),train_tokens_per_step:D(E()).optional(),train_tokens:D(E()).optional(),data_tokens:D(E()).optional(),estimated_start_time:D(E()).optional()}).transform(e=>k(e,{expected_duration_seconds:`expectedDurationSeconds`,cost_currency:`costCurrency`,train_tokens_per_step:`trainTokensPerStep`,train_tokens:`trainTokens`,data_tokens:`dataTokens`,estimated_start_time:`estimatedStartTime`})),xa=x({type:T(`wandb`),project:b(),name:D(b()).optional(),run_name:D(b()).optional(),url:D(b()).optional()}).transform(e=>k(e,{run_name:`runName`})),Sa=w({Queued:`QUEUED`,Started:`STARTED`,Validating:`VALIDATING`,Validated:`VALIDATED`,Running:`RUNNING`,FailedValidation:`FAILED_VALIDATION`,Failed:`FAILED`,Success:`SUCCESS`,Cancelled:`CANCELLED`,CancellationRequested:`CANCELLATION_REQUESTED`}),Ca=x({id:b(),auto_start:C(),model:b(),status:Sa,created_at:E(),modified_at:E(),training_files:S(b()),validation_files:D(S(b())).optional(),object:T(`job`).default(`job`),fine_tuned_model:D(b()).optional(),suffix:D(b()).optional(),integrations:D(S(xa)).optional(),trained_tokens:D(E()).optional(),metadata:D(ba).optional(),job_type:T(`classifier`),hyperparameters:va}).transform(e=>k(e,{auto_start:`autoStart`,created_at:`createdAt`,modified_at:`modifiedAt`,training_files:`trainingFiles`,validation_files:`validationFiles`,fine_tuned_model:`fineTunedModel`,trained_tokens:`trainedTokens`,job_type:`jobType`})),wa=x({name:b(),data:D(j(b(),y())).optional(),created_at:E()}).transform(e=>k(e,{created_at:`createdAt`})),Ta=w({Queued:`QUEUED`,Started:`STARTED`,Validating:`VALIDATING`,Validated:`VALIDATED`,Running:`RUNNING`,FailedValidation:`FAILED_VALIDATION`,Failed:`FAILED`,Success:`SUCCESS`,Cancelled:`CANCELLED`,CancellationRequested:`CANCELLATION_REQUESTED`}),Ea=x({id:b(),auto_start:C(),model:b(),status:Ta,created_at:E(),modified_at:E(),training_files:S(b()),validation_files:D(S(b())).optional(),object:T(`job`).default(`job`),fine_tuned_model:D(b()).optional(),suffix:D(b()).optional(),integrations:D(S(xa)).optional(),trained_tokens:D(E()).optional(),metadata:D(ba).optional(),job_type:T(`classifier`),hyperparameters:va,events:S(wa).optional(),checkpoints:S(ca).optional(),classifier_targets:S(ha)}).transform(e=>k(e,{auto_start:`autoStart`,created_at:`createdAt`,modified_at:`modifiedAt`,training_files:`trainingFiles`,validation_files:`validationFiles`,fine_tuned_model:`fineTunedModel`,trained_tokens:`trainedTokens`,job_type:`jobType`,classifier_targets:`classifierTargets`})),Da=x({name:b(),labels:S(b()),weight:_().default(1),lossFunction:D(ma).optional()}).transform(e=>k(e,{lossFunction:`loss_function`})),Oa=x({create:D(j(b(),y())).optional()}).catchall(y()),ka=x({sampling:D(x({createMessage:D(j(b(),y())).optional()}).catchall(y())).optional(),elicitation:D(Oa).optional()}).catchall(y()),Aa=x({list:D(j(b(),y())).optional(),cancel:D(j(b(),y())).optional(),requests:D(ka).optional()}).catchall(y()),ja=x({form:D(j(b(),y())).optional(),url:D(j(b(),y())).optional()}).catchall(y()),Ma=x({listChanged:D(C()).optional()}).catchall(y()),Na=x({context:D(j(b(),y())).optional(),tools:D(j(b(),y())).optional()}).catchall(y()),Pa=x({experimental:D(j(b(),j(b(),y()))).optional(),sampling:D(Na).optional(),elicitation:D(ja).optional(),roots:D(Ma).optional(),tasks:D(Aa).optional()}).catchall(y()),Fa=x({data:b().transform((e,t)=>{try{return JSON.parse(e)}catch(n){return t.addIssue({input:e,code:`custom`,message:`malformed json: ${n}`}),pe}}).pipe(Te)}),Ia=x({id:b(),object:T(`model`).default(`model`),created:E(),owned_by:b(),workspace_id:b(),root:b(),root_version:b(),archived:C(),name:D(b()).optional(),description:D(b()).optional(),capabilities:ga,max_context_length:E().default(32768),aliases:S(b()).optional(),job:D(b()).optional(),model_type:T(`completion`)}).transform(e=>k(e,{owned_by:`ownedBy`,workspace_id:`workspaceId`,root_version:`rootVersion`,max_context_length:`maxContextLength`,model_type:`modelType`})),La=x({training_steps:D(E()).optional(),learning_rate:_().default(1e-4),weight_decay:D(_()).optional(),warmup_fraction:D(_()).optional(),epochs:D(_()).optional(),seq_len:D(E()).optional(),fim_ratio:D(_()).optional()}).transform(e=>k(e,{training_steps:`trainingSteps`,learning_rate:`learningRate`,weight_decay:`weightDecay`,warmup_fraction:`warmupFraction`,seq_len:`seqLen`,fim_ratio:`fimRatio`})),Ra=x({trainingSteps:D(E()).optional(),learningRate:_().default(1e-4),weightDecay:D(_()).optional(),warmupFraction:D(_()).optional(),epochs:D(_()).optional(),seqLen:D(E()).optional(),fimRatio:D(_()).optional()}).transform(e=>k(e,{trainingSteps:`training_steps`,learningRate:`learning_rate`,weightDecay:`weight_decay`,warmupFraction:`warmup_fraction`,seqLen:`seq_len`,fimRatio:`fim_ratio`})),za=x({type:T(`github`),name:b(),owner:b(),ref:D(b()).optional(),weight:_().default(1),commit_id:b()}).transform(e=>k(e,{commit_id:`commitId`})),Ba=w({Queued:`QUEUED`,Started:`STARTED`,Validating:`VALIDATING`,Validated:`VALIDATED`,Running:`RUNNING`,FailedValidation:`FAILED_VALIDATION`,Failed:`FAILED`,Success:`SUCCESS`,Cancelled:`CANCELLED`,CancellationRequested:`CANCELLATION_REQUESTED`}),Va=x({id:b(),auto_start:C(),model:b(),status:Ba,created_at:E(),modified_at:E(),training_files:S(b()),validation_files:D(S(b())).optional(),object:T(`job`).default(`job`),fine_tuned_model:D(b()).optional(),suffix:D(b()).optional(),integrations:D(S(xa)).optional(),trained_tokens:D(E()).optional(),metadata:D(ba).optional(),job_type:T(`completion`),hyperparameters:La,repositories:S(za).optional()}).transform(e=>k(e,{auto_start:`autoStart`,created_at:`createdAt`,modified_at:`modifiedAt`,training_files:`trainingFiles`,validation_files:`validationFiles`,fine_tuned_model:`fineTunedModel`,trained_tokens:`trainedTokens`,job_type:`jobType`})),Ha=w({Queued:`QUEUED`,Started:`STARTED`,Validating:`VALIDATING`,Validated:`VALIDATED`,Running:`RUNNING`,FailedValidation:`FAILED_VALIDATION`,Failed:`FAILED`,Success:`SUCCESS`,Cancelled:`CANCELLED`,CancellationRequested:`CANCELLATION_REQUESTED`}),Ua=x({id:b(),auto_start:C(),model:b(),status:Ha,created_at:E(),modified_at:E(),training_files:S(b()),validation_files:D(S(b())).optional(),object:T(`job`).default(`job`),fine_tuned_model:D(b()).optional(),suffix:D(b()).optional(),integrations:D(S(xa)).optional(),trained_tokens:D(E()).optional(),metadata:D(ba).optional(),job_type:T(`completion`),hyperparameters:La,repositories:S(za).optional(),events:S(wa).optional(),checkpoints:S(ca).optional()}).transform(e=>k(e,{auto_start:`autoStart`,created_at:`createdAt`,modified_at:`modifiedAt`,training_files:`trainingFiles`,validation_files:`validationFiles`,fine_tuned_model:`fineTunedModel`,trained_tokens:`trainedTokens`,job_type:`jobType`})),Wa=x({reasoning_tokens:E().default(0)}).transform(e=>k(e,{reasoning_tokens:`reasoningTokens`})),Ga=w({Mcp:`mcp`,Turbine:`turbine`,Eolienne:`eolienne`}),Ka=x({oauth:D(x({accessToken:b(),tokenType:T(`Bearer`).default(`Bearer`),expiresIn:D(E()).optional(),scope:D(b()).optional(),refreshToken:D(b()).optional(),expiresAt:D(f().transform(e=>e.toISOString())).optional()}).transform(e=>k(e,{accessToken:`access_token`,tokenType:`token_type`,expiresIn:`expires_in`,refreshToken:`refresh_token`,expiresAt:`expires_at`}))).optional(),headers:D(j(b(),b())).optional(),bearerToken:D(b()).optional(),githubInstallationId:D(b()).optional()}).transform(e=>k(e,{bearerToken:`bearer_token`,githubInstallationId:`github_installation_id`})),qa=x({read_only:D(C())}).transform(e=>k(e,{read_only:`readOnly`})),Ja=x({readOnly:D(C())}).transform(e=>k(e,{readOnly:`read_only`})),Ya={And:`and`,Or:`or`},Xa=w(Ya),Za=m(Ya),Qa=x({type:Xa,expressions:S(p([v(()=>Qa),qa,S(b())]))}),$a=x({type:Za,expressions:S(p([v(()=>$a),Ja,S(b())]))});p([v(()=>Qa),qa,S(b())]),p([v(()=>$a),Ja,S(b())]),p([Qa,qa,S(b())]),p([$a,Ja,S(b())]),p([Qa,qa,S(b())]),p([$a,Ja,S(b())]);var eo=x({requires_confirmation:D(p([Qa,qa,S(b())])).optional(),skip_confirmation:D(p([Qa,qa,S(b())])).optional(),include:D(S(b())).optional(),exclude:D(S(b())).optional()}).transform(e=>k(e,{requires_confirmation:`requiresConfirmation`,skip_confirmation:`skipConfirmation`})),to=x({requiresConfirmation:D(p([$a,Ja,S(b())])).optional(),skipConfirmation:D(p([$a,Ja,S(b())])).optional(),include:D(S(b())).optional(),exclude:D(S(b())).optional()}).transform(e=>k(e,{requiresConfirmation:`requires_confirmation`,skipConfirmation:`skip_confirmation`})),no=x({name:b(),tool_configuration:eo,is_default:D(C()).optional(),consumer_type:D(oi).optional()}).transform(e=>k(e,{tool_configuration:`toolConfiguration`,is_default:`isDefault`,consumer_type:`consumerType`})),ro=x({name:j(b(),b()),description:j(b(),b()),usage_sentence:j(b(),b())}).transform(e=>k(e,{usage_sentence:`usageSentence`})),io=w({Mcp:`mcp`,Http:`http`,Turbine:`turbine`}),ao=x({name:j(b(),b()),description:j(b(),b()),usage_sentence:j(b(),b())}).transform(e=>k(e,{usage_sentence:`usageSentence`})),oo=x({type:b()}).catchall(y()),so={SharedGlobal:`shared_global`,SharedOrg:`shared_org`,SharedWorkspace:`shared_workspace`,Private:`private`},co=w(so),lo=m(so),uo=x({id:b(),name:b(),description:b(),system_prompt:D(b()).optional(),locale:D(ao).optional(),jsonschema:D(j(b(),y())).optional(),execution_config:D(oo),visibility:co,created_at:O({offset:!0}).transform(e=>new Date(e)),modified_at:O({offset:!0}).transform(e=>new Date(e)),active:D(C()).optional()}).transform(e=>k(e,{system_prompt:`systemPrompt`,execution_config:`executionConfig`,created_at:`createdAt`,modified_at:`modifiedAt`})),fo=x({src:b(),mimeType:D(b()).optional(),sizes:D(S(b())).optional()}).catchall(y()),po=x({name:b(),description:D(b()).optional(),required:D(C()).optional()}).catchall(y()),mo=x({name:b(),title:D(b()).optional(),description:D(b()).optional(),arguments:D(S(po)).optional(),icons:D(S(fo)).optional(),_meta:D(j(b(),y())).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),ho=x({name:b(),title:D(b()).optional(),uri:b(),description:D(b()).optional(),mimeType:D(b()).optional(),size:D(E()).optional(),icons:D(S(fo)).optional(),annotations:D(Yr).optional(),_meta:D(j(b(),y())).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),go=x({name:D(j(b(),b())).optional(),description:D(j(b(),b())).optional(),usage_sentence:D(j(b(),b())).optional(),working_description:D(j(b(),b())).optional(),done_description:D(j(b(),b())).optional()}).transform(e=>k(e,{usage_sentence:`usageSentence`,working_description:`workingDescription`,done_description:`doneDescription`})),_o=x({"ai.mistral/turbine":D(x({system_prompt_name:D(b()).optional(),locale:D(go).optional()}).transform(e=>k(e,{system_prompt_name:`systemPromptName`}))).optional()}).catchall(y()).transform(e=>k(e,{"ai.mistral/turbine":`aiMistralTurbine`})),vo=w({Model:`model`,App:`app`}),yo=x({resourceUri:D(b()).optional(),visibility:D(S(vo)).optional()}).catchall(y()),bo=w({Rag:`rag`,Image:`image`,Code:`code`,Event:`event`}),xo=x({locale:D(x({name:D(j(b(),b())).optional(),description:D(j(b(),b())).optional(),usage_sentence:D(j(b(),b())).optional(),working_description:D(j(b(),b())).optional(),done_description:D(j(b(),b())).optional()}).transform(e=>k(e,{usage_sentence:`usageSentence`,working_description:`workingDescription`,done_description:`doneDescription`}))).optional(),tool_type:D(bo).optional(),timeout:D(_()).optional(),private_execution:D(C()).optional()}).transform(e=>k(e,{tool_type:`toolType`,private_execution:`privateExecution`})),So=x({ui:D(yo).optional(),"ai.mistral/turbine":D(xo).optional()}).catchall(y()).transform(e=>k(e,{"ai.mistral/turbine":`aiMistralTurbine`})),Co=x({title:D(b()).optional(),readOnlyHint:D(C()).optional(),destructiveHint:D(C()).optional(),idempotentHint:D(C()).optional(),openWorldHint:D(C()).optional()}).catchall(y()),wo=x({taskSupport:D(w({Forbidden:`forbidden`,Optional:`optional`,Required:`required`})).optional()}).catchall(y()),To=x({name:b(),title:D(b()).optional(),description:D(b()).optional(),inputSchema:j(b(),y()),outputSchema:D(j(b(),y())).optional(),icons:D(S(fo)).optional(),annotations:D(Co).optional(),_meta:D(So).optional(),execution:D(wo).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),Eo=x({required:C(),schemes:S(b()).optional()}),Do=x({name:b(),description:b(),isRequired:D(C()).optional(),isSecret:D(C()).optional(),default:D(b()).optional(),choices:D(S(b())).optional()}),Oo=x({type:w({StreamableHttp:`streamable-http`,Sse:`sse`}),url:b(),supportedProtocolVersions:D(S(b())).optional(),headers:D(S(Do)).optional(),authentication:D(Eo).optional()}),ko=x({url:b(),source:b(),subfolder:D(b()).optional()}),Ao=x({listChanged:D(C()).optional()}).catchall(y()),jo=x({subscribe:D(C()).optional(),listChanged:D(C()).optional()}).catchall(y()),Mo=x({tools:D(x({call:D(j(b(),y())).optional()}).catchall(y())).optional()}).catchall(y()),No=x({list:D(j(b(),y())).optional(),cancel:D(j(b(),y())).optional(),requests:D(Mo).optional()}).catchall(y()),Po=x({listChanged:D(C()).optional()}).catchall(y()),Fo=x({experimental:D(j(b(),j(b(),y()))).optional(),logging:D(j(b(),y())).optional(),prompts:D(Ao).optional(),resources:D(jo).optional(),tools:D(Po).optional(),completions:D(j(b(),y())).optional(),tasks:D(No).optional()}).catchall(y());p([b(),S(ho)]),p([b(),S(To)]),p([b(),S(mo)]);var Io=x({$schema:D(b()).optional(),name:b(),version:b(),capabilities:Fo.optional(),title:D(b()).optional(),description:D(b()).optional(),websiteUrl:D(b()).optional(),repository:D(ko).optional(),icons:D(S(fo)).optional(),remotes:D(S(Oo)).optional(),requires:D(Pa).optional(),resources:D(p([b(),S(ho)])).optional(),tools:D(p([b(),S(To)])).optional(),prompts:D(p([b(),S(mo)])).optional(),_meta:D(_o).optional()}).catchall(y()).transform(e=>k(e,{$schema:`dollarSchema`,_meta:`meta`})),Lo=x({method_type:di,headers:D(S(x({name:b(),is_required:C().default(!0),is_secret:C().default(!0)}).transform(e=>k(e,{is_required:`isRequired`,is_secret:`isSecret`})))).optional(),has_default_credentials:C()}).transform(e=>k(e,{method_type:`methodType`,has_default_credentials:`hasDefaultCredentials`})),Ro=x({type:Ga.optional(),base_url:D(b()).optional(),headers:D(j(b(),b())).optional(),signed:D(C()).optional()}).transform(e=>k(e,{base_url:`baseUrl`})),zo=h({One:1,Two:2,Three:3,Four:4}),Bo=x({id:b(),name:b(),title:D(b()).optional(),description:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),modified_at:O({offset:!0}).transform(e=>new Date(e)),server:D(b()).optional(),protocol:io.optional(),icon_url:D(b()).optional(),server_card:D(Io).optional(),owner_id:D(b()).optional(),owner_type:zo,visibility:co,locale:D(ro).optional(),system_prompt:D(b()).optional(),supported_auth_methods:D(S(Lo)).optional(),connection_preferences:D(S(no)).optional(),connection_credentials:D(S(pi)).optional(),active:D(C()).optional(),private_tool_execution:C(),mistral:C().default(!1),is_authenticated:D(C()).optional(),tools:D(S(uo)).optional(),system_prompt_route:D(b()).optional(),connection_config:D(Ro).optional()}).transform(e=>k(e,{created_at:`createdAt`,modified_at:`modifiedAt`,icon_url:`iconUrl`,server_card:`serverCard`,owner_id:`ownerId`,owner_type:`ownerType`,system_prompt:`systemPrompt`,supported_auth_methods:`supportedAuthMethods`,connection_preferences:`connectionPreferences`,connection_credentials:`connectionCredentials`,private_tool_execution:`privateToolExecution`,is_authenticated:`isAuthenticated`,system_prompt_route:`systemPromptRoute`,connection_config:`connectionConfig`})),Vo=x({arguments:j(b(),y()).optional()}),Ho=x({active:D(C()).optional()}),Uo=x({mcp_meta:D(x({isError:C().default(!1),structuredContent:D(j(b(),y())).optional(),_meta:D(j(b(),y())).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`}))).optional()}).catchall(y()).transform(e=>k(e,{mcp_meta:`mcpMeta`})),Wo=x({uri:b(),mimeType:D(b()).optional(),_meta:D(j(b(),y())).optional(),text:b()}).catchall(y()).transform(e=>k(e,{_meta:`meta`}));p([Wo,Mi]);var Go=x({type:T(`resource`),resource:p([Wo,Mi]),annotations:D(Yr).optional(),_meta:D(j(b(),y())).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),Ko=x({type:T(`image`),data:b(),mimeType:b(),annotations:D(Yr).optional(),_meta:D(j(b(),y())).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),qo=x({name:b(),title:D(b()).optional(),uri:b(),description:D(b()).optional(),mimeType:D(b()).optional(),size:D(E()).optional(),icons:D(S(fo)).optional(),annotations:D(Yr).optional(),_meta:D(j(b(),y())).optional(),type:T(`resource_link`)}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),Jo=x({type:T(`text`),text:b(),annotations:D(Yr).optional(),_meta:D(j(b(),y())).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`}));ke(`type`,{text:Jo,image:Ko,audio:Qr,resource_link:qo,resource:Go});var Yo=x({content:S(ke(`type`,{text:Jo,image:Ko,audio:Qr,resource_link:qo,resource:Go})),metadata:D(Uo).optional()}).catchall(y()),Xo=p([j(b(),y()),b()]),Zo=p([j(b(),y()),b()]),Qo={Pending:`pending`,Allowed:`allowed`,Denied:`denied`},$o=w(Qo),es=m(Qo),ts=x({object:T(`entry`).default(`entry`),type:T(`function.call`).default(`function.call`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),completed_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),agent_id:D(b()).optional(),model:D(b()).optional(),id:b().optional(),tool_call_id:b(),name:b(),arguments:Xo,confirmation_status:D($o).optional()}).transform(e=>k(e,{created_at:`createdAt`,completed_at:`completedAt`,agent_id:`agentId`,tool_call_id:`toolCallId`,confirmation_status:`confirmationStatus`})),ns=x({object:T(`entry`).default(`entry`),type:T(`function.call`).default(`function.call`),createdAt:f().transform(e=>e.toISOString()).optional(),completedAt:D(f().transform(e=>e.toISOString())).optional(),agentId:D(b()).optional(),model:D(b()).optional(),id:b().optional(),toolCallId:b(),name:b(),arguments:Zo,confirmationStatus:D(es).optional()}).transform(e=>k(e,{createdAt:`created_at`,completedAt:`completed_at`,agentId:`agent_id`,toolCallId:`tool_call_id`,confirmationStatus:`confirmation_status`})),rs=x({object:T(`entry`).default(`entry`),type:T(`function.result`).default(`function.result`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),completed_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),id:b().optional(),tool_call_id:b(),result:b()}).transform(e=>k(e,{created_at:`createdAt`,completed_at:`completedAt`,tool_call_id:`toolCallId`})),is=x({object:T(`entry`).default(`entry`),type:T(`function.result`).default(`function.result`),createdAt:f().transform(e=>e.toISOString()).optional(),completedAt:D(f().transform(e=>e.toISOString())).optional(),id:b().optional(),toolCallId:b(),result:b()}).transform(e=>k(e,{createdAt:`created_at`,completedAt:`completed_at`,toolCallId:`tool_call_id`}));p([ye,b()]),p([ge,b()]);var as=x({type:T(`tool_file`).default(`tool_file`),tool:p([ye,b()]),file_id:b(),file_name:D(b()).optional(),file_type:D(b()).optional()}).transform(e=>k(e,{file_id:`fileId`,file_name:`fileName`,file_type:`fileType`})),os=x({type:T(`tool_file`).default(`tool_file`),tool:p([ge,b()]),fileId:b(),fileName:D(b()).optional(),fileType:D(b()).optional()}).transform(e=>k(e,{fileId:`file_id`,fileName:`file_name`,fileType:`file_type`})),ss=p([as,he,Oe,Ae,De]),cs=p([os,ce,je,ae,fe]),ls={Assistant:`assistant`,User:`user`},us=w(ls),ds=m(ls);p([b(),S(ss)]),p([b(),S(cs)]);var fs=x({object:T(`entry`).default(`entry`),type:T(`message.input`).default(`message.input`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),completed_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),id:b().optional(),role:us,content:p([b(),S(ss)]),prefix:C().default(!1)}).transform(e=>k(e,{created_at:`createdAt`,completed_at:`completedAt`})),ps=x({object:T(`entry`).default(`entry`),type:T(`message.input`).default(`message.input`),createdAt:f().transform(e=>e.toISOString()).optional(),completedAt:D(f().transform(e=>e.toISOString())).optional(),id:b().optional(),role:ds,content:p([b(),S(cs)]),prefix:C().default(!1)}).transform(e=>k(e,{createdAt:`created_at`,completedAt:`completed_at`})),ms=p([as,me,he,Oe,Ae,De]),hs=p([os,Se,ce,je,ae,fe]);p([b(),S(ms)]),p([b(),S(hs)]);var gs=x({object:T(`entry`).default(`entry`),type:T(`message.output`).default(`message.output`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),completed_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),agent_id:D(b()).optional(),model:D(b()).optional(),id:b().optional(),role:T(`assistant`).default(`assistant`),content:p([b(),S(ms)])}).transform(e=>k(e,{created_at:`createdAt`,completed_at:`completedAt`,agent_id:`agentId`})),_s=x({object:T(`entry`).default(`entry`),type:T(`message.output`).default(`message.output`),createdAt:f().transform(e=>e.toISOString()).optional(),completedAt:D(f().transform(e=>e.toISOString())).optional(),agentId:D(b()).optional(),model:D(b()).optional(),id:b().optional(),role:T(`assistant`).default(`assistant`),content:p([b(),S(hs)])}).transform(e=>k(e,{createdAt:`created_at`,completedAt:`completed_at`,agentId:`agent_id`}));p([ye,b()]),p([ge,b()]);var vs=x({object:T(`entry`).default(`entry`),type:T(`tool.execution`).default(`tool.execution`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),completed_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),agent_id:D(b()).optional(),model:D(b()).optional(),id:b().optional(),name:p([ye,b()]),arguments:b(),info:j(b(),y()).optional()}).transform(e=>k(e,{created_at:`createdAt`,completed_at:`completedAt`,agent_id:`agentId`})),ys=p([Fr,ns,ps,is,x({object:T(`entry`).default(`entry`),type:T(`tool.execution`).default(`tool.execution`),createdAt:f().transform(e=>e.toISOString()).optional(),completedAt:D(f().transform(e=>e.toISOString())).optional(),agentId:D(b()).optional(),model:D(b()).optional(),id:b().optional(),name:p([ge,b()]),arguments:b(),info:j(b(),y()).optional()}).transform(e=>k(e,{createdAt:`created_at`,completedAt:`completed_at`,agentId:`agent_id`})),_s]),bs=p([b(),S(ys)]),xs=re({Allow:`allow`,Deny:`deny`}),Ss=x({toolCallId:b(),confirmation:xs}).transform(e=>k(e,{toolCallId:`tool_call_id`})),Cs=re({Client:`client`,Server:`server`}),ws=x({inputs:bs.optional(),stream:T(!1).default(!1),store:C().default(!0),handoffExecution:Cs.default(`server`),completionArgs:Qn.optional(),toolConfirmations:D(S(Ss)).optional()}).transform(e=>k(e,{handoffExecution:`handoff_execution`,completionArgs:`completion_args`,toolConfirmations:`tool_confirmations`})),Ts=re({Client:`client`,Server:`server`}),Es=x({inputs:bs.optional(),stream:T(!0).default(!0),store:C().default(!0),handoffExecution:Ts.default(`server`),completionArgs:Qn.optional(),toolConfirmations:D(S(Ss)).optional()}).transform(e=>k(e,{handoffExecution:`handoff_execution`,completionArgs:`completion_args`,toolConfirmations:`tool_confirmations`})),Ds=w({Pending:`pending`,Allowed:`allowed`,Denied:`denied`}),Os=x({type:T(`function.call.delta`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),output_index:E().default(0),id:b(),model:D(b()).optional(),agent_id:D(b()).optional(),name:b(),tool_call_id:b(),arguments:b(),confirmation_status:D(Ds).optional()}).transform(e=>k(e,{created_at:`createdAt`,output_index:`outputIndex`,agent_id:`agentId`,tool_call_id:`toolCallId`,confirmation_status:`confirmationStatus`})),ks=p([as,me,he,Oe,Ae,De]);p([b(),ks]);var As=x({type:T(`message.output.delta`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),output_index:E().default(0),id:b(),content_index:E().default(0),model:D(b()).optional(),agent_id:D(b()).optional(),role:T(`assistant`).default(`assistant`),content:p([b(),ks])}).transform(e=>k(e,{created_at:`createdAt`,output_index:`outputIndex`,content_index:`contentIndex`,agent_id:`agentId`})),js=x({prompt_tokens:E().default(0),completion_tokens:E().default(0),total_tokens:E().default(0),connector_tokens:D(E()).optional(),connectors:D(j(b(),E())).optional()}).transform(e=>k(e,{prompt_tokens:`promptTokens`,completion_tokens:`completionTokens`,total_tokens:`totalTokens`,connector_tokens:`connectorTokens`})),Ms=x({type:T(`conversation.response.done`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),usage:js}).transform(e=>k(e,{created_at:`createdAt`})),Ns=x({type:T(`conversation.response.error`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),message:b(),code:E()}).transform(e=>k(e,{created_at:`createdAt`})),Ps=x({type:T(`conversation.response.started`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),conversation_id:b()}).transform(e=>k(e,{created_at:`createdAt`,conversation_id:`conversationId`})),Fs=w({ConversationResponseStarted:`conversation.response.started`,ConversationResponseDone:`conversation.response.done`,ConversationResponseError:`conversation.response.error`,MessageOutputDelta:`message.output.delta`,ToolExecutionStarted:`tool.execution.started`,ToolExecutionDelta:`tool.execution.delta`,ToolExecutionDone:`tool.execution.done`,AgentHandoffStarted:`agent.handoff.started`,AgentHandoffDone:`agent.handoff.done`,FunctionCallDelta:`function.call.delta`});p([ye,b()]);var Is=x({type:T(`tool.execution.delta`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),output_index:E().default(0),id:b(),name:p([ye,b()]),arguments:b()}).transform(e=>k(e,{created_at:`createdAt`,output_index:`outputIndex`}));p([ye,b()]);var Ls=x({type:T(`tool.execution.done`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),output_index:E().default(0),id:b(),name:p([ye,b()]),info:j(b(),y()).optional()}).transform(e=>k(e,{created_at:`createdAt`,output_index:`outputIndex`}));p([ye,b()]);var Rs=x({type:T(`tool.execution.started`),created_at:O({offset:!0}).transform(e=>new Date(e)).optional(),output_index:E().default(0),id:b(),model:D(b()).optional(),agent_id:D(b()).optional(),name:p([ye,b()]),arguments:b()}).transform(e=>k(e,{created_at:`createdAt`,output_index:`outputIndex`,agent_id:`agentId`}));ke(`type`,{"agent.handoff.done":Nr,"agent.handoff.started":Ir,"conversation.response.done":Ms,"conversation.response.error":Ns,"conversation.response.started":Ps,"function.call.delta":Os,"message.output.delta":As,"tool.execution.delta":Is,"tool.execution.done":Ls,"tool.execution.started":Rs});var zs=x({event:Fs,data:b().transform((e,t)=>{try{return JSON.parse(e)}catch(n){return t.addIssue({input:e,code:`custom`,message:`malformed json: ${n}`}),pe}}).pipe(ke(`type`,{"agent.handoff.done":Nr,"agent.handoff.started":Ir,"conversation.response.done":Ms,"conversation.response.error":Ns,"conversation.response.started":Ps,"function.call.delta":Os,"message.output.delta":As,"tool.execution.delta":Is,"tool.execution.done":Ls,"tool.execution.started":Rs}))});p([Pr,ts,fs,rs,vs,gs]);var Bs=x({object:T(`conversation.history`).default(`conversation.history`),conversation_id:b(),entries:S(p([Pr,ts,fs,rs,vs,gs]))}).transform(e=>k(e,{conversation_id:`conversationId`})),Vs=p([fs,gs]),Hs=x({object:T(`conversation.messages`).default(`conversation.messages`),conversation_id:b(),messages:S(Vs)}).transform(e=>k(e,{conversation_id:`conversationId`})),Us=x({messages:S(j(b(),y()))}).catchall(y()),Ws=x({messages:S(j(b(),y()))}).catchall(y()),Gs=re({Client:`client`,Server:`server`});oe([Nn,ir,or,ur,Tr,kr,Dr]),p([b(),E()]);var Ks=x({inputs:bs,stream:T(!1).default(!1),store:D(C()).optional(),handoffExecution:D(Gs).optional(),instructions:D(b()).optional(),tools:D(S(oe([Nn,ir,or,ur,Tr,kr,Dr]))).optional(),completionArgs:D(Qn).optional(),guardrails:D(S(Cr)).optional(),name:D(b()).optional(),description:D(b()).optional(),metadata:D(j(b(),y())).optional(),agentId:D(b()).optional(),agentVersion:D(p([b(),E()])).optional(),model:D(b()).optional()}).transform(e=>k(e,{handoffExecution:`handoff_execution`,completionArgs:`completion_args`,agentId:`agent_id`,agentVersion:`agent_version`}));p([Pr,ts,vs,gs]);var qs=x({object:T(`conversation.response`).default(`conversation.response`),conversation_id:b(),outputs:S(p([Pr,ts,vs,gs])),usage:js,guardrails:D(S(j(b(),y()))).optional()}).transform(e=>k(e,{conversation_id:`conversationId`})),Js=re({Client:`client`,Server:`server`});p([b(),E()]);var Ys=x({inputs:bs.optional(),stream:T(!1).default(!1),store:C().default(!0),handoffExecution:Js.default(`server`),completionArgs:Qn.optional(),guardrails:D(S(Cr)).optional(),metadata:D(j(b(),y())).optional(),fromEntryId:b(),agentVersion:D(p([b(),E()])).optional()}).transform(e=>k(e,{handoffExecution:`handoff_execution`,completionArgs:`completion_args`,fromEntryId:`from_entry_id`,agentVersion:`agent_version`})),Xs=re({Client:`client`,Server:`server`});p([b(),E()]);var Zs=x({inputs:bs.optional(),stream:T(!0).default(!0),store:C().default(!0),handoffExecution:Xs.default(`server`),completionArgs:Qn.optional(),guardrails:D(S(Cr)).optional(),metadata:D(j(b(),y())).optional(),fromEntryId:b(),agentVersion:D(p([b(),E()])).optional()}).transform(e=>k(e,{handoffExecution:`handoff_execution`,completionArgs:`completion_args`,fromEntryId:`from_entry_id`,agentVersion:`agent_version`})),Qs=w({Explorer:`EXPLORER`,UploadedFile:`UPLOADED_FILE`,DirectInput:`DIRECT_INPUT`,Playground:`PLAYGROUND`}),$s=re({Client:`client`,Server:`server`});oe([Nn,ir,or,ur,Tr,kr,Dr]),p([b(),E()]);var ec=x({inputs:bs,stream:T(!0).default(!0),store:D(C()).optional(),handoffExecution:D($s).optional(),instructions:D(b()).optional(),tools:D(S(oe([Nn,ir,or,ur,Tr,kr,Dr]))).optional(),completionArgs:D(Qn).optional(),guardrails:D(S(Cr)).optional(),name:D(b()).optional(),description:D(b()).optional(),metadata:D(j(b(),y())).optional(),agentId:D(b()).optional(),agentVersion:D(p([b(),E()])).optional(),model:D(b()).optional()}).transform(e=>k(e,{handoffExecution:`handoff_execution`,completionArgs:`completion_args`,agentId:`agent_id`,agentVersion:`agent_version`}));oe([Nn,ir,or,ur,Tr,kr,Dr]);var tc=x({instructions:D(b()).optional(),tools:S(oe([Nn,ir,or,ur,Tr,kr,Dr])).optional(),completionArgs:Qn.optional(),guardrails:D(S(Cr)).optional(),model:b(),name:b(),description:D(b()).optional(),handoffs:D(S(b())).optional(),metadata:D(j(b(),y())).optional(),versionMessage:D(b()).optional()}).transform(e=>k(e,{completionArgs:`completion_args`,versionMessage:`version_message`})),nc=x({inputFiles:D(S(b())).optional(),requests:D(S(ji)).optional(),endpoint:Xr,model:D(b()).optional(),agentId:D(b()).optional(),metadata:D(j(b(),b())).optional(),timeoutHours:E().default(24)}).transform(e=>k(e,{inputFiles:`input_files`,agentId:`agent_id`,timeoutHours:`timeout_hours`})),rc=x({searchParams:Vi,judgeId:b(),name:b(),description:b(),maxNbEvents:E()}).transform(e=>k(e,{searchParams:`search_params`,judgeId:`judge_id`,maxNbEvents:`max_nb_events`})),ic=x({issuer:b(),authorizationEndpoint:b(),tokenEndpoint:b(),registrationEndpoint:D(b()).optional(),scopesSupported:D(S(b())).optional(),responseTypesSupported:S(b()).optional(),responseModesSupported:D(S(b())).optional(),grantTypesSupported:D(S(b())).optional(),tokenEndpointAuthMethodsSupported:D(S(b())).optional(),tokenEndpointAuthSigningAlgValuesSupported:D(S(b())).optional(),serviceDocumentation:D(b()).optional(),uiLocalesSupported:D(S(b())).optional(),opPolicyUri:D(b()).optional(),opTosUri:D(b()).optional(),revocationEndpoint:D(b()).optional(),revocationEndpointAuthMethodsSupported:D(S(b())).optional(),revocationEndpointAuthSigningAlgValuesSupported:D(S(b())).optional(),introspectionEndpoint:D(b()).optional(),introspectionEndpointAuthMethodsSupported:D(S(b())).optional(),introspectionEndpointAuthSigningAlgValuesSupported:D(S(b())).optional(),codeChallengeMethodsSupported:D(S(b())).optional(),clientIdMetadataDocumentSupported:D(C()).optional(),xResourceUrl:D(b()).optional()}).transform(e=>k(e,{authorizationEndpoint:`authorization_endpoint`,tokenEndpoint:`token_endpoint`,registrationEndpoint:`registration_endpoint`,scopesSupported:`scopes_supported`,responseTypesSupported:`response_types_supported`,responseModesSupported:`response_modes_supported`,grantTypesSupported:`grant_types_supported`,tokenEndpointAuthMethodsSupported:`token_endpoint_auth_methods_supported`,tokenEndpointAuthSigningAlgValuesSupported:`token_endpoint_auth_signing_alg_values_supported`,serviceDocumentation:`service_documentation`,uiLocalesSupported:`ui_locales_supported`,opPolicyUri:`op_policy_uri`,opTosUri:`op_tos_uri`,revocationEndpoint:`revocation_endpoint`,revocationEndpointAuthMethodsSupported:`revocation_endpoint_auth_methods_supported`,revocationEndpointAuthSigningAlgValuesSupported:`revocation_endpoint_auth_signing_alg_values_supported`,introspectionEndpoint:`introspection_endpoint`,introspectionEndpointAuthMethodsSupported:`introspection_endpoint_auth_methods_supported`,introspectionEndpointAuthSigningAlgValuesSupported:`introspection_endpoint_auth_signing_alg_values_supported`,codeChallengeMethodsSupported:`code_challenge_methods_supported`,clientIdMetadataDocumentSupported:`client_id_metadata_document_supported`,xResourceUrl:`x_resource_url`})),ac=x({protocol:T(`mcp`).default(`mcp`),name:b(),title:D(b()).optional(),description:b(),iconUrl:D(b()).optional(),visibility:lo.optional(),server:b(),headers:D(j(b(),y())).optional(),authData:D(ai).optional(),oauth2ServerMetadata:D(ic).optional(),oauth2ServerMetadataUrl:D(b()).optional(),systemPrompt:D(b()).optional()}).transform(e=>k(e,{iconUrl:`icon_url`,authData:`auth_data`,oauth2ServerMetadata:`oauth2_server_metadata`,oauth2ServerMetadataUrl:`oauth2_server_metadata_url`,systemPrompt:`system_prompt`})),oc=x({payload:Ws,properties:j(b(),y())}),sc=x({name:b(),description:b()}),cc={FineTune:`fine-tune`,Batch:`batch`,Ocr:`ocr`},lc=w(cc),uc=m(cc),dc=w({Workspace:`workspace`,User:`user`}),fc={Pretrain:`pretrain`,Instruct:`instruct`,BatchRequest:`batch_request`,BatchResult:`batch_result`,BatchError:`batch_error`},pc=w(fc),mc=m(fc),hc={Upload:`upload`,Repository:`repository`,Mistral:`mistral`},gc=w(hc),_c=m(hc),vc=x({id:b(),object:b(),bytes:E(),created_at:E(),filename:b(),purpose:lc,sample_type:pc,num_lines:D(E()).optional(),mimetype:D(b()).optional(),source:gc,signature:D(b()).optional(),expires_at:D(E()).optional(),visibility:D(dc).optional()}).transform(e=>k(e,{bytes:`sizeBytes`,created_at:`createdAt`,sample_type:`sampleType`,num_lines:`numLines`,expires_at:`expiresAt`})),yc=x({type:T(`github`),name:b(),owner:b(),ref:D(b()).optional(),weight:_().default(1),token:b()}),bc=re({Completion:`completion`,Classifier:`classifier`}),xc=x({fileId:b(),weight:_().default(1)}).transform(e=>k(e,{fileId:`file_id`})),Sc=x({type:T(`wandb`),project:b(),name:D(b()).optional(),apiKey:b(),runName:D(b()).optional()}).transform(e=>k(e,{apiKey:`api_key`,runName:`run_name`}));p([Ra,ya]);var Cc=x({model:b(),trainingFiles:S(xc).optional(),validationFiles:D(S(b())).optional(),suffix:D(b()).optional(),integrations:D(S(Sc)).optional(),autoStart:C().optional(),invalidSampleSkipPercentage:_().default(0),jobType:D(bc).optional(),hyperparameters:p([Ra,ya]),repositories:D(S(yc)).optional(),classifierTargets:D(S(Da)).optional()}).transform(e=>k(e,{trainingFiles:`training_files`,validationFiles:`validation_files`,autoStart:`auto_start`,invalidSampleSkipPercentage:`invalid_sample_skip_percentage`,jobType:`job_type`,classifierTargets:`classifier_targets`})),wc=x({name:b(),pipelineComposition:D(j(b(),b())).optional()}).transform(e=>k(e,{pipelineComposition:`pipeline_composition`}));oe([Gi,qi]);var Tc=x({name:b(),description:b(),modelName:b(),output:oe([Gi,qi]),instructions:b(),tools:S(b())}).transform(e=>k(e,{modelName:`model_name`})),Ec=re({User:`User`,Workspace:`Workspace`}),Dc=x({name:b(),description:D(b()).optional(),chunkSize:D(E()).optional(),ownerType:D(Ec).optional()}).transform(e=>k(e,{chunkSize:`chunk_size`,ownerType:`owner_type`})),Oc=x({name:b(),documentCount:D(E()).optional()}).transform(e=>k(e,{documentCount:`document_count`})),kc=x({type:T(`vespa`),k8sCluster:b(),k8sNamespace:b(),vespaInstanceName:b(),schemas:S(Oc)}).transform(e=>k(e,{k8sCluster:`k8s_cluster`,k8sNamespace:`k8s_namespace`,vespaInstanceName:`vespa_instance_name`})),Ac=re({Online:`online`,Offline:`offline`}),jc=x({name:b(),documentCount:D(E()).optional(),status:Ac.default(`offline`),index:kc}).transform(e=>k(e,{documentCount:`document_count`})),Mc=x({name:b(),isDefault:D(C()).optional(),credentials:D(Ka).optional()}).transform(e=>k(e,{isDefault:`is_default`})),Nc=x({credentials:S(pi),connector_preset_credentials_for_auth:S(di).optional()}).transform(e=>k(e,{connector_preset_credentials_for_auth:`connectorPresetCredentialsForAuth`})),Pc=x({custom_task_id:b(),custom_task_type:b(),reason:D(b()).optional()}).transform(e=>k(e,{custom_task_id:`customTaskId`,custom_task_type:`customTaskType`})),Fc=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`CUSTOM_TASK_CANCELED`).default(`CUSTOM_TASK_CANCELED`),attributes:Pc}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Ic=x({custom_task_id:b(),custom_task_type:b(),payload:bn}).transform(e=>k(e,{custom_task_id:`customTaskId`,custom_task_type:`customTaskType`})),Lc=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`CUSTOM_TASK_COMPLETED`).default(`CUSTOM_TASK_COMPLETED`),attributes:Ic}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Rc=x({custom_task_id:b(),custom_task_type:b(),failure:Cn}).transform(e=>k(e,{custom_task_id:`customTaskId`,custom_task_type:`customTaskType`})),zc=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`CUSTOM_TASK_FAILED`).default(`CUSTOM_TASK_FAILED`),attributes:Rc}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Bc=x({path:b(),value:y(),op:T(`add`)}),Vc=x({type:T(`__encrypted__`),value:b()});p([Vc,b()]);var Hc=p([S(ke(`op`,{add:Bc,append:x({path:b(),value:p([Vc,b()]),op:T(`append`)}),remove:x({path:b(),value:y(),op:T(`remove`)}),replace:x({path:b(),value:y(),op:T(`replace`)})})),b()]),Uc=x({type:T(`json_patch`),value:Hc,encoding_options:D(S(vn)).optional()}).transform(e=>k(e,{encoding_options:`encodingOptions`}));ke(`type`,{json:bn.and(x({type:T(`json`)})),json_patch:Uc});var Wc=x({custom_task_id:b(),custom_task_type:b(),payload:ke(`type`,{json:bn.and(x({type:T(`json`)})),json_patch:Uc})}).transform(e=>k(e,{custom_task_id:`customTaskId`,custom_task_type:`customTaskType`})),Gc=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`CUSTOM_TASK_IN_PROGRESS`).default(`CUSTOM_TASK_IN_PROGRESS`),attributes:Wc}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Kc=x({custom_task_id:b(),custom_task_type:b(),payload:bn.optional()}).transform(e=>k(e,{custom_task_id:`customTaskId`,custom_task_type:`customTaskType`})),qc=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`CUSTOM_TASK_STARTED`).default(`CUSTOM_TASK_STARTED`),attributes:Kc}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Jc=x({custom_task_id:b(),custom_task_type:b(),timeout_type:D(b()).optional()}).transform(e=>k(e,{custom_task_id:`customTaskId`,custom_task_type:`customTaskType`,timeout_type:`timeoutType`})),Yc=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`CUSTOM_TASK_TIMED_OUT`).default(`CUSTOM_TASK_TIMED_OUT`),attributes:Jc}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Xc=x({id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),deleted_at:D(O({offset:!0}).transform(e=>new Date(e))),name:b(),description:b(),owner_id:b(),workspace_id:b()}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,deleted_at:`deletedAt`,owner_id:`ownerId`,workspace_id:`workspaceId`})),Zc=x({id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),deleted_at:D(O({offset:!0}).transform(e=>new Date(e))),creator_id:b(),dataset_id:b(),workspace_id:b(),status:Si,progress:D(E()).optional(),message:D(b()).optional()}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,deleted_at:`deletedAt`,creator_id:`creatorId`,dataset_id:`datasetId`,workspace_id:`workspaceId`})),Qc=x({id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),deleted_at:D(O({offset:!0}).transform(e=>new Date(e))),name:b(),description:b(),owner_id:b(),workspace_id:b()}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,deleted_at:`deletedAt`,owner_id:`ownerId`,workspace_id:`workspaceId`})),$c=x({id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),deleted_at:D(O({offset:!0}).transform(e=>new Date(e))),dataset_id:b(),payload:Us,properties:j(b(),y()),source:Qs}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,deleted_at:`deletedAt`,dataset_id:`datasetId`})),el=x({id:b(),object:T(`batch`).default(`batch`),deleted:C().default(!0)}),tl=x({datasetRecordIds:S(b())}).transform(e=>k(e,{datasetRecordIds:`dataset_record_ids`})),nl=x({id:b(),object:b(),deleted:C()}),rl=x({id:b(),object:b().default(`model`),deleted:C().default(!0)}),il=x({location_type:w({Local:`local`,K8s:`k8s`}),k8s_cluster:D(b()).optional(),k8s_namespace:D(b()).optional()}).transform(e=>k(e,{location_type:`locationType`,k8s_cluster:`k8sCluster`,k8s_namespace:`k8sNamespace`})),al=x({name:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),is_active:C()}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,is_active:`isActive`})),ol=x({id:b(),name:b(),is_active:C(),is_hardened:C().default(!1),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),location:D(il).optional(),workers:S(al)}).transform(e=>k(e,{is_active:`isActive`,is_hardened:`isHardened`,created_at:`createdAt`,updated_at:`updatedAt`})),sl=x({deployments:S(x({id:b(),name:b(),is_active:C(),is_hardened:C().default(!1),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),location:D(il).optional()}).transform(e=>k(e,{is_active:`isActive`,is_hardened:`isHardened`,created_at:`createdAt`,updated_at:`updatedAt`}))),next_cursor:D(b()),workspace_id:b()}).transform(e=>k(e,{next_cursor:`nextCursor`,workspace_id:`workspaceId`})),cl=w({SelfManaged:`self_managed`,MissingContent:`missing_content`,Noop:`noop`,Done:`done`,Todo:`todo`,InProgress:`in_progress`,Error:`error`,WaitingForCapacity:`waiting_for_capacity`}),ll=x({id:b(),library_id:b(),hash:D(b()),mime_type:D(b()),extension:D(b()),size:D(E()),name:b(),summary:D(b()).optional(),created_at:O({offset:!0}).transform(e=>new Date(e)),last_processed_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),number_of_pages:D(E()).optional(),process_status:cl,uploaded_by_id:D(b()),uploaded_by_type:b(),tokens_processing_main_content:D(E()).optional(),tokens_processing_summary:D(E()).optional(),url:D(b()).optional(),attributes:D(j(b(),y())).optional(),expires_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),processing_status:b(),tokens_processing_total:E()}).transform(e=>k(e,{library_id:`libraryId`,mime_type:`mimeType`,created_at:`createdAt`,last_processed_at:`lastProcessedAt`,number_of_pages:`numberOfPages`,process_status:`processStatus`,uploaded_by_id:`uploadedById`,uploaded_by_type:`uploadedByType`,tokens_processing_main_content:`tokensProcessingMainContent`,tokens_processing_summary:`tokensProcessingSummary`,expires_at:`expiresAt`,processing_status:`processingStatus`,tokens_processing_total:`tokensProcessingTotal`})),ul=x({text:b()}),dl=re({Float:`float`,Int8:`int8`,Uint8:`uint8`,Binary:`binary`,Ubinary:`ubinary`}),fl=re({Float:`float`,Base64:`base64`});p([b(),S(b())]);var pl=x({model:b(),metadata:D(j(b(),y())).optional(),inputs:p([b(),S(b())]),outputDimension:D(E()).optional(),outputDtype:dl.optional(),encodingFormat:fl.optional()}).transform(e=>k(e,{inputs:`input`,outputDimension:`output_dimension`,outputDtype:`output_dtype`,encodingFormat:`encoding_format`})),ml=x({object:b().optional(),embedding:S(_()).optional(),index:E().optional()}),hl=x({id:b(),object:b(),model:b(),usage:Ce,data:S(ml)}),gl=m({User:`User`,Workspace:`Workspace`,Org:`Org`}),_l=w({Running:`RUNNING`,Completed:`COMPLETED`,Failed:`FAILED`}),vl=re({Database:`DATABASE`,Live:`LIVE`,Hybrid:`HYBRID`}),yl=w({Event:`EVENT`,EventProgress:`EVENT_PROGRESS`}),bl=x({timestamp:O({offset:!0}).transform(e=>new Date(e)),trace_id:b(),span_id:b(),severity_text:b(),body:b(),log_attributes:j(b(),b())}).transform(e=>k(e,{trace_id:`traceId`,span_id:`spanId`,severity_text:`severityText`,log_attributes:`logAttributes`})),xl=x({results:S(bl),next_cursor:D(b()).optional()}).transform(e=>k(e,{next_cursor:`nextCursor`})),Sl=x({file_url:b()}).transform(e=>k(e,{file_url:`fileUrl`})),Cl=x({results:S(ra).optional(),next:D(b()).optional(),cursor:D(b()).optional()}),wl=x({results:S(x({customer_id:b(),organization_id:b(),workspace_id:b(),user_id:b(),timestamp:O({offset:!0}).transform(e=>new Date(e)),trace_id:b(),span_id:b(),trace_flags:E(),severity_text:b(),severity_number:E(),service_name:b(),body:b(),event_name:b(),resource_schema_url:b(),resource_attributes:j(b(),b()),scope_schema_url:b(),scope_name:b(),scope_version:b(),scope_attributes:j(b(),b()),log_attributes:j(b(),b())}).transform(e=>k(e,{customer_id:`customerId`,organization_id:`organizationId`,workspace_id:`workspaceId`,user_id:`userId`,trace_id:`traceId`,span_id:`spanId`,trace_flags:`traceFlags`,severity_text:`severityText`,severity_number:`severityNumber`,service_name:`serviceName`,event_name:`eventName`,resource_schema_url:`resourceSchemaUrl`,resource_attributes:`resourceAttributes`,scope_schema_url:`scopeSchemaUrl`,scope_name:`scopeName`,scope_version:`scopeVersion`,scope_attributes:`scopeAttributes`,log_attributes:`logAttributes`}))).optional(),next:D(b()).optional(),cursor:D(b()).optional()}),Tl=w({Error:`Error`,Ok:`Ok`,Unset:`Unset`}),El=x({customer_id:b(),organization_id:b(),workspace_id:b(),user_id:b(),trace_id:b(),span_id:b(),parent_span_id:b(),trace_state:b(),start_time:O({offset:!0}).transform(e=>new Date(e)),end_time:O({offset:!0}).transform(e=>new Date(e)),duration_ns:E(),span_name:b(),span_kind:b(),service_name:b(),status_code:Tl,status_message:b(),error_type:b(),operation_name:b(),provider_name:b(),request_model:b(),response_model:b(),response_id:b(),output_type:b(),conversation_id:b(),data_source_id:b(),agent_id:b(),agent_name:b(),agent_version:b(),agent_description:b(),workflow_name:b(),prompt_name:b(),tool_name:b(),tool_type:b(),tool_call_id:b(),input_messages:b(),output_messages:b(),system_instructions:b(),tool_definitions:b(),tool_call_arguments:b(),tool_call_result:b(),request_choice_count:E(),request_max_tokens:E(),request_temperature:D(_()),request_top_p:D(_()),request_top_k:D(_()),request_presence_penalty:D(_()),request_frequency_penalty:D(_()),request_seed:E(),request_stop_sequences:S(b()),request_encoding_formats:S(b()),response_finish_reasons:S(b()),usage_input_tokens:E(),usage_output_tokens:E(),usage_cache_read_input_tokens:E(),usage_cache_creation_input_tokens:E(),resource_attributes:j(b(),b()),span_attributes:j(b(),b()),scope_name:b(),scope_version:b()}).transform(e=>k(e,{customer_id:`customerId`,organization_id:`organizationId`,workspace_id:`workspaceId`,user_id:`userId`,trace_id:`traceId`,span_id:`spanId`,parent_span_id:`parentSpanId`,trace_state:`traceState`,start_time:`startTime`,end_time:`endTime`,duration_ns:`durationNs`,span_name:`spanName`,span_kind:`spanKind`,service_name:`serviceName`,status_code:`statusCode`,status_message:`statusMessage`,error_type:`errorType`,operation_name:`operationName`,provider_name:`providerName`,request_model:`requestModel`,response_model:`responseModel`,response_id:`responseId`,output_type:`outputType`,conversation_id:`conversationId`,data_source_id:`dataSourceId`,agent_id:`agentId`,agent_name:`agentName`,agent_version:`agentVersion`,agent_description:`agentDescription`,workflow_name:`workflowName`,prompt_name:`promptName`,tool_name:`toolName`,tool_type:`toolType`,tool_call_id:`toolCallId`,input_messages:`inputMessages`,output_messages:`outputMessages`,system_instructions:`systemInstructions`,tool_definitions:`toolDefinitions`,tool_call_arguments:`toolCallArguments`,tool_call_result:`toolCallResult`,request_choice_count:`requestChoiceCount`,request_max_tokens:`requestMaxTokens`,request_temperature:`requestTemperature`,request_top_p:`requestTopP`,request_top_k:`requestTopK`,request_presence_penalty:`requestPresencePenalty`,request_frequency_penalty:`requestFrequencyPenalty`,request_seed:`requestSeed`,request_stop_sequences:`requestStopSequences`,request_encoding_formats:`requestEncodingFormats`,response_finish_reasons:`responseFinishReasons`,usage_input_tokens:`usageInputTokens`,usage_output_tokens:`usageOutputTokens`,usage_cache_read_input_tokens:`usageCacheReadInputTokens`,usage_cache_creation_input_tokens:`usageCacheCreationInputTokens`,resource_attributes:`resourceAttributes`,span_attributes:`spanAttributes`,scope_name:`scopeName`,scope_version:`scopeVersion`})),Dl=x({results:S(El).optional(),next:D(b()).optional(),cursor:D(b()).optional()}),Ol=x({results:S(x({customer_id:b(),organization_id:b(),workspace_id:b(),user_id:b(),trace_id:b(),span_id:b(),response_id:b(),conversation_id:b(),timestamp:O({offset:!0}).transform(e=>new Date(e)),evaluation_name:b(),score_value:_(),score_label:b(),explanation:b(),metadata:j(b(),b())}).transform(e=>k(e,{customer_id:`customerId`,organization_id:`organizationId`,workspace_id:`workspaceId`,user_id:`userId`,trace_id:`traceId`,span_id:`spanId`,response_id:`responseId`,conversation_id:`conversationId`,evaluation_name:`evaluationName`,score_value:`scoreValue`,score_label:`scoreLabel`}))).optional(),next:D(b()).optional(),cursor:D(b()).optional()}),kl=w({Error:`Error`,Unset:`Unset`}),Al=x({customer_id:b(),organization_id:b(),workspace_id:b(),user_id:b(),trace_id:b(),root_span_id:b(),root_span_name:b(),start_time:O({offset:!0}).transform(e=>new Date(e)),end_time:O({offset:!0}).transform(e=>new Date(e)),duration_ns:E(),service_name:b(),environment:b(),conversation_id:b(),workflow_name:b(),agent_id:b(),agent_name:b(),status_code:kl,error_count:E(),span_count:E(),gen_ai_span_count:E(),llm_call_count:E(),tool_call_count:E(),retrieval_count:E(),evaluation_count:E(),input_tokens:E(),output_tokens:E(),cache_read_input_tokens:E(),cache_creation_input_tokens:E(),models_used:S(b()),tools_used:S(b()),first_turn_last_input_message:b(),first_turn_last_output_message:b(),last_turn_last_input_message:b(),last_turn_last_output_message:b()}).transform(e=>k(e,{customer_id:`customerId`,organization_id:`organizationId`,workspace_id:`workspaceId`,user_id:`userId`,trace_id:`traceId`,root_span_id:`rootSpanId`,root_span_name:`rootSpanName`,start_time:`startTime`,end_time:`endTime`,duration_ns:`durationNs`,service_name:`serviceName`,conversation_id:`conversationId`,workflow_name:`workflowName`,agent_id:`agentId`,agent_name:`agentName`,status_code:`statusCode`,error_count:`errorCount`,span_count:`spanCount`,gen_ai_span_count:`genAiSpanCount`,llm_call_count:`llmCallCount`,tool_call_count:`toolCallCount`,retrieval_count:`retrievalCount`,evaluation_count:`evaluationCount`,input_tokens:`inputTokens`,output_tokens:`outputTokens`,cache_read_input_tokens:`cacheReadInputTokens`,cache_creation_input_tokens:`cacheCreationInputTokens`,models_used:`modelsUsed`,tools_used:`toolsUsed`,first_turn_last_input_message:`firstTurnLastInputMessage`,first_turn_last_output_message:`firstTurnLastOutputMessage`,last_turn_last_input_message:`lastTurnLastInputMessage`,last_turn_last_output_message:`lastTurnLastOutputMessage`})),jl=x({results:S(Al).optional(),next:D(b()).optional(),cursor:D(b()).optional()}),Ml=x({status:Si});p([b(),C()]);var Nl=x({options:D(S(D(p([b(),C()])))).optional()}),Pl=x({filterParams:D(Vi).optional()}).transform(e=>k(e,{filterParams:`filter_params`})),Fl=x({counts:S(x({value:b(),count:E()}))}),Il=x({name:b(),label:b()}),Ll=x({id:b(),object:b(),bytes:E(),created_at:E(),filename:b(),purpose:lc,sample_type:pc,num_lines:D(E()).optional(),mimetype:D(b()).optional(),source:gc,signature:D(b()).optional(),expires_at:D(E()).optional(),visibility:D(dc).optional()}).transform(e=>k(e,{bytes:`sizeBytes`,created_at:`createdAt`,sample_type:`sampleType`,num_lines:`numLines`,expires_at:`expiresAt`}));p([b(),S(b())]);var Rl=x({model:b(),temperature:D(_()).optional(),topP:D(_()).optional(),maxTokens:D(E()).optional(),stream:C().default(!1),stop:D(p([b(),S(b())])).optional(),randomSeed:D(E()).optional(),metadata:D(j(b(),y())).optional(),prompt:b(),suffix:D(b()).optional(),minTokens:D(E()).optional(),promptCacheKey:D(b()).optional()}).transform(e=>k(e,{topP:`top_p`,maxTokens:`max_tokens`,randomSeed:`random_seed`,minTokens:`min_tokens`,promptCacheKey:`prompt_cache_key`})),zl=x({id:b(),object:b(),model:b(),usage:Ce,created:E(),choices:S(ea)});p([b(),S(b())]);var Bl=x({model:b(),temperature:D(_()).optional(),topP:D(_()).optional(),maxTokens:D(E()).optional(),stream:C().default(!0),stop:D(p([b(),S(b())])).optional(),randomSeed:D(E()).optional(),metadata:D(j(b(),y())).optional(),prompt:b(),suffix:D(b()).optional(),minTokens:D(E()).optional(),promptCacheKey:D(b()).optional()}).transform(e=>k(e,{topP:`top_p`,maxTokens:`max_tokens`,randomSeed:`random_seed`,minTokens:`min_tokens`,promptCacheKey:`prompt_cache_key`})),Vl=x({id:b(),object:b().default(`model`),created:E().optional(),owned_by:b().default(`mistralai`),capabilities:bi,name:D(b()).optional(),description:D(b()).optional(),max_context_length:E().default(32768),aliases:S(b()).optional(),deprecation:D(O({offset:!0}).transform(e=>new Date(e))).optional(),deprecation_replacement_model:D(b()).optional(),default_model_temperature:D(_()).optional(),type:T(`fine-tuned`),job:b(),root:b(),archived:C().default(!1)}).transform(e=>k(e,{owned_by:`ownedBy`,max_context_length:`maxContextLength`,deprecation_replacement_model:`deprecationReplacementModel`,default_model_temperature:`defaultModelTemperature`})),Hl=x({id:b(),object:b(),bytes:E(),created_at:E(),filename:b(),purpose:lc,sample_type:pc,num_lines:D(E()).optional(),mimetype:D(b()).optional(),source:gc,signature:D(b()).optional(),expires_at:D(E()).optional(),visibility:D(dc).optional(),deleted:C()}).transform(e=>k(e,{bytes:`sizeBytes`,created_at:`createdAt`,sample_type:`sampleType`,num_lines:`numLines`,expires_at:`expiresAt`})),Ul=x({options:D(S(b()))}),Wl={Enum:`ENUM`,Text:`TEXT`,Int:`INT`,Float:`FLOAT`,Bool:`BOOL`,Timestamp:`TIMESTAMP`,Array:`ARRAY`,Map:`MAP`},Gl={Eq:`eq`,Neq:`neq`,Lt:`lt`,Lte:`lte`,Gt:`gt`,Gte:`gte`,Like:`like`,Ilike:`ilike`,NotLike:`not_like`,NotIlike:`not_ilike`,Between:`between`,NotBetween:`not_between`,In:`in`,NotIn:`not_in`,Exists:`exists`,NotExists:`not_exists`,Regexp:`regexp`,NotRegexp:`not_regexp`,Contains:`contains`,NotContains:`not_contains`,Has:`has`,HasAny:`hasAny`,HasAll:`hasAll`,HasToken:`hasToken`},Kl=w(Wl),ql=w(Gl),Jl=x({name:b(),label:b(),type:Kl,group:D(b()).optional(),supported_operators:S(ql)}).transform(e=>k(e,{supported_operators:`supportedOperators`})),Yl=x({field_definitions:S(Jl)}).transform(e=>k(e,{field_definitions:`fieldDefinitions`})),Xl=x({logs:wl}),Zl=x({url:b()}),Ql=x({options:D(S(b()))}),$l=x({field_definitions:S(Jl)}).transform(e=>k(e,{field_definitions:`fieldDefinitions`})),eu=x({span_evaluations:Ol}).transform(e=>k(e,{span_evaluations:`spanEvaluations`})),tu=x({options:D(S(b()))}),nu=x({field_definitions:S(Jl)}).transform(e=>k(e,{field_definitions:`fieldDefinitions`})),ru=x({spans:Dl}),iu=x({options:D(S(b()))}),au=x({field_definitions:S(Jl)}).transform(e=>k(e,{field_definitions:`fieldDefinitions`})),ou=x({traces:jl}),su=x({campaignId:b()}).transform(e=>k(e,{campaignId:`campaign_id`})),cu=x({datasetRecordIds:S(b())}).transform(e=>k(e,{datasetRecordIds:`dataset_record_ids`})),lu=x({completionEventIds:S(b())}).transform(e=>k(e,{completionEventIds:`completion_event_ids`})),uu=x({fileId:b()}).transform(e=>k(e,{fileId:`file_id`})),du=x({conversationIds:S(b())}).transform(e=>k(e,{conversationIds:`conversation_ids`})),fu=x({id:b(),author_id:b(),name:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),modified_at:O({offset:!0}).transform(e=>new Date(e)),last_run_time:D(O({offset:!0}).transform(e=>new Date(e))),last_run_chunks_count:E(),total_chunks_count:E(),pipeline_composition:D(j(b(),b()))}).transform(e=>k(e,{author_id:`authorId`,created_at:`createdAt`,modified_at:`modifiedAt`,last_run_time:`lastRunTime`,last_run_chunks_count:`lastRunChunksCount`,total_chunks_count:`totalChunksCount`,pipeline_composition:`pipelineComposition`})),pu=x({judgeDefinition:Tc}).transform(e=>k(e,{judgeDefinition:`judge_definition`})),mu=x({messages:S(j(b(),y())),properties:D(j(b(),y())).optional()}),hu=x({judgeDefinition:Tc}).transform(e=>k(e,{judgeDefinition:`judge_definition`}));p([b(),_()]);var gu=x({analysis:b(),answer:p([b(),_()])}),_u=re({Regression:`REGRESSION`,Classification:`CLASSIFICATION`}),vu=x({expected_duration_seconds:D(E()).optional(),cost:D(_()).optional(),cost_currency:D(b()).optional(),train_tokens_per_step:D(E()).optional(),train_tokens:D(E()).optional(),data_tokens:D(E()).optional(),estimated_start_time:D(E()).optional(),deprecated:C().default(!0),details:b(),epochs:D(_()).optional(),training_steps:D(E()).optional(),object:T(`job.metadata`).default(`job.metadata`)}).transform(e=>k(e,{expected_duration_seconds:`expectedDurationSeconds`,cost_currency:`costCurrency`,train_tokens_per_step:`trainTokensPerStep`,train_tokens:`trainTokens`,data_tokens:`dataTokens`,estimated_start_time:`estimatedStartTime`,training_steps:`trainingSteps`})),yu=x({id:b(),name:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),owner_id:D(b()),owner_type:b(),total_size:E(),nb_documents:E(),chunk_size:D(E()),emoji:D(b()).optional(),description:D(b()).optional(),generated_description:D(b()).optional(),explicit_user_members_count:D(E()).optional(),explicit_workspace_members_count:D(E()).optional(),org_sharing_role:D(b()).optional(),generated_name:D(b()).optional()}).transform(e=>k(e,{created_at:`createdAt`,updated_at:`updatedAt`,owner_id:`ownerId`,owner_type:`ownerType`,total_size:`totalSize`,nb_documents:`nbDocuments`,chunk_size:`chunkSize`,generated_description:`generatedDescription`,explicit_user_members_count:`explicitUserMembersCount`,explicit_workspace_members_count:`explicitWorkspaceMembersCount`,org_sharing_role:`orgSharingRole`,generated_name:`generatedName`})),bu=x({data:S(Ai).optional(),object:T(`list`).default(`list`),total:E()}),xu=x({completion_events:x({results:S(ra).optional(),count:E(),next:D(b()).optional(),previous:D(b()).optional()})}).transform(e=>k(e,{completion_events:`completionEvents`})),Su=x({campaigns:x({results:S(Yi).optional(),count:E(),next:D(b()).optional(),previous:D(b()).optional()})}),Cu=x({field_definitions:S(yi),field_groups:S(Il)}).transform(e=>k(e,{field_definitions:`fieldDefinitions`,field_groups:`fieldGroups`})),wu=x({tasks:x({results:S(Zc).optional(),count:E(),next:D(b()).optional(),previous:D(b()).optional()})}),Tu=x({records:x({results:S($c).optional(),count:E(),next:D(b()).optional(),previous:D(b()).optional()})}),Eu=x({datasets:x({results:S(Qc).optional(),count:E(),next:D(b()).optional(),previous:D(b()).optional()})}),Du=x({total_items:E(),total_pages:E(),current_page:E(),page_size:E(),has_more:C()}).transform(e=>k(e,{total_items:`totalItems`,total_pages:`totalPages`,current_page:`currentPage`,page_size:`pageSize`,has_more:`hasMore`})),Ou=x({pagination:Du,data:S(ll)}),ku=x({data:S(Ll),object:b(),total:D(E()).optional()});ke(`job_type`,{classifier:Ca,completion:Va},{outputPropertyName:`jobType`});var Au=x({data:S(ke(`job_type`,{classifier:Ca,completion:Va},{outputPropertyName:`jobType`})).optional(),object:T(`list`).default(`list`),total:E()}),ju=x({judges:x({results:S(Ji).optional(),count:E(),next:D(b()).optional(),previous:D(b()).optional()})}),Mu=x({pagination:Du,data:S(yu)}),Nu=x({library_id:b(),user_id:D(b()).optional(),org_id:b(),role:b(),share_with_type:b(),share_with_uuid:D(b())}).transform(e=>k(e,{library_id:`libraryId`,user_id:`userId`,org_id:`orgId`,share_with_type:`shareWithType`,share_with_uuid:`shareWithUuid`})),Pu=x({data:S(Nu)}),Fu=x({task_id:b(),reason:D(b()).optional()}).transform(e=>k(e,{task_id:`taskId`})),Iu=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`WORKFLOW_EXECUTION_CANCELED`).default(`WORKFLOW_EXECUTION_CANCELED`),attributes:Fu}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Lu=x({task_id:b(),result:bn}).transform(e=>k(e,{task_id:`taskId`})),Ru=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`WORKFLOW_EXECUTION_COMPLETED`).default(`WORKFLOW_EXECUTION_COMPLETED`),attributes:Lu}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),zu=x({task_id:b(),new_execution_run_id:b(),workflow_name:b(),input:bn}).transform(e=>k(e,{task_id:`taskId`,new_execution_run_id:`newExecutionRunId`,workflow_name:`workflowName`})),Bu=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`WORKFLOW_EXECUTION_CONTINUED_AS_NEW`).default(`WORKFLOW_EXECUTION_CONTINUED_AS_NEW`),attributes:zu}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Vu=x({task_id:b(),failure:Cn}).transform(e=>k(e,{task_id:`taskId`})),Hu=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`WORKFLOW_EXECUTION_FAILED`).default(`WORKFLOW_EXECUTION_FAILED`),attributes:Vu}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Uu=x({task_id:b(),workflow_name:b(),display_name:D(b()).optional(),input:bn}).transform(e=>k(e,{task_id:`taskId`,workflow_name:`workflowName`,display_name:`displayName`})),Wu=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`WORKFLOW_EXECUTION_STARTED`).default(`WORKFLOW_EXECUTION_STARTED`),attributes:Uu}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),Gu=x({task_id:b(),failure:Cn}).transform(e=>k(e,{task_id:`taskId`})),Ku=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`WORKFLOW_TASK_FAILED`).default(`WORKFLOW_TASK_FAILED`),attributes:Gu}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`})),qu=x({task_id:b(),timeout_type:D(b()).optional()}).transform(e=>k(e,{task_id:`taskId`,timeout_type:`timeoutType`})),Ju=x({event_id:b(),event_timestamp:E(),root_workflow_exec_id:b(),parent_workflow_exec_id:D(b()),workflow_exec_id:b(),workflow_run_id:b(),workflow_name:b(),event_type:T(`WORKFLOW_TASK_TIMED_OUT`).default(`WORKFLOW_TASK_TIMED_OUT`),attributes:qu}).transform(e=>k(e,{event_id:`eventId`,event_timestamp:`eventTimestamp`,root_workflow_exec_id:`rootWorkflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,workflow_exec_id:`workflowExecId`,workflow_run_id:`workflowRunId`,workflow_name:`workflowName`,event_type:`eventType`}));p([Wu,Ru,Hu,Iu,Bu,Ju,Ku,qc,Gc,Lc,zc,Yc,Fc,kn,Sn,Dn,Tn]);var Yu=x({events:S(p([Wu,Ru,Hu,Iu,Bu,Ju,Ku,qc,Gc,Lc,zc,Yc,Fc,kn,Sn,Dn,Tn])),next_cursor:D(b()).optional()}).transform(e=>k(e,{next_cursor:`nextCursor`})),Xu=re({Asc:`asc`,Desc:`desc`}),Zu=x({searchExpression:D(b()).optional(),order:Xu.default(`desc`)}).transform(e=>k(e,{searchExpression:`search_expression`})),Qu=x({name:b(),title:D(b()).optional(),description:D(b()).optional(),inputSchema:j(b(),y()),outputSchema:D(j(b(),y())).optional(),icons:D(S(fo)).optional(),annotations:D(Co).optional(),_meta:D(So).optional(),execution:D(wo).optional()}).catchall(y()).transform(e=>k(e,{_meta:`meta`})),$u=x({message:b()}),ed=x({role:w({System:`system`,User:`user`,Assistant:`assistant`,Tool:`tool`}),total_tokens:D(E()).optional(),truncated:C().default(!1),usage_count:E().default(1)}).transform(e=>k(e,{total_tokens:`totalTokens`,usage_count:`usageCount`}));ke(`type`,{code_interpreter:Mn,connector:rr,document_library:ar,function:lr,image_generation:wr,web_search:Or,web_search_premium:Er});var td=x({instructions:D(b()).optional(),tools:S(ke(`type`,{code_interpreter:Mn,connector:rr,document_library:ar,function:lr,image_generation:wr,web_search:Or,web_search_premium:Er})).optional(),completion_args:Zn.optional(),guardrails:D(S(Sr)).optional(),name:D(b()).optional(),description:D(b()).optional(),metadata:D(j(b(),y())).optional(),object:T(`conversation`).default(`conversation`),id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),updated_at:O({offset:!0}).transform(e=>new Date(e)),model:b()}).transform(e=>k(e,{completion_args:`completionArgs`,created_at:`createdAt`,updated_at:`updatedAt`}));ke(`type`,{base:xi,"fine-tuned":Vl});var nd=x({object:b().default(`list`),data:S(ke(`type`,{base:xi,"fine-tuned":Vl})).optional()}),rd=x({categories:j(b(),C()).optional(),category_scores:j(b(),_()).optional()}).transform(e=>k(e,{category_scores:`categoryScores`})),id=x({id:b(),model:b(),results:S(rd)}),ad=x({b64payload:b(),encodingOptions:S(yn).optional(),empty:C().default(!1)}).transform(e=>k(e,{encodingOptions:`encoding_options`})),od=w({UnknownError:`UNKNOWN_ERROR`,ValidationError:`VALIDATION_ERROR`,AuthForbidden:`AUTH_FORBIDDEN`,AuthForbiddenNotWorkspaceAdmin:`AUTH_FORBIDDEN_NOT_WORKSPACE_ADMIN`,AuthForbiddenWorkspaceNotFound:`AUTH_FORBIDDEN_WORKSPACE_NOT_FOUND`,AuthForbiddenRoleNotFound:`AUTH_FORBIDDEN_ROLE_NOT_FOUND`,AuthUnauthorized:`AUTH_UNAUTHORIZED`,FeatureNotSupported:`FEATURE_NOT_SUPPORTED`,FieldsBadRequest:`FIELDS_BAD_REQUEST`,FieldsNotFound:`FIELDS_NOT_FOUND`,SearchNotFound:`SEARCH_NOT_FOUND`,SearchBadRequest:`SEARCH_BAD_REQUEST`,SearchServiceUnavailable:`SEARCH_SERVICE_UNAVAILABLE`,DatabaseError:`DATABASE_ERROR`,DatabaseTimeout:`DATABASE_TIMEOUT`,DatabaseUnavailable:`DATABASE_UNAVAILABLE`,DatabaseQueryError:`DATABASE_QUERY_ERROR`,SearchFilterToSqlConversionError:`SEARCH_FILTER_TO_SQL_CONVERSION_ERROR`,JudgeConversationFormatError:`JUDGE_CONVERSATION_FORMAT_ERROR`,JudgeMistralApiError:`JUDGE_MISTRAL_API_ERROR`,JudgeMistralApiTimeout:`JUDGE_MISTRAL_API_TIMEOUT`,JudgeNameAlreadyExists:`JUDGE_NAME_ALREADY_EXISTS`,JudgeNotFound:`JUDGE_NOT_FOUND`,JudgeAlreadyHasNewVersion:`JUDGE_ALREADY_HAS_NEW_VERSION`,JudgeUsedInCampaignCannotBeUpdated:`JUDGE_USED_IN_CAMPAIGN_CANNOT_BE_UPDATED`,JudgeDidNotChange:`JUDGE_DID_NOT_CHANGE`,CampaignNotFound:`CAMPAIGN_NOT_FOUND`,CampaignNoMatchingEvents:`CAMPAIGN_NO_MATCHING_EVENTS`,DatasetNotFound:`DATASET_NOT_FOUND`,DatasetTaskNotFound:`DATASET_TASK_NOT_FOUND`,DatasetRecordNotFound:`DATASET_RECORD_NOT_FOUND`,DatasetRecordFormatError:`DATASET_RECORD_FORMAT_ERROR`,AgentNotFound:`AGENT_NOT_FOUND`,AgentMistralApiError:`AGENT_MISTRAL_API_ERROR`,EvaluationNotFound:`EVALUATION_NOT_FOUND`,EvaluationCurrentlyRunning:`EVALUATION_CURRENTLY_RUNNING`,EvaluationRecordNotFound:`EVALUATION_RECORD_NOT_FOUND`,EvaluationRunNotFound:`EVALUATION_RUN_NOT_FOUND`,EvaluationRunTransitionIsInvalid:`EVALUATION_RUN_TRANSITION_IS_INVALID`,EvaluationRunTransitionIsRunningAlready:`EVALUATION_RUN_TRANSITION_IS_RUNNING_ALREADY`,EvaluationRunTransitionError:`EVALUATION_RUN_TRANSITION_ERROR`,TemplateError:`TEMPLATE_ERROR`,TemplateSyntaxError:`TEMPLATE_SYNTAX_ERROR`,ProjectNameAlreadyExists:`PROJECT_NAME_ALREADY_EXISTS`,EvaluationNameAlreadyExists:`EVALUATION_NAME_ALREADY_EXISTS`,TracesFilterQueryParseError:`TRACES_FILTER_QUERY_PARSE_ERROR`,TraceNotFound:`TRACE_NOT_FOUND`,SpanNotFound:`SPAN_NOT_FOUND`}),sd=x({message:b(),error_code:D(od)}).transform(e=>k(e,{error_code:`errorCode`})),cd=x({text:b(),confidence:_(),start_index:E()}).transform(e=>k(e,{start_index:`startIndex`})),ld=x({id:b(),top_left_x:D(E()),top_left_y:D(E()),bottom_right_x:D(E()),bottom_right_y:D(E()),image_base64:D(b()).optional(),image_annotation:D(b()).optional()}).transform(e=>k(e,{top_left_x:`topLeftX`,top_left_y:`topLeftY`,bottom_right_x:`bottomRightX`,bottom_right_y:`bottomRightY`,image_base64:`imageBase64`,image_annotation:`imageAnnotation`})),ud=x({word_confidence_scores:S(cd).optional(),average_page_confidence_score:_(),minimum_page_confidence_score:_()}).transform(e=>k(e,{word_confidence_scores:`wordConfidenceScores`,average_page_confidence_score:`averagePageConfidenceScore`,minimum_page_confidence_score:`minimumPageConfidenceScore`})),dd=x({dpi:E(),height:E(),width:E()}),fd=w({Markdown:`markdown`,Html:`html`}),pd=x({id:b(),content:b(),format:fd,word_confidence_scores:D(S(cd)).optional()}).transform(e=>k(e,{word_confidence_scores:`wordConfidenceScores`})),md=x({index:E(),markdown:b(),images:S(ld),tables:S(pd).optional(),hyperlinks:S(b()).optional(),header:D(b()).optional(),footer:D(b()).optional(),dimensions:D(dd),confidence_scores:D(ud).optional()}).transform(e=>k(e,{confidence_scores:`confidenceScores`})),hd={Markdown:`markdown`,Html:`html`},gd={Word:`word`,Page:`page`};p([ue,ae,je]),p([b(),S(E())]);var _d=re(hd),vd=re(gd),yd=x({model:D(b()),document:p([ue,ae,je]),pages:D(p([b(),S(E())])).optional(),includeImageBase64:D(C()).optional(),imageLimit:D(E()).optional(),imageMinSize:D(E()).optional(),bboxAnnotationFormat:D(qn).optional(),documentAnnotationFormat:D(qn).optional(),documentAnnotationPrompt:D(b()).optional(),tableFormat:D(_d).optional(),extractHeader:C().optional(),extractFooter:C().optional(),confidenceScoresGranularity:D(vd).optional()}).transform(e=>k(e,{includeImageBase64:`include_image_base64`,imageLimit:`image_limit`,imageMinSize:`image_min_size`,bboxAnnotationFormat:`bbox_annotation_format`,documentAnnotationFormat:`document_annotation_format`,documentAnnotationPrompt:`document_annotation_prompt`,tableFormat:`table_format`,extractHeader:`extract_header`,extractFooter:`extract_footer`,confidenceScoresGranularity:`confidence_scores_granularity`})),bd=x({pages_processed:E(),doc_size_bytes:D(E()).optional()}).transform(e=>k(e,{pages_processed:`pagesProcessed`,doc_size_bytes:`docSizeBytes`})),xd=x({pages:S(md),model:b(),document_annotation:D(b()).optional(),usage_info:bd}).transform(e=>k(e,{document_annotation:`documentAnnotation`,usage_info:`usageInfo`})),Sd=x({next_cursor:D(b()).optional(),page_size:E()}).transform(e=>k(e,{next_cursor:`nextCursor`,page_size:`pageSize`})),Cd=x({items:S(Bo),pagination:Sd}),wd=x({start:E(),end:E().default(0),step:E().default(0)}),Td=x({start:E(),end:E().default(0),step:E().default(0)}),Ed=x({second:S(wd).optional(),minute:S(wd).optional(),hour:S(wd).optional(),day_of_month:S(wd).optional(),month:S(wd).optional(),year:S(wd).optional(),day_of_week:S(wd).optional(),comment:D(b()).optional()}).transform(e=>k(e,{day_of_month:`dayOfMonth`,day_of_week:`dayOfWeek`})),Dd=x({second:S(Td).optional(),minute:S(Td).optional(),hour:S(Td).optional(),dayOfMonth:S(Td).optional(),month:S(Td).optional(),year:S(Td).optional(),dayOfWeek:S(Td).optional(),comment:D(b()).optional()}).transform(e=>k(e,{dayOfMonth:`day_of_month`,dayOfWeek:`day_of_week`})),Od=x({every:b(),offset:D(b()).optional()}),kd=x({every:b(),offset:D(b()).optional()}),Ad={One:1,Two:2,Three:3,Four:4,Five:5,Six:6},jd=h(Ad),Md=ne(Ad),Nd=x({catchup_window_seconds:E().default(31536e3),overlap:jd.optional(),pause_on_failure:C().default(!1)}).transform(e=>k(e,{catchup_window_seconds:`catchupWindowSeconds`,pause_on_failure:`pauseOnFailure`})),Pd=x({catchupWindowSeconds:E().default(31536e3),overlap:Md.optional(),pauseOnFailure:C().default(!1)}).transform(e=>k(e,{catchupWindowSeconds:`catchup_window_seconds`,pauseOnFailure:`pause_on_failure`})),Fd=x({input:y().optional(),calendars:S(Dd).optional(),intervals:S(kd).optional(),cronExpressions:S(b()).optional(),skip:S(Dd).optional(),startAt:D(f().transform(e=>e.toISOString())).optional(),endAt:D(f().transform(e=>e.toISOString())).optional(),jitter:D(b()).optional(),timeZoneName:D(b()).optional(),policy:Pd.optional(),maxExecutions:D(E()).optional()}).transform(e=>k(e,{cronExpressions:`cron_expressions`,startAt:`start_at`,endAt:`end_at`,timeZoneName:`time_zone_name`,maxExecutions:`max_executions`})),Id=x({document_id:b(),process_status:cl,processing_status:b()}).transform(e=>k(e,{document_id:`documentId`,process_status:`processStatus`,processing_status:`processingStatus`})),Ld=x({messages:S(ed).optional(),cached_tokens:E().default(0),audio_tokens:E().default(0)}).transform(e=>k(e,{cached_tokens:`cachedTokens`,audio_tokens:`audioTokens`})),Rd=x({name:b(),description:D(b()).optional(),input_schema:j(b(),y()),output_schema:D(j(b(),y())).optional()}).transform(e=>k(e,{input_schema:`inputSchema`,output_schema:`outputSchema`}));p([ad,j(b(),y())]);var zd=x({name:b(),input:D(p([ad,j(b(),y())])).optional()}),Bd=x({query_name:b(),result:y()}).transform(e=>k(e,{query_name:`queryName`})),Vd=re({Api:`api`,Playground:`playground`,AgentBuilderV1:`agent_builder_v1`}),Hd=x({eventId:E(),reason:D(b()).optional(),excludeSignals:C().default(!1),excludeUpdates:C().default(!1)}).transform(e=>k(e,{eventId:`event_id`,excludeSignals:`exclude_signals`,excludeUpdates:`exclude_updates`}));p([E(),_()]);var Ud=x({value:p([E(),_()])}),Wd=x({input:y(),calendars:S(Dd).optional(),intervals:S(kd).optional(),cronExpressions:S(b()).optional(),skip:S(Dd).optional(),startAt:D(f().transform(e=>e.toISOString())).optional(),endAt:D(f().transform(e=>e.toISOString())).optional(),jitter:D(b()).optional(),timeZoneName:D(b()).optional(),policy:Pd.optional(),maxExecutions:D(E()).optional(),scheduleId:D(b()).optional()}).transform(e=>k(e,{cronExpressions:`cron_expressions`,startAt:`start_at`,endAt:`end_at`,timeZoneName:`time_zone_name`,maxExecutions:`max_executions`,scheduleId:`schedule_id`})),Gd=x({scheduled_at:O({offset:!0}).transform(e=>new Date(e))}).transform(e=>k(e,{scheduled_at:`scheduledAt`})),Kd=x({scheduled_at:O({offset:!0}).transform(e=>new Date(e)),started_at:O({offset:!0}).transform(e=>new Date(e)),execution_id:b()}).transform(e=>k(e,{scheduled_at:`scheduledAt`,started_at:`startedAt`,execution_id:`executionId`})),qd=x({input:y(),calendars:S(Ed).optional(),intervals:S(Od).optional(),cron_expressions:S(b()).optional(),skip:S(Ed).optional(),start_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),end_at:D(O({offset:!0}).transform(e=>new Date(e))).optional(),jitter:D(b()).optional(),time_zone_name:D(b()).optional(),policy:Nd.optional(),schedule_id:b(),remaining_executions:D(E()).optional(),workflow_name:b(),paused:C(),note:D(b()).optional(),future_executions:S(Gd).optional(),recent_executions:S(Kd).optional()}).transform(e=>k(e,{cron_expressions:`cronExpressions`,start_at:`startAt`,end_at:`endAt`,time_zone_name:`timeZoneName`,schedule_id:`scheduleId`,remaining_executions:`remainingExecutions`,workflow_name:`workflowName`,future_executions:`futureExecutions`,recent_executions:`recentExecutions`})),Jd=x({searchParams:Vi,extraFields:D(S(b())).optional()}).transform(e=>k(e,{searchParams:`search_params`,extraFields:`extra_fields`})),Yd=x({completion_event_ids:S(b())}).transform(e=>k(e,{completion_event_ids:`completionEventIds`})),Xd=x({searchParams:Vi,extraFields:D(S(b())).optional()}).transform(e=>k(e,{searchParams:`search_params`,extraFields:`extra_fields`})),Zd=x({completion_events:Cl}).transform(e=>k(e,{completion_events:`completionEvents`})),Qd=x({name:b(),document_count:D(E())}).transform(e=>k(e,{document_count:`documentCount`})),$d=x({type:T(`vespa`),k8s_cluster:b(),k8s_namespace:b(),vespa_instance_name:b(),schemas:S(Qd)}).transform(e=>k(e,{k8s_cluster:`k8sCluster`,k8s_namespace:`k8sNamespace`,vespa_instance_name:`vespaInstanceName`})),ef=w({Online:`online`,Offline:`offline`}),tf=x({id:b(),name:b(),creator_id:b(),document_count:E(),status:ef,created_at:O({offset:!0}).transform(e=>new Date(e)),modified_at:O({offset:!0}).transform(e=>new Date(e)),index:$d}).transform(e=>k(e,{creator_id:`creatorId`,document_count:`documentCount`,created_at:`createdAt`,modified_at:`modifiedAt`})),nf=m({Viewer:`Viewer`,Editor:`Editor`}),rf=x({orgId:D(b()).optional(),shareWithUuid:b(),shareWithType:gl}).transform(e=>k(e,{orgId:`org_id`,shareWithUuid:`share_with_uuid`,shareWithType:`share_with_type`})),af=x({orgId:D(b()).optional(),level:nf,shareWithUuid:b(),shareWithType:gl}).transform(e=>k(e,{orgId:`org_id`,shareWithUuid:`share_with_uuid`,shareWithType:`share_with_type`})),of=x({name:b(),description:D(b()).optional(),input_schema:j(b(),y())}).transform(e=>k(e,{input_schema:`inputSchema`})),sf=x({b64payload:b(),encodingOptions:S(yn).optional(),empty:C().default(!1)}).catchall(y()).transform(e=>({...k(e,{encodingOptions:`encoding_options`})}));p([v(()=>sf),j(b(),y())]);var cf=x({name:b(),input:D(p([v(()=>sf),j(b(),y())])).optional()}),lf=x({message:b().default(`Signal accepted`)}),uf=x({searchExpression:D(b()).optional()}).transform(e=>k(e,{searchExpression:`search_expression`})),df=x({searchExpression:D(b()).optional()}).transform(e=>k(e,{searchExpression:`search_expression`})),ff=re({Pcm:`pcm`,Wav:`wav`,Mp3:`mp3`,Flac:`flac`,Opus:`opus`}),pf=x({model:D(b()).optional(),metadata:D(j(b(),y())).optional(),stream:C().default(!1),voiceId:D(b()).optional(),refAudio:D(b()).optional(),input:b(),responseFormat:ff.optional()}).catchall(y()).transform(e=>({...k(e,{voiceId:`voice_id`,refAudio:`ref_audio`,responseFormat:`response_format`})})),mf=x({type:T(`speech.audio.delta`),audio_data:b()}).transform(e=>k(e,{audio_data:`audioData`})),hf=x({prompt_audio_seconds:D(E()).optional(),prompt_tokens:E().default(0),total_tokens:E().default(0),completion_tokens:D(E()).optional(),request_count:D(E()).optional(),prompt_tokens_details:D(Ld).optional(),completion_tokens_details:D(Wa).optional(),prompt_token_details:D(Ld).optional(),num_cached_tokens:D(E()).optional()}).transform(e=>k(e,{prompt_audio_seconds:`promptAudioSeconds`,prompt_tokens:`promptTokens`,total_tokens:`totalTokens`,completion_tokens:`completionTokens`,request_count:`requestCount`,prompt_tokens_details:`promptTokensDetails`,completion_tokens_details:`completionTokensDetails`,prompt_token_details:`promptTokenDetails`,num_cached_tokens:`numCachedTokens`})),gf=x({type:T(`speech.audio.done`),usage:hf}),_f=w({SpeechAudioDelta:`speech.audio.delta`,SpeechAudioDone:`speech.audio.done`}),vf=x({error:b()}),yf=x({namespace:b(),workflow_name:b(),workflow_exec_id:b(),parent_workflow_exec_id:D(b()).optional(),root_workflow_exec_id:D(b()).optional()}).transform(e=>k(e,{workflow_name:`workflowName`,workflow_exec_id:`workflowExecId`,parent_workflow_exec_id:`parentWorkflowExecId`,root_workflow_exec_id:`rootWorkflowExecId`}));p([Wu,Ru,Hu,Iu,Bu,Ju,Ku,qc,Gc,Lc,zc,Yc,Fc,kn,Sn,Dn,Tn]);var bf=x({stream:b(),timestamp:O({offset:!0}).transform(e=>new Date(e)).optional(),data:p([Wu,Ru,Hu,Iu,Bu,Ju,Ku,qc,Gc,Lc,zc,Yc,Fc,kn,Sn,Dn,Tn]),workflow_context:yf,metadata:j(b(),y()).optional(),broker_sequence:E()}).transform(e=>k(e,{workflow_context:`workflowContext`,broker_sequence:`brokerSequence`})),xf=x({arrayValue:x({values:S(x({stringValue:D(b()).optional(),intValue:D(b()).optional(),boolValue:D(C()).optional()})).optional()})}),Sf=x({boolValue:C()}),Cf=x({intValue:b()}),wf=x({stringValue:b()});p([wf,Cf,Sf,xf]);var Tf=x({key:b(),value:p([wf,Cf,Sf,xf])}),Ef=x({attributes:S(Tf).optional()}),Df=x({name:b()}),Of=x({name:b(),timeUnixNano:b(),attributes:S(Tf).optional()}),kf=w({SpanKindInternal:`SPAN_KIND_INTERNAL`,SpanKindServer:`SPAN_KIND_SERVER`,SpanKindClient:`SPAN_KIND_CLIENT`}),Af=x({batches:S(x({resource:Ef,scopeSpans:S(x({scope:Df,spans:S(x({traceId:b(),spanId:b(),parentSpanId:D(b()).optional(),name:b(),kind:kf,startTimeUnixNano:b(),endTimeUnixNano:b(),attributes:S(Tf).optional(),events:S(Of).optional()})).optional()})).optional()})).optional()});p([E(),_()]),p([E(),p([E(),_()])]);var jf=x({value:S(S(p([E(),p([E(),_()])])))}),Mf=x({searchExpression:D(b()).optional()}).transform(e=>k(e,{searchExpression:`search_expression`})),Nf=x({type:T(`transcription_segment`).default(`transcription_segment`),text:b(),start:_(),end:_(),score:D(_()).optional(),speaker_id:D(b()).optional()}).catchall(y()).transform(e=>k(e,{speaker_id:`speakerId`})),Pf=x({type:T(`transcription_segment`).default(`transcription_segment`),text:b(),start:_(),end:_(),score:D(_()).optional(),speakerId:D(b()).optional()}).catchall(y()).transform(e=>({...k(e,{speakerId:`speaker_id`})})),Ff=x({model:b(),text:b(),segments:S(Nf).optional(),usage:Ce,language:D(b())}).catchall(y()),If=x({model:b(),text:b(),segments:S(Nf).optional(),usage:Ce,type:T(`transcription.done`),language:D(b())}).catchall(y());x({model:b(),text:b(),segments:S(Pf).optional(),usage:_e,type:T(`transcription.done`),language:D(b())}).catchall(y());var Lf=w({TranscriptionLanguage:`transcription.language`,TranscriptionSegment:`transcription.segment`,TranscriptionTextDelta:`transcription.text.delta`,TranscriptionDone:`transcription.done`}),Rf=x({type:T(`transcription.language`),audio_language:b()}).catchall(y()).transform(e=>k(e,{audio_language:`audioLanguage`}));x({type:T(`transcription.language`),audioLanguage:b()}).catchall(y()).transform(e=>({...k(e,{audioLanguage:`audio_language`})}));var zf=x({type:T(`transcription.segment`),text:b(),start:_(),end:_(),speaker_id:D(b()).optional()}).catchall(y()).transform(e=>k(e,{speaker_id:`speakerId`})),Bf=x({type:T(`transcription.text.delta`),text:b()}).catchall(y());x({type:T(`transcription.text.delta`),text:b()}).catchall(y()),ke(`type`,{"transcription.done":If,"transcription.language":Rf,"transcription.segment":zf,"transcription.text.delta":Bf});var Vf=x({event:Lf,data:b().transform((e,t)=>{try{return JSON.parse(e)}catch(n){return t.addIssue({input:e,code:`custom`,message:`malformed json: ${n}`}),pe}}).pipe(ke(`type`,{"transcription.done":If,"transcription.language":Rf,"transcription.segment":zf,"transcription.text.delta":Bf}))}),Hf=x({id:b(),object:T(`model`).default(`model`),archived:C().default(!1)});oe([Nn,ir,or,ur,Tr,kr,Dr]);var Uf=x({instructions:D(b()).optional(),tools:S(oe([Nn,ir,or,ur,Tr,kr,Dr])).optional(),completionArgs:Qn.optional(),guardrails:D(S(Cr)).optional(),model:D(b()).optional(),name:D(b()).optional(),description:D(b()).optional(),handoffs:D(S(b())).optional(),deploymentChat:D(C()).optional(),metadata:D(j(b(),y())).optional(),versionMessage:D(b()).optional()}).transform(e=>k(e,{completionArgs:`completion_args`,deploymentChat:`deployment_chat`,versionMessage:`version_message`})),Wf=x({title:D(b()).optional(),name:D(b()).optional(),description:D(b()).optional(),iconUrl:D(b()).optional(),systemPrompt:D(b()).optional(),connectionConfig:D(j(b(),y())).optional(),connectionSecrets:D(j(b(),y())).optional(),protocol:T(`mcp`).default(`mcp`),server:D(b()).optional(),headers:D(j(b(),y())).optional(),authData:D(ai).optional()}).transform(e=>k(e,{iconUrl:`icon_url`,systemPrompt:`system_prompt`,connectionConfig:`connection_config`,connectionSecrets:`connection_secrets`,authData:`auth_data`})),Gf=x({payload:Ws}),Kf=x({properties:j(b(),y())}),qf=x({name:D(b()).optional(),description:D(b()).optional()}),Jf=x({name:b(),description:D(b()).optional(),input_schema:j(b(),y()),output_schema:D(j(b(),y())).optional()}).transform(e=>k(e,{input_schema:`inputSchema`,output_schema:`outputSchema`}));p([C(),b(),E(),_(),f().transform(e=>e.toISOString()),S(b()),S(E()),S(_()),S(C())]);var Yf=x({name:b().optional(),attributes:D(j(b(),p([C(),b(),E(),_(),f().transform(e=>e.toISOString()),S(b()),S(E()),S(_()),S(C())]))).optional(),expiresAt:D(f().transform(e=>e.toISOString())).optional()}).transform(e=>k(e,{expiresAt:`expires_at`}));p([ad,j(b(),y())]);var Xf=x({name:b(),input:D(p([ad,j(b(),y())])).optional()});oe([Gi,qi]);var Zf=x({name:b(),description:b(),modelName:b(),output:oe([Gi,qi]),instructions:b(),tools:S(b())}).transform(e=>k(e,{modelName:`model_name`})),Qf=x({name:b().optional(),description:D(b()).optional()}),$f=x({name:D(b()).optional(),description:D(b()).optional()}),ep=x({executionTime:f().transform(e=>e.toISOString()),chunksCount:E()}).transform(e=>k(e,{executionTime:`execution_time`,chunksCount:`chunks_count`})),tp=x({update_name:b(),result:y()}).transform(e=>k(e,{update_name:`updateName`}));p([b(),E()]);var np=x({}),rp=x({loc:S(p([b(),E()])),msg:b(),type:b(),input:y().optional(),ctx:v(()=>np).optional()}),ip=x({name:b(),slug:D(b()).optional(),languages:S(b()).optional(),gender:D(b()).optional(),age:D(E()).optional(),tags:D(S(b())).optional(),color:D(b()).optional(),description:D(b()).optional(),retentionNotice:E().default(30),sampleAudio:b(),sampleFilename:D(b()).optional()}).transform(e=>k(e,{retentionNotice:`retention_notice`,sampleAudio:`sample_audio`,sampleFilename:`sample_filename`})),ap=x({name:b(),slug:D(b()).optional(),languages:S(b()).optional(),gender:D(b()).optional(),age:D(E()).optional(),tags:D(S(b())).optional(),color:D(b()).optional(),description:D(b()).optional(),retention_notice:E().default(30),id:b(),created_at:O({offset:!0}).transform(e=>new Date(e)),user_id:D(b()),trimmed_seconds:D(_()).optional()}).transform(e=>k(e,{retention_notice:`retentionNotice`,created_at:`createdAt`,user_id:`userId`,trimmed_seconds:`trimmedSeconds`})),op=x({items:S(ap),total:E(),page:E(),page_size:E(),total_pages:E()}).transform(e=>k(e,{page_size:`pageSize`,total_pages:`totalPages`})),sp=x({name:D(b()).optional(),languages:D(S(b())).optional(),gender:D(b()).optional(),age:D(E()).optional(),tags:D(S(b())).optional(),description:D(b()).optional()}),cp=re({Code:`code`}),lp=x({id:b(),name:b(),display_name:b(),type:cp,description:D(b()).optional(),customer_id:b(),workspace_id:b(),shared_namespace:D(b()).optional(),available_in_chat_assistant:C().default(!1),is_technical:C().default(!1),archived:C().default(!1),tags:S(b()).optional()}).transform(e=>k(e,{display_name:`displayName`,customer_id:`customerId`,workspace_id:`workspaceId`,shared_namespace:`sharedNamespace`,available_in_chat_assistant:`availableInChatAssistant`,is_technical:`isTechnical`})),up=x({workflow:lp}),dp=x({shared_namespace:D(b()).optional()}).transform(e=>k(e,{shared_namespace:`sharedNamespace`})),fp=x({id:b(),name:b(),display_name:b(),description:D(b()).optional(),metadata:dp.optional(),archived:C(),tags:S(b()).optional()}).transform(e=>k(e,{display_name:`displayName`})),pp=x({workflowIds:S(b())}).transform(e=>k(e,{workflowIds:`workflow_ids`})),mp=x({workflow_id:b(),workflow:D(lp).optional(),message:b()}).transform(e=>k(e,{workflow_id:`workflowId`})),hp=x({archived:S(lp),errored:S(mp).optional()}),gp=x({workflowIds:S(b())}).transform(e=>k(e,{workflowIds:`workflow_ids`})),_p=x({unarchived:S(lp),errored:S(mp).optional()}),vp=x({input_schema:j(b(),y()),output_schema:D(j(b(),y())).optional(),signals:S(of).optional(),queries:S(Rd).optional(),updates:S(Jf).optional(),enforce_determinism:C().default(!1),on_behalf_of:C().default(!1),execution_timeout:_().optional(),plugin_metadata:D(j(b(),y())).optional()}).transform(e=>k(e,{input_schema:`inputSchema`,output_schema:`outputSchema`,enforce_determinism:`enforceDeterminism`,on_behalf_of:`onBehalfOf`,execution_timeout:`executionTimeout`,plugin_metadata:`pluginMetadata`})),yp=re({WorkflowExecutionStarted:`WORKFLOW_EXECUTION_STARTED`,WorkflowExecutionCompleted:`WORKFLOW_EXECUTION_COMPLETED`,WorkflowExecutionFailed:`WORKFLOW_EXECUTION_FAILED`,WorkflowExecutionCanceled:`WORKFLOW_EXECUTION_CANCELED`,WorkflowExecutionContinuedAsNew:`WORKFLOW_EXECUTION_CONTINUED_AS_NEW`,WorkflowTaskTimedOut:`WORKFLOW_TASK_TIMED_OUT`,WorkflowTaskFailed:`WORKFLOW_TASK_FAILED`,CustomTaskStarted:`CUSTOM_TASK_STARTED`,CustomTaskInProgress:`CUSTOM_TASK_IN_PROGRESS`,CustomTaskCompleted:`CUSTOM_TASK_COMPLETED`,CustomTaskFailed:`CUSTOM_TASK_FAILED`,CustomTaskTimedOut:`CUSTOM_TASK_TIMED_OUT`,CustomTaskCanceled:`CUSTOM_TASK_CANCELED`,ActivityTaskStarted:`ACTIVITY_TASK_STARTED`,ActivityTaskCompleted:`ACTIVITY_TASK_COMPLETED`,ActivityTaskRetrying:`ACTIVITY_TASK_RETRYING`,ActivityTaskFailed:`ACTIVITY_TASK_FAILED`}),bp={Running:`RUNNING`,Completed:`COMPLETED`,Failed:`FAILED`,Canceled:`CANCELED`,Terminated:`TERMINATED`,ContinuedAsNew:`CONTINUED_AS_NEW`,TimedOut:`TIMED_OUT`,RetryingAfterError:`RETRYING_AFTER_ERROR`},xp=w(bp),Sp=m(bp),Cp=x({executions:S(x({workflow_name:b(),execution_id:b(),parent_execution_id:D(b()).optional(),root_execution_id:b(),run_id:D(b()).optional(),status:D(xp),start_time:O({offset:!0}).transform(e=>new Date(e)),end_time:D(O({offset:!0}).transform(e=>new Date(e))),total_duration_ms:D(E()).optional()}).transform(e=>k(e,{workflow_name:`workflowName`,execution_id:`executionId`,parent_execution_id:`parentExecutionId`,root_execution_id:`rootExecutionId`,run_id:`runId`,start_time:`startTime`,end_time:`endTime`,total_duration_ms:`totalDurationMs`}))),next_page_token:D(b()).optional()}).transform(e=>k(e,{next_page_token:`nextPageToken`})),wp=p([b(),E(),_(),C(),S(y())]),Tp=x({type:yl.optional(),name:b(),id:b(),timestamp_unix_nano:E(),attributes:j(b(),D(wp)),internal:C().default(!1),status:_l.optional(),start_time_unix_ms:E(),end_time_unix_ms:D(E()).optional(),error:D(b()).optional()}).transform(e=>k(e,{timestamp_unix_nano:`timestampUnixNano`,start_time_unix_ms:`startTimeUnixMs`,end_time_unix_ms:`endTimeUnixMs`})),Ep=x({executionId:D(b()).optional(),input:D(y()).optional(),waitForResult:C().default(!1),timeoutSeconds:D(_()).optional(),customTracingAttributes:D(j(b(),b())).optional(),extensions:D(j(b(),y())).optional(),taskQueue:D(b()).optional(),deploymentName:D(b()).optional()}).transform(e=>k(e,{executionId:`execution_id`,waitForResult:`wait_for_result`,timeoutSeconds:`timeout_seconds`,customTracingAttributes:`custom_tracing_attributes`,taskQueue:`task_queue`,deploymentName:`deployment_name`})),Dp=x({workflow_name:b(),execution_id:b(),parent_execution_id:D(b()).optional(),root_execution_id:b(),run_id:D(b()).optional(),status:D(xp),start_time:O({offset:!0}).transform(e=>new Date(e)),end_time:D(O({offset:!0}).transform(e=>new Date(e))),total_duration_ms:D(E()).optional(),result:D(y())}).transform(e=>k(e,{workflow_name:`workflowName`,execution_id:`executionId`,parent_execution_id:`parentExecutionId`,root_execution_id:`rootExecutionId`,run_id:`runId`,start_time:`startTime`,end_time:`endTime`,total_duration_ms:`totalDurationMs`})),Op=x({workflow_name:b(),execution_id:b(),result:y()}).transform(e=>k(e,{workflow_name:`workflowName`,execution_id:`executionId`})),kp=x({type:yl.optional(),name:b(),id:b(),timestamp_unix_nano:E(),attributes:j(b(),D(wp)),internal:C().default(!1)}).transform(e=>k(e,{timestamp_unix_nano:`timestampUnixNano`}));p([Tp,kp]);var Ap=x({workflow_name:b(),execution_id:b(),parent_execution_id:D(b()).optional(),root_execution_id:b(),run_id:D(b()).optional(),status:D(xp),start_time:O({offset:!0}).transform(e=>new Date(e)),end_time:D(O({offset:!0}).transform(e=>new Date(e))),total_duration_ms:D(E()).optional(),result:D(y()),events:S(p([Tp,kp])).optional()}).transform(e=>k(e,{workflow_name:`workflowName`,execution_id:`executionId`,parent_execution_id:`parentExecutionId`,root_execution_id:`rootExecutionId`,run_id:`runId`,start_time:`startTime`,end_time:`endTime`,total_duration_ms:`totalDurationMs`})),jp=x({workflow_name:b(),execution_id:b(),parent_execution_id:D(b()).optional(),root_execution_id:b(),run_id:D(b()).optional(),status:D(xp),start_time:O({offset:!0}).transform(e=>new Date(e)),end_time:D(O({offset:!0}).transform(e=>new Date(e))),total_duration_ms:D(E()).optional(),result:D(y()),data_source:b(),otel_trace_id:D(b()).optional(),otel_trace_data:D(Af).optional()}).transform(e=>k(e,{workflow_name:`workflowName`,execution_id:`executionId`,parent_execution_id:`parentExecutionId`,root_execution_id:`rootExecutionId`,run_id:`runId`,start_time:`startTime`,end_time:`endTime`,total_duration_ms:`totalDurationMs`,data_source:`dataSource`,otel_trace_id:`otelTraceId`,otel_trace_data:`otelTraceData`})),Mp=x({span_id:b(),name:b(),start_time_unix_nano:E(),end_time_unix_nano:D(E()),attributes:j(b(),D(wp)),events:S(kp),children:S(v(()=>Mp)).optional()}).transform(e=>k(e,{span_id:`spanId`,start_time_unix_nano:`startTimeUnixNano`,end_time_unix_nano:`endTimeUnixNano`})),Np=x({workflow_name:b(),execution_id:b(),parent_execution_id:D(b()).optional(),root_execution_id:b(),run_id:D(b()).optional(),status:D(xp),start_time:O({offset:!0}).transform(e=>new Date(e)),end_time:D(O({offset:!0}).transform(e=>new Date(e))),total_duration_ms:D(E()).optional(),result:D(y()),span_tree:D(Mp).optional()}).transform(e=>k(e,{workflow_name:`workflowName`,execution_id:`executionId`,parent_execution_id:`parentExecutionId`,root_execution_id:`rootExecutionId`,run_id:`runId`,start_time:`startTime`,end_time:`endTime`,total_duration_ms:`totalDurationMs`,span_tree:`spanTree`})),Pp=x({workflow:x({id:b(),name:b(),display_name:b(),type:cp,description:D(b()).optional(),customer_id:b(),workspace_id:b(),shared_namespace:D(b()).optional(),available_in_chat_assistant:C().default(!1),is_technical:C().default(!1),archived:C().default(!1),tags:S(b()).optional(),active:C()}).transform(e=>k(e,{display_name:`displayName`,customer_id:`customerId`,workspace_id:`workspaceId`,shared_namespace:`sharedNamespace`,available_in_chat_assistant:`availableInChatAssistant`,is_technical:`isTechnical`}))}),Fp=x({workflows:S(fp),next_cursor:D(b())}).transform(e=>k(e,{next_cursor:`nextCursor`})),Ip=x({execution_count:Ud,success_count:Ud,error_count:Ud,average_latency_ms:Ud,latency_over_time:jf,retry_rate:Ud}).transform(e=>k(e,{execution_count:`executionCount`,success_count:`successCount`,error_count:`errorCount`,average_latency_ms:`averageLatencyMs`,latency_over_time:`latencyOverTime`,retry_rate:`retryRate`})),Lp=x({id:b(),deployment_id:D(b()).optional(),task_queue:D(b()).optional(),definition:vp,workflow_id:b(),workflow:D(lp).optional(),compatible_with_chat_assistant:C().default(!1)}).transform(e=>k(e,{deployment_id:`deploymentId`,task_queue:`taskQueue`,workflow_id:`workflowId`,compatible_with_chat_assistant:`compatibleWithChatAssistant`})),Rp=x({id:b(),deployment_id:D(b()).optional(),task_queue:D(b()).optional(),definition:vp,workflow_id:b(),workflow:D(lp).optional(),compatible_with_chat_assistant:C().default(!1),active:C()}).transform(e=>k(e,{deployment_id:`deploymentId`,task_queue:`taskQueue`,workflow_id:`workflowId`,compatible_with_chat_assistant:`compatibleWithChatAssistant`})),zp=x({workflow_registration:Rp,workflow_version:Rp}).transform(e=>k(e,{workflow_registration:`workflowRegistration`,workflow_version:`workflowVersion`})),Bp=x({workflow_registrations:S(Lp),next_cursor:D(b()),workflow_versions:S(Lp)}).transform(e=>k(e,{workflow_registrations:`workflowRegistrations`,next_cursor:`nextCursor`,workflow_versions:`workflowVersions`})),Vp=x({schedules:S(qd),next_page_token:D(b()).optional()}).transform(e=>k(e,{next_page_token:`nextPageToken`})),Hp=x({note:D(b()).optional()}),Up=x({schedule:Wd,workflowRegistrationId:D(b()).optional(),workflowVersionId:D(b()).optional(),workflowIdentifier:D(b()).optional(),workflowTaskQueue:D(b()).optional(),scheduleId:D(b()).optional(),deploymentName:D(b()).optional()}).transform(e=>k(e,{workflowRegistrationId:`workflow_registration_id`,workflowVersionId:`workflow_version_id`,workflowIdentifier:`workflow_identifier`,workflowTaskQueue:`workflow_task_queue`,scheduleId:`schedule_id`,deploymentName:`deployment_name`})),Wp=x({schedule_id:b()}).transform(e=>k(e,{schedule_id:`scheduleId`})),Gp=x({overlap:D(Md).optional()}),Kp=x({schedule:Fd}),qp=x({workflow:lp}),Jp=x({displayName:D(b()).optional(),description:D(b()).optional(),availableInChatAssistant:D(C()).optional(),tags:D(S(b())).optional()}).transform(e=>k(e,{displayName:`display_name`,availableInChatAssistant:`available_in_chat_assistant`})),Yp=x({workflow:lp}),Xp=class extends tn{detail;data$;constructor(e,t){let n=`message`in e&&typeof e.message==`string`?e.message:`API error occurred: ${JSON.stringify(e)}`;super(n,t),this.data$=e,e.detail!=null&&(this.detail=e.detail),this.name=`HTTPValidationError`}},G=x({detail:S(rp).optional(),request$:Me(e=>e instanceof Request),response$:Me(e=>e instanceof Response),body$:b()}).transform(e=>new Xp(e,{request:e.request$,response:e.response$,body:e.body$})),Zp=class extends tn{detail;data$;constructor(e,t){let n=e.detail?.message||`API error occurred: ${JSON.stringify(e)}`;super(n,t),this.data$=e,this.detail=e.detail,this.name=`ObservabilityError`}},K=x({detail:sd,request$:Me(e=>e instanceof Request),response$:Me(e=>e instanceof Response),body$:b()}).transform(e=>new Zp(e,{request:e.request$,response:e.response$,body:e.body$})),q=class{#e;#t;[Symbol.toStringTag]=`APIPromise`;constructor(e){this.#e=e instanceof Promise?e:Promise.resolve(e),this.#t=e instanceof Promise?null:Promise.resolve(e[0])}#n(){return this.#t??=this.#e.then(([e])=>e)}then(e,t){return this.#e.then(e?([t])=>e(t):void 0,t)}catch(e){return this.#n().catch(e)}finally(e){return this.#n().finally(e)}$inspect(){return this.#e}};function Qp(e,t,n){return new q($p(e,t,n))}async function $p(e,t,n){let r=A(t,e=>qr.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/agents/completions`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_completion_v1_agents_completions_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,aa),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}var em=class extends ReadableStream{constructor(e,t,n){let r=e.getReader(),i=new Uint8Array,a={eventId:void 0},o=n?.dataRequired??!0;super({async pull(e){try{for(;;){let n=am(i);if(!n){let t=await r.read();if(t.done)return e.close();i=tm(i,t.value);continue}let s=i.slice(0,n.index);i=i.slice(n.index+n.length);let c=om(s,t,a,o);if(c&&!c.done)return e.enqueue(c.value);if(c?.done)return await r.cancel(`done`),e.close()}}catch(t){e.error(t),await r.cancel(t)}},cancel:e=>r.cancel(e)})}[Symbol.asyncIterator](){let e=ReadableStream.prototype[Symbol.asyncIterator];if(typeof e==`function`)return e.call(this);let t=this.getReader();return{next:async()=>{let e=await t.read();return e.done?(t.releaseLock(),{done:!0,value:void 0}):{done:!1,value:e.value}},throw:async e=>(await t.cancel(e),t.releaseLock(),{done:!0,value:void 0}),return:async()=>(await t.cancel(`done`),t.releaseLock(),{done:!0,value:void 0}),[Symbol.asyncIterator](){return this}}}};function tm(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}var nm=13,rm=10,im=[[nm,rm,nm,rm],[nm,rm,nm],[nm,rm,rm],[nm,nm,rm],[rm,nm,rm],[nm,nm],[rm,nm],[rm,rm]];function am(e){let t=e.length;for(let n=0;n<t;n++)if(!(e[n]!==nm&&e[n]!==rm))for(let r of im){if(n+r.length>t)continue;let i=!0;for(let t=0;t<r.length;t++)if(e[n+t]!==r[t]){i=!1;break}if(i)return{index:n,length:r.length}}return null}function om(e,t,n,r){let i=new TextDecoder().decode(e).split(/\r\n|\r|\n/),a=[],o={},s=!0;for(let e of i){if(!e||e.startsWith(`:`))continue;s=!1;let t=e.indexOf(`:`),r=e,i=``;t>0&&(r=e.slice(0,t),i=e[t+1]===` `?e.slice(t+2):e.slice(t+1)),r===`data`?a.push(i):r===`event`?o.event=i:r===`id`&&!i.includes(`\0`)?n.eventId=i:r===`retry`&&/^\d+$/.test(i)&&(o.retry=Number(i))}if(!s){if(o.id=n.eventId,a.length)o.data=a.join(`
|
|
4
4
|
`);else if(r)return;return t(o)}}function sm(e,t,n){return new q(cm(e,t,n))}async function cm(e,t,n){let r=A(t,e=>Jr.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/agents/completions#stream`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`text/event-stream`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`stream_agents`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(sn(200,Me(e=>e instanceof ReadableStream).transform(e=>new em(e,e=>e.data===`[DONE]`?{done:!0,value:void 0}:{done:!1,value:Fa.parse(e)}))),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}var lm=class extends R{async complete(e,t){return M(Qp(this,e,t))}async stream(e,t){return M(sm(this,e,t))}},um=x({agentId:b(),alias:b(),version:E()}).transform(e=>k(e,{agentId:`agent_id`})),dm=x({agentId:b()}).transform(e=>k(e,{agentId:`agent_id`})),fm=x({agentId:b(),alias:b()}).transform(e=>k(e,{agentId:`agent_id`}));p([E(),b()]);var pm=x({agentId:b(),agentVersion:D(p([E(),b()])).optional()}).transform(e=>k(e,{agentId:`agent_id`,agentVersion:`agent_version`})),mm=x({agentId:b(),version:b()}).transform(e=>k(e,{agentId:`agent_id`})),hm=x({page:E().default(0),pageSize:E().default(20),deploymentChat:D(C()).optional(),sources:D(S(Vd)).optional(),name:D(b()).optional(),search:D(b()).optional(),id:D(b()).optional(),metadata:D(j(b(),y())).optional()}).transform(e=>k(e,{pageSize:`page_size`,deploymentChat:`deployment_chat`})),gm=x({agentId:b()}).transform(e=>k(e,{agentId:`agent_id`})),_m=x({agentId:b(),page:E().default(0),pageSize:E().default(20)}).transform(e=>k(e,{agentId:`agent_id`,pageSize:`page_size`})),vm=x({agentId:b(),updateAgentRequest:Uf}).transform(e=>k(e,{agentId:`agent_id`,updateAgentRequest:`UpdateAgentRequest`})),ym=x({agentId:b(),version:E()}).transform(e=>k(e,{agentId:`agent_id`})),bm=x({conversationId:b(),conversationAppendRequest:ws}).transform(e=>k(e,{conversationId:`conversation_id`,conversationAppendRequest:`ConversationAppendRequest`})),xm=x({conversationId:b(),conversationAppendStreamRequest:Es}).transform(e=>k(e,{conversationId:`conversation_id`,conversationAppendStreamRequest:`ConversationAppendStreamRequest`})),Sm=x({conversationId:b()}).transform(e=>k(e,{conversationId:`conversation_id`})),Cm=x({conversationId:b()}).transform(e=>k(e,{conversationId:`conversation_id`})),wm=p([td,Mr]),Tm=x({conversationId:b()}).transform(e=>k(e,{conversationId:`conversation_id`})),Em=x({page:E().default(0),pageSize:E().default(100),metadata:D(j(b(),y())).optional()}).transform(e=>k(e,{pageSize:`page_size`})),Dm=p([td,Mr]),Om=x({conversationId:b()}).transform(e=>k(e,{conversationId:`conversation_id`})),km=x({conversationId:b(),conversationRestartRequest:Ys}).transform(e=>k(e,{conversationId:`conversation_id`,conversationRestartRequest:`ConversationRestartRequest`})),Am=x({conversationId:b(),conversationRestartStreamRequest:Zs}).transform(e=>k(e,{conversationId:`conversation_id`,conversationRestartStreamRequest:`ConversationRestartStreamRequest`})),jm=x({workflowIdentifier:b()}).transform(e=>k(e,{workflowIdentifier:`workflow_identifier`})),Mm=x({executionId:b()}).transform(e=>k(e,{executionId:`execution_id`})),Nm=x({connectorId:b(),toolExecutionConfiguration:D(to).optional()}).transform(e=>k(e,{connectorId:`connector_id`,toolExecutionConfiguration:`ToolExecutionConfiguration`})),Pm=x({connectorId:b(),toolExecutionConfiguration:D(to).optional()}).transform(e=>k(e,{connectorId:`connector_id`,toolExecutionConfiguration:`ToolExecutionConfiguration`})),Fm=x({connectorId:b(),toolExecutionConfiguration:D(to).optional()}).transform(e=>k(e,{connectorId:`connector_id`,toolExecutionConfiguration:`ToolExecutionConfiguration`})),Im=x({toolName:b(),credentialsName:D(b()).optional(),connectorIdOrName:b(),connectorCallToolRequest:Vo}).transform(e=>k(e,{toolName:`tool_name`,credentialsName:`credentials_name`,connectorIdOrName:`connector_id_or_name`,connectorCallToolRequest:`ConnectorCallToolRequest`})),Lm=x({connectorIdOrName:b(),credentialsCreateOrUpdate:Mc}).transform(e=>k(e,{connectorIdOrName:`connector_id_or_name`,credentialsCreateOrUpdate:`CredentialsCreateOrUpdate`})),Rm=x({connectorIdOrName:b(),credentialsCreateOrUpdate:Mc}).transform(e=>k(e,{connectorIdOrName:`connector_id_or_name`,credentialsCreateOrUpdate:`CredentialsCreateOrUpdate`})),zm=x({connectorIdOrName:b(),credentialsCreateOrUpdate:Mc}).transform(e=>k(e,{connectorIdOrName:`connector_id_or_name`,credentialsCreateOrUpdate:`CredentialsCreateOrUpdate`})),Bm=x({connectorId:b()}).transform(e=>k(e,{connectorId:`connector_id`})),Vm=x({connectorId:b()}).transform(e=>k(e,{connectorId:`connector_id`})),Hm=x({connectorId:b()}).transform(e=>k(e,{connectorId:`connector_id`})),Um=x({credentialsName:b(),connectorIdOrName:b()}).transform(e=>k(e,{credentialsName:`credentials_name`,connectorIdOrName:`connector_id_or_name`})),Wm=x({credentialsName:b(),connectorIdOrName:b()}).transform(e=>k(e,{credentialsName:`credentials_name`,connectorIdOrName:`connector_id_or_name`})),Gm=x({connectorId:b()}).transform(e=>k(e,{connectorId:`connector_id`})),Km=x({credentialsName:b(),connectorIdOrName:b()}).transform(e=>k(e,{credentialsName:`credentials_name`,connectorIdOrName:`connector_id_or_name`})),qm=x({connectorIdOrName:b()}).transform(e=>k(e,{connectorIdOrName:`connector_id_or_name`})),Jm=x({appReturnUrl:D(b()).optional(),methodType:fi.optional(),credentialsName:D(b()).optional(),githubInstallationLink:C().default(!1),connectorIdOrName:b()}).transform(e=>k(e,{appReturnUrl:`app_return_url`,methodType:`method_type`,credentialsName:`credentials_name`,githubInstallationLink:`github_installation_link`,connectorIdOrName:`connector_id_or_name`})),Ym=x({fetchUserData:C().default(!1),fetchCustomerData:C().default(!1),connectorIdOrName:b()}).transform(e=>k(e,{fetchUserData:`fetch_user_data`,fetchCustomerData:`fetch_customer_data`,connectorIdOrName:`connector_id_or_name`})),Xm=x({authType:D(fi).optional(),fetchDefault:C().default(!1),connectorIdOrName:b()}).transform(e=>k(e,{authType:`auth_type`,fetchDefault:`fetch_default`,connectorIdOrName:`connector_id_or_name`})),Zm=x({page:E().default(1),pageSize:E().default(100),refresh:C().default(!1),pretty:C().default(!1),credentialsName:D(b()).optional(),connectorIdOrName:b()}).transform(e=>k(e,{pageSize:`page_size`,credentialsName:`credentials_name`,connectorIdOrName:`connector_id_or_name`})),Qm=p([S(uo),S(Qu),S(j(b(),y()))]),$m=x({authType:D(fi).optional(),fetchDefault:C().default(!1),connectorIdOrName:b()}).transform(e=>k(e,{authType:`auth_type`,fetchDefault:`fetch_default`,connectorIdOrName:`connector_id_or_name`})),eh=x({queryFilters:Ho.optional(),cursor:D(b()).optional(),pageSize:E().default(100)}).transform(e=>k(e,{queryFilters:`query_filters`,pageSize:`page_size`})),th=x({authType:D(fi).optional(),fetchDefault:C().default(!1),connectorIdOrName:b()}).transform(e=>k(e,{authType:`auth_type`,fetchDefault:`fetch_default`,connectorIdOrName:`connector_id_or_name`})),nh=x({connectorId:b(),updateConnectorRequest:Wf}).transform(e=>k(e,{connectorId:`connector_id`,updateConnectorRequest:`UpdateConnectorRequest`})),rh=x({datasetId:b(),createDatasetRecordRequest:oc}).transform(e=>k(e,{datasetId:`dataset_id`,createDatasetRecordRequest:`CreateDatasetRecordRequest`})),ih=x({campaignId:b()}).transform(e=>k(e,{campaignId:`campaign_id`})),ah=x({datasetRecordId:b()}).transform(e=>k(e,{datasetRecordId:`dataset_record_id`})),oh=x({datasetId:b()}).transform(e=>k(e,{datasetId:`dataset_id`})),sh=x({judgeId:b()}).transform(e=>k(e,{judgeId:`judge_id`})),ch=x({modelId:b()}).transform(e=>k(e,{modelId:`model_id`})),lh=x({voiceId:b()}).transform(e=>k(e,{voiceId:`voice_id`})),uh=x({workflowRegistrationId:b(),workflowExecutionRequest:Ep}).transform(e=>k(e,{workflowRegistrationId:`workflow_registration_id`,workflowExecutionRequest:`WorkflowExecutionRequest`})),dh=p([Dp,Op]),fh=x({workflowIdentifier:b(),workflowExecutionRequest:Ep}).transform(e=>k(e,{workflowIdentifier:`workflow_identifier`,workflowExecutionRequest:`WorkflowExecutionRequest`})),ph=p([Dp,Op]),mh=x({datasetId:b()}).transform(e=>k(e,{datasetId:`dataset_id`})),hh=x({fileId:b()}).transform(e=>k(e,{fileId:`file_id`})),gh=x({fileId:b()}).transform(e=>k(e,{fileId:`file_id`})),_h=x({fileId:b(),expiry:E().default(24)}).transform(e=>k(e,{fileId:`file_id`})),vh=x({page:E().default(0),pageSize:E().default(100),includeTotal:C().default(!0),sampleType:D(S(mc)).optional(),source:D(S(_c)).optional(),search:D(b()).optional(),purpose:D(uc).optional(),mimetypes:D(S(b())).optional()}).transform(e=>k(e,{pageSize:`page_size`,includeTotal:`include_total`,sampleType:`sample_type`})),yh=x({fileId:b()}).transform(e=>k(e,{fileId:`file_id`})),bh=re({Workspace:`workspace`,User:`user`}),xh=x({expiry:D(E()).optional(),visibility:bh.default(`workspace`),purpose:uc.optional(),file:ti.or($r)}),Sh=x({campaignId:b()}).transform(e=>k(e,{campaignId:`campaign_id`})),Ch=x({campaignId:b(),pageSize:E().default(50),page:E().default(1)}).transform(e=>k(e,{campaignId:`campaign_id`,pageSize:`page_size`})),wh=x({campaignId:b()}).transform(e=>k(e,{campaignId:`campaign_id`})),Th=x({pageSize:E().default(50),page:E().default(1),q:D(b()).optional()}).transform(e=>k(e,{pageSize:`page_size`})),Eh=x({pageSize:E().default(50),cursor:D(b()).optional(),searchChatCompletionEventsRequest:Xd}).transform(e=>k(e,{pageSize:`page_size`,searchChatCompletionEventsRequest:`SearchChatCompletionEventsRequest`})),Dh=x({eventId:b()}).transform(e=>k(e,{eventId:`event_id`})),Oh=x({fieldName:b(),fetchFieldOptionCountsRequest:Pl}).transform(e=>k(e,{fieldName:`field_name`,fetchFieldOptionCountsRequest:`FetchFieldOptionCountsRequest`})),kh=re({Lt:`lt`,Lte:`lte`,Gt:`gt`,Gte:`gte`,Startswith:`startswith`,Istartswith:`istartswith`,Endswith:`endswith`,Iendswith:`iendswith`,Contains:`contains`,Icontains:`icontains`,Matches:`matches`,Notcontains:`notcontains`,Inotcontains:`inotcontains`,Eq:`eq`,Neq:`neq`,Isnull:`isnull`,Includes:`includes`,Excludes:`excludes`,LenEq:`len_eq`}),Ah=x({fieldName:b(),operator:kh}).transform(e=>k(e,{fieldName:`field_name`})),jh=x({datasetId:b()}).transform(e=>k(e,{datasetId:`dataset_id`})),Mh=x({datasetId:b(),pageSize:E().default(50),page:E().default(1)}).transform(e=>k(e,{datasetId:`dataset_id`,pageSize:`page_size`})),Nh=x({datasetId:b(),taskId:b()}).transform(e=>k(e,{datasetId:`dataset_id`,taskId:`task_id`})),Ph=x({datasetId:b(),pageSize:E().default(50),page:E().default(1)}).transform(e=>k(e,{datasetId:`dataset_id`,pageSize:`page_size`})),Fh=x({datasetRecordId:b()}).transform(e=>k(e,{datasetRecordId:`dataset_record_id`})),Ih=x({pageSize:E().default(50),page:E().default(1),q:D(b()).optional()}).transform(e=>k(e,{pageSize:`page_size`})),Lh=x({name:b()}),Rh=x({judgeId:b()}).transform(e=>k(e,{judgeId:`judge_id`})),zh=x({typeFilter:D(S(_u)).optional(),modelFilter:D(S(b())).optional(),pageSize:E().default(50),page:E().default(1),q:D(b()).optional()}).transform(e=>k(e,{typeFilter:`type_filter`,modelFilter:`model_filter`,pageSize:`page_size`})),Bh=x({fieldName:b(),from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional()}).transform(e=>k(e,{fieldName:`field_name`})),Vh=x({runId:b(),decodePayloads:C().default(!0)}).transform(e=>k(e,{runId:`run_id`,decodePayloads:`decode_payloads`})),Hh=x({runId:b()}).transform(e=>k(e,{runId:`run_id`})),Uh=re({Active:`active`,Paused:`paused`}),Wh=x({workflowName:D(b()).optional(),userId:D(b()).optional(),status:D(Uh).optional(),pageSize:D(E()).optional(),nextPageToken:D(b()).optional()}).transform(e=>k(e,{workflowName:`workflow_name`,userId:`user_id`,pageSize:`page_size`,nextPageToken:`next_page_token`})),Gh=x({Result:Vp}).transform(e=>k(e,{Result:`result`})),Kh=x({scheduleId:b()}).transform(e=>k(e,{scheduleId:`schedule_id`})),qh=x({eventId:b()}).transform(e=>k(e,{eventId:`event_id`})),Jh=x({traceId:b(),spanId:b(),from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional()}).transform(e=>k(e,{traceId:`trace_id`,spanId:`span_id`})),Yh=x({fieldName:b(),from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional()}).transform(e=>k(e,{fieldName:`field_name`})),Xh=x({fieldName:b(),from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional()}).transform(e=>k(e,{fieldName:`field_name`})),Zh=x({scope:re({Activity:`activity`,Workflow:`workflow`,Wildcard:`*`}).default(`*`),activityName:b().default(`*`),activityId:b().default(`*`),workflowName:b().default(`*`),workflowExecId:b().default(`*`),rootWorkflowExecId:b().default(`*`),parentWorkflowExecId:b().default(`*`),stream:b().default(`*`),startSeq:E().default(0),metadataFilters:D(j(b(),y())).optional(),workflowEventTypes:D(S(yp)).optional(),lastEventId:D(b()).optional()}).transform(e=>k(e,{activityName:`activity_name`,activityId:`activity_id`,workflowName:`workflow_name`,workflowExecId:`workflow_exec_id`,rootWorkflowExecId:`root_workflow_exec_id`,parentWorkflowExecId:`parent_workflow_exec_id`,startSeq:`start_seq`,metadataFilters:`metadata_filters`,workflowEventTypes:`workflow_event_types`,lastEventId:`last-event-id`})),Qh=x({event:b().optional(),data:b().optional().transform((e,t)=>{if(e!==void 0)try{return JSON.parse(e)}catch(n){return t.addIssue({input:e,code:`custom`,message:`malformed json: ${n}`}),pe}}).pipe(bf.optional()),id:b().optional(),retry:E().optional()}),$h=x({traceId:b()}).transform(e=>k(e,{traceId:`trace_id`})),eg=x({fieldName:b(),from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional()}).transform(e=>k(e,{fieldName:`field_name`})),tg=x({traceId:b(),from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional(),pageSize:E().default(50),cursor:D(b()).optional()}).transform(e=>k(e,{traceId:`trace_id`,pageSize:`page_size`})),ng=x({voiceId:b()}).transform(e=>k(e,{voiceId:`voice_id`})),rg=x({voiceId:b()}).transform(e=>k(e,{voiceId:`voice_id`})),ig=x({rootWorkflowExecId:D(b()).optional(),workflowExecId:D(b()).optional(),workflowRunId:D(b()).optional(),limit:E().default(100),cursor:D(b()).optional()}).transform(e=>k(e,{rootWorkflowExecId:`root_workflow_exec_id`,workflowExecId:`workflow_exec_id`,workflowRunId:`workflow_run_id`})),ag=x({executionId:b(),decodePayloads:C().default(!0)}).transform(e=>k(e,{executionId:`execution_id`,decodePayloads:`decode_payloads`})),og=re({Asc:`asc`,Desc:`desc`}),sg=x({executionId:b(),runId:D(b()).optional(),activityId:D(b()).optional(),after:D(f().transform(e=>e.toISOString())).optional(),before:D(f().transform(e=>e.toISOString())).optional(),order:og.default(`asc`),cursor:D(b()).optional(),limit:E().default(50)}).transform(e=>k(e,{executionId:`execution_id`,runId:`run_id`,activityId:`activity_id`})),cg=x({executionId:b(),mergeSameIdEvents:C().default(!1),includeInternalEvents:C().default(!1)}).transform(e=>k(e,{executionId:`execution_id`,mergeSameIdEvents:`merge_same_id_events`,includeInternalEvents:`include_internal_events`})),lg=x({executionId:b()}).transform(e=>k(e,{executionId:`execution_id`})),ug=x({executionId:b()}).transform(e=>k(e,{executionId:`execution_id`})),dg=x({executionId:b()}).transform(e=>k(e,{executionId:`execution_id`})),fg=x({workflowName:b(),startTime:D(f().transform(e=>e.toISOString())).optional(),endTime:D(f().transform(e=>e.toISOString())).optional()}).transform(e=>k(e,{workflowName:`workflow_name`,startTime:`start_time`,endTime:`end_time`})),pg=x({workflowId:D(b()).optional(),taskQueue:D(b()).optional(),activeOnly:C().default(!1),includeShared:C().default(!0),workflowSearch:D(b()).optional(),archived:D(C()).optional(),withWorkflow:C().default(!1),availableInChatAssistant:D(C()).optional(),limit:E().default(50),cursor:D(b()).optional()}).transform(e=>k(e,{workflowId:`workflow_id`,taskQueue:`task_queue`,activeOnly:`active_only`,includeShared:`include_shared`,workflowSearch:`workflow_search`,withWorkflow:`with_workflow`,availableInChatAssistant:`available_in_chat_assistant`})),mg=x({workflowRegistrationId:b(),withWorkflow:C().default(!1),includeShared:C().default(!0)}).transform(e=>k(e,{workflowRegistrationId:`workflow_registration_id`,withWorkflow:`with_workflow`,includeShared:`include_shared`})),hg={Active:`active`,Inactive:`inactive`},gg={Asc:`asc`,Desc:`desc`};p([Sp,S(Sp)]);var _g=re(hg),vg=re(gg),yg=x({status:D(p([Sp,S(Sp)])).optional(),includeShared:C().default(!0),availableInChatAssistant:D(C()).optional(),deploymentName:D(S(b())).optional(),deploymentStatus:D(_g).optional(),archived:D(C()).optional(),tags:D(S(b())).optional(),sortBy:D(T(`display_name`)).optional(),order:vg.default(`asc`),cursor:D(b()).optional(),limit:E().default(50),activeOnly:C().default(!1)}).transform(e=>k(e,{includeShared:`include_shared`,availableInChatAssistant:`available_in_chat_assistant`,deploymentName:`deployment_name`,deploymentStatus:`deployment_status`,sortBy:`sort_by`,activeOnly:`active_only`})),bg=x({Result:Fp}).transform(e=>k(e,{Result:`result`})),xg=x({workflowIdentifier:b()}).transform(e=>k(e,{workflowIdentifier:`workflow_identifier`})),Sg=x({jobId:b()}).transform(e=>k(e,{jobId:`job_id`})),Cg=x({jobId:b()}).transform(e=>k(e,{jobId:`job_id`})),wg=x({jobId:b(),inline:D(C()).optional()}).transform(e=>k(e,{jobId:`job_id`})),Tg=re({Created:`created`,MinusCreated:`-created`}),Eg=x({page:E().default(0),pageSize:E().default(100),model:D(b()).optional(),agentId:D(b()).optional(),metadata:D(j(b(),y())).optional(),createdAfter:D(f().transform(e=>e.toISOString())).optional(),createdByMe:C().default(!1),status:D(S(ki)).optional(),orderBy:Tg.default(`-created`)}).transform(e=>k(e,{pageSize:`page_size`,agentId:`agent_id`,createdAfter:`created_after`,createdByMe:`created_by_me`,orderBy:`order_by`})),Dg=x({modelId:b()}).transform(e=>k(e,{modelId:`model_id`})),Og=x({jobId:b()}).transform(e=>k(e,{jobId:`job_id`})),kg=ke(`job_type`,{classifier:Ea,completion:Ua},{outputPropertyName:`jobType`});ke(`job_type`,{classifier:Ca,completion:Va},{outputPropertyName:`jobType`});var Ag=p([vu,ke(`job_type`,{classifier:Ca,completion:Va},{outputPropertyName:`jobType`})]),jg=x({jobId:b()}).transform(e=>k(e,{jobId:`job_id`})),Mg=ke(`job_type`,{classifier:Ea,completion:Ua},{outputPropertyName:`jobType`}),Ng=re({Queued:`QUEUED`,Started:`STARTED`,Validating:`VALIDATING`,Validated:`VALIDATED`,Running:`RUNNING`,FailedValidation:`FAILED_VALIDATION`,Failed:`FAILED`,Success:`SUCCESS`,Cancelled:`CANCELLED`,CancellationRequested:`CANCELLATION_REQUESTED`}),Pg=x({page:E().default(0),pageSize:E().default(100),model:D(b()).optional(),createdAfter:D(f().transform(e=>e.toISOString())).optional(),createdBefore:D(f().transform(e=>e.toISOString())).optional(),createdByMe:C().default(!1),status:D(Ng).optional(),wandbProject:D(b()).optional(),wandbName:D(b()).optional(),suffix:D(b()).optional()}).transform(e=>k(e,{pageSize:`page_size`,createdAfter:`created_after`,createdBefore:`created_before`,createdByMe:`created_by_me`,wandbProject:`wandb_project`,wandbName:`wandb_name`})),Fg=x({jobId:b()}).transform(e=>k(e,{jobId:`job_id`})),Ig=ke(`job_type`,{classifier:Ea,completion:Ua},{outputPropertyName:`jobType`}),Lg=x({modelId:b()}).transform(e=>k(e,{modelId:`model_id`})),Rg=x({modelId:b(),updateModelRequest:$f}).transform(e=>k(e,{modelId:`model_id`,updateModelRequest:`UpdateModelRequest`})),zg=ke(`model_type`,{classifier:_a,completion:Ia},{outputPropertyName:`modelType`}),Bg=x({eventId:b(),judgeChatCompletionEventRequest:pu}).transform(e=>k(e,{eventId:`event_id`,judgeChatCompletionEventRequest:`JudgeChatCompletionEventRequest`})),Vg=x({judgeId:b(),judgeConversationRequest:mu}).transform(e=>k(e,{judgeId:`judge_id`,judgeConversationRequest:`JudgeConversationRequest`})),Hg=x({datasetRecordId:b(),judgeDatasetRecordRequest:hu}).transform(e=>k(e,{datasetRecordId:`dataset_record_id`,judgeDatasetRecordRequest:`JudgeDatasetRecordRequest`})),Ug=x({libraryId:b()}).transform(e=>k(e,{libraryId:`library_id`})),Wg=x({libraryId:b(),documentId:b()}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`})),Gg=x({libraryId:b(),documentId:b()}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`})),Kg=x({libraryId:b(),documentId:b()}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`})),qg=x({libraryId:b(),documentId:b()}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`})),Jg=x({libraryId:b(),documentId:b(),pageStart:D(E()).optional(),pageEnd:D(E()).optional()}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`,pageStart:`page_start`,pageEnd:`page_end`})),Yg=x({libraryId:b(),documentId:b()}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`})),Xg=x({libraryId:b(),search:D(b()).optional(),pageSize:E().default(100),page:E().default(0),filtersAttributes:D(b()).optional(),sortBy:b().default(`created_at`),sortOrder:b().default(`desc`)}).transform(e=>k(e,{libraryId:`library_id`,pageSize:`page_size`,filtersAttributes:`filters_attributes`,sortBy:`sort_by`,sortOrder:`sort_order`})),Zg=x({libraryId:b(),documentId:b(),updateDocumentRequest:Yf}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`,updateDocumentRequest:`UpdateDocumentRequest`})),Qg=x({libraryId:b(),documentId:b()}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`})),$g=x({libraryId:b(),documentId:b(),updateDocumentRequest:Yf}).transform(e=>k(e,{libraryId:`library_id`,documentId:`document_id`,updateDocumentRequest:`UpdateDocumentRequest`})),e_=x({file:ti.or($r)}),t_=x({libraryId:b(),requestBody:v(()=>e_)}).transform(e=>k(e,{libraryId:`library_id`,requestBody:`RequestBody`})),n_=x({libraryId:b()}).transform(e=>k(e,{libraryId:`library_id`})),r_=x({pageSize:E().default(100),page:E().default(0),search:D(b()).optional(),filterOwnedByMe:D(C()).optional()}).transform(e=>k(e,{pageSize:`page_size`,filterOwnedByMe:`filter_owned_by_me`})),i_=x({libraryId:b(),updateLibraryRequest:Qf}).transform(e=>k(e,{libraryId:`library_id`,updateLibraryRequest:`UpdateLibraryRequest`})),a_=x({libraryId:b(),sharingRequest:af}).transform(e=>k(e,{libraryId:`library_id`,sharingRequest:`SharingRequest`})),o_=x({libraryId:b(),sharingDelete:rf}).transform(e=>k(e,{libraryId:`library_id`,sharingDelete:`SharingDelete`})),s_=x({libraryId:b()}).transform(e=>k(e,{libraryId:`library_id`})),c_=x({libraryId:b(),updateLibraryRequest:Qf}).transform(e=>k(e,{libraryId:`library_id`,updateLibraryRequest:`UpdateLibraryRequest`})),l_=x({activeOnly:C().default(!0),isHardened:D(C()).optional(),workflowName:D(b()).optional(),search:D(b()).optional(),limit:D(E()).optional(),cursor:D(b()).optional(),workspaceId:D(b()).optional()}).transform(e=>k(e,{activeOnly:`active_only`,isHardened:`is_hardened`,workflowName:`workflow_name`,workspaceId:`workspace_id`})),u_=x({provider:D(b()).optional(),model:D(b()).optional()}),d_={StartTime:`start_time`,EndTime:`end_time`},f_={Asc:`asc`,Desc:`desc`};p([Sp,S(Sp)]);var p_=re(d_),m_=re(f_),h_=x({workflowIdentifier:D(b()).optional(),search:D(b()).optional(),status:D(p([Sp,S(Sp)])).optional(),deploymentName:D(b()).optional(),sortBy:D(p_).optional(),order:m_.default(`desc`),startTimeAfter:D(f().transform(e=>e.toISOString())).optional(),startTimeBefore:D(f().transform(e=>e.toISOString())).optional(),endTimeAfter:D(f().transform(e=>e.toISOString())).optional(),endTimeBefore:D(f().transform(e=>e.toISOString())).optional(),userId:D(b()).optional(),pageSize:E().default(50),nextPageToken:D(b()).optional()}).transform(e=>k(e,{workflowIdentifier:`workflow_identifier`,deploymentName:`deployment_name`,sortBy:`sort_by`,startTimeAfter:`start_time_after`,startTimeBefore:`start_time_before`,endTimeAfter:`end_time_after`,endTimeBefore:`end_time_before`,userId:`user_id`,pageSize:`page_size`,nextPageToken:`next_page_token`})),g_=x({Result:Cp}).transform(e=>k(e,{Result:`result`})),__=re({All:`all`,Custom:`custom`,Preset:`preset`}),v_=x({limit:E().default(10),offset:E().default(0),type:__.default(`all`)}),y_=x({scheduleId:b(),workflowSchedulePauseRequest:D(Hp).optional()}).transform(e=>k(e,{scheduleId:`schedule_id`,workflowSchedulePauseRequest:`WorkflowSchedulePauseRequest`})),b_=x({datasetId:b(),importDatasetFromCampaignRequest:su}).transform(e=>k(e,{datasetId:`dataset_id`,importDatasetFromCampaignRequest:`ImportDatasetFromCampaignRequest`})),x_=x({datasetId:b(),importDatasetFromDatasetRequest:cu}).transform(e=>k(e,{datasetId:`dataset_id`,importDatasetFromDatasetRequest:`ImportDatasetFromDatasetRequest`})),S_=x({datasetId:b(),importDatasetFromExplorerRequest:lu}).transform(e=>k(e,{datasetId:`dataset_id`,importDatasetFromExplorerRequest:`ImportDatasetFromExplorerRequest`})),C_=x({datasetId:b(),importDatasetFromFileRequest:uu}).transform(e=>k(e,{datasetId:`dataset_id`,importDatasetFromFileRequest:`ImportDatasetFromFileRequest`})),w_=x({datasetId:b(),importDatasetFromPlaygroundRequest:du}).transform(e=>k(e,{datasetId:`dataset_id`,importDatasetFromPlaygroundRequest:`ImportDatasetFromPlaygroundRequest`})),T_=x({executionId:b(),queryInvocationBody:zd}).transform(e=>k(e,{executionId:`execution_id`,queryInvocationBody:`QueryInvocationBody`})),E_=x({executionId:b(),resetInvocationBody:Hd}).transform(e=>k(e,{executionId:`execution_id`,resetInvocationBody:`ResetInvocationBody`})),D_=x({scheduleId:b(),workflowSchedulePauseRequest:D(Hp).optional()}).transform(e=>k(e,{scheduleId:`schedule_id`,workflowSchedulePauseRequest:`WorkflowSchedulePauseRequest`})),O_=x({modelId:b()}).transform(e=>k(e,{modelId:`model_id`})),k_=ke(`type`,{base:xi,"fine-tuned":Vl}),A_=x({from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional(),pageSize:E().default(50),cursor:D(b()).optional(),spanEvaluationsRequest:uf}).transform(e=>k(e,{pageSize:`page_size`,spanEvaluationsRequest:`SpanEvaluationsRequest`})),j_=x({from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional(),pageSize:E().default(50),cursor:D(b()).optional(),logsRequest:Zu}).transform(e=>k(e,{pageSize:`page_size`,logsRequest:`LogsRequest`})),M_=x({from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional(),pageSize:E().default(50),cursor:D(b()).optional(),spanEvaluationsRequest:uf}).transform(e=>k(e,{pageSize:`page_size`,spanEvaluationsRequest:`SpanEvaluationsRequest`})),N_=x({from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional(),pageSize:E().default(50),cursor:D(b()).optional(),spansRequest:df}).transform(e=>k(e,{pageSize:`page_size`,spansRequest:`SpansRequest`})),P_=x({from:D(f().transform(e=>e.toISOString())).optional(),to:D(f().transform(e=>e.toISOString())).optional(),pageSize:E().default(50),cursor:D(b()).optional(),tracesRequest:Mf}).transform(e=>k(e,{pageSize:`page_size`,tracesRequest:`TracesRequest`})),F_=x({executionId:b(),signalInvocationBody:cf}).transform(e=>k(e,{executionId:`execution_id`,signalInvocationBody:`SignalInvocationBody`}));ke(`type`,{"speech.audio.delta":mf,"speech.audio.done":gf});var I_=x({event:_f,data:b().transform((e,t)=>{try{return JSON.parse(e)}catch(n){return t.addIssue({input:e,code:`custom`,message:`malformed json: ${n}`}),pe}}).pipe(ke(`type`,{"speech.audio.delta":mf,"speech.audio.done":gf}))}),L_=x({audio_data:b()}).transform(e=>k(e,{audio_data:`audioData`})),R_=p([v(()=>L_),Me(e=>e instanceof ReadableStream).transform(e=>new em(e,e=>({done:!1,value:v(()=>I_).parse(e)})))]),z_=x({executionId:b(),eventSource:D(vl).optional(),lastEventId:D(b()).optional()}).transform(e=>k(e,{executionId:`execution_id`,eventSource:`event_source`,lastEventId:`last_event_id`})),B_=x({event:b().optional(),data:b().optional().transform((e,t)=>{if(e!==void 0)try{return JSON.parse(e)}catch(n){return t.addIssue({input:e,code:`custom`,message:`malformed json: ${n}`}),pe}}).pipe(bf.optional()),id:b().optional(),retry:E().optional()}),V_={Log:`log`,Error:`error`},H_=x({executionId:b(),runId:D(b()).optional(),activityId:D(b()).optional(),after:D(f().transform(e=>e.toISOString())).optional(),lastEventId:D(b()).optional()}).transform(e=>k(e,{executionId:`execution_id`,runId:`run_id`,activityId:`activity_id`,lastEventId:`last_event_id`})),U_=w(V_);p([bl,vf]);var W_=x({event:U_.optional(),id:b().optional(),data:b().optional().transform((e,t)=>{if(e!==void 0)try{return JSON.parse(e)}catch(n){return t.addIssue({input:e,code:`custom`,message:`malformed json: ${n}`}),pe}}).pipe(p([bl,vf]).optional())}),G_=x({executionId:b()}).transform(e=>k(e,{executionId:`execution_id`})),K_=x({scheduleId:b(),workflowScheduleTriggerRequest:D(Gp).optional()}).transform(e=>k(e,{scheduleId:`schedule_id`,workflowScheduleTriggerRequest:`WorkflowScheduleTriggerRequest`})),q_=x({workflowIdentifier:b()}).transform(e=>k(e,{workflowIdentifier:`workflow_identifier`})),J_=x({scheduleId:b()}).transform(e=>k(e,{scheduleId:`schedule_id`})),Y_=x({datasetRecordId:b(),updateDatasetRecordPayloadRequest:Gf}).transform(e=>k(e,{datasetRecordId:`dataset_record_id`,updateDatasetRecordPayloadRequest:`UpdateDatasetRecordPayloadRequest`})),X_=x({datasetRecordId:b(),updateDatasetRecordPropertiesRequest:Kf}).transform(e=>k(e,{datasetRecordId:`dataset_record_id`,updateDatasetRecordPropertiesRequest:`UpdateDatasetRecordPropertiesRequest`})),Z_=x({datasetId:b(),updateDatasetRequest:qf}).transform(e=>k(e,{datasetId:`dataset_id`,updateDatasetRequest:`UpdateDatasetRequest`})),Q_=x({judgeId:b(),updateJudgeRequest:Zf}).transform(e=>k(e,{judgeId:`judge_id`,updateJudgeRequest:`UpdateJudgeRequest`})),$_=x({id:b(),updateRunInfo:ep}).transform(e=>k(e,{updateRunInfo:`UpdateRunInfo`})),ev=x({scheduleId:b(),workflowScheduleUpdateRequest:Kp}).transform(e=>k(e,{scheduleId:`schedule_id`,workflowScheduleUpdateRequest:`WorkflowScheduleUpdateRequest`})),tv=x({voiceId:b(),voiceUpdateRequest:sp}).transform(e=>k(e,{voiceId:`voice_id`,voiceUpdateRequest:`VoiceUpdateRequest`})),nv=x({executionId:b(),updateInvocationBody:Xf}).transform(e=>k(e,{executionId:`execution_id`,updateInvocationBody:`UpdateInvocationBody`})),rv=x({workflowIdentifier:b(),workflowUpdateRequest:Jp}).transform(e=>k(e,{workflowIdentifier:`workflow_identifier`,workflowUpdateRequest:`WorkflowUpdateRequest`})),iv;(function(e){e.applicationJson=`application/json`,e.textEventStream=`text/event-stream`})(iv||={});function av(e,t,n){return new q(ov(e,t,n))}async function ov(e,t,n){let r=A(t,e=>pf.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/audio/speech`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:n?.acceptHeaderOverride||`application/json;q=1, text/event-stream;q=0`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`speech_v1_audio_speech_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,R_),sn(200,R_),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}var sv=class extends R{async complete(e,t){return M(av(this,e,t))}};function cv(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.getReader==`function`&&typeof t.cancel==`function`&&typeof t.tee==`function`}function lv(e,t,n){return new q(uv(e,t,n))}async function uv(e,t,n){let r=A(t,e=>ri.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=new FormData;if(Mt(a,`model`,i.model),i.context_bias!==void 0&&Mt(a,`context_bias`,i.context_bias),i.diarize!==void 0&&Mt(a,`diarize`,i.diarize),i.file!==void 0)if(ei(i.file)){let e=i.file;Mt(a,`file`,await Nt(e),`name`in e?e.name:void 0)}else if(cv(i.file.content))Mt(a,`file`,ze(await Le(i.file.content),Re(i.file.fileName)||`application/octet-stream`),i.file.fileName);else{let e=Re(i.file.fileName)||`application/octet-stream`;Mt(a,`file`,ze(i.file.content,e),i.file.fileName)}i.file_id!==void 0&&Mt(a,`file_id`,i.file_id),i.file_url!==void 0&&Mt(a,`file_url`,i.file_url),i.language!==void 0&&Mt(a,`language`,i.language),i.stream!==void 0&&Mt(a,`stream`,i.stream),i.temperature!==void 0&&Mt(a,`temperature`,i.temperature),i.timestamp_granularities!==void 0&&Mt(a,`timestamp_granularities`,i.timestamp_granularities);let o=N(`/v1/audio/transcriptions`)(),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`audio_api_v1_transcriptions_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,[g]=await H(B(200,Ff),V(`4XX`),V(`5XX`))(h,p);return g.ok,[g,{status:`complete`,request:p,response:h}]}function dv(e,t,n){return new q(fv(e,t,n))}async function fv(e,t,n){let r=A(t,e=>ii.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=new FormData;if(Mt(a,`model`,i.model),i.context_bias!==void 0&&Mt(a,`context_bias`,i.context_bias),i.diarize!==void 0&&Mt(a,`diarize`,i.diarize),i.file!==void 0)if(ei(i.file)){let e=i.file;Mt(a,`file`,await Nt(e),`name`in e?e.name:void 0)}else if(cv(i.file.content))Mt(a,`file`,ze(await Le(i.file.content),Re(i.file.fileName)||`application/octet-stream`),i.file.fileName);else{let e=Re(i.file.fileName)||`application/octet-stream`;Mt(a,`file`,ze(i.file.content,e),i.file.fileName)}i.file_id!==void 0&&Mt(a,`file_id`,i.file_id),i.file_url!==void 0&&Mt(a,`file_url`,i.file_url),i.language!==void 0&&Mt(a,`language`,i.language),i.stream!==void 0&&Mt(a,`stream`,i.stream),i.temperature!==void 0&&Mt(a,`temperature`,i.temperature),i.timestamp_granularities!==void 0&&Mt(a,`timestamp_granularities`,i.timestamp_granularities);let o=N(`/v1/audio/transcriptions#stream`)(),s=new Headers(d({Accept:`text/event-stream`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`audio_api_v1_transcriptions_post_stream`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,[g]=await H(sn(200,Me(e=>e instanceof ReadableStream).transform(e=>new em(e,e=>({done:!1,value:Vf.parse(e)})))),V(`4XX`),V(`5XX`))(h,p);return g.ok,[g,{status:`complete`,request:p,response:h}]}var pv=class extends R{async complete(e,t){return M(lv(this,e,t))}async stream(e,t){return M(dv(this,e,t))}};function mv(e,t,n){return new q(hv(e,t,n))}async function hv(e,t,n){let r=A(t,e=>ip.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/audio/voices`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`create_voice_v1_audio_voices_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,ap),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function gv(e,t,n){return new q(_v(e,t,n))}async function _v(e,t,n){let r=A(t,e=>lh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={voice_id:I(`voice_id`,i.voice_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/audio/voices/{voice_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`delete_voice_v1_audio_voices__voice_id__delete`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,ap),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function vv(e,t,n){return new q(yv(e,t,n))}async function yv(e,t,n){let r=A(t,e=>rg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={voice_id:I(`voice_id`,i.voice_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/audio/voices/{voice_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_voice_v1_audio_voices__voice_id__get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,ap),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function bv(e,t,n){return new q(xv(e,t,n))}async function xv(e,t,n){let r=A(t,e=>ng.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={voice_id:I(`voice_id`,i.voice_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/audio/voices/{voice_id}/sample`)(a),s=new Headers(d({Accept:`audio/wav`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_voice_sample_audio_v1_audio_voices__voice_id__sample_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(on(200,Me(e=>e instanceof ReadableStream),{ctype:`audio/wav`}),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Sv(e,t,n){return new q(Cv(e,t,n))}async function Cv(e,t,n){let r=A(t,e=>v_.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/audio/voices`)(),o=L({limit:i?.limit,offset:i?.offset,type:i?.type}),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`list_voices_v1_audio_voices_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,op),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function wv(e,t,n){return new q(Tv(e,t,n))}async function Tv(e,t,n){let r=A(t,e=>tv.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.VoiceUpdateRequest,{explode:!0}),o={voice_id:I(`voice_id`,i.voice_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/audio/voices/{voice_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`update_voice_v1_audio_voices__voice_id__patch`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PATCH`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,ap),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var Ev=class extends R{async list(e,t){return M(Sv(this,e,t))}async create(e,t){return M(mv(this,e,t))}async delete(e,t){return M(gv(this,e,t))}async update(e,t){return M(wv(this,e,t))}async get(e,t){return M(vv(this,e,t))}async getSampleAudio(e,t){return M(bv(this,e,t))}},Dv=class extends R{_speech;get speech(){return this._speech??=new sv(this._options)}_transcriptions;get transcriptions(){return this._transcriptions??=new pv(this._options)}_voices;get voices(){return this._voices??=new Ev(this._options)}};function Ov(e,t,n){return new q(kv(e,t,n))}async function kv(e,t,n){let r=A(t,e=>Sg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={job_id:I(`job_id`,i.job_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/batch/jobs/{job_id}/cancel`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`jobs_api_routes_batch_cancel_batch_job`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,[g]=await H(B(200,Ai),V(`4XX`),V(`5XX`))(h,p);return g.ok,[g,{status:`complete`,request:p,response:h}]}function Av(e,t,n){return new q(jv(e,t,n))}async function jv(e,t,n){let r=A(t,e=>nc.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/batch/jobs`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`jobs_api_routes_batch_create_batch_job`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,[g]=await H(B(200,Ai),V(`4XX`),V(`5XX`))(h,p);return g.ok,[g,{status:`complete`,request:p,response:h}]}function Mv(e,t,n){return new q(Nv(e,t,n))}async function Nv(e,t,n){let r=A(t,e=>Cg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={job_id:I(`job_id`,i.job_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/batch/jobs/{job_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`jobs_api_routes_batch_delete_batch_job`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,[g]=await H(B(200,el),V(`4XX`),V(`5XX`))(h,p);return g.ok,[g,{status:`complete`,request:p,response:h}]}function Pv(e,t,n){return new q(Fv(e,t,n))}async function Fv(e,t,n){let r=A(t,e=>wg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={job_id:I(`job_id`,i.job_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/batch/jobs/{job_id}`)(a),s=L({inline:i.inline}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`jobs_api_routes_batch_get_batch_job`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,[_]=await H(B(200,Ai),V(`4XX`),V(`5XX`))(g,m);return _.ok,[_,{status:`complete`,request:m,response:g}]}function Iv(e,t,n){return new q(Lv(e,t,n))}async function Lv(e,t,n){let r=A(t,e=>Eg.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/batch/jobs`)(),o=L({agent_id:i?.agent_id,created_after:i?.created_after,created_by_me:i?.created_by_me,metadata:i?.metadata,model:i?.model,order_by:i?.order_by,page:i?.page,page_size:i?.page_size,status:i?.status}),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`jobs_api_routes_batch_get_batch_jobs`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,[g]=await H(B(200,bu),V(`4XX`),V(`5XX`))(h,p);return g.ok,[g,{status:`complete`,request:p,response:h}]}var Rv=class extends R{async list(e,t){return M(Iv(this,e,t))}async create(e,t){return M(Av(this,e,t))}async get(e,t){return M(Pv(this,e,t))}async delete(e,t){return M(Mv(this,e,t))}async cancel(e,t){return M(Ov(this,e,t))}},zv=class extends R{_jobs;get jobs(){return this._jobs??=new Rv(this._options)}};function Bv(e,t,n){return new q(Vv(e,t,n))}async function Vv(e,t,n){let r=A(t,e=>tc.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/agents`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_create`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Ar),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Hv(e,t,n){return new q(Uv(e,t,n))}async function Uv(e,t,n){let r=A(t,e=>um.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/agents/{agent_id}/aliases`)(a),s=L({alias:i.alias,version:i.version}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_create_or_update_alias`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PUT`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,jr),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Wv(e,t,n){return new q(Gv(e,t,n))}async function Gv(e,t,n){let r=A(t,e=>dm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/agents/{agent_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_delete`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function Kv(e,t,n){return new q(qv(e,t,n))}async function qv(e,t,n){let r=A(t,e=>fm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/agents/{agent_id}/aliases`)(a),s=L({alias:i.alias}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_delete_alias`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let _=h.value,v={HttpMeta:{Response:_,Request:m}},[y]=await H(cn(204,g()),z(422,G),V(`4XX`),V(`5XX`))(_,m,{extraFields:v});return y.ok,[y,{status:`complete`,request:m,response:_}]}function Jv(e,t,n){return new q(Yv(e,t,n))}async function Yv(e,t,n){let r=A(t,e=>pm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/agents/{agent_id}`)(a),s=L({agent_version:i.agent_version}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Ar),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Xv(e,t,n){return new q(Zv(e,t,n))}async function Zv(e,t,n){let r=A(t,e=>mm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`}),version:I(`version`,i.version,{explode:!1,charEncoding:`percent`})},o=N(`/v1/agents/{agent_id}/versions/{version}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_get_version`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Ar),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Qv(e,t,n){return new q($v(e,t,n))}async function $v(e,t,n){let r=A(t,e=>hm.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/agents`)(),o=Ot(L({deployment_chat:i?.deployment_chat,id:i?.id,name:i?.name,page:i?.page,page_size:i?.page_size,search:i?.search,sources:i?.sources}),At({metadata:i?.metadata},{explode:!1})),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_list`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,S(Ar)),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function ey(e,t,n){return new q(ty(e,t,n))}async function ty(e,t,n){let r=A(t,e=>gm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/agents/{agent_id}/aliases`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_list_version_aliases`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,S(jr)),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function ny(e,t,n){return new q(ry(e,t,n))}async function ry(e,t,n){let r=A(t,e=>_m.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/agents/{agent_id}/versions`)(a),s=L({page:i.page,page_size:i.page_size}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_list_versions`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,S(Ar)),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function iy(e,t,n){return new q(ay(e,t,n))}async function ay(e,t,n){let r=A(t,e=>vm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateAgentRequest,{explode:!0}),o={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/agents/{agent_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_update`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PATCH`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Ar),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function oy(e,t,n){return new q(sy(e,t,n))}async function sy(e,t,n){let r=A(t,e=>ym.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={agent_id:I(`agent_id`,i.agent_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/agents/{agent_id}/version`)(a),s=L({version:i.version}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_agents_update_version`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PATCH`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Ar),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var cy=class extends R{async create(e,t){return M(Bv(this,e,t))}async list(e,t){return M(Qv(this,e,t))}async get(e,t){return M(Jv(this,e,t))}async update(e,t){return M(iy(this,e,t))}async delete(e,t){return M(Wv(this,e,t))}async updateVersion(e,t){return M(oy(this,e,t))}async listVersions(e,t){return M(ny(this,e,t))}async getVersion(e,t){return M(Xv(this,e,t))}async createVersionAlias(e,t){return M(Hv(this,e,t))}async listVersionAliases(e,t){return M(ey(this,e,t))}async deleteVersionAlias(e,t){return M(Kv(this,e,t))}};function ly(e,t,n){return new q(uy(e,t,n))}async function uy(e,t,n){let r=A(t,e=>Nm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ToolExecutionConfiguration,{explode:!0}),o={connector_id:I(`connector_id`,i.connector_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/connectors/{connector_id}/organization/activate`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_activate_for_organization_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function dy(e,t,n){return new q(fy(e,t,n))}async function fy(e,t,n){let r=A(t,e=>Pm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ToolExecutionConfiguration,{explode:!0}),o={connector_id:I(`connector_id`,i.connector_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/connectors/{connector_id}/user/activate`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_activate_for_user_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function py(e,t,n){return new q(my(e,t,n))}async function my(e,t,n){let r=A(t,e=>Fm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ToolExecutionConfiguration,{explode:!0}),o={connector_id:I(`connector_id`,i.connector_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/connectors/{connector_id}/workspace/activate`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_activate_for_workspace_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function hy(e,t,n){return new q(gy(e,t,n))}async function gy(e,t,n){let r=A(t,e=>Im.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ConnectorCallToolRequest,{explode:!0}),o={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`}),tool_name:I(`tool_name`,i.tool_name,{explode:!1,charEncoding:`percent`})},s=N(`/v1/connectors/{connector_id_or_name}/tools/{tool_name}/call`)(o),c=L({credentials_name:i.credentials_name}),l=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),u=await W(e._options.apiKey),f=U(u==null?{}:{apiKey:u}),p={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_call_tool_v1`,oAuth2Scopes:null,resolvedSecurity:f,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},m=e._createRequest(p,{security:f,method:`POST`,baseURL:n?.serverURL,path:s,headers:l,query:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!m.ok)return[m,{status:`invalid`}];let h=m.value,g=await e._do(h,{context:p,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:p.retryConfig,retryCodes:p.retryCodes});if(!g.ok)return[g,{status:`request-error`,request:h}];let _=g.value,v={HttpMeta:{Response:_,Request:h}},[y]=await H(B(200,Yo),z(422,G),V(`4XX`),V(`5XX`))(_,h,{extraFields:v});return y.ok,[y,{status:`complete`,request:h,response:_}]}function _y(e,t,n){return new q(vy(e,t,n))}async function vy(e,t,n){let r=A(t,e=>ac.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/connectors`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_create_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(201,Bo),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function yy(e,t,n){return new q(by(e,t,n))}async function by(e,t,n){let r=A(t,e=>Lm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.CredentialsCreateOrUpdate,{explode:!0}),o={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},s=N(`/v1/connectors/{connector_id_or_name}/organization/credentials`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_create_or_update_organization_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function xy(e,t,n){return new q(Sy(e,t,n))}async function Sy(e,t,n){let r=A(t,e=>Rm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.CredentialsCreateOrUpdate,{explode:!0}),o={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},s=N(`/v1/connectors/{connector_id_or_name}/user/credentials`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_create_or_update_user_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Cy(e,t,n){return new q(wy(e,t,n))}async function wy(e,t,n){let r=A(t,e=>zm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.CredentialsCreateOrUpdate,{explode:!0}),o={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},s=N(`/v1/connectors/{connector_id_or_name}/workspace/credentials`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_create_or_update_workspace_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Ty(e,t,n){return new q(Ey(e,t,n))}async function Ey(e,t,n){let r=A(t,e=>Bm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id:I(`connector_id`,i.connector_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id}/organization/deactivate`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_deactivate_for_organization_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Dy(e,t,n){return new q(Oy(e,t,n))}async function Oy(e,t,n){let r=A(t,e=>Vm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id:I(`connector_id`,i.connector_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id}/user/deactivate`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_deactivate_for_user_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function ky(e,t,n){return new q(Ay(e,t,n))}async function Ay(e,t,n){let r=A(t,e=>Hm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id:I(`connector_id`,i.connector_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id}/workspace/deactivate`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_deactivate_for_workspace_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function jy(e,t,n){return new q(My(e,t,n))}async function My(e,t,n){let r=A(t,e=>Gm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id:I(`connector_id`,i.connector_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id}#id`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_delete_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Ny(e,t,n){return new q(Py(e,t,n))}async function Py(e,t,n){let r=A(t,e=>Um.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`}),credentials_name:I(`credentials_name`,i.credentials_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/organization/credentials/{credentials_name}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_delete_organization_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Fy(e,t,n){return new q(Iy(e,t,n))}async function Iy(e,t,n){let r=A(t,e=>Wm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`}),credentials_name:I(`credentials_name`,i.credentials_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/user/credentials/{credentials_name}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_delete_user_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Ly(e,t,n){return new q(Ry(e,t,n))}async function Ry(e,t,n){let r=A(t,e=>Km.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`}),credentials_name:I(`credentials_name`,i.credentials_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/workspace/credentials/{credentials_name}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_delete_workspace_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,$u),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function zy(e,t,n){return new q(By(e,t,n))}async function By(e,t,n){let r=A(t,e=>Ym.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}#idOrName`)(a),s=L({fetch_customer_data:i.fetch_customer_data,fetch_user_data:i.fetch_user_data}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_get_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Bo),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Vy(e,t,n){return new q(Hy(e,t,n))}async function Hy(e,t,n){let r=A(t,e=>qm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/authentication_methods`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_get_authentication_methods_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,[g]=await H(B(200,S(Lo)),V(`4XX`),V(`5XX`))(h,p);return g.ok,[g,{status:`complete`,request:p,response:h}]}function Uy(e,t,n){return new q(Wy(e,t,n))}async function Wy(e,t,n){let r=A(t,e=>Jm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/auth_url`)(a),s=L({app_return_url:i.app_return_url,credentials_name:i.credentials_name,github_installation_link:i.github_installation_link,method_type:i.method_type}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_get_auth_url_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,mi),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Gy(e,t,n){return new q(Ky(e,t,n))}async function Ky(e,t,n){let r=A(t,e=>eh.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/connectors`)(),o=L({cursor:i?.cursor,page_size:i?.page_size,query_filters:i?.query_filters}),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_list_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Cd),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function qy(e,t,n){return new q(Jy(e,t,n))}async function Jy(e,t,n){let r=A(t,e=>Xm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/organization/credentials`)(a),s=L({auth_type:i.auth_type,fetch_default:i.fetch_default}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_list_organization_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Nc),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Yy(e,t,n){return new q(Xy(e,t,n))}async function Xy(e,t,n){let r=A(t,e=>Zm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/tools`)(a),s=L({credentials_name:i.credentials_name,page:i.page,page_size:i.page_size,pretty:i.pretty,refresh:i.refresh}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_list_tools_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Qm),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Zy(e,t,n){return new q(Qy(e,t,n))}async function Qy(e,t,n){let r=A(t,e=>$m.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/user/credentials`)(a),s=L({auth_type:i.auth_type,fetch_default:i.fetch_default}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_list_user_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Nc),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function $y(e,t,n){return new q(eb(e,t,n))}async function eb(e,t,n){let r=A(t,e=>th.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={connector_id_or_name:I(`connector_id_or_name`,i.connector_id_or_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/connectors/{connector_id_or_name}/workspace/credentials`)(a),s=L({auth_type:i.auth_type,fetch_default:i.fetch_default}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_list_workspace_credentials_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Nc),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function tb(e,t,n){return new q(nb(e,t,n))}async function nb(e,t,n){let r=A(t,e=>nh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateConnectorRequest,{explode:!0}),o={connector_id:I(`connector_id`,i.connector_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/connectors/{connector_id}#id`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`connector_update_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PATCH`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Bo),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var rb=class extends R{async create(e,t){return M(_y(this,e,t))}async list(e,t){return M(Gy(this,e,t))}async getAuthUrl(e,t){return M(Uy(this,e,t))}async activateForOrganization(e,t){return M(ly(this,e,t))}async deactivateForOrganization(e,t){return M(Ty(this,e,t))}async activateForWorkspace(e,t){return M(py(this,e,t))}async deactivateForWorkspace(e,t){return M(ky(this,e,t))}async activateForUser(e,t){return M(dy(this,e,t))}async deactivateForUser(e,t){return M(Dy(this,e,t))}async callTool(e,t){return M(hy(this,e,t))}async listTools(e,t){return M(Yy(this,e,t))}async getAuthenticationMethods(e,t){return M(Vy(this,e,t))}async listOrganizationCredentials(e,t){return M(qy(this,e,t))}async createOrUpdateOrganizationCredentials(e,t){return M(yy(this,e,t))}async listWorkspaceCredentials(e,t){return M($y(this,e,t))}async createOrUpdateWorkspaceCredentials(e,t){return M(Cy(this,e,t))}async listUserCredentials(e,t){return M(Zy(this,e,t))}async createOrUpdateUserCredentials(e,t){return M(xy(this,e,t))}async deleteOrganizationCredentials(e,t){return M(Ny(this,e,t))}async deleteWorkspaceCredentials(e,t){return M(Ly(this,e,t))}async deleteUserCredentials(e,t){return M(Fy(this,e,t))}async get(e,t){return M(zy(this,e,t))}async update(e,t){return M(tb(this,e,t))}async delete(e,t){return M(jy(this,e,t))}};function ib(e,t,n){return new q(ab(e,t,n))}async function ab(e,t,n){let r=A(t,e=>bm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ConversationAppendRequest,{explode:!0}),o={conversation_id:I(`conversation_id`,i.conversation_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/conversations/{conversation_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_append`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,qs),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function ob(e,t,n){return new q(sb(e,t,n))}async function sb(e,t,n){let r=A(t,e=>xm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ConversationAppendStreamRequest,{explode:!0}),o={conversation_id:I(`conversation_id`,i.conversation_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/conversations/{conversation_id}#stream`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`text/event-stream`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_append_stream`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(sn(200,Me(e=>e instanceof ReadableStream).transform(e=>new em(e,e=>({done:!1,value:zs.parse(e)})))),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function cb(e,t,n){return new q(lb(e,t,n))}async function lb(e,t,n){let r=A(t,e=>Sm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={conversation_id:I(`conversation_id`,i.conversation_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/conversations/{conversation_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_delete`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function ub(e,t,n){return new q(db(e,t,n))}async function db(e,t,n){let r=A(t,e=>Cm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={conversation_id:I(`conversation_id`,i.conversation_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/conversations/{conversation_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,wm),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function fb(e,t,n){return new q(pb(e,t,n))}async function pb(e,t,n){let r=A(t,e=>Tm.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={conversation_id:I(`conversation_id`,i.conversation_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/conversations/{conversation_id}/history`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_history`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Bs),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function mb(e,t,n){return new q(hb(e,t,n))}async function hb(e,t,n){let r=A(t,e=>Om.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={conversation_id:I(`conversation_id`,i.conversation_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/conversations/{conversation_id}/messages`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_messages`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Hs),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function gb(e,t,n){return new q(_b(e,t,n))}async function _b(e,t,n){let r=A(t,e=>Em.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/conversations`)(),o=Ot(L({page:i?.page,page_size:i?.page_size}),At({metadata:i?.metadata},{explode:!1})),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_list`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,S(Dm)),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function vb(e,t,n){return new q(yb(e,t,n))}async function yb(e,t,n){let r=A(t,e=>km.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ConversationRestartRequest,{explode:!0}),o={conversation_id:I(`conversation_id`,i.conversation_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/conversations/{conversation_id}/restart`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_restart`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,qs),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function bb(e,t,n){return new q(xb(e,t,n))}async function xb(e,t,n){let r=A(t,e=>Am.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ConversationRestartStreamRequest,{explode:!0}),o={conversation_id:I(`conversation_id`,i.conversation_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/conversations/{conversation_id}/restart#stream`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`text/event-stream`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_restart_stream`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(sn(200,Me(e=>e instanceof ReadableStream).transform(e=>new em(e,e=>({done:!1,value:zs.parse(e)})))),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Sb(e,t,n){return new q(Cb(e,t,n))}async function Cb(e,t,n){let r=A(t,e=>Ks.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/conversations`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_start`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,qs),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function wb(e,t,n){return new q(Tb(e,t,n))}async function Tb(e,t,n){let r=A(t,e=>ec.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/conversations#stream`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`text/event-stream`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`agents_api_v1_conversations_start_stream`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(sn(200,Me(e=>e instanceof ReadableStream).transform(e=>new em(e,e=>({done:!1,value:zs.parse(e)})))),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}var Eb=class extends R{async start(e,t){return M(Sb(this,e,t))}async list(e,t){return M(gb(this,e,t))}async get(e,t){return M(ub(this,e,t))}async delete(e,t){return M(cb(this,e,t))}async append(e,t){return M(ib(this,e,t))}async getHistory(e,t){return M(fb(this,e,t))}async getMessages(e,t){return M(mb(this,e,t))}async restart(e,t){return M(vb(this,e,t))}async startStream(e,t){return M(wb(this,e,t))}async appendStream(e,t){return M(ob(this,e,t))}async restartStream(e,t){return M(bb(this,e,t))}};function Db(e,t,n){return new q(Ob(e,t,n))}async function Ob(e,t,n){let r=A(t,e=>Dc.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/libraries`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_create_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(201,yu),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function kb(e,t,n){return new q(Ab(e,t,n))}async function Ab(e,t,n){let r=A(t,e=>Ug.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_delete_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,yu),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function jb(e,t,n){return new q(Mb(e,t,n))}async function Mb(e,t,n){let r=A(t,e=>n_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_get_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,yu),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Nb(e,t,n){return new q(Pb(e,t,n))}async function Pb(e,t,n){let r=A(t,e=>c_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateLibraryRequest,{explode:!0}),o={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/libraries/{library_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_update_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PUT`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,yu),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Fb(e,t,n){return new q(Ib(e,t,n))}async function Ib(e,t,n){let r=A(t,e=>r_.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/libraries`)(),o=L({filter_owned_by_me:i?.filter_owned_by_me,page:i?.page,page_size:i?.page_size,search:i?.search}),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_list_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Mu),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Lb(e,t,n){return new q(Rb(e,t,n))}async function Rb(e,t,n){let r=A(t,e=>i_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateLibraryRequest,{explode:!0}),o={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/libraries/{library_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_patch_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PATCH`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,yu),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function zb(e,t,n){return new q(Bb(e,t,n))}async function Bb(e,t,n){let r=A(t,e=>o_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.SharingDelete,{explode:!0}),o={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/libraries/{library_id}/share`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_share_delete_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`DELETE`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Nu),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Vb(e,t,n){return new q(Hb(e,t,n))}async function Hb(e,t,n){let r=A(t,e=>s_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/share`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_share_list_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Pu),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Ub(e,t,n){return new q(Wb(e,t,n))}async function Wb(e,t,n){let r=A(t,e=>a_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.SharingRequest,{explode:!0}),o={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/libraries/{library_id}/share`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_share_create_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PUT`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Nu),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var Gb=class extends R{async list(e,t){return M(Vb(this,e,t))}async updateOrCreate(e,t){return M(Ub(this,e,t))}async delete(e,t){return M(zb(this,e,t))}};function Kb(e,t,n){return new q(qb(e,t,n))}async function qb(e,t,n){let r=A(t,e=>Wg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/documents/{document_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_delete_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function Jb(e,t,n){return new q(Yb(e,t,n))}async function Yb(e,t,n){let r=A(t,e=>Gg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_get_extracted_text_signed_url_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,b()),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Xb(e,t,n){return new q(Zb(e,t,n))}async function Zb(e,t,n){let r=A(t,e=>Yg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/documents/{document_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_get_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,ll),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Qb(e,t,n){return new q($b(e,t,n))}async function $b(e,t,n){let r=A(t,e=>Kg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/documents/{document_id}/signed-url`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_get_signed_url_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,b()),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function ex(e,t,n){return new q(tx(e,t,n))}async function tx(e,t,n){let r=A(t,e=>$g.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateDocumentRequest,{explode:!0}),o={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/libraries/{library_id}/documents/{document_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_update_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PUT`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,ll),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function nx(e,t,n){return new q(rx(e,t,n))}async function rx(e,t,n){let r=A(t,e=>Xg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/documents`)(a),s=L({filters_attributes:i.filters_attributes,page:i.page,page_size:i.page_size,search:i.search,sort_by:i.sort_by,sort_order:i.sort_order}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_list_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Ou),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function ix(e,t,n){return new q(ax(e,t,n))}async function ax(e,t,n){let r=A(t,e=>Qg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/documents/{document_id}/reprocess`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_reprocess_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function ox(e,t,n){return new q(sx(e,t,n))}async function sx(e,t,n){let r=A(t,e=>qg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/documents/{document_id}/status`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_get_status_v1`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Id),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function cx(e,t,n){return new q(lx(e,t,n))}async function lx(e,t,n){let r=A(t,e=>Jg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/libraries/{library_id}/documents/{document_id}/text_content`)(a),s=L({page_end:i.page_end,page_start:i.page_start}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_get_text_content_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,ul),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function ux(e,t,n){return new q(dx(e,t,n))}async function dx(e,t,n){let r=A(t,e=>Zg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateDocumentRequest,{explode:!0}),o={document_id:I(`document_id`,i.document_id,{explode:!1,charEncoding:`percent`}),library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/libraries/{library_id}/documents/{document_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_patch_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PATCH`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,ll),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function fx(e,t,n){return new q(px(e,t,n))}async function px(e,t,n){let r=A(t,e=>t_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=new FormData;if(ei(i.RequestBody.file)){let e=i.RequestBody.file;Mt(a,`file`,await Nt(e),`name`in e?e.name:void 0)}else if(cv(i.RequestBody.file.content))Mt(a,`file`,ze(await Le(i.RequestBody.file.content),Re(i.RequestBody.file.fileName)||`application/octet-stream`),i.RequestBody.file.fileName);else{let e=Re(i.RequestBody.file.fileName)||`application/octet-stream`;Mt(a,`file`,ze(i.RequestBody.file.content,e),i.RequestBody.file.fileName)}let o={library_id:I(`library_id`,i.library_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/libraries/{library_id}/documents`)(o),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`libraries_documents_upload_v1`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B([200,201],ll),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var mx=class extends R{async list(e,t){return M(nx(this,e,t))}async upload(e,t){return M(fx(this,e,t))}async get(e,t){return M(Xb(this,e,t))}async update(e,t){return M(ux(this,e,t))}async librariesDocumentsUpdateV1(e,t){return M(ex(this,e,t))}async delete(e,t){return M(Kb(this,e,t))}async textContent(e,t){return M(cx(this,e,t))}async status(e,t){return M(ox(this,e,t))}async getSignedUrl(e,t){return M(Qb(this,e,t))}async extractedTextSignedUrl(e,t){return M(Jb(this,e,t))}async reprocess(e,t){return M(ix(this,e,t))}},hx=class extends R{_documents;get documents(){return this._documents??=new mx(this._options)}_accesses;get accesses(){return this._accesses??=new Gb(this._options)}async list(e,t){return M(Fb(this,e,t))}async create(e,t){return M(Db(this,e,t))}async get(e,t){return M(jb(this,e,t))}async delete(e,t){return M(kb(this,e,t))}async update(e,t){return M(Lb(this,e,t))}async librariesUpdateV1(e,t){return M(Nb(this,e,t))}};function gx(e,t,n){return new q(_x(e,t,n))}async function _x(e,t,n){let r=A(t,e=>rc.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/observability/campaigns`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`create_campaign_v1_observability_campaigns_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(201,Yi),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function vx(e,t,n){return new q(yx(e,t,n))}async function yx(e,t,n){let r=A(t,e=>ih.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={campaign_id:I(`campaign_id`,i.campaign_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/campaigns/{campaign_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`delete_campaign_v1_observability_campaigns__campaign_id__delete`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function bx(e,t,n){return new q(xx(e,t,n))}async function xx(e,t,n){let r=A(t,e=>Sh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={campaign_id:I(`campaign_id`,i.campaign_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/campaigns/{campaign_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_campaign_by_id_v1_observability_campaigns__campaign_id__get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Yi),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Sx(e,t,n){return new q(Cx(e,t,n))}async function Cx(e,t,n){let r=A(t,e=>wh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={campaign_id:I(`campaign_id`,i.campaign_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/campaigns/{campaign_id}/status`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_campaign_status_by_id_v1_observability_campaigns__campaign_id__status_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Ml),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function wx(e,t,n){return new q(Tx(e,t,n))}async function Tx(e,t,n){let r=A(t,e=>Th.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/observability/campaigns`)(),o=L({page:i?.page,page_size:i?.page_size,q:i?.q}),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_campaigns_v1_observability_campaigns_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Su),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Ex(e,t,n){return new q(Dx(e,t,n))}async function Dx(e,t,n){let r=A(t,e=>Ch.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={campaign_id:I(`campaign_id`,i.campaign_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/campaigns/{campaign_id}/selected-events`)(a),s=L({page:i.page,page_size:i.page_size}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_campaign_selected_events_v1_observability_campaigns__campaign_id__selected_events_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,xu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var Ox=class extends R{async create(e,t){return M(gx(this,e,t))}async list(e,t){return M(wx(this,e,t))}async fetch(e,t){return M(bx(this,e,t))}async delete(e,t){return M(vx(this,e,t))}async fetchStatus(e,t){return M(Sx(this,e,t))}async listEvents(e,t){return M(Ex(this,e,t))}};function kx(e,t,n){return new q(Ax(e,t,n))}async function Ax(e,t,n){let r=A(t,e=>Dh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={event_id:I(`event_id`,i.event_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/chat-completion-events/{event_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_chat_completion_event_v1_observability_chat_completion_events__event_id__get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,na),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function jx(e,t,n){return new q(Mx(e,t,n))}async function Mx(e,t,n){let r=A(t,e=>qh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={event_id:I(`event_id`,i.event_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/chat-completion-events/{event_id}/similar-events`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_similar_chat_completion_events_v1_observability_chat_completion_events__event_id__similar_events_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Zd),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Nx(e,t,n){return new q(Px(e,t,n))}async function Px(e,t,n){let r=A(t,e=>Bg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.JudgeChatCompletionEventRequest,{explode:!0}),o={event_id:I(`event_id`,i.event_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/chat-completion-events/{event_id}/live-judging`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`judge_chat_completion_event_v1_observability_chat_completion_events__event_id__live_judging_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,gu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Fx(e,t,n){return new q(Ix(e,t,n))}async function Ix(e,t,n){let r=A(t,e=>Eh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.SearchChatCompletionEventsRequest,{explode:!0}),o=N(`/v1/observability/chat-completion-events/search`)(),s=L({cursor:i.cursor,page_size:i.page_size}),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_chat_completion_events_v1_observability_chat_completion_events_search_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Zd),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Lx(e,t,n){return new q(Rx(e,t,n))}async function Rx(e,t,n){let r=A(t,e=>Jd.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/observability/chat-completion-events/search-ids`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_chat_completion_event_ids_v1_observability_chat_completion_events_search_ids_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Yd),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function zx(e,t,n){return new q(Bx(e,t,n))}async function Bx(e,t,n){let r=A(t,e=>Oh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.FetchFieldOptionCountsRequest,{explode:!0}),o={field_name:I(`field_name`,i.field_name,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/chat-completion-fields/{field_name}/options-counts`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_chat_completion_field_options_counts_v1_observability_chat_completion_fields__field_name__options_counts_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Fl),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Vx(e,t,n){return new q(Hx(e,t,n))}async function Hx(e,t,n){let r=A(t,e=>Ah.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={field_name:I(`field_name`,i.field_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/chat-completion-fields/{field_name}/options`)(a),s=L({operator:i.operator}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_chat_completion_field_options_v1_observability_chat_completion_fields__field_name__options_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Nl),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Ux(e,t){return new q(Wx(e,t))}async function Wx(e,t){let n=N(`/v1/observability/chat-completion-fields`)(),r=new Headers(d({Accept:`application/json`})),i=await W(e._options.apiKey),a=U(i==null?{}:{apiKey:i}),o={options:e._options,baseURL:t?.serverURL??e._baseURL??``,operationID:`get_chat_completion_fields_v1_observability_chat_completion_fields_get`,oAuth2Scopes:null,resolvedSecurity:a,securitySource:e._options.apiKey,retryConfig:t?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:t?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},s=e._createRequest(o,{security:a,method:`GET`,baseURL:t?.serverURL,path:n,headers:r,userAgent:e._options.userAgent,timeoutMs:t?.timeoutMs||e._options.timeoutMs||6e4},t);if(!s.ok)return[s,{status:`invalid`}];let c=s.value,l=await e._do(c,{context:o,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!l.ok)return[l,{status:`request-error`,request:c}];let u=l.value,f={HttpMeta:{Response:u,Request:c}},[p]=await H(B(200,Cu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(u,c,{extraFields:f});return p.ok,[p,{status:`complete`,request:c,response:u}]}var Gx=class extends R{async list(e){return M(Ux(this,e))}async fetchOptions(e,t){return M(Vx(this,e,t))}async fetchOptionCounts(e,t){return M(zx(this,e,t))}},Kx=class extends R{_fields;get fields(){return this._fields??=new Gx(this._options)}async search(e,t){return M(Fx(this,e,t))}async searchIds(e,t){return M(Lx(this,e,t))}async fetch(e,t){return M(kx(this,e,t))}async fetchSimilarEvents(e,t){return M(jx(this,e,t))}async judge(e,t){return M(Nx(this,e,t))}};function qx(e,t,n){return new q(Jx(e,t,n))}async function Jx(e,t,n){let r=A(t,e=>sc.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/observability/datasets`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`create_dataset_v1_observability_datasets_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(201,Xc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function Yx(e,t,n){return new q(Xx(e,t,n))}async function Xx(e,t,n){let r=A(t,e=>rh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.CreateDatasetRecordRequest,{explode:!0}),o={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/datasets/{dataset_id}/records`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`create_dataset_record_v1_observability_datasets__dataset_id__records_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(201,$c),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function Zx(e,t,n){return new q(Qx(e,t,n))}async function Qx(e,t,n){let r=A(t,e=>oh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/datasets/{dataset_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`delete_dataset_v1_observability_datasets__dataset_id__delete`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function $x(e,t,n){return new q(eS(e,t,n))}async function eS(e,t,n){let r=A(t,e=>mh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/datasets/{dataset_id}/exports/to-jsonl`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`export_dataset_to_jsonl_v1_observability_datasets__dataset_id__exports_to_jsonl_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Sl),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function tS(e,t,n){return new q(nS(e,t,n))}async function nS(e,t,n){let r=A(t,e=>jh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/datasets/{dataset_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_dataset_by_id_v1_observability_datasets__dataset_id__get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Qc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function rS(e,t,n){return new q(iS(e,t,n))}async function iS(e,t,n){let r=A(t,e=>Nh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`}),task_id:I(`task_id`,i.task_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/datasets/{dataset_id}/tasks/{task_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_dataset_import_task_v1_observability_datasets__dataset_id__tasks__task_id__get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Zc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function aS(e,t,n){return new q(oS(e,t,n))}async function oS(e,t,n){let r=A(t,e=>b_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ImportDatasetFromCampaignRequest,{explode:!0}),o={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/datasets/{dataset_id}/imports/from-campaign`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`post_dataset_records_from_campaign_v1_observability_datasets__dataset_id__imports_from_campaign_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(202,Zc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function sS(e,t,n){return new q(cS(e,t,n))}async function cS(e,t,n){let r=A(t,e=>x_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ImportDatasetFromDatasetRequest,{explode:!0}),o={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/datasets/{dataset_id}/imports/from-dataset`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`post_dataset_records_from_dataset_v1_observability_datasets__dataset_id__imports_from_dataset_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(202,Zc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function lS(e,t,n){return new q(uS(e,t,n))}async function uS(e,t,n){let r=A(t,e=>S_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ImportDatasetFromExplorerRequest,{explode:!0}),o={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/datasets/{dataset_id}/imports/from-explorer`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`post_dataset_records_from_explorer_v1_observability_datasets__dataset_id__imports_from_explorer_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(202,Zc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function dS(e,t,n){return new q(fS(e,t,n))}async function fS(e,t,n){let r=A(t,e=>C_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ImportDatasetFromFileRequest,{explode:!0}),o={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/datasets/{dataset_id}/imports/from-file`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`post_dataset_records_from_file_v1_observability_datasets__dataset_id__imports_from_file_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(202,Zc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function pS(e,t,n){return new q(mS(e,t,n))}async function mS(e,t,n){let r=A(t,e=>w_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.ImportDatasetFromPlaygroundRequest,{explode:!0}),o={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/datasets/{dataset_id}/imports/from-playground`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`post_dataset_records_from_playground_v1_observability_datasets__dataset_id__imports_from_playground_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(202,Zc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function hS(e,t,n){return new q(gS(e,t,n))}async function gS(e,t,n){let r=A(t,e=>Ih.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/observability/datasets`)(),o=L({page:i?.page,page_size:i?.page_size,q:i?.q}),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_datasets_v1_observability_datasets_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Eu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function _S(e,t,n){return new q(vS(e,t,n))}async function vS(e,t,n){let r=A(t,e=>Ph.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/datasets/{dataset_id}/records`)(a),s=L({page:i.page,page_size:i.page_size}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_dataset_records_v1_observability_datasets__dataset_id__records_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Tu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function yS(e,t,n){return new q(bS(e,t,n))}async function bS(e,t,n){let r=A(t,e=>Mh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/datasets/{dataset_id}/tasks`)(a),s=L({page:i.page,page_size:i.page_size}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_dataset_import_tasks_v1_observability_datasets__dataset_id__tasks_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,wu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function xS(e,t,n){return new q(SS(e,t,n))}async function SS(e,t,n){let r=A(t,e=>Z_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateDatasetRequest,{explode:!0}),o={dataset_id:I(`dataset_id`,i.dataset_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/datasets/{dataset_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`update_dataset_v1_observability_datasets__dataset_id__patch`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PATCH`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Qc),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function CS(e,t,n){return new q(wS(e,t,n))}async function wS(e,t,n){let r=A(t,e=>tl.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/observability/dataset-records/bulk-delete`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`delete_dataset_records_v1_observability_dataset_records_bulk_delete_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function TS(e,t,n){return new q(ES(e,t,n))}async function ES(e,t,n){let r=A(t,e=>ah.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={dataset_record_id:I(`dataset_record_id`,i.dataset_record_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/dataset-records/{dataset_record_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`delete_dataset_record_v1_observability_dataset_records__dataset_record_id__delete`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function DS(e,t,n){return new q(OS(e,t,n))}async function OS(e,t,n){let r=A(t,e=>Fh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={dataset_record_id:I(`dataset_record_id`,i.dataset_record_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/dataset-records/{dataset_record_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_dataset_record_v1_observability_dataset_records__dataset_record_id__get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,$c),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function kS(e,t,n){return new q(AS(e,t,n))}async function AS(e,t,n){let r=A(t,e=>Hg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.JudgeDatasetRecordRequest,{explode:!0}),o={dataset_record_id:I(`dataset_record_id`,i.dataset_record_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/dataset-records/{dataset_record_id}/live-judging`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`judge_dataset_record_v1_observability_dataset_records__dataset_record_id__live_judging_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,gu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function jS(e,t,n){return new q(MS(e,t,n))}async function MS(e,t,n){let r=A(t,e=>Y_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateDatasetRecordPayloadRequest,{explode:!0}),o={dataset_record_id:I(`dataset_record_id`,i.dataset_record_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/dataset-records/{dataset_record_id}/payload`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`update_dataset_record_payload_v1_observability_dataset_records__dataset_record_id__payload_put`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PUT`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let _=h.value,v={HttpMeta:{Response:_,Request:m}},[y]=await H(cn(204,g()),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(_,m,{extraFields:v});return y.ok,[y,{status:`complete`,request:m,response:_}]}function NS(e,t,n){return new q(PS(e,t,n))}async function PS(e,t,n){let r=A(t,e=>X_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateDatasetRecordPropertiesRequest,{explode:!0}),o={dataset_record_id:I(`dataset_record_id`,i.dataset_record_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/dataset-records/{dataset_record_id}/properties`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`update_dataset_record_properties_v1_observability_dataset_records__dataset_record_id__properties_put`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PUT`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let _=h.value,v={HttpMeta:{Response:_,Request:m}},[y]=await H(cn(204,g()),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(_,m,{extraFields:v});return y.ok,[y,{status:`complete`,request:m,response:_}]}var FS=class extends R{async fetch(e,t){return M(DS(this,e,t))}async delete(e,t){return M(TS(this,e,t))}async bulkDelete(e,t){return M(CS(this,e,t))}async judge(e,t){return M(kS(this,e,t))}async updatePayload(e,t){return M(jS(this,e,t))}async updateProperties(e,t){return M(NS(this,e,t))}},IS=class extends R{_records;get records(){return this._records??=new FS(this._options)}async create(e,t){return M(qx(this,e,t))}async list(e,t){return M(hS(this,e,t))}async fetch(e,t){return M(tS(this,e,t))}async delete(e,t){return M(Zx(this,e,t))}async update(e,t){return M(xS(this,e,t))}async listRecords(e,t){return M(_S(this,e,t))}async createRecord(e,t){return M(Yx(this,e,t))}async importFromCampaign(e,t){return M(aS(this,e,t))}async importFromExplorer(e,t){return M(lS(this,e,t))}async importFromFile(e,t){return M(dS(this,e,t))}async importFromPlayground(e,t){return M(pS(this,e,t))}async importFromDatasetRecords(e,t){return M(sS(this,e,t))}async exportToJsonl(e,t){return M($x(this,e,t))}async fetchTask(e,t){return M(rS(this,e,t))}async listTasks(e,t){return M(yS(this,e,t))}};function LS(e,t,n){return new q(RS(e,t,n))}async function RS(e,t,n){let r=A(t,e=>Tc.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/observability/judges`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`create_judge_v1_observability_judges_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(201,Ji),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function zS(e,t,n){return new q(BS(e,t,n))}async function BS(e,t,n){let r=A(t,e=>sh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={judge_id:I(`judge_id`,i.judge_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/judges/{judge_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`delete_judge_v1_observability_judges__judge_id__delete`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`DELETE`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,_={HttpMeta:{Response:h,Request:p}},[v]=await H(cn(204,g()),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:_});return v.ok,[v,{status:`complete`,request:p,response:h}]}function VS(e,t,n){return new q(HS(e,t,n))}async function HS(e,t,n){let r=A(t,e=>Rh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={judge_id:I(`judge_id`,i.judge_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/judges/{judge_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_judge_by_id_v1_observability_judges__judge_id__get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Ji),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function US(e,t,n){return new q(WS(e,t,n))}async function WS(e,t,n){let r=A(t,e=>Vg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.JudgeConversationRequest,{explode:!0}),o={judge_id:I(`judge_id`,i.judge_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/judges/{judge_id}/live-judging`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`judge_conversation_v1_observability_judges__judge_id__live_judging_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,gu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function GS(e,t,n){return new q(KS(e,t,n))}async function KS(e,t,n){let r=A(t,e=>zh.optional().parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=N(`/v1/observability/judges`)(),o=L({model_filter:i?.model_filter,page:i?.page,page_size:i?.page_size,q:i?.q,type_filter:i?.type_filter}),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_judges_v1_observability_judges_get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:a,headers:s,query:o,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,ju),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function qS(e,t,n){return new q(JS(e,t,n))}async function JS(e,t,n){let r=A(t,e=>Q_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateJudgeRequest,{explode:!0}),o={judge_id:I(`judge_id`,i.judge_id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/observability/judges/{judge_id}`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`update_judge_v1_observability_judges__judge_id__put`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PUT`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let _=h.value,v={HttpMeta:{Response:_,Request:m}},[y]=await H(cn(204,g()),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(_,m,{extraFields:v});return y.ok,[y,{status:`complete`,request:m,response:_}]}var YS=class extends R{async create(e,t){return M(LS(this,e,t))}async list(e,t){return M(GS(this,e,t))}async fetch(e,t){return M(VS(this,e,t))}async delete(e,t){return M(zS(this,e,t))}async update(e,t){return M(qS(this,e,t))}async judgeConversation(e,t){return M(US(this,e,t))}};function XS(e,t,n){return new q(ZS(e,t,n))}async function ZS(e,t,n){let r=A(t,e=>Bh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={field_name:I(`field_name`,i.field_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/logs/fields/{field_name}/options`)(a),s=L({from:i.from,to:i.to}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_log_field_options_v1_observability_logs_fields__field_name__options_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Ul),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function QS(e,t){return new q($S(e,t))}async function $S(e,t){let n=N(`/v1/observability/logs/fields`)(),r=new Headers(d({Accept:`application/json`})),i=await W(e._options.apiKey),a=U(i==null?{}:{apiKey:i}),o={options:e._options,baseURL:t?.serverURL??e._baseURL??``,operationID:`get_log_fields_v1_observability_logs_fields_get`,oAuth2Scopes:null,resolvedSecurity:a,securitySource:e._options.apiKey,retryConfig:t?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:t?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},s=e._createRequest(o,{security:a,method:`GET`,baseURL:t?.serverURL,path:n,headers:r,userAgent:e._options.userAgent,timeoutMs:t?.timeoutMs||e._options.timeoutMs||6e4},t);if(!s.ok)return[s,{status:`invalid`}];let c=s.value,l=await e._do(c,{context:o,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!l.ok)return[l,{status:`request-error`,request:c}];let u=l.value,f={HttpMeta:{Response:u,Request:c}},[p]=await H(B(200,Yl),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(u,c,{extraFields:f});return p.ok,[p,{status:`complete`,request:c,response:u}]}function eC(e,t,n){return new q(tC(e,t,n))}async function tC(e,t,n){let r=A(t,e=>j_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.LogsRequest,{explode:!0}),o=N(`/v1/observability/logs/search`)(),s=L({cursor:i.cursor,from:i.from,page_size:i.page_size,to:i.to}),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`search_logs_v1_observability_logs_search_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Xl),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var nC=class extends R{async search(e,t){return M(eC(this,e,t))}async list(e){return M(QS(this,e))}async fetchOptions(e,t){return M(XS(this,e,t))}};function rC(e,t,n){return new q(iC(e,t,n))}async function iC(e,t,n){let r=A(t,e=>Yh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={field_name:I(`field_name`,i.field_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/spans/evaluations/fields/{field_name}/options`)(a),s=L({from:i.from,to:i.to}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_span_evaluation_field_options_v1_observability_spans_evaluations_fields__field_name__options_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,Ql),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function aC(e,t,n){return new q(oC(e,t,n))}async function oC(e,t,n){let r=A(t,e=>Xh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={field_name:I(`field_name`,i.field_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/spans/fields/{field_name}/options`)(a),s=L({from:i.from,to:i.to}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_span_field_options_v1_observability_spans_fields__field_name__options_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,tu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function sC(e,t){return new q(cC(e,t))}async function cC(e,t){let n=N(`/v1/observability/spans/evaluations/fields`)(),r=new Headers(d({Accept:`application/json`})),i=await W(e._options.apiKey),a=U(i==null?{}:{apiKey:i}),o={options:e._options,baseURL:t?.serverURL??e._baseURL??``,operationID:`get_span_evaluation_fields_v1_observability_spans_evaluations_fields_get`,oAuth2Scopes:null,resolvedSecurity:a,securitySource:e._options.apiKey,retryConfig:t?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:t?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},s=e._createRequest(o,{security:a,method:`GET`,baseURL:t?.serverURL,path:n,headers:r,userAgent:e._options.userAgent,timeoutMs:t?.timeoutMs||e._options.timeoutMs||6e4},t);if(!s.ok)return[s,{status:`invalid`}];let c=s.value,l=await e._do(c,{context:o,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!l.ok)return[l,{status:`request-error`,request:c}];let u=l.value,f={HttpMeta:{Response:u,Request:c}},[p]=await H(B(200,$l),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(u,c,{extraFields:f});return p.ok,[p,{status:`complete`,request:c,response:u}]}function lC(e,t){return new q(uC(e,t))}async function uC(e,t){let n=N(`/v1/observability/spans/fields`)(),r=new Headers(d({Accept:`application/json`})),i=await W(e._options.apiKey),a=U(i==null?{}:{apiKey:i}),o={options:e._options,baseURL:t?.serverURL??e._baseURL??``,operationID:`get_span_fields_v1_observability_spans_fields_get`,oAuth2Scopes:null,resolvedSecurity:a,securitySource:e._options.apiKey,retryConfig:t?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:t?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},s=e._createRequest(o,{security:a,method:`GET`,baseURL:t?.serverURL,path:n,headers:r,userAgent:e._options.userAgent,timeoutMs:t?.timeoutMs||e._options.timeoutMs||6e4},t);if(!s.ok)return[s,{status:`invalid`}];let c=s.value,l=await e._do(c,{context:o,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!l.ok)return[l,{status:`request-error`,request:c}];let u=l.value,f={HttpMeta:{Response:u,Request:c}},[p]=await H(B(200,nu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(u,c,{extraFields:f});return p.ok,[p,{status:`complete`,request:c,response:u}]}function dC(e,t,n){return new q(fC(e,t,n))}async function fC(e,t,n){let r=A(t,e=>A_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.SpanEvaluationsRequest,{explode:!0}),o=N(`/v1/observability/spans/evaluations/search/latest`)(),s=L({cursor:i.cursor,from:i.from,page_size:i.page_size,to:i.to}),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`search_latest_span_evaluations_v1_observability_spans_evaluations_search_latest_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,eu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function pC(e,t,n){return new q(mC(e,t,n))}async function mC(e,t,n){let r=A(t,e=>M_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.SpanEvaluationsRequest,{explode:!0}),o=N(`/v1/observability/spans/evaluations/search`)(),s=L({cursor:i.cursor,from:i.from,page_size:i.page_size,to:i.to}),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`search_span_evaluations_v1_observability_spans_evaluations_search_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,eu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function hC(e,t,n){return new q(gC(e,t,n))}async function gC(e,t,n){let r=A(t,e=>N_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.SpansRequest,{explode:!0}),o=N(`/v1/observability/spans/search`)(),s=L({cursor:i.cursor,from:i.from,page_size:i.page_size,to:i.to}),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`search_spans_v1_observability_spans_search_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,ru),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var _C=class extends R{async searchSpans(e,t){return M(hC(this,e,t))}async searchSpanEvaluations(e,t){return M(pC(this,e,t))}async searchLatestSpanEvaluations(e,t){return M(dC(this,e,t))}async listSpanFields(e){return M(lC(this,e))}async listSpanEvalFields(e){return M(sC(this,e))}async fetchSpanFieldOptions(e,t){return M(aC(this,e,t))}async fetchSpanEvalFieldOptions(e,t){return M(rC(this,e,t))}};function vC(e,t,n){return new q(yC(e,t,n))}async function yC(e,t,n){let r=A(t,e=>eg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={field_name:I(`field_name`,i.field_name,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/traces/fields/{field_name}/options`)(a),s=L({from:i.from,to:i.to}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_trace_field_options_v1_observability_traces_fields__field_name__options_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,iu),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function bC(e,t,n){return new q(xC(e,t,n))}async function xC(e,t,n){let r=A(t,e=>Jh.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={span_id:I(`span_id`,i.span_id,{explode:!1,charEncoding:`percent`}),trace_id:I(`trace_id`,i.trace_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/traces/{trace_id}/spans/{span_id}`)(a),s=L({from:i.from,to:i.to}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_span_by_id_v1_observability_traces__trace_id__spans__span_id__get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,El),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function SC(e,t,n){return new q(CC(e,t,n))}async function CC(e,t,n){let r=A(t,e=>$h.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={trace_id:I(`trace_id`,i.trace_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/traces/{trace_id}`)(a),s=new Headers(d({Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_trace_by_id_v1_observability_traces__trace_id__get`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`GET`,baseURL:n?.serverURL,path:o,headers:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,Al),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function wC(e,t){return new q(TC(e,t))}async function TC(e,t){let n=N(`/v1/observability/traces/fields`)(),r=new Headers(d({Accept:`application/json`})),i=await W(e._options.apiKey),a=U(i==null?{}:{apiKey:i}),o={options:e._options,baseURL:t?.serverURL??e._baseURL??``,operationID:`get_trace_fields_v1_observability_traces_fields_get`,oAuth2Scopes:null,resolvedSecurity:a,securitySource:e._options.apiKey,retryConfig:t?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:t?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},s=e._createRequest(o,{security:a,method:`GET`,baseURL:t?.serverURL,path:n,headers:r,userAgent:e._options.userAgent,timeoutMs:t?.timeoutMs||e._options.timeoutMs||6e4},t);if(!s.ok)return[s,{status:`invalid`}];let c=s.value,l=await e._do(c,{context:o,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!l.ok)return[l,{status:`request-error`,request:c}];let u=l.value,f={HttpMeta:{Response:u,Request:c}},[p]=await H(B(200,au),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(u,c,{extraFields:f});return p.ok,[p,{status:`complete`,request:c,response:u}]}function EC(e,t,n){return new q(DC(e,t,n))}async function DC(e,t,n){let r=A(t,e=>tg.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a={trace_id:I(`trace_id`,i.trace_id,{explode:!1,charEncoding:`percent`})},o=N(`/v1/observability/traces/{trace_id}/spans`)(a),s=L({cursor:i.cursor,from:i.from,page_size:i.page_size,to:i.to}),c=new Headers(d({Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`get_trace_spans_v1_observability_traces__trace_id__spans_get`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`GET`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:null,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,ru),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}function OC(e,t,n){return new q(kC(e,t,n))}async function kC(e,t,n){let r=A(t,e=>P_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.TracesRequest,{explode:!0}),o=N(`/v1/observability/traces/search`)(),s=L({cursor:i.cursor,from:i.from,page_size:i.page_size,to:i.to}),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`search_traces_v1_observability_traces_search_post`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`POST`,baseURL:n?.serverURL,path:o,headers:c,query:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,ou),z([400,404,408,409,422],K),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var AC=class extends R{async search(e,t){return M(OC(this,e,t))}async getTraceFields(e){return M(wC(this,e))}async getTraceById(e,t){return M(SC(this,e,t))}async getTraceSpans(e,t){return M(EC(this,e,t))}async fetchOptions(e,t){return M(vC(this,e,t))}async getSpanById(e,t){return M(bC(this,e,t))}},jC=class extends R{_chatCompletionEvents;get chatCompletionEvents(){return this._chatCompletionEvents??=new Kx(this._options)}_judges;get judges(){return this._judges??=new YS(this._options)}_campaigns;get campaigns(){return this._campaigns??=new Ox(this._options)}_datasets;get datasets(){return this._datasets??=new IS(this._options)}_logs;get logs(){return this._logs??=new nC(this._options)}_traces;get traces(){return this._traces??=new AC(this._options)}_spans;get spans(){return this._spans??=new _C(this._options)}};function MC(e,t){return new q(NC(e,t))}async function NC(e,t){let n=N(`/v1/rag/ingestion_pipeline_configurations`)(),r=new Headers(d({Accept:`application/json`})),i=await W(e._options.apiKey),a=U(i==null?{}:{apiKey:i}),o={options:e._options,baseURL:t?.serverURL??e._baseURL??``,operationID:`get_configs_v1_rag_ingestion_pipeline_configurations_get`,oAuth2Scopes:null,resolvedSecurity:a,securitySource:e._options.apiKey,retryConfig:t?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:t?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},s=e._createRequest(o,{security:a,method:`GET`,baseURL:t?.serverURL,path:n,headers:r,userAgent:e._options.userAgent,timeoutMs:t?.timeoutMs||e._options.timeoutMs||6e4},t);if(!s.ok)return[s,{status:`invalid`}];let c=s.value,l=await e._do(c,{context:o,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!l.ok)return[l,{status:`request-error`,request:c}];let u=l.value,[f]=await H(B(200,S(fu)),V(`4XX`),V(`5XX`))(u,c);return f.ok,[f,{status:`complete`,request:c,response:u}]}function PC(e,t,n){return new q(FC(e,t,n))}async function FC(e,t,n){let r=A(t,e=>wc.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/rag/ingestion_pipeline_configurations`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`register_config_v1_rag_ingestion_pipeline_configurations_put`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`PUT`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,fu),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function IC(e,t,n){return new q(LC(e,t,n))}async function LC(e,t,n){let r=A(t,e=>$_.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i.UpdateRunInfo,{explode:!0}),o={id:I(`id`,i.id,{explode:!1,charEncoding:`percent`})},s=N(`/v1/rag/ingestion_pipeline_configurations/{id}/run_info`)(o),c=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),l=await W(e._options.apiKey),u=U(l==null?{}:{apiKey:l}),f={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`update_run_info_v1_rag_ingestion_pipeline_configurations__id__run_info_put`,oAuth2Scopes:null,resolvedSecurity:u,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},p=e._createRequest(f,{security:u,method:`PUT`,baseURL:n?.serverURL,path:s,headers:c,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!p.ok)return[p,{status:`invalid`}];let m=p.value,h=await e._do(m,{context:f,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:f.retryConfig,retryCodes:f.retryCodes});if(!h.ok)return[h,{status:`request-error`,request:m}];let g=h.value,_={HttpMeta:{Response:g,Request:m}},[v]=await H(B(200,fu),z(422,G),V(`4XX`),V(`5XX`))(g,m,{extraFields:_});return v.ok,[v,{status:`complete`,request:m,response:g}]}var RC=class extends R{async list(e){return M(MC(this,e))}async register(e,t){return M(PC(this,e,t))}async updateRunInfo(e,t){return M(IC(this,e,t))}};function zC(e,t){return new q(BC(e,t))}async function BC(e,t){let n=N(`/v1/rag/search_index`)(),r=new Headers(d({Accept:`application/json`})),i=await W(e._options.apiKey),a=U(i==null?{}:{apiKey:i}),o={options:e._options,baseURL:t?.serverURL??e._baseURL??``,operationID:`get_search_indexes_v1_rag_search_index_get`,oAuth2Scopes:null,resolvedSecurity:a,securitySource:e._options.apiKey,retryConfig:t?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:t?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},s=e._createRequest(o,{security:a,method:`GET`,baseURL:t?.serverURL,path:n,headers:r,userAgent:e._options.userAgent,timeoutMs:t?.timeoutMs||e._options.timeoutMs||6e4},t);if(!s.ok)return[s,{status:`invalid`}];let c=s.value,l=await e._do(c,{context:o,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!l.ok)return[l,{status:`request-error`,request:c}];let u=l.value,[f]=await H(B(200,S(tf)),V(`4XX`),V(`5XX`))(u,c);return f.ok,[f,{status:`complete`,request:c,response:u}]}function VC(e,t,n){return new q(HC(e,t,n))}async function HC(e,t,n){let r=A(t,e=>jc.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/rag/search_index`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`register_search_index_v1_rag_search_index_put`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`PUT`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,tf),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}var UC=class extends R{async list(e){return M(zC(this,e))}async register(e,t){return M(VC(this,e,t))}},WC=class extends R{_ingestionPipelineConfigurations;get ingestionPipelineConfigurations(){return this._ingestionPipelineConfigurations??=new RC(this._options)}_searchIndexes;get searchIndexes(){return this._searchIndexes??=new UC(this._options)}},GC=class extends R{_conversations;get conversations(){return this._conversations??=new Eb(this._options)}_agents;get agents(){return this._agents??=new cy(this._options)}_libraries;get libraries(){return this._libraries??=new hx(this._options)}_observability;get observability(){return this._observability??=new jC(this._options)}_connectors;get connectors(){return this._connectors??=new rb(this._options)}_rag;get rag(){return this._rag??=new WC(this._options)}};function KC(e,t,n){return new q(qC(e,t,n))}async function qC(e,t,n){let r=A(t,e=>ia.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/chat/completions`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`application/json`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`chat_completion_v1_chat_completions_post`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(B(200,aa),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}function JC(e,t,n){return new q(YC(e,t,n))}async function YC(e,t,n){let r=A(t,e=>oa.parse(e),`Input validation failed`);if(!r.ok)return[r,{status:`invalid`}];let i=r.value,a=F(`body`,i,{explode:!0}),o=N(`/v1/chat/completions#stream`)(),s=new Headers(d({"Content-Type":`application/json`,Accept:`text/event-stream`})),c=await W(e._options.apiKey),l=U(c==null?{}:{apiKey:c}),u={options:e._options,baseURL:n?.serverURL??e._baseURL??``,operationID:`stream_chat`,oAuth2Scopes:null,resolvedSecurity:l,securitySource:e._options.apiKey,retryConfig:n?.retries||e._options.retryConfig||{strategy:`none`},retryCodes:n?.retryCodes||[`429`,`500`,`502`,`503`,`504`]},f=e._createRequest(u,{security:l,method:`POST`,baseURL:n?.serverURL,path:o,headers:s,body:a,userAgent:e._options.userAgent,timeoutMs:n?.timeoutMs||e._options.timeoutMs||6e4},n);if(!f.ok)return[f,{status:`invalid`}];let p=f.value,m=await e._do(p,{context:u,isErrorStatusCode:e=>P({status:e},[`4XX`,`5XX`]),retryConfig:u.retryConfig,retryCodes:u.retryCodes});if(!m.ok)return[m,{status:`request-error`,request:p}];let h=m.value,g={HttpMeta:{Response:h,Request:p}},[_]=await H(sn(200,Me(e=>e instanceof ReadableStream).transform(e=>new em(e,e=>e.data===`[DONE]`?{done:!0,value:void 0}:{done:!1,value:Fa.parse(e)}))),z(422,G),V(`4XX`),V(`5XX`))(h,p,{extraFields:g});return _.ok,[_,{status:`complete`,request:p,response:h}]}var XC=Symbol(`Let zodToJsonSchema decide on which parser to use`),ZC={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,target:`jsonSchema7`,strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`,openAiAnyTypeName:`OpenAiAnyType`},QC=e=>typeof e==`string`?{...ZC,name:e}:{...ZC,...e},$C=e=>{let t=QC(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function ew(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function tw(e,t,n,r,i){e[t]=n,ew(e,t,r,i)}var nw=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)},rw;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(rw||={});var iw;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(iw||={});var J=rw.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),aw=e=>{switch(typeof e){case`undefined`:return J.undefined;case`string`:return J.string;case`number`:return Number.isNaN(e)?J.nan:J.number;case`boolean`:return J.boolean;case`function`:return J.function;case`bigint`:return J.bigint;case`symbol`:return J.symbol;case`object`:return Array.isArray(e)?J.array:e===null?J.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?J.promise:typeof Map<`u`&&e instanceof Map?J.map:typeof Set<`u`&&e instanceof Set?J.set:typeof Date<`u`&&e instanceof Date?J.date:J.object;default:return J.unknown}},Y=rw.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),ow=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rw.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};ow.create=e=>new ow(e);var sw=(e,t)=>{let n;switch(e.code){case Y.invalid_type:n=e.received===J.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Y.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,rw.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:n=`Unrecognized key(s) in object: ${rw.joinValues(e.keys,`, `)}`;break;case Y.invalid_union:n=`Invalid input`;break;case Y.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${rw.joinValues(e.options)}`;break;case Y.invalid_enum_value:n=`Invalid enum value. Expected ${rw.joinValues(e.options)}, received '${e.received}'`;break;case Y.invalid_arguments:n=`Invalid function arguments`;break;case Y.invalid_return_type:n=`Invalid function return type`;break;case Y.invalid_date:n=`Invalid date`;break;case Y.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:rw.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Y.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Y.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Y.custom:n=`Invalid input`;break;case Y.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Y.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Y.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,rw.assertNever(e)}return{message:n}},cw=sw;function lw(){return cw}var uw=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function X(e,t){let n=lw(),r=uw({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===sw?void 0:sw].filter(e=>!!e)});e.common.issues.push(r)}var dw=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return Z;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return Z;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},Z=Object.freeze({status:`aborted`}),fw=e=>({status:`dirty`,value:e}),pw=e=>({status:`valid`,value:e}),mw=e=>e.status===`aborted`,hw=e=>e.status===`dirty`,gw=e=>e.status===`valid`,_w=e=>typeof Promise<`u`&&e instanceof Promise,Q;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(Q||={});var vw=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},yw=(e,t)=>{if(gw(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new ow(e.common.issues);return this._error=t,this._error}}};function bw(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var xw=class{get description(){return this._def.description}_getType(e){return aw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:aw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new dw,ctx:{common:e.parent.common,data:e.data,parsedType:aw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(_w(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aw(e)};return yw(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aw(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return gw(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>gw(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aw(e)},r=this._parse({data:e,path:n.path,parent:n});return yw(n,await(_w(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Y.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new wT({schema:this,typeName:$.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return TT.create(this,this._def)}nullable(){return ET.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return aT.create(this)}promise(){return CT.create(this,this._def)}or(e){return cT.create([this,e],this._def)}and(e){return fT.create(this,e,this._def)}transform(e){return new wT({...bw(this._def),schema:this,typeName:$.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new DT({...bw(this._def),innerType:this,defaultValue:t,typeName:$.ZodDefault})}brand(){return new AT({typeName:$.ZodBranded,type:this,...bw(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new OT({...bw(this._def),innerType:this,catchValue:t,typeName:$.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return jT.create(this,e)}readonly(){return MT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Sw=/^c[^\s-]{8,}$/i,Cw=/^[0-9a-z]+$/,ww=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ew=/^[a-z0-9_-]{21}$/i,Dw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ow=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Aw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,jw,Mw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Nw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Pw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Fw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Iw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Rw=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,zw=RegExp(`^${Rw}$`);function Bw(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Vw(e){return RegExp(`^${Bw(e)}$`)}function Hw(e){let t=`${Rw}T${Bw(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Uw(e,t){return!!((t===`v4`||!t)&&Mw.test(e)||(t===`v6`||!t)&&Pw.test(e))}function Ww(e,t){if(!Dw.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Gw(e,t){return!!((t===`v4`||!t)&&Nw.test(e)||(t===`v6`||!t)&&Fw.test(e))}var Kw=class e extends xw{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==J.string){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.string,received:t.parsedType}),Z}let t=new dw,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),X(n,{code:Y.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),X(n,{code:Y.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?X(n,{code:Y.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&X(n,{code:Y.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)kw.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`email`,code:Y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)jw||=new RegExp(Aw,`u`),jw.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`emoji`,code:Y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Tw.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`uuid`,code:Y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Ew.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`nanoid`,code:Y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Sw.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`cuid`,code:Y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Cw.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`cuid2`,code:Y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)ww.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`ulid`,code:Y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),X(n,{validation:`url`,code:Y.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`regex`,code:Y.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),X(n,{code:Y.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),X(n,{code:Y.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),X(n,{code:Y.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Hw(r).test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{code:Y.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?zw.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{code:Y.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Vw(r).test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{code:Y.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Ow.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`duration`,code:Y.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Uw(e.data,r.version)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`ip`,code:Y.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Ww(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`jwt`,code:Y.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Gw(e.data,r.version)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`cidr`,code:Y.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Iw.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`base64`,code:Y.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Lw.test(e.data)||(n=this._getOrReturnCtx(e,n),X(n,{validation:`base64url`,code:Y.invalid_string,message:r.message}),t.dirty()):rw.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:Y.invalid_string,...Q.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...Q.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...Q.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...Q.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...Q.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...Q.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...Q.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...Q.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...Q.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...Q.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...Q.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...Q.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...Q.errToObj(t)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Kw.create=e=>new Kw({checks:[],typeName:$.ZodString,coerce:e?.coerce??!1,...bw(e)});function qw(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Jw=class e extends xw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==J.number){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.number,received:t.parsedType}),Z}let t,n=new dw;for(let r of this._def.checks)r.kind===`int`?rw.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),X(t,{code:Y.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),X(t,{code:Y.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),X(t,{code:Y.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?qw(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),X(t,{code:Y.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),X(t,{code:Y.not_finite,message:r.message}),n.dirty()):rw.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Q.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Q.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Q.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Q.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:Q.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Q.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Q.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Q.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Q.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&rw.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Jw.create=e=>new Jw({checks:[],typeName:$.ZodNumber,coerce:e?.coerce||!1,...bw(e)});var Yw=class e extends xw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==J.bigint)return this._getInvalidInput(e);let t,n=new dw;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),X(t,{code:Y.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),X(t,{code:Y.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),X(t,{code:Y.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):rw.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.bigint,received:t.parsedType}),Z}gte(e,t){return this.setLimit(`min`,e,!0,Q.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Q.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Q.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Q.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Q.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Yw.create=e=>new Yw({checks:[],typeName:$.ZodBigInt,coerce:e?.coerce??!1,...bw(e)});var Xw=class extends xw{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==J.boolean){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.boolean,received:t.parsedType}),Z}return pw(e.data)}};Xw.create=e=>new Xw({typeName:$.ZodBoolean,coerce:e?.coerce||!1,...bw(e)});var Zw=class e extends xw{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==J.date){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.date,received:t.parsedType}),Z}if(Number.isNaN(e.data.getTime()))return X(this._getOrReturnCtx(e),{code:Y.invalid_date}),Z;let t=new dw,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),X(n,{code:Y.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),X(n,{code:Y.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):rw.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Q.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Q.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Zw.create=e=>new Zw({checks:[],coerce:e?.coerce||!1,typeName:$.ZodDate,...bw(e)});var Qw=class extends xw{_parse(e){if(this._getType(e)!==J.symbol){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.symbol,received:t.parsedType}),Z}return pw(e.data)}};Qw.create=e=>new Qw({typeName:$.ZodSymbol,...bw(e)});var $w=class extends xw{_parse(e){if(this._getType(e)!==J.undefined){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.undefined,received:t.parsedType}),Z}return pw(e.data)}};$w.create=e=>new $w({typeName:$.ZodUndefined,...bw(e)});var eT=class extends xw{_parse(e){if(this._getType(e)!==J.null){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.null,received:t.parsedType}),Z}return pw(e.data)}};eT.create=e=>new eT({typeName:$.ZodNull,...bw(e)});var tT=class extends xw{constructor(){super(...arguments),this._any=!0}_parse(e){return pw(e.data)}};tT.create=e=>new tT({typeName:$.ZodAny,...bw(e)});var nT=class extends xw{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pw(e.data)}};nT.create=e=>new nT({typeName:$.ZodUnknown,...bw(e)});var rT=class extends xw{_parse(e){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.never,received:t.parsedType}),Z}};rT.create=e=>new rT({typeName:$.ZodNever,...bw(e)});var iT=class extends xw{_parse(e){if(this._getType(e)!==J.undefined){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.void,received:t.parsedType}),Z}return pw(e.data)}};iT.create=e=>new iT({typeName:$.ZodVoid,...bw(e)});var aT=class e extends xw{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==J.array)return X(t,{code:Y.invalid_type,expected:J.array,received:t.parsedType}),Z;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(X(t,{code:e?Y.too_big:Y.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(X(t,{code:Y.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(X(t,{code:Y.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new vw(t,e,t.path,n)))).then(e=>dw.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new vw(t,e,t.path,n)));return dw.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Q.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Q.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Q.toString(n)}})}nonempty(e){return this.min(1,e)}};aT.create=(e,t)=>new aT({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray,...bw(t)});function oT(e){if(e instanceof sT){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=TT.create(oT(r))}return new sT({...e._def,shape:()=>t})}else if(e instanceof aT)return new aT({...e._def,type:oT(e.element)});else if(e instanceof TT)return TT.create(oT(e.unwrap()));else if(e instanceof ET)return ET.create(oT(e.unwrap()));else if(e instanceof pT)return pT.create(e.items.map(e=>oT(e)));else return e}var sT=class e extends xw{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=rw.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==J.object){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.object,received:t.parsedType}),Z}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof rT&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new vw(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof rT){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(X(n,{code:Y.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new vw(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>dw.mergeObjectSync(t,e)):dw.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Q.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:Q.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of rw.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of rw.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return oT(this)}partial(t){let n={};for(let e of rw.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of rw.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof TT;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return bT(rw.objectKeys(this.shape))}};sT.create=(e,t)=>new sT({shape:()=>e,unknownKeys:`strip`,catchall:rT.create(),typeName:$.ZodObject,...bw(t)}),sT.strictCreate=(e,t)=>new sT({shape:()=>e,unknownKeys:`strict`,catchall:rT.create(),typeName:$.ZodObject,...bw(t)}),sT.lazycreate=(e,t)=>new sT({shape:e,unknownKeys:`strip`,catchall:rT.create(),typeName:$.ZodObject,...bw(t)});var cT=class extends xw{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new ow(e.ctx.common.issues));return X(t,{code:Y.invalid_union,unionErrors:n}),Z}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new ow(e));return X(t,{code:Y.invalid_union,unionErrors:i}),Z}}get options(){return this._def.options}};cT.create=(e,t)=>new cT({options:e,typeName:$.ZodUnion,...bw(t)});var lT=e=>e instanceof vT?lT(e.schema):e instanceof wT?lT(e.innerType()):e instanceof yT?[e.value]:e instanceof xT?e.options:e instanceof ST?rw.objectValues(e.enum):e instanceof DT?lT(e._def.innerType):e instanceof $w?[void 0]:e instanceof eT?[null]:e instanceof TT?[void 0,...lT(e.unwrap())]:e instanceof ET?[null,...lT(e.unwrap())]:e instanceof AT||e instanceof MT?lT(e.unwrap()):e instanceof OT?lT(e._def.innerType):[],uT=class e extends xw{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==J.object)return X(t,{code:Y.invalid_type,expected:J.object,received:t.parsedType}),Z;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(X(t,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=lT(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:$.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...bw(r)})}};function dT(e,t){let n=aw(e),r=aw(t);if(e===t)return{valid:!0,data:e};if(n===J.object&&r===J.object){let n=rw.objectKeys(t),r=rw.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=dT(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===J.array&&r===J.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=dT(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===J.date&&r===J.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var fT=class extends xw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(mw(e)||mw(r))return Z;let i=dT(e.value,r.value);return i.valid?((hw(e)||hw(r))&&t.dirty(),{status:t.value,value:i.data}):(X(n,{code:Y.invalid_intersection_types}),Z)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};fT.create=(e,t,n)=>new fT({left:e,right:t,typeName:$.ZodIntersection,...bw(n)});var pT=class e extends xw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==J.array)return X(n,{code:Y.invalid_type,expected:J.array,received:n.parsedType}),Z;if(n.data.length<this._def.items.length)return X(n,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),Z;!this._def.rest&&n.data.length>this._def.items.length&&(X(n,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new vw(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>dw.mergeArray(t,e)):dw.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};pT.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new pT({items:e,typeName:$.ZodTuple,rest:null,...bw(t)})};var mT=class e extends xw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==J.object)return X(n,{code:Y.invalid_type,expected:J.object,received:n.parsedType}),Z;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new vw(n,e,n.path,e)),value:a._parse(new vw(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?dw.mergeObjectAsync(t,r):dw.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof xw?new e({keyType:t,valueType:n,typeName:$.ZodRecord,...bw(r)}):new e({keyType:Kw.create(),valueType:t,typeName:$.ZodRecord,...bw(n)})}},hT=class extends xw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==J.map)return X(n,{code:Y.invalid_type,expected:J.map,received:n.parsedType}),Z;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new vw(n,e,n.path,[a,`key`])),value:i._parse(new vw(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return Z;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return Z;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};hT.create=(e,t,n)=>new hT({valueType:t,keyType:e,typeName:$.ZodMap,...bw(n)});var gT=class e extends xw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==J.set)return X(n,{code:Y.invalid_type,expected:J.set,received:n.parsedType}),Z;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(X(n,{code:Y.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(X(n,{code:Y.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return Z;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new vw(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:Q.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Q.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};gT.create=(e,t)=>new gT({valueType:e,minSize:null,maxSize:null,typeName:$.ZodSet,...bw(t)});var _T=class e extends xw{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==J.function)return X(t,{code:Y.invalid_type,expected:J.function,received:t.parsedType}),Z;function n(e,n){return uw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,lw(),sw].filter(e=>!!e),issueData:{code:Y.invalid_arguments,argumentsError:n}})}function r(e,n){return uw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,lw(),sw].filter(e=>!!e),issueData:{code:Y.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof CT){let e=this;return pw(async function(...t){let o=new ow([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return pw(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new ow([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new ow([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:pT.create(t).rest(nT.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||pT.create([]).rest(nT.create()),returns:n||nT.create(),typeName:$.ZodFunction,...bw(r)})}},vT=class extends xw{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};vT.create=(e,t)=>new vT({getter:e,typeName:$.ZodLazy,...bw(t)});var yT=class extends xw{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return X(t,{received:t.data,code:Y.invalid_literal,expected:this._def.value}),Z}return{status:`valid`,value:e.data}}get value(){return this._def.value}};yT.create=(e,t)=>new yT({value:e,typeName:$.ZodLiteral,...bw(t)});function bT(e,t){return new xT({values:e,typeName:$.ZodEnum,...bw(t)})}var xT=class e extends xw{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return X(t,{expected:rw.joinValues(n),received:t.parsedType,code:Y.invalid_type}),Z}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return X(t,{received:t.data,code:Y.invalid_enum_value,options:n}),Z}return pw(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};xT.create=bT;var ST=class extends xw{_parse(e){let t=rw.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==J.string&&n.parsedType!==J.number){let e=rw.objectValues(t);return X(n,{expected:rw.joinValues(e),received:n.parsedType,code:Y.invalid_type}),Z}if(this._cache||=new Set(rw.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=rw.objectValues(t);return X(n,{received:n.data,code:Y.invalid_enum_value,options:e}),Z}return pw(e.data)}get enum(){return this._def.values}};ST.create=(e,t)=>new ST({values:e,typeName:$.ZodNativeEnum,...bw(t)});var CT=class extends xw{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==J.promise&&t.common.async===!1?(X(t,{code:Y.invalid_type,expected:J.promise,received:t.parsedType}),Z):pw((t.parsedType===J.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};CT.create=(e,t)=>new CT({type:e,typeName:$.ZodPromise,...bw(t)});var wT=class extends xw{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{X(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return Z;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?Z:r.status===`dirty`||t.value===`dirty`?fw(r.value):r});{if(t.value===`aborted`)return Z;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?Z:r.status===`dirty`||t.value===`dirty`?fw(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?Z:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?Z:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!gw(e))return Z;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>gw(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):Z);rw.assertNever(r)}};wT.create=(e,t,n)=>new wT({schema:e,typeName:$.ZodEffects,effect:t,...bw(n)}),wT.createWithPreprocess=(e,t,n)=>new wT({schema:t,effect:{type:`preprocess`,transform:e},typeName:$.ZodEffects,...bw(n)});var TT=class extends xw{_parse(e){return this._getType(e)===J.undefined?pw(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};TT.create=(e,t)=>new TT({innerType:e,typeName:$.ZodOptional,...bw(t)});var ET=class extends xw{_parse(e){return this._getType(e)===J.null?pw(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ET.create=(e,t)=>new ET({innerType:e,typeName:$.ZodNullable,...bw(t)});var DT=class extends xw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===J.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};DT.create=(e,t)=>new DT({innerType:e,typeName:$.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...bw(t)});var OT=class extends xw{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return _w(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new ow(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new ow(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};OT.create=(e,t)=>new OT({innerType:e,typeName:$.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...bw(t)});var kT=class extends xw{_parse(e){if(this._getType(e)!==J.nan){let t=this._getOrReturnCtx(e);return X(t,{code:Y.invalid_type,expected:J.nan,received:t.parsedType}),Z}return{status:`valid`,value:e.data}}};kT.create=e=>new kT({typeName:$.ZodNaN,...bw(e)});var AT=class extends xw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},jT=class e extends xw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Z:e.status===`dirty`?(t.dirty(),fw(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Z:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:$.ZodPipeline})}},MT=class extends xw{_parse(e){let t=this._def.innerType._parse(e),n=e=>(gw(e)&&(e.value=Object.freeze(e.value)),e);return _w(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};MT.create=(e,t)=>new MT({innerType:e,typeName:$.ZodReadonly,...bw(t)}),sT.lazycreate;var $;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})($||={}),Kw.create,Jw.create,kT.create,Yw.create,Xw.create,Zw.create,Qw.create,$w.create,eT.create,tT.create,nT.create,rT.create,iT.create,aT.create,sT.create,sT.strictCreate,cT.create,uT.create,fT.create,pT.create,mT.create,hT.create,gT.create,_T.create,vT.create,yT.create,xT.create,ST.create,CT.create,wT.create,TT.create,ET.create,wT.createWithPreprocess,jT.create;function NT(e){if(e.target!==`openAi`)return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy===`relative`?nw(t,e.currentPath):t.join(`/`)}}function PT(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==$.ZodAny&&(n.items=wE(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&tw(n,`minItems`,e.minLength.value,e.minLength.message,t),e.maxLength&&tw(n,`maxItems`,e.maxLength.value,e.maxLength.message,t),e.exactLength&&(tw(n,`minItems`,e.exactLength.value,e.exactLength.message,t),tw(n,`maxItems`,e.exactLength.value,e.exactLength.message,t)),n}function FT(e,t){let n={type:`integer`,format:`int64`};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case`min`:t.target===`jsonSchema7`?r.inclusive?tw(n,`minimum`,r.value,r.message,t):tw(n,`exclusiveMinimum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),tw(n,`minimum`,r.value,r.message,t));break;case`max`:t.target===`jsonSchema7`?r.inclusive?tw(n,`maximum`,r.value,r.message,t):tw(n,`exclusiveMaximum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),tw(n,`maximum`,r.value,r.message,t));break;case`multipleOf`:tw(n,`multipleOf`,r.value,r.message,t);break}return n}function IT(){return{type:`boolean`}}function LT(e,t){return wE(e.type._def,t)}var RT=(e,t)=>wE(e.innerType._def,t);function zT(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>zT(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return BT(e,t)}}var BT=(e,t)=>{let n={type:`integer`,format:`unix-time`};if(t.target===`openApi3`)return n;for(let r of e.checks)switch(r.kind){case`min`:tw(n,`minimum`,r.value,r.message,t);break;case`max`:tw(n,`maximum`,r.value,r.message,t);break}return n};function VT(e,t){return{...wE(e.innerType._def,t),default:e.defaultValue()}}function HT(e,t){return t.effectStrategy===`input`?wE(e.schema._def,t):NT(t)}function UT(e){return{type:`string`,enum:Array.from(e.values)}}var WT=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function GT(e,t){let n=[wE(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),wE(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=t.target===`jsonSchema2019-09`?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(e=>{if(WT(e))i.push(...e.allOf),e.unevaluatedProperties===void 0&&(r=void 0);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}else r=void 0;i.push(t)}}),i.length?{allOf:i,...r}:void 0}function KT(e,t){let n=typeof e.value;return n!==`bigint`&&n!==`number`&&n!==`boolean`&&n!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:t.target===`openApi3`?{type:n===`bigint`?`integer`:n,enum:[e.value]}:{type:n===`bigint`?`integer`:n,const:e.value}}var qT=void 0,JT={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(qT===void 0&&(qT=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),qT),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function YT(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:tw(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t);break;case`max`:tw(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`email`:switch(t.emailStrategy){case`format:email`:$T(n,`email`,r.message,t);break;case`format:idn-email`:$T(n,`idn-email`,r.message,t);break;case`pattern:zod`:eE(n,JT.email,r.message,t);break}break;case`url`:$T(n,`uri`,r.message,t);break;case`uuid`:$T(n,`uuid`,r.message,t);break;case`regex`:eE(n,r.regex,r.message,t);break;case`cuid`:eE(n,JT.cuid,r.message,t);break;case`cuid2`:eE(n,JT.cuid2,r.message,t);break;case`startsWith`:eE(n,RegExp(`^${XT(r.value,t)}`),r.message,t);break;case`endsWith`:eE(n,RegExp(`${XT(r.value,t)}$`),r.message,t);break;case`datetime`:$T(n,`date-time`,r.message,t);break;case`date`:$T(n,`date`,r.message,t);break;case`time`:$T(n,`time`,r.message,t);break;case`duration`:$T(n,`duration`,r.message,t);break;case`length`:tw(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t),tw(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`includes`:eE(n,RegExp(XT(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&$T(n,`ipv4`,r.message,t),r.version!==`v4`&&$T(n,`ipv6`,r.message,t);break;case`base64url`:eE(n,JT.base64url,r.message,t);break;case`jwt`:eE(n,JT.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&eE(n,JT.ipv4Cidr,r.message,t),r.version!==`v4`&&eE(n,JT.ipv6Cidr,r.message,t);break;case`emoji`:eE(n,JT.emoji(),r.message,t);break;case`ulid`:eE(n,JT.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:$T(n,`binary`,r.message,t);break;case`contentEncoding:base64`:tw(n,`contentEncoding`,`base64`,r.message,t);break;case`pattern:zod`:eE(n,JT.base64,r.message,t);break}break;case`nanoid`:eE(n,JT.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function XT(e,t){return t.patternStrategy===`escape`?QT(e):e}var ZT=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function QT(e){let t=``;for(let n=0;n<e.length;n++)ZT.has(e[n])||(t+=`\\`),t+=e[n];return t}function $T(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):tw(e,`format`,t,n,r)}function eE(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:tE(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):tw(e,`pattern`,tE(t,r),n,r)}function tE(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++){if(a){i+=r[e],a=!1;continue}if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
|
|
5
5
|
]))`;continue}else if(r[e]===`$`){i+=`($|(?=[\r
|