cuelo 0.9.6 → 0.9.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 (346) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +11 -10
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +2 -2
  6. package/.next/required-server-files.json +2 -2
  7. package/.next/routes-manifest.json +6 -0
  8. package/.next/server/app/_global-error/page.js +3 -3
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  17. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  18. package/.next/server/app/_not-found/page.js +2 -2
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +2 -2
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  25. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  27. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  28. package/.next/server/app/api/agent/[id]/account/route.js +1 -1
  29. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  30. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  31. package/.next/server/app/api/agent/[id]/route.js +1 -1
  32. package/.next/server/app/api/agent/new/route.js +1 -1
  33. package/.next/server/app/api/agent/running/route.js +1 -1
  34. package/.next/server/app/api/attachment-settings/route.js +1 -1
  35. package/.next/server/app/api/attachments/[id]/transcription/route.js +2 -2
  36. package/.next/server/app/api/attachments/draft/route.js +1 -1
  37. package/.next/server/app/api/attachments/route.js +3 -3
  38. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  39. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  40. package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  41. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  42. package/.next/server/app/api/auth/providers/route.js +1 -1
  43. package/.next/server/app/api/cwd/browse/route.js +1 -1
  44. package/.next/server/app/api/cwd/validate/route.js +1 -1
  45. package/.next/server/app/api/default-cwd/route.js +1 -1
  46. package/.next/server/app/api/display-settings/route.js +1 -1
  47. package/.next/server/app/api/document-text/route.js +2 -2
  48. package/.next/server/app/api/experiments/route.js +1 -1
  49. package/.next/server/app/api/file-index/route.js +1 -1
  50. package/.next/server/app/api/files/[...path]/route.js +3 -3
  51. package/.next/server/app/api/git/diff/route.js +1 -1
  52. package/.next/server/app/api/git/status/route.js +1 -1
  53. package/.next/server/app/api/github/projects/route.js +1 -0
  54. package/.next/server/app/api/github/projects/route.js.nft.json +1 -0
  55. package/.next/server/app/api/github/projects/route_client-reference-manifest.js +1 -0
  56. package/.next/server/app/api/gpt6/handles/route.js +1 -1
  57. package/.next/server/app/api/gpt6/reply/route.js +1 -1
  58. package/.next/server/app/api/gpt6/token/route.js +1 -1
  59. package/.next/server/app/api/gpt6/web6-session/route.js +1 -1
  60. package/.next/server/app/api/home/route.js +1 -1
  61. package/.next/server/app/api/live/call/[callId]/route.js +1 -1
  62. package/.next/server/app/api/live/character-voice/route.js +1 -1
  63. package/.next/server/app/api/live/events/route.js +2 -2
  64. package/.next/server/app/api/live/offer/route.js +1 -1
  65. package/.next/server/app/api/live/voices/route.js +1 -1
  66. package/.next/server/app/api/lounge/events/route.js +2 -2
  67. package/.next/server/app/api/lounge/route.js +1 -1
  68. package/.next/server/app/api/mcp/route.js +2 -2
  69. package/.next/server/app/api/model-roles/route.js +1 -1
  70. package/.next/server/app/api/models/route.js +1 -1
  71. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  72. package/.next/server/app/api/models-config/discover/route.js +1 -1
  73. package/.next/server/app/api/models-config/route.js +3 -3
  74. package/.next/server/app/api/models-config/test/route.js +1 -1
  75. package/.next/server/app/api/office-avatars/[id]/route.js +1 -1
  76. package/.next/server/app/api/office-avatars/route.js +1 -1
  77. package/.next/server/app/api/plugins/route.js +1 -1
  78. package/.next/server/app/api/project-trust/route.js +1 -1
  79. package/.next/server/app/api/projects/route.js +1 -1
  80. package/.next/server/app/api/runs/[runId]/route.js +1 -1
  81. package/.next/server/app/api/runs/route.js +1 -1
  82. package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
  83. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  84. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  85. package/.next/server/app/api/sessions/[id]/export/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/route.js +1 -1
  89. package/.next/server/app/api/sessions/search/route.js +1 -1
  90. package/.next/server/app/api/settings/route.js +1 -1
  91. package/.next/server/app/api/sidecars/[service]/[...path]/route.js +1 -1
  92. package/.next/server/app/api/skills/check/route.js +1 -1
  93. package/.next/server/app/api/skills/install/route.js +2 -2
  94. package/.next/server/app/api/skills/route.js +2 -2
  95. package/.next/server/app/api/skills/search/route.js +1 -1
  96. package/.next/server/app/api/skills/update/route.js +1 -1
  97. package/.next/server/app/api/theme/route.js +1 -1
  98. package/.next/server/app/api/tool-image/route.js +1 -1
  99. package/.next/server/app/api/update-maintenance/route.js +8 -4
  100. package/.next/server/app/api/updates/route.js +1 -1
  101. package/.next/server/app/api/web-access/recovery/route.js +1 -1
  102. package/.next/server/app/api/web-access/route.js +1 -1
  103. package/.next/server/app/api/web6/consults/route.js +1 -1
  104. package/.next/server/app/api/worktrees/route.js +1 -1
  105. package/.next/server/app/favicon.ico/route.js +1 -1
  106. package/.next/server/app/index.html +1 -1
  107. package/.next/server/app/index.rsc +5 -5
  108. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  109. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  110. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  111. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  112. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  113. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  114. package/.next/server/app/office/page.js +2 -2
  115. package/.next/server/app/office/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/office-preview/page.js +2 -2
  117. package/.next/server/app/office-preview/page_client-reference-manifest.js +1 -1
  118. package/.next/server/app/office-preview.html +1 -1
  119. package/.next/server/app/office-preview.rsc +2 -2
  120. package/.next/server/app/office-preview.segments/_full.segment.rsc +2 -2
  121. package/.next/server/app/office-preview.segments/_head.segment.rsc +1 -1
  122. package/.next/server/app/office-preview.segments/_index.segment.rsc +2 -2
  123. package/.next/server/app/office-preview.segments/_tree.segment.rsc +1 -1
  124. package/.next/server/app/office-preview.segments/office-preview/__PAGE__.segment.rsc +1 -1
  125. package/.next/server/app/office-preview.segments/office-preview.segment.rsc +1 -1
  126. package/.next/server/app/office.html +1 -1
  127. package/.next/server/app/office.rsc +5 -5
  128. package/.next/server/app/office.segments/_full.segment.rsc +5 -5
  129. package/.next/server/app/office.segments/_head.segment.rsc +1 -1
  130. package/.next/server/app/office.segments/_index.segment.rsc +2 -2
  131. package/.next/server/app/office.segments/_tree.segment.rsc +2 -2
  132. package/.next/server/app/office.segments/office/__PAGE__.segment.rsc +4 -4
  133. package/.next/server/app/office.segments/office.segment.rsc +1 -1
  134. package/.next/server/app/page.js +2 -2
  135. package/.next/server/app/page_client-reference-manifest.js +1 -1
  136. package/.next/server/app/recover/page.js +2 -2
  137. package/.next/server/app/recover/page_client-reference-manifest.js +1 -1
  138. package/.next/server/app/recover.html +1 -1
  139. package/.next/server/app/recover.rsc +2 -2
  140. package/.next/server/app/recover.segments/_full.segment.rsc +2 -2
  141. package/.next/server/app/recover.segments/_head.segment.rsc +1 -1
  142. package/.next/server/app/recover.segments/_index.segment.rsc +2 -2
  143. package/.next/server/app/recover.segments/_tree.segment.rsc +1 -1
  144. package/.next/server/app/recover.segments/recover/__PAGE__.segment.rsc +1 -1
  145. package/.next/server/app/recover.segments/recover.segment.rsc +1 -1
  146. package/.next/server/app-paths-manifest.json +11 -10
  147. package/.next/server/chunks/1008.js +2 -2
  148. package/.next/server/chunks/2651.js +1 -1
  149. package/.next/server/chunks/3379.js +1 -1
  150. package/.next/server/chunks/5489.js +12 -12
  151. package/.next/server/chunks/6429.js +6 -6
  152. package/.next/server/chunks/7362.js +1 -1
  153. package/.next/server/middleware-build-manifest.js +1 -1
  154. package/.next/server/middleware.js +2 -2
  155. package/.next/server/pages/404.html +1 -1
  156. package/.next/server/pages/500.html +1 -1
  157. package/.next/server/server-reference-manifest.json +1 -1
  158. package/.next/static/chunks/6110-9f1e951aafcdd72e.js +1 -0
  159. package/.next/static/chunks/9575-a48cda671c8b915d.js +22 -0
  160. package/.next/static/chunks/app/{api/agent/[id]/bash-output/route-6b1496af498bb4fd.js → _global-error/page-318ea6a550b5034e.js} +1 -1
  161. package/.next/static/chunks/app/api/agent/[id]/{events/route-6b1496af498bb4fd.js → account/route-318ea6a550b5034e.js} +1 -1
  162. package/.next/static/chunks/app/{_global-error/page-6b1496af498bb4fd.js → api/agent/[id]/bash-output/route-318ea6a550b5034e.js} +1 -1
  163. package/.next/static/chunks/app/api/agent/[id]/{account/route-6b1496af498bb4fd.js → events/route-318ea6a550b5034e.js} +1 -1
  164. package/.next/static/chunks/app/api/agent/[id]/route-318ea6a550b5034e.js +1 -0
  165. package/.next/static/chunks/app/api/agent/new/route-318ea6a550b5034e.js +1 -0
  166. package/.next/static/chunks/app/api/agent/running/route-318ea6a550b5034e.js +1 -0
  167. package/.next/static/chunks/app/api/attachment-settings/route-318ea6a550b5034e.js +1 -0
  168. package/.next/static/chunks/app/api/attachments/[id]/transcription/route-318ea6a550b5034e.js +1 -0
  169. package/.next/static/chunks/app/api/attachments/draft/route-318ea6a550b5034e.js +1 -0
  170. package/.next/static/chunks/app/api/attachments/route-318ea6a550b5034e.js +1 -0
  171. package/.next/static/chunks/app/api/auth/all-providers/route-318ea6a550b5034e.js +1 -0
  172. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-318ea6a550b5034e.js +1 -0
  173. package/.next/static/chunks/app/api/auth/login/[provider]/route-318ea6a550b5034e.js +1 -0
  174. package/.next/static/chunks/app/api/auth/logout/[provider]/route-318ea6a550b5034e.js +1 -0
  175. package/.next/static/chunks/app/api/auth/providers/route-318ea6a550b5034e.js +1 -0
  176. package/.next/static/chunks/app/api/cwd/browse/route-318ea6a550b5034e.js +1 -0
  177. package/.next/static/chunks/app/api/cwd/validate/route-318ea6a550b5034e.js +1 -0
  178. package/.next/static/chunks/app/api/default-cwd/route-318ea6a550b5034e.js +1 -0
  179. package/.next/static/chunks/app/api/display-settings/route-318ea6a550b5034e.js +1 -0
  180. package/.next/static/chunks/app/api/document-text/route-318ea6a550b5034e.js +1 -0
  181. package/.next/static/chunks/app/api/experiments/route-318ea6a550b5034e.js +1 -0
  182. package/.next/static/chunks/app/api/file-index/route-318ea6a550b5034e.js +1 -0
  183. package/.next/static/chunks/app/api/files/[...path]/route-318ea6a550b5034e.js +1 -0
  184. package/.next/static/chunks/app/api/git/diff/route-318ea6a550b5034e.js +1 -0
  185. package/.next/static/chunks/app/api/git/status/route-318ea6a550b5034e.js +1 -0
  186. package/.next/static/chunks/app/api/github/projects/route-318ea6a550b5034e.js +1 -0
  187. package/.next/static/chunks/app/api/gpt6/handles/route-318ea6a550b5034e.js +1 -0
  188. package/.next/static/chunks/app/api/gpt6/reply/route-318ea6a550b5034e.js +1 -0
  189. package/.next/static/chunks/app/api/gpt6/token/route-318ea6a550b5034e.js +1 -0
  190. package/.next/static/chunks/app/api/gpt6/web6-session/route-318ea6a550b5034e.js +1 -0
  191. package/.next/static/chunks/app/api/home/route-318ea6a550b5034e.js +1 -0
  192. package/.next/static/chunks/app/api/live/call/[callId]/route-318ea6a550b5034e.js +1 -0
  193. package/.next/static/chunks/app/api/live/character-voice/route-318ea6a550b5034e.js +1 -0
  194. package/.next/static/chunks/app/api/live/events/route-318ea6a550b5034e.js +1 -0
  195. package/.next/static/chunks/app/api/live/offer/route-318ea6a550b5034e.js +1 -0
  196. package/.next/static/chunks/app/api/live/voices/route-318ea6a550b5034e.js +1 -0
  197. package/.next/static/chunks/app/api/lounge/events/route-318ea6a550b5034e.js +1 -0
  198. package/.next/static/chunks/app/api/lounge/route-318ea6a550b5034e.js +1 -0
  199. package/.next/static/chunks/app/api/mcp/route-318ea6a550b5034e.js +1 -0
  200. package/.next/static/chunks/app/api/model-roles/route-318ea6a550b5034e.js +1 -0
  201. package/.next/static/chunks/app/api/models/route-318ea6a550b5034e.js +1 -0
  202. package/.next/static/chunks/app/api/models-config/catalog/route-318ea6a550b5034e.js +1 -0
  203. package/.next/static/chunks/app/api/models-config/discover/route-318ea6a550b5034e.js +1 -0
  204. package/.next/static/chunks/app/api/models-config/route-318ea6a550b5034e.js +1 -0
  205. package/.next/static/chunks/app/api/models-config/test/route-318ea6a550b5034e.js +1 -0
  206. package/.next/static/chunks/app/api/office-avatars/[id]/route-318ea6a550b5034e.js +1 -0
  207. package/.next/static/chunks/app/api/office-avatars/route-318ea6a550b5034e.js +1 -0
  208. package/.next/static/chunks/app/api/plugins/route-318ea6a550b5034e.js +1 -0
  209. package/.next/static/chunks/app/api/project-trust/route-318ea6a550b5034e.js +1 -0
  210. package/.next/static/chunks/app/api/projects/route-318ea6a550b5034e.js +1 -0
  211. package/.next/static/chunks/app/api/runs/[runId]/route-318ea6a550b5034e.js +1 -0
  212. package/.next/static/chunks/app/api/runs/route-318ea6a550b5034e.js +1 -0
  213. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-318ea6a550b5034e.js +1 -0
  214. package/.next/static/chunks/app/api/sessions/[id]/context/route-318ea6a550b5034e.js +1 -0
  215. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-318ea6a550b5034e.js +1 -0
  216. package/.next/static/chunks/app/api/sessions/[id]/export/route-318ea6a550b5034e.js +1 -0
  217. package/.next/static/chunks/app/api/sessions/[id]/route-318ea6a550b5034e.js +1 -0
  218. package/.next/static/chunks/app/api/sessions/[id]/state/route-318ea6a550b5034e.js +1 -0
  219. package/.next/static/chunks/app/api/sessions/route-318ea6a550b5034e.js +1 -0
  220. package/.next/static/chunks/app/api/sessions/search/route-318ea6a550b5034e.js +1 -0
  221. package/.next/static/chunks/app/api/settings/route-318ea6a550b5034e.js +1 -0
  222. package/.next/static/chunks/app/api/sidecars/[service]/[...path]/route-318ea6a550b5034e.js +1 -0
  223. package/.next/static/chunks/app/api/skills/check/route-318ea6a550b5034e.js +1 -0
  224. package/.next/static/chunks/app/api/skills/install/route-318ea6a550b5034e.js +1 -0
  225. package/.next/static/chunks/app/api/skills/route-318ea6a550b5034e.js +1 -0
  226. package/.next/static/chunks/app/api/skills/search/route-318ea6a550b5034e.js +1 -0
  227. package/.next/static/chunks/app/api/skills/update/route-318ea6a550b5034e.js +1 -0
  228. package/.next/static/chunks/app/api/theme/route-318ea6a550b5034e.js +1 -0
  229. package/.next/static/chunks/app/api/tool-image/route-318ea6a550b5034e.js +1 -0
  230. package/.next/static/chunks/app/api/update-maintenance/route-318ea6a550b5034e.js +1 -0
  231. package/.next/static/chunks/app/api/updates/route-318ea6a550b5034e.js +1 -0
  232. package/.next/static/chunks/app/api/web-access/recovery/route-318ea6a550b5034e.js +1 -0
  233. package/.next/static/chunks/app/api/web-access/route-318ea6a550b5034e.js +1 -0
  234. package/.next/static/chunks/app/api/web6/consults/route-318ea6a550b5034e.js +1 -0
  235. package/.next/static/chunks/app/api/worktrees/route-318ea6a550b5034e.js +1 -0
  236. package/.next/static/chunks/app/{layout-15c56b62f49b1c1d.js → layout-489bc5b73326436e.js} +1 -1
  237. package/.next/static/chunks/app/manifest.webmanifest/route-318ea6a550b5034e.js +1 -0
  238. package/.next/static/chunks/app/office/page-8dc604f9b5e6f220.js +1 -0
  239. package/.next/static/chunks/app/page-952b1ef4df5ac896.js +1 -0
  240. package/.next/static/chunks/next/dist/client/components/builtin/app-error-318ea6a550b5034e.js +1 -0
  241. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-318ea6a550b5034e.js +1 -0
  242. package/.next/static/chunks/next/dist/client/components/builtin/not-found-318ea6a550b5034e.js +1 -0
  243. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-318ea6a550b5034e.js +1 -0
  244. package/.next/static/chunks/{webpack-fe8f1f81562a2b61.js → webpack-68986b211ad38cf1.js} +1 -1
  245. package/.next/static/css/4fae42750604bc1a.css +1 -0
  246. package/.next/static/pzZcPiD8nl6i7i_Ne9Ko-/_buildManifest.js +1 -0
  247. package/.next/trace +108 -108
  248. package/.next/trace-build +1 -1
  249. package/.next/types/app/api/github/projects/route.ts +351 -0
  250. package/.next/types/routes.d.ts +2 -1
  251. package/.next/types/validator.ts +9 -0
  252. package/README.md +8 -3
  253. package/Tools/CUELO_Setup/files/native-runtime-patch.js +3 -3
  254. package/Tools/OMP_Global_Config/agent/RULES.md +3 -1
  255. package/Tools/OMP_Global_Config/agent/TITLE_SYSTEM.md +17 -0
  256. package/Tools/OMP_Global_Config/agent/extensions/jev-runtime.ts +11 -4
  257. package/Tools/OMP_Global_Config/agent/prompt-copies/RULES.en.md +4 -2
  258. package/Tools/OMP_Global_Config/agent/tools/git-finalizer/finalizer.ps1 +68 -31
  259. package/Tools/OMP_Global_Config/agent/tools/git-finalizer/index.ts +8 -6
  260. package/Tools/OMP_Global_Config/patches/apply-core-patch.mjs +1119 -129
  261. package/bin/docker-entrypoint.mjs +19 -0
  262. package/install.mjs +11 -7
  263. package/package.json +8 -7
  264. package/.next/static/chunks/6110-004be57c825af4d9.js +0 -1
  265. package/.next/static/chunks/9575-4a84cf066c2f1257.js +0 -22
  266. package/.next/static/chunks/app/api/agent/[id]/route-6b1496af498bb4fd.js +0 -1
  267. package/.next/static/chunks/app/api/agent/new/route-6b1496af498bb4fd.js +0 -1
  268. package/.next/static/chunks/app/api/agent/running/route-6b1496af498bb4fd.js +0 -1
  269. package/.next/static/chunks/app/api/attachment-settings/route-6b1496af498bb4fd.js +0 -1
  270. package/.next/static/chunks/app/api/attachments/[id]/transcription/route-6b1496af498bb4fd.js +0 -1
  271. package/.next/static/chunks/app/api/attachments/draft/route-6b1496af498bb4fd.js +0 -1
  272. package/.next/static/chunks/app/api/attachments/route-6b1496af498bb4fd.js +0 -1
  273. package/.next/static/chunks/app/api/auth/all-providers/route-6b1496af498bb4fd.js +0 -1
  274. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-6b1496af498bb4fd.js +0 -1
  275. package/.next/static/chunks/app/api/auth/login/[provider]/route-6b1496af498bb4fd.js +0 -1
  276. package/.next/static/chunks/app/api/auth/logout/[provider]/route-6b1496af498bb4fd.js +0 -1
  277. package/.next/static/chunks/app/api/auth/providers/route-6b1496af498bb4fd.js +0 -1
  278. package/.next/static/chunks/app/api/cwd/browse/route-6b1496af498bb4fd.js +0 -1
  279. package/.next/static/chunks/app/api/cwd/validate/route-6b1496af498bb4fd.js +0 -1
  280. package/.next/static/chunks/app/api/default-cwd/route-6b1496af498bb4fd.js +0 -1
  281. package/.next/static/chunks/app/api/display-settings/route-6b1496af498bb4fd.js +0 -1
  282. package/.next/static/chunks/app/api/document-text/route-6b1496af498bb4fd.js +0 -1
  283. package/.next/static/chunks/app/api/experiments/route-6b1496af498bb4fd.js +0 -1
  284. package/.next/static/chunks/app/api/file-index/route-6b1496af498bb4fd.js +0 -1
  285. package/.next/static/chunks/app/api/files/[...path]/route-6b1496af498bb4fd.js +0 -1
  286. package/.next/static/chunks/app/api/git/diff/route-6b1496af498bb4fd.js +0 -1
  287. package/.next/static/chunks/app/api/git/status/route-6b1496af498bb4fd.js +0 -1
  288. package/.next/static/chunks/app/api/gpt6/handles/route-6b1496af498bb4fd.js +0 -1
  289. package/.next/static/chunks/app/api/gpt6/reply/route-6b1496af498bb4fd.js +0 -1
  290. package/.next/static/chunks/app/api/gpt6/token/route-6b1496af498bb4fd.js +0 -1
  291. package/.next/static/chunks/app/api/gpt6/web6-session/route-6b1496af498bb4fd.js +0 -1
  292. package/.next/static/chunks/app/api/home/route-6b1496af498bb4fd.js +0 -1
  293. package/.next/static/chunks/app/api/live/call/[callId]/route-6b1496af498bb4fd.js +0 -1
  294. package/.next/static/chunks/app/api/live/character-voice/route-6b1496af498bb4fd.js +0 -1
  295. package/.next/static/chunks/app/api/live/events/route-6b1496af498bb4fd.js +0 -1
  296. package/.next/static/chunks/app/api/live/offer/route-6b1496af498bb4fd.js +0 -1
  297. package/.next/static/chunks/app/api/live/voices/route-6b1496af498bb4fd.js +0 -1
  298. package/.next/static/chunks/app/api/lounge/events/route-6b1496af498bb4fd.js +0 -1
  299. package/.next/static/chunks/app/api/lounge/route-6b1496af498bb4fd.js +0 -1
  300. package/.next/static/chunks/app/api/mcp/route-6b1496af498bb4fd.js +0 -1
  301. package/.next/static/chunks/app/api/model-roles/route-6b1496af498bb4fd.js +0 -1
  302. package/.next/static/chunks/app/api/models/route-6b1496af498bb4fd.js +0 -1
  303. package/.next/static/chunks/app/api/models-config/catalog/route-6b1496af498bb4fd.js +0 -1
  304. package/.next/static/chunks/app/api/models-config/discover/route-6b1496af498bb4fd.js +0 -1
  305. package/.next/static/chunks/app/api/models-config/route-6b1496af498bb4fd.js +0 -1
  306. package/.next/static/chunks/app/api/models-config/test/route-6b1496af498bb4fd.js +0 -1
  307. package/.next/static/chunks/app/api/office-avatars/[id]/route-6b1496af498bb4fd.js +0 -1
  308. package/.next/static/chunks/app/api/office-avatars/route-6b1496af498bb4fd.js +0 -1
  309. package/.next/static/chunks/app/api/plugins/route-6b1496af498bb4fd.js +0 -1
  310. package/.next/static/chunks/app/api/project-trust/route-6b1496af498bb4fd.js +0 -1
  311. package/.next/static/chunks/app/api/projects/route-6b1496af498bb4fd.js +0 -1
  312. package/.next/static/chunks/app/api/runs/[runId]/route-6b1496af498bb4fd.js +0 -1
  313. package/.next/static/chunks/app/api/runs/route-6b1496af498bb4fd.js +0 -1
  314. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-6b1496af498bb4fd.js +0 -1
  315. package/.next/static/chunks/app/api/sessions/[id]/context/route-6b1496af498bb4fd.js +0 -1
  316. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-6b1496af498bb4fd.js +0 -1
  317. package/.next/static/chunks/app/api/sessions/[id]/export/route-6b1496af498bb4fd.js +0 -1
  318. package/.next/static/chunks/app/api/sessions/[id]/route-6b1496af498bb4fd.js +0 -1
  319. package/.next/static/chunks/app/api/sessions/[id]/state/route-6b1496af498bb4fd.js +0 -1
  320. package/.next/static/chunks/app/api/sessions/route-6b1496af498bb4fd.js +0 -1
  321. package/.next/static/chunks/app/api/sessions/search/route-6b1496af498bb4fd.js +0 -1
  322. package/.next/static/chunks/app/api/settings/route-6b1496af498bb4fd.js +0 -1
  323. package/.next/static/chunks/app/api/sidecars/[service]/[...path]/route-6b1496af498bb4fd.js +0 -1
  324. package/.next/static/chunks/app/api/skills/check/route-6b1496af498bb4fd.js +0 -1
  325. package/.next/static/chunks/app/api/skills/install/route-6b1496af498bb4fd.js +0 -1
  326. package/.next/static/chunks/app/api/skills/route-6b1496af498bb4fd.js +0 -1
  327. package/.next/static/chunks/app/api/skills/search/route-6b1496af498bb4fd.js +0 -1
  328. package/.next/static/chunks/app/api/skills/update/route-6b1496af498bb4fd.js +0 -1
  329. package/.next/static/chunks/app/api/theme/route-6b1496af498bb4fd.js +0 -1
  330. package/.next/static/chunks/app/api/tool-image/route-6b1496af498bb4fd.js +0 -1
  331. package/.next/static/chunks/app/api/update-maintenance/route-6b1496af498bb4fd.js +0 -1
  332. package/.next/static/chunks/app/api/updates/route-6b1496af498bb4fd.js +0 -1
  333. package/.next/static/chunks/app/api/web-access/recovery/route-6b1496af498bb4fd.js +0 -1
  334. package/.next/static/chunks/app/api/web-access/route-6b1496af498bb4fd.js +0 -1
  335. package/.next/static/chunks/app/api/web6/consults/route-6b1496af498bb4fd.js +0 -1
  336. package/.next/static/chunks/app/api/worktrees/route-6b1496af498bb4fd.js +0 -1
  337. package/.next/static/chunks/app/manifest.webmanifest/route-6b1496af498bb4fd.js +0 -1
  338. package/.next/static/chunks/app/office/page-424e244f1c7fcdc6.js +0 -1
  339. package/.next/static/chunks/app/page-b43b2b8679ed66e2.js +0 -1
  340. package/.next/static/chunks/next/dist/client/components/builtin/app-error-6b1496af498bb4fd.js +0 -1
  341. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-6b1496af498bb4fd.js +0 -1
  342. package/.next/static/chunks/next/dist/client/components/builtin/not-found-6b1496af498bb4fd.js +0 -1
  343. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6b1496af498bb4fd.js +0 -1
  344. package/.next/static/css/00f20b26266e86ed.css +0 -1
  345. package/.next/static/kRJ4zgHxJf680foSBrfpf/_buildManifest.js +0 -1
  346. /package/.next/static/{kRJ4zgHxJf680foSBrfpf → pzZcPiD8nl6i7i_Ne9Ko-}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=3432,a.ids=[3432],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")},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},7255:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k});var e=c(23211),f=c(48161),g=c(57075),h=c(80104),i=c(65630),j=a([i]);async function k(a,{params:b}){let{id:c}=await b,d=null,j=!1;try{let b=new URL(a.url);d=b.searchParams.get("path"),j="1"===b.searchParams.get("download")}catch{return e.NextResponse.json({error:"invalid url"},{status:400})}if(!d)return e.NextResponse.json({error:"path required"},{status:400});let l=(0,h.fM)(d,(0,f.tmpdir)());if(!l)return e.NextResponse.json({error:"invalid path"},{status:400});if(!await (0,i.jV)(l,c))return e.NextResponse.json({error:"forbidden"},{status:403});try{if(j){let{handle:a}=await (0,h.Vn)(l),b=g.Readable.toWeb(a.createReadStream());return new Response(b,{headers:{"Content-Type":"text/plain; charset=utf-8","Content-Disposition":'attachment; filename="bash-output.log"',"Cache-Control":"no-store"}})}let a=await (0,h.GV)(l);if(a.tooLarge)return e.NextResponse.json({error:`Full output is too large to display (limit ${h.gQ} bytes)`,data:{size:a.size,maxBytes:h.gQ}},{status:413});return e.NextResponse.json({success:!0,data:{output:a.content}})}catch{return e.NextResponse.json({error:"full output unavailable"},{status:404})}}i=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},49180:(a,b,c)=>{c.d(b,{ah:()=>e,iX:()=>h,j1:()=>i});let d=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function e(a){return!!a&&d.test(a)}function f(a){return a.replace(/\\/g,"/")}function g(a){return/[A-Za-z0-9._~+%@/\\:-]/.test(a)}function h(a,b){for(let c of b){let b=[];if(!function a(b,c){if("string"==typeof b)return void c.push(b);if(b&&"object"==typeof b){if(Array.isArray(b)){for(let d of b)a(d,c);return}for(let d of Object.values(b))a(d,c)}}(c,b),b.some(b=>(function(a,b){let c=f(b),d=c.startsWith("/")?[c,`file://${c}`]:[c];for(let b of new Set([f(a),f(function(a){try{return decodeURIComponent(a)}catch{return a}}(a))]))for(let a of d){let c=b.indexOf(a);for(;-1!==c;){let d=0===c?"":b[c-1],e=c+a.length;if((0===c||!g(d))&&function(a,b){if(b>=a.length)return!0;let c=a[b];return":"===c?/\d/.test(a[b+1]??""):!g(c)}(b,e))return!0;c=b.indexOf(a,c+1)}}return!1})(b,a)))return!0}return!1}function i(a,b){return b.some(b=>"message"===b.type&&"bashExecution"===b.message.role&&b.message.fullOutputPath===a)}},51455:a=>{a.exports=require("node:fs/promises")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},57075:a=>{a.exports=require("node:stream")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65630:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Iq:()=>h,jV:()=>i});var e=c(40402),f=c(49180),g=a([e]);async function h(a,b){if(!(0,f.ah)(b))return!1;try{let c=await (0,e.os)(b);if(!c)return!1;return(0,f.iX)(a,await (0,e.DK)(c))}catch{return!1}}async function i(a,b){if(!(0,f.ah)(b))return!1;try{let c=await (0,e.os)(b);if(!c)return!1;return(0,f.j1)(a,await (0,e.DK)(c))}catch{return!1}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},71021:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(7255),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/[id]/bash-output/route",pathname:"/api/agent/[id]/bash-output",filename:"route",bundlePath:"app/api/agent/[id]/bash-output/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\[id]\\bash-output\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/[id]/bash-output/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},80104:(a,b,c)=>{c.d(b,{GV:()=>j,Vn:()=>i,fM:()=>h,gQ:()=>g});var d=c(73024),e=c(51455),f=c(76760);let g=5242880;function h(a,b){let c=(0,f.resolve)(a);return(0,f.dirname)(c)===(0,f.resolve)(b)&&/^pi-bash-[A-Za-z0-9_-]+\.log$/.test((0,f.basename)(c))?c:null}async function i(a){if(!(await (0,e.lstat)(a)).isFile())throw Error("Bash output path is not a regular file");let b="number"==typeof d.constants.O_NOFOLLOW?d.constants.O_NOFOLLOW:0,c=await (0,e.open)(a,d.constants.O_RDONLY|b);try{let a=await c.stat();if(!a.isFile())throw Error("Bash output path is not a regular file");return{handle:c,fileInfo:a}}catch(a){throw await c.close(),a}}async function j(a,b=g){let{handle:c,fileInfo:d}=await i(a);try{if(d.size>b)return{tooLarge:!0,size:d.size};let a=Buffer.alloc(d.size),e=0;for(;e<a.length;){let b=await c.read(a,e,a.length-e,e);if(0===b.bytesRead)break;e+=b.bytesRead}return{tooLarge:!1,content:a.subarray(0,e).toString("utf8"),size:e}}finally{await c.close()}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582],()=>b(b.s=71021));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=3432,a.ids=[3432],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")},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},7255:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k});var e=c(23211),f=c(48161),g=c(57075),h=c(80104),i=c(65630),j=a([i]);async function k(a,{params:b}){let{id:c}=await b,d=null,j=!1;try{let b=new URL(a.url);d=b.searchParams.get("path"),j="1"===b.searchParams.get("download")}catch{return e.NextResponse.json({error:"invalid url"},{status:400})}if(!d)return e.NextResponse.json({error:"path required"},{status:400});let l=(0,h.fM)(d,(0,f.tmpdir)());if(!l)return e.NextResponse.json({error:"invalid path"},{status:400});if(!await (0,i.jV)(l,c))return e.NextResponse.json({error:"forbidden"},{status:403});try{if(j){let{handle:a}=await (0,h.Vn)(l),b=g.Readable.toWeb(a.createReadStream());return new Response(b,{headers:{"Content-Type":"text/plain; charset=utf-8","Content-Disposition":'attachment; filename="bash-output.log"',"Cache-Control":"no-store"}})}let a=await (0,h.GV)(l);if(a.tooLarge)return e.NextResponse.json({error:`Full output is too large to display (limit ${h.gQ} bytes)`,data:{size:a.size,maxBytes:h.gQ}},{status:413});return e.NextResponse.json({success:!0,data:{output:a.content}})}catch{return e.NextResponse.json({error:"full output unavailable"},{status:404})}}i=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},49180:(a,b,c)=>{c.d(b,{ah:()=>e,iX:()=>h,j1:()=>i});let d=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function e(a){return!!a&&d.test(a)}function f(a){return a.replace(/\\/g,"/")}function g(a){return/[A-Za-z0-9._~+%@/\\:-]/.test(a)}function h(a,b){for(let c of b){let b=[];if(!function a(b,c){if("string"==typeof b)return void c.push(b);if(b&&"object"==typeof b){if(Array.isArray(b)){for(let d of b)a(d,c);return}for(let d of Object.values(b))a(d,c)}}(c,b),b.some(b=>(function(a,b){let c=f(b),d=c.startsWith("/")?[c,`file://${c}`]:[c];for(let b of new Set([f(a),f(function(a){try{return decodeURIComponent(a)}catch{return a}}(a))]))for(let a of d){let c=b.indexOf(a);for(;-1!==c;){let d=0===c?"":b[c-1],e=c+a.length;if((0===c||!g(d))&&function(a,b){if(b>=a.length)return!0;let c=a[b];return":"===c?/\d/.test(a[b+1]??""):!g(c)}(b,e))return!0;c=b.indexOf(a,c+1)}}return!1})(b,a)))return!0}return!1}function i(a,b){return b.some(b=>"message"===b.type&&"bashExecution"===b.message.role&&b.message.fullOutputPath===a)}},51455:a=>{a.exports=require("node:fs/promises")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},57075:a=>{a.exports=require("node:stream")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65630:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Iq:()=>h,jV:()=>i});var e=c(40402),f=c(49180),g=a([e]);async function h(a,b){if(!(0,f.ah)(b))return!1;try{let c=await (0,e.os)(b);if(!c)return!1;return(0,f.iX)(a,await (0,e.DK)(c))}catch{return!1}}async function i(a,b){if(!(0,f.ah)(b))return!1;try{let c=await (0,e.os)(b);if(!c)return!1;return(0,f.j1)(a,await (0,e.DK)(c))}catch{return!1}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},80104:(a,b,c)=>{c.d(b,{GV:()=>j,Vn:()=>i,fM:()=>h,gQ:()=>g});var d=c(73024),e=c(51455),f=c(76760);let g=5242880;function h(a,b){let c=(0,f.resolve)(a);return(0,f.dirname)(c)===(0,f.resolve)(b)&&/^pi-bash-[A-Za-z0-9_-]+\.log$/.test((0,f.basename)(c))?c:null}async function i(a){if(!(await (0,e.lstat)(a)).isFile())throw Error("Bash output path is not a regular file");let b="number"==typeof d.constants.O_NOFOLLOW?d.constants.O_NOFOLLOW:0,c=await (0,e.open)(a,d.constants.O_RDONLY|b);try{let a=await c.stat();if(!a.isFile())throw Error("Bash output path is not a regular file");return{handle:c,fileInfo:a}}catch(a){throw await c.close(),a}}async function j(a,b=g){let{handle:c,fileInfo:d}=await i(a);try{if(d.size>b)return{tooLarge:!0,size:d.size};let a=Buffer.alloc(d.size),e=0;for(;e<a.length;){let b=await c.read(a,e,a.length-e,e);if(0===b.bytesRead)break;e+=b.bytesRead}return{tooLarge:!1,content:a.subarray(0,e).toString("utf8"),size:e}}finally{await c.close()}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92531:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(7255),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/[id]/bash-output/route",pathname:"/api/agent/[id]/bash-output",filename:"route",bundlePath:"app/api/agent/[id]/bash-output/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\[id]\\bash-output\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/[id]/bash-output/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582],()=>b(b.s=92531));module.exports=c})();
@@ -1,3 +1,3 @@
1
- "use strict";(()=>{var a={};a.id=5907,a.ids=[5907],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},19225:(a,b,c)=>{a.exports=c(44870)},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28315:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/skills")},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")},31421:a=>{a.exports=require("node:child_process")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},50561:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(74186),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/[id]/events/route",pathname:"/api/agent/[id]/events",filename:"route",bundlePath:"app/api/agent/[id]/events/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\[id]\\events\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/[id]/events/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},74186:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j,dynamic:()=>k});var e=c(40402),f=c(56429),g=c(66544),h=c(4157),i=a([e,f]);[e,f]=i.then?(await i)():i;let k="force-dynamic",l=new Set(["turn_start","turn_end","tool_execution_update"]);async function j(a,{params:b}){let{id:c}=await b;if(!(0,g.EN)(a))return new Response("Untrusted API request",{status:403});let d=(0,f.A4)(c);if(!d||!d.isAlive()){let a=await (0,e.os)(c);if(!a)return new Response("Session not found",{status:404});try{({session:d}=await (0,f.OF)(c,a,void 0))}catch{return new Response("Failed to start agent",{status:500})}}let i="1"===new URL(a.url).searchParams.get("timing"),k="1"===new URL(a.url).searchParams.get("entries"),m=new ReadableStream({start(b){let g=new TextEncoder,j=a=>{i&&(a={...a,serverEmittedAt:Date.now()});let c=`data: ${JSON.stringify(a)}
1
+ "use strict";(()=>{var a={};a.id=5907,a.ids=[5907],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},19225:(a,b,c)=>{a.exports=c(44870)},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28315:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/skills")},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")},31421:a=>{a.exports=require("node:child_process")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34215:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(74186),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/[id]/events/route",pathname:"/api/agent/[id]/events",filename:"route",bundlePath:"app/api/agent/[id]/events/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\[id]\\events\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/[id]/events/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},74186:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j,dynamic:()=>k});var e=c(40402),f=c(56429),g=c(66544),h=c(4157),i=a([e,f]);[e,f]=i.then?(await i)():i;let k="force-dynamic",l=new Set(["turn_start","turn_end","tool_execution_update"]);async function j(a,{params:b}){let{id:c}=await b;if(!(0,g.EN)(a))return new Response("Untrusted API request",{status:403});let d=(0,f.A4)(c);if(!d||!d.isAlive()){let a=await (0,e.os)(c);if(!a)return new Response("Session not found",{status:404});try{({session:d}=await (0,f.OF)(c,a,void 0))}catch{return new Response("Failed to start agent",{status:500})}}let i="1"===new URL(a.url).searchParams.get("timing"),k="1"===new URL(a.url).searchParams.get("entries"),m=new ReadableStream({start(b){let g=new TextEncoder,j=a=>{i&&(a={...a,serverEmittedAt:Date.now()});let c=`data: ${JSON.stringify(a)}
2
2
 
3
- `;b.enqueue(g.encode(c))},m=(0,f.KI)(j),n=d.onEvent(a=>{let b=k?"session_snapshot"===a.type?a:"agent_start"===a.type?{type:"agent_start"}:null:"session_snapshot"===a.type?null:function(a){if(l.has(a.type))return null;if("message_update"===a.type){let b={...a};return delete b.assistantMessageEvent,b}return"agent_end"===a.type?{type:"agent_end"}:a}(a);if(b){if(k)return void j(b);if(i)return void m.push({...b,serverObservedAt:Date.now(),streamEventType:a.assistantMessageEvent?.type});m.push(b)}},{keepAlive:k});if(j({type:"connected",sessionId:c}),k){let a=d.inner.sessionManager,b=a.getLeafId();b&&j({type:"session_snapshot",sessionId:c,entryId:b,context:(0,e.Uv)(a.getEntries(),b,{deferThinking:!0,deferToolResultImages:!0})})}let o=setInterval(()=>{try{b.enqueue(g.encode(":\n\n"))}catch{}},3e4),p="",q=setInterval(()=>{try{let a=(0,h.mN)(),b=a?`${a.requestId}:${a.phase}`:"";if(!a||b===p)return;p=b,j({type:"update_maintenance",requestId:a.requestId,phase:a.phase,stageHash:a.stageHash})}catch{}},2e3);a.signal?.addEventListener("abort",()=>{clearInterval(o),clearInterval(q),m.close(),n(),b.close()})}});return new Response(m,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},79646:a=>{a.exports=require("child_process")},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,5582,3229,6429],()=>b(b.s=50561));module.exports=c})();
3
+ `;b.enqueue(g.encode(c))},m=(0,f.KI)(j),n=d.onEvent(a=>{let b=k?"session_snapshot"===a.type?a:"agent_start"===a.type?{type:"agent_start"}:null:"session_snapshot"===a.type?null:function(a){if(l.has(a.type))return null;if("message_update"===a.type){let b={...a};return delete b.assistantMessageEvent,b}return"agent_end"===a.type?{type:"agent_end"}:a}(a);if(b){if(k)return void j(b);if(i)return void m.push({...b,serverObservedAt:Date.now(),streamEventType:a.assistantMessageEvent?.type});m.push(b)}},{keepAlive:k});if(j({type:"connected",sessionId:c}),k){let a=d.inner.sessionManager,b=a.getLeafId();b&&j({type:"session_snapshot",sessionId:c,entryId:b,context:(0,e.Uv)(a.getEntries(),b,{deferThinking:!0,deferToolResultImages:!0})})}let o=setInterval(()=>{try{b.enqueue(g.encode(":\n\n"))}catch{}},3e4),p="",q=setInterval(()=>{try{let a=(0,h.mN)(),b=a?`${a.requestId}:${a.phase}`:"";if(!a||b===p)return;p=b,j({type:"update_maintenance",requestId:a.requestId,phase:a.phase,stageHash:a.stageHash})}catch{}},2e3);a.signal?.addEventListener("abort",()=>{clearInterval(o),clearInterval(q),m.close(),n(),b.close()})}});return new Response(m,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},79646:a=>{a.exports=require("child_process")},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,5582,3229,6429],()=>b(b.s=34215));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=5221,a.ids=[5221],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28315:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/skills")},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")},31421:a=>{a.exports=require("node:child_process")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48233:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(79256),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/[id]/route",pathname:"/api/agent/[id]",filename:"route",bundlePath:"app/api/agent/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\[id]\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},79256:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,POST:()=>k});var e=c(23211),f=c(40402),g=c(56429),h=c(66544),i=c(4157),j=a([f,g]);async function k(a,{params:b}){let c;if(!(0,h.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,h.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});let d=(0,i.mN)();if(d)return e.NextResponse.json({error:`CUELO update ${d.phase}`,code:"update_draining",accepted:!1,requestId:d.requestId},{status:503});let j=performance.now(),{id:l}=await b,m=!1;try{let b=await a.json();c="string"==typeof b.type?b.type:void 0;let d=(0,g.A4)(l);if(d?.isAlive()){let a=performance.now(),c=await d.send(b);m="prompt"===b.type;let f=performance.now();return e.NextResponse.json({success:!0,data:c},{headers:{"Server-Timing":`session_prepare;dur=${(a-j).toFixed(2)}, command_accept;dur=${(f-a).toFixed(2)}, request;dur=${(f-j).toFixed(2)}`}})}let h=await (0,f.os)(l);if(!h)return e.NextResponse.json({error:"Session not found",..."prompt"===b.type?{code:"prompt_rejected",accepted:!1}:{}},{status:404});let{session:i}=await (0,g.OF)(l,h,void 0),k=performance.now(),n=await i.send(b);m="prompt"===b.type;let o=performance.now();return e.NextResponse.json({success:!0,data:n},{headers:{"Server-Timing":`session_prepare;dur=${(k-j).toFixed(2)}, command_accept;dur=${(o-k).toFixed(2)}, request;dur=${(o-j).toFixed(2)}`}})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a),..."prompt"===c&&!m?{code:"prompt_rejected",accepted:!1}:{}},{status:500})}}async function l(a,{params:b}){let{id:c}=await b;try{let a=(0,g.A4)(c);if(!a||!a.isAlive())return e.NextResponse.json({running:!1});let b=await a.send({type:"get_state"});return e.NextResponse.json({running:!0,state:b})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[f,g]=j.then?(await j)():j,d()}catch(a){d(a)}})},79646:a=>{a.exports=require("child_process")},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229,6429],()=>b(b.s=48233));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=5221,a.ids=[5221],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28315:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/skills")},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")},31421:a=>{a.exports=require("node:child_process")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},38255:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(79256),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/[id]/route",pathname:"/api/agent/[id]",filename:"route",bundlePath:"app/api/agent/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\[id]\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},79256:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,POST:()=>k});var e=c(23211),f=c(40402),g=c(56429),h=c(66544),i=c(4157),j=a([f,g]);async function k(a,{params:b}){let c;if(!(0,h.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,h.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});let d=(0,i.mN)();if(d)return e.NextResponse.json({error:`CUELO update ${d.phase}`,code:"update_draining",accepted:!1,requestId:d.requestId},{status:503});let j=performance.now(),{id:l}=await b,m=!1;try{let b=await a.json();c="string"==typeof b.type?b.type:void 0;let d=(0,g.A4)(l);if(d?.isAlive()){let a=performance.now(),c=await d.send(b);m="prompt"===b.type;let f=performance.now();return e.NextResponse.json({success:!0,data:c},{headers:{"Server-Timing":`session_prepare;dur=${(a-j).toFixed(2)}, command_accept;dur=${(f-a).toFixed(2)}, request;dur=${(f-j).toFixed(2)}`}})}let h=await (0,f.os)(l);if(!h)return e.NextResponse.json({error:"Session not found",..."prompt"===b.type?{code:"prompt_rejected",accepted:!1}:{}},{status:404});let{session:i}=await (0,g.OF)(l,h,void 0),k=performance.now(),n=await i.send(b);m="prompt"===b.type;let o=performance.now();return e.NextResponse.json({success:!0,data:n},{headers:{"Server-Timing":`session_prepare;dur=${(k-j).toFixed(2)}, command_accept;dur=${(o-k).toFixed(2)}, request;dur=${(o-j).toFixed(2)}`}})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a),..."prompt"===c&&!m?{code:"prompt_rejected",accepted:!1}:{}},{status:500})}}async function l(a,{params:b}){let{id:c}=await b;try{let a=(0,g.A4)(c);if(!a||!a.isAlive())return e.NextResponse.json({running:!1});let b=await a.send({type:"get_state"});return e.NextResponse.json({running:!0,state:b})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[f,g]=j.then?(await j)():j,d()}catch(a){d(a)}})},79646:a=>{a.exports=require("child_process")},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229,6429],()=>b(b.s=38255));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=6450,a.ids=[6450],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},4937:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>p});var e=c(23211),f=c(16131),g=c(29021),h=c(80547),i=c(40402),j=c(56429),k=c(5908),l=c(38741),m=c(66544),n=c(4157),o=a([f,h,i,j,l]);async function p(a){let b;if(!(0,m.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,m.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});let c=(0,n.mN)();if(c)return e.NextResponse.json({error:`CUELO update ${c.phase}`,code:"update_draining",accepted:!1,requestId:c.requestId},{status:503});let d=performance.now(),o=!1;try{let{cwd:c,...m}=await a.json();if(b="string"==typeof m.type?m.type:void 0,!c||"string"!=typeof c)return e.NextResponse.json({error:"cwd is required",..."prompt"===b?{code:"prompt_rejected",accepted:!1}:{}},{status:400});if(!(0,g.existsSync)(c))return e.NextResponse.json({error:`Directory does not exist: ${c}`,..."prompt"===b?{code:"prompt_rejected",accepted:!1}:{}},{status:400});let n=await (0,h.mc)();if(!(0,h.B7)(c,n))return e.NextResponse.json({error:"Access denied"},{status:403});let{provider:p,modelId:q,toolNames:r,thinkingLevel:s,oauthPosition:t,createRequestId:u,...v}=m;if(p&&!q||!p&&q)throw Error("provider and modelId must be provided together");let w=function(a){if(void 0===a)return;let b="string"==typeof a?(0,f.parseConfiguredThinkingLevel)(a):void 0;if(void 0===b)throw Error(`Invalid thinking level: ${String(a)}`);return b}(s),x=function(a){if(void 0!==a){if("number"!=typeof a||!Number.isSafeInteger(a)||a<0)throw Error(`Invalid oauthPosition: ${String(a)}`);return a}}(t);if(void 0!==x&&!(p&&q))throw Error("provider and modelId are required to select an account");let y=function(a){if(void 0!==a){if("string"!=typeof a||0===a.length||a.length>128)throw Error("Invalid createRequestId");return a}}(u);if(p&&q){let{modelRegistry:a}=await (0,l.getOmpRuntime)(),b=await (0,l.findModelWithRecovery)(a,p,q,{forceDiscovery:!0});if(b.miss)throw Error((0,k.zX)(b.miss))}let{session:z,realSessionId:A}=await (0,j.Yq)(y,c,{...r?{toolNames:r}:{},...p&&q?{initialModel:{provider:p,modelId:q}}:{},...w?{thinkingLevel:w}:{},...void 0!==x?{accountOauthPosition:x}:{}});(0,h.wz)(c),(0,i.mD)();let B=await z.send({type:"get_state"}),C=performance.now();if("ensure_session"===v.type)return e.NextResponse.json({success:!0,sessionId:A,data:null,model:B.model?{provider:B.model.provider,modelId:B.model.id}:null,thinkingLevel:B.thinkingLevel,configuredThinkingLevel:B.configuredThinkingLevel},{headers:{"Server-Timing":`session_prepare;dur=${(C-d).toFixed(2)}`}});let D=await z.send(v);o="prompt"===v.type;let E=performance.now();return e.NextResponse.json({success:!0,sessionId:A,data:D,model:B.model?{provider:B.model.provider,modelId:B.model.id}:null,thinkingLevel:B.thinkingLevel,configuredThinkingLevel:B.configuredThinkingLevel},{headers:{"Server-Timing":`session_prepare;dur=${(C-d).toFixed(2)}, command_accept;dur=${(E-C).toFixed(2)}, request;dur=${(E-d).toFixed(2)}`}})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a),..."prompt"===b&&!o?{code:"prompt_rejected",accepted:!1}:{}},{status:500})}}[f,h,i,j,l]=o.then?(await o)():o,d()}catch(a){d(a)}})},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},16131:a=>{a.exports=import("@oh-my-pi/pi-tui/thinking")},16781:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(4937),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/new/route",pathname:"/api/agent/new",filename:"route",bundlePath:"app/api/agent/new/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\new\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/new/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},21820:a=>{a.exports=require("os")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28315:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/skills")},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")},31421:a=>{a.exports=require("node:child_process")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},79646:a=>{a.exports=require("child_process")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,Nw:()=>i.Nw,mc:()=>n,uK:()=>m,wz:()=>i.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(25252),j=c(82536),k=c(40402),l=a([k]);k=(l.then?(await l)():l)[0];let q=/^[a-zA-Z]:[\\/]/;function m(a){return q.test(a)||a.startsWith("\\\\")||a.startsWith("//")}async function n(){let a=Date.now(),b=globalThis.__ompAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,k.wb)(),d=new Set;for(let a of c)a.cwd&&d.add((0,i.Nw)(a.cwd)),a.projectRoot&&d.add((0,i.Nw)(a.projectRoot));try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^omp-cwd-\d{8}$/.test(a)&&d.add((0,i.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,i.HM)())d.add(a);return globalThis.__ompAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function o(a,b){for(let c of b){let b=m(a)||m(c),d=b?h().win32:h(),e=b?"\\":h().sep,f=d.resolve(a),g=d.resolve(c),i=b?f.toLowerCase():f,j=b?g.toLowerCase():g,k=j.endsWith(e)?j:j+e;if(i===j||i.startsWith(k))return!0}return!1}function p(a,b){return(0,j.x)(a,b)}d()}catch(a){d(a)}})},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},82536:(a,b,c)=>{c.d(b,{x:()=>i});var d=c(29021),e=c(33873),f=c.n(e);let g=/^[a-zA-Z]:[\\/]/;function h(a){return g.test(a)||a.startsWith("\\\\")||a.startsWith("//")}function i(a,b){let c;try{c=(0,d.realpathSync)(a)}catch{return!1}let e=new Set;for(let a of b)try{e.add((0,d.realpathSync)(a))}catch{}return function(a,b){for(let c of b){let b=h(a)||h(c),d=b?f().win32:f(),e=b?"\\":f().sep,g=d.resolve(a),i=d.resolve(c),j=b?g.toLowerCase():g,k=b?i.toLowerCase():i,l=k.endsWith(e)?k:k+e;if(j===k||j.startsWith(l))return!0}return!1}(c,e)}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229,6429],()=>b(b.s=16781));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=6450,a.ids=[6450],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},4937:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>p});var e=c(23211),f=c(16131),g=c(29021),h=c(80547),i=c(40402),j=c(56429),k=c(5908),l=c(38741),m=c(66544),n=c(4157),o=a([f,h,i,j,l]);async function p(a){let b;if(!(0,m.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,m.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});let c=(0,n.mN)();if(c)return e.NextResponse.json({error:`CUELO update ${c.phase}`,code:"update_draining",accepted:!1,requestId:c.requestId},{status:503});let d=performance.now(),o=!1;try{let{cwd:c,...m}=await a.json();if(b="string"==typeof m.type?m.type:void 0,!c||"string"!=typeof c)return e.NextResponse.json({error:"cwd is required",..."prompt"===b?{code:"prompt_rejected",accepted:!1}:{}},{status:400});if(!(0,g.existsSync)(c))return e.NextResponse.json({error:`Directory does not exist: ${c}`,..."prompt"===b?{code:"prompt_rejected",accepted:!1}:{}},{status:400});let n=await (0,h.mc)();if(!(0,h.B7)(c,n))return e.NextResponse.json({error:"Access denied"},{status:403});let{provider:p,modelId:q,toolNames:r,thinkingLevel:s,oauthPosition:t,createRequestId:u,...v}=m;if(p&&!q||!p&&q)throw Error("provider and modelId must be provided together");let w=function(a){if(void 0===a)return;let b="string"==typeof a?(0,f.parseConfiguredThinkingLevel)(a):void 0;if(void 0===b)throw Error(`Invalid thinking level: ${String(a)}`);return b}(s),x=function(a){if(void 0!==a){if("number"!=typeof a||!Number.isSafeInteger(a)||a<0)throw Error(`Invalid oauthPosition: ${String(a)}`);return a}}(t);if(void 0!==x&&!(p&&q))throw Error("provider and modelId are required to select an account");let y=function(a){if(void 0!==a){if("string"!=typeof a||0===a.length||a.length>128)throw Error("Invalid createRequestId");return a}}(u);if(p&&q){let{modelRegistry:a}=await (0,l.getOmpRuntime)(),b=await (0,l.findModelWithRecovery)(a,p,q,{forceDiscovery:!0});if(b.miss)throw Error((0,k.zX)(b.miss))}let{session:z,realSessionId:A}=await (0,j.Yq)(y,c,{...r?{toolNames:r}:{},...p&&q?{initialModel:{provider:p,modelId:q}}:{},...w?{thinkingLevel:w}:{},...void 0!==x?{accountOauthPosition:x}:{}});(0,h.wz)(c),(0,i.mD)();let B=await z.send({type:"get_state"}),C=performance.now();if("ensure_session"===v.type)return e.NextResponse.json({success:!0,sessionId:A,data:null,model:B.model?{provider:B.model.provider,modelId:B.model.id}:null,thinkingLevel:B.thinkingLevel,configuredThinkingLevel:B.configuredThinkingLevel},{headers:{"Server-Timing":`session_prepare;dur=${(C-d).toFixed(2)}`}});let D=await z.send(v);o="prompt"===v.type;let E=performance.now();return e.NextResponse.json({success:!0,sessionId:A,data:D,model:B.model?{provider:B.model.provider,modelId:B.model.id}:null,thinkingLevel:B.thinkingLevel,configuredThinkingLevel:B.configuredThinkingLevel},{headers:{"Server-Timing":`session_prepare;dur=${(C-d).toFixed(2)}, command_accept;dur=${(E-C).toFixed(2)}, request;dur=${(E-d).toFixed(2)}`}})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a),..."prompt"===b&&!o?{code:"prompt_rejected",accepted:!1}:{}},{status:500})}}[f,h,i,j,l]=o.then?(await o)():o,d()}catch(a){d(a)}})},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},16131:a=>{a.exports=import("@oh-my-pi/pi-tui/thinking")},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},21820:a=>{a.exports=require("os")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28315:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/skills")},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")},31421:a=>{a.exports=require("node:child_process")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},57555:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(4937),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/new/route",pathname:"/api/agent/new",filename:"route",bundlePath:"app/api/agent/new/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\new\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/new/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},79646:a=>{a.exports=require("child_process")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,Nw:()=>i.Nw,Ph:()=>r,mU:()=>s,mc:()=>n,uK:()=>m,wz:()=>i.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(25252),j=c(82536),k=c(40402),l=a([k]);k=(l.then?(await l)():l)[0];let t=/^[a-zA-Z]:[\\/]/;function m(a){return t.test(a)||a.startsWith("\\\\")||a.startsWith("//")}async function n(){let a=Date.now(),b=globalThis.__ompAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,k.wb)(),d=new Set;for(let a of c)a.cwd&&d.add((0,i.Nw)(a.cwd)),a.projectRoot&&d.add((0,i.Nw)(a.projectRoot));try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^omp-cwd-\d{8}$/.test(a)&&d.add((0,i.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,i.HM)())d.add(a);return globalThis.__ompAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function o(a,b){for(let c of b){let b=m(a)||m(c),d=b?h().win32:h(),e=b?"\\":h().sep,f=d.resolve(a),g=d.resolve(c),i=b?f.toLowerCase():f,j=b?g.toLowerCase():g,k=j.endsWith(e)?j:j+e;if(i===j||i.startsWith(k))return!0}return!1}function p(a,b){return(0,j.x)(a,b)}function q(a){return"string"==typeof a?.windows&&t.test(a.windows)&&"string"==typeof a.local&&h().posix.isAbsolute(a.local)}function r(a=(0,k.$M)()){let b=globalThis.__cueloLegacyPathMaps??=new Map,c=b.get(a);if(c)return c;let d=[];try{let b=JSON.parse((0,e.readFileSync)(h().join(a,"cuelo-legacy-paths.json"),"utf8"));Array.isArray(b?.prefixes)&&(d=b.prefixes.filter(q))}catch{}return b.set(a,d),d}function s(a,b){if(!b.length||!t.test(a))return a;let c=a=>h().win32.normalize(a).split("\\").filter(Boolean),d=c(a),e=d.map(a=>a.toLowerCase()),f=null;for(let a of b){let b=c(a.windows).map(a=>a.toLowerCase());b.length>e.length||f&&b.length<=f.length||b.every((a,b)=>a===e[b])&&(f={length:b.length,local:a.local})}return f?h().posix.join(f.local,...d.slice(f.length)):a}d()}catch(a){d(a)}})},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},82536:(a,b,c)=>{c.d(b,{x:()=>i});var d=c(29021),e=c(33873),f=c.n(e);let g=/^[a-zA-Z]:[\\/]/;function h(a){return g.test(a)||a.startsWith("\\\\")||a.startsWith("//")}function i(a,b){let c;try{c=(0,d.realpathSync)(a)}catch{return!1}let e=new Set;for(let a of b)try{e.add((0,d.realpathSync)(a))}catch{}return function(a,b){for(let c of b){let b=h(a)||h(c),d=b?f().win32:f(),e=b?"\\":f().sep,g=d.resolve(a),i=d.resolve(c),j=b?g.toLowerCase():g,k=b?i.toLowerCase():i,l=k.endsWith(e)?k:k+e;if(j===k||j.startsWith(l))return!0}return!1}(c,e)}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229,6429],()=>b(b.s=57555));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=8197,a.ids=[8197],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},5452:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,dynamic:()=>i});var e=c(23211),f=c(56429),g=a([f]);f=(g.then?(await g)():g)[0];let i="force-dynamic";async function h(){return e.NextResponse.json({runningSessionIds:(0,f.HG)()},{headers:{"Cache-Control":"no-store"}})}d()}catch(a){d(a)}})},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28315:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/skills")},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")},31421:a=>{a.exports=require("node:child_process")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},63941:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(5452),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/running/route",pathname:"/api/agent/running",filename:"route",bundlePath:"app/api/agent/running/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\running\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/running/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},79646:a=>{a.exports=require("child_process")},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229,6429],()=>b(b.s=63941));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=8197,a.ids=[8197],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},2507:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(5452),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/running/route",pathname:"/api/agent/running",filename:"route",bundlePath:"app/api/agent/running/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\agent\\running\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/running/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},5452:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,dynamic:()=>i});var e=c(23211),f=c(56429),g=a([f]);f=(g.then?(await g)():g)[0];let i="force-dynamic";async function h(){return e.NextResponse.json({runningSessionIds:(0,f.HG)()},{headers:{"Cache-Control":"no-store"}})}d()}catch(a){d(a)}})},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28315:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/skills")},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")},31421:a=>{a.exports=require("node:child_process")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},79646:a=>{a.exports=require("child_process")},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229,6429],()=>b(b.s=2507));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=5449,a.ids=[5449],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47129:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(72120),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/attachment-settings/route",pathname:"/api/attachment-settings",filename:"route",bundlePath:"app/api/attachment-settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\attachment-settings\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/attachment-settings/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72120:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,PATCH:()=>l,dynamic:()=>n,runtime:()=>m});var e=c(34069),f=c(23211),g=c(69689),h=c(2979),i=c(66544),j=a([e,h]);[e,h]=j.then?(await j)():j;let m="nodejs",n="force-dynamic",o={"Cache-Control":"no-store"};async function k(a){if(!(0,i.EN)(a))return f.NextResponse.json({error:"Untrusted API request"},{status:403});try{return f.NextResponse.json(await (0,h.dk)((0,e.getAgentDir)()),{headers:o})}catch(a){return f.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function l(a){let b;if(!(0,i.EN)(a))return f.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,i.E2)(a))return f.NextResponse.json({error:"application/json body required"},{status:415});try{b=await a.json()}catch{return f.NextResponse.json({error:"Malformed JSON body"},{status:400})}let c=(0,g.y1)(b);if(!c.ok)return f.NextResponse.json({error:c.error},{status:400});try{return f.NextResponse.json(await (0,h.uC)((0,e.getAgentDir)(),c.patch),{headers:o})}catch(a){return f.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},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,5270],()=>b(b.s=47129));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=5449,a.ids=[5449],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71775:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(72120),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/attachment-settings/route",pathname:"/api/attachment-settings",filename:"route",bundlePath:"app/api/attachment-settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\attachment-settings\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/attachment-settings/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},72120:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,PATCH:()=>l,dynamic:()=>n,runtime:()=>m});var e=c(34069),f=c(23211),g=c(69689),h=c(2979),i=c(66544),j=a([e,h]);[e,h]=j.then?(await j)():j;let m="nodejs",n="force-dynamic",o={"Cache-Control":"no-store"};async function k(a){if(!(0,i.EN)(a))return f.NextResponse.json({error:"Untrusted API request"},{status:403});try{return f.NextResponse.json(await (0,h.dk)((0,e.getAgentDir)()),{headers:o})}catch(a){return f.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function l(a){let b;if(!(0,i.EN)(a))return f.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,i.E2)(a))return f.NextResponse.json({error:"application/json body required"},{status:415});try{b=await a.json()}catch{return f.NextResponse.json({error:"Malformed JSON body"},{status:400})}let c=(0,g.y1)(b);if(!c.ok)return f.NextResponse.json({error:c.error},{status:400});try{return f.NextResponse.json(await (0,h.uC)((0,e.getAgentDir)(),c.patch),{headers:o})}catch(a){return f.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},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,5270],()=>b(b.s=71775));module.exports=c})();
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var a={};a.id=5807,a.ids=[5807],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11746:a=>{a.exports=import("@oh-my-pi/pi-ai")},18369:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(49974),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/attachments/[id]/transcription/route",pathname:"/api/attachments/[id]/transcription",filename:"route",bundlePath:"app/api/attachments/[id]/transcription/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\attachments\\[id]\\transcription\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/attachments/[id]/transcription/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},41878:(a,b,c)=>{c.d(b,{k3:()=>D,hM:()=>r,VF:()=>B,a2:()=>C});var d=c(31421),e=c(73024),f=c(51455),g=c(48161),h=c(76760);let i=require("ffmpeg-static");var j=c.n(i),k=c(91524),l=c(90876);let m=["-ac","1","-ar","16000","-c:a","libmp3lame","-b:a","32k"],n=/^part-\d{4}\.mp3$/;class o extends Error{constructor(a,b,c,d={}){super(b),this.code=a,this.status=c,this.details=d,this.name="AudioTranscriptionError"}}let p=()=>new o("aborted","Transcription was cancelled",499),q=()=>new o("media_unreadable","The attachment has no readable audio stream",422);async function r(){if(!j()||!(0,e.existsSync)(j()))throw new o("media_tool_unavailable","FFmpeg is not available on this server; reinstall CUELO to restore it",503);return j()}function s(a){return["-protocol_whitelist","file","-format_whitelist","mov,mp4,m4a,3gp,3g2,mj2,mp3,wav,ogg,flac,matroska,webm,aac,aiff","-i",`file:${a}`]}function t(a,b,c){if(c?.aborted)return Promise.reject(p());let{promise:e,resolve:f,reject:g}=Promise.withResolvers(),h=(0,d.spawn)(a,["-hide_banner","-nostdin","-v","error",...b],{stdio:["ignore","pipe","pipe"],windowsHide:!0,signal:c}),i="",j="";return h.stdout.setEncoding("utf8").on("data",a=>{i=(i+a).slice(-4096)}),h.stderr.setEncoding("utf8").on("data",a=>{j=(j+a).slice(-4096)}),h.on("error",()=>{void 0===h.pid&&g(c?.aborted?p():new o("media_tool_unavailable","FFmpeg could not be started",503))}),h.on("close",a=>c?.aborted?g(p()):0===a?f(i):void(console.warn(`[attachment-audio] ffmpeg exited with ${a}: ${j.trim()}`),g(q()))),e}async function u(a,b,c){let d=await t(a,[...s(b),"-map","0:a:0","-c","copy","-f","null","-progress","pipe:1","-nostats","-"],c),e=Number([...d.matchAll(/^out_time_us=(\d+)\s*$/gm)].at(-1)?.[1]);if(!Number.isFinite(e)||e<=0)throw q();return e/1e6}function v(a){if(!a.mimeType.toLowerCase().startsWith("audio/"))throw new o("not_audio","Only audio attachments can be transcribed",415)}async function w(a,{resolveFfmpeg:b,signal:c}){let d,e,f,g;if(v(a),a.size<=l.E)return{durationSeconds:null,estimatedCalls:1,requiresConfirmation:!1,processing:"direct",notice:"The audio is sent as it is in one transcription request on the Antigravity account."};let h=await u(await b(),a.path,c),i=Math.ceil(h/600);return{durationSeconds:h,estimatedCalls:i,requiresConfirmation:!0,processing:"compress-and-split",notice:`The audio is ${e=Math.floor((d=Math.round(h))/3600),f=Math.floor(d%3600/60),g=String(d%60).padStart(2,"0"),e>0?`${e}:${String(f).padStart(2,"0")}:${g}`:`${f}:${g}`} long. A compressed copy is split into ${i} part${1===i?"":"s"} of up to 10 minutes, sent one after another as ${i} transcription request${1===i?"":"s"} that count toward the Antigravity account's usage. Each request can take up to ${k.nA/6e4} minutes. The original file stays unchanged.`}}async function x(a,b,{transcribe:c,signal:d}){let e=[];for(let[g,h]of a.entries()){if(d?.aborted)throw p();let i=new Uint8Array(await (0,f.readFile)(h));try{e.push(await c(i,b,d))}catch(c){if(d?.aborted)throw p();let b=c instanceof Error?c.message:String(c);throw new o("transcription_failed",1===a.length?b:`part ${g+1} of ${a.length} failed: ${b}`,502,{completedParts:g,parts:a.length})}}return{transcript:e.join("\n\n"),parts:a.length}}async function y(a,b){let c=await b.resolveFfmpeg(),d=b.maxPartBytes??l.E,e=await (0,f.mkdtemp)((0,h.join)(b.tmpRoot??(0,g.tmpdir)(),"cuelo-audio-"));try{await t(c,[...s(a.path),"-map","0:a:0",...m,"-f","segment","-segment_time",String(600),"-reset_timestamps","1",(0,h.join)(e,"part-%04d.mp3")],b.signal);let g=(await (0,f.readdir)(e)).filter(a=>n.test(a)).sort().map(a=>(0,h.join)(e,a));if(0===g.length)throw q();for(let a of g)if((await (0,f.stat)(a)).size>d)throw new o("part_too_large","A converted part is larger than the transcription limit",500);return await x(g,"audio/mpeg",b)}finally{await (0,f.rm)(e,{recursive:!0,force:!0,maxRetries:3})}}async function z(a,b){let c;v(a);let d=a.size>l.E;if(d&&!0!==b.confirmed)throw new o("confirmation_required","Large audio needs confirmation before it is transcribed",409);let e=(c=globalThis,c.__cueloAudioTranscriptions??=new Set,c.__cueloAudioTranscriptions);if(e.has(a.id))throw new o("in_progress","This attachment is already being transcribed",409);e.add(a.id);try{return d?await y(a,b):await x([a.path],a.mimeType,b)}finally{e.delete(a.id)}}function A(a){return a instanceof o?Response.json({code:a.code,error:a.message,...a.details},{status:a.status}):(console.error("[attachment-audio] unexpected failure",a),Response.json({code:"internal",error:"Transcription failed unexpectedly"},{status:500}))}async function B(a,b){try{return Response.json(await w(a,b))}catch(a){return A(a)}}async function C(a,{confirmed:b},c){try{return Response.json(await z(a,{...c,confirmed:b}))}catch(b){if(!(b instanceof o)||"confirmation_required"!==b.code)return A(b);try{let d=await w(a,c);return Response.json({code:b.code,error:b.message,plan:d},{status:b.status})}catch(a){return A(a)}}}async function D(a){let b,c=await a.text();if(!c.trim())return{confirmed:!1};try{b=JSON.parse(c)}catch{return null}if(!b||"object"!=typeof b||Array.isArray(b))return null;let{confirmed:d}=b;return void 0!==d&&"boolean"!=typeof d?null:{confirmed:!0===d}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},49974:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,POST:()=>m,dynamic:()=>o,runtime:()=>n});var e=c(23211),f=c(91524),g=c(41878),h=c(2979),i=c(66544),j=a([h]);h=(j.then?(await j)():j)[0];let n="nodejs",o="force-dynamic";function k(a){if(a instanceof h.bO)switch(a.code){case"invalid_id":return e.NextResponse.json({code:a.code,error:"Invalid attachment id"},{status:400});case"not_found":return e.NextResponse.json({code:a.code,error:"Attachment not found"},{status:404});case"busy":return e.NextResponse.json({code:a.code,error:"Attachment is being cleaned up; try again"},{status:503})}return console.error("[attachments/transcription] unexpected failure",a),e.NextResponse.json({code:"internal",error:"Transcription failed unexpectedly"},{status:500})}async function l(a,{params:b}){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});let{id:c}=await b;try{return await (0,h.rE)(c,b=>(0,g.VF)(b,{resolveFfmpeg:g.hM,signal:a.signal}))}catch(a){return k(a)}}async function m(a,{params:b}){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});let{id:c}=await b,d=await (0,g.k3)(a);if(!d)return e.NextResponse.json({code:"invalid_body",error:"Body must be empty or { confirmed?: boolean }"},{status:400});try{return await (0,h.rE)(c,b=>(0,g.a2)(b,d,{resolveFfmpeg:g.hM,transcribe:f.Du,signal:a.signal}))}catch(a){return k(a)}}d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90876:(a,b,c)=>{c.d(b,{E:()=>d});let d=0xe00000},91524:(a,b,c)=>{c.d(b,{Du:()=>i,nA:()=>g});var d=c(90876);let e="google-antigravity",f="gemini-3.8-flash",g=18e4;class h extends Error{}async function i(a,b,i){let j;if(a.byteLength>d.E)throw Error(`audio exceeds the ${d.E/1024/1024} MB transcription limit`);let[{completeSimple:k},{getOmpRuntime:l}]=await Promise.all([Promise.resolve().then(c.bind(c,11746)),c.e(8741).then(c.bind(c,38741))]),{modelRegistry:m}=await l(),n=m.find(e,f);if(!n)throw Error(`${e}/${f} is not available`);if(!n.input.includes("image"))throw Error(`${f} does not accept inline media`);let o=await m.getApiKeyAndHeaders(n);if(!o.ok||!o.apiKey)throw Error(o.ok?`No credentials for ${e}`:o.error);let p=AbortSignal.timeout(g),q={messages:[{role:"user",content:[{type:"text",text:"Transcribe the speech in this audio file verbatim.\n- Keep the spoken language; do not translate or summarize.\n- Output only the transcript text: no heading, quotes, timestamps, or commentary.\n- If several people speak, start each speaker change on a new line.\n- If there is no intelligible speech, output exactly: [no speech]"},{type:"image",mimeType:b,data:Buffer.from(a).toString("base64")}],timestamp:Date.now()}]},r={apiKey:o.apiKey,headers:o.headers,maxTokens:32768,disableReasoning:!0,cacheRetention:"none",signal:i?AbortSignal.any([i,p]):p};for(let a=0;a<2;a+=1)try{return function(a){let b=a.content.filter(a=>"text"===a.type&&"string"==typeof a.text).map(a=>a.text).join("").trim();if("stop"!==a.stopReason&&"length"!==a.stopReason){let c=[a.errorMessage,b.slice(0,160)].filter(Boolean).join("; ");throw new h(`transcription stopped: ${a.stopReason}${c?` (${c})`:""}`)}if(!b)throw Error("transcription returned no text");return"length"===a.stopReason?`${b}
2
- [transcript truncated at the output limit]`:b}(await k(n,q,r))}catch(a){if(!(a instanceof h)||r.signal.aborted)throw a;j=a}throw j}},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5270],()=>b(b.s=18369));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=5807,a.ids=[5807],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11746:a=>{a.exports=import("@oh-my-pi/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},41878:(a,b,c)=>{c.d(b,{k3:()=>D,hM:()=>r,VF:()=>B,a2:()=>C});var d=c(31421),e=c(73024),f=c(51455),g=c(48161),h=c(76760);let i=require("ffmpeg-static");var j=c.n(i),k=c(91524),l=c(90876);let m=["-ac","1","-ar","16000","-c:a","libmp3lame","-b:a","32k"],n=/^part-\d{4}\.mp3$/;class o extends Error{constructor(a,b,c,d={}){super(b),this.code=a,this.status=c,this.details=d,this.name="AudioTranscriptionError"}}let p=()=>new o("aborted","Transcription was cancelled",499),q=()=>new o("media_unreadable","The attachment has no readable audio stream",422);async function r(){if(!j()||!(0,e.existsSync)(j()))throw new o("media_tool_unavailable","FFmpeg is not available on this server; reinstall CUELO to restore it",503);return j()}function s(a){return["-protocol_whitelist","file","-format_whitelist","mov,mp4,m4a,3gp,3g2,mj2,mp3,wav,ogg,flac,matroska,webm,aac,aiff","-i",`file:${a}`]}function t(a,b,c){if(c?.aborted)return Promise.reject(p());let{promise:e,resolve:f,reject:g}=Promise.withResolvers(),h=(0,d.spawn)(a,["-hide_banner","-nostdin","-v","error",...b],{stdio:["ignore","pipe","pipe"],windowsHide:!0,signal:c}),i="",j="";return h.stdout.setEncoding("utf8").on("data",a=>{i=(i+a).slice(-4096)}),h.stderr.setEncoding("utf8").on("data",a=>{j=(j+a).slice(-4096)}),h.on("error",()=>{void 0===h.pid&&g(c?.aborted?p():new o("media_tool_unavailable","FFmpeg could not be started",503))}),h.on("close",a=>c?.aborted?g(p()):0===a?f(i):void(console.warn(`[attachment-audio] ffmpeg exited with ${a}: ${j.trim()}`),g(q()))),e}async function u(a,b,c){let d=await t(a,[...s(b),"-map","0:a:0","-c","copy","-f","null","-progress","pipe:1","-nostats","-"],c),e=Number([...d.matchAll(/^out_time_us=(\d+)\s*$/gm)].at(-1)?.[1]);if(!Number.isFinite(e)||e<=0)throw q();return e/1e6}function v(a){if(!a.mimeType.toLowerCase().startsWith("audio/"))throw new o("not_audio","Only audio attachments can be transcribed",415)}async function w(a,{resolveFfmpeg:b,signal:c}){let d,e,f,g;if(v(a),a.size<=l.E)return{durationSeconds:null,estimatedCalls:1,requiresConfirmation:!1,processing:"direct",notice:"The audio is sent as it is in one transcription request on the Antigravity account."};let h=await u(await b(),a.path,c),i=Math.ceil(h/600);return{durationSeconds:h,estimatedCalls:i,requiresConfirmation:!0,processing:"compress-and-split",notice:`The audio is ${e=Math.floor((d=Math.round(h))/3600),f=Math.floor(d%3600/60),g=String(d%60).padStart(2,"0"),e>0?`${e}:${String(f).padStart(2,"0")}:${g}`:`${f}:${g}`} long. A compressed copy is split into ${i} part${1===i?"":"s"} of up to 10 minutes, sent one after another as ${i} transcription request${1===i?"":"s"} that count toward the Antigravity account's usage. Each request can take up to ${k.nA/6e4} minutes. The original file stays unchanged.`}}async function x(a,b,{transcribe:c,signal:d}){let e=[];for(let[g,h]of a.entries()){if(d?.aborted)throw p();let i=new Uint8Array(await (0,f.readFile)(h));try{e.push(await c(i,b,d))}catch(c){if(d?.aborted)throw p();let b=c instanceof Error?c.message:String(c);throw new o("transcription_failed",1===a.length?b:`part ${g+1} of ${a.length} failed: ${b}`,502,{completedParts:g,parts:a.length})}}return{transcript:e.join("\n\n"),parts:a.length}}async function y(a,b){let c=await b.resolveFfmpeg(),d=b.maxPartBytes??l.E,e=await (0,f.mkdtemp)((0,h.join)(b.tmpRoot??(0,g.tmpdir)(),"cuelo-audio-"));try{await t(c,[...s(a.path),"-map","0:a:0",...m,"-f","segment","-segment_time",String(600),"-reset_timestamps","1",(0,h.join)(e,"part-%04d.mp3")],b.signal);let g=(await (0,f.readdir)(e)).filter(a=>n.test(a)).sort().map(a=>(0,h.join)(e,a));if(0===g.length)throw q();for(let a of g)if((await (0,f.stat)(a)).size>d)throw new o("part_too_large","A converted part is larger than the transcription limit",500);return await x(g,"audio/mpeg",b)}finally{await (0,f.rm)(e,{recursive:!0,force:!0,maxRetries:3})}}async function z(a,b){let c;v(a);let d=a.size>l.E;if(d&&!0!==b.confirmed)throw new o("confirmation_required","Large audio needs confirmation before it is transcribed",409);let e=(c=globalThis,c.__cueloAudioTranscriptions??=new Set,c.__cueloAudioTranscriptions);if(e.has(a.id))throw new o("in_progress","This attachment is already being transcribed",409);e.add(a.id);try{return d?await y(a,b):await x([a.path],a.mimeType,b)}finally{e.delete(a.id)}}function A(a){return a instanceof o?Response.json({code:a.code,error:a.message,...a.details},{status:a.status}):(console.error("[attachment-audio] unexpected failure",a),Response.json({code:"internal",error:"Transcription failed unexpectedly"},{status:500}))}async function B(a,b){try{return Response.json(await w(a,b))}catch(a){return A(a)}}async function C(a,{confirmed:b},c){try{return Response.json(await z(a,{...c,confirmed:b}))}catch(b){if(!(b instanceof o)||"confirmation_required"!==b.code)return A(b);try{let d=await w(a,c);return Response.json({code:b.code,error:b.message,plan:d},{status:b.status})}catch(a){return A(a)}}}async function D(a){let b,c=await a.text();if(!c.trim())return{confirmed:!1};try{b=JSON.parse(c)}catch{return null}if(!b||"object"!=typeof b||Array.isArray(b))return null;let{confirmed:d}=b;return void 0!==d&&"boolean"!=typeof d?null:{confirmed:!0===d}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},49974:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,POST:()=>m,dynamic:()=>o,runtime:()=>n});var e=c(23211),f=c(91524),g=c(41878),h=c(2979),i=c(66544),j=a([h]);h=(j.then?(await j)():j)[0];let n="nodejs",o="force-dynamic";function k(a){if(a instanceof h.bO)switch(a.code){case"invalid_id":return e.NextResponse.json({code:a.code,error:"Invalid attachment id"},{status:400});case"not_found":return e.NextResponse.json({code:a.code,error:"Attachment not found"},{status:404});case"busy":return e.NextResponse.json({code:a.code,error:"Attachment is being cleaned up; try again"},{status:503})}return console.error("[attachments/transcription] unexpected failure",a),e.NextResponse.json({code:"internal",error:"Transcription failed unexpectedly"},{status:500})}async function l(a,{params:b}){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});let{id:c}=await b;try{return await (0,h.rE)(c,b=>(0,g.VF)(b,{resolveFfmpeg:g.hM,signal:a.signal}))}catch(a){return k(a)}}async function m(a,{params:b}){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});let{id:c}=await b,d=await (0,g.k3)(a);if(!d)return e.NextResponse.json({code:"invalid_body",error:"Body must be empty or { confirmed?: boolean }"},{status:400});try{return await (0,h.rE)(c,b=>(0,g.a2)(b,d,{resolveFfmpeg:g.hM,transcribe:f.Du,signal:a.signal}))}catch(a){return k(a)}}d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64263:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(49974),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/attachments/[id]/transcription/route",pathname:"/api/attachments/[id]/transcription",filename:"route",bundlePath:"app/api/attachments/[id]/transcription/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\attachments\\[id]\\transcription\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/attachments/[id]/transcription/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90876:(a,b,c)=>{c.d(b,{E:()=>d});let d=0xe00000},91524:(a,b,c)=>{c.d(b,{Du:()=>i,nA:()=>g});var d=c(90876);let e="google-antigravity",f="gemini-3.8-flash",g=18e4;class h extends Error{}async function i(a,b,i){let j;if(a.byteLength>d.E)throw Error(`audio exceeds the ${d.E/1024/1024} MB transcription limit`);let[{completeSimple:k},{getOmpRuntime:l}]=await Promise.all([Promise.resolve().then(c.bind(c,11746)),c.e(8741).then(c.bind(c,38741))]),{modelRegistry:m}=await l(),n=m.find(e,f);if(!n)throw Error(`${e}/${f} is not available`);if(!n.input.includes("image"))throw Error(`${f} does not accept inline media`);let o=await m.getApiKeyAndHeaders(n);if(!o.ok||!o.apiKey)throw Error(o.ok?`No credentials for ${e}`:o.error);let p=AbortSignal.timeout(g),q={messages:[{role:"user",content:[{type:"text",text:"Transcribe the speech in this audio file verbatim.\n- Keep the spoken language; do not translate or summarize.\n- Output only the transcript text: no heading, quotes, timestamps, or commentary.\n- If several people speak, start each speaker change on a new line.\n- If there is no intelligible speech, output exactly: [no speech]"},{type:"image",mimeType:b,data:Buffer.from(a).toString("base64")}],timestamp:Date.now()}]},r={apiKey:o.apiKey,headers:o.headers,maxTokens:32768,disableReasoning:!0,cacheRetention:"none",signal:i?AbortSignal.any([i,p]):p};for(let a=0;a<2;a+=1)try{return function(a){let b=a.content.filter(a=>"text"===a.type&&"string"==typeof a.text).map(a=>a.text).join("").trim();if("stop"!==a.stopReason&&"length"!==a.stopReason){let c=[a.errorMessage,b.slice(0,160)].filter(Boolean).join("; ");throw new h(`transcription stopped: ${a.stopReason}${c?` (${c})`:""}`)}if(!b)throw Error("transcription returned no text");return"length"===a.stopReason?`${b}
2
+ [transcript truncated at the output limit]`:b}(await k(n,q,r))}catch(a){if(!(a instanceof h)||r.signal.aborted)throw a;j=a}throw j}},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5270],()=>b(b.s=64263));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=2504,a.ids=[2504],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67315:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{PUT:()=>k,dynamic:()=>m,runtime:()=>l});var e=c(23211),f=c(2979),g=c(36208),h=c(66544),i=a([f]);f=(i.then?(await i)():i)[0];let l="nodejs",m="force-dynamic";function j(a,b,c,d={}){return e.NextResponse.json({code:b,error:c,...d},{status:a})}async function k(a){let b;if(!(0,h.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,h.E2)(a))return j(415,"unsupported","application/json body required");try{b=await a.json()}catch{return j(400,"invalid_json","Malformed JSON body")}let{draftId:c,attachmentIds:d,sentAttachmentIds:i=[]}=b&&"object"==typeof b?b:{};if(!(0,g.Ly)(c))return j(400,"invalid_draft","draftId must be a UUID");for(let a of[d,i])if(!Array.isArray(a)||a.length>f.kF||!a.every(g.YC))return j(400,"invalid_attachment_ids",`attachmentIds and sentAttachmentIds must list at most ${f.kF} attachment ids`);try{let a=await (0,f.RT)().setDraftAttachments(c,d,i);return e.NextResponse.json({draftId:c.toLowerCase(),attachmentIds:a})}catch(a){if(a instanceof f.oG)return j(404,"unknown_attachment",a.message,{missing:a.missing});if(a instanceof f.bO&&"busy"===a.code)return j(503,"busy",a.message);return j(500,"draft_update_failed",a instanceof Error?a.message:String(a))}}d()}catch(a){d(a)}})},71745:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(67315),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/attachments/draft/route",pathname:"/api/attachments/draft",filename:"route",bundlePath:"app/api/attachments/draft/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\attachments\\draft\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/attachments/draft/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},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,5270],()=>b(b.s=71745));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=2504,a.ids=[2504],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67315:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{PUT:()=>k,dynamic:()=>m,runtime:()=>l});var e=c(23211),f=c(2979),g=c(36208),h=c(66544),i=a([f]);f=(i.then?(await i)():i)[0];let l="nodejs",m="force-dynamic";function j(a,b,c,d={}){return e.NextResponse.json({code:b,error:c,...d},{status:a})}async function k(a){let b;if(!(0,h.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,h.E2)(a))return j(415,"unsupported","application/json body required");try{b=await a.json()}catch{return j(400,"invalid_json","Malformed JSON body")}let{draftId:c,attachmentIds:d,sentAttachmentIds:i=[]}=b&&"object"==typeof b?b:{};if(!(0,g.Ly)(c))return j(400,"invalid_draft","draftId must be a UUID");for(let a of[d,i])if(!Array.isArray(a)||a.length>f.kF||!a.every(g.YC))return j(400,"invalid_attachment_ids",`attachmentIds and sentAttachmentIds must list at most ${f.kF} attachment ids`);try{let a=await (0,f.RT)().setDraftAttachments(c,d,i);return e.NextResponse.json({draftId:c.toLowerCase(),attachmentIds:a})}catch(a){if(a instanceof f.oG)return j(404,"unknown_attachment",a.message,{missing:a.missing});if(a instanceof f.bO&&"busy"===a.code)return j(503,"busy",a.message);return j(500,"draft_update_failed",a instanceof Error?a.message:String(a))}}d()}catch(a){d(a)}})},72519:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(67315),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/attachments/draft/route",pathname:"/api/attachments/draft",filename:"route",bundlePath:"app/api/attachments/draft/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\attachments\\draft\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/attachments/draft/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!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(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},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,5270],()=>b(b.s=72519));module.exports=c})();