@subcon/e2b-cli 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +0 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env node
2
- #!/usr/bin/env bun
3
- // @bun
4
2
  import{createRequire as gw}from"node:module";var yw=Object.create;var{getPrototypeOf:bw,defineProperty:hX,getOwnPropertyNames:D3,getOwnPropertyDescriptor:vw}=Object,O3=Object.prototype.hasOwnProperty;var uZ=($,X,Q)=>{Q=$!=null?yw(bw($)):{};let Z=X||!$||!$.__esModule?hX(Q,"default",{value:$,enumerable:!0}):Q;for(let J of D3($))if(!O3.call(Z,J))hX(Z,J,{get:()=>$[J],enumerable:!0});return Z},I3=new WeakMap,hw=($)=>{var X=I3.get($),Q;if(X)return X;if(X=hX({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function")D3($).map((Z)=>!O3.call(X,Z)&&hX(X,Z,{get:()=>$[Z],enumerable:!(Q=vw($,Z))||Q.enumerable}));return I3.set($,X),X},D=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var cZ=($,X)=>{for(var Q in X)hX($,Q,{get:X[Q],enumerable:!0,configurable:!0,set:(Z)=>X[Q]=()=>Z})};var p=($,X)=>()=>($&&(X=$($=0)),X);var z1=gw(import.meta.url);var IY=D((j3)=>{Object.defineProperty(j3,"__esModule",{value:!0});var aw=/\{[^{}]+\}/g,ow=()=>{return typeof process==="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici};function C3(){return Math.random().toString(36).slice(2,11)}function w3($){let{baseUrl:X="",Request:Q=globalThis.Request,fetch:Z=globalThis.fetch,querySerializer:J,bodySerializer:Y,headers:G,requestInitExt:K=void 0,...W}={...$};K=ow()?K:void 0,X=LY(X);let H=[];async function V(U,B){let{baseUrl:z,fetch:A=Z,Request:M=Q,headers:N,params:O={},parseAs:E="json",querySerializer:w,bodySerializer:k=Y??k3,body:x,...y}=B||{},b=X;if(z)b=LY(z)??X;let C=typeof J==="function"?J:AY(J);if(w)C=typeof w==="function"?w:AY({...typeof J==="object"?J:{},...w});let v=x===void 0?void 0:k(x,qY(G,N,O.header)),l=qY(v===void 0||v instanceof FormData?{}:{"Content-Type":"application/json"},G,N,O.header),L1={redirect:"follow",...W,...y,body:v,headers:l},E1,m1,y1=new M(x3(U,{baseUrl:b,params:O,querySerializer:C}),L1),i;for(let B1 in y)if(!(B1 in y1))y1[B1]=y[B1];if(H.length){E1=C3(),m1=Object.freeze({baseUrl:b,fetch:A,parseAs:E,querySerializer:C,bodySerializer:k});for(let B1 of H)if(B1&&typeof B1==="object"&&typeof B1.onRequest==="function"){let d=await B1.onRequest({request:y1,schemaPath:U,params:O,options:m1,id:E1});if(d)if(d instanceof M)y1=d;else if(d instanceof Response){i=d;break}else throw Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!i){try{i=await A(y1,K)}catch(B1){let d=B1;if(H.length)for(let k1=H.length-1;k1>=0;k1--){let i1=H[k1];if(i1&&typeof i1==="object"&&typeof i1.onError==="function"){let V0=await i1.onError({request:y1,error:d,schemaPath:U,params:O,options:m1,id:E1});if(V0){if(V0 instanceof Response){d=void 0,i=V0;break}if(V0 instanceof Error){d=V0;continue}throw Error("onError: must return new Response() or instance of Error")}}}if(d)throw d}if(H.length)for(let B1=H.length-1;B1>=0;B1--){let d=H[B1];if(d&&typeof d==="object"&&typeof d.onResponse==="function"){let k1=await d.onResponse({request:y1,response:i,schemaPath:U,params:O,options:m1,id:E1});if(k1){if(!(k1 instanceof Response))throw Error("onResponse: must return new Response() when modifying the response");i=k1}}}}if(i.status===204||y1.method==="HEAD"||i.headers.get("Content-Length")==="0")return i.ok?{data:void 0,response:i}:{error:void 0,response:i};if(i.ok){if(E==="stream")return{data:i.body,response:i};return{data:await i[E](),response:i}}let _1=await i.text();try{_1=JSON.parse(_1)}catch{}return{error:_1,response:i}}return{request(U,B,z){return V(B,{...z,method:U.toUpperCase()})},GET(U,B){return V(U,{...B,method:"GET"})},PUT(U,B){return V(U,{...B,method:"PUT"})},POST(U,B){return V(U,{...B,method:"POST"})},DELETE(U,B){return V(U,{...B,method:"DELETE"})},OPTIONS(U,B){return V(U,{...B,method:"OPTIONS"})},HEAD(U,B){return V(U,{...B,method:"HEAD"})},PATCH(U,B){return V(U,{...B,method:"PATCH"})},TRACE(U,B){return V(U,{...B,method:"TRACE"})},use(...U){for(let B of U){if(!B)continue;if(typeof B!=="object"||!(("onRequest"in B)||("onResponse"in B)||("onError"in B)))throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");H.push(B)}},eject(...U){for(let B of U){let z=H.indexOf(B);if(z!==-1)H.splice(z,1)}}}}class R3{constructor($,X){this.client=$,this.url=X}GET=($)=>{return this.client.GET(this.url,$)};PUT=($)=>{return this.client.PUT(this.url,$)};POST=($)=>{return this.client.POST(this.url,$)};DELETE=($)=>{return this.client.DELETE(this.url,$)};OPTIONS=($)=>{return this.client.OPTIONS(this.url,$)};HEAD=($)=>{return this.client.HEAD(this.url,$)};PATCH=($)=>{return this.client.PATCH(this.url,$)};TRACE=($)=>{return this.client.TRACE(this.url,$)}}class T3{constructor(){this.client=null}get($,X){let Q=new R3($,X);return this.client[X]=Q,Q}}function S3($){let X=new T3,Q=new Proxy($,X);function Z(){}Z.prototype=Q;let J=new Z;return X.client=J,J}function rw($){return S3(w3($))}function gX($,X,Q){if(X===void 0||X===null)return"";if(typeof X==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${$}=${Q?.allowReserved===!0?X:encodeURIComponent(X)}`}function MY($,X,Q){if(!X||typeof X!=="object")return"";let Z=[],J={simple:",",label:".",matrix:";"}[Q.style]||"&";if(Q.style!=="deepObject"&&Q.explode===!1){for(let K in X)Z.push(K,Q.allowReserved===!0?X[K]:encodeURIComponent(X[K]));let G=Z.join(",");switch(Q.style){case"form":return`${$}=${G}`;case"label":return`.${G}`;case"matrix":return`;${$}=${G}`;default:return G}}for(let G in X){let K=Q.style==="deepObject"?`${$}[${G}]`:G;Z.push(gX(K,X[G],Q))}let Y=Z.join(J);return Q.style==="label"||Q.style==="matrix"?`${J}${Y}`:Y}function NY($,X,Q){if(!Array.isArray(X))return"";if(Q.explode===!1){let Y={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[Q.style]||",",G=(Q.allowReserved===!0?X:X.map((K)=>encodeURIComponent(K))).join(Y);switch(Q.style){case"simple":return G;case"label":return`.${G}`;case"matrix":return`;${$}=${G}`;default:return`${$}=${G}`}}let Z={simple:",",label:".",matrix:";"}[Q.style]||"&",J=[];for(let Y of X)if(Q.style==="simple"||Q.style==="label")J.push(Q.allowReserved===!0?Y:encodeURIComponent(Y));else J.push(gX($,Y,Q));return Q.style==="label"||Q.style==="matrix"?`${Z}${J.join(Z)}`:J.join(Z)}function AY($){return function(Q){let Z=[];if(Q&&typeof Q==="object")for(let J in Q){let Y=Q[J];if(Y===void 0||Y===null)continue;if(Array.isArray(Y)){if(Y.length===0)continue;Z.push(NY(J,Y,{style:"form",explode:!0,...$?.array,allowReserved:$?.allowReserved||!1}));continue}if(typeof Y==="object"){Z.push(MY(J,Y,{style:"deepObject",explode:!0,...$?.object,allowReserved:$?.allowReserved||!1}));continue}Z.push(gX(J,Y,$))}return Z.join("&")}}function E3($,X){let Q=$;for(let Z of $.match(aw)??[]){let J=Z.substring(1,Z.length-1),Y=!1,G="simple";if(J.endsWith("*"))Y=!0,J=J.substring(0,J.length-1);if(J.startsWith("."))G="label",J=J.substring(1);else if(J.startsWith(";"))G="matrix",J=J.substring(1);if(!X||X[J]===void 0||X[J]===null)continue;let K=X[J];if(Array.isArray(K)){Q=Q.replace(Z,NY(J,K,{style:G,explode:Y}));continue}if(typeof K==="object"){Q=Q.replace(Z,MY(J,K,{style:G,explode:Y}));continue}if(G==="matrix"){Q=Q.replace(Z,`;${gX(J,K)}`);continue}Q=Q.replace(Z,G==="label"?`.${encodeURIComponent(K)}`:encodeURIComponent(K))}return Q}function k3($,X){if($ instanceof FormData)return $;if(X){if((X.get instanceof Function?X.get("Content-Type")??X.get("content-type"):X["Content-Type"]??X["content-type"])==="application/x-www-form-urlencoded")return new URLSearchParams($).toString()}return JSON.stringify($)}function x3($,X){let Q=`${X.baseUrl}${$}`;if(X.params?.path)Q=E3(Q,X.params.path);let Z=X.querySerializer(X.params.query??{});if(Z.startsWith("?"))Z=Z.substring(1);if(Z)Q+=`?${Z}`;return Q}function qY(...$){let X=new Headers;for(let Q of $){if(!Q||typeof Q!=="object")continue;let Z=Q instanceof Headers?Q.entries():Object.entries(Q);for(let[J,Y]of Z)if(Y===null)X.delete(J);else if(Array.isArray(Y))for(let G of Y)X.append(J,G);else if(Y!==void 0)X.set(J,Y)}return X}function LY($){if($.endsWith("/"))return $.substring(0,$.length-1);return $}j3.createFinalURL=x3;j3.createPathBasedClient=rw;j3.createQuerySerializer=AY;j3.default=w3;j3.defaultBodySerializer=k3;j3.defaultPathSerializer=E3;j3.mergeHeaders=qY;j3.randomID=C3;j3.removeTrailingSlash=LY;j3.serializeArrayParam=NY;j3.serializeObjectParam=MY;j3.serializePrimitiveParam=gX;j3.wrapAsPathBasedClient=S3});var DY=D((lZ,fX)=>{/*!
5
3
  * Platform.js v1.3.6
6
4
  * Copyright 2014-2020 Benjamin Tan
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subcon/e2b-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "CLI-first autonomous agent using Subconscious + E2B",