@abuaboud/box 0.7.11 → 0.7.12
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/cbox.mjs +4 -3
- package/package.json +1 -1
package/dist/cbox.mjs
CHANGED
|
@@ -20,6 +20,7 @@ import { join } from "node:path";
|
|
|
20
20
|
import ssh2 from "ssh2";
|
|
21
21
|
var CONFIG_DIR = join(homedir(), ".config", "box");
|
|
22
22
|
var BOXES = join(homedir(), ".box");
|
|
23
|
+
var MAX_SETUP_MB = 70;
|
|
23
24
|
var SERVICES = { 5432: "Postgres", 6379: "Redis", 3306: "MySQL", 27017: "MongoDB", 8123: "ClickHouse" };
|
|
24
25
|
function localMcp() {
|
|
25
26
|
const claudeJson = join(homedir(), ".claude.json");
|
|
@@ -807,7 +808,7 @@ async function openLocal({ name, env, here, branch, fresh = false }) {
|
|
|
807
808
|
async function sendSetup() {
|
|
808
809
|
const { tar, skills, enabled, memory, ...home2 } = localClaudeHome();
|
|
809
810
|
const buf = await tar;
|
|
810
|
-
const sha = buf && buf.length <=
|
|
811
|
+
const sha = buf && buf.length <= MAX_SETUP_MB << 20 ? createHash("sha256").update(buf).digest("hex") : void 0;
|
|
811
812
|
const put = (body) => api("/api/laptop-setup", { method: "PUT", body: JSON.stringify({ home: { ...home2, memory }, sha, ...body }) });
|
|
812
813
|
if ((await put({})).need && buf) await put({ tgz: buf.toString("base64") });
|
|
813
814
|
return { skills, plugins: enabled.length, memory: !!memory.trim(), tooBig: !!buf && !sha };
|
|
@@ -994,7 +995,7 @@ async function newRemoteBox(env, branch, name, o) {
|
|
|
994
995
|
}
|
|
995
996
|
async function sendHome(name, tar) {
|
|
996
997
|
const buf = await tar;
|
|
997
|
-
if (!buf || buf.length >
|
|
998
|
+
if (!buf || buf.length > MAX_SETUP_MB << 20) return api(`/api/boxes/${name}/home`, { method: "POST", body: "{}" }).catch(() => void 0);
|
|
998
999
|
const sha = createHash2("sha256").update(buf).digest("hex");
|
|
999
1000
|
const post = (body) => api(`/api/boxes/${name}/home`, { method: "POST", body: JSON.stringify(body) });
|
|
1000
1001
|
if ((await post({ sha }).catch(() => ({ need: false }))).need) await post({ sha, tgz: buf.toString("base64") }).catch(() => void 0);
|
|
@@ -1296,7 +1297,7 @@ async function setup() {
|
|
|
1296
1297
|
const sent = await sendSetup();
|
|
1297
1298
|
const n = (k, word) => `${k} ${word}${k === 1 ? "" : "s"}`;
|
|
1298
1299
|
ok(`Sent ${[n(sent.skills, "skill"), n(sent.plugins, "plugin"), ...sent.memory ? ["CLAUDE.md"] : []].join(", ")} ${dim("\xB7 @Box and webhooks start boxes with these")}`);
|
|
1299
|
-
if (sent.tooBig) miss(
|
|
1300
|
+
if (sent.tooBig) miss(`Your skills and plugins are over ${MAX_SETUP_MB} MB, so only CLAUDE.md and the plugin list were sent.`);
|
|
1300
1301
|
const { data } = await api("/api/accounts");
|
|
1301
1302
|
const missing = ["claude", "github"].filter((id) => data.find((a) => a.id === id)?.status !== "ready").map((id) => id === "claude" ? "sign in to Claude" : "connect GitHub");
|
|
1302
1303
|
if (missing.length) miss(`Before @Box can start boxes as you, ${missing.join(" and ")}: ${new URL("/boxes?new", load().server)}`);
|
package/package.json
CHANGED