@jiggai/kitchen 0.1.5 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +2 -2
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/server/app/_not-found.html +1 -1
  12. package/.next/server/app/_not-found.rsc +1 -1
  13. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  14. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/agents/[id]/route.js +1 -1
  21. package/.next/server/app/api/agents/[id]/route.js.nft.json +1 -1
  22. package/.next/server/app/api/agents/add/route.js +1 -1
  23. package/.next/server/app/api/agents/add/route.js.nft.json +1 -1
  24. package/.next/server/app/api/agents/file/route.js +1 -1
  25. package/.next/server/app/api/agents/file/route.js.nft.json +1 -1
  26. package/.next/server/app/api/agents/files/route.js +1 -1
  27. package/.next/server/app/api/agents/files/route.js.nft.json +1 -1
  28. package/.next/server/app/api/agents/skills/install/route.js +1 -1
  29. package/.next/server/app/api/agents/skills/install/route.js.nft.json +1 -1
  30. package/.next/server/app/api/agents/skills/route.js +1 -1
  31. package/.next/server/app/api/agents/skills/route.js.nft.json +1 -1
  32. package/.next/server/app/api/agents/update/route.js +1 -1
  33. package/.next/server/app/api/agents/update/route.js.nft.json +1 -1
  34. package/.next/server/app/api/channels/bindings/route.js +1 -1
  35. package/.next/server/app/api/channels/bindings/route.js.nft.json +1 -1
  36. package/.next/server/app/api/cron/delete/route.js +1 -1
  37. package/.next/server/app/api/cron/delete/route.js.nft.json +1 -1
  38. package/.next/server/app/api/cron/job/route.js +1 -1
  39. package/.next/server/app/api/cron/job/route.js.nft.json +1 -1
  40. package/.next/server/app/api/cron/jobs/route.js +1 -1
  41. package/.next/server/app/api/cron/jobs/route.js.nft.json +1 -1
  42. package/.next/server/app/api/cron/recipe-installed/route.js +1 -1
  43. package/.next/server/app/api/cron/recipe-installed/route.js.nft.json +1 -1
  44. package/.next/server/app/api/goals/[id]/promote/route.js +1 -1
  45. package/.next/server/app/api/goals/[id]/promote/route.js.nft.json +1 -1
  46. package/.next/server/app/api/goals/[id]/route.js +1 -1
  47. package/.next/server/app/api/goals/[id]/route.js.nft.json +1 -1
  48. package/.next/server/app/api/goals/route.js +1 -1
  49. package/.next/server/app/api/goals/route.js.nft.json +1 -1
  50. package/.next/server/app/api/ids/check/route.js +1 -1
  51. package/.next/server/app/api/ids/check/route.js.nft.json +1 -1
  52. package/.next/server/app/api/marketplace/recipes/[slug]/route.js +1 -1
  53. package/.next/server/app/api/marketplace/recipes/[slug]/route.js.nft.json +1 -1
  54. package/.next/server/app/api/marketplace/recipes/route.js +1 -1
  55. package/.next/server/app/api/marketplace/recipes/route.js.nft.json +1 -1
  56. package/.next/server/app/api/recipes/[id]/route.js +1 -1
  57. package/.next/server/app/api/recipes/[id]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/recipes/clone/route.js +1 -1
  59. package/.next/server/app/api/recipes/clone/route.js.nft.json +1 -1
  60. package/.next/server/app/api/recipes/delete/route.js +1 -1
  61. package/.next/server/app/api/recipes/delete/route.js.nft.json +1 -1
  62. package/.next/server/app/api/recipes/team-agents/route.js +1 -1
  63. package/.next/server/app/api/recipes/team-agents/route.js.nft.json +1 -1
  64. package/.next/server/app/api/scaffold/route.js +2 -2
  65. package/.next/server/app/api/scaffold/route.js.nft.json +1 -1
  66. package/.next/server/app/api/settings/cron-installation/route.js +1 -1
  67. package/.next/server/app/api/settings/cron-installation/route.js.nft.json +1 -1
  68. package/.next/server/app/api/skills/available/route.js +1 -1
  69. package/.next/server/app/api/skills/available/route.js.nft.json +1 -1
  70. package/.next/server/app/api/teams/file/route.js +1 -1
  71. package/.next/server/app/api/teams/file/route.js.nft.json +1 -1
  72. package/.next/server/app/api/teams/files/route.js +1 -1
  73. package/.next/server/app/api/teams/files/route.js.nft.json +1 -1
  74. package/.next/server/app/api/teams/meta/route.js +1 -1
  75. package/.next/server/app/api/teams/meta/route.js.nft.json +1 -1
  76. package/.next/server/app/api/teams/skills/route.js +1 -1
  77. package/.next/server/app/api/teams/skills/route.js.nft.json +1 -1
  78. package/.next/server/app/channels.html +2 -2
  79. package/.next/server/app/channels.rsc +1 -1
  80. package/.next/server/app/channels.segments/_full.segment.rsc +1 -1
  81. package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
  82. package/.next/server/app/channels.segments/_index.segment.rsc +1 -1
  83. package/.next/server/app/channels.segments/_tree.segment.rsc +1 -1
  84. package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +1 -1
  85. package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
  86. package/.next/server/app/cron-jobs.html +1 -1
  87. package/.next/server/app/cron-jobs.rsc +1 -1
  88. package/.next/server/app/cron-jobs.segments/_full.segment.rsc +1 -1
  89. package/.next/server/app/cron-jobs.segments/_head.segment.rsc +1 -1
  90. package/.next/server/app/cron-jobs.segments/_index.segment.rsc +1 -1
  91. package/.next/server/app/cron-jobs.segments/_tree.segment.rsc +1 -1
  92. package/.next/server/app/cron-jobs.segments/cron-jobs/__PAGE__.segment.rsc +1 -1
  93. package/.next/server/app/cron-jobs.segments/cron-jobs.segment.rsc +1 -1
  94. package/.next/server/app/goals/new.html +2 -2
  95. package/.next/server/app/goals/new.rsc +1 -1
  96. package/.next/server/app/goals/new.segments/_full.segment.rsc +1 -1
  97. package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
  98. package/.next/server/app/goals/new.segments/_index.segment.rsc +1 -1
  99. package/.next/server/app/goals/new.segments/_tree.segment.rsc +1 -1
  100. package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +1 -1
  101. package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
  102. package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
  103. package/.next/server/app/goals.html +1 -1
  104. package/.next/server/app/goals.rsc +1 -1
  105. package/.next/server/app/goals.segments/_full.segment.rsc +1 -1
  106. package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
  107. package/.next/server/app/goals.segments/_index.segment.rsc +1 -1
  108. package/.next/server/app/goals.segments/_tree.segment.rsc +1 -1
  109. package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +1 -1
  110. package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
  111. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  112. package/.next/server/app/settings.html +1 -1
  113. package/.next/server/app/settings.rsc +2 -2
  114. package/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  115. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  116. package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  117. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  118. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  119. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  120. package/.next/server/app/tickets/[ticket]/page.js +1 -1
  121. package/.next/server/app/tickets/[ticket]/page.js.nft.json +1 -1
  122. package/.next/server/app/tickets/page.js +1 -1
  123. package/.next/server/app/tickets/page.js.nft.json +1 -1
  124. package/.next/server/app/tickets.html +1 -1
  125. package/.next/server/app/tickets.rsc +2 -2
  126. package/.next/server/app/tickets.segments/_full.segment.rsc +2 -2
  127. package/.next/server/app/tickets.segments/_head.segment.rsc +1 -1
  128. package/.next/server/app/tickets.segments/_index.segment.rsc +1 -1
  129. package/.next/server/app/tickets.segments/_tree.segment.rsc +1 -1
  130. package/.next/server/app/tickets.segments/tickets/__PAGE__.segment.rsc +1 -1
  131. package/.next/server/app/tickets.segments/tickets.segment.rsc +1 -1
  132. package/.next/server/chunks/{[root-of-the-server]__931fa945._.js → [root-of-the-server]__055885ce._.js} +2 -2
  133. package/.next/server/chunks/{[root-of-the-server]__86aa3d16._.js → [root-of-the-server]__0c01c5c7._.js} +2 -2
  134. package/.next/server/chunks/{[root-of-the-server]__71d7f4ae._.js → [root-of-the-server]__1398a33a._.js} +2 -2
  135. package/.next/server/chunks/{[root-of-the-server]__b51afda1._.js → [root-of-the-server]__159c002b._.js} +2 -2
  136. package/.next/server/chunks/{[root-of-the-server]__23c7d83c._.js → [root-of-the-server]__20c60fb7._.js} +2 -2
  137. package/.next/server/chunks/[root-of-the-server]__2588560d._.js +6 -0
  138. package/.next/server/chunks/[root-of-the-server]__2588560d._.js.map +1 -0
  139. package/.next/server/chunks/[root-of-the-server]__27293e91._.js +3 -0
  140. package/.next/server/chunks/[root-of-the-server]__27293e91._.js.map +1 -0
  141. package/.next/server/chunks/[root-of-the-server]__29c85a51._.js +3 -0
  142. package/.next/server/chunks/[root-of-the-server]__29c85a51._.js.map +1 -0
  143. package/.next/server/chunks/{[root-of-the-server]__26de3d48._.js → [root-of-the-server]__29fa8108._.js} +2 -2
  144. package/.next/server/chunks/[root-of-the-server]__2bd44067._.js +3 -0
  145. package/.next/server/chunks/[root-of-the-server]__2bd44067._.js.map +1 -0
  146. package/.next/server/chunks/{[root-of-the-server]__69be1758._.js → [root-of-the-server]__2dd1afff._.js} +2 -2
  147. package/.next/server/chunks/[root-of-the-server]__401ab759._.js +3 -0
  148. package/.next/server/chunks/[root-of-the-server]__401ab759._.js.map +1 -0
  149. package/.next/server/chunks/{[root-of-the-server]__0554d494._.js → [root-of-the-server]__422c7160._.js} +2 -2
  150. package/.next/server/chunks/{[root-of-the-server]__04d535a1._.js → [root-of-the-server]__4670294e._.js} +2 -2
  151. package/.next/server/chunks/[root-of-the-server]__4eda99a9._.js +1 -1
  152. package/.next/server/chunks/[root-of-the-server]__4eda99a9._.js.map +1 -1
  153. package/.next/server/chunks/{[root-of-the-server]__149c6b90._.js → [root-of-the-server]__54478298._.js} +3 -3
  154. package/.next/server/chunks/[root-of-the-server]__54478298._.js.map +1 -0
  155. package/.next/server/chunks/[root-of-the-server]__6dbdb384._.js +3 -0
  156. package/.next/server/chunks/[root-of-the-server]__6dbdb384._.js.map +1 -0
  157. package/.next/server/chunks/{[root-of-the-server]__dc6c67a5._.js → [root-of-the-server]__74b80ca4._.js} +2 -2
  158. package/.next/server/chunks/[root-of-the-server]__94d68aa3._.js +1 -1
  159. package/.next/server/chunks/[root-of-the-server]__94d68aa3._.js.map +1 -1
  160. package/.next/server/chunks/[root-of-the-server]__9ecbb339._.js +3 -0
  161. package/.next/server/chunks/[root-of-the-server]__9ecbb339._.js.map +1 -0
  162. package/.next/server/chunks/[root-of-the-server]__a27f8405._.js +3 -0
  163. package/.next/server/chunks/[root-of-the-server]__a27f8405._.js.map +1 -0
  164. package/.next/server/chunks/{[root-of-the-server]__786b2d5c._.js → [root-of-the-server]__a6ac3ddf._.js} +2 -2
  165. package/.next/server/chunks/[root-of-the-server]__b11231a9._.js +1 -1
  166. package/.next/server/chunks/[root-of-the-server]__b11231a9._.js.map +1 -1
  167. package/.next/server/chunks/[root-of-the-server]__b59b3cdd._.js +1 -1
  168. package/.next/server/chunks/[root-of-the-server]__b59b3cdd._.js.map +1 -1
  169. package/.next/server/chunks/{[root-of-the-server]__94ebcd84._.js → [root-of-the-server]__b5c2b370._.js} +2 -2
  170. package/.next/server/chunks/{[root-of-the-server]__36e14ea6._.js → [root-of-the-server]__b955e35a._.js} +2 -2
  171. package/.next/server/chunks/{[root-of-the-server]__920d7db4._.js → [root-of-the-server]__be5f57b2._.js} +2 -2
  172. package/.next/server/chunks/[root-of-the-server]__c4ff0427._.js +3 -0
  173. package/.next/server/chunks/[root-of-the-server]__c4ff0427._.js.map +1 -0
  174. package/.next/server/chunks/[root-of-the-server]__c4ffbb03._.js +1 -1
  175. package/.next/server/chunks/[root-of-the-server]__c4ffbb03._.js.map +1 -1
  176. package/.next/server/chunks/[root-of-the-server]__d737ca42._.js +1 -1
  177. package/.next/server/chunks/[root-of-the-server]__d737ca42._.js.map +1 -1
  178. package/.next/server/chunks/[root-of-the-server]__df7df3ac._.js +3 -0
  179. package/.next/server/chunks/[root-of-the-server]__df7df3ac._.js.map +1 -0
  180. package/.next/server/chunks/[root-of-the-server]__dfca6557._.js +3 -0
  181. package/.next/server/chunks/[root-of-the-server]__dfca6557._.js.map +1 -0
  182. package/.next/server/chunks/[root-of-the-server]__e6184ba3._.js +1 -1
  183. package/.next/server/chunks/[root-of-the-server]__e6184ba3._.js.map +1 -1
  184. package/.next/server/chunks/{[root-of-the-server]__6fb173c8._.js → [root-of-the-server]__ed0323e9._.js} +2 -2
  185. package/.next/server/chunks/[root-of-the-server]__f585823b._.js +6 -0
  186. package/.next/server/chunks/[root-of-the-server]__f585823b._.js.map +1 -0
  187. package/.next/server/chunks/[root-of-the-server]__ff940674._.js +3 -0
  188. package/.next/server/chunks/[root-of-the-server]__ff940674._.js.map +1 -0
  189. package/.next/server/chunks/src_lib_d2210cbf._.js +1 -1
  190. package/.next/server/chunks/src_lib_d2210cbf._.js.map +1 -1
  191. package/.next/server/chunks/ssr/{[root-of-the-server]__b6de1782._.js → [root-of-the-server]__507d2fc9._.js} +2 -2
  192. package/.next/server/chunks/ssr/{[root-of-the-server]__72721a7e._.js → [root-of-the-server]__f75a61bf._.js} +2 -2
  193. package/.next/server/chunks/ssr/_1aad1d9b._.js +1 -1
  194. package/.next/server/chunks/ssr/_1aad1d9b._.js.map +1 -1
  195. package/.next/server/chunks/ssr/_da6f800e._.js +1 -1
  196. package/.next/server/chunks/ssr/_da6f800e._.js.map +1 -1
  197. package/.next/server/chunks/ssr/src_app_agents_[agentId]_agent-editor_tsx_f85bbe65._.js +1 -1
  198. package/.next/server/chunks/ssr/src_app_agents_[agentId]_agent-editor_tsx_f85bbe65._.js.map +1 -1
  199. package/.next/server/chunks/ssr/src_app_settings_settings-client_tsx_279084f8._.js +1 -1
  200. package/.next/server/chunks/ssr/src_app_settings_settings-client_tsx_279084f8._.js.map +1 -1
  201. package/.next/server/pages/404.html +1 -1
  202. package/.next/server/pages/500.html +2 -2
  203. package/.next/server/server-reference-manifest.js +1 -1
  204. package/.next/server/server-reference-manifest.json +1 -1
  205. package/.next/static/chunks/1ce21af6dfb18ee3.js +1 -0
  206. package/.next/static/chunks/55866d57aa2c7a9c.js +1 -0
  207. package/openclaw.plugin.json +1 -1
  208. package/package.json +2 -1
  209. package/src/app/agents/[agentId]/agent-editor.tsx +66 -23
  210. package/src/app/api/agents/[id]/route.ts +37 -0
  211. package/src/app/api/agents/files/route.ts +3 -1
  212. package/src/app/api/agents/skills/install/route.ts +27 -3
  213. package/src/app/api/agents/skills/route.ts +28 -12
  214. package/src/app/api/recipes/clone/route.ts +2 -2
  215. package/src/app/api/settings/cron-installation/route.ts +34 -20
  216. package/src/app/api/teams/skills/install/route.ts +3 -1
  217. package/src/app/settings/settings-client.tsx +4 -2
  218. package/src/lib/agent-workspace.ts +14 -0
  219. package/src/lib/openclaw.ts +21 -2
  220. package/.next/server/chunks/[root-of-the-server]__149c6b90._.js.map +0 -1
  221. package/.next/server/chunks/[root-of-the-server]__191c2791._.js +0 -3
  222. package/.next/server/chunks/[root-of-the-server]__191c2791._.js.map +0 -1
  223. package/.next/server/chunks/[root-of-the-server]__1ba9b3f1._.js +0 -3
  224. package/.next/server/chunks/[root-of-the-server]__1ba9b3f1._.js.map +0 -1
  225. package/.next/server/chunks/[root-of-the-server]__1e295acc._.js +0 -6
  226. package/.next/server/chunks/[root-of-the-server]__1e295acc._.js.map +0 -1
  227. package/.next/server/chunks/[root-of-the-server]__226cf7eb._.js +0 -3
  228. package/.next/server/chunks/[root-of-the-server]__226cf7eb._.js.map +0 -1
  229. package/.next/server/chunks/[root-of-the-server]__2c08c2ff._.js +0 -3
  230. package/.next/server/chunks/[root-of-the-server]__2c08c2ff._.js.map +0 -1
  231. package/.next/server/chunks/[root-of-the-server]__30d68375._.js +0 -3
  232. package/.next/server/chunks/[root-of-the-server]__30d68375._.js.map +0 -1
  233. package/.next/server/chunks/[root-of-the-server]__4f241d56._.js +0 -3
  234. package/.next/server/chunks/[root-of-the-server]__4f241d56._.js.map +0 -1
  235. package/.next/server/chunks/[root-of-the-server]__6fac1c43._.js +0 -3
  236. package/.next/server/chunks/[root-of-the-server]__6fac1c43._.js.map +0 -1
  237. package/.next/server/chunks/[root-of-the-server]__7b948232._.js +0 -6
  238. package/.next/server/chunks/[root-of-the-server]__7b948232._.js.map +0 -1
  239. package/.next/server/chunks/[root-of-the-server]__92a5b56a._.js +0 -3
  240. package/.next/server/chunks/[root-of-the-server]__92a5b56a._.js.map +0 -1
  241. package/.next/server/chunks/[root-of-the-server]__97a9f492._.js +0 -3
  242. package/.next/server/chunks/[root-of-the-server]__97a9f492._.js.map +0 -1
  243. package/.next/server/chunks/[root-of-the-server]__a1497707._.js +0 -3
  244. package/.next/server/chunks/[root-of-the-server]__a1497707._.js.map +0 -1
  245. package/.next/server/chunks/[root-of-the-server]__d907380c._.js +0 -3
  246. package/.next/server/chunks/[root-of-the-server]__d907380c._.js.map +0 -1
  247. package/.next/static/chunks/1faff0d40127675e.js +0 -1
  248. package/.next/static/chunks/4fb7740933125c6a.js +0 -1
  249. /package/.next/server/chunks/{[root-of-the-server]__931fa945._.js.map → [root-of-the-server]__055885ce._.js.map} +0 -0
  250. /package/.next/server/chunks/{[root-of-the-server]__86aa3d16._.js.map → [root-of-the-server]__0c01c5c7._.js.map} +0 -0
  251. /package/.next/server/chunks/{[root-of-the-server]__71d7f4ae._.js.map → [root-of-the-server]__1398a33a._.js.map} +0 -0
  252. /package/.next/server/chunks/{[root-of-the-server]__b51afda1._.js.map → [root-of-the-server]__159c002b._.js.map} +0 -0
  253. /package/.next/server/chunks/{[root-of-the-server]__23c7d83c._.js.map → [root-of-the-server]__20c60fb7._.js.map} +0 -0
  254. /package/.next/server/chunks/{[root-of-the-server]__26de3d48._.js.map → [root-of-the-server]__29fa8108._.js.map} +0 -0
  255. /package/.next/server/chunks/{[root-of-the-server]__69be1758._.js.map → [root-of-the-server]__2dd1afff._.js.map} +0 -0
  256. /package/.next/server/chunks/{[root-of-the-server]__0554d494._.js.map → [root-of-the-server]__422c7160._.js.map} +0 -0
  257. /package/.next/server/chunks/{[root-of-the-server]__04d535a1._.js.map → [root-of-the-server]__4670294e._.js.map} +0 -0
  258. /package/.next/server/chunks/{[root-of-the-server]__dc6c67a5._.js.map → [root-of-the-server]__74b80ca4._.js.map} +0 -0
  259. /package/.next/server/chunks/{[root-of-the-server]__786b2d5c._.js.map → [root-of-the-server]__a6ac3ddf._.js.map} +0 -0
  260. /package/.next/server/chunks/{[root-of-the-server]__94ebcd84._.js.map → [root-of-the-server]__b5c2b370._.js.map} +0 -0
  261. /package/.next/server/chunks/{[root-of-the-server]__36e14ea6._.js.map → [root-of-the-server]__b955e35a._.js.map} +0 -0
  262. /package/.next/server/chunks/{[root-of-the-server]__920d7db4._.js.map → [root-of-the-server]__be5f57b2._.js.map} +0 -0
  263. /package/.next/server/chunks/{[root-of-the-server]__6fb173c8._.js.map → [root-of-the-server]__ed0323e9._.js.map} +0 -0
  264. /package/.next/server/chunks/ssr/{[root-of-the-server]__b6de1782._.js.map → [root-of-the-server]__507d2fc9._.js.map} +0 -0
  265. /package/.next/server/chunks/ssr/{[root-of-the-server]__72721a7e._.js.map → [root-of-the-server]__f75a61bf._.js.map} +0 -0
  266. /package/.next/static/{-CtCgA0I7AqrxE21uMGGj → 2hgbnJUmLMe9COlc5rJd3}/_buildManifest.js +0 -0
  267. /package/.next/static/{-CtCgA0I7AqrxE21uMGGj → 2hgbnJUmLMe9COlc5rJd3}/_clientMiddlewareManifest.json +0 -0
  268. /package/.next/static/{-CtCgA0I7AqrxE21uMGGj → 2hgbnJUmLMe9COlc5rJd3}/_ssgManifest.js +0 -0
@@ -1,3 +0,0 @@
1
- module.exports=[59494,e=>{"use strict";function t(){let e=globalThis.__clawkitchen_api;if(!e)throw Error("ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)");return e}e.s(["getKitchenApi",()=>t])},5003,e=>{"use strict";var t=e.i(59494);async function r(e){let r=(0,t.getKitchenApi)();try{let t=await r.runtime.system.runCommandWithTimeout(["openclaw",...e],{timeoutMs:12e4});return{ok:!0,exitCode:0,stdout:String(t.stdout??""),stderr:String(t.stderr??"")}}catch(t){let e="number"==typeof t.code?t.code:1;return{ok:!1,exitCode:e,stdout:"string"==typeof t.stdout?t.stdout:"",stderr:"string"==typeof t.stderr?t.stderr:"string"==typeof t.message?t.message:String(t)}}}e.s(["runOpenClaw",()=>r])},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},7367,e=>{"use strict";var t=e.i(12714),r=e.i(60526),a=e.i(50227);async function n(){let e=a.default.join(r.default.homedir(),".openclaw","openclaw.json");return JSON.parse(await t.default.readFile(e,"utf8"))}async function s(){let e=await n(),t=e.agents?.defaults?.workspace;if(!t)throw Error("agents.defaults.workspace is not set in ~/.openclaw/openclaw.json");return t}async function o(){let e=await s();return a.default.join(e,"recipes")}async function i(){let e=await s();return a.default.join(e,"notes","goals")}async function l(e){let t=r.default.homedir();if(!t)throw Error("Could not resolve home directory");return a.default.join(t,".openclaw",`workspace-${e}`)}async function u(){let e=await n(),t=e.plugins?.installs?.recipes?.installPath||e.plugins?.installs?.recipes?.sourcePath||e.plugins?.load?.paths?.[0];if(!t)throw Error("Could not determine recipes plugin install path from ~/.openclaw/openclaw.json");return a.default.join(t,"recipes","default")}e.s(["getBuiltinRecipesDir",()=>u,"getTeamWorkspaceDir",()=>l,"getWorkspaceDir",()=>s,"getWorkspaceGoalsDir",()=>i,"getWorkspaceRecipesDir",()=>o,"readOpenClawConfig",()=>n])},50892,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),p=e.i(47587),c=e.i(66012),h=e.i(70101),f=e.i(26937),g=e.i(10372),x=e.i(93695);e.i(52474);var w=e.i(220),m=e.i(89171),R=e.i(12714),v=e.i(50227),y=e.i(5003),k=e.i(7367);let C=null,E=null;function b(e){return String(e??"").trim()}async function j(){let e=Date.now();return C&&e-C.atMs<1e4?C:E||(E=(async()=>{let[t,r]=await Promise.all([(0,y.runOpenClaw)(["recipes","list"]),(0,y.runOpenClaw)(["agents","list","--json"])]),a=new Set;if(t.ok)try{for(let e of JSON.parse(t.stdout)){let t=b(e.id);t&&a.add(t)}}catch{}let n=new Set;if(r.ok)try{for(let e of JSON.parse(r.stdout)){let t=b(e.id);t&&n.add(t)}}catch{}let s={atMs:e,recipeIds:a,agentIds:n};return C=s,E=null,s})())}async function N(e){try{let t=new URL(e.url),r=b(t.searchParams.get("kind")),a=b(t.searchParams.get("id"));if("team"!==r&&"agent"!==r)return m.NextResponse.json({ok:!1,error:"kind must be team|agent"},{status:400});if(!a)return m.NextResponse.json({ok:!0,available:!1,reason:"empty"});let n=await j();if(n.recipeIds.has(a))return m.NextResponse.json({ok:!0,available:!1,reason:"recipe-id-collision"});if("agent"===r){if(n.agentIds.has(a))return m.NextResponse.json({ok:!0,available:!1,reason:"agent-exists"});return m.NextResponse.json({ok:!0,available:!0})}try{let e=await (0,k.readOpenClawConfig)(),t=b(e.agents?.defaults?.workspace);if(t){let e=v.default.resolve(t,"..",`workspace-${a}`);if(await R.default.stat(e).then(()=>!0).catch(()=>!1))return m.NextResponse.json({ok:!0,available:!1,reason:"team-workspace-exists"})}}catch{}let s=await j();if(Array.from(s.agentIds).some(e=>e.startsWith(`${a}-`)))return m.NextResponse.json({ok:!0,available:!1,reason:"team-agents-exist"});return m.NextResponse.json({ok:!0,available:!0})}catch(e){return m.NextResponse.json({ok:!1,error:e instanceof Error?e.message:String(e)},{status:500})}}e.s(["GET",()=>N],47009);var A=e.i(47009);let O=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/ids/check/route",pathname:"/api/ids/check",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/ids/check/route.ts",nextConfigOutput:"standalone",userland:A}),{workAsyncStorage:P,workUnitAsyncStorage:S,serverHooks:T}=O;function q(){return(0,a.patchFetch)({workAsyncStorage:P,workUnitAsyncStorage:S})}async function _(e,t,a){O.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/ids/check/route";m=m.replace(/\/index$/,"")||"/";let R=await O.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:v,params:y,nextConfig:k,parsedUrl:C,isDraftMode:E,prerenderManifest:b,routerServerContext:j,isOnDemandRevalidate:N,revalidateOnlyGenerated:A,resolvedPathname:P,clientReferenceManifest:S,serverActionsManifest:T}=R,q=(0,i.normalizeAppPath)(m),_=!!(b.dynamicRoutes[q]||b.routes[P]),D=async()=>((null==j?void 0:j.render404)?await j.render404(e,t,C,!1):t.end("This page could not be found"),null);if(_&&!E){let e=!!b.routes[P],t=b.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(k.experimental.adapterPath)return await D();throw new x.NoFallbackError}}let I=null;!_||O.isDev||E||(I="/index"===(I=P)?"/":I);let H=!0===O.isDev||!_,U=_&&!H;T&&S&&(0,o.setManifestsSingleton)({page:m,clientReferenceManifest:S,serverActionsManifest:T});let M=e.method||"GET",K=(0,s.getTracer)(),$=K.getActiveScopeSpan(),F={params:y,prerenderManifest:b,renderOpts:{experimental:{authInterrupts:!!k.experimental.authInterrupts},cacheComponents:!!k.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:k.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>O.onRequestError(e,t,a,n,j)},sharedContext:{buildId:v}},W=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),L=u.NextRequestAdapter.fromNodeNextRequest(W,(0,u.signalFromNodeResponse)(t));try{let o=async e=>O.handle(L,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${m}`)}),i=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var s,l;let u=async({previousCacheEntry:r})=>{try{if(!i&&N&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(n);e.fetchMetrics=F.renderOpts.fetchMetrics;let l=F.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let u=F.renderOpts.collectedTags;if(!_)return await (0,c.sendResponse)(W,B,s,F.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);u&&(t[g.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,a=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await O.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,j),t}},d=await O.handleResponse({req:e,nextConfig:k,cacheKey:I,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:A,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:i});if(!_)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});i||t.setHeader("x-nextjs-cache",N?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let x=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return i&&_||x.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||x.get("Cache-Control")||x.set("Cache-Control",(0,f.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(W,B,new Response(d.value.body,{headers:x,status:d.value.status||200})),null};$?await l($):await K.withPropagatedContext(e.headers,()=>K.trace(d.BaseServerSpan.handleRequest,{spanName:`${M} ${m}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof x.NoFallbackError||await O.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,j),_)throw t;return await (0,c.sendResponse)(W,B,new Response(null,{status:500})),null}}e.s(["handler",()=>_,"patchFetch",()=>q,"routeModule",()=>O,"serverHooks",()=>T,"workAsyncStorage",()=>P,"workUnitAsyncStorage",()=>S],50892)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__97a9f492._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/kitchen-api.ts","../../../src/lib/openclaw.ts","../../../src/lib/paths.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/ids/check/route.ts"],"sourcesContent":["// NOTE: This file is compiled by Next.js.\n// Do not import `openclaw/plugin-sdk` here (it is provided by the gateway runtime, not as an npm dep).\n\ntype KitchenApi = {\n config: unknown;\n runtime: {\n system: { runCommandWithTimeout: (argv: string[], opts: { timeoutMs: number }) => Promise<{ stdout?: string; stderr?: string }> };\n };\n};\n\nexport function getKitchenApi(): KitchenApi {\n const api = (globalThis as unknown as { __clawkitchen_api?: KitchenApi }).__clawkitchen_api;\n if (!api) {\n throw new Error(\n \"ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)\",\n );\n }\n return api;\n}\n","import { getKitchenApi } from \"@/lib/kitchen-api\";\n\nexport type OpenClawExecResult = {\n ok: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n};\n\nexport async function runOpenClaw(args: string[]): Promise<OpenClawExecResult> {\n // Avoid child_process usage in plugin code (triggers OpenClaw install-time safety warnings).\n // Delegate to the OpenClaw runtime helper instead.\n const api = getKitchenApi();\n\n try {\n const res = await api.runtime.system.runCommandWithTimeout([\"openclaw\", ...args], { timeoutMs: 120000 });\n return { ok: true, exitCode: 0, stdout: String(res.stdout ?? \"\"), stderr: String(res.stderr ?? \"\") };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = typeof err.stdout === \"string\" ? err.stdout : \"\";\n const stderr = typeof err.stderr === \"string\" ? err.stderr : typeof err.message === \"string\" ? err.message : String(e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n","import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\ntype OpenClawConfig = {\n agents?: { defaults?: { workspace?: string } };\n gateway?: { port?: number; auth?: { token?: string } };\n tools?: {\n agentToAgent?: {\n enabled?: boolean;\n allow?: string[];\n };\n };\n plugins?: {\n installs?: { recipes?: { installPath?: string; sourcePath?: string } };\n load?: { paths?: string[] };\n };\n};\n\nexport async function readOpenClawConfig(): Promise<OpenClawConfig> {\n const p = path.join(os.homedir(), \".openclaw\", \"openclaw.json\");\n const text = await fs.readFile(p, \"utf8\");\n return JSON.parse(text) as OpenClawConfig;\n}\n\nexport async function getWorkspaceDir() {\n const cfg = await readOpenClawConfig();\n const ws = cfg.agents?.defaults?.workspace;\n if (!ws) throw new Error(\"agents.defaults.workspace is not set in ~/.openclaw/openclaw.json\");\n return ws;\n}\n\nexport async function getWorkspaceRecipesDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"recipes\");\n}\n\nexport async function getWorkspaceGoalsDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"notes\", \"goals\");\n}\n\nexport async function getTeamWorkspaceDir(teamId: string) {\n const home = os.homedir();\n if (!home) throw new Error(\"Could not resolve home directory\");\n return path.join(home, \".openclaw\", `workspace-${teamId}`);\n}\n\nexport async function getBuiltinRecipesDir() {\n const cfg = await readOpenClawConfig();\n const p =\n cfg.plugins?.installs?.recipes?.installPath ||\n cfg.plugins?.installs?.recipes?.sourcePath ||\n cfg.plugins?.load?.paths?.[0];\n if (!p) throw new Error(\"Could not determine recipes plugin install path from ~/.openclaw/openclaw.json\");\n return path.join(p, \"recipes\", \"default\");\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/ids/check/route\",\n pathname: \"/api/ids/check\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/ids/check/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/ids/check/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import { NextResponse } from \"next/server\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { readOpenClawConfig } from \"@/lib/paths\";\n\ntype Kind = \"team\" | \"agent\";\n\ntype Snapshot = {\n atMs: number;\n recipeIds: Set<string>;\n agentIds: Set<string>;\n};\n\nconst SNAPSHOT_TTL_MS = 10_000;\nlet snapshot: Snapshot | null = null;\nlet snapshotPromise: Promise<Snapshot> | null = null;\n\nfunction normalizeId(v: unknown) {\n return String(v ?? \"\").trim();\n}\n\nasync function getSnapshot(): Promise<Snapshot> {\n const now = Date.now();\n if (snapshot && now - snapshot.atMs < SNAPSHOT_TTL_MS) return snapshot;\n if (snapshotPromise) return snapshotPromise;\n\n snapshotPromise = (async () => {\n const [recipesRes, agentsRes] = await Promise.all([\n runOpenClaw([\"recipes\", \"list\"]),\n runOpenClaw([\"agents\", \"list\", \"--json\"]),\n ]);\n\n const recipeIds = new Set<string>();\n if (recipesRes.ok) {\n try {\n const items = JSON.parse(recipesRes.stdout) as Array<{ id?: unknown }>;\n for (const r of items) {\n const id = normalizeId(r.id);\n if (id) recipeIds.add(id);\n }\n } catch {\n // ignore\n }\n }\n\n const agentIds = new Set<string>();\n if (agentsRes.ok) {\n try {\n const items = JSON.parse(agentsRes.stdout) as Array<{ id?: unknown }>;\n for (const a of items) {\n const id = normalizeId(a.id);\n if (id) agentIds.add(id);\n }\n } catch {\n // ignore\n }\n }\n\n const s: Snapshot = { atMs: now, recipeIds, agentIds };\n snapshot = s;\n snapshotPromise = null;\n return s;\n })();\n\n return snapshotPromise;\n}\n\nexport async function GET(req: Request) {\n try {\n const url = new URL(req.url);\n const kind = normalizeId(url.searchParams.get(\"kind\")) as Kind;\n const id = normalizeId(url.searchParams.get(\"id\"));\n\n if (kind !== \"team\" && kind !== \"agent\") {\n return NextResponse.json({ ok: false, error: \"kind must be team|agent\" }, { status: 400 });\n }\n if (!id) {\n return NextResponse.json({ ok: true, available: false, reason: \"empty\" });\n }\n\n const snap = await getSnapshot();\n\n // Disallow collisions with any recipe id.\n if (snap.recipeIds.has(id)) {\n return NextResponse.json({ ok: true, available: false, reason: \"recipe-id-collision\" });\n }\n\n if (kind === \"agent\") {\n if (snap.agentIds.has(id)) return NextResponse.json({ ok: true, available: false, reason: \"agent-exists\" });\n return NextResponse.json({ ok: true, available: true });\n }\n\n // Team id: check team workspace dir and any team agents prefix.\n try {\n const cfg = await readOpenClawConfig();\n const baseWorkspace = normalizeId(cfg.agents?.defaults?.workspace);\n if (baseWorkspace) {\n const teamDir = path.resolve(baseWorkspace, \"..\", `workspace-${id}`);\n const hasDir = await fs\n .stat(teamDir)\n .then(() => true)\n .catch(() => false);\n if (hasDir) return NextResponse.json({ ok: true, available: false, reason: \"team-workspace-exists\" });\n }\n } catch {\n // ignore\n }\n\n const snap2 = await getSnapshot();\n const hasAgents = Array.from(snap2.agentIds).some((a) => a.startsWith(`${id}-`));\n if (hasAgents) return NextResponse.json({ ok: true, available: false, reason: \"team-agents-exist\" });\n\n return NextResponse.json({ ok: true, available: true });\n } catch (e: unknown) {\n return NextResponse.json(\n { ok: false, error: e instanceof Error ? e.message : String(e) },\n { status: 500 },\n );\n }\n}\n"],"names":[],"mappings":"uCAUO,SAAS,IACd,IAAM,EAAO,WAA6D,iBAAiB,CAC3F,GAAI,CAAC,EACH,GADQ,GACF,AAAI,MACR,gIAGJ,OAAO,CACT,qDClBA,IAAA,EAAA,EAAA,CAAA,CAAA,OASO,eAAe,EAAY,CAAc,EAG9C,IAAM,EAAM,CAAA,EAAA,EAAA,aAAA,AAAa,IAEzB,GAAI,CACF,IAAM,EAAM,MAAM,EAAI,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,cAAe,EAAK,CAAE,CAAE,UAAW,IAAO,GACtG,MAAO,CAAE,IAAI,EAAM,SAAU,EAAG,OAAQ,OAAO,EAAI,MAAM,EAAI,IAAK,OAAQ,OAAO,EAAI,MAAM,EAAI,GAAI,CACrG,CAAE,MAAO,EAAY,CAEnB,IAAM,EAA+B,UAApB,OAAO,EAAI,IAAI,CAAgB,EAAI,IAAI,CAAG,EAG3D,MAAO,CAAE,IAAI,EAAO,WAAU,OAFO,UAAtB,OAAO,EAAI,MAAM,CAAgB,EAAI,MAAM,CAAG,GAEvB,OADD,UAAtB,OAAO,EAAI,MAAM,CAAgB,EAAI,MAAM,CAA0B,UAAvB,OAAO,EAAI,OAAO,CAHnE,AAGmF,EAAI,OAAO,CAAG,OAAO,EACvE,CAC/C,CACF,wtCCxBA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAiBO,eAAe,IACpB,IAAM,EAAI,EAAA,OAAI,CAAC,IAAI,CAAC,EAAA,OAAE,CAAC,OAAO,GAAI,YAAa,iBAE/C,OAAO,KAAK,KAAK,CADJ,AACK,MADC,EAAA,OAAE,CAAC,QAAQ,CAAC,EAAG,QAEpC,CAEO,eAAe,IACpB,IAAM,EAAM,MAAM,IACZ,EAAK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SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
@@ -1,3 +0,0 @@
1
- module.exports=[59494,e=>{"use strict";function t(){let e=globalThis.__clawkitchen_api;if(!e)throw Error("ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)");return e}e.s(["getKitchenApi",()=>t])},5003,e=>{"use strict";var t=e.i(59494);async function r(e){let r=(0,t.getKitchenApi)();try{let t=await r.runtime.system.runCommandWithTimeout(["openclaw",...e],{timeoutMs:12e4});return{ok:!0,exitCode:0,stdout:String(t.stdout??""),stderr:String(t.stderr??"")}}catch(t){let e="number"==typeof t.code?t.code:1;return{ok:!1,exitCode:e,stdout:"string"==typeof t.stdout?t.stdout:"",stderr:"string"==typeof t.stderr?t.stderr:"string"==typeof t.message?t.message:String(t)}}}e.s(["runOpenClaw",()=>r])},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},7367,e=>{"use strict";var t=e.i(12714),r=e.i(60526),n=e.i(50227);async function a(){let e=n.default.join(r.default.homedir(),".openclaw","openclaw.json");return JSON.parse(await t.default.readFile(e,"utf8"))}async function i(){let e=await a(),t=e.agents?.defaults?.workspace;if(!t)throw Error("agents.defaults.workspace is not set in ~/.openclaw/openclaw.json");return t}async function s(){let e=await i();return n.default.join(e,"recipes")}async function o(){let e=await i();return n.default.join(e,"notes","goals")}async function l(e){let t=r.default.homedir();if(!t)throw Error("Could not resolve home directory");return n.default.join(t,".openclaw",`workspace-${e}`)}async function u(){let e=await a(),t=e.plugins?.installs?.recipes?.installPath||e.plugins?.installs?.recipes?.sourcePath||e.plugins?.load?.paths?.[0];if(!t)throw Error("Could not determine recipes plugin install path from ~/.openclaw/openclaw.json");return n.default.join(t,"recipes","default")}e.s(["getBuiltinRecipesDir",()=>u,"getTeamWorkspaceDir",()=>l,"getWorkspaceDir",()=>i,"getWorkspaceGoalsDir",()=>o,"getWorkspaceRecipesDir",()=>s,"readOpenClawConfig",()=>a])},5365,(e,t,r)=>{t.exports=e.x("process",()=>require("process"))},874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},72915,e=>{"use strict";var t=e.i(12714),r=e.i(50227),n=e.i(23008),a=e.i(7367);function i(e){if(!e.startsWith("---\n"))throw Error("Recipe markdown must start with YAML frontmatter (---)");let t=e.indexOf("\n---\n",4);if(-1===t)throw Error("Recipe frontmatter not terminated (---)");let r=e.slice(4,t+1),a=n.default.parse(r);if(!a?.id)throw Error("Recipe frontmatter must include id");return a.id}async function s(e){let t="builtin"===e.source?await (0,a.getBuiltinRecipesDir)():await (0,a.getWorkspaceRecipesDir)();return r.default.join(t,`${e.id}.md`)}async function o(e,n){await t.default.mkdir(r.default.dirname(e),{recursive:!0}),await t.default.writeFile(e,n,"utf8")}e.s(["parseFrontmatterId",()=>i,"resolveRecipePath",()=>s,"writeRecipeFile",()=>o])},64965,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),a=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),p=e.i(47587),c=e.i(66012),f=e.i(70101),h=e.i(26937),w=e.i(10372),x=e.i(93695);e.i(52474);var R=e.i(220),g=e.i(66680),m=e.i(89171),v=e.i(5003),y=e.i(72915);async function E(e,{params:t}){var r;let{id:n}=await t,a=JSON.parse((await (0,v.runOpenClaw)(["recipes","list"])).stdout).find(e=>e.id===n);if(!a)return m.NextResponse.json({error:`Recipe not found: ${n}`},{status:404});let i=await (0,v.runOpenClaw)(["recipes","show",n]),s=await (0,y.resolveRecipePath)(a).catch(()=>null),o=(r=i.stdout,g.default.createHash("sha256").update(r,"utf8").digest("hex"));return m.NextResponse.json({recipe:{...a,content:i.stdout,filePath:s},recipeHash:o,stderr:i.stderr})}async function C(e,{params:t}){let r,{id:n}=await t,a=await e.json();if("string"!=typeof a.content)return m.NextResponse.json({error:"Missing content"},{status:400});try{r=(0,y.parseFrontmatterId)(a.content)}catch(e){return m.NextResponse.json({error:e.message},{status:400})}if(r!==n)return m.NextResponse.json({error:`Frontmatter id (${r}) must match URL id (${n})`},{status:400});let i=JSON.parse((await (0,v.runOpenClaw)(["recipes","list"])).stdout).find(e=>e.id===n);if(!i)return m.NextResponse.json({error:`Recipe not found: ${n}`},{status:404});if("builtin"===i.source)return m.NextResponse.json({error:`Recipe ${n} is builtin and cannot be modified`},{status:403});let s=await (0,y.resolveRecipePath)(i);return await (0,y.writeRecipeFile)(s,a.content),m.NextResponse.json({ok:!0,filePath:s})}e.s(["GET",()=>E,"PUT",()=>C],89749);var b=e.i(89749);let j=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/recipes/[id]/route",pathname:"/api/recipes/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/recipes/[id]/route.ts",nextConfigOutput:"standalone",userland:b}),{workAsyncStorage:k,workUnitAsyncStorage:N,serverHooks:A}=j;function O(){return(0,n.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:N})}async function P(e,t,n){j.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/recipes/[id]/route";g=g.replace(/\/index$/,"")||"/";let m=await j.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:v,params:y,nextConfig:E,parsedUrl:C,isDraftMode:b,prerenderManifest:k,routerServerContext:N,isOnDemandRevalidate:A,revalidateOnlyGenerated:O,resolvedPathname:P,clientReferenceManifest:T,serverActionsManifest:q}=m,S=(0,o.normalizeAppPath)(g),_=!!(k.dynamicRoutes[S]||k.routes[P]),D=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,C,!1):t.end("This page could not be found"),null);if(_&&!b){let e=!!k.routes[P],t=k.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await D();throw new x.NoFallbackError}}let H=null;!_||j.isDev||b||(H="/index"===(H=P)?"/":H);let I=!0===j.isDev||!_,U=_&&!I;q&&T&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:T,serverActionsManifest:q});let $=e.method||"GET",F=(0,i.getTracer)(),M=F.getActiveScopeSpan(),K={params:y,prerenderManifest:k,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:I,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>j.onRequestError(e,t,n,a,N)},sharedContext:{buildId:v}},W=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),L=u.NextRequestAdapter.fromNodeNextRequest(W,(0,u.signalFromNodeResponse)(t));try{let s=async e=>j.handle(L,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${$} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${$} ${g}`)}),o=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var i,l;let u=async({previousCacheEntry:r})=>{try{if(!o&&A&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(a);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let u=K.renderOpts.collectedTags;if(!_)return await (0,c.sendResponse)(W,B,i,K.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(i.headers);u&&(t[w.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=w.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=w.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:A})},!1,N),t}},d=await j.handleResponse({req:e,nextConfig:E,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:n.waitUntil,isMinimalMode:o});if(!_)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",A?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let x=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return o&&_||x.delete(w.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||x.get("Cache-Control")||x.set("Cache-Control",(0,h.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(W,B,new Response(d.value.body,{headers:x,status:d.value.status||200})),null};M?await l(M):await F.withPropagatedContext(e.headers,()=>F.trace(d.BaseServerSpan.handleRequest,{spanName:`${$} ${g}`,kind:i.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},l))}catch(t){if(t instanceof x.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:A})},!1,N),_)throw t;return await (0,c.sendResponse)(W,B,new Response(null,{status:500})),null}}e.s(["handler",()=>P,"patchFetch",()=>O,"routeModule",()=>j,"serverHooks",()=>A,"workAsyncStorage",()=>k,"workUnitAsyncStorage",()=>N],64965)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__a1497707._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/kitchen-api.ts","../../../src/lib/openclaw.ts","../../../src/lib/paths.ts","../../../src/lib/recipes.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/recipes/%5Bid%5D/route.ts"],"sourcesContent":["// NOTE: This file is compiled by Next.js.\n// Do not import `openclaw/plugin-sdk` here (it is provided by the gateway runtime, not as an npm dep).\n\ntype KitchenApi = {\n config: unknown;\n runtime: {\n system: { runCommandWithTimeout: (argv: string[], opts: { timeoutMs: number }) => Promise<{ stdout?: string; stderr?: string }> };\n };\n};\n\nexport function getKitchenApi(): KitchenApi {\n const api = (globalThis as unknown as { __clawkitchen_api?: KitchenApi }).__clawkitchen_api;\n if (!api) {\n throw new Error(\n \"ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)\",\n );\n }\n return api;\n}\n","import { getKitchenApi } from \"@/lib/kitchen-api\";\n\nexport type OpenClawExecResult = {\n ok: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n};\n\nexport async function runOpenClaw(args: string[]): Promise<OpenClawExecResult> {\n // Avoid child_process usage in plugin code (triggers OpenClaw install-time safety warnings).\n // Delegate to the OpenClaw runtime helper instead.\n const api = getKitchenApi();\n\n try {\n const res = await api.runtime.system.runCommandWithTimeout([\"openclaw\", ...args], { timeoutMs: 120000 });\n return { ok: true, exitCode: 0, stdout: String(res.stdout ?? \"\"), stderr: String(res.stderr ?? \"\") };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = typeof err.stdout === \"string\" ? err.stdout : \"\";\n const stderr = typeof err.stderr === \"string\" ? err.stderr : typeof err.message === \"string\" ? err.message : String(e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n","import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\ntype OpenClawConfig = {\n agents?: { defaults?: { workspace?: string } };\n gateway?: { port?: number; auth?: { token?: string } };\n tools?: {\n agentToAgent?: {\n enabled?: boolean;\n allow?: string[];\n };\n };\n plugins?: {\n installs?: { recipes?: { installPath?: string; sourcePath?: string } };\n load?: { paths?: string[] };\n };\n};\n\nexport async function readOpenClawConfig(): Promise<OpenClawConfig> {\n const p = path.join(os.homedir(), \".openclaw\", \"openclaw.json\");\n const text = await fs.readFile(p, \"utf8\");\n return JSON.parse(text) as OpenClawConfig;\n}\n\nexport async function getWorkspaceDir() {\n const cfg = await readOpenClawConfig();\n const ws = cfg.agents?.defaults?.workspace;\n if (!ws) throw new Error(\"agents.defaults.workspace is not set in ~/.openclaw/openclaw.json\");\n return ws;\n}\n\nexport async function getWorkspaceRecipesDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"recipes\");\n}\n\nexport async function getWorkspaceGoalsDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"notes\", \"goals\");\n}\n\nexport async function getTeamWorkspaceDir(teamId: string) {\n const home = os.homedir();\n if (!home) throw new Error(\"Could not resolve home directory\");\n return path.join(home, \".openclaw\", `workspace-${teamId}`);\n}\n\nexport async function getBuiltinRecipesDir() {\n const cfg = await readOpenClawConfig();\n const p =\n cfg.plugins?.installs?.recipes?.installPath ||\n cfg.plugins?.installs?.recipes?.sourcePath ||\n cfg.plugins?.load?.paths?.[0];\n if (!p) throw new Error(\"Could not determine recipes plugin install path from ~/.openclaw/openclaw.json\");\n return path.join(p, \"recipes\", \"default\");\n}\n","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport YAML from \"yaml\";\nimport { getBuiltinRecipesDir, getWorkspaceRecipesDir } from \"./paths\";\n\nexport type RecipeListItem = {\n id: string;\n name: string;\n kind: \"agent\" | \"team\";\n source: \"builtin\" | \"workspace\";\n};\n\nexport type RecipeDetail = RecipeListItem & {\n content: string;\n filePath: string | null;\n};\n\nexport function parseFrontmatterId(md: string): string {\n if (!md.startsWith(\"---\\n\")) throw new Error(\"Recipe markdown must start with YAML frontmatter (---)\");\n const end = md.indexOf(\"\\n---\\n\", 4);\n if (end === -1) throw new Error(\"Recipe frontmatter not terminated (---)\");\n const yamlText = md.slice(4, end + 1);\n const fm = YAML.parse(yamlText) as { id?: string };\n if (!fm?.id) throw new Error(\"Recipe frontmatter must include id\");\n return fm.id;\n}\n\nexport async function resolveRecipePath(item: RecipeListItem): Promise<string> {\n const dir = item.source === \"builtin\" ? await getBuiltinRecipesDir() : await getWorkspaceRecipesDir();\n // Current convention: <id>.md in the directory.\n return path.join(dir, `${item.id}.md`);\n}\n\nexport async function readRecipe(item: RecipeListItem, contentFromCli: string): Promise<RecipeDetail> {\n // Prefer CLI-provided markdown, but also compute path for saving.\n let filePath: string | null = null;\n try {\n filePath = await resolveRecipePath(item);\n } catch {\n filePath = null;\n }\n return { ...item, content: contentFromCli, filePath };\n}\n\nexport async function writeRecipeFile(filePath: string, md: string) {\n await fs.mkdir(path.dirname(filePath), { recursive: true });\n await fs.writeFile(filePath, md, \"utf8\");\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/recipes/[id]/route\",\n pathname: \"/api/recipes/[id]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/recipes/[id]/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/recipes/[id]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import crypto from \"node:crypto\";\nimport { NextResponse } from \"next/server\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { parseFrontmatterId, resolveRecipePath, type RecipeListItem, writeRecipeFile } from \"@/lib/recipes\";\n\nfunction sha256(text: string) {\n return crypto.createHash(\"sha256\").update(text, \"utf8\").digest(\"hex\");\n}\n\nexport async function GET(\n _req: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n\n // Get list to learn the source (builtin/workspace) and metadata.\n const list = await runOpenClaw([\"recipes\", \"list\"]);\n const recipes = JSON.parse(list.stdout) as RecipeListItem[];\n const item = recipes.find((r) => r.id === id);\n if (!item) return NextResponse.json({ error: `Recipe not found: ${id}` }, { status: 404 });\n\n const shown = await runOpenClaw([\"recipes\", \"show\", id]);\n const filePath = await resolveRecipePath(item).catch(() => null);\n\n const recipeHash = sha256(shown.stdout);\n\n return NextResponse.json({ recipe: { ...item, content: shown.stdout, filePath }, recipeHash, stderr: shown.stderr });\n}\n\nexport async function PUT(\n req: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n const body = (await req.json()) as { content?: string };\n if (typeof body.content !== \"string\") {\n return NextResponse.json({ error: \"Missing content\" }, { status: 400 });\n }\n\n // Validate frontmatter id matches route id.\n let parsedId: string;\n try {\n parsedId = parseFrontmatterId(body.content);\n } catch (e) {\n return NextResponse.json({ error: (e as Error).message }, { status: 400 });\n }\n if (parsedId !== id) {\n return NextResponse.json(\n { error: `Frontmatter id (${parsedId}) must match URL id (${id})` },\n { status: 400 }\n );\n }\n\n // Determine source/path via list.\n const list = await runOpenClaw([\"recipes\", \"list\"]);\n const recipes = JSON.parse(list.stdout) as RecipeListItem[];\n const item = recipes.find((r) => r.id === id);\n if (!item) return NextResponse.json({ error: `Recipe not found: ${id}` }, { status: 404 });\n\n if (item.source === \"builtin\") {\n return NextResponse.json({ error: `Recipe ${id} is builtin and cannot be modified` }, { status: 403 });\n }\n\n const filePath = await resolveRecipePath(item);\n await writeRecipeFile(filePath, body.content);\n\n return NextResponse.json({ ok: true, filePath });\n}\n"],"names":[],"mappings":"uCAUO,SAAS,IACd,IAAM,EAAO,WAA6D,iBAAiB,CAC3F,GAAI,CAAC,EACH,GADQ,GACF,AAAI,MACR,gIAGJ,OAAO,CACT,qDClBA,IAAA,EAAA,EAAA,CAAA,CAAA,OASO,eAAe,EAAY,CAAc,EAG9C,IAAM,EAAM,CAAA,EAAA,EAAA,aAAA,AAAa,IAEzB,GAAI,CACF,IAAM,EAAM,MAAM,EAAI,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,cAAe,EAAK,CAAE,CAAE,UAAW,IAAO,GACtG,MAAO,CAAE,IAAI,EAAM,SAAU,EAAG,OAAQ,OAAO,EAAI,MAAM,EAAI,IAAK,OAAQ,OAAO,EAAI,MAAM,EAAI,GAAI,CACrG,CAAE,MAAO,EAAY,CAEnB,IAAM,EAA+B,UAApB,OAAO,EAAI,IAAI,CAAgB,EAAI,IAAI,CAAG,EAG3D,MAAO,CAAE,GAAI,GAAO,WAAU,OAFO,UAAtB,OAAO,EAAI,MAAM,CAAgB,EAAI,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qB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,EACA,MAAM,EAAe,EADT,CAGZ,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAEf,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[4]}
@@ -1,3 +0,0 @@
1
- module.exports=[70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},7367,e=>{"use strict";var t=e.i(12714),r=e.i(60526),a=e.i(50227);async function n(){let e=a.default.join(r.default.homedir(),".openclaw","openclaw.json");return JSON.parse(await t.default.readFile(e,"utf8"))}async function o(){let e=await n(),t=e.agents?.defaults?.workspace;if(!t)throw Error("agents.defaults.workspace is not set in ~/.openclaw/openclaw.json");return t}async function i(){let e=await o();return a.default.join(e,"recipes")}async function s(){let e=await o();return a.default.join(e,"notes","goals")}async function l(e){let t=r.default.homedir();if(!t)throw Error("Could not resolve home directory");return a.default.join(t,".openclaw",`workspace-${e}`)}async function u(){let e=await n(),t=e.plugins?.installs?.recipes?.installPath||e.plugins?.installs?.recipes?.sourcePath||e.plugins?.load?.paths?.[0];if(!t)throw Error("Could not determine recipes plugin install path from ~/.openclaw/openclaw.json");return a.default.join(t,"recipes","default")}e.s(["getBuiltinRecipesDir",()=>u,"getTeamWorkspaceDir",()=>l,"getWorkspaceDir",()=>o,"getWorkspaceGoalsDir",()=>s,"getWorkspaceRecipesDir",()=>i,"readOpenClawConfig",()=>n])},76509,e=>{"use strict";var t=e.i(7367);async function r(){let e=await (0,t.readOpenClawConfig)(),r=e.gateway?.port??18789,a=e.gateway?.auth?.token;if(!a)throw Error("Missing gateway token (gateway.auth.token in ~/.openclaw/openclaw.json)");return{baseUrl:`http://127.0.0.1:${r}`,token:a}}async function a(e){let{baseUrl:t,token:a}=await r(),n=await fetch(`${t}/tools/invoke`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${a}`},body:JSON.stringify(e)}),o=await n.json();if(!n.ok||!o.ok)throw Error("object"==typeof o.error&&o.error?.message||("string"==typeof o.error?o.error:null)||`tools/invoke failed (${n.status})`);return o.result}async function n(){let e=await a({tool:"gateway",args:{action:"config.get",raw:"{}"}}),t=e?.content?.find(e=>"text"===e.type)?.text;if(!t)throw Error("gateway config.get: missing text payload");let r=JSON.parse(t),n=String(r?.result?.raw??""),o=String(r?.result?.hash??"");if(!n)throw Error("gateway config.get: missing result.raw");if(!o)throw Error("gateway config.get: missing result.hash");return{raw:n,hash:o}}async function o(e,t){let{hash:r}=await n();return a({tool:"gateway",args:{action:"config.patch",raw:JSON.stringify(e,null,2),baseHash:r,note:t??"ClawKitchen settings update",restartDelayMs:1e3}})}e.s(["gatewayConfigGet",()=>n,"gatewayConfigPatch",()=>o,"toolsInvoke",()=>a])},53704,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),l=e.i(16795),u=e.i(87718),p=e.i(95169),c=e.i(47587),d=e.i(66012),g=e.i(70101),f=e.i(26937),h=e.i(10372),w=e.i(93695);e.i(52474);var x=e.i(220),y=e.i(89171),v=e.i(76509);let R="plugins.entries.recipes.config.cronInstallation";async function m(){var e;let{raw:t}=await (0,v.gatewayConfigGet)(),r=String((e=JSON.parse(t),R.split(".").reduce((e,t)=>{if(e&&"object"==typeof e)return e[t]},e)??"")).trim();return y.NextResponse.json({ok:!0,path:R,value:r})}async function E(e){let t=String((await e.json()).value??"").trim();return t&&["off","prompt","on"].includes(t)?(await (0,v.gatewayConfigPatch)({plugins:{entries:{recipes:{config:{cronInstallation:t}}}}},`ClawKitchen: set ${R}=${t}`),y.NextResponse.json({ok:!0,path:R,value:t,note:"Gateway will restart to apply config."})):y.NextResponse.json({ok:!1,error:"value must be one of: off|prompt|on"},{status:400})}e.s(["GET",()=>m,"PUT",()=>E],48e3);var C=e.i(48e3);let k=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/settings/cron-installation/route",pathname:"/api/settings/cron-installation",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/settings/cron-installation/route.ts",nextConfigOutput:"standalone",userland:C}),{workAsyncStorage:j,workUnitAsyncStorage:b,serverHooks:N}=k;function A(){return(0,a.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:b})}async function O(e,t,a){k.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let y="/api/settings/cron-installation/route";y=y.replace(/\/index$/,"")||"/";let v=await k.prepare(e,t,{srcPage:y,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:R,params:m,nextConfig:E,parsedUrl:C,isDraftMode:j,prerenderManifest:b,routerServerContext:N,isOnDemandRevalidate:A,revalidateOnlyGenerated:O,resolvedPathname:P,clientReferenceManifest:S,serverActionsManifest:T}=v,q=(0,s.normalizeAppPath)(y),_=!!(b.dynamicRoutes[q]||b.routes[P]),D=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,C,!1):t.end("This page could not be found"),null);if(_&&!j){let e=!!b.routes[P],t=b.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await D();throw new w.NoFallbackError}}let H=null;!_||k.isDev||j||(H="/index"===(H=P)?"/":H);let I=!0===k.isDev||!_,U=_&&!I;T&&S&&(0,i.setManifestsSingleton)({page:y,clientReferenceManifest:S,serverActionsManifest:T});let $=e.method||"GET",M=(0,o.getTracer)(),K=M.getActiveScopeSpan(),F={params:m,prerenderManifest:b,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:I,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>k.onRequestError(e,t,a,n,N)},sharedContext:{buildId:R}},G=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),W=u.NextRequestAdapter.fromNodeNextRequest(G,(0,u.signalFromNodeResponse)(t));try{let i=async e=>k.handle(W,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${$} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${$} ${y}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var o,l;let u=async({previousCacheEntry:r})=>{try{if(!s&&A&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(n);e.fetchMetrics=F.renderOpts.fetchMetrics;let l=F.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let u=F.renderOpts.collectedTags;if(!_)return await (0,d.sendResponse)(G,B,o,F.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,g.toNodeOutgoingHttpHeaders)(o.headers);u&&(t[h.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,a=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:A})},!1,N),t}},p=await k.handleResponse({req:e,nextConfig:E,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:s});if(!_)return null;if((null==p||null==(o=p.value)?void 0:o.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(l=p.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",A?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),j&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let w=(0,g.fromNodeOutgoingHttpHeaders)(p.value.headers);return s&&_||w.delete(h.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||w.get("Cache-Control")||w.set("Cache-Control",(0,f.getCacheControlHeader)(p.cacheControl)),await (0,d.sendResponse)(G,B,new Response(p.value.body,{headers:w,status:p.value.status||200})),null};K?await l(K):await M.withPropagatedContext(e.headers,()=>M.trace(p.BaseServerSpan.handleRequest,{spanName:`${$} ${y}`,kind:o.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},l))}catch(t){if(t instanceof w.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:A})},!1,N),_)throw t;return await (0,d.sendResponse)(G,B,new Response(null,{status:500})),null}}e.s(["handler",()=>O,"patchFetch",()=>A,"routeModule",()=>k,"serverHooks",()=>N,"workAsyncStorage",()=>j,"workUnitAsyncStorage",()=>b],53704)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__d907380c._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/paths.ts","../../../src/lib/gateway.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/settings/cron-installation/route.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\ntype OpenClawConfig = {\n agents?: { defaults?: { workspace?: string } };\n gateway?: { port?: number; auth?: { token?: string } };\n tools?: {\n agentToAgent?: {\n enabled?: boolean;\n allow?: string[];\n };\n };\n plugins?: {\n installs?: { recipes?: { installPath?: string; sourcePath?: string } };\n load?: { paths?: string[] };\n };\n};\n\nexport async function readOpenClawConfig(): Promise<OpenClawConfig> {\n const p = path.join(os.homedir(), \".openclaw\", \"openclaw.json\");\n const text = await fs.readFile(p, \"utf8\");\n return JSON.parse(text) as OpenClawConfig;\n}\n\nexport async function getWorkspaceDir() {\n const cfg = await readOpenClawConfig();\n const ws = cfg.agents?.defaults?.workspace;\n if (!ws) throw new Error(\"agents.defaults.workspace is not set in ~/.openclaw/openclaw.json\");\n return ws;\n}\n\nexport async function getWorkspaceRecipesDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"recipes\");\n}\n\nexport async function getWorkspaceGoalsDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"notes\", \"goals\");\n}\n\nexport async function getTeamWorkspaceDir(teamId: string) {\n const home = os.homedir();\n if (!home) throw new Error(\"Could not resolve home directory\");\n return path.join(home, \".openclaw\", `workspace-${teamId}`);\n}\n\nexport async function getBuiltinRecipesDir() {\n const cfg = await readOpenClawConfig();\n const p =\n cfg.plugins?.installs?.recipes?.installPath ||\n cfg.plugins?.installs?.recipes?.sourcePath ||\n cfg.plugins?.load?.paths?.[0];\n if (!p) throw new Error(\"Could not determine recipes plugin install path from ~/.openclaw/openclaw.json\");\n return path.join(p, \"recipes\", \"default\");\n}\n","import { readOpenClawConfig } from \"@/lib/paths\";\n\ntype ToolsInvokeRequest = {\n tool: string;\n action?: string;\n args?: Record<string, unknown>;\n sessionKey?: string;\n dryRun?: boolean;\n};\n\ntype ToolsInvokeResponse = {\n ok: boolean;\n result?: unknown;\n error?: { message?: string } | string;\n};\n\ntype GatewayConfigGetResult = {\n path: string;\n exists: boolean;\n raw: string;\n hash: string;\n};\n\ntype ToolTextEnvelope = {\n ok: boolean;\n result: GatewayConfigGetResult;\n};\n\nasync function getGatewayBaseUrlAndToken() {\n // ClawKitchen runs in-process with the OpenClaw Gateway (as a plugin), so we can read\n // the gateway port/token from the loaded config.\n const cfg = await readOpenClawConfig();\n const port = cfg.gateway?.port ?? 18789;\n const token = cfg.gateway?.auth?.token;\n if (!token) throw new Error(\"Missing gateway token (gateway.auth.token in ~/.openclaw/openclaw.json)\");\n\n const baseUrl = `http://127.0.0.1:${port}`;\n return { baseUrl, token };\n}\n\nexport async function toolsInvoke<T = unknown>(req: ToolsInvokeRequest): Promise<T> {\n const { baseUrl, token } = await getGatewayBaseUrlAndToken();\n\n const res = await fetch(`${baseUrl}/tools/invoke`, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n authorization: `Bearer ${token}`,\n },\n body: JSON.stringify(req),\n });\n\n const json = (await res.json()) as ToolsInvokeResponse;\n if (!res.ok || !json.ok) {\n const msg =\n (typeof json.error === \"object\" && json.error?.message) ||\n (typeof json.error === \"string\" ? json.error : null) ||\n `tools/invoke failed (${res.status})`;\n throw new Error(msg);\n }\n\n return json.result as T;\n}\n\nexport async function gatewayConfigGet(): Promise<{ raw: string; hash: string }> {\n const toolResult = await toolsInvoke<{ content: Array<{ type: string; text?: string }> }>({\n tool: \"gateway\",\n args: { action: \"config.get\", raw: \"{}\" },\n });\n\n const text = toolResult?.content?.find((c) => c.type === \"text\")?.text;\n if (!text) throw new Error(\"gateway config.get: missing text payload\");\n\n const parsed = JSON.parse(text) as ToolTextEnvelope;\n const raw = String(parsed?.result?.raw ?? \"\");\n const hash = String(parsed?.result?.hash ?? \"\");\n if (!raw) throw new Error(\"gateway config.get: missing result.raw\");\n if (!hash) throw new Error(\"gateway config.get: missing result.hash\");\n return { raw, hash };\n}\n\nexport async function gatewayConfigPatch(patch: unknown, note?: string) {\n const { hash } = await gatewayConfigGet();\n const raw = JSON.stringify(patch, null, 2);\n\n return toolsInvoke({\n tool: \"gateway\",\n args: {\n action: \"config.patch\",\n raw,\n baseHash: hash,\n note: note ?? \"ClawKitchen settings update\",\n restartDelayMs: 1000,\n },\n });\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/settings/cron-installation/route\",\n pathname: \"/api/settings/cron-installation\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/settings/cron-installation/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/settings/cron-installation/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import { NextResponse } from \"next/server\";\nimport { gatewayConfigGet, gatewayConfigPatch } from \"@/lib/gateway\";\n\nconst CFG_PATH = \"plugins.entries.recipes.config.cronInstallation\";\n\nfunction getPath(obj: unknown, p: string): unknown {\n return p.split(\".\").reduce<unknown>((acc, k) => {\n if (!acc || typeof acc !== \"object\") return undefined;\n return (acc as Record<string, unknown>)[k];\n }, obj);\n}\n\nexport async function GET() {\n const { raw } = await gatewayConfigGet();\n const cfg = JSON.parse(raw);\n const value = String(getPath(cfg, CFG_PATH) ?? \"\").trim();\n return NextResponse.json({ ok: true, path: CFG_PATH, value });\n}\n\nexport async function PUT(req: Request) {\n const body = (await req.json()) as { value?: string };\n const value = String(body.value ?? \"\").trim();\n if (!value || ![\"off\", \"prompt\", \"on\"].includes(value)) {\n return NextResponse.json({ ok: false, error: \"value must be one of: off|prompt|on\" }, { status: 400 });\n }\n\n await gatewayConfigPatch(\n {\n plugins: {\n entries: {\n recipes: {\n config: {\n cronInstallation: value,\n },\n },\n },\n },\n },\n `ClawKitchen: set ${CFG_PATH}=${value}`\n );\n\n return NextResponse.json({ ok: true, path: CFG_PATH, value, note: \"Gateway will restart to apply config.\" });\n}\n"],"names":[],"mappings":"2sCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAiBO,eAAe,IACpB,IAAM,EAAI,EAAA,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AI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[2]}
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,39905,e=>{"use strict";var t=e.i(43476),s=e.i(71645);function a(){let[e,a]=(0,s.useState)(!0),[l,o]=(0,s.useState)(!1),[r,i]=(0,s.useState)("prompt"),[n,c]=(0,s.useState)("");async function d(e){o(!0),c("");try{let t=await fetch("/api/settings/cron-installation",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:e})}),s=await t.json();if(!t.ok)throw Error(s.error||"Save failed");i(e),c("Saved.")}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}(0,s.useEffect)(()=>{(async()=>{a(!0),c("");try{let e=await fetch("/api/settings/cron-installation",{cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to load config");let s=String(t.value||"").trim();"off"===s||"prompt"===s||"on"===s?i(s):i("prompt")}catch(e){c(e instanceof Error?e.message:String(e))}finally{a(!1)}})()},[]);let f=({value:s,title:a,help:o})=>(0,t.jsxs)("button",{type:"button",onClick:()=>d(s),disabled:e||l,className:`ck-glass w-full text-left px-4 py-3 transition-colors hover:bg-white/10 ${r===s?"border-[color:var(--ck-accent-red)]":""}`,children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsx)("div",{className:"font-medium",children:a}),r===s?(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-accent-red)]",children:"Selected"}):null]}),(0,t.jsx)("div",{className:"mt-1 text-sm text-[color:var(--ck-text-secondary)]",children:o})]});return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(f,{value:"off",title:"Off",help:"Never install or reconcile recipe-defined cron jobs."}),(0,t.jsx)(f,{value:"prompt",title:"Prompt (default)",help:"Ask at scaffold time. Default answer should be No; jobs are installed disabled unless you opt in."}),(0,t.jsx)(f,{value:"on",title:"On",help:"Install/reconcile jobs during scaffold (enabledByDefault controls new jobs)."}),n?(0,t.jsx)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 text-sm",children:n}):null]})}e.s(["default",()=>a])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88810,e=>{"use strict";var t=e.i(43476),a=e.i(74080),s=e.i(71645),r=e.i(18566);function l({open:e,agentId:s,busy:r,error:l,onClose:i,onConfirm:c}){return e?(0,a.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[200]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick:i}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,t.jsxs)("div",{className:"w-full max-w-lg rounded-2xl border border-white/10 bg-[color:var(--ck-bg-glass-strong)] p-5 shadow-[var(--ck-shadow-2)]",children:[(0,t.jsx)("div",{className:"text-lg font-semibold text-[color:var(--ck-text-primary)]",children:"Delete agent"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Delete agent ",(0,t.jsx)("code",{className:"font-mono",children:s}),"? This will remove its workspace/state."]}),l?(0,t.jsx)("div",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:l}):null,(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:i,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:r,onClick:c,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-[var(--ck-accent-red-hover)] disabled:opacity-50",children:r?"Deleting…":"Delete"})]})]})})})]}),document.body):null}function i({agentId:e,returnTo:a}){let i=(0,r.useRouter)(),[c,o]=(0,s.useState)(null),[n,d]=(0,s.useState)(!0),[m,x]=(0,s.useState)(!1),[h,u]=(0,s.useState)(!1),[v,p]=(0,s.useState)(""),[g,k]=(0,s.useState)(""),[f,y]=(0,s.useState)(""),[b,j]=(0,s.useState)(""),[w,N]=(0,s.useState)(!1),[S,C]=(0,s.useState)(!1),[E,T]=(0,s.useState)(null),[A,I]=(0,s.useState)("identity"),[D,O]=(0,s.useState)(""),[R,U]=(0,s.useState)(""),[P,$]=(0,s.useState)(""),[q,L]=(0,s.useState)(""),[F,J]=(0,s.useState)(""),[z,B]=(0,s.useState)([]),[K,M]=(0,s.useState)([]),[W,Y]=(0,s.useState)(!1),[G,H]=(0,s.useState)(""),[Q,V]=(0,s.useState)(!1),[X,Z]=(0,s.useState)([]),[_,ee]=(0,s.useState)(!1),[et,ea]=(0,s.useState)(!1),[es,er]=(0,s.useState)("IDENTITY.md"),[el,ei]=(0,s.useState)(""),ec=e.includes("-")?e.split("-").slice(0,-1).join("-"):"";async function eo(){x(!0),p("");try{let t=await fetch("/api/agents/identity",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,name:D,emoji:R,theme:P,avatar:q})}),a=await t.json();if(!t.ok)throw Error(a.message||a.error||"Save failed");p("Saved identity via openclaw agents set-identity")}catch(e){p(e instanceof Error?e.message:String(e))}finally{x(!1)}}async function en(){x(!0),p(""),setTimeout(()=>p(""),6e3);try{let t=await fetch("/api/agents/update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,patch:{model:F}})}),a=await t.json();if(!t.ok)throw Error(a.error||"Save config failed");p("Saved agent config (model) and restarted gateway")}catch(e){p(e instanceof Error?e.message:String(e))}finally{x(!1)}}async function ed(t){er(t),ei(""),u(!0),k("");try{let a=await fetch(`/api/agents/file?agentId=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{cache:"no-store"}),s=await a.json();if(!a.ok||!s.ok)throw Error(s.error||"Failed to load file");ei(String(s.content??""))}catch(e){k(e instanceof Error?e.message:String(e)),setTimeout(()=>k(""),12e3)}finally{u(!1)}}async function em(){x(!0),k("");try{let t=await fetch("/api/agents/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,name:es,content:el})}),a=await t.json();if(!t.ok||!a.ok)throw Error(a.error||"Failed to save file")}catch(e){k(e instanceof Error?e.message:String(e)),setTimeout(()=>k(""),12e3)}finally{x(!1)}}async function ex(){C(!0),T(null),p("");try{let t=await fetch(`/api/agents/${encodeURIComponent(e)}`,{method:"DELETE"}),a=await t.json();if(!t.ok||!a.ok)throw Error(a.error||a.message||a.stderr||"Delete failed");window.location.href="/"}catch(e){T(e instanceof Error?e.message:String(e)),C(!1)}}return((0,s.useEffect)(()=>{(async()=>{d(!0),p("");try{let t=await fetch("/api/agents",{cache:"no-store"}),a=await t.json(),s=(Array.isArray(a.agents)?a.agents:[]).find(t=>t.id===e)??null;o(s),O(s?.identityName??""),J(s?.model??""),d(!1),(async()=>{ee(!0),Y(!0);try{let[t,a,s]=await Promise.all([fetch(`/api/agents/files?agentId=${encodeURIComponent(e)}`,{cache:"no-store"}),fetch(`/api/agents/skills?agentId=${encodeURIComponent(e)}`,{cache:"no-store"}),fetch("/api/skills/available",{cache:"no-store"})]),r=[];try{let e=await t.json();if(t.ok&&e.ok){let t=Array.isArray(e.files)?e.files:[];Z(t.map(e=>({name:String(e.name??""),missing:!!e.missing,required:!!e.required,rationale:"string"==typeof e.rationale?e.rationale:void 0})))}}catch{}try{let e=await a.json();a.ok&&e.ok&&(r=Array.isArray(e.skills)?e.skills:[],B(r))}catch{}try{let e=await s.json();if(s.ok&&e.ok){let t=Array.isArray(e.skills)?e.skills:[];M(t);let a=t.find(e=>!r.includes(e));H(a??t[0]??"")}}catch{}}finally{ee(!1),Y(!1)}})()}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}})()},[e]),(0,s.useEffect)(()=>{if("files"!==A||!X.length)return;let e=X.some(e=>e.name===es),t=X[0]?.name,a=e?es:t;a&&(a!==es&&(er(a),ei("")),el||ed(a))},[A,e,X.length]),n)?(0,t.jsx)("div",{className:"ck-glass mx-auto max-w-4xl p-6",children:"Loading…"}):c?(0,t.jsxs)("div",{className:"ck-glass mx-auto max-w-4xl p-6 sm:p-8",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Agent editor"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:[c.id,c.isDefault?" • default":"",c.model?` • ${c.model}`:""]})]}),(0,t.jsx)("button",{type:"button",disabled:m,onClick:()=>{T(null),N(!0)},className:"rounded-[var(--ck-radius-sm)] border border-red-400/40 bg-red-500/10 px-3 py-2 text-sm font-medium text-red-100 shadow-[var(--ck-shadow-1)] hover:bg-red-500/15 disabled:opacity-50",children:"Delete agent"})]}),c.workspace?(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Workspace: ",c.workspace]}):null,ec?(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Team: ",ec]}):null,v?(0,t.jsx)("div",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 p-3 text-sm text-[color:var(--ck-text-primary)]",children:v}):null,(0,t.jsx)("div",{className:"mt-6 flex flex-wrap gap-2",children:[{id:"identity",label:"Identity"},{id:"config",label:"Config"},{id:"skills",label:"Skills"},{id:"files",label:"Files"}].map(e=>(0,t.jsx)("button",{onClick:()=>I(e.id),className:A===e.id?"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)]":"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] hover:bg-white/10",children:e.label},e.id))}),(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4",children:["identity"===A?(0,t.jsxs)("div",{className:"ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Identity"}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Name"}),(0,t.jsx)("input",{value:D,onChange:e=>O(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Emoji"}),(0,t.jsx)("input",{value:R,onChange:e=>U(e.target.value),placeholder:"🦞",className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Theme"}),(0,t.jsx)("input",{value:P,onChange:e=>$(e.target.value),placeholder:"warm, sharp, calm",className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Avatar"}),(0,t.jsx)("input",{value:q,onChange:e=>L(e.target.value),placeholder:"avatars/openclaw.png",className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row",children:[(0,t.jsx)("button",{disabled:m,onClick:eo,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[var(--ck-accent-red-hover)] active:bg-[var(--ck-accent-red-active)] disabled:opacity-50",children:m?"Saving…":"Save"}),a?(0,t.jsx)("button",{disabled:m,onClick:async()=>{await eo(),i.push(a)},className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15 disabled:opacity-50",children:"Save & return"}):null]})]}):null,"config"===A?(0,t.jsxs)("div",{className:"ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Config"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"Thin slice: edit the configured model id for this agent (writes to OpenClaw config)."}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Model"}),(0,t.jsx)("input",{value:F,onChange:e=>J(e.target.value),placeholder:"openai/gpt-5.2",className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)("button",{disabled:m,onClick:en,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:m?"Saving…":"Save config"})})]}):null,"skills"===A?(0,t.jsxs)("div",{className:"ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Skills"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Skills installed in this ",(0,t.jsx)("strong",{children:"agent"})," workspace (",(0,t.jsx)("code",{children:"skills/"}),"). If you want a skill available to all agents, add it at the team level."]}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Installed"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:W?(0,t.jsx)("li",{children:"Loading…"}):z.length?z.map(e=>(0,t.jsx)("li",{children:e},e)):(0,t.jsx)("li",{children:"None installed."})})]}),(0,t.jsxs)("div",{className:"mt-5 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15 p-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Add a skill"}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,t.jsx)("select",{value:G,onChange:e=>H(e.target.value),className:"w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",disabled:Q||!K.length,children:K.length?K.map(e=>(0,t.jsx)("option",{value:e,children:e},e)):(0,t.jsx)("option",{value:"",children:"No skills found"})}),(0,t.jsx)("button",{type:"button",disabled:Q||!G,onClick:async()=>{V(!0),y(""),j("");try{let t=await fetch("/api/agents/skills/install",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,skill:G})}),a=await t.json();if(!t.ok||!a.ok)throw Error(a.error||"Failed to install skill");y(`Installed skill: ${G}`),setTimeout(()=>y(""),8e3);let s=await fetch(`/api/agents/skills?agentId=${encodeURIComponent(e)}`,{cache:"no-store"}),r=await s.json();s.ok&&r.ok&&B(Array.isArray(r.skills)?r.skills:[])}catch(e){j(e instanceof Error?e.message:String(e)),setTimeout(()=>j(""),12e3)}finally{V(!1)}},className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:Q?"Adding…":"Add"})]}),b?(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:b}):f?(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-emerald-400/30 bg-emerald-500/10 p-3 text-sm text-emerald-100",children:f}):null,(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["This uses ",(0,t.jsxs)("code",{children:["openclaw recipes install-skill <skill> --agent-id ",e," --yes"]}),"."]})]})]}):null,"files"===A?(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,t.jsxs)("div",{className:"ck-glass-strong p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Agent files"}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:et,onChange:e=>ea(e.target.checked)}),"Show optional"]})]}),(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"Default view hides optional missing files to reduce noise."}),(0,t.jsxs)("ul",{className:"mt-3 space-y-1",children:[_?(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,X.filter(e=>!!et||!!e.required||!e.missing).map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{onClick:()=>ed(e.name),className:es===e.name?"w-full rounded-[var(--ck-radius-sm)] bg-white/10 px-3 py-2 text-left text-sm text-[color:var(--ck-text-primary)]":"w-full rounded-[var(--ck-radius-sm)] px-3 py-2 text-left text-sm text-[color:var(--ck-text-secondary)] hover:bg-white/5",children:[(0,t.jsx)("span",{className:e.required?"text-[color:var(--ck-text-primary)]":"text-[color:var(--ck-text-secondary)]",children:e.name}),(0,t.jsx)("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:e.required?"required":"optional"}),e.missing?(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"missing"}):null]})},e.name))]})]}),(0,t.jsxs)("div",{className:"ck-glass-strong p-4 lg:col-span-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:["Edit: ",es]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[h?(0,t.jsx)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Loading…"}):null,(0,t.jsx)("button",{disabled:m,onClick:em,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:m?"Saving…":"Save file"})]})]}),g?(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:g}):null,(0,t.jsx)("textarea",{value:el,onChange:e=>ei(e.target.value),className:"mt-3 h-[55vh] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]",spellCheck:!1})]})]}):null]}),(0,t.jsx)(l,{open:w,agentId:e,busy:S,error:E,onClose:()=>N(!1),onConfirm:()=>void ex()})]}):(0,t.jsxs)("div",{className:"ck-glass mx-auto max-w-4xl p-6",children:["Agent not found: ",e]})}e.s(["default",()=>i])}]);