tower-studio 0.2.44 → 0.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +6 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +38 -0
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +133 -85
- package/.next/standalone/.next/server/app/_not-found/page.js +8 -9
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/adapters/test/route.js +2 -2
- package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js +2 -3
- package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +2 -2
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/route.js +5 -4
- package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +3 -4
- package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/harness/ask/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/internal/harness/ask/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/internal/harness/ask/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/internal/harness/ask/route.js +7 -0
- package/.next/standalone/.next/server/app/api/internal/harness/ask/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/internal/harness/ask/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/internal/harness/notify/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/internal/harness/notify/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/internal/harness/notify/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/internal/harness/notify/route.js +7 -0
- package/.next/standalone/.next/server/app/api/internal/harness/notify/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/internal/harness/notify/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/internal/harness/pending/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/internal/harness/pending/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/internal/harness/pending/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/internal/harness/pending/route.js +7 -0
- package/.next/standalone/.next/server/app/api/internal/harness/pending/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/internal/harness/pending/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/internal/harness/reply/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/internal/harness/reply/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/internal/harness/reply/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/internal/harness/reply/route.js +12 -0
- package/.next/standalone/.next/server/app/api/internal/harness/reply/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/internal/harness/reply/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js +3 -3
- package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +2 -2
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js +5 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +6 -5
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js +5 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js +2 -2
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js +2 -2
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +5 -3
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/harness/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/harness/page/build-manifest.json +18 -0
- package/.next/standalone/.next/server/app/harness/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/harness/page/react-loadable-manifest.json +18 -0
- package/.next/standalone/.next/server/app/harness/page/server-reference-manifest.json +437 -0
- package/.next/standalone/.next/server/app/harness/page.js +24 -0
- package/.next/standalone/.next/server/app/harness/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/harness/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +3 -2
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +244 -160
- package/.next/standalone/.next/server/app/missions/page.js +11 -11
- package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +133 -85
- package/.next/standalone/.next/server/app/onboarding/page.js +8 -9
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +133 -85
- package/.next/standalone/.next/server/app/page.js +8 -9
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +260 -140
- package/.next/standalone/.next/server/app/settings/page.js +10 -11
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +284 -248
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +9 -10
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +247 -211
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +9 -10
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/build-manifest.json +18 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/react-loadable-manifest.json +18 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/server-reference-manifest.json +401 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js +24 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +222 -186
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +9 -10
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +257 -209
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +10 -11
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +133 -85
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +9 -10
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +219 -171
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +9 -10
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +4 -4
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +269 -221
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +11 -12
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +169 -133
- package/.next/standalone/.next/server/app/workspaces/page.js +8 -9
- package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +6 -0
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_09ikw5j.js +5 -0
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +9 -5
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-1~xqo._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0lvlooo._.js → [root-of-the-server]__0-kboke._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.3n3t.._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.wsvr6._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.yf1mx._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00xe-t8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02r7j6y._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02yvm55._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__09arklv._.js → [root-of-the-server]__04-ty51._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__065hi6e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06iuq17._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06x1zwj._.js +28 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06~wmlx._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08-bq72._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08clp-r._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__092475e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__095t6ga._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_7_w.g._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0atap--._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c3je91._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dz.knv._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ehwsa1._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esywxf._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fd9z.r._.js +30 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gbyryz._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gcg7i.._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iyp~.k._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0khq-k0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kkrbn-._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l1-djp._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0m8t3vi._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nt7c0f._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nv83.p._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pr~t0y._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qcpe0l._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qfcg6k._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sq5irw._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0squ613._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u8tl88._.js +28 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wjr-72._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wugb-9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yeg1kp._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zchqv1._.js +43 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zcy11y._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~1-i5h._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~ju4-d._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10aw_67._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10ci~o9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10qclz-._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12fmxq0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__136ty69._.js +3 -0
- package/.next/standalone/.next/server/chunks/_02hac5p._.js +30 -0
- package/.next/standalone/.next/server/chunks/_0_w835g._.js +4 -0
- package/.next/standalone/.next/server/chunks/_0je3dz2._.js +30 -0
- package/.next/standalone/.next/server/chunks/_0tidm8l._.js +30 -0
- package/.next/standalone/.next/server/chunks/_0zok2an._.js +30 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_ask_route_actions_0_c62hg.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_notify_route_actions_08hof6m.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_pending_route_actions_0w9t_9m.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_internal_harness_reply_route_actions_0qatz~a.js +3 -0
- package/.next/standalone/.next/server/chunks/src_05balzk._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_0aygchu._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_0gif-f5._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_0pg9w-x._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_0vp6.co._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_11k6i~l._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +8 -2
- package/.next/standalone/.next/server/chunks/src_lib_02llcit._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_0aowbzy._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_0d~1~wz._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_0ylel_1._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_config-defaults_ts_10ayktg._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_config-reader_ts_0e5f7vk._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_0i5qmqd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_esm_build_templates_app-page_04~dhws.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_esm_build_templates_app-page_0fro4ex.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/0ws9_lucide-react_dist_esm_icons_0gv_cwy._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/12k._sonner_dist_index_mjs_0-vmpk5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-geq20._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.0m12b._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00qzvly._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01bz3_g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~hdzx._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06sew6r._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07rk6ic._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090y_.y._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b.ej5q._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b6fbjv._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b6hugs._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0br5e7w._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bx_h2u._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dhq_gl._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e79g0v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0esg88l._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h_pt4a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hzwoy5._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0idkp76._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4m.1s._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kmonje._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kqp70x._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l0~scn._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lh3mlq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0m8m7vc._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0muf4wq._.js +49 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n02kfa._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n3uc.v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o5ohqy._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s_q09t._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s~4y3y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s~ak20._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta_mpj._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0trmndk._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u3~-.g._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vyl8to._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ws0_c1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x7br99._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xnuz05._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ynq8ty._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zsnp~d._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~edc3d._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~mhv4m._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1013v_g._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11fp64w._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmn-._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_z5hke._.js → [root-of-the-server]__12viys4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0-5.hgb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0dye20y._.js → _0-wp_zu._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0..h3hk._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_08bq4g8._.js → _00_h2nx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_02p-udo._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_05~lqg-._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_0771b4a._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{_113957g._.js → _0ak77.u._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_11osha9._.js → _0ami9yt._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0r4_qn~._.js → _0awn2mm._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_07lq-bp._.js → _0b660g4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0j5.ig_._.js → _0czsddm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0fmko25._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0_nhdgs._.js → _0gomvsp._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0g~p9_x._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hg~.4w._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hsuip_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0zr81mw._.js → _0hx2o_8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0s.ik0k._.js → _0j7m~u6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_08-x_rp._.js → _0l6byg1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0i4xdso._.js → _0mmy~98._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0nrxhfb._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{_02vz78l._.js → _0o_c3b2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0os43sb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0nze-e6._.js → _0p5ft59._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0q2pep_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_060e1u.._.js → _0snv7nt._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0ty4xe6._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/_0vkl7.h._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0x09t_o._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_0z5~opf._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0zn.4bi._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_1086w4p._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_10q2mbe._.js +17 -0
- package/.next/standalone/.next/server/chunks/ssr/_11.knhq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1118hto._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0rtydyv._.js → _12s8n8g._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_11j0qlp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +8 -2
- package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_0rowjw~._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_00wjv6n._.js → src_lib_04nzvfd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0.~.oo-._.js → src_lib_0_px2pz._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0a.zy31._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0b73q0a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0cld9rt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_005uqbe._.js → src_lib_0dbf2qa._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0er7rzd._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0f0v8_~._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fr6fzy._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_01sr8_t._.js → src_lib_0h2u7a0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0k04rl3._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0lpxsj~._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sq6aqm._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ui-~7g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0y5zzg-._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0z-gn78._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_13c4a4g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_harness_harness-message_ts_0_3ygf9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_pty_11~ojr2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_pty_orphan-reaper_ts_0a0qmlo._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0ng0eku._.js → src_lib_schemas_ts_0ph~1ak._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
- package/.next/standalone/.next/server/functions-config-manifest.json +6 -0
- package/.next/standalone/.next/server/instrumentation.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.json +8 -0
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +2368 -1528
- package/.next/standalone/.next/static/chunks/0-kkc.ibted8y.js +1 -0
- package/.next/standalone/.next/static/chunks/{0xejm4ge9~cn..js → 0.2y9uc38xso-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0346xrw6i2bwo.js → 0.gedys.tq.~k.js} +1 -1
- package/.next/standalone/.next/static/chunks/00g58.es_hxli.js +1 -0
- package/.next/standalone/.next/static/chunks/00o_eiv12t~.1.js +1 -0
- package/.next/standalone/.next/static/chunks/01qtgj0xv1fsm.js +2 -0
- package/.next/standalone/.next/static/chunks/024euw7po0d0w.js +1 -0
- package/.next/standalone/.next/static/chunks/02v-9v~885t9c.js +1 -0
- package/.next/standalone/.next/static/chunks/03ct4d8znb7tp.js +1 -0
- package/.next/standalone/.next/static/chunks/03uix~1ru.ovv.js +1 -0
- package/.next/standalone/.next/static/chunks/04.2m8l~ws19v.js +1 -0
- package/.next/standalone/.next/static/chunks/06x7oq8_iu~9d.js +1 -0
- package/.next/standalone/.next/static/chunks/07c4b1kp_85qg.js +1 -0
- package/.next/standalone/.next/static/chunks/07qijq9o5jccu.js +1 -0
- package/.next/standalone/.next/static/chunks/{0uj-3ckujwaiy.js → 09om2gfwimh7k.js} +1 -1
- package/.next/standalone/.next/static/chunks/0alhq.h4~iogi.js +1 -0
- package/.next/standalone/.next/static/chunks/{0rcuiuax31_uh.js → 0cf7e1scao3zk.js} +1 -1
- package/.next/standalone/.next/static/chunks/0ck~sr0nkabl~.js +1 -0
- package/.next/standalone/.next/static/chunks/0d1ok-v-u-xe~.js +1 -0
- package/.next/standalone/.next/static/chunks/0d9u2xspag~4h.js +5 -0
- package/.next/standalone/.next/static/chunks/0ftptcpntzaux.js +1 -0
- package/.next/standalone/.next/static/chunks/0gk~m5bwgoafi.js +1 -0
- package/.next/standalone/.next/static/chunks/0in_7s8n4lmfr.js +1 -0
- package/.next/standalone/.next/static/chunks/0ix28r65.7o_r.js +12 -0
- package/.next/standalone/.next/static/chunks/0j5olwb~d3~3j.js +1 -0
- package/.next/standalone/.next/static/chunks/0mtrtl-jl46in.js +2 -0
- package/.next/standalone/.next/static/chunks/0ov_akpudbv96.js +5 -0
- package/.next/standalone/.next/static/chunks/0oyskd~8~j.j7.js +1 -0
- package/.next/standalone/.next/static/chunks/0q1872yhybt55.js +1 -0
- package/.next/standalone/.next/static/chunks/0seo-lerjdkbn.js +1 -0
- package/.next/standalone/.next/static/chunks/0t1awv68pnn-e.js +1 -0
- package/.next/standalone/.next/static/chunks/0wl8cpmvyhv0l.js +1 -0
- package/.next/standalone/.next/static/chunks/0~2l3wz-gxs2j.js +1 -0
- package/.next/standalone/.next/static/chunks/0~7h_a_dofg-4.js +1 -0
- package/.next/standalone/.next/static/chunks/11yhe31en~dvt.js +1 -0
- package/.next/standalone/.next/static/chunks/12-mlz2vukuga.js +1 -0
- package/.next/standalone/.next/static/chunks/14fch6~swodjf.css +1 -0
- package/.next/standalone/.next/static/chunks/15gztq9f12uhe.js +1 -0
- package/.next/standalone/.next/static/chunks/15ue90qe1sh-9.js +1 -0
- package/.next/standalone/.next/static/chunks/17z9uivez~kp3.js +1 -0
- package/.next/standalone/package.json +5 -6
- package/dist/mcp-server.cjs +1597 -4545
- package/package.json +5 -6
- package/prisma/schema.prisma +83 -5
- package/scripts/migrations/0005-add-parent-task-id.ts +29 -0
- package/scripts/migrations/0006-project-knowledge.ts +58 -0
- package/scripts/migrations/0007-product-group.ts +67 -0
- package/scripts/{stop-hook.js → tower-stop-hook.js} +42 -3
- package/skills/tower/SKILL.md +36 -75
- package/skills/tower/references/task-source.md +80 -0
- package/skills/tower/references/unattended-messaging.md +95 -0
- package/tsconfig.json +14 -4
- package/.next/standalone/.next/server/chunks/[externals]__0x_wqa7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.p6em~._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.zmhk-._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0042hx5._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03ufxqq._.js +0 -28
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04--bs7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04m2l8a._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04r193~._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0657y50._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06ndn7a._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08yqoti._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__098.3z2._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_d.s7s._.js +0 -28
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_zfnj0._.js +0 -20
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clptds._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g.k9o~._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i34gbs._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iggiij._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i~3dwq._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j05vlm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j1px8f._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k-5ag7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0otyifi._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pl.c5.._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0r~9.7c._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t31ba_._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t_weyi._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uptkzd._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0x3kws1._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y8w5di._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zi3~a8._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~g6-c~._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10fv6tt._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1189rd1._.js +0 -4
- package/.next/standalone/.next/server/chunks/_0jmdgq~._.js +0 -7
- package/.next/standalone/.next/server/chunks/_0q10iet._.js +0 -7
- package/.next/standalone/.next/server/chunks/_0qk_esg._.js +0 -4
- package/.next/standalone/.next/server/chunks/_0t31z6q._.js +0 -5
- package/.next/standalone/.next/server/chunks/_12537g8._.js +0 -7
- package/.next/standalone/.next/server/chunks/src_0fq3zjg._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_0weytpz._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_0wlyw0g._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_0~ey84y._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_lib_0i2.v2d._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_lib_0nw5n~t._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_lib_12xey8u._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/0ws9_lucide-react_dist_esm_icons_0pkla8j._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00ebsjb._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01fmnse._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01vm_46._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__025ol9g._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__049n47u._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04ednzb._.js +0 -43
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06dfcgo._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07xkj1s._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__081e5n~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08tzbfh._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ecd_1d._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0iln7n_._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j_-qk5._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k6oo0n._.js +0 -43
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lws68d._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mpjat-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oamph.._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pnv7nd._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tja~wz._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ug022w._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ugledi._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vxlsec._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w0.sdz._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x6k.ee._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xwzk2.._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yby8pl._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zxc81t._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zzqn5z._.js +0 -43
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10c.a3u._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10n3vn6._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmyb._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__124zb~p._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__127w3bm._.js +0 -43
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13ce7v2._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/_04~mjmb._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_05a2u03._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +0 -6
- package/.next/standalone/.next/server/chunks/ssr/_07q06~v._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0_q41~z._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_0dxbp89._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0foto06._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0kojxno._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0rxeqmo._.js +0 -17
- package/.next/standalone/.next/server/chunks/ssr/_0s.h4l2._.js +0 -43
- package/.next/standalone/.next/server/chunks/ssr/_0u3yt.5._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_0wqcz3w._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0ye1-r-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_03r.9go._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_06f0dao._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_08jql1e._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0b~j-9d._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0eymyjf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fkv9z3._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0n-n0.a._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sgt~lv._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sms4xl._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0x-iyl1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0yjmty1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_13aevv6._.js +0 -3
- package/.next/standalone/.next/static/chunks/0-tuek2jqf0el.js +0 -1
- package/.next/standalone/.next/static/chunks/0.-.jc~0b~hy0.js +0 -1
- package/.next/standalone/.next/static/chunks/0.lqb7y9kz5z6.js +0 -1
- package/.next/standalone/.next/static/chunks/0.nsmn6shzidu.js +0 -2
- package/.next/standalone/.next/static/chunks/0.~03w.uxge40.js +0 -1
- package/.next/standalone/.next/static/chunks/01hdj_kw4z2zq.js +0 -2
- package/.next/standalone/.next/static/chunks/01j9m895w64zn.js +0 -1
- package/.next/standalone/.next/static/chunks/01yoibobkdz3x.js +0 -1
- package/.next/standalone/.next/static/chunks/041o.dh2lc-k3.js +0 -1
- package/.next/standalone/.next/static/chunks/07i9j5yyg4vs3.js +0 -1
- package/.next/standalone/.next/static/chunks/08ooaq~-.8fzu.js +0 -1
- package/.next/standalone/.next/static/chunks/0bylodlncwfpb.js +0 -5
- package/.next/standalone/.next/static/chunks/0clewc5ifaruu.js +0 -12
- package/.next/standalone/.next/static/chunks/0cpwtqzrjdgvs.js +0 -1
- package/.next/standalone/.next/static/chunks/0c~e1-nst-ze-.js +0 -1
- package/.next/standalone/.next/static/chunks/0ddt-snh45031.js +0 -1
- package/.next/standalone/.next/static/chunks/0dv4anj-j523o.js +0 -1
- package/.next/standalone/.next/static/chunks/0gf~0e3xpa0fj.js +0 -5
- package/.next/standalone/.next/static/chunks/0gvfb.b8m_i8t.js +0 -1
- package/.next/standalone/.next/static/chunks/0h77-u2vvr-a1.js +0 -1
- package/.next/standalone/.next/static/chunks/0jrje~1gt6w85.css +0 -1
- package/.next/standalone/.next/static/chunks/0lqp~-dlfenad.js +0 -1
- package/.next/standalone/.next/static/chunks/0p4w5b_p_yju8.js +0 -1
- package/.next/standalone/.next/static/chunks/0qkr26yz3bocs.js +0 -1
- package/.next/standalone/.next/static/chunks/0uf~7eqel0zra.js +0 -1
- package/.next/standalone/.next/static/chunks/0w71r_sj_fibx.js +0 -1
- package/.next/standalone/.next/static/chunks/0xg6rcq6g4bbh.js +0 -1
- package/.next/standalone/.next/static/chunks/0yff8rwmrl5m4.js +0 -1
- package/.next/standalone/.next/static/chunks/0ymipmkk2uqby.js +0 -1
- package/.next/standalone/.next/static/chunks/0znfclapbniaa.js +0 -1
- package/.next/standalone/.next/static/chunks/11pe3kpxuj33f.js +0 -1
- package/.next/standalone/.next/static/chunks/172s9cg35qt7i.js +0 -1
- package/.next/standalone/.next/static/chunks/17m4o~gdsvuo3.js +0 -1
- package/.next/standalone/.next/static/chunks/184-zu89wwa4u.js +0 -1
- package/next.config.ts +0 -18
- /package/.next/standalone/.next/static/{dinNvsaC6aoPK_B7ZTeBv → Pf_z-PYy0CJhvcyPEi-LM}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{dinNvsaC6aoPK_B7ZTeBv → Pf_z-PYy0CJhvcyPEi-LM}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{dinNvsaC6aoPK_B7ZTeBv → Pf_z-PYy0CJhvcyPEi-LM}/_ssgManifest.js +0 -0
- /package/scripts/{post-tool-hook.js → tower-post-tool-hook.js} +0 -0
- /package/scripts/{session-start-hook.js → tower-session-start-hook.js} +0 -0
package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_09ikw5j.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
module.exports=[766434,t=>{"use strict";var e=t.i(765876),i=t.i(675896),s=t.i(959160),r=t.i(97944),n=t.i(86757),h=t.i(204144),o=t.i(273436),a=t.i(743641),l=t.i(813766),d=t.i(840884),u=t.i(498814),f=t.i(780006),c=t.i(544432),p=t.i(772005),m=t.i(450223),y=t.i(193695);t.i(628400);var b=t.i(800071),E=t.i(855104),g=t.i(198840),w=t.i(750227),R=t.i(902157),v=t.i(192520);t.i(660526);var _=t.i(427699),S=t.i(522734),O=t.i(687769),T=t.i(81111),k=t.i(899871),L=t.i(814747),x=t.i(449719),A=t.i(500874),N=t.i(406461),D=t.i(57328),I=t.i(666680),C=t.i(912714),B=Object.defineProperty,M="object"==typeof process&&process?process:{stdout:null,stderr:null},F=t=>!!t&&"object"==typeof t&&(t instanceof tR||t instanceof T.default||P(t)||z(t)),P=t=>!!t&&"object"==typeof t&&t instanceof O.EventEmitter&&"function"==typeof t.pipe&&t.pipe!==T.default.Writable.prototype.pipe,z=t=>!!t&&"object"==typeof t&&t instanceof O.EventEmitter&&"function"==typeof t.write&&"function"==typeof t.end,U=Symbol("EOF"),j=Symbol("maybeEmitEnd"),H=Symbol("emittedEnd"),Z=Symbol("emittingEnd"),G=Symbol("emittedError"),W=Symbol("closed"),$=Symbol("read"),V=Symbol("flush"),Y=Symbol("flushChunk"),q=Symbol("encoding"),K=Symbol("decoder"),X=Symbol("flowing"),Q=Symbol("paused"),J=Symbol("resume"),tt=Symbol("buffer"),te=Symbol("pipes"),ti=Symbol("bufferLength"),ts=Symbol("bufferPush"),tr=Symbol("bufferShift"),tn=Symbol("objectMode"),th=Symbol("destroyed"),to=Symbol("error"),ta=Symbol("emitData"),tl=Symbol("emitEnd"),td=Symbol("emitEnd2"),tu=Symbol("async"),tf=Symbol("abort"),tc=Symbol("aborted"),tp=Symbol("signal"),tm=Symbol("dataListeners"),ty=Symbol("discarded"),tb=t=>Promise.resolve().then(t),tE=t=>t(),tg=class{src;dest;opts;ondrain;constructor(t,e,i){this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[J](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},tw=class extends tg{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)}},tR=class extends O.EventEmitter{[X]=!1;[Q]=!1;[te]=[];[tt]=[];[tn];[q];[tu];[K];[U]=!1;[H]=!1;[Z]=!1;[W]=!1;[G]=null;[ti]=0;[th]=!1;[tp];[tc]=!1;[tm]=0;[ty]=!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[tn]=!0,this[q]=null):(t=>!t.objectMode&&!!t.encoding&&"buffer"!==t.encoding)(e)?(this[q]=e.encoding,this[tn]=!1):(this[tn]=!1,this[q]=null),this[tu]=!!e.async,this[K]=this[q]?new k.StringDecoder(this[q]):null,e&&!0===e.debugExposeBuffer&&Object.defineProperty(this,"buffer",{get:()=>this[tt]}),e&&!0===e.debugExposePipes&&Object.defineProperty(this,"pipes",{get:()=>this[te]});let{signal:i}=e;i&&(this[tp]=i,i.aborted?this[tf]():i.addEventListener("abort",()=>this[tf]()))}get bufferLength(){return this[ti]}get encoding(){return this[q]}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[tn]}set objectMode(t){throw Error("objectMode must be set at instantiation time")}get async(){return this[tu]}set async(t){this[tu]=this[tu]||!!t}[tf](){this[tc]=!0,this.emit("abort",this[tp]?.reason),this.destroy(this[tp]?.reason)}get aborted(){return this[tc]}set aborted(t){}write(t,e,i){if(this[tc])return!1;if(this[U])throw Error("write after end");if(this[th])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[tu]?tb:tE;if(!this[tn]&&!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[tn]?(this[X]&&0!==this[ti]&&this[V](!0),this[X]?this.emit("data",t):this[ts](t)):t.length&&("string"==typeof t&&(e!==this[q]||this[K]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[q]&&(t=this[K].write(t)),this[X]&&0!==this[ti]&&this[V](!0),this[X]?this.emit("data",t):this[ts](t)),0!==this[ti]&&this.emit("readable"),i&&s(i),this[X]}read(t){if(this[th])return null;if(this[ty]=!1,0===this[ti]||0===t||t&&t>this[ti])return this[j](),null;this[tn]&&(t=null),this[tt].length>1&&!this[tn]&&(this[tt]=[this[q]?this[tt].join(""):Buffer.concat(this[tt],this[ti])]);let e=this[$](t||null,this[tt][0]);return this[j](),e}[$](t,e){if(this[tn])this[tr]();else{let i=e;t===i.length||null===t?this[tr]():("string"==typeof i?(this[tt][0]=i.slice(t),e=i.slice(0,t)):(this[tt][0]=i.subarray(t),e=i.subarray(0,t)),this[ti]-=t)}return this.emit("data",e),this[tt].length||this[U]||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[U]=!0,this.writable=!1,(this[X]||!this[Q])&&this[j](),this}[J](){this[th]||(this[tm]||this[te].length||(this[ty]=!0),this[Q]=!1,this[X]=!0,this.emit("resume"),this[tt].length?this[V]():this[U]?this[j]():this.emit("drain"))}resume(){return this[J]()}pause(){this[X]=!1,this[Q]=!0,this[ty]=!1}get destroyed(){return this[th]}get flowing(){return this[X]}get paused(){return this[Q]}[ts](t){this[tn]?this[ti]+=1:this[ti]+=t.length,this[tt].push(t)}[tr](){return this[tn]?this[ti]-=1:this[ti]-=this[tt][0].length,this[tt].shift()}[V](t=!1){do;while(this[Y](this[tr]())&&this[tt].length)t||this[tt].length||this[U]||this.emit("drain")}[Y](t){return this.emit("data",t),this[X]}pipe(t,e){if(this[th])return t;this[ty]=!1;let i=this[H];return e=e||{},t===M.stdout||t===M.stderr?e.end=!1:e.end=!1!==e.end,e.proxyErrors=!!e.proxyErrors,i?e.end&&t.end():(this[te].push(e.proxyErrors?new tw(this,t,e):new tg(this,t,e)),this[tu]?tb(()=>this[J]()):this[J]()),t}unpipe(t){let e=this[te].find(e=>e.dest===t);e&&(1===this[te].length?(this[X]&&0===this[tm]&&(this[X]=!1),this[te]=[]):this[te].splice(this[te].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[ty]=!1,this[tm]++,this[te].length||this[X]||this[J]();else if("readable"===t&&0!==this[ti])super.emit("readable");else("end"===t||"finish"===t||"prefinish"===t)&&this[H]?(super.emit(t),this.removeAllListeners(t)):"error"===t&&this[G]&&(this[tu]?tb(()=>e.call(this,this[G])):e.call(this,this[G]));return i}removeListener(t,e){return this.off(t,e)}off(t,e){let i=super.off(t,e);return"data"===t&&(this[tm]=this.listeners("data").length,0!==this[tm]||this[ty]||this[te].length||(this[X]=!1)),i}removeAllListeners(t){let e=super.removeAllListeners(t);return("data"===t||void 0===t)&&(this[tm]=0,this[ty]||this[te].length||(this[X]=!1)),e}get emittedEnd(){return this[H]}[j](){this[Z]||this[H]||this[th]||0!==this[tt].length||!this[U]||(this[Z]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[W]&&this.emit("close"),this[Z]=!1)}emit(t,...e){let i=e[0];if("error"!==t&&"close"!==t&&t!==th&&this[th])return!1;if("data"===t)return(!!this[tn]||!!i)&&(this[tu]?(tb(()=>this[ta](i)),!0):this[ta](i));if("end"===t)return this[tl]();if("close"===t){if(this[W]=!0,!this[H]&&!this[th])return!1;let t=super.emit("close");return this.removeAllListeners("close"),t}if("error"===t){this[G]=i,super.emit(to,i);let t=(!this[tp]||!!this.listeners("error").length)&&super.emit("error",i);return this[j](),t}if("resume"===t){let t=super.emit("resume");return this[j](),t}if("finish"===t||"prefinish"===t){let e=super.emit(t);return this.removeAllListeners(t),e}let s=super.emit(t,...e);return this[j](),s}[ta](t){for(let e of this[te])!1===e.dest.write(t)&&this.pause();let e=!this[ty]&&super.emit("data",t);return this[j](),e}[tl](){return!this[H]&&(this[H]=!0,this.readable=!1,this[tu]?(tb(()=>this[td]()),!0):this[td]())}[td](){if(this[K]){let t=this[K].end();if(t){for(let e of this[te])e.dest.write(t);this[ty]||super.emit("data",t)}}for(let t of this[te])t.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[tn]||(t.dataLength=0);let e=this.promise();return this.on("data",e=>{t.push(e),this[tn]||(t.dataLength+=e.length)}),await e,t}async concat(){if(this[tn])throw Error("cannot concat in objectMode");let t=await this.collect();return this[q]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(th,()=>e(Error("stream destroyed"))),this.on("error",t=>e(t)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[ty]=!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[U])return e();let s,r,n=t=>{this.off("data",h),this.off("end",o),this.off(th,a),e(),r(t)},h=t=>{this.off("error",n),this.off("end",o),this.off(th,a),this.pause(),s({value:t,done:!!this[U]})},o=()=>{this.off("error",n),this.off("data",h),this.off(th,a),e(),s({done:!0,value:void 0})},a=()=>n(Error("stream destroyed"));return new Promise((t,e)=>{r=e,s=t,this.once(th,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[ty]=!1;let t=!1,e=()=>(this.pause(),this.off(to,e),this.off(th,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(to,e),this.once(th,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){return this[th]||(this[th]=!0,this[ty]=!0,this[tt].length=0,this[ti]=0,"function"!=typeof this.close||this[W]||this.close()),t?this.emit("error",t):this.emit(th),this}static get isStream(){return F}},tv=S.default.writev,t_=Symbol("_autoClose"),tS=Symbol("_close"),tO=Symbol("_ended"),tT=Symbol("_fd"),tk=Symbol("_finished"),tL=Symbol("_flags"),tx=Symbol("_flush"),tA=Symbol("_handleChunk"),tN=Symbol("_makeBuf"),tD=Symbol("_mode"),tI=Symbol("_needDrain"),tC=Symbol("_onerror"),tB=Symbol("_onopen"),tM=Symbol("_onread"),tF=Symbol("_onwrite"),tP=Symbol("_open"),tz=Symbol("_path"),tU=Symbol("_pos"),tj=Symbol("_queue"),tH=Symbol("_read"),tZ=Symbol("_readSize"),tG=Symbol("_reading"),tW=Symbol("_remain"),t$=Symbol("_size"),tV=Symbol("_write"),tY=Symbol("_writing"),tq=Symbol("_defaultFlag"),tK=Symbol("_errored"),tX=class extends tR{[tK]=!1;[tT];[tz];[tZ];[tG]=!1;[t$];[tW];[t_];constructor(t,e){if(super(e=e||{}),this.readable=!0,this.writable=!1,"string"!=typeof t)throw TypeError("path must be a string");this[tK]=!1,this[tT]="number"==typeof e.fd?e.fd:void 0,this[tz]=t,this[tZ]=e.readSize||0x1000000,this[tG]=!1,this[t$]="number"==typeof e.size?e.size:1/0,this[tW]=this[t$],this[t_]="boolean"!=typeof e.autoClose||e.autoClose,"number"==typeof this[tT]?this[tH]():this[tP]()}get fd(){return this[tT]}get path(){return this[tz]}write(){throw TypeError("this is a readable stream")}end(){throw TypeError("this is a readable stream")}[tP](){S.default.open(this[tz],"r",(t,e)=>this[tB](t,e))}[tB](t,e){t?this[tC](t):(this[tT]=e,this.emit("open",e),this[tH]())}[tN](){return Buffer.allocUnsafe(Math.min(this[tZ],this[tW]))}[tH](){if(!this[tG]){this[tG]=!0;let t=this[tN]();if(0===t.length)return process.nextTick(()=>this[tM](null,0,t));S.default.read(this[tT],t,0,t.length,null,(t,e,i)=>this[tM](t,e,i))}}[tM](t,e,i){this[tG]=!1,t?this[tC](t):this[tA](e,i)&&this[tH]()}[tS](){if(this[t_]&&"number"==typeof this[tT]){let t=this[tT];this[tT]=void 0,S.default.close(t,t=>t?this.emit("error",t):this.emit("close"))}}[tC](t){this[tG]=!0,this[tS](),this.emit("error",t)}[tA](t,e){let i=!1;return this[tW]-=t,t>0&&(i=super.write(t<e.length?e.subarray(0,t):e)),(0===t||this[tW]<=0)&&(i=!1,this[tS](),super.end()),i}emit(t,...e){switch(t){case"prefinish":case"finish":return!1;case"drain":return"number"==typeof this[tT]&&this[tH](),!1;case"error":return!this[tK]&&(this[tK]=!0,super.emit(t,...e));default:return super.emit(t,...e)}}},tQ=class extends tX{[tP](){let t=!0;try{this[tB](null,S.default.openSync(this[tz],"r")),t=!1}finally{t&&this[tS]()}}[tH](){let t=!0;try{if(!this[tG]){for(this[tG]=!0;;){let t=this[tN](),e=0===t.length?0:S.default.readSync(this[tT],t,0,t.length,null);if(!this[tA](e,t))break}this[tG]=!1}t=!1}finally{t&&this[tS]()}}[tS](){if(this[t_]&&"number"==typeof this[tT]){let t=this[tT];this[tT]=void 0,S.default.closeSync(t),this.emit("close")}}},tJ=class extends _.default{readable=!1;writable=!0;[tK]=!1;[tY]=!1;[tO]=!1;[tj]=[];[tI]=!1;[tz];[tD];[t_];[tT];[tq];[tL];[tk]=!1;[tU];constructor(t,e){super(e=e||{}),this[tz]=t,this[tT]="number"==typeof e.fd?e.fd:void 0,this[tD]=void 0===e.mode?438:e.mode,this[tU]="number"==typeof e.start?e.start:void 0,this[t_]="boolean"!=typeof e.autoClose||e.autoClose;let i=void 0!==this[tU]?"r+":"w";this[tq]=void 0===e.flags,this[tL]=void 0===e.flags?i:e.flags,void 0===this[tT]&&this[tP]()}emit(t,...e){if("error"===t){if(this[tK])return!1;this[tK]=!0}return super.emit(t,...e)}get fd(){return this[tT]}get path(){return this[tz]}[tC](t){this[tS](),this[tY]=!0,this.emit("error",t)}[tP](){S.default.open(this[tz],this[tL],this[tD],(t,e)=>this[tB](t,e))}[tB](t,e){this[tq]&&"r+"===this[tL]&&t&&"ENOENT"===t.code?(this[tL]="w",this[tP]()):t?this[tC](t):(this[tT]=e,this.emit("open",e),this[tY]||this[tx]())}end(t,e){return t&&this.write(t,e),this[tO]=!0,this[tY]||this[tj].length||"number"!=typeof this[tT]||this[tF](null,0),this}write(t,e){return"string"==typeof t&&(t=Buffer.from(t,e)),this[tO]?(this.emit("error",Error("write() after end()")),!1):void 0===this[tT]||this[tY]||this[tj].length?(this[tj].push(t),this[tI]=!0,!1):(this[tY]=!0,this[tV](t),!0)}[tV](t){S.default.write(this[tT],t,0,t.length,this[tU],(t,e)=>this[tF](t,e))}[tF](t,e){t?this[tC](t):(void 0!==this[tU]&&"number"==typeof e&&(this[tU]+=e),this[tj].length?this[tx]():(this[tY]=!1,this[tO]&&!this[tk]?(this[tk]=!0,this[tS](),this.emit("finish")):this[tI]&&(this[tI]=!1,this.emit("drain"))))}[tx](){if(0===this[tj].length)this[tO]&&this[tF](null,0);else if(1===this[tj].length)this[tV](this[tj].pop());else{let t=this[tj];this[tj]=[],tv(this[tT],t,this[tU],(t,e)=>this[tF](t,e))}}[tS](){if(this[t_]&&"number"==typeof this[tT]){let t=this[tT];this[tT]=void 0,S.default.close(t,t=>t?this.emit("error",t):this.emit("close"))}}},t0=class extends tJ{[tP](){let t;if(this[tq]&&"r+"===this[tL])try{t=S.default.openSync(this[tz],this[tL],this[tD])}catch(t){if(t?.code==="ENOENT")return this[tL]="w",this[tP]();throw t}else t=S.default.openSync(this[tz],this[tL],this[tD]);this[tB](null,t)}[tS](){if(this[t_]&&"number"==typeof this[tT]){let t=this[tT];this[tT]=void 0,S.default.closeSync(t),this.emit("close")}}[tV](t){let e=!0;try{this[tF](null,S.default.writeSync(this[tT],t,0,t.length,this[tU])),e=!1}finally{if(e)try{this[tS]()}catch{}}}},t1=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"]]),t2=t=>t1.get(t)||t,t5=(t={})=>{if(!t)return{};let e={};for(let[i,s]of Object.entries(t))e[t2(i)]=s;return void 0===e.chmod&&!1===e.noChmod&&(e.chmod=!0),delete e.noChmod,e},t4=(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=t5(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}),t8=N.default.constants||{ZLIB_VERNUM:4736},t3=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},t8)),t6=A.Buffer.concat,t9=Object.getOwnPropertyDescriptor(A.Buffer,"concat"),t7=t=>t,et=t9?.writable===!0||t9?.set!==void 0?t=>{A.Buffer.concat=t?t7:t6}:t=>{},ee=Symbol("_superWrite"),ei=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"}},es=Symbol("flushFlag"),er=class extends tR{#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 N[e])throw TypeError("Compression method not supported: "+e);try{this.#n=new N[e](t)}catch(t){throw new ei(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 ei(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,x.default)(this.#n,"zlib binding closed"),this.#n.reset?.()}flush(t){this.ended||("number"!=typeof t&&(t=this.#r),this.write(Object.assign(A.Buffer.alloc(0),{[es]: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}[ee](t){return super.write(t)}write(t,e,i){let s,r;if("function"==typeof e&&(i=e,e="utf8"),"string"==typeof t&&(t=A.Buffer.from(t,e)),this.#t)return;(0,x.default)(this.#n,"zlib binding closed");let n=this.#n._handle,h=n.close;n.close=()=>{};let o=this.#n.close;this.#n.close=()=>{},et(!0);try{let e="number"==typeof t[es]?t[es]:this.#i;s=this.#n._processChunk(t,e),et(!1)}catch(t){et(!1),this.#h(new ei(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 ei(t,this.write))),s)if(Array.isArray(s)&&s.length>0){let t=s[0];r=this[ee](A.Buffer.from(t));for(let t=1;t<s.length;t++)r=this[ee](s[t])}else r=this[ee](A.Buffer.from(s));return i&&i(),r}},en=class extends er{#t;#e;constructor(t,e){(t=t||{}).flush=t.flush||t3.Z_NO_FLUSH,t.finishFlush=t.finishFlush||t3.Z_FINISH,t.fullFlushFlag=t3.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(t3.Z_SYNC_FLUSH),(0,x.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)}}}},eh=class extends en{#t;constructor(t){super(t,"Gzip"),this.#t=t&&!!t.portable}[ee](t){return this.#t&&(this.#t=!1,t[9]=255),super[ee](t)}},eo=class extends en{constructor(t){super(t,"Unzip")}},ea=class extends er{constructor(t,e){(t=t||{}).flush=t.flush||t3.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||t3.BROTLI_OPERATION_FINISH,t.fullFlushFlag=t3.BROTLI_OPERATION_FLUSH,super(t,e)}},el=class extends ea{constructor(t){super(t,"BrotliCompress")}},ed=class extends ea{constructor(t){super(t,"BrotliDecompress")}},eu=class extends er{constructor(t,e){(t=t||{}).flush=t.flush||t3.ZSTD_e_continue,t.finishFlush=t.finishFlush||t3.ZSTD_e_end,t.fullFlushFlag=t3.ZSTD_e_flush,super(t,e)}},ef=class extends eu{constructor(t){super(t,"ZstdCompress")}},ec=class extends eu{constructor(t){super(t,"ZstdDecompress")}},ep=t=>(255^t)&255,em=t=>(255^t)+1&255,ey={},eb={code:()=>ev,isCode:()=>eg,isName:()=>ew,name:()=>eR};for(var eE in eb)B(ey,eE,{get:eb[eE],enumerable:!0});var eg=t=>eR.has(t),ew=t=>ev.has(t),eR=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"]]),ev=new Map(Array.from(eR).map(t=>[t[1],t[0]])),e_=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??eO(t,e,100),this.mode=i?.mode??s?.mode??eL(t,e+100,8),this.uid=i?.uid??s?.uid??eL(t,e+108,8),this.gid=i?.gid??s?.gid??eL(t,e+116,8),this.size=i?.size??s?.size??eL(t,e+124,12),this.mtime=i?.mtime??s?.mtime??eT(t,e+136,12),this.cksum=eL(t,e+148,12),s&&this.#e(s,!0),i&&this.#e(i);let r=eO(t,e+156,1);if(eg(r)&&(this.#t=r||"0"),"0"===this.#t&&"/"===this.path.slice(-1)&&(this.#t="5"),"5"===this.#t&&(this.size=0),this.linkpath=eO(t,e+157,100),"ustar\x0000"===t.subarray(e+257,e+265).toString())if(this.uname=i?.uname??s?.uname??eO(t,e+265,32),this.gname=i?.gname??s?.gname??eO(t,e+297,32),this.devmaj=i?.devmaj??s?.devmaj??eL(t,e+329,8)??0,this.devmin=i?.devmin??s?.devmin??eL(t,e+337,8)??0,0!==t[e+475]){let i=eO(t,e+345,155);this.path=i+"/"+this.path}else{let r=eO(t,e+345,130);r&&(this.path=r+"/"+this.path),this.atime=i?.atime??s?.atime??eT(t,e+476,12),this.ctime=i?.ctime??s?.ctime??eT(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=eS(this.path||"",i),r=s[0],n=s[1];this.needPax=!!s[2],this.needPax=eF(t,e,100,r)||this.needPax,this.needPax=eN(t,e+100,8,this.mode)||this.needPax,this.needPax=eN(t,e+108,8,this.uid)||this.needPax,this.needPax=eN(t,e+116,8,this.gid)||this.needPax,this.needPax=eN(t,e+124,12,this.size)||this.needPax,this.needPax=eB(t,e+136,12,this.mtime)||this.needPax,t[e+156]=Number(this.#t.codePointAt(0)),this.needPax=eF(t,e+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",e+257,8),this.needPax=eF(t,e+265,32,this.uname)||this.needPax,this.needPax=eF(t,e+297,32,this.gname)||this.needPax,this.needPax=eN(t,e+329,8,this.devmaj)||this.needPax,this.needPax=eN(t,e+337,8,this.devmin)||this.needPax,this.needPax=eF(t,e+345,i,n)||this.needPax,0!==t[e+475]?this.needPax=eF(t,e+345,155,n)||this.needPax:(this.needPax=eF(t,e+345,130,n)||this.needPax,this.needPax=eB(t,e+476,12,this.atime)||this.needPax,this.needPax=eB(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,eN(t,e+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return"Unsupported"===this.#t?this.#t:eR.get(this.#t)}get typeKey(){return this.#t}set type(t){let e=String(ev.get(t));if(eg(e)||"Unsupported"===e)this.#t=e;else if(eg(t))this.#t=t;else throw TypeError("invalid entry type: "+t)}},eS=(t,e)=>{let i=t,s="",r,n=w.posix.parse(t).root||".";if(100>Buffer.byteLength(i))r=[i,s,!1];else{s=w.posix.dirname(i),i=w.posix.basename(i);do 100>=Buffer.byteLength(i)&&Buffer.byteLength(s)<=e?r=[i,s,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(s)<=e?r=[i.slice(0,99),s,!0]:(i=w.posix.join(w.posix.basename(s),i),s=w.posix.dirname(s));while(s!==n&&void 0===r)r||(r=[t.slice(0,99),"",!0])}return r},eO=(t,e,i)=>t.subarray(e,e+i).toString("utf8").replace(/\0.*/,""),eT=(t,e,i)=>ek(eL(t,e,i)),ek=t=>void 0===t?void 0:new Date(1e3*t),eL=(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=ep(h):0===h?n=h:(s=!0,n=em(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)):ex(t,e,i),ex=(t,e,i)=>{let s;return isNaN(s=parseInt(t.subarray(e,e+i).toString("utf8").replace(/\0.*$/,"").trim(),8))?void 0:s},eA={12:0x1ffffffff,8:2097151},eN=(t,e,i,s)=>void 0!==s&&(s>eA[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]=ep(r):0===r?e[s-1]=0:(i=!0,e[s-1]=em(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):(eD(t,e,i,s),!1)),eD=(t,e,i,s)=>t.write(eI(s,i),e,i,"ascii"),eI=(t,e)=>eC(Math.floor(t).toString(8),e),eC=(t,e)=>(t.length===e-1?t:Array(e-t.length-1).join("0")+t+" ")+"\0",eB=(t,e,i,s)=>void 0!==s&&eN(t,e,i,s.getTime()/1e3),eM=Array(156).join("\0"),eF=(t,e,i,s)=>void 0!==s&&(t.write(s+eM,e,i,"utf8"),s.length!==Buffer.byteLength(s)||s.length>i),eP=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 e=Buffer.byteLength(t),i=512*Math.ceil(1+e/512),s=Buffer.allocUnsafe(i);for(let t=0;t<512;t++)s[t]=0;new e_({path:("PaxHeader/"+(0,w.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:e,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(s),s.write(t,512,e,"utf8");for(let t=e+512;t<s.length;t++)s[t]=0;return s}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(void 0===this[t])return"";let e=this[t],i=" "+("dev"===t||"ino"===t||"nlink"===t?"SCHILY.":"")+t+"="+(e instanceof Date?e.getTime()/1e3:e)+`
|
|
2
|
+
`,s=Buffer.byteLength(i),r=Math.floor(Math.log(s)/Math.log(10))+1;return s+r>=Math.pow(10,r)&&(r+=1),r+s+i}static parse(e,i,s=!1){return new t(ez(eU(e),i),s)}},ez=(t,e)=>e?Object.assign({},e,t):t,eU=t=>t.replace(/\n$/,"").split(`
|
|
3
|
+
`).reduce(ej,Object.create(null)),ej=(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},eH="win32"!==(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)?t=>t:t=>t&&t.replaceAll(/\\/g,"/"),eZ=class extends tR{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=eH(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?eH(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=eH(t.path)),t.linkpath&&(t.linkpath=eH(t.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(t).filter(([t,i])=>!(null==i||"path"===t&&e))))}},eG=(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))},eW=Buffer.from([31,139]),e$=Buffer.from([40,181,47,253]),eV=Math.max(eW.length,e$.length),eY=Symbol("state"),eq=Symbol("writeEntry"),eK=Symbol("readEntry"),eX=Symbol("nextEntry"),eQ=Symbol("processEntry"),eJ=Symbol("extendedHeader"),e0=Symbol("globalExtendedHeader"),e1=Symbol("meta"),e2=Symbol("emitMeta"),e5=Symbol("buffer"),e4=Symbol("queue"),e8=Symbol("ended"),e3=Symbol("emittedEnd"),e6=Symbol("emit"),e9=Symbol("unzip"),e7=Symbol("consumeChunk"),it=Symbol("consumeChunkSub"),ie=Symbol("consumeBody"),ii=Symbol("consumeMeta"),is=Symbol("consumeHeader"),ir=Symbol("consuming"),ih=Symbol("bufferConcat"),io=Symbol("maybeEnd"),ia=Symbol("writing"),il=Symbol("aborted"),id=Symbol("onDone"),iu=Symbol("sawValidEntry"),ic=Symbol("sawNullBlock"),ip=Symbol("sawEOF"),im=Symbol("closeStream"),iy=()=>!0,ib=class extends _.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[e4]=[];[e5];[eK];[eq];[eY]="begin";[e1]="";[eJ];[e0];[e8]=!1;[e9];[il]=!1;[iu];[ic]=!1;[ip]=!1;[ia]=!1;[ir]=!1;[e3]=!1;constructor(t={}){super(),this.file=t.file||"",this.on(id,()=>{("begin"===this[eY]||!1===this[iu])&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),t.ondone?this.on(id,t.ondone):this.on(id,()=>{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:iy;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[im]()),"function"==typeof t.onwarn&&this.on("warn",t.onwarn),"function"==typeof t.onReadEntry&&this.on("entry",t.onReadEntry)}warn(t,e,i={}){eG(this,t,e,i)}[is](t,e){let i;void 0===this[iu]&&(this[iu]=!1);try{i=new e_(t,e,this[eJ],this[e0])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(i.nullBlock)this[ic]?(this[ip]=!0,"begin"===this[eY]&&(this[eY]="header"),this[e6]("eof")):(this[ic]=!0,this[e6]("nullBlock"));else if(this[ic]=!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[eq]=new eZ(i,this[eJ],this[e0]);if(!this[iu])if(t.remain){let e=()=>{t.invalid||(this[iu]=!0)};t.on("end",e)}else this[iu]=!0;t.meta?t.size>this.maxMetaEntrySize?(t.ignore=!0,this[e6]("ignoredEntry",t),this[eY]="ignore",t.resume()):t.size>0&&(this[e1]="",t.on("data",t=>this[e1]+=t),this[eY]="meta"):(this[eJ]=void 0,t.ignore=t.ignore||!this.filter(t.path,t),t.ignore?(this[e6]("ignoredEntry",t),this[eY]=t.remain?"ignore":"header",t.resume()):(t.remain?this[eY]="body":(this[eY]="header",t.end()),this[eK]?this[e4].push(t):(this[e4].push(t),this[eX]())))}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})}[im](){queueMicrotask(()=>this.emit("close"))}[eQ](t){let e=!0;if(t)if(Array.isArray(t)){let[e,...i]=t;this.emit(e,...i)}else this[eK]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",()=>this[eX]()),e=!1);else this[eK]=void 0,e=!1;return e}[eX](){do;while(this[eQ](this[e4].shift()))if(0===this[e4].length){let t=this[eK];!t||t.flowing||t.size===t.remain?this[ia]||this.emit("drain"):t.once("drain",()=>this.emit("drain"))}}[ie](t,e){let i=this[eq];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[eY]="header",this[eq]=void 0,i.end()),r.length}[ii](t,e){let i=this[eq],s=this[ie](t,e);return!this[eq]&&i&&this[e2](i),s}[e6](t,e,i){0!==this[e4].length||this[eK]?this[e4].push([t,e,i]):this.emit(t,e,i)}[e2](t){switch(this[e6]("meta",this[e1]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[eJ]=eP.parse(this[e1],this[eJ],!1);break;case"GlobalExtendedHeader":this[e0]=eP.parse(this[e1],this[e0],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[eJ]??Object.create(null);this[eJ]=t,t.path=this[e1].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[eJ]||Object.create(null);this[eJ]=t,t.linkpath=this[e1].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+t.type)}}abort(t){this[il]=!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[il])return i?.(),!1;if((void 0===this[e9]||void 0===this.brotli&&!1===this[e9])&&t){if(this[e5]&&(t=Buffer.concat([this[e5],t]),this[e5]=void 0),t.length<eV)return this[e5]=t,i?.(),!0;for(let e=0;void 0===this[e9]&&e<eW.length;e++)t[e]!==eW[e]&&(this[e9]=!1);let e=!1;if(!1===this[e9]&&!1!==this.zstd){e=!0;for(let i=0;i<e$.length;i++)if(t[i]!==e$[i]){e=!1;break}}let s=void 0===this.brotli&&!e;if(!1===this[e9]&&s)if(t.length<512)if(!this[e8])return this[e5]=t,i?.(),!0;else this.brotli=!0;else try{new e_(t.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(void 0===this[e9]||!1===this[e9]&&(this.brotli||e)){let s=this[e8];this[e8]=!1,this[e9]=void 0===this[e9]?new eo({}):e?new ec({}):new ed({}),this[e9].on("data",t=>this[e7](t)),this[e9].on("error",t=>this.abort(t)),this[e9].on("end",()=>{this[e8]=!0,this[e7]()}),this[ia]=!0;let r=!!this[e9][s?"end":"write"](t);return this[ia]=!1,i?.(),r}}this[ia]=!0,this[e9]?this[e9].write(t):this[e7](t),this[ia]=!1;let s=!(this[e4].length>0)&&(!this[eK]||this[eK].flowing);return s||0!==this[e4].length||this[eK]?.once("drain",()=>this.emit("drain")),i?.(),s}[ih](t){t&&!this[il]&&(this[e5]=this[e5]?Buffer.concat([this[e5],t]):t)}[io](){if(this[e8]&&!this[e3]&&!this[il]&&!this[ir]){this[e3]=!0;let t=this[eq];if(t&&t.blockRemain){let e=this[e5]?this[e5].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${e} available)`,{entry:t}),this[e5]&&t.write(this[e5]),t.end()}this[e6](id)}}[e7](t){if(this[ir]&&t)this[ih](t);else if(t||this[e5]){if(t){if(this[ir]=!0,this[e5]){this[ih](t);let e=this[e5];this[e5]=void 0,this[it](e)}else this[it](t);for(;this[e5]&&this[e5]?.length>=512&&!this[il]&&!this[ip];){let t=this[e5];this[e5]=void 0,this[it](t)}this[ir]=!1}}else this[io]();(!this[e5]||this[e8])&&this[io]()}[it](t){let e=0,i=t.length;for(;e+512<=i&&!this[il]&&!this[ip];)switch(this[eY]){case"begin":case"header":this[is](t,e),e+=512;break;case"ignore":case"body":e+=this[ie](t,e);break;case"meta":e+=this[ii](t,e);break;default:throw Error("invalid state: "+this[eY])}e<i&&(this[e5]=this[e5]?Buffer.concat([t.subarray(e),this[e5]]):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[il]||(this[e9]?(t&&this[e9].write(t),this[e9].end()):(this[e8]=!0,(void 0===this.brotli||void 0===this.zstd)&&(t=t||Buffer.alloc(0)),t&&this.write(t),this[io]())),this}},iE=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)},ig=(t,e)=>{let i=new Map(e.map(t=>[iE(t),!0])),s=t.filter,r=(t,e="")=>{let s=e||(0,L.parse)(t).root||".",n;if(t===s)n=!1;else{let e=i.get(t);n=void 0!==e?e:r((0,L.dirname)(t),s)}return i.set(t,n),n};t.filter=s?(t,e)=>s(t,e)&&r(iE(t)):t=>r(iE(t))},iw=t4(t=>{let e=new ib(t),i=t.file,s;try{s=R.default.openSync(i,"r");let r=R.default.fstatSync(s),n=t.maxReadSize||0x1000000;if(r.size<n){let t=Buffer.allocUnsafe(r.size),i=R.default.readSync(s,t,0,r.size,0);e.end(i===t.byteLength?t:t.subarray(0,i))}else{let t=0,i=Buffer.allocUnsafe(n);for(;t<r.size;){let r=R.default.readSync(s,i,0,n,t);if(0===r)break;t+=r,e.write(i.subarray(0,r))}e.end()}}finally{if("number"==typeof s)try{R.default.closeSync(s)}catch{}}},(t,e)=>{let i=new ib(t),s=t.maxReadSize||0x1000000,r=t.file;return new Promise((t,e)=>{i.on("error",e),i.on("end",t),R.default.stat(r,(t,n)=>{if(t)e(t);else{let t=new tX(r,{readSize:s,size:n.size});t.on("error",e),t.pipe(i)}})})},t=>new ib(t),t=>new ib(t),(t,e)=>{let i;e?.length&&ig(t,e),t.noResume||(i=t.onReadEntry,t.onReadEntry=i?t=>{i(t),t.resume()}:t=>t.resume())}),iR=(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:iv,parse:i_}=w.win32,iS=t=>{let e="",i=i_(t);for(;iv(t)||i.root;){let s="/"===t.charAt(0)&&"//?/"!==t.slice(0,4)?"/":i.root;t=t.slice(s.length),e+=s,i=i_(t)}return[e,t]},iO=["|","<",">","?",":"],iT=iO.map(t=>String.fromCodePoint(61440+Number(t.codePointAt(0)))),ik=new Map(iO.map((t,e)=>[t,iT[e]])),iL=new Map(iT.map((t,e)=>[t,iO[e]])),ix=t=>iO.reduce((t,e)=>t.split(e).join(ik.get(e)),t),iA=(t,e)=>e?(t=eH(t).replace(/^\.(\/|$)/,""),iE(e)+"/"+t):eH(t),iN=Symbol("process"),iD=Symbol("file"),iI=Symbol("directory"),iC=Symbol("symlink"),iB=Symbol("hardlink"),iM=Symbol("header"),iF=Symbol("read"),iP=Symbol("lstat"),iz=Symbol("onlstat"),iU=Symbol("onread"),ij=Symbol("onreadlink"),iH=Symbol("openfile"),iZ=Symbol("onopenfile"),iG=Symbol("close"),iW=Symbol("mode"),i$=Symbol("awaitDrain"),iV=Symbol("ondrain"),iY=Symbol("prefix"),iq=class extends tR{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=t5(e);super(),this.path=eH(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=eH(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?eH(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]=iS(this.path);t&&"string"==typeof e&&(this.path=e,s=t)}this.win32=!!i.win32||"win32"===process.platform,this.win32&&(this.path=(t=>iT.reduce((t,e)=>t.split(e).join(iL.get(e)),t))(this.path.replaceAll(/\\/g,"/")),t=t.replaceAll(/\\/g,"/")),this.absolute=eH(i.absolute||L.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[iz](r):this[iP]()}warn(t,e,i={}){return eG(this,t,e,i)}emit(t,...e){return"error"===t&&(this.#t=!0),super.emit(t,...e)}[iP](){S.default.lstat(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[iz](e)})}[iz](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=iQ(t),this.emit("stat",t),this[iN]()}[iN](){switch(this.type){case"File":return this[iD]();case"Directory":return this[iI]();case"SymbolicLink":return this[iC]();default:return this.end()}}[iW](t){return iR(t,"Directory"===this.type,this.portable)}[iY](t){return iA(t,this.prefix)}[iM](){if(!this.stat)throw Error("cannot write header before stat");"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new e_({path:this[iY](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[iY](this.linkpath):this.linkpath,mode:this[iW](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 eP({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[iY](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[iY](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)}[iI](){if(!this.stat)throw Error("cannot create directory entry without stat");"/"!==this.path.slice(-1)&&(this.path+="/"),this.stat.size=0,this[iM](),this.end()}[iC](){S.default.readlink(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[ij](e)})}[ij](t){this.linkpath=eH(t),this[iM](),this.end()}[iB](t){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=eH(L.default.relative(this.cwd,t)),this.stat.size=0,this[iM](),this.end()}[iD](){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[iB](e);this.linkCache.set(t,this.absolute)}if(this[iM](),0===this.stat.size)return this.end();this[iH]()}[iH](){S.default.open(this.absolute,"r",(t,e)=>{if(t)return this.emit("error",t);this[iZ](e)})}[iZ](t){if(this.fd=t,this.#t)return this[iG]();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[iF]()}[iF](){let{fd:t,buf:e,offset:i,length:s,pos:r}=this;if(void 0===t||void 0===e)throw Error("cannot read file without first opening");S.default.read(t,e,i,s,r,(t,e)=>{if(t)return this[iG](()=>this.emit("error",t));this[iU](e)})}[iG](t=()=>{}){void 0!==this.fd&&S.default.close(this.fd,t)}[iU](t){if(t<=0&&this.remain>0){let t=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[iG](()=>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[iG](()=>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[iV]():this[i$](()=>this[iV]())}[i$](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)}[iV](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[iG](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[iF]()}},iK=class extends iq{sync=!0;[iP](){this[iz](S.default.lstatSync(this.absolute))}[iC](){this[ij](S.default.readlinkSync(this.absolute))}[iH](){this[iZ](S.default.openSync(this.absolute,"r"))}[iF](){let t=!0;try{let{fd:e,buf:i,offset:s,length:r,pos:n}=this;if(void 0===e||void 0===i)throw Error("fd and buf must be set in READ method");let h=S.default.readSync(e,i,s,r,n);this[iU](h),t=!1}finally{if(t)try{this[iG](()=>{})}catch{}}}[i$](t){t()}[iG](t=()=>{}){void 0!==this.fd&&S.default.closeSync(this.fd),t()}},iX=class extends tR{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 eG(this,t,e,i)}constructor(t,e={}){let i=t5(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=eH(t.path),this.mode=void 0!==t.mode?this[iW](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?eH(t.linkpath):void 0,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[t,e]=iS(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 e_({path:this[iY](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[iY](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 eP({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[iY](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[iY](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)}[iY](t){return iA(t,this.prefix)}[iW](t){return iR(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}},iQ=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported",iJ=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 i0(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 i0(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 i0(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}},i0=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}},i1=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(t,e){this.path=t||"./",this.absolute=e}},i2=Buffer.alloc(1024),i5=Symbol("onStat"),i4=Symbol("ended"),i8=Symbol("queue"),i3=Symbol("current"),i6=Symbol("process"),i9=Symbol("processing"),i7=Symbol("processJob"),st=Symbol("jobs"),se=Symbol("jobDone"),si=Symbol("addFSEntry"),ss=Symbol("addTarEntry"),sr=Symbol("stat"),sn=Symbol("readdir"),sh=Symbol("onreaddir"),so=Symbol("pipe"),sa=Symbol("entry"),sl=Symbol("entryOpt"),sd=Symbol("writeEntryClass"),su=Symbol("write"),sf=Symbol("ondrain"),sc=class extends tR{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[sd];onWriteEntry;[i8];[st]=0;[i9]=!1;[i4]=!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=eH(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[sd]=iq,"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 eh(t.gzip)),t.brotli&&("object"!=typeof t.brotli&&(t.brotli={}),this.zip=new el(t.brotli)),t.zstd&&("object"!=typeof t.zstd&&(t.zstd={}),this.zip=new ef(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[sf]()),this.on("resume",()=>e.resume())}else this.on("drain",this[sf]);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[i8]=new iJ,this[st]=0,this.jobs=Number(t.jobs)||4,this[i9]=!1,this[i4]=!1}[su](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[i4]=!0,this[i6](),i&&i(),this}write(t){if(this[i4])throw Error("write after end");return t instanceof eZ?this[ss](t):this[si](t),this.flowing}[ss](t){let e=eH(L.default.resolve(this.cwd,t.path));if(this.filter(t.path,t)){let i=new i1(t.path,e);i.entry=new iX(t,this[sl](i)),i.entry.on("end",()=>this[se](i)),this[st]+=1,this[i8].push(i)}else t.resume();this[i6]()}[si](t){let e=eH(L.default.resolve(this.cwd,t));this[i8].push(new i1(t,e)),this[i6]()}[sr](t){t.pending=!0,this[st]+=1;let e=this.follow?"stat":"lstat";S.default[e](t.absolute,(e,i)=>{t.pending=!1,this[st]-=1,e?this.emit("error",e):this[i5](t,i)})}[i5](t,e){this.statCache.set(t.absolute,e),t.stat=e,this.filter(t.path,e)?e.isFile()&&e.nlink>1&&t===this[i3]&&!this.linkCache.get(`${e.dev}:${e.ino}`)&&!this.sync&&this[i7](t):t.ignore=!0,this[i6]()}[sn](t){t.pending=!0,this[st]+=1,S.default.readdir(t.absolute,(e,i)=>{if(t.pending=!1,this[st]-=1,e)return this.emit("error",e);this[sh](t,i)})}[sh](t,e){this.readdirCache.set(t.absolute,e),t.readdir=e,this[i6]()}[i6](){if(!this[i9]){this[i9]=!0;for(let t=this[i8].head;t&&this[st]<this.jobs;t=t.next)if(this[i7](t.value),t.value.ignore){let e=t.next;this[i8].removeNode(t),t.next=e}this[i9]=!1,this[i4]&&0===this[i8].length&&0===this[st]&&(this.zip?this.zip.end(i2):(super.write(i2),super.end()))}}get[i3](){return this[i8]&&this[i8].head&&this[i8].head.value}[se](t){this[i8].shift(),this[st]-=1,this[i6]()}[i7](t){if(!t.pending){if(t.entry){t!==this[i3]||t.piped||this[so](t);return}if(!t.stat){let e=this.statCache.get(t.absolute);e?this[i5](t,e):this[sr](t)}if(t.stat&&!t.ignore){if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){let e=this.readdirCache.get(t.absolute);if(e?this[sh](t,e):this[sn](t),!t.readdir)return}if(t.entry=this[sa](t),!t.entry){t.ignore=!0;return}t!==this[i3]||t.piped||this[so](t)}}}[sl](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}}[sa](t){this[st]+=1;try{return new this[sd](t.path,this[sl](t)).on("end",()=>this[se](t)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[sf](){this[i3]&&this[i3].entry&&this[i3].entry.resume()}[so](t){t.piped=!0,t.readdir&&t.readdir.forEach(e=>{let i=t.path,s="./"===i?"":i.replace(/\/*$/,"/");this[si](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={}){eG(this,t,e,i)}},sp=class extends sc{sync=!0;constructor(t){super(t),this[sd]=iK}pause(){}resume(){}[sr](t){let e=this.follow?"statSync":"lstatSync";this[i5](t,S.default[e](t.absolute))}[sn](t){this[sh](t,S.default.readdirSync(t.absolute))}[so](t){let e=t.entry,i=this.zip;if(t.readdir&&t.readdir.forEach(e=>{let i=t.path,s="./"===i?"":i.replace(/\/*$/,"/");this[si](s+e)}),!e)throw Error("Cannot pipe without source");i?e.on("data",t=>{i.write(t)}):e.on("data",t=>{super[su](t)})}},sm=(t,e)=>{e.forEach(e=>{"@"===e.charAt(0)?iw({file:w.default.resolve(t.cwd,e.slice(1)),sync:!0,noResume:!0,onReadEntry:e=>t.add(e)}):t.add(e)}),t.end()},sy=async(t,e)=>{for(let i of e)"@"===i.charAt(0)?await iw({file:w.default.resolve(String(t.cwd),i.slice(1)),noResume:!0,onReadEntry:e=>{t.add(e)}}):t.add(i);t.end()};t4((t,e)=>{let i=new sp(t),s=new t0(t.file,{mode:t.mode||438});i.pipe(s),sm(i,e)},(t,e)=>{let i=new sc(t),s=new tJ(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 sy(i,e).catch(t=>i.emit("error",t)),r},(t,e)=>{let i=new sp(t);return sm(i,e),i},(t,e)=>{let i=new sc(t);return sy(i,e).catch(t=>i.emit("error",t)),i},(t,e)=>{if(!e?.length)throw TypeError("no paths specified to add to archive")});var sb="win32"===(process.env.__FAKE_PLATFORM__||process.platform),{O_CREAT:sE,O_NOFOLLOW:sg,O_TRUNC:sw,O_WRONLY:sR}=S.default.constants,sv=Number(process.env.__FAKE_FS_O_FILENAME__)||S.default.constants.UV_FS_O_FILEMAP||0,s_=sv|sw|sE|sR,sS=sb||"number"!=typeof sg?null:sg|sw|sE|sR,sO=null!==sS?()=>sS:sb&&sv?t=>t<524288?s_:"w":()=>"w",sT=(t,e,i)=>{try{return R.default.lchownSync(t,e,i)}catch(t){if(t?.code!=="ENOENT")throw t}},sk=(t,e,i,s)=>{R.default.lchown(t,e,i,t=>{s(t&&t?.code!=="ENOENT"?t:null)})},sL=(t,e,i,s,r)=>{e.isDirectory()?sx(w.default.resolve(t,e.name),i,s,n=>{if(n)return r(n);sk(w.default.resolve(t,e.name),i,s,r)}):sk(w.default.resolve(t,e.name),i,s,r)},sx=(t,e,i,s)=>{R.default.readdir(t,{withFileTypes:!0},(r,n)=>{if(r){if("ENOENT"===r.code)return s();if("ENOTDIR"!==r.code&&"ENOTSUP"!==r.code)return s(r)}if(r||!n.length)return sk(t,e,i,s);let h=n.length,o=null,a=r=>{if(!o){if(r)return s(o=r);if(0==--h)return sk(t,e,i,s)}};for(let s of n)sL(t,s,e,i,a)})},sA=(t,e,i,s)=>{e.isDirectory()&&sN(w.default.resolve(t,e.name),i,s),sT(w.default.resolve(t,e.name),i,s)},sN=(t,e,i)=>{let s;try{s=R.default.readdirSync(t,{withFileTypes:!0})}catch(s){if(s?.code==="ENOENT")return;if(s?.code==="ENOTDIR"||s?.code==="ENOTSUP")return sT(t,e,i);throw s}for(let r of s)sA(t,r,e,i);return sT(t,e,i)},sD=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"}},sI=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"}},sC=(t,e,i,s,r,n,h)=>{if(0===e.length)return h(null,n);let o=e.shift(),a=eH(w.default.resolve(t+"/"+o));R.default.mkdir(a,i,sB(a,e,i,s,r,n,h))},sB=(t,e,i,s,r,n,h)=>o=>{o?R.default.lstat(t,(a,l)=>{if(a)a.path=a.path&&eH(a.path),h(a);else if(l.isDirectory())sC(t,e,i,s,r,n,h);else if(s)R.default.unlink(t,o=>{if(o)return h(o);R.default.mkdir(t,i,sB(t,e,i,s,r,n,h))});else{if(l.isSymbolicLink())return h(new sI(t,t+"/"+e.join("/")));h(o)}}):(n=n||t,sC(t,e,i,s,r,n,h))},sM=Object.create(null),sF=new Set,sP="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform),sz=class{#t=new Map;#e=new Map;#i=new Set;reserve(t,e){let i=new Set((t=sP?["win32 parallelization disabled"]:t.map(t=>iE((0,w.join)((t=>{sF.has(t)?sF.delete(t):sM[t]=t.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),sF.add(t);let e=sM[t],i=sF.size-1e4;if(i>1e3){for(let t of sF)if(sF.delete(t),delete sM[t],--i<=0)break}return e})(t))))).map(t=>t.split("/").slice(0,-1).reduce((t,e)=>{let i=t.at(-1);return void 0!==i&&(e=(0,w.join)(i,e)),t.push(e||"/"),t},[])).reduce((t,e)=>t.concat(e)));for(let s of(this.#e.set(e,{dirs:i,paths:t}),t)){let t=this.#t.get(s);t?t.push(e):this.#t.set(s,[e])}for(let t of i){let i=this.#t.get(t);if(i){let t=i.at(-1);t instanceof Set?t.add(e):i.push(new Set([e]))}else this.#t.set(t,[new Set([e])])}return this.#r(e)}#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}},sU=Symbol("onEntry"),sj=Symbol("checkFs"),sH=Symbol("checkFs2"),sZ=Symbol("isReusable"),sG=Symbol("makeFs"),sW=Symbol("file"),s$=Symbol("directory"),sV=Symbol("link"),sY=Symbol("symlink"),sq=Symbol("hardlink"),sK=Symbol("ensureNoSymlink"),sX=Symbol("unsupported"),sQ=Symbol("checkPath"),sJ=Symbol("stripAbsolutePath"),s0=Symbol("mkdir"),s1=Symbol("onError"),s2=Symbol("pending"),s5=Symbol("pend"),s4=Symbol("unpend"),s8=Symbol("ended"),s3=Symbol("maybeClose"),s6=Symbol("skip"),s9=Symbol("doChown"),s7=Symbol("uid"),rt=Symbol("gid"),re=Symbol("checkedCwd"),ri="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform),rs=(t,e,i)=>void 0!==t&&t===t>>>0?t:void 0!==e&&e===e>>>0?e:i,rr=class extends ib{[s8]=!1;[re]=!1;[s2]=0;reservations=new sz;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[s8]=!0,this[s3]()},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||ri,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=eH(w.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[sU](t))}warn(t,e,i={}){return("TAR_BAD_ARCHIVE"===t||"TAR_ABORT"===t)&&(i.recoverable=!1),super.warn(t,e,i)}[s3](){this[s8]&&0===this[s2]&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[sJ](t,e){let i=t[e],{type:s}=t;if(!i||this.preservePaths)return!0;let[r,n]=iS(i),h=n.replaceAll(/\\/g,"/").split("/");if(h.includes("..")||ri&&/^[a-z]:\.\.$/i.test(h[0]??"")){if("path"===e||"Link"===s)return this.warn("TAR_ENTRY_ERROR",`${e} contains '..'`,{entry:t,[e]:i}),!1;let r=w.default.posix.dirname(t.path),n=w.default.posix.normalize(w.default.posix.join(r,h.join("/")));if(n.startsWith("../")||".."===n)return this.warn("TAR_ENTRY_ERROR",`${e} escapes extraction directory`,{entry:t,[e]:i}),!1}return r&&(t[e]=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute ${e}`,{entry:t,[e]:i})),!0}[sQ](t){let e=eH(t.path),i=e.split("/");if(this.strip){if(i.length<this.strip)return!1;if("Link"===t.type){let e=eH(String(t.linkpath)).split("/");if(!(e.length>=this.strip))return!1;t.linkpath=e.slice(this.strip).join("/")}i.splice(0,this.strip),t.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:t,path:e,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[sJ](t,"path")||!this[sJ](t,"linkpath"))return!1;if(t.absolute=w.default.isAbsolute(t.path)?eH(w.default.resolve(t.path)):eH(w.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:eH(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:e}=w.default.win32.parse(String(t.absolute));t.absolute=e+ix(String(t.absolute).slice(e.length));let{root:i}=w.default.win32.parse(t.path);t.path=i+ix(t.path.slice(i.length))}return!0}[sU](t){if(!this[sQ](t))return t.resume();switch(D.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[sj](t);default:return this[sX](t)}}[s1](t,e){"CwdError"===t.name?this.emit("error",t):(this.warn("TAR_ENTRY_ERROR",t,{entry:e}),this[s4](),e.resume())}[s0](t,e,i){((t,e,i)=>{t=eH(t);let s=e.umask??18,r=448|e.mode,n=(r&s)!=0,h=e.uid,o=e.gid,a="number"==typeof h&&"number"==typeof o&&(h!==e.processUid||o!==e.processGid),l=e.preserve,d=e.unlink,u=eH(e.cwd),f=(e,s)=>{e?i(e):s&&a?sx(s,h,o,t=>f(t)):n?R.default.chmod(t,r,i):i()};if(t===u){var c;return c=t,R.default.stat(c,(t,e)=>{(t||!e.isDirectory())&&(t=new sD(c,t?.code||"ENOTDIR")),f(t)})}if(l)return C.default.mkdir(t,{mode:r,recursive:!0}).then(t=>f(null,t??void 0),f);let p=eH(w.default.relative(u,t)).split("/");sC(u,p,r,d,u,void 0,f)})(eH(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:e},i)}[s9](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}[s7](t){return rs(this.uid,t.uid,this.processUid)}[rt](t){return rs(this.gid,t.gid,this.processGid)}[sW](t,e){let i="number"==typeof t.mode?4095&t.mode:this.fmode,s=new tJ(String(t.absolute),{flags:sO(t.size),mode:i,autoClose:!1});s.on("error",i=>{s.fd&&R.default.close(s.fd,()=>{}),s.write=()=>!0,this[s1](i,t),e()});let r=1,n=i=>{if(i){s.fd&&R.default.close(s.fd,()=>{}),this[s1](i,t),e();return}0==--r&&void 0!==s.fd&&R.default.close(s.fd,i=>{i?this[s1](i,t):this[s4](),e()})};s.on("finish",()=>{let e=String(t.absolute),i=s.fd;if("number"==typeof i&&t.mtime&&!this.noMtime){r++;let s=t.atime||new Date,h=t.mtime;R.default.futimes(i,s,h,t=>t?R.default.utimes(e,s,h,e=>n(e&&t)):n())}if("number"==typeof i&&this[s9](t)){r++;let s=this[s7](t),h=this[rt](t);"number"==typeof s&&"number"==typeof h&&R.default.fchown(i,s,h,t=>t?R.default.chown(e,s,h,e=>n(e&&t)):n())}n()});let h=this.transform&&this.transform(t)||t;h!==t&&(h.on("error",i=>{this[s1](i,t),e()}),t.pipe(h)),h.pipe(s)}[s$](t,e){let i="number"==typeof t.mode?4095&t.mode:this.dmode;this[s0](String(t.absolute),i,i=>{if(i){this[s1](i,t),e();return}let s=1,r=()=>{0==--s&&(e(),this[s4](),t.resume())};t.mtime&&!this.noMtime&&(s++,R.default.utimes(String(t.absolute),t.atime||new Date,t.mtime,r)),this[s9](t)&&(s++,R.default.chown(String(t.absolute),Number(this[s7](t)),Number(this[rt](t)),r)),r()})}[sX](t){t.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t}),t.resume()}[sY](t,e){let i=eH(w.default.relative(this.cwd,w.default.resolve(w.default.dirname(String(t.absolute)),String(t.linkpath)))).split("/");this[sK](t,this.cwd,i,()=>this[sV](t,String(t.linkpath),"symlink",e),i=>{this[s1](i,t),e()})}[sq](t,e){let i=eH(w.default.resolve(this.cwd,String(t.linkpath))),s=eH(String(t.linkpath)).split("/");this[sK](t,this.cwd,s,()=>this[sV](t,i,"link",e),i=>{this[s1](i,t),e()})}[sK](t,e,i,s,r){let n=i.shift();if(this.preservePaths||void 0===n)return s();let h=w.default.resolve(e,n);R.default.lstat(h,(e,n)=>e?s():n?.isSymbolicLink()?r(new sI(h,w.default.resolve(h,i.join("/")))):void this[sK](t,h,i,s,r))}[s5](){this[s2]++}[s4](){this[s2]--,this[s3]()}[s6](t){this[s4](),t.resume()}[sZ](t,e){return"File"===t.type&&!this.unlink&&e.isFile()&&e.nlink<=1&&!ri}[sj](t){this[s5]();let e=[t.path];t.linkpath&&e.push(t.linkpath),this.reservations.reserve(e,e=>this[sH](t,e))}[sH](t,e){let i=t=>{e(t)},s=()=>{this[s0](this.cwd,this.dmode,e=>{if(e){this[s1](e,t),i();return}this[re]=!0,r()})},r=()=>{if(t.absolute!==this.cwd){let e=eH(w.default.dirname(String(t.absolute)));if(e!==this.cwd)return this[s0](e,this.dmode,e=>{if(e){this[s1](e,t),i();return}n()})}n()},n=()=>{R.default.lstat(String(t.absolute),(e,s)=>{if(s&&(this.keep||this.newer&&s.mtime>(t.mtime??s.mtime))){this[s6](t),i();return}if(e||this[sZ](t,s))return this[sG](null,t,i);if(s.isDirectory()){if("Directory"===t.type){let e=this.chmod&&t.mode&&(4095&s.mode)!==t.mode,r=e=>this[sG](e??null,t,i);return e?R.default.chmod(String(t.absolute),Number(t.mode),r):r()}if(t.absolute!==this.cwd)return R.default.rmdir(String(t.absolute),e=>this[sG](e??null,t,i))}if(t.absolute===this.cwd)return this[sG](null,t,i);((t,e)=>{if(!ri)return R.default.unlink(t,e);let i=t+".DELETE."+(0,I.randomBytes)(16).toString("hex");R.default.rename(t,i,t=>{if(t)return e(t);R.default.unlink(i,e)})})(String(t.absolute),e=>this[sG](e??null,t,i))})};this[re]?r():s()}[sG](t,e,i){if(t){this[s1](t,e),i();return}switch(e.type){case"File":case"OldFile":case"ContiguousFile":return this[sW](e,i);case"Link":return this[sq](e,i);case"SymbolicLink":return this[sY](e,i);case"Directory":case"GNUDumpDir":return this[s$](e,i)}}[sV](t,e,i,s){R.default[i](e,String(t.absolute),e=>{e?this[s1](e,t):(this[s4](),t.resume()),s()})}},rn=t=>{try{return[null,t()]}catch(t){return[t,null]}},rh=class extends rr{sync=!0;[sG](t,e){return super[sG](t,e,()=>{})}[sj](t){if(!this[re]){let e=this[s0](this.cwd,this.dmode);if(e)return this[s1](e,t);this[re]=!0}if(t.absolute!==this.cwd){let e=eH(w.default.dirname(String(t.absolute)));if(e!==this.cwd){let i=this[s0](e,this.dmode);if(i)return this[s1](i,t)}}let[e,i]=rn(()=>R.default.lstatSync(String(t.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(t.mtime??i.mtime)))return this[s6](t);if(e||this[sZ](t,i))return this[sG](null,t);if(i.isDirectory()){if("Directory"===t.type){let[e]=this.chmod&&t.mode&&(4095&i.mode)!==t.mode?rn(()=>{R.default.chmodSync(String(t.absolute),Number(t.mode))}):[];return this[sG](e,t)}let[e]=rn(()=>R.default.rmdirSync(String(t.absolute)));this[sG](e,t)}let[s]=t.absolute===this.cwd?[]:rn(()=>(t=>{if(!ri)return R.default.unlinkSync(t);let e=t+".DELETE."+(0,I.randomBytes)(16).toString("hex");R.default.renameSync(t,e),R.default.unlinkSync(e)})(String(t.absolute)));this[sG](s,t)}[sW](t,e){let i="number"==typeof t.mode?4095&t.mode:this.fmode,s=i=>{let s;try{R.default.closeSync(r)}catch(t){s=t}(i||s)&&this[s1](i||s,t),e()},r;try{r=R.default.openSync(String(t.absolute),sO(t.size),i)}catch(t){return s(t)}let n=this.transform&&this.transform(t)||t;n!==t&&(n.on("error",e=>this[s1](e,t)),t.pipe(n)),n.on("data",t=>{try{R.default.writeSync(r,t,0,t.length)}catch(t){s(t)}}),n.on("end",()=>{let e=null;if(t.mtime&&!this.noMtime){let i=t.atime||new Date,s=t.mtime;try{R.default.futimesSync(r,i,s)}catch(r){try{R.default.utimesSync(String(t.absolute),i,s)}catch{e=r}}}if(this[s9](t)){let i=this[s7](t),s=this[rt](t);try{R.default.fchownSync(r,Number(i),Number(s))}catch(r){try{R.default.chownSync(String(t.absolute),Number(i),Number(s))}catch{e=e||r}}}s(e)})}[s$](t,e){let i="number"==typeof t.mode?4095&t.mode:this.dmode,s=this[s0](String(t.absolute),i);if(s){this[s1](s,t),e();return}if(t.mtime&&!this.noMtime)try{R.default.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch{}if(this[s9](t))try{R.default.chownSync(String(t.absolute),Number(this[s7](t)),Number(this[rt](t)))}catch{}e(),t.resume()}[s0](t,e){try{return((t,e)=>{t=eH(t);let i=e.umask??18,s=448|e.mode,r=(s&i)!=0,n=e.uid,h=e.gid,o="number"==typeof n&&"number"==typeof h&&(n!==e.processUid||h!==e.processGid),a=e.preserve,l=e.unlink,d=eH(e.cwd),u=e=>{e&&o&&sN(e,n,h),r&&R.default.chmodSync(t,s)};if(t===d)return(t=>{let e=!1,i;try{e=R.default.statSync(t).isDirectory()}catch(t){i=t?.code}finally{if(!e)throw new sD(t,i??"ENOTDIR")}})(d),u();if(a)return u(R.default.mkdirSync(t,{mode:s,recursive:!0})??void 0);let f=eH(w.default.relative(d,t)).split("/"),c;for(let t=f.shift(),e=d;t&&(e+="/"+t);t=f.shift()){e=eH(w.default.resolve(e));try{R.default.mkdirSync(e,s),c=c||e}catch{let t=R.default.lstatSync(e);if(t.isDirectory())continue;if(l){R.default.unlinkSync(e),R.default.mkdirSync(e,s),c=c||e;continue}if(t.isSymbolicLink())return new sI(e,e+"/"+f.join("/"))}}return u(c)})(eH(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:e})}catch(t){return t}}[sK](t,e,i,s,r){if(this.preservePaths||0===i.length)return s();let n=e;for(let t of i){n=w.default.resolve(n,t);let[h,o]=rn(()=>R.default.lstatSync(n));if(h)return s();if(o.isSymbolicLink())return r(new sI(n,w.default.resolve(e,i.join("/"))))}s()}[sV](t,e,i,s){let r=`${i}Sync`;try{R.default[r](e,String(t.absolute)),s(),t.resume()}catch(e){return this[s1](e,t)}}},ro=t4(t=>{let e=new rh(t),i=t.file,s=R.default.statSync(i);new tQ(i,{readSize:t.maxReadSize||0x1000000,size:s.size}).pipe(e)},(t,e)=>{let i=new rr(t),s=t.maxReadSize||0x1000000,r=t.file;return new Promise((t,e)=>{i.on("error",e),i.on("close",t),R.default.stat(r,(t,n)=>{if(t)e(t);else{let t=new tX(r,{readSize:s,size:n.size});t.on("error",e),t.pipe(i)}})})},t=>new rh(t),t=>new rr(t),(t,e)=>{e?.length&&ig(t,e)}),ra=(t,e)=>{e.forEach(e=>{"@"===e.charAt(0)?iw({file:w.default.resolve(t.cwd,e.slice(1)),sync:!0,noResume:!0,onReadEntry:e=>t.add(e)}):t.add(e)}),t.end()},rl=async(t,e)=>{for(let i of e)"@"===i.charAt(0)?await iw({file:w.default.resolve(String(t.cwd),i.slice(1)),noResume:!0,onReadEntry:e=>t.add(e)}):t.add(i);t.end()},rd=t4((t,e)=>{let i=new sp(t),s=!0,r,n;try{var h,o,a,l,d;let u;try{r=R.default.openSync(t.file,"r+")}catch(e){if(e?.code==="ENOENT")r=R.default.openSync(t.file,"w+");else throw e}let f=R.default.fstatSync(r),c=Buffer.alloc(512);t:for(n=0;n<f.size;n+=512){for(let t=0,e=0;t<512;t+=e){if(e=R.default.readSync(r,c,t,c.length-t,n+t),0===n&&31===c[0]&&139===c[1])throw Error("cannot append to compressed archives");if(!e)break t}let e=new e_(c);if(!e.cksumValid)break;let i=512*Math.ceil((e.size||0)/512);if(n+i+512>f.size)break;n+=i,t.mtimeCache&&e.mtime&&t.mtimeCache.set(String(e.path),e.mtime)}s=!1,h=t,o=i,a=n,l=r,d=e,u=new t0(h.file,{fd:l,start:a}),o.pipe(u),ra(o,d)}finally{if(s)try{R.default.closeSync(r)}catch{}}},(t,e)=>{e=Array.from(e);let i=new sc(t);return new Promise((s,r)=>{i.on("error",r);let n="r+",h=(o,a)=>o&&"ENOENT"===o.code&&"r+"===n?(n="w+",R.default.open(t.file,n,h)):o||!a?r(o):void R.default.fstat(a,(n,h)=>{if(n)return R.default.close(a,()=>r(n));((e,i,s)=>{let r=(t,i)=>{t?R.default.close(e,e=>s(t)):s(null,i)},n=0;if(0===i)return r(null,0);let h=0,o=Buffer.alloc(512),a=(s,l)=>{if(s||void 0===l)return r(s);if((h+=l)<512&&l)return R.default.read(e,o,h,o.length-h,n+h,a);if(0===n&&31===o[0]&&139===o[1])return r(Error("cannot append to compressed archives"));if(h<512)return r(null,n);let d=new e_(o);if(!d.cksumValid)return r(null,n);let u=512*Math.ceil((d.size??0)/512);if(n+u+512>i||(n+=u+512)>=i)return r(null,n);t.mtimeCache&&d.mtime&&t.mtimeCache.set(String(d.path),d.mtime),h=0,R.default.read(e,o,0,512,n,a)};R.default.read(e,o,0,512,n,a)})(a,h.size,(n,h)=>{if(n)return r(n);let o=new tJ(t.file,{fd:a,start:h});i.pipe(o),o.on("error",r),o.on("close",s),rl(i,e)})});R.default.open(t.file,n,h)})},()=>{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")});t4(rd.syncFile,rd.asyncFile,rd.syncNoFile,rd.asyncNoFile,(t,e=[])=>{rd.validate?.(t,e),ru(t)});var ru=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 rf=/^tower-(backup|auto)-\d{8}-\d{6}\.tar\.gz$/;async function rc(t){let e=(0,w.join)((0,w.dirname)(t),`_meta_tmp_${Date.now()}`);try{(0,R.mkdirSync)(e,{recursive:!0}),await ro({file:t,cwd:e,filter:t=>"metadata.json"===t});let i=(0,w.join)(e,"metadata.json");if(!(0,R.existsSync)(i))return null;return JSON.parse((0,R.readFileSync)(i,"utf-8"))}catch{return null}finally{(0,R.rmSync)(e,{recursive:!0,force:!0})}}(0,w.join)("storage","assets");var rp=t.i(22569);async function rm(e){let i=(0,g.requireLocalhost)(e);if(i)return i;try{let i=(await e.formData()).get("file");if(!i)return E.NextResponse.json({error:"No file provided"},{status:400});try{var s=i.name;if(!rf.test(s))throw Error(`Invalid backup filename: ${s}`)}catch{return E.NextResponse.json({error:"Invalid backup filename"},{status:400})}let r=await (0,rp.getConfigValue)("system.backupDir","")||(0,v.getBackupsDir)();(0,R.mkdirSync)(r,{recursive:!0});let n=(0,w.join)(r,i.name);if((0,R.existsSync)(n))return E.NextResponse.json({error:"File already exists"},{status:409});let h=Buffer.from(await i.arrayBuffer());(0,R.writeFileSync)(n,h);let o=await rc(n);if(!o||!o.version){try{t.r(902157).unlinkSync(n)}catch{}return E.NextResponse.json({error:"Invalid backup archive"},{status:400})}return E.NextResponse.json({filename:i.name,metadata:o})}catch{return E.NextResponse.json({error:"Import failed"},{status:500})}}t.s(["POST",0,rm,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],119620);var ry=t.i(119620);let rb=new e.AppRouteRouteModule({definition:{kind:i.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:ry}),{workAsyncStorage:rE,workUnitAsyncStorage:rg,serverHooks:rw}=rb;async function rR(t,e,s){s.requestMeta&&(0,r.setRequestMeta)(t,s.requestMeta),rb.isDev&&(0,r.addRequestMeta)(t,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/internal/backup/import/route";E=E.replace(/\/index$/,"")||"/";let g=await rb.prepare(t,e,{srcPage:E,multiZoneDraftMode:!1});if(!g)return e.statusCode=400,e.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:w,params:R,nextConfig:v,parsedUrl:_,isDraftMode:S,prerenderManifest:O,routerServerContext:T,isOnDemandRevalidate:k,revalidateOnlyGenerated:L,resolvedPathname:x,clientReferenceManifest:A,serverActionsManifest:N}=g,D=(0,o.normalizeAppPath)(E),I=!!(O.dynamicRoutes[D]||O.routes[x]),C=async()=>((null==T?void 0:T.render404)?await T.render404(t,e,_,!1):e.end("This page could not be found"),null);if(I&&!S){let t=!!O.routes[x],e=O.dynamicRoutes[D];if(e&&!1===e.fallback&&!t){if(v.adapterPath)return await C();throw new y.NoFallbackError}}let B=null;!I||rb.isDev||S||(B="/index"===(B=x)?"/":B);let M=!0===rb.isDev||!I,F=I&&!M;N&&A&&(0,h.setManifestsSingleton)({page:E,clientReferenceManifest:A,serverActionsManifest:N});let P=t.method||"GET",z=(0,n.getTracer)(),U=z.getActiveScopeSpan(),j=!!(null==T?void 0:T.isWrappedByNextServer),H=!!(0,r.getRequestMeta)(t,"minimalMode"),Z=(0,r.getRequestMeta)(t,"incrementalCache")||await rb.getIncrementalCache(t,v,O,H);null==Z||Z.resetRequestCache(),globalThis.__incrementalCache=Z;let G={params:R,previewProps:O.preview,renderOpts:{experimental:{authInterrupts:!!v.experimental.authInterrupts},cacheComponents:!!v.cacheComponents,supportsDynamicResponse:M,incrementalCache:Z,cacheLifeProfiles:v.cacheLife,waitUntil:s.waitUntil,onClose:t=>{e.on("close",t)},onAfterTaskError:void 0,onInstrumentationRequestError:(e,i,s,r)=>rb.onRequestError(t,e,s,r,T)},sharedContext:{buildId:w}},W=new a.NodeNextRequest(t),$=new a.NodeNextResponse(e),V=l.NextRequestAdapter.fromNodeNextRequest(W,(0,l.signalFromNodeResponse)(e));try{let r,h=async t=>rb.handle(V,G).finally(()=>{if(!t)return;t.setAttributes({"http.status_code":e.statusCode,"next.rsc":!1});let i=z.getRootSpanAttributes();if(!i)return;if(i.get("next.span_type")!==d.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 s=i.get("next.route");if(s){let e=`${P} ${s}`;t.setAttributes({"next.route":s,"http.route":s,"next.span_name":e}),t.updateName(e),r&&r!==t&&(r.setAttribute("http.route",s),r.updateName(e))}else t.updateName(`${P} ${E}`)}),o=async r=>{var n,o;let a=async({previousCacheEntry:i})=>{try{if(!H&&k&&L&&!i)return e.statusCode=404,e.setHeader("x-nextjs-cache","REVALIDATED"),e.end("This page could not be found"),null;let n=await h(r);t.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let a=G.renderOpts.collectedTags;if(!I)return await (0,f.sendResponse)(W,$,n,G.renderOpts.pendingWaitUntil),null;{let t=await n.blob(),e=(0,c.toNodeOutgoingHttpHeaders)(n.headers);a&&(e[m.NEXT_CACHE_TAGS_HEADER]=a),!e["content-type"]&&t.type&&(e["content-type"]=t.type);let i=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,s=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:b.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await t.arrayBuffer()),headers:e},cacheControl:{revalidate:i,expire:s}}}}catch(e){throw(null==i?void 0:i.isStale)&&await rb.onRequestError(t,e,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:k})},!1,T),e}},l=await rb.handleResponse({req:t,nextConfig:v,cacheKey:B,routeKind:i.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:O,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:L,responseGenerator:a,waitUntil:s.waitUntil,isMinimalMode:H});if(!I)return null;if((null==l||null==(n=l.value)?void 0:n.kind)!==b.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(o=l.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});H||e.setHeader("x-nextjs-cache",k?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),S&&e.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,c.fromNodeOutgoingHttpHeaders)(l.value.headers);return H&&I||d.delete(m.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||e.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,p.getCacheControlHeader)(l.cacheControl)),await (0,f.sendResponse)(W,$,new Response(l.value.body,{headers:d,status:l.value.status||200})),null};j&&U?await o(U):(r=z.getActiveScopeSpan(),await z.withPropagatedContext(t.headers,()=>z.trace(d.BaseServerSpan.handleRequest,{spanName:`${P} ${E}`,kind:n.SpanKind.SERVER,attributes:{"http.method":P,"http.target":t.url}},o),void 0,!j))}catch(e){if(e instanceof y.NoFallbackError||await rb.onRequestError(t,e,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:k})},!1,T),I)throw e;return await (0,f.sendResponse)(W,$,new Response(null,{status:500})),null}}t.s(["handler",0,rR,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:rE,workUnitAsyncStorage:rg})},"routeModule",0,rb,"serverHooks",0,rw,"workAsyncStorage",0,rE,"workUnitAsyncStorage",0,rg],766434)}];
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=0se9_next_dist_esm_build_templates_app-route_09ikw5j.js.map
|
package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
module.exports=[617424,e=>{"use strict";var t=e.i(765876),n=e.i(675896),s=e.i(959160),
|
|
1
|
+
module.exports=[617424,e=>{"use strict";var t=e.i(765876),n=e.i(675896),s=e.i(959160),o=e.i(97944),a=e.i(86757),r=e.i(204144),i=e.i(273436),l=e.i(743641),u=e.i(813766),d=e.i(840884),c=e.i(498814),p=e.i(780006),m=e.i(544432),h=e.i(772005),f=e.i(450223),g=e.i(193695);e.i(628400);var y=e.i(800071),w=e.i(198840),C=e.i(902157),v=e.i(750227),R=e.i(634712),_=e.i(341291),E=e.i(472129),$=e.i(769310),T=e.i(843793),b=e.i(173215),A=e.i(572173);let x=new E.ClaudeCliAdapter;function k(e){let t,n;console.error(`[${(t=new Date,n=e=>String(e).padStart(2,"0"),`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`)}] [assistant-chat] ${e}`)}class I extends Error{constructor(e){super(e),this.name="ResumeRetryNeeded"}}class S extends Error{constructor(e){super(e),this.name="ToolsUnavailableRetry"}}class N extends Error{constructor(e){super(e),this.name="ModelUnavailableRetry"}}let O="sonnet";function P(e){return/may not exist or you may not have access|selected model|model[_ ]?not[_ ]?found|unknown model|invalid model|model .*(not available|not found|does not exist)/i.test(e)}async function M(t){let n,s=(0,w.requireLocalhost)(t);if(s)return s;try{n=await t.json()}catch{return new Response(JSON.stringify({error:"Invalid JSON body"}),{status:400,headers:{"Content-Type":"application/json"}})}let o=Array.isArray(n.attachmentFilenames)?n.attachmentFilenames.filter(e=>"string"==typeof e&&R.ATTACHMENT_SUBPATH_RE.test(e)).slice(0,R.MAX_ATTACHMENTS):[];if(!n.message?.trim()&&0===o.length)return new Response(JSON.stringify({error:"Message or attachments required"}),{status:400,headers:{"Content-Type":"application/json"}});let a=!1,r=new AbortController,i=new ReadableStream({async start(t){let s=new TextEncoder;function i(e){if(!a)try{t.enqueue(s.encode(`data: ${JSON.stringify(e)}
|
|
2
2
|
|
|
3
|
-
`))}catch{
|
|
3
|
+
`))}catch{a=!0}}let l="",u="",d="";try{let t,{query:s}=await e.A(145135);l=x.resolveCommand(),u=(0,$.resolveSdkExecutable)(l),k(`claude exec — raw=${l} resolved=${u}`);let{ensureTowerDir:a}=await e.A(979764),c=a(),p=o.length>0,m=(0,b.buildTowerMcpConfig)(),h=`${m.name}-assistant`,f={mcpServers:{[h]:{command:m.command,args:m.args,env:m.env}},strictMcpConfig:!0,tools:["Read"],allowedTools:[`mcp__${h}__*`,"Read"],permissionMode:"bypassPermissions",allowDangerouslySkipPermissions:!0,includePartialMessages:!0,cwd:c,pathToClaudeCodeExecutable:u},g=await (0,A.readConfigValue)("assistant.effort","low"),y=await (0,A.readConfigValue)("assistant.maxTurns",30);f.effort=g,f.maxTurns=y;let w=await (0,A.readConfigValue)("assistant.maxOutputTokens",128e3);f.env={...process.env,CLAUDE_CODE_MAX_OUTPUT_TOKENS:String(w)};let E=(await (0,A.readConfigValue)("assistant.model","sonnet")).trim();n.sessionId&&(f.resume=n.sessionId);let M="";if(!n.sessionId){let e=await T.db.systemConfig.findUnique({where:{key:"onboarding.username"}});try{let t=e?JSON.parse(e.value):null;"string"==typeof t&&t.length>0&&(M=`[Context: The user's name is ${t}.]
|
|
4
4
|
|
|
5
|
-
`)}catch{}}let
|
|
5
|
+
`)}catch{}}let U=(t=[],(n.workspaceId&&t.push(`工作区「${n.workspaceName??n.workspaceId}」(id=${n.workspaceId})`),n.projectId&&t.push(`项目「${n.projectName??n.projectId}」(id=${n.projectId})`),0===t.length)?"":`[当前会话默认范围:${t.join("|")}。需要范围的操作默认用它;日报/跨区搜索/列所有工作区等全局请求忽略它。用户明确切换才变。]
|
|
6
|
+
|
|
7
|
+
`),H=0,q=!1,D=-1,j=e=>{let t,a,i={...f};e||delete i.resume,E?(i.model=E,d=E):(delete i.model,d="(CLI 默认)"),i.abortController=r;let l=!!n.sessionId&&e;return s({prompt:(t=l?`[沿用 tower skill 约定:新建/改任务的 description 用 Markdown 模板 ## 目标 / ## 需求 / ## 参考 / ## 备注 / ## 来源(末节 ## 来源 必带,无来源写「无」);查询结果按 skill 的 Display Templates 输出。]
|
|
8
|
+
|
|
9
|
+
`:"/tower ",a=`${M}${U}${t}${n.message}`,p?function(e,t,n){if(0===t.length)return e;let s=t.slice(0,R.MAX_ATTACHMENTS),o=v.resolve(n),a=[];for(let e of s){if(!R.ATTACHMENT_SUBPATH_RE.test(e))continue;let t=(0,R.classifyAttachmentSubPath)(e);if(!t)continue;let s=v.resolve(n,e);s.startsWith(o+v.sep)&&C.existsSync(s)&&a.push({kind:t,absPath:s})}if(0===a.length)return e;let r=a.map(e=>`- [${"image"===e.kind?"Image":"Text"}] ${e.absPath}`).join("\n");return`${e}
|
|
6
10
|
|
|
7
11
|
---
|
|
8
12
|
The user has attached the following file(s). Use the Read tool to view them:
|
|
9
|
-
${r}`}(
|
|
10
|
-
${n.stack}`:""}`);let t=/\bspawn\b|ENOENT|EINVAL/i.test(e);i({type:"error",content:/output token maximum|max_output_tokens/i.test(e)?"回复内容超出了模型单次输出上限。请把问题拆小一些,或在设置里把 assistant.maxOutputTokens 调整为所用模型支持的上限(Sonnet/Haiku 最高 64K,Opus 最高 128K)。":P(e)?`助手所用模型不可用(${d||"?"}):该模型可能不存在,或当前账号 / Claude 登录无权访问它。助手用哪个模型由配置项 assistant.model 决定(默认 sonnet);留空则继承 Claude CLI 的默认模型(受 ANTHROPIC_MODEL 环境变量或 ~/.claude 设置里的 model 影响)。请把 assistant.model 设为账号有权限的模型(如 sonnet / opus / haiku),或修正 Claude CLI 的默认模型。原始错误:${e}`:t?`无法启动 Claude CLI(raw=${l||"?"} resolved=${u||"?"})。请确认本机已安装 Claude Code 且能在命令行执行 \`claude --version\`;若已安装但仍失败,可设置环境变量 CLAUDE_CODE_PATH 指向 claude 的 cli.js。原始错误:${e}`:`Assistant encountered an error: ${e}`})}finally{i({type:"done"}),
|
|
13
|
+
${r}`}(a,o,(0,_.getAssistantCacheRoot)()):a),options:i})},L=!1,F=!1,K=async(e,{isResumeAttempt:t})=>{for await(let r of e)switch(r.type){case"assistant":{let e=r.message.content.filter(e=>"text"===e.type).map(e=>e.text??"").join(""),t=r.message.content.filter(e=>"tool_use"===e.type);for(let n of(e&&(q=!0,i({type:"text",content:e,sessionId:r.session_id})),t))H+=1,q=!0,k(`tool_use — name=${n.name??"?"} id=${n.id??"?"} toolUses=${H}`),i({type:"tool_use",content:n.name??"unknown",toolId:n.id,toolInput:n.input,sessionId:r.session_id});break}case"result":{var s,o,a;k(`turn done — subtype=${r.subtype??"?"} toolUses=${H} numTurns=${r.num_turns??"?"} outputTokens=${r.usage?.output_tokens??"?"} firstTurn=${!n.sessionId}`);let e=(s=r.subtype,o=r.is_error,s?.includes("error")||o?"error":"success");if((a={isResumeAttempt:t,outcome:e,streamedContent:q}).isResumeAttempt&&"error"===a.outcome&&!a.streamedContent)throw new I(r.error??"resume execution error");if("error"===e){let e=r.error??"";if(!q&&!F&&d!==O&&P(e))throw new N(e);i({type:"error",content:r.error??"Execution error"})}else if(!q){let e=0===D?"助手工具未能及时加载(MCP 连接超时),本轮没有执行任何操作。请再发送一次试试。":"助手本轮没有返回内容,请重试或换一种说法。";i({type:"text",content:e,sessionId:r.session_id})}i({type:"done",sessionId:r.session_id});break}case"system":if("init"===r.subtype){let e=(r.mcp_servers??[]).map(e=>`${e.name}:${e.status}`).join(",");if(D=r.tools?.length??0,k(`session init — mcpServers=[${e}] toolCount=${D}`),0===D&&!L)throw new S(`MCP not connected at init (servers=[${e}])`)}"tool_result"===r.subtype&&(k(`tool_result(system) — name=${r.tool_name??"?"}`),i({type:"tool_result",content:r.tool_name??"tool",toolOutput:r.content??""}));break;case"user":{let e=(r.message?.content??[]).filter(e=>e?.type==="tool_result");e.length>0&&k(`tool_result(user) — count=${e.length} ids=${e.map(e=>e.tool_use_id??"?").join(",")}`);break}case"stream_event":{let e=r.event;"content_block_delta"===e.type&&e.delta?.type==="text_delta"&&e.delta.text?(q=!0,i({type:"text_delta",content:e.delta.text,sessionId:r.session_id})):"content_block_start"===e.type&&e.content_block?.type==="tool_use"&&i({type:"tool_start",content:e.content_block.name??"tool",toolId:e.content_block.id,sessionId:r.session_id})}}},B=!!n.sessionId,V=!1;for(;;)try{H=0,q=!1,D=-1,await K(j(B),{isResumeAttempt:B});break}catch(t){if(r.abort(),r=new AbortController,t instanceof S&&!L){L=!0,k(`${t.message}; re-spawning once to reconnect MCP`);continue}let e=t instanceof Error?t.message:String(t);if(!F&&d!==O&&(t instanceof N||P(e))){F=!0,E=O,k(`model ${d} unavailable (${e}); retrying with fallback model ${O}`);continue}if((t instanceof I||B&&/no conversation found|no session found|session id/i.test(e))&&!V){V=!0,B=!1,k(`resume failed for sessionId=${n.sessionId} (${e}); retrying as a fresh session`);continue}throw t}}catch(n){if(a||r.signal.aborted)return void k("client disconnected — turn aborted before completion");let e=n instanceof Error?n.message:String(n);k(`ERROR: ${e}${n instanceof Error&&n.stack?`
|
|
14
|
+
${n.stack}`:""}`);let t=/\bspawn\b|ENOENT|EINVAL/i.test(e);i({type:"error",content:/output token maximum|max_output_tokens/i.test(e)?"回复内容超出了模型单次输出上限。请把问题拆小一些,或在设置里把 assistant.maxOutputTokens 调整为所用模型支持的上限(Sonnet/Haiku 最高 64K,Opus 最高 128K)。":P(e)?`助手所用模型不可用(${d||"?"}):该模型可能不存在,或当前账号 / Claude 登录无权访问它。助手用哪个模型由配置项 assistant.model 决定(默认 sonnet);留空则继承 Claude CLI 的默认模型(受 ANTHROPIC_MODEL 环境变量或 ~/.claude 设置里的 model 影响)。请把 assistant.model 设为账号有权限的模型(如 sonnet / opus / haiku),或修正 Claude CLI 的默认模型。原始错误:${e}`:t?`无法启动 Claude CLI(raw=${l||"?"} resolved=${u||"?"})。请确认本机已安装 Claude Code 且能在命令行执行 \`claude --version\`;若已安装但仍失败,可设置环境变量 CLAUDE_CODE_PATH 指向 claude 的 cli.js。原始错误:${e}`:`Assistant encountered an error: ${e}`})}finally{i({type:"done"}),a=!0;try{t.close()}catch{}}},cancel(){a=!0,r.abort()}});return new Response(i,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}e.s(["POST",0,M,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],323612);var U=e.i(323612);let H=new t.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/internal/assistant/chat/route",pathname:"/api/internal/assistant/chat",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/internal/assistant/chat/route.ts",nextConfigOutput:"standalone",userland:U}),{workAsyncStorage:q,workUnitAsyncStorage:D,serverHooks:j}=H;async function L(e,t,s){s.requestMeta&&(0,o.setRequestMeta)(e,s.requestMeta),H.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/internal/assistant/chat/route";w=w.replace(/\/index$/,"")||"/";let C=await H.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:v,params:R,nextConfig:_,parsedUrl:E,isDraftMode:$,prerenderManifest:T,routerServerContext:b,isOnDemandRevalidate:A,revalidateOnlyGenerated:x,resolvedPathname:k,clientReferenceManifest:I,serverActionsManifest:S}=C,N=(0,i.normalizeAppPath)(w),O=!!(T.dynamicRoutes[N]||T.routes[k]),P=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,E,!1):t.end("This page could not be found"),null);if(O&&!$){let e=!!T.routes[k],t=T.dynamicRoutes[N];if(t&&!1===t.fallback&&!e){if(_.adapterPath)return await P();throw new g.NoFallbackError}}let M=null;!O||H.isDev||$||(M="/index"===(M=k)?"/":M);let U=!0===H.isDev||!O,q=O&&!U;S&&I&&(0,r.setManifestsSingleton)({page:w,clientReferenceManifest:I,serverActionsManifest:S});let D=e.method||"GET",j=(0,a.getTracer)(),L=j.getActiveScopeSpan(),F=!!(null==b?void 0:b.isWrappedByNextServer),K=!!(0,o.getRequestMeta)(e,"minimalMode"),B=(0,o.getRequestMeta)(e,"incrementalCache")||await H.getIncrementalCache(e,_,T,K);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let V={params:R,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!_.experimental.authInterrupts},cacheComponents:!!_.cacheComponents,supportsDynamicResponse:U,incrementalCache:B,cacheLifeProfiles:_.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,n,s,o)=>H.onRequestError(e,t,s,o,b)},sharedContext:{buildId:v}},X=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t));try{let o,r=async e=>H.handle(W,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let n=j.getRootSpanAttributes();if(!n)return;if(n.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${n.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=n.get("next.route");if(s){let t=`${D} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),o&&o!==e&&(o.setAttribute("http.route",s),o.updateName(t))}else e.updateName(`${D} ${w}`)}),i=async o=>{var a,i;let l=async({previousCacheEntry:n})=>{try{if(!K&&A&&x&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await r(o);e.fetchMetrics=V.renderOpts.fetchMetrics;let i=V.renderOpts.pendingWaitUntil;i&&s.waitUntil&&(s.waitUntil(i),i=void 0);let l=V.renderOpts.collectedTags;if(!O)return await (0,p.sendResponse)(X,J,a,V.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let n=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,s=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:n,expire:s}}}}catch(t){throw(null==n?void 0:n.isStale)&&await H.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:A})},!1,b),t}},u=await H.handleResponse({req:e,nextConfig:_,cacheKey:M,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:x,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:K});if(!O)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(i=u.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",A?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),$&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,m.fromNodeOutgoingHttpHeaders)(u.value.headers);return K&&O||d.delete(f.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,h.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(X,J,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};F&&L?await i(L):(o=j.getActiveScopeSpan(),await j.withPropagatedContext(e.headers,()=>j.trace(d.BaseServerSpan.handleRequest,{spanName:`${D} ${w}`,kind:a.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},i),void 0,!F))}catch(t){if(t instanceof g.NoFallbackError||await H.onRequestError(e,t,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:A})},!1,b),O)throw t;return await (0,p.sendResponse)(X,J,new Response(null,{status:500})),null}}e.s(["handler",0,L,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:q,workUnitAsyncStorage:D})},"routeModule",0,H,"serverHooks",0,j,"workAsyncStorage",0,q,"workUnitAsyncStorage",0,D],617424)}];
|
|
11
15
|
|
|
12
16
|
//# sourceMappingURL=0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js.map
|
package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[901814,e=>{"use strict";var t=e.i(765876),r=e.i(675896),a=e.i(959160),n=e.i(97944),i=e.i(86757),s=e.i(204144),o=e.i(273436),l=e.i(743641),c=e.i(813766),u=e.i(840884),d=e.i(498814),p=e.i(780006),h=e.i(544432),g=e.i(772005),f=e.i(450223),m=e.i(193695);e.i(628400);var R=e.i(800071),w=e.i(855104),E=e.i(78091),v=e.i(843793),y=e.i(233405),x=e.i(195158),b=e.i(678272),S=e.i(248434),k=e.i(522734),C=e.i(814747);let A="tower-merge-temp";function N(e){let t=(e?.stderr??"").toString().trim(),r=(e?.stdout??"").toString().trim();return t||r||e?.message?.trim()||"unknown git error"}async function P(t,{params:r}){let{taskId:a}=await r,n=E.z.string().cuid().safeParse(a);if(!n.success)return w.NextResponse.json({error:"Invalid task ID"},{status:400});try{let t,r=await v.db.task.findUnique({where:{id:n.data},include:{project:!0}});if(!r)return w.NextResponse.json({error:"Task not found"},{status:404});if("IN_REVIEW"!==r.status)return w.NextResponse.json({error:"Task must be in IN_REVIEW status to merge"},{status:400});if(!r.baseBranch)return w.NextResponse.json({error:"Task has no base branch configured"},{status:400});if(!r.project?.localPath)return w.NextResponse.json({error:"Project has no local path"},{status:400});let i=await v.db.taskExecution.findFirst({where:{taskId:n.data,status:"COMPLETED"},orderBy:{createdAt:"desc"}}),s=i?.worktreeBranch??`task/${a}`,o=r.project.localPath,{hasConflicts:l,conflictFiles:c}=(0,b.checkConflicts)(o,r.baseBranch,s);if(l)return w.NextResponse.json({error:"Merge conflicts detected",conflictFiles:c},{status:409});try{t=(0,y.execFileSync)("git",["rev-parse",s],{encoding:"utf-8",timeout:3e4,cwd:o}).trim()}catch{}let{commitHash:u}=function({localPath:e,baseBranch:t,worktreeBranch:r,timeoutMs:a=3e4}){let n,i={encoding:"utf-8",timeout:a,cwd:e},s=(0,y.execFileSync)("git",["rev-parse","--abbrev-ref","HEAD"],i).trim(),o=s!==t,l=(0,y.execFileSync)("git",["status","--porcelain"],i).trim().split("\n").some(e=>""!==e.trim()&&!e.startsWith("??")),c=!1;if(l){let t=function(e){try{return(0,y.execFileSync)("git",["rev-parse","--absolute-git-dir"],{cwd:e,encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}catch{return C.default.join(e,".git")}}(e),r=C.default.join(t,"index.lock");if((0,k.existsSync)(r))throw Error(`主仓库存在 Git 锁文件(${r}),可能有其他 git 进程正在运行,或上次 git 操作异常退出残留。请确认没有正在进行的 git 操作后,删除该 lock 文件再重试。`);if((0,k.existsSync)(C.default.join(t,"MERGE_HEAD")))throw Error(`主仓库正处于未完成的合并状态(存在 MERGE_HEAD)。请先在 ${e} 执行 git merge --abort 或完成当前合并后再重试。`);if((0,k.existsSync)(C.default.join(t,"rebase-merge"))||(0,k.existsSync)(C.default.join(t,"rebase-apply")))throw Error(`主仓库正处于未完成的 rebase 状态。请先在 ${e} 执行 git rebase --abort 或完成当前 rebase 后再重试。`);try{!function(e,t,r=3e4){try{(0,y.execFileSync)("git",e,{cwd:t,encoding:"utf-8",timeout:r,stdio:["pipe","pipe","pipe"]}).trim()}catch(e){throw Error(N(e))}}(["stash","push","-m",A],e,a)}catch(t){throw Error(`暂存主仓库工作区改动失败(git stash push):${N(t)}。请在 ${e} 执行 git status / git stash list 检查工作区状态后重试。`)}c=(0,y.execFileSync)("git",["stash","list"],i).includes(A)}try{o&&(0,y.execFileSync)("git",["checkout",t],i),(0,y.execFileSync)("git",["merge",r,"--no-edit"],i),n=(0,y.execFileSync)("git",["rev-parse","--short","HEAD"],i).trim()}finally{if(o)try{(0,y.execFileSync)("git",["checkout",s],i)}catch(e){console.error("[merge] Restore original branch failed (non-fatal):",e instanceof Error?e.message:String(e))}if(c)try{(0,y.execFileSync)("git",["stash","pop"],i)}catch(e){console.error("[merge] Stash pop after merge failed (non-fatal):",e instanceof Error?e.message:String(e))}}return{commitHash:n}}({localPath:o,baseBranch:r.baseBranch,worktreeBranch:s});if(i&&u)try{await v.db.taskExecution.update({where:{id:i.id},data:{mergeCommit:u,...t?{branchTipCommit:t}:{}}})}catch{}await v.db.task.update({where:{id:n.data},data:{status:"DONE",doneAt:new Date}});try{let{destroySession:t}=await e.A(217260);t(a)}catch(e){console.error("[merge] PTY session destroy failed:",e)}try{let{captureTaskOverview:t}=await e.A(884996);await t(a)}catch(e){console.error("[merge] Task overview capture failed:",e)}try{await (0,S.removeWorktree)(o,a)}catch(e){console.error("[merge] Worktree cleanup failed:",e)}return(0,x.revalidatePath)("/workspaces"),w.NextResponse.json({success:!0,message:"Squash merge completed"})}catch(t){let e=t instanceof Error?t.message:String(t);return console.error("[merge] Merge failed:",e),w.NextResponse.json({error:`Merge failed: ${e}`},{status:500})}}e.s(["POST",0,P],997224);var T=e.i(997224);let I=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[taskId]/merge/route",pathname:"/api/tasks/[taskId]/merge",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/tasks/[taskId]/merge/route.ts",nextConfigOutput:"standalone",userland:T}),{workAsyncStorage:_,workUnitAsyncStorage:j,serverHooks:O}=I;async function D(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),I.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/tasks/[taskId]/merge/route";w=w.replace(/\/index$/,"")||"/";let E=await I.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!E)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:v,params:y,nextConfig:x,parsedUrl:b,isDraftMode:S,prerenderManifest:k,routerServerContext:C,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,resolvedPathname:P,clientReferenceManifest:T,serverActionsManifest:_}=E,j=(0,o.normalizeAppPath)(w),O=!!(k.dynamicRoutes[j]||k.routes[P]),D=async()=>((null==C?void 0:C.render404)?await C.render404(e,t,b,!1):t.end("This page could not be found"),null);if(O&&!S){let e=!!k.routes[P],t=k.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(x.adapterPath)return await D();throw new m.NoFallbackError}}let H=null;!O||I.isDev||S||(H="/index"===(H=P)?"/":H);let M=!0===I.isDev||!O,q=O&&!M;_&&T&&(0,s.setManifestsSingleton)({page:w,clientReferenceManifest:T,serverActionsManifest:_});let F=e.method||"GET",U=(0,i.getTracer)(),$=U.getActiveScopeSpan(),B=!!(null==C?void 0:C.isWrappedByNextServer),K=!!(0,n.getRequestMeta)(e,"minimalMode"),W=(0,n.getRequestMeta)(e,"incrementalCache")||await I.getIncrementalCache(e,x,k,K);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let G={params:y,previewProps:k.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:W,cacheLifeProfiles:x.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>I.onRequestError(e,t,a,n,C)},sharedContext:{buildId:v}},L=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),X=c.NextRequestAdapter.fromNodeNextRequest(L,(0,c.signalFromNodeResponse)(t));try{let n,s=async e=>I.handle(X,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=U.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${F} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${F} ${w}`)}),o=async n=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&A&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!O)return await (0,p.sendResponse)(L,V,i,G.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await I.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:A})},!1,C),t}},c=await I.handleResponse({req:e,nextConfig:x,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:K});if(!O)return null;if((null==c||null==(i=c.value)?void 0:i.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(o=c.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",A?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(c.value.headers);return K&&O||u.delete(f.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,g.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)(L,V,new Response(c.value.body,{headers:u,status:c.value.status||200})),null};B&&$?await o($):(n=U.getActiveScopeSpan(),await U.withPropagatedContext(e.headers,()=>U.trace(u.BaseServerSpan.handleRequest,{spanName:`${F} ${w}`,kind:i.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},o),void 0,!B))}catch(t){if(t instanceof m.NoFallbackError||await I.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:A})},!1,C),O)throw t;return await (0,p.sendResponse)(L,V,new Response(null,{status:500})),null}}e.s(["handler",0,D,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:_,workUnitAsyncStorage:j})},"routeModule",0,I,"serverHooks",0,O,"workAsyncStorage",0,_,"workUnitAsyncStorage",0,j],901814)}];
|
|
1
|
+
module.exports=[901814,e=>{"use strict";var t=e.i(765876),a=e.i(675896),r=e.i(959160),n=e.i(97944),i=e.i(86757),o=e.i(204144),s=e.i(273436),l=e.i(743641),c=e.i(813766),d=e.i(840884),u=e.i(498814),p=e.i(780006),f=e.i(544432),m=e.i(772005),h=e.i(450223),b=e.i(193695);e.i(628400);var g=e.i(800071),w=e.i(855104),v=e.i(78091),y=e.i(843793),R=e.i(921675),E=e.i(195158);let k=v.z.string().min(1,"ID is required");v.z.object({name:v.z.string().min(1,"Name is required").max(100),description:v.z.string().max(500).optional()}),v.z.object({name:v.z.string().min(1).max(100).optional(),description:v.z.string().max(500).optional()}),v.z.array(k).min(1,"At least one workspace id is required"),v.z.object({name:v.z.string().min(1,"Name is required").max(100),alias:v.z.string().max(100).optional(),description:v.z.string().max(5e3).optional(),gitUrl:v.z.string().max(500).optional().or(v.z.literal("")),localPath:v.z.string().optional(),workspaceId:k,projectType:v.z.enum(["FRONTEND","BACKEND"]).optional(),previewCommand:v.z.string().max(500).nullable().optional()}),v.z.object({name:v.z.string().min(1).max(100).optional(),alias:v.z.string().max(100).optional(),description:v.z.string().max(5e3).optional(),localPath:v.z.string().optional(),projectType:v.z.enum(["FRONTEND","BACKEND"]).optional(),previewCommand:v.z.string().max(500).nullable().optional(),previewPort:v.z.number().int().min(1).max(65535).nullable().optional()});let x=v.z.object({title:v.z.string().min(1,"Title is required").max(200),description:v.z.string().max(5e3).optional(),projectId:k,priority:v.z.enum(["LOW","MEDIUM","HIGH","CRITICAL"]).optional(),status:v.z.enum(["TODO","IN_PROGRESS","IN_REVIEW","DONE","CANCELLED"]).optional(),labelIds:v.z.array(k).optional(),baseBranch:v.z.string().max(200).optional(),subPath:v.z.string().max(500).optional(),versionId:k.optional()}),A=v.z.object({title:v.z.string().min(1).max(200).optional(),description:v.z.string().max(5e3).optional(),priority:v.z.enum(["LOW","MEDIUM","HIGH","CRITICAL"]).optional(),labelIds:v.z.array(k).optional(),baseBranch:v.z.string().max(200).optional(),subPath:v.z.string().max(500).optional(),previewCommandOverride:v.z.string().max(500).nullable().optional(),previewPortOverride:v.z.number().int().min(1).max(65535).nullable().optional(),versionId:k.nullable().optional()}),z=v.z.enum(["TODO","IN_PROGRESS","IN_REVIEW","DONE","CANCELLED"]),C=v.z.object({name:v.z.string().min(1,"Name is required").max(50),color:v.z.string().regex(/^#[0-9a-fA-F]{6}$/,"Invalid hex color"),workspaceId:k});v.z.object({number:v.z.string().min(1,"Number is required").max(50),name:v.z.string().min(1,"Name is required").max(100),typeId:k.optional(),baseBranch:v.z.string().max(200).optional(),startDate:v.z.coerce.date().optional(),targetDate:v.z.coerce.date().optional(),description:v.z.string().max(5e3).optional(),projectId:k,setCurrent:v.z.boolean().optional()}),v.z.object({number:v.z.string().min(1).max(50).optional(),name:v.z.string().min(1).max(100).optional(),typeId:k.nullable().optional(),baseBranch:v.z.string().max(200).nullable().optional(),startDate:v.z.coerce.date().nullable().optional(),targetDate:v.z.coerce.date().nullable().optional(),description:v.z.string().max(5e3).nullable().optional()}),v.z.object({workspaceId:k,name:v.z.string().min(1).max(50)}),v.z.object({name:v.z.string().min(1).max(50)});var N=e.i(86708);async function P(e){return y.db.label.findMany({where:{OR:[{isBuiltin:!0},{workspaceId:e}]},orderBy:[{isBuiltin:"desc"},{name:"asc"}]})}async function I(e){let t=C.parse(e),a=await y.db.label.create({data:{name:t.name,color:t.color,workspaceId:t.workspaceId}});return(0,E.revalidatePath)("/workspaces"),a}async function D(e){let t=await y.db.label.findUnique({where:{id:e}});if(!t)throw Error("Label not found");if(t.isBuiltin)throw Error("Cannot delete builtin labels");await y.db.label.delete({where:{id:e}}),(0,E.revalidatePath)("/workspaces")}async function j(e,t){await y.db.$transaction(async a=>{await a.taskLabel.deleteMany({where:{taskId:e}}),t.length>0&&await a.taskLabel.createMany({data:t.map(t=>({taskId:e,labelId:t}))})}),(0,E.revalidatePath)("/workspaces")}async function S(e){return(await y.db.taskLabel.findMany({where:{taskId:e},include:{label:!0}})).map(e=>e.label)}(0,N.ensureServerEntryExports)([P,I,D,j,S]),(0,R.registerServerReference)(P,"40a4ee923ff0b325baafa490ce673265b4bf3061a2",null),(0,R.registerServerReference)(I,"403508781c13bf9d40b2fa51d399f5ca275af8be45",null),(0,R.registerServerReference)(D,"403629f8c3d76ad7fbefdd04b8cdbe84c9ffc95758",null),(0,R.registerServerReference)(j,"607100dc3ba79d283d2e181ad0c6be5c368d248e26",null),(0,R.registerServerReference)(S,"40e75027ce84b64d14e03c58f0de065ddf45dc3968",null);var O=e.i(248434),T=e.i(50377),M=e.i(519827),B=e.i(22569);let q=T.logger.create("task-actions");async function L(e){let t=x.parse(e),a=await y.db.task.create({data:{title:t.title,description:t.description,projectId:t.projectId,priority:t.priority??"MEDIUM",status:t.status??"TODO",baseBranch:t.baseBranch??null,subPath:t.subPath??null,versionId:t.versionId??null}});return t.labelIds&&t.labelIds.length>0&&await y.db.taskLabel.createMany({data:t.labelIds.map(e=>({taskId:a.id,labelId:e}))}),(0,E.revalidatePath)("/workspaces"),a}async function U(t,a){z.parse(a);let r=!1;if("DONE"===a){let a=await y.db.task.findUnique({where:{id:t},include:{project:!0}});if(a?.baseBranch&&a.project?.localPath){let{completeWorktreeReturn:n}=await e.A(659167);r=(await n(t,a.project.localPath,a.baseBranch)).completed}}let n=await y.db.task.update({where:{id:t},data:{status:a,doneAt:"DONE"===a?new Date:null},include:{project:!0}});if("DONE"===a&&!r&&!n.baseBranch&&n.project?.localPath)try{let{execFileSync:a}=await e.A(144264),r=a("git",["rev-parse","HEAD"],{cwd:n.project.localPath,encoding:"utf-8",timeout:5e3}).trim();if(r){let e=await y.db.taskExecution.findFirst({where:{taskId:t},orderBy:{createdAt:"desc"}});e&&await y.db.taskExecution.update({where:{id:e.id},data:{mergeCommit:r}})}}catch{}if("DONE"===a&&(e.A(507603).then(({captureTaskDreaming:e})=>{e(t).catch(()=>{})}).catch(()=>{}),r||e.A(884996).then(({captureTaskOverview:e})=>{e(t).catch(()=>{})}).catch(()=>{})),"DONE"===a&&!r||"CANCELLED"===a)try{let{destroySession:a}=await e.A(217260);a(t)}catch(e){q.error("PTY session destroy failed",e,{taskId:t})}if("CANCELLED"===a&&n.project?.localPath)try{let{captureTaskOverview:a}=await e.A(884996);await a(t,{kind:"cancelled"})}catch(e){q.error("Task overview capture failed",e,{taskId:t})}if("CANCELLED"===a&&n.project?.localPath)try{await (0,O.removeWorktree)(n.project.localPath,t)}catch(e){q.error("Worktree cleanup failed",e,{taskId:t})}try{(0,E.revalidatePath)("/workspaces")}catch(e){q.error("revalidatePath failed (non-fatal)",e,{taskId:t})}return n}async function _(e,t){let{labelIds:a,...r}=A.parse(t),n=await y.db.task.update({where:{id:e},data:r});return void 0!==a&&await j(e,a),(0,E.revalidatePath)("/workspaces"),n}async function H(e){v.z.string().cuid().parse(e);let t=await y.db.task.findUniqueOrThrow({where:{id:e},select:{pinned:!0}}),a=await y.db.task.update({where:{id:e},data:{pinned:!t.pinned}});return(0,E.revalidatePath)("/workspaces"),a}async function W(t){let a=await y.db.task.findUnique({where:{id:t},include:{project:!0}});try{let{destroySession:a}=await e.A(217260);a(t)}catch{}if(a?.project?.localPath)try{await (0,O.removeWorktree)(a.project.localPath,t)}catch{}await y.db.task.delete({where:{id:t}}),(0,E.revalidatePath)("/workspaces")}async function F(e){let t=await (0,B.getArchiveDelayDays)();return y.db.task.findMany({where:{projectId:e,...(0,M.visibleTaskWhere)(t)},orderBy:[{pinned:"desc"},{order:"asc"},{createdAt:"desc"}]})}async function $(e){return e.trim()?y.db.task.findMany({where:{OR:[{title:{contains:e}},{description:{contains:e}}]},include:{project:{include:{workspace:!0}}},take:20,orderBy:{updatedAt:"desc"}}):[]}async function K(e){let t=await (0,B.getArchiveDelayDays)();return y.db.task.findMany({where:{projectId:e,...(0,M.archivedTaskWhere)(t)},include:{labels:{include:{label:!0}},version:{select:{id:!0,number:!0,name:!0}},executions:{orderBy:{createdAt:"desc"},take:1}},orderBy:{updatedAt:"desc"}})}async function G(t){let{execFileSync:a}=await e.A(144264),{existsSync:r}=await e.A(323970),n=await y.db.task.findUnique({where:{id:t}}),i=await y.db.taskExecution.findFirst({where:{taskId:t},orderBy:{createdAt:"desc"}}),o=n?.baseBranch||"main";if(!i?.worktreePath||!r(i.worktreePath))return{clean:!0,files:[],hasCommits:!1,lastCommitMessage:null,commitLog:[],hasWorktree:!1,baseBranch:o};let s=i.worktreePath;try{let e=a("git",["status","--porcelain"],{cwd:s,encoding:"utf-8",timeout:5e3}).trim(),t=e?e.split("\n").map(e=>e.trim()).filter(Boolean):[],r=(0,O.stripTowerLinkedStatus)(t,s),n=0===r.length,i=!1,l=null,c=[];try{let e=a("git",["merge-base",o,"HEAD"],{cwd:s,encoding:"utf-8",timeout:5e3}).trim(),t=a("git",["rev-list","--count",`${e}..HEAD`],{cwd:s,encoding:"utf-8",timeout:5e3}).trim();if(i=parseInt(t,10)>0){l=a("git",["log","-1","--format=%B"],{cwd:s,encoding:"utf-8",timeout:5e3}).trim();let t=a("git",["log","--oneline",`${e}..HEAD`],{cwd:s,encoding:"utf-8",timeout:5e3}).trim();c=t?t.split("\n").filter(Boolean):[]}}catch{}return{clean:n,files:r,hasCommits:i,lastCommitMessage:l,commitLog:c,hasWorktree:!0,baseBranch:o}}catch{return{clean:!0,files:[],hasCommits:!1,lastCommitMessage:null,commitLog:[],hasWorktree:!0,baseBranch:o}}}async function V(t,a){let{execFileSync:r}=await e.A(144264),{existsSync:n}=await e.A(323970),i=await y.db.taskExecution.findFirst({where:{taskId:t},orderBy:{createdAt:"desc"}});if(!i?.worktreePath||!n(i.worktreePath))throw Error("No active worktree for this task");let o=i.worktreePath;if(r("git",["add","-A"],{cwd:o,timeout:1e4}),!r("git",["status","--porcelain"],{cwd:o,encoding:"utf-8",timeout:5e3}).trim())throw Error("No changes to commit");return r("git",["commit","-m",a],{cwd:o,encoding:"utf-8",timeout:15e3}),{hash:r("git",["rev-parse","--short","HEAD"],{cwd:o,encoding:"utf-8",timeout:5e3}).trim()}}async function X(e){return/^c[a-z0-9]{20,30}$/.test(e)?y.db.task.findUnique({where:{id:e},include:{labels:{include:{label:!0}},version:{select:{id:!0,number:!0,name:!0}},project:{select:{id:!0,name:!0,type:!0,localPath:!0,workspaceId:!0}},executions:{orderBy:{createdAt:"desc"},take:1,select:{summary:!0,status:!0,endedAt:!0,gitStats:!0,worktreePath:!0}},_count:{select:{assets:!0}}}}):null}async function Y(e){let t=await (0,B.getArchiveDelayDays)();return y.db.task.count({where:{projectId:e,...(0,M.archivedTaskWhere)(t)}})}(0,N.ensureServerEntryExports)([L,U,_,H,W,F,$,K,G,V,X,Y]),(0,R.registerServerReference)(L,"407e209030abeb6675e3ada470cba988bc50a35fd4",null),(0,R.registerServerReference)(U,"60e4b2ed8000953c03639b7e7fbc5233720fd9370a",null),(0,R.registerServerReference)(_,"6076bcc79f9958bb057ccdd60911f9d7b735d7a931",null),(0,R.registerServerReference)(H,"40831188e28055647acd1df5e5715b66798b762ce4",null),(0,R.registerServerReference)(W,"408d0e75cb1bd97639d51db48f5af64af40960c091",null),(0,R.registerServerReference)(F,"405b119efa84acb36bee029d2bcc168afc7f336881",null),(0,R.registerServerReference)($,"408f6e738e5280db3c9c58fc1751dd54be7d067c14",null),(0,R.registerServerReference)(K,"402ad17793fc99949e1a4d611602a7fc06c5ad0fb5",null),(0,R.registerServerReference)(G,"401acf2b7191c3fbfd39c3f254a5628d15465f16bb",null),(0,R.registerServerReference)(V,"6031d4644cd423486c800f9dcad4ed01df4562a880",null),(0,R.registerServerReference)(X,"403a7d2c9bb7cb0a78ee046f71013ad11077222cc0",null),(0,R.registerServerReference)(Y,"409c9c0bf565a9c87ebd39a315aa1db9e204b59db7",null);var Z=e.i(189817);async function J(e,{params:t}){let{taskId:a}=await t,r=v.z.string().cuid().safeParse(a);if(!r.success)return w.NextResponse.json({error:"Invalid task ID"},{status:400});try{let e=await y.db.task.findUnique({where:{id:r.data},include:{project:!0}});if(!e)return w.NextResponse.json({error:"Task not found"},{status:404});if("DONE"===e.status||"CANCELLED"===e.status)return w.NextResponse.json({error:"Task is already completed or cancelled"},{status:400});if(!e.baseBranch)return w.NextResponse.json({error:"Task has no base branch configured"},{status:400});if(!e.project?.localPath)return w.NextResponse.json({error:"Project has no local path"},{status:400});return await U(a,"DONE"),w.NextResponse.json({success:!0,message:"Merge completed"})}catch(t){if(t instanceof Z.MergeConflictError)return w.NextResponse.json({error:"Merge conflicts detected",conflictFiles:t.conflictFiles},{status:409});if(t instanceof Z.WorktreeDirtyError)return w.NextResponse.json({error:"Worktree has uncommitted changes",files:t.files},{status:400});let e=t instanceof Error?t.message:String(t);return console.error("[merge] Merge failed:",e),w.NextResponse.json({error:`Merge failed: ${e}`},{status:500})}}e.s(["POST",0,J],997224);var Q=e.i(997224);let ee=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/tasks/[taskId]/merge/route",pathname:"/api/tasks/[taskId]/merge",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/tasks/[taskId]/merge/route.ts",nextConfigOutput:"standalone",userland:Q}),{workAsyncStorage:et,workUnitAsyncStorage:ea,serverHooks:er}=ee;async function en(e,t,r){r.requestMeta&&(0,n.setRequestMeta)(e,r.requestMeta),ee.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/tasks/[taskId]/merge/route";w=w.replace(/\/index$/,"")||"/";let v=await ee.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:y,params:R,nextConfig:E,parsedUrl:k,isDraftMode:x,prerenderManifest:A,routerServerContext:z,isOnDemandRevalidate:C,revalidateOnlyGenerated:N,resolvedPathname:P,clientReferenceManifest:I,serverActionsManifest:D}=v,j=(0,s.normalizeAppPath)(w),S=!!(A.dynamicRoutes[j]||A.routes[P]),O=async()=>((null==z?void 0:z.render404)?await z.render404(e,t,k,!1):t.end("This page could not be found"),null);if(S&&!x){let e=!!A.routes[P],t=A.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(E.adapterPath)return await O();throw new b.NoFallbackError}}let T=null;!S||ee.isDev||x||(T="/index"===(T=P)?"/":T);let M=!0===ee.isDev||!S,B=S&&!M;D&&I&&(0,o.setManifestsSingleton)({page:w,clientReferenceManifest:I,serverActionsManifest:D});let q=e.method||"GET",L=(0,i.getTracer)(),U=L.getActiveScopeSpan(),_=!!(null==z?void 0:z.isWrappedByNextServer),H=!!(0,n.getRequestMeta)(e,"minimalMode"),W=(0,n.getRequestMeta)(e,"incrementalCache")||await ee.getIncrementalCache(e,E,A,H);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let F={params:R,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:M,incrementalCache:W,cacheLifeProfiles:E.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>ee.onRequestError(e,t,r,n,z)},sharedContext:{buildId:y}},$=new l.NodeNextRequest(e),K=new l.NodeNextResponse(t),G=c.NextRequestAdapter.fromNodeNextRequest($,(0,c.signalFromNodeResponse)(t));try{let n,o=async e=>ee.handle(G,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let a=L.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route");if(r){let t=`${q} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",r),n.updateName(t))}else e.updateName(`${q} ${w}`)}),s=async n=>{var i,s;let l=async({previousCacheEntry:a})=>{try{if(!H&&C&&N&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=F.renderOpts.fetchMetrics;let s=F.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let l=F.renderOpts.collectedTags;if(!S)return await (0,p.sendResponse)($,K,i,F.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[h.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,r=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await ee.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:B,isOnDemandRevalidate:C})},!1,z),t}},c=await ee.handleResponse({req:e,nextConfig:E,cacheKey:T,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:r.waitUntil,isMinimalMode:H});if(!S)return null;if((null==c||null==(i=c.value)?void 0:i.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(s=c.value)?void 0:s.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});H||t.setHeader("x-nextjs-cache",C?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),x&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,f.fromNodeOutgoingHttpHeaders)(c.value.headers);return H&&S||d.delete(h.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,m.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)($,K,new Response(c.value.body,{headers:d,status:c.value.status||200})),null};_&&U?await s(U):(n=L.getActiveScopeSpan(),await L.withPropagatedContext(e.headers,()=>L.trace(d.BaseServerSpan.handleRequest,{spanName:`${q} ${w}`,kind:i.SpanKind.SERVER,attributes:{"http.method":q,"http.target":e.url}},s),void 0,!_))}catch(t){if(t instanceof b.NoFallbackError||await ee.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:B,isOnDemandRevalidate:C})},!1,z),S)throw t;return await (0,p.sendResponse)($,K,new Response(null,{status:500})),null}}e.s(["handler",0,en,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:et,workUnitAsyncStorage:ea})},"routeModule",0,ee,"serverHooks",0,er,"workAsyncStorage",0,et,"workUnitAsyncStorage",0,ea],901814)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[519895,e=>{"use strict";var t=e.i(980738),r=e.i(769310);class i{taskId;_pty;killed=!1;disconnectTimer=null;_buffer="";static BUFFER_MAX=51200;_onData;_exitListeners=[];_idleTimer=null;_idleThresholdMs;_onIdle;_idleFired=!1;constructor(e,s,n,o,l,a,c,d,u){this.taskId=e,this._onData=l,this._onIdle=d??null,this._idleThresholdMs=Math.max(u??18e4,18e4);const h={...(0,r.stripClaudeNestingEnv)((0,r.ensurePathInEnv)(process.env)),TERM:"xterm-color",...c};try{this._pty=t.spawn(s,n,{name:"xterm-color",cols:80,rows:24,cwd:o,env:h})}catch(e){throw console.error(`[pty] spawn failed: command="${s}", cwd="${o}", PATH="${h.PATH?.slice(0,200)}"`),e}this._pty.onData(e=>{this._buffer+=e,this._buffer.length>i.BUFFER_MAX&&(this._buffer=this._buffer.slice(this._buffer.length-i.BUFFER_MAX)),this._resetIdleTimer(),this._onData(e)}),this._pty.onExit(({exitCode:e,signal:t})=>{for(let r of(this.killed=!0,this._idleTimer&&(clearTimeout(this._idleTimer),this._idleTimer=null),a(e,t),this._exitListeners))r(e)}),this._resetIdleTimer()}_resetIdleTimer(){this._idleTimer&&(clearTimeout(this._idleTimer),this._idleTimer=null),null===this._onIdle||this.killed||this._idleFired||(this._idleTimer=setTimeout(()=>{this._idleFired=!0,this._onIdle?.()},this._idleThresholdMs))}setDataListener(e){this._onData=e}setExitListener(e){this._exitListeners=[e]}write(e){this.killed||(this._resetIdleTimer(),this._pty.write(e))}resize(e,t){this.killed||this._pty.resize(e,t)}getBuffer(){return this._buffer}get isIdle(){return this._idleFired}get pid(){return this._pty.pid}kill(e){if(!this.killed){this.killed=!0,this._idleTimer&&(clearTimeout(this._idleTimer),this._idleTimer=null);try{this._pty.kill(e)}catch{}}}forceKill(){try{this._pty.kill("SIGKILL")}catch{}this.killed=!0}killTree(e=3e3){if(this.killed)return;this.killed=!0,this._idleTimer&&(clearTimeout(this._idleTimer),this._idleTimer=null);let t=this._pty.pid;try{process.kill(-t,"SIGTERM")}catch{try{this._pty.kill()}catch{}return}let r=setTimeout(()=>{try{process.kill(-t,"SIGKILL")}catch{}},e);r.unref?.()}}e.s(["PtySession",0,i])},83721,e=>{"use strict";var t=e.i(519895),r=e.i(769310);e.i(874533);var i=e.i(912714),s=e.i(750227);let n=(0,e.i(192520).getSignalDir)();function o(e){return(0,s.join)(n,`pid-${e}`)}async function l(e,t){try{await (0,i.mkdir)(n,{recursive:!0,mode:448}),await (0,i.writeFile)(o(e),String(t),{mode:384})}catch{}}async function a(e){try{await (0,i.unlink)(o(e))}catch{}}let c=globalThis;c.__ptySessions||(c.__ptySessions=new Map);let d=c.__ptySessions;function u(e){let t=d.get(e);if(t)return d.delete(e),t.disconnectTimer&&(clearTimeout(t.disconnectTimer),t.disconnectTimer=null),t.killTree(),t}function h(e){u(e)&&a(e)}function p(){for(let e of d.keys())h(e)}let _=globalThis;"phase-production-build"===process.env.NEXT_PHASE||_.__ptySignalHandlersRegistered||(_.__ptySignalHandlersRegistered=!0,process.once("SIGTERM",()=>{console.error("[session-store] SIGTERM received — cleaning up PTY sessions"),p()}),process.once("SIGINT",()=>{console.error("[session-store] SIGINT received — cleaning up PTY sessions"),p()})),e.s(["createSession",0,function(e,i,s,n,o,a,c,h,p){u(e);let{command:_,args:m}=(0,r.resolveSpawnTargetSync)(i,s),f=new t.PtySession(e,_,m,n,o,a,c,h,p);return d.set(e,f),l(e,f.pid),f},"destroySession",0,h,"getSession",0,function(e){return d.get(e)}],83721)},192520,e=>{"use strict";let t;var r=e.i(750227),i=e.i(660526),s=e.i(666680),n=e.i(902157);function o(){return t||(t=process.env.TOWER_DATA_DIR||(0,r.join)((0,i.homedir)(),".tower"),(0,n.existsSync)(t)||(0,n.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,r.join)(o(),"assistant");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,r.join)(o(),"backups");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,r.join)(o(),"extensions");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e},"getSignalDir",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,i.homedir)(),".tower"),t=(0,s.createHash)("sha256").update(e).digest("hex").slice(0,16);return(0,r.join)((0,i.tmpdir)(),"tower-signals",t)},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,n.readFileSync)((0,r.join)(o(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,r.join)(o(),"storage");return(0,n.existsSync)(t)||(0,n.mkdirSync)(t,{recursive:!0}),t},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,i.homedir)(),".tower");return(0,r.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,r.join)((e=(0,r.join)(o(),"database"),(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,o])},843793,e=>{"use strict";var t=e.i(933919),r=e.i(192520);let i=globalThis.prisma??new t.PrismaClient({datasourceUrl:`file:${(0,r.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{i.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{i.$disconnect().catch(()=>{})}),e.s(["db",0,i])},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},198840,e=>{"use strict";var t=e.i(855104);let r=["localhost","127.0.0.1","[::1]"],i=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),s=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let s=e.headers.get("x-forwarded-for");if(s&&!s.split(",").map(e=>e.trim()).every(e=>i.has(e)))return t.NextResponse.json({error:"Forbidden"},{status:403});let n=e.headers.get("host")??"";return r.some(e=>n.startsWith(e))?null:t.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return s.test(e)?null:t.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return s.test(e)?null:t.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},572173,e=>{"use strict";var t=e.i(843793);async function r(e,r){let i=await t.db.systemConfig.findUnique({where:{key:e}});if(!i)return r;try{return JSON.parse(i.value)}catch{return r}}e.s(["readConfigValue",0,r])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0-1~xqo._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[750227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},902157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},603484,e=>{"use strict";var t=e.i(902157),r=e.i(874533),n=e.i(750227);function s(e=process.platform){return"win32"===e}function o(e){let t=e.replace(/\r\n|\r|\n/g," ");if(!t.length)return'""';let r=t.replace(/"/g,'""');return/[\s"&<>|^()]/.test(r)?`"${r}"`:r}let l=["CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION","CLAUDE_CODE_PARENT_SESSION"];async function i(e,t={}){let r=t.cwd??process.cwd(),o=t.env??process.env,l=t.platform??process.platform;if(e.includes("/")||e.includes("\\")){let t=n.default.isAbsolute(e)?e:n.default.resolve(r,e);return await u(t,l)?t:null}let a=o.PATH??o.Path??"",c=s(l)?";":":",p=a.split(c).filter(Boolean),f=s(l)?(o.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";").filter(Boolean):[""],m=s(l)&&n.default.extname(e).length>0;for(let t of p)for(let r of s(l)?m?[n.default.join(t,e)]:f.map(r=>n.default.join(t,`${e}${r}`)):[n.default.join(t,e)])if(await u(r,l))return r;return null}let a=e=>(0,r.execSync)(e,{encoding:"utf-8",timeout:5e3,stdio:["ignore","pipe","ignore"]});async function c(e,t,r={}){let l=r.env??process.env,a=r.platform??process.platform;var u=await i(e,r)??e,p=t,f=l,m=a;if(!s(m))return{command:u,args:p};let d=n.default.extname(u).toLowerCase();return".cmd"===d||".bat"===d||".com"===d?{command:f.ComSpec||"cmd.exe",args:["/d","/s","/c",[o(u),...p.map(o)].join(" ")]}:{command:u,args:p}}async function u(e,r=process.platform){try{return await t.promises.access(e,s(r)?t.constants.F_OK:t.constants.X_OK),!0}catch{return!1}}e.s(["ensurePathInEnv",0,function(e,t=process.platform){let r=s(t)?"Path":"PATH";return(e.PATH??e.Path??"").length>0?e:{...e,[r]:function(e=process.platform){return s(e)?"C:\\Windows\\System32;C:\\Windows;C:\\Windows\\System32\\Wbem":"/usr/local/bin:/opt/homebrew/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"}(t)}},"isWindows",0,s,"resolveCommandPathSync",0,function(e,t=process.platform,o=a){if(n.default.extname(e)||e.includes("/")||e.includes("\\"))return e;if(!s(t)){try{let t=(0,r.execFileSync)("which",[e],{encoding:"utf-8",timeout:5e3,stdio:["ignore","pipe","ignore"]}).trim();if(t)return t}catch{}return e}try{let t=o(`where ${e}`).trim().split("\n").map(e=>e.trim()).filter(Boolean),r=t.find(e=>/\.(cmd|bat|exe)$/i.test(e));if(r)return r;if(t.length>0)return t[0]}catch{}return e},"resolveSpawnTarget",0,c,"stripClaudeNestingEnv",0,function(e){let t={...e};for(let e of l)delete t[e];return t}])},482848,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_node_child_process_06l~6ej._.js"].map(t=>e.l(t))).then(()=>t(874533)))},268548,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_node_util_0xr.y7p._.js"].map(t=>e.l(t))).then(()=>t(812057)))},144264,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_child_process_0pwkpv9._.js"].map(t=>e.l(t))).then(()=>t(233405)))},534777,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_util_0wtvqkc._.js"].map(t=>e.l(t))).then(()=>t(224361)))},998127,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0mw.9lg._.js"].map(t=>e.l(t))).then(()=>t(603484)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0-kboke._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[750227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},902157,(e,r,t)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,r,t)=>{r.exports=e.x("node:os",()=>require("node:os"))},666680,(e,r,t)=>{r.exports=e.x("node:crypto",()=>require("node:crypto"))},933919,(e,r,t)=>{r.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},522734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},918622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},814747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},924868,(e,r,t)=>{r.exports=e.x("fs/promises",()=>require("fs/promises"))},192520,e=>{"use strict";let r;var t=e.i(750227),s=e.i(660526),n=e.i(666680),i=e.i(902157);function o(){return r||(r=process.env.TOWER_DATA_DIR||(0,t.join)((0,s.homedir)(),".tower"),(0,i.existsSync)(r)||(0,i.mkdirSync)(r,{recursive:!0})),r}e.s(["getAssistantDir",0,function(){let e=(0,t.join)(o(),"assistant");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,t.join)(o(),"backups");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,t.join)(o(),"extensions");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getSignalDir",0,function(){let e=process.env.TOWER_DATA_DIR||(0,t.join)((0,s.homedir)(),".tower"),r=(0,n.createHash)("sha256").update(e).digest("hex").slice(0,16);return(0,t.join)((0,s.tmpdir)(),"tower-signals",r)},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,i.readFileSync)((0,t.join)(o(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),r=e&&e.length>0?e:(0,t.join)(o(),"storage");return(0,i.existsSync)(r)||(0,i.mkdirSync)(r,{recursive:!0}),r},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,t.join)((0,s.homedir)(),".tower");return(0,t.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,t.join)((e=(0,t.join)(o(),"database"),(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,o])},843793,e=>{"use strict";var r=e.i(933919),t=e.i(192520);let s=globalThis.prisma??new r.PrismaClient({datasourceUrl:`file:${(0,t.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{s.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{s.$disconnect().catch(()=>{})}),e.s(["db",0,s])},324725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},193695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},198840,e=>{"use strict";var r=e.i(855104);let t=["localhost","127.0.0.1","[::1]"],s=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),n=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let n=e.headers.get("x-forwarded-for");if(n&&!n.split(",").map(e=>e.trim()).every(e=>s.has(e)))return r.NextResponse.json({error:"Forbidden"},{status:403});let i=e.headers.get("host")??"";return t.some(e=>i.startsWith(e))?null:r.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return n.test(e)?null:r.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return n.test(e)?null:r.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},572173,e=>{"use strict";var r=e.i(843793);async function t(e,t){let s=await r.db.systemConfig.findUnique({where:{key:e}});if(!s)return t;try{return JSON.parse(s.value)}catch{return t}}e.s(["readConfigValue",0,t])},341291,e=>{"use strict";var r=e.i(666680),t=e.i(902157),s=e.i(750227),n=e.i(192520);function i(e){if(!e.startsWith((0,n.getStorageDir)()+s.sep))throw Error("Path traversal detected")}let o=new Set(["image","screenshot","img","photo","picture","clipboard","paste","untitled"]);e.s(["buildCacheFilename",0,function(e,t){let n=s.basename(e,s.extname(e)),i=r.randomUUID().replace(/-/g,"").slice(0,8),a=n.toLowerCase();if(!n||o.has(a)||/^screenshot[\s_\-]/i.test(n))return`tower_image-${i}${t}`;let c=n.replace(/[^\p{L}\p{N}]/gu,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"");return`${c||"file"}-${i}${t}`},"ensureAssetsDir",0,function(e){let r,o=(i(r=s.join((0,n.getStorageDir)(),"assets",e)),r);return t.mkdirSync(o,{recursive:!0}),o},"ensureCacheDir",0,function(e){let r,o=(i(r=s.join((0,n.getStorageDir)(),"cache",e)),r);return t.mkdirSync(o,{recursive:!0}),o},"getAssistantCacheDir",0,function(e="images"){let r=new Date,o=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}`,a=s.join((0,n.getStorageDir)(),"cache","assistant",o,e);return i(a),t.mkdirSync(a,{recursive:!0}),a},"getAssistantCacheRoot",0,function(){let e=s.join((0,n.getStorageDir)(),"cache","assistant");return i(e),e}])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0.3n3t.._.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
module.exports=[769310,e=>{"use strict";var n=e.i(902157),t=e.i(874533),r=e.i(750227);function i(e=process.platform){return"win32"===e}function a(e){let n=e.replace(/\r\n|\r|\n/g," ");if(!n.length)return'""';let t=n.replace(/"/g,'""');return/[\s"&<>|^()]/.test(t)?`"${t}"`:t}let o=["CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_SESSION","CLAUDE_CODE_PARENT_SESSION"];async function s(e,n={}){let t=n.cwd??process.cwd(),a=n.env??process.env,o=n.platform??process.platform;if(e.includes("/")||e.includes("\\")){let n=r.default.isAbsolute(e)?e:r.default.resolve(t,e);return await p(n,o)?n:null}let l=a.PATH??a.Path??"",c=i(o)?";":":",u=l.split(c).filter(Boolean),d=i(o)?(a.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";").filter(Boolean):[""],m=i(o)&&r.default.extname(e).length>0;for(let n of u)for(let t of i(o)?m?[r.default.join(n,e)]:d.map(t=>r.default.join(n,`${e}${t}`)):[r.default.join(n,e)])if(await p(t,o))return t;return null}let l=e=>(0,t.execSync)(e,{encoding:"utf-8",timeout:5e3,stdio:["ignore","pipe","ignore"]});function c(e,n=process.platform,a=l){if(r.default.extname(e)||e.includes("/")||e.includes("\\"))return e;if(!i(n)){try{let n=(0,t.execFileSync)("which",[e],{encoding:"utf-8",timeout:5e3,stdio:["ignore","pipe","ignore"]}).trim();if(n)return n}catch{}return e}try{let n=a(`where ${e}`).trim().split("\n").map(e=>e.trim()).filter(Boolean),t=n.find(e=>/\.(cmd|bat|exe)$/i.test(e));if(t)return t;if(n.length>0)return n[0]}catch{}return e}async function u(e,n,t={}){let r=t.env??process.env,i=t.platform??process.platform;return d(await s(e,t)??e,n,r,i)}function d(e,n,t,o){if(!i(o))return{command:e,args:n};let s=r.default.extname(e).toLowerCase();return".cmd"===s||".bat"===s||".com"===s?{command:t.ComSpec||"cmd.exe",args:["/d","/s","/c",[a(e),...n.map(a)].join(" ")]}:{command:e,args:n}}async function p(e,t=process.platform){try{return await n.promises.access(e,i(t)?n.constants.F_OK:n.constants.X_OK),!0}catch{return!1}}async function m(e=process.platform){return i(e)?b():f()}async function f(){try{let e=await n.promises.readFile("/etc/shells","utf-8"),t=[],i=new Map;for(let n of e.split("\n")){let e=n.replace(/#.*/,"").trim();if(!e||!e.startsWith("/")||!await p(e))continue;let a=r.default.basename(e),o=i.get(a)??0;i.set(a,o+1),o>0&&(a=`${a} (${o+1})`),t.push({name:a,path:e})}return t}catch{let e=[];for(let n of["/bin/zsh","/bin/bash","/bin/sh"])await p(n)&&e.push({name:r.default.basename(n),path:n});return e}}async function b(){let e=[],n=[],t=await s("git",{platform:"win32"});if(t){let e=r.default.resolve(r.default.dirname(t),"..","..");n.push(r.default.join(e,"bin","bash.exe"),r.default.join(e,"usr","bin","bash.exe"))}for(let e of[process.env.ProgramW6432,process.env.ProgramFiles,process.env["ProgramFiles(x86)"],process.env.LocalAppData?r.default.join(process.env.LocalAppData,"Programs"):null].filter(Boolean))n.push(r.default.join(e,"Git","bin","bash.exe"),r.default.join(e,"Git","usr","bin","bash.exe"));let i=process.env.USERPROFILE??"";for(let t of(i&&n.push(r.default.join(i,"scoop","apps","git","current","bin","bash.exe")),process.env.CLAUDE_CODE_GIT_BASH_PATH&&n.unshift(process.env.CLAUDE_CODE_GIT_BASH_PATH),n))if(await p(t,"win32")){e.push({name:"Git Bash",path:t});break}let a=await s("pwsh",{platform:"win32"});a&&e.push({name:"PowerShell",path:a});let o=process.env.windir??"C:\\WINDOWS",l=r.default.join(o,"System32","WindowsPowerShell","v1.0","powershell.exe");await p(l,"win32")&&e.push({name:"Windows PowerShell",path:l});let c=process.env.ComSpec??r.default.join(o,"System32","cmd.exe");return await p(c,"win32")&&e.push({name:"Command Prompt",path:c}),e}let w=[{name:"Terminal",bundleName:"Terminal"},{name:"iTerm2",bundleName:"iTerm"},{name:"Warp",bundleName:"Warp"},{name:"Alacritty",bundleName:"Alacritty"},{name:"WezTerm",bundleName:"WezTerm"},{name:"kitty",bundleName:"kitty"},{name:"Hyper",bundleName:"Hyper"}];async function h(e=process.platform){if("darwin"===e){let n=[];for(let t of w){let r=await p(`/Applications/${t.bundleName}.app`,e);n.push({name:t.name,value:t.bundleName,installed:r})}return n}if(i(e)){let n=[],t=await s("wt",{platform:e});return t&&n.push({name:"Windows Terminal",value:t,installed:!0}),n}return[]}let S=[{name:"VS Code",command:"code"},{name:"VS Code Insiders",command:"code-insiders"},{name:"Cursor",command:"cursor"},{name:"Windsurf",command:"windsurf"},{name:"Zed",command:"zed"},{name:"Sublime Text",command:"subl"},{name:"IntelliJ IDEA",command:"idea"},{name:"WebStorm",command:"webstorm"},{name:"PyCharm",command:"pycharm"},{name:"GoLand",command:"goland"},{name:"RubyMine",command:"rubymine"},{name:"PhpStorm",command:"phpstorm"},{name:"CLion",command:"clion"},{name:"Rider",command:"rider"}],g={code:{darwin:["/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"],win32:["%LOCALAPPDATA%\\Programs\\Microsoft VS Code\\bin\\code.cmd","%ProgramFiles%\\Microsoft VS Code\\bin\\code.cmd"]},"code-insiders":{darwin:["/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code-insiders"],win32:["%LOCALAPPDATA%\\Programs\\Microsoft VS Code Insiders\\bin\\code-insiders.cmd","%ProgramFiles%\\Microsoft VS Code Insiders\\bin\\code-insiders.cmd"]},cursor:{darwin:["/Applications/Cursor.app/Contents/Resources/app/bin/cursor"],win32:["%LOCALAPPDATA%\\Programs\\cursor\\resources\\app\\bin\\cursor.cmd"]},windsurf:{darwin:["/Applications/Windsurf.app/Contents/Resources/app/bin/windsurf"],win32:["%LOCALAPPDATA%\\Programs\\Windsurf\\bin\\windsurf.cmd"]},zed:{darwin:["/Applications/Zed.app/Contents/MacOS/cli"]},subl:{darwin:["/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"],win32:["%ProgramFiles%\\Sublime Text\\subl.exe","%ProgramFiles%\\Sublime Text 3\\subl.exe"]},idea:{darwin:["/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA CE.app/Contents/MacOS/idea"]},webstorm:{darwin:["/Applications/WebStorm.app/Contents/MacOS/webstorm"]},pycharm:{darwin:["/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm"]},goland:{darwin:["/Applications/GoLand.app/Contents/MacOS/goland"]},rubymine:{darwin:["/Applications/RubyMine.app/Contents/MacOS/rubymine"]},phpstorm:{darwin:["/Applications/PhpStorm.app/Contents/MacOS/phpstorm"]},clion:{darwin:["/Applications/CLion.app/Contents/MacOS/clion"]},rider:{darwin:["/Applications/Rider.app/Contents/MacOS/rider"]}};async function y(e,n={}){let t=n.platform??process.platform,r=n.env??process.env,a=await s(e,n);if(a)return a;for(let n of g[e]?.[t]??[]){let e=i(t)?function(e,n){return e.replace(/%([^%]+)%/g,(e,t)=>{let r=n[t];if(void 0!==r)return r;let i=Object.keys(n).find(e=>e.toLowerCase()===t.toLowerCase());return i?n[i]??e:e})}(n,r):n;if(await p(e,t))return e}return null}async function A(e=process.platform){let n=[];for(let t of S){let r=!!await y(t.command,{platform:e});n.push({name:t.name,command:t.command,installed:r})}return n}e.s(["detectEditors",0,A,"detectShells",0,m,"detectTerminalApps",0,h,"ensurePathInEnv",0,function(e,n=process.platform){let t=i(n)?"Path":"PATH";return(e.PATH??e.Path??"").length>0?e:{...e,[t]:function(e=process.platform){return i(e)?"C:\\Windows\\System32;C:\\Windows;C:\\Windows\\System32\\Wbem":"/usr/local/bin:/opt/homebrew/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"}(n)}},"isWindows",0,i,"resolveCommandPath",0,s,"resolveCommandPathSync",0,c,"resolveSdkExecutable",0,function(e,t=process.platform,a=e=>(0,n.readFileSync)(e,"utf-8"),o=e=>(0,n.existsSync)(e)){if(!i(t))return e;let s=r.default.extname(e).toLowerCase();if(".cmd"!==s&&".bat"!==s)return e;let l=r.default.win32.dirname(e),c="",u=e=>{let n=e.replace(/%~?dp0%/gi,l).replace(/\//g,"\\");return r.default.win32.isAbsolute(n)?r.default.win32.normalize(n):r.default.win32.resolve(l,n)};try{let n=a(e);c=n.replace(/\s+/g," ").slice(0,400);let t=n.match(/"([^"]*\.(?:c?js|mjs))"/i);if(t){let e=u(t[1]);if(o(e))return e;console.error(`[resolveSdkExecutable] parsed cli="${e}" but it doesn't exist`)}for(let e of n.matchAll(/"([^"]*\.exe)"/gi)){let n=u(e[1]);if("node.exe"!==r.default.win32.basename(n).toLowerCase()&&o(n))return n}}catch(e){console.error(`[resolveSdkExecutable] shim read failed: ${e instanceof Error?e.message:e}`)}let d=r.default.win32.join(l,"node_modules","@anthropic-ai","claude-code"),p=r.default.win32.basename(e,r.default.win32.extname(e)),m=[r.default.win32.join(d,"cli.js"),r.default.win32.join(d,"bin",`${p}.exe`)];for(let e of m)if(o(e))return e;return console.error(`[resolveSdkExecutable] could not convert ${e} → guesses=${JSON.stringify(m)} shim="${c}"`),e},"resolveSpawnTarget",0,u,"resolveSpawnTargetSync",0,function(e,n,t=process.platform,r){return d(c(e,t,r),n,process.env,t)},"stripClaudeNestingEnv",0,function(e){let n={...e};for(let e of o)delete n[e];return n}])},324725,(e,n,t)=>{n.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},193695,(e,n,t)=>{n.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},192520,e=>{"use strict";let n;var t=e.i(750227),r=e.i(660526),i=e.i(666680),a=e.i(902157);function o(){return n||(n=process.env.TOWER_DATA_DIR||(0,t.join)((0,r.homedir)(),".tower"),(0,a.existsSync)(n)||(0,a.mkdirSync)(n,{recursive:!0})),n}e.s(["getAssistantDir",0,function(){let e=(0,t.join)(o(),"assistant");return(0,a.existsSync)(e)||(0,a.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,t.join)(o(),"backups");return(0,a.existsSync)(e)||(0,a.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,t.join)(o(),"extensions");return(0,a.existsSync)(e)||(0,a.mkdirSync)(e,{recursive:!0}),e},"getSignalDir",0,function(){let e=process.env.TOWER_DATA_DIR||(0,t.join)((0,r.homedir)(),".tower"),n=(0,i.createHash)("sha256").update(e).digest("hex").slice(0,16);return(0,t.join)((0,r.tmpdir)(),"tower-signals",n)},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,a.readFileSync)((0,t.join)(o(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),n=e&&e.length>0?e:(0,t.join)(o(),"storage");return(0,a.existsSync)(n)||(0,a.mkdirSync)(n,{recursive:!0}),n},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,t.join)((0,r.homedir)(),".tower");return(0,t.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,t.join)((e=(0,t.join)(o(),"database"),(0,a.existsSync)(e)||(0,a.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,o])},843793,e=>{"use strict";var n=e.i(933919),t=e.i(192520);let r=globalThis.prisma??new n.PrismaClient({datasourceUrl:`file:${(0,t.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{r.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{r.$disconnect().catch(()=>{})}),e.s(["db",0,r])},482819,(e,n,t)=>{"use strict";n.exports=e.r(583981).vendored["react-rsc"].ReactServerDOMTurbopackServer},921675,(e,n,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"registerServerReference",{enumerable:!0,get:function(){return r.registerServerReference}});let r=e.r(482819)},86708,(e,n,t)=>{"use strict";function r(e){for(let n=0;n<e.length;n++){let t=e[n];if("function"!=typeof t)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof t}.
|
|
2
|
+
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureServerEntryExports",{enumerable:!0,get:function(){return r}})}];
|
|
3
|
+
|
|
4
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0.wsvr6._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[750227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},902157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},666680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},933919,(e,t,r)=>{t.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},912714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},980738,(e,t,r)=>{t.exports=e.x("node-pty-c710df912a232c01",()=>require("node-pty-c710df912a232c01"))},572173,e=>{"use strict";var t=e.i(843793);async function r(e,r){let n=await t.db.systemConfig.findUnique({where:{key:e}});if(!n)return r;try{return JSON.parse(n.value)}catch{return r}}e.s(["readConfigValue",0,r])},192520,e=>{"use strict";let t;var r=e.i(750227),n=e.i(660526),a=e.i(666680),s=e.i(902157);function i(){return t||(t=process.env.TOWER_DATA_DIR||(0,r.join)((0,n.homedir)(),".tower"),(0,s.existsSync)(t)||(0,s.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,r.join)(i(),"assistant");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,r.join)(i(),"backups");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,r.join)(i(),"extensions");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getSignalDir",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,n.homedir)(),".tower"),t=(0,a.createHash)("sha256").update(e).digest("hex").slice(0,16);return(0,r.join)((0,n.tmpdir)(),"tower-signals",t)},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,s.readFileSync)((0,r.join)(i(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,r.join)(i(),"storage");return(0,s.existsSync)(t)||(0,s.mkdirSync)(t,{recursive:!0}),t},"getTowerDbFilePath",0,function(){let e=process.env.TOWER_DATA_DIR||(0,r.join)((0,n.homedir)(),".tower");return(0,r.join)(e,"database","tower.db")},"getTowerDbPath",0,function(){let e;return(0,r.join)((e=(0,r.join)(i(),"database"),(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,i])},843793,e=>{"use strict";var t=e.i(933919),r=e.i(192520);let n=globalThis.prisma??new t.PrismaClient({datasourceUrl:`file:${(0,r.getTowerDbFilePath)()}`,log:[]});process.on("SIGTERM",()=>{n.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{n.$disconnect().catch(()=>{})}),e.s(["db",0,n])},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},198840,e=>{"use strict";var t=e.i(855104);let r=["localhost","127.0.0.1","[::1]"],n=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),a=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let a=e.headers.get("x-forwarded-for");if(a&&!a.split(",").map(e=>e.trim()).every(e=>n.has(e)))return t.NextResponse.json({error:"Forbidden"},{status:403});let s=e.headers.get("host")??"";return r.some(e=>s.startsWith(e))?null:t.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return a.test(e)?null:t.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return a.test(e)?null:t.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},108789,e=>{"use strict";var t=e.i(843793);async function r(e){let r="ask"===e.kind?"OPEN":"CLOSED";return{messageId:(await t.db.harnessMessage.create({data:{taskId:e.taskId,executionId:e.executionId??null,kind:e.kind,content:e.content,state:r}})).id}}async function n(e){await o(e.taskId);let{messageId:n}=await r({taskId:e.taskId,executionId:e.executionId??null,kind:"ask",content:e.question});return{messageId:n,execPaused:(await t.db.taskExecution.updateMany({where:{taskId:e.taskId,status:"RUNNING"},data:{status:"PAUSED"}})).count>0}}async function a(e){return t.db.harnessMessage.findFirst({where:{taskId:e,kind:"ask",state:"OPEN"},orderBy:{createdAt:"desc"}})}async function s(e){return t.db.harnessMessage.findFirst({where:{taskId:e,kind:"ask"},orderBy:{createdAt:"desc"}})}async function i(e,r){return 0===(await t.db.harnessMessage.updateMany({where:{taskId:e,kind:"ask",state:"OPEN"},data:{state:"ANSWERED",replyText:r,repliedAt:new Date}})).count?null:s(e)}async function o(e){return(await t.db.harnessMessage.updateMany({where:{taskId:e,kind:"ask",state:"OPEN"},data:{state:"CANCELLED"}})).count}e.s(["answerOpenAsk",0,i,"cancelOpenAsks",0,o,"createAskMessage",0,n,"getLatestAsk",0,s,"getOpenAsk",0,a,"recordHarnessMessage",0,r])},433541,e=>e.a(async(t,r)=>{try{let t=await e.y("ws-4df7fc762dfa9a52");e.n(t),r()}catch(e){r(e)}},!0),504446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},658053,e=>{"use strict";e.s(["ASSISTANT_SESSION_KEY",0,"__assistant__"])},43510,e=>{"use strict";e.s(["hexTail",0,function(e,t=8){return Array.from(e.slice(-t)).map(e=>e.codePointAt(0).toString(16).padStart(2,"0")).join(" ")},"planTerminalWrite",0,function(e,t){return t?{body:e.replace(/[\r\n]+$/,""),submitKey:"\r"}:{body:e,submitKey:null}}])},329569,e=>{"use strict";var t=e.i(843793),r=e.i(83721),n=e.i(43510);async function a(e,a,s){try{var i;let o=await t.db.task.findUnique({where:{id:e},select:{parentTaskId:!0}}),d=o?.parentTaskId;if(!d)return;let l=(0,r.getSession)(d);if(!l||l.killed)return;let c=(i={childTitle:a,childTaskId:e,childReply:s},"[Tower] 你派生的子任务「{{childTitle}}」(taskId: {{childTaskId}})刚结束一轮、正在等指令 —— 可能完成、也可能没完成。\n\n子任务最后的回复:\n{{childReply}}\n\n请你作为中枢 review:\n1. 若要核实它具体改了什么,用 get_task_terminal_output 读它的终端产出。\n2. 若已正确完成 → stop_task_execution 关闭它 + move_task 置 DONE。\n3. 若没完成 / 有问题 → send_task_terminal_input 给它具体反馈,让它继续改。\n4. 把你的判断与决定用 manage_notes 记录下来,供用户事后查看。".replaceAll("{{childTitle}}",i.childTitle).replaceAll("{{childTaskId}}",i.childTaskId).replaceAll("{{childReply}}",i.childReply.trim()||"(无文本回复)")),{body:u,submitKey:p}=(0,n.planTerminalWrite)(c,!0);u&&l.write(u),p&&setTimeout(()=>{let e=(0,r.getSession)(d);e&&!e.killed&&e.write(p)},80)}catch(e){console.warn("[notify-parent] failed to notify parent task:",e)}}e.s(["notifyParentOnChildStop",0,a],329569)},395436,e=>e.a(async(t,r)=>{try{var n=e.i(855104),a=e.i(198840),s=e.i(843793),i=e.i(721390),o=e.i(329569),d=e.i(108789),l=e.i(83721),c=t([i]);async function u(e){let t,r=(0,a.requireLocalhost)(e);if(r)return r;try{t=await e.json()}catch{return n.NextResponse.json({error:"Invalid JSON"},{status:400})}let{taskId:c,sessionId:u,lastReply:p}=t;if(!c||"string"!=typeof c)return n.NextResponse.json({error:"taskId required"},{status:400});let h=await s.db.task.findUnique({where:{id:c},select:{id:!0,title:!0,project:{select:{name:!0,workspaceId:!0,workspace:{select:{name:!0}}}}}});if(!h)return n.NextResponse.json({error:"Task not found"},{status:404});let f={taskId:h.id,taskTitle:h.title,sessionId:u??"",workspaceId:h.project.workspaceId,workspaceName:h.project.workspace.name,projectName:h.project.name,type:"stop",timestamp:new Date().toISOString()};return((0,i.broadcastNotification)(f),await (0,d.getOpenAsk)(h.id))?((0,l.destroySession)(h.id),n.NextResponse.json({ok:!0,parked:!0})):(await (0,o.notifyParentOnChildStop)(h.id,h.title,p??""),n.NextResponse.json({ok:!0}))}[i]=c.then?(await c)():c,e.s(["POST",0,u,"dynamic",0,"force-dynamic","runtime",0,"nodejs"]),r()}catch(e){r(e)}},!1),835333,e=>e.a(async(t,r)=>{try{var n=e.i(765876),a=e.i(675896),s=e.i(959160),i=e.i(97944),o=e.i(86757),d=e.i(204144),l=e.i(273436),c=e.i(743641),u=e.i(813766),p=e.i(840884),h=e.i(498814),f=e.i(780006),x=e.i(544432),y=e.i(772005),w=e.i(450223),k=e.i(193695);e.i(628400);var m=e.i(800071),g=e.i(395436),v=t([g]);[g]=v.then?(await v)():v;let E=new n.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/internal/hooks/stop/route",pathname:"/api/internal/hooks/stop",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/internal/hooks/stop/route.ts",nextConfigOutput:"standalone",userland:g}),{workAsyncStorage:S,workUnitAsyncStorage:T,serverHooks:A}=E;async function R(e,t,r){r.requestMeta&&(0,i.setRequestMeta)(e,r.requestMeta),E.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/internal/hooks/stop/route";n=n.replace(/\/index$/,"")||"/";let s=await E.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:R,parsedUrl:S,isDraftMode:T,prerenderManifest:A,routerServerContext:I,isOnDemandRevalidate:b,revalidateOnlyGenerated:N,resolvedPathname:j,clientReferenceManifest:_,serverActionsManifest:C}=s,O=(0,l.normalizeAppPath)(n),q=!!(A.dynamicRoutes[O]||A.routes[j]),P=async()=>((null==I?void 0:I.render404)?await I.render404(e,t,S,!1):t.end("This page could not be found"),null);if(q&&!T){let e=!!A.routes[j],t=A.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(R.adapterPath)return await P();throw new k.NoFallbackError}}let D=null;!q||E.isDev||T||(D=j,D="/index"===D?"/":D);let M=!0===E.isDev||!q,U=q&&!M;C&&_&&(0,d.setManifestsSingleton)({page:n,clientReferenceManifest:_,serverActionsManifest:C});let H=e.method||"GET",F=(0,o.getTracer)(),$=F.getActiveScopeSpan(),K=!!(null==I?void 0:I.isWrappedByNextServer),L=!!(0,i.getRequestMeta)(e,"minimalMode"),W=(0,i.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,R,A,L);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let B={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:M,incrementalCache:W,cacheLifeProfiles:R.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>E.onRequestError(e,t,n,a,I)},sharedContext:{buildId:g}},G=new c.NodeNextRequest(e),V=new c.NodeNextResponse(t),X=u.NextRequestAdapter.fromNodeNextRequest(G,(0,u.signalFromNodeResponse)(t));try{let s,i=async e=>E.handle(X,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${H} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",a),s.updateName(t))}else e.updateName(`${H} ${n}`)}),d=async s=>{var o,d;let l=async({previousCacheEntry:a})=>{try{if(!L&&b&&N&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(s);e.fetchMetrics=B.renderOpts.fetchMetrics;let o=B.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let d=B.renderOpts.collectedTags;if(!q)return await (0,f.sendResponse)(G,V,n,B.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(n.headers);d&&(t[w.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=w.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,a=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=w.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==a?void 0:a.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:b})},!1,I),t}},c=await E.handleResponse({req:e,nextConfig:R,cacheKey:D,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:b,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:r.waitUntil,isMinimalMode:L});if(!q)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(d=c.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",b?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,x.fromNodeOutgoingHttpHeaders)(c.value.headers);return L&&q||u.delete(w.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,y.getCacheControlHeader)(c.cacheControl)),await (0,f.sendResponse)(G,V,new Response(c.value.body,{headers:u,status:c.value.status||200})),null};K&&$?await d($):(s=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${H} ${n}`,kind:o.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},d),void 0,!K))}catch(t){if(t instanceof k.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:b})},!1,I),q)throw t;return await (0,f.sendResponse)(G,V,new Response(null,{status:500})),null}}e.s(["handler",0,R,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:T})},"routeModule",0,E,"serverHooks",0,A,"workAsyncStorage",0,S,"workUnitAsyncStorage",0,T]),r()}catch(e){r(e)}},!1)];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0.yf1mx._.js.map
|