@easybits.cloud/cli 0.15.3 → 0.15.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 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
@@ -31,6 +31,9 @@ function langFlag(argv2) {
31
31
  return head.find((a) => a.startsWith("--lang="))?.slice(7);
32
32
  }
33
33
  var FROM_ES = [
34
+ ["Tu plan {} incluye {} agente y ya tienes {}. Borra uno para crear otro, o sube de plan ({}).", "Your {} plan includes {} agent and you already have {}. Delete one to create another, or upgrade ({})."],
35
+ ["Tu plan {} incluye {} agentes y ya tienes {}. Borra uno para crear otro, o sube de plan ({}).", "Your {} plan includes {} agents and you already have {}. Delete one to create another, or upgrade ({})."],
36
+ ["Tu plan {} incluye {} agentes y ya tienes {}. Borra uno para crear otro.", "Your {} plan includes {} agents and you already have {}. Delete one to create another."],
34
37
  ["ruta inv\xE1lida", "invalid path"],
35
38
  ["cuerpo vac\xEDo", "empty body"],
36
39
  ["archivo demasiado grande (m\xE1x 10 MB)", "file too large (max 10 MB)"],
@@ -136,6 +139,7 @@ var KIND_HINTS = () => ({
136
139
  SandboxUnreachable: t("The sandbox is not answering inside. Wait and retry; if it persists, destroy it.", "El sandbox no contesta por dentro. Espera y reintenta; si sigue, destr\xFAyelo."),
137
140
  SandboxHostTimeout: t("The operation may still be running. Check `easybits sb get <id>` and retry in a few minutes.", "La operaci\xF3n puede seguir en curso. Revisa `easybits sb get <id>` y reintenta en unos minutos."),
138
141
  SandboxHostError: t("The sandbox host failed. Retry; if it persists, contact support.", "Fall\xF3 el host de sandboxes. Reintenta; si sigue, contacta a soporte."),
142
+ AgentLimitReached: t("Your plan has no room for another persistent agent. Delete one (easybits agents ls) or upgrade: https://www.easybits.cloud/planes", "Tu plan ya no tiene lugar para otro agente persistente. Borra uno (easybits agents ls) o sube de plan: https://www.easybits.cloud/planes"),
139
143
  SQL_ERROR: t("Fix the SQL statement.", "Corrige la sentencia SQL."),
140
144
  DATABASE_STORAGE_MISSING: t("This database has no storage; its data is unavailable. Delete it (easybits db rm <db> --yes) and create a new one.", "Esta base no tiene almacenamiento; sus datos no est\xE1n disponibles. B\xF3rrala (easybits db rm <db> --yes) y crea otra."),
141
145
  DATABASE_BACKEND_ERROR: t("The database backend failed. Retry in a moment.", "Fall\xF3 el backend de la base. Reintenta en un momento.")
@@ -1244,6 +1248,16 @@ async function sandbox(ctx, usage2) {
1244
1248
  const eb = await getClient(ctx);
1245
1249
  return eb.sandboxes.get(id);
1246
1250
  }
1251
+ var FILE_READ_CAP = 8 << 20;
1252
+ function checkNotTruncated(size, path) {
1253
+ if (size < FILE_READ_CAP) return;
1254
+ throw new CliError(
1255
+ 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.`),
1256
+ 1,
1257
+ 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."),
1258
+ "truncated"
1259
+ );
1260
+ }
1247
1261
  var FILES_USAGE = "easybits sandboxes files <ls|read|write> <sandbox> <path> [local-file]";
1248
1262
  var sandboxes = {
1249
1263
  name: "sandboxes",
@@ -1409,10 +1423,12 @@ var sandboxes = {
1409
1423
  const out = str(ctx, "out");
1410
1424
  if (out) {
1411
1425
  const r = await sb.files.read(path, { encoding: "base64" });
1426
+ checkNotTruncated(r.size, path);
1412
1427
  writeFileSync3(out, Buffer.from(r.content, "base64"));
1413
1428
  emit(ctx, { path, out, size: r.size }, () => console.error(t(`Saved ${fmtBytes(r.size)} to ${out}`, `Guard\xE9 ${fmtBytes(r.size)} en ${out}`)));
1414
1429
  } else {
1415
1430
  const r = await sb.files.read(path);
1431
+ checkNotTruncated(r.size, path);
1416
1432
  emit(ctx, r, () => process.stdout.write(r.content));
1417
1433
  }
1418
1434
  } else if (action === "write") {
@@ -3723,7 +3739,7 @@ async function updateNotice(current2) {
3723
3739
  }
3724
3740
 
3725
3741
  // src/commands/doctor.ts
3726
- var VERSION = true ? "0.15.3" : "dev";
3742
+ var VERSION = true ? "0.15.5" : "dev";
3727
3743
  var doctor2 = {
3728
3744
  name: "doctor",
3729
3745
  group: "Account",
@@ -4232,7 +4248,7 @@ function normalizeArgs(input) {
4232
4248
  }
4233
4249
 
4234
4250
  // src/index.ts
4235
- var VERSION2 = true ? "0.15.3" : "dev";
4251
+ var VERSION2 = true ? "0.15.5" : "dev";
4236
4252
  var GLOBAL_OPTIONS = {
4237
4253
  json: { type: "boolean" },
4238
4254
  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.5",
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": {