@band-app/server 0.41.0 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/client/_shell.html +0 -0
  2. package/dist/client/assets/{TerminalPanel-DzwOCJgG.js → TerminalPanel-BdNt_1-v.js} +1 -1
  3. package/dist/client/assets/{_basePickBy-BbA0AK3Z.js → _basePickBy-Dt5aurJR.js} +1 -1
  4. package/dist/client/assets/{_baseUniq-7qBqNXaW.js → _baseUniq-eGBE_G8J.js} +1 -1
  5. package/dist/client/assets/arc-C2TAcIr0.js +1 -0
  6. package/dist/client/assets/architectureDiagram-VXUJARFQ-CXYQ0Bl3.js +36 -0
  7. package/dist/client/assets/{blockDiagram-VD42YOAC-BX7Q-Y-Z.js → blockDiagram-VD42YOAC-QNGIe7jl.js} +4 -4
  8. package/dist/client/assets/{c4Diagram-YG6GDRKO-D6oNykqq.js → c4Diagram-YG6GDRKO-DNBB986h.js} +1 -1
  9. package/dist/client/assets/channel-C-DZN68q.js +1 -0
  10. package/dist/client/assets/{chunk-4BX2VUAB-CZFccwrm.js → chunk-4BX2VUAB-BiYeCu61.js} +1 -1
  11. package/dist/client/assets/{chunk-55IACEB6-D0E4pVWT.js → chunk-55IACEB6-DetvZt2e.js} +1 -1
  12. package/dist/client/assets/{chunk-B4BG7PRW-TTgyO2eD.js → chunk-B4BG7PRW-C6yj2phu.js} +4 -4
  13. package/dist/client/assets/{chunk-DI55MBZ5-AIJYecXR.js → chunk-DI55MBZ5-C3tA1HuX.js} +3 -3
  14. package/dist/client/assets/{chunk-FMBD7UC4-B2zMS0uI.js → chunk-FMBD7UC4-BQgPG9nP.js} +1 -1
  15. package/dist/client/assets/{chunk-QN33PNHL-DQRknmIe.js → chunk-QN33PNHL-BEe46vEx.js} +1 -1
  16. package/dist/client/assets/{chunk-QZHKN3VN-BIu0YoeS.js → chunk-QZHKN3VN-S1hRRppa.js} +1 -1
  17. package/dist/client/assets/{chunk-TZMSLE5B-DKIlFZR0.js → chunk-TZMSLE5B-DzuJYhii.js} +1 -1
  18. package/dist/client/assets/classDiagram-2ON5EDUG-CnfpJOrh.js +1 -0
  19. package/dist/client/assets/classDiagram-v2-WZHVMYZB-CnfpJOrh.js +1 -0
  20. package/dist/client/assets/clone-HEWjuVIQ.js +1 -0
  21. package/dist/client/assets/{cose-bilkent-S5V4N54A-ex3FJdXX.js → cose-bilkent-S5V4N54A-CUxpzpxe.js} +1 -1
  22. package/dist/client/assets/{dagre-6UL2VRFP-BQccV2Oh.js → dagre-6UL2VRFP-CxQr_vx3.js} +2 -2
  23. package/dist/client/assets/diagram-PSM6KHXK-BM9S3pcM.js +24 -0
  24. package/dist/client/assets/diagram-QEK2KX5R-00WgBgwT.js +43 -0
  25. package/dist/client/assets/diagram-S2PKOQOG-CkydGteg.js +24 -0
  26. package/dist/client/assets/{erDiagram-Q2GNP2WA-BDgd89GY.js → erDiagram-Q2GNP2WA-DDbgp90K.js} +4 -4
  27. package/dist/client/assets/{flowDiagram-NV44I4VS-B9xSueau.js → flowDiagram-NV44I4VS-1sWwkovK.js} +9 -9
  28. package/dist/client/assets/{ganttDiagram-JELNMOA3-CFcgGsc7.js → ganttDiagram-JELNMOA3-z9MMcnjj.js} +4 -4
  29. package/dist/client/assets/gitGraphDiagram-V2S2FVAM-CEeNZDag.js +65 -0
  30. package/dist/client/assets/{graph-DZ6Lx-8Y.js → graph-8-N2XIVg.js} +1 -1
  31. package/dist/client/assets/{highlighted-body-B3W2YXNL-lm1TiFRw.js → highlighted-body-B3W2YXNL-oqBJo7Lw.js} +1 -1
  32. package/dist/client/assets/{index-nyUf-u5Y.js → index-B0DR0_5t.js} +2 -2
  33. package/dist/client/assets/{index-BevGkjsB.js → index-B10E2JKM.js} +1 -1
  34. package/dist/client/assets/{index-B0HZf5lc.js → index-BSMwXa_n.js} +1 -1
  35. package/dist/client/assets/index-BW8m1RE2.js +1 -0
  36. package/dist/client/assets/{index-FPCQZue_.js → index-BYyaVskX.js} +1 -1
  37. package/dist/client/assets/{index-BWttkIAc.js → index-BfpCIunK.js} +1 -1
  38. package/dist/client/assets/index-BjeVPwqv.js +1 -0
  39. package/dist/client/assets/index-CWgE6xNM.js +1 -0
  40. package/dist/client/assets/{index-gZwU3Li4.js → index-Ci4aLxZE.js} +1 -1
  41. package/dist/client/assets/{index-CiNxyl-l.js → index-D7GkBMm7.js} +1 -1
  42. package/dist/client/assets/{index-LhW9mPd1.js → index-DgfP7WcS.js} +1 -1
  43. package/dist/client/assets/{index-VMHm_SIX.js → index-DyktM7iC.js} +1 -1
  44. package/dist/client/assets/{index-DryoH4oH.js → index-UwPr1Bxu.js} +1 -1
  45. package/dist/client/assets/{infoDiagram-HS3SLOUP-Bt6yv7W6.js → infoDiagram-HS3SLOUP-0xlIsMeE.js} +1 -1
  46. package/dist/client/assets/{journeyDiagram-XKPGCS4Q-PfejmU_v.js → journeyDiagram-XKPGCS4Q-URjejIwO.js} +3 -3
  47. package/dist/client/assets/{kanban-definition-3W4ZIXB7-CsVOiW8_.js → kanban-definition-3W4ZIXB7-iMd66xJM.js} +7 -7
  48. package/dist/client/assets/{layout-CSXbAcxM.js → layout-CZKMoUju.js} +1 -1
  49. package/dist/client/assets/{main-CahoCY50.js → main-Bf7Cqkhh.js} +261 -261
  50. package/dist/client/assets/main-D4L0ZncB.css +1 -0
  51. package/dist/client/assets/{mindmap-definition-VGOIOE7T-qJiw2dzx.js → mindmap-definition-VGOIOE7T-BgBLqjDc.js} +5 -5
  52. package/dist/client/assets/pieDiagram-ADFJNKIX-CZlj_xhf.js +30 -0
  53. package/dist/client/assets/project._projectId-DkEX_rhg.js +1 -0
  54. package/dist/client/assets/{quadrantDiagram-AYHSOK5B-Dp2xa_Jl.js → quadrantDiagram-AYHSOK5B-egWT3ySU.js} +1 -1
  55. package/dist/client/assets/{requirementDiagram-UZGBJVZJ-DBhY9Ivc.js → requirementDiagram-UZGBJVZJ-C1f4-YqC.js} +1 -1
  56. package/dist/client/assets/sankeyDiagram-TZEHDZUN-BIBQCdMV.js +10 -0
  57. package/dist/client/assets/{sequenceDiagram-WL72ISMW-CSnIFlVM.js → sequenceDiagram-WL72ISMW-CwcAaqPr.js} +5 -5
  58. package/dist/client/assets/{stateDiagram-FKZM4ZOC-EP5Og_61.js → stateDiagram-FKZM4ZOC-BR0ZE0jR.js} +1 -1
  59. package/dist/client/assets/stateDiagram-v2-4FDKWEC3-Bl6SncpV.js +1 -0
  60. package/dist/client/assets/{timeline-definition-IT6M3QCI-BXA6T7e3.js → timeline-definition-IT6M3QCI-Br4v6z5c.js} +3 -3
  61. package/dist/client/assets/{treemap-GDKQZRPO-C9S3U5bB.js → treemap-GDKQZRPO-BknlJ8NC.js} +1 -1
  62. package/dist/client/assets/use-worktree-route-BKyPkuvd.js +1 -0
  63. package/dist/client/assets/worktree._worktreeId-C4rABxUB.js +1 -0
  64. package/dist/client/assets/{worktree._worktreeId-D0jmSP1c.js → worktree._worktreeId-DmBaR5MI.js} +1 -1
  65. package/dist/client/assets/{xychartDiagram-PRI3JC2R-hAwziUwL.js → xychartDiagram-PRI3JC2R-CUQFNqNp.js} +1 -1
  66. package/dist/migrations/20261006195855_repo_remote_url/migration.sql +3 -0
  67. package/dist/migrations/20261006195855_repo_remote_url/snapshot.json +5056 -0
  68. package/dist/migrations/20261006230403_project_folder/migration.sql +25 -0
  69. package/dist/migrations/20261006230403_project_folder/snapshot.json +5089 -0
  70. package/dist/migrations/20261007000744_tasks/migration.sql +42 -0
  71. package/dist/migrations/20261007000744_tasks/snapshot.json +5137 -0
  72. package/dist/migrations/20261008080246_project_title/migration.sql +1 -0
  73. package/dist/migrations/20261008080246_project_title/snapshot.json +5147 -0
  74. package/dist/openapi.json +2609 -1874
  75. package/dist/start-server.mjs +15977 -14161
  76. package/dist/terminal-daemon.mjs +176 -113
  77. package/package.json +5 -5
  78. package/dist/client/assets/arc-BujIJH3M.js +0 -1
  79. package/dist/client/assets/architectureDiagram-VXUJARFQ-Cee7WnhD.js +0 -36
  80. package/dist/client/assets/channel-SjEjlKmZ.js +0 -1
  81. package/dist/client/assets/classDiagram-2ON5EDUG-vrcqihoj.js +0 -1
  82. package/dist/client/assets/classDiagram-v2-WZHVMYZB-vrcqihoj.js +0 -1
  83. package/dist/client/assets/clone-DjMW8R3_.js +0 -1
  84. package/dist/client/assets/diagram-PSM6KHXK-BQWa4ypA.js +0 -24
  85. package/dist/client/assets/diagram-QEK2KX5R-Bm3_NNAN.js +0 -43
  86. package/dist/client/assets/diagram-S2PKOQOG-B2cGsBpb.js +0 -24
  87. package/dist/client/assets/gitGraphDiagram-V2S2FVAM-COOST92i.js +0 -65
  88. package/dist/client/assets/index-B58h_cDk.js +0 -1
  89. package/dist/client/assets/index-BWb9wrSA.js +0 -1
  90. package/dist/client/assets/index-CvAjqNkv.js +0 -1
  91. package/dist/client/assets/main-C5QtVVSn.css +0 -1
  92. package/dist/client/assets/pieDiagram-ADFJNKIX-CJze21HD.js +0 -30
  93. package/dist/client/assets/sankeyDiagram-TZEHDZUN-KSpbyhmf.js +0 -10
  94. package/dist/client/assets/stateDiagram-v2-4FDKWEC3-BeW6GbJh.js +0 -1
  95. package/dist/client/assets/worktree._worktreeId-DJBTc5Ct.js +0 -1
@@ -2024,7 +2024,7 @@ var require_thread_stream = __commonJS({
2024
2024
  var { version } = require_package();
2025
2025
  var { EventEmitter } = __require("events");
2026
2026
  var { Worker } = __require("worker_threads");
2027
- var { join: join7 } = __require("path");
2027
+ var { join: join8 } = __require("path");
2028
2028
  var { pathToFileURL } = __require("url");
2029
2029
  var { wait } = require_wait();
2030
2030
  var {
@@ -2060,7 +2060,7 @@ var require_thread_stream = __commonJS({
2060
2060
  function createWorker(stream, opts) {
2061
2061
  const { filename, workerData } = opts;
2062
2062
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
2063
- const toExecute = bundlerOverrides["thread-stream-worker"] || join7(__dirname, "lib", "worker.js");
2063
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join8(__dirname, "lib", "worker.js");
2064
2064
  const worker = new Worker(toExecute, {
2065
2065
  ...opts.workerOpts,
2066
2066
  trackUnmanagedFds: false,
@@ -2446,7 +2446,7 @@ var require_transport = __commonJS({
2446
2446
  "use strict";
2447
2447
  var { createRequire } = __require("module");
2448
2448
  var getCallers = require_caller();
2449
- var { join: join7, isAbsolute, sep: sep2 } = __require("node:path");
2449
+ var { join: join8, isAbsolute, sep: sep2 } = __require("node:path");
2450
2450
  var sleep = require_atomic_sleep();
2451
2451
  var onExit = require_on_exit_leak_free();
2452
2452
  var ThreadStream = require_thread_stream();
@@ -2509,7 +2509,7 @@ var require_transport = __commonJS({
2509
2509
  throw new Error("only one of target or targets can be specified");
2510
2510
  }
2511
2511
  if (targets) {
2512
- target = bundlerOverrides["pino-worker"] || join7(__dirname, "worker.js");
2512
+ target = bundlerOverrides["pino-worker"] || join8(__dirname, "worker.js");
2513
2513
  options.targets = targets.filter((dest) => dest.target).map((dest) => {
2514
2514
  return {
2515
2515
  ...dest,
@@ -2527,7 +2527,7 @@ var require_transport = __commonJS({
2527
2527
  });
2528
2528
  });
2529
2529
  } else if (pipeline) {
2530
- target = bundlerOverrides["pino-worker"] || join7(__dirname, "worker.js");
2530
+ target = bundlerOverrides["pino-worker"] || join8(__dirname, "worker.js");
2531
2531
  options.pipelines = [pipeline.map((dest) => {
2532
2532
  return {
2533
2533
  ...dest,
@@ -2549,7 +2549,7 @@ var require_transport = __commonJS({
2549
2549
  return origin;
2550
2550
  }
2551
2551
  if (origin === "pino/file") {
2552
- return join7(__dirname, "..", "file.js");
2552
+ return join8(__dirname, "..", "file.js");
2553
2553
  }
2554
2554
  let fixTarget2;
2555
2555
  for (const filePath of callers) {
@@ -3001,23 +3001,23 @@ var require_levels = __commonJS({
3001
3001
  }
3002
3002
  }
3003
3003
  function setLevel(level) {
3004
- const { labels, values: values2 } = this.levels;
3004
+ const { labels, values } = this.levels;
3005
3005
  if (typeof level === "number") {
3006
3006
  if (labels[level] === void 0) throw Error("unknown level value" + level);
3007
3007
  level = labels[level];
3008
3008
  }
3009
- if (values2[level] === void 0) throw Error("unknown level " + level);
3009
+ if (values[level] === void 0) throw Error("unknown level " + level);
3010
3010
  const preLevelVal = this[levelValSym];
3011
- const levelVal = this[levelValSym] = values2[level];
3011
+ const levelVal = this[levelValSym] = values[level];
3012
3012
  const useOnlyCustomLevelsVal = this[useOnlyCustomLevelsSym];
3013
3013
  const levelComparison = this[levelCompSym];
3014
3014
  const hook = this[hooksSym].logMethod;
3015
- for (const key in values2) {
3016
- if (levelComparison(values2[key], levelVal) === false) {
3015
+ for (const key in values) {
3016
+ if (levelComparison(values[key], levelVal) === false) {
3017
3017
  this[key] = noop;
3018
3018
  continue;
3019
3019
  }
3020
- this[key] = isStandardLevel(key, useOnlyCustomLevelsVal) ? levelMethods[key](hook) : genLog(values2[key], hook);
3020
+ this[key] = isStandardLevel(key, useOnlyCustomLevelsVal) ? levelMethods[key](hook) : genLog(values[key], hook);
3021
3021
  }
3022
3022
  this.emit(
3023
3023
  "level-change",
@@ -3033,8 +3033,8 @@ var require_levels = __commonJS({
3033
3033
  return levels && levels.labels ? levels.labels[levelVal] : "";
3034
3034
  }
3035
3035
  function isLevelEnabled(logLevel) {
3036
- const { values: values2 } = this.levels;
3037
- const logLevelVal = values2[logLevel];
3036
+ const { values } = this.levels;
3037
+ const logLevelVal = values[logLevel];
3038
3038
  return logLevelVal !== void 0 && this[levelCompSym](logLevelVal, this[levelValSym]);
3039
3039
  }
3040
3040
  function compareLevel(direction, current, expected) {
@@ -3059,21 +3059,21 @@ var require_levels = __commonJS({
3059
3059
  useOnlyCustomLevels ? null : nums,
3060
3060
  customNums
3061
3061
  );
3062
- const values2 = Object.assign(
3062
+ const values = Object.assign(
3063
3063
  Object.create(Object.prototype, { silent: { value: Infinity } }),
3064
3064
  useOnlyCustomLevels ? null : DEFAULT_LEVELS,
3065
3065
  customLevels
3066
3066
  );
3067
- return { labels, values: values2 };
3067
+ return { labels, values };
3068
3068
  }
3069
3069
  function assertDefaultLevelFound(defaultLevel, customLevels, useOnlyCustomLevels) {
3070
3070
  if (typeof defaultLevel === "number") {
3071
- const values2 = [].concat(
3071
+ const values = [].concat(
3072
3072
  Object.keys(customLevels || {}).map((key) => customLevels[key]),
3073
3073
  useOnlyCustomLevels ? [] : Object.keys(nums).map((level) => +level),
3074
3074
  Infinity
3075
3075
  );
3076
- if (!values2.includes(defaultLevel)) {
3076
+ if (!values.includes(defaultLevel)) {
3077
3077
  throw Error(`default level:${defaultLevel} must be included in custom levels`);
3078
3078
  }
3079
3079
  return;
@@ -3088,9 +3088,9 @@ var require_levels = __commonJS({
3088
3088
  }
3089
3089
  }
3090
3090
  function assertNoLevelCollisions(levels, customLevels) {
3091
- const { labels, values: values2 } = levels;
3091
+ const { labels, values } = levels;
3092
3092
  for (const k in customLevels) {
3093
- if (k in values2) {
3093
+ if (k in values) {
3094
3094
  throw Error("levels cannot be overridden");
3095
3095
  }
3096
3096
  if (customLevels[k] in labels) {
@@ -3538,7 +3538,7 @@ var require_safe_stable_stringify = __commonJS({
3538
3538
  return circularValue;
3539
3539
  }
3540
3540
  let res = "";
3541
- let join7 = ",";
3541
+ let join8 = ",";
3542
3542
  const originalIndentation = indentation;
3543
3543
  if (Array.isArray(value)) {
3544
3544
  if (value.length === 0) {
@@ -3552,7 +3552,7 @@ var require_safe_stable_stringify = __commonJS({
3552
3552
  indentation += spacer;
3553
3553
  res += `
3554
3554
  ${indentation}`;
3555
- join7 = `,
3555
+ join8 = `,
3556
3556
  ${indentation}`;
3557
3557
  }
3558
3558
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -3560,13 +3560,13 @@ ${indentation}`;
3560
3560
  for (; i < maximumValuesToStringify - 1; i++) {
3561
3561
  const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
3562
3562
  res += tmp2 !== void 0 ? tmp2 : "null";
3563
- res += join7;
3563
+ res += join8;
3564
3564
  }
3565
3565
  const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
3566
3566
  res += tmp !== void 0 ? tmp : "null";
3567
3567
  if (value.length - 1 > maximumBreadth) {
3568
3568
  const removedKeys = value.length - maximumBreadth - 1;
3569
- res += `${join7}"... ${getItemCount(removedKeys)} not stringified"`;
3569
+ res += `${join8}"... ${getItemCount(removedKeys)} not stringified"`;
3570
3570
  }
3571
3571
  if (spacer !== "") {
3572
3572
  res += `
@@ -3587,7 +3587,7 @@ ${originalIndentation}`;
3587
3587
  let separator = "";
3588
3588
  if (spacer !== "") {
3589
3589
  indentation += spacer;
3590
- join7 = `,
3590
+ join8 = `,
3591
3591
  ${indentation}`;
3592
3592
  whitespace = " ";
3593
3593
  }
@@ -3601,13 +3601,13 @@ ${indentation}`;
3601
3601
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
3602
3602
  if (tmp !== void 0) {
3603
3603
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
3604
- separator = join7;
3604
+ separator = join8;
3605
3605
  }
3606
3606
  }
3607
3607
  if (keyLength > maximumBreadth) {
3608
3608
  const removedKeys = keyLength - maximumBreadth;
3609
3609
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
3610
- separator = join7;
3610
+ separator = join8;
3611
3611
  }
3612
3612
  if (spacer !== "" && separator.length > 1) {
3613
3613
  res = `
@@ -3648,7 +3648,7 @@ ${originalIndentation}`;
3648
3648
  }
3649
3649
  const originalIndentation = indentation;
3650
3650
  let res = "";
3651
- let join7 = ",";
3651
+ let join8 = ",";
3652
3652
  if (Array.isArray(value)) {
3653
3653
  if (value.length === 0) {
3654
3654
  return "[]";
@@ -3661,7 +3661,7 @@ ${originalIndentation}`;
3661
3661
  indentation += spacer;
3662
3662
  res += `
3663
3663
  ${indentation}`;
3664
- join7 = `,
3664
+ join8 = `,
3665
3665
  ${indentation}`;
3666
3666
  }
3667
3667
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -3669,13 +3669,13 @@ ${indentation}`;
3669
3669
  for (; i < maximumValuesToStringify - 1; i++) {
3670
3670
  const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
3671
3671
  res += tmp2 !== void 0 ? tmp2 : "null";
3672
- res += join7;
3672
+ res += join8;
3673
3673
  }
3674
3674
  const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
3675
3675
  res += tmp !== void 0 ? tmp : "null";
3676
3676
  if (value.length - 1 > maximumBreadth) {
3677
3677
  const removedKeys = value.length - maximumBreadth - 1;
3678
- res += `${join7}"... ${getItemCount(removedKeys)} not stringified"`;
3678
+ res += `${join8}"... ${getItemCount(removedKeys)} not stringified"`;
3679
3679
  }
3680
3680
  if (spacer !== "") {
3681
3681
  res += `
@@ -3688,7 +3688,7 @@ ${originalIndentation}`;
3688
3688
  let whitespace = "";
3689
3689
  if (spacer !== "") {
3690
3690
  indentation += spacer;
3691
- join7 = `,
3691
+ join8 = `,
3692
3692
  ${indentation}`;
3693
3693
  whitespace = " ";
3694
3694
  }
@@ -3697,7 +3697,7 @@ ${indentation}`;
3697
3697
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
3698
3698
  if (tmp !== void 0) {
3699
3699
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
3700
- separator = join7;
3700
+ separator = join8;
3701
3701
  }
3702
3702
  }
3703
3703
  if (spacer !== "" && separator.length > 1) {
@@ -3755,20 +3755,20 @@ ${originalIndentation}`;
3755
3755
  indentation += spacer;
3756
3756
  let res2 = `
3757
3757
  ${indentation}`;
3758
- const join8 = `,
3758
+ const join9 = `,
3759
3759
  ${indentation}`;
3760
3760
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
3761
3761
  let i = 0;
3762
3762
  for (; i < maximumValuesToStringify - 1; i++) {
3763
3763
  const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
3764
3764
  res2 += tmp2 !== void 0 ? tmp2 : "null";
3765
- res2 += join8;
3765
+ res2 += join9;
3766
3766
  }
3767
3767
  const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
3768
3768
  res2 += tmp !== void 0 ? tmp : "null";
3769
3769
  if (value.length - 1 > maximumBreadth) {
3770
3770
  const removedKeys = value.length - maximumBreadth - 1;
3771
- res2 += `${join8}"... ${getItemCount(removedKeys)} not stringified"`;
3771
+ res2 += `${join9}"... ${getItemCount(removedKeys)} not stringified"`;
3772
3772
  }
3773
3773
  res2 += `
3774
3774
  ${originalIndentation}`;
@@ -3784,16 +3784,16 @@ ${originalIndentation}`;
3784
3784
  return '"[Object]"';
3785
3785
  }
3786
3786
  indentation += spacer;
3787
- const join7 = `,
3787
+ const join8 = `,
3788
3788
  ${indentation}`;
3789
3789
  let res = "";
3790
3790
  let separator = "";
3791
3791
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
3792
3792
  if (isTypedArrayWithEntries(value)) {
3793
- res += stringifyTypedArray(value, join7, maximumBreadth);
3793
+ res += stringifyTypedArray(value, join8, maximumBreadth);
3794
3794
  keys = keys.slice(value.length);
3795
3795
  maximumPropertiesToStringify -= value.length;
3796
- separator = join7;
3796
+ separator = join8;
3797
3797
  }
3798
3798
  if (deterministic) {
3799
3799
  keys = sort(keys, comparator);
@@ -3804,13 +3804,13 @@ ${indentation}`;
3804
3804
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
3805
3805
  if (tmp !== void 0) {
3806
3806
  res += `${separator}${strEscape(key2)}: ${tmp}`;
3807
- separator = join7;
3807
+ separator = join8;
3808
3808
  }
3809
3809
  }
3810
3810
  if (keyLength > maximumBreadth) {
3811
3811
  const removedKeys = keyLength - maximumBreadth;
3812
3812
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
3813
- separator = join7;
3813
+ separator = join8;
3814
3814
  }
3815
3815
  if (separator !== "") {
3816
3816
  res = `
@@ -8821,16 +8821,10 @@ var require_addon_unicode11 = __commonJS({
8821
8821
  }
8822
8822
  });
8823
8823
 
8824
- // terminal-daemon.ts
8824
+ // ../../packages/host-local/src/terminals/daemon/main.ts
8825
8825
  import { fileURLToPath } from "node:url";
8826
8826
  import { parseArgs } from "node:util";
8827
8827
 
8828
- // ../../packages/host-local/src/terminals/daemon/daemon-server.ts
8829
- import { randomBytes as randomBytes2, timingSafeEqual } from "node:crypto";
8830
- import { chmodSync as chmodSync2, lstatSync as lstatSync2, readFileSync as readFileSync2, renameSync as renameSync2, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "node:fs";
8831
- import { createServer } from "node:net";
8832
- import { dirname as dirname3, join as join6 } from "node:path";
8833
-
8834
8828
  // ../../packages/logger/src/index.ts
8835
8829
  var import_pino = __toESM(require_pino(), 1);
8836
8830
  function createLogger(name) {
@@ -8840,6 +8834,12 @@ function createLogger(name) {
8840
8834
  });
8841
8835
  }
8842
8836
 
8837
+ // ../../packages/host-local/src/terminals/daemon/daemon-server.ts
8838
+ import { randomBytes as randomBytes2, timingSafeEqual } from "node:crypto";
8839
+ import { chmodSync as chmodSync2, lstatSync as lstatSync2, readFileSync as readFileSync3, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
8840
+ import { createServer } from "node:net";
8841
+ import { dirname as dirname3, join as join7 } from "node:path";
8842
+
8843
8843
  // ../../packages/host-local/src/terminals/node-pty-loader.ts
8844
8844
  var cachedImport;
8845
8845
  function preloadNodePty() {
@@ -9102,6 +9102,7 @@ var OutputTail = class {
9102
9102
  return joined.length > this.max ? joined.slice(-this.max) : joined;
9103
9103
  }
9104
9104
  };
9105
+ var KILL_ESCALATION_MS = 2e3;
9105
9106
  var TerminalPool = class {
9106
9107
  historyStore;
9107
9108
  /**
@@ -9112,6 +9113,8 @@ var TerminalPool = class {
9112
9113
  * stay cold-restorable.
9113
9114
  */
9114
9115
  pruneHistoryOnExit = /* @__PURE__ */ new Set();
9116
+ /** SIGKILL timers of sessions that were sent SIGHUP and have not exited yet. */
9117
+ killTimers = /* @__PURE__ */ new WeakMap();
9115
9118
  /**
9116
9119
  * In-flight history checkpoint writes (see {@link checkpointHistoryNow}).
9117
9120
  * `hasPendingHistoryWrites` lets the daemon's shutdown wait for these
@@ -9311,8 +9314,11 @@ var TerminalPool = class {
9311
9314
  }
9312
9315
  this.maybeCheckpointHistory(terminalId, session);
9313
9316
  });
9314
- ptyProcess.onExit(({ exitCode: exitCode2 }) => {
9317
+ ptyProcess.onExit(({ exitCode }) => {
9315
9318
  log2.debug("Terminal exited: %s (worktree %s)", terminalId, worktreeId);
9319
+ const killTimer = this.killTimers.get(session);
9320
+ if (killTimer) clearTimeout(killTimer);
9321
+ this.killTimers.delete(session);
9316
9322
  const explicitlyKilled = !this.terminals.has(terminalId);
9317
9323
  this.terminals.delete(terminalId);
9318
9324
  this.outputListeners.delete(terminalId);
@@ -9340,7 +9346,7 @@ var TerminalPool = class {
9340
9346
  const event = {
9341
9347
  terminalId,
9342
9348
  worktreeId,
9343
- exitCode: exitCode2,
9349
+ exitCode,
9344
9350
  killed: explicitlyKilled,
9345
9351
  cleanupOnExit: session.cleanupOnExit
9346
9352
  };
@@ -9772,6 +9778,26 @@ var TerminalPool = class {
9772
9778
  }
9773
9779
  };
9774
9780
  }
9781
+ /**
9782
+ * Ends a shell: SIGHUP first, so it can wind down, then SIGKILL when it has
9783
+ * not exited after {@link KILL_ESCALATION_MS}. A single SIGHUP is not enough:
9784
+ * a shell that is still starting up (killed right after spawn) can miss it
9785
+ * and then sits at its prompt forever, with no `onExit` ever firing. The
9786
+ * timer is cleared by the exit handler and does not keep the process alive.
9787
+ */
9788
+ terminate(session) {
9789
+ session.pty.kill();
9790
+ if (this.killTimers.has(session)) return;
9791
+ const timer = setTimeout(() => {
9792
+ this.killTimers.delete(session);
9793
+ try {
9794
+ session.pty.kill("SIGKILL");
9795
+ } catch {
9796
+ }
9797
+ }, KILL_ESCALATION_MS);
9798
+ timer.unref();
9799
+ this.killTimers.set(session, timer);
9800
+ }
9775
9801
  /**
9776
9802
  * Kill a single terminal by terminalId.
9777
9803
  */
@@ -9779,7 +9805,7 @@ var TerminalPool = class {
9779
9805
  const session = this.terminals.get(terminalId);
9780
9806
  if (session) {
9781
9807
  this.pruneHistoryOnExit.add(terminalId);
9782
- session.pty.kill();
9808
+ this.terminate(session);
9783
9809
  this.terminals.delete(terminalId);
9784
9810
  const set = this.worktreeTerminals.get(session.worktreeId);
9785
9811
  if (set) {
@@ -9802,7 +9828,7 @@ var TerminalPool = class {
9802
9828
  const session = this.terminals.get(terminalId);
9803
9829
  if (session) {
9804
9830
  this.pruneHistoryOnExit.add(terminalId);
9805
- session.pty.kill();
9831
+ this.terminate(session);
9806
9832
  this.terminals.delete(terminalId);
9807
9833
  }
9808
9834
  }
@@ -9815,7 +9841,7 @@ var TerminalPool = class {
9815
9841
  */
9816
9842
  killAll() {
9817
9843
  for (const [, session] of this.terminals) {
9818
- session.pty.kill();
9844
+ this.terminate(session);
9819
9845
  }
9820
9846
  this.terminals.clear();
9821
9847
  this.worktreeTerminals.clear();
@@ -9892,7 +9918,7 @@ function probeEndpoint(socketPath) {
9892
9918
  function privateBindPath(socketPath) {
9893
9919
  return join4(dirname(socketPath), `.p${randomBytes(5).toString("hex")}`);
9894
9920
  }
9895
- async function publishEndpoint(boundPath, canonicalPath, supersede2) {
9921
+ async function publishEndpoint(boundPath, canonicalPath, supersede) {
9896
9922
  const identity = entryIdentity(boundPath, statSync2);
9897
9923
  if (!identity) throw new Error(`Cannot stat the bound daemon socket at ${boundPath}`);
9898
9924
  for (let attempt = 0; attempt < PUBLISH_ATTEMPTS; attempt++) {
@@ -9900,7 +9926,7 @@ async function publishEndpoint(boundPath, canonicalPath, supersede2) {
9900
9926
  linkSync(boundPath, canonicalPath);
9901
9927
  } catch (err) {
9902
9928
  if (errorCode(err) !== "EEXIST") throw err;
9903
- if (supersede2 && retireIncumbent(canonicalPath, supersede2)) {
9929
+ if (supersede && retireIncumbent(canonicalPath, supersede)) {
9904
9930
  renameSync(boundPath, canonicalPath);
9905
9931
  return confirmPublished(canonicalPath, identity, true);
9906
9932
  }
@@ -9930,16 +9956,16 @@ async function replaceProvenDead(boundPath, canonicalPath) {
9930
9956
  renameSync(boundPath, canonicalPath);
9931
9957
  return "renamed";
9932
9958
  }
9933
- function retireIncumbent(canonicalPath, supersede2) {
9934
- if (!sameEntry(entryIdentity(canonicalPath, lstatSync), supersede2.incumbent)) return false;
9959
+ function retireIncumbent(canonicalPath, supersede) {
9960
+ if (!sameEntry(entryIdentity(canonicalPath, lstatSync), supersede.incumbent)) return false;
9935
9961
  try {
9936
- linkSync(canonicalPath, supersede2.retiredPath);
9962
+ linkSync(canonicalPath, supersede.retiredPath);
9937
9963
  } catch {
9938
9964
  return false;
9939
9965
  }
9940
- if (sameEntry(entryIdentity(supersede2.retiredPath, lstatSync), supersede2.incumbent)) return true;
9966
+ if (sameEntry(entryIdentity(supersede.retiredPath, lstatSync), supersede.incumbent)) return true;
9941
9967
  try {
9942
- unlinkSync2(supersede2.retiredPath);
9968
+ unlinkSync2(supersede.retiredPath);
9943
9969
  } catch {
9944
9970
  }
9945
9971
  return false;
@@ -9985,39 +10011,62 @@ function errorCode(err) {
9985
10011
  return typeof err === "object" && err !== null && "code" in err ? String(err.code) : void 0;
9986
10012
  }
9987
10013
 
10014
+ // ../../packages/host-local/src/terminals/daemon/exit-records.ts
10015
+ import {
10016
+ mkdirSync as mkdirSync2,
10017
+ readdirSync as readdirSync3,
10018
+ readFileSync as readFileSync2,
10019
+ renameSync as renameSync2,
10020
+ unlinkSync as unlinkSync3,
10021
+ writeFileSync as writeFileSync2
10022
+ } from "node:fs";
10023
+ import { join as join5 } from "node:path";
10024
+ var EXITS_DIR = "exits";
10025
+ function exitsDir(runDir) {
10026
+ return join5(runDir, EXITS_DIR);
10027
+ }
10028
+ function writeExitRecord(runDir, event) {
10029
+ const dir = exitsDir(runDir);
10030
+ mkdirSync2(dir, { recursive: true, mode: 448 });
10031
+ const file = join5(dir, `${encodeURIComponent(event.terminalId)}.json`);
10032
+ const tmp = `${file}.tmp`;
10033
+ writeFileSync2(tmp, JSON.stringify(event), { mode: 384 });
10034
+ renameSync2(tmp, file);
10035
+ }
10036
+
9988
10037
  // ../../packages/host-local/src/terminals/daemon/protocol.ts
9989
10038
  import { createHash } from "node:crypto";
9990
- import { basename, dirname as dirname2, join as join5 } from "node:path";
10039
+ import { basename, dirname as dirname2, join as join6 } from "node:path";
9991
10040
  var PROTOCOL_VERSION = 3;
9992
10041
  var EXIT_ENDPOINT_OCCUPIED = 20;
9993
10042
  var EXIT_ENDPOINT_UNAVAILABLE = 21;
9994
10043
  var EXIT_NODE_PTY_UNAVAILABLE = 22;
9995
10044
  var ENDPOINT_LOST_ERROR = "Terminal daemon no longer owns its endpoint";
9996
10045
  var MAX_SOCKET_PATH_BYTES = 103;
9997
- function daemonPaths(runDir2, version = PROTOCOL_VERSION) {
9998
- const inRunDir = join5(runDir2, `terminal-daemon-v${version}.sock`);
9999
- const socket = Buffer.byteLength(inRunDir) <= MAX_SOCKET_PATH_BYTES ? inRunDir : join5(
10046
+ function daemonPaths(runDir, version = PROTOCOL_VERSION) {
10047
+ const inRunDir = join6(runDir, `terminal-daemon-v${version}.sock`);
10048
+ const socket = Buffer.byteLength(inRunDir) <= MAX_SOCKET_PATH_BYTES ? inRunDir : join6(
10000
10049
  shortSocketDir(),
10001
- `td-${createHash("sha256").update(runDir2).digest("hex").slice(0, 16)}-v${version}.sock`
10050
+ `td-${createHash("sha256").update(runDir).digest("hex").slice(0, 16)}-v${version}.sock`
10002
10051
  );
10003
10052
  return {
10004
- runDir: runDir2,
10053
+ runDir,
10005
10054
  socket,
10006
- token: join5(runDir2, `terminal-daemon-v${version}.token`),
10007
- pid: join5(runDir2, `terminal-daemon-v${version}.pid`),
10008
- log: join5(runDir2, "terminal-daemon.log")
10055
+ token: join6(runDir, `terminal-daemon-v${version}.token`),
10056
+ pid: join6(runDir, `terminal-daemon-v${version}.pid`),
10057
+ log: join6(runDir, "terminal-daemon.log")
10009
10058
  };
10010
10059
  }
10011
10060
  function retiredDaemonPaths(paths, tag) {
10012
10061
  return {
10013
10062
  ...paths,
10014
- socket: join5(dirname2(paths.socket), `.r${tag}`),
10063
+ socket: join6(dirname2(paths.socket), `.r${tag}`),
10015
10064
  token: paths.token.replace(/\.token$/, `.retired-${tag}.token`),
10016
10065
  pid: paths.pid.replace(/\.pid$/, `.retired-${tag}.pid`)
10017
10066
  };
10018
10067
  }
10019
10068
  function shortSocketDir() {
10020
- return join5("/tmp", `band-${process.getuid?.() ?? "user"}`);
10069
+ return join6("/tmp", `band-${process.getuid?.() ?? "user"}`);
10021
10070
  }
10022
10071
  function writeFrame(socket, message) {
10023
10072
  socket.write(`${JSON.stringify(message)}
@@ -10073,7 +10122,7 @@ var MAX_STREAM_BACKLOG_BYTES = 64 * 1024 * 1024;
10073
10122
  var STREAM_HOLD_BYTES = 128 * 1024;
10074
10123
  var SMALL_SESSION_CHARS = 4 * 1024;
10075
10124
  async function runDaemon(options) {
10076
- const { paths, buildId, supersede: supersede2 } = options;
10125
+ const { paths, buildId, supersede } = options;
10077
10126
  try {
10078
10127
  await preloadNodePty();
10079
10128
  } catch (err) {
@@ -10083,7 +10132,7 @@ async function runDaemon(options) {
10083
10132
  ensurePrivateDir(paths.runDir);
10084
10133
  ensurePrivateDir(dirname3(paths.socket));
10085
10134
  const token = randomBytes2(32).toString("hex");
10086
- const pool = new TerminalPool({ historyDir: join6(dirname3(paths.runDir), "terminal-history") });
10135
+ const pool = new TerminalPool({ historyDir: join7(dirname3(paths.runDir), "terminal-history") });
10087
10136
  const clients = /* @__PURE__ */ new Map();
10088
10137
  let shuttingDown = false;
10089
10138
  let openConnections = 0;
@@ -10100,7 +10149,7 @@ async function runDaemon(options) {
10100
10149
  });
10101
10150
  });
10102
10151
  chmodSync2(bindPath, 384);
10103
- let retired = supersede2 ? retiredDaemonPaths(paths, randomBytes2(4).toString("hex")) : null;
10152
+ let retired = supersede ? retiredDaemonPaths(paths, randomBytes2(4).toString("hex")) : null;
10104
10153
  if (retired) {
10105
10154
  copyPrivateFile(paths.token, retired.token);
10106
10155
  copyPrivateFile(paths.pid, retired.pid);
@@ -10108,7 +10157,7 @@ async function runDaemon(options) {
10108
10157
  const outcome = await publishEndpoint(
10109
10158
  bindPath,
10110
10159
  paths.socket,
10111
- supersede2 && retired ? { incumbent: supersede2, retiredPath: retired.socket } : void 0
10160
+ supersede && retired ? { incumbent: supersede, retiredPath: retired.socket } : void 0
10112
10161
  );
10113
10162
  if (retired && (outcome.status !== "published" || !outcome.superseded)) {
10114
10163
  removeRetiredFiles(retired);
@@ -10136,6 +10185,13 @@ async function runDaemon(options) {
10136
10185
  writePrivateFile(paths.pid, JSON.stringify(pidRecord));
10137
10186
  log3.info({ pid: process.pid, socket: paths.socket, buildId }, "terminal daemon ready");
10138
10187
  pool.onExit((event) => {
10188
+ if (options.recordExits && !event.killed && clients.size === 0) {
10189
+ try {
10190
+ writeExitRecord(paths.runDir, event);
10191
+ } catch (err) {
10192
+ log3.warn({ err, terminalId: event.terminalId }, "could not record a terminal exit");
10193
+ }
10194
+ }
10139
10195
  for (const client of clients.values()) {
10140
10196
  client.attached.delete(event.terminalId);
10141
10197
  client.held.delete(event.terminalId);
@@ -10482,13 +10538,13 @@ function parseHello(frame) {
10482
10538
  }
10483
10539
  function writePrivateFile(path, content) {
10484
10540
  const tmp = `${path}.${randomBytes2(4).toString("hex")}.tmp`;
10485
- writeFileSync2(tmp, content, { mode: 384 });
10486
- renameSync2(tmp, path);
10541
+ writeFileSync3(tmp, content, { mode: 384 });
10542
+ renameSync3(tmp, path);
10487
10543
  }
10488
10544
  function copyPrivateFile(from, to) {
10489
10545
  let content;
10490
10546
  try {
10491
- content = readFileSync2(from, "utf8");
10547
+ content = readFileSync3(from, "utf8");
10492
10548
  } catch {
10493
10549
  return;
10494
10550
  }
@@ -10497,7 +10553,7 @@ function copyPrivateFile(from, to) {
10497
10553
  function removeRetiredFiles(retired) {
10498
10554
  for (const path of [retired.socket, retired.token, retired.pid]) {
10499
10555
  try {
10500
- unlinkSync3(path);
10556
+ unlinkSync4(path);
10501
10557
  } catch {
10502
10558
  }
10503
10559
  }
@@ -10522,40 +10578,47 @@ function closeServer(server) {
10522
10578
  return new Promise((resolve) => server.close(() => resolve()));
10523
10579
  }
10524
10580
 
10525
- // terminal-daemon.ts
10581
+ // ../../packages/host-local/src/terminals/daemon/main.ts
10526
10582
  var log4 = createLogger("terminal-daemon");
10527
- process.on("uncaughtException", (err) => {
10528
- log4.error({ err }, "uncaught exception in terminal daemon");
10529
- });
10530
- process.on("unhandledRejection", (err) => {
10531
- log4.error({ err }, "unhandled rejection in terminal daemon");
10532
- });
10533
- var { values } = parseArgs({
10534
- options: {
10535
- "run-dir": { type: "string" },
10536
- "build-id": { type: "string", default: "unknown" },
10537
- supersede: { type: "string" }
10583
+ async function runDaemonMain(entryUrl) {
10584
+ process.on("uncaughtException", (err) => {
10585
+ log4.error({ err }, "uncaught exception in terminal daemon");
10586
+ });
10587
+ process.on("unhandledRejection", (err) => {
10588
+ log4.error({ err }, "unhandled rejection in terminal daemon");
10589
+ });
10590
+ const { values } = parseArgs({
10591
+ options: {
10592
+ "run-dir": { type: "string" },
10593
+ "build-id": { type: "string", default: "unknown" },
10594
+ supersede: { type: "string" },
10595
+ "record-exits": { type: "boolean", default: false }
10596
+ }
10597
+ });
10598
+ const runDir = values["run-dir"];
10599
+ if (!runDir) {
10600
+ log4.error("terminal daemon needs --run-dir");
10601
+ process.exit(2);
10538
10602
  }
10539
- });
10540
- var runDir = values["run-dir"];
10541
- if (!runDir) {
10542
- log4.error("terminal daemon needs --run-dir");
10543
- process.exit(2);
10544
- }
10545
- var supersede = values.supersede?.match(/^(\d+):(\d+)$/);
10546
- if (values.supersede !== void 0 && !supersede) {
10547
- log4.error({ supersede: values.supersede }, "terminal daemon got a malformed --supersede");
10548
- process.exit(2);
10549
- }
10550
- var exitCode = await runDaemon({
10551
- paths: daemonPaths(runDir),
10552
- buildId: values["build-id"] ?? "unknown",
10553
- entry: fileURLToPath(import.meta.url),
10554
- supersede: supersede ? { dev: BigInt(supersede[1]), ino: BigInt(supersede[2]) } : void 0,
10555
- onReady: () => {
10556
- process.send?.({ type: "ready", pid: process.pid }, () => {
10557
- if (process.connected) process.disconnect();
10558
- });
10603
+ const supersede = values.supersede?.match(/^(\d+):(\d+)$/);
10604
+ if (values.supersede !== void 0 && !supersede) {
10605
+ log4.error({ supersede: values.supersede }, "terminal daemon got a malformed --supersede");
10606
+ process.exit(2);
10559
10607
  }
10560
- });
10561
- process.exit(exitCode);
10608
+ const exitCode = await runDaemon({
10609
+ paths: daemonPaths(runDir),
10610
+ buildId: values["build-id"] ?? "unknown",
10611
+ entry: fileURLToPath(entryUrl),
10612
+ supersede: supersede ? { dev: BigInt(supersede[1]), ino: BigInt(supersede[2]) } : void 0,
10613
+ recordExits: values["record-exits"],
10614
+ onReady: () => {
10615
+ process.send?.({ type: "ready", pid: process.pid }, () => {
10616
+ if (process.connected) process.disconnect();
10617
+ });
10618
+ }
10619
+ });
10620
+ process.exit(exitCode);
10621
+ }
10622
+
10623
+ // terminal-daemon.ts
10624
+ await runDaemonMain(import.meta.url);