@37chengshan/ompweb 4.0.7 → 4.0.8

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 (458) 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 +3 -3
  4. package/.next/prerender-manifest.json +4 -4
  5. package/.next/react-loadable-manifest.json +4 -4
  6. package/.next/required-server-files.js +2 -2
  7. package/.next/required-server-files.json +2 -2
  8. package/.next/routes-manifest.json +10 -0
  9. package/.next/server/app/_global-error/page.js +2 -2
  10. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_global-error.html +1 -1
  12. package/.next/server/app/_global-error.rsc +2 -2
  13. package/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  14. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +2 -2
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page.js +1 -1
  17. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/_not-found.html +1 -1
  19. package/.next/server/app/_not-found.rsc +3 -3
  20. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  24. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  25. package/.next/server/app/api/agent/[id]/route.js +1 -1
  26. package/.next/server/app/api/agent/new/route.js +1 -1
  27. package/.next/server/app/api/agent/running/events/route.js +1 -1
  28. package/.next/server/app/api/agents/route.js +1 -1
  29. package/.next/server/app/api/app-update/releases/route.js +1 -1
  30. package/.next/server/app/api/app-update/route.js +2 -2
  31. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  32. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  33. package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  34. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  35. package/.next/server/app/api/auth/providers/route.js +1 -1
  36. package/.next/server/app/api/cwd/browse/route.js +1 -1
  37. package/.next/server/app/api/cwd/validate/route.js +1 -1
  38. package/.next/server/app/api/default-cwd/route.js +1 -1
  39. package/.next/server/app/api/diagnostics/route.js +1 -1
  40. package/.next/server/app/api/file-index/route.js +1 -1
  41. package/.next/server/app/api/files/[...path]/route.js +2 -2
  42. package/.next/server/app/api/git/diff/route.js +2 -2
  43. package/.next/server/app/api/git/status/route.js +1 -1
  44. package/.next/server/app/api/github/status/route.js +1 -1
  45. package/.next/server/app/api/home/route.js +1 -1
  46. package/.next/server/app/api/mcp/route.js +2 -2
  47. package/.next/server/app/api/model-roles/route.js +1 -1
  48. package/.next/server/app/api/models/fetch/route.js +1 -1
  49. package/.next/server/app/api/models/route.js +1 -1
  50. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  51. package/.next/server/app/api/models-config/route.js +1 -1
  52. package/.next/server/app/api/models-config/test/route.js +1 -1
  53. package/.next/server/app/api/omp-settings/route.js +1 -1
  54. package/.next/server/app/api/omp-update/route.js +1 -1
  55. package/.next/server/app/api/omp-version/route.js +1 -1
  56. package/.next/server/app/api/pair/accept/route.js +1 -1
  57. package/.next/server/app/api/pair/accept/route.js.nft.json +1 -1
  58. package/.next/server/app/api/pair/config/route.js +1 -1
  59. package/.next/server/app/api/pair/config/route.js.nft.json +1 -1
  60. package/.next/server/app/api/pair/devices/[id]/route.js +1 -1
  61. package/.next/server/app/api/pair/devices/[id]/route.js.nft.json +1 -1
  62. package/.next/server/app/api/pair/devices/route.js +1 -1
  63. package/.next/server/app/api/pair/devices/route.js.nft.json +1 -1
  64. package/.next/server/app/api/pair/heartbeat/route.js +1 -1
  65. package/.next/server/app/api/pair/heartbeat/route.js.nft.json +1 -1
  66. package/.next/server/app/api/pair/revoke-all/route.js +1 -1
  67. package/.next/server/app/api/pair/revoke-all/route.js.nft.json +1 -1
  68. package/.next/server/app/api/pair/token/route.js +1 -1
  69. package/.next/server/app/api/pair/token/route.js.nft.json +1 -1
  70. package/.next/server/app/api/pair/tunnel/route.js +1 -1
  71. package/.next/server/app/api/pair/tunnel/route.js.nft.json +1 -1
  72. package/.next/server/app/api/plugins/route.js +1 -1
  73. package/.next/server/app/api/projects/route.js +1 -1
  74. package/.next/server/app/api/provider-usage/route.js +1 -1
  75. package/.next/server/app/api/providers/enable/route.js +1 -1
  76. package/.next/server/app/api/proxy/route.js +1 -1
  77. package/.next/server/app/api/reveal/route.js +1 -1
  78. package/.next/server/app/api/scripts/route.js +1 -1
  79. package/.next/server/app/api/scripts/run/route.js +1 -1
  80. package/.next/server/app/api/sessions/[id]/archive/route.js +1 -1
  81. package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
  82. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  83. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  84. package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
  85. package/.next/server/app/api/sessions/[id]/plan/route.js +1 -1
  86. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  87. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  88. package/.next/server/app/api/sessions/[id]/subagents/[subagentId]/route.js +1 -1
  89. package/.next/server/app/api/sessions/[id]/subagents/route.js +1 -1
  90. package/.next/server/app/api/sessions/archive/route.js +1 -1
  91. package/.next/server/app/api/sessions/import/route.js +1 -1
  92. package/.next/server/app/api/sessions/route.js +1 -1
  93. package/.next/server/app/api/skills/check/route.js +1 -1
  94. package/.next/server/app/api/skills/install/route.js +1 -1
  95. package/.next/server/app/api/skills/route.js +1 -1
  96. package/.next/server/app/api/skills/search/route.js +1 -1
  97. package/.next/server/app/api/skills/update/route.js +1 -1
  98. package/.next/server/app/api/terminal/input/route.js +1 -1
  99. package/.next/server/app/api/terminal/open/route.js +1 -1
  100. package/.next/server/app/api/terminal/resize/route.js +1 -1
  101. package/.next/server/app/api/terminal/session/route.js +1 -1
  102. package/.next/server/app/api/terminal/stream/route.js +2 -2
  103. package/.next/server/app/api/usage-summary/route.js +1 -0
  104. package/.next/server/app/api/usage-summary/route.js.nft.json +1 -0
  105. package/.next/server/app/api/usage-summary/route_client-reference-manifest.js +1 -0
  106. package/.next/server/app/api/web-auth/session/route.js +1 -1
  107. package/.next/server/app/api/worktrees/route.js +1 -1
  108. package/.next/server/app/favicon.ico/route.js +1 -1
  109. package/.next/server/app/index.html +1 -1
  110. package/.next/server/app/index.rsc +18 -19
  111. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  112. package/.next/server/app/index.segments/_full.segment.rsc +18 -19
  113. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  114. package/.next/server/app/login/page.js +1 -1
  115. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/login.html +1 -1
  117. package/.next/server/app/login.rsc +18 -19
  118. package/.next/server/app/login.segments/_full.segment.rsc +18 -19
  119. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  120. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  121. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  122. package/.next/server/app/page.js +1 -1
  123. package/.next/server/app/page_client-reference-manifest.js +1 -1
  124. package/.next/server/app/remote/page.js +1 -1
  125. package/.next/server/app/remote/page_client-reference-manifest.js +1 -1
  126. package/.next/server/app/remote.html +1 -1
  127. package/.next/server/app/remote.rsc +21 -22
  128. package/.next/server/app/remote.segments/_full.segment.rsc +21 -22
  129. package/.next/server/app/remote.segments/_tree.segment.rsc +1 -1
  130. package/.next/server/app/remote.segments/remote/__PAGE__.segment.rsc +4 -4
  131. package/.next/server/app-paths-manifest.json +4 -3
  132. package/.next/server/chunks/5105.js +1 -0
  133. package/.next/server/chunks/5309.js +1 -1
  134. package/.next/server/middleware-build-manifest.js +1 -1
  135. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  136. package/.next/server/next-font-manifest.js +1 -1
  137. package/.next/server/next-font-manifest.json +1 -1
  138. package/.next/server/pages/404.html +1 -1
  139. package/.next/server/pages/500.html +1 -1
  140. package/.next/standalone/.next/BUILD_ID +1 -1
  141. package/.next/standalone/.next/app-path-routes-manifest.json +4 -3
  142. package/.next/standalone/.next/build-manifest.json +3 -3
  143. package/.next/standalone/.next/prerender-manifest.json +4 -4
  144. package/.next/standalone/.next/react-loadable-manifest.json +4 -4
  145. package/.next/standalone/.next/required-server-files.json +2 -2
  146. package/.next/standalone/.next/routes-manifest.json +10 -0
  147. package/.next/standalone/.next/server/app/_global-error/page.js +2 -2
  148. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  150. package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
  151. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  152. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +2 -2
  153. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  154. package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
  155. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  156. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  157. package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
  158. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  159. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  160. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  161. package/.next/standalone/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  162. package/.next/standalone/.next/server/app/api/agent/[id]/events/route.js +2 -2
  163. package/.next/standalone/.next/server/app/api/agent/[id]/route.js +1 -1
  164. package/.next/standalone/.next/server/app/api/agent/new/route.js +1 -1
  165. package/.next/standalone/.next/server/app/api/agent/running/events/route.js +1 -1
  166. package/.next/standalone/.next/server/app/api/agents/route.js +1 -1
  167. package/.next/standalone/.next/server/app/api/app-update/releases/route.js +1 -1
  168. package/.next/standalone/.next/server/app/api/app-update/route.js +2 -2
  169. package/.next/standalone/.next/server/app/api/auth/all-providers/route.js +1 -1
  170. package/.next/standalone/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  171. package/.next/standalone/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  172. package/.next/standalone/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  173. package/.next/standalone/.next/server/app/api/auth/providers/route.js +1 -1
  174. package/.next/standalone/.next/server/app/api/cwd/browse/route.js +1 -1
  175. package/.next/standalone/.next/server/app/api/cwd/validate/route.js +1 -1
  176. package/.next/standalone/.next/server/app/api/default-cwd/route.js +1 -1
  177. package/.next/standalone/.next/server/app/api/diagnostics/route.js +1 -1
  178. package/.next/standalone/.next/server/app/api/file-index/route.js +1 -1
  179. package/.next/standalone/.next/server/app/api/files/[...path]/route.js +2 -2
  180. package/.next/standalone/.next/server/app/api/git/diff/route.js +2 -2
  181. package/.next/standalone/.next/server/app/api/git/status/route.js +1 -1
  182. package/.next/standalone/.next/server/app/api/github/status/route.js +1 -1
  183. package/.next/standalone/.next/server/app/api/home/route.js +1 -1
  184. package/.next/standalone/.next/server/app/api/mcp/route.js +2 -2
  185. package/.next/standalone/.next/server/app/api/model-roles/route.js +1 -1
  186. package/.next/standalone/.next/server/app/api/models/fetch/route.js +1 -1
  187. package/.next/standalone/.next/server/app/api/models/route.js +1 -1
  188. package/.next/standalone/.next/server/app/api/models-config/catalog/route.js +1 -1
  189. package/.next/standalone/.next/server/app/api/models-config/route.js +1 -1
  190. package/.next/standalone/.next/server/app/api/models-config/test/route.js +1 -1
  191. package/.next/standalone/.next/server/app/api/omp-settings/route.js +1 -1
  192. package/.next/standalone/.next/server/app/api/omp-update/route.js +1 -1
  193. package/.next/standalone/.next/server/app/api/omp-version/route.js +1 -1
  194. package/.next/standalone/.next/server/app/api/pair/accept/route.js +1 -1
  195. package/.next/standalone/.next/server/app/api/pair/accept/route.js.nft.json +1 -1
  196. package/.next/standalone/.next/server/app/api/pair/config/route.js +1 -1
  197. package/.next/standalone/.next/server/app/api/pair/config/route.js.nft.json +1 -1
  198. package/.next/standalone/.next/server/app/api/pair/devices/[id]/route.js +1 -1
  199. package/.next/standalone/.next/server/app/api/pair/devices/[id]/route.js.nft.json +1 -1
  200. package/.next/standalone/.next/server/app/api/pair/devices/route.js +1 -1
  201. package/.next/standalone/.next/server/app/api/pair/devices/route.js.nft.json +1 -1
  202. package/.next/standalone/.next/server/app/api/pair/heartbeat/route.js +1 -1
  203. package/.next/standalone/.next/server/app/api/pair/heartbeat/route.js.nft.json +1 -1
  204. package/.next/standalone/.next/server/app/api/pair/revoke-all/route.js +1 -1
  205. package/.next/standalone/.next/server/app/api/pair/revoke-all/route.js.nft.json +1 -1
  206. package/.next/standalone/.next/server/app/api/pair/token/route.js +1 -1
  207. package/.next/standalone/.next/server/app/api/pair/token/route.js.nft.json +1 -1
  208. package/.next/standalone/.next/server/app/api/pair/tunnel/route.js +1 -1
  209. package/.next/standalone/.next/server/app/api/pair/tunnel/route.js.nft.json +1 -1
  210. package/.next/standalone/.next/server/app/api/plugins/route.js +1 -1
  211. package/.next/standalone/.next/server/app/api/projects/route.js +1 -1
  212. package/.next/standalone/.next/server/app/api/provider-usage/route.js +1 -1
  213. package/.next/standalone/.next/server/app/api/providers/enable/route.js +1 -1
  214. package/.next/standalone/.next/server/app/api/proxy/route.js +1 -1
  215. package/.next/standalone/.next/server/app/api/reveal/route.js +1 -1
  216. package/.next/standalone/.next/server/app/api/scripts/route.js +1 -1
  217. package/.next/standalone/.next/server/app/api/scripts/run/route.js +1 -1
  218. package/.next/standalone/.next/server/app/api/sessions/[id]/archive/route.js +1 -1
  219. package/.next/standalone/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
  220. package/.next/standalone/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  221. package/.next/standalone/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  222. package/.next/standalone/.next/server/app/api/sessions/[id]/export/route.js +1 -1
  223. package/.next/standalone/.next/server/app/api/sessions/[id]/plan/route.js +1 -1
  224. package/.next/standalone/.next/server/app/api/sessions/[id]/route.js +1 -1
  225. package/.next/standalone/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  226. package/.next/standalone/.next/server/app/api/sessions/[id]/subagents/[subagentId]/route.js +1 -1
  227. package/.next/standalone/.next/server/app/api/sessions/[id]/subagents/route.js +1 -1
  228. package/.next/standalone/.next/server/app/api/sessions/archive/route.js +1 -1
  229. package/.next/standalone/.next/server/app/api/sessions/import/route.js +1 -1
  230. package/.next/standalone/.next/server/app/api/sessions/route.js +1 -1
  231. package/.next/standalone/.next/server/app/api/skills/check/route.js +1 -1
  232. package/.next/standalone/.next/server/app/api/skills/install/route.js +1 -1
  233. package/.next/standalone/.next/server/app/api/skills/route.js +1 -1
  234. package/.next/standalone/.next/server/app/api/skills/search/route.js +1 -1
  235. package/.next/standalone/.next/server/app/api/skills/update/route.js +1 -1
  236. package/.next/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  237. package/.next/standalone/.next/server/app/api/terminal/open/route.js +1 -1
  238. package/.next/standalone/.next/server/app/api/terminal/resize/route.js +1 -1
  239. package/.next/standalone/.next/server/app/api/terminal/session/route.js +1 -1
  240. package/.next/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  241. package/.next/standalone/.next/server/app/api/usage-summary/route.js +1 -0
  242. package/.next/standalone/.next/server/app/api/usage-summary/route.js.nft.json +1 -0
  243. package/.next/standalone/.next/server/app/api/usage-summary/route_client-reference-manifest.js +1 -0
  244. package/.next/standalone/.next/server/app/api/web-auth/session/route.js +1 -1
  245. package/.next/standalone/.next/server/app/api/worktrees/route.js +1 -1
  246. package/.next/standalone/.next/server/app/favicon.ico/route.js +1 -1
  247. package/.next/standalone/.next/server/app/index.html +1 -1
  248. package/.next/standalone/.next/server/app/index.rsc +18 -19
  249. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  250. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +18 -19
  251. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  252. package/.next/standalone/.next/server/app/login/page.js +1 -1
  253. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  254. package/.next/standalone/.next/server/app/login.html +1 -1
  255. package/.next/standalone/.next/server/app/login.rsc +18 -19
  256. package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +18 -19
  257. package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  258. package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  259. package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +2 -2
  260. package/.next/standalone/.next/server/app/page.js +1 -1
  261. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  262. package/.next/standalone/.next/server/app/remote/page.js +1 -1
  263. package/.next/standalone/.next/server/app/remote/page_client-reference-manifest.js +1 -1
  264. package/.next/standalone/.next/server/app/remote.html +1 -1
  265. package/.next/standalone/.next/server/app/remote.rsc +21 -22
  266. package/.next/standalone/.next/server/app/remote.segments/_full.segment.rsc +21 -22
  267. package/.next/standalone/.next/server/app/remote.segments/_tree.segment.rsc +1 -1
  268. package/.next/standalone/.next/server/app/remote.segments/remote/__PAGE__.segment.rsc +4 -4
  269. package/.next/standalone/.next/server/app-paths-manifest.json +4 -3
  270. package/.next/standalone/.next/server/chunks/5105.js +1 -0
  271. package/.next/standalone/.next/server/chunks/5309.js +1 -1
  272. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  273. package/.next/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  274. package/.next/standalone/.next/server/next-font-manifest.js +1 -1
  275. package/.next/standalone/.next/server/next-font-manifest.json +1 -1
  276. package/.next/standalone/.next/server/pages/404.html +1 -1
  277. package/.next/standalone/.next/server/pages/500.html +1 -1
  278. package/.next/standalone/package.json +1 -1
  279. package/.next/standalone/server.js +1 -1
  280. package/.next/static/CYQrJAlj4LGpZLx6R09J5/_buildManifest.js +1 -0
  281. package/.next/static/chunks/2584-da00c2837d93cf36.js +1 -0
  282. package/.next/static/chunks/3651.83bd686c6f78c347.js +1 -0
  283. package/.next/static/chunks/6792.3a89b1ae59253479.js +126 -0
  284. package/.next/static/chunks/app/_global-error/page-f94b31373715403d.js +1 -0
  285. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-f94b31373715403d.js +1 -0
  286. package/.next/static/chunks/app/api/agent/[id]/events/route-f94b31373715403d.js +1 -0
  287. package/.next/static/chunks/app/api/agent/[id]/route-f94b31373715403d.js +1 -0
  288. package/.next/static/chunks/app/api/agent/new/route-f94b31373715403d.js +1 -0
  289. package/.next/static/chunks/app/api/agent/running/events/route-f94b31373715403d.js +1 -0
  290. package/.next/static/chunks/app/api/agents/route-f94b31373715403d.js +1 -0
  291. package/.next/static/chunks/app/api/app-update/releases/route-f94b31373715403d.js +1 -0
  292. package/.next/static/chunks/app/api/app-update/route-f94b31373715403d.js +1 -0
  293. package/.next/static/chunks/app/api/auth/all-providers/route-f94b31373715403d.js +1 -0
  294. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-f94b31373715403d.js +1 -0
  295. package/.next/static/chunks/app/api/auth/login/[provider]/route-f94b31373715403d.js +1 -0
  296. package/.next/static/chunks/app/api/auth/logout/[provider]/route-f94b31373715403d.js +1 -0
  297. package/.next/static/chunks/app/api/auth/providers/route-f94b31373715403d.js +1 -0
  298. package/.next/static/chunks/app/api/cwd/browse/route-f94b31373715403d.js +1 -0
  299. package/.next/static/chunks/app/api/cwd/validate/route-f94b31373715403d.js +1 -0
  300. package/.next/static/chunks/app/api/default-cwd/route-f94b31373715403d.js +1 -0
  301. package/.next/static/chunks/app/api/diagnostics/route-f94b31373715403d.js +1 -0
  302. package/.next/static/chunks/app/api/file-index/route-f94b31373715403d.js +1 -0
  303. package/.next/static/chunks/app/api/files/[...path]/route-f94b31373715403d.js +1 -0
  304. package/.next/static/chunks/app/api/git/diff/route-f94b31373715403d.js +1 -0
  305. package/.next/static/chunks/app/api/git/status/route-f94b31373715403d.js +1 -0
  306. package/.next/static/chunks/app/api/github/status/route-f94b31373715403d.js +1 -0
  307. package/.next/static/chunks/app/api/home/route-f94b31373715403d.js +1 -0
  308. package/.next/static/chunks/app/api/mcp/route-f94b31373715403d.js +1 -0
  309. package/.next/static/chunks/app/api/model-roles/route-f94b31373715403d.js +1 -0
  310. package/.next/static/chunks/app/api/models/fetch/route-f94b31373715403d.js +1 -0
  311. package/.next/static/chunks/app/api/models/route-f94b31373715403d.js +1 -0
  312. package/.next/static/chunks/app/api/models-config/catalog/route-f94b31373715403d.js +1 -0
  313. package/.next/static/chunks/app/api/models-config/route-f94b31373715403d.js +1 -0
  314. package/.next/static/chunks/app/api/models-config/test/route-f94b31373715403d.js +1 -0
  315. package/.next/static/chunks/app/api/omp-settings/route-f94b31373715403d.js +1 -0
  316. package/.next/static/chunks/app/api/omp-update/route-f94b31373715403d.js +1 -0
  317. package/.next/static/chunks/app/api/omp-version/route-f94b31373715403d.js +1 -0
  318. package/.next/static/chunks/app/api/pair/accept/route-f94b31373715403d.js +1 -0
  319. package/.next/static/chunks/app/api/pair/config/route-f94b31373715403d.js +1 -0
  320. package/.next/static/chunks/app/api/pair/devices/[id]/route-f94b31373715403d.js +1 -0
  321. package/.next/static/chunks/app/api/pair/devices/route-f94b31373715403d.js +1 -0
  322. package/.next/static/chunks/app/api/pair/heartbeat/route-f94b31373715403d.js +1 -0
  323. package/.next/static/chunks/app/api/pair/revoke-all/route-f94b31373715403d.js +1 -0
  324. package/.next/static/chunks/app/api/pair/token/route-f94b31373715403d.js +1 -0
  325. package/.next/static/chunks/app/api/pair/tunnel/route-f94b31373715403d.js +1 -0
  326. package/.next/static/chunks/app/api/plugins/route-f94b31373715403d.js +1 -0
  327. package/.next/static/chunks/app/api/projects/route-f94b31373715403d.js +1 -0
  328. package/.next/static/chunks/app/api/provider-usage/route-f94b31373715403d.js +1 -0
  329. package/.next/static/chunks/app/api/providers/enable/route-f94b31373715403d.js +1 -0
  330. package/.next/static/chunks/app/api/proxy/route-f94b31373715403d.js +1 -0
  331. package/.next/static/chunks/app/api/reveal/route-f94b31373715403d.js +1 -0
  332. package/.next/static/chunks/app/api/scripts/route-f94b31373715403d.js +1 -0
  333. package/.next/static/chunks/app/api/scripts/run/route-f94b31373715403d.js +1 -0
  334. package/.next/static/chunks/app/api/sessions/[id]/archive/route-f94b31373715403d.js +1 -0
  335. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-f94b31373715403d.js +1 -0
  336. package/.next/static/chunks/app/api/sessions/[id]/context/route-f94b31373715403d.js +1 -0
  337. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-f94b31373715403d.js +1 -0
  338. package/.next/static/chunks/app/api/sessions/[id]/export/route-f94b31373715403d.js +1 -0
  339. package/.next/static/chunks/app/api/sessions/[id]/plan/route-f94b31373715403d.js +1 -0
  340. package/.next/static/chunks/app/api/sessions/[id]/route-f94b31373715403d.js +1 -0
  341. package/.next/static/chunks/app/api/sessions/[id]/state/route-f94b31373715403d.js +1 -0
  342. package/.next/static/chunks/app/api/sessions/[id]/subagents/[subagentId]/route-f94b31373715403d.js +1 -0
  343. package/.next/static/chunks/app/api/sessions/[id]/subagents/route-f94b31373715403d.js +1 -0
  344. package/.next/static/chunks/app/api/sessions/archive/route-f94b31373715403d.js +1 -0
  345. package/.next/static/chunks/app/api/sessions/import/route-f94b31373715403d.js +1 -0
  346. package/.next/static/chunks/app/api/sessions/route-f94b31373715403d.js +1 -0
  347. package/.next/static/chunks/app/api/skills/check/route-f94b31373715403d.js +1 -0
  348. package/.next/static/chunks/app/api/skills/install/route-f94b31373715403d.js +1 -0
  349. package/.next/static/chunks/app/api/skills/route-f94b31373715403d.js +1 -0
  350. package/.next/static/chunks/app/api/skills/search/route-f94b31373715403d.js +1 -0
  351. package/.next/static/chunks/app/api/skills/update/route-f94b31373715403d.js +1 -0
  352. package/.next/static/chunks/app/api/terminal/input/route-f94b31373715403d.js +1 -0
  353. package/.next/static/chunks/app/api/terminal/open/route-f94b31373715403d.js +1 -0
  354. package/.next/static/chunks/app/api/terminal/resize/route-f94b31373715403d.js +1 -0
  355. package/.next/static/chunks/app/api/terminal/session/route-f94b31373715403d.js +1 -0
  356. package/.next/static/chunks/app/api/terminal/stream/route-f94b31373715403d.js +1 -0
  357. package/.next/static/chunks/app/api/usage-summary/route-f94b31373715403d.js +1 -0
  358. package/.next/static/chunks/app/api/web-auth/session/route-f94b31373715403d.js +1 -0
  359. package/.next/static/chunks/app/api/worktrees/route-f94b31373715403d.js +1 -0
  360. package/.next/static/chunks/app/manifest.webmanifest/route-f94b31373715403d.js +1 -0
  361. package/.next/static/chunks/app/{page-48b96ccb13ebd7bb.js → page-29ff0717ff7d59d5.js} +1 -1
  362. package/.next/static/chunks/app/remote/page-6929ee7ca38967a5.js +1 -0
  363. package/.next/static/chunks/next/dist/client/components/builtin/app-error-f94b31373715403d.js +1 -0
  364. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-f94b31373715403d.js +1 -0
  365. package/.next/static/chunks/next/dist/client/components/builtin/not-found-f94b31373715403d.js +1 -0
  366. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f94b31373715403d.js +1 -0
  367. package/.next/static/chunks/{webpack-18d04f872fe12139.js → webpack-e7dc39b3ef71fd7e.js} +1 -1
  368. package/desktop/main.js +44 -7
  369. package/next.config.ts +6 -1
  370. package/package.json +1 -1
  371. package/.next/server/chunks/4791.js +0 -1
  372. package/.next/standalone/.next/server/chunks/4791.js +0 -1
  373. package/.next/static/Q-0mKyL6V7YpE6pf8ZoFy/_buildManifest.js +0 -1
  374. package/.next/static/chunks/2584-77204310e58868e3.js +0 -1
  375. package/.next/static/chunks/3651.f68fccde22153b7d.js +0 -1
  376. package/.next/static/chunks/7408.8fb61f7f23253d4d.js +0 -126
  377. package/.next/static/chunks/app/_global-error/page-f97ee162e6cb1325.js +0 -1
  378. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-f97ee162e6cb1325.js +0 -1
  379. package/.next/static/chunks/app/api/agent/[id]/events/route-f97ee162e6cb1325.js +0 -1
  380. package/.next/static/chunks/app/api/agent/[id]/route-f97ee162e6cb1325.js +0 -1
  381. package/.next/static/chunks/app/api/agent/new/route-f97ee162e6cb1325.js +0 -1
  382. package/.next/static/chunks/app/api/agent/running/events/route-f97ee162e6cb1325.js +0 -1
  383. package/.next/static/chunks/app/api/agents/route-f97ee162e6cb1325.js +0 -1
  384. package/.next/static/chunks/app/api/app-update/releases/route-f97ee162e6cb1325.js +0 -1
  385. package/.next/static/chunks/app/api/app-update/route-f97ee162e6cb1325.js +0 -1
  386. package/.next/static/chunks/app/api/auth/all-providers/route-f97ee162e6cb1325.js +0 -1
  387. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-f97ee162e6cb1325.js +0 -1
  388. package/.next/static/chunks/app/api/auth/login/[provider]/route-f97ee162e6cb1325.js +0 -1
  389. package/.next/static/chunks/app/api/auth/logout/[provider]/route-f97ee162e6cb1325.js +0 -1
  390. package/.next/static/chunks/app/api/auth/providers/route-f97ee162e6cb1325.js +0 -1
  391. package/.next/static/chunks/app/api/cwd/browse/route-f97ee162e6cb1325.js +0 -1
  392. package/.next/static/chunks/app/api/cwd/validate/route-f97ee162e6cb1325.js +0 -1
  393. package/.next/static/chunks/app/api/default-cwd/route-f97ee162e6cb1325.js +0 -1
  394. package/.next/static/chunks/app/api/diagnostics/route-f97ee162e6cb1325.js +0 -1
  395. package/.next/static/chunks/app/api/file-index/route-f97ee162e6cb1325.js +0 -1
  396. package/.next/static/chunks/app/api/files/[...path]/route-f97ee162e6cb1325.js +0 -1
  397. package/.next/static/chunks/app/api/git/diff/route-f97ee162e6cb1325.js +0 -1
  398. package/.next/static/chunks/app/api/git/status/route-f97ee162e6cb1325.js +0 -1
  399. package/.next/static/chunks/app/api/github/status/route-f97ee162e6cb1325.js +0 -1
  400. package/.next/static/chunks/app/api/home/route-f97ee162e6cb1325.js +0 -1
  401. package/.next/static/chunks/app/api/mcp/route-f97ee162e6cb1325.js +0 -1
  402. package/.next/static/chunks/app/api/model-roles/route-f97ee162e6cb1325.js +0 -1
  403. package/.next/static/chunks/app/api/models/fetch/route-f97ee162e6cb1325.js +0 -1
  404. package/.next/static/chunks/app/api/models/route-f97ee162e6cb1325.js +0 -1
  405. package/.next/static/chunks/app/api/models-config/catalog/route-f97ee162e6cb1325.js +0 -1
  406. package/.next/static/chunks/app/api/models-config/route-f97ee162e6cb1325.js +0 -1
  407. package/.next/static/chunks/app/api/models-config/test/route-f97ee162e6cb1325.js +0 -1
  408. package/.next/static/chunks/app/api/omp-settings/route-f97ee162e6cb1325.js +0 -1
  409. package/.next/static/chunks/app/api/omp-update/route-f97ee162e6cb1325.js +0 -1
  410. package/.next/static/chunks/app/api/omp-version/route-f97ee162e6cb1325.js +0 -1
  411. package/.next/static/chunks/app/api/pair/accept/route-f97ee162e6cb1325.js +0 -1
  412. package/.next/static/chunks/app/api/pair/config/route-f97ee162e6cb1325.js +0 -1
  413. package/.next/static/chunks/app/api/pair/devices/[id]/route-f97ee162e6cb1325.js +0 -1
  414. package/.next/static/chunks/app/api/pair/devices/route-f97ee162e6cb1325.js +0 -1
  415. package/.next/static/chunks/app/api/pair/heartbeat/route-f97ee162e6cb1325.js +0 -1
  416. package/.next/static/chunks/app/api/pair/revoke-all/route-f97ee162e6cb1325.js +0 -1
  417. package/.next/static/chunks/app/api/pair/token/route-f97ee162e6cb1325.js +0 -1
  418. package/.next/static/chunks/app/api/pair/tunnel/route-f97ee162e6cb1325.js +0 -1
  419. package/.next/static/chunks/app/api/plugins/route-f97ee162e6cb1325.js +0 -1
  420. package/.next/static/chunks/app/api/projects/route-f97ee162e6cb1325.js +0 -1
  421. package/.next/static/chunks/app/api/provider-usage/route-f97ee162e6cb1325.js +0 -1
  422. package/.next/static/chunks/app/api/providers/enable/route-f97ee162e6cb1325.js +0 -1
  423. package/.next/static/chunks/app/api/proxy/route-f97ee162e6cb1325.js +0 -1
  424. package/.next/static/chunks/app/api/reveal/route-f97ee162e6cb1325.js +0 -1
  425. package/.next/static/chunks/app/api/scripts/route-f97ee162e6cb1325.js +0 -1
  426. package/.next/static/chunks/app/api/scripts/run/route-f97ee162e6cb1325.js +0 -1
  427. package/.next/static/chunks/app/api/sessions/[id]/archive/route-f97ee162e6cb1325.js +0 -1
  428. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-f97ee162e6cb1325.js +0 -1
  429. package/.next/static/chunks/app/api/sessions/[id]/context/route-f97ee162e6cb1325.js +0 -1
  430. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-f97ee162e6cb1325.js +0 -1
  431. package/.next/static/chunks/app/api/sessions/[id]/export/route-f97ee162e6cb1325.js +0 -1
  432. package/.next/static/chunks/app/api/sessions/[id]/plan/route-f97ee162e6cb1325.js +0 -1
  433. package/.next/static/chunks/app/api/sessions/[id]/route-f97ee162e6cb1325.js +0 -1
  434. package/.next/static/chunks/app/api/sessions/[id]/state/route-f97ee162e6cb1325.js +0 -1
  435. package/.next/static/chunks/app/api/sessions/[id]/subagents/[subagentId]/route-f97ee162e6cb1325.js +0 -1
  436. package/.next/static/chunks/app/api/sessions/[id]/subagents/route-f97ee162e6cb1325.js +0 -1
  437. package/.next/static/chunks/app/api/sessions/archive/route-f97ee162e6cb1325.js +0 -1
  438. package/.next/static/chunks/app/api/sessions/import/route-f97ee162e6cb1325.js +0 -1
  439. package/.next/static/chunks/app/api/sessions/route-f97ee162e6cb1325.js +0 -1
  440. package/.next/static/chunks/app/api/skills/check/route-f97ee162e6cb1325.js +0 -1
  441. package/.next/static/chunks/app/api/skills/install/route-f97ee162e6cb1325.js +0 -1
  442. package/.next/static/chunks/app/api/skills/route-f97ee162e6cb1325.js +0 -1
  443. package/.next/static/chunks/app/api/skills/search/route-f97ee162e6cb1325.js +0 -1
  444. package/.next/static/chunks/app/api/skills/update/route-f97ee162e6cb1325.js +0 -1
  445. package/.next/static/chunks/app/api/terminal/input/route-f97ee162e6cb1325.js +0 -1
  446. package/.next/static/chunks/app/api/terminal/open/route-f97ee162e6cb1325.js +0 -1
  447. package/.next/static/chunks/app/api/terminal/resize/route-f97ee162e6cb1325.js +0 -1
  448. package/.next/static/chunks/app/api/terminal/session/route-f97ee162e6cb1325.js +0 -1
  449. package/.next/static/chunks/app/api/terminal/stream/route-f97ee162e6cb1325.js +0 -1
  450. package/.next/static/chunks/app/api/web-auth/session/route-f97ee162e6cb1325.js +0 -1
  451. package/.next/static/chunks/app/api/worktrees/route-f97ee162e6cb1325.js +0 -1
  452. package/.next/static/chunks/app/manifest.webmanifest/route-f97ee162e6cb1325.js +0 -1
  453. package/.next/static/chunks/app/remote/page-3f3f16f1d3808f92.js +0 -1
  454. package/.next/static/chunks/next/dist/client/components/builtin/app-error-f97ee162e6cb1325.js +0 -1
  455. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-f97ee162e6cb1325.js +0 -1
  456. package/.next/static/chunks/next/dist/client/components/builtin/not-found-f97ee162e6cb1325.js +0 -1
  457. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f97ee162e6cb1325.js +0 -1
  458. /package/.next/static/{Q-0mKyL6V7YpE6pf8ZoFy → CYQrJAlj4LGpZLx6R09J5}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=5715,a.ids=[5715],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20565:(a,b,c)=>{"use strict";function d(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function e(a){return"string"==typeof a?a:void 0}function f(a){return"number"==typeof a&&Number.isFinite(a)?a:void 0}c.d(b,{i:()=>f,oJ:()=>e,u4:()=>d})},21820:a=>{"use strict";a.exports=require("os")},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")},56134:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/provider-usage/route",pathname:"/api/provider-usage",filename:"route",bundlePath:"app/api/provider-usage/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/provider-usage/route.ts",nextConfigOutput:"standalone",userland:()=>c(70324),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/provider-usage/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},70324:(a,b,c)=>{"use strict";let d,e;c.r(b),c.d(b,{GET:()=>r,dynamic:()=>o});var f=c(23211),g=c(79646),h=c(28354),i=c(79588),j=c(20565);let k=(0,h.promisify)(g.execFile);function l(a){return"string"==typeof a&&a.trim()?a.trim():void 0}async function m(){let a=(0,i.wS)();if(!a)throw Error("omp binary not found. Install oh-my-pi or set OMP_WEB_OMP_BIN.");let{stdout:b}=await k(a,["usage","--json","--redact"],{timeout:3e4,maxBuffer:4194304,windowsHide:!0});return b}async function n(a={}){return function(a,b={},c=Date.now()){let d;try{d=JSON.parse(a)}catch{throw Error("omp usage returned invalid JSON")}if(!(0,j.u4)(d))throw Error("omp usage returned an invalid response");let e=(Array.isArray(d.reports)?d.reports:[]).flatMap((a,d)=>(0,j.u4)(a)?function(a,b,c,d){let e=l(a.provider);if(!e||b.provider&&e!==b.provider)return[];let f=Array.isArray(a.limits)?a.limits:[],g=b.modelId?.toLowerCase(),h=new Map;for(let a of f){if(!(0,j.u4)(a)||!(0,j.u4)(a.scope)||!(0,j.u4)(a.amount))continue;let b=a.scope,c=a.amount,d=(0,j.i)(c.usedFraction);if(void 0===d)continue;let e=(0,j.u4)(a.window)?a.window:{},f=function(a,b){let c=l(a.windowId);if("5h"===c||"7d"===c||"monthly"===c||"30d"===c)return"30d"===c?"monthly":c;let d=(0,j.i)(b.durationMs);if(void 0!==d){if(6e4>=Math.abs(d-18e6))return"5h";if(6e4>=Math.abs(d-6048e5))return"7d";if(36e5>=Math.abs(d-2592e6))return"monthly"}}(b,e);if(!f)continue;let i=l(b.modelId);if(g&&i&&i.toLowerCase()!==g)continue;let k=l(b.tier),m=i?.toLowerCase(),n=k?.toLowerCase(),o=`${m??""}\0${n??""}`,p=i?+!n:n?2:3,q=h.get(o);q||(q={priority:p,modelId:i,tier:k,limits:new Map},h.set(o,q));let r={id:f,fraction:d,window:e},s=q.limits.get(f);(!s||d>s.fraction)&&q.limits.set(f,r)}let i=[...h.values()];if(g&&i.length>0){let a=i.reduce((a,b)=>b.priority<a.priority?b:a);i.splice(0,i.length,a)}let k=(0,j.u4)(a.metadata)?a.metadata:void 0,m=l(k?.email)??l(k?.accountId),n=l(k?.planType);return 0===i.length?[{provider:e,...m?{accountLabel:m}:{},...!m?{accountIndex:d+1}:{},...n?{plan:n}:{},noLimits:!0}]:i.flatMap(a=>{let b={provider:e,...m?{accountLabel:m}:{},...!m?{accountIndex:d+1}:{},...n?{plan:n}:{},...a.modelId?{modelId:a.modelId}:{},...a.tier?{tier:a.tier}:{}};for(let d of a.limits.values()){let a=function(a,b,c,d){let e=(0,j.i)(c.resetsAt);return"5h"===a?{percent:100*b,...void 0!==e?{resetMinutes:Math.max(0,Math.round((e-d)/6e4))}:{}}:{percent:100*b,...void 0!==e?{resetHours:Math.max(0,Math.round((e-d)/36e5))}:{}}}(d.id,d.fraction,d.window,c);"5h"!==d.id||b.fiveHour||(b.fiveHour=a),"7d"!==d.id||b.sevenDay||(b.sevenDay=a),"monthly"!==d.id||b.monthly||(b.monthly=a)}return b.fiveHour||b.sevenDay||b.monthly?[b]:[]})}(a,b,c,d):[]);return{generatedAt:(0,j.i)(d.generatedAt)??null,reports:e}}(await (d&&d.expiresAt>Date.now()?Promise.resolve(d.output):e||(e=m().then(a=>(d={output:a,expiresAt:Date.now()+3e5},a)).finally(()=>{e=void 0}))),a)}let o="force-dynamic",p=/^[A-Za-z0-9._:/-]{1,200}$/;function q(a){if(null===a)return;let b=a.trim();if(b)return p.test(b)?b:void 0}async function r(a){let b=new URL(a.url).searchParams,c=b.get("provider"),d=b.get("model"),e=q(c),g=q(d);if(null!==c&&!e||null!==d&&!g)return f.NextResponse.json({error:"Invalid provider or model identifier",code:"invalid_usage_query"},{status:400});try{return f.NextResponse.json(await n({provider:e,modelId:g}))}catch{return f.NextResponse.json({error:"Provider usage is currently unavailable",code:"provider_usage_unavailable"},{status:502})}}},78335:()=>{},79588:(a,b,c)=>{"use strict";c.d(b,{F1:()=>n,wS:()=>m});var d=c(79646),e=c(29021),f=c(21820),g=c(33873);let h=null,i=0,j=null,k=0,l="win32"===process.platform?["omp.exe","omp.cmd","omp"]:["omp"];function m(){if(h&&(0,e.existsSync)(h))return h;if(h=null,Date.now()-i<3e4)return null;let a=function(){let a=process.env.OMP_WEB_OMP_BIN;if(a)return(0,e.existsSync)(a)?a:null;for(let a of(process.env.PATH??"").split(g.delimiter))if(a)for(let b of l){let c=(0,g.join)(a,b);if((0,e.existsSync)(c))return c}for(let a of["/opt/homebrew/bin","/usr/local/bin",(0,g.join)((0,f.homedir)(),".bun","bin"),(0,g.join)((0,f.homedir)(),".local","bin")])for(let b of l){let c=(0,g.join)(a,b);if((0,e.existsSync)(c))return c}return null}();return a?(h=a,i=0,a):(i=Date.now(),null)}async function n(){if(j)return j;if(Date.now()-k<3e4)return null;let a=m();if(!a)return k=Date.now(),null;try{let b=(await new Promise((b,c)=>{(0,d.execFile)(a,["--version"],{timeout:1e4,windowsHide:!0},(a,d)=>{a?c(a):b(d)})})).trim();if(b)return j=b,k=0,b}catch{}return k=Date.now(),null}},79646:a=>{"use strict";a.exports=require("child_process")},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=56134));module.exports=c})();
1
+ (()=>{var a={};a.id=5715,a.ids=[5715],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20565:(a,b,c)=>{"use strict";function d(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function e(a){return"string"==typeof a?a:void 0}function f(a){return"number"==typeof a&&Number.isFinite(a)?a:void 0}c.d(b,{i:()=>f,oJ:()=>e,u4:()=>d})},21820:a=>{"use strict";a.exports=require("os")},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")},69594:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/provider-usage/route",pathname:"/api/provider-usage",filename:"route",bundlePath:"app/api/provider-usage/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/provider-usage/route.ts",nextConfigOutput:"standalone",userland:()=>c(70324),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/provider-usage/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},70324:(a,b,c)=>{"use strict";let d,e;c.r(b),c.d(b,{GET:()=>r,dynamic:()=>o});var f=c(23211),g=c(79646),h=c(28354),i=c(79588),j=c(20565);let k=(0,h.promisify)(g.execFile);function l(a){return"string"==typeof a&&a.trim()?a.trim():void 0}async function m(){let a=(0,i.wS)();if(!a)throw Error("omp binary not found. Install oh-my-pi or set OMP_WEB_OMP_BIN.");let{stdout:b}=await k(a,["usage","--json","--redact"],{timeout:3e4,maxBuffer:4194304,windowsHide:!0});return b}async function n(a={}){return function(a,b={},c=Date.now()){let d;try{d=JSON.parse(a)}catch{throw Error("omp usage returned invalid JSON")}if(!(0,j.u4)(d))throw Error("omp usage returned an invalid response");let e=(Array.isArray(d.reports)?d.reports:[]).flatMap((a,d)=>(0,j.u4)(a)?function(a,b,c,d){let e=l(a.provider);if(!e||b.provider&&e!==b.provider)return[];let f=Array.isArray(a.limits)?a.limits:[],g=b.modelId?.toLowerCase(),h=new Map;for(let a of f){if(!(0,j.u4)(a)||!(0,j.u4)(a.scope)||!(0,j.u4)(a.amount))continue;let b=a.scope,c=a.amount,d=(0,j.i)(c.usedFraction);if(void 0===d)continue;let e=(0,j.u4)(a.window)?a.window:{},f=function(a,b){let c=l(a.windowId);if("5h"===c||"7d"===c||"monthly"===c||"30d"===c)return"30d"===c?"monthly":c;let d=(0,j.i)(b.durationMs);if(void 0!==d){if(6e4>=Math.abs(d-18e6))return"5h";if(6e4>=Math.abs(d-6048e5))return"7d";if(36e5>=Math.abs(d-2592e6))return"monthly"}}(b,e);if(!f)continue;let i=l(b.modelId);if(g&&i&&i.toLowerCase()!==g)continue;let k=l(b.tier),m=i?.toLowerCase(),n=k?.toLowerCase(),o=`${m??""}\0${n??""}`,p=i?+!n:n?2:3,q=h.get(o);q||(q={priority:p,modelId:i,tier:k,limits:new Map},h.set(o,q));let r={id:f,fraction:d,window:e},s=q.limits.get(f);(!s||d>s.fraction)&&q.limits.set(f,r)}let i=[...h.values()];if(g&&i.length>0){let a=i.reduce((a,b)=>b.priority<a.priority?b:a);i.splice(0,i.length,a)}let k=(0,j.u4)(a.metadata)?a.metadata:void 0,m=l(k?.email)??l(k?.accountId),n=l(k?.planType);return 0===i.length?[{provider:e,...m?{accountLabel:m}:{},...!m?{accountIndex:d+1}:{},...n?{plan:n}:{},noLimits:!0}]:i.flatMap(a=>{let b={provider:e,...m?{accountLabel:m}:{},...!m?{accountIndex:d+1}:{},...n?{plan:n}:{},...a.modelId?{modelId:a.modelId}:{},...a.tier?{tier:a.tier}:{}};for(let d of a.limits.values()){let a=function(a,b,c,d){let e=(0,j.i)(c.resetsAt);return"5h"===a?{percent:100*b,...void 0!==e?{resetMinutes:Math.max(0,Math.round((e-d)/6e4))}:{}}:{percent:100*b,...void 0!==e?{resetHours:Math.max(0,Math.round((e-d)/36e5))}:{}}}(d.id,d.fraction,d.window,c);"5h"!==d.id||b.fiveHour||(b.fiveHour=a),"7d"!==d.id||b.sevenDay||(b.sevenDay=a),"monthly"!==d.id||b.monthly||(b.monthly=a)}return b.fiveHour||b.sevenDay||b.monthly?[b]:[]})}(a,b,c,d):[]);return{generatedAt:(0,j.i)(d.generatedAt)??null,reports:e}}(await (d&&d.expiresAt>Date.now()?Promise.resolve(d.output):e||(e=m().then(a=>(d={output:a,expiresAt:Date.now()+3e5},a)).finally(()=>{e=void 0}))),a)}let o="force-dynamic",p=/^[A-Za-z0-9._:/-]{1,200}$/;function q(a){if(null===a)return;let b=a.trim();if(b)return p.test(b)?b:void 0}async function r(a){let b=new URL(a.url).searchParams,c=b.get("provider"),d=b.get("model"),e=q(c),g=q(d);if(null!==c&&!e||null!==d&&!g)return f.NextResponse.json({error:"Invalid provider or model identifier",code:"invalid_usage_query"},{status:400});try{return f.NextResponse.json(await n({provider:e,modelId:g}))}catch{return f.NextResponse.json({error:"Provider usage is currently unavailable",code:"provider_usage_unavailable"},{status:502})}}},78335:()=>{},79588:(a,b,c)=>{"use strict";c.d(b,{F1:()=>n,wS:()=>m});var d=c(79646),e=c(29021),f=c(21820),g=c(33873);let h=null,i=0,j=null,k=0,l="win32"===process.platform?["omp.exe","omp.cmd","omp"]:["omp"];function m(){if(h&&(0,e.existsSync)(h))return h;if(h=null,Date.now()-i<3e4)return null;let a=function(){let a=process.env.OMP_WEB_OMP_BIN;if(a)return(0,e.existsSync)(a)?a:null;for(let a of(process.env.PATH??"").split(g.delimiter))if(a)for(let b of l){let c=(0,g.join)(a,b);if((0,e.existsSync)(c))return c}for(let a of["/opt/homebrew/bin","/usr/local/bin",(0,g.join)((0,f.homedir)(),".bun","bin"),(0,g.join)((0,f.homedir)(),".local","bin")])for(let b of l){let c=(0,g.join)(a,b);if((0,e.existsSync)(c))return c}return null}();return a?(h=a,i=0,a):(i=Date.now(),null)}async function n(){if(j)return j;if(Date.now()-k<3e4)return null;let a=m();if(!a)return k=Date.now(),null;try{let b=(await new Promise((b,c)=>{(0,d.execFile)(a,["--version"],{timeout:1e4,windowsHide:!0},(a,d)=>{a?c(a):b(d)})})).trim();if(b)return j=b,k=0,b}catch{}return k=Date.now(),null}},79646:a=>{"use strict";a.exports=require("child_process")},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=69594));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=2086,a.ids=[2086],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")},4984:a=>{"use strict";a.exports=require("readline")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19771:a=>{"use strict";a.exports=require("process")},20565:(a,b,c)=>{"use strict";function d(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function e(a){return"string"==typeof a?a:void 0}function f(a){return"number"==typeof a&&Number.isFinite(a)?a:void 0}c.d(b,{i:()=>f,oJ:()=>e,u4:()=>d})},21820:a=>{"use strict";a.exports=require("os")},28967:(a,b,c)=>{"use strict";function d(){return globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear()}function f(a,b){return b?{...a,modelError:b}:a}function g(a){return{...a,modelError:"Model list is temporarily unavailable. Check your configuration and try again."}}function h(a,b){var c,e,f;let g,h,i=d(),j=i.entries.get(a);if(j&&j.expiresAt>Date.now())return Promise.resolve(j.data);let k=i.inFlight.get(a)??(c=i,e=a,f=b,g=c.generation,h=Promise.resolve().then(f).then(a=>{if(c.generation===g&&c.inFlight.get(e)===h){for(c.entries.delete(e);c.entries.size>=32;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(e,{data:a,expiresAt:Date.now()+6e4})}return a}).finally(()=>{c.inFlight.get(e)===h&&c.inFlight.delete(e)}),c.inFlight.set(e,h),h);return j?(k.catch(()=>{}),Promise.resolve(j.data)):k}c.d(b,{Fw:()=>g,Mx:()=>f,kn:()=>e,rC:()=>h})},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")},36684:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/providers/enable/route",pathname:"/api/providers/enable",filename:"route",bundlePath:"app/api/providers/enable/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/providers/enable/route.ts",nextConfigOutput:"standalone",userland:()=>c(88013),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/enable/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},44870:a=>{"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")},73209:(a,b,c)=>{"use strict";c.d(b,{T4:()=>i,_6:()=>j,jd:()=>g});var d=c(21820),e=c(13798);let f=["--no-session","--no-skills","--no-lsp"];function g(){let a=globalThis.__ompUtilityRpcState;if(!a)return;a.idleTimer&&(clearTimeout(a.idleTimer),a.idleTimer=null);let b=a.proc;a.proc=null,b&&b.dispose()}async function h(a){let b=new e.XF({cwd:(0,d.homedir)(),extraArgs:f,onExit:()=>{a.proc===b&&(a.proc=null)}});try{let a=await b.waitReady(6e4);await b.negotiateProtocol(a)}catch(a){throw b.dispose(),a}return b}function i(a,b=6e4){let c=function(){if(!globalThis.__ompUtilityRpcState){globalThis.__ompUtilityRpcState={proc:null,idleTimer:null,queue:Promise.resolve()};let a=()=>g();process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__ompUtilityRpcState}(),d=c.queue.then(async()=>{c.idleTimer&&(clearTimeout(c.idleTimer),c.idleTimer=null);try{return c.proc&&c.proc.isAlive||(c.proc=await h(c)),await c.proc.sendCommand(a,b)}finally{c.idleTimer&&clearTimeout(c.idleTimer),c.idleTimer=setTimeout(()=>{c.idleTimer=null;let a=c.proc;c.proc=null,a&&a.dispose()},3e5),c.idleTimer.unref?.()}});return c.queue=d.then(()=>void 0,()=>void 0),d}async function j(a,b={}){let c=new e.XF({cwd:b.cwd??(0,d.homedir)(),extraArgs:f,env:b.env});try{let d=await c.waitReady(6e4);return await c.negotiateProtocol(d),await c.sendCommand(a,b.timeoutMs??6e4)}finally{await c.dispose()}}},78335:()=>{},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},85887:(a,b,c)=>{"use strict";c.d(b,{$M:()=>l,OK:()=>r,Pp:()=>w,Ym:()=>x,_8:()=>u,fL:()=>v,ny:()=>o,pA:()=>q,tE:()=>n,yG:()=>p});var d=c(29021),e=c(21820),f=c(33873);let g=/^[a-z0-9][a-z0-9._-]{0,63}$/,h=/^(?:CON|PRN|AUX|NUL|COM[0-9]|LPT[0-9])(?:\..*)?$/i;function i(a){let b=a?.trim();if(b&&"default"!==b){if("."===b||".."===b||b.endsWith(".")||!g.test(b)||h.test(b))throw Error(`Invalid OMP profile "${a}". Profile names must match ${g.source}, cannot be "." or "..", cannot end with ".", and cannot be a Windows reserved device name (CON, PRN, AUX, NUL, COM0-9, LPT0-9, or any of those with an extension).`);return b}}function j(){return void 0!==process.env.OMP_PROFILE?i(process.env.OMP_PROFILE):i(process.env.PI_PROFILE)}function k(){let a=f.join((0,e.homedir)(),process.env.PI_CONFIG_DIR||".omp"),b=j();return b?f.join(a,"profiles",b):a}function l(){let a=j(),b=process.env.PI_CODING_AGENT_DIR;return b&&!a?f.resolve(b):f.join(k(),"agent")}function m(a){let b=function(){let a,b;if("linux"!==process.platform&&"darwin"!==process.platform||(a=j(),(b=process.env.PI_CODING_AGENT_DIR)&&!a&&f.resolve(b)!==f.join(k(),"agent")))return;let c=process.env.XDG_DATA_HOME;if(c)try{let a=f.join(c,"omp"),b=j();if(b){let c=f.join(a,"profiles",b);return(0,d.existsSync)(c)?c:void 0}return(0,d.existsSync)(a)?a:void 0}catch{return}}();return f.join(b??l(),a)}function n(){return m("sessions")}function o(){return f.join(f.dirname(n()),"archive","sessions")}function p(){return m("blobs")}function q(){let a=l(),b=f.join(a,"config.yml");if((0,d.existsSync)(b))return b;let c=f.join(a,"config.yaml");return(0,d.existsSync)(c)?c:b}function r(){let a=l(),b=f.join(a,"models.yml");if((0,d.existsSync)(b))return b;let c=f.join(a,"models.yaml");return(0,d.existsSync)(c)?c:b}function s(a){try{return d.realpathSync.native(a)}catch{return a}}function t(a,b){let c=b.replace(/[/\\:]/g,"-");return c?a.endsWith("-")?`${a}${c}`:`${a}-${c}`:a}function u(a){let b,c=s(f.resolve(a)),d=s((0,e.homedir)()),g=s((0,e.tmpdir)()),h=f.relative(d,c),i=f.relative(g,c);return""!==h&&(h.startsWith("..")||f.isAbsolute(h))?""!==i&&(i.startsWith("..")||f.isAbsolute(i))?(b=f.resolve(c),`--${b.replace(/^[/\\]/,"").replace(/[/\\:]/g,"-")}--`):t("-tmp",i):t("-",h)}function v(){return f.join(l(),"agents")}function w(a){let b=f.resolve(a),c=(0,e.homedir)();for(;;){let a=f.join(b,".omp","agents");try{if((0,d.statSync)(a).isDirectory())return a}catch{}if((0,d.existsSync)(f.join(b,".git")))return a;if(b===c)break;let e=f.dirname(b);if(e===b)break;b=e}return f.join(f.resolve(a),".omp","agents")}function x(){return f.join((0,e.tmpdir)(),"omp-web-bundled-agents")}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87510:(a,b,c)=>{"use strict";c.d(b,{$I:()=>j,LQ:()=>m,_B:()=>k,zn:()=>l});var d=c(29021),e=c(33873),f=c(63294),g=c(85887),h=c(20565);function i(){return(0,e.join)((0,g.$M)(),"config.yml")}function j(){let a=i();if(!(0,d.existsSync)(a))return{path:a,roles:{}};let b=(0,f.Tp)((0,d.readFileSync)(a,"utf8"));if(b.errors.length>0)throw Error(`${a} is not valid YAML: ${b.errors[0].message}`);let c=b.toJS();return(0,h.u4)(c)&&(0,h.u4)(c.modelRoles)?{path:a,roles:Object.fromEntries(Object.entries(c.modelRoles).filter(a=>"string"==typeof a[1]))}:{path:a,roles:{}}}function k(a){let b=i(),c=(0,d.existsSync)(b)?(0,d.readFileSync)(b,"utf8"):"",g=(0,f.Tp)(c);if(g.errors.length>0)throw Error(`${b} is not valid YAML: ${g.errors[0].message}`);(0,d.mkdirSync)((0,e.dirname)(b),{recursive:!0});let h=`${b}.tmp-${process.pid}-${Date.now()}`;if(null===g.contents)(0,d.writeFileSync)(h,(0,f.As)({modelRoles:a}),"utf8");else{if(!(0,f.jh)(g.contents))throw Error(`${b} must contain a YAML mapping`);g.set("modelRoles",a),(0,d.writeFileSync)(h,g.toString(),"utf8")}(0,d.renameSync)(h,b)}function l(){let a=i();if(!(0,d.existsSync)(a))return new Set;let b=(0,f.Tp)((0,d.readFileSync)(a,"utf8"));if(b.errors.length>0)throw Error(`${a} is not valid YAML: ${b.errors[0].message}`);let c=b.toJS();return(0,h.u4)(c)&&Array.isArray(c.disabledProviders)?new Set(c.disabledProviders.filter(a=>"string"==typeof a)):new Set}function m(a){let b=i();if(!(0,d.existsSync)(b))return;let c=(0,f.Tp)((0,d.readFileSync)(b,"utf8"));if(c.errors.length>0)throw Error(`${b} is not valid YAML: ${c.errors[0].message}`);if(!(0,f.jh)(c.contents))throw Error(`${b} must contain a YAML mapping`);let e=c.toJS(),g=(0,h.u4)(e)&&Array.isArray(e.disabledProviders)?e.disabledProviders.filter(a=>"string"==typeof a):[],j=g.filter(b=>b!==a);if(j.length===g.length)return;c.set("disabledProviders",j);let k=`${b}.tmp-${process.pid}-${Date.now()}`;(0,d.writeFileSync)(k,c.toString(),"utf8"),(0,d.renameSync)(k,b)}},88013:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>h});var d=c(23211),e=c(28967),f=c(87510),g=c(73209);async function h(a){try{let b=await a.json();if("string"!=typeof b.provider||!b.provider.trim())return d.NextResponse.json({error:"provider is required"},{status:400});return(0,f.LQ)(b.provider),(0,e.kn)(),(0,g.jd)(),d.NextResponse.json({success:!0})}catch(a){return d.NextResponse.json({error:String(a)},{status:400})}}},91645:a=>{"use strict";a.exports=require("net")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,3294,3798],()=>b(b.s=36684));module.exports=c})();
1
+ (()=>{var a={};a.id=2086,a.ids=[2086],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")},4984:a=>{"use strict";a.exports=require("readline")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19771:a=>{"use strict";a.exports=require("process")},20565:(a,b,c)=>{"use strict";function d(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function e(a){return"string"==typeof a?a:void 0}function f(a){return"number"==typeof a&&Number.isFinite(a)?a:void 0}c.d(b,{i:()=>f,oJ:()=>e,u4:()=>d})},21820:a=>{"use strict";a.exports=require("os")},28967:(a,b,c)=>{"use strict";function d(){return globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear()}function f(a,b){return b?{...a,modelError:b}:a}function g(a){return{...a,modelError:"Model list is temporarily unavailable. Check your configuration and try again."}}function h(a,b){var c,e,f;let g,h,i=d(),j=i.entries.get(a);if(j&&j.expiresAt>Date.now())return Promise.resolve(j.data);let k=i.inFlight.get(a)??(c=i,e=a,f=b,g=c.generation,h=Promise.resolve().then(f).then(a=>{if(c.generation===g&&c.inFlight.get(e)===h){for(c.entries.delete(e);c.entries.size>=32;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(e,{data:a,expiresAt:Date.now()+6e4})}return a}).finally(()=>{c.inFlight.get(e)===h&&c.inFlight.delete(e)}),c.inFlight.set(e,h),h);return j?(k.catch(()=>{}),Promise.resolve(j.data)):k}c.d(b,{Fw:()=>g,Mx:()=>f,kn:()=>e,rC:()=>h})},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")},68972:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/providers/enable/route",pathname:"/api/providers/enable",filename:"route",bundlePath:"app/api/providers/enable/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/providers/enable/route.ts",nextConfigOutput:"standalone",userland:()=>c(88013),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/enable/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},73209:(a,b,c)=>{"use strict";c.d(b,{T4:()=>i,_6:()=>j,jd:()=>g});var d=c(21820),e=c(13798);let f=["--no-session","--no-skills","--no-lsp"];function g(){let a=globalThis.__ompUtilityRpcState;if(!a)return;a.idleTimer&&(clearTimeout(a.idleTimer),a.idleTimer=null);let b=a.proc;a.proc=null,b&&b.dispose()}async function h(a){let b=new e.XF({cwd:(0,d.homedir)(),extraArgs:f,onExit:()=>{a.proc===b&&(a.proc=null)}});try{let a=await b.waitReady(6e4);await b.negotiateProtocol(a)}catch(a){throw b.dispose(),a}return b}function i(a,b=6e4){let c=function(){if(!globalThis.__ompUtilityRpcState){globalThis.__ompUtilityRpcState={proc:null,idleTimer:null,queue:Promise.resolve()};let a=()=>g();process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__ompUtilityRpcState}(),d=c.queue.then(async()=>{c.idleTimer&&(clearTimeout(c.idleTimer),c.idleTimer=null);try{return c.proc&&c.proc.isAlive||(c.proc=await h(c)),await c.proc.sendCommand(a,b)}finally{c.idleTimer&&clearTimeout(c.idleTimer),c.idleTimer=setTimeout(()=>{c.idleTimer=null;let a=c.proc;c.proc=null,a&&a.dispose()},3e5),c.idleTimer.unref?.()}});return c.queue=d.then(()=>void 0,()=>void 0),d}async function j(a,b={}){let c=new e.XF({cwd:b.cwd??(0,d.homedir)(),extraArgs:f,env:b.env});try{let d=await c.waitReady(6e4);return await c.negotiateProtocol(d),await c.sendCommand(a,b.timeoutMs??6e4)}finally{await c.dispose()}}},78335:()=>{},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},85887:(a,b,c)=>{"use strict";c.d(b,{$M:()=>l,OK:()=>r,Pp:()=>w,Ym:()=>x,_8:()=>u,fL:()=>v,ny:()=>o,pA:()=>q,tE:()=>n,yG:()=>p});var d=c(29021),e=c(21820),f=c(33873);let g=/^[a-z0-9][a-z0-9._-]{0,63}$/,h=/^(?:CON|PRN|AUX|NUL|COM[0-9]|LPT[0-9])(?:\..*)?$/i;function i(a){let b=a?.trim();if(b&&"default"!==b){if("."===b||".."===b||b.endsWith(".")||!g.test(b)||h.test(b))throw Error(`Invalid OMP profile "${a}". Profile names must match ${g.source}, cannot be "." or "..", cannot end with ".", and cannot be a Windows reserved device name (CON, PRN, AUX, NUL, COM0-9, LPT0-9, or any of those with an extension).`);return b}}function j(){return void 0!==process.env.OMP_PROFILE?i(process.env.OMP_PROFILE):i(process.env.PI_PROFILE)}function k(){let a=f.join((0,e.homedir)(),process.env.PI_CONFIG_DIR||".omp"),b=j();return b?f.join(a,"profiles",b):a}function l(){let a=j(),b=process.env.PI_CODING_AGENT_DIR;return b&&!a?f.resolve(b):f.join(k(),"agent")}function m(a){let b=function(){let a,b;if("linux"!==process.platform&&"darwin"!==process.platform||(a=j(),(b=process.env.PI_CODING_AGENT_DIR)&&!a&&f.resolve(b)!==f.join(k(),"agent")))return;let c=process.env.XDG_DATA_HOME;if(c)try{let a=f.join(c,"omp"),b=j();if(b){let c=f.join(a,"profiles",b);return(0,d.existsSync)(c)?c:void 0}return(0,d.existsSync)(a)?a:void 0}catch{return}}();return f.join(b??l(),a)}function n(){return m("sessions")}function o(){return f.join(f.dirname(n()),"archive","sessions")}function p(){return m("blobs")}function q(){let a=l(),b=f.join(a,"config.yml");if((0,d.existsSync)(b))return b;let c=f.join(a,"config.yaml");return(0,d.existsSync)(c)?c:b}function r(){let a=l(),b=f.join(a,"models.yml");if((0,d.existsSync)(b))return b;let c=f.join(a,"models.yaml");return(0,d.existsSync)(c)?c:b}function s(a){try{return d.realpathSync.native(a)}catch{return a}}function t(a,b){let c=b.replace(/[/\\:]/g,"-");return c?a.endsWith("-")?`${a}${c}`:`${a}-${c}`:a}function u(a){let b,c=s(f.resolve(a)),d=s((0,e.homedir)()),g=s((0,e.tmpdir)()),h=f.relative(d,c),i=f.relative(g,c);return""!==h&&(h.startsWith("..")||f.isAbsolute(h))?""!==i&&(i.startsWith("..")||f.isAbsolute(i))?(b=f.resolve(c),`--${b.replace(/^[/\\]/,"").replace(/[/\\:]/g,"-")}--`):t("-tmp",i):t("-",h)}function v(){return f.join(l(),"agents")}function w(a){let b=f.resolve(a),c=(0,e.homedir)();for(;;){let a=f.join(b,".omp","agents");try{if((0,d.statSync)(a).isDirectory())return a}catch{}if((0,d.existsSync)(f.join(b,".git")))return a;if(b===c)break;let e=f.dirname(b);if(e===b)break;b=e}return f.join(f.resolve(a),".omp","agents")}function x(){return f.join((0,e.tmpdir)(),"omp-web-bundled-agents")}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87510:(a,b,c)=>{"use strict";c.d(b,{$I:()=>j,LQ:()=>m,_B:()=>k,zn:()=>l});var d=c(29021),e=c(33873),f=c(63294),g=c(85887),h=c(20565);function i(){return(0,e.join)((0,g.$M)(),"config.yml")}function j(){let a=i();if(!(0,d.existsSync)(a))return{path:a,roles:{}};let b=(0,f.Tp)((0,d.readFileSync)(a,"utf8"));if(b.errors.length>0)throw Error(`${a} is not valid YAML: ${b.errors[0].message}`);let c=b.toJS();return(0,h.u4)(c)&&(0,h.u4)(c.modelRoles)?{path:a,roles:Object.fromEntries(Object.entries(c.modelRoles).filter(a=>"string"==typeof a[1]))}:{path:a,roles:{}}}function k(a){let b=i(),c=(0,d.existsSync)(b)?(0,d.readFileSync)(b,"utf8"):"",g=(0,f.Tp)(c);if(g.errors.length>0)throw Error(`${b} is not valid YAML: ${g.errors[0].message}`);(0,d.mkdirSync)((0,e.dirname)(b),{recursive:!0});let h=`${b}.tmp-${process.pid}-${Date.now()}`;if(null===g.contents)(0,d.writeFileSync)(h,(0,f.As)({modelRoles:a}),"utf8");else{if(!(0,f.jh)(g.contents))throw Error(`${b} must contain a YAML mapping`);g.set("modelRoles",a),(0,d.writeFileSync)(h,g.toString(),"utf8")}(0,d.renameSync)(h,b)}function l(){let a=i();if(!(0,d.existsSync)(a))return new Set;let b=(0,f.Tp)((0,d.readFileSync)(a,"utf8"));if(b.errors.length>0)throw Error(`${a} is not valid YAML: ${b.errors[0].message}`);let c=b.toJS();return(0,h.u4)(c)&&Array.isArray(c.disabledProviders)?new Set(c.disabledProviders.filter(a=>"string"==typeof a)):new Set}function m(a){let b=i();if(!(0,d.existsSync)(b))return;let c=(0,f.Tp)((0,d.readFileSync)(b,"utf8"));if(c.errors.length>0)throw Error(`${b} is not valid YAML: ${c.errors[0].message}`);if(!(0,f.jh)(c.contents))throw Error(`${b} must contain a YAML mapping`);let e=c.toJS(),g=(0,h.u4)(e)&&Array.isArray(e.disabledProviders)?e.disabledProviders.filter(a=>"string"==typeof a):[],j=g.filter(b=>b!==a);if(j.length===g.length)return;c.set("disabledProviders",j);let k=`${b}.tmp-${process.pid}-${Date.now()}`;(0,d.writeFileSync)(k,c.toString(),"utf8"),(0,d.renameSync)(k,b)}},88013:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>h});var d=c(23211),e=c(28967),f=c(87510),g=c(73209);async function h(a){try{let b=await a.json();if("string"!=typeof b.provider||!b.provider.trim())return d.NextResponse.json({error:"provider is required"},{status:400});return(0,f.LQ)(b.provider),(0,e.kn)(),(0,g.jd)(),d.NextResponse.json({success:!0})}catch(a){return d.NextResponse.json({error:String(a)},{status:400})}}},91645:a=>{"use strict";a.exports=require("net")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,3294,3798],()=>b(b.s=68972));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=2246,a.ids=[2246],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},9153:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,PUT:()=>h,dynamic:()=>f});var d=c(23211),e=c(87831);let f="force-dynamic";async function g(){let a=await (0,e.Cn)(),b=await (0,e.qM)();return d.NextResponse.json({config:(0,e.li)(),detection:a,effective:b})}async function h(a){let b=await a.json().catch(()=>({})),c=b.mode;if("auto"!==c&&"manual"!==c&&"off"!==c)return d.NextResponse.json({error:"mode must be auto|manual|off",code:"invalid_mode"},{status:400});if("manual"===c){if("string"!=typeof b.url||!b.url.trim())return d.NextResponse.json({error:"url required in manual mode",code:"missing_url"},{status:400});try{let a=new URL(b.url);if("http:"!==a.protocol&&"https:"!==a.protocol)throw Error("protocol");if(!a.port)throw Error("port")}catch{return d.NextResponse.json({error:"url must be http(s)://host:port",code:"invalid_url"},{status:400})}}let f="manual"===c&&"string"==typeof b.url?b.url.trim():void 0;(0,e.qt)({mode:c,url:f});let g=await (0,e.Cn)(),h=await (0,e.qM)();return d.NextResponse.json({ok:!0,config:(0,e.li)(),detection:g,effective:h})}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32360:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/proxy/route",pathname:"/api/proxy",filename:"route",bundlePath:"app/api/proxy/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/proxy/route.ts",nextConfigOutput:"standalone",userland:()=>c(9153),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/proxy/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},33873:a=>{"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")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87831:(a,b,c)=>{"use strict";c.d(b,{Cn:()=>o,cS:()=>q,li:()=>l,qM:()=>p,qt:()=>m});var d=c(79646),e=c(29021),f=c(21820),g=c(33873),h=c(91645),i=c.n(h);let j=(0,g.join)((0,f.homedir)(),".omp","agent","proxy.json"),k=[7890,7897,1087,1080,8118,8888];function l(){try{let a=JSON.parse((0,e.readFileSync)(j,"utf8"));if("auto"===a.mode||"manual"===a.mode||"off"===a.mode)return{mode:a.mode,url:"string"==typeof a.url?a.url:void 0}}catch{}return{mode:"auto"}}function m(a){(0,e.mkdirSync)((0,g.dirname)(j),{recursive:!0});let b=`${j}.tmp-${process.pid}`;(0,e.writeFileSync)(b,JSON.stringify(a,null,2)+"\n"),(0,e.renameSync)(b,j)}function n(a,b="127.0.0.1",c=400){return new Promise(d=>{let e=new(i()).Socket,f=a=>{e.destroy(),d(a)};e.setTimeout(c),e.once("connect",()=>f(!0)),e.once("timeout",()=>f(!1)),e.once("error",()=>f(!1)),e.connect(a,b)})}async function o(){let a=[];for(let b of function(){let a=process.platform;try{if("darwin"===a){let a=(0,d.execFileSync)("scutil",["--proxy"],{encoding:"utf8",timeout:3e3}),b=[],c=/HTTPProxy\s*:\s*(\S+)/.exec(a)?.[1],e=/HTTPPort\s*:\s*(\d+)/.exec(a)?.[1],f=/HTTPSProxy\s*:\s*(\S+)/.exec(a)?.[1],g=/HTTPSPort\s*:\s*(\d+)/.exec(a)?.[1];return c&&e&&b.push({url:`http://${c}:${e}`,source:"system-http"}),f&&g&&b.push({url:`http://${f}:${g}`,source:"system-https"}),b}if("win32"===a){let a=(0,d.execFileSync)("reg",["query","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"],{encoding:"utf8",timeout:3e3}),b=/ProxyEnable\s+REG_DWORD\s+0x(\d+)/i.exec(a)?.[1];if("1"===b){let b=/ProxyServer\s+REG_SZ\s+(\S+)/i.exec(a)?.[1];if(b)return[{url:/^https?:\/\//i.test(b)?b:`http://${b}`,source:"system-proxy"}]}return[]}if("linux"===a){let a=[];for(let b of["HTTPS_PROXY","https_proxy","HTTP_PROXY","http_proxy"]){let c=process.env[b];if(c){let b=/^https?:\/\//i.test(c)?c:`http://${c}`;a.some(a=>a.url===b)||a.push({url:b,source:"env"})}}try{let b=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy","mode"],{encoding:"utf8",timeout:2e3}).trim();if("'manual'"===b){let b=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy.http","host"],{encoding:"utf8",timeout:2e3}).trim().replace(/^'|'$/g,""),c=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy.http","port"],{encoding:"utf8",timeout:2e3}).trim();b&&c&&a.push({url:`http://${b}:${c}`,source:"gnome"})}}catch{}return a}}catch{}return[]}())await n(Number(new URL(b.url).port))&&a.push(b);for(let b of k)if(await n(b)){let c=`http://127.0.0.1:${b}`;a.some(a=>a.url===c)||a.push({url:c,source:"local-port"})}let b=l(),c=!1;if("manual"===b.mode&&b.url)try{let a=Number(new URL(b.url).port);c=await n(a,new URL(b.url).hostname)}catch{c=!1}let e=a[0]?.url??(c&&b.url?b.url:null);return{candidates:a,recommended:e,manualReachable:c}}async function p(){let a=l();if("off"===a.mode)return null;if("manual"===a.mode){if(!a.url)return null;try{let b=Number(new URL(a.url).port);return await n(b,new URL(a.url).hostname)?a.url:null}catch{return null}}return(await o()).recommended}function q(a){return a?{HTTP_PROXY:a,HTTPS_PROXY:a,ALL_PROXY:a,http_proxy:a,https_proxy:a,all_proxy:a}:{}}},91645:a=>{"use strict";a.exports=require("net")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=32360));module.exports=c})();
1
+ (()=>{var a={};a.id=2246,a.ids=[2246],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},9153:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,PUT:()=>h,dynamic:()=>f});var d=c(23211),e=c(87831);let f="force-dynamic";async function g(){let a=await (0,e.Cn)(),b=await (0,e.qM)();return d.NextResponse.json({config:(0,e.li)(),detection:a,effective:b})}async function h(a){let b=await a.json().catch(()=>({})),c=b.mode;if("auto"!==c&&"manual"!==c&&"off"!==c)return d.NextResponse.json({error:"mode must be auto|manual|off",code:"invalid_mode"},{status:400});if("manual"===c){if("string"!=typeof b.url||!b.url.trim())return d.NextResponse.json({error:"url required in manual mode",code:"missing_url"},{status:400});try{let a=new URL(b.url);if("http:"!==a.protocol&&"https:"!==a.protocol)throw Error("protocol");if(!a.port)throw Error("port")}catch{return d.NextResponse.json({error:"url must be http(s)://host:port",code:"invalid_url"},{status:400})}}let f="manual"===c&&"string"==typeof b.url?b.url.trim():void 0;(0,e.qt)({mode:c,url:f});let g=await (0,e.Cn)(),h=await (0,e.qM)();return d.NextResponse.json({ok:!0,config:(0,e.li)(),detection:g,effective:h})}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},59824:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/proxy/route",pathname:"/api/proxy",filename:"route",bundlePath:"app/api/proxy/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/proxy/route.ts",nextConfigOutput:"standalone",userland:()=>c(9153),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/proxy/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87831:(a,b,c)=>{"use strict";c.d(b,{Cn:()=>o,cS:()=>q,li:()=>l,qM:()=>p,qt:()=>m});var d=c(79646),e=c(29021),f=c(21820),g=c(33873),h=c(91645),i=c.n(h);let j=(0,g.join)((0,f.homedir)(),".omp","agent","proxy.json"),k=[7890,7897,1087,1080,8118,8888];function l(){try{let a=JSON.parse((0,e.readFileSync)(j,"utf8"));if("auto"===a.mode||"manual"===a.mode||"off"===a.mode)return{mode:a.mode,url:"string"==typeof a.url?a.url:void 0}}catch{}return{mode:"auto"}}function m(a){(0,e.mkdirSync)((0,g.dirname)(j),{recursive:!0});let b=`${j}.tmp-${process.pid}`;(0,e.writeFileSync)(b,JSON.stringify(a,null,2)+"\n"),(0,e.renameSync)(b,j)}function n(a,b="127.0.0.1",c=400){return new Promise(d=>{let e=new(i()).Socket,f=a=>{e.destroy(),d(a)};e.setTimeout(c),e.once("connect",()=>f(!0)),e.once("timeout",()=>f(!1)),e.once("error",()=>f(!1)),e.connect(a,b)})}async function o(){let a=[];for(let b of function(){let a=process.platform;try{if("darwin"===a){let a=(0,d.execFileSync)("scutil",["--proxy"],{encoding:"utf8",timeout:3e3}),b=[],c=/HTTPProxy\s*:\s*(\S+)/.exec(a)?.[1],e=/HTTPPort\s*:\s*(\d+)/.exec(a)?.[1],f=/HTTPSProxy\s*:\s*(\S+)/.exec(a)?.[1],g=/HTTPSPort\s*:\s*(\d+)/.exec(a)?.[1];return c&&e&&b.push({url:`http://${c}:${e}`,source:"system-http"}),f&&g&&b.push({url:`http://${f}:${g}`,source:"system-https"}),b}if("win32"===a){let a=(0,d.execFileSync)("reg",["query","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"],{encoding:"utf8",timeout:3e3}),b=/ProxyEnable\s+REG_DWORD\s+0x(\d+)/i.exec(a)?.[1];if("1"===b){let b=/ProxyServer\s+REG_SZ\s+(\S+)/i.exec(a)?.[1];if(b)return[{url:/^https?:\/\//i.test(b)?b:`http://${b}`,source:"system-proxy"}]}return[]}if("linux"===a){let a=[];for(let b of["HTTPS_PROXY","https_proxy","HTTP_PROXY","http_proxy"]){let c=process.env[b];if(c){let b=/^https?:\/\//i.test(c)?c:`http://${c}`;a.some(a=>a.url===b)||a.push({url:b,source:"env"})}}try{let b=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy","mode"],{encoding:"utf8",timeout:2e3}).trim();if("'manual'"===b){let b=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy.http","host"],{encoding:"utf8",timeout:2e3}).trim().replace(/^'|'$/g,""),c=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy.http","port"],{encoding:"utf8",timeout:2e3}).trim();b&&c&&a.push({url:`http://${b}:${c}`,source:"gnome"})}}catch{}return a}}catch{}return[]}())await n(Number(new URL(b.url).port))&&a.push(b);for(let b of k)if(await n(b)){let c=`http://127.0.0.1:${b}`;a.some(a=>a.url===c)||a.push({url:c,source:"local-port"})}let b=l(),c=!1;if("manual"===b.mode&&b.url)try{let a=Number(new URL(b.url).port);c=await n(a,new URL(b.url).hostname)}catch{c=!1}let e=a[0]?.url??(c&&b.url?b.url:null);return{candidates:a,recommended:e,manualReachable:c}}async function p(){let a=l();if("off"===a.mode)return null;if("manual"===a.mode){if(!a.url)return null;try{let b=Number(new URL(a.url).port);return await n(b,new URL(a.url).hostname)?a.url:null}catch{return null}}return(await o()).recommended}function q(a){return a?{HTTP_PROXY:a,HTTPS_PROXY:a,ALL_PROXY:a,http_proxy:a,https_proxy:a,all_proxy:a}:{}}},91645:a=>{"use strict";a.exports=require("net")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=59824));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=7513,a.ids=[7513],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},42290:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/reveal/route",pathname:"/api/reveal",filename:"route",bundlePath:"app/api/reveal/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/reveal/route.ts",nextConfigOutput:"standalone",userland:()=>c(75715),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/reveal/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{a.exports=require("zlib")},75715:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>j});var d=c(23211),e=c(79646),f=c(29021),g=c(80547);function h(a){return`'${a.replace(/'/g,"'\\''")}'`}function i(a){return`"${a.replace(/"/g,'""')}"`}let j="force-dynamic";async function k(a){try{let b,c,j=await a.json().catch(()=>({})),k="string"==typeof j?.path?j.path:"";if(!k)return d.NextResponse.json({error:"Missing path",code:"missing_path"},{status:400});let l=await (0,g.mc)();if(!(0,g.B7)(k,l))return d.NextResponse.json({error:"Path not allowed",code:"path_not_allowed"},{status:403});try{b=(0,f.statSync)(k)}catch{return d.NextResponse.json({error:"Path does not exist",code:"path_not_found"},{status:404})}try{c=function(a,b,c){if("darwin"===a)return c?`open ${h(b)}`:`open -R ${h(b)}`;if("win32"===a)return c?`explorer ${i(b)}`:`explorer /select,${i(b)}`;if("linux"===a){if(c)return`xdg-open ${h(b)}`;let a=b.lastIndexOf("/"),d=-1===a?".":0===a?"/":b.slice(0,a);return`xdg-open ${h(d)}`}throw Error(`unsupported platform: ${a}`)}(process.platform,k,b.isDirectory())}catch{return d.NextResponse.json({error:`Reveal unsupported on ${process.platform}`,code:"unsupported_platform"},{status:501})}let m="win32"===process.platform;return await new Promise((a,b)=>{(0,e.exec)(c,{timeout:8e3},c=>{c&&!m?b(c):a()})}),d.NextResponse.json({ok:!0,path:k})}catch(b){let a=b instanceof Error?b.message:"Failed to reveal path";return d.NextResponse.json({error:a,code:"reveal_failed"},{status:500})}}},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,4509],()=>b(b.s=42290));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=7513,a.ids=[7513],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49118:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/reveal/route",pathname:"/api/reveal",filename:"route",bundlePath:"app/api/reveal/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/reveal/route.ts",nextConfigOutput:"standalone",userland:()=>c(75715),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/reveal/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{a.exports=require("zlib")},75715:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>j});var d=c(23211),e=c(79646),f=c(29021),g=c(80547);function h(a){return`'${a.replace(/'/g,"'\\''")}'`}function i(a){return`"${a.replace(/"/g,'""')}"`}let j="force-dynamic";async function k(a){try{let b,c,j=await a.json().catch(()=>({})),k="string"==typeof j?.path?j.path:"";if(!k)return d.NextResponse.json({error:"Missing path",code:"missing_path"},{status:400});let l=await (0,g.mc)();if(!(0,g.B7)(k,l))return d.NextResponse.json({error:"Path not allowed",code:"path_not_allowed"},{status:403});try{b=(0,f.statSync)(k)}catch{return d.NextResponse.json({error:"Path does not exist",code:"path_not_found"},{status:404})}try{c=function(a,b,c){if("darwin"===a)return c?`open ${h(b)}`:`open -R ${h(b)}`;if("win32"===a)return c?`explorer ${i(b)}`:`explorer /select,${i(b)}`;if("linux"===a){if(c)return`xdg-open ${h(b)}`;let a=b.lastIndexOf("/"),d=-1===a?".":0===a?"/":b.slice(0,a);return`xdg-open ${h(d)}`}throw Error(`unsupported platform: ${a}`)}(process.platform,k,b.isDirectory())}catch{return d.NextResponse.json({error:`Reveal unsupported on ${process.platform}`,code:"unsupported_platform"},{status:501})}let m="win32"===process.platform;return await new Promise((a,b)=>{(0,e.exec)(c,{timeout:8e3},c=>{c&&!m?b(c):a()})}),d.NextResponse.json({ok:!0,path:k})}catch(b){let a=b instanceof Error?b.message:"Failed to reveal path";return d.NextResponse.json({error:a,code:"reveal_failed"},{status:500})}}},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,4509],()=>b(b.s=49118));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=118,a.ids=[118],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1456:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/scripts/route",pathname:"/api/scripts",filename:"route",bundlePath:"app/api/scripts/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/scripts/route.ts",nextConfigOutput:"standalone",userland:()=>c(10827),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/scripts/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10827:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>p,PUT:()=>q,dynamic:()=>n});var d=c(23211),e=c(24923),f=c(29021),g=c(33873),h=c(21820);let i=["play","rocket","wrench"],j=(0,g.join)((0,h.homedir)(),".omp","agent","scripts.json");function k(a){if(!Array.isArray(a))return null;let b=[];for(let c of a){if(!c||"object"!=typeof c)return null;let a=c.name,d=c.command;if("string"!=typeof a||!a.trim()||"string"!=typeof d||!d.trim())return null;let e=c.icon;b.push({name:a.trim(),command:d.trim(),..."string"==typeof c.description?{description:c.description}:{},..."string"==typeof e&&i.includes(e)?{icon:e}:{}})}return b}function l(a){try{let b=JSON.parse((0,f.readFileSync)(a,"utf8"));return k(b.scripts)??[]}catch{return[]}}var m=c(80547);let n="force-dynamic";async function o(a){let b=await (0,e.KI)(a),c=await (0,m.mc)();return(0,m.B7)(b.projectRoot,c)?{projectRoot:b.projectRoot}:{response:d.NextResponse.json({error:"Path not allowed",code:"path_not_allowed"},{status:403})}}async function p(a){let b=new URL(a.url).searchParams.get("cwd");if(!b)return d.NextResponse.json({error:"Missing cwd",code:"missing_cwd"},{status:400});try{let a=await o(b);if("response"in a)return a.response;return d.NextResponse.json({scripts:function(a){let b=new Map;for(let a of l(j))b.set(a.name,a);for(let c of l((0,g.join)(a,".omp","scripts.json")))b.set(c.name,c);return[...b.values()]}(a.projectRoot)})}catch(b){let a=b instanceof Error?b.message:"Failed to list scripts";return d.NextResponse.json({error:a,code:"scripts_list_failed"},{status:500})}}async function q(a){let b=new URL(a.url).searchParams.get("cwd");if(!b)return d.NextResponse.json({error:"Missing cwd",code:"missing_cwd"},{status:400});try{let c=await a.json().catch(()=>({})),e=k(c.scripts);if(!e)return d.NextResponse.json({error:"scripts must be an array of {name, command}",code:"invalid_scripts"},{status:400});let h=await o(b);if("response"in h)return h.response;return!function(a,b){let c,d,e=(0,g.join)(a,".omp","scripts.json");if(0===b.length){try{(0,f.existsSync)(e)&&(0,f.writeFileSync)(e,JSON.stringify({scripts:[]},null,2)+"\n")}catch{}return}c=(0,g.dirname)(e),(0,f.mkdirSync)(c,{recursive:!0}),d=`${e}.tmp-${process.pid}`,(0,f.writeFileSync)(d,JSON.stringify({scripts:b},null,2)+"\n"),(0,f.renameSync)(d,e)}(h.projectRoot,e),d.NextResponse.json({ok:!0,scripts:e})}catch(b){let a=b instanceof Error?b.message:"Failed to save scripts";return d.NextResponse.json({error:a,code:"scripts_save_failed"},{status:500})}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{a.exports=require("zlib")},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,4509],()=>b(b.s=1456));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=118,a.ids=[118],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10827:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>p,PUT:()=>q,dynamic:()=>n});var d=c(23211),e=c(24923),f=c(29021),g=c(33873),h=c(21820);let i=["play","rocket","wrench"],j=(0,g.join)((0,h.homedir)(),".omp","agent","scripts.json");function k(a){if(!Array.isArray(a))return null;let b=[];for(let c of a){if(!c||"object"!=typeof c)return null;let a=c.name,d=c.command;if("string"!=typeof a||!a.trim()||"string"!=typeof d||!d.trim())return null;let e=c.icon;b.push({name:a.trim(),command:d.trim(),..."string"==typeof c.description?{description:c.description}:{},..."string"==typeof e&&i.includes(e)?{icon:e}:{}})}return b}function l(a){try{let b=JSON.parse((0,f.readFileSync)(a,"utf8"));return k(b.scripts)??[]}catch{return[]}}var m=c(80547);let n="force-dynamic";async function o(a){let b=await (0,e.KI)(a),c=await (0,m.mc)();return(0,m.B7)(b.projectRoot,c)?{projectRoot:b.projectRoot}:{response:d.NextResponse.json({error:"Path not allowed",code:"path_not_allowed"},{status:403})}}async function p(a){let b=new URL(a.url).searchParams.get("cwd");if(!b)return d.NextResponse.json({error:"Missing cwd",code:"missing_cwd"},{status:400});try{let a=await o(b);if("response"in a)return a.response;return d.NextResponse.json({scripts:function(a){let b=new Map;for(let a of l(j))b.set(a.name,a);for(let c of l((0,g.join)(a,".omp","scripts.json")))b.set(c.name,c);return[...b.values()]}(a.projectRoot)})}catch(b){let a=b instanceof Error?b.message:"Failed to list scripts";return d.NextResponse.json({error:a,code:"scripts_list_failed"},{status:500})}}async function q(a){let b=new URL(a.url).searchParams.get("cwd");if(!b)return d.NextResponse.json({error:"Missing cwd",code:"missing_cwd"},{status:400});try{let c=await a.json().catch(()=>({})),e=k(c.scripts);if(!e)return d.NextResponse.json({error:"scripts must be an array of {name, command}",code:"invalid_scripts"},{status:400});let h=await o(b);if("response"in h)return h.response;return!function(a,b){let c,d,e=(0,g.join)(a,".omp","scripts.json");if(0===b.length){try{(0,f.existsSync)(e)&&(0,f.writeFileSync)(e,JSON.stringify({scripts:[]},null,2)+"\n")}catch{}return}c=(0,g.dirname)(e),(0,f.mkdirSync)(c,{recursive:!0}),d=`${e}.tmp-${process.pid}`,(0,f.writeFileSync)(d,JSON.stringify({scripts:b},null,2)+"\n"),(0,f.renameSync)(d,e)}(h.projectRoot,e),d.NextResponse.json({ok:!0,scripts:e})}catch(b){let a=b instanceof Error?b.message:"Failed to save scripts";return d.NextResponse.json({error:a,code:"scripts_save_failed"},{status:500})}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{a.exports=require("zlib")},79646:a=>{a.exports=require("child_process")},85976:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/scripts/route",pathname:"/api/scripts",filename:"route",bundlePath:"app/api/scripts/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/scripts/route.ts",nextConfigOutput:"standalone",userland:()=>c(10827),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/scripts/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,4509],()=>b(b.s=85976));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=1952,a.ids=[1952],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},26847:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>l,dynamic:()=>k});var d=c(23211),e=c(79646),f=c(29021),g=c(33873),h=c(24923),i=c(80547),j=c(87831);let k="force-dynamic";async function l(a){try{let b=await a.json().catch(()=>({}));if("string"!=typeof b.cwd||"string"!=typeof b.command||!b.command.trim())return d.NextResponse.json({error:"cwd and command are required",code:"invalid_request"},{status:400});let c="detach"===b.mode?"detach":"wait",k=b.command,l=b.cwd,m=await (0,h.KI)(l),n=await (0,i.mc)();if(!(0,i.B7)(m.projectRoot,n))return d.NextResponse.json({error:"Path not allowed",code:"path_not_allowed"},{status:403});if("detach"===c){let a=(0,g.join)(m.projectRoot,".omp","scripts-logs",`${Date.now()}.log`);(0,f.mkdirSync)((0,g.dirname)(a),{recursive:!0});let b=(0,f.openSync)(a,"a"),c=(0,e.spawn)(k,{cwd:m.projectRoot,shell:!0,detached:!0,stdio:["ignore",b,b],env:{...process.env,...(0,j.cS)(process.env.OMP_WEB_PROXY_URL||null)}});return c.unref(),d.NextResponse.json({ok:!0,mode:"detach",pid:c.pid,logPath:a})}return await new Promise(a=>{let b=(0,e.spawn)(k,{cwd:m.projectRoot,shell:!0,env:{...process.env,...(0,j.cS)(process.env.OMP_WEB_PROXY_URL||null)}}),c="",f=!1,g=(b,e)=>{f||(f=!0,a(d.NextResponse.json({ok:!0,mode:"wait",exitCode:b,timedOut:e,output:c})))},h=setTimeout(()=>{try{b.kill("SIGTERM")}catch{}g(null,!0)},6e4);b.stdout?.on("data",a=>{c.length<20480&&(c+=a.toString())}),b.stderr?.on("data",a=>{c.length<20480&&(c+=a.toString())}),b.on("error",a=>{clearTimeout(h),g(null,!1)}),b.on("exit",a=>{clearTimeout(h),g(a,!1)})})}catch(b){let a=b instanceof Error?b.message:"Script execution failed";return d.NextResponse.json({error:a,code:"script_run_failed"},{status:500})}}},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},53224:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/scripts/run/route",pathname:"/api/scripts/run",filename:"route",bundlePath:"app/api/scripts/run/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/scripts/run/route.ts",nextConfigOutput:"standalone",userland:()=>c(26847),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/scripts/run/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{a.exports=require("zlib")},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87831:(a,b,c)=>{c.d(b,{Cn:()=>o,cS:()=>q,li:()=>l,qM:()=>p,qt:()=>m});var d=c(79646),e=c(29021),f=c(21820),g=c(33873),h=c(91645),i=c.n(h);let j=(0,g.join)((0,f.homedir)(),".omp","agent","proxy.json"),k=[7890,7897,1087,1080,8118,8888];function l(){try{let a=JSON.parse((0,e.readFileSync)(j,"utf8"));if("auto"===a.mode||"manual"===a.mode||"off"===a.mode)return{mode:a.mode,url:"string"==typeof a.url?a.url:void 0}}catch{}return{mode:"auto"}}function m(a){(0,e.mkdirSync)((0,g.dirname)(j),{recursive:!0});let b=`${j}.tmp-${process.pid}`;(0,e.writeFileSync)(b,JSON.stringify(a,null,2)+"\n"),(0,e.renameSync)(b,j)}function n(a,b="127.0.0.1",c=400){return new Promise(d=>{let e=new(i()).Socket,f=a=>{e.destroy(),d(a)};e.setTimeout(c),e.once("connect",()=>f(!0)),e.once("timeout",()=>f(!1)),e.once("error",()=>f(!1)),e.connect(a,b)})}async function o(){let a=[];for(let b of function(){let a=process.platform;try{if("darwin"===a){let a=(0,d.execFileSync)("scutil",["--proxy"],{encoding:"utf8",timeout:3e3}),b=[],c=/HTTPProxy\s*:\s*(\S+)/.exec(a)?.[1],e=/HTTPPort\s*:\s*(\d+)/.exec(a)?.[1],f=/HTTPSProxy\s*:\s*(\S+)/.exec(a)?.[1],g=/HTTPSPort\s*:\s*(\d+)/.exec(a)?.[1];return c&&e&&b.push({url:`http://${c}:${e}`,source:"system-http"}),f&&g&&b.push({url:`http://${f}:${g}`,source:"system-https"}),b}if("win32"===a){let a=(0,d.execFileSync)("reg",["query","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"],{encoding:"utf8",timeout:3e3}),b=/ProxyEnable\s+REG_DWORD\s+0x(\d+)/i.exec(a)?.[1];if("1"===b){let b=/ProxyServer\s+REG_SZ\s+(\S+)/i.exec(a)?.[1];if(b)return[{url:/^https?:\/\//i.test(b)?b:`http://${b}`,source:"system-proxy"}]}return[]}if("linux"===a){let a=[];for(let b of["HTTPS_PROXY","https_proxy","HTTP_PROXY","http_proxy"]){let c=process.env[b];if(c){let b=/^https?:\/\//i.test(c)?c:`http://${c}`;a.some(a=>a.url===b)||a.push({url:b,source:"env"})}}try{let b=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy","mode"],{encoding:"utf8",timeout:2e3}).trim();if("'manual'"===b){let b=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy.http","host"],{encoding:"utf8",timeout:2e3}).trim().replace(/^'|'$/g,""),c=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy.http","port"],{encoding:"utf8",timeout:2e3}).trim();b&&c&&a.push({url:`http://${b}:${c}`,source:"gnome"})}}catch{}return a}}catch{}return[]}())await n(Number(new URL(b.url).port))&&a.push(b);for(let b of k)if(await n(b)){let c=`http://127.0.0.1:${b}`;a.some(a=>a.url===c)||a.push({url:c,source:"local-port"})}let b=l(),c=!1;if("manual"===b.mode&&b.url)try{let a=Number(new URL(b.url).port);c=await n(a,new URL(b.url).hostname)}catch{c=!1}let e=a[0]?.url??(c&&b.url?b.url:null);return{candidates:a,recommended:e,manualReachable:c}}async function p(){let a=l();if("off"===a.mode)return null;if("manual"===a.mode){if(!a.url)return null;try{let b=Number(new URL(a.url).port);return await n(b,new URL(a.url).hostname)?a.url:null}catch{return null}}return(await o()).recommended}function q(a){return a?{HTTP_PROXY:a,HTTPS_PROXY:a,ALL_PROXY:a,http_proxy:a,https_proxy:a,all_proxy:a}:{}}},91645:a=>{a.exports=require("net")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,4509],()=>b(b.s=53224));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=1952,a.ids=[1952],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},26847:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>l,dynamic:()=>k});var d=c(23211),e=c(79646),f=c(29021),g=c(33873),h=c(24923),i=c(80547),j=c(87831);let k="force-dynamic";async function l(a){try{let b=await a.json().catch(()=>({}));if("string"!=typeof b.cwd||"string"!=typeof b.command||!b.command.trim())return d.NextResponse.json({error:"cwd and command are required",code:"invalid_request"},{status:400});let c="detach"===b.mode?"detach":"wait",k=b.command,l=b.cwd,m=await (0,h.KI)(l),n=await (0,i.mc)();if(!(0,i.B7)(m.projectRoot,n))return d.NextResponse.json({error:"Path not allowed",code:"path_not_allowed"},{status:403});if("detach"===c){let a=(0,g.join)(m.projectRoot,".omp","scripts-logs",`${Date.now()}.log`);(0,f.mkdirSync)((0,g.dirname)(a),{recursive:!0});let b=(0,f.openSync)(a,"a"),c=(0,e.spawn)(k,{cwd:m.projectRoot,shell:!0,detached:!0,stdio:["ignore",b,b],env:{...process.env,...(0,j.cS)(process.env.OMP_WEB_PROXY_URL||null)}});return c.unref(),d.NextResponse.json({ok:!0,mode:"detach",pid:c.pid,logPath:a})}return await new Promise(a=>{let b=(0,e.spawn)(k,{cwd:m.projectRoot,shell:!0,env:{...process.env,...(0,j.cS)(process.env.OMP_WEB_PROXY_URL||null)}}),c="",f=!1,g=(b,e)=>{f||(f=!0,a(d.NextResponse.json({ok:!0,mode:"wait",exitCode:b,timedOut:e,output:c})))},h=setTimeout(()=>{try{b.kill("SIGTERM")}catch{}g(null,!0)},6e4);b.stdout?.on("data",a=>{c.length<20480&&(c+=a.toString())}),b.stderr?.on("data",a=>{c.length<20480&&(c+=a.toString())}),b.on("error",a=>{clearTimeout(h),g(null,!1)}),b.on("exit",a=>{clearTimeout(h),g(a,!1)})})}catch(b){let a=b instanceof Error?b.message:"Script execution failed";return d.NextResponse.json({error:a,code:"script_run_failed"},{status:500})}}},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30192:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/scripts/run/route",pathname:"/api/scripts/run",filename:"route",bundlePath:"app/api/scripts/run/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/scripts/run/route.ts",nextConfigOutput:"standalone",userland:()=>c(26847),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/scripts/run/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{a.exports=require("zlib")},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87831:(a,b,c)=>{c.d(b,{Cn:()=>o,cS:()=>q,li:()=>l,qM:()=>p,qt:()=>m});var d=c(79646),e=c(29021),f=c(21820),g=c(33873),h=c(91645),i=c.n(h);let j=(0,g.join)((0,f.homedir)(),".omp","agent","proxy.json"),k=[7890,7897,1087,1080,8118,8888];function l(){try{let a=JSON.parse((0,e.readFileSync)(j,"utf8"));if("auto"===a.mode||"manual"===a.mode||"off"===a.mode)return{mode:a.mode,url:"string"==typeof a.url?a.url:void 0}}catch{}return{mode:"auto"}}function m(a){(0,e.mkdirSync)((0,g.dirname)(j),{recursive:!0});let b=`${j}.tmp-${process.pid}`;(0,e.writeFileSync)(b,JSON.stringify(a,null,2)+"\n"),(0,e.renameSync)(b,j)}function n(a,b="127.0.0.1",c=400){return new Promise(d=>{let e=new(i()).Socket,f=a=>{e.destroy(),d(a)};e.setTimeout(c),e.once("connect",()=>f(!0)),e.once("timeout",()=>f(!1)),e.once("error",()=>f(!1)),e.connect(a,b)})}async function o(){let a=[];for(let b of function(){let a=process.platform;try{if("darwin"===a){let a=(0,d.execFileSync)("scutil",["--proxy"],{encoding:"utf8",timeout:3e3}),b=[],c=/HTTPProxy\s*:\s*(\S+)/.exec(a)?.[1],e=/HTTPPort\s*:\s*(\d+)/.exec(a)?.[1],f=/HTTPSProxy\s*:\s*(\S+)/.exec(a)?.[1],g=/HTTPSPort\s*:\s*(\d+)/.exec(a)?.[1];return c&&e&&b.push({url:`http://${c}:${e}`,source:"system-http"}),f&&g&&b.push({url:`http://${f}:${g}`,source:"system-https"}),b}if("win32"===a){let a=(0,d.execFileSync)("reg",["query","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"],{encoding:"utf8",timeout:3e3}),b=/ProxyEnable\s+REG_DWORD\s+0x(\d+)/i.exec(a)?.[1];if("1"===b){let b=/ProxyServer\s+REG_SZ\s+(\S+)/i.exec(a)?.[1];if(b)return[{url:/^https?:\/\//i.test(b)?b:`http://${b}`,source:"system-proxy"}]}return[]}if("linux"===a){let a=[];for(let b of["HTTPS_PROXY","https_proxy","HTTP_PROXY","http_proxy"]){let c=process.env[b];if(c){let b=/^https?:\/\//i.test(c)?c:`http://${c}`;a.some(a=>a.url===b)||a.push({url:b,source:"env"})}}try{let b=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy","mode"],{encoding:"utf8",timeout:2e3}).trim();if("'manual'"===b){let b=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy.http","host"],{encoding:"utf8",timeout:2e3}).trim().replace(/^'|'$/g,""),c=(0,d.execFileSync)("gsettings",["get","org.gnome.system.proxy.http","port"],{encoding:"utf8",timeout:2e3}).trim();b&&c&&a.push({url:`http://${b}:${c}`,source:"gnome"})}}catch{}return a}}catch{}return[]}())await n(Number(new URL(b.url).port))&&a.push(b);for(let b of k)if(await n(b)){let c=`http://127.0.0.1:${b}`;a.some(a=>a.url===c)||a.push({url:c,source:"local-port"})}let b=l(),c=!1;if("manual"===b.mode&&b.url)try{let a=Number(new URL(b.url).port);c=await n(a,new URL(b.url).hostname)}catch{c=!1}let e=a[0]?.url??(c&&b.url?b.url:null);return{candidates:a,recommended:e,manualReachable:c}}async function p(){let a=l();if("off"===a.mode)return null;if("manual"===a.mode){if(!a.url)return null;try{let b=Number(new URL(a.url).port);return await n(b,new URL(a.url).hostname)?a.url:null}catch{return null}}return(await o()).recommended}function q(a){return a?{HTTP_PROXY:a,HTTPS_PROXY:a,ALL_PROXY:a,http_proxy:a,https_proxy:a,all_proxy:a}:{}}},91645:a=>{a.exports=require("net")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,4509],()=>b(b.s=30192));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=7074,a.ids=[7074],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},18524:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/archive/route",pathname:"/api/sessions/[id]/archive",filename:"route",bundlePath:"app/api/sessions/[id]/archive/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/sessions/[id]/archive/route.ts",nextConfigOutput:"standalone",userland:()=>c(82181),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/archive/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65644:(a,b,c)=>{c.d(b,{Q:()=>h,r:()=>g});var d=c(23211),e=c(78573);let f={error:"Session not found",code:"session_not_found"};async function g(a){let b=await (0,e.os)(a);return b?{filePath:b}:{response:d.NextResponse.json(f,{status:404})}}function h(a,b=500){return d.NextResponse.json({error:String(a)},{status:b})}},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},82181:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>i});var d=c(23211),e=c(63945),f=c(78573),g=c(65644),h=c(86465);async function i(a,{params:b}){let{id:c}=await b;try{let a=await (0,g.r)(c);if("response"in a)return a.response;let b=a.filePath;if((await (0,f.dQ)()).some(a=>a.parentSessionId===c))return d.NextResponse.json({error:"Archive child sessions before archiving this session",code:"session_has_children"},{status:409});await (0,h.A4)(c)?.destroyAndWait?.();let i=(0,e.a8)(b);return(0,f.BR)(c),(0,f.mD)(),d.NextResponse.json({ok:!0,archived:!0,archivedPath:i})}catch(b){let a=b instanceof Error?b.message:String(b);return d.NextResponse.json({error:a,code:"session_archive_failed"},{status:500})}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,3294,4509,3798,7839,6465],()=>b(b.s=18524));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=7074,a.ids=[7074],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},8988:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/archive/route",pathname:"/api/sessions/[id]/archive",filename:"route",bundlePath:"app/api/sessions/[id]/archive/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/sessions/[id]/archive/route.ts",nextConfigOutput:"standalone",userland:()=>c(82181),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/archive/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65644:(a,b,c)=>{c.d(b,{Q:()=>h,r:()=>g});var d=c(23211),e=c(78573);let f={error:"Session not found",code:"session_not_found"};async function g(a){let b=await (0,e.os)(a);return b?{filePath:b}:{response:d.NextResponse.json(f,{status:404})}}function h(a,b=500){return d.NextResponse.json({error:String(a)},{status:b})}},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},82181:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>i});var d=c(23211),e=c(63945),f=c(78573),g=c(65644),h=c(86465);async function i(a,{params:b}){let{id:c}=await b;try{let a=await (0,g.r)(c);if("response"in a)return a.response;let b=a.filePath;if((await (0,f.dQ)()).some(a=>a.parentSessionId===c))return d.NextResponse.json({error:"Archive child sessions before archiving this session",code:"session_has_children"},{status:409});await (0,h.A4)(c)?.destroyAndWait?.();let i=(0,e.a8)(b);return(0,f.BR)(c),(0,f.mD)(),d.NextResponse.json({ok:!0,archived:!0,archivedPath:i})}catch(b){let a=b instanceof Error?b.message:String(b);return d.NextResponse.json({error:a,code:"session_archive_failed"},{status:500})}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,3294,4509,3798,7839,6465],()=>b(b.s=8988));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=2835,a.ids=[2835],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},17486:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>j});var d=c(23211),e=c(63945);function f(a){if(!a)return;let b=(a.split(/\r?\n/)[0]??"").replace(/[\u0000-\u001f\u007f-\u009f]/g," ").replace(/\s+/g," ").trim();return b.length>0?b:void 0}var g=c(86465),h=c(78573),i=c(65644);async function j(a,{params:b}){let{id:c}=await b;try{let a=(0,g.A4)(c),b=!!a?.isAlive?.();if(b&&"function"==typeof a?.send)try{let b=await a.send({type:"get_state"}),c=f(b?.sessionName);if(c)return(0,h.mD)(),d.NextResponse.json({title:c,usage:null})}catch{}let j=await (0,i.r)(c);if("response"in j)return j.response;let k=j.filePath,l=(0,e.mk)(k,!1),m=f(l?.title);if(m)return d.NextResponse.json({title:m,usage:null});let n=function(a){if(!a||"(no messages)"===a)return null;let b=f(a);if(!b||!/[\p{L}\p{N}]/u.test(b))return null;let c=Array.from(b);return c.length<=60?b:`${c.slice(0,60).join("").trimEnd()}…`}(l?.firstMessage);if(!n)return d.NextResponse.json({error:"The session has no user messages to name",code:"session_no_messages_to_name"},{status:409});return b||(0,e.Bm)(k,n,"auto"),(0,h.mD)(),d.NextResponse.json({title:n,usage:null})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65644:(a,b,c)=>{c.d(b,{Q:()=>h,r:()=>g});var d=c(23211),e=c(78573);let f={error:"Session not found",code:"session_not_found"};async function g(a){let b=await (0,e.os)(a);return b?{filePath:b}:{response:d.NextResponse.json(f,{status:404})}}function h(a,b=500){return d.NextResponse.json({error:String(a)},{status:b})}},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91222:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/auto-name/route",pathname:"/api/sessions/[id]/auto-name",filename:"route",bundlePath:"app/api/sessions/[id]/auto-name/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/sessions/[id]/auto-name/route.ts",nextConfigOutput:"standalone",userland:()=>c(17486),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/auto-name/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},91645:a=>{a.exports=require("net")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,3294,4509,3798,7839,6465],()=>b(b.s=91222));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=2835,a.ids=[2835],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11338:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/auto-name/route",pathname:"/api/sessions/[id]/auto-name",filename:"route",bundlePath:"app/api/sessions/[id]/auto-name/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/sessions/[id]/auto-name/route.ts",nextConfigOutput:"standalone",userland:()=>c(17486),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/auto-name/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},17486:(a,b,c)=>{c.r(b),c.d(b,{POST:()=>j});var d=c(23211),e=c(63945);function f(a){if(!a)return;let b=(a.split(/\r?\n/)[0]??"").replace(/[\u0000-\u001f\u007f-\u009f]/g," ").replace(/\s+/g," ").trim();return b.length>0?b:void 0}var g=c(86465),h=c(78573),i=c(65644);async function j(a,{params:b}){let{id:c}=await b;try{let a=(0,g.A4)(c),b=!!a?.isAlive?.();if(b&&"function"==typeof a?.send)try{let b=await a.send({type:"get_state"}),c=f(b?.sessionName);if(c)return(0,h.mD)(),d.NextResponse.json({title:c,usage:null})}catch{}let j=await (0,i.r)(c);if("response"in j)return j.response;let k=j.filePath,l=(0,e.mk)(k,!1),m=f(l?.title);if(m)return d.NextResponse.json({title:m,usage:null});let n=function(a){if(!a||"(no messages)"===a)return null;let b=f(a);if(!b||!/[\p{L}\p{N}]/u.test(b))return null;let c=Array.from(b);return c.length<=60?b:`${c.slice(0,60).join("").trimEnd()}…`}(l?.firstMessage);if(!n)return d.NextResponse.json({error:"The session has no user messages to name",code:"session_no_messages_to_name"},{status:409});return b||(0,e.Bm)(k,n,"auto"),(0,h.mD)(),d.NextResponse.json({title:n,usage:null})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65644:(a,b,c)=>{c.d(b,{Q:()=>h,r:()=>g});var d=c(23211),e=c(78573);let f={error:"Session not found",code:"session_not_found"};async function g(a){let b=await (0,e.os)(a);return b?{filePath:b}:{response:d.NextResponse.json(f,{status:404})}}function h(a,b=500){return d.NextResponse.json({error:String(a)},{status:b})}},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,3294,4509,3798,7839,6465],()=>b(b.s=11338));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=6709,a.ids=[6709],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")},6004:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>h});var d=c(23211),e=c(63945),f=c(78573),g=c(65644);async function h(a,{params:b}){let{id:c}=await b,i=new URL(a.url),j=i.searchParams.get("leafId")??void 0,k=i.searchParams.has("deferThinking"),l=i.searchParams.has("deferMedia"),m=i.searchParams.has("includePreCompaction");try{let a=await (0,g.r)(c);if("response"in a)return a.response;let b=a.filePath,{header:h,entries:i,error:n}=(0,e.Fy)(b,{resolveBlobs:!0,skipToolResultImages:l});if("too_large"===n)return d.NextResponse.json({error:"Session file is too large to open in omp-web",code:"session_file_too_large"},{status:413});if(!h)return d.NextResponse.json({error:"Session file is missing or malformed",code:"session_file_malformed"},{status:404});let o=(0,f.Uv)(i,j,{deferThinking:k,deferToolResultImages:l,includePreCompaction:m});return d.NextResponse.json({context:o})}catch(a){return(0,g.Q)(a)}}},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},15206:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/context/route",pathname:"/api/sessions/[id]/context",filename:"route",bundlePath:"app/api/sessions/[id]/context/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/sessions/[id]/context/route.ts",nextConfigOutput:"standalone",userland:()=>c(6004),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/context/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65644:(a,b,c)=>{c.d(b,{Q:()=>h,r:()=>g});var d=c(23211),e=c(78573);let f={error:"Session not found",code:"session_not_found"};async function g(a){let b=await (0,e.os)(a);return b?{filePath:b}:{response:d.NextResponse.json(f,{status:404})}}function h(a,b=500){return d.NextResponse.json({error:String(a)},{status:b})}},74075:a=>{a.exports=require("zlib")},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,4509],()=>b(b.s=15206));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=6709,a.ids=[6709],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")},6004:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>h});var d=c(23211),e=c(63945),f=c(78573),g=c(65644);async function h(a,{params:b}){let{id:c}=await b,i=new URL(a.url),j=i.searchParams.get("leafId")??void 0,k=i.searchParams.has("deferThinking"),l=i.searchParams.has("deferMedia"),m=i.searchParams.has("includePreCompaction");try{let a=await (0,g.r)(c);if("response"in a)return a.response;let b=a.filePath,{header:h,entries:i,error:n}=(0,e.Fy)(b,{resolveBlobs:!0,skipToolResultImages:l});if("too_large"===n)return d.NextResponse.json({error:"Session file is too large to open in omp-web",code:"session_file_too_large"},{status:413});if(!h)return d.NextResponse.json({error:"Session file is missing or malformed",code:"session_file_malformed"},{status:404});let o=(0,f.Uv)(i,j,{deferThinking:k,deferToolResultImages:l,includePreCompaction:m});return d.NextResponse.json({context:o})}catch(a){return(0,g.Q)(a)}}},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63546:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/context/route",pathname:"/api/sessions/[id]/context",filename:"route",bundlePath:"app/api/sessions/[id]/context/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/cc/code/ompweb/app/api/sessions/[id]/context/route.ts",nextConfigOutput:"standalone",userland:()=>c(6004),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/context/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},65644:(a,b,c)=>{c.d(b,{Q:()=>h,r:()=>g});var d=c(23211),e=c(78573);let f={error:"Session not found",code:"session_not_found"};async function g(a){let b=await (0,e.os)(a);return b?{filePath:b}:{response:d.NextResponse.json(f,{status:404})}}function h(a,b=500){return d.NextResponse.json({error:String(a)},{status:b})}},74075:a=>{a.exports=require("zlib")},79646:a=>{a.exports=require("child_process")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,4509],()=>b(b.s=63546));module.exports=c})();