tower-studio 0.2.44 → 0.2.46

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 (587) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +6 -0
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/routes-manifest.json +38 -0
  6. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +3 -3
  15. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +133 -85
  16. package/.next/standalone/.next/server/app/_not-found/page.js +8 -9
  17. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/api/adapters/test/route.js +2 -2
  20. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js +1 -1
  23. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/git/route.js +1 -1
  25. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js +2 -3
  30. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +2 -2
  32. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/internal/assistant/route.js +5 -4
  34. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +1 -1
  36. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +3 -4
  38. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js +1 -1
  40. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/internal/harness/ask/route/app-paths-manifest.json +3 -0
  42. package/.next/standalone/.next/server/app/api/internal/harness/ask/route/build-manifest.json +9 -0
  43. package/.next/standalone/.next/server/app/api/internal/harness/ask/route/server-reference-manifest.json +4 -0
  44. package/.next/standalone/.next/server/app/api/internal/harness/ask/route.js +7 -0
  45. package/.next/standalone/.next/server/app/api/internal/harness/ask/route.js.nft.json +1 -0
  46. package/.next/standalone/.next/server/app/api/internal/harness/ask/route_client-reference-manifest.js +3 -0
  47. package/.next/standalone/.next/server/app/api/internal/harness/notify/route/app-paths-manifest.json +3 -0
  48. package/.next/standalone/.next/server/app/api/internal/harness/notify/route/build-manifest.json +9 -0
  49. package/.next/standalone/.next/server/app/api/internal/harness/notify/route/server-reference-manifest.json +4 -0
  50. package/.next/standalone/.next/server/app/api/internal/harness/notify/route.js +7 -0
  51. package/.next/standalone/.next/server/app/api/internal/harness/notify/route.js.nft.json +1 -0
  52. package/.next/standalone/.next/server/app/api/internal/harness/notify/route_client-reference-manifest.js +3 -0
  53. package/.next/standalone/.next/server/app/api/internal/harness/pending/route/app-paths-manifest.json +3 -0
  54. package/.next/standalone/.next/server/app/api/internal/harness/pending/route/build-manifest.json +9 -0
  55. package/.next/standalone/.next/server/app/api/internal/harness/pending/route/server-reference-manifest.json +4 -0
  56. package/.next/standalone/.next/server/app/api/internal/harness/pending/route.js +7 -0
  57. package/.next/standalone/.next/server/app/api/internal/harness/pending/route.js.nft.json +1 -0
  58. package/.next/standalone/.next/server/app/api/internal/harness/pending/route_client-reference-manifest.js +3 -0
  59. package/.next/standalone/.next/server/app/api/internal/harness/reply/route/app-paths-manifest.json +3 -0
  60. package/.next/standalone/.next/server/app/api/internal/harness/reply/route/build-manifest.json +9 -0
  61. package/.next/standalone/.next/server/app/api/internal/harness/reply/route/server-reference-manifest.json +4 -0
  62. package/.next/standalone/.next/server/app/api/internal/harness/reply/route.js +12 -0
  63. package/.next/standalone/.next/server/app/api/internal/harness/reply/route.js.nft.json +1 -0
  64. package/.next/standalone/.next/server/app/api/internal/harness/reply/route_client-reference-manifest.js +3 -0
  65. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js +1 -1
  66. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js +1 -1
  68. package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js.nft.json +1 -1
  69. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js +3 -3
  70. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +2 -2
  72. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js +1 -1
  74. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js +1 -1
  76. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js +1 -1
  78. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js +1 -1
  80. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js +5 -4
  82. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +6 -5
  84. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  85. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js +5 -4
  86. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js.nft.json +1 -1
  87. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js +2 -2
  88. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  89. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js +2 -2
  90. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +5 -3
  92. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/harness/page/app-paths-manifest.json +3 -0
  94. package/.next/standalone/.next/server/app/harness/page/build-manifest.json +18 -0
  95. package/.next/standalone/.next/server/app/harness/page/next-font-manifest.json +11 -0
  96. package/.next/standalone/.next/server/app/harness/page/react-loadable-manifest.json +18 -0
  97. package/.next/standalone/.next/server/app/harness/page/server-reference-manifest.json +437 -0
  98. package/.next/standalone/.next/server/app/harness/page.js +24 -0
  99. package/.next/standalone/.next/server/app/harness/page.js.nft.json +1 -0
  100. package/.next/standalone/.next/server/app/harness/page_client-reference-manifest.js +3 -0
  101. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +3 -2
  102. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +244 -160
  103. package/.next/standalone/.next/server/app/missions/page.js +11 -11
  104. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +3 -3
  107. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +133 -85
  108. package/.next/standalone/.next/server/app/onboarding/page.js +8 -9
  109. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  110. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +3 -3
  112. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +133 -85
  113. package/.next/standalone/.next/server/app/page.js +8 -9
  114. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  115. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +3 -3
  117. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +260 -140
  118. package/.next/standalone/.next/server/app/settings/page.js +10 -11
  119. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  120. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +3 -3
  122. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +284 -248
  123. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +9 -10
  124. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  125. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +3 -3
  127. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +247 -211
  128. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +9 -10
  129. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  130. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/app-paths-manifest.json +3 -0
  132. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/build-manifest.json +18 -0
  133. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/next-font-manifest.json +11 -0
  134. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/react-loadable-manifest.json +18 -0
  135. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/server-reference-manifest.json +401 -0
  136. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js +24 -0
  137. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js.nft.json +1 -0
  138. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page_client-reference-manifest.js +3 -0
  139. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +3 -3
  140. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +222 -186
  141. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +9 -10
  142. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  143. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +3 -3
  145. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +257 -209
  146. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +10 -11
  147. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +3 -3
  150. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +133 -85
  151. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +9 -10
  152. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  153. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +3 -3
  155. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +219 -171
  156. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +9 -10
  157. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  159. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +4 -4
  160. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +269 -221
  161. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +11 -12
  162. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  163. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  164. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +3 -3
  165. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +169 -133
  166. package/.next/standalone/.next/server/app/workspaces/page.js +8 -9
  167. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  168. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  169. package/.next/standalone/.next/server/app-paths-manifest.json +6 -0
  170. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_09ikw5j.js +5 -0
  171. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +9 -5
  172. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +1 -1
  173. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-1~xqo._.js +3 -0
  174. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0lvlooo._.js → [root-of-the-server]__0-kboke._.js} +1 -1
  175. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.3n3t.._.js +3 -0
  176. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.wsvr6._.js +4 -0
  177. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.yf1mx._.js +3 -0
  178. package/.next/standalone/.next/server/chunks/[root-of-the-server]__00xe-t8._.js +3 -0
  179. package/.next/standalone/.next/server/chunks/[root-of-the-server]__02r7j6y._.js +3 -0
  180. package/.next/standalone/.next/server/chunks/[root-of-the-server]__02yvm55._.js +3 -0
  181. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__09arklv._.js → [root-of-the-server]__04-ty51._.js} +2 -2
  182. package/.next/standalone/.next/server/chunks/[root-of-the-server]__065hi6e._.js +3 -0
  183. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06iuq17._.js +3 -0
  184. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06x1zwj._.js +28 -0
  185. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06~wmlx._.js +3 -0
  186. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08-bq72._.js +3 -0
  187. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08clp-r._.js +3 -0
  188. package/.next/standalone/.next/server/chunks/[root-of-the-server]__092475e._.js +3 -0
  189. package/.next/standalone/.next/server/chunks/[root-of-the-server]__095t6ga._.js +3 -0
  190. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_7_w.g._.js +3 -0
  191. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0atap--._.js +3 -0
  192. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c3je91._.js +3 -0
  193. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dz.knv._.js +3 -0
  194. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ehwsa1._.js +4 -0
  195. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esywxf._.js +3 -0
  196. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fd9z.r._.js +30 -0
  197. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gbyryz._.js +3 -0
  198. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gcg7i.._.js +3 -0
  199. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iyp~.k._.js +2 -2
  200. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0khq-k0._.js +3 -0
  201. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kkrbn-._.js +4 -0
  202. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l1-djp._.js +1 -1
  203. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0m8t3vi._.js +3 -0
  204. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nt7c0f._.js +3 -0
  205. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nv83.p._.js +4 -0
  206. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pr~t0y._.js +3 -0
  207. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qcpe0l._.js +3 -0
  208. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qfcg6k._.js +3 -0
  209. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sq5irw._.js +3 -0
  210. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0squ613._.js +3 -0
  211. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u8tl88._.js +28 -0
  212. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wjr-72._.js +3 -0
  213. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wugb-9._.js +3 -0
  214. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yeg1kp._.js +4 -0
  215. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zchqv1._.js +43 -0
  216. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zcy11y._.js +3 -0
  217. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~1-i5h._.js +3 -0
  218. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~ju4-d._.js +1 -1
  219. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10aw_67._.js +3 -0
  220. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10ci~o9._.js +3 -0
  221. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10qclz-._.js +3 -0
  222. package/.next/standalone/.next/server/chunks/[root-of-the-server]__12fmxq0._.js +3 -0
  223. package/.next/standalone/.next/server/chunks/[root-of-the-server]__136ty69._.js +3 -0
  224. package/.next/standalone/.next/server/chunks/_02hac5p._.js +30 -0
  225. package/.next/standalone/.next/server/chunks/_0_w835g._.js +4 -0
  226. package/.next/standalone/.next/server/chunks/_0je3dz2._.js +30 -0
  227. package/.next/standalone/.next/server/chunks/_0tidm8l._.js +30 -0
  228. package/.next/standalone/.next/server/chunks/_0zok2an._.js +30 -0
  229. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_ask_route_actions_0_c62hg.js +3 -0
  230. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_notify_route_actions_08hof6m.js +3 -0
  231. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_pending_route_actions_0w9t_9m.js +3 -0
  232. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_reply_route_actions_0qatz~a.js +3 -0
  233. package/.next/standalone/.next/server/chunks/src_05balzk._.js +3 -0
  234. package/.next/standalone/.next/server/chunks/src_0aygchu._.js +3 -0
  235. package/.next/standalone/.next/server/chunks/src_0gif-f5._.js +3 -0
  236. package/.next/standalone/.next/server/chunks/src_0pg9w-x._.js +3 -0
  237. package/.next/standalone/.next/server/chunks/src_0vp6.co._.js +3 -0
  238. package/.next/standalone/.next/server/chunks/src_11k6i~l._.js +3 -0
  239. package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +8 -2
  240. package/.next/standalone/.next/server/chunks/src_lib_02llcit._.js +1 -1
  241. package/.next/standalone/.next/server/chunks/src_lib_0aowbzy._.js +1 -1
  242. package/.next/standalone/.next/server/chunks/src_lib_0d~1~wz._.js +3 -0
  243. package/.next/standalone/.next/server/chunks/src_lib_0ylel_1._.js +3 -0
  244. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  245. package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
  246. package/.next/standalone/.next/server/chunks/src_lib_config-defaults_ts_10ayktg._.js +3 -0
  247. package/.next/standalone/.next/server/chunks/src_lib_config-reader_ts_0e5f7vk._.js +3 -0
  248. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  249. package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_0i5qmqd._.js +1 -1
  250. package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_esm_build_templates_app-page_04~dhws.js +4 -0
  251. package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_esm_build_templates_app-page_0fro4ex.js +4 -0
  252. package/.next/standalone/.next/server/chunks/ssr/0ws9_lucide-react_dist_esm_icons_0gv_cwy._.js +3 -0
  253. package/.next/standalone/.next/server/chunks/ssr/12k._sonner_dist_index_mjs_0-vmpk5._.js +3 -0
  254. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-geq20._.js +3 -0
  255. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.0m12b._.js +30 -0
  256. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00qzvly._.js +43 -0
  257. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01bz3_g._.js +3 -0
  258. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~hdzx._.js +3 -0
  259. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06sew6r._.js +43 -0
  260. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07rk6ic._.js +30 -0
  261. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090y_.y._.js +3 -0
  262. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b.ej5q._.js +1 -1
  263. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b6fbjv._.js +30 -0
  264. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b6hugs._.js +43 -0
  265. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0br5e7w._.js +43 -0
  266. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bx_h2u._.js +4 -0
  267. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dhq_gl._.js +30 -0
  268. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e79g0v._.js +3 -0
  269. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0esg88l._.js +30 -0
  270. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h_pt4a._.js +3 -0
  271. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hzwoy5._.js +30 -0
  272. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0idkp76._.js +3 -0
  273. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4m.1s._.js +3 -0
  274. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  275. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kmonje._.js +3 -0
  276. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kqp70x._.js +30 -0
  277. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l0~scn._.js +1 -1
  278. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lh3mlq._.js +3 -0
  279. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0m8m7vc._.js +30 -0
  280. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0muf4wq._.js +49 -0
  281. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n02kfa._.js +30 -0
  282. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n3uc.v._.js +3 -0
  283. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o5ohqy._.js +47 -0
  284. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s_q09t._.js +30 -0
  285. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s~4y3y._.js +1 -1
  286. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s~ak20._.js +3 -0
  287. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta_mpj._.js +30 -0
  288. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0trmndk._.js +30 -0
  289. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u3~-.g._.js +30 -0
  290. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vyl8to._.js +3 -0
  291. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ws0_c1._.js +3 -0
  292. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x7br99._.js +3 -0
  293. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xnuz05._.js +5 -0
  294. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ynq8ty._.js +3 -0
  295. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zsnp~d._.js +5 -0
  296. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~edc3d._.js +30 -0
  297. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~mhv4m._.js +3 -0
  298. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1013v_g._.js +47 -0
  299. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11fp64w._.js +3 -0
  300. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmn-._.js +30 -0
  301. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_z5hke._.js → [root-of-the-server]__12viys4._.js} +2 -2
  302. package/.next/standalone/.next/server/chunks/ssr/_0-5.hgb._.js +3 -0
  303. package/.next/standalone/.next/server/chunks/ssr/{_0dye20y._.js → _0-wp_zu._.js} +2 -2
  304. package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
  305. package/.next/standalone/.next/server/chunks/ssr/_0..h3hk._.js +3 -0
  306. package/.next/standalone/.next/server/chunks/ssr/{_08bq4g8._.js → _00_h2nx._.js} +2 -2
  307. package/.next/standalone/.next/server/chunks/ssr/_02p-udo._.js +3 -0
  308. package/.next/standalone/.next/server/chunks/ssr/_05~lqg-._.js +4 -0
  309. package/.next/standalone/.next/server/chunks/ssr/_0771b4a._.js +47 -0
  310. package/.next/standalone/.next/server/chunks/ssr/{_113957g._.js → _0ak77.u._.js} +3 -3
  311. package/.next/standalone/.next/server/chunks/ssr/{_11osha9._.js → _0ami9yt._.js} +2 -2
  312. package/.next/standalone/.next/server/chunks/ssr/{_0r4_qn~._.js → _0awn2mm._.js} +2 -2
  313. package/.next/standalone/.next/server/chunks/ssr/{_07lq-bp._.js → _0b660g4._.js} +1 -1
  314. package/.next/standalone/.next/server/chunks/ssr/{_0j5.ig_._.js → _0czsddm._.js} +1 -1
  315. package/.next/standalone/.next/server/chunks/ssr/_0fmko25._.js +3 -0
  316. package/.next/standalone/.next/server/chunks/ssr/{_0_nhdgs._.js → _0gomvsp._.js} +2 -2
  317. package/.next/standalone/.next/server/chunks/ssr/_0g~p9_x._.js +3 -0
  318. package/.next/standalone/.next/server/chunks/ssr/_0hg~.4w._.js +6 -0
  319. package/.next/standalone/.next/server/chunks/ssr/_0hsuip_._.js +3 -0
  320. package/.next/standalone/.next/server/chunks/ssr/{_0zr81mw._.js → _0hx2o_8._.js} +2 -2
  321. package/.next/standalone/.next/server/chunks/ssr/{_0s.ik0k._.js → _0j7m~u6._.js} +1 -1
  322. package/.next/standalone/.next/server/chunks/ssr/{_08-x_rp._.js → _0l6byg1._.js} +1 -1
  323. package/.next/standalone/.next/server/chunks/ssr/{_0i4xdso._.js → _0mmy~98._.js} +2 -2
  324. package/.next/standalone/.next/server/chunks/ssr/_0nrxhfb._.js +47 -0
  325. package/.next/standalone/.next/server/chunks/ssr/{_02vz78l._.js → _0o_c3b2._.js} +2 -2
  326. package/.next/standalone/.next/server/chunks/ssr/_0os43sb._.js +3 -0
  327. package/.next/standalone/.next/server/chunks/ssr/{_0nze-e6._.js → _0p5ft59._.js} +1 -1
  328. package/.next/standalone/.next/server/chunks/ssr/_0q2pep_._.js +3 -0
  329. package/.next/standalone/.next/server/chunks/ssr/{_060e1u.._.js → _0snv7nt._.js} +1 -1
  330. package/.next/standalone/.next/server/chunks/ssr/_0ty4xe6._.js +43 -0
  331. package/.next/standalone/.next/server/chunks/ssr/_0vkl7.h._.js +47 -0
  332. package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
  333. package/.next/standalone/.next/server/chunks/ssr/_0x09t_o._.js +47 -0
  334. package/.next/standalone/.next/server/chunks/ssr/_0z5~opf._.js +3 -0
  335. package/.next/standalone/.next/server/chunks/ssr/_0zn.4bi._.js +47 -0
  336. package/.next/standalone/.next/server/chunks/ssr/_1086w4p._.js +47 -0
  337. package/.next/standalone/.next/server/chunks/ssr/_10q2mbe._.js +17 -0
  338. package/.next/standalone/.next/server/chunks/ssr/_11.knhq._.js +3 -0
  339. package/.next/standalone/.next/server/chunks/ssr/_1118hto._.js +43 -0
  340. package/.next/standalone/.next/server/chunks/ssr/{_0rtydyv._.js → _12s8n8g._.js} +1 -1
  341. package/.next/standalone/.next/server/chunks/ssr/src_11j0qlp._.js +3 -0
  342. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +8 -2
  343. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  344. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  345. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  346. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  347. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  348. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  349. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
  350. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  351. package/.next/standalone/.next/server/chunks/ssr/src_components_0rowjw~._.js +7 -0
  352. package/.next/standalone/.next/server/chunks/ssr/{src_lib_00wjv6n._.js → src_lib_04nzvfd._.js} +1 -1
  353. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0.~.oo-._.js → src_lib_0_px2pz._.js} +2 -2
  354. package/.next/standalone/.next/server/chunks/ssr/src_lib_0a.zy31._.js +3 -0
  355. package/.next/standalone/.next/server/chunks/ssr/src_lib_0b73q0a._.js +3 -0
  356. package/.next/standalone/.next/server/chunks/ssr/src_lib_0cld9rt._.js +3 -0
  357. package/.next/standalone/.next/server/chunks/ssr/{src_lib_005uqbe._.js → src_lib_0dbf2qa._.js} +1 -1
  358. package/.next/standalone/.next/server/chunks/ssr/src_lib_0er7rzd._.js +3 -0
  359. package/.next/standalone/.next/server/chunks/ssr/src_lib_0f0v8_~._.js +3 -0
  360. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fr6fzy._.js +3 -0
  361. package/.next/standalone/.next/server/chunks/ssr/{src_lib_01sr8_t._.js → src_lib_0h2u7a0._.js} +1 -1
  362. package/.next/standalone/.next/server/chunks/ssr/src_lib_0k04rl3._.js +3 -0
  363. package/.next/standalone/.next/server/chunks/ssr/src_lib_0lpxsj~._.js +3 -0
  364. package/.next/standalone/.next/server/chunks/ssr/src_lib_0sq6aqm._.js +3 -0
  365. package/.next/standalone/.next/server/chunks/ssr/src_lib_0ui-~7g._.js +3 -0
  366. package/.next/standalone/.next/server/chunks/ssr/src_lib_0y5zzg-._.js +3 -0
  367. package/.next/standalone/.next/server/chunks/ssr/src_lib_0z-gn78._.js +3 -0
  368. package/.next/standalone/.next/server/chunks/ssr/src_lib_13c4a4g._.js +3 -0
  369. package/.next/standalone/.next/server/chunks/ssr/src_lib_harness_harness-message_ts_0_3ygf9._.js +3 -0
  370. package/.next/standalone/.next/server/chunks/ssr/src_lib_pty_11~ojr2._.js +3 -0
  371. package/.next/standalone/.next/server/chunks/ssr/src_lib_pty_orphan-reaper_ts_0a0qmlo._.js +3 -0
  372. package/.next/standalone/.next/server/chunks/ssr/{_0ng0eku._.js → src_lib_schemas_ts_0ph~1ak._.js} +3 -3
  373. package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
  374. package/.next/standalone/.next/server/functions-config-manifest.json +6 -0
  375. package/.next/standalone/.next/server/instrumentation.js +1 -1
  376. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  377. package/.next/standalone/.next/server/next-font-manifest.js +1 -1
  378. package/.next/standalone/.next/server/next-font-manifest.json +8 -0
  379. package/.next/standalone/.next/server/pages/500.html +1 -1
  380. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  381. package/.next/standalone/.next/server/server-reference-manifest.json +2368 -1528
  382. package/.next/standalone/.next/static/chunks/0-kkc.ibted8y.js +1 -0
  383. package/.next/standalone/.next/static/chunks/{0xejm4ge9~cn..js → 0.2y9uc38xso-.js} +1 -1
  384. package/.next/standalone/.next/static/chunks/{0346xrw6i2bwo.js → 0.gedys.tq.~k.js} +1 -1
  385. package/.next/standalone/.next/static/chunks/00g58.es_hxli.js +1 -0
  386. package/.next/standalone/.next/static/chunks/00o_eiv12t~.1.js +1 -0
  387. package/.next/standalone/.next/static/chunks/01qtgj0xv1fsm.js +2 -0
  388. package/.next/standalone/.next/static/chunks/024euw7po0d0w.js +1 -0
  389. package/.next/standalone/.next/static/chunks/02v-9v~885t9c.js +1 -0
  390. package/.next/standalone/.next/static/chunks/03ct4d8znb7tp.js +1 -0
  391. package/.next/standalone/.next/static/chunks/03uix~1ru.ovv.js +1 -0
  392. package/.next/standalone/.next/static/chunks/04.2m8l~ws19v.js +1 -0
  393. package/.next/standalone/.next/static/chunks/06x7oq8_iu~9d.js +1 -0
  394. package/.next/standalone/.next/static/chunks/07c4b1kp_85qg.js +1 -0
  395. package/.next/standalone/.next/static/chunks/07qijq9o5jccu.js +1 -0
  396. package/.next/standalone/.next/static/chunks/{0uj-3ckujwaiy.js → 09om2gfwimh7k.js} +1 -1
  397. package/.next/standalone/.next/static/chunks/0alhq.h4~iogi.js +1 -0
  398. package/.next/standalone/.next/static/chunks/{0rcuiuax31_uh.js → 0cf7e1scao3zk.js} +1 -1
  399. package/.next/standalone/.next/static/chunks/0ck~sr0nkabl~.js +1 -0
  400. package/.next/standalone/.next/static/chunks/0d1ok-v-u-xe~.js +1 -0
  401. package/.next/standalone/.next/static/chunks/0d9u2xspag~4h.js +5 -0
  402. package/.next/standalone/.next/static/chunks/0ftptcpntzaux.js +1 -0
  403. package/.next/standalone/.next/static/chunks/0gk~m5bwgoafi.js +1 -0
  404. package/.next/standalone/.next/static/chunks/0in_7s8n4lmfr.js +1 -0
  405. package/.next/standalone/.next/static/chunks/0ix28r65.7o_r.js +12 -0
  406. package/.next/standalone/.next/static/chunks/0j5olwb~d3~3j.js +1 -0
  407. package/.next/standalone/.next/static/chunks/0mtrtl-jl46in.js +2 -0
  408. package/.next/standalone/.next/static/chunks/0ov_akpudbv96.js +5 -0
  409. package/.next/standalone/.next/static/chunks/0oyskd~8~j.j7.js +1 -0
  410. package/.next/standalone/.next/static/chunks/0q1872yhybt55.js +1 -0
  411. package/.next/standalone/.next/static/chunks/0seo-lerjdkbn.js +1 -0
  412. package/.next/standalone/.next/static/chunks/0t1awv68pnn-e.js +1 -0
  413. package/.next/standalone/.next/static/chunks/0wl8cpmvyhv0l.js +1 -0
  414. package/.next/standalone/.next/static/chunks/0~2l3wz-gxs2j.js +1 -0
  415. package/.next/standalone/.next/static/chunks/0~7h_a_dofg-4.js +1 -0
  416. package/.next/standalone/.next/static/chunks/11yhe31en~dvt.js +1 -0
  417. package/.next/standalone/.next/static/chunks/12-mlz2vukuga.js +1 -0
  418. package/.next/standalone/.next/static/chunks/14fch6~swodjf.css +1 -0
  419. package/.next/standalone/.next/static/chunks/15gztq9f12uhe.js +1 -0
  420. package/.next/standalone/.next/static/chunks/15ue90qe1sh-9.js +1 -0
  421. package/.next/standalone/.next/static/chunks/17z9uivez~kp3.js +1 -0
  422. package/.next/standalone/package.json +5 -6
  423. package/dist/mcp-server.cjs +1597 -4545
  424. package/package.json +5 -6
  425. package/prisma/schema.prisma +83 -5
  426. package/scripts/migrations/0005-add-parent-task-id.ts +29 -0
  427. package/scripts/migrations/0006-project-knowledge.ts +58 -0
  428. package/scripts/migrations/0007-product-group.ts +67 -0
  429. package/scripts/{stop-hook.js → tower-stop-hook.js} +42 -3
  430. package/skills/tower/SKILL.md +36 -75
  431. package/skills/tower/references/task-source.md +80 -0
  432. package/skills/tower/references/unattended-messaging.md +95 -0
  433. package/tsconfig.json +14 -4
  434. package/.next/standalone/.next/server/chunks/[externals]__0x_wqa7._.js +0 -3
  435. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.p6em~._.js +0 -3
  436. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.zmhk-._.js +0 -3
  437. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0042hx5._.js +0 -3
  438. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03ufxqq._.js +0 -28
  439. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04--bs7._.js +0 -3
  440. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04m2l8a._.js +0 -3
  441. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04r193~._.js +0 -3
  442. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0657y50._.js +0 -3
  443. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06ndn7a._.js +0 -4
  444. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08yqoti._.js +0 -3
  445. package/.next/standalone/.next/server/chunks/[root-of-the-server]__098.3z2._.js +0 -3
  446. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_d.s7s._.js +0 -28
  447. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_zfnj0._.js +0 -20
  448. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clptds._.js +0 -3
  449. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g.k9o~._.js +0 -3
  450. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i34gbs._.js +0 -4
  451. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iggiij._.js +0 -3
  452. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i~3dwq._.js +0 -3
  453. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j05vlm._.js +0 -3
  454. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j1px8f._.js +0 -3
  455. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k-5ag7._.js +0 -3
  456. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0otyifi._.js +0 -3
  457. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pl.c5.._.js +0 -3
  458. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0r~9.7c._.js +0 -4
  459. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t31ba_._.js +0 -3
  460. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t_weyi._.js +0 -3
  461. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uptkzd._.js +0 -4
  462. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0x3kws1._.js +0 -3
  463. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y8w5di._.js +0 -4
  464. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zi3~a8._.js +0 -3
  465. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~g6-c~._.js +0 -3
  466. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10fv6tt._.js +0 -3
  467. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1189rd1._.js +0 -4
  468. package/.next/standalone/.next/server/chunks/_0jmdgq~._.js +0 -7
  469. package/.next/standalone/.next/server/chunks/_0q10iet._.js +0 -7
  470. package/.next/standalone/.next/server/chunks/_0qk_esg._.js +0 -4
  471. package/.next/standalone/.next/server/chunks/_0t31z6q._.js +0 -5
  472. package/.next/standalone/.next/server/chunks/_12537g8._.js +0 -7
  473. package/.next/standalone/.next/server/chunks/src_0fq3zjg._.js +0 -3
  474. package/.next/standalone/.next/server/chunks/src_0weytpz._.js +0 -3
  475. package/.next/standalone/.next/server/chunks/src_0wlyw0g._.js +0 -3
  476. package/.next/standalone/.next/server/chunks/src_0~ey84y._.js +0 -3
  477. package/.next/standalone/.next/server/chunks/src_lib_0i2.v2d._.js +0 -3
  478. package/.next/standalone/.next/server/chunks/src_lib_0nw5n~t._.js +0 -3
  479. package/.next/standalone/.next/server/chunks/src_lib_12xey8u._.js +0 -3
  480. package/.next/standalone/.next/server/chunks/ssr/0ws9_lucide-react_dist_esm_icons_0pkla8j._.js +0 -3
  481. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00ebsjb._.js +0 -30
  482. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01fmnse._.js +0 -3
  483. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01vm_46._.js +0 -47
  484. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__025ol9g._.js +0 -3
  485. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__049n47u._.js +0 -3
  486. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04ednzb._.js +0 -43
  487. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +0 -3
  488. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +0 -3
  489. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06dfcgo._.js +0 -30
  490. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07xkj1s._.js +0 -47
  491. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__081e5n~._.js +0 -3
  492. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08tzbfh._.js +0 -3
  493. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ecd_1d._.js +0 -47
  494. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0iln7n_._.js +0 -47
  495. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j_-qk5._.js +0 -30
  496. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k6oo0n._.js +0 -43
  497. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lws68d._.js +0 -47
  498. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mpjat-._.js +0 -3
  499. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oamph.._.js +0 -47
  500. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pnv7nd._.js +0 -30
  501. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tja~wz._.js +0 -30
  502. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ug022w._.js +0 -30
  503. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ugledi._.js +0 -3
  504. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vxlsec._.js +0 -4
  505. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w0.sdz._.js +0 -3
  506. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x6k.ee._.js +0 -30
  507. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xwzk2.._.js +0 -47
  508. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yby8pl._.js +0 -47
  509. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +0 -5
  510. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zxc81t._.js +0 -30
  511. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zzqn5z._.js +0 -43
  512. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10c.a3u._.js +0 -30
  513. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10n3vn6._.js +0 -30
  514. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmyb._.js +0 -30
  515. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__124zb~p._.js +0 -30
  516. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__127w3bm._.js +0 -43
  517. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13ce7v2._.js +0 -30
  518. package/.next/standalone/.next/server/chunks/ssr/_04~mjmb._.js +0 -3
  519. package/.next/standalone/.next/server/chunks/ssr/_05a2u03._.js +0 -47
  520. package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +0 -6
  521. package/.next/standalone/.next/server/chunks/ssr/_07q06~v._.js +0 -47
  522. package/.next/standalone/.next/server/chunks/ssr/_0_q41~z._.js +0 -47
  523. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +0 -7
  524. package/.next/standalone/.next/server/chunks/ssr/_0dxbp89._.js +0 -47
  525. package/.next/standalone/.next/server/chunks/ssr/_0foto06._.js +0 -3
  526. package/.next/standalone/.next/server/chunks/ssr/_0kojxno._.js +0 -3
  527. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +0 -3
  528. package/.next/standalone/.next/server/chunks/ssr/_0rxeqmo._.js +0 -17
  529. package/.next/standalone/.next/server/chunks/ssr/_0s.h4l2._.js +0 -43
  530. package/.next/standalone/.next/server/chunks/ssr/_0u3yt.5._.js +0 -4
  531. package/.next/standalone/.next/server/chunks/ssr/_0wqcz3w._.js +0 -47
  532. package/.next/standalone/.next/server/chunks/ssr/_0ye1-r-._.js +0 -3
  533. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_03r.9go._.js +0 -3
  534. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_06f0dao._.js +0 -3
  535. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +0 -3
  536. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +0 -3
  537. package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +0 -3
  538. package/.next/standalone/.next/server/chunks/ssr/src_lib_08jql1e._.js +0 -3
  539. package/.next/standalone/.next/server/chunks/ssr/src_lib_0b~j-9d._.js +0 -3
  540. package/.next/standalone/.next/server/chunks/ssr/src_lib_0eymyjf._.js +0 -3
  541. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fkv9z3._.js +0 -3
  542. package/.next/standalone/.next/server/chunks/ssr/src_lib_0n-n0.a._.js +0 -3
  543. package/.next/standalone/.next/server/chunks/ssr/src_lib_0sgt~lv._.js +0 -3
  544. package/.next/standalone/.next/server/chunks/ssr/src_lib_0sms4xl._.js +0 -5
  545. package/.next/standalone/.next/server/chunks/ssr/src_lib_0x-iyl1._.js +0 -3
  546. package/.next/standalone/.next/server/chunks/ssr/src_lib_0yjmty1._.js +0 -3
  547. package/.next/standalone/.next/server/chunks/ssr/src_lib_13aevv6._.js +0 -3
  548. package/.next/standalone/.next/static/chunks/0-tuek2jqf0el.js +0 -1
  549. package/.next/standalone/.next/static/chunks/0.-.jc~0b~hy0.js +0 -1
  550. package/.next/standalone/.next/static/chunks/0.lqb7y9kz5z6.js +0 -1
  551. package/.next/standalone/.next/static/chunks/0.nsmn6shzidu.js +0 -2
  552. package/.next/standalone/.next/static/chunks/0.~03w.uxge40.js +0 -1
  553. package/.next/standalone/.next/static/chunks/01hdj_kw4z2zq.js +0 -2
  554. package/.next/standalone/.next/static/chunks/01j9m895w64zn.js +0 -1
  555. package/.next/standalone/.next/static/chunks/01yoibobkdz3x.js +0 -1
  556. package/.next/standalone/.next/static/chunks/041o.dh2lc-k3.js +0 -1
  557. package/.next/standalone/.next/static/chunks/07i9j5yyg4vs3.js +0 -1
  558. package/.next/standalone/.next/static/chunks/08ooaq~-.8fzu.js +0 -1
  559. package/.next/standalone/.next/static/chunks/0bylodlncwfpb.js +0 -5
  560. package/.next/standalone/.next/static/chunks/0clewc5ifaruu.js +0 -12
  561. package/.next/standalone/.next/static/chunks/0cpwtqzrjdgvs.js +0 -1
  562. package/.next/standalone/.next/static/chunks/0c~e1-nst-ze-.js +0 -1
  563. package/.next/standalone/.next/static/chunks/0ddt-snh45031.js +0 -1
  564. package/.next/standalone/.next/static/chunks/0dv4anj-j523o.js +0 -1
  565. package/.next/standalone/.next/static/chunks/0gf~0e3xpa0fj.js +0 -5
  566. package/.next/standalone/.next/static/chunks/0gvfb.b8m_i8t.js +0 -1
  567. package/.next/standalone/.next/static/chunks/0h77-u2vvr-a1.js +0 -1
  568. package/.next/standalone/.next/static/chunks/0jrje~1gt6w85.css +0 -1
  569. package/.next/standalone/.next/static/chunks/0lqp~-dlfenad.js +0 -1
  570. package/.next/standalone/.next/static/chunks/0p4w5b_p_yju8.js +0 -1
  571. package/.next/standalone/.next/static/chunks/0qkr26yz3bocs.js +0 -1
  572. package/.next/standalone/.next/static/chunks/0uf~7eqel0zra.js +0 -1
  573. package/.next/standalone/.next/static/chunks/0w71r_sj_fibx.js +0 -1
  574. package/.next/standalone/.next/static/chunks/0xg6rcq6g4bbh.js +0 -1
  575. package/.next/standalone/.next/static/chunks/0yff8rwmrl5m4.js +0 -1
  576. package/.next/standalone/.next/static/chunks/0ymipmkk2uqby.js +0 -1
  577. package/.next/standalone/.next/static/chunks/0znfclapbniaa.js +0 -1
  578. package/.next/standalone/.next/static/chunks/11pe3kpxuj33f.js +0 -1
  579. package/.next/standalone/.next/static/chunks/172s9cg35qt7i.js +0 -1
  580. package/.next/standalone/.next/static/chunks/17m4o~gdsvuo3.js +0 -1
  581. package/.next/standalone/.next/static/chunks/184-zu89wwa4u.js +0 -1
  582. package/next.config.ts +0 -18
  583. /package/.next/standalone/.next/static/{dinNvsaC6aoPK_B7ZTeBv → Pf_z-PYy0CJhvcyPEi-LM}/_buildManifest.js +0 -0
  584. /package/.next/standalone/.next/static/{dinNvsaC6aoPK_B7ZTeBv → Pf_z-PYy0CJhvcyPEi-LM}/_clientMiddlewareManifest.js +0 -0
  585. /package/.next/standalone/.next/static/{dinNvsaC6aoPK_B7ZTeBv → Pf_z-PYy0CJhvcyPEi-LM}/_ssgManifest.js +0 -0
  586. /package/scripts/{post-tool-hook.js → tower-post-tool-hook.js} +0 -0
  587. /package/scripts/{session-start-hook.js → tower-session-start-hook.js} +0 -0
@@ -1,4 +0,0 @@
1
- module.exports=[750227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},902157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},933919,(e,t,r)=>{t.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},522734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},912714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},980738,(e,t,r)=>{t.exports=e.x("node-pty-c710df912a232c01",()=>require("node-pty-c710df912a232c01"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},433541,e=>e.a(async(t,r)=>{try{let t=await e.y("ws-4df7fc762dfa9a52");e.n(t),r()}catch(e){r(e)}},!0),504446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},666680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},687769,(e,t,r)=>{t.exports=e.x("node:events",()=>require("node:events"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},899871,(e,t,r)=>{t.exports=e.x("node:string_decoder",()=>require("node:string_decoder"))},449719,(e,t,r)=>{t.exports=e.x("assert",()=>require("assert"))},500874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},406461,(e,t,r)=>{t.exports=e.x("zlib",()=>require("zlib"))},57328,(e,t,r)=>{t.exports=e.x("node:assert",()=>require("node:assert"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},198840,e=>{"use strict";var t=e.i(855104);let r=["localhost","127.0.0.1","[::1]"],a=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),n=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let n=e.headers.get("x-forwarded-for");if(n&&!n.split(",").map(e=>e.trim()).every(e=>a.has(e)))return t.NextResponse.json({error:"Forbidden"},{status:403});let s=e.headers.get("host")??"";return r.some(e=>s.startsWith(e))?null:t.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return n.test(e)?null:t.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return n.test(e)?null:t.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},192520,e=>{"use strict";let t;var r=e.i(750227),a=e.i(660526),n=e.i(902157);function s(){return t||(t=process.env.TOWER_DATA_DIR||(0,r.join)((0,a.homedir)(),".tower"),(0,n.existsSync)(t)||(0,n.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,r.join)(s(),"assistant");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,r.join)(s(),"backups");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,r.join)(s(),"extensions");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,n.readFileSync)((0,r.join)(s(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,r.join)(s(),"storage");return(0,n.existsSync)(t)||(0,n.mkdirSync)(t,{recursive:!0}),t},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,a.homedir)(),".tower");return(0,r.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,r.join)((e=(0,r.join)(s(),"database"),(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,s])},843793,e=>{"use strict";var t=e.i(933919),r=e.i(192520);let a=globalThis.prisma??new t.PrismaClient({datasourceUrl:`file:${(0,r.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{a.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{a.$disconnect().catch(()=>{})}),e.s(["db",0,a])},572173,e=>{"use strict";var t=e.i(843793);async function r(e,r){let a=await t.db.systemConfig.findUnique({where:{key:e}});if(!a)return r;try{return JSON.parse(a.value)}catch{return r}}e.s(["readConfigValue",0,r])},482819,(e,t,r)=>{"use strict";t.exports=e.r(583981).vendored["react-rsc"].ReactServerDOMTurbopackServer},921675,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"registerServerReference",{enumerable:!0,get:function(){return a.registerServerReference}});let a=e.r(482819)},86708,(e,t,r)=>{"use strict";function a(e){for(let t=0;t<e.length;t++){let r=e[t];if("function"!=typeof r)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof r}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ensureServerEntryExports",{enumerable:!0,get:function(){return a}})},658053,e=>{"use strict";e.s(["ASSISTANT_SESSION_KEY",0,"__assistant__"])},276534,e=>{"use strict";e.s(["CONFIG_DEFAULTS",0,{"git.pathMappingRules":{defaultValue:[],type:"object",label:"Git Path Mapping Rules"},"system.maxUploadBytes":{defaultValue:0x3200000,type:"number",label:"Max Upload Size (bytes)"},"system.maxConcurrentExecutions":{defaultValue:20,type:"number",label:"Max Concurrent Executions"},"system.maxReadableFileBytes":{defaultValue:5242880,type:"number",label:"Max Readable File Size (bytes)"},"system.backupDir":{defaultValue:"",type:"string",label:"Backup Directory"},"git.timeoutSec":{defaultValue:30,type:"number",label:"Git Operation Timeout (seconds)"},"search.resultLimit":{defaultValue:20,type:"number",label:"Search Result Limit"},"search.allModeCap":{defaultValue:5,type:"number",label:"All-Mode Per-Type Cap"},"search.debounceMs":{defaultValue:250,type:"number",label:"Search Debounce (ms)"},"search.snippetLength":{defaultValue:80,type:"number",label:"Snippet Length (characters)"},"search.codeTimeoutSec":{defaultValue:30,type:"number",label:"Code Search Timeout (seconds)"},"board.archiveDelayDays":{defaultValue:7,type:"number",label:"Archive Delay (days)"},"missions.grid.minCols":{defaultValue:1,type:"number",label:"Grid Min Columns"},"missions.grid.maxCols":{defaultValue:5,type:"number",label:"Grid Max Columns"},"missions.grid.minRows":{defaultValue:1,type:"number",label:"Grid Min Rows"},"missions.grid.maxRows":{defaultValue:5,type:"number",label:"Grid Max Rows"},"terminal.app":{defaultValue:"Terminal",type:"string",label:"Default Terminal App"},"editor.command":{defaultValue:"",type:"string",label:"Default Editor Command"},"terminal.wsPort":{defaultValue:3001,type:"number",label:"WebSocket Port"},"terminal.idleTimeoutSec":{defaultValue:180,type:"number",label:"Idle Timeout (seconds)"},"terminal.fontSize":{defaultValue:13,type:"number",label:"Terminal Font Size"},"terminal.fontFamily":{defaultValue:"Menlo, Monaco, 'Courier New', monospace",type:"string",label:"Terminal Font Family"},"assistant.systemPrompt":{defaultValue:'You are Tower Assistant — the built-in AI operator for the Tower task management platform.\n\n## Identity\n- You are a task management operator, NOT a coding assistant.\n- You can ONLY use Tower MCP tools. You CANNOT read files, edit code, run shell commands, or search the web.\n- Always respond in the same language the user uses.\n\n## Capabilities\nWhen users ask what you can do, respond with EXACTLY these 6 groups. Translate to the user\'s language.\n\n1. **Workspace & Project** — View, create, update, delete workspaces and projects. Search projects and repositories.\n2. **Task Management** — Create tasks (priority, labels, worktree branch isolation, sub-path, auto-start). Move task status (TODO → IN_PROGRESS → IN_REVIEW → DONE / CANCELLED). Update task info and labels.\n3. **Execution Monitor** — Start task execution, check execution status, get terminal output, send commands to running terminals.\n4. **Daily Report & Todo** — Generate daily work summary (completed + in-progress). View pending task list sorted by priority.\n5. **Labels & Notes & Assets** — Manage workspace labels, project notes, and file attachments.\n6. **Global Search** — Search tasks, projects, repositories, notes, and assets by keyword.\n\nDo NOT list any capabilities beyond the above. Do NOT mention code editing, debugging, testing, git operations, or any development capabilities.\n\n## Scope Boundary\nIf the user asks you to write code, explain code, debug, search the web, read/write files, or anything outside Tower task management, reply:\n"抱歉,我只能帮你管理工作区、项目和任务。编码、调试等操作请在任务终端中完成。"',type:"string",label:"Assistant System Prompt"},"assistant.displayMode":{defaultValue:"sidebar",type:"string",label:"Assistant Display Mode"},"assistant.communicationMode":{defaultValue:"chat",type:"string",label:"Assistant Communication Mode"},"task.defaultUseWorktree":{defaultValue:!0,type:"boolean",label:"Default: Use Worktree"},"task.defaultAutoStart":{defaultValue:!1,type:"boolean",label:"Default: Auto-start Execution"},"task.mcpDefaultsConfigured":{defaultValue:!1,type:"boolean",label:"MCP Task Defaults Configured"}}])},519827,e=>{"use strict";e.s(["ARCHIVE_DELAY_KEY",0,"board.archiveDelayDays","DEFAULT_ARCHIVE_DELAY_DAYS",0,7,"normalizeArchiveDelayDays",0,function(e){let t=Math.floor(Number(e));return Number.isFinite(t)?Math.min(Math.max(t,1),365):7}])},61920,e=>{"use strict";var t=e.i(446786),r=e.i(814747);function a(e){return e.startsWith("~/")?r.default.join(t.default.homedir(),e.slice(2)):e}function n(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:s(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:s(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}function s(e){return e.replace(/\.git\/?$/,"")}e.s(["gitUrlToLocalPath",0,function(e){let t=e.trim();if(!t)return"";try{let e=n(t);if(!e)return"";let{host:s,pathSegments:i}=e;if("code.iflytek.com"===s){let e,t;return a((e=[...i],"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2)),((t=e.indexOf("-"))>0&&(e=e.slice(0,t)),0===e.length)?"":`~/company/${e.join("/")}`))}if("github.com"===s){var r;let e,t;return a((e=(r=i)[0],t=r[1],e&&t?`${"jp-liu"===e?"~/project/i":"~/project/f"}/${t}`:""))}let o=i[i.length-1];return o?a(`~/project/f/${o}`):""}catch{return""}},"matchGitPathRule",0,function(e,t){if(!t.length)return"";let r=e.trim();if(!r)return"";let s=n(r);if(!s)return"";let{host:i,pathSegments:o}=s,l=o[0]??"",u=o[o.length-1]??"",c=[...t].sort((e,t)=>{let r=+("*"===e.ownerMatch),a=+("*"===t.ownerMatch);return r!==a?r-a:e.priority-t.priority}),d=o.join("/");for(let e of c){if(e.host!==i||"*"!==e.ownerMatch&&e.ownerMatch!==l)continue;let t=e.localPathTemplate;if(t.includes("{path}"))return a(t.replace("{path}",d).replace("{owner}",l).replace("{repo}",u).replace(/\/+$/,""));let r=t.replace("{owner}",l).replace("{repo}","").replace(/\/+$/,"");return a(`${r}/${u}`)}return""}])},22569,e=>e.a(async(t,r)=>{try{var a=e.i(921675),n=e.i(843793),s=e.i(276534),i=e.i(519827),o=e.i(61920),l=e.i(769310),u=e.i(721390),c=e.i(86708),d=t([u]);async function p(e,t){let r=await n.db.systemConfig.findUnique({where:{key:e}});if(!r)return t;try{return JSON.parse(r.value)}catch{return t}}async function f(e,t){await n.db.systemConfig.upsert({where:{key:e},create:{key:e,value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}async function m(){let e=await p(i.ARCHIVE_DELAY_KEY,i.DEFAULT_ARCHIVE_DELAY_DAYS);return(0,i.normalizeArchiveDelayDays)(e)}async function b(e){let t=e.trim();if(!t)return{path:"",source:"empty"};try{let e=await p("git.pathMappingRules",[]),r=(0,o.matchGitPathRule)(t,e);if(r)return{path:r,source:"rule"};return{path:(0,o.gitUrlToLocalPath)(t),source:"fallback"}}catch{return{path:(0,o.gitUrlToLocalPath)(t),source:"fallback"}}}async function y(e){let{path:t}=await b(e);return t}async function h(e){let t=await n.db.systemConfig.findMany({where:{key:{in:e}}}),r=Object.fromEntries(t.map(e=>{try{return[e.key,JSON.parse(e.value)]}catch{return[e.key,null]}})),a={};for(let t of e)a[t]=t in r?r[t]:s.CONFIG_DEFAULTS[t]?.defaultValue??null;return a}async function x(){return(0,l.detectShells)()}async function g(){return(0,l.detectTerminalApps)()}async function S(){return(0,l.detectEditors)()}async function v(){return{platform:process.platform}}async function w(){let e=(0,u.getActiveWsPort)();if(null!==e)return e;let t=parseInt(process.env.PORT||"3000",10);return p("terminal.wsPort",t+1)}[u]=d.then?(await d)():d,(0,c.ensureServerEntryExports)([p,f,m,b,y,h,x,g,S,v,w]),(0,a.registerServerReference)(p,"60f9fcca9cc5ca10fc49386cabdc7854ab8435ad47",null),(0,a.registerServerReference)(f,"60e7655a5a8bc89fb0a12f0a9ed7be77e2c93394c8",null),(0,a.registerServerReference)(m,"00f66bbd58ea8fa3664e8a8eda1a9778b065fc6f77",null),(0,a.registerServerReference)(b,"40cd8986fe033e986fd37131f7586d8531eb9088e4",null),(0,a.registerServerReference)(y,"401b2f95e3cce5930ded602c9fd3e9e135e02a054d",null),(0,a.registerServerReference)(h,"403fb9aba477474068caa46d6c3fa942de05b4edb6",null),(0,a.registerServerReference)(x,"00ec78b4361bde323969d61a25f29d635c8b6168fb",null),(0,a.registerServerReference)(g,"00305fac2a0ec5e118c6215d6ff1ecd64b9030fcce",null),(0,a.registerServerReference)(S,"00bf89d6a861e75f676070da30fb1dfddeeb4791f2",null),(0,a.registerServerReference)(v,"007f5b03cd21f0213076bfdd693e82f325efb7e444",null),(0,a.registerServerReference)(w,"0034462e041760d222594debc480822d72dd44f371",null),e.s(["getConfigValue",0,p]),r()}catch(e){r(e)}},!1)];
3
-
4
- //# sourceMappingURL=%5Broot-of-the-server%5D__0uptkzd._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[874533,(e,r,t)=>{r.exports=e.x("node:child_process",()=>require("node:child_process"))},750227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},902157,(e,r,t)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,r,t)=>{r.exports=e.x("node:os",()=>require("node:os"))},933919,(e,r,t)=>{r.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},666680,(e,r,t)=>{r.exports=e.x("node:crypto",()=>require("node:crypto"))},193695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},918622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},324725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},198840,e=>{"use strict";var r=e.i(855104);let t=["localhost","127.0.0.1","[::1]"],s=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),n=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let n=e.headers.get("x-forwarded-for");if(n&&!n.split(",").map(e=>e.trim()).every(e=>s.has(e)))return r.NextResponse.json({error:"Forbidden"},{status:403});let i=e.headers.get("host")??"";return t.some(e=>i.startsWith(e))?null:r.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return n.test(e)?null:r.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return n.test(e)?null:r.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},192520,e=>{"use strict";let r;var t=e.i(750227),s=e.i(660526),n=e.i(902157);function i(){return r||(r=process.env.TOWER_DATA_DIR||(0,t.join)((0,s.homedir)(),".tower"),(0,n.existsSync)(r)||(0,n.mkdirSync)(r,{recursive:!0})),r}e.s(["getAssistantDir",0,function(){let e=(0,t.join)(i(),"assistant");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,t.join)(i(),"backups");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,t.join)(i(),"extensions");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,n.readFileSync)((0,t.join)(i(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),r=e&&e.length>0?e:(0,t.join)(i(),"storage");return(0,n.existsSync)(r)||(0,n.mkdirSync)(r,{recursive:!0}),r},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,t.join)((0,s.homedir)(),".tower");return(0,t.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,t.join)((e=(0,t.join)(i(),"database"),(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,i])},843793,e=>{"use strict";var r=e.i(933919),t=e.i(192520);let s=globalThis.prisma??new r.PrismaClient({datasourceUrl:`file:${(0,t.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{s.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{s.$disconnect().catch(()=>{})}),e.s(["db",0,s])},572173,e=>{"use strict";var r=e.i(843793);async function t(e,t){let s=await r.db.systemConfig.findUnique({where:{key:e}});if(!s)return t;try{return JSON.parse(s.value)}catch{return t}}e.s(["readConfigValue",0,t])},341291,e=>{"use strict";var r=e.i(666680),t=e.i(902157),s=e.i(750227),n=e.i(192520);function i(e){if(!e.startsWith((0,n.getStorageDir)()+s.sep))throw Error("Path traversal detected")}let a=new Set(["image","screenshot","img","photo","picture","clipboard","paste","untitled"]);e.s(["buildCacheFilename",0,function(e,t){let n=s.basename(e,s.extname(e)),i=r.randomUUID().replace(/-/g,"").slice(0,8),o=n.toLowerCase();if(!n||a.has(o)||/^screenshot[\s_\-]/i.test(n))return`tower_image-${i}${t}`;let c=n.replace(/[^\p{L}\p{N}]/gu,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"");return`${c||"file"}-${i}${t}`},"ensureAssetsDir",0,function(e){let r,a=(i(r=s.join((0,n.getStorageDir)(),"assets",e)),r);return t.mkdirSync(a,{recursive:!0}),a},"ensureCacheDir",0,function(e){let r,a=(i(r=s.join((0,n.getStorageDir)(),"cache",e)),r);return t.mkdirSync(a,{recursive:!0}),a},"getAssistantCacheDir",0,function(e="images"){let r=new Date,a=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}`,o=s.join((0,n.getStorageDir)(),"cache","assistant",a,e);return i(o),t.mkdirSync(o,{recursive:!0}),o},"getAssistantCacheRoot",0,function(){let e=s.join((0,n.getStorageDir)(),"cache","assistant");return i(e),e}])},634712,e=>{"use strict";let r=["jpg","jpeg","png","gif","webp"],t=["md","txt","json","csv"],s=[...r,...t].join("|"),n=RegExp(`^\\d{4}-\\d{2}/(images|files)/[^/]+\\.(${s})$`,"i");function i(e){let s=e.replace(/^\./,"").toLowerCase();return r.includes(s)?"image":t.includes(s)?"text":null}[...r.map(e=>`.${e}`),...t.map(e=>`.${e}`),"image/*"].join(","),e.s(["ALLOWED_TEXT_EXTS",0,t,"ATTACHMENT_SUBPATH_RE",0,n,"MAX_ATTACHMENTS",0,10,"classifyAttachmentExt",0,i,"classifyAttachmentSubPath",0,function(e){if(!n.test(e))return null;let r=e.lastIndexOf(".");return r<0?null:i(e.slice(r+1))}])},482848,e=>{e.v(e=>Promise.resolve().then(()=>e(874533)))},268548,e=>{e.v(r=>Promise.all(["server/chunks/[externals]_node_util_0xr.y7p._.js"].map(r=>e.l(r))).then(()=>r(812057)))},144264,e=>{e.v(r=>Promise.all(["server/chunks/[externals]_child_process_0pwkpv9._.js"].map(r=>e.l(r))).then(()=>r(233405)))},534777,e=>{e.v(r=>Promise.all(["server/chunks/[externals]_util_0wtvqkc._.js"].map(r=>e.l(r))).then(()=>r(224361)))},200628,e=>{e.v(e=>Promise.resolve().then(()=>e(769310)))},145135,e=>{e.v(r=>Promise.all(["server/chunks/[externals]__0o6dym7._.js","server/chunks/07-d_@anthropic-ai_claude-agent-sdk_sdk_mjs_0.721uk._.js"].map(r=>e.l(r))).then(()=>r(217040)))},979764,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0iyp~.k._.js"].map(r=>e.l(r))).then(()=>r(471552)))}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0x3kws1._.js.map
@@ -1,4 +0,0 @@
1
- module.exports=[666680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},912714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},980738,(e,t,r)=>{t.exports=e.x("node-pty-c710df912a232c01",()=>require("node-pty-c710df912a232c01"))},446786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},750227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},902157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},933919,(e,t,r)=>{t.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},433541,e=>e.a(async(t,r)=>{try{let t=await e.y("ws-4df7fc762dfa9a52");e.n(t),r()}catch(e){r(e)}},!0),504446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},198840,e=>{"use strict";var t=e.i(855104);let r=["localhost","127.0.0.1","[::1]"],a=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),n=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let n=e.headers.get("x-forwarded-for");if(n&&!n.split(",").map(e=>e.trim()).every(e=>a.has(e)))return t.NextResponse.json({error:"Forbidden"},{status:403});let s=e.headers.get("host")??"";return r.some(e=>s.startsWith(e))?null:t.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return n.test(e)?null:t.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return n.test(e)?null:t.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},192520,e=>{"use strict";let t;var r=e.i(750227),a=e.i(660526),n=e.i(902157);function s(){return t||(t=process.env.TOWER_DATA_DIR||(0,r.join)((0,a.homedir)(),".tower"),(0,n.existsSync)(t)||(0,n.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,r.join)(s(),"assistant");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,r.join)(s(),"backups");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,r.join)(s(),"extensions");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,n.readFileSync)((0,r.join)(s(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,r.join)(s(),"storage");return(0,n.existsSync)(t)||(0,n.mkdirSync)(t,{recursive:!0}),t},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,a.homedir)(),".tower");return(0,r.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,r.join)((e=(0,r.join)(s(),"database"),(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,s])},843793,e=>{"use strict";var t=e.i(933919),r=e.i(192520);let a=globalThis.prisma??new t.PrismaClient({datasourceUrl:`file:${(0,r.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{a.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{a.$disconnect().catch(()=>{})}),e.s(["db",0,a])},572173,e=>{"use strict";var t=e.i(843793);async function r(e,r){let a=await t.db.systemConfig.findUnique({where:{key:e}});if(!a)return r;try{return JSON.parse(a.value)}catch{return r}}e.s(["readConfigValue",0,r])},482819,(e,t,r)=>{"use strict";t.exports=e.r(583981).vendored["react-rsc"].ReactServerDOMTurbopackServer},921675,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"registerServerReference",{enumerable:!0,get:function(){return a.registerServerReference}});let a=e.r(482819)},86708,(e,t,r)=>{"use strict";function a(e){for(let t=0;t<e.length;t++){let r=e[t];if("function"!=typeof r)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof r}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ensureServerEntryExports",{enumerable:!0,get:function(){return a}})},658053,e=>{"use strict";e.s(["ASSISTANT_SESSION_KEY",0,"__assistant__"])},341291,e=>{"use strict";var t=e.i(666680),r=e.i(902157),a=e.i(750227),n=e.i(192520);function s(e){if(!e.startsWith((0,n.getStorageDir)()+a.sep))throw Error("Path traversal detected")}let i=new Set(["image","screenshot","img","photo","picture","clipboard","paste","untitled"]);e.s(["buildCacheFilename",0,function(e,r){let n=a.basename(e,a.extname(e)),s=t.randomUUID().replace(/-/g,"").slice(0,8),o=n.toLowerCase();if(!n||i.has(o)||/^screenshot[\s_\-]/i.test(n))return`tower_image-${s}${r}`;let l=n.replace(/[^\p{L}\p{N}]/gu,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"");return`${l||"file"}-${s}${r}`},"ensureAssetsDir",0,function(e){let t,i=(s(t=a.join((0,n.getStorageDir)(),"assets",e)),t);return r.mkdirSync(i,{recursive:!0}),i},"ensureCacheDir",0,function(e){let t,i=(s(t=a.join((0,n.getStorageDir)(),"cache",e)),t);return r.mkdirSync(i,{recursive:!0}),i},"getAssistantCacheDir",0,function(e="images"){let t=new Date,i=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}`,o=a.join((0,n.getStorageDir)(),"cache","assistant",i,e);return s(o),r.mkdirSync(o,{recursive:!0}),o},"getAssistantCacheRoot",0,function(){let e=a.join((0,n.getStorageDir)(),"cache","assistant");return s(e),e}])},634712,e=>{"use strict";let t=["jpg","jpeg","png","gif","webp"],r=["md","txt","json","csv"],a=[...t,...r].join("|"),n=RegExp(`^\\d{4}-\\d{2}/(images|files)/[^/]+\\.(${a})$`,"i");function s(e){let a=e.replace(/^\./,"").toLowerCase();return t.includes(a)?"image":r.includes(a)?"text":null}[...t.map(e=>`.${e}`),...r.map(e=>`.${e}`),"image/*"].join(","),e.s(["ALLOWED_TEXT_EXTS",0,r,"ATTACHMENT_SUBPATH_RE",0,n,"MAX_ATTACHMENTS",0,10,"classifyAttachmentExt",0,s,"classifyAttachmentSubPath",0,function(e){if(!n.test(e))return null;let t=e.lastIndexOf(".");return t<0?null:s(e.slice(t+1))}])},276534,e=>{"use strict";e.s(["CONFIG_DEFAULTS",0,{"git.pathMappingRules":{defaultValue:[],type:"object",label:"Git Path Mapping Rules"},"system.maxUploadBytes":{defaultValue:0x3200000,type:"number",label:"Max Upload Size (bytes)"},"system.maxConcurrentExecutions":{defaultValue:20,type:"number",label:"Max Concurrent Executions"},"system.maxReadableFileBytes":{defaultValue:5242880,type:"number",label:"Max Readable File Size (bytes)"},"system.backupDir":{defaultValue:"",type:"string",label:"Backup Directory"},"git.timeoutSec":{defaultValue:30,type:"number",label:"Git Operation Timeout (seconds)"},"search.resultLimit":{defaultValue:20,type:"number",label:"Search Result Limit"},"search.allModeCap":{defaultValue:5,type:"number",label:"All-Mode Per-Type Cap"},"search.debounceMs":{defaultValue:250,type:"number",label:"Search Debounce (ms)"},"search.snippetLength":{defaultValue:80,type:"number",label:"Snippet Length (characters)"},"search.codeTimeoutSec":{defaultValue:30,type:"number",label:"Code Search Timeout (seconds)"},"board.archiveDelayDays":{defaultValue:7,type:"number",label:"Archive Delay (days)"},"missions.grid.minCols":{defaultValue:1,type:"number",label:"Grid Min Columns"},"missions.grid.maxCols":{defaultValue:5,type:"number",label:"Grid Max Columns"},"missions.grid.minRows":{defaultValue:1,type:"number",label:"Grid Min Rows"},"missions.grid.maxRows":{defaultValue:5,type:"number",label:"Grid Max Rows"},"terminal.app":{defaultValue:"Terminal",type:"string",label:"Default Terminal App"},"editor.command":{defaultValue:"",type:"string",label:"Default Editor Command"},"terminal.wsPort":{defaultValue:3001,type:"number",label:"WebSocket Port"},"terminal.idleTimeoutSec":{defaultValue:180,type:"number",label:"Idle Timeout (seconds)"},"terminal.fontSize":{defaultValue:13,type:"number",label:"Terminal Font Size"},"terminal.fontFamily":{defaultValue:"Menlo, Monaco, 'Courier New', monospace",type:"string",label:"Terminal Font Family"},"assistant.systemPrompt":{defaultValue:'You are Tower Assistant — the built-in AI operator for the Tower task management platform.\n\n## Identity\n- You are a task management operator, NOT a coding assistant.\n- You can ONLY use Tower MCP tools. You CANNOT read files, edit code, run shell commands, or search the web.\n- Always respond in the same language the user uses.\n\n## Capabilities\nWhen users ask what you can do, respond with EXACTLY these 6 groups. Translate to the user\'s language.\n\n1. **Workspace & Project** — View, create, update, delete workspaces and projects. Search projects and repositories.\n2. **Task Management** — Create tasks (priority, labels, worktree branch isolation, sub-path, auto-start). Move task status (TODO → IN_PROGRESS → IN_REVIEW → DONE / CANCELLED). Update task info and labels.\n3. **Execution Monitor** — Start task execution, check execution status, get terminal output, send commands to running terminals.\n4. **Daily Report & Todo** — Generate daily work summary (completed + in-progress). View pending task list sorted by priority.\n5. **Labels & Notes & Assets** — Manage workspace labels, project notes, and file attachments.\n6. **Global Search** — Search tasks, projects, repositories, notes, and assets by keyword.\n\nDo NOT list any capabilities beyond the above. Do NOT mention code editing, debugging, testing, git operations, or any development capabilities.\n\n## Scope Boundary\nIf the user asks you to write code, explain code, debug, search the web, read/write files, or anything outside Tower task management, reply:\n"抱歉,我只能帮你管理工作区、项目和任务。编码、调试等操作请在任务终端中完成。"',type:"string",label:"Assistant System Prompt"},"assistant.displayMode":{defaultValue:"sidebar",type:"string",label:"Assistant Display Mode"},"assistant.communicationMode":{defaultValue:"chat",type:"string",label:"Assistant Communication Mode"},"task.defaultUseWorktree":{defaultValue:!0,type:"boolean",label:"Default: Use Worktree"},"task.defaultAutoStart":{defaultValue:!1,type:"boolean",label:"Default: Auto-start Execution"},"task.mcpDefaultsConfigured":{defaultValue:!1,type:"boolean",label:"MCP Task Defaults Configured"}}])},519827,e=>{"use strict";e.s(["ARCHIVE_DELAY_KEY",0,"board.archiveDelayDays","DEFAULT_ARCHIVE_DELAY_DAYS",0,7,"normalizeArchiveDelayDays",0,function(e){let t=Math.floor(Number(e));return Number.isFinite(t)?Math.min(Math.max(t,1),365):7}])},61920,e=>{"use strict";var t=e.i(446786),r=e.i(814747);function a(e){return e.startsWith("~/")?r.default.join(t.default.homedir(),e.slice(2)):e}function n(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:s(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:s(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}function s(e){return e.replace(/\.git\/?$/,"")}e.s(["gitUrlToLocalPath",0,function(e){let t=e.trim();if(!t)return"";try{let e=n(t);if(!e)return"";let{host:s,pathSegments:i}=e;if("code.iflytek.com"===s){let e,t;return a((e=[...i],"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2)),((t=e.indexOf("-"))>0&&(e=e.slice(0,t)),0===e.length)?"":`~/company/${e.join("/")}`))}if("github.com"===s){var r;let e,t;return a((e=(r=i)[0],t=r[1],e&&t?`${"jp-liu"===e?"~/project/i":"~/project/f"}/${t}`:""))}let o=i[i.length-1];return o?a(`~/project/f/${o}`):""}catch{return""}},"matchGitPathRule",0,function(e,t){if(!t.length)return"";let r=e.trim();if(!r)return"";let s=n(r);if(!s)return"";let{host:i,pathSegments:o}=s,l=o[0]??"",u=o[o.length-1]??"",c=[...t].sort((e,t)=>{let r=+("*"===e.ownerMatch),a=+("*"===t.ownerMatch);return r!==a?r-a:e.priority-t.priority}),d=o.join("/");for(let e of c){if(e.host!==i||"*"!==e.ownerMatch&&e.ownerMatch!==l)continue;let t=e.localPathTemplate;if(t.includes("{path}"))return a(t.replace("{path}",d).replace("{owner}",l).replace("{repo}",u).replace(/\/+$/,""));let r=t.replace("{owner}",l).replace("{repo}","").replace(/\/+$/,"");return a(`${r}/${u}`)}return""}])},22569,e=>e.a(async(t,r)=>{try{var a=e.i(921675),n=e.i(843793),s=e.i(276534),i=e.i(519827),o=e.i(61920),l=e.i(769310),u=e.i(721390),c=e.i(86708),d=t([u]);async function p(e,t){let r=await n.db.systemConfig.findUnique({where:{key:e}});if(!r)return t;try{return JSON.parse(r.value)}catch{return t}}async function f(e,t){await n.db.systemConfig.upsert({where:{key:e},create:{key:e,value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}async function m(){let e=await p(i.ARCHIVE_DELAY_KEY,i.DEFAULT_ARCHIVE_DELAY_DAYS);return(0,i.normalizeArchiveDelayDays)(e)}async function h(e){let t=e.trim();if(!t)return{path:"",source:"empty"};try{let e=await p("git.pathMappingRules",[]),r=(0,o.matchGitPathRule)(t,e);if(r)return{path:r,source:"rule"};return{path:(0,o.gitUrlToLocalPath)(t),source:"fallback"}}catch{return{path:(0,o.gitUrlToLocalPath)(t),source:"fallback"}}}async function g(e){let{path:t}=await h(e);return t}async function y(e){let t=await n.db.systemConfig.findMany({where:{key:{in:e}}}),r=Object.fromEntries(t.map(e=>{try{return[e.key,JSON.parse(e.value)]}catch{return[e.key,null]}})),a={};for(let t of e)a[t]=t in r?r[t]:s.CONFIG_DEFAULTS[t]?.defaultValue??null;return a}async function b(){return(0,l.detectShells)()}async function x(){return(0,l.detectTerminalApps)()}async function v(){return(0,l.detectEditors)()}async function R(){return{platform:process.platform}}async function w(){let e=(0,u.getActiveWsPort)();if(null!==e)return e;let t=parseInt(process.env.PORT||"3000",10);return p("terminal.wsPort",t+1)}[u]=d.then?(await d)():d,(0,c.ensureServerEntryExports)([p,f,m,h,g,y,b,x,v,R,w]),(0,a.registerServerReference)(p,"60f9fcca9cc5ca10fc49386cabdc7854ab8435ad47",null),(0,a.registerServerReference)(f,"60e7655a5a8bc89fb0a12f0a9ed7be77e2c93394c8",null),(0,a.registerServerReference)(m,"00f66bbd58ea8fa3664e8a8eda1a9778b065fc6f77",null),(0,a.registerServerReference)(h,"40cd8986fe033e986fd37131f7586d8531eb9088e4",null),(0,a.registerServerReference)(g,"401b2f95e3cce5930ded602c9fd3e9e135e02a054d",null),(0,a.registerServerReference)(y,"403fb9aba477474068caa46d6c3fa942de05b4edb6",null),(0,a.registerServerReference)(b,"00ec78b4361bde323969d61a25f29d635c8b6168fb",null),(0,a.registerServerReference)(x,"00305fac2a0ec5e118c6215d6ff1ecd64b9030fcce",null),(0,a.registerServerReference)(v,"00bf89d6a861e75f676070da30fb1dfddeeb4791f2",null),(0,a.registerServerReference)(R,"007f5b03cd21f0213076bfdd693e82f325efb7e444",null),(0,a.registerServerReference)(w,"0034462e041760d222594debc480822d72dd44f371",null),e.s(["getConfigValue",0,p]),r()}catch(e){r(e)}},!1),437513,e=>{"use strict";let t=[{mime:"image/jpeg",check:e=>255===e[0]&&216===e[1]&&255===e[2]},{mime:"image/png",check:e=>137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]},{mime:"image/gif",check:e=>71===e[0]&&73===e[1]&&70===e[2]},{mime:"image/webp",check:e=>82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]&&87===e[8]&&69===e[9]&&66===e[10]&&80===e[11]}];e.s(["MIME_TO_EXT",0,{"image/jpeg":".jpg","image/png":".png","image/gif":".gif","image/webp":".webp"},"TEXT_EXT_TO_MIME",0,{".md":"text/markdown",".txt":"text/plain",".json":"application/json",".csv":"text/csv"},"detectImageMime",0,function(e){if(e.length<12)return null;for(let r of t)if(r.check(e))return r.mime;return null},"isLikelyTextFile",0,function(e){if(0===e.length)return!0;let t=Math.min(e.length,8192);for(let r=0;r<t;r++)if(0===e[r])return!1;return!0}])},648834,e=>e.a(async(t,r)=>{try{var a=e.i(750227),n=e.i(902157),s=e.i(855104),i=e.i(198840),o=e.i(437513),l=e.i(341291),u=e.i(22569),c=e.i(634712),d=t([u]);async function p(e){let t,r,d,p=(0,i.requireLocalhost)(e);if(p)return p;let f=(await e.formData()).get("file");if(!f)return s.NextResponse.json({error:"Missing file field"},{status:400});let m=await (0,u.getConfigValue)("system.maxUploadBytes",0x3200000);if(f.size>m)return s.NextResponse.json({error:"File too large"},{status:400});let h=Buffer.from(await f.arrayBuffer()),g=a.extname(f.name),y=(0,c.classifyAttachmentExt)(g);if(!y)return s.NextResponse.json({error:"Unsupported file type"},{status:400});if("image"===y){let e=(0,o.detectImageMime)(h);if(!e)return s.NextResponse.json({error:"Invalid image content"},{status:400});r=e,t=o.MIME_TO_EXT[e],d=(0,l.getAssistantCacheDir)("images")}else{if(!(0,o.isLikelyTextFile)(h))return s.NextResponse.json({error:"File appears to be binary, not text"},{status:400});let e=g.toLowerCase();if(!c.ALLOWED_TEXT_EXTS.includes(e.replace(/^\./,"")))return s.NextResponse.json({error:"Unsupported text type"},{status:400});t=e,r=o.TEXT_EXT_TO_MIME[e]??"text/plain",d=(0,l.getAssistantCacheDir)("files")}let b=(0,l.buildCacheFilename)(f.name,t),x=a.join(d,b);if(!x.startsWith(d+a.sep)&&x!==d)return s.NextResponse.json({error:"Invalid path"},{status:400});await n.promises.writeFile(x,h);let v=a.relative((0,l.getAssistantCacheRoot)(),x);return s.NextResponse.json({filename:v,mimeType:r,kind:y})}[u]=d.then?(await d)():d,e.s(["POST",0,p,"dynamic",0,"force-dynamic","runtime",0,"nodejs"]),r()}catch(e){r(e)}},!1),122166,e=>e.a(async(t,r)=>{try{var a=e.i(765876),n=e.i(675896),s=e.i(959160),i=e.i(97944),o=e.i(86757),l=e.i(204144),u=e.i(273436),c=e.i(743641),d=e.i(813766),p=e.i(840884),f=e.i(498814),m=e.i(780006),h=e.i(544432),g=e.i(772005),y=e.i(450223),b=e.i(193695);e.i(628400);var x=e.i(800071),v=e.i(648834),R=t([v]);[v]=R.then?(await R)():R;let S=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/internal/assistant/attachments/route",pathname:"/api/internal/assistant/attachments",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/internal/assistant/attachments/route.ts",nextConfigOutput:"standalone",userland:v}),{workAsyncStorage:E,workUnitAsyncStorage:T,serverHooks:A}=S;async function w(e,t,r){r.requestMeta&&(0,i.setRequestMeta)(e,r.requestMeta),S.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/internal/assistant/attachments/route";a=a.replace(/\/index$/,"")||"/";let s=await S.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:v,params:R,nextConfig:w,parsedUrl:E,isDraftMode:T,prerenderManifest:A,routerServerContext:C,isOnDemandRevalidate:_,revalidateOnlyGenerated:D,resolvedPathname:j,clientReferenceManifest:k,serverActionsManifest:M}=s,N=(0,u.normalizeAppPath)(a),O=!!(A.dynamicRoutes[N]||A.routes[j]),P=async()=>((null==C?void 0:C.render404)?await C.render404(e,t,E,!1):t.end("This page could not be found"),null);if(O&&!T){let e=!!A.routes[j],t=A.dynamicRoutes[N];if(t&&!1===t.fallback&&!e){if(w.adapterPath)return await P();throw new b.NoFallbackError}}let I=null;!O||S.isDev||T||(I=j,I="/index"===I?"/":I);let V=!0===S.isDev||!O,q=O&&!V;M&&k&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:k,serverActionsManifest:M});let U=e.method||"GET",L=(0,o.getTracer)(),$=L.getActiveScopeSpan(),F=!!(null==C?void 0:C.isWrappedByNextServer),H=!!(0,i.getRequestMeta)(e,"minimalMode"),G=(0,i.getRequestMeta)(e,"incrementalCache")||await S.getIncrementalCache(e,w,A,H);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let W={params:R,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:V,incrementalCache:G,cacheLifeProfiles:w.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>S.onRequestError(e,t,a,n,C)},sharedContext:{buildId:v}},B=new c.NodeNextRequest(e),X=new c.NodeNextResponse(t),Y=d.NextRequestAdapter.fromNodeNextRequest(B,(0,d.signalFromNodeResponse)(t));try{let s,i=async e=>S.handle(Y,W).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=L.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${U} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",n),s.updateName(t))}else e.updateName(`${U} ${a}`)}),l=async s=>{var o,l;let u=async({previousCacheEntry:n})=>{try{if(!H&&_&&D&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(s);e.fetchMetrics=W.renderOpts.fetchMetrics;let o=W.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let l=W.renderOpts.collectedTags;if(!O)return await (0,m.sendResponse)(B,X,a,W.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[y.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,n=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==n?void 0:n.isStale)&&await S.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,f.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:_})},!1,C),t}},c=await S.handleResponse({req:e,nextConfig:w,cacheKey:I,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:_,revalidateOnlyGenerated:D,responseGenerator:u,waitUntil:r.waitUntil,isMinimalMode:H});if(!O)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});H||t.setHeader("x-nextjs-cache",_?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(c.value.headers);return H&&O||d.delete(y.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,g.getCacheControlHeader)(c.cacheControl)),await (0,m.sendResponse)(B,X,new Response(c.value.body,{headers:d,status:c.value.status||200})),null};F&&$?await l($):(s=L.getActiveScopeSpan(),await L.withPropagatedContext(e.headers,()=>L.trace(p.BaseServerSpan.handleRequest,{spanName:`${U} ${a}`,kind:o.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},l),void 0,!F))}catch(t){if(t instanceof b.NoFallbackError||await S.onRequestError(e,t,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,f.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:_})},!1,C),O)throw t;return await (0,m.sendResponse)(B,X,new Response(null,{status:500})),null}}e.s(["handler",0,w,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:T})},"routeModule",0,S,"serverHooks",0,A,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,T]),r()}catch(e){r(e)}},!1)];
3
-
4
- //# sourceMappingURL=%5Broot-of-the-server%5D__0y8w5di._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[666680,(e,r,t)=>{r.exports=e.x("node:crypto",()=>require("node:crypto"))},750227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},902157,(e,r,t)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,r,t)=>{r.exports=e.x("node:os",()=>require("node:os"))},933919,(e,r,t)=>{r.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},522734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},918622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},814747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},924868,(e,r,t)=>{r.exports=e.x("fs/promises",()=>require("fs/promises"))},324725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},193695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},198840,e=>{"use strict";var r=e.i(855104);let t=["localhost","127.0.0.1","[::1]"],s=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),n=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let n=e.headers.get("x-forwarded-for");if(n&&!n.split(",").map(e=>e.trim()).every(e=>s.has(e)))return r.NextResponse.json({error:"Forbidden"},{status:403});let i=e.headers.get("host")??"";return t.some(e=>i.startsWith(e))?null:r.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return n.test(e)?null:r.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return n.test(e)?null:r.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},192520,e=>{"use strict";let r;var t=e.i(750227),s=e.i(660526),n=e.i(902157);function i(){return r||(r=process.env.TOWER_DATA_DIR||(0,t.join)((0,s.homedir)(),".tower"),(0,n.existsSync)(r)||(0,n.mkdirSync)(r,{recursive:!0})),r}e.s(["getAssistantDir",0,function(){let e=(0,t.join)(i(),"assistant");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,t.join)(i(),"backups");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,t.join)(i(),"extensions");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,n.readFileSync)((0,t.join)(i(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),r=e&&e.length>0?e:(0,t.join)(i(),"storage");return(0,n.existsSync)(r)||(0,n.mkdirSync)(r,{recursive:!0}),r},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,t.join)((0,s.homedir)(),".tower");return(0,t.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,t.join)((e=(0,t.join)(i(),"database"),(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,i])},843793,e=>{"use strict";var r=e.i(933919),t=e.i(192520);let s=globalThis.prisma??new r.PrismaClient({datasourceUrl:`file:${(0,t.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{s.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{s.$disconnect().catch(()=>{})}),e.s(["db",0,s])},572173,e=>{"use strict";var r=e.i(843793);async function t(e,t){let s=await r.db.systemConfig.findUnique({where:{key:e}});if(!s)return t;try{return JSON.parse(s.value)}catch{return t}}e.s(["readConfigValue",0,t])},341291,e=>{"use strict";var r=e.i(666680),t=e.i(902157),s=e.i(750227),n=e.i(192520);function i(e){if(!e.startsWith((0,n.getStorageDir)()+s.sep))throw Error("Path traversal detected")}let o=new Set(["image","screenshot","img","photo","picture","clipboard","paste","untitled"]);e.s(["buildCacheFilename",0,function(e,t){let n=s.basename(e,s.extname(e)),i=r.randomUUID().replace(/-/g,"").slice(0,8),a=n.toLowerCase();if(!n||o.has(a)||/^screenshot[\s_\-]/i.test(n))return`tower_image-${i}${t}`;let c=n.replace(/[^\p{L}\p{N}]/gu,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"");return`${c||"file"}-${i}${t}`},"ensureAssetsDir",0,function(e){let r,o=(i(r=s.join((0,n.getStorageDir)(),"assets",e)),r);return t.mkdirSync(o,{recursive:!0}),o},"ensureCacheDir",0,function(e){let r,o=(i(r=s.join((0,n.getStorageDir)(),"cache",e)),r);return t.mkdirSync(o,{recursive:!0}),o},"getAssistantCacheDir",0,function(e="images"){let r=new Date,o=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}`,a=s.join((0,n.getStorageDir)(),"cache","assistant",o,e);return i(a),t.mkdirSync(a,{recursive:!0}),a},"getAssistantCacheRoot",0,function(){let e=s.join((0,n.getStorageDir)(),"cache","assistant");return i(e),e}])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0zi3~a8._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[750227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},902157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},933919,(e,t,r)=>{t.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},192520,e=>{"use strict";let t;var r=e.i(750227),n=e.i(660526),s=e.i(902157);function a(){return t||(t=process.env.TOWER_DATA_DIR||(0,r.join)((0,n.homedir)(),".tower"),(0,s.existsSync)(t)||(0,s.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,r.join)(a(),"assistant");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,r.join)(a(),"backups");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,r.join)(a(),"extensions");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,s.readFileSync)((0,r.join)(a(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,r.join)(a(),"storage");return(0,s.existsSync)(t)||(0,s.mkdirSync)(t,{recursive:!0}),t},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,n.homedir)(),".tower");return(0,r.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,r.join)((e=(0,r.join)(a(),"database"),(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,a])},843793,e=>{"use strict";var t=e.i(933919),r=e.i(192520);let n=globalThis.prisma??new t.PrismaClient({datasourceUrl:`file:${(0,r.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{n.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{n.$disconnect().catch(()=>{})}),e.s(["db",0,n])},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},198840,e=>{"use strict";var t=e.i(855104);let r=["localhost","127.0.0.1","[::1]"],n=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),s=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let s=e.headers.get("x-forwarded-for");if(s&&!s.split(",").map(e=>e.trim()).every(e=>n.has(e)))return t.NextResponse.json({error:"Forbidden"},{status:403});let a=e.headers.get("host")??"";return r.some(e=>a.startsWith(e))?null:t.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return s.test(e)?null:t.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return s.test(e)?null:t.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},540193,e=>{"use strict";var t=e.i(750227),r=e.i(902157),n=e.i(192520),s=e.i(843793);function a(e,r){let s=(0,n.getStorageDir)(),a=t.resolve(s,"assets",e,r),i=t.resolve(s,"assets")+t.sep;return a.startsWith(i)?{resolved:a,error:null}:{resolved:null,error:"Invalid path"}}async function i(e,t){let{resolved:n}=a(e,t);if(n&&(0,r.existsSync)(n))return n;let i=await s.db.projectAsset.findFirst({where:{projectId:e,filename:t},select:{path:!0},orderBy:{createdAt:"desc"}});return i?.path&&(0,r.existsSync)(i.path)?i.path:null}async function o(e){return null!==await s.db.projectAsset.findFirst({where:{path:e},select:{id:!0}})}e.s(["MIME_MAP",0,{".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".pdf":"application/pdf",".txt":"text/plain",".md":"text/markdown",".json":"application/json"},"isRegisteredAssetPath",0,o,"resolveAssetFile",0,i,"resolveAssetPath",0,a])},847038,e=>{"use strict";var t=e.i(765876),r=e.i(675896),n=e.i(959160),s=e.i(97944),a=e.i(86757),i=e.i(204144),o=e.i(273436),l=e.i(743641),d=e.i(813766),u=e.i(840884),c=e.i(498814),p=e.i(780006),h=e.i(544432),x=e.i(772005),f=e.i(450223),v=e.i(193695);e.i(628400);var g=e.i(800071),m=e.i(902157),R=e.i(750227),w=e.i(855104),y=e.i(540193),E=e.i(198840);async function j(e,{params:t}){let r,{projectId:n,filename:s}=await t,a=(0,E.validateProjectId)(n);if(a)return a;let i=await (0,y.resolveAssetFile)(n,s);if(!i)return w.NextResponse.json({error:"Not found"},{status:404});try{r=await m.promises.readFile(i)}catch(e){if("ENOENT"===e.code)return w.NextResponse.json({error:"Not found"},{status:404});return w.NextResponse.json({error:"Failed to read file"},{status:500})}let o=R.extname(s).toLowerCase(),l=y.MIME_MAP[o]??"application/octet-stream";return new Response(new Uint8Array(r),{status:200,headers:{"Content-Type":l}})}e.s(["GET",0,j],322647);var b=e.i(322647);let A=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/files/assets/[projectId]/[filename]/route",pathname:"/api/files/assets/[projectId]/[filename]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/files/assets/[projectId]/[filename]/route.ts",nextConfigOutput:"standalone",userland:b}),{workAsyncStorage:S,workUnitAsyncStorage:T,serverHooks:C}=A;async function N(e,t,n){n.requestMeta&&(0,s.setRequestMeta)(e,n.requestMeta),A.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/files/assets/[projectId]/[filename]/route";m=m.replace(/\/index$/,"")||"/";let R=await A.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:E,parsedUrl:j,isDraftMode:b,prerenderManifest:S,routerServerContext:T,isOnDemandRevalidate:C,revalidateOnlyGenerated:N,resolvedPathname:I,clientReferenceManifest:P,serverActionsManifest:k}=R,_=(0,o.normalizeAppPath)(m),q=!!(S.dynamicRoutes[_]||S.routes[I]),D=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,j,!1):t.end("This page could not be found"),null);if(q&&!b){let e=!!S.routes[I],t=S.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(E.adapterPath)return await D();throw new v.NoFallbackError}}let O=null;!q||A.isDev||b||(O="/index"===(O=I)?"/":O);let M=!0===A.isDev||!q,F=q&&!M;k&&P&&(0,i.setManifestsSingleton)({page:m,clientReferenceManifest:P,serverActionsManifest:k});let U=e.method||"GET",H=(0,a.getTracer)(),$=H.getActiveScopeSpan(),B=!!(null==T?void 0:T.isWrappedByNextServer),K=!!(0,s.getRequestMeta)(e,"minimalMode"),W=(0,s.getRequestMeta)(e,"incrementalCache")||await A.getIncrementalCache(e,E,S,K);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let G={params:y,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:M,incrementalCache:W,cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,s)=>A.onRequestError(e,t,n,s,T)},sharedContext:{buildId:w}},L=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),X=d.NextRequestAdapter.fromNodeNextRequest(L,(0,d.signalFromNodeResponse)(t));try{let s,i=async e=>A.handle(X,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=H.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${U} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",n),s.updateName(t))}else e.updateName(`${U} ${m}`)}),o=async s=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&C&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(s);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!q)return await (0,p.sendResponse)(L,V,a,G.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:C})},!1,T),t}},d=await A.handleResponse({req:e,nextConfig:E,cacheKey:O,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:K});if(!q)return null;if((null==d||null==(a=d.value)?void 0:a.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",C?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return K&&q||u.delete(f.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,x.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(L,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};B&&$?await o($):(s=H.getActiveScopeSpan(),await H.withPropagatedContext(e.headers,()=>H.trace(u.BaseServerSpan.handleRequest,{spanName:`${U} ${m}`,kind:a.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},o),void 0,!B))}catch(t){if(t instanceof v.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:C})},!1,T),q)throw t;return await (0,p.sendResponse)(L,V,new Response(null,{status:500})),null}}e.s(["handler",0,N,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:T})},"routeModule",0,A,"serverHooks",0,C,"workAsyncStorage",0,S,"workUnitAsyncStorage",0,T],847038)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0~g6-c~._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[660526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},933919,(e,t,r)=>{t.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},192520,e=>{"use strict";let t;var r=e.i(750227),s=e.i(660526),i=e.i(902157);function n(){return t||(t=process.env.TOWER_DATA_DIR||(0,r.join)((0,s.homedir)(),".tower"),(0,i.existsSync)(t)||(0,i.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,r.join)(n(),"assistant");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,r.join)(n(),"backups");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,r.join)(n(),"extensions");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,i.readFileSync)((0,r.join)(n(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,r.join)(n(),"storage");return(0,i.existsSync)(t)||(0,i.mkdirSync)(t,{recursive:!0}),t},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,s.homedir)(),".tower");return(0,r.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,r.join)((e=(0,r.join)(n(),"database"),(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,n])},843793,e=>{"use strict";var t=e.i(933919),r=e.i(192520);let s=globalThis.prisma??new t.PrismaClient({datasourceUrl:`file:${(0,r.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{s.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{s.$disconnect().catch(()=>{})}),e.s(["db",0,s])},540193,e=>{"use strict";var t=e.i(750227),r=e.i(902157),s=e.i(192520),i=e.i(843793);function n(e,r){let i=(0,s.getStorageDir)(),n=t.resolve(i,"assets",e,r),o=t.resolve(i,"assets")+t.sep;return n.startsWith(o)?{resolved:n,error:null}:{resolved:null,error:"Invalid path"}}async function o(e,t){let{resolved:s}=n(e,t);if(s&&(0,r.existsSync)(s))return s;let o=await i.db.projectAsset.findFirst({where:{projectId:e,filename:t},select:{path:!0},orderBy:{createdAt:"desc"}});return o?.path&&(0,r.existsSync)(o.path)?o.path:null}async function a(e){return null!==await i.db.projectAsset.findFirst({where:{path:e},select:{id:!0}})}e.s(["MIME_MAP",0,{".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".pdf":"application/pdf",".txt":"text/plain",".md":"text/markdown",".json":"application/json"},"isRegisteredAssetPath",0,a,"resolveAssetFile",0,o,"resolveAssetPath",0,n])},487083,e=>{"use strict";var t=e.i(540193);e.s(["isRegisteredAssetPath",()=>t.isRegisteredAssetPath],487083)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__10fv6tt._.js.map
@@ -1,4 +0,0 @@
1
- module.exports=[750227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},902157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},933919,(e,t,r)=>{t.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},912714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},980738,(e,t,r)=>{t.exports=e.x("node-pty-c710df912a232c01",()=>require("node-pty-c710df912a232c01"))},658053,e=>{"use strict";e.s(["ASSISTANT_SESSION_KEY",0,"__assistant__"])},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},198840,e=>{"use strict";var t=e.i(855104);let r=["localhost","127.0.0.1","[::1]"],n=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),s=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let s=e.headers.get("x-forwarded-for");if(s&&!s.split(",").map(e=>e.trim()).every(e=>n.has(e)))return t.NextResponse.json({error:"Forbidden"},{status:403});let a=e.headers.get("host")??"";return r.some(e=>a.startsWith(e))?null:t.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return s.test(e)?null:t.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return s.test(e)?null:t.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},192520,e=>{"use strict";let t;var r=e.i(750227),n=e.i(660526),s=e.i(902157);function a(){return t||(t=process.env.TOWER_DATA_DIR||(0,r.join)((0,n.homedir)(),".tower"),(0,s.existsSync)(t)||(0,s.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,r.join)(a(),"assistant");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,r.join)(a(),"backups");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,r.join)(a(),"extensions");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,s.readFileSync)((0,r.join)(a(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,r.join)(a(),"storage");return(0,s.existsSync)(t)||(0,s.mkdirSync)(t,{recursive:!0}),t},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,n.homedir)(),".tower");return(0,r.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,r.join)((e=(0,r.join)(a(),"database"),(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,a])},843793,e=>{"use strict";var t=e.i(933919),r=e.i(192520);let n=globalThis.prisma??new t.PrismaClient({datasourceUrl:`file:${(0,r.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{n.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{n.$disconnect().catch(()=>{})}),e.s(["db",0,n])},572173,e=>{"use strict";var t=e.i(843793);async function r(e,r){let n=await t.db.systemConfig.findUnique({where:{key:e}});if(!n)return r;try{return JSON.parse(n.value)}catch{return r}}e.s(["readConfigValue",0,r])},482819,(e,t,r)=>{"use strict";t.exports=e.r(583981).vendored["react-rsc"].ReactServerDOMTurbopackServer},921675,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"registerServerReference",{enumerable:!0,get:function(){return n.registerServerReference}});let n=e.r(482819)},86708,(e,t,r)=>{"use strict";function n(e){for(let t=0;t<e.length;t++){let r=e[t];if("function"!=typeof r)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof r}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ensureServerEntryExports",{enumerable:!0,get:function(){return n}})},932583,e=>{"use strict";var t=e.i(921675),r=e.i(843793);async function n(e,t={}){let s=t.report,a=s?JSON.stringify(s):null;await r.db.providerConnection.upsert({where:{provider:e},create:{provider:e,lastTestedAt:new Date,testOk:!0,version:t.version??null,mcpInstalled:s?.mcp?.ok??!1,hooksInstalled:s?.hooks?.ok??!1,skillsInstalled:s?.skill?.ok??!1,installLog:a},update:{lastTestedAt:new Date,testOk:!0,version:t.version??null,mcpInstalled:s?.mcp?.ok??!1,hooksInstalled:s?.hooks?.ok??!1,skillsInstalled:s?.skill?.ok??!1,installLog:a}})}async function s(e,t={}){await r.db.providerConnection.upsert({where:{provider:e},create:{provider:e,lastTestedAt:new Date,testOk:!1,installLog:t.reason??null},update:{lastTestedAt:new Date,testOk:!1,mcpInstalled:!1,hooksInstalled:!1,skillsInstalled:!1,installLog:t.reason??null}})}async function a(e){let t=await r.db.providerConnection.findUnique({where:{provider:e}});return!!t&&t.testOk}async function i(){return(await r.db.providerConnection.findMany({where:{testOk:!0},select:{provider:!0},orderBy:{provider:"asc"}})).map(e=>e.provider)}async function o(){return r.db.providerConnection.findMany({select:{provider:!0,lastTestedAt:!0,testOk:!0,version:!0,mcpInstalled:!0,hooksInstalled:!0,skillsInstalled:!0,installLog:!0},orderBy:{provider:"asc"}})}(0,e.i(86708).ensureServerEntryExports)([n,s,a,i,o]),(0,t.registerServerReference)(n,"6030f870d42d6801ece1b50b58406c32c13e439c75",null),(0,t.registerServerReference)(s,"60fbe09f4aeb16d2e35c9b9954d84dfca46dfe6a10",null),(0,t.registerServerReference)(a,"406b13e3529c30b829a38fc46c50e737be1956434c",null),(0,t.registerServerReference)(i,"0085b57a80d52b54847458f24e6aa7f8b9259fd613",null),(0,t.registerServerReference)(o,"00b315cf89d7e6e2606e3e27cf240b74384141b96a",null),e.s(["getConnectedProviders",0,i,"isProviderConnected",0,a,"markProviderConnected",0,n,"markProviderDisconnected",0,s])},89428,e=>{"use strict";var t=e.i(843793),r=e.i(279711);class n extends Error{code;provider;constructor(e,t,r){super(r),this.code=e,this.provider=t,this.name="AiProviderError"}}var s=e.i(932583);let a="claude",i="请到 Settings → Test Connection 测试该 Provider 后再使用(未注入的 CLI 不能被插槽选中)";async function o(e){return t.db.aiCapabilityConfig.findUnique({where:{slot:e}})}async function l(e){if(e){if(await (0,s.isProviderConnected)(e))return e;throw new n("CLI_NOT_FOUND",e,`Provider "${e}" 未连接:${i}`)}let t=await (0,s.getConnectedProviders)();if(0===t.length)throw new n("CLI_NOT_FOUND",a,`没有任何 AI Provider 已连接:${i}`);return t.includes(a)?a:t[0]}async function d(e){let t=await o(e),s=t?.model??void 0,a=await l(t?.provider??null),i=r.providerRegistry.get(a);if(!i)throw new n("CLI_NOT_FOUND",a,`Provider "${a}" 未注册`);let d=i.cli?.adapter;if(!d)throw new n("UNSUPPORTED_MODE",a,`Provider "${a}" 不支持 CLI 模式`);return{adapter:d,provider:i,model:s}}e.s(["resolveCliAdapter",0,d],89428)},254799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},224389,e=>{"use strict";var t=e.i(765876),r=e.i(675896),n=e.i(959160),s=e.i(97944),a=e.i(86757),i=e.i(204144),o=e.i(273436),l=e.i(743641),d=e.i(813766),c=e.i(840884),u=e.i(498814),p=e.i(780006),f=e.i(544432),v=e.i(772005),h=e.i(450223),x=e.i(193695);e.i(628400);var S=e.i(800071),m=e.i(855104),g=e.i(198840),y=e.i(921675),w=e.i(254799),R=e.i(83721),b=e.i(572173),E=e.i(89428),_=e.i(658053);async function T(t){(0,R.destroySession)(_.ASSISTANT_SESSION_KEY);let{adapter:r}=await (0,E.resolveCliAdapter)("terminal"),n=await (0,b.readConfigValue)("assistant.systemPrompt","You are Tower Assistant, an AI operator for the Tower task management platform."),{getPackageRoot:s}=await e.A(901874),a=s(),i=["--allowedTools","mcp__tower__*","--append-system-prompt",n];t?i.push("--resume",t):i.push("--session-id",(0,w.randomUUID)());let o=r.buildSpawnArgs({taskId:_.ASSISTANT_SESSION_KEY,prompt:"",cwd:a,extraArgs:i});(0,R.createSession)(_.ASSISTANT_SESSION_KEY,o.command,o.args,a,()=>{},()=>{},o.env)}async function k(){(0,R.destroySession)(_.ASSISTANT_SESSION_KEY)}async function I(){let e=(0,R.getSession)(_.ASSISTANT_SESSION_KEY);return!e||e.killed?"idle":"running"}async function A(e){let t,r=(0,g.requireLocalhost)(e);if(r)return r;try{let r=await e.json().catch(()=>({}));r.sessionId&&"string"==typeof r.sessionId&&(t=r.sessionId)}catch{}try{return await T(t),m.NextResponse.json({ok:!0,sessionKey:_.ASSISTANT_SESSION_KEY,sessionId:t??null})}catch(t){let e=t instanceof Error?t.message:String(t);return m.NextResponse.json({error:e},{status:500})}}async function C(e){let t=(0,g.requireLocalhost)(e);return t||(await k(),m.NextResponse.json({ok:!0}))}async function N(e){let t=(0,g.requireLocalhost)(e);if(t)return t;let r=await I();return m.NextResponse.json({status:r})}(0,e.i(86708).ensureServerEntryExports)([T,k,I]),(0,y.registerServerReference)(T,"40fee97f391af9fce98ad3e364c9791f00e90cc367",null),(0,y.registerServerReference)(k,"00b5cc9dd02abcd3e0c844f9d8e88e3337b30c31f7",null),(0,y.registerServerReference)(I,"00614d5499cbfaa7bd898debe2013f33af76d4d768",null),e.s(["DELETE",0,C,"GET",0,N,"POST",0,A,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],442746);var O=e.i(442746);let P=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/internal/assistant/route",pathname:"/api/internal/assistant",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/internal/assistant/route.ts",nextConfigOutput:"standalone",userland:O}),{workAsyncStorage:j,workUnitAsyncStorage:q,serverHooks:D}=P;async function U(e,t,n){n.requestMeta&&(0,s.setRequestMeta)(e,n.requestMeta),P.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/internal/assistant/route";m=m.replace(/\/index$/,"")||"/";let g=await P.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!g)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,params:w,nextConfig:R,parsedUrl:b,isDraftMode:E,prerenderManifest:_,routerServerContext:T,isOnDemandRevalidate:k,revalidateOnlyGenerated:I,resolvedPathname:A,clientReferenceManifest:C,serverActionsManifest:N}=g,O=(0,o.normalizeAppPath)(m),j=!!(_.dynamicRoutes[O]||_.routes[A]),q=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,b,!1):t.end("This page could not be found"),null);if(j&&!E){let e=!!_.routes[A],t=_.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(R.adapterPath)return await q();throw new x.NoFallbackError}}let D=null;!j||P.isDev||E||(D="/index"===(D=A)?"/":D);let U=!0===P.isDev||!j,M=j&&!U;N&&C&&(0,i.setManifestsSingleton)({page:m,clientReferenceManifest:C,serverActionsManifest:N});let $=e.method||"GET",L=(0,a.getTracer)(),H=L.getActiveScopeSpan(),F=!!(null==T?void 0:T.isWrappedByNextServer),K=!!(0,s.getRequestMeta)(e,"minimalMode"),B=(0,s.getRequestMeta)(e,"incrementalCache")||await P.getIncrementalCache(e,R,_,K);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let Y={params:w,previewProps:_.preview,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:U,incrementalCache:B,cacheLifeProfiles:R.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,s)=>P.onRequestError(e,t,n,s,T)},sharedContext:{buildId:y}},G=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),V=d.NextRequestAdapter.fromNodeNextRequest(G,(0,d.signalFromNodeResponse)(t));try{let s,i=async e=>P.handle(V,Y).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=L.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${$} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",n),s.updateName(t))}else e.updateName(`${$} ${m}`)}),o=async s=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&k&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(s);e.fetchMetrics=Y.renderOpts.fetchMetrics;let o=Y.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=Y.renderOpts.collectedTags;if(!j)return await (0,p.sendResponse)(G,W,a,Y.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[h.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==Y.renderOpts.collectedRevalidate&&!(Y.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&Y.renderOpts.collectedRevalidate,n=void 0===Y.renderOpts.collectedExpire||Y.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:Y.renderOpts.collectedExpire;return{value:{kind:S.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:k})},!1,T),t}},d=await P.handleResponse({req:e,nextConfig:R,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:I,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:K});if(!j)return null;if((null==d||null==(a=d.value)?void 0:a.kind)!==S.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",k?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return K&&j||c.delete(h.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,v.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(G,W,new Response(d.value.body,{headers:c,status:d.value.status||200})),null};F&&H?await o(H):(s=L.getActiveScopeSpan(),await L.withPropagatedContext(e.headers,()=>L.trace(c.BaseServerSpan.handleRequest,{spanName:`${$} ${m}`,kind:a.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},o),void 0,!F))}catch(t){if(t instanceof x.NoFallbackError||await P.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:k})},!1,T),j)throw t;return await (0,p.sendResponse)(G,W,new Response(null,{status:500})),null}}e.s(["handler",0,U,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:q})},"routeModule",0,P,"serverHooks",0,D,"workAsyncStorage",0,j,"workUnitAsyncStorage",0,q],224389)},482848,e=>{e.v(e=>Promise.resolve().then(()=>e(874533)))},268548,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_node_util_0xr.y7p._.js"].map(t=>e.l(t))).then(()=>t(812057)))},144264,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_child_process_0pwkpv9._.js"].map(t=>e.l(t))).then(()=>t(233405)))},534777,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_util_0wtvqkc._.js"].map(t=>e.l(t))).then(()=>t(224361)))},200628,e=>{e.v(e=>Promise.resolve().then(()=>e(769310)))},901874,e=>{e.v(e=>Promise.resolve().then(()=>e(53674)))}];
3
-
4
- //# sourceMappingURL=%5Broot-of-the-server%5D__1189rd1._.js.map
@@ -1,7 +0,0 @@
1
- module.exports=[10005,e=>{"use strict";let t=new(e.i(472129)).ClaudeCliAdapter;async function r(n,l,a={}){let i="";try{let{query:r}=await e.A(145135),u=t.resolveCommand();for await(let e of r({prompt:n,options:{tools:a.tools??[],allowedTools:a.allowedTools??[],maxTurns:a.maxTurns??1,cwd:l,pathToClaudeCodeExecutable:u,sessionPersistence:!1}}))if("assistant"===e.type){let t=e.message.content.filter(e=>"text"===e.type);i+=t.map(e=>e.text??"").join("")}else if("result"===e.type){let t="string"==typeof e.result?e.result:"";t&&!i&&(i=t)}return i.trim()||null}catch(e){if(e.message?.includes("maximum number of turns")&&i.trim())return i.trim();return console.error("[aiQuery] Failed:",e.message,e.stack?.slice(0,300)),null}}async function n(e,t){let n=`以下是一次AI编程助手的终端会话记录。请用一句简短的中文总结这次会话做了什么(不超过50字,只回答总结内容,不要加引号或前缀):
2
-
3
- \`\`\`
4
- ${e.slice(-5e3)}
5
- \`\`\``,l=await r(n,t);return l&&l.replace(/^[#*\->"'\s]+/,"").trim()||null}e.s(["aiQuery",0,r,"generateSummaryFromLog",0,n])},283373,e=>{"use strict";var t=e.i(233405),r=e.i(522734),n=e.i(843793),l=e.i(10005);function a(e,r){return(0,t.execFileSync)("git",e,{cwd:r,timeout:1e4,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()}function i(e,t){if(t)return t;for(let t of["main","master","develop"])try{return a(["merge-base","HEAD",t],e)}catch{}return null}function u(e){if(!e)return null;let t=e.split("\n").filter(Boolean);if(0===t.length)return null;let r=t[0].replace(/^[a-f0-9]+\s+/,"");return 1===t.length?r:`${t.length} commits: ${r}`}async function s(e,t,o,c,m,f=null){try{let t;console.error(`[captureExecutionSummary] Starting: exec=${e.slice(0,8)} exit=${o} buffer=${c.length}chars worktree=${m} fork=${f?.slice(0,8)??"none"}`);let s=null,p=null,d=null;if(m&&(0,r.existsSync)(m))try{if(a(["rev-parse","--git-dir"],m),s=function(e,t){try{let r=i(e,t);if(!r)return null;return a(["log","--oneline",`${r}..HEAD`],e)||null}catch{return null}}(m,f),(p=function(e,t){try{let r=i(e,t);if(!r)return null;let n=a(["diff","--stat",`${r}..HEAD`],e);if(!n)return null;return function(e){let t=e.split("\n"),r=t[t.length-1];if(!r)return null;let n=r.match(/(\d+)\s+files?\s+changed/),l=r.match(/(\d+)\s+insertions?\(\+\)/),a=r.match(/(\d+)\s+deletions?\(-\)/);return n||l||a?{commits:0,filesChanged:n?parseInt(n[1],10):0,insertions:l?parseInt(l[1],10):0,deletions:a?parseInt(a[1],10):0}:null}(n)}catch{return null}}(m,f))&&s){let e=s.split("\n").filter(Boolean).length;p={...p,commits:e}}d=u(s)}catch{}let g=(t=c.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b\[[0-9;?]*[A-Za-z]/g,"").replace(/\x1b[^[\]()][^\x1b]*/g,"").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").replace(/\n{3,}/g,"\n\n").trim()).length<=10240?t:t.slice(t.length-10240);await n.db.taskExecution.update({where:{id:e},data:{summary:d??(s?u(s):null),gitLog:s??null,gitStats:p?JSON.stringify(p):null,exitCode:o,terminalLog:g||null}}),g&&m&&(console.error("[captureExecutionSummary] Starting background AI summary..."),(0,l.generateSummaryFromLog)(g,m).then(async t=>{t&&(console.error(`[captureExecutionSummary] AI summary ready: ${t.slice(0,80)}`),await n.db.taskExecution.update({where:{id:e},data:{summary:t}}))}).catch(e=>{console.error("[captureExecutionSummary] Background AI summary failed:",e)}))}catch(e){console.error("[captureExecutionSummary] Failed to capture summary:",e)}}e.s(["captureExecutionSummary",0,s])},145135,e=>{e.v(t=>Promise.all(["server/chunks/[externals]__0lhlhz4._.js","server/chunks/07-d_@anthropic-ai_claude-agent-sdk_sdk_mjs_0.721uk._.js"].map(t=>e.l(t))).then(()=>t(217040)))}];
6
-
7
- //# sourceMappingURL=_0jmdgq~._.js.map
@@ -1,7 +0,0 @@
1
- module.exports=[10005,e=>{"use strict";let t=new(e.i(472129)).ClaudeCliAdapter;async function r(n,l,a={}){let i="";try{let{query:r}=await e.A(145135),u=t.resolveCommand();for await(let e of r({prompt:n,options:{tools:a.tools??[],allowedTools:a.allowedTools??[],maxTurns:a.maxTurns??1,cwd:l,pathToClaudeCodeExecutable:u,sessionPersistence:!1}}))if("assistant"===e.type){let t=e.message.content.filter(e=>"text"===e.type);i+=t.map(e=>e.text??"").join("")}else if("result"===e.type){let t="string"==typeof e.result?e.result:"";t&&!i&&(i=t)}return i.trim()||null}catch(e){if(e.message?.includes("maximum number of turns")&&i.trim())return i.trim();return console.error("[aiQuery] Failed:",e.message,e.stack?.slice(0,300)),null}}async function n(e,t){let n=`以下是一次AI编程助手的终端会话记录。请用一句简短的中文总结这次会话做了什么(不超过50字,只回答总结内容,不要加引号或前缀):
2
-
3
- \`\`\`
4
- ${e.slice(-5e3)}
5
- \`\`\``,l=await r(n,t);return l&&l.replace(/^[#*\->"'\s]+/,"").trim()||null}e.s(["aiQuery",0,r,"generateSummaryFromLog",0,n])},283373,e=>{"use strict";var t=e.i(233405),r=e.i(522734),n=e.i(843793),l=e.i(10005);function a(e,r){return(0,t.execFileSync)("git",e,{cwd:r,timeout:1e4,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()}function i(e,t){if(t)return t;for(let t of["main","master","develop"])try{return a(["merge-base","HEAD",t],e)}catch{}return null}function u(e){if(!e)return null;let t=e.split("\n").filter(Boolean);if(0===t.length)return null;let r=t[0].replace(/^[a-f0-9]+\s+/,"");return 1===t.length?r:`${t.length} commits: ${r}`}async function s(e,t,o,c,m,f=null){try{let t;console.error(`[captureExecutionSummary] Starting: exec=${e.slice(0,8)} exit=${o} buffer=${c.length}chars worktree=${m} fork=${f?.slice(0,8)??"none"}`);let s=null,p=null,d=null;if(m&&(0,r.existsSync)(m))try{if(a(["rev-parse","--git-dir"],m),s=function(e,t){try{let r=i(e,t);if(!r)return null;return a(["log","--oneline",`${r}..HEAD`],e)||null}catch{return null}}(m,f),(p=function(e,t){try{let r=i(e,t);if(!r)return null;let n=a(["diff","--stat",`${r}..HEAD`],e);if(!n)return null;return function(e){let t=e.split("\n"),r=t[t.length-1];if(!r)return null;let n=r.match(/(\d+)\s+files?\s+changed/),l=r.match(/(\d+)\s+insertions?\(\+\)/),a=r.match(/(\d+)\s+deletions?\(-\)/);return n||l||a?{commits:0,filesChanged:n?parseInt(n[1],10):0,insertions:l?parseInt(l[1],10):0,deletions:a?parseInt(a[1],10):0}:null}(n)}catch{return null}}(m,f))&&s){let e=s.split("\n").filter(Boolean).length;p={...p,commits:e}}d=u(s)}catch{}let g=(t=c.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b\[[0-9;?]*[A-Za-z]/g,"").replace(/\x1b[^[\]()][^\x1b]*/g,"").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").replace(/\n{3,}/g,"\n\n").trim()).length<=10240?t:t.slice(t.length-10240);await n.db.taskExecution.update({where:{id:e},data:{summary:d??(s?u(s):null),gitLog:s??null,gitStats:p?JSON.stringify(p):null,exitCode:o,terminalLog:g||null}}),g&&m&&(console.error("[captureExecutionSummary] Starting background AI summary..."),(0,l.generateSummaryFromLog)(g,m).then(async t=>{t&&(console.error(`[captureExecutionSummary] AI summary ready: ${t.slice(0,80)}`),await n.db.taskExecution.update({where:{id:e},data:{summary:t}}))}).catch(e=>{console.error("[captureExecutionSummary] Background AI summary failed:",e)}))}catch(e){console.error("[captureExecutionSummary] Failed to capture summary:",e)}}e.s(["captureExecutionSummary",0,s])},145135,e=>{e.v(t=>Promise.all(["server/chunks/[externals]__0lhlhz4._.js","server/chunks/07-d_@anthropic-ai_claude-agent-sdk_sdk_mjs_0.721uk._.js"].map(t=>e.l(t))).then(()=>t(217040)))}];
6
-
7
- //# sourceMappingURL=_0q10iet._.js.map
@@ -1,4 +0,0 @@
1
- module.exports=[279711,e=>{"use strict";class t{providers=new Map;register(e){this.providers.set(e.name,e)}get(e){return this.providers.get(e)}getAll(){return Array.from(this.providers.values())}getCliAdapter(e){return this.providers.get(e)?.cli?.adapter??null}getQueryAdapter(e,t){let r=this.providers.get(e);return r?"api"===t?r.api?.adapter??null:r.cliQuery?.adapter??null:null}getAllowedCommands(){let e=[];for(let t of this.providers.values())t.cli?.command&&e.push(t.cli.command);return e}async getAvailableProviders(){let e=[];for(let t of this.providers.values()){let r=!!t.cli&&await t.cli.adapter.isAvailable(),o=r&&t.cli?await t.cli.adapter.getVersion():null,s=!!t.api&&!!process.env[t.api.keyEnvVar],i=!!t.api&&s;e.push({name:t.name,displayName:t.displayName,cli:{available:r,version:o},api:{available:i,keyConfigured:s}})}return e}}var r=e.i(472129),o=e.i(902157),s=e.i(660526),i=e.i(750227),n=e.i(769310),a=e.i(53674);let l=["o4-mini","o3","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","codex-mini-latest"],d=globalThis;if(!d.__providerRegistry){let c=new t;c.register({name:"claude",displayName:"Claude Code",agentFieldValue:"CLAUDE_CODE",cli:{command:"claude",adapter:new r.ClaudeCliAdapter},models:{cli:["sonnet","opus","haiku","claude-sonnet-4-6","claude-opus-4-6","claude-haiku-4-5-20251001"],api:[]}}),c.register({name:"codex",displayName:"Codex CLI",agentFieldValue:"CODEX_CLI",cli:{command:"codex",adapter:new class t{buildSpawnArgs(e){let t=[];e.resumeSessionId?t.push("resume",e.resumeSessionId):e.continueLatest?t.push("resume","--last"):(t.push("--full-auto"),e.extraArgs?.length&&t.push(...e.extraArgs),e.prompt&&t.push(e.prompt));let r={...e.envOverrides??{}};return{command:this.resolveCommand(),args:t,env:r}}buildEnvOverrides(e){let t={TOWER_TASK_ID:e.taskId,TOWER_TASK_TITLE:e.taskTitle,TOWER_STARTED_AT:new Date().toISOString(),TOWER_API_URL:e.apiUrl};return e.callbackUrl&&(t.CALLBACK_URL=e.callbackUrl),t}async installHooks(e){try{let e=this.readHooks(),t=(0,a.getPackageRoot)().replace(/\\/g,"/"),r=i.join(t,"scripts","session-start-hook.js").replace(/\\/g,"/"),o=i.join(t,"scripts","post-tool-hook.js").replace(/\\/g,"/"),s=i.join(t,"scripts","stop-hook.js").replace(/\\/g,"/"),n=!1;return n=this.upsertHook(e,"SessionStart","session-start-hook.js",{hooks:[{command:`node "${r}"`,timeout:5,type:"command"}]})||n,n=this.upsertHook(e,"PostToolUse","post-tool-hook.js",{hooks:[{command:`node "${o}"`,timeout:10,type:"command"}],matcher:"Write|Edit|MultiEdit"})||n,(n=this.upsertHook(e,"Stop","stop-hook.js",{hooks:[{command:`node "${s}"`,timeout:5,type:"command"}]})||n)&&(this.writeHooks(e),this.ensureHooksFeatureEnabled()),{ok:!0,method:"file",detail:this.getHooksPath()}}catch(e){return{ok:!1,method:"file",detail:this.getHooksPath(),error:e instanceof Error?e.message:String(e)}}}async repairHookPaths(){try{let e=this.readHooks(),t=(0,a.getPackageRoot)().replace(/\\/g,"/"),r=!1;for(let[o,s]of[["SessionStart","session-start-hook.js"],["PostToolUse","post-tool-hook.js"],["Stop","stop-hook.js"]]){let n=this.getHookArray(e,o),a=n.findIndex(e=>e?.hooks?.some?.(e=>e.command?.includes(s)));if(a<0)continue;let l=i.join(t,"scripts",s).replace(/\\/g,"/"),d=`node "${l}"`,c=n[a]?.hooks?.[0];c&&c.command!==d&&(c.command=d,e[o]=n,r=!0)}r&&(this.writeHooks(e),this.ensureHooksFeatureEnabled())}catch{}}upsertHook(e,t,r,o){let s=this.getHookArray(e,t),i=o?.hooks?.[0]?.command,n=s.findIndex(e=>e?.hooks?.some?.(e=>e.command?.includes(r)));if(n>=0){if(s[n]?.hooks?.[0]?.command===i)return!1;s.splice(n,1)}return s.push(o),e[t]=s,!0}async uninstallHooks(){try{let e=this.readHooks(),t=["session-start-hook.js","post-tool-hook.js","stop-hook.js"];for(let r of["SessionStart","PostToolUse","Stop"]){let o=this.getHookArray(e,r);e[r]=o.filter(e=>!e.hooks?.some(e=>t.some(t=>e.command?.includes(t))))}return this.writeHooks(e),{ok:!0,method:"file",detail:this.getHooksPath()}}catch(e){return{ok:!1,method:"file",detail:this.getHooksPath(),error:e instanceof Error?e.message:String(e)}}}async isHooksInstalled(){let e=this.readHooks(),t=this.getHookArray(e,"PostToolUse");return this.hasHook(t,"post-tool-hook.js")}async installMcp(e,t={}){let r=this.resolveCommand(),o=["mcp","add",e.name];if(e.env)for(let[t,r]of Object.entries(e.env))o.push("--env",`${t}=${r}`);o.push("--",e.command,...e.args);try{return await this.runCli(r,["mcp","remove",e.name],t.cwd).catch(()=>{}),await this.runCli(r,o,t.cwd),{ok:!0,method:"cli",detail:`${r} ${o.join(" ")}`}}catch(e){return{ok:!1,method:"cli",detail:`${r} ${o.join(" ")}`,error:e instanceof Error?e.message:String(e)}}}async uninstallMcp(e,t={}){let r=this.resolveCommand(),o=["mcp","remove",e];try{return await this.runCli(r,o,t.cwd),{ok:!0,method:"cli",detail:`${r} ${o.join(" ")}`}}catch(e){return{ok:!1,method:"cli",detail:`${r} ${o.join(" ")}`,error:e instanceof Error?e.message:String(e)}}}async isMcpInstalled(e,t={}){let r=this.resolveCommand();try{return await this.runCli(r,["mcp","get",e],t.cwd,5e3),!0}catch{return!1}}async installSkill(e,t){let r=i.join(this.getConfigDir(),"skills",e);try{if(!o.existsSync(t))return{ok:!1,method:"symlink",detail:r,error:`Source skill dir does not exist: ${t}`};o.mkdirSync(i.dirname(r),{recursive:!0});let e=await o.promises.lstat(r).catch(()=>null);if(e)if(!(e.isSymbolicLink()||(0,n.isWindows)()&&e.isDirectory()))return{ok:!1,method:"symlink",detail:r,error:`Refusing to overwrite non-symlink at ${r}`};else try{let e=await o.promises.readlink(r);if(i.resolve(e)===i.resolve(t))return{ok:!0,method:"symlink",detail:`${r} → ${t} (already)`};await o.promises.unlink(r)}catch{if(!e.isSymbolicLink())return{ok:!1,method:"symlink",detail:r,error:`Refusing to overwrite non-symlink at ${r}`}}let s=(0,n.isWindows)()?"junction":"dir";return await o.promises.symlink(t,r,s),{ok:!0,method:"symlink",detail:`${r} → ${t}`}}catch(e){return{ok:!1,method:"symlink",detail:r,error:e instanceof Error?e.message:String(e)}}}async uninstallSkill(e){let t=i.join(this.getConfigDir(),"skills",e);try{let e=await o.promises.lstat(t).catch(()=>null);if(!e)return{ok:!0,method:"symlink",detail:`${t} (already absent)`};if(!e.isSymbolicLink())return{ok:!1,method:"symlink",detail:t,error:`Refusing to remove non-symlink at ${t}`};return await o.promises.unlink(t),{ok:!0,method:"symlink",detail:t}}catch(e){return{ok:!1,method:"symlink",detail:t,error:e instanceof Error?e.message:String(e)}}}async isSkillInstalled(e,t){let r=i.join(this.getConfigDir(),"skills",e);try{if(!(await o.promises.lstat(r)).isSymbolicLink())return!1;if(!t)return!0;let e=await o.promises.readlink(r),s=i.isAbsolute(e)?e:i.resolve(i.dirname(r),e);return i.resolve(s)===i.resolve(t)}catch{return!1}}async runCli(t,r,o,s=1e4){let{execFile:i}=await e.A(482848),{promisify:n}=await e.A(268548),a=n(i),{stdout:l}=await a(t,r,{cwd:o,timeout:s});return l}async isAvailable(){return null!==await this.getVersion()}async getVersion(){try{let{execFile:t}=await e.A(144264),{promisify:r}=await e.A(534777),{resolveSpawnTarget:o}=await e.A(200628),s=r(t),i=await o(this.resolveCommand(),["--version"]),{stdout:n}=await s(i.command,i.args,{timeout:5e3});return n.trim()||null}catch{return null}}async getModels(){return l}getConfigDir(){return i.join(s.homedir(),".codex")}getSettingsPath(){return i.join(this.getConfigDir(),"config.toml")}getSessionsDir(){return i.join(this.getConfigDir(),"sessions")}getApiKeyInfo(){return{envVar:"OPENAI_API_KEY",required:!1}}buildHelloProbeArgs(e){return{command:this.resolveCommand(),args:["exec",e]}}resolveCommand(){return process.env.CODEX_CLI_PATH?process.env.CODEX_CLI_PATH:(0,n.resolveCommandPathSync)("codex")}getHooksPath(){return i.join(this.getConfigDir(),"hooks.json")}readHooks(){try{return JSON.parse(o.readFileSync(this.getHooksPath(),"utf-8")).hooks??{}}catch{return{}}}writeHooks(e){let t=this.getConfigDir();o.existsSync(t)||o.mkdirSync(t,{recursive:!0}),o.writeFileSync(this.getHooksPath(),JSON.stringify({hooks:e},null,2),"utf-8")}ensureHooksFeatureEnabled(){let e=this.getSettingsPath(),t="";try{t=o.readFileSync(e,"utf-8")}catch{}if(/codex_hooks\s*=\s*true/.test(t))return;/\[features\]/.test(t)?t=t.replace(/\[features\]/,"[features]\ncodex_hooks = true"):t+="\n[features]\ncodex_hooks = true\n";let r=this.getConfigDir();o.existsSync(r)||o.mkdirSync(r,{recursive:!0}),o.writeFileSync(e,t,"utf-8")}getHookArray(e,t){let r=e[t];return Array.isArray(r)?r:[]}hasHook(e,t){return e.some(e=>e.hooks?.some(e=>e.command?.includes(t)))}}},models:{cli:["o4-mini","o3","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","codex-mini-latest"],api:[]}}),d.__providerRegistry=c}let c=d.__providerRegistry;e.s(["providerRegistry",0,c],279711)},482819,(e,t,r)=>{"use strict";t.exports=e.r(583981).vendored["react-rsc"].ReactServerDOMTurbopackServer},921675,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"registerServerReference",{enumerable:!0,get:function(){return o.registerServerReference}});let o=e.r(482819)},86708,(e,t,r)=>{"use strict";function o(e){for(let t=0;t<e.length;t++){let r=e[t];if("function"!=typeof r)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof r}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ensureServerEntryExports",{enumerable:!0,get:function(){return o}})},932583,e=>{"use strict";var t=e.i(921675),r=e.i(843793);async function o(e,t={}){let s=t.report,i=s?JSON.stringify(s):null;await r.db.providerConnection.upsert({where:{provider:e},create:{provider:e,lastTestedAt:new Date,testOk:!0,version:t.version??null,mcpInstalled:s?.mcp?.ok??!1,hooksInstalled:s?.hooks?.ok??!1,skillsInstalled:s?.skill?.ok??!1,installLog:i},update:{lastTestedAt:new Date,testOk:!0,version:t.version??null,mcpInstalled:s?.mcp?.ok??!1,hooksInstalled:s?.hooks?.ok??!1,skillsInstalled:s?.skill?.ok??!1,installLog:i}})}async function s(e,t={}){await r.db.providerConnection.upsert({where:{provider:e},create:{provider:e,lastTestedAt:new Date,testOk:!1,installLog:t.reason??null},update:{lastTestedAt:new Date,testOk:!1,mcpInstalled:!1,hooksInstalled:!1,skillsInstalled:!1,installLog:t.reason??null}})}async function i(e){let t=await r.db.providerConnection.findUnique({where:{provider:e}});return!!t&&t.testOk}async function n(){return(await r.db.providerConnection.findMany({where:{testOk:!0},select:{provider:!0},orderBy:{provider:"asc"}})).map(e=>e.provider)}async function a(){return r.db.providerConnection.findMany({select:{provider:!0,lastTestedAt:!0,testOk:!0,version:!0,mcpInstalled:!0,hooksInstalled:!0,skillsInstalled:!0,installLog:!0},orderBy:{provider:"asc"}})}(0,e.i(86708).ensureServerEntryExports)([o,s,i,n,a]),(0,t.registerServerReference)(o,"6030f870d42d6801ece1b50b58406c32c13e439c75",null),(0,t.registerServerReference)(s,"60fbe09f4aeb16d2e35c9b9954d84dfca46dfe6a10",null),(0,t.registerServerReference)(i,"406b13e3529c30b829a38fc46c50e737be1956434c",null),(0,t.registerServerReference)(n,"0085b57a80d52b54847458f24e6aa7f8b9259fd613",null),(0,t.registerServerReference)(a,"00b315cf89d7e6e2606e3e27cf240b74384141b96a",null),e.s(["getConnectedProviders",0,n,"isProviderConnected",0,i,"markProviderConnected",0,o,"markProviderDisconnected",0,s])}];
3
-
4
- //# sourceMappingURL=_0qk_esg._.js.map
@@ -1,5 +0,0 @@
1
- module.exports=[605171,t=>{"use strict";var e=t.i(750227),i=t.i(902157);t.i(660526);var s=t.i(427699),r=t.i(522734),n=t.i(687769),h=t.i(81111),o=t.i(899871),a=t.i(814747),l=t.i(449719),d=t.i(500874),u=t.i(406461),f=t.i(57328),c=t.i(666680),p=t.i(912714),m=Object.defineProperty,y="object"==typeof process&&process?process:{stdout:null,stderr:null},b=t=>!!t&&"object"==typeof t&&(t instanceof te||t instanceof h.default||E(t)||g(t)),E=t=>!!t&&"object"==typeof t&&t instanceof n.EventEmitter&&"function"==typeof t.pipe&&t.pipe!==h.default.Writable.prototype.pipe,g=t=>!!t&&"object"==typeof t&&t instanceof n.EventEmitter&&"function"==typeof t.write&&"function"==typeof t.end,w=Symbol("EOF"),R=Symbol("maybeEmitEnd"),v=Symbol("emittedEnd"),_=Symbol("emittingEnd"),S=Symbol("emittedError"),O=Symbol("closed"),T=Symbol("read"),k=Symbol("flush"),L=Symbol("flushChunk"),x=Symbol("encoding"),A=Symbol("decoder"),N=Symbol("flowing"),D=Symbol("paused"),I=Symbol("resume"),C=Symbol("buffer"),B=Symbol("pipes"),M=Symbol("bufferLength"),F=Symbol("bufferPush"),P=Symbol("bufferShift"),z=Symbol("objectMode"),U=Symbol("destroyed"),j=Symbol("error"),H=Symbol("emitData"),Z=Symbol("emitEnd"),G=Symbol("emitEnd2"),W=Symbol("async"),$=Symbol("abort"),V=Symbol("aborted"),Y=Symbol("signal"),q=Symbol("dataListeners"),K=Symbol("discarded"),X=t=>Promise.resolve().then(t),Q=t=>t(),J=class{src;dest;opts;ondrain;constructor(t,e,i){this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[I](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},tt=class extends J{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,i){super(t,e,i),this.proxyErrors=t=>this.dest.emit("error",t),t.on("error",this.proxyErrors)}},te=class extends n.EventEmitter{[N]=!1;[D]=!1;[B]=[];[C]=[];[z];[x];[W];[A];[w]=!1;[v]=!1;[_]=!1;[O]=!1;[S]=null;[M]=0;[U]=!1;[Y];[V]=!1;[q]=0;[K]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&"string"==typeof e.encoding)throw TypeError("Encoding and objectMode may not be used together");(t=>!!t.objectMode)(e)?(this[z]=!0,this[x]=null):(t=>!t.objectMode&&!!t.encoding&&"buffer"!==t.encoding)(e)?(this[x]=e.encoding,this[z]=!1):(this[z]=!1,this[x]=null),this[W]=!!e.async,this[A]=this[x]?new o.StringDecoder(this[x]):null,e&&!0===e.debugExposeBuffer&&Object.defineProperty(this,"buffer",{get:()=>this[C]}),e&&!0===e.debugExposePipes&&Object.defineProperty(this,"pipes",{get:()=>this[B]});let{signal:i}=e;i&&(this[Y]=i,i.aborted?this[$]():i.addEventListener("abort",()=>this[$]()))}get bufferLength(){return this[M]}get encoding(){return this[x]}set encoding(t){throw Error("Encoding must be set at instantiation time")}setEncoding(t){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[z]}set objectMode(t){throw Error("objectMode must be set at instantiation time")}get async(){return this[W]}set async(t){this[W]=this[W]||!!t}[$](){this[V]=!0,this.emit("abort",this[Y]?.reason),this.destroy(this[Y]?.reason)}get aborted(){return this[V]}set aborted(t){}write(t,e,i){if(this[V])return!1;if(this[w])throw Error("write after end");if(this[U])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;"function"==typeof e&&(i=e,e="utf8"),e||(e="utf8");let s=this[W]?X:Q;if(!this[z]&&!Buffer.isBuffer(t)){let e;if(e=t,!Buffer.isBuffer(e)&&ArrayBuffer.isView(e))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else{let e;if((e=t)instanceof ArrayBuffer||e&&"object"==typeof e&&e.constructor&&"ArrayBuffer"===e.constructor.name&&e.byteLength>=0)t=Buffer.from(t);else if("string"!=typeof t)throw Error("Non-contiguous data written to non-objectMode stream")}}return this[z]?(this[N]&&0!==this[M]&&this[k](!0),this[N]?this.emit("data",t):this[F](t)):t.length&&("string"==typeof t&&(e!==this[x]||this[A]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[x]&&(t=this[A].write(t)),this[N]&&0!==this[M]&&this[k](!0),this[N]?this.emit("data",t):this[F](t)),0!==this[M]&&this.emit("readable"),i&&s(i),this[N]}read(t){if(this[U])return null;if(this[K]=!1,0===this[M]||0===t||t&&t>this[M])return this[R](),null;this[z]&&(t=null),this[C].length>1&&!this[z]&&(this[C]=[this[x]?this[C].join(""):Buffer.concat(this[C],this[M])]);let e=this[T](t||null,this[C][0]);return this[R](),e}[T](t,e){if(this[z])this[P]();else{let i=e;t===i.length||null===t?this[P]():("string"==typeof i?(this[C][0]=i.slice(t),e=i.slice(0,t)):(this[C][0]=i.subarray(t),e=i.subarray(0,t)),this[M]-=t)}return this.emit("data",e),this[C].length||this[w]||this.emit("drain"),e}end(t,e,i){return"function"==typeof t&&(i=t,t=void 0),"function"==typeof e&&(i=e,e="utf8"),void 0!==t&&this.write(t,e),i&&this.once("end",i),this[w]=!0,this.writable=!1,(this[N]||!this[D])&&this[R](),this}[I](){this[U]||(this[q]||this[B].length||(this[K]=!0),this[D]=!1,this[N]=!0,this.emit("resume"),this[C].length?this[k]():this[w]?this[R]():this.emit("drain"))}resume(){return this[I]()}pause(){this[N]=!1,this[D]=!0,this[K]=!1}get destroyed(){return this[U]}get flowing(){return this[N]}get paused(){return this[D]}[F](t){this[z]?this[M]+=1:this[M]+=t.length,this[C].push(t)}[P](){return this[z]?this[M]-=1:this[M]-=this[C][0].length,this[C].shift()}[k](t=!1){do;while(this[L](this[P]())&&this[C].length)t||this[C].length||this[w]||this.emit("drain")}[L](t){return this.emit("data",t),this[N]}pipe(t,e){if(this[U])return t;this[K]=!1;let i=this[v];return e=e||{},t===y.stdout||t===y.stderr?e.end=!1:e.end=!1!==e.end,e.proxyErrors=!!e.proxyErrors,i?e.end&&t.end():(this[B].push(e.proxyErrors?new tt(this,t,e):new J(this,t,e)),this[W]?X(()=>this[I]()):this[I]()),t}unpipe(t){let e=this[B].find(e=>e.dest===t);e&&(1===this[B].length?(this[N]&&0===this[q]&&(this[N]=!1),this[B]=[]):this[B].splice(this[B].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let i=super.on(t,e);if("data"===t)this[K]=!1,this[q]++,this[B].length||this[N]||this[I]();else if("readable"===t&&0!==this[M])super.emit("readable");else("end"===t||"finish"===t||"prefinish"===t)&&this[v]?(super.emit(t),this.removeAllListeners(t)):"error"===t&&this[S]&&(this[W]?X(()=>e.call(this,this[S])):e.call(this,this[S]));return i}removeListener(t,e){return this.off(t,e)}off(t,e){let i=super.off(t,e);return"data"===t&&(this[q]=this.listeners("data").length,0!==this[q]||this[K]||this[B].length||(this[N]=!1)),i}removeAllListeners(t){let e=super.removeAllListeners(t);return("data"===t||void 0===t)&&(this[q]=0,this[K]||this[B].length||(this[N]=!1)),e}get emittedEnd(){return this[v]}[R](){this[_]||this[v]||this[U]||0!==this[C].length||!this[w]||(this[_]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[O]&&this.emit("close"),this[_]=!1)}emit(t,...e){let i=e[0];if("error"!==t&&"close"!==t&&t!==U&&this[U])return!1;if("data"===t)return(!!this[z]||!!i)&&(this[W]?(X(()=>this[H](i)),!0):this[H](i));if("end"===t)return this[Z]();if("close"===t){if(this[O]=!0,!this[v]&&!this[U])return!1;let t=super.emit("close");return this.removeAllListeners("close"),t}if("error"===t){this[S]=i,super.emit(j,i);let t=(!this[Y]||!!this.listeners("error").length)&&super.emit("error",i);return this[R](),t}if("resume"===t){let t=super.emit("resume");return this[R](),t}if("finish"===t||"prefinish"===t){let e=super.emit(t);return this.removeAllListeners(t),e}let s=super.emit(t,...e);return this[R](),s}[H](t){for(let e of this[B])!1===e.dest.write(t)&&this.pause();let e=!this[K]&&super.emit("data",t);return this[R](),e}[Z](){return!this[v]&&(this[v]=!0,this.readable=!1,this[W]?(X(()=>this[G]()),!0):this[G]())}[G](){if(this[A]){let t=this[A].end();if(t){for(let e of this[B])e.dest.write(t);this[K]||super.emit("data",t)}}for(let t of this[B])t.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[z]||(t.dataLength=0);let e=this.promise();return this.on("data",e=>{t.push(e),this[z]||(t.dataLength+=e.length)}),await e,t}async concat(){if(this[z])throw Error("cannot concat in objectMode");let t=await this.collect();return this[x]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(U,()=>e(Error("stream destroyed"))),this.on("error",t=>e(t)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[K]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(null!==i)return Promise.resolve({done:!1,value:i});if(this[w])return e();let s,r,n=t=>{this.off("data",h),this.off("end",o),this.off(U,a),e(),r(t)},h=t=>{this.off("error",n),this.off("end",o),this.off(U,a),this.pause(),s({value:t,done:!!this[w]})},o=()=>{this.off("error",n),this.off("data",h),this.off(U,a),e(),s({done:!0,value:void 0})},a=()=>n(Error("stream destroyed"));return new Promise((t,e)=>{r=e,s=t,this.once(U,a),this.once("error",n),this.once("end",o),this.once("data",h)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[K]=!1;let t=!1,e=()=>(this.pause(),this.off(j,e),this.off(U,e),this.off("end",e),t=!0,{done:!0,value:void 0}),i=()=>{if(t)return e();let i=this.read();return null===i?e():{done:!1,value:i}};return this.once("end",e),this.once(j,e),this.once(U,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){return this[U]||(this[U]=!0,this[K]=!0,this[C].length=0,this[M]=0,"function"!=typeof this.close||this[O]||this.close()),t?this.emit("error",t):this.emit(U),this}static get isStream(){return b}},ti=r.default.writev,ts=Symbol("_autoClose"),tr=Symbol("_close"),tn=Symbol("_ended"),th=Symbol("_fd"),to=Symbol("_finished"),ta=Symbol("_flags"),tl=Symbol("_flush"),td=Symbol("_handleChunk"),tu=Symbol("_makeBuf"),tf=Symbol("_mode"),tc=Symbol("_needDrain"),tp=Symbol("_onerror"),tm=Symbol("_onopen"),ty=Symbol("_onread"),tb=Symbol("_onwrite"),tE=Symbol("_open"),tg=Symbol("_path"),tw=Symbol("_pos"),tR=Symbol("_queue"),tv=Symbol("_read"),t_=Symbol("_readSize"),tS=Symbol("_reading"),tO=Symbol("_remain"),tT=Symbol("_size"),tk=Symbol("_write"),tL=Symbol("_writing"),tx=Symbol("_defaultFlag"),tA=Symbol("_errored"),tN=class extends te{[tA]=!1;[th];[tg];[t_];[tS]=!1;[tT];[tO];[ts];constructor(t,e){if(super(e=e||{}),this.readable=!0,this.writable=!1,"string"!=typeof t)throw TypeError("path must be a string");this[tA]=!1,this[th]="number"==typeof e.fd?e.fd:void 0,this[tg]=t,this[t_]=e.readSize||0x1000000,this[tS]=!1,this[tT]="number"==typeof e.size?e.size:1/0,this[tO]=this[tT],this[ts]="boolean"!=typeof e.autoClose||e.autoClose,"number"==typeof this[th]?this[tv]():this[tE]()}get fd(){return this[th]}get path(){return this[tg]}write(){throw TypeError("this is a readable stream")}end(){throw TypeError("this is a readable stream")}[tE](){r.default.open(this[tg],"r",(t,e)=>this[tm](t,e))}[tm](t,e){t?this[tp](t):(this[th]=e,this.emit("open",e),this[tv]())}[tu](){return Buffer.allocUnsafe(Math.min(this[t_],this[tO]))}[tv](){if(!this[tS]){this[tS]=!0;let t=this[tu]();if(0===t.length)return process.nextTick(()=>this[ty](null,0,t));r.default.read(this[th],t,0,t.length,null,(t,e,i)=>this[ty](t,e,i))}}[ty](t,e,i){this[tS]=!1,t?this[tp](t):this[td](e,i)&&this[tv]()}[tr](){if(this[ts]&&"number"==typeof this[th]){let t=this[th];this[th]=void 0,r.default.close(t,t=>t?this.emit("error",t):this.emit("close"))}}[tp](t){this[tS]=!0,this[tr](),this.emit("error",t)}[td](t,e){let i=!1;return this[tO]-=t,t>0&&(i=super.write(t<e.length?e.subarray(0,t):e)),(0===t||this[tO]<=0)&&(i=!1,this[tr](),super.end()),i}emit(t,...e){switch(t){case"prefinish":case"finish":return!1;case"drain":return"number"==typeof this[th]&&this[tv](),!1;case"error":return!this[tA]&&(this[tA]=!0,super.emit(t,...e));default:return super.emit(t,...e)}}},tD=class extends tN{[tE](){let t=!0;try{this[tm](null,r.default.openSync(this[tg],"r")),t=!1}finally{t&&this[tr]()}}[tv](){let t=!0;try{if(!this[tS]){for(this[tS]=!0;;){let t=this[tu](),e=0===t.length?0:r.default.readSync(this[th],t,0,t.length,null);if(!this[td](e,t))break}this[tS]=!1}t=!1}finally{t&&this[tr]()}}[tr](){if(this[ts]&&"number"==typeof this[th]){let t=this[th];this[th]=void 0,r.default.closeSync(t),this.emit("close")}}},tI=class extends s.default{readable=!1;writable=!0;[tA]=!1;[tL]=!1;[tn]=!1;[tR]=[];[tc]=!1;[tg];[tf];[ts];[th];[tx];[ta];[to]=!1;[tw];constructor(t,e){super(e=e||{}),this[tg]=t,this[th]="number"==typeof e.fd?e.fd:void 0,this[tf]=void 0===e.mode?438:e.mode,this[tw]="number"==typeof e.start?e.start:void 0,this[ts]="boolean"!=typeof e.autoClose||e.autoClose;let i=void 0!==this[tw]?"r+":"w";this[tx]=void 0===e.flags,this[ta]=void 0===e.flags?i:e.flags,void 0===this[th]&&this[tE]()}emit(t,...e){if("error"===t){if(this[tA])return!1;this[tA]=!0}return super.emit(t,...e)}get fd(){return this[th]}get path(){return this[tg]}[tp](t){this[tr](),this[tL]=!0,this.emit("error",t)}[tE](){r.default.open(this[tg],this[ta],this[tf],(t,e)=>this[tm](t,e))}[tm](t,e){this[tx]&&"r+"===this[ta]&&t&&"ENOENT"===t.code?(this[ta]="w",this[tE]()):t?this[tp](t):(this[th]=e,this.emit("open",e),this[tL]||this[tl]())}end(t,e){return t&&this.write(t,e),this[tn]=!0,this[tL]||this[tR].length||"number"!=typeof this[th]||this[tb](null,0),this}write(t,e){return"string"==typeof t&&(t=Buffer.from(t,e)),this[tn]?(this.emit("error",Error("write() after end()")),!1):void 0===this[th]||this[tL]||this[tR].length?(this[tR].push(t),this[tc]=!0,!1):(this[tL]=!0,this[tk](t),!0)}[tk](t){r.default.write(this[th],t,0,t.length,this[tw],(t,e)=>this[tb](t,e))}[tb](t,e){t?this[tp](t):(void 0!==this[tw]&&"number"==typeof e&&(this[tw]+=e),this[tR].length?this[tl]():(this[tL]=!1,this[tn]&&!this[to]?(this[to]=!0,this[tr](),this.emit("finish")):this[tc]&&(this[tc]=!1,this.emit("drain"))))}[tl](){if(0===this[tR].length)this[tn]&&this[tb](null,0);else if(1===this[tR].length)this[tk](this[tR].pop());else{let t=this[tR];this[tR]=[],ti(this[th],t,this[tw],(t,e)=>this[tb](t,e))}}[tr](){if(this[ts]&&"number"==typeof this[th]){let t=this[th];this[th]=void 0,r.default.close(t,t=>t?this.emit("error",t):this.emit("close"))}}},tC=class extends tI{[tE](){let t;if(this[tx]&&"r+"===this[ta])try{t=r.default.openSync(this[tg],this[ta],this[tf])}catch(t){if(t?.code==="ENOENT")return this[ta]="w",this[tE]();throw t}else t=r.default.openSync(this[tg],this[ta],this[tf]);this[tm](null,t)}[tr](){if(this[ts]&&"number"==typeof this[th]){let t=this[th];this[th]=void 0,r.default.closeSync(t),this.emit("close")}}[tk](t){let e=!0;try{this[tb](null,r.default.writeSync(this[th],t,0,t.length,this[tw])),e=!1}finally{if(e)try{this[tr]()}catch{}}}},tB=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),tM=t=>tB.get(t)||t,tF=(t={})=>{if(!t)return{};let e={};for(let[i,s]of Object.entries(t))e[tM(i)]=s;return void 0===e.chmod&&!1===e.noChmod&&(e.chmod=!0),delete e.noChmod,e},tP=(t,e,i,s,r)=>Object.assign((n=[],h,o)=>{Array.isArray(n)&&(h=n,n={}),"function"==typeof h&&(o=h,h=void 0),h=h?Array.from(h):[];let a=tF(n);if(r?.(a,h),a.sync&&a.file){if("function"==typeof o)throw TypeError("callback not supported for sync tar functions");return t(a,h)}if(a.sync||!a.file)if(!a.sync||a.file){if(!a.sync&&!a.file){if("function"==typeof o)throw TypeError("callback only supported with file option");return s(a,h)}}else{if("function"==typeof o)throw TypeError("callback not supported for sync tar functions");return i(a,h)}else{let t=e(a,h);return o?t.then(()=>o(),o):t}throw Error("impossible options??")},{syncFile:t,asyncFile:e,syncNoFile:i,asyncNoFile:s,validate:r}),tz=u.default.constants||{ZLIB_VERNUM:4736},tU=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},tz)),tj=d.Buffer.concat,tH=Object.getOwnPropertyDescriptor(d.Buffer,"concat"),tZ=t=>t,tG=tH?.writable===!0||tH?.set!==void 0?t=>{d.Buffer.concat=t?tZ:tj}:t=>{},tW=Symbol("_superWrite"),t$=class extends Error{code;errno;constructor(t,e){super("zlib: "+t.message,{cause:t}),this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,e??this.constructor)}get name(){return"ZlibError"}},tV=Symbol("flushFlag"),tY=class extends te{#t=!1;#e=!1;#i;#s;#r;#n;#h;get sawError(){return this.#t}get handle(){return this.#n}get flushFlag(){return this.#i}constructor(t,e){if(!t||"object"!=typeof t)throw TypeError("invalid options for ZlibBase constructor");if(super(t),this.#i=t.flush??0,this.#s=t.finishFlush??0,this.#r=t.fullFlushFlag??0,"function"!=typeof u[e])throw TypeError("Compression method not supported: "+e);try{this.#n=new u[e](t)}catch(t){throw new t$(t,this.constructor)}this.#h=t=>{this.#t||(this.#t=!0,this.close(),this.emit("error",t))},this.#n?.on("error",t=>this.#h(new t$(t))),this.once("end",()=>this.close)}close(){this.#n&&(this.#n.close(),this.#n=void 0,this.emit("close"))}reset(){if(!this.#t)return(0,l.default)(this.#n,"zlib binding closed"),this.#n.reset?.()}flush(t){this.ended||("number"!=typeof t&&(t=this.#r),this.write(Object.assign(d.Buffer.alloc(0),{[tV]:t})))}end(t,e,i){return"function"==typeof t&&(i=t,e=void 0,t=void 0),"function"==typeof e&&(i=e,e=void 0),t&&(e?this.write(t,e):this.write(t)),this.flush(this.#s),this.#e=!0,super.end(i)}get ended(){return this.#e}[tW](t){return super.write(t)}write(t,e,i){let s,r;if("function"==typeof e&&(i=e,e="utf8"),"string"==typeof t&&(t=d.Buffer.from(t,e)),this.#t)return;(0,l.default)(this.#n,"zlib binding closed");let n=this.#n._handle,h=n.close;n.close=()=>{};let o=this.#n.close;this.#n.close=()=>{},tG(!0);try{let e="number"==typeof t[tV]?t[tV]:this.#i;s=this.#n._processChunk(t,e),tG(!1)}catch(t){tG(!1),this.#h(new t$(t,this.write))}finally{this.#n&&(this.#n._handle=n,n.close=h,this.#n.close=o,this.#n.removeAllListeners("error"))}if(this.#n&&this.#n.on("error",t=>this.#h(new t$(t,this.write))),s)if(Array.isArray(s)&&s.length>0){let t=s[0];r=this[tW](d.Buffer.from(t));for(let t=1;t<s.length;t++)r=this[tW](s[t])}else r=this[tW](d.Buffer.from(s));return i&&i(),r}},tq=class extends tY{#t;#e;constructor(t,e){(t=t||{}).flush=t.flush||tU.Z_NO_FLUSH,t.finishFlush=t.finishFlush||tU.Z_FINISH,t.fullFlushFlag=tU.Z_FULL_FLUSH,super(t,e),this.#t=t.level,this.#e=t.strategy}params(t,e){if(!this.sawError){if(!this.handle)throw Error("cannot switch params when binding is closed");if(!this.handle.params)throw Error("not supported in this implementation");if(this.#t!==t||this.#e!==e){this.flush(tU.Z_SYNC_FLUSH),(0,l.default)(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(t,e)=>{"function"==typeof t&&(e=t,t=this.flushFlag),this.flush(t),e?.()};try{this.handle.params(t,e)}finally{this.handle.flush=i}this.handle&&(this.#t=t,this.#e=e)}}}},tK=class extends tq{#t;constructor(t){super(t,"Gzip"),this.#t=t&&!!t.portable}[tW](t){return this.#t&&(this.#t=!1,t[9]=255),super[tW](t)}},tX=class extends tq{constructor(t){super(t,"Unzip")}},tQ=class extends tY{constructor(t,e){(t=t||{}).flush=t.flush||tU.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||tU.BROTLI_OPERATION_FINISH,t.fullFlushFlag=tU.BROTLI_OPERATION_FLUSH,super(t,e)}},tJ=class extends tQ{constructor(t){super(t,"BrotliCompress")}},t0=class extends tQ{constructor(t){super(t,"BrotliDecompress")}},t1=class extends tY{constructor(t,e){(t=t||{}).flush=t.flush||tU.ZSTD_e_continue,t.finishFlush=t.finishFlush||tU.ZSTD_e_end,t.fullFlushFlag=tU.ZSTD_e_flush,super(t,e)}},t2=class extends t1{constructor(t){super(t,"ZstdCompress")}},t5=class extends t1{constructor(t){super(t,"ZstdDecompress")}},t4=t=>(255^t)&255,t8=t=>(255^t)+1&255,t3={},t6={code:()=>ei,isCode:()=>t9,isName:()=>et,name:()=>ee};for(var t7 in t6)m(t3,t7,{get:t6[t7],enumerable:!0});var t9=t=>ee.has(t),et=t=>ei.has(t),ee=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),ei=new Map(Array.from(ee).map(t=>[t[1],t[0]])),es=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#t="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(t,e=0,i,s){Buffer.isBuffer(t)?this.decode(t,e||0,i,s):t&&this.#e(t)}decode(t,e,i,s){if(e||(e=0),!t||!(t.length>=e+512))throw Error("need 512 bytes for header");this.path=i?.path??en(t,e,100),this.mode=i?.mode??s?.mode??ea(t,e+100,8),this.uid=i?.uid??s?.uid??ea(t,e+108,8),this.gid=i?.gid??s?.gid??ea(t,e+116,8),this.size=i?.size??s?.size??ea(t,e+124,12),this.mtime=i?.mtime??s?.mtime??eh(t,e+136,12),this.cksum=ea(t,e+148,12),s&&this.#e(s,!0),i&&this.#e(i);let r=en(t,e+156,1);if(t9(r)&&(this.#t=r||"0"),"0"===this.#t&&"/"===this.path.slice(-1)&&(this.#t="5"),"5"===this.#t&&(this.size=0),this.linkpath=en(t,e+157,100),"ustar\x0000"===t.subarray(e+257,e+265).toString())if(this.uname=i?.uname??s?.uname??en(t,e+265,32),this.gname=i?.gname??s?.gname??en(t,e+297,32),this.devmaj=i?.devmaj??s?.devmaj??ea(t,e+329,8)??0,this.devmin=i?.devmin??s?.devmin??ea(t,e+337,8)??0,0!==t[e+475]){let i=en(t,e+345,155);this.path=i+"/"+this.path}else{let r=en(t,e+345,130);r&&(this.path=r+"/"+this.path),this.atime=i?.atime??s?.atime??eh(t,e+476,12),this.ctime=i?.ctime??s?.ctime??eh(t,e+488,12)}let n=256;for(let i=e;i<e+148;i++)n+=t[i];for(let i=e+156;i<e+512;i++)n+=t[i];this.cksumValid=n===this.cksum,void 0===this.cksum&&256===n&&(this.nullBlock=!0)}#e(t,e=!1){Object.assign(this,Object.fromEntries(Object.entries(t).filter(([t,i])=>!(null==i||"path"===t&&e||"linkpath"===t&&e||"global"===t))))}encode(t,e=0){if(t||(t=this.block=Buffer.alloc(512)),"Unsupported"===this.#t&&(this.#t="0"),!(t.length>=e+512))throw Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,s=er(this.path||"",i),r=s[0],n=s[1];this.needPax=!!s[2],this.needPax=eb(t,e,100,r)||this.needPax,this.needPax=eu(t,e+100,8,this.mode)||this.needPax,this.needPax=eu(t,e+108,8,this.uid)||this.needPax,this.needPax=eu(t,e+116,8,this.gid)||this.needPax,this.needPax=eu(t,e+124,12,this.size)||this.needPax,this.needPax=em(t,e+136,12,this.mtime)||this.needPax,t[e+156]=Number(this.#t.codePointAt(0)),this.needPax=eb(t,e+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",e+257,8),this.needPax=eb(t,e+265,32,this.uname)||this.needPax,this.needPax=eb(t,e+297,32,this.gname)||this.needPax,this.needPax=eu(t,e+329,8,this.devmaj)||this.needPax,this.needPax=eu(t,e+337,8,this.devmin)||this.needPax,this.needPax=eb(t,e+345,i,n)||this.needPax,0!==t[e+475]?this.needPax=eb(t,e+345,155,n)||this.needPax:(this.needPax=eb(t,e+345,130,n)||this.needPax,this.needPax=em(t,e+476,12,this.atime)||this.needPax,this.needPax=em(t,e+488,12,this.ctime)||this.needPax);let h=256;for(let i=e;i<e+148;i++)h+=t[i];for(let i=e+156;i<e+512;i++)h+=t[i];return this.cksum=h,eu(t,e+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return"Unsupported"===this.#t?this.#t:ee.get(this.#t)}get typeKey(){return this.#t}set type(t){let e=String(ei.get(t));if(t9(e)||"Unsupported"===e)this.#t=e;else if(t9(t))this.#t=t;else throw TypeError("invalid entry type: "+t)}},er=(t,i)=>{let s=t,r="",n,h=e.posix.parse(t).root||".";if(100>Buffer.byteLength(s))n=[s,r,!1];else{r=e.posix.dirname(s),s=e.posix.basename(s);do 100>=Buffer.byteLength(s)&&Buffer.byteLength(r)<=i?n=[s,r,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(r)<=i?n=[s.slice(0,99),r,!0]:(s=e.posix.join(e.posix.basename(r),s),r=e.posix.dirname(r));while(r!==h&&void 0===n)n||(n=[t.slice(0,99),"",!0])}return n},en=(t,e,i)=>t.subarray(e,e+i).toString("utf8").replace(/\0.*/,""),eh=(t,e,i)=>eo(ea(t,e,i)),eo=t=>void 0===t?void 0:new Date(1e3*t),ea=(t,e,i)=>128&Number(t[e])?(t=>{let e=t[0],i=128===e?(t=>{for(var e=t.length,i=0,s=e-1;s>-1;s--){var r=Number(t[s]);0!==r&&(i+=r*Math.pow(256,e-s-1))}return i})(t.subarray(1,t.length)):255===e?(t=>{for(var e=t.length,i=0,s=!1,r=e-1;r>-1;r--){var n,h=Number(t[r]);s?n=t4(h):0===h?n=h:(s=!0,n=t8(h)),0!==n&&(i-=n*Math.pow(256,e-r-1))}return i})(t):null;if(null===i)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i})(t.subarray(e,e+i)):el(t,e,i),el=(t,e,i)=>{let s;return isNaN(s=parseInt(t.subarray(e,e+i).toString("utf8").replace(/\0.*$/,"").trim(),8))?void 0:s},ed={12:0x1ffffffff,8:2097151},eu=(t,e,i,s)=>void 0!==s&&(s>ed[i]||s<0?(((t,e)=>{if(Number.isSafeInteger(t))t<0?((t,e)=>{e[0]=255;var i=!1;t*=-1;for(var s=e.length;s>1;s--){var r=255&t;t=Math.floor(t/256),i?e[s-1]=t4(r):0===r?e[s-1]=0:(i=!0,e[s-1]=t8(r))}})(t,e):((t,e)=>{e[0]=128;for(var i=e.length;i>1;i--)e[i-1]=255&t,t=Math.floor(t/256)})(t,e);else throw Error("cannot encode number outside of javascript safe integer range")})(s,t.subarray(e,e+i)),!0):(ef(t,e,i,s),!1)),ef=(t,e,i,s)=>t.write(ec(s,i),e,i,"ascii"),ec=(t,e)=>ep(Math.floor(t).toString(8),e),ep=(t,e)=>(t.length===e-1?t:Array(e-t.length-1).join("0")+t+" ")+"\0",em=(t,e,i,s)=>void 0!==s&&eu(t,e,i,s.getTime()/1e3),ey=Array(156).join("\0"),eb=(t,e,i,s)=>void 0!==s&&(t.write(s+ey,e,i,"utf8"),s.length!==Buffer.byteLength(s)||s.length>i),eE=class t{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,e=!1){this.atime=t.atime,this.charset=t.charset,this.comment=t.comment,this.ctime=t.ctime,this.dev=t.dev,this.gid=t.gid,this.global=e,this.gname=t.gname,this.ino=t.ino,this.linkpath=t.linkpath,this.mtime=t.mtime,this.nlink=t.nlink,this.path=t.path,this.size=t.size,this.uid=t.uid,this.uname=t.uname}encode(){let t=this.encodeBody();if(""===t)return Buffer.allocUnsafe(0);let i=Buffer.byteLength(t),s=512*Math.ceil(1+i/512),r=Buffer.allocUnsafe(s);for(let t=0;t<512;t++)r[t]=0;new es({path:("PaxHeader/"+(0,e.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:i,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(t,512,i,"utf8");for(let t=i+512;t<r.length;t++)r[t]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(void 0===this[t])return"";let e=this[t],i=" "+("dev"===t||"ino"===t||"nlink"===t?"SCHILY.":"")+t+"="+(e instanceof Date?e.getTime()/1e3:e)+`
2
- `,s=Buffer.byteLength(i),r=Math.floor(Math.log(s)/Math.log(10))+1;return s+r>=Math.pow(10,r)&&(r+=1),r+s+i}static parse(e,i,s=!1){return new t(eg(ew(e),i),s)}},eg=(t,e)=>e?Object.assign({},e,t):t,ew=t=>t.replace(/\n$/,"").split(`
3
- `).reduce(eR,Object.create(null)),eR=(t,e)=>{let i=parseInt(e,10);if(i!==Buffer.byteLength(e)+1)return t;let s=(e=e.slice((i+" ").length)).split("="),r=s.shift();if(!r)return t;let n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),h=s.join("=");return t[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(1e3*Number(h)):/^[0-9]+$/.test(h)?+h:h,t},ev="win32"!==(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)?t=>t:t=>t&&t.replaceAll(/\\/g,"/"),e_=class extends te{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(t,e,i){switch(super({}),this.pause(),this.extended=e,this.globalExtended=i,this.header=t,this.remain=t.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=t.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!t.path)throw Error("no path provided for tar.ReadEntry");this.path=ev(t.path),this.mode=t.mode,this.mode&&(this.mode=4095&this.mode),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=this.remain,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=t.linkpath?ev(t.linkpath):void 0,this.uname=t.uname,this.gname=t.gname,e&&this.#t(e),i&&this.#t(i,!0)}write(t){let e=t.length;if(e>this.blockRemain)throw Error("writing more to entry than is appropriate");let i=this.remain,s=this.blockRemain;return this.remain=Math.max(0,i-e),this.blockRemain=Math.max(0,s-e),!!this.ignore||(i>=e?super.write(t):super.write(t.subarray(0,i)))}#t(t,e=!1){t.path&&(t.path=ev(t.path)),t.linkpath&&(t.linkpath=ev(t.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(t).filter(([t,i])=>!(null==i||"path"===t&&e))))}},eS=(t,e,i,s={})=>{t.file&&(s.file=t.file),t.cwd&&(s.cwd=t.cwd),s.code=i instanceof Error&&i.code||e,s.tarCode=e,t.strict||!1===s.recoverable?i instanceof Error?t.emit("error",Object.assign(i,s)):t.emit("error",Object.assign(Error(`${e}: ${i}`),s)):(i instanceof Error&&(s=Object.assign(i,s),i=i.message),t.emit("warn",e,i,s))},eO=Buffer.from([31,139]),eT=Buffer.from([40,181,47,253]),ek=Math.max(eO.length,eT.length),eL=Symbol("state"),ex=Symbol("writeEntry"),eA=Symbol("readEntry"),eN=Symbol("nextEntry"),eD=Symbol("processEntry"),eI=Symbol("extendedHeader"),eC=Symbol("globalExtendedHeader"),eB=Symbol("meta"),eM=Symbol("emitMeta"),eF=Symbol("buffer"),eP=Symbol("queue"),ez=Symbol("ended"),eU=Symbol("emittedEnd"),ej=Symbol("emit"),eH=Symbol("unzip"),eZ=Symbol("consumeChunk"),eG=Symbol("consumeChunkSub"),eW=Symbol("consumeBody"),e$=Symbol("consumeMeta"),eV=Symbol("consumeHeader"),eY=Symbol("consuming"),eq=Symbol("bufferConcat"),eK=Symbol("maybeEnd"),eX=Symbol("writing"),eQ=Symbol("aborted"),eJ=Symbol("onDone"),e0=Symbol("sawValidEntry"),e1=Symbol("sawNullBlock"),e2=Symbol("sawEOF"),e5=Symbol("closeStream"),e4=()=>!0,e8=class extends s.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[eP]=[];[eF];[eA];[ex];[eL]="begin";[eB]="";[eI];[eC];[ez]=!1;[eH];[eQ]=!1;[e0];[e1]=!1;[e2]=!1;[eX]=!1;[eY]=!1;[eU]=!1;constructor(t={}){super(),this.file=t.file||"",this.on(eJ,()=>{("begin"===this[eL]||!1===this[e0])&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),t.ondone?this.on(eJ,t.ondone):this.on(eJ,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!t.strict,this.maxMetaEntrySize=t.maxMetaEntrySize||1048576,this.filter="function"==typeof t.filter?t.filter:e4;let e=t.file&&(t.file.endsWith(".tar.br")||t.file.endsWith(".tbr"));this.brotli=t.gzip||t.zstd||void 0===t.brotli?!!e&&void 0:t.brotli;let i=t.file&&(t.file.endsWith(".tar.zst")||t.file.endsWith(".tzst"));this.zstd=t.gzip||t.brotli||void 0===t.zstd?!!i||void 0:t.zstd,this.on("end",()=>this[e5]()),"function"==typeof t.onwarn&&this.on("warn",t.onwarn),"function"==typeof t.onReadEntry&&this.on("entry",t.onReadEntry)}warn(t,e,i={}){eS(this,t,e,i)}[eV](t,e){let i;void 0===this[e0]&&(this[e0]=!1);try{i=new es(t,e,this[eI],this[eC])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(i.nullBlock)this[e1]?(this[e2]=!0,"begin"===this[eL]&&(this[eL]="header"),this[ej]("eof")):(this[e1]=!0,this[ej]("nullBlock"));else if(this[e1]=!1,i.cksumValid)if(i.path){let t=i.type;if(/^(Symbolic)?Link$/.test(t)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(/^(Symbolic)?Link$/.test(t)||/^(Global)?ExtendedHeader$/.test(t)||!i.linkpath){let t=this[ex]=new e_(i,this[eI],this[eC]);if(!this[e0])if(t.remain){let e=()=>{t.invalid||(this[e0]=!0)};t.on("end",e)}else this[e0]=!0;t.meta?t.size>this.maxMetaEntrySize?(t.ignore=!0,this[ej]("ignoredEntry",t),this[eL]="ignore",t.resume()):t.size>0&&(this[eB]="",t.on("data",t=>this[eB]+=t),this[eL]="meta"):(this[eI]=void 0,t.ignore=t.ignore||!this.filter(t.path,t),t.ignore?(this[ej]("ignoredEntry",t),this[eL]=t.remain?"ignore":"header",t.resume()):(t.remain?this[eL]="body":(this[eL]="header",t.end()),this[eA]?this[eP].push(t):(this[eP].push(t),this[eN]())))}else this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i})}else this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i})}[e5](){queueMicrotask(()=>this.emit("close"))}[eD](t){let e=!0;if(t)if(Array.isArray(t)){let[e,...i]=t;this.emit(e,...i)}else this[eA]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",()=>this[eN]()),e=!1);else this[eA]=void 0,e=!1;return e}[eN](){do;while(this[eD](this[eP].shift()))if(0===this[eP].length){let t=this[eA];!t||t.flowing||t.size===t.remain?this[eX]||this.emit("drain"):t.once("drain",()=>this.emit("drain"))}}[eW](t,e){let i=this[ex];if(!i)throw Error("attempt to consume body without entry??");let s=i.blockRemain??0,r=s>=t.length&&0===e?t:t.subarray(e,e+s);return i.write(r),i.blockRemain||(this[eL]="header",this[ex]=void 0,i.end()),r.length}[e$](t,e){let i=this[ex],s=this[eW](t,e);return!this[ex]&&i&&this[eM](i),s}[ej](t,e,i){0!==this[eP].length||this[eA]?this[eP].push([t,e,i]):this.emit(t,e,i)}[eM](t){switch(this[ej]("meta",this[eB]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[eI]=eE.parse(this[eB],this[eI],!1);break;case"GlobalExtendedHeader":this[eC]=eE.parse(this[eB],this[eC],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[eI]??Object.create(null);this[eI]=t,t.path=this[eB].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[eI]||Object.create(null);this[eI]=t,t.linkpath=this[eB].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+t.type)}}abort(t){this[eQ]=!0,this.emit("abort",t),this.warn("TAR_ABORT",t,{recoverable:!1})}write(t,e,i){if("function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,"string"==typeof e?e:"utf8")),this[eQ])return i?.(),!1;if((void 0===this[eH]||void 0===this.brotli&&!1===this[eH])&&t){if(this[eF]&&(t=Buffer.concat([this[eF],t]),this[eF]=void 0),t.length<ek)return this[eF]=t,i?.(),!0;for(let e=0;void 0===this[eH]&&e<eO.length;e++)t[e]!==eO[e]&&(this[eH]=!1);let e=!1;if(!1===this[eH]&&!1!==this.zstd){e=!0;for(let i=0;i<eT.length;i++)if(t[i]!==eT[i]){e=!1;break}}let s=void 0===this.brotli&&!e;if(!1===this[eH]&&s)if(t.length<512)if(!this[ez])return this[eF]=t,i?.(),!0;else this.brotli=!0;else try{new es(t.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(void 0===this[eH]||!1===this[eH]&&(this.brotli||e)){let s=this[ez];this[ez]=!1,this[eH]=void 0===this[eH]?new tX({}):e?new t5({}):new t0({}),this[eH].on("data",t=>this[eZ](t)),this[eH].on("error",t=>this.abort(t)),this[eH].on("end",()=>{this[ez]=!0,this[eZ]()}),this[eX]=!0;let r=!!this[eH][s?"end":"write"](t);return this[eX]=!1,i?.(),r}}this[eX]=!0,this[eH]?this[eH].write(t):this[eZ](t),this[eX]=!1;let s=!(this[eP].length>0)&&(!this[eA]||this[eA].flowing);return s||0!==this[eP].length||this[eA]?.once("drain",()=>this.emit("drain")),i?.(),s}[eq](t){t&&!this[eQ]&&(this[eF]=this[eF]?Buffer.concat([this[eF],t]):t)}[eK](){if(this[ez]&&!this[eU]&&!this[eQ]&&!this[eY]){this[eU]=!0;let t=this[ex];if(t&&t.blockRemain){let e=this[eF]?this[eF].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${e} available)`,{entry:t}),this[eF]&&t.write(this[eF]),t.end()}this[ej](eJ)}}[eZ](t){if(this[eY]&&t)this[eq](t);else if(t||this[eF]){if(t){if(this[eY]=!0,this[eF]){this[eq](t);let e=this[eF];this[eF]=void 0,this[eG](e)}else this[eG](t);for(;this[eF]&&this[eF]?.length>=512&&!this[eQ]&&!this[e2];){let t=this[eF];this[eF]=void 0,this[eG](t)}this[eY]=!1}}else this[eK]();(!this[eF]||this[ez])&&this[eK]()}[eG](t){let e=0,i=t.length;for(;e+512<=i&&!this[eQ]&&!this[e2];)switch(this[eL]){case"begin":case"header":this[eV](t,e),e+=512;break;case"ignore":case"body":e+=this[eW](t,e);break;case"meta":e+=this[e$](t,e);break;default:throw Error("invalid state: "+this[eL])}e<i&&(this[eF]=this[eF]?Buffer.concat([t.subarray(e),this[eF]]):t.subarray(e))}end(t,e,i){return"function"==typeof t&&(i=t,e=void 0,t=void 0),"function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,e)),i&&this.once("finish",i),this[eQ]||(this[eH]?(t&&this[eH].write(t),this[eH].end()):(this[ez]=!0,(void 0===this.brotli||void 0===this.zstd)&&(t=t||Buffer.alloc(0)),t&&this.write(t),this[eK]())),this}},e3=t=>{let e=t.length-1,i=-1;for(;e>-1&&"/"===t.charAt(e);)i=e,e--;return -1===i?t:t.slice(0,i)},e6=(t,e)=>{let i=new Map(e.map(t=>[e3(t),!0])),s=t.filter,r=(t,e="")=>{let s=e||(0,a.parse)(t).root||".",n;if(t===s)n=!1;else{let e=i.get(t);n=void 0!==e?e:r((0,a.dirname)(t),s)}return i.set(t,n),n};t.filter=s?(t,e)=>s(t,e)&&r(e3(t)):t=>r(e3(t))},e7=tP(t=>{let e=new e8(t),s=t.file,r;try{r=i.default.openSync(s,"r");let n=i.default.fstatSync(r),h=t.maxReadSize||0x1000000;if(n.size<h){let t=Buffer.allocUnsafe(n.size),s=i.default.readSync(r,t,0,n.size,0);e.end(s===t.byteLength?t:t.subarray(0,s))}else{let t=0,s=Buffer.allocUnsafe(h);for(;t<n.size;){let n=i.default.readSync(r,s,0,h,t);if(0===n)break;t+=n,e.write(s.subarray(0,n))}e.end()}}finally{if("number"==typeof r)try{i.default.closeSync(r)}catch{}}},(t,e)=>{let s=new e8(t),r=t.maxReadSize||0x1000000,n=t.file;return new Promise((t,e)=>{s.on("error",e),s.on("end",t),i.default.stat(n,(t,i)=>{if(t)e(t);else{let t=new tN(n,{readSize:r,size:i.size});t.on("error",e),t.pipe(s)}})})},t=>new e8(t),t=>new e8(t),(t,e)=>{let i;e?.length&&e6(t,e),t.noResume||(i=t.onReadEntry,t.onReadEntry=i?t=>{i(t),t.resume()}:t=>t.resume())}),e9=(t,e,i)=>(t&=4095,i&&(t=(384|t)&-19),e&&(256&t&&(t|=64),32&t&&(t|=8),4&t&&(t|=1)),t),{isAbsolute:it,parse:ie}=e.win32,ii=t=>{let e="",i=ie(t);for(;it(t)||i.root;){let s="/"===t.charAt(0)&&"//?/"!==t.slice(0,4)?"/":i.root;t=t.slice(s.length),e+=s,i=ie(t)}return[e,t]},is=["|","<",">","?",":"],ir=is.map(t=>String.fromCodePoint(61440+Number(t.codePointAt(0)))),ih=new Map(is.map((t,e)=>[t,ir[e]])),io=new Map(ir.map((t,e)=>[t,is[e]])),ia=t=>is.reduce((t,e)=>t.split(e).join(ih.get(e)),t),il=(t,e)=>e?(t=ev(t).replace(/^\.(\/|$)/,""),e3(e)+"/"+t):ev(t),id=Symbol("process"),iu=Symbol("file"),ic=Symbol("directory"),ip=Symbol("symlink"),im=Symbol("hardlink"),iy=Symbol("header"),ib=Symbol("read"),iE=Symbol("lstat"),ig=Symbol("onlstat"),iw=Symbol("onread"),iR=Symbol("onreadlink"),iv=Symbol("openfile"),i_=Symbol("onopenfile"),iS=Symbol("close"),iO=Symbol("mode"),iT=Symbol("awaitDrain"),ik=Symbol("ondrain"),iL=Symbol("prefix"),ix=class extends te{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#t=!1;constructor(t,e={}){let i=tF(e);super(),this.path=ev(t),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||0x1000000,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=ev(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?ev(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let s=!1;if(!this.preservePaths){let[t,e]=ii(this.path);t&&"string"==typeof e&&(this.path=e,s=t)}this.win32=!!i.win32||"win32"===process.platform,this.win32&&(this.path=(t=>ir.reduce((t,e)=>t.split(e).join(io.get(e)),t))(this.path.replaceAll(/\\/g,"/")),t=t.replaceAll(/\\/g,"/")),this.absolute=ev(i.absolute||a.default.resolve(this.cwd,t)),""===this.path&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path});let r=this.statCache.get(this.absolute);r?this[ig](r):this[iE]()}warn(t,e,i={}){return eS(this,t,e,i)}emit(t,...e){return"error"===t&&(this.#t=!0),super.emit(t,...e)}[iE](){r.default.lstat(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[ig](e)})}[ig](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=iD(t),this.emit("stat",t),this[id]()}[id](){switch(this.type){case"File":return this[iu]();case"Directory":return this[ic]();case"SymbolicLink":return this[ip]();default:return this.end()}}[iO](t){return e9(t,"Directory"===this.type,this.portable)}[iL](t){return il(t,this.prefix)}[iy](){if(!this.stat)throw Error("cannot write header before stat");"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new es({path:this[iL](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[iL](this.linkpath):this.linkpath,mode:this[iO](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:"Unsupported"===this.type?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new eE({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[iL](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[iL](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let t=this.header?.block;if(!t)throw Error("failed to encode header");super.write(t)}[ic](){if(!this.stat)throw Error("cannot create directory entry without stat");"/"!==this.path.slice(-1)&&(this.path+="/"),this.stat.size=0,this[iy](),this.end()}[ip](){r.default.readlink(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[iR](e)})}[iR](t){this.linkpath=ev(t),this[iy](),this.end()}[im](t){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=ev(a.default.relative(this.cwd,t)),this.stat.size=0,this[iy](),this.end()}[iu](){if(!this.stat)throw Error("cannot create file entry without stat");if(this.stat.nlink>1){let t=`${this.stat.dev}:${this.stat.ino}`,e=this.linkCache.get(t);if(e?.indexOf(this.cwd)===0)return this[im](e);this.linkCache.set(t,this.absolute)}if(this[iy](),0===this.stat.size)return this.end();this[iv]()}[iv](){r.default.open(this.absolute,"r",(t,e)=>{if(t)return this.emit("error",t);this[i_](e)})}[i_](t){if(this.fd=t,this.#t)return this[iS]();if(!this.stat)throw Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let e=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(e),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[ib]()}[ib](){let{fd:t,buf:e,offset:i,length:s,pos:n}=this;if(void 0===t||void 0===e)throw Error("cannot read file without first opening");r.default.read(t,e,i,s,n,(t,e)=>{if(t)return this[iS](()=>this.emit("error",t));this[iw](e)})}[iS](t=()=>{}){void 0!==this.fd&&r.default.close(this.fd,t)}[iw](t){if(t<=0&&this.remain>0){let t=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[iS](()=>this.emit("error",t))}if(t>this.remain){let t=Object.assign(Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[iS](()=>this.emit("error",t))}if(!this.buf)throw Error("should have created buffer prior to reading");if(t===this.remain)for(let e=t;e<this.length&&t<this.blockRemain;e++)this.buf[e+this.offset]=0,t++,this.remain++;let e=0===this.offset&&t===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+t);this.write(e)?this[ik]():this[iT](()=>this[ik]())}[iT](t){this.once("drain",t)}write(t,e,i){if("function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,"string"==typeof e?e:"utf8")),this.blockRemain<t.length){let t=Object.assign(Error("writing more data than expected"),{path:this.absolute});return this.emit("error",t)}return this.remain-=t.length,this.blockRemain-=t.length,this.pos+=t.length,this.offset+=t.length,super.write(t,null,i)}[ik](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[iS](t=>t?this.emit("error",t):this.end());if(!this.buf)throw Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[ib]()}},iA=class extends ix{sync=!0;[iE](){this[ig](r.default.lstatSync(this.absolute))}[ip](){this[iR](r.default.readlinkSync(this.absolute))}[iv](){this[i_](r.default.openSync(this.absolute,"r"))}[ib](){let t=!0;try{let{fd:e,buf:i,offset:s,length:n,pos:h}=this;if(void 0===e||void 0===i)throw Error("fd and buf must be set in READ method");let o=r.default.readSync(e,i,s,n,h);this[iw](o),t=!1}finally{if(t)try{this[iS](()=>{})}catch{}}}[iT](t){t()}[iS](t=()=>{}){void 0!==this.fd&&r.default.closeSync(this.fd),t()}},iN=class extends te{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(t,e,i={}){return eS(this,t,e,i)}constructor(t,e={}){let i=tF(e);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=t;let{type:s}=t;if("Unsupported"===s)throw Error("writing entry that should be ignored");this.type=s,"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=ev(t.path),this.mode=void 0!==t.mode?this[iO](t.mode):void 0,this.uid=this.portable?void 0:t.uid,this.gid=this.portable?void 0:t.gid,this.uname=this.portable?void 0:t.uname,this.gname=this.portable?void 0:t.gname,this.size=t.size,this.mtime=this.noMtime?void 0:i.mtime||t.mtime,this.atime=this.portable?void 0:t.atime,this.ctime=this.portable?void 0:t.ctime,this.linkpath=void 0!==t.linkpath?ev(t.linkpath):void 0,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[t,e]=ii(this.path);t&&"string"==typeof e&&(this.path=e,r=t)}this.remain=t.size,this.blockRemain=t.startBlockSize,this.onWriteEntry?.(this),this.header=new es({path:this[iL](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[iL](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path}),this.header.encode()&&!this.noPax&&super.write(new eE({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[iL](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[iL](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let n=this.header?.block;if(!n)throw Error("failed to encode header");super.write(n),t.pipe(this)}[iL](t){return il(t,this.prefix)}[iO](t){return e9(t,"Directory"===this.type,this.portable)}write(t,e,i){"function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,"string"==typeof e?e:"utf8"));let s=t.length;if(s>this.blockRemain)throw Error("writing more to entry than is appropriate");return this.blockRemain-=s,super.write(t,i)}end(t,e,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),"function"==typeof t&&(i=t,e=void 0,t=void 0),"function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,e??"utf8")),i&&this.once("finish",i),t?super.end(t,i):super.end(i),this}},iD=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported",iI=class t{tail;head;length=0;static create(e=[]){return new t(e)}constructor(t=[]){for(let e of t)this.push(e)}*[Symbol.iterator](){for(let t=this.head;t;t=t.next)yield t.value}removeNode(t){if(t.list!==this)throw Error("removing node which does not belong to this list");let e=t.next,i=t.prev;return e&&(e.prev=i),i&&(i.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=i),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,e}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);let e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}pushNode(t){if(t===this.tail)return;t.list&&t.list.removeNode(t);let e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}push(...t){for(let i=0,s=t.length;i<s;i++){var e;e=this,e.tail=new iC(t[i],e.tail,void 0,e),e.head||(e.head=e.tail),e.length++}return this.length}unshift(...t){for(var e,i=0,s=t.length;i<s;i++){e=this,e.head=new iC(t[i],void 0,e.head,e),e.tail||(e.tail=e.head),e.length++}return this.length}pop(){if(!this.tail)return;let t=this.tail.value,e=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,e.list=void 0,this.length--,t}shift(){if(!this.head)return;let t=this.head.value,e=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,e.list=void 0,this.length--,t}forEach(t,e){e=e||this;for(let i=this.head,s=0;i;s++)t.call(e,i.value,s,this),i=i.next}forEachReverse(t,e){e=e||this;for(let i=this.tail,s=this.length-1;i;s--)t.call(e,i.value,s,this),i=i.prev}get(t){let e=0,i=this.head;for(;i&&e<t;e++)i=i.next;if(e===t&&i)return i.value}getReverse(t){let e=0,i=this.tail;for(;i&&e<t;e++)i=i.prev;if(e===t&&i)return i.value}map(e,i){i=i||this;let s=new t;for(let t=this.head;t;)s.push(e.call(i,t.value,this)),t=t.next;return s}mapReverse(e,i){i=i||this;var s=new t;for(let t=this.tail;t;)s.push(e.call(i,t.value,this)),t=t.prev;return s}reduce(t,e){let i,s=this.head;if(arguments.length>1)i=e;else if(this.head)s=this.head.next,i=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var r=0;s;r++)i=t(i,s.value,r),s=s.next;return i}reduceReverse(t,e){let i,s=this.tail;if(arguments.length>1)i=e;else if(this.tail)s=this.tail.prev,i=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(let e=this.length-1;s;e--)i=t(i,s.value,e),s=s.prev;return i}toArray(){let t=Array(this.length);for(let e=0,i=this.head;i;e++)t[e]=i.value,i=i.next;return t}toArrayReverse(){let t=Array(this.length);for(let e=0,i=this.tail;i;e++)t[e]=i.value,i=i.prev;return t}slice(e=0,i=this.length){i<0&&(i+=this.length),e<0&&(e+=this.length);let s=new t;if(i<e||i<0)return s;e<0&&(e=0),i>this.length&&(i=this.length);let r=this.head,n=0;for(n=0;r&&n<e;n++)r=r.next;for(;r&&n<i;n++,r=r.next)s.push(r.value);return s}sliceReverse(e=0,i=this.length){i<0&&(i+=this.length),e<0&&(e+=this.length);let s=new t;if(i<e||i<0)return s;e<0&&(e=0),i>this.length&&(i=this.length);let r=this.length,n=this.tail;for(;n&&r>i;r--)n=n.prev;for(;n&&r>e;r--,n=n.prev)s.push(n.value);return s}splice(t,e=0,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let s=this.head;for(let e=0;s&&e<t;e++)s=s.next;let r=[];for(let t=0;s&&t<e;t++)r.push(s.value),s=this.removeNode(s);for(let t of(s?s!==this.tail&&(s=s.prev):s=this.tail,i))s=function(t,e,i){let s=e?e.next:t.head,r=new iC(i,e,s,t);return void 0===r.next&&(t.tail=r),void 0===r.prev&&(t.head=r),t.length++,r}(this,s,t);return r}reverse(){let t=this.head,e=this.tail;for(let e=t;e;e=e.prev){let t=e.prev;e.prev=e.next,e.next=t}return this.head=e,this.tail=t,this}},iC=class{list;next;prev;value;constructor(t,e,i,s){this.list=s,this.value=t,e?(e.next=this,this.prev=e):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}},iB=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(t,e){this.path=t||"./",this.absolute=e}},iM=Buffer.alloc(1024),iF=Symbol("onStat"),iP=Symbol("ended"),iz=Symbol("queue"),iU=Symbol("current"),ij=Symbol("process"),iH=Symbol("processing"),iZ=Symbol("processJob"),iG=Symbol("jobs"),iW=Symbol("jobDone"),i$=Symbol("addFSEntry"),iV=Symbol("addTarEntry"),iY=Symbol("stat"),iq=Symbol("readdir"),iK=Symbol("onreaddir"),iX=Symbol("pipe"),iQ=Symbol("entry"),iJ=Symbol("entryOpt"),i0=Symbol("writeEntryClass"),i1=Symbol("write"),i2=Symbol("ondrain"),i5=class extends te{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[i0];onWriteEntry;[iz];[iG]=0;[iH]=!1;[iP]=!1;constructor(t={}){if(super(),this.opt=t,this.file=t.file||"",this.cwd=t.cwd||process.cwd(),this.maxReadSize=t.maxReadSize,this.preservePaths=!!t.preservePaths,this.strict=!!t.strict,this.noPax=!!t.noPax,this.prefix=ev(t.prefix||""),this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.readdirCache=t.readdirCache||new Map,this.onWriteEntry=t.onWriteEntry,this[i0]=ix,"function"==typeof t.onwarn&&this.on("warn",t.onwarn),this.portable=!!t.portable,t.gzip||t.brotli||t.zstd){if(+!!t.gzip+ +!!t.brotli+ +!!t.zstd>1)throw TypeError("gzip, brotli, zstd are mutually exclusive");if(t.gzip&&("object"!=typeof t.gzip&&(t.gzip={}),this.portable&&(t.gzip.portable=!0),this.zip=new tK(t.gzip)),t.brotli&&("object"!=typeof t.brotli&&(t.brotli={}),this.zip=new tJ(t.brotli)),t.zstd&&("object"!=typeof t.zstd&&(t.zstd={}),this.zip=new t2(t.zstd)),!this.zip)throw Error("impossible");let e=this.zip;e.on("data",t=>super.write(t)),e.on("end",()=>super.end()),e.on("drain",()=>this[i2]()),this.on("resume",()=>e.resume())}else this.on("drain",this[i2]);this.noDirRecurse=!!t.noDirRecurse,this.follow=!!t.follow,this.noMtime=!!t.noMtime,t.mtime&&(this.mtime=t.mtime),this.filter="function"==typeof t.filter?t.filter:()=>!0,this[iz]=new iI,this[iG]=0,this.jobs=Number(t.jobs)||4,this[iH]=!1,this[iP]=!1}[i1](t){return super.write(t)}add(t){return this.write(t),this}end(t,e,i){return"function"==typeof t&&(i=t,t=void 0),"function"==typeof e&&(i=e,e=void 0),t&&this.add(t),this[iP]=!0,this[ij](),i&&i(),this}write(t){if(this[iP])throw Error("write after end");return t instanceof e_?this[iV](t):this[i$](t),this.flowing}[iV](t){let e=ev(a.default.resolve(this.cwd,t.path));if(this.filter(t.path,t)){let i=new iB(t.path,e);i.entry=new iN(t,this[iJ](i)),i.entry.on("end",()=>this[iW](i)),this[iG]+=1,this[iz].push(i)}else t.resume();this[ij]()}[i$](t){let e=ev(a.default.resolve(this.cwd,t));this[iz].push(new iB(t,e)),this[ij]()}[iY](t){t.pending=!0,this[iG]+=1;let e=this.follow?"stat":"lstat";r.default[e](t.absolute,(e,i)=>{t.pending=!1,this[iG]-=1,e?this.emit("error",e):this[iF](t,i)})}[iF](t,e){this.statCache.set(t.absolute,e),t.stat=e,this.filter(t.path,e)?e.isFile()&&e.nlink>1&&t===this[iU]&&!this.linkCache.get(`${e.dev}:${e.ino}`)&&!this.sync&&this[iZ](t):t.ignore=!0,this[ij]()}[iq](t){t.pending=!0,this[iG]+=1,r.default.readdir(t.absolute,(e,i)=>{if(t.pending=!1,this[iG]-=1,e)return this.emit("error",e);this[iK](t,i)})}[iK](t,e){this.readdirCache.set(t.absolute,e),t.readdir=e,this[ij]()}[ij](){if(!this[iH]){this[iH]=!0;for(let t=this[iz].head;t&&this[iG]<this.jobs;t=t.next)if(this[iZ](t.value),t.value.ignore){let e=t.next;this[iz].removeNode(t),t.next=e}this[iH]=!1,this[iP]&&0===this[iz].length&&0===this[iG]&&(this.zip?this.zip.end(iM):(super.write(iM),super.end()))}}get[iU](){return this[iz]&&this[iz].head&&this[iz].head.value}[iW](t){this[iz].shift(),this[iG]-=1,this[ij]()}[iZ](t){if(!t.pending){if(t.entry){t!==this[iU]||t.piped||this[iX](t);return}if(!t.stat){let e=this.statCache.get(t.absolute);e?this[iF](t,e):this[iY](t)}if(t.stat&&!t.ignore){if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){let e=this.readdirCache.get(t.absolute);if(e?this[iK](t,e):this[iq](t),!t.readdir)return}if(t.entry=this[iQ](t),!t.entry){t.ignore=!0;return}t!==this[iU]||t.piped||this[iX](t)}}}[iJ](t){return{onwarn:(t,e,i)=>this.warn(t,e,i),noPax:this.noPax,cwd:this.cwd,absolute:t.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[iQ](t){this[iG]+=1;try{return new this[i0](t.path,this[iJ](t)).on("end",()=>this[iW](t)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[i2](){this[iU]&&this[iU].entry&&this[iU].entry.resume()}[iX](t){t.piped=!0,t.readdir&&t.readdir.forEach(e=>{let i=t.path,s="./"===i?"":i.replace(/\/*$/,"/");this[i$](s+e)});let e=t.entry,i=this.zip;if(!e)throw Error("cannot pipe without source");i?e.on("data",t=>{i.write(t)||e.pause()}):e.on("data",t=>{super.write(t)||e.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(t,e,i={}){eS(this,t,e,i)}},i4=class extends i5{sync=!0;constructor(t){super(t),this[i0]=iA}pause(){}resume(){}[iY](t){let e=this.follow?"statSync":"lstatSync";this[iF](t,r.default[e](t.absolute))}[iq](t){this[iK](t,r.default.readdirSync(t.absolute))}[iX](t){let e=t.entry,i=this.zip;if(t.readdir&&t.readdir.forEach(e=>{let i=t.path,s="./"===i?"":i.replace(/\/*$/,"/");this[i$](s+e)}),!e)throw Error("Cannot pipe without source");i?e.on("data",t=>{i.write(t)}):e.on("data",t=>{super[i1](t)})}},i8=(t,i)=>{i.forEach(i=>{"@"===i.charAt(0)?e7({file:e.default.resolve(t.cwd,i.slice(1)),sync:!0,noResume:!0,onReadEntry:e=>t.add(e)}):t.add(i)}),t.end()},i3=async(t,i)=>{for(let s of i)"@"===s.charAt(0)?await e7({file:e.default.resolve(String(t.cwd),s.slice(1)),noResume:!0,onReadEntry:e=>{t.add(e)}}):t.add(s);t.end()};tP((t,e)=>{let i=new i4(t),s=new tC(t.file,{mode:t.mode||438});i.pipe(s),i8(i,e)},(t,e)=>{let i=new i5(t),s=new tI(t.file,{mode:t.mode||438});i.pipe(s);let r=new Promise((t,e)=>{s.on("error",e),s.on("close",t),i.on("error",e)});return i3(i,e).catch(t=>i.emit("error",t)),r},(t,e)=>{let i=new i4(t);return i8(i,e),i},(t,e)=>{let i=new i5(t);return i3(i,e).catch(t=>i.emit("error",t)),i},(t,e)=>{if(!e?.length)throw TypeError("no paths specified to add to archive")});var i6="win32"===(process.env.__FAKE_PLATFORM__||process.platform),{O_CREAT:i7,O_NOFOLLOW:i9,O_TRUNC:st,O_WRONLY:se}=r.default.constants,si=Number(process.env.__FAKE_FS_O_FILENAME__)||r.default.constants.UV_FS_O_FILEMAP||0,ss=si|st|i7|se,sr=i6||"number"!=typeof i9?null:i9|st|i7|se,sn=null!==sr?()=>sr:i6&&si?t=>t<524288?ss:"w":()=>"w",sh=(t,e,s)=>{try{return i.default.lchownSync(t,e,s)}catch(t){if(t?.code!=="ENOENT")throw t}},so=(t,e,s,r)=>{i.default.lchown(t,e,s,t=>{r(t&&t?.code!=="ENOENT"?t:null)})},sa=(t,i,s,r,n)=>{i.isDirectory()?sl(e.default.resolve(t,i.name),s,r,h=>{if(h)return n(h);so(e.default.resolve(t,i.name),s,r,n)}):so(e.default.resolve(t,i.name),s,r,n)},sl=(t,e,s,r)=>{i.default.readdir(t,{withFileTypes:!0},(i,n)=>{if(i){if("ENOENT"===i.code)return r();if("ENOTDIR"!==i.code&&"ENOTSUP"!==i.code)return r(i)}if(i||!n.length)return so(t,e,s,r);let h=n.length,o=null,a=i=>{if(!o){if(i)return r(o=i);if(0==--h)return so(t,e,s,r)}};for(let i of n)sa(t,i,e,s,a)})},sd=(t,i,s,r)=>{i.isDirectory()&&su(e.default.resolve(t,i.name),s,r),sh(e.default.resolve(t,i.name),s,r)},su=(t,e,s)=>{let r;try{r=i.default.readdirSync(t,{withFileTypes:!0})}catch(i){if(i?.code==="ENOENT")return;if(i?.code==="ENOTDIR"||i?.code==="ENOTSUP")return sh(t,e,s);throw i}for(let i of r)sd(t,i,e,s);return sh(t,e,s)},sf=class extends Error{path;code;syscall="chdir";constructor(t,e){super(`${e}: Cannot cd into '${t}'`),this.path=t,this.code=e}get name(){return"CwdError"}},sc=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(t,e){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=t,this.path=e}get name(){return"SymlinkError"}},sp=(t,s,r,n,h,o,a)=>{if(0===s.length)return a(null,o);let l=s.shift(),d=ev(e.default.resolve(t+"/"+l));i.default.mkdir(d,r,sm(d,s,r,n,h,o,a))},sm=(t,e,s,r,n,h,o)=>a=>{a?i.default.lstat(t,(l,d)=>{if(l)l.path=l.path&&ev(l.path),o(l);else if(d.isDirectory())sp(t,e,s,r,n,h,o);else if(r)i.default.unlink(t,a=>{if(a)return o(a);i.default.mkdir(t,s,sm(t,e,s,r,n,h,o))});else{if(d.isSymbolicLink())return o(new sc(t,t+"/"+e.join("/")));o(a)}}):(h=h||t,sp(t,e,s,r,n,h,o))},sy=Object.create(null),sb=new Set,sE="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform),sg=class{#t=new Map;#e=new Map;#i=new Set;reserve(t,i){let s=new Set((t=sE?["win32 parallelization disabled"]:t.map(t=>e3((0,e.join)((t=>{sb.has(t)?sb.delete(t):sy[t]=t.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),sb.add(t);let e=sy[t],i=sb.size-1e4;if(i>1e3){for(let t of sb)if(sb.delete(t),delete sy[t],--i<=0)break}return e})(t))))).map(t=>t.split("/").slice(0,-1).reduce((t,i)=>{let s=t.at(-1);return void 0!==s&&(i=(0,e.join)(s,i)),t.push(i||"/"),t},[])).reduce((t,e)=>t.concat(e)));for(let e of(this.#e.set(i,{dirs:s,paths:t}),t)){let t=this.#t.get(e);t?t.push(i):this.#t.set(e,[i])}for(let t of s){let e=this.#t.get(t);if(e){let t=e.at(-1);t instanceof Set?t.add(i):e.push(new Set([i]))}else this.#t.set(t,[new Set([i])])}return this.#r(i)}#s(t){let e=this.#e.get(t);if(!e)throw Error("function does not have any path reservations");return{paths:e.paths.map(t=>this.#t.get(t)),dirs:[...e.dirs].map(t=>this.#t.get(t))}}check(t){let{paths:e,dirs:i}=this.#s(t);return e.every(e=>e&&e[0]===t)&&i.every(e=>e&&e[0]instanceof Set&&e[0].has(t))}#r(t){return!this.#i.has(t)&&!!this.check(t)&&(this.#i.add(t),t(()=>this.#n(t)),!0)}#n(t){if(!this.#i.has(t))return!1;let e=this.#e.get(t);if(!e)throw Error("invalid reservation");let{paths:i,dirs:s}=e,r=new Set;for(let e of i){let i=this.#t.get(e);if(!i||i?.[0]!==t)continue;let s=i[1];if(!s){this.#t.delete(e);continue}if(i.shift(),"function"==typeof s)r.add(s);else for(let t of s)r.add(t)}for(let e of s){let i=this.#t.get(e),s=i?.[0];if(!(!i||!(s instanceof Set)))if(1===s.size&&1===i.length){this.#t.delete(e);continue}else if(1===s.size){i.shift();let t=i[0];"function"==typeof t&&r.add(t)}else s.delete(t)}return this.#i.delete(t),r.forEach(t=>this.#r(t)),!0}},sw=Symbol("onEntry"),sR=Symbol("checkFs"),sv=Symbol("checkFs2"),s_=Symbol("isReusable"),sS=Symbol("makeFs"),sO=Symbol("file"),sT=Symbol("directory"),sk=Symbol("link"),sL=Symbol("symlink"),sx=Symbol("hardlink"),sA=Symbol("ensureNoSymlink"),sN=Symbol("unsupported"),sD=Symbol("checkPath"),sI=Symbol("stripAbsolutePath"),sC=Symbol("mkdir"),sB=Symbol("onError"),sM=Symbol("pending"),sF=Symbol("pend"),sP=Symbol("unpend"),sz=Symbol("ended"),sU=Symbol("maybeClose"),sj=Symbol("skip"),sH=Symbol("doChown"),sZ=Symbol("uid"),sG=Symbol("gid"),sW=Symbol("checkedCwd"),s$="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform),sV=(t,e,i)=>void 0!==t&&t===t>>>0?t:void 0!==e&&e===e>>>0?e:i,sY=class extends e8{[sz]=!1;[sW]=!1;[sM]=0;reservations=new sg;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(t={}){if(t.ondone=()=>{this[sz]=!0,this[sU]()},super(t),this.transform=t.transform,this.chmod=!!t.chmod,"number"==typeof t.uid||"number"==typeof t.gid){if("number"!=typeof t.uid||"number"!=typeof t.gid)throw TypeError("cannot set owner without number uid and gid");if(t.preserveOwner)throw TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;this.preserveOwner=void 0===t.preserveOwner&&"number"!=typeof t.uid?!!(process.getuid&&0===process.getuid()):!!t.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth="number"==typeof t.maxDepth?t.maxDepth:1024,this.forceChown=!0===t.forceChown,this.win32=!!t.win32||s$,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=ev(e.default.resolve(t.cwd||process.cwd())),this.strip=Number(t.strip)||0,this.processUmask=this.chmod?"number"==typeof t.processUmask?t.processUmask:process.umask():0,this.umask="number"==typeof t.umask?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.on("entry",t=>this[sw](t))}warn(t,e,i={}){return("TAR_BAD_ARCHIVE"===t||"TAR_ABORT"===t)&&(i.recoverable=!1),super.warn(t,e,i)}[sU](){this[sz]&&0===this[sM]&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[sI](t,i){let s=t[i],{type:r}=t;if(!s||this.preservePaths)return!0;let[n,h]=ii(s),o=h.replaceAll(/\\/g,"/").split("/");if(o.includes("..")||s$&&/^[a-z]:\.\.$/i.test(o[0]??"")){if("path"===i||"Link"===r)return this.warn("TAR_ENTRY_ERROR",`${i} contains '..'`,{entry:t,[i]:s}),!1;let n=e.default.posix.dirname(t.path),h=e.default.posix.normalize(e.default.posix.join(n,o.join("/")));if(h.startsWith("../")||".."===h)return this.warn("TAR_ENTRY_ERROR",`${i} escapes extraction directory`,{entry:t,[i]:s}),!1}return n&&(t[i]=String(h),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${i}`,{entry:t,[i]:s})),!0}[sD](t){let i=ev(t.path),s=i.split("/");if(this.strip){if(s.length<this.strip)return!1;if("Link"===t.type){let e=ev(String(t.linkpath)).split("/");if(!(e.length>=this.strip))return!1;t.linkpath=e.slice(this.strip).join("/")}s.splice(0,this.strip),t.path=s.join("/")}if(isFinite(this.maxDepth)&&s.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:t,path:i,depth:s.length,maxDepth:this.maxDepth}),!1;if(!this[sI](t,"path")||!this[sI](t,"linkpath"))return!1;if(t.absolute=e.default.isAbsolute(t.path)?ev(e.default.resolve(t.path)):ev(e.default.resolve(this.cwd,t.path)),!this.preservePaths&&"string"==typeof t.absolute&&0!==t.absolute.indexOf(this.cwd+"/")&&t.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:ev(t.path),resolvedPath:t.absolute,cwd:this.cwd}),!1;if(t.absolute===this.cwd&&"Directory"!==t.type&&"GNUDumpDir"!==t.type)return!1;if(this.win32){let{root:i}=e.default.win32.parse(String(t.absolute));t.absolute=i+ia(String(t.absolute).slice(i.length));let{root:s}=e.default.win32.parse(t.path);t.path=s+ia(t.path.slice(s.length))}return!0}[sw](t){if(!this[sD](t))return t.resume();switch(f.default.equal(typeof t.absolute,"string"),t.type){case"Directory":case"GNUDumpDir":t.mode&&(t.mode=448|t.mode);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[sR](t);default:return this[sN](t)}}[sB](t,e){"CwdError"===t.name?this.emit("error",t):(this.warn("TAR_ENTRY_ERROR",t,{entry:e}),this[sP](),e.resume())}[sC](t,s,r){((t,s,r)=>{t=ev(t);let n=s.umask??18,h=448|s.mode,o=(h&n)!=0,a=s.uid,l=s.gid,d="number"==typeof a&&"number"==typeof l&&(a!==s.processUid||l!==s.processGid),u=s.preserve,f=s.unlink,c=ev(s.cwd),m=(e,s)=>{e?r(e):s&&d?sl(s,a,l,t=>m(t)):o?i.default.chmod(t,h,r):r()};if(t===c){var y;return y=t,i.default.stat(y,(t,e)=>{(t||!e.isDirectory())&&(t=new sf(y,t?.code||"ENOTDIR")),m(t)})}if(u)return p.default.mkdir(t,{mode:h,recursive:!0}).then(t=>m(null,t??void 0),m);let b=ev(e.default.relative(c,t)).split("/");sp(c,b,h,f,c,void 0,m)})(ev(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:s},r)}[sH](t){return this.forceChown||this.preserveOwner&&("number"==typeof t.uid&&t.uid!==this.processUid||"number"==typeof t.gid&&t.gid!==this.processGid)||"number"==typeof this.uid&&this.uid!==this.processUid||"number"==typeof this.gid&&this.gid!==this.processGid}[sZ](t){return sV(this.uid,t.uid,this.processUid)}[sG](t){return sV(this.gid,t.gid,this.processGid)}[sO](t,e){let s="number"==typeof t.mode?4095&t.mode:this.fmode,r=new tI(String(t.absolute),{flags:sn(t.size),mode:s,autoClose:!1});r.on("error",s=>{r.fd&&i.default.close(r.fd,()=>{}),r.write=()=>!0,this[sB](s,t),e()});let n=1,h=s=>{if(s){r.fd&&i.default.close(r.fd,()=>{}),this[sB](s,t),e();return}0==--n&&void 0!==r.fd&&i.default.close(r.fd,i=>{i?this[sB](i,t):this[sP](),e()})};r.on("finish",()=>{let e=String(t.absolute),s=r.fd;if("number"==typeof s&&t.mtime&&!this.noMtime){n++;let r=t.atime||new Date,o=t.mtime;i.default.futimes(s,r,o,t=>t?i.default.utimes(e,r,o,e=>h(e&&t)):h())}if("number"==typeof s&&this[sH](t)){n++;let r=this[sZ](t),o=this[sG](t);"number"==typeof r&&"number"==typeof o&&i.default.fchown(s,r,o,t=>t?i.default.chown(e,r,o,e=>h(e&&t)):h())}h()});let o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",i=>{this[sB](i,t),e()}),t.pipe(o)),o.pipe(r)}[sT](t,e){let s="number"==typeof t.mode?4095&t.mode:this.dmode;this[sC](String(t.absolute),s,s=>{if(s){this[sB](s,t),e();return}let r=1,n=()=>{0==--r&&(e(),this[sP](),t.resume())};t.mtime&&!this.noMtime&&(r++,i.default.utimes(String(t.absolute),t.atime||new Date,t.mtime,n)),this[sH](t)&&(r++,i.default.chown(String(t.absolute),Number(this[sZ](t)),Number(this[sG](t)),n)),n()})}[sN](t){t.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t}),t.resume()}[sL](t,i){let s=ev(e.default.relative(this.cwd,e.default.resolve(e.default.dirname(String(t.absolute)),String(t.linkpath)))).split("/");this[sA](t,this.cwd,s,()=>this[sk](t,String(t.linkpath),"symlink",i),e=>{this[sB](e,t),i()})}[sx](t,i){let s=ev(e.default.resolve(this.cwd,String(t.linkpath))),r=ev(String(t.linkpath)).split("/");this[sA](t,this.cwd,r,()=>this[sk](t,s,"link",i),e=>{this[sB](e,t),i()})}[sA](t,s,r,n,h){let o=r.shift();if(this.preservePaths||void 0===o)return n();let a=e.default.resolve(s,o);i.default.lstat(a,(i,s)=>i?n():s?.isSymbolicLink()?h(new sc(a,e.default.resolve(a,r.join("/")))):void this[sA](t,a,r,n,h))}[sF](){this[sM]++}[sP](){this[sM]--,this[sU]()}[sj](t){this[sP](),t.resume()}[s_](t,e){return"File"===t.type&&!this.unlink&&e.isFile()&&e.nlink<=1&&!s$}[sR](t){this[sF]();let e=[t.path];t.linkpath&&e.push(t.linkpath),this.reservations.reserve(e,e=>this[sv](t,e))}[sv](t,s){let r=t=>{s(t)},n=()=>{this[sC](this.cwd,this.dmode,e=>{if(e){this[sB](e,t),r();return}this[sW]=!0,h()})},h=()=>{if(t.absolute!==this.cwd){let i=ev(e.default.dirname(String(t.absolute)));if(i!==this.cwd)return this[sC](i,this.dmode,e=>{if(e){this[sB](e,t),r();return}o()})}o()},o=()=>{i.default.lstat(String(t.absolute),(e,s)=>{if(s&&(this.keep||this.newer&&s.mtime>(t.mtime??s.mtime))){this[sj](t),r();return}if(e||this[s_](t,s))return this[sS](null,t,r);if(s.isDirectory()){if("Directory"===t.type){let e=this.chmod&&t.mode&&(4095&s.mode)!==t.mode,n=e=>this[sS](e??null,t,r);return e?i.default.chmod(String(t.absolute),Number(t.mode),n):n()}if(t.absolute!==this.cwd)return i.default.rmdir(String(t.absolute),e=>this[sS](e??null,t,r))}if(t.absolute===this.cwd)return this[sS](null,t,r);((t,e)=>{if(!s$)return i.default.unlink(t,e);let s=t+".DELETE."+(0,c.randomBytes)(16).toString("hex");i.default.rename(t,s,t=>{if(t)return e(t);i.default.unlink(s,e)})})(String(t.absolute),e=>this[sS](e??null,t,r))})};this[sW]?h():n()}[sS](t,e,i){if(t){this[sB](t,e),i();return}switch(e.type){case"File":case"OldFile":case"ContiguousFile":return this[sO](e,i);case"Link":return this[sx](e,i);case"SymbolicLink":return this[sL](e,i);case"Directory":case"GNUDumpDir":return this[sT](e,i)}}[sk](t,e,s,r){i.default[s](e,String(t.absolute),e=>{e?this[sB](e,t):(this[sP](),t.resume()),r()})}},sq=t=>{try{return[null,t()]}catch(t){return[t,null]}},sK=class extends sY{sync=!0;[sS](t,e){return super[sS](t,e,()=>{})}[sR](t){if(!this[sW]){let e=this[sC](this.cwd,this.dmode);if(e)return this[sB](e,t);this[sW]=!0}if(t.absolute!==this.cwd){let i=ev(e.default.dirname(String(t.absolute)));if(i!==this.cwd){let e=this[sC](i,this.dmode);if(e)return this[sB](e,t)}}let[s,r]=sq(()=>i.default.lstatSync(String(t.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(t.mtime??r.mtime)))return this[sj](t);if(s||this[s_](t,r))return this[sS](null,t);if(r.isDirectory()){if("Directory"===t.type){let[e]=this.chmod&&t.mode&&(4095&r.mode)!==t.mode?sq(()=>{i.default.chmodSync(String(t.absolute),Number(t.mode))}):[];return this[sS](e,t)}let[e]=sq(()=>i.default.rmdirSync(String(t.absolute)));this[sS](e,t)}let[n]=t.absolute===this.cwd?[]:sq(()=>(t=>{if(!s$)return i.default.unlinkSync(t);let e=t+".DELETE."+(0,c.randomBytes)(16).toString("hex");i.default.renameSync(t,e),i.default.unlinkSync(e)})(String(t.absolute)));this[sS](n,t)}[sO](t,e){let s="number"==typeof t.mode?4095&t.mode:this.fmode,r=s=>{let r;try{i.default.closeSync(n)}catch(t){r=t}(s||r)&&this[sB](s||r,t),e()},n;try{n=i.default.openSync(String(t.absolute),sn(t.size),s)}catch(t){return r(t)}let h=this.transform&&this.transform(t)||t;h!==t&&(h.on("error",e=>this[sB](e,t)),t.pipe(h)),h.on("data",t=>{try{i.default.writeSync(n,t,0,t.length)}catch(t){r(t)}}),h.on("end",()=>{let e=null;if(t.mtime&&!this.noMtime){let s=t.atime||new Date,r=t.mtime;try{i.default.futimesSync(n,s,r)}catch(n){try{i.default.utimesSync(String(t.absolute),s,r)}catch{e=n}}}if(this[sH](t)){let s=this[sZ](t),r=this[sG](t);try{i.default.fchownSync(n,Number(s),Number(r))}catch(n){try{i.default.chownSync(String(t.absolute),Number(s),Number(r))}catch{e=e||n}}}r(e)})}[sT](t,e){let s="number"==typeof t.mode?4095&t.mode:this.dmode,r=this[sC](String(t.absolute),s);if(r){this[sB](r,t),e();return}if(t.mtime&&!this.noMtime)try{i.default.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch{}if(this[sH](t))try{i.default.chownSync(String(t.absolute),Number(this[sZ](t)),Number(this[sG](t)))}catch{}e(),t.resume()}[sC](t,s){try{return((t,s)=>{t=ev(t);let r=s.umask??18,n=448|s.mode,h=(n&r)!=0,o=s.uid,a=s.gid,l="number"==typeof o&&"number"==typeof a&&(o!==s.processUid||a!==s.processGid),d=s.preserve,u=s.unlink,f=ev(s.cwd),c=e=>{e&&l&&su(e,o,a),h&&i.default.chmodSync(t,n)};if(t===f)return(t=>{let e=!1,s;try{e=i.default.statSync(t).isDirectory()}catch(t){s=t?.code}finally{if(!e)throw new sf(t,s??"ENOTDIR")}})(f),c();if(d)return c(i.default.mkdirSync(t,{mode:n,recursive:!0})??void 0);let p=ev(e.default.relative(f,t)).split("/"),m;for(let t=p.shift(),s=f;t&&(s+="/"+t);t=p.shift()){s=ev(e.default.resolve(s));try{i.default.mkdirSync(s,n),m=m||s}catch{let t=i.default.lstatSync(s);if(t.isDirectory())continue;if(u){i.default.unlinkSync(s),i.default.mkdirSync(s,n),m=m||s;continue}if(t.isSymbolicLink())return new sc(s,s+"/"+p.join("/"))}}return c(m)})(ev(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:s})}catch(t){return t}}[sA](t,s,r,n,h){if(this.preservePaths||0===r.length)return n();let o=s;for(let t of r){o=e.default.resolve(o,t);let[a,l]=sq(()=>i.default.lstatSync(o));if(a)return n();if(l.isSymbolicLink())return h(new sc(o,e.default.resolve(s,r.join("/"))))}n()}[sk](t,e,s,r){let n=`${s}Sync`;try{i.default[n](e,String(t.absolute)),r(),t.resume()}catch(e){return this[sB](e,t)}}},sX=tP(t=>{let e=new sK(t),s=t.file,r=i.default.statSync(s);new tD(s,{readSize:t.maxReadSize||0x1000000,size:r.size}).pipe(e)},(t,e)=>{let s=new sY(t),r=t.maxReadSize||0x1000000,n=t.file;return new Promise((t,e)=>{s.on("error",e),s.on("close",t),i.default.stat(n,(t,i)=>{if(t)e(t);else{let t=new tN(n,{readSize:r,size:i.size});t.on("error",e),t.pipe(s)}})})},t=>new sK(t),t=>new sY(t),(t,e)=>{e?.length&&e6(t,e)}),sQ=(t,i)=>{i.forEach(i=>{"@"===i.charAt(0)?e7({file:e.default.resolve(t.cwd,i.slice(1)),sync:!0,noResume:!0,onReadEntry:e=>t.add(e)}):t.add(i)}),t.end()},sJ=async(t,i)=>{for(let s of i)"@"===s.charAt(0)?await e7({file:e.default.resolve(String(t.cwd),s.slice(1)),noResume:!0,onReadEntry:e=>t.add(e)}):t.add(s);t.end()},s0=tP((t,e)=>{let s=new i4(t),r=!0,n,h;try{var o,a,l,d,u;let f;try{n=i.default.openSync(t.file,"r+")}catch(e){if(e?.code==="ENOENT")n=i.default.openSync(t.file,"w+");else throw e}let c=i.default.fstatSync(n),p=Buffer.alloc(512);t:for(h=0;h<c.size;h+=512){for(let t=0,e=0;t<512;t+=e){if(e=i.default.readSync(n,p,t,p.length-t,h+t),0===h&&31===p[0]&&139===p[1])throw Error("cannot append to compressed archives");if(!e)break t}let e=new es(p);if(!e.cksumValid)break;let s=512*Math.ceil((e.size||0)/512);if(h+s+512>c.size)break;h+=s,t.mtimeCache&&e.mtime&&t.mtimeCache.set(String(e.path),e.mtime)}r=!1,o=t,a=s,l=h,d=n,u=e,f=new tC(o.file,{fd:d,start:l}),a.pipe(f),sQ(a,u)}finally{if(r)try{i.default.closeSync(n)}catch{}}},(t,e)=>{e=Array.from(e);let s=new i5(t);return new Promise((r,n)=>{s.on("error",n);let h="r+",o=(a,l)=>a&&"ENOENT"===a.code&&"r+"===h?(h="w+",i.default.open(t.file,h,o)):a||!l?n(a):void i.default.fstat(l,(h,o)=>{if(h)return i.default.close(l,()=>n(h));((e,s,r)=>{let n=(t,s)=>{t?i.default.close(e,e=>r(t)):r(null,s)},h=0;if(0===s)return n(null,0);let o=0,a=Buffer.alloc(512),l=(r,d)=>{if(r||void 0===d)return n(r);if((o+=d)<512&&d)return i.default.read(e,a,o,a.length-o,h+o,l);if(0===h&&31===a[0]&&139===a[1])return n(Error("cannot append to compressed archives"));if(o<512)return n(null,h);let u=new es(a);if(!u.cksumValid)return n(null,h);let f=512*Math.ceil((u.size??0)/512);if(h+f+512>s||(h+=f+512)>=s)return n(null,h);t.mtimeCache&&u.mtime&&t.mtimeCache.set(String(u.path),u.mtime),o=0,i.default.read(e,a,0,512,h,l)};i.default.read(e,a,0,512,h,l)})(l,o.size,(i,h)=>{if(i)return n(i);let o=new tI(t.file,{fd:l,start:h});s.pipe(o),o.on("error",n),o.on("close",r),sJ(s,e)})});i.default.open(t.file,h,o)})},()=>{throw TypeError("file is required")},()=>{throw TypeError("file is required")},(t,e)=>{if(!t.file)throw TypeError("file is required");if(t.gzip||t.brotli||t.zstd||t.file.endsWith(".br")||t.file.endsWith(".tbr"))throw TypeError("cannot append to compressed archives");if(!e?.length)throw TypeError("no paths specified to add/replace")});tP(s0.syncFile,s0.asyncFile,s0.syncNoFile,s0.asyncNoFile,(t,e=[])=>{s0.validate?.(t,e),s1(t)});var s1=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(i,s)=>e(i,s)&&!((t.mtimeCache?.get(i)??s.mtime??0)>(s.mtime??0)):(e,i)=>!((t.mtimeCache?.get(e)??i.mtime??0)>(i.mtime??0))};let s2=/^tower-(backup|auto)-\d{8}-\d{6}\.tar\.gz$/;async function s5(t){let s=(0,e.join)((0,e.dirname)(t),`_meta_tmp_${Date.now()}`);try{(0,i.mkdirSync)(s,{recursive:!0}),await sX({file:t,cwd:s,filter:t=>"metadata.json"===t});let r=(0,e.join)(s,"metadata.json");if(!(0,i.existsSync)(r))return null;return JSON.parse((0,i.readFileSync)(r,"utf-8"))}catch{return null}finally{(0,i.rmSync)(s,{recursive:!0,force:!0})}}(0,e.join)("storage","assets"),t.s(["readMetadataFromArchive",0,s5,"validateFilename",0,function(t){if(!s2.test(t))throw Error(`Invalid backup filename: ${t}`)}],605171)},119620,t=>t.a(async(e,i)=>{try{var s=t.i(855104),r=t.i(198840),n=t.i(750227),h=t.i(902157),o=t.i(192520),a=t.i(605171),l=t.i(22569),d=e([l]);async function u(e){let i=(0,r.requireLocalhost)(e);if(i)return i;try{let i=(await e.formData()).get("file");if(!i)return s.NextResponse.json({error:"No file provided"},{status:400});try{(0,a.validateFilename)(i.name)}catch{return s.NextResponse.json({error:"Invalid backup filename"},{status:400})}let r=await (0,l.getConfigValue)("system.backupDir","")||(0,o.getBackupsDir)();(0,h.mkdirSync)(r,{recursive:!0});let d=(0,n.join)(r,i.name);if((0,h.existsSync)(d))return s.NextResponse.json({error:"File already exists"},{status:409});let u=Buffer.from(await i.arrayBuffer());(0,h.writeFileSync)(d,u);let f=await (0,a.readMetadataFromArchive)(d);if(!f||!f.version){try{t.r(902157).unlinkSync(d)}catch{}return s.NextResponse.json({error:"Invalid backup archive"},{status:400})}return s.NextResponse.json({filename:i.name,metadata:f})}catch{return s.NextResponse.json({error:"Import failed"},{status:500})}}[l]=d.then?(await d)():d,t.s(["POST",0,u,"dynamic",0,"force-dynamic","runtime",0,"nodejs"]),i()}catch(t){i(t)}},!1),766434,t=>t.a(async(e,i)=>{try{var s=t.i(765876),r=t.i(675896),n=t.i(959160),h=t.i(97944),o=t.i(86757),a=t.i(204144),l=t.i(273436),d=t.i(743641),u=t.i(813766),f=t.i(840884),c=t.i(498814),p=t.i(780006),m=t.i(544432),y=t.i(772005),b=t.i(450223),E=t.i(193695);t.i(628400);var g=t.i(800071),w=t.i(119620),R=e([w]);[w]=R.then?(await R)():R;let _=new s.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/internal/backup/import/route",pathname:"/api/internal/backup/import",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/internal/backup/import/route.ts",nextConfigOutput:"standalone",userland:w}),{workAsyncStorage:S,workUnitAsyncStorage:O,serverHooks:T}=_;async function v(t,e,i){i.requestMeta&&(0,h.setRequestMeta)(t,i.requestMeta),_.isDev&&(0,h.addRequestMeta)(t,"devRequestTimingInternalsEnd",process.hrtime.bigint());let s="/api/internal/backup/import/route";s=s.replace(/\/index$/,"")||"/";let n=await _.prepare(t,e,{srcPage:s,multiZoneDraftMode:!1});if(!n)return e.statusCode=400,e.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:w,params:R,nextConfig:v,parsedUrl:S,isDraftMode:O,prerenderManifest:T,routerServerContext:k,isOnDemandRevalidate:L,revalidateOnlyGenerated:x,resolvedPathname:A,clientReferenceManifest:N,serverActionsManifest:D}=n,I=(0,l.normalizeAppPath)(s),C=!!(T.dynamicRoutes[I]||T.routes[A]),B=async()=>((null==k?void 0:k.render404)?await k.render404(t,e,S,!1):e.end("This page could not be found"),null);if(C&&!O){let t=!!T.routes[A],e=T.dynamicRoutes[I];if(e&&!1===e.fallback&&!t){if(v.adapterPath)return await B();throw new E.NoFallbackError}}let M=null;!C||_.isDev||O||(M=A,M="/index"===M?"/":M);let F=!0===_.isDev||!C,P=C&&!F;D&&N&&(0,a.setManifestsSingleton)({page:s,clientReferenceManifest:N,serverActionsManifest:D});let z=t.method||"GET",U=(0,o.getTracer)(),j=U.getActiveScopeSpan(),H=!!(null==k?void 0:k.isWrappedByNextServer),Z=!!(0,h.getRequestMeta)(t,"minimalMode"),G=(0,h.getRequestMeta)(t,"incrementalCache")||await _.getIncrementalCache(t,v,T,Z);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let W={params:R,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!v.experimental.authInterrupts},cacheComponents:!!v.cacheComponents,supportsDynamicResponse:F,incrementalCache:G,cacheLifeProfiles:v.cacheLife,waitUntil:i.waitUntil,onClose:t=>{e.on("close",t)},onAfterTaskError:void 0,onInstrumentationRequestError:(e,i,s,r)=>_.onRequestError(t,e,s,r,k)},sharedContext:{buildId:w}},$=new d.NodeNextRequest(t),V=new d.NodeNextResponse(e),Y=u.NextRequestAdapter.fromNodeNextRequest($,(0,u.signalFromNodeResponse)(e));try{let n,h=async t=>_.handle(Y,W).finally(()=>{if(!t)return;t.setAttributes({"http.status_code":e.statusCode,"next.rsc":!1});let i=U.getRootSpanAttributes();if(!i)return;if(i.get("next.span_type")!==f.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${i.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=i.get("next.route");if(r){let e=`${z} ${r}`;t.setAttributes({"next.route":r,"http.route":r,"next.span_name":e}),t.updateName(e),n&&n!==t&&(n.setAttribute("http.route",r),n.updateName(e))}else t.updateName(`${z} ${s}`)}),a=async n=>{var o,a;let l=async({previousCacheEntry:r})=>{try{if(!Z&&L&&x&&!r)return e.statusCode=404,e.setHeader("x-nextjs-cache","REVALIDATED"),e.end("This page could not be found"),null;let s=await h(n);t.fetchMetrics=W.renderOpts.fetchMetrics;let o=W.renderOpts.pendingWaitUntil;o&&i.waitUntil&&(i.waitUntil(o),o=void 0);let a=W.renderOpts.collectedTags;if(!C)return await (0,p.sendResponse)($,V,s,W.renderOpts.pendingWaitUntil),null;{let t=await s.blob(),e=(0,m.toNodeOutgoingHttpHeaders)(s.headers);a&&(e[b.NEXT_CACHE_TAGS_HEADER]=a),!e["content-type"]&&t.type&&(e["content-type"]=t.type);let i=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=b.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,r=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=b.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await t.arrayBuffer()),headers:e},cacheControl:{revalidate:i,expire:r}}}}catch(e){throw(null==r?void 0:r.isStale)&&await _.onRequestError(t,e,{routerKind:"App Router",routePath:s,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:L})},!1,k),e}},d=await _.handleResponse({req:t,nextConfig:v,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:L,revalidateOnlyGenerated:x,responseGenerator:l,waitUntil:i.waitUntil,isMinimalMode:Z});if(!C)return null;if((null==d||null==(o=d.value)?void 0:o.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(a=d.value)?void 0:a.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});Z||e.setHeader("x-nextjs-cache",L?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),O&&e.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,m.fromNodeOutgoingHttpHeaders)(d.value.headers);return Z&&C||u.delete(b.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||e.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,y.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)($,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};H&&j?await a(j):(n=U.getActiveScopeSpan(),await U.withPropagatedContext(t.headers,()=>U.trace(f.BaseServerSpan.handleRequest,{spanName:`${z} ${s}`,kind:o.SpanKind.SERVER,attributes:{"http.method":z,"http.target":t.url}},a),void 0,!H))}catch(e){if(e instanceof E.NoFallbackError||await _.onRequestError(t,e,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:L})},!1,k),C)throw e;return await (0,p.sendResponse)($,V,new Response(null,{status:500})),null}}t.s(["handler",0,v,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:O})},"routeModule",0,_,"serverHooks",0,T,"workAsyncStorage",0,S,"workUnitAsyncStorage",0,O]),i()}catch(t){i(t)}},!1)];
4
-
5
- //# sourceMappingURL=_0t31z6q._.js.map