@dylanpiercey/work 0.0.39 → 0.0.41

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.
Files changed (158) hide show
  1. package/README.md +11 -1
  2. package/bin/work.mjs +76 -1
  3. package/dist/index.mjs +1148 -788
  4. package/dist/public/assets/{_D7dsIO-O2.js → _3FvrUJYy2.js} +2 -2
  5. package/dist/public/assets/{_D7dsIO-O2.js.map → _3FvrUJYy2.js.map} +1 -1
  6. package/dist/public/assets/{_8FQvJvvC.js → _B0Lbe-Ub.js} +2 -2
  7. package/dist/public/assets/{_8FQvJvvC.js.map → _B0Lbe-Ub.js.map} +1 -1
  8. package/dist/public/assets/{_D51cBuRP.js → _B2NkZVYt.js} +2 -2
  9. package/dist/public/assets/{_D51cBuRP.js.map → _B2NkZVYt.js.map} +1 -1
  10. package/dist/public/assets/{_WOCAvL642.js → _B67tNyB02.js} +2 -2
  11. package/dist/public/assets/{_WOCAvL642.js.map → _B67tNyB02.js.map} +1 -1
  12. package/dist/public/assets/{_CR7soDA62.js → _B72m4Heg2.js} +2 -2
  13. package/dist/public/assets/{_CR7soDA62.js.map → _B72m4Heg2.js.map} +1 -1
  14. package/dist/public/assets/{_9mIlYM38.js → _B7kC4ECJ.js} +2 -2
  15. package/dist/public/assets/{_9mIlYM38.js.map → _B7kC4ECJ.js.map} +1 -1
  16. package/dist/public/assets/{_BWm0ZgI6.js → _B7s0O6p8.js} +2 -2
  17. package/dist/public/assets/{_BWm0ZgI6.js.map → _B7s0O6p8.js.map} +1 -1
  18. package/dist/public/assets/{_Bq_UbhoI2.js → _BBC6FrOe2.js} +2 -2
  19. package/dist/public/assets/{_Bq_UbhoI2.js.map → _BBC6FrOe2.js.map} +1 -1
  20. package/dist/public/assets/{_CFFd0jR-2.js → _BCIV1arR2.js} +2 -2
  21. package/dist/public/assets/{_CFFd0jR-2.js.map → _BCIV1arR2.js.map} +1 -1
  22. package/dist/public/assets/{_DzkSj4zS2.js → _BCnAMUTQ2.js} +2 -2
  23. package/dist/public/assets/{_DzkSj4zS2.js.map → _BCnAMUTQ2.js.map} +1 -1
  24. package/dist/public/assets/{_zW4ABdBd.js → _BCr95U42.js} +2 -2
  25. package/dist/public/assets/{_zW4ABdBd.js.map → _BCr95U42.js.map} +1 -1
  26. package/dist/public/assets/{__dMnQCKa.js → _BKxOULLA.js} +2 -2
  27. package/dist/public/assets/{__dMnQCKa.js.map → _BKxOULLA.js.map} +1 -1
  28. package/dist/public/assets/{_CGMrqKQx.js → _BLiEKrCj.js} +2 -2
  29. package/dist/public/assets/{_CGMrqKQx.js.map → _BLiEKrCj.js.map} +1 -1
  30. package/dist/public/assets/{_0YVFvNq7.js → _BOb-Pn3q.js} +2 -2
  31. package/dist/public/assets/{_0YVFvNq7.js.map → _BOb-Pn3q.js.map} +1 -1
  32. package/dist/public/assets/{_B9ZTM6vy.js → _BQBiYAA_.js} +2 -2
  33. package/dist/public/assets/{_B9ZTM6vy.js.map → _BQBiYAA_.js.map} +1 -1
  34. package/dist/public/assets/{_CXeLdopD2.js → _BVpFyzyu2.js} +2 -2
  35. package/dist/public/assets/{_CXeLdopD2.js.map → _BVpFyzyu2.js.map} +1 -1
  36. package/dist/public/assets/{_B1sHSj4w2.js → _BW-4hwO72.js} +2 -2
  37. package/dist/public/assets/{_B1sHSj4w2.js.map → _BW-4hwO72.js.map} +1 -1
  38. package/dist/public/assets/{_haaSjWYo.js → _BWNzPyR-.js} +2 -2
  39. package/dist/public/assets/{_haaSjWYo.js.map → _BWNzPyR-.js.map} +1 -1
  40. package/dist/public/assets/{_RKCdcM6s.js → _BXsQSWWX.js} +2 -2
  41. package/dist/public/assets/{_RKCdcM6s.js.map → _BXsQSWWX.js.map} +1 -1
  42. package/dist/public/assets/{_3_h0JIqF2.js → _B_WEnwWZ2.js} +2 -2
  43. package/dist/public/assets/{_3_h0JIqF2.js.map → _B_WEnwWZ2.js.map} +1 -1
  44. package/dist/public/assets/{_CsBnKH_a2.js → _Bct9DrCG2.js} +2 -2
  45. package/dist/public/assets/{_CsBnKH_a2.js.map → _Bct9DrCG2.js.map} +1 -1
  46. package/dist/public/assets/{_DIhu80mU.js → _BdJRzcvC.js} +2 -2
  47. package/dist/public/assets/{_DIhu80mU.js.map → _BdJRzcvC.js.map} +1 -1
  48. package/dist/public/assets/{_BwHPDQ2K2.js → _BfM6eibe2.js} +2 -2
  49. package/dist/public/assets/{_BwHPDQ2K2.js.map → _BfM6eibe2.js.map} +1 -1
  50. package/dist/public/assets/{_DpJaOsUS2.js → _Bg7axLcI2.js} +2 -2
  51. package/dist/public/assets/{_DpJaOsUS2.js.map → _Bg7axLcI2.js.map} +1 -1
  52. package/dist/public/assets/{_yNCqh4w6.js → _BjchXZRW.js} +2 -2
  53. package/dist/public/assets/{_yNCqh4w6.js.map → _BjchXZRW.js.map} +1 -1
  54. package/dist/public/assets/{_CF4aOEw0.js → _BnSmLTYb.js} +2 -2
  55. package/dist/public/assets/{_CF4aOEw0.js.map → _BnSmLTYb.js.map} +1 -1
  56. package/dist/public/assets/{_B222bJOA.js → _Bni2E818.js} +2 -2
  57. package/dist/public/assets/{_B222bJOA.js.map → _Bni2E818.js.map} +1 -1
  58. package/dist/public/assets/{_D2YiTEdV2.js → _BoX_Ofe92.js} +2 -2
  59. package/dist/public/assets/{_D2YiTEdV2.js.map → _BoX_Ofe92.js.map} +1 -1
  60. package/dist/public/assets/{_C9FF4Nwt2.js → _BocyNiHx2.js} +2 -2
  61. package/dist/public/assets/{_C9FF4Nwt2.js.map → _BocyNiHx2.js.map} +1 -1
  62. package/dist/public/assets/{_Cd1ynaVf.js → _ByWtfiyC.js} +2 -2
  63. package/dist/public/assets/{_Cd1ynaVf.js.map → _ByWtfiyC.js.map} +1 -1
  64. package/dist/public/assets/{_Biu1sMqL2.js → _C2jFdMKg2.js} +2 -2
  65. package/dist/public/assets/{_Biu1sMqL2.js.map → _C2jFdMKg2.js.map} +1 -1
  66. package/dist/public/assets/{_CN_uVutc.js → _C4VRIVt2.js} +2 -2
  67. package/dist/public/assets/{_CN_uVutc.js.map → _C4VRIVt2.js.map} +1 -1
  68. package/dist/public/assets/{_CVepAYMH.js → _C78LMQ4R.js} +2 -2
  69. package/dist/public/assets/{_CVepAYMH.js.map → _C78LMQ4R.js.map} +1 -1
  70. package/dist/public/assets/{_DrAyvf042.js → _CHpdg7T22.js} +2 -2
  71. package/dist/public/assets/{_DrAyvf042.js.map → _CHpdg7T22.js.map} +1 -1
  72. package/dist/public/assets/{_frxegHGP.js → _CLG4Axpw.js} +2 -2
  73. package/dist/public/assets/{_frxegHGP.js.map → _CLG4Axpw.js.map} +1 -1
  74. package/dist/public/assets/{_CM1Bz2e2.js → _CMC5FOms.js} +2 -2
  75. package/dist/public/assets/{_CM1Bz2e2.js.map → _CMC5FOms.js.map} +1 -1
  76. package/dist/public/assets/{_aF_XxRRK.js → _COW7ENXO.js} +2 -2
  77. package/dist/public/assets/{_aF_XxRRK.js.map → _COW7ENXO.js.map} +1 -1
  78. package/dist/public/assets/{_gCS79yat.js → _CR9ATfbr.js} +2 -2
  79. package/dist/public/assets/{_gCS79yat.js.map → _CR9ATfbr.js.map} +1 -1
  80. package/dist/public/assets/{_wqbV3ClO2.js → _CXQ9i19x2.js} +2 -2
  81. package/dist/public/assets/{_wqbV3ClO2.js.map → _CXQ9i19x2.js.map} +1 -1
  82. package/dist/public/assets/{_BWmXhThI.js → _C_g0fhev.js} +2 -2
  83. package/dist/public/assets/{_BWmXhThI.js.map → _C_g0fhev.js.map} +1 -1
  84. package/dist/public/assets/{_Dlge38I0.js → _Cf990ZTV.js} +2 -2
  85. package/dist/public/assets/{_Dlge38I0.js.map → _Cf990ZTV.js.map} +1 -1
  86. package/dist/public/assets/{_B-8ckAju2.js → _CglqdFiD2.js} +2 -2
  87. package/dist/public/assets/{_B-8ckAju2.js.map → _CglqdFiD2.js.map} +1 -1
  88. package/dist/public/assets/{_Cry0Vu092.js → _CsZuTP-e2.js} +2 -2
  89. package/dist/public/assets/{_Cry0Vu092.js.map → _CsZuTP-e2.js.map} +1 -1
  90. package/dist/public/assets/{_CYFv9QGU.js → _CuXae0ve.js} +2 -2
  91. package/dist/public/assets/{_CYFv9QGU.js.map → _CuXae0ve.js.map} +1 -1
  92. package/dist/public/assets/{_BCGHghp3.js → _D-CiRcbK.js} +2 -2
  93. package/dist/public/assets/{_BCGHghp3.js.map → _D-CiRcbK.js.map} +1 -1
  94. package/dist/public/assets/{_DZOjtuBx.js → _D20wuad5.js} +2 -2
  95. package/dist/public/assets/{_DZOjtuBx.js.map → _D20wuad5.js.map} +1 -1
  96. package/dist/public/assets/{_Dh3Zdz4W.js → _D4T8Kx36.js} +2 -2
  97. package/dist/public/assets/{_Dh3Zdz4W.js.map → _D4T8Kx36.js.map} +1 -1
  98. package/dist/public/assets/{_DN7QgLB-.js → _D8kGoid1.js} +2 -2
  99. package/dist/public/assets/{_DN7QgLB-.js.map → _D8kGoid1.js.map} +1 -1
  100. package/dist/public/assets/{_CuUIu7A0.js → _D9nZPeON.js} +2 -2
  101. package/dist/public/assets/{_CuUIu7A0.js.map → _D9nZPeON.js.map} +1 -1
  102. package/dist/public/assets/{_B0Zx9TVd.js → _DANQhsl6.js} +2 -2
  103. package/dist/public/assets/{_B0Zx9TVd.js.map → _DANQhsl6.js.map} +1 -1
  104. package/dist/public/assets/{_CudIJ9N1.js → _DCdPuEzi.js} +2 -2
  105. package/dist/public/assets/{_CudIJ9N1.js.map → _DCdPuEzi.js.map} +1 -1
  106. package/dist/public/assets/{_BpjzFBgX.js → _DDsvxP8k.js} +2 -2
  107. package/dist/public/assets/{_BpjzFBgX.js.map → _DDsvxP8k.js.map} +1 -1
  108. package/dist/public/assets/{_CGlduZ09.js → _DITDEtIK.js} +2 -2
  109. package/dist/public/assets/{_CGlduZ09.js.map → _DITDEtIK.js.map} +1 -1
  110. package/dist/public/assets/{_CWq_CViy.js → _DKIbpX1r.js} +2 -2
  111. package/dist/public/assets/{_CWq_CViy.js.map → _DKIbpX1r.js.map} +1 -1
  112. package/dist/public/assets/{_CfjmjCpz2.js → _DLtguS0M2.js} +2 -2
  113. package/dist/public/assets/{_CfjmjCpz2.js.map → _DLtguS0M2.js.map} +1 -1
  114. package/dist/public/assets/{_BaVw_5rb.js → _DOK3qs_j.js} +2 -2
  115. package/dist/public/assets/{_BaVw_5rb.js.map → _DOK3qs_j.js.map} +1 -1
  116. package/dist/public/assets/{_Bn3jsc1x2.js → _DOMdlLi02.js} +2 -2
  117. package/dist/public/assets/{_Bn3jsc1x2.js.map → _DOMdlLi02.js.map} +1 -1
  118. package/dist/public/assets/{_B0tTvCKz.js → _DOuSJx7H.js} +2 -2
  119. package/dist/public/assets/{_B0tTvCKz.js.map → _DOuSJx7H.js.map} +1 -1
  120. package/dist/public/assets/{_CxK19rXP.js → _DRFzGQ_P.js} +2 -2
  121. package/dist/public/assets/{_CxK19rXP.js.map → _DRFzGQ_P.js.map} +1 -1
  122. package/dist/public/assets/{_BTD-E3MH.js → _DYUI_qtj.js} +2 -2
  123. package/dist/public/assets/{_BTD-E3MH.js.map → _DYUI_qtj.js.map} +1 -1
  124. package/dist/public/assets/{_Cj248HDV.js → _Di2tZObT.js} +2 -2
  125. package/dist/public/assets/{_Cj248HDV.js.map → _Di2tZObT.js.map} +1 -1
  126. package/dist/public/assets/{_DpZRF37u.js → _DiZzZSjb.js} +2 -2
  127. package/dist/public/assets/{_DpZRF37u.js.map → _DiZzZSjb.js.map} +1 -1
  128. package/dist/public/assets/{_BQHdIsH-.js → _Dl4EWW5M.js} +2 -2
  129. package/dist/public/assets/{_BQHdIsH-.js.map → _Dl4EWW5M.js.map} +1 -1
  130. package/dist/public/assets/{_IEZe9nw42.js → _DnucOiTi2.js} +2 -2
  131. package/dist/public/assets/{_IEZe9nw42.js.map → _DnucOiTi2.js.map} +1 -1
  132. package/dist/public/assets/{_D79L--fl.js → _EPocSo4T.js} +2 -2
  133. package/dist/public/assets/{_D79L--fl.js.map → _EPocSo4T.js.map} +1 -1
  134. package/dist/public/assets/{_Bl7Ludpl.js → _KKXFtWm1.js} +2 -2
  135. package/dist/public/assets/{_Bl7Ludpl.js.map → _KKXFtWm1.js.map} +1 -1
  136. package/dist/public/assets/{_BlBppazN.js → _MORbWdYO.js} +2 -2
  137. package/dist/public/assets/{_BlBppazN.js.map → _MORbWdYO.js.map} +1 -1
  138. package/dist/public/assets/{_bcyfHqN_2.js → _QIS_jvCk2.js} +2 -2
  139. package/dist/public/assets/{_bcyfHqN_2.js.map → _QIS_jvCk2.js.map} +1 -1
  140. package/dist/public/assets/{_Dq_5FFld.js → _Zjm8E5gs.js} +2 -2
  141. package/dist/public/assets/{_Dq_5FFld.js.map → _Zjm8E5gs.js.map} +1 -1
  142. package/dist/public/assets/{_HibLhaHH.js → __Fv6A47I.js} +2 -2
  143. package/dist/public/assets/{_HibLhaHH.js.map → __Fv6A47I.js.map} +1 -1
  144. package/dist/public/assets/{_CUhN1PMI.js → _bqFlf3Pi.js} +2 -2
  145. package/dist/public/assets/{_CUhN1PMI.js.map → _bqFlf3Pi.js.map} +1 -1
  146. package/dist/public/assets/{_KoAN5c4U.js → _eLpVB_Wq.js} +2 -2
  147. package/dist/public/assets/{_KoAN5c4U.js.map → _eLpVB_Wq.js.map} +1 -1
  148. package/dist/public/assets/{_D2ch0L3l2.js → _lXr5_a6k2.js} +2 -2
  149. package/dist/public/assets/{_D2ch0L3l2.js.map → _lXr5_a6k2.js.map} +1 -1
  150. package/dist/public/assets/{_D4GRfjHF.js → _vk5AMlte.js} +2 -2
  151. package/dist/public/assets/{_D4GRfjHF.js.map → _vk5AMlte.js.map} +1 -1
  152. package/dist/public/assets/index-B0XMMdPo.css +1 -0
  153. package/dist/public/assets/index-CNo7v-9k.js +1615 -0
  154. package/dist/public/assets/index-CNo7v-9k.js.map +1 -0
  155. package/package.json +3 -1
  156. package/dist/public/assets/index-BJLi-qve.css +0 -1
  157. package/dist/public/assets/index-YZZGnWtK.js +0 -1615
  158. package/dist/public/assets/index-YZZGnWtK.js.map +0 -1
package/dist/index.mjs CHANGED
@@ -8,6 +8,7 @@ import { Readable } from "node:stream";
8
8
  import { AsyncLocalStorage } from "node:async_hooks";
9
9
  import fs from "node:fs";
10
10
  import os from "node:os";
11
+ import { DatabaseSync } from "node:sqlite";
11
12
  import { spawn } from "node:child_process";
12
13
  import fsp from "node:fs/promises";
13
14
  import crypto from "node:crypto";
@@ -4377,32 +4378,13 @@ var _layout_default = _template("a", (input) => {
4377
4378
  _trailers("</body></html>");
4378
4379
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {});
4379
4380
  }, 1);
4380
- var page_module_default = { boot: "_w" };
4381
- var ui_module_default = {
4382
- icon: "_a",
4383
- btn: "_b",
4384
- primary: "_c",
4385
- danger: "_d",
4386
- armed: "_e",
4387
- chip: "_f",
4388
- lane: "_g",
4389
- pr: "_h",
4390
- draft: "_i",
4391
- dim: "_j",
4392
- mono: "_k",
4393
- spacer: "_l",
4394
- dot: "_m",
4395
- working: "_n",
4396
- waiting: "_o",
4397
- idle: "_p",
4398
- off: "_q",
4399
- splitBtn: "_r",
4400
- splitPrimary: "_s _r",
4401
- splitGrow: "_t",
4402
- spin: "_u",
4403
- workSpin: "_v"
4381
+ var phase = {
4382
+ working: "_p",
4383
+ waiting: "_q",
4384
+ idle: "_r",
4385
+ off: "_s"
4404
4386
  };
4405
- var page_boot_module_default = { root: "_x" };
4387
+ var splitPrimary = "_u _t";
4406
4388
  var bus = new EventTarget();
4407
4389
  function requestDiff(workspaceId, pr) {
4408
4390
  bus.dispatchEvent(new Event("intent"));
@@ -4442,19 +4424,7 @@ function coalesce(fn) {
4442
4424
  function isTouch() {
4443
4425
  return typeof window !== "undefined" && window.matchMedia("(pointer: coarse)").matches;
4444
4426
  }
4445
- var toast_module_default = {
4446
- toast: "_y",
4447
- toastFloat: "_z",
4448
- toastInline: "_A",
4449
- toastError: "_B",
4450
- toastTitle: "_C",
4451
- toastWarn: "_D",
4452
- toastInfo: "_E",
4453
- toastBody: "_F",
4454
- toastContent: "_G",
4455
- toastActions: "_H",
4456
- toastDismiss: "_I _ez"
4457
- };
4427
+ var toastDismiss = "_S _G";
4458
4428
  //#endregion
4459
4429
  //#region src/tags/toast.marko
4460
4430
  var toast_default = _template("w", (input) => {
@@ -4465,27 +4435,27 @@ var toast_default = _template("w", (input) => {
4465
4435
  const kind = inputKind || "error";
4466
4436
  const placement = inputPlacement || "float";
4467
4437
  const kindClass = {
4468
- error: toast_module_default.toastError,
4469
- warn: toast_module_default.toastWarn,
4470
- info: toast_module_default.toastInfo
4438
+ error: "_L",
4439
+ warn: "_N",
4440
+ info: "_O"
4471
4441
  }[kind];
4472
4442
  const placementClass = {
4473
- float: toast_module_default.toastFloat,
4474
- inline: toast_module_default.toastInline
4443
+ float: "_J",
4444
+ inline: "_K"
4475
4445
  }[placement];
4476
4446
  _html(`<div${_attr_class([
4477
- toast_module_default.toast,
4447
+ "_I",
4478
4448
  kindClass,
4479
4449
  placementClass,
4480
4450
  inputClass
4481
4451
  ])} role=${kind === "error" ? "alert" : "status"}${_attrs_partial(htmlInput, {
4482
4452
  class: 1,
4483
4453
  role: 1
4484
- }, "a", $scope0_id, "div")}><div${_attr_class(toast_module_default.toastBody)}>`);
4454
+ }, "a", $scope0_id, "div")}><div${_attr_class("_P")}>`);
4485
4455
  _if(() => {
4486
4456
  if (title) {
4487
4457
  const $scope1_id = _scope_id();
4488
- _html(`<strong${_attr_class(toast_module_default.toastTitle)}>${_escape(title)}${_el_resume($scope1_id, "b", $sg__input_title)}</strong>`);
4458
+ _html(`<strong${_attr_class("_M")}>${_escape(title)}${_el_resume($scope1_id, "b", $sg__input_title)}</strong>`);
4489
4459
  $si__input_title && writeScope($scope1_id, { _: _scope_with_id($scope0_id) });
4490
4460
  return 0;
4491
4461
  }
@@ -4493,7 +4463,7 @@ var toast_default = _template("w", (input) => {
4493
4463
  _if(() => {
4494
4464
  if (content) {
4495
4465
  const $scope2_id = _scope_id();
4496
- _html(`<div${_attr_class(toast_module_default.toastContent)}>`);
4466
+ _html(`<div${_attr_class("_Q")}>`);
4497
4467
  _dynamic_tag($scope2_id, "b", content, {}, 0, 0, $sg__input_content);
4498
4468
  _html("</div>");
4499
4469
  $si__input_content && writeScope($scope2_id, { _: _scope_with_id($scope0_id) });
@@ -4504,7 +4474,7 @@ var toast_default = _template("w", (input) => {
4504
4474
  _if(() => {
4505
4475
  if (action || onDismiss) {
4506
4476
  const $scope3_id = _scope_id();
4507
- _html(`<div${_attr_class(toast_module_default.toastActions)}>`);
4477
+ _html(`<div${_attr_class("_R")}>`);
4508
4478
  _if(() => {
4509
4479
  if (action) {
4510
4480
  const $scope4_id = _scope_id();
@@ -4516,7 +4486,7 @@ var toast_default = _template("w", (input) => {
4516
4486
  _if(() => {
4517
4487
  if (onDismiss) {
4518
4488
  const $scope5_id = _scope_id();
4519
- _html(`<button${_attr_class(toast_module_default.toastDismiss)} type=button title=Dismiss aria-label=Dismiss>×</button>${_el_resume($scope5_id, "a")}`);
4489
+ _html(`<button${_attr_class(toastDismiss)} type=button title=Dismiss aria-label=Dismiss>×</button>${_el_resume($scope5_id, "a")}`);
4520
4490
  _script($scope5_id, "w0");
4521
4491
  writeScope($scope5_id, { _: _scope_with_id($scope3_id) });
4522
4492
  return 0;
@@ -4596,36 +4566,13 @@ function phaseOf(status) {
4596
4566
  function sessionPhase(state) {
4597
4567
  return state?.phase === "working" ? "working" : state?.phase === "waiting" ? "waiting" : state?.alive ? "idle" : "off";
4598
4568
  }
4599
- var palette_module_default = {
4600
- paletteBackdrop: "_bh",
4601
- palette: "_bi",
4602
- inline: "_bj",
4603
- rows: "_bk",
4604
- rowWrap: "_bl",
4605
- row: "_bm",
4606
- rowMore: "_bn",
4607
- hi: "_bo",
4608
- archived: "_bp",
4609
- cmdRow: "_bq",
4610
- onboard: "_br",
4611
- rowName: "_bs",
4612
- rowNameText: "_bt",
4613
- rowStats: "_bu",
4614
- open: "_bv",
4615
- stat: "_bw",
4616
- rowRepos: "_bx",
4617
- paletteFoot: "_by",
4618
- hint: "_bz",
4619
- archivedLink: "_bA",
4620
- newSessionPop: "_bB"
4621
- };
4622
4569
  //#endregion
4623
4570
  //#region src/tags/icons/icon-base.marko
4624
4571
  var icon_base_default = _template("B", (input) => {
4625
4572
  const $scope0_reason = _scope_reason();
4626
4573
  const $scope0_id = _scope_id();
4627
4574
  const size = input.size ?? 15;
4628
- _html(`<svg${_attr_class([ui_module_default.icon, input.class])}${_attr("width", size)}${_attr("height", size)} viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path${_attr("d", input.d)}></path>${_el_resume($scope0_id, "b", _serialize_guard($scope0_reason, 2))}</svg>${_el_resume($scope0_id, "a", _serialize_guard($scope0_reason, 0))}`);
4575
+ _html(`<svg${_attr_class(["_c", input.class])}${_attr("width", size)}${_attr("height", size)} viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path${_attr("d", input.d)}></path>${_el_resume($scope0_id, "b", _serialize_guard($scope0_reason, 2))}</svg>${_el_resume($scope0_id, "a", _serialize_guard($scope0_reason, 0))}`);
4629
4576
  _serialize_if($scope0_reason, 1) && writeScope($scope0_id, {});
4630
4577
  });
4631
4578
  //#endregion
@@ -4696,7 +4643,7 @@ var icon_agent_default = _template("z", (input) => {
4696
4643
  _if(() => {
4697
4644
  if (d) {
4698
4645
  const $scope1_id = _scope_id();
4699
- _html(`<svg${_attr_class([ui_module_default.icon, input.class])}${_attr("width", size)}${_attr("height", size)} viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path${_attr("d", d)}></path>${_el_resume($scope1_id, "b", $sg__input_agent)}</svg>${_el_resume($scope1_id, "a", $sg__input_size__OR__input_class)}`);
4646
+ _html(`<svg${_attr_class(["_c", input.class])}${_attr("width", size)}${_attr("height", size)} viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path${_attr("d", d)}></path>${_el_resume($scope1_id, "b", $sg__input_agent)}</svg>${_el_resume($scope1_id, "a", $sg__input_size__OR__input_class)}`);
4700
4647
  $si__input_size__OR__input_agent__OR__input_class && writeScope($scope1_id, { _: _scope_with_id($scope0_id) });
4701
4648
  return 0;
4702
4649
  } else {
@@ -4760,7 +4707,7 @@ var palette_default = _template("o", (input) => {
4760
4707
  run: () => input.onNewSession(currentWs, settings?.preferredAgent || "claude")
4761
4708
  }
4762
4709
  ].filter((r) => r.kind === "cmd" && fuzzy(query || "", r.label));
4763
- const rows = [
4710
+ const rows$1 = [
4764
4711
  ...matches(active).map((ws) => ({
4765
4712
  kind: "ws",
4766
4713
  ws
@@ -4773,7 +4720,7 @@ var palette_default = _template("o", (input) => {
4773
4720
  ...commands,
4774
4721
  { kind: "new" }
4775
4722
  ];
4776
- const hi = Math.min(hiRaw, rows.length - 1);
4723
+ const hi = Math.min(hiRaw, rows$1.length - 1);
4777
4724
  const pick = _resume((row) => {
4778
4725
  if (!row) return;
4779
4726
  if (row.kind === "new") input.onNew();
@@ -4783,17 +4730,17 @@ var palette_default = _template("o", (input) => {
4783
4730
  _if(() => {
4784
4731
  if (!input.inline) {
4785
4732
  const $scope5_id = _scope_id();
4786
- _html(`<div${_attr_class(palette_module_default.paletteBackdrop)}></div>${_el_resume($scope5_id, "a")}`);
4733
+ _html(`<div${_attr_class("_bj")}></div>${_el_resume($scope5_id, "a")}`);
4787
4734
  _script($scope5_id, "o4");
4788
4735
  writeScope($scope5_id, {});
4789
4736
  return 0;
4790
4737
  }
4791
4738
  }, $scope0_id, "a", $sg__input_inline, $sg__input_inline, 1, 0, 1);
4792
- _html(`<div${_attr_class([palette_module_default.palette, { [palette_module_default.inline]: input.inline }])} data-palette${input.inline ? " data-inline" : ""} role=dialog aria-label=Workspaces>`);
4739
+ _html(`<div${_attr_class(["_bl", { ["_bk"]: input.inline }])} data-palette${input.inline ? " data-inline" : ""} role=dialog aria-label=Workspaces>`);
4793
4740
  _if(() => {
4794
4741
  if (input.inline && !input.workspaces.length) {
4795
4742
  const $scope8_id = _scope_id();
4796
- _html(`<div${_attr_class(palette_module_default.onboard)}><p>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`);
4743
+ _html(`<div${_attr_class("_bt")}><p>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`);
4797
4744
  _serialize_if($scope0_reason, 0) && writeScope($scope8_id, {});
4798
4745
  return 0;
4799
4746
  }
@@ -4801,50 +4748,50 @@ var palette_default = _template("o", (input) => {
4801
4748
  _html(`<input${_attr_input_value($scope0_id, "d", query || "", _resume(function(v) {
4802
4749
  query = v;
4803
4750
  hiRaw = 0;
4804
- }, "o0", $scope0_id))} autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces">${_el_resume($scope0_id, "d")}<ul${_attr_class(palette_module_default.rows)}>`);
4805
- _for_of(rows, (row, i) => {
4751
+ }, "o0", $scope0_id))} autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces">${_el_resume($scope0_id, "d")}<ul${_attr_class("_bm")}>`);
4752
+ _for_of(rows$1, (row$1, i) => {
4806
4753
  const $scope1_id = _scope_id();
4807
- _html(`<li><div${_attr_class(palette_module_default.rowWrap)}><button${_attr_class([palette_module_default.row, {
4808
- [palette_module_default.hi]: i === hi,
4809
- [palette_module_default.archived]: row.kind === "ws" && row.archived
4754
+ _html(`<li><div${_attr_class("_bn")}><button${_attr_class(["_bq", {
4755
+ ["_bp"]: i === hi,
4756
+ ["_bo"]: row$1.kind === "ws" && row$1.archived
4810
4757
  }])}>`);
4811
4758
  _if(() => {
4812
- if (row.kind === "new") {
4759
+ if (row$1.kind === "new") {
4813
4760
  const $scope10_id = _scope_id();
4814
- _html(`<span${_attr_class(palette_module_default.rowName)}>+ New workspace</span>`);
4761
+ _html(`<span${_attr_class("_bu")}>+ New workspace</span>`);
4815
4762
  writeScope($scope10_id, {});
4816
4763
  return 0;
4817
- } else if (row.kind === "cmd") {
4764
+ } else if (row$1.kind === "cmd") {
4818
4765
  const $scope9_id = _scope_id();
4819
- _html(`<span${_attr_class([palette_module_default.rowName, palette_module_default.cmdRow])}>▸ <!>${_escape(row.label)}${_el_resume($scope9_id, "b")}</span>`);
4766
+ _html(`<span${_attr_class(["_bu", "_bs"])}>▸ <!>${_escape(row$1.label)}${_el_resume($scope9_id, "b")}</span>`);
4820
4767
  writeScope($scope9_id, {});
4821
4768
  return 1;
4822
4769
  } else {
4823
4770
  const $scope2_id = _scope_id();
4824
- const st = input.status[row.ws.id];
4771
+ const st = input.status[row$1.ws.id];
4825
4772
  const rowPrs = (st?.repos || []).flatMap((r) => r.prs || []);
4826
- _html(`<span${_attr_class(palette_module_default.rowName)}><span${_attr_class([ui_module_default.dot, ui_module_default[phaseOf(st)]])}></span>${_el_resume($scope2_id, "b")}<span${_attr_class(palette_module_default.rowNameText)}>${_escape(row.ws.name)}${_el_resume($scope2_id, "d")}</span>`);
4773
+ _html(`<span${_attr_class("_bu")}><span${_attr_class(["_o", phase[phaseOf(st)]])}></span>${_el_resume($scope2_id, "b")}<span${_attr_class("_bv")}>${_escape(row$1.ws.name)}${_el_resume($scope2_id, "d")}</span>`);
4827
4774
  _if(() => {
4828
- if (row.ws.id === input.selectedId) {
4775
+ if (row$1.ws.id === input.selectedId) {
4829
4776
  const $scope14_id = _scope_id();
4830
- _html(`<span${_attr_class([ui_module_default.chip, palette_module_default.open])}>open</span>`);
4777
+ _html(`<span${_attr_class(["_h", "_bx"])}>open</span>`);
4831
4778
  writeScope($scope14_id, {});
4832
4779
  return 0;
4833
4780
  }
4834
4781
  }, $scope2_id, "e", 1, 1, 1, 0, 1);
4835
4782
  _if(() => {
4836
- if (row.archived) {
4783
+ if (row$1.archived) {
4837
4784
  const $scope15_id = _scope_id();
4838
- _html(`<span${_attr_class(ui_module_default.chip)}>archived</span>`);
4785
+ _html(`<span${_attr_class("_h")}>archived</span>`);
4839
4786
  writeScope($scope15_id, {});
4840
4787
  return 0;
4841
4788
  }
4842
4789
  }, $scope2_id, "f", 1, 1, 1, 0, 1);
4843
- _html(`<span${_attr_class(palette_module_default.rowStats)}>`);
4790
+ _html(`<span${_attr_class("_bw")}>`);
4844
4791
  _if(() => {
4845
4792
  if (st?.agents) {
4846
4793
  const $scope11_id = _scope_id();
4847
- _html(`<span${_attr_class([ui_module_default.chip, palette_module_default.stat])}${_attr("title", `${st.agents} running session${st.agents === 1 ? "" : "s"}${st.working ? ` — ${st.working} working` : ""}${st.waiting ? ` — ${st.waiting} waiting on you` : ""}`)}>${_escape(st.agents)}${_el_resume($scope11_id, "b")}</span>${_el_resume($scope11_id, "a")}`);
4794
+ _html(`<span${_attr_class(["_h", "_by"])}${_attr("title", `${st.agents} running session${st.agents === 1 ? "" : "s"}${st.working ? ` — ${st.working} working` : ""}${st.waiting ? ` — ${st.waiting} waiting on you` : ""}`)}>${_escape(st.agents)}${_el_resume($scope11_id, "b")}</span>${_el_resume($scope11_id, "a")}`);
4848
4795
  writeScope($scope11_id, {});
4849
4796
  return 0;
4850
4797
  }
@@ -4852,7 +4799,7 @@ var palette_default = _template("o", (input) => {
4852
4799
  _if(() => {
4853
4800
  if (rowPrs.length) {
4854
4801
  const $scope13_id = _scope_id();
4855
- _html(`<span${_attr_class([ui_module_default.chip, palette_module_default.stat])}${_attr("title", `${rowPrs.length} open PR${rowPrs.length === 1 ? "" : "s"}`)}>${_escape(rowPrs.length)}${_el_resume($scope13_id, "b")} PR<!>${rowPrs.length === 1 ? "" : "s"}${_el_resume($scope13_id, "c")}</span>${_el_resume($scope13_id, "a")}`);
4802
+ _html(`<span${_attr_class(["_h", "_by"])}${_attr("title", `${rowPrs.length} open PR${rowPrs.length === 1 ? "" : "s"}`)}>${_escape(rowPrs.length)}${_el_resume($scope13_id, "b")} PR<!>${rowPrs.length === 1 ? "" : "s"}${_el_resume($scope13_id, "c")}</span>${_el_resume($scope13_id, "a")}`);
4856
4803
  writeScope($scope13_id, {});
4857
4804
  return 0;
4858
4805
  }
@@ -4860,15 +4807,15 @@ var palette_default = _template("o", (input) => {
4860
4807
  _if(() => {
4861
4808
  if ((st?.ports || []).length) {
4862
4809
  const $scope12_id = _scope_id();
4863
- _html(`<span${_attr_class([ui_module_default.chip, palette_module_default.stat])}${_attr("title", st.ports.map((p) => `:${p.port} ${p.cmd}`).join("\n"))}>:<!>${_escape(st.ports.length)}${_el_resume($scope12_id, "b")}</span>${_el_resume($scope12_id, "a")}`);
4810
+ _html(`<span${_attr_class(["_h", "_by"])}${_attr("title", st.ports.map((p) => `:${p.port} ${p.cmd}`).join("\n"))}>:<!>${_escape(st.ports.length)}${_el_resume($scope12_id, "b")}</span>${_el_resume($scope12_id, "a")}`);
4864
4811
  writeScope($scope12_id, {});
4865
4812
  return 0;
4866
4813
  }
4867
4814
  }, $scope2_id, "j", 1, 1, 1, 0, 1);
4868
- _html(`</span></span><span${_attr_class(palette_module_default.rowRepos)}>`);
4869
- _for_of(st?.repos || row.ws.repos, (repo) => {
4815
+ _html(`</span></span><span${_attr_class("_bz")}>`);
4816
+ _for_of(st?.repos || row$1.ws.repos, (repo) => {
4870
4817
  const $scope16_id = _scope_id();
4871
- _html(`<span${_attr_class(ui_module_default.mono)}>${_escape(repo.worktree)}${_el_resume($scope16_id, "b")}</span>`);
4818
+ _html(`<span${_attr_class("_m")}>${_escape(repo.worktree)}${_el_resume($scope16_id, "b")}</span>`);
4872
4819
  writeScope($scope16_id, {});
4873
4820
  }, "full_name", $scope2_id, "k", 1, 1, 1, "</span>", 1);
4874
4821
  _subscribe($si__input_status && $input_status__closures, _subscribe($si__input_selectedId && $input_selectedId__closures, writeScope($scope2_id, {
@@ -4883,16 +4830,16 @@ var palette_default = _template("o", (input) => {
4883
4830
  }
4884
4831
  }, $scope1_id, "b", 1, 1, 1, "</button>");
4885
4832
  _if(() => {
4886
- if (row.kind === "ws") {
4833
+ if (row$1.kind === "ws") {
4887
4834
  const $scope3_id = _scope_id();
4888
- _html(`<button${_attr_class(palette_module_default.rowMore)} title="Review changes">`);
4835
+ _html(`<button${_attr_class("_br")} title="Review changes">`);
4889
4836
  icon_diff_default({ size: 13 });
4890
- _html(`</button>${_el_resume($scope3_id, "a")}<button${_attr_class(palette_module_default.rowMore)} title="Manage workspace">`);
4837
+ _html(`</button>${_el_resume($scope3_id, "a")}<button${_attr_class("_br")} title="Manage workspace">`);
4891
4838
  icon_manage_default({ size: 13 });
4892
4839
  const newPopId = _id();
4893
- _html(`</button>${_el_resume($scope3_id, "c")}<button${_attr_class(palette_module_default.rowMore)} title="New session"${_attr("popovertarget", newPopId)}>`);
4840
+ _html(`</button>${_el_resume($scope3_id, "c")}<button${_attr_class("_br")} title="New session"${_attr("popovertarget", newPopId)}>`);
4894
4841
  icon_plus_default({ size: 13 });
4895
- _html(`</button>${_el_resume($scope3_id, "e")}<div${_attr("id", newPopId)} popover=auto${_attr_class(palette_module_default.newSessionPop)}>`);
4842
+ _html(`</button>${_el_resume($scope3_id, "e")}<div${_attr("id", newPopId)} popover=auto${_attr_class("_bD")}>`);
4896
4843
  _for_of([...input.settings?.agents || [], "shell"], (agent) => {
4897
4844
  const $scope4_id = _scope_id();
4898
4845
  _html("<button>");
@@ -4921,31 +4868,31 @@ var palette_default = _template("o", (input) => {
4921
4868
  _html("</div></li>");
4922
4869
  _script($scope1_id, "o7");
4923
4870
  writeScope($scope1_id, {
4924
- e: row,
4925
- f: row?.kind,
4926
- g: row?.archived,
4927
- h: row?.label,
4928
- i: row?.ws,
4929
- j: row?.ws?.id,
4930
- k: row?.ws?.name,
4931
- l: row?.ws?.repos,
4871
+ e: row$1,
4872
+ f: row$1?.kind,
4873
+ g: row$1?.archived,
4874
+ h: row$1?.label,
4875
+ i: row$1?.ws,
4876
+ j: row$1?.ws?.id,
4877
+ k: row$1?.ws?.name,
4878
+ l: row$1?.ws?.repos,
4932
4879
  m: i
4933
4880
  });
4934
4881
  }, (r) => r.kind === "new" ? "new" : r.kind === "cmd" ? `cmd:${r.label}` : r.ws.id, $scope0_id, "e", 1, 1, 1, "</ul>", 1);
4935
4882
  _if(() => {
4936
4883
  if (archived.length && !query) {
4937
4884
  const $scope7_id = _scope_id();
4938
- _html(`<button${_attr_class(palette_module_default.archivedLink)}>${`archived (${_escape(`${archived.length}`)})`}${_el_resume($scope7_id, "b")}</button>${_el_resume($scope7_id, "a")}`);
4885
+ _html(`<button${_attr_class("_bC")}>${`archived (${_escape(`${archived.length}`)})`}${_el_resume($scope7_id, "b")}</button>${_el_resume($scope7_id, "a")}`);
4939
4886
  _script($scope7_id, "o8");
4940
4887
  writeScope($scope7_id, {});
4941
4888
  return 0;
4942
4889
  }
4943
4890
  }, $scope0_id, "f", 1, 1, 1, 0, 1);
4944
- _html(`<div${_attr_class(palette_module_default.paletteFoot)}><span></span><span${_attr_class(palette_module_default.hint)}>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span>`);
4891
+ _html(`<div${_attr_class("_bA")}><span></span><span${_attr_class("_bB")}>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span>`);
4945
4892
  _if(() => {
4946
4893
  if (settings) {
4947
4894
  const $scope6_id = _scope_id();
4948
- _html(`<label${_attr_class(ui_module_default.dim)}>`);
4895
+ _html(`<label${_attr_class("_l")}>`);
4949
4896
  _attr_select_value($scope6_id, "b", settings.preferredAgent, _resume(function(v) {
4950
4897
  settings = {
4951
4898
  ...settings,
@@ -5004,8 +4951,8 @@ var palette_default = _template("o", (input) => {
5004
4951
  ak: matches,
5005
4952
  al: currentWs,
5006
4953
  an: commands,
5007
- ap: rows,
5008
- aq: rows.length,
4954
+ ap: rows$1,
4955
+ aq: rows$1.length,
5009
4956
  as: hi,
5010
4957
  au: pick,
5011
4958
  a9: input.queryChange || void 0,
@@ -5016,45 +4963,11 @@ var palette_default = _template("o", (input) => {
5016
4963
  });
5017
4964
  _resume_branch($scope0_id);
5018
4965
  });
5019
- var new_workspace_module_default = {
5020
- content: "_R _bE",
5021
- actions: "_S",
5022
- barPrimary: "_T",
5023
- iconBtn: "_U _ez",
5024
- spinning: "_V _eA",
5025
- field: "_W",
5026
- section: "_X",
5027
- reposHead: "_Y",
5028
- curRepos: "_Z",
5029
- curRepo: "_0",
5030
- curFull: "_1",
5031
- curBase: "_2",
5032
- curRemove: "_3",
5033
- emptyNote: "_4",
5034
- steps: "_5",
5035
- active: "_6",
5036
- stepDone: "_7",
5037
- archived: "_8",
5038
- archivedCount: "_9",
5039
- archivedHint: "__",
5040
- archivedList: "_ba",
5041
- archivedCard: "_bb",
5042
- archivedMain: "_bc",
5043
- archivedName: "_bd",
5044
- archivedMeta: "_be",
5045
- restoreBtn: "_bf",
5046
- btn: "_bg"
5047
- };
5048
- var page_shell_module_default = {
5049
- page: "_bC",
5050
- body: "_bD",
5051
- content: "_bE",
5052
- contentWide: "_bF",
5053
- pageHead: "_bG",
5054
- pageHeadText: "_bH",
5055
- pageMeta: "_bI",
5056
- pageHeadAside: "_bJ"
5057
- };
4966
+ //#endregion
4967
+ //#region src/tags/new-workspace.css.ts
4968
+ var content$2 = "_T _A";
4969
+ var iconBtn$5 = "_W _G";
4970
+ var spinning$3 = "_X _H";
5058
4971
  //#endregion
5059
4972
  //#region src/tags/icons/icon-refresh.marko
5060
4973
  var icon_refresh_default = _template("O", (input) => {
@@ -5072,20 +4985,6 @@ var icon_refresh_default = _template("O", (input) => {
5072
4985
  });
5073
4986
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
5074
4987
  });
5075
- var repo_picker_module_default = {
5076
- addRepo: "_b_",
5077
- repoResults: "_ca",
5078
- resultWrap: "_cb",
5079
- hi: "_cc",
5080
- resultRow: "_cd",
5081
- resultBranch: "_ce",
5082
- on: "_cf",
5083
- branchPick: "_cg",
5084
- branchList: "_ch",
5085
- resultPlus: "_ci",
5086
- repoName: "_cj",
5087
- emptyNote: "_ck"
5088
- };
5089
4988
  //#endregion
5090
4989
  //#region src/tags/repo-picker.marko
5091
4990
  var api$7;
@@ -5135,14 +5034,14 @@ var repo_picker_default = _template("q", (input) => {
5135
5034
  input.onError?.(String(err.message || err));
5136
5035
  }
5137
5036
  }, "q5", $scope0_id);
5138
- _html(`<div${_attr_class(repo_picker_module_default.addRepo)}><input${_attr_input_value($scope0_id, "b", filter, _resume(function(v) {
5037
+ _html(`<div${_attr_class("_bM")}><input${_attr_input_value($scope0_id, "b", filter, _resume(function(v) {
5139
5038
  filter = v;
5140
5039
  highlight = 0;
5141
5040
  }, "q0", $scope0_id))} placeholder="Add a repo…" aria-label="Add a repo"${_attr("disabled", input.disabled)}>${_el_resume($scope0_id, "b")}`);
5142
5041
  _if(() => {
5143
5042
  if (filter && !catalog) {
5144
5043
  const $scope8_id = _scope_id();
5145
- _html(`<p${_attr_class(repo_picker_module_default.emptyNote)}>Loading repos…</p>`);
5044
+ _html(`<p${_attr_class("_bX")}>Loading repos…</p>`);
5146
5045
  writeScope($scope8_id, {});
5147
5046
  return 0;
5148
5047
  }
@@ -5150,23 +5049,23 @@ var repo_picker_default = _template("q", (input) => {
5150
5049
  _if(() => {
5151
5050
  if (results.length) {
5152
5051
  const $scope2_id = _scope_id();
5153
- _html(`<ul${_attr_class(repo_picker_module_default.repoResults)}>`);
5052
+ _html(`<ul${_attr_class("_bN")}>`);
5154
5053
  _for_of(results, (repo, i) => {
5155
5054
  const $scope3_id = _scope_id();
5156
- _html(`<li><div${_attr_class([repo_picker_module_default.resultWrap, { [repo_picker_module_default.hi]: i === highlight }])}><button${_attr_class(repo_picker_module_default.resultRow)}>`);
5055
+ _html(`<li><div${_attr_class(["_bP", { ["_bO"]: i === highlight }])}><button${_attr_class("_bQ")}>`);
5157
5056
  icon_plus_default({
5158
5057
  size: 12,
5159
- class: repo_picker_module_default.resultPlus
5058
+ class: "_bV"
5160
5059
  });
5161
- _html(`<span${_attr_class(repo_picker_module_default.repoName)}>${_escape(repo.nameWithOwner)}${_el_resume($scope3_id, "e")}</span></button>${_el_resume($scope3_id, "b")}<button${_attr_class([repo_picker_module_default.resultBranch, { [repo_picker_module_default.on]: branchesFor === repo.nameWithOwner }])}${_attr("title", `Pick a base branch for ${repo.nameWithOwner}`)}${_attr("aria-label", `Pick a base branch for ${repo.nameWithOwner}`)}>⎇</button>${_el_resume($scope3_id, "f")}</div>${_el_resume($scope3_id, "a")}`);
5060
+ _html(`<span${_attr_class("_bW")}>${_escape(repo.nameWithOwner)}${_el_resume($scope3_id, "e")}</span></button>${_el_resume($scope3_id, "b")}<button${_attr_class(["_bS", { ["_bR"]: branchesFor === repo.nameWithOwner }])}${_attr("title", `Pick a base branch for ${repo.nameWithOwner}`)}${_attr("aria-label", `Pick a base branch for ${repo.nameWithOwner}`)}>⎇</button>${_el_resume($scope3_id, "f")}</div>${_el_resume($scope3_id, "a")}`);
5162
5061
  _if(() => {
5163
5062
  if (branchesFor === repo.nameWithOwner) {
5164
5063
  const $scope4_id = _scope_id();
5165
- _html(`<div${_attr_class(repo_picker_module_default.branchPick)}>`);
5064
+ _html(`<div${_attr_class("_bT")}>`);
5166
5065
  _if(() => {
5167
5066
  if (!branches) {
5168
5067
  const $scope9_id = _scope_id();
5169
- _html(`<p${_attr_class(repo_picker_module_default.emptyNote)}><span${_attr_class(ui_module_default.spin)}></span> Loading branches…</p>`);
5068
+ _html(`<p${_attr_class("_bX")}><span${_attr_class("_w")}></span> Loading branches…</p>`);
5170
5069
  writeScope($scope9_id, {});
5171
5070
  return 0;
5172
5071
  } else {
@@ -5183,17 +5082,17 @@ var repo_picker_default = _template("q", (input) => {
5183
5082
  }
5184
5083
  }, $scope5_id, "a", 1, 1, 1, 0, 1);
5185
5084
  const shown = (branchFilter ? branches.filter((b) => b.toLowerCase().includes(branchFilter.toLowerCase())) : branches).slice(0, 12);
5186
- _html(`<ul${_attr_class(repo_picker_module_default.branchList)}>`);
5085
+ _html(`<ul${_attr_class("_bU")}>`);
5187
5086
  _for_of(shown, (branch) => {
5188
5087
  const $scope7_id = _scope_id();
5189
- _html(`<li><button${_attr_class(repo_picker_module_default.resultRow)}><span${_attr_class([repo_picker_module_default.repoName, ui_module_default.mono])}>${_escape(branch)}${_el_resume($scope7_id, "c")}</span></button>${_el_resume($scope7_id, "a")}</li>`);
5088
+ _html(`<li><button${_attr_class("_bQ")}><span${_attr_class(["_bW", "_m"])}>${_escape(branch)}${_el_resume($scope7_id, "c")}</span></button>${_el_resume($scope7_id, "a")}</li>`);
5190
5089
  _script($scope7_id, "q7");
5191
5090
  writeScope($scope7_id, { e: branch });
5192
5091
  }, (b) => b, $scope5_id, "c", 1, 1, 1, 0, 1);
5193
5092
  _if(() => {
5194
5093
  if (!shown.length) {
5195
5094
  const $scope10_id = _scope_id();
5196
- _html(`<li><p${_attr_class(repo_picker_module_default.emptyNote)}>No branches match.</p></li>`);
5095
+ _html(`<li><p${_attr_class("_bX")}>No branches match.</p></li>`);
5197
5096
  writeScope($scope10_id, {});
5198
5097
  return 0;
5199
5098
  }
@@ -5218,7 +5117,7 @@ var repo_picker_default = _template("q", (input) => {
5218
5117
  return 0;
5219
5118
  } else if (filter && catalog) {
5220
5119
  const $scope1_id = _scope_id();
5221
- _html(`<p${_attr_class(repo_picker_module_default.emptyNote)}>No repos match "<!>${_escape(filter)}${_el_resume($scope1_id, "b")}".</p>`);
5120
+ _html(`<p${_attr_class("_bX")}>No repos match "<!>${_escape(filter)}${_el_resume($scope1_id, "b")}".</p>`);
5222
5121
  writeScope($scope1_id, {});
5223
5122
  return 1;
5224
5123
  }
@@ -5269,8 +5168,8 @@ var new_workspace_default = _template("m", (input) => {
5269
5168
  let busy = false;
5270
5169
  let restoring = null;
5271
5170
  let error = null;
5272
- let steps = [];
5273
- const archived = (input.workspaces || []).filter((ws) => ws.status === "archived").slice().sort((a, b) => b.created_at.localeCompare(a.created_at));
5171
+ let steps$1 = [];
5172
+ const archived$2 = (input.workspaces || []).filter((ws) => ws.status === "archived").slice().sort((a, b) => b.created_at.localeCompare(a.created_at));
5274
5173
  const prog = {
5275
5174
  last: 0,
5276
5175
  op: ""
@@ -5280,7 +5179,7 @@ var new_workspace_default = _template("m", (input) => {
5280
5179
  if (e.op !== prog.op) continue;
5281
5180
  if (e.seq && e.seq <= prog.last) continue;
5282
5181
  if (e.seq) prog.last = e.seq;
5283
- steps = steps.concat(e.message);
5182
+ steps$1 = steps$1.concat(e.message);
5284
5183
  }
5285
5184
  }, "m1", $scope0_id);
5286
5185
  const addRepo = _resume((fullName, baseBranch) => {
@@ -5317,7 +5216,7 @@ var new_workspace_default = _template("m", (input) => {
5317
5216
  if (restoring) return;
5318
5217
  busy = true;
5319
5218
  error = null;
5320
- steps = [];
5219
+ steps$1 = [];
5321
5220
  prog.op = Math.random().toString(36).slice(2, 10);
5322
5221
  try {
5323
5222
  prog.last = (await api$6("/api/progress")).seq;
@@ -5348,7 +5247,7 @@ var new_workspace_default = _template("m", (input) => {
5348
5247
  }
5349
5248
  }, "m5", $scope0_id);
5350
5249
  const titleId = _id();
5351
- _html(`<div${_attr_class(page_shell_module_default.page)} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class(page_shell_module_default.body)}><div${_attr_class(new_workspace_module_default.content)}><header${_attr_class(page_shell_module_default.pageHead)}><div${_attr_class(page_shell_module_default.pageHeadText)}><h1${_attr("id", titleId)}>New workspace</h1><p${_attr_class(page_shell_module_default.pageMeta)}>Name the space and pick repos — or restore an archived one below.</p></div></header>`);
5250
+ _html(`<div${_attr_class("_y")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_z")}><div${_attr_class(content$2)}><header${_attr_class("_C")}><div${_attr_class("_D")}><h1${_attr("id", titleId)}>New workspace</h1><p${_attr_class("_E")}>Name the space and pick repos — or restore an archived one below.</p></div></header>`);
5352
5251
  _if(() => {
5353
5252
  if (error) {
5354
5253
  const $scope4_id = _scope_id();
@@ -5369,23 +5268,23 @@ var new_workspace_default = _template("m", (input) => {
5369
5268
  return 0;
5370
5269
  }
5371
5270
  }, $scope0_id, "h", 1, 1, 1, 0, 1);
5372
- _html(`<label${_attr_class(new_workspace_module_default.field)}><span>Name</span><input${_attr_input_value($scope0_id, "j", name, _resume((_new_name) => {
5271
+ _html(`<label${_attr_class("_Y")}><span>Name</span><input${_attr_input_value($scope0_id, "j", name, _resume((_new_name) => {
5373
5272
  name = _new_name;
5374
- }, "m0", $scope0_id))} placeholder=my-feature${_attr("disabled", busy)} autofocus>${_el_resume($scope0_id, "j")}</label><section${_attr_class(new_workspace_module_default.section)}><div${_attr_class(new_workspace_module_default.reposHead)}><h2>Repos</h2><button${_attr_class([new_workspace_module_default.iconBtn, { [new_workspace_module_default.spinning]: catalogRefreshing }])} title="Refresh repo list" aria-label="Refresh repo list"${_attr("disabled", catalogRefreshing)}>`);
5273
+ }, "m0", $scope0_id))} placeholder=my-feature${_attr("disabled", busy)} autofocus>${_el_resume($scope0_id, "j")}</label><section${_attr_class("_Z")}><div${_attr_class("_0")}><h2>Repos</h2><button${_attr_class([iconBtn$5, { [spinning$3]: catalogRefreshing }])} title="Refresh repo list" aria-label="Refresh repo list"${_attr("disabled", catalogRefreshing)}>`);
5375
5274
  icon_refresh_default({ size: 14 });
5376
- _html(`</button>${_el_resume($scope0_id, "m")}</div><ul${_attr_class(new_workspace_module_default.curRepos)}>`);
5275
+ _html(`</button>${_el_resume($scope0_id, "m")}</div><ul${_attr_class("_1")}>`);
5377
5276
  _for_of(selected, (repo) => {
5378
5277
  const $scope1_id = _scope_id();
5379
- _html(`<li${_attr_class(new_workspace_module_default.curRepo)}><span${_attr_class(new_workspace_module_default.curFull)}>${_escape(repo.fullName)}${_el_resume($scope1_id, "c")}</span>`);
5278
+ _html(`<li${_attr_class("_2")}><span${_attr_class("_3")}>${_escape(repo.fullName)}${_el_resume($scope1_id, "c")}</span>`);
5380
5279
  _if(() => {
5381
5280
  if (repo.baseBranch) {
5382
5281
  const $scope8_id = _scope_id();
5383
- _html(`<span${_attr_class([new_workspace_module_default.curBase, ui_module_default.mono])} title="Base branch">⎇ <!>${_escape(repo.baseBranch)}${_el_resume($scope8_id, "b")}</span>`);
5282
+ _html(`<span${_attr_class(["_4", "_m"])} title="Base branch">⎇ <!>${_escape(repo.baseBranch)}${_el_resume($scope8_id, "b")}</span>`);
5384
5283
  writeScope($scope8_id, {});
5385
5284
  return 0;
5386
5285
  }
5387
5286
  }, $scope1_id, "d", 1, 1, 1, 0, 1);
5388
- _html(`<button${_attr_class(new_workspace_module_default.curRemove)}${_attr("title", `Remove ${repo.fullName}`)}${_attr("disabled", busy)}>×</button>${_el_resume($scope1_id, "e")}</li>`);
5287
+ _html(`<button${_attr_class("_5")}${_attr("title", `Remove ${repo.fullName}`)}${_attr("disabled", busy)}>×</button>${_el_resume($scope1_id, "e")}</li>`);
5389
5288
  _script($scope1_id, "m11");
5390
5289
  writeScope($scope1_id, {
5391
5290
  h: repo?.fullName,
@@ -5395,7 +5294,7 @@ var new_workspace_default = _template("m", (input) => {
5395
5294
  _if(() => {
5396
5295
  if (!selected.length) {
5397
5296
  const $scope9_id = _scope_id();
5398
- _html(`<li${_attr_class(new_workspace_module_default.emptyNote)}>No repos yet — search below to add one (or create empty).</li>`);
5297
+ _html(`<li${_attr_class("_6")}>No repos yet — search below to add one (or create empty).</li>`);
5399
5298
  writeScope($scope9_id, {});
5400
5299
  return 0;
5401
5300
  }
@@ -5418,21 +5317,21 @@ var new_workspace_default = _template("m", (input) => {
5418
5317
  _var($scope0_id, "s", $childScope, "m12");
5419
5318
  _html("</section>");
5420
5319
  _if(() => {
5421
- if (busy && steps.length) {
5320
+ if (busy && steps$1.length) {
5422
5321
  const $scope6_id = _scope_id();
5423
- _html(`<ul${_attr_class(new_workspace_module_default.steps)}>`);
5424
- _for_of(steps, (step, i) => {
5322
+ _html(`<ul${_attr_class("_7")}>`);
5323
+ _for_of(steps$1, (step, i) => {
5425
5324
  const $scope7_id = _scope_id();
5426
- _html(`<li${_attr_class({ [new_workspace_module_default.active]: i === steps.length - 1 })}>`);
5325
+ _html(`<li${_attr_class({ ["_8"]: i === steps$1.length - 1 })}>`);
5427
5326
  _if(() => {
5428
- if (i === steps.length - 1) {
5327
+ if (i === steps$1.length - 1) {
5429
5328
  const $scope10_id = _scope_id();
5430
- _html(`<span${_attr_class(ui_module_default.spin)}></span>`);
5329
+ _html(`<span${_attr_class("_w")}></span>`);
5431
5330
  writeScope($scope10_id, {});
5432
5331
  return 0;
5433
5332
  } else {
5434
5333
  const $scope11_id = _scope_id();
5435
- _html(`<span${_attr_class(new_workspace_module_default.stepDone)}>✓</span>`);
5334
+ _html(`<span${_attr_class("_9")}>✓</span>`);
5436
5335
  writeScope($scope11_id, {});
5437
5336
  return 1;
5438
5337
  }
@@ -5444,22 +5343,22 @@ var new_workspace_default = _template("m", (input) => {
5444
5343
  return 0;
5445
5344
  }
5446
5345
  }, $scope0_id, "t", 1, 1, 1, 0, 1);
5447
- _html(`<div${_attr_class(new_workspace_module_default.actions)}><button type=button${_attr_class(ui_module_default.btn)}${_attr("disabled", busy || !!restoring)}>Cancel</button>${_el_resume($scope0_id, "v")}<button type=button${_attr_class([
5448
- ui_module_default.btn,
5449
- ui_module_default.primary,
5450
- new_workspace_module_default.barPrimary
5346
+ _html(`<div${_attr_class("_U")}><button type=button${_attr_class("_d")}${_attr("disabled", busy || !!restoring)}>Cancel</button>${_el_resume($scope0_id, "v")}<button type=button${_attr_class([
5347
+ "_d",
5348
+ "_e",
5349
+ "_V"
5451
5350
  ])}${_attr("disabled", busy || !!restoring || !name.trim())}>${busy ? "Creating…" : "Create workspace"}${_el_resume($scope0_id, "x")}</button>${_el_resume($scope0_id, "w")}</div>`);
5452
5351
  _if(() => {
5453
- if (archived.length) {
5352
+ if (archived$2.length) {
5454
5353
  const $scope2_id = _scope_id();
5455
- _html(`<section${_attr_class(new_workspace_module_default.archived)}><div${_attr_class(new_workspace_module_default.reposHead)}><h2>Archived</h2><span${_attr_class(new_workspace_module_default.archivedCount)}>${_escape(archived.length)}${_el_resume($scope2_id, "d", $sg__input_workspaces)}</span></div><p${_attr_class(new_workspace_module_default.archivedHint)}>Restore a parked space instead of creating a new one.</p><ul${_attr_class(new_workspace_module_default.archivedList)}>`);
5456
- _for_of(archived, (ws) => {
5354
+ _html(`<section${_attr_class("__")}><div${_attr_class("_0")}><h2>Archived</h2><span${_attr_class("_ba")}>${_escape(archived$2.length)}${_el_resume($scope2_id, "d", $sg__input_workspaces)}</span></div><p${_attr_class("_bb")}>Restore a parked space instead of creating a new one.</p><ul${_attr_class("_bc")}>`);
5355
+ _for_of(archived$2, (ws) => {
5457
5356
  const $scope3_id = _scope_id();
5458
- _html(`<li${_attr_class(new_workspace_module_default.archivedCard)}><div${_attr_class(new_workspace_module_default.archivedMain)}><span${_attr_class(new_workspace_module_default.archivedName)}>${_escape(ws.name)}${_el_resume($scope3_id, "d", $sg__input_workspaces)}</span><span${_attr_class([new_workspace_module_default.archivedMeta, ui_module_default.mono])}${_attr("title", ws.display_path || ws.path)}>${_escape(ws.display_path || ws.path)}${_el_resume($scope3_id, "f", $sg__input_workspaces)}</span>${_el_resume($scope3_id, "e", $sg__input_workspaces)}</div><button type=button${_attr_class([ui_module_default.btn, new_workspace_module_default.restoreBtn])}${_attr("disabled", busy || !!restoring)}>`);
5357
+ _html(`<li${_attr_class("_bd")}><div${_attr_class("_be")}><span${_attr_class("_bf")}>${_escape(ws.name)}${_el_resume($scope3_id, "d", $sg__input_workspaces)}</span><span${_attr_class(["_bg", "_m"])}${_attr("title", ws.display_path || ws.path)}>${_escape(ws.display_path || ws.path)}${_el_resume($scope3_id, "f", $sg__input_workspaces)}</span>${_el_resume($scope3_id, "e", $sg__input_workspaces)}</div><button type=button${_attr_class(["_d", "_bh"])}${_attr("disabled", busy || !!restoring)}>`);
5459
5358
  _if(() => {
5460
5359
  if (restoring === ws.id) {
5461
5360
  const $scope12_id = _scope_id();
5462
- _html(`<span${_attr_class(ui_module_default.spin)}></span> Restoring…`);
5361
+ _html(`<span${_attr_class("_w")}></span> Restoring…`);
5463
5362
  writeScope($scope12_id, {});
5464
5363
  return 0;
5465
5364
  } else {
@@ -5494,10 +5393,10 @@ var new_workspace_default = _template("m", (input) => {
5494
5393
  a9: busy,
5495
5394
  aa: restoring,
5496
5395
  ae: error,
5497
- af: steps,
5498
- ag: steps?.length,
5499
- ai: $si__input_workspaces && archived,
5500
- aj: $si__input_workspaces && archived?.length,
5396
+ af: steps$1,
5397
+ ag: steps$1?.length,
5398
+ ai: $si__input_workspaces && archived$2,
5399
+ aj: $si__input_workspaces && archived$2?.length,
5501
5400
  al: prog.op,
5502
5401
  am: prog.last,
5503
5402
  ao: takeProgress,
@@ -5557,16 +5456,6 @@ function diffTreeOpen() {
5557
5456
  function diffUncommitted() {
5558
5457
  return get("diff-uncommitted") === "1";
5559
5458
  }
5560
- var work_view_module_default = {
5561
- workView: "_J",
5562
- sideWrap: "_K",
5563
- navPage: "_L",
5564
- mainCol: "_M",
5565
- termArea: "_N",
5566
- asBar: "_O",
5567
- padInline: "_P",
5568
- emptySess: "_Q"
5569
- };
5570
5459
  //#endregion
5571
5460
  //#region src/client/api.ts
5572
5461
  /** Fetch JSON from an API route. Error bodies are always `{ error: string }`;
@@ -5629,25 +5518,8 @@ function vapidKey(base64) {
5629
5518
  const raw = atob(padded.replace(/-/g, "+").replace(/_/g, "/"));
5630
5519
  return Uint8Array.from(raw, (c) => c.charCodeAt(0));
5631
5520
  }
5632
- var side_nav_module_default = {
5633
- iconBtn: "_cQ _ez",
5634
- spinning: "_cR _eA",
5635
- navToggle: "_cS _ez",
5636
- notifyBtn: "_cT _ez",
5637
- sideNav: "_cU",
5638
- pageHead: "_cV",
5639
- pageHeadActions: "_cW",
5640
- sectionLabel: "_cX",
5641
- newSpaceBtn: "_cY",
5642
- page: "_cZ",
5643
- sideList: "_c0",
5644
- sideRail: "_c1",
5645
- sideFoot: "_c2",
5646
- footSpacer: "_c3",
5647
- on: "_c4",
5648
- closed: "_c5",
5649
- railPop: "_c6"
5650
- };
5521
+ var iconBtn$4 = "_cp _G";
5522
+ var navToggle = "_cr _G";
5651
5523
  _template("C", (input) => {
5652
5524
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
5653
5525
  const $scope0_id = _scope_id();
@@ -5680,35 +5552,7 @@ var icon_gauge_default = _template("J", (input) => {
5680
5552
  });
5681
5553
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
5682
5554
  });
5683
- var side_nav_item_module_default = {
5684
- railBtn: "_e1 _ez",
5685
- current: "_e2",
5686
- railDot: "_e3",
5687
- ws: "_e4",
5688
- railPopWs: "_e5",
5689
- wsRow: "_e6",
5690
- wsBtn: "_e7",
5691
- wsActions: "_e8",
5692
- rowIcon: "_e9",
5693
- on: "_e_",
5694
- newSessionPop: "_fa",
5695
- wsText: "_fb",
5696
- wsName: "_fc",
5697
- wsMeta: "_fd",
5698
- wsOpenHint: "_fe",
5699
- statusDot: "_ff",
5700
- pageCard: "_fg",
5701
- sessTitle: "_fh",
5702
- sessActions: "_fi",
5703
- sessRenameDot: "_fj",
5704
- sessRename: "_fk",
5705
- close: "_fl",
5706
- sess: "_fm",
5707
- armed: "_fn",
5708
- sessions: "_fo",
5709
- sessBtn: "_fp",
5710
- sessIcon: "_fq"
5711
- };
5555
+ var railBtn = "_eR _G";
5712
5556
  //#endregion
5713
5557
  //#region src/tags/icons/icon-edit.marko
5714
5558
  var icon_edit_default = _template("H", (input) => {
@@ -5726,17 +5570,12 @@ var icon_edit_default = _template("H", (input) => {
5726
5570
  });
5727
5571
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
5728
5572
  });
5729
- var side_nav_chips_module_default = {
5730
- sideChips: "_fB",
5731
- prChip: "_fC",
5732
- portChip: "_fD",
5733
- seg: "_fE",
5734
- portOpen: "_fF",
5735
- action: "_fG",
5736
- dismiss: "_fH",
5737
- armed: "_fI",
5738
- merged: "_fJ",
5739
- closed: "_fK"
5573
+ var prChip = "_fG _h _fF";
5574
+ var portChip = "_fH _h _fF";
5575
+ var prState = {
5576
+ open: "_fM",
5577
+ merged: "_fN",
5578
+ closed: "_fO"
5740
5579
  };
5741
5580
  //#endregion
5742
5581
  //#region src/tags/icons/icon-xmark.marko
@@ -5800,26 +5639,26 @@ var side_nav_chips_default = _template("r", (input) => {
5800
5639
  const name = repo.full_name.split("/")[1];
5801
5640
  return repos.some((r) => r.full_name !== repo.full_name && r.full_name.split("/")[1] === name) ? repo.full_name : name;
5802
5641
  }, "r2", $scope1_id);
5803
- _html(`<div${_attr_class(side_nav_chips_module_default.sideChips)}>`);
5642
+ _html(`<div${_attr_class("_fE")}>`);
5804
5643
  _for_of(repos, (repo) => {
5805
5644
  const $scope2_id = _scope_id();
5806
- _for_of(repo.prs || [], (pr) => {
5645
+ _for_of(repo.prs || [], (pr$1) => {
5807
5646
  const $scope3_id = _scope_id();
5808
- const open = isOpen(pr);
5647
+ const open = isOpen(pr$1);
5809
5648
  _html(`<span${_attr_class([
5810
- ui_module_default.chip,
5811
- side_nav_chips_module_default.prChip,
5649
+ "_h",
5650
+ prChip,
5812
5651
  {
5813
- [ui_module_default.pr]: open && !pr.isDraft,
5814
- [ui_module_default.draft]: open && pr.isDraft,
5815
- [side_nav_chips_module_default.merged]: pr.state === "MERGED",
5816
- [side_nav_chips_module_default.closed]: pr.state === "CLOSED"
5652
+ ["_j"]: open && !pr$1.isDraft,
5653
+ ["_k"]: open && pr$1.isDraft,
5654
+ [prState.merged]: pr$1.state === "MERGED",
5655
+ [prState.closed]: pr$1.state === "CLOSED"
5817
5656
  }
5818
- ])}${_attr("title", prTitle(repo, pr))}><a${_attr_class(side_nav_chips_module_default.seg)}${_attr("href", pr.url)} target=_blank rel=noopener>${_escape(repoLabel(repo))}${_el_resume($scope3_id, "c", $sg__input_status_repos)}#${_sep($sg__input_status_repos)}${_escape(pr.number)}${_el_resume($scope3_id, "d", $sg__input_status_repos)}</a>${_el_resume($scope3_id, "b", $sg__input_status_repos)}`);
5657
+ ])}${_attr("title", prTitle(repo, pr$1))}><a${_attr_class("_fI")}${_attr("href", pr$1.url)} target=_blank rel=noopener>${_escape(repoLabel(repo))}${_el_resume($scope3_id, "c", $sg__input_status_repos)}#${_sep($sg__input_status_repos)}${_escape(pr$1.number)}${_el_resume($scope3_id, "d", $sg__input_status_repos)}</a>${_el_resume($scope3_id, "b", $sg__input_status_repos)}`);
5819
5658
  _if(() => {
5820
5659
  if (open) {
5821
5660
  const $scope4_id = _scope_id();
5822
- _html(`<button type=button${_attr_class([side_nav_chips_module_default.seg, side_nav_chips_module_default.action])}${_attr("title", `Review #${pr.number} diff`)}>`);
5661
+ _html(`<button type=button${_attr_class(["_fI", "_fJ"])}${_attr("title", `Review #${pr$1.number} diff`)}>`);
5823
5662
  icon_diff_default({ size: 12 });
5824
5663
  _html(`</button>${_el_resume($scope4_id, "a")}`);
5825
5664
  _script($scope4_id, "r3");
@@ -5828,10 +5667,10 @@ var side_nav_chips_default = _template("r", (input) => {
5828
5667
  } else {
5829
5668
  const $scope6_id = _scope_id();
5830
5669
  _html(`<button type=button${_attr_class([
5831
- side_nav_chips_module_default.seg,
5832
- side_nav_chips_module_default.action,
5833
- side_nav_chips_module_default.dismiss
5834
- ])}${_attr("title", `Clear #${pr.number} from this list`)}>`);
5670
+ "_fI",
5671
+ "_fJ",
5672
+ "_fK"
5673
+ ])}${_attr("title", `Clear #${pr$1.number} from this list`)}>`);
5835
5674
  icon_xmark_default({ size: 12 });
5836
5675
  _html(`</button>${_el_resume($scope6_id, "a")}`);
5837
5676
  _script($scope6_id, "r4");
@@ -5841,7 +5680,7 @@ var side_nav_chips_default = _template("r", (input) => {
5841
5680
  }, $scope3_id, "e", $sg__input_status_repos, $sg__input_status_repos, $sg__input_status_repos, 0, 1);
5842
5681
  _html(`</span>${_el_resume($scope3_id, "a", $sg__input_status_repos)}`);
5843
5682
  _subscribe($si__input_status_repos && $if_content__repoLabel__closures, writeScope($scope3_id, {
5844
- l: pr?.number,
5683
+ l: pr$1?.number,
5845
5684
  _: _scope_with_id($scope2_id)
5846
5685
  }));
5847
5686
  }, "number", $scope2_id, "a", $sg__input_status_repos, $sg__input_status_repos, $sg__input_status_repos, 0, 1);
@@ -5854,11 +5693,11 @@ var side_nav_chips_default = _template("r", (input) => {
5854
5693
  }, "full_name", $scope1_id, "b", $sg__input_status_repos, $sg__input_status_repos, $sg__input_status_repos__OR__input_status_ports);
5855
5694
  _for_of(ports, (p) => {
5856
5695
  const $scope5_id = _scope_id();
5857
- _html(`<span${_attr_class([ui_module_default.chip, side_nav_chips_module_default.portChip])}${_attr("title", p.cmd)}><button type=button${_attr_class([side_nav_chips_module_default.seg, side_nav_chips_module_default.portOpen])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${p.port}`)}>:${_sep($sg__input_status_ports)}${_escape(p.port)}${_el_resume($scope5_id, "c", $sg__input_status_ports)}</button>${_el_resume($scope5_id, "b")}<button type=button${_attr_class([
5858
- side_nav_chips_module_default.seg,
5859
- side_nav_chips_module_default.action,
5860
- side_nav_chips_module_default.dismiss,
5861
- { [side_nav_chips_module_default.armed]: armedPid === p.pid }
5696
+ _html(`<span${_attr_class(["_h", portChip])}${_attr("title", p.cmd)}><button type=button${_attr_class(["_fI", "_fP"])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${p.port}`)}>:${_sep($sg__input_status_ports)}${_escape(p.port)}${_el_resume($scope5_id, "c", $sg__input_status_ports)}</button>${_el_resume($scope5_id, "b")}<button type=button${_attr_class([
5697
+ "_fI",
5698
+ "_fJ",
5699
+ "_fK",
5700
+ { ["_fL"]: armedPid === p.pid }
5862
5701
  ])}${armedPid === p.pid ? _attr("title", `Really kill ${p.cmd}?`) : _attr("title", `Kill ${p.cmd} (pid ${p.pid})`)}>`);
5863
5702
  icon_xmark_default({ size: 12 });
5864
5703
  _html(`</button>${_el_resume($scope5_id, "d")}</span>${_el_resume($scope5_id, "a", $sg__input_status_ports)}`);
@@ -5931,41 +5770,41 @@ var side_nav_item_default = _template("s", (input) => {
5931
5770
  renamingId = null;
5932
5771
  if (title) input.onRenameSession?.(s, title);
5933
5772
  }, "s2", $scope0_id);
5934
- const ws = input.workspaces.find((w) => w.id === input.workspaceId);
5773
+ const ws$1 = input.workspaces.find((w) => w.id === input.workspaceId);
5935
5774
  _if(() => {
5936
- if (ws) {
5775
+ if (ws$1) {
5937
5776
  const $scope1_id = _scope_id();
5938
5777
  const st = input.status[input.workspaceId];
5939
- const dot = phaseOf(st);
5778
+ const dot$1 = phaseOf(st);
5940
5779
  _if(() => {
5941
5780
  if (input.rail) {
5942
5781
  const $scope2_id = _scope_id();
5943
- _html(`<button${_attr_class([side_nav_item_module_default.railBtn, { [side_nav_item_module_default.current]: input.current }])}${_attr("title", ws.name)}>${_escape((input.index ?? 0) + 1)}${_el_resume($scope2_id, "b", _serialize_guard($scope0_reason, 18))}<span${_attr_class([
5944
- ui_module_default.dot,
5945
- ui_module_default[dot],
5946
- side_nav_item_module_default.railDot
5782
+ _html(`<button${_attr_class([railBtn, { ["_eQ"]: input.current }])}${_attr("title", ws$1.name)}>${_escape((input.index ?? 0) + 1)}${_el_resume($scope2_id, "b", _serialize_guard($scope0_reason, 18))}<span${_attr_class([
5783
+ "_o",
5784
+ phase[dot$1],
5785
+ "_eS"
5947
5786
  ])}></span>${_el_resume($scope2_id, "c", $sg__input_workspaceId__OR__input_status)}</button>${_el_resume($scope2_id, "a")}`);
5948
5787
  _script($scope2_id, "s3");
5949
5788
  _subscribe($si__input_workspaces__OR__input_workspaceId && $ws_name__closures, _subscribe($si__input_index && $input_index__closures, _subscribe($si__input_current && $input_current__closures, writeScope($scope2_id, { _: _scope_with_id($scope1_id) }))));
5950
5789
  return 0;
5951
5790
  } else {
5952
5791
  const $scope3_id = _scope_id();
5953
- const sessions = input.sessions || [];
5954
- const phaseLabel = dot === "working" ? "Working" : dot === "waiting" ? "Needs you" : dot === "idle" ? "Idle" : "Off";
5955
- const meta = sessions.length === 0 ? phaseLabel : sessions.length === 1 ? `${sessions[0].title || sessions[0].agent} · ${phaseLabel}` : `${sessions.length} sessions · ${phaseLabel}`;
5956
- _html(`<section${_attr_class([side_nav_item_module_default.ws, {
5957
- [side_nav_item_module_default.current]: input.current,
5958
- [side_nav_item_module_default.railPopWs]: input.railPop,
5959
- [side_nav_item_module_default.pageCard]: input.page
5960
- }])}><div${_attr_class(side_nav_item_module_default.wsRow)}><button${_attr_class(side_nav_item_module_default.wsBtn)}><span${_attr_class([
5961
- ui_module_default.dot,
5962
- ui_module_default[dot],
5963
- side_nav_item_module_default.statusDot
5964
- ])}></span>${_el_resume($scope3_id, "d", $sg__input_workspaceId__OR__input_status)}<span${_attr_class(side_nav_item_module_default.wsText)}><span${_attr_class(side_nav_item_module_default.wsName)}>${_escape(ws.name)}${_el_resume($scope3_id, "g", $sg__input_workspaces__OR__input_workspaceId)}</span>`);
5792
+ const sessions$1 = input.sessions || [];
5793
+ const phaseLabel = dot$1 === "working" ? "Working" : dot$1 === "waiting" ? "Needs you" : dot$1 === "idle" ? "Idle" : "Off";
5794
+ const meta = sessions$1.length === 0 ? phaseLabel : sessions$1.length === 1 ? `${sessions$1[0].title || sessions$1[0].agent} · ${phaseLabel}` : `${sessions$1.length} sessions · ${phaseLabel}`;
5795
+ _html(`<section${_attr_class(["_eT", {
5796
+ ["_eQ"]: input.current,
5797
+ ["_eU"]: input.railPop,
5798
+ ["_e6"]: input.page
5799
+ }])}><div${_attr_class("_eV")}><button${_attr_class("_eW")}><span${_attr_class([
5800
+ "_o",
5801
+ phase[dot$1],
5802
+ "_e5"
5803
+ ])}></span>${_el_resume($scope3_id, "d", $sg__input_workspaceId__OR__input_status)}<span${_attr_class("_e1")}><span${_attr_class("_e2")}>${_escape(ws$1.name)}${_el_resume($scope3_id, "g", $sg__input_workspaces__OR__input_workspaceId)}</span>`);
5965
5804
  _if(() => {
5966
5805
  if (input.page) {
5967
5806
  const $scope12_id = _scope_id();
5968
- _html(`<span${_attr_class(side_nav_item_module_default.wsMeta)}>${_escape(meta)}${_el_resume($scope12_id, "b", _serialize_guard($scope0_reason, 5))}</span>`);
5807
+ _html(`<span${_attr_class("_e3")}>${_escape(meta)}${_el_resume($scope12_id, "b", _serialize_guard($scope0_reason, 5))}</span>`);
5969
5808
  _serialize_if($scope0_reason, 10) && writeScope($scope12_id, { _: _serialize_if($scope0_reason, 5) && _scope_with_id($scope3_id) });
5970
5809
  return 0;
5971
5810
  }
@@ -5974,7 +5813,7 @@ var side_nav_item_default = _template("s", (input) => {
5974
5813
  _if(() => {
5975
5814
  if (input.page) {
5976
5815
  const $scope4_id = _scope_id();
5977
- _html(`<span${_attr_class(side_nav_item_module_default.wsOpenHint)}>${input.current ? "Open" : ""}${_el_resume($scope4_id, "b", _serialize_guard($scope0_reason, 17))}</span>`);
5816
+ _html(`<span${_attr_class("_e4")}>${input.current ? "Open" : ""}${_el_resume($scope4_id, "b", _serialize_guard($scope0_reason, 17))}</span>`);
5978
5817
  $si__input_workspaces__OR__input_workspaceId__OR__input_rail__OR__input_current__OR__input_page && _subscribe($si__input_current && $input_current__closures, writeScope($scope4_id, {
5979
5818
  _: _scope_with_id($scope3_id),
5980
5819
  Cab: $si__input_current && 2
@@ -5986,17 +5825,17 @@ var side_nav_item_default = _template("s", (input) => {
5986
5825
  _if(() => {
5987
5826
  if (!input.page) {
5988
5827
  const $scope5_id = _scope_id();
5989
- _html(`<div${_attr_class(side_nav_item_module_default.wsActions)}>`);
5828
+ _html(`<div${_attr_class("_eX")}>`);
5990
5829
  _if(() => {
5991
5830
  if (input.onNewSession) {
5992
5831
  const $scope6_id = _scope_id();
5993
5832
  const newPopId = _id();
5994
- _html(`<button${_attr_class(side_nav_item_module_default.rowIcon)} title="New session"${_attr("popovertarget", newPopId)}>`);
5833
+ _html(`<button${_attr_class("_eY")} title="New session"${_attr("popovertarget", newPopId)}>`);
5995
5834
  icon_agent_default({
5996
5835
  agent: "shell",
5997
5836
  size: 12
5998
5837
  });
5999
- _html(`</button>${_el_resume($scope6_id, "a")}<div${_attr("id", newPopId)} popover=auto${_attr_class(side_nav_item_module_default.newSessionPop)}>`);
5838
+ _html(`</button>${_el_resume($scope6_id, "a")}<div${_attr("id", newPopId)} popover=auto${_attr_class("_e0")}>`);
6000
5839
  _for_of([...input.agents || [], "shell"], (agent) => {
6001
5840
  const $scope7_id = _scope_id();
6002
5841
  _html("<button>");
@@ -6025,7 +5864,7 @@ var side_nav_item_default = _template("s", (input) => {
6025
5864
  _if(() => {
6026
5865
  if (input.onReview) {
6027
5866
  const $scope8_id = _scope_id();
6028
- _html(`<button${_attr_class(side_nav_item_module_default.rowIcon)} title="Review changes">`);
5867
+ _html(`<button${_attr_class("_eY")} title="Review changes">`);
6029
5868
  icon_diff_default({ size: 12 });
6030
5869
  _html(`</button>${_el_resume($scope8_id, "a")}`);
6031
5870
  _script($scope8_id, "s6");
@@ -6033,7 +5872,7 @@ var side_nav_item_default = _template("s", (input) => {
6033
5872
  return 0;
6034
5873
  }
6035
5874
  }, $scope5_id, "c", $sg__input_onReview, $sg__input_onReview, $sg__input_onNewSession__OR__input_onReview, 0, 1);
6036
- _html(`<button${_attr_class([side_nav_item_module_default.rowIcon, { [side_nav_item_module_default.on]: input.managing }])} title="Manage workspace" aria-pressed=${input.managing ? "true" : "false"}>`);
5875
+ _html(`<button${_attr_class(["_eY", { ["_eZ"]: input.managing }])} title="Manage workspace" aria-pressed=${input.managing ? "true" : "false"}>`);
6037
5876
  icon_manage_default({ size: 12 });
6038
5877
  _html(`</button>${_el_resume($scope5_id, "d")}</div>`);
6039
5878
  _script($scope5_id, "s7");
@@ -6041,17 +5880,17 @@ var side_nav_item_default = _template("s", (input) => {
6041
5880
  return 0;
6042
5881
  }
6043
5882
  }, $scope3_id, "j", $sg__input_page, $sg__input_page, $sg__input_page, 0, 1);
6044
- _html(`</div><div${_attr_class(side_nav_item_module_default.sessions)}>`);
6045
- _for_of(sessions.length > 1 ? sessions : [], (s) => {
5883
+ _html(`</div><div${_attr_class("_fd")}>`);
5884
+ _for_of(sessions$1.length > 1 ? sessions$1 : [], (s) => {
6046
5885
  const $scope9_id = _scope_id();
6047
- _html(`<div${_attr_class([side_nav_item_module_default.sess, { [side_nav_item_module_default.current]: s.id === input.currentTab }])}>`);
5886
+ _html(`<div${_attr_class(["_fb", { ["_eQ"]: s.id === input.currentTab }])}>`);
6048
5887
  _if(() => {
6049
5888
  if (renamingId === s.id) {
6050
5889
  const $scope11_id = _scope_id();
6051
5890
  _html(`<span${_attr_class([
6052
- ui_module_default.dot,
6053
- ui_module_default[sessionPhase(s.state)],
6054
- side_nav_item_module_default.sessRenameDot
5891
+ "_o",
5892
+ phase[sessionPhase(s.state)],
5893
+ "_e9"
6055
5894
  ])}></span>${_el_resume($scope11_id, "a", $sg__input_sessions)}`);
6056
5895
  _set_serialize_reason({
6057
5896
  1: $sg__input_sessions,
@@ -6061,17 +5900,17 @@ var side_nav_item_default = _template("s", (input) => {
6061
5900
  icon_agent_default({
6062
5901
  agent: s.agent,
6063
5902
  size: 13,
6064
- class: side_nav_item_module_default.sessIcon
5903
+ class: "_ff"
6065
5904
  });
6066
5905
  _html(`<input${_attr_input_value($scope11_id, "c", renameValue, _resume((_new_renameValue) => {
6067
5906
  renameValue = _new_renameValue;
6068
- }, "s0", $scope11_id))}${_attr_class(side_nav_item_module_default.sessRename)} aria-label="Session name">${_el_resume($scope11_id, "c")}`);
5907
+ }, "s0", $scope11_id))}${_attr_class("_e_")} aria-label="Session name">${_el_resume($scope11_id, "c")}`);
6069
5908
  _script($scope11_id, "s8");
6070
5909
  _subscribe($renameValue__closures, writeScope($scope11_id, { b: $si__input_sessions && _existing_scope($childScope2) }));
6071
5910
  return 0;
6072
5911
  } else {
6073
5912
  const $scope10_id = _scope_id();
6074
- _html(`<button${_attr_class(side_nav_item_module_default.sessBtn)}><span${_attr_class([ui_module_default.dot, ui_module_default[sessionPhase(s.state)]])}></span>${_el_resume($scope10_id, "b", $sg__input_sessions)}`);
5913
+ _html(`<button${_attr_class("_fe")}><span${_attr_class(["_o", phase[sessionPhase(s.state)]])}></span>${_el_resume($scope10_id, "b", $sg__input_sessions)}`);
6075
5914
  _set_serialize_reason({
6076
5915
  1: $sg__input_sessions,
6077
5916
  2: $sg__input_sessions
@@ -6080,11 +5919,11 @@ var side_nav_item_default = _template("s", (input) => {
6080
5919
  icon_agent_default({
6081
5920
  agent: s.agent,
6082
5921
  size: 13,
6083
- class: side_nav_item_module_default.sessIcon
5922
+ class: "_ff"
6084
5923
  });
6085
- _html(`<span${_attr_class(side_nav_item_module_default.sessTitle)}>${_escape(s.title || s.agent)}${_el_resume($scope10_id, "e", $sg__input_sessions)}</span></button>${_el_resume($scope10_id, "a")}<div${_attr_class(side_nav_item_module_default.sessActions)}><button${_attr_class(side_nav_item_module_default.rowIcon)} title="Rename session">`);
5924
+ _html(`<span${_attr_class("_e7")}>${_escape(s.title || s.agent)}${_el_resume($scope10_id, "e", $sg__input_sessions)}</span></button>${_el_resume($scope10_id, "a")}<div${_attr_class("_e8")}><button${_attr_class("_eY")} title="Rename session">`);
6086
5925
  icon_edit_default({ size: 12 });
6087
- _html(`</button>${_el_resume($scope10_id, "g")}<button${_attr_class([side_nav_item_module_default.close, { [side_nav_item_module_default.armed]: armedKill === s.id }])} title=${armedKill === s.id ? "\"Really kill this session?\"" : "\"Kill session\""}>×</button>${_el_resume($scope10_id, "i")}</div>`);
5926
+ _html(`</button>${_el_resume($scope10_id, "g")}<button${_attr_class(["_fa", { ["_fc"]: armedKill === s.id }])} title=${armedKill === s.id ? "\"Really kill this session?\"" : "\"Kill session\""}>×</button>${_el_resume($scope10_id, "i")}</div>`);
6088
5927
  _script($scope10_id, "s9");
6089
5928
  _subscribe($armedKill__closures, writeScope($scope10_id, { c: $si__input_sessions && _existing_scope($childScope3) }));
6090
5929
  return 1;
@@ -6113,9 +5952,9 @@ var side_nav_item_default = _template("s", (input) => {
6113
5952
  _html(`</div></section>${_el_resume($scope3_id, "a")}`);
6114
5953
  _script($scope3_id, "s10");
6115
5954
  _subscribe($si__input_workspaces__OR__input_workspaceId && $ws_name__closures, _subscribe($si__input_onReviewPr && $input_onReviewPr__closures, _subscribe($si__input_page && $input_page__closures, _subscribe($si__input_railPop && $input_railPop__closures, _subscribe($si__input_sessions && $input_sessions__closures, _subscribe($si__input_current && $input_current__closures, _subscribe($si__input_workspaceId && $input_workspaceId__closures, writeScope($scope3_id, {
6116
- o: $si__input_workspaceId__OR__input_status && sessions.length,
6117
- q: $si__input_workspaceId__OR__input_status && sessions[0]?.title,
6118
- r: $si__input_workspaceId__OR__input_status && sessions[0]?.agent,
5955
+ o: $si__input_workspaceId__OR__input_status && sessions$1.length,
5956
+ q: $si__input_workspaceId__OR__input_status && sessions$1[0]?.title,
5957
+ r: $si__input_workspaceId__OR__input_status && sessions$1[0]?.agent,
6119
5958
  s: $si__input_sessions && phaseLabel,
6120
5959
  u: $si__input_page && meta,
6121
5960
  _: _scope_with_id($scope1_id),
@@ -6128,7 +5967,7 @@ var side_nav_item_default = _template("s", (input) => {
6128
5967
  }, $scope1_id, "a", _serialize_guard($scope0_reason, 4), $sg__input_rail, $sg__input_rail, 0, 1);
6129
5968
  writeScope($scope1_id, {
6130
5969
  b: $si__input_rail && st,
6131
- c: $si__input_rail && dot,
5970
+ c: $si__input_rail && dot$1,
6132
5971
  _: _scope_with_id($scope0_id)
6133
5972
  });
6134
5973
  return 0;
@@ -6161,7 +6000,7 @@ var side_nav_item_default = _template("s", (input) => {
6161
6000
  a2: renamingId,
6162
6001
  a3: renameValue,
6163
6002
  a5: commitRename,
6164
- a7: $si__input_workspaces__OR__input_workspaceId__OR__input_rail && ws?.name,
6003
+ a7: $si__input_workspaces__OR__input_workspaceId__OR__input_rail && ws$1?.name,
6165
6004
  ab: $si__input_current && $input_current__closures,
6166
6005
  ac: $si__input_index && $input_index__closures,
6167
6006
  ap: $si__input_workspaces__OR__input_workspaceId && $ws_name__closures,
@@ -6282,16 +6121,16 @@ var side_nav_default = _template("t", (input) => {
6282
6121
  const wsSelected = view !== "usage" && view !== "new";
6283
6122
  const otherIds = itemIds.filter((id) => id !== ws.id);
6284
6123
  const listIds = isPage ? [ws.id, ...otherIds] : itemIds;
6285
- _html(`<aside${_attr_class([side_nav_module_default.sideNav, {
6286
- [side_nav_module_default.closed]: !navOpen,
6287
- [side_nav_module_default.page]: isPage
6124
+ _html(`<aside${_attr_class(["_cv", {
6125
+ ["_ct"]: !navOpen,
6126
+ ["_cu"]: isPage
6288
6127
  }])}${_attr("hidden", view === "diff")}>`);
6289
6128
  _if(() => {
6290
6129
  if (isPage) {
6291
6130
  const $scope1_id = _scope_id();
6292
- _html(`<header${_attr_class(side_nav_module_default.pageHead)}><h1>Workspaces</h1><div${_attr_class(side_nav_module_default.pageHeadActions)}>`);
6131
+ _html(`<header${_attr_class("_cw")}><h1>Workspaces</h1><div${_attr_class("_cx")}>`);
6293
6132
  _if(() => {}, $scope1_id, "c", 1, 1, 1, 0, 1);
6294
- _html(`<button${_attr_class([side_nav_module_default.iconBtn, { [side_nav_module_default.on]: view === "usage" }])} title=Usage aria-pressed=${view === "usage" ? "true" : "false"}>`);
6133
+ _html(`<button${_attr_class([iconBtn$4, { ["_co"]: view === "usage" }])} title=Usage aria-pressed=${view === "usage" ? "true" : "false"}>`);
6295
6134
  icon_gauge_default({ size: 16 });
6296
6135
  _html(`</button>${_el_resume($scope1_id, "d")}</div></header>`);
6297
6136
  _script($scope1_id, "t18");
@@ -6299,13 +6138,13 @@ var side_nav_default = _template("t", (input) => {
6299
6138
  return 0;
6300
6139
  }
6301
6140
  }, $scope0_id, "b", 1, 1, 1, 0, 1);
6302
- _html(`<div${_attr_class(side_nav_module_default.sideList)}>`);
6141
+ _html(`<div${_attr_class("_cA")}>`);
6303
6142
  _for_of(listIds, (wsId) => {
6304
6143
  const $scope2_id = _scope_id();
6305
6144
  _if(() => {
6306
6145
  if (isPage && wsId === ws.id) {
6307
6146
  const $scope10_id = _scope_id();
6308
- _html(`<h2${_attr_class(side_nav_module_default.sectionLabel)}>Current</h2>`);
6147
+ _html(`<h2${_attr_class("_cy")}>Current</h2>`);
6309
6148
  writeScope($scope10_id, {});
6310
6149
  return 0;
6311
6150
  }
@@ -6313,7 +6152,7 @@ var side_nav_default = _template("t", (input) => {
6313
6152
  _if(() => {
6314
6153
  if (isPage && wsId !== ws.id && wsId === otherIds[0]) {
6315
6154
  const $scope11_id = _scope_id();
6316
- _html(`<h2${_attr_class(side_nav_module_default.sectionLabel)}>Other spaces</h2>`);
6155
+ _html(`<h2${_attr_class("_cy")}>Other spaces</h2>`);
6317
6156
  writeScope($scope11_id, {});
6318
6157
  return 0;
6319
6158
  }
@@ -6412,7 +6251,7 @@ var side_nav_default = _template("t", (input) => {
6412
6251
  railHover = null;
6413
6252
  }, 150);
6414
6253
  }, "t9", $scope3_id);
6415
- _html(`<div${_attr_class(side_nav_module_default.sideRail)}>`);
6254
+ _html(`<div${_attr_class("_cB")}>`);
6416
6255
  _for_of(itemIds, (wsId, i) => {
6417
6256
  const $scope4_id = _scope_id();
6418
6257
  _html("<span>");
@@ -6460,7 +6299,7 @@ var side_nav_default = _template("t", (input) => {
6460
6299
  if (railHover) {
6461
6300
  const $scope5_id = _scope_id();
6462
6301
  const hoverId = railHover.id;
6463
- _html(`<div${_attr_class(side_nav_module_default.railPop)}${_attr_style(`top:${railHover.top}px;left:${railHover.left}px`)}>`);
6302
+ _html(`<div${_attr_class("_cE")}${_attr_style(`top:${railHover.top}px;left:${railHover.left}px`)}>`);
6464
6303
  _set_serialize_reason({
6465
6304
  0: 1,
6466
6305
  1: 1,
@@ -6564,11 +6403,11 @@ var side_nav_default = _template("t", (input) => {
6564
6403
  return 0;
6565
6404
  }
6566
6405
  }, $scope0_id, "d");
6567
- _html(`<div${_attr_class(side_nav_module_default.sideFoot)}>`);
6406
+ _html(`<div${_attr_class("_cC")}>`);
6568
6407
  _if(() => {
6569
6408
  if (isPage) {
6570
6409
  const $scope6_id = _scope_id();
6571
- _html(`<button${_attr_class([side_nav_module_default.newSpaceBtn, { [side_nav_module_default.on]: view === "new" }])} title="New workspace" aria-pressed=${view === "new" ? "true" : "false"}>`);
6410
+ _html(`<button${_attr_class(["_cz", { ["_co"]: view === "new" }])} title="New workspace" aria-pressed=${view === "new" ? "true" : "false"}>`);
6572
6411
  icon_folder_plus_default({ size: 16 });
6573
6412
  _html(` New workspace</button>${_el_resume($scope6_id, "a")}`);
6574
6413
  _script($scope6_id, "t21");
@@ -6576,7 +6415,7 @@ var side_nav_default = _template("t", (input) => {
6576
6415
  return 0;
6577
6416
  } else {
6578
6417
  const $scope7_id = _scope_id();
6579
- _html(`<button${_attr_class(side_nav_module_default.navToggle)} title=${navOpen ? "\"Collapse sidebar\"" : "\"Expand sidebar\""}>`);
6418
+ _html(`<button${_attr_class(navToggle)} title=${navOpen ? "\"Collapse sidebar\"" : "\"Expand sidebar\""}>`);
6580
6419
  _if(() => {
6581
6420
  if (navOpen) {
6582
6421
  const $scope12_id = _scope_id();
@@ -6590,11 +6429,11 @@ var side_nav_default = _template("t", (input) => {
6590
6429
  return 1;
6591
6430
  }
6592
6431
  }, $scope7_id, "a", 1, 1, 1, "</button>", 1);
6593
- _html(`<div${_attr_class([ui_module_default.spacer, side_nav_module_default.footSpacer])}></div>`);
6432
+ _html(`<div${_attr_class(["_n", "_cD"])}></div>`);
6594
6433
  _if(() => {}, $scope7_id, "c", 1, 1, 1, 0, 1);
6595
- _html(`<button${_attr_class([side_nav_module_default.iconBtn, { [side_nav_module_default.on]: view === "usage" }])} title=Usage aria-pressed=${view === "usage" ? "true" : "false"}>`);
6434
+ _html(`<button${_attr_class([iconBtn$4, { ["_co"]: view === "usage" }])} title=Usage aria-pressed=${view === "usage" ? "true" : "false"}>`);
6596
6435
  icon_gauge_default({ size: 15 });
6597
- _html(`</button>${_el_resume($scope7_id, "d")}<button${_attr_class([side_nav_module_default.iconBtn, { [side_nav_module_default.on]: view === "new" }])} title="New workspace" aria-pressed=${view === "new" ? "true" : "false"}>`);
6436
+ _html(`</button>${_el_resume($scope7_id, "d")}<button${_attr_class([iconBtn$4, { ["_co"]: view === "new" }])} title="New workspace" aria-pressed=${view === "new" ? "true" : "false"}>`);
6598
6437
  icon_folder_plus_default({ size: 16 });
6599
6438
  _html(`</button>${_el_resume($scope7_id, "f")}`);
6600
6439
  _script($scope7_id, "t23");
@@ -6912,63 +6751,13 @@ function treeRows(files) {
6912
6751
  walk(root, 0, "");
6913
6752
  return rows;
6914
6753
  }
6915
- var diff_view_module_default = {
6916
- iconBtn: "_dH _ez",
6917
- spinning: "_dI _eA",
6918
- diffView: "_dJ",
6919
- treeToggle: "_dK _ez",
6920
- diffTools: "_dL",
6921
- on: "_dM",
6922
- diffCol: "_dN",
6923
- chrome: "_dO",
6924
- backBtn: "_dP",
6925
- headText: "_dQ",
6926
- pageTitle: "_dR",
6927
- headWithSend: "_dS",
6928
- toolCtrl: "_dT",
6929
- findBtn: "_dU",
6930
- findSlot: "_dV",
6931
- findSlotClosed: "_dW",
6932
- toolsFind: "_dX",
6933
- fileFindActive: "_dY",
6934
- pathFindActive: "_dZ",
6935
- diffMain: "_d0",
6936
- toastMeta: "_d1",
6937
- diffHead: "_d2",
6938
- filterSlot: "_d3",
6939
- diffStats: "_d4",
6940
- statAdd: "_d5",
6941
- statDel: "_d6",
6942
- statEmpty: "_d7",
6943
- statSep: "_d8",
6944
- scope: "_d9",
6945
- scopeOpt: "_d_",
6946
- scopeOn: "_ea",
6947
- scopeChip: "_eb",
6948
- repoSection: "_ec",
6949
- repoSep: "_ed",
6950
- repoSepCollapsed: "_ee",
6951
- repoWorktree: "_ef _k",
6952
- repoState: "_eg",
6953
- repoTitle: "_eh _j",
6954
- repoMeta: "_ei",
6955
- compare: "_ej",
6956
- compareBase: "_ek",
6957
- compareHead: "_el",
6958
- compareVs: "_em",
6959
- compareTopic: "_en",
6960
- files: "_eo",
6961
- file: "_ep",
6962
- diffWait: "_eq",
6963
- treeChev: "_er",
6964
- treeChevOpen: "_es",
6965
- treeChevBusy: "_et",
6966
- status: "_eu",
6967
- path: "_ev",
6968
- centerPad: "_ew",
6969
- filesBtn: "_ex",
6970
- diffPad: "_ey"
6971
- };
6754
+ //#endregion
6755
+ //#region src/tags/diff-view.css.ts
6756
+ var iconBtn$3 = "_dN _G";
6757
+ var spinning$2 = "_dO _H";
6758
+ var treeToggle = "_dR _G";
6759
+ var repoWorktree = "_el _m";
6760
+ var repoTitle = "_en _l";
6972
6761
  //#endregion
6973
6762
  //#region src/tags/icons/icon-back.marko
6974
6763
  var icon_back_default = _template("A", (input) => {
@@ -6986,10 +6775,6 @@ var icon_back_default = _template("A", (input) => {
6986
6775
  });
6987
6776
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
6988
6777
  });
6989
- var file_filter_module_default = {
6990
- wrap: "_eN",
6991
- fileFilter: "_eO"
6992
- };
6993
6778
  //#endregion
6994
6779
  //#region src/tags/file-filter.marko
6995
6780
  var file_filter_default = _template("j", (input) => {
@@ -7019,9 +6804,9 @@ var file_filter_default = _template("j", (input) => {
7019
6804
  pending = v;
7020
6805
  box.timer = setTimeout(flush, 150);
7021
6806
  }, "j2", $scope0_id);
7022
- _html(`<div${_attr_class(file_filter_module_default.wrap)}><input${_attr_input_value($scope0_id, "b", draft, _resume(function(v) {
6807
+ _html(`<div${_attr_class("_fg")}><input${_attr_input_value($scope0_id, "b", draft, _resume(function(v) {
7023
6808
  type(v);
7024
- }, "j0", $scope0_id))}${_attr_class(file_filter_module_default.fileFilter)} type=search placeholder="Filter files…" aria-label="Filter files">${_el_resume($scope0_id, "b")}</div>`);
6809
+ }, "j0", $scope0_id))}${_attr_class("_fh")} type=search placeholder="Filter files…" aria-label="Filter files">${_el_resume($scope0_id, "b")}</div>`);
7025
6810
  _script($scope0_id, "j3");
7026
6811
  writeScope($scope0_id, {
7027
6812
  e: _serialize_if($scope0_reason, 1) && input.value,
@@ -7036,7 +6821,6 @@ var file_filter_default = _template("j", (input) => {
7036
6821
  });
7037
6822
  _resume_branch($scope0_id);
7038
6823
  });
7039
- var diff_send_module_default = { headActions: "_e0" };
7040
6824
  //#endregion
7041
6825
  //#region src/tags/diff-send.marko
7042
6826
  var diff_send_default = _template("g", (input) => {
@@ -7046,17 +6830,17 @@ var diff_send_default = _template("g", (input) => {
7046
6830
  let sendTarget = null;
7047
6831
  const sessions = input.sessions || [];
7048
6832
  const sendPick = sessions.some((s) => s.id === sendTarget) ? sendTarget : sessions[0]?.id ?? null;
7049
- _html(`<span${_attr_class(diff_send_module_default.headActions)}><button type=button${_attr_class(ui_module_default.btn)} title="Copy comments as markdown">Copy${_el_resume($scope0_id, "c")}</button>${_el_resume($scope0_id, "b")}`);
6833
+ _html(`<span${_attr_class("_fi")}><button type=button${_attr_class("_d")} title="Copy comments as markdown">Copy${_el_resume($scope0_id, "c")}</button>${_el_resume($scope0_id, "b")}`);
7050
6834
  _if(() => {
7051
6835
  if (sessions.length === 1) {
7052
6836
  const $scope1_id = _scope_id();
7053
- _html(`<button type=button${_attr_class([ui_module_default.btn, ui_module_default.primary])}${_attr("disabled", sending)}>${`Send to ${_escape(`${sessions[0].title || sessions[0].agent}`)}`}${_el_resume($scope1_id, "b")}</button>${_el_resume($scope1_id, "a")}`);
6837
+ _html(`<button type=button${_attr_class(["_d", "_e"])}${_attr("disabled", sending)}>${`Send to ${_escape(`${sessions[0].title || sessions[0].agent}`)}`}${_el_resume($scope1_id, "b")}</button>${_el_resume($scope1_id, "a")}`);
7054
6838
  _script($scope1_id, "g1");
7055
6839
  writeScope($scope1_id, { _: _scope_with_id($scope0_id) });
7056
6840
  return 0;
7057
6841
  } else if (sessions.length) {
7058
6842
  const $scope2_id = _scope_id();
7059
- _html(`<span${_attr_class(ui_module_default.splitPrimary)}><button type=button${_attr("disabled", sending)}>Send to${_el_resume($scope2_id, "c")}</button>${_el_resume($scope2_id, "b")}`);
6843
+ _html(`<span${_attr_class(splitPrimary)}><button type=button${_attr("disabled", sending)}>Send to${_el_resume($scope2_id, "c")}</button>${_el_resume($scope2_id, "b")}`);
7060
6844
  _attr_select_value($scope2_id, "d", sendTarget, _resume((_new_sendTarget) => {
7061
6845
  sendTarget = _new_sendTarget;
7062
6846
  }, "g0", $scope2_id), () => {
@@ -8527,19 +8311,7 @@ function clip(line, at, len) {
8527
8311
  const end = Math.min(line.length, at + len + pad);
8528
8312
  return (start > 0 ? "…" : "") + line.slice(start, end) + (end < line.length ? "…" : "");
8529
8313
  }
8530
- var diff_find_module_default = {
8531
- findBar: "_eC",
8532
- closed: "_eD",
8533
- findInput: "_eE",
8534
- termOverlay: "_eF",
8535
- count: "_eG",
8536
- findIconBtn: "_eH _ez",
8537
- findWrap: "_eI",
8538
- termOverlayWrap: "_eJ",
8539
- termKeybarWrap: "_eK",
8540
- termKeybar: "_eL",
8541
- termClosed: "_eM"
8542
- };
8314
+ var findIconBtn = "_eK _G";
8543
8315
  //#endregion
8544
8316
  //#region src/tags/diff-find.marko
8545
8317
  var setSearchPaint$1;
@@ -8609,9 +8381,9 @@ var diff_find_default = _template("f", (input) => {
8609
8381
  el.select();
8610
8382
  }, 0);
8611
8383
  }, "f5", $scope0_id);
8612
- _html(`<div${_attr_class([diff_find_module_default.findBar, !open && diff_find_module_default.closed])} aria-hidden=${open ? "false" : "true"}><input${_attr_input_value($scope0_id, "b", query || "", _resume(function(v) {
8384
+ _html(`<div${_attr_class(["_eG", !open && "_eF"])} aria-hidden=${open ? "false" : "true"}><input${_attr_input_value($scope0_id, "b", query || "", _resume(function(v) {
8613
8385
  type(v);
8614
- }, "f0", $scope0_id))}${_attr_class(diff_find_module_default.findInput)} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in diffs" aria-label="Find in diffs">${_el_resume($scope0_id, "b")}<span${_attr_class(diff_find_module_default.count)}>${open && (query || "").trim() ? hits.length ? `${_escape(`${at + 1}`)}/${_escape(`${hits.length}`)}` : "0/0" : ""}${_el_resume($scope0_id, "d")}</span><button type=button${_attr_class(diff_find_module_default.findIconBtn)} title="Previous match"${_attr("disabled", !hits.length || !open)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class(diff_find_module_default.findIconBtn)} title="Next match"${_attr("disabled", !hits.length || !open)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "f")}<button type=button${_attr_class(diff_find_module_default.findIconBtn)} title="Close find" tabindex=${open ? "0" : "-1"}>×</button>${_el_resume($scope0_id, "g")}</div>${_el_resume($scope0_id, "a")}`);
8386
+ }, "f0", $scope0_id))}${_attr_class("_eH")} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in diffs" aria-label="Find in diffs">${_el_resume($scope0_id, "b")}<span${_attr_class("_eJ")}>${open && (query || "").trim() ? hits.length ? `${_escape(`${at + 1}`)}/${_escape(`${hits.length}`)}` : "0/0" : ""}${_el_resume($scope0_id, "d")}</span><button type=button${_attr_class(findIconBtn)} title="Previous match"${_attr("disabled", !hits.length || !open)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class(findIconBtn)} title="Next match"${_attr("disabled", !hits.length || !open)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "f")}<button type=button${_attr_class(findIconBtn)} title="Close find" tabindex=${open ? "0" : "-1"}>×</button>${_el_resume($scope0_id, "g")}</div>${_el_resume($scope0_id, "a")}`);
8615
8387
  _script($scope0_id, "f6");
8616
8388
  _script($scope0_id, "f7");
8617
8389
  _script($scope0_id, "f8");
@@ -8661,14 +8433,13 @@ var icon_search_default = _template("P", (input) => {
8661
8433
  });
8662
8434
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
8663
8435
  });
8664
- var diff_file_module_default = { diffFile: "_eZ" };
8665
8436
  //#endregion
8666
8437
  //#region src/tags/diff-file.marko
8667
8438
  var diff_file_default = _template("e", (input) => {
8668
8439
  _scope_reason();
8669
8440
  const $scope0_id = _scope_id();
8670
8441
  _el($scope0_id, "e0");
8671
- _html(`<div${_attr_class(diff_file_module_default.diffFile)}></div>${_el_resume($scope0_id, "a")}`);
8442
+ _html(`<div${_attr_class("_fj")}></div>${_el_resume($scope0_id, "a")}`);
8672
8443
  _script($scope0_id, "e1");
8673
8444
  writeScope($scope0_id, {
8674
8445
  d: input.file,
@@ -8685,18 +8456,6 @@ var diff_file_default = _template("e", (input) => {
8685
8456
  });
8686
8457
  _resume_branch($scope0_id);
8687
8458
  });
8688
- var diff_tree_module_default = {
8689
- tree: "_fr",
8690
- closed: "_fs",
8691
- treeRepo: "_ft",
8692
- treeRepoName: "_fu",
8693
- treeDir: "_fv",
8694
- treeFile: "_fw",
8695
- treeFileName: "_fx",
8696
- treeNote: "_fy",
8697
- treeChev: "_fz",
8698
- status: "_fA"
8699
- };
8700
8459
  //#endregion
8701
8460
  //#region src/tags/diff-tree.marko
8702
8461
  var diff_tree_default = _template("h", (input) => {
@@ -8709,10 +8468,10 @@ var diff_tree_default = _template("h", (input) => {
8709
8468
  let openedRepos = input.openedRepos;
8710
8469
  let collapsedDirs = /* @__PURE__ */ new Set();
8711
8470
  const commentKeys = input.commentKeys || /* @__PURE__ */ new Set();
8712
- _html(`<aside${_attr_class([diff_tree_module_default.tree, { [diff_tree_module_default.closed]: input.open === false }])}>`);
8471
+ _html(`<aside${_attr_class(["_fv", { ["_fu"]: input.open === false }])}>`);
8713
8472
  _for_of(input.sections, (section) => {
8714
8473
  const $scope1_id = _scope_id();
8715
- _html(`<div${_attr_class(diff_tree_module_default.treeRepo)}><button type=button${_attr_class([diff_tree_module_default.treeRepoName, { [diff_tree_module_default.closed]: collapsedRepos.has(section.id) }])}><span${_attr_class(diff_tree_module_default.treeChev)}>${collapsedRepos.has(section.id) ? "▸" : "▾"}${_el_resume($scope1_id, "d")}</span>${_sep($sg__input_sections)}${_escape(section.label)}${_el_resume($scope1_id, "e", $sg__input_sections)}</button>${_el_resume($scope1_id, "b")}`);
8474
+ _html(`<div${_attr_class("_fw")}><button type=button${_attr_class(["_fx", { ["_fu"]: collapsedRepos.has(section.id) }])}><span${_attr_class("_fC")}>${collapsedRepos.has(section.id) ? "▸" : "▾"}${_el_resume($scope1_id, "d")}</span>${_sep($sg__input_sections)}${_escape(section.label)}${_el_resume($scope1_id, "e", $sg__input_sections)}</button>${_el_resume($scope1_id, "b")}`);
8716
8475
  _if(() => {
8717
8476
  if (!collapsedRepos.has(section.id) || openedRepos.has(section.id)) {
8718
8477
  const $scope2_id = _scope_id();
@@ -8739,17 +8498,17 @@ var diff_tree_default = _template("h", (input) => {
8739
8498
  _if(() => {
8740
8499
  if (!hiddenByCollapse(row) && row.kind === "dir") {
8741
8500
  const $scope5_id = _scope_id();
8742
- _html(`<button type=button${_attr_class([diff_tree_module_default.treeDir, { [diff_tree_module_default.closed]: collapsedDirs.has(dirKey(row.path)) }])}${_attr("title", row.path)}${_attr_style(`padding-left:${.35 + row.depth * .75}rem`)}><span${_attr_class(diff_tree_module_default.treeChev)}>${collapsedDirs.has(dirKey(row.path)) ? "▸" : "▾"}${_el_resume($scope5_id, "c")}</span>${_escape(row.label)}${_el_resume($scope5_id, "d", $sg__input_sections)}/</button>${_el_resume($scope5_id, "a")}`);
8501
+ _html(`<button type=button${_attr_class(["_fy", { ["_fu"]: collapsedDirs.has(dirKey(row.path)) }])}${_attr("title", row.path)}${_attr_style(`padding-left:${.35 + row.depth * .75}rem`)}><span${_attr_class("_fC")}>${collapsedDirs.has(dirKey(row.path)) ? "▸" : "▾"}${_el_resume($scope5_id, "c")}</span>${_escape(row.label)}${_el_resume($scope5_id, "d", $sg__input_sections)}/</button>${_el_resume($scope5_id, "a")}`);
8743
8502
  _script($scope5_id, "h3");
8744
8503
  _subscribe($si__input_sections && $if_content__dirKey__closures, _subscribe($collapsedDirs__closures, writeScope($scope5_id, { Cv: 1 })));
8745
8504
  return 0;
8746
8505
  } else if (!hiddenByCollapse(row) && row.kind !== "dir") {
8747
8506
  const $scope4_id = _scope_id();
8748
- _html(`<button type=button${_attr_class(diff_tree_module_default.treeFile)}${_attr("title", row.file.path)}${_attr_style(`padding-left:${.5 + row.depth * .75}rem`)}><span${_attr_class(diff_tree_module_default.status)}${_attr("data-status", row.file.status)}>${_escape(row.file.status)}${_el_resume($scope4_id, "c", $sg__input_sections)}</span>${_el_resume($scope4_id, "b", $sg__input_sections)}<span${_attr_class(diff_tree_module_default.treeFileName)}>${_escape(row.name)}${_el_resume($scope4_id, "e", $sg__input_sections)}</span>`);
8507
+ _html(`<button type=button${_attr_class("_fz")}${_attr("title", row.file.path)}${_attr_style(`padding-left:${.5 + row.depth * .75}rem`)}><span${_attr_class("_fD")}${_attr("data-status", row.file.status)}>${_escape(row.file.status)}${_el_resume($scope4_id, "c", $sg__input_sections)}</span>${_el_resume($scope4_id, "b", $sg__input_sections)}<span${_attr_class("_fA")}>${_escape(row.name)}${_el_resume($scope4_id, "e", $sg__input_sections)}</span>`);
8749
8508
  _if(() => {
8750
8509
  if (commentKeys.has(row.file.key)) {
8751
8510
  const $scope6_id = _scope_id();
8752
- _html(`<span${_attr_class(diff_tree_module_default.treeNote)}>💬</span>`);
8511
+ _html(`<span${_attr_class("_fB")}>💬</span>`);
8753
8512
  _serialize_if($scope0_reason, 0) && writeScope($scope6_id, {});
8754
8513
  return 0;
8755
8514
  }
@@ -8808,18 +8567,9 @@ var diff_tree_default = _template("h", (input) => {
8808
8567
  });
8809
8568
  _resume_branch($scope0_id);
8810
8569
  });
8811
- var diff_file_sheet_module_default = {
8812
- iconBtn: "_eP _ez",
8813
- spinning: "_eQ _eA",
8814
- sheetBackdrop: "_eR",
8815
- fileSheet: "_eS",
8816
- sheetHead: "_eT",
8817
- fileCount: "_eU",
8818
- sheetList: "_eV",
8819
- sheetFile: "_eW",
8820
- sheetPath: "_eX",
8821
- status: "_eY"
8822
- };
8570
+ //#endregion
8571
+ //#region src/tags/diff-file-sheet.css.ts
8572
+ var iconBtn$2 = "_fk _G";
8823
8573
  //#endregion
8824
8574
  //#region src/tags/diff-file-sheet.marko
8825
8575
  var diff_file_sheet_default = _template("d", (input) => {
@@ -8832,10 +8582,10 @@ var diff_file_sheet_default = _template("d", (input) => {
8832
8582
  _if(() => {
8833
8583
  if (open) {
8834
8584
  const $scope1_id = _scope_id();
8835
- _html(`<div${_attr_class(diff_file_sheet_module_default.sheetBackdrop)}></div>${_el_resume($scope1_id, "a")}<div${_attr_class(diff_file_sheet_module_default.fileSheet)} role=dialog aria-label="Jump to file"><div${_attr_class(diff_file_sheet_module_default.sheetHead)}><strong>Files</strong><span${_attr_class(diff_file_sheet_module_default.fileCount)}>${_escape(input.files.length)}${_el_resume($scope1_id, "e", _serialize_guard($scope0_reason, 6))}${_sep($sg__input_total__OR__input_files_length)}${input.files.length !== total ? ` / ${_escape(`${total}`)}` : ""}${_el_resume($scope1_id, "f", $sg__input_total__OR__input_files_length)}</span><button type=button${_attr_class(diff_file_sheet_module_default.iconBtn)} title=Close aria-label=Close>×</button>${_el_resume($scope1_id, "g")}</div><div${_attr_class(diff_file_sheet_module_default.sheetList)}>`);
8585
+ _html(`<div${_attr_class("_fm")}></div>${_el_resume($scope1_id, "a")}<div${_attr_class("_fn")} role=dialog aria-label="Jump to file"><div${_attr_class("_fo")}><strong>Files</strong><span${_attr_class("_fp")}>${_escape(input.files.length)}${_el_resume($scope1_id, "e", _serialize_guard($scope0_reason, 6))}${_sep($sg__input_total__OR__input_files_length)}${input.files.length !== total ? ` / ${_escape(`${total}`)}` : ""}${_el_resume($scope1_id, "f", $sg__input_total__OR__input_files_length)}</span><button type=button${_attr_class(iconBtn$2)} title=Close aria-label=Close>×</button>${_el_resume($scope1_id, "g")}</div><div${_attr_class("_fq")}>`);
8836
8586
  _for_of(input.files, (file) => {
8837
8587
  const $scope2_id = _scope_id();
8838
- _html(`<button type=button${_attr_class([diff_file_sheet_module_default.sheetFile, ui_module_default.mono])}><span${_attr_class(diff_file_sheet_module_default.status)}${_attr("data-status", file.status)}>${_escape(file.status)}${_el_resume($scope2_id, "c", $sg__input_files)}</span>${_el_resume($scope2_id, "b", $sg__input_files)}<span${_attr_class(diff_file_sheet_module_default.sheetPath)}${_attr("title", file.key)}><bdi>${_escape(file.key)}${_el_resume($scope2_id, "e", $sg__input_files)}</bdi></span>${_el_resume($scope2_id, "d", $sg__input_files)}`);
8588
+ _html(`<button type=button${_attr_class(["_fr", "_m"])}><span${_attr_class("_ft")}${_attr("data-status", file.status)}>${_escape(file.status)}${_el_resume($scope2_id, "c", $sg__input_files)}</span>${_el_resume($scope2_id, "b", $sg__input_files)}<span${_attr_class("_fs")}${_attr("title", file.key)}><bdi>${_escape(file.key)}${_el_resume($scope2_id, "e", $sg__input_files)}</bdi></span>${_el_resume($scope2_id, "d", $sg__input_files)}`);
8839
8589
  _if(() => {
8840
8590
  if (commentKeys.has(file.key)) {
8841
8591
  const $scope3_id = _scope_id();
@@ -9228,11 +8978,11 @@ var diff_view_default = _template("i", (input) => {
9228
8978
  revealSearchHit();
9229
8979
  }, 0);
9230
8980
  }, "i20", $scope0_id);
9231
- _html(`<div${_attr_class(diff_view_module_default.diffView)}><div${_attr_class(diff_view_module_default.diffCol)}><div${_attr_class([diff_view_module_default.chrome, { [diff_view_module_default.headWithSend]: comments.length > 0 }])}><div${_attr_class(diff_view_module_default.diffHead)}>`);
8981
+ _html(`<div${_attr_class("_dP")}><div${_attr_class("_dT")}><div${_attr_class(["_dU", { ["_dY"]: comments.length > 0 }])}><div${_attr_class("_d8")}>`);
9232
8982
  _if(() => {
9233
8983
  if (input.onExit) {
9234
8984
  const $scope1_id = _scope_id();
9235
- _html(`<button${_attr_class([diff_view_module_default.iconBtn, diff_view_module_default.backBtn])} title="Back to terminal">`);
8985
+ _html(`<button${_attr_class([iconBtn$3, "_dV"])} title="Back to terminal">`);
9236
8986
  icon_back_default({ size: 14 });
9237
8987
  _html(`</button>${_el_resume($scope1_id, "a")}`);
9238
8988
  _script($scope1_id, "i36");
@@ -9240,7 +8990,7 @@ var diff_view_default = _template("i", (input) => {
9240
8990
  return 0;
9241
8991
  }
9242
8992
  }, $scope0_id, "e", $sg__input_onExit, $sg__input_onExit, 1, 0, 1);
9243
- _html(`<div${_attr_class(diff_view_module_default.filterSlot)}>`);
8993
+ _html(`<div${_attr_class("_d9")}>`);
9244
8994
  _set_serialize_reason(2);
9245
8995
  const $childScope = _peek_scope_id();
9246
8996
  file_filter_default({
@@ -9249,16 +8999,16 @@ var diff_view_default = _template("i", (input) => {
9249
8999
  fileFilter = _new_fileFilter;
9250
9000
  }, "i21", $scope0_id)
9251
9001
  });
9252
- _html(`</div><div${_attr_class(diff_view_module_default.headText)}><h1${_attr_class(diff_view_module_default.pageTitle)}>Review</h1><span${_attr_class(diff_view_module_default.diffStats)}>`);
9002
+ _html(`</div><div${_attr_class("_dW")}><h1${_attr_class("_dX")}>Review</h1><span${_attr_class("_d_")}>`);
9253
9003
  _if(() => {
9254
9004
  if (lineStats.additions || lineStats.deletions) {
9255
9005
  const $scope27_id = _scope_id();
9256
- _html(`<span${_attr_class(diff_view_module_default.statAdd)}>+<!>${_escape(lineStats.additions)}${_el_resume($scope27_id, "b")}</span><span${_attr_class(diff_view_module_default.statDel)}>−<!>${_escape(lineStats.deletions)}${_el_resume($scope27_id, "d")}</span>`);
9006
+ _html(`<span${_attr_class("_ea")}>+<!>${_escape(lineStats.additions)}${_el_resume($scope27_id, "b")}</span><span${_attr_class("_eb")}>−<!>${_escape(lineStats.deletions)}${_el_resume($scope27_id, "d")}</span>`);
9257
9007
  writeScope($scope27_id, {});
9258
9008
  return 0;
9259
9009
  } else {
9260
9010
  const $scope29_id = _scope_id();
9261
- _html(`<span${_attr_class(diff_view_module_default.statEmpty)}>0</span>`);
9011
+ _html(`<span${_attr_class("_ec")}>0</span>`);
9262
9012
  writeScope($scope29_id, {});
9263
9013
  return 1;
9264
9014
  }
@@ -9266,7 +9016,7 @@ var diff_view_default = _template("i", (input) => {
9266
9016
  _if(() => {
9267
9017
  if (comments.length) {
9268
9018
  const $scope13_id = _scope_id();
9269
- _html(`<span${_attr_class(diff_view_module_default.statSep)}>·</span>${_escape(comments.length)}${_el_resume($scope13_id, "b")} comment<!>${comments.length === 1 ? "" : "s"}${_el_resume($scope13_id, "c")}`);
9019
+ _html(`<span${_attr_class("_ed")}>·</span>${_escape(comments.length)}${_el_resume($scope13_id, "b")} comment<!>${comments.length === 1 ? "" : "s"}${_el_resume($scope13_id, "c")}`);
9270
9020
  writeScope($scope13_id, {});
9271
9021
  return 0;
9272
9022
  }
@@ -9286,19 +9036,19 @@ var diff_view_default = _template("i", (input) => {
9286
9036
  return 0;
9287
9037
  }
9288
9038
  }, $scope0_id, "m", 1, 1, 1, 0, 1);
9289
- _html(`</div><div${_attr_class([diff_view_module_default.diffTools, { [diff_view_module_default.toolsFind]: findOpen && !isTouch() }])}><button${_attr_class([diff_view_module_default.treeToggle, { [diff_view_module_default.on]: treeOpen }])} title=${treeOpen ? "\"Hide file tree\"" : "\"Show file tree\""}>`);
9039
+ _html(`</div><div${_attr_class(["_dS", { ["_d3"]: findOpen && !isTouch() }])}><button${_attr_class([treeToggle, { ["_dQ"]: treeOpen }])} title=${treeOpen ? "\"Hide file tree\"" : "\"Show file tree\""}>`);
9290
9040
  icon_sidebar_default({ size: 14 });
9291
9041
  _html(`</button>${_el_resume($scope0_id, "o")}<button${_attr_class([
9292
- diff_view_module_default.iconBtn,
9293
- diff_view_module_default.toolCtrl,
9294
- { [diff_view_module_default.spinning]: loading }
9042
+ iconBtn$3,
9043
+ "_dZ",
9044
+ { [spinning$2]: loading }
9295
9045
  ])} title="Refresh diff"${_attr("disabled", loading)}>`);
9296
9046
  icon_refresh_default({ size: 14 });
9297
- _html(`</button>${_el_resume($scope0_id, "q")}<button${_attr_class([diff_view_module_default.filesBtn, diff_view_module_default.toolCtrl])} title="Jump to file">Files (<!>${_escape(shownFiles.length)}${_el_resume($scope0_id, "t")})</button>${_el_resume($scope0_id, "s")}<div${_attr_class([diff_view_module_default.scope, diff_view_module_default.toolCtrl])} role=group aria-label="Review scope"><button type=button${_attr_class([diff_view_module_default.scopeOpt, { [diff_view_module_default.scopeOn]: !uncommitted }])} aria-pressed=${!uncommitted ? "true" : "false"} title="Committed changes only — base…tip, no working-tree edits"${_attr("disabled", loading)}>Committed</button>${_el_resume($scope0_id, "v")}<button type=button${_attr_class([diff_view_module_default.scopeOpt, { [diff_view_module_default.scopeOn]: uncommitted }])} aria-pressed=${uncommitted ? "true" : "false"} title="Include uncommitted and untracked files in the working tree"${_attr("disabled", loading)}>Working tree</button>${_el_resume($scope0_id, "w")}</div><button type=button${_attr_class([
9298
- diff_view_module_default.scopeChip,
9299
- diff_view_module_default.toolCtrl,
9300
- { [diff_view_module_default.scopeOn]: uncommitted }
9301
- ])} aria-pressed=${uncommitted ? "true" : "false"} title=${uncommitted ? "\"Showing working tree — tap for committed only\"" : "\"Showing committed only — tap to include uncommitted\""}${_attr("disabled", loading)}>${uncommitted ? "Dirty" : "Clean"}${_el_resume($scope0_id, "y")}</button>${_el_resume($scope0_id, "x")}<div${_attr_class([diff_view_module_default.findSlot, { [diff_view_module_default.findSlotClosed]: !findOpen }])}>`);
9047
+ _html(`</button>${_el_resume($scope0_id, "q")}<button${_attr_class(["_eD", "_dZ"])} title="Jump to file">Files (<!>${_escape(shownFiles.length)}${_el_resume($scope0_id, "t")})</button>${_el_resume($scope0_id, "s")}<div${_attr_class(["_ee", "_dZ"])} role=group aria-label="Review scope"><button type=button${_attr_class(["_eg", { ["_ef"]: !uncommitted }])} aria-pressed=${!uncommitted ? "true" : "false"} title="Committed changes only — base…tip, no working-tree edits"${_attr("disabled", loading)}>Committed</button>${_el_resume($scope0_id, "v")}<button type=button${_attr_class(["_eg", { ["_ef"]: uncommitted }])} aria-pressed=${uncommitted ? "true" : "false"} title="Include uncommitted and untracked files in the working tree"${_attr("disabled", loading)}>Working tree</button>${_el_resume($scope0_id, "w")}</div><button type=button${_attr_class([
9048
+ "_eh",
9049
+ "_dZ",
9050
+ { ["_ef"]: uncommitted }
9051
+ ])} aria-pressed=${uncommitted ? "true" : "false"} title=${uncommitted ? "\"Showing working tree — tap for committed only\"" : "\"Showing committed only — tap to include uncommitted\""}${_attr("disabled", loading)}>${uncommitted ? "Dirty" : "Clean"}${_el_resume($scope0_id, "y")}</button>${_el_resume($scope0_id, "x")}<div${_attr_class(["_d2", { ["_d1"]: !findOpen }])}>`);
9302
9052
  _set_serialize_reason(2);
9303
9053
  const $childScope3 = _peek_scope_id();
9304
9054
  diff_find_default({
@@ -9314,12 +9064,12 @@ var diff_view_default = _template("i", (input) => {
9314
9064
  }, "i23", $scope0_id)
9315
9065
  });
9316
9066
  _html(`</div>${_el_resume($scope0_id, "z")}<button${_attr_class([
9317
- diff_view_module_default.iconBtn,
9318
- diff_view_module_default.findBtn,
9319
- diff_view_module_default.toolCtrl
9067
+ iconBtn$3,
9068
+ "_d0",
9069
+ "_dZ"
9320
9070
  ])} title="Find in the review (⌘/Ctrl+F)" aria-label="Find in the review"${_attr("hidden", findOpen)}>`);
9321
9071
  icon_search_default({ size: 14 });
9322
- _html(`</button>${_el_resume($scope0_id, "a1")}</div>${_el_resume($scope0_id, "n")}</div>${_el_resume($scope0_id, "c")}<div${_attr_class(diff_view_module_default.diffMain)} data-diff-main>`);
9072
+ _html(`</button>${_el_resume($scope0_id, "a1")}</div>${_el_resume($scope0_id, "n")}</div>${_el_resume($scope0_id, "c")}<div${_attr_class("_d6")} data-diff-main>`);
9323
9073
  _if(() => {
9324
9074
  if (error) {
9325
9075
  const $scope14_id = _scope_id();
@@ -9342,7 +9092,7 @@ var diff_view_default = _template("i", (input) => {
9342
9092
  _if(() => {
9343
9093
  if (!repos && loading) {
9344
9094
  const $scope30_id = _scope_id();
9345
- _html(`<p${_attr_class(diff_view_module_default.centerPad)}>Loading diff…</p>`);
9095
+ _html(`<p${_attr_class("_eC")}>Loading diff…</p>`);
9346
9096
  writeScope($scope30_id, {});
9347
9097
  return 0;
9348
9098
  }
@@ -9411,7 +9161,7 @@ var diff_view_default = _template("i", (input) => {
9411
9161
  action: attrTag({ content: _content_resume("i41", () => {
9412
9162
  _scope_reason();
9413
9163
  const $scope17_id = _scope_id();
9414
- _html(`<button${_attr_class(ui_module_default.btn)}${_attr("disabled", loading)}>${loading ? "Reloading…" : "Reload"}${_el_resume($scope17_id, "b")}</button>${_el_resume($scope17_id, "a")}`);
9164
+ _html(`<button${_attr_class("_d")}${_attr("disabled", loading)}>${loading ? "Reloading…" : "Reload"}${_el_resume($scope17_id, "b")}</button>${_el_resume($scope17_id, "a")}`);
9415
9165
  _script($scope17_id, "i40");
9416
9166
  _subscribe($loading__closures, writeScope($scope17_id, { _: _scope_with_id($scope16_id) }));
9417
9167
  _resume_branch($scope17_id);
@@ -9419,13 +9169,13 @@ var diff_view_default = _template("i", (input) => {
9419
9169
  content: _content_resume("i42", () => {
9420
9170
  _scope_reason();
9421
9171
  const $scope28_id = _scope_id();
9422
- _html(`<span${_attr_class(ui_module_default.dim)}>`);
9172
+ _html(`<span${_attr_class("_l")}>`);
9423
9173
  _for_of(driftRepos, (repo, i) => {
9424
9174
  const $scope31_id = _scope_id();
9425
9175
  _html(`${i > 0 ? " · " : ""}${_el_resume($scope31_id, "a")}<!>${_escape(repo.worktree)}${_el_resume($scope31_id, "b")} #<!>${_escape(repo.pr.number)}${_el_resume($scope31_id, "c")}`);
9426
9176
  writeScope($scope31_id, {});
9427
9177
  }, "id", $scope28_id, "b");
9428
- _html(` — this view has a newer tip than the PR page.</span><span${_attr_class([ui_module_default.mono, diff_view_module_default.toastMeta])}>`);
9178
+ _html(` — this view has a newer tip than the PR page.</span><span${_attr_class(["_m", "_d7"])}>`);
9429
9179
  _for_of(driftRepos, (repo, i) => {
9430
9180
  const $scope32_id = _scope_id();
9431
9181
  _html(`<span${_attr("title", `origin/${repo.pr.headRefName} ${repo.head} · GitHub ${repo.pr.headRefOid}`)}>${i > 0 ? " · " : ""}${_el_resume($scope32_id, "b")}<!>${_escape(shortSha(repo.head))}${_el_resume($scope32_id, "c")} → <!>${_escape(shortSha(repo.pr.headRefOid))}${_el_resume($scope32_id, "d")}</span>${_el_resume($scope32_id, "a")}`);
@@ -9477,12 +9227,12 @@ var diff_view_default = _template("i", (input) => {
9477
9227
  _if(() => {
9478
9228
  if (repos && !allFiles.length) {
9479
9229
  const $scope26_id = _scope_id();
9480
- _html(`<p${_attr_class(diff_view_module_default.centerPad)}>${repoList.some((r) => r.pr) ? "No file changes on these PRs." : "No changes vs base."}${_el_resume($scope26_id, "b")}</p>`);
9230
+ _html(`<p${_attr_class("_eC")}>${repoList.some((r) => r.pr) ? "No file changes on these PRs." : "No changes vs base."}${_el_resume($scope26_id, "b")}</p>`);
9481
9231
  writeScope($scope26_id, {});
9482
9232
  return 0;
9483
9233
  } else if (repos && !shownFiles.length && !findState.hit) {
9484
9234
  const $scope18_id = _scope_id();
9485
- _html(`<p${_attr_class(diff_view_module_default.centerPad)}>${findState.query.trim() ? "No matches in diffs." : `No files match "${_escape(`${fileFilter}`)}".`}${_el_resume($scope18_id, "b")}</p>`);
9235
+ _html(`<p${_attr_class("_eC")}>${findState.query.trim() ? "No matches in diffs." : `No files match "${_escape(`${fileFilter}`)}".`}${_el_resume($scope18_id, "b")}</p>`);
9486
9236
  writeScope($scope18_id, {});
9487
9237
  return 1;
9488
9238
  }
@@ -9511,21 +9261,21 @@ var diff_view_default = _template("i", (input) => {
9511
9261
  _if(() => {
9512
9262
  if (repoFiles.length || repo.pr) {
9513
9263
  const $scope4_id = _scope_id();
9514
- _html(`<section${_attr_class(diff_view_module_default.repoSection)}${repo.pr ? _attr("data-pr", `${repo.worktree}/${repo.pr.number}`) : ""}${_attr("hidden", !shownInRepo.length && !repo.pr && findState.hit?.repo !== repo.id)}>`);
9264
+ _html(`<section${_attr_class("_ei")}${repo.pr ? _attr("data-pr", `${repo.worktree}/${repo.pr.number}`) : ""}${_attr("hidden", !shownInRepo.length && !repo.pr && findState.hit?.repo !== repo.id)}>`);
9515
9265
  _if(() => {
9516
9266
  if (repoList.length > 1) {
9517
9267
  const $scope5_id = _scope_id();
9518
9268
  const repoCollapsed = collapsedRepos.has(repo.id);
9519
9269
  const repoExpanding = expandingRepos.has(repo.id);
9520
- _html(`<button type=button${_attr_class([diff_view_module_default.repoSep, repoCollapsed && diff_view_module_default.repoSepCollapsed])} aria-expanded=${!repoCollapsed ? "true" : "false"} aria-busy=${repoExpanding ? "true" : "false"}${repoCollapsed ? _attr("title", `Show ${shownInRepo.length || repoFiles.length} files`) : " title=\"Hide files\""}><span${_attr_class([
9521
- diff_view_module_default.treeChev,
9522
- !repoCollapsed && diff_view_module_default.treeChevOpen,
9523
- repoExpanding && diff_view_module_default.treeChevBusy
9524
- ])} aria-hidden=true>${repoCollapsed ? "▸" : "▾"}${_el_resume($scope5_id, "c")}</span>${_el_resume($scope5_id, "b")}<span${_attr_class(diff_view_module_default.repoWorktree)}>${_escape(repo.worktree)}${_el_resume($scope5_id, "e")}</span>`);
9270
+ _html(`<button type=button${_attr_class(["_ej", repoCollapsed && "_ek"])} aria-expanded=${!repoCollapsed ? "true" : "false"} aria-busy=${repoExpanding ? "true" : "false"}${repoCollapsed ? _attr("title", `Show ${shownInRepo.length || repoFiles.length} files`) : " title=\"Hide files\""}><span${_attr_class([
9271
+ "_ex",
9272
+ !repoCollapsed && "_ey",
9273
+ repoExpanding && "_ez"
9274
+ ])} aria-hidden=true>${repoCollapsed ? "▸" : "▾"}${_el_resume($scope5_id, "c")}</span>${_el_resume($scope5_id, "b")}<span${_attr_class(repoWorktree)}>${_escape(repo.worktree)}${_el_resume($scope5_id, "e")}</span>`);
9525
9275
  _if(() => {
9526
9276
  if (repo.pr) {
9527
9277
  const $scope33_id = _scope_id();
9528
- _html(`<a${_attr_class([ui_module_default.chip, ui_module_default.pr])}${_attr("href", `${repo.pr.url}/files`)} target=_blank rel=noopener${_attr("title", `${repo.pr.title} — ${repo.pr.headRefName} ${repo.head} vs ${repo.base} ${repo.baseSha}`)}>#<!>${_escape(repo.pr.number)}${_el_resume($scope33_id, "b")}</a>${_el_resume($scope33_id, "a")}<span${_attr_class(diff_view_module_default.repoTitle)}>${_escape(repo.pr.title)}${_el_resume($scope33_id, "d")}</span>`);
9278
+ _html(`<a${_attr_class(["_h", "_j"])}${_attr("href", `${repo.pr.url}/files`)} target=_blank rel=noopener${_attr("title", `${repo.pr.title} — ${repo.pr.headRefName} ${repo.head} vs ${repo.base} ${repo.baseSha}`)}>#<!>${_escape(repo.pr.number)}${_el_resume($scope33_id, "b")}</a>${_el_resume($scope33_id, "a")}<span${_attr_class(repoTitle)}>${_escape(repo.pr.title)}${_el_resume($scope33_id, "d")}</span>`);
9529
9279
  _script($scope33_id, "i44");
9530
9280
  _subscribe($for_content__repo_baseSha__closures, _subscribe($for_content__repo_base__closures, _subscribe($for_content__repo_head__closures, _subscribe($for_content__repo_pr_headRefName__closures, _subscribe($for_content__repo_pr_title__closures, _subscribe($for_content__repo_pr_url__closures, _subscribe($for_content__repo_pr_number__closures, writeScope($scope33_id, {
9531
9281
  Ca4: 2,
@@ -9536,17 +9286,17 @@ var diff_view_default = _template("i", (input) => {
9536
9286
  return 0;
9537
9287
  } else {
9538
9288
  const $scope34_id = _scope_id();
9539
- _html(`<span${_attr_class(diff_view_module_default.repoTitle)}>${_escape(repo.full_name)}${_el_resume($scope34_id, "b")}</span>`);
9289
+ _html(`<span${_attr_class(repoTitle)}>${_escape(repo.full_name)}${_el_resume($scope34_id, "b")}</span>`);
9540
9290
  _subscribe($for_content__repo_full_name__closures, writeScope($scope34_id, {}));
9541
9291
  return 1;
9542
9292
  }
9543
9293
  }, $scope5_id, "f");
9544
- const compare = reviewCompareLabel(repo.pr?.baseRefName || repo.base, repo.pr?.headRefName || repo.branch, input.workspaceBranch || "");
9545
- _html(`<span${_attr_class(diff_view_module_default.compare)}${_attr("title", `${compare.title} · ${repo.head.slice(0, 7)}…${repo.baseSha.slice(0, 7)}`)}><span${_attr_class(diff_view_module_default.compareBase)}>${_escape(compare.base)}${_el_resume($scope5_id, "i")}</span><span${_attr_class(diff_view_module_default.compareVs)} aria-hidden=true>vs</span><span${_attr_class(diff_view_module_default.compareHead)}>${_escape(compare.head)}${_el_resume($scope5_id, "l")}</span>`);
9294
+ const compare$1 = reviewCompareLabel(repo.pr?.baseRefName || repo.base, repo.pr?.headRefName || repo.branch, input.workspaceBranch || "");
9295
+ _html(`<span${_attr_class("_ep")}${_attr("title", `${compare$1.title} · ${repo.head.slice(0, 7)}…${repo.baseSha.slice(0, 7)}`)}><span${_attr_class("_eq")}>${_escape(compare$1.base)}${_el_resume($scope5_id, "i")}</span><span${_attr_class("_es")} aria-hidden=true>vs</span><span${_attr_class("_er")}>${_escape(compare$1.head)}${_el_resume($scope5_id, "l")}</span>`);
9546
9296
  _if(() => {
9547
- if (compare.topic) {
9297
+ if (compare$1.topic) {
9548
9298
  const $scope36_id = _scope_id();
9549
- _html(`<span${_attr_class(diff_view_module_default.compareTopic)}>${_escape(compare.topic)}${_el_resume($scope36_id, "b")}</span>`);
9299
+ _html(`<span${_attr_class("_et")}>${_escape(compare$1.topic)}${_el_resume($scope36_id, "b")}</span>`);
9550
9300
  writeScope($scope36_id, {});
9551
9301
  return 0;
9552
9302
  }
@@ -9555,7 +9305,7 @@ var diff_view_default = _template("i", (input) => {
9555
9305
  _if(() => {
9556
9306
  if (localDifferIds.has(repo.id)) {
9557
9307
  const $scope6_id = _scope_id();
9558
- _html(`<span${_attr_class(ui_module_default.chip)}${_attr("title", `checked out ${repo.branch} ${repo.localHead}`)}>local <!>${_escape(shortBranch(repo.branch, input.workspaceBranch || ""))}${_el_resume($scope6_id, "b")}</span>${_el_resume($scope6_id, "a")}`);
9308
+ _html(`<span${_attr_class("_h")}${_attr("title", `checked out ${repo.branch} ${repo.localHead}`)}>local <!>${_escape(shortBranch(repo.branch, input.workspaceBranch || ""))}${_el_resume($scope6_id, "b")}</span>${_el_resume($scope6_id, "a")}`);
9559
9309
  _subscribe($for_content__repo_localHead__closures, _subscribe($for_content__repo_branch__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, writeScope($scope6_id, {
9560
9310
  Cdn: $si__input_workspaceBranch && 1,
9561
9311
  Caa: 1
@@ -9563,22 +9313,22 @@ var diff_view_default = _template("i", (input) => {
9563
9313
  return 0;
9564
9314
  }
9565
9315
  }, $scope5_id, "n", 1, 1, 1, 0, 1);
9566
- _html(`<span${_attr_class(diff_view_module_default.repoState)}>${_escape(shownInRepo.length || repoFiles.length)}${_el_resume($scope5_id, "p")} file<!>${(shownInRepo.length || repoFiles.length) === 1 ? "" : "s"}${_el_resume($scope5_id, "q")}</span></button>${_el_resume($scope5_id, "a")}`);
9316
+ _html(`<span${_attr_class("_em")}>${_escape(shownInRepo.length || repoFiles.length)}${_el_resume($scope5_id, "p")} file<!>${(shownInRepo.length || repoFiles.length) === 1 ? "" : "s"}${_el_resume($scope5_id, "q")}</span></button>${_el_resume($scope5_id, "a")}`);
9567
9317
  _script($scope5_id, "i45");
9568
9318
  _subscribe($for_content__shownInRepo_length__closures, _subscribe($for_content__repoFiles_length__closures, _subscribe($for_content__repo_branch__closures, _subscribe($for_content__repo_pr_baseRefName__closures, _subscribe($for_content__repo_baseSha__closures, _subscribe($for_content__repo_base__closures, _subscribe($for_content__repo_head__closures, _subscribe($for_content__repo_pr_headRefName__closures, _subscribe($for_content__repo_worktree__closures, _subscribe($for_content__repo_pr__closures, _subscribe($for_content__repo_id__closures, _subscribe($localDifferIds__closures, _subscribe($expandingRepos__closures, _subscribe($collapsedRepos__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, writeScope($scope5_id, {
9569
9319
  r: repoCollapsed,
9570
9320
  t: repoExpanding,
9571
- a0: compare?.topic,
9321
+ a0: compare$1?.topic,
9572
9322
  Cdy: 1
9573
9323
  }))))))))))))))));
9574
9324
  return 0;
9575
9325
  } else {
9576
9326
  const $scope7_id = _scope_id();
9577
- _html(`<p${_attr_class(diff_view_module_default.repoMeta)}>`);
9327
+ _html(`<p${_attr_class("_eo")}>`);
9578
9328
  _if(() => {
9579
9329
  if (repo.pr) {
9580
9330
  const $scope35_id = _scope_id();
9581
- _html(`<a${_attr_class([ui_module_default.chip, ui_module_default.pr])}${_attr("href", `${repo.pr.url}/files`)} target=_blank rel=noopener${_attr("title", `${repo.pr.title} — ${repo.pr.headRefName} ${repo.head} vs ${repo.base} ${repo.baseSha}`)}>#<!>${_escape(repo.pr.number)}${_el_resume($scope35_id, "b")}</a>${_el_resume($scope35_id, "a")}<span${_attr_class(ui_module_default.dim)}>${_escape(repo.pr.title)}${_el_resume($scope35_id, "d")}</span>`);
9331
+ _html(`<a${_attr_class(["_h", "_j"])}${_attr("href", `${repo.pr.url}/files`)} target=_blank rel=noopener${_attr("title", `${repo.pr.title} — ${repo.pr.headRefName} ${repo.head} vs ${repo.base} ${repo.baseSha}`)}>#<!>${_escape(repo.pr.number)}${_el_resume($scope35_id, "b")}</a>${_el_resume($scope35_id, "a")}<span${_attr_class("_l")}>${_escape(repo.pr.title)}${_el_resume($scope35_id, "d")}</span>`);
9582
9332
  _subscribe($for_content__repo_baseSha__closures, _subscribe($for_content__repo_base__closures, _subscribe($for_content__repo_head__closures, _subscribe($for_content__repo_pr_headRefName__closures, _subscribe($for_content__repo_pr_title__closures, _subscribe($for_content__repo_pr_url__closures, _subscribe($for_content__repo_pr_number__closures, writeScope($scope35_id, {
9583
9333
  Ca1: 1,
9584
9334
  Ca2: 1,
@@ -9591,12 +9341,12 @@ var diff_view_default = _template("i", (input) => {
9591
9341
  return 0;
9592
9342
  }
9593
9343
  }, $scope7_id, "b");
9594
- const compare = reviewCompareLabel(repo.pr?.baseRefName || repo.base, repo.pr?.headRefName || repo.branch, input.workspaceBranch || "");
9595
- _html(`<span${_attr_class(diff_view_module_default.compare)}${_attr("title", `${compare.title} · ${repo.head.slice(0, 7)}…${repo.baseSha.slice(0, 7)}`)}><span${_attr_class(diff_view_module_default.compareBase)}>${_escape(compare.base)}${_el_resume($scope7_id, "e")}</span><span${_attr_class(diff_view_module_default.compareVs)} aria-hidden=true>vs</span><span${_attr_class(diff_view_module_default.compareHead)}>${_escape(compare.head)}${_el_resume($scope7_id, "h")}</span>`);
9344
+ const compare$2 = reviewCompareLabel(repo.pr?.baseRefName || repo.base, repo.pr?.headRefName || repo.branch, input.workspaceBranch || "");
9345
+ _html(`<span${_attr_class("_ep")}${_attr("title", `${compare$2.title} · ${repo.head.slice(0, 7)}…${repo.baseSha.slice(0, 7)}`)}><span${_attr_class("_eq")}>${_escape(compare$2.base)}${_el_resume($scope7_id, "e")}</span><span${_attr_class("_es")} aria-hidden=true>vs</span><span${_attr_class("_er")}>${_escape(compare$2.head)}${_el_resume($scope7_id, "h")}</span>`);
9596
9346
  _if(() => {
9597
- if (compare.topic) {
9347
+ if (compare$2.topic) {
9598
9348
  const $scope37_id = _scope_id();
9599
- _html(`<span${_attr_class(diff_view_module_default.compareTopic)}>${_escape(compare.topic)}${_el_resume($scope37_id, "b")}</span>`);
9349
+ _html(`<span${_attr_class("_et")}>${_escape(compare$2.topic)}${_el_resume($scope37_id, "b")}</span>`);
9600
9350
  writeScope($scope37_id, {});
9601
9351
  return 0;
9602
9352
  }
@@ -9605,7 +9355,7 @@ var diff_view_default = _template("i", (input) => {
9605
9355
  _if(() => {
9606
9356
  if (localDifferIds.has(repo.id)) {
9607
9357
  const $scope8_id = _scope_id();
9608
- _html(`<span${_attr_class(ui_module_default.chip)}${_attr("title", `checked out ${repo.branch} ${repo.localHead}`)}>local <!>${_escape(shortBranch(repo.branch, input.workspaceBranch || ""))}${_el_resume($scope8_id, "b")}</span>${_el_resume($scope8_id, "a")}`);
9358
+ _html(`<span${_attr_class("_h")}${_attr("title", `checked out ${repo.branch} ${repo.localHead}`)}>local <!>${_escape(shortBranch(repo.branch, input.workspaceBranch || ""))}${_el_resume($scope8_id, "b")}</span>${_el_resume($scope8_id, "a")}`);
9609
9359
  _subscribe($for_content__repo_localHead__closures, _subscribe($for_content__repo_branch__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, writeScope($scope8_id, {
9610
9360
  Cdn: $si__input_workspaceBranch && 3,
9611
9361
  Caa: 3,
@@ -9616,7 +9366,7 @@ var diff_view_default = _template("i", (input) => {
9616
9366
  }, $scope7_id, "j", 1, 1, 1, 0, 1);
9617
9367
  _html("</p>");
9618
9368
  _subscribe($for_content__repo_branch__closures, _subscribe($for_content__repo_pr_baseRefName__closures, _subscribe($for_content__repo_baseSha__closures, _subscribe($for_content__repo_base__closures, _subscribe($for_content__repo_head__closures, _subscribe($for_content__repo_pr_headRefName__closures, _subscribe($for_content__repo_pr__closures, _subscribe($for_content__repo_id__closures, _subscribe($localDifferIds__closures, _subscribe($si__input_workspaceBranch && $input_workspaceBranch__closures, writeScope($scope7_id, {
9619
- p: compare?.topic,
9369
+ p: compare$2?.topic,
9620
9370
  Cdn: $si__input_workspaceBranch && 2,
9621
9371
  Cea: 1,
9622
9372
  Cy: 1,
@@ -9636,48 +9386,48 @@ var diff_view_default = _template("i", (input) => {
9636
9386
  const $scope9_id = _scope_id();
9637
9387
  const $show = repoList.length === 1 || !collapsedRepos.has(repo.id);
9638
9388
  _show_start($show);
9639
- _html(`<div${_attr_class(diff_view_module_default.files)}>`);
9640
- _for_of(repoFiles, (file) => {
9389
+ _html(`<div${_attr_class("_eu")}>`);
9390
+ _for_of(repoFiles, (file$2) => {
9641
9391
  const $scope10_id = _scope_id();
9642
9392
  const $for_content2__file__closures = /* @__PURE__ */ new Set();
9643
9393
  const $for_content2__file_key__closures = /* @__PURE__ */ new Set();
9644
9394
  const $for_content2__fileComments__closures = /* @__PURE__ */ new Set();
9645
- const fileComments = commentsByFile.get(file.key) || [];
9395
+ const fileComments = commentsByFile.get(file$2.key) || [];
9646
9396
  let expanded = true;
9647
- _html(`<details${_attr_details_or_dialog_open($scope10_id, "a", expanded)}${_attr_class([diff_view_module_default.file, findState.hit?.key === file.key && diff_view_module_default.fileFindActive])}${_attr("data-key", file.key)}${_attr("hidden", !shownKeySet.has(file.key))}><summary><span${_attr_class(diff_view_module_default.status)}${_attr("data-status", file.status)}>${_escape(file.status)}${_el_resume($scope10_id, "c")}</span>${_el_resume($scope10_id, "b")}<span${_attr_class([diff_view_module_default.path, findState.hit?.key === file.key && findState.hit.line < 1 && diff_view_module_default.pathFindActive])}${_attr("title", file.path)}><bdi>${_escape(file.path)}${_el_resume($scope10_id, "e")}</bdi></span>${_el_resume($scope10_id, "d")}`);
9397
+ _html(`<details${_attr_details_or_dialog_open($scope10_id, "a", expanded)}${_attr_class(["_ev", findState.hit?.key === file$2.key && "_d4"])}${_attr("data-key", file$2.key)}${_attr("hidden", !shownKeySet.has(file$2.key))}><summary><span${_attr_class("_eA")}${_attr("data-status", file$2.status)}>${_escape(file$2.status)}${_el_resume($scope10_id, "c")}</span>${_el_resume($scope10_id, "b")}<span${_attr_class(["_eB", findState.hit?.key === file$2.key && findState.hit.line < 1 && "_d5"])}${_attr("title", file$2.path)}><bdi>${_escape(file$2.path)}${_el_resume($scope10_id, "e")}</bdi></span>${_el_resume($scope10_id, "d")}`);
9648
9398
  _if(() => {
9649
9399
  if (fileComments.length) {
9650
9400
  const $scope38_id = _scope_id();
9651
- _html(`<span${_attr_class(ui_module_default.chip)}>💬 <!>${_escape(fileComments.length)}${_el_resume($scope38_id, "b")}</span>`);
9401
+ _html(`<span${_attr_class("_h")}>💬 <!>${_escape(fileComments.length)}${_el_resume($scope38_id, "b")}</span>`);
9652
9402
  writeScope($scope38_id, {});
9653
9403
  return 0;
9654
9404
  }
9655
9405
  }, $scope10_id, "f", 1, 1, 1, 0, 1);
9656
9406
  _html("</summary>");
9657
9407
  _if(() => {
9658
- if (file.binary) {
9408
+ if (file$2.binary) {
9659
9409
  const $scope39_id = _scope_id();
9660
- _html(`<p${_attr_class(diff_view_module_default.diffPad)}>binary file</p>`);
9410
+ _html(`<p${_attr_class("_eE")}>binary file</p>`);
9661
9411
  writeScope($scope39_id, {});
9662
9412
  return 0;
9663
- } else if (file.tooLarge) {
9413
+ } else if (file$2.tooLarge) {
9664
9414
  const $scope40_id = _scope_id();
9665
- _html(`<p${_attr_class(diff_view_module_default.diffPad)}>file too large to display</p>`);
9415
+ _html(`<p${_attr_class("_eE")}>file too large to display</p>`);
9666
9416
  writeScope($scope40_id, {});
9667
9417
  return 1;
9668
- } else if (file.old == null && file.new == null) {
9418
+ } else if (file$2.old == null && file$2.new == null) {
9669
9419
  const $scope41_id = _scope_id();
9670
- _html(`<p${_attr_class(diff_view_module_default.diffPad)}>file could not be read</p>`);
9420
+ _html(`<p${_attr_class("_eE")}>file could not be read</p>`);
9671
9421
  writeScope($scope41_id, {});
9672
9422
  return 2;
9673
9423
  } else {
9674
9424
  const $scope11_id = _scope_id();
9675
9425
  let near = false;
9676
- const forceNear = findState.hit?.key === file.key;
9426
+ const forceNear = findState.hit?.key === file$2.key;
9677
9427
  _if(() => {
9678
9428
  if (!forceNear) {
9679
9429
  const $scope25_id = _scope_id();
9680
- _html(`<div${_attr_class(diff_view_module_default.diffWait)}></div>${_el_resume($scope25_id, "a")}`);
9430
+ _html(`<div${_attr_class("_ew")}></div>${_el_resume($scope25_id, "a")}`);
9681
9431
  _script($scope25_id, "i46");
9682
9432
  writeScope($scope25_id, {});
9683
9433
  return 0;
@@ -9685,23 +9435,23 @@ var diff_view_default = _template("i", (input) => {
9685
9435
  const $scope12_id = _scope_id();
9686
9436
  const $childScope8 = _peek_scope_id();
9687
9437
  diff_file_default({
9688
- file,
9438
+ file: file$2,
9689
9439
  comments: fileComments,
9690
- draft: draft && draft.key === file.key ? draft : null,
9440
+ draft: draft && draft.key === file$2.key ? draft : null,
9691
9441
  sessions: input.sessions || [],
9692
9442
  onSelect: _resume(function(range) {
9693
9443
  draft = {
9694
- key: file.key,
9444
+ key: file$2.key,
9695
9445
  side: range.side || "additions",
9696
9446
  start: Math.min(range.start, range.end),
9697
9447
  end: Math.max(range.start, range.end)
9698
9448
  };
9699
9449
  }, "i26", $scope12_id),
9700
9450
  onSaveComment: _resume(function(text) {
9701
- saveComment(file, text);
9451
+ saveComment(file$2, text);
9702
9452
  }, "i27", $scope12_id),
9703
9453
  onSendDraft: _resume(function(text, sessionId) {
9704
- sendDraftComment(file, text, sessionId);
9454
+ sendDraftComment(file$2, text, sessionId);
9705
9455
  }, "i28", $scope12_id),
9706
9456
  onCancelDraft: _resume(function() {
9707
9457
  draft = null;
@@ -9731,12 +9481,12 @@ var diff_view_default = _template("i", (input) => {
9731
9481
  _html(`</details>${_el_resume($scope10_id, "a")}`);
9732
9482
  _script($scope10_id, "i47");
9733
9483
  _subscribe($commentsByFile__closures, _subscribe($shownKeySet__closures, _subscribe($findState_hit_line__closures, _subscribe($findState_hit_key__closures, writeScope($scope10_id, {
9734
- i: file,
9735
- j: file?.key,
9736
- q: file?.binary,
9737
- r: file?.tooLarge,
9738
- s: file?.old,
9739
- t: file?.new,
9484
+ i: file$2,
9485
+ j: file$2?.key,
9486
+ q: file$2?.binary,
9487
+ r: file$2?.tooLarge,
9488
+ s: file$2?.old,
9489
+ t: file$2?.new,
9740
9490
  u: fileComments,
9741
9491
  v: fileComments.length,
9742
9492
  w: expanded,
@@ -9931,39 +9681,12 @@ var diff_view_default = _template("i", (input) => {
9931
9681
  });
9932
9682
  _resume_branch($scope0_id);
9933
9683
  });
9934
- var manage_workspace_module_default = {
9935
- content: "_cl _bE",
9936
- pageMeta: "_cm _bI",
9937
- wsLabel: "_cn",
9938
- metaSep: "_co",
9939
- pathMeta: "_cp",
9940
- statusPill: "_cq",
9941
- statusOff: "_cr",
9942
- progress: "_cs",
9943
- section: "_ct",
9944
- sectionHead: "_cu",
9945
- sectionCount: "_cv",
9946
- pickerWrap: "_cw",
9947
- cardList: "_cx",
9948
- card: "_cy",
9949
- pending: "_cz",
9950
- cardMain: "_cA",
9951
- cardTitle: "_cB",
9952
- cardMeta: "_cC",
9953
- cardSub: "_cD",
9954
- cardTag: "_cE",
9955
- cardAction: "_cF",
9956
- dangerAction: "_cG",
9957
- armed: "_cH",
9958
- portLink: "_cI",
9959
- emptyNote: "_cJ",
9960
- dangerZone: "_cK",
9961
- dangerRow: "_cL",
9962
- dangerBtn: "_cM",
9963
- dangerHint: "_cN",
9964
- iconBtn: "_cO _ez",
9965
- spinning: "_cP _eA"
9966
- };
9684
+ //#endregion
9685
+ //#region src/tags/manage-workspace.css.ts
9686
+ var content$1 = "_cF _A";
9687
+ var pageMeta = "_cG _E";
9688
+ var iconBtn$1 = "_c8 _G";
9689
+ var spinning$1 = "_c9 _H";
9967
9690
  //#endregion
9968
9691
  //#region src/tags/manage-workspace.marko
9969
9692
  var api$3;
@@ -10057,16 +9780,16 @@ var manage_workspace_default = _template("k", (input) => {
10057
9780
  setTimeout(() => loadProcs(void 0), 500);
10058
9781
  }, "k5", $scope0_id);
10059
9782
  const titleId = _id();
10060
- _html(`<div${_attr_class(page_shell_module_default.page)} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class(page_shell_module_default.body)}><div${_attr_class(manage_workspace_module_default.content)}><header${_attr_class(page_shell_module_default.pageHead)}><div${_attr_class(page_shell_module_default.pageHeadText)}><h1${_attr("id", titleId)}>Manage</h1><p${_attr_class(manage_workspace_module_default.pageMeta)}${_attr("title", ws.display_path || ws.path)}><span${_attr_class(manage_workspace_module_default.wsLabel)}>${_escape(ws.name)}${_el_resume($scope0_id, "i")}</span>`);
9783
+ _html(`<div${_attr_class("_y")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_z")}><div${_attr_class(content$1)}><header${_attr_class("_C")}><div${_attr_class("_D")}><h1${_attr("id", titleId)}>Manage</h1><p${_attr_class(pageMeta)}${_attr("title", ws.display_path || ws.path)}><span${_attr_class("_cH")}>${_escape(ws.name)}${_el_resume($scope0_id, "i")}</span>`);
10061
9784
  _if(() => {
10062
9785
  if (ws.status !== "active") {
10063
9786
  const $scope10_id = _scope_id();
10064
- _html(`<span${_attr_class([manage_workspace_module_default.statusPill, manage_workspace_module_default.statusOff])}>Archived</span>`);
9787
+ _html(`<span${_attr_class(["_cK", "_cL"])}>Archived</span>`);
10065
9788
  writeScope($scope10_id, {});
10066
9789
  return 0;
10067
9790
  }
10068
9791
  }, $scope0_id, "j", 1, 1, 1, 0, 1);
10069
- _html(`<span${_attr_class(manage_workspace_module_default.metaSep)} aria-hidden=true>·</span><span${_attr_class([manage_workspace_module_default.pathMeta, ui_module_default.mono])}>${_escape(ws.display_path || ws.path)}${_el_resume($scope0_id, "m")}</span></p>${_el_resume($scope0_id, "g")}</div></header>`);
9792
+ _html(`<span${_attr_class("_cI")} aria-hidden=true>·</span><span${_attr_class(["_cJ", "_m"])}>${_escape(ws.display_path || ws.path)}${_el_resume($scope0_id, "m")}</span></p>${_el_resume($scope0_id, "g")}</div></header>`);
10070
9793
  _if(() => {
10071
9794
  if (error) {
10072
9795
  const $scope2_id = _scope_id();
@@ -10090,21 +9813,21 @@ var manage_workspace_default = _template("k", (input) => {
10090
9813
  _if(() => {
10091
9814
  if (pendingAction && actionStep) {
10092
9815
  const $scope7_id = _scope_id();
10093
- _html(`<p${_attr_class(manage_workspace_module_default.progress)}><span${_attr_class(ui_module_default.spin)}></span><!>${_escape(actionStep)}${_el_resume($scope7_id, "c")}</p>`);
9816
+ _html(`<p${_attr_class("_cM")}><span${_attr_class("_w")}></span><!>${_escape(actionStep)}${_el_resume($scope7_id, "c")}</p>`);
10094
9817
  writeScope($scope7_id, {});
10095
9818
  return 0;
10096
9819
  }
10097
9820
  }, $scope0_id, "o", 1, 1, 1, 0, 1);
10098
- _html(`<section${_attr_class(manage_workspace_module_default.section)}><div${_attr_class(manage_workspace_module_default.sectionHead)}><h2>Repos</h2><span${_attr_class(manage_workspace_module_default.sectionCount)}>${_escape(ws.repos.length)}${_el_resume($scope0_id, "s")}</span><div${_attr_class(ui_module_default.spacer)}></div><button${_attr_class([manage_workspace_module_default.iconBtn, { [manage_workspace_module_default.spinning]: catalogRefreshing }])} title="Refresh repo list" aria-label="Refresh repo list"${_attr("disabled", catalogRefreshing)}>`);
9821
+ _html(`<section${_attr_class("_cN")}><div${_attr_class("_cO")}><h2>Repos</h2><span${_attr_class("_cP")}>${_escape(ws.repos.length)}${_el_resume($scope0_id, "s")}</span><div${_attr_class("_n")}></div><button${_attr_class([iconBtn$1, { [spinning$1]: catalogRefreshing }])} title="Refresh repo list" aria-label="Refresh repo list"${_attr("disabled", catalogRefreshing)}>`);
10099
9822
  icon_refresh_default({ size: 14 });
10100
- _html(`</button>${_el_resume($scope0_id, "u")}</div><ul${_attr_class(manage_workspace_module_default.cardList)}>`);
9823
+ _html(`</button>${_el_resume($scope0_id, "u")}</div><ul${_attr_class("_cR")}>`);
10101
9824
  _for_of(ws.repos, (row) => {
10102
9825
  const $scope1_id = _scope_id();
10103
- _html(`<li${_attr_class(manage_workspace_module_default.card)}><div${_attr_class(manage_workspace_module_default.cardMain)}><span${_attr_class([manage_workspace_module_default.cardTitle, ui_module_default.mono])}>${_escape(row.worktree)}${_el_resume($scope1_id, "d")}/</span><span${_attr_class(manage_workspace_module_default.cardMeta)}><span${_attr_class(manage_workspace_module_default.cardSub)}>${_escape(row.full_name)}${_el_resume($scope1_id, "g")}</span>`);
9826
+ _html(`<li${_attr_class("_cT")}><div${_attr_class("_cU")}><span${_attr_class(["_cV", "_m"])}>${_escape(row.worktree)}${_el_resume($scope1_id, "d")}/</span><span${_attr_class("_cW")}><span${_attr_class("_cX")}>${_escape(row.full_name)}${_el_resume($scope1_id, "g")}</span>`);
10104
9827
  _if(() => {
10105
9828
  if (row.base_branch !== row.default_branch) {
10106
9829
  const $scope11_id = _scope_id();
10107
- _html(`<span${_attr_class([manage_workspace_module_default.cardTag, ui_module_default.mono])} title="Base branch">⎇ <!>${_escape(row.base_branch)}${_el_resume($scope11_id, "b")}</span>`);
9830
+ _html(`<span${_attr_class(["_cY", "_m"])} title="Base branch">⎇ <!>${_escape(row.base_branch)}${_el_resume($scope11_id, "b")}</span>`);
10108
9831
  writeScope($scope11_id, {});
10109
9832
  return 0;
10110
9833
  }
@@ -10113,15 +9836,15 @@ var manage_workspace_default = _template("k", (input) => {
10113
9836
  _if(() => {
10114
9837
  if (busy.has(row.full_name)) {
10115
9838
  const $scope12_id = _scope_id();
10116
- _html(`<span${_attr_class(ui_module_default.spin)}></span>`);
9839
+ _html(`<span${_attr_class("_w")}></span>`);
10117
9840
  writeScope($scope12_id, {});
10118
9841
  return 0;
10119
9842
  } else {
10120
9843
  const $scope6_id = _scope_id();
10121
9844
  _html(`<button${_attr_class([
10122
- manage_workspace_module_default.cardAction,
10123
- manage_workspace_module_default.dangerAction,
10124
- { [manage_workspace_module_default.armed]: confirmingRemove === row.full_name }
9845
+ "_cZ",
9846
+ "_c1",
9847
+ { ["_c0"]: confirmingRemove === row.full_name }
10125
9848
  ])}${confirmingRemove === row.full_name ? _attr("title", `Really remove ${row.worktree}/? Uncommitted changes are lost.`) : _attr("title", `Remove ${row.worktree}/`)}>${confirmingRemove === row.full_name ? "Remove?" : "×"}${_el_resume($scope6_id, "b")}</button>${_el_resume($scope6_id, "a")}`);
10126
9849
  _script($scope6_id, "k11");
10127
9850
  _subscribe($confirmingRemove__closures, writeScope($scope6_id, {}));
@@ -10138,19 +9861,19 @@ var manage_workspace_default = _template("k", (input) => {
10138
9861
  }, "full_name", $scope0_id, "x", 1, 1, 1, 0, 1);
10139
9862
  _for_of([...busy].filter((n) => !inWorkspace.has(n)), (name) => {
10140
9863
  const $scope13_id = _scope_id();
10141
- _html(`<li${_attr_class([manage_workspace_module_default.card, manage_workspace_module_default.pending])}><span${_attr_class(ui_module_default.spin)}></span><div${_attr_class(manage_workspace_module_default.cardMain)}><span${_attr_class(manage_workspace_module_default.cardSub)}>Adding <!>${_escape(name)}${_el_resume($scope13_id, "e")}…</span></div></li>`);
9864
+ _html(`<li${_attr_class(["_cT", "_cS"])}><span${_attr_class("_w")}></span><div${_attr_class("_cU")}><span${_attr_class("_cX")}>Adding <!>${_escape(name)}${_el_resume($scope13_id, "e")}…</span></div></li>`);
10142
9865
  writeScope($scope13_id, {});
10143
9866
  }, (n) => n, $scope0_id, "y", 1, 1, 1, 0, 1);
10144
9867
  _html("</ul>");
10145
9868
  _if(() => {
10146
9869
  if (!ws.repos.length && !busy.size) {
10147
9870
  const $scope14_id = _scope_id();
10148
- _html(`<p${_attr_class(manage_workspace_module_default.emptyNote)}>No repos yet — search below to add one.</p>`);
9871
+ _html(`<p${_attr_class("_c3")}>No repos yet — search below to add one.</p>`);
10149
9872
  writeScope($scope14_id, {});
10150
9873
  return 0;
10151
9874
  }
10152
9875
  }, $scope0_id, "z", 1, 1, 1, 0, 1);
10153
- _html(`<div${_attr_class(manage_workspace_module_default.pickerWrap)}>`);
9876
+ _html(`<div${_attr_class("_cQ")}>`);
10154
9877
  const $childScope = _peek_scope_id();
10155
9878
  let refreshCatalog = repo_picker_default({
10156
9879
  exclude: inWorkspace,
@@ -10170,17 +9893,17 @@ var manage_workspace_default = _template("k", (input) => {
10170
9893
  _if(() => {
10171
9894
  if (running.length) {
10172
9895
  const $scope8_id = _scope_id();
10173
- _html(`<section${_attr_class(manage_workspace_module_default.section)}><div${_attr_class(manage_workspace_module_default.sectionHead)}><h2>Running</h2><span${_attr_class(manage_workspace_module_default.sectionCount)}>${_escape(running.length)}${_el_resume($scope8_id, "d")}</span></div><ul${_attr_class(manage_workspace_module_default.cardList)}>`);
9896
+ _html(`<section${_attr_class("_cN")}><div${_attr_class("_cO")}><h2>Running</h2><span${_attr_class("_cP")}>${_escape(running.length)}${_el_resume($scope8_id, "d")}</span></div><ul${_attr_class("_cR")}>`);
10174
9897
  _for_of(running, (p) => {
10175
9898
  const $scope9_id = _scope_id();
10176
- _html(`<li${_attr_class(manage_workspace_module_default.card)}><div${_attr_class(manage_workspace_module_default.cardMain)}${_attr("title", p.args)}><span${_attr_class([manage_workspace_module_default.cardTitle, ui_module_default.mono])}>${_escape(p.cmd)}${_el_resume($scope9_id, "d")}</span>`);
9899
+ _html(`<li${_attr_class("_cT")}><div${_attr_class("_cU")}${_attr("title", p.args)}><span${_attr_class(["_cV", "_m"])}>${_escape(p.cmd)}${_el_resume($scope9_id, "d")}</span>`);
10177
9900
  _if(() => {
10178
9901
  if (p.ports.length) {
10179
9902
  const $scope15_id = _scope_id();
10180
- _html(`<span${_attr_class(manage_workspace_module_default.cardMeta)}>`);
9903
+ _html(`<span${_attr_class("_cW")}>`);
10181
9904
  _for_of(p.ports, (port) => {
10182
9905
  const $scope16_id = _scope_id();
10183
- _html(`<button${_attr_class([ui_module_default.chip, manage_workspace_module_default.portLink])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${port}`)}>:<!>${_escape(port)}${_el_resume($scope16_id, "b")}</button>${_el_resume($scope16_id, "a")}`);
9906
+ _html(`<button${_attr_class(["_h", "_c2"])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${port}`)}>:<!>${_escape(port)}${_el_resume($scope16_id, "b")}</button>${_el_resume($scope16_id, "a")}`);
10184
9907
  _script($scope16_id, "k13");
10185
9908
  writeScope($scope16_id, { d: port });
10186
9909
  }, (x) => String(x), $scope15_id, "a", 1, 1, 1, "</span>", 1);
@@ -10188,7 +9911,7 @@ var manage_workspace_default = _template("k", (input) => {
10188
9911
  return 0;
10189
9912
  }
10190
9913
  }, $scope9_id, "e", 1, 1, 1, 0, 1);
10191
- _html(`</div>${_el_resume($scope9_id, "b")}<button${_attr_class([manage_workspace_module_default.cardAction, manage_workspace_module_default.dangerAction])} type=button${_attr("title", `Kill ${p.pid}`)}${_attr("aria-label", `Kill process ${p.pid}`)}>×</button>${_el_resume($scope9_id, "f")}</li>`);
9914
+ _html(`</div>${_el_resume($scope9_id, "b")}<button${_attr_class(["_cZ", "_c1"])} type=button${_attr("title", `Kill ${p.pid}`)}${_attr("aria-label", `Kill process ${p.pid}`)}>×</button>${_el_resume($scope9_id, "f")}</li>`);
10192
9915
  _script($scope9_id, "k14");
10193
9916
  writeScope($scope9_id, {
10194
9917
  k: p?.ports,
@@ -10200,28 +9923,28 @@ var manage_workspace_default = _template("k", (input) => {
10200
9923
  return 0;
10201
9924
  }
10202
9925
  }, $scope0_id, "a3", 1, 1, 1, 0, 1);
10203
- _html(`<section${_attr_class([manage_workspace_module_default.section, manage_workspace_module_default.dangerZone])}><div${_attr_class(manage_workspace_module_default.sectionHead)}><h2>Workspace</h2></div><div${_attr_class(manage_workspace_module_default.dangerRow)}>`);
9926
+ _html(`<section${_attr_class(["_cN", "_c4"])}><div${_attr_class("_cO")}><h2>Workspace</h2></div><div${_attr_class("_c5")}>`);
10204
9927
  _if(() => {
10205
9928
  if (ws.status === "active") {
10206
9929
  const $scope4_id = _scope_id();
10207
- _html(`<button type=button${_attr_class([ui_module_default.btn, manage_workspace_module_default.dangerBtn])}${_attr("disabled", !!pendingAction)}>${pendingAction === "archive" ? "Archiving…" : "Archive"}${_el_resume($scope4_id, "b")}</button>${_el_resume($scope4_id, "a")}`);
9930
+ _html(`<button type=button${_attr_class(["_d", "_c6"])}${_attr("disabled", !!pendingAction)}>${pendingAction === "archive" ? "Archiving…" : "Archive"}${_el_resume($scope4_id, "b")}</button>${_el_resume($scope4_id, "a")}`);
10208
9931
  _script($scope4_id, "k15");
10209
9932
  writeScope($scope4_id, {});
10210
9933
  return 0;
10211
9934
  } else {
10212
9935
  const $scope5_id = _scope_id();
10213
- _html(`<button type=button${_attr_class([ui_module_default.btn, manage_workspace_module_default.dangerBtn])}${_attr("disabled", !!pendingAction)}>Restore</button>${_el_resume($scope5_id, "a")}`);
9936
+ _html(`<button type=button${_attr_class(["_d", "_c6"])}${_attr("disabled", !!pendingAction)}>Restore</button>${_el_resume($scope5_id, "a")}`);
10214
9937
  _script($scope5_id, "k16");
10215
9938
  writeScope($scope5_id, {});
10216
9939
  return 1;
10217
9940
  }
10218
9941
  }, $scope0_id, "a7", 1, 1, 1, 0, 1);
10219
9942
  _html(`<button type=button${_attr_class([
10220
- ui_module_default.btn,
10221
- ui_module_default.danger,
10222
- manage_workspace_module_default.dangerBtn,
10223
- { [ui_module_default.armed]: confirmingDelete }
10224
- ])}${_attr("disabled", !!pendingAction)}>${pendingAction === "delete" ? "Deleting…" : "Delete"}${_el_resume($scope0_id, "a9")}</button>${_el_resume($scope0_id, "a8")}</div><p${_attr_class(manage_workspace_module_default.dangerHint)}>Archive hides the space from the list. Delete removes it and its worktrees.</p></section></div></div></div>`);
9943
+ "_d",
9944
+ "_g",
9945
+ "_c6",
9946
+ { ["_f"]: confirmingDelete }
9947
+ ])}${_attr("disabled", !!pendingAction)}>${pendingAction === "delete" ? "Deleting…" : "Delete"}${_el_resume($scope0_id, "a9")}</button>${_el_resume($scope0_id, "a8")}</div><p${_attr_class("_c7")}>Archive hides the space from the list. Delete removes it and its worktrees.</p></section></div></div></div>`);
10225
9948
  _script($scope0_id, "k17");
10226
9949
  _script($scope0_id, "k18");
10227
9950
  writeScope($scope0_id, {
@@ -10255,34 +9978,11 @@ var manage_workspace_default = _template("k", (input) => {
10255
9978
  });
10256
9979
  _resume_branch($scope0_id);
10257
9980
  });
10258
- var usage_stats_module_default = {
10259
- content: "_bK _bK _bF",
10260
- iconBtn: "_bL _ez",
10261
- spinning: "_bM _eA",
10262
- refreshBtn: "_bN",
10263
- note: "_bO",
10264
- usageList: "_bP",
10265
- usageRow: "_bQ",
10266
- usageName: "_bR",
10267
- plan: "_bS",
10268
- usageStale: "_bT",
10269
- stale: "_bU",
10270
- usageMeters: "_bV",
10271
- meter: "_bW",
10272
- meterLabel: "_bX",
10273
- meterTrack: "_bY",
10274
- meterFill: "_bZ",
10275
- fillOk: "_b0",
10276
- fillMid: "_b1",
10277
- fillWarm: "_b2",
10278
- fillHot: "_b3",
10279
- meterPct: "_b4",
10280
- pctOk: "_b5",
10281
- pctMid: "_b6",
10282
- pctWarm: "_b7",
10283
- pctHot: "_b8",
10284
- meterReset: "_b9"
10285
- };
9981
+ //#endregion
9982
+ //#region src/tags/usage-stats.css.ts
9983
+ var content = "_bY _A _B";
9984
+ var iconBtn = "_bZ _G";
9985
+ var spinning = "_b0 _H";
10286
9986
  //#endregion
10287
9987
  //#region src/tags/usage-stats.marko
10288
9988
  var api$2;
@@ -10317,34 +10017,34 @@ var usage_stats_default = _template("x", (input) => {
10317
10017
  refreshing = false;
10318
10018
  }, "x1", $scope0_id);
10319
10019
  const titleId = _id();
10320
- _html(`<div${_attr_class(page_shell_module_default.page)} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class(page_shell_module_default.body)}><div${_attr_class(usage_stats_module_default.content)}><header${_attr_class(page_shell_module_default.pageHead)}><div${_attr_class(page_shell_module_default.pageHeadText)}><h1${_attr("id", titleId)}>Usage</h1><p${_attr_class(page_shell_module_default.pageMeta)}>Provider plan windows across your agents.</p></div><div${_attr_class(page_shell_module_default.pageHeadAside)}><button${_attr_class([
10321
- usage_stats_module_default.iconBtn,
10322
- usage_stats_module_default.refreshBtn,
10323
- { [usage_stats_module_default.spinning]: refreshing }
10020
+ _html(`<div${_attr_class("_y")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_z")}><div${_attr_class(content)}><header${_attr_class("_C")}><div${_attr_class("_D")}><h1${_attr("id", titleId)}>Usage</h1><p${_attr_class("_E")}>Provider plan windows across your agents.</p></div><div${_attr_class("_F")}><button${_attr_class([
10021
+ iconBtn,
10022
+ "_b1",
10023
+ { [spinning]: refreshing }
10324
10024
  ])} title="Refresh usage" aria-label="Refresh usage"${_attr("disabled", refreshing)}>`);
10325
10025
  icon_refresh_default({ size: 14 });
10326
10026
  _html(`</button>${_el_resume($scope0_id, "i")}</div></header>`);
10327
10027
  _if(() => {
10328
10028
  if (!usage) {
10329
10029
  const $scope3_id = _scope_id();
10330
- _html(`<p${_attr_class([ui_module_default.dim, usage_stats_module_default.note])}><span${_attr_class(ui_module_default.spin)}></span> Loading usage…</p>`);
10030
+ _html(`<p${_attr_class(["_l", "_b2"])}><span${_attr_class("_w")}></span> Loading usage…</p>`);
10331
10031
  writeScope($scope3_id, {});
10332
10032
  return 0;
10333
10033
  } else if (usage.error) {
10334
10034
  const $scope1_id = _scope_id();
10335
- _html(`<p${_attr_class([ui_module_default.dim, usage_stats_module_default.note])}>${_escape(usage.error)}${_el_resume($scope1_id, "b")}</p>`);
10035
+ _html(`<p${_attr_class(["_l", "_b2"])}>${_escape(usage.error)}${_el_resume($scope1_id, "b")}</p>`);
10336
10036
  writeScope($scope1_id, {});
10337
10037
  return 1;
10338
10038
  } else {
10339
10039
  const $scope2_id = _scope_id();
10340
- _html(`<div${_attr_class(usage_stats_module_default.usageList)}>`);
10040
+ _html(`<div${_attr_class("_b3")}>`);
10341
10041
  _for_of(usage.agents || [], (agent) => {
10342
10042
  const $scope4_id = _scope_id();
10343
- _html(`<div${_attr_class([usage_stats_module_default.usageRow, { [usage_stats_module_default.stale]: agent.stale_seconds != null }])}><div${_attr_class(usage_stats_module_default.usageName)}><strong>${_escape(agent.agent)}${_el_resume($scope4_id, "c")}</strong>`);
10043
+ _html(`<div${_attr_class(["_b4", { ["_b8"]: agent.stale_seconds != null }])}><div${_attr_class("_b5")}><strong>${_escape(agent.agent)}${_el_resume($scope4_id, "c")}</strong>`);
10344
10044
  _if(() => {
10345
10045
  if (agent.plan) {
10346
10046
  const $scope5_id = _scope_id();
10347
- _html(`<span${_attr_class(usage_stats_module_default.plan)}>${_escape(agent.plan.replace(/^default_/, "").replaceAll("_", " "))}${_el_resume($scope5_id, "b")}</span>`);
10047
+ _html(`<span${_attr_class("_b6")}>${_escape(agent.plan.replace(/^default_/, "").replaceAll("_", " "))}${_el_resume($scope5_id, "b")}</span>`);
10348
10048
  writeScope($scope5_id, {});
10349
10049
  return 0;
10350
10050
  }
@@ -10352,25 +10052,34 @@ var usage_stats_default = _template("x", (input) => {
10352
10052
  _if(() => {
10353
10053
  if (agent.stale_seconds != null) {
10354
10054
  const $scope6_id = _scope_id();
10355
- _html(`<span${_attr_class(usage_stats_module_default.usageStale)}${_attr("title", `plan-usage could not reach this provider — these are its last cached numbers, ${duration(agent.stale_seconds * 1e3)} old`)}>⚠ <!>${_escape(duration(agent.stale_seconds * 1e3))}${_el_resume($scope6_id, "b")} old</span>${_el_resume($scope6_id, "a")}`);
10055
+ _html(`<span${_attr_class("_b7")}${_attr("title", `${agent.note || "couldn't reach this provider"} — these are the last cached numbers, ${duration(agent.stale_seconds * 1e3)} old`)}>⚠ <!>${_escape(duration(agent.stale_seconds * 1e3))}${_el_resume($scope6_id, "b")} old</span>${_el_resume($scope6_id, "a")}`);
10356
10056
  writeScope($scope6_id, {});
10357
10057
  return 0;
10358
10058
  }
10359
10059
  }, $scope4_id, "e", 1, 1, 1, 0, 1);
10360
- _html(`</div><div${_attr_class(usage_stats_module_default.usageMeters)}>`);
10060
+ _html(`</div><div${_attr_class("_b9")}>`);
10361
10061
  _for_of(agent.windows || [], (win) => {
10362
10062
  const $scope7_id = _scope_id();
10363
10063
  const pct = Math.round(win.used_percent);
10364
10064
  const label = resetLabel(win.resets_at, agent.stale_seconds != null);
10365
- const fillClass = win.used_percent >= 90 ? usage_stats_module_default.fillHot : win.used_percent >= 70 ? usage_stats_module_default.fillWarm : win.used_percent >= 40 ? usage_stats_module_default.fillMid : usage_stats_module_default.fillOk;
10366
- const pctClass = win.used_percent >= 90 ? usage_stats_module_default.pctHot : win.used_percent >= 70 ? usage_stats_module_default.pctWarm : win.used_percent >= 40 ? usage_stats_module_default.pctMid : usage_stats_module_default.pctOk;
10367
- _html(`<div${_attr_class(usage_stats_module_default.meter)}${_attr("title", `${win.window}: ${pct}% used${win.resets_at ? ` — resets ${new Date(win.resets_at).toLocaleString()}` : ""}`)}><span${_attr_class(usage_stats_module_default.meterLabel)}>${_escape(win.window)}${_el_resume($scope7_id, "c")}</span><span${_attr_class(usage_stats_module_default.meterTrack)}><span${_attr_class([usage_stats_module_default.meterFill, fillClass])}${_attr_style(`width:${Math.min(100, Math.max(2, win.used_percent))}%`)}></span>${_el_resume($scope7_id, "e")}</span><span${_attr_class([usage_stats_module_default.meterPct, pctClass])}>${_escape(pct)}${_el_resume($scope7_id, "g")}%</span>${_el_resume($scope7_id, "f")}<span${_attr_class(usage_stats_module_default.meterReset)}>${label ? `↻ ${_escape(`${_to_text(label)}`)}` : ""}${_el_resume($scope7_id, "i")}</span></div>${_el_resume($scope7_id, "a")}`);
10065
+ const fillClass = win.used_percent >= 90 ? "_ch" : win.used_percent >= 70 ? "_cg" : win.used_percent >= 40 ? "_cf" : "_ce";
10066
+ const pctClass = win.used_percent >= 90 ? "_cm" : win.used_percent >= 70 ? "_cl" : win.used_percent >= 40 ? "_ck" : "_cj";
10067
+ _html(`<div${_attr_class("_ca")}${_attr("title", `${win.window}: ${pct}% used${win.resets_at ? ` — resets ${new Date(win.resets_at).toLocaleString()}` : ""}`)}><span${_attr_class("_cb")}>${_escape(win.window)}${_el_resume($scope7_id, "c")}</span><span${_attr_class("_cc")}><span${_attr_class(["_cd", fillClass])}${_attr_style(`width:${Math.min(100, Math.max(2, win.used_percent))}%`)}></span>${_el_resume($scope7_id, "e")}</span><span${_attr_class(["_ci", pctClass])}>${_escape(pct)}${_el_resume($scope7_id, "g")}%</span>${_el_resume($scope7_id, "f")}<span${_attr_class("_cn")}>${label ? `↻ ${_escape(`${_to_text(label)}`)}` : ""}${_el_resume($scope7_id, "i")}</span></div>${_el_resume($scope7_id, "a")}`);
10368
10068
  writeScope($scope7_id, {});
10369
- }, "window", $scope4_id, "f", 1, 1, 1, "</div>", 1);
10370
- _html(`</div>${_el_resume($scope4_id, "a")}`);
10069
+ }, "window", $scope4_id, "g", 1, 1, 1, 0, 1);
10070
+ _if(() => {
10071
+ if (agent.note) {
10072
+ const $scope8_id = _scope_id();
10073
+ _html(`<p${_attr_class("_b_")}>${_escape(agent.note)}${_el_resume($scope8_id, "b")}</p>`);
10074
+ writeScope($scope8_id, {});
10075
+ return 0;
10076
+ }
10077
+ }, $scope4_id, "h", 1, 1, 1, 0, 1);
10078
+ _html(`</div></div>${_el_resume($scope4_id, "a")}`);
10371
10079
  writeScope($scope4_id, {
10372
- i: agent?.stale_seconds,
10373
- k: agent?.plan
10080
+ k: agent?.stale_seconds,
10081
+ m: agent?.plan,
10082
+ n: agent?.note
10374
10083
  });
10375
10084
  }, (a) => `${a.agent}-${a.account || ""}`, $scope2_id, "a", 1, 1, 1, "</div>", 1);
10376
10085
  writeScope($scope2_id, {});
@@ -10388,45 +10097,6 @@ var usage_stats_default = _template("x", (input) => {
10388
10097
  });
10389
10098
  _resume_branch($scope0_id);
10390
10099
  });
10391
- var term_module_default = {
10392
- iconBtn: "_c7 _ez",
10393
- termWrap: "_c8",
10394
- term: "_c9",
10395
- xterm: "_c_",
10396
- termDead: "_da",
10397
- termCopied: "_db",
10398
- termCopiedFade: "_dc",
10399
- termUploading: "_dd",
10400
- trapBackdrop: "_de",
10401
- pasteTrap: "_df",
10402
- kbSlot: "_dg",
10403
- keyBar: "_dh",
10404
- keyBarBtns: "_di",
10405
- keyBarBtnsHidden: "_dj",
10406
- kspacer: "_dk",
10407
- sessBtn: "_dl",
10408
- sessDot: "_dm",
10409
- sessPop: "_dn",
10410
- sessRow: "_do",
10411
- current: "_dp",
10412
- sessOpen: "_dq",
10413
- sessTitle: "_dr",
10414
- sessRename: "_ds",
10415
- sessX: "_dt",
10416
- armed: "_du",
10417
- sessEdit: "_dv",
10418
- sessNew: "_dw",
10419
- lone: "_dx",
10420
- kbarWs: "_dy",
10421
- kbarWsName: "_dz",
10422
- kbtn: "_dA _ez",
10423
- dpadGrid: "_dB",
10424
- repeat: "_dC",
10425
- on: "_dD",
10426
- bigGlyph: "_dE",
10427
- enter: "_dF",
10428
- dpadEsc: "_dG"
10429
- };
10430
10100
  //#endregion
10431
10101
  //#region src/tags/term-find.marko
10432
10102
  var term_find_default = _template("u", (input) => {
@@ -10462,15 +10132,15 @@ var term_find_default = _template("u", (input) => {
10462
10132
  const hasQuery = !!query.trim();
10463
10133
  const canStep = hasQuery && open;
10464
10134
  _html(`<div${_attr_class([
10465
- diff_find_module_default.findWrap,
10466
- input.placement === "keybar" ? diff_find_module_default.termKeybarWrap : diff_find_module_default.termOverlayWrap,
10467
- !open && diff_find_module_default.termClosed
10468
- ])} aria-hidden=${open ? "false" : "true"}><div${_attr_class([diff_find_module_default.findBar, input.placement === "keybar" ? diff_find_module_default.termKeybar : diff_find_module_default.termOverlay])}><input${_attr_input_value($scope0_id, "c", query, _resume(function(v) {
10135
+ "_eL",
10136
+ input.placement === "keybar" ? "_eN" : "_eM",
10137
+ !open && "_eP"
10138
+ ])} aria-hidden=${open ? "false" : "true"}><div${_attr_class(["_eG", input.placement === "keybar" ? "_eO" : "_eI"])}><input${_attr_input_value($scope0_id, "c", query, _resume(function(v) {
10469
10139
  if (!open) return;
10470
10140
  query = v;
10471
10141
  live.query = v;
10472
10142
  run(0);
10473
- }, "u0", $scope0_id))}${_attr_class(diff_find_module_default.findInput)} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in terminal" aria-label="Find in terminal">${_el_resume($scope0_id, "c")}<button type=button${_attr_class(diff_find_module_default.findIconBtn)} title="Previous match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "d")}<button type=button${_attr_class(diff_find_module_default.findIconBtn)} title="Next match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class(diff_find_module_default.findIconBtn)} title="Close find" tabindex=${open ? "0" : "-1"}>×</button>${_el_resume($scope0_id, "f")}</div>${_el_resume($scope0_id, "b", _serialize_guard($scope0_reason, 2))}</div>${_el_resume($scope0_id, "a")}`);
10143
+ }, "u0", $scope0_id))}${_attr_class("_eH")} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in terminal" aria-label="Find in terminal">${_el_resume($scope0_id, "c")}<button type=button${_attr_class(findIconBtn)} title="Previous match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "d")}<button type=button${_attr_class(findIconBtn)} title="Next match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class(findIconBtn)} title="Close find" tabindex=${open ? "0" : "-1"}>×</button>${_el_resume($scope0_id, "f")}</div>${_el_resume($scope0_id, "b", _serialize_guard($scope0_reason, 2))}</div>${_el_resume($scope0_id, "a")}`);
10474
10144
  _script($scope0_id, "u4");
10475
10145
  _script($scope0_id, "u5");
10476
10146
  _script($scope0_id, "u6");
@@ -10563,19 +10233,19 @@ var REPEAT_EVERY = 55;
10563
10233
  var term_default = _template("v", (input) => {
10564
10234
  const $scope0_reason = _scope_reason();
10565
10235
  _serialize_guard($scope0_reason, 3);
10566
- _serialize_guard($scope0_reason, 5);
10567
- _serialize_guard($scope0_reason, 7);
10236
+ _serialize_guard($scope0_reason, 6);
10568
10237
  _serialize_guard($scope0_reason, 8);
10569
- const $si__input_sessions = _serialize_if($scope0_reason, 7);
10238
+ _serialize_guard($scope0_reason, 9);
10239
+ const $si__input_sessions = _serialize_if($scope0_reason, 8);
10570
10240
  _serialize_guard($scope0_reason, 1);
10571
10241
  _serialize_guard($scope0_reason, 10);
10572
- const $si__input_onRenameSession = _serialize_if($scope0_reason, 8);
10242
+ const $si__input_onRenameSession = _serialize_if($scope0_reason, 9);
10573
10243
  _serialize_guard($scope0_reason, 11);
10574
- const $si__input_agents = _serialize_if($scope0_reason, 11), $si__input_agent = _serialize_if($scope0_reason, 5);
10244
+ const $si__input_agents = _serialize_if($scope0_reason, 11), $si__input_mode = _serialize_if($scope0_reason, 3), $si__input_agent = _serialize_if($scope0_reason, 6);
10575
10245
  _serialize_guard($scope0_reason, 2);
10576
10246
  _serialize_guard($scope0_reason, 4);
10577
10247
  _serialize_guard($scope0_reason, 12);
10578
- const $si__input_onCloseSession = _serialize_if($scope0_reason, 10), $si__input_sessionId = _serialize_if($scope0_reason, 9), $si__input_sessionState = _serialize_if($scope0_reason, 6), $si__input_workspaceName = _serialize_if($scope0_reason, 12);
10248
+ const $si__input_onCloseSession = _serialize_if($scope0_reason, 10), $si__input_sessionId = _serialize_if($scope0_reason, 5), $si__input_sessionState = _serialize_if($scope0_reason, 7), $si__input_workspaceName = _serialize_if($scope0_reason, 12);
10579
10249
  const $scope0_id = _scope_id();
10580
10250
  _hoist($scope0_id, "v20");
10581
10251
  const $findOpen__closures = /* @__PURE__ */ new Set();
@@ -10587,6 +10257,7 @@ var term_default = _template("v", (input) => {
10587
10257
  const $input_agent__closures = /* @__PURE__ */ new Set();
10588
10258
  const $input_sessionState__closures = /* @__PURE__ */ new Set();
10589
10259
  const $input_agents__closures = /* @__PURE__ */ new Set();
10260
+ const $onTermPage__closures = /* @__PURE__ */ new Set();
10590
10261
  const $input_workspaceName__closures = /* @__PURE__ */ new Set();
10591
10262
  let dead = false;
10592
10263
  let kb = false;
@@ -10655,14 +10326,12 @@ var term_default = _template("v", (input) => {
10655
10326
  }
10656
10327
  openFind();
10657
10328
  }, "v7", $scope0_id);
10658
- const canFind = (() => {
10659
- const mode = input.mode;
10660
- return mode == null || mode === "term" || mode === "diff";
10661
- })();
10662
- const findLit = !input.mode || input.mode === "term" ? findOpen : input.mode === "diff" && !!input.reviewFindOpen;
10329
+ const onTermPage = input.mode == null || input.mode === "term";
10330
+ const canKeys = onTermPage || input.mode === "diff";
10331
+ const findLit = onTermPage ? findOpen : input.mode === "diff" && !!input.reviewFindOpen;
10663
10332
  const toggleSharedFind = _resume(() => {
10664
- if (!canFind) return;
10665
- if (!input.mode || input.mode === "term") {
10333
+ if (!canKeys) return;
10334
+ if (onTermPage) {
10666
10335
  toggleFind();
10667
10336
  return;
10668
10337
  }
@@ -10736,7 +10405,7 @@ var term_default = _template("v", (input) => {
10736
10405
  trapOpen = true;
10737
10406
  }
10738
10407
  }, "v14", $scope0_id);
10739
- _html(`<div${_attr("hidden", input.mode != null && input.mode !== "term")}${_attr_class(term_module_default.termWrap)}><div${_attr_class(term_module_default.term)}></div>${_el_resume($scope0_id, "b")}`);
10408
+ _html(`<div${_attr("hidden", !onTermPage)}${_attr_class("_da")}><div${_attr_class("_db")}></div>${_el_resume($scope0_id, "b")}`);
10740
10409
  _if(() => {
10741
10410
  if (findOpen) {
10742
10411
  const $scope11_id = _scope_id();
@@ -10763,7 +10432,7 @@ var term_default = _template("v", (input) => {
10763
10432
  _if(() => {
10764
10433
  if (uploading) {
10765
10434
  const $scope18_id = _scope_id();
10766
- _html(`<div${_attr_class(term_module_default.termUploading)}>uploading…</div>`);
10435
+ _html(`<div${_attr_class("_dj")}>uploading…</div>`);
10767
10436
  writeScope($scope18_id, {});
10768
10437
  return 0;
10769
10438
  }
@@ -10771,7 +10440,7 @@ var term_default = _template("v", (input) => {
10771
10440
  _if(() => {
10772
10441
  if (copiedFlash) {
10773
10442
  const $scope19_id = _scope_id();
10774
- _html(`<div${_attr_class(term_module_default.termCopied)}>Copied</div>`);
10443
+ _html(`<div${_attr_class("_di")}>Copied</div>`);
10775
10444
  writeScope($scope19_id, {});
10776
10445
  return 0;
10777
10446
  }
@@ -10780,7 +10449,7 @@ var term_default = _template("v", (input) => {
10780
10449
  _if(() => {
10781
10450
  if (trapOpen) {
10782
10451
  const $scope10_id = _scope_id();
10783
- _html(`<div${_attr_class(term_module_default.trapBackdrop)}><div${_attr_class(term_module_default.pasteTrap)}><p${_attr_class(ui_module_default.dim)}>Long-press below and choose Paste</p><input placeholder="Paste here…">${_el_resume($scope10_id, "d")}<button${_attr_class(ui_module_default.btn)}>Cancel</button>${_el_resume($scope10_id, "e")}</div>${_el_resume($scope10_id, "b")}</div>${_el_resume($scope10_id, "a")}`);
10452
+ _html(`<div${_attr_class("_dk")}><div${_attr_class("_dl")}><p${_attr_class("_l")}>Long-press below and choose Paste</p><input placeholder="Paste here…">${_el_resume($scope10_id, "d")}<button${_attr_class("_d")}>Cancel</button>${_el_resume($scope10_id, "e")}</div>${_el_resume($scope10_id, "b")}</div>${_el_resume($scope10_id, "a")}`);
10784
10453
  _script($scope10_id, "v23");
10785
10454
  _script($scope10_id, "v24");
10786
10455
  writeScope($scope10_id, {});
@@ -10789,9 +10458,9 @@ var term_default = _template("v", (input) => {
10789
10458
  }, $scope0_id, "g", 1, 1, 1, 0, 1);
10790
10459
  _html(`</div>${_el_resume($scope0_id, "a")}`);
10791
10460
  _if(() => {}, $scope0_id, "h", 1, 1, 1, 0, 1);
10792
- _script($scope0_id, "v38");
10793
10461
  _script($scope0_id, "v39");
10794
10462
  _script($scope0_id, "v40");
10463
+ _script($scope0_id, "v41");
10795
10464
  writeScope($scope0_id, {
10796
10465
  k: input.mode,
10797
10466
  l: input.reviewFindOpen,
@@ -10802,12 +10471,12 @@ var term_default = _template("v", (input) => {
10802
10471
  q: input.onExitReview,
10803
10472
  r: input.onToggleDiff,
10804
10473
  s: input.onNewSession,
10805
- t: input.agent,
10806
- u: input.sessionState,
10807
- v: input.sessions,
10808
- w: input.onRenameSession,
10809
- x: input.sessionId,
10810
- y: input.onOpenTab,
10474
+ t: input.onOpenTab,
10475
+ u: input.sessionId,
10476
+ v: input.agent,
10477
+ w: input.sessionState,
10478
+ x: input.sessions,
10479
+ y: input.onRenameSession,
10811
10480
  z: input.onCloseSession,
10812
10481
  a0: input.agents,
10813
10482
  a1: input.workspaceName,
@@ -10817,39 +10486,41 @@ var term_default = _template("v", (input) => {
10817
10486
  a5: touch,
10818
10487
  a8: trapOpen,
10819
10488
  a9: findOpen,
10820
- ac: $openChange,
10821
- ad: findTick,
10822
- af: ioBox.current,
10823
- ai: searchBox.query,
10824
- aj: searchBox.overlay,
10825
- ak: searchBox.refreshTimer,
10826
- am: findFocusRef,
10827
- ao: scheduleFindRefresh,
10828
- ap: runFind,
10829
- aq: clearFind,
10830
- as: openFind,
10831
- au: toggleFind,
10832
- av: canFind,
10833
- ax: findLit,
10834
- ay: toggleSharedFind,
10835
- b0: copyFlashBox.timer,
10836
- b1: flashCopied,
10837
- b3: holdBox.current,
10838
- b5: startHold,
10839
- b6: stopHold,
10840
- b7: uploadAsset,
10841
- ba: handlePasted,
10842
- bb: pasteClipboard,
10843
- bp: $findOpen__closures,
10844
- br: $findTick__closures,
10845
- bi: $si__input_onRenameSession && $input_onRenameSession__closures,
10846
- bk: $si__input_onCloseSession && $input_onCloseSession__closures,
10847
- bj: $si__input_sessionId && $input_sessionId__closures,
10848
- bh: $si__input_sessions && $input_sessions__closures,
10849
- bf: $si__input_agent && $input_agent__closures,
10850
- bg: $si__input_sessionState && $input_sessionState__closures,
10851
- bl: $si__input_agents && $input_agents__closures,
10852
- bm: $si__input_workspaceName && $input_workspaceName__closures
10489
+ ab: $openChange,
10490
+ ac: findTick,
10491
+ ae: ioBox.current,
10492
+ ah: searchBox.query,
10493
+ ai: searchBox.overlay,
10494
+ aj: searchBox.refreshTimer,
10495
+ al: findFocusRef,
10496
+ an: scheduleFindRefresh,
10497
+ ao: runFind,
10498
+ ap: clearFind,
10499
+ aq: openFind,
10500
+ as: toggleFind,
10501
+ at: onTermPage,
10502
+ aw: canKeys,
10503
+ ay: findLit,
10504
+ az: toggleSharedFind,
10505
+ b1: copyFlashBox.timer,
10506
+ b2: flashCopied,
10507
+ b4: holdBox.current,
10508
+ b6: startHold,
10509
+ b7: stopHold,
10510
+ b8: uploadAsset,
10511
+ bb: handlePasted,
10512
+ bc: pasteClipboard,
10513
+ bq: $findOpen__closures,
10514
+ bs: $findTick__closures,
10515
+ bk: $si__input_onRenameSession && $input_onRenameSession__closures,
10516
+ bl: $si__input_onCloseSession && $input_onCloseSession__closures,
10517
+ bg: $si__input_sessionId && $input_sessionId__closures,
10518
+ bj: $si__input_sessions && $input_sessions__closures,
10519
+ bh: $si__input_agent && $input_agent__closures,
10520
+ bi: $si__input_sessionState && $input_sessionState__closures,
10521
+ bm: $si__input_agents && $input_agents__closures,
10522
+ bx: $si__input_mode && $onTermPage__closures,
10523
+ bn: $si__input_workspaceName && $input_workspaceName__closures
10853
10524
  });
10854
10525
  _resume_branch($scope0_id);
10855
10526
  });
@@ -11027,7 +10698,7 @@ var work_view_default = _template("y", (input) => {
11027
10698
  error = String(err.message || err);
11028
10699
  }
11029
10700
  }, "y15", $scope0_id);
11030
- _html(`<div${_attr_class([work_view_module_default.workView, { [work_view_module_default.navPage]: view === "nav" }])}><div${_attr_class(work_view_module_default.sideWrap)}>`);
10701
+ _html(`<div${_attr_class(["_bF", { ["_bE"]: view === "nav" }])}><div${_attr_class("_bG")}>`);
11031
10702
  _set_serialize_reason({
11032
10703
  0: _serialize_guard($scope0_reason, 0),
11033
10704
  1: _serialize_guard($scope0_reason, 2),
@@ -11098,7 +10769,7 @@ var work_view_default = _template("y", (input) => {
11098
10769
  openDiff(pr);
11099
10770
  }, "y27", $scope0_id)
11100
10771
  });
11101
- _html(`</div><div${_attr_class(work_view_module_default.mainCol)}>`);
10772
+ _html(`</div><div${_attr_class("_bH")}>`);
11102
10773
  _if(() => {
11103
10774
  if (error) {
11104
10775
  const $scope8_id = _scope_id();
@@ -11188,7 +10859,7 @@ var work_view_default = _template("y", (input) => {
11188
10859
  }
11189
10860
  }, $scope0_id, "h");
11190
10861
  _if(() => {}, $scope0_id, "i");
11191
- _html(`<div${_attr_class([work_view_module_default.termArea, { [work_view_module_default.asBar]: view !== "term" }])}>`);
10862
+ _html(`<div${_attr_class(["_bJ", { ["_bI"]: view !== "term" }])}>`);
11192
10863
  _if(() => {
11193
10864
  if (shownSessions) {
11194
10865
  const $scope4_id = _scope_id();
@@ -11262,7 +10933,7 @@ var work_view_default = _template("y", (input) => {
11262
10933
  _if(() => {
11263
10934
  if (!shownSessions.length) {
11264
10935
  const $scope6_id = _scope_id();
11265
- _html(`<div${_attr_class(work_view_module_default.emptySess)}><p${_attr_class(ui_module_default.dim)}>No sessions in this workspace.</p><button${_attr_class([ui_module_default.btn, ui_module_default.primary])}${_attr("disabled", spawning)}>${spawning ? "Starting…" : `Start ${_escape(`${input.preferred || "claude"}`)}`}${_el_resume($scope6_id, "d")}</button>${_el_resume($scope6_id, "c")}</div>`);
10936
+ _html(`<div${_attr_class("_bL")}><p${_attr_class("_l")}>No sessions in this workspace.</p><button${_attr_class(["_d", "_e"])}${_attr("disabled", spawning)}>${spawning ? "Starting…" : `Start ${_escape(`${input.preferred || "claude"}`)}`}${_el_resume($scope6_id, "d")}</button>${_el_resume($scope6_id, "c")}</div>`);
11266
10937
  _script($scope6_id, "y47");
11267
10938
  _subscribe($spawning__closures, _subscribe($si__input_preferred && $input_preferred__closures, writeScope($scope6_id, {})));
11268
10939
  return 0;
@@ -11272,7 +10943,7 @@ var work_view_default = _template("y", (input) => {
11272
10943
  return 0;
11273
10944
  } else {
11274
10945
  const $scope10_id = _scope_id();
11275
- _html(`<p${_attr_class(work_view_module_default.padInline)}>Loading sessions…</p>`);
10946
+ _html(`<p${_attr_class("_bK")}>Loading sessions…</p>`);
11276
10947
  writeScope($scope10_id, {});
11277
10948
  return 1;
11278
10949
  }
@@ -11453,7 +11124,7 @@ var page_boot_default = _template("n", (input) => {
11453
11124
  }, "n4", $scope0_id);
11454
11125
  const selected = workspaces.find((ws) => ws.id === selectedId);
11455
11126
  const showInlinePalette = !creating && !selected;
11456
- _html(`<div${_attr_class(page_boot_module_default.root)}>`);
11127
+ _html(`<div${_attr_class("_x")}>`);
11457
11128
  _if(() => {
11458
11129
  if (error) {
11459
11130
  const $scope5_id = _scope_id();
@@ -11668,12 +11339,12 @@ var _page_default = _template("b", (input) => {
11668
11339
  placeholder: attrTag({ content: _content_resume("b0", () => {
11669
11340
  _scope_reason();
11670
11341
  _scope_id();
11671
- _html(`<div${_attr_class(page_module_default.boot)}><span${_attr_class(ui_module_default.spin)}></span>Loading workspaces…</div>`);
11342
+ _html(`<div${_attr_class("_b")}><span${_attr_class("_w")}></span>Loading workspaces…</div>`);
11672
11343
  }, $scope0_id) }),
11673
11344
  catch: attrTag({ content: _content_resume("b1", (err) => {
11674
11345
  const $scope3_reason = _scope_reason();
11675
11346
  const $scope3_id = _scope_id();
11676
- _html(`<div${_attr_class(page_module_default.boot)}><p>${err instanceof Error ? _escape(err.message) : _escape(String(err))}${_el_resume($scope3_id, "b", _serialize_guard($scope3_reason, 0))}</p></div>`);
11347
+ _html(`<div${_attr_class("_b")}><p>${err instanceof Error ? _escape(err.message) : _escape(String(err))}${_el_resume($scope3_id, "b", _serialize_guard($scope3_reason, 0))}</p></div>`);
11677
11348
  _serialize_if($scope3_reason, 0) && writeScope($scope3_id, {});
11678
11349
  }, $scope0_id) })
11679
11350
  });
@@ -13475,31 +13146,720 @@ function head16(context) {
13475
13146
  return stripResponseBody(get16(context));
13476
13147
  }
13477
13148
  //#endregion
13478
- //#region src/server/usage.ts
13149
+ //#region src/server/usage/shared.ts
13150
+ var HOME = os.homedir();
13151
+ var obj = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
13152
+ var arr = (value) => Array.isArray(value) ? value : [];
13153
+ var str = (value) => typeof value === "string" ? value : "";
13154
+ /** Numeric coercion that refuses NaN/Infinity — a provider sending "n/a"
13155
+ * must read as "no number", not as a percentage that renders a bar. */
13156
+ function num(value) {
13157
+ if (value == null || value === "") return null;
13158
+ const n = typeof value === "number" ? value : Number(value);
13159
+ return Number.isFinite(n) ? n : null;
13160
+ }
13161
+ function readJson(file) {
13162
+ try {
13163
+ return obj(JSON.parse(fs.readFileSync(file, "utf8")));
13164
+ } catch {
13165
+ return null;
13166
+ }
13167
+ }
13168
+ /** True if an epoch (seconds or ms) or ISO-8601 expiry is in the past. */
13169
+ function expired(value) {
13170
+ if (value == null) return false;
13171
+ if (typeof value === "string") {
13172
+ const t = Date.parse(value.replace(/\.\d+/, ""));
13173
+ return Number.isFinite(t) && t < Date.now();
13174
+ }
13175
+ const n = num(value);
13176
+ if (n == null) return false;
13177
+ return (n > 1e11 ? n : n * 1e3) < Date.now();
13178
+ }
13179
+ function isoFromEpoch(value) {
13180
+ const n = num(value);
13181
+ if (n == null || n <= 0) return null;
13182
+ const ms = n > 1e11 ? n : n * 1e3;
13183
+ return new Date(ms).toISOString();
13184
+ }
13185
+ /** `p•••@g•••.com` — enough to tell two accounts apart, and the page is
13186
+ * screenshotted into PRs and chat, so the address itself doesn't belong. */
13187
+ function maskEmail(email) {
13188
+ if (!email || !email.includes("@")) return email || "—";
13189
+ const [local, domain] = email.split("@");
13190
+ if (!local || !domain) return email;
13191
+ const tld = domain.split(".").pop() || "";
13192
+ return `${local[0]}•••@${domain[0]}•••.${tld}`;
13193
+ }
13194
+ /** A fetch that failed, carrying a reason fit to show on the row.
13195
+ *
13196
+ * A stale number with no explanation is what makes a usage table untrustworthy
13197
+ * — "why is claude2 from yesterday?" deserves an answer next to the number. */
13198
+ var FetchFailed = class extends Error {
13199
+ reason;
13200
+ constructor(reason) {
13201
+ super(reason);
13202
+ this.reason = reason;
13203
+ }
13204
+ };
13205
+ function httpReason(status) {
13206
+ if (status === 401 || status === 403) return "auth expired";
13207
+ if (status === 429) return "rate limited or auth expired";
13208
+ if (status >= 500) return `provider error (HTTP ${status})`;
13209
+ return `HTTP ${status}`;
13210
+ }
13211
+ var TIMEOUT_MS = 15e3;
13212
+ /** JSON over HTTPS, with every failure mode collapsed into a FetchFailed
13213
+ * whose reason is worth showing to a human. */
13214
+ async function fetchJson(url, init = {}) {
13215
+ let res;
13216
+ try {
13217
+ res = await fetch(url, {
13218
+ ...init,
13219
+ signal: AbortSignal.timeout(TIMEOUT_MS)
13220
+ });
13221
+ } catch (err) {
13222
+ const name = err?.name;
13223
+ throw new FetchFailed(name === "TimeoutError" || name === "AbortError" ? "timed out" : "network unreachable");
13224
+ }
13225
+ if (!res.ok) throw new FetchFailed(httpReason(res.status));
13226
+ try {
13227
+ return await res.json();
13228
+ } catch {
13229
+ throw new FetchFailed("unreadable response");
13230
+ }
13231
+ }
13232
+ var cacheDir = path.join(config.dataDir, "usage");
13233
+ function readCache(key) {
13234
+ const blob = readJson(path.join(cacheDir, `${key}.json`));
13235
+ if (!blob) return null;
13236
+ const payload = blob.payload;
13237
+ const at = num(blob.fetched_at);
13238
+ if (!payload || typeof payload !== "object" || at == null) return null;
13239
+ return {
13240
+ payload: obj(payload),
13241
+ ageMs: Math.max(0, Date.now() - at)
13242
+ };
13243
+ }
13244
+ function writeCache(key, payload) {
13245
+ try {
13246
+ fs.mkdirSync(cacheDir, { recursive: true });
13247
+ fs.writeFileSync(path.join(cacheDir, `${key}.json`), JSON.stringify({
13248
+ fetched_at: Date.now(),
13249
+ payload
13250
+ }));
13251
+ } catch {}
13252
+ }
13253
+ /** Live fetch, falling back to the last good payload on disk.
13254
+ *
13255
+ * There is no "cache is fresh enough, skip the fetch" branch: the page's own
13256
+ * 60s stale-while-revalidate (server/usage/index.ts) already decides how often
13257
+ * this runs, and a second TTL underneath it only makes the numbers older than
13258
+ * the page claims. */
13259
+ async function loadPayload(key, live) {
13260
+ let reason;
13261
+ try {
13262
+ const data = await live();
13263
+ if (data) {
13264
+ writeCache(key, data);
13265
+ return {
13266
+ payload: data,
13267
+ source: "live"
13268
+ };
13269
+ }
13270
+ } catch (err) {
13271
+ reason = err instanceof FetchFailed ? err.reason : "fetch failed";
13272
+ }
13273
+ const disk = readCache(key);
13274
+ if (disk) return {
13275
+ payload: disk.payload,
13276
+ source: `stale-cache ${Math.round(disk.ageMs / 1e3)}s`,
13277
+ reason
13278
+ };
13279
+ return {
13280
+ payload: null,
13281
+ source: "missing",
13282
+ reason
13283
+ };
13284
+ }
13285
+ /** How to get a fresh token back, per provider. */
13286
+ var REAUTH = {
13287
+ codex: "codex login",
13288
+ cursor: "cursor-agent login",
13289
+ grok: "grok",
13290
+ copilot: "gh auth login"
13291
+ };
13292
+ /** Never signed in (or the CLI's credentials went missing) — not an outage.
13293
+ * Distinct from a failed request: nothing was ever sent, so blaming the
13294
+ * network would send you debugging the wrong thing. */
13295
+ function noAuthReason(key) {
13296
+ const hint = REAUTH[key];
13297
+ return hint ? `not signed in (run \`${hint}\`)` : "no credentials on disk";
13298
+ }
13299
+ function blankRow(agent, source = "missing") {
13300
+ return {
13301
+ agent,
13302
+ plan: agent,
13303
+ account: "—",
13304
+ five_h: null,
13305
+ five_h_resets: null,
13306
+ seven_d: null,
13307
+ seven_d_resets: null,
13308
+ fable: null,
13309
+ fable_resets: null,
13310
+ source
13311
+ };
13312
+ }
13313
+ /** Say *why* a row is showing last-known numbers, on the row itself.
13314
+ *
13315
+ * `tokenExpired` is the local credential check: true/false where an expiry is
13316
+ * readable off disk, undefined where it isn't. It beats guessing from the
13317
+ * status code — a dead token comes back 429 or 403 as readily as 401 — and
13318
+ * knowing the token is *good* is what lets a 429 be reported as plain
13319
+ * throttling instead of sending you to re-authenticate for nothing. */
13320
+ function markStale(row, key, tokenExpired, reason) {
13321
+ if (!/^(stale|claude\.json|missing)/.test(row.source)) return row;
13322
+ let why = reason ?? (tokenExpired ? "auth expired" : void 0);
13323
+ if (!why) why = "couldn't reach provider";
13324
+ if (why.startsWith("rate limited") && tokenExpired === false) why = "rate limited — retry shortly";
13325
+ else if (/^(auth expired|rate limited)/.test(why)) {
13326
+ const hint = REAUTH[key];
13327
+ why += hint ? ` (run \`${hint}\`)` : " (sign in again)";
13328
+ }
13329
+ return {
13330
+ ...row,
13331
+ stale_reason: why
13332
+ };
13333
+ }
13334
+ //#endregion
13335
+ //#region src/server/usage/claude.ts
13336
+ /** Every Claude account this machine can read.
13337
+ *
13338
+ * Numbered dirs (~/.claude-1, -2) keep metadata at <dir>/.claude.json; the
13339
+ * stock single-account install keeps it at ~/.claude.json with only
13340
+ * credentials under ~/.claude/. */
13341
+ function claudeAccounts() {
13342
+ const candidates = [...[1, 2].map((n) => ({
13343
+ suffix: String(n),
13344
+ dir: path.join(HOME, `.claude-${n}`),
13345
+ meta: path.join(HOME, `.claude-${n}`, ".claude.json"),
13346
+ label: `claude${n}`
13347
+ })), {
13348
+ suffix: "",
13349
+ dir: path.join(HOME, ".claude"),
13350
+ meta: path.join(HOME, ".claude.json"),
13351
+ label: "claude"
13352
+ }];
13353
+ const out = [];
13354
+ for (const candidate of candidates) {
13355
+ const meta = readJson(candidate.meta);
13356
+ if (!meta) continue;
13357
+ const oauth = obj(meta.oauthAccount);
13358
+ out.push({
13359
+ ...candidate,
13360
+ email: str(oauth.emailAddress).trim(),
13361
+ plan: str(oauth.organizationRateLimitTier || oauth.organizationType)
13362
+ });
13363
+ }
13364
+ return out;
13365
+ }
13366
+ var credentials = (account) => readJson(path.join(account.dir, ".credentials.json"));
13367
+ /** Why an account has no live data — an expired token is the common case
13368
+ * and only that account's own CLI can refresh it. */
13369
+ function credentialNote(account) {
13370
+ const cred = credentials(account);
13371
+ if (!cred) return "no credentials — run: claude";
13372
+ if (expired(obj(cred.claudeAiOauth).expiresAt)) return "token expired — use this Claude account to refresh";
13373
+ return "usage unavailable";
13374
+ }
13375
+ function tokenExpired(account) {
13376
+ const cred = credentials(account);
13377
+ return cred ? expired(obj(cred.claudeAiOauth).expiresAt) : false;
13378
+ }
13379
+ async function fetchUsage$3(account) {
13380
+ const token = str(obj(credentials(account)?.claudeAiOauth).accessToken);
13381
+ if (!token) return null;
13382
+ return obj(await fetchJson("https://api.anthropic.com/api/oauth/usage", { headers: {
13383
+ Authorization: `Bearer ${token}`,
13384
+ "anthropic-beta": "oauth-2025-04-20",
13385
+ "User-Agent": "claude-cli",
13386
+ Accept: "application/json"
13387
+ } }));
13388
+ }
13389
+ /** The CLI's own last-seen utilization, written into .claude.json. Older and
13390
+ * coarser than the API, but it survives an expired token. */
13391
+ function claudeJsonFallback(account) {
13392
+ const cached = readJson(account.meta)?.cachedUsageUtilization;
13393
+ return cached && typeof cached === "object" ? obj(cached) : null;
13394
+ }
13395
+ /** The payload nests windows under `utilization` on some plans and inlines
13396
+ * them on others. */
13397
+ function utilRoot(data) {
13398
+ const util = obj(data.utilization);
13399
+ return "five_hour" in util || "limits" in util ? util : data;
13400
+ }
13401
+ function window$2(data, key) {
13402
+ const win = obj(utilRoot(data)[key]);
13403
+ const used = num(win.utilization);
13404
+ return [used == null ? null : Math.trunc(used), str(win.resets_at) || null];
13405
+ }
13406
+ /** Fable gets its own weekly cap, listed as a model-scoped limit rather than
13407
+ * a top-level window. */
13408
+ function fableWindow(data) {
13409
+ for (const entry of arr(utilRoot(data).limits)) {
13410
+ const limit = obj(entry);
13411
+ if (limit.kind !== "weekly_scoped") continue;
13412
+ const model = obj(obj(limit.scope).model);
13413
+ if (!str(model.display_name || model.id).toLowerCase().includes("fable")) continue;
13414
+ const pct = num(limit.percent);
13415
+ return [pct == null ? null : Math.trunc(pct), str(limit.resets_at) || null];
13416
+ }
13417
+ return [null, null];
13418
+ }
13419
+ function parseRow$4(account, data, source) {
13420
+ const [five, fiveResets] = data ? window$2(data, "five_hour") : [null, null];
13421
+ const [seven, sevenResets] = data ? window$2(data, "seven_day") : [null, null];
13422
+ const [fable, fableResets] = data ? fableWindow(data) : [null, null];
13423
+ const row = {
13424
+ agent: account.label,
13425
+ plan: account.plan || "claude",
13426
+ account: maskEmail(account.email),
13427
+ five_h: five,
13428
+ five_h_resets: fiveResets,
13429
+ seven_d: seven,
13430
+ seven_d_resets: sevenResets,
13431
+ fable,
13432
+ fable_resets: fableResets,
13433
+ source
13434
+ };
13435
+ if (five == null && seven == null && fable == null) row.note = credentialNote(account);
13436
+ return row;
13437
+ }
13438
+ async function claudeRow(account) {
13439
+ const loaded = await loadPayload(`claude${account.suffix}`, () => fetchUsage$3(account));
13440
+ const fallback = loaded.payload ? null : claudeJsonFallback(account);
13441
+ return markStale(parseRow$4(account, loaded.payload ?? fallback, fallback ? "claude.json" : loaded.source), account.label, tokenExpired(account), loaded.reason);
13442
+ }
13443
+ //#endregion
13444
+ //#region src/server/usage/codex.ts
13445
+ var AUTH$2 = path.join(HOME, ".codex", "auth.json");
13446
+ /** Live rate-limit windows from the endpoint the Codex CLI itself uses. */
13447
+ async function fetchUsage$2() {
13448
+ const tokens = obj(readJson(AUTH$2)?.tokens);
13449
+ const token = str(tokens.access_token);
13450
+ if (!token) return null;
13451
+ return obj(await fetchJson("https://chatgpt.com/backend-api/wham/usage", { headers: {
13452
+ Authorization: `Bearer ${token}`,
13453
+ "chatgpt-account-id": str(tokens.account_id),
13454
+ "User-Agent": "codex-cli",
13455
+ Accept: "application/json"
13456
+ } }));
13457
+ }
13458
+ /** (used percent, reset) for whichever window is `seconds` long — the two
13459
+ * windows arrive as primary/secondary rather than named 5h / 7d. */
13460
+ function window$1(rateLimit, seconds) {
13461
+ for (const key of ["primary_window", "secondary_window"]) {
13462
+ const win = obj(rateLimit[key]);
13463
+ if (num(win.limit_window_seconds) !== seconds) continue;
13464
+ const used = num(win.used_percent);
13465
+ return [used == null ? null : Math.trunc(used), isoFromEpoch(win.reset_at)];
13466
+ }
13467
+ return [null, null];
13468
+ }
13469
+ function parseRow$3(payload, source) {
13470
+ const rateLimit = obj(payload.rate_limit);
13471
+ const [five, fiveResets] = window$1(rateLimit, 18e3);
13472
+ const [seven, sevenResets] = window$1(rateLimit, 604800);
13473
+ return {
13474
+ agent: "codex",
13475
+ plan: str(payload.plan_type) || "codex",
13476
+ account: maskEmail(str(payload.email)),
13477
+ five_h: five,
13478
+ five_h_resets: fiveResets,
13479
+ seven_d: seven,
13480
+ seven_d_resets: sevenResets,
13481
+ fable: null,
13482
+ fable_resets: null,
13483
+ source
13484
+ };
13485
+ }
13486
+ async function codexRow() {
13487
+ const { payload, source, reason } = await loadPayload("codex", fetchUsage$2);
13488
+ const missingAuth = fs.existsSync(AUTH$2) ? void 0 : noAuthReason("codex");
13489
+ return markStale(payload ? parseRow$3(payload, source) : {
13490
+ ...blankRow("codex", source),
13491
+ note: missingAuth ?? "usage unavailable"
13492
+ }, "codex", void 0, missingAuth ?? reason);
13493
+ }
13494
+ //#endregion
13495
+ //#region src/server/usage/copilot.ts
13496
+ var USER_API = "https://api.github.com/copilot_internal/user";
13497
+ var HOSTS = path.join(process.env.XDG_CONFIG_HOME || path.join(HOME, ".config"), "gh", "hosts.yml");
13498
+ var SESSION_DB = path.join(HOME, ".copilot", "session-store.db");
13499
+ /** github.com's `oauth_token` straight out of gh's own hosts.yml.
13500
+ *
13501
+ * Deliberately not a YAML parse (no dependency): track the current top-level
13502
+ * host key by indentation and take the first token beneath github.com. */
13503
+ function hostsToken() {
13504
+ let text;
13505
+ try {
13506
+ text = fs.readFileSync(HOSTS, "utf8");
13507
+ } catch {
13508
+ return null;
13509
+ }
13510
+ let host = "";
13511
+ for (const line of text.split("\n")) {
13512
+ if (line[0]?.trim() && line.trimEnd().endsWith(":")) {
13513
+ host = line.trim().replace(/:$/, "");
13514
+ continue;
13515
+ }
13516
+ if (host !== "github.com") continue;
13517
+ const match = /^\s+oauth_token:\s*(\S+)/.exec(line);
13518
+ if (match) return match[1] ?? null;
13519
+ }
13520
+ return null;
13521
+ }
13522
+ /** The Copilot CLI keeps its own auth in the OS keyring, so reuse the token
13523
+ * gh manages. Copilot entitlement is account-scoped, so any valid token for
13524
+ * the entitled user reads the quota. */
13525
+ async function token() {
13526
+ for (const key of ["GH_TOKEN", "GITHUB_TOKEN"]) {
13527
+ const value = process.env[key]?.trim();
13528
+ if (value) return value;
13529
+ }
13530
+ const fromHosts = hostsToken();
13531
+ if (fromHosts) return fromHosts;
13532
+ try {
13533
+ return await run("gh", ["auth", "token"]) || null;
13534
+ } catch {
13535
+ return null;
13536
+ }
13537
+ }
13538
+ async function fetchUsage$1(auth) {
13539
+ if (!auth) return null;
13540
+ const data = obj(await fetchJson(USER_API, { headers: {
13541
+ Authorization: `token ${auth}`,
13542
+ "User-Agent": "GitHubCopilotCLI",
13543
+ Accept: "application/json"
13544
+ } }));
13545
+ return data.quota_snapshots == null ? null : data;
13546
+ }
13547
+ /** Billing period start = one month before the quota reset date. */
13548
+ function periodStart(resetIso) {
13549
+ const reset = new Date(resetIso);
13550
+ if (Number.isNaN(reset.getTime())) return null;
13551
+ const year = reset.getUTCMonth() === 0 ? reset.getUTCFullYear() - 1 : reset.getUTCFullYear();
13552
+ const month = reset.getUTCMonth() === 0 ? 12 : reset.getUTCMonth();
13553
+ const day = Math.min(reset.getUTCDate(), 28);
13554
+ return `${String(year).padStart(4, "0")}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
13555
+ }
13556
+ /** Credits this machine's Copilot CLI has spent in the current period.
13557
+ *
13558
+ * GitHub's own quota snapshot is batched — it can still read `credits_used: 0`
13559
+ * minutes after a session that plainly spent credits — so the CLI's local
13560
+ * ledger is the only number that moves in real time. It sees this machine
13561
+ * only, which is why the caller floors it with upstream rather than trusting
13562
+ * it alone. */
13563
+ function localCredits(start) {
13564
+ if (!start || !fs.existsSync(SESSION_DB)) return null;
13565
+ try {
13566
+ const db = new DatabaseSync(SESSION_DB, { readOnly: true });
13567
+ try {
13568
+ const nano = num(db.prepare("select sum(total_nano_aiu) as nano from assistant_usage_events where created_at >= ?").get(start)?.nano);
13569
+ return nano == null ? 0 : nano / 1e9;
13570
+ } finally {
13571
+ db.close();
13572
+ }
13573
+ } catch {
13574
+ return null;
13575
+ }
13576
+ }
13577
+ function parseRow$2(payload, source) {
13578
+ const premium = obj(obj(payload.quota_snapshots).premium_interactions);
13579
+ const reset = str(payload.quota_reset_date_utc || payload.quota_reset_date) || null;
13580
+ let pct = null;
13581
+ let note;
13582
+ if (!Object.keys(premium).length || !premium.has_quota) note = "no premium quota";
13583
+ else if (premium.unlimited) note = "unlimited premium requests";
13584
+ else {
13585
+ const remaining = num(premium.percent_remaining);
13586
+ if (remaining != null) pct = 100 - remaining;
13587
+ const entitlement = num(premium.entitlement) ?? 0;
13588
+ const used = reset ? localCredits(periodStart(reset)) : null;
13589
+ if (entitlement > 0 && used != null) {
13590
+ const localPct = 100 * used / entitlement;
13591
+ if (pct == null || localPct > pct) {
13592
+ pct = localPct;
13593
+ source = `${source}+local`;
13594
+ }
13595
+ }
13596
+ }
13597
+ if (pct != null) pct = Math.round(pct * 1e3) / 1e3;
13598
+ const row = {
13599
+ agent: "copilot",
13600
+ plan: str(payload.copilot_plan) || "copilot",
13601
+ account: str(payload.login) || "—",
13602
+ five_h: null,
13603
+ five_h_resets: null,
13604
+ seven_d: pct,
13605
+ seven_d_resets: pct == null ? null : reset,
13606
+ fable: null,
13607
+ fable_resets: null,
13608
+ source
13609
+ };
13610
+ if (note) row.note = note;
13611
+ return row;
13612
+ }
13613
+ async function copilotRow() {
13614
+ const auth = await token();
13615
+ const { payload, source, reason } = await loadPayload("copilot", () => fetchUsage$1(auth));
13616
+ const missingAuth = auth ? void 0 : noAuthReason("copilot");
13617
+ return markStale(payload ? parseRow$2(payload, source) : {
13618
+ ...blankRow("copilot", source),
13619
+ note: missingAuth ?? "usage unavailable"
13620
+ }, "copilot", void 0, missingAuth ?? reason);
13621
+ }
13622
+ //#endregion
13623
+ //#region src/server/usage/cursor.ts
13624
+ var AUTH$1 = path.join(HOME, ".config", "cursor", "auth.json");
13625
+ var CLI_CONFIG = path.join(HOME, ".cursor", "cli-config.json");
13626
+ var API = "https://api2.cursor.sh";
13627
+ var WWW = "https://cursor.com";
13628
+ function cursorAuth() {
13629
+ const auth = readJson(AUTH$1);
13630
+ if (!auth) return null;
13631
+ const token = str(auth.accessToken || auth.access_token);
13632
+ if (!token) return null;
13633
+ let sub = "";
13634
+ try {
13635
+ sub = str(obj(JSON.parse(Buffer.from(str(token.split(".")[1]), "base64url").toString())).sub);
13636
+ } catch {}
13637
+ return {
13638
+ token,
13639
+ sub,
13640
+ email: str(obj(readJson(CLI_CONFIG)?.authInfo).email).trim()
13641
+ };
13642
+ }
13643
+ var dashboardPost = async (token, method) => obj(await fetchJson(`${API}/aiserver.v1.DashboardService/${method}`, {
13644
+ method: "POST",
13645
+ body: "{}",
13646
+ headers: {
13647
+ Authorization: `Bearer ${token}`,
13648
+ "Content-Type": "application/json",
13649
+ Accept: "application/json",
13650
+ "Connect-Protocol-Version": "1",
13651
+ "User-Agent": "cursor-agent"
13652
+ }
13653
+ }));
13654
+ /** Enterprise/team monthly pool, which the dashboard service leaves empty —
13655
+ * it is only readable with the web session cookie. */
13656
+ async function usageSummary(auth) {
13657
+ if (!auth.sub) return null;
13658
+ const cookie = `WorkosCursorSessionToken=${encodeURIComponent(`${auth.sub}::${auth.token}`)}`;
13659
+ return obj(await fetchJson(`${WWW}/api/usage-summary`, { headers: {
13660
+ Cookie: cookie,
13661
+ Accept: "application/json",
13662
+ "User-Agent": "Mozilla/5.0"
13663
+ } }));
13664
+ }
13665
+ /** Prefer the dashboard's planUsage (Pro/Ultra); fall back to the web
13666
+ * summary for Enterprise/team accounts, where planUsage comes back empty.
13667
+ * Each call is optional on its own, so one failing endpoint must not hide a
13668
+ * number another would have produced — but if nothing lands, the first
13669
+ * failure is rethrown so the row can say why. */
13670
+ async function fetchUsage(auth) {
13671
+ let failure;
13672
+ const soft = async (load) => {
13673
+ try {
13674
+ return await load();
13675
+ } catch (err) {
13676
+ failure ??= err;
13677
+ return null;
13678
+ }
13679
+ };
13680
+ const [period, planInfo] = await Promise.all([soft(() => dashboardPost(auth.token, "GetCurrentPeriodUsage")), soft(() => dashboardPost(auth.token, "GetPlanInfo"))]);
13681
+ const planUsage = obj(obj(period).planUsage);
13682
+ const summary = num(planUsage.limit) ? null : await soft(() => usageSummary(auth));
13683
+ if (!Object.keys(planUsage).length && !summary) {
13684
+ if (failure) throw failure;
13685
+ return null;
13686
+ }
13687
+ return {
13688
+ period: obj(period),
13689
+ plan_info: obj(obj(planInfo).planInfo),
13690
+ summary
13691
+ };
13692
+ }
13693
+ function parseRow$1(payload, auth, source) {
13694
+ const period = obj(payload.period);
13695
+ const planInfo = obj(payload.plan_info);
13696
+ const summary = obj(payload.summary);
13697
+ let pct = num(obj(period.planUsage).totalPercentUsed);
13698
+ let resets = isoFromEpoch(period.billingCycleEnd);
13699
+ if (pct == null) {
13700
+ const overall = obj(obj(summary.individualUsage).overall);
13701
+ const used = num(overall.used);
13702
+ const limit = num(overall.limit);
13703
+ if (used != null && limit) pct = Math.round(100 * used / limit);
13704
+ resets = str(summary.billingCycleEnd) || resets;
13705
+ }
13706
+ return {
13707
+ agent: "cursor",
13708
+ plan: str(planInfo.planName || summary.membershipType) || "cursor",
13709
+ account: auth?.email ? maskEmail(auth.email) : "—",
13710
+ five_h: null,
13711
+ five_h_resets: null,
13712
+ seven_d: pct == null ? null : Math.trunc(pct),
13713
+ seven_d_resets: resets,
13714
+ fable: null,
13715
+ fable_resets: null,
13716
+ source
13717
+ };
13718
+ }
13719
+ async function cursorRow() {
13720
+ const auth = cursorAuth();
13721
+ const { payload, source, reason } = await loadPayload("cursor", () => auth ? fetchUsage(auth) : Promise.resolve(null));
13722
+ const missingAuth = auth ? void 0 : noAuthReason("cursor");
13723
+ return markStale(payload ? parseRow$1(payload, auth, source) : {
13724
+ ...blankRow("cursor", source),
13725
+ note: missingAuth ?? "usage unavailable"
13726
+ }, "cursor", void 0, missingAuth ?? reason);
13727
+ }
13728
+ //#endregion
13729
+ //#region src/server/usage/grok.ts
13730
+ var AUTH = path.join(HOME, ".grok", "auth.json");
13731
+ var LOG = path.join(HOME, ".grok", "logs", "unified.jsonl");
13732
+ /** The newest usable entry in ~/.grok/auth.json, which is keyed by scope
13733
+ * rather than being a single credential. */
13734
+ function grokAuth() {
13735
+ const auth = readJson(AUTH);
13736
+ if (!auth) return null;
13737
+ const entry = Object.values(auth).map(obj).filter((entry) => str(entry.key) || str(entry.access_token)).sort((a, b) => str(b.create_time || b.expires_at).localeCompare(str(a.create_time || a.expires_at)))[0];
13738
+ if (!entry) return null;
13739
+ return {
13740
+ token: str(entry.key) || str(entry.access_token),
13741
+ email: str(entry.email),
13742
+ expiresAt: entry.expires_at
13743
+ };
13744
+ }
13745
+ /** Weekly credit pool from the Grok Build CLI's own proxy. */
13746
+ async function fetchBilling(token) {
13747
+ const data = obj(await fetchJson("https://cli-chat-proxy.grok.com/v1/billing?format=credits", { headers: {
13748
+ Authorization: `Bearer ${token}`,
13749
+ Accept: "application/json",
13750
+ "User-Agent": "grok-cli",
13751
+ "x-grok-client-mode": "cli"
13752
+ } }));
13753
+ return data.config ? data : null;
13754
+ }
13755
+ /** Fallback: the last credits config the CLI logged, normalized to the live
13756
+ * API's shape. Reads only the tail — this log grows without bound. */
13757
+ function billingFromLogs() {
13758
+ let chunk;
13759
+ try {
13760
+ const { size } = fs.statSync(LOG);
13761
+ const start = Math.max(0, size - 512e3);
13762
+ const fd = fs.openSync(LOG, "r");
13763
+ try {
13764
+ const buf = Buffer.alloc(size - start);
13765
+ fs.readSync(fd, buf, 0, buf.length, start);
13766
+ chunk = buf.toString("utf8");
13767
+ } finally {
13768
+ fs.closeSync(fd);
13769
+ }
13770
+ } catch {
13771
+ return null;
13772
+ }
13773
+ let latest = null;
13774
+ for (const line of chunk.split("\n")) {
13775
+ if (!line.includes("billing: fetched credits config")) continue;
13776
+ try {
13777
+ const entry = obj(JSON.parse(line));
13778
+ if (entry.msg === "billing: fetched credits config") latest = entry;
13779
+ } catch {}
13780
+ }
13781
+ if (!latest) return null;
13782
+ const ctx = obj(latest.ctx);
13783
+ const cfg = obj(ctx.config);
13784
+ if (!Object.keys(cfg).length) return null;
13785
+ return {
13786
+ config: cfg,
13787
+ subscriptionTier: ctx.subscriptionTier
13788
+ };
13789
+ }
13790
+ function parseRow(payload, auth, source) {
13791
+ const cfg = payload.config ? obj(payload.config) : payload;
13792
+ const pct = num(cfg.creditUsagePercent);
13793
+ let productPct = null;
13794
+ for (const entry of arr(cfg.productUsage)) {
13795
+ const usage = obj(entry);
13796
+ if (!str(usage.product).toLowerCase().includes("grok")) continue;
13797
+ productPct = num(usage.usagePercent);
13798
+ break;
13799
+ }
13800
+ const used = pct ?? productPct;
13801
+ const period = obj(cfg.currentPeriod);
13802
+ return {
13803
+ agent: "grok",
13804
+ plan: str(payload.subscriptionTier || cfg.subscriptionTier) || "Grok Build",
13805
+ account: auth?.email ? maskEmail(auth.email) : "—",
13806
+ five_h: null,
13807
+ five_h_resets: null,
13808
+ seven_d: used == null ? null : Math.trunc(used),
13809
+ seven_d_resets: str(period.end || cfg.billingPeriodEnd) || null,
13810
+ fable: null,
13811
+ fable_resets: null,
13812
+ source
13813
+ };
13814
+ }
13815
+ async function grokRow() {
13816
+ const auth = grokAuth();
13817
+ const loaded = await loadPayload("grok", () => auth?.token ? fetchBilling(auth.token) : Promise.resolve(null));
13818
+ const fromLog = loaded.payload ? null : billingFromLogs();
13819
+ const payload = loaded.payload ?? fromLog;
13820
+ const source = fromLog ? "unified.jsonl" : loaded.source;
13821
+ const missingAuth = auth?.token ? void 0 : noAuthReason("grok");
13822
+ return markStale(payload ? parseRow(payload, auth, source) : {
13823
+ ...blankRow("grok", source),
13824
+ note: missingAuth ?? "usage unavailable"
13825
+ }, "grok", expired(auth?.expiresAt), missingAuth ?? loaded.reason);
13826
+ }
13827
+ //#endregion
13828
+ //#region src/server/usage/index.ts
13479
13829
  var TTL_MS = 6e4;
13480
- /** Plan/quota usage across agent accounts, via the plan-usage CLI. */
13481
- var usage = (refresh = false) => cached("usage", refresh);
13482
- var cached = swr(TTL_MS, fetchUsage);
13483
- /** Age of a row that the CLI served from a failed refresh, in seconds
13484
- * undefined when the numbers are current. Percentages from a stale row
13485
- * describe a window that has since moved on, so they can't be shown as
13486
- * live figures. */
13830
+ /** Plan/quota usage across every agent account this machine is signed into.
13831
+ *
13832
+ * Each provider is one blocking HTTPS round trip against the same endpoint its
13833
+ * own CLI uses; they touch disjoint credentials and cache files, so they run
13834
+ * concurrently and the wait is the slowest single provider, not their sum. */
13835
+ async function collect() {
13836
+ const providers = [
13837
+ ...claudeAccounts().map((account) => [account.label, () => claudeRow(account)]),
13838
+ ["codex", codexRow],
13839
+ ["cursor", cursorRow],
13840
+ ["grok", grokRow],
13841
+ ["copilot", copilotRow]
13842
+ ];
13843
+ return Promise.all(providers.map(([key, load]) => load().catch(() => ({
13844
+ ...blankRow(key, "error"),
13845
+ note: "fetch failed"
13846
+ }))));
13847
+ }
13848
+ /** Age of a row served from a failed refresh, in seconds — undefined when the
13849
+ * numbers are current. Percentages from a stale row describe a window that has
13850
+ * since moved on, so they can't be shown as live figures. */
13487
13851
  function staleSeconds(source) {
13488
- const match = /^stale-cache\s+(\d+(?:\.\d+)?)s/.exec(source || "");
13852
+ const match = /^stale-cache\s+(\d+)s/.exec(source);
13489
13853
  return match ? Number(match[1]) : void 0;
13490
13854
  }
13491
- async function fetchUsage(_key, refresh) {
13492
- let out = refresh ? await run("plan-usage", ["--json", "--refresh"]) : await run("plan-usage", ["--json", "--no-wait"]);
13493
- let rows = JSON.parse(out);
13494
- if (!rows.length && !refresh) {
13495
- out = await run("plan-usage", ["--json"]);
13496
- rows = JSON.parse(out);
13497
- }
13498
- return { agents: rows.map((row) => ({
13855
+ var cached = swr(TTL_MS, (_key, _refresh) => collect());
13856
+ var usage = async (refresh = false) => {
13857
+ return { agents: (await cached("usage", refresh)).map((row) => ({
13499
13858
  agent: row.agent,
13500
13859
  plan: row.plan,
13501
13860
  account: row.account,
13502
13861
  stale_seconds: staleSeconds(row.source),
13862
+ note: row.stale_reason || row.note,
13503
13863
  windows: [
13504
13864
  {
13505
13865
  window: "5h",
@@ -13518,7 +13878,7 @@ async function fetchUsage(_key, refresh) {
13518
13878
  }
13519
13879
  ].filter((w) => w.used_percent != null)
13520
13880
  })) };
13521
- }
13881
+ };
13522
13882
  //#endregion
13523
13883
  //#region __marko-run__api.usage.js
13524
13884
  var getHandler$6 = normalizeHandler(Run.GET({ search: (value) => ({ refresh: "refresh" in value }) }, async (ctx) => Response.json(await usage(ctx.search.refresh))), "GET");
@@ -18650,4 +19010,4 @@ server.listen(port, () => {
18650
19010
  //#endregion
18651
19011
  export {};
18652
19012
 
18653
- ;var __MARKO_MANIFEST__={"esfPH6H":{"block":[2,"stylesheet#/assets/index-BJLi-qve.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/index-BJLi-qve.css\"",">"],"defer":[2,"/assets/index-YZZGnWtK.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/index-YZZGnWtK.js\"","></script>"]}};
19013
+ ;var __MARKO_MANIFEST__={"esfPH6H":{"block":[2,"stylesheet#/assets/index-B0XMMdPo.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/index-B0XMMdPo.css\"",">"],"defer":[2,"/assets/index-CNo7v-9k.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/index-CNo7v-9k.js\"","></script>"]}};