vibedoc 1.11.0 → 1.12.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 (523) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +2 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +14 -14
  5. package/.next/routes-manifest.json +12 -0
  6. package/.next/server/app/(app)/activity/page.js.nft.json +1 -1
  7. package/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/(app)/board/page.js.nft.json +1 -1
  9. package/.next/server/app/(app)/board/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/(app)/chat/page.js.nft.json +1 -1
  11. package/.next/server/app/(app)/chat/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/(app)/docs/page.js.nft.json +1 -1
  13. package/.next/server/app/(app)/docs/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/(app)/explorer/page.js.nft.json +1 -1
  15. package/.next/server/app/(app)/explorer/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/(app)/graph/page.js.nft.json +1 -1
  17. package/.next/server/app/(app)/graph/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/(app)/manual-tests/page.js.nft.json +1 -1
  19. package/.next/server/app/(app)/manual-tests/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/(app)/memory/page.js.nft.json +1 -1
  21. package/.next/server/app/(app)/memory/page_client-reference-manifest.js +1 -1
  22. package/.next/server/app/(app)/roadmap/page.js.nft.json +1 -1
  23. package/.next/server/app/(app)/roadmap/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/(app)/settings/page.js.nft.json +1 -1
  25. package/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/(app)/setup/page.js.nft.json +1 -1
  27. package/.next/server/app/(app)/setup/page_client-reference-manifest.js +1 -1
  28. package/.next/server/app/_global-error.html +1 -1
  29. package/.next/server/app/_global-error.rsc +1 -1
  30. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  31. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  32. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  33. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  34. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/_not-found.html +1 -1
  36. package/.next/server/app/_not-found.rsc +2 -2
  37. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  38. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  39. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  40. package/.next/server/app/activity.html +1 -1
  41. package/.next/server/app/activity.rsc +6 -6
  42. package/.next/server/app/activity.segments/!KGFwcCk/activity/__PAGE__.segment.rsc +5 -5
  43. package/.next/server/app/activity.segments/_full.segment.rsc +6 -6
  44. package/.next/server/app/activity.segments/_tree.segment.rsc +2 -2
  45. package/.next/server/app/api/activity/route.js +1 -1
  46. package/.next/server/app/api/activity/route.js.nft.json +1 -1
  47. package/.next/server/app/api/chat/route.js +1 -1
  48. package/.next/server/app/api/chat/route.js.nft.json +1 -1
  49. package/.next/server/app/api/context/route.js +1 -1
  50. package/.next/server/app/api/context/route.js.nft.json +1 -1
  51. package/.next/server/app/api/conversations/route.js +1 -1
  52. package/.next/server/app/api/conversations/route.js.nft.json +1 -1
  53. package/.next/server/app/api/decisions/route.js +1 -1
  54. package/.next/server/app/api/decisions/route.js.nft.json +1 -1
  55. package/.next/server/app/api/docs/graph/route.js +1 -1
  56. package/.next/server/app/api/docs/graph/route.js.nft.json +1 -1
  57. package/.next/server/app/api/docs/links/route.js +1 -1
  58. package/.next/server/app/api/docs/links/route.js.nft.json +1 -1
  59. package/.next/server/app/api/docs/route.js +1 -1
  60. package/.next/server/app/api/docs/route.js.nft.json +1 -1
  61. package/.next/server/app/api/explorer/route.js +1 -1
  62. package/.next/server/app/api/explorer/route.js.nft.json +1 -1
  63. package/.next/server/app/api/mcp/route.js +1 -1
  64. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  65. package/.next/server/app/api/memory/entries/delete/route.js +1 -1
  66. package/.next/server/app/api/memory/entries/delete/route.js.nft.json +1 -1
  67. package/.next/server/app/api/memory/entries/merge/route.js +1 -1
  68. package/.next/server/app/api/memory/entries/merge/route.js.nft.json +1 -1
  69. package/.next/server/app/api/memory/entries/merge/undo/route.js +1 -1
  70. package/.next/server/app/api/memory/entries/merge/undo/route.js.nft.json +1 -1
  71. package/.next/server/app/api/memory/entries/restore/route.js +1 -1
  72. package/.next/server/app/api/memory/entries/restore/route.js.nft.json +1 -1
  73. package/.next/server/app/api/memory/entries/route.js +1 -1
  74. package/.next/server/app/api/memory/entries/route.js.nft.json +1 -1
  75. package/.next/server/app/api/memory/entries/save/route.js +1 -1
  76. package/.next/server/app/api/memory/entries/save/route.js.nft.json +1 -1
  77. package/.next/server/app/api/memory/graph/route.js +1 -1
  78. package/.next/server/app/api/memory/graph/route.js.nft.json +1 -1
  79. package/.next/server/app/api/memory/health/dismiss/route.js +1 -1
  80. package/.next/server/app/api/memory/health/dismiss/route.js.nft.json +1 -1
  81. package/.next/server/app/api/memory/health/route.js +1 -1
  82. package/.next/server/app/api/memory/health/route.js.nft.json +1 -1
  83. package/.next/server/app/api/memory/history/route.js +1 -1
  84. package/.next/server/app/api/memory/history/route.js.nft.json +1 -1
  85. package/.next/server/app/api/memory/restore/route/app-paths-manifest.json +3 -0
  86. package/.next/server/app/api/memory/restore/route/build-manifest.json +12 -0
  87. package/.next/server/app/api/memory/restore/route/server-reference-manifest.json +4 -0
  88. package/.next/server/app/api/memory/restore/route.js +9 -0
  89. package/.next/server/app/api/memory/restore/route.js.map +5 -0
  90. package/.next/server/app/api/memory/restore/route.js.nft.json +1 -0
  91. package/.next/server/app/api/memory/restore/route_client-reference-manifest.js +3 -0
  92. package/.next/server/app/api/memory/route.js +1 -1
  93. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  94. package/.next/server/app/api/memory/versions/route/app-paths-manifest.json +3 -0
  95. package/.next/server/app/api/memory/versions/route/build-manifest.json +12 -0
  96. package/.next/server/app/api/memory/versions/route/server-reference-manifest.json +4 -0
  97. package/.next/server/app/api/memory/versions/route.js +8 -0
  98. package/.next/server/app/api/memory/versions/route.js.map +5 -0
  99. package/.next/server/app/api/memory/versions/route.js.nft.json +1 -0
  100. package/.next/server/app/api/memory/versions/route_client-reference-manifest.js +3 -0
  101. package/.next/server/app/api/plan/apply/route.js +1 -1
  102. package/.next/server/app/api/plan/apply/route.js.nft.json +1 -1
  103. package/.next/server/app/api/projects/route.js +1 -1
  104. package/.next/server/app/api/projects/route.js.nft.json +1 -1
  105. package/.next/server/app/api/registry/route.js +1 -1
  106. package/.next/server/app/api/registry/route.js.nft.json +1 -1
  107. package/.next/server/app/api/roadmap/create/route.js +1 -1
  108. package/.next/server/app/api/roadmap/create/route.js.nft.json +1 -1
  109. package/.next/server/app/api/roadmap/delete/route.js +1 -1
  110. package/.next/server/app/api/roadmap/delete/route.js.nft.json +1 -1
  111. package/.next/server/app/api/roadmap/generate/route.js +1 -1
  112. package/.next/server/app/api/roadmap/generate/route.js.nft.json +1 -1
  113. package/.next/server/app/api/roadmap/layout/route.js +1 -1
  114. package/.next/server/app/api/roadmap/layout/route.js.nft.json +1 -1
  115. package/.next/server/app/api/roadmap/restore/route.js +1 -1
  116. package/.next/server/app/api/roadmap/restore/route.js.nft.json +1 -1
  117. package/.next/server/app/api/roadmap/route.js +1 -1
  118. package/.next/server/app/api/roadmap/route.js.nft.json +1 -1
  119. package/.next/server/app/api/roadmap/update/route.js +1 -1
  120. package/.next/server/app/api/roadmap/update/route.js.nft.json +1 -1
  121. package/.next/server/app/api/sessions/route.js +1 -1
  122. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  123. package/.next/server/app/api/settings/route.js +1 -1
  124. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  125. package/.next/server/app/api/setup/generate/route.js +1 -1
  126. package/.next/server/app/api/setup/generate/route.js.nft.json +1 -1
  127. package/.next/server/app/api/setup/write/route.js +1 -1
  128. package/.next/server/app/api/setup/write/route.js.nft.json +1 -1
  129. package/.next/server/app/api/summary/route.js +1 -1
  130. package/.next/server/app/api/summary/route.js.nft.json +1 -1
  131. package/.next/server/app/api/tasks/bulk/route.js +1 -1
  132. package/.next/server/app/api/tasks/bulk/route.js.nft.json +1 -1
  133. package/.next/server/app/api/tasks/create/route.js +1 -1
  134. package/.next/server/app/api/tasks/create/route.js.nft.json +1 -1
  135. package/.next/server/app/api/tasks/delete/route.js +1 -1
  136. package/.next/server/app/api/tasks/delete/route.js.nft.json +1 -1
  137. package/.next/server/app/api/tasks/manual-tests/route.js +1 -1
  138. package/.next/server/app/api/tasks/manual-tests/route.js.nft.json +1 -1
  139. package/.next/server/app/api/tasks/restore/route.js +1 -1
  140. package/.next/server/app/api/tasks/restore/route.js.nft.json +1 -1
  141. package/.next/server/app/api/tasks/review/route.js +1 -1
  142. package/.next/server/app/api/tasks/review/route.js.nft.json +1 -1
  143. package/.next/server/app/api/tasks/route.js +1 -1
  144. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  145. package/.next/server/app/api/tasks/update/route.js +1 -1
  146. package/.next/server/app/api/tasks/update/route.js.nft.json +1 -1
  147. package/.next/server/app/api/views/route.js +1 -1
  148. package/.next/server/app/api/views/route.js.nft.json +1 -1
  149. package/.next/server/app/board.html +1 -1
  150. package/.next/server/app/board.rsc +7 -7
  151. package/.next/server/app/board.segments/!KGFwcCk/board/__PAGE__.segment.rsc +5 -5
  152. package/.next/server/app/board.segments/_full.segment.rsc +7 -7
  153. package/.next/server/app/board.segments/_tree.segment.rsc +2 -2
  154. package/.next/server/app/chat.html +1 -1
  155. package/.next/server/app/chat.rsc +6 -6
  156. package/.next/server/app/chat.segments/!KGFwcCk/chat/__PAGE__.segment.rsc +6 -6
  157. package/.next/server/app/chat.segments/_full.segment.rsc +6 -6
  158. package/.next/server/app/chat.segments/_tree.segment.rsc +2 -2
  159. package/.next/server/app/docs.html +1 -1
  160. package/.next/server/app/docs.rsc +7 -7
  161. package/.next/server/app/docs.segments/!KGFwcCk/docs/__PAGE__.segment.rsc +5 -5
  162. package/.next/server/app/docs.segments/_full.segment.rsc +7 -7
  163. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  164. package/.next/server/app/explorer.html +1 -1
  165. package/.next/server/app/explorer.rsc +6 -6
  166. package/.next/server/app/explorer.segments/!KGFwcCk/explorer/__PAGE__.segment.rsc +9 -11
  167. package/.next/server/app/explorer.segments/_full.segment.rsc +6 -6
  168. package/.next/server/app/explorer.segments/_tree.segment.rsc +2 -2
  169. package/.next/server/app/graph.html +1 -1
  170. package/.next/server/app/graph.rsc +6 -6
  171. package/.next/server/app/graph.segments/!KGFwcCk/graph/__PAGE__.segment.rsc +5 -5
  172. package/.next/server/app/graph.segments/_full.segment.rsc +6 -6
  173. package/.next/server/app/graph.segments/_tree.segment.rsc +2 -2
  174. package/.next/server/app/index.html +1 -1
  175. package/.next/server/app/index.rsc +2 -2
  176. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  177. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  178. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  179. package/.next/server/app/manual-tests.html +1 -1
  180. package/.next/server/app/manual-tests.rsc +6 -6
  181. package/.next/server/app/manual-tests.segments/!KGFwcCk/manual-tests/__PAGE__.segment.rsc +9 -11
  182. package/.next/server/app/manual-tests.segments/_full.segment.rsc +6 -6
  183. package/.next/server/app/manual-tests.segments/_tree.segment.rsc +2 -2
  184. package/.next/server/app/memory.html +1 -1
  185. package/.next/server/app/memory.rsc +7 -7
  186. package/.next/server/app/memory.segments/!KGFwcCk/memory/__PAGE__.segment.rsc +5 -5
  187. package/.next/server/app/memory.segments/_full.segment.rsc +7 -7
  188. package/.next/server/app/memory.segments/_tree.segment.rsc +2 -2
  189. package/.next/server/app/page.js.nft.json +1 -1
  190. package/.next/server/app/page_client-reference-manifest.js +1 -1
  191. package/.next/server/app/roadmap.html +1 -1
  192. package/.next/server/app/roadmap.rsc +6 -6
  193. package/.next/server/app/roadmap.segments/!KGFwcCk/roadmap/__PAGE__.segment.rsc +5 -5
  194. package/.next/server/app/roadmap.segments/_full.segment.rsc +6 -6
  195. package/.next/server/app/roadmap.segments/_tree.segment.rsc +2 -2
  196. package/.next/server/app/settings.html +1 -1
  197. package/.next/server/app/settings.rsc +6 -6
  198. package/.next/server/app/settings.segments/!KGFwcCk/settings/__PAGE__.segment.rsc +11 -9
  199. package/.next/server/app/settings.segments/_full.segment.rsc +6 -6
  200. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  201. package/.next/server/app/setup.html +1 -1
  202. package/.next/server/app/setup.rsc +6 -6
  203. package/.next/server/app/setup.segments/!KGFwcCk/setup/__PAGE__.segment.rsc +9 -11
  204. package/.next/server/app/setup.segments/_full.segment.rsc +6 -6
  205. package/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
  206. package/.next/server/app-paths-manifest.json +2 -0
  207. package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0-r4g2t._.js → 11mp_@anthropic-ai_sdk_013qeb4._.js} +1 -1
  208. package/.next/server/chunks/{11mp_@anthropic-ai_sdk_02lx_j3._.js → 11mp_@anthropic-ai_sdk_05ck8py._.js} +1 -1
  209. package/.next/server/chunks/{11mp_@anthropic-ai_sdk_01gyja3._.js → 11mp_@anthropic-ai_sdk_05w8m72._.js} +1 -1
  210. package/.next/server/chunks/{11mp_@anthropic-ai_sdk_05iv23g._.js → 11mp_@anthropic-ai_sdk_086oevc._.js} +1 -1
  211. package/.next/server/chunks/11mp_@anthropic-ai_sdk_08rl0hf._.js +3 -0
  212. package/.next/server/chunks/11mp_@anthropic-ai_sdk_09ujrsu._.js +3 -0
  213. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0c3_7p7._.js +3 -0
  214. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0cto43x._.js +3 -0
  215. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0fgisb_._.js +3 -0
  216. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0fy8wd3._.js +3 -0
  217. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0fyvizf._.js +3 -0
  218. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0hg0i2g._.js +3 -0
  219. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0i0sz05._.js +3 -0
  220. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0l0j9c6._.js +3 -0
  221. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0lcm61d._.js +3 -0
  222. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0qtva5j._.js +3 -0
  223. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0r4fkdu._.js +3 -0
  224. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0wbae0t._.js +3 -0
  225. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0wxyz1t._.js +3 -0
  226. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0y2cods._.js +3 -0
  227. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0zu0fj1._.js +3 -0
  228. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0zxpgt0._.js +3 -0
  229. package/.next/server/chunks/11mp_@anthropic-ai_sdk_10_cxcd._.js +3 -0
  230. package/.next/server/chunks/11mp_@anthropic-ai_sdk_10gb7d1._.js +3 -0
  231. package/.next/server/chunks/11mp_@anthropic-ai_sdk_12q70bs._.js +3 -0
  232. package/.next/server/chunks/11mp_@anthropic-ai_sdk_149ltk3._.js +3 -0
  233. package/.next/server/chunks/11mp_@anthropic-ai_sdk_165_uiw._.js +3 -0
  234. package/.next/server/chunks/11mp_@anthropic-ai_sdk_19w4zh6._.js +3 -0
  235. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1adck-s._.js +3 -0
  236. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1c2dwoi._.js +3 -0
  237. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1d9lw_2._.js +3 -0
  238. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1db6a7p._.js +3 -0
  239. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1h2f90s._.js +3 -0
  240. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1k5_i1z._.js +3 -0
  241. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1p3mv6i._.js +3 -0
  242. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1qoom5s._.js +3 -0
  243. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1qsbcbe._.js +3 -0
  244. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1rk0x59._.js +3 -0
  245. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1sd98mi._.js +3 -0
  246. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1sumqg8._.js +3 -0
  247. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1t-rt4q._.js +3 -0
  248. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1tr-k4y._.js +3 -0
  249. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1xk3c39._.js +3 -0
  250. package/.next/server/chunks/11mp_@anthropic-ai_sdk_206l10_._.js +3 -0
  251. package/.next/server/chunks/11mp_@anthropic-ai_sdk_20giys9._.js +3 -0
  252. package/.next/server/chunks/11mp_@anthropic-ai_sdk_20xrvvy._.js +3 -0
  253. package/.next/server/chunks/11mp_@anthropic-ai_sdk_20xrvvy._.js.map +1 -0
  254. package/.next/server/chunks/11mp_@anthropic-ai_sdk_215tg00._.js +3 -0
  255. package/.next/server/chunks/11mp_@anthropic-ai_sdk_215tg00._.js.map +1 -0
  256. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_018s_10._.js +3 -0
  257. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_08d6i7w._.js +3 -0
  258. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_09_fd9g._.js +3 -0
  259. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0eopml6._.js +3 -0
  260. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0f5epel._.js +3 -0
  261. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0okfnhu._.js +3 -0
  262. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0s8-ha8._.js +3 -0
  263. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0ujs27r._.js +3 -0
  264. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0uo7rs8._.js +3 -0
  265. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0vyq_2d._.js +3 -0
  266. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0w3js74._.js +3 -0
  267. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0xa4-uq._.js +3 -0
  268. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_113y3so._.js +3 -0
  269. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_12qcr96._.js +3 -0
  270. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_13ixdy8._.js +3 -0
  271. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1708vst._.js +3 -0
  272. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1_rdguq._.js +3 -0
  273. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1bgpe23._.js +3 -0
  274. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1f-tphn._.js +3 -0
  275. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1h1pqdh._.js +3 -0
  276. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1hfj_1d._.js +3 -0
  277. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1ih2qzz._.js +3 -0
  278. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1jatyl1._.js +3 -0
  279. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1v1zbha._.js +3 -0
  280. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1vyqs5z._.js +3 -0
  281. package/.next/server/chunks/{[root-of-the-server]__0xldguc._.js → [root-of-the-server]__00usbi3._.js} +2 -2
  282. package/.next/server/chunks/{[root-of-the-server]__0i1yba1._.js → [root-of-the-server]__04cwur0._.js} +2 -2
  283. package/.next/server/chunks/{[root-of-the-server]__1yh-4vk._.js → [root-of-the-server]__04ri_ci._.js} +2 -2
  284. package/.next/server/chunks/{[root-of-the-server]__06ndlro._.js → [root-of-the-server]__05-be3n._.js} +2 -2
  285. package/.next/server/chunks/{[root-of-the-server]__08v3p50._.js → [root-of-the-server]__0756_60._.js} +2 -2
  286. package/.next/server/chunks/{[root-of-the-server]__0pz59qo._.js → [root-of-the-server]__089ay-q._.js} +2 -2
  287. package/.next/server/chunks/{[root-of-the-server]__0cxmrop._.js → [root-of-the-server]__0d4t4q6._.js} +2 -2
  288. package/.next/server/chunks/{[root-of-the-server]__1ef-hw_._.js → [root-of-the-server]__0dgwykw._.js} +2 -2
  289. package/.next/server/chunks/[root-of-the-server]__0fn-a8c._.js +22 -43
  290. package/.next/server/chunks/[root-of-the-server]__0fn-a8c._.js.map +1 -1
  291. package/.next/server/chunks/{[root-of-the-server]__0zy73pu._.js → [root-of-the-server]__0n0myt9._.js} +2 -2
  292. package/.next/server/chunks/[root-of-the-server]__0n0myt9._.js.map +1 -0
  293. package/.next/server/chunks/[root-of-the-server]__0pe1qih._.js +3 -0
  294. package/.next/server/chunks/[root-of-the-server]__0pe1qih._.js.map +1 -0
  295. package/.next/server/chunks/[root-of-the-server]__0pvi3ku._.js +22 -43
  296. package/.next/server/chunks/[root-of-the-server]__0pvi3ku._.js.map +1 -1
  297. package/.next/server/chunks/{[root-of-the-server]__1qcy2l0._.js → [root-of-the-server]__0s-j6z-._.js} +2 -2
  298. package/.next/server/chunks/{[root-of-the-server]__1zhd93r._.js → [root-of-the-server]__0yaxn8g._.js} +2 -2
  299. package/.next/server/chunks/{[root-of-the-server]__0rh8yfn._.js → [root-of-the-server]__162_l0k._.js} +2 -2
  300. package/.next/server/chunks/{[root-of-the-server]__0hk-9ll._.js → [root-of-the-server]__16smlkg._.js} +2 -2
  301. package/.next/server/chunks/{[root-of-the-server]__11rp-qx._.js → [root-of-the-server]__19yo85m._.js} +2 -2
  302. package/.next/server/chunks/[root-of-the-server]__1lxrobr._.js +3 -0
  303. package/.next/server/chunks/[root-of-the-server]__1lxrobr._.js.map +1 -0
  304. package/.next/server/chunks/{[root-of-the-server]__1sn6-7a._.js → [root-of-the-server]__1mnzsbh._.js} +2 -2
  305. package/.next/server/chunks/{[root-of-the-server]__11nbc9e._.js → [root-of-the-server]__1ntu_6r._.js} +2 -2
  306. package/.next/server/chunks/[root-of-the-server]__1p4ws5z._.js +3 -0
  307. package/.next/server/chunks/[root-of-the-server]__1p4ws5z._.js.map +1 -0
  308. package/.next/server/chunks/{[root-of-the-server]__1wbho9e._.js → [root-of-the-server]__1s0t8r3._.js} +2 -2
  309. package/.next/server/chunks/{[root-of-the-server]__1r67yrn._.js → [root-of-the-server]__1sd3l-d._.js} +2 -2
  310. package/.next/server/chunks/[root-of-the-server]__1vnine1._.js +22 -43
  311. package/.next/server/chunks/[root-of-the-server]__1vnine1._.js.map +1 -1
  312. package/.next/server/chunks/{[root-of-the-server]__0rikmqn._.js → [root-of-the-server]__1vzxnjb._.js} +2 -2
  313. package/.next/server/chunks/{[root-of-the-server]__0wc_gnr._.js → [root-of-the-server]__1zeys20._.js} +2 -2
  314. package/.next/server/chunks/_04byth9._.js +4 -4
  315. package/.next/server/chunks/_04byth9._.js.map +1 -1
  316. package/.next/server/chunks/_next-internal_server_app_api_memory_restore_route_actions_0679kmo.js +3 -0
  317. package/.next/server/chunks/_next-internal_server_app_api_memory_restore_route_actions_0679kmo.js.map +1 -0
  318. package/.next/server/chunks/_next-internal_server_app_api_memory_versions_route_actions_13mix75.js +3 -0
  319. package/.next/server/chunks/_next-internal_server_app_api_memory_versions_route_actions_13mix75.js.map +1 -0
  320. package/.next/server/chunks/ssr/{_0me5_6x._.js → _0-_04ia._.js} +1 -1
  321. package/.next/server/chunks/ssr/{_190c11r._.js → _0cv0ugs._.js} +1 -1
  322. package/.next/server/chunks/ssr/_0ghj-vx._.js +1 -1
  323. package/.next/server/chunks/ssr/_0ghj-vx._.js.map +1 -1
  324. package/.next/server/chunks/ssr/_0o8t6j-._.js +3 -0
  325. package/.next/server/chunks/ssr/_0o8t6j-._.js.map +1 -0
  326. package/.next/server/chunks/ssr/_128p7pz._.js +3 -0
  327. package/.next/server/chunks/ssr/_128p7pz._.js.map +1 -0
  328. package/.next/server/chunks/ssr/{_1feybpz._.js → _1hm7p_8._.js} +1 -1
  329. package/.next/server/chunks/ssr/{_1cz8dnu._.js → _1s-2jub._.js} +1 -1
  330. package/.next/server/chunks/ssr/src_app_(app)_memory_page_tsx_19jhb1c._.js +2 -2
  331. package/.next/server/chunks/ssr/src_app_(app)_memory_page_tsx_19jhb1c._.js.map +1 -1
  332. package/.next/server/chunks/ssr/src_components_chat_ChatView_tsx_0h5j-e2._.js +1 -1
  333. package/.next/server/chunks/ssr/src_components_chat_ChatView_tsx_0h5j-e2._.js.map +1 -1
  334. package/.next/server/middleware-build-manifest.js +3 -3
  335. package/.next/server/pages/404.html +1 -1
  336. package/.next/server/pages/500.html +1 -1
  337. package/.next/server/server-reference-manifest.js +1 -1
  338. package/.next/server/server-reference-manifest.json +1 -1
  339. package/.next/static/chunks/05qw7-fs1exlt.js +1 -0
  340. package/.next/static/chunks/0eax07u1ta6tp.css +1 -0
  341. package/.next/static/chunks/0lfd3aomz4wv4.js +1 -0
  342. package/.next/static/chunks/{3rtr962aa09nh.js → 0po8atank1p02.js} +2 -2
  343. package/.next/static/chunks/11ou9nrpdg4qo.js +3 -0
  344. package/.next/static/chunks/1g7st54huk4if.js +1 -0
  345. package/.next/static/chunks/40diykjra8f9n.js +2107 -0
  346. package/README.md +4 -2
  347. package/package.json +1 -1
  348. package/.next/server/chunks/11mp_@anthropic-ai_sdk_05oneea._.js +0 -3
  349. package/.next/server/chunks/11mp_@anthropic-ai_sdk_07fgg-l._.js +0 -3
  350. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0_5gzfy._.js +0 -3
  351. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0_jynr-._.js +0 -3
  352. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0aykesf._.js +0 -3
  353. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0br_1fc._.js +0 -3
  354. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0cd5lu7._.js +0 -3
  355. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0ckxhy7._.js +0 -3
  356. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0e5qkuv._.js +0 -3
  357. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0el8pm6._.js +0 -3
  358. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0i4w8fv._.js +0 -3
  359. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0i7ckik._.js +0 -3
  360. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0l1p4c6._.js +0 -3
  361. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0m-xqs_._.js +0 -3
  362. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0nltdmf._.js +0 -3
  363. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0qxmzg8._.js +0 -3
  364. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0spr_aj._.js +0 -3
  365. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0th0pyh._.js +0 -3
  366. package/.next/server/chunks/11mp_@anthropic-ai_sdk_0x21fif._.js +0 -3
  367. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1-7bj56._.js +0 -3
  368. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1-efoj1._.js +0 -3
  369. package/.next/server/chunks/11mp_@anthropic-ai_sdk_13vu693._.js +0 -3
  370. package/.next/server/chunks/11mp_@anthropic-ai_sdk_13w62gi._.js +0 -3
  371. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1887ce1._.js +0 -3
  372. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1_jq3yb._.js +0 -3
  373. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1agvp6h._.js +0 -3
  374. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1b1-3vt._.js +0 -3
  375. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1ekldtb._.js +0 -3
  376. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1ezcndt._.js +0 -3
  377. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1gr-orf._.js +0 -3
  378. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1hf-884._.js +0 -3
  379. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1ndwnmb._.js +0 -3
  380. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1rdesfd._.js +0 -3
  381. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1s8h60-._.js +0 -3
  382. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1tgk9wk._.js +0 -3
  383. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1uugb45._.js +0 -3
  384. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1vcxmui._.js +0 -3
  385. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1x63qpm._.js +0 -3
  386. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1y5oj_h._.js +0 -3
  387. package/.next/server/chunks/11mp_@anthropic-ai_sdk_1z0q4jj._.js +0 -3
  388. package/.next/server/chunks/11mp_@anthropic-ai_sdk_20j6dn7._.js +0 -3
  389. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_00nr0dy._.js +0 -3
  390. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_06kgcr0._.js +0 -3
  391. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_07kod-g._.js +0 -3
  392. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0_va-1q._.js +0 -3
  393. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0dr79hc._.js +0 -3
  394. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0ew4_uw._.js +0 -3
  395. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0iy714m._.js +0 -3
  396. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0n6aq49._.js +0 -3
  397. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0ncvuil._.js +0 -3
  398. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0vilstf._.js +0 -3
  399. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0ybdfbv._.js +0 -3
  400. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0z31-c0._.js +0 -3
  401. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0zu51ny._.js +0 -3
  402. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_13-fsm5._.js +0 -3
  403. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_13lk7wf._.js +0 -3
  404. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1ao3e3l._.js +0 -3
  405. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1ck6z1z._.js +0 -3
  406. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1dm3so9._.js +0 -3
  407. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1jxtz_6._.js +0 -3
  408. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1pdl5qg._.js +0 -3
  409. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1tzpss1._.js +0 -3
  410. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1x_0sf4._.js +0 -3
  411. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1x_fy5x._.js +0 -3
  412. package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1xx8_-m._.js +0 -3
  413. package/.next/server/chunks/[root-of-the-server]__0usdydm._.js +0 -3
  414. package/.next/server/chunks/[root-of-the-server]__0usdydm._.js.map +0 -1
  415. package/.next/server/chunks/ssr/_0pg63il._.js +0 -3
  416. package/.next/server/chunks/ssr/_0pg63il._.js.map +0 -1
  417. package/.next/server/chunks/ssr/_16b4hkt._.js +0 -3
  418. package/.next/server/chunks/ssr/_16b4hkt._.js.map +0 -1
  419. package/.next/server/chunks/ssr/_1t8it2w._.js +0 -3
  420. package/.next/server/chunks/ssr/_1t8it2w._.js.map +0 -1
  421. package/.next/static/chunks/036fex6o238at.css +0 -1
  422. package/.next/static/chunks/1c5ibgojv8jdi.js +0 -3
  423. package/.next/static/chunks/1pmgcotwq-_yh.js +0 -1
  424. package/.next/static/chunks/1xxzt2y2ttqql.js +0 -2107
  425. package/.next/static/chunks/263i_dcdizuvd.js +0 -1
  426. package/.next/static/chunks/2mf5us3y9wd9g.js +0 -1
  427. package/.next/static/chunks/42c9smmpcu4re.js +0 -1
  428. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_20j6dn7._.js.map → 11mp_@anthropic-ai_sdk_013qeb4._.js.map} +0 -0
  429. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1z0q4jj._.js.map → 11mp_@anthropic-ai_sdk_05ck8py._.js.map} +0 -0
  430. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1y5oj_h._.js.map → 11mp_@anthropic-ai_sdk_05w8m72._.js.map} +0 -0
  431. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1x63qpm._.js.map → 11mp_@anthropic-ai_sdk_086oevc._.js.map} +0 -0
  432. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1vcxmui._.js.map → 11mp_@anthropic-ai_sdk_08rl0hf._.js.map} +0 -0
  433. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1uugb45._.js.map → 11mp_@anthropic-ai_sdk_09ujrsu._.js.map} +0 -0
  434. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1tgk9wk._.js.map → 11mp_@anthropic-ai_sdk_0c3_7p7._.js.map} +0 -0
  435. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1s8h60-._.js.map → 11mp_@anthropic-ai_sdk_0cto43x._.js.map} +0 -0
  436. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1rdesfd._.js.map → 11mp_@anthropic-ai_sdk_0fgisb_._.js.map} +0 -0
  437. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1ndwnmb._.js.map → 11mp_@anthropic-ai_sdk_0fy8wd3._.js.map} +0 -0
  438. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1hf-884._.js.map → 11mp_@anthropic-ai_sdk_0fyvizf._.js.map} +0 -0
  439. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1gr-orf._.js.map → 11mp_@anthropic-ai_sdk_0hg0i2g._.js.map} +0 -0
  440. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1ezcndt._.js.map → 11mp_@anthropic-ai_sdk_0i0sz05._.js.map} +0 -0
  441. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1ekldtb._.js.map → 11mp_@anthropic-ai_sdk_0l0j9c6._.js.map} +0 -0
  442. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1b1-3vt._.js.map → 11mp_@anthropic-ai_sdk_0lcm61d._.js.map} +0 -0
  443. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1agvp6h._.js.map → 11mp_@anthropic-ai_sdk_0qtva5j._.js.map} +0 -0
  444. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1_jq3yb._.js.map → 11mp_@anthropic-ai_sdk_0r4fkdu._.js.map} +0 -0
  445. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1887ce1._.js.map → 11mp_@anthropic-ai_sdk_0wbae0t._.js.map} +0 -0
  446. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_13w62gi._.js.map → 11mp_@anthropic-ai_sdk_0wxyz1t._.js.map} +0 -0
  447. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_13vu693._.js.map → 11mp_@anthropic-ai_sdk_0y2cods._.js.map} +0 -0
  448. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1-efoj1._.js.map → 11mp_@anthropic-ai_sdk_0zu0fj1._.js.map} +0 -0
  449. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1-7bj56._.js.map → 11mp_@anthropic-ai_sdk_0zxpgt0._.js.map} +0 -0
  450. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0x21fif._.js.map → 11mp_@anthropic-ai_sdk_10_cxcd._.js.map} +0 -0
  451. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0th0pyh._.js.map → 11mp_@anthropic-ai_sdk_10gb7d1._.js.map} +0 -0
  452. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0spr_aj._.js.map → 11mp_@anthropic-ai_sdk_12q70bs._.js.map} +0 -0
  453. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0qxmzg8._.js.map → 11mp_@anthropic-ai_sdk_149ltk3._.js.map} +0 -0
  454. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0nltdmf._.js.map → 11mp_@anthropic-ai_sdk_165_uiw._.js.map} +0 -0
  455. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0m-xqs_._.js.map → 11mp_@anthropic-ai_sdk_19w4zh6._.js.map} +0 -0
  456. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0l1p4c6._.js.map → 11mp_@anthropic-ai_sdk_1adck-s._.js.map} +0 -0
  457. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0i7ckik._.js.map → 11mp_@anthropic-ai_sdk_1c2dwoi._.js.map} +0 -0
  458. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0i4w8fv._.js.map → 11mp_@anthropic-ai_sdk_1d9lw_2._.js.map} +0 -0
  459. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0el8pm6._.js.map → 11mp_@anthropic-ai_sdk_1db6a7p._.js.map} +0 -0
  460. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0e5qkuv._.js.map → 11mp_@anthropic-ai_sdk_1h2f90s._.js.map} +0 -0
  461. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0ckxhy7._.js.map → 11mp_@anthropic-ai_sdk_1k5_i1z._.js.map} +0 -0
  462. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0cd5lu7._.js.map → 11mp_@anthropic-ai_sdk_1p3mv6i._.js.map} +0 -0
  463. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0br_1fc._.js.map → 11mp_@anthropic-ai_sdk_1qoom5s._.js.map} +0 -0
  464. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0aykesf._.js.map → 11mp_@anthropic-ai_sdk_1qsbcbe._.js.map} +0 -0
  465. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0_jynr-._.js.map → 11mp_@anthropic-ai_sdk_1rk0x59._.js.map} +0 -0
  466. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0_5gzfy._.js.map → 11mp_@anthropic-ai_sdk_1sd98mi._.js.map} +0 -0
  467. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_07fgg-l._.js.map → 11mp_@anthropic-ai_sdk_1sumqg8._.js.map} +0 -0
  468. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_05oneea._.js.map → 11mp_@anthropic-ai_sdk_1t-rt4q._.js.map} +0 -0
  469. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_05iv23g._.js.map → 11mp_@anthropic-ai_sdk_1tr-k4y._.js.map} +0 -0
  470. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_02lx_j3._.js.map → 11mp_@anthropic-ai_sdk_1xk3c39._.js.map} +0 -0
  471. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_01gyja3._.js.map → 11mp_@anthropic-ai_sdk_206l10_._.js.map} +0 -0
  472. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0-r4g2t._.js.map → 11mp_@anthropic-ai_sdk_20giys9._.js.map} +0 -0
  473. /package/.next/server/chunks/{[root-of-the-server]__0zy73pu._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_018s_10._.js.map} +0 -0
  474. /package/.next/server/chunks/{[root-of-the-server]__06ndlro._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_08d6i7w._.js.map} +0 -0
  475. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1xx8_-m._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_09_fd9g._.js.map} +0 -0
  476. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1x_fy5x._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0eopml6._.js.map} +0 -0
  477. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1x_0sf4._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0f5epel._.js.map} +0 -0
  478. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1tzpss1._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0okfnhu._.js.map} +0 -0
  479. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1pdl5qg._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0s8-ha8._.js.map} +0 -0
  480. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1jxtz_6._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0ujs27r._.js.map} +0 -0
  481. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1dm3so9._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0uo7rs8._.js.map} +0 -0
  482. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1ck6z1z._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0vyq_2d._.js.map} +0 -0
  483. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1ao3e3l._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0w3js74._.js.map} +0 -0
  484. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_13lk7wf._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0xa4-uq._.js.map} +0 -0
  485. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_13-fsm5._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_113y3so._.js.map} +0 -0
  486. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0zu51ny._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_12qcr96._.js.map} +0 -0
  487. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0z31-c0._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_13ixdy8._.js.map} +0 -0
  488. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0ybdfbv._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1708vst._.js.map} +0 -0
  489. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0vilstf._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1_rdguq._.js.map} +0 -0
  490. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0ncvuil._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1bgpe23._.js.map} +0 -0
  491. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0n6aq49._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1f-tphn._.js.map} +0 -0
  492. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0iy714m._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1h1pqdh._.js.map} +0 -0
  493. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0ew4_uw._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1hfj_1d._.js.map} +0 -0
  494. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0dr79hc._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1ih2qzz._.js.map} +0 -0
  495. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0_va-1q._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1jatyl1._.js.map} +0 -0
  496. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_07kod-g._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1v1zbha._.js.map} +0 -0
  497. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_06kgcr0._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1vyqs5z._.js.map} +0 -0
  498. /package/.next/server/chunks/{[root-of-the-server]__0xldguc._.js.map → [root-of-the-server]__00usbi3._.js.map} +0 -0
  499. /package/.next/server/chunks/{[root-of-the-server]__0i1yba1._.js.map → [root-of-the-server]__04cwur0._.js.map} +0 -0
  500. /package/.next/server/chunks/{[root-of-the-server]__1yh-4vk._.js.map → [root-of-the-server]__04ri_ci._.js.map} +0 -0
  501. /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_00nr0dy._.js.map → [root-of-the-server]__05-be3n._.js.map} +0 -0
  502. /package/.next/server/chunks/{[root-of-the-server]__0wc_gnr._.js.map → [root-of-the-server]__0756_60._.js.map} +0 -0
  503. /package/.next/server/chunks/{[root-of-the-server]__0pz59qo._.js.map → [root-of-the-server]__089ay-q._.js.map} +0 -0
  504. /package/.next/server/chunks/{[root-of-the-server]__0cxmrop._.js.map → [root-of-the-server]__0d4t4q6._.js.map} +0 -0
  505. /package/.next/server/chunks/{[root-of-the-server]__1ef-hw_._.js.map → [root-of-the-server]__0dgwykw._.js.map} +0 -0
  506. /package/.next/server/chunks/{[root-of-the-server]__1qcy2l0._.js.map → [root-of-the-server]__0s-j6z-._.js.map} +0 -0
  507. /package/.next/server/chunks/{[root-of-the-server]__1zhd93r._.js.map → [root-of-the-server]__0yaxn8g._.js.map} +0 -0
  508. /package/.next/server/chunks/{[root-of-the-server]__0rh8yfn._.js.map → [root-of-the-server]__162_l0k._.js.map} +0 -0
  509. /package/.next/server/chunks/{[root-of-the-server]__0hk-9ll._.js.map → [root-of-the-server]__16smlkg._.js.map} +0 -0
  510. /package/.next/server/chunks/{[root-of-the-server]__11rp-qx._.js.map → [root-of-the-server]__19yo85m._.js.map} +0 -0
  511. /package/.next/server/chunks/{[root-of-the-server]__1sn6-7a._.js.map → [root-of-the-server]__1mnzsbh._.js.map} +0 -0
  512. /package/.next/server/chunks/{[root-of-the-server]__11nbc9e._.js.map → [root-of-the-server]__1ntu_6r._.js.map} +0 -0
  513. /package/.next/server/chunks/{[root-of-the-server]__1wbho9e._.js.map → [root-of-the-server]__1s0t8r3._.js.map} +0 -0
  514. /package/.next/server/chunks/{[root-of-the-server]__1r67yrn._.js.map → [root-of-the-server]__1sd3l-d._.js.map} +0 -0
  515. /package/.next/server/chunks/{[root-of-the-server]__0rikmqn._.js.map → [root-of-the-server]__1vzxnjb._.js.map} +0 -0
  516. /package/.next/server/chunks/{[root-of-the-server]__08v3p50._.js.map → [root-of-the-server]__1zeys20._.js.map} +0 -0
  517. /package/.next/server/chunks/ssr/{_0me5_6x._.js.map → _0-_04ia._.js.map} +0 -0
  518. /package/.next/server/chunks/ssr/{_190c11r._.js.map → _0cv0ugs._.js.map} +0 -0
  519. /package/.next/server/chunks/ssr/{_1feybpz._.js.map → _1hm7p_8._.js.map} +0 -0
  520. /package/.next/server/chunks/ssr/{_1cz8dnu._.js.map → _1s-2jub._.js.map} +0 -0
  521. /package/.next/static/{5hNes2Kijr5IvUPPw-ez9 → P1gxTEpKVh-OOtIXC432U}/_buildManifest.js +0 -0
  522. /package/.next/static/{5hNes2Kijr5IvUPPw-ez9 → P1gxTEpKVh-OOtIXC432U}/_clientMiddlewareManifest.js +0 -0
  523. /package/.next/static/{5hNes2Kijr5IvUPPw-ez9 → P1gxTEpKVh-OOtIXC432U}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/memory/EntryList.tsx","../../../../src/components/memory/EntryDetail.tsx","../../../../src/components/memory/EntryHistory.tsx","../../../../src/components/memory/MemoryTab.tsx","../../../../src/components/memory/MemoryGraph.tsx","../../../../src/components/memory/MergeDialog.tsx","../../../../src/components/memory/CleanupPanel.tsx","../../../../src/app/%28app%29/memory/page.tsx","../../../../src/lib/entries.ts","../../../../src/lib/recall.ts","../../../../node_modules/.pnpm/lucide-react%401.48.0_react%4019.3.0/node_modules/lucide-react/src/icons/git-commit-horizontal.ts","../../../../src/lib/memory-graph.ts"],"sourcesContent":["\"use client\"\n\nimport { useMemo, useState } from \"react\"\nimport { Plus, Search } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { Input } from \"@/components/ui/input\"\nimport { OwnerChip } from \"@/components/shared/OwnerChip\"\nimport { ENTRY_TYPES, type Entry, type EntryType } from \"@/lib/entries\"\nimport { filterEntries, tokenize } from \"@/lib/recall\"\n\n/** Knowledge entries (R046) with search (ranked like vibedoc_recall) and a type filter. */\nexport function EntryList({ entries, selectedId, onOpen, onNew }: {\n entries: Entry[]\n selectedId?: string | null\n onOpen: (id: string) => void\n onNew: () => void\n}) {\n const [query, setQuery] = useState(\"\")\n const [type, setType] = useState<EntryType | null>(null)\n const shown = useMemo(() => filterEntries(entries, { query, type }), [entries, query, type])\n const counts = useMemo(() => {\n const c: Record<string, number> = {}\n for (const e of entries) c[e.type] = (c[e.type] ?? 0) + 1\n return c\n }, [entries])\n const searching = tokenize(query).length > 0\n\n const chip = (value: EntryType | null, label: string, count: number) => (\n <button\n key={label}\n type=\"button\"\n aria-pressed={type === value}\n onClick={() => setType(value)}\n className={cn(\n \"h-6 rounded-[5px] border border-transparent px-2 text-xs font-medium text-muted outline-none transition-colors\",\n \"hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\",\n type === value && \"border-border2 bg-surface2 text-txt\",\n )}\n >\n {label} <span className=\"font-mono text-[10px] opacity-70\">{count}</span>\n </button>\n )\n\n return (\n <section aria-label=\"Knowledge entries\" className=\"flex min-w-0 flex-col gap-3\">\n <div className=\"flex items-baseline justify-between\">\n <h2 className=\"font-display text-base font-semibold tracking-tight\">Knowledge entries</h2>\n <button\n type=\"button\"\n onClick={onNew}\n className=\"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted outline-none hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\"\n >\n <Plus className=\"size-3.5\" aria-hidden /> New entry\n </button>\n </div>\n\n <div className=\"relative\">\n <Search className=\"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted\" aria-hidden />\n <Input\n id=\"memory-search\"\n type=\"search\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder=\"Search entries…\"\n aria-label=\"Search entries\"\n className=\"h-8 pl-8\"\n />\n </div>\n\n <div role=\"group\" aria-label=\"Filter by type\" className=\"flex flex-wrap gap-1\">\n {chip(null, \"All\", entries.length)}\n {ENTRY_TYPES.map((t) => chip(t, t, counts[t] ?? 0))}\n </div>\n\n {entries.length === 0 ? (\n <p className=\"rounded-xl border border-dashed border-border p-4 text-sm text-muted\">\n No knowledge entries yet. Agents save them with <code className=\"font-mono text-xs\">vibedoc_save_entry</code>.\n </p>\n ) : shown.length === 0 ? (\n <p className=\"p-2 text-sm text-muted\">\n No entries match {searching ? `\"${query.trim()}\"` : \"this filter\"}.\n </p>\n ) : (\n <ul className=\"flex flex-col divide-y divide-border rounded-xl border border-border bg-surface\">\n {shown.map((e) => (\n <li key={e.id}>\n <button\n type=\"button\"\n onClick={() => onOpen(e.id)}\n aria-current={e.id === selectedId ? \"true\" : undefined}\n className={cn(\n \"flex w-full flex-col gap-0.5 px-3 py-2 text-left outline-none transition-colors hover:bg-surface2 focus-visible:bg-surface2\",\n e.id === selectedId && \"bg-surface2 shadow-[inset_2px_0_0_var(--color-accent-edge)]\",\n )}\n >\n <span className=\"flex items-center gap-2 font-mono text-[11px] text-muted\">\n <span>{e.id}</span>\n <span>·</span>\n <span>{e.type}</span>\n <span className=\"ml-auto flex items-center gap-2\">\n <OwnerChip owner={e.by} className=\"font-sans\" />\n {e.updatedAt}\n </span>\n </span>\n <span className=\"text-sm text-txt\">{e.summary}</span>\n </button>\n </li>\n ))}\n </ul>\n )}\n </section>\n )\n}\n","\"use client\"\n\nimport { useEffect, useState, type ReactNode } from \"react\"\nimport { Pencil, Trash2, X } from \"lucide-react\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { ItemPanelHeader } from \"@/components/shared/ItemPanelHeader\"\nimport { OwnerChip } from \"@/components/shared/OwnerChip\"\nimport { MarkdownRenderer } from \"@/components/docs/MarkdownRenderer\"\nimport { ENTRY_TYPES, validateEntryInput, type Entry, type EntryType } from \"@/lib/entries\"\n\ntype Draft = { type: EntryType; summary: string; body: string }\n\n/**\n * One knowledge entry: read view with Edit, or the edit form. `entry` null = a new entry (form only).\n * R053 adds its panels (Related, History) under the body via `children`.\n */\nexport function EntryDetail({ entry, rootParam, onSaved, onDelete, onClose, children }: {\n entry: Entry | null\n rootParam: string\n onSaved: (entry: Entry) => void\n onDelete: (entry: Entry) => void\n onClose: () => void\n children?: ReactNode\n}) {\n const [editing, setEditing] = useState(entry === null)\n const [draft, setDraft] = useState<Draft>(() => toDraft(entry))\n const [error, setError] = useState<string | null>(null)\n const [saving, setSaving] = useState(false)\n\n const startEdit = () => { setDraft(toDraft(entry)); setError(null); setEditing(true) }\n const cancel = () => { if (entry) { setEditing(false); setError(null) } else onClose() }\n\n const save = async () => {\n // same rules as the server, so a bad summary never costs a request\n const invalid = validateEntryInput({ ...draft, id: entry?.id })\n if (invalid) { setError(invalid); return }\n setSaving(true)\n setError(null)\n try {\n const res = await fetch(`/api/memory/entries/save${rootParam}`, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ ...(entry ? { id: entry.id } : {}), ...draft }),\n })\n const data = (await res.json().catch(() => ({}))) as { entry?: Entry; error?: string }\n if (!res.ok || !data.entry) throw new Error(data.error ?? `Save failed (${res.status})`)\n setEditing(false)\n onSaved(data.entry)\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e))\n } finally {\n setSaving(false)\n }\n }\n\n // ⌫ / Delete deletes the open entry, unless the user is typing somewhere\n useEffect(() => {\n if (editing || !entry) return\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Backspace\" && e.key !== \"Delete\") return\n if (e.metaKey || e.ctrlKey || e.altKey) return\n const t = e.target as HTMLElement | null\n if (t && (t.isContentEditable || [\"INPUT\", \"TEXTAREA\", \"SELECT\"].includes(t.tagName))) return\n e.preventDefault()\n onDelete(entry)\n }\n window.addEventListener(\"keydown\", onKey)\n return () => window.removeEventListener(\"keydown\", onKey)\n }, [editing, entry, onDelete])\n\n const closeButton = (\n <button type=\"button\" onClick={onClose} aria-label=\"Close entry\" className=\"rounded p-1 text-muted hover:bg-surface2 hover:text-txt\">\n <X className=\"size-3.5\" />\n </button>\n )\n\n if (editing) {\n return (\n <section aria-label={entry ? `Edit ${entry.id}` : \"New entry\"} className=\"rounded-xl border border-border bg-surface\">\n <form\n onSubmit={(e) => { e.preventDefault(); void save() }}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") { e.preventDefault(); cancel() }\n if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) { e.preventDefault(); void save() }\n }}\n className=\"flex flex-col gap-3 p-5\"\n >\n <div className=\"flex items-center justify-between font-mono text-[11px] text-muted\">\n <span>{entry ? `${entry.id} · editing` : \"New entry\"}</span>\n {closeButton}\n </div>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Type\n <select\n value={draft.type}\n onChange={(e) => setDraft({ ...draft, type: e.target.value as EntryType })}\n className=\"h-8 rounded-md border border-border bg-bg px-2 text-sm text-txt focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent\"\n >\n {ENTRY_TYPES.map((t) => <option key={t} value={t}>{t}</option>)}\n </select>\n </label>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Summary (one line)\n <Input\n autoFocus\n value={draft.summary}\n onChange={(e) => setDraft({ ...draft, summary: e.target.value })}\n maxLength={200}\n className=\"h-8 text-txt\"\n />\n </label>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Details (markdown)\n <textarea\n value={draft.body}\n onChange={(e) => setDraft({ ...draft, body: e.target.value })}\n rows={8}\n className=\"w-full resize-y rounded-md border border-border bg-bg px-3 py-2 font-mono text-xs text-txt focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent\"\n />\n </label>\n {error && <p role=\"alert\" className=\"text-xs text-danger\">{error}</p>}\n <div className=\"flex items-center justify-end gap-2\">\n <span className=\"mr-auto text-[11px] text-muted\">⌘↵ save · Esc cancel</span>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={cancel}>Cancel</Button>\n <Button type=\"submit\" size=\"sm\" disabled={saving}>{saving ? \"Saving…\" : \"Save\"}</Button>\n </div>\n </form>\n </section>\n )\n }\n\n if (!entry) return null\n return (\n <section aria-label={entry.id} className=\"rounded-xl border border-border bg-surface\">\n <ItemPanelHeader\n kicker={<span>{entry.id} · entry</span>}\n menu={\n <span className=\"flex items-center gap-1\">\n <Button variant=\"ghost\" size=\"sm\" onClick={startEdit} className=\"h-7 px-2 text-xs\">\n <Pencil className=\"size-3.5\" /> Edit\n </Button>\n <Button variant=\"ghost\" size=\"sm\" onClick={() => onDelete(entry)} title=\"Delete (⌫)\" className=\"h-7 px-2 text-xs hover:text-danger\">\n <Trash2 className=\"size-3.5\" /> Delete\n </Button>\n {closeButton}\n </span>\n }\n title={entry.summary}\n properties={[\n { label: \"Type\", value: entry.type },\n { label: \"Updated\", value: entry.updatedAt || null },\n { label: \"Changed by\", value: entry.by ? <OwnerChip owner={entry.by} className=\"text-xs text-txt\" /> : null },\n { label: \"File\", value: <span className=\"truncate font-mono text-[11px] text-muted\">{entry.file}</span> },\n ]}\n />\n <div className=\"p-5\">\n {entry.body ? <MarkdownRenderer content={entry.body} /> : <p className=\"text-sm text-muted\">No details.</p>}\n {children}\n </div>\n </section>\n )\n}\n\nfunction toDraft(entry: Entry | null): Draft {\n return entry ? { type: entry.type, summary: entry.summary, body: entry.body } : { type: \"convention\", summary: \"\", body: \"\" }\n}\n","\"use client\"\n\nimport { useState } from \"react\"\nimport { ChevronRight, GitCommitHorizontal, X } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { useApp } from \"@/context/AppContext\"\nimport type { FileCommit, FileHistory } from \"@/lib/core\"\n\n/**\n * How an entry changed over time (R053): the commits that touched its file, from git.\n * Collapsed by default; nothing is fetched until it is opened. A row shows that version read-only.\n */\nexport function EntryHistory({ entryId }: { entryId: string }) {\n const { rootParam } = useApp()\n const [open, setOpen] = useState(false)\n const [data, setData] = useState<FileHistory | null>(null)\n const [error, setError] = useState<string | null>(null)\n const [version, setVersion] = useState<{ commit: FileCommit; text: string } | null>(null)\n const base = `/api/memory/history${rootParam}&entry=${encodeURIComponent(entryId)}`\n\n const get = async <T,>(url: string): Promise<T> => {\n const res = await fetch(url)\n const body = await res.json().catch(() => ({}))\n if (!res.ok) throw new Error(body.error ?? `Request failed (${res.status})`)\n return body as T\n }\n\n const toggle = async () => {\n const next = !open\n setOpen(next)\n if (!next || data) return\n try {\n setData(await get<FileHistory>(base))\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e))\n }\n }\n\n const show = async (commit: FileCommit) => {\n try {\n const { text } = await get<{ text: string }>(`${base}&sha=${commit.sha}`)\n setVersion({ commit, text })\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e))\n }\n }\n\n return (\n <section aria-label=\"History\" className=\"mt-4 border-t border-border pt-3\">\n <button\n type=\"button\"\n onClick={toggle}\n aria-expanded={open}\n className=\"flex items-center gap-1 rounded text-xs font-semibold text-txt outline-none focus-visible:ring-2 focus-visible:ring-accent\"\n >\n <ChevronRight className={cn(\"size-3.5 text-muted transition-transform\", open && \"rotate-90\")} aria-hidden />\n History\n </button>\n\n {open && (\n <div className=\"mt-2 flex flex-col gap-2\">\n {error && <p role=\"alert\" className=\"text-xs text-danger\">{error}</p>}\n {!data && !error && <p className=\"text-xs text-muted\">Loading history…</p>}\n {data?.reason === \"no-git\" && <p className=\"text-xs text-muted\">History needs git: this project is not a git repository.</p>}\n {data && !data.reason && !data.history.length && !data.uncommitted && (\n <p className=\"text-xs text-muted\">Not committed yet.</p>\n )}\n {data && (data.uncommitted || data.history.length > 0) && (\n <ul className=\"flex flex-col\">\n {data.uncommitted && (\n <li className=\"flex items-center gap-2 px-2 py-1 text-xs text-muted\">\n <span className=\"size-1.5 rounded-full bg-accent\" aria-hidden /> Uncommitted changes\n </li>\n )}\n {data.history.map((c) => (\n <li key={c.sha}>\n <button\n type=\"button\"\n onClick={() => show(c)}\n aria-current={version?.commit.sha === c.sha ? \"true\" : undefined}\n className={cn(\n \"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-xs outline-none hover:bg-surface2 focus-visible:ring-2 focus-visible:ring-accent\",\n version?.commit.sha === c.sha && \"bg-surface2\",\n )}\n >\n <GitCommitHorizontal className=\"size-3.5 shrink-0 text-muted\" aria-hidden />\n <span className=\"shrink-0 font-mono text-[11px] text-muted\">{c.date.slice(0, 10)}</span>\n <span className=\"min-w-0 flex-1 truncate text-txt\">{c.subject}</span>\n <span className=\"shrink-0 text-muted\">{c.author}</span>\n </button>\n </li>\n ))}\n </ul>\n )}\n {version && (\n <div className=\"rounded-md border border-border bg-bg\">\n <div className=\"flex items-center justify-between border-b border-border px-3 py-1.5 font-mono text-[11px] text-muted\">\n <span>{version.commit.sha.slice(0, 7)} · {version.commit.date.slice(0, 10)} · read-only</span>\n <button type=\"button\" onClick={() => setVersion(null)} aria-label=\"Close version\" className=\"rounded p-0.5 hover:text-txt\">\n <X className=\"size-3.5\" />\n </button>\n </div>\n <pre className=\"max-h-72 overflow-auto whitespace-pre-wrap p-3 font-mono text-xs text-txt\">{version.text}</pre>\n </div>\n )}\n </div>\n )}\n </section>\n )\n}\n","import { MarkdownRenderer } from \"@/components/docs/MarkdownRenderer\"\nimport { EmptyState } from \"@/components/shared/EmptyState\"\nimport type { Entry } from \"@/lib/entries\"\nimport { EntryList } from \"./EntryList\"\nimport { EntryDetail } from \"./EntryDetail\"\nimport { EntryRelated } from \"./EntryRelated\"\nimport { EntryHistory } from \"./EntryHistory\"\nimport { MemoryGraph } from \"./MemoryGraph\"\nimport { CleanupPanel } from \"./CleanupPanel\"\nimport type { MergeInput } from \"./MergeDialog\"\nimport type { CleanupFlag } from \"@/lib/core\"\nimport { cn } from \"@/lib/utils\"\nimport { AlertTriangle } from \"lucide-react\"\n\ninterface MemoryTabProps {\n memory: { content: string; exists: boolean } | null\n /** null while loading */\n entries: Entry[] | null\n rootParam: string\n /** The open entry id (from ?entry=), or null */\n selectedId: string | null\n /** The New entry form is open */\n creating: boolean\n onOpen: (id: string) => void\n onNew: () => void\n onClose: () => void\n onSaved: (entry: Entry) => void\n onDelete: (entry: Entry) => void\n view: \"list\" | \"graph\"\n onView: (view: \"list\" | \"graph\") => void\n /** Health flags incl. dismissed ones (null while loading) */\n flags: CleanupFlag[] | null\n /** The Cleanup panel is open (?cleanup=1) */\n cleanup: boolean\n onCleanup: (open: boolean) => void\n onDismiss: (flag: CleanupFlag) => void\n onMerge: (input: MergeInput) => Promise<string | null>\n /** Delete from a \"Not recalled lately\" row; the Cleanup panel stays open */\n onDeleteStale: (id: string) => void\n}\n\nexport function MemoryTab({ memory, entries, rootParam, selectedId, creating, onOpen, onNew, onClose, onSaved, onDelete, view, onView, flags, cleanup, onCleanup, onDismiss, onMerge, onDeleteStale }: MemoryTabProps) {\n const selected = selectedId ? entries?.find((e) => e.id === selectedId) : undefined\n const open = flags?.filter((f) => !f.dismissed) ?? []\n const warn = open.some((f) => f.severity === \"warn\")\n return (\n <div className={cn(\n \"grid items-start gap-6 p-6\",\n view === \"graph\" ? \"lg:grid-cols-[minmax(0,1fr)_minmax(0,30rem)]\" : \"lg:grid-cols-[minmax(280px,380px)_minmax(0,42rem)]\",\n )}>\n <div className=\"flex items-center justify-between gap-4 lg:col-span-2\">\n <h1 className=\"font-display text-xl font-semibold tracking-tight\">Memory</h1>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n aria-pressed={cleanup}\n onClick={() => onCleanup(!cleanup)}\n className={cn(\n \"flex h-7 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium text-muted outline-none transition-colors duration-(--duration-fast)\",\n \"hover:border-border2 hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\",\n cleanup && \"border-border2 bg-surface2 text-txt\",\n )}\n >\n {warn && <AlertTriangle className=\"size-3.5 text-amber\" aria-hidden />}\n Cleanup <span className=\"font-mono text-[11px]\">({open.length})</span>\n </button>\n <div role=\"group\" aria-label=\"Entries view\" className=\"flex rounded-md border border-border p-0.5\">\n {([\"list\", \"graph\"] as const).map((v) => (\n <button\n key={v}\n type=\"button\"\n aria-pressed={view === v}\n onClick={() => onView(v)}\n className={cn(\n \"h-6 rounded-[5px] border border-transparent px-2.5 text-xs font-medium capitalize text-muted outline-none transition-colors\",\n \"hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\",\n view === v && \"border-border2 bg-surface2 text-txt\",\n )}\n >\n {v}\n </button>\n ))}\n </div>\n </div>\n </div>\n {entries && view === \"graph\" ? (\n <MemoryGraph entries={entries} selectedId={selectedId} onOpenEntry={onOpen} />\n ) : entries ? (\n <EntryList entries={entries} selectedId={selectedId} onOpen={onOpen} onNew={onNew} />\n ) : (\n <p className=\"text-sm text-muted\">Loading entries…</p>\n )}\n {creating || selected ? (\n <div className=\"min-w-0 lg:sticky lg:top-6\">\n <EntryDetail key={creating ? \"new\" : selected?.id} entry={creating ? null : selected ?? null} rootParam={rootParam} onSaved={onSaved} onDelete={onDelete} onClose={onClose}>\n {selected && !creating && (\n <>\n <EntryRelated entryId={selected.id} onOpenEntry={onOpen} />\n <EntryHistory entryId={selected.id} />\n </>\n )}\n </EntryDetail>\n </div>\n ) : cleanup ? (\n <div className=\"min-w-0 lg:sticky lg:top-6\">\n <CleanupPanel flags={flags} entries={entries} onDismiss={onDismiss} onMerge={onMerge} onDelete={onDeleteStale} onOpenEntry={onOpen} onClose={() => onCleanup(false)} />\n </div>\n ) : selectedId && entries ? (\n <div role=\"alert\" className=\"min-w-0 rounded-xl border border-dashed border-border p-5 text-sm text-muted\">\n Entry {selectedId} not found.{\" \"}\n <button type=\"button\" onClick={onClose} className=\"text-txt underline underline-offset-2\">Show the handoff</button>\n </div>\n ) : (\n <div className=\"min-w-0\">\n <div className=\"flex items-baseline justify-between mb-3\">\n <h2 className=\"font-display text-base font-semibold tracking-tight\">Session handoff</h2>\n <span className=\"text-xs font-mono text-muted\">memory/MEMORY.md</span>\n </div>\n\n {memory?.exists ? (\n <div className=\"bg-surface border border-border rounded-xl p-5\">\n <MarkdownRenderer content={memory.content} />\n </div>\n ) : (\n <EmptyState\n icon=\"🧠\"\n message=\"No MEMORY.md yet.\"\n subMessage=\"AI will create one at the end of the first session.\"\n bordered\n />\n )}\n\n <div className=\"mt-4 p-4 bg-surface2 border border-border rounded-xl\">\n <p className=\"text-xs font-mono text-muted mb-2\">\n Add to your CLAUDE.md system prompt:\n </p>\n <pre className=\"text-xs font-mono text-accent/80 whitespace-pre-wrap leading-relaxed\">{`At session start:\n1. Call vibedoc_read_memory\n If it shows ⚠ Memory warnings, fix the handoff with vibedoc_update_memory first\n2. Call vibedoc_get_status\n\nWhen you learn a fact that should still hold next week:\n- Call vibedoc_save_entry (convention, gotcha, decision, preference)\n\nAt session end:\n- Call vibedoc_update_memory with full handoff`}</pre>\n </div>\n </div>\n )}\n </div>\n )\n}\n","\"use client\"\n\nimport { memo, useEffect, useMemo, useState, useSyncExternalStore } from \"react\"\nimport { Background, BackgroundVariant, Controls, Handle, Position, ReactFlow, type Edge, type Node, type NodeProps } from \"@xyflow/react\"\nimport \"@xyflow/react/dist/style.css\"\nimport { cn } from \"@/lib/utils\"\nimport { useApp } from \"@/context/AppContext\"\nimport { StatusIcon } from \"@/components/shared/StatusIcon\"\nimport { displayStatus } from \"@/lib/statuses\"\nimport type { Entry } from \"@/lib/entries\"\nimport { GRAPH_COL_W, graphLayout, type GraphNode, type MemoryGraph as Graph } from \"@/lib/memory-graph\"\nimport { KIND_ICON, useOpenNode } from \"./EntryRelated\"\n\ntype MemNodeData = { node: GraphNode; status?: string; unlinked: boolean; dim: boolean; active: boolean }\ntype MemNode = Node<MemNodeData, \"mem\">\n\nconst NODE_W = GRAPH_COL_W - 44\nconst FLOW_STYLE = { \"--xy-background-color\": \"var(--color-bg)\" } as React.CSSProperties\n// ponytail: above this many nodes only the ones on screen render; measured smooth at 240 entries either way\nconst VIRTUALIZE_OVER = 150\n// fitting a wide graph shrinks the text past reading; below this zoom, centre it and let the user pan\nconst FIT_MIN_ZOOM = 0.8\n\nfunction subscribeTheme(cb: () => void) {\n const mo = new MutationObserver(cb)\n mo.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\"] })\n return () => mo.disconnect()\n}\n\n/** One node: kind icon (or task status), id, label. Handles left and right; edges pick a side by column. */\nconst MemNodeView = memo(function MemNodeView({ data }: NodeProps<MemNode>) {\n const { node, status, unlinked, dim, active } = data\n const Icon = KIND_ICON[node.kind]\n return (\n <div\n title={node.path}\n style={{ width: NODE_W }}\n className={cn(\n \"flex items-center gap-2 rounded-md border bg-surface px-2.5 py-1.5 text-xs transition-opacity\",\n node.kind === \"entry\" ? \"border-border2\" : \"border-border\",\n active && \"border-accent ring-1 ring-accent\",\n unlinked && \"border-dashed opacity-60\",\n dim && \"opacity-25\",\n )}\n >\n {[\"l\", \"r\"].map((side) => (\n <span key={side}>\n <Handle id={side} type=\"source\" position={side === \"l\" ? Position.Left : Position.Right} isConnectable={false} className=\"opacity-0\" />\n <Handle id={`${side}-t`} type=\"target\" position={side === \"l\" ? Position.Left : Position.Right} isConnectable={false} className=\"opacity-0\" />\n </span>\n ))}\n {status ? <StatusIcon status={status} className=\"size-3.5 shrink-0\" /> : <Icon className={cn(\"size-3.5 shrink-0\", node.kind === \"entry\" ? \"text-accent\" : \"text-muted\")} aria-hidden />}\n {node.kind !== \"doc\" && <span className=\"shrink-0 font-mono text-[10px] text-muted\">{node.id}</span>}\n <span className={cn(\"min-w-0 truncate\", node.kind === \"entry\" ? \"text-txt\" : \"text-muted\")}>{node.label}</span>\n </div>\n )\n})\nconst nodeTypes = { mem: MemNodeView }\n\n/**\n * Entries and the tasks, epics, ADRs and docs they link to (R053). Deterministic layout from graphLayout();\n * selecting an entry highlights it and its neighbours. Refetches on every memory_updated SSE event.\n */\nexport function MemoryGraph({ entries, selectedId, onOpenEntry }: { entries: Entry[]; selectedId: string | null; onOpenEntry: (id: string) => void }) {\n const { rootParam, summary, board } = useApp()\n const open = useOpenNode(onOpenEntry)\n const [graph, setGraph] = useState<Graph | null>(null)\n const isDark = useSyncExternalStore(subscribeTheme, () => document.documentElement.classList.contains(\"dark\"), () => true)\n\n useEffect(() => {\n let live = true\n fetch(`/api/memory/graph${rootParam}`)\n .then((r) => r.json())\n .then((g: Graph) => { if (live) setGraph(g.nodes ? g : { nodes: [], edges: [] }) })\n .catch((e) => {\n console.warn(\"Loading the memory graph failed\", e)\n if (live) setGraph({ nodes: [], edges: [] })\n })\n return () => { live = false }\n }, [rootParam, summary])\n\n const { nodes, edges } = useMemo(() => {\n if (!graph) return { nodes: [] as MemNode[], edges: [] as Edge[] }\n const types = Object.fromEntries(entries.map((e) => [e.id, e.type]))\n const pos = graphLayout(graph, types)\n const tasks = new Map(Object.values(board ?? {}).flat().map((t) => [t.id, t]))\n const linked = new Set(graph.edges.flatMap((e) => [e.from, e.to]))\n const focus = selectedId && pos[selectedId]\n ? new Set([selectedId, ...graph.edges.filter((e) => e.from === selectedId || e.to === selectedId).flatMap((e) => [e.from, e.to])])\n : null\n const nodes: MemNode[] = graph.nodes.map((n) => {\n const task = n.kind === \"task\" ? tasks.get(n.id) : undefined\n return {\n id: n.id,\n type: \"mem\",\n position: pos[n.id] ?? { x: 0, y: 0 },\n data: {\n node: n,\n status: task ? displayStatus(task) : undefined,\n unlinked: n.kind === \"entry\" && !linked.has(n.id),\n dim: !!focus && !focus.has(n.id),\n active: n.id === selectedId,\n },\n draggable: false,\n }\n })\n const edges: Edge[] = graph.edges.map((e) => {\n const fx = pos[e.from]?.x ?? 0, tx = pos[e.to]?.x ?? 0\n const leftward = tx < fx\n const hot = !!focus && (e.from === selectedId || e.to === selectedId)\n return {\n id: `${e.from}->${e.to}`,\n source: e.from,\n target: e.to,\n // same column (entry → entry) loops out and back on the right\n sourceHandle: leftward ? \"l\" : \"r\",\n targetHandle: leftward ? \"r-t\" : tx === fx ? \"r-t\" : \"l-t\",\n style: { stroke: hot ? \"var(--color-accent)\" : \"var(--color-border2)\", strokeWidth: hot ? 1.75 : 1, opacity: focus && !hot ? 0.15 : 1 },\n }\n })\n return { nodes, edges }\n }, [graph, entries, board, selectedId])\n\n if (!graph) return <p className=\"text-sm text-muted\">Loading graph…</p>\n if (!graph.nodes.length) return <p className=\"rounded-xl border border-dashed border-border p-4 text-sm text-muted\">No entries to draw yet.</p>\n\n return (\n <div aria-label=\"Memory graph\" className=\"h-[70vh] min-h-[420px] overflow-hidden rounded-xl border border-border\">\n <ReactFlow<MemNode>\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n onNodeClick={(_, n) => open(n.data.node)}\n nodesConnectable={false}\n nodesDraggable={false}\n deleteKeyCode={null}\n colorMode={isDark ? \"dark\" : \"light\"}\n onlyRenderVisibleElements={nodes.length > VIRTUALIZE_OVER}\n fitView\n fitViewOptions={{ padding: 0.1, minZoom: FIT_MIN_ZOOM, maxZoom: 1 }}\n minZoom={0.1}\n style={FLOW_STYLE}\n >\n <Background variant={BackgroundVariant.Dots} gap={20} size={1} />\n <Controls showInteractive={false} />\n </ReactFlow>\n </div>\n )\n}\n","\"use client\"\n\nimport { useState, type RefObject } from \"react\"\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"@/components/ui/dialog\"\nimport { Input } from \"@/components/ui/input\"\nimport { Button } from \"@/components/ui/button\"\nimport { ENTRY_TYPES, type Entry, type EntryType } from \"@/lib/entries\"\nimport { cn } from \"@/lib/utils\"\n\nexport type MergeInput = { keepId: string; dropIds: string[]; type: EntryType; summary: string; body: string }\n\n/** The kept entry's fields; the body is the kept body plus the others' bodies under `---`. */\nfunction draftFor(keep: Entry, group: Entry[]) {\n const body = [keep, ...group.filter((e) => e.id !== keep.id)].map((e) => e.body.trim()).filter(Boolean).join(\"\\n\\n---\\n\\n\")\n return { type: keep.type, summary: keep.summary, body }\n}\n\n/** Approve a suggested duplicate merge (R051). Nothing is merged until Approve. Mount with a key per group. */\nexport function MergeDialog({ group, onClose, onApprove, returnFocus }: {\n /** the suggested entries, at least two */\n group: Entry[]\n onClose: () => void\n /** Returns an error message to show, or null on success. */\n onApprove: (input: MergeInput) => Promise<string | null>\n /** focused again on close (Esc / Cancel), when it is still on the page */\n returnFocus?: RefObject<HTMLElement | null>\n}) {\n const sorted = [...group].sort((a, b) => a.id.localeCompare(b.id, \"en\", { numeric: true }))\n const [keepId, setKeepId] = useState(sorted[0].id)\n const [draft, setDraft] = useState(() => draftFor(sorted[0], sorted))\n const [error, setError] = useState<string | null>(null)\n const [busy, setBusy] = useState(false)\n\n const pick = (id: string) => {\n setKeepId(id)\n setDraft(draftFor(sorted.find((e) => e.id === id) ?? sorted[0], sorted))\n }\n\n async function approve() {\n if (busy || !draft.summary.trim()) return\n setBusy(true)\n const err = await onApprove({ keepId, dropIds: sorted.filter((e) => e.id !== keepId).map((e) => e.id), ...draft })\n setBusy(false)\n if (err) setError(err)\n else onClose()\n }\n\n return (\n <Dialog open onOpenChange={(v) => { if (!v) onClose() }}>\n <DialogContent\n onCloseAutoFocus={(e) => {\n const el = returnFocus?.current\n if (el?.isConnected) { e.preventDefault(); el.focus() }\n }}\n className=\"max-h-[90vh] max-w-3xl overflow-y-auto border-border bg-surface text-txt shadow-xl shadow-black/20\">\n <DialogTitle className=\"text-sm font-semibold text-txt\">Merge entries</DialogTitle>\n <DialogDescription className=\"text-xs text-muted\">\n Pick the entry to keep and edit the merged text. The others are deleted; mentions of them point to the kept id.\n </DialogDescription>\n <form\n onSubmit={(e) => { e.preventDefault(); void approve() }}\n onKeyDown={(e) => { if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) { e.preventDefault(); void approve() } }}\n className=\"flex min-w-0 flex-col gap-3\"\n >\n <fieldset className=\"grid min-w-0 gap-2 sm:grid-cols-2\">\n <legend className=\"sr-only\">Entry to keep</legend>\n {sorted.map((e) => (\n <label\n key={e.id}\n className={cn(\n \"flex min-w-0 cursor-pointer flex-col gap-1.5 rounded-lg border bg-bg p-3 transition-colors duration-(--duration-fast)\",\n e.id === keepId ? \"border-accent\" : \"border-border hover:border-border2\",\n )}\n >\n <span className=\"flex items-center gap-2 text-xs\">\n <input\n type=\"radio\"\n name=\"keep\"\n value={e.id}\n checked={e.id === keepId}\n onChange={() => pick(e.id)}\n className=\"size-3.5 accent-accent focus-visible:outline-2 focus-visible:outline-accent\"\n />\n <span className=\"font-mono text-[11px] text-muted\">{e.id}</span>\n <span className=\"font-mono text-[10px] text-muted\">{e.type}</span>\n <span className=\"ml-auto text-muted\">{e.id === keepId ? \"Keep\" : \"Delete\"}</span>\n </span>\n <span className=\"text-[13px] font-medium text-txt\">{e.summary}</span>\n {e.body && <span className=\"line-clamp-6 whitespace-pre-wrap font-mono text-[11px] text-muted\">{e.body}</span>}\n </label>\n ))}\n </fieldset>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Type\n <select\n value={draft.type}\n onChange={(e) => setDraft({ ...draft, type: e.target.value as EntryType })}\n className=\"h-8 rounded-md border border-border bg-bg px-2 text-sm text-txt focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent\"\n >\n {ENTRY_TYPES.map((t) => <option key={t} value={t}>{t}</option>)}\n </select>\n </label>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Merged summary (one line)\n <Input value={draft.summary} onChange={(e) => setDraft({ ...draft, summary: e.target.value })} maxLength={200} className=\"h-8 text-txt\" />\n </label>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Merged details (markdown)\n <textarea\n value={draft.body}\n onChange={(e) => setDraft({ ...draft, body: e.target.value })}\n rows={8}\n className=\"w-full resize-y rounded-md border border-border bg-bg px-3 py-2 font-mono text-xs text-txt focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent\"\n />\n </label>\n {error && <p role=\"alert\" className=\"text-xs text-danger\">{error}</p>}\n <div className=\"flex items-center justify-end gap-2\">\n <span className=\"mr-auto font-mono text-[11px] text-muted\">⌘↵ approve · Esc cancel</span>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={onClose}>Cancel</Button>\n <Button type=\"submit\" size=\"sm\" disabled={busy || !draft.summary.trim()}>\n {busy ? \"Merging…\" : `Merge into ${keepId}`}\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n )\n}\n","\"use client\"\n\nimport { useEffect, useMemo, useRef, useState } from \"react\"\nimport { useRouter } from \"next/navigation\"\nimport { AlertTriangle, Info, Trash2 } from \"lucide-react\"\nimport { useApp } from \"@/context/AppContext\"\nimport { StatusIcon } from \"@/components/shared/StatusIcon\"\nimport { displayStatus } from \"@/lib/statuses\"\nimport { cn } from \"@/lib/utils\"\nimport type { CleanupFlag } from \"@/lib/core\"\nimport type { HealthKind } from \"@/lib/memory-health\"\nimport type { Entry } from \"@/lib/entries\"\nimport { MergeDialog, type MergeInput } from \"./MergeDialog\"\n\nconst GROUPS: { kind: HealthKind; label: string }[] = [\n { kind: \"contradiction\", label: \"Contradicts the board\" },\n { kind: \"dangling-ref\", label: \"Missing items\" },\n { kind: \"duplicate\", label: \"Possible duplicates\" },\n { kind: \"stale\", label: \"Not recalled lately\" },\n]\n\n/** Memory health flags (R051), grouped by kind. Dismiss hides a flag until its id changes (memory/.cleanup.json). */\nexport function CleanupPanel({ flags, entries, onDismiss, onMerge, onDelete, onOpenEntry, onClose }: {\n /** null while loading; includes dismissed flags (marked `dismissed`) */\n flags: CleanupFlag[] | null\n /** for entry summaries next to their ids */\n entries: Entry[] | null\n onDismiss: (flag: CleanupFlag) => void\n /** Approve a suggested merge; returns an error message, or null on success */\n onMerge: (input: MergeInput) => Promise<string | null>\n /** Delete a stale entry now (Undo toast, no confirm) */\n onDelete: (id: string) => void\n onOpenEntry: (id: string) => void\n onClose: () => void\n}) {\n const router = useRouter()\n const { board } = useApp()\n const [showDismissed, setShowDismissed] = useState(false)\n const [merging, setMerging] = useState<string[] | null>(null)\n // the Merge… button that opened the dialog: the dialog has no DialogTrigger, so focus goes back here by hand\n const mergeTrigger = useRef<HTMLButtonElement | null>(null)\n // a row action that removes its row (Delete, Dismiss with dismissed hidden): once it's gone, focus the row now at its index\n const refocus = useRef<{ id: string; index: number } | null>(null)\n const sectionRef = useRef<HTMLElement | null>(null)\n const tasks = useMemo(() => new Map(Object.values(board ?? {}).flat().map((t) => [t.id, t])), [board])\n const summaries = useMemo(() => new Map((entries ?? []).map((e) => [e.id, e.summary])), [entries])\n const shown = (flags ?? []).filter((f) => showDismissed || !f.dismissed)\n const mergeGroup = merging && (entries ?? []).filter((e) => merging.includes(e.id))\n const dismissedCount = (flags ?? []).filter((f) => f.dismissed).length\n const shownIds = shown.map((f) => f.id).join(\" \")\n\n useEffect(() => {\n const pending = refocus.current\n if (!pending || shownIds.split(\" \").includes(pending.id)) return\n refocus.current = null\n const rows = sectionRef.current?.querySelectorAll<HTMLElement>(\"li[data-flag]\") ?? []\n const next = rows[Math.min(pending.index, rows.length - 1)]\n const target = next?.querySelector<HTMLElement>(\"button[data-action]\") ?? sectionRef.current?.querySelector<HTMLElement>(\"h2\")\n target?.focus()\n }, [shownIds])\n\n const willRemove = (f: CleanupFlag) => { refocus.current = { id: f.id, index: shown.indexOf(f) } }\n\n // open a referenced item where it lives, like the Related panel\n const open = (id: string) => {\n if (id.startsWith(\"T\")) router.push(`/board?task=${id}`)\n else if (id.startsWith(\"R\")) router.push(`/roadmap?item=${id}`)\n else if (id.startsWith(\"E\")) onOpenEntry(id)\n }\n\n const ref = (id: string) => {\n const task = tasks.get(id)\n const title = task?.title ?? summaries.get(id)\n return (\n <button\n key={id}\n type=\"button\"\n onClick={() => open(id)}\n className=\"inline-flex max-w-full items-center gap-1.5 rounded-sm px-1.5 py-0.5 text-left text-xs outline-none transition-colors duration-(--duration-fast) hover:bg-surface2 focus-visible:ring-2 focus-visible:ring-accent\"\n >\n {task && <StatusIcon status={displayStatus(task)} className=\"size-3.5 shrink-0\" />}\n <span className=\"shrink-0 font-mono text-[11px] text-muted\">{id}</span>\n {title && <span className=\"min-w-0 truncate text-txt\">{title}</span>}\n </button>\n )\n }\n\n const row = (f: CleanupFlag) => {\n const Icon = f.severity === \"warn\" ? AlertTriangle : Info\n return (\n <li key={f.id} data-flag={f.id} className={cn(\"flex items-start gap-2 rounded-lg border border-border bg-surface px-3 py-2.5\", f.dismissed && \"opacity-60\")}>\n <Icon className={cn(\"mt-0.5 size-3.5 shrink-0\", f.severity === \"warn\" && !f.dismissed ? \"text-amber\" : \"text-muted\")} aria-label={f.severity === \"warn\" ? \"Warning\" : \"Note\"} />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <p className={cn(\"text-[13px]\", f.dismissed ? \"text-muted\" : \"text-txt\")}>\n {f.message.split(/\\b([TRE]\\d+)\\b/).map((part, i) => (i % 2 ? <span key={i} className=\"font-mono text-[12px]\">{part}</span> : part))}\n </p>\n {f.refs.length > 0 && (\n <div className={cn(\"-ml-1.5 flex gap-1\", f.kind === \"duplicate\" ? \"flex-col items-start\" : \"flex-wrap\")}>{f.refs.map(ref)}</div>\n )}\n </div>\n {f.suggestion?.action === \"merge\" && !f.dismissed && (\n <button\n type=\"button\"\n data-action\n onClick={(e) => { mergeTrigger.current = e.currentTarget; setMerging(f.suggestion?.ids ?? null) }}\n className=\"h-6 shrink-0 rounded-md border border-border px-2 text-xs text-txt outline-none transition-colors duration-(--duration-fast) hover:border-border2 hover:bg-surface2 focus-visible:ring-2 focus-visible:ring-accent\"\n >\n Merge…\n </button>\n )}\n {f.suggestion?.action === \"delete\" && !f.dismissed && (\n <button\n type=\"button\"\n data-action\n onClick={() => { willRemove(f); f.suggestion?.ids.forEach(onDelete) }}\n aria-label={`Delete ${f.suggestion.ids.join(\", \")}`}\n className=\"inline-flex h-6 shrink-0 items-center gap-1 rounded-md border border-border px-2 text-xs text-txt outline-none transition-colors duration-(--duration-fast) hover:border-border2 hover:bg-surface2 hover:text-danger focus-visible:ring-2 focus-visible:ring-accent\"\n >\n <Trash2 className=\"size-3\" aria-hidden /> Delete\n </button>\n )}\n {f.dismissed ? (\n <span className=\"shrink-0 font-mono text-[10px] text-muted\" title=\"Dismissed on\">dismissed {f.dismissed}</span>\n ) : (\n <button\n type=\"button\"\n data-action\n onClick={() => { if (!showDismissed) willRemove(f); onDismiss(f) }}\n className=\"h-6 shrink-0 rounded-md px-2 text-xs text-muted outline-none transition-colors duration-(--duration-fast) hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\"\n >\n Dismiss\n </button>\n )}\n </li>\n )\n }\n\n return (\n <section ref={sectionRef} aria-label=\"Cleanup\" className=\"min-w-0\">\n <div className=\"mb-3 flex items-baseline justify-between gap-3\">\n <h2 tabIndex={-1} className=\"outline-none font-display text-base font-semibold tracking-tight\">Cleanup</h2>\n <div className=\"flex items-center gap-3\">\n {dismissedCount > 0 && (\n <label className=\"flex cursor-pointer items-center gap-1.5 text-xs text-muted\">\n <input\n type=\"checkbox\"\n checked={showDismissed}\n onChange={(e) => setShowDismissed(e.target.checked)}\n className=\"size-3.5 accent-accent focus-visible:outline-2 focus-visible:outline-accent\"\n />\n Show dismissed <span className=\"font-mono text-[10px]\">{dismissedCount}</span>\n </label>\n )}\n <button type=\"button\" onClick={onClose} className=\"text-xs text-muted underline-offset-2 outline-none hover:text-txt hover:underline focus-visible:ring-2 focus-visible:ring-accent\">\n Show the handoff\n </button>\n </div>\n </div>\n {flags === null ? (\n <p className=\"text-sm text-muted\">Checking memory…</p>\n ) : !shown.length ? (\n <p className=\"rounded-xl border border-dashed border-border p-5 text-sm text-muted\">Memory looks clean</p>\n ) : (\n <div className=\"flex flex-col gap-4\">\n {GROUPS.map(({ kind, label }) => {\n const group = shown.filter((f) => f.kind === kind)\n if (!group.length) return null\n return (\n <div key={kind} className=\"flex flex-col gap-1.5\">\n <h3 className=\"font-mono text-[10px] font-medium uppercase tracking-[0.06em] text-muted\">\n {label} <span>{group.filter((f) => !f.dismissed).length}</span>\n </h3>\n <ul className=\"flex flex-col gap-1.5\">{group.map(row)}</ul>\n </div>\n )\n })}\n </div>\n )}\n {mergeGroup && mergeGroup.length > 1 && (\n <MergeDialog key={mergeGroup.map((e) => e.id).join(\"+\")} group={mergeGroup} onClose={() => setMerging(null)} onApprove={onMerge} returnFocus={mergeTrigger} />\n )}\n </section>\n )\n}\n","\"use client\"\n\nimport { Suspense, useCallback, useEffect, useState } from \"react\"\nimport { useRouter, useSearchParams } from \"next/navigation\"\nimport { useApp } from \"@/context/AppContext\"\nimport { MemoryTab } from \"@/components/memory/MemoryTab\"\nimport { toast, undoToast } from \"@/components/ui/toast\"\nimport type { Entry } from \"@/lib/entries\"\nimport type { CleanupFlag } from \"@/lib/core\"\nimport type { MergeInput } from \"@/components/memory/MergeDialog\"\n\nexport default function MemoryPage() {\n return (\n <Suspense>\n <MemoryPageInner />\n </Suspense>\n )\n}\n\nfunction MemoryPageInner() {\n const { summary, rootParam } = useApp()\n const router = useRouter()\n // ?entry=E012 is the open entry and ?view=graph the Graph view, so a link or a reload keeps both\n const params = useSearchParams()\n const selectedId = params.get(\"entry\")\n const view = params.get(\"view\") === \"graph\" ? \"graph\" : \"list\"\n const cleanup = params.get(\"cleanup\") === \"1\"\n const [entries, setEntries] = useState<Entry[] | null>(null)\n const [creating, setCreating] = useState(false)\n const [flags, setFlags] = useState<CleanupFlag[] | null>(null)\n\n const load = useCallback(() => {\n let live = true\n fetch(`/api/memory/entries${rootParam}`)\n .then((r) => r.json())\n .then((d: { entries?: Entry[] }) => { if (live) setEntries(d.entries ?? []) })\n .catch((e) => {\n console.warn(\"Loading memory entries failed\", e)\n if (live) setEntries([])\n })\n return () => { live = false }\n }, [rootParam])\n\n // AppContext replaces `summary` on every memory_updated SSE event, so refetch the entries with it\n useEffect(() => load(), [load, summary])\n\n // Health flags (incl. dismissed) for the Cleanup count + panel; they depend on the board and roadmap too\n const loadFlags = useCallback(() => {\n fetch(`/api/memory/health${rootParam}&dismissed=1`)\n .then((r) => r.json())\n .then((d: { flags?: CleanupFlag[] }) => setFlags(d.flags ?? []))\n .catch((e) => {\n console.warn(\"Loading memory health failed\", e)\n setFlags([])\n })\n }, [rootParam])\n useEffect(() => {\n loadFlags()\n const onSse = (e: Event) => {\n const type = (e as CustomEvent<{ type?: string }>).detail?.type ?? \"\"\n if (type === \"memory_updated\" || type === \"roadmap_updated\" || type.startsWith(\"task_\")) loadFlags()\n }\n window.addEventListener(\"vibedoc:sse\", onSse)\n return () => window.removeEventListener(\"vibedoc:sse\", onSse)\n }, [loadFlags])\n\n const dismiss = useCallback(async (flag: CleanupFlag) => {\n const today = new Date().toLocaleDateString(\"en-CA\")\n setFlags((list) => (list ?? []).map((f) => (f.id === flag.id ? { ...f, dismissed: today } : f)))\n try {\n const res = await fetch(`/api/memory/health/dismiss${rootParam}`, { method: \"POST\", headers: { \"content-type\": \"application/json\" }, body: JSON.stringify({ id: flag.id }) })\n const data = await res.json().catch(() => ({}))\n if (!res.ok) throw new Error(data.error ?? `Request failed (${res.status})`)\n } catch (e) {\n toast(`Dismiss failed: ${e instanceof Error ? e.message : String(e)}`)\n loadFlags()\n }\n }, [rootParam, loadFlags])\n\n const go = useCallback((entry: string | null, v: \"list\" | \"graph\", withCleanup = false) => {\n const q = new URLSearchParams()\n if (v === \"graph\") q.set(\"view\", \"graph\")\n if (entry) q.set(\"entry\", entry)\n if (withCleanup) q.set(\"cleanup\", \"1\")\n router.replace(q.size ? `/memory?${q}` : \"/memory\", { scroll: false })\n }, [router])\n const select = useCallback((id: string | null) => {\n setCreating(false)\n go(id, view)\n }, [go, view])\n\n const post = useCallback(async (url: string, body: object) => {\n const res = await fetch(`${url}${rootParam}`, { method: \"POST\", headers: { \"content-type\": \"application/json\" }, body: JSON.stringify(body) })\n const data = await res.json().catch(() => ({}))\n if (!res.ok) throw new Error(data.error ?? `Request failed (${res.status})`)\n return data\n }, [rootParam])\n\n // No confirm: delete now, offer Undo (restores the same file), like tasks and docs\n const remove = useCallback(async (entry: Entry) => {\n try {\n const { file, raw } = await post(\"/api/memory/entries/delete\", { id: entry.id })\n setEntries((list) => (list ?? []).filter((e) => e.id !== entry.id))\n select(null)\n undoToast(`Deleted ${entry.id}`, async () => {\n await post(\"/api/memory/entries/restore\", { file, raw })\n load()\n select(entry.id)\n })\n } catch (e) {\n toast(`Delete failed: ${e instanceof Error ? e.message : String(e)}`)\n }\n }, [post, select, load])\n\n // From the Cleanup panel: same delete + Undo, but the panel stays open\n const removeStale = useCallback(async (id: string) => {\n try {\n const { file, raw } = await post(\"/api/memory/entries/delete\", { id })\n setEntries((list) => (list ?? []).filter((e) => e.id !== id))\n setFlags((list) => (list ?? []).filter((f) => !(f.kind === \"stale\" && f.refs.includes(id))))\n undoToast(`Deleted ${id}`, async () => {\n await post(\"/api/memory/entries/restore\", { file, raw })\n load()\n })\n } catch (e) {\n toast(`Delete failed: ${e instanceof Error ? e.message : String(e)}`)\n }\n }, [post, load])\n\n // The dialog is the approval; Undo writes every touched file back\n const merge = useCallback(async (input: MergeInput): Promise<string | null> => {\n try {\n const { entry, before } = await post(\"/api/memory/entries/merge\", input)\n setEntries((list) => [...(list ?? []).filter((e) => e.id !== entry.id && !input.dropIds.includes(e.id)), entry])\n select(entry.id)\n undoToast(`Merged into ${entry.id}`, async () => {\n await post(\"/api/memory/entries/merge/undo\", { before })\n load()\n select(entry.id)\n })\n return null\n } catch (e) {\n return e instanceof Error ? e.message : String(e)\n }\n }, [post, select, load])\n\n return (\n <MemoryTab\n memory={summary?.memory ?? null}\n entries={entries}\n rootParam={rootParam}\n selectedId={creating ? null : selectedId}\n creating={creating}\n onOpen={select}\n onNew={() => setCreating(true)}\n onClose={() => select(null)}\n onDelete={remove}\n view={view}\n onView={(v) => go(selectedId, v, cleanup)}\n flags={flags}\n cleanup={cleanup && !creating && !selectedId}\n onCleanup={(open) => { setCreating(false); go(open ? null : selectedId, view, open) }}\n onDismiss={dismiss}\n onMerge={merge}\n onDeleteStale={removeStale}\n onSaved={(entry) => {\n // show the saved text now; the SSE refetch confirms it\n setEntries((list) => [...(list ?? []).filter((e) => e.id !== entry.id), entry])\n select(entry.id)\n }}\n />\n )\n}\n","// Pure knowledge-entry parsing and formatting (R046, no fs). Self-check: node src/lib/entries.check.mts\n// One long-lived fact per file: memory/entries/E001-<slug>.md\n\nexport const ENTRY_TYPES = ['convention', 'gotcha', 'decision', 'preference'] as const\nexport type EntryType = typeof ENTRY_TYPES[number]\n\n/**\n * updatedAt = the `**Updated:**` date (YYYY-MM-DD); by = `**By:**` who saved it last (\"human\" | \"ai:<agent>\",\n * null in files from before R047); file = path relative to root.\n */\nexport type Entry = { id: string; type: EntryType; summary: string; body: string; updatedAt: string; by: string | null; file: string }\nexport type EntryInput = { id?: string; type: string; summary: string; body?: string }\n\nexport const SUMMARY_MAX = 120\n\nconst isEntryType = (s: string): s is EntryType => (ENTRY_TYPES as readonly string[]).includes(s)\n\n/** \"e1\" / \"E01\" / \"E001\" → \"E001\"; anything else → null. */\nexport function normalizeEntryId(s: string): string | null {\n const m = /^e(\\d+)$/i.exec(s.trim())\n if (!m) return null\n const n = Number(m[1])\n return n > 0 ? `E${String(n).padStart(3, '0')}` : null\n}\n\n/** One past the highest id: [] → \"E001\"; [\"E001\",\"E007\"] → \"E008\". */\nexport function nextEntryId(ids: string[]): string {\n const max = Math.max(0, ...ids.map(id => Number(normalizeEntryId(id)?.slice(1) ?? 0)))\n return `E${String(max + 1).padStart(3, '0')}`\n}\n\nexport function entrySlug(summary: string): string {\n return summary.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 40).replace(/-$/, '')\n}\n\n/** null when the `# E001: summary` H1 or a known `**Type:**` is missing. */\nexport function parseEntry(raw: string, file: string): Entry | null {\n const lines = raw.replace(/\\r\\n/g, '\\n').split('\\n')\n const h1 = /^#\\s+(E\\d+):\\s*(.+?)\\s*$/i.exec(lines[0] ?? '')\n const id = h1 && normalizeEntryId(h1[1])\n if (!h1 || !id) return null\n // Contiguous **Key:** Value block under the H1, like task files\n const meta: Record<string, string> = {}\n let i = 1\n for (; i < lines.length; i++) {\n const m = /^\\*\\*(\\w+):\\*\\*\\s*(.*)$/.exec(lines[i])\n if (!m) break\n meta[m[1].toLowerCase()] = m[2].trim()\n }\n const type = meta.type ?? ''\n if (!isEntryType(type)) return null\n return { id, type, summary: h1[2], body: lines.slice(i).join('\\n').trim(), updatedAt: meta.updated ?? '', by: meta.by || null, file }\n}\n\nexport function formatEntry(e: Omit<Entry, 'file'>): string {\n const head = `# ${e.id}: ${e.summary}\\n**Type:** ${e.type}\\n**Updated:** ${e.updatedAt}\\n${e.by ? `**By:** ${e.by}\\n` : ''}`\n return e.body.trim() ? `${head}\\n${e.body.trim()}\\n` : head\n}\n\n/** Error message, or null when valid. Does not check whether an id exists. */\nexport function validateEntryInput(i: EntryInput): string | null {\n if (i.id !== undefined && !normalizeEntryId(String(i.id))) return `Invalid id \"${i.id}\": expected E followed by a number, e.g. E001`\n if (!isEntryType(String(i.type ?? ''))) return `Invalid type \"${i.type ?? ''}\": use one of ${ENTRY_TYPES.join(', ')}`\n const summary = String(i.summary ?? '').trim()\n if (!summary) return 'summary is required'\n if (/\\n/.test(summary)) return 'summary must be one line'\n if (summary.length > SUMMARY_MAX) return `summary is ${summary.length} characters; keep it to ${SUMMARY_MAX}`\n if (i.body !== undefined && typeof i.body !== 'string') return 'body must be a string'\n return null\n}\n\n/**\n * Replace whole-token mentions of `fromIds` (any padding: E11, E011) with `toId`, for a merge (R051).\n * Same token boundaries as the memory graph's ID_RE, so \"XE011\" and \"E011a\" stay.\n */\nexport function replaceEntryRefs(text: string, fromIds: string[], toId: string): string {\n const from = new Set(fromIds.map(id => normalizeEntryId(id)))\n return text.replace(/(?<![A-Za-z0-9_-])E\\d+(?![A-Za-z0-9_])/g, m => (from.has(normalizeEntryId(m)) ? toId : m))\n}\n","// Pure keyword recall over knowledge entries (R048, no fs). Self-check: node src/lib/recall.check.mts\n// Index first, bodies on request: agents get compact lines here and fetch bodies with vibedoc_get_entries.\n\nexport type RecallEntry = { id: string; type: string; summary: string; body: string; updatedAt: string }\nexport type RecallHit = { id: string; type: string; summary: string; tokens: number; score: number }\n\nconst STOPWORDS = new Set(('a an and are as at be but by can do does for from how i if in into is it its of on or ' +\n 'our so that the their then there these this to use used using was we what when where which who why will with you your').split(' '))\n\n/** Lowercase, split on non-alphanumerics, drop stopwords and 1-char tokens, naive plural strip (\"events\" → \"event\"). */\nexport function tokenize(s: string): string[] {\n return s.toLowerCase().split(/[^a-z0-9]+/)\n .filter(t => t.length > 1 && !STOPWORDS.has(t))\n // ponytail: plural strip only, no real stemmer; add one if recall misses obvious matches\n .map(t => (t.length > 3 && t.endsWith('s') && !t.endsWith('ss') ? t.slice(0, -1) : t))\n}\n\nexport function estimateTokens(s: string): number {\n return Math.ceil(s.length / 4)\n}\n\n/** Per query token: +3 in summary, +2 matches id or type, +1 in body. Score 0 dropped; ties → newest first. */\nexport function rankEntries(entries: RecallEntry[], query: string, opts: { type?: string; limit?: number } = {}): RecallHit[] {\n const q = [...new Set(tokenize(query))]\n if (!q.length) return []\n const hits: (RecallHit & { updatedAt: string })[] = []\n for (const e of entries) {\n if (opts.type && e.type !== opts.type) continue\n const summary = new Set(tokenize(e.summary))\n const body = new Set(tokenize(e.body))\n const idType = new Set([e.id.toLowerCase(), ...tokenize(e.type)])\n let score = 0\n for (const t of q) {\n if (summary.has(t)) score += 3\n if (idType.has(t)) score += 2\n if (body.has(t)) score += 1\n }\n if (score > 0) {\n hits.push({ id: e.id, type: e.type, summary: e.summary, tokens: estimateTokens(`${e.summary}\\n${e.body}`), score, updatedAt: e.updatedAt })\n }\n }\n hits.sort((a, b) => b.score - a.score || b.updatedAt.localeCompare(a.updatedAt))\n return hits.slice(0, opts.limit ?? 10).map(({ updatedAt: _, ...h }) => h)\n}\n\n/** \"E012 · convention · Only core.ts touches fs (~120 tok)\" */\nexport function formatCompactLine(h: RecallHit): string {\n return `${h.id} · ${h.type} · ${h.summary} (~${h.tokens} tok)`\n}\n\n/** Every entry as a compact hit, newest first: the session-start index order. */\nexport function indexHits(entries: RecallEntry[]): RecallHit[] {\n return [...entries].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt) || a.id.localeCompare(b.id, 'en', { numeric: true }))\n .map(e => ({ id: e.id, type: e.type, summary: e.summary, tokens: estimateTokens(`${e.summary}\\n${e.body}`), score: 0 }))\n}\n\nexport const DEFAULT_SESSION_BUDGET = 2000\nconst INDEX_HINT = 'Save new facts with vibedoc_save_entry; fetch bodies with vibedoc_get_entries.'\n\n/** \"## Since the last handoff (auto, 2026-10-03)\" + the newest episode body, plus \"+N older\" when more are newer than MEMORY.md (R050). */\nexport function formatEpisodeSection(ep: { end: string; body: string }, older = 0): string {\n return [\n `## Since the last handoff (auto, ${ep.end.slice(0, 10)})`,\n ep.body.trim().replace(/^## /gm, '### '), // nest the episode's own sections under this one\n ...(older > 0 ? ['', `+${older} older episode${older === 1 ? '' : 's'} in .vibedoc/episodes/`] : []),\n ].join('\\n')\n}\n\n/**\n * Session start = the whole handoff + the episode section (if any) + as many index lines (in the order given) as fit\n * `budget` tokens, then \"+N more\" when some were left out. Header, footer and hint count toward the budget.\n * The handoff and the episode are never cut.\n */\nexport function fitToBudget(handoff: string, index: RecallHit[], budget: number, episode = ''):\n { text: string; shown: number; omitted: number; tokens: number } {\n const render = (n: number, warning?: string) => [\n handoff.trimEnd(), '',\n ...(episode ? [episode.trimEnd(), ''] : []),\n ...(warning ? [warning] : []),\n `## Knowledge entries (${index.length})`,\n ...index.slice(0, n).map(formatCompactLine),\n ...(n < index.length ? [`+${index.length - n} more entries — use vibedoc_recall { query }`] : []),\n INDEX_HINT,\n ].join('\\n')\n const fits = (n: number) => estimateTokens(render(n)) <= budget\n let text: string\n let shown = 0\n if (!fits(0)) {\n const what = episode ? `The handoff and the latest episode are ~${estimateTokens(`${handoff}\\n${episode}`)} tokens` : `The handoff alone is ~${estimateTokens(handoff)} tokens`\n text = render(0, `⚠️ ${what}, over the ${budget}-token session budget: trim memory/MEMORY.md.`)\n } else {\n // ponytail: re-renders per line (O(n²) chars); fine for hundreds of entries\n while (shown < index.length && fits(shown + 1)) shown++\n text = render(shown)\n }\n return { text, shown, omitted: index.length - shown, tokens: estimateTokens(text) }\n}\n\nexport const RELATED_MIN_SCORE = 3\nconst GOAL_CHARS = 500\n\n/** Recall query for a task: its title, the first 500 chars of its Goal, and the Phase epic title (id dropped). */\nexport function taskQuery(task: { title: string; phase?: string; raw?: string }): string {\n const goal = /^## Goal[ \\t]*\\n([\\s\\S]*?)(?=^## |(?![\\s\\S]))/m.exec(task.raw ?? '')?.[1].trim() ?? ''\n const epic = (task.phase ?? '').replace(/^R\\d+\\s*[—–-]\\s*/, '')\n return [task.title, goal.slice(0, GOAL_CHARS), epic].filter(Boolean).join(' ')\n}\n\n/** Only strong matches (at least one summary hit) → \"## Related memory\" block; '' when none qualify. */\nexport function formatRelated(hits: RecallHit[], limit = 3): string {\n const strong = hits.filter(h => h.score >= RELATED_MIN_SCORE).slice(0, limit)\n if (!strong.length) return ''\n return `## Related memory\\n${strong.map(formatCompactLine).join('\\n')}\\nFetch with vibedoc_get_entries`\n}\n\n/**\n * The Memory tab list (R047). No searchable words → the entries of `type`, newest first (session-start order).\n * Otherwise ranked like vibedoc_recall, so the UI and agents agree on the first hit. Returns the full entries.\n */\nexport function filterEntries<T extends RecallEntry>(entries: T[], opts: { query?: string; type?: string | null }): T[] {\n const pool = opts.type ? entries.filter(e => e.type === opts.type) : entries\n const byId = new Map(pool.map(e => [e.id, e]))\n const query = opts.query ?? ''\n const hits = tokenize(query).length ? rankEntries(pool, query, { limit: pool.length }) : indexHits(pool)\n return hits.map(h => byId.get(h.id)).filter((e): e is T => !!e)\n}\n","import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'git-commit-horizontal',\n size: 24,\n node: [\n ['circle', { cx: '12', cy: '12', r: '3', key: '1v7zrd' }],\n ['line', { x1: '3', x2: '9', y1: '12', y2: '12', key: '1dyftd' }],\n ['line', { x1: '15', x2: '21', y1: '12', y2: '12', key: 'oup4p8' }],\n ],\n aliases: ['git-commit'],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name GitCommitHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIzIiAvPgogIDxsaW5lIHgxPSIzIiB4Mj0iOSIgeTE9IjEyIiB5Mj0iMTIiIC8+CiAgPGxpbmUgeDE9IjE1IiB4Mj0iMjEiIHkxPSIxMiIgeTI9IjEyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/git-commit-horizontal\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst GitCommitHorizontal = createLucideIcon(__iconData);\n\nexport default GitCommitHorizontal;\n","// Pure memory link graph (R053, no fs): links are inferred from text, never stored. Self-check: node src/lib/memory-graph.check.mts\n// Outgoing edges come from entry text; incoming edges from task, roadmap and doc files that mention an entry id.\n\nexport type NodeKind = 'entry' | 'task' | 'epic' | 'adr' | 'doc'\nexport type GraphNode = { id: string; kind: NodeKind; label: string; path: string }\nexport type GraphEdge = { from: string; to: string } // from mentions to\nexport type MemoryGraph = { nodes: GraphNode[]; edges: GraphEdge[] }\n/** A node plus the text scanned for its refs. */\nexport type GraphItem = GraphNode & { text: string }\n\n// Upper case only, whole tokens: \"XT0651\", \"e2e\" and \"T0651a\" don't match\nconst ID_RE = /(?<![A-Za-z0-9_-])(E\\d+|T\\d{3,}|R\\d{3,}|ADR-\\d+)(?![A-Za-z0-9_])/g\nconst BACKTICK_MD_RE = /`([^`\\s]+\\.md)`/g\nconst LINK_MD_RE = /\\]\\(\\s*<?([^)\\s>#]+\\.md)(?:#[^)\\s]*)?>?\\s*\\)/g\n\nconst pad3 = (n: string) => String(Number(n)).padStart(3, '0')\n\n/** \"E1\" → \"E001\", \"ADR-4\" → \"ADR-004\"; task and roadmap ids are already padded. */\nfunction normalizeId(id: string): string {\n if (id.startsWith('ADR-')) return `ADR-${pad3(id.slice(4))}`\n if (id.startsWith('E')) return `E${pad3(id.slice(1))}`\n return id\n}\n\nconst normalizePath = (p: string) => p.replace(/\\\\/g, '/').replace(/^\\.?\\//, '')\n\n/** Item ids (E/T/R/ADR) and `*.md` paths (in backticks or as link targets) mentioned in `text`, deduplicated. */\nexport function extractRefs(text: string): { ids: string[]; paths: string[] } {\n const ids = new Set<string>()\n for (const m of text.matchAll(ID_RE)) {\n if (/^E0+$/.test(m[1])) continue // E0 is not an entry id\n ids.add(normalizeId(m[1]))\n }\n const paths = new Set<string>()\n for (const re of [BACKTICK_MD_RE, LINK_MD_RE]) {\n for (const m of text.matchAll(re)) {\n if (/^[a-z]+:\\/\\//i.test(m[1])) continue // external URL\n paths.add(normalizePath(m[1]))\n }\n }\n return { ids: [...ids], paths: [...paths] }\n}\n\n/** Classify a non-entry markdown file by path. Label = its H1 without the \"ID: \" prefix, else the file name. */\nexport function fileNode(relPath: string, raw: string): GraphNode {\n const p = normalizePath(relPath)\n const name = p.split('/').pop() ?? p\n const h1 = /^#\\s+(.+?)\\s*$/m.exec(raw)?.[1] ?? ''\n const label = (id: string) => h1.replace(new RegExp(`^${id}\\\\s*[:—–-]\\\\s*`), '') || name.replace(/\\.md$/, '')\n let m: RegExpExecArray | null\n if ((m = /^plans\\/tasks\\/(T\\d{3,})[^/]*\\.md$/.exec(p))) return { id: m[1], kind: 'task', label: label(m[1]), path: p }\n if ((m = /^plans\\/roadmap\\/(R\\d{3,})[^/]*\\.md$/.exec(p))) return { id: m[1], kind: 'epic', label: label(m[1]), path: p }\n if ((m = /(?:^|\\/)(ADR-\\d+)[^/]*\\.md$/.exec(p))) {\n const id = normalizeId(m[1])\n return { id, kind: 'adr', label: label(m[1]), path: p }\n }\n return { id: p, kind: 'doc', label: h1 || name.replace(/\\.md$/, ''), path: p }\n}\n\n/**\n * Resolve refs into a graph. Unresolved refs, self-links and duplicate edges are dropped.\n * Nodes = every entry + every other item that touches an entry.\n */\nexport function buildGraph(entries: GraphItem[], others: GraphItem[]): MemoryGraph {\n const all = [...entries, ...others]\n const byId = new Map(all.map(n => [n.id, n]))\n const byPath = new Map(all.map(n => [n.path, n]))\n const entryIds = new Set(entries.map(e => e.id))\n const edges = new Map<string, GraphEdge>()\n const add = (from: string, to: string) => { if (from !== to) edges.set(`${from}\\u0000${to}`, { from, to }) }\n\n for (const e of entries) {\n const { ids, paths } = extractRefs(e.text)\n for (const id of ids) if (byId.has(id)) add(e.id, id)\n for (const p of paths) { const n = byPath.get(p); if (n) add(e.id, n.id) }\n }\n // incoming: other files that mention an entry id (not the whole doc-to-doc graph)\n for (const o of others) {\n for (const id of extractRefs(o.text).ids) if (entryIds.has(id)) add(o.id, id)\n }\n\n const touched = new Set(entryIds)\n for (const e of edges.values()) { touched.add(e.from); touched.add(e.to) }\n const nodes = all.filter(n => touched.has(n.id)).map(({ text: _, ...n }) => n)\n return { nodes, edges: [...edges.values()] }\n}\n\n/** One entry, its direct neighbours and the edges between it and them. Unknown id → empty graph. */\nexport function neighbourhood(graph: MemoryGraph, id: string): MemoryGraph {\n if (!graph.nodes.some(n => n.id === id)) return { nodes: [], edges: [] }\n const edges = graph.edges.filter(e => e.from === id || e.to === id)\n const keep = new Set([id, ...edges.flatMap(e => [e.from, e.to])])\n return { nodes: graph.nodes.filter(n => keep.has(n.id)), edges }\n}\n\n/**\n * \"Links: …\" / \"Linked from: …\" lines for one entry (vibedoc_get_entries). A line with nothing is left out;\n * each is capped at `cap` items plus \"+N more\", so a hub entry stays short.\n */\nexport function formatEntryLinks(graph: MemoryGraph, id: string, cap = 10): string[] {\n const line = (label: string, ids: string[]) => {\n if (!ids.length) return []\n const more = ids.length > cap ? `, +${ids.length - cap} more` : ''\n return [`${label}: ${ids.slice(0, cap).join(', ')}${more}`]\n }\n return [\n ...line('Links', graph.edges.filter(e => e.from === id).map(e => e.to)),\n ...line('Linked from', graph.edges.filter(e => e.to === id).map(e => e.from)),\n ]\n}\n\nexport const GRAPH_COL_W = 240\nexport const GRAPH_ROW_H = 48\n/** Column per kind: epics and tasks left of the entries, ADRs and docs right of them. */\nconst GRAPH_COL: Record<NodeKind, number> = { epic: -2, task: -1, entry: 0, adr: 1, doc: 2 }\n\n/**\n * Deterministic positions for the graph view (no layout library, no saved positions): entries stacked in the\n * centre column (sorted by type, then id), every other node in its kind's column at the average y of the\n * entries it links with, pushed down to keep one row of space. Same graph → same positions on every load.\n */\nexport function graphLayout(graph: MemoryGraph, entryType: Record<string, string> = {}): Record<string, { x: number; y: number }> {\n const pos: Record<string, { x: number; y: number }> = {}\n const num = (id: string) => Number(id.replace(/\\D/g, '')) || 0\n const entries = graph.nodes.filter(n => n.kind === 'entry')\n .sort((a, b) => (entryType[a.id] ?? '').localeCompare(entryType[b.id] ?? '') || num(a.id) - num(b.id))\n entries.forEach((e, i) => { pos[e.id] = { x: 0, y: i * GRAPH_ROW_H } })\n\n const neighbourYs = new Map<string, number[]>()\n for (const { from, to } of graph.edges) {\n for (const [other, entry] of [[from, to], [to, from]]) {\n if (pos[entry] && !pos[other]) neighbourYs.set(other, [...(neighbourYs.get(other) ?? []), pos[entry].y])\n }\n }\n for (const kind of ['epic', 'task', 'adr', 'doc'] as const) {\n const col = graph.nodes.filter(n => n.kind === kind).map(n => {\n const ys = neighbourYs.get(n.id) ?? [0]\n return { id: n.id, want: ys.reduce((a, b) => a + b, 0) / ys.length }\n }).sort((a, b) => a.want - b.want || a.id.localeCompare(b.id, 'en', { numeric: true }))\n let next = -Infinity\n for (const { id, want } of col) {\n const y = Math.max(want, next)\n pos[id] = { x: GRAPH_COL[kind] * GRAPH_COL_W, y }\n next = y + GRAPH_ROW_H\n }\n }\n return pos\n}\n"],"names":["ENTRY_TYPES","s","SUMMARY_MAX","n","isEntryType","includes","normalizeEntryId","m","Number","exec","trim","nextEntryId","String","padStart","replace","id","ids","max","Math","map","slice","h1","entrySlug","summary","toLowerCase","file","meta","parseEntry","raw","lines","split","i","length","updatedAt","e","type","by","head","formatEntry","body","join","updated","undefined","validateEntryInput","test","fromIds","Set","replaceEntryRefs","text","toId","from","has"],"mappings":"0DOEA,EAAA,EAAA,CAA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AW,EACX,QAAS,EACT,cAAe,EACf,QAAS,AAAC,IAER,EAAW,AAAC,GAAS,IAAI,CAAC,GAAQ,EAAA,AAAE,EAAE,MAAM,CAAC,AAAC,GAAM,EAAE,EAAE,GAAK,EAAM,EAAE,EAAG,EAAM,EAC9E,EAAO,EAAM,EAAE,CACjB,GAGN,kBAjKe,SAAS,EACtB,MACE,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,QAAQ,CAAA,UACP,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAA,IAGP","ignoreList":[10]}
1
+ {"version":3,"sources":["../../../../src/components/memory/MemoryTab.tsx","../../../../src/components/memory/EntryList.tsx","../../../../src/components/memory/EntryDetail.tsx","../../../../src/components/memory/EntryHistory.tsx","../../../../src/components/memory/MemoryGraph.tsx","../../../../src/components/memory/MergeDialog.tsx","../../../../src/components/memory/CleanupPanel.tsx","../../../../src/components/memory/MemoryHistory.tsx","../../../../src/app/%28app%29/memory/page.tsx","../../../../src/lib/entries.ts","../../../../src/lib/recall.ts","../../../../node_modules/.pnpm/lucide-react%401.48.0_react%4019.3.0/node_modules/lucide-react/src/icons/rotate-ccw-clock.ts","../../../../node_modules/.pnpm/lucide-react%401.48.0_react%4019.3.0/node_modules/lucide-react/src/icons/git-commit-horizontal.ts","../../../../src/lib/memory-graph.ts"],"sourcesContent":["import { MarkdownRenderer } from \"@/components/docs/MarkdownRenderer\"\nimport { EmptyState } from \"@/components/shared/EmptyState\"\nimport type { Entry } from \"@/lib/entries\"\nimport { EntryList } from \"./EntryList\"\nimport { EntryDetail } from \"./EntryDetail\"\nimport { EntryRelated } from \"./EntryRelated\"\nimport { EntryHistory } from \"./EntryHistory\"\nimport { MemoryGraph } from \"./MemoryGraph\"\nimport { CleanupPanel } from \"./CleanupPanel\"\nimport { MemoryHistory } from \"./MemoryHistory\"\nimport type { MergeInput } from \"./MergeDialog\"\nimport type { CleanupFlag, MemoryVersion } from \"@/lib/core\"\nimport { cn } from \"@/lib/utils\"\nimport { AlertTriangle } from \"lucide-react\"\n\ninterface MemoryTabProps {\n memory: { content: string; exists: boolean } | null\n /** null while loading */\n entries: Entry[] | null\n rootParam: string\n /** The open entry id (from ?entry=), or null */\n selectedId: string | null\n /** The New entry form is open */\n creating: boolean\n onOpen: (id: string) => void\n onNew: () => void\n onClose: () => void\n onSaved: (entry: Entry) => void\n onDelete: (entry: Entry) => void\n view: \"list\" | \"graph\"\n onView: (view: \"list\" | \"graph\") => void\n /** Health flags incl. dismissed ones (null while loading) */\n flags: CleanupFlag[] | null\n /** The Cleanup panel is open (?cleanup=1) */\n cleanup: boolean\n onCleanup: (open: boolean) => void\n onDismiss: (flag: CleanupFlag) => void\n onMerge: (input: MergeInput) => Promise<string | null>\n /** Delete from a \"Not recalled lately\" row; the Cleanup panel stays open */\n onDeleteStale: (id: string) => void\n /** Saved MEMORY.md versions (null while loading) */\n versions: MemoryVersion[] | null\n /** The history pane is open (?history=1) and its selected version (?version=) */\n history: boolean\n versionId: string | null\n onHistory: (open: boolean, versionId?: string | null) => void\n onRestore: (version: MemoryVersion) => Promise<void>\n}\n\nexport function MemoryTab({ memory, entries, rootParam, selectedId, creating, onOpen, onNew, onClose, onSaved, onDelete, view, onView, flags, cleanup, onCleanup, onDismiss, onMerge, onDeleteStale, versions, history, versionId, onHistory, onRestore }: MemoryTabProps) {\n const selected = selectedId ? entries?.find((e) => e.id === selectedId) : undefined\n const open = flags?.filter((f) => !f.dismissed) ?? []\n const warn = open.some((f) => f.severity === \"warn\")\n return (\n <div className={cn(\n \"grid items-start gap-6 p-6\",\n view === \"graph\" ? \"lg:grid-cols-[minmax(0,1fr)_minmax(0,30rem)]\" : \"lg:grid-cols-[minmax(280px,380px)_minmax(0,42rem)]\",\n )}>\n <div className=\"flex items-center justify-between gap-4 lg:col-span-2\">\n <h1 className=\"font-display text-xl font-semibold tracking-tight\">Memory</h1>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n aria-pressed={cleanup}\n onClick={() => onCleanup(!cleanup)}\n className={cn(\n \"flex h-7 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium text-muted outline-none transition-colors duration-(--duration-fast)\",\n \"hover:border-border2 hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\",\n cleanup && \"border-border2 bg-surface2 text-txt\",\n )}\n >\n {warn && <AlertTriangle className=\"size-3.5 text-amber\" aria-hidden />}\n Cleanup <span className=\"font-mono text-[11px]\">({open.length})</span>\n </button>\n <div role=\"group\" aria-label=\"Entries view\" className=\"flex rounded-md border border-border p-0.5\">\n {([\"list\", \"graph\"] as const).map((v) => (\n <button\n key={v}\n type=\"button\"\n aria-pressed={view === v}\n onClick={() => onView(v)}\n className={cn(\n \"h-6 rounded-[5px] border border-transparent px-2.5 text-xs font-medium capitalize text-muted outline-none transition-colors\",\n \"hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\",\n view === v && \"border-border2 bg-surface2 text-txt\",\n )}\n >\n {v}\n </button>\n ))}\n </div>\n </div>\n </div>\n {entries && view === \"graph\" ? (\n <MemoryGraph entries={entries} selectedId={selectedId} onOpenEntry={onOpen} />\n ) : entries ? (\n <EntryList entries={entries} selectedId={selectedId} onOpen={onOpen} onNew={onNew} />\n ) : (\n <p className=\"text-sm text-muted\">Loading entries…</p>\n )}\n {creating || selected ? (\n <div className=\"min-w-0 lg:sticky lg:top-6\">\n <EntryDetail key={creating ? \"new\" : selected?.id} entry={creating ? null : selected ?? null} rootParam={rootParam} onSaved={onSaved} onDelete={onDelete} onClose={onClose}>\n {selected && !creating && (\n <>\n <EntryRelated entryId={selected.id} onOpenEntry={onOpen} />\n <EntryHistory entryId={selected.id} />\n </>\n )}\n </EntryDetail>\n </div>\n ) : cleanup ? (\n <div className=\"min-w-0 lg:sticky lg:top-6\">\n <CleanupPanel flags={flags} entries={entries} onDismiss={onDismiss} onMerge={onMerge} onDelete={onDeleteStale} onOpenEntry={onOpen} onClose={() => onCleanup(false)} />\n </div>\n ) : selectedId && entries ? (\n <div role=\"alert\" className=\"min-w-0 rounded-xl border border-dashed border-border p-5 text-sm text-muted\">\n Entry {selectedId} not found.{\" \"}\n <button type=\"button\" onClick={onClose} className=\"text-txt underline underline-offset-2\">Show the handoff</button>\n </div>\n ) : (\n <div className=\"min-w-0\">\n <div className=\"mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2\">\n <h2 className=\"font-display text-base font-semibold tracking-tight\">Session handoff</h2>\n <div className=\"flex items-center gap-3\">\n <span className=\"text-xs font-mono text-muted\">memory/MEMORY.md</span>\n <button\n type=\"button\"\n aria-pressed={history}\n onClick={() => onHistory(!history)}\n className={cn(\n \"flex h-7 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium text-muted outline-none transition-colors duration-(--duration-fast)\",\n \"hover:border-border2 hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\",\n history && \"border-border2 bg-surface2 text-txt\",\n )}\n >\n History <span className=\"font-mono text-[11px]\">({versions?.length ?? \"…\"})</span>\n </button>\n </div>\n </div>\n\n {history ? (\n <MemoryHistory\n versions={versions}\n current={memory?.exists ? memory.content : \"\"}\n rootParam={rootParam}\n selectedId={versionId}\n onSelect={(id) => onHistory(true, id)}\n onClose={() => onHistory(false)}\n onRestore={onRestore}\n />\n ) : memory?.exists ? (\n <div className=\"bg-surface border border-border rounded-xl p-5\">\n <MarkdownRenderer content={memory.content} />\n </div>\n ) : (\n <EmptyState\n icon=\"🧠\"\n message=\"No MEMORY.md yet.\"\n subMessage=\"AI will create one at the end of the first session.\"\n bordered\n />\n )}\n\n <div className=\"mt-4 p-4 bg-surface2 border border-border rounded-xl\">\n <p className=\"text-xs font-mono text-muted mb-2\">\n Add to your CLAUDE.md system prompt:\n </p>\n <pre className=\"text-xs font-mono text-accent/80 whitespace-pre-wrap leading-relaxed\">{`At session start:\n1. Call vibedoc_read_memory\n If it shows ⚠ Memory warnings, fix the handoff with vibedoc_update_memory first\n2. Call vibedoc_get_status\n\nWhen you learn a fact that should still hold next week:\n- Call vibedoc_save_entry (convention, gotcha, decision, preference)\n\nAt session end:\n- Call vibedoc_update_memory with full handoff`}</pre>\n </div>\n </div>\n )}\n </div>\n )\n}\n","\"use client\"\n\nimport { useMemo, useState } from \"react\"\nimport { Plus, Search } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { Input } from \"@/components/ui/input\"\nimport { OwnerChip } from \"@/components/shared/OwnerChip\"\nimport { ENTRY_TYPES, type Entry, type EntryType } from \"@/lib/entries\"\nimport { filterEntries, tokenize } from \"@/lib/recall\"\n\n/** Knowledge entries (R046) with search (ranked like vibedoc_recall) and a type filter. */\nexport function EntryList({ entries, selectedId, onOpen, onNew }: {\n entries: Entry[]\n selectedId?: string | null\n onOpen: (id: string) => void\n onNew: () => void\n}) {\n const [query, setQuery] = useState(\"\")\n const [type, setType] = useState<EntryType | null>(null)\n const shown = useMemo(() => filterEntries(entries, { query, type }), [entries, query, type])\n const counts = useMemo(() => {\n const c: Record<string, number> = {}\n for (const e of entries) c[e.type] = (c[e.type] ?? 0) + 1\n return c\n }, [entries])\n const searching = tokenize(query).length > 0\n\n const chip = (value: EntryType | null, label: string, count: number) => (\n <button\n key={label}\n type=\"button\"\n aria-pressed={type === value}\n onClick={() => setType(value)}\n className={cn(\n \"h-6 rounded-[5px] border border-transparent px-2 text-xs font-medium text-muted outline-none transition-colors\",\n \"hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\",\n type === value && \"border-border2 bg-surface2 text-txt\",\n )}\n >\n {label} <span className=\"font-mono text-[10px] opacity-70\">{count}</span>\n </button>\n )\n\n return (\n <section aria-label=\"Knowledge entries\" className=\"flex min-w-0 flex-col gap-3\">\n <div className=\"flex items-baseline justify-between\">\n <h2 className=\"font-display text-base font-semibold tracking-tight\">Knowledge entries</h2>\n <button\n type=\"button\"\n onClick={onNew}\n className=\"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted outline-none hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\"\n >\n <Plus className=\"size-3.5\" aria-hidden /> New entry\n </button>\n </div>\n\n <div className=\"relative\">\n <Search className=\"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted\" aria-hidden />\n <Input\n id=\"memory-search\"\n type=\"search\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder=\"Search entries…\"\n aria-label=\"Search entries\"\n className=\"h-8 pl-8\"\n />\n </div>\n\n <div role=\"group\" aria-label=\"Filter by type\" className=\"flex flex-wrap gap-1\">\n {chip(null, \"All\", entries.length)}\n {ENTRY_TYPES.map((t) => chip(t, t, counts[t] ?? 0))}\n </div>\n\n {entries.length === 0 ? (\n <p className=\"rounded-xl border border-dashed border-border p-4 text-sm text-muted\">\n No knowledge entries yet. Agents save them with <code className=\"font-mono text-xs\">vibedoc_save_entry</code>.\n </p>\n ) : shown.length === 0 ? (\n <p className=\"p-2 text-sm text-muted\">\n No entries match {searching ? `\"${query.trim()}\"` : \"this filter\"}.\n </p>\n ) : (\n <ul className=\"flex flex-col divide-y divide-border rounded-xl border border-border bg-surface\">\n {shown.map((e) => (\n <li key={e.id}>\n <button\n type=\"button\"\n onClick={() => onOpen(e.id)}\n aria-current={e.id === selectedId ? \"true\" : undefined}\n className={cn(\n \"flex w-full flex-col gap-0.5 px-3 py-2 text-left outline-none transition-colors hover:bg-surface2 focus-visible:bg-surface2\",\n e.id === selectedId && \"bg-surface2 shadow-[inset_2px_0_0_var(--color-accent-edge)]\",\n )}\n >\n <span className=\"flex items-center gap-2 font-mono text-[11px] text-muted\">\n <span>{e.id}</span>\n <span>·</span>\n <span>{e.type}</span>\n <span className=\"ml-auto flex items-center gap-2\">\n <OwnerChip owner={e.by} className=\"font-sans\" />\n {e.updatedAt}\n </span>\n </span>\n <span className=\"text-sm text-txt\">{e.summary}</span>\n </button>\n </li>\n ))}\n </ul>\n )}\n </section>\n )\n}\n","\"use client\"\n\nimport { useEffect, useState, type ReactNode } from \"react\"\nimport { Pencil, Trash2, X } from \"lucide-react\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { ItemPanelHeader } from \"@/components/shared/ItemPanelHeader\"\nimport { OwnerChip } from \"@/components/shared/OwnerChip\"\nimport { MarkdownRenderer } from \"@/components/docs/MarkdownRenderer\"\nimport { ENTRY_TYPES, validateEntryInput, type Entry, type EntryType } from \"@/lib/entries\"\n\ntype Draft = { type: EntryType; summary: string; body: string }\n\n/**\n * One knowledge entry: read view with Edit, or the edit form. `entry` null = a new entry (form only).\n * R053 adds its panels (Related, History) under the body via `children`.\n */\nexport function EntryDetail({ entry, rootParam, onSaved, onDelete, onClose, children }: {\n entry: Entry | null\n rootParam: string\n onSaved: (entry: Entry) => void\n onDelete: (entry: Entry) => void\n onClose: () => void\n children?: ReactNode\n}) {\n const [editing, setEditing] = useState(entry === null)\n const [draft, setDraft] = useState<Draft>(() => toDraft(entry))\n const [error, setError] = useState<string | null>(null)\n const [saving, setSaving] = useState(false)\n\n const startEdit = () => { setDraft(toDraft(entry)); setError(null); setEditing(true) }\n const cancel = () => { if (entry) { setEditing(false); setError(null) } else onClose() }\n\n const save = async () => {\n // same rules as the server, so a bad summary never costs a request\n const invalid = validateEntryInput({ ...draft, id: entry?.id })\n if (invalid) { setError(invalid); return }\n setSaving(true)\n setError(null)\n try {\n const res = await fetch(`/api/memory/entries/save${rootParam}`, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ ...(entry ? { id: entry.id } : {}), ...draft }),\n })\n const data = (await res.json().catch(() => ({}))) as { entry?: Entry; error?: string }\n if (!res.ok || !data.entry) throw new Error(data.error ?? `Save failed (${res.status})`)\n setEditing(false)\n onSaved(data.entry)\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e))\n } finally {\n setSaving(false)\n }\n }\n\n // ⌫ / Delete deletes the open entry, unless the user is typing somewhere\n useEffect(() => {\n if (editing || !entry) return\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Backspace\" && e.key !== \"Delete\") return\n if (e.metaKey || e.ctrlKey || e.altKey) return\n const t = e.target as HTMLElement | null\n if (t && (t.isContentEditable || [\"INPUT\", \"TEXTAREA\", \"SELECT\"].includes(t.tagName))) return\n e.preventDefault()\n onDelete(entry)\n }\n window.addEventListener(\"keydown\", onKey)\n return () => window.removeEventListener(\"keydown\", onKey)\n }, [editing, entry, onDelete])\n\n const closeButton = (\n <button type=\"button\" onClick={onClose} aria-label=\"Close entry\" className=\"rounded p-1 text-muted hover:bg-surface2 hover:text-txt\">\n <X className=\"size-3.5\" />\n </button>\n )\n\n if (editing) {\n return (\n <section aria-label={entry ? `Edit ${entry.id}` : \"New entry\"} className=\"rounded-xl border border-border bg-surface\">\n <form\n onSubmit={(e) => { e.preventDefault(); void save() }}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") { e.preventDefault(); cancel() }\n if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) { e.preventDefault(); void save() }\n }}\n className=\"flex flex-col gap-3 p-5\"\n >\n <div className=\"flex items-center justify-between font-mono text-[11px] text-muted\">\n <span>{entry ? `${entry.id} · editing` : \"New entry\"}</span>\n {closeButton}\n </div>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Type\n <select\n value={draft.type}\n onChange={(e) => setDraft({ ...draft, type: e.target.value as EntryType })}\n className=\"h-8 rounded-md border border-border bg-bg px-2 text-sm text-txt focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent\"\n >\n {ENTRY_TYPES.map((t) => <option key={t} value={t}>{t}</option>)}\n </select>\n </label>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Summary (one line)\n <Input\n autoFocus\n value={draft.summary}\n onChange={(e) => setDraft({ ...draft, summary: e.target.value })}\n maxLength={200}\n className=\"h-8 text-txt\"\n />\n </label>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Details (markdown)\n <textarea\n value={draft.body}\n onChange={(e) => setDraft({ ...draft, body: e.target.value })}\n rows={8}\n className=\"w-full resize-y rounded-md border border-border bg-bg px-3 py-2 font-mono text-xs text-txt focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent\"\n />\n </label>\n {error && <p role=\"alert\" className=\"text-xs text-danger\">{error}</p>}\n <div className=\"flex items-center justify-end gap-2\">\n <span className=\"mr-auto text-[11px] text-muted\">⌘↵ save · Esc cancel</span>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={cancel}>Cancel</Button>\n <Button type=\"submit\" size=\"sm\" disabled={saving}>{saving ? \"Saving…\" : \"Save\"}</Button>\n </div>\n </form>\n </section>\n )\n }\n\n if (!entry) return null\n return (\n <section aria-label={entry.id} className=\"rounded-xl border border-border bg-surface\">\n <ItemPanelHeader\n kicker={<span>{entry.id} · entry</span>}\n menu={\n <span className=\"flex items-center gap-1\">\n <Button variant=\"ghost\" size=\"sm\" onClick={startEdit} className=\"h-7 px-2 text-xs\">\n <Pencil className=\"size-3.5\" /> Edit\n </Button>\n <Button variant=\"ghost\" size=\"sm\" onClick={() => onDelete(entry)} title=\"Delete (⌫)\" className=\"h-7 px-2 text-xs hover:text-danger\">\n <Trash2 className=\"size-3.5\" /> Delete\n </Button>\n {closeButton}\n </span>\n }\n title={entry.summary}\n properties={[\n { label: \"Type\", value: entry.type },\n { label: \"Updated\", value: entry.updatedAt || null },\n { label: \"Changed by\", value: entry.by ? <OwnerChip owner={entry.by} className=\"text-xs text-txt\" /> : null },\n { label: \"File\", value: <span className=\"truncate font-mono text-[11px] text-muted\">{entry.file}</span> },\n ]}\n />\n <div className=\"p-5\">\n {entry.body ? <MarkdownRenderer content={entry.body} /> : <p className=\"text-sm text-muted\">No details.</p>}\n {children}\n </div>\n </section>\n )\n}\n\nfunction toDraft(entry: Entry | null): Draft {\n return entry ? { type: entry.type, summary: entry.summary, body: entry.body } : { type: \"convention\", summary: \"\", body: \"\" }\n}\n","\"use client\"\n\nimport { useState } from \"react\"\nimport { ChevronRight, GitCommitHorizontal, X } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { useApp } from \"@/context/AppContext\"\nimport type { FileCommit, FileHistory } from \"@/lib/core\"\n\n/**\n * How an entry changed over time (R053): the commits that touched its file, from git.\n * Collapsed by default; nothing is fetched until it is opened. A row shows that version read-only.\n */\nexport function EntryHistory({ entryId }: { entryId: string }) {\n const { rootParam } = useApp()\n const [open, setOpen] = useState(false)\n const [data, setData] = useState<FileHistory | null>(null)\n const [error, setError] = useState<string | null>(null)\n const [version, setVersion] = useState<{ commit: FileCommit; text: string } | null>(null)\n const base = `/api/memory/history${rootParam}&entry=${encodeURIComponent(entryId)}`\n\n const get = async <T,>(url: string): Promise<T> => {\n const res = await fetch(url)\n const body = await res.json().catch(() => ({}))\n if (!res.ok) throw new Error(body.error ?? `Request failed (${res.status})`)\n return body as T\n }\n\n const toggle = async () => {\n const next = !open\n setOpen(next)\n if (!next || data) return\n try {\n setData(await get<FileHistory>(base))\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e))\n }\n }\n\n const show = async (commit: FileCommit) => {\n try {\n const { text } = await get<{ text: string }>(`${base}&sha=${commit.sha}`)\n setVersion({ commit, text })\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e))\n }\n }\n\n return (\n <section aria-label=\"History\" className=\"mt-4 border-t border-border pt-3\">\n <button\n type=\"button\"\n onClick={toggle}\n aria-expanded={open}\n className=\"flex items-center gap-1 rounded text-xs font-semibold text-txt outline-none focus-visible:ring-2 focus-visible:ring-accent\"\n >\n <ChevronRight className={cn(\"size-3.5 text-muted transition-transform\", open && \"rotate-90\")} aria-hidden />\n History\n </button>\n\n {open && (\n <div className=\"mt-2 flex flex-col gap-2\">\n {error && <p role=\"alert\" className=\"text-xs text-danger\">{error}</p>}\n {!data && !error && <p className=\"text-xs text-muted\">Loading history…</p>}\n {data?.reason === \"no-git\" && <p className=\"text-xs text-muted\">History needs git: this project is not a git repository.</p>}\n {data && !data.reason && !data.history.length && !data.uncommitted && (\n <p className=\"text-xs text-muted\">Not committed yet.</p>\n )}\n {data && (data.uncommitted || data.history.length > 0) && (\n <ul className=\"flex flex-col\">\n {data.uncommitted && (\n <li className=\"flex items-center gap-2 px-2 py-1 text-xs text-muted\">\n <span className=\"size-1.5 rounded-full bg-accent\" aria-hidden /> Uncommitted changes\n </li>\n )}\n {data.history.map((c) => (\n <li key={c.sha}>\n <button\n type=\"button\"\n onClick={() => show(c)}\n aria-current={version?.commit.sha === c.sha ? \"true\" : undefined}\n className={cn(\n \"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-xs outline-none hover:bg-surface2 focus-visible:ring-2 focus-visible:ring-accent\",\n version?.commit.sha === c.sha && \"bg-surface2\",\n )}\n >\n <GitCommitHorizontal className=\"size-3.5 shrink-0 text-muted\" aria-hidden />\n <span className=\"shrink-0 font-mono text-[11px] text-muted\">{c.date.slice(0, 10)}</span>\n <span className=\"min-w-0 flex-1 truncate text-txt\">{c.subject}</span>\n <span className=\"shrink-0 text-muted\">{c.author}</span>\n </button>\n </li>\n ))}\n </ul>\n )}\n {version && (\n <div className=\"rounded-md border border-border bg-bg\">\n <div className=\"flex items-center justify-between border-b border-border px-3 py-1.5 font-mono text-[11px] text-muted\">\n <span>{version.commit.sha.slice(0, 7)} · {version.commit.date.slice(0, 10)} · read-only</span>\n <button type=\"button\" onClick={() => setVersion(null)} aria-label=\"Close version\" className=\"rounded p-0.5 hover:text-txt\">\n <X className=\"size-3.5\" />\n </button>\n </div>\n <pre className=\"max-h-72 overflow-auto whitespace-pre-wrap p-3 font-mono text-xs text-txt\">{version.text}</pre>\n </div>\n )}\n </div>\n )}\n </section>\n )\n}\n","\"use client\"\n\nimport { memo, useEffect, useMemo, useState, useSyncExternalStore } from \"react\"\nimport { Background, BackgroundVariant, Controls, Handle, Position, ReactFlow, type Edge, type Node, type NodeProps } from \"@xyflow/react\"\nimport \"@xyflow/react/dist/style.css\"\nimport { cn } from \"@/lib/utils\"\nimport { useApp } from \"@/context/AppContext\"\nimport { StatusIcon } from \"@/components/shared/StatusIcon\"\nimport { displayStatus } from \"@/lib/statuses\"\nimport type { Entry } from \"@/lib/entries\"\nimport { GRAPH_COL_W, graphLayout, type GraphNode, type MemoryGraph as Graph } from \"@/lib/memory-graph\"\nimport { KIND_ICON, useOpenNode } from \"./EntryRelated\"\n\ntype MemNodeData = { node: GraphNode; status?: string; unlinked: boolean; dim: boolean; active: boolean }\ntype MemNode = Node<MemNodeData, \"mem\">\n\nconst NODE_W = GRAPH_COL_W - 44\nconst FLOW_STYLE = { \"--xy-background-color\": \"var(--color-bg)\" } as React.CSSProperties\n// ponytail: above this many nodes only the ones on screen render; measured smooth at 240 entries either way\nconst VIRTUALIZE_OVER = 150\n// fitting a wide graph shrinks the text past reading; below this zoom, centre it and let the user pan\nconst FIT_MIN_ZOOM = 0.8\n\nfunction subscribeTheme(cb: () => void) {\n const mo = new MutationObserver(cb)\n mo.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\"] })\n return () => mo.disconnect()\n}\n\n/** One node: kind icon (or task status), id, label. Handles left and right; edges pick a side by column. */\nconst MemNodeView = memo(function MemNodeView({ data }: NodeProps<MemNode>) {\n const { node, status, unlinked, dim, active } = data\n const Icon = KIND_ICON[node.kind]\n return (\n <div\n title={node.path}\n style={{ width: NODE_W }}\n className={cn(\n \"flex items-center gap-2 rounded-md border bg-surface px-2.5 py-1.5 text-xs transition-opacity\",\n node.kind === \"entry\" ? \"border-border2\" : \"border-border\",\n active && \"border-accent ring-1 ring-accent\",\n unlinked && \"border-dashed opacity-60\",\n dim && \"opacity-25\",\n )}\n >\n {[\"l\", \"r\"].map((side) => (\n <span key={side}>\n <Handle id={side} type=\"source\" position={side === \"l\" ? Position.Left : Position.Right} isConnectable={false} className=\"opacity-0\" />\n <Handle id={`${side}-t`} type=\"target\" position={side === \"l\" ? Position.Left : Position.Right} isConnectable={false} className=\"opacity-0\" />\n </span>\n ))}\n {status ? <StatusIcon status={status} className=\"size-3.5 shrink-0\" /> : <Icon className={cn(\"size-3.5 shrink-0\", node.kind === \"entry\" ? \"text-accent\" : \"text-muted\")} aria-hidden />}\n {node.kind !== \"doc\" && <span className=\"shrink-0 font-mono text-[10px] text-muted\">{node.id}</span>}\n <span className={cn(\"min-w-0 truncate\", node.kind === \"entry\" ? \"text-txt\" : \"text-muted\")}>{node.label}</span>\n </div>\n )\n})\nconst nodeTypes = { mem: MemNodeView }\n\n/**\n * Entries and the tasks, epics, ADRs and docs they link to (R053). Deterministic layout from graphLayout();\n * selecting an entry highlights it and its neighbours. Refetches on every memory_updated SSE event.\n */\nexport function MemoryGraph({ entries, selectedId, onOpenEntry }: { entries: Entry[]; selectedId: string | null; onOpenEntry: (id: string) => void }) {\n const { rootParam, summary, board } = useApp()\n const open = useOpenNode(onOpenEntry)\n const [graph, setGraph] = useState<Graph | null>(null)\n const isDark = useSyncExternalStore(subscribeTheme, () => document.documentElement.classList.contains(\"dark\"), () => true)\n\n useEffect(() => {\n let live = true\n fetch(`/api/memory/graph${rootParam}`)\n .then((r) => r.json())\n .then((g: Graph) => { if (live) setGraph(g.nodes ? g : { nodes: [], edges: [] }) })\n .catch((e) => {\n console.warn(\"Loading the memory graph failed\", e)\n if (live) setGraph({ nodes: [], edges: [] })\n })\n return () => { live = false }\n }, [rootParam, summary])\n\n const { nodes, edges } = useMemo(() => {\n if (!graph) return { nodes: [] as MemNode[], edges: [] as Edge[] }\n const types = Object.fromEntries(entries.map((e) => [e.id, e.type]))\n const pos = graphLayout(graph, types)\n const tasks = new Map(Object.values(board ?? {}).flat().map((t) => [t.id, t]))\n const linked = new Set(graph.edges.flatMap((e) => [e.from, e.to]))\n const focus = selectedId && pos[selectedId]\n ? new Set([selectedId, ...graph.edges.filter((e) => e.from === selectedId || e.to === selectedId).flatMap((e) => [e.from, e.to])])\n : null\n const nodes: MemNode[] = graph.nodes.map((n) => {\n const task = n.kind === \"task\" ? tasks.get(n.id) : undefined\n return {\n id: n.id,\n type: \"mem\",\n position: pos[n.id] ?? { x: 0, y: 0 },\n data: {\n node: n,\n status: task ? displayStatus(task) : undefined,\n unlinked: n.kind === \"entry\" && !linked.has(n.id),\n dim: !!focus && !focus.has(n.id),\n active: n.id === selectedId,\n },\n draggable: false,\n }\n })\n const edges: Edge[] = graph.edges.map((e) => {\n const fx = pos[e.from]?.x ?? 0, tx = pos[e.to]?.x ?? 0\n const leftward = tx < fx\n const hot = !!focus && (e.from === selectedId || e.to === selectedId)\n return {\n id: `${e.from}->${e.to}`,\n source: e.from,\n target: e.to,\n // same column (entry → entry) loops out and back on the right\n sourceHandle: leftward ? \"l\" : \"r\",\n targetHandle: leftward ? \"r-t\" : tx === fx ? \"r-t\" : \"l-t\",\n style: { stroke: hot ? \"var(--color-accent)\" : \"var(--color-border2)\", strokeWidth: hot ? 1.75 : 1, opacity: focus && !hot ? 0.15 : 1 },\n }\n })\n return { nodes, edges }\n }, [graph, entries, board, selectedId])\n\n if (!graph) return <p className=\"text-sm text-muted\">Loading graph…</p>\n if (!graph.nodes.length) return <p className=\"rounded-xl border border-dashed border-border p-4 text-sm text-muted\">No entries to draw yet.</p>\n\n return (\n <div aria-label=\"Memory graph\" className=\"h-[70vh] min-h-[420px] overflow-hidden rounded-xl border border-border\">\n <ReactFlow<MemNode>\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n onNodeClick={(_, n) => open(n.data.node)}\n nodesConnectable={false}\n nodesDraggable={false}\n deleteKeyCode={null}\n colorMode={isDark ? \"dark\" : \"light\"}\n onlyRenderVisibleElements={nodes.length > VIRTUALIZE_OVER}\n fitView\n fitViewOptions={{ padding: 0.1, minZoom: FIT_MIN_ZOOM, maxZoom: 1 }}\n minZoom={0.1}\n style={FLOW_STYLE}\n >\n <Background variant={BackgroundVariant.Dots} gap={20} size={1} />\n <Controls showInteractive={false} />\n </ReactFlow>\n </div>\n )\n}\n","\"use client\"\n\nimport { useState, type RefObject } from \"react\"\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"@/components/ui/dialog\"\nimport { Input } from \"@/components/ui/input\"\nimport { Button } from \"@/components/ui/button\"\nimport { ENTRY_TYPES, type Entry, type EntryType } from \"@/lib/entries\"\nimport { cn } from \"@/lib/utils\"\n\nexport type MergeInput = { keepId: string; dropIds: string[]; type: EntryType; summary: string; body: string }\n\n/** The kept entry's fields; the body is the kept body plus the others' bodies under `---`. */\nfunction draftFor(keep: Entry, group: Entry[]) {\n const body = [keep, ...group.filter((e) => e.id !== keep.id)].map((e) => e.body.trim()).filter(Boolean).join(\"\\n\\n---\\n\\n\")\n return { type: keep.type, summary: keep.summary, body }\n}\n\n/** Approve a suggested duplicate merge (R051). Nothing is merged until Approve. Mount with a key per group. */\nexport function MergeDialog({ group, onClose, onApprove, returnFocus }: {\n /** the suggested entries, at least two */\n group: Entry[]\n onClose: () => void\n /** Returns an error message to show, or null on success. */\n onApprove: (input: MergeInput) => Promise<string | null>\n /** focused again on close (Esc / Cancel), when it is still on the page */\n returnFocus?: RefObject<HTMLElement | null>\n}) {\n const sorted = [...group].sort((a, b) => a.id.localeCompare(b.id, \"en\", { numeric: true }))\n const [keepId, setKeepId] = useState(sorted[0].id)\n const [draft, setDraft] = useState(() => draftFor(sorted[0], sorted))\n const [error, setError] = useState<string | null>(null)\n const [busy, setBusy] = useState(false)\n\n const pick = (id: string) => {\n setKeepId(id)\n setDraft(draftFor(sorted.find((e) => e.id === id) ?? sorted[0], sorted))\n }\n\n async function approve() {\n if (busy || !draft.summary.trim()) return\n setBusy(true)\n const err = await onApprove({ keepId, dropIds: sorted.filter((e) => e.id !== keepId).map((e) => e.id), ...draft })\n setBusy(false)\n if (err) setError(err)\n else onClose()\n }\n\n return (\n <Dialog open onOpenChange={(v) => { if (!v) onClose() }}>\n <DialogContent\n onCloseAutoFocus={(e) => {\n const el = returnFocus?.current\n if (el?.isConnected) { e.preventDefault(); el.focus() }\n }}\n className=\"max-h-[90vh] max-w-3xl overflow-y-auto border-border bg-surface text-txt shadow-xl shadow-black/20\">\n <DialogTitle className=\"text-sm font-semibold text-txt\">Merge entries</DialogTitle>\n <DialogDescription className=\"text-xs text-muted\">\n Pick the entry to keep and edit the merged text. The others are deleted; mentions of them point to the kept id.\n </DialogDescription>\n <form\n onSubmit={(e) => { e.preventDefault(); void approve() }}\n onKeyDown={(e) => { if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) { e.preventDefault(); void approve() } }}\n className=\"flex min-w-0 flex-col gap-3\"\n >\n <fieldset className=\"grid min-w-0 gap-2 sm:grid-cols-2\">\n <legend className=\"sr-only\">Entry to keep</legend>\n {sorted.map((e) => (\n <label\n key={e.id}\n className={cn(\n \"flex min-w-0 cursor-pointer flex-col gap-1.5 rounded-lg border bg-bg p-3 transition-colors duration-(--duration-fast)\",\n e.id === keepId ? \"border-accent\" : \"border-border hover:border-border2\",\n )}\n >\n <span className=\"flex items-center gap-2 text-xs\">\n <input\n type=\"radio\"\n name=\"keep\"\n value={e.id}\n checked={e.id === keepId}\n onChange={() => pick(e.id)}\n className=\"size-3.5 accent-accent focus-visible:outline-2 focus-visible:outline-accent\"\n />\n <span className=\"font-mono text-[11px] text-muted\">{e.id}</span>\n <span className=\"font-mono text-[10px] text-muted\">{e.type}</span>\n <span className=\"ml-auto text-muted\">{e.id === keepId ? \"Keep\" : \"Delete\"}</span>\n </span>\n <span className=\"text-[13px] font-medium text-txt\">{e.summary}</span>\n {e.body && <span className=\"line-clamp-6 whitespace-pre-wrap font-mono text-[11px] text-muted\">{e.body}</span>}\n </label>\n ))}\n </fieldset>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Type\n <select\n value={draft.type}\n onChange={(e) => setDraft({ ...draft, type: e.target.value as EntryType })}\n className=\"h-8 rounded-md border border-border bg-bg px-2 text-sm text-txt focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent\"\n >\n {ENTRY_TYPES.map((t) => <option key={t} value={t}>{t}</option>)}\n </select>\n </label>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Merged summary (one line)\n <Input value={draft.summary} onChange={(e) => setDraft({ ...draft, summary: e.target.value })} maxLength={200} className=\"h-8 text-txt\" />\n </label>\n <label className=\"flex flex-col gap-1 text-xs text-muted\">\n Merged details (markdown)\n <textarea\n value={draft.body}\n onChange={(e) => setDraft({ ...draft, body: e.target.value })}\n rows={8}\n className=\"w-full resize-y rounded-md border border-border bg-bg px-3 py-2 font-mono text-xs text-txt focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent\"\n />\n </label>\n {error && <p role=\"alert\" className=\"text-xs text-danger\">{error}</p>}\n <div className=\"flex items-center justify-end gap-2\">\n <span className=\"mr-auto font-mono text-[11px] text-muted\">⌘↵ approve · Esc cancel</span>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={onClose}>Cancel</Button>\n <Button type=\"submit\" size=\"sm\" disabled={busy || !draft.summary.trim()}>\n {busy ? \"Merging…\" : `Merge into ${keepId}`}\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n )\n}\n","\"use client\"\n\nimport { useEffect, useMemo, useRef, useState } from \"react\"\nimport { useRouter } from \"next/navigation\"\nimport { AlertTriangle, Info, Trash2 } from \"lucide-react\"\nimport { useApp } from \"@/context/AppContext\"\nimport { StatusIcon } from \"@/components/shared/StatusIcon\"\nimport { displayStatus } from \"@/lib/statuses\"\nimport { cn } from \"@/lib/utils\"\nimport type { CleanupFlag } from \"@/lib/core\"\nimport type { HealthKind } from \"@/lib/memory-health\"\nimport type { Entry } from \"@/lib/entries\"\nimport { MergeDialog, type MergeInput } from \"./MergeDialog\"\n\nconst GROUPS: { kind: HealthKind; label: string }[] = [\n { kind: \"contradiction\", label: \"Contradicts the board\" },\n { kind: \"dangling-ref\", label: \"Missing items\" },\n { kind: \"duplicate\", label: \"Possible duplicates\" },\n { kind: \"stale\", label: \"Not recalled lately\" },\n]\n\n/** Memory health flags (R051), grouped by kind. Dismiss hides a flag until its id changes (memory/.cleanup.json). */\nexport function CleanupPanel({ flags, entries, onDismiss, onMerge, onDelete, onOpenEntry, onClose }: {\n /** null while loading; includes dismissed flags (marked `dismissed`) */\n flags: CleanupFlag[] | null\n /** for entry summaries next to their ids */\n entries: Entry[] | null\n onDismiss: (flag: CleanupFlag) => void\n /** Approve a suggested merge; returns an error message, or null on success */\n onMerge: (input: MergeInput) => Promise<string | null>\n /** Delete a stale entry now (Undo toast, no confirm) */\n onDelete: (id: string) => void\n onOpenEntry: (id: string) => void\n onClose: () => void\n}) {\n const router = useRouter()\n const { board } = useApp()\n const [showDismissed, setShowDismissed] = useState(false)\n const [merging, setMerging] = useState<string[] | null>(null)\n // the Merge… button that opened the dialog: the dialog has no DialogTrigger, so focus goes back here by hand\n const mergeTrigger = useRef<HTMLButtonElement | null>(null)\n // a row action that removes its row (Delete, Dismiss with dismissed hidden): once it's gone, focus the row now at its index\n const refocus = useRef<{ id: string; index: number } | null>(null)\n const sectionRef = useRef<HTMLElement | null>(null)\n const tasks = useMemo(() => new Map(Object.values(board ?? {}).flat().map((t) => [t.id, t])), [board])\n const summaries = useMemo(() => new Map((entries ?? []).map((e) => [e.id, e.summary])), [entries])\n const shown = (flags ?? []).filter((f) => showDismissed || !f.dismissed)\n const mergeGroup = merging && (entries ?? []).filter((e) => merging.includes(e.id))\n const dismissedCount = (flags ?? []).filter((f) => f.dismissed).length\n const shownIds = shown.map((f) => f.id).join(\" \")\n\n useEffect(() => {\n const pending = refocus.current\n if (!pending || shownIds.split(\" \").includes(pending.id)) return\n refocus.current = null\n const rows = sectionRef.current?.querySelectorAll<HTMLElement>(\"li[data-flag]\") ?? []\n const next = rows[Math.min(pending.index, rows.length - 1)]\n const target = next?.querySelector<HTMLElement>(\"button[data-action]\") ?? sectionRef.current?.querySelector<HTMLElement>(\"h2\")\n target?.focus()\n }, [shownIds])\n\n const willRemove = (f: CleanupFlag) => { refocus.current = { id: f.id, index: shown.indexOf(f) } }\n\n // open a referenced item where it lives, like the Related panel\n const open = (id: string) => {\n if (id.startsWith(\"T\")) router.push(`/board?task=${id}`)\n else if (id.startsWith(\"R\")) router.push(`/roadmap?item=${id}`)\n else if (id.startsWith(\"E\")) onOpenEntry(id)\n }\n\n const ref = (id: string) => {\n const task = tasks.get(id)\n const title = task?.title ?? summaries.get(id)\n return (\n <button\n key={id}\n type=\"button\"\n onClick={() => open(id)}\n className=\"inline-flex max-w-full items-center gap-1.5 rounded-sm px-1.5 py-0.5 text-left text-xs outline-none transition-colors duration-(--duration-fast) hover:bg-surface2 focus-visible:ring-2 focus-visible:ring-accent\"\n >\n {task && <StatusIcon status={displayStatus(task)} className=\"size-3.5 shrink-0\" />}\n <span className=\"shrink-0 font-mono text-[11px] text-muted\">{id}</span>\n {title && <span className=\"min-w-0 truncate text-txt\">{title}</span>}\n </button>\n )\n }\n\n const row = (f: CleanupFlag) => {\n const Icon = f.severity === \"warn\" ? AlertTriangle : Info\n return (\n <li key={f.id} data-flag={f.id} className={cn(\"flex items-start gap-2 rounded-lg border border-border bg-surface px-3 py-2.5\", f.dismissed && \"opacity-60\")}>\n <Icon className={cn(\"mt-0.5 size-3.5 shrink-0\", f.severity === \"warn\" && !f.dismissed ? \"text-amber\" : \"text-muted\")} aria-label={f.severity === \"warn\" ? \"Warning\" : \"Note\"} />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <p className={cn(\"text-[13px]\", f.dismissed ? \"text-muted\" : \"text-txt\")}>\n {f.message.split(/\\b([TRE]\\d+)\\b/).map((part, i) => (i % 2 ? <span key={i} className=\"font-mono text-[12px]\">{part}</span> : part))}\n </p>\n {f.refs.length > 0 && (\n <div className={cn(\"-ml-1.5 flex gap-1\", f.kind === \"duplicate\" ? \"flex-col items-start\" : \"flex-wrap\")}>{f.refs.map(ref)}</div>\n )}\n </div>\n {f.suggestion?.action === \"merge\" && !f.dismissed && (\n <button\n type=\"button\"\n data-action\n onClick={(e) => { mergeTrigger.current = e.currentTarget; setMerging(f.suggestion?.ids ?? null) }}\n className=\"h-6 shrink-0 rounded-md border border-border px-2 text-xs text-txt outline-none transition-colors duration-(--duration-fast) hover:border-border2 hover:bg-surface2 focus-visible:ring-2 focus-visible:ring-accent\"\n >\n Merge…\n </button>\n )}\n {f.suggestion?.action === \"delete\" && !f.dismissed && (\n <button\n type=\"button\"\n data-action\n onClick={() => { willRemove(f); f.suggestion?.ids.forEach(onDelete) }}\n aria-label={`Delete ${f.suggestion.ids.join(\", \")}`}\n className=\"inline-flex h-6 shrink-0 items-center gap-1 rounded-md border border-border px-2 text-xs text-txt outline-none transition-colors duration-(--duration-fast) hover:border-border2 hover:bg-surface2 hover:text-danger focus-visible:ring-2 focus-visible:ring-accent\"\n >\n <Trash2 className=\"size-3\" aria-hidden /> Delete\n </button>\n )}\n {f.dismissed ? (\n <span className=\"shrink-0 font-mono text-[10px] text-muted\" title=\"Dismissed on\">dismissed {f.dismissed}</span>\n ) : (\n <button\n type=\"button\"\n data-action\n onClick={() => { if (!showDismissed) willRemove(f); onDismiss(f) }}\n className=\"h-6 shrink-0 rounded-md px-2 text-xs text-muted outline-none transition-colors duration-(--duration-fast) hover:bg-surface2 hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\"\n >\n Dismiss\n </button>\n )}\n </li>\n )\n }\n\n return (\n <section ref={sectionRef} aria-label=\"Cleanup\" className=\"min-w-0\">\n <div className=\"mb-3 flex items-baseline justify-between gap-3\">\n <h2 tabIndex={-1} className=\"outline-none font-display text-base font-semibold tracking-tight\">Cleanup</h2>\n <div className=\"flex items-center gap-3\">\n {dismissedCount > 0 && (\n <label className=\"flex cursor-pointer items-center gap-1.5 text-xs text-muted\">\n <input\n type=\"checkbox\"\n checked={showDismissed}\n onChange={(e) => setShowDismissed(e.target.checked)}\n className=\"size-3.5 accent-accent focus-visible:outline-2 focus-visible:outline-accent\"\n />\n Show dismissed <span className=\"font-mono text-[10px]\">{dismissedCount}</span>\n </label>\n )}\n <button type=\"button\" onClick={onClose} className=\"text-xs text-muted underline-offset-2 outline-none hover:text-txt hover:underline focus-visible:ring-2 focus-visible:ring-accent\">\n Show the handoff\n </button>\n </div>\n </div>\n {flags === null ? (\n <p className=\"text-sm text-muted\">Checking memory…</p>\n ) : !shown.length ? (\n <p className=\"rounded-xl border border-dashed border-border p-5 text-sm text-muted\">Memory looks clean</p>\n ) : (\n <div className=\"flex flex-col gap-4\">\n {GROUPS.map(({ kind, label }) => {\n const group = shown.filter((f) => f.kind === kind)\n if (!group.length) return null\n return (\n <div key={kind} className=\"flex flex-col gap-1.5\">\n <h3 className=\"font-mono text-[10px] font-medium uppercase tracking-[0.06em] text-muted\">\n {label} <span>{group.filter((f) => !f.dismissed).length}</span>\n </h3>\n <ul className=\"flex flex-col gap-1.5\">{group.map(row)}</ul>\n </div>\n )\n })}\n </div>\n )}\n {mergeGroup && mergeGroup.length > 1 && (\n <MergeDialog key={mergeGroup.map((e) => e.id).join(\"+\")} group={mergeGroup} onClose={() => setMerging(null)} onApprove={onMerge} returnFocus={mergeTrigger} />\n )}\n </section>\n )\n}\n","\"use client\"\n\nimport { useEffect, useMemo, useState } from \"react\"\nimport { History, X } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { lineDiff, visibleHunks } from \"@/lib/diff\"\nimport { OwnerChip } from \"@/components/shared/OwnerChip\"\nimport { parseOwner } from \"@/lib/owner\"\nimport { timeAgo } from \"@/components/activity/ActivityEventRow\"\nimport type { MemoryVersion } from \"@/lib/core\"\n\ninterface MemoryHistoryProps {\n /** null while loading */\n versions: MemoryVersion[] | null\n /** The MEMORY.md on disk now (the diff's other side) */\n current: string\n rootParam: string\n /** ?version= */\n selectedId: string | null\n onSelect: (id: string | null) => void\n onClose: () => void\n onRestore: (version: MemoryVersion) => Promise<void>\n}\n\n/**\n * Saved MEMORY.md versions (R045), newest first, in place of the rendered handoff.\n * A row shows a line diff from the current file to that version and a Restore button.\n */\nexport function MemoryHistory({ versions, current, rootParam, selectedId, onSelect, onClose, onRestore }: MemoryHistoryProps) {\n const [loaded, setLoaded] = useState<{ id: string; content: string } | { id: string; error: string } | null>(null)\n const [restoring, setRestoring] = useState(false)\n const selected = versions?.find((v) => v.id === selectedId) ?? null\n\n useEffect(() => {\n if (!selectedId) return\n let live = true\n fetch(`/api/memory/versions${rootParam}&id=${encodeURIComponent(selectedId)}`)\n .then(async (r) => {\n const body = await r.json().catch(() => ({}))\n if (!r.ok) throw new Error(body.error ?? `Request failed (${r.status})`)\n if (live) setLoaded({ id: selectedId, content: String(body.content ?? \"\") })\n })\n .catch((e) => { if (live) setLoaded({ id: selectedId, error: e instanceof Error ? e.message : String(e) }) })\n return () => { live = false }\n }, [selectedId, rootParam])\n\n // Esc closes the pane, unless something inside (a field, a menu) already handled it\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Escape\" || e.defaultPrevented) return\n const t = e.target as HTMLElement | null\n if (t?.closest(\"input, textarea, select, [contenteditable=true], [role=dialog]\")) return\n onClose()\n }\n window.addEventListener(\"keydown\", onKey)\n return () => window.removeEventListener(\"keydown\", onKey)\n }, [onClose])\n\n const version = loaded && loaded.id === selectedId ? loaded : null\n const hunks = useMemo(() => (version && \"content\" in version ? visibleHunks(lineDiff(current, version.content)) : []), [version, current])\n const added = hunks.filter((h) => typeof h !== \"number\" && h.op === \"+\").length\n const removed = hunks.filter((h) => typeof h !== \"number\" && h.op === \"-\").length\n const changed = added + removed > 0\n\n const restore = async () => {\n if (!selected) return\n setRestoring(true)\n try { await onRestore(selected) } finally { setRestoring(false) }\n }\n\n return (\n <section aria-label=\"MEMORY.md history\" className=\"flex flex-col gap-3\">\n {!versions && <p className=\"text-sm text-muted\">Loading history…</p>}\n {versions?.length === 0 && (\n <div className=\"rounded-xl border border-dashed border-border p-5 text-sm text-muted\">\n No earlier versions yet. VibeDoc saves one before each handoff.\n </div>\n )}\n {versions && versions.length > 0 && (\n <ul className=\"flex flex-col rounded-xl border border-border bg-surface p-1\">\n {versions.map((v) => (\n <li key={v.id}>\n <button\n type=\"button\"\n onClick={() => onSelect(v.id === selectedId ? null : v.id)}\n aria-current={v.id === selectedId ? \"true\" : undefined}\n className={cn(\n \"flex w-full min-w-0 flex-col gap-0.5 rounded-md px-2 py-1.5 text-left text-xs outline-none hover:bg-surface2 focus-visible:ring-2 focus-visible:ring-accent\",\n v.id === selectedId && \"bg-surface2\",\n )}\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <History className=\"size-3.5 shrink-0 text-muted\" aria-hidden />\n <time dateTime={v.at} title={new Date(v.at).toLocaleString()} className=\"shrink-0 font-mono text-[11px] text-muted\">{timeAgo(v.at)}</time>\n <OwnerChip owner={parseOwner(v.actor)} className=\"shrink-0\" />\n <span className=\"shrink-0 font-mono text-[11px] text-muted\">{v.reason === \"restore\" ? \"before restore\" : \"before update\"}</span>\n </span>\n <span className={cn(\"block truncate pl-5.5\", v.excerpt ? \"text-txt\" : \"italic text-muted\")}>{v.excerpt || \"No handoff\"}</span>\n </button>\n </li>\n ))}\n </ul>\n )}\n\n {selectedId && versions && !selected && (\n <p role=\"alert\" className=\"text-xs text-muted\">Version <span className=\"font-mono\">{selectedId}</span> is no longer saved.</p>\n )}\n {selected && (\n <div className=\"overflow-hidden rounded-xl border border-border bg-bg\">\n <div className=\"flex items-start gap-2 border-b border-border bg-surface2 px-3 py-1.5 font-mono text-[11px] text-muted\">\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5\">\n <span title={new Date(selected.at).toLocaleString()}>{selected.at.slice(0, 16).replace(\"T\", \" \")}Z</span>\n <span><span className=\"text-danger\">− now</span> <span className=\"text-teal\">+ this version</span></span>\n {version && \"content\" in version && (\n <span className=\"ml-auto\"><span className=\"text-teal\">+{added}</span> <span className=\"text-danger\">−{removed}</span></span>\n )}\n </div>\n <button type=\"button\" onClick={() => onSelect(null)} aria-label=\"Close version\" className=\"shrink-0 rounded p-0.5 outline-none hover:text-txt focus-visible:ring-2 focus-visible:ring-accent\">\n <X className=\"size-3.5\" />\n </button>\n </div>\n <div className=\"max-h-96 overflow-auto font-mono text-[11px] leading-5\">\n {!version && <div className=\"px-3 py-1 text-muted\">Loading diff…</div>}\n {version && \"error\" in version && <div role=\"alert\" className=\"px-3 py-1 text-danger\">{version.error}</div>}\n {version && \"content\" in version && !changed && <div className=\"px-3 py-1 text-muted\">Same as the current file.</div>}\n {hunks.map((h, i) =>\n typeof h === \"number\" ? (\n <div key={i} className=\"bg-surface2/50 px-3 text-muted\">⋯ {h} unchanged line{h > 1 ? \"s\" : \"\"}</div>\n ) : (\n <div\n key={i}\n className={cn(\n \"whitespace-pre-wrap break-words px-3\",\n h.op === \"+\" && \"bg-teal/10 text-teal\",\n h.op === \"-\" && \"bg-danger/10 text-danger\",\n )}\n >\n {h.op === \"-\" ? \"−\" : h.op}{\" \"}{h.text || \" \"}\n </div>\n ),\n )}\n </div>\n <div className=\"flex items-center gap-2 border-t border-border px-3 py-2\">\n <button\n type=\"button\"\n onClick={restore}\n disabled={restoring || !version || \"error\" in version || !changed}\n className=\"h-7 shrink-0 whitespace-nowrap rounded-md bg-accent px-2.5 text-xs font-medium text-accent-fg outline-none hover:bg-accent/90 focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg disabled:opacity-50\"\n >\n {restoring ? \"Restoring…\" : \"Restore this version\"}\n </button>\n <span className=\"text-[11px] text-muted\">The current file is saved first, so you can undo.</span>\n </div>\n </div>\n )}\n </section>\n )\n}\n","\"use client\"\n\nimport { Suspense, useCallback, useEffect, useState } from \"react\"\nimport { useRouter, useSearchParams } from \"next/navigation\"\nimport { useApp } from \"@/context/AppContext\"\nimport { MemoryTab } from \"@/components/memory/MemoryTab\"\nimport { toast, undoToast } from \"@/components/ui/toast\"\nimport type { Entry } from \"@/lib/entries\"\nimport type { CleanupFlag, MemoryVersion } from \"@/lib/core\"\nimport type { MergeInput } from \"@/components/memory/MergeDialog\"\n\nexport default function MemoryPage() {\n return (\n <Suspense>\n <MemoryPageInner />\n </Suspense>\n )\n}\n\nfunction MemoryPageInner() {\n const { summary, rootParam, refresh } = useApp()\n const router = useRouter()\n // ?entry=E012 is the open entry and ?view=graph the Graph view, so a link or a reload keeps both\n const params = useSearchParams()\n const selectedId = params.get(\"entry\")\n const view = params.get(\"view\") === \"graph\" ? \"graph\" : \"list\"\n const cleanup = params.get(\"cleanup\") === \"1\"\n const history = params.get(\"history\") === \"1\"\n const versionId = history ? params.get(\"version\") : null\n const [entries, setEntries] = useState<Entry[] | null>(null)\n const [creating, setCreating] = useState(false)\n const [flags, setFlags] = useState<CleanupFlag[] | null>(null)\n const [versions, setVersions] = useState<MemoryVersion[] | null>(null)\n\n const load = useCallback(() => {\n let live = true\n fetch(`/api/memory/entries${rootParam}`)\n .then((r) => r.json())\n .then((d: { entries?: Entry[] }) => { if (live) setEntries(d.entries ?? []) })\n .catch((e) => {\n console.warn(\"Loading memory entries failed\", e)\n if (live) setEntries([])\n })\n return () => { live = false }\n }, [rootParam])\n\n // AppContext replaces `summary` on every memory_updated SSE event, so refetch the entries with it\n useEffect(() => load(), [load, summary])\n\n // MEMORY.md versions (R045); refetched with `summary` too, so an agent's handoff shows up while the list is open\n const loadVersions = useCallback(() => {\n let live = true\n fetch(`/api/memory/versions${rootParam}`)\n .then((r) => r.json())\n .then((d: unknown) => { if (live) setVersions(Array.isArray(d) ? d : []) })\n .catch((e) => {\n console.warn(\"Loading memory versions failed\", e)\n if (live) setVersions([])\n })\n return () => { live = false }\n }, [rootParam])\n useEffect(() => loadVersions(), [loadVersions, summary])\n\n // Health flags (incl. dismissed) for the Cleanup count + panel; they depend on the board and roadmap too\n const loadFlags = useCallback(() => {\n fetch(`/api/memory/health${rootParam}&dismissed=1`)\n .then((r) => r.json())\n .then((d: { flags?: CleanupFlag[] }) => setFlags(d.flags ?? []))\n .catch((e) => {\n console.warn(\"Loading memory health failed\", e)\n setFlags([])\n })\n }, [rootParam])\n useEffect(() => {\n loadFlags()\n const onSse = (e: Event) => {\n const type = (e as CustomEvent<{ type?: string }>).detail?.type ?? \"\"\n if (type === \"memory_updated\" || type === \"roadmap_updated\" || type.startsWith(\"task_\")) loadFlags()\n }\n window.addEventListener(\"vibedoc:sse\", onSse)\n return () => window.removeEventListener(\"vibedoc:sse\", onSse)\n }, [loadFlags])\n\n const dismiss = useCallback(async (flag: CleanupFlag) => {\n const today = new Date().toLocaleDateString(\"en-CA\")\n setFlags((list) => (list ?? []).map((f) => (f.id === flag.id ? { ...f, dismissed: today } : f)))\n try {\n const res = await fetch(`/api/memory/health/dismiss${rootParam}`, { method: \"POST\", headers: { \"content-type\": \"application/json\" }, body: JSON.stringify({ id: flag.id }) })\n const data = await res.json().catch(() => ({}))\n if (!res.ok) throw new Error(data.error ?? `Request failed (${res.status})`)\n } catch (e) {\n toast(`Dismiss failed: ${e instanceof Error ? e.message : String(e)}`)\n loadFlags()\n }\n }, [rootParam, loadFlags])\n\n // hist: undefined = history closed, null = the list, an id = that version\n const go = useCallback((entry: string | null, v: \"list\" | \"graph\", withCleanup = false, hist?: string | null) => {\n const q = new URLSearchParams()\n if (v === \"graph\") q.set(\"view\", \"graph\")\n if (entry) q.set(\"entry\", entry)\n if (withCleanup) q.set(\"cleanup\", \"1\")\n if (hist !== undefined) q.set(\"history\", \"1\")\n if (hist) q.set(\"version\", hist)\n router.replace(q.size ? `/memory?${q}` : \"/memory\", { scroll: false })\n }, [router])\n const select = useCallback((id: string | null) => {\n setCreating(false)\n go(id, view)\n }, [go, view])\n\n const post = useCallback(async (url: string, body: object) => {\n const res = await fetch(`${url}${rootParam}`, { method: \"POST\", headers: { \"content-type\": \"application/json\" }, body: JSON.stringify(body) })\n const data = await res.json().catch(() => ({}))\n if (!res.ok) throw new Error(data.error ?? `Request failed (${res.status})`)\n return data\n }, [rootParam])\n\n // No confirm: delete now, offer Undo (restores the same file), like tasks and docs\n const remove = useCallback(async (entry: Entry) => {\n try {\n const { file, raw } = await post(\"/api/memory/entries/delete\", { id: entry.id })\n setEntries((list) => (list ?? []).filter((e) => e.id !== entry.id))\n select(null)\n undoToast(`Deleted ${entry.id}`, async () => {\n await post(\"/api/memory/entries/restore\", { file, raw })\n load()\n select(entry.id)\n })\n } catch (e) {\n toast(`Delete failed: ${e instanceof Error ? e.message : String(e)}`)\n }\n }, [post, select, load])\n\n // From the Cleanup panel: same delete + Undo, but the panel stays open\n const removeStale = useCallback(async (id: string) => {\n try {\n const { file, raw } = await post(\"/api/memory/entries/delete\", { id })\n setEntries((list) => (list ?? []).filter((e) => e.id !== id))\n setFlags((list) => (list ?? []).filter((f) => !(f.kind === \"stale\" && f.refs.includes(id))))\n undoToast(`Deleted ${id}`, async () => {\n await post(\"/api/memory/entries/restore\", { file, raw })\n load()\n })\n } catch (e) {\n toast(`Delete failed: ${e instanceof Error ? e.message : String(e)}`)\n }\n }, [post, load])\n\n // The dialog is the approval; Undo writes every touched file back\n const merge = useCallback(async (input: MergeInput): Promise<string | null> => {\n try {\n const { entry, before } = await post(\"/api/memory/entries/merge\", input)\n setEntries((list) => [...(list ?? []).filter((e) => e.id !== entry.id && !input.dropIds.includes(e.id)), entry])\n select(entry.id)\n undoToast(`Merged into ${entry.id}`, async () => {\n await post(\"/api/memory/entries/merge/undo\", { before })\n load()\n select(entry.id)\n })\n return null\n } catch (e) {\n return e instanceof Error ? e.message : String(e)\n }\n }, [post, select, load])\n\n // Restore writes the version back; the API snapshots the replaced file first and returns its id, so Undo restores that\n const restoreVersion = useCallback(async (version: MemoryVersion) => {\n try {\n const { replacedId } = await post(\"/api/memory/restore\", { id: version.id })\n go(null, view)\n await refresh()\n loadVersions()\n const undo = async () => {\n await post(\"/api/memory/restore\", { id: replacedId })\n await refresh()\n loadVersions()\n }\n if (replacedId) undoToast(\"Restored MEMORY.md\", undo)\n else toast(\"Restored MEMORY.md\")\n } catch (e) {\n toast(`Restore failed: ${e instanceof Error ? e.message : String(e)}`)\n }\n }, [post, go, view, refresh, loadVersions])\n\n return (\n <MemoryTab\n memory={summary?.memory ?? null}\n entries={entries}\n rootParam={rootParam}\n selectedId={creating ? null : selectedId}\n creating={creating}\n onOpen={select}\n onNew={() => setCreating(true)}\n onClose={() => select(null)}\n onDelete={remove}\n view={view}\n onView={(v) => go(selectedId, v, cleanup)}\n flags={flags}\n cleanup={cleanup && !creating && !selectedId}\n onCleanup={(open) => { setCreating(false); go(open ? null : selectedId, view, open) }}\n onDismiss={dismiss}\n onMerge={merge}\n onDeleteStale={removeStale}\n versions={versions}\n history={history}\n versionId={versionId}\n onHistory={(open, id) => go(null, view, false, open ? id ?? null : undefined)}\n onRestore={restoreVersion}\n onSaved={(entry) => {\n // show the saved text now; the SSE refetch confirms it\n setEntries((list) => [...(list ?? []).filter((e) => e.id !== entry.id), entry])\n select(entry.id)\n }}\n />\n )\n}\n","// Pure knowledge-entry parsing and formatting (R046, no fs). Self-check: node src/lib/entries.check.mts\n// One long-lived fact per file: memory/entries/E001-<slug>.md\n\nexport const ENTRY_TYPES = ['convention', 'gotcha', 'decision', 'preference'] as const\nexport type EntryType = typeof ENTRY_TYPES[number]\n\n/**\n * updatedAt = the `**Updated:**` date (YYYY-MM-DD); by = `**By:**` who saved it last (\"human\" | \"ai:<agent>\",\n * null in files from before R047); file = path relative to root.\n */\nexport type Entry = { id: string; type: EntryType; summary: string; body: string; updatedAt: string; by: string | null; file: string }\nexport type EntryInput = { id?: string; type: string; summary: string; body?: string }\n\nexport const SUMMARY_MAX = 120\n\nconst isEntryType = (s: string): s is EntryType => (ENTRY_TYPES as readonly string[]).includes(s)\n\n/** \"e1\" / \"E01\" / \"E001\" → \"E001\"; anything else → null. */\nexport function normalizeEntryId(s: string): string | null {\n const m = /^e(\\d+)$/i.exec(s.trim())\n if (!m) return null\n const n = Number(m[1])\n return n > 0 ? `E${String(n).padStart(3, '0')}` : null\n}\n\n/** One past the highest id: [] → \"E001\"; [\"E001\",\"E007\"] → \"E008\". */\nexport function nextEntryId(ids: string[]): string {\n const max = Math.max(0, ...ids.map(id => Number(normalizeEntryId(id)?.slice(1) ?? 0)))\n return `E${String(max + 1).padStart(3, '0')}`\n}\n\nexport function entrySlug(summary: string): string {\n return summary.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 40).replace(/-$/, '')\n}\n\n/** null when the `# E001: summary` H1 or a known `**Type:**` is missing. */\nexport function parseEntry(raw: string, file: string): Entry | null {\n const lines = raw.replace(/\\r\\n/g, '\\n').split('\\n')\n const h1 = /^#\\s+(E\\d+):\\s*(.+?)\\s*$/i.exec(lines[0] ?? '')\n const id = h1 && normalizeEntryId(h1[1])\n if (!h1 || !id) return null\n // Contiguous **Key:** Value block under the H1, like task files\n const meta: Record<string, string> = {}\n let i = 1\n for (; i < lines.length; i++) {\n const m = /^\\*\\*(\\w+):\\*\\*\\s*(.*)$/.exec(lines[i])\n if (!m) break\n meta[m[1].toLowerCase()] = m[2].trim()\n }\n const type = meta.type ?? ''\n if (!isEntryType(type)) return null\n return { id, type, summary: h1[2], body: lines.slice(i).join('\\n').trim(), updatedAt: meta.updated ?? '', by: meta.by || null, file }\n}\n\nexport function formatEntry(e: Omit<Entry, 'file'>): string {\n const head = `# ${e.id}: ${e.summary}\\n**Type:** ${e.type}\\n**Updated:** ${e.updatedAt}\\n${e.by ? `**By:** ${e.by}\\n` : ''}`\n return e.body.trim() ? `${head}\\n${e.body.trim()}\\n` : head\n}\n\n/** Error message, or null when valid. Does not check whether an id exists. */\nexport function validateEntryInput(i: EntryInput): string | null {\n if (i.id !== undefined && !normalizeEntryId(String(i.id))) return `Invalid id \"${i.id}\": expected E followed by a number, e.g. E001`\n if (!isEntryType(String(i.type ?? ''))) return `Invalid type \"${i.type ?? ''}\": use one of ${ENTRY_TYPES.join(', ')}`\n const summary = String(i.summary ?? '').trim()\n if (!summary) return 'summary is required'\n if (/\\n/.test(summary)) return 'summary must be one line'\n if (summary.length > SUMMARY_MAX) return `summary is ${summary.length} characters; keep it to ${SUMMARY_MAX}`\n if (i.body !== undefined && typeof i.body !== 'string') return 'body must be a string'\n return null\n}\n\n/**\n * Replace whole-token mentions of `fromIds` (any padding: E11, E011) with `toId`, for a merge (R051).\n * Same token boundaries as the memory graph's ID_RE, so \"XE011\" and \"E011a\" stay.\n */\nexport function replaceEntryRefs(text: string, fromIds: string[], toId: string): string {\n const from = new Set(fromIds.map(id => normalizeEntryId(id)))\n return text.replace(/(?<![A-Za-z0-9_-])E\\d+(?![A-Za-z0-9_])/g, m => (from.has(normalizeEntryId(m)) ? toId : m))\n}\n","// Pure keyword recall over knowledge entries (R048, no fs). Self-check: node src/lib/recall.check.mts\n// Index first, bodies on request: agents get compact lines here and fetch bodies with vibedoc_get_entries.\n\nexport type RecallEntry = { id: string; type: string; summary: string; body: string; updatedAt: string }\nexport type RecallHit = { id: string; type: string; summary: string; tokens: number; score: number }\n\nconst STOPWORDS = new Set(('a an and are as at be but by can do does for from how i if in into is it its of on or ' +\n 'our so that the their then there these this to use used using was we what when where which who why will with you your').split(' '))\n\n/** Lowercase, split on non-alphanumerics, drop stopwords and 1-char tokens, naive plural strip (\"events\" → \"event\"). */\nexport function tokenize(s: string): string[] {\n return s.toLowerCase().split(/[^a-z0-9]+/)\n .filter(t => t.length > 1 && !STOPWORDS.has(t))\n // ponytail: plural strip only, no real stemmer; add one if recall misses obvious matches\n .map(t => (t.length > 3 && t.endsWith('s') && !t.endsWith('ss') ? t.slice(0, -1) : t))\n}\n\nexport function estimateTokens(s: string): number {\n return Math.ceil(s.length / 4)\n}\n\n/** Per query token: +3 in summary, +2 matches id or type, +1 in body. Score 0 dropped; ties → newest first. */\nexport function rankEntries(entries: RecallEntry[], query: string, opts: { type?: string; limit?: number } = {}): RecallHit[] {\n const q = [...new Set(tokenize(query))]\n if (!q.length) return []\n const hits: (RecallHit & { updatedAt: string })[] = []\n for (const e of entries) {\n if (opts.type && e.type !== opts.type) continue\n const summary = new Set(tokenize(e.summary))\n const body = new Set(tokenize(e.body))\n const idType = new Set([e.id.toLowerCase(), ...tokenize(e.type)])\n let score = 0\n for (const t of q) {\n if (summary.has(t)) score += 3\n if (idType.has(t)) score += 2\n if (body.has(t)) score += 1\n }\n if (score > 0) {\n hits.push({ id: e.id, type: e.type, summary: e.summary, tokens: estimateTokens(`${e.summary}\\n${e.body}`), score, updatedAt: e.updatedAt })\n }\n }\n hits.sort((a, b) => b.score - a.score || b.updatedAt.localeCompare(a.updatedAt))\n return hits.slice(0, opts.limit ?? 10).map(({ updatedAt: _, ...h }) => h)\n}\n\n/** \"E012 · convention · Only core.ts touches fs (~120 tok)\" */\nexport function formatCompactLine(h: RecallHit): string {\n return `${h.id} · ${h.type} · ${h.summary} (~${h.tokens} tok)`\n}\n\n/** Every entry as a compact hit, newest first: the session-start index order. */\nexport function indexHits(entries: RecallEntry[]): RecallHit[] {\n return [...entries].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt) || a.id.localeCompare(b.id, 'en', { numeric: true }))\n .map(e => ({ id: e.id, type: e.type, summary: e.summary, tokens: estimateTokens(`${e.summary}\\n${e.body}`), score: 0 }))\n}\n\nexport const DEFAULT_SESSION_BUDGET = 2000\nconst INDEX_HINT = 'Save new facts with vibedoc_save_entry; fetch bodies with vibedoc_get_entries.'\n\n/** \"## Since the last handoff (auto, 2026-10-03)\" + the newest episode body, plus \"+N older\" when more are newer than MEMORY.md (R050). */\nexport function formatEpisodeSection(ep: { end: string; body: string }, older = 0): string {\n return [\n `## Since the last handoff (auto, ${ep.end.slice(0, 10)})`,\n ep.body.trim().replace(/^## /gm, '### '), // nest the episode's own sections under this one\n ...(older > 0 ? ['', `+${older} older episode${older === 1 ? '' : 's'} in .vibedoc/episodes/`] : []),\n ].join('\\n')\n}\n\n/**\n * Session start = the whole handoff + the episode section (if any) + as many index lines (in the order given) as fit\n * `budget` tokens, then \"+N more\" when some were left out. Header, footer and hint count toward the budget.\n * The handoff and the episode are never cut.\n */\nexport function fitToBudget(handoff: string, index: RecallHit[], budget: number, episode = ''):\n { text: string; shown: number; omitted: number; tokens: number } {\n const render = (n: number, warning?: string) => [\n handoff.trimEnd(), '',\n ...(episode ? [episode.trimEnd(), ''] : []),\n ...(warning ? [warning] : []),\n `## Knowledge entries (${index.length})`,\n ...index.slice(0, n).map(formatCompactLine),\n ...(n < index.length ? [`+${index.length - n} more entries — use vibedoc_recall { query }`] : []),\n INDEX_HINT,\n ].join('\\n')\n const fits = (n: number) => estimateTokens(render(n)) <= budget\n let text: string\n let shown = 0\n if (!fits(0)) {\n const what = episode ? `The handoff and the latest episode are ~${estimateTokens(`${handoff}\\n${episode}`)} tokens` : `The handoff alone is ~${estimateTokens(handoff)} tokens`\n text = render(0, `⚠️ ${what}, over the ${budget}-token session budget: trim memory/MEMORY.md.`)\n } else {\n // ponytail: re-renders per line (O(n²) chars); fine for hundreds of entries\n while (shown < index.length && fits(shown + 1)) shown++\n text = render(shown)\n }\n return { text, shown, omitted: index.length - shown, tokens: estimateTokens(text) }\n}\n\nexport const RELATED_MIN_SCORE = 3\nconst GOAL_CHARS = 500\n\n/** Recall query for a task: its title, the first 500 chars of its Goal, and the Phase epic title (id dropped). */\nexport function taskQuery(task: { title: string; phase?: string; raw?: string }): string {\n const goal = /^## Goal[ \\t]*\\n([\\s\\S]*?)(?=^## |(?![\\s\\S]))/m.exec(task.raw ?? '')?.[1].trim() ?? ''\n const epic = (task.phase ?? '').replace(/^R\\d+\\s*[—–-]\\s*/, '')\n return [task.title, goal.slice(0, GOAL_CHARS), epic].filter(Boolean).join(' ')\n}\n\n/** Only strong matches (at least one summary hit) → \"## Related memory\" block; '' when none qualify. */\nexport function formatRelated(hits: RecallHit[], limit = 3): string {\n const strong = hits.filter(h => h.score >= RELATED_MIN_SCORE).slice(0, limit)\n if (!strong.length) return ''\n return `## Related memory\\n${strong.map(formatCompactLine).join('\\n')}\\nFetch with vibedoc_get_entries`\n}\n\n/**\n * The Memory tab list (R047). No searchable words → the entries of `type`, newest first (session-start order).\n * Otherwise ranked like vibedoc_recall, so the UI and agents agree on the first hit. Returns the full entries.\n */\nexport function filterEntries<T extends RecallEntry>(entries: T[], opts: { query?: string; type?: string | null }): T[] {\n const pool = opts.type ? entries.filter(e => e.type === opts.type) : entries\n const byId = new Map(pool.map(e => [e.id, e]))\n const query = opts.query ?? ''\n const hits = tokenize(query).length ? rankEntries(pool, query, { limit: pool.length }) : indexHits(pool)\n return hits.map(h => byId.get(h.id)).filter((e): e is T => !!e)\n}\n","import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'rotate-ccw-clock',\n size: 24,\n node: [\n ['path', { d: 'M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8', key: '1357e3' }],\n ['path', { d: 'M3 3v5h5', key: '1xhq8a' }],\n ['path', { d: 'M12 7v5l4 2', key: '1fdv2h' }],\n ],\n aliases: ['history'],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name RotateCcwClock\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAxIDAgOS05IDkuNzUgOS43NSAwIDAgMC02Ljc0IDIuNzRMMyA4IiAvPgogIDxwYXRoIGQ9Ik0zIDN2NWg1IiAvPgogIDxwYXRoIGQ9Ik0xMiA3djVsNCAyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/rotate-ccw-clock\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst RotateCcwClock = createLucideIcon(__iconData);\n\nexport default RotateCcwClock;\n","import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'git-commit-horizontal',\n size: 24,\n node: [\n ['circle', { cx: '12', cy: '12', r: '3', key: '1v7zrd' }],\n ['line', { x1: '3', x2: '9', y1: '12', y2: '12', key: '1dyftd' }],\n ['line', { x1: '15', x2: '21', y1: '12', y2: '12', key: 'oup4p8' }],\n ],\n aliases: ['git-commit'],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name GitCommitHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIzIiAvPgogIDxsaW5lIHgxPSIzIiB4Mj0iOSIgeTE9IjEyIiB5Mj0iMTIiIC8+CiAgPGxpbmUgeDE9IjE1IiB4Mj0iMjEiIHkxPSIxMiIgeTI9IjEyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/git-commit-horizontal\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst GitCommitHorizontal = createLucideIcon(__iconData);\n\nexport default GitCommitHorizontal;\n","// Pure memory link graph (R053, no fs): links are inferred from text, never stored. Self-check: node src/lib/memory-graph.check.mts\n// Outgoing edges come from entry text; incoming edges from task, roadmap and doc files that mention an entry id.\n\nexport type NodeKind = 'entry' | 'task' | 'epic' | 'adr' | 'doc'\nexport type GraphNode = { id: string; kind: NodeKind; label: string; path: string }\nexport type GraphEdge = { from: string; to: string } // from mentions to\nexport type MemoryGraph = { nodes: GraphNode[]; edges: GraphEdge[] }\n/** A node plus the text scanned for its refs. */\nexport type GraphItem = GraphNode & { text: string }\n\n// Upper case only, whole tokens: \"XT0651\", \"e2e\" and \"T0651a\" don't match\nconst ID_RE = /(?<![A-Za-z0-9_-])(E\\d+|T\\d{3,}|R\\d{3,}|ADR-\\d+)(?![A-Za-z0-9_])/g\nconst BACKTICK_MD_RE = /`([^`\\s]+\\.md)`/g\nconst LINK_MD_RE = /\\]\\(\\s*<?([^)\\s>#]+\\.md)(?:#[^)\\s]*)?>?\\s*\\)/g\n\nconst pad3 = (n: string) => String(Number(n)).padStart(3, '0')\n\n/** \"E1\" → \"E001\", \"ADR-4\" → \"ADR-004\"; task and roadmap ids are already padded. */\nfunction normalizeId(id: string): string {\n if (id.startsWith('ADR-')) return `ADR-${pad3(id.slice(4))}`\n if (id.startsWith('E')) return `E${pad3(id.slice(1))}`\n return id\n}\n\nconst normalizePath = (p: string) => p.replace(/\\\\/g, '/').replace(/^\\.?\\//, '')\n\n/** Item ids (E/T/R/ADR) and `*.md` paths (in backticks or as link targets) mentioned in `text`, deduplicated. */\nexport function extractRefs(text: string): { ids: string[]; paths: string[] } {\n const ids = new Set<string>()\n for (const m of text.matchAll(ID_RE)) {\n if (/^E0+$/.test(m[1])) continue // E0 is not an entry id\n ids.add(normalizeId(m[1]))\n }\n const paths = new Set<string>()\n for (const re of [BACKTICK_MD_RE, LINK_MD_RE]) {\n for (const m of text.matchAll(re)) {\n if (/^[a-z]+:\\/\\//i.test(m[1])) continue // external URL\n paths.add(normalizePath(m[1]))\n }\n }\n return { ids: [...ids], paths: [...paths] }\n}\n\n/** Classify a non-entry markdown file by path. Label = its H1 without the \"ID: \" prefix, else the file name. */\nexport function fileNode(relPath: string, raw: string): GraphNode {\n const p = normalizePath(relPath)\n const name = p.split('/').pop() ?? p\n const h1 = /^#\\s+(.+?)\\s*$/m.exec(raw)?.[1] ?? ''\n const label = (id: string) => h1.replace(new RegExp(`^${id}\\\\s*[:—–-]\\\\s*`), '') || name.replace(/\\.md$/, '')\n let m: RegExpExecArray | null\n if ((m = /^plans\\/tasks\\/(T\\d{3,})[^/]*\\.md$/.exec(p))) return { id: m[1], kind: 'task', label: label(m[1]), path: p }\n if ((m = /^plans\\/roadmap\\/(R\\d{3,})[^/]*\\.md$/.exec(p))) return { id: m[1], kind: 'epic', label: label(m[1]), path: p }\n if ((m = /(?:^|\\/)(ADR-\\d+)[^/]*\\.md$/.exec(p))) {\n const id = normalizeId(m[1])\n return { id, kind: 'adr', label: label(m[1]), path: p }\n }\n return { id: p, kind: 'doc', label: h1 || name.replace(/\\.md$/, ''), path: p }\n}\n\n/**\n * Resolve refs into a graph. Unresolved refs, self-links and duplicate edges are dropped.\n * Nodes = every entry + every other item that touches an entry.\n */\nexport function buildGraph(entries: GraphItem[], others: GraphItem[]): MemoryGraph {\n const all = [...entries, ...others]\n const byId = new Map(all.map(n => [n.id, n]))\n const byPath = new Map(all.map(n => [n.path, n]))\n const entryIds = new Set(entries.map(e => e.id))\n const edges = new Map<string, GraphEdge>()\n const add = (from: string, to: string) => { if (from !== to) edges.set(`${from}\\u0000${to}`, { from, to }) }\n\n for (const e of entries) {\n const { ids, paths } = extractRefs(e.text)\n for (const id of ids) if (byId.has(id)) add(e.id, id)\n for (const p of paths) { const n = byPath.get(p); if (n) add(e.id, n.id) }\n }\n // incoming: other files that mention an entry id (not the whole doc-to-doc graph)\n for (const o of others) {\n for (const id of extractRefs(o.text).ids) if (entryIds.has(id)) add(o.id, id)\n }\n\n const touched = new Set(entryIds)\n for (const e of edges.values()) { touched.add(e.from); touched.add(e.to) }\n const nodes = all.filter(n => touched.has(n.id)).map(({ text: _, ...n }) => n)\n return { nodes, edges: [...edges.values()] }\n}\n\n/** One entry, its direct neighbours and the edges between it and them. Unknown id → empty graph. */\nexport function neighbourhood(graph: MemoryGraph, id: string): MemoryGraph {\n if (!graph.nodes.some(n => n.id === id)) return { nodes: [], edges: [] }\n const edges = graph.edges.filter(e => e.from === id || e.to === id)\n const keep = new Set([id, ...edges.flatMap(e => [e.from, e.to])])\n return { nodes: graph.nodes.filter(n => keep.has(n.id)), edges }\n}\n\n/**\n * \"Links: …\" / \"Linked from: …\" lines for one entry (vibedoc_get_entries). A line with nothing is left out;\n * each is capped at `cap` items plus \"+N more\", so a hub entry stays short.\n */\nexport function formatEntryLinks(graph: MemoryGraph, id: string, cap = 10): string[] {\n const line = (label: string, ids: string[]) => {\n if (!ids.length) return []\n const more = ids.length > cap ? `, +${ids.length - cap} more` : ''\n return [`${label}: ${ids.slice(0, cap).join(', ')}${more}`]\n }\n return [\n ...line('Links', graph.edges.filter(e => e.from === id).map(e => e.to)),\n ...line('Linked from', graph.edges.filter(e => e.to === id).map(e => e.from)),\n ]\n}\n\nexport const GRAPH_COL_W = 240\nexport const GRAPH_ROW_H = 48\n/** Column per kind: epics and tasks left of the entries, ADRs and docs right of them. */\nconst GRAPH_COL: Record<NodeKind, number> = { epic: -2, task: -1, entry: 0, adr: 1, doc: 2 }\n\n/**\n * Deterministic positions for the graph view (no layout library, no saved positions): entries stacked in the\n * centre column (sorted by type, then id), every other node in its kind's column at the average y of the\n * entries it links with, pushed down to keep one row of space. Same graph → same positions on every load.\n */\nexport function graphLayout(graph: MemoryGraph, entryType: Record<string, string> = {}): Record<string, { x: number; y: number }> {\n const pos: Record<string, { x: number; y: number }> = {}\n const num = (id: string) => Number(id.replace(/\\D/g, '')) || 0\n const entries = graph.nodes.filter(n => n.kind === 'entry')\n .sort((a, b) => (entryType[a.id] ?? '').localeCompare(entryType[b.id] ?? '') || num(a.id) - num(b.id))\n entries.forEach((e, i) => { pos[e.id] = { x: 0, y: i * GRAPH_ROW_H } })\n\n const neighbourYs = new Map<string, number[]>()\n for (const { from, to } of graph.edges) {\n for (const [other, entry] of [[from, to], [to, from]]) {\n if (pos[entry] && !pos[other]) neighbourYs.set(other, [...(neighbourYs.get(other) ?? []), pos[entry].y])\n }\n }\n for (const kind of ['epic', 'task', 'adr', 'doc'] as const) {\n const col = graph.nodes.filter(n => n.kind === kind).map(n => {\n const ys = neighbourYs.get(n.id) ?? [0]\n return { id: n.id, want: ys.reduce((a, b) => a + b, 0) / ys.length }\n }).sort((a, b) => a.want - b.want || a.id.localeCompare(b.id, 'en', { numeric: true }))\n let next = -Infinity\n for (const { id, want } of col) {\n const y = Math.max(want, next)\n pos[id] = { x: GRAPH_COL[kind] * GRAPH_COL_W, y }\n next = y + GRAPH_ROW_H\n }\n }\n return pos\n}\n"],"names":["ENTRY_TYPES","s","SUMMARY_MAX","n","isEntryType","includes","normalizeEntryId","m","Number","exec","trim","nextEntryId","String","padStart","replace","id","ids","max","Math","map","slice","h1","entrySlug","summary","toLowerCase","file","meta","parseEntry","raw","lines","split","i","length","updatedAt","e","type","by","head","formatEntry","body","join","updated","undefined","validateEntryInput","test","fromIds","Set","replaceEntryRefs","text","from","toId","has"],"mappings":"0DQEA,EAAA,EAAA,CAAA,CAAA,QACA,EAAA,EAAA,CAAA,CAAA,QACA,EAAA,EAAA,CAAA,CAAA,QRJA,EAAA,EAAA,CAAA,CAAA,QACA,EAAA,EAAA,CAAA,CAAA,OCEA,EAAA,EAAA,CAAA,CAAA,QAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,QACA,EAAA,EAAA,CAAA,CAAA,QACA,EAAA,EAAA,CAAA,CAAA,QQHO,IAAMA,EAAc,CAAC,aAAc,SAAU,W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