@band-app/server 0.60.0 → 0.60.1
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-B15ghqjC.js → TerminalPanel-C2ewe-bN.js} +1 -1
- package/dist/client/assets/{_basePickBy-DnTEmDSj.js → _basePickBy-Dfft9U2Y.js} +1 -1
- package/dist/client/assets/{_baseUniq-vhCiyIYf.js → _baseUniq-VT-Fvpwa.js} +1 -1
- package/dist/client/assets/{arc-CZ4Bw9uS.js → arc-IQNCYyHi.js} +1 -1
- package/dist/client/assets/{architectureDiagram-VXUJARFQ-CvqgWcYx.js → architectureDiagram-VXUJARFQ-CEeXYnM1.js} +1 -1
- package/dist/client/assets/{blockDiagram-VD42YOAC-D8REfakL.js → blockDiagram-VD42YOAC-D8t34_qE.js} +1 -1
- package/dist/client/assets/{c4Diagram-YG6GDRKO-BIgJnhrx.js → c4Diagram-YG6GDRKO-Bac4BHFl.js} +1 -1
- package/dist/client/assets/channel-CFIprjUA.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-BO8PrQP3.js → chunk-4BX2VUAB-8OgHJjso.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-DO5fHd1T.js → chunk-55IACEB6-1q6zldbT.js} +1 -1
- package/dist/client/assets/{chunk-B4BG7PRW-CAtAtkCf.js → chunk-B4BG7PRW-CyB0YChj.js} +1 -1
- package/dist/client/assets/{chunk-DI55MBZ5-DRnZO_Tx.js → chunk-DI55MBZ5-CbH2Vi7l.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-DzqqzV_F.js → chunk-FMBD7UC4-DChsRBYo.js} +1 -1
- package/dist/client/assets/{chunk-QN33PNHL-DETRpC4Q.js → chunk-QN33PNHL-CCiqRxGJ.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-D6X6jOAA.js → chunk-QZHKN3VN-DSknJcWz.js} +1 -1
- package/dist/client/assets/{chunk-TZMSLE5B-C8IfJ5NA.js → chunk-TZMSLE5B-Dntdjhjx.js} +1 -1
- package/dist/client/assets/classDiagram-2ON5EDUG-BZeh-LMx.js +1 -0
- package/dist/client/assets/classDiagram-v2-WZHVMYZB-BZeh-LMx.js +1 -0
- package/dist/client/assets/clone-DTnLV01L.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-DMKRB7Bs.js → cose-bilkent-S5V4N54A-Dpk2C2KC.js} +1 -1
- package/dist/client/assets/{dagre-6UL2VRFP-C_cXM9p2.js → dagre-6UL2VRFP-BxmsX_AF.js} +1 -1
- package/dist/client/assets/{diagram-PSM6KHXK-D_A2BJh_.js → diagram-PSM6KHXK-Cese24hg.js} +1 -1
- package/dist/client/assets/{diagram-QEK2KX5R-BnKjlyrI.js → diagram-QEK2KX5R-Lux1tuP-.js} +1 -1
- package/dist/client/assets/{diagram-S2PKOQOG-R4tiwc1I.js → diagram-S2PKOQOG-Da29vVFh.js} +1 -1
- package/dist/client/assets/{erDiagram-Q2GNP2WA-CNV08IQO.js → erDiagram-Q2GNP2WA-COz-Bxty.js} +1 -1
- package/dist/client/assets/{flowDiagram-NV44I4VS-BAXwfe4s.js → flowDiagram-NV44I4VS-2AOhgtfg.js} +1 -1
- package/dist/client/assets/{ganttDiagram-JELNMOA3-Bk3PXBP9.js → ganttDiagram-JELNMOA3-CvaV3At7.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-V2S2FVAM-C8tujQgm.js → gitGraphDiagram-V2S2FVAM-KL6lDevE.js} +1 -1
- package/dist/client/assets/{graph-BIBqorc8.js → graph-BkqeF57r.js} +1 -1
- package/dist/client/assets/{highlighted-body-B3W2YXNL-NymhDWI2.js → highlighted-body-B3W2YXNL-BKvFJmoF.js} +1 -1
- package/dist/client/assets/{index-Dg2MZcDG.js → index-1IWusiUu.js} +1 -1
- package/dist/client/assets/{index-BvS6Fo_E.js → index-B5-KuoCn.js} +1 -1
- package/dist/client/assets/{index-D9qmTeqK.js → index-BERL9iqq.js} +1 -1
- package/dist/client/assets/{index-DJlBcjuS.js → index-Bh02-TAC.js} +1 -1
- package/dist/client/assets/{index-Dc6DOl2V.js → index-By0VjYTD.js} +1 -1
- package/dist/client/assets/{index-DSUNlkvo.js → index-C6ii9XZB.js} +1 -1
- package/dist/client/assets/{index-Cqclrque.js → index-Cg0ZZSF_.js} +1 -1
- package/dist/client/assets/{index-PQDlzdDe.js → index-CjIZcCsd.js} +1 -1
- package/dist/client/assets/{index-C6Buf5vO.js → index-CrWN-rZL.js} +1 -1
- package/dist/client/assets/{index-secZqOa5.js → index-Cunx_dNp.js} +1 -1
- package/dist/client/assets/{index-BYzUhLmm.js → index-GqTH-hCs.js} +1 -1
- package/dist/client/assets/{index-BKBEQAUS.js → index-elgH9x1b.js} +1 -1
- package/dist/client/assets/{index-BYs8YaN9.js → index-oW3oul3c.js} +1 -1
- package/dist/client/assets/{infoDiagram-HS3SLOUP-GzU-nr0a.js → infoDiagram-HS3SLOUP-B_qM6pDv.js} +1 -1
- package/dist/client/assets/{journeyDiagram-XKPGCS4Q-Dv_GZIcq.js → journeyDiagram-XKPGCS4Q-DTM3hwpa.js} +1 -1
- package/dist/client/assets/{kanban-definition-3W4ZIXB7-BuCDku9Z.js → kanban-definition-3W4ZIXB7-B-SYRVBz.js} +1 -1
- package/dist/client/assets/{layout-C1BWvm3U.js → layout-BKMHlUnr.js} +1 -1
- package/dist/client/assets/{main-CW1tJAHn.js → main-DFazIJQl.js} +188 -188
- package/dist/client/assets/{mindmap-definition-VGOIOE7T-D-ySOJ80.js → mindmap-definition-VGOIOE7T-Dt3thgpD.js} +1 -1
- package/dist/client/assets/{pieDiagram-ADFJNKIX-BCPXro4s.js → pieDiagram-ADFJNKIX-5PIGWxue.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-AYHSOK5B-6iX-Hvg-.js → quadrantDiagram-AYHSOK5B-4zkd2IVs.js} +1 -1
- package/dist/client/assets/{requirementDiagram-UZGBJVZJ-CZu5itKP.js → requirementDiagram-UZGBJVZJ-DjXgbXXX.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-TZEHDZUN-C7dzQDVd.js → sankeyDiagram-TZEHDZUN-G9X9dJMl.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-WL72ISMW-Q9GYKo64.js → sequenceDiagram-WL72ISMW-gEn86t4_.js} +1 -1
- package/dist/client/assets/{stateDiagram-FKZM4ZOC-DcAjq5pM.js → stateDiagram-FKZM4ZOC-BKnMRzie.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-4FDKWEC3-Be9VMvTq.js +1 -0
- package/dist/client/assets/{timeline-definition-IT6M3QCI-CkyryJCh.js → timeline-definition-IT6M3QCI-CZWSQmlt.js} +1 -1
- package/dist/client/assets/{treemap-GDKQZRPO-BW9t3c2Z.js → treemap-GDKQZRPO-BL3I0InS.js} +1 -1
- package/dist/client/assets/{worktree._worktreeId-CWpDyVL-.js → worktree._worktreeId-BdiLGtrz.js} +1 -1
- package/dist/client/assets/{worktree._worktreeId-BvQb_KmW.js → worktree._worktreeId-DbLgzjwP.js} +1 -1
- package/dist/client/assets/{xychartDiagram-PRI3JC2R-DxUmnBlk.js → xychartDiagram-PRI3JC2R-CcsXglTm.js} +1 -1
- package/dist/openapi.json +77 -0
- package/dist/start-server.mjs +114 -34
- package/package.json +10 -10
- package/dist/client/assets/channel-DaBOqDcm.js +0 -1
- package/dist/client/assets/classDiagram-2ON5EDUG-CovRsOYg.js +0 -1
- package/dist/client/assets/classDiagram-v2-WZHVMYZB-CovRsOYg.js +0 -1
- package/dist/client/assets/clone-CEAieby9.js +0 -1
- package/dist/client/assets/stateDiagram-v2-4FDKWEC3-D0LqsI9r.js +0 -1
package/dist/start-server.mjs
CHANGED
|
@@ -4323,11 +4323,11 @@ var require_pino = __commonJS({
|
|
|
4323
4323
|
depthLimit: 5,
|
|
4324
4324
|
edgeLimit: 100
|
|
4325
4325
|
};
|
|
4326
|
-
var
|
|
4326
|
+
var normalize4 = createArgsNormalizer(defaultOptions2);
|
|
4327
4327
|
var serializers = Object.assign(/* @__PURE__ */ Object.create(null), stdSerializers);
|
|
4328
4328
|
function pino2(...args) {
|
|
4329
4329
|
const instance = {};
|
|
4330
|
-
const { opts, stream } =
|
|
4330
|
+
const { opts, stream } = normalize4(instance, caller(), ...args);
|
|
4331
4331
|
if (opts.level && typeof opts.level === "string" && DEFAULT_LEVELS[opts.level.toLowerCase()] !== void 0) opts.level = opts.level.toLowerCase();
|
|
4332
4332
|
const {
|
|
4333
4333
|
redact,
|
|
@@ -48171,27 +48171,27 @@ from generate_subscripts(${name5}, ${sql2.raw(dim.toString())}) ${aliases[dim -
|
|
|
48171
48171
|
order by ${aliases[dim - 1]})`;
|
|
48172
48172
|
return sql2`case when ${name5} is null then null else ${expression} end`;
|
|
48173
48173
|
};
|
|
48174
|
-
arrayCompatNormalize = (
|
|
48174
|
+
arrayCompatNormalize = (normalize4) => {
|
|
48175
48175
|
const loop = (value, arrayDimensions) => {
|
|
48176
48176
|
const innerDimensions = arrayDimensions - 1;
|
|
48177
48177
|
if (arrayDimensions > 1) for (let i = 0; i < value.length; ++i) loop(value[i], innerDimensions);
|
|
48178
|
-
else for (let i = 0; i < value.length; ++i) value[i] =
|
|
48178
|
+
else for (let i = 0; i < value.length; ++i) value[i] = normalize4(value[i]);
|
|
48179
48179
|
return value;
|
|
48180
48180
|
};
|
|
48181
48181
|
return loop;
|
|
48182
48182
|
};
|
|
48183
|
-
arrayCompatNormalizeInput = (
|
|
48183
|
+
arrayCompatNormalizeInput = (normalize4, transformToPgArray = false) => {
|
|
48184
48184
|
const loop = (value, arrayDimensions) => {
|
|
48185
48185
|
const innerDimensions = arrayDimensions - 1;
|
|
48186
48186
|
const out = Array.from({ length: value.length });
|
|
48187
48187
|
if (arrayDimensions > 1) for (let i = 0; i < value.length; ++i) out[i] = loop(value[i], innerDimensions);
|
|
48188
|
-
else for (let i = 0; i < value.length; ++i) out[i] =
|
|
48188
|
+
else for (let i = 0; i < value.length; ++i) out[i] = normalize4(value[i]);
|
|
48189
48189
|
return out;
|
|
48190
48190
|
};
|
|
48191
48191
|
return transformToPgArray ? (v2, d) => makePgArray(loop(v2, d)) : loop;
|
|
48192
48192
|
};
|
|
48193
|
-
parsePgArrayAndNormalize = (
|
|
48194
|
-
const codec2 = arrayCompatNormalize(
|
|
48193
|
+
parsePgArrayAndNormalize = (normalize4) => {
|
|
48194
|
+
const codec2 = arrayCompatNormalize(normalize4);
|
|
48195
48195
|
return (value, arrayDimensions) => codec2(parsePgArray(value), arrayDimensions);
|
|
48196
48196
|
};
|
|
48197
48197
|
parseLineTuple = (v2) => {
|
|
@@ -88785,8 +88785,8 @@ var require_resolve = __commonJS({
|
|
|
88785
88785
|
}
|
|
88786
88786
|
return count3;
|
|
88787
88787
|
}
|
|
88788
|
-
function getFullPath(resolver, id = "",
|
|
88789
|
-
if (
|
|
88788
|
+
function getFullPath(resolver, id = "", normalize4) {
|
|
88789
|
+
if (normalize4 !== false)
|
|
88790
88790
|
id = normalizeId(id);
|
|
88791
88791
|
const p2 = resolver.parse(id);
|
|
88792
88792
|
return _getFullPath(resolver, p2);
|
|
@@ -90126,7 +90126,7 @@ var require_fast_uri = __commonJS({
|
|
|
90126
90126
|
"use strict";
|
|
90127
90127
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
|
|
90128
90128
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
90129
|
-
function
|
|
90129
|
+
function normalize4(uri, options) {
|
|
90130
90130
|
if (typeof uri === "string") {
|
|
90131
90131
|
uri = /** @type {T} */
|
|
90132
90132
|
serialize2(parse8(uri, options), options);
|
|
@@ -90362,7 +90362,7 @@ var require_fast_uri = __commonJS({
|
|
|
90362
90362
|
}
|
|
90363
90363
|
var fastUri = {
|
|
90364
90364
|
SCHEMES,
|
|
90365
|
-
normalize:
|
|
90365
|
+
normalize: normalize4,
|
|
90366
90366
|
resolve: resolve16,
|
|
90367
90367
|
resolveComponent,
|
|
90368
90368
|
equal,
|
|
@@ -114731,7 +114731,7 @@ init_registry();
|
|
|
114731
114731
|
// package.json
|
|
114732
114732
|
var package_default = {
|
|
114733
114733
|
name: "@band-app/server",
|
|
114734
|
-
version: "0.60.
|
|
114734
|
+
version: "0.60.1",
|
|
114735
114735
|
type: "module",
|
|
114736
114736
|
types: "src/index.ts",
|
|
114737
114737
|
exports: {
|
|
@@ -123459,18 +123459,53 @@ var directOps = {
|
|
|
123459
123459
|
init_dist();
|
|
123460
123460
|
init_zod();
|
|
123461
123461
|
|
|
123462
|
-
// src/server/services/_utils/worktree-
|
|
123462
|
+
// src/server/services/_utils/worktree-download-link.ts
|
|
123463
123463
|
init_state();
|
|
123464
123464
|
import { createHmac as createHmac2, timingSafeEqual as timingSafeEqual8 } from "node:crypto";
|
|
123465
|
+
var WORKTREE_DOWNLOAD_PREFIX = "/api/worktree-download/";
|
|
123466
|
+
var DOWNLOAD_TTL_MS = 5 * 60 * 1e3;
|
|
123467
|
+
function signingKey() {
|
|
123468
|
+
const token = resolveAdminToken(process.env.BAND_ADMIN_TOKEN).token;
|
|
123469
|
+
return createHmac2("sha256", token).update("worktree-download-v1").digest();
|
|
123470
|
+
}
|
|
123471
|
+
function normalize3(path2) {
|
|
123472
|
+
return path2.replace(/^\/+/, "");
|
|
123473
|
+
}
|
|
123474
|
+
function sign(worktreeId4, path2, expiresAt) {
|
|
123475
|
+
return createHmac2("sha256", signingKey()).update(`${worktreeId4}
|
|
123476
|
+
${normalize3(path2)}
|
|
123477
|
+
${expiresAt}`).digest("hex");
|
|
123478
|
+
}
|
|
123479
|
+
function worktreeDownloadUrl(worktreeId4, path2, now = Date.now()) {
|
|
123480
|
+
const expiresAt = now + DOWNLOAD_TTL_MS;
|
|
123481
|
+
const grant = `${expiresAt}.${sign(worktreeId4, path2, expiresAt)}`;
|
|
123482
|
+
const encodedPath = normalize3(path2).split("/").map(encodeURIComponent).join("/");
|
|
123483
|
+
return `${WORKTREE_DOWNLOAD_PREFIX}${encodeURIComponent(worktreeId4)}/${grant}/${encodedPath}`;
|
|
123484
|
+
}
|
|
123485
|
+
function verifyWorktreeDownloadGrant(worktreeId4, grant, filePath, now = Date.now()) {
|
|
123486
|
+
if (filePath.includes("\0")) return false;
|
|
123487
|
+
const [expiry, signature, ...extra] = grant.split(".");
|
|
123488
|
+
const expiresAt = Number(expiry);
|
|
123489
|
+
if (extra.length > 0 || !signature || !Number.isSafeInteger(expiresAt) || expiresAt < now) {
|
|
123490
|
+
return false;
|
|
123491
|
+
}
|
|
123492
|
+
const expected = Buffer.from(sign(worktreeId4, filePath, expiresAt), "hex");
|
|
123493
|
+
const given = Buffer.from(signature, "hex");
|
|
123494
|
+
return given.length === expected.length && timingSafeEqual8(given, expected);
|
|
123495
|
+
}
|
|
123496
|
+
|
|
123497
|
+
// src/server/services/_utils/worktree-preview-link.ts
|
|
123498
|
+
init_state();
|
|
123499
|
+
import { createHmac as createHmac3, timingSafeEqual as timingSafeEqual9 } from "node:crypto";
|
|
123465
123500
|
import { posix as posix10 } from "node:path";
|
|
123466
123501
|
var WORKTREE_PREVIEW_PREFIX = "/api/worktree-preview/";
|
|
123467
123502
|
var PREVIEW_TTL_MS = 60 * 60 * 1e3;
|
|
123468
|
-
function
|
|
123503
|
+
function signingKey2() {
|
|
123469
123504
|
const token = resolveAdminToken(process.env.BAND_ADMIN_TOKEN).token;
|
|
123470
|
-
return
|
|
123505
|
+
return createHmac3("sha256", token).update("worktree-preview-v1").digest();
|
|
123471
123506
|
}
|
|
123472
|
-
function
|
|
123473
|
-
return
|
|
123507
|
+
function sign2(worktreeId4, dir, expiresAt) {
|
|
123508
|
+
return createHmac3("sha256", signingKey2()).update(`${worktreeId4}
|
|
123474
123509
|
${dir}
|
|
123475
123510
|
${expiresAt}`).digest("hex");
|
|
123476
123511
|
}
|
|
@@ -123479,7 +123514,7 @@ function worktreePreviewUrl(worktreeId4, path2, now = Date.now()) {
|
|
|
123479
123514
|
const dir = posix10.dirname(path2.replace(/^\/+/, ""));
|
|
123480
123515
|
const encodedDir = Buffer.from(dir, "utf8").toString("base64url");
|
|
123481
123516
|
const encodedPath = path2.split("/").map(encodeURIComponent).join("/");
|
|
123482
|
-
const grant = `${expiresAt}.${encodedDir}.${
|
|
123517
|
+
const grant = `${expiresAt}.${encodedDir}.${sign2(worktreeId4, dir, expiresAt)}`;
|
|
123483
123518
|
return `${WORKTREE_PREVIEW_PREFIX}${encodeURIComponent(worktreeId4)}/${grant}/${encodedPath}`;
|
|
123484
123519
|
}
|
|
123485
123520
|
function verifyWorktreePreviewGrant(worktreeId4, grant, filePath, now = Date.now()) {
|
|
@@ -123490,9 +123525,9 @@ function verifyWorktreePreviewGrant(worktreeId4, grant, filePath, now = Date.now
|
|
|
123490
123525
|
return false;
|
|
123491
123526
|
}
|
|
123492
123527
|
const dir = Buffer.from(encodedDir, "base64url").toString("utf8");
|
|
123493
|
-
const expected = Buffer.from(
|
|
123528
|
+
const expected = Buffer.from(sign2(worktreeId4, dir, expiresAt), "hex");
|
|
123494
123529
|
const given = Buffer.from(signature, "hex");
|
|
123495
|
-
if (given.length !== expected.length || !
|
|
123530
|
+
if (given.length !== expected.length || !timingSafeEqual9(given, expected)) return false;
|
|
123496
123531
|
const target = posix10.normalize(filePath.replace(/^\/+/, ""));
|
|
123497
123532
|
if (target === ".." || target.startsWith("../")) return false;
|
|
123498
123533
|
return dir === "." || target === dir || target.startsWith(`${dir}/`);
|
|
@@ -125087,14 +125122,14 @@ function asciiFuzzyIndex(input3, pattern, caseSensitive) {
|
|
|
125087
125122
|
}
|
|
125088
125123
|
return firstIdx;
|
|
125089
125124
|
}
|
|
125090
|
-
var fuzzyMatchV2 = (caseSensitive,
|
|
125125
|
+
var fuzzyMatchV2 = (caseSensitive, normalize4, forward, input3, pattern, withPos, slab2) => {
|
|
125091
125126
|
const M = pattern.length;
|
|
125092
125127
|
if (M === 0) {
|
|
125093
125128
|
return [{ start: 0, end: 0, score: 0 }, createPosSet(withPos)];
|
|
125094
125129
|
}
|
|
125095
125130
|
const N = input3.length;
|
|
125096
125131
|
if (slab2 !== null && N * M > slab2.i16.length) {
|
|
125097
|
-
return fuzzyMatchV1(caseSensitive,
|
|
125132
|
+
return fuzzyMatchV1(caseSensitive, normalize4, forward, input3, pattern, withPos);
|
|
125098
125133
|
}
|
|
125099
125134
|
const idx = asciiFuzzyIndex(input3, pattern, caseSensitive);
|
|
125100
125135
|
if (idx < 0) {
|
|
@@ -125127,7 +125162,7 @@ var fuzzyMatchV2 = (caseSensitive, normalize3, forward, input3, pattern, withPos
|
|
|
125127
125162
|
if (!caseSensitive && charClass === 2) {
|
|
125128
125163
|
char2 = String.fromCodePoint(char2).toLowerCase().codePointAt(0);
|
|
125129
125164
|
}
|
|
125130
|
-
if (
|
|
125165
|
+
if (normalize4) {
|
|
125131
125166
|
char2 = normalizeRune(char2);
|
|
125132
125167
|
}
|
|
125133
125168
|
}
|
|
@@ -125267,7 +125302,7 @@ var fuzzyMatchV2 = (caseSensitive, normalize3, forward, input3, pattern, withPos
|
|
|
125267
125302
|
}
|
|
125268
125303
|
return [{ start: j, end: maxScorePos + 1, score: maxScore }, pos];
|
|
125269
125304
|
};
|
|
125270
|
-
function calculateScore(caseSensitive,
|
|
125305
|
+
function calculateScore(caseSensitive, normalize4, text4, pattern, sidx, eidx, withPos) {
|
|
125271
125306
|
let pidx = 0, score = 0, inGap = false, consecutive = 0, firstBonus = toShort(0);
|
|
125272
125307
|
const pos = createPosSet(withPos);
|
|
125273
125308
|
let prevCharClass = 0;
|
|
@@ -125284,7 +125319,7 @@ function calculateScore(caseSensitive, normalize3, text4, pattern, sidx, eidx, w
|
|
|
125284
125319
|
rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
|
|
125285
125320
|
}
|
|
125286
125321
|
}
|
|
125287
|
-
if (
|
|
125322
|
+
if (normalize4) {
|
|
125288
125323
|
rune = normalizeRune(rune);
|
|
125289
125324
|
}
|
|
125290
125325
|
if (rune === pattern[pidx]) {
|
|
@@ -125323,7 +125358,7 @@ function calculateScore(caseSensitive, normalize3, text4, pattern, sidx, eidx, w
|
|
|
125323
125358
|
}
|
|
125324
125359
|
return [score, pos];
|
|
125325
125360
|
}
|
|
125326
|
-
var fuzzyMatchV1 = (caseSensitive,
|
|
125361
|
+
var fuzzyMatchV1 = (caseSensitive, normalize4, forward, text4, pattern, withPos, slab2) => {
|
|
125327
125362
|
if (pattern.length === 0) {
|
|
125328
125363
|
return [{ start: 0, end: 0, score: 0 }, null];
|
|
125329
125364
|
}
|
|
@@ -125342,7 +125377,7 @@ var fuzzyMatchV1 = (caseSensitive, normalize3, forward, text4, pattern, withPos,
|
|
|
125342
125377
|
rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
|
|
125343
125378
|
}
|
|
125344
125379
|
}
|
|
125345
|
-
if (
|
|
125380
|
+
if (normalize4) {
|
|
125346
125381
|
rune = normalizeRune(rune);
|
|
125347
125382
|
}
|
|
125348
125383
|
const pchar = pattern[indexAt(pidx, lenPattern, forward)];
|
|
@@ -125386,7 +125421,7 @@ var fuzzyMatchV1 = (caseSensitive, normalize3, forward, text4, pattern, withPos,
|
|
|
125386
125421
|
}
|
|
125387
125422
|
const [score, pos] = calculateScore(
|
|
125388
125423
|
caseSensitive,
|
|
125389
|
-
|
|
125424
|
+
normalize4,
|
|
125390
125425
|
text4,
|
|
125391
125426
|
pattern,
|
|
125392
125427
|
sidx,
|
|
@@ -125397,7 +125432,7 @@ var fuzzyMatchV1 = (caseSensitive, normalize3, forward, text4, pattern, withPos,
|
|
|
125397
125432
|
}
|
|
125398
125433
|
return [{ start: -1, end: -1, score: 0 }, null];
|
|
125399
125434
|
};
|
|
125400
|
-
var exactMatchNaive = (caseSensitive,
|
|
125435
|
+
var exactMatchNaive = (caseSensitive, normalize4, forward, text4, pattern, withPos, slab2) => {
|
|
125401
125436
|
if (pattern.length === 0) {
|
|
125402
125437
|
return [{ start: 0, end: 0, score: 0 }, null];
|
|
125403
125438
|
}
|
|
@@ -125421,7 +125456,7 @@ var exactMatchNaive = (caseSensitive, normalize3, forward, text4, pattern, withP
|
|
|
125421
125456
|
rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
|
|
125422
125457
|
}
|
|
125423
125458
|
}
|
|
125424
|
-
if (
|
|
125459
|
+
if (normalize4) {
|
|
125425
125460
|
rune = normalizeRune(rune);
|
|
125426
125461
|
}
|
|
125427
125462
|
const pidx_ = indexAt(pidx, lenPattern, forward);
|
|
@@ -125458,7 +125493,7 @@ var exactMatchNaive = (caseSensitive, normalize3, forward, text4, pattern, withP
|
|
|
125458
125493
|
sidx = lenRunes - (bestPos + 1);
|
|
125459
125494
|
eidx = lenRunes - (bestPos - lenPattern + 1);
|
|
125460
125495
|
}
|
|
125461
|
-
const [score] = calculateScore(caseSensitive,
|
|
125496
|
+
const [score] = calculateScore(caseSensitive, normalize4, text4, pattern, sidx, eidx, false);
|
|
125462
125497
|
return [{ start: sidx, end: eidx, score }, null];
|
|
125463
125498
|
}
|
|
125464
125499
|
return [{ start: -1, end: -1, score: 0 }, null];
|
|
@@ -125472,7 +125507,7 @@ function makeSlab(size16, size32) {
|
|
|
125472
125507
|
};
|
|
125473
125508
|
}
|
|
125474
125509
|
var slab = makeSlab(SLAB_16_SIZE, SLAB_32_SIZE);
|
|
125475
|
-
var buildPatternForBasicMatch = (query, casing,
|
|
125510
|
+
var buildPatternForBasicMatch = (query, casing, normalize4) => {
|
|
125476
125511
|
let caseSensitive = false;
|
|
125477
125512
|
switch (casing) {
|
|
125478
125513
|
case "smart-case":
|
|
@@ -125489,7 +125524,7 @@ var buildPatternForBasicMatch = (query, casing, normalize3) => {
|
|
|
125489
125524
|
break;
|
|
125490
125525
|
}
|
|
125491
125526
|
let queryRunes = strToRunes(query);
|
|
125492
|
-
if (
|
|
125527
|
+
if (normalize4) {
|
|
125493
125528
|
queryRunes = queryRunes.map(normalizeRune);
|
|
125494
125529
|
}
|
|
125495
125530
|
return {
|
|
@@ -125966,6 +126001,13 @@ var worktreeRouter = t.router({
|
|
|
125966
126001
|
}
|
|
125967
126002
|
return { url: worktreePreviewUrl(input3.worktreeId, input3.path) };
|
|
125968
126003
|
}),
|
|
126004
|
+
/** A signed URL (5 minutes, one file) that a drag out of the Explorer hands to another app. */
|
|
126005
|
+
downloadUrl: publicProcedure.input(external_exports2.object({ worktreeId: external_exports2.string(), path: external_exports2.string().min(1) })).query(({ input: input3 }) => {
|
|
126006
|
+
if (!worktreeService.resolve(input3.worktreeId)) {
|
|
126007
|
+
throw new TRPCError({ code: "NOT_FOUND", message: "Worktree not found" });
|
|
126008
|
+
}
|
|
126009
|
+
return { url: worktreeDownloadUrl(input3.worktreeId, input3.path) };
|
|
126010
|
+
}),
|
|
125969
126011
|
searchFiles: publicProcedure.input(directOps["worktree.searchFiles"].input).query(({ input: input3 }) => directOps["worktree.searchFiles"].run(worktreeOps, input3)),
|
|
125970
126012
|
// Resolve an absolute (or worktree-relative) path against this
|
|
125971
126013
|
// worktree: does it exist, is it a regular file, and does it live inside
|
|
@@ -126167,6 +126209,7 @@ function discoverProcedures() {
|
|
|
126167
126209
|
path2.startsWith("hooks."))
|
|
126168
126210
|
continue;
|
|
126169
126211
|
if (path2 === "worktree.previewUrl") continue;
|
|
126212
|
+
if (path2 === "worktree.downloadUrl") continue;
|
|
126170
126213
|
if (path2 === "worktree.directAccess") continue;
|
|
126171
126214
|
if (path2 === "worktree.readExternalFile" || path2 === "worktree.saveExternalFile") continue;
|
|
126172
126215
|
if (path2 === "environment.validate") continue;
|
|
@@ -137489,6 +137532,39 @@ async function handleWorktreePreview(req, res) {
|
|
|
137489
137532
|
isValidVisualEditNonce(nonce) ? nonce : void 0
|
|
137490
137533
|
);
|
|
137491
137534
|
}
|
|
137535
|
+
async function handleWorktreeDownload(req, res) {
|
|
137536
|
+
const [rest = ""] = (req.url ?? "").slice(WORKTREE_DOWNLOAD_PREFIX.length).split("?");
|
|
137537
|
+
const [rawId, grant, ...pathParts] = rest.split("/");
|
|
137538
|
+
let wId;
|
|
137539
|
+
let filePath;
|
|
137540
|
+
try {
|
|
137541
|
+
wId = decodeURIComponent(rawId ?? "");
|
|
137542
|
+
filePath = decodeURIComponent(pathParts.join("/"));
|
|
137543
|
+
} catch {
|
|
137544
|
+
res.writeHead(400);
|
|
137545
|
+
res.end("Bad request");
|
|
137546
|
+
return;
|
|
137547
|
+
}
|
|
137548
|
+
if (!wId || !grant || !filePath) {
|
|
137549
|
+
res.writeHead(400);
|
|
137550
|
+
res.end("Bad request");
|
|
137551
|
+
return;
|
|
137552
|
+
}
|
|
137553
|
+
if (!verifyWorktreeDownloadGrant(wId, grant, filePath)) {
|
|
137554
|
+
res.writeHead(403);
|
|
137555
|
+
res.end("Forbidden");
|
|
137556
|
+
return;
|
|
137557
|
+
}
|
|
137558
|
+
await serveWorktreeFile(
|
|
137559
|
+
res,
|
|
137560
|
+
wId,
|
|
137561
|
+
filePath,
|
|
137562
|
+
{ "X-Content-Type-Options": "nosniff", "Cache-Control": "private, no-store" },
|
|
137563
|
+
void 0,
|
|
137564
|
+
true,
|
|
137565
|
+
req.headers.range
|
|
137566
|
+
);
|
|
137567
|
+
}
|
|
137492
137568
|
var MAX_WEBHOOK_BODY_BYTES = 256 * 1024;
|
|
137493
137569
|
var MAX_GITHUB_HOOK_BODY_BYTES = 2 * 1024 * 1024;
|
|
137494
137570
|
async function handleGithubWebhook(req, res) {
|
|
@@ -137750,6 +137826,10 @@ async function main() {
|
|
|
137750
137826
|
await handleWorktreePreview(req, res);
|
|
137751
137827
|
return;
|
|
137752
137828
|
}
|
|
137829
|
+
if (req.method === "GET" && req.url?.startsWith(WORKTREE_DOWNLOAD_PREFIX)) {
|
|
137830
|
+
await handleWorktreeDownload(req, res);
|
|
137831
|
+
return;
|
|
137832
|
+
}
|
|
137753
137833
|
if (handleAuth(req, res)) return;
|
|
137754
137834
|
if (req.url?.split("?")[0] === EXT_INSTALL_PATH) {
|
|
137755
137835
|
await handleExtensionInstall(req, res, requestDevice(req).admin);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@band-app/server",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -58,24 +58,24 @@
|
|
|
58
58
|
"vitest": "^4.0.18",
|
|
59
59
|
"ws": "^8.18.0",
|
|
60
60
|
"zod": "^3.25.67",
|
|
61
|
+
"@band-app/coding-agent": "^0.60.1",
|
|
61
62
|
"@band-app/environment": "^0.1.0",
|
|
62
|
-
"@band-app/coding-agent": "^0.60.0",
|
|
63
63
|
"@band-app/host-api": "^0.1.0",
|
|
64
|
-
"@band-app/chat-runtime": "^0.1.0",
|
|
65
64
|
"@band-app/host-local": "^0.1.0",
|
|
65
|
+
"@band-app/chat-runtime": "^0.1.0",
|
|
66
66
|
"@band-app/host-remote": "^0.1.0",
|
|
67
|
-
"@band-app/logger": "^0.60.
|
|
67
|
+
"@band-app/logger": "^0.60.1",
|
|
68
68
|
"@band-app/plugin-api": "^0.1.0",
|
|
69
|
+
"@band-app/link": "^0.1.0",
|
|
70
|
+
"@band-app/plugin-github": "^0.1.0",
|
|
69
71
|
"@band-app/shared": "^0.1.0",
|
|
70
72
|
"@band-app/worktree-ops": "^0.1.0",
|
|
71
|
-
"@band-app/plugin-
|
|
72
|
-
"@band-app/plugin-simulator": "^0.1.0",
|
|
73
|
-
"@band-app/link": "^0.1.0"
|
|
73
|
+
"@band-app/plugin-simulator": "^0.1.0"
|
|
74
74
|
},
|
|
75
75
|
"optionalDependencies": {
|
|
76
|
-
"@band-app/worker-cli-darwin-arm64": "0.60.
|
|
77
|
-
"@band-app/worker-cli-linux-x64": "0.60.
|
|
78
|
-
"@band-app/worker-cli-linux-arm64": "0.60.
|
|
76
|
+
"@band-app/worker-cli-darwin-arm64": "0.60.1",
|
|
77
|
+
"@band-app/worker-cli-linux-x64": "0.60.1",
|
|
78
|
+
"@band-app/worker-cli-linux-arm64": "0.60.1"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"dev": "NODE_ENV=development tsx watch --exclude '../web/**' start-server.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as a,Z as n}from"./main-CW1tJAHn.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-CAtAtkCf.js";import{_ as i}from"./main-CW1tJAHn.js";import"./chunk-FMBD7UC4-DzqqzV_F.js";import"./chunk-55IACEB6-DO5fHd1T.js";import"./chunk-QN33PNHL-DETRpC4Q.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-CAtAtkCf.js";import{_ as i}from"./main-CW1tJAHn.js";import"./chunk-FMBD7UC4-DzqqzV_F.js";import"./chunk-55IACEB6-DO5fHd1T.js";import"./chunk-QN33PNHL-DETRpC4Q.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-vhCiyIYf.js";var e=4;function a(o){return r(o,e)}export{a as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as t,b as r,a,S as s}from"./chunk-DI55MBZ5-DRnZO_Tx.js";import{_ as i}from"./main-CW1tJAHn.js";import"./chunk-55IACEB6-DO5fHd1T.js";import"./chunk-QN33PNHL-DETRpC4Q.js";var l={parser:a,get db(){return new s(2)},renderer:r,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{l as diagram};
|