@qt4798/pi-web 0.18.10 → 0.18.12

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 (367) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +17 -18
  3. package/.next/build-manifest.json +3 -3
  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 +0 -6
  8. package/.next/server/app/_global-error/page.js +1 -1
  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]/lease/route.js +1 -1
  25. package/.next/server/app/api/agent/[id]/route.js +1 -1
  26. package/.next/server/app/api/agent/new/route.js +1 -1
  27. package/.next/server/app/api/agent/running/events/route.js +2 -2
  28. package/.next/server/app/api/agent/running/route.js +1 -1
  29. package/.next/server/app/api/app-update/route.js +1 -1
  30. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  31. package/.next/server/app/api/auth/combined/route.js +1 -1
  32. package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  33. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  34. package/.next/server/app/api/auth/providers/route.js +1 -1
  35. package/.next/server/app/api/backup/export/route.js +1 -1
  36. package/.next/server/app/api/backup/import/route.js +1 -1
  37. package/.next/server/app/api/cwd/browse/route.js +1 -1
  38. package/.next/server/app/api/cwd/validate/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 +3 -3
  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 +2 -2
  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 +2 -2
  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/enabled/route.js +1 -1
  56. package/.next/server/app/api/models/refresh/route.js +1 -1
  57. package/.next/server/app/api/models/route.js +1 -1
  58. package/.next/server/app/api/models-config/builtin/route.js +1 -1
  59. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  60. package/.next/server/app/api/models-config/discover/route.js +1 -1
  61. package/.next/server/app/api/models-config/route.js +1 -1
  62. package/.next/server/app/api/models-config/test/route.js +1 -1
  63. package/.next/server/app/api/modes/route.js +1 -1
  64. package/.next/server/app/api/plugins/check/route.js +1 -1
  65. package/.next/server/app/api/plugins/route.js +1 -1
  66. package/.next/server/app/api/project-aliases/route.js +1 -1
  67. package/.next/server/app/api/project-trust/route.js +1 -1
  68. package/.next/server/app/api/projects/visibility/route.js +1 -1
  69. package/.next/server/app/api/provider-usage/query/route.js +1 -1
  70. package/.next/server/app/api/proxy/route.js +1 -1
  71. package/.next/server/app/api/proxy/test/route.js +1 -1
  72. package/.next/server/app/api/sessions/[id]/auto-name/route.js +2 -2
  73. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  74. package/.next/server/app/api/sessions/[id]/details/route.js +1 -1
  75. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  76. package/.next/server/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route.js +1 -1
  77. package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
  78. package/.next/server/app/api/sessions/[id]/queue-recovery/route.js +1 -1
  79. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  80. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  81. package/.next/server/app/api/sessions/route.js +1 -1
  82. package/.next/server/app/api/sessions/search/route.js +1 -1
  83. package/.next/server/app/api/settings/title-model/route.js +1 -1
  84. package/.next/server/app/api/skills/check/route.js +1 -1
  85. package/.next/server/app/api/skills/install/route.js +1 -1
  86. package/.next/server/app/api/skills/route.js +1 -1
  87. package/.next/server/app/api/skills/search/route.js +1 -1
  88. package/.next/server/app/api/skills/update/route.js +1 -1
  89. package/.next/server/app/api/snippets/[id]/route.js +1 -1
  90. package/.next/server/app/api/snippets/route.js +1 -1
  91. package/.next/server/app/api/subagents/[id]/route.js +1 -1
  92. package/.next/server/app/api/subagents/profiles/route.js +1 -1
  93. package/.next/server/app/api/subagents/settings/route.js +1 -1
  94. package/.next/server/app/api/tasks/[id]/[action]/route.js +1 -1
  95. package/.next/server/app/api/tasks/[id]/changed-files/route.js +2 -2
  96. package/.next/server/app/api/tasks/[id]/diff/route.js +2 -2
  97. package/.next/server/app/api/tasks/[id]/events/route.js +1 -1
  98. package/.next/server/app/api/tasks/[id]/route.js +1 -1
  99. package/.next/server/app/api/tasks/batch/route.js +1 -1
  100. package/.next/server/app/api/tasks/events/route.js +2 -2
  101. package/.next/server/app/api/tasks/route.js +1 -1
  102. package/.next/server/app/api/tasks/settings/route.js +1 -1
  103. package/.next/server/app/api/tasks/templates/route.js +1 -1
  104. package/.next/server/app/api/terminal/[id]/events/route.js +2 -2
  105. package/.next/server/app/api/terminal/[id]/route.js +1 -1
  106. package/.next/server/app/api/terminal/route.js +1 -1
  107. package/.next/server/app/api/themes/[name]/route.js +1 -1
  108. package/.next/server/app/api/themes/[name]/route.js.nft.json +1 -1
  109. package/.next/server/app/api/themes/route.js +1 -1
  110. package/.next/server/app/api/themes/route.js.nft.json +1 -1
  111. package/.next/server/app/api/tools/extension-tools/route.js +1 -1
  112. package/.next/server/app/api/tools/settings/route.js +1 -1
  113. package/.next/server/app/api/usage/route.js +1 -1
  114. package/.next/server/app/api/vision-config/route.js +2 -2
  115. package/.next/server/app/api/web-auth/route.js +1 -1
  116. package/.next/server/app/api/worktrees/route.js +1 -1
  117. package/.next/server/app/icon.ico/route.js +1 -1
  118. package/.next/server/app/icon.png/route.js +1 -1
  119. package/.next/server/app/icon.svg/route.js +1 -1
  120. package/.next/server/app/index.html +1 -1
  121. package/.next/server/app/index.rsc +4 -4
  122. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  123. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  124. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  125. package/.next/server/app/login/page.js +1 -1
  126. package/.next/server/app/login/page.js.nft.json +1 -1
  127. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  128. package/.next/server/app/login.html +1 -1
  129. package/.next/server/app/login.rsc +3 -3
  130. package/.next/server/app/login.segments/_full.segment.rsc +3 -3
  131. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  132. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  133. package/.next/server/app/page.js +15 -15
  134. package/.next/server/app/page.js.nft.json +1 -1
  135. package/.next/server/app/page_client-reference-manifest.js +1 -1
  136. package/.next/server/app-paths-manifest.json +17 -18
  137. package/.next/server/chunks/3379.js +1 -1
  138. package/.next/server/chunks/4253.js +3 -3
  139. package/.next/server/chunks/6429.js +3 -3
  140. package/.next/server/chunks/{1213.js → 6593.js} +1 -1
  141. package/.next/server/chunks/7915.js +1 -1
  142. package/.next/server/chunks/8526.js +1 -0
  143. package/.next/server/middleware-build-manifest.js +1 -1
  144. package/.next/server/middleware.js +1 -1
  145. package/.next/server/pages/404.html +1 -1
  146. package/.next/server/pages/500.html +1 -1
  147. package/.next/server/server-reference-manifest.json +1 -1
  148. package/.next/server/webpack-runtime.js +1 -1
  149. package/.next/static/chunks/5170-6ee3710ea5c117f3.js +1 -0
  150. package/.next/static/chunks/8272-a2dd6dc928b6876e.js +1 -0
  151. package/.next/static/chunks/app/_global-error/page-43ebd38332159d0f.js +1 -0
  152. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-43ebd38332159d0f.js +1 -0
  153. package/.next/static/chunks/app/api/agent/[id]/events/route-43ebd38332159d0f.js +1 -0
  154. package/.next/static/chunks/app/api/agent/[id]/lease/route-43ebd38332159d0f.js +1 -0
  155. package/.next/static/chunks/app/api/agent/[id]/route-43ebd38332159d0f.js +1 -0
  156. package/.next/static/chunks/app/api/agent/new/route-43ebd38332159d0f.js +1 -0
  157. package/.next/static/chunks/app/api/agent/running/events/route-43ebd38332159d0f.js +1 -0
  158. package/.next/static/chunks/app/api/agent/running/route-43ebd38332159d0f.js +1 -0
  159. package/.next/static/chunks/app/api/app-update/route-43ebd38332159d0f.js +1 -0
  160. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-43ebd38332159d0f.js +1 -0
  161. package/.next/static/chunks/app/api/auth/combined/route-43ebd38332159d0f.js +1 -0
  162. package/.next/static/chunks/app/api/auth/login/[provider]/route-43ebd38332159d0f.js +1 -0
  163. package/.next/static/chunks/app/api/auth/logout/[provider]/route-43ebd38332159d0f.js +1 -0
  164. package/.next/static/chunks/app/api/auth/providers/route-43ebd38332159d0f.js +1 -0
  165. package/.next/static/chunks/app/api/backup/export/route-43ebd38332159d0f.js +1 -0
  166. package/.next/static/chunks/app/api/backup/import/route-43ebd38332159d0f.js +1 -0
  167. package/.next/static/chunks/app/api/cwd/browse/route-43ebd38332159d0f.js +1 -0
  168. package/.next/static/chunks/app/api/cwd/validate/route-43ebd38332159d0f.js +1 -0
  169. package/.next/static/chunks/app/api/default-cwd/route-43ebd38332159d0f.js +1 -0
  170. package/.next/static/chunks/app/api/events/route-43ebd38332159d0f.js +1 -0
  171. package/.next/static/chunks/app/api/features/route-43ebd38332159d0f.js +1 -0
  172. package/.next/static/chunks/app/api/file-index/route-43ebd38332159d0f.js +1 -0
  173. package/.next/static/chunks/app/api/files/[...path]/route-43ebd38332159d0f.js +1 -0
  174. package/.next/static/chunks/app/api/git/diff/route-43ebd38332159d0f.js +1 -0
  175. package/.next/static/chunks/app/api/git/push/route-43ebd38332159d0f.js +1 -0
  176. package/.next/static/chunks/app/api/git/stash/route-43ebd38332159d0f.js +1 -0
  177. package/.next/static/chunks/app/api/git/status/route-43ebd38332159d0f.js +1 -0
  178. package/.next/static/chunks/app/api/home/route-43ebd38332159d0f.js +1 -0
  179. package/.next/static/chunks/app/api/import/discover/route-43ebd38332159d0f.js +1 -0
  180. package/.next/static/chunks/app/api/import/execute/route-43ebd38332159d0f.js +1 -0
  181. package/.next/static/chunks/app/api/import/status/route-43ebd38332159d0f.js +1 -0
  182. package/.next/static/chunks/app/api/logs/route-43ebd38332159d0f.js +1 -0
  183. package/.next/static/chunks/app/api/mcp/restart/route-43ebd38332159d0f.js +1 -0
  184. package/.next/static/chunks/app/api/mcp/route-43ebd38332159d0f.js +1 -0
  185. package/.next/static/chunks/app/api/models/enabled/route-43ebd38332159d0f.js +1 -0
  186. package/.next/static/chunks/app/api/models/refresh/route-43ebd38332159d0f.js +1 -0
  187. package/.next/static/chunks/app/api/models/route-43ebd38332159d0f.js +1 -0
  188. package/.next/static/chunks/app/api/models-config/builtin/route-43ebd38332159d0f.js +1 -0
  189. package/.next/static/chunks/app/api/models-config/catalog/route-43ebd38332159d0f.js +1 -0
  190. package/.next/static/chunks/app/api/models-config/discover/route-43ebd38332159d0f.js +1 -0
  191. package/.next/static/chunks/app/api/models-config/route-43ebd38332159d0f.js +1 -0
  192. package/.next/static/chunks/app/api/models-config/test/route-43ebd38332159d0f.js +1 -0
  193. package/.next/static/chunks/app/api/modes/route-43ebd38332159d0f.js +1 -0
  194. package/.next/static/chunks/app/api/plugins/check/route-43ebd38332159d0f.js +1 -0
  195. package/.next/static/chunks/app/api/plugins/route-43ebd38332159d0f.js +1 -0
  196. package/.next/static/chunks/app/api/project-aliases/route-43ebd38332159d0f.js +1 -0
  197. package/.next/static/chunks/app/api/project-trust/route-43ebd38332159d0f.js +1 -0
  198. package/.next/static/chunks/app/api/projects/visibility/route-43ebd38332159d0f.js +1 -0
  199. package/.next/static/chunks/app/api/provider-usage/query/route-43ebd38332159d0f.js +1 -0
  200. package/.next/static/chunks/app/api/proxy/route-43ebd38332159d0f.js +1 -0
  201. package/.next/static/chunks/app/api/proxy/test/route-43ebd38332159d0f.js +1 -0
  202. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-43ebd38332159d0f.js +1 -0
  203. package/.next/static/chunks/app/api/sessions/[id]/context/route-43ebd38332159d0f.js +1 -0
  204. package/.next/static/chunks/app/api/sessions/[id]/details/route-43ebd38332159d0f.js +1 -0
  205. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-43ebd38332159d0f.js +1 -0
  206. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-43ebd38332159d0f.js +1 -0
  207. package/.next/static/chunks/app/api/sessions/[id]/export/route-43ebd38332159d0f.js +1 -0
  208. package/.next/static/chunks/app/api/sessions/[id]/queue-recovery/route-43ebd38332159d0f.js +1 -0
  209. package/.next/static/chunks/app/api/sessions/[id]/route-43ebd38332159d0f.js +1 -0
  210. package/.next/static/chunks/app/api/sessions/[id]/state/route-43ebd38332159d0f.js +1 -0
  211. package/.next/static/chunks/app/api/sessions/route-43ebd38332159d0f.js +1 -0
  212. package/.next/static/chunks/app/api/sessions/search/route-43ebd38332159d0f.js +1 -0
  213. package/.next/static/chunks/app/api/settings/title-model/route-43ebd38332159d0f.js +1 -0
  214. package/.next/static/chunks/app/api/skills/check/route-43ebd38332159d0f.js +1 -0
  215. package/.next/static/chunks/app/api/skills/install/route-43ebd38332159d0f.js +1 -0
  216. package/.next/static/chunks/app/api/skills/route-43ebd38332159d0f.js +1 -0
  217. package/.next/static/chunks/app/api/skills/search/route-43ebd38332159d0f.js +1 -0
  218. package/.next/static/chunks/app/api/skills/update/route-43ebd38332159d0f.js +1 -0
  219. package/.next/static/chunks/app/api/snippets/[id]/route-43ebd38332159d0f.js +1 -0
  220. package/.next/static/chunks/app/api/snippets/route-43ebd38332159d0f.js +1 -0
  221. package/.next/static/chunks/app/api/subagents/[id]/route-43ebd38332159d0f.js +1 -0
  222. package/.next/static/chunks/app/api/subagents/profiles/route-43ebd38332159d0f.js +1 -0
  223. package/.next/static/chunks/app/api/subagents/settings/route-43ebd38332159d0f.js +1 -0
  224. package/.next/static/chunks/app/api/tasks/[id]/[action]/route-43ebd38332159d0f.js +1 -0
  225. package/.next/static/chunks/app/api/tasks/[id]/changed-files/route-43ebd38332159d0f.js +1 -0
  226. package/.next/static/chunks/app/api/tasks/[id]/diff/route-43ebd38332159d0f.js +1 -0
  227. package/.next/static/chunks/app/api/tasks/[id]/events/route-43ebd38332159d0f.js +1 -0
  228. package/.next/static/chunks/app/api/tasks/[id]/route-43ebd38332159d0f.js +1 -0
  229. package/.next/static/chunks/app/api/tasks/batch/route-43ebd38332159d0f.js +1 -0
  230. package/.next/static/chunks/app/api/tasks/events/route-43ebd38332159d0f.js +1 -0
  231. package/.next/static/chunks/app/api/tasks/route-43ebd38332159d0f.js +1 -0
  232. package/.next/static/chunks/app/api/tasks/settings/route-43ebd38332159d0f.js +1 -0
  233. package/.next/static/chunks/app/api/tasks/templates/route-43ebd38332159d0f.js +1 -0
  234. package/.next/static/chunks/app/api/terminal/[id]/events/route-43ebd38332159d0f.js +1 -0
  235. package/.next/static/chunks/app/api/terminal/[id]/route-43ebd38332159d0f.js +1 -0
  236. package/.next/static/chunks/app/api/terminal/route-43ebd38332159d0f.js +1 -0
  237. package/.next/static/chunks/app/api/themes/[name]/route-43ebd38332159d0f.js +1 -0
  238. package/.next/static/chunks/app/api/themes/route-43ebd38332159d0f.js +1 -0
  239. package/.next/static/chunks/app/api/tools/extension-tools/route-43ebd38332159d0f.js +1 -0
  240. package/.next/static/chunks/app/api/tools/settings/route-43ebd38332159d0f.js +1 -0
  241. package/.next/static/chunks/app/api/usage/route-43ebd38332159d0f.js +1 -0
  242. package/.next/static/chunks/app/api/vision-config/route-43ebd38332159d0f.js +1 -0
  243. package/.next/static/chunks/app/api/web-auth/route-43ebd38332159d0f.js +1 -0
  244. package/.next/static/chunks/app/api/worktrees/route-43ebd38332159d0f.js +1 -0
  245. package/.next/static/chunks/app/login/{page-9e7302325b4e8bec.js → page-7d898795adddde04.js} +1 -1
  246. package/.next/static/chunks/app/{page-b5504be1d93b8430.js → page-abc85eb2cca48bce.js} +11 -11
  247. package/.next/static/chunks/next/dist/client/components/builtin/app-error-43ebd38332159d0f.js +1 -0
  248. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-43ebd38332159d0f.js +1 -0
  249. package/.next/static/chunks/next/dist/client/components/builtin/not-found-43ebd38332159d0f.js +1 -0
  250. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-43ebd38332159d0f.js +1 -0
  251. package/.next/static/chunks/{webpack-e1f649c791588f74.js → webpack-8937e0633207540f.js} +1 -1
  252. package/.next/static/css/2d92ddfd19010e95.css +1 -0
  253. package/.next/static/fs5JGinkTfT6aWXJqEdny/_buildManifest.js +1 -0
  254. package/.next/trace +84 -83
  255. package/.next/trace-build +1 -1
  256. package/.next/types/routes.d.ts +1 -2
  257. package/.next/types/validator.ts +0 -9
  258. package/package.json +3 -1
  259. package/.next/server/app/api/project-state/route.js +0 -1
  260. package/.next/server/app/api/project-state/route.js.nft.json +0 -1
  261. package/.next/server/app/api/project-state/route_client-reference-manifest.js +0 -1
  262. package/.next/server/chunks/8152.js +0 -1
  263. package/.next/static/Bc4W8o_I-azZJvzY-9RoR/_buildManifest.js +0 -1
  264. package/.next/static/chunks/2981-20a2f99db34a0dc8.js +0 -1
  265. package/.next/static/chunks/7650-4f948821e59fd720.js +0 -1
  266. package/.next/static/chunks/app/_global-error/page-df454574f4d3121d.js +0 -1
  267. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-df454574f4d3121d.js +0 -1
  268. package/.next/static/chunks/app/api/agent/[id]/events/route-df454574f4d3121d.js +0 -1
  269. package/.next/static/chunks/app/api/agent/[id]/lease/route-df454574f4d3121d.js +0 -1
  270. package/.next/static/chunks/app/api/agent/[id]/route-df454574f4d3121d.js +0 -1
  271. package/.next/static/chunks/app/api/agent/new/route-df454574f4d3121d.js +0 -1
  272. package/.next/static/chunks/app/api/agent/running/events/route-df454574f4d3121d.js +0 -1
  273. package/.next/static/chunks/app/api/agent/running/route-df454574f4d3121d.js +0 -1
  274. package/.next/static/chunks/app/api/app-update/route-df454574f4d3121d.js +0 -1
  275. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-df454574f4d3121d.js +0 -1
  276. package/.next/static/chunks/app/api/auth/combined/route-df454574f4d3121d.js +0 -1
  277. package/.next/static/chunks/app/api/auth/login/[provider]/route-df454574f4d3121d.js +0 -1
  278. package/.next/static/chunks/app/api/auth/logout/[provider]/route-df454574f4d3121d.js +0 -1
  279. package/.next/static/chunks/app/api/auth/providers/route-df454574f4d3121d.js +0 -1
  280. package/.next/static/chunks/app/api/backup/export/route-df454574f4d3121d.js +0 -1
  281. package/.next/static/chunks/app/api/backup/import/route-df454574f4d3121d.js +0 -1
  282. package/.next/static/chunks/app/api/cwd/browse/route-df454574f4d3121d.js +0 -1
  283. package/.next/static/chunks/app/api/cwd/validate/route-df454574f4d3121d.js +0 -1
  284. package/.next/static/chunks/app/api/default-cwd/route-df454574f4d3121d.js +0 -1
  285. package/.next/static/chunks/app/api/events/route-df454574f4d3121d.js +0 -1
  286. package/.next/static/chunks/app/api/features/route-df454574f4d3121d.js +0 -1
  287. package/.next/static/chunks/app/api/file-index/route-df454574f4d3121d.js +0 -1
  288. package/.next/static/chunks/app/api/files/[...path]/route-df454574f4d3121d.js +0 -1
  289. package/.next/static/chunks/app/api/git/diff/route-df454574f4d3121d.js +0 -1
  290. package/.next/static/chunks/app/api/git/push/route-df454574f4d3121d.js +0 -1
  291. package/.next/static/chunks/app/api/git/stash/route-df454574f4d3121d.js +0 -1
  292. package/.next/static/chunks/app/api/git/status/route-df454574f4d3121d.js +0 -1
  293. package/.next/static/chunks/app/api/home/route-df454574f4d3121d.js +0 -1
  294. package/.next/static/chunks/app/api/import/discover/route-df454574f4d3121d.js +0 -1
  295. package/.next/static/chunks/app/api/import/execute/route-df454574f4d3121d.js +0 -1
  296. package/.next/static/chunks/app/api/import/status/route-df454574f4d3121d.js +0 -1
  297. package/.next/static/chunks/app/api/logs/route-df454574f4d3121d.js +0 -1
  298. package/.next/static/chunks/app/api/mcp/restart/route-df454574f4d3121d.js +0 -1
  299. package/.next/static/chunks/app/api/mcp/route-df454574f4d3121d.js +0 -1
  300. package/.next/static/chunks/app/api/models/enabled/route-df454574f4d3121d.js +0 -1
  301. package/.next/static/chunks/app/api/models/refresh/route-df454574f4d3121d.js +0 -1
  302. package/.next/static/chunks/app/api/models/route-df454574f4d3121d.js +0 -1
  303. package/.next/static/chunks/app/api/models-config/builtin/route-df454574f4d3121d.js +0 -1
  304. package/.next/static/chunks/app/api/models-config/catalog/route-df454574f4d3121d.js +0 -1
  305. package/.next/static/chunks/app/api/models-config/discover/route-df454574f4d3121d.js +0 -1
  306. package/.next/static/chunks/app/api/models-config/route-df454574f4d3121d.js +0 -1
  307. package/.next/static/chunks/app/api/models-config/test/route-df454574f4d3121d.js +0 -1
  308. package/.next/static/chunks/app/api/modes/route-df454574f4d3121d.js +0 -1
  309. package/.next/static/chunks/app/api/plugins/check/route-df454574f4d3121d.js +0 -1
  310. package/.next/static/chunks/app/api/plugins/route-df454574f4d3121d.js +0 -1
  311. package/.next/static/chunks/app/api/project-aliases/route-df454574f4d3121d.js +0 -1
  312. package/.next/static/chunks/app/api/project-state/route-df454574f4d3121d.js +0 -1
  313. package/.next/static/chunks/app/api/project-trust/route-df454574f4d3121d.js +0 -1
  314. package/.next/static/chunks/app/api/projects/visibility/route-df454574f4d3121d.js +0 -1
  315. package/.next/static/chunks/app/api/provider-usage/query/route-df454574f4d3121d.js +0 -1
  316. package/.next/static/chunks/app/api/proxy/route-df454574f4d3121d.js +0 -1
  317. package/.next/static/chunks/app/api/proxy/test/route-df454574f4d3121d.js +0 -1
  318. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-df454574f4d3121d.js +0 -1
  319. package/.next/static/chunks/app/api/sessions/[id]/context/route-df454574f4d3121d.js +0 -1
  320. package/.next/static/chunks/app/api/sessions/[id]/details/route-df454574f4d3121d.js +0 -1
  321. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-df454574f4d3121d.js +0 -1
  322. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-df454574f4d3121d.js +0 -1
  323. package/.next/static/chunks/app/api/sessions/[id]/export/route-df454574f4d3121d.js +0 -1
  324. package/.next/static/chunks/app/api/sessions/[id]/queue-recovery/route-df454574f4d3121d.js +0 -1
  325. package/.next/static/chunks/app/api/sessions/[id]/route-df454574f4d3121d.js +0 -1
  326. package/.next/static/chunks/app/api/sessions/[id]/state/route-df454574f4d3121d.js +0 -1
  327. package/.next/static/chunks/app/api/sessions/route-df454574f4d3121d.js +0 -1
  328. package/.next/static/chunks/app/api/sessions/search/route-df454574f4d3121d.js +0 -1
  329. package/.next/static/chunks/app/api/settings/title-model/route-df454574f4d3121d.js +0 -1
  330. package/.next/static/chunks/app/api/skills/check/route-df454574f4d3121d.js +0 -1
  331. package/.next/static/chunks/app/api/skills/install/route-df454574f4d3121d.js +0 -1
  332. package/.next/static/chunks/app/api/skills/route-df454574f4d3121d.js +0 -1
  333. package/.next/static/chunks/app/api/skills/search/route-df454574f4d3121d.js +0 -1
  334. package/.next/static/chunks/app/api/skills/update/route-df454574f4d3121d.js +0 -1
  335. package/.next/static/chunks/app/api/snippets/[id]/route-df454574f4d3121d.js +0 -1
  336. package/.next/static/chunks/app/api/snippets/route-df454574f4d3121d.js +0 -1
  337. package/.next/static/chunks/app/api/subagents/[id]/route-df454574f4d3121d.js +0 -1
  338. package/.next/static/chunks/app/api/subagents/profiles/route-df454574f4d3121d.js +0 -1
  339. package/.next/static/chunks/app/api/subagents/settings/route-df454574f4d3121d.js +0 -1
  340. package/.next/static/chunks/app/api/tasks/[id]/[action]/route-df454574f4d3121d.js +0 -1
  341. package/.next/static/chunks/app/api/tasks/[id]/changed-files/route-df454574f4d3121d.js +0 -1
  342. package/.next/static/chunks/app/api/tasks/[id]/diff/route-df454574f4d3121d.js +0 -1
  343. package/.next/static/chunks/app/api/tasks/[id]/events/route-df454574f4d3121d.js +0 -1
  344. package/.next/static/chunks/app/api/tasks/[id]/route-df454574f4d3121d.js +0 -1
  345. package/.next/static/chunks/app/api/tasks/batch/route-df454574f4d3121d.js +0 -1
  346. package/.next/static/chunks/app/api/tasks/events/route-df454574f4d3121d.js +0 -1
  347. package/.next/static/chunks/app/api/tasks/route-df454574f4d3121d.js +0 -1
  348. package/.next/static/chunks/app/api/tasks/settings/route-df454574f4d3121d.js +0 -1
  349. package/.next/static/chunks/app/api/tasks/templates/route-df454574f4d3121d.js +0 -1
  350. package/.next/static/chunks/app/api/terminal/[id]/events/route-df454574f4d3121d.js +0 -1
  351. package/.next/static/chunks/app/api/terminal/[id]/route-df454574f4d3121d.js +0 -1
  352. package/.next/static/chunks/app/api/terminal/route-df454574f4d3121d.js +0 -1
  353. package/.next/static/chunks/app/api/themes/[name]/route-df454574f4d3121d.js +0 -1
  354. package/.next/static/chunks/app/api/themes/route-df454574f4d3121d.js +0 -1
  355. package/.next/static/chunks/app/api/tools/extension-tools/route-df454574f4d3121d.js +0 -1
  356. package/.next/static/chunks/app/api/tools/settings/route-df454574f4d3121d.js +0 -1
  357. package/.next/static/chunks/app/api/usage/route-df454574f4d3121d.js +0 -1
  358. package/.next/static/chunks/app/api/vision-config/route-df454574f4d3121d.js +0 -1
  359. package/.next/static/chunks/app/api/web-auth/route-df454574f4d3121d.js +0 -1
  360. package/.next/static/chunks/app/api/worktrees/route-df454574f4d3121d.js +0 -1
  361. package/.next/static/chunks/next/dist/client/components/builtin/app-error-df454574f4d3121d.js +0 -1
  362. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-df454574f4d3121d.js +0 -1
  363. package/.next/static/chunks/next/dist/client/components/builtin/not-found-df454574f4d3121d.js +0 -1
  364. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-df454574f4d3121d.js +0 -1
  365. package/.next/static/css/e11550eee90cf54b.css +0 -1
  366. package/.next/types/app/api/project-state/route.ts +0 -353
  367. /package/.next/static/{Bc4W8o_I-azZJvzY-9RoR → fs5JGinkTfT6aWXJqEdny}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=8658,a.ids=[8658],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")},12773:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>n,dynamic:()=>o});var e=c(23211),f=c(29021),g=c(21820),h=c(33873),i=c(19821),j=c(75430),k=c(66544),l=a([i,j]);[i,j]=l.then?(await l)():l;let o="force-dynamic";function m(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}async function n(a){let b;if(!(0,k.EN)(a))return e.NextResponse.json({ok:!1,error:"Access denied"},{status:403});if(!(0,k.E2)(a))return e.NextResponse.json({ok:!1,error:"Content-Type must be application/json"},{status:415});try{let c,d=await a.json(),k="string"==typeof d.providerName?d.providerName.trim():"";if(!k)return e.NextResponse.json({ok:!1,error:"providerName is required"},{status:400});if(!m(d.provider))return e.NextResponse.json({ok:!1,error:"provider is required"},{status:400});if(!m(d.model))return e.NextResponse.json({ok:!1,error:"model is required"},{status:400});let l="string"==typeof d.model.id?d.model.id.trim():"";if(!l)return e.NextResponse.json({ok:!1,error:"Model ID is required"},{status:400});b=(0,f.mkdtempSync)((0,h.join)((0,g.tmpdir)(),"pi-web-model-test-"));let n=(0,h.join)(b,"models.json");(0,f.writeFileSync)(n,JSON.stringify({providers:{[k]:{...d.provider,models:[{...d.model,id:l}]}}},null,2),"utf8");let o=await j.ModelRuntime.create({modelsPath:n}),p=o.getError();if(p)return e.NextResponse.json({ok:!1,error:p});let q=o.getModel(k,l);if(!q)return e.NextResponse.json({ok:!1,error:`Model not found: ${k}/${l}`});let r=await o.getAuth(q);if(!r?.auth.apiKey)return e.NextResponse.json({ok:!1,error:`No API key found for "${k}"`});let s=new AbortController,t=setTimeout(()=>s.abort(),2e4),u=Date.now();try{let a=await (0,i.completeSimple)(q,{messages:[{role:"user",content:"Reply with OK only.",timestamp:Date.now()}]},{apiKey:r.auth.apiKey,headers:r.auth.headers,maxTokens:16,timeoutMs:2e4,maxRetries:0,cacheRetention:"none",signal:s.signal,onResponse:a=>{c=a.status}}),b=Date.now()-u;if("error"===a.stopReason||"aborted"===a.stopReason)return e.NextResponse.json({ok:!1,error:a.errorMessage??(s.signal.aborted?"Test timed out":"Model returned an error"),latencyMs:b,status:c});return e.NextResponse.json({ok:!0,latencyMs:b,status:c,responseText:a.content.filter(a=>"text"===a.type).map(a=>a.text).join("").slice(0,300)})}finally{clearTimeout(t)}}catch(a){return e.NextResponse.json({ok:!1,error:a instanceof Error?a.message:String(a)},{status:500})}finally{b&&(0,f.rmSync)(b,{recursive:!0,force:!0})}}d()}catch(a){d(a)}})},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19821:a=>{"use strict";a.exports=import("@earendil-works/pi-ai/compat")},21820:a=>{"use strict";a.exports=require("os")},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")},45702:(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/models-config/test/route",pathname:"/api/models-config/test",filename:"route",bundlePath:"app/api/models-config/test/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/models-config/test/route.ts",nextConfigOutput:"standalone",userland:()=>c(12773),...{}}),{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/models-config/test/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,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))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"))}},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},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")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=45702));module.exports=c})();
1
+ (()=>{var a={};a.id=8658,a.ids=[8658],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")},12773:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>n,dynamic:()=>o});var e=c(23211),f=c(29021),g=c(21820),h=c(33873),i=c(19821),j=c(75430),k=c(66544),l=a([i,j]);[i,j]=l.then?(await l)():l;let o="force-dynamic";function m(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}async function n(a){let b;if(!(0,k.EN)(a))return e.NextResponse.json({ok:!1,error:"Access denied"},{status:403});if(!(0,k.E2)(a))return e.NextResponse.json({ok:!1,error:"Content-Type must be application/json"},{status:415});try{let c,d=await a.json(),k="string"==typeof d.providerName?d.providerName.trim():"";if(!k)return e.NextResponse.json({ok:!1,error:"providerName is required"},{status:400});if(!m(d.provider))return e.NextResponse.json({ok:!1,error:"provider is required"},{status:400});if(!m(d.model))return e.NextResponse.json({ok:!1,error:"model is required"},{status:400});let l="string"==typeof d.model.id?d.model.id.trim():"";if(!l)return e.NextResponse.json({ok:!1,error:"Model ID is required"},{status:400});b=(0,f.mkdtempSync)((0,h.join)((0,g.tmpdir)(),"pi-web-model-test-"));let n=(0,h.join)(b,"models.json");(0,f.writeFileSync)(n,JSON.stringify({providers:{[k]:{...d.provider,models:[{...d.model,id:l}]}}},null,2),"utf8");let o=await j.ModelRuntime.create({modelsPath:n}),p=o.getError();if(p)return e.NextResponse.json({ok:!1,error:p});let q=o.getModel(k,l);if(!q)return e.NextResponse.json({ok:!1,error:`Model not found: ${k}/${l}`});let r=await o.getAuth(q);if(!r?.auth.apiKey)return e.NextResponse.json({ok:!1,error:`No API key found for "${k}"`});let s=new AbortController,t=setTimeout(()=>s.abort(),2e4),u=Date.now();try{let a=await (0,i.completeSimple)(q,{messages:[{role:"user",content:"Reply with OK only.",timestamp:Date.now()}]},{apiKey:r.auth.apiKey,headers:r.auth.headers,maxTokens:16,timeoutMs:2e4,maxRetries:0,cacheRetention:"none",signal:s.signal,onResponse:a=>{c=a.status}}),b=Date.now()-u;if("error"===a.stopReason||"aborted"===a.stopReason)return e.NextResponse.json({ok:!1,error:a.errorMessage??(s.signal.aborted?"Test timed out":"Model returned an error"),latencyMs:b,status:c});return e.NextResponse.json({ok:!0,latencyMs:b,status:c,responseText:a.content.filter(a=>"text"===a.type).map(a=>a.text).join("").slice(0,300)})}finally{clearTimeout(t)}}catch(a){return e.NextResponse.json({ok:!1,error:a instanceof Error?a.message:String(a)},{status:500})}finally{b&&(0,f.rmSync)(b,{recursive:!0,force:!0})}}d()}catch(a){d(a)}})},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19821:a=>{"use strict";a.exports=import("@earendil-works/pi-ai/compat")},21820:a=>{"use strict";a.exports=require("os")},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")},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,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))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"))}},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},85923:(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/models-config/test/route",pathname:"/api/models-config/test",filename:"route",bundlePath:"app/api/models-config/test/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/models-config/test/route.ts",nextConfigOutput:"standalone",userland:()=>c(12773),...{}}),{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/models-config/test/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")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=85923));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=9502,a.ids=[9502],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")},6999:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Tu:()=>o,o$:()=>n});var e=c(73024),f=c(76760),g=c(80974),h=c.n(g),i=c(75430),j=c(8102),k=a([i]);i=(k.then?(await k)():k)[0];let p={retries:{retries:10,factor:2,minTimeout:50,maxTimeout:2e3,randomize:!0},stale:3e4};function l(){return(0,f.join)((0,i.getAgentDir)(),"settings.json")}function m(){let a=l();if(!(0,e.existsSync)(a))return{};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return null===b||"object"!=typeof b||Array.isArray(b)?{}:b}catch{return{}}}async function n(a){let b=l(),c=null,d=await h().lock(b,{...p,onCompromised:a=>{c=a}});try{if(c)throw c;let d=m(),e=await a(d);if(c)throw c;if(!e||"object"!=typeof e||!e.settings)throw Error("settings.json mutation must return { settings }");if(!1===e.changed)return{changed:!1};if((0,j.$)(b,JSON.stringify(e.settings,null,2)),c)throw c;return{changed:!0}}finally{d().catch(()=>{})}}function o(){return m()}d()}catch(a){d(a)}})},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")},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")},22241:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,PUT:()=>i,dynamic:()=>j});var e=c(23211),f=c(64735),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(a){let b=new URL(a.url).searchParams.get("session");return e.NextResponse.json((0,f.lN)(b||null))}async function i(a){try{let b=new URL(a.url).searchParams.get("session"),c=await a.json(),d=(0,f.lN)(b||null),g=c.collaborationMode,h=c.tokenMode,i=c.toolApprovalMode,j=c.permissionRules,k={collaborationMode:"normal"===g||"plan"===g||"goal"===g?g:d.collaborationMode,tokenMode:"full"===h||"economy"===h||"delivery"===h?h:d.tokenMode,toolApprovalMode:"ask"===i||"auto"===i||"yolo"===i?i:d.toolApprovalMode,permissionRules:j&&"object"==typeof j&&!Array.isArray(j)?{allow:Array.isArray(j.allow)?j.allow:d.permissionRules.allow,ask:Array.isArray(j.ask)?j.ask:d.permissionRules.ask,deny:Array.isArray(j.deny)?j.deny:d.permissionRules.deny}:d.permissionRules};return await (0,f.S3)(k,b||null),e.NextResponse.json({success:!0,modes: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)}})},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")},36193:(a,b,c)=>{"use strict";c.d(b,{LD:()=>m,kP:()=>o,ni:()=>n});var d=c(67264);function e(a){if(!a)return[];let b=[];for(let c of a){let a=function(a){let b=a.trim();if(!b)return null;let c=b.indexOf("="),d=b.indexOf("(");if(c>0&&(d<0||c<d)){let a=b.slice(0,c).trim();return a?{tool:a,subject:b.slice(c+1),literal:!0}:null}if(d>=0&&b.endsWith(")")){let a=b.slice(0,d).trim();return a?{tool:a,subject:b.slice(d+1,-1)}:null}return{tool:b}}(c);a&&b.push(a)}return b}function f(a){return void 0===a.subject?a.tool:a.literal?`${a.tool}=${a.subject}`:`${a.tool}(${a.subject})`}function g(a){return a.includes("*")||a.includes("?")}function h(a,b){return void 0===b.subject||""!==a&&(b.literal||!g(b.subject)?a===b.subject:(function(a){let b="^";for(let c of a)"*"===c?b+=".*":"?"===c?b+=".":b+=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return RegExp(b+"$")})(b.subject).test(a))}function i(a,b){return a.toLowerCase()===b.toLowerCase()}function j(a,b,c){for(let d of a)if(i(d.tool,b)&&h(c,d))return!0;return!1}function k(a){let b=a.trim();return!!b&&!!(/\$\(/.test(b)||/`/.test(b)||/(^|\s)(python|python3|node|ruby|perl|php)\s+-[a-z]*c(\s|$)/i.test(b)||/(^|\s)(sh|bash|zsh)\s+-c(\s|$)/i.test(b)||/(^|\s)(sudo|su)\s/i.test(b)||/;\s*[a-z]/i.test(b)||/\|\s*(sh|bash|zsh|python|python3|node)\b/i.test(b)||/\|\s*tee\b/i.test(b))}let l=["ls","cat","head","tail","grep","rg","find","wc","echo","pwd","cd","git status","git diff","git log","git branch","git remote","git stash list","git show","git ls-files","which","type","env","file","stat","du","df","history","man","less","more","tree","git diff --","git log --","curl -I","curl --head"];function m(a,b,c={}){let e=c.mode??"auto",f=c.readOnly??d.MJ.has(b.toLowerCase()),n=function(a,b){if("bash"===a.toLowerCase()){let a=b?.command;return"string"==typeof a&&a.trim()?`command:${a.trim()}`:""}let c=b??{},d="string"==typeof c.source_path?c.source_path:"",e="string"==typeof c.destination_path?c.destination_path:"";if(d&&e)return e!==d?`${d}\u0000${e}`:d;for(let a of["path","file_path","file","glob","pattern","directory"]){let b=c[a];if("string"==typeof b&&b)return b}return""}(b,c.args),o="bash"===b.toLowerCase(),p=o&&n.startsWith("command:")?n.slice(8):"";if(j(a.deny,b,n))return"deny";if(o&&p){let c=k(p);return j(a.allow,b,n)&&!c?"allow":j(a.ask,b,n)?"ask":c?a.allow.some(a=>i(a.tool,b)&&void 0!==a.subject&&!g(a.subject)&&h(n,a))||"yolo"===e?"allow":"ask":!function(a){let b=a.trim();if(!b||k(b)||/[;&|>]/.test(b))return!1;let c=b.toLowerCase();for(let a of l)if(c===a||c.startsWith(a+" "))return!0;return!1}(p)?"ask"===e?"ask":"allow":"allow"}return j(a.allow,b,n)?"allow":j(a.ask,b,n)?"ask":f?"allow":"ask"===e?"ask":"allow"}function n(a){return{allow:e(a?.allow),ask:e(a?.ask),deny:e(a?.deny)}}function o(a){return{allow:a.allow.map(f),ask:a.ask.map(f),deny:a.deny.map(f)}}},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")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64735:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{S3:()=>k,lN:()=>j});var e=c(6999),f=c(67264),g=c(36193),h=a([e]);e=(h.then?(await h)():h)[0];let l="modes",m="modesPerSession";function i(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b=a.permissionRules,c=(0,g.kP)((0,g.ni)(b));return{collaborationMode:(0,f.UY)(a.collaborationMode),tokenMode:(0,f.wI)(a.tokenMode),toolApprovalMode:(0,f.g0)(a.toolApprovalMode),permissionRules:{allow:Array.isArray(c.allow)?c.allow:[],ask:Array.isArray(c.ask)?c.ask:[],deny:Array.isArray(c.deny)?c.deny:[]}}}function j(a){let b=(0,f.Md)(),c=(0,e.Tu)();if(a){let b=c[m];if(b&&"object"==typeof b&&!Array.isArray(b)){let c=i(b[a]);if(c)return c}}return i(c[l])??b}async function k(a,b){let c={collaborationMode:(0,f.UY)(a.collaborationMode),tokenMode:(0,f.wI)(a.tokenMode),toolApprovalMode:(0,f.g0)(a.toolApprovalMode),permissionRules:a.permissionRules};await (0,e.o$)(a=>{if(b){let d=a[m]??{};d[b]=c,a[m]=d}else a[l]=c;return{settings:a}})}d()}catch(a){d(a)}})},67264:(a,b,c)=>{"use strict";c.d(b,{CS:()=>l,MJ:()=>k,Md:()=>g,UY:()=>h,g0:()=>j,wI:()=>i});let d="normal",e="full",f="auto";function g(){return{collaborationMode:d,tokenMode:e,toolApprovalMode:f,permissionRules:{allow:[],ask:[],deny:[]}}}function h(a){return"normal"===a||"plan"===a||"goal"===a?a:d}function i(a){return"economy"===a||"delivery"===a||"full"===a?a:e}function j(a){return"ask"===a||"auto"===a||"yolo"===a?a:f}let k=new Set(["read","grep","find","ls","bash_output","get_tools","get_commands","get_session_stats"]);function l(a){if(!a)return"";let b=a.replace(/^\uFEFF/,""),c=b;if((b=b.replace(/<(?:economy|delivery|goal)-profile>\n?[\s\S]*?<\/(?:economy|delivery|goal)-profile>\n*(?:Goal:\s*[^\n]*\n?)?/g,""))===c){let a=/^\s*<(?:economy|delivery|goal)-profile>\s*/.exec(b);if(a){let c=b.slice(a[0].length).match(/^[^.]*?\.\s+([\s\S]*)$/);b=c?c[1]:""}}return(b=b.replace(/^You are in PLAN MODE\.[\s\S]*?\n(?=\n|$)/,"")).replace(/^\s*\n/,"").trimStart()}},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")},78335:()=>{},80042:(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/modes/route",pathname:"/api/modes",filename:"route",bundlePath:"app/api/modes/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/modes/route.ts",nextConfigOutput:"standalone",userland:()=>c(22241),...{}}),{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/modes/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)}}},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=80042));module.exports=c})();
1
+ (()=>{var a={};a.id=9502,a.ids=[9502],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},927:(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/modes/route",pathname:"/api/modes",filename:"route",bundlePath:"app/api/modes/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/modes/route.ts",nextConfigOutput:"standalone",userland:()=>c(22241),...{}}),{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/modes/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)}}},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6999:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Tu:()=>o,o$:()=>n});var e=c(73024),f=c(76760),g=c(80974),h=c.n(g),i=c(75430),j=c(8102),k=a([i]);i=(k.then?(await k)():k)[0];let p={retries:{retries:10,factor:2,minTimeout:50,maxTimeout:2e3,randomize:!0},stale:3e4};function l(){return(0,f.join)((0,i.getAgentDir)(),"settings.json")}function m(){let a=l();if(!(0,e.existsSync)(a))return{};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return null===b||"object"!=typeof b||Array.isArray(b)?{}:b}catch{return{}}}async function n(a){let b=l(),c=null,d=await h().lock(b,{...p,onCompromised:a=>{c=a}});try{if(c)throw c;let d=m(),e=await a(d);if(c)throw c;if(!e||"object"!=typeof e||!e.settings)throw Error("settings.json mutation must return { settings }");if(!1===e.changed)return{changed:!1};if((0,j.$)(b,JSON.stringify(e.settings,null,2)),c)throw c;return{changed:!0}}finally{d().catch(()=>{})}}function o(){return m()}d()}catch(a){d(a)}})},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")},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")},22241:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,PUT:()=>i,dynamic:()=>j});var e=c(23211),f=c(64735),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(a){let b=new URL(a.url).searchParams.get("session");return e.NextResponse.json((0,f.lN)(b||null))}async function i(a){try{let b=new URL(a.url).searchParams.get("session"),c=await a.json(),d=(0,f.lN)(b||null),g=c.collaborationMode,h=c.tokenMode,i=c.toolApprovalMode,j=c.permissionRules,k={collaborationMode:"normal"===g||"plan"===g||"goal"===g?g:d.collaborationMode,tokenMode:"full"===h||"economy"===h||"delivery"===h?h:d.tokenMode,toolApprovalMode:"ask"===i||"auto"===i||"yolo"===i?i:d.toolApprovalMode,permissionRules:j&&"object"==typeof j&&!Array.isArray(j)?{allow:Array.isArray(j.allow)?j.allow:d.permissionRules.allow,ask:Array.isArray(j.ask)?j.ask:d.permissionRules.ask,deny:Array.isArray(j.deny)?j.deny:d.permissionRules.deny}:d.permissionRules};return await (0,f.S3)(k,b||null),e.NextResponse.json({success:!0,modes: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)}})},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")},36193:(a,b,c)=>{"use strict";c.d(b,{LD:()=>m,kP:()=>o,ni:()=>n});var d=c(67264);function e(a){if(!a)return[];let b=[];for(let c of a){let a=function(a){let b=a.trim();if(!b)return null;let c=b.indexOf("="),d=b.indexOf("(");if(c>0&&(d<0||c<d)){let a=b.slice(0,c).trim();return a?{tool:a,subject:b.slice(c+1),literal:!0}:null}if(d>=0&&b.endsWith(")")){let a=b.slice(0,d).trim();return a?{tool:a,subject:b.slice(d+1,-1)}:null}return{tool:b}}(c);a&&b.push(a)}return b}function f(a){return void 0===a.subject?a.tool:a.literal?`${a.tool}=${a.subject}`:`${a.tool}(${a.subject})`}function g(a){return a.includes("*")||a.includes("?")}function h(a,b){return void 0===b.subject||""!==a&&(b.literal||!g(b.subject)?a===b.subject:(function(a){let b="^";for(let c of a)"*"===c?b+=".*":"?"===c?b+=".":b+=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return RegExp(b+"$")})(b.subject).test(a))}function i(a,b){return a.toLowerCase()===b.toLowerCase()}function j(a,b,c){for(let d of a)if(i(d.tool,b)&&h(c,d))return!0;return!1}function k(a){let b=a.trim();return!!b&&!!(/\$\(/.test(b)||/`/.test(b)||/(^|\s)(python|python3|node|ruby|perl|php)\s+-[a-z]*c(\s|$)/i.test(b)||/(^|\s)(sh|bash|zsh)\s+-c(\s|$)/i.test(b)||/(^|\s)(sudo|su)\s/i.test(b)||/;\s*[a-z]/i.test(b)||/\|\s*(sh|bash|zsh|python|python3|node)\b/i.test(b)||/\|\s*tee\b/i.test(b))}let l=["ls","cat","head","tail","grep","rg","find","wc","echo","pwd","cd","git status","git diff","git log","git branch","git remote","git stash list","git show","git ls-files","which","type","env","file","stat","du","df","history","man","less","more","tree","git diff --","git log --","curl -I","curl --head"];function m(a,b,c={}){let e=c.mode??"auto",f=c.readOnly??d.MJ.has(b.toLowerCase()),n=function(a,b){if("bash"===a.toLowerCase()){let a=b?.command;return"string"==typeof a&&a.trim()?`command:${a.trim()}`:""}let c=b??{},d="string"==typeof c.source_path?c.source_path:"",e="string"==typeof c.destination_path?c.destination_path:"";if(d&&e)return e!==d?`${d}\u0000${e}`:d;for(let a of["path","file_path","file","glob","pattern","directory"]){let b=c[a];if("string"==typeof b&&b)return b}return""}(b,c.args),o="bash"===b.toLowerCase(),p=o&&n.startsWith("command:")?n.slice(8):"";if(j(a.deny,b,n))return"deny";if(o&&p){let c=k(p);return j(a.allow,b,n)&&!c?"allow":j(a.ask,b,n)?"ask":c?a.allow.some(a=>i(a.tool,b)&&void 0!==a.subject&&!g(a.subject)&&h(n,a))||"yolo"===e?"allow":"ask":!function(a){let b=a.trim();if(!b||k(b)||/[;&|>]/.test(b))return!1;let c=b.toLowerCase();for(let a of l)if(c===a||c.startsWith(a+" "))return!0;return!1}(p)?"ask"===e?"ask":"allow":"allow"}return j(a.allow,b,n)?"allow":j(a.ask,b,n)?"ask":f?"allow":"ask"===e?"ask":"allow"}function n(a){return{allow:e(a?.allow),ask:e(a?.ask),deny:e(a?.deny)}}function o(a){return{allow:a.allow.map(f),ask:a.ask.map(f),deny:a.deny.map(f)}}},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")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64735:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{S3:()=>k,lN:()=>j});var e=c(6999),f=c(67264),g=c(36193),h=a([e]);e=(h.then?(await h)():h)[0];let l="modes",m="modesPerSession";function i(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b=a.permissionRules,c=(0,g.kP)((0,g.ni)(b));return{collaborationMode:(0,f.UY)(a.collaborationMode),tokenMode:(0,f.wI)(a.tokenMode),toolApprovalMode:(0,f.g0)(a.toolApprovalMode),permissionRules:{allow:Array.isArray(c.allow)?c.allow:[],ask:Array.isArray(c.ask)?c.ask:[],deny:Array.isArray(c.deny)?c.deny:[]}}}function j(a){let b=(0,f.Md)(),c=(0,e.Tu)();if(a){let b=c[m];if(b&&"object"==typeof b&&!Array.isArray(b)){let c=i(b[a]);if(c)return c}}return i(c[l])??b}async function k(a,b){let c={collaborationMode:(0,f.UY)(a.collaborationMode),tokenMode:(0,f.wI)(a.tokenMode),toolApprovalMode:(0,f.g0)(a.toolApprovalMode),permissionRules:a.permissionRules};await (0,e.o$)(a=>{if(b){let d=a[m]??{};d[b]=c,a[m]=d}else a[l]=c;return{settings:a}})}d()}catch(a){d(a)}})},67264:(a,b,c)=>{"use strict";c.d(b,{CS:()=>l,MJ:()=>k,Md:()=>g,UY:()=>h,g0:()=>j,wI:()=>i});let d="normal",e="full",f="auto";function g(){return{collaborationMode:d,tokenMode:e,toolApprovalMode:f,permissionRules:{allow:[],ask:[],deny:[]}}}function h(a){return"normal"===a||"plan"===a||"goal"===a?a:d}function i(a){return"economy"===a||"delivery"===a||"full"===a?a:e}function j(a){return"ask"===a||"auto"===a||"yolo"===a?a:f}let k=new Set(["read","grep","find","ls","bash_output","get_tools","get_commands","get_session_stats"]);function l(a){if(!a)return"";let b=a.replace(/^\uFEFF/,""),c=b;if((b=b.replace(/<(?:economy|delivery|goal)-profile>\n?[\s\S]*?<\/(?:economy|delivery|goal)-profile>\n*(?:Goal:\s*[^\n]*\n?)?/g,""))===c){let a=/^\s*<(?:economy|delivery|goal)-profile>\s*/.exec(b);if(a){let c=b.slice(a[0].length).match(/^[^.]*?\.\s+([\s\S]*)$/);b=c?c[1]:""}}return(b=b.replace(/^You are in PLAN MODE\.[\s\S]*?\n(?=\n|$)/,"")).replace(/^\s*\n/,"").trimStart()}},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")},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=927));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=2403,a.ids=[2403],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")},10595:(a,b,c)=>{c.d(b,{f:()=>g});var d=c(29021),e=c(33873);let f=require("process");function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},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")},22620:(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/plugins/check/route",pathname:"/api/plugins/check",filename:"route",bundlePath:"app/api/plugins/check/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/plugins/check/route.ts",nextConfigOutput:"standalone",userland:()=>c(97982),...{}}),{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/plugins/check/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")},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")},65742:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Q:()=>u,t:()=>p});var e=c(79646),f=c(29021),g=c(33873),h=c(28354),i=c(75430),j=c(43618),k=c(10595),l=c(72498),m=a([i,l]);[i,l]=m.then?(await m)():m;let v=(0,h.promisify)(e.execFile);function n(a){return"project"===a?"project":"global"}function o(a){if(!a.startsWith("npm:"))return;let b=a.slice(4).trim(),c=b.match(/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/);return{name:c?.[1]??b,spec:b,version:c?.[2]}}function p(a){let b=o(a);return b?null===(0,j.valid)(b.version??""):!!(a.startsWith("git:")||/^(https?|ssh|git):\/\//i.test(a))&&!function(a){let b=a.startsWith("git:")?a.slice(4).trim():a.trim(),c=b.match(/^git@[^:]+:(.+)$/)?.[1];if(c)return c.includes("@");if(b.includes("://"))try{return new URL(b).pathname.replace(/^\/+/,"").includes("@")}catch{return!1}let d=b.indexOf("/");return d>=0&&b.slice(d+1).includes("@")}(a)}function q(a,b,c){let d=o(a.source);return{source:a.source,scope:n(a.scope),displayName:d?.name??a.source,type:d?"npm":"git",state:b,message:c}}async function r(a,b,c){let d="npm"===a?(0,k.f)("npm",b):{command:a,args:b},{stdout:e}=await v(d.command,d.args,{cwd:c.cwd,env:c.env?{...process.env,...c.env}:process.env,encoding:"utf8",timeout:1e4});return e}async function s(a,b,c,d){if(!a.installedPath||!(0,f.existsSync)(a.installedPath))return q(a,"error","Package is not installed.");let e=o(a.source);if(!e)return q(a,"unsupported");let[h="npm",...i]=c??[];if(!h)return q(a,"error","Invalid npmCommand.");let k=function(a){let b=JSON.parse((0,f.readFileSync)((0,g.join)(a,"package.json"),"utf8"));if("string"!=typeof b.version||!(0,j.valid)(b.version))throw Error("Installed package version is unavailable.");return b.version}(a.installedPath),l=await d(h,[...i,"view",e.spec,"version","--json"],{cwd:b}),m=e.version?(0,j.validRange)(e.version)??void 0:void 0,n=function(a,b){let c=JSON.parse(a.trim());if("string"==typeof c&&(0,j.valid)(c))return c;if(Array.isArray(c)){let a=c.filter(a=>"string"==typeof a&&null!==(0,j.valid)(a)),d=b?(0,j.maxSatisfying)(a,b):a.sort(j.rcompare)[0];if(d)return d}throw Error("Unexpected response from npm view.")}(l,m);return q(a,(0,j.gt)(n,k)?"update-available":"up-to-date")}async function t(a,b){if(!a.installedPath||!(0,f.existsSync)(a.installedPath))return q(a,"error","Package is not installed.");let c={cwd:a.installedPath,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}},d=(await b("git",["rev-parse","HEAD"],c)).trim(),e=await b("git",["rev-parse","--abbrev-ref","@{upstream}"],c).then(a=>a.trim()).catch(()=>""),g=e.startsWith("origin/")?`refs/heads/${e.slice(7)}`:"HEAD",h=await b("git",["ls-remote","origin",g],c),i=h.match(/^([0-9a-f]{40,64})\s+/m)?.[1];if(!i)throw Error(`Failed to determine remote ${g}.`);return q(a,d===i?"up-to-date":"update-available")}async function u(a,b,c={}){let d=c.packages,e=c.npmCommand;if(!d){let b=(0,i.getAgentDir)(),c=(0,l.Y1)(a,b),f=i.SettingsManager.create(a,b,{projectTrusted:c.trusted});d=new i.DefaultPackageManager({cwd:a,agentDir:b,settingsManager:f}).listConfiguredPackages(),e??=f.getNpmCommand()}let f=d.filter(a=>!b?.source||a.source===b.source&&n(a.scope)===b.scope),g=c.runCommand??r;return Promise.all(f.map(async b=>{if(!p(b.source))return q(b,"unsupported","Pinned or local packages cannot be checked automatically.");if(/^(1|true|yes)$/i.test(process.env.PI_OFFLINE??""))return q(b,"error","Update checks are disabled while PI_OFFLINE=1.");try{return o(b.source)?await s(b,a,e,g):await t(b,g)}catch(a){return q(b,"error",a instanceof Error?a.message:String(a))}}))}d()}catch(a){d(a)}})},72498:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Fk:()=>i,Y1:()=>g,er:()=>h});var e=c(75430),f=a([e]);function g(a,b){return a&&(0,e.hasTrustRequiringProjectResources)(a)?{requiresTrust:!0,trusted:!0===new e.ProjectTrustStore(b).get(a)}:{requiresTrust:!1,trusted:!0}}function h(a,b){let c=g(a,b);return c.requiresTrust?(new e.ProjectTrustStore(b).set(a,!0),{requiresTrust:!0,trusted:!0}):c}function i(a,b){if(!g(a,b).requiresTrust)return;let c=new e.ProjectTrustStore(b);return{resolveProjectTrust:async()=>!0===c.get(a)}}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},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")},97982:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(80547),g=c(65742),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd:"";if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});let d=await (0,f.mc)();if(!(0,f.B7)(c,d))return e.NextResponse.json({error:"Access denied"},{status:403});let h="string"==typeof b.source?b.source:void 0,i="global"===b.scope||"project"===b.scope?b.scope:void 0;if(h&&!i||!h&&i)return e.NextResponse.json({error:"source and scope must be provided together"},{status:400});let j=await (0,g.Q)(c,h&&i?{source:h,scope:i}:void 0);if(h&&i&&0===j.length)return e.NextResponse.json({error:"Configured package not found"},{status:404});return e.NextResponse.json({updates:j})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,3618,5582],()=>b(b.s=22620));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=2403,a.ids=[2403],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")},10595:(a,b,c)=>{c.d(b,{f:()=>g});var d=c(29021),e=c(33873);let f=require("process");function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},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")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},62217:(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/plugins/check/route",pathname:"/api/plugins/check",filename:"route",bundlePath:"app/api/plugins/check/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/plugins/check/route.ts",nextConfigOutput:"standalone",userland:()=>c(97982),...{}}),{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/plugins/check/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")},65742:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Q:()=>u,t:()=>p});var e=c(79646),f=c(29021),g=c(33873),h=c(28354),i=c(75430),j=c(43618),k=c(10595),l=c(72498),m=a([i,l]);[i,l]=m.then?(await m)():m;let v=(0,h.promisify)(e.execFile);function n(a){return"project"===a?"project":"global"}function o(a){if(!a.startsWith("npm:"))return;let b=a.slice(4).trim(),c=b.match(/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/);return{name:c?.[1]??b,spec:b,version:c?.[2]}}function p(a){let b=o(a);return b?null===(0,j.valid)(b.version??""):!!(a.startsWith("git:")||/^(https?|ssh|git):\/\//i.test(a))&&!function(a){let b=a.startsWith("git:")?a.slice(4).trim():a.trim(),c=b.match(/^git@[^:]+:(.+)$/)?.[1];if(c)return c.includes("@");if(b.includes("://"))try{return new URL(b).pathname.replace(/^\/+/,"").includes("@")}catch{return!1}let d=b.indexOf("/");return d>=0&&b.slice(d+1).includes("@")}(a)}function q(a,b,c){let d=o(a.source);return{source:a.source,scope:n(a.scope),displayName:d?.name??a.source,type:d?"npm":"git",state:b,message:c}}async function r(a,b,c){let d="npm"===a?(0,k.f)("npm",b):{command:a,args:b},{stdout:e}=await v(d.command,d.args,{cwd:c.cwd,env:c.env?{...process.env,...c.env}:process.env,encoding:"utf8",timeout:1e4});return e}async function s(a,b,c,d){if(!a.installedPath||!(0,f.existsSync)(a.installedPath))return q(a,"error","Package is not installed.");let e=o(a.source);if(!e)return q(a,"unsupported");let[h="npm",...i]=c??[];if(!h)return q(a,"error","Invalid npmCommand.");let k=function(a){let b=JSON.parse((0,f.readFileSync)((0,g.join)(a,"package.json"),"utf8"));if("string"!=typeof b.version||!(0,j.valid)(b.version))throw Error("Installed package version is unavailable.");return b.version}(a.installedPath),l=await d(h,[...i,"view",e.spec,"version","--json"],{cwd:b}),m=e.version?(0,j.validRange)(e.version)??void 0:void 0,n=function(a,b){let c=JSON.parse(a.trim());if("string"==typeof c&&(0,j.valid)(c))return c;if(Array.isArray(c)){let a=c.filter(a=>"string"==typeof a&&null!==(0,j.valid)(a)),d=b?(0,j.maxSatisfying)(a,b):a.sort(j.rcompare)[0];if(d)return d}throw Error("Unexpected response from npm view.")}(l,m);return q(a,(0,j.gt)(n,k)?"update-available":"up-to-date")}async function t(a,b){if(!a.installedPath||!(0,f.existsSync)(a.installedPath))return q(a,"error","Package is not installed.");let c={cwd:a.installedPath,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}},d=(await b("git",["rev-parse","HEAD"],c)).trim(),e=await b("git",["rev-parse","--abbrev-ref","@{upstream}"],c).then(a=>a.trim()).catch(()=>""),g=e.startsWith("origin/")?`refs/heads/${e.slice(7)}`:"HEAD",h=await b("git",["ls-remote","origin",g],c),i=h.match(/^([0-9a-f]{40,64})\s+/m)?.[1];if(!i)throw Error(`Failed to determine remote ${g}.`);return q(a,d===i?"up-to-date":"update-available")}async function u(a,b,c={}){let d=c.packages,e=c.npmCommand;if(!d){let b=(0,i.getAgentDir)(),c=(0,l.Y1)(a,b),f=i.SettingsManager.create(a,b,{projectTrusted:c.trusted});d=new i.DefaultPackageManager({cwd:a,agentDir:b,settingsManager:f}).listConfiguredPackages(),e??=f.getNpmCommand()}let f=d.filter(a=>!b?.source||a.source===b.source&&n(a.scope)===b.scope),g=c.runCommand??r;return Promise.all(f.map(async b=>{if(!p(b.source))return q(b,"unsupported","Pinned or local packages cannot be checked automatically.");if(/^(1|true|yes)$/i.test(process.env.PI_OFFLINE??""))return q(b,"error","Update checks are disabled while PI_OFFLINE=1.");try{return o(b.source)?await s(b,a,e,g):await t(b,g)}catch(a){return q(b,"error",a instanceof Error?a.message:String(a))}}))}d()}catch(a){d(a)}})},72498:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Fk:()=>i,Y1:()=>g,er:()=>h});var e=c(75430),f=a([e]);function g(a,b){return a&&(0,e.hasTrustRequiringProjectResources)(a)?{requiresTrust:!0,trusted:!0===new e.ProjectTrustStore(b).get(a)}:{requiresTrust:!1,trusted:!0}}function h(a,b){let c=g(a,b);return c.requiresTrust?(new e.ProjectTrustStore(b).set(a,!0),{requiresTrust:!0,trusted:!0}):c}function i(a,b){if(!g(a,b).requiresTrust)return;let c=new e.ProjectTrustStore(b);return{resolveProjectTrust:async()=>!0===c.get(a)}}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},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")},97982:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(80547),g=c(65742),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd:"";if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});let d=await (0,f.mc)();if(!(0,f.B7)(c,d))return e.NextResponse.json({error:"Access denied"},{status:403});let h="string"==typeof b.source?b.source:void 0,i="global"===b.scope||"project"===b.scope?b.scope:void 0;if(h&&!i||!h&&i)return e.NextResponse.json({error:"source and scope must be provided together"},{status:400});let j=await (0,g.Q)(c,h&&i?{source:h,scope:i}:void 0);if(h&&i&&0===j.length)return e.NextResponse.json({error:"Configured package not found"},{status:404});return e.NextResponse.json({updates:j})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,3618,5582],()=>b(b.s=62217));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=9742,a.ids=[9742],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")},10595:(a,b,c)=>{c.d(b,{f:()=>g});var d=c(29021),e=c(33873);let f=require("process");function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},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")},32493:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>w,POST:()=>x,dynamic:()=>y});var e=c(23211),f=c(29021),g=c(76760),h=c(75430),i=c(80547),j=c(66544),k=c(72498),l=c(65742),m=a([h,i,k,l]);[h,i,k,l]=m.then?(await m)():m;let y="force-dynamic";function n(){return{extensions:0,skills:0,prompts:0,themes:0}}function o(a){return"project"===a?"project":"global"}function p(a,b){return`${b}\0${a}`}function q(a){return"string"==typeof a?a:a.source}function r(a){return"string"!=typeof a&&Array.isArray(a.extensions)&&0===a.extensions.length&&Array.isArray(a.skills)&&0===a.skills.length&&Array.isArray(a.prompts)&&0===a.prompts.length&&Array.isArray(a.themes)&&0===a.themes.length}function s(a,b,c,d){let e="project"===c?a.getProjectSettings().packages??[]:a.getGlobalSettings().packages??[],f=!1,g=e.map(a=>q(a)!==b?a:(f=!0,d)?{..."string"==typeof a?{source:a}:a,extensions:[],skills:[],prompts:[],themes:[]}:q(a));return!!f&&("project"===c?a.setProjectPackages(g):a.setPackages(g),!0)}function t(a,b){var c,d;let e,f;return{kind:b,name:(c=a.path,d=b,e=(0,g.basename)(c),f=(0,g.extname)(e),"skill"===d&&"skill.md"===e.toLowerCase()?(0,g.basename)((0,g.dirname)(c)):("extension"===d||"theme"===d||"prompt"===d)&&f?"extension"===d&&/^index\.(ts|js)$/.test(e)?(0,g.basename)((0,g.dirname)(c)):e.slice(0,-f.length):e),path:a.path,relativePath:function(a){let b=a.metadata.baseDir;if(!b)return a.path;let c=(0,g.relative)(b,a.path);return c&&!c.startsWith("..")?c.split(g.sep).join("/"):a.path}(a)}}function u(a,b,c,d,e){if(!a.enabled||"package"!==a.metadata.origin)return;let f=a.metadata.source,g=o(a.metadata.scope),h=p(f,g),i=c.get(h)??n();i[b]+=1,e[b]+=1,c.set(h,i);let j=d.get(h)??[];j.push(t(a,"extensions"===b?"extension":"skills"===b?"skill":"prompts"===b?"prompt":"theme")),d.set(h,j)}async function v(a){let b=(0,h.getAgentDir)(),c=(0,k.Y1)(a,b),d=h.SettingsManager.create(a,b,{projectTrusted:c.trusted}),e=new h.DefaultPackageManager({cwd:a,agentDir:b,settingsManager:d}),i=[],j=new Map,m=new Map,s=[],v=n(),w=function(a){let b=new Map;for(let c of a.getGlobalSettings().packages??[])b.set(p(q(c),"global"),r(c));for(let c of a.getProjectSettings().packages??[])b.set(p(q(c),"project"),r(c));return b}(d);try{let a=await e.resolve(async a=>(i.push({type:"warning",source:a,message:"Package is configured but not installed yet."}),"skip"));({countsByPackage:j,resourcesByPackage:m,standaloneExtensions:s,totals:v}=function(a){let b=new Map,c=new Map,d=n();for(let e of a.extensions)u(e,"extensions",b,c,d);for(let e of a.skills)u(e,"skills",b,c,d);for(let e of a.prompts)u(e,"prompts",b,c,d);for(let e of a.themes)u(e,"themes",b,c,d);let e=a.extensions.filter(a=>"top-level"===a.metadata.origin).map(a=>({...t(a,"extension"),kind:"extension",scope:o(a.metadata.scope),enabled:a.enabled}));return d.extensions+=e.filter(a=>a.enabled).length,{countsByPackage:b,resourcesByPackage:c,standaloneExtensions:e,totals:d}}(a))}catch(a){i.push({type:"error",message:a instanceof Error?a.message:String(a)})}return{packages:e.listConfiguredPackages().map(a=>{let b=o(a.scope),c=p(a.source,b),d=w.get(c)??!1,e=j.get(c)??n(),h=m.get(c)??[],k=e.extensions+e.skills+e.prompts+e.themes,q=function(a){if(!a)return{};try{let b=(0,f.statSync)(a).isDirectory()?(0,g.join)(a,"package.json"):(0,g.join)((0,g.dirname)(a),"package.json");if(!(0,f.existsSync)(b))return{};let c=JSON.parse((0,f.readFileSync)(b,"utf8"));return{packageName:"string"==typeof c.name?c.name:void 0,version:"string"==typeof c.version?c.version:void 0,description:"string"==typeof c.description?c.description:void 0}}catch{return{}}}(a.installedPath);return a.installedPath||i.push({type:"warning",source:a.source,message:"Configured package path was not found."}),{source:a.source,scope:b,canCheckForUpdates:(0,l.t)(a.source),filtered:a.filtered,disabled:d,installedPath:a.installedPath,packageName:q.packageName,version:q.version,configuredVersion:function(a){let b=a.startsWith("npm:")?a.slice(4):void 0;if(b){let a=b.lastIndexOf("@"),c=b.startsWith("@")?b.indexOf("/",1):0;return a>c&&b.slice(a+1)||void 0}if(a.startsWith("git:")||/^[a-z]+:\/\//.test(a)){let b=a.lastIndexOf("@"),c=a.lastIndexOf("/"),d=a.lastIndexOf(":");if(b>Math.max(c,d))return a.slice(b+1)||void 0}}(a.source),description:q.description,counts:e,resources:h,status:d?"disabled":k>0?"loaded":a.installedPath?"installed":"missing"}}),standaloneExtensions:s,totals:v,diagnostics:i,projectResourcesLoaded:c.trusted}}async function w(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=await (0,i.mc)();if(!(0,i.A$)(c,a))return e.NextResponse.json({error:"Access denied"},{status:403});return e.NextResponse.json(await v(c))}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function x(a){if(!(0,j.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,j.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{var b;let c=await a.json();if(!c.cwd)return e.NextResponse.json({error:"cwd required"},{status:400});if(!c.action)return e.NextResponse.json({error:"action required"},{status:400});let d=await (0,i.mc)();if(!(0,i.A$)(c.cwd,d))return e.NextResponse.json({error:"Access denied"},{status:403});let f=(0,h.getAgentDir)(),g=(0,k.Y1)(c.cwd,f),j=h.SettingsManager.create(c.cwd,f,{projectTrusted:g.trusted}),l=(b=c.scope,"project"===b?"project":"global");if("project"===l&&!g.trusted)return e.NextResponse.json({error:"Project resources must be trusted before modifying project plugins"},{status:403});let m=new h.DefaultPackageManager({cwd:c.cwd,agentDir:f,settingsManager:j}),n=c.source?.trim(),o="project"===l;if("install"===c.action){if(!n)return e.NextResponse.json({error:"source required"},{status:400});await m.installAndPersist(n,{local:o})}else if("remove"===c.action){if(!n)return e.NextResponse.json({error:"source required"},{status:400});await m.removeAndPersist(n,{local:o})}else if("update"===c.action){if(!n&&!g.trusted&&m.listConfiguredPackages().some(a=>"project"===a.scope))return e.NextResponse.json({error:"Project resources must be trusted before updating project plugins"},{status:403});await m.update(n)}else if("disable"===c.action){if(!n)return e.NextResponse.json({error:"source required"},{status:400});s(j,n,l,!0),await j.flush()}else{if("enable"!==c.action)return e.NextResponse.json({error:`Unsupported action: ${c.action}`},{status:400});if(!n)return e.NextResponse.json({error:"source required"},{status:400});s(j,n,l,!1),await j.flush()}return e.NextResponse.json(await v(c.cwd))}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},33873:a=>{a.exports=require("path")},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")},57078:(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/plugins/route",pathname:"/api/plugins",filename:"route",bundlePath:"app/api/plugins/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/plugins/route.ts",nextConfigOutput:"standalone",userland:()=>c(32493),...{}}),{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/plugins/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")},65742:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Q:()=>u,t:()=>p});var e=c(79646),f=c(29021),g=c(33873),h=c(28354),i=c(75430),j=c(43618),k=c(10595),l=c(72498),m=a([i,l]);[i,l]=m.then?(await m)():m;let v=(0,h.promisify)(e.execFile);function n(a){return"project"===a?"project":"global"}function o(a){if(!a.startsWith("npm:"))return;let b=a.slice(4).trim(),c=b.match(/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/);return{name:c?.[1]??b,spec:b,version:c?.[2]}}function p(a){let b=o(a);return b?null===(0,j.valid)(b.version??""):!!(a.startsWith("git:")||/^(https?|ssh|git):\/\//i.test(a))&&!function(a){let b=a.startsWith("git:")?a.slice(4).trim():a.trim(),c=b.match(/^git@[^:]+:(.+)$/)?.[1];if(c)return c.includes("@");if(b.includes("://"))try{return new URL(b).pathname.replace(/^\/+/,"").includes("@")}catch{return!1}let d=b.indexOf("/");return d>=0&&b.slice(d+1).includes("@")}(a)}function q(a,b,c){let d=o(a.source);return{source:a.source,scope:n(a.scope),displayName:d?.name??a.source,type:d?"npm":"git",state:b,message:c}}async function r(a,b,c){let d="npm"===a?(0,k.f)("npm",b):{command:a,args:b},{stdout:e}=await v(d.command,d.args,{cwd:c.cwd,env:c.env?{...process.env,...c.env}:process.env,encoding:"utf8",timeout:1e4});return e}async function s(a,b,c,d){if(!a.installedPath||!(0,f.existsSync)(a.installedPath))return q(a,"error","Package is not installed.");let e=o(a.source);if(!e)return q(a,"unsupported");let[h="npm",...i]=c??[];if(!h)return q(a,"error","Invalid npmCommand.");let k=function(a){let b=JSON.parse((0,f.readFileSync)((0,g.join)(a,"package.json"),"utf8"));if("string"!=typeof b.version||!(0,j.valid)(b.version))throw Error("Installed package version is unavailable.");return b.version}(a.installedPath),l=await d(h,[...i,"view",e.spec,"version","--json"],{cwd:b}),m=e.version?(0,j.validRange)(e.version)??void 0:void 0,n=function(a,b){let c=JSON.parse(a.trim());if("string"==typeof c&&(0,j.valid)(c))return c;if(Array.isArray(c)){let a=c.filter(a=>"string"==typeof a&&null!==(0,j.valid)(a)),d=b?(0,j.maxSatisfying)(a,b):a.sort(j.rcompare)[0];if(d)return d}throw Error("Unexpected response from npm view.")}(l,m);return q(a,(0,j.gt)(n,k)?"update-available":"up-to-date")}async function t(a,b){if(!a.installedPath||!(0,f.existsSync)(a.installedPath))return q(a,"error","Package is not installed.");let c={cwd:a.installedPath,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}},d=(await b("git",["rev-parse","HEAD"],c)).trim(),e=await b("git",["rev-parse","--abbrev-ref","@{upstream}"],c).then(a=>a.trim()).catch(()=>""),g=e.startsWith("origin/")?`refs/heads/${e.slice(7)}`:"HEAD",h=await b("git",["ls-remote","origin",g],c),i=h.match(/^([0-9a-f]{40,64})\s+/m)?.[1];if(!i)throw Error(`Failed to determine remote ${g}.`);return q(a,d===i?"up-to-date":"update-available")}async function u(a,b,c={}){let d=c.packages,e=c.npmCommand;if(!d){let b=(0,i.getAgentDir)(),c=(0,l.Y1)(a,b),f=i.SettingsManager.create(a,b,{projectTrusted:c.trusted});d=new i.DefaultPackageManager({cwd:a,agentDir:b,settingsManager:f}).listConfiguredPackages(),e??=f.getNpmCommand()}let f=d.filter(a=>!b?.source||a.source===b.source&&n(a.scope)===b.scope),g=c.runCommand??r;return Promise.all(f.map(async b=>{if(!p(b.source))return q(b,"unsupported","Pinned or local packages cannot be checked automatically.");if(/^(1|true|yes)$/i.test(process.env.PI_OFFLINE??""))return q(b,"error","Update checks are disabled while PI_OFFLINE=1.");try{return o(b.source)?await s(b,a,e,g):await t(b,g)}catch(a){return q(b,"error",a instanceof Error?a.message:String(a))}}))}d()}catch(a){d(a)}})},66544:(a,b,c)=>{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,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))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"))}},72498:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Fk:()=>i,Y1:()=>g,er:()=>h});var e=c(75430),f=a([e]);function g(a,b){return a&&(0,e.hasTrustRequiringProjectResources)(a)?{requiresTrust:!0,trusted:!0===new e.ProjectTrustStore(b).get(a)}:{requiresTrust:!1,trusted:!0}}function h(a,b){let c=g(a,b);return c.requiresTrust?(new e.ProjectTrustStore(b).set(a,!0),{requiresTrust:!0,trusted:!0}):c}function i(a,b){if(!g(a,b).requiresTrust)return;let c=new e.ProjectTrustStore(b);return{resolveProjectTrust:async()=>!0===c.get(a)}}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},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,3618,5582],()=>b(b.s=57078));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=9742,a.ids=[9742],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")},6899:(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/plugins/route",pathname:"/api/plugins",filename:"route",bundlePath:"app/api/plugins/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/plugins/route.ts",nextConfigOutput:"standalone",userland:()=>c(32493),...{}}),{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/plugins/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)}}},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10595:(a,b,c)=>{c.d(b,{f:()=>g});var d=c(29021),e=c(33873);let f=require("process");function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},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")},32493:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>w,POST:()=>x,dynamic:()=>y});var e=c(23211),f=c(29021),g=c(76760),h=c(75430),i=c(80547),j=c(66544),k=c(72498),l=c(65742),m=a([h,i,k,l]);[h,i,k,l]=m.then?(await m)():m;let y="force-dynamic";function n(){return{extensions:0,skills:0,prompts:0,themes:0}}function o(a){return"project"===a?"project":"global"}function p(a,b){return`${b}\0${a}`}function q(a){return"string"==typeof a?a:a.source}function r(a){return"string"!=typeof a&&Array.isArray(a.extensions)&&0===a.extensions.length&&Array.isArray(a.skills)&&0===a.skills.length&&Array.isArray(a.prompts)&&0===a.prompts.length&&Array.isArray(a.themes)&&0===a.themes.length}function s(a,b,c,d){let e="project"===c?a.getProjectSettings().packages??[]:a.getGlobalSettings().packages??[],f=!1,g=e.map(a=>q(a)!==b?a:(f=!0,d)?{..."string"==typeof a?{source:a}:a,extensions:[],skills:[],prompts:[],themes:[]}:q(a));return!!f&&("project"===c?a.setProjectPackages(g):a.setPackages(g),!0)}function t(a,b){var c,d;let e,f;return{kind:b,name:(c=a.path,d=b,e=(0,g.basename)(c),f=(0,g.extname)(e),"skill"===d&&"skill.md"===e.toLowerCase()?(0,g.basename)((0,g.dirname)(c)):("extension"===d||"theme"===d||"prompt"===d)&&f?"extension"===d&&/^index\.(ts|js)$/.test(e)?(0,g.basename)((0,g.dirname)(c)):e.slice(0,-f.length):e),path:a.path,relativePath:function(a){let b=a.metadata.baseDir;if(!b)return a.path;let c=(0,g.relative)(b,a.path);return c&&!c.startsWith("..")?c.split(g.sep).join("/"):a.path}(a)}}function u(a,b,c,d,e){if(!a.enabled||"package"!==a.metadata.origin)return;let f=a.metadata.source,g=o(a.metadata.scope),h=p(f,g),i=c.get(h)??n();i[b]+=1,e[b]+=1,c.set(h,i);let j=d.get(h)??[];j.push(t(a,"extensions"===b?"extension":"skills"===b?"skill":"prompts"===b?"prompt":"theme")),d.set(h,j)}async function v(a){let b=(0,h.getAgentDir)(),c=(0,k.Y1)(a,b),d=h.SettingsManager.create(a,b,{projectTrusted:c.trusted}),e=new h.DefaultPackageManager({cwd:a,agentDir:b,settingsManager:d}),i=[],j=new Map,m=new Map,s=[],v=n(),w=function(a){let b=new Map;for(let c of a.getGlobalSettings().packages??[])b.set(p(q(c),"global"),r(c));for(let c of a.getProjectSettings().packages??[])b.set(p(q(c),"project"),r(c));return b}(d);try{let a=await e.resolve(async a=>(i.push({type:"warning",source:a,message:"Package is configured but not installed yet."}),"skip"));({countsByPackage:j,resourcesByPackage:m,standaloneExtensions:s,totals:v}=function(a){let b=new Map,c=new Map,d=n();for(let e of a.extensions)u(e,"extensions",b,c,d);for(let e of a.skills)u(e,"skills",b,c,d);for(let e of a.prompts)u(e,"prompts",b,c,d);for(let e of a.themes)u(e,"themes",b,c,d);let e=a.extensions.filter(a=>"top-level"===a.metadata.origin).map(a=>({...t(a,"extension"),kind:"extension",scope:o(a.metadata.scope),enabled:a.enabled}));return d.extensions+=e.filter(a=>a.enabled).length,{countsByPackage:b,resourcesByPackage:c,standaloneExtensions:e,totals:d}}(a))}catch(a){i.push({type:"error",message:a instanceof Error?a.message:String(a)})}return{packages:e.listConfiguredPackages().map(a=>{let b=o(a.scope),c=p(a.source,b),d=w.get(c)??!1,e=j.get(c)??n(),h=m.get(c)??[],k=e.extensions+e.skills+e.prompts+e.themes,q=function(a){if(!a)return{};try{let b=(0,f.statSync)(a).isDirectory()?(0,g.join)(a,"package.json"):(0,g.join)((0,g.dirname)(a),"package.json");if(!(0,f.existsSync)(b))return{};let c=JSON.parse((0,f.readFileSync)(b,"utf8"));return{packageName:"string"==typeof c.name?c.name:void 0,version:"string"==typeof c.version?c.version:void 0,description:"string"==typeof c.description?c.description:void 0}}catch{return{}}}(a.installedPath);return a.installedPath||i.push({type:"warning",source:a.source,message:"Configured package path was not found."}),{source:a.source,scope:b,canCheckForUpdates:(0,l.t)(a.source),filtered:a.filtered,disabled:d,installedPath:a.installedPath,packageName:q.packageName,version:q.version,configuredVersion:function(a){let b=a.startsWith("npm:")?a.slice(4):void 0;if(b){let a=b.lastIndexOf("@"),c=b.startsWith("@")?b.indexOf("/",1):0;return a>c&&b.slice(a+1)||void 0}if(a.startsWith("git:")||/^[a-z]+:\/\//.test(a)){let b=a.lastIndexOf("@"),c=a.lastIndexOf("/"),d=a.lastIndexOf(":");if(b>Math.max(c,d))return a.slice(b+1)||void 0}}(a.source),description:q.description,counts:e,resources:h,status:d?"disabled":k>0?"loaded":a.installedPath?"installed":"missing"}}),standaloneExtensions:s,totals:v,diagnostics:i,projectResourcesLoaded:c.trusted}}async function w(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=await (0,i.mc)();if(!(0,i.A$)(c,a))return e.NextResponse.json({error:"Access denied"},{status:403});return e.NextResponse.json(await v(c))}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function x(a){if(!(0,j.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,j.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{var b;let c=await a.json();if(!c.cwd)return e.NextResponse.json({error:"cwd required"},{status:400});if(!c.action)return e.NextResponse.json({error:"action required"},{status:400});let d=await (0,i.mc)();if(!(0,i.A$)(c.cwd,d))return e.NextResponse.json({error:"Access denied"},{status:403});let f=(0,h.getAgentDir)(),g=(0,k.Y1)(c.cwd,f),j=h.SettingsManager.create(c.cwd,f,{projectTrusted:g.trusted}),l=(b=c.scope,"project"===b?"project":"global");if("project"===l&&!g.trusted)return e.NextResponse.json({error:"Project resources must be trusted before modifying project plugins"},{status:403});let m=new h.DefaultPackageManager({cwd:c.cwd,agentDir:f,settingsManager:j}),n=c.source?.trim(),o="project"===l;if("install"===c.action){if(!n)return e.NextResponse.json({error:"source required"},{status:400});await m.installAndPersist(n,{local:o})}else if("remove"===c.action){if(!n)return e.NextResponse.json({error:"source required"},{status:400});await m.removeAndPersist(n,{local:o})}else if("update"===c.action){if(!n&&!g.trusted&&m.listConfiguredPackages().some(a=>"project"===a.scope))return e.NextResponse.json({error:"Project resources must be trusted before updating project plugins"},{status:403});await m.update(n)}else if("disable"===c.action){if(!n)return e.NextResponse.json({error:"source required"},{status:400});s(j,n,l,!0),await j.flush()}else{if("enable"!==c.action)return e.NextResponse.json({error:`Unsupported action: ${c.action}`},{status:400});if(!n)return e.NextResponse.json({error:"source required"},{status:400});s(j,n,l,!1),await j.flush()}return e.NextResponse.json(await v(c.cwd))}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},33873:a=>{a.exports=require("path")},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")},65742:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Q:()=>u,t:()=>p});var e=c(79646),f=c(29021),g=c(33873),h=c(28354),i=c(75430),j=c(43618),k=c(10595),l=c(72498),m=a([i,l]);[i,l]=m.then?(await m)():m;let v=(0,h.promisify)(e.execFile);function n(a){return"project"===a?"project":"global"}function o(a){if(!a.startsWith("npm:"))return;let b=a.slice(4).trim(),c=b.match(/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/);return{name:c?.[1]??b,spec:b,version:c?.[2]}}function p(a){let b=o(a);return b?null===(0,j.valid)(b.version??""):!!(a.startsWith("git:")||/^(https?|ssh|git):\/\//i.test(a))&&!function(a){let b=a.startsWith("git:")?a.slice(4).trim():a.trim(),c=b.match(/^git@[^:]+:(.+)$/)?.[1];if(c)return c.includes("@");if(b.includes("://"))try{return new URL(b).pathname.replace(/^\/+/,"").includes("@")}catch{return!1}let d=b.indexOf("/");return d>=0&&b.slice(d+1).includes("@")}(a)}function q(a,b,c){let d=o(a.source);return{source:a.source,scope:n(a.scope),displayName:d?.name??a.source,type:d?"npm":"git",state:b,message:c}}async function r(a,b,c){let d="npm"===a?(0,k.f)("npm",b):{command:a,args:b},{stdout:e}=await v(d.command,d.args,{cwd:c.cwd,env:c.env?{...process.env,...c.env}:process.env,encoding:"utf8",timeout:1e4});return e}async function s(a,b,c,d){if(!a.installedPath||!(0,f.existsSync)(a.installedPath))return q(a,"error","Package is not installed.");let e=o(a.source);if(!e)return q(a,"unsupported");let[h="npm",...i]=c??[];if(!h)return q(a,"error","Invalid npmCommand.");let k=function(a){let b=JSON.parse((0,f.readFileSync)((0,g.join)(a,"package.json"),"utf8"));if("string"!=typeof b.version||!(0,j.valid)(b.version))throw Error("Installed package version is unavailable.");return b.version}(a.installedPath),l=await d(h,[...i,"view",e.spec,"version","--json"],{cwd:b}),m=e.version?(0,j.validRange)(e.version)??void 0:void 0,n=function(a,b){let c=JSON.parse(a.trim());if("string"==typeof c&&(0,j.valid)(c))return c;if(Array.isArray(c)){let a=c.filter(a=>"string"==typeof a&&null!==(0,j.valid)(a)),d=b?(0,j.maxSatisfying)(a,b):a.sort(j.rcompare)[0];if(d)return d}throw Error("Unexpected response from npm view.")}(l,m);return q(a,(0,j.gt)(n,k)?"update-available":"up-to-date")}async function t(a,b){if(!a.installedPath||!(0,f.existsSync)(a.installedPath))return q(a,"error","Package is not installed.");let c={cwd:a.installedPath,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}},d=(await b("git",["rev-parse","HEAD"],c)).trim(),e=await b("git",["rev-parse","--abbrev-ref","@{upstream}"],c).then(a=>a.trim()).catch(()=>""),g=e.startsWith("origin/")?`refs/heads/${e.slice(7)}`:"HEAD",h=await b("git",["ls-remote","origin",g],c),i=h.match(/^([0-9a-f]{40,64})\s+/m)?.[1];if(!i)throw Error(`Failed to determine remote ${g}.`);return q(a,d===i?"up-to-date":"update-available")}async function u(a,b,c={}){let d=c.packages,e=c.npmCommand;if(!d){let b=(0,i.getAgentDir)(),c=(0,l.Y1)(a,b),f=i.SettingsManager.create(a,b,{projectTrusted:c.trusted});d=new i.DefaultPackageManager({cwd:a,agentDir:b,settingsManager:f}).listConfiguredPackages(),e??=f.getNpmCommand()}let f=d.filter(a=>!b?.source||a.source===b.source&&n(a.scope)===b.scope),g=c.runCommand??r;return Promise.all(f.map(async b=>{if(!p(b.source))return q(b,"unsupported","Pinned or local packages cannot be checked automatically.");if(/^(1|true|yes)$/i.test(process.env.PI_OFFLINE??""))return q(b,"error","Update checks are disabled while PI_OFFLINE=1.");try{return o(b.source)?await s(b,a,e,g):await t(b,g)}catch(a){return q(b,"error",a instanceof Error?a.message:String(a))}}))}d()}catch(a){d(a)}})},66544:(a,b,c)=>{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,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))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"))}},72498:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Fk:()=>i,Y1:()=>g,er:()=>h});var e=c(75430),f=a([e]);function g(a,b){return a&&(0,e.hasTrustRequiringProjectResources)(a)?{requiresTrust:!0,trusted:!0===new e.ProjectTrustStore(b).get(a)}:{requiresTrust:!1,trusted:!0}}function h(a,b){let c=g(a,b);return c.requiresTrust?(new e.ProjectTrustStore(b).set(a,!0),{requiresTrust:!0,trusted:!0}):c}function i(a,b){if(!g(a,b).requiresTrust)return;let c=new e.ProjectTrustStore(b);return{resolveProjectTrust:async()=>!0===c.get(a)}}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},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,3618,5582],()=>b(b.s=6899));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=5982,a.ids=[5982],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")},12412:a=>{a.exports=require("assert")},13313:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,PUT:()=>l,dynamic:()=>m});var e=c(79748),f=c(23211),g=c(75430),h=c(89856),i=c(56429),j=a([g,i]);[g,i]=j.then?(await j)():j;let m="force-dynamic";async function k(){return f.NextResponse.json({aliases:(0,h.yM)((0,g.getAgentDir)())})}async function l(a){try{let b=await a.json();if("string"!=typeof b.cwd||!b.cwd.trim())return f.NextResponse.json({error:"cwd required"},{status:400});let c=b.cwd.trim();try{if(!(await (0,e.stat)(c)).isDirectory())return f.NextResponse.json({error:"cwd must be a directory"},{status:400})}catch{return f.NextResponse.json({error:"Directory does not exist"},{status:400})}let d="string"==typeof b.alias?b.alias:"",j=(0,g.getAgentDir)(),k=(0,h.Yt)(j,c,d);return(0,i.iP)("project_alias_changed",c,{alias:d.trim()}),f.NextResponse.json({aliases:k})}catch(a){return f.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},13642:(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/project-aliases/route",pathname:"/api/project-aliases",filename:"route",bundlePath:"app/api/project-aliases/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/project-aliases/route.ts",nextConfigOutput:"standalone",userland:()=>c(13313),...{}}),{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/project-aliases/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)}}},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")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},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")},77598:a=>{a.exports=require("node:crypto")},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")},89856:(a,b,c)=>{c.d(b,{Yt:()=>j,yM:()=>i});var d=c(73024),e=c(76760),f=c(8102);function g(a){return(0,e.join)(a,"project-aliases.json")}function h(a){let b=g(a);if(!(0,d.existsSync)(b))return{};try{let a=JSON.parse((0,d.readFileSync)(b,"utf8"));if(!a||"object"!=typeof a||Array.isArray(a))return{};let c={};for(let[b,d]of Object.entries(a))"string"==typeof d&&""!==d.trim()&&(c[b]=d.trim());return c}catch{return{}}}function i(a){return h(a)}function j(a,b,c){let d=(0,e.resolve)(b),i=h(a),j=c.trim();return j?i[d]=j:delete i[d],(0,f.$)(g(a),JSON.stringify(i,null,2)),i}},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5138,5582,8904,6429],()=>b(b.s=13642));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=5982,a.ids=[5982],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")},12412:a=>{a.exports=require("assert")},13313:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,PUT:()=>l,dynamic:()=>m});var e=c(79748),f=c(23211),g=c(75430),h=c(89856),i=c(56429),j=a([g,i]);[g,i]=j.then?(await j)():j;let m="force-dynamic";async function k(){return f.NextResponse.json({aliases:(0,h.yM)((0,g.getAgentDir)())})}async function l(a){try{let b=await a.json();if("string"!=typeof b.cwd||!b.cwd.trim())return f.NextResponse.json({error:"cwd required"},{status:400});let c=b.cwd.trim();try{if(!(await (0,e.stat)(c)).isDirectory())return f.NextResponse.json({error:"cwd must be a directory"},{status:400})}catch{return f.NextResponse.json({error:"Directory does not exist"},{status:400})}let d="string"==typeof b.alias?b.alias:"",j=(0,g.getAgentDir)(),k=(0,h.Yt)(j,c,d);return(0,i.iP)("project_alias_changed",c,{alias:d.trim()}),f.NextResponse.json({aliases:k})}catch(a){return f.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},22399:(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/project-aliases/route",pathname:"/api/project-aliases",filename:"route",bundlePath:"app/api/project-aliases/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/project-aliases/route.ts",nextConfigOutput:"standalone",userland:()=>c(13313),...{}}),{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/project-aliases/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")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},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")},77598:a=>{a.exports=require("node:crypto")},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")},89856:(a,b,c)=>{c.d(b,{Yt:()=>j,yM:()=>i});var d=c(73024),e=c(76760),f=c(8102);function g(a){return(0,e.join)(a,"project-aliases.json")}function h(a){let b=g(a);if(!(0,d.existsSync)(b))return{};try{let a=JSON.parse((0,d.readFileSync)(b,"utf8"));if(!a||"object"!=typeof a||Array.isArray(a))return{};let c={};for(let[b,d]of Object.entries(a))"string"==typeof d&&""!==d.trim()&&(c[b]=d.trim());return c}catch{return{}}}function i(a){return h(a)}function j(a,b,c){let d=(0,e.resolve)(b),i=h(a),j=c.trim();return j?i[d]=j:delete i[d],(0,f.$)(g(a),JSON.stringify(i,null,2)),i}},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5138,5582,8904,6429],()=>b(b.s=22399));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=1960,a.ids=[1960],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")},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")},24979:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>o,POST:()=>p,dynamic:()=>q});var e=c(79748),f=c(33873),g=c(23211),h=c(75430),i=c(80547),j=c(28967),k=c(72498),l=c(56429),m=a([h,i,k,l]);[h,i,k,l]=m.then?(await m)():m;let q="force-dynamic";async function n(a){if("string"!=typeof a||!a.trim())return{response:g.NextResponse.json({error:"cwd required"},{status:400})};let b=(0,f.resolve)(a);try{if(!(await (0,e.stat)(b)).isDirectory())return{response:g.NextResponse.json({error:"cwd must be a directory"},{status:400})}}catch{return{response:g.NextResponse.json({error:"Directory does not exist"},{status:400})}}let c=await (0,i.mc)();return(0,i.A$)(b,c)?{cwd:b}:{response:g.NextResponse.json({error:"Access denied"},{status:403})}}async function o(a){let b=await n(new URL(a.url).searchParams.get("cwd"));return"response"in b?b.response:g.NextResponse.json((0,k.Y1)(b.cwd,(0,h.getAgentDir)()))}async function p(a){try{let b=await a.json(),c=await n(b.cwd);if("response"in c)return c.response;let d=(0,h.getAgentDir)();if(!(0,k.Y1)(c.cwd,d).requiresTrust)return g.NextResponse.json({error:"This project has no resources that require trust"},{status:409});if((0,l._I)(c.cwd))return g.NextResponse.json({error:"Wait for the active session to finish before trusting this project"},{status:409});let e=(0,k.er)(c.cwd,d);return(0,j.k)(),await (0,l.oA)(c.cwd),g.NextResponse.json(e)}catch(a){return g.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50938:(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/project-trust/route",pathname:"/api/project-trust",filename:"route",bundlePath:"app/api/project-trust/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/project-trust/route.ts",nextConfigOutput:"standalone",userland:()=>c(24979),...{}}),{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/project-trust/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)}}},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")},77598:a=>{a.exports=require("node:crypto")},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,5138,5582,8904,6429],()=>b(b.s=50938));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=1960,a.ids=[1960],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")},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")},24979:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>o,POST:()=>p,dynamic:()=>q});var e=c(79748),f=c(33873),g=c(23211),h=c(75430),i=c(80547),j=c(28967),k=c(72498),l=c(56429),m=a([h,i,k,l]);[h,i,k,l]=m.then?(await m)():m;let q="force-dynamic";async function n(a){if("string"!=typeof a||!a.trim())return{response:g.NextResponse.json({error:"cwd required"},{status:400})};let b=(0,f.resolve)(a);try{if(!(await (0,e.stat)(b)).isDirectory())return{response:g.NextResponse.json({error:"cwd must be a directory"},{status:400})}}catch{return{response:g.NextResponse.json({error:"Directory does not exist"},{status:400})}}let c=await (0,i.mc)();return(0,i.A$)(b,c)?{cwd:b}:{response:g.NextResponse.json({error:"Access denied"},{status:403})}}async function o(a){let b=await n(new URL(a.url).searchParams.get("cwd"));return"response"in b?b.response:g.NextResponse.json((0,k.Y1)(b.cwd,(0,h.getAgentDir)()))}async function p(a){try{let b=await a.json(),c=await n(b.cwd);if("response"in c)return c.response;let d=(0,h.getAgentDir)();if(!(0,k.Y1)(c.cwd,d).requiresTrust)return g.NextResponse.json({error:"This project has no resources that require trust"},{status:409});if((0,l._I)(c.cwd))return g.NextResponse.json({error:"Wait for the active session to finish before trusting this project"},{status:409});let e=(0,k.er)(c.cwd,d);return(0,j.k)(),await (0,l.oA)(c.cwd),g.NextResponse.json(e)}catch(a){return g.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},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")},70735:(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/project-trust/route",pathname:"/api/project-trust",filename:"route",bundlePath:"app/api/project-trust/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/project-trust/route.ts",nextConfigOutput:"standalone",userland:()=>c(24979),...{}}),{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/project-trust/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")},77598:a=>{a.exports=require("node:crypto")},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,5138,5582,8904,6429],()=>b(b.s=70735));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=9647,a.ids=[9647],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")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27250:(a,b,c)=>{c.d(b,{Cb:()=>j,lF:()=>i,pZ:()=>k});var d=c(76760),e=c(74244),f=c(20495);function g(a){return(0,d.join)(a,"project-visibility.json")}function h(a){let b={hidden:{}};if(!a||"object"!=typeof a||Array.isArray(a))return b;let c=a.hidden;if(!c||"object"!=typeof c||Array.isArray(c))return b;for(let[a,d]of Object.entries(c))!(!a||!d||"object"!=typeof d||Array.isArray(d))&&"string"==typeof d.path&&d.path&&(b.hidden[a]={path:d.path,name:"string"==typeof d.name?d.name:"",hiddenAt:"string"==typeof d.hiddenAt?d.hiddenAt:""});return b}function i(a){return Object.entries((0,f.j)(g(a),h).hidden).map(([a,b])=>({key:a,...b}))}async function j(a,b,c){let i=(0,e.z)((0,d.resolve)(b)),{value:j}=await (0,f._)(g(a),h,a=>a.hidden[i]?{value:a,changed:!1}:{value:{hidden:{...a.hidden,[i]:{path:(0,d.resolve)(b),name:c.trim(),hiddenAt:new Date().toISOString()}}}});return j}async function k(a,b){let c=(0,e.z)((0,d.resolve)(b)),{value:i}=await (0,f._)(g(a),h,a=>{if(!(c in a.hidden))return{value:a,changed:!1};let b={...a.hidden};return delete b[c],{value:{hidden:b}}});return i}},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},37036:(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/projects/visibility/route",pathname:"/api/projects/visibility",filename:"route",bundlePath:"app/api/projects/visibility/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/projects/visibility/route.ts",nextConfigOutput:"standalone",userland:()=>c(88026),...{}}),{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/projects/visibility/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")},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")},66544:(a,b,c)=>{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,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))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=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},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")},88026:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,POST:()=>m,dynamic:()=>n});var e=c(23211),f=c(33873),g=c(75430),h=c(27250),i=c(56429),j=c(66544),k=a([g,i]);[g,i]=k.then?(await k)():k;let n="force-dynamic";async function l(){return e.NextResponse.json({hidden:(0,h.lF)((0,g.getAgentDir)())})}async function m(a){if(!(0,j.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,j.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),{action:c,projectRoot:d}=b;if("hide"!==c&&"unhide"!==c||"string"!=typeof d||!d.trim())return e.NextResponse.json({error:"action ('hide'|'unhide') and projectRoot are required"},{status:400});let j=(0,g.getAgentDir)();if("hide"===c){let a="string"==typeof b.name&&b.name.trim()?b.name:(0,f.basename)(d.trim());await (0,h.Cb)(j,d.trim(),a)}else await (0,h.pZ)(j,d.trim());return(0,i.iP)("project_visibility_changed",d.trim(),{action:c}),e.NextResponse.json({hidden:(0,h.lF)(j)})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5138,5582,8904,6429],()=>b(b.s=37036));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=9647,a.ids=[9647],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")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27250:(a,b,c)=>{c.d(b,{Cb:()=>j,lF:()=>i,pZ:()=>k});var d=c(76760),e=c(74244),f=c(20495);function g(a){return(0,d.join)(a,"project-visibility.json")}function h(a){let b={hidden:{}};if(!a||"object"!=typeof a||Array.isArray(a))return b;let c=a.hidden;if(!c||"object"!=typeof c||Array.isArray(c))return b;for(let[a,d]of Object.entries(c))!(!a||!d||"object"!=typeof d||Array.isArray(d))&&"string"==typeof d.path&&d.path&&(b.hidden[a]={path:d.path,name:"string"==typeof d.name?d.name:"",hiddenAt:"string"==typeof d.hiddenAt?d.hiddenAt:""});return b}function i(a){return Object.entries((0,f.j)(g(a),h).hidden).map(([a,b])=>({key:a,...b}))}async function j(a,b,c){let i=(0,e.z)((0,d.resolve)(b)),{value:j}=await (0,f._)(g(a),h,a=>a.hidden[i]?{value:a,changed:!1}:{value:{hidden:{...a.hidden,[i]:{path:(0,d.resolve)(b),name:c.trim(),hiddenAt:new Date().toISOString()}}}});return j}async function k(a,b){let c=(0,e.z)((0,d.resolve)(b)),{value:i}=await (0,f._)(g(a),h,a=>{if(!(c in a.hidden))return{value:a,changed:!1};let b={...a.hidden};return delete b[c],{value:{hidden:b}}});return i}},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},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")},66544:(a,b,c)=>{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,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))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=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},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")},88026:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,POST:()=>m,dynamic:()=>n});var e=c(23211),f=c(33873),g=c(75430),h=c(27250),i=c(56429),j=c(66544),k=a([g,i]);[g,i]=k.then?(await k)():k;let n="force-dynamic";async function l(){return e.NextResponse.json({hidden:(0,h.lF)((0,g.getAgentDir)())})}async function m(a){if(!(0,j.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,j.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),{action:c,projectRoot:d}=b;if("hide"!==c&&"unhide"!==c||"string"!=typeof d||!d.trim())return e.NextResponse.json({error:"action ('hide'|'unhide') and projectRoot are required"},{status:400});let j=(0,g.getAgentDir)();if("hide"===c){let a="string"==typeof b.name&&b.name.trim()?b.name:(0,f.basename)(d.trim());await (0,h.Cb)(j,d.trim(),a)}else await (0,h.pZ)(j,d.trim());return(0,i.iP)("project_visibility_changed",d.trim(),{action:c}),e.NextResponse.json({hidden:(0,h.lF)(j)})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},92473:(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/projects/visibility/route",pathname:"/api/projects/visibility",filename:"route",bundlePath:"app/api/projects/visibility/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/projects/visibility/route.ts",nextConfigOutput:"standalone",userland:()=>c(88026),...{}}),{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/projects/visibility/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)}}},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5138,5582,8904,6429],()=>b(b.s=92473));module.exports=c})();