@qt4798/pi-web 0.17.7 → 0.17.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +24 -23
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/routes-manifest.json +6 -0
  8. package/.next/server/app/_global-error/page.js +2 -2
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page.js +1 -1
  16. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/_not-found.html +1 -1
  18. package/.next/server/app/_not-found.rsc +2 -2
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  23. package/.next/server/app/api/agent/[id]/events/route.js +3 -3
  24. package/.next/server/app/api/agent/[id]/route.js +1 -1
  25. package/.next/server/app/api/agent/new/route.js +1 -1
  26. package/.next/server/app/api/agent/running/events/route.js +2 -2
  27. package/.next/server/app/api/agent/running/route.js +1 -1
  28. package/.next/server/app/api/app-update/route.js +1 -1
  29. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  30. package/.next/server/app/api/auth/combined/route.js +1 -1
  31. package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  32. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  33. package/.next/server/app/api/auth/providers/route.js +1 -1
  34. package/.next/server/app/api/backup/export/route.js +1 -1
  35. package/.next/server/app/api/backup/import/route.js +1 -1
  36. package/.next/server/app/api/cwd/browse/route.js +1 -1
  37. package/.next/server/app/api/cwd/validate/route.js +1 -1
  38. package/.next/server/app/api/deepseek/balance/route.js +1 -1
  39. package/.next/server/app/api/default-cwd/route.js +1 -1
  40. package/.next/server/app/api/events/route.js +2 -2
  41. package/.next/server/app/api/features/route.js +1 -1
  42. package/.next/server/app/api/file-index/route.js +1 -1
  43. package/.next/server/app/api/files/[...path]/route.js +1 -1
  44. package/.next/server/app/api/git/diff/route.js +2 -2
  45. package/.next/server/app/api/git/push/route.js +1 -1
  46. package/.next/server/app/api/git/stash/route.js +1 -1
  47. package/.next/server/app/api/git/status/route.js +1 -1
  48. package/.next/server/app/api/home/route.js +1 -1
  49. package/.next/server/app/api/import/discover/route.js +1 -1
  50. package/.next/server/app/api/import/execute/route.js +1 -1
  51. package/.next/server/app/api/import/status/route.js +1 -1
  52. package/.next/server/app/api/logs/route.js +1 -1
  53. package/.next/server/app/api/mcp/restart/route.js +1 -1
  54. package/.next/server/app/api/mcp/route.js +2 -2
  55. package/.next/server/app/api/models/route.js +1 -1
  56. package/.next/server/app/api/models-config/builtin/route.js +1 -1
  57. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  58. package/.next/server/app/api/models-config/discover/route.js +1 -1
  59. package/.next/server/app/api/models-config/route.js +1 -1
  60. package/.next/server/app/api/models-config/test/route.js +1 -1
  61. package/.next/server/app/api/modes/route.js +1 -1
  62. package/.next/server/app/api/pair/route.js +1 -0
  63. package/.next/server/app/api/pair/route.js.nft.json +1 -0
  64. package/.next/server/app/api/pair/route_client-reference-manifest.js +1 -0
  65. package/.next/server/app/api/plugins/check/route.js +1 -1
  66. package/.next/server/app/api/plugins/route.js +1 -1
  67. package/.next/server/app/api/project-aliases/route.js +1 -1
  68. package/.next/server/app/api/project-state/route.js +1 -1
  69. package/.next/server/app/api/project-trust/route.js +1 -1
  70. package/.next/server/app/api/projects/visibility/route.js +1 -1
  71. package/.next/server/app/api/proxy/route.js +1 -1
  72. package/.next/server/app/api/proxy/test/route.js +1 -1
  73. package/.next/server/app/api/sessions/[id]/auto-name/route.js +2 -2
  74. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  75. package/.next/server/app/api/sessions/[id]/details/route.js +1 -1
  76. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  77. package/.next/server/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route.js +1 -1
  78. package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
  79. package/.next/server/app/api/sessions/[id]/queue-recovery/route.js +1 -1
  80. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  81. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  82. package/.next/server/app/api/sessions/route.js +1 -1
  83. package/.next/server/app/api/sessions/search/route.js +1 -1
  84. package/.next/server/app/api/settings/title-model/route.js +1 -1
  85. package/.next/server/app/api/skills/check/route.js +1 -1
  86. package/.next/server/app/api/skills/install/route.js +1 -1
  87. package/.next/server/app/api/skills/route.js +1 -1
  88. package/.next/server/app/api/skills/search/route.js +1 -1
  89. package/.next/server/app/api/skills/update/route.js +1 -1
  90. package/.next/server/app/api/snippets/[id]/route.js +1 -1
  91. package/.next/server/app/api/snippets/route.js +1 -1
  92. package/.next/server/app/api/subagents/[id]/route.js +1 -1
  93. package/.next/server/app/api/subagents/profiles/route.js +1 -1
  94. package/.next/server/app/api/subagents/settings/route.js +1 -1
  95. package/.next/server/app/api/tasks/[id]/[action]/route.js +1 -1
  96. package/.next/server/app/api/tasks/[id]/changed-files/route.js +1 -1
  97. package/.next/server/app/api/tasks/[id]/diff/route.js +2 -2
  98. package/.next/server/app/api/tasks/[id]/events/route.js +1 -1
  99. package/.next/server/app/api/tasks/[id]/route.js +1 -1
  100. package/.next/server/app/api/tasks/batch/route.js +1 -1
  101. package/.next/server/app/api/tasks/events/route.js +1 -1
  102. package/.next/server/app/api/tasks/route.js +1 -1
  103. package/.next/server/app/api/tasks/settings/route.js +1 -1
  104. package/.next/server/app/api/tasks/templates/route.js +1 -1
  105. package/.next/server/app/api/terminal/[id]/events/route.js +2 -2
  106. package/.next/server/app/api/terminal/[id]/route.js +1 -1
  107. package/.next/server/app/api/terminal/route.js +1 -1
  108. package/.next/server/app/api/themes/[name]/route.js +1 -1
  109. package/.next/server/app/api/themes/route.js +1 -1
  110. package/.next/server/app/api/tools/extension-tools/route.js +1 -1
  111. package/.next/server/app/api/tools/settings/route.js +1 -1
  112. package/.next/server/app/api/usage/route.js +1 -1
  113. package/.next/server/app/api/vision-config/route.js +1 -1
  114. package/.next/server/app/api/worktrees/route.js +1 -1
  115. package/.next/server/app/icon.ico/route.js +1 -1
  116. package/.next/server/app/icon.png/route.js +1 -1
  117. package/.next/server/app/icon.svg/route.js +1 -1
  118. package/.next/server/app/index.html +1 -1
  119. package/.next/server/app/index.rsc +4 -4
  120. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  121. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  122. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  123. package/.next/server/app/page.js +13 -13
  124. package/.next/server/app/page_client-reference-manifest.js +1 -1
  125. package/.next/server/app-paths-manifest.json +24 -23
  126. package/.next/server/chunks/4154.js +1 -0
  127. package/.next/server/chunks/4253.js +1 -1
  128. package/.next/server/chunks/5582.js +1 -1
  129. package/.next/server/chunks/7915.js +1 -1
  130. package/.next/server/instrumentation.js +1 -1
  131. package/.next/server/instrumentation.js.nft.json +1 -1
  132. package/.next/server/middleware-build-manifest.js +1 -1
  133. package/.next/server/pages/404.html +1 -1
  134. package/.next/server/pages/500.html +1 -1
  135. package/.next/server/server-reference-manifest.json +1 -1
  136. package/.next/static/chunks/{9786-a857d8cac4c6f124.js → 9660-8945dc0e772329fb.js} +1 -1
  137. package/.next/static/chunks/app/_global-error/page-1f18a3ac6ad460ce.js +1 -0
  138. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-1f18a3ac6ad460ce.js +1 -0
  139. package/.next/static/chunks/app/api/agent/[id]/events/route-1f18a3ac6ad460ce.js +1 -0
  140. package/.next/static/chunks/app/api/agent/[id]/route-1f18a3ac6ad460ce.js +1 -0
  141. package/.next/static/chunks/app/api/agent/new/route-1f18a3ac6ad460ce.js +1 -0
  142. package/.next/static/chunks/app/api/agent/running/events/route-1f18a3ac6ad460ce.js +1 -0
  143. package/.next/static/chunks/app/api/agent/running/route-1f18a3ac6ad460ce.js +1 -0
  144. package/.next/static/chunks/app/api/app-update/route-1f18a3ac6ad460ce.js +1 -0
  145. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-1f18a3ac6ad460ce.js +1 -0
  146. package/.next/static/chunks/app/api/auth/combined/route-1f18a3ac6ad460ce.js +1 -0
  147. package/.next/static/chunks/app/api/auth/login/[provider]/route-1f18a3ac6ad460ce.js +1 -0
  148. package/.next/static/chunks/app/api/auth/logout/[provider]/route-1f18a3ac6ad460ce.js +1 -0
  149. package/.next/static/chunks/app/api/auth/providers/route-1f18a3ac6ad460ce.js +1 -0
  150. package/.next/static/chunks/app/api/backup/export/route-1f18a3ac6ad460ce.js +1 -0
  151. package/.next/static/chunks/app/api/backup/import/route-1f18a3ac6ad460ce.js +1 -0
  152. package/.next/static/chunks/app/api/cwd/browse/route-1f18a3ac6ad460ce.js +1 -0
  153. package/.next/static/chunks/app/api/cwd/validate/route-1f18a3ac6ad460ce.js +1 -0
  154. package/.next/static/chunks/app/api/deepseek/balance/route-1f18a3ac6ad460ce.js +1 -0
  155. package/.next/static/chunks/app/api/default-cwd/route-1f18a3ac6ad460ce.js +1 -0
  156. package/.next/static/chunks/app/api/events/route-1f18a3ac6ad460ce.js +1 -0
  157. package/.next/static/chunks/app/api/features/route-1f18a3ac6ad460ce.js +1 -0
  158. package/.next/static/chunks/app/api/file-index/route-1f18a3ac6ad460ce.js +1 -0
  159. package/.next/static/chunks/app/api/files/[...path]/route-1f18a3ac6ad460ce.js +1 -0
  160. package/.next/static/chunks/app/api/git/diff/route-1f18a3ac6ad460ce.js +1 -0
  161. package/.next/static/chunks/app/api/git/push/route-1f18a3ac6ad460ce.js +1 -0
  162. package/.next/static/chunks/app/api/git/stash/route-1f18a3ac6ad460ce.js +1 -0
  163. package/.next/static/chunks/app/api/git/status/route-1f18a3ac6ad460ce.js +1 -0
  164. package/.next/static/chunks/app/api/home/route-1f18a3ac6ad460ce.js +1 -0
  165. package/.next/static/chunks/app/api/import/discover/route-1f18a3ac6ad460ce.js +1 -0
  166. package/.next/static/chunks/app/api/import/execute/route-1f18a3ac6ad460ce.js +1 -0
  167. package/.next/static/chunks/app/api/import/status/route-1f18a3ac6ad460ce.js +1 -0
  168. package/.next/static/chunks/app/api/logs/route-1f18a3ac6ad460ce.js +1 -0
  169. package/.next/static/chunks/app/api/mcp/restart/route-1f18a3ac6ad460ce.js +1 -0
  170. package/.next/static/chunks/app/api/mcp/route-1f18a3ac6ad460ce.js +1 -0
  171. package/.next/static/chunks/app/api/models/route-1f18a3ac6ad460ce.js +1 -0
  172. package/.next/static/chunks/app/api/models-config/builtin/route-1f18a3ac6ad460ce.js +1 -0
  173. package/.next/static/chunks/app/api/models-config/catalog/route-1f18a3ac6ad460ce.js +1 -0
  174. package/.next/static/chunks/app/api/models-config/discover/route-1f18a3ac6ad460ce.js +1 -0
  175. package/.next/static/chunks/app/api/models-config/route-1f18a3ac6ad460ce.js +1 -0
  176. package/.next/static/chunks/app/api/models-config/test/route-1f18a3ac6ad460ce.js +1 -0
  177. package/.next/static/chunks/app/api/modes/route-1f18a3ac6ad460ce.js +1 -0
  178. package/.next/static/chunks/app/api/pair/route-1f18a3ac6ad460ce.js +1 -0
  179. package/.next/static/chunks/app/api/plugins/check/route-1f18a3ac6ad460ce.js +1 -0
  180. package/.next/static/chunks/app/api/plugins/route-1f18a3ac6ad460ce.js +1 -0
  181. package/.next/static/chunks/app/api/project-aliases/route-1f18a3ac6ad460ce.js +1 -0
  182. package/.next/static/chunks/app/api/project-state/route-1f18a3ac6ad460ce.js +1 -0
  183. package/.next/static/chunks/app/api/project-trust/route-1f18a3ac6ad460ce.js +1 -0
  184. package/.next/static/chunks/app/api/projects/visibility/route-1f18a3ac6ad460ce.js +1 -0
  185. package/.next/static/chunks/app/api/proxy/route-1f18a3ac6ad460ce.js +1 -0
  186. package/.next/static/chunks/app/api/proxy/test/route-1f18a3ac6ad460ce.js +1 -0
  187. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-1f18a3ac6ad460ce.js +1 -0
  188. package/.next/static/chunks/app/api/sessions/[id]/context/route-1f18a3ac6ad460ce.js +1 -0
  189. package/.next/static/chunks/app/api/sessions/[id]/details/route-1f18a3ac6ad460ce.js +1 -0
  190. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-1f18a3ac6ad460ce.js +1 -0
  191. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-1f18a3ac6ad460ce.js +1 -0
  192. package/.next/static/chunks/app/api/sessions/[id]/export/route-1f18a3ac6ad460ce.js +1 -0
  193. package/.next/static/chunks/app/api/sessions/[id]/queue-recovery/route-1f18a3ac6ad460ce.js +1 -0
  194. package/.next/static/chunks/app/api/sessions/[id]/route-1f18a3ac6ad460ce.js +1 -0
  195. package/.next/static/chunks/app/api/sessions/[id]/state/route-1f18a3ac6ad460ce.js +1 -0
  196. package/.next/static/chunks/app/api/sessions/route-1f18a3ac6ad460ce.js +1 -0
  197. package/.next/static/chunks/app/api/sessions/search/route-1f18a3ac6ad460ce.js +1 -0
  198. package/.next/static/chunks/app/api/settings/title-model/route-1f18a3ac6ad460ce.js +1 -0
  199. package/.next/static/chunks/app/api/skills/check/route-1f18a3ac6ad460ce.js +1 -0
  200. package/.next/static/chunks/app/api/skills/install/route-1f18a3ac6ad460ce.js +1 -0
  201. package/.next/static/chunks/app/api/skills/route-1f18a3ac6ad460ce.js +1 -0
  202. package/.next/static/chunks/app/api/skills/search/route-1f18a3ac6ad460ce.js +1 -0
  203. package/.next/static/chunks/app/api/skills/update/route-1f18a3ac6ad460ce.js +1 -0
  204. package/.next/static/chunks/app/api/snippets/[id]/route-1f18a3ac6ad460ce.js +1 -0
  205. package/.next/static/chunks/app/api/snippets/route-1f18a3ac6ad460ce.js +1 -0
  206. package/.next/static/chunks/app/api/subagents/[id]/route-1f18a3ac6ad460ce.js +1 -0
  207. package/.next/static/chunks/app/api/subagents/profiles/route-1f18a3ac6ad460ce.js +1 -0
  208. package/.next/static/chunks/app/api/subagents/settings/route-1f18a3ac6ad460ce.js +1 -0
  209. package/.next/static/chunks/app/api/tasks/[id]/[action]/route-1f18a3ac6ad460ce.js +1 -0
  210. package/.next/static/chunks/app/api/tasks/[id]/changed-files/route-1f18a3ac6ad460ce.js +1 -0
  211. package/.next/static/chunks/app/api/tasks/[id]/diff/route-1f18a3ac6ad460ce.js +1 -0
  212. package/.next/static/chunks/app/api/tasks/[id]/events/route-1f18a3ac6ad460ce.js +1 -0
  213. package/.next/static/chunks/app/api/tasks/[id]/route-1f18a3ac6ad460ce.js +1 -0
  214. package/.next/static/chunks/app/api/tasks/batch/route-1f18a3ac6ad460ce.js +1 -0
  215. package/.next/static/chunks/app/api/tasks/events/route-1f18a3ac6ad460ce.js +1 -0
  216. package/.next/static/chunks/app/api/tasks/route-1f18a3ac6ad460ce.js +1 -0
  217. package/.next/static/chunks/app/api/tasks/settings/route-1f18a3ac6ad460ce.js +1 -0
  218. package/.next/static/chunks/app/api/tasks/templates/route-1f18a3ac6ad460ce.js +1 -0
  219. package/.next/static/chunks/app/api/terminal/[id]/events/route-1f18a3ac6ad460ce.js +1 -0
  220. package/.next/static/chunks/app/api/terminal/[id]/route-1f18a3ac6ad460ce.js +1 -0
  221. package/.next/static/chunks/app/api/terminal/route-1f18a3ac6ad460ce.js +1 -0
  222. package/.next/static/chunks/app/api/themes/[name]/route-1f18a3ac6ad460ce.js +1 -0
  223. package/.next/static/chunks/app/api/themes/route-1f18a3ac6ad460ce.js +1 -0
  224. package/.next/static/chunks/app/api/tools/extension-tools/route-1f18a3ac6ad460ce.js +1 -0
  225. package/.next/static/chunks/app/api/tools/settings/route-1f18a3ac6ad460ce.js +1 -0
  226. package/.next/static/chunks/app/api/usage/route-1f18a3ac6ad460ce.js +1 -0
  227. package/.next/static/chunks/app/api/vision-config/route-1f18a3ac6ad460ce.js +1 -0
  228. package/.next/static/chunks/app/api/worktrees/route-1f18a3ac6ad460ce.js +1 -0
  229. package/.next/static/chunks/app/page-4dc15b51da9c8fc9.js +206 -0
  230. package/.next/static/chunks/next/dist/client/components/builtin/app-error-1f18a3ac6ad460ce.js +1 -0
  231. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-1f18a3ac6ad460ce.js +1 -0
  232. package/.next/static/chunks/next/dist/client/components/builtin/not-found-1f18a3ac6ad460ce.js +1 -0
  233. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-1f18a3ac6ad460ce.js +1 -0
  234. package/.next/static/css/cc02ff1fe55740e5.css +1 -0
  235. package/.next/static/vOqofO6dUkQhxJHaAA5d2/_buildManifest.js +1 -0
  236. package/.next/trace +7 -83
  237. package/.next/trace-build +1 -1
  238. package/.next/types/app/api/pair/route.ts +353 -0
  239. package/.next/types/routes.d.ts +2 -1
  240. package/.next/types/validator.ts +9 -0
  241. package/package.json +3 -1
  242. package/.next/static/chunks/app/_global-error/page-cfe3af3c88e8502f.js +0 -1
  243. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-cfe3af3c88e8502f.js +0 -1
  244. package/.next/static/chunks/app/api/agent/[id]/events/route-cfe3af3c88e8502f.js +0 -1
  245. package/.next/static/chunks/app/api/agent/[id]/route-cfe3af3c88e8502f.js +0 -1
  246. package/.next/static/chunks/app/api/agent/new/route-cfe3af3c88e8502f.js +0 -1
  247. package/.next/static/chunks/app/api/agent/running/events/route-cfe3af3c88e8502f.js +0 -1
  248. package/.next/static/chunks/app/api/agent/running/route-cfe3af3c88e8502f.js +0 -1
  249. package/.next/static/chunks/app/api/app-update/route-cfe3af3c88e8502f.js +0 -1
  250. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-cfe3af3c88e8502f.js +0 -1
  251. package/.next/static/chunks/app/api/auth/combined/route-cfe3af3c88e8502f.js +0 -1
  252. package/.next/static/chunks/app/api/auth/login/[provider]/route-cfe3af3c88e8502f.js +0 -1
  253. package/.next/static/chunks/app/api/auth/logout/[provider]/route-cfe3af3c88e8502f.js +0 -1
  254. package/.next/static/chunks/app/api/auth/providers/route-cfe3af3c88e8502f.js +0 -1
  255. package/.next/static/chunks/app/api/backup/export/route-cfe3af3c88e8502f.js +0 -1
  256. package/.next/static/chunks/app/api/backup/import/route-cfe3af3c88e8502f.js +0 -1
  257. package/.next/static/chunks/app/api/cwd/browse/route-cfe3af3c88e8502f.js +0 -1
  258. package/.next/static/chunks/app/api/cwd/validate/route-cfe3af3c88e8502f.js +0 -1
  259. package/.next/static/chunks/app/api/deepseek/balance/route-cfe3af3c88e8502f.js +0 -1
  260. package/.next/static/chunks/app/api/default-cwd/route-cfe3af3c88e8502f.js +0 -1
  261. package/.next/static/chunks/app/api/events/route-cfe3af3c88e8502f.js +0 -1
  262. package/.next/static/chunks/app/api/features/route-cfe3af3c88e8502f.js +0 -1
  263. package/.next/static/chunks/app/api/file-index/route-cfe3af3c88e8502f.js +0 -1
  264. package/.next/static/chunks/app/api/files/[...path]/route-cfe3af3c88e8502f.js +0 -1
  265. package/.next/static/chunks/app/api/git/diff/route-cfe3af3c88e8502f.js +0 -1
  266. package/.next/static/chunks/app/api/git/push/route-cfe3af3c88e8502f.js +0 -1
  267. package/.next/static/chunks/app/api/git/stash/route-cfe3af3c88e8502f.js +0 -1
  268. package/.next/static/chunks/app/api/git/status/route-cfe3af3c88e8502f.js +0 -1
  269. package/.next/static/chunks/app/api/home/route-cfe3af3c88e8502f.js +0 -1
  270. package/.next/static/chunks/app/api/import/discover/route-cfe3af3c88e8502f.js +0 -1
  271. package/.next/static/chunks/app/api/import/execute/route-cfe3af3c88e8502f.js +0 -1
  272. package/.next/static/chunks/app/api/import/status/route-cfe3af3c88e8502f.js +0 -1
  273. package/.next/static/chunks/app/api/logs/route-cfe3af3c88e8502f.js +0 -1
  274. package/.next/static/chunks/app/api/mcp/restart/route-cfe3af3c88e8502f.js +0 -1
  275. package/.next/static/chunks/app/api/mcp/route-cfe3af3c88e8502f.js +0 -1
  276. package/.next/static/chunks/app/api/models/route-cfe3af3c88e8502f.js +0 -1
  277. package/.next/static/chunks/app/api/models-config/builtin/route-cfe3af3c88e8502f.js +0 -1
  278. package/.next/static/chunks/app/api/models-config/catalog/route-cfe3af3c88e8502f.js +0 -1
  279. package/.next/static/chunks/app/api/models-config/discover/route-cfe3af3c88e8502f.js +0 -1
  280. package/.next/static/chunks/app/api/models-config/route-cfe3af3c88e8502f.js +0 -1
  281. package/.next/static/chunks/app/api/models-config/test/route-cfe3af3c88e8502f.js +0 -1
  282. package/.next/static/chunks/app/api/modes/route-cfe3af3c88e8502f.js +0 -1
  283. package/.next/static/chunks/app/api/plugins/check/route-cfe3af3c88e8502f.js +0 -1
  284. package/.next/static/chunks/app/api/plugins/route-cfe3af3c88e8502f.js +0 -1
  285. package/.next/static/chunks/app/api/project-aliases/route-cfe3af3c88e8502f.js +0 -1
  286. package/.next/static/chunks/app/api/project-state/route-cfe3af3c88e8502f.js +0 -1
  287. package/.next/static/chunks/app/api/project-trust/route-cfe3af3c88e8502f.js +0 -1
  288. package/.next/static/chunks/app/api/projects/visibility/route-cfe3af3c88e8502f.js +0 -1
  289. package/.next/static/chunks/app/api/proxy/route-cfe3af3c88e8502f.js +0 -1
  290. package/.next/static/chunks/app/api/proxy/test/route-cfe3af3c88e8502f.js +0 -1
  291. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-cfe3af3c88e8502f.js +0 -1
  292. package/.next/static/chunks/app/api/sessions/[id]/context/route-cfe3af3c88e8502f.js +0 -1
  293. package/.next/static/chunks/app/api/sessions/[id]/details/route-cfe3af3c88e8502f.js +0 -1
  294. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-cfe3af3c88e8502f.js +0 -1
  295. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-cfe3af3c88e8502f.js +0 -1
  296. package/.next/static/chunks/app/api/sessions/[id]/export/route-cfe3af3c88e8502f.js +0 -1
  297. package/.next/static/chunks/app/api/sessions/[id]/queue-recovery/route-cfe3af3c88e8502f.js +0 -1
  298. package/.next/static/chunks/app/api/sessions/[id]/route-cfe3af3c88e8502f.js +0 -1
  299. package/.next/static/chunks/app/api/sessions/[id]/state/route-cfe3af3c88e8502f.js +0 -1
  300. package/.next/static/chunks/app/api/sessions/route-cfe3af3c88e8502f.js +0 -1
  301. package/.next/static/chunks/app/api/sessions/search/route-cfe3af3c88e8502f.js +0 -1
  302. package/.next/static/chunks/app/api/settings/title-model/route-cfe3af3c88e8502f.js +0 -1
  303. package/.next/static/chunks/app/api/skills/check/route-cfe3af3c88e8502f.js +0 -1
  304. package/.next/static/chunks/app/api/skills/install/route-cfe3af3c88e8502f.js +0 -1
  305. package/.next/static/chunks/app/api/skills/route-cfe3af3c88e8502f.js +0 -1
  306. package/.next/static/chunks/app/api/skills/search/route-cfe3af3c88e8502f.js +0 -1
  307. package/.next/static/chunks/app/api/skills/update/route-cfe3af3c88e8502f.js +0 -1
  308. package/.next/static/chunks/app/api/snippets/[id]/route-cfe3af3c88e8502f.js +0 -1
  309. package/.next/static/chunks/app/api/snippets/route-cfe3af3c88e8502f.js +0 -1
  310. package/.next/static/chunks/app/api/subagents/[id]/route-cfe3af3c88e8502f.js +0 -1
  311. package/.next/static/chunks/app/api/subagents/profiles/route-cfe3af3c88e8502f.js +0 -1
  312. package/.next/static/chunks/app/api/subagents/settings/route-cfe3af3c88e8502f.js +0 -1
  313. package/.next/static/chunks/app/api/tasks/[id]/[action]/route-cfe3af3c88e8502f.js +0 -1
  314. package/.next/static/chunks/app/api/tasks/[id]/changed-files/route-cfe3af3c88e8502f.js +0 -1
  315. package/.next/static/chunks/app/api/tasks/[id]/diff/route-cfe3af3c88e8502f.js +0 -1
  316. package/.next/static/chunks/app/api/tasks/[id]/events/route-cfe3af3c88e8502f.js +0 -1
  317. package/.next/static/chunks/app/api/tasks/[id]/route-cfe3af3c88e8502f.js +0 -1
  318. package/.next/static/chunks/app/api/tasks/batch/route-cfe3af3c88e8502f.js +0 -1
  319. package/.next/static/chunks/app/api/tasks/events/route-cfe3af3c88e8502f.js +0 -1
  320. package/.next/static/chunks/app/api/tasks/route-cfe3af3c88e8502f.js +0 -1
  321. package/.next/static/chunks/app/api/tasks/settings/route-cfe3af3c88e8502f.js +0 -1
  322. package/.next/static/chunks/app/api/tasks/templates/route-cfe3af3c88e8502f.js +0 -1
  323. package/.next/static/chunks/app/api/terminal/[id]/events/route-cfe3af3c88e8502f.js +0 -1
  324. package/.next/static/chunks/app/api/terminal/[id]/route-cfe3af3c88e8502f.js +0 -1
  325. package/.next/static/chunks/app/api/terminal/route-cfe3af3c88e8502f.js +0 -1
  326. package/.next/static/chunks/app/api/themes/[name]/route-cfe3af3c88e8502f.js +0 -1
  327. package/.next/static/chunks/app/api/themes/route-cfe3af3c88e8502f.js +0 -1
  328. package/.next/static/chunks/app/api/tools/extension-tools/route-cfe3af3c88e8502f.js +0 -1
  329. package/.next/static/chunks/app/api/tools/settings/route-cfe3af3c88e8502f.js +0 -1
  330. package/.next/static/chunks/app/api/usage/route-cfe3af3c88e8502f.js +0 -1
  331. package/.next/static/chunks/app/api/vision-config/route-cfe3af3c88e8502f.js +0 -1
  332. package/.next/static/chunks/app/api/worktrees/route-cfe3af3c88e8502f.js +0 -1
  333. package/.next/static/chunks/app/page-f572e8cb1d35be40.js +0 -206
  334. package/.next/static/chunks/next/dist/client/components/builtin/app-error-cfe3af3c88e8502f.js +0 -1
  335. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-cfe3af3c88e8502f.js +0 -1
  336. package/.next/static/chunks/next/dist/client/components/builtin/not-found-cfe3af3c88e8502f.js +0 -1
  337. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cfe3af3c88e8502f.js +0 -1
  338. package/.next/static/css/69b56227f1fefbb0.css +0 -1
  339. package/.next/static/lh89q_egAarSwgB6HxUCx/_buildManifest.js +0 -1
  340. /package/.next/static/{lh89q_egAarSwgB6HxUCx → vOqofO6dUkQhxJHaAA5d2}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=4524,a.ids=[4524],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},10847:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>j,GET:()=>h,POST:()=>i,dynamic:()=>f,runtime:()=>g});var d=c(23211),e=c(90584);let f="force-dynamic",g="nodejs";async function h(a,{params:b}){let{id:c}=await b,f=(0,e.Bb)(c);return f?d.NextResponse.json({id:c,cwd:f}):d.NextResponse.json({error:"Terminal expired or closed"},{status:404})}async function i(a,{params:b}){try{let{id:c}=await b,f=await a.json();if("input"===f.type&&"string"==typeof f.data&&f.data.length<=65536)return(0,e.OA)(c,f.data)?d.NextResponse.json({success:!0}):d.NextResponse.json({error:"Terminal not found"},{status:404});if("resize"===f.type&&Number.isInteger(f.cols)&&Number.isInteger(f.rows)&&f.cols>=2&&f.cols<=1e3&&f.rows>=2&&f.rows<=1e3)return(0,e.Nu)(c,f.cols,f.rows)?d.NextResponse.json({success:!0}):d.NextResponse.json({error:"Terminal not found"},{status:404});return d.NextResponse.json({error:"Invalid terminal command"},{status:400})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a,{params:b}){let{id:c}=await b;return(0,e.BY)(c),d.NextResponse.json({success:!0})}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},58864:(a,b,c)=>{"use strict";c.d(b,{A_:()=>h,Eb:()=>k,W3:()=>j,gB:()=>i,pJ:()=>g,uK:()=>f});var d=c(33873);let e=/^[a-zA-Z]:[\\/]/;function f(a){return e.test(a)||a.startsWith("\\\\")||a.startsWith("//")}function g(a){let b=a.trim().match(/^([a-zA-Z]):(?:[\\/](.*))?$/);if(b){let a=b[1].toLowerCase(),c=(b[2]??"").replace(/\\/g,"/");return c?`/mnt/${a}/${c}`:`/mnt/${a}`}return a}function h(a){let b=a.join("/"),c=j(b);return/^[a-zA-Z]:$/.test(c)?`${c}/`:f(c)?c:"/"+b.replace(/^\/+/,"")}function i(a){return a&&"win32"===process.platform?(0,d.normalize)(a):a}function j(a){return a.replace(/\\/g,"/")}function k(a,b){return a===b||!!a&&!!b&&"win32"===process.platform&&i(a).toLowerCase()===i(b).toLowerCase()}},62288:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/terminal/[id]/route",pathname:"/api/terminal/[id]",filename:"route",bundlePath:"app/api/terminal/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/terminal/[id]/route.ts",nextConfigOutput:"standalone",userland:()=>c(10847),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/terminal/[id]/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90584:(a,b,c)=>{"use strict";c.d(b,{PB:()=>l,Bb:()=>n,hr:()=>m,BY:()=>r,Nu:()=>q,BJ:()=>o,OA:()=>p});var d=c(55511),e=c(21820);let f=require("node-pty");var g=c(58864);function h(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())r(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}function i(a,b){for(let c of a.listeners)c(b)}function j(a,b){b.cleanupTimer||b.listeners.size||h().get(a)!==b||(b.cleanupTimer=setTimeout(()=>r(a),12e4),b.cleanupTimer.unref?.())}function k(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function l(a,b,c,m=(0,d.randomUUID)()){let n=h().get(m);if(n){if(!(0,g.Eb)(n.cwd,a))throw Error("Terminal belongs to a different workspace");return m}let o="win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh",p="win32"===process.platform?[]:["-l"],q=(0,f.spawn)(o,p,{name:"xterm-256color",cols:k(b,80),rows:k(c,24),cwd:a||(0,e.homedir)(),env:function(){let a={};for(let[b,c]of Object.entries(process.env))void 0!==c&&(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",a}()}),r={pty:q,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return h().set(m,r),j(m,r),q.onData(a=>{r.backlog=(r.backlog+a).slice(-131072),r.offset+=a.length,i(r,{type:"output",data:a,offset:r.offset})}),q.onExit(({exitCode:a})=>{r.cleanupTimer&&clearTimeout(r.cleanupTimer),r.cleanupTimer=null,r.exited=!0,r.exitCode=a,i(r,{type:"exit",exitCode:a}),j(m,r)}),m}function m(a){return h().has(a)}function n(a){return h().get(a)?.cwd}function o(a,b,c){let d=h().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),j(a,d)}}}function p(a,b){let c=h().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function q(a,b,c){let d=h().get(a);return!!d&&!d.exited&&(d.pty.resize(k(b,80),k(c,24)),!0)}function r(a,b=!1){let c=h().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),h().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),i(c,{type:"closed"}),c.listeners.clear(),!0)}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=62288));module.exports=c})();
1
+ (()=>{var a={};a.id=4524,a.ids=[4524],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},10847:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>j,GET:()=>h,POST:()=>i,dynamic:()=>f,runtime:()=>g});var d=c(23211),e=c(90584);let f="force-dynamic",g="nodejs";async function h(a,{params:b}){let{id:c}=await b,f=(0,e.Bb)(c);return f?d.NextResponse.json({id:c,cwd:f}):d.NextResponse.json({error:"Terminal expired or closed"},{status:404})}async function i(a,{params:b}){try{let{id:c}=await b,f=await a.json();if("input"===f.type&&"string"==typeof f.data&&f.data.length<=65536)return(0,e.OA)(c,f.data)?d.NextResponse.json({success:!0}):d.NextResponse.json({error:"Terminal not found"},{status:404});if("resize"===f.type&&Number.isInteger(f.cols)&&Number.isInteger(f.rows)&&f.cols>=2&&f.cols<=1e3&&f.rows>=2&&f.rows<=1e3)return(0,e.Nu)(c,f.cols,f.rows)?d.NextResponse.json({success:!0}):d.NextResponse.json({error:"Terminal not found"},{status:404});return d.NextResponse.json({error:"Invalid terminal command"},{status:400})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a,{params:b}){let{id:c}=await b;return(0,e.BY)(c),d.NextResponse.json({success:!0})}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},28360:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/terminal/[id]/route",pathname:"/api/terminal/[id]",filename:"route",bundlePath:"app/api/terminal/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/terminal/[id]/route.ts",nextConfigOutput:"standalone",userland:()=>c(10847),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/terminal/[id]/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},58864:(a,b,c)=>{"use strict";c.d(b,{A_:()=>h,Eb:()=>k,W3:()=>j,gB:()=>i,pJ:()=>g,uK:()=>f});var d=c(33873);let e=/^[a-zA-Z]:[\\/]/;function f(a){return e.test(a)||a.startsWith("\\\\")||a.startsWith("//")}function g(a){let b=a.trim().match(/^([a-zA-Z]):(?:[\\/](.*))?$/);if(b){let a=b[1].toLowerCase(),c=(b[2]??"").replace(/\\/g,"/");return c?`/mnt/${a}/${c}`:`/mnt/${a}`}return a}function h(a){let b=a.join("/"),c=j(b);return/^[a-zA-Z]:$/.test(c)?`${c}/`:f(c)?c:"/"+b.replace(/^\/+/,"")}function i(a){return a&&"win32"===process.platform?(0,d.normalize)(a):a}function j(a){return a.replace(/\\/g,"/")}function k(a,b){return a===b||!!a&&!!b&&"win32"===process.platform&&i(a).toLowerCase()===i(b).toLowerCase()}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90584:(a,b,c)=>{"use strict";c.d(b,{PB:()=>l,Bb:()=>n,hr:()=>m,BY:()=>r,Nu:()=>q,BJ:()=>o,OA:()=>p});var d=c(55511),e=c(21820);let f=require("node-pty");var g=c(58864);function h(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())r(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}function i(a,b){for(let c of a.listeners)c(b)}function j(a,b){b.cleanupTimer||b.listeners.size||h().get(a)!==b||(b.cleanupTimer=setTimeout(()=>r(a),12e4),b.cleanupTimer.unref?.())}function k(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function l(a,b,c,m=(0,d.randomUUID)()){let n=h().get(m);if(n){if(!(0,g.Eb)(n.cwd,a))throw Error("Terminal belongs to a different workspace");return m}let o="win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh",p="win32"===process.platform?[]:["-l"],q=(0,f.spawn)(o,p,{name:"xterm-256color",cols:k(b,80),rows:k(c,24),cwd:a||(0,e.homedir)(),env:function(){let a={};for(let[b,c]of Object.entries(process.env))void 0!==c&&(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",a}()}),r={pty:q,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return h().set(m,r),j(m,r),q.onData(a=>{r.backlog=(r.backlog+a).slice(-131072),r.offset+=a.length,i(r,{type:"output",data:a,offset:r.offset})}),q.onExit(({exitCode:a})=>{r.cleanupTimer&&clearTimeout(r.cleanupTimer),r.cleanupTimer=null,r.exited=!0,r.exitCode=a,i(r,{type:"exit",exitCode:a}),j(m,r)}),m}function m(a){return h().has(a)}function n(a){return h().get(a)?.cwd}function o(a,b,c){let d=h().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),j(a,d)}}}function p(a,b){let c=h().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function q(a,b,c){let d=h().get(a);return!!d&&!d.exited&&(d.pty.resize(k(b,80),k(c,24)),!0)}function r(a,b=!1){let c=h().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),h().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),i(c,{type:"closed"}),c.listeners.clear(),!0)}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=28360));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=2614,a.ids=[2614],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47709:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>l,runtime:()=>m});var e=c(79748),f=c(33873),g=c(23211),h=c(80547),i=c(90584),j=a([h]);h=(j.then?(await j)():j)[0];let l="force-dynamic",m="nodejs";async function k(a){try{let b=await a.json();if(void 0!==b.id&&("string"!=typeof b.id||!/^[a-f0-9]{32}$/.test(b.id)))return g.NextResponse.json({error:"Invalid terminal id"},{status:400});if("string"!=typeof b.cwd||!b.cwd.trim())return g.NextResponse.json({error:"cwd required"},{status:400});let c=(0,f.resolve)(b.cwd);if(!(await (0,e.stat)(c)).isDirectory())return g.NextResponse.json({error:"cwd must be a directory"},{status:400});let d=await (0,h.mc)();if(!(0,h.B7)(c,d))return g.NextResponse.json({error:"Access denied"},{status:403});let j=(0,i.PB)(c,"number"==typeof b.cols?b.cols:80,"number"==typeof b.rows?b.rows:24,b.id);return g.NextResponse.json({id:j})}catch(a){return g.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},62184:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/terminal/route",pathname:"/api/terminal",filename:"route",bundlePath:"app/api/terminal/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/terminal/route.ts",nextConfigOutput:"standalone",userland:()=>c(47709),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/terminal/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,mc:()=>n,uK:()=>l.uK,wz:()=>i.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(25252),j=c(82536),k=c(40402),l=c(58864),m=a([k]);async function n(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,k.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,i.Nw)(a.cwd)),a.projectRoot&&d.add((0,i.Nw)(a.projectRoot));try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^pi-cwd-\d{8}$/.test(a)&&d.add((0,i.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,i.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function o(a,b){return(0,j.o)(a,b)}function p(a,b){return(0,j.x)(a,b)}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90584:(a,b,c)=>{c.d(b,{PB:()=>l,Bb:()=>n,hr:()=>m,BY:()=>r,Nu:()=>q,BJ:()=>o,OA:()=>p});var d=c(55511),e=c(21820);let f=require("node-pty");var g=c(58864);function h(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())r(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}function i(a,b){for(let c of a.listeners)c(b)}function j(a,b){b.cleanupTimer||b.listeners.size||h().get(a)!==b||(b.cleanupTimer=setTimeout(()=>r(a),12e4),b.cleanupTimer.unref?.())}function k(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function l(a,b,c,m=(0,d.randomUUID)()){let n=h().get(m);if(n){if(!(0,g.Eb)(n.cwd,a))throw Error("Terminal belongs to a different workspace");return m}let o="win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh",p="win32"===process.platform?[]:["-l"],q=(0,f.spawn)(o,p,{name:"xterm-256color",cols:k(b,80),rows:k(c,24),cwd:a||(0,e.homedir)(),env:function(){let a={};for(let[b,c]of Object.entries(process.env))void 0!==c&&(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",a}()}),r={pty:q,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return h().set(m,r),j(m,r),q.onData(a=>{r.backlog=(r.backlog+a).slice(-131072),r.offset+=a.length,i(r,{type:"output",data:a,offset:r.offset})}),q.onExit(({exitCode:a})=>{r.cleanupTimer&&clearTimeout(r.cleanupTimer),r.cleanupTimer=null,r.exited=!0,r.exitCode=a,i(r,{type:"exit",exitCode:a}),j(m,r)}),m}function m(a){return h().has(a)}function n(a){return h().get(a)?.cwd}function o(a,b,c){let d=h().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),j(a,d)}}}function p(a,b){let c=h().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function q(a,b,c){let d=h().get(a);return!!d&&!d.exited&&(d.pty.resize(k(b,80),k(c,24)),!0)}function r(a,b=!1){let c=h().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),h().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),i(c,{type:"closed"}),c.listeners.clear(),!0)}},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=62184));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=2614,a.ids=[2614],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29376:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/terminal/route",pathname:"/api/terminal",filename:"route",bundlePath:"app/api/terminal/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/terminal/route.ts",nextConfigOutput:"standalone",userland:()=>c(47709),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/terminal/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47709:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>l,runtime:()=>m});var e=c(79748),f=c(33873),g=c(23211),h=c(80547),i=c(90584),j=a([h]);h=(j.then?(await j)():j)[0];let l="force-dynamic",m="nodejs";async function k(a){try{let b=await a.json();if(void 0!==b.id&&("string"!=typeof b.id||!/^[a-f0-9]{32}$/.test(b.id)))return g.NextResponse.json({error:"Invalid terminal id"},{status:400});if("string"!=typeof b.cwd||!b.cwd.trim())return g.NextResponse.json({error:"cwd required"},{status:400});let c=(0,f.resolve)(b.cwd);if(!(await (0,e.stat)(c)).isDirectory())return g.NextResponse.json({error:"cwd must be a directory"},{status:400});let d=await (0,h.mc)();if(!(0,h.B7)(c,d))return g.NextResponse.json({error:"Access denied"},{status:403});let j=(0,i.PB)(c,"number"==typeof b.cols?b.cols:80,"number"==typeof b.rows?b.rows:24,b.id);return g.NextResponse.json({id:j})}catch(a){return g.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,mc:()=>n,uK:()=>l.uK,wz:()=>i.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(25252),j=c(82536),k=c(40402),l=c(58864),m=a([k]);async function n(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,k.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,i.Nw)(a.cwd)),a.projectRoot&&d.add((0,i.Nw)(a.projectRoot));try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^pi-cwd-\d{8}$/.test(a)&&d.add((0,i.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,i.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function o(a,b){return(0,j.o)(a,b)}function p(a,b){return(0,j.x)(a,b)}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90584:(a,b,c)=>{c.d(b,{PB:()=>l,Bb:()=>n,hr:()=>m,BY:()=>r,Nu:()=>q,BJ:()=>o,OA:()=>p});var d=c(55511),e=c(21820);let f=require("node-pty");var g=c(58864);function h(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())r(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}function i(a,b){for(let c of a.listeners)c(b)}function j(a,b){b.cleanupTimer||b.listeners.size||h().get(a)!==b||(b.cleanupTimer=setTimeout(()=>r(a),12e4),b.cleanupTimer.unref?.())}function k(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function l(a,b,c,m=(0,d.randomUUID)()){let n=h().get(m);if(n){if(!(0,g.Eb)(n.cwd,a))throw Error("Terminal belongs to a different workspace");return m}let o="win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh",p="win32"===process.platform?[]:["-l"],q=(0,f.spawn)(o,p,{name:"xterm-256color",cols:k(b,80),rows:k(c,24),cwd:a||(0,e.homedir)(),env:function(){let a={};for(let[b,c]of Object.entries(process.env))void 0!==c&&(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",a}()}),r={pty:q,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return h().set(m,r),j(m,r),q.onData(a=>{r.backlog=(r.backlog+a).slice(-131072),r.offset+=a.length,i(r,{type:"output",data:a,offset:r.offset})}),q.onExit(({exitCode:a})=>{r.cleanupTimer&&clearTimeout(r.cleanupTimer),r.cleanupTimer=null,r.exited=!0,r.exitCode=a,i(r,{type:"exit",exitCode:a}),j(m,r)}),m}function m(a){return h().has(a)}function n(a){return h().get(a)?.cwd}function o(a,b,c){let d=h().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),j(a,d)}}}function p(a,b){let c=h().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function q(a,b,c){let d=h().get(a);return!!d&&!d.exited&&(d.pty.resize(k(b,80),k(c,24)),!0)}function r(a,b=!1){let c=h().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),h().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),i(c,{type:"closed"}),c.listeners.clear(),!0)}},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=29376));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=8380,a.ids=[8380],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20936:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/themes/[name]/route",pathname:"/api/themes/[name]",filename:"route",bundlePath:"app/api/themes/[name]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/themes/[name]/route.ts",nextConfigOutput:"standalone",userland:()=>c(36855),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/themes/[name]/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},36855:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>f});var d=c(23211),e=c(16593);async function f(a,{params:b}){try{let{name:c}=await b,{searchParams:f}=new URL(a.url),g=f.get("cwd")||void 0,h=f.get("mode")||"dark",i=(0,e.eW)(decodeURIComponent(c),"light"===h?"light":"dark",g);if(!i)return d.NextResponse.json({error:`Theme "${c}" variant "${h}" not found`},{status:404});return d.NextResponse.json(i)}catch(a){return console.error("Failed to resolve theme:",a),d.NextResponse.json({error:"Failed to resolve theme"},{status:500})}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,1213],()=>b(b.s=20936));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=8380,a.ids=[8380],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},36855:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>f});var d=c(23211),e=c(16593);async function f(a,{params:b}){try{let{name:c}=await b,{searchParams:f}=new URL(a.url),g=f.get("cwd")||void 0,h=f.get("mode")||"dark",i=(0,e.eW)(decodeURIComponent(c),"light"===h?"light":"dark",g);if(!i)return d.NextResponse.json({error:`Theme "${c}" variant "${h}" not found`},{status:404});return d.NextResponse.json(i)}catch(a){return console.error("Failed to resolve theme:",a),d.NextResponse.json({error:"Failed to resolve theme"},{status:500})}}},43296:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/themes/[name]/route",pathname:"/api/themes/[name]",filename:"route",bundlePath:"app/api/themes/[name]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/themes/[name]/route.ts",nextConfigOutput:"standalone",userland:()=>c(36855),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/themes/[name]/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,1213],()=>b(b.s=43296));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=8504,a.ids=[8504],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31400:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/themes/route",pathname:"/api/themes",filename:"route",bundlePath:"app/api/themes/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/themes/route.ts",nextConfigOutput:"standalone",userland:()=>c(68971),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/themes/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68971:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>f});var d=c(23211),e=c(16593);async function f(a){try{let{searchParams:b}=new URL(a.url),c=b.get("cwd")||void 0,f="light"!==b.get("mode"),g=(0,e.pj)(c,f);return d.NextResponse.json({themeSets:g,defaultPreview:(0,e.h9)(f)})}catch(a){return console.error("Failed to list themes:",a),d.NextResponse.json({error:"Failed to list themes"},{status:500})}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,1213],()=>b(b.s=31400));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=8504,a.ids=[8504],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68971:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>f});var d=c(23211),e=c(16593);async function f(a){try{let{searchParams:b}=new URL(a.url),c=b.get("cwd")||void 0,f="light"!==b.get("mode"),g=(0,e.pj)(c,f);return d.NextResponse.json({themeSets:g,defaultPreview:(0,e.h9)(f)})}catch(a){return console.error("Failed to list themes:",a),d.NextResponse.json({error:"Failed to list themes"},{status:500})}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96480:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/themes/route",pathname:"/api/themes",filename:"route",bundlePath:"app/api/themes/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/themes/route.ts",nextConfigOutput:"standalone",userland:()=>c(68971),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/themes/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,1213],()=>b(b.s=96480));module.exports=c})();
@@ -1,2 +1,2 @@
1
1
  (()=>{var a={};a.id=7003,a.ids=[7003],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},53686:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,PUT:()=>j,dynamic:()=>k});var e=c(23211),f=c(66544),g=c(78963),h=a([g]);g=(h.then?(await h)():h)[0];let k="force-dynamic";async function i(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});try{let a=(0,g.t0)();return e.NextResponse.json({disabled:a.disabled,filePath:(0,g.kx)()})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});if(!(0,f.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json();if(!Array.isArray(b.disabled)||b.disabled.some(a=>"string"!=typeof a))return e.NextResponse.json({error:"disabled must be an array of tool names"},{status:400});let c=await (0,g.qV)({disabled:b.disabled});return e.NextResponse.json({disabled:c.disabled,filePath:(0,g.kx)()})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},78963:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{H4:()=>m,kx:()=>k,qV:()=>o,t0:()=>n});var e=c(73024),f=c(76760),g=c(75430),h=c(80974),i=c.n(h),j=a([g]);function k(a=(0,g.getAgentDir)()){return(0,f.join)(a,"extension-tools.json")}function l(a){return"object"!=typeof a||null===a||Array.isArray(a)?{disabled:[]}:{disabled:Array.isArray(a.disabled)?[...new Set(a.disabled.filter(a=>"string"==typeof a&&""!==a.trim()).map(a=>a.trim()))]:[]}}function m(a,b){if(0===b.disabled.length)return[...a];let c=new Set(b.disabled);return a.filter(a=>!c.has(a))}function n(a=k()){if(!(0,e.existsSync)(a))return{disabled:[]};try{return l(JSON.parse((0,e.readFileSync)(a,"utf8")))}catch{return{disabled:[]}}}async function o(a,b=k()){let c=l(a);(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0});try{(0,e.writeFileSync)(b,JSON.stringify({version:1,disabled:[]},null,2),{flag:"wx",mode:384})}catch(a){if("EEXIST"!==a.code)throw a}let d=await i().lock(b,{realpath:!1,retries:10});try{(0,e.writeFileSync)(b,`${JSON.stringify({version:1,disabled:c.disabled},null,2)}
2
- `,"utf8"),(0,e.chmodSync)(b,384)}finally{await d()}return c}g=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},81115:a=>{"use strict";a.exports=require("constants")},86102:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/tools/extension-tools/route",pathname:"/api/tools/extension-tools",filename:"route",bundlePath:"app/api/tools/extension-tools/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/tools/extension-tools/route.ts",nextConfigOutput:"standalone",userland:()=>c(53686),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/tools/extension-tools/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974],()=>b(b.s=86102));module.exports=c})();
2
+ `,"utf8"),(0,e.chmodSync)(b,384)}finally{await d()}return c}g=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{},99474:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/tools/extension-tools/route",pathname:"/api/tools/extension-tools",filename:"route",bundlePath:"app/api/tools/extension-tools/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/tools/extension-tools/route.ts",nextConfigOutput:"standalone",userland:()=>c(53686),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/tools/extension-tools/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974],()=>b(b.s=99474));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=6293,a.ids=[6293],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},305:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Up:()=>r,dp:()=>q,wQ:()=>m});var e=c(73024),f=c(76760),g=c(75430),h=c(80974),i=c.n(h),j=a([g]);g=(j.then?(await j)():j)[0];let s=["read","bash","edit","write"],t=new Set(["bash","powershell"]);function k(a,b=process.platform){return"win32"===b&&a?.includes("powershell")===!0&&!a.includes("bash")}function l(a,b){let c=b?"powershell":"bash",d=[];for(let b of a){let a=t.has(b)?c:b;d.includes(a)||d.push(a)}return d}function m(a,b,c=process.platform){return l(a,k(b,c))}function n(a=(0,g.getAgentDir)()){return(0,f.join)(a,"settings.json")}function o(a){if(!(0,e.existsSync)(a))return{};let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if("object"!=typeof b||null===b||Array.isArray(b))throw Error("Invalid settings.json: expected an object");return b}function p(a){if(void 0!==a.defaultTools){if(!Array.isArray(a.defaultTools)||a.defaultTools.some(a=>"string"!=typeof a))throw Error("Invalid settings.json: defaultTools must be an array of strings");return a.defaultTools}}async function q(a=n(),b=process.platform){if(!(0,e.existsSync)(a))return!1;let c=await i().lock(a,{realpath:!1,retries:10});try{return k(p(o(a)),b)}finally{await c()}}async function r(a,b=n(),c=process.platform){if("win32"!==c)throw Error("PowerShell tool settings are only available on Windows");(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0});try{(0,e.writeFileSync)(b,"{}",{flag:"wx",mode:384})}catch(a){if("EEXIST"!==a.code)throw a}let d=await i().lock(b,{realpath:!1,retries:10});try{let c=o(b),d=p(c)??s,f=l(d,a);d.some(a=>t.has(a))||f.push(a?"powershell":"bash"),c.defaultTools=f,(0,e.writeFileSync)(b,JSON.stringify(c,null,2),"utf8"),(0,e.chmodSync)(b,384)}finally{await d()}return a}d()}catch(a){d(a)}})},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32280:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,PUT:()=>j,dynamic:()=>k});var e=c(23211),f=c(66544),g=c(305),h=a([g]);g=(h.then?(await h)():h)[0];let k="force-dynamic";async function i(){try{return e.NextResponse.json({isWindows:"win32"===process.platform,powerShellEnabled:await (0,g.dp)()})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,f.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});if("win32"!==process.platform)return e.NextResponse.json({error:"PowerShell tool settings are only available on Windows"},{status:404});try{let b=await a.json();if("boolean"!=typeof b.enabled)return e.NextResponse.json({error:"enabled must be a boolean"},{status:400});return e.NextResponse.json({isWindows:!0,powerShellEnabled:await (0,g.Up)(b.enabled)})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{},99294:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/tools/settings/route",pathname:"/api/tools/settings",filename:"route",bundlePath:"app/api/tools/settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/tools/settings/route.ts",nextConfigOutput:"standalone",userland:()=>c(32280),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/tools/settings/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974],()=>b(b.s=99294));module.exports=c})();
1
+ (()=>{var a={};a.id=6293,a.ids=[6293],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},305:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Up:()=>r,dp:()=>q,wQ:()=>m});var e=c(73024),f=c(76760),g=c(75430),h=c(80974),i=c.n(h),j=a([g]);g=(j.then?(await j)():j)[0];let s=["read","bash","edit","write"],t=new Set(["bash","powershell"]);function k(a,b=process.platform){return"win32"===b&&a?.includes("powershell")===!0&&!a.includes("bash")}function l(a,b){let c=b?"powershell":"bash",d=[];for(let b of a){let a=t.has(b)?c:b;d.includes(a)||d.push(a)}return d}function m(a,b,c=process.platform){return l(a,k(b,c))}function n(a=(0,g.getAgentDir)()){return(0,f.join)(a,"settings.json")}function o(a){if(!(0,e.existsSync)(a))return{};let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if("object"!=typeof b||null===b||Array.isArray(b))throw Error("Invalid settings.json: expected an object");return b}function p(a){if(void 0!==a.defaultTools){if(!Array.isArray(a.defaultTools)||a.defaultTools.some(a=>"string"!=typeof a))throw Error("Invalid settings.json: defaultTools must be an array of strings");return a.defaultTools}}async function q(a=n(),b=process.platform){if(!(0,e.existsSync)(a))return!1;let c=await i().lock(a,{realpath:!1,retries:10});try{return k(p(o(a)),b)}finally{await c()}}async function r(a,b=n(),c=process.platform){if("win32"!==c)throw Error("PowerShell tool settings are only available on Windows");(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0});try{(0,e.writeFileSync)(b,"{}",{flag:"wx",mode:384})}catch(a){if("EEXIST"!==a.code)throw a}let d=await i().lock(b,{realpath:!1,retries:10});try{let c=o(b),d=p(c)??s,f=l(d,a);d.some(a=>t.has(a))||f.push(a?"powershell":"bash"),c.defaultTools=f,(0,e.writeFileSync)(b,JSON.stringify(c,null,2),"utf8"),(0,e.chmodSync)(b,384)}finally{await d()}return a}d()}catch(a){d(a)}})},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32280:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,PUT:()=>j,dynamic:()=>k});var e=c(23211),f=c(66544),g=c(305),h=a([g]);g=(h.then?(await h)():h)[0];let k="force-dynamic";async function i(){try{return e.NextResponse.json({isWindows:"win32"===process.platform,powerShellEnabled:await (0,g.dp)()})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,f.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});if("win32"!==process.platform)return e.NextResponse.json({error:"PowerShell tool settings are only available on Windows"},{status:404});try{let b=await a.json();if("boolean"!=typeof b.enabled)return e.NextResponse.json({error:"enabled must be a boolean"},{status:400});return e.NextResponse.json({isWindows:!0,powerShellEnabled:await (0,g.Up)(b.enabled)})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},61562:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/tools/settings/route",pathname:"/api/tools/settings",filename:"route",bundlePath:"app/api/tools/settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/tools/settings/route.ts",nextConfigOutput:"standalone",userland:()=>c(32280),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/tools/settings/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974],()=>b(b.s=61562));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=7347,a.ids=[7347],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29016:(a,b,c)=>{c.d(b,{b:()=>d});function d(a){if(!a)return 0;let b=0;for(let c of a){let a=c.codePointAt(0)??0;a>=19968&&a<=40959||a>=13312&&a<=19903||a>=131072&&a<=173791||a>=12352&&a<=12447||a>=12448&&a<=12543||a>=44032&&a<=55215?b+=1:b+=.25}return Math.max(0,Math.round(b))}},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50842:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j,dynamic:()=>k});var e=c(23211),f=c(29021),g=c(40402),h=c(29016),i=a([g]);g=(i.then?(await i)():i)[0];let k="force-dynamic";async function j(){try{let a=await (0,g.dQ)(),b=[],c=new Map,d=0,i=0;for(let e of a){let a=function(a){let b,c=0,d=0;try{let b=(0,f.statSync)(a);c=b.mtimeMs,d=b.size}catch{return null}let e=globalThis.__piUsageSummaryCache??=new Map,i=e.get(a);if(i&&i.mtimeMs===c&&i.size===d)return i;try{b=function(a){let b=0,c=0,d=0,e=0;for(let f of a){if("message"!==f.type)continue;let a=f.message;d+=1,b+=function(a){let b=a.usage;return b?(b.input??0)+(b.output??0)+(b.cacheRead??0)+(b.cacheWrite??0):0}(a);let g=function(a){let b=a.content;return"string"==typeof b?b:Array.isArray(b)?b.map(a=>a&&"object"==typeof a&&"text"in a?String(a.text??""):"").join("\n"):""}(a),i=Math.max(0,5e5-e);if(i>0){let a=g.slice(0,i);e+=a.length,c+=(0,h.b)(a)}}return{usageTokens:b,estimatedTokens:c,messageCount:d}}((0,g.DK)(a))}catch{return null}for(e.set(a,{mtimeMs:c,size:d,...b});e.size>2e3;){let a=e.keys().next().value;if(void 0===a)break;e.delete(a)}return b}(e.path);if(!a)continue;let{usageTokens:j,estimatedTokens:k,messageCount:l}=a,m=j>0?j:k;d+=m,i+=l,b.push({path:e.path,id:e.id,cwd:e.cwd,name:e.name,firstMessage:e.firstMessage,created:e.created,modified:e.modified,messageCount:l,usageTokens:j,estimatedTokens:k,tokens:m,hasUsageRecords:j>0});let n=(e.modified??e.created??"").slice(0,10);n&&c.set(n,(c.get(n)??0)+m)}b.sort((a,b)=>(b.modified??"").localeCompare(a.modified??""));let j=[...c.entries()].map(([a,b])=>({day:a,tokens:b})).sort((a,b)=>a.day.localeCompare(b.day)),k={sessions:b,daily:j,totalTokens:d,totalSessions:b.length,messageCount:i};return e.NextResponse.json(k)}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:500})}}d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72230:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/usage/route",pathname:"/api/usage",filename:"route",bundlePath:"app/api/usage/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/usage/route.ts",nextConfigOutput:"standalone",userland:()=>c(50842),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/usage/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=72230));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=7347,a.ids=[7347],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4610:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/usage/route",pathname:"/api/usage",filename:"route",bundlePath:"app/api/usage/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/usage/route.ts",nextConfigOutput:"standalone",userland:()=>c(50842),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/usage/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29016:(a,b,c)=>{c.d(b,{b:()=>d});function d(a){if(!a)return 0;let b=0;for(let c of a){let a=c.codePointAt(0)??0;a>=19968&&a<=40959||a>=13312&&a<=19903||a>=131072&&a<=173791||a>=12352&&a<=12447||a>=12448&&a<=12543||a>=44032&&a<=55215?b+=1:b+=.25}return Math.max(0,Math.round(b))}},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50842:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j,dynamic:()=>k});var e=c(23211),f=c(29021),g=c(40402),h=c(29016),i=a([g]);g=(i.then?(await i)():i)[0];let k="force-dynamic";async function j(){try{let a=await (0,g.dQ)(),b=[],c=new Map,d=0,i=0;for(let e of a){let a=function(a){let b,c=0,d=0;try{let b=(0,f.statSync)(a);c=b.mtimeMs,d=b.size}catch{return null}let e=globalThis.__piUsageSummaryCache??=new Map,i=e.get(a);if(i&&i.mtimeMs===c&&i.size===d)return i;try{b=function(a){let b=0,c=0,d=0,e=0;for(let f of a){if("message"!==f.type)continue;let a=f.message;d+=1,b+=function(a){let b=a.usage;return b?(b.input??0)+(b.output??0)+(b.cacheRead??0)+(b.cacheWrite??0):0}(a);let g=function(a){let b=a.content;return"string"==typeof b?b:Array.isArray(b)?b.map(a=>a&&"object"==typeof a&&"text"in a?String(a.text??""):"").join("\n"):""}(a),i=Math.max(0,5e5-e);if(i>0){let a=g.slice(0,i);e+=a.length,c+=(0,h.b)(a)}}return{usageTokens:b,estimatedTokens:c,messageCount:d}}((0,g.DK)(a))}catch{return null}for(e.set(a,{mtimeMs:c,size:d,...b});e.size>2e3;){let a=e.keys().next().value;if(void 0===a)break;e.delete(a)}return b}(e.path);if(!a)continue;let{usageTokens:j,estimatedTokens:k,messageCount:l}=a,m=j>0?j:k;d+=m,i+=l,b.push({path:e.path,id:e.id,cwd:e.cwd,name:e.name,firstMessage:e.firstMessage,created:e.created,modified:e.modified,messageCount:l,usageTokens:j,estimatedTokens:k,tokens:m,hasUsageRecords:j>0});let n=(e.modified??e.created??"").slice(0,10);n&&c.set(n,(c.get(n)??0)+m)}b.sort((a,b)=>(b.modified??"").localeCompare(a.modified??""));let j=[...c.entries()].map(([a,b])=>({day:a,tokens:b})).sort((a,b)=>a.day.localeCompare(b.day)),k={sessions:b,daily:j,totalTokens:d,totalSessions:b.length,messageCount:i};return e.NextResponse.json(k)}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:500})}}d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=4610));module.exports=c})();
@@ -1,2 +1,2 @@
1
1
  (()=>{var a={};a.id=2713,a.ids=[2713],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},58372:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,PUT:()=>j,dynamic:()=>k});var e=c(23211),f=c(88373),g=c(66544),h=a([f]);f=(h.then?(await h)():h)[0];let k="force-dynamic";async function i(a){return(0,g.EN)(a)?e.NextResponse.json({...(0,f.MU)(),path:(0,f.wC)()}):e.NextResponse.json({error:"Access denied"},{status:403})}async function j(a){if(!(0,g.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});if(!(0,g.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json();return(0,f.Or)({provider:"string"==typeof b.provider?b.provider:void 0,baseUrl:"string"==typeof b.baseUrl?b.baseUrl:void 0,apiKey:"string"==typeof b.apiKey?b.apiKey:void 0,model:"string"==typeof b.model?b.model:void 0,maxTokens:"number"==typeof b.maxTokens?b.maxTokens:void 0}),e.NextResponse.json({success:!0,...(0,f.MU)(),path:(0,f.wC)()})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:400})}}d()}catch(a){d(a)}})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88373:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{MU:()=>l,Or:()=>m,wC:()=>n});var e=c(73024),f=c(76760),g=c(75430),h=c(8102),i=a([g]);g=(i.then?(await i)():i)[0];let o=["MCP_OCR_PROVIDER","MCP_OCR_BASE_URL","MCP_OCR_API_KEY","MCP_OCR_MODEL","MCP_OCR_MAX_TOKENS"];function j(){return(0,f.join)((0,f.dirname)((0,g.getAgentDir)()),"plugins","deepseek-vision",".env")}function k(){let a=function(){let a={};try{if(!(0,e.existsSync)(j()))return a;for(let b of(0,e.readFileSync)(j(),"utf8").split(/\r?\n/)){let c=b.match(/^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)\s*$/);c&&(a[c[1]]=function(a){let b=a.trim();return b.startsWith('"')&&b.endsWith('"')||b.startsWith("'")&&b.endsWith("'")?b.slice(1,-1):b}(c[2]))}}catch{return{}}return a}(),b=Number(a.MCP_OCR_MAX_TOKENS);return{provider:a.MCP_OCR_PROVIDER||"custom",baseUrl:a.MCP_OCR_BASE_URL||"",apiKey:a.MCP_OCR_API_KEY||"",model:a.MCP_OCR_MODEL||"",maxTokens:Number.isInteger(b)&&b>0?b:4096}}function l(){let a=k();return{...a,apiKey:"",hasApiKey:!!a.apiKey}}function m(a){let b=k(),c={provider:"string"==typeof a.provider&&a.provider.trim()?a.provider.trim():b.provider,baseUrl:"string"==typeof a.baseUrl?a.baseUrl.trim():b.baseUrl,apiKey:"string"==typeof a.apiKey&&a.apiKey?a.apiKey:b.apiKey,model:"string"==typeof a.model?a.model.trim():b.model,maxTokens:"number"==typeof a.maxTokens&&Number.isInteger(a.maxTokens)&&a.maxTokens>0?a.maxTokens:b.maxTokens},d=j();(0,e.mkdirSync)((0,f.dirname)(d),{recursive:!0,mode:448});let g=(0,e.existsSync)(d)?(0,e.readFileSync)(d,"utf8"):"",i={MCP_OCR_PROVIDER:c.provider,MCP_OCR_BASE_URL:c.baseUrl,MCP_OCR_API_KEY:c.apiKey,MCP_OCR_MODEL:c.model,MCP_OCR_MAX_TOKENS:String(c.maxTokens)},l=new Set,m=g.split(/\r?\n/).map(a=>{let b=a.match(/^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=/);if(!b||!o.includes(b[1]))return a;let c=b[1];return l.add(c),`${c}=${i[c]}`});for(let a of o)l.has(a)||m.push(`${a}=${i[a]}`);(0,h.$)(d,`${m.filter((a,b)=>b<m.length-1||""!==a).join("\n")}
2
- `)}function n(){return j()}d()}catch(a){d(a)}})},96487:()=>{},96902:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/vision-config/route",pathname:"/api/vision-config",filename:"route",bundlePath:"app/api/vision-config/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/vision-config/route.ts",nextConfigOutput:"standalone",userland:()=>c(58372),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/vision-config/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=96902));module.exports=c})();
2
+ `)}function n(){return j()}d()}catch(a){d(a)}})},95234:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/vision-config/route",pathname:"/api/vision-config",filename:"route",bundlePath:"app/api/vision-config/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/vision-config/route.ts",nextConfigOutput:"standalone",userland:()=>c(58372),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/vision-config/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=95234));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=4016,a.ids=[4016],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},42819:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>n,GET:()=>l,POST:()=>m});var e=c(23211),f=c(29021),g=c(24923),h=c(80547),i=c(74244),j=a([h]);async function k(a){let b=await (0,h.mc)();return(0,h.A$)(a,b)?null:e.NextResponse.json({error:"Access denied"},{status:403})}async function l(a){try{let b=new URL(a.url).searchParams.get("cwd");if(!b)return e.NextResponse.json({error:"cwd is required"},{status:400});let c=await k(b);if(c)return c;let d=await (0,g.KI)(b),j=[],l=null,m=!0;try{j=await (0,g.P9)((0,f.existsSync)(b)?b:d.projectRoot),l=(0,g.xw)(j,b)}catch{m=!1}for(let a of j)(0,h.wz)(a.path);return e.NextResponse.json({projectRoot:d.projectRoot,projectKey:(0,i.z)(d.projectRoot),isGit:m,isTopLevel:d.isTopLevel,currentWorktreePath:l,worktrees:j})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function m(a){try{let b=await a.json();if(!b.cwd||"string"!=typeof b.cwd)return e.NextResponse.json({error:"cwd is required"},{status:400});if(!b.branch||"string"!=typeof b.branch)return e.NextResponse.json({error:"branch is required"},{status:400});let c=await k(b.cwd);if(c)return c;if(!(0,f.existsSync)(b.cwd))return e.NextResponse.json({error:`Directory does not exist: ${b.cwd}`},{status:400});let d=await (0,g.l)(b.cwd,b.branch);return e.NextResponse.json(d)}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:400})}}async function n(a){try{let b=await a.json();if(!b.cwd||"string"!=typeof b.cwd)return e.NextResponse.json({error:"cwd is required"},{status:400});if(!b.path||"string"!=typeof b.path)return e.NextResponse.json({error:"path is required"},{status:400});let c=await k(b.cwd);if(c)return c;return await (0,g.IL)(b.cwd,b.path,!0===b.force),e.NextResponse.json({success:!0})}catch(c){let a=c instanceof Error?c.message:String(c),b=/contains modified or untracked files|is dirty/i.test(a);return e.NextResponse.json({error:a,dirty:b},{status:b?409:400})}}h=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},61316:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/worktrees/route.ts",nextConfigOutput:"standalone",userland:()=>c(42819),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/worktrees/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,mc:()=>n,uK:()=>l.uK,wz:()=>i.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(25252),j=c(82536),k=c(40402),l=c(58864),m=a([k]);async function n(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,k.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,i.Nw)(a.cwd)),a.projectRoot&&d.add((0,i.Nw)(a.projectRoot));try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^pi-cwd-\d{8}$/.test(a)&&d.add((0,i.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,i.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function o(a,b){return(0,j.o)(a,b)}function p(a,b){return(0,j.x)(a,b)}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=61316));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=4016,a.ids=[4016],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},22388:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/worktrees/route.ts",nextConfigOutput:"standalone",userland:()=>c(42819),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/worktrees/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},42819:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>n,GET:()=>l,POST:()=>m});var e=c(23211),f=c(29021),g=c(24923),h=c(80547),i=c(74244),j=a([h]);async function k(a){let b=await (0,h.mc)();return(0,h.A$)(a,b)?null:e.NextResponse.json({error:"Access denied"},{status:403})}async function l(a){try{let b=new URL(a.url).searchParams.get("cwd");if(!b)return e.NextResponse.json({error:"cwd is required"},{status:400});let c=await k(b);if(c)return c;let d=await (0,g.KI)(b),j=[],l=null,m=!0;try{j=await (0,g.P9)((0,f.existsSync)(b)?b:d.projectRoot),l=(0,g.xw)(j,b)}catch{m=!1}for(let a of j)(0,h.wz)(a.path);return e.NextResponse.json({projectRoot:d.projectRoot,projectKey:(0,i.z)(d.projectRoot),isGit:m,isTopLevel:d.isTopLevel,currentWorktreePath:l,worktrees:j})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function m(a){try{let b=await a.json();if(!b.cwd||"string"!=typeof b.cwd)return e.NextResponse.json({error:"cwd is required"},{status:400});if(!b.branch||"string"!=typeof b.branch)return e.NextResponse.json({error:"branch is required"},{status:400});let c=await k(b.cwd);if(c)return c;if(!(0,f.existsSync)(b.cwd))return e.NextResponse.json({error:`Directory does not exist: ${b.cwd}`},{status:400});let d=await (0,g.l)(b.cwd,b.branch);return e.NextResponse.json(d)}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:400})}}async function n(a){try{let b=await a.json();if(!b.cwd||"string"!=typeof b.cwd)return e.NextResponse.json({error:"cwd is required"},{status:400});if(!b.path||"string"!=typeof b.path)return e.NextResponse.json({error:"path is required"},{status:400});let c=await k(b.cwd);if(c)return c;return await (0,g.IL)(b.cwd,b.path,!0===b.force),e.NextResponse.json({success:!0})}catch(c){let a=c instanceof Error?c.message:String(c),b=/contains modified or untracked files|is dirty/i.test(a);return e.NextResponse.json({error:a,dirty:b},{status:b?409:400})}}h=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,mc:()=>n,uK:()=>l.uK,wz:()=>i.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(25252),j=c(82536),k=c(40402),l=c(58864),m=a([k]);async function n(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,k.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,i.Nw)(a.cwd)),a.projectRoot&&d.add((0,i.Nw)(a.projectRoot));try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^pi-cwd-\d{8}$/.test(a)&&d.add((0,i.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,i.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function o(a,b){return(0,j.o)(a,b)}function p(a,b){return(0,j.x)(a,b)}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=22388));module.exports=c})();