@band-app/server 0.30.1 → 0.31.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/assets/{TerminalPanel-CYc7wmeE.js → TerminalPanel-B7w-MXq6.js} +1 -1
- package/dist/client/assets/{_basePickBy-DSFTNllf.js → _basePickBy-MOPnIDNU.js} +1 -1
- package/dist/client/assets/{_baseUniq-DnkIfali.js → _baseUniq-Dvgd7LC-.js} +1 -1
- package/dist/client/assets/{arc-yqr-IZtS.js → arc-CLKtuYIQ.js} +1 -1
- package/dist/client/assets/{architectureDiagram-VXUJARFQ-DgI9TKhb.js → architectureDiagram-VXUJARFQ-2uXtcrIY.js} +1 -1
- package/dist/client/assets/{blockDiagram-VD42YOAC-BGOVIb7o.js → blockDiagram-VD42YOAC-BVsh28c_.js} +1 -1
- package/dist/client/assets/{c4Diagram-YG6GDRKO-iztuATa5.js → c4Diagram-YG6GDRKO-7c05Vgq2.js} +1 -1
- package/dist/client/assets/channel-C3O7_aZ0.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-CcUWoJOh.js → chunk-4BX2VUAB-BE-3fdKG.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-CLZYywVn.js → chunk-55IACEB6-BHogGWxY.js} +1 -1
- package/dist/client/assets/{chunk-B4BG7PRW-DjGod5fi.js → chunk-B4BG7PRW-vTUbHTLu.js} +1 -1
- package/dist/client/assets/{chunk-DI55MBZ5-rvGroe_f.js → chunk-DI55MBZ5-CZc3Izff.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-DaPnkf6C.js → chunk-FMBD7UC4-DJ2VRMnr.js} +1 -1
- package/dist/client/assets/{chunk-QN33PNHL-0f_dQb97.js → chunk-QN33PNHL-fRdq2MR_.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-V5my3DmE.js → chunk-QZHKN3VN-CuEMRzZD.js} +1 -1
- package/dist/client/assets/{chunk-TZMSLE5B-BtkkmYb5.js → chunk-TZMSLE5B-D72a0Zdw.js} +1 -1
- package/dist/client/assets/classDiagram-2ON5EDUG-BoiZPwoN.js +1 -0
- package/dist/client/assets/classDiagram-v2-WZHVMYZB-BoiZPwoN.js +1 -0
- package/dist/client/assets/clone-lHwRbEeN.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-Cmx6KOyO.js → cose-bilkent-S5V4N54A-BKtPu1zs.js} +1 -1
- package/dist/client/assets/{dagre-6UL2VRFP-Bka4HPUz.js → dagre-6UL2VRFP-B9QQeVOI.js} +1 -1
- package/dist/client/assets/{diagram-PSM6KHXK-CD7rmMsc.js → diagram-PSM6KHXK-B8HYQLMw.js} +1 -1
- package/dist/client/assets/{diagram-QEK2KX5R-oiADiv14.js → diagram-QEK2KX5R-ComYD9MH.js} +1 -1
- package/dist/client/assets/{diagram-S2PKOQOG-B4Uae-nx.js → diagram-S2PKOQOG-BY9m2nHh.js} +1 -1
- package/dist/client/assets/{erDiagram-Q2GNP2WA-BvFMCk4I.js → erDiagram-Q2GNP2WA-BNvaDjit.js} +1 -1
- package/dist/client/assets/{flowDiagram-NV44I4VS-BTNbN1IS.js → flowDiagram-NV44I4VS-Ddpvl-vl.js} +1 -1
- package/dist/client/assets/{ganttDiagram-JELNMOA3-oGw7ex14.js → ganttDiagram-JELNMOA3-DtLpVIoc.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-V2S2FVAM-ANBYCIGh.js → gitGraphDiagram-V2S2FVAM-DQF0HBF1.js} +1 -1
- package/dist/client/assets/{graph-CcgcxFwc.js → graph-C781x5wO.js} +1 -1
- package/dist/client/assets/{highlighted-body-B3W2YXNL-CB6TXvrA.js → highlighted-body-B3W2YXNL-CiFHkG2b.js} +1 -1
- package/dist/client/assets/{index-CNK9CFgH.js → index-BBCldE3w.js} +1 -1
- package/dist/client/assets/{index-B6XNXoaL.js → index-BQJE_ylT.js} +1 -1
- package/dist/client/assets/{index-jADn9moZ.js → index-BQaxF9MG.js} +1 -1
- package/dist/client/assets/{index-CX6RhqKm.js → index-BR41myYB.js} +1 -1
- package/dist/client/assets/{index-D3oXjM3u.js → index-BTP6G260.js} +1 -1
- package/dist/client/assets/{index-BAmJ0GKU.js → index-BVLZtCO_.js} +1 -1
- package/dist/client/assets/{index-DbPjX4ZE.js → index-Bg6O6yab.js} +1 -1
- package/dist/client/assets/{index-CCYZ9TFO.js → index-C9uXadXD.js} +1 -1
- package/dist/client/assets/{index-AmFSOCK4.js → index-Ca5qw4bu.js} +1 -1
- package/dist/client/assets/{index-oktth6Eb.js → index-Co3FYAz1.js} +1 -1
- package/dist/client/assets/{index-DGfblNX8.js → index-CoD9Za6I.js} +1 -1
- package/dist/client/assets/{index-DbMvNJEz.js → index-CsCNs38S.js} +1 -1
- package/dist/client/assets/{index-DwfeHYo6.js → index-D8ecQsfM.js} +1 -1
- package/dist/client/assets/{index-DcH_gVmD.js → index-Dhu83XDb.js} +1 -1
- package/dist/client/assets/{index-DfpgVgGw.js → index-Dk3mw2MP.js} +1 -1
- package/dist/client/assets/{index-CCvSBgbq.js → index-Dmw4xB4j.js} +1 -1
- package/dist/client/assets/{index-DW6uLGze.js → index-DwZk_cus.js} +1 -1
- package/dist/client/assets/{index-UPQzA7yb.js → index-xIKGJ3n2.js} +1 -1
- package/dist/client/assets/{infoDiagram-HS3SLOUP-D90X75Z3.js → infoDiagram-HS3SLOUP-BMWXVFwl.js} +1 -1
- package/dist/client/assets/{journeyDiagram-XKPGCS4Q-BgChwq0x.js → journeyDiagram-XKPGCS4Q-BI2_OL4h.js} +1 -1
- package/dist/client/assets/{kanban-definition-3W4ZIXB7-Di1Xrs0h.js → kanban-definition-3W4ZIXB7-DOsG8dYx.js} +1 -1
- package/dist/client/assets/{layout-BvXbPDLJ.js → layout-Bbvi54cd.js} +1 -1
- package/dist/client/assets/main-D_80GG4H.css +1 -0
- package/dist/client/assets/{main-DUGGQWmn.js → main-DraI_2WE.js} +225 -225
- package/dist/client/assets/{mindmap-definition-VGOIOE7T-CiiV7X0E.js → mindmap-definition-VGOIOE7T-D4Sd_Kfu.js} +1 -1
- package/dist/client/assets/{pieDiagram-ADFJNKIX-C5XzwLyG.js → pieDiagram-ADFJNKIX-C7h-nB1m.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-AYHSOK5B-BwkGtnp5.js → quadrantDiagram-AYHSOK5B-Dy596AJL.js} +1 -1
- package/dist/client/assets/{requirementDiagram-UZGBJVZJ-BzEtQL4i.js → requirementDiagram-UZGBJVZJ-xscRQbHJ.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-TZEHDZUN-BkqqCKr3.js → sankeyDiagram-TZEHDZUN-DCi7vP32.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-WL72ISMW-D_gZ_Lt0.js → sequenceDiagram-WL72ISMW-qUhe9Cbc.js} +1 -1
- package/dist/client/assets/{stateDiagram-FKZM4ZOC-DEDS5Lv4.js → stateDiagram-FKZM4ZOC-DSmbkZ_d.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-4FDKWEC3-BsPlpajy.js +1 -0
- package/dist/client/assets/{timeline-definition-IT6M3QCI-DalCe-B5.js → timeline-definition-IT6M3QCI-C6Z_s_Vx.js} +1 -1
- package/dist/client/assets/{treemap-GDKQZRPO-CtoL0e4U.js → treemap-GDKQZRPO-Dn8bXpzH.js} +1 -1
- package/dist/client/assets/workspace._workspaceId-BMWfOwwz.js +1 -0
- package/dist/client/assets/{workspace._workspaceId-CouwLO7q.js → workspace._workspaceId-X6y8HU1f.js} +1 -1
- package/dist/client/assets/{xychartDiagram-PRI3JC2R-C3bXo21u.js → xychartDiagram-PRI3JC2R-Bo0o11Hv.js} +1 -1
- package/dist/openapi.json +37 -0
- package/dist/server/assets/{TerminalPanel-Br6bnerp.js → TerminalPanel-DwiK0a7O.js} +27 -24
- package/dist/server/assets/{_basePickBy-BbVdfJJx.js → _basePickBy-BI_h9zNZ.js} +2 -2
- package/dist/server/assets/{_baseUniq-DZlTc9mr.js → _baseUniq-BsVb1Z1a.js} +1 -1
- package/dist/server/assets/_tanstack-start-manifest_v-tp111Oi_.js +4 -0
- package/dist/server/assets/{arc-CI6FZKZK.js → arc-5WhmOOvK.js} +1 -1
- package/dist/server/assets/{architecture-7HQA4BMR-C5ydTPUl.js → architecture-7HQA4BMR-Cj4ZRaay.js} +6 -6
- package/dist/server/assets/{architectureDiagram-VXUJARFQ-5uniqAHc.js → architectureDiagram-VXUJARFQ-DkchSxdX.js} +6 -6
- package/dist/server/assets/{blockDiagram-VD42YOAC-ZfA3oZiS.js → blockDiagram-VD42YOAC-Dg_flni_.js} +6 -6
- package/dist/server/assets/{c4Diagram-YG6GDRKO-CIA5eVV6.js → c4Diagram-YG6GDRKO-DsFHmTD3.js} +2 -2
- package/dist/server/assets/{channel-Cx4VskGi.js → channel-CKjBHgWA.js} +1 -1
- package/dist/server/assets/{chunk-4BX2VUAB-Ded1GGo-.js → chunk-4BX2VUAB-BnMplOsV.js} +1 -1
- package/dist/server/assets/{chunk-55IACEB6-BwrewJPk.js → chunk-55IACEB6-BW3-4FCm.js} +1 -1
- package/dist/server/assets/{chunk-B4BG7PRW-6-52BPtW.js → chunk-B4BG7PRW-44B9JfnQ.js} +4 -4
- package/dist/server/assets/{chunk-DI55MBZ5-DFS2_qc9.js → chunk-DI55MBZ5-xUtiLewM.js} +3 -3
- package/dist/server/assets/{chunk-FMBD7UC4-CHuRNLFJ.js → chunk-FMBD7UC4-LQJJD-on.js} +1 -1
- package/dist/server/assets/{chunk-QN33PNHL-BvqSEFKx.js → chunk-QN33PNHL-Bz6JspT7.js} +1 -1
- package/dist/server/assets/{chunk-QZHKN3VN-BrGUOJtT.js → chunk-QZHKN3VN-CqbN5Hbm.js} +1 -1
- package/dist/server/assets/{chunk-TZMSLE5B-CM-vVEKG.js → chunk-TZMSLE5B-CLfUYKJu.js} +1 -1
- package/dist/server/assets/{classDiagram-v2-WZHVMYZB-vj4N4uTP.js → classDiagram-2ON5EDUG-CnPtqi4k.js} +5 -5
- package/dist/server/assets/{classDiagram-2ON5EDUG-vj4N4uTP.js → classDiagram-v2-WZHVMYZB-CnPtqi4k.js} +5 -5
- package/dist/server/assets/{clone-FpW231EY.js → clone-BBTPQ6Eb.js} +1 -1
- package/dist/server/assets/{cose-bilkent-S5V4N54A-KcHAEwzJ.js → cose-bilkent-S5V4N54A-B9ae2Qdn.js} +1 -1
- package/dist/server/assets/{dagre-6UL2VRFP-CQWT1qH1.js → dagre-6UL2VRFP-B7jTJSLw.js} +6 -6
- package/dist/server/assets/{diagram-PSM6KHXK-C522aWwF.js → diagram-PSM6KHXK-zpQZfPMx.js} +7 -7
- package/dist/server/assets/{diagram-QEK2KX5R-AmngkeIE.js → diagram-QEK2KX5R-CIAMWYgF.js} +6 -6
- package/dist/server/assets/{diagram-S2PKOQOG-BM39hxHa.js → diagram-S2PKOQOG-DmG_O45F.js} +6 -6
- package/dist/server/assets/{erDiagram-Q2GNP2WA-BKMMfe3p.js → erDiagram-Q2GNP2WA-eOuplDm8.js} +4 -4
- package/dist/server/assets/{flowDiagram-NV44I4VS-BfixH-Db.js → flowDiagram-NV44I4VS-D936EXJm.js} +5 -5
- package/dist/server/assets/{ganttDiagram-JELNMOA3-DFMW13wi.js → ganttDiagram-JELNMOA3-BiN9iSoE.js} +1 -1
- package/dist/server/assets/{gitGraph-G5XIXVHT-DCO9Wzl8.js → gitGraph-G5XIXVHT-CEvzHY0m.js} +6 -6
- package/dist/server/assets/{gitGraphDiagram-V2S2FVAM-CojxDa8_.js → gitGraphDiagram-V2S2FVAM-BySu09rG.js} +7 -7
- package/dist/server/assets/{graph-DX0Ld9Ij.js → graph-7Z3Uekg6.js} +2 -2
- package/dist/server/assets/{highlighted-body-B3W2YXNL-BRJTScpo.js → highlighted-body-B3W2YXNL-D96wFQIF.js} +1 -1
- package/dist/server/assets/{index-B70OKozW.js → index--KaT9H0k.js} +5 -5
- package/dist/server/assets/{index-1fKvU2GD.js → index-0NB-RPox.js} +2 -2
- package/dist/server/assets/{index-C9NLW19U.js → index-B2cRwRII.js} +2 -2
- package/dist/server/assets/{index-BPhNydFp.js → index-BJJ8j1rg.js} +2 -2
- package/dist/server/assets/{index-DsUEML0Q.js → index-BTtOxXlZ.js} +3 -3
- package/dist/server/assets/{index-BJCGggpH.js → index-BeVYh61F.js} +2 -2
- package/dist/server/assets/{index-CGahi9V_.js → index-BstlKcBR.js} +4 -4
- package/dist/server/assets/{index-BJtDnGxq.js → index-C2HXhI72.js} +2 -2
- package/dist/server/assets/{index-B0xGaLrl.js → index-C9azpIfZ.js} +3 -3
- package/dist/server/assets/{index-BFGzZbup.js → index-CIQ2H-15.js} +2 -2
- package/dist/server/assets/{index-Cd5puaI6.js → index-CTx1RpR6.js} +2 -2
- package/dist/server/assets/{index-DCgp2ft7.js → index-CdB_dmgU.js} +1 -1
- package/dist/server/assets/{index-C0OatepH.js → index-CvolrjMO.js} +2 -2
- package/dist/server/assets/{index-BD2aoqcU.js → index-DKHXjVjQ.js} +1 -1
- package/dist/server/assets/{index-BqzKD5E_.js → index-Dh1M5dNP.js} +2 -2
- package/dist/server/assets/{index-7EU1eTTa.js → index-OaYzTlpS.js} +2 -2
- package/dist/server/assets/{index-Cwe7nbJw.js → index-P4B7a8It.js} +2 -2
- package/dist/server/assets/{index-y8Aubw3W.js → index-a62bFj9q.js} +5 -5
- package/dist/server/assets/{info-VBDWY6EO-BUsqumC5.js → info-VBDWY6EO-KF3o2F_X.js} +6 -6
- package/dist/server/assets/{infoDiagram-HS3SLOUP--nKUIx4y.js → infoDiagram-HS3SLOUP-tw47oYSh.js} +5 -5
- package/dist/server/assets/{journeyDiagram-XKPGCS4Q-KjVGeKmm.js → journeyDiagram-XKPGCS4Q-dlsRbD68.js} +4 -4
- package/dist/server/assets/{kanban-definition-3W4ZIXB7-aISJLxn5.js → kanban-definition-3W4ZIXB7-BY-i-k2L.js} +2 -2
- package/dist/server/assets/{layout-CzeG7EPR.js → layout-CBNJVKY7.js} +4 -4
- package/dist/server/assets/{mermaid-3ZIDBTTL-BTOUM0ev.js → mermaid-3ZIDBTTL-OXquaWS7.js} +1 -1
- package/dist/server/assets/{mermaid-parser.core-BoGFLsBJ.js → mermaid-parser.core-BJPps3BL.js} +11 -11
- package/dist/server/assets/{mindmap-definition-VGOIOE7T--AIwUu6M.js → mindmap-definition-VGOIOE7T-BhmQKdg9.js} +3 -3
- package/dist/server/assets/{packet-DYOGHKS2-BTGkKC22.js → packet-DYOGHKS2-pVltsqVu.js} +6 -6
- package/dist/server/assets/{pie-VRWISCQL-BjDIbOyB.js → pie-VRWISCQL-Drk2bcq1.js} +6 -6
- package/dist/server/assets/{pieDiagram-ADFJNKIX-VNMmF9Za.js → pieDiagram-ADFJNKIX-CaxKfDJS.js} +7 -7
- package/dist/server/assets/{quadrantDiagram-AYHSOK5B-re6uOzo4.js → quadrantDiagram-AYHSOK5B-Ca2xEu2r.js} +1 -1
- package/dist/server/assets/{radar-ZZBFDIW7-bi1qVKOM.js → radar-ZZBFDIW7-ButuOJZN.js} +6 -6
- package/dist/server/assets/{requirementDiagram-UZGBJVZJ-BImsyUnt.js → requirementDiagram-UZGBJVZJ-Yu709R_p.js} +3 -3
- package/dist/server/assets/{router-B7-XKvBR.js → router-CijxukSe.js} +553 -246
- package/dist/server/assets/{sankeyDiagram-TZEHDZUN-BdxA5ccl.js → sankeyDiagram-TZEHDZUN-B-IfXZ0G.js} +1 -1
- package/dist/server/assets/{sequenceDiagram-WL72ISMW-De8W2AXi.js → sequenceDiagram-WL72ISMW-D1bV4VYq.js} +3 -3
- package/dist/server/assets/{stateDiagram-FKZM4ZOC-CslmqvhX.js → stateDiagram-FKZM4ZOC-vLFbsrNj.js} +8 -8
- package/dist/server/assets/{stateDiagram-v2-4FDKWEC3-BXVdfPdk.js → stateDiagram-v2-4FDKWEC3-BKTZFre2.js} +4 -4
- package/dist/server/assets/{timeline-definition-IT6M3QCI-BrEcv0X7.js → timeline-definition-IT6M3QCI-BoTxx0bm.js} +2 -2
- package/dist/server/assets/{treemap-GDKQZRPO-IZvjxjwq.js → treemap-GDKQZRPO-CAmm-Xwb.js} +6 -6
- package/dist/server/assets/{workspace._workspaceId-DSom1njg.js → workspace._workspaceId-C-QhWzy_.js} +2 -2
- package/dist/server/assets/{workspace._workspaceId-DMfwrjZz.js → workspace._workspaceId-DivWn3Sp.js} +1 -1
- package/dist/server/assets/{xychartDiagram-PRI3JC2R-B99wGKft.js → xychartDiagram-PRI3JC2R-XawkKMC7.js} +1 -1
- package/dist/server/server.js +2 -2
- package/dist/start-server.mjs +650 -363
- package/package.json +6 -4
- package/dist/client/assets/channel-BkKcGPNX.js +0 -1
- package/dist/client/assets/classDiagram-2ON5EDUG-31IVI--d.js +0 -1
- package/dist/client/assets/classDiagram-v2-WZHVMYZB-31IVI--d.js +0 -1
- package/dist/client/assets/clone-TmgJgLyY.js +0 -1
- package/dist/client/assets/main-CkQFvJn7.css +0 -1
- package/dist/client/assets/stateDiagram-v2-4FDKWEC3-2jb1quoy.js +0 -1
- package/dist/client/assets/workspace._workspaceId-Tn_ATtTD.js +0 -1
- package/dist/server/assets/_tanstack-start-manifest_v-DKMimfmd.js +0 -4
package/dist/start-server.mjs
CHANGED
|
@@ -4907,7 +4907,7 @@ var require_sonic_boom = __commonJS({
|
|
|
4907
4907
|
if (!(this instanceof SonicBoom)) {
|
|
4908
4908
|
return new SonicBoom(opts);
|
|
4909
4909
|
}
|
|
4910
|
-
let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir:
|
|
4910
|
+
let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir: mkdir5, retryEAGAIN, fsync, contentMode, mode } = opts || {};
|
|
4911
4911
|
fd = fd || dest;
|
|
4912
4912
|
this._len = 0;
|
|
4913
4913
|
this.fd = -1;
|
|
@@ -4932,7 +4932,7 @@ var require_sonic_boom = __commonJS({
|
|
|
4932
4932
|
this.append = append || false;
|
|
4933
4933
|
this.mode = mode;
|
|
4934
4934
|
this.retryEAGAIN = retryEAGAIN || (() => true);
|
|
4935
|
-
this.mkdir =
|
|
4935
|
+
this.mkdir = mkdir5 || false;
|
|
4936
4936
|
let fsWriteSync;
|
|
4937
4937
|
let fsWrite;
|
|
4938
4938
|
if (contentMode === kContentModeBuffer) {
|
|
@@ -5648,7 +5648,7 @@ var require_thread_stream = __commonJS({
|
|
|
5648
5648
|
var { version: version2 } = require_package();
|
|
5649
5649
|
var { EventEmitter } = __require("events");
|
|
5650
5650
|
var { Worker } = __require("worker_threads");
|
|
5651
|
-
var { join:
|
|
5651
|
+
var { join: join37 } = __require("path");
|
|
5652
5652
|
var { pathToFileURL } = __require("url");
|
|
5653
5653
|
var { wait } = require_wait();
|
|
5654
5654
|
var {
|
|
@@ -5684,7 +5684,7 @@ var require_thread_stream = __commonJS({
|
|
|
5684
5684
|
function createWorker(stream, opts) {
|
|
5685
5685
|
const { filename, workerData } = opts;
|
|
5686
5686
|
const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
5687
|
-
const toExecute = bundlerOverrides["thread-stream-worker"] ||
|
|
5687
|
+
const toExecute = bundlerOverrides["thread-stream-worker"] || join37(__dirname, "lib", "worker.js");
|
|
5688
5688
|
const worker = new Worker(toExecute, {
|
|
5689
5689
|
...opts.workerOpts,
|
|
5690
5690
|
trackUnmanagedFds: false,
|
|
@@ -6070,7 +6070,7 @@ var require_transport = __commonJS({
|
|
|
6070
6070
|
"use strict";
|
|
6071
6071
|
var { createRequire: createRequire2 } = __require("module");
|
|
6072
6072
|
var getCallers = require_caller();
|
|
6073
|
-
var { join:
|
|
6073
|
+
var { join: join37, isAbsolute: isAbsolute5, sep: sep9 } = __require("node:path");
|
|
6074
6074
|
var sleep2 = require_atomic_sleep();
|
|
6075
6075
|
var onExit = require_on_exit_leak_free();
|
|
6076
6076
|
var ThreadStream = require_thread_stream();
|
|
@@ -6133,7 +6133,7 @@ var require_transport = __commonJS({
|
|
|
6133
6133
|
throw new Error("only one of target or targets can be specified");
|
|
6134
6134
|
}
|
|
6135
6135
|
if (targets) {
|
|
6136
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
6136
|
+
target = bundlerOverrides["pino-worker"] || join37(__dirname, "worker.js");
|
|
6137
6137
|
options2.targets = targets.filter((dest) => dest.target).map((dest) => {
|
|
6138
6138
|
return {
|
|
6139
6139
|
...dest,
|
|
@@ -6151,7 +6151,7 @@ var require_transport = __commonJS({
|
|
|
6151
6151
|
});
|
|
6152
6152
|
});
|
|
6153
6153
|
} else if (pipeline) {
|
|
6154
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
6154
|
+
target = bundlerOverrides["pino-worker"] || join37(__dirname, "worker.js");
|
|
6155
6155
|
options2.pipelines = [pipeline.map((dest) => {
|
|
6156
6156
|
return {
|
|
6157
6157
|
...dest,
|
|
@@ -6173,7 +6173,7 @@ var require_transport = __commonJS({
|
|
|
6173
6173
|
return origin;
|
|
6174
6174
|
}
|
|
6175
6175
|
if (origin === "pino/file") {
|
|
6176
|
-
return
|
|
6176
|
+
return join37(__dirname, "..", "file.js");
|
|
6177
6177
|
}
|
|
6178
6178
|
let fixTarget2;
|
|
6179
6179
|
for (const filePath of callers) {
|
|
@@ -6501,11 +6501,11 @@ var require_tools = __commonJS({
|
|
|
6501
6501
|
}
|
|
6502
6502
|
}
|
|
6503
6503
|
}
|
|
6504
|
-
function buildFormatters(level, bindings,
|
|
6504
|
+
function buildFormatters(level, bindings, log47) {
|
|
6505
6505
|
return {
|
|
6506
6506
|
level,
|
|
6507
6507
|
bindings,
|
|
6508
|
-
log:
|
|
6508
|
+
log: log47
|
|
6509
6509
|
};
|
|
6510
6510
|
}
|
|
6511
6511
|
function normalizeDestFileDescriptor(destination) {
|
|
@@ -6888,11 +6888,11 @@ var require_proto = __commonJS({
|
|
|
6888
6888
|
}
|
|
6889
6889
|
} else instance[serializersSym] = serializers;
|
|
6890
6890
|
if (options2.hasOwnProperty("formatters")) {
|
|
6891
|
-
const { level, bindings: chindings, log:
|
|
6891
|
+
const { level, bindings: chindings, log: log47 } = options2.formatters;
|
|
6892
6892
|
instance[formattersSym] = buildFormatters(
|
|
6893
6893
|
level || formatters.level,
|
|
6894
6894
|
chindings || resetChildingsFormatter,
|
|
6895
|
-
|
|
6895
|
+
log47 || formatters.log
|
|
6896
6896
|
);
|
|
6897
6897
|
} else {
|
|
6898
6898
|
instance[formattersSym] = buildFormatters(
|
|
@@ -7162,7 +7162,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
7162
7162
|
return circularValue;
|
|
7163
7163
|
}
|
|
7164
7164
|
let res = "";
|
|
7165
|
-
let
|
|
7165
|
+
let join37 = ",";
|
|
7166
7166
|
const originalIndentation = indentation;
|
|
7167
7167
|
if (Array.isArray(value)) {
|
|
7168
7168
|
if (value.length === 0) {
|
|
@@ -7176,7 +7176,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
7176
7176
|
indentation += spacer;
|
|
7177
7177
|
res += `
|
|
7178
7178
|
${indentation}`;
|
|
7179
|
-
|
|
7179
|
+
join37 = `,
|
|
7180
7180
|
${indentation}`;
|
|
7181
7181
|
}
|
|
7182
7182
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -7184,13 +7184,13 @@ ${indentation}`;
|
|
|
7184
7184
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
7185
7185
|
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
7186
7186
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7187
|
-
res +=
|
|
7187
|
+
res += join37;
|
|
7188
7188
|
}
|
|
7189
7189
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
7190
7190
|
res += tmp !== void 0 ? tmp : "null";
|
|
7191
7191
|
if (value.length - 1 > maximumBreadth) {
|
|
7192
7192
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
7193
|
-
res += `${
|
|
7193
|
+
res += `${join37}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
7194
7194
|
}
|
|
7195
7195
|
if (spacer !== "") {
|
|
7196
7196
|
res += `
|
|
@@ -7211,7 +7211,7 @@ ${originalIndentation}`;
|
|
|
7211
7211
|
let separator = "";
|
|
7212
7212
|
if (spacer !== "") {
|
|
7213
7213
|
indentation += spacer;
|
|
7214
|
-
|
|
7214
|
+
join37 = `,
|
|
7215
7215
|
${indentation}`;
|
|
7216
7216
|
whitespace = " ";
|
|
7217
7217
|
}
|
|
@@ -7225,13 +7225,13 @@ ${indentation}`;
|
|
|
7225
7225
|
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
7226
7226
|
if (tmp !== void 0) {
|
|
7227
7227
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
7228
|
-
separator =
|
|
7228
|
+
separator = join37;
|
|
7229
7229
|
}
|
|
7230
7230
|
}
|
|
7231
7231
|
if (keyLength > maximumBreadth) {
|
|
7232
7232
|
const removedKeys = keyLength - maximumBreadth;
|
|
7233
7233
|
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
7234
|
-
separator =
|
|
7234
|
+
separator = join37;
|
|
7235
7235
|
}
|
|
7236
7236
|
if (spacer !== "" && separator.length > 1) {
|
|
7237
7237
|
res = `
|
|
@@ -7272,7 +7272,7 @@ ${originalIndentation}`;
|
|
|
7272
7272
|
}
|
|
7273
7273
|
const originalIndentation = indentation;
|
|
7274
7274
|
let res = "";
|
|
7275
|
-
let
|
|
7275
|
+
let join37 = ",";
|
|
7276
7276
|
if (Array.isArray(value)) {
|
|
7277
7277
|
if (value.length === 0) {
|
|
7278
7278
|
return "[]";
|
|
@@ -7285,7 +7285,7 @@ ${originalIndentation}`;
|
|
|
7285
7285
|
indentation += spacer;
|
|
7286
7286
|
res += `
|
|
7287
7287
|
${indentation}`;
|
|
7288
|
-
|
|
7288
|
+
join37 = `,
|
|
7289
7289
|
${indentation}`;
|
|
7290
7290
|
}
|
|
7291
7291
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -7293,13 +7293,13 @@ ${indentation}`;
|
|
|
7293
7293
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
7294
7294
|
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
7295
7295
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7296
|
-
res +=
|
|
7296
|
+
res += join37;
|
|
7297
7297
|
}
|
|
7298
7298
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
7299
7299
|
res += tmp !== void 0 ? tmp : "null";
|
|
7300
7300
|
if (value.length - 1 > maximumBreadth) {
|
|
7301
7301
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
7302
|
-
res += `${
|
|
7302
|
+
res += `${join37}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
7303
7303
|
}
|
|
7304
7304
|
if (spacer !== "") {
|
|
7305
7305
|
res += `
|
|
@@ -7312,7 +7312,7 @@ ${originalIndentation}`;
|
|
|
7312
7312
|
let whitespace = "";
|
|
7313
7313
|
if (spacer !== "") {
|
|
7314
7314
|
indentation += spacer;
|
|
7315
|
-
|
|
7315
|
+
join37 = `,
|
|
7316
7316
|
${indentation}`;
|
|
7317
7317
|
whitespace = " ";
|
|
7318
7318
|
}
|
|
@@ -7321,7 +7321,7 @@ ${indentation}`;
|
|
|
7321
7321
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
7322
7322
|
if (tmp !== void 0) {
|
|
7323
7323
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
7324
|
-
separator =
|
|
7324
|
+
separator = join37;
|
|
7325
7325
|
}
|
|
7326
7326
|
}
|
|
7327
7327
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -7379,20 +7379,20 @@ ${originalIndentation}`;
|
|
|
7379
7379
|
indentation += spacer;
|
|
7380
7380
|
let res2 = `
|
|
7381
7381
|
${indentation}`;
|
|
7382
|
-
const
|
|
7382
|
+
const join38 = `,
|
|
7383
7383
|
${indentation}`;
|
|
7384
7384
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
7385
7385
|
let i = 0;
|
|
7386
7386
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
7387
7387
|
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
7388
7388
|
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
7389
|
-
res2 +=
|
|
7389
|
+
res2 += join38;
|
|
7390
7390
|
}
|
|
7391
7391
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
7392
7392
|
res2 += tmp !== void 0 ? tmp : "null";
|
|
7393
7393
|
if (value.length - 1 > maximumBreadth) {
|
|
7394
7394
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
7395
|
-
res2 += `${
|
|
7395
|
+
res2 += `${join38}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
7396
7396
|
}
|
|
7397
7397
|
res2 += `
|
|
7398
7398
|
${originalIndentation}`;
|
|
@@ -7408,16 +7408,16 @@ ${originalIndentation}`;
|
|
|
7408
7408
|
return '"[Object]"';
|
|
7409
7409
|
}
|
|
7410
7410
|
indentation += spacer;
|
|
7411
|
-
const
|
|
7411
|
+
const join37 = `,
|
|
7412
7412
|
${indentation}`;
|
|
7413
7413
|
let res = "";
|
|
7414
7414
|
let separator = "";
|
|
7415
7415
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
7416
7416
|
if (isTypedArrayWithEntries(value)) {
|
|
7417
|
-
res += stringifyTypedArray(value,
|
|
7417
|
+
res += stringifyTypedArray(value, join37, maximumBreadth);
|
|
7418
7418
|
keys = keys.slice(value.length);
|
|
7419
7419
|
maximumPropertiesToStringify -= value.length;
|
|
7420
|
-
separator =
|
|
7420
|
+
separator = join37;
|
|
7421
7421
|
}
|
|
7422
7422
|
if (deterministic) {
|
|
7423
7423
|
keys = sort(keys, comparator);
|
|
@@ -7428,13 +7428,13 @@ ${indentation}`;
|
|
|
7428
7428
|
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
7429
7429
|
if (tmp !== void 0) {
|
|
7430
7430
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
7431
|
-
separator =
|
|
7431
|
+
separator = join37;
|
|
7432
7432
|
}
|
|
7433
7433
|
}
|
|
7434
7434
|
if (keyLength > maximumBreadth) {
|
|
7435
7435
|
const removedKeys = keyLength - maximumBreadth;
|
|
7436
7436
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
7437
|
-
separator =
|
|
7437
|
+
separator = join37;
|
|
7438
7438
|
}
|
|
7439
7439
|
if (separator !== "") {
|
|
7440
7440
|
res = `
|
|
@@ -65903,8 +65903,8 @@ var require_core = __commonJS({
|
|
|
65903
65903
|
return this;
|
|
65904
65904
|
}
|
|
65905
65905
|
case "object": {
|
|
65906
|
-
const
|
|
65907
|
-
this._cache.delete(
|
|
65906
|
+
const cacheKey3 = schemaKeyRef;
|
|
65907
|
+
this._cache.delete(cacheKey3);
|
|
65908
65908
|
let id = schemaKeyRef[this.opts.schemaId];
|
|
65909
65909
|
if (id) {
|
|
65910
65910
|
id = (0, resolve_1.normalizeId)(id);
|
|
@@ -66069,11 +66069,11 @@ var require_core = __commonJS({
|
|
|
66069
66069
|
Ajv2.ValidationError = validation_error_1.default;
|
|
66070
66070
|
Ajv2.MissingRefError = ref_error_1.default;
|
|
66071
66071
|
exports.default = Ajv2;
|
|
66072
|
-
function checkOptions(checkOpts, options2, msg,
|
|
66072
|
+
function checkOptions(checkOpts, options2, msg, log47 = "error") {
|
|
66073
66073
|
for (const key in checkOpts) {
|
|
66074
66074
|
const opt = key;
|
|
66075
66075
|
if (opt in options2)
|
|
66076
|
-
this.logger[
|
|
66076
|
+
this.logger[log47](`${msg}: option ${key}. ${checkOpts[opt]}`);
|
|
66077
66077
|
}
|
|
66078
66078
|
}
|
|
66079
66079
|
function getSchEnv(keyRef) {
|
|
@@ -68557,7 +68557,7 @@ var require_dist5 = __commonJS({
|
|
|
68557
68557
|
// start-server.ts
|
|
68558
68558
|
import { appendFileSync, createReadStream as createReadStream3, mkdirSync as mkdirSync8, readFileSync as readFileSync8, statSync as statSync10 } from "node:fs";
|
|
68559
68559
|
import { createServer } from "node:http";
|
|
68560
|
-
import { basename as basename5, join as
|
|
68560
|
+
import { basename as basename5, join as join36, resolve as resolve11, sep as sep8 } from "node:path";
|
|
68561
68561
|
|
|
68562
68562
|
// ../../node_modules/.pnpm/@trpc+server@11.12.0_typescript@5.9.3/node_modules/@trpc/server/dist/codes-DagpWZLc.mjs
|
|
68563
68563
|
function mergeWithoutOverrides(obj1, ...objs) {
|
|
@@ -68681,8 +68681,8 @@ var freezeIfAvailable = (obj) => {
|
|
|
68681
68681
|
};
|
|
68682
68682
|
function createInnerProxy(callback, path, memo3) {
|
|
68683
68683
|
var _memo$cacheKey;
|
|
68684
|
-
const
|
|
68685
|
-
(_memo$cacheKey = memo3[
|
|
68684
|
+
const cacheKey3 = path.join(".");
|
|
68685
|
+
(_memo$cacheKey = memo3[cacheKey3]) !== null && _memo$cacheKey !== void 0 || (memo3[cacheKey3] = new Proxy(noop, {
|
|
68686
68686
|
get(_obj, key) {
|
|
68687
68687
|
if (typeof key !== "string" || key === "then") return void 0;
|
|
68688
68688
|
return createInnerProxy(callback, [...path, key], memo3);
|
|
@@ -68706,7 +68706,7 @@ function createInnerProxy(callback, path, memo3) {
|
|
|
68706
68706
|
return callback(opts);
|
|
68707
68707
|
}
|
|
68708
68708
|
}));
|
|
68709
|
-
return memo3[
|
|
68709
|
+
return memo3[cacheKey3];
|
|
68710
68710
|
}
|
|
68711
68711
|
var createRecursiveProxy = (callback) => createInnerProxy(callback, [], emptyObject());
|
|
68712
68712
|
var JSONRPC2_TO_HTTP_CODE = {
|
|
@@ -89183,7 +89183,7 @@ function sql(strings, ...params) {
|
|
|
89183
89183
|
return new SQL([new StringChunk(str)]);
|
|
89184
89184
|
}
|
|
89185
89185
|
_sql.raw = raw;
|
|
89186
|
-
function
|
|
89186
|
+
function join37(chunks, separator) {
|
|
89187
89187
|
const result = [];
|
|
89188
89188
|
for (const [i, chunk] of chunks.entries()) {
|
|
89189
89189
|
if (i > 0 && separator !== void 0) result.push(separator);
|
|
@@ -89191,7 +89191,7 @@ function sql(strings, ...params) {
|
|
|
89191
89191
|
}
|
|
89192
89192
|
return new SQL(result);
|
|
89193
89193
|
}
|
|
89194
|
-
_sql.join =
|
|
89194
|
+
_sql.join = join37;
|
|
89195
89195
|
function identifier(value) {
|
|
89196
89196
|
return new Name(value);
|
|
89197
89197
|
}
|
|
@@ -93698,7 +93698,7 @@ var SQLiteSelectQueryBuilderBase = class extends TypedQueryBuilder {
|
|
|
93698
93698
|
const baseTableName = this.tableName;
|
|
93699
93699
|
const tableName = getTableLikeName(table);
|
|
93700
93700
|
for (const item of extractUsedTable(table)) this.usedTables.add(item);
|
|
93701
|
-
if (typeof tableName === "string" && this.config.joins?.some((
|
|
93701
|
+
if (typeof tableName === "string" && this.config.joins?.some((join37) => join37.alias === tableName)) throw new Error(`Alias "${tableName}" is already used in this query`);
|
|
93702
93702
|
if (!this.isPartialSelect) {
|
|
93703
93703
|
if (Object.keys(this.joinsNotNullableMap).length === 1 && typeof baseTableName === "string") this.config.fields = { [baseTableName]: this.config.fields };
|
|
93704
93704
|
if (typeof tableName === "string" && !is(table, SQL)) {
|
|
@@ -94906,7 +94906,7 @@ var SQLiteDialect = class {
|
|
|
94906
94906
|
if (!joins2) return;
|
|
94907
94907
|
const withEntries = Object.entries(joins2).filter(([_2, v2]) => v2);
|
|
94908
94908
|
if (!withEntries.length) return;
|
|
94909
|
-
return sql.join(withEntries.map(([k4,
|
|
94909
|
+
return sql.join(withEntries.map(([k4, join37]) => {
|
|
94910
94910
|
const relation = tableConfig.relations[k4];
|
|
94911
94911
|
const isSingle2 = is(relation, One);
|
|
94912
94912
|
const targetTable = aliasedTable(relation.targetTable, `d${currentDepth + 1}`);
|
|
@@ -94917,7 +94917,7 @@ var SQLiteDialect = class {
|
|
|
94917
94917
|
table: targetTable,
|
|
94918
94918
|
mode: isSingle2 ? "first" : "many",
|
|
94919
94919
|
schema,
|
|
94920
|
-
queryConfig:
|
|
94920
|
+
queryConfig: join37,
|
|
94921
94921
|
tableConfig: schema[relation.targetTableName],
|
|
94922
94922
|
relationWhere: filter,
|
|
94923
94923
|
isNested: true,
|
|
@@ -94931,7 +94931,7 @@ var SQLiteDialect = class {
|
|
|
94931
94931
|
key: k4,
|
|
94932
94932
|
selection: innerQuery.selection,
|
|
94933
94933
|
isArray: !isSingle2,
|
|
94934
|
-
isOptional: (relation.optional ?? false) ||
|
|
94934
|
+
isOptional: (relation.optional ?? false) || join37 !== true && !!join37.where
|
|
94935
94935
|
});
|
|
94936
94936
|
const jsonColumns = sql.join(innerQuery.selection.map((s2) => {
|
|
94937
94937
|
return sql`${sql.raw(this.escapeString(s2.key))}, ${s2.selection ? sql`${jsonb2}(${sql.identifier(s2.key)})` : sql.identifier(s2.key)}`;
|
|
@@ -95400,7 +95400,7 @@ var SQLiteUpdateBase = class extends QueryPromise {
|
|
|
95400
95400
|
createJoin(joinType) {
|
|
95401
95401
|
return ((table, on) => {
|
|
95402
95402
|
const tableName = getTableLikeName(table);
|
|
95403
|
-
if (typeof tableName === "string" && this.config.joins.some((
|
|
95403
|
+
if (typeof tableName === "string" && this.config.joins.some((join37) => join37.alias === tableName)) throw new Error(`Alias "${tableName}" is already used in this query`);
|
|
95404
95404
|
if (typeof on === "function") {
|
|
95405
95405
|
const from = this.config.from ? is(table, SQLiteTable) ? table[Table.Symbol.Columns] : is(table, Subquery) ? table._.selectedFields : is(table, SQLiteViewBase) ? table[ViewBaseConfig].selectedFields : void 0 : void 0;
|
|
95406
95406
|
on = on(new Proxy(this.config.table[Table.Symbol.Columns], new SelectionProxyHandler({
|
|
@@ -101200,6 +101200,7 @@ var settingsUpdateInput = external_exports2.object({
|
|
|
101200
101200
|
useWebGLTerminalRenderer: external_exports2.boolean().optional(),
|
|
101201
101201
|
webBrowserCdpEnabled: external_exports2.boolean().optional(),
|
|
101202
101202
|
theme: external_exports2.enum(["system", "light", "dark"]).optional(),
|
|
101203
|
+
translucentSidebar: external_exports2.boolean().optional(),
|
|
101203
101204
|
// Retention window for the Reports `usage_events` table
|
|
101204
101205
|
// (issue #425). Bounded to [1, 3650] days so a stray UI value
|
|
101205
101206
|
// can't accidentally configure a 100-year window (which would
|
|
@@ -110583,10 +110584,10 @@ function DialogOverlay2({
|
|
|
110583
110584
|
);
|
|
110584
110585
|
}
|
|
110585
110586
|
var DIALOG_CONTENT_VARIANTS = {
|
|
110586
|
-
default: "ease-out fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
|
|
110587
|
+
default: "ease-out fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
|
|
110587
110588
|
"bottom-sheet": [
|
|
110588
110589
|
// Shared
|
|
110589
|
-
"ease-out fixed z-50 flex flex-col bg-background shadow-lg duration-200 outline-none",
|
|
110590
|
+
"ease-out fixed z-50 flex flex-col border-border bg-background shadow-lg duration-200 outline-none",
|
|
110590
110591
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
110591
110592
|
// Mobile (< lg): bottom drawer
|
|
110592
110593
|
"inset-x-0 bottom-0 w-full max-w-none rounded-t-2xl border border-b-0 p-6",
|
|
@@ -110598,7 +110599,7 @@ var DIALOG_CONTENT_VARIANTS = {
|
|
|
110598
110599
|
].join(" "),
|
|
110599
110600
|
"command-palette": [
|
|
110600
110601
|
// Shared
|
|
110601
|
-
"fixed z-50 flex flex-col bg-background shadow-lg outline-none",
|
|
110602
|
+
"fixed z-50 flex flex-col border-border bg-background shadow-lg outline-none",
|
|
110602
110603
|
// Mobile-only open/close animation: the drawer slide is touch-initiated.
|
|
110603
110604
|
// Desktop (lg+) gets NO open/close animation — this is a keyboard-summoned
|
|
110604
110605
|
// surface hit dozens of times a day; it must appear instantly.
|
|
@@ -113837,29 +113838,26 @@ var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
|
|
|
113837
113838
|
// src/dashboard/components/DashboardShell.tsx
|
|
113838
113839
|
var import_react28 = __toESM(require_react(), 1);
|
|
113839
113840
|
|
|
113840
|
-
// src/dashboard/hooks/use-app-update.ts
|
|
113841
|
-
var import_react15 = __toESM(require_react(), 1);
|
|
113842
|
-
|
|
113843
113841
|
// src/dashboard/hooks/use-cli-setup.ts
|
|
113844
|
-
var
|
|
113842
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
113845
113843
|
|
|
113846
113844
|
// src/dashboard/hooks/use-collapse-state.ts
|
|
113847
|
-
var
|
|
113845
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
113848
113846
|
|
|
113849
113847
|
// src/dashboard/hooks/use-hooks-setup.ts
|
|
113850
|
-
var
|
|
113848
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
113851
113849
|
|
|
113852
113850
|
// src/dashboard/hooks/use-label-filter.ts
|
|
113853
|
-
var
|
|
113851
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
113854
113852
|
|
|
113855
113853
|
// src/dashboard/hooks/use-label-last-workspace.ts
|
|
113856
|
-
var
|
|
113854
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
113857
113855
|
|
|
113858
113856
|
// src/dashboard/hooks/use-projects.ts
|
|
113859
113857
|
var EMPTY_PROJECTS = Object.freeze([]);
|
|
113860
113858
|
|
|
113861
113859
|
// src/dashboard/hooks/use-status.ts
|
|
113862
|
-
var
|
|
113860
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
113863
113861
|
|
|
113864
113862
|
// src/dashboard/components/ProjectList.tsx
|
|
113865
113863
|
var import_core8 = __toESM(require_dist3(), 1);
|
|
@@ -113868,13 +113866,13 @@ var import_utilities = __toESM(require_dist(), 1);
|
|
|
113868
113866
|
var import_react25 = __toESM(require_react(), 1);
|
|
113869
113867
|
|
|
113870
113868
|
// src/dashboard/hooks/use-pinned-workspaces.ts
|
|
113871
|
-
var
|
|
113869
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
113872
113870
|
|
|
113873
113871
|
// src/dashboard/components/DeleteWorkspaceDialog.tsx
|
|
113874
113872
|
var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
|
|
113875
113873
|
|
|
113876
113874
|
// src/dashboard/components/NewWorkspaceForm.tsx
|
|
113877
|
-
var
|
|
113875
|
+
var import_react22 = __toESM(require_react(), 1);
|
|
113878
113876
|
|
|
113879
113877
|
// src/lib/branch-name.ts
|
|
113880
113878
|
function slugifyBranchName(input) {
|
|
@@ -113884,15 +113882,19 @@ function slugifyBranchName(input) {
|
|
|
113884
113882
|
// src/dashboard/components/NewWorkspaceForm.tsx
|
|
113885
113883
|
var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
|
|
113886
113884
|
|
|
113887
|
-
// src/dashboard/components/
|
|
113885
|
+
// src/dashboard/components/ProjectAvatar.tsx
|
|
113886
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
113888
113887
|
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
|
|
113889
113888
|
|
|
113889
|
+
// src/dashboard/components/PromoteToGitDialog.tsx
|
|
113890
|
+
var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
|
|
113891
|
+
|
|
113890
113892
|
// src/dashboard/components/WorkspaceCard.tsx
|
|
113891
113893
|
var import_lucide_react5 = __toESM(require_lucide_react(), 1);
|
|
113892
113894
|
var import_react24 = __toESM(require_react(), 1);
|
|
113893
113895
|
|
|
113894
113896
|
// src/dashboard/components/GitStatusIndicator.tsx
|
|
113895
|
-
var
|
|
113897
|
+
var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
|
|
113896
113898
|
function GitStatusIndicator({ git }) {
|
|
113897
113899
|
const parts = [];
|
|
113898
113900
|
if (git.conflict) {
|
|
@@ -113924,27 +113926,27 @@ function GitStatusIndicator({ git }) {
|
|
|
113924
113926
|
});
|
|
113925
113927
|
}
|
|
113926
113928
|
if (parts.length === 0) return null;
|
|
113927
|
-
return /* @__PURE__ */ (0,
|
|
113928
|
-
/* @__PURE__ */ (0,
|
|
113929
|
-
/* @__PURE__ */ (0,
|
|
113929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Tooltip2, { children: [
|
|
113930
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "inline-flex items-center gap-0.5 font-mono text-[11px] leading-none shrink-0 pr-0.5", children: parts.map((p3) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: p3.color, children: p3.text }, p3.text)) }) }),
|
|
113931
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TooltipContent2, { children: parts.map((p3) => p3.tooltip).join(", ") })
|
|
113930
113932
|
] });
|
|
113931
113933
|
}
|
|
113932
113934
|
|
|
113933
113935
|
// src/dashboard/components/SetupStatusIndicator.tsx
|
|
113934
113936
|
var import_lucide_react4 = __toESM(require_lucide_react(), 1);
|
|
113935
|
-
var
|
|
113937
|
+
var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
|
|
113936
113938
|
function SetupStatusIndicator({ setup }) {
|
|
113937
113939
|
if (!setup) return null;
|
|
113938
113940
|
if (setup.state === "running") {
|
|
113939
|
-
return /* @__PURE__ */ (0,
|
|
113940
|
-
/* @__PURE__ */ (0,
|
|
113941
|
-
/* @__PURE__ */ (0,
|
|
113941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Tooltip2, { children: [
|
|
113942
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react4.Loader, { className: "size-3.5 shrink-0 text-blue-600 dark:text-blue-400 animate-spin" }) }),
|
|
113943
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TooltipContent2, { side: "top", children: "Setting up workspace..." })
|
|
113942
113944
|
] });
|
|
113943
113945
|
}
|
|
113944
113946
|
if (setup.state === "failed") {
|
|
113945
|
-
return /* @__PURE__ */ (0,
|
|
113946
|
-
/* @__PURE__ */ (0,
|
|
113947
|
-
/* @__PURE__ */ (0,
|
|
113947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Tooltip2, { children: [
|
|
113948
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react4.CircleAlert, { className: "size-3.5 shrink-0 text-red-600 dark:text-red-400" }) }),
|
|
113949
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(TooltipContent2, { side: "top", children: [
|
|
113948
113950
|
"Setup failed",
|
|
113949
113951
|
setup.error ? `: ${setup.error}` : ""
|
|
113950
113952
|
] })
|
|
@@ -113954,7 +113956,7 @@ function SetupStatusIndicator({ setup }) {
|
|
|
113954
113956
|
}
|
|
113955
113957
|
|
|
113956
113958
|
// src/dashboard/components/WorkspaceLabel.tsx
|
|
113957
|
-
var
|
|
113959
|
+
var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
|
|
113958
113960
|
function WorkspaceLabel({
|
|
113959
113961
|
name: name3,
|
|
113960
113962
|
projectName,
|
|
@@ -113964,14 +113966,14 @@ function WorkspaceLabel({
|
|
|
113964
113966
|
const nameClass = tone === "switcher" ? `text-foreground ${isActive ? "font-semibold" : "font-medium"}` : isActive ? "font-bold text-foreground" : "font-medium text-foreground/75";
|
|
113965
113967
|
const projectClass = tone === "switcher" ? "text-foreground/70" : isActive ? "text-foreground/80" : "text-foreground/60";
|
|
113966
113968
|
const isSidebar = tone === "sidebar";
|
|
113967
|
-
return /* @__PURE__ */ (0,
|
|
113968
|
-
/* @__PURE__ */ (0,
|
|
113969
|
-
/* @__PURE__ */ (0,
|
|
113969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col min-w-0 leading-tight", children: [
|
|
113970
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: cn(isSidebar ? "text-[13px]" : "text-sm", "truncate", nameClass), children: name3 }),
|
|
113971
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: cn(isSidebar ? "text-[11px]" : "text-xs", "truncate", projectClass), children: projectName })
|
|
113970
113972
|
] });
|
|
113971
113973
|
}
|
|
113972
113974
|
|
|
113973
113975
|
// src/dashboard/components/WorkspaceCard.tsx
|
|
113974
|
-
var
|
|
113976
|
+
var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
|
|
113975
113977
|
var RECENT_ACTIVATION_WINDOW_MS = 300;
|
|
113976
113978
|
var recentlyActivatedWorkspaceId = null;
|
|
113977
113979
|
var recentlyActivatedTimer = null;
|
|
@@ -114081,21 +114083,21 @@ var WorkspaceCard = (0, import_react24.memo)(function WorkspaceCard2({
|
|
|
114081
114083
|
});
|
|
114082
114084
|
}
|
|
114083
114085
|
};
|
|
114084
|
-
return /* @__PURE__ */ (0,
|
|
114085
|
-
/* @__PURE__ */ (0,
|
|
114086
|
-
/* @__PURE__ */ (0,
|
|
114087
|
-
/* @__PURE__ */ (0,
|
|
114086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenu2, { children: [
|
|
114087
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ContextMenuTrigger2, { asChild: true, disabled: isDeleting, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { ...containerProps, children: [
|
|
114088
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Tooltip2, { delayDuration: 800, children: [
|
|
114089
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center gap-2 min-w-0 overflow-hidden", children: [
|
|
114088
114090
|
isRoot ? (
|
|
114089
114091
|
// On the root card the house is AgentStatusIndicator's idle
|
|
114090
114092
|
// fallback (the slot other cards use for the branch glyph),
|
|
114091
114093
|
// so an active agent's status dot replaces the house rather
|
|
114092
114094
|
// than sitting beside it.
|
|
114093
|
-
/* @__PURE__ */ (0,
|
|
114095
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
114094
114096
|
AgentStatusIndicator,
|
|
114095
114097
|
{
|
|
114096
114098
|
agent: status?.agent,
|
|
114097
114099
|
isActive,
|
|
114098
|
-
fallback: /* @__PURE__ */ (0,
|
|
114100
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
114099
114101
|
import_lucide_react5.Home,
|
|
114100
114102
|
{
|
|
114101
114103
|
"data-testid": "workspace-card__home-icon",
|
|
@@ -114104,14 +114106,14 @@ var WorkspaceCard = (0, import_react24.memo)(function WorkspaceCard2({
|
|
|
114104
114106
|
)
|
|
114105
114107
|
}
|
|
114106
114108
|
)
|
|
114107
|
-
) : /* @__PURE__ */ (0,
|
|
114109
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AgentStatusIndicator, { agent: status?.agent, isActive }),
|
|
114108
114110
|
showProjectName ? (
|
|
114109
114111
|
// Pinned section: stack the branch name over the project name
|
|
114110
114112
|
// as a compact two-line block so a mixed list of pinned cards
|
|
114111
114113
|
// stays scannable without a long, mid-truncated
|
|
114112
114114
|
// `project/branch` string on one line. Shared with the ⌘K
|
|
114113
114115
|
// workspace picker via `WorkspaceLabel`.
|
|
114114
|
-
/* @__PURE__ */ (0,
|
|
114116
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
114115
114117
|
WorkspaceLabel,
|
|
114116
114118
|
{
|
|
114117
114119
|
name: worktree.name,
|
|
@@ -114119,7 +114121,7 @@ var WorkspaceCard = (0, import_react24.memo)(function WorkspaceCard2({
|
|
|
114119
114121
|
isActive
|
|
114120
114122
|
}
|
|
114121
114123
|
)
|
|
114122
|
-
) : /* @__PURE__ */ (0,
|
|
114124
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
114123
114125
|
"span",
|
|
114124
114126
|
{
|
|
114125
114127
|
className: `text-[13px] truncate ${isActive ? "font-bold text-foreground" : "font-medium text-foreground/75"}`,
|
|
@@ -114127,64 +114129,64 @@ var WorkspaceCard = (0, import_react24.memo)(function WorkspaceCard2({
|
|
|
114127
114129
|
}
|
|
114128
114130
|
)
|
|
114129
114131
|
] }) }),
|
|
114130
|
-
/* @__PURE__ */ (0,
|
|
114132
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TooltipContent2, { side: "right", children: `${projectName}/${worktree.name}` })
|
|
114131
114133
|
] }),
|
|
114132
|
-
isDeleting && /* @__PURE__ */ (0,
|
|
114134
|
+
isDeleting && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
114133
114135
|
"span",
|
|
114134
114136
|
{
|
|
114135
114137
|
"data-testid": "workspace-card__deleting",
|
|
114136
114138
|
className: "flex items-center gap-1 shrink-0 ml-auto pl-2 text-xs text-muted-foreground",
|
|
114137
114139
|
children: [
|
|
114138
|
-
/* @__PURE__ */ (0,
|
|
114140
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.Loader, { className: "size-3.5 animate-spin" }),
|
|
114139
114141
|
"Deleting\u2026"
|
|
114140
114142
|
]
|
|
114141
114143
|
}
|
|
114142
114144
|
),
|
|
114143
|
-
/* @__PURE__ */ (0,
|
|
114145
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
114144
114146
|
"div",
|
|
114145
114147
|
{
|
|
114146
114148
|
className: `${isDeleting ? "hidden" : "hidden @[10rem]:flex group-hover:flex"} items-center gap-2 shrink-0 ml-auto pl-2`,
|
|
114147
114149
|
children: [
|
|
114148
|
-
/* @__PURE__ */ (0,
|
|
114149
|
-
!isPlain && branchStatus && /* @__PURE__ */ (0,
|
|
114150
|
-
!isPlain && branchStatus && /* @__PURE__ */ (0,
|
|
114150
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SetupStatusIndicator, { setup: setupStatus }),
|
|
114151
|
+
!isPlain && branchStatus && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GitStatusIndicator, { git: branchStatus.git }),
|
|
114152
|
+
!isPlain && branchStatus && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(CIStatusIndicator, { ci: branchStatus.ci })
|
|
114151
114153
|
]
|
|
114152
114154
|
}
|
|
114153
114155
|
)
|
|
114154
114156
|
] }) }),
|
|
114155
|
-
/* @__PURE__ */ (0,
|
|
114156
|
-
/* @__PURE__ */ (0,
|
|
114157
|
-
/* @__PURE__ */ (0,
|
|
114158
|
-
isPinned ? /* @__PURE__ */ (0,
|
|
114157
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuContent2, { children: [
|
|
114158
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ContextMenuLabel2, { children: "Workspace" }),
|
|
114159
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuItem2, { onClick: () => onTogglePinned(projectName, worktree.name, isPinned), children: [
|
|
114160
|
+
isPinned ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.PinOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.Pin, {}),
|
|
114159
114161
|
isPinned ? "Unpin workspace" : "Pin workspace"
|
|
114160
114162
|
] }),
|
|
114161
|
-
/* @__PURE__ */ (0,
|
|
114162
|
-
capabilities.copyPath && /* @__PURE__ */ (0,
|
|
114163
|
-
/* @__PURE__ */ (0,
|
|
114163
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ContextMenuSeparator2, {}),
|
|
114164
|
+
capabilities.copyPath && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuItem2, { onClick: () => navigator.clipboard.writeText(worktree.path), children: [
|
|
114165
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.Clipboard, {}),
|
|
114164
114166
|
"Copy path"
|
|
114165
114167
|
] }),
|
|
114166
|
-
capabilities.revealInFinder && /* @__PURE__ */ (0,
|
|
114167
|
-
/* @__PURE__ */ (0,
|
|
114168
|
+
capabilities.revealInFinder && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuItem2, { onClick: () => capabilities.revealInFinder(worktree.path), children: [
|
|
114169
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.FolderOpen, {}),
|
|
114168
114170
|
"Open in Finder"
|
|
114169
114171
|
] }),
|
|
114170
|
-
worktree.hasSetup && /* @__PURE__ */ (0,
|
|
114171
|
-
/* @__PURE__ */ (0,
|
|
114172
|
+
worktree.hasSetup && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuItem2, { onClick: () => runScript(worktree.path, "setup"), children: [
|
|
114173
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.Play, {}),
|
|
114172
114174
|
"Run setup"
|
|
114173
114175
|
] }),
|
|
114174
|
-
worktree.hasTeardown && /* @__PURE__ */ (0,
|
|
114175
|
-
/* @__PURE__ */ (0,
|
|
114176
|
+
worktree.hasTeardown && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuItem2, { onClick: () => runScript(worktree.path, "teardown"), children: [
|
|
114177
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.Square, {}),
|
|
114176
114178
|
"Run teardown"
|
|
114177
114179
|
] }),
|
|
114178
|
-
!isPlain && /* @__PURE__ */ (0,
|
|
114179
|
-
/* @__PURE__ */ (0,
|
|
114180
|
+
!isPlain && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuItem2, { onClick: () => gitPull(projectName, worktree.name), children: [
|
|
114181
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.ArrowDownToLine, {}),
|
|
114180
114182
|
"Git pull"
|
|
114181
114183
|
] }),
|
|
114182
|
-
!isPlain && /* @__PURE__ */ (0,
|
|
114183
|
-
/* @__PURE__ */ (0,
|
|
114184
|
+
!isPlain && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuItem2, { onClick: () => gitPush(projectName, worktree.name), children: [
|
|
114185
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.ArrowUpFromLine, {}),
|
|
114184
114186
|
"Git push"
|
|
114185
114187
|
] }),
|
|
114186
|
-
!isPlain && worktree.name !== defaultBranch && /* @__PURE__ */ (0,
|
|
114187
|
-
/* @__PURE__ */ (0,
|
|
114188
|
+
!isPlain && worktree.name !== defaultBranch && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ContextMenuItem2, { variant: "destructive", onClick: handleDelete, children: [
|
|
114189
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react5.Trash2, {}),
|
|
114188
114190
|
"Delete workspace"
|
|
114189
114191
|
] })
|
|
114190
114192
|
] })
|
|
@@ -114192,7 +114194,7 @@ var WorkspaceCard = (0, import_react24.memo)(function WorkspaceCard2({
|
|
|
114192
114194
|
});
|
|
114193
114195
|
|
|
114194
114196
|
// src/dashboard/components/ProjectList.tsx
|
|
114195
|
-
var
|
|
114197
|
+
var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
|
|
114196
114198
|
|
|
114197
114199
|
// src/dashboard/components/SettingsPage.tsx
|
|
114198
114200
|
var import_react27 = __toESM(require_react(), 1);
|
|
@@ -114201,16 +114203,16 @@ var import_react27 = __toESM(require_react(), 1);
|
|
|
114201
114203
|
var import_react26 = __toESM(require_react(), 1);
|
|
114202
114204
|
|
|
114203
114205
|
// src/dashboard/components/settings/SettingsRow.tsx
|
|
114204
|
-
var
|
|
114206
|
+
var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
|
|
114205
114207
|
|
|
114206
114208
|
// src/dashboard/components/settings/SettingsSection.tsx
|
|
114207
|
-
var
|
|
114209
|
+
var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
|
|
114208
114210
|
|
|
114209
114211
|
// src/dashboard/components/SettingsPage.tsx
|
|
114210
|
-
var
|
|
114212
|
+
var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
|
|
114211
114213
|
|
|
114212
114214
|
// src/dashboard/components/DashboardShell.tsx
|
|
114213
|
-
var
|
|
114215
|
+
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
|
|
114214
114216
|
var isElectron = typeof window !== "undefined" && "__BAND_DESKTOP__" in window;
|
|
114215
114217
|
|
|
114216
114218
|
// src/dashboard/components/DiffFileContent.tsx
|
|
@@ -114270,7 +114272,7 @@ var SUPPORTED_LANGUAGES = [
|
|
|
114270
114272
|
var LANGUAGE_LABEL_BY_ID = new Map(SUPPORTED_LANGUAGES.map((l) => [l.id, l.label]));
|
|
114271
114273
|
|
|
114272
114274
|
// src/dashboard/components/DiffFileContent.tsx
|
|
114273
|
-
var
|
|
114275
|
+
var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
|
|
114274
114276
|
var diffTheme = EditorView.theme({
|
|
114275
114277
|
".cm-insertedLine": { backgroundColor: "rgba(34, 197, 94, 0.1)" },
|
|
114276
114278
|
".cm-deletedLine": { backgroundColor: "rgba(239, 68, 68, 0.1)" },
|
|
@@ -114321,12 +114323,12 @@ var diffTheme = EditorView.theme({
|
|
|
114321
114323
|
|
|
114322
114324
|
// src/dashboard/components/DiffOverviewRuler.tsx
|
|
114323
114325
|
var import_react30 = __toESM(require_react(), 1);
|
|
114324
|
-
var
|
|
114326
|
+
var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
|
|
114325
114327
|
|
|
114326
114328
|
// src/dashboard/components/FileBrowser.tsx
|
|
114327
114329
|
var import_lucide_react6 = __toESM(require_lucide_react(), 1);
|
|
114328
114330
|
var import_react31 = __toESM(require_react(), 1);
|
|
114329
|
-
var
|
|
114331
|
+
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
|
|
114330
114332
|
var DRAG_MIME = "application/x-band-tree-entry";
|
|
114331
114333
|
var DRAG_EXPAND_DELAY_MS = 600;
|
|
114332
114334
|
function parentOf(path) {
|
|
@@ -114424,21 +114426,21 @@ function EntryNameInput({
|
|
|
114424
114426
|
}
|
|
114425
114427
|
};
|
|
114426
114428
|
const Icon = kind === "directory" ? import_lucide_react6.Folder : import_lucide_react6.File;
|
|
114427
|
-
return /* @__PURE__ */ (0,
|
|
114428
|
-
/* @__PURE__ */ (0,
|
|
114429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex w-full flex-col", style: { paddingLeft: `${depth * indent + basePad}px` }, children: [
|
|
114430
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114429
114431
|
"div",
|
|
114430
114432
|
{
|
|
114431
114433
|
className: `flex items-center ${compact ? "h-[28px] gap-1 pr-3 text-[13px]" : "h-[32px] gap-1.5 pr-4 text-[15px]"}`,
|
|
114432
114434
|
style: { height },
|
|
114433
114435
|
children: [
|
|
114434
|
-
/* @__PURE__ */ (0,
|
|
114435
|
-
/* @__PURE__ */ (0,
|
|
114436
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "size-3.5 shrink-0" }),
|
|
114437
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
114436
114438
|
Icon,
|
|
114437
114439
|
{
|
|
114438
114440
|
className: kind === "directory" ? "size-4 shrink-0 text-blue-600 dark:text-blue-400" : "size-4 shrink-0 text-muted-foreground"
|
|
114439
114441
|
}
|
|
114440
114442
|
),
|
|
114441
|
-
/* @__PURE__ */ (0,
|
|
114443
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
114442
114444
|
"input",
|
|
114443
114445
|
{
|
|
114444
114446
|
ref: inputRef,
|
|
@@ -114476,7 +114478,7 @@ function EntryNameInput({
|
|
|
114476
114478
|
]
|
|
114477
114479
|
}
|
|
114478
114480
|
),
|
|
114479
|
-
error40 && /* @__PURE__ */ (0,
|
|
114481
|
+
error40 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
114480
114482
|
"div",
|
|
114481
114483
|
{
|
|
114482
114484
|
className: "pointer-events-none text-xs text-destructive",
|
|
@@ -114549,7 +114551,7 @@ function TreeNode2({
|
|
|
114549
114551
|
onOpenFilePinned(entryPath);
|
|
114550
114552
|
}
|
|
114551
114553
|
};
|
|
114552
|
-
const button = /* @__PURE__ */ (0,
|
|
114554
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114553
114555
|
"button",
|
|
114554
114556
|
{
|
|
114555
114557
|
ref: isSelected ? selectedRef : void 0,
|
|
@@ -114569,15 +114571,15 @@ function TreeNode2({
|
|
|
114569
114571
|
className: `flex w-full items-center text-left select-none hover:bg-accent/50 [-webkit-touch-callout:none] ${compact ? "h-[28px] gap-1 pr-3 text-[13px]" : "h-[32px] gap-1.5 pr-4 text-[15px]"} ${isSelected ? "bg-blue-500/30 text-foreground outline outline-1 -outline-offset-1 outline-blue-400/60 hover:bg-blue-500/30 dark:bg-blue-500/40 dark:outline-blue-400/70 dark:hover:bg-blue-500/40" : ""} ${isCut ? "opacity-50" : ""} ${isDropTarget ? "bg-blue-500/20 outline outline-1 -outline-offset-1 outline-blue-400/60" : ""}`,
|
|
114570
114572
|
style: { paddingLeft: `${depth * indent + basePad}px` },
|
|
114571
114573
|
children: [
|
|
114572
|
-
isDir ? isExpanded ? /* @__PURE__ */ (0,
|
|
114574
|
+
isDir ? isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.ChevronDown, { className: "size-3.5 shrink-0 text-muted-foreground/70" }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.ChevronRight, { className: "size-3.5 shrink-0 text-muted-foreground/70" }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "size-3.5 shrink-0" }),
|
|
114573
114575
|
isDir ? (() => {
|
|
114574
114576
|
const FolderIcon = getFolderIcon(entry.name, isExpanded);
|
|
114575
|
-
return /* @__PURE__ */ (0,
|
|
114577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(FolderIcon, { className: "size-4 shrink-0" });
|
|
114576
114578
|
})() : (() => {
|
|
114577
114579
|
const FileIcon = getFileIcon(entry.name);
|
|
114578
|
-
return /* @__PURE__ */ (0,
|
|
114580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(FileIcon, { className: "size-4 shrink-0" });
|
|
114579
114581
|
})(),
|
|
114580
|
-
/* @__PURE__ */ (0,
|
|
114582
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "min-w-0 flex-1 truncate", children: entry.name })
|
|
114581
114583
|
]
|
|
114582
114584
|
}
|
|
114583
114585
|
);
|
|
@@ -114600,7 +114602,7 @@ function TreeNode2({
|
|
|
114600
114602
|
// a padding div with `depth={0}` would double-apply `basePad`, shifting
|
|
114601
114603
|
// the input ~4px to the right and giving it visibly less horizontal
|
|
114602
114604
|
// room than the rest of the tree.
|
|
114603
|
-
/* @__PURE__ */ (0,
|
|
114605
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
114604
114606
|
EntryNameInput,
|
|
114605
114607
|
{
|
|
114606
114608
|
kind: isDir ? "directory" : "file",
|
|
@@ -114614,130 +114616,130 @@ function TreeNode2({
|
|
|
114614
114616
|
},
|
|
114615
114617
|
`rename-${entryPath}`
|
|
114616
114618
|
)
|
|
114617
|
-
) : /* @__PURE__ */ (0,
|
|
114619
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114618
114620
|
ContextMenu2,
|
|
114619
114621
|
{
|
|
114620
114622
|
onOpenChange: (open3) => {
|
|
114621
114623
|
if (open3) onSelectRow(entryPath, isDir ? "directory" : "file");
|
|
114622
114624
|
},
|
|
114623
114625
|
children: [
|
|
114624
|
-
/* @__PURE__ */ (0,
|
|
114625
|
-
/* @__PURE__ */ (0,
|
|
114626
|
-
isDir && /* @__PURE__ */ (0,
|
|
114627
|
-
/* @__PURE__ */ (0,
|
|
114626
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextMenuTrigger2, { asChild: true, children: button }),
|
|
114627
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ContextMenuContent2, { onCloseAutoFocus: menu.flush, children: [
|
|
114628
|
+
isDir && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
114629
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114628
114630
|
ContextMenuItem2,
|
|
114629
114631
|
{
|
|
114630
114632
|
"data-testid": "file-tree__new-file",
|
|
114631
114633
|
onSelect: () => menu.queue(() => onRequestNewEntry(entryPath, "file")),
|
|
114632
114634
|
children: [
|
|
114633
|
-
/* @__PURE__ */ (0,
|
|
114635
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.File, { className: "size-4" }),
|
|
114634
114636
|
"New File"
|
|
114635
114637
|
]
|
|
114636
114638
|
}
|
|
114637
114639
|
),
|
|
114638
|
-
/* @__PURE__ */ (0,
|
|
114640
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114639
114641
|
ContextMenuItem2,
|
|
114640
114642
|
{
|
|
114641
114643
|
"data-testid": "file-tree__new-folder",
|
|
114642
114644
|
onSelect: () => menu.queue(() => onRequestNewEntry(entryPath, "directory")),
|
|
114643
114645
|
children: [
|
|
114644
|
-
/* @__PURE__ */ (0,
|
|
114646
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.FolderPlus, { className: "size-4" }),
|
|
114645
114647
|
"New Folder"
|
|
114646
114648
|
]
|
|
114647
114649
|
}
|
|
114648
114650
|
),
|
|
114649
|
-
/* @__PURE__ */ (0,
|
|
114651
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextMenuSeparator2, {})
|
|
114650
114652
|
] }),
|
|
114651
|
-
onRevealInFinder && /* @__PURE__ */ (0,
|
|
114652
|
-
/* @__PURE__ */ (0,
|
|
114653
|
+
onRevealInFinder && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
114654
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114653
114655
|
ContextMenuItem2,
|
|
114654
114656
|
{
|
|
114655
114657
|
"data-testid": "file-tree__reveal-in-finder",
|
|
114656
114658
|
onSelect: () => menu.queue(() => onRevealInFinder(entryPath)),
|
|
114657
114659
|
children: [
|
|
114658
|
-
/* @__PURE__ */ (0,
|
|
114660
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.FolderOpen, { className: "size-4" }),
|
|
114659
114661
|
"Reveal in Finder"
|
|
114660
114662
|
]
|
|
114661
114663
|
}
|
|
114662
114664
|
),
|
|
114663
|
-
/* @__PURE__ */ (0,
|
|
114665
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextMenuSeparator2, {})
|
|
114664
114666
|
] }),
|
|
114665
|
-
canCut && /* @__PURE__ */ (0,
|
|
114667
|
+
canCut && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114666
114668
|
ContextMenuItem2,
|
|
114667
114669
|
{
|
|
114668
114670
|
"data-testid": "file-tree__cut",
|
|
114669
114671
|
onSelect: () => menu.queue(() => onCut(entryPath, isDir ? "directory" : "file")),
|
|
114670
114672
|
children: [
|
|
114671
|
-
/* @__PURE__ */ (0,
|
|
114673
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.Scissors, { className: "size-4" }),
|
|
114672
114674
|
"Cut"
|
|
114673
114675
|
]
|
|
114674
114676
|
}
|
|
114675
114677
|
),
|
|
114676
|
-
canCopy && /* @__PURE__ */ (0,
|
|
114678
|
+
canCopy && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114677
114679
|
ContextMenuItem2,
|
|
114678
114680
|
{
|
|
114679
114681
|
"data-testid": "file-tree__copy",
|
|
114680
114682
|
onSelect: () => menu.queue(() => onCopy(entryPath, isDir ? "directory" : "file")),
|
|
114681
114683
|
children: [
|
|
114682
|
-
/* @__PURE__ */ (0,
|
|
114684
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.Copy, { className: "size-4" }),
|
|
114683
114685
|
"Copy"
|
|
114684
114686
|
]
|
|
114685
114687
|
}
|
|
114686
114688
|
),
|
|
114687
|
-
canPaste && /* @__PURE__ */ (0,
|
|
114689
|
+
canPaste && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114688
114690
|
ContextMenuItem2,
|
|
114689
114691
|
{
|
|
114690
114692
|
"data-testid": "file-tree__paste",
|
|
114691
114693
|
onSelect: () => menu.queue(() => void onPaste(dropFolder)),
|
|
114692
114694
|
children: [
|
|
114693
|
-
/* @__PURE__ */ (0,
|
|
114695
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.ClipboardPaste, { className: "size-4" }),
|
|
114694
114696
|
"Paste"
|
|
114695
114697
|
]
|
|
114696
114698
|
}
|
|
114697
114699
|
),
|
|
114698
|
-
(canCut || canCopy || canPaste) && /* @__PURE__ */ (0,
|
|
114699
|
-
/* @__PURE__ */ (0,
|
|
114700
|
+
(canCut || canCopy || canPaste) && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextMenuSeparator2, {}),
|
|
114701
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114700
114702
|
ContextMenuItem2,
|
|
114701
114703
|
{
|
|
114702
114704
|
"data-testid": "file-tree__copy-relative-path",
|
|
114703
114705
|
onSelect: () => menu.queue(() => void writeClipboardText(entryPath)),
|
|
114704
114706
|
children: [
|
|
114705
|
-
/* @__PURE__ */ (0,
|
|
114707
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.ClipboardCopy, { className: "size-4" }),
|
|
114706
114708
|
"Copy relative path"
|
|
114707
114709
|
]
|
|
114708
114710
|
}
|
|
114709
114711
|
),
|
|
114710
|
-
workspacePath && /* @__PURE__ */ (0,
|
|
114712
|
+
workspacePath && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114711
114713
|
ContextMenuItem2,
|
|
114712
114714
|
{
|
|
114713
114715
|
"data-testid": "file-tree__copy-absolute-path",
|
|
114714
114716
|
onSelect: () => menu.queue(() => void writeClipboardText(joinWorkspacePath(workspacePath, entryPath))),
|
|
114715
114717
|
children: [
|
|
114716
|
-
/* @__PURE__ */ (0,
|
|
114718
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.ClipboardCopy, { className: "size-4" }),
|
|
114717
114719
|
"Copy absolute path"
|
|
114718
114720
|
]
|
|
114719
114721
|
}
|
|
114720
114722
|
),
|
|
114721
|
-
(canRename || canDelete) && /* @__PURE__ */ (0,
|
|
114722
|
-
canRename && /* @__PURE__ */ (0,
|
|
114723
|
+
(canRename || canDelete) && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextMenuSeparator2, {}),
|
|
114724
|
+
canRename && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114723
114725
|
ContextMenuItem2,
|
|
114724
114726
|
{
|
|
114725
114727
|
"data-testid": "file-tree__rename",
|
|
114726
114728
|
onSelect: () => menu.queue(() => onRequestRename(entryPath)),
|
|
114727
114729
|
children: [
|
|
114728
|
-
/* @__PURE__ */ (0,
|
|
114730
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.Pencil, { className: "size-4" }),
|
|
114729
114731
|
"Rename"
|
|
114730
114732
|
]
|
|
114731
114733
|
}
|
|
114732
114734
|
),
|
|
114733
|
-
canDelete && /* @__PURE__ */ (0,
|
|
114735
|
+
canDelete && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
114734
114736
|
ContextMenuItem2,
|
|
114735
114737
|
{
|
|
114736
114738
|
variant: "destructive",
|
|
114737
114739
|
"data-testid": "file-tree__delete",
|
|
114738
114740
|
onSelect: () => menu.queue(() => onRequestDelete(entryPath, isDir ? "directory" : "file")),
|
|
114739
114741
|
children: [
|
|
114740
|
-
/* @__PURE__ */ (0,
|
|
114742
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.Trash2, { className: "size-4" }),
|
|
114741
114743
|
"Delete"
|
|
114742
114744
|
]
|
|
114743
114745
|
}
|
|
@@ -114747,13 +114749,13 @@ function TreeNode2({
|
|
|
114747
114749
|
}
|
|
114748
114750
|
);
|
|
114749
114751
|
const showInlineInput = newEntry?.parentPath === entryPath;
|
|
114750
|
-
return /* @__PURE__ */ (0,
|
|
114752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
114751
114753
|
row,
|
|
114752
114754
|
isExpanded && (() => {
|
|
114753
114755
|
const splitIdx = children?.findIndex((c) => c.type === "file") ?? -1;
|
|
114754
114756
|
const folderChildren = splitIdx === -1 ? children ?? [] : (children ?? []).slice(0, splitIdx);
|
|
114755
114757
|
const fileChildren = splitIdx === -1 ? [] : (children ?? []).slice(splitIdx);
|
|
114756
|
-
const renderChild = (child) => /* @__PURE__ */ (0,
|
|
114758
|
+
const renderChild = (child) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
114757
114759
|
TreeNode2,
|
|
114758
114760
|
{
|
|
114759
114761
|
entry: child,
|
|
@@ -114793,7 +114795,7 @@ function TreeNode2({
|
|
|
114793
114795
|
},
|
|
114794
114796
|
child.name
|
|
114795
114797
|
);
|
|
114796
|
-
const newEntryInput = showInlineInput ? /* @__PURE__ */ (0,
|
|
114798
|
+
const newEntryInput = showInlineInput ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
114797
114799
|
EntryNameInput,
|
|
114798
114800
|
{
|
|
114799
114801
|
kind: newEntry.kind,
|
|
@@ -114805,9 +114807,9 @@ function TreeNode2({
|
|
|
114805
114807
|
},
|
|
114806
114808
|
`new-${newEntry.kind}-${entryPath}`
|
|
114807
114809
|
) : null;
|
|
114808
|
-
return /* @__PURE__ */ (0,
|
|
114810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
114809
114811
|
showInlineInput && newEntry.kind === "directory" && newEntryInput,
|
|
114810
|
-
isLoading && !children?.length && /* @__PURE__ */ (0,
|
|
114812
|
+
isLoading && !children?.length && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
114811
114813
|
"div",
|
|
114812
114814
|
{
|
|
114813
114815
|
className: `flex items-center text-muted-foreground/70 ${compact ? "text-[13px]" : "text-[15px]"}`,
|
|
@@ -114818,7 +114820,7 @@ function TreeNode2({
|
|
|
114818
114820
|
children: "Loading\u2026"
|
|
114819
114821
|
}
|
|
114820
114822
|
),
|
|
114821
|
-
!isLoading && !showInlineInput && children && children.length === 0 && /* @__PURE__ */ (0,
|
|
114823
|
+
!isLoading && !showInlineInput && children && children.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
114822
114824
|
"div",
|
|
114823
114825
|
{
|
|
114824
114826
|
className: `flex items-center italic text-muted-foreground/50 ${compact ? "text-[13px]" : "text-[15px]"}`,
|
|
@@ -115343,7 +115345,7 @@ var FileBrowser = (0, import_react31.forwardRef)(function FileBrowser2({
|
|
|
115343
115345
|
);
|
|
115344
115346
|
const rootMenu = useDeferredMenuAction();
|
|
115345
115347
|
if (!adapter.listWorkspaceFiles) {
|
|
115346
|
-
return /* @__PURE__ */ (0,
|
|
115348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: "File browsing not supported" });
|
|
115347
115349
|
}
|
|
115348
115350
|
const rootEntries = dirContents.get("") ?? [];
|
|
115349
115351
|
const rootLoading = loadingPaths.has("");
|
|
@@ -115392,37 +115394,37 @@ var FileBrowser = (0, import_react31.forwardRef)(function FileBrowser2({
|
|
|
115392
115394
|
void pasteInto(resolveDefaultTarget());
|
|
115393
115395
|
}
|
|
115394
115396
|
};
|
|
115395
|
-
return /* @__PURE__ */ (0,
|
|
115396
|
-
/* @__PURE__ */ (0,
|
|
115397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex h-full flex-col overflow-hidden", onKeyDown: handleKeyDown, children: [
|
|
115398
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
115397
115399
|
ContextMenu2,
|
|
115398
115400
|
{
|
|
115399
115401
|
onOpenChange: (open3) => {
|
|
115400
115402
|
if (open3) clearTreeSelection();
|
|
115401
115403
|
},
|
|
115402
115404
|
children: [
|
|
115403
|
-
operationError && /* @__PURE__ */ (0,
|
|
115405
|
+
operationError && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
115404
115406
|
"div",
|
|
115405
115407
|
{
|
|
115406
115408
|
role: "alert",
|
|
115407
115409
|
"data-testid": "file-tree__error",
|
|
115408
115410
|
className: "mx-2 mt-1 flex shrink-0 items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-2 py-1.5 text-xs text-destructive",
|
|
115409
115411
|
children: [
|
|
115410
|
-
/* @__PURE__ */ (0,
|
|
115411
|
-
/* @__PURE__ */ (0,
|
|
115412
|
-
/* @__PURE__ */ (0,
|
|
115412
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.AlertTriangle, { className: "mt-0.5 size-3.5 shrink-0" }),
|
|
115413
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "min-w-0 flex-1 break-words", children: operationError }),
|
|
115414
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
115413
115415
|
"button",
|
|
115414
115416
|
{
|
|
115415
115417
|
type: "button",
|
|
115416
115418
|
"aria-label": "Dismiss",
|
|
115417
115419
|
onClick: () => setOperationError(null),
|
|
115418
115420
|
className: "shrink-0 rounded-sm hover:bg-destructive/20",
|
|
115419
|
-
children: /* @__PURE__ */ (0,
|
|
115421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.X, { className: "size-3.5" })
|
|
115420
115422
|
}
|
|
115421
115423
|
)
|
|
115422
115424
|
]
|
|
115423
115425
|
}
|
|
115424
115426
|
),
|
|
115425
|
-
/* @__PURE__ */ (0,
|
|
115427
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextMenuTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
115426
115428
|
"div",
|
|
115427
115429
|
{
|
|
115428
115430
|
"data-testid": "file-tree__root",
|
|
@@ -115441,7 +115443,7 @@ var FileBrowser = (0, import_react31.forwardRef)(function FileBrowser2({
|
|
|
115441
115443
|
const rootSplitIdx = rootEntries.findIndex((e) => e.type === "file");
|
|
115442
115444
|
const rootFolders = rootSplitIdx === -1 ? rootEntries : rootEntries.slice(0, rootSplitIdx);
|
|
115443
115445
|
const rootFiles = rootSplitIdx === -1 ? [] : rootEntries.slice(rootSplitIdx);
|
|
115444
|
-
const renderRow = (entry) => /* @__PURE__ */ (0,
|
|
115446
|
+
const renderRow = (entry) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
115445
115447
|
TreeNode2,
|
|
115446
115448
|
{
|
|
115447
115449
|
entry,
|
|
@@ -115481,7 +115483,7 @@ var FileBrowser = (0, import_react31.forwardRef)(function FileBrowser2({
|
|
|
115481
115483
|
},
|
|
115482
115484
|
entry.name
|
|
115483
115485
|
);
|
|
115484
|
-
const rootInput = showRootInput ? /* @__PURE__ */ (0,
|
|
115486
|
+
const rootInput = showRootInput ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
115485
115487
|
EntryNameInput,
|
|
115486
115488
|
{
|
|
115487
115489
|
kind: newEntry.kind,
|
|
@@ -115493,51 +115495,51 @@ var FileBrowser = (0, import_react31.forwardRef)(function FileBrowser2({
|
|
|
115493
115495
|
},
|
|
115494
115496
|
`new-${newEntry.kind}-root`
|
|
115495
115497
|
) : null;
|
|
115496
|
-
return /* @__PURE__ */ (0,
|
|
115498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
115497
115499
|
showRootInput && newEntry.kind === "directory" && rootInput,
|
|
115498
|
-
rootLoading && rootEntries.length === 0 && !showRootInput && /* @__PURE__ */ (0,
|
|
115499
|
-
!rootLoading && rootEntries.length === 0 && !showRootInput && /* @__PURE__ */ (0,
|
|
115500
|
+
rootLoading && rootEntries.length === 0 && !showRootInput && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: "Loading\u2026" }),
|
|
115501
|
+
!rootLoading && rootEntries.length === 0 && !showRootInput && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: "Empty directory" }),
|
|
115500
115502
|
rootFolders.map(renderRow),
|
|
115501
115503
|
showRootInput && newEntry.kind === "file" && rootInput,
|
|
115502
115504
|
rootFiles.map(renderRow)
|
|
115503
115505
|
] });
|
|
115504
115506
|
})(),
|
|
115505
|
-
/* @__PURE__ */ (0,
|
|
115507
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "min-h-[40px] flex-1" })
|
|
115506
115508
|
]
|
|
115507
115509
|
}
|
|
115508
115510
|
) }),
|
|
115509
|
-
/* @__PURE__ */ (0,
|
|
115510
|
-
/* @__PURE__ */ (0,
|
|
115511
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ContextMenuContent2, { onCloseAutoFocus: rootMenu.flush, children: [
|
|
115512
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
115511
115513
|
ContextMenuItem2,
|
|
115512
115514
|
{
|
|
115513
115515
|
"data-testid": "file-tree__new-file",
|
|
115514
115516
|
onSelect: () => rootMenu.queue(() => requestNewEntry("", "file")),
|
|
115515
115517
|
children: [
|
|
115516
|
-
/* @__PURE__ */ (0,
|
|
115518
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.File, { className: "size-4" }),
|
|
115517
115519
|
"New File"
|
|
115518
115520
|
]
|
|
115519
115521
|
}
|
|
115520
115522
|
),
|
|
115521
|
-
/* @__PURE__ */ (0,
|
|
115523
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
115522
115524
|
ContextMenuItem2,
|
|
115523
115525
|
{
|
|
115524
115526
|
"data-testid": "file-tree__new-folder",
|
|
115525
115527
|
onSelect: () => rootMenu.queue(() => requestNewEntry("", "directory")),
|
|
115526
115528
|
children: [
|
|
115527
|
-
/* @__PURE__ */ (0,
|
|
115529
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.FolderPlus, { className: "size-4" }),
|
|
115528
115530
|
"New Folder"
|
|
115529
115531
|
]
|
|
115530
115532
|
}
|
|
115531
115533
|
),
|
|
115532
|
-
canPaste && /* @__PURE__ */ (0,
|
|
115533
|
-
/* @__PURE__ */ (0,
|
|
115534
|
-
/* @__PURE__ */ (0,
|
|
115534
|
+
canPaste && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
115535
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextMenuSeparator2, {}),
|
|
115536
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
115535
115537
|
ContextMenuItem2,
|
|
115536
115538
|
{
|
|
115537
115539
|
"data-testid": "file-tree__paste",
|
|
115538
115540
|
onSelect: () => rootMenu.queue(() => void pasteInto("")),
|
|
115539
115541
|
children: [
|
|
115540
|
-
/* @__PURE__ */ (0,
|
|
115542
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.ClipboardPaste, { className: "size-4" }),
|
|
115541
115543
|
"Paste"
|
|
115542
115544
|
]
|
|
115543
115545
|
}
|
|
@@ -115547,42 +115549,42 @@ var FileBrowser = (0, import_react31.forwardRef)(function FileBrowser2({
|
|
|
115547
115549
|
]
|
|
115548
115550
|
}
|
|
115549
115551
|
),
|
|
115550
|
-
/* @__PURE__ */ (0,
|
|
115552
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
115551
115553
|
Dialog2,
|
|
115552
115554
|
{
|
|
115553
115555
|
open: pendingDelete !== null,
|
|
115554
115556
|
onOpenChange: (open3) => {
|
|
115555
115557
|
if (!open3) cancelDelete();
|
|
115556
115558
|
},
|
|
115557
|
-
children: /* @__PURE__ */ (0,
|
|
115558
|
-
/* @__PURE__ */ (0,
|
|
115559
|
-
/* @__PURE__ */ (0,
|
|
115559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(DialogContent2, { className: "sm:max-w-[425px]", onClick: (e) => e.stopPropagation(), children: [
|
|
115560
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(DialogHeader, { children: [
|
|
115561
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(DialogTitle2, { children: [
|
|
115560
115562
|
"Delete ",
|
|
115561
115563
|
pendingDelete?.kind === "directory" ? "folder" : "file"
|
|
115562
115564
|
] }),
|
|
115563
|
-
/* @__PURE__ */ (0,
|
|
115565
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(DialogDescription2, { children: [
|
|
115564
115566
|
"Are you sure you want to delete ",
|
|
115565
|
-
/* @__PURE__ */ (0,
|
|
115567
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("strong", { children: pendingDelete?.path }),
|
|
115566
115568
|
"?"
|
|
115567
115569
|
] })
|
|
115568
115570
|
] }),
|
|
115569
|
-
/* @__PURE__ */ (0,
|
|
115570
|
-
pendingDelete?.kind === "directory" && /* @__PURE__ */ (0,
|
|
115571
|
-
/* @__PURE__ */ (0,
|
|
115572
|
-
/* @__PURE__ */ (0,
|
|
115571
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex flex-col gap-2 text-sm", children: [
|
|
115572
|
+
pendingDelete?.kind === "directory" && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-start gap-2 rounded-md border border-yellow-500/30 bg-yellow-500/10 p-3", children: [
|
|
115573
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.AlertTriangle, { className: "size-4 shrink-0 text-yellow-500 mt-0.5" }),
|
|
115574
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: "The folder and all of its contents will be deleted from disk. This cannot be undone." })
|
|
115573
115575
|
] }),
|
|
115574
|
-
pendingDelete?.kind === "file" && /* @__PURE__ */ (0,
|
|
115575
|
-
/* @__PURE__ */ (0,
|
|
115576
|
-
/* @__PURE__ */ (0,
|
|
115576
|
+
pendingDelete?.kind === "file" && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-start gap-2 rounded-md border border-yellow-500/30 bg-yellow-500/10 p-3", children: [
|
|
115577
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.AlertTriangle, { className: "size-4 shrink-0 text-yellow-500 mt-0.5" }),
|
|
115578
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: "The file will be deleted from disk. This cannot be undone." })
|
|
115577
115579
|
] }),
|
|
115578
|
-
deleteError && /* @__PURE__ */ (0,
|
|
115579
|
-
/* @__PURE__ */ (0,
|
|
115580
|
-
/* @__PURE__ */ (0,
|
|
115580
|
+
deleteError && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-destructive", children: [
|
|
115581
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react6.AlertTriangle, { className: "size-4 shrink-0 mt-0.5" }),
|
|
115582
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: deleteError })
|
|
115581
115583
|
] })
|
|
115582
115584
|
] }),
|
|
115583
|
-
/* @__PURE__ */ (0,
|
|
115584
|
-
/* @__PURE__ */ (0,
|
|
115585
|
-
/* @__PURE__ */ (0,
|
|
115585
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(DialogFooter, { children: [
|
|
115586
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Button, { variant: "ghost", onClick: cancelDelete, disabled: deleteSubmitting, children: "Cancel" }),
|
|
115587
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
115586
115588
|
Button,
|
|
115587
115589
|
{
|
|
115588
115590
|
variant: "destructive",
|
|
@@ -115604,17 +115606,17 @@ var import_react34 = __toESM(require_react(), 1);
|
|
|
115604
115606
|
|
|
115605
115607
|
// src/dashboard/components/ImagePreview.tsx
|
|
115606
115608
|
var import_react32 = __toESM(require_react(), 1);
|
|
115607
|
-
var
|
|
115609
|
+
var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
|
|
115608
115610
|
|
|
115609
115611
|
// src/dashboard/components/LanguagePickerDialog.tsx
|
|
115610
115612
|
var import_react33 = __toESM(require_react(), 1);
|
|
115611
|
-
var
|
|
115613
|
+
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
|
|
115612
115614
|
|
|
115613
115615
|
// src/dashboard/components/PdfPreview.tsx
|
|
115614
|
-
var
|
|
115616
|
+
var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
|
|
115615
115617
|
|
|
115616
115618
|
// src/dashboard/components/FileViewer.tsx
|
|
115617
|
-
var
|
|
115619
|
+
var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
|
|
115618
115620
|
|
|
115619
115621
|
// src/dashboard/components/QuickOpenDialog.tsx
|
|
115620
115622
|
var import_react35 = __toESM(require_react(), 1);
|
|
@@ -115628,12 +115630,12 @@ function formatFileLocation(filePath, line2, options2) {
|
|
|
115628
115630
|
}
|
|
115629
115631
|
|
|
115630
115632
|
// src/dashboard/components/QuickOpenDialog.tsx
|
|
115631
|
-
var
|
|
115633
|
+
var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1);
|
|
115632
115634
|
|
|
115633
115635
|
// src/dashboard/components/SearchBar.tsx
|
|
115634
115636
|
var import_lucide_react7 = __toESM(require_lucide_react(), 1);
|
|
115635
115637
|
var import_react36 = __toESM(require_react(), 1);
|
|
115636
|
-
var
|
|
115638
|
+
var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1);
|
|
115637
115639
|
var DEFAULT_VISIBLE_OPTIONS = ["caseSensitive", "wholeWord", "regex"];
|
|
115638
115640
|
function ToggleButton({
|
|
115639
115641
|
active,
|
|
@@ -115641,7 +115643,7 @@ function ToggleButton({
|
|
|
115641
115643
|
title,
|
|
115642
115644
|
children
|
|
115643
115645
|
}) {
|
|
115644
|
-
return /* @__PURE__ */ (0,
|
|
115646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
115645
115647
|
"button",
|
|
115646
115648
|
{
|
|
115647
115649
|
type: "button",
|
|
@@ -115663,6 +115665,7 @@ var SearchBar = (0, import_react36.forwardRef)(function SearchBar2({
|
|
|
115663
115665
|
onPrevious,
|
|
115664
115666
|
onClose,
|
|
115665
115667
|
visibleOptions = DEFAULT_VISIBLE_OPTIONS,
|
|
115668
|
+
variant = "bar",
|
|
115666
115669
|
className
|
|
115667
115670
|
}, ref) {
|
|
115668
115671
|
const showCase = visibleOptions.includes("caseSensitive");
|
|
@@ -115682,21 +115685,30 @@ var SearchBar = (0, import_react36.forwardRef)(function SearchBar2({
|
|
|
115682
115685
|
const toggleRegex = (0, import_react36.useCallback)(() => {
|
|
115683
115686
|
onOptionsChange({ ...options2, regex: !options2.regex });
|
|
115684
115687
|
}, [options2, onOptionsChange]);
|
|
115685
|
-
|
|
115688
|
+
const floating = variant === "floating";
|
|
115689
|
+
const hasMatches = !!matchInfo && matchInfo.total > 0;
|
|
115690
|
+
const noResults = !!query && !!matchInfo && !hasMatches;
|
|
115691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
115686
115692
|
"div",
|
|
115687
115693
|
{
|
|
115694
|
+
"data-testid": floating ? "find-widget" : void 0,
|
|
115688
115695
|
className: cn(
|
|
115689
|
-
"flex shrink-0 items-center gap-1.5 border-b border-border bg-muted/30 px-3 py-1.5",
|
|
115696
|
+
floating ? "absolute top-1.5 right-4 z-20 flex w-80 max-w-[calc(100%-1.5rem)] items-center gap-0.5 rounded-md border border-border bg-popover py-1 pr-1 pl-2 text-popover-foreground shadow-md" : "flex shrink-0 items-center gap-1.5 border-b border-border bg-muted/30 px-3 py-1.5",
|
|
115690
115697
|
className
|
|
115691
115698
|
),
|
|
115692
115699
|
children: [
|
|
115693
|
-
/* @__PURE__ */ (0,
|
|
115694
|
-
/* @__PURE__ */ (0,
|
|
115700
|
+
!floating && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react7.Search, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
115701
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
115695
115702
|
"input",
|
|
115696
115703
|
{
|
|
115697
115704
|
ref: inputRef,
|
|
115698
|
-
className:
|
|
115705
|
+
className: cn(
|
|
115706
|
+
"min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground",
|
|
115707
|
+
floating ? "text-[13px]" : "text-sm"
|
|
115708
|
+
),
|
|
115699
115709
|
placeholder: placeholder2,
|
|
115710
|
+
"aria-label": placeholder2,
|
|
115711
|
+
"aria-invalid": noResults || void 0,
|
|
115700
115712
|
value: query,
|
|
115701
115713
|
onChange: (e) => onQueryChange(e.target.value),
|
|
115702
115714
|
onKeyDown: (e) => {
|
|
@@ -115712,40 +115724,55 @@ var SearchBar = (0, import_react36.forwardRef)(function SearchBar2({
|
|
|
115712
115724
|
}
|
|
115713
115725
|
}
|
|
115714
115726
|
),
|
|
115715
|
-
showCase && /* @__PURE__ */ (0,
|
|
115716
|
-
showWholeWord && /* @__PURE__ */ (0,
|
|
115717
|
-
showRegex && /* @__PURE__ */ (0,
|
|
115718
|
-
|
|
115719
|
-
|
|
115727
|
+
showCase && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ToggleButton, { active: options2.caseSensitive, onClick: toggleCase, title: "Match Case", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react7.CaseSensitive, { className: "size-4" }) }),
|
|
115728
|
+
showWholeWord && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ToggleButton, { active: options2.wholeWord, onClick: toggleWholeWord, title: "Match Whole Word", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react7.WholeWord, { className: "size-4" }) }),
|
|
115729
|
+
showRegex && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ToggleButton, { active: options2.regex, onClick: toggleRegex, title: "Use Regular Expression", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react7.Regex, { className: "size-4" }) }),
|
|
115730
|
+
floating ? (
|
|
115731
|
+
// Always shown, like VS Code: `0/0` before a query, `3/12` while
|
|
115732
|
+
// matching, "No results" when a query matched nothing.
|
|
115733
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
115734
|
+
"span",
|
|
115735
|
+
{
|
|
115736
|
+
"data-testid": "find-widget__count",
|
|
115737
|
+
className: cn(
|
|
115738
|
+
"shrink-0 px-1 text-xs tabular-nums",
|
|
115739
|
+
noResults ? "text-destructive" : "text-muted-foreground"
|
|
115740
|
+
),
|
|
115741
|
+
children: noResults ? "No results" : `${hasMatches ? matchInfo.current : 0}/${hasMatches ? matchInfo.total : 0}`
|
|
115742
|
+
}
|
|
115743
|
+
)
|
|
115744
|
+
) : matchInfo && query && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "shrink-0 text-xs text-muted-foreground tabular-nums", children: matchInfo.total > 0 ? `${matchInfo.current} of ${matchInfo.total}` : "No results" }),
|
|
115745
|
+
onPrevious && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
115720
115746
|
"button",
|
|
115721
115747
|
{
|
|
115722
115748
|
type: "button",
|
|
115723
115749
|
onClick: onPrevious,
|
|
115724
|
-
disabled: !
|
|
115750
|
+
disabled: !hasMatches,
|
|
115725
115751
|
className: "inline-flex size-6 items-center justify-center rounded text-muted-foreground hover:text-foreground disabled:opacity-30",
|
|
115726
115752
|
title: "Previous match (Shift+Enter)",
|
|
115727
|
-
children: /* @__PURE__ */ (0,
|
|
115753
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react7.ChevronUp, { className: "size-3.5" })
|
|
115728
115754
|
}
|
|
115729
115755
|
),
|
|
115730
|
-
onNext && /* @__PURE__ */ (0,
|
|
115756
|
+
onNext && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
115731
115757
|
"button",
|
|
115732
115758
|
{
|
|
115733
115759
|
type: "button",
|
|
115734
115760
|
onClick: onNext,
|
|
115735
|
-
disabled: !
|
|
115761
|
+
disabled: !hasMatches,
|
|
115736
115762
|
className: "inline-flex size-6 items-center justify-center rounded text-muted-foreground hover:text-foreground disabled:opacity-30",
|
|
115737
115763
|
title: "Next match (Enter)",
|
|
115738
|
-
children: /* @__PURE__ */ (0,
|
|
115764
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react7.ChevronDown, { className: "size-3.5" })
|
|
115739
115765
|
}
|
|
115740
115766
|
),
|
|
115741
|
-
onClose && /* @__PURE__ */ (0,
|
|
115767
|
+
floating && onClose && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { "aria-hidden": true, className: "mx-0.5 h-4 w-px shrink-0 bg-border" }),
|
|
115768
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
115742
115769
|
"button",
|
|
115743
115770
|
{
|
|
115744
115771
|
type: "button",
|
|
115745
115772
|
onClick: onClose,
|
|
115746
115773
|
className: "inline-flex size-6 items-center justify-center rounded text-muted-foreground hover:text-foreground",
|
|
115747
115774
|
title: "Close (Escape)",
|
|
115748
|
-
children: /* @__PURE__ */ (0,
|
|
115775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react7.X, { className: "size-3.5" })
|
|
115749
115776
|
}
|
|
115750
115777
|
)
|
|
115751
115778
|
]
|
|
@@ -115755,14 +115782,14 @@ var SearchBar = (0, import_react36.forwardRef)(function SearchBar2({
|
|
|
115755
115782
|
|
|
115756
115783
|
// src/dashboard/components/SearchFilesDialog.tsx
|
|
115757
115784
|
var import_react37 = __toESM(require_react(), 1);
|
|
115758
|
-
var
|
|
115785
|
+
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
|
|
115759
115786
|
|
|
115760
115787
|
// src/dashboard/components/WorkspacePickerDialog.tsx
|
|
115761
115788
|
var import_react38 = __toESM(require_react(), 1);
|
|
115762
|
-
var
|
|
115789
|
+
var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1);
|
|
115763
115790
|
|
|
115764
115791
|
// src/dashboard/components/WorkspaceTabNav.tsx
|
|
115765
|
-
var
|
|
115792
|
+
var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1);
|
|
115766
115793
|
|
|
115767
115794
|
// src/dashboard/hooks/use-diff-target.ts
|
|
115768
115795
|
var import_react39 = __toESM(require_react(), 1);
|
|
@@ -118437,6 +118464,16 @@ var ProjectQueries = class {
|
|
|
118437
118464
|
const db = getDb();
|
|
118438
118465
|
db.update(projects).set({ hasOrigin }).where(eq(projects.name, name3)).run();
|
|
118439
118466
|
}
|
|
118467
|
+
/**
|
|
118468
|
+
* Path and kind of one project, by primary key. For per-request lookups
|
|
118469
|
+
* (e.g. the avatar route) that don't need the worktree tree `loadAll`
|
|
118470
|
+
* assembles.
|
|
118471
|
+
*/
|
|
118472
|
+
findLocation(name3) {
|
|
118473
|
+
const db = getDb();
|
|
118474
|
+
const row = db.select({ path: projects.path, kind: projects.kind }).from(projects).where(eq(projects.name, name3)).get();
|
|
118475
|
+
return row ? { path: row.path, kind: row.kind ?? "git" } : void 0;
|
|
118476
|
+
}
|
|
118440
118477
|
};
|
|
118441
118478
|
|
|
118442
118479
|
// src/server/infra/db/queries/workspace-statuses.ts
|
|
@@ -135834,13 +135871,231 @@ var prereqsRouter = t3.router({
|
|
|
135834
135871
|
|
|
135835
135872
|
// src/server/services/project-service.ts
|
|
135836
135873
|
import { existsSync as existsSync13 } from "node:fs";
|
|
135837
|
-
import { basename as basename4, join as
|
|
135874
|
+
import { basename as basename4, join as join30, resolve as resolve7 } from "node:path";
|
|
135875
|
+
|
|
135876
|
+
// src/server/services/project-avatar-service.ts
|
|
135877
|
+
import { mkdir as mkdir3, readFile as readFile5, rename, writeFile as writeFile3 } from "node:fs/promises";
|
|
135878
|
+
import { join as join29 } from "node:path";
|
|
135879
|
+
|
|
135880
|
+
// src/server/infra/github/github-client.ts
|
|
135881
|
+
var FETCH_TIMEOUT_MS = 1e4;
|
|
135882
|
+
var MAX_AVATAR_BYTES = 1024 * 1024;
|
|
135883
|
+
var MAX_REDIRECTS = 2;
|
|
135884
|
+
var GITHUB_AVATAR_CDN = "avatars.githubusercontent.com";
|
|
135885
|
+
var ALLOWED_TYPES = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/gif", "image/webp"]);
|
|
135886
|
+
var GitHubClient = class {
|
|
135887
|
+
async fetchAvatar(ref) {
|
|
135888
|
+
const signal = AbortSignal.timeout(FETCH_TIMEOUT_MS);
|
|
135889
|
+
try {
|
|
135890
|
+
let url2 = new URL(avatarUrl(ref));
|
|
135891
|
+
const origin = url2.origin;
|
|
135892
|
+
for (let hop = 0; ; hop++) {
|
|
135893
|
+
const res = await fetch(url2, { signal, redirect: "manual" });
|
|
135894
|
+
if (res.status >= 300 && res.status < 400) {
|
|
135895
|
+
await res.body?.cancel();
|
|
135896
|
+
const location = res.headers.get("location");
|
|
135897
|
+
const next = location ? new URL(location, url2) : null;
|
|
135898
|
+
const allowed = next && (next.origin === origin || ref.host === "github.com" && next.protocol === "https:" && next.hostname === GITHUB_AVATAR_CDN);
|
|
135899
|
+
if (!next || !allowed || hop >= MAX_REDIRECTS) {
|
|
135900
|
+
return { kind: "unavailable", reason: `redirect to ${location ?? "(none)"}` };
|
|
135901
|
+
}
|
|
135902
|
+
url2 = next;
|
|
135903
|
+
continue;
|
|
135904
|
+
}
|
|
135905
|
+
return await readAvatar(res);
|
|
135906
|
+
}
|
|
135907
|
+
} catch (err) {
|
|
135908
|
+
return { kind: "unavailable", reason: err instanceof Error ? err.message : String(err) };
|
|
135909
|
+
}
|
|
135910
|
+
}
|
|
135911
|
+
};
|
|
135912
|
+
async function readAvatar(res) {
|
|
135913
|
+
if (res.status === 404) {
|
|
135914
|
+
await res.body?.cancel();
|
|
135915
|
+
return { kind: "missing" };
|
|
135916
|
+
}
|
|
135917
|
+
if (!res.ok) {
|
|
135918
|
+
await res.body?.cancel();
|
|
135919
|
+
return { kind: "unavailable", reason: `HTTP ${res.status}` };
|
|
135920
|
+
}
|
|
135921
|
+
const contentType = res.headers.get("content-type")?.split(";")[0].trim().toLowerCase() ?? "";
|
|
135922
|
+
const declaredLength = Number(res.headers.get("content-length") ?? 0);
|
|
135923
|
+
if (!ALLOWED_TYPES.has(contentType) || declaredLength > MAX_AVATAR_BYTES || !res.body) {
|
|
135924
|
+
await res.body?.cancel();
|
|
135925
|
+
return { kind: "missing" };
|
|
135926
|
+
}
|
|
135927
|
+
const chunks = [];
|
|
135928
|
+
let total = 0;
|
|
135929
|
+
const reader = res.body.getReader();
|
|
135930
|
+
for (; ; ) {
|
|
135931
|
+
const { done, value } = await reader.read();
|
|
135932
|
+
if (done) break;
|
|
135933
|
+
total += value.byteLength;
|
|
135934
|
+
if (total > MAX_AVATAR_BYTES) {
|
|
135935
|
+
await reader.cancel();
|
|
135936
|
+
return { kind: "missing" };
|
|
135937
|
+
}
|
|
135938
|
+
chunks.push(value);
|
|
135939
|
+
}
|
|
135940
|
+
if (total === 0) return { kind: "missing" };
|
|
135941
|
+
return { kind: "image", bytes: Buffer.concat(chunks), contentType };
|
|
135942
|
+
}
|
|
135943
|
+
function avatarUrl(ref) {
|
|
135944
|
+
const base2 = ref.host === "github.com" ? (process.env.BAND_GITHUB_URL || "https://github.com").replace(/\/+$/, "") : `https://${ref.host}`;
|
|
135945
|
+
return `${base2}/${encodeURIComponent(ref.owner)}.png?size=64`;
|
|
135946
|
+
}
|
|
135947
|
+
|
|
135948
|
+
// src/server/infra/github/github-repo-ref.ts
|
|
135949
|
+
var GITHUB_COM_ALIASES = /* @__PURE__ */ new Set(["github.com", "www.github.com", "ssh.github.com"]);
|
|
135950
|
+
var OWNER_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/;
|
|
135951
|
+
function githubRepoRef(info) {
|
|
135952
|
+
if (!info) return null;
|
|
135953
|
+
const host = info.host.toLowerCase();
|
|
135954
|
+
if (!OWNER_PATTERN.test(info.owner)) return null;
|
|
135955
|
+
if (GITHUB_COM_ALIASES.has(host)) {
|
|
135956
|
+
return { host: "github.com", owner: info.owner, repo: info.repo };
|
|
135957
|
+
}
|
|
135958
|
+
if (host.startsWith("github.") || host.endsWith(".ghe.com")) {
|
|
135959
|
+
return { host, owner: info.owner, repo: info.repo };
|
|
135960
|
+
}
|
|
135961
|
+
return null;
|
|
135962
|
+
}
|
|
135963
|
+
|
|
135964
|
+
// src/server/services/project-avatar-service.ts
|
|
135965
|
+
var log32 = createLogger("project-avatars");
|
|
135966
|
+
var CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
135967
|
+
var FAILURE_BACKOFF_MS = 5 * 60 * 1e3;
|
|
135968
|
+
var REMOTE_TTL_MS = 60 * 1e3;
|
|
135969
|
+
var ProjectAvatarService = class {
|
|
135970
|
+
constructor(queries = new ProjectQueries(), git = new GitClient(), github = new GitHubClient()) {
|
|
135971
|
+
this.queries = queries;
|
|
135972
|
+
this.git = git;
|
|
135973
|
+
this.github = github;
|
|
135974
|
+
}
|
|
135975
|
+
remotes = /* @__PURE__ */ new Map();
|
|
135976
|
+
entries = /* @__PURE__ */ new Map();
|
|
135977
|
+
inflight = /* @__PURE__ */ new Map();
|
|
135978
|
+
/**
|
|
135979
|
+
* Avatar descriptor for `projects.list`. Never touches the network: it
|
|
135980
|
+
* reads the `origin` remote (memoised) and the cache sidecar only.
|
|
135981
|
+
*/
|
|
135982
|
+
async describe(project) {
|
|
135983
|
+
if (project.kind !== "git") return null;
|
|
135984
|
+
const ref = await this.repoRef(project.path);
|
|
135985
|
+
if (!ref) return null;
|
|
135986
|
+
const entry = await this.entry(ref);
|
|
135987
|
+
if (entry.meta?.status === "missing" && !this.isStale(entry.meta)) return null;
|
|
135988
|
+
return {
|
|
135989
|
+
src: `/api/project-avatar/${encodeURIComponent(project.name)}`,
|
|
135990
|
+
label: `${ref.owner}/${ref.repo}`
|
|
135991
|
+
};
|
|
135992
|
+
}
|
|
135993
|
+
/**
|
|
135994
|
+
* The avatar bytes for the project named `projectName`, fetching and
|
|
135995
|
+
* caching them on a miss. `null` when the project is unknown, not on
|
|
135996
|
+
* GitHub, has no avatar, or GitHub is unreachable with nothing cached.
|
|
135997
|
+
*/
|
|
135998
|
+
async image(projectName) {
|
|
135999
|
+
const project = this.queries.findLocation(projectName);
|
|
136000
|
+
if (!project || project.kind !== "git") return null;
|
|
136001
|
+
const ref = await this.repoRef(project.path);
|
|
136002
|
+
if (!ref) return null;
|
|
136003
|
+
const key = cacheKey2(ref);
|
|
136004
|
+
const entry = await this.entry(ref);
|
|
136005
|
+
if (entry.meta && !this.isStale(entry.meta)) return this.readCached(key, entry.meta);
|
|
136006
|
+
if (Date.now() < entry.retryAfter) return this.readCached(key, entry.meta);
|
|
136007
|
+
let pending = this.inflight.get(key);
|
|
136008
|
+
if (!pending) {
|
|
136009
|
+
pending = this.refresh(ref, entry).finally(() => this.inflight.delete(key));
|
|
136010
|
+
this.inflight.set(key, pending);
|
|
136011
|
+
}
|
|
136012
|
+
return pending;
|
|
136013
|
+
}
|
|
136014
|
+
async refresh(ref, entry) {
|
|
136015
|
+
const key = cacheKey2(ref);
|
|
136016
|
+
try {
|
|
136017
|
+
const result = await this.github.fetchAvatar(ref);
|
|
136018
|
+
if (result.kind === "unavailable") {
|
|
136019
|
+
log32.debug("avatar for %s/%s unavailable: %s", ref.host, ref.owner, result.reason);
|
|
136020
|
+
entry.retryAfter = Date.now() + FAILURE_BACKOFF_MS;
|
|
136021
|
+
return this.readCached(key, entry.meta);
|
|
136022
|
+
}
|
|
136023
|
+
if (result.kind === "missing") {
|
|
136024
|
+
await this.writeMeta(key, entry, { status: "missing", fetchedAt: Date.now() });
|
|
136025
|
+
return null;
|
|
136026
|
+
}
|
|
136027
|
+
await mkdir3(cacheDir(), { recursive: true });
|
|
136028
|
+
const imagePath = join29(cacheDir(), `${key}.img`);
|
|
136029
|
+
await writeFile3(`${imagePath}.tmp`, result.bytes);
|
|
136030
|
+
await rename(`${imagePath}.tmp`, imagePath);
|
|
136031
|
+
await this.writeMeta(key, entry, {
|
|
136032
|
+
status: "ok",
|
|
136033
|
+
contentType: result.contentType,
|
|
136034
|
+
fetchedAt: Date.now()
|
|
136035
|
+
});
|
|
136036
|
+
return { bytes: result.bytes, contentType: result.contentType };
|
|
136037
|
+
} catch (err) {
|
|
136038
|
+
log32.debug("avatar cache write for %s failed: %s", key, err);
|
|
136039
|
+
entry.retryAfter = Date.now() + FAILURE_BACKOFF_MS;
|
|
136040
|
+
return this.readCached(key, entry.meta);
|
|
136041
|
+
}
|
|
136042
|
+
}
|
|
136043
|
+
async readCached(key, meta2) {
|
|
136044
|
+
if (meta2?.status !== "ok" || !meta2.contentType) return null;
|
|
136045
|
+
try {
|
|
136046
|
+
const bytes = await readFile5(join29(cacheDir(), `${key}.img`));
|
|
136047
|
+
return { bytes, contentType: meta2.contentType };
|
|
136048
|
+
} catch {
|
|
136049
|
+
return null;
|
|
136050
|
+
}
|
|
136051
|
+
}
|
|
136052
|
+
async writeMeta(key, entry, meta2) {
|
|
136053
|
+
entry.meta = meta2;
|
|
136054
|
+
entry.retryAfter = 0;
|
|
136055
|
+
await mkdir3(cacheDir(), { recursive: true });
|
|
136056
|
+
await writeFile3(join29(cacheDir(), `${key}.json`), JSON.stringify(meta2));
|
|
136057
|
+
}
|
|
136058
|
+
/** In-memory view of one owner's cache sidecar, loaded from disk once. */
|
|
136059
|
+
async entry(ref) {
|
|
136060
|
+
const key = cacheKey2(ref);
|
|
136061
|
+
let entry = this.entries.get(key);
|
|
136062
|
+
if (entry) return entry;
|
|
136063
|
+
let meta2 = null;
|
|
136064
|
+
try {
|
|
136065
|
+
meta2 = JSON.parse(await readFile5(join29(cacheDir(), `${key}.json`), "utf-8"));
|
|
136066
|
+
} catch {
|
|
136067
|
+
}
|
|
136068
|
+
entry = this.entries.get(key) ?? { meta: meta2, retryAfter: 0 };
|
|
136069
|
+
this.entries.set(key, entry);
|
|
136070
|
+
return entry;
|
|
136071
|
+
}
|
|
136072
|
+
isStale(meta2) {
|
|
136073
|
+
return Date.now() - meta2.fetchedAt > CACHE_TTL_MS;
|
|
136074
|
+
}
|
|
136075
|
+
async repoRef(projectPath) {
|
|
136076
|
+
const cached2 = this.remotes.get(projectPath);
|
|
136077
|
+
if (cached2 && Date.now() - cached2.at < REMOTE_TTL_MS) return cached2.ref;
|
|
136078
|
+
const ref = githubRepoRef(await this.git.getRepoInfo(projectPath));
|
|
136079
|
+
this.remotes.set(projectPath, { ref, at: Date.now() });
|
|
136080
|
+
return ref;
|
|
136081
|
+
}
|
|
136082
|
+
};
|
|
136083
|
+
function cacheDir() {
|
|
136084
|
+
return join29(bandHome(), "cache", "github-avatars");
|
|
136085
|
+
}
|
|
136086
|
+
function cacheKey2(ref) {
|
|
136087
|
+
return `${ref.host.replace(/[^a-z0-9.-]/g, "_")}__${ref.owner.toLowerCase()}`;
|
|
136088
|
+
}
|
|
136089
|
+
var projectAvatarService = new ProjectAvatarService();
|
|
136090
|
+
|
|
136091
|
+
// src/server/services/project-service.ts
|
|
135838
136092
|
var ProjectService = class {
|
|
135839
|
-
constructor(queries = new ProjectQueries(), git = new GitClient(), settings2 = settingsService, statusQueries = new WorkspaceStatusQueries()) {
|
|
136093
|
+
constructor(queries = new ProjectQueries(), git = new GitClient(), settings2 = settingsService, statusQueries = new WorkspaceStatusQueries(), avatars = projectAvatarService) {
|
|
135840
136094
|
this.queries = queries;
|
|
135841
136095
|
this.git = git;
|
|
135842
136096
|
this.settings = settings2;
|
|
135843
136097
|
this.statusQueries = statusQueries;
|
|
136098
|
+
this.avatars = avatars;
|
|
135844
136099
|
}
|
|
135845
136100
|
/**
|
|
135846
136101
|
* Snapshot of the projects table joined with the dashboard-facing
|
|
@@ -135868,6 +136123,7 @@ var ProjectService = class {
|
|
|
135868
136123
|
}
|
|
135869
136124
|
const result = await Promise.all(
|
|
135870
136125
|
projects2.map(async (project) => {
|
|
136126
|
+
const avatar = this.avatars.describe(project).catch(() => null);
|
|
135871
136127
|
let worktrees2 = project.worktrees;
|
|
135872
136128
|
if (project.kind === "git") {
|
|
135873
136129
|
const trackedByPath = new Map(project.worktrees.map((wt) => [wt.path, wt]));
|
|
@@ -135895,6 +136151,7 @@ var ProjectService = class {
|
|
|
135895
136151
|
defaultBranch: project.defaultBranch,
|
|
135896
136152
|
label: project.label,
|
|
135897
136153
|
kind: project.kind,
|
|
136154
|
+
avatar: await avatar,
|
|
135898
136155
|
worktrees: worktrees2.map((wt) => {
|
|
135899
136156
|
const workspaceId = toWorkspaceId(project.name, wt.name);
|
|
135900
136157
|
const status = statusMap.get(workspaceId);
|
|
@@ -135916,7 +136173,7 @@ var ProjectService = class {
|
|
|
135916
136173
|
*/
|
|
135917
136174
|
checkPath(path) {
|
|
135918
136175
|
const resolvedPath = resolve7(path);
|
|
135919
|
-
const isGitRepo = existsSync13(
|
|
136176
|
+
const isGitRepo = existsSync13(join30(resolvedPath, ".git"));
|
|
135920
136177
|
return { isGitRepo };
|
|
135921
136178
|
}
|
|
135922
136179
|
/**
|
|
@@ -135952,7 +136209,7 @@ var ProjectService = class {
|
|
|
135952
136209
|
}
|
|
135953
136210
|
}
|
|
135954
136211
|
const resolvedPath = resolve7(path);
|
|
135955
|
-
const kind = existsSync13(
|
|
136212
|
+
const kind = existsSync13(join30(resolvedPath, ".git")) ? "git" : "plain";
|
|
135956
136213
|
let defaultBranch = "main";
|
|
135957
136214
|
let worktrees2 = [];
|
|
135958
136215
|
if (kind === "git") {
|
|
@@ -136131,8 +136388,8 @@ var projectsRouter = t3.router({
|
|
|
136131
136388
|
|
|
136132
136389
|
// src/server/api/queue/router.ts
|
|
136133
136390
|
import { realpathSync as realpathSync4 } from "node:fs";
|
|
136134
|
-
import { join as
|
|
136135
|
-
var
|
|
136391
|
+
import { join as join31, resolve as resolve8, sep as sep5 } from "node:path";
|
|
136392
|
+
var log33 = createLogger("trpc.queue");
|
|
136136
136393
|
var queuedFileSchema = external_exports2.object({
|
|
136137
136394
|
mediaType: external_exports2.string(),
|
|
136138
136395
|
url: external_exports2.string(),
|
|
@@ -136140,7 +136397,7 @@ var queuedFileSchema = external_exports2.object({
|
|
|
136140
136397
|
filename: external_exports2.string().optional()
|
|
136141
136398
|
});
|
|
136142
136399
|
function isPathWithinUploadDir(p3) {
|
|
136143
|
-
const uploadDir =
|
|
136400
|
+
const uploadDir = join31(bandHome(), "uploads");
|
|
136144
136401
|
const normalized2 = resolve8(p3);
|
|
136145
136402
|
if (normalized2 !== uploadDir && !normalized2.startsWith(uploadDir + sep5)) {
|
|
136146
136403
|
return false;
|
|
@@ -136161,10 +136418,10 @@ async function resolveQueuedFiles(chatId, files) {
|
|
|
136161
136418
|
for (let i = 0; i < files.length; i++) {
|
|
136162
136419
|
const file2 = files[i];
|
|
136163
136420
|
const uploadsUrlMatch = file2.url.match(/^\/api\/uploads\/(.+)$/);
|
|
136164
|
-
const derivedPath = file2.path ?? (uploadsUrlMatch ?
|
|
136421
|
+
const derivedPath = file2.path ?? (uploadsUrlMatch ? join31(bandHome(), "uploads", uploadsUrlMatch[1]) : void 0);
|
|
136165
136422
|
if (derivedPath) {
|
|
136166
136423
|
if (!isPathWithinUploadDir(derivedPath)) {
|
|
136167
|
-
|
|
136424
|
+
log33.warn(
|
|
136168
136425
|
{ chatId, path: derivedPath, filename: file2.filename },
|
|
136169
136426
|
"queue: dropping file with path outside uploads directory"
|
|
136170
136427
|
);
|
|
@@ -136189,7 +136446,7 @@ async function resolveQueuedFiles(chatId, files) {
|
|
|
136189
136446
|
});
|
|
136190
136447
|
continue;
|
|
136191
136448
|
}
|
|
136192
|
-
|
|
136449
|
+
log33.warn(
|
|
136193
136450
|
{ chatId, url: file2.url, filename: file2.filename },
|
|
136194
136451
|
"queue: dropping file with no path and non-data URL \u2014 cannot recover disk path"
|
|
136195
136452
|
);
|
|
@@ -136197,7 +136454,7 @@ async function resolveQueuedFiles(chatId, files) {
|
|
|
136197
136454
|
if (needsSave.length > 0) {
|
|
136198
136455
|
const saved = await saveUploadedFilesDetailed(needsSave);
|
|
136199
136456
|
if (saved.length !== needsSave.length) {
|
|
136200
|
-
|
|
136457
|
+
log33.error(
|
|
136201
136458
|
{ chatId, expected: needsSave.length, got: saved.length },
|
|
136202
136459
|
"queue: saveUploadedFilesDetailed returned unexpected count \u2014 dropping data-URL files (cannot map 1:1)"
|
|
136203
136460
|
);
|
|
@@ -136230,7 +136487,7 @@ var queueRouter = t3.router({
|
|
|
136230
136487
|
try {
|
|
136231
136488
|
files = await resolveQueuedFiles(chatId, input.files);
|
|
136232
136489
|
} catch (err) {
|
|
136233
|
-
|
|
136490
|
+
log33.error(
|
|
136234
136491
|
{ chatId, err: err instanceof Error ? err.message : err },
|
|
136235
136492
|
"queue.push: failed to persist file uploads; enqueuing text only"
|
|
136236
136493
|
);
|
|
@@ -136266,7 +136523,7 @@ var queueRouter = t3.router({
|
|
|
136266
136523
|
files: await resolveQueuedFiles(chatId, m3.files)
|
|
136267
136524
|
};
|
|
136268
136525
|
} catch (err) {
|
|
136269
|
-
|
|
136526
|
+
log33.error(
|
|
136270
136527
|
{ chatId, messageId: m3.id, err: err instanceof Error ? err.message : err },
|
|
136271
136528
|
"queue: failed to resolve files for queued message; dropping its files"
|
|
136272
136529
|
);
|
|
@@ -136387,7 +136644,7 @@ function aggregateTurnsByHourAndModel(snap, provider) {
|
|
|
136387
136644
|
}
|
|
136388
136645
|
return Array.from(buckets2.values());
|
|
136389
136646
|
}
|
|
136390
|
-
var
|
|
136647
|
+
var log34 = createLogger("usage-scanner");
|
|
136391
136648
|
var SCHEDULER_KEY2 = Symbol.for("band.usage-scanner");
|
|
136392
136649
|
var g6 = globalThis;
|
|
136393
136650
|
if (!g6[SCHEDULER_KEY2]) {
|
|
@@ -136449,14 +136706,14 @@ var UsageScannerService = class {
|
|
|
136449
136706
|
try {
|
|
136450
136707
|
totalRows += await this.scanPair(ws, a);
|
|
136451
136708
|
} catch (err) {
|
|
136452
|
-
|
|
136709
|
+
log34.warn(
|
|
136453
136710
|
{ err, workspaceId: ws.workspaceId, agentType: a.agentType },
|
|
136454
136711
|
"usage scanner pair failed"
|
|
136455
136712
|
);
|
|
136456
136713
|
}
|
|
136457
136714
|
}
|
|
136458
136715
|
}
|
|
136459
|
-
|
|
136716
|
+
log34.debug(
|
|
136460
136717
|
{ durationMs: this.now() - started, workspaces: workspaces.length, rowsWritten: totalRows },
|
|
136461
136718
|
"usage scanner tick complete"
|
|
136462
136719
|
);
|
|
@@ -136501,7 +136758,7 @@ var UsageScannerService = class {
|
|
|
136501
136758
|
try {
|
|
136502
136759
|
reader = this.getUsageReader(a);
|
|
136503
136760
|
} catch (err) {
|
|
136504
|
-
|
|
136761
|
+
log34.debug({ err, agentId: a.agentId }, "failed to resolve usage reader for scan");
|
|
136505
136762
|
return 0;
|
|
136506
136763
|
}
|
|
136507
136764
|
if (!reader) return 0;
|
|
@@ -136510,7 +136767,7 @@ var UsageScannerService = class {
|
|
|
136510
136767
|
try {
|
|
136511
136768
|
sessions = await reader.listSessions(ws.worktreePath);
|
|
136512
136769
|
} catch (err) {
|
|
136513
|
-
|
|
136770
|
+
log34.debug(
|
|
136514
136771
|
{ err, agentId: a.agentId, worktreePath: ws.worktreePath },
|
|
136515
136772
|
"listSessions failed during usage scan"
|
|
136516
136773
|
);
|
|
@@ -136526,7 +136783,7 @@ var UsageScannerService = class {
|
|
|
136526
136783
|
try {
|
|
136527
136784
|
snap = await reader.getSessionUsage(s2.sessionId, ws.worktreePath);
|
|
136528
136785
|
} catch (err) {
|
|
136529
|
-
|
|
136786
|
+
log34.debug(
|
|
136530
136787
|
{ err, sessionId: s2.sessionId, agentType: a.agentType },
|
|
136531
136788
|
"getSessionUsage failed"
|
|
136532
136789
|
);
|
|
@@ -136564,7 +136821,7 @@ var UsageScannerService = class {
|
|
|
136564
136821
|
this.scanState.set(ws.workspaceId, a.agentType, maxObserved);
|
|
136565
136822
|
}
|
|
136566
136823
|
if (changed.length > slice.length) {
|
|
136567
|
-
|
|
136824
|
+
log34.debug(
|
|
136568
136825
|
{
|
|
136569
136826
|
workspaceId: ws.workspaceId,
|
|
136570
136827
|
agentType: a.agentType,
|
|
@@ -136626,11 +136883,11 @@ function startUsageScanner(options2 = {}) {
|
|
|
136626
136883
|
const intervalMs = options2.intervalMs ?? USAGE_SCAN_INTERVAL_MS;
|
|
136627
136884
|
const svc = getUsageScannerService();
|
|
136628
136885
|
svc.tick().catch((err) => {
|
|
136629
|
-
|
|
136886
|
+
log34.warn({ err }, "initial usage scanner tick failed");
|
|
136630
136887
|
});
|
|
136631
136888
|
const timer = setInterval(() => {
|
|
136632
136889
|
svc.tick().catch((err) => {
|
|
136633
|
-
|
|
136890
|
+
log34.warn({ err }, "scheduled usage scanner tick failed");
|
|
136634
136891
|
});
|
|
136635
136892
|
}, intervalMs);
|
|
136636
136893
|
timer.unref();
|
|
@@ -136748,7 +137005,7 @@ var reportsRouter = t3.router({
|
|
|
136748
137005
|
});
|
|
136749
137006
|
|
|
136750
137007
|
// src/server/services/session-service.ts
|
|
136751
|
-
var
|
|
137008
|
+
var log35 = createLogger("session-service");
|
|
136752
137009
|
var SessionService = class {
|
|
136753
137010
|
/** Lists past sessions for a workspace's chat pane (default chat when
|
|
136754
137011
|
* `chatId` is undefined). */
|
|
@@ -136761,7 +137018,7 @@ var SessionService = class {
|
|
|
136761
137018
|
if (!chatService.get(chatId)) {
|
|
136762
137019
|
chatService.create(input.workspaceId, { id: chatId, name: "Chat" });
|
|
136763
137020
|
}
|
|
136764
|
-
|
|
137021
|
+
log35.debug({ chatId, workspaceId: input.workspaceId }, "listing past sessions for chat");
|
|
136765
137022
|
return agentSessionService.listSessions(chatId);
|
|
136766
137023
|
}
|
|
136767
137024
|
};
|
|
@@ -136887,7 +137144,7 @@ function getToken() {
|
|
|
136887
137144
|
}
|
|
136888
137145
|
|
|
136889
137146
|
// src/server/infra/tunnels/tunnel-client.ts
|
|
136890
|
-
var
|
|
137147
|
+
var log36 = createLogger("tunnel");
|
|
136891
137148
|
var TunnelClient = class _TunnelClient {
|
|
136892
137149
|
tunnelProcess = null;
|
|
136893
137150
|
tunnelUrl = null;
|
|
@@ -136912,7 +137169,7 @@ var TunnelClient = class _TunnelClient {
|
|
|
136912
137169
|
spawnTunnel(options2, resolvedPath) {
|
|
136913
137170
|
const nullDevice = process.platform === "win32" ? "NUL" : "/dev/null";
|
|
136914
137171
|
const args = ["tunnel", "--config", nullDevice, "--url", `http://localhost:${options2.port}`];
|
|
136915
|
-
|
|
137172
|
+
log36.debug("spawning cloudflared %s", args.join(" "));
|
|
136916
137173
|
return new Promise((resolve12, reject) => {
|
|
136917
137174
|
const child = spawn4("cloudflared", args, {
|
|
136918
137175
|
env: { ...process.env, PATH: resolvedPath },
|
|
@@ -136926,12 +137183,12 @@ var TunnelClient = class _TunnelClient {
|
|
|
136926
137183
|
for (const line2 of text3.split("\n")) {
|
|
136927
137184
|
const trimmed = line2.trim();
|
|
136928
137185
|
if (!trimmed) continue;
|
|
136929
|
-
|
|
137186
|
+
log36.debug("output: %s", trimmed);
|
|
136930
137187
|
const url2 = _TunnelClient.extractUrl(trimmed);
|
|
136931
137188
|
if (url2) {
|
|
136932
137189
|
const token = getToken();
|
|
136933
137190
|
this.tunnelUrl = _TunnelClient.appendToken(url2, token);
|
|
136934
|
-
|
|
137191
|
+
log36.debug("detected URL: %s", this.tunnelUrl);
|
|
136935
137192
|
emit({ kind: "tunnel-url", url: this.tunnelUrl });
|
|
136936
137193
|
if (!settled) {
|
|
136937
137194
|
settled = true;
|
|
@@ -136946,7 +137203,7 @@ var TunnelClient = class _TunnelClient {
|
|
|
136946
137203
|
handleOutput(data);
|
|
136947
137204
|
});
|
|
136948
137205
|
child.on("error", (err) => {
|
|
136949
|
-
|
|
137206
|
+
log36.debug("process error: %s", err.message);
|
|
136950
137207
|
this.tunnelProcess = null;
|
|
136951
137208
|
this.tunnelUrl = null;
|
|
136952
137209
|
emit({ kind: "tunnel-error", error: err.message });
|
|
@@ -136956,7 +137213,7 @@ var TunnelClient = class _TunnelClient {
|
|
|
136956
137213
|
}
|
|
136957
137214
|
});
|
|
136958
137215
|
child.on("exit", (code) => {
|
|
136959
|
-
|
|
137216
|
+
log36.debug("process exited with code: %d", code ?? -1);
|
|
136960
137217
|
const wasRunning = this.tunnelProcess !== null && settled;
|
|
136961
137218
|
this.tunnelProcess = null;
|
|
136962
137219
|
this.tunnelUrl = null;
|
|
@@ -136978,7 +137235,7 @@ var TunnelClient = class _TunnelClient {
|
|
|
136978
137235
|
});
|
|
136979
137236
|
setTimeout(() => {
|
|
136980
137237
|
if (!settled) {
|
|
136981
|
-
|
|
137238
|
+
log36.debug("30s timeout reached, resolving without URL");
|
|
136982
137239
|
settled = true;
|
|
136983
137240
|
resolve12();
|
|
136984
137241
|
}
|
|
@@ -136987,12 +137244,12 @@ var TunnelClient = class _TunnelClient {
|
|
|
136987
137244
|
}
|
|
136988
137245
|
async start(options2) {
|
|
136989
137246
|
if (this.startInProgress) {
|
|
136990
|
-
|
|
137247
|
+
log36.debug("start: start already in progress, waiting...");
|
|
136991
137248
|
await this.startInProgress;
|
|
136992
137249
|
return;
|
|
136993
137250
|
}
|
|
136994
137251
|
if (this.tunnelProcess) {
|
|
136995
|
-
|
|
137252
|
+
log36.debug("start: already running, re-emitting URL");
|
|
136996
137253
|
if (this.tunnelUrl) {
|
|
136997
137254
|
emit({ kind: "tunnel-url", url: this.tunnelUrl });
|
|
136998
137255
|
}
|
|
@@ -137057,7 +137314,7 @@ var TunnelService = class {
|
|
|
137057
137314
|
var tunnelService = new TunnelService();
|
|
137058
137315
|
|
|
137059
137316
|
// src/server/api/system/router.ts
|
|
137060
|
-
var
|
|
137317
|
+
var log37 = createLogger("trpc.system");
|
|
137061
137318
|
var systemRouter = t3.router({
|
|
137062
137319
|
/**
|
|
137063
137320
|
* Combined liveness probe — webserver is always true if this query
|
|
@@ -137065,15 +137322,15 @@ var systemRouter = t3.router({
|
|
|
137065
137322
|
* an interval to drive the bottom-bar status pill.
|
|
137066
137323
|
*/
|
|
137067
137324
|
health: publicProcedure.query(() => {
|
|
137068
|
-
|
|
137325
|
+
log37.debug("services.health called");
|
|
137069
137326
|
const tunnel = tunnelService.getStatus();
|
|
137070
|
-
|
|
137327
|
+
log37.debug({ tunnel }, "services.health: tunnel status");
|
|
137071
137328
|
const result = {
|
|
137072
137329
|
webserver: true,
|
|
137073
137330
|
tunnel: tunnel.running,
|
|
137074
137331
|
tunnel_url: tunnel.url
|
|
137075
137332
|
};
|
|
137076
|
-
|
|
137333
|
+
log37.debug({ result }, "services.health result");
|
|
137077
137334
|
return result;
|
|
137078
137335
|
}),
|
|
137079
137336
|
// Activity level controls how often the branch-status poller fires.
|
|
@@ -137189,7 +137446,7 @@ var systemRouter = t3.router({
|
|
|
137189
137446
|
});
|
|
137190
137447
|
|
|
137191
137448
|
// src/server/api/tasks/router.ts
|
|
137192
|
-
var
|
|
137449
|
+
var log38 = createLogger("tasks-router");
|
|
137193
137450
|
var tasksRouter = t3.router({
|
|
137194
137451
|
list: publicProcedure.input(
|
|
137195
137452
|
external_exports2.object({
|
|
@@ -137251,7 +137508,7 @@ var tasksRouter = t3.router({
|
|
|
137251
137508
|
if (input.files && input.files.length > 0) {
|
|
137252
137509
|
const savedFiles = await saveUploadedFilesDetailed(input.files);
|
|
137253
137510
|
if (savedFiles.length !== input.files.length) {
|
|
137254
|
-
|
|
137511
|
+
log38.warn(
|
|
137255
137512
|
{ chatId, submitted: input.files.length, saved: savedFiles.length },
|
|
137256
137513
|
"tasks.submit: some file uploads were dropped (malformed data URL?)"
|
|
137257
137514
|
);
|
|
@@ -137446,25 +137703,25 @@ var terminalsRouters = {
|
|
|
137446
137703
|
};
|
|
137447
137704
|
|
|
137448
137705
|
// src/server/api/tunnel/router.ts
|
|
137449
|
-
var
|
|
137706
|
+
var log39 = createLogger("trpc.tunnel");
|
|
137450
137707
|
var tunnelRouter = t3.router({
|
|
137451
137708
|
status: publicProcedure.query(() => {
|
|
137452
137709
|
return tunnelService.getStatus();
|
|
137453
137710
|
}),
|
|
137454
137711
|
start: publicProcedure.input(external_exports2.object({}).optional()).mutation(async () => {
|
|
137455
|
-
|
|
137712
|
+
log39.debug("tunnel.start called");
|
|
137456
137713
|
try {
|
|
137457
137714
|
await tunnelService.start();
|
|
137458
137715
|
} catch (err) {
|
|
137459
|
-
|
|
137716
|
+
log39.debug({ err }, "tunnel.start: startTunnel failed");
|
|
137460
137717
|
return { ok: true, url: null };
|
|
137461
137718
|
}
|
|
137462
137719
|
const status = tunnelService.getStatus();
|
|
137463
|
-
|
|
137720
|
+
log39.debug({ status }, "tunnel.start: after startTunnel");
|
|
137464
137721
|
if (status.url) {
|
|
137465
137722
|
return { ok: true, url: status.url };
|
|
137466
137723
|
}
|
|
137467
|
-
|
|
137724
|
+
log39.debug("tunnel.start: no URL available");
|
|
137468
137725
|
return { ok: true, url: null };
|
|
137469
137726
|
}),
|
|
137470
137727
|
stop: publicProcedure.mutation(async () => {
|
|
@@ -137475,9 +137732,9 @@ var tunnelRouter = t3.router({
|
|
|
137475
137732
|
|
|
137476
137733
|
// src/server/services/diff-service.ts
|
|
137477
137734
|
import { existsSync as existsSync14 } from "node:fs";
|
|
137478
|
-
import { readFile as
|
|
137479
|
-
import { join as
|
|
137480
|
-
var
|
|
137735
|
+
import { readFile as readFile6, rm as rm3 } from "node:fs/promises";
|
|
137736
|
+
import { join as join32, resolve as resolve9, sep as sep6 } from "node:path";
|
|
137737
|
+
var log40 = createLogger("diff-service");
|
|
137481
137738
|
var EMPTY_TREE_ARGS = ["hash-object", "-t", "tree", "/dev/null"];
|
|
137482
137739
|
var EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
137483
137740
|
async function resolveDiffContext(cwd, defaultBranch, diffMode, compareBranchInput) {
|
|
@@ -137530,7 +137787,7 @@ function parseFileStatuses(nameStatusOutput) {
|
|
|
137530
137787
|
return fileStatuses;
|
|
137531
137788
|
}
|
|
137532
137789
|
function assertWorktreeRelative(cwd, filePath) {
|
|
137533
|
-
const target = resolve9(
|
|
137790
|
+
const target = resolve9(join32(cwd, filePath));
|
|
137534
137791
|
if (target !== cwd && !target.startsWith(cwd + sep6)) {
|
|
137535
137792
|
throw new Error("Invalid path");
|
|
137536
137793
|
}
|
|
@@ -137545,7 +137802,7 @@ function assertWorktreeRelative(cwd, filePath) {
|
|
|
137545
137802
|
}
|
|
137546
137803
|
async function readUntrackedFileLines(cwd, file2) {
|
|
137547
137804
|
try {
|
|
137548
|
-
const content2 = await
|
|
137805
|
+
const content2 = await readFile6(join32(cwd, file2), "utf-8");
|
|
137549
137806
|
const lines = content2.split("\n");
|
|
137550
137807
|
if (lines.length > 0 && lines[lines.length - 1] === "") {
|
|
137551
137808
|
lines.pop();
|
|
@@ -137582,7 +137839,7 @@ var DiffService = class {
|
|
|
137582
137839
|
);
|
|
137583
137840
|
branches = output.trim().split("\n").map((b2) => b2.trim()).filter(Boolean);
|
|
137584
137841
|
} catch (err) {
|
|
137585
|
-
|
|
137842
|
+
log40.error(
|
|
137586
137843
|
`listBranches: for-each-ref failed for ${cwd}: ${err instanceof Error ? err.message : err}`
|
|
137587
137844
|
);
|
|
137588
137845
|
}
|
|
@@ -137681,7 +137938,7 @@ var DiffService = class {
|
|
|
137681
137938
|
async getDiffSummary(workspaceId, options2) {
|
|
137682
137939
|
const workspace = this.workspaces.resolve(workspaceId);
|
|
137683
137940
|
if (!workspace) throw new WorkspaceNotFoundError(workspaceId);
|
|
137684
|
-
const hasGit = existsSync14(
|
|
137941
|
+
const hasGit = existsSync14(join32(workspace.worktree.path, ".git"));
|
|
137685
137942
|
if (workspace.project.kind === "plain" || !hasGit) {
|
|
137686
137943
|
const defaultBranch2 = workspace.project.defaultBranch;
|
|
137687
137944
|
return {
|
|
@@ -137747,7 +138004,7 @@ var DiffService = class {
|
|
|
137747
138004
|
const isUntracked = untrackedOutput.trim().split("\n").filter(Boolean).length > 0;
|
|
137748
138005
|
if (isUntracked) {
|
|
137749
138006
|
try {
|
|
137750
|
-
const content2 = await
|
|
138007
|
+
const content2 = await readFile6(targetAbs, "utf-8");
|
|
137751
138008
|
const lines = content2.split("\n");
|
|
137752
138009
|
if (lines.length > 0 && lines[lines.length - 1] === "") {
|
|
137753
138010
|
lines.pop();
|
|
@@ -137814,8 +138071,8 @@ var diffService = new DiffService();
|
|
|
137814
138071
|
|
|
137815
138072
|
// src/server/services/files-service.ts
|
|
137816
138073
|
import { existsSync as existsSync15 } from "node:fs";
|
|
137817
|
-
import { cp, mkdir as
|
|
137818
|
-
import { dirname as dirname10, extname as extname3, join as
|
|
138074
|
+
import { cp, mkdir as mkdir4, readdir as readdir4, readFile as readFile7, rename as rename2, rm as rm4, stat as stat6, writeFile as writeFile4 } from "node:fs/promises";
|
|
138075
|
+
import { dirname as dirname10, extname as extname3, join as join33, resolve as resolve10, sep as sep7 } from "node:path";
|
|
137819
138076
|
var MAX_FILE_SIZE2 = 1024 * 1024;
|
|
137820
138077
|
var LANG_MAP2 = {
|
|
137821
138078
|
".js": "javascript",
|
|
@@ -137863,7 +138120,7 @@ var FilesService = class {
|
|
|
137863
138120
|
throw new WorkspaceNotFoundError(workspaceId);
|
|
137864
138121
|
}
|
|
137865
138122
|
const root = workspace.worktree.path;
|
|
137866
|
-
const target = resolve10(
|
|
138123
|
+
const target = resolve10(join33(root, relative2));
|
|
137867
138124
|
const insideRoot = target === root || target.startsWith(root + sep7);
|
|
137868
138125
|
if (!insideRoot) {
|
|
137869
138126
|
throw new Error("Invalid path");
|
|
@@ -137906,7 +138163,7 @@ var FilesService = class {
|
|
|
137906
138163
|
if (size4 > MAX_FILE_SIZE2) {
|
|
137907
138164
|
return { tooLarge: true, size: size4 };
|
|
137908
138165
|
}
|
|
137909
|
-
const buffer = await
|
|
138166
|
+
const buffer = await readFile7(target);
|
|
137910
138167
|
const sample = buffer.subarray(0, 8192);
|
|
137911
138168
|
if (sample.includes(0)) {
|
|
137912
138169
|
return { binary: true, size: size4 };
|
|
@@ -137926,7 +138183,7 @@ var FilesService = class {
|
|
|
137926
138183
|
if (fileStat.isDirectory()) {
|
|
137927
138184
|
throw new Error("Cannot write to a directory");
|
|
137928
138185
|
}
|
|
137929
|
-
await
|
|
138186
|
+
await writeFile4(target, content2, "utf-8");
|
|
137930
138187
|
return { ok: true };
|
|
137931
138188
|
}
|
|
137932
138189
|
async createFile(workspaceId, path, content2 = "") {
|
|
@@ -137943,7 +138200,7 @@ var FilesService = class {
|
|
|
137943
138200
|
if (!parentStat.isDirectory()) {
|
|
137944
138201
|
throw new Error("Parent is not a directory");
|
|
137945
138202
|
}
|
|
137946
|
-
await
|
|
138203
|
+
await writeFile4(target, content2, { encoding: "utf-8", flag: "wx" });
|
|
137947
138204
|
return { ok: true };
|
|
137948
138205
|
}
|
|
137949
138206
|
async createDirectory(workspaceId, path) {
|
|
@@ -137960,7 +138217,7 @@ var FilesService = class {
|
|
|
137960
138217
|
if (!parentStat.isDirectory()) {
|
|
137961
138218
|
throw new Error("Parent is not a directory");
|
|
137962
138219
|
}
|
|
137963
|
-
await
|
|
138220
|
+
await mkdir4(target);
|
|
137964
138221
|
return { ok: true };
|
|
137965
138222
|
}
|
|
137966
138223
|
async deletePath(workspaceId, path) {
|
|
@@ -138005,7 +138262,7 @@ var FilesService = class {
|
|
|
138005
138262
|
if (!toParentStat.isDirectory()) {
|
|
138006
138263
|
throw new Error("Destination parent is not a directory");
|
|
138007
138264
|
}
|
|
138008
|
-
await
|
|
138265
|
+
await rename2(fromTarget, toTarget);
|
|
138009
138266
|
return {
|
|
138010
138267
|
ok: true,
|
|
138011
138268
|
kind: entryStat.isDirectory() ? "directory" : "file"
|
|
@@ -139712,7 +139969,7 @@ function getScalarHtml(specUrl) {
|
|
|
139712
139969
|
}
|
|
139713
139970
|
|
|
139714
139971
|
// src/server/api/terminals/ws.ts
|
|
139715
|
-
var
|
|
139972
|
+
var log41 = createLogger("terminal-ws");
|
|
139716
139973
|
var MAX_CLOSE_REASON_BYTES = 123;
|
|
139717
139974
|
var HEARTBEAT_INTERVAL_MS2 = 3e4;
|
|
139718
139975
|
function clampCloseReason(reason) {
|
|
@@ -139797,7 +140054,7 @@ async function handleTerminalConnection(ws, req) {
|
|
|
139797
140054
|
existing = await terminalService.info(terminalId) !== null;
|
|
139798
140055
|
} catch (err) {
|
|
139799
140056
|
const msg = err instanceof Error ? err.message : String(err);
|
|
139800
|
-
|
|
140057
|
+
log41.error("Failed to look up terminal %s: %s", terminalId, msg);
|
|
139801
140058
|
safeClose(ws, 1011, msg);
|
|
139802
140059
|
return;
|
|
139803
140060
|
}
|
|
@@ -139840,7 +140097,7 @@ async function handleTerminalConnection(ws, req) {
|
|
|
139840
140097
|
await terminalService.spawn(workspaceId, terminalId, spawnOpts);
|
|
139841
140098
|
} catch (err) {
|
|
139842
140099
|
const msg = err instanceof Error ? err.message : String(err);
|
|
139843
|
-
|
|
140100
|
+
log41.error("Failed to spawn terminal %s for workspace %s: %s", terminalId, workspaceId, msg);
|
|
139844
140101
|
safeClose(ws, 4001, msg);
|
|
139845
140102
|
return;
|
|
139846
140103
|
}
|
|
@@ -139848,7 +140105,7 @@ async function handleTerminalConnection(ws, req) {
|
|
|
139848
140105
|
attachSession(ws, inbox, terminalId, workspaceId, true, pendingMessage);
|
|
139849
140106
|
}
|
|
139850
140107
|
function attachSession(ws, inbox, terminalId, workspaceId, isNew, pendingMessage) {
|
|
139851
|
-
|
|
140108
|
+
log41.debug(
|
|
139852
140109
|
"Terminal %s: %s (workspace %s)",
|
|
139853
140110
|
isNew ? "connected" : "reconnected",
|
|
139854
140111
|
terminalId,
|
|
@@ -139867,7 +140124,7 @@ function attachSession(ws, inbox, terminalId, workspaceId, isNew, pendingMessage
|
|
|
139867
140124
|
});
|
|
139868
140125
|
const unsubscribeExit = terminalService.onExit(terminalId, (event) => {
|
|
139869
140126
|
unsubscribeTitle();
|
|
139870
|
-
|
|
140127
|
+
log41.debug("PTY exited with code %d for terminal %s", event.exitCode, terminalId);
|
|
139871
140128
|
if (ws.readyState === ws.OPEN) {
|
|
139872
140129
|
ws.close(1e3, "Terminal exited");
|
|
139873
140130
|
}
|
|
@@ -139895,7 +140152,7 @@ function attachSession(ws, inbox, terminalId, workspaceId, isNew, pendingMessage
|
|
|
139895
140152
|
try {
|
|
139896
140153
|
attached = await terminalService.attach(terminalId, dims);
|
|
139897
140154
|
} catch (err) {
|
|
139898
|
-
|
|
140155
|
+
log41.error("Failed to attach terminal %s: %s", terminalId, err);
|
|
139899
140156
|
safeClose(ws, 1011, "Terminal attach failed");
|
|
139900
140157
|
return;
|
|
139901
140158
|
}
|
|
@@ -139934,7 +140191,7 @@ function attachSession(ws, inbox, terminalId, workspaceId, isNew, pendingMessage
|
|
|
139934
140191
|
const cols = Number.isFinite(parsed.cols) && parsed.cols > 0 ? parsed.cols : void 0;
|
|
139935
140192
|
const rows = Number.isFinite(parsed.rows) && parsed.rows > 0 ? parsed.rows : void 0;
|
|
139936
140193
|
void startReplay(cols, rows).catch((err) => {
|
|
139937
|
-
|
|
140194
|
+
log41.error("Failed to replay terminal %s: %s", terminalId, err);
|
|
139938
140195
|
});
|
|
139939
140196
|
return;
|
|
139940
140197
|
}
|
|
@@ -139949,7 +140206,7 @@ function attachSession(ws, inbox, terminalId, workspaceId, isNew, pendingMessage
|
|
|
139949
140206
|
clearInterval(pingInterval);
|
|
139950
140207
|
attachment?.detach();
|
|
139951
140208
|
unsubscribeExit();
|
|
139952
|
-
|
|
140209
|
+
log41.debug("Terminal disconnected: %s (PTY kept alive)", terminalId);
|
|
139953
140210
|
});
|
|
139954
140211
|
if (pendingMessage) {
|
|
139955
140212
|
processMessage(pendingMessage);
|
|
@@ -139972,7 +140229,7 @@ function handleMessage(ws, terminalId, message) {
|
|
|
139972
140229
|
}
|
|
139973
140230
|
if (parsed.type === "close") {
|
|
139974
140231
|
void terminalService.kill(terminalId).catch((err) => {
|
|
139975
|
-
|
|
140232
|
+
log41.error("Failed to kill terminal %s: %s", terminalId, err);
|
|
139976
140233
|
});
|
|
139977
140234
|
ws.close(1e3, "Terminal closed by client");
|
|
139978
140235
|
return;
|
|
@@ -139987,7 +140244,7 @@ function handleMessage(ws, terminalId, message) {
|
|
|
139987
140244
|
}
|
|
139988
140245
|
|
|
139989
140246
|
// src/server/infra/browser-host/cdp-proxy.ts
|
|
139990
|
-
var
|
|
140247
|
+
var log42 = createLogger("cdp-proxy");
|
|
139991
140248
|
async function handleCdpConnection(ws, req) {
|
|
139992
140249
|
const url2 = new URL(req.url ?? "", `http://${req.headers.host}`);
|
|
139993
140250
|
const bandTabId = url2.searchParams.get("bandTabId");
|
|
@@ -140010,17 +140267,17 @@ async function handleCdpConnection(ws, req) {
|
|
|
140010
140267
|
cdpTargetId = await ensureCdpTargetId(bandTabId);
|
|
140011
140268
|
} catch (err) {
|
|
140012
140269
|
const message = err instanceof Error ? err.message : String(err);
|
|
140013
|
-
|
|
140270
|
+
log42.debug("ensureCdpTargetId failed for %s: %s", bandTabId, message);
|
|
140014
140271
|
if (ws.readyState === ws.OPEN) {
|
|
140015
140272
|
ws.close(4001, message.slice(0, 123));
|
|
140016
140273
|
}
|
|
140017
140274
|
return;
|
|
140018
140275
|
}
|
|
140019
140276
|
const upstreamUrl = `ws://${DESKTOP_CDP_HOST}:${DESKTOP_CDP_PORT}/devtools/page/${encodeURIComponent(cdpTargetId)}`;
|
|
140020
|
-
|
|
140277
|
+
log42.info("CDP proxy connecting bandTabId=%s upstream=%s", bandTabId, upstreamUrl);
|
|
140021
140278
|
upstream = new wrapper_default(upstreamUrl);
|
|
140022
140279
|
upstream.on("open", () => {
|
|
140023
|
-
|
|
140280
|
+
log42.info("CDP upstream open bandTabId=%s pending=%d", bandTabId, pending.length);
|
|
140024
140281
|
for (const msg of pending) {
|
|
140025
140282
|
upstream?.send(msg);
|
|
140026
140283
|
}
|
|
@@ -140032,20 +140289,20 @@ async function handleCdpConnection(ws, req) {
|
|
|
140032
140289
|
}
|
|
140033
140290
|
});
|
|
140034
140291
|
upstream.on("error", (err) => {
|
|
140035
|
-
|
|
140292
|
+
log42.warn("CDP upstream error bandTabId=%s: %s", bandTabId, err.message);
|
|
140036
140293
|
markTargetDestroyed(bandTabId);
|
|
140037
140294
|
if (ws.readyState === ws.OPEN) {
|
|
140038
140295
|
ws.close(4001, `Desktop CDP error: ${err.message}`.slice(0, 123));
|
|
140039
140296
|
}
|
|
140040
140297
|
});
|
|
140041
140298
|
upstream.on("close", (code) => {
|
|
140042
|
-
|
|
140299
|
+
log42.info("CDP upstream closed bandTabId=%s code=%d", bandTabId, code);
|
|
140043
140300
|
if (ws.readyState === ws.OPEN) {
|
|
140044
140301
|
ws.close(1e3, "Upstream closed");
|
|
140045
140302
|
}
|
|
140046
140303
|
});
|
|
140047
140304
|
ws.on("close", () => {
|
|
140048
|
-
|
|
140305
|
+
log42.debug("CDP client closed bandTabId=%s", bandTabId);
|
|
140049
140306
|
if (upstream && (upstream.readyState === wrapper_default.OPEN || upstream.readyState === wrapper_default.CONNECTING)) {
|
|
140050
140307
|
try {
|
|
140051
140308
|
upstream.close();
|
|
@@ -140054,7 +140311,7 @@ async function handleCdpConnection(ws, req) {
|
|
|
140054
140311
|
}
|
|
140055
140312
|
});
|
|
140056
140313
|
ws.on("error", (err) => {
|
|
140057
|
-
|
|
140314
|
+
log42.debug("CDP client error bandTabId=%s: %s", bandTabId, err.message);
|
|
140058
140315
|
try {
|
|
140059
140316
|
upstream?.close();
|
|
140060
140317
|
} catch {
|
|
@@ -140063,7 +140320,7 @@ async function handleCdpConnection(ws, req) {
|
|
|
140063
140320
|
}
|
|
140064
140321
|
|
|
140065
140322
|
// src/server/infra/browser-host/cdp-targets.ts
|
|
140066
|
-
var
|
|
140323
|
+
var log43 = createLogger("cdp-targets");
|
|
140067
140324
|
var CdpUnreachableError = class extends Error {
|
|
140068
140325
|
constructor(message) {
|
|
140069
140326
|
super(message);
|
|
@@ -140119,7 +140376,7 @@ async function captureSnapshot(bandTabId) {
|
|
|
140119
140376
|
});
|
|
140120
140377
|
ws.on("error", (err) => {
|
|
140121
140378
|
clearTimeout(timeout);
|
|
140122
|
-
|
|
140379
|
+
log43.debug("captureSnapshot ws error for tab %s: %s", bandTabId, err.message);
|
|
140123
140380
|
markTargetDestroyed(bandTabId);
|
|
140124
140381
|
settle(new CdpUnreachableError(err.message));
|
|
140125
140382
|
});
|
|
@@ -140138,7 +140395,7 @@ function runMigrations() {
|
|
|
140138
140395
|
}
|
|
140139
140396
|
|
|
140140
140397
|
// src/server/infra/lsp/lsp-proxy.ts
|
|
140141
|
-
var
|
|
140398
|
+
var log44 = createLogger("lsp-proxy");
|
|
140142
140399
|
function frameMessage(json3) {
|
|
140143
140400
|
const body = Buffer.from(json3, "utf-8");
|
|
140144
140401
|
const header = `Content-Length: ${body.byteLength}\r
|
|
@@ -140156,7 +140413,7 @@ function createFrameParser(onMessage) {
|
|
|
140156
140413
|
const headerStr = buffer.subarray(0, separatorIdx).toString("ascii");
|
|
140157
140414
|
const match = headerStr.match(/Content-Length:\s*(\d+)/i);
|
|
140158
140415
|
if (!match) {
|
|
140159
|
-
|
|
140416
|
+
log44.warn("Malformed LSP header: %s", headerStr);
|
|
140160
140417
|
buffer = buffer.subarray(separatorIdx + 4);
|
|
140161
140418
|
continue;
|
|
140162
140419
|
}
|
|
@@ -140189,7 +140446,7 @@ async function handleLspConnection(ws, req) {
|
|
|
140189
140446
|
session = await getOrSpawnServer(workspaceId, lang);
|
|
140190
140447
|
} catch (err) {
|
|
140191
140448
|
const message = err instanceof Error ? err.message : String(err);
|
|
140192
|
-
|
|
140449
|
+
log44.error(
|
|
140193
140450
|
"Failed to spawn %s language server for workspace %s: %s",
|
|
140194
140451
|
lang,
|
|
140195
140452
|
workspaceId,
|
|
@@ -140203,12 +140460,12 @@ async function handleLspConnection(ws, req) {
|
|
|
140203
140460
|
ws.close(4002, "Language server stdio not available");
|
|
140204
140461
|
return;
|
|
140205
140462
|
}
|
|
140206
|
-
|
|
140463
|
+
log44.debug("LSP client connected: %s/%s", workspaceId, lang);
|
|
140207
140464
|
const pendingRequests = /* @__PURE__ */ new Map();
|
|
140208
140465
|
const retriedIds = /* @__PURE__ */ new Set();
|
|
140209
140466
|
const RETRY_DELAY_MS = 2e3;
|
|
140210
140467
|
const parseFrame = createFrameParser((json3) => {
|
|
140211
|
-
|
|
140468
|
+
log44.debug(
|
|
140212
140469
|
"LSP stdout [%s/%s]: %s",
|
|
140213
140470
|
workspaceId,
|
|
140214
140471
|
lang,
|
|
@@ -140220,7 +140477,7 @@ async function handleLspConnection(ws, req) {
|
|
|
140220
140477
|
const originalRequest = pendingRequests.get(msg.id);
|
|
140221
140478
|
retriedIds.add(msg.id);
|
|
140222
140479
|
pendingRequests.delete(msg.id);
|
|
140223
|
-
|
|
140480
|
+
log44.debug(
|
|
140224
140481
|
"LSP retrying request %d after 'No Project' error [%s/%s]",
|
|
140225
140482
|
msg.id,
|
|
140226
140483
|
workspaceId,
|
|
@@ -140242,14 +140499,14 @@ async function handleLspConnection(ws, req) {
|
|
|
140242
140499
|
const onStdoutData = (chunk) => parseFrame(chunk);
|
|
140243
140500
|
lspProcess.stdout.on("data", onStdoutData);
|
|
140244
140501
|
const onExit = (code) => {
|
|
140245
|
-
|
|
140502
|
+
log44.debug("LSP server exited (code %s), closing WebSocket", String(code));
|
|
140246
140503
|
if (ws.readyState === ws.OPEN) {
|
|
140247
140504
|
ws.close(1e3, "Language server exited");
|
|
140248
140505
|
}
|
|
140249
140506
|
};
|
|
140250
140507
|
lspProcess.on("exit", onExit);
|
|
140251
140508
|
function forwardToStdin(json3) {
|
|
140252
|
-
|
|
140509
|
+
log44.debug(
|
|
140253
140510
|
"LSP stdin [%s/%s]: %s",
|
|
140254
140511
|
workspaceId,
|
|
140255
140512
|
lang,
|
|
@@ -140276,23 +140533,23 @@ async function handleLspConnection(ws, req) {
|
|
|
140276
140533
|
ws.on("close", () => {
|
|
140277
140534
|
lspProcess.stdout?.off("data", onStdoutData);
|
|
140278
140535
|
lspProcess.off("exit", onExit);
|
|
140279
|
-
|
|
140536
|
+
log44.debug("LSP client disconnected: %s/%s (server kept alive)", workspaceId, lang);
|
|
140280
140537
|
});
|
|
140281
140538
|
}
|
|
140282
140539
|
|
|
140283
140540
|
// src/server/infra/terminals/create-backend.ts
|
|
140284
140541
|
import { existsSync as existsSync16, statSync as statSync8 } from "node:fs";
|
|
140285
|
-
import { join as
|
|
140286
|
-
var
|
|
140542
|
+
import { join as join34 } from "node:path";
|
|
140543
|
+
var log45 = createLogger("terminal-backend");
|
|
140287
140544
|
function createTerminalBackend(serverRoot, bandHome2) {
|
|
140288
140545
|
if (process.platform === "win32") return new InProcessTerminalBackend();
|
|
140289
140546
|
if (process.env.BAND_TERMINAL_DAEMON === "0") return new InProcessTerminalBackend();
|
|
140290
140547
|
const entry = [
|
|
140291
|
-
|
|
140292
|
-
|
|
140548
|
+
join34(serverRoot, "terminal-daemon.mjs"),
|
|
140549
|
+
join34(serverRoot, "terminal-daemon.ts")
|
|
140293
140550
|
].find((candidate) => existsSync16(candidate));
|
|
140294
140551
|
if (!entry) {
|
|
140295
|
-
|
|
140552
|
+
log45.error(
|
|
140296
140553
|
{ serverRoot },
|
|
140297
140554
|
"terminal daemon entry is missing; terminals will not survive a server restart"
|
|
140298
140555
|
);
|
|
@@ -140301,7 +140558,7 @@ function createTerminalBackend(serverRoot, bandHome2) {
|
|
|
140301
140558
|
const { size: size4, mtimeMs } = statSync8(entry);
|
|
140302
140559
|
return new DaemonTerminalBackend({
|
|
140303
140560
|
entry,
|
|
140304
|
-
runDir:
|
|
140561
|
+
runDir: join34(bandHome2, "run"),
|
|
140305
140562
|
cwd: bandHome2,
|
|
140306
140563
|
buildId: `${size4}-${Math.trunc(mtimeMs)}`
|
|
140307
140564
|
});
|
|
@@ -140344,7 +140601,7 @@ async function listenWithFallback(server, startPort, attempts = 20) {
|
|
|
140344
140601
|
import { execFile as execFile10 } from "node:child_process";
|
|
140345
140602
|
import { statSync as statSync9 } from "node:fs";
|
|
140346
140603
|
import { homedir as homedir8 } from "node:os";
|
|
140347
|
-
import { join as
|
|
140604
|
+
import { join as join35 } from "node:path";
|
|
140348
140605
|
var BAND_SKILL_NAMES = [
|
|
140349
140606
|
"band",
|
|
140350
140607
|
"band-chat",
|
|
@@ -140397,7 +140654,7 @@ async function installSkills(opts = {}) {
|
|
|
140397
140654
|
const sharedDir = getSharedSkillsDir(home);
|
|
140398
140655
|
const markAllSkipped = () => {
|
|
140399
140656
|
for (const name3 of BAND_SKILL_NAMES) {
|
|
140400
|
-
result.skipped.push(
|
|
140657
|
+
result.skipped.push(join35(sharedDir, name3, SKILL_FILE));
|
|
140401
140658
|
}
|
|
140402
140659
|
};
|
|
140403
140660
|
const bandPath = await findBandBinary();
|
|
@@ -140450,7 +140707,7 @@ async function installSkills(opts = {}) {
|
|
|
140450
140707
|
}
|
|
140451
140708
|
|
|
140452
140709
|
// src/server/services/setup-service.ts
|
|
140453
|
-
var
|
|
140710
|
+
var log46 = createLogger("setup");
|
|
140454
140711
|
var AGENT_CHECKS = [
|
|
140455
140712
|
{ id: "claude-code", type: "claude-code", label: "Claude Code", binary: "claude" },
|
|
140456
140713
|
{ id: "codex", type: "codex", label: "Codex", binary: "codex" },
|
|
@@ -140467,7 +140724,7 @@ async function runFirstTimeSetup() {
|
|
|
140467
140724
|
]);
|
|
140468
140725
|
for (const r2 of results) {
|
|
140469
140726
|
if (r2.status === "rejected") {
|
|
140470
|
-
|
|
140727
|
+
log46.warn(
|
|
140471
140728
|
"Setup step failed: %s",
|
|
140472
140729
|
r2.reason instanceof Error ? r2.reason.message : String(r2.reason)
|
|
140473
140730
|
);
|
|
@@ -140481,7 +140738,7 @@ async function refreshAgentModelsInBackground() {
|
|
|
140481
140738
|
const ok = results.filter((r2) => !r2.error).length;
|
|
140482
140739
|
const failed = results.length - ok;
|
|
140483
140740
|
if (results.length > 0) {
|
|
140484
|
-
|
|
140741
|
+
log46.info(
|
|
140485
140742
|
"Background model refresh: %d/%d agents updated (%d failed)",
|
|
140486
140743
|
ok,
|
|
140487
140744
|
results.length,
|
|
@@ -140489,7 +140746,7 @@ async function refreshAgentModelsInBackground() {
|
|
|
140489
140746
|
);
|
|
140490
140747
|
}
|
|
140491
140748
|
} catch (err) {
|
|
140492
|
-
|
|
140749
|
+
log46.warn(
|
|
140493
140750
|
"Background model refresh failed: %s",
|
|
140494
140751
|
err instanceof Error ? err.message : String(err)
|
|
140495
140752
|
);
|
|
@@ -140503,7 +140760,7 @@ async function ensureProjectStateInSync() {
|
|
|
140503
140760
|
try {
|
|
140504
140761
|
await syncService.syncWorktrees();
|
|
140505
140762
|
} catch (err) {
|
|
140506
|
-
|
|
140763
|
+
log46.warn(
|
|
140507
140764
|
"Failed to sync project state at boot: %s",
|
|
140508
140765
|
err instanceof Error ? err.message : String(err)
|
|
140509
140766
|
);
|
|
@@ -140514,22 +140771,22 @@ async function ensureCliInstalled() {
|
|
|
140514
140771
|
try {
|
|
140515
140772
|
cliStatus = await checkCli();
|
|
140516
140773
|
} catch (err) {
|
|
140517
|
-
|
|
140774
|
+
log46.warn("Could not check CLI status: %s", err instanceof Error ? err.message : String(err));
|
|
140518
140775
|
return;
|
|
140519
140776
|
}
|
|
140520
140777
|
if (cliStatus === "Installed") {
|
|
140521
140778
|
return;
|
|
140522
140779
|
}
|
|
140523
140780
|
if (cliStatus !== "NotInstalled") {
|
|
140524
|
-
|
|
140781
|
+
log46.warn("CLI not auto-installed (status: %s)", cliStatus);
|
|
140525
140782
|
return;
|
|
140526
140783
|
}
|
|
140527
|
-
|
|
140784
|
+
log46.info("Installing band CLI...");
|
|
140528
140785
|
try {
|
|
140529
140786
|
await installCli();
|
|
140530
|
-
|
|
140787
|
+
log46.info("CLI installed to %s", SYMLINK_PATH);
|
|
140531
140788
|
} catch (err) {
|
|
140532
|
-
|
|
140789
|
+
log46.warn("CLI installation failed: %s", err instanceof Error ? err.message : String(err));
|
|
140533
140790
|
}
|
|
140534
140791
|
}
|
|
140535
140792
|
async function ensureDefaultCodingAgents() {
|
|
@@ -140538,17 +140795,17 @@ async function ensureDefaultCodingAgents() {
|
|
|
140538
140795
|
if (Array.isArray(existing) && existing.length > 0) {
|
|
140539
140796
|
return;
|
|
140540
140797
|
}
|
|
140541
|
-
|
|
140798
|
+
log46.info("Detecting installed coding agents...");
|
|
140542
140799
|
const detected = [];
|
|
140543
140800
|
for (const check2 of AGENT_CHECKS) {
|
|
140544
140801
|
const path = await systemService.whichBinary(check2.binary);
|
|
140545
140802
|
if (path) {
|
|
140546
|
-
|
|
140803
|
+
log46.info("Detected coding agent: %s (%s)", check2.id, path);
|
|
140547
140804
|
detected.push({ id: check2.id, type: check2.type, label: check2.label });
|
|
140548
140805
|
}
|
|
140549
140806
|
}
|
|
140550
140807
|
if (detected.length === 0) {
|
|
140551
|
-
|
|
140808
|
+
log46.info("No coding agent CLIs detected on PATH");
|
|
140552
140809
|
return;
|
|
140553
140810
|
}
|
|
140554
140811
|
const current2 = loadSettings();
|
|
@@ -140557,7 +140814,7 @@ async function ensureDefaultCodingAgents() {
|
|
|
140557
140814
|
current2.defaultCodingAgent = detected[0].id;
|
|
140558
140815
|
}
|
|
140559
140816
|
saveSettings(current2);
|
|
140560
|
-
|
|
140817
|
+
log46.info("Enabled %d coding agent(s); default = %s", detected.length, current2.defaultCodingAgent);
|
|
140561
140818
|
}
|
|
140562
140819
|
function ensureNotificationDefaults() {
|
|
140563
140820
|
const settings2 = loadSettings();
|
|
@@ -140569,7 +140826,7 @@ function ensureNotificationDefaults() {
|
|
|
140569
140826
|
...settings2,
|
|
140570
140827
|
notifications: { ...notifications, soundOnNeedsAttention: true }
|
|
140571
140828
|
});
|
|
140572
|
-
|
|
140829
|
+
log46.info("Set default notifications.soundOnNeedsAttention = true");
|
|
140573
140830
|
}
|
|
140574
140831
|
async function ensureClaudeHooks() {
|
|
140575
140832
|
try {
|
|
@@ -140578,9 +140835,9 @@ async function ensureClaudeHooks() {
|
|
|
140578
140835
|
return;
|
|
140579
140836
|
}
|
|
140580
140837
|
await installHooks();
|
|
140581
|
-
|
|
140838
|
+
log46.info("Installed Claude Code hooks");
|
|
140582
140839
|
} catch (err) {
|
|
140583
|
-
|
|
140840
|
+
log46.warn(
|
|
140584
140841
|
"Failed to install Claude Code hooks: %s",
|
|
140585
140842
|
err instanceof Error ? err.message : String(err)
|
|
140586
140843
|
);
|
|
@@ -140588,11 +140845,11 @@ async function ensureClaudeHooks() {
|
|
|
140588
140845
|
}
|
|
140589
140846
|
async function ensureSkillsInstalled() {
|
|
140590
140847
|
try {
|
|
140591
|
-
const result = await installSkills({ log:
|
|
140848
|
+
const result = await installSkills({ log: log46 });
|
|
140592
140849
|
const wrote = result.written.length + result.updated.length;
|
|
140593
140850
|
const linkChange = result.linked.length;
|
|
140594
140851
|
if (wrote > 0 || linkChange > 0 || result.conflicts.length > 0) {
|
|
140595
|
-
|
|
140852
|
+
log46.info(
|
|
140596
140853
|
"Synced CLI skills (shared: %d written, %d updated, %d unchanged; symlinks: %d created, %d already-linked, %d conflicts, %d skipped)",
|
|
140597
140854
|
result.written.length,
|
|
140598
140855
|
result.updated.length,
|
|
@@ -140604,7 +140861,7 @@ async function ensureSkillsInstalled() {
|
|
|
140604
140861
|
);
|
|
140605
140862
|
}
|
|
140606
140863
|
} catch (err) {
|
|
140607
|
-
|
|
140864
|
+
log46.warn("Failed to sync CLI skills: %s", err instanceof Error ? err.message : String(err));
|
|
140608
140865
|
}
|
|
140609
140866
|
}
|
|
140610
140867
|
var SetupService = class {
|
|
@@ -140618,7 +140875,7 @@ var setupService = new SetupService();
|
|
|
140618
140875
|
function logCrash(message) {
|
|
140619
140876
|
try {
|
|
140620
140877
|
mkdirSync8(bandHome(), { recursive: true });
|
|
140621
|
-
appendFileSync(
|
|
140878
|
+
appendFileSync(join36(bandHome(), "server.log"), message, "utf-8");
|
|
140622
140879
|
} catch {
|
|
140623
140880
|
}
|
|
140624
140881
|
}
|
|
@@ -140648,7 +140905,7 @@ ${error40.stack || error40.message}
|
|
|
140648
140905
|
process.exit(1);
|
|
140649
140906
|
});
|
|
140650
140907
|
var SERVER_ROOT = import.meta.dirname;
|
|
140651
|
-
var clientDir =
|
|
140908
|
+
var clientDir = join36(SERVER_ROOT, "client");
|
|
140652
140909
|
function resolveInitialPort() {
|
|
140653
140910
|
const fromEnv = Number.parseInt(process.env.PORT ?? "", 10);
|
|
140654
140911
|
if (Number.isFinite(fromEnv) && fromEnv > 0) return fromEnv;
|
|
@@ -140675,7 +140932,7 @@ function getOpenApiSpec() {
|
|
|
140675
140932
|
if (isDev) {
|
|
140676
140933
|
const { generateOpenAPIDocument } = await import("@trpc/openapi");
|
|
140677
140934
|
const doc2 = await generateOpenAPIDocument(
|
|
140678
|
-
|
|
140935
|
+
join36(SERVER_ROOT, "src", "server", "api", "router.ts"),
|
|
140679
140936
|
{
|
|
140680
140937
|
title: "Band API",
|
|
140681
140938
|
version: "1.0.0"
|
|
@@ -140684,7 +140941,7 @@ function getOpenApiSpec() {
|
|
|
140684
140941
|
doc2.servers = [{ url: "/trpc" }];
|
|
140685
140942
|
return JSON.stringify(doc2, null, 2);
|
|
140686
140943
|
}
|
|
140687
|
-
const openApiDoc = JSON.parse(readFileSync8(
|
|
140944
|
+
const openApiDoc = JSON.parse(readFileSync8(join36(SERVER_ROOT, "openapi.json"), "utf-8"));
|
|
140688
140945
|
openApiDoc.servers = [{ url: "/trpc" }];
|
|
140689
140946
|
return JSON.stringify(openApiDoc, null, 2);
|
|
140690
140947
|
})().catch((err) => {
|
|
@@ -140707,7 +140964,7 @@ function serveStaticFile(res, root, subdir, rawFilename) {
|
|
|
140707
140964
|
res.end("Bad request");
|
|
140708
140965
|
return;
|
|
140709
140966
|
}
|
|
140710
|
-
const filePath =
|
|
140967
|
+
const filePath = join36(root, subdir, filename);
|
|
140711
140968
|
try {
|
|
140712
140969
|
const fileStat = statSync10(filePath);
|
|
140713
140970
|
const contentType = mimeTypeFromFilename(filename);
|
|
@@ -140730,7 +140987,7 @@ function serveWorkspaceFile(res, workspaceId, rawPath) {
|
|
|
140730
140987
|
return;
|
|
140731
140988
|
}
|
|
140732
140989
|
const root = workspace.worktree.path;
|
|
140733
|
-
const target = resolve11(
|
|
140990
|
+
const target = resolve11(join36(root, rawPath));
|
|
140734
140991
|
if (!target.startsWith(root + sep8) && target !== root) {
|
|
140735
140992
|
res.writeHead(400);
|
|
140736
140993
|
res.end("Bad request");
|
|
@@ -140883,6 +141140,36 @@ async function main() {
|
|
|
140883
141140
|
serveStaticFile(res, bandHome(), "uploads", req.url.slice("/api/uploads/".length));
|
|
140884
141141
|
return;
|
|
140885
141142
|
}
|
|
141143
|
+
const projectAvatarMatch = req.url?.match(/^\/api\/project-avatar\/([^/?]+)(?:\?|$)/);
|
|
141144
|
+
if (projectAvatarMatch && req.method === "GET") {
|
|
141145
|
+
let projectName;
|
|
141146
|
+
try {
|
|
141147
|
+
projectName = decodeURIComponent(projectAvatarMatch[1]);
|
|
141148
|
+
} catch {
|
|
141149
|
+
res.writeHead(400);
|
|
141150
|
+
res.end("Bad request");
|
|
141151
|
+
return;
|
|
141152
|
+
}
|
|
141153
|
+
const avatar = await projectAvatarService.image(projectName);
|
|
141154
|
+
if (!avatar) {
|
|
141155
|
+
res.writeHead(404, { "Cache-Control": "no-store" });
|
|
141156
|
+
res.end("Not found");
|
|
141157
|
+
return;
|
|
141158
|
+
}
|
|
141159
|
+
res.writeHead(200, {
|
|
141160
|
+
"Content-Type": avatar.contentType,
|
|
141161
|
+
"Content-Length": avatar.bytes.length.toString(),
|
|
141162
|
+
"Cache-Control": "private, max-age=3600",
|
|
141163
|
+
"X-Content-Type-Options": "nosniff",
|
|
141164
|
+
// The bytes come from a remote host. If one is ever opened as a
|
|
141165
|
+
// document rather than through <img>, it gets no script and no
|
|
141166
|
+
// access to Band's origin.
|
|
141167
|
+
"Content-Security-Policy": "default-src 'none'; sandbox",
|
|
141168
|
+
"Content-Disposition": "inline"
|
|
141169
|
+
});
|
|
141170
|
+
res.end(avatar.bytes);
|
|
141171
|
+
return;
|
|
141172
|
+
}
|
|
140886
141173
|
if (req.url?.startsWith("/api/shared/")) {
|
|
140887
141174
|
const rest = req.url.slice("/api/shared/".length);
|
|
140888
141175
|
const slashIdx = rest.indexOf("/");
|
|
@@ -140897,7 +141184,7 @@ async function main() {
|
|
|
140897
141184
|
res.end("Bad request");
|
|
140898
141185
|
return;
|
|
140899
141186
|
}
|
|
140900
|
-
serveStaticFile(res, bandHome(),
|
|
141187
|
+
serveStaticFile(res, bandHome(), join36("shared", partition), rest.slice(slashIdx + 1));
|
|
140901
141188
|
return;
|
|
140902
141189
|
}
|
|
140903
141190
|
if (req.url?.startsWith("/api/workspace-file/")) {
|
|
@@ -141078,7 +141365,7 @@ async function main() {
|
|
|
141078
141365
|
const mod = await viteServer.ssrLoadModule("@tanstack/react-start/server-entry");
|
|
141079
141366
|
return mod.default.fetch(request);
|
|
141080
141367
|
};
|
|
141081
|
-
const apiDir =
|
|
141368
|
+
const apiDir = join36(SERVER_ROOT, "src", "server", "api");
|
|
141082
141369
|
viteServer.watcher.on("change", (file2) => {
|
|
141083
141370
|
if (file2.startsWith(apiDir)) {
|
|
141084
141371
|
_openApiSpec = null;
|