asteroid-odyssey 1.7.389 → 1.7.394
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/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
|
|
4
4
|
`);f=V.pop()??"";for(let re of V){let oe=re.split(`
|
|
5
5
|
`),k=[],z;for(let R of oe)if(R.startsWith("data:"))k.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))z=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))u=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let N=Number.parseInt(R.replace(/^retry:\s*/,""),10);Number.isNaN(N)||(d=N);}let S,j=!1;if(k.length){let R=k.join(`
|
|
6
|
-
`);try{S=JSON.parse(R),j=!0;}catch{S=R;}}j&&(a&&await a(S),n&&(S=await n(S))),r?.({data:S,event:z,id:u,retry:d}),k.length&&(yield S);}}}finally{y.removeEventListener("abort",M),w.releaseLock();}break}catch(P){if(t?.(P),i!==void 0&&g>=i)break;let O=Math.min(d*2**(g-1),s??3e4);await m(O);}}}()}}var ne=e=>{switch(e){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},se=e=>{switch(e){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},ie=e=>{switch(e){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},G=({allowReserved:e,explode:t,name:r,style:n,value:a})=>{if(!t){let s=(e?a:a.map(l=>encodeURIComponent(l))).join(se(n));switch(n){case "label":return `.${s}`;case "matrix":return `;${r}=${s}`;case "simple":return s;default:return `${r}=${s}`}}let c=ne(n),i=a.map(s=>n==="label"||n==="simple"?e?s:encodeURIComponent(s):C({allowReserved:e,name:r,value:s})).join(c);return n==="label"||n==="matrix"?c+i:i},C=({allowReserved:e,name:t,value:r})=>{if(r==null)return "";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${e?r:encodeURIComponent(r)}`},W=({allowReserved:e,explode:t,name:r,style:n,value:a,valueOnly:c})=>{if(a instanceof Date)return c?a.toISOString():`${r}=${a.toISOString()}`;if(n!=="deepObject"&&!t){let l=[];Object.entries(a).forEach(([p,u])=>{l=[...l,p,e?u:encodeURIComponent(u)];});let h=l.join(",");switch(n){case "form":return `${r}=${h}`;case "label":return `.${h}`;case "matrix":return `;${r}=${h}`;default:return h}}let i=ie(n),s=Object.entries(a).map(([l,h])=>C({allowReserved:e,name:n==="deepObject"?`${r}[${l}]`:l,value:h})).join(i);return n==="label"||n==="matrix"?i+s:s};var ae=/\{[^{}]+\}/g,le=({path:e,url:t})=>{let r=t,n=t.match(ae);if(n)for(let a of n){let c=false,i=a.substring(1,a.length-1),s="simple";i.endsWith("*")&&(c=true,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),s="label"):i.startsWith(";")&&(i=i.substring(1),s="matrix");let l=e[i];if(l==null)continue;if(Array.isArray(l)){r=r.replace(a,G({explode:c,name:i,style:s,value:l}));continue}if(typeof l=="object"){r=r.replace(a,W({explode:c,name:i,style:s,value:l,valueOnly:true}));continue}if(s==="matrix"){r=r.replace(a,`;${C({name:i,value:l})}`);continue}let h=encodeURIComponent(s==="label"?`.${l}`:l);r=r.replace(a,h);}return r},$=({baseUrl:e,path:t,query:r,querySerializer:n,url:a})=>{let c=a.startsWith("/")?a:`/${a}`,i=(e??"")+c;t&&(i=le({path:t,url:i}));let s=r?n(r):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(i+=`?${s}`),i};function q(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return "serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(t)return e.body}var Q=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r};var J=({parameters:e={},...t}={})=>n=>{let a=[];if(n&&typeof n=="object")for(let c in n){let i=n[c];if(i==null)continue;let s=e[c]||t;if(Array.isArray(i)){let l=G({allowReserved:s.allowReserved,explode:true,name:c,style:"form",value:i,...s.array});l&&a.push(l);}else if(typeof i=="object"){let l=W({allowReserved:s.allowReserved,explode:true,name:c,style:"deepObject",value:i,...s.object});l&&a.push(l);}else {let l=C({allowReserved:s.allowReserved,name:c,value:i});l&&a.push(l);}}return a.join("&")},_=e=>{if(!e)return "stream";let t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return "json";if(t==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return "blob";if(t.startsWith("text/"))return "text"}},ce=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)):false;async function Y(e){for(let t of e.security??[]){if(ce(e,t.name))continue;let r=await Q(t,e.auth);if(!r)continue;let n=t.name??"Authorization";switch(t.in){case "query":e.query||(e.query={}),e.query[n]=r;break;case "cookie":e.headers.append("Cookie",`${n}=${r}`);break;default:e.headers.set(n,r);break}}}var F=e=>$({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:J(e.querySerializer),url:e.url}),U=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=I(e.headers,t.headers),r},ue=e=>{let t=[];return e.forEach((r,n)=>{t.push([n,r]);}),t},I=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let n=r instanceof Headers?ue(r):Object.entries(r);for(let[a,c]of n)if(c===null)t.delete(a);else if(Array.isArray(c))for(let i of c)t.append(a,i);else c!==void 0&&t.set(a,typeof c=="object"?JSON.stringify(c):c);}return t},D=class{fns=[];clear(){this.fns=[];}eject(t){let r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null);}exists(t){let r=this.getInterceptorIndex(t);return !!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){let n=this.getInterceptorIndex(t);return this.fns[n]?(this.fns[n]=r,t):false}use(t){return this.fns.push(t),this.fns.length-1}},Z=()=>({error:new D,request:new D,response:new D}),pe=J({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),de={"Content-Type":"application/json"},T=(e={})=>({...L,headers:de,parseAs:"auto",querySerializer:pe,...e});var K=(e={})=>{let t=U(T(),e),r=()=>({...t}),n=p=>(t=U(t,p),r()),a=Z(),c=async p=>{let u={...t,...p,fetch:p.fetch??t.fetch??globalThis.fetch,headers:I(t.headers,p.headers),serializedBody:void 0};u.security&&await Y(u),u.requestValidator&&await u.requestValidator(u),u.body!==void 0&&u.bodySerializer&&(u.serializedBody=u.bodySerializer(u.body)),(u.body===void 0||u.serializedBody==="")&&u.headers.delete("Content-Type");let m=u,x=F(m);return {opts:m,url:x}},i=async p=>{let u=p.throwOnError??t.throwOnError,m=p.responseStyle??t.responseStyle,x,E;try{let{opts:d,url:g}=await c(p),y={redirect:"follow",...d,body:q(d)};x=new Request(g,y);for(let A of a.request.fns)A&&(x=await A(x,d));let b=d.fetch;E=await b(x);for(let A of a.response.fns)A&&(E=await A(E,x,d));let P={request:x,response:E};if(E.ok){let A=(d.parseAs==="auto"?_(E.headers.get("Content-Type")):d.parseAs)??"json";if(E.status===204||E.headers.get("Content-Length")==="0"){let f;switch(A){case "arrayBuffer":case "blob":case "text":f=await E[A]();break;case "formData":f=new FormData;break;case "stream":f=E.body;break;default:f={};break}return d.responseStyle==="data"?f:{data:f,...P}}let w;switch(A){case "arrayBuffer":case "blob":case "formData":case "text":w=await E[A]();break;case "json":{let f=await E.text();w=f?JSON.parse(f):{};break}case "stream":return d.responseStyle==="data"?E.body:{data:E.body,...P}}return A==="json"&&(d.responseValidator&&await d.responseValidator(w),d.responseTransformer&&(w=await d.responseTransformer(w))),d.responseStyle==="data"?w:{data:w,...P}}let O=await E.text(),B;try{B=JSON.parse(O);}catch{}throw B??O}catch(d){let g=d;for(let y of a.error.fns)y&&(g=await y(g,E,x,p));if(g=g||{},u)throw g;return m==="data"?void 0:{error:g,request:x,response:E}}},s=p=>u=>i({...u,method:p}),l=p=>async u=>{let{opts:m,url:x}=await c(u);return H({...m,body:m.body,method:p,onRequest:async(E,d)=>{let g=new Request(E,d);for(let y of a.request.fns)y&&(g=await y(g,m));return g},serializedBody:q(m),url:x})};return {buildUrl:p=>F({...t,...p}),connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:r,head:s("HEAD"),interceptors:a,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:i,setConfig:n,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:s("TRACE")}};var o=K(T({baseUrl:"https://odyssey.asteroid.ai/agents/v2"}));var Ee=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/admin/customer-activity",...e}),ge=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/admin/customer-activity/notable",...e}),Ae=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/admin/customer-activity/window-stats",...e}),fe=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools",...e}),xe=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools",...e,headers:{"Content-Type":"application/json",...e.headers}}),he=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e}),ye=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e}),me=e=>(e.client??o).patch({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),we=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e}),Pe=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles",...e}),Se=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e}),De=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e}),Te=e=>(e.client??o).patch({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),be=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/clear-browser-cache",...e}),ke=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/duplicate",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/inbox-emails",...e}),Ge=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/inbox-emails/{emailId}",...e}),We=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents",...e}),Ie=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents",...e,headers:{"Content-Type":"application/json",...e.headers}}),Be=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/available-tools",...e}),Le=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}",...e}),qe=e=>(e.client??o).patch({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Fe=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/execute",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows",...e}),Ke=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/validate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ve=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}",...e}),ze=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}",...e}),je=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/execute",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/inputs",...e}),Xe=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/output-schemas",...e}),He=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/publish",...e}),$e=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/context",...e}),Qe=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/docs/search",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/environments",...e}),_e=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/environments",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ye=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/environments/{environmentId}",...e}),Ze=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/environments/{environmentId}/stop",...e}),et=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches",...e}),tt=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches",...e,headers:{"Content-Type":"application/json",...e.headers}}),rt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}",...e}),ot=e=>(e.client??o).put({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/cancel",...e}),nt=e=>(e.client??o).put({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/pause",...e}),st=e=>(e.client??o).put({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/resume",...e}),it=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions",...e}),at=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}",...e}),lt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/activities",...e}),ct=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/agent-files",...e}),ut=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/agent-files/{fileId}/download",...e}),pt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files",...e}),dt=e=>(e.client??o).post({...v,security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files",...e,headers:{"Content-Type":null,...e.headers}}),Et=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files/{fileId}/download",...e}),gt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/debug-files/{fileId}/download",...e}),At=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/files",...e}),ft=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/files/{fileId}/download",...e}),xt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/recording",...e}),ht=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/status",...e,headers:{"Content-Type":"application/json",...e.headers}}),yt=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/user-messages",...e,headers:{"Content-Type":"application/json",...e.headers}}),mt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/scheduled-executions",...e}),wt=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/schema/validate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rt=e=>(e.client??o).post({...v,security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/temp-files/{organizationId}",...e,headers:{"Content-Type":null,...e.headers}}),Pt=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/workflows/validate",...e,headers:{"Content-Type":"application/json",...e.headers}});
|
|
6
|
+
`);try{S=JSON.parse(R),j=!0;}catch{S=R;}}j&&(a&&await a(S),n&&(S=await n(S))),r?.({data:S,event:z,id:u,retry:d}),k.length&&(yield S);}}}finally{y.removeEventListener("abort",M),w.releaseLock();}break}catch(P){if(t?.(P),i!==void 0&&g>=i)break;let O=Math.min(d*2**(g-1),s??3e4);await m(O);}}}()}}var ne=e=>{switch(e){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},se=e=>{switch(e){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},ie=e=>{switch(e){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},G=({allowReserved:e,explode:t,name:r,style:n,value:a})=>{if(!t){let s=(e?a:a.map(l=>encodeURIComponent(l))).join(se(n));switch(n){case "label":return `.${s}`;case "matrix":return `;${r}=${s}`;case "simple":return s;default:return `${r}=${s}`}}let c=ne(n),i=a.map(s=>n==="label"||n==="simple"?e?s:encodeURIComponent(s):C({allowReserved:e,name:r,value:s})).join(c);return n==="label"||n==="matrix"?c+i:i},C=({allowReserved:e,name:t,value:r})=>{if(r==null)return "";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${e?r:encodeURIComponent(r)}`},W=({allowReserved:e,explode:t,name:r,style:n,value:a,valueOnly:c})=>{if(a instanceof Date)return c?a.toISOString():`${r}=${a.toISOString()}`;if(n!=="deepObject"&&!t){let l=[];Object.entries(a).forEach(([p,u])=>{l=[...l,p,e?u:encodeURIComponent(u)];});let h=l.join(",");switch(n){case "form":return `${r}=${h}`;case "label":return `.${h}`;case "matrix":return `;${r}=${h}`;default:return h}}let i=ie(n),s=Object.entries(a).map(([l,h])=>C({allowReserved:e,name:n==="deepObject"?`${r}[${l}]`:l,value:h})).join(i);return n==="label"||n==="matrix"?i+s:s};var ae=/\{[^{}]+\}/g,le=({path:e,url:t})=>{let r=t,n=t.match(ae);if(n)for(let a of n){let c=false,i=a.substring(1,a.length-1),s="simple";i.endsWith("*")&&(c=true,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),s="label"):i.startsWith(";")&&(i=i.substring(1),s="matrix");let l=e[i];if(l==null)continue;if(Array.isArray(l)){r=r.replace(a,G({explode:c,name:i,style:s,value:l}));continue}if(typeof l=="object"){r=r.replace(a,W({explode:c,name:i,style:s,value:l,valueOnly:true}));continue}if(s==="matrix"){r=r.replace(a,`;${C({name:i,value:l})}`);continue}let h=encodeURIComponent(s==="label"?`.${l}`:l);r=r.replace(a,h);}return r},$=({baseUrl:e,path:t,query:r,querySerializer:n,url:a})=>{let c=a.startsWith("/")?a:`/${a}`,i=(e??"")+c;t&&(i=le({path:t,url:i}));let s=r?n(r):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(i+=`?${s}`),i};function q(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return "serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(t)return e.body}var Q=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r};var J=({parameters:e={},...t}={})=>n=>{let a=[];if(n&&typeof n=="object")for(let c in n){let i=n[c];if(i==null)continue;let s=e[c]||t;if(Array.isArray(i)){let l=G({allowReserved:s.allowReserved,explode:true,name:c,style:"form",value:i,...s.array});l&&a.push(l);}else if(typeof i=="object"){let l=W({allowReserved:s.allowReserved,explode:true,name:c,style:"deepObject",value:i,...s.object});l&&a.push(l);}else {let l=C({allowReserved:s.allowReserved,name:c,value:i});l&&a.push(l);}}return a.join("&")},_=e=>{if(!e)return "stream";let t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return "json";if(t==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return "blob";if(t.startsWith("text/"))return "text"}},ce=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)):false;async function Y(e){for(let t of e.security??[]){if(ce(e,t.name))continue;let r=await Q(t,e.auth);if(!r)continue;let n=t.name??"Authorization";switch(t.in){case "query":e.query||(e.query={}),e.query[n]=r;break;case "cookie":e.headers.append("Cookie",`${n}=${r}`);break;default:e.headers.set(n,r);break}}}var F=e=>$({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:J(e.querySerializer),url:e.url}),U=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=I(e.headers,t.headers),r},ue=e=>{let t=[];return e.forEach((r,n)=>{t.push([n,r]);}),t},I=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let n=r instanceof Headers?ue(r):Object.entries(r);for(let[a,c]of n)if(c===null)t.delete(a);else if(Array.isArray(c))for(let i of c)t.append(a,i);else c!==void 0&&t.set(a,typeof c=="object"?JSON.stringify(c):c);}return t},D=class{fns=[];clear(){this.fns=[];}eject(t){let r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null);}exists(t){let r=this.getInterceptorIndex(t);return !!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){let n=this.getInterceptorIndex(t);return this.fns[n]?(this.fns[n]=r,t):false}use(t){return this.fns.push(t),this.fns.length-1}},Z=()=>({error:new D,request:new D,response:new D}),pe=J({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),de={"Content-Type":"application/json"},T=(e={})=>({...L,headers:de,parseAs:"auto",querySerializer:pe,...e});var K=(e={})=>{let t=U(T(),e),r=()=>({...t}),n=p=>(t=U(t,p),r()),a=Z(),c=async p=>{let u={...t,...p,fetch:p.fetch??t.fetch??globalThis.fetch,headers:I(t.headers,p.headers),serializedBody:void 0};u.security&&await Y(u),u.requestValidator&&await u.requestValidator(u),u.body!==void 0&&u.bodySerializer&&(u.serializedBody=u.bodySerializer(u.body)),(u.body===void 0||u.serializedBody==="")&&u.headers.delete("Content-Type");let m=u,x=F(m);return {opts:m,url:x}},i=async p=>{let u=p.throwOnError??t.throwOnError,m=p.responseStyle??t.responseStyle,x,E;try{let{opts:d,url:g}=await c(p),y={redirect:"follow",...d,body:q(d)};x=new Request(g,y);for(let A of a.request.fns)A&&(x=await A(x,d));let b=d.fetch;E=await b(x);for(let A of a.response.fns)A&&(E=await A(E,x,d));let P={request:x,response:E};if(E.ok){let A=(d.parseAs==="auto"?_(E.headers.get("Content-Type")):d.parseAs)??"json";if(E.status===204||E.headers.get("Content-Length")==="0"){let f;switch(A){case "arrayBuffer":case "blob":case "text":f=await E[A]();break;case "formData":f=new FormData;break;case "stream":f=E.body;break;default:f={};break}return d.responseStyle==="data"?f:{data:f,...P}}let w;switch(A){case "arrayBuffer":case "blob":case "formData":case "text":w=await E[A]();break;case "json":{let f=await E.text();w=f?JSON.parse(f):{};break}case "stream":return d.responseStyle==="data"?E.body:{data:E.body,...P}}return A==="json"&&(d.responseValidator&&await d.responseValidator(w),d.responseTransformer&&(w=await d.responseTransformer(w))),d.responseStyle==="data"?w:{data:w,...P}}let O=await E.text(),B;try{B=JSON.parse(O);}catch{}throw B??O}catch(d){let g=d;for(let y of a.error.fns)y&&(g=await y(g,E,x,p));if(g=g||{},u)throw g;return m==="data"?void 0:{error:g,request:x,response:E}}},s=p=>u=>i({...u,method:p}),l=p=>async u=>{let{opts:m,url:x}=await c(u);return H({...m,body:m.body,method:p,onRequest:async(E,d)=>{let g=new Request(E,d);for(let y of a.request.fns)y&&(g=await y(g,m));return g},serializedBody:q(m),url:x})};return {buildUrl:p=>F({...t,...p}),connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:r,head:s("HEAD"),interceptors:a,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:i,setConfig:n,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:s("TRACE")}};var o=K(T({baseUrl:"https://odyssey.asteroid.ai/agents/v2"}));var Ee=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/admin/customer-activity",...e}),ge=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/admin/customer-activity/notable",...e}),Ae=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/admin/customer-activity/window-stats",...e}),fe=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools",...e}),xe=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools",...e,headers:{"Content-Type":"application/json",...e.headers}}),he=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e}),ye=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e}),me=e=>(e.client??o).patch({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),we=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e}),Pe=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles",...e}),Se=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e}),De=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e}),Te=e=>(e.client??o).patch({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),be=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/clear-browser-cache",...e}),ke=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/duplicate",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/inbox-emails",...e}),Ge=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/inbox-emails/{emailId}",...e}),We=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents",...e}),Ie=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents",...e,headers:{"Content-Type":"application/json",...e.headers}}),Be=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/available-tools",...e}),Le=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}",...e}),qe=e=>(e.client??o).patch({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Fe=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/execute",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows",...e}),Ke=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/validate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ve=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}",...e}),ze=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}",...e}),je=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/execute",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/inputs",...e}),Xe=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/output-schemas",...e}),He=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/publish",...e}),$e=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/context",...e}),Qe=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/docs/search",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/environments",...e}),_e=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/environments",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ye=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/environments/{environmentId}",...e}),Ze=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/environments/{environmentId}/stop",...e}),et=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches",...e}),tt=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches",...e,headers:{"Content-Type":"application/json",...e.headers}}),rt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}",...e}),ot=e=>(e.client??o).put({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/cancel",...e}),nt=e=>(e.client??o).put({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/pause",...e}),st=e=>(e.client??o).put({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/resume",...e}),it=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions",...e}),at=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}",...e}),lt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/activities",...e}),ct=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/agent-files",...e}),ut=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/agent-files/{fileId}/download",...e}),pt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files",...e}),dt=e=>(e.client??o).post({...v,security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files",...e,headers:{"Content-Type":null,...e.headers}}),Et=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files/{fileId}/download",...e}),gt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/debug-files/{fileId}/download",...e}),At=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/files",...e}),ft=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/files/{fileId}/download",...e}),xt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/recording",...e}),ht=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/status",...e,headers:{"Content-Type":"application/json",...e.headers}}),yt=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/user-messages",...e,headers:{"Content-Type":"application/json",...e.headers}}),mt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/scheduled-executions",...e}),wt=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/schema/validate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rt=e=>(e.client??o).post({...v,security:[{name:"X-Api-Key",type:"apiKey"}],url:"/temp-files/{organizationId}",...e,headers:{"Content-Type":null,...e.headers}}),Pt=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/workflows/validate",...e,headers:{"Content-Type":"application/json",...e.headers}});
|
|
7
7
|
exports.adminCustomerActivityList=Ee;exports.adminCustomerActivityNotableList=ge;exports.adminCustomerActivityWindowStatsList=Ae;exports.agentByIdDelete=Le;exports.agentByIdUpdate=qe;exports.agentCreate=Ie;exports.agentExecutePost=Fe;exports.agentList=We;exports.agentProfileClearBrowserCache=be;exports.agentProfileDelete=Ce;exports.agentProfileDuplicate=ke;exports.agentProfileGet=De;exports.agentProfileGetInboxEmail=Ge;exports.agentProfileGetInboxEmails=ve;exports.agentProfilePoolDelete=he;exports.agentProfilePoolGet=ye;exports.agentProfilePoolMembersAdd=Pe;exports.agentProfilePoolMembersList=Re;exports.agentProfilePoolMembersRemove=we;exports.agentProfilePoolUpdate=me;exports.agentProfilePoolsCreate=xe;exports.agentProfilePoolsList=fe;exports.agentProfileUpdate=Te;exports.agentProfilesCreate=Se;exports.agentProfilesList=Oe;exports.agentWorkflowsCreate=Ke;exports.agentWorkflowsDeleteWorkflow=Ve;exports.agentWorkflowsExecute=je;exports.agentWorkflowsGet=ze;exports.agentWorkflowsGetInputs=Ne;exports.agentWorkflowsGetOutputSchemas=Xe;exports.agentWorkflowsList=Ue;exports.agentWorkflowsPublish=He;exports.agentWorkflowsValidate=Me;exports.availableToolsList=Be;exports.client=o;exports.contextGet=$e;exports.docsSearchSearch=Qe;exports.environmentByIdGet=Ye;exports.environmentByIdStop=Ze;exports.environmentsList=Je;exports.environmentsStart=_e;exports.executionActivitiesGet=lt;exports.executionAgentFileDownloadRedirect=ut;exports.executionAgentFilesGet=ct;exports.executionBatchCancel=ot;exports.executionBatchGet=rt;exports.executionBatchPause=nt;exports.executionBatchResume=st;exports.executionBatchesCreate=tt;exports.executionBatchesList=et;exports.executionContextFileDownloadRedirect=Et;exports.executionContextFilesGet=pt;exports.executionContextFilesUpload=dt;exports.executionDebugFileDownloadRedirect=gt;exports.executionFileDownloadRedirect=ft;exports.executionFilesGet=At;exports.executionGet=at;exports.executionRecordingRedirect=xt;exports.executionStatusUpdate=ht;exports.executionUserMessagesAdd=yt;exports.executionsList=it;exports.scheduledExecutionsList=mt;exports.schemaValidationValidate=wt;exports.tempFilesStage=Rt;exports.workflowSpecValidationValidate=Pt;
|
package/dist/index.mjs
CHANGED
|
@@ -3,5 +3,5 @@ var X=(e,t,r)=>{typeof r=="string"||r instanceof Blob?e.append(t,r):r instanceof
|
|
|
3
3
|
|
|
4
4
|
`);f=V.pop()??"";for(let re of V){let oe=re.split(`
|
|
5
5
|
`),k=[],z;for(let R of oe)if(R.startsWith("data:"))k.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))z=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))u=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let N=Number.parseInt(R.replace(/^retry:\s*/,""),10);Number.isNaN(N)||(d=N);}let S,j=!1;if(k.length){let R=k.join(`
|
|
6
|
-
`);try{S=JSON.parse(R),j=!0;}catch{S=R;}}j&&(a&&await a(S),n&&(S=await n(S))),r?.({data:S,event:z,id:u,retry:d}),k.length&&(yield S);}}}finally{y.removeEventListener("abort",M),w.releaseLock();}break}catch(P){if(t?.(P),i!==void 0&&g>=i)break;let O=Math.min(d*2**(g-1),s??3e4);await m(O);}}}()}}var ne=e=>{switch(e){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},se=e=>{switch(e){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},ie=e=>{switch(e){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},G=({allowReserved:e,explode:t,name:r,style:n,value:a})=>{if(!t){let s=(e?a:a.map(l=>encodeURIComponent(l))).join(se(n));switch(n){case "label":return `.${s}`;case "matrix":return `;${r}=${s}`;case "simple":return s;default:return `${r}=${s}`}}let c=ne(n),i=a.map(s=>n==="label"||n==="simple"?e?s:encodeURIComponent(s):C({allowReserved:e,name:r,value:s})).join(c);return n==="label"||n==="matrix"?c+i:i},C=({allowReserved:e,name:t,value:r})=>{if(r==null)return "";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${e?r:encodeURIComponent(r)}`},W=({allowReserved:e,explode:t,name:r,style:n,value:a,valueOnly:c})=>{if(a instanceof Date)return c?a.toISOString():`${r}=${a.toISOString()}`;if(n!=="deepObject"&&!t){let l=[];Object.entries(a).forEach(([p,u])=>{l=[...l,p,e?u:encodeURIComponent(u)];});let h=l.join(",");switch(n){case "form":return `${r}=${h}`;case "label":return `.${h}`;case "matrix":return `;${r}=${h}`;default:return h}}let i=ie(n),s=Object.entries(a).map(([l,h])=>C({allowReserved:e,name:n==="deepObject"?`${r}[${l}]`:l,value:h})).join(i);return n==="label"||n==="matrix"?i+s:s};var ae=/\{[^{}]+\}/g,le=({path:e,url:t})=>{let r=t,n=t.match(ae);if(n)for(let a of n){let c=false,i=a.substring(1,a.length-1),s="simple";i.endsWith("*")&&(c=true,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),s="label"):i.startsWith(";")&&(i=i.substring(1),s="matrix");let l=e[i];if(l==null)continue;if(Array.isArray(l)){r=r.replace(a,G({explode:c,name:i,style:s,value:l}));continue}if(typeof l=="object"){r=r.replace(a,W({explode:c,name:i,style:s,value:l,valueOnly:true}));continue}if(s==="matrix"){r=r.replace(a,`;${C({name:i,value:l})}`);continue}let h=encodeURIComponent(s==="label"?`.${l}`:l);r=r.replace(a,h);}return r},$=({baseUrl:e,path:t,query:r,querySerializer:n,url:a})=>{let c=a.startsWith("/")?a:`/${a}`,i=(e??"")+c;t&&(i=le({path:t,url:i}));let s=r?n(r):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(i+=`?${s}`),i};function q(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return "serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(t)return e.body}var Q=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r};var J=({parameters:e={},...t}={})=>n=>{let a=[];if(n&&typeof n=="object")for(let c in n){let i=n[c];if(i==null)continue;let s=e[c]||t;if(Array.isArray(i)){let l=G({allowReserved:s.allowReserved,explode:true,name:c,style:"form",value:i,...s.array});l&&a.push(l);}else if(typeof i=="object"){let l=W({allowReserved:s.allowReserved,explode:true,name:c,style:"deepObject",value:i,...s.object});l&&a.push(l);}else {let l=C({allowReserved:s.allowReserved,name:c,value:i});l&&a.push(l);}}return a.join("&")},_=e=>{if(!e)return "stream";let t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return "json";if(t==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return "blob";if(t.startsWith("text/"))return "text"}},ce=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)):false;async function Y(e){for(let t of e.security??[]){if(ce(e,t.name))continue;let r=await Q(t,e.auth);if(!r)continue;let n=t.name??"Authorization";switch(t.in){case "query":e.query||(e.query={}),e.query[n]=r;break;case "cookie":e.headers.append("Cookie",`${n}=${r}`);break;default:e.headers.set(n,r);break}}}var F=e=>$({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:J(e.querySerializer),url:e.url}),U=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=I(e.headers,t.headers),r},ue=e=>{let t=[];return e.forEach((r,n)=>{t.push([n,r]);}),t},I=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let n=r instanceof Headers?ue(r):Object.entries(r);for(let[a,c]of n)if(c===null)t.delete(a);else if(Array.isArray(c))for(let i of c)t.append(a,i);else c!==void 0&&t.set(a,typeof c=="object"?JSON.stringify(c):c);}return t},D=class{fns=[];clear(){this.fns=[];}eject(t){let r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null);}exists(t){let r=this.getInterceptorIndex(t);return !!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){let n=this.getInterceptorIndex(t);return this.fns[n]?(this.fns[n]=r,t):false}use(t){return this.fns.push(t),this.fns.length-1}},Z=()=>({error:new D,request:new D,response:new D}),pe=J({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),de={"Content-Type":"application/json"},T=(e={})=>({...L,headers:de,parseAs:"auto",querySerializer:pe,...e});var K=(e={})=>{let t=U(T(),e),r=()=>({...t}),n=p=>(t=U(t,p),r()),a=Z(),c=async p=>{let u={...t,...p,fetch:p.fetch??t.fetch??globalThis.fetch,headers:I(t.headers,p.headers),serializedBody:void 0};u.security&&await Y(u),u.requestValidator&&await u.requestValidator(u),u.body!==void 0&&u.bodySerializer&&(u.serializedBody=u.bodySerializer(u.body)),(u.body===void 0||u.serializedBody==="")&&u.headers.delete("Content-Type");let m=u,x=F(m);return {opts:m,url:x}},i=async p=>{let u=p.throwOnError??t.throwOnError,m=p.responseStyle??t.responseStyle,x,E;try{let{opts:d,url:g}=await c(p),y={redirect:"follow",...d,body:q(d)};x=new Request(g,y);for(let A of a.request.fns)A&&(x=await A(x,d));let b=d.fetch;E=await b(x);for(let A of a.response.fns)A&&(E=await A(E,x,d));let P={request:x,response:E};if(E.ok){let A=(d.parseAs==="auto"?_(E.headers.get("Content-Type")):d.parseAs)??"json";if(E.status===204||E.headers.get("Content-Length")==="0"){let f;switch(A){case "arrayBuffer":case "blob":case "text":f=await E[A]();break;case "formData":f=new FormData;break;case "stream":f=E.body;break;default:f={};break}return d.responseStyle==="data"?f:{data:f,...P}}let w;switch(A){case "arrayBuffer":case "blob":case "formData":case "text":w=await E[A]();break;case "json":{let f=await E.text();w=f?JSON.parse(f):{};break}case "stream":return d.responseStyle==="data"?E.body:{data:E.body,...P}}return A==="json"&&(d.responseValidator&&await d.responseValidator(w),d.responseTransformer&&(w=await d.responseTransformer(w))),d.responseStyle==="data"?w:{data:w,...P}}let O=await E.text(),B;try{B=JSON.parse(O);}catch{}throw B??O}catch(d){let g=d;for(let y of a.error.fns)y&&(g=await y(g,E,x,p));if(g=g||{},u)throw g;return m==="data"?void 0:{error:g,request:x,response:E}}},s=p=>u=>i({...u,method:p}),l=p=>async u=>{let{opts:m,url:x}=await c(u);return H({...m,body:m.body,method:p,onRequest:async(E,d)=>{let g=new Request(E,d);for(let y of a.request.fns)y&&(g=await y(g,m));return g},serializedBody:q(m),url:x})};return {buildUrl:p=>F({...t,...p}),connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:r,head:s("HEAD"),interceptors:a,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:i,setConfig:n,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:s("TRACE")}};var o=K(T({baseUrl:"https://odyssey.asteroid.ai/agents/v2"}));var Ee=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/admin/customer-activity",...e}),ge=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/admin/customer-activity/notable",...e}),Ae=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/admin/customer-activity/window-stats",...e}),fe=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools",...e}),xe=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools",...e,headers:{"Content-Type":"application/json",...e.headers}}),he=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e}),ye=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e}),me=e=>(e.client??o).patch({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),we=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e}),Pe=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles",...e}),Se=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e}),De=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e}),Te=e=>(e.client??o).patch({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),be=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/clear-browser-cache",...e}),ke=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/duplicate",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/inbox-emails",...e}),Ge=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/inbox-emails/{emailId}",...e}),We=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents",...e}),Ie=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents",...e,headers:{"Content-Type":"application/json",...e.headers}}),Be=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/available-tools",...e}),Le=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}",...e}),qe=e=>(e.client??o).patch({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Fe=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/execute",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows",...e}),Ke=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/validate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ve=e=>(e.client??o).delete({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}",...e}),ze=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}",...e}),je=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/execute",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/inputs",...e}),Xe=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/output-schemas",...e}),He=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/publish",...e}),$e=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/context",...e}),Qe=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/docs/search",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/environments",...e}),_e=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/environments",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ye=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/environments/{environmentId}",...e}),Ze=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/environments/{environmentId}/stop",...e}),et=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches",...e}),tt=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches",...e,headers:{"Content-Type":"application/json",...e.headers}}),rt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}",...e}),ot=e=>(e.client??o).put({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/cancel",...e}),nt=e=>(e.client??o).put({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/pause",...e}),st=e=>(e.client??o).put({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/resume",...e}),it=e=>(e?.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions",...e}),at=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}",...e}),lt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/activities",...e}),ct=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/agent-files",...e}),ut=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/agent-files/{fileId}/download",...e}),pt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files",...e}),dt=e=>(e.client??o).post({...v,security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files",...e,headers:{"Content-Type":null,...e.headers}}),Et=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files/{fileId}/download",...e}),gt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/debug-files/{fileId}/download",...e}),At=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/files",...e}),ft=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/files/{fileId}/download",...e}),xt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/recording",...e}),ht=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/status",...e,headers:{"Content-Type":"application/json",...e.headers}}),yt=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/user-messages",...e,headers:{"Content-Type":"application/json",...e.headers}}),mt=e=>(e.client??o).get({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/scheduled-executions",...e}),wt=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/schema/validate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rt=e=>(e.client??o).post({...v,security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/temp-files/{organizationId}",...e,headers:{"Content-Type":null,...e.headers}}),Pt=e=>(e.client??o).post({security:[{name:"X-Asteroid-Agents-Api-Key",type:"apiKey"}],url:"/workflows/validate",...e,headers:{"Content-Type":"application/json",...e.headers}});
|
|
6
|
+
`);try{S=JSON.parse(R),j=!0;}catch{S=R;}}j&&(a&&await a(S),n&&(S=await n(S))),r?.({data:S,event:z,id:u,retry:d}),k.length&&(yield S);}}}finally{y.removeEventListener("abort",M),w.releaseLock();}break}catch(P){if(t?.(P),i!==void 0&&g>=i)break;let O=Math.min(d*2**(g-1),s??3e4);await m(O);}}}()}}var ne=e=>{switch(e){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},se=e=>{switch(e){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},ie=e=>{switch(e){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},G=({allowReserved:e,explode:t,name:r,style:n,value:a})=>{if(!t){let s=(e?a:a.map(l=>encodeURIComponent(l))).join(se(n));switch(n){case "label":return `.${s}`;case "matrix":return `;${r}=${s}`;case "simple":return s;default:return `${r}=${s}`}}let c=ne(n),i=a.map(s=>n==="label"||n==="simple"?e?s:encodeURIComponent(s):C({allowReserved:e,name:r,value:s})).join(c);return n==="label"||n==="matrix"?c+i:i},C=({allowReserved:e,name:t,value:r})=>{if(r==null)return "";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${e?r:encodeURIComponent(r)}`},W=({allowReserved:e,explode:t,name:r,style:n,value:a,valueOnly:c})=>{if(a instanceof Date)return c?a.toISOString():`${r}=${a.toISOString()}`;if(n!=="deepObject"&&!t){let l=[];Object.entries(a).forEach(([p,u])=>{l=[...l,p,e?u:encodeURIComponent(u)];});let h=l.join(",");switch(n){case "form":return `${r}=${h}`;case "label":return `.${h}`;case "matrix":return `;${r}=${h}`;default:return h}}let i=ie(n),s=Object.entries(a).map(([l,h])=>C({allowReserved:e,name:n==="deepObject"?`${r}[${l}]`:l,value:h})).join(i);return n==="label"||n==="matrix"?i+s:s};var ae=/\{[^{}]+\}/g,le=({path:e,url:t})=>{let r=t,n=t.match(ae);if(n)for(let a of n){let c=false,i=a.substring(1,a.length-1),s="simple";i.endsWith("*")&&(c=true,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),s="label"):i.startsWith(";")&&(i=i.substring(1),s="matrix");let l=e[i];if(l==null)continue;if(Array.isArray(l)){r=r.replace(a,G({explode:c,name:i,style:s,value:l}));continue}if(typeof l=="object"){r=r.replace(a,W({explode:c,name:i,style:s,value:l,valueOnly:true}));continue}if(s==="matrix"){r=r.replace(a,`;${C({name:i,value:l})}`);continue}let h=encodeURIComponent(s==="label"?`.${l}`:l);r=r.replace(a,h);}return r},$=({baseUrl:e,path:t,query:r,querySerializer:n,url:a})=>{let c=a.startsWith("/")?a:`/${a}`,i=(e??"")+c;t&&(i=le({path:t,url:i}));let s=r?n(r):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(i+=`?${s}`),i};function q(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return "serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(t)return e.body}var Q=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r};var J=({parameters:e={},...t}={})=>n=>{let a=[];if(n&&typeof n=="object")for(let c in n){let i=n[c];if(i==null)continue;let s=e[c]||t;if(Array.isArray(i)){let l=G({allowReserved:s.allowReserved,explode:true,name:c,style:"form",value:i,...s.array});l&&a.push(l);}else if(typeof i=="object"){let l=W({allowReserved:s.allowReserved,explode:true,name:c,style:"deepObject",value:i,...s.object});l&&a.push(l);}else {let l=C({allowReserved:s.allowReserved,name:c,value:i});l&&a.push(l);}}return a.join("&")},_=e=>{if(!e)return "stream";let t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return "json";if(t==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return "blob";if(t.startsWith("text/"))return "text"}},ce=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)):false;async function Y(e){for(let t of e.security??[]){if(ce(e,t.name))continue;let r=await Q(t,e.auth);if(!r)continue;let n=t.name??"Authorization";switch(t.in){case "query":e.query||(e.query={}),e.query[n]=r;break;case "cookie":e.headers.append("Cookie",`${n}=${r}`);break;default:e.headers.set(n,r);break}}}var F=e=>$({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:J(e.querySerializer),url:e.url}),U=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=I(e.headers,t.headers),r},ue=e=>{let t=[];return e.forEach((r,n)=>{t.push([n,r]);}),t},I=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let n=r instanceof Headers?ue(r):Object.entries(r);for(let[a,c]of n)if(c===null)t.delete(a);else if(Array.isArray(c))for(let i of c)t.append(a,i);else c!==void 0&&t.set(a,typeof c=="object"?JSON.stringify(c):c);}return t},D=class{fns=[];clear(){this.fns=[];}eject(t){let r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null);}exists(t){let r=this.getInterceptorIndex(t);return !!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){let n=this.getInterceptorIndex(t);return this.fns[n]?(this.fns[n]=r,t):false}use(t){return this.fns.push(t),this.fns.length-1}},Z=()=>({error:new D,request:new D,response:new D}),pe=J({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),de={"Content-Type":"application/json"},T=(e={})=>({...L,headers:de,parseAs:"auto",querySerializer:pe,...e});var K=(e={})=>{let t=U(T(),e),r=()=>({...t}),n=p=>(t=U(t,p),r()),a=Z(),c=async p=>{let u={...t,...p,fetch:p.fetch??t.fetch??globalThis.fetch,headers:I(t.headers,p.headers),serializedBody:void 0};u.security&&await Y(u),u.requestValidator&&await u.requestValidator(u),u.body!==void 0&&u.bodySerializer&&(u.serializedBody=u.bodySerializer(u.body)),(u.body===void 0||u.serializedBody==="")&&u.headers.delete("Content-Type");let m=u,x=F(m);return {opts:m,url:x}},i=async p=>{let u=p.throwOnError??t.throwOnError,m=p.responseStyle??t.responseStyle,x,E;try{let{opts:d,url:g}=await c(p),y={redirect:"follow",...d,body:q(d)};x=new Request(g,y);for(let A of a.request.fns)A&&(x=await A(x,d));let b=d.fetch;E=await b(x);for(let A of a.response.fns)A&&(E=await A(E,x,d));let P={request:x,response:E};if(E.ok){let A=(d.parseAs==="auto"?_(E.headers.get("Content-Type")):d.parseAs)??"json";if(E.status===204||E.headers.get("Content-Length")==="0"){let f;switch(A){case "arrayBuffer":case "blob":case "text":f=await E[A]();break;case "formData":f=new FormData;break;case "stream":f=E.body;break;default:f={};break}return d.responseStyle==="data"?f:{data:f,...P}}let w;switch(A){case "arrayBuffer":case "blob":case "formData":case "text":w=await E[A]();break;case "json":{let f=await E.text();w=f?JSON.parse(f):{};break}case "stream":return d.responseStyle==="data"?E.body:{data:E.body,...P}}return A==="json"&&(d.responseValidator&&await d.responseValidator(w),d.responseTransformer&&(w=await d.responseTransformer(w))),d.responseStyle==="data"?w:{data:w,...P}}let O=await E.text(),B;try{B=JSON.parse(O);}catch{}throw B??O}catch(d){let g=d;for(let y of a.error.fns)y&&(g=await y(g,E,x,p));if(g=g||{},u)throw g;return m==="data"?void 0:{error:g,request:x,response:E}}},s=p=>u=>i({...u,method:p}),l=p=>async u=>{let{opts:m,url:x}=await c(u);return H({...m,body:m.body,method:p,onRequest:async(E,d)=>{let g=new Request(E,d);for(let y of a.request.fns)y&&(g=await y(g,m));return g},serializedBody:q(m),url:x})};return {buildUrl:p=>F({...t,...p}),connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:r,head:s("HEAD"),interceptors:a,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:i,setConfig:n,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:s("TRACE")}};var o=K(T({baseUrl:"https://odyssey.asteroid.ai/agents/v2"}));var Ee=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/admin/customer-activity",...e}),ge=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/admin/customer-activity/notable",...e}),Ae=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/admin/customer-activity/window-stats",...e}),fe=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools",...e}),xe=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools",...e,headers:{"Content-Type":"application/json",...e.headers}}),he=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e}),ye=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e}),me=e=>(e.client??o).patch({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),we=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e}),Pe=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profile-pools/{poolId}/members",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles",...e}),Se=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e}),De=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e}),Te=e=>(e.client??o).patch({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),be=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/clear-browser-cache",...e}),ke=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/duplicate",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/inbox-emails",...e}),Ge=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agent-profiles/{profileId}/inbox-emails/{emailId}",...e}),We=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents",...e}),Ie=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents",...e,headers:{"Content-Type":"application/json",...e.headers}}),Be=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/available-tools",...e}),Le=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}",...e}),qe=e=>(e.client??o).patch({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Fe=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/execute",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows",...e}),Ke=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/validate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ve=e=>(e.client??o).delete({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}",...e}),ze=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}",...e}),je=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/execute",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/inputs",...e}),Xe=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/output-schemas",...e}),He=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/agents/{agentId}/workflows/{workflowId}/publish",...e}),$e=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/context",...e}),Qe=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/docs/search",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/environments",...e}),_e=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/environments",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ye=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/environments/{environmentId}",...e}),Ze=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/environments/{environmentId}/stop",...e}),et=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches",...e}),tt=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches",...e,headers:{"Content-Type":"application/json",...e.headers}}),rt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}",...e}),ot=e=>(e.client??o).put({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/cancel",...e}),nt=e=>(e.client??o).put({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/pause",...e}),st=e=>(e.client??o).put({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/execution-batches/{batchId}/resume",...e}),it=e=>(e?.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions",...e}),at=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}",...e}),lt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/activities",...e}),ct=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/agent-files",...e}),ut=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/agent-files/{fileId}/download",...e}),pt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files",...e}),dt=e=>(e.client??o).post({...v,security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files",...e,headers:{"Content-Type":null,...e.headers}}),Et=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/context-files/{fileId}/download",...e}),gt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/debug-files/{fileId}/download",...e}),At=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/files",...e}),ft=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/files/{fileId}/download",...e}),xt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/recording",...e}),ht=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/status",...e,headers:{"Content-Type":"application/json",...e.headers}}),yt=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/executions/{executionId}/user-messages",...e,headers:{"Content-Type":"application/json",...e.headers}}),mt=e=>(e.client??o).get({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/scheduled-executions",...e}),wt=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/schema/validate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rt=e=>(e.client??o).post({...v,security:[{name:"X-Api-Key",type:"apiKey"}],url:"/temp-files/{organizationId}",...e,headers:{"Content-Type":null,...e.headers}}),Pt=e=>(e.client??o).post({security:[{name:"X-Api-Key",type:"apiKey"}],url:"/workflows/validate",...e,headers:{"Content-Type":"application/json",...e.headers}});
|
|
7
7
|
export{Ee as adminCustomerActivityList,ge as adminCustomerActivityNotableList,Ae as adminCustomerActivityWindowStatsList,Le as agentByIdDelete,qe as agentByIdUpdate,Ie as agentCreate,Fe as agentExecutePost,We as agentList,be as agentProfileClearBrowserCache,Ce as agentProfileDelete,ke as agentProfileDuplicate,De as agentProfileGet,Ge as agentProfileGetInboxEmail,ve as agentProfileGetInboxEmails,he as agentProfilePoolDelete,ye as agentProfilePoolGet,Pe as agentProfilePoolMembersAdd,Re as agentProfilePoolMembersList,we as agentProfilePoolMembersRemove,me as agentProfilePoolUpdate,xe as agentProfilePoolsCreate,fe as agentProfilePoolsList,Te as agentProfileUpdate,Se as agentProfilesCreate,Oe as agentProfilesList,Ke as agentWorkflowsCreate,Ve as agentWorkflowsDeleteWorkflow,je as agentWorkflowsExecute,ze as agentWorkflowsGet,Ne as agentWorkflowsGetInputs,Xe as agentWorkflowsGetOutputSchemas,Ue as agentWorkflowsList,He as agentWorkflowsPublish,Me as agentWorkflowsValidate,Be as availableToolsList,o as client,$e as contextGet,Qe as docsSearchSearch,Ye as environmentByIdGet,Ze as environmentByIdStop,Je as environmentsList,_e as environmentsStart,lt as executionActivitiesGet,ut as executionAgentFileDownloadRedirect,ct as executionAgentFilesGet,ot as executionBatchCancel,rt as executionBatchGet,nt as executionBatchPause,st as executionBatchResume,tt as executionBatchesCreate,et as executionBatchesList,Et as executionContextFileDownloadRedirect,pt as executionContextFilesGet,dt as executionContextFilesUpload,gt as executionDebugFileDownloadRedirect,ft as executionFileDownloadRedirect,At as executionFilesGet,at as executionGet,xt as executionRecordingRedirect,ht as executionStatusUpdate,yt as executionUserMessagesAdd,it as executionsList,mt as scheduledExecutionsList,wt as schemaValidationValidate,Rt as tempFilesStage,Pt as workflowSpecValidationValidate};
|