purplemux 0.1.17 → 0.1.18

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 (169) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +18 -18
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/routes-manifest.json +13 -7
  6. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0fi~pyu._.js → [root-of-the-server]__0-ptdqu._.js} +2 -2
  7. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0der504._.js → [root-of-the-server]__0.784vy._.js} +2 -2
  8. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0.ci6xk._.js → [root-of-the-server]__0.lni9v._.js} +2 -2
  9. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0001gmm._.js +15 -0
  10. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0wvse.i._.js → [root-of-the-server]__004og4w._.js} +2 -2
  11. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0q8vz0w._.js → [root-of-the-server]__0bhgbyi._.js} +2 -2
  12. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0eqgg0e._.js → [root-of-the-server]__0iqf2xr._.js} +14 -2
  13. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__00.o36.._.js → [root-of-the-server]__0kszkmt._.js} +2 -2
  14. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0mm5n3z._.js +15 -0
  15. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0rn27mp._.js → [root-of-the-server]__0n.b1bb._.js} +2 -2
  16. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__047h5zj._.js → [root-of-the-server]__0n26.bn._.js} +2 -2
  17. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0f4eb0-._.js → [root-of-the-server]__0n43wjx._.js} +2 -2
  18. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__12vs-9c._.js → [root-of-the-server]__0o3y7mk._.js} +2 -2
  19. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o4dvc-._.js +1 -1
  20. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0hr115i._.js → [root-of-the-server]__0~hbxss._.js} +2 -2
  21. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0ccgn_3._.js → [root-of-the-server]__11b3od9._.js} +2 -2
  22. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0aboezg._.js → [root-of-the-server]__11mo3f-._.js} +2 -2
  23. package/.next/standalone/.next/server/chunks/src_lib_status-manager_ts_003hlhy._.js +3 -0
  24. package/.next/standalone/.next/server/chunks/src_lib_workspace-store_ts_0vqt073._.js +1 -1
  25. package/.next/standalone/.next/server/chunks/ssr/_03axaof._.js +1 -1
  26. package/.next/standalone/.next/server/chunks/ssr/_0camkxl._.js +1 -1
  27. package/.next/standalone/.next/server/chunks/ssr/_0i209pm._.js +1 -1
  28. package/.next/standalone/.next/server/chunks/ssr/_0sfa_96._.js +1 -1
  29. package/.next/standalone/.next/server/chunks/ssr/_0x2-u_i._.js +1 -1
  30. package/.next/standalone/.next/server/chunks/ssr/src_components_features_terminal_terminal-page_tsx_0o~2bsa._.js +1 -1
  31. package/.next/standalone/.next/server/chunks/ssr/src_hooks_use-browser-title_ts_0bw6.cb._.js +1 -1
  32. package/.next/standalone/.next/server/chunks/ssr/src_lib_workspace-store_ts_00x-rec._.js +1 -1
  33. package/.next/standalone/.next/server/middleware-build-manifest.js +18 -18
  34. package/.next/standalone/.next/server/pages/_app/build-manifest.json +2 -2
  35. package/.next/standalone/.next/server/pages/_app/client-build-manifest.json +1 -1
  36. package/.next/standalone/.next/server/pages/api/git/branch.js +1 -1
  37. package/.next/standalone/.next/server/pages/api/git/branch.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/pages/api/git/status.js +1 -1
  39. package/.next/standalone/.next/server/pages/api/git/status.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/pages/api/layout/cwd.js +1 -1
  41. package/.next/standalone/.next/server/pages/api/layout/cwd.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/pages/api/layout/diff.js +1 -1
  43. package/.next/standalone/.next/server/pages/api/layout/diff.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId]/tabs/[tabId]/move.js +1 -1
  45. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId]/tabs/[tabId]/move.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId]/tabs/[tabId].js +3 -3
  47. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId]/tabs/[tabId].js.nft.json +1 -1
  48. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId]/tabs/order.js +1 -1
  49. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId]/tabs/order.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId]/tabs.js +5 -5
  51. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId]/tabs.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId].js +1 -1
  53. package/.next/standalone/.next/server/pages/api/layout/pane/[paneId].js.nft.json +1 -1
  54. package/.next/standalone/.next/server/pages/api/layout/pane.js +1 -1
  55. package/.next/standalone/.next/server/pages/api/layout/pane.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/pages/api/layout.js +1 -1
  57. package/.next/standalone/.next/server/pages/api/layout.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/pages/api/message-history.js +1 -1
  59. package/.next/standalone/.next/server/pages/api/message-history.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/pages/api/push/vapid-key.js +1 -1
  61. package/.next/standalone/.next/server/pages/api/push/vapid-key.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/pages/api/stats/daily-report/cache.js +1 -1
  63. package/.next/standalone/.next/server/pages/api/stats/daily-report/cache.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/pages/api/stats/daily-report/generate.js +1 -1
  65. package/.next/standalone/.next/server/pages/api/stats/daily-report/generate.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/pages/api/stats/projects.js +1 -1
  67. package/.next/standalone/.next/server/pages/api/stats/projects.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/pages/api/stats/sessions.js +1 -1
  69. package/.next/standalone/.next/server/pages/api/stats/sessions.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/pages/api/stats/uptime.js +1 -1
  71. package/.next/standalone/.next/server/pages/api/stats/uptime.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/pages/api/status/hook.js +5 -5
  73. package/.next/standalone/.next/server/pages/api/status/hook.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/pages/api/status/statusline/pages-manifest.json +3 -0
  75. package/.next/standalone/.next/server/pages/api/status/statusline.js +5 -0
  76. package/.next/standalone/.next/server/pages/api/status/statusline.js.map +5 -0
  77. package/.next/standalone/.next/server/pages/api/status/statusline.js.nft.json +1 -0
  78. package/.next/standalone/.next/server/pages/api/system/tmux-sessions.js +1 -1
  79. package/.next/standalone/.next/server/pages/api/system/tmux-sessions.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/pages/api/tmux/capture.js +1 -1
  81. package/.next/standalone/.next/server/pages/api/tmux/capture.js.nft.json +1 -1
  82. package/.next/standalone/.next/server/pages/api/tmux/info.js +1 -1
  83. package/.next/standalone/.next/server/pages/api/tmux/info.js.nft.json +1 -1
  84. package/.next/standalone/.next/server/pages/api/tmux/permission-options.js +1 -1
  85. package/.next/standalone/.next/server/pages/api/tmux/permission-options.js.nft.json +1 -1
  86. package/.next/standalone/.next/server/pages/api/tmux/plan-options.js +1 -1
  87. package/.next/standalone/.next/server/pages/api/tmux/plan-options.js.nft.json +1 -1
  88. package/.next/standalone/.next/server/pages/api/tmux/recover-unknown.js +5 -5
  89. package/.next/standalone/.next/server/pages/api/tmux/recover-unknown.js.nft.json +1 -1
  90. package/.next/standalone/.next/server/pages/api/tmux/reset.js +5 -5
  91. package/.next/standalone/.next/server/pages/api/tmux/reset.js.nft.json +1 -1
  92. package/.next/standalone/.next/server/pages/api/tmux/send-input.js +1 -1
  93. package/.next/standalone/.next/server/pages/api/tmux/send-input.js.nft.json +1 -1
  94. package/.next/standalone/.next/server/pages/api/workspace/[workspaceId].js +1 -1
  95. package/.next/standalone/.next/server/pages/api/workspace/[workspaceId].js.nft.json +1 -1
  96. package/.next/standalone/.next/server/pages/api/workspace/active.js +1 -1
  97. package/.next/standalone/.next/server/pages/api/workspace/active.js.nft.json +1 -1
  98. package/.next/standalone/.next/server/pages/api/workspace/reorder.js +1 -1
  99. package/.next/standalone/.next/server/pages/api/workspace/reorder.js.nft.json +1 -1
  100. package/.next/standalone/.next/server/pages/api/workspace/validate.js +1 -1
  101. package/.next/standalone/.next/server/pages/api/workspace/validate.js.nft.json +1 -1
  102. package/.next/standalone/.next/server/pages/api/workspace.js +4 -4
  103. package/.next/standalone/.next/server/pages/api/workspace.js.nft.json +1 -1
  104. package/.next/standalone/.next/server/pages/de/404.html +1 -1
  105. package/.next/standalone/.next/server/pages/de/500.html +1 -1
  106. package/.next/standalone/.next/server/pages/en/404.html +1 -1
  107. package/.next/standalone/.next/server/pages/en/500.html +1 -1
  108. package/.next/standalone/.next/server/pages/es/404.html +1 -1
  109. package/.next/standalone/.next/server/pages/es/500.html +1 -1
  110. package/.next/standalone/.next/server/pages/fr/404.html +1 -1
  111. package/.next/standalone/.next/server/pages/fr/500.html +1 -1
  112. package/.next/standalone/.next/server/pages/index/build-manifest.json +4 -4
  113. package/.next/standalone/.next/server/pages/index/client-build-manifest.json +1 -1
  114. package/.next/standalone/.next/server/pages/index/react-loadable-manifest.json +3 -3
  115. package/.next/standalone/.next/server/pages/ja/404.html +1 -1
  116. package/.next/standalone/.next/server/pages/ja/500.html +1 -1
  117. package/.next/standalone/.next/server/pages/ko/404.html +1 -1
  118. package/.next/standalone/.next/server/pages/ko/500.html +1 -1
  119. package/.next/standalone/.next/server/pages/pt-BR/404.html +1 -1
  120. package/.next/standalone/.next/server/pages/pt-BR/500.html +1 -1
  121. package/.next/standalone/.next/server/pages/reports/build-manifest.json +3 -3
  122. package/.next/standalone/.next/server/pages/reports/client-build-manifest.json +1 -1
  123. package/.next/standalone/.next/server/pages/ru/404.html +1 -1
  124. package/.next/standalone/.next/server/pages/ru/500.html +1 -1
  125. package/.next/standalone/.next/server/pages/stats/build-manifest.json +3 -3
  126. package/.next/standalone/.next/server/pages/stats/client-build-manifest.json +1 -1
  127. package/.next/standalone/.next/server/pages/tr/404.html +1 -1
  128. package/.next/standalone/.next/server/pages/tr/500.html +1 -1
  129. package/.next/standalone/.next/server/pages/webview/build-manifest.json +3 -3
  130. package/.next/standalone/.next/server/pages/webview/client-build-manifest.json +1 -1
  131. package/.next/standalone/.next/server/pages/zh-CN/404.html +1 -1
  132. package/.next/standalone/.next/server/pages/zh-CN/500.html +1 -1
  133. package/.next/standalone/.next/server/pages/zh-TW/404.html +1 -1
  134. package/.next/standalone/.next/server/pages/zh-TW/500.html +1 -1
  135. package/.next/standalone/.next/server/pages-manifest.json +1 -0
  136. package/.next/standalone/.next/static/{9sQS-T1N6dQRRCfQ5dv7l → OBuQPM-YIw3qyEE3jhL3e}/_buildManifest.js +5 -4
  137. package/.next/standalone/.next/static/chunks/{03pj5vbx8tt6r.js → 059hm.5_8_lbf.js} +1 -1
  138. package/.next/standalone/.next/static/chunks/{15d5efa-41siq.js → 06qo9c6zmfuby.js} +1 -1
  139. package/.next/standalone/.next/static/chunks/{0.65n77uprskt.js → 09j2n1dl5w7kw.js} +1 -1
  140. package/.next/standalone/.next/static/chunks/0f4xf8w_wwlb5.js +5 -0
  141. package/.next/standalone/.next/static/chunks/{0oziwy-vdu0f~.js → 0fx~fwx.8d70..js} +2 -2
  142. package/.next/standalone/.next/static/chunks/{04_gnka.lemzz.js → 0g1jj1418404y.js} +3 -3
  143. package/.next/standalone/.next/static/chunks/0ld-oc3qt3ev4.js +5 -0
  144. package/.next/standalone/.next/static/chunks/{0qtk3r.4beszd.js → 0oa6n2st2h3y4.js} +3 -3
  145. package/.next/standalone/.next/static/chunks/{1622t59.xl3hg.js → 0sby0kfs4r39m.js} +1 -1
  146. package/.next/standalone/.next/static/chunks/{0w8wkbxa.u_pi.js → 119sqy0vy5gzx.js} +3 -3
  147. package/.next/standalone/.next/static/chunks/13xp_-k99aus8.js +1 -0
  148. package/.next/standalone/.next/static/chunks/{0minecbyq81wq.js → 154d~13n-o1ax.js} +4 -4
  149. package/.next/standalone/.next/static/chunks/{0pl9csop3j.pi.js → 15rw76n0-15~j.js} +1 -1
  150. package/.next/standalone/.next/static/chunks/17bn35muvbncj.css +1 -0
  151. package/.next/standalone/.next/static/chunks/{turbopack-0q6~qdu7y-idl.js → turbopack-0-~0otu~wqqdf.js} +1 -1
  152. package/.next/standalone/.next/static/chunks/{turbopack-04h~wvgsyz27p.js → turbopack-0cczrwv.x0k9m.js} +1 -1
  153. package/.next/standalone/.next/static/chunks/{turbopack-0.dkht~dwfayp.js → turbopack-0ynenqgdbu55u.js} +1 -1
  154. package/.next/standalone/.next/static/chunks/{turbopack-13xx2s-bjf8-7.js → turbopack-11vxxrzwm.se_.js} +1 -1
  155. package/.next/standalone/.next/static/chunks/{turbopack-0-bxg2d3m993v.js → turbopack-16fhr1wncw41u.js} +1 -1
  156. package/.next/standalone/package.json +1 -1
  157. package/.next/standalone/server.js +1 -1
  158. package/dist/server.js +77 -119
  159. package/package.json +1 -1
  160. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0oroz_c._.js +0 -30
  161. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sus.46._.js +0 -42
  162. package/.next/standalone/.next/server/chunks/src_lib_0dloxl0._.js +0 -61
  163. package/.next/standalone/.next/server/chunks/src_lib_0k3pcvq._.js +0 -61
  164. package/.next/standalone/.next/static/chunks/068ekp47esvhq.js +0 -5
  165. package/.next/standalone/.next/static/chunks/08x8a4eswq64z.css +0 -1
  166. package/.next/standalone/.next/static/chunks/0xh6vx3lhw1an.js +0 -5
  167. package/.next/standalone/.next/static/chunks/111wo.gkd383u.js +0 -1
  168. /package/.next/standalone/.next/static/{9sQS-T1N6dQRRCfQ5dv7l → OBuQPM-YIw3qyEE3jhL3e}/_clientMiddlewareManifest.js +0 -0
  169. /package/.next/standalone/.next/static/{9sQS-T1N6dQRRCfQ5dv7l → OBuQPM-YIw3qyEE3jhL3e}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- 9sQS-T1N6dQRRCfQ5dv7l
1
+ OBuQPM-YIw3qyEE3jhL3e
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "pages": {
3
3
  "/": [
4
- "static/chunks/15d5efa-41siq.js",
4
+ "static/chunks/06qo9c6zmfuby.js",
5
5
  "static/chunks/0y1iobvr7xv~m.js",
6
6
  "static/chunks/06wc2umsaus4g.js",
7
7
  "static/chunks/0o7vp7rng47dj.js",
@@ -10,16 +10,16 @@
10
10
  "static/chunks/0-sxrfxgcu1ce.js",
11
11
  "static/chunks/15aj3kd.p7zw6.js",
12
12
  "static/chunks/0q_k2q4jnitzb.js",
13
- "static/chunks/03pj5vbx8tt6r.js",
13
+ "static/chunks/059hm.5_8_lbf.js",
14
14
  "static/chunks/0ml5~2ty-rbv_.js",
15
- "static/chunks/111wo.gkd383u.js",
15
+ "static/chunks/13xp_-k99aus8.js",
16
16
  "static/chunks/0hrc-naqx2l7..js",
17
17
  "static/chunks/00yfl7agnve...js",
18
18
  "static/chunks/0c3gfuc02qr00.js",
19
19
  "static/chunks/0wlz6--vu7adu.js",
20
20
  "static/chunks/0bw-pbfc7gjj-.js",
21
21
  "static/chunks/0yi.kp2rt4-nc.js",
22
- "static/chunks/turbopack-0q6~qdu7y-idl.js"
22
+ "static/chunks/turbopack-0-~0otu~wqqdf.js"
23
23
  ],
24
24
  "/_app": [
25
25
  "static/chunks/0uxhf0if8bv~8.js",
@@ -29,9 +29,9 @@
29
29
  "static/chunks/0yi.kp2rt4-nc.js",
30
30
  "static/chunks/0ds79k_04k7_v.js",
31
31
  "static/chunks/14_wa..vd6~2y.js",
32
- "static/chunks/08x8a4eswq64z.css",
32
+ "static/chunks/17bn35muvbncj.css",
33
33
  "static/chunks/0z3gpm0o.mwwy.css",
34
- "static/chunks/turbopack-04h~wvgsyz27p.js"
34
+ "static/chunks/turbopack-0cczrwv.x0k9m.js"
35
35
  ],
36
36
  "/_error": [
37
37
  "static/chunks/0~o730huopa91.js",
@@ -63,17 +63,17 @@
63
63
  "static/chunks/0bw-pbfc7gjj-.js",
64
64
  "static/chunks/14_wa..vd6~2y.js",
65
65
  "static/chunks/0kv4vcveacgn2.js",
66
- "static/chunks/0pl9csop3j.pi.js",
66
+ "static/chunks/15rw76n0-15~j.js",
67
67
  "static/chunks/00yfl7agnve...js",
68
68
  "static/chunks/0wlz6--vu7adu.js",
69
69
  "static/chunks/0yi.kp2rt4-nc.js",
70
70
  "static/chunks/031unywm42_xs.js",
71
71
  "static/chunks/0hrc-naqx2l7..js",
72
- "static/chunks/111wo.gkd383u.js",
72
+ "static/chunks/13xp_-k99aus8.js",
73
73
  "static/chunks/0-sxrfxgcu1ce.js",
74
74
  "static/chunks/0ml5~2ty-rbv_.js",
75
75
  "static/chunks/15aj3kd.p7zw6.js",
76
- "static/chunks/turbopack-0.dkht~dwfayp.js"
76
+ "static/chunks/turbopack-0ynenqgdbu55u.js"
77
77
  ],
78
78
  "/reset": [
79
79
  "static/chunks/0_sdw~kzk-at0.js",
@@ -94,15 +94,15 @@
94
94
  "static/chunks/0kv4vcveacgn2.js",
95
95
  "static/chunks/0o7vp7rng47dj.js",
96
96
  "static/chunks/0c3gfuc02qr00.js",
97
- "static/chunks/111wo.gkd383u.js",
97
+ "static/chunks/13xp_-k99aus8.js",
98
98
  "static/chunks/0hrc-naqx2l7..js",
99
99
  "static/chunks/0yi.kp2rt4-nc.js",
100
- "static/chunks/0.65n77uprskt.js",
100
+ "static/chunks/09j2n1dl5w7kw.js",
101
101
  "static/chunks/0ml5~2ty-rbv_.js",
102
102
  "static/chunks/0wlz6--vu7adu.js",
103
103
  "static/chunks/14_wa..vd6~2y.js",
104
104
  "static/chunks/0bw-pbfc7gjj-.js",
105
- "static/chunks/turbopack-0-bxg2d3m993v.js"
105
+ "static/chunks/turbopack-16fhr1wncw41u.js"
106
106
  ],
107
107
  "/tools-required": [
108
108
  "static/chunks/0kf8xkvr3218u.js",
@@ -121,28 +121,28 @@
121
121
  "static/chunks/0ay.h74rl2t2c.js",
122
122
  "static/chunks/0o7vp7rng47dj.js",
123
123
  "static/chunks/0c3gfuc02qr00.js",
124
- "static/chunks/03pj5vbx8tt6r.js",
124
+ "static/chunks/059hm.5_8_lbf.js",
125
125
  "static/chunks/0-sxrfxgcu1ce.js",
126
126
  "static/chunks/14_wa..vd6~2y.js",
127
127
  "static/chunks/0kv4vcveacgn2.js",
128
128
  "static/chunks/0wlz6--vu7adu.js",
129
129
  "static/chunks/00yfl7agnve...js",
130
130
  "static/chunks/0yi.kp2rt4-nc.js",
131
- "static/chunks/111wo.gkd383u.js",
131
+ "static/chunks/13xp_-k99aus8.js",
132
132
  "static/chunks/0hrc-naqx2l7..js",
133
133
  "static/chunks/0abvchxh9j._1.js",
134
134
  "static/chunks/0ml5~2ty-rbv_.js",
135
135
  "static/chunks/15aj3kd.p7zw6.js",
136
136
  "static/chunks/0bw-pbfc7gjj-.js",
137
- "static/chunks/turbopack-13xx2s-bjf8-7.js"
137
+ "static/chunks/turbopack-11vxxrzwm.se_.js"
138
138
  ]
139
139
  },
140
140
  "devFiles": [],
141
141
  "polyfillFiles": [],
142
142
  "lowPriorityFiles": [
143
- "static/9sQS-T1N6dQRRCfQ5dv7l/_buildManifest.js",
144
- "static/9sQS-T1N6dQRRCfQ5dv7l/_ssgManifest.js",
145
- "static/9sQS-T1N6dQRRCfQ5dv7l/_clientMiddlewareManifest.js"
143
+ "static/OBuQPM-YIw3qyEE3jhL3e/_buildManifest.js",
144
+ "static/OBuQPM-YIw3qyEE3jhL3e/_ssgManifest.js",
145
+ "static/OBuQPM-YIw3qyEE3jhL3e/_clientMiddlewareManifest.js"
146
146
  ],
147
147
  "rootMainFiles": []
148
148
  }
@@ -3,9 +3,9 @@
3
3
  "routes": {},
4
4
  "dynamicRoutes": {},
5
5
  "preview": {
6
- "previewModeId": "5bcd94333c94d8f7685ed33657dd7f0a",
7
- "previewModeSigningKey": "bea6688cc8e823a0b4846bf47cdbc3c0a81897a7adc250ab3ef76d2b56a8b81e",
8
- "previewModeEncryptionKey": "739370404b492c1922fd88f3ec42c92d7ab46d92249dd15ce454c4eceb3243c3"
6
+ "previewModeId": "f4a037663b54e0769678779dd5976ac3",
7
+ "previewModeSigningKey": "eef350f043c91911a21753ba7fa77434dfc8bc548e780efe3adcc378f39f3b16",
8
+ "previewModeEncryptionKey": "b0dc9979257bb6770d00bd7dad50e6bd40e25f8e418c3a6f5e052a9e95b2d370"
9
9
  },
10
10
  "notFoundRoutes": []
11
11
  }
@@ -2,7 +2,7 @@
2
2
  "version": 1,
3
3
  "config": {
4
4
  "env": {
5
- "NEXT_PUBLIC_COMMIT_HASH": "bd3f928"
5
+ "NEXT_PUBLIC_COMMIT_HASH": "1676b09"
6
6
  },
7
7
  "webpack": null,
8
8
  "typescript": {
@@ -340,6 +340,12 @@
340
340
  "routeKeys": {},
341
341
  "namedRegex": "^/api/status/hook(?:/)?$"
342
342
  },
343
+ {
344
+ "page": "/api/status/statusline",
345
+ "regex": "^/api/status/statusline(?:/)?$",
346
+ "routeKeys": {},
347
+ "namedRegex": "^/api/status/statusline(?:/)?$"
348
+ },
343
349
  {
344
350
  "page": "/api/system/tmux-sessions",
345
351
  "regex": "^/api/system/tmux\\-sessions(?:/)?$",
@@ -476,31 +482,31 @@
476
482
  "dataRoutes": [
477
483
  {
478
484
  "page": "/",
479
- "dataRouteRegex": "^/_next/data/9sQS\\-T1N6dQRRCfQ5dv7l/index\\.json$"
485
+ "dataRouteRegex": "^/_next/data/OBuQPM\\-YIw3qyEE3jhL3e/index\\.json$"
480
486
  },
481
487
  {
482
488
  "page": "/login",
483
- "dataRouteRegex": "^/_next/data/9sQS\\-T1N6dQRRCfQ5dv7l/login\\.json$"
489
+ "dataRouteRegex": "^/_next/data/OBuQPM\\-YIw3qyEE3jhL3e/login\\.json$"
484
490
  },
485
491
  {
486
492
  "page": "/reports",
487
- "dataRouteRegex": "^/_next/data/9sQS\\-T1N6dQRRCfQ5dv7l/reports\\.json$"
493
+ "dataRouteRegex": "^/_next/data/OBuQPM\\-YIw3qyEE3jhL3e/reports\\.json$"
488
494
  },
489
495
  {
490
496
  "page": "/reset",
491
- "dataRouteRegex": "^/_next/data/9sQS\\-T1N6dQRRCfQ5dv7l/reset\\.json$"
497
+ "dataRouteRegex": "^/_next/data/OBuQPM\\-YIw3qyEE3jhL3e/reset\\.json$"
492
498
  },
493
499
  {
494
500
  "page": "/stats",
495
- "dataRouteRegex": "^/_next/data/9sQS\\-T1N6dQRRCfQ5dv7l/stats\\.json$"
501
+ "dataRouteRegex": "^/_next/data/OBuQPM\\-YIw3qyEE3jhL3e/stats\\.json$"
496
502
  },
497
503
  {
498
504
  "page": "/tools-required",
499
- "dataRouteRegex": "^/_next/data/9sQS\\-T1N6dQRRCfQ5dv7l/tools-required\\.json$"
505
+ "dataRouteRegex": "^/_next/data/OBuQPM\\-YIw3qyEE3jhL3e/tools-required\\.json$"
500
506
  },
501
507
  {
502
508
  "page": "/webview",
503
- "dataRouteRegex": "^/_next/data/9sQS\\-T1N6dQRRCfQ5dv7l/webview\\.json$"
509
+ "dataRouteRegex": "^/_next/data/OBuQPM\\-YIw3qyEE3jhL3e/webview\\.json$"
504
510
  }
505
511
  ],
506
512
  "i18n": {
@@ -1,3 +1,3 @@
1
- module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},666680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},130146,(e,t,r)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},233405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},25146,e=>{"use strict";var t=e.i(130146),r=e.i(814747),a=e.i(446786);let s=r.default.join(a.default.homedir(),".purplemux","logs"),n=process.env.LOG_LEVEL||"info",i=(e=>{if(!e)return{};let t={};for(let r of e.split(",")){let[e,a]=r.split("=").map(e=>e.trim());e&&a&&(t[e]=a)}return t})(process.env.LOG_LEVELS),l=["trace","debug","info","warn","error","fatal"],o=globalThis;if(!o.__ptRootLogger){let e=[n,...Object.values(i)].reduce((e,t)=>l.indexOf(t)<l.indexOf(e)?t:e,"fatal");o.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:r.default.join(s,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let u=o.__ptRootLogger;e.s(["createLogger",0,e=>{let t=u.child({module:e});return t.level=i[e]??n,t}])},44014,e=>{"use strict";let t,r;var a=e.i(666680);e.s(["nanoid",0,function(e=21){var s;s=e|=0,!t||t.length<s?(t=Buffer.allocUnsafe(128*s),a.webcrypto.getRandomValues(t),r=0):r+s>t.length&&(a.webcrypto.getRandomValues(t),r=0),r+=s;let n="";for(let a=r-e;a<r;a++)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[a]];return n}],44014)},459015,544538,e=>{"use strict";var t=e.i(233405),r=e.i(924868),a=e.i(224361),s=e.i(814747),n=e.i(44014),i=e.i(25146);process.platform;let l="linux"===process.platform;e.s(["isLinux",0,l],544538);let o=(0,i.createLogger)("terminal"),u=(0,a.promisify)(t.execFile),p="purple",c=s.default.join(process.env.__PMUX_APP_DIR_UNPACKED||process.env.__PMUX_APP_DIR||process.cwd(),"src","config","tmux.conf"),d={...process.env},m=new Set(["AUTH_PASSWORD","NEXTAUTH_SECRET","PORT"]),f=()=>Object.fromEntries(Object.entries(d).filter(([e])=>!e.startsWith("npm_")&&!e.startsWith("NODE_")&&!m.has(e))),h=async()=>{try{let{stdout:e}=await u("tmux",["-L",p,"ls","-F","#{session_name}"],{timeout:5e3});return e.trim().split("\n").map(e=>e.trim()).filter(e=>e.startsWith("pt-"))}catch{return[]}},w=async(e,t,r,a)=>{let s=process.env.SHELL||"/bin/zsh";await u("tmux",["-u","-L",p,"-f",c,"new-session","-d","-s",e,"-x",String(t),"-y",String(r)],{timeout:5e3,env:{...f(),SHELL:s,TERM:"xterm-256color",COLORTERM:"truecolor"},cwd:a||process.env.HOME||"/"}),await b(),o.debug(`tmux session created: ${e} (cols: ${t}, rows: ${r})`)},y=e=>new Promise(t=>setTimeout(t,e)),x=async e=>{if(!await g(e))return;o.debug(`killSession start: ${e}`);let t=await P(e);if(t)try{o.debug(`SIGTERM → process group ${t}: ${e}`),process.kill(-t,"SIGTERM")}catch{}try{await u("tmux",["-L",p,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<5;t++){if(!await g(e))return void o.debug(`killSession done (SIGTERM): ${e}`);await y(200)}if(o.warn(`session survived SIGTERM, escalating to SIGKILL: ${e}`),t)try{o.debug(`SIGKILL → process group ${t}: ${e}`),process.kill(-t,"SIGKILL")}catch{}try{await u("tmux",["-L",p,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<3;t++){if(!await g(e))return void o.debug(`killSession done (SIGKILL): ${e}`);await y(200)}o.warn(`tmux session still alive after kill: ${e}`)},g=async e=>{try{return await u("tmux",["-L",p,"has-session","-t",e],{timeout:5e3}),!0}catch{return!1}},v=async()=>{},_=async()=>{await v();let e=await h();e.length>0&&e.forEach(e=>{o.debug(`existing tmux session found: ${e}`)})},S=async e=>{if(l)try{return await r.default.readlink(`/proc/${e}/cwd`)}catch{return null}try{let{stdout:t}=await u("lsof",["-a","-p",String(e),"-d","cwd","-Fn"],{timeout:5e3}),r=t.split("\n").find(e=>e.startsWith("n/"));return r?r.slice(1):null}catch{return null}},L=async e=>{let t=await P(e);if(t){let e=await S(t);if(e)return e}try{let{stdout:t}=await u("tmux",["-L",p,"display-message","-p","-t",e,"#{pane_current_path}"],{timeout:5e3});return t.trim()||null}catch{return null}},P=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"display-message","-p","-t",e,"#{pane_pid}"],{timeout:5e3}),r=parseInt(t.trim(),10);return Number.isNaN(r)?null:r}catch{return null}},b=async()=>{try{await u("tmux",["-L",p,"source-file",c],{timeout:5e3})}catch{}},E=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"list-panes","-t",e,"-F","#{pane_current_command}"],{timeout:5e3});return t.trim()||null}catch{return null}},$=async()=>{try{let{stdout:e}=await u("tmux",["-L",p,"list-panes","-a","-F","#{session_name} #{pane_current_command} #{pane_current_path} #{pane_pid} #{window_activity}"],{timeout:5e3}),t=new Map;for(let r of e.trim().split("\n")){if(!r)continue;let[e,a,s,n,i]=r.split(" ");if(e&&a){let r=parseInt(n,10),l=parseInt(i,10);t.set(e,{command:a,path:s||"",pid:Number.isNaN(r)?0:r,windowActivity:Number.isNaN(l)?0:l})}}return t}catch{return new Map}},q=new Set(["bash","zsh","fish","sh","dash"]),R=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"display-message","-p","-t",e,"#{pane_title}"],{timeout:5e3});return t.trim()||null}catch{return null}},I=async e=>{await u("tmux",["-L",p,"copy-mode","-q","-t",e],{timeout:5e3}).catch(()=>{})},N=async(e,t)=>{await I(e),await u("tmux",["-L",p,"send-keys","-t",e,t,"Enter"],{timeout:5e3})},T=async(e,t)=>{await I(e),await u("tmux",["-L",p,"send-keys","-t",e,t],{timeout:5e3})},k=async(e,t)=>{await I(e),await u("tmux",["-L",p,"send-keys","-t",e,"-l",`\x1b[200~${t}\x1b[201~`],{timeout:5e3}),await u("tmux",["-L",p,"send-keys","-t",e,"Enter"],{timeout:5e3}),await new Promise(e=>setTimeout(e,600)),await u("tmux",["-L",p,"send-keys","-t",e,"Enter"],{timeout:5e3})},M=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"display-message","-p","-t",e,"#{pane_current_path} #{pane_current_command} #{pane_pid} #{pane_width} #{pane_height} #{session_created}"],{timeout:5e3}),[r,a,s,n,i,l]=t.trim().split(" ");return{cwd:r||null,command:a||null,pid:s&&parseInt(s,10)||null,width:n&&parseInt(n,10)||null,height:i&&parseInt(i,10)||null,sessionCreated:l&&parseInt(l,10)||null}}catch{return{cwd:null,command:null,pid:null,width:null,height:null,sessionCreated:null}}},C=new Set(["node","python","python3","ruby","perl","deno","bun"]),A=async()=>{try{await u("tmux",["-L",p,"kill-server"],{timeout:5e3}),o.debug("tmux server killed")}catch{}},j=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"capture-pane","-p","-t",e],{timeout:5e3});return t}catch{return null}},D=async(e,t)=>{try{let{stdout:r}=await u("tmux",["-L",p,"capture-pane","-p","-S",`-${t}`,"-t",e],{timeout:5e3});return r}catch{return null}},G=async e=>{if(l){let t=[];return await Promise.all(e.map(async e=>{try{for(let a of(await r.default.readFile(`/proc/${e}/task/${e}/children`,"utf-8")).trim().split(/\s+/)){let e=parseInt(a,10);Number.isNaN(e)||t.push(e)}}catch{}})),t}try{let{stdout:t}=await u("pgrep",["-P",e.join(",")],{timeout:5e3});return t.trim().split("\n").map(e=>parseInt(e,10)).filter(e=>!Number.isNaN(e))}catch{return[]}},H=async e=>{let t=[],r=[e];for(;r.length>0;){let e=await G(r);if(0===e.length)break;t.push(...e),r=e}return t},O=async e=>{try{let t=new Set(e),{stdout:r}=await u("ss",["-tlnp"],{timeout:5e3}),a=new Set;for(let e of r.split("\n")){let r=e.match(/pid=(\d+)/g);if(!r||!r.some(e=>t.has(parseInt(e.replace("pid=",""),10))))continue;let s=e.match(/:(\d+)\s/);s&&a.add(parseInt(s[1],10))}return[...a].sort((e,t)=>e-t)}catch{return[]}},W=async e=>{let t=await H(e);if(0===t.length)return[];if(l)return O(t);try{let{stdout:e}=await u("lsof",["-a","-p",t.join(","),"-i","-sTCP:LISTEN","-P","-Fn"],{timeout:5e3}),r=new Set;for(let t of e.split("\n"))if(t.startsWith("n")){let e=t.match(/:(\d+)$/);e&&r.add(parseInt(e[1],10))}return[...r].sort((e,t)=>e-t)}catch{return[]}},U=async e=>{let t=await P(e);if(!t)return null;try{let{stdout:e}=await u("pgrep",["-n","-P",String(t)],{timeout:5e3}),r=e.trim();if(!r)return null;let{stdout:a}=await u("ps",["-o","args=","-p",r],{timeout:5e3}),n=a.trim();if(!n)return null;let i=n.split(/\s+/);if(0===i.length)return n;if(i[0]=s.default.basename(i[0]),C.has(i[0])&&i.length>1){let e=s.default.basename(i[1]).replace(/\.(c|m)?js$/,"");i.splice(0,2,e)}return i.join(" ")}catch{return null}};e.s(["SAFE_SHELLS",0,q,"applyConfig",0,b,"capturePaneContent",0,j,"capturePaneContentWithHistory",0,D,"createSession",0,w,"defaultSessionName",0,()=>`pt-${(0,n.nanoid)(6)}-${(0,n.nanoid)(6)}-${(0,n.nanoid)(6)}`,"exitCopyMode",0,I,"getAllPanesInfo",0,$,"getLastCommand",0,U,"getListeningPorts",0,W,"getPaneCurrentCommand",0,E,"getPaneDetailInfo",0,M,"getPaneTitle",0,R,"getSessionCwd",0,L,"getSessionPanePid",0,P,"hasSession",0,g,"killServer",0,A,"killSession",0,x,"listSessions",0,h,"sanitizedEnv",0,f,"scanSessions",0,_,"sendBracketedPaste",0,k,"sendKeys",0,N,"sendRawKeys",0,T,"workspaceSessionName",0,(e,t,r)=>`pt-${e}-${t}-${r}`],459015)},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},406461,(e,t,r)=>{t.exports=e.x("zlib",()=>require("zlib"))},254799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},524836,(e,t,r)=>{t.exports=e.x("https",()=>require("https"))},921517,(e,t,r)=>{t.exports=e.x("http",()=>require("http"))},504446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},755004,(e,t,r)=>{t.exports=e.x("tls",()=>require("tls"))},792509,(e,t,r)=>{t.exports=e.x("url",()=>require("url"))},500874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},175609,(e,t,r)=>{t.exports=e.x("node-pty-592e8dc6192cfd06",()=>require("node-pty-592e8dc6192cfd06"))},971780,e=>{"use strict";var t=e.i(459015);e.i(478319),e.i(220951),e.i(175609),new TextEncoder,new TextDecoder,(0,e.i(25146).createLogger)("terminal"),new TextDecoder;let r=globalThis,a=r.__purplemux_terminal_connections??=new Map;r.__purplemux_terminal_output_ts??=new Map;let s=(e,t,r)=>{for(let s of a.values())if(s.sessionName===e&&!s.cleaned)return void s.pty.resize(t,r)},n=e=>new Promise(t=>setTimeout(t,e)),i=async(e,r,i)=>{let l=(e=>{for(let t of a.values())if(t.sessionName===e&&!t.cleaned)return{cols:t.currentCols,rows:t.currentRows};return null})(e);if(l&&l.cols>50)return(0,t.capturePaneContentWithHistory)(e,50);let o=(e=>{for(let t of a.values())if(t.sessionName===e&&!t.cleaned){if(t.capturePaused)return null;return t.capturePaused=!0,{cols:t.currentCols,rows:t.currentRows}}return null})(e);if(!o)return(0,t.capturePaneContent)(e);try{s(e,r,i),await n(300);let a=await (0,t.capturePaneContent)(e);return s(e,o.cols,o.rows),await n(300),a}finally{(e=>{for(let t of a.values())if(t.sessionName===e&&!t.cleaned){if(!t.capturePaused)return;t.capturePaused=!1;return}})(e)}};e.s(["capturePaneAtWidth",0,i],971780)},8372,e=>{"use strict";var t=e.i(926747),r=e.i(190406),a=e.i(244898),s=e.i(262950),n=e.i(459015),i=e.i(971780);let l=(0,e.i(25146).createLogger)("tmux"),o=/^\s*(?:[❯›>]\s+)?(?:\d+\.\s+)?(.+)$/,u=["Yes,","Yes ","No,","No ","Tell Claude"],p=e=>/^\s+\S/.test(e)||/^\s*[❯›>]/.test(e),c=async(e,t)=>{if("GET"!==e.method)return t.setHeader("Allow","GET"),t.status(405).json({error:"Method not allowed"});let r=e.query.session;if(!r)return t.status(400).json({error:"session parameter required"});if(!await (0,n.hasSession)(r))return t.status(404).json({error:"Session not found"});try{let e=await (0,i.capturePaneAtWidth)(r,120,50);if(!e)return t.status(200).json({options:[]});let a=(e=>{let t=e.split("\n"),r=[],a=!1;for(let e of t){if(!e.trim()||!p(e)){if(a)break;continue}let t=e.match(o);if(!t)continue;let s=t[1].trim();if(a)if(u.some(e=>s.startsWith(e)))r.push(s);else break;else u.some(e=>s.startsWith(e))&&(r.push(s),a=!0)}return r})(e);return t.status(200).json({options:a})}catch(e){return l.error(`plan-options query failed: ${e instanceof Error?e.message:e}`),t.status(500).json({error:"Terminal capture failed"})}};e.s(["default",0,c],875757);var d=e.i(875757),m=e.i(7031),f=e.i(181927),h=e.i(846432);let w=(0,s.hoist)(d,"default"),y=(0,s.hoist)(d,"config"),x=new a.PagesAPIRouteModule({definition:{kind:r.RouteKind.PAGES_API,page:"/api/tmux/plan-options",pathname:"/api/tmux/plan-options",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function g(e,r,a){a.requestMeta&&(0,h.setRequestMeta)(e,a.requestMeta),x.isDev&&(0,h.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let s="/api/tmux/plan-options";s=s.replace(/\/index$/,"")||"/";let n=await x.prepare(e,r,{srcPage:s});if(!n){r.statusCode=400,r.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve());return}let{query:i,params:l,prerenderManifest:o,routerServerContext:u}=n;try{let t,a=e.method||"GET",n=(0,m.getTracer)(),p=n.getActiveScopeSpan(),c=!!(null==u?void 0:u.isWrappedByNextServer),d=x.instrumentationOnRequestError.bind(x),h=async p=>x.render(e,r,{query:{...i,...l},params:l,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:o.preview,propagateError:!1,dev:x.isDev,page:"/api/tmux/plan-options",internalRevalidate:null==u?void 0:u.revalidate,onError:(...t)=>d(e,...t)}).finally(()=>{if(!p)return;p.setAttributes({"http.status_code":r.statusCode,"next.rsc":!1});let e=n.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==f.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=e.get("next.route");if(i){let e=`${a} ${i}`;p.setAttributes({"next.route":i,"http.route":i,"next.span_name":e}),p.updateName(e),t&&t!==p&&(t.setAttribute("http.route",i),t.updateName(e))}else p.updateName(`${a} ${s}`)});c&&p?await h(p):(t=n.getActiveScopeSpan(),await n.withPropagatedContext(e.headers,()=>n.trace(f.BaseServerSpan.handleRequest,{spanName:`${a} ${s}`,kind:m.SpanKind.SERVER,attributes:{"http.method":a,"http.target":e.url}},h),void 0,!c))}catch(e){if(x.isDev)throw e;(0,t.sendError)(r,500,"Internal Server Error")}finally{null==a.waitUntil||a.waitUntil.call(a,Promise.resolve())}}e.s(["config",0,y,"default",0,w,"handler",0,g],8372)}];
1
+ module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},130146,(e,t,r)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},666680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},233405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},25146,e=>{"use strict";var t=e.i(130146),r=e.i(814747),a=e.i(446786);let s=r.default.join(a.default.homedir(),".purplemux","logs"),n=process.env.LOG_LEVEL||"info",i=(e=>{if(!e)return{};let t={};for(let r of e.split(",")){let[e,a]=r.split("=").map(e=>e.trim());e&&a&&(t[e]=a)}return t})(process.env.LOG_LEVELS),l=["trace","debug","info","warn","error","fatal"],o=globalThis;if(!o.__ptRootLogger){let e=[n,...Object.values(i)].reduce((e,t)=>l.indexOf(t)<l.indexOf(e)?t:e,"fatal");o.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:r.default.join(s,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let u=o.__ptRootLogger;e.s(["createLogger",0,e=>{let t=u.child({module:e});return t.level=i[e]??n,t}])},44014,e=>{"use strict";let t,r;var a=e.i(666680);e.s(["nanoid",0,function(e=21){var s;s=e|=0,!t||t.length<s?(t=Buffer.allocUnsafe(128*s),a.webcrypto.getRandomValues(t),r=0):r+s>t.length&&(a.webcrypto.getRandomValues(t),r=0),r+=s;let n="";for(let a=r-e;a<r;a++)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[a]];return n}],44014)},459015,544538,e=>{"use strict";var t=e.i(233405),r=e.i(924868),a=e.i(224361),s=e.i(814747),n=e.i(44014),i=e.i(25146);process.platform;let l="linux"===process.platform;e.s(["isLinux",0,l],544538);let o=(0,i.createLogger)("terminal"),u=(0,a.promisify)(t.execFile),p="purple",c=s.default.join(process.env.__PMUX_APP_DIR_UNPACKED||process.env.__PMUX_APP_DIR||process.cwd(),"src","config","tmux.conf"),d={...process.env},m=new Set(["AUTH_PASSWORD","NEXTAUTH_SECRET","PORT"]),f=()=>Object.fromEntries(Object.entries(d).filter(([e])=>!e.startsWith("npm_")&&!e.startsWith("NODE_")&&!m.has(e))),h=async()=>{try{let{stdout:e}=await u("tmux",["-L",p,"ls","-F","#{session_name}"],{timeout:5e3});return e.trim().split("\n").map(e=>e.trim()).filter(e=>e.startsWith("pt-"))}catch{return[]}},w=async(e,t,r,a)=>{let s=process.env.SHELL||"/bin/zsh";await u("tmux",["-u","-L",p,"-f",c,"new-session","-d","-s",e,"-x",String(t),"-y",String(r)],{timeout:5e3,env:{...f(),SHELL:s,TERM:"xterm-256color",COLORTERM:"truecolor"},cwd:a||process.env.HOME||"/"}),await b(),o.debug(`tmux session created: ${e} (cols: ${t}, rows: ${r})`)},y=e=>new Promise(t=>setTimeout(t,e)),x=async e=>{if(!await g(e))return;o.debug(`killSession start: ${e}`);let t=await P(e);if(t)try{o.debug(`SIGTERM → process group ${t}: ${e}`),process.kill(-t,"SIGTERM")}catch{}try{await u("tmux",["-L",p,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<5;t++){if(!await g(e))return void o.debug(`killSession done (SIGTERM): ${e}`);await y(200)}if(o.warn(`session survived SIGTERM, escalating to SIGKILL: ${e}`),t)try{o.debug(`SIGKILL → process group ${t}: ${e}`),process.kill(-t,"SIGKILL")}catch{}try{await u("tmux",["-L",p,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<3;t++){if(!await g(e))return void o.debug(`killSession done (SIGKILL): ${e}`);await y(200)}o.warn(`tmux session still alive after kill: ${e}`)},g=async e=>{try{return await u("tmux",["-L",p,"has-session","-t",e],{timeout:5e3}),!0}catch{return!1}},v=async()=>{},_=async()=>{await v();let e=await h();e.length>0&&e.forEach(e=>{o.debug(`existing tmux session found: ${e}`)})},S=async e=>{if(l)try{return await r.default.readlink(`/proc/${e}/cwd`)}catch{return null}try{let{stdout:t}=await u("lsof",["-a","-p",String(e),"-d","cwd","-Fn"],{timeout:5e3}),r=t.split("\n").find(e=>e.startsWith("n/"));return r?r.slice(1):null}catch{return null}},L=async e=>{let t=await P(e);if(t){let e=await S(t);if(e)return e}try{let{stdout:t}=await u("tmux",["-L",p,"display-message","-p","-t",e,"#{pane_current_path}"],{timeout:5e3});return t.trim()||null}catch{return null}},P=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"display-message","-p","-t",e,"#{pane_pid}"],{timeout:5e3}),r=parseInt(t.trim(),10);return Number.isNaN(r)?null:r}catch{return null}},b=async()=>{try{await u("tmux",["-L",p,"source-file",c],{timeout:5e3})}catch{}},E=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"list-panes","-t",e,"-F","#{pane_current_command}"],{timeout:5e3});return t.trim()||null}catch{return null}},$=async()=>{try{let{stdout:e}=await u("tmux",["-L",p,"list-panes","-a","-F","#{session_name} #{pane_current_command} #{pane_current_path} #{pane_pid} #{window_activity}"],{timeout:5e3}),t=new Map;for(let r of e.trim().split("\n")){if(!r)continue;let[e,a,s,n,i]=r.split(" ");if(e&&a){let r=parseInt(n,10),l=parseInt(i,10);t.set(e,{command:a,path:s||"",pid:Number.isNaN(r)?0:r,windowActivity:Number.isNaN(l)?0:l})}}return t}catch{return new Map}},q=new Set(["bash","zsh","fish","sh","dash"]),R=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"display-message","-p","-t",e,"#{pane_title}"],{timeout:5e3});return t.trim()||null}catch{return null}},I=async e=>{await u("tmux",["-L",p,"copy-mode","-q","-t",e],{timeout:5e3}).catch(()=>{})},N=async(e,t)=>{await I(e),await u("tmux",["-L",p,"send-keys","-t",e,t,"Enter"],{timeout:5e3})},T=async(e,t)=>{await I(e),await u("tmux",["-L",p,"send-keys","-t",e,t],{timeout:5e3})},k=async(e,t)=>{await I(e),await u("tmux",["-L",p,"send-keys","-t",e,"-l",`\x1b[200~${t}\x1b[201~`],{timeout:5e3}),await u("tmux",["-L",p,"send-keys","-t",e,"Enter"],{timeout:5e3}),await new Promise(e=>setTimeout(e,600)),await u("tmux",["-L",p,"send-keys","-t",e,"Enter"],{timeout:5e3})},M=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"display-message","-p","-t",e,"#{pane_current_path} #{pane_current_command} #{pane_pid} #{pane_width} #{pane_height} #{session_created}"],{timeout:5e3}),[r,a,s,n,i,l]=t.trim().split(" ");return{cwd:r||null,command:a||null,pid:s&&parseInt(s,10)||null,width:n&&parseInt(n,10)||null,height:i&&parseInt(i,10)||null,sessionCreated:l&&parseInt(l,10)||null}}catch{return{cwd:null,command:null,pid:null,width:null,height:null,sessionCreated:null}}},C=new Set(["node","python","python3","ruby","perl","deno","bun"]),A=async()=>{try{await u("tmux",["-L",p,"kill-server"],{timeout:5e3}),o.debug("tmux server killed")}catch{}},j=async e=>{try{let{stdout:t}=await u("tmux",["-L",p,"capture-pane","-p","-t",e],{timeout:5e3});return t}catch{return null}},D=async(e,t)=>{try{let{stdout:r}=await u("tmux",["-L",p,"capture-pane","-p","-S",`-${t}`,"-t",e],{timeout:5e3});return r}catch{return null}},G=async e=>{if(l){let t=[];return await Promise.all(e.map(async e=>{try{for(let a of(await r.default.readFile(`/proc/${e}/task/${e}/children`,"utf-8")).trim().split(/\s+/)){let e=parseInt(a,10);Number.isNaN(e)||t.push(e)}}catch{}})),t}try{let{stdout:t}=await u("pgrep",["-P",e.join(",")],{timeout:5e3});return t.trim().split("\n").map(e=>parseInt(e,10)).filter(e=>!Number.isNaN(e))}catch{return[]}},H=async e=>{let t=[],r=[e];for(;r.length>0;){let e=await G(r);if(0===e.length)break;t.push(...e),r=e}return t},O=async e=>{try{let t=new Set(e),{stdout:r}=await u("ss",["-tlnp"],{timeout:5e3}),a=new Set;for(let e of r.split("\n")){let r=e.match(/pid=(\d+)/g);if(!r||!r.some(e=>t.has(parseInt(e.replace("pid=",""),10))))continue;let s=e.match(/:(\d+)\s/);s&&a.add(parseInt(s[1],10))}return[...a].sort((e,t)=>e-t)}catch{return[]}},W=async e=>{let t=await H(e);if(0===t.length)return[];if(l)return O(t);try{let{stdout:e}=await u("lsof",["-a","-p",t.join(","),"-i","-sTCP:LISTEN","-P","-Fn"],{timeout:5e3}),r=new Set;for(let t of e.split("\n"))if(t.startsWith("n")){let e=t.match(/:(\d+)$/);e&&r.add(parseInt(e[1],10))}return[...r].sort((e,t)=>e-t)}catch{return[]}},U=async e=>{let t=await P(e);if(!t)return null;try{let{stdout:e}=await u("pgrep",["-n","-P",String(t)],{timeout:5e3}),r=e.trim();if(!r)return null;let{stdout:a}=await u("ps",["-o","args=","-p",r],{timeout:5e3}),n=a.trim();if(!n)return null;let i=n.split(/\s+/);if(0===i.length)return n;if(i[0]=s.default.basename(i[0]),C.has(i[0])&&i.length>1){let e=s.default.basename(i[1]).replace(/\.(c|m)?js$/,"");i.splice(0,2,e)}return i.join(" ")}catch{return null}};e.s(["SAFE_SHELLS",0,q,"applyConfig",0,b,"capturePaneContent",0,j,"capturePaneContentWithHistory",0,D,"createSession",0,w,"defaultSessionName",0,()=>`pt-${(0,n.nanoid)(6)}-${(0,n.nanoid)(6)}-${(0,n.nanoid)(6)}`,"exitCopyMode",0,I,"getAllPanesInfo",0,$,"getLastCommand",0,U,"getListeningPorts",0,W,"getPaneCurrentCommand",0,E,"getPaneDetailInfo",0,M,"getPaneTitle",0,R,"getSessionCwd",0,L,"getSessionPanePid",0,P,"hasSession",0,g,"killServer",0,A,"killSession",0,x,"listSessions",0,h,"sanitizedEnv",0,f,"scanSessions",0,_,"sendBracketedPaste",0,k,"sendKeys",0,N,"sendRawKeys",0,T,"workspaceSessionName",0,(e,t,r)=>`pt-${e}-${t}-${r}`],459015)},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},406461,(e,t,r)=>{t.exports=e.x("zlib",()=>require("zlib"))},254799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},524836,(e,t,r)=>{t.exports=e.x("https",()=>require("https"))},921517,(e,t,r)=>{t.exports=e.x("http",()=>require("http"))},504446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},755004,(e,t,r)=>{t.exports=e.x("tls",()=>require("tls"))},792509,(e,t,r)=>{t.exports=e.x("url",()=>require("url"))},500874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},175609,(e,t,r)=>{t.exports=e.x("node-pty-592e8dc6192cfd06",()=>require("node-pty-592e8dc6192cfd06"))},971780,e=>{"use strict";var t=e.i(459015);e.i(478319),e.i(220951),e.i(175609),new TextEncoder,new TextDecoder,(0,e.i(25146).createLogger)("terminal"),new TextDecoder;let r=globalThis,a=r.__purplemux_terminal_connections??=new Map;r.__purplemux_terminal_output_ts??=new Map;let s=(e,t,r)=>{for(let s of a.values())if(s.sessionName===e&&!s.cleaned)return void s.pty.resize(t,r)},n=e=>new Promise(t=>setTimeout(t,e)),i=async(e,r,i)=>{let l=(e=>{for(let t of a.values())if(t.sessionName===e&&!t.cleaned)return{cols:t.currentCols,rows:t.currentRows};return null})(e);if(l&&l.cols>50)return(0,t.capturePaneContentWithHistory)(e,50);let o=(e=>{for(let t of a.values())if(t.sessionName===e&&!t.cleaned){if(t.capturePaused)return null;return t.capturePaused=!0,{cols:t.currentCols,rows:t.currentRows}}return null})(e);if(!o)return(0,t.capturePaneContent)(e);try{s(e,r,i),await n(300);let a=await (0,t.capturePaneContent)(e);return s(e,o.cols,o.rows),await n(300),a}finally{(e=>{for(let t of a.values())if(t.sessionName===e&&!t.cleaned){if(!t.capturePaused)return;t.capturePaused=!1;return}})(e)}};e.s(["capturePaneAtWidth",0,i],971780)},8372,e=>{"use strict";var t=e.i(926747),r=e.i(190406),a=e.i(244898),s=e.i(262950),n=e.i(459015),i=e.i(971780);let l=(0,e.i(25146).createLogger)("tmux"),o=/^\s*(?:[❯›>]\s+)?(?:\d+\.\s+)?(.+)$/,u=["Yes,","Yes ","No,","No ","Tell Claude"],p=e=>/^\s+\S/.test(e)||/^\s*[❯›>]/.test(e),c=async(e,t)=>{if("GET"!==e.method)return t.setHeader("Allow","GET"),t.status(405).json({error:"Method not allowed"});let r=e.query.session;if(!r)return t.status(400).json({error:"session parameter required"});if(!await (0,n.hasSession)(r))return t.status(404).json({error:"Session not found"});try{let e=await (0,i.capturePaneAtWidth)(r,120,50);if(!e)return t.status(200).json({options:[]});let a=(e=>{let t=e.split("\n"),r=[],a=!1;for(let e of t){if(!e.trim()||!p(e)){if(a)break;continue}let t=e.match(o);if(!t)continue;let s=t[1].trim();if(a)if(u.some(e=>s.startsWith(e)))r.push(s);else break;else u.some(e=>s.startsWith(e))&&(r.push(s),a=!0)}return r})(e);return t.status(200).json({options:a})}catch(e){return l.error(`plan-options query failed: ${e instanceof Error?e.message:e}`),t.status(500).json({error:"Terminal capture failed"})}};e.s(["default",0,c],875757);var d=e.i(875757),m=e.i(7031),f=e.i(181927),h=e.i(846432);let w=(0,s.hoist)(d,"default"),y=(0,s.hoist)(d,"config"),x=new a.PagesAPIRouteModule({definition:{kind:r.RouteKind.PAGES_API,page:"/api/tmux/plan-options",pathname:"/api/tmux/plan-options",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function g(e,r,a){a.requestMeta&&(0,h.setRequestMeta)(e,a.requestMeta),x.isDev&&(0,h.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let s="/api/tmux/plan-options";s=s.replace(/\/index$/,"")||"/";let n=await x.prepare(e,r,{srcPage:s});if(!n){r.statusCode=400,r.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve());return}let{query:i,params:l,prerenderManifest:o,routerServerContext:u}=n;try{let t,a=e.method||"GET",n=(0,m.getTracer)(),p=n.getActiveScopeSpan(),c=!!(null==u?void 0:u.isWrappedByNextServer),d=x.instrumentationOnRequestError.bind(x),h=async p=>x.render(e,r,{query:{...i,...l},params:l,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:o.preview,propagateError:!1,dev:x.isDev,page:"/api/tmux/plan-options",internalRevalidate:null==u?void 0:u.revalidate,onError:(...t)=>d(e,...t)}).finally(()=>{if(!p)return;p.setAttributes({"http.status_code":r.statusCode,"next.rsc":!1});let e=n.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==f.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=e.get("next.route");if(i){let e=`${a} ${i}`;p.setAttributes({"next.route":i,"http.route":i,"next.span_name":e}),p.updateName(e),t&&t!==p&&(t.setAttribute("http.route",i),t.updateName(e))}else p.updateName(`${a} ${s}`)});c&&p?await h(p):(t=n.getActiveScopeSpan(),await n.withPropagatedContext(e.headers,()=>n.trace(f.BaseServerSpan.handleRequest,{spanName:`${a} ${s}`,kind:m.SpanKind.SERVER,attributes:{"http.method":a,"http.target":e.url}},h),void 0,!c))}catch(e){if(x.isDev)throw e;(0,t.sendError)(r,500,"Internal Server Error")}finally{null==a.waitUntil||a.waitUntil.call(a,Promise.resolve())}}e.s(["config",0,y,"default",0,w,"handler",0,g],8372)}];
2
2
 
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0fi~pyu._.js.map
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0-ptdqu._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},130146,(e,t,r)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},25146,e=>{"use strict";var t=e.i(130146),r=e.i(814747),i=e.i(446786);let a=r.default.join(i.default.homedir(),".purplemux","logs"),s=process.env.LOG_LEVEL||"info",o=(e=>{if(!e)return{};let t={};for(let r of e.split(",")){let[e,i]=r.split("=").map(e=>e.trim());e&&i&&(t[e]=i)}return t})(process.env.LOG_LEVELS),l=["trace","debug","info","warn","error","fatal"],n=globalThis;if(!n.__ptRootLogger){let e=[s,...Object.values(o)].reduce((e,t)=>l.indexOf(t)<l.indexOf(e)?t:e,"fatal");n.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:r.default.join(a,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let p=n.__ptRootLogger;e.s(["createLogger",0,e=>{let t=p.child({module:e});return t.level=o[e]??s,t}])},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},254799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},500874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},792509,(e,t,r)=>{t.exports=e.x("url",()=>require("url"))},504446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},755004,(e,t,r)=>{t.exports=e.x("tls",()=>require("tls"))},921517,(e,t,r)=>{t.exports=e.x("http",()=>require("http"))},524836,(e,t,r)=>{t.exports=e.x("https",()=>require("https"))},206892,e=>{"use strict";var t=e.i(926747),r=e.i(190406),i=e.i(244898),a=e.i(262950),s=e.i(228448);let o=async(e,t)=>{if("GET"!==e.method)return t.setHeader("Allow","GET"),t.status(405).json({error:"Method not allowed"});let r=await (0,s.getVAPIDKeys)();return t.status(200).json({publicKey:r.publicKey})};e.s(["default",0,o],24648);var l=e.i(24648),n=e.i(7031),p=e.i(181927),u=e.i(846432);let d=(0,a.hoist)(l,"default"),x=(0,a.hoist)(l,"config"),c=new i.PagesAPIRouteModule({definition:{kind:r.RouteKind.PAGES_API,page:"/api/push/vapid-key",pathname:"/api/push/vapid-key",bundlePath:"",filename:""},userland:l,distDir:".next",relativeProjectDir:""});async function m(e,r,i){i.requestMeta&&(0,u.setRequestMeta)(e,i.requestMeta),c.isDev&&(0,u.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/push/vapid-key";a=a.replace(/\/index$/,"")||"/";let s=await c.prepare(e,r,{srcPage:a});if(!s){r.statusCode=400,r.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve());return}let{query:o,params:l,prerenderManifest:d,routerServerContext:x}=s;try{let t,i=e.method||"GET",s=(0,n.getTracer)(),u=s.getActiveScopeSpan(),m=!!(null==x?void 0:x.isWrappedByNextServer),f=c.instrumentationOnRequestError.bind(c),h=async n=>c.render(e,r,{query:{...o,...l},params:l,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:d.preview,propagateError:!1,dev:c.isDev,page:"/api/push/vapid-key",internalRevalidate:null==x?void 0:x.revalidate,onError:(...t)=>f(e,...t)}).finally(()=>{if(!n)return;n.setAttributes({"http.status_code":r.statusCode,"next.rsc":!1});let e=s.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=e.get("next.route");if(o){let e=`${i} ${o}`;n.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),n.updateName(e),t&&t!==n&&(t.setAttribute("http.route",o),t.updateName(e))}else n.updateName(`${i} ${a}`)});m&&u?await h(u):(t=s.getActiveScopeSpan(),await s.withPropagatedContext(e.headers,()=>s.trace(p.BaseServerSpan.handleRequest,{spanName:`${i} ${a}`,kind:n.SpanKind.SERVER,attributes:{"http.method":i,"http.target":e.url}},h),void 0,!m))}catch(e){if(c.isDev)throw e;(0,t.sendError)(r,500,"Internal Server Error")}finally{null==i.waitUntil||i.waitUntil.call(i,Promise.resolve())}}e.s(["config",0,x,"default",0,d,"handler",0,m],206892)}];
1
+ module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},130146,(e,t,r)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},25146,e=>{"use strict";var t=e.i(130146),r=e.i(814747),i=e.i(446786);let a=r.default.join(i.default.homedir(),".purplemux","logs"),s=process.env.LOG_LEVEL||"info",o=(e=>{if(!e)return{};let t={};for(let r of e.split(",")){let[e,i]=r.split("=").map(e=>e.trim());e&&i&&(t[e]=i)}return t})(process.env.LOG_LEVELS),l=["trace","debug","info","warn","error","fatal"],n=globalThis;if(!n.__ptRootLogger){let e=[s,...Object.values(o)].reduce((e,t)=>l.indexOf(t)<l.indexOf(e)?t:e,"fatal");n.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:r.default.join(a,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let p=n.__ptRootLogger;e.s(["createLogger",0,e=>{let t=p.child({module:e});return t.level=o[e]??s,t}])},254799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},500874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},792509,(e,t,r)=>{t.exports=e.x("url",()=>require("url"))},504446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},755004,(e,t,r)=>{t.exports=e.x("tls",()=>require("tls"))},921517,(e,t,r)=>{t.exports=e.x("http",()=>require("http"))},524836,(e,t,r)=>{t.exports=e.x("https",()=>require("https"))},206892,e=>{"use strict";var t=e.i(926747),r=e.i(190406),i=e.i(244898),a=e.i(262950),s=e.i(228448);let o=async(e,t)=>{if("GET"!==e.method)return t.setHeader("Allow","GET"),t.status(405).json({error:"Method not allowed"});let r=await (0,s.getVAPIDKeys)();return t.status(200).json({publicKey:r.publicKey})};e.s(["default",0,o],24648);var l=e.i(24648),n=e.i(7031),p=e.i(181927),u=e.i(846432);let d=(0,a.hoist)(l,"default"),x=(0,a.hoist)(l,"config"),c=new i.PagesAPIRouteModule({definition:{kind:r.RouteKind.PAGES_API,page:"/api/push/vapid-key",pathname:"/api/push/vapid-key",bundlePath:"",filename:""},userland:l,distDir:".next",relativeProjectDir:""});async function m(e,r,i){i.requestMeta&&(0,u.setRequestMeta)(e,i.requestMeta),c.isDev&&(0,u.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/push/vapid-key";a=a.replace(/\/index$/,"")||"/";let s=await c.prepare(e,r,{srcPage:a});if(!s){r.statusCode=400,r.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve());return}let{query:o,params:l,prerenderManifest:d,routerServerContext:x}=s;try{let t,i=e.method||"GET",s=(0,n.getTracer)(),u=s.getActiveScopeSpan(),m=!!(null==x?void 0:x.isWrappedByNextServer),f=c.instrumentationOnRequestError.bind(c),h=async n=>c.render(e,r,{query:{...o,...l},params:l,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:d.preview,propagateError:!1,dev:c.isDev,page:"/api/push/vapid-key",internalRevalidate:null==x?void 0:x.revalidate,onError:(...t)=>f(e,...t)}).finally(()=>{if(!n)return;n.setAttributes({"http.status_code":r.statusCode,"next.rsc":!1});let e=s.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=e.get("next.route");if(o){let e=`${i} ${o}`;n.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),n.updateName(e),t&&t!==n&&(t.setAttribute("http.route",o),t.updateName(e))}else n.updateName(`${i} ${a}`)});m&&u?await h(u):(t=s.getActiveScopeSpan(),await s.withPropagatedContext(e.headers,()=>s.trace(p.BaseServerSpan.handleRequest,{spanName:`${i} ${a}`,kind:n.SpanKind.SERVER,attributes:{"http.method":i,"http.target":e.url}},h),void 0,!m))}catch(e){if(c.isDev)throw e;(0,t.sendError)(r,500,"Internal Server Error")}finally{null==i.waitUntil||i.waitUntil.call(i,Promise.resolve())}}e.s(["config",0,x,"default",0,d,"handler",0,m],206892)}];
2
2
 
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0der504._.js.map
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0.784vy._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[270406,(e,t,n)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,n)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,n)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,n)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},666680,(e,t,n)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},130146,(e,t,n)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},224361,(e,t,n)=>{t.exports=e.x("util",()=>require("util"))},233405,(e,t,n)=>{t.exports=e.x("child_process",()=>require("child_process"))},25146,e=>{"use strict";var t=e.i(130146),n=e.i(814747),a=e.i(446786);let r=n.default.join(a.default.homedir(),".purplemux","logs"),s=process.env.LOG_LEVEL||"info",i=(e=>{if(!e)return{};let t={};for(let n of e.split(",")){let[e,a]=n.split("=").map(e=>e.trim());e&&a&&(t[e]=a)}return t})(process.env.LOG_LEVELS),o=["trace","debug","info","warn","error","fatal"],u=globalThis;if(!u.__ptRootLogger){let e=[s,...Object.values(i)].reduce((e,t)=>o.indexOf(t)<o.indexOf(e)?t:e,"fatal");u.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:n.default.join(r,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let l=u.__ptRootLogger;e.s(["createLogger",0,e=>{let t=l.child({module:e});return t.level=i[e]??s,t}])},44014,e=>{"use strict";let t,n;var a=e.i(666680);e.s(["nanoid",0,function(e=21){var r;r=e|=0,!t||t.length<r?(t=Buffer.allocUnsafe(128*r),a.webcrypto.getRandomValues(t),n=0):n+r>t.length&&(a.webcrypto.getRandomValues(t),n=0),n+=r;let s="";for(let a=n-e;a<n;a++)s+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[a]];return s}],44014)},459015,544538,e=>{"use strict";var t=e.i(233405),n=e.i(924868),a=e.i(224361),r=e.i(814747),s=e.i(44014),i=e.i(25146);process.platform;let o="linux"===process.platform;e.s(["isLinux",0,o],544538);let u=(0,i.createLogger)("terminal"),l=(0,a.promisify)(t.execFile),c="purple",d=r.default.join(process.env.__PMUX_APP_DIR_UNPACKED||process.env.__PMUX_APP_DIR||process.cwd(),"src","config","tmux.conf"),f={...process.env},m=new Set(["AUTH_PASSWORD","NEXTAUTH_SECRET","PORT"]),h=()=>Object.fromEntries(Object.entries(f).filter(([e])=>!e.startsWith("npm_")&&!e.startsWith("NODE_")&&!m.has(e))),p=async()=>{try{let{stdout:e}=await l("tmux",["-L",c,"ls","-F","#{session_name}"],{timeout:5e3});return e.trim().split("\n").map(e=>e.trim()).filter(e=>e.startsWith("pt-"))}catch{return[]}},y=async(e,t,n,a)=>{let r=process.env.SHELL||"/bin/zsh";await l("tmux",["-u","-L",c,"-f",d,"new-session","-d","-s",e,"-x",String(t),"-y",String(n)],{timeout:5e3,env:{...h(),SHELL:r,TERM:"xterm-256color",COLORTERM:"truecolor"},cwd:a||process.env.HOME||"/"}),await b(),u.debug(`tmux session created: ${e} (cols: ${t}, rows: ${n})`)},g=e=>new Promise(t=>setTimeout(t,e)),w=async e=>{if(!await S(e))return;u.debug(`killSession start: ${e}`);let t=await C(e);if(t)try{u.debug(`SIGTERM → process group ${t}: ${e}`),process.kill(-t,"SIGTERM")}catch{}try{await l("tmux",["-L",c,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<5;t++){if(!await S(e))return void u.debug(`killSession done (SIGTERM): ${e}`);await g(200)}if(u.warn(`session survived SIGTERM, escalating to SIGKILL: ${e}`),t)try{u.debug(`SIGKILL → process group ${t}: ${e}`),process.kill(-t,"SIGKILL")}catch{}try{await l("tmux",["-L",c,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<3;t++){if(!await S(e))return void u.debug(`killSession done (SIGKILL): ${e}`);await g(200)}u.warn(`tmux session still alive after kill: ${e}`)},S=async e=>{try{return await l("tmux",["-L",c,"has-session","-t",e],{timeout:5e3}),!0}catch{return!1}},$=async()=>{},v=async()=>{await $();let e=await p();e.length>0&&e.forEach(e=>{u.debug(`existing tmux session found: ${e}`)})},x=async e=>{if(o)try{return await n.default.readlink(`/proc/${e}/cwd`)}catch{return null}try{let{stdout:t}=await l("lsof",["-a","-p",String(e),"-d","cwd","-Fn"],{timeout:5e3}),n=t.split("\n").find(e=>e.startsWith("n/"));return n?n.slice(1):null}catch{return null}},D=async e=>{let t=await C(e);if(t){let e=await x(t);if(e)return e}try{let{stdout:t}=await l("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_current_path}"],{timeout:5e3});return t.trim()||null}catch{return null}},C=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_pid}"],{timeout:5e3}),n=parseInt(t.trim(),10);return Number.isNaN(n)?null:n}catch{return null}},b=async()=>{try{await l("tmux",["-L",c,"source-file",d],{timeout:5e3})}catch{}},M=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"list-panes","-t",e,"-F","#{pane_current_command}"],{timeout:5e3});return t.trim()||null}catch{return null}},k=async()=>{try{let{stdout:e}=await l("tmux",["-L",c,"list-panes","-a","-F","#{session_name} #{pane_current_command} #{pane_current_path} #{pane_pid} #{window_activity}"],{timeout:5e3}),t=new Map;for(let n of e.trim().split("\n")){if(!n)continue;let[e,a,r,s,i]=n.split(" ");if(e&&a){let n=parseInt(s,10),o=parseInt(i,10);t.set(e,{command:a,path:r||"",pid:Number.isNaN(n)?0:n,windowActivity:Number.isNaN(o)?0:o})}}return t}catch{return new Map}},_=new Set(["bash","zsh","fish","sh","dash"]),T=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_title}"],{timeout:5e3});return t.trim()||null}catch{return null}},L=async e=>{await l("tmux",["-L",c,"copy-mode","-q","-t",e],{timeout:5e3}).catch(()=>{})},O=async(e,t)=>{await L(e),await l("tmux",["-L",c,"send-keys","-t",e,t,"Enter"],{timeout:5e3})},I=async(e,t)=>{await L(e),await l("tmux",["-L",c,"send-keys","-t",e,t],{timeout:5e3})},A=async(e,t)=>{await L(e),await l("tmux",["-L",c,"send-keys","-t",e,"-l",`\x1b[200~${t}\x1b[201~`],{timeout:5e3}),await l("tmux",["-L",c,"send-keys","-t",e,"Enter"],{timeout:5e3}),await new Promise(e=>setTimeout(e,600)),await l("tmux",["-L",c,"send-keys","-t",e,"Enter"],{timeout:5e3})},E=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_current_path} #{pane_current_command} #{pane_pid} #{pane_width} #{pane_height} #{session_created}"],{timeout:5e3}),[n,a,r,s,i,o]=t.trim().split(" ");return{cwd:n||null,command:a||null,pid:r&&parseInt(r,10)||null,width:s&&parseInt(s,10)||null,height:i&&parseInt(i,10)||null,sessionCreated:o&&parseInt(o,10)||null}}catch{return{cwd:null,command:null,pid:null,width:null,height:null,sessionCreated:null}}},j=new Set(["node","python","python3","ruby","perl","deno","bun"]),R=async()=>{try{await l("tmux",["-L",c,"kill-server"],{timeout:5e3}),u.debug("tmux server killed")}catch{}},N=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"capture-pane","-p","-t",e],{timeout:5e3});return t}catch{return null}},P=async(e,t)=>{try{let{stdout:n}=await l("tmux",["-L",c,"capture-pane","-p","-S",`-${t}`,"-t",e],{timeout:5e3});return n}catch{return null}},F=async e=>{if(o){let t=[];return await Promise.all(e.map(async e=>{try{for(let a of(await n.default.readFile(`/proc/${e}/task/${e}/children`,"utf-8")).trim().split(/\s+/)){let e=parseInt(a,10);Number.isNaN(e)||t.push(e)}}catch{}})),t}try{let{stdout:t}=await l("pgrep",["-P",e.join(",")],{timeout:5e3});return t.trim().split("\n").map(e=>parseInt(e,10)).filter(e=>!Number.isNaN(e))}catch{return[]}},H=async e=>{let t=[],n=[e];for(;n.length>0;){let e=await F(n);if(0===e.length)break;t.push(...e),n=e}return t},Y=async e=>{try{let t=new Set(e),{stdout:n}=await l("ss",["-tlnp"],{timeout:5e3}),a=new Set;for(let e of n.split("\n")){let n=e.match(/pid=(\d+)/g);if(!n||!n.some(e=>t.has(parseInt(e.replace("pid=",""),10))))continue;let r=e.match(/:(\d+)\s/);r&&a.add(parseInt(r[1],10))}return[...a].sort((e,t)=>e-t)}catch{return[]}},W=async e=>{let t=await H(e);if(0===t.length)return[];if(o)return Y(t);try{let{stdout:e}=await l("lsof",["-a","-p",t.join(","),"-i","-sTCP:LISTEN","-P","-Fn"],{timeout:5e3}),n=new Set;for(let t of e.split("\n"))if(t.startsWith("n")){let e=t.match(/:(\d+)$/);e&&n.add(parseInt(e[1],10))}return[...n].sort((e,t)=>e-t)}catch{return[]}},U=async e=>{let t=await C(e);if(!t)return null;try{let{stdout:e}=await l("pgrep",["-n","-P",String(t)],{timeout:5e3}),n=e.trim();if(!n)return null;let{stdout:a}=await l("ps",["-o","args=","-p",n],{timeout:5e3}),s=a.trim();if(!s)return null;let i=s.split(/\s+/);if(0===i.length)return s;if(i[0]=r.default.basename(i[0]),j.has(i[0])&&i.length>1){let e=r.default.basename(i[1]).replace(/\.(c|m)?js$/,"");i.splice(0,2,e)}return i.join(" ")}catch{return null}};e.s(["SAFE_SHELLS",0,_,"applyConfig",0,b,"capturePaneContent",0,N,"capturePaneContentWithHistory",0,P,"createSession",0,y,"defaultSessionName",0,()=>`pt-${(0,s.nanoid)(6)}-${(0,s.nanoid)(6)}-${(0,s.nanoid)(6)}`,"exitCopyMode",0,L,"getAllPanesInfo",0,k,"getLastCommand",0,U,"getListeningPorts",0,W,"getPaneCurrentCommand",0,M,"getPaneDetailInfo",0,E,"getPaneTitle",0,T,"getSessionCwd",0,D,"getSessionPanePid",0,C,"hasSession",0,S,"killServer",0,R,"killSession",0,w,"listSessions",0,p,"sanitizedEnv",0,h,"scanSessions",0,v,"sendBracketedPaste",0,A,"sendKeys",0,O,"sendRawKeys",0,I,"workspaceSessionName",0,(e,t,n)=>`pt-${e}-${t}-${n}`],459015)},713915,e=>{"use strict";var t=e.i(233405),n=e.i(924868),a=e.i(446786),r=e.i(814747),s=e.i(224361),i=e.i(459015);let o=(0,s.promisify)(t.execFile),u=null,l=null,c=async()=>{let e=a.default.userInfo().shell||process.env.SHELL||"/bin/bash";try{let{stdout:t}=await o(e,["-ilc",'echo -n "$PATH"'],{timeout:5e3,env:{...(0,i.sanitizedEnv)(),SHELL:e,DISABLE_AUTO_UPDATE:"true",ZSH_TMUX_AUTOSTARTED:"true",TERM:"xterm-256color",COLORTERM:"truecolor"}});return t.toString().trim()}catch{return process.env.PATH||""}},d=async()=>u||(l||(l=c().then(e=>(u=e,l=null,e))),l),f=async(e,t,n)=>{try{let a=await d(),{stdout:r}=await o(e,t,{timeout:5e3,env:{...process.env,PATH:a}});return{installed:!0,version:n(r)}}catch{return{installed:!1,version:null}}},m=e=>e.trim().match(/(\d+\.\d+[\d.]*)/)?.[1]??null,h=[r.default.join(a.default.homedir(),".local","bin")],p=async()=>{for(let e of h)try{return await (0,n.access)(r.default.join(e,"claude")),e}catch{}return null},y=e=>e.installed&&null!==e.version&&parseFloat(e.version)>=2.9,g=async()=>{u=await c();let[e,t,s]=await Promise.all([f("tmux",["-V"],m),f("git",["--version"],m),f("claude",["--version"],m)]),i=(y(e)&&t.installed&&s.installed,s.installed?null:await p()),o=!1;if(s.installed||i)try{await (0,n.access)(r.default.join(a.default.homedir(),".claude")),o=!0}catch{}return{tmux:{...e,compatible:y(e)},git:t,claude:{...s,binaryPath:i,loggedIn:o}}},w=null,S=null,$=null,v=null,x=async()=>$&&Date.now()-$.checkedAt<1e3?$.result:v||(v=g().then(e=>($={result:e,checkedAt:Date.now()},v=null,e)).catch(e=>{throw v=null,e})),D=async()=>{u=await c();let[e,t,n]=await Promise.all([f("tmux",["-V"],m),f("git",["--version"],m),f("claude",["--version"],m)]);return{tmux:{...e,compatible:y(e)},git:t,claude:n}},C=async()=>w&&Date.now()-w.checkedAt<3e4?w.result:S||(S=D().then(e=>(w={result:e,checkedAt:Date.now()},S=null,e)).catch(e=>{throw S=null,e}));e.s(["getCachedPreflightStatus",0,x,"getCachedRuntimePreflight",0,C,"getShellPath",0,d,"invalidateRuntimeCache",0,()=>{w=null,S=null}])},522734,(e,t,n)=>{t.exports=e.x("fs",()=>require("fs"))},319668,(e,t,n)=>{t.exports=e.x("readline",()=>require("readline"))},990294,(e,t,n)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",n="minute",a="hour",r="week",s="month",i="quarter",o="year",u="date",l="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=function(e,t,n){var a=String(e);return!a||a.length>=t?e:""+Array(t+1-a.length).join(n)+e},m="en",h={};h[m]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}};var p="$isDayjsObject",y=function(e){return e instanceof $||!(!e||!e[p])},g=function e(t,n,a){var r;if(!t)return m;if("string"==typeof t){var s=t.toLowerCase();h[s]&&(r=s),n&&(h[s]=n,r=s);var i=t.split("-");if(!r&&i.length>1)return e(i[0])}else{var o=t.name;h[o]=t,r=o}return!a&&r&&(m=r),r||!a&&m},w=function(e,t){if(y(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new $(n)},S={s:f,z:function(e){var t=-e.utcOffset(),n=Math.abs(t);return(t<=0?"+":"-")+f(Math.floor(n/60),2,"0")+":"+f(n%60,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var a=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(a,s),i=n-r<0,o=t.clone().add(a+(i?-1:1),s);return+(-(a+(n-r)/(i?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(l){return({M:s,y:o,w:r,d:"day",D:u,h:a,m:n,s:t,ms:e,Q:i})[l]||String(l||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};S.l=g,S.i=y,S.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var $=function(){function f(e){this.$L=g(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[p]=!0}var m=f.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var a=t.match(c);if(a){var r=a[2]-1||0,s=(a[7]||"0").substring(0,3);return n?new Date(Date.UTC(a[1],r,a[3]||1,a[4]||0,a[5]||0,a[6]||0,s)):new Date(a[1],r,a[3]||1,a[4]||0,a[5]||0,a[6]||0,s)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return S},m.isValid=function(){return this.$d.toString()!==l},m.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return w(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<w(e)},m.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,i){var l=this,c=!!S.u(i)||i,d=S.p(e),f=function(e,t){var n=S.w(l.$u?Date.UTC(l.$y,t,e):new Date(l.$y,t,e),l);return c?n:n.endOf("day")},m=function(e,t){return S.w(l.toDate()[e].apply(l.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),l)},h=this.$W,p=this.$M,y=this.$D,g="set"+(this.$u?"UTC":"");switch(d){case o:return c?f(1,0):f(31,11);case s:return c?f(1,p):f(0,p+1);case r:var w=this.$locale().weekStart||0,$=(h<w?h+7:h)-w;return f(c?y-$:y+(6-$),p);case"day":case u:return m(g+"Hours",0);case a:return m(g+"Minutes",1);case n:return m(g+"Seconds",2);case t:return m(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(r,i){var l,c=S.p(r),d="set"+(this.$u?"UTC":""),f=((l={}).day=d+"Date",l[u]=d+"Date",l[s]=d+"Month",l[o]=d+"FullYear",l[a]=d+"Hours",l[n]=d+"Minutes",l[t]=d+"Seconds",l[e]=d+"Milliseconds",l)[c],m="day"===c?this.$D+(i-this.$W):i;if(c===s||c===o){var h=this.clone().set(u,1);h.$d[f](m),h.init(),this.$d=h.set(u,Math.min(this.$D,h.daysInMonth())).$d}else f&&this.$d[f](m);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[S.p(e)]()},m.add=function(e,i){var u,l=this;e=Number(e);var c=S.p(i),d=function(t){var n=w(l);return S.w(n.date(n.date()+Math.round(t*e)),l)};if(c===s)return this.set(s,this.$M+e);if(c===o)return this.set(o,this.$y+e);if("day"===c)return d(1);if(c===r)return d(7);var f=((u={})[n]=6e4,u[a]=36e5,u[t]=1e3,u)[c]||1,m=this.$d.getTime()+e*f;return S.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var a=e||"YYYY-MM-DDTHH:mm:ssZ",r=S.z(this),s=this.$H,i=this.$m,o=this.$M,u=n.weekdays,c=n.months,f=n.meridiem,m=function(e,n,r,s){return e&&(e[n]||e(t,a))||r[n].slice(0,s)},h=function(e){return S.s(s%12||12,e,"0")},p=f||function(e,t,n){var a=e<12?"AM":"PM";return n?a.toLowerCase():a};return a.replace(d,function(e,a){return a||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return S.s(t.$y,4,"0");case"M":return o+1;case"MM":return S.s(o+1,2,"0");case"MMM":return m(n.monthsShort,o,c,3);case"MMMM":return m(c,o);case"D":return t.$D;case"DD":return S.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return m(n.weekdaysMin,t.$W,u,2);case"ddd":return m(n.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(s);case"HH":return S.s(s,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return p(s,i,!0);case"A":return p(s,i,!1);case"m":return String(i);case"mm":return S.s(i,2,"0");case"s":return String(t.$s);case"ss":return S.s(t.$s,2,"0");case"SSS":return S.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},m.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},m.diff=function(e,u,l){var c,d=this,f=S.p(u),m=w(e),h=(m.utcOffset()-this.utcOffset())*6e4,p=this-m,y=function(){return S.m(d,m)};switch(f){case o:c=y()/12;break;case s:c=y();break;case i:c=y()/3;break;case r:c=(p-h)/6048e5;break;case"day":c=(p-h)/864e5;break;case a:c=p/36e5;break;case n:c=p/6e4;break;case t:c=p/1e3;break;default:c=p}return l?c:S.a(c)},m.daysInMonth=function(){return this.endOf(s).$D},m.$locale=function(){return h[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),a=g(e,t,!0);return a&&(n.$L=a),n},m.clone=function(){return S.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},f}(),v=$.prototype;return w.prototype=v,[["$ms",e],["$s",t],["$m",n],["$H",a],["$W","day"],["$M",s],["$y",o],["$D",u]].forEach(function(e){v[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),w.extend=function(e,t){return e.$i||(e(t,$,w),e.$i=!0),w},w.locale=g,w.isDayjs=y,w.unix=function(e){return w(1e3*e)},w.en=h[m],w.Ls=h,w.p={},w}()},177579,e=>{"use strict";var t=e.i(924868),n=e.i(522734),a=e.i(814747),r=e.i(446786),s=e.i(319668),i=e.i(990294);let o=a.default.join(r.default.homedir(),".purplemux","stats"),u=a.default.join(o,"cache.json"),l=a.default.join(r.default.homedir(),".claude","projects"),c=async()=>{let e=[];try{for(let n of(await t.default.readdir(l))){let r=a.default.join(l,n),s=await t.default.stat(r).catch(()=>null);if(s?.isDirectory())for(let n of(await t.default.readdir(r).catch(()=>[])))n.endsWith(".jsonl")&&!/^agent-/.test(n)&&e.push(a.default.join(r,n))}}catch{}return e},d=async(e,t)=>{let a=new Map,r=new Map;try{let i=(0,n.createReadStream)(e,{encoding:"utf-8"});for await(let e of s.default.createInterface({input:i,crlfDelay:1/0}))if(e.trim())try{let n=JSON.parse(e),s=String(n.timestamp??"");if(!s)continue;let i=s.slice(0,10);if(!t.has(i))continue;let o=String(n.type??"");if("user"!==o&&"assistant"!==o)continue;let u=String(n.sessionId??""),l=String(new Date(s).getHours()),c=a.get(i);c||(c={messageCount:0,sessionCount:0,toolCallCount:0,hourCounts:{},modelTokens:{},sessions:[]},a.set(i,c),r.set(i,new Map));let d=r.get(i);if("user"===o&&(c.messageCount++,c.hourCounts[l]=(c.hourCounts[l]??0)+1,u)){let e=d.get(u);e?(e.messages++,s>e.end&&(e.end=s),s<e.start&&(e.start=s)):d.set(u,{start:s,end:s,messages:1})}if("assistant"===o){let e=n.message;if(!e)continue;let t=e.content;if(Array.isArray(t)){let e=t.filter(e=>"object"==typeof e&&null!==e&&"tool_use"===e.type).length;c.toolCallCount+=e}let a=String(e.model??""),r=e.usage;if(a&&!a.startsWith("<")&&r){c.modelTokens[a]||(c.modelTokens[a]={input:0,output:0,cacheRead:0,cacheCreation:0});let e=c.modelTokens[a];e.input+=Number(r.input_tokens??0),e.output+=Number(r.output_tokens??0),e.cacheRead+=Number(r.cache_read_input_tokens??0),e.cacheCreation+=Number(r.cache_creation_input_tokens??0)}if(u){let e=d.get(u);e?(s>e.end&&(e.end=s),s<e.start&&(e.start=s)):d.set(u,{start:s,end:s,messages:0})}}}catch{}}catch{}for(let[e,t]of r){let n=a.get(e);n&&(n.sessionCount=t.size,n.sessions=Array.from(t.entries()).map(([e,t])=>({id:e,start:t.start,end:t.end,messages:t.messages})))}return a},f=async(e,t)=>{let n=[],a=0,r=async()=>{for(;a<e.length;){let t=a++;n[t]=await e[t]()}},s=Array.from({length:Math.min(t,e.length)},()=>r());return await Promise.all(s),n},m=(e,t)=>{for(let[n,a]of(e.messageCount+=t.messageCount,e.toolCallCount+=t.toolCallCount,Object.entries(t.hourCounts)))e.hourCounts[n]=(e.hourCounts[n]??0)+a;for(let[n,a]of Object.entries(t.modelTokens)){e.modelTokens[n]||(e.modelTokens[n]={input:0,output:0,cacheRead:0,cacheCreation:0});let t=e.modelTokens[n];t.input+=a.input,t.output+=a.output,t.cacheRead+=a.cacheRead,t.cacheCreation+=a.cacheCreation}let n=new Set(e.sessions.map(e=>e.id));for(let a of t.sessions)if(n.has(a.id)){let t=e.sessions.find(e=>e.id===a.id);t.messages+=a.messages,a.start<t.start&&(t.start=a.start),a.end>t.end&&(t.end=a.end)}else e.sessions.push(a);e.sessionCount=e.sessions.length},h=async()=>{try{let e=await t.default.readFile(u,"utf-8"),n=JSON.parse(e);if(1!==n.version)return null;return n}catch{return null}},p=async e=>{await t.default.mkdir(o,{recursive:!0}),await t.default.writeFile(u,JSON.stringify(e),"utf-8")},y=null,g=async e=>{try{let t=(0,n.createReadStream)(e,{encoding:"utf-8"});for await(let e of s.default.createInterface({input:t,crlfDelay:1/0}))if(e.trim())try{let t=JSON.parse(e),n=String(t.timestamp??"");if(n)return n.slice(0,10)}catch{}}catch{}return null},w=async()=>{let e=await c();if(0===e.length)return null;let t=e.map(e=>()=>g(e)),n=(await f(t,10)).filter(e=>null!==e);return 0===n.length?null:(n.sort(),n[0])},S=async e=>{if(0===e.size)return new Map;let t=(await c()).map(t=>()=>d(t,e)),n=await f(t,10),a=new Map;for(let e of n)for(let[t,n]of e){let e=a.get(t);e?m(e,n):a.set(t,n)}return a},$=async()=>{if(y&&Date.now()<y.expiresAt)return y.data;let e=(0,i.default)().subtract(1,"day").format("YYYY-MM-DD"),t=(0,i.default)().format("YYYY-MM-DD"),n=await h(),a=new Set;if(a.add(t),n){if(n.lastComputedDate<e){let t=(0,i.default)(n.lastComputedDate).add(1,"day"),r=(0,i.default)(e);for(;t.isBefore(r)||t.isSame(r);){let e=t.format("YYYY-MM-DD");n.days[e]||a.add(e),t=t.add(1,"day")}}}else{n={version:1,lastComputedDate:"",days:{}};let r=await w();if(!r)return v(n,t);let s=(0,i.default)(r),o=(0,i.default)(e);for(;s.isBefore(o)||s.isSame(o);)a.add(s.format("YYYY-MM-DD")),s=s.add(1,"day")}let r=await S(a);for(let[e,a]of r)e!==t&&(n.days[e]=a);n.lastComputedDate=e,await p(n);let s=r.get(t)??null,o=v(n,t,s);return y={data:o,expiresAt:Date.now()+3e5},o},v=(e,t,n)=>{let a=[],r=[],s={},i={},o={},u=0,l=0,c="",d={sessionId:"",duration:0,messageCount:0,timestamp:""},f=Object.entries(e.days);for(let[e,m]of(n&&f.push([t,n]),f.sort((e,t)=>e[0].localeCompare(t[0])),f)){!c&&m.messageCount>0&&(c=e),a.push({date:e,messageCount:m.messageCount,sessionCount:m.sessionCount,toolCallCount:m.toolCallCount});let t={};for(let[e,n]of Object.entries(m.modelTokens)){t[e]={input:n.input,output:n.output,cacheRead:n.cacheRead,cacheCreation:n.cacheCreation},s[e]||(s[e]={inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,webSearchRequests:0,costUSD:0,contextWindow:0,maxOutputTokens:0});let a=s[e];a.inputTokens+=n.input,a.outputTokens+=n.output,a.cacheReadInputTokens+=n.cacheRead,a.cacheCreationInputTokens+=n.cacheCreation}r.push({date:e,tokensByModel:t});let n=new Date(e).getDay();for(let[e,t]of Object.entries(m.hourCounts)){i[e]=(i[e]??0)+t;let a=`${n}-${e}`;o[a]=(o[a]??0)+t}for(let e of(u+=m.sessionCount,l+=m.messageCount,m.sessions)){let t=new Date(e.end).getTime()-new Date(e.start).getTime();t>d.duration&&(d={sessionId:e.id,duration:t,messageCount:e.messages,timestamp:e.start})}}return{version:1,lastComputedDate:t,dailyActivity:a,dailyModelTokens:r,modelUsage:s,totalSessions:u,totalMessages:l,longestSession:d,firstSessionDate:c,hourCounts:i,dayHourCounts:o,totalSpeculationTimeSavedMs:0}};e.s(["collectJsonlFiles",0,c,"getStatsCache",0,$])},7991,e=>{"use strict";var t=e.i(924868),n=e.i(814747),a=e.i(446786),r=e.i(522734),s=e.i(319668),i=e.i(233405),o=e.i(713915),u=e.i(177579);let l=n.default.join(a.default.homedir(),".purplemux","stats","daily-reports"),c=async()=>{let e={};try{for(let a of(await t.default.readdir(l)))if(a.endsWith(".json"))try{let r=await t.default.readFile(n.default.join(l,a),"utf-8"),s=JSON.parse(r);s.date&&s.brief&&(e[s.date]=s)}catch{}}catch{}return e},d=async e=>{await t.default.mkdir(l,{recursive:!0}),await t.default.writeFile(n.default.join(l,`${e.date}.json`),JSON.stringify(e,null,2),"utf-8")},f=e=>{let t=a.default.homedir();return(e.startsWith(t)?e.slice(t.length+1):e).replace(/^Workspace\/github\.com\//g,"").replace(/^Workspace\/gitlab\.kolonfnc\.com\//g,"gitlab/").replace(/^Documents\//g,"docs/").replace(/^Downloads/g,"Downloads")},m=async e=>{let t=await (0,u.collectJsonlFiles)(),a=[];for(let i of t){let t=[],o=[],u=0,l="";try{let n=(0,r.createReadStream)(i,{encoding:"utf-8"});for await(let a of s.default.createInterface({input:n,crlfDelay:1/0}))if(a.trim())try{let n=JSON.parse(a),r=String(n.timestamp??"");if(!r.startsWith(e))continue;o.push(r);let s=String(n.type??"");if(l||"string"!=typeof n.cwd||(l=n.cwd),"user"===s){let e=n.message;if(!e)continue;let a=e.content,s="";if("string"==typeof a)s=a.slice(0,300);else if(Array.isArray(a)){let e=[];for(let t of a)"object"==typeof t&&null!==t&&"text"===t.type&&e.push(String(t.text??"").slice(0,300));s=e.join(" | ")}if(s.includes("<command-message>")){let e=s.match(/<command-name>\/([^<]+)<\/command-name>/);s=`[Command: ${e?e[1]:"unknown"}]`}if(s.includes("<local-command-caveat>")||s.includes("<task-notification>"))continue;s.trim()&&t.push({time:r.slice(11,16),text:s.slice(0,200)})}if("assistant"===s){let e=n.message;if(!e)continue;let t=e.content;Array.isArray(t)&&(u+=t.filter(e=>"object"==typeof e&&null!==e&&"tool_use"===e.type).length)}}catch{}}catch{}if(o.length>0&&t.length>0){let e=l?f(l):n.default.basename(n.default.dirname(i));a.push({project:e,start:Math.min(...o.map(e=>new Date(e).getTime())).toString(),msgCount:t.length,toolCount:u,firstMessage:t[0].text})}}return a.sort((e,t)=>Number(e.start)-Number(t.start)),a},h=async(e,t)=>{let n=await (0,o.getShellPath)();return new Promise((a,r)=>{let s=(0,i.execFile)("claude",["-p"],{timeout:12e4,maxBuffer:1048576,env:{...process.env,PATH:n}},(e,t)=>{e?r(Error(`claude -p failed: ${e.message}`)):a(t.trim())});s.stdin?.write(`${t}
1
+ module.exports=[270406,(e,t,n)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,n)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,n)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,n)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},130146,(e,t,n)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},666680,(e,t,n)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},224361,(e,t,n)=>{t.exports=e.x("util",()=>require("util"))},233405,(e,t,n)=>{t.exports=e.x("child_process",()=>require("child_process"))},25146,e=>{"use strict";var t=e.i(130146),n=e.i(814747),a=e.i(446786);let r=n.default.join(a.default.homedir(),".purplemux","logs"),s=process.env.LOG_LEVEL||"info",i=(e=>{if(!e)return{};let t={};for(let n of e.split(",")){let[e,a]=n.split("=").map(e=>e.trim());e&&a&&(t[e]=a)}return t})(process.env.LOG_LEVELS),o=["trace","debug","info","warn","error","fatal"],u=globalThis;if(!u.__ptRootLogger){let e=[s,...Object.values(i)].reduce((e,t)=>o.indexOf(t)<o.indexOf(e)?t:e,"fatal");u.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:n.default.join(r,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let l=u.__ptRootLogger;e.s(["createLogger",0,e=>{let t=l.child({module:e});return t.level=i[e]??s,t}])},44014,e=>{"use strict";let t,n;var a=e.i(666680);e.s(["nanoid",0,function(e=21){var r;r=e|=0,!t||t.length<r?(t=Buffer.allocUnsafe(128*r),a.webcrypto.getRandomValues(t),n=0):n+r>t.length&&(a.webcrypto.getRandomValues(t),n=0),n+=r;let s="";for(let a=n-e;a<n;a++)s+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[a]];return s}],44014)},459015,544538,e=>{"use strict";var t=e.i(233405),n=e.i(924868),a=e.i(224361),r=e.i(814747),s=e.i(44014),i=e.i(25146);process.platform;let o="linux"===process.platform;e.s(["isLinux",0,o],544538);let u=(0,i.createLogger)("terminal"),l=(0,a.promisify)(t.execFile),c="purple",d=r.default.join(process.env.__PMUX_APP_DIR_UNPACKED||process.env.__PMUX_APP_DIR||process.cwd(),"src","config","tmux.conf"),f={...process.env},m=new Set(["AUTH_PASSWORD","NEXTAUTH_SECRET","PORT"]),h=()=>Object.fromEntries(Object.entries(f).filter(([e])=>!e.startsWith("npm_")&&!e.startsWith("NODE_")&&!m.has(e))),p=async()=>{try{let{stdout:e}=await l("tmux",["-L",c,"ls","-F","#{session_name}"],{timeout:5e3});return e.trim().split("\n").map(e=>e.trim()).filter(e=>e.startsWith("pt-"))}catch{return[]}},y=async(e,t,n,a)=>{let r=process.env.SHELL||"/bin/zsh";await l("tmux",["-u","-L",c,"-f",d,"new-session","-d","-s",e,"-x",String(t),"-y",String(n)],{timeout:5e3,env:{...h(),SHELL:r,TERM:"xterm-256color",COLORTERM:"truecolor"},cwd:a||process.env.HOME||"/"}),await b(),u.debug(`tmux session created: ${e} (cols: ${t}, rows: ${n})`)},g=e=>new Promise(t=>setTimeout(t,e)),w=async e=>{if(!await S(e))return;u.debug(`killSession start: ${e}`);let t=await C(e);if(t)try{u.debug(`SIGTERM → process group ${t}: ${e}`),process.kill(-t,"SIGTERM")}catch{}try{await l("tmux",["-L",c,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<5;t++){if(!await S(e))return void u.debug(`killSession done (SIGTERM): ${e}`);await g(200)}if(u.warn(`session survived SIGTERM, escalating to SIGKILL: ${e}`),t)try{u.debug(`SIGKILL → process group ${t}: ${e}`),process.kill(-t,"SIGKILL")}catch{}try{await l("tmux",["-L",c,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<3;t++){if(!await S(e))return void u.debug(`killSession done (SIGKILL): ${e}`);await g(200)}u.warn(`tmux session still alive after kill: ${e}`)},S=async e=>{try{return await l("tmux",["-L",c,"has-session","-t",e],{timeout:5e3}),!0}catch{return!1}},$=async()=>{},v=async()=>{await $();let e=await p();e.length>0&&e.forEach(e=>{u.debug(`existing tmux session found: ${e}`)})},x=async e=>{if(o)try{return await n.default.readlink(`/proc/${e}/cwd`)}catch{return null}try{let{stdout:t}=await l("lsof",["-a","-p",String(e),"-d","cwd","-Fn"],{timeout:5e3}),n=t.split("\n").find(e=>e.startsWith("n/"));return n?n.slice(1):null}catch{return null}},D=async e=>{let t=await C(e);if(t){let e=await x(t);if(e)return e}try{let{stdout:t}=await l("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_current_path}"],{timeout:5e3});return t.trim()||null}catch{return null}},C=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_pid}"],{timeout:5e3}),n=parseInt(t.trim(),10);return Number.isNaN(n)?null:n}catch{return null}},b=async()=>{try{await l("tmux",["-L",c,"source-file",d],{timeout:5e3})}catch{}},M=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"list-panes","-t",e,"-F","#{pane_current_command}"],{timeout:5e3});return t.trim()||null}catch{return null}},k=async()=>{try{let{stdout:e}=await l("tmux",["-L",c,"list-panes","-a","-F","#{session_name} #{pane_current_command} #{pane_current_path} #{pane_pid} #{window_activity}"],{timeout:5e3}),t=new Map;for(let n of e.trim().split("\n")){if(!n)continue;let[e,a,r,s,i]=n.split(" ");if(e&&a){let n=parseInt(s,10),o=parseInt(i,10);t.set(e,{command:a,path:r||"",pid:Number.isNaN(n)?0:n,windowActivity:Number.isNaN(o)?0:o})}}return t}catch{return new Map}},_=new Set(["bash","zsh","fish","sh","dash"]),T=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_title}"],{timeout:5e3});return t.trim()||null}catch{return null}},L=async e=>{await l("tmux",["-L",c,"copy-mode","-q","-t",e],{timeout:5e3}).catch(()=>{})},O=async(e,t)=>{await L(e),await l("tmux",["-L",c,"send-keys","-t",e,t,"Enter"],{timeout:5e3})},I=async(e,t)=>{await L(e),await l("tmux",["-L",c,"send-keys","-t",e,t],{timeout:5e3})},A=async(e,t)=>{await L(e),await l("tmux",["-L",c,"send-keys","-t",e,"-l",`\x1b[200~${t}\x1b[201~`],{timeout:5e3}),await l("tmux",["-L",c,"send-keys","-t",e,"Enter"],{timeout:5e3}),await new Promise(e=>setTimeout(e,600)),await l("tmux",["-L",c,"send-keys","-t",e,"Enter"],{timeout:5e3})},E=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_current_path} #{pane_current_command} #{pane_pid} #{pane_width} #{pane_height} #{session_created}"],{timeout:5e3}),[n,a,r,s,i,o]=t.trim().split(" ");return{cwd:n||null,command:a||null,pid:r&&parseInt(r,10)||null,width:s&&parseInt(s,10)||null,height:i&&parseInt(i,10)||null,sessionCreated:o&&parseInt(o,10)||null}}catch{return{cwd:null,command:null,pid:null,width:null,height:null,sessionCreated:null}}},j=new Set(["node","python","python3","ruby","perl","deno","bun"]),R=async()=>{try{await l("tmux",["-L",c,"kill-server"],{timeout:5e3}),u.debug("tmux server killed")}catch{}},N=async e=>{try{let{stdout:t}=await l("tmux",["-L",c,"capture-pane","-p","-t",e],{timeout:5e3});return t}catch{return null}},P=async(e,t)=>{try{let{stdout:n}=await l("tmux",["-L",c,"capture-pane","-p","-S",`-${t}`,"-t",e],{timeout:5e3});return n}catch{return null}},F=async e=>{if(o){let t=[];return await Promise.all(e.map(async e=>{try{for(let a of(await n.default.readFile(`/proc/${e}/task/${e}/children`,"utf-8")).trim().split(/\s+/)){let e=parseInt(a,10);Number.isNaN(e)||t.push(e)}}catch{}})),t}try{let{stdout:t}=await l("pgrep",["-P",e.join(",")],{timeout:5e3});return t.trim().split("\n").map(e=>parseInt(e,10)).filter(e=>!Number.isNaN(e))}catch{return[]}},H=async e=>{let t=[],n=[e];for(;n.length>0;){let e=await F(n);if(0===e.length)break;t.push(...e),n=e}return t},Y=async e=>{try{let t=new Set(e),{stdout:n}=await l("ss",["-tlnp"],{timeout:5e3}),a=new Set;for(let e of n.split("\n")){let n=e.match(/pid=(\d+)/g);if(!n||!n.some(e=>t.has(parseInt(e.replace("pid=",""),10))))continue;let r=e.match(/:(\d+)\s/);r&&a.add(parseInt(r[1],10))}return[...a].sort((e,t)=>e-t)}catch{return[]}},W=async e=>{let t=await H(e);if(0===t.length)return[];if(o)return Y(t);try{let{stdout:e}=await l("lsof",["-a","-p",t.join(","),"-i","-sTCP:LISTEN","-P","-Fn"],{timeout:5e3}),n=new Set;for(let t of e.split("\n"))if(t.startsWith("n")){let e=t.match(/:(\d+)$/);e&&n.add(parseInt(e[1],10))}return[...n].sort((e,t)=>e-t)}catch{return[]}},U=async e=>{let t=await C(e);if(!t)return null;try{let{stdout:e}=await l("pgrep",["-n","-P",String(t)],{timeout:5e3}),n=e.trim();if(!n)return null;let{stdout:a}=await l("ps",["-o","args=","-p",n],{timeout:5e3}),s=a.trim();if(!s)return null;let i=s.split(/\s+/);if(0===i.length)return s;if(i[0]=r.default.basename(i[0]),j.has(i[0])&&i.length>1){let e=r.default.basename(i[1]).replace(/\.(c|m)?js$/,"");i.splice(0,2,e)}return i.join(" ")}catch{return null}};e.s(["SAFE_SHELLS",0,_,"applyConfig",0,b,"capturePaneContent",0,N,"capturePaneContentWithHistory",0,P,"createSession",0,y,"defaultSessionName",0,()=>`pt-${(0,s.nanoid)(6)}-${(0,s.nanoid)(6)}-${(0,s.nanoid)(6)}`,"exitCopyMode",0,L,"getAllPanesInfo",0,k,"getLastCommand",0,U,"getListeningPorts",0,W,"getPaneCurrentCommand",0,M,"getPaneDetailInfo",0,E,"getPaneTitle",0,T,"getSessionCwd",0,D,"getSessionPanePid",0,C,"hasSession",0,S,"killServer",0,R,"killSession",0,w,"listSessions",0,p,"sanitizedEnv",0,h,"scanSessions",0,v,"sendBracketedPaste",0,A,"sendKeys",0,O,"sendRawKeys",0,I,"workspaceSessionName",0,(e,t,n)=>`pt-${e}-${t}-${n}`],459015)},713915,e=>{"use strict";var t=e.i(233405),n=e.i(924868),a=e.i(446786),r=e.i(814747),s=e.i(224361),i=e.i(459015);let o=(0,s.promisify)(t.execFile),u=null,l=null,c=async()=>{let e=a.default.userInfo().shell||process.env.SHELL||"/bin/bash";try{let{stdout:t}=await o(e,["-ilc",'echo -n "$PATH"'],{timeout:5e3,env:{...(0,i.sanitizedEnv)(),SHELL:e,DISABLE_AUTO_UPDATE:"true",ZSH_TMUX_AUTOSTARTED:"true",TERM:"xterm-256color",COLORTERM:"truecolor"}});return t.toString().trim()}catch{return process.env.PATH||""}},d=async()=>u||(l||(l=c().then(e=>(u=e,l=null,e))),l),f=async(e,t,n)=>{try{let a=await d(),{stdout:r}=await o(e,t,{timeout:5e3,env:{...process.env,PATH:a}});return{installed:!0,version:n(r)}}catch{return{installed:!1,version:null}}},m=e=>e.trim().match(/(\d+\.\d+[\d.]*)/)?.[1]??null,h=[r.default.join(a.default.homedir(),".local","bin")],p=async()=>{for(let e of h)try{return await (0,n.access)(r.default.join(e,"claude")),e}catch{}return null},y=e=>e.installed&&null!==e.version&&parseFloat(e.version)>=2.9,g=async()=>{u=await c();let[e,t,s]=await Promise.all([f("tmux",["-V"],m),f("git",["--version"],m),f("claude",["--version"],m)]),i=(y(e)&&t.installed&&s.installed,s.installed?null:await p()),o=!1;if(s.installed||i)try{await (0,n.access)(r.default.join(a.default.homedir(),".claude")),o=!0}catch{}return{tmux:{...e,compatible:y(e)},git:t,claude:{...s,binaryPath:i,loggedIn:o}}},w=null,S=null,$=null,v=null,x=async()=>$&&Date.now()-$.checkedAt<1e3?$.result:v||(v=g().then(e=>($={result:e,checkedAt:Date.now()},v=null,e)).catch(e=>{throw v=null,e})),D=async()=>{u=await c();let[e,t,n]=await Promise.all([f("tmux",["-V"],m),f("git",["--version"],m),f("claude",["--version"],m)]);return{tmux:{...e,compatible:y(e)},git:t,claude:n}},C=async()=>w&&Date.now()-w.checkedAt<3e4?w.result:S||(S=D().then(e=>(w={result:e,checkedAt:Date.now()},S=null,e)).catch(e=>{throw S=null,e}));e.s(["getCachedPreflightStatus",0,x,"getCachedRuntimePreflight",0,C,"getShellPath",0,d,"invalidateRuntimeCache",0,()=>{w=null,S=null}])},522734,(e,t,n)=>{t.exports=e.x("fs",()=>require("fs"))},319668,(e,t,n)=>{t.exports=e.x("readline",()=>require("readline"))},990294,(e,t,n)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",n="minute",a="hour",r="week",s="month",i="quarter",o="year",u="date",l="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=function(e,t,n){var a=String(e);return!a||a.length>=t?e:""+Array(t+1-a.length).join(n)+e},m="en",h={};h[m]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}};var p="$isDayjsObject",y=function(e){return e instanceof $||!(!e||!e[p])},g=function e(t,n,a){var r;if(!t)return m;if("string"==typeof t){var s=t.toLowerCase();h[s]&&(r=s),n&&(h[s]=n,r=s);var i=t.split("-");if(!r&&i.length>1)return e(i[0])}else{var o=t.name;h[o]=t,r=o}return!a&&r&&(m=r),r||!a&&m},w=function(e,t){if(y(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new $(n)},S={s:f,z:function(e){var t=-e.utcOffset(),n=Math.abs(t);return(t<=0?"+":"-")+f(Math.floor(n/60),2,"0")+":"+f(n%60,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var a=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(a,s),i=n-r<0,o=t.clone().add(a+(i?-1:1),s);return+(-(a+(n-r)/(i?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(l){return({M:s,y:o,w:r,d:"day",D:u,h:a,m:n,s:t,ms:e,Q:i})[l]||String(l||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};S.l=g,S.i=y,S.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var $=function(){function f(e){this.$L=g(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[p]=!0}var m=f.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var a=t.match(c);if(a){var r=a[2]-1||0,s=(a[7]||"0").substring(0,3);return n?new Date(Date.UTC(a[1],r,a[3]||1,a[4]||0,a[5]||0,a[6]||0,s)):new Date(a[1],r,a[3]||1,a[4]||0,a[5]||0,a[6]||0,s)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return S},m.isValid=function(){return this.$d.toString()!==l},m.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return w(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<w(e)},m.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,i){var l=this,c=!!S.u(i)||i,d=S.p(e),f=function(e,t){var n=S.w(l.$u?Date.UTC(l.$y,t,e):new Date(l.$y,t,e),l);return c?n:n.endOf("day")},m=function(e,t){return S.w(l.toDate()[e].apply(l.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),l)},h=this.$W,p=this.$M,y=this.$D,g="set"+(this.$u?"UTC":"");switch(d){case o:return c?f(1,0):f(31,11);case s:return c?f(1,p):f(0,p+1);case r:var w=this.$locale().weekStart||0,$=(h<w?h+7:h)-w;return f(c?y-$:y+(6-$),p);case"day":case u:return m(g+"Hours",0);case a:return m(g+"Minutes",1);case n:return m(g+"Seconds",2);case t:return m(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(r,i){var l,c=S.p(r),d="set"+(this.$u?"UTC":""),f=((l={}).day=d+"Date",l[u]=d+"Date",l[s]=d+"Month",l[o]=d+"FullYear",l[a]=d+"Hours",l[n]=d+"Minutes",l[t]=d+"Seconds",l[e]=d+"Milliseconds",l)[c],m="day"===c?this.$D+(i-this.$W):i;if(c===s||c===o){var h=this.clone().set(u,1);h.$d[f](m),h.init(),this.$d=h.set(u,Math.min(this.$D,h.daysInMonth())).$d}else f&&this.$d[f](m);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[S.p(e)]()},m.add=function(e,i){var u,l=this;e=Number(e);var c=S.p(i),d=function(t){var n=w(l);return S.w(n.date(n.date()+Math.round(t*e)),l)};if(c===s)return this.set(s,this.$M+e);if(c===o)return this.set(o,this.$y+e);if("day"===c)return d(1);if(c===r)return d(7);var f=((u={})[n]=6e4,u[a]=36e5,u[t]=1e3,u)[c]||1,m=this.$d.getTime()+e*f;return S.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var a=e||"YYYY-MM-DDTHH:mm:ssZ",r=S.z(this),s=this.$H,i=this.$m,o=this.$M,u=n.weekdays,c=n.months,f=n.meridiem,m=function(e,n,r,s){return e&&(e[n]||e(t,a))||r[n].slice(0,s)},h=function(e){return S.s(s%12||12,e,"0")},p=f||function(e,t,n){var a=e<12?"AM":"PM";return n?a.toLowerCase():a};return a.replace(d,function(e,a){return a||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return S.s(t.$y,4,"0");case"M":return o+1;case"MM":return S.s(o+1,2,"0");case"MMM":return m(n.monthsShort,o,c,3);case"MMMM":return m(c,o);case"D":return t.$D;case"DD":return S.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return m(n.weekdaysMin,t.$W,u,2);case"ddd":return m(n.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(s);case"HH":return S.s(s,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return p(s,i,!0);case"A":return p(s,i,!1);case"m":return String(i);case"mm":return S.s(i,2,"0");case"s":return String(t.$s);case"ss":return S.s(t.$s,2,"0");case"SSS":return S.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},m.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},m.diff=function(e,u,l){var c,d=this,f=S.p(u),m=w(e),h=(m.utcOffset()-this.utcOffset())*6e4,p=this-m,y=function(){return S.m(d,m)};switch(f){case o:c=y()/12;break;case s:c=y();break;case i:c=y()/3;break;case r:c=(p-h)/6048e5;break;case"day":c=(p-h)/864e5;break;case a:c=p/36e5;break;case n:c=p/6e4;break;case t:c=p/1e3;break;default:c=p}return l?c:S.a(c)},m.daysInMonth=function(){return this.endOf(s).$D},m.$locale=function(){return h[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),a=g(e,t,!0);return a&&(n.$L=a),n},m.clone=function(){return S.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},f}(),v=$.prototype;return w.prototype=v,[["$ms",e],["$s",t],["$m",n],["$H",a],["$W","day"],["$M",s],["$y",o],["$D",u]].forEach(function(e){v[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),w.extend=function(e,t){return e.$i||(e(t,$,w),e.$i=!0),w},w.locale=g,w.isDayjs=y,w.unix=function(e){return w(1e3*e)},w.en=h[m],w.Ls=h,w.p={},w}()},177579,e=>{"use strict";var t=e.i(924868),n=e.i(522734),a=e.i(814747),r=e.i(446786),s=e.i(319668),i=e.i(990294);let o=a.default.join(r.default.homedir(),".purplemux","stats"),u=a.default.join(o,"cache.json"),l=a.default.join(r.default.homedir(),".claude","projects"),c=async()=>{let e=[];try{for(let n of(await t.default.readdir(l))){let r=a.default.join(l,n),s=await t.default.stat(r).catch(()=>null);if(s?.isDirectory())for(let n of(await t.default.readdir(r).catch(()=>[])))n.endsWith(".jsonl")&&!/^agent-/.test(n)&&e.push(a.default.join(r,n))}}catch{}return e},d=async(e,t)=>{let a=new Map,r=new Map;try{let i=(0,n.createReadStream)(e,{encoding:"utf-8"});for await(let e of s.default.createInterface({input:i,crlfDelay:1/0}))if(e.trim())try{let n=JSON.parse(e),s=String(n.timestamp??"");if(!s)continue;let i=s.slice(0,10);if(!t.has(i))continue;let o=String(n.type??"");if("user"!==o&&"assistant"!==o)continue;let u=String(n.sessionId??""),l=String(new Date(s).getHours()),c=a.get(i);c||(c={messageCount:0,sessionCount:0,toolCallCount:0,hourCounts:{},modelTokens:{},sessions:[]},a.set(i,c),r.set(i,new Map));let d=r.get(i);if("user"===o&&(c.messageCount++,c.hourCounts[l]=(c.hourCounts[l]??0)+1,u)){let e=d.get(u);e?(e.messages++,s>e.end&&(e.end=s),s<e.start&&(e.start=s)):d.set(u,{start:s,end:s,messages:1})}if("assistant"===o){let e=n.message;if(!e)continue;let t=e.content;if(Array.isArray(t)){let e=t.filter(e=>"object"==typeof e&&null!==e&&"tool_use"===e.type).length;c.toolCallCount+=e}let a=String(e.model??""),r=e.usage;if(a&&!a.startsWith("<")&&r){c.modelTokens[a]||(c.modelTokens[a]={input:0,output:0,cacheRead:0,cacheCreation:0});let e=c.modelTokens[a];e.input+=Number(r.input_tokens??0),e.output+=Number(r.output_tokens??0),e.cacheRead+=Number(r.cache_read_input_tokens??0),e.cacheCreation+=Number(r.cache_creation_input_tokens??0)}if(u){let e=d.get(u);e?(s>e.end&&(e.end=s),s<e.start&&(e.start=s)):d.set(u,{start:s,end:s,messages:0})}}}catch{}}catch{}for(let[e,t]of r){let n=a.get(e);n&&(n.sessionCount=t.size,n.sessions=Array.from(t.entries()).map(([e,t])=>({id:e,start:t.start,end:t.end,messages:t.messages})))}return a},f=async(e,t)=>{let n=[],a=0,r=async()=>{for(;a<e.length;){let t=a++;n[t]=await e[t]()}},s=Array.from({length:Math.min(t,e.length)},()=>r());return await Promise.all(s),n},m=(e,t)=>{for(let[n,a]of(e.messageCount+=t.messageCount,e.toolCallCount+=t.toolCallCount,Object.entries(t.hourCounts)))e.hourCounts[n]=(e.hourCounts[n]??0)+a;for(let[n,a]of Object.entries(t.modelTokens)){e.modelTokens[n]||(e.modelTokens[n]={input:0,output:0,cacheRead:0,cacheCreation:0});let t=e.modelTokens[n];t.input+=a.input,t.output+=a.output,t.cacheRead+=a.cacheRead,t.cacheCreation+=a.cacheCreation}let n=new Set(e.sessions.map(e=>e.id));for(let a of t.sessions)if(n.has(a.id)){let t=e.sessions.find(e=>e.id===a.id);t.messages+=a.messages,a.start<t.start&&(t.start=a.start),a.end>t.end&&(t.end=a.end)}else e.sessions.push(a);e.sessionCount=e.sessions.length},h=async()=>{try{let e=await t.default.readFile(u,"utf-8"),n=JSON.parse(e);if(1!==n.version)return null;return n}catch{return null}},p=async e=>{await t.default.mkdir(o,{recursive:!0}),await t.default.writeFile(u,JSON.stringify(e),"utf-8")},y=null,g=async e=>{try{let t=(0,n.createReadStream)(e,{encoding:"utf-8"});for await(let e of s.default.createInterface({input:t,crlfDelay:1/0}))if(e.trim())try{let t=JSON.parse(e),n=String(t.timestamp??"");if(n)return n.slice(0,10)}catch{}}catch{}return null},w=async()=>{let e=await c();if(0===e.length)return null;let t=e.map(e=>()=>g(e)),n=(await f(t,10)).filter(e=>null!==e);return 0===n.length?null:(n.sort(),n[0])},S=async e=>{if(0===e.size)return new Map;let t=(await c()).map(t=>()=>d(t,e)),n=await f(t,10),a=new Map;for(let e of n)for(let[t,n]of e){let e=a.get(t);e?m(e,n):a.set(t,n)}return a},$=async()=>{if(y&&Date.now()<y.expiresAt)return y.data;let e=(0,i.default)().subtract(1,"day").format("YYYY-MM-DD"),t=(0,i.default)().format("YYYY-MM-DD"),n=await h(),a=new Set;if(a.add(t),n){if(n.lastComputedDate<e){let t=(0,i.default)(n.lastComputedDate).add(1,"day"),r=(0,i.default)(e);for(;t.isBefore(r)||t.isSame(r);){let e=t.format("YYYY-MM-DD");n.days[e]||a.add(e),t=t.add(1,"day")}}}else{n={version:1,lastComputedDate:"",days:{}};let r=await w();if(!r)return v(n,t);let s=(0,i.default)(r),o=(0,i.default)(e);for(;s.isBefore(o)||s.isSame(o);)a.add(s.format("YYYY-MM-DD")),s=s.add(1,"day")}let r=await S(a);for(let[e,a]of r)e!==t&&(n.days[e]=a);n.lastComputedDate=e,await p(n);let s=r.get(t)??null,o=v(n,t,s);return y={data:o,expiresAt:Date.now()+3e5},o},v=(e,t,n)=>{let a=[],r=[],s={},i={},o={},u=0,l=0,c="",d={sessionId:"",duration:0,messageCount:0,timestamp:""},f=Object.entries(e.days);for(let[e,m]of(n&&f.push([t,n]),f.sort((e,t)=>e[0].localeCompare(t[0])),f)){!c&&m.messageCount>0&&(c=e),a.push({date:e,messageCount:m.messageCount,sessionCount:m.sessionCount,toolCallCount:m.toolCallCount});let t={};for(let[e,n]of Object.entries(m.modelTokens)){t[e]={input:n.input,output:n.output,cacheRead:n.cacheRead,cacheCreation:n.cacheCreation},s[e]||(s[e]={inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,webSearchRequests:0,costUSD:0,contextWindow:0,maxOutputTokens:0});let a=s[e];a.inputTokens+=n.input,a.outputTokens+=n.output,a.cacheReadInputTokens+=n.cacheRead,a.cacheCreationInputTokens+=n.cacheCreation}r.push({date:e,tokensByModel:t});let n=new Date(e).getDay();for(let[e,t]of Object.entries(m.hourCounts)){i[e]=(i[e]??0)+t;let a=`${n}-${e}`;o[a]=(o[a]??0)+t}for(let e of(u+=m.sessionCount,l+=m.messageCount,m.sessions)){let t=new Date(e.end).getTime()-new Date(e.start).getTime();t>d.duration&&(d={sessionId:e.id,duration:t,messageCount:e.messages,timestamp:e.start})}}return{version:1,lastComputedDate:t,dailyActivity:a,dailyModelTokens:r,modelUsage:s,totalSessions:u,totalMessages:l,longestSession:d,firstSessionDate:c,hourCounts:i,dayHourCounts:o,totalSpeculationTimeSavedMs:0}};e.s(["collectJsonlFiles",0,c,"getStatsCache",0,$])},7991,e=>{"use strict";var t=e.i(924868),n=e.i(814747),a=e.i(446786),r=e.i(522734),s=e.i(319668),i=e.i(233405),o=e.i(713915),u=e.i(177579);let l=n.default.join(a.default.homedir(),".purplemux","stats","daily-reports"),c=async()=>{let e={};try{for(let a of(await t.default.readdir(l)))if(a.endsWith(".json"))try{let r=await t.default.readFile(n.default.join(l,a),"utf-8"),s=JSON.parse(r);s.date&&s.brief&&(e[s.date]=s)}catch{}}catch{}return e},d=async e=>{await t.default.mkdir(l,{recursive:!0}),await t.default.writeFile(n.default.join(l,`${e.date}.json`),JSON.stringify(e,null,2),"utf-8")},f=e=>{let t=a.default.homedir();return(e.startsWith(t)?e.slice(t.length+1):e).replace(/^Workspace\/github\.com\//g,"").replace(/^Workspace\/gitlab\.kolonfnc\.com\//g,"gitlab/").replace(/^Documents\//g,"docs/").replace(/^Downloads/g,"Downloads")},m=async e=>{let t=await (0,u.collectJsonlFiles)(),a=[];for(let i of t){let t=[],o=[],u=0,l="";try{let n=(0,r.createReadStream)(i,{encoding:"utf-8"});for await(let a of s.default.createInterface({input:n,crlfDelay:1/0}))if(a.trim())try{let n=JSON.parse(a),r=String(n.timestamp??"");if(!r.startsWith(e))continue;o.push(r);let s=String(n.type??"");if(l||"string"!=typeof n.cwd||(l=n.cwd),"user"===s){let e=n.message;if(!e)continue;let a=e.content,s="";if("string"==typeof a)s=a.slice(0,300);else if(Array.isArray(a)){let e=[];for(let t of a)"object"==typeof t&&null!==t&&"text"===t.type&&e.push(String(t.text??"").slice(0,300));s=e.join(" | ")}if(s.includes("<command-message>")){let e=s.match(/<command-name>\/([^<]+)<\/command-name>/);s=`[Command: ${e?e[1]:"unknown"}]`}if(s.includes("<local-command-caveat>")||s.includes("<task-notification>"))continue;s.trim()&&t.push({time:r.slice(11,16),text:s.slice(0,200)})}if("assistant"===s){let e=n.message;if(!e)continue;let t=e.content;Array.isArray(t)&&(u+=t.filter(e=>"object"==typeof e&&null!==e&&"tool_use"===e.type).length)}}catch{}}catch{}if(o.length>0&&t.length>0){let e=l?f(l):n.default.basename(n.default.dirname(i));a.push({project:e,start:Math.min(...o.map(e=>new Date(e).getTime())).toString(),msgCount:t.length,toolCount:u,firstMessage:t[0].text})}}return a.sort((e,t)=>Number(e.start)-Number(t.start)),a},h=async(e,t)=>{let n=await (0,o.getShellPath)();return new Promise((a,r)=>{let s=(0,i.execFile)("claude",["-p"],{timeout:12e4,maxBuffer:1048576,env:{...process.env,PATH:n}},(e,t)=>{e?r(Error(`claude -p failed: ${e.message}`)):a(t.trim())});s.stdin?.write(`${t}
2
2
 
3
3
  ${e}`),s.stdin?.end()})},p={en:"English",ko:"Korean (한국어)",ja:"Japanese (日本語)","zh-CN":"Simplified Chinese (简体中文)","zh-TW":"Traditional Chinese (繁體中文)",de:"German (Deutsch)",es:"Spanish (Español)",fr:"French (Français)","pt-BR":"Brazilian Portuguese (Português do Brasil)",ru:"Russian (Русский)",tr:"Turkish (Türkçe)"},y=async(e,t=!1,n="en")=>{var a,r;let s,i,o;if(!t){let t=await g(e);if(t&&t.locale===n)return t}let u=await m(e);if(0===u.length){let t={date:e,brief:"No activity recorded.",detail:"",generatedAt:new Date().toISOString(),locale:n};return await d(t),t}let l=u.map(e=>{let t=new Date(Number(e.start)).toTimeString().slice(0,5);return`[${t}] [${e.project}] msgs=${e.msgCount}, tools=${e.toolCount} | ${e.firstMessage}`}).join("\n"),{brief:c,detail:f}=(i=(r=await h(l,(a=e,s=p[n]??p.en,`Summarize the Claude session history for ${a}.
4
4
 
@@ -27,4 +27,4 @@ Rules:
27
27
 
28
28
  Data:`))).match(/\[BRIEF\]\s*\n([\s\S]*?)(?=\[DETAIL\])/),o=r.match(/\[DETAIL\]\s*\n([\s\S]*?)$/),{brief:i?i[1].replace(/[\s#\-]*$/,"").trim():r.slice(0,500),detail:o?o[1].trim():""}),y={date:e,brief:c,detail:f,generatedAt:new Date().toISOString(),locale:n};return await d(y),y},g=async e=>{try{let a=await t.default.readFile(n.default.join(l,`${e}.json`),"utf-8"),r=JSON.parse(a);return r.date&&r.brief?r:null}catch{return null}};e.s(["generateDailyReport",0,y,"readAllCachedReports",0,c,"shortenCwd",0,f])}];
29
29
 
30
- //# sourceMappingURL=%5Broot-of-the-server%5D__0.ci6xk._.js.map
30
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0.lni9v._.js.map
@@ -0,0 +1,15 @@
1
+ module.exports=[522734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},254799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},130146,(e,t,r)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},233405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},25146,e=>{"use strict";var t=e.i(130146),r=e.i(814747),i=e.i(446786);let a=r.default.join(i.default.homedir(),".purplemux","logs"),n=process.env.LOG_LEVEL||"info",s=(e=>{if(!e)return{};let t={};for(let r of e.split(",")){let[e,i]=r.split("=").map(e=>e.trim());e&&i&&(t[e]=i)}return t})(process.env.LOG_LEVELS),o=["trace","debug","info","warn","error","fatal"],l=globalThis;if(!l.__ptRootLogger){let e=[n,...Object.values(s)].reduce((e,t)=>o.indexOf(t)<o.indexOf(e)?t:e,"fatal");l.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:r.default.join(a,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let u=l.__ptRootLogger;e.s(["createLogger",0,e=>{let t=u.child({module:e});return t.level=s[e]??n,t}])},871911,e=>{"use strict";var t=e.i(254799),r=e.i(522734),i=e.i(814747),a=e.i(446786);let n=i.default.join(a.default.homedir(),".purplemux","cli-token"),s=globalThis;e.s(["verifyCliToken",0,e=>{let a=e.headers["x-pmux-token"];var o="string"==typeof a?a:void 0;if(!o)return!1;let l=(()=>{if(s.__ptCliToken)return s.__ptCliToken;let e=(()=>{try{return r.default.readFileSync(n,"utf-8").trim()||null}catch{return null}})();if(e)return s.__ptCliToken=e,e;let a=(0,t.randomBytes)(32).toString("hex");s.__ptCliToken=a;try{r.default.mkdirSync(i.default.dirname(n),{recursive:!0}),r.default.writeFileSync(n,a,{mode:384})}catch{}return a})();return o.length===l.length&&(0,t.timingSafeEqual)(Buffer.from(o),Buffer.from(l))}])},796902,e=>{"use strict";var t=e.i(814747),r=e.i(446786);let i=t.default.join(r.default.homedir(),".purplemux"),a=t.default.join(i,"statusline.sh"),n=t.default.join(i,"rate-limits.json"),s=`#!/bin/sh
2
+ PORT_FILE="$HOME/.purplemux/port"
3
+ TOKEN_FILE="$HOME/.purplemux/cli-token"
4
+ [ -f "$PORT_FILE" ] || exit 0
5
+ [ -f "$TOKEN_FILE" ] || exit 0
6
+ PORT=$(cat "$PORT_FILE")
7
+ TOKEN=$(cat "$TOKEN_FILE")
8
+ curl -sf --max-time 2 -X POST \\
9
+ -H 'Content-Type: application/json' \\
10
+ -H "x-pmux-token: \${TOKEN}" \\
11
+ --data-binary @- \\
12
+ "http://localhost:\${PORT}/api/status/statusline" 2>/dev/null || exit 0
13
+ `;e.s(["RATE_LIMITS_FILE",0,n,"STATUSLINE_SCRIPT_CONTENT",0,s,"STATUSLINE_SCRIPT_PATH",0,a])},135992,e=>{"use strict";var t=e.i(926747),r=e.i(190406),i=e.i(244898),a=e.i(262950),n=e.i(924868),s=e.i(814747),o=e.i(446786),l=e.i(233405),u=e.i(871911),d=e.i(796902);let p=(0,e.i(25146).createLogger)("statusline"),c=async e=>{let t=e.workspace?.project_dir,r=[];for(let e of(t&&(r.push(s.default.join(t,".claude","settings.local.json")),r.push(s.default.join(t,".claude","settings.json"))),r.push(s.default.join(o.default.homedir(),".claude","settings.json")),r))try{let t=await n.default.readFile(e,"utf-8"),r=JSON.parse(t),i=r?.statusLine?.command;if("string"==typeof i&&i.trim())return i}catch{}return null},f=async e=>{let t=e.rate_limits?.five_hour??null,r=e.rate_limits?.seven_day??null;if(!t&&!r)return;let i=e.context_window,a={ts:Date.now()/1e3,model:e.model?.display_name??null,five_hour:t,seven_day:r,context:i?{used_pct:i.used_percentage,remaining_pct:i.remaining_percentage,input_tokens:i.total_input_tokens,output_tokens:i.total_output_tokens,window_size:i.context_window_size}:null,cost:e.cost??null};try{await n.default.writeFile(d.RATE_LIMITS_FILE,JSON.stringify(a))}catch(e){p.debug({err:e},"failed to write rate-limits.json")}},m=async(e,t)=>{if("POST"!==e.method)return t.setHeader("Allow","POST"),t.status(405).json({error:"Method not allowed"});if(!(0,u.verifyCliToken)(e))return t.status(403).json({error:"Forbidden"});let r=e.body??{};await f(r),t.setHeader("Content-Type","text/plain; charset=utf-8");try{let e=await c(r);if(e){let i,a=await (i=JSON.stringify(r),new Promise((t,r)=>{let a=(0,l.spawn)("sh",["-c",e],{stdio:["pipe","pipe","pipe"]}),n="",s="";a.stdout.on("data",e=>{n+=e.toString()}),a.stderr.on("data",e=>{s+=e.toString()}),a.on("error",r),a.on("close",e=>{0!==e&&s&&p.debug({code:e,stderr:s},"user statusLine exited non-zero"),t(n)}),a.stdin.write(i),a.stdin.end()}));return t.status(200).send(a)}}catch(e){p.debug({err:e},"user statusLine failed")}return t.status(204).end()};e.s(["default",0,m],826327);var _=e.i(826327),g=e.i(7031),h=e.i(181927),x=e.i(846432);let y=(0,a.hoist)(_,"default"),v=(0,a.hoist)(_,"config"),T=new i.PagesAPIRouteModule({definition:{kind:r.RouteKind.PAGES_API,page:"/api/status/statusline",pathname:"/api/status/statusline",bundlePath:"",filename:""},userland:_,distDir:".next",relativeProjectDir:""});async function w(e,r,i){i.requestMeta&&(0,x.setRequestMeta)(e,i.requestMeta),T.isDev&&(0,x.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/status/statusline";a=a.replace(/\/index$/,"")||"/";let n=await T.prepare(e,r,{srcPage:a});if(!n){r.statusCode=400,r.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve());return}let{query:s,params:o,prerenderManifest:l,routerServerContext:u}=n;try{let t,i=e.method||"GET",n=(0,g.getTracer)(),d=n.getActiveScopeSpan(),p=!!(null==u?void 0:u.isWrappedByNextServer),c=T.instrumentationOnRequestError.bind(T),f=async d=>T.render(e,r,{query:{...s,...o},params:o,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:l.preview,propagateError:!1,dev:T.isDev,page:"/api/status/statusline",internalRevalidate:null==u?void 0:u.revalidate,onError:(...t)=>c(e,...t)}).finally(()=>{if(!d)return;d.setAttributes({"http.status_code":r.statusCode,"next.rsc":!1});let e=n.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==h.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=e.get("next.route");if(s){let e=`${i} ${s}`;d.setAttributes({"next.route":s,"http.route":s,"next.span_name":e}),d.updateName(e),t&&t!==d&&(t.setAttribute("http.route",s),t.updateName(e))}else d.updateName(`${i} ${a}`)});p&&d?await f(d):(t=n.getActiveScopeSpan(),await n.withPropagatedContext(e.headers,()=>n.trace(h.BaseServerSpan.handleRequest,{spanName:`${i} ${a}`,kind:g.SpanKind.SERVER,attributes:{"http.method":i,"http.target":e.url}},f),void 0,!p))}catch(e){if(T.isDev)throw e;(0,t.sendError)(r,500,"Internal Server Error")}finally{null==i.waitUntil||i.waitUntil.call(i,Promise.resolve())}}e.s(["config",0,v,"default",0,y,"handler",0,w],135992)}];
14
+
15
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0001gmm._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},666680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},130146,(e,t,r)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},233405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},25146,e=>{"use strict";var t=e.i(130146),r=e.i(814747),a=e.i(446786);let n=r.default.join(a.default.homedir(),".purplemux","logs"),i=process.env.LOG_LEVEL||"info",s=(e=>{if(!e)return{};let t={};for(let r of e.split(",")){let[e,a]=r.split("=").map(e=>e.trim());e&&a&&(t[e]=a)}return t})(process.env.LOG_LEVELS),l=["trace","debug","info","warn","error","fatal"],o=globalThis;if(!o.__ptRootLogger){let e=[i,...Object.values(s)].reduce((e,t)=>l.indexOf(t)<l.indexOf(e)?t:e,"fatal");o.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:r.default.join(n,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let u=o.__ptRootLogger;e.s(["createLogger",0,e=>{let t=u.child({module:e});return t.level=s[e]??i,t}])},44014,e=>{"use strict";let t,r;var a=e.i(666680);e.s(["nanoid",0,function(e=21){var n;n=e|=0,!t||t.length<n?(t=Buffer.allocUnsafe(128*n),a.webcrypto.getRandomValues(t),r=0):r+n>t.length&&(a.webcrypto.getRandomValues(t),r=0),r+=n;let i="";for(let a=r-e;a<r;a++)i+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[a]];return i}],44014)},459015,544538,e=>{"use strict";var t=e.i(233405),r=e.i(924868),a=e.i(224361),n=e.i(814747),i=e.i(44014),s=e.i(25146);process.platform;let l="linux"===process.platform;e.s(["isLinux",0,l],544538);let o=(0,s.createLogger)("terminal"),u=(0,a.promisify)(t.execFile),c="purple",p=n.default.join(process.env.__PMUX_APP_DIR_UNPACKED||process.env.__PMUX_APP_DIR||process.cwd(),"src","config","tmux.conf"),d={...process.env},m=new Set(["AUTH_PASSWORD","NEXTAUTH_SECRET","PORT"]),h=()=>Object.fromEntries(Object.entries(d).filter(([e])=>!e.startsWith("npm_")&&!e.startsWith("NODE_")&&!m.has(e))),f=async()=>{try{let{stdout:e}=await u("tmux",["-L",c,"ls","-F","#{session_name}"],{timeout:5e3});return e.trim().split("\n").map(e=>e.trim()).filter(e=>e.startsWith("pt-"))}catch{return[]}},w=async(e,t,r,a)=>{let n=process.env.SHELL||"/bin/zsh";await u("tmux",["-u","-L",c,"-f",p,"new-session","-d","-s",e,"-x",String(t),"-y",String(r)],{timeout:5e3,env:{...h(),SHELL:n,TERM:"xterm-256color",COLORTERM:"truecolor"},cwd:a||process.env.HOME||"/"}),await E(),o.debug(`tmux session created: ${e} (cols: ${t}, rows: ${r})`)},g=e=>new Promise(t=>setTimeout(t,e)),y=async e=>{if(!await x(e))return;o.debug(`killSession start: ${e}`);let t=await b(e);if(t)try{o.debug(`SIGTERM → process group ${t}: ${e}`),process.kill(-t,"SIGTERM")}catch{}try{await u("tmux",["-L",c,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<5;t++){if(!await x(e))return void o.debug(`killSession done (SIGTERM): ${e}`);await g(200)}if(o.warn(`session survived SIGTERM, escalating to SIGKILL: ${e}`),t)try{o.debug(`SIGKILL → process group ${t}: ${e}`),process.kill(-t,"SIGKILL")}catch{}try{await u("tmux",["-L",c,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<3;t++){if(!await x(e))return void o.debug(`killSession done (SIGKILL): ${e}`);await g(200)}o.warn(`tmux session still alive after kill: ${e}`)},x=async e=>{try{return await u("tmux",["-L",c,"has-session","-t",e],{timeout:5e3}),!0}catch{return!1}},S=async()=>{},v=async()=>{await S();let e=await f();e.length>0&&e.forEach(e=>{o.debug(`existing tmux session found: ${e}`)})},L=async e=>{if(l)try{return await r.default.readlink(`/proc/${e}/cwd`)}catch{return null}try{let{stdout:t}=await u("lsof",["-a","-p",String(e),"-d","cwd","-Fn"],{timeout:5e3}),r=t.split("\n").find(e=>e.startsWith("n/"));return r?r.slice(1):null}catch{return null}},_=async e=>{let t=await b(e);if(t){let e=await L(t);if(e)return e}try{let{stdout:t}=await u("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_current_path}"],{timeout:5e3});return t.trim()||null}catch{return null}},b=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_pid}"],{timeout:5e3}),r=parseInt(t.trim(),10);return Number.isNaN(r)?null:r}catch{return null}},E=async()=>{try{await u("tmux",["-L",c,"source-file",p],{timeout:5e3})}catch{}},P=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"list-panes","-t",e,"-F","#{pane_current_command}"],{timeout:5e3});return t.trim()||null}catch{return null}},$=async()=>{try{let{stdout:e}=await u("tmux",["-L",c,"list-panes","-a","-F","#{session_name} #{pane_current_command} #{pane_current_path} #{pane_pid} #{window_activity}"],{timeout:5e3}),t=new Map;for(let r of e.trim().split("\n")){if(!r)continue;let[e,a,n,i,s]=r.split(" ");if(e&&a){let r=parseInt(i,10),l=parseInt(s,10);t.set(e,{command:a,path:n||"",pid:Number.isNaN(r)?0:r,windowActivity:Number.isNaN(l)?0:l})}}return t}catch{return new Map}},I=new Set(["bash","zsh","fish","sh","dash"]),R=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_title}"],{timeout:5e3});return t.trim()||null}catch{return null}},N=async e=>{await u("tmux",["-L",c,"copy-mode","-q","-t",e],{timeout:5e3}).catch(()=>{})},k=async(e,t)=>{await N(e),await u("tmux",["-L",c,"send-keys","-t",e,t,"Enter"],{timeout:5e3})},C=async(e,t)=>{await N(e),await u("tmux",["-L",c,"send-keys","-t",e,t],{timeout:5e3})},M=async(e,t)=>{await N(e),await u("tmux",["-L",c,"send-keys","-t",e,"-l",`\x1b[200~${t}\x1b[201~`],{timeout:5e3}),await u("tmux",["-L",c,"send-keys","-t",e,"Enter"],{timeout:5e3}),await new Promise(e=>setTimeout(e,600)),await u("tmux",["-L",c,"send-keys","-t",e,"Enter"],{timeout:5e3})},q=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_current_path} #{pane_current_command} #{pane_pid} #{pane_width} #{pane_height} #{session_created}"],{timeout:5e3}),[r,a,n,i,s,l]=t.trim().split(" ");return{cwd:r||null,command:a||null,pid:n&&parseInt(n,10)||null,width:i&&parseInt(i,10)||null,height:s&&parseInt(s,10)||null,sessionCreated:l&&parseInt(l,10)||null}}catch{return{cwd:null,command:null,pid:null,width:null,height:null,sessionCreated:null}}},T=new Set(["node","python","python3","ruby","perl","deno","bun"]),A=async()=>{try{await u("tmux",["-L",c,"kill-server"],{timeout:5e3}),o.debug("tmux server killed")}catch{}},j=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"capture-pane","-p","-t",e],{timeout:5e3});return t}catch{return null}},D=async(e,t)=>{try{let{stdout:r}=await u("tmux",["-L",c,"capture-pane","-p","-S",`-${t}`,"-t",e],{timeout:5e3});return r}catch{return null}},G=async e=>{if(l){let t=[];return await Promise.all(e.map(async e=>{try{for(let a of(await r.default.readFile(`/proc/${e}/task/${e}/children`,"utf-8")).trim().split(/\s+/)){let e=parseInt(a,10);Number.isNaN(e)||t.push(e)}}catch{}})),t}try{let{stdout:t}=await u("pgrep",["-P",e.join(",")],{timeout:5e3});return t.trim().split("\n").map(e=>parseInt(e,10)).filter(e=>!Number.isNaN(e))}catch{return[]}},H=async e=>{let t=[],r=[e];for(;r.length>0;){let e=await G(r);if(0===e.length)break;t.push(...e),r=e}return t},O=async e=>{try{let t=new Set(e),{stdout:r}=await u("ss",["-tlnp"],{timeout:5e3}),a=new Set;for(let e of r.split("\n")){let r=e.match(/pid=(\d+)/g);if(!r||!r.some(e=>t.has(parseInt(e.replace("pid=",""),10))))continue;let n=e.match(/:(\d+)\s/);n&&a.add(parseInt(n[1],10))}return[...a].sort((e,t)=>e-t)}catch{return[]}},F=async e=>{let t=await H(e);if(0===t.length)return[];if(l)return O(t);try{let{stdout:e}=await u("lsof",["-a","-p",t.join(","),"-i","-sTCP:LISTEN","-P","-Fn"],{timeout:5e3}),r=new Set;for(let t of e.split("\n"))if(t.startsWith("n")){let e=t.match(/:(\d+)$/);e&&r.add(parseInt(e[1],10))}return[...r].sort((e,t)=>e-t)}catch{return[]}},U=async e=>{let t=await b(e);if(!t)return null;try{let{stdout:e}=await u("pgrep",["-n","-P",String(t)],{timeout:5e3}),r=e.trim();if(!r)return null;let{stdout:a}=await u("ps",["-o","args=","-p",r],{timeout:5e3}),i=a.trim();if(!i)return null;let s=i.split(/\s+/);if(0===s.length)return i;if(s[0]=n.default.basename(s[0]),T.has(s[0])&&s.length>1){let e=n.default.basename(s[1]).replace(/\.(c|m)?js$/,"");s.splice(0,2,e)}return s.join(" ")}catch{return null}};e.s(["SAFE_SHELLS",0,I,"applyConfig",0,E,"capturePaneContent",0,j,"capturePaneContentWithHistory",0,D,"createSession",0,w,"defaultSessionName",0,()=>`pt-${(0,i.nanoid)(6)}-${(0,i.nanoid)(6)}-${(0,i.nanoid)(6)}`,"exitCopyMode",0,N,"getAllPanesInfo",0,$,"getLastCommand",0,U,"getListeningPorts",0,F,"getPaneCurrentCommand",0,P,"getPaneDetailInfo",0,q,"getPaneTitle",0,R,"getSessionCwd",0,_,"getSessionPanePid",0,b,"hasSession",0,x,"killServer",0,A,"killSession",0,y,"listSessions",0,f,"sanitizedEnv",0,h,"scanSessions",0,v,"sendBracketedPaste",0,M,"sendKeys",0,k,"sendRawKeys",0,C,"workspaceSessionName",0,(e,t,r)=>`pt-${e}-${t}-${r}`],459015)},422392,e=>{"use strict";let t=new Map,r=6e4;e.s(["getCached",0,e=>{let r=t.get(e);return r?Date.now()>r.expiresAt?(t.delete(e),null):r.data:null},"setCached",0,(e,a,n=r)=>{t.set(e,{data:a,expiresAt:Date.now()+n})}])},740670,e=>{"use strict";var t=e.i(926747),r=e.i(190406),a=e.i(244898),n=e.i(262950),i=e.i(233405),s=e.i(224361),l=e.i(459015),o=e.i(422392);let u=(0,s.promisify)(i.execFile),c=async e=>{let t=await (0,l.getSessionCwd)(e);if(!t)throw Error("tmux-session-not-found");let r=`git-branch:${t}`,a=(0,o.getCached)(r);if(null!==a)return a;try{let{stdout:e}=await u("git",["-C",t,"rev-parse","--abbrev-ref","HEAD"],{timeout:5e3}),a=e.trim()||null;return(0,o.setCached)(r,a,15e3),a}catch(e){if(128===e.code)return(0,o.setCached)(r,null,15e3),null;throw e}},p=(0,e.i(25146).createLogger)("git"),d=async(e,t)=>{if("GET"!==e.method)return t.setHeader("Allow","GET"),t.status(405).json({error:"Method not allowed"});let r=e.query.tmuxSession;if(!r)return t.status(400).json({error:"missing-param",message:"tmuxSession parameter required"});try{let e=await c(r);return t.status(200).json({branch:e})}catch(r){let e=r instanceof Error?r.message:String(r);if("tmux-session-not-found"===e)return t.status(404).json({error:"tmux-session-not-found"});return p.error(`branch query failed: ${e}`),t.status(500).json({error:"git-error"})}};e.s(["default",0,d],612542);var m=e.i(612542),h=e.i(7031),f=e.i(181927),w=e.i(846432);let g=(0,n.hoist)(m,"default"),y=(0,n.hoist)(m,"config"),x=new a.PagesAPIRouteModule({definition:{kind:r.RouteKind.PAGES_API,page:"/api/git/branch",pathname:"/api/git/branch",bundlePath:"",filename:""},userland:m,distDir:".next",relativeProjectDir:""});async function S(e,r,a){a.requestMeta&&(0,w.setRequestMeta)(e,a.requestMeta),x.isDev&&(0,w.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/git/branch";n=n.replace(/\/index$/,"")||"/";let i=await x.prepare(e,r,{srcPage:n});if(!i){r.statusCode=400,r.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve());return}let{query:s,params:l,prerenderManifest:o,routerServerContext:u}=i;try{let t,a=e.method||"GET",i=(0,h.getTracer)(),c=i.getActiveScopeSpan(),p=!!(null==u?void 0:u.isWrappedByNextServer),d=x.instrumentationOnRequestError.bind(x),m=async c=>x.render(e,r,{query:{...s,...l},params:l,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:o.preview,propagateError:!1,dev:x.isDev,page:"/api/git/branch",internalRevalidate:null==u?void 0:u.revalidate,onError:(...t)=>d(e,...t)}).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":r.statusCode,"next.rsc":!1});let e=i.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==f.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=e.get("next.route");if(s){let e=`${a} ${s}`;c.setAttributes({"next.route":s,"http.route":s,"next.span_name":e}),c.updateName(e),t&&t!==c&&(t.setAttribute("http.route",s),t.updateName(e))}else c.updateName(`${a} ${n}`)});p&&c?await m(c):(t=i.getActiveScopeSpan(),await i.withPropagatedContext(e.headers,()=>i.trace(f.BaseServerSpan.handleRequest,{spanName:`${a} ${n}`,kind:h.SpanKind.SERVER,attributes:{"http.method":a,"http.target":e.url}},m),void 0,!p))}catch(e){if(x.isDev)throw e;(0,t.sendError)(r,500,"Internal Server Error")}finally{null==a.waitUntil||a.waitUntil.call(a,Promise.resolve())}}e.s(["config",0,y,"default",0,g,"handler",0,S],740670)}];
1
+ module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},924868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},130146,(e,t,r)=>{t.exports=e.x("pino-28069d5257187539",()=>require("pino-28069d5257187539"))},666680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},233405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},25146,e=>{"use strict";var t=e.i(130146),r=e.i(814747),a=e.i(446786);let n=r.default.join(a.default.homedir(),".purplemux","logs"),i=process.env.LOG_LEVEL||"info",s=(e=>{if(!e)return{};let t={};for(let r of e.split(",")){let[e,a]=r.split("=").map(e=>e.trim());e&&a&&(t[e]=a)}return t})(process.env.LOG_LEVELS),l=["trace","debug","info","warn","error","fatal"],o=globalThis;if(!o.__ptRootLogger){let e=[i,...Object.values(s)].reduce((e,t)=>l.indexOf(t)<l.indexOf(e)?t:e,"fatal");o.__ptRootLogger=(0,t.default)({level:e,transport:{targets:[{target:"pino-roll",level:e,options:{file:r.default.join(n,"purplemux"),frequency:"daily",dateFormat:"yyyy-MM-dd",limit:{count:7},mkdir:!0}},{target:"pino-pretty",level:e,options:{colorize:!0,ignore:"pid,hostname,module",translateTime:"HH:MM:ss",messageFormat:"[{module}] {msg}"}}]}})}let u=o.__ptRootLogger;e.s(["createLogger",0,e=>{let t=u.child({module:e});return t.level=s[e]??i,t}])},44014,e=>{"use strict";let t,r;var a=e.i(666680);e.s(["nanoid",0,function(e=21){var n;n=e|=0,!t||t.length<n?(t=Buffer.allocUnsafe(128*n),a.webcrypto.getRandomValues(t),r=0):r+n>t.length&&(a.webcrypto.getRandomValues(t),r=0),r+=n;let i="";for(let a=r-e;a<r;a++)i+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[a]];return i}],44014)},459015,544538,e=>{"use strict";var t=e.i(233405),r=e.i(924868),a=e.i(224361),n=e.i(814747),i=e.i(44014),s=e.i(25146);process.platform;let l="linux"===process.platform;e.s(["isLinux",0,l],544538);let o=(0,s.createLogger)("terminal"),u=(0,a.promisify)(t.execFile),c="purple",p=n.default.join(process.env.__PMUX_APP_DIR_UNPACKED||process.env.__PMUX_APP_DIR||process.cwd(),"src","config","tmux.conf"),d={...process.env},m=new Set(["AUTH_PASSWORD","NEXTAUTH_SECRET","PORT"]),h=()=>Object.fromEntries(Object.entries(d).filter(([e])=>!e.startsWith("npm_")&&!e.startsWith("NODE_")&&!m.has(e))),f=async()=>{try{let{stdout:e}=await u("tmux",["-L",c,"ls","-F","#{session_name}"],{timeout:5e3});return e.trim().split("\n").map(e=>e.trim()).filter(e=>e.startsWith("pt-"))}catch{return[]}},w=async(e,t,r,a)=>{let n=process.env.SHELL||"/bin/zsh";await u("tmux",["-u","-L",c,"-f",p,"new-session","-d","-s",e,"-x",String(t),"-y",String(r)],{timeout:5e3,env:{...h(),SHELL:n,TERM:"xterm-256color",COLORTERM:"truecolor"},cwd:a||process.env.HOME||"/"}),await E(),o.debug(`tmux session created: ${e} (cols: ${t}, rows: ${r})`)},g=e=>new Promise(t=>setTimeout(t,e)),y=async e=>{if(!await x(e))return;o.debug(`killSession start: ${e}`);let t=await b(e);if(t)try{o.debug(`SIGTERM → process group ${t}: ${e}`),process.kill(-t,"SIGTERM")}catch{}try{await u("tmux",["-L",c,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<5;t++){if(!await x(e))return void o.debug(`killSession done (SIGTERM): ${e}`);await g(200)}if(o.warn(`session survived SIGTERM, escalating to SIGKILL: ${e}`),t)try{o.debug(`SIGKILL → process group ${t}: ${e}`),process.kill(-t,"SIGKILL")}catch{}try{await u("tmux",["-L",c,"kill-session","-t",e],{timeout:5e3})}catch{}for(let t=0;t<3;t++){if(!await x(e))return void o.debug(`killSession done (SIGKILL): ${e}`);await g(200)}o.warn(`tmux session still alive after kill: ${e}`)},x=async e=>{try{return await u("tmux",["-L",c,"has-session","-t",e],{timeout:5e3}),!0}catch{return!1}},S=async()=>{},v=async()=>{await S();let e=await f();e.length>0&&e.forEach(e=>{o.debug(`existing tmux session found: ${e}`)})},L=async e=>{if(l)try{return await r.default.readlink(`/proc/${e}/cwd`)}catch{return null}try{let{stdout:t}=await u("lsof",["-a","-p",String(e),"-d","cwd","-Fn"],{timeout:5e3}),r=t.split("\n").find(e=>e.startsWith("n/"));return r?r.slice(1):null}catch{return null}},_=async e=>{let t=await b(e);if(t){let e=await L(t);if(e)return e}try{let{stdout:t}=await u("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_current_path}"],{timeout:5e3});return t.trim()||null}catch{return null}},b=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_pid}"],{timeout:5e3}),r=parseInt(t.trim(),10);return Number.isNaN(r)?null:r}catch{return null}},E=async()=>{try{await u("tmux",["-L",c,"source-file",p],{timeout:5e3})}catch{}},P=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"list-panes","-t",e,"-F","#{pane_current_command}"],{timeout:5e3});return t.trim()||null}catch{return null}},$=async()=>{try{let{stdout:e}=await u("tmux",["-L",c,"list-panes","-a","-F","#{session_name} #{pane_current_command} #{pane_current_path} #{pane_pid} #{window_activity}"],{timeout:5e3}),t=new Map;for(let r of e.trim().split("\n")){if(!r)continue;let[e,a,n,i,s]=r.split(" ");if(e&&a){let r=parseInt(i,10),l=parseInt(s,10);t.set(e,{command:a,path:n||"",pid:Number.isNaN(r)?0:r,windowActivity:Number.isNaN(l)?0:l})}}return t}catch{return new Map}},I=new Set(["bash","zsh","fish","sh","dash"]),R=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_title}"],{timeout:5e3});return t.trim()||null}catch{return null}},N=async e=>{await u("tmux",["-L",c,"copy-mode","-q","-t",e],{timeout:5e3}).catch(()=>{})},k=async(e,t)=>{await N(e),await u("tmux",["-L",c,"send-keys","-t",e,t,"Enter"],{timeout:5e3})},C=async(e,t)=>{await N(e),await u("tmux",["-L",c,"send-keys","-t",e,t],{timeout:5e3})},M=async(e,t)=>{await N(e),await u("tmux",["-L",c,"send-keys","-t",e,"-l",`\x1b[200~${t}\x1b[201~`],{timeout:5e3}),await u("tmux",["-L",c,"send-keys","-t",e,"Enter"],{timeout:5e3}),await new Promise(e=>setTimeout(e,600)),await u("tmux",["-L",c,"send-keys","-t",e,"Enter"],{timeout:5e3})},q=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"display-message","-p","-t",e,"#{pane_current_path} #{pane_current_command} #{pane_pid} #{pane_width} #{pane_height} #{session_created}"],{timeout:5e3}),[r,a,n,i,s,l]=t.trim().split(" ");return{cwd:r||null,command:a||null,pid:n&&parseInt(n,10)||null,width:i&&parseInt(i,10)||null,height:s&&parseInt(s,10)||null,sessionCreated:l&&parseInt(l,10)||null}}catch{return{cwd:null,command:null,pid:null,width:null,height:null,sessionCreated:null}}},T=new Set(["node","python","python3","ruby","perl","deno","bun"]),A=async()=>{try{await u("tmux",["-L",c,"kill-server"],{timeout:5e3}),o.debug("tmux server killed")}catch{}},j=async e=>{try{let{stdout:t}=await u("tmux",["-L",c,"capture-pane","-p","-t",e],{timeout:5e3});return t}catch{return null}},D=async(e,t)=>{try{let{stdout:r}=await u("tmux",["-L",c,"capture-pane","-p","-S",`-${t}`,"-t",e],{timeout:5e3});return r}catch{return null}},G=async e=>{if(l){let t=[];return await Promise.all(e.map(async e=>{try{for(let a of(await r.default.readFile(`/proc/${e}/task/${e}/children`,"utf-8")).trim().split(/\s+/)){let e=parseInt(a,10);Number.isNaN(e)||t.push(e)}}catch{}})),t}try{let{stdout:t}=await u("pgrep",["-P",e.join(",")],{timeout:5e3});return t.trim().split("\n").map(e=>parseInt(e,10)).filter(e=>!Number.isNaN(e))}catch{return[]}},H=async e=>{let t=[],r=[e];for(;r.length>0;){let e=await G(r);if(0===e.length)break;t.push(...e),r=e}return t},O=async e=>{try{let t=new Set(e),{stdout:r}=await u("ss",["-tlnp"],{timeout:5e3}),a=new Set;for(let e of r.split("\n")){let r=e.match(/pid=(\d+)/g);if(!r||!r.some(e=>t.has(parseInt(e.replace("pid=",""),10))))continue;let n=e.match(/:(\d+)\s/);n&&a.add(parseInt(n[1],10))}return[...a].sort((e,t)=>e-t)}catch{return[]}},F=async e=>{let t=await H(e);if(0===t.length)return[];if(l)return O(t);try{let{stdout:e}=await u("lsof",["-a","-p",t.join(","),"-i","-sTCP:LISTEN","-P","-Fn"],{timeout:5e3}),r=new Set;for(let t of e.split("\n"))if(t.startsWith("n")){let e=t.match(/:(\d+)$/);e&&r.add(parseInt(e[1],10))}return[...r].sort((e,t)=>e-t)}catch{return[]}},U=async e=>{let t=await b(e);if(!t)return null;try{let{stdout:e}=await u("pgrep",["-n","-P",String(t)],{timeout:5e3}),r=e.trim();if(!r)return null;let{stdout:a}=await u("ps",["-o","args=","-p",r],{timeout:5e3}),i=a.trim();if(!i)return null;let s=i.split(/\s+/);if(0===s.length)return i;if(s[0]=n.default.basename(s[0]),T.has(s[0])&&s.length>1){let e=n.default.basename(s[1]).replace(/\.(c|m)?js$/,"");s.splice(0,2,e)}return s.join(" ")}catch{return null}};e.s(["SAFE_SHELLS",0,I,"applyConfig",0,E,"capturePaneContent",0,j,"capturePaneContentWithHistory",0,D,"createSession",0,w,"defaultSessionName",0,()=>`pt-${(0,i.nanoid)(6)}-${(0,i.nanoid)(6)}-${(0,i.nanoid)(6)}`,"exitCopyMode",0,N,"getAllPanesInfo",0,$,"getLastCommand",0,U,"getListeningPorts",0,F,"getPaneCurrentCommand",0,P,"getPaneDetailInfo",0,q,"getPaneTitle",0,R,"getSessionCwd",0,_,"getSessionPanePid",0,b,"hasSession",0,x,"killServer",0,A,"killSession",0,y,"listSessions",0,f,"sanitizedEnv",0,h,"scanSessions",0,v,"sendBracketedPaste",0,M,"sendKeys",0,k,"sendRawKeys",0,C,"workspaceSessionName",0,(e,t,r)=>`pt-${e}-${t}-${r}`],459015)},422392,e=>{"use strict";let t=new Map,r=6e4;e.s(["getCached",0,e=>{let r=t.get(e);return r?Date.now()>r.expiresAt?(t.delete(e),null):r.data:null},"setCached",0,(e,a,n=r)=>{t.set(e,{data:a,expiresAt:Date.now()+n})}])},740670,e=>{"use strict";var t=e.i(926747),r=e.i(190406),a=e.i(244898),n=e.i(262950),i=e.i(233405),s=e.i(224361),l=e.i(459015),o=e.i(422392);let u=(0,s.promisify)(i.execFile),c=async e=>{let t=await (0,l.getSessionCwd)(e);if(!t)throw Error("tmux-session-not-found");let r=`git-branch:${t}`,a=(0,o.getCached)(r);if(null!==a)return a;try{let{stdout:e}=await u("git",["-C",t,"rev-parse","--abbrev-ref","HEAD"],{timeout:5e3}),a=e.trim()||null;return(0,o.setCached)(r,a,15e3),a}catch(e){if(128===e.code)return(0,o.setCached)(r,null,15e3),null;throw e}},p=(0,e.i(25146).createLogger)("git"),d=async(e,t)=>{if("GET"!==e.method)return t.setHeader("Allow","GET"),t.status(405).json({error:"Method not allowed"});let r=e.query.tmuxSession;if(!r)return t.status(400).json({error:"missing-param",message:"tmuxSession parameter required"});try{let e=await c(r);return t.status(200).json({branch:e})}catch(r){let e=r instanceof Error?r.message:String(r);if("tmux-session-not-found"===e)return t.status(404).json({error:"tmux-session-not-found"});return p.error(`branch query failed: ${e}`),t.status(500).json({error:"git-error"})}};e.s(["default",0,d],612542);var m=e.i(612542),h=e.i(7031),f=e.i(181927),w=e.i(846432);let g=(0,n.hoist)(m,"default"),y=(0,n.hoist)(m,"config"),x=new a.PagesAPIRouteModule({definition:{kind:r.RouteKind.PAGES_API,page:"/api/git/branch",pathname:"/api/git/branch",bundlePath:"",filename:""},userland:m,distDir:".next",relativeProjectDir:""});async function S(e,r,a){a.requestMeta&&(0,w.setRequestMeta)(e,a.requestMeta),x.isDev&&(0,w.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/git/branch";n=n.replace(/\/index$/,"")||"/";let i=await x.prepare(e,r,{srcPage:n});if(!i){r.statusCode=400,r.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve());return}let{query:s,params:l,prerenderManifest:o,routerServerContext:u}=i;try{let t,a=e.method||"GET",i=(0,h.getTracer)(),c=i.getActiveScopeSpan(),p=!!(null==u?void 0:u.isWrappedByNextServer),d=x.instrumentationOnRequestError.bind(x),m=async c=>x.render(e,r,{query:{...s,...l},params:l,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:o.preview,propagateError:!1,dev:x.isDev,page:"/api/git/branch",internalRevalidate:null==u?void 0:u.revalidate,onError:(...t)=>d(e,...t)}).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":r.statusCode,"next.rsc":!1});let e=i.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==f.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=e.get("next.route");if(s){let e=`${a} ${s}`;c.setAttributes({"next.route":s,"http.route":s,"next.span_name":e}),c.updateName(e),t&&t!==c&&(t.setAttribute("http.route",s),t.updateName(e))}else c.updateName(`${a} ${n}`)});p&&c?await m(c):(t=i.getActiveScopeSpan(),await i.withPropagatedContext(e.headers,()=>i.trace(f.BaseServerSpan.handleRequest,{spanName:`${a} ${n}`,kind:h.SpanKind.SERVER,attributes:{"http.method":a,"http.target":e.url}},m),void 0,!p))}catch(e){if(x.isDev)throw e;(0,t.sendError)(r,500,"Internal Server Error")}finally{null==a.waitUntil||a.waitUntil.call(a,Promise.resolve())}}e.s(["config",0,y,"default",0,g,"handler",0,S],740670)}];
2
2
 
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0wvse.i._.js.map
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__004og4w._.js.map