@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
@@ -2,7 +2,7 @@
2
2
  "id": "kitchen",
3
3
  "name": "ClawKitchen",
4
4
  "description": "Local UI for managing OpenClaw recipes, teams, agents, cron jobs, and skills.",
5
- "version": "0.1.0",
5
+ "version": "0.1.6",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiggai/kitchen",
3
- "version": "0.1.5",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "openclaw": {
6
6
  "extensions": [
@@ -10,6 +10,7 @@
10
10
  "scripts": {
11
11
  "dev": "next dev",
12
12
  "build": "next build",
13
+ "postbuild": "node scripts/copy-standalone-static.mjs",
13
14
  "start": "next start",
14
15
  "lint": "eslint",
15
16
  "smoke:goals": "node scripts/goals-smoke.mjs",
@@ -109,7 +109,7 @@ export default function AgentEditor({ agentId, returnTo }: { agentId: string; re
109
109
  const [agentFiles, setAgentFiles] = useState<Array<FileEntry & { required?: boolean; rationale?: string }>>([]);
110
110
  const [agentFilesLoading, setAgentFilesLoading] = useState(false);
111
111
  const [showOptionalFiles, setShowOptionalFiles] = useState(false);
112
- const [fileName, setFileName] = useState<string>("IDENTITY.md");
112
+ const [fileName, setFileName] = useState<string>("SOUL.md");
113
113
  const [fileContent, setFileContent] = useState<string>("");
114
114
 
115
115
  const teamId = agentId.includes("-") ? agentId.split("-").slice(0, -1).join("-") : "";
@@ -225,8 +225,6 @@ export default function AgentEditor({ agentId, returnTo }: { agentId: string; re
225
225
  setSaving(true);
226
226
  setPageMsg("");
227
227
 
228
- // Auto-clear after a moment (non-blocking).
229
- setTimeout(() => setPageMsg(""), 6000);
230
228
  try {
231
229
  const res = await fetch("/api/agents/update", {
232
230
  method: "POST",
@@ -261,7 +259,6 @@ export default function AgentEditor({ agentId, returnTo }: { agentId: string; re
261
259
  setFileContent(String(json.content ?? ""));
262
260
  } catch (e: unknown) {
263
261
  setFileError(e instanceof Error ? e.message : String(e));
264
- setTimeout(() => setFileError(""), 12000);
265
262
  } finally {
266
263
  setLoadingFile(false);
267
264
  }
@@ -288,6 +285,29 @@ export default function AgentEditor({ agentId, returnTo }: { agentId: string; re
288
285
  // eslint-disable-next-line react-hooks/exhaustive-deps
289
286
  }, [activeTab, agentId, agentFiles.length]);
290
287
 
288
+ function defaultFileContent(name: string) {
289
+ switch (name) {
290
+ case "SOUL.md":
291
+ return "# SOUL.md\n\n";
292
+ case "AGENTS.md":
293
+ return "# AGENTS.md\n\n";
294
+ case "TOOLS.md":
295
+ return "# TOOLS.md\n\n";
296
+ case "STATUS.md":
297
+ return "# STATUS.md\n\n- (empty)\n";
298
+ case "NOTES.md":
299
+ return "# NOTES.md\n\n- (empty)\n";
300
+ case "IDENTITY.md":
301
+ return "# IDENTITY.md\n\n- **Name:**\n- **Creature:**\n- **Vibe:**\n- **Emoji:**\n- **Avatar:**\n";
302
+ case "USER.md":
303
+ return "# USER.md\n\n";
304
+ case "HEARTBEAT.md":
305
+ return "# HEARTBEAT.md\n\n# Keep this file empty (or with only comments) to skip heartbeat API calls.\n";
306
+ default:
307
+ return "";
308
+ }
309
+ }
310
+
291
311
  async function onSaveAgentFile() {
292
312
  setSaving(true);
293
313
  setFileError("");
@@ -299,15 +319,28 @@ export default function AgentEditor({ agentId, returnTo }: { agentId: string; re
299
319
  });
300
320
  const json = (await res.json()) as { ok?: boolean; error?: string };
301
321
  if (!res.ok || !json.ok) throw new Error(json.error || "Failed to save file");
322
+
323
+ // Refresh the file list so missing/mtime updates immediately.
324
+ const r = await fetch(`/api/agents/files?agentId=${encodeURIComponent(agentId)}`, { cache: "no-store" });
325
+ const j = await r.json();
326
+ if (r.ok && j.ok && Array.isArray(j.files)) {
327
+ setAgentFiles(j.files);
328
+ }
302
329
  // No-op: saving a file doesn't need a global notice.
303
330
  } catch (e: unknown) {
304
331
  setFileError(e instanceof Error ? e.message : String(e));
305
- setTimeout(() => setFileError(""), 12000);
306
332
  } finally {
307
333
  setSaving(false);
308
334
  }
309
335
  }
310
336
 
337
+ async function onCreateMissingFile(name: string) {
338
+ setFileName(name);
339
+ setFileError("");
340
+ setFileContent(defaultFileContent(name));
341
+ await onSaveAgentFile();
342
+ }
343
+
311
344
  async function onDeleteAgent() {
312
345
  setDeleteBusy(true);
313
346
  setDeleteError(null);
@@ -533,14 +566,12 @@ export default function AgentEditor({ agentId, returnTo }: { agentId: string; re
533
566
  const json = await res.json();
534
567
  if (!res.ok || !json.ok) throw new Error(json.error || "Failed to install skill");
535
568
  setSkillMsg(`Installed skill: ${selectedSkill}`);
536
- setTimeout(() => setSkillMsg(""), 8000);
537
569
  // Refresh installed list.
538
570
  const r = await fetch(`/api/agents/skills?agentId=${encodeURIComponent(agentId)}`, { cache: "no-store" });
539
571
  const j = await r.json();
540
572
  if (r.ok && j.ok) setSkillsList(Array.isArray(j.skills) ? j.skills : []);
541
573
  } catch (e: unknown) {
542
574
  setSkillError(e instanceof Error ? e.message : String(e));
543
- setTimeout(() => setSkillError(""), 12000);
544
575
  } finally {
545
576
  setInstallingSkill(false);
546
577
  }
@@ -587,22 +618,34 @@ export default function AgentEditor({ agentId, returnTo }: { agentId: string; re
587
618
  .filter((f) => (showOptionalFiles ? true : Boolean(f.required) || !f.missing))
588
619
  .map((f) => (
589
620
  <li key={f.name}>
590
- <button
591
- onClick={() => onLoadAgentFile(f.name)}
592
- className={
593
- fileName === f.name
594
- ? "w-full rounded-[var(--ck-radius-sm)] bg-white/10 px-3 py-2 text-left text-sm text-[color:var(--ck-text-primary)]"
595
- : "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"
596
- }
597
- >
598
- <span className={f.required ? "text-[color:var(--ck-text-primary)]" : "text-[color:var(--ck-text-secondary)]"}>
599
- {f.name}
600
- </span>
601
- <span className="ml-2 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]">
602
- {f.required ? "required" : "optional"}
603
- </span>
604
- {f.missing ? <span className="ml-2 text-xs text-[color:var(--ck-text-tertiary)]">missing</span> : null}
605
- </button>
621
+ <div className="flex items-center gap-2">
622
+ <button
623
+ onClick={() => onLoadAgentFile(f.name)}
624
+ className={
625
+ fileName === f.name
626
+ ? "w-full rounded-[var(--ck-radius-sm)] bg-white/10 px-3 py-2 text-left text-sm text-[color:var(--ck-text-primary)]"
627
+ : "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"
628
+ }
629
+ >
630
+ <span className={f.required ? "text-[color:var(--ck-text-primary)]" : "text-[color:var(--ck-text-secondary)]"}>
631
+ {f.name}
632
+ </span>
633
+ <span className="ml-2 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]">
634
+ {f.required ? "required" : "optional"}
635
+ </span>
636
+ {f.missing ? <span className="ml-2 text-xs text-[color:var(--ck-text-tertiary)]">missing</span> : null}
637
+ </button>
638
+ {f.missing ? (
639
+ <button
640
+ type="button"
641
+ disabled={saving}
642
+ onClick={() => void onCreateMissingFile(f.name)}
643
+ className="shrink-0 rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50"
644
+ >
645
+ Create
646
+ </button>
647
+ ) : null}
648
+ </div>
606
649
  </li>
607
650
  ))}
608
651
  </ul>
@@ -1,6 +1,9 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
1
3
  import { NextResponse } from "next/server";
2
4
 
3
5
  import { runOpenClaw } from "@/lib/openclaw";
6
+ import { parseTeamRoleWorkspace } from "@/lib/agent-workspace";
4
7
 
5
8
  export async function DELETE(_req: Request, { params }: { params: Promise<{ id: string }> }) {
6
9
  try {
@@ -8,6 +11,17 @@ export async function DELETE(_req: Request, { params }: { params: Promise<{ id:
8
11
  const agentId = String(id ?? "").trim();
9
12
  if (!agentId) return NextResponse.json({ ok: false, error: "agent id is required" }, { status: 400 });
10
13
 
14
+ // Resolve workspace BEFORE deleting (after deletion it may disappear from list).
15
+ let workspace: string | null = null;
16
+ try {
17
+ const { stdout } = await runOpenClaw(["agents", "list", "--json"]);
18
+ const list = JSON.parse(stdout) as Array<{ id: string; workspace?: string }>;
19
+ const agent = list.find((a) => a.id === agentId);
20
+ workspace = agent?.workspace ? String(agent.workspace) : null;
21
+ } catch {
22
+ workspace = null;
23
+ }
24
+
11
25
  const result = await runOpenClaw(["agents", "delete", agentId, "--force", "--json"]);
12
26
  if (!result.ok) {
13
27
  return NextResponse.json(
@@ -28,6 +42,29 @@ export async function DELETE(_req: Request, { params }: { params: Promise<{ id:
28
42
  parsed = null;
29
43
  }
30
44
 
45
+ // If this was a team role agent, also remove its role directory.
46
+ // Safer than rm: move to a team-local .trash folder.
47
+ if (workspace) {
48
+ const info = parseTeamRoleWorkspace(workspace);
49
+ if (info.kind === "teamRole") {
50
+ const trashDir = path.join(info.teamDir, ".trash", "roles");
51
+ const ts = new Date().toISOString().replace(/[:.]/g, "-");
52
+ const dst = path.join(trashDir, `${info.role}-${ts}`);
53
+ try {
54
+ await fs.mkdir(trashDir, { recursive: true });
55
+ // Only move if the dir exists.
56
+ await fs.rename(info.roleDir, dst);
57
+ } catch {
58
+ // If rename fails (cross-device / missing), fall back to best-effort recursive removal.
59
+ try {
60
+ await fs.rm(info.roleDir, { recursive: true, force: true });
61
+ } catch {
62
+ // ignore
63
+ }
64
+ }
65
+ }
66
+ }
67
+
31
68
  return NextResponse.json({ ok: true, result: parsed ?? result.stdout });
32
69
  } catch (err: unknown) {
33
70
  return NextResponse.json(
@@ -26,11 +26,13 @@ export async function GET(req: Request) {
26
26
 
27
27
  // Required vs optional classification to avoid "missing" noise.
28
28
  const candidates: Array<{ name: string; required: boolean; rationale: string }> = [
29
- { name: "IDENTITY.md", required: true, rationale: "Identity (name/emoji/avatar)" },
30
29
  { name: "SOUL.md", required: true, rationale: "Agent persona/instructions" },
31
30
  { name: "AGENTS.md", required: true, rationale: "Agent operating rules" },
32
31
  { name: "TOOLS.md", required: true, rationale: "Agent local notes" },
33
32
 
33
+ { name: "STATUS.md", required: false, rationale: "Optional current status snapshot" },
34
+ { name: "NOTES.md", required: false, rationale: "Optional scratchpad" },
35
+ { name: "IDENTITY.md", required: false, rationale: "Optional identity (name/emoji/avatar)" },
34
36
  { name: "USER.md", required: false, rationale: "Optional user profile" },
35
37
  { name: "HEARTBEAT.md", required: false, rationale: "Optional periodic checklist" },
36
38
  ];
@@ -1,5 +1,6 @@
1
1
  import { NextResponse } from "next/server";
2
2
  import { runOpenClaw } from "@/lib/openclaw";
3
+ import { parseTeamRoleWorkspace } from "@/lib/agent-workspace";
3
4
 
4
5
  export async function POST(req: Request) {
5
6
  const body = (await req.json()) as { agentId?: string; skill?: string };
@@ -9,14 +10,37 @@ export async function POST(req: Request) {
9
10
  if (!agentId) return NextResponse.json({ ok: false, error: "agentId is required" }, { status: 400 });
10
11
  if (!skill) return NextResponse.json({ ok: false, error: "skill is required" }, { status: 400 });
11
12
 
12
- const args = ["recipes", "install-skill", skill, "--agent-id", agentId, "--yes"];
13
+ // For role-based team agents, install at team scope to avoid creating a separate
14
+ // workspace-<agentId> directory that diverges from roles/<role>.
15
+ let args = ["recipes", "install-skill", skill, "--agent-id", agentId, "--yes"];
16
+ try {
17
+ const { stdout } = await runOpenClaw(["agents", "list", "--json"]);
18
+ const list = JSON.parse(stdout) as Array<{ id: string; workspace?: string }>;
19
+ const agent = list.find((a) => a.id === agentId);
20
+ const ws = agent?.workspace ? String(agent.workspace) : "";
21
+ const info = parseTeamRoleWorkspace(ws);
22
+ if (info.kind === "teamRole") {
23
+ args = ["recipes", "install-skill", skill, "--team-id", info.teamId, "--yes"];
24
+ }
25
+ } catch {
26
+ // If anything goes wrong, fall back to agent scope.
27
+ }
28
+
13
29
  const res = await runOpenClaw(args);
14
30
  if (!res.ok) {
31
+ const stdout = res.stdout?.trim();
32
+ const stderr = res.stderr?.trim();
15
33
  return NextResponse.json(
16
- { ok: false, error: res.stderr.trim() || `openclaw ${args.join(" ")} failed (exit=${res.exitCode})`, stdout: res.stdout, stderr: res.stderr },
34
+ {
35
+ ok: false,
36
+ error: stderr || stdout || `openclaw ${args.join(" ")} failed (exit=${res.exitCode})`,
37
+ stdout: res.stdout,
38
+ stderr: res.stderr,
39
+ scopeArgs: args,
40
+ },
17
41
  { status: 500 },
18
42
  );
19
43
  }
20
44
 
21
- return NextResponse.json({ ok: true, agentId, skill, stdout: res.stdout, stderr: res.stderr });
45
+ return NextResponse.json({ ok: true, agentId, skill, scopeArgs: args, stdout: res.stdout, stderr: res.stderr });
22
46
  }
@@ -2,6 +2,7 @@ import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { NextResponse } from "next/server";
4
4
  import { runOpenClaw } from "@/lib/openclaw";
5
+ import { parseTeamRoleWorkspace } from "@/lib/agent-workspace";
5
6
 
6
7
  type AgentListItem = { id: string; workspace?: string };
7
8
 
@@ -19,17 +20,32 @@ export async function GET(req: Request) {
19
20
  if (!agentId) return NextResponse.json({ ok: false, error: "agentId is required" }, { status: 400 });
20
21
 
21
22
  const ws = await resolveAgentWorkspace(agentId);
22
- const skillsDir = path.join(ws, "skills");
23
-
24
- try {
25
- const entries = await fs.readdir(skillsDir, { withFileTypes: true });
26
- const skills = entries
27
- .filter((e) => e.isDirectory())
28
- .map((e) => e.name)
29
- .sort((a, b) => a.localeCompare(b));
30
-
31
- return NextResponse.json({ ok: true, agentId, workspace: ws, skillsDir, skills });
32
- } catch (e: unknown) {
33
- return NextResponse.json({ ok: true, agentId, workspace: ws, skillsDir, skills: [], note: e instanceof Error ? e.message : String(e) });
23
+
24
+ const info = parseTeamRoleWorkspace(ws);
25
+ const dirs: string[] = [path.join(ws, "skills")];
26
+ if (info.kind === "teamRole") {
27
+ // If skills were installed at the team scope, surface them for the role agent too.
28
+ dirs.push(path.join(info.teamDir, "skills"));
34
29
  }
30
+
31
+ const skills = new Set<string>();
32
+ const notes: string[] = [];
33
+
34
+ for (const skillsDir of dirs) {
35
+ try {
36
+ const entries = await fs.readdir(skillsDir, { withFileTypes: true });
37
+ for (const e of entries) if (e.isDirectory()) skills.add(e.name);
38
+ } catch (e: unknown) {
39
+ notes.push(`${skillsDir}: ${e instanceof Error ? e.message : String(e)}`);
40
+ }
41
+ }
42
+
43
+ return NextResponse.json({
44
+ ok: true,
45
+ agentId,
46
+ workspace: ws,
47
+ skillsDirs: dirs,
48
+ skills: Array.from(skills).sort((a, b) => a.localeCompare(b)),
49
+ note: notes.length ? notes.join("; ") : undefined,
50
+ });
35
51
  }
@@ -108,9 +108,9 @@ export async function POST(req: Request) {
108
108
  if (scaffold) {
109
109
  const cmd =
110
110
  kind === "team"
111
- ? ["recipes", "scaffold-team", toId, "--team-id", toId, "--overwrite"]
111
+ ? ["recipes", "scaffold-team", toId, "--team-id", toId, "--overwrite", "--overwrite-recipe"]
112
112
  : kind === "agent"
113
- ? ["recipes", "scaffold", toId, "--agent-id", toId, "--overwrite"]
113
+ ? ["recipes", "scaffold", toId, "--agent-id", toId, "--overwrite", "--overwrite-recipe"]
114
114
  : null;
115
115
 
116
116
  if (!cmd) {
@@ -11,33 +11,47 @@ function getPath(obj: unknown, p: string): unknown {
11
11
  }
12
12
 
13
13
  export async function GET() {
14
- const { raw } = await gatewayConfigGet();
15
- const cfg = JSON.parse(raw);
16
- const value = String(getPath(cfg, CFG_PATH) ?? "").trim();
17
- return NextResponse.json({ ok: true, path: CFG_PATH, value });
14
+ try {
15
+ const { raw } = await gatewayConfigGet();
16
+ const cfg = JSON.parse(raw);
17
+ const value = String(getPath(cfg, CFG_PATH) ?? "").trim();
18
+ return NextResponse.json({ ok: true, path: CFG_PATH, value });
19
+ } catch (e: unknown) {
20
+ return NextResponse.json(
21
+ { ok: false, error: e instanceof Error ? e.message : String(e) },
22
+ { status: 500 },
23
+ );
24
+ }
18
25
  }
19
26
 
20
27
  export async function PUT(req: Request) {
21
- const body = (await req.json()) as { value?: string };
22
- const value = String(body.value ?? "").trim();
23
- if (!value || !["off", "prompt", "on"].includes(value)) {
24
- return NextResponse.json({ ok: false, error: "value must be one of: off|prompt|on" }, { status: 400 });
25
- }
28
+ try {
29
+ const body = (await req.json()) as { value?: string };
30
+ const value = String(body.value ?? "").trim();
31
+ if (!value || !["off", "prompt", "on"].includes(value)) {
32
+ return NextResponse.json({ ok: false, error: "value must be one of: off|prompt|on" }, { status: 400 });
33
+ }
26
34
 
27
- await gatewayConfigPatch(
28
- {
29
- plugins: {
30
- entries: {
31
- recipes: {
32
- config: {
33
- cronInstallation: value,
35
+ await gatewayConfigPatch(
36
+ {
37
+ plugins: {
38
+ entries: {
39
+ recipes: {
40
+ config: {
41
+ cronInstallation: value,
42
+ },
34
43
  },
35
44
  },
36
45
  },
37
46
  },
38
- },
39
- `ClawKitchen: set ${CFG_PATH}=${value}`
40
- );
47
+ `ClawKitchen: set ${CFG_PATH}=${value}`
48
+ );
41
49
 
42
- return NextResponse.json({ ok: true, path: CFG_PATH, value, note: "Gateway will restart to apply config." });
50
+ return NextResponse.json({ ok: true, path: CFG_PATH, value, note: "Gateway will restart to apply config." });
51
+ } catch (e: unknown) {
52
+ return NextResponse.json(
53
+ { ok: false, error: e instanceof Error ? e.message : String(e) },
54
+ { status: 500 },
55
+ );
56
+ }
43
57
  }
@@ -12,10 +12,12 @@ export async function POST(req: Request) {
12
12
  const args = ["recipes", "install-skill", skill, "--team-id", teamId, "--yes"];
13
13
  const res = await runOpenClaw(args);
14
14
  if (!res.ok) {
15
+ const stdout = res.stdout?.trim();
16
+ const stderr = res.stderr?.trim();
15
17
  return NextResponse.json(
16
18
  {
17
19
  ok: false,
18
- error: res.stderr.trim() || `openclaw ${args.join(" ")} failed (exit=${res.exitCode})`,
20
+ error: stderr || stdout || `openclaw ${args.join(" ")} failed (exit=${res.exitCode})`,
19
21
  stdout: res.stdout,
20
22
  stderr: res.stderr,
21
23
  },
@@ -16,7 +16,8 @@ export default function SettingsClient() {
16
16
  setMsg("");
17
17
  try {
18
18
  const res = await fetch("/api/settings/cron-installation", { cache: "no-store" });
19
- const json = await res.json();
19
+ const text = await res.text();
20
+ const json = text ? (JSON.parse(text) as { ok?: boolean; value?: string; error?: string }) : {};
20
21
  if (!res.ok) throw new Error(json.error || "Failed to load config");
21
22
  const v = String(json.value || "").trim();
22
23
  if (v === "off" || v === "prompt" || v === "on") setMode(v);
@@ -38,7 +39,8 @@ export default function SettingsClient() {
38
39
  headers: { "content-type": "application/json" },
39
40
  body: JSON.stringify({ value: next }),
40
41
  });
41
- const json = await res.json();
42
+ const text = await res.text();
43
+ const json = text ? (JSON.parse(text) as { ok?: boolean; error?: string }) : {};
42
44
  if (!res.ok) throw new Error(json.error || "Save failed");
43
45
  setMode(next);
44
46
  setMsg("Saved.");
@@ -0,0 +1,14 @@
1
+ import path from "node:path";
2
+
3
+ export function parseTeamRoleWorkspace(ws: string):
4
+ | { kind: "teamRole"; teamDir: string; teamId: string; roleDir: string; role: string }
5
+ | { kind: "other" } {
6
+ const normalized = ws.replace(/\\/g, "/");
7
+ const m = normalized.match(/^(.*\/workspace-([^\/]+))\/roles\/([^\/]+)\/?$/);
8
+ if (!m) return { kind: "other" };
9
+ const teamDir = m[1];
10
+ const teamId = m[2];
11
+ const role = m[3];
12
+ const roleDir = path.join(teamDir, "roles", role);
13
+ return { kind: "teamRole", teamDir, teamId, roleDir, role };
14
+ }
@@ -13,8 +13,27 @@ export async function runOpenClaw(args: string[]): Promise<OpenClawExecResult> {
13
13
  const api = getKitchenApi();
14
14
 
15
15
  try {
16
- const res = await api.runtime.system.runCommandWithTimeout(["openclaw", ...args], { timeoutMs: 120000 });
17
- return { ok: true, exitCode: 0, stdout: String(res.stdout ?? ""), stderr: String(res.stderr ?? "") };
16
+ const res = (await api.runtime.system.runCommandWithTimeout(["openclaw", ...args], { timeoutMs: 120000 })) as {
17
+ stdout?: unknown;
18
+ stderr?: unknown;
19
+ exitCode?: unknown;
20
+ code?: unknown;
21
+ status?: unknown;
22
+ };
23
+
24
+ const stdout = String(res.stdout ?? "");
25
+ const stderr = String(res.stderr ?? "");
26
+ const exitCode =
27
+ typeof res.exitCode === "number"
28
+ ? res.exitCode
29
+ : typeof res.code === "number"
30
+ ? res.code
31
+ : typeof res.status === "number"
32
+ ? res.status
33
+ : 0;
34
+
35
+ if (exitCode !== 0) return { ok: false, exitCode, stdout, stderr };
36
+ return { ok: true, exitCode: 0, stdout, stderr };
18
37
  } catch (e: unknown) {
19
38
  const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };
20
39
  const exitCode = typeof err.code === "number" ? err.code : 1;
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/kitchen-api.ts","../../../src/lib/openclaw.ts","../../../src/lib/paths.ts","../../../src/lib/goals.ts","../../../src/app/api/goals/%5Bid%5D/promote/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"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 { getWorkspaceGoalsDir } from \"@/lib/paths\";\n\nexport type GoalStatus = \"planned\" | \"active\" | \"done\";\n\nexport type GoalFrontmatter = {\n id: string;\n title: string;\n status: GoalStatus;\n tags: string[];\n teams: string[];\n updatedAt: string; // ISO\n};\n\nexport type GoalSummary = GoalFrontmatter & {\n filename: string;\n};\n\nconst ID_RE = /^[a-z0-9][a-z0-9-]{1,63}$/;\n\nfunction assertSafeGoalId(id: string) {\n if (!ID_RE.test(id)) {\n throw new Error(\n `Invalid goal id \"${id}\". Use 2-64 chars: lowercase letters, numbers, hyphens. Example: \"increase-trial-activation\".`\n );\n }\n}\n\nfunction splitFrontmatter(md: string): { fm: unknown; body: string } {\n if (md.startsWith(\"---\\n\")) {\n const end = md.indexOf(\"\\n---\\n\", 4);\n if (end !== -1) {\n const yamlText = md.slice(4, end + 1);\n const body = md.slice(end + 5);\n const fm = YAML.parse(yamlText) as unknown;\n return { fm: fm ?? {}, body };\n }\n }\n return { fm: {}, body: md };\n}\n\nfunction normalizeFrontmatter(input: unknown, fallbackId: string, fallbackTitle: string): GoalFrontmatter {\n const now = new Date().toISOString();\n const obj = (input && typeof input === \"object\") ? (input as Record<string, unknown>) : {};\n const id = String(obj.id ?? fallbackId).trim();\n const title = String(obj.title ?? fallbackTitle ?? id).trim() || id;\n const statusRaw = String(obj.status ?? \"planned\").trim();\n const status: GoalStatus = statusRaw === \"active\" || statusRaw === \"done\" ? statusRaw : \"planned\";\n const tags = Array.isArray(obj.tags) ? (obj.tags as unknown[]).map(String) : [];\n const teams = Array.isArray(obj.teams) ? (obj.teams as unknown[]).map(String) : [];\n const updatedAt = String(obj.updatedAt ?? now);\n\n return { id, title, status, tags, teams, updatedAt };\n}\n\nasync function ensureGoalsDir() {\n const dir = await getWorkspaceGoalsDir();\n await fs.mkdir(dir, { recursive: true });\n return dir;\n}\n\nasync function goalPathForId(id: string) {\n assertSafeGoalId(id);\n const root = await ensureGoalsDir();\n const full = path.join(root, `${id}.md`);\n const normalizedRoot = path.resolve(root) + path.sep;\n const normalizedFull = path.resolve(full);\n if (!normalizedFull.startsWith(normalizedRoot)) throw new Error(\"Path traversal rejected\");\n return { root, full };\n}\n\nexport async function listGoals(): Promise<GoalSummary[]> {\n const dir = await ensureGoalsDir();\n const files = (await fs.readdir(dir)).filter((f) => f.endsWith(\".md\"));\n\n const out: GoalSummary[] = [];\n for (const f of files) {\n const full = path.join(dir, f);\n const md = await fs.readFile(full, \"utf8\");\n const id = f.replace(/\\.md$/, \"\");\n const { fm } = splitFrontmatter(md);\n const normalized = normalizeFrontmatter(fm, id, id);\n out.push({ ...normalized, filename: f });\n }\n\n // sort: active first, then planned, then done; within status by updatedAt desc\n const rank: Record<GoalStatus, number> = { active: 0, planned: 1, done: 2 };\n out.sort((a, b) => {\n const ra = rank[a.status];\n const rb = rank[b.status];\n if (ra !== rb) return ra - rb;\n return String(b.updatedAt).localeCompare(String(a.updatedAt));\n });\n\n return out;\n}\n\nexport async function readGoal(id: string): Promise<{ frontmatter: GoalFrontmatter; body: string; raw: string } | null> {\n const { full } = await goalPathForId(id);\n try {\n const raw = await fs.readFile(full, \"utf8\");\n const { fm, body } = splitFrontmatter(raw);\n const fmObj = (fm && typeof fm === \"object\") ? (fm as Record<string, unknown>) : {};\n const frontmatter = normalizeFrontmatter(fm, id, String(fmObj.title ?? id));\n return { frontmatter, body, raw };\n } catch (e: unknown) {\n if (typeof e === \"object\" && e && (e as { code?: string }).code === \"ENOENT\") return null;\n throw e;\n }\n}\n\nexport async function writeGoal(params: {\n id: string;\n title: string;\n status?: GoalStatus;\n tags?: string[];\n teams?: string[];\n body: string;\n}): Promise<{ frontmatter: GoalFrontmatter; raw: string }>\n{\n const { id } = params;\n const { full } = await goalPathForId(id);\n\n const updatedAt = new Date().toISOString();\n const fm: GoalFrontmatter = {\n id,\n title: params.title,\n status: params.status ?? \"planned\",\n tags: params.tags ?? [],\n teams: params.teams ?? [],\n updatedAt,\n };\n\n const raw = `---\\n${YAML.stringify(fm).trim()}\\n---\\n\\n${(params.body ?? \"\").trim()}\\n`;\n await fs.writeFile(full, raw, \"utf8\");\n return { frontmatter: fm, raw };\n}\n\nexport async function deleteGoal(id: string): Promise<{ ok: true } | { ok: false; reason: \"not_found\" }> {\n const { full } = await goalPathForId(id);\n try {\n await fs.unlink(full);\n return { ok: true };\n } catch (e: unknown) {\n if (typeof e === \"object\" && e && (e as { code?: string }).code === \"ENOENT\") {\n return { ok: false, reason: \"not_found\" };\n }\n throw e;\n }\n}\n","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { NextResponse } from \"next/server\";\n\nimport { readGoal, writeGoal } from \"@/lib/goals\";\nimport { getTeamWorkspaceDir, readOpenClawConfig } from \"@/lib/paths\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\n\nfunction slugifyFilePart(input: string) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^a-z0-9\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/-+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 80);\n}\n\nconst WORKFLOW_MARKER = \"<!-- goal-workflow -->\";\n\nfunction ensureWorkflowInstructions(body: string) {\n if (body.includes(WORKFLOW_MARKER)) return body;\n const snippet = [\n \"\",\n \"## Workflow\",\n WORKFLOW_MARKER,\n \"- Use **Promote to inbox** to send this goal to the development-team inbox for scoping.\",\n \"- When promoted, set goal status to **active**.\",\n \"- Track implementation work via tickets (add links/IDs under a **Tickets** section in this goal).\",\n \"- When development is complete (all associated tickets marked done), set goal status to **done**.\",\n \"\",\n \"## Tickets\",\n \"- (add ticket links/ids)\",\n \"\",\n ].join(\"\\n\");\n\n return (body ?? \"\").trim() + snippet;\n}\n\nexport async function POST(_: Request, { params }: { params: Promise<{ id: string }> }) {\n try {\n const { id } = await params;\n const goalId = decodeURIComponent(id);\n\n const existing = await readGoal(goalId);\n if (!existing) return NextResponse.json({ error: \"Goal not found\" }, { status: 404 });\n\n // 1) Create inbox item for development-team lead to scope\n const teamId = \"development-team\";\n const teamWs = await getTeamWorkspaceDir(teamId);\n const inboxDir = path.join(teamWs, \"inbox\");\n await fs.mkdir(inboxDir, { recursive: true });\n\n const received = new Date().toISOString();\n const stamp = received.replace(/[-:]/g, \"\").replace(/\\..+$/, \"\");\n const titlePart = slugifyFilePart(existing.frontmatter.title || goalId);\n const filename = `${received.slice(0, 10)}-${received.slice(11, 16).replace(\":\", \"\")}-goal-${titlePart || goalId}.md`;\n\n const inboxBody = [\n \"# Inbox — development-team\",\n \"\",\n `Received: ${received}`,\n \"\",\n \"## Request\",\n `Goal: ${existing.frontmatter.title} (${goalId})`,\n \"\",\n \"## Proposed work\",\n \"- Ticket: (lead to create during scoping)\",\n \"- Owner: lead\",\n \"\",\n \"## Links\",\n `- Goal UI: /goals/${encodeURIComponent(goalId)}`,\n `- Goal file: ~/.openclaw/workspace/notes/goals/${goalId}.md`,\n \"\",\n \"## Goal body (snapshot)\",\n existing.body?.trim() ? existing.body.trim() : \"(empty)\",\n \"\",\n ].join(\"\\n\");\n\n const inboxPath = path.join(inboxDir, filename);\n await fs.writeFile(inboxPath, inboxBody, { encoding: \"utf8\", flag: \"wx\" }).catch(async (e: unknown) => {\n const code = (e && typeof e === \"object\" && \"code\" in e) ? String((e as { code?: unknown }).code) : \"\";\n if (code === \"EEXIST\") {\n const alt = path.join(inboxDir, filename.replace(/\\.md$/, `-${stamp}.md`));\n await fs.writeFile(alt, inboxBody, { encoding: \"utf8\", flag: \"wx\" });\n return;\n }\n throw e;\n });\n\n // 2) Mark goal active + ensure workflow instructions exist\n const updatedBody = ensureWorkflowInstructions(existing.body ?? \"\");\n const updated = await writeGoal({\n id: goalId,\n title: existing.frontmatter.title,\n status: \"active\",\n tags: existing.frontmatter.tags,\n teams: existing.frontmatter.teams,\n body: updatedBody,\n });\n\n // 3) Optional lead ping only if config is permissive\n let pingAttempted = false;\n let pingOk = false;\n let pingReason: string | null = null;\n\n const cfg = await readOpenClawConfig();\n const enabled = cfg.tools?.agentToAgent?.enabled === true;\n const allow = cfg.tools?.agentToAgent?.allow ?? [];\n const targetAgentId = \"development-team-lead\";\n const permitted = enabled && (allow.includes(\"*\") || allow.includes(targetAgentId));\n\n if (!permitted) {\n pingReason = enabled\n ? `agentToAgent.allow does not include \"*\" or \"${targetAgentId}\"`\n : \"tools.agentToAgent.enabled is false\";\n } else {\n pingAttempted = true;\n try {\n const res = await runOpenClaw([\n \"agent\",\n \"--agent\",\n targetAgentId,\n \"--message\",\n `New goal promoted to development-team inbox: ${updated.frontmatter.title} (${goalId}). Inbox file: ${inboxPath}`,\n \"--timeout\",\n \"60\",\n \"--json\",\n ]);\n if (!res.ok) throw new Error(res.stderr || `openclaw exit ${res.exitCode}`);\n pingOk = true;\n } catch (e: unknown) {\n pingReason = e instanceof Error ? e.message : String(e);\n }\n }\n\n return NextResponse.json({\n ok: true,\n goal: updated.frontmatter,\n inboxPath,\n pingAttempted,\n pingOk,\n pingReason,\n });\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : String(e);\n const status = /Invalid goal id|Path traversal/.test(msg) ? 400 : 500;\n return NextResponse.json({ error: msg }, { status });\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/goals/[id]/promote/route\",\n pathname: \"/api/goals/[id]/promote\",\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/goals/[id]/promote/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/goals/[id]/promote/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"],"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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