@jlongo78/agent-spaces 0.7.3 → 0.7.5

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 (597) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +7 -0
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +19 -19
  6. package/.next/standalone/.next/routes-manifest.json +42 -0
  7. package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page.js +1 -1
  8. package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page.js.nft.json +1 -1
  9. package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/(desktop)/admin/users/page.js +1 -1
  11. package/.next/standalone/.next/server/app/(desktop)/admin/users/page.js.nft.json +1 -1
  12. package/.next/standalone/.next/server/app/(desktop)/admin/users/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(desktop)/analytics/page.js +1 -1
  14. package/.next/standalone/.next/server/app/(desktop)/analytics/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/(desktop)/analytics/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(desktop)/cortex/page.js +1 -1
  17. package/.next/standalone/.next/server/app/(desktop)/cortex/page.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/(desktop)/cortex/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/(desktop)/network/page.js +1 -1
  20. package/.next/standalone/.next/server/app/(desktop)/network/page.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/(desktop)/network/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/(desktop)/page.js +1 -1
  23. package/.next/standalone/.next/server/app/(desktop)/page.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/(desktop)/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/(desktop)/projects/page.js +1 -1
  26. package/.next/standalone/.next/server/app/(desktop)/projects/page.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/(desktop)/projects/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page.js +1 -1
  29. package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page_client-reference-manifest.js +1 -1
  31. package/.next/standalone/.next/server/app/(desktop)/sessions/page.js +1 -1
  32. package/.next/standalone/.next/server/app/(desktop)/sessions/page.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/(desktop)/sessions/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/(desktop)/settings/page.js +1 -1
  35. package/.next/standalone/.next/server/app/(desktop)/settings/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/(desktop)/settings/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/(desktop)/terminal/page.js +1 -1
  38. package/.next/standalone/.next/server/app/(desktop)/terminal/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/(desktop)/terminal/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page.js +1 -1
  41. package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page.js +1 -1
  44. package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/(desktop)/workspaces/page.js +1 -1
  47. package/.next/standalone/.next/server/app/(desktop)/workspaces/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/(desktop)/workspaces/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  50. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  51. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  52. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  53. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  54. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  55. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  56. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  58. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  59. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  60. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  61. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  62. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  63. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  64. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  65. package/.next/standalone/.next/server/app/admin/analytics.html +1 -1
  66. package/.next/standalone/.next/server/app/admin/analytics.rsc +17 -16
  67. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics/__PAGE__.segment.rsc +2 -2
  68. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics.segment.rsc +1 -1
  69. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
  70. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  71. package/.next/standalone/.next/server/app/admin/analytics.segments/_full.segment.rsc +17 -16
  72. package/.next/standalone/.next/server/app/admin/analytics.segments/_head.segment.rsc +1 -1
  73. package/.next/standalone/.next/server/app/admin/analytics.segments/_index.segment.rsc +2 -2
  74. package/.next/standalone/.next/server/app/admin/analytics.segments/_tree.segment.rsc +2 -2
  75. package/.next/standalone/.next/server/app/admin/users.html +1 -1
  76. package/.next/standalone/.next/server/app/admin/users.rsc +17 -16
  77. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users/__PAGE__.segment.rsc +2 -2
  78. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users.segment.rsc +1 -1
  79. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
  80. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  81. package/.next/standalone/.next/server/app/admin/users.segments/_full.segment.rsc +17 -16
  82. package/.next/standalone/.next/server/app/admin/users.segments/_head.segment.rsc +1 -1
  83. package/.next/standalone/.next/server/app/admin/users.segments/_index.segment.rsc +2 -2
  84. package/.next/standalone/.next/server/app/admin/users.segments/_tree.segment.rsc +2 -2
  85. package/.next/standalone/.next/server/app/analytics.html +1 -1
  86. package/.next/standalone/.next/server/app/analytics.rsc +17 -16
  87. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics/__PAGE__.segment.rsc +2 -2
  88. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics.segment.rsc +1 -1
  89. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  90. package/.next/standalone/.next/server/app/analytics.segments/_full.segment.rsc +17 -16
  91. package/.next/standalone/.next/server/app/analytics.segments/_head.segment.rsc +1 -1
  92. package/.next/standalone/.next/server/app/analytics.segments/_index.segment.rsc +2 -2
  93. package/.next/standalone/.next/server/app/analytics.segments/_tree.segment.rsc +2 -2
  94. package/.next/standalone/.next/server/app/api/analytics/overview/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/bulk/route.js.nft.json +1 -1
  96. package/.next/standalone/.next/server/app/api/chat/route.js +1 -1
  97. package/.next/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  98. package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/cortex/context/route.js.nft.json +1 -1
  100. package/.next/standalone/.next/server/app/api/cortex/curation/assess/route/app-paths-manifest.json +3 -0
  101. package/.next/standalone/.next/server/app/api/cortex/curation/assess/route/build-manifest.json +11 -0
  102. package/.next/standalone/.next/server/app/api/cortex/curation/assess/route/server-reference-manifest.json +4 -0
  103. package/.next/standalone/.next/server/app/api/cortex/curation/assess/route.js +7 -0
  104. package/.next/standalone/.next/server/app/api/cortex/curation/assess/route.js.map +5 -0
  105. package/.next/standalone/.next/server/app/api/cortex/curation/assess/route.js.nft.json +1 -0
  106. package/.next/standalone/.next/server/app/api/cortex/curation/assess/route_client-reference-manifest.js +2 -0
  107. package/.next/standalone/.next/server/app/api/cortex/curation/publish/route/app-paths-manifest.json +3 -0
  108. package/.next/standalone/.next/server/app/api/cortex/curation/publish/route/build-manifest.json +11 -0
  109. package/.next/standalone/.next/server/app/api/cortex/curation/publish/route/server-reference-manifest.json +4 -0
  110. package/.next/standalone/.next/server/app/api/cortex/curation/publish/route.js +7 -0
  111. package/.next/standalone/.next/server/app/api/cortex/curation/publish/route.js.map +5 -0
  112. package/.next/standalone/.next/server/app/api/cortex/curation/publish/route.js.nft.json +1 -0
  113. package/.next/standalone/.next/server/app/api/cortex/curation/publish/route_client-reference-manifest.js +2 -0
  114. package/.next/standalone/.next/server/app/api/cortex/curation/refine/route/app-paths-manifest.json +3 -0
  115. package/.next/standalone/.next/server/app/api/cortex/curation/refine/route/build-manifest.json +11 -0
  116. package/.next/standalone/.next/server/app/api/cortex/curation/refine/route/server-reference-manifest.json +4 -0
  117. package/.next/standalone/.next/server/app/api/cortex/curation/refine/route.js +7 -0
  118. package/.next/standalone/.next/server/app/api/cortex/curation/refine/route.js.map +5 -0
  119. package/.next/standalone/.next/server/app/api/cortex/curation/refine/route.js.nft.json +1 -0
  120. package/.next/standalone/.next/server/app/api/cortex/curation/refine/route_client-reference-manifest.js +2 -0
  121. package/.next/standalone/.next/server/app/api/cortex/curation/review/route/app-paths-manifest.json +3 -0
  122. package/.next/standalone/.next/server/app/api/cortex/curation/review/route/build-manifest.json +11 -0
  123. package/.next/standalone/.next/server/app/api/cortex/curation/review/route/server-reference-manifest.json +4 -0
  124. package/.next/standalone/.next/server/app/api/cortex/curation/review/route.js +7 -0
  125. package/.next/standalone/.next/server/app/api/cortex/curation/review/route.js.map +5 -0
  126. package/.next/standalone/.next/server/app/api/cortex/curation/review/route.js.nft.json +1 -0
  127. package/.next/standalone/.next/server/app/api/cortex/curation/review/route_client-reference-manifest.js +2 -0
  128. package/.next/standalone/.next/server/app/api/cortex/curation/seed/route/app-paths-manifest.json +3 -0
  129. package/.next/standalone/.next/server/app/api/cortex/curation/seed/route/build-manifest.json +11 -0
  130. package/.next/standalone/.next/server/app/api/cortex/curation/seed/route/server-reference-manifest.json +4 -0
  131. package/.next/standalone/.next/server/app/api/cortex/curation/seed/route.js +7 -0
  132. package/.next/standalone/.next/server/app/api/cortex/curation/seed/route.js.map +5 -0
  133. package/.next/standalone/.next/server/app/api/cortex/curation/seed/route.js.nft.json +1 -0
  134. package/.next/standalone/.next/server/app/api/cortex/curation/seed/route_client-reference-manifest.js +2 -0
  135. package/.next/standalone/.next/server/app/api/cortex/export/route.js.nft.json +1 -1
  136. package/.next/standalone/.next/server/app/api/cortex/federation/pending/route.js.nft.json +1 -1
  137. package/.next/standalone/.next/server/app/api/cortex/federation/resolve/route.js.nft.json +1 -1
  138. package/.next/standalone/.next/server/app/api/cortex/federation/search/route.js.nft.json +1 -1
  139. package/.next/standalone/.next/server/app/api/cortex/federation/teach/route.js.nft.json +1 -1
  140. package/.next/standalone/.next/server/app/api/cortex/graph/edges/route.js.nft.json +1 -1
  141. package/.next/standalone/.next/server/app/api/cortex/graph/entities/[id]/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/cortex/graph/entities/route.js.nft.json +1 -1
  143. package/.next/standalone/.next/server/app/api/cortex/graph/populate/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/cortex/import/route.js.nft.json +1 -1
  145. package/.next/standalone/.next/server/app/api/cortex/import/status/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/cortex/ingest/bootstrap/route.js.nft.json +1 -1
  147. package/.next/standalone/.next/server/app/api/cortex/ingest/status/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/cortex/knowledge/[id]/route.js.nft.json +1 -1
  149. package/.next/standalone/.next/server/app/api/cortex/knowledge/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/cortex/lobes/[id]/route.js.nft.json +1 -1
  151. package/.next/standalone/.next/server/app/api/cortex/lobes/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/cortex/lobes/share/route.js.nft.json +1 -1
  153. package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route/app-paths-manifest.json +3 -0
  154. package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route/build-manifest.json +11 -0
  155. package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route/server-reference-manifest.json +4 -0
  156. package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route.js +7 -0
  157. package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route.js.map +5 -0
  158. package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route.js.nft.json +1 -0
  159. package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route_client-reference-manifest.js +2 -0
  160. package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route/app-paths-manifest.json +3 -0
  161. package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route/build-manifest.json +11 -0
  162. package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route/server-reference-manifest.json +4 -0
  163. package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route.js +7 -0
  164. package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route.js.map +5 -0
  165. package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route.js.nft.json +1 -0
  166. package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route_client-reference-manifest.js +2 -0
  167. package/.next/standalone/.next/server/app/api/cortex/mcp/call/route.js.nft.json +1 -1
  168. package/.next/standalone/.next/server/app/api/cortex/mcp/tools/route.js.nft.json +1 -1
  169. package/.next/standalone/.next/server/app/api/cortex/search/route.js.nft.json +1 -1
  170. package/.next/standalone/.next/server/app/api/cortex/settings/route.js.nft.json +1 -1
  171. package/.next/standalone/.next/server/app/api/cortex/status/route.js.nft.json +1 -1
  172. package/.next/standalone/.next/server/app/api/cortex/timeline/route.js.nft.json +1 -1
  173. package/.next/standalone/.next/server/app/api/cortex/usage/route.js.nft.json +1 -1
  174. package/.next/standalone/.next/server/app/api/cortex/workspace/[id]/context/route.js.nft.json +1 -1
  175. package/.next/standalone/.next/server/app/api/events/route.js.nft.json +1 -1
  176. package/.next/standalone/.next/server/app/api/folders/route.js.nft.json +1 -1
  177. package/.next/standalone/.next/server/app/api/network/handshake/route.js.nft.json +1 -1
  178. package/.next/standalone/.next/server/app/api/network/projects/route.js.nft.json +1 -1
  179. package/.next/standalone/.next/server/app/api/network/search/route.js.nft.json +1 -1
  180. package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js.nft.json +1 -1
  181. package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js.nft.json +1 -1
  182. package/.next/standalone/.next/server/app/api/network/sessions/route.js.nft.json +1 -1
  183. package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js.nft.json +1 -1
  184. package/.next/standalone/.next/server/app/api/network/workspaces/route.js +1 -1
  185. package/.next/standalone/.next/server/app/api/network/workspaces/route.js.nft.json +1 -1
  186. package/.next/standalone/.next/server/app/api/panes/[id]/route.js.nft.json +1 -1
  187. package/.next/standalone/.next/server/app/api/panes/route.js.nft.json +1 -1
  188. package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  189. package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  190. package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js.nft.json +1 -1
  191. package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js.nft.json +1 -1
  192. package/.next/standalone/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  193. package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
  194. package/.next/standalone/.next/server/app/api/sync/route.js.nft.json +1 -1
  195. package/.next/standalone/.next/server/app/api/tags/route.js.nft.json +1 -1
  196. package/.next/standalone/.next/server/app/api/tier/route.js.nft.json +1 -1
  197. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js.nft.json +1 -1
  198. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js.nft.json +1 -1
  199. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js.nft.json +1 -1
  200. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js.nft.json +1 -1
  201. package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js.nft.json +1 -1
  202. package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js.nft.json +1 -1
  203. package/.next/standalone/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  204. package/.next/standalone/.next/server/app/cortex.html +1 -1
  205. package/.next/standalone/.next/server/app/cortex.rsc +17 -16
  206. package/.next/standalone/.next/server/app/cortex.segments/!KGRlc2t0b3Ap/cortex/__PAGE__.segment.rsc +2 -2
  207. package/.next/standalone/.next/server/app/cortex.segments/!KGRlc2t0b3Ap/cortex.segment.rsc +1 -1
  208. package/.next/standalone/.next/server/app/cortex.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  209. package/.next/standalone/.next/server/app/cortex.segments/_full.segment.rsc +17 -16
  210. package/.next/standalone/.next/server/app/cortex.segments/_head.segment.rsc +1 -1
  211. package/.next/standalone/.next/server/app/cortex.segments/_index.segment.rsc +2 -2
  212. package/.next/standalone/.next/server/app/cortex.segments/_tree.segment.rsc +2 -2
  213. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  214. package/.next/standalone/.next/server/app/login.html +1 -1
  215. package/.next/standalone/.next/server/app/login.rsc +2 -2
  216. package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +2 -2
  217. package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
  218. package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +2 -2
  219. package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  220. package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  221. package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
  222. package/.next/standalone/.next/server/app/m/page.js.nft.json +1 -1
  223. package/.next/standalone/.next/server/app/m/page_client-reference-manifest.js +1 -1
  224. package/.next/standalone/.next/server/app/m/projects/page.js.nft.json +1 -1
  225. package/.next/standalone/.next/server/app/m/projects/page_client-reference-manifest.js +1 -1
  226. package/.next/standalone/.next/server/app/m/projects.html +1 -1
  227. package/.next/standalone/.next/server/app/m/projects.rsc +4 -4
  228. package/.next/standalone/.next/server/app/m/projects.segments/_full.segment.rsc +4 -4
  229. package/.next/standalone/.next/server/app/m/projects.segments/_head.segment.rsc +1 -1
  230. package/.next/standalone/.next/server/app/m/projects.segments/_index.segment.rsc +2 -2
  231. package/.next/standalone/.next/server/app/m/projects.segments/_tree.segment.rsc +2 -2
  232. package/.next/standalone/.next/server/app/m/projects.segments/m/projects/__PAGE__.segment.rsc +2 -2
  233. package/.next/standalone/.next/server/app/m/projects.segments/m/projects.segment.rsc +1 -1
  234. package/.next/standalone/.next/server/app/m/projects.segments/m.segment.rsc +2 -2
  235. package/.next/standalone/.next/server/app/m/sessions/[id]/page.js.nft.json +1 -1
  236. package/.next/standalone/.next/server/app/m/sessions/[id]/page_client-reference-manifest.js +1 -1
  237. package/.next/standalone/.next/server/app/m/sessions/page.js.nft.json +1 -1
  238. package/.next/standalone/.next/server/app/m/sessions/page_client-reference-manifest.js +1 -1
  239. package/.next/standalone/.next/server/app/m/sessions.html +1 -1
  240. package/.next/standalone/.next/server/app/m/sessions.rsc +4 -4
  241. package/.next/standalone/.next/server/app/m/sessions.segments/_full.segment.rsc +4 -4
  242. package/.next/standalone/.next/server/app/m/sessions.segments/_head.segment.rsc +1 -1
  243. package/.next/standalone/.next/server/app/m/sessions.segments/_index.segment.rsc +2 -2
  244. package/.next/standalone/.next/server/app/m/sessions.segments/_tree.segment.rsc +2 -2
  245. package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions/__PAGE__.segment.rsc +2 -2
  246. package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions.segment.rsc +1 -1
  247. package/.next/standalone/.next/server/app/m/sessions.segments/m.segment.rsc +2 -2
  248. package/.next/standalone/.next/server/app/m/settings/page.js.nft.json +1 -1
  249. package/.next/standalone/.next/server/app/m/settings/page_client-reference-manifest.js +1 -1
  250. package/.next/standalone/.next/server/app/m/settings.html +1 -1
  251. package/.next/standalone/.next/server/app/m/settings.rsc +4 -4
  252. package/.next/standalone/.next/server/app/m/settings.segments/_full.segment.rsc +4 -4
  253. package/.next/standalone/.next/server/app/m/settings.segments/_head.segment.rsc +1 -1
  254. package/.next/standalone/.next/server/app/m/settings.segments/_index.segment.rsc +2 -2
  255. package/.next/standalone/.next/server/app/m/settings.segments/_tree.segment.rsc +2 -2
  256. package/.next/standalone/.next/server/app/m/settings.segments/m/settings/__PAGE__.segment.rsc +2 -2
  257. package/.next/standalone/.next/server/app/m/settings.segments/m/settings.segment.rsc +1 -1
  258. package/.next/standalone/.next/server/app/m/settings.segments/m.segment.rsc +2 -2
  259. package/.next/standalone/.next/server/app/m/terminal/page.js.nft.json +1 -1
  260. package/.next/standalone/.next/server/app/m/terminal/page_client-reference-manifest.js +1 -1
  261. package/.next/standalone/.next/server/app/m/terminal.html +1 -1
  262. package/.next/standalone/.next/server/app/m/terminal.rsc +4 -4
  263. package/.next/standalone/.next/server/app/m/terminal.segments/_full.segment.rsc +4 -4
  264. package/.next/standalone/.next/server/app/m/terminal.segments/_head.segment.rsc +1 -1
  265. package/.next/standalone/.next/server/app/m/terminal.segments/_index.segment.rsc +2 -2
  266. package/.next/standalone/.next/server/app/m/terminal.segments/_tree.segment.rsc +2 -2
  267. package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal/__PAGE__.segment.rsc +2 -2
  268. package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal.segment.rsc +1 -1
  269. package/.next/standalone/.next/server/app/m/terminal.segments/m.segment.rsc +2 -2
  270. package/.next/standalone/.next/server/app/m.html +1 -1
  271. package/.next/standalone/.next/server/app/m.rsc +4 -4
  272. package/.next/standalone/.next/server/app/m.segments/_full.segment.rsc +4 -4
  273. package/.next/standalone/.next/server/app/m.segments/_head.segment.rsc +1 -1
  274. package/.next/standalone/.next/server/app/m.segments/_index.segment.rsc +2 -2
  275. package/.next/standalone/.next/server/app/m.segments/_tree.segment.rsc +2 -2
  276. package/.next/standalone/.next/server/app/m.segments/m/__PAGE__.segment.rsc +2 -2
  277. package/.next/standalone/.next/server/app/m.segments/m.segment.rsc +2 -2
  278. package/.next/standalone/.next/server/app/network.html +1 -1
  279. package/.next/standalone/.next/server/app/network.rsc +17 -16
  280. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network/__PAGE__.segment.rsc +2 -2
  281. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network.segment.rsc +1 -1
  282. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  283. package/.next/standalone/.next/server/app/network.segments/_full.segment.rsc +17 -16
  284. package/.next/standalone/.next/server/app/network.segments/_head.segment.rsc +1 -1
  285. package/.next/standalone/.next/server/app/network.segments/_index.segment.rsc +2 -2
  286. package/.next/standalone/.next/server/app/network.segments/_tree.segment.rsc +2 -2
  287. package/.next/standalone/.next/server/app/projects.html +1 -1
  288. package/.next/standalone/.next/server/app/projects.rsc +17 -16
  289. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects/__PAGE__.segment.rsc +2 -2
  290. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects.segment.rsc +1 -1
  291. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  292. package/.next/standalone/.next/server/app/projects.segments/_full.segment.rsc +17 -16
  293. package/.next/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
  294. package/.next/standalone/.next/server/app/projects.segments/_index.segment.rsc +2 -2
  295. package/.next/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
  296. package/.next/standalone/.next/server/app/sessions.html +1 -1
  297. package/.next/standalone/.next/server/app/sessions.rsc +17 -16
  298. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions/__PAGE__.segment.rsc +2 -2
  299. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions.segment.rsc +1 -1
  300. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  301. package/.next/standalone/.next/server/app/sessions.segments/_full.segment.rsc +17 -16
  302. package/.next/standalone/.next/server/app/sessions.segments/_head.segment.rsc +1 -1
  303. package/.next/standalone/.next/server/app/sessions.segments/_index.segment.rsc +2 -2
  304. package/.next/standalone/.next/server/app/sessions.segments/_tree.segment.rsc +2 -2
  305. package/.next/standalone/.next/server/app/settings.html +1 -1
  306. package/.next/standalone/.next/server/app/settings.rsc +17 -16
  307. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings/__PAGE__.segment.rsc +2 -2
  308. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings.segment.rsc +1 -1
  309. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  310. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +17 -16
  311. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  312. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  313. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  314. package/.next/standalone/.next/server/app/terminal.html +1 -1
  315. package/.next/standalone/.next/server/app/terminal.rsc +17 -16
  316. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal/__PAGE__.segment.rsc +2 -2
  317. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal.segment.rsc +1 -1
  318. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  319. package/.next/standalone/.next/server/app/terminal.segments/_full.segment.rsc +17 -16
  320. package/.next/standalone/.next/server/app/terminal.segments/_head.segment.rsc +1 -1
  321. package/.next/standalone/.next/server/app/terminal.segments/_index.segment.rsc +2 -2
  322. package/.next/standalone/.next/server/app/terminal.segments/_tree.segment.rsc +2 -2
  323. package/.next/standalone/.next/server/app/workspaces.html +1 -1
  324. package/.next/standalone/.next/server/app/workspaces.rsc +17 -16
  325. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces/__PAGE__.segment.rsc +2 -2
  326. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces.segment.rsc +1 -1
  327. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap.segment.rsc +5 -4
  328. package/.next/standalone/.next/server/app/workspaces.segments/_full.segment.rsc +17 -16
  329. package/.next/standalone/.next/server/app/workspaces.segments/_head.segment.rsc +1 -1
  330. package/.next/standalone/.next/server/app/workspaces.segments/_index.segment.rsc +2 -2
  331. package/.next/standalone/.next/server/app/workspaces.segments/_tree.segment.rsc +2 -2
  332. package/.next/standalone/.next/server/app-paths-manifest.json +7 -0
  333. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0041efe4._.js +98 -0
  334. package/.next/standalone/.next/server/chunks/[root-of-the-server]__00bf0ace._.js +2 -2
  335. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e71d908._.js +2 -2
  336. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e9142f3._.js +2 -2
  337. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10e47926._.js +1 -1
  338. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1665dc78._.js +2 -2
  339. package/.next/standalone/.next/server/chunks/[root-of-the-server]__175cbabf._.js +2 -2
  340. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1adae357._.js +2 -2
  341. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1d359752._.js +2 -2
  342. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1e8fabeb._.js +3 -3
  343. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1f8deca0._.js +8 -8
  344. package/.next/standalone/.next/server/chunks/[root-of-the-server]__253fdda1._.js +2 -2
  345. package/.next/standalone/.next/server/chunks/[root-of-the-server]__28e6434f._.js +2 -2
  346. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2a386564._.js +1 -1
  347. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2c20fb38._.js +2 -2
  348. package/.next/standalone/.next/server/chunks/[root-of-the-server]__309132cd._.js +1 -1
  349. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__cf3c60c2._.js → [root-of-the-server]__33fec964._.js} +4 -4
  350. package/.next/standalone/.next/server/chunks/[root-of-the-server]__3786d8ae._.js +1 -1
  351. package/.next/standalone/.next/server/chunks/[root-of-the-server]__3ae92407._.js +2 -2
  352. package/.next/standalone/.next/server/chunks/[root-of-the-server]__3beda9fe._.js +2 -2
  353. package/.next/standalone/.next/server/chunks/[root-of-the-server]__4619e9bd._.js +1 -1
  354. package/.next/standalone/.next/server/chunks/[root-of-the-server]__4a051043._.js +1 -1
  355. package/.next/standalone/.next/server/chunks/[root-of-the-server]__508002e4._.js +2 -2
  356. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5086c373._.js +2 -2
  357. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5913e097._.js +2 -2
  358. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5b5f68d2._.js +2 -2
  359. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5c1f2459._.js +2 -2
  360. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5ec8c977._.js +2 -2
  361. package/.next/standalone/.next/server/chunks/[root-of-the-server]__63cebc6c._.js +98 -0
  362. package/.next/standalone/.next/server/chunks/[root-of-the-server]__64d30d4d._.js +2 -2
  363. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6c54fc2e._.js +2 -2
  364. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6dc1fb7e._.js +1 -1
  365. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6e568102._.js +1 -1
  366. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6faa04c0._.js +2 -2
  367. package/.next/standalone/.next/server/chunks/[root-of-the-server]__74a34dc3._.js +98 -0
  368. package/.next/standalone/.next/server/chunks/[root-of-the-server]__7e7250a4._.js +3 -3
  369. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8309e0a4._.js +2 -2
  370. package/.next/standalone/.next/server/chunks/[root-of-the-server]__86cc0e2b._.js +6 -6
  371. package/.next/standalone/.next/server/chunks/[root-of-the-server]__89c2565a._.js +2 -2
  372. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8d178ad9._.js +2 -2
  373. package/.next/standalone/.next/server/chunks/[root-of-the-server]__93ee06f3._.js +3 -3
  374. package/.next/standalone/.next/server/chunks/[root-of-the-server]__9e4c154a._.js +2 -2
  375. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a9d2e1d3._.js +2 -2
  376. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ae53d343._.js +2 -2
  377. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b3a04cef._.js +2 -2
  378. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4270b77._.js +3 -0
  379. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b6b6ce60._.js +1 -1
  380. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b9545dd9._.js +1 -1
  381. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c88b63f7._.js +98 -0
  382. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__eee4c5e8._.js → [root-of-the-server]__cba5f007._.js} +2 -2
  383. package/.next/standalone/.next/server/chunks/[root-of-the-server]__cbf4ceb0._.js +2 -2
  384. package/.next/standalone/.next/server/chunks/[root-of-the-server]__cefdba2f._.js +2 -2
  385. package/.next/standalone/.next/server/chunks/[root-of-the-server]__cf9e82bb._.js +2 -2
  386. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d2897392._.js +2 -2
  387. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d3b2d856._.js +2 -2
  388. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d73273ca._.js +1 -1
  389. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d8417eb6._.js +2 -2
  390. package/.next/standalone/.next/server/chunks/[root-of-the-server]__dc2a55de._.js +2 -2
  391. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e0d4690b._.js +3 -3
  392. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e678dd53._.js +3 -0
  393. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e9223f55._.js +2 -2
  394. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ea630076._.js +3 -3
  395. package/.next/standalone/.next/server/chunks/[root-of-the-server]__eb8acb65._.js +1 -1
  396. package/.next/standalone/.next/server/chunks/[root-of-the-server]__f26ca49d._.js +1 -1
  397. package/.next/standalone/.next/server/chunks/[root-of-the-server]__f33e1101._.js +1 -1
  398. package/.next/standalone/.next/server/chunks/[root-of-the-server]__f515f865._.js +2 -2
  399. package/.next/standalone/.next/server/chunks/[root-of-the-server]__fceb5d60._.js +98 -0
  400. package/.next/standalone/.next/server/chunks/[root-of-the-server]__fed41403._.js +2 -2
  401. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ff2e98c2._.js +2 -2
  402. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_cortex_curation_assess_route_actions_3e8ef2a6.js +3 -0
  403. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_cortex_curation_publish_route_actions_49238be3.js +3 -0
  404. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_cortex_curation_refine_route_actions_05675688.js +3 -0
  405. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_cortex_curation_review_route_actions_5cbb5f6b.js +3 -0
  406. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_cortex_curation_seed_route_actions_21084bdb.js +3 -0
  407. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_cortex_marketplace_browse_route_actions_7ed0768c.js +3 -0
  408. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_cortex_marketplace_preview_route_actions_38d4cc17.js +3 -0
  409. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__19afc53d._.js +3 -0
  410. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__66aca5d4._.js +1 -1
  411. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__efef0a06._.js → [root-of-the-server]__ca5beb09._.js} +2 -2
  412. package/.next/standalone/.next/server/chunks/ssr/{_7dd2ac82._.js → _078dd64d._.js} +1 -1
  413. package/.next/standalone/.next/server/chunks/ssr/_163d0838._.js +3 -0
  414. package/.next/standalone/.next/server/chunks/ssr/{_a4eeff0d._.js → _2230ad2d._.js} +2 -2
  415. package/.next/standalone/.next/server/chunks/ssr/{_9303a965._.js → _701606d5._.js} +1 -1
  416. package/.next/standalone/.next/server/chunks/ssr/_72b1de37._.js +3 -0
  417. package/.next/standalone/.next/server/chunks/ssr/{_d39bcfda._.js → _93ef0f79._.js} +2 -2
  418. package/.next/standalone/.next/server/chunks/ssr/_950142a4._.js +1 -1
  419. package/.next/standalone/.next/server/chunks/ssr/_a22b5eb0._.js +3 -0
  420. package/.next/standalone/.next/server/chunks/ssr/_aeeff784._.js +3 -0
  421. package/.next/standalone/.next/server/chunks/ssr/_c1cfdd09._.js +3 -0
  422. package/.next/standalone/.next/server/chunks/ssr/_c2d3f6de._.js +3 -0
  423. package/.next/standalone/.next/server/chunks/ssr/{_8167090e._.js → _db2fec84._.js} +2 -2
  424. package/.next/standalone/.next/server/chunks/ssr/src_02bae6e5._.js +3 -0
  425. package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_terminal_page_tsx_de5e8d85._.js +2 -2
  426. package/.next/standalone/.next/server/chunks/ssr/src_components_terminal_terminal-pane_tsx_803c5e2c._.js +2 -2
  427. package/.next/standalone/.next/server/edge/chunks/_d73df637._.js +1 -1
  428. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  429. package/.next/standalone/.next/server/pages/404.html +1 -1
  430. package/.next/standalone/.next/server/pages/500.html +2 -2
  431. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  432. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  433. package/.next/standalone/.next/static/chunks/25b7a243a404a1a7.js +1 -0
  434. package/.next/standalone/.next/static/chunks/2b997e211a5d547b.js +1 -0
  435. package/.next/standalone/.next/static/chunks/5e08abb00653754a.js +1 -0
  436. package/.next/standalone/.next/static/chunks/61f2ed39b75b1efc.js +1 -0
  437. package/.next/standalone/.next/static/chunks/6c78a1dfa7ec2959.css +3 -0
  438. package/.next/standalone/.next/static/chunks/7246f1ee445f7024.js +1 -0
  439. package/.next/standalone/.next/static/chunks/7424664c6ffa94bd.js +1 -0
  440. package/.next/standalone/.next/static/chunks/7e0091ab6c5ee8bd.js +1 -0
  441. package/.next/standalone/.next/static/chunks/8b3f4572fec83caa.js +5 -0
  442. package/.next/standalone/.next/static/chunks/{a7b2795949a6c63e.js → 9899cf4c2bdbe61d.js} +2 -2
  443. package/.next/standalone/.next/static/chunks/ac339e970df82fa5.js +5 -0
  444. package/.next/standalone/.next/static/chunks/{0e61e67b7b8fc3f3.js → c418112e102673ce.js} +1 -1
  445. package/.next/standalone/.next/static/chunks/e2f0a2330dedff4b.js +85 -0
  446. package/.next/standalone/.next/static/chunks/f0c8b3f8cc1939ec.js +1 -0
  447. package/.next/standalone/.next/static/chunks/f9f2628207848ac2.js +1 -0
  448. package/.next/standalone/bin/cortex-hook.sh +62 -62
  449. package/.next/standalone/bin/cortex-mcp.js +60 -60
  450. package/.next/standalone/docs/superpowers/plans/2026-03-13-cortex-wiring.md +1387 -1387
  451. package/.next/standalone/docs/superpowers/plans/2026-03-14-cortex-v2-entity-graph.md +1923 -1923
  452. package/.next/standalone/docs/superpowers/plans/2026-03-14-cortex-v2-knowledge-evolution.md +1113 -1113
  453. package/.next/standalone/docs/superpowers/plans/2026-03-15-cortex-v2-boundary-engine.md +853 -853
  454. package/.next/standalone/docs/superpowers/plans/2026-03-15-cortex-v2-context-engine.md +1274 -1274
  455. package/.next/standalone/docs/superpowers/plans/2026-03-15-cortex-v2-signal-ingestion.md +933 -933
  456. package/.next/standalone/docs/superpowers/plans/2026-03-16-cortex-lobes.md +1080 -1080
  457. package/.next/standalone/docs/superpowers/plans/2026-03-16-cortex-v2-gravity-system.md +768 -768
  458. package/.next/standalone/docs/superpowers/plans/2026-03-16-cortex-v2-ui.md +1108 -1108
  459. package/.next/standalone/docs/superpowers/plans/2026-03-18-cortex-ui-integration.md +1846 -0
  460. package/.next/standalone/docs/superpowers/specs/2026-03-13-cortex-wiring-design.md +268 -268
  461. package/.next/standalone/docs/superpowers/specs/2026-03-14-cortex-v2-design.md +623 -623
  462. package/.next/standalone/docs/superpowers/specs/2026-03-16-cortex-lobes-design.md +263 -263
  463. package/.next/standalone/docs/superpowers/specs/2026-03-16-cortex-v2-ui-design.md +240 -240
  464. package/.next/standalone/docs/superpowers/specs/2026-03-18-cortex-ui-integration-design.md +341 -0
  465. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +46 -0
  466. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  467. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +1 -0
  468. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  469. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +42 -0
  470. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +46 -0
  471. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  472. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  473. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  474. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  475. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  476. package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  477. package/.next/standalone/node_modules/@img/{sharp-win32-x64 → sharp-linux-x64}/package.json +46 -39
  478. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  479. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  480. package/.next/standalone/package.json +102 -102
  481. package/.next/standalone/server.js +1 -1
  482. package/.next/standalone/src/app/(desktop)/cortex/page.tsx +78 -75
  483. package/.next/standalone/src/app/api/cortex/context/route.ts +78 -78
  484. package/.next/standalone/src/app/api/cortex/curation/assess/route.ts +27 -0
  485. package/.next/standalone/src/app/api/cortex/curation/publish/route.ts +23 -0
  486. package/.next/standalone/src/app/api/cortex/curation/refine/route.ts +23 -0
  487. package/.next/standalone/src/app/api/cortex/curation/review/route.ts +29 -0
  488. package/.next/standalone/src/app/api/cortex/curation/seed/route.ts +23 -0
  489. package/.next/standalone/src/app/api/cortex/export/route.ts +40 -40
  490. package/.next/standalone/src/app/api/cortex/federation/pending/route.ts +20 -20
  491. package/.next/standalone/src/app/api/cortex/federation/resolve/route.ts +43 -43
  492. package/.next/standalone/src/app/api/cortex/federation/search/route.ts +35 -35
  493. package/.next/standalone/src/app/api/cortex/federation/teach/route.ts +76 -76
  494. package/.next/standalone/src/app/api/cortex/graph/edges/route.ts +112 -112
  495. package/.next/standalone/src/app/api/cortex/graph/entities/[id]/route.ts +73 -73
  496. package/.next/standalone/src/app/api/cortex/graph/entities/route.ts +75 -75
  497. package/.next/standalone/src/app/api/cortex/graph/populate/route.ts +203 -203
  498. package/.next/standalone/src/app/api/cortex/import/route.ts +75 -43
  499. package/.next/standalone/src/app/api/cortex/import/status/route.ts +15 -15
  500. package/.next/standalone/src/app/api/cortex/ingest/bootstrap/route.ts +29 -29
  501. package/.next/standalone/src/app/api/cortex/ingest/status/route.ts +15 -15
  502. package/.next/standalone/src/app/api/cortex/knowledge/[id]/route.ts +91 -91
  503. package/.next/standalone/src/app/api/cortex/knowledge/route.ts +93 -93
  504. package/.next/standalone/src/app/api/cortex/lobes/[id]/route.ts +67 -67
  505. package/.next/standalone/src/app/api/cortex/lobes/route.ts +22 -22
  506. package/.next/standalone/src/app/api/cortex/lobes/share/route.ts +80 -80
  507. package/.next/standalone/src/app/api/cortex/marketplace/browse/route.ts +43 -0
  508. package/.next/standalone/src/app/api/cortex/marketplace/preview/route.ts +46 -0
  509. package/.next/standalone/src/app/api/cortex/mcp/call/route.ts +11 -11
  510. package/.next/standalone/src/app/api/cortex/mcp/tools/route.ts +6 -6
  511. package/.next/standalone/src/app/api/cortex/search/route.ts +43 -43
  512. package/.next/standalone/src/app/api/cortex/settings/route.ts +33 -33
  513. package/.next/standalone/src/app/api/cortex/status/route.ts +169 -129
  514. package/.next/standalone/src/app/api/cortex/timeline/route.ts +42 -42
  515. package/.next/standalone/src/app/api/cortex/usage/route.ts +31 -31
  516. package/.next/standalone/src/app/api/cortex/workspace/[id]/context/route.ts +41 -41
  517. package/.next/standalone/src/components/cortex/constants.ts +29 -0
  518. package/.next/standalone/src/components/cortex/cortex-dashboard.tsx +304 -228
  519. package/.next/standalone/src/components/cortex/cortex-indicator.tsx +44 -44
  520. package/.next/standalone/src/components/cortex/cortex-panel.tsx +140 -140
  521. package/.next/standalone/src/components/cortex/cortex-settings.tsx +221 -221
  522. package/.next/standalone/src/components/cortex/curation-tab.tsx +810 -0
  523. package/.next/standalone/src/components/cortex/entity-detail.tsx +101 -101
  524. package/.next/standalone/src/components/cortex/entity-graph.tsx +382 -382
  525. package/.next/standalone/src/components/cortex/import-dialog.tsx +212 -0
  526. package/.next/standalone/src/components/cortex/injection-badge.tsx +72 -72
  527. package/.next/standalone/src/components/cortex/knowledge-card.tsx +109 -127
  528. package/.next/standalone/src/components/cortex/knowledge-tab.tsx +158 -56
  529. package/.next/standalone/src/components/cortex/lobe-settings.tsx +215 -199
  530. package/.next/standalone/src/components/cortex/marketplace-card.tsx +126 -0
  531. package/.next/standalone/src/components/cortex/marketplace-tab.tsx +113 -0
  532. package/.next/standalone/src/lib/cortex/config.ts +40 -40
  533. package/.next/standalone/src/lib/cortex/debug.ts +10 -10
  534. package/.next/standalone/src/lib/cortex/distillation/usage-store.ts +18 -18
  535. package/.next/standalone/src/lib/cortex/graph/resolver.ts +10 -10
  536. package/.next/standalone/src/lib/cortex/graph/types.ts +22 -22
  537. package/.next/standalone/src/lib/cortex/index.ts +56 -56
  538. package/.next/standalone/src/lib/cortex/ingestion/bootstrap.ts +14 -14
  539. package/.next/standalone/src/lib/cortex/knowledge/compat.ts +14 -14
  540. package/.next/standalone/src/lib/cortex/knowledge/contradiction.ts +10 -10
  541. package/.next/standalone/src/lib/cortex/knowledge/types.ts +67 -67
  542. package/.next/standalone/src/lib/cortex/lobes/config.ts +16 -16
  543. package/.next/standalone/src/lib/cortex/lobes/resolver.ts +8 -8
  544. package/.next/standalone/src/lib/cortex/lobes/shares.ts +14 -14
  545. package/.next/standalone/src/lib/cortex/mcp/server.ts +8 -8
  546. package/.next/standalone/src/lib/cortex/portability/exporter.ts +6 -6
  547. package/.next/standalone/src/lib/cortex/portability/importer.ts +10 -10
  548. package/.next/standalone/src/lib/cortex/retrieval/context-engine.ts +10 -10
  549. package/.next/standalone/src/lib/cortex/types.ts +39 -38
  550. package/.next/standalone/tsconfig.json +34 -34
  551. package/LICENSE +661 -661
  552. package/README.md +131 -131
  553. package/bin/cortex-hook.sh +62 -62
  554. package/bin/cortex-mcp.js +60 -60
  555. package/bin/fix-standalone-externals.js +79 -79
  556. package/bin/lib/auto-setup.js +110 -110
  557. package/bin/mdns-service.js +171 -171
  558. package/bin/postinstall.js +35 -35
  559. package/bin/setup-admin.js +195 -195
  560. package/bin/spaces-dev.js +208 -208
  561. package/bin/spaces-install.js +599 -599
  562. package/bin/spaces-reset-totp.js +50 -50
  563. package/bin/spaces-service.js +1020 -1020
  564. package/bin/spaces-setup.js +253 -253
  565. package/bin/spaces.js +776 -728
  566. package/bin/ssh-auth-keys.sh +68 -68
  567. package/bin/terminal-server.js +1649 -1646
  568. package/package.json +102 -102
  569. package/.next/standalone/.claude/settings.local.json +0 -55
  570. package/.next/standalone/.claude/spaces-env.json +0 -1
  571. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ecce08b._.js +0 -3
  572. package/.next/standalone/.next/server/chunks/ssr/_7e63066a._.js +0 -3
  573. package/.next/standalone/.next/server/chunks/ssr/_a012c43b._.js +0 -3
  574. package/.next/standalone/.next/server/chunks/ssr/_b4db3983._.js +0 -3
  575. package/.next/standalone/.next/server/chunks/ssr/_cd50a174._.js +0 -3
  576. package/.next/standalone/.next/server/chunks/ssr/_e7a9e2b0._.js +0 -3
  577. package/.next/standalone/.next/server/chunks/ssr/_ed6c285b._.js +0 -3
  578. package/.next/standalone/.next/server/chunks/ssr/src_133a7c8a._.js +0 -3
  579. package/.next/standalone/.next/static/chunks/17d164c01fa1aaa9.js +0 -5
  580. package/.next/standalone/.next/static/chunks/19da759dde107f02.js +0 -1
  581. package/.next/standalone/.next/static/chunks/58d78765e5140dcb.js +0 -1
  582. package/.next/standalone/.next/static/chunks/596bd56e0ad09173.js +0 -5
  583. package/.next/standalone/.next/static/chunks/78dd908e70bf8c4b.js +0 -85
  584. package/.next/standalone/.next/static/chunks/79aacab676df80c4.js +0 -1
  585. package/.next/standalone/.next/static/chunks/846d6ef408f69390.js +0 -1
  586. package/.next/standalone/.next/static/chunks/8de5e432a2fc563a.js +0 -1
  587. package/.next/standalone/.next/static/chunks/9196173f0d081f2c.js +0 -1
  588. package/.next/standalone/.next/static/chunks/9bd8a119aaeafc9e.js +0 -1
  589. package/.next/standalone/.next/static/chunks/e35e863c09511a51.js +0 -1
  590. package/.next/standalone/.next/static/chunks/f644c11ace7a0d9d.css +0 -3
  591. package/.next/standalone/.spaces/cortex-context.md +0 -70
  592. package/.next/standalone/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64.node +0 -0
  593. package/.next/standalone/src/components/cortex/context-tab.tsx +0 -171
  594. /package/.next/standalone/.next/static/{B207XFa7QvXAYS7Sqq2_4 → 77VYbwIoyxFNr5xevTrCu}/_buildManifest.js +0 -0
  595. /package/.next/standalone/.next/static/{B207XFa7QvXAYS7Sqq2_4 → 77VYbwIoyxFNr5xevTrCu}/_clientMiddlewareManifest.json +0 -0
  596. /package/.next/standalone/.next/static/{B207XFa7QvXAYS7Sqq2_4 → 77VYbwIoyxFNr5xevTrCu}/_ssgManifest.js +0 -0
  597. /package/.next/standalone/node_modules/@img/{sharp-win32-x64 → sharp-libvips-linux-x64}/versions.json +0 -0
@@ -1,268 +1,268 @@
1
- # Cortex Wiring & Roadmap Design Spec
2
-
3
- **Date:** 2026-03-13
4
- **Status:** Draft
5
- **Scope:** Wire up 5 existing-but-unused Cortex subsystems; define roadmap for future phases
6
-
7
- ---
8
-
9
- ## Background
10
-
11
- Cortex is a RAG knowledge layer that ingests Claude conversation history into LanceDB, then injects relevant context into prompts. The basic ingest → embed → store → search → inject loop works, but several subsystems were implemented and never connected to the pipeline:
12
-
13
- - **Distiller** — LLM-based extraction of decisions, patterns, preferences, error fixes
14
- - **Deduplicator** — cosine similarity duplicate detection
15
- - **Extractors** — regex-based classification of conversation chunks
16
- - **Staleness** — file-change-aware decay scoring
17
- - **MCP server** — 10 tool definitions with no mounting point
18
-
19
- This spec covers wiring all 5 into the working system, then defines 4 future phases.
20
-
21
- ---
22
-
23
- ## Phase 1: Layered Wiring (Immediate Work)
24
-
25
- Each layer builds on the previous one. Each is independently shippable and testable.
26
-
27
- ### Layer 1: Deduplication
28
-
29
- **Goal:** Prevent duplicate knowledge units from accumulating in the store.
30
-
31
- **Where:** `pipeline.ts` — the dedup check replaces the current direct path from chunking to embedding. Chunks are embedded first, then checked for duplicates before storing.
32
-
33
- **Revised pipeline order:** chunk → embed → dedup check → store (if not duplicate)
34
-
35
- **Two-phase check:**
36
-
37
- 1. **Hash check (instant, pre-embed):** SHA-256 of normalized text. Maintained as an in-memory `Set<string>` on the pipeline instance, populated from the store on init. Catches exact re-ingestion (e.g., bootstrap re-running over already-ingested files). Hash matches skip embedding entirely.
38
-
39
- 2. **Cosine check via store search (post-embed):** For chunks that pass the hash check, embed the chunk, then use `store.search(layerKey, candidateVector, 1)` to find the nearest neighbor. If the nearest result has distance < 0.05 (similarity > 0.95), it's a duplicate. This uses LanceDB's native vector search — the existing `isDuplicate()` function in `deduplicator.ts` compares two individual vectors and is not suitable for store-wide checks.
40
-
41
- **Vector reuse:** Since the cosine check requires embedding the chunk, and the store also needs the vector, the embedded vector is cached and reused for the `store.add()` call. No double-embedding.
42
-
43
- **Duplicate handling:**
44
- - Hash match → skip silently, don't embed
45
- - Cosine match → skip storing, but bump `access_count` on the matched existing unit (validates its relevance)
46
-
47
- **Files changed:**
48
- - `pipeline.ts` — restructure Tier 2 to: embed → hash check → cosine check via `store.search()` → store
49
- - `deduplicator.ts` — add `textHash(text: string): string` utility. Keep existing `isDuplicate()` / `cosineSimilarity()` for other use cases (e.g., federation teach route)
50
- - `store.ts` — add `updateAccessCount(layerKey: string, id: string): Promise<void>` method
51
-
52
- ---
53
-
54
- ### Layer 2: Extractors
55
-
56
- **Goal:** Enrich chunks with specific type classifications and metadata before embedding.
57
-
58
- **Where:** `pipeline.ts` — after chunking, before embedding. Runs on each `RawChunk`.
59
-
60
- **Classification logic:**
61
-
62
- Each chunk currently defaults to type `conversation`. After extraction:
63
- - `detectErrorFixPairs()` matches → type becomes `error_fix`, file refs extracted from stack traces
64
- - `extractDecisionPatterns()` matches → type becomes `decision`
65
- - `extractCommands()` finds commands → type stays as-is, commands added to `metadata.commands`
66
- - Multiple matches: highest-value type wins (`decision` > `error_fix` > `conversation`)
67
-
68
- Note: `code_pattern` is a valid knowledge type but no extractor currently produces it. It will be generated only by LLM distillation in Layer 4 (the `patterns` prompt). The regex extractors in this layer do not attempt to classify code patterns — that requires semantic understanding beyond regex.
69
-
70
- **Key downstream effect:** These classifications determine which chunks get queued for LLM distillation in Layer 4. Only `decision` and `error_fix` types are queued. Plain `conversation` and `command` chunks are skipped — this is the cost control mechanism.
71
-
72
- **`RawChunk` already has `metadata`:** The type in `types.ts` includes `metadata: Record<string, unknown>`, so no extension is needed.
73
-
74
- **Files changed:**
75
- - `pipeline.ts` — call extractors on each chunk after `chunkMessages()`, before embed
76
- - `extractors.ts` — no changes needed, functions already implemented
77
-
78
- ---
79
-
80
- ### Layer 3: Staleness
81
-
82
- **Goal:** Knowledge units that reference files which have since changed should rank lower in search results and be visually flagged.
83
-
84
- **When computed:** At search/retrieval time, not at ingest time. Avoids filesystem checks during ingestion and ensures staleness is always current.
85
-
86
- **How it works:**
87
-
88
- The relevance formula in `search.ts` is: `similarity x confidence x (1 - stale_score) x recencyBoost x layerWeight` (the `layerWeight` multiplication happens in `search.ts`, not `scoring.ts`). Currently `stale_score` is always 0. This layer makes it real.
89
-
90
- When `CortexSearch.search()` returns candidates:
91
- 1. For each result with `file_refs[]`, call `computeFileStaleScore()` from `staleness.ts`
92
- 2. It requires a `fileModTimes: Record<string, string>` map — built by calling `fs.stat()` on each referenced file
93
- 3. Computes exponential decay based on days elapsed since file change
94
- 4. Stale score feeds into existing relevance formula — stale units naturally rank lower
95
-
96
- **File path resolution:** `file_refs` are stored as relative paths (from `extractFileRefs()` in `chunker.ts`). To resolve them for `fs.stat()`:
97
- - The search API route receives the query context. For workspace-scoped searches, `project_path` on the knowledge unit provides the root.
98
- - For the `personal` layer, results may reference files across different projects. Each unit's `project_path` is used as the resolution root.
99
- - If `project_path` is null or the file doesn't exist, `stale_score` remains 0 (not stale, just unresolvable).
100
-
101
- **Performance:** Staleness checks involve filesystem `stat()` calls. To keep search fast:
102
- - Only check `file_refs` on the top N results (after initial vector search ranking), not all candidates
103
- - Cache `stat()` results for the duration of a single search request (files don't change mid-request)
104
- - Typical case: 5-10 results with 1-3 file refs each = 5-30 stat calls, well under 10ms total
105
-
106
- **UI indicator:** In `knowledge-card.tsx`, if `stale_score > 0.3`, show an amber indicator with tooltip "Referenced files have changed since this was learned". No deletion, no archiving — stale units just rank lower. User can manually delete via existing button.
107
-
108
- **Files changed:**
109
- - `search.ts` — add staleness computation after vector search, before final scoring/ranking
110
- - `staleness.ts` — add Windows path normalization (backslash → forward slash) if needed
111
- - `knowledge-card.tsx` — add amber staleness badge when `stale_score > 0.3`
112
- - `src/app/api/cortex/search/route.ts` — pass filesystem context to search if needed
113
-
114
- ---
115
-
116
- ### Layer 4: Distillation
117
-
118
- **Goal:** Extract structured knowledge (decisions, patterns, preferences, error fixes) from raw conversation chunks using LLM calls.
119
-
120
- **`callLLM` implementation:**
121
-
122
- New file `src/lib/cortex/distillation/llm.ts` with auto-detect:
123
- 1. `ANTHROPIC_API_KEY` present → Claude Haiku via Messages API (direct `fetch`, no SDK)
124
- 2. `OPENAI_API_KEY` present → GPT-4o-mini via Chat Completions API (direct `fetch`)
125
- 3. Neither → log warning, distillation disabled gracefully
126
-
127
- **Selective distillation (fed by Layer 2 extractors):**
128
-
129
- Not every chunk gets distilled. Only chunks classified as `decision` or `error_fix` by the extractors are queued. Plain `conversation` and `command` chunks are skipped. In practice ~10-20% of chunks qualify, which controls API cost. The `pattern` and `code_pattern` types are *outputs* of distillation (not inputs to it).
130
-
131
- **Adapting the existing `DistillationScheduler`:**
132
-
133
- The scheduler (`scheduler.ts`) uses:
134
- - In-memory `pendingChunkIds: string[]` (not file-backed)
135
- - Idle-debounce pattern: flushes 30 seconds after last enqueue (not periodic)
136
- - Batch size of 50 (not 20)
137
- - Callback signature: `(chunkIds: string[]) => Promise<void>`
138
-
139
- We keep this design rather than rewrite it. Adaptations needed:
140
-
141
- 1. **ID-to-text resolution:** The scheduler hands off IDs, but `Distiller.distill()` takes text. Solution: when the pipeline enqueues a chunk for distillation, it also writes the chunk text to a lightweight JSON file at `~/.spaces/cortex/distill-queue.json` keyed by ID. The `onDistill` callback reads text from this file, passes to `Distiller.distill()`, then removes processed entries.
142
-
143
- 2. **Persistence across restarts:** The in-memory queue is lost on restart. The `distill-queue.json` file doubles as persistence — on init, any remaining entries are re-enqueued into the scheduler.
144
-
145
- 3. **Batch size stays at 50:** The 4 extraction prompts run once per batch (not per chunk), so 50 chunks per batch is fine. Cost estimate updated below.
146
-
147
- 4. **Idle debounce is appropriate:** Distillation runs 30s after the last ingest activity stops. This is better than a fixed interval — it processes soon after work is done, but doesn't interrupt active ingestion.
148
-
149
- **Respects existing settings:** The distillation toggle in `cortex-settings.tsx` already writes `config.ingestion.distillation`. We read it to gate the scheduler. If disabled, enqueue is a no-op.
150
-
151
- **Files changed:**
152
- - New: `src/lib/cortex/distillation/llm.ts` — `callLLM` with provider auto-detect
153
- - `src/lib/cortex/index.ts` — instantiate `Distiller` with callback, wire `DistillationScheduler`
154
- - `pipeline.ts` — after storing qualifying chunks, enqueue their IDs + write text to queue file
155
- - `scheduler.ts` — no changes to scheduler itself
156
- - New: `src/lib/cortex/distillation/queue.ts` — JSON file read/write for chunk text keyed by ID, init-time recovery
157
- - `config.ts` — read existing `distillation` toggle
158
-
159
- ---
160
-
161
- ### Layer 5: MCP Server
162
-
163
- **Goal:** Expose Cortex as an MCP tool server so Claude Code and other agents can search, teach, and manage knowledge directly.
164
-
165
- **Mounting approach:**
166
-
167
- Register as a stdio MCP server that Claude Code discovers automatically. A small entry point script handles the transport:
168
-
169
- `bin/cortex-mcp.js`:
170
- 1. Imports `handleToolCall` from `mcp/server.ts`
171
- 2. Wraps in stdio MCP transport (JSON-RPC over stdin/stdout)
172
- 3. Gets registered via settings written by `terminal-server.js`
173
-
174
- **Auth context for standalone process:** The MCP server runs as a child process of Claude Code, which runs inside a terminal session. The entry point receives the Spaces server URL and session context via environment variables set during registration (same pattern as the existing cortex hooks). It calls the Cortex HTTP API endpoints rather than importing the Cortex singleton directly — this avoids LanceDB connection conflicts and auth context issues. The `handleToolCall` in `mcp/server.ts` is adapted to be a thin HTTP client wrapper.
175
-
176
- **10 tools exposed:**
177
- - `cortex_search` — vector search
178
- - `cortex_teach` — manually add knowledge
179
- - `cortex_forget` — delete a unit
180
- - `cortex_status` — health + counts
181
- - `cortex_recall` — retrieve by ID
182
- - `cortex_similar` — find related units
183
- - `cortex_context` — formatted context dump
184
- - `cortex_timeline` — chronological view
185
- - `cortex_export` / `cortex_import` — portability
186
-
187
- **Registration:** `terminal-server.js` (`writeCortexHookConfig()`) already writes Claude Code settings for cortex hooks. Extend to also register the MCP server in `.claude/settings.local.json`, passing `SPACES_URL` and auth headers as env vars.
188
-
189
- **Files changed:**
190
- - New: `bin/cortex-mcp.js` — stdio MCP entry point, HTTP client to Spaces API
191
- - `src/lib/cortex/mcp/server.ts` — adapt `handleToolCall` to work as HTTP client wrapper
192
- - `terminal-server.js` — add MCP server registration to `writeCortexHookConfig()`
193
-
194
- ---
195
-
196
- ## Existing Bugs to Fix During Wiring
197
-
198
- These are bugs discovered during exploration that should be fixed as part of this work:
199
-
200
- 1. **Client-side layer filtering** — `cortex-panel.tsx` fetches 20 results total, then filters by tab. If all 20 are `workspace`, other tabs show empty. Fix: add a `layer` query param to the search API route (`src/app/api/cortex/search/route.ts`), and have the panel send 3 separate requests (one per tab). Files: `cortex-panel.tsx`, `src/app/api/cortex/search/route.ts`.
201
-
202
- 2. **Exporter hardcodes 384-dim vector** — `exporter.ts` uses `new Array(384).fill(0)` as a dummy query vector for `store.search()`. This is functionally broken for any non-384-dim embedding provider (1024 for Voyage, 1536 for OpenAI). Fix: read dimensions from the store/embedding config and construct the dummy vector accordingly. File: `exporter.ts`.
203
-
204
- 3. **PATCH knowledge is non-atomic** — delete + re-insert with crash risk. Acceptable for now but noted as tech debt.
205
-
206
- ---
207
-
208
- ## Testing Strategy
209
-
210
- Each layer ships with tests:
211
-
212
- - **Layer 1 (Dedup):** Unit test `textHash()` for deterministic output. Unit test the pipeline with duplicate inputs and verify only one unit stored. Test `access_count` bump on cosine match.
213
- - **Layer 2 (Extractors):** Unit test each extractor function (already pure functions with string input/output). Test pipeline classification with known error/fix and decision conversation samples.
214
- - **Layer 3 (Staleness):** Unit test `computeFileStaleScore()` with mock file mod times. Test that stale results rank lower than fresh ones in search output.
215
- - **Layer 4 (Distillation):** Unit test `callLLM` provider detection. Integration test with mocked LLM responses to verify end-to-end: enqueue → scheduler flush → distiller → store. Test queue persistence across simulated restart.
216
- - **Layer 5 (MCP):** Integration test: start MCP server, send JSON-RPC tool calls, verify correct HTTP API calls made.
217
-
218
- ---
219
-
220
- ## Future Phases (Roadmap)
221
-
222
- ### Phase 2: Smarter Retrieval
223
- - Multi-hop search: find related → find related to related
224
- - Per-layer search queries (fix client-side filtering — included in Phase 1 bug fixes)
225
- - Contradiction detection at search time
226
- - Context-aware injection budget (complex prompts get more tokens)
227
-
228
- ### Phase 3: Better UI
229
- - Timeline view (API exists, no UI)
230
- - Knowledge graph visualization
231
- - Inline editing of knowledge units
232
- - "Why was this injected?" explanations
233
- - Confidence tuning slider per unit
234
- - Staleness management view for bulk review
235
-
236
- ### Phase 4: Active Learning
237
- - Track whether injected context was useful (accepted vs ignored)
238
- - Feedback loop: boost confidence on useful units, decay ignored ones
239
- - Quick-reaction UI in injection badge ("helpful" / "not useful")
240
-
241
- ### Phase 5: Cross-Workspace Intelligence
242
- - Promote workspace units to personal layer when useful across projects
243
- - Wire up federation `connectedNodes` so team sync actually works (requires network discovery mechanism — largest unknown in the roadmap)
244
- - Pattern transfer between similar project contexts
245
-
246
- ---
247
-
248
- ## Cost Estimate
249
-
250
- Distillation uses Claude Haiku (or GPT-4o-mini as fallback):
251
- - ~500-1000 input tokens per extraction prompt, ~200 output tokens
252
- - 4 prompts per batch of up to 50 chunks
253
- - Heavy day of use: maybe 5-10 batches = 20-40 API calls
254
- - Estimated cost: $0.05-0.30/day at Haiku pricing
255
- - All other layers (dedup, extractors, staleness, MCP) have zero API cost
256
-
257
- ---
258
-
259
- ## Decisions Made
260
-
261
- | Decision | Choice | Rationale |
262
- |----------|--------|-----------|
263
- | Distillation LLM cost | Direct API (Haiku) | Cheap enough to evaluate; easy to switch later |
264
- | Dedup strategy | Hash + cosine via store search | Hash is instant for exact matches; store vector search catches paraphrases without double-embedding |
265
- | Staleness behavior | Decay + visual flag | Stale doesn't mean wrong; let user decide |
266
- | MCP server | Wire up now, HTTP client pattern | Already built; HTTP avoids LanceDB conflicts in child process |
267
- | Implementation order | Layered | Each layer independently shippable and testable |
268
- | Scheduler design | Keep existing idle-debounce | Better UX than fixed interval; add file-backed persistence |
1
+ # Cortex Wiring & Roadmap Design Spec
2
+
3
+ **Date:** 2026-03-13
4
+ **Status:** Draft
5
+ **Scope:** Wire up 5 existing-but-unused Cortex subsystems; define roadmap for future phases
6
+
7
+ ---
8
+
9
+ ## Background
10
+
11
+ Cortex is a RAG knowledge layer that ingests Claude conversation history into LanceDB, then injects relevant context into prompts. The basic ingest → embed → store → search → inject loop works, but several subsystems were implemented and never connected to the pipeline:
12
+
13
+ - **Distiller** — LLM-based extraction of decisions, patterns, preferences, error fixes
14
+ - **Deduplicator** — cosine similarity duplicate detection
15
+ - **Extractors** — regex-based classification of conversation chunks
16
+ - **Staleness** — file-change-aware decay scoring
17
+ - **MCP server** — 10 tool definitions with no mounting point
18
+
19
+ This spec covers wiring all 5 into the working system, then defines 4 future phases.
20
+
21
+ ---
22
+
23
+ ## Phase 1: Layered Wiring (Immediate Work)
24
+
25
+ Each layer builds on the previous one. Each is independently shippable and testable.
26
+
27
+ ### Layer 1: Deduplication
28
+
29
+ **Goal:** Prevent duplicate knowledge units from accumulating in the store.
30
+
31
+ **Where:** `pipeline.ts` — the dedup check replaces the current direct path from chunking to embedding. Chunks are embedded first, then checked for duplicates before storing.
32
+
33
+ **Revised pipeline order:** chunk → embed → dedup check → store (if not duplicate)
34
+
35
+ **Two-phase check:**
36
+
37
+ 1. **Hash check (instant, pre-embed):** SHA-256 of normalized text. Maintained as an in-memory `Set<string>` on the pipeline instance, populated from the store on init. Catches exact re-ingestion (e.g., bootstrap re-running over already-ingested files). Hash matches skip embedding entirely.
38
+
39
+ 2. **Cosine check via store search (post-embed):** For chunks that pass the hash check, embed the chunk, then use `store.search(layerKey, candidateVector, 1)` to find the nearest neighbor. If the nearest result has distance < 0.05 (similarity > 0.95), it's a duplicate. This uses LanceDB's native vector search — the existing `isDuplicate()` function in `deduplicator.ts` compares two individual vectors and is not suitable for store-wide checks.
40
+
41
+ **Vector reuse:** Since the cosine check requires embedding the chunk, and the store also needs the vector, the embedded vector is cached and reused for the `store.add()` call. No double-embedding.
42
+
43
+ **Duplicate handling:**
44
+ - Hash match → skip silently, don't embed
45
+ - Cosine match → skip storing, but bump `access_count` on the matched existing unit (validates its relevance)
46
+
47
+ **Files changed:**
48
+ - `pipeline.ts` — restructure Tier 2 to: embed → hash check → cosine check via `store.search()` → store
49
+ - `deduplicator.ts` — add `textHash(text: string): string` utility. Keep existing `isDuplicate()` / `cosineSimilarity()` for other use cases (e.g., federation teach route)
50
+ - `store.ts` — add `updateAccessCount(layerKey: string, id: string): Promise<void>` method
51
+
52
+ ---
53
+
54
+ ### Layer 2: Extractors
55
+
56
+ **Goal:** Enrich chunks with specific type classifications and metadata before embedding.
57
+
58
+ **Where:** `pipeline.ts` — after chunking, before embedding. Runs on each `RawChunk`.
59
+
60
+ **Classification logic:**
61
+
62
+ Each chunk currently defaults to type `conversation`. After extraction:
63
+ - `detectErrorFixPairs()` matches → type becomes `error_fix`, file refs extracted from stack traces
64
+ - `extractDecisionPatterns()` matches → type becomes `decision`
65
+ - `extractCommands()` finds commands → type stays as-is, commands added to `metadata.commands`
66
+ - Multiple matches: highest-value type wins (`decision` > `error_fix` > `conversation`)
67
+
68
+ Note: `code_pattern` is a valid knowledge type but no extractor currently produces it. It will be generated only by LLM distillation in Layer 4 (the `patterns` prompt). The regex extractors in this layer do not attempt to classify code patterns — that requires semantic understanding beyond regex.
69
+
70
+ **Key downstream effect:** These classifications determine which chunks get queued for LLM distillation in Layer 4. Only `decision` and `error_fix` types are queued. Plain `conversation` and `command` chunks are skipped — this is the cost control mechanism.
71
+
72
+ **`RawChunk` already has `metadata`:** The type in `types.ts` includes `metadata: Record<string, unknown>`, so no extension is needed.
73
+
74
+ **Files changed:**
75
+ - `pipeline.ts` — call extractors on each chunk after `chunkMessages()`, before embed
76
+ - `extractors.ts` — no changes needed, functions already implemented
77
+
78
+ ---
79
+
80
+ ### Layer 3: Staleness
81
+
82
+ **Goal:** Knowledge units that reference files which have since changed should rank lower in search results and be visually flagged.
83
+
84
+ **When computed:** At search/retrieval time, not at ingest time. Avoids filesystem checks during ingestion and ensures staleness is always current.
85
+
86
+ **How it works:**
87
+
88
+ The relevance formula in `search.ts` is: `similarity x confidence x (1 - stale_score) x recencyBoost x layerWeight` (the `layerWeight` multiplication happens in `search.ts`, not `scoring.ts`). Currently `stale_score` is always 0. This layer makes it real.
89
+
90
+ When `CortexSearch.search()` returns candidates:
91
+ 1. For each result with `file_refs[]`, call `computeFileStaleScore()` from `staleness.ts`
92
+ 2. It requires a `fileModTimes: Record<string, string>` map — built by calling `fs.stat()` on each referenced file
93
+ 3. Computes exponential decay based on days elapsed since file change
94
+ 4. Stale score feeds into existing relevance formula — stale units naturally rank lower
95
+
96
+ **File path resolution:** `file_refs` are stored as relative paths (from `extractFileRefs()` in `chunker.ts`). To resolve them for `fs.stat()`:
97
+ - The search API route receives the query context. For workspace-scoped searches, `project_path` on the knowledge unit provides the root.
98
+ - For the `personal` layer, results may reference files across different projects. Each unit's `project_path` is used as the resolution root.
99
+ - If `project_path` is null or the file doesn't exist, `stale_score` remains 0 (not stale, just unresolvable).
100
+
101
+ **Performance:** Staleness checks involve filesystem `stat()` calls. To keep search fast:
102
+ - Only check `file_refs` on the top N results (after initial vector search ranking), not all candidates
103
+ - Cache `stat()` results for the duration of a single search request (files don't change mid-request)
104
+ - Typical case: 5-10 results with 1-3 file refs each = 5-30 stat calls, well under 10ms total
105
+
106
+ **UI indicator:** In `knowledge-card.tsx`, if `stale_score > 0.3`, show an amber indicator with tooltip "Referenced files have changed since this was learned". No deletion, no archiving — stale units just rank lower. User can manually delete via existing button.
107
+
108
+ **Files changed:**
109
+ - `search.ts` — add staleness computation after vector search, before final scoring/ranking
110
+ - `staleness.ts` — add Windows path normalization (backslash → forward slash) if needed
111
+ - `knowledge-card.tsx` — add amber staleness badge when `stale_score > 0.3`
112
+ - `src/app/api/cortex/search/route.ts` — pass filesystem context to search if needed
113
+
114
+ ---
115
+
116
+ ### Layer 4: Distillation
117
+
118
+ **Goal:** Extract structured knowledge (decisions, patterns, preferences, error fixes) from raw conversation chunks using LLM calls.
119
+
120
+ **`callLLM` implementation:**
121
+
122
+ New file `src/lib/cortex/distillation/llm.ts` with auto-detect:
123
+ 1. `ANTHROPIC_API_KEY` present → Claude Haiku via Messages API (direct `fetch`, no SDK)
124
+ 2. `OPENAI_API_KEY` present → GPT-4o-mini via Chat Completions API (direct `fetch`)
125
+ 3. Neither → log warning, distillation disabled gracefully
126
+
127
+ **Selective distillation (fed by Layer 2 extractors):**
128
+
129
+ Not every chunk gets distilled. Only chunks classified as `decision` or `error_fix` by the extractors are queued. Plain `conversation` and `command` chunks are skipped. In practice ~10-20% of chunks qualify, which controls API cost. The `pattern` and `code_pattern` types are *outputs* of distillation (not inputs to it).
130
+
131
+ **Adapting the existing `DistillationScheduler`:**
132
+
133
+ The scheduler (`scheduler.ts`) uses:
134
+ - In-memory `pendingChunkIds: string[]` (not file-backed)
135
+ - Idle-debounce pattern: flushes 30 seconds after last enqueue (not periodic)
136
+ - Batch size of 50 (not 20)
137
+ - Callback signature: `(chunkIds: string[]) => Promise<void>`
138
+
139
+ We keep this design rather than rewrite it. Adaptations needed:
140
+
141
+ 1. **ID-to-text resolution:** The scheduler hands off IDs, but `Distiller.distill()` takes text. Solution: when the pipeline enqueues a chunk for distillation, it also writes the chunk text to a lightweight JSON file at `~/.spaces/cortex/distill-queue.json` keyed by ID. The `onDistill` callback reads text from this file, passes to `Distiller.distill()`, then removes processed entries.
142
+
143
+ 2. **Persistence across restarts:** The in-memory queue is lost on restart. The `distill-queue.json` file doubles as persistence — on init, any remaining entries are re-enqueued into the scheduler.
144
+
145
+ 3. **Batch size stays at 50:** The 4 extraction prompts run once per batch (not per chunk), so 50 chunks per batch is fine. Cost estimate updated below.
146
+
147
+ 4. **Idle debounce is appropriate:** Distillation runs 30s after the last ingest activity stops. This is better than a fixed interval — it processes soon after work is done, but doesn't interrupt active ingestion.
148
+
149
+ **Respects existing settings:** The distillation toggle in `cortex-settings.tsx` already writes `config.ingestion.distillation`. We read it to gate the scheduler. If disabled, enqueue is a no-op.
150
+
151
+ **Files changed:**
152
+ - New: `src/lib/cortex/distillation/llm.ts` — `callLLM` with provider auto-detect
153
+ - `src/lib/cortex/index.ts` — instantiate `Distiller` with callback, wire `DistillationScheduler`
154
+ - `pipeline.ts` — after storing qualifying chunks, enqueue their IDs + write text to queue file
155
+ - `scheduler.ts` — no changes to scheduler itself
156
+ - New: `src/lib/cortex/distillation/queue.ts` — JSON file read/write for chunk text keyed by ID, init-time recovery
157
+ - `config.ts` — read existing `distillation` toggle
158
+
159
+ ---
160
+
161
+ ### Layer 5: MCP Server
162
+
163
+ **Goal:** Expose Cortex as an MCP tool server so Claude Code and other agents can search, teach, and manage knowledge directly.
164
+
165
+ **Mounting approach:**
166
+
167
+ Register as a stdio MCP server that Claude Code discovers automatically. A small entry point script handles the transport:
168
+
169
+ `bin/cortex-mcp.js`:
170
+ 1. Imports `handleToolCall` from `mcp/server.ts`
171
+ 2. Wraps in stdio MCP transport (JSON-RPC over stdin/stdout)
172
+ 3. Gets registered via settings written by `terminal-server.js`
173
+
174
+ **Auth context for standalone process:** The MCP server runs as a child process of Claude Code, which runs inside a terminal session. The entry point receives the Spaces server URL and session context via environment variables set during registration (same pattern as the existing cortex hooks). It calls the Cortex HTTP API endpoints rather than importing the Cortex singleton directly — this avoids LanceDB connection conflicts and auth context issues. The `handleToolCall` in `mcp/server.ts` is adapted to be a thin HTTP client wrapper.
175
+
176
+ **10 tools exposed:**
177
+ - `cortex_search` — vector search
178
+ - `cortex_teach` — manually add knowledge
179
+ - `cortex_forget` — delete a unit
180
+ - `cortex_status` — health + counts
181
+ - `cortex_recall` — retrieve by ID
182
+ - `cortex_similar` — find related units
183
+ - `cortex_context` — formatted context dump
184
+ - `cortex_timeline` — chronological view
185
+ - `cortex_export` / `cortex_import` — portability
186
+
187
+ **Registration:** `terminal-server.js` (`writeCortexHookConfig()`) already writes Claude Code settings for cortex hooks. Extend to also register the MCP server in `.claude/settings.local.json`, passing `SPACES_URL` and auth headers as env vars.
188
+
189
+ **Files changed:**
190
+ - New: `bin/cortex-mcp.js` — stdio MCP entry point, HTTP client to Spaces API
191
+ - `src/lib/cortex/mcp/server.ts` — adapt `handleToolCall` to work as HTTP client wrapper
192
+ - `terminal-server.js` — add MCP server registration to `writeCortexHookConfig()`
193
+
194
+ ---
195
+
196
+ ## Existing Bugs to Fix During Wiring
197
+
198
+ These are bugs discovered during exploration that should be fixed as part of this work:
199
+
200
+ 1. **Client-side layer filtering** — `cortex-panel.tsx` fetches 20 results total, then filters by tab. If all 20 are `workspace`, other tabs show empty. Fix: add a `layer` query param to the search API route (`src/app/api/cortex/search/route.ts`), and have the panel send 3 separate requests (one per tab). Files: `cortex-panel.tsx`, `src/app/api/cortex/search/route.ts`.
201
+
202
+ 2. **Exporter hardcodes 384-dim vector** — `exporter.ts` uses `new Array(384).fill(0)` as a dummy query vector for `store.search()`. This is functionally broken for any non-384-dim embedding provider (1024 for Voyage, 1536 for OpenAI). Fix: read dimensions from the store/embedding config and construct the dummy vector accordingly. File: `exporter.ts`.
203
+
204
+ 3. **PATCH knowledge is non-atomic** — delete + re-insert with crash risk. Acceptable for now but noted as tech debt.
205
+
206
+ ---
207
+
208
+ ## Testing Strategy
209
+
210
+ Each layer ships with tests:
211
+
212
+ - **Layer 1 (Dedup):** Unit test `textHash()` for deterministic output. Unit test the pipeline with duplicate inputs and verify only one unit stored. Test `access_count` bump on cosine match.
213
+ - **Layer 2 (Extractors):** Unit test each extractor function (already pure functions with string input/output). Test pipeline classification with known error/fix and decision conversation samples.
214
+ - **Layer 3 (Staleness):** Unit test `computeFileStaleScore()` with mock file mod times. Test that stale results rank lower than fresh ones in search output.
215
+ - **Layer 4 (Distillation):** Unit test `callLLM` provider detection. Integration test with mocked LLM responses to verify end-to-end: enqueue → scheduler flush → distiller → store. Test queue persistence across simulated restart.
216
+ - **Layer 5 (MCP):** Integration test: start MCP server, send JSON-RPC tool calls, verify correct HTTP API calls made.
217
+
218
+ ---
219
+
220
+ ## Future Phases (Roadmap)
221
+
222
+ ### Phase 2: Smarter Retrieval
223
+ - Multi-hop search: find related → find related to related
224
+ - Per-layer search queries (fix client-side filtering — included in Phase 1 bug fixes)
225
+ - Contradiction detection at search time
226
+ - Context-aware injection budget (complex prompts get more tokens)
227
+
228
+ ### Phase 3: Better UI
229
+ - Timeline view (API exists, no UI)
230
+ - Knowledge graph visualization
231
+ - Inline editing of knowledge units
232
+ - "Why was this injected?" explanations
233
+ - Confidence tuning slider per unit
234
+ - Staleness management view for bulk review
235
+
236
+ ### Phase 4: Active Learning
237
+ - Track whether injected context was useful (accepted vs ignored)
238
+ - Feedback loop: boost confidence on useful units, decay ignored ones
239
+ - Quick-reaction UI in injection badge ("helpful" / "not useful")
240
+
241
+ ### Phase 5: Cross-Workspace Intelligence
242
+ - Promote workspace units to personal layer when useful across projects
243
+ - Wire up federation `connectedNodes` so team sync actually works (requires network discovery mechanism — largest unknown in the roadmap)
244
+ - Pattern transfer between similar project contexts
245
+
246
+ ---
247
+
248
+ ## Cost Estimate
249
+
250
+ Distillation uses Claude Haiku (or GPT-4o-mini as fallback):
251
+ - ~500-1000 input tokens per extraction prompt, ~200 output tokens
252
+ - 4 prompts per batch of up to 50 chunks
253
+ - Heavy day of use: maybe 5-10 batches = 20-40 API calls
254
+ - Estimated cost: $0.05-0.30/day at Haiku pricing
255
+ - All other layers (dedup, extractors, staleness, MCP) have zero API cost
256
+
257
+ ---
258
+
259
+ ## Decisions Made
260
+
261
+ | Decision | Choice | Rationale |
262
+ |----------|--------|-----------|
263
+ | Distillation LLM cost | Direct API (Haiku) | Cheap enough to evaluate; easy to switch later |
264
+ | Dedup strategy | Hash + cosine via store search | Hash is instant for exact matches; store vector search catches paraphrases without double-embedding |
265
+ | Staleness behavior | Decay + visual flag | Stale doesn't mean wrong; let user decide |
266
+ | MCP server | Wire up now, HTTP client pattern | Already built; HTTP avoids LanceDB conflicts in child process |
267
+ | Implementation order | Layered | Each layer independently shippable and testable |
268
+ | Scheduler design | Keep existing idle-debounce | Better UX than fixed interval; add file-backed persistence |