@botbuddy/cli 1.64.15 → 1.64.16
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/daemon/bin/darwin-arm64/botbuddy-daemon +0 -0
- package/daemon/bin/linux-x64/botbuddy-daemon +0 -0
- package/daemon-release/darwin-arm64.json +4 -4
- package/daemon-release/linux-x64.json +4 -4
- package/daemon-release/manifest.json +5 -5
- package/package.json +1 -1
- package/src/stack-local-locks.mjs +25 -0
- package/src/stack.mjs +19 -1
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.64.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.64.16",
|
|
3
|
+
"source_commit": "6690f94e4c3d385159ca315713a6eab3560289fb",
|
|
4
|
+
"source_sha256": "81838b2e5024a22f62c4b55a75c3113c26cfe88f0047f0048f28f5800d0693d3",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "9ca9db33cdee03687c26d5e162f4d936d44b7c1c23028c78566a61b90f7c40ad"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.64.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.64.16",
|
|
3
|
+
"source_commit": "6690f94e4c3d385159ca315713a6eab3560289fb",
|
|
4
|
+
"source_sha256": "81838b2e5024a22f62c4b55a75c3113c26cfe88f0047f0048f28f5800d0693d3",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "b1a73bbd5bc7d78a13a3ec6f547436cc780163687bb5162e230d5796291e7689"
|
|
7
7
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
|
-
"release_version": "1.64.
|
|
4
|
-
"source_commit": "
|
|
5
|
-
"source_sha256": "
|
|
3
|
+
"release_version": "1.64.16",
|
|
4
|
+
"source_commit": "6690f94e4c3d385159ca315713a6eab3560289fb",
|
|
5
|
+
"source_sha256": "81838b2e5024a22f62c4b55a75c3113c26cfe88f0047f0048f28f5800d0693d3",
|
|
6
6
|
"targets": {
|
|
7
7
|
"darwin-arm64": {
|
|
8
8
|
"goos": "darwin",
|
|
9
9
|
"goarch": "arm64",
|
|
10
10
|
"binary": "daemon/bin/darwin-arm64/botbuddy-daemon",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "9ca9db33cdee03687c26d5e162f4d936d44b7c1c23028c78566a61b90f7c40ad",
|
|
12
12
|
"mode": "0755"
|
|
13
13
|
},
|
|
14
14
|
"linux-x64": {
|
|
15
15
|
"goos": "linux",
|
|
16
16
|
"goarch": "amd64",
|
|
17
17
|
"binary": "daemon/bin/linux-x64/botbuddy-daemon",
|
|
18
|
-
"sha256": "
|
|
18
|
+
"sha256": "b1a73bbd5bc7d78a13a3ec6f547436cc780163687bb5162e230d5796291e7689",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from "node:util";
|
|
2
|
+
|
|
3
|
+
// Applied only to the private materialized stack, never to the source config.
|
|
4
|
+
export async function patchLocalLockCapacity(text, value) {
|
|
5
|
+
if (!Number.isInteger(value) || value < 16 || value > 1024) throw new Error("local lock capacity must be an integer from 16 to 1024");
|
|
6
|
+
if (typeof text !== "string" || Buffer.byteLength(text) > 1024 * 1024) throw new Error("local stack config unavailable or too large");
|
|
7
|
+
const { parse, stringify } = await import("./vendor/smol-toml/index.js");
|
|
8
|
+
let doc;
|
|
9
|
+
try { doc = parse(text, { integersAsBigInt: true, unsafeKeyBehaviour: "throw" }); }
|
|
10
|
+
catch { throw new Error("local stack config is not valid supported TOML"); }
|
|
11
|
+
doc.db ??= Object.create(null);
|
|
12
|
+
if (!doc.db || typeof doc.db !== "object" || Array.isArray(doc.db)) throw new Error("local db config is ambiguous");
|
|
13
|
+
doc.db.settings ??= Object.create(null);
|
|
14
|
+
const settings = doc.db.settings;
|
|
15
|
+
if (!settings || typeof settings !== "object" || Array.isArray(settings)) throw new Error("local db settings are ambiguous");
|
|
16
|
+
if (Object.hasOwn(settings, "max_locks_per_transaction") && settings.max_locks_per_transaction !== BigInt(value)) {
|
|
17
|
+
throw new Error("local lock capacity conflicts with the source configuration");
|
|
18
|
+
}
|
|
19
|
+
settings.max_locks_per_transaction = BigInt(value);
|
|
20
|
+
let patched, check;
|
|
21
|
+
try { patched = stringify(doc, { numbersAsFloat: true, strictTemporal: true }); check = parse(patched, { integersAsBigInt: true, unsafeKeyBehaviour: "throw" }); }
|
|
22
|
+
catch { throw new Error("local stack config could not roundtrip safely"); }
|
|
23
|
+
if (!isDeepStrictEqual(doc, check)) throw new Error("local stack config changed during roundtrip");
|
|
24
|
+
return patched;
|
|
25
|
+
}
|
package/src/stack.mjs
CHANGED
|
@@ -237,6 +237,8 @@ ${bold("done OPTIONS")}
|
|
|
237
237
|
require exact worktree + live connection proof.
|
|
238
238
|
|
|
239
239
|
${bold("run OPTIONS")}
|
|
240
|
+
--local-max-locks N Set max_locks_per_transaction (16-1024) in the disposable stack only.
|
|
241
|
+
Refuses conflicting source settings or an explicit --stack-path.
|
|
240
242
|
--repo <repo> Required approved repository name.
|
|
241
243
|
--ticket <BOT-123> Required ticket for the batch.
|
|
242
244
|
--run-id <UUID> Optional caller-chosen run identity. Choose it before dispatch to arm
|
|
@@ -528,6 +530,15 @@ export function parseStackArgs(argv) {
|
|
|
528
530
|
case "--purpose": if (need(a, rest[i + 1])) opts.purpose = rest[++i]; break;
|
|
529
531
|
case "--run-id": if (need(a, rest[i + 1])) opts.runId = rest[++i]; break;
|
|
530
532
|
case "--stack-path": if (need(a, rest[i + 1])) { opts.stackPath = rest[++i]; opts.stackPathExplicit = true; } break;
|
|
533
|
+
case "--local-max-locks": {
|
|
534
|
+
if (need(a, rest[i + 1])) {
|
|
535
|
+
const raw = rest[++i];
|
|
536
|
+
const n = Number(raw);
|
|
537
|
+
if (!/^\d+$/.test(raw) || !Number.isInteger(n) || n < 16 || n > 1024) errors.push("--local-max-locks must be an integer from 16 to 1024");
|
|
538
|
+
else opts.localMaxLocks = n;
|
|
539
|
+
}
|
|
540
|
+
break;
|
|
541
|
+
}
|
|
531
542
|
case "--idle-ttl": {
|
|
532
543
|
if (need(a, rest[i + 1])) {
|
|
533
544
|
const n = Number(rest[++i]);
|
|
@@ -647,6 +658,7 @@ export function parseStackArgs(argv) {
|
|
|
647
658
|
// `up` exits once the lease is active, so it can never hold a remote lease's SSH
|
|
648
659
|
// forwards and always asks for a co-located host.
|
|
649
660
|
if (opts.remote && opts.localOnly) errors.push("--remote and --local-only are mutually exclusive");
|
|
661
|
+
if (opts.localMaxLocks != null && (command !== "run" || opts.stackPathExplicit)) errors.push("--local-max-locks requires a CLI-materialized stack run without --stack-path");
|
|
650
662
|
if (opts.remote && opts.localExec) {
|
|
651
663
|
errors.push("--remote cannot be combined with --local-exec: a local-exec stack is started on THIS machine");
|
|
652
664
|
}
|
|
@@ -959,6 +971,9 @@ async function claimProjectLock(projectId, lock, subject) {
|
|
|
959
971
|
}
|
|
960
972
|
|
|
961
973
|
export async function resolveRunExecution(cwd, opts, { materialize = materializeRunStackDir, lock = acquireStackLock, identity = leasedStackIdentity, reserveBlocks = reservePortBlocks, releaseClaim = releaseLeasedStackClaim, claimHeld = leasedStackClaimHeld, stableReusable = stableRunStackReusable, markReleased = markLeasedStackReleased, idleOriginPort = idleRequesterOriginPort, stableIdle = stableRunStackIdle, recordOrigin = recordRequesterOrigin, reserveOrigin = reserveRequesterOrigin, portRegistryDir = null, warn = (line) => process.stderr.write(`${line}\n`) } = {}) {
|
|
974
|
+
if (opts.localMaxLocks != null && (opts.stackPathExplicit || (opts.stackPath && opts.stackPath !== "."))) {
|
|
975
|
+
throw new Error("local lock capacity requires a CLI-materialized stack");
|
|
976
|
+
}
|
|
962
977
|
const refuseRoot = (execution) => {
|
|
963
978
|
if (execution.stackPath === ".") {
|
|
964
979
|
throw new Error(
|
|
@@ -1095,11 +1110,14 @@ export async function resolveRunExecution(cwd, opts, { materialize = materialize
|
|
|
1095
1110
|
}
|
|
1096
1111
|
// The materialized stack stays canonical (a co-located placement serves it unchanged);
|
|
1097
1112
|
// only the remote bundle's config variant names the reserved origin.
|
|
1113
|
+
const localConfig = opts.localMaxLocks == null ? undefined : await (await import("./stack-local-locks.mjs")).patchLocalLockCapacity(
|
|
1114
|
+
readFileSync(join(worktreeRoot, "supabase", "config.toml"), "utf8"), opts.localMaxLocks,
|
|
1115
|
+
);
|
|
1098
1116
|
const execution = refuseRoot(resolveStackPath(cwd, materialize(
|
|
1099
1117
|
cwd,
|
|
1100
1118
|
{ slot: opts.slot, repo: opts.repo, ticket: opts.ticket, nonce, idleTtlSecs: opts.idleTtl ?? undefined },
|
|
1101
1119
|
// BOT-2403: a functions directory another writer replaced under this stack is reported.
|
|
1102
|
-
{ ...(portRegistryDir ? { portRegistryDir } : {}), warn },
|
|
1120
|
+
{ ...(portRegistryDir ? { portRegistryDir } : {}), ...(localConfig === undefined ? {} : { configText: localConfig }), warn },
|
|
1103
1121
|
)));
|
|
1104
1122
|
let originConfigText = null;
|
|
1105
1123
|
if (requesterOrigin) {
|