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=2053,a.ids=[2053],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11641:(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(21972),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/check/route",pathname:"/api/skills/check",filename:"route",bundlePath:"app/api/skills/check/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\check\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/check/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)}})},19038:(a,b,c)=>{c.d(b,{CU:()=>l,S7:()=>u});var d=c(79646),e=c(79748),f=c(21820),g=c(33873),h=c(28354);let i=process.env.SKILLS_API_URL||"https://skills.sh",j=(0,h.promisify)(d.execFile);class k extends Error{constructor(a){super(`HTTP ${a}`),this.status=a}}function l(a){let b=n(a.skillPath??""),c=b?`${a.source}/${b}`:a.source,d=a.ref?`#${encodeURIComponent(a.ref)}`:"",e=["skills","add",`${c}${d}`,"--skill",m(a.package),"-y","--agent","claude-code"];return"global"===a.scope&&e.push("-g"),e}function m(a){let b=a.lastIndexOf("@");return b>=0?a.slice(b+1):a}function n(a){let b=a.replace(/\\/g,"/");return b.toLowerCase().endsWith("/skill.md")?b=b.slice(0,-9):b.toLowerCase().endsWith("skill.md")&&(b=b.slice(0,-8)),b.replace(/\/$/,"")}function o(a,b,c,d){return{package:a.package,scope:a.scope,state:b,currentVersion:a.versionHash,latestVersion:c,message:d}}async function p(a,b,c){let d=await b(a,{cache:"no-store",headers:c,signal:AbortSignal.timeout(15e3)});if(!d.ok)throw new k(d.status);return d.json()}async function q(a){let b=`https://github.com/${a.source}.git`,c=a.ref||"HEAD",d=n(a.skillPath),h=await (0,e.mkdtemp)((0,g.join)((0,f.tmpdir)(),"cuelo-skill-check-"));try{await j("git",["init","--bare",h],{timeout:3e4}),await j("git",[`--git-dir=${h}`,"fetch","--depth=1","--filter=blob:none","--no-tags",b,c],{timeout:3e4});let a=d?`FETCH_HEAD:${d}`:"FETCH_HEAD^{tree}",{stdout:e}=await j("git",[`--git-dir=${h}`,"rev-parse",a],{timeout:3e4}),f=e.trim();if(!/^[0-9a-f]{40}$/i.test(f))throw Error("Invalid Git tree hash");return f}finally{await (0,e.rm)(h,{recursive:!0,force:!0})}}async function r(a,b){let c,d=a.ref||"HEAD",e=`https://api.github.com/repos/${a.source}/git/trees/${encodeURIComponent(d)}?recursive=1`,f={Accept:"application/vnd.github.v3+json","User-Agent":"cuelo"};b.githubToken&&(f.Authorization=`Bearer ${b.githubToken}`);let g=n(a.skillPath);try{let a=await p(e,b.fetcher,f);if(c="string"!=typeof a.sha||g?void 0:a.sha,g&&Array.isArray(a.tree)){let b=a.tree.find(a=>"tree"===a.type&&a.path===g);b&&"string"==typeof b.sha&&(c=b.sha)}}catch(d){if(!(d instanceof k)||![401,403,429].includes(d.status))throw d;c=await b.resolveGitTreeHash(a)}return c?o(a,c===a.versionHash?"up-to-date":"update-available",c):o(a,"error",void 0,"Remote skill path was not found.")}async function s(a,b){let[c,d]=a.source.split("/"),e=m(a.package).toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),f=`${b.skillsApiBase}/api/download/${encodeURIComponent(c)}/${encodeURIComponent(d)}/${encodeURIComponent(e)}`,g=await p(f,b.fetcher),h="string"==typeof g.hash?g.hash:void 0;return h?o(a,h===a.versionHash?"up-to-date":"update-available",h):o(a,"error",void 0,"skills.sh did not return a version hash.")}async function t(a,b={}){if(!a.canCheckForUpdates||!a.versionHash||!a.skillPath)return o(a,"unsupported",void 0,"This lock entry cannot be checked automatically.");let c={...b,fetcher:b.fetcher??fetch,skillsApiBase:b.skillsApiBase??i,resolveGitTreeHash:b.resolveGitTreeHash??q};try{return"global"===a.scope?await r(a,c):await s(a,c)}catch(b){return o(a,"error",void 0,b instanceof Error?b.message:String(b))}}async function u(a,b={}){let c=b.fetcher??fetch,d=new Map,e=async(a,b)=>{let e=d.get(a);return e||(e=c(a,b),d.set(a,e)),(await e).clone()};return Promise.all(a.map(a=>t(a,{...b,fetcher:e})))}},21820:a=>{a.exports=require("os")},21972:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>l});var e=c(23211),f=c(19038),g=c(21278),h=c(80547),i=c(66544),j=a([g,h]);[g,h]=j.then?(await j)():j;let l="force-dynamic";async function k(a){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,i.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd.trim():"";if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});let d=await (0,h.mc)();if(!(0,h.B7)(c,d))return e.NextResponse.json({error:"Access denied"},{status:403});let i="string"==typeof b.package?b.package.trim():void 0,j="global"===b.scope||"project"===b.scope?b.scope:void 0;if(i&&!j||!i&&j)return e.NextResponse.json({error:"package and scope must be provided together"},{status:400});let{skills:k}=await (0,g.y)(c),l=k.map(a=>a.install).filter(a=>!!a).filter(a=>!i||a.package===i&&a.scope===j);if(i&&0===l.length)return e.NextResponse.json({error:"Installed skill not found"},{status:404});let m=await (0,f.S7)(l,{githubToken:process.env.GITHUB_TOKEN||process.env.GH_TOKEN});return e.NextResponse.json({updates:m})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message.slice(-500):"Skill update check failed"},{status:500})}}d()}catch(a){d(a)}})},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")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},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")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},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")},78772:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/settings")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},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,3229,2651],()=>b(b.s=11641));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=2053,a.ids=[2053],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19038:(a,b,c)=>{c.d(b,{CU:()=>l,S7:()=>u});var d=c(79646),e=c(79748),f=c(21820),g=c(33873),h=c(28354);let i=process.env.SKILLS_API_URL||"https://skills.sh",j=(0,h.promisify)(d.execFile);class k extends Error{constructor(a){super(`HTTP ${a}`),this.status=a}}function l(a){let b=n(a.skillPath??""),c=b?`${a.source}/${b}`:a.source,d=a.ref?`#${encodeURIComponent(a.ref)}`:"",e=["skills","add",`${c}${d}`,"--skill",m(a.package),"-y","--agent","claude-code"];return"global"===a.scope&&e.push("-g"),e}function m(a){let b=a.lastIndexOf("@");return b>=0?a.slice(b+1):a}function n(a){let b=a.replace(/\\/g,"/");return b.toLowerCase().endsWith("/skill.md")?b=b.slice(0,-9):b.toLowerCase().endsWith("skill.md")&&(b=b.slice(0,-8)),b.replace(/\/$/,"")}function o(a,b,c,d){return{package:a.package,scope:a.scope,state:b,currentVersion:a.versionHash,latestVersion:c,message:d}}async function p(a,b,c){let d=await b(a,{cache:"no-store",headers:c,signal:AbortSignal.timeout(15e3)});if(!d.ok)throw new k(d.status);return d.json()}async function q(a){let b=`https://github.com/${a.source}.git`,c=a.ref||"HEAD",d=n(a.skillPath),h=await (0,e.mkdtemp)((0,g.join)((0,f.tmpdir)(),"cuelo-skill-check-"));try{await j("git",["init","--bare",h],{timeout:3e4}),await j("git",[`--git-dir=${h}`,"fetch","--depth=1","--filter=blob:none","--no-tags",b,c],{timeout:3e4});let a=d?`FETCH_HEAD:${d}`:"FETCH_HEAD^{tree}",{stdout:e}=await j("git",[`--git-dir=${h}`,"rev-parse",a],{timeout:3e4}),f=e.trim();if(!/^[0-9a-f]{40}$/i.test(f))throw Error("Invalid Git tree hash");return f}finally{await (0,e.rm)(h,{recursive:!0,force:!0})}}async function r(a,b){let c,d=a.ref||"HEAD",e=`https://api.github.com/repos/${a.source}/git/trees/${encodeURIComponent(d)}?recursive=1`,f={Accept:"application/vnd.github.v3+json","User-Agent":"cuelo"};b.githubToken&&(f.Authorization=`Bearer ${b.githubToken}`);let g=n(a.skillPath);try{let a=await p(e,b.fetcher,f);if(c="string"!=typeof a.sha||g?void 0:a.sha,g&&Array.isArray(a.tree)){let b=a.tree.find(a=>"tree"===a.type&&a.path===g);b&&"string"==typeof b.sha&&(c=b.sha)}}catch(d){if(!(d instanceof k)||![401,403,429].includes(d.status))throw d;c=await b.resolveGitTreeHash(a)}return c?o(a,c===a.versionHash?"up-to-date":"update-available",c):o(a,"error",void 0,"Remote skill path was not found.")}async function s(a,b){let[c,d]=a.source.split("/"),e=m(a.package).toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),f=`${b.skillsApiBase}/api/download/${encodeURIComponent(c)}/${encodeURIComponent(d)}/${encodeURIComponent(e)}`,g=await p(f,b.fetcher),h="string"==typeof g.hash?g.hash:void 0;return h?o(a,h===a.versionHash?"up-to-date":"update-available",h):o(a,"error",void 0,"skills.sh did not return a version hash.")}async function t(a,b={}){if(!a.canCheckForUpdates||!a.versionHash||!a.skillPath)return o(a,"unsupported",void 0,"This lock entry cannot be checked automatically.");let c={...b,fetcher:b.fetcher??fetch,skillsApiBase:b.skillsApiBase??i,resolveGitTreeHash:b.resolveGitTreeHash??q};try{return"global"===a.scope?await r(a,c):await s(a,c)}catch(b){return o(a,"error",void 0,b instanceof Error?b.message:String(b))}}async function u(a,b={}){let c=b.fetcher??fetch,d=new Map,e=async(a,b)=>{let e=d.get(a);return e||(e=c(a,b),d.set(a,e)),(await e).clone()};return Promise.all(a.map(a=>t(a,{...b,fetcher:e})))}},21820:a=>{a.exports=require("os")},21972:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>l});var e=c(23211),f=c(19038),g=c(21278),h=c(80547),i=c(66544),j=a([g,h]);[g,h]=j.then?(await j)():j;let l="force-dynamic";async function k(a){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,i.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd.trim():"";if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});let d=await (0,h.mc)();if(!(0,h.B7)(c,d))return e.NextResponse.json({error:"Access denied"},{status:403});let i="string"==typeof b.package?b.package.trim():void 0,j="global"===b.scope||"project"===b.scope?b.scope:void 0;if(i&&!j||!i&&j)return e.NextResponse.json({error:"package and scope must be provided together"},{status:400});let{skills:k}=await (0,g.y)(c),l=k.map(a=>a.install).filter(a=>!!a).filter(a=>!i||a.package===i&&a.scope===j);if(i&&0===l.length)return e.NextResponse.json({error:"Installed skill not found"},{status:404});let m=await (0,f.S7)(l,{githubToken:process.env.GITHUB_TOKEN||process.env.GH_TOKEN});return e.NextResponse.json({updates:m})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message.slice(-500):"Skill update check failed"},{status:500})}}d()}catch(a){d(a)}})},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")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},39583:(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(21972),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/check/route",pathname:"/api/skills/check",filename:"route",bundlePath:"app/api/skills/check/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\check\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/check/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")},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")},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")},78772:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/settings")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},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,3229,2651],()=>b(b.s=39583));module.exports=c})();
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var a={};a.id=7812,a.ids=[7812],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")},8102:(a,b,c)=>{c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43987:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>l,dynamic:()=>m});var e=c(23211),f=c(92582),g=c(97990),h=c(80547),i=c(66544),j=c(72498),k=a([f,h]);[f,h]=k.then?(await k)():k;let m="force-dynamic",n=/\x1B\[[0-9;]*m/g,o=/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)+@[A-Za-z0-9_.-]+$/;async function l(a){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,i.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.package?b.package.trim():"",d=b.scope,i="string"==typeof b.cwd?b.cwd.trim():"";if(!c)return e.NextResponse.json({error:"package required"},{status:400});if(c.length>256||!o.test(c))return e.NextResponse.json({error:"package must be a GitHub skill reference"},{status:400});if("global"!==d&&"project"!==d)return e.NextResponse.json({error:"scope must be global or project"},{status:400});let k="global"===d;if(!k){if(!i)return e.NextResponse.json({error:"cwd required for project install"},{status:400});let a=await (0,h.mc)();if(!(0,h.B7)(i,a))return e.NextResponse.json({error:"Access denied"},{status:403});if(!(0,j.Y1)(i,(0,f.getAgentDir)()).trusted)return e.NextResponse.json({error:"Project resources must be trusted before installing project skills"},{status:403})}let l=["skills","add",c,"-y","--agent","claude-code"];k&&l.push("-g"),console.log(`[skills/install] running: npx ${l.join(" ")}`);let{stdout:m,stderr:p}=await (0,g.a6)(l,{timeout:6e4,cwd:k?void 0:i,env:(0,g.$A)({FORCE_COLOR:"0"})}),q=(0,g.FZ)(m+p).replace(n,"").slice(-4e3);if(!/Installation complete|Installed \d+ skill/.test(q))return e.NextResponse.json({error:q||"Install failed"},{status:500});return e.NextResponse.json({success:!0,output:q})}catch(b){let a=(0,g.FZ)((b.stdout??"")+(b.stderr??"")).replace(n,"").slice(-4e3);return e.NextResponse.json({error:a||"Install failed"},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},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")},55025:(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(43987),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/install/route",pathname:"/api/skills/install",filename:"route",bundlePath:"app/api/skills/install/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\install\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/install/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)}})},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},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"))}},72498:(a,b,c)=>{c.d(b,{LV:()=>k,TK:()=>p,Y1:()=>m,er:()=>n,qm:()=>r,wK:()=>o});var d=c(29021),e=c(33873),f=c(13229),g=c(8102);let h=[".omp/extensions",".omp/hooks",".omp/tools",".pi/extensions",".pi/hooks",".pi/tools",".claude/extensions",".claude/hooks",".claude/tools",".agents/extensions",".agents/hooks",".agents/tools"],i=[".mcp.json",".omp/.mcp.json",".omp/mcp.json",".claude/.mcp.json",".claude/mcp.json",".cursor/mcp.json"];function j(a){return(0,e.join)(a,"cuelo-trusted-projects.json")}function k(a){let b=(0,e.resolve)(a);try{return(0,d.realpathSync)(b)}catch{return b}}function l(a){try{(0,f.adoptLegacyStateFile)(j(a),"omp-web-trusted-projects.json");let b=JSON.parse((0,d.readFileSync)(j(a),"utf8"));if("object"!=typeof b||null===b||Array.isArray(b))return{};return Object.fromEntries(Object.entries(b).filter(a=>"boolean"==typeof a[1]))}catch{return{}}}function m(a,b){return a&&function(a){if(!a)return!1;for(let b of h)if((0,d.existsSync)((0,e.join)(a,b)))return!0;for(let b of i)if((0,d.existsSync)((0,e.join)(a,b)))return!0;return!1}(a)?{requiresTrust:!0,trusted:!0===l(b)[k(a)]}:{requiresTrust:!1,trusted:!0}}function n(a,b){let c=m(a,b);return c.requiresTrust?(o(a,b,!0),{requiresTrust:!0,trusted:!0}):c}function o(a,b,c){let e=l(b);e[k(a)]=c,(0,d.mkdirSync)(b,{recursive:!0}),(0,g.$)(j(b),`${JSON.stringify(e,null,2)}
2
- `)}function p(a){return l(a)}function q(a,b){let c=(0,e.relative)((0,e.resolve)(b),(0,e.resolve)(a));return""===c||!(0,e.isAbsolute)(c)&&".."!==c&&!c.startsWith(`..${e.sep}`)&&!c.startsWith("../")}function r(a,b,c){let d=m(a,b);if(d.requiresTrust&&!d.trusted)return{preloadedExtensionPaths:c.extensionPaths.filter(b=>!q(b,a)),preloadedCustomToolPaths:c.customToolPaths.filter(b=>b.source?.level!=="project"&&!q(b.path,a)),enableMCP:!1}}},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")},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)}})},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")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},97990:(a,b,c)=>{c.d(b,{$A:()=>m,FZ:()=>n,a6:()=>o});var d=c(79646),e=c(28354),f=c(29021),g=c(33873),h=c(19771);let i=(0,e.promisify)(d.execFile),j=/(?:^|_)(?:API_KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|PRIVATE_KEY|AUTH)(?:$|_)/i,k=/(?:auth(?:token)?|userconfig|globalconfig)/i;function l(a){return j.test(a)||k.test(a)}function m(a={}){let b={};for(let[a,c]of Object.entries(process.env))void 0===c||l(a)||(b[a]=c);for(let[c,d]of Object.entries(a))void 0!==d&&(b[c]=d);return b}function n(a,b=process.env){let c=a;for(let a of[...new Set(Object.entries(b).filter(([a,b])=>l(a)&&"string"==typeof b&&b.length>=4).map(([,a])=>a))].sort((a,b)=>b.length-a.length))c=c.replaceAll(a,"[REDACTED]");return c.replace(/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi,"$1 [REDACTED]")}async function o(a,b={}){let c=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}(),{command:d,commandArgs:e}=c?{command:h.execPath,commandArgs:[c,...a]}:{command:"npx",commandArgs:a};return i(d,e,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229],()=>b(b.s=55025));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=7812,a.ids=[7812],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")},8102:(a,b,c)=>{c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43987:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>l,dynamic:()=>m});var e=c(23211),f=c(92582),g=c(97990),h=c(80547),i=c(66544),j=c(72498),k=a([f,h]);[f,h]=k.then?(await k)():k;let m="force-dynamic",n=/\x1B\[[0-9;]*m/g,o=/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)+@[A-Za-z0-9_.-]+$/;async function l(a){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,i.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.package?b.package.trim():"",d=b.scope,i="string"==typeof b.cwd?b.cwd.trim():"";if(!c)return e.NextResponse.json({error:"package required"},{status:400});if(c.length>256||!o.test(c))return e.NextResponse.json({error:"package must be a GitHub skill reference"},{status:400});if("global"!==d&&"project"!==d)return e.NextResponse.json({error:"scope must be global or project"},{status:400});let k="global"===d;if(!k){if(!i)return e.NextResponse.json({error:"cwd required for project install"},{status:400});let a=await (0,h.mc)();if(!(0,h.B7)(i,a))return e.NextResponse.json({error:"Access denied"},{status:403});if(!(0,j.Y1)(i,(0,f.getAgentDir)()).trusted)return e.NextResponse.json({error:"Project resources must be trusted before installing project skills"},{status:403})}let l=["skills","add",c,"-y","--agent","claude-code"];k&&l.push("-g"),console.log(`[skills/install] running: npx ${l.join(" ")}`);let{stdout:m,stderr:p}=await (0,g.a6)(l,{timeout:6e4,cwd:k?void 0:i,env:(0,g.$A)({FORCE_COLOR:"0"})}),q=(0,g.FZ)(m+p).replace(n,"").slice(-4e3);if(!/Installation complete|Installed \d+ skill/.test(q))return e.NextResponse.json({error:q||"Install failed"},{status:500});return e.NextResponse.json({success:!0,output:q})}catch(b){let a=(0,g.FZ)((b.stdout??"")+(b.stderr??"")).replace(n,"").slice(-4e3);return e.NextResponse.json({error:a||"Install failed"},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},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")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},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"))}},71607:(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(43987),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/install/route",pathname:"/api/skills/install",filename:"route",bundlePath:"app/api/skills/install/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\install\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/install/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)}})},72498:(a,b,c)=>{c.d(b,{LV:()=>k,TK:()=>p,Y1:()=>m,er:()=>n,qm:()=>r,wK:()=>o});var d=c(29021),e=c(33873),f=c(13229),g=c(8102);let h=[".omp/extensions",".omp/hooks",".omp/tools",".pi/extensions",".pi/hooks",".pi/tools",".claude/extensions",".claude/hooks",".claude/tools",".agents/extensions",".agents/hooks",".agents/tools"],i=[".mcp.json",".omp/.mcp.json",".omp/mcp.json",".claude/.mcp.json",".claude/mcp.json",".cursor/mcp.json"];function j(a){return(0,e.join)(a,"cuelo-trusted-projects.json")}function k(a){let b=(0,e.resolve)(a);try{return(0,d.realpathSync)(b)}catch{return b}}function l(a){try{(0,f.adoptLegacyStateFile)(j(a),"omp-web-trusted-projects.json");let b=JSON.parse((0,d.readFileSync)(j(a),"utf8"));if("object"!=typeof b||null===b||Array.isArray(b))return{};return Object.fromEntries(Object.entries(b).filter(a=>"boolean"==typeof a[1]))}catch{return{}}}function m(a,b){return a&&function(a){if(!a)return!1;for(let b of h)if((0,d.existsSync)((0,e.join)(a,b)))return!0;for(let b of i)if((0,d.existsSync)((0,e.join)(a,b)))return!0;return!1}(a)?{requiresTrust:!0,trusted:!0===l(b)[k(a)]}:{requiresTrust:!1,trusted:!0}}function n(a,b){let c=m(a,b);return c.requiresTrust?(o(a,b,!0),{requiresTrust:!0,trusted:!0}):c}function o(a,b,c){let e=l(b);e[k(a)]=c,(0,d.mkdirSync)(b,{recursive:!0}),(0,g.$)(j(b),`${JSON.stringify(e,null,2)}
2
+ `)}function p(a){return l(a)}function q(a,b){let c=(0,e.relative)((0,e.resolve)(b),(0,e.resolve)(a));return""===c||!(0,e.isAbsolute)(c)&&".."!==c&&!c.startsWith(`..${e.sep}`)&&!c.startsWith("../")}function r(a,b,c){let d=m(a,b);if(d.requiresTrust&&!d.trusted)return{preloadedExtensionPaths:c.extensionPaths.filter(b=>!q(b,a)),preloadedCustomToolPaths:c.customToolPaths.filter(b=>b.source?.level!=="project"&&!q(b.path,a)),enableMCP:!1}}},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")},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)}})},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")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},97990:(a,b,c)=>{c.d(b,{$A:()=>m,FZ:()=>n,a6:()=>o});var d=c(79646),e=c(28354),f=c(29021),g=c(33873),h=c(19771);let i=(0,e.promisify)(d.execFile),j=/(?:^|_)(?:API_KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|PRIVATE_KEY|AUTH)(?:$|_)/i,k=/(?:auth(?:token)?|userconfig|globalconfig)/i;function l(a){return j.test(a)||k.test(a)}function m(a={}){let b={};for(let[a,c]of Object.entries(process.env))void 0===c||l(a)||(b[a]=c);for(let[c,d]of Object.entries(a))void 0!==d&&(b[c]=d);return b}function n(a,b=process.env){let c=a;for(let a of[...new Set(Object.entries(b).filter(([a,b])=>l(a)&&"string"==typeof b&&b.length>=4).map(([,a])=>a))].sort((a,b)=>b.length-a.length))c=c.replaceAll(a,"[REDACTED]");return c.replace(/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi,"$1 [REDACTED]")}async function o(a,b={}){let c=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}(),{command:d,commandArgs:e}=c?{command:h.execPath,commandArgs:[c,...a]}:{command:"npx",commandArgs:a};return i(d,e,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229],()=>b(b.s=71607));module.exports=c})();
@@ -1,6 +1,6 @@
1
- "use strict";(()=>{var a={};a.id=9968,a.ids=[9968],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},18885:(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(45403),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/route",pathname:"/api/skills",filename:"route",bundlePath:"app/api/skills/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,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)}})},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},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")},45403:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>p,PATCH:()=>q,dynamic:()=>r});var e=c(23211),f=c(29021),g=c(21820),h=c(33873),i=c.n(h),j=c(92582),k=c(34069),l=c(21278),m=c(80547),n=c(66544),o=a([j,k,l,m]);[j,k,l,m]=o.then?(await o)():o;let r="force-dynamic";async function p(a){if(!(0,n.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=await (0,m.mc)();if(!(0,m.B7)(c,a))return e.NextResponse.json({error:"Access denied"},{status:403});return e.NextResponse.json(await (0,l.y)(c))}catch{return e.NextResponse.json({error:"Unable to load skills"},{status:500})}}async function q(a){if(!(0,n.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,n.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b,c=await a.json(),d="string"==typeof c.filePath?c.filePath.trim():"",h=c.disableModelInvocation;if(!d)return e.NextResponse.json({error:"filePath required"},{status:400});if("boolean"!=typeof h)return e.NextResponse.json({error:"disableModelInvocation must be boolean"},{status:400});if("skill.md"!==i().basename(d).toLowerCase())return e.NextResponse.json({error:"Only SKILL.md files can be changed"},{status:400});try{b=(0,f.realpathSync)(d)}catch{return e.NextResponse.json({error:"file not found"},{status:404})}if("skill.md"!==i().basename(b).toLowerCase())return e.NextResponse.json({error:"Only SKILL.md files can be changed"},{status:400});if(!(0,f.statSync)(b).isFile())return e.NextResponse.json({error:"file must be a regular file"},{status:400});let l=new Set(await (0,m.mc)());l.add((0,j.getAgentDir)());let n=i().join((0,g.homedir)(),".agents","skills");if((0,f.existsSync)(n)&&l.add(n),!(0,m.B7)(b,l))return e.NextResponse.json({error:"Access denied"},{status:403});let o=(0,f.readFileSync)(b,"utf8"),p="disable-model-invocation",{frontmatter:q}=(0,k.parseFrontmatter)(o),r=!!q[p],s=o;return h&&!r?(s=o.replace(/^---\r?\n/,`---
1
+ "use strict";(()=>{var a={};a.id=9968,a.ids=[9968],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},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")},45403:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>p,PATCH:()=>q,dynamic:()=>r});var e=c(23211),f=c(29021),g=c(21820),h=c(33873),i=c.n(h),j=c(92582),k=c(34069),l=c(21278),m=c(80547),n=c(66544),o=a([j,k,l,m]);[j,k,l,m]=o.then?(await o)():o;let r="force-dynamic";async function p(a){if(!(0,n.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=await (0,m.mc)();if(!(0,m.B7)(c,a))return e.NextResponse.json({error:"Access denied"},{status:403});return e.NextResponse.json(await (0,l.y)(c))}catch{return e.NextResponse.json({error:"Unable to load skills"},{status:500})}}async function q(a){if(!(0,n.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,n.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b,c=await a.json(),d="string"==typeof c.filePath?c.filePath.trim():"",h=c.disableModelInvocation;if(!d)return e.NextResponse.json({error:"filePath required"},{status:400});if("boolean"!=typeof h)return e.NextResponse.json({error:"disableModelInvocation must be boolean"},{status:400});if("skill.md"!==i().basename(d).toLowerCase())return e.NextResponse.json({error:"Only SKILL.md files can be changed"},{status:400});try{b=(0,f.realpathSync)(d)}catch{return e.NextResponse.json({error:"file not found"},{status:404})}if("skill.md"!==i().basename(b).toLowerCase())return e.NextResponse.json({error:"Only SKILL.md files can be changed"},{status:400});if(!(0,f.statSync)(b).isFile())return e.NextResponse.json({error:"file must be a regular file"},{status:400});let l=new Set(await (0,m.mc)());l.add((0,j.getAgentDir)());let n=i().join((0,g.homedir)(),".agents","skills");if((0,f.existsSync)(n)&&l.add(n),!(0,m.B7)(b,l))return e.NextResponse.json({error:"Access denied"},{status:403});let o=(0,f.readFileSync)(b,"utf8"),p="disable-model-invocation",{frontmatter:q}=(0,k.parseFrontmatter)(o),r=!!q[p],s=o;return h&&!r?(s=o.replace(/^---\r?\n/,`---
2
2
  ${p}: true
3
3
  `))===o&&(s=`---
4
4
  ${p}: true
5
5
  ---
6
- ${o}`):!h&&r&&(s=o.replace(RegExp(`^${p}\\s*:.*\\r?\\n`,"m"),"")),(0,f.writeFileSync)(b,s,"utf8"),e.NextResponse.json({success:!0})}catch{return e.NextResponse.json({error:"Unable to update skill metadata"},{status:500})}}d()}catch(a){d(a)}})},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")},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")},78772:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/settings")},79646:a=>{a.exports=require("child_process")},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,3229,2651],()=>b(b.s=18885));module.exports=c})();
6
+ ${o}`):!h&&r&&(s=o.replace(RegExp(`^${p}\\s*:.*\\r?\\n`,"m"),"")),(0,f.writeFileSync)(b,s,"utf8"),e.NextResponse.json({success:!0})}catch{return e.NextResponse.json({error:"Unable to update skill metadata"},{status:500})}}d()}catch(a){d(a)}})},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")},56427:(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(45403),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/route",pathname:"/api/skills",filename:"route",bundlePath:"app/api/skills/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,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)}})},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")},78772:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/settings")},79646:a=>{a.exports=require("child_process")},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,3229,2651],()=>b(b.s=56427));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=3955,a.ids=[3955],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19771:a=>{"use strict";a.exports=require("process")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";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"))}},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},85834:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{POST:()=>E,dynamic:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(97990),x=c(66544);let y="force-dynamic",z=/\x1B\[[0-9;]*m/g,A=process.env.SKILLS_API_URL||"https://skills.sh";function B(a){let b=a.replace(z,""),c=[],d=b.split("\n");for(let a=0;a<d.length;a++){let b=d[a].trim().match(/^([\w.\-]+\/[\w.\-@:]+)\s+([\d.,]+[KMB]?\s+installs)$/);if(b){let e=d[a+1]?.trim().replace(/^└\s*/,"");c.push({package:b[1],installs:b[2],url:e?.startsWith("https://")?e:""})}}return c}async function C(a,b){let c=`${A}/api/search?q=${encodeURIComponent(a)}&limit=${b}`,d=await fetch(c,{cache:"no-store"});if(!d.ok)throw Error(`skills.sh search failed: HTTP ${d.status}`);return((await d.json()).skills??[]).map(a=>{var b;let c=a.name?.trim(),d=a.source?.trim(),e=a.id?.trim();return c&&(d||e)?{package:`${d||e}@${c}`,installs:(b=a.installs)&&!(b<=0)?b>=1e6?`${(b/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:b>=1e3?`${(b/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${b} install${1===b?"":"s"}`:"",url:e?`${A}/${e}`:""}:null}).filter(a=>null!==a).sort((a,b)=>D(b.installs)-D(a.installs))}function D(a){let b=a.match(/^([\d.]+)([KMB])?\s+installs?$/);if(!b)return 0;let c=Number(b[1]);return Number.isFinite(c)?c*("B"===b[2]?1e9:"M"===b[2]?1e6:"K"===b[2]?1e3:1):0}async function E(a){if(!(0,x.EN)(a))return v.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,x.E2)(a))return v.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b,{query:c,limit:d}=await a.json(),e="string"==typeof c?c.trim():"";if(!e)return v.NextResponse.json({error:"query required"},{status:400});if(e.length>200)return v.NextResponse.json({error:"query must be 200 characters or fewer"},{status:400});let f=(b="number"==typeof d?d:Number(d),Number.isFinite(b)?Math.min(50,Math.max(1,Math.floor(b))):50);try{let a=await C(e,f);return v.NextResponse.json({results:a})}catch{let{stdout:a,stderr:b}=await (0,w.a6)(["skills","find",e],{timeout:2e4,env:(0,w.$A)({FORCE_COLOR:"0"})}),c=(0,w.FZ)(a+b).replace(z,""),d=B(c).slice(0,f);return v.NextResponse.json({results:d})}}catch(c){let a=(0,w.FZ)((c.stdout??"")+(c.stderr??"")),b=a?B(a):[];if(b.length>0)return v.NextResponse.json({results:b});return v.NextResponse.json({error:(0,w.FZ)(c.message??"Skill search failed").slice(-500)},{status:500})}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/search/route",pathname:"/api/skills/search",filename:"route",bundlePath:"app/api/skills/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\search\\route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/search/route";"/index"===d&&(d="/");let e=await F.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:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[E]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||F.isDev||z||(L="/index"===(L=E)?"/":L);let M=!0===F.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==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.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)=>F.onRequestError(a,b,d,e,B)},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=>F.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&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=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 F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),b}},k=await F.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,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",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return 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 F.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},97990:(a,b,c)=>{"use strict";c.d(b,{$A:()=>m,FZ:()=>n,a6:()=>o});var d=c(79646),e=c(28354),f=c(29021),g=c(33873),h=c(19771);let i=(0,e.promisify)(d.execFile),j=/(?:^|_)(?:API_KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|PRIVATE_KEY|AUTH)(?:$|_)/i,k=/(?:auth(?:token)?|userconfig|globalconfig)/i;function l(a){return j.test(a)||k.test(a)}function m(a={}){let b={};for(let[a,c]of Object.entries(process.env))void 0===c||l(a)||(b[a]=c);for(let[c,d]of Object.entries(a))void 0!==d&&(b[c]=d);return b}function n(a,b=process.env){let c=a;for(let a of[...new Set(Object.entries(b).filter(([a,b])=>l(a)&&"string"==typeof b&&b.length>=4).map(([,a])=>a))].sort((a,b)=>b.length-a.length))c=c.replaceAll(a,"[REDACTED]");return c.replace(/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi,"$1 [REDACTED]")}async function o(a,b={}){let c=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}(),{command:d,commandArgs:e}=c?{command:h.execPath,commandArgs:[c,...a]}:{command:"npx",commandArgs:a};return i(d,e,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=85834));module.exports=c})();
1
+ (()=>{var a={};a.id=3955,a.ids=[3955],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19771:a=>{"use strict";a.exports=require("process")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},36223:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{POST:()=>E,dynamic:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(97990),x=c(66544);let y="force-dynamic",z=/\x1B\[[0-9;]*m/g,A=process.env.SKILLS_API_URL||"https://skills.sh";function B(a){let b=a.replace(z,""),c=[],d=b.split("\n");for(let a=0;a<d.length;a++){let b=d[a].trim().match(/^([\w.\-]+\/[\w.\-@:]+)\s+([\d.,]+[KMB]?\s+installs)$/);if(b){let e=d[a+1]?.trim().replace(/^└\s*/,"");c.push({package:b[1],installs:b[2],url:e?.startsWith("https://")?e:""})}}return c}async function C(a,b){let c=`${A}/api/search?q=${encodeURIComponent(a)}&limit=${b}`,d=await fetch(c,{cache:"no-store"});if(!d.ok)throw Error(`skills.sh search failed: HTTP ${d.status}`);return((await d.json()).skills??[]).map(a=>{var b;let c=a.name?.trim(),d=a.source?.trim(),e=a.id?.trim();return c&&(d||e)?{package:`${d||e}@${c}`,installs:(b=a.installs)&&!(b<=0)?b>=1e6?`${(b/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:b>=1e3?`${(b/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${b} install${1===b?"":"s"}`:"",url:e?`${A}/${e}`:""}:null}).filter(a=>null!==a).sort((a,b)=>D(b.installs)-D(a.installs))}function D(a){let b=a.match(/^([\d.]+)([KMB])?\s+installs?$/);if(!b)return 0;let c=Number(b[1]);return Number.isFinite(c)?c*("B"===b[2]?1e9:"M"===b[2]?1e6:"K"===b[2]?1e3:1):0}async function E(a){if(!(0,x.EN)(a))return v.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,x.E2)(a))return v.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b,{query:c,limit:d}=await a.json(),e="string"==typeof c?c.trim():"";if(!e)return v.NextResponse.json({error:"query required"},{status:400});if(e.length>200)return v.NextResponse.json({error:"query must be 200 characters or fewer"},{status:400});let f=(b="number"==typeof d?d:Number(d),Number.isFinite(b)?Math.min(50,Math.max(1,Math.floor(b))):50);try{let a=await C(e,f);return v.NextResponse.json({results:a})}catch{let{stdout:a,stderr:b}=await (0,w.a6)(["skills","find",e],{timeout:2e4,env:(0,w.$A)({FORCE_COLOR:"0"})}),c=(0,w.FZ)(a+b).replace(z,""),d=B(c).slice(0,f);return v.NextResponse.json({results:d})}}catch(c){let a=(0,w.FZ)((c.stdout??"")+(c.stderr??"")),b=a?B(a):[];if(b.length>0)return v.NextResponse.json({results:b});return v.NextResponse.json({error:(0,w.FZ)(c.message??"Skill search failed").slice(-500)},{status:500})}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/search/route",pathname:"/api/skills/search",filename:"route",bundlePath:"app/api/skills/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\search\\route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/search/route";"/index"===d&&(d="/");let e=await F.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:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[E]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||F.isDev||z||(L="/index"===(L=E)?"/":L);let M=!0===F.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==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.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)=>F.onRequestError(a,b,d,e,B)},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=>F.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&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=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 F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),b}},k=await F.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,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",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return 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 F.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";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"))}},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},97990:(a,b,c)=>{"use strict";c.d(b,{$A:()=>m,FZ:()=>n,a6:()=>o});var d=c(79646),e=c(28354),f=c(29021),g=c(33873),h=c(19771);let i=(0,e.promisify)(d.execFile),j=/(?:^|_)(?:API_KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|PRIVATE_KEY|AUTH)(?:$|_)/i,k=/(?:auth(?:token)?|userconfig|globalconfig)/i;function l(a){return j.test(a)||k.test(a)}function m(a={}){let b={};for(let[a,c]of Object.entries(process.env))void 0===c||l(a)||(b[a]=c);for(let[c,d]of Object.entries(a))void 0!==d&&(b[c]=d);return b}function n(a,b=process.env){let c=a;for(let a of[...new Set(Object.entries(b).filter(([a,b])=>l(a)&&"string"==typeof b&&b.length>=4).map(([,a])=>a))].sort((a,b)=>b.length-a.length))c=c.replaceAll(a,"[REDACTED]");return c.replace(/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi,"$1 [REDACTED]")}async function o(a,b={}){let c=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}(),{command:d,commandArgs:e}=c?{command:h.execPath,commandArgs:[c,...a]}:{command:"npx",commandArgs:a};return i(d,e,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=36223));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=9156,a.ids=[9156],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19038:(a,b,c)=>{c.d(b,{CU:()=>l,S7:()=>u});var d=c(79646),e=c(79748),f=c(21820),g=c(33873),h=c(28354);let i=process.env.SKILLS_API_URL||"https://skills.sh",j=(0,h.promisify)(d.execFile);class k extends Error{constructor(a){super(`HTTP ${a}`),this.status=a}}function l(a){let b=n(a.skillPath??""),c=b?`${a.source}/${b}`:a.source,d=a.ref?`#${encodeURIComponent(a.ref)}`:"",e=["skills","add",`${c}${d}`,"--skill",m(a.package),"-y","--agent","claude-code"];return"global"===a.scope&&e.push("-g"),e}function m(a){let b=a.lastIndexOf("@");return b>=0?a.slice(b+1):a}function n(a){let b=a.replace(/\\/g,"/");return b.toLowerCase().endsWith("/skill.md")?b=b.slice(0,-9):b.toLowerCase().endsWith("skill.md")&&(b=b.slice(0,-8)),b.replace(/\/$/,"")}function o(a,b,c,d){return{package:a.package,scope:a.scope,state:b,currentVersion:a.versionHash,latestVersion:c,message:d}}async function p(a,b,c){let d=await b(a,{cache:"no-store",headers:c,signal:AbortSignal.timeout(15e3)});if(!d.ok)throw new k(d.status);return d.json()}async function q(a){let b=`https://github.com/${a.source}.git`,c=a.ref||"HEAD",d=n(a.skillPath),h=await (0,e.mkdtemp)((0,g.join)((0,f.tmpdir)(),"cuelo-skill-check-"));try{await j("git",["init","--bare",h],{timeout:3e4}),await j("git",[`--git-dir=${h}`,"fetch","--depth=1","--filter=blob:none","--no-tags",b,c],{timeout:3e4});let a=d?`FETCH_HEAD:${d}`:"FETCH_HEAD^{tree}",{stdout:e}=await j("git",[`--git-dir=${h}`,"rev-parse",a],{timeout:3e4}),f=e.trim();if(!/^[0-9a-f]{40}$/i.test(f))throw Error("Invalid Git tree hash");return f}finally{await (0,e.rm)(h,{recursive:!0,force:!0})}}async function r(a,b){let c,d=a.ref||"HEAD",e=`https://api.github.com/repos/${a.source}/git/trees/${encodeURIComponent(d)}?recursive=1`,f={Accept:"application/vnd.github.v3+json","User-Agent":"cuelo"};b.githubToken&&(f.Authorization=`Bearer ${b.githubToken}`);let g=n(a.skillPath);try{let a=await p(e,b.fetcher,f);if(c="string"!=typeof a.sha||g?void 0:a.sha,g&&Array.isArray(a.tree)){let b=a.tree.find(a=>"tree"===a.type&&a.path===g);b&&"string"==typeof b.sha&&(c=b.sha)}}catch(d){if(!(d instanceof k)||![401,403,429].includes(d.status))throw d;c=await b.resolveGitTreeHash(a)}return c?o(a,c===a.versionHash?"up-to-date":"update-available",c):o(a,"error",void 0,"Remote skill path was not found.")}async function s(a,b){let[c,d]=a.source.split("/"),e=m(a.package).toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),f=`${b.skillsApiBase}/api/download/${encodeURIComponent(c)}/${encodeURIComponent(d)}/${encodeURIComponent(e)}`,g=await p(f,b.fetcher),h="string"==typeof g.hash?g.hash:void 0;return h?o(a,h===a.versionHash?"up-to-date":"update-available",h):o(a,"error",void 0,"skills.sh did not return a version hash.")}async function t(a,b={}){if(!a.canCheckForUpdates||!a.versionHash||!a.skillPath)return o(a,"unsupported",void 0,"This lock entry cannot be checked automatically.");let c={...b,fetcher:b.fetcher??fetch,skillsApiBase:b.skillsApiBase??i,resolveGitTreeHash:b.resolveGitTreeHash??q};try{return"global"===a.scope?await r(a,c):await s(a,c)}catch(b){return o(a,"error",void 0,b instanceof Error?b.message:String(b))}}async function u(a,b={}){let c=b.fetcher??fetch,d=new Map,e=async(a,b)=>{let e=d.get(a);return e||(e=c(a,b),d.set(a,e)),(await e).clone()};return Promise.all(a.map(a=>t(a,{...b,fetcher:e})))}},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},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")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},56679:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>n,dynamic:()=>o});var e=c(23211),f=c(92582),g=c(97990),h=c(19038),i=c(21278),j=c(80547),k=c(66544),l=c(72498),m=a([f,i,j]);[f,i,j]=m.then?(await m)():m;let o="force-dynamic";async function n(a){if(!(0,k.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,k.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd.trim():"",d="string"==typeof b.package?b.package.trim():"",k="global"===b.scope||"project"===b.scope?b.scope:void 0;if(!c||!d||!k)return e.NextResponse.json({error:"cwd, package, and scope are required"},{status:400});let m=await (0,j.mc)();if(!(0,j.B7)(c,m))return e.NextResponse.json({error:"Access denied"},{status:403});if("project"===k&&!(0,l.Y1)(c,(0,f.getAgentDir)()).trusted)return e.NextResponse.json({error:"Project resources must be trusted before updating project skills"},{status:403});let{skills:n}=await (0,i.y)(c),o=n.find(a=>a.install?.package===d&&a.install.scope===k);if(!o?.install)return e.NextResponse.json({error:"Installed skill not found"},{status:404});if(!o.install.canCheckForUpdates)return e.NextResponse.json({error:"This skill cannot be updated automatically"},{status:400});let{stdout:p,stderr:q}=await (0,g.a6)((0,h.CU)(o.install),{timeout:6e4,cwd:"project"===k?c:void 0,env:(0,g.$A)({FORCE_COLOR:"0"})}),r=(await (0,i.y)(c)).skills.find(a=>a.install?.package===d&&a.install.scope===k);return e.NextResponse.json({success:!0,skill:r,output:(0,g.FZ)(`${p}${q}`).slice(-1e3)})}catch(b){let a=(0,g.FZ)(`${b.stdout??""}${b.stderr??""}`).slice(-1e3);return e.NextResponse.json({error:a||"Skill update failed"},{status:500})}}d()}catch(a){d(a)}})},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")},78772:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/settings")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80185:(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(56679),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/update/route",pathname:"/api/skills/update",filename:"route",bundlePath:"app/api/skills/update/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\update\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/update/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)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},97990:(a,b,c)=>{c.d(b,{$A:()=>m,FZ:()=>n,a6:()=>o});var d=c(79646),e=c(28354),f=c(29021),g=c(33873),h=c(19771);let i=(0,e.promisify)(d.execFile),j=/(?:^|_)(?:API_KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|PRIVATE_KEY|AUTH)(?:$|_)/i,k=/(?:auth(?:token)?|userconfig|globalconfig)/i;function l(a){return j.test(a)||k.test(a)}function m(a={}){let b={};for(let[a,c]of Object.entries(process.env))void 0===c||l(a)||(b[a]=c);for(let[c,d]of Object.entries(a))void 0!==d&&(b[c]=d);return b}function n(a,b=process.env){let c=a;for(let a of[...new Set(Object.entries(b).filter(([a,b])=>l(a)&&"string"==typeof b&&b.length>=4).map(([,a])=>a))].sort((a,b)=>b.length-a.length))c=c.replaceAll(a,"[REDACTED]");return c.replace(/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi,"$1 [REDACTED]")}async function o(a,b={}){let c=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}(),{command:d,commandArgs:e}=c?{command:h.execPath,commandArgs:[c,...a]}:{command:"npx",commandArgs:a};return i(d,e,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229,2651],()=>b(b.s=80185));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=9156,a.ids=[9156],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19038:(a,b,c)=>{c.d(b,{CU:()=>l,S7:()=>u});var d=c(79646),e=c(79748),f=c(21820),g=c(33873),h=c(28354);let i=process.env.SKILLS_API_URL||"https://skills.sh",j=(0,h.promisify)(d.execFile);class k extends Error{constructor(a){super(`HTTP ${a}`),this.status=a}}function l(a){let b=n(a.skillPath??""),c=b?`${a.source}/${b}`:a.source,d=a.ref?`#${encodeURIComponent(a.ref)}`:"",e=["skills","add",`${c}${d}`,"--skill",m(a.package),"-y","--agent","claude-code"];return"global"===a.scope&&e.push("-g"),e}function m(a){let b=a.lastIndexOf("@");return b>=0?a.slice(b+1):a}function n(a){let b=a.replace(/\\/g,"/");return b.toLowerCase().endsWith("/skill.md")?b=b.slice(0,-9):b.toLowerCase().endsWith("skill.md")&&(b=b.slice(0,-8)),b.replace(/\/$/,"")}function o(a,b,c,d){return{package:a.package,scope:a.scope,state:b,currentVersion:a.versionHash,latestVersion:c,message:d}}async function p(a,b,c){let d=await b(a,{cache:"no-store",headers:c,signal:AbortSignal.timeout(15e3)});if(!d.ok)throw new k(d.status);return d.json()}async function q(a){let b=`https://github.com/${a.source}.git`,c=a.ref||"HEAD",d=n(a.skillPath),h=await (0,e.mkdtemp)((0,g.join)((0,f.tmpdir)(),"cuelo-skill-check-"));try{await j("git",["init","--bare",h],{timeout:3e4}),await j("git",[`--git-dir=${h}`,"fetch","--depth=1","--filter=blob:none","--no-tags",b,c],{timeout:3e4});let a=d?`FETCH_HEAD:${d}`:"FETCH_HEAD^{tree}",{stdout:e}=await j("git",[`--git-dir=${h}`,"rev-parse",a],{timeout:3e4}),f=e.trim();if(!/^[0-9a-f]{40}$/i.test(f))throw Error("Invalid Git tree hash");return f}finally{await (0,e.rm)(h,{recursive:!0,force:!0})}}async function r(a,b){let c,d=a.ref||"HEAD",e=`https://api.github.com/repos/${a.source}/git/trees/${encodeURIComponent(d)}?recursive=1`,f={Accept:"application/vnd.github.v3+json","User-Agent":"cuelo"};b.githubToken&&(f.Authorization=`Bearer ${b.githubToken}`);let g=n(a.skillPath);try{let a=await p(e,b.fetcher,f);if(c="string"!=typeof a.sha||g?void 0:a.sha,g&&Array.isArray(a.tree)){let b=a.tree.find(a=>"tree"===a.type&&a.path===g);b&&"string"==typeof b.sha&&(c=b.sha)}}catch(d){if(!(d instanceof k)||![401,403,429].includes(d.status))throw d;c=await b.resolveGitTreeHash(a)}return c?o(a,c===a.versionHash?"up-to-date":"update-available",c):o(a,"error",void 0,"Remote skill path was not found.")}async function s(a,b){let[c,d]=a.source.split("/"),e=m(a.package).toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),f=`${b.skillsApiBase}/api/download/${encodeURIComponent(c)}/${encodeURIComponent(d)}/${encodeURIComponent(e)}`,g=await p(f,b.fetcher),h="string"==typeof g.hash?g.hash:void 0;return h?o(a,h===a.versionHash?"up-to-date":"update-available",h):o(a,"error",void 0,"skills.sh did not return a version hash.")}async function t(a,b={}){if(!a.canCheckForUpdates||!a.versionHash||!a.skillPath)return o(a,"unsupported",void 0,"This lock entry cannot be checked automatically.");let c={...b,fetcher:b.fetcher??fetch,skillsApiBase:b.skillsApiBase??i,resolveGitTreeHash:b.resolveGitTreeHash??q};try{return"global"===a.scope?await r(a,c):await s(a,c)}catch(b){return o(a,"error",void 0,b instanceof Error?b.message:String(b))}}async function u(a,b={}){let c=b.fetcher??fetch,d=new Map,e=async(a,b)=>{let e=d.get(a);return e||(e=c(a,b),d.set(a,e)),(await e).clone()};return Promise.all(a.map(a=>t(a,{...b,fetcher:e})))}},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},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")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},56679:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>n,dynamic:()=>o});var e=c(23211),f=c(92582),g=c(97990),h=c(19038),i=c(21278),j=c(80547),k=c(66544),l=c(72498),m=a([f,i,j]);[f,i,j]=m.then?(await m)():m;let o="force-dynamic";async function n(a){if(!(0,k.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,k.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd.trim():"",d="string"==typeof b.package?b.package.trim():"",k="global"===b.scope||"project"===b.scope?b.scope:void 0;if(!c||!d||!k)return e.NextResponse.json({error:"cwd, package, and scope are required"},{status:400});let m=await (0,j.mc)();if(!(0,j.B7)(c,m))return e.NextResponse.json({error:"Access denied"},{status:403});if("project"===k&&!(0,l.Y1)(c,(0,f.getAgentDir)()).trusted)return e.NextResponse.json({error:"Project resources must be trusted before updating project skills"},{status:403});let{skills:n}=await (0,i.y)(c),o=n.find(a=>a.install?.package===d&&a.install.scope===k);if(!o?.install)return e.NextResponse.json({error:"Installed skill not found"},{status:404});if(!o.install.canCheckForUpdates)return e.NextResponse.json({error:"This skill cannot be updated automatically"},{status:400});let{stdout:p,stderr:q}=await (0,g.a6)((0,h.CU)(o.install),{timeout:6e4,cwd:"project"===k?c:void 0,env:(0,g.$A)({FORCE_COLOR:"0"})}),r=(await (0,i.y)(c)).skills.find(a=>a.install?.package===d&&a.install.scope===k);return e.NextResponse.json({success:!0,skill:r,output:(0,g.FZ)(`${p}${q}`).slice(-1e3)})}catch(b){let a=(0,g.FZ)(`${b.stdout??""}${b.stderr??""}`).slice(-1e3);return e.NextResponse.json({error:a||"Skill update failed"},{status:500})}}d()}catch(a){d(a)}})},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")},78431:(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(56679),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/update/route",pathname:"/api/skills/update",filename:"route",bundlePath:"app/api/skills/update/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\skills\\update\\route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/update/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)}})},78772:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/settings")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},97990:(a,b,c)=>{c.d(b,{$A:()=>m,FZ:()=>n,a6:()=>o});var d=c(79646),e=c(28354),f=c(29021),g=c(33873),h=c(19771);let i=(0,e.promisify)(d.execFile),j=/(?:^|_)(?:API_KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|PRIVATE_KEY|AUTH)(?:$|_)/i,k=/(?:auth(?:token)?|userconfig|globalconfig)/i;function l(a){return j.test(a)||k.test(a)}function m(a={}){let b={};for(let[a,c]of Object.entries(process.env))void 0===c||l(a)||(b[a]=c);for(let[c,d]of Object.entries(a))void 0!==d&&(b[c]=d);return b}function n(a,b=process.env){let c=a;for(let a of[...new Set(Object.entries(b).filter(([a,b])=>l(a)&&"string"==typeof b&&b.length>=4).map(([,a])=>a))].sort((a,b)=>b.length-a.length))c=c.replaceAll(a,"[REDACTED]");return c.replace(/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi,"$1 [REDACTED]")}async function o(a,b={}){let c=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}(),{command:d,commandArgs:e}=c?{command:h.execPath,commandArgs:[c,...a]}:{command:"npx",commandArgs:a};return i(d,e,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5582,3229,2651],()=>b(b.s=78431));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=1921,a.ids=[1921],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12665:(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(51944),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/theme/route",pathname:"/api/theme",filename:"route",bundlePath:"app/api/theme/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\theme\\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/theme/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)}})},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34447:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/settings")},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")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},51944:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,dynamic:()=>l});var e=c(23211),f=c(80547),g=c(38741),h=c(67108),i=c(66544),j=a([f,g,h]);[f,g,h]=j.then?(await j)():j;let l="force-dynamic";async function k(a){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});try{let b=new URL(a.url).searchParams.get("cwd")??void 0;if(b){let a=await (0,f.mc)();if(!(0,f.B7)(b,a))return e.NextResponse.json({error:"Access denied"},{status:403})}return e.NextResponse.json(await (0,h.u1)(await (0,g.getSettingsForCwd)(b)))}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},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"))}},67108:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{YE:()=>k,u1:()=>j});var e=c(77558),f=c(34447),g=a([e,f]);function h(...a){return a.find(a=>"string"==typeof a&&a.length>0)??"transparent"}async function i(a){let b=await (0,e.getResolvedThemeColors)(a),c=(0,e.isLightTheme)(a)?"light":"dark",d="var(--seed-color-fg-brand)";return{name:a,colorScheme:c,variables:{"--omp-md-heading":h(b.mdHeading,d),"--omp-md-link":h(b.mdLink,d),"--omp-md-code":h(b.mdCode,b.syntaxString,d)}}}async function j(a){let b=f.cfgThemeDark.get(a)??"titanium",c=f.cfgThemeLight.get(a)??"light",[d,e]=await Promise.all([i(b),i(c)]);return{names:{dark:b,light:c},palettes:{dark:d,light:e}}}async function k(){return(await (0,e.getAvailableThemes)()).map(a=>({name:a,colorScheme:(0,e.isLightTheme)(a)?"light":"dark"}))}[e,f]=g.then?(await g)():g,d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77558:a=>{a.exports=import("@oh-my-pi/pi-tui/theme/theme")},77598:a=>{a.exports=require("node:crypto")},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)}})},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")},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=12665));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=1921,a.ids=[1921],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34447:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/settings")},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")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},51944:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,dynamic:()=>l});var e=c(23211),f=c(80547),g=c(38741),h=c(67108),i=c(66544),j=a([f,g,h]);[f,g,h]=j.then?(await j)():j;let l="force-dynamic";async function k(a){if(!(0,i.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});try{let b=new URL(a.url).searchParams.get("cwd")??void 0;if(b){let a=await (0,f.mc)();if(!(0,f.B7)(b,a))return e.NextResponse.json({error:"Access denied"},{status:403})}return e.NextResponse.json(await (0,h.u1)(await (0,g.getSettingsForCwd)(b)))}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},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"))}},67108:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{YE:()=>k,u1:()=>j});var e=c(77558),f=c(34447),g=a([e,f]);function h(...a){return a.find(a=>"string"==typeof a&&a.length>0)??"transparent"}async function i(a){let b=await (0,e.getResolvedThemeColors)(a),c=(0,e.isLightTheme)(a)?"light":"dark",d="var(--seed-color-fg-brand)";return{name:a,colorScheme:c,variables:{"--omp-md-heading":h(b.mdHeading,d),"--omp-md-link":h(b.mdLink,d),"--omp-md-code":h(b.mdCode,b.syntaxString,d)}}}async function j(a){let b=f.cfgThemeDark.get(a)??"titanium",c=f.cfgThemeLight.get(a)??"light",[d,e]=await Promise.all([i(b),i(c)]);return{names:{dark:b,light:c},palettes:{dark:d,light:e}}}async function k(){return(await (0,e.getAvailableThemes)()).map(a=>({name:a,colorScheme:(0,e.isLightTheme)(a)?"light":"dark"}))}[e,f]=g.then?(await g)():g,d()}catch(a){d(a)}})},70079:(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(51944),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/theme/route",pathname:"/api/theme",filename:"route",bundlePath:"app/api/theme/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\theme\\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/theme/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")},77558:a=>{a.exports=import("@oh-my-pi/pi-tui/theme/theme")},77598:a=>{a.exports=require("node:crypto")},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)}})},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")},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=70079));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=3344,a.ids=[3344],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")},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")},56403:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i});var e=c(23211),f=c(66544),g=c(58610),h=a([g]);async function i(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});let b=new URL(a.url).searchParams,c=b.get("sessionId"),d=b.get("toolCallId");if(!c||!d)return e.NextResponse.json({error:"sessionId and toolCallId are required"},{status:400});let h=b.get("index"),i=null===h?null:Number(h);if(null!==i&&(!Number.isSafeInteger(i)||i<0))return e.NextResponse.json({error:"Valid index is required"},{status:400});try{let a=await (0,g.R6)(c,d);if(null===a)return e.NextResponse.json({error:"Session not found"},{status:404});if(!a||a.isError)return e.NextResponse.json({error:"Tool result not found"},{status:404});let b=(0,g.AG)(a);if(null===i)return e.NextResponse.json({count:b.length},{headers:{"Cache-Control":"no-store"}});let f=b[i];if(!f)return e.NextResponse.json({error:"Image not found"},{status:404});let h=(0,g.uO)(f);if(!h.ok)return e.NextResponse.json({error:h.error},{status:h.status});return new Response(new Uint8Array(h.bytes),{headers:{"Content-Type":h.mime,"Content-Length":String(h.bytes.length),"Cache-Control":"private, max-age=3600","Content-Security-Policy":"default-src 'none'; sandbox","Referrer-Policy":"no-referrer","X-Content-Type-Options":"nosniff"}})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},58610:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{AG:()=>q,R6:()=>o,uO:()=>s});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(92582),j=c(56429),k=c(40402),l=c(82536),m=c(1060),n=a([i,j,k]);async function o(a,b){let c,d=(0,j.A4)(a);if(d?.isAlive())c=d.inner.sessionManager.getEntries();else{let b=await (0,k.os)(a);if(!b)return null;c=(await i.SessionManager.open(b)).getEntries()}for(let a of c)if("message"===a.type&&"toolResult"===a.message.role&&a.message.toolCallId===b)return a.message}function p(a){return"object"==typeof a&&null!==a&&"imagePaths"in a&&Array.isArray(a.imagePaths)?a.imagePaths.filter(a=>"string"==typeof a):[]}function q(a){let b=[];for(let c of a.content??[]){if("image"!==c.type)continue;let a="data"in c&&"string"==typeof c.data?c.data:c.source?.type==="base64"?c.source.data:void 0;a&&!a.startsWith("blob:")&&b.push({kind:"data",data:a})}let c=a.details,d="object"==typeof c&&null!==c&&"xdev"in c?c.xdev:void 0;for(let e of"generate_image"===a.toolName?p(c):"object"==typeof d&&null!==d&&"tool"in d&&"generate_image"===d.tool&&"inner"in d?p(d.inner):[])b.push({kind:"file",path:e});return b}function r(a){let b=(...b)=>b.every((b,c)=>a[c]===b);return b(137,80,78,71,13,10,26,10)?"image/png":b(255,216,255)?"image/jpeg":b(71,73,70,56)&&(55===a[4]||57===a[4])&&97===a[5]?"image/gif":b(82,73,70,70)&&87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]?"image/webp":null}[i,j,k]=n.then?(await n)():n;let t=/^omp-image-[A-Za-z0-9]+\.(?:png|jpe?g|gif|webp)$/i,u={ok:!1,status:404,error:"Image not found"};function s(a){if("data"===a.kind){if(Math.floor(3*a.data.length/4)>m.kv+3)return{ok:!1,status:413,error:"Image too large"};let b=Buffer.from(a.data,"base64"),c=r(b);return c?{ok:!0,bytes:b,mime:c}:{ok:!1,status:415,error:"Not an image"}}let b=a.path;if(!h().isAbsolute(b)||!t.test(h().basename(b))||!(0,l.x)(b,new Set([(0,f.tmpdir)()])))return u;let c=(0,e.statSync)(b);if(!c.isFile())return u;if(c.size>m.kv)return{ok:!1,status:413,error:"Image too large"};let d=(0,e.readFileSync)(b),g=r(d);return g&&g===(0,m.cV)(b)?{ok:!0,bytes:d,mime:g}:{ok:!1,status:415,error:"Not an image"}}d()}catch(a){d(a)}})},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")},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")},87877:(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(56403),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/tool-image/route",pathname:"/api/tool-image",filename:"route",bundlePath:"app/api/tool-image/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\tool-image\\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/tool-image/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)}})},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=87877));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=3344,a.ids=[3344],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")},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")},43435:(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(56403),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/tool-image/route",pathname:"/api/tool-image",filename:"route",bundlePath:"app/api/tool-image/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"D:\\a\\CUELO\\CUELO\\app\\api\\tool-image\\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/tool-image/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)}})},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")},56403:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i});var e=c(23211),f=c(66544),g=c(58610),h=a([g]);async function i(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});let b=new URL(a.url).searchParams,c=b.get("sessionId"),d=b.get("toolCallId");if(!c||!d)return e.NextResponse.json({error:"sessionId and toolCallId are required"},{status:400});let h=b.get("index"),i=null===h?null:Number(h);if(null!==i&&(!Number.isSafeInteger(i)||i<0))return e.NextResponse.json({error:"Valid index is required"},{status:400});try{let a=await (0,g.R6)(c,d);if(null===a)return e.NextResponse.json({error:"Session not found"},{status:404});if(!a||a.isError)return e.NextResponse.json({error:"Tool result not found"},{status:404});let b=(0,g.AG)(a);if(null===i)return e.NextResponse.json({count:b.length},{headers:{"Cache-Control":"no-store"}});let f=b[i];if(!f)return e.NextResponse.json({error:"Image not found"},{status:404});let h=(0,g.uO)(f);if(!h.ok)return e.NextResponse.json({error:h.error},{status:h.status});return new Response(new Uint8Array(h.bytes),{headers:{"Content-Type":h.mime,"Content-Length":String(h.bytes.length),"Cache-Control":"private, max-age=3600","Content-Security-Policy":"default-src 'none'; sandbox","Referrer-Policy":"no-referrer","X-Content-Type-Options":"nosniff"}})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},58610:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{AG:()=>q,R6:()=>o,uO:()=>s});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(92582),j=c(56429),k=c(40402),l=c(82536),m=c(1060),n=a([i,j,k]);async function o(a,b){let c,d=(0,j.A4)(a);if(d?.isAlive())c=d.inner.sessionManager.getEntries();else{let b=await (0,k.os)(a);if(!b)return null;c=(await i.SessionManager.open(b)).getEntries()}for(let a of c)if("message"===a.type&&"toolResult"===a.message.role&&a.message.toolCallId===b)return a.message}function p(a){return"object"==typeof a&&null!==a&&"imagePaths"in a&&Array.isArray(a.imagePaths)?a.imagePaths.filter(a=>"string"==typeof a):[]}function q(a){let b=[];for(let c of a.content??[]){if("image"!==c.type)continue;let a="data"in c&&"string"==typeof c.data?c.data:c.source?.type==="base64"?c.source.data:void 0;a&&!a.startsWith("blob:")&&b.push({kind:"data",data:a})}let c=a.details,d="object"==typeof c&&null!==c&&"xdev"in c?c.xdev:void 0;for(let e of"generate_image"===a.toolName?p(c):"object"==typeof d&&null!==d&&"tool"in d&&"generate_image"===d.tool&&"inner"in d?p(d.inner):[])b.push({kind:"file",path:e});return b}function r(a){let b=(...b)=>b.every((b,c)=>a[c]===b);return b(137,80,78,71,13,10,26,10)?"image/png":b(255,216,255)?"image/jpeg":b(71,73,70,56)&&(55===a[4]||57===a[4])&&97===a[5]?"image/gif":b(82,73,70,70)&&87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]?"image/webp":null}[i,j,k]=n.then?(await n)():n;let t=/^omp-image-[A-Za-z0-9]+\.(?:png|jpe?g|gif|webp)$/i,u={ok:!1,status:404,error:"Image not found"};function s(a){if("data"===a.kind){if(Math.floor(3*a.data.length/4)>m.kv+3)return{ok:!1,status:413,error:"Image too large"};let b=Buffer.from(a.data,"base64"),c=r(b);return c?{ok:!0,bytes:b,mime:c}:{ok:!1,status:415,error:"Not an image"}}let b=a.path;if(!h().isAbsolute(b)||!t.test(h().basename(b))||!(0,l.x)(b,new Set([(0,f.tmpdir)()])))return u;let c=(0,e.statSync)(b);if(!c.isFile())return u;if(c.size>m.kv)return{ok:!1,status:413,error:"Image too large"};let d=(0,e.readFileSync)(b),g=r(d);return g&&g===(0,m.cV)(b)?{ok:!0,bytes:d,mime:g}:{ok:!1,status:415,error:"Not an image"}}d()}catch(a){d(a)}})},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")},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=43435));module.exports=c})();