@runweave/server-linux-x64 0.1.19 → 0.1.21

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 (85) hide show
  1. package/manifest.json +153 -153
  2. package/native.tar.gz +0 -0
  3. package/package.json +1 -1
  4. package/payload/app-server/build-info.json +4 -4
  5. package/payload/app-server/index.cjs +30 -8
  6. package/payload/app-server/index.cjs.map +1 -1
  7. package/payload/backend/activity-sqlite-worker.cjs +29 -7
  8. package/payload/backend/build-info.json +4 -4
  9. package/payload/backend/dev-resources/control.cjs +29 -7
  10. package/payload/backend/index.cjs +213 -52
  11. package/payload/frontend/dist/assets/{_baseUniq-Rpr7ObZY.js → _baseUniq-1Km-k-ta.js} +1 -1
  12. package/payload/frontend/dist/assets/{access-BvxRY1pA.js → access-DUvHn-7g.js} +1 -1
  13. package/payload/frontend/dist/assets/{advanced-CZfrALGq.js → advanced-2iC4XP-k.js} +1 -1
  14. package/payload/frontend/dist/assets/{appearance-D0AwwNw_.js → appearance-F3ep216f.js} +1 -1
  15. package/payload/frontend/dist/assets/{arc-BxzXVQYF.js → arc-B_Rv2EgC.js} +1 -1
  16. package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-DTYJSSVX.js → architectureDiagram-Q4EWVU46-CAfCOCHn.js} +1 -1
  17. package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-DaIImc6U.js → blockDiagram-DXYQGD6D-Dt_EPk2t.js} +1 -1
  18. package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-DRS-zy_e.js → c4Diagram-AHTNJAMY-pJxLy6Ib.js} +1 -1
  19. package/payload/frontend/dist/assets/channel-DycidetN.js +1 -0
  20. package/payload/frontend/dist/assets/{chunk-4BX2VUAB-BxZHfjDE.js → chunk-4BX2VUAB-XIuvwA5G.js} +1 -1
  21. package/payload/frontend/dist/assets/{chunk-4TB4RGXK-BbTiOq_d.js → chunk-4TB4RGXK-BaJHFe6f.js} +1 -1
  22. package/payload/frontend/dist/assets/{chunk-55IACEB6-DSGNAzPL.js → chunk-55IACEB6-CBN94dv8.js} +1 -1
  23. package/payload/frontend/dist/assets/{chunk-EDXVE4YY-C3VoLWVy.js → chunk-EDXVE4YY-BTpbJ8AJ.js} +1 -1
  24. package/payload/frontend/dist/assets/{chunk-FMBD7UC4-jgIQKRAn.js → chunk-FMBD7UC4-D8EB4vd_.js} +1 -1
  25. package/payload/frontend/dist/assets/{chunk-OYMX7WX6-CR1nxjr3.js → chunk-OYMX7WX6-CVlwUrKx.js} +1 -1
  26. package/payload/frontend/dist/assets/{chunk-QZHKN3VN-BsZQAe-R.js → chunk-QZHKN3VN-CaRy6kUM.js} +1 -1
  27. package/payload/frontend/dist/assets/{chunk-YZCP3GAM-C7hytF3a.js → chunk-YZCP3GAM-D76OSgAi.js} +1 -1
  28. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-5pjklcgn.js +1 -0
  29. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-5pjklcgn.js +1 -0
  30. package/payload/frontend/dist/assets/clone-CUh1yxwY.js +1 -0
  31. package/payload/frontend/dist/assets/{connection-Brx3p6gD.js → connection-DbcKyIr4.js} +1 -1
  32. package/payload/frontend/dist/assets/{connections-DV6_2T4t.js → connections-C-JFI1d6.js} +1 -1
  33. package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-CrqquZt2.js → cose-bilkent-S5V4N54A-C8Ve8zWa.js} +1 -1
  34. package/payload/frontend/dist/assets/{dagre-KV5264BT-BOAEPW4D.js → dagre-KV5264BT-DlutyhBV.js} +1 -1
  35. package/payload/frontend/dist/assets/{desktop-1i0ByIN_.js → desktop-hY0qLy1k.js} +1 -1
  36. package/payload/frontend/dist/assets/{diagram-5BDNPKRD-NVdwMJnF.js → diagram-5BDNPKRD-BOWSLJh5.js} +1 -1
  37. package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-RKmkTTau.js → diagram-G4DWMVQ6-DEJYwBtT.js} +1 -1
  38. package/payload/frontend/dist/assets/{diagram-MMDJMWI5-B0Or1DIY.js → diagram-MMDJMWI5-DCHKtsej.js} +1 -1
  39. package/payload/frontend/dist/assets/{diagram-TYMM5635-CoJGPUQX.js → diagram-TYMM5635-DcWqaORk.js} +1 -1
  40. package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-DHK_lg3E.js → erDiagram-SMLLAGMA-BAnv2QR4.js} +1 -1
  41. package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-CzirUF-x.js → flowDiagram-DWJPFMVM-CLJLX_pg.js} +1 -1
  42. package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-DGY2KYoN.js → ganttDiagram-T4ZO3ILL-CEwNMCO_.js} +1 -1
  43. package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-BI5lNHKC.js → gitGraphDiagram-UUTBAWPF-7qYUaW4T.js} +1 -1
  44. package/payload/frontend/dist/assets/{graph-CxjgBe1N.js → graph-C3pGWAsG.js} +1 -1
  45. package/payload/frontend/dist/assets/{image-LArOi_ON.js → image-DzByFbwW.js} +1 -1
  46. package/payload/frontend/dist/assets/{index-CLYrzd8Y.js → index-X6z9DRtr.js} +5 -5
  47. package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-DTRl6YSd.js → infoDiagram-42DDH7IO-uykCNcsm.js} +1 -1
  48. package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-DCnBRtVx.js → ishikawaDiagram-UXIWVN3A-DFjUz1ZP.js} +1 -1
  49. package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-ChVgjvDs.js → journeyDiagram-VCZTEJTY-KlFjvI1y.js} +1 -1
  50. package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-skToH2-J.js → kanban-definition-6JOO6SKY-CWNvauW5.js} +1 -1
  51. package/payload/frontend/dist/assets/{layout-B4V_ctSo.js → layout-DEYchOZT.js} +1 -1
  52. package/payload/frontend/dist/assets/{linear-DYom329p.js → linear-CxNxQzFY.js} +1 -1
  53. package/payload/frontend/dist/assets/{main-C_6tTN_b.js → main-B5vSE7PX.js} +142 -142
  54. package/payload/frontend/dist/assets/{min-EMXbJh1s.js → min-D_bax_Q3.js} +1 -1
  55. package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-DLHGcrEw.js → mindmap-definition-QFDTVHPH-9CPQZB_P.js} +1 -1
  56. package/payload/frontend/dist/assets/{monitoring-Bvfy9Q9G.js → monitoring-BHrlQuyI.js} +1 -1
  57. package/payload/frontend/dist/assets/{notifications-CdkYtTCy.js → notifications-C5O4JnTW.js} +1 -1
  58. package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-LrDfLpSu.js → pieDiagram-DEJITSTG-wRY5e0M8.js} +1 -1
  59. package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-uV9sfVKm.js → quadrantDiagram-34T5L4WZ-t11sO3Dt.js} +1 -1
  60. package/payload/frontend/dist/assets/{record-content-B3qVdcq-.js → record-content-BQpFEpbH.js} +1 -1
  61. package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-Cf_SmlxS.js → requirementDiagram-MS252O5E-C0CwyWRr.js} +1 -1
  62. package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-DSLCPq2l.js → sankeyDiagram-XADWPNL6-BV_woefX.js} +1 -1
  63. package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-CAAjivQf.js → sequenceDiagram-FGHM5R23-Df4He8NT.js} +1 -1
  64. package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-DNMUe2-F.js → stateDiagram-FHFEXIEX-BEgdIPpz.js} +1 -1
  65. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-DyKoLPVf.js +1 -0
  66. package/payload/frontend/dist/assets/{status-BPA1tGcF.js → status-Ce0iPeyb.js} +1 -1
  67. package/payload/frontend/dist/assets/suiji-CKYE-bFZ.js +1 -0
  68. package/payload/frontend/dist/assets/{svg-BbHfpNxC.js → svg-Bw5hEl7G.js} +1 -1
  69. package/payload/frontend/dist/assets/{tabs-DkuqaUwz.js → tabs-DbtEnTWL.js} +1 -1
  70. package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-DNJNPFK4.js → timeline-definition-GMOUNBTQ-DwbNhEn4.js} +1 -1
  71. package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-BycjIB3y.js → vennDiagram-DHZGUBPP-pAfUF9dm.js} +1 -1
  72. package/payload/frontend/dist/assets/{wardley-RL74JXVD-Bq01rln7.js → wardley-RL74JXVD-DcKkKo7k.js} +1 -1
  73. package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-D4_m8ewM.js → wardleyDiagram-NUSXRM2D-B1APfa8B.js} +1 -1
  74. package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-CovxGnwH.js → xychartDiagram-5P7HB3ND-BaKuAJV-.js} +1 -1
  75. package/payload/frontend/dist/build-info.json +4 -4
  76. package/payload/frontend/dist/companion.html +1 -1
  77. package/payload/frontend/dist/index.html +2 -2
  78. package/payload/pty-host/index.cjs +126 -17
  79. package/payload/server/index.cjs +29 -7
  80. package/payload/frontend/dist/assets/channel-hL0i3Xgx.js +0 -1
  81. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-Nr4qU3jt.js +0 -1
  82. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-Nr4qU3jt.js +0 -1
  83. package/payload/frontend/dist/assets/clone-ePxKteP6.js +0 -1
  84. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-Ca5k1Q3K.js +0 -1
  85. package/payload/frontend/dist/assets/suiji-ZMTJOgTp.js +0 -1
@@ -12017,27 +12017,49 @@ function assertWindowsPrivatePath(file) {
12017
12017
  if (process.platform !== "win32") return;
12018
12018
  const script = `
12019
12019
  $ErrorActionPreference = 'Stop'
12020
+ try {
12020
12021
  # Use .NET directly: a parent pwsh may export a PSModulePath incompatible with Windows PowerShell.
12021
12022
  $acl = if ([IO.Directory]::Exists($env:RUNWEAVE_PRIVATE_PATH)) {
12022
12023
  [IO.Directory]::GetAccessControl($env:RUNWEAVE_PRIVATE_PATH)
12023
12024
  } else { [IO.File]::GetAccessControl($env:RUNWEAVE_PRIVATE_PATH) }
12024
12025
  $sid = [Security.Principal.WindowsIdentity]::GetCurrent().User
12025
12026
  $allowed = @($sid.Value, 'S-1-5-18', 'S-1-5-32-544')
12026
- if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed) { throw 'owner' }
12027
+ if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed) { [Console]::Write('owner'); exit 0 }
12027
12028
  foreach ($rule in $acl.GetAccessRules($true, $true, [Security.Principal.SecurityIdentifier])) {
12028
- if ($rule.AccessControlType -eq 'Allow' -and $rule.IdentityReference.Value -notin $allowed) { throw 'access' }
12029
+ if ($rule.AccessControlType -eq 'Allow' -and $rule.IdentityReference.Value -notin $allowed) { [Console]::Write('access'); exit 0 }
12030
+ }
12031
+ [Console]::Write('private')
12032
+ } catch {
12033
+ [Console]::Write('check-failed:' + $_.Exception.GetType().FullName + ':' + $_.Exception.HResult)
12029
12034
  }
12030
12035
  `;
12036
+ const startedAt = performance.now();
12037
+ let result;
12031
12038
  try {
12032
- (0, import_node_child_process.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
12039
+ result = (0, import_node_child_process.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
12033
12040
  env: { ...process.env, RUNWEAVE_PRIVATE_PATH: file },
12034
- stdio: "ignore",
12041
+ stdio: ["ignore", "pipe", "pipe"],
12042
+ encoding: "utf8",
12043
+ maxBuffer: 64 * 1024,
12035
12044
  timeout: 1e4,
12036
12045
  windowsHide: true
12037
- });
12038
- } catch {
12039
- throw new ConfigurationError("CONFIG_WINDOWS_ACL_NOT_PRIVATE", [file]);
12046
+ }).trim();
12047
+ } catch (cause) {
12048
+ const error = cause;
12049
+ throw new ConfigurationError(
12050
+ error.code === "ETIMEDOUT" ? "CONFIG_WINDOWS_ACL_CHECK_TIMEOUT" : "CONFIG_WINDOWS_ACL_CHECK_FAILED",
12051
+ [
12052
+ file,
12053
+ `exit=${error.status ?? "none"}`,
12054
+ `signal=${error.signal ?? "none"}`,
12055
+ `code=${error.code ?? "none"}`,
12056
+ `elapsedMs=${Math.round(performance.now() - startedAt)}`
12057
+ ]
12058
+ );
12040
12059
  }
12060
+ if (result === "owner" || result === "access") throw new ConfigurationError("CONFIG_WINDOWS_ACL_NOT_PRIVATE", [file, result]);
12061
+ if (/^check-failed:[A-Za-z0-9_.]+:-?\d+$/.test(result)) throw new ConfigurationError("CONFIG_WINDOWS_ACL_CHECK_FAILED", [file, result]);
12062
+ if (result !== "private") throw new ConfigurationError("CONFIG_WINDOWS_ACL_CHECK_FAILED", [file, "invalid-result"]);
12041
12063
  }
12042
12064
 
12043
12065
  // packages/config-node/src/context.ts
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "version": "0.1.0",
3
- "buildId": "20261111T131758068Z-c9ecf70f",
4
- "sourceRevision": "c9ecf70f133fab80d90c6621f3a071d11d9d09b0",
3
+ "buildId": "20261113T062359739Z-29c9c1a8",
4
+ "sourceRevision": "29c9c1a8763c9546f77448d7cd7115e5b319f4a1",
5
5
  "sourceDirty": false,
6
- "builtAt": "2026-11-11T13:17:58.068Z",
7
- "contentSha256": "d6f9ec551eed0650856e63d15d2186974fe7eeb9fc2dd4464f1c3263638470c8"
6
+ "builtAt": "2026-11-13T06:23:59.739Z",
7
+ "contentSha256": "ba7f394359ade82a0cd500fc579139993af3c0dc7c6fc3893c34371feb9a559a"
8
8
  }
@@ -8483,27 +8483,49 @@ function assertWindowsPrivatePath(file) {
8483
8483
  if (process.platform !== "win32") return;
8484
8484
  const script = `
8485
8485
  $ErrorActionPreference = 'Stop'
8486
+ try {
8486
8487
  # Use .NET directly: a parent pwsh may export a PSModulePath incompatible with Windows PowerShell.
8487
8488
  $acl = if ([IO.Directory]::Exists($env:RUNWEAVE_PRIVATE_PATH)) {
8488
8489
  [IO.Directory]::GetAccessControl($env:RUNWEAVE_PRIVATE_PATH)
8489
8490
  } else { [IO.File]::GetAccessControl($env:RUNWEAVE_PRIVATE_PATH) }
8490
8491
  $sid = [Security.Principal.WindowsIdentity]::GetCurrent().User
8491
8492
  $allowed = @($sid.Value, 'S-1-5-18', 'S-1-5-32-544')
8492
- if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed) { throw 'owner' }
8493
+ if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed) { [Console]::Write('owner'); exit 0 }
8493
8494
  foreach ($rule in $acl.GetAccessRules($true, $true, [Security.Principal.SecurityIdentifier])) {
8494
- if ($rule.AccessControlType -eq 'Allow' -and $rule.IdentityReference.Value -notin $allowed) { throw 'access' }
8495
+ if ($rule.AccessControlType -eq 'Allow' -and $rule.IdentityReference.Value -notin $allowed) { [Console]::Write('access'); exit 0 }
8496
+ }
8497
+ [Console]::Write('private')
8498
+ } catch {
8499
+ [Console]::Write('check-failed:' + $_.Exception.GetType().FullName + ':' + $_.Exception.HResult)
8495
8500
  }
8496
8501
  `;
8502
+ const startedAt = performance.now();
8503
+ let result;
8497
8504
  try {
8498
- (0, import_node_child_process2.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
8505
+ result = (0, import_node_child_process2.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
8499
8506
  env: { ...process.env, RUNWEAVE_PRIVATE_PATH: file },
8500
- stdio: "ignore",
8507
+ stdio: ["ignore", "pipe", "pipe"],
8508
+ encoding: "utf8",
8509
+ maxBuffer: 64 * 1024,
8501
8510
  timeout: 1e4,
8502
8511
  windowsHide: true
8503
- });
8504
- } catch {
8505
- throw new ConfigurationError("CONFIG_WINDOWS_ACL_NOT_PRIVATE", [file]);
8512
+ }).trim();
8513
+ } catch (cause) {
8514
+ const error = cause;
8515
+ throw new ConfigurationError(
8516
+ error.code === "ETIMEDOUT" ? "CONFIG_WINDOWS_ACL_CHECK_TIMEOUT" : "CONFIG_WINDOWS_ACL_CHECK_FAILED",
8517
+ [
8518
+ file,
8519
+ `exit=${error.status ?? "none"}`,
8520
+ `signal=${error.signal ?? "none"}`,
8521
+ `code=${error.code ?? "none"}`,
8522
+ `elapsedMs=${Math.round(performance.now() - startedAt)}`
8523
+ ]
8524
+ );
8506
8525
  }
8526
+ if (result === "owner" || result === "access") throw new ConfigurationError("CONFIG_WINDOWS_ACL_NOT_PRIVATE", [file, result]);
8527
+ if (/^check-failed:[A-Za-z0-9_.]+:-?\d+$/.test(result)) throw new ConfigurationError("CONFIG_WINDOWS_ACL_CHECK_FAILED", [file, result]);
8528
+ if (result !== "private") throw new ConfigurationError("CONFIG_WINDOWS_ACL_CHECK_FAILED", [file, "invalid-result"]);
8507
8529
  }
8508
8530
 
8509
8531
  // packages/config-node/src/private-file.ts
@@ -1,4 +1,4 @@
1
- /* runweave:build-info */var __RUNWEAVE_BUILD_INFO__={"version":"0.1.0","buildId":"20261111T131758068Z-c9ecf70f","sourceRevision":"c9ecf70f133fab80d90c6621f3a071d11d9d09b0","sourceDirty":false,"builtAt":"2026-11-11T13:17:58.068Z","contentSha256":"d6f9ec551eed0650856e63d15d2186974fe7eeb9fc2dd4464f1c3263638470c8"};
1
+ /* runweave:build-info */var __RUNWEAVE_BUILD_INFO__={"version":"0.1.0","buildId":"20261113T062359739Z-29c9c1a8","sourceRevision":"29c9c1a8763c9546f77448d7cd7115e5b319f4a1","sourceDirty":false,"builtAt":"2026-11-13T06:23:59.739Z","contentSha256":"ba7f394359ade82a0cd500fc579139993af3c0dc7c6fc3893c34371feb9a559a"};
2
2
  const __IMPORT_META_URL__ = require('url').pathToFileURL(__filename).href;
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -63498,27 +63498,49 @@ function assertWindowsPrivatePath(file) {
63498
63498
  if (process.platform !== "win32") return;
63499
63499
  const script = `
63500
63500
  $ErrorActionPreference = 'Stop'
63501
+ try {
63501
63502
  # Use .NET directly: a parent pwsh may export a PSModulePath incompatible with Windows PowerShell.
63502
63503
  $acl = if ([IO.Directory]::Exists($env:RUNWEAVE_PRIVATE_PATH)) {
63503
63504
  [IO.Directory]::GetAccessControl($env:RUNWEAVE_PRIVATE_PATH)
63504
63505
  } else { [IO.File]::GetAccessControl($env:RUNWEAVE_PRIVATE_PATH) }
63505
63506
  $sid = [Security.Principal.WindowsIdentity]::GetCurrent().User
63506
63507
  $allowed = @($sid.Value, 'S-1-5-18', 'S-1-5-32-544')
63507
- if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed) { throw 'owner' }
63508
+ if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed) { [Console]::Write('owner'); exit 0 }
63508
63509
  foreach ($rule in $acl.GetAccessRules($true, $true, [Security.Principal.SecurityIdentifier])) {
63509
- if ($rule.AccessControlType -eq 'Allow' -and $rule.IdentityReference.Value -notin $allowed) { throw 'access' }
63510
+ if ($rule.AccessControlType -eq 'Allow' -and $rule.IdentityReference.Value -notin $allowed) { [Console]::Write('access'); exit 0 }
63511
+ }
63512
+ [Console]::Write('private')
63513
+ } catch {
63514
+ [Console]::Write('check-failed:' + $_.Exception.GetType().FullName + ':' + $_.Exception.HResult)
63510
63515
  }
63511
63516
  `;
63517
+ const startedAt = performance.now();
63518
+ let result;
63512
63519
  try {
63513
- (0, import_node_child_process.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
63520
+ result = (0, import_node_child_process.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
63514
63521
  env: { ...process.env, RUNWEAVE_PRIVATE_PATH: file },
63515
- stdio: "ignore",
63522
+ stdio: ["ignore", "pipe", "pipe"],
63523
+ encoding: "utf8",
63524
+ maxBuffer: 64 * 1024,
63516
63525
  timeout: 1e4,
63517
63526
  windowsHide: true
63518
- });
63519
- } catch {
63520
- throw new ConfigurationError("CONFIG_WINDOWS_ACL_NOT_PRIVATE", [file]);
63527
+ }).trim();
63528
+ } catch (cause) {
63529
+ const error2 = cause;
63530
+ throw new ConfigurationError(
63531
+ error2.code === "ETIMEDOUT" ? "CONFIG_WINDOWS_ACL_CHECK_TIMEOUT" : "CONFIG_WINDOWS_ACL_CHECK_FAILED",
63532
+ [
63533
+ file,
63534
+ `exit=${error2.status ?? "none"}`,
63535
+ `signal=${error2.signal ?? "none"}`,
63536
+ `code=${error2.code ?? "none"}`,
63537
+ `elapsedMs=${Math.round(performance.now() - startedAt)}`
63538
+ ]
63539
+ );
63521
63540
  }
63541
+ if (result === "owner" || result === "access") throw new ConfigurationError("CONFIG_WINDOWS_ACL_NOT_PRIVATE", [file, result]);
63542
+ if (/^check-failed:[A-Za-z0-9_.]+:-?\d+$/.test(result)) throw new ConfigurationError("CONFIG_WINDOWS_ACL_CHECK_FAILED", [file, result]);
63543
+ if (result !== "private") throw new ConfigurationError("CONFIG_WINDOWS_ACL_CHECK_FAILED", [file, "invalid-result"]);
63522
63544
  }
63523
63545
 
63524
63546
  // packages/config-node/src/private-file.ts
@@ -72000,12 +72022,20 @@ function readHost(scope) {
72000
72022
  }
72001
72023
 
72002
72024
  // packages/pty-host/src/transport.ts
72025
+ var HostTransportError = class extends Error {
72026
+ constructor(code, bufferedBytes, limitBytes = 4 * 1024 * 1024) {
72027
+ super(code);
72028
+ this.code = code;
72029
+ this.bufferedBytes = bufferedBytes;
72030
+ this.limitBytes = limitBytes;
72031
+ }
72032
+ };
72003
72033
  function receiveJsonLines(socket, onMessage) {
72004
72034
  let source2 = "";
72005
72035
  socket.setEncoding("utf8");
72006
72036
  socket.on("data", (data) => {
72007
72037
  source2 += data;
72008
- if (Buffer.byteLength(source2) > 4 * 1024 * 1024) return socket.destroy(new Error("HOST_MESSAGE_TOO_LARGE"));
72038
+ if (Buffer.byteLength(source2) > 4 * 1024 * 1024) return socket.destroy(new HostTransportError("HOST_MESSAGE_TOO_LARGE", Buffer.byteLength(source2)));
72009
72039
  let end;
72010
72040
  while ((end = source2.indexOf("\n")) !== -1) {
72011
72041
  const line = source2.slice(0, end);
@@ -72022,35 +72052,76 @@ function receiveJsonLines(socket, onMessage) {
72022
72052
  function sendJson(socket, message2) {
72023
72053
  if (socket.destroyed) return false;
72024
72054
  if (socket.writableLength > 4 * 1024 * 1024) {
72025
- socket.destroy(new Error("HOST_OUTPUT_GAP"));
72055
+ socket.destroy(new HostTransportError("HOST_OUTPUT_GAP", socket.writableLength));
72026
72056
  return false;
72027
72057
  }
72028
72058
  socket.write(JSON.stringify(message2) + "\n");
72029
72059
  return true;
72030
72060
  }
72031
72061
 
72062
+ // packages/pty-host/src/diagnostics.ts
72063
+ function hostErrorCode(error2) {
72064
+ if (!(error2 instanceof Error)) return "HOST_OPERATION_FAILED";
72065
+ const code = error2.code;
72066
+ if (code && /^(?:E[A-Z0-9_]+|HOST_[A-Z0-9_]+)$/.test(code)) return code;
72067
+ return /^HOST_[A-Z0-9_]+$/.test(error2.message) ? error2.message : "HOST_OPERATION_FAILED";
72068
+ }
72069
+ var actions = /* @__PURE__ */ new Set([
72070
+ "hello",
72071
+ "claimWriter",
72072
+ "listSessions",
72073
+ "createSession",
72074
+ "setUpstreams",
72075
+ "freeze",
72076
+ "stop",
72077
+ "writeInput",
72078
+ "getInputOperation",
72079
+ "getSnapshot",
72080
+ "readOutput",
72081
+ "resize",
72082
+ "signal",
72083
+ "closeSession",
72084
+ "attachSession"
72085
+ ]);
72086
+ function diagnosticAction(action) {
72087
+ return actions.has(action) ? action : "unknown";
72088
+ }
72089
+ function writeHostDiagnostic(diagnostic) {
72090
+ process.stderr.write(JSON.stringify({ timestamp: (/* @__PURE__ */ new Date()).toISOString(), ...diagnostic }) + "\n");
72091
+ }
72092
+ function reportHostDiagnostic(sink, diagnostic) {
72093
+ try {
72094
+ sink(diagnostic);
72095
+ } catch {
72096
+ }
72097
+ }
72098
+
72032
72099
  // packages/pty-host/src/client.ts
72033
72100
  var PtyHostClient = class _PtyHostClient {
72034
- descriptor;
72035
- generation = 0;
72036
- events = /* @__PURE__ */ new Set();
72037
- disconnected = /* @__PURE__ */ new Set();
72038
- pending = /* @__PURE__ */ new Map();
72039
- socket;
72040
- token;
72041
- connected = false;
72042
- constructor(scope) {
72101
+ constructor(scope, diagnostic) {
72102
+ this.diagnostic = diagnostic;
72043
72103
  const discovery = readHost(scope);
72044
72104
  this.descriptor = discovery.descriptor;
72045
72105
  this.token = discovery.token;
72046
72106
  this.socket = (0, import_node_net2.createConnection)(this.descriptor.endpoint);
72047
- this.socket.on("error", () => {
72107
+ this.socket.on("error", (error2) => {
72108
+ this.disconnectError = error2;
72048
72109
  });
72049
72110
  this.socket.on("close", () => {
72050
72111
  this.connected = false;
72051
- for (const request2 of this.pending.values()) request2.reject(new Error("HOST_CONNECTION_LOST"));
72112
+ const error2 = this.disconnectError ?? new Error("HOST_CONNECTION_LOST");
72113
+ reportHostDiagnostic(this.diagnostic, {
72114
+ event: "pty-host.connection.closed",
72115
+ hostInstanceId: this.descriptor.hostInstanceId,
72116
+ connectionId: this.connectionId,
72117
+ code: hostErrorCode(error2),
72118
+ pendingRequests: this.pending.size,
72119
+ writableBytes: this.socket.writableLength,
72120
+ ...error2 instanceof HostTransportError ? { bufferedBytes: error2.bufferedBytes, limitBytes: error2.limitBytes } : {}
72121
+ });
72122
+ for (const request2 of this.pending.values()) request2.reject(error2);
72052
72123
  this.pending.clear();
72053
- for (const listener of this.disconnected) listener();
72124
+ for (const listener of this.disconnected) listener(error2);
72054
72125
  });
72055
72126
  receiveJsonLines(this.socket, (value) => {
72056
72127
  const message2 = value;
@@ -72062,13 +72133,28 @@ var PtyHostClient = class _PtyHostClient {
72062
72133
  } else if (message2.type) for (const listener of this.events) listener(value);
72063
72134
  });
72064
72135
  }
72065
- static async connect(scope, ownerId2, expectedGeneration, expectedHostInstanceId) {
72066
- const client = new _PtyHostClient(scope);
72136
+ descriptor;
72137
+ generation = 0;
72138
+ events = /* @__PURE__ */ new Set();
72139
+ disconnected = /* @__PURE__ */ new Set();
72140
+ pending = /* @__PURE__ */ new Map();
72141
+ socket;
72142
+ token;
72143
+ connected = false;
72144
+ connectionId = (0, import_node_crypto15.randomUUID)();
72145
+ disconnectError;
72146
+ get isConnected() {
72147
+ return this.connected && !this.socket.destroyed;
72148
+ }
72149
+ static async connect(scope, ownerId2, expectedGeneration, expectedHostInstanceId, diagnostic = writeHostDiagnostic) {
72150
+ const client = new _PtyHostClient(scope, diagnostic);
72067
72151
  try {
72068
72152
  await new Promise((resolve, reject) => {
72069
72153
  const timer = setTimeout(() => {
72070
- client.socket.destroy();
72071
- reject(new Error("HOST_CONNECT_TIMEOUT"));
72154
+ const error2 = new Error("HOST_CONNECT_TIMEOUT");
72155
+ client.disconnectError = error2;
72156
+ client.socket.destroy(error2);
72157
+ reject(error2);
72072
72158
  }, 5e3);
72073
72159
  client.socket.once("error", (error2) => {
72074
72160
  clearTimeout(timer);
@@ -72091,8 +72177,9 @@ var PtyHostClient = class _PtyHostClient {
72091
72177
  /** Aborting only releases this caller's wait; it does not cancel or replay Host operations. */
72092
72178
  request(action, body2 = {}, signal) {
72093
72179
  if (signal?.aborted) return Promise.reject(new Error("HOST_REQUEST_ABORTED"));
72094
- if (!this.connected) return Promise.reject(new Error("HOST_CONNECTION_LOST"));
72180
+ if (!this.isConnected) return Promise.reject(this.socket.errored ?? this.disconnectError ?? new Error("HOST_CONNECTION_LOST"));
72095
72181
  const requestId = (0, import_node_crypto15.randomUUID)();
72182
+ const startedAt = performance.now();
72096
72183
  return new Promise((resolve, reject) => {
72097
72184
  const cleanup = () => {
72098
72185
  clearTimeout(timer);
@@ -72105,6 +72192,17 @@ var PtyHostClient = class _PtyHostClient {
72105
72192
  resolve(value);
72106
72193
  },
72107
72194
  reject: (error2) => {
72195
+ reportHostDiagnostic(this.diagnostic, {
72196
+ event: "pty-host.request.failed",
72197
+ hostInstanceId: this.descriptor.hostInstanceId,
72198
+ connectionId: this.connectionId,
72199
+ requestId,
72200
+ action: diagnosticAction(action),
72201
+ code: hostErrorCode(error2),
72202
+ elapsedMs: Math.round(performance.now() - startedAt),
72203
+ pendingRequests: this.pending.size,
72204
+ writableBytes: this.socket.writableLength
72205
+ });
72108
72206
  cleanup();
72109
72207
  reject(error2);
72110
72208
  }
@@ -72115,7 +72213,7 @@ var PtyHostClient = class _PtyHostClient {
72115
72213
  signal?.addEventListener("abort", abort, { once: true });
72116
72214
  try {
72117
72215
  if (!sendJson(this.socket, { requestId, token: this.token, hostInstanceId: this.descriptor.hostInstanceId, action, body: body2 })) {
72118
- request2.reject(new Error("HOST_CONNECTION_LOST"));
72216
+ request2.reject(this.socket.errored ?? new Error("HOST_CONNECTION_LOST"));
72119
72217
  }
72120
72218
  } catch (error2) {
72121
72219
  request2.reject(error2);
@@ -72123,11 +72221,13 @@ var PtyHostClient = class _PtyHostClient {
72123
72221
  });
72124
72222
  }
72125
72223
  close() {
72224
+ this.disconnectError ??= new Error("HOST_CLIENT_CLOSED");
72126
72225
  this.socket.destroy();
72127
72226
  }
72128
72227
  };
72129
72228
 
72130
72229
  // backend/src/terminal/runtime/pty-host-client.ts
72230
+ var hostLogger = logger.child({ component: "pty-host" });
72131
72231
  var ownerId = (0, import_node_crypto16.randomUUID)();
72132
72232
  var connection;
72133
72233
  var generation;
@@ -72139,7 +72239,13 @@ function usesPtyHost() {
72139
72239
  }
72140
72240
  async function getPtyHost() {
72141
72241
  if (stopped) throw new Error("HOST_CLIENT_STOPPED");
72142
- connection ??= PtyHostClient.connect(configuration().context, ownerId, generation, hostInstanceId).then(async (client) => {
72242
+ connection ??= PtyHostClient.connect(
72243
+ configuration().context,
72244
+ ownerId,
72245
+ generation,
72246
+ hostInstanceId,
72247
+ ({ event, ...fields2 }) => hostLogger.warn(event, fields2)
72248
+ ).then(async (client) => {
72143
72249
  generation = client.generation;
72144
72250
  hostInstanceId = client.descriptor.hostInstanceId;
72145
72251
  client.disconnected.add(() => {
@@ -72174,7 +72280,7 @@ async function createHostedPty(options) {
72174
72280
  const dataListeners = /* @__PURE__ */ new Set();
72175
72281
  const frameListeners = /* @__PURE__ */ new Set();
72176
72282
  const exitListeners = /* @__PURE__ */ new Set();
72177
- const disconnectListeners = /* @__PURE__ */ new Set();
72283
+ const failureListeners = /* @__PURE__ */ new Set();
72178
72284
  const resizeListeners = /* @__PURE__ */ new Set();
72179
72285
  const pending2 = [];
72180
72286
  let exited;
@@ -72187,6 +72293,8 @@ async function createHostedPty(options) {
72187
72293
  for (const listener of frameListeners) listener(frame);
72188
72294
  };
72189
72295
  let initializing = true;
72296
+ let disposed = false;
72297
+ let failed = false;
72190
72298
  const early = [];
72191
72299
  const receive = (event) => {
72192
72300
  if (event.terminalSessionId !== options.terminalSessionId) return;
@@ -72194,7 +72302,7 @@ async function createHostedPty(options) {
72194
72302
  early.push(event);
72195
72303
  return;
72196
72304
  }
72197
- if (event.type === "launch" && options.onLaunch) void options.onLaunch(event.launch).catch(disconnected);
72305
+ if (event.type === "launch" && options.onLaunch) void options.onLaunch(event.launch).catch((error2) => notifyFailure("launch", error2));
72198
72306
  if (event.type === "output") emitFrame(event);
72199
72307
  if (event.type === "resize") {
72200
72308
  grid = { cols: event.cols, rows: event.rows };
@@ -72205,9 +72313,12 @@ async function createHostedPty(options) {
72205
72313
  for (const listener of exitListeners) listener({ exitCode: exited });
72206
72314
  }
72207
72315
  };
72208
- const disconnected = () => {
72209
- for (const listener of disconnectListeners) listener();
72316
+ const fail3 = (failure3) => {
72317
+ if (disposed || failed) return;
72318
+ failed = true;
72319
+ for (const listener of failureListeners) listener(failure3);
72210
72320
  };
72321
+ const disconnected = (error2) => fail3({ kind: "host-disconnected", code: hostErrorCode(error2) });
72211
72322
  client.events.add(receive);
72212
72323
  client.disconnected.add(disconnected);
72213
72324
  let attached;
@@ -72254,7 +72365,19 @@ async function createHostedPty(options) {
72254
72365
  });
72255
72366
  return job;
72256
72367
  };
72257
- const notifyFailure = () => disconnected();
72368
+ const notifyFailure = (action, error2) => {
72369
+ if (disposed || failed) return;
72370
+ const code = hostErrorCode(error2);
72371
+ hostLogger.warn("terminal.host.operation.failed", {
72372
+ terminalSessionId: options.terminalSessionId,
72373
+ hostInstanceId: client.descriptor.hostInstanceId,
72374
+ action,
72375
+ code,
72376
+ pendingInputs,
72377
+ pendingBytes
72378
+ });
72379
+ fail3({ kind: client.isConnected ? "host-operation-failed" : "host-disconnected", action, code });
72380
+ };
72258
72381
  return {
72259
72382
  pid: attached.session.pid,
72260
72383
  onData(listener) {
@@ -72265,15 +72388,16 @@ async function createHostedPty(options) {
72265
72388
  if (exited !== void 0) listener({ exitCode: exited });
72266
72389
  },
72267
72390
  write(data) {
72268
- void writeSteps([{ type: "text", data }], void 0, true).catch(notifyFailure);
72391
+ void writeSteps([{ type: "text", data }], void 0, true).catch((error2) => notifyFailure("writeInput", error2));
72269
72392
  },
72270
72393
  resize(cols, rows) {
72271
- void client.request("resize", { ...target2, cols, rows }).catch(notifyFailure);
72394
+ void client.request("resize", { ...target2, cols, rows }).catch((error2) => notifyFailure("resize", error2));
72272
72395
  },
72273
72396
  signal(signal) {
72274
- void client.request("signal", { ...target2, signal }).catch(notifyFailure);
72397
+ void client.request("signal", { ...target2, signal }).catch((error2) => notifyFailure("signal", error2));
72275
72398
  },
72276
72399
  dispose() {
72400
+ disposed = true;
72277
72401
  client.events.delete(receive);
72278
72402
  client.disconnected.delete(disconnected);
72279
72403
  },
@@ -72289,8 +72413,8 @@ async function createHostedPty(options) {
72289
72413
  frameListeners.add(listener);
72290
72414
  for (const frame of pending2.splice(0)) listener(frame);
72291
72415
  },
72292
- onDisconnect(listener) {
72293
- disconnectListeners.add(listener);
72416
+ onFailure(listener) {
72417
+ failureListeners.add(listener);
72294
72418
  },
72295
72419
  onResize(listener) {
72296
72420
  resizeListeners.add(listener);
@@ -114183,10 +114307,19 @@ function getLiveTerminalScrollback(scrollback) {
114183
114307
  }
114184
114308
 
114185
114309
  // backend/src/ws/terminal-server-connection-helpers.ts
114310
+ var TERMINAL_RECOVERY_CLOSE_REASONS = {
114311
+ "mirror-limit": "Terminal mirror output limit",
114312
+ "host-disconnected": "Terminal host connection lost",
114313
+ "host-operation-failed": "Terminal host operation failed"
114314
+ };
114186
114315
  var TMUX_INITIAL_REPAINT_SETTLE_MS = 50;
114187
114316
  var TMUX_METADATA_SYNC_DELAY_MS = 100;
114188
114317
  var TERMINAL_WS_MAX_PENDING_BYTES = 4 * 1024 * 1024;
114189
114318
  var terminalWsLogger = logger.child({ component: "terminal-ws" });
114319
+ var socketContexts = /* @__PURE__ */ new WeakMap();
114320
+ function registerTerminalSocketContext(socket, terminalSessionId) {
114321
+ socketContexts.set(socket, { terminalSessionId });
114322
+ }
114190
114323
  function delay7(ms) {
114191
114324
  return new Promise((resolve) => setTimeout(resolve, ms));
114192
114325
  }
@@ -114227,14 +114360,25 @@ function sendEvent(socket, event) {
114227
114360
  }
114228
114361
  const payload = JSON.stringify(event);
114229
114362
  if (socket.bufferedAmount + Buffer.byteLength(payload, "utf8") > TERMINAL_WS_MAX_PENDING_BYTES) {
114230
- closeSlowTerminalSocket(socket);
114363
+ closeSlowTerminalSocket(socket, "Terminal output recovery required", {
114364
+ trigger: "send-buffer-limit",
114365
+ payloadBytes: Buffer.byteLength(payload, "utf8"),
114366
+ limitBytes: TERMINAL_WS_MAX_PENDING_BYTES,
114367
+ messageType: event.type
114368
+ });
114231
114369
  return false;
114232
114370
  }
114233
114371
  socket.send(payload);
114234
114372
  return true;
114235
114373
  }
114236
- function closeSlowTerminalSocket(socket, reason = "Terminal output recovery required") {
114374
+ function closeSlowTerminalSocket(socket, reason = "Terminal output recovery required", details = {}) {
114237
114375
  if (socket.readyState !== 1) return;
114376
+ terminalWsLogger.warn("terminal.output.recovery.required", {
114377
+ ...socketContexts.get(socket),
114378
+ reason,
114379
+ bufferedBytes: socket.bufferedAmount,
114380
+ ...details
114381
+ });
114238
114382
  socket.close(1013, reason);
114239
114383
  socket.emit("terminal-output-stopped");
114240
114384
  const timer = setTimeout(() => socket.terminate(), 1e3);
@@ -114724,6 +114868,7 @@ function attachTerminalWebSocketServer(upgradeRouter, terminalSessionManager, ru
114724
114868
  return;
114725
114869
  }
114726
114870
  const { terminalSessionId } = handshake;
114871
+ registerTerminalSocketContext(socket, terminalSessionId);
114727
114872
  const connectedAt = Date.now();
114728
114873
  const session = terminalSessionManager.getSession(terminalSessionId);
114729
114874
  const params = new URL(request2.url ?? "/", "http://localhost").searchParams;
@@ -114848,7 +114993,7 @@ function attachTerminalWebSocketServer(upgradeRouter, terminalSessionManager, ru
114848
114993
  try {
114849
114994
  activeRuntime.resize(cols, rows);
114850
114995
  } catch {
114851
- closeSlowTerminalSocket(socket);
114996
+ closeSlowTerminalSocket(socket, "Terminal initial resize failed");
114852
114997
  runtimeRegistry.retainIdleRuntime(runtimeId);
114853
114998
  return;
114854
114999
  }
@@ -114979,7 +115124,10 @@ function attachTerminalWebSocketServer(upgradeRouter, terminalSessionManager, ru
114979
115124
  unsubscribe = runtimeRegistry.subscribe(runtimeId, {
114980
115125
  onOutputFrame: (frame) => outputRecovery?.onFrame(frame),
114981
115126
  onResize: (cols2, rows2) => outputRecovery?.onResize(cols2, rows2),
114982
- onRecoveryError: () => closeSlowTerminalSocket(socket, "Terminal mirror output limit"),
115127
+ onRecoveryError: (failure3) => {
115128
+ terminalWsLogger5.warn("terminal.runtime.recovery.failed", { terminalSessionId, ...failure3 });
115129
+ closeSlowTerminalSocket(socket, TERMINAL_RECOVERY_CLOSE_REASONS[failure3.kind]);
115130
+ },
114983
115131
  onData(data) {
114984
115132
  runtimeOutputSequence += 1;
114985
115133
  logTerminalPerf("terminal.runtime.output", {
@@ -115023,7 +115171,7 @@ function attachTerminalWebSocketServer(upgradeRouter, terminalSessionManager, ru
115023
115171
  pendingInitialOutput += metadata.output;
115024
115172
  if (Buffer.byteLength(pendingInitialOutput, "utf8") > 512 * 1024) {
115025
115173
  pendingInitialOutput = "";
115026
- closeSlowTerminalSocket(socket);
115174
+ closeSlowTerminalSocket(socket, "Terminal initial output queue exceeded", { trigger: "initial-output-limit", limitBytes: 512 * 1024 });
115027
115175
  }
115028
115176
  return;
115029
115177
  }
@@ -124604,7 +124752,7 @@ var ExperienceLearningAnalysis = class {
124604
124752
  triggers,
124605
124753
  applicability,
124606
124754
  avoid,
124607
- actions,
124755
+ actions: actions2,
124608
124756
  verification,
124609
124757
  state
124610
124758
  }) => ({
@@ -124613,7 +124761,7 @@ var ExperienceLearningAnalysis = class {
124613
124761
  triggers,
124614
124762
  applicability,
124615
124763
  avoid,
124616
- actions,
124764
+ actions: actions2,
124617
124765
  verification,
124618
124766
  state
124619
124767
  })
@@ -126703,8 +126851,14 @@ var TerminalOutputScreen = class _TerminalOutputScreen {
126703
126851
  if (this.disposed) return;
126704
126852
  this.pendingBytes += frame.range.toOffset - frame.range.fromOffset;
126705
126853
  if (this.pendingBytes > RESUME_MAX_BYTES || this.queue.length >= 8192) {
126854
+ const failure3 = {
126855
+ code: this.pendingBytes > RESUME_MAX_BYTES ? "HOST_MIRROR_PENDING_LIMIT" : "HOST_MIRROR_QUEUE_LIMIT",
126856
+ bufferedBytes: this.pendingBytes,
126857
+ limitBytes: RESUME_MAX_BYTES,
126858
+ queuedOperations: this.queue.length
126859
+ };
126706
126860
  this.dispose();
126707
- this.onFailure();
126861
+ this.onFailure(failure3);
126708
126862
  return;
126709
126863
  }
126710
126864
  this.queue.push({ frame });
@@ -126809,8 +126963,14 @@ var TerminalOutputScreen = class _TerminalOutputScreen {
126809
126963
  this.writing = false;
126810
126964
  this.partialControlBytes = screenParserIsIdle(this.terminal) ? 0 : this.partialControlBytes + frame.range.toOffset - frame.range.fromOffset;
126811
126965
  if (this.partialControlBytes > RESUME_MAX_BYTES) {
126966
+ const failure3 = {
126967
+ code: "HOST_MIRROR_CONTROL_LIMIT",
126968
+ bufferedBytes: this.partialControlBytes,
126969
+ limitBytes: RESUME_MAX_BYTES,
126970
+ queuedOperations: this.queue.length
126971
+ };
126812
126972
  this.dispose();
126813
- this.onFailure();
126973
+ this.onFailure(failure3);
126814
126974
  return;
126815
126975
  }
126816
126976
  this.completeSnapshot?.();
@@ -126923,9 +127083,10 @@ var TerminalRuntimeRegistry = class _TerminalRuntimeRegistry {
126923
127083
  if (entry.outputRecovery && !runtime.hosted) {
126924
127084
  entry.outputScreen = new TerminalOutputScreen(
126925
127085
  entry.outputRecovery.cursor,
126926
- () => {
127086
+ (failure3) => {
127087
+ logger.warn("terminal.mirror.failed", { terminalSessionId, ...failure3 });
126927
127088
  for (const subscriber of entry.subscribers)
126928
- subscriber.onRecoveryError?.();
127089
+ subscriber.onRecoveryError?.({ kind: "mirror-limit", code: failure3.code });
126929
127090
  void this.disposeRuntime(runtimeId);
126930
127091
  }
126931
127092
  );
@@ -126957,8 +127118,8 @@ var TerminalRuntimeRegistry = class _TerminalRuntimeRegistry {
126957
127118
  runtime.hosted.onFrame((frame) => {
126958
127119
  for (const subscriber of entry.subscribers) subscriber.onOutputFrame?.(frame);
126959
127120
  });
126960
- runtime.hosted.onDisconnect(() => {
126961
- for (const subscriber of entry.subscribers) subscriber.onRecoveryError?.();
127121
+ runtime.hosted.onFailure((failure3) => {
127122
+ for (const subscriber of entry.subscribers) subscriber.onRecoveryError?.(failure3);
126962
127123
  void this.disposeRuntime(runtimeId);
126963
127124
  });
126964
127125
  }