tower-studio 0.2.43 → 0.2.45

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 (536) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +5 -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 +30 -0
  6. package/.next/standalone/.next/server/app/_global-error/page.js +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +2 -2
  16. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +31 -31
  17. package/.next/standalone/.next/server/app/_not-found/page.js +6 -6
  18. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/api/adapters/test/route.js +3 -3
  21. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/browse-fs/route.js +1 -1
  23. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js +1 -1
  25. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/git/route.js +1 -1
  27. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js +4 -3
  32. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +1 -1
  34. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/internal/assistant/route.js +1 -1
  36. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +1 -1
  38. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +3 -2
  40. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js +1 -1
  42. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/internal/harness/ask/route/app-paths-manifest.json +3 -0
  44. package/.next/standalone/.next/server/app/api/internal/harness/ask/route/build-manifest.json +9 -0
  45. package/.next/standalone/.next/server/app/api/internal/harness/ask/route/server-reference-manifest.json +4 -0
  46. package/.next/standalone/.next/server/app/api/internal/harness/ask/route.js +7 -0
  47. package/.next/standalone/.next/server/app/api/internal/harness/ask/route.js.nft.json +1 -0
  48. package/.next/standalone/.next/server/app/api/internal/harness/ask/route_client-reference-manifest.js +3 -0
  49. package/.next/standalone/.next/server/app/api/internal/harness/notify/route/app-paths-manifest.json +3 -0
  50. package/.next/standalone/.next/server/app/api/internal/harness/notify/route/build-manifest.json +9 -0
  51. package/.next/standalone/.next/server/app/api/internal/harness/notify/route/server-reference-manifest.json +4 -0
  52. package/.next/standalone/.next/server/app/api/internal/harness/notify/route.js +7 -0
  53. package/.next/standalone/.next/server/app/api/internal/harness/notify/route.js.nft.json +1 -0
  54. package/.next/standalone/.next/server/app/api/internal/harness/notify/route_client-reference-manifest.js +3 -0
  55. package/.next/standalone/.next/server/app/api/internal/harness/pending/route/app-paths-manifest.json +3 -0
  56. package/.next/standalone/.next/server/app/api/internal/harness/pending/route/build-manifest.json +9 -0
  57. package/.next/standalone/.next/server/app/api/internal/harness/pending/route/server-reference-manifest.json +4 -0
  58. package/.next/standalone/.next/server/app/api/internal/harness/pending/route.js +7 -0
  59. package/.next/standalone/.next/server/app/api/internal/harness/pending/route.js.nft.json +1 -0
  60. package/.next/standalone/.next/server/app/api/internal/harness/pending/route_client-reference-manifest.js +3 -0
  61. package/.next/standalone/.next/server/app/api/internal/harness/reply/route/app-paths-manifest.json +3 -0
  62. package/.next/standalone/.next/server/app/api/internal/harness/reply/route/build-manifest.json +9 -0
  63. package/.next/standalone/.next/server/app/api/internal/harness/reply/route/server-reference-manifest.json +4 -0
  64. package/.next/standalone/.next/server/app/api/internal/harness/reply/route.js +12 -0
  65. package/.next/standalone/.next/server/app/api/internal/harness/reply/route.js.nft.json +1 -0
  66. package/.next/standalone/.next/server/app/api/internal/harness/reply/route_client-reference-manifest.js +3 -0
  67. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js +1 -1
  68. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
  69. package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js +1 -1
  70. package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js +3 -3
  72. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +2 -2
  74. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js +1 -1
  76. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js +1 -1
  78. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js +1 -1
  80. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js +1 -1
  82. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js +3 -3
  84. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js.nft.json +1 -1
  85. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +5 -5
  86. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  87. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js +4 -4
  88. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js.nft.json +1 -1
  89. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js +2 -2
  90. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js +2 -2
  92. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +4 -3
  94. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/harness/page/app-paths-manifest.json +3 -0
  96. package/.next/standalone/.next/server/app/harness/page/build-manifest.json +18 -0
  97. package/.next/standalone/.next/server/app/harness/page/next-font-manifest.json +11 -0
  98. package/.next/standalone/.next/server/app/harness/page/react-loadable-manifest.json +18 -0
  99. package/.next/standalone/.next/server/app/harness/page/server-reference-manifest.json +389 -0
  100. package/.next/standalone/.next/server/app/harness/page.js +25 -0
  101. package/.next/standalone/.next/server/app/harness/page.js.nft.json +1 -0
  102. package/.next/standalone/.next/server/app/harness/page_client-reference-manifest.js +3 -0
  103. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  104. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +68 -68
  105. package/.next/standalone/.next/server/app/missions/page.js +8 -8
  106. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  107. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +2 -2
  109. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +31 -31
  110. package/.next/standalone/.next/server/app/onboarding/page.js +6 -6
  111. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  112. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +2 -2
  114. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +31 -31
  115. package/.next/standalone/.next/server/app/page.js +6 -6
  116. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  117. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +2 -2
  119. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +132 -96
  120. package/.next/standalone/.next/server/app/settings/page.js +9 -8
  121. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  122. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +2 -2
  124. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +106 -106
  125. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +8 -8
  126. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  127. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +2 -2
  129. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +89 -89
  130. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +7 -7
  131. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  132. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  133. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +2 -2
  134. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +78 -78
  135. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +8 -8
  136. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  137. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +2 -2
  139. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +77 -77
  140. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +8 -7
  141. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  143. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +2 -2
  144. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +31 -31
  145. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +7 -7
  146. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  147. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +2 -2
  149. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +67 -67
  150. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +7 -7
  151. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  153. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +3 -3
  154. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +83 -83
  155. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +10 -9
  156. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  157. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  158. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +2 -2
  159. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +53 -53
  160. package/.next/standalone/.next/server/app/workspaces/page.js +6 -6
  161. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  163. package/.next/standalone/.next/server/app-paths-manifest.json +5 -0
  164. package/.next/standalone/.next/server/chunks/{_0keginv._.js → 0se9_next_0cuhhky._.js} +3 -3
  165. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_03qwlhl.js +1 -1
  166. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_09pca3o.js +1 -1
  167. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +1 -1
  168. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +3 -0
  169. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
  170. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0m8aavq.js +1 -1
  171. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yp430z.js +1 -1
  172. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yzw48x.js +1 -1
  173. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0lvlooo._.js → [root-of-the-server]__0-kboke._.js} +1 -1
  174. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-z_a1d._.js +1 -1
  175. package/.next/standalone/.next/server/chunks/[root-of-the-server]__02r7j6y._.js +3 -0
  176. package/.next/standalone/.next/server/chunks/[root-of-the-server]__034jopu._.js +4 -0
  177. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06x1zwj._.js +28 -0
  178. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0j7565a._.js → [root-of-the-server]__07xsu6m._.js} +2 -2
  179. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08-bq72._.js +3 -0
  180. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08-s.nv._.js +4 -0
  181. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08clp-r._.js +3 -0
  182. package/.next/standalone/.next/server/chunks/[root-of-the-server]__095t6ga._.js +3 -0
  183. package/.next/standalone/.next/server/chunks/[root-of-the-server]__098.3z2._.js +1 -1
  184. package/.next/standalone/.next/server/chunks/[root-of-the-server]__09arklv._.js +3 -0
  185. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_7_w.g._.js +3 -0
  186. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_~s0z4._.js +3 -0
  187. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ehx6q.._.js +3 -0
  188. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gbyryz._.js +3 -0
  189. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gn0ubd._.js +1 -1
  190. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gwztza._.js +1 -1
  191. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k9rz_z._.js +3 -0
  192. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0khq-k0._.js +3 -0
  193. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l1-djp._.js +1 -1
  194. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nt7c0f._.js +3 -0
  195. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o6i1wy._.js +3 -0
  196. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pmamzv._.js +3 -0
  197. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pr~t0y._.js +3 -0
  198. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0ajay8_._.js → [root-of-the-server]__0pzyjqf._.js} +1 -1
  199. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qcpe0l._.js +3 -0
  200. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qfcg6k._.js +3 -0
  201. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sq5irw._.js +3 -0
  202. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0tplo5s._.js +3 -0
  203. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0tpzojh._.js +3 -0
  204. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u8tl88._.js +28 -0
  205. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0v98a~t._.js +3 -0
  206. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vh3112._.js +3 -0
  207. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wjr-72._.js +3 -0
  208. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xasom7._.js +4 -0
  209. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xot7fu._.js +1 -1
  210. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xy1t4x._.js +4 -0
  211. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y3adwk._.js +3 -0
  212. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y~y6sh._.js +3 -0
  213. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10aw_67._.js +3 -0
  214. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10ci~o9._.js +3 -0
  215. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10jnn26._.js +3 -0
  216. package/.next/standalone/.next/server/chunks/[root-of-the-server]__116v_bx._.js +4 -0
  217. package/.next/standalone/.next/server/chunks/[root-of-the-server]__119rbly._.js +3 -0
  218. package/.next/standalone/.next/server/chunks/[root-of-the-server]__12fmxq0._.js +3 -0
  219. package/.next/standalone/.next/server/chunks/[root-of-the-server]__136ty69._.js +3 -0
  220. package/.next/standalone/.next/server/chunks/{_0q10iet._.js → _02hac5p._.js} +1 -1
  221. package/.next/standalone/.next/server/chunks/{_12537g8._.js → _0je3dz2._.js} +1 -1
  222. package/.next/standalone/.next/server/chunks/_0qk_esg._.js +2 -2
  223. package/.next/standalone/.next/server/chunks/_0t31z6q._.js +1 -1
  224. package/.next/standalone/.next/server/chunks/{_0jmdgq~._.js → _0tidm8l._.js} +1 -1
  225. package/.next/standalone/.next/server/chunks/_0zok2an._.js +7 -0
  226. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_ask_route_actions_0_c62hg.js +3 -0
  227. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_notify_route_actions_08hof6m.js +3 -0
  228. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_pending_route_actions_0w9t_9m.js +3 -0
  229. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_reply_route_actions_0qatz~a.js +3 -0
  230. package/.next/standalone/.next/server/chunks/{src_0fq3zjg._.js → src_05balzk._.js} +2 -2
  231. package/.next/standalone/.next/server/chunks/src_0aqjfcv._.js +3 -0
  232. package/.next/standalone/.next/server/chunks/src_0aygchu._.js +3 -0
  233. package/.next/standalone/.next/server/chunks/{src_0~ey84y._.js → src_0gif-f5._.js} +2 -2
  234. package/.next/standalone/.next/server/chunks/{src_0wlyw0g._.js → src_0vp6.co._.js} +2 -2
  235. package/.next/standalone/.next/server/chunks/src_11k6i~l._.js +3 -0
  236. package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +8 -2
  237. package/.next/standalone/.next/server/chunks/src_lib_02llcit._.js +1 -1
  238. package/.next/standalone/.next/server/chunks/src_lib_0aowbzy._.js +1 -1
  239. package/.next/standalone/.next/server/chunks/src_lib_0d~1~wz._.js +3 -0
  240. package/.next/standalone/.next/server/chunks/src_lib_0nw5n~t._.js +1 -1
  241. package/.next/standalone/.next/server/chunks/src_lib_0ylel_1._.js +3 -0
  242. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  243. package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
  244. package/.next/standalone/.next/server/chunks/src_lib_config-defaults_ts_10ayktg._.js +3 -0
  245. package/.next/standalone/.next/server/chunks/src_lib_config-reader_ts_0e5f7vk._.js +3 -0
  246. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  247. package/.next/standalone/.next/server/chunks/ssr/0se9_next_11h0sx_._.js +1 -1
  248. package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_esm_build_templates_app-page_0fro4ex.js +4 -0
  249. package/.next/standalone/.next/server/chunks/ssr/0ws9_lucide-react_dist_esm_icons_0r~ty--._.js +3 -0
  250. package/.next/standalone/.next/server/chunks/ssr/12k._sonner_dist_index_mjs_0-vmpk5._.js +3 -0
  251. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.q~~2p._.js +3 -0
  252. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01zrinc._.js +3 -0
  253. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0iln7n_._.js → [root-of-the-server]__03x8axh._.js} +4 -4
  254. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +1 -1
  255. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__051tpij._.js +30 -0
  256. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +1 -1
  257. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06s-_gx._.js +30 -0
  258. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0yby8pl._.js → [root-of-the-server]__06t.cx~._.js} +4 -4
  259. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08etd~v._.js +30 -0
  260. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0k6oo0n._.js → [root-of-the-server]__096w7g2._.js} +2 -2
  261. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ecd_1d._.js → [root-of-the-server]__0__klx0._.js} +4 -4
  262. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ccy_gg._.js +3 -0
  263. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cjmeyl._.js +3 -0
  264. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dfqa5a._.js +30 -0
  265. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dmjt7o._.js +30 -0
  266. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dv.-zu._.js +30 -0
  267. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0lws68d._.js → [root-of-the-server]__0dx9sp-._.js} +4 -4
  268. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0f57j8r._.js +47 -0
  269. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fl0l82._.js +30 -0
  270. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g2wrd2._.js +30 -0
  271. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0i0k_zi._.js +30 -0
  272. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ixgha6._.js +30 -0
  273. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j1dx6p._.js +47 -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]__0kn~asi._.js +47 -0
  276. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__127w3bm._.js → [root-of-the-server]__0lau3k_._.js} +2 -2
  277. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0m.hayd._.js +47 -0
  278. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mpjat-._.js +1 -1
  279. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_z5hke._.js → [root-of-the-server]__0o9jkew._.js} +1 -1
  280. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0sg4fde._.js +4 -0
  281. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t_zq~v._.js +30 -0
  282. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0zzqn5z._.js → [root-of-the-server]__0tb.1li._.js} +2 -2
  283. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__04ednzb._.js → [root-of-the-server]__0vi-5xg._.js} +2 -2
  284. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w24qox._.js +47 -0
  285. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wq~4aj._.js +30 -0
  286. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ydiu_y._.js +30 -0
  287. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yihqy6._.js +3 -0
  288. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ynq8ty._.js +3 -0
  289. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  290. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zouyfp._.js +3 -0
  291. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~s8otw._.js +30 -0
  292. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1184s~q._.js +3 -0
  293. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11fp64w._.js +3 -0
  294. package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
  295. package/.next/standalone/.next/server/chunks/ssr/_0..h3hk._.js +3 -0
  296. package/.next/standalone/.next/server/chunks/ssr/_0.iq8t8._.js +4 -0
  297. package/.next/standalone/.next/server/chunks/ssr/_00.myc6._.js +3 -0
  298. package/.next/standalone/.next/server/chunks/ssr/_00eymu8._.js +3 -0
  299. package/.next/standalone/.next/server/chunks/ssr/{_07lq-bp._.js → _01fdzzv._.js} +1 -1
  300. package/.next/standalone/.next/server/chunks/ssr/{_0_q41~z._.js → _03-we0p._.js} +4 -4
  301. package/.next/standalone/.next/server/chunks/ssr/{_0uryq~z._.js → _04szgc6._.js} +2 -2
  302. package/.next/standalone/.next/server/chunks/ssr/{_113957g._.js → _078cdw~._.js} +1 -1
  303. package/.next/standalone/.next/server/chunks/ssr/_08bq4g8._.js +1 -1
  304. package/.next/standalone/.next/server/chunks/ssr/{_0j5.ig_._.js → _09rq08e._.js} +1 -1
  305. package/.next/standalone/.next/server/chunks/ssr/_09z-55_._.js +17 -0
  306. package/.next/standalone/.next/server/chunks/ssr/{src_components_ui_popover_tsx_0a78wqo._.js → _0bndp1~._.js} +2 -2
  307. package/.next/standalone/.next/server/chunks/ssr/{_08-x_rp._.js → _0h0b46r._.js} +1 -1
  308. package/.next/standalone/.next/server/chunks/ssr/{_0wqcz3w._.js → _0kd_tda._.js} +4 -4
  309. package/.next/standalone/.next/server/chunks/ssr/{_07q06~v._.js → _0ktexki._.js} +4 -4
  310. package/.next/standalone/.next/server/chunks/ssr/{_0b7smy6._.js → _0ljrvyt._.js} +2 -2
  311. package/.next/standalone/.next/server/chunks/ssr/_0lo1nei._.js +6 -0
  312. package/.next/standalone/.next/server/chunks/ssr/_0mdd702._.js +3 -0
  313. package/.next/standalone/.next/server/chunks/ssr/_0n0q6~9._.js +3 -0
  314. package/.next/standalone/.next/server/chunks/ssr/_0os43sb._.js +3 -0
  315. package/.next/standalone/.next/server/chunks/ssr/_0pab_al._.js +3 -0
  316. package/.next/standalone/.next/server/chunks/ssr/{_047dh-f._.js → _0pg6-.y._.js} +2 -2
  317. package/.next/standalone/.next/server/chunks/ssr/{_05a2u03._.js → _0pvp63a._.js} +4 -4
  318. package/.next/standalone/.next/server/chunks/ssr/_0qi4x-5._.js +3 -0
  319. package/.next/standalone/.next/server/chunks/ssr/{_0s.h4l2._.js → _0qnobd-._.js} +1 -1
  320. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  321. package/.next/standalone/.next/server/chunks/ssr/_0ts~td3._.js +3 -0
  322. package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
  323. package/.next/standalone/.next/server/chunks/ssr/{_0s.ik0k._.js → _0xnn~jq._.js} +1 -1
  324. package/.next/standalone/.next/server/chunks/ssr/_0y0_4zs._.js +3 -0
  325. package/.next/standalone/.next/server/chunks/ssr/{_0nze-e6._.js → _0ytcm0j._.js} +1 -1
  326. package/.next/standalone/.next/server/chunks/ssr/_0yva1-.._.js +3 -0
  327. package/.next/standalone/.next/server/chunks/ssr/{_0dxbp89._.js → _0yz5dmq._.js} +4 -4
  328. package/.next/standalone/.next/server/chunks/ssr/{_060e1u.._.js → _0~6pqk.._.js} +1 -1
  329. package/.next/standalone/.next/server/chunks/ssr/_11w13--._.js +3 -0
  330. package/.next/standalone/.next/server/chunks/ssr/{_0oeih09._.js → _12la163._.js} +2 -2
  331. package/.next/standalone/.next/server/chunks/ssr/{_0rtydyv._.js → _13_b8hh._.js} +1 -1
  332. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_09eeb85._.js +3 -0
  333. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  334. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  335. package/.next/standalone/.next/server/chunks/ssr/src_0vv366l._.js +3 -0
  336. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +8 -2
  337. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  338. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  339. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  340. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  341. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  342. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  343. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
  344. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  345. package/.next/standalone/.next/server/chunks/ssr/src_components_0rowjw~._.js +7 -0
  346. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0.~.oo-._.js → src_lib_0-x.wbd._.js} +1 -1
  347. package/.next/standalone/.next/server/chunks/ssr/{src_lib_00wjv6n._.js → src_lib_00p-ir2._.js} +1 -1
  348. package/.next/standalone/.next/server/chunks/ssr/src_lib_03x1i~1._.js +5 -0
  349. package/.next/standalone/.next/server/chunks/ssr/{src_lib_005uqbe._.js → src_lib_03xtona._.js} +1 -1
  350. package/.next/standalone/.next/server/chunks/ssr/{src_lib_01sr8_t._.js → src_lib_04y-65j._.js} +1 -1
  351. package/.next/standalone/.next/server/chunks/ssr/src_lib_08gthaz._.js +3 -0
  352. package/.next/standalone/.next/server/chunks/ssr/src_lib_090~6pq._.js +3 -0
  353. package/.next/standalone/.next/server/chunks/ssr/src_lib_0k8dkbn._.js +3 -0
  354. package/.next/standalone/.next/server/chunks/ssr/src_lib_0knbpxk._.js +3 -0
  355. package/.next/standalone/.next/server/chunks/ssr/src_lib_0p_iehl._.js +3 -0
  356. package/.next/standalone/.next/server/chunks/ssr/src_lib_0qve1ri._.js +3 -0
  357. package/.next/standalone/.next/server/chunks/ssr/src_lib_0s35u~4._.js +3 -0
  358. package/.next/standalone/.next/server/chunks/ssr/src_lib_0x2ui80._.js +3 -0
  359. package/.next/standalone/.next/server/chunks/ssr/src_lib_0ypc5_d._.js +3 -0
  360. package/.next/standalone/.next/server/chunks/ssr/src_lib_10jh2mz._.js +3 -0
  361. package/.next/standalone/.next/server/chunks/ssr/src_lib_harness_harness-message_ts_0_3ygf9._.js +3 -0
  362. package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
  363. package/.next/standalone/.next/server/functions-config-manifest.json +5 -0
  364. package/.next/standalone/.next/server/instrumentation.js +1 -1
  365. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  366. package/.next/standalone/.next/server/next-font-manifest.js +1 -1
  367. package/.next/standalone/.next/server/next-font-manifest.json +4 -0
  368. package/.next/standalone/.next/server/pages/500.html +1 -1
  369. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  370. package/.next/standalone/.next/server/server-reference-manifest.json +582 -330
  371. package/.next/standalone/.next/static/chunks/0-nppzqp-r.9c.js +1 -0
  372. package/.next/standalone/.next/static/chunks/{0-vgfstmpuwnx.js → 0-te2tg6~a23u.js} +1 -1
  373. package/.next/standalone/.next/static/chunks/0.64.6c1mh7d2.js +1 -0
  374. package/.next/standalone/.next/static/chunks/0.8n1ce9lggg4.js +1 -0
  375. package/.next/standalone/.next/static/chunks/0.zgqz~m3sjej.js +1 -0
  376. package/.next/standalone/.next/static/chunks/00.eotegra08r.js +1 -0
  377. package/.next/standalone/.next/static/chunks/{0sr-m2t6vck14.js → 02xqrfqu.s8-i.js} +1 -1
  378. package/.next/standalone/.next/static/chunks/03y272e6e9o8i.js +1 -0
  379. package/.next/standalone/.next/static/chunks/08eyd7sq064r0.js +1 -0
  380. package/.next/standalone/.next/static/chunks/09b33znj4m__c.js +1 -0
  381. package/.next/standalone/.next/static/chunks/{0ts___1ygewqp.js → 09bezwcb__18t.js} +1 -1
  382. package/.next/standalone/.next/static/chunks/{14mk_a0k99wbg.js → 0bvhkgitn__gl.js} +1 -1
  383. package/.next/standalone/.next/static/chunks/0c.t.evwah_m4.js +1 -0
  384. package/.next/standalone/.next/static/chunks/{08i9.47-_mxro.js → 0c4-6qdhi645s.js} +1 -1
  385. package/.next/standalone/.next/static/chunks/0d0zm8viq3ol4.js +12 -0
  386. package/.next/standalone/.next/static/chunks/0dktl5t_dtxu..js +1 -0
  387. package/.next/standalone/.next/static/chunks/0e5~nzt657k92.js +1 -0
  388. package/.next/standalone/.next/static/chunks/0erwxvpb9w29_.js +1 -0
  389. package/.next/standalone/.next/static/chunks/{04op7bjge~n4l.js → 0gy79dfi~lnig.js} +1 -1
  390. package/.next/standalone/.next/static/chunks/{0rjt_ddd~6t8r.js → 0gz3xwb5_8xwv.js} +1 -1
  391. package/.next/standalone/.next/static/chunks/0i75~pu.bp20..js +1 -0
  392. package/.next/standalone/.next/static/chunks/0jn_w5b9r~beu.js +1 -0
  393. package/.next/standalone/.next/static/chunks/0l59z2mf1ouxu.js +1 -0
  394. package/.next/standalone/.next/static/chunks/0m4xd-ie7j.hx.js +1 -0
  395. package/.next/standalone/.next/static/chunks/0mx9ebe6we4z0.js +1 -0
  396. package/.next/standalone/.next/static/chunks/0nsggimu5je3g.js +1 -0
  397. package/.next/standalone/.next/static/chunks/0nw8nx8kafy79.js +1 -0
  398. package/.next/standalone/.next/static/chunks/0pzjryav9pm7p.js +1 -0
  399. package/.next/standalone/.next/static/chunks/0q-rl50zskr35.js +1 -0
  400. package/.next/standalone/.next/static/chunks/0qqy2x-fsmmmx.js +1 -0
  401. package/.next/standalone/.next/static/chunks/0t59wpux0g1~l.js +1 -0
  402. package/.next/standalone/.next/static/chunks/0uezq8wiwkq8d.js +1 -0
  403. package/.next/standalone/.next/static/chunks/0vrc~7m1_cuvl.js +1 -0
  404. package/.next/standalone/.next/static/chunks/0xbh24-hxrt~m.css +1 -0
  405. package/.next/standalone/.next/static/chunks/0xkkmruo8p.l_.js +1 -0
  406. package/.next/standalone/.next/static/chunks/0xx0pe_j2kmr9.js +2 -0
  407. package/.next/standalone/.next/static/chunks/0zqjqiqmorenw.js +5 -0
  408. package/.next/standalone/.next/static/chunks/136l78utn~v08.js +1 -0
  409. package/.next/standalone/.next/static/chunks/171x9kw9wcyk4.js +1 -0
  410. package/.next/standalone/.next/static/chunks/{11p.r-9wyh7_2.js → 17m4o~gdsvuo3.js} +1 -1
  411. package/.next/standalone/package.json +5 -5
  412. package/dist/mcp-server.cjs +227 -25
  413. package/package.json +5 -5
  414. package/prisma/schema.prisma +37 -0
  415. package/scripts/migrations/0005-add-parent-task-id.ts +29 -0
  416. package/scripts/{stop-hook.js → tower-stop-hook.js} +42 -3
  417. package/skills/tower/SKILL.md +31 -0
  418. package/skills/tower/references/unattended-messaging.md +95 -0
  419. package/tsconfig.json +14 -4
  420. package/.next/standalone/.next/server/chunks/[externals]__0m6hc.0._.js +0 -3
  421. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.p6em~._.js +0 -3
  422. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.zmhk-._.js +0 -3
  423. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0042hx5._.js +0 -3
  424. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03ufxqq._.js +0 -28
  425. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04--bs7._.js +0 -3
  426. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04m2l8a._.js +0 -3
  427. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04r193~._.js +0 -3
  428. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05abzth._.js +0 -3
  429. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0657y50._.js +0 -3
  430. package/.next/standalone/.next/server/chunks/[root-of-the-server]__075a0hk._.js +0 -3
  431. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08yqoti._.js +0 -3
  432. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_d.s7s._.js +0 -28
  433. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b25v3p._.js +0 -4
  434. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clptds._.js +0 -3
  435. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g.k9o~._.js +0 -3
  436. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h6bl6t._.js +0 -3
  437. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i~3dwq._.js +0 -3
  438. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j05vlm._.js +0 -3
  439. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j1px8f._.js +0 -3
  440. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k-5ag7._.js +0 -3
  441. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0otyifi._.js +0 -3
  442. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q~uf3u._.js +0 -3
  443. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t31ba_._.js +0 -3
  444. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t_weyi._.js +0 -3
  445. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uptkzd._.js +0 -4
  446. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wkjqrd._.js +0 -3
  447. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0x3kws1._.js +0 -3
  448. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y8w5di._.js +0 -4
  449. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~g6-c~._.js +0 -3
  450. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10fv6tt._.js +0 -3
  451. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1189rd1._.js +0 -4
  452. package/.next/standalone/.next/server/chunks/src_0weytpz._.js +0 -3
  453. package/.next/standalone/.next/server/chunks/src_lib_0i2.v2d._.js +0 -3
  454. package/.next/standalone/.next/server/chunks/src_lib_12xey8u._.js +0 -3
  455. package/.next/standalone/.next/server/chunks/ssr/0ws9_lucide-react_dist_esm_icons_0pkla8j._.js +0 -3
  456. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00dh103._.js +0 -3
  457. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00ebsjb._.js +0 -30
  458. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01vm_46._.js +0 -47
  459. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__025ol9g._.js +0 -3
  460. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__065f3ii._.js +0 -3
  461. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06dfcgo._.js +0 -30
  462. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07xkj1s._.js +0 -47
  463. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08k-xb7._.js +0 -3
  464. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08tzbfh._.js +0 -3
  465. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0iaw1ms._.js +0 -3
  466. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j_-qk5._.js +0 -30
  467. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oamph.._.js +0 -47
  468. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pnv7nd._.js +0 -30
  469. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0stlq2_._.js +0 -4
  470. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tja~wz._.js +0 -30
  471. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ug022w._.js +0 -30
  472. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x6k.ee._.js +0 -30
  473. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xr45lx._.js +0 -3
  474. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xwzk2.._.js +0 -47
  475. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zxc81t._.js +0 -30
  476. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10c.a3u._.js +0 -30
  477. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10n3vn6._.js +0 -30
  478. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmyb._.js +0 -30
  479. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__124zb~p._.js +0 -30
  480. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12ko8p6._.js +0 -3
  481. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13ce7v2._.js +0 -30
  482. package/.next/standalone/.next/server/chunks/ssr/_00l85fp._.js +0 -4
  483. package/.next/standalone/.next/server/chunks/ssr/_00odlgv._.js +0 -3
  484. package/.next/standalone/.next/server/chunks/ssr/_0463zy~._.js +0 -3
  485. package/.next/standalone/.next/server/chunks/ssr/_05k76ur._.js +0 -3
  486. package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +0 -6
  487. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +0 -7
  488. package/.next/standalone/.next/server/chunks/ssr/_0gkid_a._.js +0 -3
  489. package/.next/standalone/.next/server/chunks/ssr/_0rrs.-d._.js +0 -3
  490. package/.next/standalone/.next/server/chunks/ssr/_0rxeqmo._.js +0 -17
  491. package/.next/standalone/.next/server/chunks/ssr/_0syb503._.js +0 -3
  492. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_03r.9go._.js +0 -3
  493. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_06f0dao._.js +0 -3
  494. package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +0 -3
  495. package/.next/standalone/.next/server/chunks/ssr/src_lib_08jql1e._.js +0 -3
  496. package/.next/standalone/.next/server/chunks/ssr/src_lib_0b~j-9d._.js +0 -3
  497. package/.next/standalone/.next/server/chunks/ssr/src_lib_0eymyjf._.js +0 -3
  498. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fkv9z3._.js +0 -3
  499. package/.next/standalone/.next/server/chunks/ssr/src_lib_0n-n0.a._.js +0 -3
  500. package/.next/standalone/.next/server/chunks/ssr/src_lib_0sgt~lv._.js +0 -3
  501. package/.next/standalone/.next/server/chunks/ssr/src_lib_0sms4xl._.js +0 -5
  502. package/.next/standalone/.next/server/chunks/ssr/src_lib_0x-iyl1._.js +0 -3
  503. package/.next/standalone/.next/server/chunks/ssr/src_lib_0yjmty1._.js +0 -3
  504. package/.next/standalone/.next/server/chunks/ssr/src_lib_13aevv6._.js +0 -3
  505. package/.next/standalone/.next/static/chunks/0.lqb7y9kz5z6.js +0 -1
  506. package/.next/standalone/.next/static/chunks/0.lyp-cx3zt9..js +0 -2
  507. package/.next/standalone/.next/static/chunks/00z.kuqsfrxq5.js +0 -12
  508. package/.next/standalone/.next/static/chunks/01rbl6a8z.tuw.js +0 -1
  509. package/.next/standalone/.next/static/chunks/01yoibobkdz3x.js +0 -1
  510. package/.next/standalone/.next/static/chunks/05v-c3ir3ik_1.js +0 -5
  511. package/.next/standalone/.next/static/chunks/070fs6rmafi.i.js +0 -1
  512. package/.next/standalone/.next/static/chunks/07i9j5yyg4vs3.js +0 -1
  513. package/.next/standalone/.next/static/chunks/0_yp-y9l0upp~.js +0 -1
  514. package/.next/standalone/.next/static/chunks/0ddt-snh45031.js +0 -1
  515. package/.next/standalone/.next/static/chunks/0evfu1ozaw5ak.js +0 -1
  516. package/.next/standalone/.next/static/chunks/0gq65t6au55oa.js +0 -1
  517. package/.next/standalone/.next/static/chunks/0gz71w_~yw2iu.js +0 -1
  518. package/.next/standalone/.next/static/chunks/0hk3lmsij2x1c.js +0 -1
  519. package/.next/standalone/.next/static/chunks/0j1hqwmeaqnn2.js +0 -1
  520. package/.next/standalone/.next/static/chunks/0jrje~1gt6w85.css +0 -1
  521. package/.next/standalone/.next/static/chunks/0p4w5b_p_yju8.js +0 -1
  522. package/.next/standalone/.next/static/chunks/0prrt_bws8ml6.js +0 -1
  523. package/.next/standalone/.next/static/chunks/0qgqjy.9.-qpi.js +0 -1
  524. package/.next/standalone/.next/static/chunks/0rfq8fy71hj7c.js +0 -1
  525. package/.next/standalone/.next/static/chunks/0rnitheqdpd1..js +0 -1
  526. package/.next/standalone/.next/static/chunks/0vmy6tsqy.xf4.js +0 -1
  527. package/.next/standalone/.next/static/chunks/0wbq-_8jyxjxm.js +0 -1
  528. package/.next/standalone/.next/static/chunks/0xejm4ge9~cn..js +0 -1
  529. package/.next/standalone/.next/static/chunks/0~prx0ure_1i6.js +0 -1
  530. package/.next/standalone/.next/static/chunks/1107zshxaajt9.js +0 -1
  531. package/.next/standalone/.next/static/chunks/11x3_612u8w~9.js +0 -1
  532. /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → f1860bJqnbYj-1WLMj7F-}/_buildManifest.js +0 -0
  533. /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → f1860bJqnbYj-1WLMj7F-}/_clientMiddlewareManifest.js +0 -0
  534. /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → f1860bJqnbYj-1WLMj7F-}/_ssgManifest.js +0 -0
  535. /package/scripts/{post-tool-hook.js → tower-post-tool-hook.js} +0 -0
  536. /package/scripts/{session-start-hook.js → tower-session-start-hook.js} +0 -0
@@ -1,5 +1,5 @@
1
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
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(114430),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)];
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
4
 
5
5
  //# sourceMappingURL=_0t31z6q._.js.map
@@ -4,4 +4,4 @@ module.exports=[10005,e=>{"use strict";let t=new(e.i(472129)).ClaudeCliAdapter;a
4
4
  ${e.slice(-5e3)}
5
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
6
 
7
- //# sourceMappingURL=_0jmdgq~._.js.map
7
+ //# sourceMappingURL=_0tidm8l._.js.map
@@ -0,0 +1,7 @@
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=_0zok2an._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[150809,(e,o,d)=>{}];
2
+
3
+ //# sourceMappingURL=_next-internal_server_app_api_internal_harness_ask_route_actions_0_c62hg.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[250380,(e,o,d)=>{}];
2
+
3
+ //# sourceMappingURL=_next-internal_server_app_api_internal_harness_notify_route_actions_08hof6m.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[637352,(e,o,d)=>{}];
2
+
3
+ //# sourceMappingURL=_next-internal_server_app_api_internal_harness_pending_route_actions_0w9t_9m.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[267144,(e,o,d)=>{}];
2
+
3
+ //# sourceMappingURL=_next-internal_server_app_api_internal_harness_reply_route_actions_0qatz~a.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[215624,e=>{"use strict";var t=e.i(921675),a=e.i(843793),n=e.i(195158),r=e.i(50377),i=e.i(86708);let s=["onboarding.completed","onboarding.lastStep","onboarding.username"];async function o(){let e=await a.db.systemConfig.findMany({where:{key:{in:[...s]}}}),t={};for(let a of e)try{t[a.key]=JSON.parse(a.value)}catch{t[a.key]=null}let n=!0===t["onboarding.completed"],r=t["onboarding.lastStep"],i=t["onboarding.username"];return{isFirstRun:!n,isCompleted:n,lastStep:"number"==typeof r?r:0,username:"string"==typeof i&&i.length>0?i:null}}async function l(e){await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),(0,n.revalidatePath)("/","layout")}async function u(e,t=4){if(await a.db.systemConfig.upsert({where:{key:"onboarding.completed"},create:{key:"onboarding.completed",value:"true"},update:{value:"true"}}),await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:String(t)},update:{value:String(t)}}),void 0!==e){let t=e.trim().slice(0,64).replace(/[\r\n]/g," ");t.length>0&&await a.db.systemConfig.upsert({where:{key:"onboarding.username"},create:{key:"onboarding.username",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}(0,n.revalidatePath)("/","layout")}async function d(e,t){await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.requested"},create:{key:"onboarding.extensions.requested",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.completed"},create:{key:"onboarding.extensions.completed",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}}),(0,n.revalidatePath)("/","layout")}async function c(t){try{r.logger.create("task-completion").info("Task completion event dispatched",{taskId:t.taskId,taskTitle:t.taskTitle,status:t.status,executionId:t.executionId});let{broadcastNotification:a}=await e.A(590621);a({...t,type:"completion"})}catch{}}(0,i.ensureServerEntryExports)([o,l,u,d,c]),(0,t.registerServerReference)(o,"00120f8f663c6ecb5e907be3722be478161731fb06",null),(0,t.registerServerReference)(l,"40f1fe7136b3744a64a73f740180f891458c0c6401",null),(0,t.registerServerReference)(u,"60055c035170d24b736f46a94e3432ed3060e75fb0",null),(0,t.registerServerReference)(d,"60bac43b8930ce1461a961a4aa62d3122b8ee95c7b",null),(0,t.registerServerReference)(c,"4027ca05fa72e0ebd510c561a1c9b99820fffdc216",null),e.s(["dispatchTaskCompletionEvent",0,c])},590621,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~ju4-d._.js","server/chunks/src_lib_0i2.v2d._.js"].map(t=>e.l(t))).then(()=>t(513200)))}];
1
+ module.exports=[215624,e=>{"use strict";var t=e.i(921675),a=e.i(843793),n=e.i(195158),r=e.i(50377),i=e.i(86708);let s=["onboarding.completed","onboarding.lastStep","onboarding.username"];async function o(){let e=await a.db.systemConfig.findMany({where:{key:{in:[...s]}}}),t={};for(let a of e)try{t[a.key]=JSON.parse(a.value)}catch{t[a.key]=null}let n=!0===t["onboarding.completed"],r=t["onboarding.lastStep"],i=t["onboarding.username"];return{isFirstRun:!n,isCompleted:n,lastStep:"number"==typeof r?r:0,username:"string"==typeof i&&i.length>0?i:null}}async function d(e){await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),(0,n.revalidatePath)("/","layout")}async function l(e,t=4){if(await a.db.systemConfig.upsert({where:{key:"onboarding.completed"},create:{key:"onboarding.completed",value:"true"},update:{value:"true"}}),await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:String(t)},update:{value:String(t)}}),void 0!==e){let t=e.trim().slice(0,64).replace(/[\r\n]/g," ");t.length>0&&await a.db.systemConfig.upsert({where:{key:"onboarding.username"},create:{key:"onboarding.username",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}(0,n.revalidatePath)("/","layout")}async function u(e,t){await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.requested"},create:{key:"onboarding.extensions.requested",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.completed"},create:{key:"onboarding.extensions.completed",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}}),(0,n.revalidatePath)("/","layout")}async function c(t){try{r.logger.create("task-completion").info("Task completion event dispatched",{taskId:t.taskId,taskTitle:t.taskTitle,status:t.status,executionId:t.executionId});let{broadcastNotification:a}=await e.A(590621);a({...t,type:"completion"}),(async()=>{try{let{db:a}=await e.A(989186),{recordHarnessMessage:n}=await e.A(60345),r=await a.task.findUnique({where:{id:t.taskId},select:{unattended:!0}});if(!r?.unattended)return;let i="COMPLETED"===t.status;await n({taskId:t.taskId,executionId:t.executionId,kind:i?"done":"failed",content:i?"任务已完成,进入待审阅。":"任务执行失败,请查看终端。"})}catch{}})()}catch{}}(0,i.ensureServerEntryExports)([o,d,l,u,c]),(0,t.registerServerReference)(o,"0018fbdd66aba52ffae0eea94c547cdac80082d648",null),(0,t.registerServerReference)(d,"4043130a1d362ee33ae88de0ed751aa1fbfa0fb132",null),(0,t.registerServerReference)(l,"602e0b75d87a1db34c3ffadaf61190e40e67bb0a42",null),(0,t.registerServerReference)(u,"603480184e60c27214a54381387436ff640e52b1b6",null),(0,t.registerServerReference)(c,"40a9ab396e79818e2ea0459b4f4c315855196db134",null),e.s(["dispatchTaskCompletionEvent",0,c])},590621,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~ju4-d._.js","server/chunks/src_lib_0d~1~wz._.js"].map(t=>e.l(t))).then(()=>t(513200)))},989186,e=>{e.v(e=>Promise.resolve().then(()=>e(843793)))},60345,e=>{e.v(e=>Promise.resolve().then(()=>e(108789)))}];
2
2
 
3
- //# sourceMappingURL=src_0fq3zjg._.js.map
3
+ //# sourceMappingURL=src_05balzk._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[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"抱歉,我只能帮你管理工作区、项目和任务。编码、调试等操作请在任务终端中完成。"\n\n## 任务来源标注\n每次通过 create_task 创建任务时,在 description 末尾追加一段来源标注(与任务终端、飞书的来源规范一致):\n## 来源\nTower Assistant',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"},"task.systemDirective":{defaultValue:"## Tower 系统说明\n你运行在 Tower(一个 AI 任务调度平台)的任务终端里,为某个具体任务而启动。你的产出会被 Tower 记录为「任务执行」,任务结束后进入 review 状态,可能被派生你的父任务或用户审阅。环境变量里有 TOWER_TASK_ID(当前任务 id)、TOWER_TASK_TITLE(任务标题)等,可用来识别自己。\n\n## 首要原则\n- **项目自身规则优先**:工作目录里项目的 CLAUDE.md / AGENTS.md 等约定优先级最高,与本声明冲突时以项目规则为准。本声明只规定「作为一个 Tower 任务」的通用行为,不覆盖具体项目的技术规范。\n- **只做任务范围内的事**:紧扣当前任务目标,不顺手改无关代码、不擅自扩大改动面。\n- **完成即验证**:有测试 / 构建 / lint / 类型检查就先跑一遍再宣称「做完」;失败如实报告,不确定就说不确定,别把没验证的当成功。\n- **长进程别占住终端**:dev server、watch 等需长时间前台运行的命令,用完即停或放后台,别让任务终端被永久卡住(Tower 的 Preview 有独立管理,通常不需要你手动起 dev server)。\n- **默认用中文回复**(除非项目或用户另有要求)。\n\n## Git 工作规则\n- 完成一段有意义的改动后,主动用清晰的 message 创建 commit(约定式:feat / fix / refactor / docs / chore…),不要留一堆未提交的改动。\n- 若当前任务运行在 Git worktree 隔离分支里(worktree 任务):**只 commit,不要 push** —— worktree 分支由 Tower 统一管理与合并。\n- 若当前任务直接在项目主工作区里(非 worktree 任务):可以 push。\n- 不确定自己是不是 worktree 任务时,默认只 commit、不 push。\n\n## 并发与协作(多任务可能同改一个仓库)\n- Tower 常同时跑多个任务、甚至同一仓库多个 worktree。**只 stage / commit 你这轮亲手改的文件**,一律 `git add <明确路径>`;禁止 `git add .` / `-A` / `-u` / `git commit -a`,别把别的窗口或用户手动的改动一并提交。\n- `git status` 里不认识、不是你改的文件一律不碰、不提交,需要时在小结里提一句即可。\n- 不 force-push、不改写共享分支历史;不对不属于你的改动做 `git reset --hard` / `git clean -fd`。\n\n## Worktree 纪律(务必防止改到主仓库)\n- 开工第一件事先跑 `pwd`:它就是你的工作根。之后所有 Read/Edit/Write/Bash 路径都以它为基准,优先用相对路径;用绝对路径时必须以这个根开头,**绝不**凭上下文/记忆里的主仓库路径去拼绝对路径——这正是历次「worktree 里看什么都没变」的根因。\n- 判断自己是不是 worktree 任务:`pwd` 落在 `.worktrees/task-$TOWER_TASK_ID` 下、或 `git branch --show-current` 为 `task/$TOWER_TASK_ID`,即是。是则严格走本节纪律。\n- 动任何文件 / 提交前,先核对三件事都成立:① `git rev-parse --show-toplevel` 等于当前 worktree 根(不是主仓库路径);② `git branch --show-current` 为 `task/$TOWER_TASK_ID`(不是 main / feature / 其它分支);③ 要改的文件绝对路径含 `.worktrees/task-$TOWER_TASK_ID/` 段。任一不满足,说明你操作到主仓库了,**立即停止、不要提交**,先纠正目录。\n- 绝不 `cd` 到主仓库或 worktree 之外去改文件 / 跑 git;所有 git 命令都在当前 worktree 根内执行(跨目录时用 `git -C <worktree 根>` 显式指定,别靠默认 cwd 猜)。\n- 万一已经改错到主仓库:把改动搬回 worktree(`git -C <worktree 根> cherry-pick <误提交>` 或重打一遍),主仓库工作区用 `git restore` 复原、误提交按情况处理——已被别的提交叠在上面就用 `git revert`(保历史、不动别人的提交),确认独占且未 push 才用 `git reset`;最后如实报告两边最终状态,不要隐瞒。\n\n## 汇报与交接\n- 产出会被 review,结尾给一段可速读的小结:做了什么、改了哪些关键文件、验证结果、还剩什么没做 / 被什么阻塞、有没有需要用户或父任务拍板的决策。\n- 真被外部因素阻塞(待接口、待素材、待人决策)就**明确说明并停下**,别反复空转或自行臆测硬做。\n- 危险 / 不可逆操作(删数据库、删大目录、`rm -rf`、`drop table`、对外发布 / 部署)先说明并征得确认再执行。\n\n## 无人值守(环境变量 TOWER_UNATTENDED=1 时尤其重要)\n- 你可能在无人盯守下运行。两个与人沟通的 MCP 工具:`ask_human`(阻塞:**记录**问题并挂起任务——本回合到此为止,人回复后自动唤醒、带答案续跑)和 `notify_human`(非阻塞:**记录**一条进度/FYI 后立即继续,不必等回复、不挂起)。**注意:这两个工具只在 Tower 内记录(/harness 面板可见),本身不把消息发给人**;无人值守下要真正通知到人,须按系统提示里「无人值守外推」段先经平台渠道把消息发出去,再调这两个工具留档。\n- 需要人拍板才能推进(选型、二义需求、缺关键信息、对外发布/部署等)→ 用 `ask_human` 把问题和可选项讲清楚,然后停下等待,别自行臆测硬做。\n- 危险 / 不可逆操作(删库、删大目录、`rm -rf`、`drop table`、force-push、对外发布)→ 一律先 `ask_human` 征得同意再执行,即使终端已放开权限也不例外。\n- 只是想同步进展或抛个 FYI、无需回复 → 用 `notify_human`,发完继续干。\n- 调用 `ask_human` 后立即结束本回合、不要再继续操作;它会关闭终端省资源,人回复后任务自动恢复。\n\n## 本轮 commit 回显\n- **每轮回复的最后,必须把本轮创建的 commit 列出来让用户一眼看到**。格式固定:先一行加粗小标题 `**本轮 commit**`(不要用 `---` 分隔线、不要用 emoji),换行后每条 commit 单独一行、以 `- ` 开头,形如 `` - `<短 hash>` <message 首行> ``(hash 用行内代码包住)。本轮没有创建任何 commit 时,只回一行 `本轮无 commit`。",type:"string",label:"Task System Directive (built-in)"},"harness.targets":{defaultValue:[],type:"object",label:"Harness Notify Targets (multi-platform registry)"},"harness.pendingTtlDays":{defaultValue:14,type:"number",label:"Harness Pending Ask TTL (days)"}}])},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),a=e.i(814747);function r(e){return e.startsWith("~/")?a.default.join(t.default.homedir(),e.slice(2)):e}function n(e){let t,a=e.match(/^git@([^:]+):(.+)$/);if(a)return{host:a[1],pathSegments:s(a[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:l}=e;if("code.iflytek.com"===s){let e,t;return r((e=[...l],"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 a;let e,t;return r((e=(a=l)[0],t=a[1],e&&t?`${"jp-liu"===e?"~/project/i":"~/project/f"}/${t}`:""))}let i=l[l.length-1];return i?r(`~/project/f/${i}`):""}catch{return""}},"matchGitPathRule",0,function(e,t){if(!t.length)return"";let a=e.trim();if(!a)return"";let s=n(a);if(!s)return"";let{host:l,pathSegments:i}=s,o=i[0]??"",u=i[i.length-1]??"",c=[...t].sort((e,t)=>{let a=+("*"===e.ownerMatch),r=+("*"===t.ownerMatch);return a!==r?a-r:e.priority-t.priority}),d=i.join("/");for(let e of c){if(e.host!==l||"*"!==e.ownerMatch&&e.ownerMatch!==o)continue;let t=e.localPathTemplate;if(t.includes("{path}"))return r(t.replace("{path}",d).replace("{owner}",o).replace("{repo}",u).replace(/\/+$/,""));let a=t.replace("{owner}",o).replace("{repo}","").replace(/\/+$/,"");return r(`${a}/${u}`)}return""}])},22569,e=>e.a(async(t,a)=>{try{var r=e.i(921675),n=e.i(843793),s=e.i(276534),l=e.i(519827),i=e.i(61920),o=e.i(769310),u=e.i(721390),c=e.i(86708),d=t([u]);async function m(e,t){let a=await n.db.systemConfig.findUnique({where:{key:e}});if(!a)return t;try{return JSON.parse(a.value)}catch{return t}}async function p(e,t){await n.db.systemConfig.upsert({where:{key:e},create:{key:e,value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}async function f(){let e=await m(l.ARCHIVE_DELAY_KEY,l.DEFAULT_ARCHIVE_DELAY_DAYS);return(0,l.normalizeArchiveDelayDays)(e)}async function b(e){let t=e.trim();if(!t)return{path:"",source:"empty"};try{let e=await m("git.pathMappingRules",[]),a=(0,i.matchGitPathRule)(t,e);if(a)return{path:a,source:"rule"};return{path:(0,i.gitUrlToLocalPath)(t),source:"fallback"}}catch{return{path:(0,i.gitUrlToLocalPath)(t),source:"fallback"}}}async function h(e){let{path:t}=await b(e);return t}async function y(e){let t=await n.db.systemConfig.findMany({where:{key:{in:e}}}),a=Object.fromEntries(t.map(e=>{try{return[e.key,JSON.parse(e.value)]}catch{return[e.key,null]}})),r={};for(let t of e)r[t]=t in a?a[t]:s.CONFIG_DEFAULTS[t]?.defaultValue??null;return r}async function g(){return(0,o.detectShells)()}async function w(){return(0,o.detectTerminalApps)()}async function T(){return(0,o.detectEditors)()}async function k(){return{platform:process.platform}}async function S(){let e=(0,u.getActiveWsPort)();if(null!==e)return e;let t=parseInt(process.env.PORT||"3000",10);return m("terminal.wsPort",t+1)}[u]=d.then?(await d)():d,(0,c.ensureServerEntryExports)([m,p,f,b,h,y,g,w,T,k,S]),(0,r.registerServerReference)(m,"6022dc05b858325d54679979f48ec6986b1257019b",null),(0,r.registerServerReference)(p,"600c0360fc4ce13a01e338268cc272dde1b16ec989",null),(0,r.registerServerReference)(f,"0018c44abcb186f7ba3403be069e7e9f6da8616369",null),(0,r.registerServerReference)(b,"406446cc2b798b6d5a8041b1a353ccdb1582682094",null),(0,r.registerServerReference)(h,"404ef38e3210ade662b09756d1418c29f2fab30709",null),(0,r.registerServerReference)(y,"40a8d9987d8b71ec56eef76f4a4ea0c28fdcd8edc0",null),(0,r.registerServerReference)(g,"003999071c484871321a8108440d7489c3f12e05ad",null),(0,r.registerServerReference)(w,"005c2726b05a25fd0df69e27f64e4c4d3ac62d4aeb",null),(0,r.registerServerReference)(T,"000978f807ee1c10e9f24a8760105b9a4286b20f03",null),(0,r.registerServerReference)(k,"00b51d8a985a33823255b31ad031b117cbf4d4026b",null),(0,r.registerServerReference)(S,"00bbe981391f69ab27be7d2c2adf20dcedb8f4caea",null),e.s(["getConfigValue",0,m]),a()}catch(e){a(e)}},!1)];
2
+
3
+ //# sourceMappingURL=src_0aqjfcv._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[397998,e=>{"use strict";async function r(){{let{pruneOrphanedWorktrees:r,cleanupStaleExecutions:s,ensureTowerLabel:t,ensureDefaultWorkspace:a}=await e.A(257948);await r(),await s(),await t(),await a();let{startWsServer:o}=await e.A(484221);await o();let{ensureTowerDir:l}=await e.A(204549);l();let i=globalThis;if(!i.__harnessSweepStarted){i.__harnessSweepStarted=!0;let r=async()=>{try{let{readConfigValue:r}=await e.A(938213),{sweepExpiredAsks:s}=await e.A(28505),t=await r("harness.pendingTtlDays",14),a=await s(t);a>0&&console.error(`[harness] TTL sweep expired ${a} stale open ask(s)`)}catch(e){console.error("[harness] TTL sweep failed:",e)}};r(),setInterval(()=>void r(),216e5)}(async()=>{try{let{providerRegistry:r}=await e.A(128761),{installAllForProvider:s}=await e.A(518092),t=parseInt(process.env.PORT||"3000",10),a=`http://localhost:${t}`;for(let e of r.getAll()){let r=e.cli?.adapter;if(r)try{if(await r.repairHookPaths?.().catch(()=>{}),!await r.isAvailable()||await r.isMcpInstalled("tower",{scope:"user"}).catch(()=>!1))continue;let t=await s(e.name,a);t.ok?console.error(`[init-tower] Auto-installed Tower MCP for ${e.name} (user scope)`):console.error(`[init-tower] Auto-install for ${e.name} reported issues:`,{mcp:t.mcp?.ok,hooks:t.hooks?.ok,skill:t.skill?.ok})}catch(r){console.error(`[init-tower] Auto-install failed for ${e.name}:`,r)}}}catch(e){console.error("[init-tower] Provider auto-install setup failed:",e)}})()}}e.s(["register",0,r])},257948,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__136ty69._.js"].map(r=>e.l(r))).then(()=>r(271856)))},484221,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0_~s0z4._.js","server/chunks/src_lib_0ylel_1._.js"].map(r=>e.l(r))).then(()=>r(336114)))},204549,e=>{e.v(r=>Promise.all(["server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js","server/chunks/[root-of-the-server]__0u8tl88._.js"].map(r=>e.l(r))).then(()=>r(301105)))},938213,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0qfcg6k._.js"].map(r=>e.l(r))).then(()=>r(746888)))},28505,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__12fmxq0._.js"].map(r=>e.l(r))).then(()=>r(845520)))},128761,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__0-kboke._.js","server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js"].map(r=>e.l(r))).then(()=>r(136902)))},518092,e=>{e.v(r=>Promise.all(["server/chunks/[root-of-the-server]__02r7j6y._.js","server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js"].map(r=>e.l(r))).then(()=>r(760138)))}];
2
+
3
+ //# sourceMappingURL=src_0aygchu._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[215624,e=>{"use strict";var t=e.i(921675),a=e.i(843793),n=e.i(195158),r=e.i(50377),i=e.i(86708);let s=["onboarding.completed","onboarding.lastStep","onboarding.username"];async function o(){let e=await a.db.systemConfig.findMany({where:{key:{in:[...s]}}}),t={};for(let a of e)try{t[a.key]=JSON.parse(a.value)}catch{t[a.key]=null}let n=!0===t["onboarding.completed"],r=t["onboarding.lastStep"],i=t["onboarding.username"];return{isFirstRun:!n,isCompleted:n,lastStep:"number"==typeof r?r:0,username:"string"==typeof i&&i.length>0?i:null}}async function l(e){await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),(0,n.revalidatePath)("/","layout")}async function u(e,t=4){if(await a.db.systemConfig.upsert({where:{key:"onboarding.completed"},create:{key:"onboarding.completed",value:"true"},update:{value:"true"}}),await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:String(t)},update:{value:String(t)}}),void 0!==e){let t=e.trim().slice(0,64).replace(/[\r\n]/g," ");t.length>0&&await a.db.systemConfig.upsert({where:{key:"onboarding.username"},create:{key:"onboarding.username",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}(0,n.revalidatePath)("/","layout")}async function d(e,t){await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.requested"},create:{key:"onboarding.extensions.requested",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.completed"},create:{key:"onboarding.extensions.completed",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}}),(0,n.revalidatePath)("/","layout")}async function c(t){try{r.logger.create("task-completion").info("Task completion event dispatched",{taskId:t.taskId,taskTitle:t.taskTitle,status:t.status,executionId:t.executionId});let{broadcastNotification:a}=await e.A(590621);a({...t,type:"completion"})}catch{}}(0,i.ensureServerEntryExports)([o,l,u,d,c]),(0,t.registerServerReference)(o,"00120f8f663c6ecb5e907be3722be478161731fb06",null),(0,t.registerServerReference)(l,"40f1fe7136b3744a64a73f740180f891458c0c6401",null),(0,t.registerServerReference)(u,"60055c035170d24b736f46a94e3432ed3060e75fb0",null),(0,t.registerServerReference)(d,"60bac43b8930ce1461a961a4aa62d3122b8ee95c7b",null),(0,t.registerServerReference)(c,"4027ca05fa72e0ebd510c561a1c9b99820fffdc216",null),e.s(["dispatchTaskCompletionEvent",0,c])},590621,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~ju4-d._.js","server/chunks/src_lib_0i2.v2d._.js"].map(t=>e.l(t))).then(()=>t(513200)))}];
1
+ module.exports=[215624,e=>{"use strict";var t=e.i(921675),a=e.i(843793),n=e.i(195158),r=e.i(50377),i=e.i(86708);let s=["onboarding.completed","onboarding.lastStep","onboarding.username"];async function o(){let e=await a.db.systemConfig.findMany({where:{key:{in:[...s]}}}),t={};for(let a of e)try{t[a.key]=JSON.parse(a.value)}catch{t[a.key]=null}let n=!0===t["onboarding.completed"],r=t["onboarding.lastStep"],i=t["onboarding.username"];return{isFirstRun:!n,isCompleted:n,lastStep:"number"==typeof r?r:0,username:"string"==typeof i&&i.length>0?i:null}}async function d(e){await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),(0,n.revalidatePath)("/","layout")}async function l(e,t=4){if(await a.db.systemConfig.upsert({where:{key:"onboarding.completed"},create:{key:"onboarding.completed",value:"true"},update:{value:"true"}}),await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:String(t)},update:{value:String(t)}}),void 0!==e){let t=e.trim().slice(0,64).replace(/[\r\n]/g," ");t.length>0&&await a.db.systemConfig.upsert({where:{key:"onboarding.username"},create:{key:"onboarding.username",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}(0,n.revalidatePath)("/","layout")}async function u(e,t){await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.requested"},create:{key:"onboarding.extensions.requested",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.completed"},create:{key:"onboarding.extensions.completed",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}}),(0,n.revalidatePath)("/","layout")}async function c(t){try{r.logger.create("task-completion").info("Task completion event dispatched",{taskId:t.taskId,taskTitle:t.taskTitle,status:t.status,executionId:t.executionId});let{broadcastNotification:a}=await e.A(590621);a({...t,type:"completion"}),(async()=>{try{let{db:a}=await e.A(989186),{recordHarnessMessage:n}=await e.A(60345),r=await a.task.findUnique({where:{id:t.taskId},select:{unattended:!0}});if(!r?.unattended)return;let i="COMPLETED"===t.status;await n({taskId:t.taskId,executionId:t.executionId,kind:i?"done":"failed",content:i?"任务已完成,进入待审阅。":"任务执行失败,请查看终端。"})}catch{}})()}catch{}}(0,i.ensureServerEntryExports)([o,d,l,u,c]),(0,t.registerServerReference)(o,"0018fbdd66aba52ffae0eea94c547cdac80082d648",null),(0,t.registerServerReference)(d,"4043130a1d362ee33ae88de0ed751aa1fbfa0fb132",null),(0,t.registerServerReference)(l,"602e0b75d87a1db34c3ffadaf61190e40e67bb0a42",null),(0,t.registerServerReference)(u,"603480184e60c27214a54381387436ff640e52b1b6",null),(0,t.registerServerReference)(c,"40a9ab396e79818e2ea0459b4f4c315855196db134",null),e.s(["dispatchTaskCompletionEvent",0,c])},590621,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~ju4-d._.js","server/chunks/src_lib_0d~1~wz._.js"].map(t=>e.l(t))).then(()=>t(513200)))},989186,e=>{e.v(e=>Promise.resolve().then(()=>e(843793)))},60345,e=>{e.v(e=>Promise.resolve().then(()=>e(108789)))}];
2
2
 
3
- //# sourceMappingURL=src_0~ey84y._.js.map
3
+ //# sourceMappingURL=src_0gif-f5._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[215624,e=>{"use strict";var t=e.i(921675),a=e.i(843793),n=e.i(195158),r=e.i(50377),i=e.i(86708);let s=["onboarding.completed","onboarding.lastStep","onboarding.username"];async function o(){let e=await a.db.systemConfig.findMany({where:{key:{in:[...s]}}}),t={};for(let a of e)try{t[a.key]=JSON.parse(a.value)}catch{t[a.key]=null}let n=!0===t["onboarding.completed"],r=t["onboarding.lastStep"],i=t["onboarding.username"];return{isFirstRun:!n,isCompleted:n,lastStep:"number"==typeof r?r:0,username:"string"==typeof i&&i.length>0?i:null}}async function l(e){await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),(0,n.revalidatePath)("/","layout")}async function u(e,t=4){if(await a.db.systemConfig.upsert({where:{key:"onboarding.completed"},create:{key:"onboarding.completed",value:"true"},update:{value:"true"}}),await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:String(t)},update:{value:String(t)}}),void 0!==e){let t=e.trim().slice(0,64).replace(/[\r\n]/g," ");t.length>0&&await a.db.systemConfig.upsert({where:{key:"onboarding.username"},create:{key:"onboarding.username",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}(0,n.revalidatePath)("/","layout")}async function d(e,t){await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.requested"},create:{key:"onboarding.extensions.requested",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.completed"},create:{key:"onboarding.extensions.completed",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}}),(0,n.revalidatePath)("/","layout")}async function c(t){try{r.logger.create("task-completion").info("Task completion event dispatched",{taskId:t.taskId,taskTitle:t.taskTitle,status:t.status,executionId:t.executionId});let{broadcastNotification:a}=await e.A(590621);a({...t,type:"completion"})}catch{}}(0,i.ensureServerEntryExports)([o,l,u,d,c]),(0,t.registerServerReference)(o,"00120f8f663c6ecb5e907be3722be478161731fb06",null),(0,t.registerServerReference)(l,"40f1fe7136b3744a64a73f740180f891458c0c6401",null),(0,t.registerServerReference)(u,"60055c035170d24b736f46a94e3432ed3060e75fb0",null),(0,t.registerServerReference)(d,"60bac43b8930ce1461a961a4aa62d3122b8ee95c7b",null),(0,t.registerServerReference)(c,"4027ca05fa72e0ebd510c561a1c9b99820fffdc216",null),e.s(["dispatchTaskCompletionEvent",0,c])},590621,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~ju4-d._.js","server/chunks/src_lib_0i2.v2d._.js"].map(t=>e.l(t))).then(()=>t(513200)))}];
1
+ module.exports=[215624,e=>{"use strict";var t=e.i(921675),a=e.i(843793),n=e.i(195158),r=e.i(50377),i=e.i(86708);let s=["onboarding.completed","onboarding.lastStep","onboarding.username"];async function o(){let e=await a.db.systemConfig.findMany({where:{key:{in:[...s]}}}),t={};for(let a of e)try{t[a.key]=JSON.parse(a.value)}catch{t[a.key]=null}let n=!0===t["onboarding.completed"],r=t["onboarding.lastStep"],i=t["onboarding.username"];return{isFirstRun:!n,isCompleted:n,lastStep:"number"==typeof r?r:0,username:"string"==typeof i&&i.length>0?i:null}}async function d(e){await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),(0,n.revalidatePath)("/","layout")}async function l(e,t=4){if(await a.db.systemConfig.upsert({where:{key:"onboarding.completed"},create:{key:"onboarding.completed",value:"true"},update:{value:"true"}}),await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:String(t)},update:{value:String(t)}}),void 0!==e){let t=e.trim().slice(0,64).replace(/[\r\n]/g," ");t.length>0&&await a.db.systemConfig.upsert({where:{key:"onboarding.username"},create:{key:"onboarding.username",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}(0,n.revalidatePath)("/","layout")}async function u(e,t){await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.requested"},create:{key:"onboarding.extensions.requested",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.completed"},create:{key:"onboarding.extensions.completed",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}}),(0,n.revalidatePath)("/","layout")}async function c(t){try{r.logger.create("task-completion").info("Task completion event dispatched",{taskId:t.taskId,taskTitle:t.taskTitle,status:t.status,executionId:t.executionId});let{broadcastNotification:a}=await e.A(590621);a({...t,type:"completion"}),(async()=>{try{let{db:a}=await e.A(989186),{recordHarnessMessage:n}=await e.A(60345),r=await a.task.findUnique({where:{id:t.taskId},select:{unattended:!0}});if(!r?.unattended)return;let i="COMPLETED"===t.status;await n({taskId:t.taskId,executionId:t.executionId,kind:i?"done":"failed",content:i?"任务已完成,进入待审阅。":"任务执行失败,请查看终端。"})}catch{}})()}catch{}}(0,i.ensureServerEntryExports)([o,d,l,u,c]),(0,t.registerServerReference)(o,"0018fbdd66aba52ffae0eea94c547cdac80082d648",null),(0,t.registerServerReference)(d,"4043130a1d362ee33ae88de0ed751aa1fbfa0fb132",null),(0,t.registerServerReference)(l,"602e0b75d87a1db34c3ffadaf61190e40e67bb0a42",null),(0,t.registerServerReference)(u,"603480184e60c27214a54381387436ff640e52b1b6",null),(0,t.registerServerReference)(c,"40a9ab396e79818e2ea0459b4f4c315855196db134",null),e.s(["dispatchTaskCompletionEvent",0,c])},590621,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~ju4-d._.js","server/chunks/src_lib_0d~1~wz._.js"].map(t=>e.l(t))).then(()=>t(513200)))},989186,e=>{e.v(e=>Promise.resolve().then(()=>e(843793)))},60345,e=>{e.v(e=>Promise.resolve().then(()=>e(108789)))}];
2
2
 
3
- //# sourceMappingURL=src_0wlyw0g._.js.map
3
+ //# sourceMappingURL=src_0vp6.co._.js.map