@seqyuan/annovibe 0.8.62 → 0.8.63

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 (231) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +4 -3
  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 +8 -0
  8. package/.next/server/app/_global-error/page.js +2 -2
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_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 +1 -1
  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 +1 -1
  49. package/.next/server/app/api/im/projects/route.js +1 -1
  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/internal/runtime/route.js +1 -1
  53. package/.next/server/app/api/memory/promote/route.js +2 -2
  54. package/.next/server/app/api/models/route.js +1 -1
  55. package/.next/server/app/api/models-config/discover/route.js +1 -1
  56. package/.next/server/app/api/models-config/route.js +1 -1
  57. package/.next/server/app/api/models-config/test/route.js +1 -1
  58. package/.next/server/app/api/plot-kernels/route.js +1 -1
  59. package/.next/server/app/api/plot-kernels/save/route.js +1 -1
  60. package/.next/server/app/api/plot-kernels/status/route.js +1 -1
  61. package/.next/server/app/api/plot-kernels/stop/route.js +1 -1
  62. package/.next/server/app/api/projects/browse/route.js +1 -1
  63. package/.next/server/app/api/projects/route.js +2 -2
  64. package/.next/server/app/api/search/route.js +2 -2
  65. package/.next/server/app/api/sessions/[id]/context/route.js +2 -2
  66. package/.next/server/app/api/sessions/[id]/plan/route.js +3 -0
  67. package/.next/server/app/api/sessions/[id]/plan/route_client-reference-manifest.js +1 -0
  68. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  69. package/.next/server/app/api/sessions/new/route.js +1 -1
  70. package/.next/server/app/api/sessions/route.js +2 -2
  71. package/.next/server/app/api/settings/route.js +1 -1
  72. package/.next/server/app/api/skills/install/route.js +2 -2
  73. package/.next/server/app/api/skills/route.js +2 -2
  74. package/.next/server/app/api/skills/search/route.js +1 -1
  75. package/.next/server/app/api/soul/route.js +1 -1
  76. package/.next/server/app/api/subagents/status/route.js +1 -1
  77. package/.next/server/app/api/version/route.js +1 -1
  78. package/.next/server/app/favicon.ico/route.js +1 -1
  79. package/.next/server/app/icon.svg/route.js +1 -1
  80. package/.next/server/app/index.html +1 -1
  81. package/.next/server/app/index.rsc +2 -2
  82. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  83. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  84. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  85. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  86. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  87. package/.next/server/app/login/page.js +2 -2
  88. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  89. package/.next/server/app/login.html +1 -1
  90. package/.next/server/app/login.rsc +1 -1
  91. package/.next/server/app/login.segments/_full.segment.rsc +1 -1
  92. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  93. package/.next/server/app/login.segments/_index.segment.rsc +1 -1
  94. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  95. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  96. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  97. package/.next/server/app/page.js +10 -8
  98. package/.next/server/app/page_client-reference-manifest.js +1 -1
  99. package/.next/server/app/smoke/page.js +2 -2
  100. package/.next/server/app/smoke/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/smoke.html +1 -1
  102. package/.next/server/app/smoke.rsc +1 -1
  103. package/.next/server/app/smoke.segments/_full.segment.rsc +1 -1
  104. package/.next/server/app/smoke.segments/_head.segment.rsc +1 -1
  105. package/.next/server/app/smoke.segments/_index.segment.rsc +1 -1
  106. package/.next/server/app/smoke.segments/_tree.segment.rsc +1 -1
  107. package/.next/server/app/smoke.segments/smoke/__PAGE__.segment.rsc +1 -1
  108. package/.next/server/app/smoke.segments/smoke.segment.rsc +1 -1
  109. package/.next/server/app-paths-manifest.json +4 -3
  110. package/.next/server/chunks/1494.js +2 -2
  111. package/.next/server/middleware-build-manifest.js +1 -1
  112. package/.next/server/middleware.js +3 -3
  113. package/.next/server/next-font-manifest.js +1 -1
  114. package/.next/server/next-font-manifest.json +1 -1
  115. package/.next/server/pages/404.html +1 -1
  116. package/.next/server/pages/500.html +1 -1
  117. package/.next/server/server-reference-manifest.json +1 -1
  118. package/.next/static/chunks/app/_global-error/page-7e0d4554d6477b1e.js +1 -0
  119. package/.next/static/chunks/app/api/agent/[id]/events/route-7e0d4554d6477b1e.js +1 -0
  120. package/.next/static/chunks/app/api/agent/[id]/route-7e0d4554d6477b1e.js +1 -0
  121. package/.next/static/chunks/app/api/agent/new/route-7e0d4554d6477b1e.js +1 -0
  122. package/.next/static/chunks/app/api/agent/runtime/route-7e0d4554d6477b1e.js +1 -0
  123. package/.next/static/chunks/app/api/apps/[id]/[[...path]]/route-7e0d4554d6477b1e.js +1 -0
  124. package/.next/static/chunks/app/api/apps/route-7e0d4554d6477b1e.js +1 -0
  125. package/.next/static/chunks/app/api/auth/all-providers/route-7e0d4554d6477b1e.js +1 -0
  126. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-7e0d4554d6477b1e.js +1 -0
  127. package/.next/static/chunks/app/api/auth/login/[provider]/route-7e0d4554d6477b1e.js +1 -0
  128. package/.next/static/chunks/app/api/auth/login/route-7e0d4554d6477b1e.js +1 -0
  129. package/.next/static/chunks/app/api/auth/logout/[provider]/route-7e0d4554d6477b1e.js +1 -0
  130. package/.next/static/chunks/app/api/auth/providers/route-7e0d4554d6477b1e.js +1 -0
  131. package/.next/static/chunks/app/api/auth/status/route-7e0d4554d6477b1e.js +1 -0
  132. package/.next/static/chunks/app/api/default-cwd/route-7e0d4554d6477b1e.js +1 -0
  133. package/.next/static/chunks/app/api/files/[...path]/route-7e0d4554d6477b1e.js +1 -0
  134. package/.next/static/chunks/app/api/harness/route-7e0d4554d6477b1e.js +1 -0
  135. package/.next/static/chunks/app/api/home/route-7e0d4554d6477b1e.js +1 -0
  136. package/.next/static/chunks/app/api/im/cancel/route-7e0d4554d6477b1e.js +1 -0
  137. package/.next/static/chunks/app/api/im/gateway-status/route-7e0d4554d6477b1e.js +1 -0
  138. package/.next/static/chunks/app/api/im/gateway-token/route-7e0d4554d6477b1e.js +1 -0
  139. package/.next/static/chunks/app/api/im/project/route-7e0d4554d6477b1e.js +1 -0
  140. package/.next/static/chunks/app/api/im/projects/route-7e0d4554d6477b1e.js +1 -0
  141. package/.next/static/chunks/app/api/im/session-ids/route-7e0d4554d6477b1e.js +1 -0
  142. package/.next/static/chunks/app/api/im/turn/route-7e0d4554d6477b1e.js +1 -0
  143. package/.next/static/chunks/app/api/internal/runtime/route-7e0d4554d6477b1e.js +1 -0
  144. package/.next/static/chunks/app/api/memory/promote/route-7e0d4554d6477b1e.js +1 -0
  145. package/.next/static/chunks/app/api/models/route-7e0d4554d6477b1e.js +1 -0
  146. package/.next/static/chunks/app/api/models-config/discover/route-7e0d4554d6477b1e.js +1 -0
  147. package/.next/static/chunks/app/api/models-config/route-7e0d4554d6477b1e.js +1 -0
  148. package/.next/static/chunks/app/api/models-config/test/route-7e0d4554d6477b1e.js +1 -0
  149. package/.next/static/chunks/app/api/plot-kernels/route-7e0d4554d6477b1e.js +1 -0
  150. package/.next/static/chunks/app/api/plot-kernels/save/route-7e0d4554d6477b1e.js +1 -0
  151. package/.next/static/chunks/app/api/plot-kernels/status/route-7e0d4554d6477b1e.js +1 -0
  152. package/.next/static/chunks/app/api/plot-kernels/stop/route-7e0d4554d6477b1e.js +1 -0
  153. package/.next/static/chunks/app/api/projects/browse/route-7e0d4554d6477b1e.js +1 -0
  154. package/.next/static/chunks/app/api/projects/route-7e0d4554d6477b1e.js +1 -0
  155. package/.next/static/chunks/app/api/search/route-7e0d4554d6477b1e.js +1 -0
  156. package/.next/static/chunks/app/api/sessions/[id]/context/route-7e0d4554d6477b1e.js +1 -0
  157. package/.next/static/chunks/app/api/sessions/[id]/plan/route-7e0d4554d6477b1e.js +1 -0
  158. package/.next/static/chunks/app/api/sessions/[id]/route-7e0d4554d6477b1e.js +1 -0
  159. package/.next/static/chunks/app/api/sessions/new/route-7e0d4554d6477b1e.js +1 -0
  160. package/.next/static/chunks/app/api/sessions/route-7e0d4554d6477b1e.js +1 -0
  161. package/.next/static/chunks/app/api/settings/route-7e0d4554d6477b1e.js +1 -0
  162. package/.next/static/chunks/app/api/skills/install/route-7e0d4554d6477b1e.js +1 -0
  163. package/.next/static/chunks/app/api/skills/route-7e0d4554d6477b1e.js +1 -0
  164. package/.next/static/chunks/app/api/skills/search/route-7e0d4554d6477b1e.js +1 -0
  165. package/.next/static/chunks/app/api/soul/route-7e0d4554d6477b1e.js +1 -0
  166. package/.next/static/chunks/app/api/subagents/status/route-7e0d4554d6477b1e.js +1 -0
  167. package/.next/static/chunks/app/api/version/route-7e0d4554d6477b1e.js +1 -0
  168. package/.next/static/chunks/app/favicon.ico/route-7e0d4554d6477b1e.js +1 -0
  169. package/.next/static/chunks/app/page-f799e3f049a07f93.js +29 -0
  170. package/.next/static/chunks/next/dist/client/components/builtin/app-error-7e0d4554d6477b1e.js +1 -0
  171. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-7e0d4554d6477b1e.js +1 -0
  172. package/.next/static/chunks/next/dist/client/components/builtin/not-found-7e0d4554d6477b1e.js +1 -0
  173. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-7e0d4554d6477b1e.js +1 -0
  174. package/package.json +1 -1
  175. package/.next/static/chunks/app/_global-error/page-b23e767fd4cc8cb6.js +0 -1
  176. package/.next/static/chunks/app/api/agent/[id]/events/route-b23e767fd4cc8cb6.js +0 -1
  177. package/.next/static/chunks/app/api/agent/[id]/route-b23e767fd4cc8cb6.js +0 -1
  178. package/.next/static/chunks/app/api/agent/new/route-b23e767fd4cc8cb6.js +0 -1
  179. package/.next/static/chunks/app/api/agent/runtime/route-b23e767fd4cc8cb6.js +0 -1
  180. package/.next/static/chunks/app/api/apps/[id]/[[...path]]/route-b23e767fd4cc8cb6.js +0 -1
  181. package/.next/static/chunks/app/api/apps/route-b23e767fd4cc8cb6.js +0 -1
  182. package/.next/static/chunks/app/api/auth/all-providers/route-b23e767fd4cc8cb6.js +0 -1
  183. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-b23e767fd4cc8cb6.js +0 -1
  184. package/.next/static/chunks/app/api/auth/login/[provider]/route-b23e767fd4cc8cb6.js +0 -1
  185. package/.next/static/chunks/app/api/auth/login/route-b23e767fd4cc8cb6.js +0 -1
  186. package/.next/static/chunks/app/api/auth/logout/[provider]/route-b23e767fd4cc8cb6.js +0 -1
  187. package/.next/static/chunks/app/api/auth/providers/route-b23e767fd4cc8cb6.js +0 -1
  188. package/.next/static/chunks/app/api/auth/status/route-b23e767fd4cc8cb6.js +0 -1
  189. package/.next/static/chunks/app/api/default-cwd/route-b23e767fd4cc8cb6.js +0 -1
  190. package/.next/static/chunks/app/api/files/[...path]/route-b23e767fd4cc8cb6.js +0 -1
  191. package/.next/static/chunks/app/api/harness/route-b23e767fd4cc8cb6.js +0 -1
  192. package/.next/static/chunks/app/api/home/route-b23e767fd4cc8cb6.js +0 -1
  193. package/.next/static/chunks/app/api/im/cancel/route-b23e767fd4cc8cb6.js +0 -1
  194. package/.next/static/chunks/app/api/im/gateway-status/route-b23e767fd4cc8cb6.js +0 -1
  195. package/.next/static/chunks/app/api/im/gateway-token/route-b23e767fd4cc8cb6.js +0 -1
  196. package/.next/static/chunks/app/api/im/project/route-b23e767fd4cc8cb6.js +0 -1
  197. package/.next/static/chunks/app/api/im/projects/route-b23e767fd4cc8cb6.js +0 -1
  198. package/.next/static/chunks/app/api/im/session-ids/route-b23e767fd4cc8cb6.js +0 -1
  199. package/.next/static/chunks/app/api/im/turn/route-b23e767fd4cc8cb6.js +0 -1
  200. package/.next/static/chunks/app/api/internal/runtime/route-b23e767fd4cc8cb6.js +0 -1
  201. package/.next/static/chunks/app/api/memory/promote/route-b23e767fd4cc8cb6.js +0 -1
  202. package/.next/static/chunks/app/api/models/route-b23e767fd4cc8cb6.js +0 -1
  203. package/.next/static/chunks/app/api/models-config/discover/route-b23e767fd4cc8cb6.js +0 -1
  204. package/.next/static/chunks/app/api/models-config/route-b23e767fd4cc8cb6.js +0 -1
  205. package/.next/static/chunks/app/api/models-config/test/route-b23e767fd4cc8cb6.js +0 -1
  206. package/.next/static/chunks/app/api/plot-kernels/route-b23e767fd4cc8cb6.js +0 -1
  207. package/.next/static/chunks/app/api/plot-kernels/save/route-b23e767fd4cc8cb6.js +0 -1
  208. package/.next/static/chunks/app/api/plot-kernels/status/route-b23e767fd4cc8cb6.js +0 -1
  209. package/.next/static/chunks/app/api/plot-kernels/stop/route-b23e767fd4cc8cb6.js +0 -1
  210. package/.next/static/chunks/app/api/projects/browse/route-b23e767fd4cc8cb6.js +0 -1
  211. package/.next/static/chunks/app/api/projects/route-b23e767fd4cc8cb6.js +0 -1
  212. package/.next/static/chunks/app/api/search/route-b23e767fd4cc8cb6.js +0 -1
  213. package/.next/static/chunks/app/api/sessions/[id]/context/route-b23e767fd4cc8cb6.js +0 -1
  214. package/.next/static/chunks/app/api/sessions/[id]/route-b23e767fd4cc8cb6.js +0 -1
  215. package/.next/static/chunks/app/api/sessions/new/route-b23e767fd4cc8cb6.js +0 -1
  216. package/.next/static/chunks/app/api/sessions/route-b23e767fd4cc8cb6.js +0 -1
  217. package/.next/static/chunks/app/api/settings/route-b23e767fd4cc8cb6.js +0 -1
  218. package/.next/static/chunks/app/api/skills/install/route-b23e767fd4cc8cb6.js +0 -1
  219. package/.next/static/chunks/app/api/skills/route-b23e767fd4cc8cb6.js +0 -1
  220. package/.next/static/chunks/app/api/skills/search/route-b23e767fd4cc8cb6.js +0 -1
  221. package/.next/static/chunks/app/api/soul/route-b23e767fd4cc8cb6.js +0 -1
  222. package/.next/static/chunks/app/api/subagents/status/route-b23e767fd4cc8cb6.js +0 -1
  223. package/.next/static/chunks/app/api/version/route-b23e767fd4cc8cb6.js +0 -1
  224. package/.next/static/chunks/app/favicon.ico/route-b23e767fd4cc8cb6.js +0 -1
  225. package/.next/static/chunks/app/page-c7a9a60fdde6514a.js +0 -27
  226. package/.next/static/chunks/next/dist/client/components/builtin/app-error-b23e767fd4cc8cb6.js +0 -1
  227. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-b23e767fd4cc8cb6.js +0 -1
  228. package/.next/static/chunks/next/dist/client/components/builtin/not-found-b23e767fd4cc8cb6.js +0 -1
  229. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-b23e767fd4cc8cb6.js +0 -1
  230. /package/.next/static/{xDKR0US1cCdxIsgo1n350 → r_6uwH0al9bu9SYHLxIf_}/_buildManifest.js +0 -0
  231. /package/.next/static/{xDKR0US1cCdxIsgo1n350 → r_6uwH0al9bu9SYHLxIf_}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
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:()=>i});var e=c(23211),f=c(75430),g=c(40402),h=a([f,g]);async function i(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),h=(0,g.Uv)(b.getEntries(),d);return e.NextResponse.json({context:h})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[f,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},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})},23615:(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)}})},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:*
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:()=>i});var e=c(23211),f=c(75430),g=c(40402),h=a([f,g]);async function i(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),h=(0,g.Uv)(b.getEntries(),d);return e.NextResponse.json({context:h})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[f,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},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")},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;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,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=23615));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;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,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)}})},74890:(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)}})},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=74890));module.exports=c})();
@@ -0,0 +1,3 @@
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
+
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)}})},44006:(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)}})},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;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,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=44006));module.exports=c})();
@@ -0,0 +1 @@
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/sessions/[id]/plan/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/home/runner/work/annovibe/annovibe/app/api/sessions/[id]/plan/route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
@@ -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")},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")},63151:(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)}})},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:()=>o,GET:()=>m,PATCH:()=>n});var e=c(23211),f=c(29021),g=c(33873),h=c(75430),i=c(40402),j=c(56429),k=c(74788),l=a([h,i,j,k]);async function m(a,{params:b}){let{id:c}=await b;try{let b,d,g,l=await (0,i.os)(c);if(!l)return e.NextResponse.json({error:"Session not found"},{status:404});let m=h.SessionManager.open(l),n=m.getEntries(),o=m.getTree(),p=m.getLeafId(),q=(0,i.Uv)(n,p),r=m.getHeader(),s=r?.timestamp??new Date().toISOString();try{s=(0,f.statSync)(l).mtime.toISOString()}catch{}let t=r?.cwd??"",u=!1;if(t)try{u=(0,f.statSync)(t).isDirectory()}catch{u=!1}let v=null;try{let a=(await (0,i.dQ)()).find(a=>a.id===c);d=a?.parentSessionId,v=a?.sessionMeta??null}catch{}v||(v=(0,k.U5)(c));let w=r?{path:l,id:r.id,cwd:t,cwdExists:u,name:m.getSessionName(),created:r.timestamp,modified:s,messageCount:q.messages.length,firstMessage:q.messages.find(a=>"user"===a.role)?(g=q.messages.find(a=>"user"===a.role).content,"string"==typeof g?g:(Array.isArray(g)?g.find(a=>"text"===a.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:d,sessionKind:v?.sessionKind,createdBy:v?.createdBy,sessionMeta:v}:null;if(new URL(a.url).searchParams.has("includeState")){let a=(0,j.A4)(c);if(a?.isAlive()){let c=await a.send({type:"get_state"});b={running:a.isBusy(),state:c}}else b={running:!1}}return e.NextResponse.json({sessionId:c,filePath:l,info:w,tree:o,leafId:p,context:q,sessionMeta:v,...void 0!==b?{agentState:b}:{}})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function n(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,i.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});return h.SessionManager.open(d).appendSessionInfo(b.trim()),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function o(a,{params:b}){let{id:c}=await b;try{let a,b=await (0,i.os)(c);if(!b)return e.NextResponse.json({error:"Session not found"},{status:404});let d=(0,f.readFileSync)(b,"utf8").split("\n")[0];try{let b=JSON.parse(d);"session"===b.type&&(a=b.parentSession)}catch{}let h=b.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let c of(0,f.readdirSync)(h).filter(a=>a.endsWith(".jsonl")&&(0,g.join)(h,a)!==b)){let d=(0,g.join)(h,c);try{let c=(0,f.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,f.writeFileSync)(d,c.join("\n")))}catch{}}}catch{}return(0,j.A4)(c)?.destroy(),(0,f.unlinkSync)(b),(0,i.BR)(c),await (0,k.Of)(c),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[h,i,j,k]=l.then?(await l)():l,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=63151));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")},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")},41434:(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:()=>o,GET:()=>m,PATCH:()=>n});var e=c(23211),f=c(29021),g=c(33873),h=c(75430),i=c(40402),j=c(56429),k=c(74788),l=a([h,i,j,k]);async function m(a,{params:b}){let{id:c}=await b;try{let b,d,g,l=await (0,i.os)(c);if(!l)return e.NextResponse.json({error:"Session not found"},{status:404});let m=h.SessionManager.open(l),n=m.getEntries(),o=m.getTree(),p=m.getLeafId(),q=(0,i.Uv)(n,p),r=m.getHeader(),s=r?.timestamp??new Date().toISOString();try{s=(0,f.statSync)(l).mtime.toISOString()}catch{}let t=r?.cwd??"",u=!1;if(t)try{u=(0,f.statSync)(t).isDirectory()}catch{u=!1}let v=null;try{let a=(await (0,i.dQ)()).find(a=>a.id===c);d=a?.parentSessionId,v=a?.sessionMeta??null}catch{}v||(v=(0,k.U5)(c));let w=r?{path:l,id:r.id,cwd:t,cwdExists:u,name:m.getSessionName(),created:r.timestamp,modified:s,messageCount:q.messages.length,firstMessage:q.messages.find(a=>"user"===a.role)?(g=q.messages.find(a=>"user"===a.role).content,"string"==typeof g?g:(Array.isArray(g)?g.find(a=>"text"===a.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:d,sessionKind:v?.sessionKind,createdBy:v?.createdBy,sessionMeta:v}:null;if(new URL(a.url).searchParams.has("includeState")){let a=(0,j.A4)(c);if(a?.isAlive()){let c=await a.send({type:"get_state"});b={running:a.isBusy(),state:c}}else b={running:!1}}return e.NextResponse.json({sessionId:c,filePath:l,info:w,tree:o,leafId:p,context:q,sessionMeta:v,...void 0!==b?{agentState:b}:{}})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function n(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,i.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});return h.SessionManager.open(d).appendSessionInfo(b.trim()),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function o(a,{params:b}){let{id:c}=await b;try{let a,b=await (0,i.os)(c);if(!b)return e.NextResponse.json({error:"Session not found"},{status:404});let d=(0,f.readFileSync)(b,"utf8").split("\n")[0];try{let b=JSON.parse(d);"session"===b.type&&(a=b.parentSession)}catch{}let h=b.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let c of(0,f.readdirSync)(h).filter(a=>a.endsWith(".jsonl")&&(0,g.join)(h,a)!==b)){let d=(0,g.join)(h,c);try{let c=(0,f.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,f.writeFileSync)(d,c.join("\n")))}catch{}}}catch{}return(0,j.A4)(c)?.destroy(),(0,f.unlinkSync)(b),(0,i.BR)(c),await (0,k.Of)(c),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[h,i,j,k]=l.then?(await l)():l,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=41434));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")},12151:(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=12151));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")},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")},57886:(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}}},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=57886));module.exports=c})();
@@ -1,3 +1,3 @@
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")},35395:(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)}})},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:*
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")},38446:(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)}})},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;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,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=35395));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;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,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=38446));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")},17091:(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)}})},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")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=17091));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")},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:()=>{},85934:(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)}})},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=85934));module.exports=c})();
@@ -1,5 +1,5 @@
1
- (()=>{var a={};a.id=7812,a.ids=[7812],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")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67426:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>L,patchFetch:()=>K,routeModule:()=>G,serverHooks:()=>J,workAsyncStorage:()=>H,workUnitAsyncStorage:()=>I});var d={};c.r(d),c.d(d,{POST:()=>F,dynamic:()=>x,runtime:()=>y});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(23211),w=c(84107);let x="force-dynamic",y="nodejs",z=/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*(?:\x07|\x1B\\))/g,A=[{key:"source",stage:"Source resolved",regex:/Source:\s*([^\n]+)/,line:a=>`Source: ${a[1].trim()}`},{key:"fetch",stage:"Fetching skills",regex:/Fetching skills/,line:"Fetching skills"},{key:"clone",stage:"Cloning repository",regex:/Cloning repository/,line:"Cloning repository"},{key:"cloned",stage:"Repository cloned",regex:/Repository cloned/,line:"Repository cloned"},{key:"discover",stage:"Discovering skills",regex:/Discovering skills/,line:"Discovering skills"},{key:"found",stage:"Skills discovered",regex:/(Found\s+\d+\s+skills?)/,line:a=>a[1]},{key:"selected",stage:"Skill selected",regex:/(Selected\s+\d+\s+skills?:?\s*[^\n]*)/,line:a=>a[1]},{key:"summary",stage:"Preparing install",regex:/Installation Summary/,line:"Preparing install"},{key:"risk",stage:"Checking risk report",regex:/Security Risk Assessments/,line:"Checking risk report"},{key:"complete",stage:"Installation complete",regex:/Installation complete/,line:"Installation complete"},{key:"installed",stage:"Installed",regex:/(Installed\s+\d+\s+skills?)/,line:a=>a[1]},{key:"done",stage:"Done",regex:/Done!/,line:"Done"},{key:"clone-failed",stage:"Clone failed",regex:/Failed to clone repository/,line:"Failed to clone repository"},{key:"failed",stage:"Installation failed",regex:/Installation failed|Failed to install/,line:"Installation failed"}];function B(a){return a.replace(z,"").replace(/\r/g,"\n").split("\n").map(a=>a.replace(/\s+/g," ").trim()).filter(Boolean).filter((a,b,c)=>0===b||a!==c[b-1]).join("\n")}function C(a){return a.split("\n").slice(-20).join("\n")}function D(a){return/Installation complete|Installed \d+ skill/.test(a)}function E(a){if(null===a.exitCode&&null===a.signalCode){try{"win32"!==process.platform&&a.pid?process.kill(-a.pid,"SIGTERM"):a.kill("SIGTERM")}catch{a.kill("SIGTERM")}setTimeout(()=>{if(null===a.exitCode&&null===a.signalCode)try{"win32"!==process.platform&&a.pid?process.kill(-a.pid,"SIGKILL"):a.kill("SIGKILL")}catch{}},5e3).unref()}}async function F(a){try{let{package:c,scope:d,cwd:e,stream:f}=await a.json();if(!c?.trim())return v.NextResponse.json({error:"package required"},{status:400});let g="project"!==d,h=["--yes","skills","add",c.trim(),"-y","--agent","pi"];if(g&&h.push("-g"),console.log(`[skills/install] running: npx ${h.join(" ")}`),f){var b;let c,d;return b=!g&&e?e:void 0,c=new TextEncoder,d=null,new Response(new ReadableStream({start(e){let f="",g=!1,i=new Set,j=a=>{e.enqueue(c.encode(`${JSON.stringify(a)}
1
+ (()=>{var a={};a.id=7812,a.ids=[7812],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")},18821:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>L,patchFetch:()=>K,routeModule:()=>G,serverHooks:()=>J,workAsyncStorage:()=>H,workUnitAsyncStorage:()=>I});var d={};c.r(d),c.d(d,{POST:()=>F,dynamic:()=>x,runtime:()=>y});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(23211),w=c(84107);let x="force-dynamic",y="nodejs",z=/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*(?:\x07|\x1B\\))/g,A=[{key:"source",stage:"Source resolved",regex:/Source:\s*([^\n]+)/,line:a=>`Source: ${a[1].trim()}`},{key:"fetch",stage:"Fetching skills",regex:/Fetching skills/,line:"Fetching skills"},{key:"clone",stage:"Cloning repository",regex:/Cloning repository/,line:"Cloning repository"},{key:"cloned",stage:"Repository cloned",regex:/Repository cloned/,line:"Repository cloned"},{key:"discover",stage:"Discovering skills",regex:/Discovering skills/,line:"Discovering skills"},{key:"found",stage:"Skills discovered",regex:/(Found\s+\d+\s+skills?)/,line:a=>a[1]},{key:"selected",stage:"Skill selected",regex:/(Selected\s+\d+\s+skills?:?\s*[^\n]*)/,line:a=>a[1]},{key:"summary",stage:"Preparing install",regex:/Installation Summary/,line:"Preparing install"},{key:"risk",stage:"Checking risk report",regex:/Security Risk Assessments/,line:"Checking risk report"},{key:"complete",stage:"Installation complete",regex:/Installation complete/,line:"Installation complete"},{key:"installed",stage:"Installed",regex:/(Installed\s+\d+\s+skills?)/,line:a=>a[1]},{key:"done",stage:"Done",regex:/Done!/,line:"Done"},{key:"clone-failed",stage:"Clone failed",regex:/Failed to clone repository/,line:"Failed to clone repository"},{key:"failed",stage:"Installation failed",regex:/Installation failed|Failed to install/,line:"Installation failed"}];function B(a){return a.replace(z,"").replace(/\r/g,"\n").split("\n").map(a=>a.replace(/\s+/g," ").trim()).filter(Boolean).filter((a,b,c)=>0===b||a!==c[b-1]).join("\n")}function C(a){return a.split("\n").slice(-20).join("\n")}function D(a){return/Installation complete|Installed \d+ skill/.test(a)}function E(a){if(null===a.exitCode&&null===a.signalCode){try{"win32"!==process.platform&&a.pid?process.kill(-a.pid,"SIGTERM"):a.kill("SIGTERM")}catch{a.kill("SIGTERM")}setTimeout(()=>{if(null===a.exitCode&&null===a.signalCode)try{"win32"!==process.platform&&a.pid?process.kill(-a.pid,"SIGKILL"):a.kill("SIGKILL")}catch{}},5e3).unref()}}async function F(a){try{let{package:c,scope:d,cwd:e,stream:f}=await a.json();if(!c?.trim())return v.NextResponse.json({error:"package required"},{status:400});let g="project"!==d,h=["--yes","skills","add",c.trim(),"-y","--agent","pi"];if(g&&h.push("-g"),console.log(`[skills/install] running: npx ${h.join(" ")}`),f){var b;let c,d;return b=!g&&e?e:void 0,c=new TextEncoder,d=null,new Response(new ReadableStream({start(e){let f="",g=!1,i=new Set,j=a=>{e.enqueue(c.encode(`${JSON.stringify(a)}
2
2
  `))},k=()=>{clearTimeout(o),a.signal.removeEventListener("abort",n)},l=a=>{if(!g){g=!0,k();try{j(a)}finally{e.close()}}},m=a=>{l({type:"error",error:a,output:B(f)})},n=()=>{if(!g){g=!0,k(),d&&E(d);try{e.close()}catch{}}},o=setTimeout(()=>{d&&E(d);let a=B(f);m(`Skill installation timed out after ${Math.round(10)} minutes while cloning or installing. Last output:
3
3
  ${C(a)}`)},6e5);a.signal.addEventListener("abort",n),d=(0,w.Y)(h,{cwd:b,env:{...process.env,FORCE_COLOR:"0"},detached:"win32"!==process.platform}),j({type:"progress",stage:"Starting installer",line:"Starting installer"});let p=a=>{let b=a.toString("utf8");for(let a of function(a){let b=B(a),c=[];for(let a of A){let d=b.match(a.regex);if(!d)continue;let e="function"==typeof a.line?a.line(d):a.line;c.push({key:a.key,stage:a.stage,line:e})}return c}(f=(f+b).slice(-1048576))){let b=`${a.key}:${a.line}`;i.has(b)||(i.add(b),j({type:"progress",stage:a.stage,line:a.line}))}};d.stdout.on("data",p),d.stderr.on("data",p),d.on("error",a=>{m(a.message)}),d.on("close",(a,b)=>{if(g)return;let c=B(f);if(D(c))return void l({type:"done",success:!0,output:c});let d=null!==a?`exit code ${a}`:`signal ${b??"unknown"}`;m(`${C(c)||"Install failed"}
4
4
  Installer exited with ${d}.`)})},cancel(){d&&E(d)}}),{headers:{"Content-Type":"application/x-ndjson; charset=utf-8","Cache-Control":"no-store, no-transform","X-Accel-Buffering":"no"}})}let{stdout:i,stderr:j}=await (0,w.a)(h,{timeout:6e5,cwd:!g&&e?e:void 0,env:{...process.env,FORCE_COLOR:"0"}}),k=B(i+j);if(!D(k))return v.NextResponse.json({error:C(k)||"Install failed",output:k},{status:500});return v.NextResponse.json({success:!0,output:k})}catch(c){let a=B((c.stdout??"")+(c.stderr??"")),b=c.killed||"SIGTERM"===c.signal||/timed out|timeout/i.test(c.message??"")?`Skill installation timed out after ${Math.round(10)} minutes while cloning or installing. Last output:
5
- ${C(a)}`:C(a)||(c.message??String(c));return v.NextResponse.json({error:b,output:a},{status:500})}}let G=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/install/route",pathname:"/api/skills/install",filename:"route",bundlePath:"app/api/skills/install/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/skills/install/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:H,workUnitAsyncStorage:I,serverHooks:J}=G;function K(){return(0,g.patchFetch)({workAsyncStorage:H,workUnitAsyncStorage:I})}async function L(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),G.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/install/route";"/index"===d&&(d="/");let e=await G.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:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:F}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||G.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===G.isDev||!I,M=I&&!L;F&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:F});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await G.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.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)=>G.onRequestError(a,b,d,e,A)},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=>G.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&&B&&C&&!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 G.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await G.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,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",B?"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 G.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},84107:(a,b,c)=>{"use strict";c.d(b,{a:()=>k,Y:()=>l});var d=c(79646),e=c(28354),f=c(29021),g=c(33873);let h=require("process"),i=(0,e.promisify)(d.execFile);function j(a){let b=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}();return b?{command:h.execPath,commandArgs:[b,...a]}:{command:"npx",commandArgs:a}}async function k(a,b={}){let{command:c,commandArgs:d}=j(a);return i(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env,maxBuffer:b.maxBuffer??0xa00000})}function l(a,b={}){let{command:c,commandArgs:e}=j(a),f=(0,d.spawn)(c,e,{cwd:b.cwd,env:b.env,detached:b.detached,stdio:["pipe","pipe","pipe"],windowsHide:!0});return f.stdin.end(),f}},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=67426));module.exports=c})();
5
+ ${C(a)}`:C(a)||(c.message??String(c));return v.NextResponse.json({error:b,output:a},{status:500})}}let G=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/install/route",pathname:"/api/skills/install",filename:"route",bundlePath:"app/api/skills/install/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/skills/install/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:H,workUnitAsyncStorage:I,serverHooks:J}=G;function K(){return(0,g.patchFetch)({workAsyncStorage:H,workUnitAsyncStorage:I})}async function L(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),G.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/install/route";"/index"===d&&(d="/");let e=await G.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:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:F}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||G.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===G.isDev||!I,M=I&&!L;F&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:F});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await G.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.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)=>G.onRequestError(a,b,d,e,A)},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=>G.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&&B&&C&&!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 G.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await G.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,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",B?"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 G.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},84107:(a,b,c)=>{"use strict";c.d(b,{a:()=>k,Y:()=>l});var d=c(79646),e=c(28354),f=c(29021),g=c(33873);let h=require("process"),i=(0,e.promisify)(d.execFile);function j(a){let b=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}();return b?{command:h.execPath,commandArgs:[b,...a]}:{command:"npx",commandArgs:a}}async function k(a,b={}){let{command:c,commandArgs:d}=j(a);return i(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env,maxBuffer:b.maxBuffer??0xa00000})}function l(a,b={}){let{command:c,commandArgs:e}=j(a),f=(0,d.spawn)(c,e,{cwd:b.cwd,env:b.env,detached:b.detached,stdio:["pipe","pipe","pipe"],windowsHide:!0});return f.stdin.end(),f}},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=18821));module.exports=c})();
@@ -1,6 +1,6 @@
1
- (()=>{var a={};a.id=9968,a.ids=[9968],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")},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")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45403:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,PATCH:()=>j,dynamic:()=>k});var e=c(23211),f=c(29021),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let k="force-dynamic";async function i(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=new g.DefaultResourceLoader({cwd:c,agentDir:(0,g.getAgentDir)()});await a.reload();let{skills:b,diagnostics:d}=a.getSkills();return e.NextResponse.json({skills:b,diagnostics:d})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function j(a){try{let{filePath:b,disableModelInvocation:c}=await a.json();if(!b)return e.NextResponse.json({error:"filePath required"},{status:400});if(!(0,f.existsSync)(b))return e.NextResponse.json({error:"file not found"},{status:404});let d=(0,f.readFileSync)(b,"utf8"),h="disable-model-invocation",{frontmatter:i}=(0,g.parseFrontmatter)(d),j=!!i[h],k=d;return c&&!j?(k=d.replace(/^---\r?\n/,`---
1
+ (()=>{var a={};a.id=9968,a.ids=[9968],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")},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")},34796:(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(45403),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/route",pathname:"/api/skills",filename:"route",bundlePath:"app/api/skills/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/skills/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/skills/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=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45403:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,PATCH:()=>j,dynamic:()=>k});var e=c(23211),f=c(29021),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let k="force-dynamic";async function i(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=new g.DefaultResourceLoader({cwd:c,agentDir:(0,g.getAgentDir)()});await a.reload();let{skills:b,diagnostics:d}=a.getSkills();return e.NextResponse.json({skills:b,diagnostics:d})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function j(a){try{let{filePath:b,disableModelInvocation:c}=await a.json();if(!b)return e.NextResponse.json({error:"filePath required"},{status:400});if(!(0,f.existsSync)(b))return e.NextResponse.json({error:"file not found"},{status:404});let d=(0,f.readFileSync)(b,"utf8"),h="disable-model-invocation",{frontmatter:i}=(0,g.parseFrontmatter)(d),j=!!i[h],k=d;return c&&!j?(k=d.replace(/^---\r?\n/,`---
2
2
  ${h}: true
3
3
  `))===d&&(k=`---
4
4
  ${h}: true
5
5
  ---
6
- ${d}`):!c&&j&&(k=d.replace(RegExp(`^${h}\\s*:.*\\r?\\n`,"m"),"")),(0,f.writeFileSync)(b,k,"utf8"),e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},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")},95913:(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(45403),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/route",pathname:"/api/skills",filename:"route",bundlePath:"app/api/skills/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/skills/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/skills/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=95913));module.exports=c})();
6
+ ${d}`):!c&&j&&(k=d.replace(RegExp(`^${h}\\s*:.*\\r?\\n`,"m"),"")),(0,f.writeFileSync)(b,k,"utf8"),e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},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=34796));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=3955,a.ids=[3955],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")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},84107:(a,b,c)=>{"use strict";c.d(b,{a:()=>k,Y:()=>l});var d=c(79646),e=c(28354),f=c(29021),g=c(33873);let h=require("process"),i=(0,e.promisify)(d.execFile);function j(a){let b=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}();return b?{command:h.execPath,commandArgs:[b,...a]}:{command:"npx",commandArgs:a}}async function k(a,b={}){let{command:c,commandArgs:d}=j(a);return i(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env,maxBuffer:b.maxBuffer??0xa00000})}function l(a,b={}){let{command:c,commandArgs:e}=j(a),f=(0,d.spawn)(c,e,{cwd:b.cwd,env:b.env,detached:b.detached,stdio:["pipe","pipe","pipe"],windowsHide:!0});return f.stdin.end(),f}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},96613:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>J,patchFetch:()=>I,routeModule:()=>E,serverHooks:()=>H,workAsyncStorage:()=>F,workUnitAsyncStorage:()=>G});var d={};c.r(d),c.d(d,{POST:()=>D,dynamic:()=>x});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(23211),w=c(84107);let x="force-dynamic",y=/\x1B\[[0-9;]*m/g,z=process.env.SKILLS_API_URL||"https://skills.sh";function A(a){let b=a.replace(y,""),c=[],d=b.split("\n");for(let a=0;a<d.length;a++){let b=d[a].trim().match(/^([\w.\-]+\/[\w.\-@:]+)\s+([\d.,]+[KMB]?\s+installs)$/);if(b){let e=d[a+1]?.trim().replace(/^└\s*/,"");c.push({package:b[1],installs:b[2],url:e?.startsWith("https://")?e:""})}}return c}async function B(a,b){let c=`${z}/api/search?q=${encodeURIComponent(a)}&limit=${b}`,d=await fetch(c,{cache:"no-store"});if(!d.ok)throw Error(`skills.sh search failed: HTTP ${d.status}`);return((await d.json()).skills??[]).map(a=>{var b;let c=a.name?.trim(),d=a.source?.trim(),e=a.id?.trim();return c&&(d||e)?{package:`${d||e}@${c}`,installs:(b=a.installs)&&!(b<=0)?b>=1e6?`${(b/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:b>=1e3?`${(b/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${b} install${1===b?"":"s"}`:"",url:e?`${z}/${e}`:""}:null}).filter(a=>null!==a).sort((a,b)=>C(b.installs)-C(a.installs))}function C(a){let b=a.match(/^([\d.]+)([KMB])?\s+installs?$/);if(!b)return 0;let c=Number(b[1]);return Number.isFinite(c)?c*("B"===b[2]?1e9:"M"===b[2]?1e6:"K"===b[2]?1e3:1):0}async function D(a){try{let b,{query:c,limit:d}=await a.json();if(!c?.trim())return v.NextResponse.json({error:"query required"},{status:400});let e=(b="number"==typeof d?d:Number(d),Number.isFinite(b)?Math.min(50,Math.max(1,Math.floor(b))):50);try{let a=await B(c.trim(),e);return v.NextResponse.json({results:a})}catch{let{stdout:a,stderr:b}=await (0,w.a)(["--yes","skills","find",c.trim()],{timeout:2e4,env:{...process.env,FORCE_COLOR:"0"}}),d=A(a+b).slice(0,e);return v.NextResponse.json({results:d})}}catch(c){let a=(c.stdout??"")+(c.stderr??""),b=a?A(a):[];if(b.length>0)return v.NextResponse.json({results:b});return v.NextResponse.json({error:c.message??String(c)},{status:500})}}let E=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/search/route",pathname:"/api/skills/search",filename:"route",bundlePath:"app/api/skills/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/skills/search/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:F,workUnitAsyncStorage:G,serverHooks:H}=E;function I(){return(0,g.patchFetch)({workAsyncStorage:F,workUnitAsyncStorage:G})}async function J(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),E.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/search/route";"/index"===d&&(d="/");let e=await E.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:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||E.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===E.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==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await E.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.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)=>E.onRequestError(a,b,d,e,A)},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=>E.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&&B&&C&&!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 E.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await E.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,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",B?"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 E.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=96613));module.exports=c})();
1
+ (()=>{var a={};a.id=3955,a.ids=[3955],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")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},84107:(a,b,c)=>{"use strict";c.d(b,{a:()=>k,Y:()=>l});var d=c(79646),e=c(28354),f=c(29021),g=c(33873);let h=require("process"),i=(0,e.promisify)(d.execFile);function j(a){let b=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}();return b?{command:h.execPath,commandArgs:[b,...a]}:{command:"npx",commandArgs:a}}async function k(a,b={}){let{command:c,commandArgs:d}=j(a);return i(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env,maxBuffer:b.maxBuffer??0xa00000})}function l(a,b={}){let{command:c,commandArgs:e}=j(a),f=(0,d.spawn)(c,e,{cwd:b.cwd,env:b.env,detached:b.detached,stdio:["pipe","pipe","pipe"],windowsHide:!0});return f.stdin.end(),f}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89815:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>J,patchFetch:()=>I,routeModule:()=>E,serverHooks:()=>H,workAsyncStorage:()=>F,workUnitAsyncStorage:()=>G});var d={};c.r(d),c.d(d,{POST:()=>D,dynamic:()=>x});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(23211),w=c(84107);let x="force-dynamic",y=/\x1B\[[0-9;]*m/g,z=process.env.SKILLS_API_URL||"https://skills.sh";function A(a){let b=a.replace(y,""),c=[],d=b.split("\n");for(let a=0;a<d.length;a++){let b=d[a].trim().match(/^([\w.\-]+\/[\w.\-@:]+)\s+([\d.,]+[KMB]?\s+installs)$/);if(b){let e=d[a+1]?.trim().replace(/^└\s*/,"");c.push({package:b[1],installs:b[2],url:e?.startsWith("https://")?e:""})}}return c}async function B(a,b){let c=`${z}/api/search?q=${encodeURIComponent(a)}&limit=${b}`,d=await fetch(c,{cache:"no-store"});if(!d.ok)throw Error(`skills.sh search failed: HTTP ${d.status}`);return((await d.json()).skills??[]).map(a=>{var b;let c=a.name?.trim(),d=a.source?.trim(),e=a.id?.trim();return c&&(d||e)?{package:`${d||e}@${c}`,installs:(b=a.installs)&&!(b<=0)?b>=1e6?`${(b/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:b>=1e3?`${(b/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${b} install${1===b?"":"s"}`:"",url:e?`${z}/${e}`:""}:null}).filter(a=>null!==a).sort((a,b)=>C(b.installs)-C(a.installs))}function C(a){let b=a.match(/^([\d.]+)([KMB])?\s+installs?$/);if(!b)return 0;let c=Number(b[1]);return Number.isFinite(c)?c*("B"===b[2]?1e9:"M"===b[2]?1e6:"K"===b[2]?1e3:1):0}async function D(a){try{let b,{query:c,limit:d}=await a.json();if(!c?.trim())return v.NextResponse.json({error:"query required"},{status:400});let e=(b="number"==typeof d?d:Number(d),Number.isFinite(b)?Math.min(50,Math.max(1,Math.floor(b))):50);try{let a=await B(c.trim(),e);return v.NextResponse.json({results:a})}catch{let{stdout:a,stderr:b}=await (0,w.a)(["--yes","skills","find",c.trim()],{timeout:2e4,env:{...process.env,FORCE_COLOR:"0"}}),d=A(a+b).slice(0,e);return v.NextResponse.json({results:d})}}catch(c){let a=(c.stdout??"")+(c.stderr??""),b=a?A(a):[];if(b.length>0)return v.NextResponse.json({results:b});return v.NextResponse.json({error:c.message??String(c)},{status:500})}}let E=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/search/route",pathname:"/api/skills/search",filename:"route",bundlePath:"app/api/skills/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/skills/search/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:F,workUnitAsyncStorage:G,serverHooks:H}=E;function I(){return(0,g.patchFetch)({workAsyncStorage:F,workUnitAsyncStorage:G})}async function J(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),E.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/search/route";"/index"===d&&(d="/");let e=await E.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:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||E.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===E.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==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await E.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.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)=>E.onRequestError(a,b,d,e,A)},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=>E.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&&B&&C&&!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 E.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await E.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,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",B?"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 E.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),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,1813],()=>b(b.s=89815));module.exports=c})();