@boxlite-ai/boxlite 0.1.3 → 0.1.5
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/README.md +2 -2
- package/dist/browserbox.d.ts +1 -1
- package/dist/browserbox.d.ts.map +1 -1
- package/dist/browserbox.js +5 -42
- package/dist/browserbox.js.map +1 -1
- package/dist/codebox.d.ts +1 -1
- package/dist/codebox.d.ts.map +1 -1
- package/dist/codebox.js +7 -44
- package/dist/codebox.js.map +1 -1
- package/dist/computerbox.d.ts +1 -1
- package/dist/computerbox.d.ts.map +1 -1
- package/dist/computerbox.js +8 -45
- package/dist/computerbox.js.map +1 -1
- package/dist/constants.js +18 -21
- package/dist/constants.js.map +1 -1
- package/dist/errors.js +4 -11
- package/dist/errors.js.map +1 -1
- package/dist/exec.js +1 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -37
- package/dist/index.js.map +1 -1
- package/dist/interactivebox.d.ts +3 -11
- package/dist/interactivebox.d.ts.map +1 -1
- package/dist/interactivebox.js +35 -50
- package/dist/interactivebox.js.map +1 -1
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +8 -9
- package/dist/native.js.map +1 -1
- package/dist/simplebox.d.ts +1 -1
- package/dist/simplebox.d.ts.map +1 -1
- package/dist/simplebox.js +3 -7
- package/dist/simplebox.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ npm install boxlite
|
|
|
40
40
|
### JavaScript
|
|
41
41
|
|
|
42
42
|
```javascript
|
|
43
|
-
|
|
43
|
+
import { SimpleBox } from '@boxlite-ai/boxlite';
|
|
44
44
|
|
|
45
45
|
async function main() {
|
|
46
46
|
const box = new SimpleBox({ image: 'alpine:latest' });
|
|
@@ -186,7 +186,7 @@ try {
|
|
|
186
186
|
console.log(endpoint); // http://localhost:9222
|
|
187
187
|
|
|
188
188
|
// Connect with Puppeteer
|
|
189
|
-
|
|
189
|
+
import puppeteer from 'puppeteer-core';
|
|
190
190
|
const browserInstance = await puppeteer.connect({ browserURL: endpoint });
|
|
191
191
|
|
|
192
192
|
const page = await browserInstance.newPage();
|
package/dist/browserbox.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides a minimal, elegant API for running isolated browsers that can be
|
|
5
5
|
* controlled from outside using standard tools like Puppeteer or Playwright.
|
|
6
6
|
*/
|
|
7
|
-
import { SimpleBox, type SimpleBoxOptions } from './simplebox';
|
|
7
|
+
import { SimpleBox, type SimpleBoxOptions } from './simplebox.js';
|
|
8
8
|
/**
|
|
9
9
|
* Browser type supported by BrowserBox.
|
|
10
10
|
*/
|
package/dist/browserbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserbox.d.ts","sourceRoot":"","sources":["../lib/browserbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"browserbox.d.ts","sourceRoot":"","sources":["../lib/browserbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIlE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;IAC/F,yCAAyC;IACzC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAgD;IAErF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAI3B;IAEF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IACvC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAE/B;;;;;;;;;;;;;OAaG;gBACS,OAAO,GAAE,iBAAsB;IAmB3C;;;;;;;;;;;;;;;;;;;OAmBG;IACG,KAAK,CAAC,OAAO,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkChD;;;;;;OAMG;YACW,cAAc;IAuB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;OAIG;IACG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7C"}
|
package/dist/browserbox.js
CHANGED
|
@@ -1,48 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BrowserBox - Secure browser with remote debugging.
|
|
4
3
|
*
|
|
5
4
|
* Provides a minimal, elegant API for running isolated browsers that can be
|
|
6
5
|
* controlled from outside using standard tools like Puppeteer or Playwright.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.BrowserBox = void 0;
|
|
43
|
-
const simplebox_1 = require("./simplebox");
|
|
44
|
-
const errors_1 = require("./errors");
|
|
45
|
-
const constants = __importStar(require("./constants"));
|
|
7
|
+
import { SimpleBox } from './simplebox.js';
|
|
8
|
+
import { TimeoutError } from './errors.js';
|
|
9
|
+
import * as constants from './constants.js';
|
|
46
10
|
/**
|
|
47
11
|
* Secure browser environment with remote debugging.
|
|
48
12
|
*
|
|
@@ -80,7 +44,7 @@ const constants = __importStar(require("./constants"));
|
|
|
80
44
|
* }
|
|
81
45
|
* ```
|
|
82
46
|
*/
|
|
83
|
-
class BrowserBox extends
|
|
47
|
+
export class BrowserBox extends SimpleBox {
|
|
84
48
|
/**
|
|
85
49
|
* Create a new BrowserBox.
|
|
86
50
|
*
|
|
@@ -171,7 +135,7 @@ class BrowserBox extends simplebox_1.SimpleBox {
|
|
|
171
135
|
while (true) {
|
|
172
136
|
const elapsed = (Date.now() - startTime) / 1000;
|
|
173
137
|
if (elapsed > timeout) {
|
|
174
|
-
throw new
|
|
138
|
+
throw new TimeoutError(`Browser '${this._browser}' did not start within ${timeout} seconds`);
|
|
175
139
|
}
|
|
176
140
|
// Check if browser process is running
|
|
177
141
|
const result = await this.exec('pgrep', '-f', processPattern);
|
|
@@ -224,7 +188,6 @@ class BrowserBox extends simplebox_1.SimpleBox {
|
|
|
224
188
|
await super[Symbol.asyncDispose]();
|
|
225
189
|
}
|
|
226
190
|
}
|
|
227
|
-
exports.BrowserBox = BrowserBox;
|
|
228
191
|
BrowserBox.DEFAULT_IMAGE = 'mcr.microsoft.com/playwright:v1.47.2-jammy';
|
|
229
192
|
BrowserBox.PORTS = {
|
|
230
193
|
chromium: constants.BROWSERBOX_PORT_CHROMIUM,
|
package/dist/browserbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserbox.js","sourceRoot":"","sources":["../lib/browserbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browserbox.js","sourceRoot":"","sources":["../lib/browserbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAqB5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,OAAO,UAAW,SAAQ,SAAS;IAYvC;;;;;;;;;;;;;OAaG;IACH,YAAY,UAA6B,EAAE;QACzC,MAAM,EACJ,OAAO,GAAG,UAAU,EACpB,SAAS,GAAG,IAAI,EAChB,IAAI,GAAG,CAAC,EACR,GAAG,WAAW,EACf,GAAG,OAAO,CAAC;QAEZ,KAAK,CAAC;YACJ,GAAG,WAAW;YACd,KAAK,EAAE,UAAU,CAAC,aAAa;YAC/B,SAAS;YACT,IAAI;SACL,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,KAA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+1 @@
|
|
|
1
|
-
{"version":3,"file":"codebox.d.ts","sourceRoot":"","sources":["../lib/codebox.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"codebox.d.ts","sourceRoot":"","sources":["../lib/codebox.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACrE,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,OAAQ,SAAQ,SAAS;IACpC;;;;;;;;;;;;;OAaG;gBACS,OAAO,GAAE,cAAmB;IAOxC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQxC;;;;;;;;;;;;;;;;;OAiBG;IACG,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMpD;;;;;;;;;;;;;;;;;;;OAmBG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ1D;;;;;;;;;;;;;;;;;;OAkBG;IACG,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;CAO9D"}
|
package/dist/codebox.js
CHANGED
|
@@ -1,46 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* CodeBox - Secure Python code execution container.
|
|
4
3
|
*
|
|
5
4
|
* Provides a simple, secure environment for running untrusted Python code.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(o, k2, desc);
|
|
14
|
-
}) : (function(o, m, k, k2) {
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
o[k2] = m[k];
|
|
17
|
-
}));
|
|
18
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
-
}) : function(o, v) {
|
|
21
|
-
o["default"] = v;
|
|
22
|
-
});
|
|
23
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
-
var ownKeys = function(o) {
|
|
25
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
-
var ar = [];
|
|
27
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
-
return ar;
|
|
29
|
-
};
|
|
30
|
-
return ownKeys(o);
|
|
31
|
-
};
|
|
32
|
-
return function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.CodeBox = void 0;
|
|
42
|
-
const simplebox_1 = require("./simplebox");
|
|
43
|
-
const errors_1 = require("./errors");
|
|
6
|
+
import { SimpleBox } from './simplebox.js';
|
|
7
|
+
import { ExecError } from './errors.js';
|
|
44
8
|
/**
|
|
45
9
|
* Secure container for executing Python code.
|
|
46
10
|
*
|
|
@@ -67,7 +31,7 @@ const errors_1 = require("./errors");
|
|
|
67
31
|
* // Automatically stopped when leaving scope
|
|
68
32
|
* ```
|
|
69
33
|
*/
|
|
70
|
-
class CodeBox extends
|
|
34
|
+
export class CodeBox extends SimpleBox {
|
|
71
35
|
/**
|
|
72
36
|
* Create a new CodeBox.
|
|
73
37
|
*
|
|
@@ -117,7 +81,7 @@ class CodeBox extends simplebox_1.SimpleBox {
|
|
|
117
81
|
async run(code) {
|
|
118
82
|
const result = await this.exec('/usr/local/bin/python', '-c', code);
|
|
119
83
|
if (result.exitCode !== 0) {
|
|
120
|
-
throw new
|
|
84
|
+
throw new ExecError('run()', result.exitCode, result.stderr);
|
|
121
85
|
}
|
|
122
86
|
return result.stdout;
|
|
123
87
|
}
|
|
@@ -140,7 +104,7 @@ class CodeBox extends simplebox_1.SimpleBox {
|
|
|
140
104
|
* ```
|
|
141
105
|
*/
|
|
142
106
|
async runScript(scriptPath) {
|
|
143
|
-
const fs = await
|
|
107
|
+
const fs = await import('fs/promises');
|
|
144
108
|
const code = await fs.readFile(scriptPath, 'utf-8');
|
|
145
109
|
return this.run(code);
|
|
146
110
|
}
|
|
@@ -167,7 +131,7 @@ class CodeBox extends simplebox_1.SimpleBox {
|
|
|
167
131
|
async installPackage(packageName) {
|
|
168
132
|
const result = await this.exec('pip', 'install', packageName);
|
|
169
133
|
if (result.exitCode !== 0) {
|
|
170
|
-
throw new
|
|
134
|
+
throw new ExecError(`installPackage('${packageName}')`, result.exitCode, result.stderr);
|
|
171
135
|
}
|
|
172
136
|
return result.stdout;
|
|
173
137
|
}
|
|
@@ -193,10 +157,9 @@ class CodeBox extends simplebox_1.SimpleBox {
|
|
|
193
157
|
async installPackages(...packages) {
|
|
194
158
|
const result = await this.exec('pip', 'install', ...packages);
|
|
195
159
|
if (result.exitCode !== 0) {
|
|
196
|
-
throw new
|
|
160
|
+
throw new ExecError(`installPackages(${packages.join(', ')})`, result.exitCode, result.stderr);
|
|
197
161
|
}
|
|
198
162
|
return result.stdout;
|
|
199
163
|
}
|
|
200
164
|
}
|
|
201
|
-
exports.CodeBox = CodeBox;
|
|
202
165
|
//# sourceMappingURL=codebox.js.map
|
package/dist/codebox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codebox.js","sourceRoot":"","sources":["../lib/codebox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codebox.js","sourceRoot":"","sources":["../lib/codebox.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC;;;;;;;;;;;;;OAaG;IACH,YAAY,UAA0B,EAAE;QACtC,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,aAAa;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,GAAG,CAAC,IAAY;QACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACpE,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,SAAS,CAAC,UAAkB;QAChC,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CAAC,cAAc,CAAC,WAAmB;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAC9D,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,SAAS,CAAC,mBAAmB,WAAW,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC1F,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,eAAe,CAAC,GAAG,QAAkB;QACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAC;QAC9D,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,SAAS,CAAC,mBAAmB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACjG,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;CACF"}
|
package/dist/computerbox.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides a minimal, elegant API for running isolated desktop environments
|
|
5
5
|
* that can be viewed from a browser, with full GUI automation support.
|
|
6
6
|
*/
|
|
7
|
-
import { SimpleBox, type SimpleBoxOptions } from './simplebox';
|
|
7
|
+
import { SimpleBox, type SimpleBoxOptions } from './simplebox.js';
|
|
8
8
|
/**
|
|
9
9
|
* Options for creating a ComputerBox.
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computerbox.d.ts","sourceRoot":"","sources":["../lib/computerbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"computerbox.d.ts","sourceRoot":"","sources":["../lib/computerbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIlE;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;IAChG,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IAEd,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IAEf,kCAAkC;IAClC,MAAM,EAAE,KAAK,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,WAAY,SAAQ,SAAS;IACxC;;;;;;;;;;;;;;OAcG;gBACS,OAAO,GAAE,kBAAuB;IAqC5C;;;;;;;;OAQG;YACW,WAAW;IAQzB;;;;;;;;;;;;;;;;;OAiBG;IACG,cAAc,CAAC,OAAO,GAAE,MAAwC,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BtF;;;;;;;;;;;;;;;;;OAiBG;IACG,UAAU,IAAI,OAAO,CA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";
|
|
2
1
|
/**
|
|
3
2
|
* ComputerBox - Desktop environment with web access.
|
|
4
3
|
*
|
|
5
4
|
* Provides a minimal, elegant API for running isolated desktop environments
|
|
6
5
|
* that can be viewed from a browser, with full GUI automation support.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.ComputerBox = void 0;
|
|
43
|
-
const simplebox_1 = require("./simplebox");
|
|
44
|
-
const errors_1 = require("./errors");
|
|
45
|
-
const constants = __importStar(require("./constants"));
|
|
7
|
+
import { SimpleBox } from './simplebox.js';
|
|
8
|
+
import { ExecError, TimeoutError, ParseError } from './errors.js';
|
|
9
|
+
import * as constants from './constants.js';
|
|
46
10
|
/**
|
|
47
11
|
* Desktop environment accessible via web browser.
|
|
48
12
|
*
|
|
@@ -81,7 +45,7 @@ const constants = __importStar(require("./constants"));
|
|
|
81
45
|
* }
|
|
82
46
|
* ```
|
|
83
47
|
*/
|
|
84
|
-
class ComputerBox extends
|
|
48
|
+
export class ComputerBox extends SimpleBox {
|
|
85
49
|
/**
|
|
86
50
|
* Create and auto-start a desktop environment.
|
|
87
51
|
*
|
|
@@ -134,7 +98,7 @@ class ComputerBox extends simplebox_1.SimpleBox {
|
|
|
134
98
|
async execOrThrow(label, cmd, ...args) {
|
|
135
99
|
const result = await this.exec(cmd, ...args);
|
|
136
100
|
if (result.exitCode !== 0) {
|
|
137
|
-
throw new
|
|
101
|
+
throw new ExecError(label, result.exitCode, result.stderr);
|
|
138
102
|
}
|
|
139
103
|
return result;
|
|
140
104
|
}
|
|
@@ -161,7 +125,7 @@ class ComputerBox extends simplebox_1.SimpleBox {
|
|
|
161
125
|
while (true) {
|
|
162
126
|
const elapsed = (Date.now() - startTime) / 1000;
|
|
163
127
|
if (elapsed > timeout) {
|
|
164
|
-
throw new
|
|
128
|
+
throw new TimeoutError(`Desktop did not become ready within ${timeout} seconds`);
|
|
165
129
|
}
|
|
166
130
|
try {
|
|
167
131
|
const result = await this.exec('xwininfo', '-tree', '-root');
|
|
@@ -326,7 +290,7 @@ print(base64.b64encode(buffer.getvalue()).decode("utf-8"))
|
|
|
326
290
|
if (x !== undefined && y !== undefined) {
|
|
327
291
|
return [x, y];
|
|
328
292
|
}
|
|
329
|
-
throw new
|
|
293
|
+
throw new ParseError('Failed to parse cursor position from xdotool output');
|
|
330
294
|
}
|
|
331
295
|
/**
|
|
332
296
|
* Type text using the keyboard.
|
|
@@ -399,8 +363,7 @@ print(base64.b64encode(buffer.getvalue()).decode("utf-8"))
|
|
|
399
363
|
if (parts.length === 2) {
|
|
400
364
|
return [parseInt(parts[0], 10), parseInt(parts[1], 10)];
|
|
401
365
|
}
|
|
402
|
-
throw new
|
|
366
|
+
throw new ParseError('Failed to parse screen size from xdotool output');
|
|
403
367
|
}
|
|
404
368
|
}
|
|
405
|
-
exports.ComputerBox = ComputerBox;
|
|
406
369
|
//# sourceMappingURL=computerbox.js.map
|
package/dist/computerbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computerbox.js","sourceRoot":"","sources":["../lib/computerbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computerbox.js","sourceRoot":"","sources":["../lib/computerbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAoC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,OAAO,WAAY,SAAQ,SAAS;IACxC;;;;;;;;;;;;;;OAcG;IACH,YAAY,UAA8B,EAAE;QAC1C,MAAM,EACJ,IAAI,GAAG,SAAS,CAAC,gBAAgB,EACjC,SAAS,GAAG,SAAS,CAAC,sBAAsB,EAC5C,WAAW,GAAG,SAAS,CAAC,yBAAyB,EACjD,YAAY,GAAG,SAAS,CAAC,0BAA0B,EACnD,GAAG,GAAG,EAAE,EACR,KAAK,GAAG,EAAE,EACV,GAAG,WAAW,EACf,GAAG,OAAO,CAAC;QAEZ,+CAA+C;QAC/C,MAAM,UAAU,GAA2B;YACzC,OAAO,EAAE,SAAS,CAAC,0BAA0B;YAC7C,aAAa,EAAE,SAAS,CAAC,yBAAyB,CAAC,QAAQ,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I,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC1D,CAAC;QAED,MAAM,IAAI,UAAU,CAAC,iDAAiD,CAAC,CAAC;IAC1E,CAAC;CACF"}
|
package/dist/constants.js
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Default configuration constants for BoxLite specialized boxes.
|
|
4
3
|
*
|
|
5
4
|
* These values match the Python SDK for consistency across language bindings.
|
|
6
5
|
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.DEFAULT_MEMORY_MIB = exports.DEFAULT_CPUS = exports.BROWSERBOX_PORT_WEBKIT = exports.BROWSERBOX_PORT_FIREFOX = exports.BROWSERBOX_PORT_CHROMIUM = exports.BROWSERBOX_IMAGE_WEBKIT = exports.BROWSERBOX_IMAGE_FIREFOX = exports.BROWSERBOX_IMAGE_CHROMIUM = exports.DESKTOP_READY_RETRY_DELAY = exports.DESKTOP_READY_TIMEOUT = exports.COMPUTERBOX_GUI_HTTPS_PORT = exports.COMPUTERBOX_GUI_HTTP_PORT = exports.COMPUTERBOX_DISPLAY_HEIGHT = exports.COMPUTERBOX_DISPLAY_WIDTH = exports.COMPUTERBOX_DISPLAY_NUMBER = exports.COMPUTERBOX_MEMORY_MIB = exports.COMPUTERBOX_CPUS = exports.COMPUTERBOX_IMAGE = void 0;
|
|
9
6
|
// ComputerBox (Desktop Automation) defaults
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
export const COMPUTERBOX_IMAGE = 'ghcr.io/boxlite-labs/computerbox:latest';
|
|
8
|
+
export const COMPUTERBOX_CPUS = 2;
|
|
9
|
+
export const COMPUTERBOX_MEMORY_MIB = 2048;
|
|
10
|
+
export const COMPUTERBOX_DISPLAY_NUMBER = ':1';
|
|
11
|
+
export const COMPUTERBOX_DISPLAY_WIDTH = 1024;
|
|
12
|
+
export const COMPUTERBOX_DISPLAY_HEIGHT = 768;
|
|
13
|
+
export const COMPUTERBOX_GUI_HTTP_PORT = 3000;
|
|
14
|
+
export const COMPUTERBOX_GUI_HTTPS_PORT = 3001;
|
|
18
15
|
// Desktop readiness detection
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export const DESKTOP_READY_TIMEOUT = 60; // seconds
|
|
17
|
+
export const DESKTOP_READY_RETRY_DELAY = 2; // seconds
|
|
21
18
|
// BrowserBox defaults
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
export const BROWSERBOX_IMAGE_CHROMIUM = 'browserless/chrome:latest';
|
|
20
|
+
export const BROWSERBOX_IMAGE_FIREFOX = 'browserless/firefox:latest';
|
|
21
|
+
export const BROWSERBOX_IMAGE_WEBKIT = 'browserless/webkit:latest';
|
|
25
22
|
// Browser CDP ports
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
export const BROWSERBOX_PORT_CHROMIUM = 9222;
|
|
24
|
+
export const BROWSERBOX_PORT_FIREFOX = 9223;
|
|
25
|
+
export const BROWSERBOX_PORT_WEBKIT = 9224;
|
|
29
26
|
// Default resource limits
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
export const DEFAULT_CPUS = 1;
|
|
28
|
+
export const DEFAULT_MEMORY_MIB = 512;
|
|
32
29
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../lib/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../lib/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4CAA4C;AAC5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,yCAAyC,CAAC;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAC9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAE/C,8BAA8B;AAC9B,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC,CAAC,UAAU;AACnD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,CAAC,UAAU;AAEtD,sBAAsB;AACtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,4BAA4B,CAAC;AACrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;AAEnE,oBAAoB;AACpB,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAC7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAC5C,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,0BAA0B;AAC1B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ParseError = exports.TimeoutError = exports.ExecError = exports.BoxliteError = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Base error class for all BoxLite-related errors.
|
|
6
3
|
*
|
|
@@ -15,7 +12,7 @@ exports.ParseError = exports.TimeoutError = exports.ExecError = exports.BoxliteE
|
|
|
15
12
|
* }
|
|
16
13
|
* ```
|
|
17
14
|
*/
|
|
18
|
-
class BoxliteError extends Error {
|
|
15
|
+
export class BoxliteError extends Error {
|
|
19
16
|
constructor(message) {
|
|
20
17
|
super(message);
|
|
21
18
|
this.name = 'BoxliteError';
|
|
@@ -25,7 +22,6 @@ class BoxliteError extends Error {
|
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
exports.BoxliteError = BoxliteError;
|
|
29
25
|
/**
|
|
30
26
|
* Execution error thrown when a command fails (non-zero exit code).
|
|
31
27
|
*
|
|
@@ -43,7 +39,7 @@ exports.BoxliteError = BoxliteError;
|
|
|
43
39
|
* }
|
|
44
40
|
* ```
|
|
45
41
|
*/
|
|
46
|
-
class ExecError extends BoxliteError {
|
|
42
|
+
export class ExecError extends BoxliteError {
|
|
47
43
|
/**
|
|
48
44
|
* @param command - The command that failed
|
|
49
45
|
* @param exitCode - The non-zero exit code
|
|
@@ -60,7 +56,6 @@ class ExecError extends BoxliteError {
|
|
|
60
56
|
}
|
|
61
57
|
}
|
|
62
58
|
}
|
|
63
|
-
exports.ExecError = ExecError;
|
|
64
59
|
/**
|
|
65
60
|
* Timeout error thrown when an operation exceeds its time limit.
|
|
66
61
|
*
|
|
@@ -75,7 +70,7 @@ exports.ExecError = ExecError;
|
|
|
75
70
|
* }
|
|
76
71
|
* ```
|
|
77
72
|
*/
|
|
78
|
-
class TimeoutError extends BoxliteError {
|
|
73
|
+
export class TimeoutError extends BoxliteError {
|
|
79
74
|
constructor(message) {
|
|
80
75
|
super(message);
|
|
81
76
|
this.name = 'TimeoutError';
|
|
@@ -84,7 +79,6 @@ class TimeoutError extends BoxliteError {
|
|
|
84
79
|
}
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
|
-
exports.TimeoutError = TimeoutError;
|
|
88
82
|
/**
|
|
89
83
|
* Parse error thrown when unable to parse command output.
|
|
90
84
|
*
|
|
@@ -101,7 +95,7 @@ exports.TimeoutError = TimeoutError;
|
|
|
101
95
|
* }
|
|
102
96
|
* ```
|
|
103
97
|
*/
|
|
104
|
-
class ParseError extends BoxliteError {
|
|
98
|
+
export class ParseError extends BoxliteError {
|
|
105
99
|
constructor(message) {
|
|
106
100
|
super(message);
|
|
107
101
|
this.name = 'ParseError';
|
|
@@ -110,5 +104,4 @@ class ParseError extends BoxliteError {
|
|
|
110
104
|
}
|
|
111
105
|
}
|
|
112
106
|
}
|
|
113
|
-
exports.ParseError = ParseError;
|
|
114
107
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../lib/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../lib/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,uEAAuE;QACvE,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;CACF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,SAAU,SAAQ,YAAY;IACzC;;;;OAIG;IACH,YACkB,OAAe,EACf,QAAgB,EAChB,MAAc;QAE9B,KAAK,CAAC,YAAY,OAAO,2BAA2B,QAAQ,KAAK,MAAM,EAAE,CAAC,CAAC;QAJ3D,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAQ;QAG9B,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CACF;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;CACF;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAC1C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;CACF"}
|
package/dist/exec.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
|
-
import { getNativeModule, getJsBoxlite } from './native';
|
|
21
|
+
import { getNativeModule, getJsBoxlite } from './native.js';
|
|
22
22
|
export declare const JsBoxlite: any;
|
|
23
23
|
export { getNativeModule, getJsBoxlite };
|
|
24
|
-
export { SimpleBox, type SimpleBoxOptions } from './simplebox';
|
|
25
|
-
export { type ExecResult } from './exec';
|
|
26
|
-
export { BoxliteError, ExecError, TimeoutError, ParseError } from './errors';
|
|
27
|
-
export * from './constants';
|
|
28
|
-
export { CodeBox, type CodeBoxOptions } from './codebox';
|
|
29
|
-
export { BrowserBox, type BrowserBoxOptions, type BrowserType } from './browserbox';
|
|
30
|
-
export { ComputerBox, type ComputerBoxOptions, type Screenshot } from './computerbox';
|
|
31
|
-
export { InteractiveBox, type InteractiveBoxOptions } from './interactivebox';
|
|
24
|
+
export { SimpleBox, type SimpleBoxOptions } from './simplebox.js';
|
|
25
|
+
export { type ExecResult } from './exec.js';
|
|
26
|
+
export { BoxliteError, ExecError, TimeoutError, ParseError } from './errors.js';
|
|
27
|
+
export * from './constants.js';
|
|
28
|
+
export { CodeBox, type CodeBoxOptions } from './codebox.js';
|
|
29
|
+
export { BrowserBox, type BrowserBoxOptions, type BrowserType } from './browserbox.js';
|
|
30
|
+
export { ComputerBox, type ComputerBoxOptions, type Screenshot } from './computerbox.js';
|
|
31
|
+
export { InteractiveBox, type InteractiveBoxOptions } from './interactivebox.js';
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG5D,eAAO,MAAM,SAAS,KAAiB,CAAC;AAGxC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChF,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BoxLite Node.js SDK
|
|
4
3
|
*
|
|
@@ -19,43 +18,18 @@
|
|
|
19
18
|
*
|
|
20
19
|
* @packageDocumentation
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
|
-
if (k2 === undefined) k2 = k;
|
|
24
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
-
}
|
|
28
|
-
Object.defineProperty(o, k2, desc);
|
|
29
|
-
}) : (function(o, m, k, k2) {
|
|
30
|
-
if (k2 === undefined) k2 = k;
|
|
31
|
-
o[k2] = m[k];
|
|
32
|
-
}));
|
|
33
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
34
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
35
|
-
};
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.InteractiveBox = exports.ComputerBox = exports.BrowserBox = exports.CodeBox = exports.ParseError = exports.TimeoutError = exports.ExecError = exports.BoxliteError = exports.SimpleBox = exports.getJsBoxlite = exports.getNativeModule = exports.JsBoxlite = void 0;
|
|
38
|
-
const native_1 = require("./native");
|
|
39
|
-
Object.defineProperty(exports, "getNativeModule", { enumerable: true, get: function () { return native_1.getNativeModule; } });
|
|
40
|
-
Object.defineProperty(exports, "getJsBoxlite", { enumerable: true, get: function () { return native_1.getJsBoxlite; } });
|
|
21
|
+
import { getNativeModule, getJsBoxlite } from './native.js';
|
|
41
22
|
// Re-export native bindings
|
|
42
|
-
|
|
23
|
+
export const JsBoxlite = getJsBoxlite();
|
|
24
|
+
// Export native module loader for advanced use cases
|
|
25
|
+
export { getNativeModule, getJsBoxlite };
|
|
43
26
|
// Re-export TypeScript wrappers
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Object.defineProperty(exports, "BoxliteError", { enumerable: true, get: function () { return errors_1.BoxliteError; } });
|
|
48
|
-
Object.defineProperty(exports, "ExecError", { enumerable: true, get: function () { return errors_1.ExecError; } });
|
|
49
|
-
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return errors_1.TimeoutError; } });
|
|
50
|
-
Object.defineProperty(exports, "ParseError", { enumerable: true, get: function () { return errors_1.ParseError; } });
|
|
51
|
-
__exportStar(require("./constants"), exports);
|
|
27
|
+
export { SimpleBox } from './simplebox.js';
|
|
28
|
+
export { BoxliteError, ExecError, TimeoutError, ParseError } from './errors.js';
|
|
29
|
+
export * from './constants.js';
|
|
52
30
|
// Specialized boxes
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var computerbox_1 = require("./computerbox");
|
|
58
|
-
Object.defineProperty(exports, "ComputerBox", { enumerable: true, get: function () { return computerbox_1.ComputerBox; } });
|
|
59
|
-
var interactivebox_1 = require("./interactivebox");
|
|
60
|
-
Object.defineProperty(exports, "InteractiveBox", { enumerable: true, get: function () { return interactivebox_1.InteractiveBox; } });
|
|
31
|
+
export { CodeBox } from './codebox.js';
|
|
32
|
+
export { BrowserBox } from './browserbox.js';
|
|
33
|
+
export { ComputerBox } from './computerbox.js';
|
|
34
|
+
export { InteractiveBox } from './interactivebox.js';
|
|
61
35
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,4BAA4B;AAC5B,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;AAExC,qDAAqD;AACrD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAEzC,gCAAgC;AAChC,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChF,cAAc,gBAAgB,CAAC;AAE/B,oBAAoB;AACpB,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAA4C,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,WAAW,EAA4C,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,cAAc,EAA8B,MAAM,qBAAqB,CAAC"}
|
package/dist/interactivebox.d.ts
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides automatic PTY-based interactive sessions, similar to `docker exec -it`.
|
|
5
5
|
*/
|
|
6
|
-
import { SimpleBoxOptions } from './simplebox';
|
|
7
|
-
type Boxlite = any;
|
|
8
|
-
type Box = any;
|
|
6
|
+
import { SimpleBox, SimpleBoxOptions } from './simplebox.js';
|
|
9
7
|
type Execution = any;
|
|
10
8
|
/**
|
|
11
9
|
* Options for creating an InteractiveBox.
|
|
@@ -55,11 +53,9 @@ export interface InteractiveBoxOptions extends SimpleBoxOptions {
|
|
|
55
53
|
* // Automatically stopped when leaving scope
|
|
56
54
|
* ```
|
|
57
55
|
*/
|
|
58
|
-
export declare class InteractiveBox {
|
|
59
|
-
protected _runtime: Boxlite;
|
|
60
|
-
protected _box: Box;
|
|
56
|
+
export declare class InteractiveBox extends SimpleBox {
|
|
61
57
|
protected _shell: string;
|
|
62
|
-
protected
|
|
58
|
+
protected _interactiveEnv?: Record<string, string>;
|
|
63
59
|
protected _tty: boolean;
|
|
64
60
|
protected _execution?: Execution;
|
|
65
61
|
protected _stdin?: any;
|
|
@@ -84,10 +80,6 @@ export declare class InteractiveBox {
|
|
|
84
80
|
* ```
|
|
85
81
|
*/
|
|
86
82
|
constructor(options: InteractiveBoxOptions);
|
|
87
|
-
/**
|
|
88
|
-
* Get the box ID (ULID format).
|
|
89
|
-
*/
|
|
90
|
-
get id(): string;
|
|
91
83
|
/**
|
|
92
84
|
* Start the interactive shell session.
|
|
93
85
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactivebox.d.ts","sourceRoot":"","sources":["../lib/interactivebox.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"interactivebox.d.ts","sourceRoot":"","sources":["../lib/interactivebox.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAG7D,KAAK,SAAS,GAAG,GAAG,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAE3C,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnD,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC;IACjC,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IACvB,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACxB,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACxB,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAM;IACzC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAS;IAEnC;;;;;;;;;;;;;;;OAeG;gBACS,OAAO,EAAE,qBAAqB;IAiB1C;;;;;;;;;;;;OAYG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkD5B;;;;;;;;OAQG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;;;;OAOG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA4B3B;;;;;;;;;;;OAWG;IACG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C;;OAEG;YACW,aAAa;IA4B3B;;OAEG;YACW,cAAc;IAoB5B;;OAEG;YACW,cAAc;IAoB5B;;OAEG;YACW,YAAY;CAW3B"}
|
package/dist/interactivebox.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* InteractiveBox - Interactive terminal sessions with PTY support.
|
|
4
3
|
*
|
|
5
4
|
* Provides automatic PTY-based interactive sessions, similar to `docker exec -it`.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
exports.InteractiveBox = void 0;
|
|
9
|
-
const native_1 = require("./native");
|
|
6
|
+
import { SimpleBox } from './simplebox.js';
|
|
10
7
|
/**
|
|
11
8
|
* Interactive box with automatic PTY and terminal forwarding.
|
|
12
9
|
*
|
|
@@ -41,7 +38,7 @@ const native_1 = require("./native");
|
|
|
41
38
|
* // Automatically stopped when leaving scope
|
|
42
39
|
* ```
|
|
43
40
|
*/
|
|
44
|
-
class InteractiveBox {
|
|
41
|
+
export class InteractiveBox extends SimpleBox {
|
|
45
42
|
/**
|
|
46
43
|
* Create an interactive box.
|
|
47
44
|
*
|
|
@@ -59,35 +56,19 @@ class InteractiveBox {
|
|
|
59
56
|
* ```
|
|
60
57
|
*/
|
|
61
58
|
constructor(options) {
|
|
59
|
+
// Extract InteractiveBox-specific options before passing to parent
|
|
60
|
+
const { shell = '/bin/sh', tty, ...baseOptions } = options;
|
|
61
|
+
// Call parent constructor (handles runtime, lazy box creation)
|
|
62
|
+
super(baseOptions);
|
|
62
63
|
this._ioTasks = [];
|
|
63
64
|
this._exited = false;
|
|
64
|
-
|
|
65
|
-
// Use provided runtime or get global default
|
|
66
|
-
if (options.runtime) {
|
|
67
|
-
this._runtime = options.runtime;
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
this._runtime = JsBoxlite.default();
|
|
71
|
-
}
|
|
72
|
-
// Create box directly (no SimpleBox wrapper)
|
|
73
|
-
const { shell = '/bin/sh', tty, env, ...boxOptions } = options;
|
|
74
|
-
this._box = this._runtime.create(boxOptions, options.name);
|
|
65
|
+
// InteractiveBox-specific initialization
|
|
75
66
|
this._shell = shell;
|
|
76
|
-
this.
|
|
67
|
+
this._interactiveEnv = options.env;
|
|
77
68
|
// Determine TTY mode: undefined = auto-detect, true = force, false = disable
|
|
78
|
-
|
|
79
|
-
this._tty = process.stdin.isTTY ?? false;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
this._tty = tty;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Get the box ID (ULID format).
|
|
87
|
-
*/
|
|
88
|
-
get id() {
|
|
89
|
-
return this._box.id;
|
|
69
|
+
this._tty = tty === undefined ? (process.stdin.isTTY ?? false) : tty;
|
|
90
70
|
}
|
|
71
|
+
// id getter inherited from SimpleBox
|
|
91
72
|
/**
|
|
92
73
|
* Start the interactive shell session.
|
|
93
74
|
*
|
|
@@ -102,27 +83,29 @@ class InteractiveBox {
|
|
|
102
83
|
* ```
|
|
103
84
|
*/
|
|
104
85
|
async start() {
|
|
86
|
+
// Ensure box is created (inherited from SimpleBox)
|
|
87
|
+
const box = await this._ensureBox();
|
|
105
88
|
// Convert env to array format if provided
|
|
106
|
-
const envArray = this.
|
|
107
|
-
? Object.entries(this.
|
|
89
|
+
const envArray = this._interactiveEnv
|
|
90
|
+
? Object.entries(this._interactiveEnv).map(([k, v]) => [k, v])
|
|
108
91
|
: undefined;
|
|
109
|
-
// Start shell with PTY
|
|
110
|
-
this._execution = await
|
|
111
|
-
// Get streams
|
|
92
|
+
// Start shell with PTY (box.exec runs command inside container, not on host)
|
|
93
|
+
this._execution = await box.exec(this._shell, [], envArray, true);
|
|
94
|
+
// Get streams (these are async in Rust, must await)
|
|
112
95
|
try {
|
|
113
|
-
this._stdin = this._execution.stdin();
|
|
96
|
+
this._stdin = await this._execution.stdin();
|
|
114
97
|
}
|
|
115
98
|
catch (err) {
|
|
116
99
|
// stdin not available
|
|
117
100
|
}
|
|
118
101
|
try {
|
|
119
|
-
this._stdout = this._execution.stdout();
|
|
102
|
+
this._stdout = await this._execution.stdout();
|
|
120
103
|
}
|
|
121
104
|
catch (err) {
|
|
122
105
|
// stdout not available
|
|
123
106
|
}
|
|
124
107
|
try {
|
|
125
|
-
this._stderr = this._execution.stderr();
|
|
108
|
+
this._stderr = await this._execution.stderr();
|
|
126
109
|
}
|
|
127
110
|
catch (err) {
|
|
128
111
|
// stderr not available
|
|
@@ -161,7 +144,7 @@ class InteractiveBox {
|
|
|
161
144
|
* ```
|
|
162
145
|
*/
|
|
163
146
|
async stop() {
|
|
164
|
-
// Restore terminal settings
|
|
147
|
+
// 1. Restore terminal settings (InteractiveBox-specific cleanup)
|
|
165
148
|
if (this._tty && process.stdin.isTTY) {
|
|
166
149
|
try {
|
|
167
150
|
process.stdin.setRawMode(false);
|
|
@@ -171,18 +154,21 @@ class InteractiveBox {
|
|
|
171
154
|
// Ignore errors during cleanup
|
|
172
155
|
}
|
|
173
156
|
}
|
|
174
|
-
// Wait for I/O tasks to complete (with timeout)
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
Promise.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
157
|
+
// 2. Wait for I/O tasks to complete (with timeout)
|
|
158
|
+
if (this._ioTasks.length > 0) {
|
|
159
|
+
try {
|
|
160
|
+
await Promise.race([
|
|
161
|
+
Promise.all(this._ioTasks),
|
|
162
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error('Timeout')), 3000))
|
|
163
|
+
]);
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
// Timeout or error - continue with shutdown
|
|
167
|
+
}
|
|
168
|
+
this._ioTasks = []; // Clear tasks
|
|
183
169
|
}
|
|
184
|
-
//
|
|
185
|
-
await
|
|
170
|
+
// 3. Call parent's stop() to shut down the box
|
|
171
|
+
await super.stop();
|
|
186
172
|
}
|
|
187
173
|
/**
|
|
188
174
|
* Implement async disposable pattern (TypeScript 5.2+).
|
|
@@ -295,5 +281,4 @@ class InteractiveBox {
|
|
|
295
281
|
}
|
|
296
282
|
}
|
|
297
283
|
}
|
|
298
|
-
exports.InteractiveBox = InteractiveBox;
|
|
299
284
|
//# sourceMappingURL=interactivebox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactivebox.js","sourceRoot":"","sources":["../lib/interactivebox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interactivebox.js","sourceRoot":"","sources":["../lib/interactivebox.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,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AE,OAAO;QAE1B,IAAI,CAAC;YACH,OAAO,IAAI,EAAE,CAAC;gBACZ,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBACxC,IAAI,KAAK,KAAK,IAAI;oBAAE,MAAM;gBAE1B,kBAAkB;gBAClB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;oBAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC9B,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC9B,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,wBAAwB;QAC1B,CAAC;IACH,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,YAAY;QACxB,IAAI,CAAC;YACH,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACpB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAC/B,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,gCAAgC;QAClC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;IACH,CAAC;CACF"}
|
package/dist/native.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../lib/native.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../lib/native.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,GAAG,CAYrC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,GAAG,CAElC"}
|
package/dist/native.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Native module loader for BoxLite Node.js SDK.
|
|
4
3
|
*
|
|
5
4
|
* This module centralizes native binding loading to avoid duplication
|
|
6
5
|
* across simplebox.ts, interactivebox.ts, and index.ts.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
7
|
+
import { loadBinding } from '@node-rs/helper';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { dirname, join } from 'path';
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = dirname(__filename);
|
|
13
12
|
// Cache the loaded native module
|
|
14
13
|
let _nativeModule = null;
|
|
15
14
|
/**
|
|
@@ -20,10 +19,10 @@ let _nativeModule = null;
|
|
|
20
19
|
*
|
|
21
20
|
* @throws Error if the native extension is not found or fails to load
|
|
22
21
|
*/
|
|
23
|
-
function getNativeModule() {
|
|
22
|
+
export function getNativeModule() {
|
|
24
23
|
if (_nativeModule === null) {
|
|
25
24
|
try {
|
|
26
|
-
_nativeModule =
|
|
25
|
+
_nativeModule = loadBinding(join(__dirname, '..'), 'boxlite', '@boxlite-ai/boxlite');
|
|
27
26
|
}
|
|
28
27
|
catch (err) {
|
|
29
28
|
throw new Error(`BoxLite native extension not found: ${err}. ` +
|
|
@@ -35,7 +34,7 @@ function getNativeModule() {
|
|
|
35
34
|
/**
|
|
36
35
|
* Get the JsBoxlite runtime class from the native module.
|
|
37
36
|
*/
|
|
38
|
-
function getJsBoxlite() {
|
|
37
|
+
export function getJsBoxlite() {
|
|
39
38
|
return getNativeModule().JsBoxlite;
|
|
40
39
|
}
|
|
41
40
|
//# sourceMappingURL=native.js.map
|
package/dist/native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../lib/native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../lib/native.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,iCAAiC;AACjC,IAAI,aAAa,GAAQ,IAAI,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAAC;QACvF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACb,uCAAuC,GAAG,IAAI;gBAC9C,sDAAsD,CACvD,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,eAAe,EAAE,CAAC,SAAS,CAAC;AACrC,CAAC"}
|
package/dist/simplebox.d.ts
CHANGED
package/dist/simplebox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplebox.d.ts","sourceRoot":"","sources":["../lib/simplebox.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"simplebox.d.ts","sourceRoot":"","sources":["../lib/simplebox.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAI5C,KAAK,OAAO,GA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C,KAAK,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC;IAE/B;;;;;;;;;;;;;;;;OAgBG;gBACS,OAAO,GAAE,gBAAqB;IA4B1C;;;OAGG;cACa,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC;IAc1C;;;;OAIG;IACH,IAAI,EAAE,IAAI,MAAM,CAKf;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;IAK9B;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED;;;;OAIG;IACH,IAAI;IAOJ;;OAEG;IACG,OAAO;IAKb;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IACzD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAsGzF;;;;;;;;;;;;;OAaG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B;;;;;;;;;OASG;IACG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7C"}
|
package/dist/simplebox.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* SimpleBox - Foundation for specialized container types.
|
|
4
3
|
*
|
|
@@ -8,9 +7,7 @@
|
|
|
8
7
|
* 2. Command execution with output collection
|
|
9
8
|
* 3. Try/finally cleanup patterns
|
|
10
9
|
*/
|
|
11
|
-
|
|
12
|
-
exports.SimpleBox = void 0;
|
|
13
|
-
const native_1 = require("./native");
|
|
10
|
+
import { getJsBoxlite } from './native.js';
|
|
14
11
|
/**
|
|
15
12
|
* Base class for specialized container types.
|
|
16
13
|
*
|
|
@@ -49,7 +46,7 @@ const native_1 = require("./native");
|
|
|
49
46
|
* }
|
|
50
47
|
* ```
|
|
51
48
|
*/
|
|
52
|
-
class SimpleBox {
|
|
49
|
+
export class SimpleBox {
|
|
53
50
|
/**
|
|
54
51
|
* Create a new SimpleBox.
|
|
55
52
|
*
|
|
@@ -70,7 +67,7 @@ class SimpleBox {
|
|
|
70
67
|
constructor(options = {}) {
|
|
71
68
|
this._box = null;
|
|
72
69
|
this._boxPromise = null;
|
|
73
|
-
const JsBoxlite =
|
|
70
|
+
const JsBoxlite = getJsBoxlite();
|
|
74
71
|
// Use provided runtime or get global default
|
|
75
72
|
if (options.runtime) {
|
|
76
73
|
this._runtime = options.runtime;
|
|
@@ -277,5 +274,4 @@ class SimpleBox {
|
|
|
277
274
|
await this.stop();
|
|
278
275
|
}
|
|
279
276
|
}
|
|
280
|
-
exports.SimpleBox = SimpleBox;
|
|
281
277
|
//# sourceMappingURL=simplebox.js.map
|
package/dist/simplebox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplebox.js","sourceRoot":"","sources":["../lib/simplebox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simplebox.js","sourceRoot":"","sources":["../lib/simplebox.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAsD3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,OAAO,SAAS;IAOpB;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,UAA4B,EAAE;QAtBhC,SAAI,GAAe,IAAI,CAAC;QACxB,gBAAW,GAAwB,IAAI,CAAC;QAsBhD,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;QAEjC,6CAA6C;QAC7C,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,IAAI,CAAC,QAA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;;;;OAaG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,yCAAyC;YACzC,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boxlite-ai/boxlite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "BoxLite - Embeddable micro-VM runtime for secure, isolated code execution",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"files": [
|
|
@@ -21,8 +22,8 @@
|
|
|
21
22
|
"vitest": "^2.0.0"
|
|
22
23
|
},
|
|
23
24
|
"optionalDependencies": {
|
|
24
|
-
"@boxlite-ai/boxlite-darwin-arm64": "0.1.
|
|
25
|
-
"@boxlite-ai/boxlite-linux-x64-gnu": "0.1.
|
|
25
|
+
"@boxlite-ai/boxlite-darwin-arm64": "0.1.5",
|
|
26
|
+
"@boxlite-ai/boxlite-linux-x64-gnu": "0.1.5"
|
|
26
27
|
},
|
|
27
28
|
"keywords": [
|
|
28
29
|
"boxlite",
|