@jiggai/kitchen 0.1.3 → 0.1.7

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 (389) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/prerender-manifest.json +0 -24
  4. package/.next/server/app/_global-error/page.js +1 -1
  5. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  6. package/.next/server/app/_global-error.html +2 -2
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page.js +1 -1
  14. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/server/app/agents/[agentId]/page.js +1 -1
  24. package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
  25. package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/agents/[id]/route.js +1 -1
  27. package/.next/server/app/api/agents/[id]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/agents/add/route.js +1 -1
  29. package/.next/server/app/api/agents/add/route.js.nft.json +1 -1
  30. package/.next/server/app/api/agents/file/route.js +1 -1
  31. package/.next/server/app/api/agents/file/route.js.nft.json +1 -1
  32. package/.next/server/app/api/agents/files/route.js +1 -1
  33. package/.next/server/app/api/agents/files/route.js.nft.json +1 -1
  34. package/.next/server/app/api/agents/identity/route.js +1 -1
  35. package/.next/server/app/api/agents/identity/route.js.nft.json +1 -1
  36. package/.next/server/app/api/agents/route.js +1 -1
  37. package/.next/server/app/api/agents/route.js.nft.json +1 -1
  38. package/.next/server/app/api/agents/skills/install/route.js +1 -1
  39. package/.next/server/app/api/agents/skills/install/route.js.nft.json +1 -1
  40. package/.next/server/app/api/agents/skills/route.js +1 -1
  41. package/.next/server/app/api/agents/skills/route.js.nft.json +1 -1
  42. package/.next/server/app/api/agents/update/route.js +1 -1
  43. package/.next/server/app/api/agents/update/route.js.nft.json +1 -1
  44. package/.next/server/app/api/channels/bindings/route.js +1 -1
  45. package/.next/server/app/api/channels/bindings/route.js.nft.json +1 -1
  46. package/.next/server/app/api/cron/delete/route.js +1 -1
  47. package/.next/server/app/api/cron/delete/route.js.nft.json +1 -1
  48. package/.next/server/app/api/cron/job/route.js +1 -1
  49. package/.next/server/app/api/cron/job/route.js.nft.json +1 -1
  50. package/.next/server/app/api/cron/jobs/route.js +1 -1
  51. package/.next/server/app/api/cron/jobs/route.js.nft.json +1 -1
  52. package/.next/server/app/api/cron/recipe-installed/route.js +1 -1
  53. package/.next/server/app/api/cron/recipe-installed/route.js.nft.json +1 -1
  54. package/.next/server/app/api/gateway/restart/route.js +1 -1
  55. package/.next/server/app/api/gateway/restart/route.js.nft.json +1 -1
  56. package/.next/server/app/api/goals/[id]/promote/route.js +1 -1
  57. package/.next/server/app/api/goals/[id]/promote/route.js.nft.json +1 -1
  58. package/.next/server/app/api/goals/[id]/route.js +1 -1
  59. package/.next/server/app/api/goals/[id]/route.js.nft.json +1 -1
  60. package/.next/server/app/api/goals/route.js +1 -1
  61. package/.next/server/app/api/goals/route.js.nft.json +1 -1
  62. package/.next/server/app/api/ids/check/route.js +1 -1
  63. package/.next/server/app/api/ids/check/route.js.nft.json +1 -1
  64. package/.next/server/app/api/marketplace/recipes/[slug]/route.js +1 -1
  65. package/.next/server/app/api/marketplace/recipes/[slug]/route.js.nft.json +1 -1
  66. package/.next/server/app/api/marketplace/recipes/route.js +1 -1
  67. package/.next/server/app/api/marketplace/recipes/route.js.nft.json +1 -1
  68. package/.next/server/app/api/recipes/[id]/route.js +1 -1
  69. package/.next/server/app/api/recipes/[id]/route.js.nft.json +1 -1
  70. package/.next/server/app/api/recipes/clone/route.js +1 -1
  71. package/.next/server/app/api/recipes/clone/route.js.nft.json +1 -1
  72. package/.next/server/app/api/recipes/delete/route.js +1 -1
  73. package/.next/server/app/api/recipes/delete/route.js.nft.json +1 -1
  74. package/.next/server/app/api/recipes/route.js +1 -1
  75. package/.next/server/app/api/recipes/route.js.nft.json +1 -1
  76. package/.next/server/app/api/recipes/team-agents/route.js +1 -1
  77. package/.next/server/app/api/recipes/team-agents/route.js.nft.json +1 -1
  78. package/.next/server/app/api/scaffold/route.js +2 -2
  79. package/.next/server/app/api/scaffold/route.js.nft.json +1 -1
  80. package/.next/server/app/api/settings/cron-installation/route.js +1 -1
  81. package/.next/server/app/api/settings/cron-installation/route.js.nft.json +1 -1
  82. package/.next/server/app/api/skills/available/route.js +1 -1
  83. package/.next/server/app/api/skills/available/route.js.nft.json +1 -1
  84. package/.next/server/app/api/teams/file/route.js +1 -1
  85. package/.next/server/app/api/teams/file/route.js.nft.json +1 -1
  86. package/.next/server/app/api/teams/files/route.js +1 -1
  87. package/.next/server/app/api/teams/files/route.js.nft.json +1 -1
  88. package/.next/server/app/api/teams/meta/route.js +1 -1
  89. package/.next/server/app/api/teams/meta/route.js.nft.json +1 -1
  90. package/.next/server/app/api/teams/remove-team/route.js +1 -1
  91. package/.next/server/app/api/teams/remove-team/route.js.nft.json +1 -1
  92. package/.next/server/app/api/teams/skills/install/route.js +1 -1
  93. package/.next/server/app/api/teams/skills/install/route.js.nft.json +1 -1
  94. package/.next/server/app/api/teams/skills/route.js +1 -1
  95. package/.next/server/app/api/teams/skills/route.js.nft.json +1 -1
  96. package/.next/server/app/api/tickets/move/route.js +1 -1
  97. package/.next/server/app/api/tickets/move/route.js.nft.json +1 -1
  98. package/.next/server/app/channels/page.js +1 -1
  99. package/.next/server/app/channels/page.js.nft.json +1 -1
  100. package/.next/server/app/channels.html +2 -2
  101. package/.next/server/app/channels.rsc +1 -1
  102. package/.next/server/app/channels.segments/_full.segment.rsc +1 -1
  103. package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
  104. package/.next/server/app/channels.segments/_index.segment.rsc +1 -1
  105. package/.next/server/app/channels.segments/_tree.segment.rsc +1 -1
  106. package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +1 -1
  107. package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
  108. package/.next/server/app/cron-jobs/page.js +1 -1
  109. package/.next/server/app/cron-jobs/page.js.nft.json +1 -1
  110. package/.next/server/app/cron-jobs.html +1 -1
  111. package/.next/server/app/cron-jobs.rsc +1 -1
  112. package/.next/server/app/cron-jobs.segments/_full.segment.rsc +1 -1
  113. package/.next/server/app/cron-jobs.segments/_head.segment.rsc +1 -1
  114. package/.next/server/app/cron-jobs.segments/_index.segment.rsc +1 -1
  115. package/.next/server/app/cron-jobs.segments/_tree.segment.rsc +1 -1
  116. package/.next/server/app/cron-jobs.segments/cron-jobs/__PAGE__.segment.rsc +1 -1
  117. package/.next/server/app/cron-jobs.segments/cron-jobs.segment.rsc +1 -1
  118. package/.next/server/app/goals/[id]/page.js +1 -1
  119. package/.next/server/app/goals/[id]/page.js.nft.json +1 -1
  120. package/.next/server/app/goals/new/page.js +1 -1
  121. package/.next/server/app/goals/new/page.js.nft.json +1 -1
  122. package/.next/server/app/goals/new.html +2 -2
  123. package/.next/server/app/goals/new.rsc +1 -1
  124. package/.next/server/app/goals/new.segments/_full.segment.rsc +1 -1
  125. package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
  126. package/.next/server/app/goals/new.segments/_index.segment.rsc +1 -1
  127. package/.next/server/app/goals/new.segments/_tree.segment.rsc +1 -1
  128. package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +1 -1
  129. package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
  130. package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
  131. package/.next/server/app/goals/page.js +1 -1
  132. package/.next/server/app/goals/page.js.nft.json +1 -1
  133. package/.next/server/app/goals.html +1 -1
  134. package/.next/server/app/goals.rsc +1 -1
  135. package/.next/server/app/goals.segments/_full.segment.rsc +1 -1
  136. package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
  137. package/.next/server/app/goals.segments/_index.segment.rsc +1 -1
  138. package/.next/server/app/goals.segments/_tree.segment.rsc +1 -1
  139. package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +1 -1
  140. package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
  141. package/.next/server/app/page.js +3 -3
  142. package/.next/server/app/page.js.nft.json +1 -1
  143. package/.next/server/app/recipes/[id]/page.js +4 -3
  144. package/.next/server/app/recipes/[id]/page.js.nft.json +1 -1
  145. package/.next/server/app/recipes/page.js +4 -3
  146. package/.next/server/app/recipes/page.js.nft.json +1 -1
  147. package/.next/server/app/recipes/page_client-reference-manifest.js +1 -1
  148. package/.next/server/app/settings/page.js +1 -1
  149. package/.next/server/app/settings/page.js.nft.json +1 -1
  150. package/.next/server/app/settings.html +1 -1
  151. package/.next/server/app/settings.rsc +1 -1
  152. package/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  153. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  154. package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  155. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  156. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  157. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  158. package/.next/server/app/teams/[teamId]/page.js +3 -3
  159. package/.next/server/app/teams/[teamId]/page.js.nft.json +1 -1
  160. package/.next/server/app/tickets/[ticket]/page.js +2 -2
  161. package/.next/server/app/tickets/[ticket]/page.js.nft.json +1 -1
  162. package/.next/server/app/tickets/page.js +2 -2
  163. package/.next/server/app/tickets/page.js.nft.json +1 -1
  164. package/.next/server/app/tickets.html +1 -1
  165. package/.next/server/app/tickets.rsc +2 -2
  166. package/.next/server/app/tickets.segments/_full.segment.rsc +2 -2
  167. package/.next/server/app/tickets.segments/_head.segment.rsc +1 -1
  168. package/.next/server/app/tickets.segments/_index.segment.rsc +1 -1
  169. package/.next/server/app/tickets.segments/_tree.segment.rsc +1 -1
  170. package/.next/server/app/tickets.segments/tickets/__PAGE__.segment.rsc +1 -1
  171. package/.next/server/app/tickets.segments/tickets.segment.rsc +1 -1
  172. package/.next/server/chunks/[root-of-the-server]__055885ce._.js +3 -0
  173. package/.next/server/chunks/[root-of-the-server]__055885ce._.js.map +1 -0
  174. package/.next/server/chunks/[root-of-the-server]__0c01c5c7._.js +10 -0
  175. package/.next/server/chunks/[root-of-the-server]__0c01c5c7._.js.map +1 -0
  176. package/.next/server/chunks/[root-of-the-server]__1398a33a._.js +3 -0
  177. package/.next/server/chunks/[root-of-the-server]__1398a33a._.js.map +1 -0
  178. package/.next/server/chunks/[root-of-the-server]__159c002b._.js +8 -0
  179. package/.next/server/chunks/[root-of-the-server]__159c002b._.js.map +1 -0
  180. package/.next/server/chunks/[root-of-the-server]__20c60fb7._.js +3 -0
  181. package/.next/server/chunks/[root-of-the-server]__20c60fb7._.js.map +1 -0
  182. package/.next/server/chunks/[root-of-the-server]__2588560d._.js +6 -0
  183. package/.next/server/chunks/[root-of-the-server]__2588560d._.js.map +1 -0
  184. package/.next/server/chunks/[root-of-the-server]__27293e91._.js +3 -0
  185. package/.next/server/chunks/[root-of-the-server]__27293e91._.js.map +1 -0
  186. package/.next/server/chunks/[root-of-the-server]__29c85a51._.js +3 -0
  187. package/.next/server/chunks/[root-of-the-server]__29c85a51._.js.map +1 -0
  188. package/.next/server/chunks/[root-of-the-server]__29fa8108._.js +3 -0
  189. package/.next/server/chunks/[root-of-the-server]__29fa8108._.js.map +1 -0
  190. package/.next/server/chunks/[root-of-the-server]__2bd44067._.js +3 -0
  191. package/.next/server/chunks/[root-of-the-server]__2bd44067._.js.map +1 -0
  192. package/.next/server/chunks/[root-of-the-server]__2dd1afff._.js +3 -0
  193. package/.next/server/chunks/[root-of-the-server]__2dd1afff._.js.map +1 -0
  194. package/.next/server/chunks/[root-of-the-server]__401ab759._.js +3 -0
  195. package/.next/server/chunks/[root-of-the-server]__401ab759._.js.map +1 -0
  196. package/.next/server/chunks/[root-of-the-server]__422c7160._.js +3 -0
  197. package/.next/server/chunks/[root-of-the-server]__422c7160._.js.map +1 -0
  198. package/.next/server/chunks/[root-of-the-server]__4670294e._.js +3 -0
  199. package/.next/server/chunks/[root-of-the-server]__4670294e._.js.map +1 -0
  200. package/.next/server/chunks/[root-of-the-server]__4898071c._.js +1 -1
  201. package/.next/server/chunks/[root-of-the-server]__4898071c._.js.map +1 -1
  202. package/.next/server/chunks/[root-of-the-server]__4eda99a9._.js +3 -0
  203. package/.next/server/chunks/[root-of-the-server]__4eda99a9._.js.map +1 -0
  204. package/.next/server/chunks/[root-of-the-server]__54478298._.js +8 -0
  205. package/.next/server/chunks/[root-of-the-server]__54478298._.js.map +1 -0
  206. package/.next/server/chunks/[root-of-the-server]__6dbdb384._.js +3 -0
  207. package/.next/server/chunks/[root-of-the-server]__6dbdb384._.js.map +1 -0
  208. package/.next/server/chunks/{[root-of-the-server]__dc6c67a5._.js → [root-of-the-server]__74b80ca4._.js} +2 -2
  209. package/.next/server/chunks/[root-of-the-server]__94d68aa3._.js +3 -0
  210. package/.next/server/chunks/[root-of-the-server]__94d68aa3._.js.map +1 -0
  211. package/.next/server/chunks/[root-of-the-server]__9ecbb339._.js +3 -0
  212. package/.next/server/chunks/[root-of-the-server]__9ecbb339._.js.map +1 -0
  213. package/.next/server/chunks/[root-of-the-server]__a27f8405._.js +3 -0
  214. package/.next/server/chunks/[root-of-the-server]__a27f8405._.js.map +1 -0
  215. package/.next/server/chunks/[root-of-the-server]__a6ac3ddf._.js +3 -0
  216. package/.next/server/chunks/[root-of-the-server]__a6ac3ddf._.js.map +1 -0
  217. package/.next/server/chunks/[root-of-the-server]__b11231a9._.js +3 -0
  218. package/.next/server/chunks/[root-of-the-server]__b11231a9._.js.map +1 -0
  219. package/.next/server/chunks/[root-of-the-server]__b59b3cdd._.js +3 -0
  220. package/.next/server/chunks/[root-of-the-server]__b59b3cdd._.js.map +1 -0
  221. package/.next/server/chunks/{[root-of-the-server]__94ebcd84._.js → [root-of-the-server]__b5c2b370._.js} +2 -2
  222. package/.next/server/chunks/[root-of-the-server]__b955e35a._.js +3 -0
  223. package/.next/server/chunks/[root-of-the-server]__b955e35a._.js.map +1 -0
  224. package/.next/server/chunks/{[root-of-the-server]__920d7db4._.js → [root-of-the-server]__be5f57b2._.js} +2 -2
  225. package/.next/server/chunks/[root-of-the-server]__c4ff0427._.js +3 -0
  226. package/.next/server/chunks/[root-of-the-server]__c4ff0427._.js.map +1 -0
  227. package/.next/server/chunks/[root-of-the-server]__c4ffbb03._.js +3 -0
  228. package/.next/server/chunks/[root-of-the-server]__c4ffbb03._.js.map +1 -0
  229. package/.next/server/chunks/[root-of-the-server]__d737ca42._.js +3 -0
  230. package/.next/server/chunks/[root-of-the-server]__d737ca42._.js.map +1 -0
  231. package/.next/server/chunks/[root-of-the-server]__df7df3ac._.js +3 -0
  232. package/.next/server/chunks/[root-of-the-server]__df7df3ac._.js.map +1 -0
  233. package/.next/server/chunks/[root-of-the-server]__dfca6557._.js +3 -0
  234. package/.next/server/chunks/[root-of-the-server]__dfca6557._.js.map +1 -0
  235. package/.next/server/chunks/[root-of-the-server]__e6184ba3._.js +3 -0
  236. package/.next/server/chunks/[root-of-the-server]__e6184ba3._.js.map +1 -0
  237. package/.next/server/chunks/[root-of-the-server]__ed0323e9._.js +8 -0
  238. package/.next/server/chunks/[root-of-the-server]__ed0323e9._.js.map +1 -0
  239. package/.next/server/chunks/[root-of-the-server]__f585823b._.js +6 -0
  240. package/.next/server/chunks/[root-of-the-server]__f585823b._.js.map +1 -0
  241. package/.next/server/chunks/[root-of-the-server]__ff940674._.js +3 -0
  242. package/.next/server/chunks/[root-of-the-server]__ff940674._.js.map +1 -0
  243. package/.next/server/chunks/src_lib_d2210cbf._.js +3 -0
  244. package/.next/server/chunks/src_lib_d2210cbf._.js.map +1 -0
  245. package/.next/server/chunks/ssr/[root-of-the-server]__4393e897._.js +3 -0
  246. package/.next/server/chunks/ssr/[root-of-the-server]__4393e897._.js.map +1 -0
  247. package/.next/server/chunks/ssr/{[root-of-the-server]__ae77070e._.js → [root-of-the-server]__4c6cc96d._.js} +2 -2
  248. package/.next/server/chunks/ssr/[root-of-the-server]__4c6cc96d._.js.map +1 -0
  249. package/.next/server/chunks/ssr/{[root-of-the-server]__b6de1782._.js → [root-of-the-server]__507d2fc9._.js} +2 -2
  250. package/.next/server/chunks/ssr/{[root-of-the-server]__c72e7548._.js → [root-of-the-server]__7180d770._.js} +2 -2
  251. package/.next/server/chunks/ssr/[root-of-the-server]__7180d770._.js.map +1 -0
  252. package/.next/server/chunks/ssr/[root-of-the-server]__82ce3aee._.js +3 -0
  253. package/.next/server/chunks/ssr/[root-of-the-server]__82ce3aee._.js.map +1 -0
  254. package/.next/server/chunks/ssr/[root-of-the-server]__8d24c9c3._.js +3 -0
  255. package/.next/server/chunks/ssr/[root-of-the-server]__8d24c9c3._.js.map +1 -0
  256. package/.next/server/chunks/ssr/[root-of-the-server]__bc3b27b0._.js +3 -0
  257. package/.next/server/chunks/ssr/[root-of-the-server]__bc3b27b0._.js.map +1 -0
  258. package/.next/server/chunks/ssr/{[root-of-the-server]__72721a7e._.js → [root-of-the-server]__f75a61bf._.js} +2 -2
  259. package/.next/server/chunks/ssr/_1aad1d9b._.js +24 -0
  260. package/.next/server/chunks/ssr/_1aad1d9b._.js.map +1 -0
  261. package/.next/server/chunks/ssr/{node_modules_next_aefa2538._.js → _da6f800e._.js} +2 -2
  262. package/.next/server/chunks/ssr/_da6f800e._.js.map +1 -0
  263. package/.next/server/chunks/ssr/src_app_agents_[agentId]_agent-editor_tsx_f85bbe65._.js +1 -1
  264. package/.next/server/chunks/ssr/src_app_agents_[agentId]_agent-editor_tsx_f85bbe65._.js.map +1 -1
  265. package/.next/server/chunks/ssr/src_app_recipes_recipes-client_tsx_8ed3ca94._.js +1 -1
  266. package/.next/server/chunks/ssr/src_app_recipes_recipes-client_tsx_8ed3ca94._.js.map +1 -1
  267. package/.next/server/pages/404.html +1 -1
  268. package/.next/server/pages/500.html +2 -2
  269. package/.next/static/chunks/{a33f8641aafb9e7f.js → 54beb791bcc086ae.js} +1 -1
  270. package/.next/static/chunks/55866d57aa2c7a9c.js +1 -0
  271. package/openclaw/index.ts +4 -0
  272. package/openclaw.plugin.json +1 -1
  273. package/package.json +1 -1
  274. package/src/app/agents/[agentId]/agent-editor.tsx +66 -23
  275. package/src/app/api/agents/[id]/route.ts +37 -0
  276. package/src/app/api/agents/add/route.ts +7 -7
  277. package/src/app/api/agents/files/route.ts +3 -1
  278. package/src/app/api/agents/skills/install/route.ts +27 -3
  279. package/src/app/api/agents/skills/route.ts +28 -12
  280. package/src/app/api/goals/[id]/promote/route.ts +12 -18
  281. package/src/app/api/recipes/team-agents/route.ts +1 -1
  282. package/src/app/api/teams/skills/install/route.ts +3 -1
  283. package/src/app/api/tickets/move/route.ts +3 -4
  284. package/src/app/recipes/[id]/page.tsx +7 -0
  285. package/src/app/recipes/page.tsx +7 -0
  286. package/src/app/recipes/recipes-client.tsx +0 -5
  287. package/src/lib/agent-workspace.ts +14 -0
  288. package/src/lib/gateway.ts +5 -8
  289. package/src/lib/kitchen-api.ts +19 -0
  290. package/src/lib/openclaw.ts +28 -26
  291. package/src/lib/paths.ts +4 -3
  292. package/src/proxy.ts +2 -2
  293. package/.next/server/app/recipes.html +0 -1
  294. package/.next/server/app/recipes.meta +0 -15
  295. package/.next/server/app/recipes.rsc +0 -21
  296. package/.next/server/app/recipes.segments/_full.segment.rsc +0 -21
  297. package/.next/server/app/recipes.segments/_head.segment.rsc +0 -6
  298. package/.next/server/app/recipes.segments/_index.segment.rsc +0 -6
  299. package/.next/server/app/recipes.segments/_tree.segment.rsc +0 -4
  300. package/.next/server/app/recipes.segments/recipes/__PAGE__.segment.rsc +0 -10
  301. package/.next/server/app/recipes.segments/recipes.segment.rsc +0 -4
  302. package/.next/server/chunks/[root-of-the-server]__02ebb205._.js +0 -3
  303. package/.next/server/chunks/[root-of-the-server]__02ebb205._.js.map +0 -1
  304. package/.next/server/chunks/[root-of-the-server]__0761ac0a._.js +0 -3
  305. package/.next/server/chunks/[root-of-the-server]__0761ac0a._.js.map +0 -1
  306. package/.next/server/chunks/[root-of-the-server]__0a87d140._.js +0 -3
  307. package/.next/server/chunks/[root-of-the-server]__0a87d140._.js.map +0 -1
  308. package/.next/server/chunks/[root-of-the-server]__13e03a23._.js +0 -8
  309. package/.next/server/chunks/[root-of-the-server]__13e03a23._.js.map +0 -1
  310. package/.next/server/chunks/[root-of-the-server]__16252fca._.js +0 -3
  311. package/.next/server/chunks/[root-of-the-server]__16252fca._.js.map +0 -1
  312. package/.next/server/chunks/[root-of-the-server]__1ab15cc6._.js +0 -3
  313. package/.next/server/chunks/[root-of-the-server]__1ab15cc6._.js.map +0 -1
  314. package/.next/server/chunks/[root-of-the-server]__1cb96385._.js +0 -3
  315. package/.next/server/chunks/[root-of-the-server]__1cb96385._.js.map +0 -1
  316. package/.next/server/chunks/[root-of-the-server]__20cb8aee._.js +0 -3
  317. package/.next/server/chunks/[root-of-the-server]__20cb8aee._.js.map +0 -1
  318. package/.next/server/chunks/[root-of-the-server]__22a29d25._.js +0 -6
  319. package/.next/server/chunks/[root-of-the-server]__22a29d25._.js.map +0 -1
  320. package/.next/server/chunks/[root-of-the-server]__2369d373._.js +0 -3
  321. package/.next/server/chunks/[root-of-the-server]__2369d373._.js.map +0 -1
  322. package/.next/server/chunks/[root-of-the-server]__24fa7b94._.js +0 -3
  323. package/.next/server/chunks/[root-of-the-server]__24fa7b94._.js.map +0 -1
  324. package/.next/server/chunks/[root-of-the-server]__2c9b0df9._.js +0 -3
  325. package/.next/server/chunks/[root-of-the-server]__2c9b0df9._.js.map +0 -1
  326. package/.next/server/chunks/[root-of-the-server]__2ffbbf0e._.js +0 -3
  327. package/.next/server/chunks/[root-of-the-server]__2ffbbf0e._.js.map +0 -1
  328. package/.next/server/chunks/[root-of-the-server]__394097c4._.js +0 -3
  329. package/.next/server/chunks/[root-of-the-server]__394097c4._.js.map +0 -1
  330. package/.next/server/chunks/[root-of-the-server]__457a879e._.js +0 -3
  331. package/.next/server/chunks/[root-of-the-server]__457a879e._.js.map +0 -1
  332. package/.next/server/chunks/[root-of-the-server]__4ae35c7d._.js +0 -3
  333. package/.next/server/chunks/[root-of-the-server]__4ae35c7d._.js.map +0 -1
  334. package/.next/server/chunks/[root-of-the-server]__4d1845bd._.js +0 -3
  335. package/.next/server/chunks/[root-of-the-server]__4d1845bd._.js.map +0 -1
  336. package/.next/server/chunks/[root-of-the-server]__593499ba._.js +0 -3
  337. package/.next/server/chunks/[root-of-the-server]__593499ba._.js.map +0 -1
  338. package/.next/server/chunks/[root-of-the-server]__69bcd4b9._.js +0 -3
  339. package/.next/server/chunks/[root-of-the-server]__69bcd4b9._.js.map +0 -1
  340. package/.next/server/chunks/[root-of-the-server]__7f23701b._.js +0 -3
  341. package/.next/server/chunks/[root-of-the-server]__7f23701b._.js.map +0 -1
  342. package/.next/server/chunks/[root-of-the-server]__8f127b48._.js +0 -3
  343. package/.next/server/chunks/[root-of-the-server]__8f127b48._.js.map +0 -1
  344. package/.next/server/chunks/[root-of-the-server]__93e05771._.js +0 -3
  345. package/.next/server/chunks/[root-of-the-server]__93e05771._.js.map +0 -1
  346. package/.next/server/chunks/[root-of-the-server]__9a65704e._.js +0 -3
  347. package/.next/server/chunks/[root-of-the-server]__9a65704e._.js.map +0 -1
  348. package/.next/server/chunks/[root-of-the-server]__b76a826e._.js +0 -3
  349. package/.next/server/chunks/[root-of-the-server]__b76a826e._.js.map +0 -1
  350. package/.next/server/chunks/[root-of-the-server]__baf1631b._.js +0 -3
  351. package/.next/server/chunks/[root-of-the-server]__baf1631b._.js.map +0 -1
  352. package/.next/server/chunks/[root-of-the-server]__bfd1044e._.js +0 -8
  353. package/.next/server/chunks/[root-of-the-server]__bfd1044e._.js.map +0 -1
  354. package/.next/server/chunks/[root-of-the-server]__c4a25b8f._.js +0 -3
  355. package/.next/server/chunks/[root-of-the-server]__c4a25b8f._.js.map +0 -1
  356. package/.next/server/chunks/[root-of-the-server]__c4e76686._.js +0 -3
  357. package/.next/server/chunks/[root-of-the-server]__c4e76686._.js.map +0 -1
  358. package/.next/server/chunks/[root-of-the-server]__c6906128._.js +0 -3
  359. package/.next/server/chunks/[root-of-the-server]__c6906128._.js.map +0 -1
  360. package/.next/server/chunks/[root-of-the-server]__c8eb444c._.js +0 -8
  361. package/.next/server/chunks/[root-of-the-server]__c8eb444c._.js.map +0 -1
  362. package/.next/server/chunks/[root-of-the-server]__e28b8399._.js +0 -3
  363. package/.next/server/chunks/[root-of-the-server]__e28b8399._.js.map +0 -1
  364. package/.next/server/chunks/[root-of-the-server]__e31f8972._.js +0 -10
  365. package/.next/server/chunks/[root-of-the-server]__e31f8972._.js.map +0 -1
  366. package/.next/server/chunks/[root-of-the-server]__fee3f59e._.js +0 -3
  367. package/.next/server/chunks/[root-of-the-server]__fee3f59e._.js.map +0 -1
  368. package/.next/server/chunks/[root-of-the-server]__fff0b9c4._.js +0 -6
  369. package/.next/server/chunks/[root-of-the-server]__fff0b9c4._.js.map +0 -1
  370. package/.next/server/chunks/ssr/[root-of-the-server]__277a8350._.js +0 -3
  371. package/.next/server/chunks/ssr/[root-of-the-server]__277a8350._.js.map +0 -1
  372. package/.next/server/chunks/ssr/[root-of-the-server]__7458e8cf._.js +0 -3
  373. package/.next/server/chunks/ssr/[root-of-the-server]__7458e8cf._.js.map +0 -1
  374. package/.next/server/chunks/ssr/[root-of-the-server]__8aa0b951._.js +0 -3
  375. package/.next/server/chunks/ssr/[root-of-the-server]__8aa0b951._.js.map +0 -1
  376. package/.next/server/chunks/ssr/[root-of-the-server]__91b2c698._.js +0 -3
  377. package/.next/server/chunks/ssr/[root-of-the-server]__91b2c698._.js.map +0 -1
  378. package/.next/server/chunks/ssr/[root-of-the-server]__ae77070e._.js.map +0 -1
  379. package/.next/server/chunks/ssr/[root-of-the-server]__c72e7548._.js.map +0 -1
  380. package/.next/server/chunks/ssr/node_modules_next_aefa2538._.js.map +0 -1
  381. package/.next/static/chunks/4fb7740933125c6a.js +0 -1
  382. /package/.next/server/chunks/{[root-of-the-server]__dc6c67a5._.js.map → [root-of-the-server]__74b80ca4._.js.map} +0 -0
  383. /package/.next/server/chunks/{[root-of-the-server]__94ebcd84._.js.map → [root-of-the-server]__b5c2b370._.js.map} +0 -0
  384. /package/.next/server/chunks/{[root-of-the-server]__920d7db4._.js.map → [root-of-the-server]__be5f57b2._.js.map} +0 -0
  385. /package/.next/server/chunks/ssr/{[root-of-the-server]__b6de1782._.js.map → [root-of-the-server]__507d2fc9._.js.map} +0 -0
  386. /package/.next/server/chunks/ssr/{[root-of-the-server]__72721a7e._.js.map → [root-of-the-server]__f75a61bf._.js.map} +0 -0
  387. /package/.next/static/{8pxUnfVjZMQrso_jWABg7 → uZkSG3UgZ81MwaAQa74zD}/_buildManifest.js +0 -0
  388. /package/.next/static/{8pxUnfVjZMQrso_jWABg7 → uZkSG3UgZ81MwaAQa74zD}/_clientMiddlewareManifest.json +0 -0
  389. /package/.next/static/{8pxUnfVjZMQrso_jWABg7 → uZkSG3UgZ81MwaAQa74zD}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/paths.ts","../../../src/lib/goals.ts","../../../src/app/api/goals/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import fs from \"node:fs/promises\";\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(process.env.HOME || \"\", \".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 = process.env.HOME || \"\";\n if (!home) throw new Error(\"HOME is not set\");\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 { NextResponse } from \"next/server\";\nimport { listGoals, writeGoal } from \"@/lib/goals\";\n\nexport async function GET() {\n try {\n const goals = await listGoals();\n return NextResponse.json({ goals });\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : String(e);\n return NextResponse.json({ error: msg }, { status: 500 });\n }\n}\n\ntype GoalWriteBody = {\n id: string;\n title: string;\n status?: \"planned\" | \"active\" | \"done\";\n tags?: string[];\n teams?: string[];\n body?: string;\n};\n\nexport async function POST(req: Request) {\n try {\n const body = (await req.json()) as GoalWriteBody;\n const id = String(body?.id ?? \"\").trim();\n const title = String(body?.title ?? \"\").trim();\n if (!id || !title) {\n return NextResponse.json({ error: \"id and title are required\" }, { status: 400 });\n }\n\n const result = await writeGoal({\n id,\n title,\n status: body?.status,\n tags: Array.isArray(body?.tags) ? body.tags : [],\n teams: Array.isArray(body?.teams) ? body.teams : [],\n body: String(body?.body ?? \"\"),\n });\n\n return NextResponse.json({ goal: result.frontmatter });\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/route\",\n pathname: \"/api/goals\",\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/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/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":"0oCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAiBO,eAAe,IACpB,IAAM,EAAI,EAAA,OAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,EAAI,GAAI,YAAa,iBAEzD,OAAO,KAAK,KAAK,CAAC,AADL,MAAM,EAAA,OAAE,CAAC,QAAQ,CAAC,EAAG,QAEpC,CAEO,eAAe,IACpB,IAAM,EAAM,MAAM,IACZ,EAAK,EAAI,MAAM,EAAE,UAAU,UACjC,GAAI,CAAC,EAAI,MAAM,AAAI,MAAM,qEACzB,OAAO,CACT,CAEO,eAAe,IACpB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AAiB,CAAA,EAAA,EAAA,qBAAA,AAAqB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAY,AAAZ,EAAa,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":[3]}
@@ -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"))},74533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},12057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},16328,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),a=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),p=e.i(47587),c=e.i(66012),x=e.i(70101),h=e.i(26937),R=e.i(10372),v=e.i(93695);e.i(52474);var m=e.i(220),g=e.i(89171),f=e.i(74533);let w=(0,e.i(12057).promisify)(f.execFile);async function E(e){try{let t=await e.json(),r=String(t.ticket??"").trim(),n=String(t.to??"").trim();if(!r)return g.NextResponse.json({ok:!1,error:"Missing ticket"},{status:400});if(!n||!["backlog","in-progress","testing","done"].includes(n))return g.NextResponse.json({ok:!1,error:"Invalid destination stage"},{status:400});let a=["recipes","move-ticket","--team-id","development-team","--ticket",r,"--to",n,"--yes"];return await w("openclaw",a,{timeout:3e4}),g.NextResponse.json({ok:!0})}catch(t){let e=t instanceof Error?t.message:String(t);return g.NextResponse.json({ok:!1,error:e},{status:500})}}e.s(["POST",()=>E],9749);var y=e.i(9749);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tickets/move/route",pathname:"/api/tickets/move",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/tickets/move/route.ts",nextConfigOutput:"standalone",userland:y}),{workAsyncStorage:k,workUnitAsyncStorage:A,serverHooks:b}=C;function N(){return(0,n.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:A})}async function T(e,t,n){C.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/tickets/move/route";g=g.replace(/\/index$/,"")||"/";let f=await C.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!f)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:E,nextConfig:y,parsedUrl:k,isDraftMode:A,prerenderManifest:b,routerServerContext:N,isOnDemandRevalidate:T,revalidateOnlyGenerated:P,resolvedPathname:S,clientReferenceManifest:j,serverActionsManifest:q}=f,O=(0,i.normalizeAppPath)(g),_=!!(b.dynamicRoutes[O]||b.routes[S]),H=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,k,!1):t.end("This page could not be found"),null);if(_&&!A){let e=!!b.routes[S],t=b.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await H();throw new v.NoFallbackError}}let I=null;!_||C.isDev||A||(I="/index"===(I=S)?"/":I);let U=!0===C.isDev||!_,D=_&&!U;q&&j&&(0,o.setManifestsSingleton)({page:g,clientReferenceManifest:j,serverActionsManifest:q});let M=e.method||"GET",F=(0,s.getTracer)(),$=F.getActiveScopeSpan(),K={params:E,prerenderManifest:b,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>C.onRequestError(e,t,n,a,N)},sharedContext:{buildId:w}},B=new l.NodeNextRequest(e),L=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(B,(0,d.signalFromNodeResponse)(t));try{let o=async e=>C.handle(G,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")!==u.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=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${g}`)}),i=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var s,l;let d=async({previousCacheEntry:r})=>{try{if(!i&&T&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(a);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=K.renderOpts.collectedTags;if(!_)return await (0,c.sendResponse)(B,L,s,K.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(s.headers);d&&(t[R.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=R.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,N),t}},u=await C.handleResponse({req:e,nextConfig:y,cacheKey:I,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:P,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:i});if(!_)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});i||t.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let v=(0,x.fromNodeOutgoingHttpHeaders)(u.value.headers);return i&&_||v.delete(R.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||v.get("Cache-Control")||v.set("Cache-Control",(0,h.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(B,L,new Response(u.value.body,{headers:v,status:u.value.status||200})),null};$?await l($):await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${g}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof v.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,N),_)throw t;return await (0,c.sendResponse)(B,L,new Response(null,{status:500})),null}}e.s(["handler",()=>T,"patchFetch",()=>N,"routeModule",()=>C,"serverHooks",()=>b,"workAsyncStorage",()=>k,"workUnitAsyncStorage",()=>A],16328)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__c4a25b8f._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/app/api/tickets/move/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { NextResponse } from \"next/server\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nconst execFileAsync = promisify(execFile);\n\nexport async function POST(req: Request) {\n try {\n const body = await req.json();\n const ticket = String(body.ticket ?? \"\").trim();\n const to = String(body.to ?? \"\").trim();\n\n if (!ticket) {\n return NextResponse.json({ ok: false, error: \"Missing ticket\" }, { status: 400 });\n }\n if (!to || ![\"backlog\", \"in-progress\", \"testing\", \"done\"].includes(to)) {\n return NextResponse.json({ ok: false, error: \"Invalid destination stage\" }, { status: 400 });\n }\n\n const args = [\n \"recipes\",\n \"move-ticket\",\n \"--team-id\",\n \"development-team\",\n \"--ticket\",\n ticket,\n \"--to\",\n to,\n \"--yes\",\n ];\n\n await execFileAsync(\"openclaw\", args, { timeout: 30_000 });\n\n return NextResponse.json({ ok: true });\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : String(err);\n return NextResponse.json({ ok: false, error: message }, { status: 500 });\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/tickets/move/route\",\n pathname: \"/api/tickets/move\",\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/tickets/move/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/tickets/move/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":"+oCCAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,KDhBA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGA,IAAM,EAAgB,CAAA,EAAA,AAFtB,EAAA,CAAA,CAAA,OAEsB,SAAA,AAAS,EAAC,EAAA,QAAQ,EAEjC,eAAe,EAAK,CAAY,EACrC,GAAI,CACF,IAAM,EAAO,MAAM,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B,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":[1]}
@@ -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"))},74533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},12057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},5003,e=>{"use strict";var t=e.i(74533);let r=(0,e.i(12057).promisify)(t.execFile);async function n(e){try{let{stdout:t,stderr:n}=await r("openclaw",e,{maxBuffer:0xa00000,env:process.env});return{ok:!0,exitCode:0,stdout:t?.toString()??"",stderr:n?.toString()??""}}catch(t){let e="number"==typeof t.code?t.code:1;return{ok:!1,exitCode:e,stdout:"string"==typeof t.stdout?t.stdout:t.stdout&&"object"==typeof t.stdout&&"toString"in t.stdout?String(t.stdout.toString()):"",stderr:"string"==typeof t.stderr?t.stderr:t.stderr&&"object"==typeof t.stderr&&"toString"in t.stderr?String(t.stderr.toString()):"string"==typeof t.message?t.message:String(t)}}}e.s(["runOpenClaw",()=>n])},64145,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),a=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),p=e.i(47587),c=e.i(66012),x=e.i(70101),h=e.i(26937),g=e.i(10372),R=e.i(93695);e.i(52474);var v=e.i(220),f=e.i(89171),m=e.i(5003);async function w(){try{let{stdout:e,stderr:t}=await (0,m.runOpenClaw)(["agents","list","--json"]),r=JSON.parse(e);return f.NextResponse.json({agents:r,stderr:t||void 0})}catch(e){return f.NextResponse.json({error:"Failed to list agents",message:e instanceof Error?e.message:String(e)},{status:500})}}e.s(["GET",()=>w],62603);var y=e.i(62603);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/agents/route",pathname:"/api/agents",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/agents/route.ts",nextConfigOutput:"standalone",userland:y}),{workAsyncStorage:C,workUnitAsyncStorage:b,serverHooks:S}=E;function A(){return(0,n.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:b})}async function N(e,t,n){E.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/agents/route";f=f.replace(/\/index$/,"")||"/";let m=await E.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:C,parsedUrl:b,isDraftMode:S,prerenderManifest:A,routerServerContext:N,isOnDemandRevalidate:T,revalidateOnlyGenerated:O,resolvedPathname:k,clientReferenceManifest:P,serverActionsManifest:j}=m,q=(0,i.normalizeAppPath)(f),_=!!(A.dynamicRoutes[q]||A.routes[k]),H=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,b,!1):t.end("This page could not be found"),null);if(_&&!S){let e=!!A.routes[k],t=A.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(C.experimental.adapterPath)return await H();throw new R.NoFallbackError}}let U=null;!_||E.isDev||S||(U="/index"===(U=k)?"/":U);let I=!0===E.isDev||!_,D=_&&!I;j&&P&&(0,o.setManifestsSingleton)({page:f,clientReferenceManifest:P,serverActionsManifest:j});let M=e.method||"GET",F=(0,s.getTracer)(),$=F.getActiveScopeSpan(),K={params:y,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:I,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:C.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>E.onRequestError(e,t,n,a,N)},sharedContext:{buildId:w}},B=new l.NodeNextRequest(e),L=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(B,(0,d.signalFromNodeResponse)(t));try{let o=async e=>E.handle(G,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")!==u.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=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${f}`)}),i=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var s,l;let d=async({previousCacheEntry:r})=>{try{if(!i&&T&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(a);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=K.renderOpts.collectedTags;if(!_)return await (0,c.sendResponse)(B,L,s,K.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(s.headers);d&&(t[g.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,N),t}},u=await E.handleResponse({req:e,nextConfig:C,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:O,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:i});if(!_)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});i||t.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let R=(0,x.fromNodeOutgoingHttpHeaders)(u.value.headers);return i&&_||R.delete(g.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||R.get("Cache-Control")||R.set("Cache-Control",(0,h.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(B,L,new Response(u.value.body,{headers:R,status:u.value.status||200})),null};$?await l($):await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${f}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof R.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,N),_)throw t;return await (0,c.sendResponse)(B,L,new Response(null,{status:500})),null}}e.s(["handler",()=>N,"patchFetch",()=>A,"routeModule",()=>E,"serverHooks",()=>S,"workAsyncStorage",()=>C,"workUnitAsyncStorage",()=>b],64145)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__c4e76686._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/openclaw.ts","../../../src/app/api/agents/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nconst execFileAsync = promisify(execFile);\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 // Use execFile (no shell) for safety.\n try {\n const { stdout, stderr } = await execFileAsync(\"openclaw\", args, {\n maxBuffer: 10 * 1024 * 1024,\n env: process.env,\n });\n return { ok: true, exitCode: 0, stdout: stdout?.toString() ?? \"\", stderr: stderr?.toString() ?? \"\" };\n } catch (e: unknown) {\n // execFile throws on non-zero exit; it often includes stdout/stderr.\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n\n const stdout =\n typeof err.stdout === \"string\" ? err.stdout : err.stdout && typeof err.stdout === \"object\" && \"toString\" in err.stdout\n ? String((err.stdout as { toString: () => string }).toString())\n : \"\";\n\n const stderr =\n typeof err.stderr === \"string\"\n ? err.stderr\n : err.stderr && typeof err.stderr === \"object\" && \"toString\" in err.stderr\n ? String((err.stderr as { toString: () => string }).toString())\n : typeof err.message === \"string\"\n ? err.message\n : String(e);\n\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n","import { NextResponse } from \"next/server\";\n\nimport { runOpenClaw } from \"@/lib/openclaw\";\n\ntype AgentListItem = {\n id: string;\n identityName?: string;\n workspace?: string;\n model?: string;\n isDefault?: boolean;\n};\n\nexport async function GET() {\n try {\n const { stdout, stderr } = await runOpenClaw([\"agents\", \"list\", \"--json\"]);\n\n const agents = JSON.parse(stdout) as AgentListItem[];\n\n return NextResponse.json({ agents, stderr: stderr || undefined });\n } catch (err) {\n return NextResponse.json(\n {\n error: \"Failed to list agents\",\n message: err instanceof Error ? err.message : String(err),\n },\n { status: 500 },\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/agents/route\",\n pathname: \"/api/agents\",\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/agents/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/agents/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":"8oCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAGA,IAAM,EAAgB,CAAA,EAAA,AAFtB,EAAA,CAAA,CAAA,OAEsB,SAAA,AAAS,EAAC,EAAA,QAAQ,EASjC,eAAe,EAAY,CAAc,EAE9C,GAAI,CACF,GAAM,QAAE,CAAM,QAAE,CAAM,CAAE,CAAG,MAAM,EAAc,WAAY,EAAM,CAC/D,UAAW,KAAK,IAChB,GADuB,CAClB,QAAQ,GAAG,AAClB,GACA,MAAO,CAAE,IAAI,EAAM,SAAU,EAAG,OAAQ,GAAQ,YAAc,GAAI,OAAQ,GAAQ,YAAc,EAAG,CACrG,CAAE,MAAO,EAAY,CAGnB,IAAM,EAA+B,UAApB,OAAO,EAAI,IAAI,CAAgB,EAAI,IAAI,CAA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AAD,EAAkB,GACnB,EADwB,AAChB,GADmB,GACb,CAAC,EAAA,sBAAsB,GAIrC,EAAW,YAAY,EAAK,EAAD,AAAK,SAAS,CAAC,kBAAqB,EAAD,AAAS,GAAG,CAAC,kBAAkB,AAC7F,EAAQ,GAAG,CAAC,gBAAiB,CAAA,EAAA,EAAA,qBAAA,AAAqB,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":[2]}
@@ -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"))},7367,e=>{"use strict";var t=e.i(12714),r=e.i(50227);async function n(){let e=r.default.join(process.env.HOME||"",".openclaw","openclaw.json");return JSON.parse(await t.default.readFile(e,"utf8"))}async function a(){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 s(){let e=await a();return r.default.join(e,"recipes")}async function o(){let e=await a();return r.default.join(e,"notes","goals")}async function i(e){let t=process.env.HOME||"";if(!t)throw Error("HOME is not set");return r.default.join(t,".openclaw",`workspace-${e}`)}async function l(){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 r.default.join(t,"recipes","default")}e.s(["getBuiltinRecipesDir",()=>l,"getTeamWorkspaceDir",()=>i,"getWorkspaceDir",()=>a,"getWorkspaceGoalsDir",()=>o,"getWorkspaceRecipesDir",()=>s,"readOpenClawConfig",()=>n])},76509,e=>{"use strict";var t=e.i(7367);async function r(){let e=(process.env.OPENCLAW_GATEWAY_HTTP_URL||process.env.OPENCLAW_GATEWAY_URL||"").trim(),r=(process.env.OPENCLAW_GATEWAY_TOKEN||"").trim(),n=await (0,t.readOpenClawConfig)(),a=n.gateway?.port??18789,s=r||n.gateway?.auth?.token;if(!s)throw Error("Missing gateway token. Set OPENCLAW_GATEWAY_TOKEN or gateway.auth.token in ~/.openclaw/openclaw.json");return{baseUrl:e||`http://127.0.0.1:${a}`,token:s}}async function n(e){let{baseUrl:t,token:n}=await r(),a=await fetch(`${t}/tools/invoke`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${n}`},body:JSON.stringify(e)}),s=await a.json();if(!a.ok||!s.ok)throw Error("object"==typeof s.error&&s.error?.message||("string"==typeof s.error?s.error:null)||`tools/invoke failed (${a.status})`);return s.result}async function a(){let e=await n({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),a=String(r?.result?.raw??""),s=String(r?.result?.hash??"");if(!a)throw Error("gateway config.get: missing result.raw");if(!s)throw Error("gateway config.get: missing result.hash");return{raw:a,hash:s}}async function s(e,t){let{hash:r}=await a();return n({tool:"gateway",args:{action:"config.patch",raw:JSON.stringify(e,null,2),baseHash:r,note:t??"ClawKitchen settings update",restartDelayMs:1e3}})}e.s(["gatewayConfigGet",()=>a,"gatewayConfigPatch",()=>s,"toolsInvoke",()=>n])},64937,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),a=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),c=e.i(95169),p=e.i(47587),d=e.i(66012),g=e.i(70101),h=e.i(26937),f=e.i(10372),w=e.i(93695);e.i(52474);var x=e.i(220),y=e.i(89171),R=e.i(76509);function E(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}async function v(){try{let{raw:e,hash:t}=await (0,R.gatewayConfigGet)(),r=function(e){try{return JSON.parse(e)}catch{return null}}(e),n=E(r)?r:{},a=E(n.channels)?n.channels:{};return y.NextResponse.json({ok:!0,hash:t,channels:a})}catch(t){let e=t instanceof Error?t.message:String(t);return y.NextResponse.json({ok:!1,error:e},{status:500})}}async function m(e){try{let t=await e.json(),r=String(t?.provider??"").trim();if(!r)return y.NextResponse.json({ok:!1,error:"provider is required"},{status:400});let n=E(t?.config)?t.config:null;if(!n)return y.NextResponse.json({ok:!1,error:"config must be an object"},{status:400});if("telegram"===r&&!String(n.botToken??"").trim())return y.NextResponse.json({ok:!1,error:"telegram.botToken is required"},{status:400});return await (0,R.gatewayConfigPatch)({channels:{[r]:n}},`ClawKitchen Channels upsert: ${r}`),y.NextResponse.json({ok:!0})}catch(t){let e=t instanceof Error?t.message:String(t);return y.NextResponse.json({ok:!1,error:e},{status:500})}}async function C(e){try{let t=await e.json(),r=String(t?.provider??"").trim();if(!r)return y.NextResponse.json({ok:!1,error:"provider is required"},{status:400});return await (0,R.gatewayConfigPatch)({channels:{[r]:null}},`ClawKitchen Channels delete: ${r}`),y.NextResponse.json({ok:!0})}catch(t){let e=t instanceof Error?t.message:String(t);return y.NextResponse.json({ok:!1,error:e},{status:500})}}e.s(["DELETE",()=>C,"GET",()=>v,"PUT",()=>m],23334);var k=e.i(23334);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/channels/bindings/route",pathname:"/api/channels/bindings",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/channels/bindings/route.ts",nextConfigOutput:"standalone",userland:k}),{workAsyncStorage:j,workUnitAsyncStorage:A,serverHooks:b}=N;function T(){return(0,n.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:A})}async function O(e,t,n){N.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let y="/api/channels/bindings/route";y=y.replace(/\/index$/,"")||"/";let R=await N.prepare(e,t,{srcPage:y,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:E,params:v,nextConfig:m,parsedUrl:C,isDraftMode:k,prerenderManifest:j,routerServerContext:A,isOnDemandRevalidate:b,revalidateOnlyGenerated:T,resolvedPathname:O,clientReferenceManifest:P,serverActionsManifest:S}=R,_=(0,i.normalizeAppPath)(y),q=!!(j.dynamicRoutes[_]||j.routes[O]),H=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,C,!1):t.end("This page could not be found"),null);if(q&&!k){let e=!!j.routes[O],t=j.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(m.experimental.adapterPath)return await H();throw new w.NoFallbackError}}let D=null;!q||N.isDev||k||(D="/index"===(D=O)?"/":D);let U=!0===N.isDev||!q,M=q&&!U;S&&P&&(0,o.setManifestsSingleton)({page:y,clientReferenceManifest:P,serverActionsManifest:S});let I=e.method||"GET",$=(0,s.getTracer)(),W=$.getActiveScopeSpan(),K={params:v,prerenderManifest:j,renderOpts:{experimental:{authInterrupts:!!m.experimental.authInterrupts},cacheComponents:!!m.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:m.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>N.onRequestError(e,t,n,a,A)},sharedContext:{buildId:E}},L=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),F=u.NextRequestAdapter.fromNodeNextRequest(L,(0,u.signalFromNodeResponse)(t));try{let o=async e=>N.handle(F,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.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=`${I} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${I} ${y}`)}),i=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var s,l;let u=async({previousCacheEntry:r})=>{try{if(!i&&b&&T&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(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(!q)return await (0,d.sendResponse)(L,G,s,K.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,g.toNodeOutgoingHttpHeaders)(s.headers);u&&(t[f.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>=f.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:b})},!1,A),t}},c=await N.handleResponse({req:e,nextConfig:m,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:j,isRoutePPREnabled:!1,isOnDemandRevalidate:b,revalidateOnlyGenerated:T,responseGenerator:u,waitUntil:n.waitUntil,isMinimalMode:i});if(!q)return null;if((null==c||null==(s=c.value)?void 0:s.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});i||t.setHeader("x-nextjs-cache",b?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let w=(0,g.fromNodeOutgoingHttpHeaders)(c.value.headers);return i&&q||w.delete(f.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||w.get("Cache-Control")||w.set("Cache-Control",(0,h.getCacheControlHeader)(c.cacheControl)),await (0,d.sendResponse)(L,G,new Response(c.value.body,{headers:w,status:c.value.status||200})),null};W?await l(W):await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${I} ${y}`,kind:s.SpanKind.SERVER,attributes:{"http.method":I,"http.target":e.url}},l))}catch(t){if(t instanceof w.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:b})},!1,A),q)throw t;return await (0,d.sendResponse)(L,G,new Response(null,{status:500})),null}}e.s(["handler",()=>O,"patchFetch",()=>T,"routeModule",()=>N,"serverHooks",()=>b,"workAsyncStorage",()=>j,"workUnitAsyncStorage",()=>A],64937)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__c6906128._.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/channels/bindings/route.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\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(process.env.HOME || \"\", \".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 = process.env.HOME || \"\";\n if (!home) throw new Error(\"HOME is not set\");\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 // Allow running ClawKitchen on a different host than the OpenClaw gateway.\n // Useful for remote dev/prod deployments where the gateway lives elsewhere.\n const envUrl = (process.env.OPENCLAW_GATEWAY_HTTP_URL || process.env.OPENCLAW_GATEWAY_URL || \"\").trim();\n const envToken = (process.env.OPENCLAW_GATEWAY_TOKEN || \"\").trim();\n\n const cfg = await readOpenClawConfig();\n const port = cfg.gateway?.port ?? 18789;\n const token = envToken || cfg.gateway?.auth?.token;\n if (!token) throw new Error(\"Missing gateway token. Set OPENCLAW_GATEWAY_TOKEN or gateway.auth.token in ~/.openclaw/openclaw.json\");\n\n const baseUrl = envUrl || `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/channels/bindings/route\",\n pathname: \"/api/channels/bindings\",\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/channels/bindings/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/channels/bindings/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\nfunction safeJsonParse(raw: string): unknown {\n try {\n return JSON.parse(raw);\n } catch {\n return null;\n }\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return Boolean(v) && typeof v === \"object\" && !Array.isArray(v);\n}\n\nexport async function GET() {\n try {\n const { raw, hash } = await gatewayConfigGet();\n const parsed = safeJsonParse(raw);\n const root = isRecord(parsed) ? parsed : {};\n const channels = isRecord(root.channels) ? root.channels : {};\n return NextResponse.json({ ok: true, hash, channels });\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : String(e);\n return NextResponse.json({ ok: false, error: msg }, { status: 500 });\n }\n}\n\ntype UpsertBody = {\n provider: string;\n config: Record<string, unknown>;\n};\n\nexport async function PUT(req: Request) {\n try {\n const body = (await req.json()) as UpsertBody;\n const provider = String(body?.provider ?? \"\").trim();\n if (!provider) return NextResponse.json({ ok: false, error: \"provider is required\" }, { status: 400 });\n\n const cfg = isRecord(body?.config) ? body.config : null;\n if (!cfg) return NextResponse.json({ ok: false, error: \"config must be an object\" }, { status: 400 });\n\n // v1 validation (Telegram as reference)\n if (provider === \"telegram\") {\n const botToken = String(cfg.botToken ?? \"\").trim();\n if (!botToken) return NextResponse.json({ ok: false, error: \"telegram.botToken is required\" }, { status: 400 });\n }\n\n await gatewayConfigPatch({ channels: { [provider]: cfg } }, `ClawKitchen Channels upsert: ${provider}`);\n return NextResponse.json({ ok: true });\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : String(e);\n return NextResponse.json({ ok: false, error: msg }, { status: 500 });\n }\n}\n\ntype DeleteBody = { provider: string };\n\nexport async function DELETE(req: Request) {\n try {\n const body = (await req.json()) as DeleteBody;\n const provider = String(body?.provider ?? \"\").trim();\n if (!provider) return NextResponse.json({ ok: false, error: \"provider is required\" }, { status: 400 });\n\n // Patch semantics: setting a provider to null removes/clears it in the gateway config patcher.\n await gatewayConfigPatch({ channels: { [provider]: null } }, `ClawKitchen Channels delete: ${provider}`);\n return NextResponse.json({ ok: true });\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : String(e);\n return NextResponse.json({ ok: false, error: msg }, { status: 500 });\n }\n}\n"],"names":[],"mappings":"0oCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAiBO,eAAe,IACpB,IAAM,EAAI,EAAA,OAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,EAAI,GAAI,YAAa,iBAEzD,OAAO,KAAK,KAAK,CADJ,AACK,MADC,EAAA,OAAE,CAAC,QAAQ,CAAC,EAAG,QAEpC,CAEO,eAAe,IACpB,IAAM,EAAM,MAAM,IACZ,EAAK,EAAI,MAAM,EAAE,UAAU,UACjC,GAAI,CAAC,EAAI,MAAM,AAAI,MAAM,qEACzB,OAAO,CACT,CAEO,eAAe,IACpB,IAAM,EAAK,MAAM,IACjB,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAI,UACvB,CAEO,eAAe,IACpB,IAAM,EAAK,MAAM,IACjB,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAI,QAAS,QAChC,CAEO,eAAe,EAAoB,CAAc,EACtD,IAAM,EAAO,QAAQ,GAAG,CAAC,IAAI,EAAI,GACjC,GAAI,CAAC,EAAM,MAAM,AAAI,MAAM,mBAC3B,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAM,YAAa,CAAC,UAAU,EAAE,EAAA,CAAQ,CAC3D,CAEO,eAAe,IACpB,IAAM,EAAM,MAAM,IACZ,EACJ,EAAI,OAAO,EAAE,UAAU,SAAS,aAChC,EAAI,OAAO,EAAE,UAAU,SAAS,YAChC,EAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAC/B,GAAI,CAAC,EAAG,MAAM,AAAI,MAAM,kFACxB,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAG,UAAW,UACjC,wM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AO,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,mBAAmB,AAAnB,EAAoB,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":[2]}
@@ -1,8 +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"))},7367,e=>{"use strict";var t=e.i(12714),r=e.i(50227);async function a(){let e=r.default.join(process.env.HOME||"",".openclaw","openclaw.json");return JSON.parse(await t.default.readFile(e,"utf8"))}async function n(){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 n();return r.default.join(e,"recipes")}async function i(){let e=await n();return r.default.join(e,"notes","goals")}async function o(e){let t=process.env.HOME||"";if(!t)throw Error("HOME is not set");return r.default.join(t,".openclaw",`workspace-${e}`)}async function l(){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 r.default.join(t,"recipes","default")}e.s(["getBuiltinRecipesDir",()=>l,"getTeamWorkspaceDir",()=>o,"getWorkspaceDir",()=>n,"getWorkspaceGoalsDir",()=>i,"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"))},25092,e=>{"use strict";var t=e.i(12714),r=e.i(50227),a=e.i(23008),n=e.i(7367);let s=/^[a-z0-9][a-z0-9-]{1,63}$/;function i(e){if(e.startsWith("---\n")){let t=e.indexOf("\n---\n",4);if(-1!==t){let r=e.slice(4,t+1),n=e.slice(t+5);return{fm:a.default.parse(r)??{},body:n}}}return{fm:{},body:e}}function o(e,t,r){let a=new Date().toISOString(),n=e&&"object"==typeof e?e:{},s=String(n.id??t).trim(),i=String(n.title??r??s).trim()||s,o=String(n.status??"planned").trim(),l=Array.isArray(n.tags)?n.tags.map(String):[];return{id:s,title:i,status:"active"===o||"done"===o?o:"planned",tags:l,teams:Array.isArray(n.teams)?n.teams.map(String):[],updatedAt:String(n.updatedAt??a)}}async function l(){let e=await (0,n.getWorkspaceGoalsDir)();return await t.default.mkdir(e,{recursive:!0}),e}async function u(e){if(!s.test(e))throw Error(`Invalid goal id "${e}". Use 2-64 chars: lowercase letters, numbers, hyphens. Example: "increase-trial-activation".`);let t=await l(),a=r.default.join(t,`${e}.md`),n=r.default.resolve(t)+r.default.sep;if(!r.default.resolve(a).startsWith(n))throw Error("Path traversal rejected");return{root:t,full:a}}async function d(){let e=await l(),a=(await t.default.readdir(e)).filter(e=>e.endsWith(".md")),n=[];for(let s of a){let a=r.default.join(e,s),l=await t.default.readFile(a,"utf8"),u=s.replace(/\.md$/,""),{fm:d}=i(l),p=o(d,u,u);n.push({...p,filename:s})}let s={active:0,planned:1,done:2};return n.sort((e,t)=>{let r=s[e.status],a=s[t.status];return r!==a?r-a:String(t.updatedAt).localeCompare(String(e.updatedAt))}),n}async function p(e){let{full:r}=await u(e);try{let a=await t.default.readFile(r,"utf8"),{fm:n,body:s}=i(a),l=n&&"object"==typeof n?n:{};return{frontmatter:o(n,e,String(l.title??e)),body:s,raw:a}}catch(e){if("object"==typeof e&&e&&"ENOENT"===e.code)return null;throw e}}async function c(e){let{id:r}=e,{full:n}=await u(r),s=new Date().toISOString(),i={id:r,title:e.title,status:e.status??"planned",tags:e.tags??[],teams:e.teams??[],updatedAt:s},o=`---
2
- ${a.default.stringify(i).trim()}
3
- ---
4
-
5
- ${(e.body??"").trim()}
6
- `;return await t.default.writeFile(n,o,"utf8"),{frontmatter:i,raw:o}}async function f(e){let{full:r}=await u(e);try{return await t.default.unlink(r),{ok:!0}}catch(e){if("object"==typeof e&&e&&"ENOENT"===e.code)return{ok:!1,reason:"not_found"};throw e}}e.s(["deleteGoal",()=>f,"listGoals",()=>d,"readGoal",()=>p,"writeGoal",()=>c])},41314,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),i=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),g=e.i(26937),h=e.i(10372),w=e.i(93695);e.i(52474);var x=e.i(220),m=e.i(89171),y=e.i(25092);async function v(e,t){let{id:r}=await t.params;try{let e=await (0,y.readGoal)(r);if(!e)return m.NextResponse.json({error:"Not found"},{status:404});return m.NextResponse.json({goal:e.frontmatter,body:e.body,raw:e.raw})}catch(r){let e=r instanceof Error?r.message:String(r),t=/Invalid goal id|Path traversal/.test(e)?400:500;return m.NextResponse.json({error:e},{status:t})}}async function R(e,t){let{id:r}=await t.params;try{let t=await e.json(),a=String(t?.title??"").trim();if(!a)return m.NextResponse.json({error:"title is required"},{status:400});let n=await (0,y.writeGoal)({id:r,title:a,status:t?.status,tags:Array.isArray(t?.tags)?t.tags:[],teams:Array.isArray(t?.teams)?t.teams:[],body:String(t?.body??"")});return m.NextResponse.json({goal:n.frontmatter})}catch(r){let e=r instanceof Error?r.message:String(r),t=/Invalid goal id|Path traversal/.test(e)?400:500;return m.NextResponse.json({error:e},{status:t})}}async function E(e,t){let{id:r}=await t.params;try{if(!(await (0,y.deleteGoal)(r)).ok)return m.NextResponse.json({error:"Not found"},{status:404});return m.NextResponse.json({ok:!0})}catch(r){let e=r instanceof Error?r.message:String(r),t=/Invalid goal id|Path traversal/.test(e)?400:500;return m.NextResponse.json({error:e},{status:t})}}e.s(["DELETE",()=>E,"GET",()=>v,"PUT",()=>R],34015);var j=e.i(34015);let A=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/goals/[id]/route",pathname:"/api/goals/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/goals/[id]/route.ts",nextConfigOutput:"standalone",userland:j}),{workAsyncStorage:b,workUnitAsyncStorage:C,serverHooks:N}=A;function S(){return(0,a.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:C})}async function k(e,t,a){A.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/goals/[id]/route";m=m.replace(/\/index$/,"")||"/";let y=await A.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:v,params:R,nextConfig:E,parsedUrl:j,isDraftMode:b,prerenderManifest:C,routerServerContext:N,isOnDemandRevalidate:S,revalidateOnlyGenerated:k,resolvedPathname:O,clientReferenceManifest:P,serverActionsManifest:T}=y,q=(0,o.normalizeAppPath)(m),D=!!(C.dynamicRoutes[q]||C.routes[O]),I=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,j,!1):t.end("This page could not be found"),null);if(D&&!b){let e=!!C.routes[O],t=C.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await I();throw new w.NoFallbackError}}let _=null;!D||A.isDev||b||(_="/index"===(_=O)?"/":_);let H=!0===A.isDev||!D,U=D&&!H;T&&P&&(0,i.setManifestsSingleton)({page:m,clientReferenceManifest:P,serverActionsManifest:T});let $=e.method||"GET",M=(0,s.getTracer)(),G=M.getActiveScopeSpan(),F={params:R,prerenderManifest:C,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:H,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)=>A.onRequestError(e,t,a,n,N)},sharedContext:{buildId:v}},W=new l.NodeNextRequest(e),K=new l.NodeNextResponse(t),B=u.NextRequestAdapter.fromNodeNextRequest(W,(0,u.signalFromNodeResponse)(t));try{let i=async e=>A.handle(B,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")!==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=`${$} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${$} ${m}`)}),o=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var s,l;let u=async({previousCacheEntry:r})=>{try{if(!o&&S&&k&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=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(!D)return await (0,c.sendResponse)(W,K,s,F.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(s.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: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 A.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,N),t}},d=await A.handleResponse({req:e,nextConfig:E,cacheKey:_,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:k,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:o});if(!D)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==x.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",S?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let w=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return o&&D||w.delete(h.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||w.get("Cache-Control")||w.set("Cache-Control",(0,g.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(W,K,new Response(d.value.body,{headers:w,status:d.value.status||200})),null};G?await l(G):await M.withPropagatedContext(e.headers,()=>M.trace(d.BaseServerSpan.handleRequest,{spanName:`${$} ${m}`,kind:s.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},l))}catch(t){if(t instanceof w.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,N),D)throw t;return await (0,c.sendResponse)(W,K,new Response(null,{status:500})),null}}e.s(["handler",()=>k,"patchFetch",()=>S,"routeModule",()=>A,"serverHooks",()=>N,"workAsyncStorage",()=>b,"workUnitAsyncStorage",()=>C],41314)}];
7
-
8
- //# sourceMappingURL=%5Broot-of-the-server%5D__c8eb444c._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/paths.ts","../../../src/lib/goals.ts","../../../src/app/api/goals/%5Bid%5D/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import fs from \"node:fs/promises\";\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(process.env.HOME || \"\", \".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 = process.env.HOME || \"\";\n if (!home) throw new Error(\"HOME is not set\");\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 { NextResponse } from \"next/server\";\nimport { deleteGoal, readGoal, writeGoal } from \"@/lib/goals\";\n\nexport async function GET(_req: Request, ctx: { params: Promise<{ id: string }> }) {\n const { id } = await ctx.params;\n try {\n const goal = await readGoal(id);\n if (!goal) return NextResponse.json({ error: \"Not found\" }, { status: 404 });\n return NextResponse.json({ goal: goal.frontmatter, body: goal.body, raw: goal.raw });\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\nexport async function PUT(req: Request, ctx: { params: Promise<{ id: string }> }) {\n const { id } = await ctx.params;\n type GoalPutBody = {\n title: string;\n status?: \"planned\" | \"active\" | \"done\";\n tags?: string[];\n teams?: string[];\n body?: string;\n };\n\n try {\n const data = (await req.json()) as GoalPutBody;\n const title = String(data?.title ?? \"\").trim();\n if (!title) return NextResponse.json({ error: \"title is required\" }, { status: 400 });\n\n const result = await writeGoal({\n id,\n title,\n status: data?.status,\n tags: Array.isArray(data?.tags) ? data.tags : [],\n teams: Array.isArray(data?.teams) ? data.teams : [],\n body: String(data?.body ?? \"\"),\n });\n\n return NextResponse.json({ goal: result.frontmatter });\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\nexport async function DELETE(_req: Request, ctx: { params: Promise<{ id: string }> }) {\n const { id } = await ctx.params;\n try {\n const result = await deleteGoal(id);\n if (!result.ok) return NextResponse.json({ error: \"Not found\" }, { status: 404 });\n return NextResponse.json({ ok: true });\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]/route\",\n pathname: \"/api/goals/[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/goals/[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/goals/[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"],"names":[],"mappings":"0oCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAiBO,eAAe,IACpB,IAAM,EAAI,EAAA,OAAI,CAAC,IA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