@surething/cockpit 1.0.261 → 1.0.262

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 (525) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +7 -4
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/cockpit-build.json +1 -1
  5. package/.next-prod/prerender-manifest.json +4 -4
  6. package/.next-prod/routes-manifest.json +18 -0
  7. package/.next-prod/server/app/_global-error/page.js +2 -2
  8. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next-prod/server/app/_global-error.html +1 -1
  10. package/.next-prod/server/app/_global-error.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next-prod/server/app/_not-found/page.js +1 -1
  15. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next-prod/server/app/_not-found.html +2 -2
  17. package/.next-prod/server/app/_not-found.rsc +4 -4
  18. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +4 -4
  19. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +12 -11
  20. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/.next-prod/server/app/api/agent/test/route.js +1 -1
  23. package/.next-prod/server/app/api/bash/route.js +1 -1
  24. package/.next-prod/server/app/api/chat/codex/route.js +1 -1
  25. package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
  26. package/.next-prod/server/app/api/chat/glm/route.js +1 -1
  27. package/.next-prod/server/app/api/chat/kimi/route.js +1 -1
  28. package/.next-prod/server/app/api/chat/ollama/route.js +1 -1
  29. package/.next-prod/server/app/api/chat/route.js +1 -1
  30. package/.next-prod/server/app/api/chat/stop/route.js +1 -1
  31. package/.next-prod/server/app/api/claude-stats/route.js +1 -1
  32. package/.next-prod/server/app/api/commands/route.js +1 -1
  33. package/.next-prod/server/app/api/comments/route.js +1 -1
  34. package/.next-prod/server/app/api/db/columns/route.js +1 -1
  35. package/.next-prod/server/app/api/db/connect/route.js +1 -1
  36. package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
  37. package/.next-prod/server/app/api/db/export/route.js +1 -1
  38. package/.next-prod/server/app/api/db/query/route.js +1 -1
  39. package/.next-prod/server/app/api/db/schemas/route.js +2 -2
  40. package/.next-prod/server/app/api/deepseek/balance/route.js +1 -1
  41. package/.next-prod/server/app/api/deepseek/credentials/route.js +1 -1
  42. package/.next-prod/server/app/api/deepseek/models/route.js +1 -1
  43. package/.next-prod/server/app/api/dev/spans/route.js +1 -1
  44. package/.next-prod/server/app/api/extension/version/route.js +1 -1
  45. package/.next-prod/server/app/api/file/route.js +1 -1
  46. package/.next-prod/server/app/api/files/blame/route.js +1 -1
  47. package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
  48. package/.next-prod/server/app/api/files/copy/route.js +1 -1
  49. package/.next-prod/server/app/api/files/delete/route.js +1 -1
  50. package/.next-prod/server/app/api/files/expanded/route.js +1 -1
  51. package/.next-prod/server/app/api/files/index/route.js +1 -1
  52. package/.next-prod/server/app/api/files/init/route.js +1 -1
  53. package/.next-prod/server/app/api/files/paste/route.js +1 -1
  54. package/.next-prod/server/app/api/files/read/route.js +1 -1
  55. package/.next-prod/server/app/api/files/readdir/route.js +1 -1
  56. package/.next-prod/server/app/api/files/recent/route.js +1 -1
  57. package/.next-prod/server/app/api/files/save/route.js +1 -1
  58. package/.next-prod/server/app/api/files/search/route.js +1 -1
  59. package/.next-prod/server/app/api/files/stat/route.js +1 -1
  60. package/.next-prod/server/app/api/files/text/route.js +1 -1
  61. package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
  62. package/.next-prod/server/app/api/git/branches/route.js +1 -1
  63. package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
  64. package/.next-prod/server/app/api/git/commits/route.js +1 -1
  65. package/.next-prod/server/app/api/git/current-branch/route.js +1 -1
  66. package/.next-prod/server/app/api/git/diff/route.js +1 -1
  67. package/.next-prod/server/app/api/git/discard/route.js +1 -1
  68. package/.next-prod/server/app/api/git/stage/route.js +1 -1
  69. package/.next-prod/server/app/api/git/status/route.js +1 -1
  70. package/.next-prod/server/app/api/git/unstage/route.js +1 -1
  71. package/.next-prod/server/app/api/git/worktree/route.js +1 -1
  72. package/.next-prod/server/app/api/glm/credentials/route.js +1 -1
  73. package/.next-prod/server/app/api/glm/models/route.js +1 -1
  74. package/.next-prod/server/app/api/glm/usage/route.js +1 -1
  75. package/.next-prod/server/app/api/global-state/route.js +1 -1
  76. package/.next-prod/server/app/api/health/route.js +1 -1
  77. package/.next-prod/server/app/api/html-apps/[id]/route.js +1 -1
  78. package/.next-prod/server/app/api/html-apps/route.js +1 -1
  79. package/.next-prod/server/app/api/jupyter/load/route.js +1 -1
  80. package/.next-prod/server/app/api/jupyter/save/route.js +1 -1
  81. package/.next-prod/server/app/api/jupyter/shutdown/route.js +1 -1
  82. package/.next-prod/server/app/api/kimi/credentials/route.js +1 -1
  83. package/.next-prod/server/app/api/kimi/models/route.js +1 -1
  84. package/.next-prod/server/app/api/kimi/usage/route.js +1 -1
  85. package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
  86. package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
  87. package/.next-prod/server/app/api/lsp/references/route.js +1 -1
  88. package/.next-prod/server/app/api/lsp/status/route.js +1 -1
  89. package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
  90. package/.next-prod/server/app/api/mysql/columns/route.js +2 -2
  91. package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
  92. package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
  93. package/.next-prod/server/app/api/mysql/export/route.js +1 -1
  94. package/.next-prod/server/app/api/mysql/query/route.js +1 -1
  95. package/.next-prod/server/app/api/mysql/schemas/route.js +1 -1
  96. package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
  97. package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
  98. package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
  99. package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
  100. package/.next-prod/server/app/api/note/route.js +1 -1
  101. package/.next-prod/server/app/api/ollama/config/route.js +1 -1
  102. package/.next-prod/server/app/api/ollama/models/route.js +1 -1
  103. package/.next-prod/server/app/api/ollama/start/route.js +1 -1
  104. package/.next-prod/server/app/api/open-cursor/route.js +1 -1
  105. package/.next-prod/server/app/api/open-vscode/route.js +1 -1
  106. package/.next-prod/server/app/api/pick-folder/route.js +1 -1
  107. package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
  108. package/.next-prod/server/app/api/project-settings/route.js +1 -1
  109. package/.next-prod/server/app/api/project-state/route.js +2 -2
  110. package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -1
  111. package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
  112. package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
  113. package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
  114. package/.next-prod/server/app/api/projectGraph/context/route.js +1 -1
  115. package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
  116. package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
  117. package/.next-prod/server/app/api/projectGraph/impact/route.js +1 -1
  118. package/.next-prod/server/app/api/projectGraph/related/route.js +1 -1
  119. package/.next-prod/server/app/api/projectGraph/risk/route.js +1 -1
  120. package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
  121. package/.next-prod/server/app/api/projects/route.js +1 -1
  122. package/.next-prod/server/app/api/prompts/config/route.js +1 -1
  123. package/.next-prod/server/app/api/push/public-key/route.js +1 -1
  124. package/.next-prod/server/app/api/push/subscribe/route.js +1 -1
  125. package/.next-prod/server/app/api/push/unsubscribe/route.js +1 -1
  126. package/.next-prod/server/app/api/redis/command/route.js +1 -1
  127. package/.next-prod/server/app/api/redis/connect/route.js +1 -1
  128. package/.next-prod/server/app/api/redis/delete/route.js +1 -1
  129. package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
  130. package/.next-prod/server/app/api/redis/get/route.js +1 -1
  131. package/.next-prod/server/app/api/redis/keys/route.js +1 -1
  132. package/.next-prod/server/app/api/redis/set/route.js +1 -1
  133. package/.next-prod/server/app/api/restart/route.js +1 -0
  134. package/.next-prod/server/app/api/restart/route.js.nft.json +1 -0
  135. package/.next-prod/server/app/api/restart/route_client-reference-manifest.js +1 -0
  136. package/.next-prod/server/app/api/review/[id]/comments/route.js +1 -1
  137. package/.next-prod/server/app/api/review/[id]/replies/route.js +1 -1
  138. package/.next-prod/server/app/api/review/[id]/route.js +1 -1
  139. package/.next-prod/server/app/api/review/identify/route.js +1 -1
  140. package/.next-prod/server/app/api/review/order/route.js +1 -1
  141. package/.next-prod/server/app/api/review/route.js +1 -1
  142. package/.next-prod/server/app/api/review/share-info/route.js +1 -1
  143. package/.next-prod/server/app/api/review/users/route.js +1 -1
  144. package/.next-prod/server/app/api/scheduled-tasks/route.js +2 -2
  145. package/.next-prod/server/app/api/services/config/route.js +1 -1
  146. package/.next-prod/server/app/api/services/scripts/route.js +1 -1
  147. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
  148. package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
  149. package/.next-prod/server/app/api/session-by-path/route.js +1 -1
  150. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
  151. package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
  152. package/.next-prod/server/app/api/sessions/route.js +1 -1
  153. package/.next-prod/server/app/api/settings/route.js +1 -1
  154. package/.next-prod/server/app/api/shutdown/route.js +1 -0
  155. package/.next-prod/server/app/api/shutdown/route.js.nft.json +1 -0
  156. package/.next-prod/server/app/api/shutdown/route_client-reference-manifest.js +1 -0
  157. package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
  158. package/.next-prod/server/app/api/skills/content/route.js +1 -1
  159. package/.next-prod/server/app/api/skills/route.js +1 -1
  160. package/.next-prod/server/app/api/snapshots/diff/route.js +1 -1
  161. package/.next-prod/server/app/api/snapshots/route.js +1 -1
  162. package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
  163. package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
  164. package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
  165. package/.next-prod/server/app/api/terminal/env/route.js +1 -1
  166. package/.next-prod/server/app/api/terminal/history/route.js +1 -1
  167. package/.next-prod/server/app/api/update/route.js +1 -0
  168. package/.next-prod/server/app/api/update/route.js.nft.json +1 -0
  169. package/.next-prod/server/app/api/update/route_client-reference-manifest.js +1 -0
  170. package/.next-prod/server/app/api/version/route.js +1 -1
  171. package/.next-prod/server/app/apps/[...path]/route.js +1 -1
  172. package/.next-prod/server/app/favicon.ico/route.js +1 -1
  173. package/.next-prod/server/app/m/page.js +1 -1
  174. package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
  175. package/.next-prod/server/app/manifest.webmanifest/route.js +2 -2
  176. package/.next-prod/server/app/page.js +1 -1
  177. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  178. package/.next-prod/server/app/project/page.js +1 -1
  179. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  180. package/.next-prod/server/app/review/[id]/page.js +1 -1
  181. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  182. package/.next-prod/server/app-paths-manifest.json +7 -4
  183. package/.next-prod/server/chunks/5750.js +16 -13
  184. package/.next-prod/server/chunks/6495.js +1 -1
  185. package/.next-prod/server/chunks/6548.js +1 -1
  186. package/.next-prod/server/chunks/7184.js +1 -1
  187. package/.next-prod/server/chunks/841.js +1 -1
  188. package/.next-prod/server/functions-config-manifest.json +3 -0
  189. package/.next-prod/server/middleware-build-manifest.js +1 -1
  190. package/.next-prod/server/pages/404.html +2 -2
  191. package/.next-prod/server/pages/500.html +1 -1
  192. package/.next-prod/server/server-reference-manifest.json +1 -1
  193. package/.next-prod/static/chunks/{1372-d16d68b1b03a345a.js → 1372-a26fa30d21bd1ecc.js} +1 -1
  194. package/.next-prod/static/chunks/5400-bf3fe22440a73161.js +36 -0
  195. package/.next-prod/static/chunks/6784-d51b98432358f755.js +381 -0
  196. package/.next-prod/static/chunks/app/_global-error/page-7c7e4c414aa6453c.js +1 -0
  197. package/.next-prod/static/chunks/app/api/agent/test/route-7c7e4c414aa6453c.js +1 -0
  198. package/.next-prod/static/chunks/app/api/bash/route-7c7e4c414aa6453c.js +1 -0
  199. package/.next-prod/static/chunks/app/api/chat/codex/route-7c7e4c414aa6453c.js +1 -0
  200. package/.next-prod/static/chunks/app/api/chat/deepseek/route-7c7e4c414aa6453c.js +1 -0
  201. package/.next-prod/static/chunks/app/api/chat/glm/route-7c7e4c414aa6453c.js +1 -0
  202. package/.next-prod/static/chunks/app/api/chat/kimi/route-7c7e4c414aa6453c.js +1 -0
  203. package/.next-prod/static/chunks/app/api/chat/ollama/route-7c7e4c414aa6453c.js +1 -0
  204. package/.next-prod/static/chunks/app/api/chat/route-7c7e4c414aa6453c.js +1 -0
  205. package/.next-prod/static/chunks/app/api/chat/stop/route-7c7e4c414aa6453c.js +1 -0
  206. package/.next-prod/static/chunks/app/api/claude-stats/route-7c7e4c414aa6453c.js +1 -0
  207. package/.next-prod/static/chunks/app/api/commands/route-7c7e4c414aa6453c.js +1 -0
  208. package/.next-prod/static/chunks/app/api/comments/route-7c7e4c414aa6453c.js +1 -0
  209. package/.next-prod/static/chunks/app/api/db/columns/route-7c7e4c414aa6453c.js +1 -0
  210. package/.next-prod/static/chunks/app/api/db/connect/route-7c7e4c414aa6453c.js +1 -0
  211. package/.next-prod/static/chunks/app/api/db/disconnect/route-7c7e4c414aa6453c.js +1 -0
  212. package/.next-prod/static/chunks/app/api/db/export/route-7c7e4c414aa6453c.js +1 -0
  213. package/.next-prod/static/chunks/app/api/db/query/route-7c7e4c414aa6453c.js +1 -0
  214. package/.next-prod/static/chunks/app/api/db/schemas/route-7c7e4c414aa6453c.js +1 -0
  215. package/.next-prod/static/chunks/app/api/deepseek/balance/route-7c7e4c414aa6453c.js +1 -0
  216. package/.next-prod/static/chunks/app/api/deepseek/credentials/route-7c7e4c414aa6453c.js +1 -0
  217. package/.next-prod/static/chunks/app/api/deepseek/models/route-7c7e4c414aa6453c.js +1 -0
  218. package/.next-prod/static/chunks/app/api/dev/spans/route-7c7e4c414aa6453c.js +1 -0
  219. package/.next-prod/static/chunks/app/api/extension/version/route-7c7e4c414aa6453c.js +1 -0
  220. package/.next-prod/static/chunks/app/api/file/route-7c7e4c414aa6453c.js +1 -0
  221. package/.next-prod/static/chunks/app/api/files/blame/route-7c7e4c414aa6453c.js +1 -0
  222. package/.next-prod/static/chunks/app/api/files/clipboard/route-7c7e4c414aa6453c.js +1 -0
  223. package/.next-prod/static/chunks/app/api/files/copy/route-7c7e4c414aa6453c.js +1 -0
  224. package/.next-prod/static/chunks/app/api/files/delete/route-7c7e4c414aa6453c.js +1 -0
  225. package/.next-prod/static/chunks/app/api/files/expanded/route-7c7e4c414aa6453c.js +1 -0
  226. package/.next-prod/static/chunks/app/api/files/index/route-7c7e4c414aa6453c.js +1 -0
  227. package/.next-prod/static/chunks/app/api/files/init/route-7c7e4c414aa6453c.js +1 -0
  228. package/.next-prod/static/chunks/app/api/files/paste/route-7c7e4c414aa6453c.js +1 -0
  229. package/.next-prod/static/chunks/app/api/files/read/route-7c7e4c414aa6453c.js +1 -0
  230. package/.next-prod/static/chunks/app/api/files/readdir/route-7c7e4c414aa6453c.js +1 -0
  231. package/.next-prod/static/chunks/app/api/files/recent/route-7c7e4c414aa6453c.js +1 -0
  232. package/.next-prod/static/chunks/app/api/files/save/route-7c7e4c414aa6453c.js +1 -0
  233. package/.next-prod/static/chunks/app/api/files/search/route-7c7e4c414aa6453c.js +1 -0
  234. package/.next-prod/static/chunks/app/api/files/stat/route-7c7e4c414aa6453c.js +1 -0
  235. package/.next-prod/static/chunks/app/api/files/text/route-7c7e4c414aa6453c.js +1 -0
  236. package/.next-prod/static/chunks/app/api/git/branch-diff/route-7c7e4c414aa6453c.js +1 -0
  237. package/.next-prod/static/chunks/app/api/git/branches/route-7c7e4c414aa6453c.js +1 -0
  238. package/.next-prod/static/chunks/app/api/git/commit-diff/route-7c7e4c414aa6453c.js +1 -0
  239. package/.next-prod/static/chunks/app/api/git/commits/route-7c7e4c414aa6453c.js +1 -0
  240. package/.next-prod/static/chunks/app/api/git/current-branch/route-7c7e4c414aa6453c.js +1 -0
  241. package/.next-prod/static/chunks/app/api/git/diff/route-7c7e4c414aa6453c.js +1 -0
  242. package/.next-prod/static/chunks/app/api/git/discard/route-7c7e4c414aa6453c.js +1 -0
  243. package/.next-prod/static/chunks/app/api/git/stage/route-7c7e4c414aa6453c.js +1 -0
  244. package/.next-prod/static/chunks/app/api/git/status/route-7c7e4c414aa6453c.js +1 -0
  245. package/.next-prod/static/chunks/app/api/git/unstage/route-7c7e4c414aa6453c.js +1 -0
  246. package/.next-prod/static/chunks/app/api/git/worktree/route-7c7e4c414aa6453c.js +1 -0
  247. package/.next-prod/static/chunks/app/api/glm/credentials/route-7c7e4c414aa6453c.js +1 -0
  248. package/.next-prod/static/chunks/app/api/glm/models/route-7c7e4c414aa6453c.js +1 -0
  249. package/.next-prod/static/chunks/app/api/glm/usage/route-7c7e4c414aa6453c.js +1 -0
  250. package/.next-prod/static/chunks/app/api/global-state/route-7c7e4c414aa6453c.js +1 -0
  251. package/.next-prod/static/chunks/app/api/health/route-7c7e4c414aa6453c.js +1 -0
  252. package/.next-prod/static/chunks/app/api/html-apps/[id]/route-7c7e4c414aa6453c.js +1 -0
  253. package/.next-prod/static/chunks/app/api/html-apps/route-7c7e4c414aa6453c.js +1 -0
  254. package/.next-prod/static/chunks/app/api/jupyter/load/route-7c7e4c414aa6453c.js +1 -0
  255. package/.next-prod/static/chunks/app/api/jupyter/save/route-7c7e4c414aa6453c.js +1 -0
  256. package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-7c7e4c414aa6453c.js +1 -0
  257. package/.next-prod/static/chunks/app/api/kimi/credentials/route-7c7e4c414aa6453c.js +1 -0
  258. package/.next-prod/static/chunks/app/api/kimi/models/route-7c7e4c414aa6453c.js +1 -0
  259. package/.next-prod/static/chunks/app/api/kimi/usage/route-7c7e4c414aa6453c.js +1 -0
  260. package/.next-prod/static/chunks/app/api/lsp/definition/route-7c7e4c414aa6453c.js +1 -0
  261. package/.next-prod/static/chunks/app/api/lsp/hover/route-7c7e4c414aa6453c.js +1 -0
  262. package/.next-prod/static/chunks/app/api/lsp/references/route-7c7e4c414aa6453c.js +1 -0
  263. package/.next-prod/static/chunks/app/api/lsp/status/route-7c7e4c414aa6453c.js +1 -0
  264. package/.next-prod/static/chunks/app/api/lsp/warmup/route-7c7e4c414aa6453c.js +1 -0
  265. package/.next-prod/static/chunks/app/api/mysql/columns/route-7c7e4c414aa6453c.js +1 -0
  266. package/.next-prod/static/chunks/app/api/mysql/connect/route-7c7e4c414aa6453c.js +1 -0
  267. package/.next-prod/static/chunks/app/api/mysql/disconnect/route-7c7e4c414aa6453c.js +1 -0
  268. package/.next-prod/static/chunks/app/api/mysql/export/route-7c7e4c414aa6453c.js +1 -0
  269. package/.next-prod/static/chunks/app/api/mysql/query/route-7c7e4c414aa6453c.js +1 -0
  270. package/.next-prod/static/chunks/app/api/mysql/schemas/route-7c7e4c414aa6453c.js +1 -0
  271. package/.next-prod/static/chunks/app/api/neo4j/connect/route-7c7e4c414aa6453c.js +1 -0
  272. package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-7c7e4c414aa6453c.js +1 -0
  273. package/.next-prod/static/chunks/app/api/neo4j/query/route-7c7e4c414aa6453c.js +1 -0
  274. package/.next-prod/static/chunks/app/api/neo4j/schema/route-7c7e4c414aa6453c.js +1 -0
  275. package/.next-prod/static/chunks/app/api/note/route-7c7e4c414aa6453c.js +1 -0
  276. package/.next-prod/static/chunks/app/api/ollama/config/route-7c7e4c414aa6453c.js +1 -0
  277. package/.next-prod/static/chunks/app/api/ollama/models/route-7c7e4c414aa6453c.js +1 -0
  278. package/.next-prod/static/chunks/app/api/ollama/start/route-7c7e4c414aa6453c.js +1 -0
  279. package/.next-prod/static/chunks/app/api/open-cursor/route-7c7e4c414aa6453c.js +1 -0
  280. package/.next-prod/static/chunks/app/api/open-vscode/route-7c7e4c414aa6453c.js +1 -0
  281. package/.next-prod/static/chunks/app/api/pick-folder/route-7c7e4c414aa6453c.js +1 -0
  282. package/.next-prod/static/chunks/app/api/pinned-sessions/route-7c7e4c414aa6453c.js +1 -0
  283. package/.next-prod/static/chunks/app/api/project-settings/route-7c7e4c414aa6453c.js +1 -0
  284. package/.next-prod/static/chunks/app/api/project-state/route-7c7e4c414aa6453c.js +1 -0
  285. package/.next-prod/static/chunks/app/api/projectGraph/affected/route-7c7e4c414aa6453c.js +1 -0
  286. package/.next-prod/static/chunks/app/api/projectGraph/callees/route-7c7e4c414aa6453c.js +1 -0
  287. package/.next-prod/static/chunks/app/api/projectGraph/callers/route-7c7e4c414aa6453c.js +1 -0
  288. package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-7c7e4c414aa6453c.js +1 -0
  289. package/.next-prod/static/chunks/app/api/projectGraph/context/route-7c7e4c414aa6453c.js +1 -0
  290. package/.next-prod/static/chunks/app/api/projectGraph/file/route-7c7e4c414aa6453c.js +1 -0
  291. package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-7c7e4c414aa6453c.js +1 -0
  292. package/.next-prod/static/chunks/app/api/projectGraph/impact/route-7c7e4c414aa6453c.js +1 -0
  293. package/.next-prod/static/chunks/app/api/projectGraph/related/route-7c7e4c414aa6453c.js +1 -0
  294. package/.next-prod/static/chunks/app/api/projectGraph/risk/route-7c7e4c414aa6453c.js +1 -0
  295. package/.next-prod/static/chunks/app/api/projectGraph/search/route-7c7e4c414aa6453c.js +1 -0
  296. package/.next-prod/static/chunks/app/api/projects/route-7c7e4c414aa6453c.js +1 -0
  297. package/.next-prod/static/chunks/app/api/prompts/config/route-7c7e4c414aa6453c.js +1 -0
  298. package/.next-prod/static/chunks/app/api/push/public-key/route-7c7e4c414aa6453c.js +1 -0
  299. package/.next-prod/static/chunks/app/api/push/subscribe/route-7c7e4c414aa6453c.js +1 -0
  300. package/.next-prod/static/chunks/app/api/push/unsubscribe/route-7c7e4c414aa6453c.js +1 -0
  301. package/.next-prod/static/chunks/app/api/redis/command/route-7c7e4c414aa6453c.js +1 -0
  302. package/.next-prod/static/chunks/app/api/redis/connect/route-7c7e4c414aa6453c.js +1 -0
  303. package/.next-prod/static/chunks/app/api/redis/delete/route-7c7e4c414aa6453c.js +1 -0
  304. package/.next-prod/static/chunks/app/api/redis/disconnect/route-7c7e4c414aa6453c.js +1 -0
  305. package/.next-prod/static/chunks/app/api/redis/get/route-7c7e4c414aa6453c.js +1 -0
  306. package/.next-prod/static/chunks/app/api/redis/keys/route-7c7e4c414aa6453c.js +1 -0
  307. package/.next-prod/static/chunks/app/api/redis/set/route-7c7e4c414aa6453c.js +1 -0
  308. package/.next-prod/static/chunks/app/api/restart/route-7c7e4c414aa6453c.js +1 -0
  309. package/.next-prod/static/chunks/app/api/review/[id]/comments/route-7c7e4c414aa6453c.js +1 -0
  310. package/.next-prod/static/chunks/app/api/review/[id]/replies/route-7c7e4c414aa6453c.js +1 -0
  311. package/.next-prod/static/chunks/app/api/review/[id]/route-7c7e4c414aa6453c.js +1 -0
  312. package/.next-prod/static/chunks/app/api/review/identify/route-7c7e4c414aa6453c.js +1 -0
  313. package/.next-prod/static/chunks/app/api/review/order/route-7c7e4c414aa6453c.js +1 -0
  314. package/.next-prod/static/chunks/app/api/review/route-7c7e4c414aa6453c.js +1 -0
  315. package/.next-prod/static/chunks/app/api/review/share-info/route-7c7e4c414aa6453c.js +1 -0
  316. package/.next-prod/static/chunks/app/api/review/users/route-7c7e4c414aa6453c.js +1 -0
  317. package/.next-prod/static/chunks/app/api/scheduled-tasks/route-7c7e4c414aa6453c.js +1 -0
  318. package/.next-prod/static/chunks/app/api/services/config/route-7c7e4c414aa6453c.js +1 -0
  319. package/.next-prod/static/chunks/app/api/services/scripts/route-7c7e4c414aa6453c.js +1 -0
  320. package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-7c7e4c414aa6453c.js +1 -0
  321. package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-7c7e4c414aa6453c.js +1 -0
  322. package/.next-prod/static/chunks/app/api/session-by-path/route-7c7e4c414aa6453c.js +1 -0
  323. package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-7c7e4c414aa6453c.js +1 -0
  324. package/.next-prod/static/chunks/app/api/sessions/projects/route-7c7e4c414aa6453c.js +1 -0
  325. package/.next-prod/static/chunks/app/api/sessions/route-7c7e4c414aa6453c.js +1 -0
  326. package/.next-prod/static/chunks/app/api/settings/route-7c7e4c414aa6453c.js +1 -0
  327. package/.next-prod/static/chunks/app/api/shutdown/route-7c7e4c414aa6453c.js +1 -0
  328. package/.next-prod/static/chunks/app/api/skills/[id]/route-7c7e4c414aa6453c.js +1 -0
  329. package/.next-prod/static/chunks/app/api/skills/content/route-7c7e4c414aa6453c.js +1 -0
  330. package/.next-prod/static/chunks/app/api/skills/route-7c7e4c414aa6453c.js +1 -0
  331. package/.next-prod/static/chunks/app/api/snapshots/diff/route-7c7e4c414aa6453c.js +1 -0
  332. package/.next-prod/static/chunks/app/api/snapshots/route-7c7e4c414aa6453c.js +1 -0
  333. package/.next-prod/static/chunks/app/api/terminal/aliases/route-7c7e4c414aa6453c.js +1 -0
  334. package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-7c7e4c414aa6453c.js +1 -0
  335. package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-7c7e4c414aa6453c.js +1 -0
  336. package/.next-prod/static/chunks/app/api/terminal/env/route-7c7e4c414aa6453c.js +1 -0
  337. package/.next-prod/static/chunks/app/api/terminal/history/route-7c7e4c414aa6453c.js +1 -0
  338. package/.next-prod/static/chunks/app/api/update/route-7c7e4c414aa6453c.js +1 -0
  339. package/.next-prod/static/chunks/app/api/version/route-7c7e4c414aa6453c.js +1 -0
  340. package/.next-prod/static/chunks/app/apps/[...path]/route-7c7e4c414aa6453c.js +1 -0
  341. package/.next-prod/static/chunks/app/{layout-ab52fc1a83af968b.js → layout-7b31e254e348e208.js} +1 -1
  342. package/.next-prod/static/chunks/app/manifest.webmanifest/route-7c7e4c414aa6453c.js +1 -0
  343. package/.next-prod/static/chunks/app/{page-5de8b6584e328a6f.js → page-cb0d12250512641d.js} +1 -1
  344. package/.next-prod/static/chunks/app/project/{page-5de8b6584e328a6f.js → page-cb0d12250512641d.js} +1 -1
  345. package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-7c7e4c414aa6453c.js +1 -0
  346. package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-7c7e4c414aa6453c.js +1 -0
  347. package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-7c7e4c414aa6453c.js +1 -0
  348. package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-7c7e4c414aa6453c.js +1 -0
  349. package/.next-prod/static/css/38ad6f470b64a40f.css +1 -0
  350. package/.next-prod/static/noNfrQRJFchmZSWx_yn1K/_buildManifest.js +1 -0
  351. package/.next-prod/trace +14 -14
  352. package/.next-prod/trace-build +1 -1
  353. package/.next-prod/types/app/api/restart/route.ts +353 -0
  354. package/.next-prod/types/app/api/shutdown/route.ts +353 -0
  355. package/.next-prod/types/app/api/update/route.ts +353 -0
  356. package/.next-prod/types/routes.d.ts +4 -1
  357. package/.next-prod/types/validator.ts +27 -0
  358. package/README.md +75 -0
  359. package/README.zh.md +64 -0
  360. package/bin/cock-service.mjs +498 -0
  361. package/bin/cock.mjs +35 -27
  362. package/bin/cockpitHome.mjs +33 -0
  363. package/bin/rotateLog.mjs +52 -0
  364. package/bin/updater.mjs +231 -0
  365. package/dist/{chunk-CLPJYIFC.mjs → chunk-AI7T3EXM.mjs} +4 -3
  366. package/dist/{chunk-B5LXMESP.mjs → chunk-LC4LAEWJ.mjs} +1 -1
  367. package/dist/{chunk-TU3GL2HK.mjs → chunk-ZCMAJV2M.mjs} +15 -4
  368. package/dist/httpApi.mjs +2 -2
  369. package/dist/scheduledTasks.mjs +24 -4
  370. package/dist/{server-2UJDVZ32.mjs → server-CQXVJT3F.mjs} +2 -2
  371. package/dist/wsServer.mjs +144 -112
  372. package/package.json +1 -1
  373. package/server.mjs +127 -11
  374. package/.next-prod/static/chunks/1157-164bcf046a0a9b15.js +0 -32
  375. package/.next-prod/static/chunks/6784-09dffdb0e8ca7fb3.js +0 -381
  376. package/.next-prod/static/chunks/app/_global-error/page-3c1c06e2de280418.js +0 -1
  377. package/.next-prod/static/chunks/app/api/agent/test/route-3c1c06e2de280418.js +0 -1
  378. package/.next-prod/static/chunks/app/api/bash/route-3c1c06e2de280418.js +0 -1
  379. package/.next-prod/static/chunks/app/api/chat/codex/route-3c1c06e2de280418.js +0 -1
  380. package/.next-prod/static/chunks/app/api/chat/deepseek/route-3c1c06e2de280418.js +0 -1
  381. package/.next-prod/static/chunks/app/api/chat/glm/route-3c1c06e2de280418.js +0 -1
  382. package/.next-prod/static/chunks/app/api/chat/kimi/route-3c1c06e2de280418.js +0 -1
  383. package/.next-prod/static/chunks/app/api/chat/ollama/route-3c1c06e2de280418.js +0 -1
  384. package/.next-prod/static/chunks/app/api/chat/route-3c1c06e2de280418.js +0 -1
  385. package/.next-prod/static/chunks/app/api/chat/stop/route-3c1c06e2de280418.js +0 -1
  386. package/.next-prod/static/chunks/app/api/claude-stats/route-3c1c06e2de280418.js +0 -1
  387. package/.next-prod/static/chunks/app/api/commands/route-3c1c06e2de280418.js +0 -1
  388. package/.next-prod/static/chunks/app/api/comments/route-3c1c06e2de280418.js +0 -1
  389. package/.next-prod/static/chunks/app/api/db/columns/route-3c1c06e2de280418.js +0 -1
  390. package/.next-prod/static/chunks/app/api/db/connect/route-3c1c06e2de280418.js +0 -1
  391. package/.next-prod/static/chunks/app/api/db/disconnect/route-3c1c06e2de280418.js +0 -1
  392. package/.next-prod/static/chunks/app/api/db/export/route-3c1c06e2de280418.js +0 -1
  393. package/.next-prod/static/chunks/app/api/db/query/route-3c1c06e2de280418.js +0 -1
  394. package/.next-prod/static/chunks/app/api/db/schemas/route-3c1c06e2de280418.js +0 -1
  395. package/.next-prod/static/chunks/app/api/deepseek/balance/route-3c1c06e2de280418.js +0 -1
  396. package/.next-prod/static/chunks/app/api/deepseek/credentials/route-3c1c06e2de280418.js +0 -1
  397. package/.next-prod/static/chunks/app/api/deepseek/models/route-3c1c06e2de280418.js +0 -1
  398. package/.next-prod/static/chunks/app/api/dev/spans/route-3c1c06e2de280418.js +0 -1
  399. package/.next-prod/static/chunks/app/api/extension/version/route-3c1c06e2de280418.js +0 -1
  400. package/.next-prod/static/chunks/app/api/file/route-3c1c06e2de280418.js +0 -1
  401. package/.next-prod/static/chunks/app/api/files/blame/route-3c1c06e2de280418.js +0 -1
  402. package/.next-prod/static/chunks/app/api/files/clipboard/route-3c1c06e2de280418.js +0 -1
  403. package/.next-prod/static/chunks/app/api/files/copy/route-3c1c06e2de280418.js +0 -1
  404. package/.next-prod/static/chunks/app/api/files/delete/route-3c1c06e2de280418.js +0 -1
  405. package/.next-prod/static/chunks/app/api/files/expanded/route-3c1c06e2de280418.js +0 -1
  406. package/.next-prod/static/chunks/app/api/files/index/route-3c1c06e2de280418.js +0 -1
  407. package/.next-prod/static/chunks/app/api/files/init/route-3c1c06e2de280418.js +0 -1
  408. package/.next-prod/static/chunks/app/api/files/paste/route-3c1c06e2de280418.js +0 -1
  409. package/.next-prod/static/chunks/app/api/files/read/route-3c1c06e2de280418.js +0 -1
  410. package/.next-prod/static/chunks/app/api/files/readdir/route-3c1c06e2de280418.js +0 -1
  411. package/.next-prod/static/chunks/app/api/files/recent/route-3c1c06e2de280418.js +0 -1
  412. package/.next-prod/static/chunks/app/api/files/save/route-3c1c06e2de280418.js +0 -1
  413. package/.next-prod/static/chunks/app/api/files/search/route-3c1c06e2de280418.js +0 -1
  414. package/.next-prod/static/chunks/app/api/files/stat/route-3c1c06e2de280418.js +0 -1
  415. package/.next-prod/static/chunks/app/api/files/text/route-3c1c06e2de280418.js +0 -1
  416. package/.next-prod/static/chunks/app/api/git/branch-diff/route-3c1c06e2de280418.js +0 -1
  417. package/.next-prod/static/chunks/app/api/git/branches/route-3c1c06e2de280418.js +0 -1
  418. package/.next-prod/static/chunks/app/api/git/commit-diff/route-3c1c06e2de280418.js +0 -1
  419. package/.next-prod/static/chunks/app/api/git/commits/route-3c1c06e2de280418.js +0 -1
  420. package/.next-prod/static/chunks/app/api/git/current-branch/route-3c1c06e2de280418.js +0 -1
  421. package/.next-prod/static/chunks/app/api/git/diff/route-3c1c06e2de280418.js +0 -1
  422. package/.next-prod/static/chunks/app/api/git/discard/route-3c1c06e2de280418.js +0 -1
  423. package/.next-prod/static/chunks/app/api/git/stage/route-3c1c06e2de280418.js +0 -1
  424. package/.next-prod/static/chunks/app/api/git/status/route-3c1c06e2de280418.js +0 -1
  425. package/.next-prod/static/chunks/app/api/git/unstage/route-3c1c06e2de280418.js +0 -1
  426. package/.next-prod/static/chunks/app/api/git/worktree/route-3c1c06e2de280418.js +0 -1
  427. package/.next-prod/static/chunks/app/api/glm/credentials/route-3c1c06e2de280418.js +0 -1
  428. package/.next-prod/static/chunks/app/api/glm/models/route-3c1c06e2de280418.js +0 -1
  429. package/.next-prod/static/chunks/app/api/glm/usage/route-3c1c06e2de280418.js +0 -1
  430. package/.next-prod/static/chunks/app/api/global-state/route-3c1c06e2de280418.js +0 -1
  431. package/.next-prod/static/chunks/app/api/health/route-3c1c06e2de280418.js +0 -1
  432. package/.next-prod/static/chunks/app/api/html-apps/[id]/route-3c1c06e2de280418.js +0 -1
  433. package/.next-prod/static/chunks/app/api/html-apps/route-3c1c06e2de280418.js +0 -1
  434. package/.next-prod/static/chunks/app/api/jupyter/load/route-3c1c06e2de280418.js +0 -1
  435. package/.next-prod/static/chunks/app/api/jupyter/save/route-3c1c06e2de280418.js +0 -1
  436. package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-3c1c06e2de280418.js +0 -1
  437. package/.next-prod/static/chunks/app/api/kimi/credentials/route-3c1c06e2de280418.js +0 -1
  438. package/.next-prod/static/chunks/app/api/kimi/models/route-3c1c06e2de280418.js +0 -1
  439. package/.next-prod/static/chunks/app/api/kimi/usage/route-3c1c06e2de280418.js +0 -1
  440. package/.next-prod/static/chunks/app/api/lsp/definition/route-3c1c06e2de280418.js +0 -1
  441. package/.next-prod/static/chunks/app/api/lsp/hover/route-3c1c06e2de280418.js +0 -1
  442. package/.next-prod/static/chunks/app/api/lsp/references/route-3c1c06e2de280418.js +0 -1
  443. package/.next-prod/static/chunks/app/api/lsp/status/route-3c1c06e2de280418.js +0 -1
  444. package/.next-prod/static/chunks/app/api/lsp/warmup/route-3c1c06e2de280418.js +0 -1
  445. package/.next-prod/static/chunks/app/api/mysql/columns/route-3c1c06e2de280418.js +0 -1
  446. package/.next-prod/static/chunks/app/api/mysql/connect/route-3c1c06e2de280418.js +0 -1
  447. package/.next-prod/static/chunks/app/api/mysql/disconnect/route-3c1c06e2de280418.js +0 -1
  448. package/.next-prod/static/chunks/app/api/mysql/export/route-3c1c06e2de280418.js +0 -1
  449. package/.next-prod/static/chunks/app/api/mysql/query/route-3c1c06e2de280418.js +0 -1
  450. package/.next-prod/static/chunks/app/api/mysql/schemas/route-3c1c06e2de280418.js +0 -1
  451. package/.next-prod/static/chunks/app/api/neo4j/connect/route-3c1c06e2de280418.js +0 -1
  452. package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-3c1c06e2de280418.js +0 -1
  453. package/.next-prod/static/chunks/app/api/neo4j/query/route-3c1c06e2de280418.js +0 -1
  454. package/.next-prod/static/chunks/app/api/neo4j/schema/route-3c1c06e2de280418.js +0 -1
  455. package/.next-prod/static/chunks/app/api/note/route-3c1c06e2de280418.js +0 -1
  456. package/.next-prod/static/chunks/app/api/ollama/config/route-3c1c06e2de280418.js +0 -1
  457. package/.next-prod/static/chunks/app/api/ollama/models/route-3c1c06e2de280418.js +0 -1
  458. package/.next-prod/static/chunks/app/api/ollama/start/route-3c1c06e2de280418.js +0 -1
  459. package/.next-prod/static/chunks/app/api/open-cursor/route-3c1c06e2de280418.js +0 -1
  460. package/.next-prod/static/chunks/app/api/open-vscode/route-3c1c06e2de280418.js +0 -1
  461. package/.next-prod/static/chunks/app/api/pick-folder/route-3c1c06e2de280418.js +0 -1
  462. package/.next-prod/static/chunks/app/api/pinned-sessions/route-3c1c06e2de280418.js +0 -1
  463. package/.next-prod/static/chunks/app/api/project-settings/route-3c1c06e2de280418.js +0 -1
  464. package/.next-prod/static/chunks/app/api/project-state/route-3c1c06e2de280418.js +0 -1
  465. package/.next-prod/static/chunks/app/api/projectGraph/affected/route-3c1c06e2de280418.js +0 -1
  466. package/.next-prod/static/chunks/app/api/projectGraph/callees/route-3c1c06e2de280418.js +0 -1
  467. package/.next-prod/static/chunks/app/api/projectGraph/callers/route-3c1c06e2de280418.js +0 -1
  468. package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-3c1c06e2de280418.js +0 -1
  469. package/.next-prod/static/chunks/app/api/projectGraph/context/route-3c1c06e2de280418.js +0 -1
  470. package/.next-prod/static/chunks/app/api/projectGraph/file/route-3c1c06e2de280418.js +0 -1
  471. package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-3c1c06e2de280418.js +0 -1
  472. package/.next-prod/static/chunks/app/api/projectGraph/impact/route-3c1c06e2de280418.js +0 -1
  473. package/.next-prod/static/chunks/app/api/projectGraph/related/route-3c1c06e2de280418.js +0 -1
  474. package/.next-prod/static/chunks/app/api/projectGraph/risk/route-3c1c06e2de280418.js +0 -1
  475. package/.next-prod/static/chunks/app/api/projectGraph/search/route-3c1c06e2de280418.js +0 -1
  476. package/.next-prod/static/chunks/app/api/projects/route-3c1c06e2de280418.js +0 -1
  477. package/.next-prod/static/chunks/app/api/prompts/config/route-3c1c06e2de280418.js +0 -1
  478. package/.next-prod/static/chunks/app/api/push/public-key/route-3c1c06e2de280418.js +0 -1
  479. package/.next-prod/static/chunks/app/api/push/subscribe/route-3c1c06e2de280418.js +0 -1
  480. package/.next-prod/static/chunks/app/api/push/unsubscribe/route-3c1c06e2de280418.js +0 -1
  481. package/.next-prod/static/chunks/app/api/redis/command/route-3c1c06e2de280418.js +0 -1
  482. package/.next-prod/static/chunks/app/api/redis/connect/route-3c1c06e2de280418.js +0 -1
  483. package/.next-prod/static/chunks/app/api/redis/delete/route-3c1c06e2de280418.js +0 -1
  484. package/.next-prod/static/chunks/app/api/redis/disconnect/route-3c1c06e2de280418.js +0 -1
  485. package/.next-prod/static/chunks/app/api/redis/get/route-3c1c06e2de280418.js +0 -1
  486. package/.next-prod/static/chunks/app/api/redis/keys/route-3c1c06e2de280418.js +0 -1
  487. package/.next-prod/static/chunks/app/api/redis/set/route-3c1c06e2de280418.js +0 -1
  488. package/.next-prod/static/chunks/app/api/review/[id]/comments/route-3c1c06e2de280418.js +0 -1
  489. package/.next-prod/static/chunks/app/api/review/[id]/replies/route-3c1c06e2de280418.js +0 -1
  490. package/.next-prod/static/chunks/app/api/review/[id]/route-3c1c06e2de280418.js +0 -1
  491. package/.next-prod/static/chunks/app/api/review/identify/route-3c1c06e2de280418.js +0 -1
  492. package/.next-prod/static/chunks/app/api/review/order/route-3c1c06e2de280418.js +0 -1
  493. package/.next-prod/static/chunks/app/api/review/route-3c1c06e2de280418.js +0 -1
  494. package/.next-prod/static/chunks/app/api/review/share-info/route-3c1c06e2de280418.js +0 -1
  495. package/.next-prod/static/chunks/app/api/review/users/route-3c1c06e2de280418.js +0 -1
  496. package/.next-prod/static/chunks/app/api/scheduled-tasks/route-3c1c06e2de280418.js +0 -1
  497. package/.next-prod/static/chunks/app/api/services/config/route-3c1c06e2de280418.js +0 -1
  498. package/.next-prod/static/chunks/app/api/services/scripts/route-3c1c06e2de280418.js +0 -1
  499. package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-3c1c06e2de280418.js +0 -1
  500. package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-3c1c06e2de280418.js +0 -1
  501. package/.next-prod/static/chunks/app/api/session-by-path/route-3c1c06e2de280418.js +0 -1
  502. package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-3c1c06e2de280418.js +0 -1
  503. package/.next-prod/static/chunks/app/api/sessions/projects/route-3c1c06e2de280418.js +0 -1
  504. package/.next-prod/static/chunks/app/api/sessions/route-3c1c06e2de280418.js +0 -1
  505. package/.next-prod/static/chunks/app/api/settings/route-3c1c06e2de280418.js +0 -1
  506. package/.next-prod/static/chunks/app/api/skills/[id]/route-3c1c06e2de280418.js +0 -1
  507. package/.next-prod/static/chunks/app/api/skills/content/route-3c1c06e2de280418.js +0 -1
  508. package/.next-prod/static/chunks/app/api/skills/route-3c1c06e2de280418.js +0 -1
  509. package/.next-prod/static/chunks/app/api/snapshots/diff/route-3c1c06e2de280418.js +0 -1
  510. package/.next-prod/static/chunks/app/api/snapshots/route-3c1c06e2de280418.js +0 -1
  511. package/.next-prod/static/chunks/app/api/terminal/aliases/route-3c1c06e2de280418.js +0 -1
  512. package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-3c1c06e2de280418.js +0 -1
  513. package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-3c1c06e2de280418.js +0 -1
  514. package/.next-prod/static/chunks/app/api/terminal/env/route-3c1c06e2de280418.js +0 -1
  515. package/.next-prod/static/chunks/app/api/terminal/history/route-3c1c06e2de280418.js +0 -1
  516. package/.next-prod/static/chunks/app/api/version/route-3c1c06e2de280418.js +0 -1
  517. package/.next-prod/static/chunks/app/apps/[...path]/route-3c1c06e2de280418.js +0 -1
  518. package/.next-prod/static/chunks/app/manifest.webmanifest/route-3c1c06e2de280418.js +0 -1
  519. package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-3c1c06e2de280418.js +0 -1
  520. package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-3c1c06e2de280418.js +0 -1
  521. package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-3c1c06e2de280418.js +0 -1
  522. package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-3c1c06e2de280418.js +0 -1
  523. package/.next-prod/static/css/83c134c954630942.css +0 -1
  524. package/.next-prod/static/pgteRwI6FQcp683smeSNO/_buildManifest.js +0 -1
  525. /package/.next-prod/static/{pgteRwI6FQcp683smeSNO → noNfrQRJFchmZSWx_yn1K}/_ssgManifest.js +0 -0
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var a={};a.id=8834,a.ids=[8834],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},6727:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D9:()=>r,LO:()=>q,OR:()=>m,SJ:()=>s,fA:()=>l,fG:()=>p});var e=c(29021),f=c(89705),g=c(56825),h=c(72891),i=c(770),j=c(88503),k=a([h,j,g]);[h,j,g]=k.then?(await k)():k;let l="nodejs",m="force-dynamic",n=["claude","ollama","codex","kimi","deepseek","glm"],o=new Set(["ollama","deepseek","kimi","glm"]),p=(0,h.RL)(()=>f.JkU(function*(){let a=yield*j.Uu;return(0,h.ok)(a)})),q=(0,h.RL)(a=>f.JkU(function*(){let b,{cwd:c,tabId:d,sessionId:k,engine:l,model:m,language:p,message:q,taskFile:r,type:s,delayMinutes:t,intervalMinutes:u,activeFrom:v,activeTo:w,cron:x}=yield*(0,h.k9)(a);if(!c||!d||!k||!s)return yield*f.fJG(new i.yI({field:"cwd|tabId|sessionId|type",reason:"missing"}));let y=yield*f.JkU(function*(){let a=q?.trim()??"",b=r?.trim()??"";return a||b?b?b.startsWith("/")?(0,e.existsSync)(b)?{message:"",taskFile:b}:yield*f.fJG(new i.yI({field:"taskFile",reason:"File does not exist or cannot be read"})):yield*f.fJG(new i.yI({field:"taskFile",reason:"must be absolute"})):{message:a}:yield*f.fJG(new i.yI({field:"message|taskFile",reason:"missing"}))});if(l&&!n.includes(l))return yield*f.fJG(new i.yI({field:"engine",reason:`unknown engine '${l}'`}));let z=Date.now();if("once"===s&&t)b=z+6e4*t;else if("interval"===s&&u)b=z+6e4*u;else{if("cron"!==s||!x)return yield*f.fJG(new i.yI({field:"type|timeConfig",reason:"Invalid type or missing time config"}));b=(0,g.$_)(x)}let A={id:`task-${z}-${Math.random().toString(36).slice(2,8)}`,cwd:c,tabId:d,sessionId:k,engine:l,model:l&&o.has(l)?m:void 0,language:p,message:y.message,taskFile:y.taskFile,type:s,delayMinutes:"once"===s?t:void 0,intervalMinutes:"interval"===s?u:void 0,activeFrom:"interval"===s?v:void 0,activeTo:"interval"===s?w:void 0,cron:"cron"===s?x:void 0,nextFireTime:b,paused:!1,createdAt:z},B=yield*(0,j.sP)(A);return(0,h.ok)({task:B})})),r=(0,h.RL)(a=>f.JkU(function*(){let{id:b,action:c,fields:d}=yield*(0,h.k9)(a);if(!b)return yield*f.fJG(new i.yI({field:"id",reason:"missing"}));let e=yield*(0,j.ex)(b,c,d);return e.simpleSuccess?(0,h.ok)({success:!0}):(0,h.ok)({task:e.task})})),s=(0,h.RL)(a=>f.JkU(function*(){let b=yield*(0,h.k9)(a);return b.id?(yield*(0,j.OT)(b.id),(0,h.ok)({success:!0})):yield*f.fJG(new i.yI({field:"id",reason:"missing"}))}));d()}catch(a){d(a)}})},8086:a=>{a.exports=require("module")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14480:(a,b,c)=>{c.d(b,{A:()=>g});var d=c(63863),e=c(11672),f=c(47313);d.Ay.isInitialized||d.Ay.init({resources:{en:{translation:e},zh:{translation:f}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});let g=d.Ay},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},38616:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>e.SJ,GET:()=>e.fG,PATCH:()=>e.D9,POST:()=>e.LO,dynamic:()=>e.OR,runtime:()=>e.fA});var e=c(6727),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},41204:a=>{a.exports=require("string_decoder")},41726:(a,b,c)=>{c.d(b,{iX:()=>h,mw:()=>f,o5:()=>g,oO:()=>i});var d=c(7939);function e(a){return{file:a,async read(){let b=await (0,d.JE)(a,{});return b.apiKey?.trim()??""},async write(b){await (0,d.An)(a,{apiKey:b})}}}let f=e(d.B0),g=e(d.N8),h=e(d.nm);function i(a){return a?a.length<=8?a.replace(/./g,"•"):`${a.slice(0,3)}${"•".repeat(Math.max(4,a.length-7))}${a.slice(-4)}`:""}},43775:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/scheduled-tasks/route",pathname:"/api/scheduled-tasks",filename:"route",bundlePath:"app/api/scheduled-tasks/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/scheduled-tasks/route.ts",nextConfigOutput:"",userland:()=>c(38616),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/scheduled-tasks/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51181:a=>{a.exports=require("web-push")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},56180:(a,b,c)=>{c.d(b,{u:()=>h});var d=c(7939),e=c(59419),f=c(39876);let g={sessionsRoot:(0,d.B3)("ollama"),defaultModel:"qwen3.5:35b-a3b-coding-nvfp4",createModel:a=>(0,f.q)(a)},h={name:"ollama",preflight:async a=>(0,e.p)(a),runner:{run:a=>(0,e.o)(a,g)}}},56825:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$_:()=>r,So:()=>p,_u:()=>x});var e=c(29021),f=c(7939),g=c(79830),h=c(82940),i=c(33286),j=c(81869),k=c(89705),l=c(14480),m=c(770),n=c(94506),o=a([j,i,n]);function p(a){if(!a.taskFile)return a.message;let b=l.A.t("scheduledTasks.taskFilePromptHeader",{lng:a.language||"en"});return`${b}
2
- - ${a.taskFile}`}function q(a,b,c){let d=[];for(let e of a.split(","))if("*"===e)for(let a=b;a<=c;a++)d.push(a);else if(e.includes("/")){let[a,f]=e.split("/"),g=parseInt(f,10),h="*"===a?b:parseInt(a,10);for(let a=h;a<=c;a+=g)d.push(a)}else if(e.includes("-")){let[a,b]=e.split("-").map(Number);for(let c=a;c<=b;c++)d.push(c)}else d.push(parseInt(e,10));return d}function r(a,b=new Date){let c=a.trim().split(/\s+/);if(5!==c.length)return b.getTime()+6e4;let d=q(c[0],0,59),e=q(c[1],0,23),f=q(c[2],1,31),g=q(c[3],1,12),h=q(c[4],0,6),i=new Date(b);i.setSeconds(0,0),i.setMinutes(i.getMinutes()+1);for(let a=0;a<527040;a++){let a=i.getMinutes(),b=i.getHours(),c=i.getDate(),j=i.getMonth()+1,k=i.getDay();if(d.includes(a)&&e.includes(b)&&f.includes(c)&&g.includes(j)&&h.includes(k))return i.getTime();i.setMinutes(i.getMinutes()+1)}return b.getTime()+864e5}[j,i,n]=o.then?(await o)():o;let u={ollama:f.yw,deepseek:f.Xi,kimi:f.n2,glm:f.Rk};async function s(a,b){if(!u[b]&&"claude"!==b&&"codex"!==b)return!1;let c=await (0,f.JE)((0,f.Mx)(a.cwd),{});return c.noHistories?.[a.sessionId]===!0}async function t(a){return n.s9.runPromise(k.JkU(function*(){let b,c=a.engine??"claude";if(!["claude","ollama","codex","kimi","deepseek","glm"].includes(c))return yield*k.fJG(new m.Yv({provider:"claude",kind:"unsupported-engine",cause:Error(`scheduled tasks not supported for engine '${c}' (task ${a.id})`)}));if(a.taskFile&&!(0,e.existsSync)(a.taskFile))return yield*k.fJG(new m.Yv({provider:c,kind:"unknown",cause:Error(`task file not found: ${a.taskFile} (task ${a.id})`)}));let d=(b=u[c])?b(a.cwd,a.sessionId):"codex"===c?(0,f.eg)(a.sessionId):(0,f.Kk)(a.cwd,a.sessionId),g=!d||!(0,e.existsSync)(d);return g&&console.warn(`[ScheduledTask] resume session missing (${d??`no session for ${a.sessionId}`}) for task ${a.id}, engine ${c}; starting a fresh session`),yield*k.$mh({try:async()=>{let b=(0,j.E)(c);if(!b)throw Error(`no engine spec for ${c}`);let d=await s(a,c),e=await (0,i.T)(b,{prompt:p(a),...g?{}:{sessionId:a.sessionId},cwd:a.cwd,engine:c,...a.model&&{model:a.model},...d&&{noHistory:!0}});if(!e.ok)throw Error(`${c} dispatch rejected (${e.status}): ${e.error}`);let f=e.runKey,k=Date.now()+18e5;for(;(0,h.yQ)(f)&&Date.now()<k;)await new Promise(a=>setTimeout(a,500));if((0,h.yQ)(f))throw(0,h.Y6)(f),Error(`${c} run timed out after 30m (session ${a.sessionId})`);let l=(0,h.Si)(f);if(!l||"error"===l.status)throw Error(`${c} run failed (session ${a.sessionId})`);if(g){let b=(0,h.j$)(f);b&&b!==a.sessionId&&(console.warn(`[ScheduledTask] task ${a.id}: rebound session ${a.sessionId} → ${b}`),a.sessionId=b)}return!0},catch:a=>new m.Yv({provider:c,kind:"unknown",cause:a})})}).pipe(k.h9N(b=>k.JkU(function*(){return console.error(`[ScheduledTask] Failed to send message for task ${a.id}:`,b),yield*k.$mh(()=>(0,g.CS)(a.cwd,a.sessionId,"unread")).pipe(k.NWQ(()=>k.rIH)),!1}))))}class v{async ensureInit(){if(!this.initialized)return this.initPromise||(this.initPromise=this.init()),this.initPromise}async init(){if(!this.initialized){for(let a of(this.initialized=!0,this.tasks=await (0,f.JE)(f.iK,[]),console.log(`[ScheduledTaskManager] Loaded ${this.tasks.length} scheduled tasks`),this.tasks))a.paused||a.completed||this.scheduleTask(a);await this.saveToDisk()}}setOnTaskFired(a){this.onTaskFired=a}async readTasksFromDisk(){return(0,f.JE)(f.iK,[])}async getTasks(){await this.ensureInit();let a=await this.readTasksFromDisk();return a.sort((a,b)=>(a.sortIndex??a.createdAt)-(b.sortIndex??b.createdAt)),a}async getUnreadCount(){return await this.ensureInit(),(await this.readTasksFromDisk()).filter(a=>a.unread).length}async addTask(a){await this.ensureInit();let b={...a};return await (0,f.N9)(f.iK,[],a=>[...a,b]),this.tasks.push(b),b.paused||b.completed||this.scheduleTask(b),b}async updateTask(a,b){await this.ensureInit();let c=await (0,f.Ux)(f.iK,async()=>{let c=await (0,f.JE)(f.iK,[]),d=c.findIndex(b=>b.id===a);if(-1===d)return null;let e={...c[d],...b};return c[d]=e,await (0,f.An)(f.iK,c),e});if(!c)return null;let d=this.tasks.findIndex(b=>b.id===a);return -1!==d&&(this.tasks[d]=c,this.clearTimer(a),c.paused||c.completed||this.scheduleTask(c)),c}async deleteTask(a){if(await this.ensureInit(),!await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]),c=b.findIndex(b=>b.id===a);return -1!==c&&(b.splice(c,1),await (0,f.An)(f.iK,b),!0)}))return!1;let b=this.tasks.findIndex(b=>b.id===a);return -1!==b&&(this.clearTimer(a),this.tasks.splice(b,1)),!0}async pauseTask(a){return this.updateTask(a,{paused:!0})}async resumeTask(a){let b=(await (0,f.JE)(f.iK,[])).find(b=>b.id===a);if(!b)return null;let c=Date.now(),d=b.nextFireTime;return d<=c&&(d="interval"===b.type&&b.intervalMinutes?c+6e4*b.intervalMinutes:"cron"===b.type&&b.cron?r(b.cron):c+6e4),this.updateTask(a,{paused:!1,nextFireTime:d,consecutiveFailures:0})}async triggerTask(a){await this.ensureInit();let b=(await (0,f.JE)(f.iK,[])).find(b=>b.id===a);if(!b)return;let c=this.tasks.findIndex(b=>b.id===a);-1!==c?this.tasks[c]=b:this.tasks.push(b),this.fireTaskManual(a).catch(b=>{console.error(`[ScheduledTask] Manual trigger failed for ${a}:`,b)})}async fireTaskManual(a){if(this.firing.has(a))return void console.warn(`[ScheduledTask] Skipping manual trigger of ${a}: still in flight`);let b=this.tasks.find(b=>b.id===a);if(b){console.log(`[ScheduledTask] Manual trigger ${a}: "${b.message}"`),this.firing.add(a);try{let a=await t(b);b.lastFiredAt=Date.now(),b.lastResult=a?"success":"error",b.consecutiveFailures=a?0:(b.consecutiveFailures??0)+1,b.unread=!0,await this.saveToDisk(),this.onTaskFired&&this.onTaskFired(b)}finally{this.firing.delete(a)}}}async markRead(a){await this.updateTask(a,{unread:!1})}async markReadBySessionId(a){await this.ensureInit(),await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]),c=!1;for(let d of b)d.sessionId===a&&d.unread&&(d.unread=!1,c=!0);c&&await (0,f.An)(f.iK,b)})}async markAllRead(){await this.ensureInit(),await (0,f.Ux)(f.iK,async()=>{let a=await (0,f.JE)(f.iK,[]),b=!1;for(let c of a)c.unread&&(c.unread=!1,b=!0);b&&await (0,f.An)(f.iK,a)})}async reorderTasks(a){await this.ensureInit(),await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]);for(let c=0;c<a.length;c++){let d=b.find(b=>b.id===a[c]);d&&(d.sortIndex=c)}await (0,f.An)(f.iK,b)})}scheduleTask(a){let b=Date.now();if(a.nextFireTime<=b)if("interval"===a.type&&a.intervalMinutes)a.nextFireTime=b+6e4*a.intervalMinutes;else{if("cron"!==a.type||!a.cron)return a.completed=!0,!1;a.nextFireTime=r(a.cron)}this.clearTimer(a.id);let c=a.nextFireTime-b,d=setTimeout(()=>{this.fireTask(a.id)},c);return this.timers.set(a.id,d),!0}clearTimer(a){let b=this.timers.get(a);b&&(clearTimeout(b),this.timers.delete(a))}isInActiveRange(a){if("interval"!==a.type||!a.activeFrom||!a.activeTo)return!0;let b=new Date,[c,d]=a.activeFrom.split(":").map(Number),[e,f]=a.activeTo.split(":").map(Number),g=60*b.getHours()+b.getMinutes(),h=60*c+d,i=60*e+f;return h<=i?g>=h&&g<=i:g>=h||g<=i}async fireTask(a){if(this.firing.has(a))return void console.warn(`[ScheduledTask] Skipping reentrant fire of ${a}: still in flight`);let b=this.tasks.find(b=>b.id===a);if(b&&!b.paused){if(!this.isInActiveRange(b)){console.log(`[ScheduledTask] Skipping task ${a}: outside active range ${b.activeFrom}-${b.activeTo}`),"interval"===b.type&&b.intervalMinutes&&(b.nextFireTime=Date.now()+6e4*b.intervalMinutes,this.scheduleTask(b),await this.saveToDisk());return}console.log(`[ScheduledTask] Firing task ${a}: "${b.message}"`),this.firing.add(a);try{let c=await t(b);b.lastFiredAt=Date.now(),b.lastResult=c?"success":"error",b.consecutiveFailures=c?0:(b.consecutiveFailures??0)+1,b.unread=!0;let d=!c&&(b.consecutiveFailures??0)>=3;"once"===b.type?b.completed=!0:d?(b.paused=!0,this.clearTimer(a),console.warn(`[ScheduledTask] auto-paused task ${a} after ${b.consecutiveFailures} consecutive failures`)):"interval"===b.type&&b.intervalMinutes?(b.nextFireTime=Date.now()+6e4*b.intervalMinutes,this.scheduleTask(b)):"cron"===b.type&&b.cron&&(b.nextFireTime=r(b.cron),this.scheduleTask(b)),await this.saveToDisk(),this.onTaskFired&&this.onTaskFired(b)}finally{this.firing.delete(a)}}}async saveToDisk(){try{await (0,f.N9)(f.iK,[],()=>[...this.tasks])}catch(a){console.error("[ScheduledTaskManager] Failed to save:",a)}}constructor(){this.tasks=[],this.timers=new Map,this.firing=new Set,this.initialized=!1,this.initPromise=null,this.onTaskFired=null}}let w=globalThis,x=w.__scheduledTaskManager??(w.__scheduledTaskManager=new v);d()}catch(a){d(a)}})},61994:(a,b,c)=>{c.d(b,{k7:()=>k,tl:()=>j});var d=c(7939),e=c(79830),f=c(59419),g=c(39876);async function h(){return(0,d.JE)(d.tP,{})}function i(a,b,c){if(!a.regions)return a.endpoints;let d=b.region||a.regions.defaultFor(c);return a.regions.byId[d]??a.endpoints}async function j(a){let b=await h();return i(a,b.engines?.[a.name]??{},b.language)}function k(a){return{name:a.name,async preflight(b){var c,d,e;let g=await h(),i=g.engines?.[a.name]??{};if(!await a.apiKey.read())return{ok:!1,status:400,error:`${a.label} API key is not configured. Open the ${a.label} picker in the chat header to set one.`};let j=(0,f.p)(b);return j.ok?(c="string"==typeof b.model?b.model:void 0,d=i.builtinModel,e=a.defaultModel,b.model="string"==typeof c&&c.trim()?c.trim():d&&d.trim()?d.trim():e,{ok:!0}):j},runner:{async run(b){let c=await a.apiKey.read(),e=await h(),j=e.engines?.[a.name]??{},k=i(a,j,e.language);await (0,f.o)(b,{sessionsRoot:(0,d.B3)(a.name),defaultModel:a.defaultModel,createModel:async a=>(0,g.a)({baseURL:k.openAiBaseUrl,apiKey:c,modelName:a}),...void 0!==a.builtinTemperature&&{temperature:a.builtinTemperature}})},resolveTitle:(a,b)=>(0,e.Pn)(a,b)}}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},67928:(a,b,c)=>{c.d(b,{SY:()=>h,YR:()=>f});var d=c(41726),e=c(61994);let f="https://api.kimi.com/coding/v1",g={name:"kimi",label:"Kimi",endpoints:{openAiBaseUrl:f},defaultModel:"kimi-for-coding",apiKey:d.o5,builtinTemperature:null},h=(0,e.k7)(g)},72587:(a,b,c)=>{c.d(b,{gh:()=>g,ux:()=>h});var d=c(41726),e=c(61994);let f={cn:{openAiBaseUrl:"https://open.bigmodel.cn/api/coding/paas/v4"},global:{openAiBaseUrl:"https://api.z.ai/api/coding/paas/v4"}};Object.keys(f);let g={name:"glm",label:"GLM",endpoints:f.cn,regions:{byId:f,defaultFor:function(a){return"en"===a?"global":"cn"}},defaultModel:"glm-5.2",apiKey:d.iX},h=(0,e.k7)(g)},74075:a=>{a.exports=require("zlib")},75342:a=>{a.exports=require("@vscode/ripgrep")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81869:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{E:()=>l});var e=c(30816),f=c(86184),g=c(56180),h=c(67928),i=c(72587),j=c(29352),k=a([e]);let m={claude:(e=(k.then?(await k)():k)[0]).m,deepseek:f.e,ollama:g.u,kimi:h.SY,glm:i.ux,codex:j.ND};function l(a){return m[a??"claude"]}d()}catch(a){d(a)}})},83997:a=>{a.exports=require("tty")},86184:(a,b,c)=>{c.d(b,{e:()=>g});var d=c(41726),e=c(61994);let f={name:"deepseek",label:"DeepSeek",endpoints:{openAiBaseUrl:"https://api.deepseek.com/v1"},defaultModel:"deepseek-v4-pro",apiKey:d.mw},g=(0,e.k7)(f)},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88503:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OT:()=>n,Uu:()=>k,ex:()=>p,sP:()=>l});var e=c(89705),f=c(770),g=c(56825),h=a([g]);g=(h.then?(await h)():h)[0];let i=e.$mh({try:()=>g._u.getTasks(),catch:a=>new f.uV({message:"scheduler.getTasks failed",cause:a})}),j=e.$mh({try:()=>g._u.getUnreadCount(),catch:a=>new f.uV({message:"scheduler.getUnreadCount failed",cause:a})}),k=e.JkU(function*(){let a=yield*i,b=yield*j;return{tasks:a.map(a=>({...a,resolvedPrompt:(0,g.So)(a)})),unreadCount:b}}).pipe(e.DM4(()=>({tasks:[],unreadCount:0}))),l=a=>e.$mh({try:()=>g._u.addTask(a),catch:a=>new f.uV({message:"scheduler.addTask failed",cause:a})}),m=(a,b)=>e.$mh({try:()=>g._u.updateTask(a,b),catch:a=>new f.uV({message:"scheduler.updateTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))),n=a=>e.$mh({try:()=>g._u.deleteTask(a),catch:a=>new f.uV({message:"scheduler.deleteTask failed",cause:a})}).pipe(e.qIB(b=>b?e.rIH:e.fJG(new f.m_({resource:"task",id:a})))),o=e.$mh({try:()=>g._u.markAllRead(),catch:a=>new f.uV({message:"scheduler.markAllRead failed",cause:a})}),p=(a,b,c)=>{if("pause"===b)return e.$mh({try:()=>g._u.pauseTask(a),catch:a=>new f.uV({message:"scheduler.pauseTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})));if("resume"===b)return e.$mh({try:()=>g._u.resumeTask(a),catch:a=>new f.uV({message:"scheduler.resumeTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})));if("trigger"===b)return e.$mh({try:()=>g._u.triggerTask(a),catch:a=>new f.uV({message:"scheduler.triggerTask failed",cause:a})}).pipe(e.as({task:null,simpleSuccess:!0}));if("markRead"===b)return e.$mh({try:()=>g._u.markRead(a),catch:a=>new f.uV({message:"scheduler.markRead failed",cause:a})}).pipe(e.as({task:null,simpleSuccess:!0}));if("markReadBySessionId"===b&&"string"==typeof c?.sessionId){let a;return(a=c.sessionId,e.$mh({try:()=>g._u.markReadBySessionId(a),catch:a=>new f.uV({message:"scheduler.markReadBySessionId failed",cause:a})})).pipe(e.as({task:null,simpleSuccess:!0}))}if("markAllRead"===b)return o.pipe(e.as({task:null,simpleSuccess:!0}));if("reorder"===b&&Array.isArray(c?.orderedIds)){let a;return(a=c.orderedIds,e.$mh({try:()=>g._u.reorderTasks([...a]),catch:a=>new f.uV({message:"scheduler.reorderTasks failed",cause:a})})).pipe(e.as({task:null,simpleSuccess:!0}))}if("update"===b&&c){let b=Date.now(),d={...c};if("taskFile"in c||"message"in c){let a="string"==typeof c.taskFile?c.taskFile.trim():"";d.taskFile=a||void 0,d.message=a?"":"string"==typeof c.message?c.message.trim():""}return"once"===c.type&&c.delayMinutes?(d.nextFireTime=b+6e4*c.delayMinutes,d.completed=!1):"interval"===c.type&&c.intervalMinutes?d.nextFireTime=b+6e4*c.intervalMinutes:"cron"===c.type&&c.cron&&(d.nextFireTime=(0,g.$_)(c.cron)),d.paused=!1,m(a,d).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})))}return c?m(a,c).pipe(e.TjK(a=>({task:a,simpleSuccess:!1}))):e.PyW({task:null,simpleSuccess:!1})};d()}catch(a){d(a)}})},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,3742,3863,6495,1564,9830,841,3286,6548,516,9352,816],()=>b(b.s=43775));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=8834,a.ids=[8834],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},6727:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D9:()=>r,LO:()=>q,OR:()=>m,SJ:()=>s,fA:()=>l,fG:()=>p});var e=c(29021),f=c(89705),g=c(56825),h=c(72891),i=c(770),j=c(88503),k=a([h,j,g]);[h,j,g]=k.then?(await k)():k;let l="nodejs",m="force-dynamic",n=["claude","ollama","codex","kimi","deepseek","glm"],o=new Set(["ollama","deepseek","kimi","glm"]),p=(0,h.RL)(()=>f.JkU(function*(){let a=yield*j.Uu;return(0,h.ok)(a)})),q=(0,h.RL)(a=>f.JkU(function*(){let b,{cwd:c,tabId:d,sessionId:k,engine:l,model:m,language:p,message:q,taskFile:r,type:s,delayMinutes:t,intervalMinutes:u,activeFrom:v,activeTo:w,cron:x}=yield*(0,h.k9)(a);if(!c||!d||!k||!s)return yield*f.fJG(new i.yI({field:"cwd|tabId|sessionId|type",reason:"missing"}));let y=yield*f.JkU(function*(){let a=q?.trim()??"",b=r?.trim()??"";return a||b?b?b.startsWith("/")?(0,e.existsSync)(b)?{message:"",taskFile:b}:yield*f.fJG(new i.yI({field:"taskFile",reason:"File does not exist or cannot be read"})):yield*f.fJG(new i.yI({field:"taskFile",reason:"must be absolute"})):{message:a}:yield*f.fJG(new i.yI({field:"message|taskFile",reason:"missing"}))});if(l&&!n.includes(l))return yield*f.fJG(new i.yI({field:"engine",reason:`unknown engine '${l}'`}));let z=Date.now();if("once"===s&&t)b=z+6e4*t;else if("interval"===s&&u)b=z+6e4*u;else{if("cron"!==s||!x)return yield*f.fJG(new i.yI({field:"type|timeConfig",reason:"Invalid type or missing time config"}));b=(0,g.$_)(x)}let A={id:`task-${z}-${Math.random().toString(36).slice(2,8)}`,cwd:c,tabId:d,sessionId:k,engine:l,model:l&&o.has(l)?m:void 0,language:p,message:y.message,taskFile:y.taskFile,type:s,delayMinutes:"once"===s?t:void 0,intervalMinutes:"interval"===s?u:void 0,activeFrom:"interval"===s?v:void 0,activeTo:"interval"===s?w:void 0,cron:"cron"===s?x:void 0,nextFireTime:b,paused:!1,createdAt:z},B=yield*(0,j.sP)(A);return(0,h.ok)({task:B})})),r=(0,h.RL)(a=>f.JkU(function*(){let{id:b,action:c,fields:d}=yield*(0,h.k9)(a);if(!b)return yield*f.fJG(new i.yI({field:"id",reason:"missing"}));let e=yield*(0,j.ex)(b,c,d);return e.simpleSuccess?(0,h.ok)({success:!0}):(0,h.ok)({task:e.task})})),s=(0,h.RL)(a=>f.JkU(function*(){let b=yield*(0,h.k9)(a);return b.id?(yield*(0,j.OT)(b.id),(0,h.ok)({success:!0})):yield*f.fJG(new i.yI({field:"id",reason:"missing"}))}));d()}catch(a){d(a)}})},8086:a=>{a.exports=require("module")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14480:(a,b,c)=>{c.d(b,{A:()=>g});var d=c(63863),e=c(11672),f=c(47313);d.Ay.isInitialized||d.Ay.init({resources:{en:{translation:e},zh:{translation:f}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});let g=d.Ay},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},34873:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/scheduled-tasks/route",pathname:"/api/scheduled-tasks",filename:"route",bundlePath:"app/api/scheduled-tasks/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/scheduled-tasks/route.ts",nextConfigOutput:"",userland:()=>c(38616),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/scheduled-tasks/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},38616:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>e.SJ,GET:()=>e.fG,PATCH:()=>e.D9,POST:()=>e.LO,dynamic:()=>e.OR,runtime:()=>e.fA});var e=c(6727),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},41204:a=>{a.exports=require("string_decoder")},41726:(a,b,c)=>{c.d(b,{iX:()=>h,mw:()=>f,o5:()=>g,oO:()=>i});var d=c(7939);function e(a){return{file:a,async read(){let b=await (0,d.JE)(a,{});return b.apiKey?.trim()??""},async write(b){await (0,d.An)(a,{apiKey:b})}}}let f=e(d.B0),g=e(d.N8),h=e(d.nm);function i(a){return a?a.length<=8?a.replace(/./g,"•"):`${a.slice(0,3)}${"•".repeat(Math.max(4,a.length-7))}${a.slice(-4)}`:""}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51181:a=>{a.exports=require("web-push")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},56180:(a,b,c)=>{c.d(b,{u:()=>h});var d=c(7939),e=c(59419),f=c(39876);let g={sessionsRoot:(0,d.B3)("ollama"),defaultModel:"qwen3.5:35b-a3b-coding-nvfp4",createModel:a=>(0,f.q)(a)},h={name:"ollama",preflight:async a=>(0,e.p)(a),runner:{run:a=>(0,e.o)(a,g)}}},56825:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$_:()=>r,So:()=>p,_u:()=>x});var e=c(29021),f=c(7939),g=c(79830),h=c(82940),i=c(33286),j=c(81869),k=c(89705),l=c(14480),m=c(770),n=c(94506),o=a([j,i,n]);function p(a){if(!a.taskFile)return a.message;let b=l.A.t("scheduledTasks.taskFilePromptHeader",{lng:a.language||"en"});return`${b}
2
+ - ${a.taskFile}`}function q(a,b,c){let d=[];for(let e of a.split(","))if("*"===e)for(let a=b;a<=c;a++)d.push(a);else if(e.includes("/")){let[a,f]=e.split("/"),g=parseInt(f,10),h="*"===a?b:parseInt(a,10);for(let a=h;a<=c;a+=g)d.push(a)}else if(e.includes("-")){let[a,b]=e.split("-").map(Number);for(let c=a;c<=b;c++)d.push(c)}else d.push(parseInt(e,10));return d}function r(a,b=new Date){let c=a.trim().split(/\s+/);if(5!==c.length)return b.getTime()+6e4;let d=q(c[0],0,59),e=q(c[1],0,23),f=q(c[2],1,31),g=q(c[3],1,12),h=q(c[4],0,6),i=new Date(b);i.setSeconds(0,0),i.setMinutes(i.getMinutes()+1);for(let a=0;a<527040;a++){let a=i.getMinutes(),b=i.getHours(),c=i.getDate(),j=i.getMonth()+1,k=i.getDay();if(d.includes(a)&&e.includes(b)&&f.includes(c)&&g.includes(j)&&h.includes(k))return i.getTime();i.setMinutes(i.getMinutes()+1)}return b.getTime()+864e5}[j,i,n]=o.then?(await o)():o;let u={ollama:f.yw,deepseek:f.Xi,kimi:f.n2,glm:f.Rk};async function s(a,b){if(!u[b]&&"claude"!==b&&"codex"!==b)return!1;let c=await (0,f.JE)((0,f.Mx)(a.cwd),{});return c.noHistories?.[a.sessionId]===!0}async function t(a){return n.s9.runPromise(k.JkU(function*(){let b,c=a.engine??"claude";if(!["claude","ollama","codex","kimi","deepseek","glm"].includes(c))return yield*k.fJG(new m.Yv({provider:"claude",kind:"unsupported-engine",cause:Error(`scheduled tasks not supported for engine '${c}' (task ${a.id})`)}));if(a.taskFile&&!(0,e.existsSync)(a.taskFile))return yield*k.fJG(new m.Yv({provider:c,kind:"unknown",cause:Error(`task file not found: ${a.taskFile} (task ${a.id})`)}));let d=(b=u[c])?b(a.cwd,a.sessionId):"codex"===c?(0,f.eg)(a.sessionId):(0,f.Kk)(a.cwd,a.sessionId),g=!d||!(0,e.existsSync)(d);return g&&console.warn(`[ScheduledTask] resume session missing (${d??`no session for ${a.sessionId}`}) for task ${a.id}, engine ${c}; starting a fresh session`),yield*k.$mh({try:async()=>{let b=(0,j.E)(c);if(!b)throw Error(`no engine spec for ${c}`);let d=await s(a,c),e=await (0,i.T)(b,{prompt:p(a),...g?{}:{sessionId:a.sessionId},cwd:a.cwd,engine:c,...a.model&&{model:a.model},...d&&{noHistory:!0}});if(!e.ok)throw Error(`${c} dispatch rejected (${e.status}): ${e.error}`);let f=e.runKey,k=Date.now()+18e5;for(;(0,h.yQ)(f)&&Date.now()<k;)await new Promise(a=>setTimeout(a,500));if((0,h.yQ)(f))throw(0,h.Y6)(f),Error(`${c} run timed out after 30m (session ${a.sessionId})`);let l=(0,h.Si)(f);if(!l||"error"===l.status)throw Error(`${c} run failed (session ${a.sessionId})`);if(g){let b=(0,h.j$)(f);b&&b!==a.sessionId&&(console.warn(`[ScheduledTask] task ${a.id}: rebound session ${a.sessionId} → ${b}`),a.sessionId=b)}return!0},catch:a=>new m.Yv({provider:c,kind:"unknown",cause:a})})}).pipe(k.h9N(b=>k.JkU(function*(){return console.error(`[ScheduledTask] Failed to send message for task ${a.id}:`,b),yield*k.$mh(()=>(0,g.CS)(a.cwd,a.sessionId,"unread")).pipe(k.NWQ(()=>k.rIH)),!1}))))}class v{async ensureInit(){if(!this.initialized)return this.initPromise||(this.initPromise=this.init()),this.initPromise}async init(){if(!this.initialized){for(let a of(this.initialized=!0,this.tasks=await (0,f.JE)(f.iK,[]),console.log(`[ScheduledTaskManager] Loaded ${this.tasks.length} scheduled tasks`),this.tasks))a.paused||a.completed||this.scheduleTask(a);await this.saveToDisk()}}setOnTaskFired(a){this.onTaskFired=a}async readTasksFromDisk(){return(0,f.JE)(f.iK,[])}async getTasks(){await this.ensureInit();let a=await this.readTasksFromDisk();return a.sort((a,b)=>(a.sortIndex??a.createdAt)-(b.sortIndex??b.createdAt)),a}async getUnreadCount(){return await this.ensureInit(),(await this.readTasksFromDisk()).filter(a=>a.unread).length}async addTask(a){await this.ensureInit();let b={...a};return await (0,f.N9)(f.iK,[],a=>[...a,b]),this.tasks.push(b),b.paused||b.completed||this.scheduleTask(b),b}async updateTask(a,b){await this.ensureInit();let c=await (0,f.Ux)(f.iK,async()=>{let c=await (0,f.JE)(f.iK,[]),d=c.findIndex(b=>b.id===a);if(-1===d)return null;let e={...c[d],...b};return c[d]=e,await (0,f.An)(f.iK,c),e});if(!c)return null;let d=this.tasks.findIndex(b=>b.id===a);return -1!==d&&(this.tasks[d]=c,this.clearTimer(a),c.paused||c.completed||this.scheduleTask(c)),c}async deleteTask(a){if(await this.ensureInit(),!await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]),c=b.findIndex(b=>b.id===a);return -1!==c&&(b.splice(c,1),await (0,f.An)(f.iK,b),!0)}))return!1;let b=this.tasks.findIndex(b=>b.id===a);return -1!==b&&(this.clearTimer(a),this.tasks.splice(b,1)),!0}async pauseTask(a){return this.updateTask(a,{paused:!0})}async resumeTask(a){let b=(await (0,f.JE)(f.iK,[])).find(b=>b.id===a);if(!b)return null;let c=Date.now(),d=b.nextFireTime;return d<=c&&(d="interval"===b.type&&b.intervalMinutes?c+6e4*b.intervalMinutes:"cron"===b.type&&b.cron?r(b.cron):c+6e4),this.updateTask(a,{paused:!1,nextFireTime:d,consecutiveFailures:0})}async triggerTask(a){await this.ensureInit();let b=(await (0,f.JE)(f.iK,[])).find(b=>b.id===a);if(!b)return;let c=this.tasks.findIndex(b=>b.id===a);-1!==c?this.tasks[c]=b:this.tasks.push(b),this.fireTaskManual(a).catch(b=>{console.error(`[ScheduledTask] Manual trigger failed for ${a}:`,b)})}async fireTaskManual(a){if(this.firing.has(a))return void console.warn(`[ScheduledTask] Skipping manual trigger of ${a}: still in flight`);let b=this.tasks.find(b=>b.id===a);if(b){console.log(`[ScheduledTask] Manual trigger ${a}: "${b.message}"`),this.firing.add(a);try{let a=await t(b);b.lastFiredAt=Date.now(),b.lastResult=a?"success":"error",b.consecutiveFailures=a?0:(b.consecutiveFailures??0)+1,b.unread=!0,await this.saveToDisk(),this.onTaskFired&&this.onTaskFired(b)}finally{this.firing.delete(a)}}}async markRead(a){await this.updateTask(a,{unread:!1})}async markReadBySessionId(a){await this.ensureInit(),await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]),c=!1;for(let d of b)d.sessionId===a&&d.unread&&(d.unread=!1,c=!0);c&&await (0,f.An)(f.iK,b)})}async markAllRead(){await this.ensureInit(),await (0,f.Ux)(f.iK,async()=>{let a=await (0,f.JE)(f.iK,[]),b=!1;for(let c of a)c.unread&&(c.unread=!1,b=!0);b&&await (0,f.An)(f.iK,a)})}async reorderTasks(a){await this.ensureInit(),await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]);for(let c=0;c<a.length;c++){let d=b.find(b=>b.id===a[c]);d&&(d.sortIndex=c)}await (0,f.An)(f.iK,b)})}scheduleTask(a){let b=Date.now();if(a.nextFireTime<=b)if("interval"===a.type&&a.intervalMinutes)a.nextFireTime=b+6e4*a.intervalMinutes;else{if("cron"!==a.type||!a.cron)return a.completed=!0,!1;a.nextFireTime=r(a.cron)}this.clearTimer(a.id);let c=a.nextFireTime-b,d=setTimeout(()=>{this.fireTask(a.id)},c);return this.timers.set(a.id,d),!0}clearTimer(a){let b=this.timers.get(a);b&&(clearTimeout(b),this.timers.delete(a))}isInActiveRange(a){if("interval"!==a.type||!a.activeFrom||!a.activeTo)return!0;let b=new Date,[c,d]=a.activeFrom.split(":").map(Number),[e,f]=a.activeTo.split(":").map(Number),g=60*b.getHours()+b.getMinutes(),h=60*c+d,i=60*e+f;return h<=i?g>=h&&g<=i:g>=h||g<=i}async fireTask(a){if(this.firing.has(a))return void console.warn(`[ScheduledTask] Skipping reentrant fire of ${a}: still in flight`);let b=this.tasks.find(b=>b.id===a);if(b&&!b.paused){if(!this.isInActiveRange(b)){console.log(`[ScheduledTask] Skipping task ${a}: outside active range ${b.activeFrom}-${b.activeTo}`),"interval"===b.type&&b.intervalMinutes&&(b.nextFireTime=Date.now()+6e4*b.intervalMinutes,this.scheduleTask(b),await this.saveToDisk());return}console.log(`[ScheduledTask] Firing task ${a}: "${b.message}"`),this.firing.add(a);try{let c=await t(b);b.lastFiredAt=Date.now(),b.lastResult=c?"success":"error",b.consecutiveFailures=c?0:(b.consecutiveFailures??0)+1,b.unread=!0;let d=!c&&(b.consecutiveFailures??0)>=3;"once"===b.type?b.completed=!0:d?(b.paused=!0,this.clearTimer(a),console.warn(`[ScheduledTask] auto-paused task ${a} after ${b.consecutiveFailures} consecutive failures`)):"interval"===b.type&&b.intervalMinutes?(b.nextFireTime=Date.now()+6e4*b.intervalMinutes,this.scheduleTask(b)):"cron"===b.type&&b.cron&&(b.nextFireTime=r(b.cron),this.scheduleTask(b)),await this.saveToDisk(),this.onTaskFired&&this.onTaskFired(b)}finally{this.firing.delete(a)}}}async saveToDisk(){try{await (0,f.N9)(f.iK,[],()=>[...this.tasks])}catch(a){console.error("[ScheduledTaskManager] Failed to save:",a)}}constructor(){this.tasks=[],this.timers=new Map,this.firing=new Set,this.initialized=!1,this.initPromise=null,this.onTaskFired=null}}let w=globalThis,x=w.__scheduledTaskManager??(w.__scheduledTaskManager=new v);d()}catch(a){d(a)}})},61994:(a,b,c)=>{c.d(b,{k7:()=>k,tl:()=>j});var d=c(7939),e=c(79830),f=c(59419),g=c(39876);async function h(){return(0,d.JE)(d.tP,{})}function i(a,b,c){if(!a.regions)return a.endpoints;let d=b.region||a.regions.defaultFor(c);return a.regions.byId[d]??a.endpoints}async function j(a){let b=await h();return i(a,b.engines?.[a.name]??{},b.language)}function k(a){return{name:a.name,async preflight(b){var c,d,e;let g=await h(),i=g.engines?.[a.name]??{};if(!await a.apiKey.read())return{ok:!1,status:400,error:`${a.label} API key is not configured. Open the ${a.label} picker in the chat header to set one.`};let j=(0,f.p)(b);return j.ok?(c="string"==typeof b.model?b.model:void 0,d=i.builtinModel,e=a.defaultModel,b.model="string"==typeof c&&c.trim()?c.trim():d&&d.trim()?d.trim():e,{ok:!0}):j},runner:{async run(b){let c=await a.apiKey.read(),e=await h(),j=e.engines?.[a.name]??{},k=i(a,j,e.language);await (0,f.o)(b,{sessionsRoot:(0,d.B3)(a.name),defaultModel:a.defaultModel,createModel:async a=>(0,g.a)({baseURL:k.openAiBaseUrl,apiKey:c,modelName:a}),...void 0!==a.builtinTemperature&&{temperature:a.builtinTemperature}})},resolveTitle:(a,b)=>(0,e.Pn)(a,b)}}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},67928:(a,b,c)=>{c.d(b,{SY:()=>h,YR:()=>f});var d=c(41726),e=c(61994);let f="https://api.kimi.com/coding/v1",g={name:"kimi",label:"Kimi",endpoints:{openAiBaseUrl:f},defaultModel:"kimi-for-coding",apiKey:d.o5,builtinTemperature:null},h=(0,e.k7)(g)},72587:(a,b,c)=>{c.d(b,{gh:()=>g,ux:()=>h});var d=c(41726),e=c(61994);let f={cn:{openAiBaseUrl:"https://open.bigmodel.cn/api/coding/paas/v4"},global:{openAiBaseUrl:"https://api.z.ai/api/coding/paas/v4"}};Object.keys(f);let g={name:"glm",label:"GLM",endpoints:f.cn,regions:{byId:f,defaultFor:function(a){return"en"===a?"global":"cn"}},defaultModel:"glm-5.2",apiKey:d.iX},h=(0,e.k7)(g)},74075:a=>{a.exports=require("zlib")},75342:a=>{a.exports=require("@vscode/ripgrep")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81869:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{E:()=>l});var e=c(30816),f=c(86184),g=c(56180),h=c(67928),i=c(72587),j=c(29352),k=a([e]);let m={claude:(e=(k.then?(await k)():k)[0]).m,deepseek:f.e,ollama:g.u,kimi:h.SY,glm:i.ux,codex:j.ND};function l(a){return m[a??"claude"]}d()}catch(a){d(a)}})},83997:a=>{a.exports=require("tty")},86184:(a,b,c)=>{c.d(b,{e:()=>g});var d=c(41726),e=c(61994);let f={name:"deepseek",label:"DeepSeek",endpoints:{openAiBaseUrl:"https://api.deepseek.com/v1"},defaultModel:"deepseek-v4-pro",apiKey:d.mw},g=(0,e.k7)(f)},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88503:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OT:()=>n,Uu:()=>k,ex:()=>p,sP:()=>l});var e=c(89705),f=c(770),g=c(56825),h=a([g]);g=(h.then?(await h)():h)[0];let i=e.$mh({try:()=>g._u.getTasks(),catch:a=>new f.uV({message:"scheduler.getTasks failed",cause:a})}),j=e.$mh({try:()=>g._u.getUnreadCount(),catch:a=>new f.uV({message:"scheduler.getUnreadCount failed",cause:a})}),k=e.JkU(function*(){let a=yield*i,b=yield*j;return{tasks:a.map(a=>({...a,resolvedPrompt:(0,g.So)(a)})),unreadCount:b}}).pipe(e.DM4(()=>({tasks:[],unreadCount:0}))),l=a=>e.$mh({try:()=>g._u.addTask(a),catch:a=>new f.uV({message:"scheduler.addTask failed",cause:a})}),m=(a,b)=>e.$mh({try:()=>g._u.updateTask(a,b),catch:a=>new f.uV({message:"scheduler.updateTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))),n=a=>e.$mh({try:()=>g._u.deleteTask(a),catch:a=>new f.uV({message:"scheduler.deleteTask failed",cause:a})}).pipe(e.qIB(b=>b?e.rIH:e.fJG(new f.m_({resource:"task",id:a})))),o=e.$mh({try:()=>g._u.markAllRead(),catch:a=>new f.uV({message:"scheduler.markAllRead failed",cause:a})}),p=(a,b,c)=>{if("pause"===b)return e.$mh({try:()=>g._u.pauseTask(a),catch:a=>new f.uV({message:"scheduler.pauseTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})));if("resume"===b)return e.$mh({try:()=>g._u.resumeTask(a),catch:a=>new f.uV({message:"scheduler.resumeTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})));if("trigger"===b)return e.$mh({try:()=>g._u.triggerTask(a),catch:a=>new f.uV({message:"scheduler.triggerTask failed",cause:a})}).pipe(e.as({task:null,simpleSuccess:!0}));if("markRead"===b)return e.$mh({try:()=>g._u.markRead(a),catch:a=>new f.uV({message:"scheduler.markRead failed",cause:a})}).pipe(e.as({task:null,simpleSuccess:!0}));if("markReadBySessionId"===b&&"string"==typeof c?.sessionId){let a;return(a=c.sessionId,e.$mh({try:()=>g._u.markReadBySessionId(a),catch:a=>new f.uV({message:"scheduler.markReadBySessionId failed",cause:a})})).pipe(e.as({task:null,simpleSuccess:!0}))}if("markAllRead"===b)return o.pipe(e.as({task:null,simpleSuccess:!0}));if("reorder"===b&&Array.isArray(c?.orderedIds)){let a;return(a=c.orderedIds,e.$mh({try:()=>g._u.reorderTasks([...a]),catch:a=>new f.uV({message:"scheduler.reorderTasks failed",cause:a})})).pipe(e.as({task:null,simpleSuccess:!0}))}if("update"===b&&c){let b=Date.now(),d={...c};if("taskFile"in c||"message"in c){let a="string"==typeof c.taskFile?c.taskFile.trim():"";d.taskFile=a||void 0,d.message=a?"":"string"==typeof c.message?c.message.trim():""}return"once"===c.type&&c.delayMinutes?(d.nextFireTime=b+6e4*c.delayMinutes,d.completed=!1):"interval"===c.type&&c.intervalMinutes?d.nextFireTime=b+6e4*c.intervalMinutes:"cron"===c.type&&c.cron&&(d.nextFireTime=(0,g.$_)(c.cron)),d.paused=!1,m(a,d).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})))}return c?m(a,c).pipe(e.TjK(a=>({task:a,simpleSuccess:!1}))):e.PyW({task:null,simpleSuccess:!1})};d()}catch(a){d(a)}})},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,3742,3863,6495,1564,9830,841,3286,6548,516,9352,816],()=>b(b.s=34873));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=8387,a.ids=[8387],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27549:(a,b,c)=>{c.d(b,{F:()=>f});let d=a=>{let b=a.trim().split(/\s+/)[0]??"",c=b.match(/^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i);return e(c?c[1]:b)||"command"},e=a=>a.replace(/[^a-zA-Z0-9_-]/g,"").slice(0,32),f=a=>{if(!Array.isArray(a))return[];let b=new Set,c=a=>{if(!b.has(a))return b.add(a),a;let c=2;for(;b.has(`${a}-${c}`);)c++;return b.add(`${a}-${c}`),`${a}-${c}`},f=[];for(let b of a){if("string"==typeof b){let a=b.trim();if(!a)continue;f.push({name:c(d(a)),command:a});continue}if(b&&"object"==typeof b){let{name:a,command:g}=b;if("string"!=typeof g||!g.trim())continue;let h="string"==typeof a?e(a.trim()):"";f.push({name:c(h||d(g)),command:g})}}return f}},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},57559:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,POST:()=>m});var e=c(89705),f=c(7939),g=c(72891),h=c(770),i=c(27549),j=a([g]);g=(j.then?(await j)():j)[0];let k=(a,b)=>"global"===b?(0,f.po)():a?(0,f.Eu)(a):null,l=(0,g.RL)(a=>e.JkU(function*(){let b=new URL(a.url).searchParams,c=k(b.get("cwd"),b.get("scope"));if(!c)return yield*e.fJG(new h.yI({field:"cwd|scope",reason:"Missing cwd or scope"}));let d=yield*e.$mh({try:()=>(0,f.JE)(c,{customCommands:[]}),catch:a=>new h.uU({path:c,op:"read",cause:a})});return(0,g.ok)({customCommands:(0,i.F)(d?.customCommands)})})),m=(0,g.RL)(a=>e.JkU(function*(){let b=yield*(0,g.k9)(a),c=k(b.cwd??null,b.scope??null);if(!c)return yield*e.fJG(new h.yI({field:"cwd|scope",reason:"Missing cwd or scope"}));let d={customCommands:(0,i.F)(b.customCommands)};return yield*e.$mh({try:()=>(0,f.Ux)(c,()=>(0,f.An)(c,d)),catch:a=>new h.uU({path:c,op:"write",cause:a})}),(0,g.ok)({success:!0,customCommands:d.customCommands})}));d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")},97313:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/services/config/route",pathname:"/api/services/config",filename:"route",bundlePath:"app/api/services/config/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/services/config/route.ts",nextConfigOutput:"",userland:()=>c(57559),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/config/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,6495,1564],()=>b(b.s=97313));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=8387,a.ids=[8387],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27549:(a,b,c)=>{c.d(b,{F:()=>f});let d=a=>{let b=a.trim().split(/\s+/)[0]??"",c=b.match(/^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i);return e(c?c[1]:b)||"command"},e=a=>a.replace(/[^a-zA-Z0-9_-]/g,"").slice(0,32),f=a=>{if(!Array.isArray(a))return[];let b=new Set,c=a=>{if(!b.has(a))return b.add(a),a;let c=2;for(;b.has(`${a}-${c}`);)c++;return b.add(`${a}-${c}`),`${a}-${c}`},f=[];for(let b of a){if("string"==typeof b){let a=b.trim();if(!a)continue;f.push({name:c(d(a)),command:a});continue}if(b&&"object"==typeof b){let{name:a,command:g}=b;if("string"!=typeof g||!g.trim())continue;let h="string"==typeof a?e(a.trim()):"";f.push({name:c(h||d(g)),command:g})}}return f}},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},57559:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l,POST:()=>m});var e=c(89705),f=c(7939),g=c(72891),h=c(770),i=c(27549),j=a([g]);g=(j.then?(await j)():j)[0];let k=(a,b)=>"global"===b?(0,f.po)():a?(0,f.Eu)(a):null,l=(0,g.RL)(a=>e.JkU(function*(){let b=new URL(a.url).searchParams,c=k(b.get("cwd"),b.get("scope"));if(!c)return yield*e.fJG(new h.yI({field:"cwd|scope",reason:"Missing cwd or scope"}));let d=yield*e.$mh({try:()=>(0,f.JE)(c,{customCommands:[]}),catch:a=>new h.uU({path:c,op:"read",cause:a})});return(0,g.ok)({customCommands:(0,i.F)(d?.customCommands)})})),m=(0,g.RL)(a=>e.JkU(function*(){let b=yield*(0,g.k9)(a),c=k(b.cwd??null,b.scope??null);if(!c)return yield*e.fJG(new h.yI({field:"cwd|scope",reason:"Missing cwd or scope"}));let d={customCommands:(0,i.F)(b.customCommands)};return yield*e.$mh({try:()=>(0,f.Ux)(c,()=>(0,f.An)(c,d)),catch:a=>new h.uU({path:c,op:"write",cause:a})}),(0,g.ok)({success:!0,customCommands:d.customCommands})}));d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},77419:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/services/config/route",pathname:"/api/services/config",filename:"route",bundlePath:"app/api/services/config/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/services/config/route.ts",nextConfigOutput:"",userland:()=>c(57559),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/config/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,6495,1564],()=>b(b.s=77419));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=4647,a.ids=[4647],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50977:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l});var e=c(79748),f=c(29021),g=c(33873),h=c(89705),i=c(72891),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(0,i.RL)(a=>h.JkU(function*(){let b=new URL(a.url).searchParams.get("cwd");if(!b)return yield*h.fJG(new j.yI({field:"cwd",reason:"missing"}));let c=(0,g.join)(b,"package.json");if(!(0,f.existsSync)(c))return(0,i.ok)({scripts:{}});let d=yield*h.$mh({try:()=>(0,e.readFile)(c,"utf-8"),catch:a=>new j.uU({path:c,op:"read",cause:a})}),k=yield*h.SvU({try:()=>JSON.parse(d),catch:a=>new j.yI({field:"package.json",reason:`invalid JSON: ${String(a)}`})});return(0,i.ok)({scripts:k.scripts??{}})}));d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72539:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/services/scripts/route",pathname:"/api/services/scripts",filename:"route",bundlePath:"app/api/services/scripts/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/services/scripts/route.ts",nextConfigOutput:"",userland:()=>c(50977),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/scripts/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,6495,1564],()=>b(b.s=72539));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=4647,a.ids=[4647],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},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")},33053:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/services/scripts/route",pathname:"/api/services/scripts",filename:"route",bundlePath:"app/api/services/scripts/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/services/scripts/route.ts",nextConfigOutput:"",userland:()=>c(50977),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/scripts/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50977:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l});var e=c(79748),f=c(29021),g=c(33873),h=c(89705),i=c(72891),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(0,i.RL)(a=>h.JkU(function*(){let b=new URL(a.url).searchParams.get("cwd");if(!b)return yield*h.fJG(new j.yI({field:"cwd",reason:"missing"}));let c=(0,g.join)(b,"package.json");if(!(0,f.existsSync)(c))return(0,i.ok)({scripts:{}});let d=yield*h.$mh({try:()=>(0,e.readFile)(c,"utf-8"),catch:a=>new j.uU({path:c,op:"read",cause:a})}),k=yield*h.SvU({try:()=>JSON.parse(d),catch:a=>new j.yI({field:"package.json",reason:`invalid JSON: ${String(a)}`})});return(0,i.ok)({scripts:k.scripts??{}})}));d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,6495,1564],()=>b(b.s=33053));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=3347,a.ids=[3347],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},2259:(a,b,c)=>{c.d(b,{N:()=>g});var d=c(40516);function e(a){if(a.assistantOpen)return null;let b=`codex-assistant-${a.msgCounter++}`;return a.assistantOpen=!0,b}function f(a,b,c){let d=RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return a.map(a=>a.replace(d,c))}function g(a,b,c,g,h){if(!g)return{newLines:f(a,b,c),targetMissed:!1};let i=a.find(a=>{try{return"session_meta"===JSON.parse(a).type}catch{return!1}});if(!i)return{newLines:[],targetMissed:!0};let j=[],k={msgCounter:0,assistantOpen:!1,spawnCallIds:new Set,waitCallIds:new Set},l=[],m=-1,n=()=>{0!==l.length&&(j.push(l),l=[],k.assistantOpen=!1)};for(let b of a){let a;if(b.trim()){try{a=JSON.parse(b)}catch{l.length>0&&l.push(b);continue}"session_meta"!==a.type&&(function(a){let b=a.payload;return"event_msg"===a.type&&b?.type==="task_started"}(a)&&l.length>0&&n(),l.push(b),(function(a,b){let c=a.payload;if(!c)return[];let f=[];if("response_item"===a.type){if("message"===c.type&&"user"===c.role){let{text:a,images:e}=(0,d.L8)(c.content);(e.length>0||a&&!a.startsWith("<")&&!a.startsWith("#"))&&(b.assistantOpen=!1,f.push(`codex-user-${b.msgCounter++}`))}if("message"===c.type&&"assistant"===c.role&&c.content?.filter(a=>"output_text"===a.type&&a.text).map(a=>a.text).join("")){let a=e(b);a&&f.push(a)}if("function_call"===c.type&&c.name&&(c.name===d.jB&&c.call_id&&b.waitCallIds.add(c.call_id),!(d.g$.has(c.name)&&c.name!==d.$H))){let a=e(b);a&&f.push(a),c.name===d.$H&&c.call_id&&b.spawnCallIds.add(c.call_id)}if("custom_tool_call"===c.type&&c.name||"custom_tool_call_output"===c.type&&c.call_id){let a=e(b);a&&f.push(a)}if((0,d.F3)(c)){let a=e(b);a&&f.push(a)}if("function_call_output"===c.type&&c.call_id&&!b.spawnCallIds.has(c.call_id)&&!b.waitCallIds.has(c.call_id)){let a=e(b);a&&f.push(a)}}if("event_msg"===a.type&&"web_search_end"===c.type&&c.call_id){let a=e(b);a&&f.push(a)}return"response_completed"===a.type&&(b.assistantOpen=!1),f})(a,k).includes(g)&&(m=j.length),function(a){let b=a.payload;return"event_msg"===a.type&&b?.type==="task_complete"}(a)&&n())}}return(n(),m<0)?{newLines:[],targetMissed:!0}:{newLines:f([i,...("single"===h?j.slice(m,m+1):j.slice(0,m+1)).flat()],b,c),targetMissed:!1}}},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},13437:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(29021),e=c(33873);function f(a){return a.replace(/\.jsonl$/,"")}function g(a,b){if(d.mkdirSync((0,e.join)(b,".."),{recursive:!0}),!d.existsSync(b))try{d.linkSync(a,b)}catch{d.copyFileSync(a,b)}}function h(a){try{return d.readdirSync(a)}catch{return[]}}function i(a,b,c){let i=f(a);if(!d.existsSync(i))return 0;let j=f(b),k=c.join("\n"),l=a=>a.length>0&&k.includes(a),m=0;try{let a=(0,e.join)(i,"subagents");for(let b of h(a)){let c;if(!b.endsWith(".meta.json"))continue;try{c=JSON.parse(d.readFileSync((0,e.join)(a,b),"utf-8")).toolUseId}catch{continue}if(!c||!l(c))continue;let f=b.replace(/\.meta\.json$/,".jsonl");for(let c of[b,f])d.existsSync((0,e.join)(a,c))&&(g((0,e.join)(a,c),(0,e.join)(j,"subagents",c)),m++)}let b=(0,e.join)(i,"tool-results");for(let a of h(b))l((0,e.basename)(a,(0,e.extname)(a)))&&(g((0,e.join)(b,a),(0,e.join)(j,"tool-results",a)),m++);let c=(0,e.join)(i,"workflows");for(let a of h(c)){let b=(0,e.basename)(a,(0,e.extname)(a));l(b)&&(g((0,e.join)(c,a),(0,e.join)(j,"workflows",a)),m++,m+=function a(b,c){let f=0;for(let i of h(b)){let h,j=(0,e.join)(b,i),k=(0,e.join)(c,i);try{h=d.statSync(j)}catch{continue}h.isDirectory()?f+=a(j,k):(g(j,k),f++)}return f}((0,e.join)(i,"subagents","workflows",b),(0,e.join)(j,"subagents","workflows",b)))}}catch{}return m}},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},26479:(a,b,c)=>{c.d(b,{CR:()=>h,my:()=>i,os:()=>g});var d=c(29021),e=c(33873),f=c(7939);function g(a,b){let c=(0,f.Kk)(a,b);if(d.existsSync(c))return{sessionPath:c,engine:"claude"};let e=(0,f.Xi)(a,b);if(d.existsSync(e))return{sessionPath:e,engine:"deepseek"};let g=(0,f.n2)(a,b);if(d.existsSync(g))return{sessionPath:g,engine:"kimi"};let h=(0,f.Rk)(a,b);if(d.existsSync(h))return{sessionPath:h,engine:"glm"};let i=(0,f.eg)(b);if(i)return{sessionPath:i,engine:"codex"};let j=(0,f.yw)(a,b);return d.existsSync(j)?{sessionPath:j,engine:"ollama"}:null}function h(a){return!!a.engine}function i(a,b,c){switch(a.engine){case"claude":return(0,f.Kk)(b,c);case"deepseek":return(0,f.Xi)(b,c);case"kimi":return(0,f.n2)(b,c);case"glm":return(0,f.Rk)(b,c);case"ollama":return(0,f.yw)(b,c);case"codex":{let a=new Date,b=a=>String(a).padStart(2,"0"),d=String(a.getFullYear()),g=b(a.getMonth()+1),h=b(a.getDate()),i=`${d}-${g}-${h}T${b(a.getHours())}-${b(a.getMinutes())}-${b(a.getSeconds())}`;return(0,e.join)(f.yk,d,g,h,`rollout-${i}-${c}.jsonl`)}default:return null}}},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},42619:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/session/[sessionId]/fork/route",pathname:"/api/session/[sessionId]/fork",filename:"route",bundlePath:"app/api/session/[sessionId]/fork/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session/[sessionId]/fork/route.ts",nextConfigOutput:"",userland:()=>c(46789),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/fork/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46789:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>e.L,runtime:()=>e.f});var e=c(74534),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},74534:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{L:()=>s,f:()=>r});var e=c(29021),f=c(79748),g=c(4984),h=c(55511),i=c(89705),j=c(7939),k=c(72891),l=c(770),m=c(26479),n=c(98084),o=c(13437),p=c(2259),q=a([k]);k=(q.then?(await q)():q)[0];let r="nodejs",s=(0,k.OZ)((a,{sessionId:b})=>i.JkU(function*(){let c=yield*(0,k.k9)(a),{cwd:d,fromMessageUuid:q}=c,r="single"===c.scope?"single":"prefix";if(!d)return yield*i.fJG(new l.yI({field:"cwd",reason:"missing"}));if("single"===r&&!q)return yield*i.fJG(new l.yI({field:"fromMessageUuid",reason:"missing"}));let s=(0,m.os)(d,b);if(!s)return yield*i.fJG(new l.m_({resource:"session",id:b}));if(!(0,m.CR)(s))return yield*i.fJG(new l.yI({field:"engine",reason:`cannot create sessions in the ${s.engine} store`}));let t=s.sessionPath,u=yield*i.$mh({try:async()=>{let a=(0,h.randomUUID)(),c=[],d=[],f=(0,e.createReadStream)(t),i=(0,g.createInterface)({input:f,crlfDelay:1/0}),j=[],k="collecting";for await(let e of i){if("done"===k)break;if(e.trim()){if("codex"===s.engine){j.push(e);continue}try{let b=JSON.parse(e);if("found_target"===k){if((0,n.l)(b)){k="done";break}}else"single"===r&&(0,n.l)(b)&&(d=[]);q&&b.uuid===q&&(k="found_target"),"single"===r?d.push(b):(b.sessionId=a,c.push(JSON.stringify(b)))}catch{if("prefix"===r){let d=e.replace(RegExp(b,"g"),a);c.push(d)}}}}if("codex"===s.engine){let d=(0,p.N)(j,b,a,q,r);c=d.newLines,k=d.targetMissed?"collecting":"found_target"}else if("single"===r){var l=d;let b=new Map;for(let a of l)"string"==typeof a.uuid&&b.set(a.uuid,(0,h.randomUUID)());let e=null;for(let c of l){c.sessionId=a;let d="string"==typeof c.parentUuid?c.parentUuid:null;if(c.parentUuid=(d&&b.get(d))??e,"string"==typeof c.uuid){let a=b.get(c.uuid);c.uuid=a,e=a}}for(let a of d)c.push(JSON.stringify(a))}return{newSessionId:a,newLines:c,targetMissed:!!q&&"collecting"===k}},catch:a=>new l.uU({path:t,op:"read",cause:a})});if(u.targetMissed)return yield*i.fJG(new l.m_({resource:"message",id:q??"(unknown)"}));let v=(0,m.my)(s,d,u.newSessionId);if(!v)return yield*i.fJG(new l.yI({field:"engine",reason:`cannot create sessions in the ${s.engine} store`}));yield*i.$mh({try:async()=>{await (0,j.Wd)(v),await (0,f.writeFile)(v,u.newLines.join("\n")+"\n","utf-8")},catch:a=>new l.uU({path:v,op:"write",cause:a})});let w=(0,o._)(t,v,u.newLines);return(0,k.ok)({success:!0,originalSessionId:b,newSessionId:u.newSessionId,messageCount:u.newLines.length,artifactCount:w})}));d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")},98084:(a,b,c)=>{function d(a){return a.isMeta&&a.sourceToolUseID?"skill":a.origin?.kind==="task-notification"?"task-notification":a.origin?.kind&&"human"!==a.origin.kind||a.isMeta||a.isCompactSummary?"meta":null}function e(a){if("user"!==a.type||null!==d(a))return!1;let b=a.message?.content;return"string"==typeof b?b.length>0:!!Array.isArray(b)&&b.some(a=>a?.type==="text")}c.d(b,{k:()=>d,l:()=>e})}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,6495,1564,516],()=>b(b.s=42619));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=3347,a.ids=[3347],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},2259:(a,b,c)=>{c.d(b,{N:()=>g});var d=c(40516);function e(a){if(a.assistantOpen)return null;let b=`codex-assistant-${a.msgCounter++}`;return a.assistantOpen=!0,b}function f(a,b,c){let d=RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return a.map(a=>a.replace(d,c))}function g(a,b,c,g,h){if(!g)return{newLines:f(a,b,c),targetMissed:!1};let i=a.find(a=>{try{return"session_meta"===JSON.parse(a).type}catch{return!1}});if(!i)return{newLines:[],targetMissed:!0};let j=[],k={msgCounter:0,assistantOpen:!1,spawnCallIds:new Set,waitCallIds:new Set},l=[],m=-1,n=()=>{0!==l.length&&(j.push(l),l=[],k.assistantOpen=!1)};for(let b of a){let a;if(b.trim()){try{a=JSON.parse(b)}catch{l.length>0&&l.push(b);continue}"session_meta"!==a.type&&(function(a){let b=a.payload;return"event_msg"===a.type&&b?.type==="task_started"}(a)&&l.length>0&&n(),l.push(b),(function(a,b){let c=a.payload;if(!c)return[];let f=[];if("response_item"===a.type){if("message"===c.type&&"user"===c.role){let{text:a,images:e}=(0,d.L8)(c.content);(e.length>0||a&&!a.startsWith("<")&&!a.startsWith("#"))&&(b.assistantOpen=!1,f.push(`codex-user-${b.msgCounter++}`))}if("message"===c.type&&"assistant"===c.role&&c.content?.filter(a=>"output_text"===a.type&&a.text).map(a=>a.text).join("")){let a=e(b);a&&f.push(a)}if("function_call"===c.type&&c.name&&(c.name===d.jB&&c.call_id&&b.waitCallIds.add(c.call_id),!(d.g$.has(c.name)&&c.name!==d.$H))){let a=e(b);a&&f.push(a),c.name===d.$H&&c.call_id&&b.spawnCallIds.add(c.call_id)}if("custom_tool_call"===c.type&&c.name||"custom_tool_call_output"===c.type&&c.call_id){let a=e(b);a&&f.push(a)}if((0,d.F3)(c)){let a=e(b);a&&f.push(a)}if("function_call_output"===c.type&&c.call_id&&!b.spawnCallIds.has(c.call_id)&&!b.waitCallIds.has(c.call_id)){let a=e(b);a&&f.push(a)}}if("event_msg"===a.type&&"web_search_end"===c.type&&c.call_id){let a=e(b);a&&f.push(a)}return"response_completed"===a.type&&(b.assistantOpen=!1),f})(a,k).includes(g)&&(m=j.length),function(a){let b=a.payload;return"event_msg"===a.type&&b?.type==="task_complete"}(a)&&n())}}return(n(),m<0)?{newLines:[],targetMissed:!0}:{newLines:f([i,...("single"===h?j.slice(m,m+1):j.slice(0,m+1)).flat()],b,c),targetMissed:!1}}},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},5405:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/session/[sessionId]/fork/route",pathname:"/api/session/[sessionId]/fork",filename:"route",bundlePath:"app/api/session/[sessionId]/fork/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session/[sessionId]/fork/route.ts",nextConfigOutput:"",userland:()=>c(46789),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/fork/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},13437:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(29021),e=c(33873);function f(a){return a.replace(/\.jsonl$/,"")}function g(a,b){if(d.mkdirSync((0,e.join)(b,".."),{recursive:!0}),!d.existsSync(b))try{d.linkSync(a,b)}catch{d.copyFileSync(a,b)}}function h(a){try{return d.readdirSync(a)}catch{return[]}}function i(a,b,c){let i=f(a);if(!d.existsSync(i))return 0;let j=f(b),k=c.join("\n"),l=a=>a.length>0&&k.includes(a),m=0;try{let a=(0,e.join)(i,"subagents");for(let b of h(a)){let c;if(!b.endsWith(".meta.json"))continue;try{c=JSON.parse(d.readFileSync((0,e.join)(a,b),"utf-8")).toolUseId}catch{continue}if(!c||!l(c))continue;let f=b.replace(/\.meta\.json$/,".jsonl");for(let c of[b,f])d.existsSync((0,e.join)(a,c))&&(g((0,e.join)(a,c),(0,e.join)(j,"subagents",c)),m++)}let b=(0,e.join)(i,"tool-results");for(let a of h(b))l((0,e.basename)(a,(0,e.extname)(a)))&&(g((0,e.join)(b,a),(0,e.join)(j,"tool-results",a)),m++);let c=(0,e.join)(i,"workflows");for(let a of h(c)){let b=(0,e.basename)(a,(0,e.extname)(a));l(b)&&(g((0,e.join)(c,a),(0,e.join)(j,"workflows",a)),m++,m+=function a(b,c){let f=0;for(let i of h(b)){let h,j=(0,e.join)(b,i),k=(0,e.join)(c,i);try{h=d.statSync(j)}catch{continue}h.isDirectory()?f+=a(j,k):(g(j,k),f++)}return f}((0,e.join)(i,"subagents","workflows",b),(0,e.join)(j,"subagents","workflows",b)))}}catch{}return m}},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},26479:(a,b,c)=>{c.d(b,{CR:()=>h,my:()=>i,os:()=>g});var d=c(29021),e=c(33873),f=c(7939);function g(a,b){let c=(0,f.Kk)(a,b);if(d.existsSync(c))return{sessionPath:c,engine:"claude"};let e=(0,f.Xi)(a,b);if(d.existsSync(e))return{sessionPath:e,engine:"deepseek"};let g=(0,f.n2)(a,b);if(d.existsSync(g))return{sessionPath:g,engine:"kimi"};let h=(0,f.Rk)(a,b);if(d.existsSync(h))return{sessionPath:h,engine:"glm"};let i=(0,f.eg)(b);if(i)return{sessionPath:i,engine:"codex"};let j=(0,f.yw)(a,b);return d.existsSync(j)?{sessionPath:j,engine:"ollama"}:null}function h(a){return!!a.engine}function i(a,b,c){switch(a.engine){case"claude":return(0,f.Kk)(b,c);case"deepseek":return(0,f.Xi)(b,c);case"kimi":return(0,f.n2)(b,c);case"glm":return(0,f.Rk)(b,c);case"ollama":return(0,f.yw)(b,c);case"codex":{let a=new Date,b=a=>String(a).padStart(2,"0"),d=String(a.getFullYear()),g=b(a.getMonth()+1),h=b(a.getDate()),i=`${d}-${g}-${h}T${b(a.getHours())}-${b(a.getMinutes())}-${b(a.getSeconds())}`;return(0,e.join)(f.yk,d,g,h,`rollout-${i}-${c}.jsonl`)}default:return null}}},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46789:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>e.L,runtime:()=>e.f});var e=c(74534),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},74534:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{L:()=>s,f:()=>r});var e=c(29021),f=c(79748),g=c(4984),h=c(55511),i=c(89705),j=c(7939),k=c(72891),l=c(770),m=c(26479),n=c(98084),o=c(13437),p=c(2259),q=a([k]);k=(q.then?(await q)():q)[0];let r="nodejs",s=(0,k.OZ)((a,{sessionId:b})=>i.JkU(function*(){let c=yield*(0,k.k9)(a),{cwd:d,fromMessageUuid:q}=c,r="single"===c.scope?"single":"prefix";if(!d)return yield*i.fJG(new l.yI({field:"cwd",reason:"missing"}));if("single"===r&&!q)return yield*i.fJG(new l.yI({field:"fromMessageUuid",reason:"missing"}));let s=(0,m.os)(d,b);if(!s)return yield*i.fJG(new l.m_({resource:"session",id:b}));if(!(0,m.CR)(s))return yield*i.fJG(new l.yI({field:"engine",reason:`cannot create sessions in the ${s.engine} store`}));let t=s.sessionPath,u=yield*i.$mh({try:async()=>{let a=(0,h.randomUUID)(),c=[],d=[],f=(0,e.createReadStream)(t),i=(0,g.createInterface)({input:f,crlfDelay:1/0}),j=[],k="collecting";for await(let e of i){if("done"===k)break;if(e.trim()){if("codex"===s.engine){j.push(e);continue}try{let b=JSON.parse(e);if("found_target"===k){if((0,n.l)(b)){k="done";break}}else"single"===r&&(0,n.l)(b)&&(d=[]);q&&b.uuid===q&&(k="found_target"),"single"===r?d.push(b):(b.sessionId=a,c.push(JSON.stringify(b)))}catch{if("prefix"===r){let d=e.replace(RegExp(b,"g"),a);c.push(d)}}}}if("codex"===s.engine){let d=(0,p.N)(j,b,a,q,r);c=d.newLines,k=d.targetMissed?"collecting":"found_target"}else if("single"===r){var l=d;let b=new Map;for(let a of l)"string"==typeof a.uuid&&b.set(a.uuid,(0,h.randomUUID)());let e=null;for(let c of l){c.sessionId=a;let d="string"==typeof c.parentUuid?c.parentUuid:null;if(c.parentUuid=(d&&b.get(d))??e,"string"==typeof c.uuid){let a=b.get(c.uuid);c.uuid=a,e=a}}for(let a of d)c.push(JSON.stringify(a))}return{newSessionId:a,newLines:c,targetMissed:!!q&&"collecting"===k}},catch:a=>new l.uU({path:t,op:"read",cause:a})});if(u.targetMissed)return yield*i.fJG(new l.m_({resource:"message",id:q??"(unknown)"}));let v=(0,m.my)(s,d,u.newSessionId);if(!v)return yield*i.fJG(new l.yI({field:"engine",reason:`cannot create sessions in the ${s.engine} store`}));yield*i.$mh({try:async()=>{await (0,j.Wd)(v),await (0,f.writeFile)(v,u.newLines.join("\n")+"\n","utf-8")},catch:a=>new l.uU({path:v,op:"write",cause:a})});let w=(0,o._)(t,v,u.newLines);return(0,k.ok)({success:!0,originalSessionId:b,newSessionId:u.newSessionId,messageCount:u.newLines.length,artifactCount:w})}));d()}catch(a){d(a)}})},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")},98084:(a,b,c)=>{function d(a){return a.isMeta&&a.sourceToolUseID?"skill":a.origin?.kind==="task-notification"?"task-notification":a.origin?.kind&&"human"!==a.origin.kind||a.isMeta||a.isCompactSummary?"meta":null}function e(a){if("user"!==a.type||null!==d(a))return!1;let b=a.message?.content;return"string"==typeof b?b.length>0:!!Array.isArray(b)&&b.some(a=>a?.type==="text")}c.d(b,{k:()=>d,l:()=>e})}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,6495,1564,516],()=>b(b.s=5405));module.exports=c})();
@@ -1,3 +1,3 @@
1
1
  "use strict";(()=>{var a={};a.id=5849,a.ids=[5849],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1613:(a,b,c)=>{function d(a,b,c){return b?a?c?`${a.replace(/\n+$/,"")}
2
2
 
3
- ${b}`:a+b:b:a}function e(a,b,c=!1){let d=a||[];if(!b)return d;let f=d[d.length-1];return c||f?.type!=="text"?[...d,{type:"text",text:b}]:[...d.slice(0,-1),{type:"text",text:f.text+b}]}function f(a,b){let c=a||[];return c.some(a=>"tool"===a.type&&a.id===b)?c:[...c,{type:"tool",id:b}]}c.d(b,{ur:()=>f,yk:()=>d,zG:()=>e})},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},7152:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OR:()=>m,fA:()=>l,fG:()=>n});var e=c(29021),f=c(89705),g=c(7939),h=c(72891),i=c(770),j=c(71949),k=a([h]);h=(k.then?(await k)():k)[0];let l="nodejs",m="force-dynamic",n=(0,h.OZ)((a,{sessionId:b})=>f.JkU(function*(){if(!b)return yield*f.fJG(new i.yI({field:"sessionId",reason:"missing"}));let a=process.cwd(),c=(0,g.Kk)(a,b);if(!e.existsSync(c))return yield*f.fJG(new i.m_({resource:"session",id:b}));let d=yield*f.$mh({try:()=>(0,j.q)(c),catch:a=>new i.uV({message:"parseTranscriptFile failed",cause:a})});return(0,h.ok)({messages:d})}));d()}catch(a){d(a)}})},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64513:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>e.fG,dynamic:()=>e.OR,runtime:()=>e.fA});var e=c(7152),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},71729:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/session/[sessionId]/history/route",pathname:"/api/session/[sessionId]/history",filename:"route",bundlePath:"app/api/session/[sessionId]/history/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session/[sessionId]/history/route.ts",nextConfigOutput:"",userland:()=>c(64513),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/history/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},71949:(a,b,c)=>{c.d(b,{q:()=>i});var d=c(29021),e=c(4984),f=c(1613),g=c(98084);function h(a){let b=a.message?.content;return"string"==typeof b?b:Array.isArray(b)?b.filter(a=>"text"===a.type).map(a=>a.text||"").join("\n"):""}async function i(a){let b=d.createReadStream(a),c=e.createInterface({input:b,crlfDelay:1/0}),i=[];for await(let a of c)try{let b=JSON.parse(a);("user"===b.type||"assistant"===b.type)&&i.push(b)}catch{}return function(a){let b=[],c=null,d=!1,e=new Map,i=new Map;for(let b of a){if("user"===b.type&&b.message?.content&&Array.isArray(b.message.content))for(let a of b.message.content)"tool_result"===a.type&&a.tool_use_id&&e.set(a.tool_use_id,a.content||"");if("user"===b.type&&"skill"===(0,g.k)(b)&&b.sourceToolUseID){let a=h(b);a&&i.set(b.sourceToolUseID,a)}}for(let j of a){if("user"===j.type&&j.message?.role==="user"&&j.message?.content){let a=(0,g.k)(j);if(a){if("skill"!==a){let d=function(a,b){let c=h(a);if("task-notification"===b){let b=c.match(/<summary>([\s\S]*?)<\/summary>/)?.[1]?.trim(),d=c.match(/<status>([\s\S]*?)<\/status>/)?.[1]?.trim();return{id:a.uuid||`sysevent-${Date.now()}`,role:"system",content:b||c.trim().slice(0,200),timestamp:a.timestamp,systemEvent:{kind:"task-notification",detail:c.trim(),...d?{status:d}:{}}}}let d=c.trim();return d?{id:a.uuid||`sysevent-${Date.now()}`,role:"system",content:d,timestamp:a.timestamp,systemEvent:{kind:"meta"}}:null}(j,a);d&&(c&&(b.push(c),c=null),b.push(d))}continue}let d=j.message.content;if("string"==typeof d){c&&(b.push(c),c=null);let a={id:j.uuid||`user-${Date.now()}`,role:"user",content:d,timestamp:j.timestamp};b.push(a);continue}if(!Array.isArray(d))continue;let e=d.filter(a=>"text"===a.type),f=d.filter(a=>"image"===a.type&&a.source);if(e.length>0||f.length>0){c&&(b.push(c),c=null);let a={id:j.uuid||`user-${Date.now()}`,role:"user",content:e.map(a=>a.text||"").join("\n"),timestamp:j.timestamp};f.length>0&&(a.images=f.map(a=>({type:"base64",media_type:a.source?.media_type||"image/png",data:a.source?.data||""}))),b.push(a)}}if("assistant"===j.type&&j.message?.content){let a=j.message.content;if(!Array.isArray(a))continue;let b=a.filter(a=>"text"===a.type),g=a.filter(a=>"tool_use"===a.type);if(b.length>0){let a=b.map(a=>a.text||"").join("");c?(c.content=(0,f.yk)(c.content,a,d),c.parts=(0,f.zG)(c.parts,a,d)):c={id:j.uuid||`assistant-${Date.now()}`,role:"assistant",content:a,parts:(0,f.zG)([],a),timestamp:j.timestamp,toolCalls:[]},d=!1}if(g.length>0)for(let a of(c||(c={id:j.uuid||`assistant-${Date.now()}`,role:"assistant",content:"",parts:[],toolCalls:[]}),d=!0,g))a.name&&a.id&&(c.parts=(0,f.ur)(c.parts,a.id),c.toolCalls.push({id:a.id,name:a.name,input:a.input||{},result:e.get(a.id),isLoading:!1,...i.has(a.id)?{skillContent:i.get(a.id)}:{}}))}}return c&&b.push(c),b}(i)}},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")},98084:(a,b,c)=>{function d(a){return a.isMeta&&a.sourceToolUseID?"skill":a.origin?.kind==="task-notification"?"task-notification":a.origin?.kind&&"human"!==a.origin.kind||a.isMeta||a.isCompactSummary?"meta":null}function e(a){if("user"!==a.type||null!==d(a))return!1;let b=a.message?.content;return"string"==typeof b?b.length>0:!!Array.isArray(b)&&b.some(a=>a?.type==="text")}c.d(b,{k:()=>d,l:()=>e})}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,6495,1564],()=>b(b.s=71729));module.exports=c})();
3
+ ${b}`:a+b:b:a}function e(a,b,c=!1){let d=a||[];if(!b)return d;let f=d[d.length-1];return c||f?.type!=="text"?[...d,{type:"text",text:b}]:[...d.slice(0,-1),{type:"text",text:f.text+b}]}function f(a,b){let c=a||[];return c.some(a=>"tool"===a.type&&a.id===b)?c:[...c,{type:"tool",id:b}]}c.d(b,{ur:()=>f,yk:()=>d,zG:()=>e})},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},7152:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OR:()=>m,fA:()=>l,fG:()=>n});var e=c(29021),f=c(89705),g=c(7939),h=c(72891),i=c(770),j=c(71949),k=a([h]);h=(k.then?(await k)():k)[0];let l="nodejs",m="force-dynamic",n=(0,h.OZ)((a,{sessionId:b})=>f.JkU(function*(){if(!b)return yield*f.fJG(new i.yI({field:"sessionId",reason:"missing"}));let a=process.cwd(),c=(0,g.Kk)(a,b);if(!e.existsSync(c))return yield*f.fJG(new i.m_({resource:"session",id:b}));let d=yield*f.$mh({try:()=>(0,j.q)(c),catch:a=>new i.uV({message:"parseTranscriptFile failed",cause:a})});return(0,h.ok)({messages:d})}));d()}catch(a){d(a)}})},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},25915:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/session/[sessionId]/history/route",pathname:"/api/session/[sessionId]/history",filename:"route",bundlePath:"app/api/session/[sessionId]/history/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session/[sessionId]/history/route.ts",nextConfigOutput:"",userland:()=>c(64513),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/history/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},27910:a=>{a.exports=require("stream")},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")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64513:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>e.fG,dynamic:()=>e.OR,runtime:()=>e.fA});var e=c(7152),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},71949:(a,b,c)=>{c.d(b,{q:()=>i});var d=c(29021),e=c(4984),f=c(1613),g=c(98084);function h(a){let b=a.message?.content;return"string"==typeof b?b:Array.isArray(b)?b.filter(a=>"text"===a.type).map(a=>a.text||"").join("\n"):""}async function i(a){let b=d.createReadStream(a),c=e.createInterface({input:b,crlfDelay:1/0}),i=[];for await(let a of c)try{let b=JSON.parse(a);("user"===b.type||"assistant"===b.type)&&i.push(b)}catch{}return function(a){let b=[],c=null,d=!1,e=new Map,i=new Map;for(let b of a){if("user"===b.type&&b.message?.content&&Array.isArray(b.message.content))for(let a of b.message.content)"tool_result"===a.type&&a.tool_use_id&&e.set(a.tool_use_id,a.content||"");if("user"===b.type&&"skill"===(0,g.k)(b)&&b.sourceToolUseID){let a=h(b);a&&i.set(b.sourceToolUseID,a)}}for(let j of a){if("user"===j.type&&j.message?.role==="user"&&j.message?.content){let a=(0,g.k)(j);if(a){if("skill"!==a){let d=function(a,b){let c=h(a);if("task-notification"===b){let b=c.match(/<summary>([\s\S]*?)<\/summary>/)?.[1]?.trim(),d=c.match(/<status>([\s\S]*?)<\/status>/)?.[1]?.trim();return{id:a.uuid||`sysevent-${Date.now()}`,role:"system",content:b||c.trim().slice(0,200),timestamp:a.timestamp,systemEvent:{kind:"task-notification",detail:c.trim(),...d?{status:d}:{}}}}let d=c.trim();return d?{id:a.uuid||`sysevent-${Date.now()}`,role:"system",content:d,timestamp:a.timestamp,systemEvent:{kind:"meta"}}:null}(j,a);d&&(c&&(b.push(c),c=null),b.push(d))}continue}let d=j.message.content;if("string"==typeof d){c&&(b.push(c),c=null);let a={id:j.uuid||`user-${Date.now()}`,role:"user",content:d,timestamp:j.timestamp};b.push(a);continue}if(!Array.isArray(d))continue;let e=d.filter(a=>"text"===a.type),f=d.filter(a=>"image"===a.type&&a.source);if(e.length>0||f.length>0){c&&(b.push(c),c=null);let a={id:j.uuid||`user-${Date.now()}`,role:"user",content:e.map(a=>a.text||"").join("\n"),timestamp:j.timestamp};f.length>0&&(a.images=f.map(a=>({type:"base64",media_type:a.source?.media_type||"image/png",data:a.source?.data||""}))),b.push(a)}}if("assistant"===j.type&&j.message?.content){let a=j.message.content;if(!Array.isArray(a))continue;let b=a.filter(a=>"text"===a.type),g=a.filter(a=>"tool_use"===a.type);if(b.length>0){let a=b.map(a=>a.text||"").join("");c?(c.content=(0,f.yk)(c.content,a,d),c.parts=(0,f.zG)(c.parts,a,d)):c={id:j.uuid||`assistant-${Date.now()}`,role:"assistant",content:a,parts:(0,f.zG)([],a),timestamp:j.timestamp,toolCalls:[]},d=!1}if(g.length>0)for(let a of(c||(c={id:j.uuid||`assistant-${Date.now()}`,role:"assistant",content:"",parts:[],toolCalls:[]}),d=!0,g))a.name&&a.id&&(c.parts=(0,f.ur)(c.parts,a.id),c.toolCalls.push({id:a.id,name:a.name,input:a.input||{},result:e.get(a.id),isLoading:!1,...i.has(a.id)?{skillContent:i.get(a.id)}:{}}))}}return c&&b.push(c),b}(i)}},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")},98084:(a,b,c)=>{function d(a){return a.isMeta&&a.sourceToolUseID?"skill":a.origin?.kind==="task-notification"?"task-notification":a.origin?.kind&&"human"!==a.origin.kind||a.isMeta||a.isCompactSummary?"meta":null}function e(a){if("user"!==a.type||null!==d(a))return!1;let b=a.message?.content;return"string"==typeof b?b.length>0:!!Array.isArray(b)&&b.some(a=>a?.type==="text")}c.d(b,{k:()=>d,l:()=>e})}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,6495,1564],()=>b(b.s=25915));module.exports=c})();