@topmaker/pi-web 0.1.0

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 (384) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +27 -0
  3. package/.next/build/chunks/[root-of-the-server]__0d-m0h0._.js +206 -0
  4. package/.next/build/chunks/[root-of-the-server]__0d-m0h0._.js.map +8 -0
  5. package/.next/build/chunks/[root-of-the-server]__0ubbtyl._.js +500 -0
  6. package/.next/build/chunks/[root-of-the-server]__0ubbtyl._.js.map +11 -0
  7. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_06e.r3r._.js +13 -0
  8. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_06e.r3r._.js.map +5 -0
  9. package/.next/build/chunks/[turbopack]_runtime.js +890 -0
  10. package/.next/build/chunks/[turbopack]_runtime.js.map +11 -0
  11. package/.next/build/chunks/node_modules__pnpm_11dow_.._.js +6824 -0
  12. package/.next/build/package.json +1 -0
  13. package/.next/build/postcss.js +6 -0
  14. package/.next/build-manifest.json +21 -0
  15. package/.next/diagnostics/build-diagnostics.json +6 -0
  16. package/.next/diagnostics/framework.json +1 -0
  17. package/.next/diagnostics/route-bundle-stats.json +28 -0
  18. package/.next/export-marker.json +6 -0
  19. package/.next/fallback-build-manifest.json +13 -0
  20. package/.next/images-manifest.json +68 -0
  21. package/.next/next-minimal-server.js.nft.json +1 -0
  22. package/.next/next-server.js.nft.json +1 -0
  23. package/.next/package.json +1 -0
  24. package/.next/prerender-manifest.json +114 -0
  25. package/.next/required-server-files.js +339 -0
  26. package/.next/required-server-files.json +339 -0
  27. package/.next/routes-manifest.json +212 -0
  28. package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  29. package/.next/server/app/_global-error/page/build-manifest.json +17 -0
  30. package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  31. package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  32. package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  33. package/.next/server/app/_global-error/page.js +10 -0
  34. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  35. package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
  36. package/.next/server/app/_global-error.html +1 -0
  37. package/.next/server/app/_global-error.meta +15 -0
  38. package/.next/server/app/_global-error.rsc +15 -0
  39. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  40. package/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
  41. package/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
  42. package/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
  43. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  44. package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  45. package/.next/server/app/_not-found/page/build-manifest.json +17 -0
  46. package/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
  47. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  48. package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  49. package/.next/server/app/_not-found/page.js +13 -0
  50. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  51. package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
  52. package/.next/server/app/_not-found.html +1 -0
  53. package/.next/server/app/_not-found.meta +16 -0
  54. package/.next/server/app/_not-found.rsc +16 -0
  55. package/.next/server/app/_not-found.segments/_full.segment.rsc +16 -0
  56. package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
  57. package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -0
  58. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  59. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
  60. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  61. package/.next/server/app/api/agent/[id]/events/route/app-paths-manifest.json +3 -0
  62. package/.next/server/app/api/agent/[id]/events/route/build-manifest.json +9 -0
  63. package/.next/server/app/api/agent/[id]/events/route/server-reference-manifest.json +4 -0
  64. package/.next/server/app/api/agent/[id]/events/route.js +6 -0
  65. package/.next/server/app/api/agent/[id]/events/route.js.map +5 -0
  66. package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -0
  67. package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +3 -0
  68. package/.next/server/app/api/agent/[id]/route/app-paths-manifest.json +3 -0
  69. package/.next/server/app/api/agent/[id]/route/build-manifest.json +9 -0
  70. package/.next/server/app/api/agent/[id]/route/server-reference-manifest.json +4 -0
  71. package/.next/server/app/api/agent/[id]/route.js +7 -0
  72. package/.next/server/app/api/agent/[id]/route.js.map +5 -0
  73. package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -0
  74. package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +3 -0
  75. package/.next/server/app/api/agent/new/route/app-paths-manifest.json +3 -0
  76. package/.next/server/app/api/agent/new/route/build-manifest.json +9 -0
  77. package/.next/server/app/api/agent/new/route/server-reference-manifest.json +4 -0
  78. package/.next/server/app/api/agent/new/route.js +7 -0
  79. package/.next/server/app/api/agent/new/route.js.nft.json +1 -0
  80. package/.next/server/app/api/agent/new/route_client-reference-manifest.js +3 -0
  81. package/.next/server/app/api/auth/all-providers/route/app-paths-manifest.json +3 -0
  82. package/.next/server/app/api/auth/all-providers/route/build-manifest.json +9 -0
  83. package/.next/server/app/api/auth/all-providers/route/server-reference-manifest.json +4 -0
  84. package/.next/server/app/api/auth/all-providers/route.js +6 -0
  85. package/.next/server/app/api/auth/all-providers/route.js.nft.json +1 -0
  86. package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +3 -0
  87. package/.next/server/app/api/auth/api-key/[provider]/route/app-paths-manifest.json +3 -0
  88. package/.next/server/app/api/auth/api-key/[provider]/route/build-manifest.json +9 -0
  89. package/.next/server/app/api/auth/api-key/[provider]/route/server-reference-manifest.json +4 -0
  90. package/.next/server/app/api/auth/api-key/[provider]/route.js +7 -0
  91. package/.next/server/app/api/auth/api-key/[provider]/route.js.map +5 -0
  92. package/.next/server/app/api/auth/api-key/[provider]/route.js.nft.json +1 -0
  93. package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +3 -0
  94. package/.next/server/app/api/auth/login/[provider]/route/app-paths-manifest.json +3 -0
  95. package/.next/server/app/api/auth/login/[provider]/route/build-manifest.json +9 -0
  96. package/.next/server/app/api/auth/login/[provider]/route/server-reference-manifest.json +4 -0
  97. package/.next/server/app/api/auth/login/[provider]/route.js +6 -0
  98. package/.next/server/app/api/auth/login/[provider]/route.js.map +5 -0
  99. package/.next/server/app/api/auth/login/[provider]/route.js.nft.json +1 -0
  100. package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +3 -0
  101. package/.next/server/app/api/auth/logout/[provider]/route/app-paths-manifest.json +3 -0
  102. package/.next/server/app/api/auth/logout/[provider]/route/build-manifest.json +9 -0
  103. package/.next/server/app/api/auth/logout/[provider]/route/server-reference-manifest.json +4 -0
  104. package/.next/server/app/api/auth/logout/[provider]/route.js +6 -0
  105. package/.next/server/app/api/auth/logout/[provider]/route.js.map +5 -0
  106. package/.next/server/app/api/auth/logout/[provider]/route.js.nft.json +1 -0
  107. package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +3 -0
  108. package/.next/server/app/api/auth/providers/route/app-paths-manifest.json +3 -0
  109. package/.next/server/app/api/auth/providers/route/build-manifest.json +9 -0
  110. package/.next/server/app/api/auth/providers/route/server-reference-manifest.json +4 -0
  111. package/.next/server/app/api/auth/providers/route.js +6 -0
  112. package/.next/server/app/api/auth/providers/route.js.nft.json +1 -0
  113. package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +3 -0
  114. package/.next/server/app/api/default-cwd/route/app-paths-manifest.json +3 -0
  115. package/.next/server/app/api/default-cwd/route/build-manifest.json +9 -0
  116. package/.next/server/app/api/default-cwd/route/server-reference-manifest.json +4 -0
  117. package/.next/server/app/api/default-cwd/route.js +7 -0
  118. package/.next/server/app/api/default-cwd/route.js.nft.json +1 -0
  119. package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +3 -0
  120. package/.next/server/app/api/files/[...path]/route/app-paths-manifest.json +3 -0
  121. package/.next/server/app/api/files/[...path]/route/build-manifest.json +9 -0
  122. package/.next/server/app/api/files/[...path]/route/server-reference-manifest.json +4 -0
  123. package/.next/server/app/api/files/[...path]/route.js +8 -0
  124. package/.next/server/app/api/files/[...path]/route.js.map +5 -0
  125. package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -0
  126. package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +3 -0
  127. package/.next/server/app/api/home/route/app-paths-manifest.json +3 -0
  128. package/.next/server/app/api/home/route/build-manifest.json +9 -0
  129. package/.next/server/app/api/home/route/server-reference-manifest.json +4 -0
  130. package/.next/server/app/api/home/route.js +7 -0
  131. package/.next/server/app/api/home/route.js.nft.json +1 -0
  132. package/.next/server/app/api/home/route_client-reference-manifest.js +3 -0
  133. package/.next/server/app/api/models/route/app-paths-manifest.json +3 -0
  134. package/.next/server/app/api/models/route/build-manifest.json +9 -0
  135. package/.next/server/app/api/models/route/server-reference-manifest.json +4 -0
  136. package/.next/server/app/api/models/route.js +6 -0
  137. package/.next/server/app/api/models/route.js.nft.json +1 -0
  138. package/.next/server/app/api/models/route_client-reference-manifest.js +3 -0
  139. package/.next/server/app/api/models-config/route/app-paths-manifest.json +3 -0
  140. package/.next/server/app/api/models-config/route/build-manifest.json +9 -0
  141. package/.next/server/app/api/models-config/route/server-reference-manifest.json +4 -0
  142. package/.next/server/app/api/models-config/route.js +7 -0
  143. package/.next/server/app/api/models-config/route.js.nft.json +1 -0
  144. package/.next/server/app/api/models-config/route_client-reference-manifest.js +3 -0
  145. package/.next/server/app/api/models-config/test/route/app-paths-manifest.json +3 -0
  146. package/.next/server/app/api/models-config/test/route/build-manifest.json +9 -0
  147. package/.next/server/app/api/models-config/test/route/server-reference-manifest.json +4 -0
  148. package/.next/server/app/api/models-config/test/route.js +7 -0
  149. package/.next/server/app/api/models-config/test/route.js.nft.json +1 -0
  150. package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +3 -0
  151. package/.next/server/app/api/sessions/[id]/context/route/app-paths-manifest.json +3 -0
  152. package/.next/server/app/api/sessions/[id]/context/route/build-manifest.json +9 -0
  153. package/.next/server/app/api/sessions/[id]/context/route/server-reference-manifest.json +4 -0
  154. package/.next/server/app/api/sessions/[id]/context/route.js +7 -0
  155. package/.next/server/app/api/sessions/[id]/context/route.js.map +5 -0
  156. package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -0
  157. package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +3 -0
  158. package/.next/server/app/api/sessions/[id]/route/app-paths-manifest.json +3 -0
  159. package/.next/server/app/api/sessions/[id]/route/build-manifest.json +9 -0
  160. package/.next/server/app/api/sessions/[id]/route/server-reference-manifest.json +4 -0
  161. package/.next/server/app/api/sessions/[id]/route.js +7 -0
  162. package/.next/server/app/api/sessions/[id]/route.js.map +5 -0
  163. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -0
  164. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +3 -0
  165. package/.next/server/app/api/sessions/new/route/app-paths-manifest.json +3 -0
  166. package/.next/server/app/api/sessions/new/route/build-manifest.json +9 -0
  167. package/.next/server/app/api/sessions/new/route/server-reference-manifest.json +4 -0
  168. package/.next/server/app/api/sessions/new/route.js +6 -0
  169. package/.next/server/app/api/sessions/new/route.js.nft.json +1 -0
  170. package/.next/server/app/api/sessions/new/route_client-reference-manifest.js +3 -0
  171. package/.next/server/app/api/sessions/route/app-paths-manifest.json +3 -0
  172. package/.next/server/app/api/sessions/route/build-manifest.json +9 -0
  173. package/.next/server/app/api/sessions/route/server-reference-manifest.json +4 -0
  174. package/.next/server/app/api/sessions/route.js +7 -0
  175. package/.next/server/app/api/sessions/route.js.nft.json +1 -0
  176. package/.next/server/app/api/sessions/route_client-reference-manifest.js +3 -0
  177. package/.next/server/app/api/skills/install/route/app-paths-manifest.json +3 -0
  178. package/.next/server/app/api/skills/install/route/build-manifest.json +9 -0
  179. package/.next/server/app/api/skills/install/route/server-reference-manifest.json +4 -0
  180. package/.next/server/app/api/skills/install/route.js +7 -0
  181. package/.next/server/app/api/skills/install/route.js.nft.json +1 -0
  182. package/.next/server/app/api/skills/install/route_client-reference-manifest.js +3 -0
  183. package/.next/server/app/api/skills/route/app-paths-manifest.json +3 -0
  184. package/.next/server/app/api/skills/route/build-manifest.json +9 -0
  185. package/.next/server/app/api/skills/route/server-reference-manifest.json +4 -0
  186. package/.next/server/app/api/skills/route.js +7 -0
  187. package/.next/server/app/api/skills/route.js.nft.json +1 -0
  188. package/.next/server/app/api/skills/route_client-reference-manifest.js +3 -0
  189. package/.next/server/app/api/skills/search/route/app-paths-manifest.json +3 -0
  190. package/.next/server/app/api/skills/search/route/build-manifest.json +9 -0
  191. package/.next/server/app/api/skills/search/route/server-reference-manifest.json +4 -0
  192. package/.next/server/app/api/skills/search/route.js +7 -0
  193. package/.next/server/app/api/skills/search/route.js.nft.json +1 -0
  194. package/.next/server/app/api/skills/search/route_client-reference-manifest.js +3 -0
  195. package/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
  196. package/.next/server/app/favicon.ico/route/build-manifest.json +9 -0
  197. package/.next/server/app/favicon.ico/route.js +8 -0
  198. package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
  199. package/.next/server/app/favicon.ico.body +0 -0
  200. package/.next/server/app/favicon.ico.meta +1 -0
  201. package/.next/server/app/index.html +1 -0
  202. package/.next/server/app/index.meta +14 -0
  203. package/.next/server/app/index.rsc +17 -0
  204. package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -0
  205. package/.next/server/app/index.segments/_full.segment.rsc +17 -0
  206. package/.next/server/app/index.segments/_head.segment.rsc +6 -0
  207. package/.next/server/app/index.segments/_index.segment.rsc +5 -0
  208. package/.next/server/app/index.segments/_tree.segment.rsc +4 -0
  209. package/.next/server/app/page/app-paths-manifest.json +3 -0
  210. package/.next/server/app/page/build-manifest.json +17 -0
  211. package/.next/server/app/page/next-font-manifest.json +11 -0
  212. package/.next/server/app/page/react-loadable-manifest.json +1 -0
  213. package/.next/server/app/page/server-reference-manifest.json +4 -0
  214. package/.next/server/app/page.js +14 -0
  215. package/.next/server/app/page.js.nft.json +1 -0
  216. package/.next/server/app/page_client-reference-manifest.js +3 -0
  217. package/.next/server/app-paths-manifest.json +27 -0
  218. package/.next/server/chunks/112n_next_068e6nc._.js +13 -0
  219. package/.next/server/chunks/112n_next_dist_esm_build_templates_app-route_0bxw3gf.js +3 -0
  220. package/.next/server/chunks/[externals]_next_dist_0g2nsos._.js +3 -0
  221. package/.next/server/chunks/[externals]_next_dist_0g2nsos._.js.map +1 -0
  222. package/.next/server/chunks/[externals]_os_0149k2b._.js +3 -0
  223. package/.next/server/chunks/[externals]_os_0149k2b._.js.map +1 -0
  224. package/.next/server/chunks/[root-of-the-server]__0.m7tuh._.js +8 -0
  225. package/.next/server/chunks/[root-of-the-server]__0.m7tuh._.js.map +1 -0
  226. package/.next/server/chunks/[root-of-the-server]__0.ph805._.js +3 -0
  227. package/.next/server/chunks/[root-of-the-server]__0.ph805._.js.map +1 -0
  228. package/.next/server/chunks/[root-of-the-server]__015avud._.js +5 -0
  229. package/.next/server/chunks/[root-of-the-server]__015avud._.js.map +1 -0
  230. package/.next/server/chunks/[root-of-the-server]__02d~8ho._.js +3 -0
  231. package/.next/server/chunks/[root-of-the-server]__02d~8ho._.js.map +1 -0
  232. package/.next/server/chunks/[root-of-the-server]__02y51p8._.js +3 -0
  233. package/.next/server/chunks/[root-of-the-server]__02y51p8._.js.map +1 -0
  234. package/.next/server/chunks/[root-of-the-server]__06f2iy5._.js +3 -0
  235. package/.next/server/chunks/[root-of-the-server]__06f2iy5._.js.map +1 -0
  236. package/.next/server/chunks/[root-of-the-server]__0dbav4v._.js +5 -0
  237. package/.next/server/chunks/[root-of-the-server]__0dbav4v._.js.map +1 -0
  238. package/.next/server/chunks/[root-of-the-server]__0e9015k._.js +3 -0
  239. package/.next/server/chunks/[root-of-the-server]__0e9015k._.js.map +1 -0
  240. package/.next/server/chunks/[root-of-the-server]__0f3okwb._.js +7 -0
  241. package/.next/server/chunks/[root-of-the-server]__0f3okwb._.js.map +1 -0
  242. package/.next/server/chunks/[root-of-the-server]__0frxsvt._.js +5 -0
  243. package/.next/server/chunks/[root-of-the-server]__0frxsvt._.js.map +1 -0
  244. package/.next/server/chunks/[root-of-the-server]__0j7e~br._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__0j7e~br._.js.map +1 -0
  246. package/.next/server/chunks/[root-of-the-server]__0m-~s-d._.js +3 -0
  247. package/.next/server/chunks/[root-of-the-server]__0m-~s-d._.js.map +1 -0
  248. package/.next/server/chunks/[root-of-the-server]__0n9tlui._.js +3 -0
  249. package/.next/server/chunks/[root-of-the-server]__0n9tlui._.js.map +1 -0
  250. package/.next/server/chunks/[root-of-the-server]__0om~ep7._.js +3 -0
  251. package/.next/server/chunks/[root-of-the-server]__0om~ep7._.js.map +1 -0
  252. package/.next/server/chunks/[root-of-the-server]__0u5gprg._.js +5 -0
  253. package/.next/server/chunks/[root-of-the-server]__0u5gprg._.js.map +1 -0
  254. package/.next/server/chunks/[root-of-the-server]__0yxswji._.js +3 -0
  255. package/.next/server/chunks/[root-of-the-server]__0yxswji._.js.map +1 -0
  256. package/.next/server/chunks/[root-of-the-server]__0~-_d6r._.js +3 -0
  257. package/.next/server/chunks/[root-of-the-server]__0~-_d6r._.js.map +1 -0
  258. package/.next/server/chunks/[root-of-the-server]__0~poyc8._.js +5 -0
  259. package/.next/server/chunks/[root-of-the-server]__0~poyc8._.js.map +1 -0
  260. package/.next/server/chunks/[root-of-the-server]__11_26e7._.js +3 -0
  261. package/.next/server/chunks/[root-of-the-server]__11_26e7._.js.map +1 -0
  262. package/.next/server/chunks/[root-of-the-server]__11wd9no._.js +5 -0
  263. package/.next/server/chunks/[root-of-the-server]__11wd9no._.js.map +1 -0
  264. package/.next/server/chunks/[root-of-the-server]__12evxhy._.js +3 -0
  265. package/.next/server/chunks/[root-of-the-server]__12evxhy._.js.map +1 -0
  266. package/.next/server/chunks/[root-of-the-server]__137mme0._.js +5 -0
  267. package/.next/server/chunks/[root-of-the-server]__137mme0._.js.map +1 -0
  268. package/.next/server/chunks/[turbopack]_runtime.js +903 -0
  269. package/.next/server/chunks/[turbopack]_runtime.js.map +11 -0
  270. package/.next/server/chunks/_0.i~0tk._.js +6 -0
  271. package/.next/server/chunks/_next-internal_server_app_api_agent_[id]_events_route_actions_05o7blz.js +3 -0
  272. package/.next/server/chunks/_next-internal_server_app_api_agent_[id]_events_route_actions_05o7blz.js.map +1 -0
  273. package/.next/server/chunks/_next-internal_server_app_api_agent_[id]_route_actions_0kr98j0.js +3 -0
  274. package/.next/server/chunks/_next-internal_server_app_api_agent_[id]_route_actions_0kr98j0.js.map +1 -0
  275. package/.next/server/chunks/_next-internal_server_app_api_agent_new_route_actions_0w3r5tj.js +3 -0
  276. package/.next/server/chunks/_next-internal_server_app_api_auth_all-providers_route_actions_0qx7ozc.js +3 -0
  277. package/.next/server/chunks/_next-internal_server_app_api_auth_api-key_[provider]_route_actions_02zwuk7.js +3 -0
  278. package/.next/server/chunks/_next-internal_server_app_api_auth_api-key_[provider]_route_actions_02zwuk7.js.map +1 -0
  279. package/.next/server/chunks/_next-internal_server_app_api_auth_login_[provider]_route_actions_0iuf38..js +3 -0
  280. package/.next/server/chunks/_next-internal_server_app_api_auth_login_[provider]_route_actions_0iuf38..js.map +1 -0
  281. package/.next/server/chunks/_next-internal_server_app_api_auth_logout_[provider]_route_actions_0rakqrt.js +3 -0
  282. package/.next/server/chunks/_next-internal_server_app_api_auth_logout_[provider]_route_actions_0rakqrt.js.map +1 -0
  283. package/.next/server/chunks/_next-internal_server_app_api_auth_providers_route_actions_0d~j0qt.js +3 -0
  284. package/.next/server/chunks/_next-internal_server_app_api_default-cwd_route_actions_0nw97z4.js +3 -0
  285. package/.next/server/chunks/_next-internal_server_app_api_files_[___path]_route_actions_0_g4akf.js +3 -0
  286. package/.next/server/chunks/_next-internal_server_app_api_files_[___path]_route_actions_0_g4akf.js.map +1 -0
  287. package/.next/server/chunks/_next-internal_server_app_api_home_route_actions_0_7wduh.js +3 -0
  288. package/.next/server/chunks/_next-internal_server_app_api_models-config_route_actions_0ipr5cq.js +3 -0
  289. package/.next/server/chunks/_next-internal_server_app_api_models-config_test_route_actions_078zink.js +3 -0
  290. package/.next/server/chunks/_next-internal_server_app_api_models_route_actions_0vfccm4.js +3 -0
  291. package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_context_route_actions_0d0pnzf.js +3 -0
  292. package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_context_route_actions_0d0pnzf.js.map +1 -0
  293. package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_route_actions_0eo4u5w.js +3 -0
  294. package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_route_actions_0eo4u5w.js.map +1 -0
  295. package/.next/server/chunks/_next-internal_server_app_api_sessions_new_route_actions_093p~n-.js +3 -0
  296. package/.next/server/chunks/_next-internal_server_app_api_sessions_route_actions_0y1t9w0.js +3 -0
  297. package/.next/server/chunks/_next-internal_server_app_api_skills_install_route_actions_03-v3ve.js +3 -0
  298. package/.next/server/chunks/_next-internal_server_app_api_skills_route_actions_0kp0j6w.js +3 -0
  299. package/.next/server/chunks/_next-internal_server_app_api_skills_search_route_actions_011wkra.js +3 -0
  300. package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_095lj93.js +3 -0
  301. package/.next/server/chunks/ssr/112n_next_dist_0hmcjgv._.js +19 -0
  302. package/.next/server/chunks/ssr/112n_next_dist_0lxyjfe._.js +6 -0
  303. package/.next/server/chunks/ssr/112n_next_dist_client_components_0-r-u7j._.js +3 -0
  304. package/.next/server/chunks/ssr/112n_next_dist_client_components_builtin_forbidden_10im-eu.js +3 -0
  305. package/.next/server/chunks/ssr/112n_next_dist_client_components_builtin_global-error_01namsb.js +3 -0
  306. package/.next/server/chunks/ssr/112n_next_dist_client_components_builtin_unauthorized_0j6wmn3.js +3 -0
  307. package/.next/server/chunks/ssr/112n_next_dist_esm_build_templates_app-page_0cce051.js +4 -0
  308. package/.next/server/chunks/ssr/112n_next_dist_esm_build_templates_app-page_0ihw.w2.js +4 -0
  309. package/.next/server/chunks/ssr/112n_next_dist_esm_build_templates_app-page_0mqn_sx.js +4 -0
  310. package/.next/server/chunks/ssr/[root-of-the-server]__0cwenou._.js +6 -0
  311. package/.next/server/chunks/ssr/[root-of-the-server]__0cwenou._.js.map +1 -0
  312. package/.next/server/chunks/ssr/[root-of-the-server]__0dabl-y._.js +3 -0
  313. package/.next/server/chunks/ssr/[root-of-the-server]__0dabl-y._.js.map +1 -0
  314. package/.next/server/chunks/ssr/[root-of-the-server]__0j9~ds-._.js +3 -0
  315. package/.next/server/chunks/ssr/[root-of-the-server]__0j9~ds-._.js.map +1 -0
  316. package/.next/server/chunks/ssr/[root-of-the-server]__0nxtsm6._.js +33 -0
  317. package/.next/server/chunks/ssr/[root-of-the-server]__0nxtsm6._.js.map +1 -0
  318. package/.next/server/chunks/ssr/[root-of-the-server]__0qcqmvb._.js +3 -0
  319. package/.next/server/chunks/ssr/[root-of-the-server]__0qcqmvb._.js.map +1 -0
  320. package/.next/server/chunks/ssr/[root-of-the-server]__0rh-ctm._.js +3 -0
  321. package/.next/server/chunks/ssr/[root-of-the-server]__0rh-ctm._.js.map +1 -0
  322. package/.next/server/chunks/ssr/[root-of-the-server]__0w~zl.s._.js +3 -0
  323. package/.next/server/chunks/ssr/[root-of-the-server]__0w~zl.s._.js.map +1 -0
  324. package/.next/server/chunks/ssr/[root-of-the-server]__13v00ti._.js +33 -0
  325. package/.next/server/chunks/ssr/[root-of-the-server]__13v00ti._.js.map +1 -0
  326. package/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
  327. package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +11 -0
  328. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js +3 -0
  329. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js +3 -0
  330. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_09-gtaw.js +3 -0
  331. package/.next/server/chunks/ssr/components_ToolPanel_tsx_0j-gxri._.js +3 -0
  332. package/.next/server/chunks/ssr/components_ToolPanel_tsx_0r3vloj._.js +3 -0
  333. package/.next/server/chunks/ssr/node_modules__pnpm_0w5-g43._.js +3 -0
  334. package/.next/server/chunks/ssr/node_modules__pnpm_132eyv8._.js +33 -0
  335. package/.next/server/functions-config-manifest.json +4 -0
  336. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  337. package/.next/server/middleware-build-manifest.js +21 -0
  338. package/.next/server/middleware-manifest.json +6 -0
  339. package/.next/server/next-font-manifest.js +1 -0
  340. package/.next/server/next-font-manifest.json +15 -0
  341. package/.next/server/pages/404.html +1 -0
  342. package/.next/server/pages/500.html +1 -0
  343. package/.next/server/pages-manifest.json +4 -0
  344. package/.next/server/prefetch-hints.json +1 -0
  345. package/.next/server/server-reference-manifest.js +1 -0
  346. package/.next/server/server-reference-manifest.json +5 -0
  347. package/.next/static/chunks/0-0.t5js8g7~q.css +2 -0
  348. package/.next/static/chunks/03~yq9q893hmn.js +1 -0
  349. package/.next/static/chunks/09~i24obu64ju.js +1 -0
  350. package/.next/static/chunks/0bhezvep69s-m.js +1 -0
  351. package/.next/static/chunks/0eeo0wdf_vpux.js +1 -0
  352. package/.next/static/chunks/0h-koyddrxbr3.js +31 -0
  353. package/.next/static/chunks/0n.b7iq774lmz.js +4 -0
  354. package/.next/static/chunks/0snrehn51~02y.js +1 -0
  355. package/.next/static/chunks/0uhzxwyzllypk.js +2 -0
  356. package/.next/static/chunks/16ns6qga1x5xc.js +1 -0
  357. package/.next/static/chunks/turbopack-0u4ndhvzvhyg_.js +1 -0
  358. package/.next/static/eor69KaOTH9ZuDLU7-hXD/_buildManifest.js +11 -0
  359. package/.next/static/eor69KaOTH9ZuDLU7-hXD/_clientMiddlewareManifest.js +1 -0
  360. package/.next/static/eor69KaOTH9ZuDLU7-hXD/_ssgManifest.js +1 -0
  361. package/.next/static/media/053481348fc656b8-s.0oa9m1o0~yfw1.woff2 +0 -0
  362. package/.next/static/media/122ae3fd2eb25590-s.0ncu_-f3icz-t.woff2 +0 -0
  363. package/.next/static/media/19f01400f4b28c83-s.0dah.bwspgr4j.woff2 +0 -0
  364. package/.next/static/media/434fa64db183c5f7-s.0f6kj3bf2p152.woff2 +0 -0
  365. package/.next/static/media/72c852477dae22c1-s.0k5bu7w9.fmu6.woff2 +0 -0
  366. package/.next/static/media/7da1b2d9318915d2-s.p.0jn-y.~othqka.woff2 +0 -0
  367. package/.next/static/media/bfe1d01af4e99ec2-s.p.0xkmhr9m~odtp.woff2 +0 -0
  368. package/.next/static/media/favicon.0~uco8ba8mwit.ico +0 -0
  369. package/.next/trace +1 -0
  370. package/.next/trace-build +1 -0
  371. package/.next/turbopack +0 -0
  372. package/.next/types/cache-life.d.ts +145 -0
  373. package/.next/types/routes.d.ts +93 -0
  374. package/.next/types/validator.ts +259 -0
  375. package/LICENSE +21 -0
  376. package/README.md +79 -0
  377. package/bin/pi-web.js +77 -0
  378. package/next.config.ts +20 -0
  379. package/package.json +58 -0
  380. package/public/file.svg +1 -0
  381. package/public/globe.svg +1 -0
  382. package/public/next.svg +1 -0
  383. package/public/vercel.svg +1 -0
  384. package/public/window.svg +1 -0
@@ -0,0 +1,5 @@
1
+ module.exports=[24725,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},93695,(e,t,n)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,n)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,n)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},66592,e=>e.a(async(t,n)=>{try{let t=await e.y("@earendil-works/pi-coding-agent-8d8517777649a67a");e.n(t),n()}catch(e){n(e)}},!0),9948,e=>{"use strict";e.s(["normalizeToolCalls",0,function(e){if("assistant"!==e.role)return e;let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>("object"!=typeof e||null===e||Array.isArray(e)||"toolCall"!==e.type?null:{type:"toolCall",toolCallId:"string"==typeof e.toolCallId?e.toolCallId:"string"==typeof e.id?e.id:"",toolName:"string"==typeof e.toolName?e.toolName:"string"==typeof e.name?e.name:"",input:"object"!=typeof e.input||null===e.input||Array.isArray(e.input)?"object"!=typeof e.arguments||null===e.arguments||Array.isArray(e.arguments)?{}:e.arguments:e.input})??e);return{...e,content:n}}])},79839,e=>e.a(async(t,n)=>{try{var s=e.i(66592),i=e.i(9948),r=t([s]);async function a(){let e=await s.SessionManager.listAll(),t=new Map;for(let n of e)t.set(n.path,n.id);let n=o();return e.map(e=>(n.set(e.id,e.path),{path:e.path,id:e.id,cwd:e.cwd,name:e.name,created:e.created instanceof Date?e.created.toISOString():String(e.created),modified:e.modified instanceof Date?e.modified.toISOString():String(e.modified),messageCount:e.messageCount,firstMessage:e.firstMessage||"(no messages)",parentSessionId:e.parentSessionPath?t.get(e.parentSessionPath):void 0}))}function o(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function l(e){let t=o().get(e);return t||(await a(),o().get(e)??null)}[s]=r.then?(await r)():r,e.s(["buildSessionContext",0,function(e,t){let n,r,a,o=new Map;for(let t of e)o.set(t.id,t);let l=(0,s.buildSessionContext)(e,t,o);if(null===t||(t&&(n=o.get(t)),n||(n=e[e.length-1]),!n))return{messages:[],entryIds:[],thinkingLevel:l.thinkingLevel,model:l.model};let d=[],c=n;for(;c;)d.unshift(c),c=c.parentId?o.get(c.parentId):void 0;for(let e of d)"compaction"===e.type&&(r=e.id,a=e.firstKeptEntryId);let u=[];if(r){u.push(r);let e=d.findIndex(e=>e.id===r),t=a?d.findIndex((t,n)=>n<e&&t.id===a):-1,n=t>=0?t:e;for(let t=n;t<e;t++)"message"===d[t].type&&u.push(d[t].id);for(let t=e+1;t<d.length;t++)"message"===d[t].type&&u.push(d[t].id)}else for(let e of d)"message"===e.type&&u.push(e.id);return{messages:l.messages.map(e=>"compactionSummary"===e.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
2
+
3
+ ${e.summary??""}`,timestamp:e.timestamp}:(0,i.normalizeToolCalls)(e)),entryIds:u,thinkingLevel:l.thinkingLevel,model:l.model}},"cacheSessionPath",0,function(e,t){o().set(e,t)},"invalidateSessionPathCache",0,function(e){o().delete(e)},"listAllSessions",0,a,"resolveSessionPath",0,l]),n()}catch(e){n(e)}},!1),77845,e=>e.a(async(t,n)=>{try{var s=e.i(66592),i=e.i(79839),r=t([s,i]);[s,i]=r.then?(await r)():r;class l{inner;listeners;unsubscribe;idleTimer;onDestroyCallback;_alive;constructor(e){this.inner=e,this.listeners=[],this.unsubscribe=null,this.idleTimer=null,this.onDestroyCallback=null,this._alive=!0}get sessionId(){return this.inner.sessionId}get sessionFile(){return this.inner.sessionFile??""}isAlive(){return this._alive}start(){this.unsubscribe=this.inner.subscribe(e=>{for(let t of(this.resetIdleTimer(),this.listeners))t(e)}),this.resetIdleTimer()}resetIdleTimer(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>this.destroy(),6e5)}onEvent(e){return this.listeners.push(e),()=>{let t=this.listeners.indexOf(e);-1!==t&&this.listeners.splice(t,1)}}onDestroy(e){this.onDestroyCallback=e}async send(t){this.resetIdleTimer();let n=t.type;switch(n){case"prompt":{let e=t.images;return this.inner.prompt(t.message,e?.length?{images:e}:void 0).catch(()=>{}),null}case"abort":return await this.inner.abort(),null;case"get_state":{let e=this.inner.model,t=this.inner.getContextUsage();return{sessionId:this.inner.sessionId,sessionFile:this.inner.sessionFile??"",isStreaming:this.inner.isStreaming,isCompacting:this.inner.isCompacting,autoCompactionEnabled:this.inner.autoCompactionEnabled,autoRetryEnabled:this.inner.autoRetryEnabled,model:e?{id:e.id,provider:e.provider}:void 0,messageCount:0,pendingMessageCount:0,contextUsage:t?{percent:t.percent,contextWindow:t.contextWindow,tokens:t.tokens}:null,systemPrompt:this.inner.agent.state?.systemPrompt??"",thinkingLevel:this.inner.agent.state?.thinkingLevel??"off"}}case"set_model":{let{provider:e,modelId:n}=t,s=this.inner.modelRegistry.find(e,n);if(!s)throw Error(`Model not found: ${e}/${n}`);return await this.inner.setModel(s),{id:s.id,provider:s.provider}}case"fork":{let e,n=t.entryId,r=this.inner.sessionManager,a=this.inner.sessionFile;if(!r.isPersisted())return{cancelled:!0};if(!a)throw Error("Persisted session is missing a session file");let o=r.getEntry(n);if(!o)throw Error("Invalid entry ID for forking");let l=r.getSessionDir();if(o.parentId){let t=s.SessionManager.open(a,l).createBranchedSession(o.parentId);if(!t)throw Error("Failed to create forked session");e=t}else{let t=s.SessionManager.create(r.getCwd(),l);t.newSession({parentSession:a}),e=t.getSessionFile()}let d=s.SessionManager.open(e,l).getSessionId();return(0,i.cacheSessionPath)(d,e),this.destroy(),{cancelled:!1,newSessionId:d}}case"navigate_tree":return{cancelled:(await this.inner.navigateTree(t.targetId,{})).cancelled};case"set_thinking_level":{let e=t.level;return this.inner.setThinkingLevel(e),"xhigh"===e&&this.inner.model?.compat?.thinkingFormat==="deepseek"&&this.inner.agent?.state&&(this.inner.agent.state.thinkingLevel="xhigh"),null}case"compact":{let{findCutPoint:n,DEFAULT_COMPACTION_SETTINGS:s}=await e.A(86156),i=this.inner.sessionManager.getBranch(),r={...s,...this.inner.settingsManager.getCompactionSettings()},a=-1;for(let e=i.length-1;e>=0;e--)if("compaction"===i[e].type){a=e;break}let o=a+1,l=n(i,o,i.length,r.keepRecentTokens);if((l.isSplitTurn?l.turnStartIndex:l.firstKeptEntryIndex)<=o)throw Error("Conversation too short to compact");return await this.inner.compact(t.customInstructions)}case"set_auto_compaction":return this.inner.setAutoCompactionEnabled(t.enabled),null;case"steer":{let e=t.images;return await this.inner.steer(t.message,e?.length?e:void 0),null}case"follow_up":{let e=t.images;return await this.inner.followUp(t.message,e?.length?e:void 0),null}case"get_tools":{let e=this.inner.getAllTools(),t=new Set(this.inner.getActiveToolNames());return e.map(e=>({name:e.name,description:e.description,active:t.has(e.name)}))}case"set_tools":return this.inner.setActiveToolsByName(t.toolNames),null;case"abort_compaction":return this.inner.abortCompaction(),null;case"set_auto_retry":return this.inner.setAutoRetryEnabled(t.enabled),null;default:throw Error(`Unsupported command: ${n}`)}}destroy(){this._alive&&(this._alive=!1,this.idleTimer&&clearTimeout(this.idleTimer),this.unsubscribe?.(),this.onDestroyCallback?.())}}function a(){if(!globalThis.__piSessions){globalThis.__piSessions=new Map;let e=()=>globalThis.__piSessions?.forEach(e=>e.destroy());process.once("exit",e),process.once("SIGINT",e),process.once("SIGTERM",e)}return globalThis.__piSessions}async function o(t,n,r,o){let d=a(),c=(globalThis.__piStartLocks||(globalThis.__piStartLocks=new Map),globalThis.__piStartLocks),u=d.get(t);if(u?.isAlive())return{session:u,realSessionId:t};let p=c.get(t);if(p)return p;let h=(async()=>{let t,{SessionManager:a,getAgentDir:c}=await e.A(86156),u=c(),p=n?a.open(n,void 0):a.create(r,void 0);void 0!==o&&(t=0===o.length?[]:["read","bash","edit","write","grep","find","ls"]);let{session:h}=await (0,s.createAgentSession)({cwd:r,agentDir:u,sessionManager:p,...void 0!==t?{tools:t}:{}});o&&o.length>0&&h.setActiveToolsByName(o),o?.length===0&&(h.agent.state.systemPrompt="");let g=new l(h);g.start();let m=h.sessionId,f=h.sessionFile;return f&&(0,i.cacheSessionPath)(m,f),g.onDestroy(()=>d.delete(m)),d.set(m,g),{session:g,realSessionId:m}})().finally(()=>c.delete(t));return c.set(t,h),h}e.s(["getRpcSession",0,function(e){return a().get(e)},"startRpcSession",0,o]),n()}catch(e){n(e)}},!1),44801,e=>e.a(async(t,n)=>{try{var s=e.i(80630),i=e.i(79839),r=e.i(77845),a=e.i(66592),o=t([i,r,a]);async function l(e,{params:t}){let{id:n}=await t;try{let t=await e.json(),o=(0,r.getRpcSession)(n);if(o?.isAlive()){let e=await o.send(t);return s.NextResponse.json({success:!0,data:e})}let l=await (0,i.resolveSessionPath)(n);if(!l)return s.NextResponse.json({error:"Session not found"},{status:404});let d=a.SessionManager.open(l).getHeader()?.cwd??process.cwd(),{session:c}=await (0,r.startRpcSession)(n,l,d),u=await c.send(t);return s.NextResponse.json({success:!0,data:u})}catch(e){return s.NextResponse.json({error:String(e)},{status:500})}}async function d(e,{params:t}){let{id:n}=await t;try{let e=(0,r.getRpcSession)(n);if(!e||!e.isAlive())return s.NextResponse.json({running:!1});let t=await e.send({type:"get_state"});return s.NextResponse.json({running:!0,state:t})}catch(e){return s.NextResponse.json({error:String(e)},{status:500})}}[i,r,a]=o.then?(await o)():o,e.s(["GET",0,d,"POST",0,l]),n()}catch(e){n(e)}},!1),4429,e=>e.a(async(t,n)=>{try{var s=e.i(14448),i=e.i(51795),r=e.i(89303),a=e.i(51349),o=e.i(1654),l=e.i(94945),d=e.i(90777),c=e.i(50854),u=e.i(93079),p=e.i(32946),h=e.i(4287),g=e.i(71538),m=e.i(8919),f=e.i(50325),y=e.i(37782),v=e.i(93695);e.i(58724);var w=e.i(86627),x=e.i(44801),S=t([x]);[x]=S.then?(await S)():S;let b=new s.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/agent/[id]/route",pathname:"/api/agent/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/agent/[id]/route.ts",nextConfigOutput:"",userland:x,...{}}),{workAsyncStorage:C,workUnitAsyncStorage:T,serverHooks:_}=b;async function R(e,t,n){n.requestMeta&&(0,a.setRequestMeta)(e,n.requestMeta),b.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let s="/api/agent/[id]/route";s=s.replace(/\/index$/,"")||"/";let r=await b.prepare(e,t,{srcPage:s,multiZoneDraftMode:!1});if(!r)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:x,deploymentId:S,params:R,nextConfig:C,parsedUrl:T,isDraftMode:_,prerenderManifest:E,routerServerContext:A,isOnDemandRevalidate:I,revalidateOnlyGenerated:k,resolvedPathname:P,clientReferenceManifest:N,serverActionsManifest:M}=r,j=(0,d.normalizeAppPath)(s),O=!!(E.dynamicRoutes[j]||E.routes[P]),q=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,T,!1):t.end("This page could not be found"),null);if(O&&!_){let e=!!E.routes[P],t=E.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(C.adapterPath)return await q();throw new v.NoFallbackError}}let D=null;!O||b.isDev||_||(D=P,D="/index"===D?"/":D);let U=!0===b.isDev||!O,H=O&&!U;M&&N&&(0,l.setManifestsSingleton)({page:s,clientReferenceManifest:N,serverActionsManifest:M});let F=e.method||"GET",L=(0,o.getTracer)(),$=L.getActiveScopeSpan(),B=!!(null==A?void 0:A.isWrappedByNextServer),K=!!(0,a.getRequestMeta)(e,"minimalMode"),G=(0,a.getRequestMeta)(e,"incrementalCache")||await b.getIncrementalCache(e,C,E,K);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let W={params:R,previewProps:E.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:G,cacheLifeProfiles:C.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,n,s,i)=>b.onRequestError(e,t,s,i,A)},sharedContext:{buildId:x,deploymentId:S}},z=new c.NodeNextRequest(e),V=new c.NodeNextResponse(t),X=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t));try{let r,a=async e=>b.handle(X,W).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let n=L.getRootSpanAttributes();if(!n)return;if(n.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${n.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=n.get("next.route");if(i){let t=`${F} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t),r&&r!==e&&(r.setAttribute("http.route",i),r.updateName(t))}else e.updateName(`${F} ${s}`)}),l=async r=>{var o,l;let d=async({previousCacheEntry:i})=>{try{if(!K&&I&&k&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await a(r);e.fetchMetrics=W.renderOpts.fetchMetrics;let o=W.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=W.renderOpts.collectedTags;if(!O)return await (0,g.sendResponse)(z,V,s,W.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[y.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let n=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,i=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:n,expire:i}}}}catch(t){throw(null==i?void 0:i.isStale)&&await b.onRequestError(e,t,{routerKind:"App Router",routePath:s,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:I})},!1,A),t}},c=await b.handleResponse({req:e,nextConfig:C,cacheKey:D,routeKind:i.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:E,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:k,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:K});if(!O)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",I?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),_&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,m.fromNodeOutgoingHttpHeaders)(c.value.headers);return K&&O||u.delete(y.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,f.getCacheControlHeader)(c.cacheControl)),await (0,g.sendResponse)(z,V,new Response(c.value.body,{headers:u,status:c.value.status||200})),null};B&&$?await l($):(r=L.getActiveScopeSpan(),await L.withPropagatedContext(e.headers,()=>L.trace(p.BaseServerSpan.handleRequest,{spanName:`${F} ${s}`,kind:o.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},l),void 0,!B))}catch(t){if(t instanceof v.NoFallbackError||await b.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:I})},!1,A),O)throw t;return await (0,g.sendResponse)(z,V,new Response(null,{status:500})),null}}e.s(["handler",0,R,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:T})},"routeModule",0,b,"serverHooks",0,_,"workAsyncStorage",0,C,"workUnitAsyncStorage",0,T]),n()}catch(e){n(e)}},!1),86156,e=>{e.v(e=>Promise.resolve().then(()=>e(66592)))}];
4
+
5
+ //# sourceMappingURL=%5Broot-of-the-server%5D__015avud._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../lib/normalize.ts","../../../lib/session-reader.ts","../../../lib/rpc-manager.ts","../../../app/api/agent/%5Bid%5D/route.ts","../../../node_modules/.pnpm/next%4016.2.6_%40babel%2Bcore%407.29.7_%40playwright%2Btest%401.60.0_react-dom%4019.2.6_react%4019.2.6__react%4019.2.6/node_modules/next/src/build/templates/app-route.ts"],"sourcesContent":["import type { AgentMessage, AssistantMessage, ToolCallContent } from \"./types\";\n\nfunction isObject(val: unknown): val is Record<string, unknown> {\n return typeof val === \"object\" && val !== null && !Array.isArray(val);\n}\n\nfunction normalizeToolCallBlock(block: unknown): ToolCallContent | null {\n if (!isObject(block) || block.type !== \"toolCall\") return null;\n return {\n type: \"toolCall\",\n toolCallId: typeof block.toolCallId === \"string\" ? block.toolCallId : (typeof block.id === \"string\" ? block.id : \"\"),\n toolName: typeof block.toolName === \"string\" ? block.toolName : (typeof block.name === \"string\" ? block.name : \"\"),\n input: typeof block.input === \"object\" && block.input !== null && !Array.isArray(block.input)\n ? block.input as Record<string, unknown>\n : (typeof block.arguments === \"object\" && block.arguments !== null && !Array.isArray(block.arguments)\n ? block.arguments as Record<string, unknown>\n : {}),\n };\n}\n\nexport function normalizeToolCalls(msg: AgentMessage): AgentMessage {\n if (msg.role !== \"assistant\") return msg;\n const content = (msg as AssistantMessage).content;\n if (!Array.isArray(content)) return msg;\n const normalized = content.map((block) => {\n const result = normalizeToolCallBlock(block);\n return result ?? block;\n });\n return { ...msg, content: normalized } as AgentMessage;\n}","import { SessionManager, buildSessionContext as piBuildSessionContext, getAgentDir } from \"@earendil-works/pi-coding-agent\";\nimport type { SessionEntry, SessionInfo, SessionContext, SessionTreeNode, AssistantMessage } from \"./types\";\nimport type { SessionEntry as PiSessionEntry, SessionInfo as PiSessionInfo } from \"@earendil-works/pi-coding-agent\";\nimport { normalizeToolCalls } from \"./normalize\";\n\nexport { getAgentDir };\n\nexport function getSessionsDir(): string {\n return `${getAgentDir()}/sessions`;\n}\n\nexport async function listAllSessions(): Promise<SessionInfo[]> {\n const piSessions: PiSessionInfo[] = await SessionManager.listAll();\n const pathToId = new Map<string, string>();\n for (const s of piSessions) pathToId.set(s.path, s.id);\n\n const cache = getPathCache();\n return piSessions.map((s) => {\n // Populate path cache so resolveSessionPath works without a full scan\n cache.set(s.id, s.path);\n return {\n path: s.path,\n id: s.id,\n cwd: s.cwd,\n name: s.name,\n created: s.created instanceof Date ? s.created.toISOString() : String(s.created),\n modified: s.modified instanceof Date ? s.modified.toISOString() : String(s.modified),\n messageCount: s.messageCount,\n firstMessage: s.firstMessage || \"(no messages)\",\n parentSessionId: s.parentSessionPath ? pathToId.get(s.parentSessionPath) : undefined,\n };\n });\n}\n\n// ============================================================================\n// Session path cache: sessionId → absolute file path\n// Stored in globalThis for hot-reload safety\n// ============================================================================\ndeclare global {\n var __piSessionPathCache: Map<string, string> | undefined;\n}\n\nfunction getPathCache(): Map<string, string> {\n if (!globalThis.__piSessionPathCache) globalThis.__piSessionPathCache = new Map();\n return globalThis.__piSessionPathCache;\n}\n\nexport async function resolveSessionPath(sessionId: string): Promise<string | null> {\n const cached = getPathCache().get(sessionId);\n if (cached) return cached;\n\n // Cache miss: scan all sessions to populate cache, then retry\n await listAllSessions();\n return getPathCache().get(sessionId) ?? null;\n}\n\nexport function cacheSessionPath(sessionId: string, filePath: string): void {\n getPathCache().set(sessionId, filePath);\n}\n\nexport function invalidateSessionPathCache(sessionId: string): void {\n getPathCache().delete(sessionId);\n}\n\nexport function getSessionEntries(filePath: string): SessionEntry[] {\n const entries = SessionManager.open(filePath).getEntries();\n return entries as unknown as SessionEntry[];\n}\n\nexport function buildTree(entries: SessionEntry[]): SessionTreeNode[] {\n const nodeMap = new Map<string, SessionTreeNode>();\n const labelsById = new Map<string, string>();\n\n for (const entry of entries) {\n if (entry.type === \"label\") {\n const l = entry as { type: \"label\"; targetId: string; label?: string };\n if (l.label) labelsById.set(l.targetId, l.label);\n else labelsById.delete(l.targetId);\n }\n }\n\n const roots: SessionTreeNode[] = [];\n for (const entry of entries) {\n nodeMap.set(entry.id, { entry, children: [], label: labelsById.get(entry.id) });\n }\n for (const entry of entries) {\n const node = nodeMap.get(entry.id)!;\n if (!entry.parentId) {\n roots.push(node);\n } else {\n const parent = nodeMap.get(entry.parentId);\n if (parent) parent.children.push(node);\n else roots.push(node);\n }\n }\n\n const stack = [...roots];\n while (stack.length > 0) {\n const node = stack.pop()!;\n node.children.sort((a, b) => new Date(a.entry.timestamp).getTime() - new Date(b.entry.timestamp).getTime());\n stack.push(...node.children);\n }\n return roots;\n}\n\nexport function buildSessionContext(entries: SessionEntry[], leafId?: string | null): SessionContext {\n const byId = new Map<string, SessionEntry>();\n for (const e of entries) byId.set(e.id, e);\n\n const piEntries = entries as unknown as PiSessionEntry[];\n const piCtx = piBuildSessionContext(piEntries, leafId, byId as unknown as Map<string, PiSessionEntry>);\n\n // Build entryIds: parallel array to messages[], mapping each message back to its entry id.\n // Needed for fork and navigate_tree calls from the UI.\n let targetLeaf: SessionEntry | undefined;\n if (leafId === null) {\n return { messages: [], entryIds: [], thinkingLevel: piCtx.thinkingLevel, model: piCtx.model };\n }\n if (leafId) targetLeaf = byId.get(leafId);\n if (!targetLeaf) targetLeaf = entries[entries.length - 1];\n if (!targetLeaf) {\n return { messages: [], entryIds: [], thinkingLevel: piCtx.thinkingLevel, model: piCtx.model };\n }\n\n // Walk path from target leaf to root\n const path: SessionEntry[] = [];\n let cur: SessionEntry | undefined = targetLeaf;\n while (cur) {\n path.unshift(cur);\n cur = cur.parentId ? byId.get(cur.parentId) : undefined;\n }\n\n // Find the last compaction on path (mirrors pi's buildSessionContext logic)\n let compactionId: string | undefined;\n let firstKeptEntryId: string | undefined;\n for (const e of path) {\n if (e.type === \"compaction\") {\n compactionId = e.id;\n firstKeptEntryId = (e as { firstKeptEntryId: string }).firstKeptEntryId;\n }\n }\n\n const entryIds: string[] = [];\n if (compactionId) {\n // The first message in piCtx.messages is the synthetic compaction summary — map to compaction entry id\n entryIds.push(compactionId);\n const compactionIdx = path.findIndex((e) => e.id === compactionId);\n const firstKeptIdx = firstKeptEntryId\n ? path.findIndex((e, i) => i < compactionIdx && e.id === firstKeptEntryId)\n : -1;\n const startIdx = firstKeptIdx >= 0 ? firstKeptIdx : compactionIdx;\n for (let i = startIdx; i < compactionIdx; i++) {\n if (path[i].type === \"message\") entryIds.push(path[i].id);\n }\n for (let i = compactionIdx + 1; i < path.length; i++) {\n if (path[i].type === \"message\") entryIds.push(path[i].id);\n }\n } else {\n for (const e of path) {\n if (e.type === \"message\") entryIds.push(e.id);\n }\n }\n\n // pi injects compaction summary as {role:\"compactionSummary\", summary, tokensBefore}.\n // Convert to {role:\"user\"} so MessageView can render it the same as before.\n const messages = (piCtx.messages as AssistantMessage[]).map((msg) => {\n const raw = msg as unknown as Record<string, unknown>;\n if (raw.role === \"compactionSummary\") {\n return {\n role: \"user\" as const,\n content: `*The conversation history before this point was compacted into the following summary:*\\n\\n${raw.summary ?? \"\"}`,\n timestamp: raw.timestamp as number | undefined,\n };\n }\n return normalizeToolCalls(msg);\n });\n\n return {\n messages,\n entryIds,\n thinkingLevel: piCtx.thinkingLevel,\n model: piCtx.model,\n };\n}\n\nexport function getLeafId(entries: SessionEntry[]): string | null {\n if (entries.length === 0) return null;\n return entries[entries.length - 1].id;\n}\n\n\n\n","import { createAgentSession, SessionManager } from \"@earendil-works/pi-coding-agent\";\nimport { cacheSessionPath } from \"./session-reader\";\nimport type { AgentSessionLike, ToolInfo } from \"./pi-types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface AgentEvent {\n type: string;\n [key: string]: unknown;\n}\n\ntype EventListener = (event: AgentEvent) => void;\n\n// ============================================================================\n// AgentSessionWrapper\n// Wraps AgentSession with the same interface the rest of the app expects\n// ============================================================================\n\nexport class AgentSessionWrapper {\n private listeners: EventListener[] = [];\n private unsubscribe: (() => void) | null = null;\n private idleTimer: ReturnType<typeof setTimeout> | null = null;\n private onDestroyCallback: (() => void) | null = null;\n private _alive = true;\n\n constructor(public readonly inner: AgentSessionLike) {}\n\n get sessionId(): string {\n return this.inner.sessionId;\n }\n\n get sessionFile(): string {\n return this.inner.sessionFile ?? \"\";\n }\n\n isAlive(): boolean {\n return this._alive;\n }\n\n start(): void {\n this.unsubscribe = this.inner.subscribe((event: AgentEvent) => {\n this.resetIdleTimer();\n for (const l of this.listeners) l(event);\n });\n this.resetIdleTimer();\n }\n\n private resetIdleTimer(): void {\n if (this.idleTimer) clearTimeout(this.idleTimer);\n this.idleTimer = setTimeout(() => this.destroy(), 10 * 60 * 1000);\n }\n\n onEvent(listener: EventListener): () => void {\n this.listeners.push(listener);\n return () => {\n const i = this.listeners.indexOf(listener);\n if (i !== -1) this.listeners.splice(i, 1);\n };\n }\n\n onDestroy(cb: () => void): void {\n this.onDestroyCallback = cb;\n }\n\n async send(command: Record<string, unknown>): Promise<unknown> {\n this.resetIdleTimer();\n const type = command.type as string;\n\n switch (type) {\n case \"prompt\": {\n // Fire and forget — events come via subscribe\n const promptImages = command.images as Array<{ type: \"image\"; data: string; mimeType: string }> | undefined;\n this.inner.prompt(command.message as string, promptImages?.length ? { images: promptImages } : undefined).catch(() => {});\n return null;\n }\n\n case \"abort\":\n await this.inner.abort();\n return null;\n\n case \"get_state\": {\n const model = this.inner.model;\n const contextUsage = this.inner.getContextUsage();\n return {\n sessionId: this.inner.sessionId,\n sessionFile: this.inner.sessionFile ?? \"\",\n isStreaming: this.inner.isStreaming,\n isCompacting: this.inner.isCompacting,\n autoCompactionEnabled: this.inner.autoCompactionEnabled,\n autoRetryEnabled: this.inner.autoRetryEnabled,\n model: model ? { id: model.id, provider: model.provider } : undefined,\n messageCount: 0,\n pendingMessageCount: 0,\n contextUsage: contextUsage\n ? { percent: contextUsage.percent, contextWindow: contextUsage.contextWindow, tokens: contextUsage.tokens }\n : null,\n systemPrompt: this.inner.agent.state?.systemPrompt ?? \"\",\n thinkingLevel: this.inner.agent.state?.thinkingLevel ?? \"off\",\n };\n }\n\n case \"set_model\": {\n const { provider, modelId } = command as { provider: string; modelId: string };\n const registry = this.inner.modelRegistry;\n const model = registry.find(provider, modelId);\n if (!model) throw new Error(`Model not found: ${provider}/${modelId}`);\n await this.inner.setModel(model);\n return { id: model.id, provider: model.provider };\n }\n\n case \"fork\": {\n const entryId = command.entryId as string;\n const sessionManager = this.inner.sessionManager;\n const currentSessionFile = this.inner.sessionFile;\n\n if (!sessionManager.isPersisted()) return { cancelled: true };\n if (!currentSessionFile) throw new Error(\"Persisted session is missing a session file\");\n\n const entry = sessionManager.getEntry(entryId);\n if (!entry) throw new Error(\"Invalid entry ID for forking\");\n\n const sessionDir = sessionManager.getSessionDir();\n let newSessionFile: string;\n\n if (!entry.parentId) {\n // Fork before the first message: create an empty session linked to this one\n const newManager = SessionManager.create(sessionManager.getCwd(), sessionDir);\n newManager.newSession({ parentSession: currentSessionFile });\n newSessionFile = newManager.getSessionFile() as string;\n } else {\n // Fork after some history: copy path up to (but not including) the fork point\n const sourceManager = SessionManager.open(currentSessionFile, sessionDir);\n const forkedPath = sourceManager.createBranchedSession(entry.parentId);\n if (!forkedPath) throw new Error(\"Failed to create forked session\");\n newSessionFile = forkedPath;\n }\n\n const newSessionId = SessionManager.open(newSessionFile, sessionDir).getSessionId();\n cacheSessionPath(newSessionId, newSessionFile);\n this.destroy();\n return { cancelled: false, newSessionId };\n }\n\n case \"navigate_tree\": {\n const result = await this.inner.navigateTree(command.targetId as string, {});\n return { cancelled: result.cancelled };\n }\n\n case \"set_thinking_level\": {\n const level = command.level as string;\n this.inner.setThinkingLevel(level);\n // setThinkingLevel clamps xhigh→high for models where supportsXhigh()===false.\n // If the model has DeepSeek thinking compat (reasoningEffortMap maps xhigh→max),\n // force the state back so the compat layer can use it correctly.\n if (level === \"xhigh\" && (this.inner.model as { compat?: { thinkingFormat?: string } } | null)?.compat?.thinkingFormat === \"deepseek\" && this.inner.agent?.state) {\n this.inner.agent.state.thinkingLevel = \"xhigh\";\n }\n return null;\n }\n\n case \"compact\": {\n // pi's compact() does not guard against empty messagesToSummarize — use findCutPoint\n // to pre-check and throw a clean error instead of generating a useless empty summary.\n const { findCutPoint, DEFAULT_COMPACTION_SETTINGS } = await import(\"@earendil-works/pi-coding-agent\");\n const pathEntries = this.inner.sessionManager.getBranch() as Array<{ type: string }>;\n const settings = { ...DEFAULT_COMPACTION_SETTINGS, ...this.inner.settingsManager.getCompactionSettings() };\n let prevCompactionIndex = -1;\n for (let i = pathEntries.length - 1; i >= 0; i--) {\n if (pathEntries[i].type === \"compaction\") { prevCompactionIndex = i; break; }\n }\n const boundaryStart = prevCompactionIndex + 1;\n const cutPoint = findCutPoint(pathEntries as never, boundaryStart, pathEntries.length, settings.keepRecentTokens);\n const historyEnd = cutPoint.isSplitTurn ? cutPoint.turnStartIndex : cutPoint.firstKeptEntryIndex;\n if (historyEnd <= boundaryStart) {\n throw new Error(\"Conversation too short to compact\");\n }\n const result = await this.inner.compact(command.customInstructions as string | undefined);\n return result;\n }\n\n case \"set_auto_compaction\": {\n this.inner.setAutoCompactionEnabled(command.enabled as boolean);\n return null;\n }\n\n case \"steer\": {\n const steerImages = command.images as Array<{ type: \"image\"; data: string; mimeType: string }> | undefined;\n await this.inner.steer(command.message as string, steerImages?.length ? steerImages : undefined);\n return null;\n }\n\n case \"follow_up\": {\n const followImages = command.images as Array<{ type: \"image\"; data: string; mimeType: string }> | undefined;\n await this.inner.followUp(command.message as string, followImages?.length ? followImages : undefined);\n return null;\n }\n\n case \"get_tools\": {\n const all: ToolInfo[] = this.inner.getAllTools();\n const active = new Set<string>(this.inner.getActiveToolNames());\n return all.map((t) => ({\n name: t.name,\n description: t.description,\n active: active.has(t.name),\n }));\n }\n\n case \"set_tools\": {\n this.inner.setActiveToolsByName(command.toolNames as string[]);\n return null;\n }\n\n case \"abort_compaction\": {\n this.inner.abortCompaction();\n return null;\n }\n\n case \"set_auto_retry\": {\n this.inner.setAutoRetryEnabled(command.enabled as boolean);\n return null;\n }\n\n default:\n throw new Error(`Unsupported command: ${type}`);\n }\n }\n\n destroy(): void {\n if (!this._alive) return;\n this._alive = false;\n if (this.idleTimer) clearTimeout(this.idleTimer);\n this.unsubscribe?.();\n this.onDestroyCallback?.();\n }\n}\n\n// ============================================================================\n// Session registry\n// ============================================================================\n\ndeclare global {\n var __piSessions: Map<string, AgentSessionWrapper> | undefined;\n var __piStartLocks: Map<string, Promise<{ session: AgentSessionWrapper; realSessionId: string }>> | undefined;\n}\n\nfunction getRegistry(): Map<string, AgentSessionWrapper> {\n if (!globalThis.__piSessions) {\n globalThis.__piSessions = new Map();\n const cleanup = () => globalThis.__piSessions?.forEach((s) => s.destroy());\n process.once(\"exit\", cleanup);\n process.once(\"SIGINT\", cleanup);\n process.once(\"SIGTERM\", cleanup);\n }\n return globalThis.__piSessions;\n}\n\nfunction getLocks(): Map<string, Promise<{ session: AgentSessionWrapper; realSessionId: string }>> {\n if (!globalThis.__piStartLocks) globalThis.__piStartLocks = new Map();\n return globalThis.__piStartLocks;\n}\n\nexport function getRpcSession(sessionId: string): AgentSessionWrapper | undefined {\n return getRegistry().get(sessionId);\n}\n\n/**\n * Get or create an AgentSession for the given session.\n * For new sessions (sessionFile === \"\"), pi generates its own id.\n * Pass toolNames to pre-configure active tools (empty array = all tools disabled).\n */\nexport async function startRpcSession(\n sessionId: string,\n sessionFile: string,\n cwd: string,\n toolNames?: string[]\n): Promise<{ session: AgentSessionWrapper; realSessionId: string }> {\n const registry = getRegistry();\n const locks = getLocks();\n\n const existing = registry.get(sessionId);\n if (existing?.isAlive()) return { session: existing, realSessionId: sessionId };\n\n const inflight = locks.get(sessionId);\n if (inflight) return inflight;\n\n const starting = (async () => {\n const { SessionManager, getAgentDir } = await import(\"@earendil-works/pi-coding-agent\");\n const agentDir = getAgentDir();\n\n const sessionManager = sessionFile\n ? SessionManager.open(sessionFile, undefined)\n : SessionManager.create(cwd, undefined);\n\n // Determine which tools to pass based on requested toolNames.\n // Since v0.68.0, createAgentSession expects string[] tool names instead of Tool[] instances.\n // Pass all built-in coding tool names by default; for \"all off\", pass empty array.\n const allCodingToolNames = [\"read\", \"bash\", \"edit\", \"write\", \"grep\", \"find\", \"ls\"];\n let toolsOption: string[] | undefined;\n if (toolNames !== undefined) {\n toolsOption = toolNames.length === 0 ? [] : allCodingToolNames;\n }\n\n const { session: inner } = await createAgentSession({\n cwd,\n agentDir,\n sessionManager,\n ...(toolsOption !== undefined ? { tools: toolsOption } : {}),\n });\n\n // If specific tool names were requested (non-empty), narrow active tools now\n if (toolNames && toolNames.length > 0) {\n inner.setActiveToolsByName(toolNames);\n }\n\n // When all tools are disabled, clear the system prompt entirely.\n // pi's buildSystemPrompt always produces a non-empty prompt even with no tools;\n // the only way to truly clear it is to call agent.setSystemPrompt directly.\n if (toolNames?.length === 0) {\n inner.agent.state.systemPrompt = \"\";\n }\n\n const wrapper = new AgentSessionWrapper(inner);\n wrapper.start();\n\n const realSessionId = inner.sessionId as string;\n const realSessionFile = inner.sessionFile as string | undefined;\n if (realSessionFile) cacheSessionPath(realSessionId, realSessionFile);\n\n wrapper.onDestroy(() => registry.delete(realSessionId));\n registry.set(realSessionId, wrapper);\n\n return { session: wrapper, realSessionId };\n })().finally(() => locks.delete(sessionId));\n\n locks.set(sessionId, starting);\n return starting;\n}\n","import { NextResponse } from \"next/server\";\nimport { resolveSessionPath } from \"@/lib/session-reader\";\nimport { startRpcSession, getRpcSession } from \"@/lib/rpc-manager\";\nimport { SessionManager } from \"@earendil-works/pi-coding-agent\";\n\n// POST /api/agent/[id] - Send a command to an existing session\nexport async function POST(\n req: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n\n try {\n const body = await req.json() as { type: string; [key: string]: unknown };\n\n // Fast path: already-running session\n const existing = getRpcSession(id);\n if (existing?.isAlive()) {\n const result = await existing.send(body);\n return NextResponse.json({ success: true, data: result });\n }\n\n const filePath = await resolveSessionPath(id);\n if (!filePath) {\n return NextResponse.json({ error: \"Session not found\" }, { status: 404 });\n }\n\n const cwd = SessionManager.open(filePath).getHeader()?.cwd ?? process.cwd();\n\n const { session } = await startRpcSession(id, filePath, cwd);\n const result = await session.send(body);\n\n return NextResponse.json({ success: true, data: result });\n } catch (error) {\n return NextResponse.json({ error: String(error) }, { status: 500 });\n }\n}\n\n// GET /api/agent/[id] - Get current agent state\nexport async function GET(\n _req: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n\n try {\n const session = getRpcSession(id);\n if (!session || !session.isAlive()) {\n return NextResponse.json({ running: false });\n }\n\n const state = await session.send({ type: \"get_state\" });\n return NextResponse.json({ running: true, state });\n } catch (error) {\n return NextResponse.json({ error: String(error) }, { status: 500 });\n }\n}\n","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n type AppRouteUserlandModule,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport {\n addRequestMeta,\n getRequestMeta,\n setRequestMeta,\n type RequestMeta,\n} from '../../server/request-meta'\nimport { getTracer, type Span, SpanKind } from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\nimport * as userland from 'VAR_USERLAND'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland as AppRouteUserlandModule,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...(process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER\n ? {\n getUserland: () => import('VAR_USERLAND'),\n }\n : {}),\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil?: (prom: Promise<void>) => void\n requestMeta?: RequestMeta\n }\n) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta)\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n deploymentId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] ||\n prerenderManifest.routes[resolvedPathname]\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname])\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n const isWrappedByNextServer = Boolean(\n routerServerContext?.isWrappedByNextServer\n )\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'))\n\n const incrementalCache =\n getRequestMeta(req, 'incrementalCache') ||\n (await routeModule.getIncrementalCache(\n req,\n nextConfig,\n prerenderManifest,\n isMinimalMode\n ))\n\n incrementalCache?.resetRequestCache()\n ;(globalThis as any).__incrementalCache = incrementalCache\n\n const context: AppRouteRouteHandlerContext = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n deploymentId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n try {\n let parentSpan: Span | undefined\n const invokeRouteModule = async (span?: Span) => {\n return routeModule.handle(nextReq, context).finally(() => {\n if (!span) return\n\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false,\n })\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route')\n if (route) {\n const name = `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route)\n parentSpan.updateName(name)\n }\n } else {\n span.updateName(`${method} ${srcPage}`)\n }\n })\n }\n\n const handleResponse = async (currentSpan?: Span) => {\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await invokeRouteModule(currentSpan)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n response,\n context.renderOpts.pendingWaitUntil\n )\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return null\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan)\n } else {\n parentSpan = tracer.getActiveScopeSpan()\n await tracer.withPropagatedContext(\n req.headers,\n () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n handleResponse\n ),\n undefined,\n !isWrappedByNextServer\n )\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return null\n }\n}\n"],"names":["isObject","val","Array","isArray","normalizeToolCallBlock","block","type","toolCallId","id","toolName","name","input","arguments","normalizeToolCalls","msg","role","content","normalized","map","result","getSessionsDir","listAllSessions","piSessions","listAll","pathToId","Map","s","set","path","cache","getPathCache","cwd","created","Date","toISOString","String","modified","messageCount","firstMessage","parentSessionId","parentSessionPath","get","undefined","globalThis","__piSessionPathCache","resolveSessionPath","sessionId","cached","cacheSessionPath","filePath","invalidateSessionPathCache","delete","getSessionEntries","entries","open","getEntries","buildTree","nodeMap","labelsById","entry","l","label","targetId","roots","children","node","parentId","push","parent","stack","length","pop","sort","a","b","timestamp","getTime","buildSessionContext","leafId","byId","e","piEntries","piCtx","targetLeaf","messages","entryIds","thinkingLevel","model","cur","unshift","compactionId","firstKeptEntryId","compactionIdx","findIndex","firstKeptIdx","i","startIdx","raw","summary","getLeafId","AgentSessionWrapper","listeners","unsubscribe","idleTimer","onDestroyCallback","_alive","inner","sessionFile","isAlive","start","subscribe","event","resetIdleTimer","clearTimeout","setTimeout","destroy","onEvent","listener","indexOf","splice","onDestroy","cb","send","command","promptImages","images","prompt","message","catch","abort","contextUsage","getContextUsage","isStreaming","isCompacting","autoCompactionEnabled","autoRetryEnabled","provider","pendingMessageCount","percent","contextWindow","tokens","systemPrompt","agent","state","modelId","registry","modelRegistry","find","Error","setModel","entryId","sessionManager","currentSessionFile","isPersisted","cancelled","getEntry","sessionDir","getSessionDir","newSessionFile","newManager","create","getCwd","newSession","parentSession","getSessionFile","sourceManager","forkedPath","createBranchedSession","newSessionId","getSessionId","navigateTree","level","setThinkingLevel","compat","thinkingFormat","findCutPoint","DEFAULT_COMPACTION_SETTINGS","pathEntries","getBranch","settings","settingsManager","getCompactionSettings","prevCompactionIndex","boundaryStart","cutPoint","keepRecentTokens","historyEnd","isSplitTurn","turnStartIndex","firstKeptEntryIndex","compact","customInstructions","setAutoCompactionEnabled","enabled","steerImages","steer","followImages","followUp","all","getAllTools","active","Set","getActiveToolNames","t","description","has","setActiveToolsByName","toolNames","abortCompaction","setAutoRetryEnabled","getRegistry","__piSessions","cleanup","forEach","process","once","getLocks","__piStartLocks","getRpcSession","startRpcSession","locks","existing","session","realSessionId","inflight","starting","SessionManager","getAgentDir","agentDir","allCodingToolNames","toolsOption","tools","wrapper","realSessionFile","finally","POST","req","params","body","json","success","data","error","status","getHeader","GET","_req","running","AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","setRequestMeta","getTracer","SpanKind","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","CachedRouteKind","userland","routeModule","definition","kind","APP_ROUTE","page","pathname","filename","bundlePath","distDir","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","TURBOPACK","__NEXT_DEV_SERVER","getUserland","workAsyncStorage","workUnitAsyncStorage","serverHooks","handler","res","ctx","requestMeta","isDev","hrtime","bigint","srcPage","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","deploymentId","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isIsr","Boolean","dynamicRoutes","routes","render404","isPrerendered","prerenderInfo","fallback","adapterPath","cacheKey","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","isWrappedByNextServer","isMinimalMode","incrementalCache","getIncrementalCache","resetRequestCache","__incrementalCache","context","previewProps","preview","renderOpts","experimental","authInterrupts","cacheComponents","cacheLifeProfiles","cacheLife","onClose","on","onAfterTaskError","onInstrumentationRequestError","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","parentSpan","invokeRouteModule","span","handle","setAttributes","rootSpanAttributes","getRootSpanAttributes","handleRequest","console","warn","route","updateName","setAttribute","handleResponse","currentSpan","cacheEntry","responseGenerator","previousCacheEntry","setHeader","response","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","headers","revalidate","collectedRevalidate","expire","collectedExpire","value","Buffer","from","arrayBuffer","cacheControl","err","isStale","routerKind","routePath","routeType","revalidateReason","routeKind","isFallback","isRoutePPREnabled","isMiss","Response","withPropagatedContext","trace","spanName","SERVER","attributes","url"],"mappings":"+oCAoBO,SAASa,AAAmBC,CAAiB,EAClD,GAAiB,cAAbA,EAAIC,IAAI,CAAkB,OAAOD,EACrC,IAAME,EAAWF,EAAyBE,OAAO,CACjD,GAAI,CAACd,MAAMC,OAAO,CAACa,GAAU,OAAOF,EACpC,IAAMG,EAAaD,EAAQE,GAAG,CAAC,AAACb,GAEvBc,CAnBT,AAAI,AAJkB,CAIjBnB,SAASK,AAJP,OAAOJ,GAA4B,AAARA,QAAg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AE5K,OAAQ,GAAI,IAE5B,IACT,CACF,mCA7eA,SAASO,EACP,MAAA,CAAA,EAAOC,EAAAA,UAAAA,EAAY,kBACjByC,uBACAC,CACF,EACF","ignoreList":[4]}
@@ -0,0 +1,3 @@
1
+ module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},84045,e=>{"use strict";var t=e.i(14448),r=e.i(51795),a=e.i(89303),n=e.i(51349),s=e.i(1654),i=e.i(94945),o=e.i(90777),l=e.i(50854),d=e.i(93079),u=e.i(32946),p=e.i(4287),c=e.i(71538),h=e.i(8919),R=e.i(50325),x=e.i(37782),v=e.i(93695);e.i(58724);var w=e.i(86627);async function g(){return new Response("Not used",{status:410})}e.s(["POST",0,g],26447);var f=e.i(26447);let m=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sessions/new/route",pathname:"/api/sessions/new",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/sessions/new/route.ts",nextConfigOutput:"",userland:f,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:C,serverHooks:y}=m;async function A(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),m.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/sessions/new/route";g=g.replace(/\/index$/,"")||"/";let f=await m.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!f)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,deploymentId:C,params:y,nextConfig:A,parsedUrl:b,isDraftMode:N,prerenderManifest:T,routerServerContext:P,isOnDemandRevalidate:q,revalidateOnlyGenerated:S,resolvedPathname:O,clientReferenceManifest:_,serverActionsManifest:k}=f,H=(0,o.normalizeAppPath)(g),I=!!(T.dynamicRoutes[H]||T.routes[O]),U=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,b,!1):t.end("This page could not be found"),null);if(I&&!N){let e=!!T.routes[O],t=T.dynamicRoutes[H];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await U();throw new v.NoFallbackError}}let j=null;!I||m.isDev||N||(j="/index"===(j=O)?"/":j);let M=!0===m.isDev||!I,D=I&&!M;k&&_&&(0,i.setManifestsSingleton)({page:g,clientReferenceManifest:_,serverActionsManifest:k});let $=e.method||"GET",F=(0,s.getTracer)(),K=F.getActiveScopeSpan(),B=!!(null==P?void 0:P.isWrappedByNextServer),L=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await m.getIncrementalCache(e,A,T,L);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:y,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:M,incrementalCache:G,cacheLifeProfiles:A.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>m.onRequestError(e,t,a,n,P)},sharedContext:{buildId:E,deploymentId:C}},W=new l.NodeNextRequest(e),X=new l.NodeNextResponse(t),z=d.NextRequestAdapter.fromNodeNextRequest(W,(0,d.signalFromNodeResponse)(t));try{let n,i=async e=>m.handle(z,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${$} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${$} ${g}`)}),o=async n=>{var s,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&q&&S&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(n);e.fetchMetrics=V.renderOpts.fetchMetrics;let o=V.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=V.renderOpts.collectedTags;if(!I)return await (0,c.sendResponse)(W,X,s,V.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[x.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await m.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:q})},!1,P),t}},d=await m.handleResponse({req:e,nextConfig:A,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:S,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:L});if(!I)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",q?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&I||u.delete(x.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,R.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(W,X,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};B&&K?await o(K):(n=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${$} ${g}`,kind:s.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},o),void 0,!B))}catch(t){if(t instanceof v.NoFallbackError||await m.onRequestError(e,t,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:q})},!1,P),I)throw t;return await (0,c.sendResponse)(W,X,new Response(null,{status:500})),null}}e.s(["handler",0,A,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:C})},"routeModule",0,m,"serverHooks",0,y,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,C],84045)}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__02d~8ho._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/next%4016.2.6_%40babel%2Bcore%407.29.7_%40playwright%2Btest%401.60.0_react-dom%4019.2.6_react%4019.2.6__react%4019.2.6/node_modules/next/dist/esm/build/templates/app-route.js","../../../app/api/sessions/new/route.ts"],"sourcesContent":["import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/sessions/new/route\",\n pathname: \"/api/sessions/new\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/app/api/sessions/new/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/sessions/new/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId,\n deploymentId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","// This route is no longer used — new sessions are created fully client-side.\n// Kept as a no-op for reference.\nexport async function POST() {\n return new Response(\"Not used\", { status: 410 });\n}\n"],"names":["POST","Response","status"],"mappings":"g0BAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,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EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,EACA,sBACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA5TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[0]}
@@ -0,0 +1,3 @@
1
+ module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},92840,e=>{"use strict";var t=e.i(14448),r=e.i(51795),a=e.i(89303),n=e.i(51349),s=e.i(1654),o=e.i(94945),i=e.i(90777),l=e.i(50854),d=e.i(93079),u=e.i(32946),p=e.i(4287),c=e.i(71538),h=e.i(8919),x=e.i(50325),R=e.i(37782),v=e.i(93695);e.i(58724);var m=e.i(86627),g=e.i(80630),f=e.i(46786);async function w(){return g.NextResponse.json({home:(0,f.homedir)()})}e.s(["GET",0,w],48003);var E=e.i(48003);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/home/route",pathname:"/api/home",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/home/route.ts",nextConfigOutput:"",userland:E,...{}}),{workAsyncStorage:y,workUnitAsyncStorage:A,serverHooks:b}=C;async function N(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),C.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/home/route";g=g.replace(/\/index$/,"")||"/";let f=await C.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!f)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:w,deploymentId:E,params:y,nextConfig:A,parsedUrl:b,isDraftMode:N,prerenderManifest:T,routerServerContext:q,isOnDemandRevalidate:P,revalidateOnlyGenerated:S,resolvedPathname:_,clientReferenceManifest:k,serverActionsManifest:O}=f,j=(0,i.normalizeAppPath)(g),H=!!(T.dynamicRoutes[j]||T.routes[_]),I=async()=>((null==q?void 0:q.render404)?await q.render404(e,t,b,!1):t.end("This page could not be found"),null);if(H&&!N){let e=!!T.routes[_],t=T.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await I();throw new v.NoFallbackError}}let U=null;!H||C.isDev||N||(U="/index"===(U=_)?"/":U);let M=!0===C.isDev||!H,D=H&&!M;O&&k&&(0,o.setManifestsSingleton)({page:g,clientReferenceManifest:k,serverActionsManifest:O});let $=e.method||"GET",F=(0,s.getTracer)(),K=F.getActiveScopeSpan(),B=!!(null==q?void 0:q.isWrappedByNextServer),L=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,A,T,L);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:y,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:M,incrementalCache:G,cacheLifeProfiles:A.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,q)},sharedContext:{buildId:w,deploymentId:E}},W=new l.NodeNextRequest(e),X=new l.NodeNextResponse(t),z=d.NextRequestAdapter.fromNodeNextRequest(W,(0,d.signalFromNodeResponse)(t));try{let n,o=async e=>C.handle(z,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${$} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${$} ${g}`)}),i=async n=>{var s,i;let l=async({previousCacheEntry:r})=>{try{if(!L&&P&&S&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(n);e.fetchMetrics=V.renderOpts.fetchMetrics;let i=V.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let l=V.renderOpts.collectedTags;if(!H)return await (0,c.sendResponse)(W,X,s,V.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[R.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=R.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:P})},!1,q),t}},d=await C.handleResponse({req:e,nextConfig:A,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:S,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:L});if(!H)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==m.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});L||t.setHeader("x-nextjs-cache",P?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&H||u.delete(R.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,x.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(W,X,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};B&&K?await i(K):(n=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${$} ${g}`,kind:s.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},i),void 0,!B))}catch(t){if(t instanceof v.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:P})},!1,q),H)throw t;return await (0,c.sendResponse)(W,X,new Response(null,{status:500})),null}}e.s(["handler",0,N,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:y,workUnitAsyncStorage:A})},"routeModule",0,C,"serverHooks",0,b,"workAsyncStorage",0,y,"workUnitAsyncStorage",0,A],92840)}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__02y51p8._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/next%4016.2.6_%40babel%2Bcore%407.29.7_%40playwright%2Btest%401.60.0_react-dom%4019.2.6_react%4019.2.6__react%4019.2.6/node_modules/next/dist/esm/build/templates/app-route.js","../../../app/api/home/route.ts"],"sourcesContent":["import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/home/route\",\n pathname: \"/api/home\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/app/api/home/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/home/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId,\n deploymentId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import { NextResponse } from \"next/server\";\nimport { homedir } from \"os\";\n\nexport async function GET() {\n return NextResponse.json({ home: homedir() });\n}\n"],"names":["GET","json","home"],"mappings":"0iCAAA,IAAA,EAAA,EAAA,CAAA,CAA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AAkB,GACtC,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,QAAiB,EAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,CAClC,0CACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA5TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAW,AAAX,EAAY,kBACf,uBACA,CACJ,EACJ","ignoreList":[0]}
@@ -0,0 +1,3 @@
1
+ module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},66592,e=>e.a(async(t,r)=>{try{let t=await e.y("@earendil-works/pi-coding-agent-8d8517777649a67a");e.n(t),r()}catch(e){r(e)}},!0),62228,e=>e.a(async(t,r)=>{try{let t=await e.y("@earendil-works/pi-ai-152b2a90ef04a40c");e.n(t),r()}catch(e){r(e)}},!0),29705,e=>e.a(async(t,r)=>{try{var a=e.i(66592),n=e.i(62228),i=t([a,n]);async function o(){let e=new Map,t=[],r=null,i={},o={};try{let s=(0,a.getAgentDir)(),l=a.AuthStorage.create(),d=a.ModelRegistry.create(l).getAvailable();for(let r of(t=d.map(e=>({id:e.id,name:e.name,provider:e.provider})),d)){let t=`${r.provider}:${r.id}`;e.set(t,r.name),i[t]=(0,n.getSupportedThinkingLevels)(r),r.thinkingLevelMap&&(o[t]=r.thinkingLevelMap)}let u=a.SettingsManager.create(process.cwd(),s),p=u.getDefaultProvider(),c=u.getDefaultModel();p&&(r={provider:p,modelId:c??d[0]?.id??""})}catch{}return Response.json({models:Object.fromEntries(e),modelList:t,defaultModel:r,thinkingLevels:i,thinkingLevelMaps:o})}[a,n]=i.then?(await i)():i,e.s(["GET",0,o,"dynamic",0,"force-dynamic"]),r()}catch(e){r(e)}},!1),49103,e=>e.a(async(t,r)=>{try{var a=e.i(14448),n=e.i(51795),i=e.i(89303),o=e.i(51349),s=e.i(1654),l=e.i(94945),d=e.i(90777),u=e.i(50854),p=e.i(93079),c=e.i(32946),h=e.i(4287),v=e.i(71538),g=e.i(8919),R=e.i(50325),x=e.i(37782),m=e.i(93695);e.i(58724);var w=e.i(86627),f=e.i(29705),y=t([f]);[f]=y.then?(await y)():y;let C=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/models/route",pathname:"/api/models",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/models/route.ts",nextConfigOutput:"",userland:f,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:b,serverHooks:T}=C;async function E(e,t,r){r.requestMeta&&(0,o.setRequestMeta)(e,r.requestMeta),C.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/models/route";a=a.replace(/\/index$/,"")||"/";let i=await C.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!i)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:f,deploymentId:y,params:E,nextConfig:A,parsedUrl:b,isDraftMode:T,prerenderManifest:N,routerServerContext:P,isOnDemandRevalidate:S,revalidateOnlyGenerated:k,resolvedPathname:q,clientReferenceManifest:O,serverActionsManifest:_}=i,M=(0,d.normalizeAppPath)(a),j=!!(N.dynamicRoutes[M]||N.routes[q]),H=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,b,!1):t.end("This page could not be found"),null);if(j&&!T){let e=!!N.routes[q],t=N.dynamicRoutes[M];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await H();throw new m.NoFallbackError}}let I=null;!j||C.isDev||T||(I=q,I="/index"===I?"/":I);let D=!0===C.isDev||!j,U=j&&!D;_&&O&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:O,serverActionsManifest:_});let $=e.method||"GET",F=(0,s.getTracer)(),K=F.getActiveScopeSpan(),L=!!(null==P?void 0:P.isWrappedByNextServer),B=!!(0,o.getRequestMeta)(e,"minimalMode"),G=(0,o.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,A,N,B);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:E,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:D,incrementalCache:G,cacheLifeProfiles:A.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,P)},sharedContext:{buildId:f,deploymentId:y}},W=new u.NodeNextRequest(e),X=new u.NodeNextResponse(t),z=p.NextRequestAdapter.fromNodeNextRequest(W,(0,p.signalFromNodeResponse)(t));try{let i,o=async e=>C.handle(z,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${$} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),i&&i!==e&&(i.setAttribute("http.route",n),i.updateName(t))}else e.updateName(`${$} ${a}`)}),l=async i=>{var s,l;let d=async({previousCacheEntry:n})=>{try{if(!B&&S&&k&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(i);e.fetchMetrics=V.renderOpts.fetchMetrics;let s=V.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let l=V.renderOpts.collectedTags;if(!j)return await (0,v.sendResponse)(W,X,a,V.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,g.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[x.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,n=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==n?void 0:n.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,P),t}},u=await C.handleResponse({req:e,nextConfig:A,cacheKey:I,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:k,responseGenerator:d,waitUntil:r.waitUntil,isMinimalMode:B});if(!j)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",S?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,g.fromNodeOutgoingHttpHeaders)(u.value.headers);return B&&j||p.delete(x.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,R.getCacheControlHeader)(u.cacheControl)),await (0,v.sendResponse)(W,X,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};L&&K?await l(K):(i=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(c.BaseServerSpan.handleRequest,{spanName:`${$} ${a}`,kind:s.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},l),void 0,!L))}catch(t){if(t instanceof m.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,P),j)throw t;return await (0,v.sendResponse)(W,X,new Response(null,{status:500})),null}}e.s(["handler",0,E,"patchFetch",0,function(){return(0,i.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:b})},"routeModule",0,C,"serverHooks",0,T,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,b]),r()}catch(e){r(e)}},!1)];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__06f2iy5._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../app/api/models/route.ts","../../../node_modules/.pnpm/next%4016.2.6_%40babel%2Bcore%407.29.7_%40playwright%2Btest%401.60.0_react-dom%4019.2.6_react%4019.2.6__react%4019.2.6/node_modules/next/src/build/templates/app-route.ts"],"sourcesContent":["import { AuthStorage, ModelRegistry, SettingsManager, getAgentDir } from \"@earendil-works/pi-coding-agent\";\nimport { getSupportedThinkingLevels } from \"@earendil-works/pi-ai\";\n\nexport const dynamic = \"force-dynamic\";\n\nexport async function GET() {\n const nameMap = new Map<string, string>();\n let modelList: { id: string; name: string; provider: string }[] = [];\n let defaultModel: { provider: string; modelId: string } | null = null;\n const thinkingLevels: Record<string, string[]> = {};\n const thinkingLevelMaps: Record<string, Record<string, string | null>> = {};\n\n try {\n const agentDir = getAgentDir();\n const authStorage = AuthStorage.create();\n const registry = ModelRegistry.create(authStorage);\n const available = registry.getAvailable();\n modelList = available.map((m: { id: string; name: string; provider: string }) => ({\n id: m.id,\n name: m.name,\n provider: m.provider,\n }));\n for (const m of available) {\n const key = `${m.provider}:${m.id}`;\n nameMap.set(key, m.name);\n thinkingLevels[key] = getSupportedThinkingLevels(m);\n if (m.thinkingLevelMap) thinkingLevelMaps[key] = m.thinkingLevelMap;\n }\n\n const settings = SettingsManager.create(process.cwd(), agentDir);\n const provider = settings.getDefaultProvider();\n const modelId = settings.getDefaultModel();\n if (provider) {\n defaultModel = { provider, modelId: modelId ?? available[0]?.id ?? \"\" };\n }\n } catch { /* return empty */ }\n\n return Response.json({ models: Object.fromEntries(nameMap), modelList, defaultModel, thinkingLevels, thinkingLevelMaps });\n}\n","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n type AppRouteUserlandModule,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport {\n addRequestMeta,\n getRequestMeta,\n setRequestMeta,\n type RequestMeta,\n} from '../../server/request-meta'\nimport { getTracer, type Span, SpanKind } from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\nimport * as userland from 'VAR_USERLAND'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland as AppRouteUserlandModule,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...(process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER\n ? {\n getUserland: () => import('VAR_USERLAND'),\n }\n : {}),\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil?: (prom: Promise<void>) => void\n requestMeta?: RequestMeta\n }\n) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta)\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n deploymentId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] ||\n prerenderManifest.routes[resolvedPathname]\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname])\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n const isWrappedByNextServer = Boolean(\n routerServerContext?.isWrappedByNextServer\n )\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'))\n\n const incrementalCache =\n getRequestMeta(req, 'incrementalCache') ||\n (await routeModule.getIncrementalCache(\n req,\n nextConfig,\n prerenderManifest,\n isMinimalMode\n ))\n\n incrementalCache?.resetRequestCache()\n ;(globalThis as any).__incrementalCache = incrementalCache\n\n const context: AppRouteRouteHandlerContext = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n deploymentId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n try {\n let parentSpan: Span | undefined\n const invokeRouteModule = async (span?: Span) => {\n return routeModule.handle(nextReq, context).finally(() => {\n if (!span) return\n\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false,\n })\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route')\n if (route) {\n const name = `${method} ${route}`\n\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n span.updateName(name)\n\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route)\n parentSpan.updateName(name)\n }\n } else {\n span.updateName(`${method} ${srcPage}`)\n }\n })\n }\n\n const handleResponse = async (currentSpan?: Span) => {\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await invokeRouteModule(currentSpan)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n response,\n context.renderOpts.pendingWaitUntil\n )\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return null\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan)\n } else {\n parentSpan = tracer.getActiveScopeSpan()\n await tracer.withPropagatedContext(\n req.headers,\n () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n handleResponse\n ),\n undefined,\n !isWrappedByNextServer\n )\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return null\n }\n}\n"],"names":["dynamic","GET","nameMap","Map","modelList","defaultModel","thinkingLevels","thinkingLevelMaps","agentDir","authStorage","create","registry","available","getAvailable","map","m","id","name","provider","key","set","thinkingLevelMap","settings","process","cwd","getDefaultProvider","modelId","getDefaultModel","Response","json","models","Object","fromEntries","AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","setRequestMeta","getTracer","SpanKind","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","CachedRouteKind","userland","routeModule","definition","kind","APP_ROUTE","page","pathname","filename","bundlePath","distDir","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","TURBOPACK","__NEXT_DEV_SERVER","getUserland","workAsyncStorage","workUnitAsyncStorage","serverHooks","handler","req","res","ctx","requestMeta","isDev","hrtime","bigint","srcPage","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","deploymentId","params","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isIsr","Boolean","dynamicRoutes","routes","render404","isPrerendered","prerenderInfo","fallback","adapterPath","cacheKey","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","isWrappedByNextServer","isMinimalMode","incrementalCache","getIncrementalCache","resetRequestCache","globalThis","__incrementalCache","context","previewProps","preview","renderOpts","experimental","authInterrupts","cacheComponents","cacheLifeProfiles","cacheLife","onClose","cb","on","onAfterTaskError","undefined","onInstrumentationRequestError","error","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","parentSpan","invokeRouteModule","span","handle","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","get","handleRequest","console","warn","route","updateName","setAttribute","handleResponse","currentSpan","cacheEntry","responseGenerator","previousCacheEntry","setHeader","response","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","headers","type","revalidate","collectedRevalidate","expire","collectedExpire","value","status","body","Buffer","from","arrayBuffer","cacheControl","err","isStale","routerKind","routePath","routeType","revalidateReason","routeKind","isFallback","isRoutePPREnabled","Error","isMiss","delete","getHeader","withPropagatedContext","trace","spanName","SERVER","attributes","url"],"mappings":"+jCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,kBAIO,eAAeC,IACpB,IAAMC,EAAU,IAAIC,IAChBC,EAA8D,EAAE,CAChEC,EAA6D,KAC3DC,EAA2C,CAAC,EAC5CC,EAAmE,CAAC,EAE1E,GAAI,CACF,IAAMC,EAAW,CAAA,EAAA,EAAA,WAAA,AAAW,IACtBC,EAAc,EAAA,WAAW,CAACC,MAAM,GAEhCE,EADW,AACCD,EADD,aAAa,CAACD,MAAM,CAACD,GACXI,YAAY,GAMvC,IAAK,IAAME,KALXX,EAAYQ,EAAUE,GAAG,CAAEC,AAAD,IAAuD,AAAC,CAChFC,GAAID,EAAEC,EAAE,CACRC,KAAMF,EAAEE,IAAI,CACZC,SAAUH,EAAEG,QAAQ,CACtB,CAAC,EACeN,GAAW,CACzB,IAAMO,EAAM,CAAA,EAAGJ,EAAEG,QAAQ,CAAC,CAAC,EAAEH,EAAEC,EAAE,CAAA,CAAE,CACnCd,EAAQkB,GAAG,CAACD,EAAKJ,EAAEE,IAAI,EACvBX,CAAc,CAACa,EAAI,CAAG,CAAA,EAAA,EAAA,0BAAA,AAA0B,EAACJ,GAC7CA,EAAEM,gBAAgB,EAAEd,EAAiB,CAACY,EAAI,CAAGJ,EAAEM,gBAAAA,AAAgB,CACrE,CAEA,IAAMC,EAAW,EAAA,eAAe,CAACZ,MAAM,CAACa,QAAQC,GAAG,GAAIhB,GACjDU,EAAWI,EAASG,kBAAkB,GACtCC,EAAUJ,EAASK,eAAe,GACpCT,IACFb,EAAe,CAAEa,GADL,QACeQ,QAASA,GAAWd,CAAS,CAAC,EAAE,EAAEI,IAAM,GAAG,CAE1E,CAAE,KAAM,CAAqB,CAE7B,OAAOY,SAASC,IAAI,CAAC,CAAE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AA,EACJ2G,EACAC,EAEA,IAAIlI,SAASsJ,EAAWgB,KAAK,CAACE,IAAI,CAAE,SAClCR,EACAO,OAAQjB,EAAWgB,KAAK,CAACC,MAAM,EAAI,GACrC,IAEK,IACT,EAIIlE,GAAyBF,EAC3B,MAAMiD,EAAejD,EADkB,EAGvCkC,EAAanC,EAAOE,kBAAkB,GACtC,MAAMF,EAAOwF,CAf2H,oBAetG,CAChCrI,EAAI2G,OAAO,CACX,IACE9D,EAAOyF,KAAK,CACVvK,EAAAA,cAAAA,CAAe0H,aAAa,CAC5B,CACE8C,SAAU,CAAA,EAAG3F,EAAO,CAAC,EAAErC,EAAAA,CAAS,CAChC3B,KAAMpB,EAAAA,QAAAA,CAASgL,MAAM,CACrBC,WAAY,CACV,cAAe7F,EACf,cAAe5C,EAAI0I,GAAG,AACxB,CACF,EACA3C,QAEJ3B,EACA,CAACpB,GAGP,CAAE,MAAOwE,EAAK,CAuBZ,GAtBMA,aAAejJ,EAAAA,eAAc,EAEjC,CAFqC,KAE/BG,EAAYgG,cAAc,CAC9B1E,EACAwH,EACA,CACEE,WAAY,aACZC,UAAW5F,EACX6F,UAAW,QACXC,iBAAAA,CAAAA,EAAkB7J,EAAAA,mBAAAA,EAAoB,oBACpC2E,EACAjB,sBACF,EACF,GACA+C,AAbiB,EAcjBhD,GAOAO,EAAO,MAAMwF,EAQjB,OALA,MAAA,CAAA,EAAMvJ,EAAAA,YAAAA,EACJ2G,EACAC,EACA,IAAIlI,SAAS,KAAM,CAAEuK,OAAQ,GAAI,IAE5B,IACT,CACF,mCA7eA,SAAShK,EACP,MAAA,CAAA,EAAOC,EAAAA,UAAAA,EAAY,kBACjByC,uBACAC,CACF,EACF","ignoreList":[1]}
@@ -0,0 +1,5 @@
1
+ module.exports=[22734,(e,t,s)=>{t.exports=e.x("fs",()=>require("fs"))},24725,(e,t,s)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},14747,(e,t,s)=>{t.exports=e.x("path",()=>require("path"))},93695,(e,t,s)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,s)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,s)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,s)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,s)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},66592,e=>e.a(async(t,s)=>{try{let t=await e.y("@earendil-works/pi-coding-agent-8d8517777649a67a");e.n(t),s()}catch(e){s(e)}},!0),9948,e=>{"use strict";e.s(["normalizeToolCalls",0,function(e){if("assistant"!==e.role)return e;let t=e.content;if(!Array.isArray(t))return e;let s=t.map(e=>("object"!=typeof e||null===e||Array.isArray(e)||"toolCall"!==e.type?null:{type:"toolCall",toolCallId:"string"==typeof e.toolCallId?e.toolCallId:"string"==typeof e.id?e.id:"",toolName:"string"==typeof e.toolName?e.toolName:"string"==typeof e.name?e.name:"",input:"object"!=typeof e.input||null===e.input||Array.isArray(e.input)?"object"!=typeof e.arguments||null===e.arguments||Array.isArray(e.arguments)?{}:e.arguments:e.input})??e);return{...e,content:s}}])},79839,e=>e.a(async(t,s)=>{try{var n=e.i(66592),i=e.i(9948),r=t([n]);async function a(){let e=await n.SessionManager.listAll(),t=new Map;for(let s of e)t.set(s.path,s.id);let s=o();return e.map(e=>(s.set(e.id,e.path),{path:e.path,id:e.id,cwd:e.cwd,name:e.name,created:e.created instanceof Date?e.created.toISOString():String(e.created),modified:e.modified instanceof Date?e.modified.toISOString():String(e.modified),messageCount:e.messageCount,firstMessage:e.firstMessage||"(no messages)",parentSessionId:e.parentSessionPath?t.get(e.parentSessionPath):void 0}))}function o(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function l(e){let t=o().get(e);return t||(await a(),o().get(e)??null)}[n]=r.then?(await r)():r,e.s(["buildSessionContext",0,function(e,t){let s,r,a,o=new Map;for(let t of e)o.set(t.id,t);let l=(0,n.buildSessionContext)(e,t,o);if(null===t||(t&&(s=o.get(t)),s||(s=e[e.length-1]),!s))return{messages:[],entryIds:[],thinkingLevel:l.thinkingLevel,model:l.model};let d=[],c=s;for(;c;)d.unshift(c),c=c.parentId?o.get(c.parentId):void 0;for(let e of d)"compaction"===e.type&&(r=e.id,a=e.firstKeptEntryId);let u=[];if(r){u.push(r);let e=d.findIndex(e=>e.id===r),t=a?d.findIndex((t,s)=>s<e&&t.id===a):-1,s=t>=0?t:e;for(let t=s;t<e;t++)"message"===d[t].type&&u.push(d[t].id);for(let t=e+1;t<d.length;t++)"message"===d[t].type&&u.push(d[t].id)}else for(let e of d)"message"===e.type&&u.push(e.id);return{messages:l.messages.map(e=>"compactionSummary"===e.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
2
+
3
+ ${e.summary??""}`,timestamp:e.timestamp}:(0,i.normalizeToolCalls)(e)),entryIds:u,thinkingLevel:l.thinkingLevel,model:l.model}},"cacheSessionPath",0,function(e,t){o().set(e,t)},"invalidateSessionPathCache",0,function(e){o().delete(e)},"listAllSessions",0,a,"resolveSessionPath",0,l]),s()}catch(e){s(e)}},!1),77845,e=>e.a(async(t,s)=>{try{var n=e.i(66592),i=e.i(79839),r=t([n,i]);[n,i]=r.then?(await r)():r;class l{inner;listeners;unsubscribe;idleTimer;onDestroyCallback;_alive;constructor(e){this.inner=e,this.listeners=[],this.unsubscribe=null,this.idleTimer=null,this.onDestroyCallback=null,this._alive=!0}get sessionId(){return this.inner.sessionId}get sessionFile(){return this.inner.sessionFile??""}isAlive(){return this._alive}start(){this.unsubscribe=this.inner.subscribe(e=>{for(let t of(this.resetIdleTimer(),this.listeners))t(e)}),this.resetIdleTimer()}resetIdleTimer(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>this.destroy(),6e5)}onEvent(e){return this.listeners.push(e),()=>{let t=this.listeners.indexOf(e);-1!==t&&this.listeners.splice(t,1)}}onDestroy(e){this.onDestroyCallback=e}async send(t){this.resetIdleTimer();let s=t.type;switch(s){case"prompt":{let e=t.images;return this.inner.prompt(t.message,e?.length?{images:e}:void 0).catch(()=>{}),null}case"abort":return await this.inner.abort(),null;case"get_state":{let e=this.inner.model,t=this.inner.getContextUsage();return{sessionId:this.inner.sessionId,sessionFile:this.inner.sessionFile??"",isStreaming:this.inner.isStreaming,isCompacting:this.inner.isCompacting,autoCompactionEnabled:this.inner.autoCompactionEnabled,autoRetryEnabled:this.inner.autoRetryEnabled,model:e?{id:e.id,provider:e.provider}:void 0,messageCount:0,pendingMessageCount:0,contextUsage:t?{percent:t.percent,contextWindow:t.contextWindow,tokens:t.tokens}:null,systemPrompt:this.inner.agent.state?.systemPrompt??"",thinkingLevel:this.inner.agent.state?.thinkingLevel??"off"}}case"set_model":{let{provider:e,modelId:s}=t,n=this.inner.modelRegistry.find(e,s);if(!n)throw Error(`Model not found: ${e}/${s}`);return await this.inner.setModel(n),{id:n.id,provider:n.provider}}case"fork":{let e,s=t.entryId,r=this.inner.sessionManager,a=this.inner.sessionFile;if(!r.isPersisted())return{cancelled:!0};if(!a)throw Error("Persisted session is missing a session file");let o=r.getEntry(s);if(!o)throw Error("Invalid entry ID for forking");let l=r.getSessionDir();if(o.parentId){let t=n.SessionManager.open(a,l).createBranchedSession(o.parentId);if(!t)throw Error("Failed to create forked session");e=t}else{let t=n.SessionManager.create(r.getCwd(),l);t.newSession({parentSession:a}),e=t.getSessionFile()}let d=n.SessionManager.open(e,l).getSessionId();return(0,i.cacheSessionPath)(d,e),this.destroy(),{cancelled:!1,newSessionId:d}}case"navigate_tree":return{cancelled:(await this.inner.navigateTree(t.targetId,{})).cancelled};case"set_thinking_level":{let e=t.level;return this.inner.setThinkingLevel(e),"xhigh"===e&&this.inner.model?.compat?.thinkingFormat==="deepseek"&&this.inner.agent?.state&&(this.inner.agent.state.thinkingLevel="xhigh"),null}case"compact":{let{findCutPoint:s,DEFAULT_COMPACTION_SETTINGS:n}=await e.A(86156),i=this.inner.sessionManager.getBranch(),r={...n,...this.inner.settingsManager.getCompactionSettings()},a=-1;for(let e=i.length-1;e>=0;e--)if("compaction"===i[e].type){a=e;break}let o=a+1,l=s(i,o,i.length,r.keepRecentTokens);if((l.isSplitTurn?l.turnStartIndex:l.firstKeptEntryIndex)<=o)throw Error("Conversation too short to compact");return await this.inner.compact(t.customInstructions)}case"set_auto_compaction":return this.inner.setAutoCompactionEnabled(t.enabled),null;case"steer":{let e=t.images;return await this.inner.steer(t.message,e?.length?e:void 0),null}case"follow_up":{let e=t.images;return await this.inner.followUp(t.message,e?.length?e:void 0),null}case"get_tools":{let e=this.inner.getAllTools(),t=new Set(this.inner.getActiveToolNames());return e.map(e=>({name:e.name,description:e.description,active:t.has(e.name)}))}case"set_tools":return this.inner.setActiveToolsByName(t.toolNames),null;case"abort_compaction":return this.inner.abortCompaction(),null;case"set_auto_retry":return this.inner.setAutoRetryEnabled(t.enabled),null;default:throw Error(`Unsupported command: ${s}`)}}destroy(){this._alive&&(this._alive=!1,this.idleTimer&&clearTimeout(this.idleTimer),this.unsubscribe?.(),this.onDestroyCallback?.())}}function a(){if(!globalThis.__piSessions){globalThis.__piSessions=new Map;let e=()=>globalThis.__piSessions?.forEach(e=>e.destroy());process.once("exit",e),process.once("SIGINT",e),process.once("SIGTERM",e)}return globalThis.__piSessions}async function o(t,s,r,o){let d=a(),c=(globalThis.__piStartLocks||(globalThis.__piStartLocks=new Map),globalThis.__piStartLocks),u=d.get(t);if(u?.isAlive())return{session:u,realSessionId:t};let p=c.get(t);if(p)return p;let h=(async()=>{let t,{SessionManager:a,getAgentDir:c}=await e.A(86156),u=c(),p=s?a.open(s,void 0):a.create(r,void 0);void 0!==o&&(t=0===o.length?[]:["read","bash","edit","write","grep","find","ls"]);let{session:h}=await (0,n.createAgentSession)({cwd:r,agentDir:u,sessionManager:p,...void 0!==t?{tools:t}:{}});o&&o.length>0&&h.setActiveToolsByName(o),o?.length===0&&(h.agent.state.systemPrompt="");let g=new l(h);g.start();let m=h.sessionId,f=h.sessionFile;return f&&(0,i.cacheSessionPath)(m,f),g.onDestroy(()=>d.delete(m)),d.set(m,g),{session:g,realSessionId:m}})().finally(()=>c.delete(t));return c.set(t,h),h}e.s(["getRpcSession",0,function(e){return a().get(e)},"startRpcSession",0,o]),s()}catch(e){s(e)}},!1),40784,e=>e.a(async(t,s)=>{try{var n=e.i(80630),i=e.i(22734),r=e.i(14747),a=e.i(66592),o=e.i(79839),l=e.i(77845),d=t([a,o,l]);async function c(e,{params:t}){let{id:s}=await t;try{let t,r,d=await (0,o.resolveSessionPath)(s);if(!d)return n.NextResponse.json({error:"Session not found"},{status:404});let c=a.SessionManager.open(d),u=c.getEntries(),p=c.getTree(),h=c.getLeafId(),g=(0,o.buildSessionContext)(u,h),m=c.getHeader(),f=m?.timestamp??new Date().toISOString();try{f=(0,i.statSync)(d).mtime.toISOString()}catch{}let y=await (0,o.listAllSessions)(),v=y.find(e=>e.id===s)?.parentSessionId,S=m?{path:d,id:m.id,cwd:m.cwd??"",name:c.getSessionName(),created:m.timestamp,modified:f,messageCount:g.messages.length,firstMessage:g.messages.find(e=>"user"===e.role)?(r=g.messages.find(e=>"user"===e.role).content,"string"==typeof r?r:(Array.isArray(r)?r.find(e=>"text"===e.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:v}:null;if(new URL(e.url).searchParams.has("includeState")){let e=(0,l.getRpcSession)(s);if(e?.isAlive()){let s=await e.send({type:"get_state"});t={running:!0,state:s}}else t={running:!1}}return n.NextResponse.json({sessionId:s,filePath:d,info:S,tree:p,leafId:h,context:g,...void 0!==t?{agentState:t}:{}})}catch(e){return n.NextResponse.json({error:String(e)},{status:500})}}async function u(e,{params:t}){let{id:s}=await t;try{let{name:t}=await e.json();if("string"!=typeof t)return n.NextResponse.json({error:"name is required"},{status:400});let i=await (0,o.resolveSessionPath)(s);if(!i)return n.NextResponse.json({error:"Session not found"},{status:404});return a.SessionManager.open(i).appendSessionInfo(t.trim()),n.NextResponse.json({ok:!0})}catch(e){return n.NextResponse.json({error:String(e)},{status:500})}}async function p(e,{params:t}){let{id:s}=await t;try{let e,t=await (0,o.resolveSessionPath)(s);if(!t)return n.NextResponse.json({error:"Session not found"},{status:404});let a=(0,i.readFileSync)(t,"utf8").split("\n")[0];try{let t=JSON.parse(a);"session"===t.type&&(e=t.parentSession)}catch{}let d=t.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let s of(0,i.readdirSync)(d).filter(e=>e.endsWith(".jsonl")&&(0,r.join)(d,e)!==t)){let n=(0,r.join)(d,s);try{let s=(0,i.readFileSync)(n,"utf8").split("\n"),r=JSON.parse(s[0]);"session"===r.type&&r.parentSession===t&&(r.parentSession=e,s[0]=JSON.stringify(r),(0,i.writeFileSync)(n,s.join("\n")))}catch{}}}catch{}return(0,l.getRpcSession)(s)?.destroy(),(0,i.unlinkSync)(t),(0,o.invalidateSessionPathCache)(s),n.NextResponse.json({ok:!0})}catch(e){return n.NextResponse.json({error:String(e)},{status:500})}}[a,o,l]=d.then?(await d)():d,e.s(["DELETE",0,p,"GET",0,c,"PATCH",0,u]),s()}catch(e){s(e)}},!1),60813,e=>e.a(async(t,s)=>{try{var n=e.i(14448),i=e.i(51795),r=e.i(89303),a=e.i(51349),o=e.i(1654),l=e.i(94945),d=e.i(90777),c=e.i(50854),u=e.i(93079),p=e.i(32946),h=e.i(4287),g=e.i(71538),m=e.i(8919),f=e.i(50325),y=e.i(37782),v=e.i(93695);e.i(58724);var S=e.i(86627),w=e.i(40784),x=t([w]);[w]=x.then?(await x)():x;let b=new n.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/route",pathname:"/api/sessions/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/sessions/[id]/route.ts",nextConfigOutput:"",userland:w,...{}}),{workAsyncStorage:C,workUnitAsyncStorage:T,serverHooks:E}=b;async function R(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),b.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/sessions/[id]/route";n=n.replace(/\/index$/,"")||"/";let r=await b.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!r)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:w,deploymentId:x,params:R,nextConfig:C,parsedUrl:T,isDraftMode:E,prerenderManifest:_,routerServerContext:A,isOnDemandRevalidate:I,revalidateOnlyGenerated:k,resolvedPathname:N,clientReferenceManifest:P,serverActionsManifest:j}=r,M=(0,d.normalizeAppPath)(n),O=!!(_.dynamicRoutes[M]||_.routes[N]),q=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,T,!1):t.end("This page could not be found"),null);if(O&&!E){let e=!!_.routes[N],t=_.dynamicRoutes[M];if(t&&!1===t.fallback&&!e){if(C.adapterPath)return await q();throw new v.NoFallbackError}}let D=null;!O||b.isDev||E||(D=N,D="/index"===D?"/":D);let U=!0===b.isDev||!O,F=O&&!U;j&&P&&(0,l.setManifestsSingleton)({page:n,clientReferenceManifest:P,serverActionsManifest:j});let H=e.method||"GET",L=(0,o.getTracer)(),$=L.getActiveScopeSpan(),B=!!(null==A?void 0:A.isWrappedByNextServer),K=!!(0,a.getRequestMeta)(e,"minimalMode"),G=(0,a.getRequestMeta)(e,"incrementalCache")||await b.getIncrementalCache(e,C,_,K);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let W={params:R,previewProps:_.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:G,cacheLifeProfiles:C.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,s,n,i)=>b.onRequestError(e,t,n,i,A)},sharedContext:{buildId:w,deploymentId:x}},z=new c.NodeNextRequest(e),J=new c.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t));try{let r,a=async e=>b.handle(V,W).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let s=L.getRootSpanAttributes();if(!s)return;if(s.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${s.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=s.get("next.route");if(i){let t=`${H} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t),r&&r!==e&&(r.setAttribute("http.route",i),r.updateName(t))}else e.updateName(`${H} ${n}`)}),l=async r=>{var o,l;let d=async({previousCacheEntry:i})=>{try{if(!K&&I&&k&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await a(r);e.fetchMetrics=W.renderOpts.fetchMetrics;let o=W.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=W.renderOpts.collectedTags;if(!O)return await (0,g.sendResponse)(z,J,n,W.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[y.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let s=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,i=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:S.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:s,expire:i}}}}catch(t){throw(null==i?void 0:i.isStale)&&await b.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:I})},!1,A),t}},c=await b.handleResponse({req:e,nextConfig:C,cacheKey:D,routeKind:i.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:k,responseGenerator:d,waitUntil:s.waitUntil,isMinimalMode:K});if(!O)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==S.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",I?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,m.fromNodeOutgoingHttpHeaders)(c.value.headers);return K&&O||u.delete(y.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,f.getCacheControlHeader)(c.cacheControl)),await (0,g.sendResponse)(z,J,new Response(c.value.body,{headers:u,status:c.value.status||200})),null};B&&$?await l($):(r=L.getActiveScopeSpan(),await L.withPropagatedContext(e.headers,()=>L.trace(p.BaseServerSpan.handleRequest,{spanName:`${H} ${n}`,kind:o.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},l),void 0,!B))}catch(t){if(t instanceof v.NoFallbackError||await b.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:I})},!1,A),O)throw t;return await (0,g.sendResponse)(z,J,new Response(null,{status:500})),null}}e.s(["handler",0,R,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:T})},"routeModule",0,b,"serverHooks",0,E,"workAsyncStorage",0,C,"workUnitAsyncStorage",0,T]),s()}catch(e){s(e)}},!1),86156,e=>{e.v(e=>Promise.resolve().then(()=>e(66592)))}];
4
+
5
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0dbav4v._.js.map