@band-app/server 0.46.0 → 0.48.0
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/client/_shell.html +0 -0
- package/dist/client/assets/{TerminalPanel-pkSSHqjB.js → TerminalPanel-DkQbk-aU.js} +1 -1
- package/dist/client/assets/{_basePickBy-30wa-B3K.js → _basePickBy-Dpp3dGrC.js} +1 -1
- package/dist/client/assets/{_baseUniq-DYFc8VYN.js → _baseUniq-CL7CCXzw.js} +1 -1
- package/dist/client/assets/{arc-aFj-W69O.js → arc-Dgc_RxlI.js} +1 -1
- package/dist/client/assets/{architectureDiagram-VXUJARFQ-CUH4fJYm.js → architectureDiagram-VXUJARFQ-CgG43jHE.js} +1 -1
- package/dist/client/assets/{blockDiagram-VD42YOAC-CRkquXXQ.js → blockDiagram-VD42YOAC-Bt7XXELu.js} +1 -1
- package/dist/client/assets/{c4Diagram-YG6GDRKO-CD-EJ5GA.js → c4Diagram-YG6GDRKO-BQwG7Gi0.js} +1 -1
- package/dist/client/assets/channel-BhaORH-2.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-VhYl9M0k.js → chunk-4BX2VUAB-BwFghqiW.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-BQC_5pzd.js → chunk-55IACEB6-C7yjJLc1.js} +1 -1
- package/dist/client/assets/{chunk-B4BG7PRW-C1FqesKA.js → chunk-B4BG7PRW-BaJd9PuL.js} +1 -1
- package/dist/client/assets/{chunk-DI55MBZ5-DYC7fpTc.js → chunk-DI55MBZ5-CElPgENm.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-DwHYZG2m.js → chunk-FMBD7UC4-D3qe2ywl.js} +1 -1
- package/dist/client/assets/{chunk-QN33PNHL-QrOgqJ2x.js → chunk-QN33PNHL-DStfzqTU.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-BfeDvyyD.js → chunk-QZHKN3VN-B1rMgEw-.js} +1 -1
- package/dist/client/assets/{chunk-TZMSLE5B-DqbFla-p.js → chunk-TZMSLE5B-BEcRDS9V.js} +1 -1
- package/dist/client/assets/classDiagram-2ON5EDUG-iB9V-fQK.js +1 -0
- package/dist/client/assets/classDiagram-v2-WZHVMYZB-iB9V-fQK.js +1 -0
- package/dist/client/assets/clone-UwjnYJkb.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-Dtr68WKY.js → cose-bilkent-S5V4N54A-DQnvhn8W.js} +1 -1
- package/dist/client/assets/{dagre-6UL2VRFP-DeO-jAE4.js → dagre-6UL2VRFP-Y6UFkfVj.js} +1 -1
- package/dist/client/assets/{diagram-PSM6KHXK-DIoKKrik.js → diagram-PSM6KHXK-Cn_p_oe9.js} +1 -1
- package/dist/client/assets/{diagram-QEK2KX5R-YSmrv8Ap.js → diagram-QEK2KX5R-CWHFM00-.js} +1 -1
- package/dist/client/assets/{diagram-S2PKOQOG-Bkn85uc6.js → diagram-S2PKOQOG-C0TgWCYA.js} +1 -1
- package/dist/client/assets/{erDiagram-Q2GNP2WA-BwNSRuDm.js → erDiagram-Q2GNP2WA-BP1po3AK.js} +1 -1
- package/dist/client/assets/{flowDiagram-NV44I4VS-Bi4yldps.js → flowDiagram-NV44I4VS-B5oUkhMT.js} +1 -1
- package/dist/client/assets/{ganttDiagram-JELNMOA3-BArJltql.js → ganttDiagram-JELNMOA3-C7DXX2RL.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-V2S2FVAM-DL2anp1a.js → gitGraphDiagram-V2S2FVAM-Dn30v3Fe.js} +1 -1
- package/dist/client/assets/{graph-CA6szdeU.js → graph-E5kkHB_s.js} +1 -1
- package/dist/client/assets/{highlighted-body-B3W2YXNL-Ce8JER1R.js → highlighted-body-B3W2YXNL-B2bPrtWU.js} +1 -1
- package/dist/client/assets/{index-C5m9KGZf.js → index-A7maATW7.js} +1 -1
- package/dist/client/assets/{index-Czi_pJOK.js → index-B-miY5Sp.js} +1 -1
- package/dist/client/assets/{index-DDvAHSPZ.js → index-B2f2Xih0.js} +1 -1
- package/dist/client/assets/{index-CSQuqpCk.js → index-BScD8646.js} +1 -1
- package/dist/client/assets/{index-DpxJvU7W.js → index-BlpyLCQK.js} +1 -1
- package/dist/client/assets/{index-8yx33Rgn.js → index-BuqiLymH.js} +1 -1
- package/dist/client/assets/{index-DeSewZzo.js → index-CVOnvTFc.js} +1 -1
- package/dist/client/assets/{index-BeG__tJz.js → index-CYUAdSi5.js} +1 -1
- package/dist/client/assets/{index-Cro4_Zyl.js → index-D50A2A_K.js} +1 -1
- package/dist/client/assets/{index-D757VVMZ.js → index-D6MDOO4K.js} +1 -1
- package/dist/client/assets/{index-BhEFhSvO.js → index-DKIwN46L.js} +1 -1
- package/dist/client/assets/{index-D-zrg5eL.js → index-DOWIe80D.js} +1 -1
- package/dist/client/assets/{index-4MpV9Rhm.js → index-DzUf0Wwy.js} +1 -1
- package/dist/client/assets/{infoDiagram-HS3SLOUP-opriBuJD.js → infoDiagram-HS3SLOUP-CoxVQgxs.js} +1 -1
- package/dist/client/assets/{journeyDiagram-XKPGCS4Q-t3TBG9zd.js → journeyDiagram-XKPGCS4Q-BUPqESWB.js} +1 -1
- package/dist/client/assets/{kanban-definition-3W4ZIXB7-D1KUbYAi.js → kanban-definition-3W4ZIXB7-DDooJc-Z.js} +1 -1
- package/dist/client/assets/{layout-BaSYphI5.js → layout-DQ2tNoC7.js} +1 -1
- package/dist/client/assets/{main-Bqsm7w7O.js → main-BbHA32iD.js} +274 -274
- package/dist/client/assets/main-Bump8gDQ.css +1 -0
- package/dist/client/assets/{mindmap-definition-VGOIOE7T-ChEtbA0z.js → mindmap-definition-VGOIOE7T-BBoouni0.js} +1 -1
- package/dist/client/assets/{pieDiagram-ADFJNKIX-D-2g15uY.js → pieDiagram-ADFJNKIX-DAO1Cf3O.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-AYHSOK5B-3I1XUOAj.js → quadrantDiagram-AYHSOK5B-CjJp6wOV.js} +1 -1
- package/dist/client/assets/{requirementDiagram-UZGBJVZJ-rSbxWkaA.js → requirementDiagram-UZGBJVZJ-CX3MPDiG.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-TZEHDZUN-C4ZbxfZu.js → sankeyDiagram-TZEHDZUN-Cqnsrnu8.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-WL72ISMW-Bjrx7GQ9.js → sequenceDiagram-WL72ISMW-CTJ2qJj_.js} +1 -1
- package/dist/client/assets/{stateDiagram-FKZM4ZOC-DmItUmdi.js → stateDiagram-FKZM4ZOC-Cy-jjqJZ.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-4FDKWEC3-CT80STo9.js +1 -0
- package/dist/client/assets/{timeline-definition-IT6M3QCI-C0WtBwwx.js → timeline-definition-IT6M3QCI-Bbb0ib0X.js} +1 -1
- package/dist/client/assets/{treemap-GDKQZRPO-B_sR8-qR.js → treemap-GDKQZRPO-DUB2cMCc.js} +1 -1
- package/dist/client/assets/{worktree._worktreeId-XB6R8O1k.js → worktree._worktreeId-CZWwGpYU.js} +1 -1
- package/dist/client/assets/{worktree._worktreeId-Dx83Amei.js → worktree._worktreeId-DSiEfzZW.js} +1 -1
- package/dist/client/assets/{xychartDiagram-PRI3JC2R-BgnyoF2_.js → xychartDiagram-PRI3JC2R-CI6Pnd76.js} +1 -1
- package/dist/migrations/20261012171800_follow_the_work/migration.sql +3 -0
- package/dist/migrations/20261012171800_follow_the_work/snapshot.json +4409 -0
- package/dist/migrations/20261012190000_agent_status_states/migration.sql +4 -0
- package/dist/migrations/20261012190000_agent_status_states/snapshot.json +4409 -0
- package/dist/openapi.json +1883 -187
- package/dist/start-server.mjs +12982 -11047
- package/dist/terminal-daemon.mjs +149 -55
- package/package.json +6 -6
- package/dist/client/assets/channel-i7vnUKiG.js +0 -1
- package/dist/client/assets/classDiagram-2ON5EDUG-QKheXL6H.js +0 -1
- package/dist/client/assets/classDiagram-v2-WZHVMYZB-QKheXL6H.js +0 -1
- package/dist/client/assets/clone-C6EEluIC.js +0 -1
- package/dist/client/assets/main-BXb3TLCw.css +0 -1
- package/dist/client/assets/stateDiagram-v2-4FDKWEC3-CABlMyog.js +0 -1
package/dist/terminal-daemon.mjs
CHANGED
|
@@ -1219,7 +1219,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1219
1219
|
var kContentModeUtf8 = "utf8";
|
|
1220
1220
|
var [major, minor] = (process.versions.node || "0.0").split(".").map(Number);
|
|
1221
1221
|
var kCopyBuffer = major >= 22 && minor >= 7;
|
|
1222
|
-
function openFile(
|
|
1222
|
+
function openFile(file2, sonic) {
|
|
1223
1223
|
sonic._opening = true;
|
|
1224
1224
|
sonic._writing = true;
|
|
1225
1225
|
sonic._asyncDrainScheduled = false;
|
|
@@ -1241,7 +1241,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1241
1241
|
}
|
|
1242
1242
|
const reopening = sonic._reopening;
|
|
1243
1243
|
sonic.fd = fd;
|
|
1244
|
-
sonic.file =
|
|
1244
|
+
sonic.file = file2;
|
|
1245
1245
|
sonic._reopening = false;
|
|
1246
1246
|
sonic._opening = false;
|
|
1247
1247
|
sonic._writing = false;
|
|
@@ -1263,20 +1263,20 @@ var require_sonic_boom = __commonJS({
|
|
|
1263
1263
|
const mode = sonic.mode;
|
|
1264
1264
|
if (sonic.sync) {
|
|
1265
1265
|
try {
|
|
1266
|
-
if (sonic.mkdir) fs.mkdirSync(path.dirname(
|
|
1267
|
-
const fd = fs.openSync(
|
|
1266
|
+
if (sonic.mkdir) fs.mkdirSync(path.dirname(file2), { recursive: true });
|
|
1267
|
+
const fd = fs.openSync(file2, flags, mode);
|
|
1268
1268
|
fileOpened(null, fd);
|
|
1269
1269
|
} catch (err) {
|
|
1270
1270
|
fileOpened(err);
|
|
1271
1271
|
throw err;
|
|
1272
1272
|
}
|
|
1273
1273
|
} else if (sonic.mkdir) {
|
|
1274
|
-
fs.mkdir(path.dirname(
|
|
1274
|
+
fs.mkdir(path.dirname(file2), { recursive: true }, (err) => {
|
|
1275
1275
|
if (err) return fileOpened(err);
|
|
1276
|
-
fs.open(
|
|
1276
|
+
fs.open(file2, flags, mode, fileOpened);
|
|
1277
1277
|
});
|
|
1278
1278
|
} else {
|
|
1279
|
-
fs.open(
|
|
1279
|
+
fs.open(file2, flags, mode, fileOpened);
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
function SonicBoom(opts) {
|
|
@@ -1582,13 +1582,13 @@ var require_sonic_boom = __commonJS({
|
|
|
1582
1582
|
}
|
|
1583
1583
|
this._actualWrite();
|
|
1584
1584
|
}
|
|
1585
|
-
SonicBoom.prototype.reopen = function(
|
|
1585
|
+
SonicBoom.prototype.reopen = function(file2) {
|
|
1586
1586
|
if (this.destroyed) {
|
|
1587
1587
|
throw new Error("SonicBoom destroyed");
|
|
1588
1588
|
}
|
|
1589
1589
|
if (this._opening) {
|
|
1590
1590
|
this.once("ready", () => {
|
|
1591
|
-
this.reopen(
|
|
1591
|
+
this.reopen(file2);
|
|
1592
1592
|
});
|
|
1593
1593
|
return;
|
|
1594
1594
|
}
|
|
@@ -1598,8 +1598,8 @@ var require_sonic_boom = __commonJS({
|
|
|
1598
1598
|
if (!this.file) {
|
|
1599
1599
|
throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");
|
|
1600
1600
|
}
|
|
1601
|
-
if (
|
|
1602
|
-
this.file =
|
|
1601
|
+
if (file2) {
|
|
1602
|
+
this.file = file2;
|
|
1603
1603
|
}
|
|
1604
1604
|
this._reopening = true;
|
|
1605
1605
|
if (this._writing) {
|
|
@@ -2216,7 +2216,7 @@ var require_thread_stream = __commonJS({
|
|
|
2216
2216
|
}
|
|
2217
2217
|
if (this[kImpl].flushing && this[kImpl].buf.length + data.length >= MAX_STRING) {
|
|
2218
2218
|
try {
|
|
2219
|
-
|
|
2219
|
+
writeSync2(this);
|
|
2220
2220
|
this[kImpl].flushing = true;
|
|
2221
2221
|
} catch (err) {
|
|
2222
2222
|
destroy(this, err);
|
|
@@ -2226,7 +2226,7 @@ var require_thread_stream = __commonJS({
|
|
|
2226
2226
|
this[kImpl].buf += data;
|
|
2227
2227
|
if (this[kImpl].sync) {
|
|
2228
2228
|
try {
|
|
2229
|
-
|
|
2229
|
+
writeSync2(this);
|
|
2230
2230
|
return true;
|
|
2231
2231
|
} catch (err) {
|
|
2232
2232
|
destroy(this, err);
|
|
@@ -2272,7 +2272,7 @@ var require_thread_stream = __commonJS({
|
|
|
2272
2272
|
if (this[kImpl].destroyed) {
|
|
2273
2273
|
return;
|
|
2274
2274
|
}
|
|
2275
|
-
|
|
2275
|
+
writeSync2(this);
|
|
2276
2276
|
flushSync(this);
|
|
2277
2277
|
}
|
|
2278
2278
|
unref() {
|
|
@@ -2376,7 +2376,7 @@ var require_thread_stream = __commonJS({
|
|
|
2376
2376
|
destroy(stream, err);
|
|
2377
2377
|
}
|
|
2378
2378
|
}
|
|
2379
|
-
function
|
|
2379
|
+
function writeSync2(stream) {
|
|
2380
2380
|
const cb = () => {
|
|
2381
2381
|
if (stream[kImpl].ending) {
|
|
2382
2382
|
end(stream);
|
|
@@ -8827,18 +8827,112 @@ import { parseArgs } from "node:util";
|
|
|
8827
8827
|
|
|
8828
8828
|
// ../../packages/logger/src/index.ts
|
|
8829
8829
|
var import_pino = __toESM(require_pino(), 1);
|
|
8830
|
+
import {
|
|
8831
|
+
closeSync,
|
|
8832
|
+
existsSync,
|
|
8833
|
+
mkdirSync,
|
|
8834
|
+
openSync,
|
|
8835
|
+
renameSync,
|
|
8836
|
+
rmSync,
|
|
8837
|
+
statSync,
|
|
8838
|
+
writeSync
|
|
8839
|
+
} from "node:fs";
|
|
8840
|
+
import { dirname } from "node:path";
|
|
8841
|
+
var DEFAULT_LOG_MAX_BYTES = 10 * 1024 * 1024;
|
|
8842
|
+
var DEFAULT_LOG_KEEP = 3;
|
|
8843
|
+
var RotatingFile = class {
|
|
8844
|
+
constructor(path, maxBytes = DEFAULT_LOG_MAX_BYTES, keep = DEFAULT_LOG_KEEP) {
|
|
8845
|
+
this.path = path;
|
|
8846
|
+
this.maxBytes = maxBytes;
|
|
8847
|
+
this.keep = keep;
|
|
8848
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
8849
|
+
if (existsSync(path) && statSync(path).size >= maxBytes) this.shift();
|
|
8850
|
+
this.open();
|
|
8851
|
+
}
|
|
8852
|
+
fd;
|
|
8853
|
+
size = 0;
|
|
8854
|
+
write(chunk) {
|
|
8855
|
+
const buf = typeof chunk === "string" ? Buffer.from(chunk) : chunk;
|
|
8856
|
+
if (this.fd === void 0) return;
|
|
8857
|
+
if (this.size > 0 && this.size + buf.length > this.maxBytes) {
|
|
8858
|
+
this.close();
|
|
8859
|
+
this.shift();
|
|
8860
|
+
this.open();
|
|
8861
|
+
}
|
|
8862
|
+
if (this.fd === void 0) return;
|
|
8863
|
+
try {
|
|
8864
|
+
writeSync(this.fd, buf);
|
|
8865
|
+
this.size += buf.length;
|
|
8866
|
+
} catch {
|
|
8867
|
+
}
|
|
8868
|
+
}
|
|
8869
|
+
close() {
|
|
8870
|
+
if (this.fd === void 0) return;
|
|
8871
|
+
try {
|
|
8872
|
+
closeSync(this.fd);
|
|
8873
|
+
} catch {
|
|
8874
|
+
}
|
|
8875
|
+
this.fd = void 0;
|
|
8876
|
+
}
|
|
8877
|
+
open() {
|
|
8878
|
+
try {
|
|
8879
|
+
this.fd = openSync(this.path, "a", 384);
|
|
8880
|
+
this.size = statSync(this.path).size;
|
|
8881
|
+
} catch {
|
|
8882
|
+
this.fd = void 0;
|
|
8883
|
+
}
|
|
8884
|
+
}
|
|
8885
|
+
shift() {
|
|
8886
|
+
try {
|
|
8887
|
+
const oldest = this.keep - 1;
|
|
8888
|
+
if (oldest < 1) {
|
|
8889
|
+
rmSync(this.path, { force: true });
|
|
8890
|
+
return;
|
|
8891
|
+
}
|
|
8892
|
+
rmSync(`${this.path}.${oldest}`, { force: true });
|
|
8893
|
+
for (let i = oldest - 1; i >= 1; i--) {
|
|
8894
|
+
if (existsSync(`${this.path}.${i}`))
|
|
8895
|
+
renameSync(`${this.path}.${i}`, `${this.path}.${i + 1}`);
|
|
8896
|
+
}
|
|
8897
|
+
renameSync(this.path, `${this.path}.1`);
|
|
8898
|
+
} catch {
|
|
8899
|
+
}
|
|
8900
|
+
}
|
|
8901
|
+
};
|
|
8902
|
+
var file;
|
|
8903
|
+
function logFile() {
|
|
8904
|
+
if (file) return file;
|
|
8905
|
+
const path = process.env.BAND_LOG_FILE;
|
|
8906
|
+
if (!path) return void 0;
|
|
8907
|
+
const max = Number(process.env.BAND_LOG_MAX_BYTES);
|
|
8908
|
+
const keep = Number(process.env.BAND_LOG_KEEP);
|
|
8909
|
+
const target = new RotatingFile(
|
|
8910
|
+
path,
|
|
8911
|
+
max > 0 ? max : DEFAULT_LOG_MAX_BYTES,
|
|
8912
|
+
keep >= 1 ? keep : DEFAULT_LOG_KEEP
|
|
8913
|
+
);
|
|
8914
|
+
for (const stream of [process.stdout, process.stderr]) {
|
|
8915
|
+
stream.write = ((chunk, ...rest) => {
|
|
8916
|
+
target.write(chunk);
|
|
8917
|
+
const cb = rest.find((r) => typeof r === "function");
|
|
8918
|
+
cb?.();
|
|
8919
|
+
return true;
|
|
8920
|
+
});
|
|
8921
|
+
}
|
|
8922
|
+
file = target;
|
|
8923
|
+
return target;
|
|
8924
|
+
}
|
|
8830
8925
|
function createLogger(name) {
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
});
|
|
8926
|
+
const options = { name, level: process.env.LOG_LEVEL || "info" };
|
|
8927
|
+
const target = logFile();
|
|
8928
|
+
return target ? (0, import_pino.default)(options, { write: (line) => target.write(line) }) : (0, import_pino.default)(options);
|
|
8835
8929
|
}
|
|
8836
8930
|
|
|
8837
8931
|
// ../../packages/host-local/src/terminals/daemon/daemon-server.ts
|
|
8838
8932
|
import { randomBytes as randomBytes2, timingSafeEqual } from "node:crypto";
|
|
8839
|
-
import { chmodSync as chmodSync2, lstatSync as lstatSync2, readFileSync as readFileSync3, renameSync as
|
|
8933
|
+
import { chmodSync as chmodSync2, lstatSync as lstatSync2, readFileSync as readFileSync3, renameSync as renameSync4, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
8840
8934
|
import { createServer } from "node:net";
|
|
8841
|
-
import { dirname as
|
|
8935
|
+
import { dirname as dirname4, join as join7 } from "node:path";
|
|
8842
8936
|
|
|
8843
8937
|
// ../../packages/host-local/src/terminals/node-pty-loader.ts
|
|
8844
8938
|
var cachedImport;
|
|
@@ -8849,19 +8943,19 @@ function preloadNodePty() {
|
|
|
8849
8943
|
|
|
8850
8944
|
// ../../packages/host-local/src/terminals/terminal-pool.ts
|
|
8851
8945
|
import { randomUUID } from "node:crypto";
|
|
8852
|
-
import { existsSync as
|
|
8946
|
+
import { existsSync as existsSync3, unlinkSync, writeFileSync } from "node:fs";
|
|
8853
8947
|
import { tmpdir } from "node:os";
|
|
8854
8948
|
import { join as join3, sep } from "node:path";
|
|
8855
8949
|
|
|
8856
8950
|
// ../../packages/host-local/src/process/path.ts
|
|
8857
8951
|
import { execFile } from "node:child_process";
|
|
8858
|
-
import { existsSync } from "node:fs";
|
|
8952
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
8859
8953
|
import { delimiter } from "node:path";
|
|
8860
8954
|
function defaultShell() {
|
|
8861
8955
|
if (process.env.SHELL) return process.env.SHELL;
|
|
8862
8956
|
if (process.platform === "win32") return process.env.ComSpec || "cmd.exe";
|
|
8863
8957
|
for (const candidate of ["/bin/zsh", "/bin/bash", "/bin/sh"]) {
|
|
8864
|
-
if (
|
|
8958
|
+
if (existsSync2(candidate)) return candidate;
|
|
8865
8959
|
}
|
|
8866
8960
|
return "/bin/sh";
|
|
8867
8961
|
}
|
|
@@ -8873,7 +8967,7 @@ function extraBinDirs() {
|
|
|
8873
8967
|
} else if (process.platform === "linux") {
|
|
8874
8968
|
const dirs = [];
|
|
8875
8969
|
const linuxbrew = "/home/linuxbrew/.linuxbrew/bin";
|
|
8876
|
-
if (
|
|
8970
|
+
if (existsSync2(linuxbrew)) dirs.push(linuxbrew);
|
|
8877
8971
|
dirs.push("/usr/local/bin");
|
|
8878
8972
|
cachedBinDirs = dirs;
|
|
8879
8973
|
} else {
|
|
@@ -8914,7 +9008,7 @@ async function shellPath() {
|
|
|
8914
9008
|
}
|
|
8915
9009
|
|
|
8916
9010
|
// ../../packages/host-local/src/terminals/claude-resume.ts
|
|
8917
|
-
import { readdirSync, statSync } from "node:fs";
|
|
9011
|
+
import { readdirSync, statSync as statSync2 } from "node:fs";
|
|
8918
9012
|
import { homedir } from "node:os";
|
|
8919
9013
|
import { join } from "node:path";
|
|
8920
9014
|
var CLAUDE_COMMAND_PATTERN = /^claude(\s|$)/;
|
|
@@ -8940,7 +9034,7 @@ function findLatestClaudeSessionId(cwd) {
|
|
|
8940
9034
|
for (const name of names) {
|
|
8941
9035
|
let mtimeMs;
|
|
8942
9036
|
try {
|
|
8943
|
-
mtimeMs =
|
|
9037
|
+
mtimeMs = statSync2(join(dir, name)).mtimeMs;
|
|
8944
9038
|
} catch {
|
|
8945
9039
|
continue;
|
|
8946
9040
|
}
|
|
@@ -8970,7 +9064,7 @@ function hintForPtySpawnError(err) {
|
|
|
8970
9064
|
}
|
|
8971
9065
|
|
|
8972
9066
|
// ../../packages/host-local/src/terminals/terminal-history.ts
|
|
8973
|
-
import { readdirSync as readdirSync2, readFileSync, rmSync } from "node:fs";
|
|
9067
|
+
import { readdirSync as readdirSync2, readFileSync, rmSync as rmSync2 } from "node:fs";
|
|
8974
9068
|
import { mkdir, rename, writeFile } from "node:fs/promises";
|
|
8975
9069
|
import { join as join2 } from "node:path";
|
|
8976
9070
|
var log = createLogger("terminal-history");
|
|
@@ -9013,7 +9107,7 @@ var TerminalHistoryManager = class {
|
|
|
9013
9107
|
/** Drop a terminal's saved history: its tab or worktree was actually closed or deleted. */
|
|
9014
9108
|
removeSession(terminalId) {
|
|
9015
9109
|
try {
|
|
9016
|
-
|
|
9110
|
+
rmSync2(this.sessionDir(terminalId), { recursive: true, force: true });
|
|
9017
9111
|
} catch (err) {
|
|
9018
9112
|
log.warn({ err, terminalId }, "failed to remove terminal history directory");
|
|
9019
9113
|
}
|
|
@@ -9037,7 +9131,7 @@ var TerminalHistoryManager = class {
|
|
|
9037
9131
|
const meta = readJson(join2(dir, "meta.json"));
|
|
9038
9132
|
if (meta?.worktreeId !== worktreeId) continue;
|
|
9039
9133
|
try {
|
|
9040
|
-
|
|
9134
|
+
rmSync2(dir, { recursive: true, force: true });
|
|
9041
9135
|
} catch (err) {
|
|
9042
9136
|
log.warn({ err, dir }, "failed to remove terminal history directory");
|
|
9043
9137
|
}
|
|
@@ -9209,10 +9303,10 @@ var TerminalPool = class {
|
|
|
9209
9303
|
checkpoint.cwd
|
|
9210
9304
|
) ?? cwd;
|
|
9211
9305
|
}
|
|
9212
|
-
if (!
|
|
9306
|
+
if (!existsSync3(cwd)) {
|
|
9213
9307
|
throw new Error(`Worktree directory does not exist: ${cwd}`);
|
|
9214
9308
|
}
|
|
9215
|
-
if (!
|
|
9309
|
+
if (!existsSync3(shell)) {
|
|
9216
9310
|
throw new Error(`Shell not found: ${shell}`);
|
|
9217
9311
|
}
|
|
9218
9312
|
log2.debug(
|
|
@@ -9862,7 +9956,7 @@ function resolveSafeCwd(candidate, worktreeRoot, label, original) {
|
|
|
9862
9956
|
log2.warn("Ignoring %s %s \u2014 resolves outside worktree root %s", label, original, worktreeRoot);
|
|
9863
9957
|
return null;
|
|
9864
9958
|
}
|
|
9865
|
-
if (!
|
|
9959
|
+
if (!existsSync3(candidate)) {
|
|
9866
9960
|
log2.warn("Ignoring %s %s \u2014 directory does not exist", label, original);
|
|
9867
9961
|
return null;
|
|
9868
9962
|
}
|
|
@@ -9875,13 +9969,13 @@ import {
|
|
|
9875
9969
|
chmodSync,
|
|
9876
9970
|
linkSync,
|
|
9877
9971
|
lstatSync,
|
|
9878
|
-
mkdirSync,
|
|
9879
|
-
renameSync,
|
|
9880
|
-
statSync as
|
|
9972
|
+
mkdirSync as mkdirSync2,
|
|
9973
|
+
renameSync as renameSync2,
|
|
9974
|
+
statSync as statSync3,
|
|
9881
9975
|
unlinkSync as unlinkSync2
|
|
9882
9976
|
} from "node:fs";
|
|
9883
9977
|
import { connect } from "node:net";
|
|
9884
|
-
import { dirname, join as join4 } from "node:path";
|
|
9978
|
+
import { dirname as dirname2, join as join4 } from "node:path";
|
|
9885
9979
|
var PROBE_TIMEOUT_MS = 500;
|
|
9886
9980
|
var PUBLISH_ATTEMPTS = 3;
|
|
9887
9981
|
function isProvenDead(outcome) {
|
|
@@ -9916,10 +10010,10 @@ function probeEndpoint(socketPath) {
|
|
|
9916
10010
|
});
|
|
9917
10011
|
}
|
|
9918
10012
|
function privateBindPath(socketPath) {
|
|
9919
|
-
return join4(
|
|
10013
|
+
return join4(dirname2(socketPath), `.p${randomBytes(5).toString("hex")}`);
|
|
9920
10014
|
}
|
|
9921
10015
|
async function publishEndpoint(boundPath, canonicalPath, supersede) {
|
|
9922
|
-
const identity = entryIdentity(boundPath,
|
|
10016
|
+
const identity = entryIdentity(boundPath, statSync3);
|
|
9923
10017
|
if (!identity) throw new Error(`Cannot stat the bound daemon socket at ${boundPath}`);
|
|
9924
10018
|
for (let attempt = 0; attempt < PUBLISH_ATTEMPTS; attempt++) {
|
|
9925
10019
|
try {
|
|
@@ -9927,7 +10021,7 @@ async function publishEndpoint(boundPath, canonicalPath, supersede) {
|
|
|
9927
10021
|
} catch (err) {
|
|
9928
10022
|
if (errorCode(err) !== "EEXIST") throw err;
|
|
9929
10023
|
if (supersede && retireIncumbent(canonicalPath, supersede)) {
|
|
9930
|
-
|
|
10024
|
+
renameSync2(boundPath, canonicalPath);
|
|
9931
10025
|
return confirmPublished(canonicalPath, identity, true);
|
|
9932
10026
|
}
|
|
9933
10027
|
const replaced = await replaceProvenDead(boundPath, canonicalPath);
|
|
@@ -9953,7 +10047,7 @@ async function replaceProvenDead(boundPath, canonicalPath) {
|
|
|
9953
10047
|
const second = await probeEndpoint(canonicalPath);
|
|
9954
10048
|
if (second === "connected") return { status: "occupied" };
|
|
9955
10049
|
if (!isProvenDead(second)) return { status: "inconclusive" };
|
|
9956
|
-
|
|
10050
|
+
renameSync2(boundPath, canonicalPath);
|
|
9957
10051
|
return "renamed";
|
|
9958
10052
|
}
|
|
9959
10053
|
function retireIncumbent(canonicalPath, supersede) {
|
|
@@ -9976,7 +10070,7 @@ function sameEntry(a, b) {
|
|
|
9976
10070
|
function confirmPublished(canonicalPath, identity, superseded) {
|
|
9977
10071
|
let published;
|
|
9978
10072
|
try {
|
|
9979
|
-
const stats =
|
|
10073
|
+
const stats = statSync3(canonicalPath, { bigint: true });
|
|
9980
10074
|
published = { dev: stats.dev, ino: stats.ino };
|
|
9981
10075
|
} catch (err) {
|
|
9982
10076
|
return errorCode(err) === "ENOENT" ? { status: "lost" } : { status: "inconclusive" };
|
|
@@ -9985,14 +10079,14 @@ function confirmPublished(canonicalPath, identity, superseded) {
|
|
|
9985
10079
|
}
|
|
9986
10080
|
function endpointOwnership(canonicalPath, owned) {
|
|
9987
10081
|
try {
|
|
9988
|
-
const stats =
|
|
10082
|
+
const stats = statSync3(canonicalPath, { bigint: true });
|
|
9989
10083
|
return stats.dev === owned.dev && stats.ino === owned.ino ? "owned" : "lost";
|
|
9990
10084
|
} catch (err) {
|
|
9991
10085
|
return errorCode(err) === "ENOENT" ? "lost" : "indeterminate";
|
|
9992
10086
|
}
|
|
9993
10087
|
}
|
|
9994
10088
|
function ensurePrivateDir(dir) {
|
|
9995
|
-
|
|
10089
|
+
mkdirSync2(dir, { recursive: true, mode: 448 });
|
|
9996
10090
|
const stats = lstatSync(dir);
|
|
9997
10091
|
const uid = process.getuid?.();
|
|
9998
10092
|
if (!stats.isDirectory()) throw new Error(`${dir} is not a directory`);
|
|
@@ -10013,10 +10107,10 @@ function errorCode(err) {
|
|
|
10013
10107
|
|
|
10014
10108
|
// ../../packages/host-local/src/terminals/daemon/exit-records.ts
|
|
10015
10109
|
import {
|
|
10016
|
-
mkdirSync as
|
|
10110
|
+
mkdirSync as mkdirSync3,
|
|
10017
10111
|
readdirSync as readdirSync3,
|
|
10018
10112
|
readFileSync as readFileSync2,
|
|
10019
|
-
renameSync as
|
|
10113
|
+
renameSync as renameSync3,
|
|
10020
10114
|
unlinkSync as unlinkSync3,
|
|
10021
10115
|
writeFileSync as writeFileSync2
|
|
10022
10116
|
} from "node:fs";
|
|
@@ -10027,16 +10121,16 @@ function exitsDir(runDir) {
|
|
|
10027
10121
|
}
|
|
10028
10122
|
function writeExitRecord(runDir, event) {
|
|
10029
10123
|
const dir = exitsDir(runDir);
|
|
10030
|
-
|
|
10031
|
-
const
|
|
10032
|
-
const tmp = `${
|
|
10124
|
+
mkdirSync3(dir, { recursive: true, mode: 448 });
|
|
10125
|
+
const file2 = join5(dir, `${encodeURIComponent(event.terminalId)}.json`);
|
|
10126
|
+
const tmp = `${file2}.tmp`;
|
|
10033
10127
|
writeFileSync2(tmp, JSON.stringify(event), { mode: 384 });
|
|
10034
|
-
|
|
10128
|
+
renameSync3(tmp, file2);
|
|
10035
10129
|
}
|
|
10036
10130
|
|
|
10037
10131
|
// ../../packages/host-local/src/terminals/daemon/protocol.ts
|
|
10038
10132
|
import { createHash } from "node:crypto";
|
|
10039
|
-
import { basename, dirname as
|
|
10133
|
+
import { basename, dirname as dirname3, join as join6 } from "node:path";
|
|
10040
10134
|
var PROTOCOL_VERSION = 3;
|
|
10041
10135
|
var EXIT_ENDPOINT_OCCUPIED = 20;
|
|
10042
10136
|
var EXIT_ENDPOINT_UNAVAILABLE = 21;
|
|
@@ -10060,7 +10154,7 @@ function daemonPaths(runDir, version = PROTOCOL_VERSION) {
|
|
|
10060
10154
|
function retiredDaemonPaths(paths, tag) {
|
|
10061
10155
|
return {
|
|
10062
10156
|
...paths,
|
|
10063
|
-
socket: join6(
|
|
10157
|
+
socket: join6(dirname3(paths.socket), `.r${tag}`),
|
|
10064
10158
|
token: paths.token.replace(/\.token$/, `.retired-${tag}.token`),
|
|
10065
10159
|
pid: paths.pid.replace(/\.pid$/, `.retired-${tag}.pid`)
|
|
10066
10160
|
};
|
|
@@ -10130,9 +10224,9 @@ async function runDaemon(options) {
|
|
|
10130
10224
|
return EXIT_NODE_PTY_UNAVAILABLE;
|
|
10131
10225
|
}
|
|
10132
10226
|
ensurePrivateDir(paths.runDir);
|
|
10133
|
-
ensurePrivateDir(
|
|
10227
|
+
ensurePrivateDir(dirname4(paths.socket));
|
|
10134
10228
|
const token = randomBytes2(32).toString("hex");
|
|
10135
|
-
const pool = new TerminalPool({ historyDir: join7(
|
|
10229
|
+
const pool = new TerminalPool({ historyDir: join7(dirname4(paths.runDir), "terminal-history") });
|
|
10136
10230
|
const clients = /* @__PURE__ */ new Map();
|
|
10137
10231
|
let shuttingDown = false;
|
|
10138
10232
|
let openConnections = 0;
|
|
@@ -10539,7 +10633,7 @@ function parseHello(frame) {
|
|
|
10539
10633
|
function writePrivateFile(path, content) {
|
|
10540
10634
|
const tmp = `${path}.${randomBytes2(4).toString("hex")}.tmp`;
|
|
10541
10635
|
writeFileSync3(tmp, content, { mode: 384 });
|
|
10542
|
-
|
|
10636
|
+
renameSync4(tmp, path);
|
|
10543
10637
|
}
|
|
10544
10638
|
function copyPrivateFile(from, to) {
|
|
10545
10639
|
let content;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@band-app/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"vitest": "^4.0.18",
|
|
58
58
|
"ws": "^8.18.0",
|
|
59
59
|
"zod": "^3.25.67",
|
|
60
|
-
"@band-app/coding-agent": "^0.
|
|
60
|
+
"@band-app/coding-agent": "^0.48.0",
|
|
61
61
|
"@band-app/environment": "^0.1.0",
|
|
62
62
|
"@band-app/host-local": "^0.1.0",
|
|
63
|
-
"@band-app/host-remote": "^0.1.0",
|
|
64
|
-
"@band-app/host-api": "^0.1.0",
|
|
65
63
|
"@band-app/link": "^0.1.0",
|
|
64
|
+
"@band-app/host-api": "^0.1.0",
|
|
65
|
+
"@band-app/host-remote": "^0.1.0",
|
|
66
|
+
"@band-app/logger": "^0.48.0",
|
|
66
67
|
"@band-app/plugin-api": "^0.1.0",
|
|
67
|
-
"@band-app/plugin-github": "^0.1.0",
|
|
68
68
|
"@band-app/shared": "^0.1.0",
|
|
69
|
-
"@band-app/
|
|
69
|
+
"@band-app/plugin-github": "^0.1.0"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"dev": "NODE_ENV=development tsx watch --exclude '../web/**' start-server.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as a,Z as n}from"./main-Bqsm7w7O.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-C1FqesKA.js";import{_ as i}from"./main-Bqsm7w7O.js";import"./chunk-FMBD7UC4-DwHYZG2m.js";import"./chunk-55IACEB6-BQC_5pzd.js";import"./chunk-QN33PNHL-QrOgqJ2x.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-C1FqesKA.js";import{_ as i}from"./main-Bqsm7w7O.js";import"./chunk-FMBD7UC4-DwHYZG2m.js";import"./chunk-55IACEB6-BQC_5pzd.js";import"./chunk-QN33PNHL-QrOgqJ2x.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./_baseUniq-DYFc8VYN.js";var e=4;function a(o){return r(o,e)}export{a as c};
|