@circuitwall/jarela 2.2.1 → 2.3.0

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 (651) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +6 -5
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/routes-manifest.json +8 -0
  6. package/.next/standalone/.next/server/app/_global-error/page.js +68 -68
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page.js +76 -76
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +93 -93
  22. package/.next/standalone/.next/server/app/api/v1/access/route.js +169 -169
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +82 -56
  24. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +122 -122
  26. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +100 -100
  27. package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +753 -753
  28. package/.next/standalone/.next/server/app/api/v1/agents/route.js +65 -65
  29. package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +364 -364
  30. package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +802 -802
  31. package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +2 -2
  32. package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +49 -49
  33. package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +910 -910
  34. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +589 -16
  35. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +23 -23
  37. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +30 -30
  38. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +703 -130
  39. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +708 -135
  41. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +802 -229
  43. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +739 -739
  45. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1035 -1035
  46. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +679 -106
  47. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +804 -804
  49. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +700 -700
  50. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +9 -9
  51. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/api/v1/config/route.js +85 -85
  53. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +709 -709
  54. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/api/v1/credentials/route.js +2 -2
  56. package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +10 -10
  58. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +784 -784
  59. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +23 -23
  60. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +86 -86
  61. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +57 -57
  63. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +523 -523
  65. package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +44 -44
  66. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +65 -65
  67. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +122 -122
  69. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +37 -37
  71. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/api/v1/env/route.js +9 -9
  73. package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +368 -368
  74. package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +44 -44
  75. package/.next/standalone/.next/server/app/api/v1/events/route.js +751 -178
  76. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/v1/events/test/route.js +77 -77
  78. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +763 -763
  79. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +44 -44
  81. package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +9 -9
  82. package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +65 -65
  83. package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +34 -34
  84. package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +204 -204
  85. package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +133 -133
  86. package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +106 -106
  87. package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +114 -114
  88. package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +134 -134
  89. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +690 -690
  90. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +93 -93
  92. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +9 -9
  94. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +185 -185
  96. package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +171 -171
  98. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +396 -396
  100. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +212 -212
  102. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +235 -235
  104. package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +26 -26
  105. package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +221 -221
  106. package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +58 -58
  107. package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +72 -72
  108. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +9 -9
  109. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
  110. package/.next/standalone/.next/server/app/api/v1/health/route.js +772 -772
  111. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +133 -133
  112. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +9 -9
  113. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
  114. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +363 -363
  115. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +233 -233
  116. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +682 -682
  117. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +879 -879
  118. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +108 -108
  119. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +952 -952
  120. package/.next/standalone/.next/server/app/api/v1/integrations/route.js +216 -216
  121. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +864 -847
  122. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js.nft.json +1 -1
  123. package/.next/standalone/.next/server/app/api/v1/local-file/route.js +26 -26
  124. package/.next/standalone/.next/server/app/api/v1/logs/route.js +70 -70
  125. package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +72 -72
  126. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +979 -979
  127. package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +196 -196
  128. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +2 -2
  129. package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +381 -381
  130. package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +79 -79
  131. package/.next/standalone/.next/server/app/api/v1/memory/route.js +51 -51
  132. package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +131 -131
  133. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +374 -369
  134. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js.nft.json +1 -1
  135. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +143 -143
  136. package/.next/standalone/.next/server/app/api/v1/models/route.js +543 -543
  137. package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +445 -445
  138. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +120 -120
  139. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
  140. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +234 -234
  141. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +407 -407
  143. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +37 -37
  145. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +107 -107
  147. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +228 -228
  149. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +9 -9
  151. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/v1/packages/route.js +148 -148
  153. package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +787 -787
  155. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
  156. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +507 -507
  157. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +181 -181
  159. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +258 -258
  161. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +30 -30
  163. package/.next/standalone/.next/server/app/api/v1/profile/route.js +164 -164
  164. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +44 -44
  165. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +9 -9
  166. package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +164 -164
  167. package/.next/standalone/.next/server/app/api/v1/providers/route.js +94 -94
  168. package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +450 -450
  169. package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +37 -37
  170. package/.next/standalone/.next/server/app/api/v1/redaction/route.js +58 -58
  171. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +600 -600
  172. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +44 -44
  173. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
  174. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +732 -732
  175. package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +359 -359
  176. package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +197 -197
  177. package/.next/standalone/.next/server/app/api/v1/security/state/route.js +51 -51
  178. package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +176 -176
  179. package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +190 -190
  180. package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +26 -26
  181. package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +770 -770
  182. package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +115 -115
  183. package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +327 -327
  184. package/.next/standalone/.next/server/app/api/v1/skills/route.js +870 -870
  185. package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +838 -808
  186. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +177 -177
  187. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
  188. package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +164 -164
  189. package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +115 -115
  190. package/.next/standalone/.next/server/app/api/v1/tasks/route.js +23 -23
  191. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +1429 -0
  192. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js.nft.json +1 -0
  193. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route_client-reference-manifest.js +1 -0
  194. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +635 -634
  195. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js.nft.json +1 -1
  196. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +53 -439
  197. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.nft.json +1 -1
  198. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +172 -172
  199. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
  200. package/.next/standalone/.next/server/app/api/v1/threads/route.js +908 -908
  201. package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
  202. package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
  203. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +17 -17
  204. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  205. package/.next/standalone/.next/server/app/api/v1/update/route.js +570 -570
  206. package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +224 -224
  207. package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +975 -975
  208. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +23 -23
  209. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +72 -72
  210. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
  211. package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +128 -128
  212. package/.next/standalone/.next/server/app/api/v1/watchers/route.js +164 -164
  213. package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
  214. package/.next/standalone/.next/server/app/icon.svg/route.js +62 -62
  215. package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +436 -436
  216. package/.next/standalone/.next/server/app/page.js +1243 -854
  217. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  218. package/.next/standalone/.next/server/app/setup/page.js +91 -91
  219. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app-paths-manifest.json +6 -5
  221. package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +335 -986
  222. package/.next/standalone/.next/server/chunks/1433.js +1 -1
  223. package/.next/standalone/.next/server/chunks/1638.js +1 -2
  224. package/.next/standalone/.next/server/chunks/1738.js +1 -1
  225. package/.next/standalone/.next/server/chunks/210.js +6 -6
  226. package/.next/standalone/.next/server/chunks/2151.js +31 -1
  227. package/.next/standalone/.next/server/chunks/2207.js +1 -0
  228. package/.next/standalone/.next/server/chunks/2471.js +28 -28
  229. package/.next/standalone/.next/server/chunks/2504.js +1 -1
  230. package/.next/standalone/.next/server/chunks/2695.js +17 -17
  231. package/.next/standalone/.next/server/chunks/3042.js +14 -8
  232. package/.next/standalone/.next/server/chunks/3399.js +1 -1
  233. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  234. package/.next/standalone/.next/server/chunks/4189.js +946 -0
  235. package/.next/standalone/.next/server/chunks/{9590.js → 423.js} +8 -3
  236. package/.next/standalone/.next/server/chunks/4433.js +146 -146
  237. package/.next/standalone/.next/server/chunks/4508.js +1 -1
  238. package/.next/standalone/.next/server/chunks/4588.js +1 -0
  239. package/.next/standalone/.next/server/chunks/46.js +5 -0
  240. package/.next/standalone/.next/server/chunks/466.js +12 -0
  241. package/.next/standalone/.next/server/chunks/4868.js +206 -206
  242. package/.next/standalone/.next/server/chunks/4992.js +13 -0
  243. package/.next/standalone/.next/server/chunks/5120.js +963 -0
  244. package/.next/standalone/.next/server/chunks/5701.js +1 -1
  245. package/.next/standalone/.next/server/chunks/5900.js +1 -1
  246. package/.next/standalone/.next/server/chunks/6210.js +1 -0
  247. package/.next/standalone/.next/server/chunks/6213.js +1 -1
  248. package/.next/standalone/.next/server/chunks/6649.js +2 -2
  249. package/.next/standalone/.next/server/chunks/6703.js +3 -3
  250. package/.next/standalone/.next/server/chunks/7445.js +1 -0
  251. package/.next/standalone/.next/server/chunks/8067.js +12 -0
  252. package/.next/standalone/.next/server/chunks/8461.js +14 -9
  253. package/.next/standalone/.next/server/chunks/8558.js +1 -1
  254. package/.next/standalone/.next/server/chunks/8724.js +1 -1
  255. package/.next/standalone/.next/server/chunks/8849.js +91 -91
  256. package/.next/standalone/.next/server/chunks/9032.js +6 -5
  257. package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33173 -31461
  258. package/.next/standalone/.next/server/chunks/9237.js +396 -396
  259. package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1628 -570
  260. package/.next/standalone/.next/server/chunks/9406.js +1 -1
  261. package/.next/standalone/.next/server/chunks/9824.js +98 -98
  262. package/.next/standalone/.next/server/chunks/9826.js +1 -0
  263. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  264. package/.next/standalone/.next/server/middleware.js +415 -397
  265. package/.next/standalone/.next/server/pages/404.html +2 -2
  266. package/.next/standalone/.next/server/pages/500.html +1 -1
  267. package/.next/standalone/.next/server/preview-props.json +3 -3
  268. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  269. package/.next/standalone/.next/static/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
  270. package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
  271. package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  272. package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  273. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  274. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
  275. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
  276. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
  277. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
  278. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
  279. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
  280. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
  281. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
  282. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
  283. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
  284. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
  285. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
  286. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
  287. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
  288. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
  289. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
  290. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
  291. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
  292. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
  293. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
  294. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
  295. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
  296. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
  297. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
  298. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
  299. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
  300. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
  301. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
  302. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
  303. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
  304. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
  305. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
  306. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
  307. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
  308. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
  309. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
  310. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
  311. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
  312. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
  313. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
  314. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
  315. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
  316. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
  317. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
  318. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
  319. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
  320. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
  321. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
  322. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
  323. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
  324. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
  325. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
  326. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
  327. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
  328. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
  329. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
  330. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
  331. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
  332. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
  333. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
  334. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
  335. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
  336. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
  337. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
  338. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
  339. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  340. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
  341. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
  342. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  343. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
  344. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
  345. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
  346. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
  347. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
  348. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
  349. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
  350. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
  351. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
  352. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
  353. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
  354. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
  355. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
  356. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
  357. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
  358. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
  359. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
  360. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
  361. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
  362. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
  363. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
  364. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
  365. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
  366. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
  367. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
  368. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
  369. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
  370. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
  371. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
  372. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
  373. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
  374. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
  375. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
  376. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
  377. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
  378. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
  379. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
  380. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
  381. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
  382. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
  383. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
  384. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
  385. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
  386. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
  387. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
  388. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
  389. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
  390. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
  391. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
  392. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
  393. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
  394. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
  395. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
  396. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
  397. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
  398. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
  399. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
  400. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
  401. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
  402. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
  403. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
  404. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
  405. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
  406. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
  407. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
  408. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
  409. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
  410. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
  411. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
  412. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
  413. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
  414. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
  415. package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-213a623b37226452.js} +1041 -652
  416. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6fc5f8e744c81802.js +17 -0
  417. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6fc5f8e744c81802.js +17 -0
  418. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6fc5f8e744c81802.js +17 -0
  419. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6fc5f8e744c81802.js +17 -0
  420. package/.next/standalone/.next/static/css/{d80058f0b9b41c09.css → 312542a5725ba0d5.css} +2 -2
  421. package/.next/standalone/docs/adoption/changesets.json +309 -0
  422. package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  423. package/.next/standalone/package.json +3 -3
  424. package/CHANGELOG.md +25 -0
  425. package/api/client.ts +9 -0
  426. package/api/types.ts +29 -0
  427. package/app/api/v1/lifecycle/adoption/route.ts +14 -2
  428. package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
  429. package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
  430. package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
  431. package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
  432. package/app/api/v1/threads/[thread_id]/route.ts +5 -1
  433. package/components/chat/ChatView.tsx +52 -11
  434. package/components/chat/ContextBoundary.test.tsx +68 -1
  435. package/components/chat/ContextBoundary.tsx +92 -13
  436. package/components/chat/MessageList.test.tsx +31 -0
  437. package/components/chat/MessageList.tsx +49 -28
  438. package/components/chat/ToolList.test.tsx +92 -16
  439. package/components/chat/ToolList.tsx +59 -4
  440. package/components/chat/chat-helpers.test.tsx +24 -1
  441. package/components/chat/chat-helpers.ts +47 -4
  442. package/components/chat/useThreadActivity.test.tsx +113 -0
  443. package/components/chat/useThreadActivity.ts +94 -0
  444. package/components/chat/useThreadData.ts +16 -16
  445. package/components/chat/workflow-step-retry.ts +25 -0
  446. package/components/ui/BootScreen.tsx +17 -0
  447. package/components/ui/WorkflowChecklist.tsx +71 -33
  448. package/hooks/useSSE.ts +28 -3
  449. package/lib/agents/compaction-pipeline.test.ts +202 -0
  450. package/lib/agents/compaction-pipeline.ts +483 -0
  451. package/lib/agents/conversation-summary.ts +37 -21
  452. package/lib/agents/prepare/history-window.test.ts +18 -0
  453. package/lib/agents/prepare/history-window.ts +11 -2
  454. package/lib/agents/prepare/request.ts +4 -0
  455. package/lib/agents/prepare/system-prompt.test.ts +39 -0
  456. package/lib/agents/prepare/system-prompt.ts +8 -3
  457. package/lib/agents/prompt-registry.test.ts +5 -140
  458. package/lib/agents/prompt-registry.ts +45 -1
  459. package/lib/agents/prompt-variants.ts +146 -0
  460. package/lib/agents/run-registry.test.ts +22 -0
  461. package/lib/agents/run-registry.ts +29 -0
  462. package/lib/agents/run-thread.retry.test.ts +67 -1
  463. package/lib/agents/run-thread.ts +86 -1
  464. package/lib/agents/thread-activity.test.ts +31 -0
  465. package/lib/agents/thread-activity.ts +27 -0
  466. package/lib/agents/thread-compaction-state.test.ts +82 -0
  467. package/lib/agents/thread-compaction-state.ts +121 -0
  468. package/lib/agents/thread-compaction.test.ts +83 -4
  469. package/lib/agents/thread-compaction.ts +34 -11
  470. package/lib/agents/warm-summary-background.test.ts +219 -5
  471. package/lib/agents/warm-summary-background.ts +325 -142
  472. package/lib/agents/warm-topics.test.ts +37 -0
  473. package/lib/agents/warm-topics.ts +297 -0
  474. package/lib/agents/workflow-step-retry.test.ts +96 -0
  475. package/lib/agents/workflow-step-retry.ts +216 -0
  476. package/lib/api/browser-control.ts +0 -3
  477. package/lib/db/migrations.ts +5 -0
  478. package/lib/env/config.ts +2 -0
  479. package/lib/env/schema.ts +12 -0
  480. package/lib/lifecycle/changeset-build.test.ts +93 -0
  481. package/lib/lifecycle/changeset-build.ts +210 -0
  482. package/lib/lifecycle/changesets.test.ts +101 -0
  483. package/lib/lifecycle/changesets.ts +166 -0
  484. package/lib/lifecycle/surface-collect.test.ts +88 -0
  485. package/lib/lifecycle/surface-collect.ts +64 -0
  486. package/lib/lifecycle/surface-snapshot.test.ts +104 -0
  487. package/lib/lifecycle/surface-snapshot.ts +210 -0
  488. package/lib/memory/record.ts +0 -2
  489. package/lib/providers/external.ts +0 -2
  490. package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  491. package/lib/stores/threads.test.ts +9 -0
  492. package/lib/stores/threads.ts +21 -11
  493. package/lib/stores/version-adoption.test.ts +96 -0
  494. package/lib/stores/version-adoption.ts +239 -26
  495. package/lib/stores/workflow-progress.ts +3 -0
  496. package/lib/tools/communications/ms-todo.ts +0 -7
  497. package/lib/tools/general/memory.ts +1 -1
  498. package/lib/tools/general/workflow-progress.ts +2 -0
  499. package/lib/tools/runtime/catalog.ts +1 -25
  500. package/lib/triggers/registry.ts +0 -4
  501. package/package.json +3 -3
  502. package/scripts/install-to-system.ps1 +39 -11
  503. package/scripts/install-to-system.sh +37 -3
  504. package/.next/standalone/.next/server/chunks/3979.js +0 -581
  505. package/.next/standalone/.next/server/chunks/5936.js +0 -594
  506. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-36cb8b428b38b26a.js +0 -17
  507. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-36cb8b428b38b26a.js +0 -17
  508. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-36cb8b428b38b26a.js +0 -17
  509. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-36cb8b428b38b26a.js +0 -17
  510. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-36cb8b428b38b26a.js +0 -17
  511. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-36cb8b428b38b26a.js +0 -17
  512. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-36cb8b428b38b26a.js +0 -17
  513. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-36cb8b428b38b26a.js +0 -17
  514. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-36cb8b428b38b26a.js +0 -17
  515. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-36cb8b428b38b26a.js +0 -17
  516. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-36cb8b428b38b26a.js +0 -17
  517. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-36cb8b428b38b26a.js +0 -17
  518. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-36cb8b428b38b26a.js +0 -17
  519. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-36cb8b428b38b26a.js +0 -17
  520. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-36cb8b428b38b26a.js +0 -17
  521. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-36cb8b428b38b26a.js +0 -17
  522. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-36cb8b428b38b26a.js +0 -17
  523. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-36cb8b428b38b26a.js +0 -17
  524. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-36cb8b428b38b26a.js +0 -17
  525. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-36cb8b428b38b26a.js +0 -17
  526. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-36cb8b428b38b26a.js +0 -17
  527. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-36cb8b428b38b26a.js +0 -17
  528. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-36cb8b428b38b26a.js +0 -17
  529. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-36cb8b428b38b26a.js +0 -17
  530. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-36cb8b428b38b26a.js +0 -17
  531. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-36cb8b428b38b26a.js +0 -17
  532. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-36cb8b428b38b26a.js +0 -17
  533. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-36cb8b428b38b26a.js +0 -17
  534. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-36cb8b428b38b26a.js +0 -17
  535. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-36cb8b428b38b26a.js +0 -17
  536. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-36cb8b428b38b26a.js +0 -17
  537. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-36cb8b428b38b26a.js +0 -17
  538. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-36cb8b428b38b26a.js +0 -17
  539. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-36cb8b428b38b26a.js +0 -17
  540. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-36cb8b428b38b26a.js +0 -17
  541. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-36cb8b428b38b26a.js +0 -17
  542. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-36cb8b428b38b26a.js +0 -17
  543. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-36cb8b428b38b26a.js +0 -17
  544. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-36cb8b428b38b26a.js +0 -17
  545. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-36cb8b428b38b26a.js +0 -17
  546. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-36cb8b428b38b26a.js +0 -17
  547. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-36cb8b428b38b26a.js +0 -17
  548. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-36cb8b428b38b26a.js +0 -17
  549. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-36cb8b428b38b26a.js +0 -17
  550. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-36cb8b428b38b26a.js +0 -17
  551. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-36cb8b428b38b26a.js +0 -17
  552. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-36cb8b428b38b26a.js +0 -17
  553. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-36cb8b428b38b26a.js +0 -17
  554. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-36cb8b428b38b26a.js +0 -17
  555. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-36cb8b428b38b26a.js +0 -17
  556. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-36cb8b428b38b26a.js +0 -17
  557. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-36cb8b428b38b26a.js +0 -17
  558. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-36cb8b428b38b26a.js +0 -17
  559. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-36cb8b428b38b26a.js +0 -17
  560. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-36cb8b428b38b26a.js +0 -17
  561. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-36cb8b428b38b26a.js +0 -17
  562. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-36cb8b428b38b26a.js +0 -17
  563. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-36cb8b428b38b26a.js +0 -17
  564. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-36cb8b428b38b26a.js +0 -17
  565. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-36cb8b428b38b26a.js +0 -17
  566. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-36cb8b428b38b26a.js +0 -17
  567. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-36cb8b428b38b26a.js +0 -17
  568. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-36cb8b428b38b26a.js +0 -17
  569. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-36cb8b428b38b26a.js +0 -17
  570. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-36cb8b428b38b26a.js +0 -17
  571. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  572. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-36cb8b428b38b26a.js +0 -17
  573. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-36cb8b428b38b26a.js +0 -17
  574. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  575. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-36cb8b428b38b26a.js +0 -17
  576. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-36cb8b428b38b26a.js +0 -17
  577. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-36cb8b428b38b26a.js +0 -17
  578. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-36cb8b428b38b26a.js +0 -17
  579. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-36cb8b428b38b26a.js +0 -17
  580. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-36cb8b428b38b26a.js +0 -17
  581. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-36cb8b428b38b26a.js +0 -17
  582. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-36cb8b428b38b26a.js +0 -17
  583. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-36cb8b428b38b26a.js +0 -17
  584. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-36cb8b428b38b26a.js +0 -17
  585. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-36cb8b428b38b26a.js +0 -17
  586. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-36cb8b428b38b26a.js +0 -17
  587. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-36cb8b428b38b26a.js +0 -17
  588. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-36cb8b428b38b26a.js +0 -17
  589. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-36cb8b428b38b26a.js +0 -17
  590. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-36cb8b428b38b26a.js +0 -17
  591. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-36cb8b428b38b26a.js +0 -17
  592. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-36cb8b428b38b26a.js +0 -17
  593. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-36cb8b428b38b26a.js +0 -17
  594. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-36cb8b428b38b26a.js +0 -17
  595. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-36cb8b428b38b26a.js +0 -17
  596. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-36cb8b428b38b26a.js +0 -17
  597. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-36cb8b428b38b26a.js +0 -17
  598. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-36cb8b428b38b26a.js +0 -17
  599. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-36cb8b428b38b26a.js +0 -17
  600. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-36cb8b428b38b26a.js +0 -17
  601. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-36cb8b428b38b26a.js +0 -17
  602. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-36cb8b428b38b26a.js +0 -17
  603. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-36cb8b428b38b26a.js +0 -17
  604. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-36cb8b428b38b26a.js +0 -17
  605. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-36cb8b428b38b26a.js +0 -17
  606. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-36cb8b428b38b26a.js +0 -17
  607. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-36cb8b428b38b26a.js +0 -17
  608. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-36cb8b428b38b26a.js +0 -17
  609. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-36cb8b428b38b26a.js +0 -17
  610. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-36cb8b428b38b26a.js +0 -17
  611. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-36cb8b428b38b26a.js +0 -17
  612. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-36cb8b428b38b26a.js +0 -17
  613. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-36cb8b428b38b26a.js +0 -17
  614. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-36cb8b428b38b26a.js +0 -17
  615. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-36cb8b428b38b26a.js +0 -17
  616. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-36cb8b428b38b26a.js +0 -17
  617. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-36cb8b428b38b26a.js +0 -17
  618. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-36cb8b428b38b26a.js +0 -17
  619. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-36cb8b428b38b26a.js +0 -17
  620. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-36cb8b428b38b26a.js +0 -17
  621. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-36cb8b428b38b26a.js +0 -17
  622. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-36cb8b428b38b26a.js +0 -17
  623. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-36cb8b428b38b26a.js +0 -17
  624. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-36cb8b428b38b26a.js +0 -17
  625. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-36cb8b428b38b26a.js +0 -17
  626. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-36cb8b428b38b26a.js +0 -17
  627. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-36cb8b428b38b26a.js +0 -17
  628. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-36cb8b428b38b26a.js +0 -17
  629. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-36cb8b428b38b26a.js +0 -17
  630. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-36cb8b428b38b26a.js +0 -17
  631. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-36cb8b428b38b26a.js +0 -17
  632. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-36cb8b428b38b26a.js +0 -17
  633. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-36cb8b428b38b26a.js +0 -17
  634. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-36cb8b428b38b26a.js +0 -17
  635. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-36cb8b428b38b26a.js +0 -17
  636. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-36cb8b428b38b26a.js +0 -17
  637. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-36cb8b428b38b26a.js +0 -17
  638. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-36cb8b428b38b26a.js +0 -17
  639. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-36cb8b428b38b26a.js +0 -17
  640. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-36cb8b428b38b26a.js +0 -17
  641. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-36cb8b428b38b26a.js +0 -17
  642. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-36cb8b428b38b26a.js +0 -17
  643. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-36cb8b428b38b26a.js +0 -17
  644. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-36cb8b428b38b26a.js +0 -17
  645. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-36cb8b428b38b26a.js +0 -17
  646. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-36cb8b428b38b26a.js +0 -17
  647. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-36cb8b428b38b26a.js +0 -17
  648. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-36cb8b428b38b26a.js +0 -17
  649. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-36cb8b428b38b26a.js +0 -17
  650. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_buildManifest.js +0 -0
  651. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_ssgManifest.js +0 -0
@@ -114,628 +114,184 @@ module.exports = require("node:async_hooks");
114
114
 
115
115
  /***/ }),
116
116
 
117
- /***/ 17533:
118
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
119
-
120
- __webpack_require__.r(__webpack_exports__);
121
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
122
- /* harmony export */ handler: () => (/* binding */ handler),
123
- /* harmony export */ patchFetch: () => (/* binding */ patchFetch),
124
- /* harmony export */ routeModule: () => (/* binding */ routeModule),
125
- /* harmony export */ serverHooks: () => (/* binding */ serverHooks),
126
- /* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
127
- /* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
128
- /* harmony export */ });
129
- /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
130
- /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__);
131
- /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
132
- /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
133
- /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__);
134
- /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
135
- /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__);
136
- /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
137
- /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__);
138
- /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
139
- /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__);
140
- /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
141
- /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__);
142
- /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
143
- /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__);
144
- /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
145
- /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__);
146
- /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
147
- /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__);
148
- /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
149
- /* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
150
- /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
151
- /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__);
152
- /* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
153
- /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
154
- /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
155
- /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
156
- /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__);
157
- /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
158
- /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__);
159
- /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
160
- /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__);
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
117
+ /***/ 19121:
118
+ /***/ ((module) => {
170
119
 
120
+ module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
171
121
 
122
+ /***/ }),
172
123
 
124
+ /***/ 21455:
125
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
173
126
 
127
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
128
+ /* harmony export */ SK: () => (/* binding */ getSkill),
129
+ /* harmony export */ YJ: () => (/* binding */ getSkillsDir),
130
+ /* harmony export */ bG: () => (/* binding */ listSkills),
131
+ /* harmony export */ hI: () => (/* binding */ writeSkill),
132
+ /* harmony export */ hp: () => (/* binding */ deleteSkill),
133
+ /* harmony export */ nh: () => (/* binding */ getSkillsDirs)
134
+ /* harmony export */ });
135
+ /* unused harmony exports getBuiltinSkillsDir, invalidateSkillsCache */
136
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
137
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_fs__WEBPACK_IMPORTED_MODULE_0__);
138
+ /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76760);
139
+ /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(node_path__WEBPACK_IMPORTED_MODULE_1__);
140
+ /* harmony import */ var _lib_stores_skill_repos__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70106);
141
+ /* harmony import */ var _lib_cache_keyed_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65700);
142
+ // Skills loader — reads packaged built-in skills plus user SKILL.md files
143
+ // from the repos in the `skill_repos` table (lib/stores/skill-repos.ts,
144
+ // ADR-0074).
145
+ //
146
+ // Supported layouts (both may coexist):
147
+ // repoPath/skill-name/SKILL.md ← Claude-style (directory per skill)
148
+ // repoPath/skill-name.md ← flat .md files
149
+ //
150
+ // Repos are scanned in created_at order; a later repo's skill wins over an
151
+ // earlier repo's (and over built-ins) when ids collide. Writes and deletes
152
+ // always target the one repo flagged `writable` in the DB, so the rest can
153
+ // be read-only clones of shared skill sets.
154
+ //
155
+ // Writing always uses the Claude-style layout so output is compatible with
156
+ // VS Code Copilot and any other tool that discovers skills by SKILL.md.
157
+ //
158
+ // Synchronous I/O is intentional: the caller (system-prompt assembly) is
159
+ // synchronous, and skill directories are small enough that readFileSync
160
+ // overhead is negligible per turn.
174
161
 
175
162
 
176
163
 
177
164
 
178
165
 
179
- // We inject the nextConfigOutput here so that we can use them in the route
180
- // module.
181
- const nextConfigOutput = "standalone"
182
- const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
183
- definition: {
184
- kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
185
- page: "/api/v1/skills/[id]/route",
186
- pathname: "/api/v1/skills/[id]",
187
- filename: "route",
188
- bundlePath: "app/api/v1/skills/[id]/route"
189
- },
190
- distDir: ".next" || 0,
191
- relativeProjectDir: false || '',
192
- resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/skills/[id]/route.ts",
193
- nextConfigOutput,
194
- // The lazy require factory ensures that:
195
- // - In dev: devRequestTimingInternalsEnd is set before userland executes,
196
- // correctly attributing module load time to application-code rather than
197
- // framework internals.
198
- // - In all modes: async modules (route files with top-level await) are
199
- // handled correctly — require() returns a Promise for such modules, which
200
- // ensureUserland() awaits before the first request is handled.
201
- userland: ()=>__webpack_require__(15431),
202
- // In Turbopack dev mode, also provide a synchronous per-request getter so
203
- // server HMR updates are picked up without re-executing the entry chunk.
204
- // Using require() (synchronous) avoids adding async overhead that would be
205
- // incorrectly attributed to application-code time in devRequestTiming.
206
- ... false ? 0 : {}
207
- });
208
- // Pull out the exports that we need to expose from the module. This should
209
- // be eliminated when we've moved the other routes to the new format. These
210
- // are used to hook into the route.
211
- const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
212
- function patchFetch() {
213
- return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
214
- workAsyncStorage,
215
- workUnitAsyncStorage
216
- });
166
+ // All enabled skill repo paths, in override order (later wins on id collision).
167
+ function getSkillsDirs() {
168
+ return (0,_lib_stores_skill_repos__WEBPACK_IMPORTED_MODULE_2__/* .listEnabledSkillRepos */ .cf)().map((r)=>r.path);
217
169
  }
218
-
219
- async function handler(req, res, ctx) {
220
- if (ctx.requestMeta) {
221
- (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
222
- }
223
- if (routeModule.isDev) {
224
- (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
225
- }
226
- let srcPage = "/api/v1/skills/[id]/route";
227
- // turbopack doesn't normalize `/index` in the page name
228
- // so we need to to process dynamic routes properly
229
- // TODO: fix turbopack providing differing value from webpack
230
- if (false) {} else if (srcPage === '/index') {
231
- // we always normalize /index specifically
232
- srcPage = '/';
233
- }
234
- const multiZoneDraftMode = false;
235
- const prepareResult = await routeModule.prepare(req, res, {
236
- srcPage,
237
- multiZoneDraftMode
238
- });
239
- if (!prepareResult) {
240
- res.statusCode = 400;
241
- res.end('Bad Request');
242
- ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
243
- return null;
244
- }
245
- const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
246
- const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
247
- // Only this route's prerenders can establish ISR or admit generated params.
248
- const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]) && (routeModule.isDev || (0,next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__.isRouteCacheOwner)(resolvedPathname, routeModule.cacheOwner, prerenderManifest.routes[resolvedPathname]));
249
- let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
250
- const render404 = async ()=>{
251
- // TODO: should route-module itself handle rendering the 404
252
- if (routerServerContext == null ? void 0 : routerServerContext.render404) {
253
- await routerServerContext.render404(req, res, parsedUrl, false);
254
- } else {
255
- res.end('This page could not be found');
170
+ // The writable skill repo's path, or "" if none is configured.
171
+ function getSkillsDir() {
172
+ return (0,_lib_stores_skill_repos__WEBPACK_IMPORTED_MODULE_2__/* .getWritableSkillRepo */ .i4)()?.path ?? "";
173
+ }
174
+ function getBuiltinSkillsDir() {
175
+ return node_path__WEBPACK_IMPORTED_MODULE_1___default().join(process.cwd(), "lib", "skills", "builtins");
176
+ }
177
+ function parseSkill(id, content, source) {
178
+ const lines = content.split("\n");
179
+ let name = id;
180
+ const descParts = [];
181
+ let headingFound = false;
182
+ for (const line of lines){
183
+ if (!headingFound && line.startsWith("# ")) {
184
+ name = line.slice(2).trim();
185
+ headingFound = true;
186
+ continue;
256
187
  }
257
- return null;
188
+ if (headingFound) {
189
+ if (line.startsWith("#")) break;
190
+ if (line.trim() === "" && descParts.length > 0) break;
191
+ if (line.trim()) descParts.push(line.trim());
192
+ }
193
+ }
194
+ return {
195
+ id,
196
+ name,
197
+ description: descParts.join(" ").slice(0, 200),
198
+ source
258
199
  };
259
- if (isIsr && !isDraftMode) {
260
- const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
261
- if (prerenderInfo) {
262
- if (prerenderInfo.fallback === false && !isPrerendered) {
263
- if (nextConfig.adapterPath) {
264
- return await render404();
265
- }
266
- throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
200
+ }
201
+ // listSkills() readdirs every skill repo and reads each SKILL.md, and the
202
+ // system prompt calls it on every turn — measured at 1.85 ms for 3 skills,
203
+ // ~60% of prompt assembly, because the cost is disk rather than row count.
204
+ // Same shape as the drop-in tool cache in lib/tools/external.ts: a short TTL
205
+ // so hand-edited files still appear promptly, plus explicit invalidation from
206
+ // the in-process write paths so write_skill is visible on the very next turn.
207
+ // listSkills() readdirs every skill repo and reads each SKILL.md, and the
208
+ // system prompt calls it on every turn — measured at 1.85 ms for 3 skills,
209
+ // ~60% of prompt assembly, because the cost is disk rather than row count.
210
+ // The key covers repo enable/disable, which changes the result without
211
+ // touching any skill file; the TTL only bounds hand edits made outside the app.
212
+ const skillsCache = (0,_lib_cache_keyed_cache__WEBPACK_IMPORTED_MODULE_3__/* .createKeyedCache */ .J)({
213
+ ttlMs: 5000,
214
+ key: ()=>[
215
+ getBuiltinSkillsDir(),
216
+ ...getSkillsDirs()
217
+ ].join("|"),
218
+ load: ()=>{
219
+ const byId = new Map();
220
+ for (const skill of readSkillsFromDir(getBuiltinSkillsDir(), "builtin")){
221
+ byId.set(skill.id, skill);
222
+ }
223
+ for (const dir of getSkillsDirs()){
224
+ for (const skill of readSkillsFromDir(dir, "user")){
225
+ byId.set(skill.id, skill);
267
226
  }
268
227
  }
228
+ return Array.from(byId.values()).sort((a, b)=>a.id.localeCompare(b.id));
269
229
  }
270
- let cacheKey = null;
271
- if (isIsr && !routeModule.isDev && !isDraftMode) {
272
- cacheKey = resolvedPathname;
273
- // ensure /index and / is normalized to one key
274
- cacheKey = cacheKey === '/index' ? '/' : cacheKey;
275
- }
276
- // Before rendering (which initializes component tree modules), we have to
277
- // set the reference manifests to our global store so Server Action's
278
- // encryption util can access to them at the top level of the page module.
279
- if (serverActionsManifest && clientReferenceManifest) {
280
- (0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
281
- page: srcPage,
282
- clientReferenceManifest,
283
- serverActionsManifest
284
- });
285
- }
286
- const method = req.method || 'GET';
287
- const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
288
- const activeSpan = tracer.getActiveScopeSpan();
289
- const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
290
- const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
291
- const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
292
- incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
293
- globalThis.__incrementalCache = incrementalCache;
294
- const context = {
295
- params,
296
- previewProps,
297
- renderOpts: {
298
- experimental: {
299
- authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
300
- useCacheTimeout: nextConfig.experimental.useCacheTimeout,
301
- durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
302
- },
303
- cacheComponents: Boolean(nextConfig.cacheComponents),
304
- validationLevel: nextConfig.experimental.instantInsights.validationLevel,
305
- isDraftMode,
306
- incrementalCache,
307
- hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
308
- cacheLifeProfiles: nextConfig.cacheLife,
309
- staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
310
- waitUntil: ctx.waitUntil,
311
- onClose: (cb)=>{
312
- res.on('close', cb);
313
- },
314
- onAfterTaskError: undefined
315
- },
316
- sharedContext: {
317
- buildId,
318
- deploymentId
230
+ });
231
+ /** Drop the cached skill list. Call after any write to a skill repo. */ function invalidateSkillsCache() {
232
+ skillsCache.invalidate();
233
+ }
234
+ function listSkills() {
235
+ return skillsCache.get();
236
+ }
237
+ function readSkillsFromDir(dir, source) {
238
+ if (!dir || !(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(dir)) return [];
239
+ let entries;
240
+ try {
241
+ entries = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(dir, {
242
+ withFileTypes: true
243
+ }).map((e)=>({
244
+ name: e.name,
245
+ isDir: e.isDirectory()
246
+ }));
247
+ } catch {
248
+ return [];
249
+ }
250
+ const skills = [];
251
+ for (const entry of entries){
252
+ if (entry.isDir) {
253
+ const skillFile = node_path__WEBPACK_IMPORTED_MODULE_1___default().join(dir, entry.name, "SKILL.md");
254
+ if (!(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(skillFile)) continue;
255
+ try {
256
+ const content = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(skillFile, "utf8");
257
+ skills.push(parseSkill(entry.name, content, source));
258
+ } catch {}
259
+ } else if (entry.name.endsWith(".md")) {
260
+ const id = entry.name.slice(0, -3);
261
+ try {
262
+ const content = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(node_path__WEBPACK_IMPORTED_MODULE_1___default().join(dir, entry.name), "utf8");
263
+ skills.push(parseSkill(id, content, source));
264
+ } catch {}
319
265
  }
320
- };
321
- const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
322
- const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
323
- const nextReq = next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.signalFromNodeResponse)(res));
324
- const responseGenerator = async ({ previousCacheEntry })=>{
266
+ }
267
+ return skills;
268
+ }
269
+ function getSkill(id) {
270
+ if (!sanitizeId(id)) return null;
271
+ // Later directories override earlier ones, so search in reverse.
272
+ const dirs = getSkillsDirs();
273
+ for(let i = dirs.length - 1; i >= 0; i--){
274
+ const user = readSkillFromDir(dirs[i], id, "user");
275
+ if (user) return user;
276
+ }
277
+ return readSkillFromDir(getBuiltinSkillsDir(), id, "builtin");
278
+ }
279
+ function readSkillFromDir(dir, id, source) {
280
+ if (!dir) return null;
281
+ // Claude-style first
282
+ const claudeFile = node_path__WEBPACK_IMPORTED_MODULE_1___default().join(dir, id, "SKILL.md");
283
+ if ((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(claudeFile)) {
325
284
  try {
326
- if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
327
- res.statusCode = 404;
328
- // on-demand revalidate always sets this header
329
- res.setHeader('x-nextjs-cache', 'REVALIDATED');
330
- res.end('This page could not be found');
331
- return null;
332
- }
333
- const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
334
- req.fetchMetrics = context.renderOpts.fetchMetrics;
335
- let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
336
- // Attempt using provided waitUntil if available
337
- // if it's not we fallback to sendResponse's handling
338
- if (pendingWaitUntil) {
339
- if (ctx.waitUntil) {
340
- ctx.waitUntil(pendingWaitUntil);
341
- pendingWaitUntil = undefined;
342
- }
343
- }
344
- const cacheTags = context.renderOpts.collectedTags;
345
- // If the request is for a static response, we can cache it so long
346
- // as it's not edge.
347
- if (isIsr) {
348
- const blob = await response.blob();
349
- // Copy the headers from the response.
350
- const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
351
- if (cacheTags) {
352
- headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
353
- }
354
- if (!headers['content-type'] && blob.type) {
355
- headers['content-type'] = blob.type;
356
- }
357
- const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
358
- const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? // route has a numeric `revalidate` but didn't declare an
359
- // explicit `expire` (e.g. via `cacheLife`). This mirrors the
360
- // build-time fallback in `build/index.ts` so cache entries
361
- // and the response Cache-Control header agree on the route's
362
- // effective expire. Routes that opt out of revalidation
363
- // (`revalidate: false`) or that are dynamic (`revalidate: 0`)
364
- // keep `expire: undefined`.
365
- revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
366
- // Create the cache entry for the response.
367
- const cacheEntry = {
368
- value: {
369
- kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
370
- status: response.status,
371
- body: Buffer.from(await blob.arrayBuffer()),
372
- headers
373
- },
374
- cacheControl: {
375
- revalidate,
376
- expire
377
- }
378
- };
379
- return cacheEntry;
380
- } else {
381
- // send response without caching if not ISR
382
- await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
383
- return null;
384
- }
385
- } catch (err) {
386
- // if this is a background revalidate we need to report
387
- // the request error here as it won't be bubbled
388
- if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
389
- const silenceLog = false;
390
- await routeModule.onRequestError(req, err, {
391
- routerKind: 'App Router',
392
- routePath: srcPage,
393
- routeType: 'route',
394
- revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
395
- isStaticGeneration: cacheKey !== null,
396
- isOnDemandRevalidate
397
- })
398
- }, silenceLog, routerServerContext);
399
- }
400
- throw err;
401
- }
402
- };
403
- const handleResponse = async (currentSpan, parentSpan)=>{
404
- try {
405
- var _cacheEntry_value;
406
- const cacheEntry = await routeModule.handleResponse({
407
- req,
408
- nextConfig,
409
- cacheKey,
410
- routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
411
- isFallback: false,
412
- previewProps,
413
- prerenderManifest,
414
- isRoutePPREnabled: false,
415
- isOnDemandRevalidate,
416
- revalidateOnlyGenerated,
417
- responseGenerator,
418
- waitUntil: ctx.waitUntil,
419
- isMinimalMode
420
- });
421
- if (cacheEntry !== null && 'error' in cacheEntry) {
422
- throw cacheEntry.error;
423
- }
424
- // we don't create a cacheEntry for ISR
425
- if (!isIsr) {
426
- return;
427
- }
428
- if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE) {
429
- var _cacheEntry_value1;
430
- throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
431
- }
432
- if (!isMinimalMode) {
433
- res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
434
- }
435
- // Draft mode should never be cached
436
- if (isDraftMode) {
437
- res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
438
- }
439
- const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
440
- if (!(isMinimalMode && isIsr)) {
441
- headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
442
- }
443
- // If cache control is already set on the response we don't
444
- // override it to allow users to customize it via next.config
445
- if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
446
- headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
447
- }
448
- await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.
449
- new Response(cacheEntry.value.body, {
450
- headers,
451
- status: cacheEntry.value.status || 200
452
- }));
453
- return;
454
- } catch (err) {
455
- if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
456
- const silenceLog = false;
457
- await routeModule.onRequestError(req, err, {
458
- routerKind: 'App Router',
459
- routePath: normalizedSrcPage,
460
- routeType: 'route',
461
- revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
462
- isStaticGeneration: cacheKey !== null,
463
- isOnDemandRevalidate
464
- })
465
- }, silenceLog, routerServerContext);
466
- }
467
- // rethrow so that we can handle serving error page
468
- // If this is during static generation, throw the error again.
469
- if (isIsr) throw err;
470
- // Otherwise, send a 500 response unless the original response has
471
- // already committed. In that case, preserve its status code for
472
- // telemetry while still recording the failure and terminating a response
473
- // that the failed pipeline left open.
474
- if (res.headersSent) {
475
- if (currentSpan) {
476
- const error = err instanceof Error ? err : new Error('Unknown app route error');
477
- currentSpan.recordException(error);
478
- currentSpan.setStatus({
479
- code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
480
- message: error.message
481
- });
482
- currentSpan.setAttribute('error.type', error.name);
483
- }
484
- if (!res.writableEnded && !res.destroyed) {
485
- res.end();
486
- }
487
- } else {
488
- await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
489
- status: 500
490
- }));
491
- }
492
- return;
493
- } finally{
494
- ;
495
- (()=>{
496
- if (!currentSpan) {
497
- return;
498
- }
499
- let statusCode = res.statusCode;
500
- currentSpan.setAttributes({
501
- 'http.status_code': statusCode,
502
- 'next.rsc': false
503
- });
504
- if (statusCode && statusCode >= 500) {
505
- // For 5xx status codes: SHOULD be set to 'Error' span status.
506
- // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
507
- currentSpan.setStatus({
508
- code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
509
- });
510
- // For span status 'Error', SHOULD set 'error.type' attribute.
511
- currentSpan.setAttribute('error.type', statusCode.toString());
512
- }
513
- const rootSpanAttributes = tracer.getRootSpanAttributes();
514
- // We were unable to get attributes, probably OTEL is not enabled
515
- if (!rootSpanAttributes) {
516
- return;
517
- }
518
- if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
519
- console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
520
- return;
521
- }
522
- const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
523
- const name = `${method} ${route}`;
524
- currentSpan.setAttributes({
525
- 'next.route': route,
526
- 'http.route': route,
527
- 'next.span_name': name
528
- });
529
- currentSpan.updateName(name);
530
- // Propagate http.route to the parent span if one exists (e.g.
531
- // a platform-created HTTP span in adapter deployments).
532
- if (parentSpan && parentSpan !== currentSpan) {
533
- parentSpan.setAttribute('http.route', route);
534
- parentSpan.updateName(name);
535
- }
536
- })();
537
- }
538
- };
539
- // TODO: activeSpan code path is for when wrapped by
540
- // next-server can be removed when this is no longer used
541
- if (isWrappedByNextServer && activeSpan) {
542
- await handleResponse(activeSpan, undefined);
543
- } else {
544
- let parentSpan = tracer.getActiveScopeSpan();
545
- await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
546
- spanName: `${method} ${srcPage}`,
547
- kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
548
- attributes: {
549
- 'http.method': method,
550
- 'http.target': req.url
551
- }
552
- }, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
553
- }
554
- }
555
-
556
- //# sourceMappingURL=app-route.js.map
557
-
558
-
559
- /***/ }),
560
-
561
- /***/ 19121:
562
- /***/ ((module) => {
563
-
564
- module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
565
-
566
- /***/ }),
567
-
568
- /***/ 21455:
569
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
570
-
571
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
572
- /* harmony export */ SK: () => (/* binding */ getSkill),
573
- /* harmony export */ YJ: () => (/* binding */ getSkillsDir),
574
- /* harmony export */ bG: () => (/* binding */ listSkills),
575
- /* harmony export */ hI: () => (/* binding */ writeSkill),
576
- /* harmony export */ hp: () => (/* binding */ deleteSkill),
577
- /* harmony export */ nh: () => (/* binding */ getSkillsDirs)
578
- /* harmony export */ });
579
- /* unused harmony exports getBuiltinSkillsDir, invalidateSkillsCache */
580
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
581
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_fs__WEBPACK_IMPORTED_MODULE_0__);
582
- /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76760);
583
- /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(node_path__WEBPACK_IMPORTED_MODULE_1__);
584
- /* harmony import */ var _lib_stores_skill_repos__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70106);
585
- /* harmony import */ var _lib_cache_keyed_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65700);
586
- // Skills loader — reads packaged built-in skills plus user SKILL.md files
587
- // from the repos in the `skill_repos` table (lib/stores/skill-repos.ts,
588
- // ADR-0074).
589
- //
590
- // Supported layouts (both may coexist):
591
- // repoPath/skill-name/SKILL.md ← Claude-style (directory per skill)
592
- // repoPath/skill-name.md ← flat .md files
593
- //
594
- // Repos are scanned in created_at order; a later repo's skill wins over an
595
- // earlier repo's (and over built-ins) when ids collide. Writes and deletes
596
- // always target the one repo flagged `writable` in the DB, so the rest can
597
- // be read-only clones of shared skill sets.
598
- //
599
- // Writing always uses the Claude-style layout so output is compatible with
600
- // VS Code Copilot and any other tool that discovers skills by SKILL.md.
601
- //
602
- // Synchronous I/O is intentional: the caller (system-prompt assembly) is
603
- // synchronous, and skill directories are small enough that readFileSync
604
- // overhead is negligible per turn.
605
-
606
-
607
-
608
-
609
-
610
- // All enabled skill repo paths, in override order (later wins on id collision).
611
- function getSkillsDirs() {
612
- return (0,_lib_stores_skill_repos__WEBPACK_IMPORTED_MODULE_2__/* .listEnabledSkillRepos */ .cf)().map((r)=>r.path);
613
- }
614
- // The writable skill repo's path, or "" if none is configured.
615
- function getSkillsDir() {
616
- return (0,_lib_stores_skill_repos__WEBPACK_IMPORTED_MODULE_2__/* .getWritableSkillRepo */ .i4)()?.path ?? "";
617
- }
618
- function getBuiltinSkillsDir() {
619
- return node_path__WEBPACK_IMPORTED_MODULE_1___default().join(process.cwd(), "lib", "skills", "builtins");
620
- }
621
- function parseSkill(id, content, source) {
622
- const lines = content.split("\n");
623
- let name = id;
624
- const descParts = [];
625
- let headingFound = false;
626
- for (const line of lines){
627
- if (!headingFound && line.startsWith("# ")) {
628
- name = line.slice(2).trim();
629
- headingFound = true;
630
- continue;
631
- }
632
- if (headingFound) {
633
- if (line.startsWith("#")) break;
634
- if (line.trim() === "" && descParts.length > 0) break;
635
- if (line.trim()) descParts.push(line.trim());
636
- }
637
- }
638
- return {
639
- id,
640
- name,
641
- description: descParts.join(" ").slice(0, 200),
642
- source
643
- };
644
- }
645
- // listSkills() readdirs every skill repo and reads each SKILL.md, and the
646
- // system prompt calls it on every turn — measured at 1.85 ms for 3 skills,
647
- // ~60% of prompt assembly, because the cost is disk rather than row count.
648
- // Same shape as the drop-in tool cache in lib/tools/external.ts: a short TTL
649
- // so hand-edited files still appear promptly, plus explicit invalidation from
650
- // the in-process write paths so write_skill is visible on the very next turn.
651
- // listSkills() readdirs every skill repo and reads each SKILL.md, and the
652
- // system prompt calls it on every turn — measured at 1.85 ms for 3 skills,
653
- // ~60% of prompt assembly, because the cost is disk rather than row count.
654
- // The key covers repo enable/disable, which changes the result without
655
- // touching any skill file; the TTL only bounds hand edits made outside the app.
656
- const skillsCache = (0,_lib_cache_keyed_cache__WEBPACK_IMPORTED_MODULE_3__/* .createKeyedCache */ .J)({
657
- ttlMs: 5000,
658
- key: ()=>[
659
- getBuiltinSkillsDir(),
660
- ...getSkillsDirs()
661
- ].join("|"),
662
- load: ()=>{
663
- const byId = new Map();
664
- for (const skill of readSkillsFromDir(getBuiltinSkillsDir(), "builtin")){
665
- byId.set(skill.id, skill);
666
- }
667
- for (const dir of getSkillsDirs()){
668
- for (const skill of readSkillsFromDir(dir, "user")){
669
- byId.set(skill.id, skill);
670
- }
671
- }
672
- return Array.from(byId.values()).sort((a, b)=>a.id.localeCompare(b.id));
673
- }
674
- });
675
- /** Drop the cached skill list. Call after any write to a skill repo. */ function invalidateSkillsCache() {
676
- skillsCache.invalidate();
677
- }
678
- function listSkills() {
679
- return skillsCache.get();
680
- }
681
- function readSkillsFromDir(dir, source) {
682
- if (!dir || !(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(dir)) return [];
683
- let entries;
684
- try {
685
- entries = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(dir, {
686
- withFileTypes: true
687
- }).map((e)=>({
688
- name: e.name,
689
- isDir: e.isDirectory()
690
- }));
691
- } catch {
692
- return [];
693
- }
694
- const skills = [];
695
- for (const entry of entries){
696
- if (entry.isDir) {
697
- const skillFile = node_path__WEBPACK_IMPORTED_MODULE_1___default().join(dir, entry.name, "SKILL.md");
698
- if (!(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(skillFile)) continue;
699
- try {
700
- const content = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(skillFile, "utf8");
701
- skills.push(parseSkill(entry.name, content, source));
702
- } catch {}
703
- } else if (entry.name.endsWith(".md")) {
704
- const id = entry.name.slice(0, -3);
705
- try {
706
- const content = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(node_path__WEBPACK_IMPORTED_MODULE_1___default().join(dir, entry.name), "utf8");
707
- skills.push(parseSkill(id, content, source));
708
- } catch {}
709
- }
710
- }
711
- return skills;
712
- }
713
- function getSkill(id) {
714
- if (!sanitizeId(id)) return null;
715
- // Later directories override earlier ones, so search in reverse.
716
- const dirs = getSkillsDirs();
717
- for(let i = dirs.length - 1; i >= 0; i--){
718
- const user = readSkillFromDir(dirs[i], id, "user");
719
- if (user) return user;
720
- }
721
- return readSkillFromDir(getBuiltinSkillsDir(), id, "builtin");
722
- }
723
- function readSkillFromDir(dir, id, source) {
724
- if (!dir) return null;
725
- // Claude-style first
726
- const claudeFile = node_path__WEBPACK_IMPORTED_MODULE_1___default().join(dir, id, "SKILL.md");
727
- if ((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(claudeFile)) {
728
- try {
729
- const content = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(claudeFile, "utf8");
730
- return {
731
- ...parseSkill(id, content, source),
732
- content
733
- };
734
- } catch {}
735
- }
736
- // Flat .md
737
- const flatFile = node_path__WEBPACK_IMPORTED_MODULE_1___default().join(dir, `${id}.md`);
738
- if ((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(flatFile)) {
285
+ const content = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(claudeFile, "utf8");
286
+ return {
287
+ ...parseSkill(id, content, source),
288
+ content
289
+ };
290
+ } catch {}
291
+ }
292
+ // Flat .md
293
+ const flatFile = node_path__WEBPACK_IMPORTED_MODULE_1___default().join(dir, `${id}.md`);
294
+ if ((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(flatFile)) {
739
295
  try {
740
296
  const content = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(flatFile, "utf8");
741
297
  return {
@@ -910,174 +466,618 @@ function noStoreJson(data) {
910
466
  headers: {
911
467
  "Cache-Control": "no-store"
912
468
  }
913
- });
914
- }
915
- // Validate a JSON request body against a zod schema.
916
- // Returns either the parsed data or a 400 NextResponse explaining the issue.
917
- // Caller pattern:
918
- // const parsed = await validateBody(req, Schema);
919
- // if (parsed instanceof NextResponse) return parsed;
920
- // // use parsed.field
921
- async function validateBody(req, schema) {
922
- let raw;
923
- try {
924
- raw = await req.json();
925
- } catch {
926
- return errorResponse("Request body must be valid JSON", 400);
927
- }
928
- const parsed = schema.safeParse(raw);
929
- if (!parsed.success) {
930
- return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
931
- }
932
- return parsed.data;
933
- }
934
-
935
-
936
- /***/ }),
937
-
938
- /***/ 44708:
939
- /***/ ((module) => {
940
-
941
- module.exports = require("node:https");
942
-
943
- /***/ }),
944
-
945
- /***/ 44870:
946
- /***/ ((module) => {
947
-
948
- module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
949
-
950
- /***/ }),
951
-
952
- /***/ 48161:
953
- /***/ ((module) => {
954
-
955
- module.exports = require("node:os");
956
-
957
- /***/ }),
958
-
959
- /***/ 51455:
960
- /***/ ((module) => {
961
-
962
- module.exports = require("node:fs/promises");
963
-
964
- /***/ }),
965
-
966
- /***/ 55511:
967
- /***/ ((module) => {
968
-
969
- module.exports = require("crypto");
970
-
971
- /***/ }),
972
-
973
- /***/ 55591:
974
- /***/ ((module) => {
975
-
976
- module.exports = require("https");
977
-
978
- /***/ }),
979
-
980
- /***/ 57075:
981
- /***/ ((module) => {
982
-
983
- module.exports = require("node:stream");
984
-
985
- /***/ }),
986
-
987
- /***/ 57975:
988
- /***/ ((module) => {
989
-
990
- module.exports = require("node:util");
991
-
992
- /***/ }),
993
-
994
- /***/ 63033:
995
- /***/ ((module) => {
996
-
997
- module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
998
-
999
- /***/ }),
1000
-
1001
- /***/ 70106:
1002
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1003
-
1004
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1005
- /* harmony export */ A0: () => (/* binding */ getSkillRepoByPath),
1006
- /* harmony export */ Dk: () => (/* binding */ deleteSkillRepo),
1007
- /* harmony export */ MZ: () => (/* binding */ getSkillRepo),
1008
- /* harmony export */ bo: () => (/* binding */ listSkillRepos),
1009
- /* harmony export */ cf: () => (/* binding */ listEnabledSkillRepos),
1010
- /* harmony export */ hI: () => (/* binding */ updateSkillRepo),
1011
- /* harmony export */ i4: () => (/* binding */ getWritableSkillRepo),
1012
- /* harmony export */ qz: () => (/* binding */ createSkillRepo)
1013
- /* harmony export */ });
1014
- /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77598);
1015
- /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_crypto__WEBPACK_IMPORTED_MODULE_0__);
1016
- /* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46);
1017
- // CRUD for the `skill_repos` table (ADR-0074). A repo is a directory the
1018
- // user has asked Jarela to scan for */SKILL.md (Claude-style) and *.md
1019
- // skill files, layered over the packaged built-ins.
1020
-
1021
-
1022
- const now = ()=>new Date().toISOString();
1023
- // Scan/override order: created_at ASC — a later repo's skill wins over an
1024
- // earlier repo's on id collision, so callers should apply rows in this order.
1025
- function listSkillRepos() {
1026
- return (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos ORDER BY created_at ASC").all();
1027
- }
1028
- function listEnabledSkillRepos() {
1029
- return (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos WHERE enabled=1 ORDER BY created_at ASC").all();
1030
- }
1031
- function getSkillRepo(id) {
1032
- const row = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos WHERE id=?").get(id);
1033
- return row ?? null;
1034
- }
1035
- function getSkillRepoByPath(path) {
1036
- const row = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos WHERE path=?").get(path);
1037
- return row ?? null;
1038
- }
1039
- // At most one repo may be writable at a time — write_skill/delete_skill
1040
- // target it. Undefined = "leave as-is" for updateSkillRepo; false clears it.
1041
- function getWritableSkillRepo() {
1042
- const row = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos WHERE writable=1").get();
1043
- return row ?? null;
1044
- }
1045
- // The first repo added becomes writable by default so a fresh setup has
1046
- // somewhere to write to without an extra API call.
1047
- function createSkillRepo(input) {
1048
- const id = (0,node_crypto__WEBPACK_IMPORTED_MODULE_0__.randomUUID)();
1049
- const t = now();
1050
- const makeWritable = input.writable ?? getWritableSkillRepo() === null;
1051
- const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)();
1052
- if (makeWritable) {
1053
- db.prepare("UPDATE skill_repos SET writable=0, updated_at=? WHERE writable=1").run(t);
1054
- }
1055
- db.prepare(`INSERT INTO skill_repos (id, path, label, writable, enabled, created_at, updated_at)
1056
- VALUES (?, ?, ?, ?, 1, ?, ?)`).run(id, input.path, input.label ?? null, makeWritable ? 1 : 0, t, t);
1057
- return getSkillRepo(id);
1058
- }
1059
- function updateSkillRepo(id, patch) {
1060
- const existing = getSkillRepo(id);
1061
- if (!existing) return null;
1062
- const t = now();
1063
- const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)();
1064
- if (patch.writable) {
1065
- db.prepare("UPDATE skill_repos SET writable=0, updated_at=? WHERE writable=1 AND id<>?").run(t, id);
469
+ });
470
+ }
471
+ // Validate a JSON request body against a zod schema.
472
+ // Returns either the parsed data or a 400 NextResponse explaining the issue.
473
+ // Caller pattern:
474
+ // const parsed = await validateBody(req, Schema);
475
+ // if (parsed instanceof NextResponse) return parsed;
476
+ // // use parsed.field
477
+ async function validateBody(req, schema) {
478
+ let raw;
479
+ try {
480
+ raw = await req.json();
481
+ } catch {
482
+ return errorResponse("Request body must be valid JSON", 400);
483
+ }
484
+ const parsed = schema.safeParse(raw);
485
+ if (!parsed.success) {
486
+ return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
487
+ }
488
+ return parsed.data;
489
+ }
490
+
491
+
492
+ /***/ }),
493
+
494
+ /***/ 44708:
495
+ /***/ ((module) => {
496
+
497
+ module.exports = require("node:https");
498
+
499
+ /***/ }),
500
+
501
+ /***/ 44870:
502
+ /***/ ((module) => {
503
+
504
+ module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
505
+
506
+ /***/ }),
507
+
508
+ /***/ 48161:
509
+ /***/ ((module) => {
510
+
511
+ module.exports = require("node:os");
512
+
513
+ /***/ }),
514
+
515
+ /***/ 51455:
516
+ /***/ ((module) => {
517
+
518
+ module.exports = require("node:fs/promises");
519
+
520
+ /***/ }),
521
+
522
+ /***/ 55511:
523
+ /***/ ((module) => {
524
+
525
+ module.exports = require("crypto");
526
+
527
+ /***/ }),
528
+
529
+ /***/ 55591:
530
+ /***/ ((module) => {
531
+
532
+ module.exports = require("https");
533
+
534
+ /***/ }),
535
+
536
+ /***/ 57075:
537
+ /***/ ((module) => {
538
+
539
+ module.exports = require("node:stream");
540
+
541
+ /***/ }),
542
+
543
+ /***/ 57975:
544
+ /***/ ((module) => {
545
+
546
+ module.exports = require("node:util");
547
+
548
+ /***/ }),
549
+
550
+ /***/ 63033:
551
+ /***/ ((module) => {
552
+
553
+ module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
554
+
555
+ /***/ }),
556
+
557
+ /***/ 70106:
558
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
559
+
560
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
561
+ /* harmony export */ A0: () => (/* binding */ getSkillRepoByPath),
562
+ /* harmony export */ Dk: () => (/* binding */ deleteSkillRepo),
563
+ /* harmony export */ MZ: () => (/* binding */ getSkillRepo),
564
+ /* harmony export */ bo: () => (/* binding */ listSkillRepos),
565
+ /* harmony export */ cf: () => (/* binding */ listEnabledSkillRepos),
566
+ /* harmony export */ hI: () => (/* binding */ updateSkillRepo),
567
+ /* harmony export */ i4: () => (/* binding */ getWritableSkillRepo),
568
+ /* harmony export */ qz: () => (/* binding */ createSkillRepo)
569
+ /* harmony export */ });
570
+ /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77598);
571
+ /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_crypto__WEBPACK_IMPORTED_MODULE_0__);
572
+ /* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46);
573
+ // CRUD for the `skill_repos` table (ADR-0074). A repo is a directory the
574
+ // user has asked Jarela to scan for */SKILL.md (Claude-style) and *.md
575
+ // skill files, layered over the packaged built-ins.
576
+
577
+
578
+ const now = ()=>new Date().toISOString();
579
+ // Scan/override order: created_at ASC — a later repo's skill wins over an
580
+ // earlier repo's on id collision, so callers should apply rows in this order.
581
+ function listSkillRepos() {
582
+ return (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos ORDER BY created_at ASC").all();
583
+ }
584
+ function listEnabledSkillRepos() {
585
+ return (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos WHERE enabled=1 ORDER BY created_at ASC").all();
586
+ }
587
+ function getSkillRepo(id) {
588
+ const row = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos WHERE id=?").get(id);
589
+ return row ?? null;
590
+ }
591
+ function getSkillRepoByPath(path) {
592
+ const row = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos WHERE path=?").get(path);
593
+ return row ?? null;
594
+ }
595
+ // At most one repo may be writable at a time — write_skill/delete_skill
596
+ // target it. Undefined = "leave as-is" for updateSkillRepo; false clears it.
597
+ function getWritableSkillRepo() {
598
+ const row = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("SELECT * FROM skill_repos WHERE writable=1").get();
599
+ return row ?? null;
600
+ }
601
+ // The first repo added becomes writable by default so a fresh setup has
602
+ // somewhere to write to without an extra API call.
603
+ function createSkillRepo(input) {
604
+ const id = (0,node_crypto__WEBPACK_IMPORTED_MODULE_0__.randomUUID)();
605
+ const t = now();
606
+ const makeWritable = input.writable ?? getWritableSkillRepo() === null;
607
+ const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)();
608
+ if (makeWritable) {
609
+ db.prepare("UPDATE skill_repos SET writable=0, updated_at=? WHERE writable=1").run(t);
610
+ }
611
+ db.prepare(`INSERT INTO skill_repos (id, path, label, writable, enabled, created_at, updated_at)
612
+ VALUES (?, ?, ?, ?, 1, ?, ?)`).run(id, input.path, input.label ?? null, makeWritable ? 1 : 0, t, t);
613
+ return getSkillRepo(id);
614
+ }
615
+ function updateSkillRepo(id, patch) {
616
+ const existing = getSkillRepo(id);
617
+ if (!existing) return null;
618
+ const t = now();
619
+ const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)();
620
+ if (patch.writable) {
621
+ db.prepare("UPDATE skill_repos SET writable=0, updated_at=? WHERE writable=1 AND id<>?").run(t, id);
622
+ }
623
+ db.prepare("UPDATE skill_repos SET label=?, enabled=?, writable=?, updated_at=? WHERE id=?").run(patch.label === undefined ? existing.label : patch.label, patch.enabled === undefined ? existing.enabled : patch.enabled ? 1 : 0, patch.writable === undefined ? existing.writable : patch.writable ? 1 : 0, t, id);
624
+ return getSkillRepo(id);
625
+ }
626
+ function deleteSkillRepo(id) {
627
+ return (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("DELETE FROM skill_repos WHERE id=?").run(id).changes > 0;
628
+ }
629
+
630
+
631
+ /***/ }),
632
+
633
+ /***/ 73024:
634
+ /***/ ((module) => {
635
+
636
+ module.exports = require("node:fs");
637
+
638
+ /***/ }),
639
+
640
+ /***/ 74303:
641
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
642
+
643
+ __webpack_require__.r(__webpack_exports__);
644
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
645
+ /* harmony export */ handler: () => (/* binding */ handler),
646
+ /* harmony export */ patchFetch: () => (/* binding */ patchFetch),
647
+ /* harmony export */ routeModule: () => (/* binding */ routeModule),
648
+ /* harmony export */ serverHooks: () => (/* binding */ serverHooks),
649
+ /* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
650
+ /* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
651
+ /* harmony export */ });
652
+ /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
653
+ /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__);
654
+ /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
655
+ /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
656
+ /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__);
657
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
658
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__);
659
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
660
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__);
661
+ /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
662
+ /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__);
663
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
664
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__);
665
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
666
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__);
667
+ /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
668
+ /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__);
669
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
670
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__);
671
+ /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
672
+ /* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
673
+ /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
674
+ /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__);
675
+ /* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
676
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
677
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
678
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
679
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__);
680
+ /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
681
+ /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__);
682
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
683
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__);
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+ // We inject the nextConfigOutput here so that we can use them in the route
703
+ // module.
704
+ const nextConfigOutput = "standalone"
705
+ const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
706
+ definition: {
707
+ kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
708
+ page: "/api/v1/skills/[id]/route",
709
+ pathname: "/api/v1/skills/[id]",
710
+ filename: "route",
711
+ bundlePath: "app/api/v1/skills/[id]/route"
712
+ },
713
+ distDir: ".next" || 0,
714
+ relativeProjectDir: false || '',
715
+ resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/skills/[id]/route.ts",
716
+ nextConfigOutput,
717
+ // The lazy require factory ensures that:
718
+ // - In dev: devRequestTimingInternalsEnd is set before userland executes,
719
+ // correctly attributing module load time to application-code rather than
720
+ // framework internals.
721
+ // - In all modes: async modules (route files with top-level await) are
722
+ // handled correctly — require() returns a Promise for such modules, which
723
+ // ensureUserland() awaits before the first request is handled.
724
+ userland: ()=>__webpack_require__(15431),
725
+ // In Turbopack dev mode, also provide a synchronous per-request getter so
726
+ // server HMR updates are picked up without re-executing the entry chunk.
727
+ // Using require() (synchronous) avoids adding async overhead that would be
728
+ // incorrectly attributed to application-code time in devRequestTiming.
729
+ ... false ? 0 : {}
730
+ });
731
+ // Pull out the exports that we need to expose from the module. This should
732
+ // be eliminated when we've moved the other routes to the new format. These
733
+ // are used to hook into the route.
734
+ const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
735
+ function patchFetch() {
736
+ return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
737
+ workAsyncStorage,
738
+ workUnitAsyncStorage
739
+ });
740
+ }
741
+
742
+ async function handler(req, res, ctx) {
743
+ if (ctx.requestMeta) {
744
+ (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
745
+ }
746
+ if (routeModule.isDev) {
747
+ (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
748
+ }
749
+ let srcPage = "/api/v1/skills/[id]/route";
750
+ // turbopack doesn't normalize `/index` in the page name
751
+ // so we need to to process dynamic routes properly
752
+ // TODO: fix turbopack providing differing value from webpack
753
+ if (false) {} else if (srcPage === '/index') {
754
+ // we always normalize /index specifically
755
+ srcPage = '/';
756
+ }
757
+ const multiZoneDraftMode = false;
758
+ const prepareResult = await routeModule.prepare(req, res, {
759
+ srcPage,
760
+ multiZoneDraftMode
761
+ });
762
+ if (!prepareResult) {
763
+ res.statusCode = 400;
764
+ res.end('Bad Request');
765
+ ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
766
+ return null;
767
+ }
768
+ const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
769
+ const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
770
+ // Only this route's prerenders can establish ISR or admit generated params.
771
+ const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]) && (routeModule.isDev || (0,next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__.isRouteCacheOwner)(resolvedPathname, routeModule.cacheOwner, prerenderManifest.routes[resolvedPathname]));
772
+ let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
773
+ const render404 = async ()=>{
774
+ // TODO: should route-module itself handle rendering the 404
775
+ if (routerServerContext == null ? void 0 : routerServerContext.render404) {
776
+ await routerServerContext.render404(req, res, parsedUrl, false);
777
+ } else {
778
+ res.end('This page could not be found');
779
+ }
780
+ return null;
781
+ };
782
+ if (isIsr && !isDraftMode) {
783
+ const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
784
+ if (prerenderInfo) {
785
+ if (prerenderInfo.fallback === false && !isPrerendered) {
786
+ if (nextConfig.adapterPath) {
787
+ return await render404();
788
+ }
789
+ throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
790
+ }
791
+ }
792
+ }
793
+ let cacheKey = null;
794
+ if (isIsr && !routeModule.isDev && !isDraftMode) {
795
+ cacheKey = resolvedPathname;
796
+ // ensure /index and / is normalized to one key
797
+ cacheKey = cacheKey === '/index' ? '/' : cacheKey;
798
+ }
799
+ // Before rendering (which initializes component tree modules), we have to
800
+ // set the reference manifests to our global store so Server Action's
801
+ // encryption util can access to them at the top level of the page module.
802
+ if (serverActionsManifest && clientReferenceManifest) {
803
+ (0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
804
+ page: srcPage,
805
+ clientReferenceManifest,
806
+ serverActionsManifest
807
+ });
808
+ }
809
+ const method = req.method || 'GET';
810
+ const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
811
+ const activeSpan = tracer.getActiveScopeSpan();
812
+ const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
813
+ const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
814
+ const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
815
+ incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
816
+ globalThis.__incrementalCache = incrementalCache;
817
+ const context = {
818
+ params,
819
+ previewProps,
820
+ renderOpts: {
821
+ experimental: {
822
+ authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
823
+ useCacheTimeout: nextConfig.experimental.useCacheTimeout,
824
+ durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
825
+ },
826
+ cacheComponents: Boolean(nextConfig.cacheComponents),
827
+ validationLevel: nextConfig.experimental.instantInsights.validationLevel,
828
+ isDraftMode,
829
+ incrementalCache,
830
+ hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
831
+ cacheLifeProfiles: nextConfig.cacheLife,
832
+ staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
833
+ waitUntil: ctx.waitUntil,
834
+ onClose: (cb)=>{
835
+ res.on('close', cb);
836
+ },
837
+ onAfterTaskError: undefined
838
+ },
839
+ sharedContext: {
840
+ buildId,
841
+ deploymentId
842
+ }
843
+ };
844
+ const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
845
+ const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
846
+ const nextReq = next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.signalFromNodeResponse)(res));
847
+ const responseGenerator = async ({ previousCacheEntry })=>{
848
+ try {
849
+ if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
850
+ res.statusCode = 404;
851
+ // on-demand revalidate always sets this header
852
+ res.setHeader('x-nextjs-cache', 'REVALIDATED');
853
+ res.end('This page could not be found');
854
+ return null;
855
+ }
856
+ const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
857
+ req.fetchMetrics = context.renderOpts.fetchMetrics;
858
+ let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
859
+ // Attempt using provided waitUntil if available
860
+ // if it's not we fallback to sendResponse's handling
861
+ if (pendingWaitUntil) {
862
+ if (ctx.waitUntil) {
863
+ ctx.waitUntil(pendingWaitUntil);
864
+ pendingWaitUntil = undefined;
865
+ }
866
+ }
867
+ const cacheTags = context.renderOpts.collectedTags;
868
+ // If the request is for a static response, we can cache it so long
869
+ // as it's not edge.
870
+ if (isIsr) {
871
+ const blob = await response.blob();
872
+ // Copy the headers from the response.
873
+ const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
874
+ if (cacheTags) {
875
+ headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
876
+ }
877
+ if (!headers['content-type'] && blob.type) {
878
+ headers['content-type'] = blob.type;
879
+ }
880
+ const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
881
+ const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? // route has a numeric `revalidate` but didn't declare an
882
+ // explicit `expire` (e.g. via `cacheLife`). This mirrors the
883
+ // build-time fallback in `build/index.ts` so cache entries
884
+ // and the response Cache-Control header agree on the route's
885
+ // effective expire. Routes that opt out of revalidation
886
+ // (`revalidate: false`) or that are dynamic (`revalidate: 0`)
887
+ // keep `expire: undefined`.
888
+ revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
889
+ // Create the cache entry for the response.
890
+ const cacheEntry = {
891
+ value: {
892
+ kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
893
+ status: response.status,
894
+ body: Buffer.from(await blob.arrayBuffer()),
895
+ headers
896
+ },
897
+ cacheControl: {
898
+ revalidate,
899
+ expire
900
+ }
901
+ };
902
+ return cacheEntry;
903
+ } else {
904
+ // send response without caching if not ISR
905
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
906
+ return null;
907
+ }
908
+ } catch (err) {
909
+ // if this is a background revalidate we need to report
910
+ // the request error here as it won't be bubbled
911
+ if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
912
+ const silenceLog = false;
913
+ await routeModule.onRequestError(req, err, {
914
+ routerKind: 'App Router',
915
+ routePath: srcPage,
916
+ routeType: 'route',
917
+ revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
918
+ isStaticGeneration: cacheKey !== null,
919
+ isOnDemandRevalidate
920
+ })
921
+ }, silenceLog, routerServerContext);
922
+ }
923
+ throw err;
924
+ }
925
+ };
926
+ const handleResponse = async (currentSpan, parentSpan)=>{
927
+ try {
928
+ var _cacheEntry_value;
929
+ const cacheEntry = await routeModule.handleResponse({
930
+ req,
931
+ nextConfig,
932
+ cacheKey,
933
+ routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
934
+ isFallback: false,
935
+ previewProps,
936
+ prerenderManifest,
937
+ isRoutePPREnabled: false,
938
+ isOnDemandRevalidate,
939
+ revalidateOnlyGenerated,
940
+ responseGenerator,
941
+ waitUntil: ctx.waitUntil,
942
+ isMinimalMode
943
+ });
944
+ if (cacheEntry !== null && 'error' in cacheEntry) {
945
+ throw cacheEntry.error;
946
+ }
947
+ // we don't create a cacheEntry for ISR
948
+ if (!isIsr) {
949
+ return;
950
+ }
951
+ if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE) {
952
+ var _cacheEntry_value1;
953
+ throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
954
+ }
955
+ if (!isMinimalMode) {
956
+ res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
957
+ }
958
+ // Draft mode should never be cached
959
+ if (isDraftMode) {
960
+ res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
961
+ }
962
+ const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
963
+ if (!(isMinimalMode && isIsr)) {
964
+ headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
965
+ }
966
+ // If cache control is already set on the response we don't
967
+ // override it to allow users to customize it via next.config
968
+ if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
969
+ headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
970
+ }
971
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.
972
+ new Response(cacheEntry.value.body, {
973
+ headers,
974
+ status: cacheEntry.value.status || 200
975
+ }));
976
+ return;
977
+ } catch (err) {
978
+ if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
979
+ const silenceLog = false;
980
+ await routeModule.onRequestError(req, err, {
981
+ routerKind: 'App Router',
982
+ routePath: normalizedSrcPage,
983
+ routeType: 'route',
984
+ revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
985
+ isStaticGeneration: cacheKey !== null,
986
+ isOnDemandRevalidate
987
+ })
988
+ }, silenceLog, routerServerContext);
989
+ }
990
+ // rethrow so that we can handle serving error page
991
+ // If this is during static generation, throw the error again.
992
+ if (isIsr) throw err;
993
+ // Otherwise, send a 500 response unless the original response has
994
+ // already committed. In that case, preserve its status code for
995
+ // telemetry while still recording the failure and terminating a response
996
+ // that the failed pipeline left open.
997
+ if (res.headersSent) {
998
+ if (currentSpan) {
999
+ const error = err instanceof Error ? err : new Error('Unknown app route error');
1000
+ currentSpan.recordException(error);
1001
+ currentSpan.setStatus({
1002
+ code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
1003
+ message: error.message
1004
+ });
1005
+ currentSpan.setAttribute('error.type', error.name);
1006
+ }
1007
+ if (!res.writableEnded && !res.destroyed) {
1008
+ res.end();
1009
+ }
1010
+ } else {
1011
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
1012
+ status: 500
1013
+ }));
1014
+ }
1015
+ return;
1016
+ } finally{
1017
+ ;
1018
+ (()=>{
1019
+ if (!currentSpan) {
1020
+ return;
1021
+ }
1022
+ let statusCode = res.statusCode;
1023
+ currentSpan.setAttributes({
1024
+ 'http.status_code': statusCode,
1025
+ 'next.rsc': false
1026
+ });
1027
+ if (statusCode && statusCode >= 500) {
1028
+ // For 5xx status codes: SHOULD be set to 'Error' span status.
1029
+ // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
1030
+ currentSpan.setStatus({
1031
+ code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
1032
+ });
1033
+ // For span status 'Error', SHOULD set 'error.type' attribute.
1034
+ currentSpan.setAttribute('error.type', statusCode.toString());
1035
+ }
1036
+ const rootSpanAttributes = tracer.getRootSpanAttributes();
1037
+ // We were unable to get attributes, probably OTEL is not enabled
1038
+ if (!rootSpanAttributes) {
1039
+ return;
1040
+ }
1041
+ if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
1042
+ console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
1043
+ return;
1044
+ }
1045
+ const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
1046
+ const name = `${method} ${route}`;
1047
+ currentSpan.setAttributes({
1048
+ 'next.route': route,
1049
+ 'http.route': route,
1050
+ 'next.span_name': name
1051
+ });
1052
+ currentSpan.updateName(name);
1053
+ // Propagate http.route to the parent span if one exists (e.g.
1054
+ // a platform-created HTTP span in adapter deployments).
1055
+ if (parentSpan && parentSpan !== currentSpan) {
1056
+ parentSpan.setAttribute('http.route', route);
1057
+ parentSpan.updateName(name);
1058
+ }
1059
+ })();
1060
+ }
1061
+ };
1062
+ // TODO: activeSpan code path is for when wrapped by
1063
+ // next-server can be removed when this is no longer used
1064
+ if (isWrappedByNextServer && activeSpan) {
1065
+ await handleResponse(activeSpan, undefined);
1066
+ } else {
1067
+ let parentSpan = tracer.getActiveScopeSpan();
1068
+ await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
1069
+ spanName: `${method} ${srcPage}`,
1070
+ kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
1071
+ attributes: {
1072
+ 'http.method': method,
1073
+ 'http.target': req.url
1074
+ }
1075
+ }, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
1066
1076
  }
1067
- db.prepare("UPDATE skill_repos SET label=?, enabled=?, writable=?, updated_at=? WHERE id=?").run(patch.label === undefined ? existing.label : patch.label, patch.enabled === undefined ? existing.enabled : patch.enabled ? 1 : 0, patch.writable === undefined ? existing.writable : patch.writable ? 1 : 0, t, id);
1068
- return getSkillRepo(id);
1069
- }
1070
- function deleteSkillRepo(id) {
1071
- return (0,_lib_db__WEBPACK_IMPORTED_MODULE_1__/* .getDb */ .Lf)().prepare("DELETE FROM skill_repos WHERE id=?").run(id).changes > 0;
1072
1077
  }
1073
1078
 
1079
+ //# sourceMappingURL=app-route.js.map
1074
1080
 
1075
- /***/ }),
1076
-
1077
- /***/ 73024:
1078
- /***/ ((module) => {
1079
-
1080
- module.exports = require("node:fs");
1081
1081
 
1082
1082
  /***/ }),
1083
1083
 
@@ -1158,7 +1158,7 @@ module.exports = import("@huggingface/transformers");;
1158
1158
  var __webpack_require__ = require("../../../../../webpack-runtime.js");
1159
1159
  __webpack_require__.C(exports);
1160
1160
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
1161
- var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46], () => (__webpack_exec__(17533)));
1161
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46], () => (__webpack_exec__(74303)));
1162
1162
  module.exports = __webpack_exports__;
1163
1163
 
1164
1164
  })();