@e2b/cli 0.2.2 → 0.2.3
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 +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ ${r.message}`:C,U=[F,t,e].filter(Boolean).join(`
|
|
|
71
71
|
`),a+=t+"[["+s+`]]
|
|
72
72
|
`,a+=JE(s+".",t,o)}),a}function rj(e,t,n,r){var i=e+hu(n),s="";return A9(r).length>0&&(s+=t+"["+i+`]
|
|
73
73
|
`),s+JE(i+".",t,r)}});var L9=E(n1=>{"use strict";l();n1.parse=R9();n1.stringify=M9()});var s1=E(fs=>{"use strict";l();Object.defineProperty(fs,"__esModule",{value:!0});fs.DEFAULT_COLOR_MAP=void 0;fs.DEFAULT_COLOR_MAP={red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",white_bold:"\x1B[01m",reset:"\x1B[0m"};var i1=class{constructor(t=fs.DEFAULT_COLOR_MAP){this.text="",this.colorMap=t}addCharsWithColor(t,n){let r=this.colorMap[t];this.text+=r!==void 0?`${r}${n}${this.colorMap.reset}`:n}renderConsole(){return this.text}};fs.default=i1});var Ka=E(je=>{"use strict";l();Object.defineProperty(je,"__esModule",{value:!0});je.DEFAULT_HEADER_ALIGNMENT=je.DEFAULT_ROW_ALIGNMENT=je.DEFAULT_HEADER_FONT_COLOR=je.DEFAULT_ROW_FONT_COLOR=je.COLORS=je.ALIGNMENTS=je.DEFAULT_TABLE_STYLE=je.DEFAULT_ROW_SEPARATOR=je.DEFAULT_COLUMN_LEN=void 0;je.DEFAULT_COLUMN_LEN=20;je.DEFAULT_ROW_SEPARATOR=!1;je.DEFAULT_TABLE_STYLE={headerTop:{left:"\u250C",mid:"\u252C",right:"\u2510",other:"\u2500"},headerBottom:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"},tableBottom:{left:"\u2514",mid:"\u2534",right:"\u2518",other:"\u2500"},vertical:"\u2502",rowSeparator:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"}};je.ALIGNMENTS=["right","left","center"];je.COLORS=["red","green","yellow","white","blue","magenta","cyan","white_bold","reset"];je.DEFAULT_ROW_FONT_COLOR="white";je.DEFAULT_HEADER_FONT_COLOR="white_bold";je.DEFAULT_ROW_ALIGNMENT="right";je.DEFAULT_HEADER_ALIGNMENT="center"});var a1=E($n=>{"use strict";l();Object.defineProperty($n,"__esModule",{value:!0});$n.rawColumnToInternalColumn=$n.objIfExists=void 0;var dj=Ka(),_j=(e,t)=>t?{[e]:t}:{};$n.objIfExists=_j;var mj=e=>{var t;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(t=e.title)!==null&&t!==void 0?t:e.name},(0,$n.objIfExists)("color",e.color)),(0,$n.objIfExists)("maxLen",e.maxLen)),(0,$n.objIfExists)("minLen",e.minLen)),{alignment:e.alignment||dj.DEFAULT_ROW_ALIGNMENT})};$n.rawColumnToInternalColumn=mj});var Y9=E(o1=>{"use strict";l();Object.defineProperty(o1,"__esModule",{value:!0});var pj=[{first:768,last:879},{first:1155,last:1158},{first:1160,last:1161},{first:1425,last:1469},{first:1471,last:1471},{first:1473,last:1474},{first:1476,last:1477},{first:1479,last:1479},{first:1536,last:1539},{first:1552,last:1557},{first:1611,last:1630},{first:1648,last:1648},{first:1750,last:1764},{first:1767,last:1768},{first:1770,last:1773},{first:1807,last:1807},{first:1809,last:1809},{first:1840,last:1866},{first:1958,last:1968},{first:2027,last:2035},{first:2305,last:2306},{first:2364,last:2364},{first:2369,last:2376},{first:2381,last:2381},{first:2385,last:2388},{first:2402,last:2403},{first:2433,last:2433},{first:2492,last:2492},{first:2497,last:2500},{first:2509,last:2509},{first:2530,last:2531},{first:2561,last:2562},{first:2620,last:2620},{first:2625,last:2626},{first:2631,last:2632},{first:2635,last:2637},{first:2672,last:2673},{first:2689,last:2690},{first:2748,last:2748},{first:2753,last:2757},{first:2759,last:2760},{first:2765,last:2765},{first:2786,last:2787},{first:2817,last:2817},{first:2876,last:2876},{first:2879,last:2879},{first:2881,last:2883},{first:2893,last:2893},{first:2902,last:2902},{first:2946,last:2946},{first:3008,last:3008},{first:3021,last:3021},{first:3134,last:3136},{first:3142,last:3144},{first:3146,last:3149},{first:3157,last:3158},{first:3260,last:3260},{first:3263,last:3263},{first:3270,last:3270},{first:3276,last:3277},{first:3298,last:3299},{first:3393,last:3395},{first:3405,last:3405},{first:3530,last:3530},{first:3538,last:3540},{first:3542,last:3542},{first:3633,last:3633},{first:3636,last:3642},{first:3655,last:3662},{first:3761,last:3761},{first:3764,last:3769},{first:3771,last:3772},{first:3784,last:3789},{first:3864,last:3865},{first:3893,last:3893},{first:3895,last:3895},{first:3897,last:3897},{first:3953,last:3966},{first:3968,last:3972},{first:3974,last:3975},{first:3984,last:3991},{first:3993,last:4028},{first:4038,last:4038},{first:4141,last:4144},{first:4146,last:4146},{first:4150,last:4151},{first:4153,last:4153},{first:4184,last:4185},{first:4448,last:4607},{first:4959,last:4959},{first:5906,last:5908},{first:5938,last:5940},{first:5970,last:5971},{first:6002,last:6003},{first:6068,last:6069},{first:6071,last:6077},{first:6086,last:6086},{first:6089,last:6099},{first:6109,last:6109},{first:6155,last:6157},{first:6313,last:6313},{first:6432,last:6434},{first:6439,last:6440},{first:6450,last:6450},{first:6457,last:6459},{first:6679,last:6680},{first:6912,last:6915},{first:6964,last:6964},{first:6966,last:6970},{first:6972,last:6972},{first:6978,last:6978},{first:7019,last:7027},{first:7616,last:7626},{first:7678,last:7679},{first:8203,last:8207},{first:8234,last:8238},{first:8288,last:8291},{first:8298,last:8303},{first:8400,last:8431},{first:12330,last:12335},{first:12441,last:12442},{first:43014,last:43014},{first:43019,last:43019},{first:43045,last:43046},{first:64286,last:64286},{first:65024,last:65039},{first:65056,last:65059},{first:65279,last:65279},{first:65529,last:65531},{first:68097,last:68099},{first:68101,last:68102},{first:68108,last:68111},{first:68152,last:68154},{first:68159,last:68159},{first:119143,last:119145},{first:119155,last:119170},{first:119173,last:119179},{first:119210,last:119213},{first:119362,last:119364},{first:917505,last:917505},{first:917536,last:917631},{first:917760,last:917999}];o1.default=pj});var q9=E(l1=>{"use strict";l();Object.defineProperty(l1,"__esModule",{value:!0});var Ej=(e,t,n)=>{let r=0,i,s=n;if(e<t[0].first||e>t[s].last)return 0;for(;s>=r;)if(i=Math.floor((r+s)/2),e>t[i].last)r=i+1;else if(e<t[i].first)s=i-1;else return 1;return 0};l1.default=Ej});var c1=E(za=>{"use strict";l();var $9=za&&za.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(za,"__esModule",{value:!0});var V9=$9(Y9()),fj=$9(q9()),gj=e=>e===0?0:e<32||e>=127&&e<160?-1:fj.default(e,V9.default,V9.default.length-1)?0:1+ +(e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141));za.default=gj});var W9=E(Qa=>{"use strict";l();var hj=Qa&&Qa.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qa,"__esModule",{value:!0});var Sj=hj(c1()),Tj=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n),i=Sj.default(r);if(i<0)return-1;t+=i}return t};Qa.default=Tj});var z9=E(Ar=>{"use strict";l();var K9=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.wcswidth=Ar.wcwidth=void 0;var bj=K9(W9());Ar.wcswidth=bj.default;var Dj=K9(c1());Ar.wcwidth=Dj.default});var u1=E(si=>{"use strict";l();Object.defineProperty(si,"__esModule",{value:!0});si.findWidthInConsole=si.stripAnsi=void 0;var Cj=z9(),Rj=/\x1b\[\d{1,3}(;\d{1,3})*m/g,Aj=e=>e.replace(Rj,"");si.stripAnsi=Aj;var Oj=(e,t)=>{let n=0;return e=(0,si.stripAnsi)(e),t&&Object.entries(t).forEach(([r,i])=>{let s=new RegExp(r,"g");n+=(e.match(s)||[]).length*i,e=e.replace(r,"")}),n+=(0,Cj.wcswidth)(e),n};si.findWidthInConsole=Oj});var _1=E(Or=>{"use strict";l();Object.defineProperty(Or,"__esModule",{value:!0});Or.biggestWordInSentence=Or.limitWidth=Or.textWithPadding=void 0;var d1=u1(),Nj=(e,t,n,r)=>{let i=(0,d1.findWidthInConsole)(e,r),s=Math.floor((n-i)/2),a=n-s-i;if(n<i)return e;switch(t){case"left":return e.concat(" ".repeat(n-i));case"center":return" ".repeat(s).concat(e).concat(" ".repeat(a));case"right":default:return" ".repeat(n-i).concat(e)}};Or.textWithPadding=Nj;var yj=(e,t,n)=>{let r=[],i=e.split(" "),s=[],a=0;return i.forEach(o=>{let c=(0,d1.findWidthInConsole)(o,n);a+c<=t?(a+=c+1,s.push(o)):(r.push(s.join(" ")),s=[o],a=c+1)}),r.push(s.join(" ")),r};Or.limitWidth=yj;var Ij=(e,t)=>e.split(" ").reduce((n,r)=>Math.max(n,(0,d1.findWidthInConsole)(r,t)),0);Or.biggestWordInSentence=Ij});var Xa=E(xe=>{"use strict";l();Object.defineProperty(xe,"__esModule",{value:!0});xe.getWidthLimitedColumnsArray=xe.createHeaderAsRow=xe.renderTableHorizontalBorders=xe.findLenOfColumn=xe.createRow=xe.createColumFromComputedColumn=xe.createColumFromOnlyName=xe.createTableHorizontalBorders=xe.convertRawRowOptionsToStandard=xe.cellText=void 0;var m1=a1(),Q9=u1(),p1=_1(),bu=Ka(),gs=(e,t)=>Math.max(e,t),vj=e=>e==null?"":`${e}`;xe.cellText=vj;var xj=e=>{if(e)return{color:e.color,separator:e.separator||bu.DEFAULT_ROW_SEPARATOR}};xe.convertRawRowOptionsToStandard=xj;var Mj=({left:e,mid:t,right:n,other:r},i)=>{let s=e;return i.forEach(a=>{s+=r.repeat(a+2),s+=t}),s=s.slice(0,-t.length),s+=n,s};xe.createTableHorizontalBorders=Mj;var Lj=e=>({name:e,title:e});xe.createColumFromOnlyName=Lj;var wj=e=>{var t;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(t=e.title)!==null&&t!==void 0?t:e.name},(0,m1.objIfExists)("color",e.color)),(0,m1.objIfExists)("maxLen",e.maxLen)),(0,m1.objIfExists)("minLen",e.minLen)),{alignment:e.alignment||bu.DEFAULT_ROW_ALIGNMENT})};xe.createColumFromComputedColumn=wj;var Pj=(e,t,n)=>({color:e,separator:n,text:t});xe.createRow=Pj;var Fj=(e,t,n)=>{let r=e.name,i=e.title,s=gs(0,e?.minLen||0);return e.maxLen?(s=gs(s,gs(e.maxLen,(0,p1.biggestWordInSentence)(i,n))),s=t.reduce((a,o)=>gs(a,(0,p1.biggestWordInSentence)((0,xe.cellText)(o.text[r]),n)),s),s):(s=gs(s,(0,Q9.findWidthInConsole)(i,n)),t.forEach(a=>{s=gs(s,(0,Q9.findWidthInConsole)((0,xe.cellText)(a.text[r]),n))}),s)};xe.findLenOfColumn=Fj;var kj=(e,t)=>(0,xe.createTableHorizontalBorders)(e,t);xe.renderTableHorizontalBorders=kj;var Bj=(e,t)=>{let n=bu.DEFAULT_HEADER_FONT_COLOR,r=e(n,{},!1);return t.forEach(i=>{r.text[i.name]=i.title}),r};xe.createHeaderAsRow=Bj;var Uj=(e,t,n)=>{let r={};return e.forEach(i=>{r[i.name]=(0,p1.limitWidth)((0,xe.cellText)(t.text[i.name]),i.length||bu.DEFAULT_COLUMN_LEN,n)}),r};xe.getWidthLimitedColumnsArray=Uj});var X9=E(hs=>{"use strict";l();Object.defineProperty(hs,"__esModule",{value:!0});hs.preProcessRows=hs.preProcessColumns=void 0;var Gj=Xa(),Hj=e=>{e.computedColumns.length&&e.computedColumns.forEach(t=>{e.addColumn(t),e.rows.forEach(n=>{n.text[t.name]=t.function(n.text)})})},Yj=e=>{e.enabledColumns.length&&(e.columns=e.columns.filter(t=>e.enabledColumns.includes(t.name)))},qj=e=>{e.disabledColumns.length&&(e.columns=e.columns.filter(t=>!e.disabledColumns.includes(t.name)))},Vj=e=>{e.columns.forEach(t=>{t.length=(0,Gj.findLenOfColumn)(t,e.rows,e.charLength)})},$j=e=>{Hj(e),qj(e),Yj(e),Vj(e)};hs.preProcessColumns=$j;var Wj=e=>{let t=e.rows.filter(n=>e.filterFunction(n.text)).sort((n,r)=>e.sortFunction(n.text,r.text));e.rows=t};hs.preProcessRows=Wj});var E1=E($t=>{"use strict";l();var Z9=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($t,"__esModule",{value:!0});$t.printSimpleTable=$t.renderSimpleTable=$t.renderTable=void 0;var J9=Z9(s1()),e2=_1(),sn=Ka(),Nr=Xa(),Kj=Z9(f1()),j9=X9(),zj=(e,t,n,r,i,s,a,o)=>{let c=new J9.default(a);return c.addCharsWithColor("",e.vertical),t.forEach(u=>{let m=n<r[u.name].length?(0,Nr.cellText)(r[u.name][n]):"";c.addCharsWithColor(sn.DEFAULT_ROW_FONT_COLOR," "),c.addCharsWithColor(i&&sn.DEFAULT_HEADER_FONT_COLOR||u.color||s.color,(0,e2.textWithPadding)(m,u.alignment||sn.DEFAULT_ROW_ALIGNMENT,u.length||sn.DEFAULT_COLUMN_LEN,o)),c.addCharsWithColor("",` ${e.vertical}`)}),c.renderConsole()},t2=(e,t,n,r,i,s)=>{let a=(0,Nr.getWidthLimitedColumnsArray)(t,n,s),o=Object.values(a).reduce((u,d)=>Math.max(u,d.length),0),c=[];for(let u=0;u<o;u+=1){let d=zj(e,t,u,a,i,n,r,s);c.push(d)}return c},Qj=(e,t)=>{let n=[];return n=n.concat(t2(e.tableStyle,e.columns,t,e.colorMap,void 0,e.charLength)),n},Xj=e=>{let t=[];if(e.title===void 0)return t;let n=()=>{let s=(a,o)=>a+o+2+1;return e.columns.map(a=>a.length||sn.DEFAULT_COLUMN_LEN).reduce(s,1)},r=(0,e2.textWithPadding)(e.title,sn.DEFAULT_HEADER_ALIGNMENT,n()),i=new J9.default(e.colorMap);return i.addCharsWithColor(sn.DEFAULT_HEADER_FONT_COLOR,r),t.push(i.renderConsole()),t},jj=e=>{let t=[];t.push((0,Nr.renderTableHorizontalBorders)(e.tableStyle.headerTop,e.columns.map(r=>r.length||sn.DEFAULT_COLUMN_LEN)));let n=(0,Nr.createHeaderAsRow)(Nr.createRow,e.columns);return t=t.concat(t2(e.tableStyle,e.columns,n,e.colorMap,!0)),t.push((0,Nr.renderTableHorizontalBorders)(e.tableStyle.headerBottom,e.columns.map(r=>r.length||sn.DEFAULT_COLUMN_LEN))),t},Zj=e=>{let t=[];return t.push((0,Nr.renderTableHorizontalBorders)(e.tableStyle.tableBottom,e.columns.map(n=>n.length||sn.DEFAULT_COLUMN_LEN))),t},Jj=(e,t)=>{let n=[],r=e.rows.length-1;return e.rows.indexOf(t)!==r&&t.separator&&n.push((0,Nr.renderTableHorizontalBorders)(e.tableStyle.rowSeparator,e.columns.map(s=>s.length||sn.DEFAULT_COLUMN_LEN))),n},eZ=e=>{(0,j9.preProcessColumns)(e),(0,j9.preProcessRows)(e);let t=[];return Xj(e).forEach(n=>t.push(n)),jj(e).forEach(n=>t.push(n)),e.rows.forEach(n=>{Qj(e,n).forEach(r=>t.push(r)),Jj(e,n).forEach(r=>t.push(r))}),Zj(e).forEach(n=>t.push(n)),t.join(`
|
|
74
|
-
`)};$t.renderTable=eZ;var tZ=e=>{let t=new Kj.default;return t.addRows(e),(0,$t.renderTable)(t)};$t.renderSimpleTable=tZ;var nZ=e=>{console.log((0,$t.renderSimpleTable)(e))};$t.printSimpleTable=nZ});var f1=E(h1=>{"use strict";l();Object.defineProperty(h1,"__esModule",{value:!0});var rZ=s1(),Du=Ka(),Cu=Xa(),iZ=a1(),sZ=E1(),aZ=()=>0,oZ=()=>!0,g1=class{initSimple(t){this.columns=t.map(n=>({name:n,title:n,alignment:Du.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var n;this.title=t?.title||this.title,this.tableStyle=t?.style||this.tableStyle,this.sortFunction=t?.sort||this.sortFunction,this.filterFunction=t?.filter||this.filterFunction,this.enabledColumns=t?.enabledColumns||this.enabledColumns,this.disabledColumns=t?.disabledColumns||this.disabledColumns,this.computedColumns=t?.computedColumns||this.computedColumns,this.columns=((n=t?.columns)===null||n===void 0?void 0:n.map(iZ.rawColumnToInternalColumn))||this.columns,this.rowSeparator=t?.rowSeparator||this.rowSeparator,this.charLength=t?.charLength||this.charLength,t?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=Du.DEFAULT_TABLE_STYLE,this.filterFunction=oZ,this.sortFunction=aZ,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=Du.DEFAULT_ROW_SEPARATOR,this.colorMap=rZ.DEFAULT_COLOR_MAP,this.charLength={},t instanceof Array?this.initSimple(t):typeof t=="object"&&this.initDetailed(t)}createColumnFromRow(t){let n=this.columns.map(r=>r.name);Object.keys(t).forEach(r=>{n.includes(r)||this.columns.push((0,Cu.createColumFromOnlyName)(r))})}addColumn(t){typeof t=="string"?this.columns.push((0,Cu.createColumFromOnlyName)(t)):this.columns.push((0,Cu.createColumFromComputedColumn)(t))}addColumns(t){t.forEach(n=>{this.addColumn(n)})}addRow(t,n){this.createColumnFromRow(t),this.rows.push((0,Cu.createRow)(n?.color||Du.DEFAULT_ROW_FONT_COLOR,t,n?.separator!==void 0?n?.separator:this.rowSeparator))}addRows(t,n){t.forEach(r=>{this.addRow(r,n)})}renderTable(){return(0,sZ.renderTable)(this)}};h1.default=g1});var r2=E(ja=>{"use strict";l();var lZ=ja&&ja.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ja,"__esModule",{value:!0});var cZ=lZ(f1()),n2=Xa(),S1=class{constructor(t){this.table=new cZ.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,n){return this.table.addRow(t,(0,n2.convertRawRowOptionsToStandard)(n)),this}addRows(t,n){return this.table.addRows(t,(0,n2.convertRawRowOptionsToStandard)(n)),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};ja.default=S1});var T1=E(Sn=>{"use strict";l();var uZ=Sn&&Sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.renderTable=Sn.printTable=Sn.Table=void 0;var dZ=uZ(r2());Sn.Table=dZ.default;var i2=E1();Object.defineProperty(Sn,"printTable",{enumerable:!0,get:function(){return i2.printSimpleTable}});Object.defineProperty(Sn,"renderTable",{enumerable:!0,get:function(){return i2.renderSimpleTable}})});var hZ={};Ou(hZ,{pkg:()=>cc});module.exports=kP(hZ);l();var C2=J(require("update-notifier"));var Nu={};Ou(Nu,{author:()=>qP,bin:()=>jP,bugs:()=>VP,default:()=>e5,dependencies:()=>ZP,description:()=>GP,devDependencies:()=>QP,engines:()=>JP,files:()=>XP,homepage:()=>HP,license:()=>YP,name:()=>UP,publishConfig:()=>WP,repository:()=>$P,scripts:()=>zP,sideEffects:()=>KP,version:()=>yu});var UP="@e2b/cli",yu="0.2.2",GP="CLI for managing e2b sandbox templates",HP="https://e2b.dev",YP="MIT",qP={name:"FoundryLabs, Inc.",email:"hello@e2b.dev",url:"https://e2b.dev"},VP="https://github.com/e2b-dev/e2b/issues",$P={type:"git",url:"https://github.com/e2b-dev/e2b",directory:"packages/cli"},WP={access:"public"},KP=!1,zP={prepublishOnly:"pnpm build",build:"tsc --noEmit --skipLibCheck && tsup --minify",dev:"tsup --watch",test:"pnpm build && cd testground/demo-basic && ../../dist/index.js template build","check-deps":"knip","update-deps":"ncu -u && pnpm i"},QP={"@types/inquirer":"^9.0.7","@types/node":"^18.18.6","@types/tar-fs":"^2.0.3","@types/update-notifier":"6.0.5",knip:"^2.33.4","npm-check-updates":"^16.14.6",tsup:"^7.2.0",typescript:"^5.2.2",vitest:"^0.34.6"},XP=["dist","LICENSE","README","package.json"],jP={e2b:"dist/index.js"},ZP={"@balena/dockerignore":"^1.0.2","@iarna/toml":"^2.2.5","@nodelib/fs.walk":"^2.0.0","async-listen":"^3.0.1",boxen:"^7.1.1",chalk:"^5.3.0","cli-highlight":"^2.1.11",commander:"^11.1.0","console-table-printer":"^2.11.2",e2b:"^0.11.20",ignore:"^5.2.4",inquirer:"^9.2.12",open:"^9.1.0","strip-ansi":"^7.1.0","tar-fs":"^3.0.4","update-notifier":"5.1.0",yup:"^1.3.2"},JP={node:">=18"},e5={name:UP,version:yu,description:GP,homepage:HP,license:YP,author:qP,bugs:VP,repository:$P,publishConfig:WP,sideEffects:KP,scripts:zP,devDependencies:QP,files:XP,bin:jP,dependencies:ZP,engines:JP};l();l();var W1=J($1(),1),{program:FZ,createCommand:kZ,createArgument:BZ,createOption:UZ,CommanderError:GZ,InvalidArgumentError:HZ,InvalidOptionArgumentError:YZ,Command:Ke,Argument:qZ,Option:ai,Help:VZ}=W1.default;l();l();l();var K1=(e=0)=>t=>`\x1B[${t+e}m`,z1=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Q1=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,we={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},WZ=Object.keys(we.modifier),h5=Object.keys(we.color),S5=Object.keys(we.bgColor),KZ=[...h5,...S5];function T5(){let e=new Map;for(let[t,n]of Object.entries(we)){for(let[r,i]of Object.entries(n))we[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[r]=we[r],e.set(i[0],i[1]);Object.defineProperty(we,t,{value:n,enumerable:!1})}return Object.defineProperty(we,"codes",{value:e,enumerable:!1}),we.color.close="\x1B[39m",we.bgColor.close="\x1B[49m",we.color.ansi=K1(),we.color.ansi256=z1(),we.color.ansi16m=Q1(),we.bgColor.ansi=K1(10),we.bgColor.ansi256=z1(10),we.bgColor.ansi16m=Q1(10),Object.defineProperties(we,{rgbToAnsi256:{value(t,n,r){return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>we.rgbToAnsi256(...we.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,i;if(t>=232)n=((t-232)*10+8)/255,r=n,i=n;else{t-=16;let o=t%36;n=Math.floor(t/36)/5,r=Math.floor(o/6)/5,i=o%6/5}let s=Math.max(n,r,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(n));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>we.ansi256ToAnsi(we.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>we.ansi256ToAnsi(we.hexToAnsi256(t)),enumerable:!1}}),we}var b5=T5(),Qt=b5;l();var io=J(require("process"),1),j1=J(require("os"),1),Yu=J(require("tty"),1);function Ft(e,t=globalThis.Deno?globalThis.Deno.args:io.default.argv){let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:Ue}=io.default,ro;Ft("no-color")||Ft("no-colors")||Ft("color=false")||Ft("color=never")?ro=0:(Ft("color")||Ft("colors")||Ft("color=true")||Ft("color=always"))&&(ro=1);function D5(){if("FORCE_COLOR"in Ue)return Ue.FORCE_COLOR==="true"?1:Ue.FORCE_COLOR==="false"?0:Ue.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ue.FORCE_COLOR,10),3)}function C5(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function R5(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=D5();r!==void 0&&(ro=r);let i=n?ro:r;if(i===0)return 0;if(n){if(Ft("color=16m")||Ft("color=full")||Ft("color=truecolor"))return 3;if(Ft("color=256"))return 2}if("TF_BUILD"in Ue&&"AGENT_NAME"in Ue)return 1;if(e&&!t&&i===void 0)return 0;let s=i||0;if(Ue.TERM==="dumb")return s;if(io.default.platform==="win32"){let a=j1.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Ue)return"GITHUB_ACTIONS"in Ue||"GITEA_ACTIONS"in Ue?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Ue)||Ue.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ue)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ue.TEAMCITY_VERSION)?1:0;if(Ue.COLORTERM==="truecolor"||Ue.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Ue){let a=Number.parseInt((Ue.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ue.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ue.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ue.TERM)||"COLORTERM"in Ue?1:s}function X1(e,t={}){let n=R5(e,{streamIsTTY:e&&e.isTTY,...t});return C5(n)}var A5={stdout:X1({isTTY:Yu.default.isatty(1)}),stderr:X1({isTTY:Yu.default.isatty(2)})},Z1=A5;l();function J1(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,s=0,a="";do a+=e.slice(s,r)+t+n,s=r+i,r=e.indexOf(t,s);while(r!==-1);return a+=e.slice(s),a}function ef(e,t,n,r){let i=0,s="";do{let a=e[r-1]==="\r";s+=e.slice(i,a?r-1:r)+t+(a?`\r
|
|
74
|
+
`)};$t.renderTable=eZ;var tZ=e=>{let t=new Kj.default;return t.addRows(e),(0,$t.renderTable)(t)};$t.renderSimpleTable=tZ;var nZ=e=>{console.log((0,$t.renderSimpleTable)(e))};$t.printSimpleTable=nZ});var f1=E(h1=>{"use strict";l();Object.defineProperty(h1,"__esModule",{value:!0});var rZ=s1(),Du=Ka(),Cu=Xa(),iZ=a1(),sZ=E1(),aZ=()=>0,oZ=()=>!0,g1=class{initSimple(t){this.columns=t.map(n=>({name:n,title:n,alignment:Du.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var n;this.title=t?.title||this.title,this.tableStyle=t?.style||this.tableStyle,this.sortFunction=t?.sort||this.sortFunction,this.filterFunction=t?.filter||this.filterFunction,this.enabledColumns=t?.enabledColumns||this.enabledColumns,this.disabledColumns=t?.disabledColumns||this.disabledColumns,this.computedColumns=t?.computedColumns||this.computedColumns,this.columns=((n=t?.columns)===null||n===void 0?void 0:n.map(iZ.rawColumnToInternalColumn))||this.columns,this.rowSeparator=t?.rowSeparator||this.rowSeparator,this.charLength=t?.charLength||this.charLength,t?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=Du.DEFAULT_TABLE_STYLE,this.filterFunction=oZ,this.sortFunction=aZ,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=Du.DEFAULT_ROW_SEPARATOR,this.colorMap=rZ.DEFAULT_COLOR_MAP,this.charLength={},t instanceof Array?this.initSimple(t):typeof t=="object"&&this.initDetailed(t)}createColumnFromRow(t){let n=this.columns.map(r=>r.name);Object.keys(t).forEach(r=>{n.includes(r)||this.columns.push((0,Cu.createColumFromOnlyName)(r))})}addColumn(t){typeof t=="string"?this.columns.push((0,Cu.createColumFromOnlyName)(t)):this.columns.push((0,Cu.createColumFromComputedColumn)(t))}addColumns(t){t.forEach(n=>{this.addColumn(n)})}addRow(t,n){this.createColumnFromRow(t),this.rows.push((0,Cu.createRow)(n?.color||Du.DEFAULT_ROW_FONT_COLOR,t,n?.separator!==void 0?n?.separator:this.rowSeparator))}addRows(t,n){t.forEach(r=>{this.addRow(r,n)})}renderTable(){return(0,sZ.renderTable)(this)}};h1.default=g1});var r2=E(ja=>{"use strict";l();var lZ=ja&&ja.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ja,"__esModule",{value:!0});var cZ=lZ(f1()),n2=Xa(),S1=class{constructor(t){this.table=new cZ.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,n){return this.table.addRow(t,(0,n2.convertRawRowOptionsToStandard)(n)),this}addRows(t,n){return this.table.addRows(t,(0,n2.convertRawRowOptionsToStandard)(n)),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};ja.default=S1});var T1=E(Sn=>{"use strict";l();var uZ=Sn&&Sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.renderTable=Sn.printTable=Sn.Table=void 0;var dZ=uZ(r2());Sn.Table=dZ.default;var i2=E1();Object.defineProperty(Sn,"printTable",{enumerable:!0,get:function(){return i2.printSimpleTable}});Object.defineProperty(Sn,"renderTable",{enumerable:!0,get:function(){return i2.renderSimpleTable}})});var hZ={};Ou(hZ,{pkg:()=>cc});module.exports=kP(hZ);l();var C2=J(require("update-notifier"));var Nu={};Ou(Nu,{author:()=>qP,bin:()=>jP,bugs:()=>VP,default:()=>e5,dependencies:()=>ZP,description:()=>GP,devDependencies:()=>QP,engines:()=>JP,files:()=>XP,homepage:()=>HP,license:()=>YP,name:()=>UP,publishConfig:()=>WP,repository:()=>$P,scripts:()=>zP,sideEffects:()=>KP,version:()=>yu});var UP="@e2b/cli",yu="0.2.3",GP="CLI for managing e2b sandbox templates",HP="https://e2b.dev",YP="MIT",qP={name:"FoundryLabs, Inc.",email:"hello@e2b.dev",url:"https://e2b.dev"},VP="https://github.com/e2b-dev/e2b/issues",$P={type:"git",url:"https://github.com/e2b-dev/e2b",directory:"packages/cli"},WP={access:"public"},KP=!1,zP={prepublishOnly:"pnpm build",build:"tsc --noEmit --skipLibCheck && tsup --minify",dev:"tsup --watch",test:"pnpm build && cd testground/demo-basic && ../../dist/index.js template build","check-deps":"knip","update-deps":"ncu -u && pnpm i"},QP={"@types/inquirer":"^9.0.7","@types/node":"^18.18.6","@types/tar-fs":"^2.0.3","@types/update-notifier":"6.0.5",knip:"^2.33.4","npm-check-updates":"^16.14.6",tsup:"^7.2.0",typescript:"^5.2.2",vitest:"^0.34.6"},XP=["dist","LICENSE","README","package.json"],jP={e2b:"dist/index.js"},ZP={"@balena/dockerignore":"^1.0.2","@iarna/toml":"^2.2.5","@nodelib/fs.walk":"^2.0.0","async-listen":"^3.0.1",boxen:"^7.1.1",chalk:"^5.3.0","cli-highlight":"^2.1.11",commander:"^11.1.0","console-table-printer":"^2.11.2",e2b:"^0.11.20",ignore:"^5.2.4",inquirer:"^9.2.12",open:"^9.1.0","strip-ansi":"^7.1.0","tar-fs":"^3.0.4","update-notifier":"5.1.0",yup:"^1.3.2"},JP={node:">=18"},e5={name:UP,version:yu,description:GP,homepage:HP,license:YP,author:qP,bugs:VP,repository:$P,publishConfig:WP,sideEffects:KP,scripts:zP,devDependencies:QP,files:XP,bin:jP,dependencies:ZP,engines:JP};l();l();var W1=J($1(),1),{program:FZ,createCommand:kZ,createArgument:BZ,createOption:UZ,CommanderError:GZ,InvalidArgumentError:HZ,InvalidOptionArgumentError:YZ,Command:Ke,Argument:qZ,Option:ai,Help:VZ}=W1.default;l();l();l();var K1=(e=0)=>t=>`\x1B[${t+e}m`,z1=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Q1=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,we={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},WZ=Object.keys(we.modifier),h5=Object.keys(we.color),S5=Object.keys(we.bgColor),KZ=[...h5,...S5];function T5(){let e=new Map;for(let[t,n]of Object.entries(we)){for(let[r,i]of Object.entries(n))we[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[r]=we[r],e.set(i[0],i[1]);Object.defineProperty(we,t,{value:n,enumerable:!1})}return Object.defineProperty(we,"codes",{value:e,enumerable:!1}),we.color.close="\x1B[39m",we.bgColor.close="\x1B[49m",we.color.ansi=K1(),we.color.ansi256=z1(),we.color.ansi16m=Q1(),we.bgColor.ansi=K1(10),we.bgColor.ansi256=z1(10),we.bgColor.ansi16m=Q1(10),Object.defineProperties(we,{rgbToAnsi256:{value(t,n,r){return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>we.rgbToAnsi256(...we.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,i;if(t>=232)n=((t-232)*10+8)/255,r=n,i=n;else{t-=16;let o=t%36;n=Math.floor(t/36)/5,r=Math.floor(o/6)/5,i=o%6/5}let s=Math.max(n,r,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(n));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>we.ansi256ToAnsi(we.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>we.ansi256ToAnsi(we.hexToAnsi256(t)),enumerable:!1}}),we}var b5=T5(),Qt=b5;l();var io=J(require("process"),1),j1=J(require("os"),1),Yu=J(require("tty"),1);function Ft(e,t=globalThis.Deno?globalThis.Deno.args:io.default.argv){let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:Ue}=io.default,ro;Ft("no-color")||Ft("no-colors")||Ft("color=false")||Ft("color=never")?ro=0:(Ft("color")||Ft("colors")||Ft("color=true")||Ft("color=always"))&&(ro=1);function D5(){if("FORCE_COLOR"in Ue)return Ue.FORCE_COLOR==="true"?1:Ue.FORCE_COLOR==="false"?0:Ue.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ue.FORCE_COLOR,10),3)}function C5(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function R5(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=D5();r!==void 0&&(ro=r);let i=n?ro:r;if(i===0)return 0;if(n){if(Ft("color=16m")||Ft("color=full")||Ft("color=truecolor"))return 3;if(Ft("color=256"))return 2}if("TF_BUILD"in Ue&&"AGENT_NAME"in Ue)return 1;if(e&&!t&&i===void 0)return 0;let s=i||0;if(Ue.TERM==="dumb")return s;if(io.default.platform==="win32"){let a=j1.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Ue)return"GITHUB_ACTIONS"in Ue||"GITEA_ACTIONS"in Ue?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Ue)||Ue.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ue)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ue.TEAMCITY_VERSION)?1:0;if(Ue.COLORTERM==="truecolor"||Ue.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Ue){let a=Number.parseInt((Ue.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ue.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ue.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ue.TERM)||"COLORTERM"in Ue?1:s}function X1(e,t={}){let n=R5(e,{streamIsTTY:e&&e.isTTY,...t});return C5(n)}var A5={stdout:X1({isTTY:Yu.default.isatty(1)}),stderr:X1({isTTY:Yu.default.isatty(2)})},Z1=A5;l();function J1(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,s=0,a="";do a+=e.slice(s,r)+t+n,s=r+i,r=e.indexOf(t,s);while(r!==-1);return a+=e.slice(s),a}function ef(e,t,n,r){let i=0,s="";do{let a=e[r-1]==="\r";s+=e.slice(i,a?r-1:r)+t+(a?`\r
|
|
75
75
|
`:`
|
|
76
76
|
`)+n,i=r+1,r=e.indexOf(`
|
|
77
77
|
`,i)}while(r!==-1);return s+=e.slice(i),s}var{stdout:tf,stderr:nf}=Z1,qu=Symbol("GENERATOR"),oi=Symbol("STYLER"),Ds=Symbol("IS_EMPTY"),rf=["ansi","ansi","ansi256","ansi16m"],li=Object.create(null),O5=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=tf?tf.level:0;e.level=t.level===void 0?n:t.level};var N5=e=>{let t=(...n)=>n.join(" ");return O5(t,e),Object.setPrototypeOf(t,Cs.prototype),t};function Cs(e){return N5(e)}Object.setPrototypeOf(Cs.prototype,Function.prototype);for(let[e,t]of Object.entries(Qt))li[e]={get(){let n=so(this,$u(t.open,t.close,this[oi]),this[Ds]);return Object.defineProperty(this,e,{value:n}),n}};li.visible={get(){let e=so(this,this[oi],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Vu=(e,t,n,...r)=>e==="rgb"?t==="ansi16m"?Qt[n].ansi16m(...r):t==="ansi256"?Qt[n].ansi256(Qt.rgbToAnsi256(...r)):Qt[n].ansi(Qt.rgbToAnsi(...r)):e==="hex"?Vu("rgb",t,n,...Qt.hexToRgb(...r)):Qt[n][e](...r),y5=["rgb","hex","ansi256"];for(let e of y5){li[e]={get(){let{level:n}=this;return function(...r){let i=$u(Vu(e,rf[n],"color",...r),Qt.color.close,this[oi]);return so(this,i,this[Ds])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);li[t]={get(){let{level:n}=this;return function(...r){let i=$u(Vu(e,rf[n],"bgColor",...r),Qt.bgColor.close,this[oi]);return so(this,i,this[Ds])}}}}var I5=Object.defineProperties(()=>{},{...li,level:{enumerable:!0,get(){return this[qu].level},set(e){this[qu].level=e}}}),$u=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},so=(e,t,n)=>{let r=(...i)=>v5(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,I5),r[qu]=e,r[oi]=t,r[Ds]=n,r},v5=(e,t)=>{if(e.level<=0||!t)return e[Ds]?"":t;let n=e[oi];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes("\x1B"))for(;n!==void 0;)t=J1(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
|
|
@@ -162,8 +162,8 @@ with sandbox URL ${Ne(`${n.getProtocol()}://${n.getHostname()}`)}`,`Disconnectin
|
|
|
162
162
|
`)}catch(t){console.error(t),process.exit(1)}});l();var h2=J(require("fs"));l();async function f2(e,t){return(await(await import("inquirer")).default.prompt([{name:"templates",message:Ze.underline(t),type:"checkbox",pageSize:50,choices:e.map(i=>({name:_t(i),value:i}))}])).templates}l();async function g2(e,t=!1){return(await(await import("inquirer")).default.prompt([{name:"confirm",type:"confirm",default:t,message:e}])).confirm}var pZ=Yr(vt.path("/templates/{templateID}").method("delete").create()),S2=new Ke("delete").description(`Delete sandbox template and ${st(ms)} config`).argument("[template]",`Specify ${Ne("[template]")} to delete it. If you don's specify ${Ne("[template]")} the command will try to delete sandbox template defined by ${st("e2b.toml")}.`).addOption(hr).addOption(EL).alias("dl").option("-y, --yes","Skip manual delete confirmation").action(async(e,t)=>{try{let n=Xi(),r=dr(t.path),i=[];if(e)i.push({template_id:e});else if(t.select){let s=await b1({accessToken:n}),a=await f2(s,"Select sandbox templates to delete");if(i.push(...a.map(o=>({template_id:o.templateID,...o}))),!i||i.length===0){console.log("No sandbox templates selected");return}}else{let s=Es(r),a=h2.existsSync(s)?await ps(s):void 0;if(!a){console.log(`No ${st(ms)} found in ${at(r)}. Specify sandbox template with ${Ne("[template]")} argument or use interactive mode with ${Ne("-s")} flag.`);return}i.push({...a,configPath:s})}if(!i||i.length===0){console.log(`No sandbox templates selected. Specify sandbox template with ${Ne("[template]")} argument or use interactive mode with ${Ne("-s")} flag.`);return}if(console.log(Ze.red(Ze.underline(`
|
|
163
163
|
Sandbox templates to delete`))),i.forEach(s=>console.log(_t({...s,templateID:s.template_id},s.configPath))),process.stdout.write(`
|
|
164
164
|
`),!t.yes&&!await g2(`Do you really want to delete ${i.length===1?"this template":"these templates"}?`)){console.log("Canceled");return}await Promise.all(i.map(async s=>{console.log(`- Deleting sandbox template ${_t({...s,templateID:s.template_id},s.configPath)}`),await pZ(n,{templateID:s.template_id}),s.configPath&&await B9(s.configPath)})),process.stdout.write(`
|
|
165
|
-
`)}catch(n){console.error(wl(n.message)),process.exit(1)}});l();var T2=J(T1());var EZ=qr(vt.path("/sandboxes").method("get").create()),b2=new Ke("sandboxes").description("List all running sandboxes").alias("
|
|
166
|
-
`)):console.log("No running sandboxes.")}catch(e){console.error(e),process.exit(1)}});async function fZ({apiKey:e}){return(await EZ(e,{})).data}l();var D2=new Ke("connect").description("Connect terminal to already running sandbox").argument("
|
|
165
|
+
`)}catch(n){console.error(wl(n.message)),process.exit(1)}});l();var T2=J(T1());var EZ=qr(vt.path("/sandboxes").method("get").create()),b2=new Ke("sandboxes").description("List all running sandboxes").alias("sb").action(async()=>{try{let e=Qi(),t=await fZ({apiKey:e});t?.length?(new T2.Table({title:"Running sandboxes",columns:[{name:"sandboxID",alignment:"left",title:"Sandbox ID"},{name:"templateID",alignment:"left",title:"Template ID"},{name:"alias",alignment:"left",title:"Alias"},{name:"startedAt",alignment:"left",title:"Started at"},{name:"metadata",alignment:"left",title:"Metadata"}],disabledColumns:["clientID"],rows:t.map(r=>({...r,sandboxID:`${r.sandboxID}-${r.clientID}`,startedAt:new Date(r.startedAt).toLocaleString(),metadata:JSON.stringify(r.metadata)})),colorMap:{orange:"\x1B[38;5;216m"}}).printTable(),process.stdout.write(`
|
|
166
|
+
`)):console.log("No running sandboxes.")}catch(e){console.error(e),process.exit(1)}});async function fZ({apiKey:e}){return(await EZ(e,{})).data}l();var D2=new Ke("connect").description("Connect terminal to already running sandbox").argument("<sandboxID>",`Connect to sandbox with ${Ne("<sandboxID>")}`).alias("cn").action(async e=>{try{let t=Qi();e||(console.error("You need to specify sandbox ID"),process.exit(1)),await gZ({apiKey:t,sandboxID:e}),process.exit(0)}catch(t){console.error(t),process.exit(1)}});async function gZ({apiKey:e,sandboxID:t}){let n=await Qr.reconnect({sandboxID:t,apiKey:e});if(n.terminal){let{exited:r}=await Ru(n.terminal,`Terminal connected to sandbox ${Ot(t)}
|
|
167
167
|
with sandbox URL ${Ne(`${n.getProtocol()}://${n.getHostname()}`)}`,`Disconnecting terminal from sandbox ${Ot(t)}`);await r,console.log(`Closing terminal connection to sandbox ${Ot(t)}`)}else throw new Error("Cannot start terminal - no sandbox")}var C1=new Ke().description(`Create sandbox templates from Dockerfiles by running ${Ot("e2b build")} then use our SDKs to create sandboxes from these templates.
|
|
168
168
|
|
|
169
169
|
Visit ${Ot("E2B docs (https://e2b.dev/docs)")} to learn how to create sandbox templates and start sandboxes.
|