@seqyuan/annovibe 0.8.69 → 0.8.70

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 (238) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +10 -9
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/routes-manifest.json +6 -0
  8. package/.next/server/app/_global-error/page.js +3 -3
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  17. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  18. package/.next/server/app/_not-found/page.js +2 -2
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  27. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  28. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  29. package/.next/server/app/api/agent/[id]/route.js +1 -1
  30. package/.next/server/app/api/agent/new/route.js +1 -1
  31. package/.next/server/app/api/agent/runtime/route.js +1 -1
  32. package/.next/server/app/api/apps/[id]/[[...path]]/route.js +2 -2
  33. package/.next/server/app/api/apps/route.js +2 -2
  34. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  35. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  36. package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
  37. package/.next/server/app/api/auth/login/route.js +1 -1
  38. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  39. package/.next/server/app/api/auth/providers/route.js +1 -1
  40. package/.next/server/app/api/auth/status/route.js +1 -1
  41. package/.next/server/app/api/default-cwd/route.js +1 -1
  42. package/.next/server/app/api/files/[...path]/route.js +2 -2
  43. package/.next/server/app/api/harness/route.js +1 -1
  44. package/.next/server/app/api/home/route.js +1 -1
  45. package/.next/server/app/api/im/cancel/route.js +1 -1
  46. package/.next/server/app/api/im/gateway-status/route.js +1 -1
  47. package/.next/server/app/api/im/gateway-token/route.js +1 -1
  48. package/.next/server/app/api/im/project/route.js +2 -2
  49. package/.next/server/app/api/im/projects/route.js +2 -2
  50. package/.next/server/app/api/im/session-ids/route.js +1 -1
  51. package/.next/server/app/api/im/turn/route.js +2 -2
  52. package/.next/server/app/api/images/upload/route.js +1 -1
  53. package/.next/server/app/api/internal/runtime/route.js +1 -1
  54. package/.next/server/app/api/memory/dismiss/route.js +7 -0
  55. package/.next/server/app/api/memory/dismiss/route_client-reference-manifest.js +1 -0
  56. package/.next/server/app/api/memory/promote/route.js +4 -4
  57. package/.next/server/app/api/models/route.js +1 -1
  58. package/.next/server/app/api/models-config/discover/route.js +1 -1
  59. package/.next/server/app/api/models-config/route.js +1 -1
  60. package/.next/server/app/api/models-config/test/route.js +1 -1
  61. package/.next/server/app/api/plot-kernels/route.js +1 -1
  62. package/.next/server/app/api/plot-kernels/save/route.js +1 -1
  63. package/.next/server/app/api/plot-kernels/status/route.js +1 -1
  64. package/.next/server/app/api/plot-kernels/stop/route.js +1 -1
  65. package/.next/server/app/api/projects/browse/route.js +1 -1
  66. package/.next/server/app/api/projects/route.js +2 -2
  67. package/.next/server/app/api/search/route.js +1 -1
  68. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  69. package/.next/server/app/api/sessions/[id]/plan/route.js +1 -1
  70. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  71. package/.next/server/app/api/sessions/new/route.js +1 -1
  72. package/.next/server/app/api/sessions/route.js +1 -1
  73. package/.next/server/app/api/settings/route.js +1 -1
  74. package/.next/server/app/api/skills/install/route.js +2 -2
  75. package/.next/server/app/api/skills/route.js +2 -2
  76. package/.next/server/app/api/skills/search/route.js +1 -1
  77. package/.next/server/app/api/soul/route.js +1 -1
  78. package/.next/server/app/api/subagents/status/route.js +1 -1
  79. package/.next/server/app/api/version/route.js +1 -1
  80. package/.next/server/app/favicon.ico/route.js +1 -1
  81. package/.next/server/app/icon.svg/route.js +1 -1
  82. package/.next/server/app/index.html +1 -1
  83. package/.next/server/app/index.rsc +2 -2
  84. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  85. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  86. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  87. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  88. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  89. package/.next/server/app/login/page.js +2 -2
  90. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  91. package/.next/server/app/login.html +1 -1
  92. package/.next/server/app/login.rsc +1 -1
  93. package/.next/server/app/login.segments/_full.segment.rsc +1 -1
  94. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  95. package/.next/server/app/login.segments/_index.segment.rsc +1 -1
  96. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  97. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  98. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  99. package/.next/server/app/page.js +5 -5
  100. package/.next/server/app/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/smoke/page.js +2 -2
  102. package/.next/server/app/smoke/page_client-reference-manifest.js +1 -1
  103. package/.next/server/app/smoke.html +2 -2
  104. package/.next/server/app/smoke.rsc +2 -2
  105. package/.next/server/app/smoke.segments/_full.segment.rsc +2 -2
  106. package/.next/server/app/smoke.segments/_head.segment.rsc +1 -1
  107. package/.next/server/app/smoke.segments/_index.segment.rsc +1 -1
  108. package/.next/server/app/smoke.segments/_tree.segment.rsc +1 -1
  109. package/.next/server/app/smoke.segments/smoke/__PAGE__.segment.rsc +2 -2
  110. package/.next/server/app/smoke.segments/smoke.segment.rsc +1 -1
  111. package/.next/server/app-paths-manifest.json +10 -9
  112. package/.next/server/chunks/1494.js +3 -3
  113. package/.next/server/chunks/7601.js +6 -6
  114. package/.next/server/chunks/7890.js +1 -1
  115. package/.next/server/chunks/9093.js +3 -3
  116. package/.next/server/middleware-build-manifest.js +1 -1
  117. package/.next/server/pages/404.html +1 -1
  118. package/.next/server/pages/500.html +1 -1
  119. package/.next/server/server-reference-manifest.json +1 -1
  120. package/.next/static/chunks/{9901-a87c4e0037c62107.js → 9901-54dfe54ff40a31d4.js} +5 -5
  121. package/.next/static/chunks/app/_global-error/page-4d80c4980a021c05.js +1 -0
  122. package/.next/static/chunks/app/api/agent/[id]/events/route-4d80c4980a021c05.js +1 -0
  123. package/.next/static/chunks/app/api/agent/[id]/route-4d80c4980a021c05.js +1 -0
  124. package/.next/static/chunks/app/api/agent/new/route-4d80c4980a021c05.js +1 -0
  125. package/.next/static/chunks/app/api/agent/runtime/route-4d80c4980a021c05.js +1 -0
  126. package/.next/static/chunks/app/api/apps/[id]/[[...path]]/route-4d80c4980a021c05.js +1 -0
  127. package/.next/static/chunks/app/api/apps/route-4d80c4980a021c05.js +1 -0
  128. package/.next/static/chunks/app/api/auth/all-providers/route-4d80c4980a021c05.js +1 -0
  129. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-4d80c4980a021c05.js +1 -0
  130. package/.next/static/chunks/app/api/auth/login/[provider]/route-4d80c4980a021c05.js +1 -0
  131. package/.next/static/chunks/app/api/auth/login/route-4d80c4980a021c05.js +1 -0
  132. package/.next/static/chunks/app/api/auth/logout/[provider]/route-4d80c4980a021c05.js +1 -0
  133. package/.next/static/chunks/app/api/auth/providers/route-4d80c4980a021c05.js +1 -0
  134. package/.next/static/chunks/app/api/auth/status/route-4d80c4980a021c05.js +1 -0
  135. package/.next/static/chunks/app/api/default-cwd/route-4d80c4980a021c05.js +1 -0
  136. package/.next/static/chunks/app/api/files/[...path]/route-4d80c4980a021c05.js +1 -0
  137. package/.next/static/chunks/app/api/harness/route-4d80c4980a021c05.js +1 -0
  138. package/.next/static/chunks/app/api/home/route-4d80c4980a021c05.js +1 -0
  139. package/.next/static/chunks/app/api/im/cancel/route-4d80c4980a021c05.js +1 -0
  140. package/.next/static/chunks/app/api/im/gateway-status/route-4d80c4980a021c05.js +1 -0
  141. package/.next/static/chunks/app/api/im/gateway-token/route-4d80c4980a021c05.js +1 -0
  142. package/.next/static/chunks/app/api/im/project/route-4d80c4980a021c05.js +1 -0
  143. package/.next/static/chunks/app/api/im/projects/route-4d80c4980a021c05.js +1 -0
  144. package/.next/static/chunks/app/api/im/session-ids/route-4d80c4980a021c05.js +1 -0
  145. package/.next/static/chunks/app/api/im/turn/route-4d80c4980a021c05.js +1 -0
  146. package/.next/static/chunks/app/api/images/upload/route-4d80c4980a021c05.js +1 -0
  147. package/.next/static/chunks/app/api/internal/runtime/route-4d80c4980a021c05.js +1 -0
  148. package/.next/static/chunks/app/api/memory/dismiss/route-4d80c4980a021c05.js +1 -0
  149. package/.next/static/chunks/app/api/memory/promote/route-4d80c4980a021c05.js +1 -0
  150. package/.next/static/chunks/app/api/models/route-4d80c4980a021c05.js +1 -0
  151. package/.next/static/chunks/app/api/models-config/discover/route-4d80c4980a021c05.js +1 -0
  152. package/.next/static/chunks/app/api/models-config/route-4d80c4980a021c05.js +1 -0
  153. package/.next/static/chunks/app/api/models-config/test/route-4d80c4980a021c05.js +1 -0
  154. package/.next/static/chunks/app/api/plot-kernels/route-4d80c4980a021c05.js +1 -0
  155. package/.next/static/chunks/app/api/plot-kernels/save/route-4d80c4980a021c05.js +1 -0
  156. package/.next/static/chunks/app/api/plot-kernels/status/route-4d80c4980a021c05.js +1 -0
  157. package/.next/static/chunks/app/api/plot-kernels/stop/route-4d80c4980a021c05.js +1 -0
  158. package/.next/static/chunks/app/api/projects/browse/route-4d80c4980a021c05.js +1 -0
  159. package/.next/static/chunks/app/api/projects/route-4d80c4980a021c05.js +1 -0
  160. package/.next/static/chunks/app/api/search/route-4d80c4980a021c05.js +1 -0
  161. package/.next/static/chunks/app/api/sessions/[id]/context/route-4d80c4980a021c05.js +1 -0
  162. package/.next/static/chunks/app/api/sessions/[id]/plan/route-4d80c4980a021c05.js +1 -0
  163. package/.next/static/chunks/app/api/sessions/[id]/route-4d80c4980a021c05.js +1 -0
  164. package/.next/static/chunks/app/api/sessions/new/route-4d80c4980a021c05.js +1 -0
  165. package/.next/static/chunks/app/api/sessions/route-4d80c4980a021c05.js +1 -0
  166. package/.next/static/chunks/app/api/settings/route-4d80c4980a021c05.js +1 -0
  167. package/.next/static/chunks/app/api/skills/install/route-4d80c4980a021c05.js +1 -0
  168. package/.next/static/chunks/app/api/skills/route-4d80c4980a021c05.js +1 -0
  169. package/.next/static/chunks/app/api/skills/search/route-4d80c4980a021c05.js +1 -0
  170. package/.next/static/chunks/app/api/soul/route-4d80c4980a021c05.js +1 -0
  171. package/.next/static/chunks/app/api/subagents/status/route-4d80c4980a021c05.js +1 -0
  172. package/.next/static/chunks/app/api/version/route-4d80c4980a021c05.js +1 -0
  173. package/.next/static/chunks/app/favicon.ico/route-4d80c4980a021c05.js +1 -0
  174. package/.next/static/chunks/app/{page-9b0d820413a43b2f.js → page-a113a7a2f2a36013.js} +13 -13
  175. package/.next/static/chunks/next/dist/client/components/builtin/app-error-4d80c4980a021c05.js +1 -0
  176. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-4d80c4980a021c05.js +1 -0
  177. package/.next/static/chunks/next/dist/client/components/builtin/not-found-4d80c4980a021c05.js +1 -0
  178. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-4d80c4980a021c05.js +1 -0
  179. package/.next/static/fHPCy5VWfMn3HKqoTaWk-/_buildManifest.js +1 -0
  180. package/package.json +1 -1
  181. package/.next/static/chunks/app/_global-error/page-8bc0531916c80cbc.js +0 -1
  182. package/.next/static/chunks/app/api/agent/[id]/events/route-8bc0531916c80cbc.js +0 -1
  183. package/.next/static/chunks/app/api/agent/[id]/route-8bc0531916c80cbc.js +0 -1
  184. package/.next/static/chunks/app/api/agent/new/route-8bc0531916c80cbc.js +0 -1
  185. package/.next/static/chunks/app/api/agent/runtime/route-8bc0531916c80cbc.js +0 -1
  186. package/.next/static/chunks/app/api/apps/[id]/[[...path]]/route-8bc0531916c80cbc.js +0 -1
  187. package/.next/static/chunks/app/api/apps/route-8bc0531916c80cbc.js +0 -1
  188. package/.next/static/chunks/app/api/auth/all-providers/route-8bc0531916c80cbc.js +0 -1
  189. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-8bc0531916c80cbc.js +0 -1
  190. package/.next/static/chunks/app/api/auth/login/[provider]/route-8bc0531916c80cbc.js +0 -1
  191. package/.next/static/chunks/app/api/auth/login/route-8bc0531916c80cbc.js +0 -1
  192. package/.next/static/chunks/app/api/auth/logout/[provider]/route-8bc0531916c80cbc.js +0 -1
  193. package/.next/static/chunks/app/api/auth/providers/route-8bc0531916c80cbc.js +0 -1
  194. package/.next/static/chunks/app/api/auth/status/route-8bc0531916c80cbc.js +0 -1
  195. package/.next/static/chunks/app/api/default-cwd/route-8bc0531916c80cbc.js +0 -1
  196. package/.next/static/chunks/app/api/files/[...path]/route-8bc0531916c80cbc.js +0 -1
  197. package/.next/static/chunks/app/api/harness/route-8bc0531916c80cbc.js +0 -1
  198. package/.next/static/chunks/app/api/home/route-8bc0531916c80cbc.js +0 -1
  199. package/.next/static/chunks/app/api/im/cancel/route-8bc0531916c80cbc.js +0 -1
  200. package/.next/static/chunks/app/api/im/gateway-status/route-8bc0531916c80cbc.js +0 -1
  201. package/.next/static/chunks/app/api/im/gateway-token/route-8bc0531916c80cbc.js +0 -1
  202. package/.next/static/chunks/app/api/im/project/route-8bc0531916c80cbc.js +0 -1
  203. package/.next/static/chunks/app/api/im/projects/route-8bc0531916c80cbc.js +0 -1
  204. package/.next/static/chunks/app/api/im/session-ids/route-8bc0531916c80cbc.js +0 -1
  205. package/.next/static/chunks/app/api/im/turn/route-8bc0531916c80cbc.js +0 -1
  206. package/.next/static/chunks/app/api/images/upload/route-8bc0531916c80cbc.js +0 -1
  207. package/.next/static/chunks/app/api/internal/runtime/route-8bc0531916c80cbc.js +0 -1
  208. package/.next/static/chunks/app/api/memory/promote/route-8bc0531916c80cbc.js +0 -1
  209. package/.next/static/chunks/app/api/models/route-8bc0531916c80cbc.js +0 -1
  210. package/.next/static/chunks/app/api/models-config/discover/route-8bc0531916c80cbc.js +0 -1
  211. package/.next/static/chunks/app/api/models-config/route-8bc0531916c80cbc.js +0 -1
  212. package/.next/static/chunks/app/api/models-config/test/route-8bc0531916c80cbc.js +0 -1
  213. package/.next/static/chunks/app/api/plot-kernels/route-8bc0531916c80cbc.js +0 -1
  214. package/.next/static/chunks/app/api/plot-kernels/save/route-8bc0531916c80cbc.js +0 -1
  215. package/.next/static/chunks/app/api/plot-kernels/status/route-8bc0531916c80cbc.js +0 -1
  216. package/.next/static/chunks/app/api/plot-kernels/stop/route-8bc0531916c80cbc.js +0 -1
  217. package/.next/static/chunks/app/api/projects/browse/route-8bc0531916c80cbc.js +0 -1
  218. package/.next/static/chunks/app/api/projects/route-8bc0531916c80cbc.js +0 -1
  219. package/.next/static/chunks/app/api/search/route-8bc0531916c80cbc.js +0 -1
  220. package/.next/static/chunks/app/api/sessions/[id]/context/route-8bc0531916c80cbc.js +0 -1
  221. package/.next/static/chunks/app/api/sessions/[id]/plan/route-8bc0531916c80cbc.js +0 -1
  222. package/.next/static/chunks/app/api/sessions/[id]/route-8bc0531916c80cbc.js +0 -1
  223. package/.next/static/chunks/app/api/sessions/new/route-8bc0531916c80cbc.js +0 -1
  224. package/.next/static/chunks/app/api/sessions/route-8bc0531916c80cbc.js +0 -1
  225. package/.next/static/chunks/app/api/settings/route-8bc0531916c80cbc.js +0 -1
  226. package/.next/static/chunks/app/api/skills/install/route-8bc0531916c80cbc.js +0 -1
  227. package/.next/static/chunks/app/api/skills/route-8bc0531916c80cbc.js +0 -1
  228. package/.next/static/chunks/app/api/skills/search/route-8bc0531916c80cbc.js +0 -1
  229. package/.next/static/chunks/app/api/soul/route-8bc0531916c80cbc.js +0 -1
  230. package/.next/static/chunks/app/api/subagents/status/route-8bc0531916c80cbc.js +0 -1
  231. package/.next/static/chunks/app/api/version/route-8bc0531916c80cbc.js +0 -1
  232. package/.next/static/chunks/app/favicon.ico/route-8bc0531916c80cbc.js +0 -1
  233. package/.next/static/chunks/next/dist/client/components/builtin/app-error-8bc0531916c80cbc.js +0 -1
  234. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-8bc0531916c80cbc.js +0 -1
  235. package/.next/static/chunks/next/dist/client/components/builtin/not-found-8bc0531916c80cbc.js +0 -1
  236. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-8bc0531916c80cbc.js +0 -1
  237. package/.next/static/nFbDyer8nSnq4gO0cB2_z/_buildManifest.js +0 -1
  238. /package/.next/static/{nFbDyer8nSnq4gO0cB2_z → fHPCy5VWfMn3HKqoTaWk-}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- (()=>{var a={};a.id=64,a.ids=[64],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11460:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{H5:()=>x,Oz:()=>z,RD:()=>u,hF:()=>t,m3:()=>y,oB:()=>v,oE:()=>w});var e=c(29021),f=c(33873),g=c(40402),h=a([g]);g=(h.then?(await h)():h)[0];let A=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function i(){return(0,f.join)((0,g.$M)(),"annovibe-projects.json")}function j(a){return a.trim().replace(/[\\/]+$/,"")||a.trim()}function k(a){let b=j(a);return(0,f.basename)(b)||b||"No Project"}function l(){let a=i();try{let b=JSON.parse((0,e.readFileSync)(a,"utf8")),c={},d=b.projects&&"object"==typeof b.projects?b.projects:{};for(let[a,b]of Object.entries(d)){if(!b||"object"!=typeof b)continue;let d=j("string"==typeof b.cwd?b.cwd:a);d&&(c[d]={cwd:d,..."string"==typeof b.name?{name:b.name}:{},..."boolean"==typeof b.hidden?{hidden:b.hidden}:{},..."boolean"==typeof b.pinned?{pinned:b.pinned}:{},..."number"==typeof b.sortOrder&&Number.isFinite(b.sortOrder)?{sortOrder:b.sortOrder}:{},..."string"==typeof b.addedAt?{addedAt:b.addedAt}:{},..."string"==typeof b.lastAccessed?{lastAccessed:b.lastAccessed}:{}})}return{version:2,manualOrder:!0===b.manualOrder,projects:c}}catch{return{version:2,manualOrder:!1,projects:{}}}}function m(a){let b=i();(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0}),(0,e.writeFileSync)(b,JSON.stringify(a,null,2),"utf8")}function n(a){try{return(0,e.statSync)(a).isDirectory()}catch{return!1}}function o(a,b){let c=A.compare(a.displayName,b.displayName);return 0!==c?c:a.cwd.localeCompare(b.cwd)}function p(a,b,c){let d=!0===a.pinned,e=!0===b.pinned;if(d!==e)return d?-1:1;if(c){let c="number"==typeof a.sortOrder&&Number.isFinite(a.sortOrder)?a.sortOrder:null,d="number"==typeof b.sortOrder&&Number.isFinite(b.sortOrder)?b.sortOrder:null;if(null!==c&&null!==d&&c!==d)return c-d;if(null!==c)return -1;if(null!==d)return 1}return o({displayName:a.name?.trim()||k(a.cwd),cwd:a.cwd},{displayName:b.name?.trim()||k(b.cwd),cwd:b.cwd})}function q(a){let b=-1;for(let c of Object.values(a.projects))"number"==typeof c.sortOrder&&Number.isFinite(c.sortOrder)&&(b=Math.max(b,c.sortOrder));return b+1}function r(a,b){let c=j(b),d=new Date().toISOString(),e=a.projects[c],f={cwd:c,addedAt:e?.addedAt??d,lastAccessed:e?.lastAccessed??d,...e?.name?{name:e.name}:{},..."boolean"==typeof e?.hidden?{hidden:e.hidden}:{},..."boolean"==typeof e?.pinned?{pinned:e.pinned}:{},..."number"==typeof e?.sortOrder&&Number.isFinite(e.sortOrder)?{sortOrder:e.sortOrder}:{}};return a.projects[c]=f,f}function s(a,b){a.manualOrder=!0;let c=new Set,d=0;for(let e of b){let b=j(e);if(!b||c.has(b))continue;let f=r(a,b);f.hidden=!1,f.sortOrder=d++,c.add(b)}for(let b of Object.values(a.projects).filter(a=>!a.hidden&&!c.has(a.cwd)).sort((a,b)=>p(a,b,!0)))b.sortOrder=d++}async function t(a={}){let[b,c]=await Promise.all([(0,g.dQ)(),Promise.resolve(l())]),d=function(a){let b=new Map;for(let c of a){let a=j(c.cwd||"");if(!a)continue;let d=b.get(a)??{count:0,last:null,created:null};d.count+=1,(!d.last||c.modified>d.last)&&(d.last=c.modified),(!d.created||c.created<d.created)&&(d.created=c.created),b.set(a,d)}return b}(b),f=new Set([...d.keys(),...Object.keys(c.projects)]),h=[];for(let b of f){let f=c.projects[b];if(f?.hidden&&!a.includeHidden)continue;let g=d.get(b),i=g&&f?"both":g?"session":"manual",j=f?.lastAccessed&&(!g?.last||f.lastAccessed>g.last)?f.lastAccessed:g?.last??f?.lastAccessed??null;h.push({cwd:b,name:f?.name,displayName:f?.name?.trim()||k(b),chatCount:g?.count??0,lastAccessed:j,created:g?.created??f?.addedAt??null,hidden:f?.hidden,pinned:f?.pinned??!1,sortOrder:"number"==typeof f?.sortOrder&&Number.isFinite(f.sortOrder)?f.sortOrder:null,exists:!!(0,e.existsSync)(b)&&n(b),source:i})}return h.sort((a,b)=>{let d=!0===a.pinned,e=!0===b.pinned;if(d!==e)return d?-1:1;if(c.manualOrder){let c="number"==typeof a.sortOrder&&Number.isFinite(a.sortOrder)?a.sortOrder:null,d="number"==typeof b.sortOrder&&Number.isFinite(b.sortOrder)?b.sortOrder:null;if(null!==c&&null!==d&&c!==d)return c-d;if(null!==c)return -1;if(null!==d)return 1}return o(a,b)}),h}function u(a,b={}){let c=j(a);if(!c)throw Error("cwd is required");let d=l(),e=new Date().toISOString(),f=d.projects[c],g={cwd:c,addedAt:f?.addedAt??e,lastAccessed:e,...f?.name?{name:f.name}:{},...f?.pinned===!0?{pinned:!0}:{},..."number"==typeof f?.sortOrder&&Number.isFinite(f.sortOrder)?{sortOrder:f.sortOrder}:{},hidden:b.hidden??!1};if(d.manualOrder&&void 0===g.sortOrder&&!g.hidden&&(g.sortOrder=q(d)),void 0!==b.name){let a=b.name?.trim()??"";a&&(g.name=a)}return d.projects[c]=g,m(d),{cwd:c,name:g.name,displayName:g.name?.trim()||k(c),chatCount:0,lastAccessed:g.lastAccessed??null,created:g.addedAt??null,hidden:g.hidden,pinned:g.pinned??!1,sortOrder:"number"==typeof g.sortOrder&&Number.isFinite(g.sortOrder)?g.sortOrder:null,exists:n(c),source:"manual"}}function v(a,b){let c=j(a),d=b.trim();if(!c)throw Error("cwd is required");let e=l(),f=e.projects[c];e.projects[c]={cwd:c,addedAt:f?.addedAt??new Date().toISOString(),lastAccessed:new Date().toISOString(),...d?{name:d}:{},...f?.pinned===!0?{pinned:!0}:{},..."number"==typeof f?.sortOrder&&Number.isFinite(f.sortOrder)?{sortOrder:f.sortOrder}:{},hidden:f?.hidden??!1},m(e)}function w(a){let b=j(a);if(!b)throw Error("cwd is required");let c=l();delete c.projects[b],m(c)}function x(a){let b=j(a);if(!b)return;let c=l(),d=c.projects[b],e={cwd:b,addedAt:d?.addedAt??new Date().toISOString(),lastAccessed:new Date().toISOString(),...d?.name?{name:d.name}:{},...d?.pinned===!0?{pinned:!0}:{},..."number"==typeof d?.sortOrder&&Number.isFinite(d.sortOrder)?{sortOrder:d.sortOrder}:{},hidden:!1};c.manualOrder&&void 0===e.sortOrder&&(e.sortOrder=q(c)),c.projects[b]=e,m(c)}function y(a,b){let c=j(a);if(!c)throw Error("cwd is required");let d=l(),e=r(d,c);if(e.hidden=!1,e.lastAccessed=new Date().toISOString(),e.pinned=b,d.manualOrder){let a=Object.values(d.projects).filter(a=>!a.hidden).sort((a,b)=>p(a,b,!0)).map(a=>a.cwd).filter(a=>a!==c);if(b){let b=a.findIndex(a=>d.projects[a]?.pinned!==!0),e=-1===b?a.length:b;a.splice(e,0,c)}else{let b=a.findIndex(a=>d.projects[a]?.pinned!==!0),e=-1===b?a.length:b;a.splice(e,0,c)}s(d,a)}m(d)}function z(a){let b=l();s(b,a),m(b)}d()}catch(a){d(a)}})},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33034:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(84187),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/projects/route",pathname:"/api/projects",filename:"route",bundlePath:"app/api/projects/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/projects/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/projects/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
1
+ (()=>{var a={};a.id=64,a.ids=[64],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11460:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{H5:()=>x,Oz:()=>z,RD:()=>u,hF:()=>t,m3:()=>y,oB:()=>v,oE:()=>w});var e=c(29021),f=c(33873),g=c(40402),h=a([g]);g=(h.then?(await h)():h)[0];let A=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function i(){return(0,f.join)((0,g.$M)(),"annovibe-projects.json")}function j(a){return a.trim().replace(/[\\/]+$/,"")||a.trim()}function k(a){let b=j(a);return(0,f.basename)(b)||b||"No Project"}function l(){let a=i();try{let b=JSON.parse((0,e.readFileSync)(a,"utf8")),c={},d=b.projects&&"object"==typeof b.projects?b.projects:{};for(let[a,b]of Object.entries(d)){if(!b||"object"!=typeof b)continue;let d=j("string"==typeof b.cwd?b.cwd:a);d&&(c[d]={cwd:d,..."string"==typeof b.name?{name:b.name}:{},..."boolean"==typeof b.hidden?{hidden:b.hidden}:{},..."boolean"==typeof b.pinned?{pinned:b.pinned}:{},..."number"==typeof b.sortOrder&&Number.isFinite(b.sortOrder)?{sortOrder:b.sortOrder}:{},..."string"==typeof b.addedAt?{addedAt:b.addedAt}:{},..."string"==typeof b.lastAccessed?{lastAccessed:b.lastAccessed}:{}})}return{version:2,manualOrder:!0===b.manualOrder,projects:c}}catch{return{version:2,manualOrder:!1,projects:{}}}}function m(a){let b=i();(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0}),(0,e.writeFileSync)(b,JSON.stringify(a,null,2),"utf8")}function n(a){try{return(0,e.statSync)(a).isDirectory()}catch{return!1}}function o(a,b){let c=A.compare(a.displayName,b.displayName);return 0!==c?c:a.cwd.localeCompare(b.cwd)}function p(a,b,c){let d=!0===a.pinned,e=!0===b.pinned;if(d!==e)return d?-1:1;if(c){let c="number"==typeof a.sortOrder&&Number.isFinite(a.sortOrder)?a.sortOrder:null,d="number"==typeof b.sortOrder&&Number.isFinite(b.sortOrder)?b.sortOrder:null;if(null!==c&&null!==d&&c!==d)return c-d;if(null!==c)return -1;if(null!==d)return 1}return o({displayName:a.name?.trim()||k(a.cwd),cwd:a.cwd},{displayName:b.name?.trim()||k(b.cwd),cwd:b.cwd})}function q(a){let b=-1;for(let c of Object.values(a.projects))"number"==typeof c.sortOrder&&Number.isFinite(c.sortOrder)&&(b=Math.max(b,c.sortOrder));return b+1}function r(a,b){let c=j(b),d=new Date().toISOString(),e=a.projects[c],f={cwd:c,addedAt:e?.addedAt??d,lastAccessed:e?.lastAccessed??d,...e?.name?{name:e.name}:{},..."boolean"==typeof e?.hidden?{hidden:e.hidden}:{},..."boolean"==typeof e?.pinned?{pinned:e.pinned}:{},..."number"==typeof e?.sortOrder&&Number.isFinite(e.sortOrder)?{sortOrder:e.sortOrder}:{}};return a.projects[c]=f,f}function s(a,b){a.manualOrder=!0;let c=new Set,d=0;for(let e of b){let b=j(e);if(!b||c.has(b))continue;let f=r(a,b);f.hidden=!1,f.sortOrder=d++,c.add(b)}for(let b of Object.values(a.projects).filter(a=>!a.hidden&&!c.has(a.cwd)).sort((a,b)=>p(a,b,!0)))b.sortOrder=d++}async function t(a={}){let[b,c]=await Promise.all([(0,g.dQ)(),Promise.resolve(l())]),d=function(a){let b=new Map;for(let c of a){let a=j(c.cwd||"");if(!a)continue;let d=b.get(a)??{count:0,last:null,created:null};d.count+=1,(!d.last||c.modified>d.last)&&(d.last=c.modified),(!d.created||c.created<d.created)&&(d.created=c.created),b.set(a,d)}return b}(b),f=new Set([...d.keys(),...Object.keys(c.projects)]),h=[];for(let b of f){let f=c.projects[b];if(f?.hidden&&!a.includeHidden)continue;let g=d.get(b),i=g&&f?"both":g?"session":"manual",j=f?.lastAccessed&&(!g?.last||f.lastAccessed>g.last)?f.lastAccessed:g?.last??f?.lastAccessed??null;h.push({cwd:b,name:f?.name,displayName:f?.name?.trim()||k(b),chatCount:g?.count??0,lastAccessed:j,created:g?.created??f?.addedAt??null,hidden:f?.hidden,pinned:f?.pinned??!1,sortOrder:"number"==typeof f?.sortOrder&&Number.isFinite(f.sortOrder)?f.sortOrder:null,exists:!!(0,e.existsSync)(b)&&n(b),source:i})}return h.sort((a,b)=>{let d=!0===a.pinned,e=!0===b.pinned;if(d!==e)return d?-1:1;if(c.manualOrder){let c="number"==typeof a.sortOrder&&Number.isFinite(a.sortOrder)?a.sortOrder:null,d="number"==typeof b.sortOrder&&Number.isFinite(b.sortOrder)?b.sortOrder:null;if(null!==c&&null!==d&&c!==d)return c-d;if(null!==c)return -1;if(null!==d)return 1}return o(a,b)}),h}function u(a,b={}){let c=j(a);if(!c)throw Error("cwd is required");let d=l(),e=new Date().toISOString(),f=d.projects[c],g={cwd:c,addedAt:f?.addedAt??e,lastAccessed:e,...f?.name?{name:f.name}:{},...f?.pinned===!0?{pinned:!0}:{},..."number"==typeof f?.sortOrder&&Number.isFinite(f.sortOrder)?{sortOrder:f.sortOrder}:{},hidden:b.hidden??!1};if(d.manualOrder&&void 0===g.sortOrder&&!g.hidden&&(g.sortOrder=q(d)),void 0!==b.name){let a=b.name?.trim()??"";a&&(g.name=a)}return d.projects[c]=g,m(d),{cwd:c,name:g.name,displayName:g.name?.trim()||k(c),chatCount:0,lastAccessed:g.lastAccessed??null,created:g.addedAt??null,hidden:g.hidden,pinned:g.pinned??!1,sortOrder:"number"==typeof g.sortOrder&&Number.isFinite(g.sortOrder)?g.sortOrder:null,exists:n(c),source:"manual"}}function v(a,b){let c=j(a),d=b.trim();if(!c)throw Error("cwd is required");let e=l(),f=e.projects[c];e.projects[c]={cwd:c,addedAt:f?.addedAt??new Date().toISOString(),lastAccessed:new Date().toISOString(),...d?{name:d}:{},...f?.pinned===!0?{pinned:!0}:{},..."number"==typeof f?.sortOrder&&Number.isFinite(f.sortOrder)?{sortOrder:f.sortOrder}:{},hidden:f?.hidden??!1},m(e)}function w(a){let b=j(a);if(!b)throw Error("cwd is required");let c=l();delete c.projects[b],m(c)}function x(a){let b=j(a);if(!b)return;let c=l(),d=c.projects[b],e={cwd:b,addedAt:d?.addedAt??new Date().toISOString(),lastAccessed:new Date().toISOString(),...d?.name?{name:d.name}:{},...d?.pinned===!0?{pinned:!0}:{},..."number"==typeof d?.sortOrder&&Number.isFinite(d.sortOrder)?{sortOrder:d.sortOrder}:{},hidden:!1};c.manualOrder&&void 0===e.sortOrder&&(e.sortOrder=q(c)),c.projects[b]=e,m(c)}function y(a,b){let c=j(a);if(!c)throw Error("cwd is required");let d=l(),e=r(d,c);if(e.hidden=!1,e.lastAccessed=new Date().toISOString(),e.pinned=b,d.manualOrder){let a=Object.values(d.projects).filter(a=>!a.hidden).sort((a,b)=>p(a,b,!0)).map(a=>a.cwd).filter(a=>a!==c);if(b){let b=a.findIndex(a=>d.projects[a]?.pinned!==!0),e=-1===b?a.length:b;a.splice(e,0,c)}else{let b=a.findIndex(a=>d.projects[a]?.pinned!==!0),e=-1===b?a.length:b;a.splice(e,0,c)}s(d,a)}m(d)}function z(a){let b=l();s(b,a),m(b)}d()}catch(a){d(a)}})},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
2
2
 
3
- ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},84187:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>l,GET:()=>i,PATCH:()=>k,POST:()=>j});var e=c(23211),f=c(29021),g=c(11460),h=a([g]);async function i(){try{let a=await (0,g.hF)();return e.NextResponse.json({projects:a})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function j(a){try{let b=await a.json();if("string"!=typeof b.cwd||!b.cwd.trim())return e.NextResponse.json({error:"cwd is required"},{status:400});let c=b.cwd.trim();if(!0===b.create&&(0,f.mkdirSync)(c,{recursive:!0}),!function(a){try{return(0,f.statSync)(a).isDirectory()}catch{return!1}}(c))return e.NextResponse.json({error:"Project path must be an existing directory"},{status:400});let d=(0,g.RD)(c,{}),h=await (0,g.hF)();return e.NextResponse.json({ok:!0,project:d,projects:h})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function k(a){try{let b=await a.json();if(Array.isArray(b.order)){let a=b.order.filter(a=>"string"==typeof a&&a.trim().length>0);(0,g.Oz)(a);let c=await (0,g.hF)();return e.NextResponse.json({ok:!0,projects:c})}if("string"!=typeof b.cwd||!b.cwd.trim())return e.NextResponse.json({error:"cwd is required"},{status:400});if(!0===b.touch)(0,g.H5)(b.cwd);else if("string"==typeof b.name)(0,g.oB)(b.cwd,b.name);else{if("boolean"!=typeof b.pinned)return e.NextResponse.json({error:"No valid update fields provided"},{status:400});(0,g.m3)(b.cwd,b.pinned)}let c=await (0,g.hF)();return e.NextResponse.json({ok:!0,projects:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function l(a){try{let b=await a.json();if("string"!=typeof b.cwd||!b.cwd.trim())return e.NextResponse.json({error:"cwd is required"},{status:400});(0,g.oE)(b.cwd);let c=await (0,g.hF)();return e.NextResponse.json({ok:!0,projects:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=33034));module.exports=c})();
3
+ ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63384:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(84187),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/projects/route",pathname:"/api/projects",filename:"route",bundlePath:"app/api/projects/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/projects/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/projects/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},84187:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>l,GET:()=>i,PATCH:()=>k,POST:()=>j});var e=c(23211),f=c(29021),g=c(11460),h=a([g]);async function i(){try{let a=await (0,g.hF)();return e.NextResponse.json({projects:a})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function j(a){try{let b=await a.json();if("string"!=typeof b.cwd||!b.cwd.trim())return e.NextResponse.json({error:"cwd is required"},{status:400});let c=b.cwd.trim();if(!0===b.create&&(0,f.mkdirSync)(c,{recursive:!0}),!function(a){try{return(0,f.statSync)(a).isDirectory()}catch{return!1}}(c))return e.NextResponse.json({error:"Project path must be an existing directory"},{status:400});let d=(0,g.RD)(c,{}),h=await (0,g.hF)();return e.NextResponse.json({ok:!0,project:d,projects:h})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function k(a){try{let b=await a.json();if(Array.isArray(b.order)){let a=b.order.filter(a=>"string"==typeof a&&a.trim().length>0);(0,g.Oz)(a);let c=await (0,g.hF)();return e.NextResponse.json({ok:!0,projects:c})}if("string"!=typeof b.cwd||!b.cwd.trim())return e.NextResponse.json({error:"cwd is required"},{status:400});if(!0===b.touch)(0,g.H5)(b.cwd);else if("string"==typeof b.name)(0,g.oB)(b.cwd,b.name);else{if("boolean"!=typeof b.pinned)return e.NextResponse.json({error:"No valid update fields provided"},{status:400});(0,g.m3)(b.cwd,b.pinned)}let c=await (0,g.hF)();return e.NextResponse.json({ok:!0,projects:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function l(a){try{let b=await a.json();if("string"!=typeof b.cwd||!b.cwd.trim())return e.NextResponse.json({error:"cwd is required"},{status:400});(0,g.oE)(b.cwd);let c=await (0,g.hF)();return e.NextResponse.json({ok:!0,projects:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=63384));module.exports=c})();
@@ -1,3 +1,3 @@
1
1
  (()=>{var a={};a.id=6202,a.ids=[6202],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},13437:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j});var e=c(23211),f=c(40402),g=a([f]);function h(a){return a.replace(/\s+/g," ").trim()}function i(a){return!!a&&"object"==typeof a&&"text"===a.type&&"string"==typeof a.text}async function j(a){try{let b=new URL(a.url),c=h(b.searchParams.get("q")??""),d="current"===b.searchParams.get("scope")?"current":"all",g=b.searchParams.get("cwd");if(c.length<2)return e.NextResponse.json({results:[],totalMatches:0,truncated:!1});let j=(await (0,f.dQ)()).filter(a=>"current"!==d||!g||a.cwd===g).sort((a,b)=>b.modified.localeCompare(a.modified)),k=[],l=0,m=!1;for(let a of j){if(l>=80){m=!0;break}let b=[],d=0;try{for(let e of(0,f.DK)(a.path)){let a=function(a){if("message"!==a.type)return null;let{message:b}=a;if("user"!==b.role&&"assistant"!==b.role)return null;let c=b.content;if("string"==typeof c)return{role:b.role,text:h(c)};if(!Array.isArray(c))return null;let d=c.filter(i).map(a=>a.text).join(" ");return{role:b.role,text:h(d)}}(e);a?.text&&a.text.toLowerCase().includes(c.toLowerCase())&&(d+=1,b.length<8&&l<80?(b.push({entryId:e.id,role:a.role,timestamp:e.timestamp,snippet:function(a,b){let c=a.toLowerCase(),d=b.toLowerCase(),e=c.indexOf(d);if(e<0)return a.slice(0,180);let f=Math.max(0,e-70),g=Math.min(a.length,e+b.length+110),h=f>0?"... ":"",i=g<a.length?" ...":"";return`${h}${a.slice(f,g)}${i}`}(a.text,c)}),l+=1):m=!0)}}catch{continue}b.length>0&&k.push({session:a,matches:b,matchCount:d})}return e.NextResponse.json({results:k,totalMatches:l,truncated:m})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
2
2
 
3
- ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87410:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(13437),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/search/route",pathname:"/api/search",filename:"route",bundlePath:"app/api/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/search/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/search/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=87410));module.exports=c})();
3
+ ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68960:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(13437),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/search/route",pathname:"/api/search",filename:"route",bundlePath:"app/api/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/search/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/search/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=68960));module.exports=c})();
@@ -1,3 +1,3 @@
1
1
  (()=>{var a={};a.id=6709,a.ids=[6709],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6004:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j});var e=c(23211),f=c(75430),g=c(40402),h=c(11638),i=a([f,g]);async function j(a,{params:b}){let{id:c}=await b,d=new URL(a.url).searchParams.get("leafId")??void 0;try{let a=await (0,g.os)(c);if(!a)return e.NextResponse.json({error:"Session not found"},{status:404});let b=f.SessionManager.open(a),i=(0,g.Uv)(b.getEntries(),d);try{return e.NextResponse.json({context:i})}catch{let a=(0,h.z)({context:i});return new Response(a,{status:200,headers:{"Content-Type":"application/json"}})}}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[f,g]=i.then?(await i)():i,d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11638:(a,b,c)=>{"use strict";function d(a){let b='"';for(let c=0;c<a.length;c++){let d=a.charCodeAt(c);34===d?b+='\\"':92===d?b+="\\\\":8===d?b+="\\b":12===d?b+="\\f":10===d?b+="\\n":13===d?b+="\\r":9===d?b+="\\t":d<32?b+="\\u"+d.toString(16).padStart(4,"0"):b+=String.fromCharCode(d)}return b+'"'}function e(a){try{return JSON.stringify(a)}catch(b){if(b instanceof RangeError&&b.message.includes("Maximum call stack size exceeded"))return function(a){let b=[],c=[{t:"val",v:a}];for(;c.length>0;){let a=c.pop();switch(a.t){case"val":{let e=a.v;if(null==e)b.push("null");else if("boolean"==typeof e)b.push(e?"true":"false");else if("number"==typeof e)b.push(Number.isFinite(e)?String(e):"null");else if("string"==typeof e)b.push(d(e));else if(Array.isArray(e))if(0===e.length)b.push("[]");else{b.push("["),c.push({t:"close"});for(let a=e.length-1;a>=0;a--)a<e.length-1&&c.push({t:"sep"}),c.push({t:"val",v:e[a]})}else if("object"!=typeof e||null===e||Array.isArray(e))b.push("null");else{let a=Object.keys(e);if(0===a.length)b.push("{}");else{b.push("{"),c.push({t:"close"});for(let b=a.length-1;b>=0;b--)b<a.length-1&&c.push({t:"sep"}),c.push({t:"val",v:e[a[b]]}),c.push({t:"key",k:a[b]})}}break}case"sep":b.push(",");break;case"key":b.push(d(a.k)+":");break;case"close":{let a=0,c=!1;for(let d=b.length-1;d>=0;d--){let e=b[d];if("]"===e||"}"===e)a++;else if("["===e||"{"===e){if(0===a){b.push("["===e?"]":"}"),c=!0;break}a--}}c||b.push("}")}}}return b.join("")}(a);throw b}}c.d(b,{z:()=>e})},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
2
2
 
3
- ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},69424:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(6004),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/context/route",pathname:"/api/sessions/[id]/context",filename:"route",bundlePath:"app/api/sessions/[id]/context/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/[id]/context/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/context/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=69424));module.exports=c})();
3
+ ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76330:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(6004),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/context/route",pathname:"/api/sessions/[id]/context",filename:"route",bundlePath:"app/api/sessions/[id]/context/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/[id]/context/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/context/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=76330));module.exports=c})();
@@ -1,3 +1,3 @@
1
1
  (()=>{var a={};a.id=4721,a.ids=[4721],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},22660:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k});var e=c(23211),f=c(29021),g=c(33873),h=c(75430),i=c(40402),j=a([h,i]);async function k(a,{params:b}){let{id:c}=await b;try{let b=await a.json(),d=await (0,i.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});let j=h.SessionManager.open(d).getHeader(),k=j?.cwd;if(!k)return e.NextResponse.json({error:"Session cwd not found"},{status:400});let l=Array.isArray(b.tasks)?b.tasks.map(a=>(function(a){if("string"!=typeof a)return null;let b=a.replace(/\s+/g," ").trim();return b.length>0?b:null})(a?.step)).filter(a=>null!==a):[],m="string"==typeof b.planText?b.planText.trim():"",n=["# Annovibe Plan","","This plan was generated by the Annovibe AI agent.","It is read-only until the plan is approved for execution.","",m||l.map((a,b)=>`${b+1}. ${a}`).join("\n"),"","## Steps","",...l.map(a=>`- [ ] ${a}`),""].join("\n"),o=(0,g.join)(k,".annovibe-plan.md");return(0,f.writeFileSync)(o,n),e.NextResponse.json({ok:!0,path:o})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[h,i]=j.then?(await j)():j,d()}catch(a){d(a)}})},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
2
2
 
3
- ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},95316:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(22660),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/plan/route",pathname:"/api/sessions/[id]/plan",filename:"route",bundlePath:"app/api/sessions/[id]/plan/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/[id]/plan/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/plan/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=95316));module.exports=c})();
3
+ ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92918:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(22660),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/plan/route",pathname:"/api/sessions/[id]/plan",filename:"route",bundlePath:"app/api/sessions/[id]/plan/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/[id]/plan/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/plan/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=92918));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=6849,a.ids=[6849],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11638:(a,b,c)=>{function d(a){let b='"';for(let c=0;c<a.length;c++){let d=a.charCodeAt(c);34===d?b+='\\"':92===d?b+="\\\\":8===d?b+="\\b":12===d?b+="\\f":10===d?b+="\\n":13===d?b+="\\r":9===d?b+="\\t":d<32?b+="\\u"+d.toString(16).padStart(4,"0"):b+=String.fromCharCode(d)}return b+'"'}function e(a){try{return JSON.stringify(a)}catch(b){if(b instanceof RangeError&&b.message.includes("Maximum call stack size exceeded"))return function(a){let b=[],c=[{t:"val",v:a}];for(;c.length>0;){let a=c.pop();switch(a.t){case"val":{let e=a.v;if(null==e)b.push("null");else if("boolean"==typeof e)b.push(e?"true":"false");else if("number"==typeof e)b.push(Number.isFinite(e)?String(e):"null");else if("string"==typeof e)b.push(d(e));else if(Array.isArray(e))if(0===e.length)b.push("[]");else{b.push("["),c.push({t:"close"});for(let a=e.length-1;a>=0;a--)a<e.length-1&&c.push({t:"sep"}),c.push({t:"val",v:e[a]})}else if("object"!=typeof e||null===e||Array.isArray(e))b.push("null");else{let a=Object.keys(e);if(0===a.length)b.push("{}");else{b.push("{"),c.push({t:"close"});for(let b=a.length-1;b>=0;b--)b<a.length-1&&c.push({t:"sep"}),c.push({t:"val",v:e[a[b]]}),c.push({t:"key",k:a[b]})}}break}case"sep":b.push(",");break;case"key":b.push(d(a.k)+":");break;case"close":{let a=0,c=!1;for(let d=b.length-1;d>=0;d--){let e=b[d];if("]"===e||"}"===e)a++;else if("["===e||"{"===e){if(0===a){b.push("["===e?"]":"}"),c=!0;break}a--}}c||b.push("}")}}}return b.join("")}(a);throw b}}c.d(b,{z:()=>e})},11648:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(98192),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/route",pathname:"/api/sessions/[id]",filename:"route",bundlePath:"app/api/sessions/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/[id]/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},21820:a=>{a.exports=require("os")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},98192:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>p,GET:()=>n,PATCH:()=>o});var e=c(23211),f=c(11638),g=c(29021),h=c(33873),i=c(75430),j=c(40402),k=c(56429),l=c(74788),m=a([i,j,k,l]);async function n(a,{params:b}){let{id:c}=await b;try{let b,d,h,m=await (0,j.os)(c);if(!m)return e.NextResponse.json({error:"Session not found"},{status:404});let n=i.SessionManager.open(m),o=n.getEntries(),p=n.getTree(),q=n.getLeafId(),r=(0,j.Uv)(o,q),s=n.getHeader(),t=s?.timestamp??new Date().toISOString();try{t=(0,g.statSync)(m).mtime.toISOString()}catch{}let u=s?.cwd??"",v=!1;if(u)try{v=(0,g.statSync)(u).isDirectory()}catch{v=!1}let w=null;try{let a=(await (0,j.dQ)()).find(a=>a.id===c);d=a?.parentSessionId,w=a?.sessionMeta??null}catch{}w||(w=(0,l.U5)(c));let x=s?{path:m,id:s.id,cwd:u,cwdExists:v,name:n.getSessionName(),created:s.timestamp,modified:t,messageCount:r.messages.length,firstMessage:r.messages.find(a=>"user"===a.role)?(h=r.messages.find(a=>"user"===a.role).content,"string"==typeof h?h:(Array.isArray(h)?h.find(a=>"text"===a.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:d,sessionKind:w?.sessionKind,createdBy:w?.createdBy,sessionMeta:w}:null;if(new URL(a.url).searchParams.has("includeState")){let a=(0,k.A4)(c);if(a?.isAlive()){let c=await a.send({type:"get_state"});b={running:a.isBusy(),state:c}}else b={running:!1}}let y={sessionId:c,filePath:m,info:x,tree:p,leafId:q,context:r,sessionMeta:w,...void 0!==b?{agentState:b}:{}};try{return e.NextResponse.json(y)}catch(b){let a=(0,f.z)(y);return new Response(a,{status:200,headers:{"Content-Type":"application/json"}})}}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function o(a,{params:b}){let{id:c}=await b;try{let{name:b}=await a.json();if("string"!=typeof b)return e.NextResponse.json({error:"name is required"},{status:400});let d=await (0,j.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});return i.SessionManager.open(d).appendSessionInfo(b.trim()),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function p(a,{params:b}){let{id:c}=await b;try{let a,b=await (0,j.os)(c);if(!b)return e.NextResponse.json({error:"Session not found"},{status:404});let d=(0,g.readFileSync)(b,"utf8").split("\n")[0];try{let b=JSON.parse(d);"session"===b.type&&(a=b.parentSession)}catch{}let f=b.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let c of(0,g.readdirSync)(f).filter(a=>a.endsWith(".jsonl")&&(0,h.join)(f,a)!==b)){let d=(0,h.join)(f,c);try{let c=(0,g.readFileSync)(d,"utf8").split("\n"),e=JSON.parse(c[0]);"session"===e.type&&e.parentSession===b&&(e.parentSession=a,c[0]=JSON.stringify(e),(0,g.writeFileSync)(d,c.join("\n")))}catch{}}}catch{}return(0,k.A4)(c)?.destroy(),(0,g.unlinkSync)(b),(0,j.BR)(c),await (0,l.Of)(c),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[i,j,k,l]=m.then?(await m)():m,d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601],()=>b(b.s=11648));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=6849,a.ids=[6849],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11638:(a,b,c)=>{function d(a){let b='"';for(let c=0;c<a.length;c++){let d=a.charCodeAt(c);34===d?b+='\\"':92===d?b+="\\\\":8===d?b+="\\b":12===d?b+="\\f":10===d?b+="\\n":13===d?b+="\\r":9===d?b+="\\t":d<32?b+="\\u"+d.toString(16).padStart(4,"0"):b+=String.fromCharCode(d)}return b+'"'}function e(a){try{return JSON.stringify(a)}catch(b){if(b instanceof RangeError&&b.message.includes("Maximum call stack size exceeded"))return function(a){let b=[],c=[{t:"val",v:a}];for(;c.length>0;){let a=c.pop();switch(a.t){case"val":{let e=a.v;if(null==e)b.push("null");else if("boolean"==typeof e)b.push(e?"true":"false");else if("number"==typeof e)b.push(Number.isFinite(e)?String(e):"null");else if("string"==typeof e)b.push(d(e));else if(Array.isArray(e))if(0===e.length)b.push("[]");else{b.push("["),c.push({t:"close"});for(let a=e.length-1;a>=0;a--)a<e.length-1&&c.push({t:"sep"}),c.push({t:"val",v:e[a]})}else if("object"!=typeof e||null===e||Array.isArray(e))b.push("null");else{let a=Object.keys(e);if(0===a.length)b.push("{}");else{b.push("{"),c.push({t:"close"});for(let b=a.length-1;b>=0;b--)b<a.length-1&&c.push({t:"sep"}),c.push({t:"val",v:e[a[b]]}),c.push({t:"key",k:a[b]})}}break}case"sep":b.push(",");break;case"key":b.push(d(a.k)+":");break;case"close":{let a=0,c=!1;for(let d=b.length-1;d>=0;d--){let e=b[d];if("]"===e||"}"===e)a++;else if("["===e||"{"===e){if(0===a){b.push("["===e?"]":"}"),c=!0;break}a--}}c||b.push("}")}}}return b.join("")}(a);throw b}}c.d(b,{z:()=>e})},21820:a=>{a.exports=require("os")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},35706:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(98192),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/route",pathname:"/api/sessions/[id]",filename:"route",bundlePath:"app/api/sessions/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/[id]/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},98192:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>p,GET:()=>n,PATCH:()=>o});var e=c(23211),f=c(11638),g=c(29021),h=c(33873),i=c(75430),j=c(40402),k=c(56429),l=c(74788),m=a([i,j,k,l]);async function n(a,{params:b}){let{id:c}=await b;try{let b,d,h,m=await (0,j.os)(c);if(!m)return e.NextResponse.json({error:"Session not found"},{status:404});let n=i.SessionManager.open(m),o=n.getEntries(),p=n.getTree(),q=n.getLeafId(),r=(0,j.Uv)(o,q),s=n.getHeader(),t=s?.timestamp??new Date().toISOString();try{t=(0,g.statSync)(m).mtime.toISOString()}catch{}let u=s?.cwd??"",v=!1;if(u)try{v=(0,g.statSync)(u).isDirectory()}catch{v=!1}let w=null;try{let a=(await (0,j.dQ)()).find(a=>a.id===c);d=a?.parentSessionId,w=a?.sessionMeta??null}catch{}w||(w=(0,l.U5)(c));let x=s?{path:m,id:s.id,cwd:u,cwdExists:v,name:n.getSessionName(),created:s.timestamp,modified:t,messageCount:r.messages.length,firstMessage:r.messages.find(a=>"user"===a.role)?(h=r.messages.find(a=>"user"===a.role).content,"string"==typeof h?h:(Array.isArray(h)?h.find(a=>"text"===a.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:d,sessionKind:w?.sessionKind,createdBy:w?.createdBy,sessionMeta:w}:null;if(new URL(a.url).searchParams.has("includeState")){let a=(0,k.A4)(c);if(a?.isAlive()){let c=await a.send({type:"get_state"});b={running:a.isBusy(),state:c}}else b={running:!1}}let y={sessionId:c,filePath:m,info:x,tree:p,leafId:q,context:r,sessionMeta:w,...void 0!==b?{agentState:b}:{}};try{return e.NextResponse.json(y)}catch(b){let a=(0,f.z)(y);return new Response(a,{status:200,headers:{"Content-Type":"application/json"}})}}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function o(a,{params:b}){let{id:c}=await b;try{let{name:b}=await a.json();if("string"!=typeof b)return e.NextResponse.json({error:"name is required"},{status:400});let d=await (0,j.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});return i.SessionManager.open(d).appendSessionInfo(b.trim()),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function p(a,{params:b}){let{id:c}=await b;try{let a,b=await (0,j.os)(c);if(!b)return e.NextResponse.json({error:"Session not found"},{status:404});let d=(0,g.readFileSync)(b,"utf8").split("\n")[0];try{let b=JSON.parse(d);"session"===b.type&&(a=b.parentSession)}catch{}let f=b.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let c of(0,g.readdirSync)(f).filter(a=>a.endsWith(".jsonl")&&(0,h.join)(f,a)!==b)){let d=(0,h.join)(f,c);try{let c=(0,g.readFileSync)(d,"utf8").split("\n"),e=JSON.parse(c[0]);"session"===e.type&&e.parentSession===b&&(e.parentSession=a,c[0]=JSON.stringify(e),(0,g.writeFileSync)(d,c.join("\n")))}catch{}}}catch{}return(0,k.A4)(c)?.destroy(),(0,g.unlinkSync)(b),(0,j.BR)(c),await (0,l.Of)(c),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[i,j,k,l]=m.then?(await m)():m,d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601],()=>b(b.s=35706));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=222,a.ids=[222],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},94410:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>B,patchFetch:()=>A,routeModule:()=>w,serverHooks:()=>z,workAsyncStorage:()=>x,workUnitAsyncStorage:()=>y});var d={};c.r(d),c.d(d,{POST:()=>v});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527);async function v(){return new Response("Not used",{status:410})}let w=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/new/route",pathname:"/api/sessions/new",filename:"route",bundlePath:"app/api/sessions/new/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/new/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:x,workUnitAsyncStorage:y,serverHooks:z}=w;function A(){return(0,g.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:y})}async function B(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),w.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/new/route";"/index"===d&&(d="/");let e=await w.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||w.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===w.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await w.getIncrementalCache(a,x,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>w.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>w.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await w.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await w.handleResponse({req:a,nextConfig:x,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await w.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=94410));module.exports=c})();
1
+ (()=>{var a={};a.id=222,a.ids=[222],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},18088:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>B,patchFetch:()=>A,routeModule:()=>w,serverHooks:()=>z,workAsyncStorage:()=>x,workUnitAsyncStorage:()=>y});var d={};c.r(d),c.d(d,{POST:()=>v});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527);async function v(){return new Response("Not used",{status:410})}let w=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/new/route",pathname:"/api/sessions/new",filename:"route",bundlePath:"app/api/sessions/new/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/new/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:x,workUnitAsyncStorage:y,serverHooks:z}=w;function A(){return(0,g.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:y})}async function B(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),w.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/new/route";"/index"===d&&(d="/");let e=await w.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||w.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===w.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await w.getIncrementalCache(a,x,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>w.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>w.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await w.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await w.handleResponse({req:a,nextConfig:x,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await w.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=18088));module.exports=c})();
@@ -1,3 +1,3 @@
1
1
  (()=>{var a={};a.id=1097,a.ids=[1097],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},40228:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h});var e=c(23211),f=c(40402),g=a([f]);async function h(a){try{let b=await (0,f.dQ)(),c=a.nextUrl.searchParams.get("cwd");if(c)return e.NextResponse.json({sessions:b.filter(a=>a.cwd===decodeURIComponent(c))});return e.NextResponse.json({sessions:b})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
2
2
 
3
- ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75260:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(40228),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/route",pathname:"/api/sessions",filename:"route",bundlePath:"app/api/sessions/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=75260));module.exports=c})();
3
+ ${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},85022:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(40228),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/route",pathname:"/api/sessions",filename:"route",bundlePath:"app/api/sessions/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/sessions/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=85022));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=5177,a.ids=[5177],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},9774:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{cV:()=>k,p6:()=>l});var e=c(29021),f=c(33873),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let m={generativeUI:!0,plotIdleTimeoutMs:1728e5,saveFormat:"pdf",saveDpi:300,saveWidth:800,saveHeight:600};function i(){return(0,f.join)((0,g.getAgentDir)(),"annovibe-settings.json")}function j(a){if(!a||"object"!=typeof a)return{...m};let b="number"==typeof a.plotIdleTimeoutMs&&Number.isFinite(a.plotIdleTimeoutMs)&&a.plotIdleTimeoutMs>=0?Math.min(Math.round(a.plotIdleTimeoutMs),2592e6):m.plotIdleTimeoutMs;return{generativeUI:"boolean"==typeof a.generativeUI?a.generativeUI:m.generativeUI,plotIdleTimeoutMs:b,saveFormat:"png"===a.saveFormat||"svg"===a.saveFormat?a.saveFormat:"pdf",saveDpi:"number"==typeof a.saveDpi&&Number.isFinite(a.saveDpi)&&a.saveDpi>=72&&a.saveDpi<=1200?a.saveDpi:m.saveDpi,saveWidth:"number"==typeof a.saveWidth&&Number.isFinite(a.saveWidth)&&a.saveWidth>=100&&a.saveWidth<=8e3?a.saveWidth:m.saveWidth,saveHeight:"number"==typeof a.saveHeight&&Number.isFinite(a.saveHeight)&&a.saveHeight>=100&&a.saveHeight<=8e3?a.saveHeight:m.saveHeight}}function k(){let a=i(),b=(0,e.existsSync)(a)?a:(0,f.join)((0,g.getAgentDir)(),"pidex-settings.json");if(!(0,e.existsSync)(b))return{...m};try{return j(JSON.parse((0,e.readFileSync)(b,"utf8")))}catch{return{...m}}}function l(a){let b=j({...k(),...a}),c=i(),d=(0,f.dirname)(c);return(0,e.existsSync)(d)||(0,e.mkdirSync)(d,{recursive:!0}),(0,e.writeFileSync)(c,JSON.stringify(b,null,2),"utf8"),b}d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44364:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,PUT:()=>i,dynamic:()=>j});var e=c(23211),f=c(9774),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(){return e.NextResponse.json({settings:(0,f.cV)()})}async function i(a){try{let b=(await a.json()).settings;if(!b||"object"!=typeof b)return e.NextResponse.json({error:"Invalid settings data"},{status:400});let c=(0,f.p6)({..."boolean"==typeof b.generativeUI?{generativeUI:b.generativeUI}:{},..."number"==typeof b.plotIdleTimeoutMs?{plotIdleTimeoutMs:b.plotIdleTimeoutMs}:{},..."string"==typeof b.saveFormat?{saveFormat:b.saveFormat}:{},..."number"==typeof b.saveDpi?{saveDpi:b.saveDpi}:{},..."number"==typeof b.saveWidth?{saveWidth:b.saveWidth}:{},..."number"==typeof b.saveHeight?{saveHeight:b.saveHeight}:{}});return e.NextResponse.json({success:!0,settings:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94684:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(44364),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/settings/route",pathname:"/api/settings",filename:"route",bundlePath:"app/api/settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/settings/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/settings/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=94684));module.exports=c})();
1
+ (()=>{var a={};a.id=5177,a.ids=[5177],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},9774:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{cV:()=>k,p6:()=>l});var e=c(29021),f=c(33873),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let m={generativeUI:!0,plotIdleTimeoutMs:1728e5,saveFormat:"pdf",saveDpi:300,saveWidth:800,saveHeight:600};function i(){return(0,f.join)((0,g.getAgentDir)(),"annovibe-settings.json")}function j(a){if(!a||"object"!=typeof a)return{...m};let b="number"==typeof a.plotIdleTimeoutMs&&Number.isFinite(a.plotIdleTimeoutMs)&&a.plotIdleTimeoutMs>=0?Math.min(Math.round(a.plotIdleTimeoutMs),2592e6):m.plotIdleTimeoutMs;return{generativeUI:"boolean"==typeof a.generativeUI?a.generativeUI:m.generativeUI,plotIdleTimeoutMs:b,saveFormat:"png"===a.saveFormat||"svg"===a.saveFormat?a.saveFormat:"pdf",saveDpi:"number"==typeof a.saveDpi&&Number.isFinite(a.saveDpi)&&a.saveDpi>=72&&a.saveDpi<=1200?a.saveDpi:m.saveDpi,saveWidth:"number"==typeof a.saveWidth&&Number.isFinite(a.saveWidth)&&a.saveWidth>=100&&a.saveWidth<=8e3?a.saveWidth:m.saveWidth,saveHeight:"number"==typeof a.saveHeight&&Number.isFinite(a.saveHeight)&&a.saveHeight>=100&&a.saveHeight<=8e3?a.saveHeight:m.saveHeight}}function k(){let a=i(),b=(0,e.existsSync)(a)?a:(0,f.join)((0,g.getAgentDir)(),"pidex-settings.json");if(!(0,e.existsSync)(b))return{...m};try{return j(JSON.parse((0,e.readFileSync)(b,"utf8")))}catch{return{...m}}}function l(a){let b=j({...k(),...a}),c=i(),d=(0,f.dirname)(c);return(0,e.existsSync)(d)||(0,e.mkdirSync)(d,{recursive:!0}),(0,e.writeFileSync)(c,JSON.stringify(b,null,2),"utf8"),b}d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44364:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,PUT:()=>i,dynamic:()=>j});var e=c(23211),f=c(9774),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(){return e.NextResponse.json({settings:(0,f.cV)()})}async function i(a){try{let b=(await a.json()).settings;if(!b||"object"!=typeof b)return e.NextResponse.json({error:"Invalid settings data"},{status:400});let c=(0,f.p6)({..."boolean"==typeof b.generativeUI?{generativeUI:b.generativeUI}:{},..."number"==typeof b.plotIdleTimeoutMs?{plotIdleTimeoutMs:b.plotIdleTimeoutMs}:{},..."string"==typeof b.saveFormat?{saveFormat:b.saveFormat}:{},..."number"==typeof b.saveDpi?{saveDpi:b.saveDpi}:{},..."number"==typeof b.saveWidth?{saveWidth:b.saveWidth}:{},..."number"==typeof b.saveHeight?{saveHeight:b.saveHeight}:{}});return e.NextResponse.json({success:!0,settings:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50942:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(44364),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/settings/route",pathname:"/api/settings",filename:"route",bundlePath:"app/api/settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/settings/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/settings/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=50942));module.exports=c})();