@easybits.cloud/cli 0.15.3 → 0.15.4

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 CHANGED
@@ -42,6 +42,7 @@ easybits sandboxes exec sb_abc123 -- npm test
42
42
  easybits sandboxes logs sb_abc123 --unit myapp --lines 100 --since "10 min ago" --grep ERROR
43
43
  easybits sandboxes files ls sb_abc123 /data/work
44
44
  easybits sandboxes files read sb_abc123 /etc/os-release
45
+ easybits sandboxes files read sb_abc123 /data/app.db --out app.db # tope 8 MB: más grande sale con código 1 ("truncated")
45
46
  easybits sandboxes files write sb_abc123 /data/work/app.js ./app.js
46
47
  easybits sandboxes suspend sb_abc123
47
48
  easybits sandboxes resume sb_abc123
package/dist/index.js CHANGED
@@ -1244,6 +1244,16 @@ async function sandbox(ctx, usage2) {
1244
1244
  const eb = await getClient(ctx);
1245
1245
  return eb.sandboxes.get(id);
1246
1246
  }
1247
+ var FILE_READ_CAP = 8 << 20;
1248
+ function checkNotTruncated(size, path) {
1249
+ if (size < FILE_READ_CAP) return;
1250
+ throw new CliError(
1251
+ t(`${path} is 8 MB or larger and the read was cut at 8 MB.`, `${path} pesa 8 MB o m\xE1s y la lectura se cort\xF3 en 8 MB.`),
1252
+ 1,
1253
+ t("Compress or split it inside the sandbox first (exec), then read the pieces.", "Compr\xEDmelo o p\xE1rtelo dentro de la caja (exec) y lee las partes."),
1254
+ "truncated"
1255
+ );
1256
+ }
1247
1257
  var FILES_USAGE = "easybits sandboxes files <ls|read|write> <sandbox> <path> [local-file]";
1248
1258
  var sandboxes = {
1249
1259
  name: "sandboxes",
@@ -1409,10 +1419,12 @@ var sandboxes = {
1409
1419
  const out = str(ctx, "out");
1410
1420
  if (out) {
1411
1421
  const r = await sb.files.read(path, { encoding: "base64" });
1422
+ checkNotTruncated(r.size, path);
1412
1423
  writeFileSync3(out, Buffer.from(r.content, "base64"));
1413
1424
  emit(ctx, { path, out, size: r.size }, () => console.error(t(`Saved ${fmtBytes(r.size)} to ${out}`, `Guard\xE9 ${fmtBytes(r.size)} en ${out}`)));
1414
1425
  } else {
1415
1426
  const r = await sb.files.read(path);
1427
+ checkNotTruncated(r.size, path);
1416
1428
  emit(ctx, r, () => process.stdout.write(r.content));
1417
1429
  }
1418
1430
  } else if (action === "write") {
@@ -3723,7 +3735,7 @@ async function updateNotice(current2) {
3723
3735
  }
3724
3736
 
3725
3737
  // src/commands/doctor.ts
3726
- var VERSION = true ? "0.15.3" : "dev";
3738
+ var VERSION = true ? "0.15.4" : "dev";
3727
3739
  var doctor2 = {
3728
3740
  name: "doctor",
3729
3741
  group: "Account",
@@ -4232,7 +4244,7 @@ function normalizeArgs(input) {
4232
4244
  }
4233
4245
 
4234
4246
  // src/index.ts
4235
- var VERSION2 = true ? "0.15.3" : "dev";
4247
+ var VERSION2 = true ? "0.15.4" : "dev";
4236
4248
  var GLOBAL_OPTIONS = {
4237
4249
  json: { type: "boolean" },
4238
4250
  token: { type: "string" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easybits.cloud/cli",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "description": "Official CLI for EasyBits, the cloud for AI agents — sandboxes, hosting, domains, databases, agents and files from your terminal",
5
5
  "type": "module",
6
6
  "bin": {