kontexta 5.1.3 → 6.0.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 (543) hide show
  1. package/bundle/standalone/CHANGELOG.md +51 -0
  2. package/bundle/standalone/apps/web/.next/BUILD_ID +1 -1
  3. package/bundle/standalone/apps/web/.next/app-build-manifest.json +99 -92
  4. package/bundle/standalone/apps/web/.next/app-path-routes-manifest.json +13 -12
  5. package/bundle/standalone/apps/web/.next/build-manifest.json +2 -2
  6. package/bundle/standalone/apps/web/.next/prerender-manifest.json +3 -3
  7. package/bundle/standalone/apps/web/.next/required-server-files.json +1 -0
  8. package/bundle/standalone/apps/web/.next/routes-manifest.json +8 -0
  9. package/bundle/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/bundle/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/bundle/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  12. package/bundle/standalone/apps/web/.next/server/app/_not-found.rsc +4 -4
  13. package/bundle/standalone/apps/web/.next/server/app/api/about/route.js.nft.json +1 -1
  14. package/bundle/standalone/apps/web/.next/server/app/api/about/route_client-reference-manifest.js +1 -1
  15. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/hooks/route.js +1 -1
  16. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/hooks/route.js.nft.json +1 -1
  17. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/hooks/route_client-reference-manifest.js +1 -1
  18. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/mcp/route.js +1 -0
  19. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/mcp/route.js.nft.json +1 -0
  20. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/mcp/route_client-reference-manifest.js +1 -0
  21. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/route.js +1 -1
  22. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/route.js.nft.json +1 -1
  23. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/route_client-reference-manifest.js +1 -1
  24. package/bundle/standalone/apps/web/.next/server/app/api/agents/route.js +1 -1
  25. package/bundle/standalone/apps/web/.next/server/app/api/agents/route.js.nft.json +1 -1
  26. package/bundle/standalone/apps/web/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  27. package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  28. package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  29. package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  30. package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  31. package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route.js.nft.json +1 -1
  32. package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
  33. package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  34. package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  35. package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route.js.nft.json +1 -1
  36. package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route_client-reference-manifest.js +1 -1
  37. package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route.js.nft.json +1 -1
  38. package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route_client-reference-manifest.js +1 -1
  39. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route.js.nft.json +1 -1
  40. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route_client-reference-manifest.js +1 -1
  41. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route.js.nft.json +1 -1
  42. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route_client-reference-manifest.js +1 -1
  43. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route.js.nft.json +1 -1
  44. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route_client-reference-manifest.js +1 -1
  45. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route.js.nft.json +1 -1
  46. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route_client-reference-manifest.js +1 -1
  47. package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route.js.nft.json +1 -1
  48. package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route_client-reference-manifest.js +1 -1
  49. package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route.js.nft.json +1 -1
  50. package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route_client-reference-manifest.js +1 -1
  51. package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route.js.nft.json +1 -1
  52. package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route_client-reference-manifest.js +1 -1
  53. package/bundle/standalone/apps/web/.next/server/app/api/clip/route.js.nft.json +1 -1
  54. package/bundle/standalone/apps/web/.next/server/app/api/clip/route_client-reference-manifest.js +1 -1
  55. package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route.js.nft.json +1 -1
  56. package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route_client-reference-manifest.js +1 -1
  57. package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route.js.nft.json +1 -1
  58. package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route_client-reference-manifest.js +1 -1
  59. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/backlinks/route.js.nft.json +1 -1
  60. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/backlinks/route_client-reference-manifest.js +1 -1
  61. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route.js.nft.json +1 -1
  62. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route_client-reference-manifest.js +1 -1
  63. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-html/route.js.nft.json +1 -1
  64. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-html/route_client-reference-manifest.js +1 -1
  65. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route.js.nft.json +1 -1
  66. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route_client-reference-manifest.js +1 -1
  67. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route.js.nft.json +1 -1
  68. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route_client-reference-manifest.js +1 -1
  69. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route.js.nft.json +1 -1
  70. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route_client-reference-manifest.js +1 -1
  71. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route.js.nft.json +1 -1
  72. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route_client-reference-manifest.js +1 -1
  73. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route.js.nft.json +1 -1
  74. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route_client-reference-manifest.js +1 -1
  75. package/bundle/standalone/apps/web/.next/server/app/api/files/route.js.nft.json +1 -1
  76. package/bundle/standalone/apps/web/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  77. package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route.js.nft.json +1 -1
  78. package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route_client-reference-manifest.js +1 -1
  79. package/bundle/standalone/apps/web/.next/server/app/api/folders/route.js +1 -1
  80. package/bundle/standalone/apps/web/.next/server/app/api/folders/route.js.nft.json +1 -1
  81. package/bundle/standalone/apps/web/.next/server/app/api/folders/route_client-reference-manifest.js +1 -1
  82. package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route.js.nft.json +1 -1
  83. package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route_client-reference-manifest.js +1 -1
  84. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route.js +1 -1
  85. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route.js.nft.json +1 -1
  86. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route_client-reference-manifest.js +1 -1
  87. package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route.js.nft.json +1 -1
  88. package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route_client-reference-manifest.js +1 -1
  89. package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route.js.nft.json +1 -1
  90. package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route_client-reference-manifest.js +1 -1
  91. package/bundle/standalone/apps/web/.next/server/app/api/health/route.js.nft.json +1 -1
  92. package/bundle/standalone/apps/web/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  93. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js +9 -9
  94. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js.nft.json +1 -1
  95. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route_client-reference-manifest.js +1 -1
  96. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js +1 -1
  97. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js.nft.json +1 -1
  98. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route_client-reference-manifest.js +1 -1
  99. package/bundle/standalone/apps/web/.next/server/app/api/profile/route.js.nft.json +1 -1
  100. package/bundle/standalone/apps/web/.next/server/app/api/profile/route_client-reference-manifest.js +1 -1
  101. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route.js.nft.json +1 -1
  102. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route_client-reference-manifest.js +1 -1
  103. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route.js.nft.json +1 -1
  104. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route_client-reference-manifest.js +1 -1
  105. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route.js.nft.json +1 -1
  106. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route_client-reference-manifest.js +1 -1
  107. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route.js.nft.json +1 -1
  108. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route_client-reference-manifest.js +1 -1
  109. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route.js.nft.json +1 -1
  110. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route_client-reference-manifest.js +1 -1
  111. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  112. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  113. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route.js.nft.json +1 -1
  114. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route_client-reference-manifest.js +1 -1
  115. package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route.js.nft.json +1 -1
  116. package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route_client-reference-manifest.js +1 -1
  117. package/bundle/standalone/apps/web/.next/server/app/api/projects/route.js.nft.json +1 -1
  118. package/bundle/standalone/apps/web/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  119. package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route.js.nft.json +1 -1
  120. package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route_client-reference-manifest.js +1 -1
  121. package/bundle/standalone/apps/web/.next/server/app/api/publish/route.js.nft.json +1 -1
  122. package/bundle/standalone/apps/web/.next/server/app/api/publish/route_client-reference-manifest.js +1 -1
  123. package/bundle/standalone/apps/web/.next/server/app/api/refresh/route.js.nft.json +1 -1
  124. package/bundle/standalone/apps/web/.next/server/app/api/refresh/route_client-reference-manifest.js +1 -1
  125. package/bundle/standalone/apps/web/.next/server/app/api/reindex/route.js.nft.json +1 -1
  126. package/bundle/standalone/apps/web/.next/server/app/api/reindex/route_client-reference-manifest.js +1 -1
  127. package/bundle/standalone/apps/web/.next/server/app/api/reports/resources/[name]/route.js.nft.json +1 -1
  128. package/bundle/standalone/apps/web/.next/server/app/api/reports/resources/[name]/route_client-reference-manifest.js +1 -1
  129. package/bundle/standalone/apps/web/.next/server/app/api/search/route.js.nft.json +1 -1
  130. package/bundle/standalone/apps/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  131. package/bundle/standalone/apps/web/.next/server/app/api/tags/route.js.nft.json +1 -1
  132. package/bundle/standalone/apps/web/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  133. package/bundle/standalone/apps/web/.next/server/app/api/version-check/route.js.nft.json +1 -1
  134. package/bundle/standalone/apps/web/.next/server/app/api/version-check/route_client-reference-manifest.js +1 -1
  135. package/bundle/standalone/apps/web/.next/server/app/api/welcome/route.js.nft.json +1 -1
  136. package/bundle/standalone/apps/web/.next/server/app/api/welcome/route_client-reference-manifest.js +1 -1
  137. package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route.js.nft.json +1 -1
  138. package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route_client-reference-manifest.js +1 -1
  139. package/bundle/standalone/apps/web/.next/server/app/apple-icon.png/route.js.nft.json +1 -1
  140. package/bundle/standalone/apps/web/.next/server/app/calendar/page.js +1 -1
  141. package/bundle/standalone/apps/web/.next/server/app/calendar/page.js.nft.json +1 -1
  142. package/bundle/standalone/apps/web/.next/server/app/calendar/page_client-reference-manifest.js +1 -1
  143. package/bundle/standalone/apps/web/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  144. package/bundle/standalone/apps/web/.next/server/app/icon.png/route.js.nft.json +1 -1
  145. package/bundle/standalone/apps/web/.next/server/app/login/page.js.nft.json +1 -1
  146. package/bundle/standalone/apps/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  147. package/bundle/standalone/apps/web/.next/server/app/page.js +4 -4
  148. package/bundle/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
  149. package/bundle/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  150. package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page.js.nft.json +1 -1
  151. package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page_client-reference-manifest.js +1 -1
  152. package/bundle/standalone/apps/web/.next/server/app/preview/motifs.html +2 -2
  153. package/bundle/standalone/apps/web/.next/server/app/preview/motifs.rsc +4 -4
  154. package/bundle/standalone/apps/web/.next/server/app-paths-manifest.json +13 -12
  155. package/bundle/standalone/apps/web/.next/server/chunks/3668.js +2 -2
  156. package/bundle/standalone/apps/web/.next/server/pages/404.html +1 -1
  157. package/bundle/standalone/apps/web/.next/server/pages/500.html +1 -1
  158. package/bundle/standalone/apps/web/.next/server/pages/_app.js.nft.json +1 -1
  159. package/bundle/standalone/apps/web/.next/server/pages/_document.js.nft.json +1 -1
  160. package/bundle/standalone/apps/web/.next/server/pages/_error.js.nft.json +1 -1
  161. package/bundle/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  162. package/bundle/standalone/apps/web/.next/static/chunks/app/api/about/route-e920054b7eb00274.js +1 -0
  163. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/hooks/route-e920054b7eb00274.js +1 -0
  164. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/mcp/route-e920054b7eb00274.js +1 -0
  165. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/route-e920054b7eb00274.js +1 -0
  166. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/route-e920054b7eb00274.js +1 -0
  167. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/login/route-e920054b7eb00274.js +1 -0
  168. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/logout/route-e920054b7eb00274.js +1 -0
  169. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/setup/route-e920054b7eb00274.js +1 -0
  170. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/status/route-e920054b7eb00274.js +1 -0
  171. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/token/route-e920054b7eb00274.js +1 -0
  172. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/conflicts/route-e920054b7eb00274.js +1 -0
  173. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/[id]/route-e920054b7eb00274.js +1 -0
  174. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/route-e920054b7eb00274.js +1 -0
  175. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/[id]/route-e920054b7eb00274.js +1 -0
  176. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/route-e920054b7eb00274.js +1 -0
  177. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/ics/route-e920054b7eb00274.js +1 -0
  178. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/links/route-e920054b7eb00274.js +1 -0
  179. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/settings/route-e920054b7eb00274.js +1 -0
  180. package/bundle/standalone/apps/web/.next/static/chunks/app/api/clip/route-e920054b7eb00274.js +1 -0
  181. package/bundle/standalone/apps/web/.next/static/chunks/app/api/docker-config/route-e920054b7eb00274.js +1 -0
  182. package/bundle/standalone/apps/web/.next/static/chunks/app/api/export/zip/route-e920054b7eb00274.js +1 -0
  183. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/backlinks/route-e920054b7eb00274.js +1 -0
  184. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/download/route-e920054b7eb00274.js +1 -0
  185. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-html/route-e920054b7eb00274.js +1 -0
  186. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-pdf/route-e920054b7eb00274.js +1 -0
  187. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/restore/route-e920054b7eb00274.js +1 -0
  188. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/route-e920054b7eb00274.js +1 -0
  189. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/move/route-e920054b7eb00274.js +1 -0
  190. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/route-e920054b7eb00274.js +1 -0
  191. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/route-e920054b7eb00274.js +1 -0
  192. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/upload/route-e920054b7eb00274.js +1 -0
  193. package/bundle/standalone/apps/web/.next/static/chunks/app/api/folders/route-e920054b7eb00274.js +1 -0
  194. package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/remote/route-e920054b7eb00274.js +1 -0
  195. package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/sync-all/route-e920054b7eb00274.js +1 -0
  196. package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/test-pattern/route-e920054b7eb00274.js +1 -0
  197. package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/validate/route-e920054b7eb00274.js +1 -0
  198. package/bundle/standalone/apps/web/.next/static/chunks/app/api/health/route-e920054b7eb00274.js +1 -0
  199. package/bundle/standalone/apps/web/.next/static/chunks/app/api/install-snippets/route-e920054b7eb00274.js +1 -0
  200. package/bundle/standalone/apps/web/.next/static/chunks/app/api/mcp-tools/route-e920054b7eb00274.js +1 -0
  201. package/bundle/standalone/apps/web/.next/static/chunks/app/api/profile/route-e920054b7eb00274.js +1 -0
  202. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/hands-config/route-e920054b7eb00274.js +1 -0
  203. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-config/route-e920054b7eb00274.js +1 -0
  204. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-status/route-e920054b7eb00274.js +1 -0
  205. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/onboard/route-e920054b7eb00274.js +1 -0
  206. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/refresh/route-e920054b7eb00274.js +1 -0
  207. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/route-e920054b7eb00274.js +1 -0
  208. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/sync/route-e920054b7eb00274.js +1 -0
  209. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/onboard/route-e920054b7eb00274.js +1 -0
  210. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/route-e920054b7eb00274.js +1 -0
  211. package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/html/route-e920054b7eb00274.js +1 -0
  212. package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/route-e920054b7eb00274.js +1 -0
  213. package/bundle/standalone/apps/web/.next/static/chunks/app/api/refresh/route-e920054b7eb00274.js +1 -0
  214. package/bundle/standalone/apps/web/.next/static/chunks/app/api/reindex/route-e920054b7eb00274.js +1 -0
  215. package/bundle/standalone/apps/web/.next/static/chunks/app/api/reports/resources/[name]/route-e920054b7eb00274.js +1 -0
  216. package/bundle/standalone/apps/web/.next/static/chunks/app/api/search/route-e920054b7eb00274.js +1 -0
  217. package/bundle/standalone/apps/web/.next/static/chunks/app/api/tags/route-e920054b7eb00274.js +1 -0
  218. package/bundle/standalone/apps/web/.next/static/chunks/app/api/version-check/route-e920054b7eb00274.js +1 -0
  219. package/bundle/standalone/apps/web/.next/static/chunks/app/api/welcome/route-e920054b7eb00274.js +1 -0
  220. package/bundle/standalone/apps/web/.next/static/chunks/app/api/ws-config/route-e920054b7eb00274.js +1 -0
  221. package/bundle/standalone/apps/web/.next/static/chunks/app/calendar/page-7d520da68bac245d.js +1 -0
  222. package/bundle/standalone/apps/web/.next/static/chunks/app/{layout-da10917c290d5da7.js → layout-b3fc3a7cf96952bd.js} +1 -1
  223. package/bundle/standalone/apps/web/.next/static/chunks/app/page-f2e6293531d0db55.js +1 -0
  224. package/bundle/standalone/apps/web/.next/static/chunks/app/preview/motifs/page-e920054b7eb00274.js +1 -0
  225. package/bundle/standalone/apps/web/.next/static/css/{c2dc6e054d3457fa.css → c9d10f1f97d629ff.css} +2 -2
  226. package/bundle/standalone/apps/web/package.json +6 -5
  227. package/bundle/standalone/apps/web/server.js +1 -1
  228. package/bundle/standalone/apps/web/src/lib/mcp-tools.json +126 -118
  229. package/bundle/standalone/node_modules/kontexta-mcp/dist/agent-rules/rules-block.md +28 -185
  230. package/bundle/standalone/node_modules/kontexta-mcp/dist/agent-rules/rules-reference.md +207 -0
  231. package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js +20 -20
  232. package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js.map +1 -1
  233. package/bundle/standalone/node_modules/kontexta-mcp/dist/connect-cli.d.ts +3 -0
  234. package/bundle/standalone/node_modules/kontexta-mcp/dist/connect-cli.d.ts.map +1 -0
  235. package/bundle/standalone/node_modules/kontexta-mcp/dist/connect-cli.js +166 -0
  236. package/bundle/standalone/node_modules/kontexta-mcp/dist/connect-cli.js.map +1 -0
  237. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/executor.js +1 -1
  238. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/executor.js.map +1 -1
  239. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/formatter.js +1 -1
  240. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/loader.js +1 -1
  241. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/loader.js.map +1 -1
  242. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/sanitizer.js +2 -2
  243. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/sanitizer.js.map +1 -1
  244. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/schema-doc.js +26 -26
  245. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks/emit.mjs +39 -2
  246. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks-block.js +1 -1
  247. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks-block.js.map +1 -1
  248. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks-cli.js +2 -2
  249. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks-cli.js.map +1 -1
  250. package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js +240 -94
  251. package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js.map +1 -1
  252. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.js +8 -8
  253. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.js.map +1 -1
  254. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-commit-upgrades-tool.js +1 -1
  255. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-housekeep-tool.js +1 -1
  256. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-tools.js +2 -2
  257. package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/011-journal-files-in-kb.sql +2 -0
  258. package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/012-agents-mcp.sql +6 -0
  259. package/bundle/standalone/node_modules/kontexta-mcp/dist/profile-tool.js +1 -1
  260. package/bundle/standalone/node_modules/kontexta-mcp/dist/profile-tool.js.map +1 -1
  261. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.d.ts +7 -0
  262. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.d.ts.map +1 -0
  263. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.js +13 -0
  264. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.js.map +1 -0
  265. package/bundle/standalone/node_modules/kontexta-mcp/package.json +5 -2
  266. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.d.ts +5 -0
  267. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.d.ts.map +1 -1
  268. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.js +84 -25
  269. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.js.map +1 -1
  270. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/rules-block.md +28 -185
  271. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/rules-reference.md +207 -0
  272. package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.d.ts +25 -1
  273. package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.d.ts.map +1 -1
  274. package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.js +159 -32
  275. package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.js.map +1 -1
  276. package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/011-journal-files-in-kb.sql +2 -0
  277. package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/012-agents-mcp.sql +6 -0
  278. package/bundle/standalone/node_modules/kxta-core/dist/decision/engine.d.ts +71 -0
  279. package/bundle/standalone/node_modules/kxta-core/dist/decision/engine.d.ts.map +1 -0
  280. package/bundle/standalone/node_modules/kxta-core/dist/decision/engine.js +192 -0
  281. package/bundle/standalone/node_modules/kxta-core/dist/decision/engine.js.map +1 -0
  282. package/bundle/standalone/node_modules/kxta-core/dist/decision/index.d.ts +9 -0
  283. package/bundle/standalone/node_modules/kxta-core/dist/decision/index.d.ts.map +1 -0
  284. package/bundle/standalone/node_modules/kxta-core/dist/decision/index.js +10 -0
  285. package/bundle/standalone/node_modules/kxta-core/dist/decision/index.js.map +1 -0
  286. package/bundle/standalone/node_modules/kxta-core/dist/decision/intent-router.d.ts +20 -0
  287. package/bundle/standalone/node_modules/kxta-core/dist/decision/intent-router.d.ts.map +1 -0
  288. package/bundle/standalone/node_modules/kxta-core/dist/decision/intent-router.js +124 -0
  289. package/bundle/standalone/node_modules/kxta-core/dist/decision/intent-router.js.map +1 -0
  290. package/bundle/standalone/node_modules/kxta-core/dist/decision/pruning.d.ts +20 -0
  291. package/bundle/standalone/node_modules/kxta-core/dist/decision/pruning.d.ts.map +1 -0
  292. package/bundle/standalone/node_modules/kxta-core/dist/decision/pruning.js +28 -0
  293. package/bundle/standalone/node_modules/kxta-core/dist/decision/pruning.js.map +1 -0
  294. package/bundle/standalone/node_modules/kxta-core/dist/decision/sufficiency.d.ts +30 -0
  295. package/bundle/standalone/node_modules/kxta-core/dist/decision/sufficiency.d.ts.map +1 -0
  296. package/bundle/standalone/node_modules/kxta-core/dist/decision/sufficiency.js +57 -0
  297. package/bundle/standalone/node_modules/kxta-core/dist/decision/sufficiency.js.map +1 -0
  298. package/bundle/standalone/node_modules/kxta-core/dist/decision/types.d.ts +42 -0
  299. package/bundle/standalone/node_modules/kxta-core/dist/decision/types.d.ts.map +1 -0
  300. package/bundle/standalone/node_modules/kxta-core/dist/decision/types.js +7 -0
  301. package/bundle/standalone/node_modules/kxta-core/dist/decision/types.js.map +1 -0
  302. package/bundle/standalone/node_modules/kxta-core/dist/files/index.d.ts +3 -1
  303. package/bundle/standalone/node_modules/kxta-core/dist/files/index.d.ts.map +1 -1
  304. package/bundle/standalone/node_modules/kxta-core/dist/files/index.js +10 -1
  305. package/bundle/standalone/node_modules/kxta-core/dist/files/index.js.map +1 -1
  306. package/bundle/standalone/node_modules/kxta-core/dist/hooks/agents.d.ts +19 -2
  307. package/bundle/standalone/node_modules/kxta-core/dist/hooks/agents.d.ts.map +1 -1
  308. package/bundle/standalone/node_modules/kxta-core/dist/hooks/agents.js +15 -15
  309. package/bundle/standalone/node_modules/kxta-core/dist/hooks/agents.js.map +1 -1
  310. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.d.ts +2 -0
  311. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.d.ts.map +1 -1
  312. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.js +5 -5
  313. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.js.map +1 -1
  314. package/bundle/standalone/node_modules/kxta-core/dist/hooks/emit.mjs +39 -2
  315. package/bundle/standalone/node_modules/kxta-core/dist/hooks/index.d.ts +2 -2
  316. package/bundle/standalone/node_modules/kxta-core/dist/hooks/index.d.ts.map +1 -1
  317. package/bundle/standalone/node_modules/kxta-core/dist/hooks/index.js +1 -1
  318. package/bundle/standalone/node_modules/kxta-core/dist/hooks/index.js.map +1 -1
  319. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/antigravity.d.ts +3 -0
  320. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/antigravity.d.ts.map +1 -0
  321. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/antigravity.js +75 -0
  322. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/antigravity.js.map +1 -0
  323. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/codex.js +1 -1
  324. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/codex.js.map +1 -1
  325. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/copilot.d.ts.map +1 -1
  326. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/copilot.js +4 -3
  327. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/copilot.js.map +1 -1
  328. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/gemini.d.ts.map +1 -1
  329. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/gemini.js +0 -1
  330. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/gemini.js.map +1 -1
  331. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/hermes.d.ts +3 -0
  332. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/hermes.d.ts.map +1 -0
  333. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/hermes.js +107 -0
  334. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/hermes.js.map +1 -0
  335. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/index.d.ts.map +1 -1
  336. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/index.js +4 -0
  337. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/index.js.map +1 -1
  338. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/json-config.d.ts +2 -0
  339. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/json-config.d.ts.map +1 -1
  340. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/json-config.js +27 -13
  341. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/json-config.js.map +1 -1
  342. package/bundle/standalone/node_modules/kxta-core/dist/hooks/registry.d.ts +11 -0
  343. package/bundle/standalone/node_modules/kxta-core/dist/hooks/registry.d.ts.map +1 -1
  344. package/bundle/standalone/node_modules/kxta-core/dist/hooks/registry.js +29 -3
  345. package/bundle/standalone/node_modules/kxta-core/dist/hooks/registry.js.map +1 -1
  346. package/bundle/standalone/node_modules/kxta-core/dist/index.d.ts +5 -1
  347. package/bundle/standalone/node_modules/kxta-core/dist/index.d.ts.map +1 -1
  348. package/bundle/standalone/node_modules/kxta-core/dist/index.js +5 -1
  349. package/bundle/standalone/node_modules/kxta-core/dist/index.js.map +1 -1
  350. package/bundle/standalone/node_modules/kxta-core/dist/inference/bundled.d.ts +3 -0
  351. package/bundle/standalone/node_modules/kxta-core/dist/inference/bundled.d.ts.map +1 -0
  352. package/bundle/standalone/node_modules/kxta-core/dist/inference/bundled.js +27 -0
  353. package/bundle/standalone/node_modules/kxta-core/dist/inference/bundled.js.map +1 -0
  354. package/bundle/standalone/node_modules/kxta-core/dist/inference/cache-manager.d.ts +41 -0
  355. package/bundle/standalone/node_modules/kxta-core/dist/inference/cache-manager.d.ts.map +1 -0
  356. package/bundle/standalone/node_modules/kxta-core/dist/inference/cache-manager.js +140 -0
  357. package/bundle/standalone/node_modules/kxta-core/dist/inference/cache-manager.js.map +1 -0
  358. package/bundle/standalone/node_modules/kxta-core/dist/inference/index.d.ts +14 -0
  359. package/bundle/standalone/node_modules/kxta-core/dist/inference/index.d.ts.map +1 -0
  360. package/bundle/standalone/node_modules/kxta-core/dist/inference/index.js +15 -0
  361. package/bundle/standalone/node_modules/kxta-core/dist/inference/index.js.map +1 -0
  362. package/bundle/standalone/node_modules/kxta-core/dist/inference/runtime.d.ts +132 -0
  363. package/bundle/standalone/node_modules/kxta-core/dist/inference/runtime.d.ts.map +1 -0
  364. package/bundle/standalone/node_modules/kxta-core/dist/inference/runtime.js +311 -0
  365. package/bundle/standalone/node_modules/kxta-core/dist/inference/runtime.js.map +1 -0
  366. package/bundle/standalone/node_modules/kxta-core/dist/inference/types.d.ts +53 -0
  367. package/bundle/standalone/node_modules/kxta-core/dist/inference/types.d.ts.map +1 -0
  368. package/bundle/standalone/node_modules/kxta-core/dist/inference/types.js +6 -0
  369. package/bundle/standalone/node_modules/kxta-core/dist/inference/types.js.map +1 -0
  370. package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.js +26 -10
  371. package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.js.map +1 -1
  372. package/bundle/standalone/node_modules/kxta-core/dist/journal/event-triage.d.ts +31 -0
  373. package/bundle/standalone/node_modules/kxta-core/dist/journal/event-triage.d.ts.map +1 -0
  374. package/bundle/standalone/node_modules/kxta-core/dist/journal/event-triage.js +94 -0
  375. package/bundle/standalone/node_modules/kxta-core/dist/journal/event-triage.js.map +1 -0
  376. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.js +2 -2
  377. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.js.map +1 -1
  378. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.d.ts.map +1 -1
  379. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.js +5 -0
  380. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.js.map +1 -1
  381. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tool-classes.d.ts.map +1 -1
  382. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tool-classes.js +30 -5
  383. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tool-classes.js.map +1 -1
  384. package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.js +2 -2
  385. package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.d.ts +34 -0
  386. package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.d.ts.map +1 -1
  387. package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.js +251 -6
  388. package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.js.map +1 -1
  389. package/bundle/standalone/node_modules/kxta-core/dist/journal/types.d.ts +1 -0
  390. package/bundle/standalone/node_modules/kxta-core/dist/journal/types.d.ts.map +1 -1
  391. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/alerts.d.ts +8 -0
  392. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/alerts.d.ts.map +1 -0
  393. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/alerts.js +8 -0
  394. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/alerts.js.map +1 -0
  395. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/entry.d.ts +31 -0
  396. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/entry.d.ts.map +1 -0
  397. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/entry.js +55 -0
  398. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/entry.js.map +1 -0
  399. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/index.d.ts +10 -0
  400. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/index.d.ts.map +1 -0
  401. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/index.js +7 -0
  402. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/index.js.map +1 -0
  403. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/install.d.ts +46 -0
  404. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/install.d.ts.map +1 -0
  405. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/install.js +113 -0
  406. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/install.js.map +1 -0
  407. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/claude-code.d.ts +3 -0
  408. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/claude-code.d.ts.map +1 -0
  409. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/claude-code.js +115 -0
  410. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/claude-code.js.map +1 -0
  411. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/codex.d.ts +3 -0
  412. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/codex.d.ts.map +1 -0
  413. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/codex.js +76 -0
  414. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/codex.js.map +1 -0
  415. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/continue.d.ts +3 -0
  416. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/continue.d.ts.map +1 -0
  417. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/continue.js +64 -0
  418. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/continue.js.map +1 -0
  419. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/hermes.d.ts +3 -0
  420. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/hermes.d.ts.map +1 -0
  421. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/hermes.js +90 -0
  422. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/hermes.js.map +1 -0
  423. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/index.d.ts +3 -0
  424. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/index.d.ts.map +1 -0
  425. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/index.js +17 -0
  426. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/index.js.map +1 -0
  427. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/json-servers.d.ts +31 -0
  428. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/json-servers.d.ts.map +1 -0
  429. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/json-servers.js +136 -0
  430. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/json-servers.js.map +1 -0
  431. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/rules.d.ts +5 -0
  432. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/rules.d.ts.map +1 -0
  433. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/rules.js +19 -0
  434. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/rules.js.map +1 -0
  435. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.d.ts +5 -0
  436. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.d.ts.map +1 -0
  437. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.js +62 -0
  438. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.js.map +1 -0
  439. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/types.d.ts +55 -0
  440. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/types.d.ts.map +1 -0
  441. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/types.js +2 -0
  442. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/types.js.map +1 -0
  443. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/write.d.ts +3 -0
  444. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/write.d.ts.map +1 -0
  445. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/write.js +25 -0
  446. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/write.js.map +1 -0
  447. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/yaml-config.d.ts +5 -0
  448. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/yaml-config.d.ts.map +1 -0
  449. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/yaml-config.js +17 -0
  450. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/yaml-config.js.map +1 -0
  451. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.d.ts.map +1 -1
  452. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.js +12 -1
  453. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.js.map +1 -1
  454. package/bundle/standalone/node_modules/kxta-core/dist/project-map/index.js +1 -1
  455. package/bundle/standalone/node_modules/kxta-core/dist/rerank/arbitrator.d.ts +29 -0
  456. package/bundle/standalone/node_modules/kxta-core/dist/rerank/arbitrator.d.ts.map +1 -0
  457. package/bundle/standalone/node_modules/kxta-core/dist/rerank/arbitrator.js +68 -0
  458. package/bundle/standalone/node_modules/kxta-core/dist/rerank/arbitrator.js.map +1 -0
  459. package/bundle/standalone/node_modules/kxta-core/dist/rerank/engine.d.ts +57 -0
  460. package/bundle/standalone/node_modules/kxta-core/dist/rerank/engine.d.ts.map +1 -0
  461. package/bundle/standalone/node_modules/kxta-core/dist/rerank/engine.js +199 -0
  462. package/bundle/standalone/node_modules/kxta-core/dist/rerank/engine.js.map +1 -0
  463. package/bundle/standalone/node_modules/kxta-core/dist/rerank/index.d.ts +7 -0
  464. package/bundle/standalone/node_modules/kxta-core/dist/rerank/index.d.ts.map +1 -0
  465. package/bundle/standalone/node_modules/kxta-core/dist/rerank/index.js +8 -0
  466. package/bundle/standalone/node_modules/kxta-core/dist/rerank/index.js.map +1 -0
  467. package/bundle/standalone/node_modules/kxta-core/dist/rerank/types.d.ts +50 -0
  468. package/bundle/standalone/node_modules/kxta-core/dist/rerank/types.d.ts.map +1 -0
  469. package/bundle/standalone/node_modules/kxta-core/dist/rerank/types.js +2 -0
  470. package/bundle/standalone/node_modules/kxta-core/dist/rerank/types.js.map +1 -0
  471. package/bundle/standalone/node_modules/kxta-core/dist/types.d.ts +5 -0
  472. package/bundle/standalone/node_modules/kxta-core/dist/types.d.ts.map +1 -1
  473. package/bundle/standalone/node_modules/kxta-core/dist/util/paths.js +1 -1
  474. package/bundle/standalone/node_modules/kxta-core/package.json +7 -3
  475. package/bundle/standalone/node_modules/kxta-publish/package.json +3 -3
  476. package/bundle/standalone/package.json +3 -2
  477. package/dist/connect-AL5DTU3K.js +22 -0
  478. package/dist/index.js +7 -1
  479. package/dist/{start-RJVUJT4B.js → start-GP4ERBBP.js} +7 -0
  480. package/package.json +6 -2
  481. package/bundle/standalone/apps/web/.next/static/chunks/app/api/about/route-0cc6597bb67aea3b.js +0 -1
  482. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/hooks/route-0cc6597bb67aea3b.js +0 -1
  483. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/route-0cc6597bb67aea3b.js +0 -1
  484. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/route-0cc6597bb67aea3b.js +0 -1
  485. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/login/route-0cc6597bb67aea3b.js +0 -1
  486. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/logout/route-0cc6597bb67aea3b.js +0 -1
  487. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/setup/route-0cc6597bb67aea3b.js +0 -1
  488. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/status/route-0cc6597bb67aea3b.js +0 -1
  489. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/token/route-0cc6597bb67aea3b.js +0 -1
  490. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/conflicts/route-0cc6597bb67aea3b.js +0 -1
  491. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/[id]/route-0cc6597bb67aea3b.js +0 -1
  492. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/route-0cc6597bb67aea3b.js +0 -1
  493. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/[id]/route-0cc6597bb67aea3b.js +0 -1
  494. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/route-0cc6597bb67aea3b.js +0 -1
  495. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/ics/route-0cc6597bb67aea3b.js +0 -1
  496. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/links/route-0cc6597bb67aea3b.js +0 -1
  497. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/settings/route-0cc6597bb67aea3b.js +0 -1
  498. package/bundle/standalone/apps/web/.next/static/chunks/app/api/clip/route-0cc6597bb67aea3b.js +0 -1
  499. package/bundle/standalone/apps/web/.next/static/chunks/app/api/docker-config/route-0cc6597bb67aea3b.js +0 -1
  500. package/bundle/standalone/apps/web/.next/static/chunks/app/api/export/zip/route-0cc6597bb67aea3b.js +0 -1
  501. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/backlinks/route-0cc6597bb67aea3b.js +0 -1
  502. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/download/route-0cc6597bb67aea3b.js +0 -1
  503. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-html/route-0cc6597bb67aea3b.js +0 -1
  504. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-pdf/route-0cc6597bb67aea3b.js +0 -1
  505. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/restore/route-0cc6597bb67aea3b.js +0 -1
  506. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/route-0cc6597bb67aea3b.js +0 -1
  507. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/move/route-0cc6597bb67aea3b.js +0 -1
  508. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/route-0cc6597bb67aea3b.js +0 -1
  509. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/route-0cc6597bb67aea3b.js +0 -1
  510. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/upload/route-0cc6597bb67aea3b.js +0 -1
  511. package/bundle/standalone/apps/web/.next/static/chunks/app/api/folders/route-0cc6597bb67aea3b.js +0 -1
  512. package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/remote/route-0cc6597bb67aea3b.js +0 -1
  513. package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/sync-all/route-0cc6597bb67aea3b.js +0 -1
  514. package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/test-pattern/route-0cc6597bb67aea3b.js +0 -1
  515. package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/validate/route-0cc6597bb67aea3b.js +0 -1
  516. package/bundle/standalone/apps/web/.next/static/chunks/app/api/health/route-0cc6597bb67aea3b.js +0 -1
  517. package/bundle/standalone/apps/web/.next/static/chunks/app/api/install-snippets/route-0cc6597bb67aea3b.js +0 -1
  518. package/bundle/standalone/apps/web/.next/static/chunks/app/api/mcp-tools/route-0cc6597bb67aea3b.js +0 -1
  519. package/bundle/standalone/apps/web/.next/static/chunks/app/api/profile/route-0cc6597bb67aea3b.js +0 -1
  520. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/hands-config/route-0cc6597bb67aea3b.js +0 -1
  521. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-config/route-0cc6597bb67aea3b.js +0 -1
  522. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-status/route-0cc6597bb67aea3b.js +0 -1
  523. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/onboard/route-0cc6597bb67aea3b.js +0 -1
  524. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/refresh/route-0cc6597bb67aea3b.js +0 -1
  525. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/route-0cc6597bb67aea3b.js +0 -1
  526. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/sync/route-0cc6597bb67aea3b.js +0 -1
  527. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/onboard/route-0cc6597bb67aea3b.js +0 -1
  528. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/route-0cc6597bb67aea3b.js +0 -1
  529. package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/html/route-0cc6597bb67aea3b.js +0 -1
  530. package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/route-0cc6597bb67aea3b.js +0 -1
  531. package/bundle/standalone/apps/web/.next/static/chunks/app/api/refresh/route-0cc6597bb67aea3b.js +0 -1
  532. package/bundle/standalone/apps/web/.next/static/chunks/app/api/reindex/route-0cc6597bb67aea3b.js +0 -1
  533. package/bundle/standalone/apps/web/.next/static/chunks/app/api/reports/resources/[name]/route-0cc6597bb67aea3b.js +0 -1
  534. package/bundle/standalone/apps/web/.next/static/chunks/app/api/search/route-0cc6597bb67aea3b.js +0 -1
  535. package/bundle/standalone/apps/web/.next/static/chunks/app/api/tags/route-0cc6597bb67aea3b.js +0 -1
  536. package/bundle/standalone/apps/web/.next/static/chunks/app/api/version-check/route-0cc6597bb67aea3b.js +0 -1
  537. package/bundle/standalone/apps/web/.next/static/chunks/app/api/welcome/route-0cc6597bb67aea3b.js +0 -1
  538. package/bundle/standalone/apps/web/.next/static/chunks/app/api/ws-config/route-0cc6597bb67aea3b.js +0 -1
  539. package/bundle/standalone/apps/web/.next/static/chunks/app/calendar/page-f9542f9f518f9257.js +0 -1
  540. package/bundle/standalone/apps/web/.next/static/chunks/app/page-19695d4fd9fa5c0a.js +0 -1
  541. package/bundle/standalone/apps/web/.next/static/chunks/app/preview/motifs/page-0cc6597bb67aea3b.js +0 -1
  542. /package/bundle/standalone/apps/web/.next/static/{KgyobLEcr42ig4jXUMcNO → olhhWqI4356zOu5Kz_S1K}/_buildManifest.js +0 -0
  543. /package/bundle/standalone/apps/web/.next/static/{KgyobLEcr42ig4jXUMcNO → olhhWqI4356zOu5Kz_S1K}/_ssgManifest.js +0 -0
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Inference Runtime — singleton manager for ONNX model lifecycles.
3
+ *
4
+ * Responsibilities:
5
+ * 1. Initialize @huggingface/transformers environment variables
6
+ * 2. Select execution device (auto-detect CPU vs GPU)
7
+ * 3. Lazy-load models on first inference call
8
+ * 4. Handle graceful teardown via beforeExit hooks
9
+ */
10
+ import type { ModelRuntimeConfig, ModelSessionStatus, ExecutionDevice } from "./types.js";
11
+ /**
12
+ * Runtime state for a single loaded model.
13
+ */
14
+ export interface ModelSession {
15
+ config: ModelRuntimeConfig;
16
+ device: string;
17
+ /** Cache directory the model was resolved from. */
18
+ cacheDir: string;
19
+ loadedAt: number;
20
+ memoryRssBytes: number;
21
+ /** Lazy-loaded model instance (ONNX runtime object, tokenizer/model pair, or transformers pipeline). */
22
+ instance: unknown;
23
+ }
24
+ /**
25
+ * Set (or clear) the configured execution device.
26
+ */
27
+ export declare function setInferenceDevice(device: ExecutionDevice | null): void;
28
+ /**
29
+ * Get the configured execution device, if any.
30
+ */
31
+ export declare function getInferenceDevice(): ExecutionDevice | null;
32
+ declare class InferenceRuntime {
33
+ private static _instance;
34
+ private _sessions;
35
+ private _initialized;
36
+ private _teardownRegistered;
37
+ /**
38
+ * Get the singleton instance.
39
+ */
40
+ static get instance(): InferenceRuntime;
41
+ private constructor();
42
+ /**
43
+ * Initialize the inference runtime.
44
+ * Sets up transformers environment variables and device selection.
45
+ */
46
+ initialize(): void;
47
+ /**
48
+ * Detect the best available execution device.
49
+ * Returns the configured device (from `system1.device`) when set, otherwise
50
+ * defaults to "cpu" — GPU detection can be added later.
51
+ */
52
+ detectDevice(): ExecutionDevice;
53
+ /**
54
+ * Resolve the final device for a model config.
55
+ * Merges user-specified device with auto-detection.
56
+ */
57
+ resolveDevice(config: ModelRuntimeConfig): string;
58
+ /**
59
+ * Get or lazily load a model session.
60
+ *
61
+ * @param config - Model configuration
62
+ * @returns The loaded model session
63
+ */
64
+ getModelSession(config: ModelRuntimeConfig): Promise<ModelSession>;
65
+ /**
66
+ * Load a specific model instance based on config.
67
+ * Handles different model types (cross-encoder, classifier, etc.).
68
+ */
69
+ private loadModel;
70
+ /**
71
+ * Get the current RSS memory usage of this Node.js process.
72
+ */
73
+ private getProcessMemoryRss;
74
+ /**
75
+ * Get the status of a loaded model.
76
+ */
77
+ getModelStatus(modelId: string): ModelSessionStatus | null;
78
+ /**
79
+ * Check if a specific model is loaded and available.
80
+ */
81
+ isModelLoaded(modelId: string): boolean;
82
+ /**
83
+ * Get all loaded model statuses.
84
+ */
85
+ getAllModelStatuses(): ModelSessionStatus[];
86
+ /**
87
+ * Get the number of currently loaded models.
88
+ */
89
+ get loadedCount(): number;
90
+ /**
91
+ * Shutdown and clean up all model sessions.
92
+ */
93
+ shutdown(): void;
94
+ /**
95
+ * Clear a specific model from cache (force reload next time).
96
+ */
97
+ clearModelCache(modelId: string): void;
98
+ /**
99
+ * Clear all model sessions (useful for testing or hot-reload).
100
+ */
101
+ clearAllSessions(): void;
102
+ }
103
+ /**
104
+ * Export singleton instance for use throughout the codebase.
105
+ */
106
+ export declare const inferenceRuntime: InferenceRuntime;
107
+ /**
108
+ * Convenience function to get a model session.
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * const session = await getModel("Xenova/ms-marco-MiniLM-L-6-v2");
113
+ * if (session.instance) {
114
+ * // Use the model
115
+ * }
116
+ * ```
117
+ */
118
+ export declare function getModel(config: ModelRuntimeConfig): Promise<ModelSession>;
119
+ /**
120
+ * Check if a model is loaded.
121
+ */
122
+ export declare function isLoaded(modelId: string): boolean;
123
+ /**
124
+ * Get model status.
125
+ */
126
+ export declare function getStatus(modelId: string): ModelSessionStatus | null;
127
+ /**
128
+ * Get all model statuses.
129
+ */
130
+ export declare function getAllStatuses(): ModelSessionStatus[];
131
+ export {};
132
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/inference/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAI1F;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,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AAgB,kBAA4B,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAEhF;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAEpE;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,kBAAkB,EAAE,CAErD"}
@@ -0,0 +1,311 @@
1
+ /**
2
+ * Inference Runtime — singleton manager for ONNX model lifecycles.
3
+ *
4
+ * Responsibilities:
5
+ * 1. Initialize @huggingface/transformers environment variables
6
+ * 2. Select execution device (auto-detect CPU vs GPU)
7
+ * 3. Lazy-load models on first inference call
8
+ * 4. Handle graceful teardown via beforeExit hooks
9
+ */
10
+ import { getModelCacheDir, invalidateModelCache } from "./cache-manager.js";
11
+ import { resolveBundledModelsDir } from "./bundled.js";
12
+ /**
13
+ * Default timeout for inference operations (milliseconds).
14
+ */
15
+ const DEFAULT_TIMEOUT_MS = 300;
16
+ /**
17
+ * Default device when user specifies "auto".
18
+ */
19
+ const DEFAULT_AUTO_DEVICE = "cpu";
20
+ /**
21
+ * Configured execution device (from `system1.device` in kontexta.json).
22
+ * When set to a concrete device it is used directly; "auto" falls through to
23
+ * detection.
24
+ */
25
+ let _configuredDevice = null;
26
+ /**
27
+ * Set (or clear) the configured execution device.
28
+ */
29
+ export function setInferenceDevice(device) {
30
+ _configuredDevice = device && device !== "auto" ? device : null;
31
+ }
32
+ /**
33
+ * Get the configured execution device, if any.
34
+ */
35
+ export function getInferenceDevice() {
36
+ return _configuredDevice;
37
+ }
38
+ class InferenceRuntime {
39
+ static _instance = null;
40
+ _sessions = new Map();
41
+ _initialized = false;
42
+ _teardownRegistered = false;
43
+ /**
44
+ * Get the singleton instance.
45
+ */
46
+ static get instance() {
47
+ if (!InferenceRuntime._instance) {
48
+ InferenceRuntime._instance = new InferenceRuntime();
49
+ }
50
+ return InferenceRuntime._instance;
51
+ }
52
+ constructor() {
53
+ // Initialize transformers environment on first access
54
+ if (!this._initialized) {
55
+ this.initialize();
56
+ }
57
+ }
58
+ /**
59
+ * Initialize the inference runtime.
60
+ * Sets up transformers environment variables and device selection.
61
+ */
62
+ initialize() {
63
+ if (this._initialized)
64
+ return;
65
+ // Configure @huggingface/transformers to use our cache directory
66
+ const cacheDir = getModelCacheDir();
67
+ // These environment variables control the HF transformers library behavior
68
+ if (!process.env.HF_HOME) {
69
+ process.env.HF_HOME = cacheDir;
70
+ }
71
+ if (!process.env.TRANSFORMERS_CACHE) {
72
+ process.env.TRANSFORMERS_CACHE = cacheDir;
73
+ }
74
+ if (!process.env.HUGGINGFACE_HUB_CACHE) {
75
+ process.env.HUGGINGFACE_HUB_CACHE = cacheDir;
76
+ }
77
+ // Disable remote model downloads telemetry
78
+ process.env.HF_HUB_DISABLE_TELEMETRY = "1";
79
+ this._initialized = true;
80
+ // Register teardown hook if not already done
81
+ if (!this._teardownRegistered) {
82
+ this._teardownRegistered = true;
83
+ process.on("beforeExit", () => this.shutdown());
84
+ }
85
+ }
86
+ /**
87
+ * Detect the best available execution device.
88
+ * Returns the configured device (from `system1.device`) when set, otherwise
89
+ * defaults to "cpu" — GPU detection can be added later.
90
+ */
91
+ detectDevice() {
92
+ return _configuredDevice ?? DEFAULT_AUTO_DEVICE;
93
+ }
94
+ /**
95
+ * Resolve the final device for a model config.
96
+ * Merges user-specified device with auto-detection.
97
+ */
98
+ resolveDevice(config) {
99
+ const device = config.device ?? "auto";
100
+ if (device === "auto") {
101
+ return this.detectDevice();
102
+ }
103
+ return device;
104
+ }
105
+ /**
106
+ * Get or lazily load a model session.
107
+ *
108
+ * @param config - Model configuration
109
+ * @returns The loaded model session
110
+ */
111
+ async getModelSession(config) {
112
+ // Return cached session if available
113
+ const existing = this._sessions.get(config.modelId);
114
+ if (existing)
115
+ return existing;
116
+ const device = this.resolveDevice(config);
117
+ const cacheDir = config.cacheDir ?? getModelCacheDir();
118
+ const startTime = Date.now();
119
+ const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
120
+ try {
121
+ const modelInstance = await this.loadModel(config, device);
122
+ const loadDuration = Date.now() - startTime;
123
+ const memoryRss = this.getProcessMemoryRss();
124
+ const session = {
125
+ config,
126
+ device,
127
+ cacheDir,
128
+ loadedAt: startTime,
129
+ memoryRssBytes: memoryRss,
130
+ instance: modelInstance,
131
+ };
132
+ this._sessions.set(config.modelId, session);
133
+ return session;
134
+ }
135
+ catch (error) {
136
+ // If model fails to load (missing, corrupt, etc.), do NOT throw.
137
+ // Return a null session to signal the caller to fall back to heuristics.
138
+ console.warn(`[InferenceRuntime] Failed to load model ${config.modelId}: ${error instanceof Error ? error.message : String(error)}`);
139
+ const failedSession = {
140
+ config,
141
+ device,
142
+ cacheDir,
143
+ loadedAt: startTime,
144
+ memoryRssBytes: 0,
145
+ instance: null,
146
+ };
147
+ this._sessions.set(config.modelId, failedSession);
148
+ return failedSession;
149
+ }
150
+ }
151
+ /**
152
+ * Load a specific model instance based on config.
153
+ * Handles different model types (cross-encoder, classifier, etc.).
154
+ */
155
+ async loadModel(config, device) {
156
+ const { AutoTokenizer, AutoModelForSequenceClassification, pipeline, env } = await import("@huggingface/transformers");
157
+ env.cacheDir = config.cacheDir ?? getModelCacheDir();
158
+ env.allowLocalModels = true;
159
+ const bundled = resolveBundledModelsDir(config.modelId);
160
+ if (bundled) {
161
+ env.localModelPath = bundled;
162
+ env.allowRemoteModels = false;
163
+ }
164
+ else {
165
+ env.allowRemoteModels = true;
166
+ }
167
+ // Set device preference for transformers
168
+ if (device === "cpu" && env.backends?.onnx?.wasm) {
169
+ env.backends.onnx.wasm.numThreads = 1; // Avoid CPU starvation
170
+ }
171
+ // Sequence classification / cross-encoder model
172
+ if (config.modelId.includes("ms-marco") ||
173
+ config.modelId.includes("rerank") ||
174
+ config.subfolder === "cross-encoder") {
175
+ const tokenizer = await AutoTokenizer.from_pretrained(config.modelId);
176
+ const model = await AutoModelForSequenceClassification.from_pretrained(config.modelId);
177
+ return { tokenizer, model, type: "cross-encoder" };
178
+ }
179
+ // Default pipeline fallback
180
+ const modelInstance = await pipeline("feature-extraction", config.modelId, {
181
+ progress_callback: () => { },
182
+ });
183
+ return modelInstance;
184
+ }
185
+ /**
186
+ * Get the current RSS memory usage of this Node.js process.
187
+ */
188
+ getProcessMemoryRss() {
189
+ try {
190
+ if (process.memoryUsage) {
191
+ return process.memoryUsage().rss;
192
+ }
193
+ }
194
+ catch {
195
+ // Fallback if memoryUsage is unavailable (unlikely in Node.js)
196
+ }
197
+ return 0;
198
+ }
199
+ /**
200
+ * Get the status of a loaded model.
201
+ */
202
+ getModelStatus(modelId) {
203
+ const session = this._sessions.get(modelId);
204
+ if (!session)
205
+ return null;
206
+ return {
207
+ modelId,
208
+ loaded: session.instance !== null,
209
+ device: session.device,
210
+ memoryRssBytes: session.memoryRssBytes,
211
+ loadDurationMs: Date.now() - session.loadedAt,
212
+ cacheDir: session.cacheDir,
213
+ };
214
+ }
215
+ /**
216
+ * Check if a specific model is loaded and available.
217
+ */
218
+ isModelLoaded(modelId) {
219
+ const session = this._sessions.get(modelId);
220
+ return session !== undefined && session.instance !== null && session.instance !== undefined;
221
+ }
222
+ /**
223
+ * Get all loaded model statuses.
224
+ */
225
+ getAllModelStatuses() {
226
+ const statuses = [];
227
+ for (const [modelId] of this._sessions) {
228
+ const status = this.getModelStatus(modelId);
229
+ if (status)
230
+ statuses.push(status);
231
+ }
232
+ return statuses;
233
+ }
234
+ /**
235
+ * Get the number of currently loaded models.
236
+ */
237
+ get loadedCount() {
238
+ return this._sessions.size;
239
+ }
240
+ /**
241
+ * Shutdown and clean up all model sessions.
242
+ */
243
+ shutdown() {
244
+ for (const [modelId, session] of this._sessions) {
245
+ try {
246
+ // Attempt to dispose model resources
247
+ if (session.instance && typeof session.instance === "object" && "dispose" in session.instance) {
248
+ const disposeFn = session.instance.dispose;
249
+ if (typeof disposeFn === "function") {
250
+ disposeFn();
251
+ }
252
+ }
253
+ }
254
+ catch {
255
+ // Best-effort cleanup — don't throw during shutdown
256
+ }
257
+ }
258
+ this._sessions.clear();
259
+ this._initialized = false;
260
+ }
261
+ /**
262
+ * Clear a specific model from cache (force reload next time).
263
+ */
264
+ clearModelCache(modelId) {
265
+ this._sessions.delete(modelId);
266
+ invalidateModelCache(modelId);
267
+ }
268
+ /**
269
+ * Clear all model sessions (useful for testing or hot-reload).
270
+ */
271
+ clearAllSessions() {
272
+ this.shutdown();
273
+ }
274
+ }
275
+ /**
276
+ * Export singleton instance for use throughout the codebase.
277
+ */
278
+ export const inferenceRuntime = InferenceRuntime.instance;
279
+ /**
280
+ * Convenience function to get a model session.
281
+ *
282
+ * @example
283
+ * ```typescript
284
+ * const session = await getModel("Xenova/ms-marco-MiniLM-L-6-v2");
285
+ * if (session.instance) {
286
+ * // Use the model
287
+ * }
288
+ * ```
289
+ */
290
+ export async function getModel(config) {
291
+ return InferenceRuntime.instance.getModelSession(config);
292
+ }
293
+ /**
294
+ * Check if a model is loaded.
295
+ */
296
+ export function isLoaded(modelId) {
297
+ return InferenceRuntime.instance.isModelLoaded(modelId);
298
+ }
299
+ /**
300
+ * Get model status.
301
+ */
302
+ export function getStatus(modelId) {
303
+ return InferenceRuntime.instance.getModelStatus(modelId);
304
+ }
305
+ /**
306
+ * Get all model statuses.
307
+ */
308
+ export function getAllStatuses() {
309
+ return InferenceRuntime.instance.getAllModelStatuses();
310
+ }
311
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/inference/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,gBAAgB,EAAwC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAgBv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QAAQ,CAAC,OAAe;IACtC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,gBAAgB,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC;AACzD,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Type definitions for the System 1 local inference substrate.
3
+ * Supports cross-encoder reranking (Tier 1) and multi-head decision models (Tier 2).
4
+ */
5
+ /** Execution target for ONNX model inference. */
6
+ export type ExecutionDevice = "cpu" | "gpu" | "auto" | "wasm";
7
+ /**
8
+ * Configuration for loading a single ONNX model from HuggingFace.
9
+ */
10
+ export interface ModelRuntimeConfig {
11
+ /** HuggingFace model identifier, e.g. "Xenova/ms-marco-MiniLM-L-6-v2". */
12
+ modelId: string;
13
+ /** Optional subfolder within the repo (rarely needed). */
14
+ subfolder?: string;
15
+ /** Target execution device. Default: "auto". */
16
+ device?: ExecutionDevice;
17
+ /** Hard timeout in ms for a single inference call. Default: 300. */
18
+ timeoutMs?: number;
19
+ /**
20
+ * Optional cache directory override. Falls back to global cache manager
21
+ * resolution when omitted.
22
+ */
23
+ cacheDir?: string;
24
+ }
25
+ /**
26
+ * Status snapshot of a loaded model session.
27
+ */
28
+ export interface ModelSessionStatus {
29
+ modelId: string;
30
+ loaded: boolean;
31
+ device: string;
32
+ memoryRssBytes: number;
33
+ loadDurationMs: number;
34
+ /** Directory where the model's ONNX weights are cached. */
35
+ cacheDir?: string;
36
+ }
37
+ /**
38
+ * Tier classification for model usage.
39
+ * Tier 1: Fast pairwise reranker (cross-encoder).
40
+ * Tier 2: Multi-head decision engine (classifier).
41
+ */
42
+ export type ModelTier = "tier1-reranker" | "tier2-decision";
43
+ /**
44
+ * Registry entry mapping a logical model name to its runtime config and tier.
45
+ */
46
+ export interface ModelRegistryEntry {
47
+ name: string;
48
+ config: ModelRuntimeConfig;
49
+ tier: ModelTier;
50
+ /** Whether this model is required for core functionality. Default: false. */
51
+ required?: boolean;
52
+ }
53
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/inference/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,CAAC;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Type definitions for the System 1 local inference substrate.
3
+ * Supports cross-encoder reranking (Tier 1) and multi-head decision models (Tier 2).
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/inference/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,7 +1,7 @@
1
1
  // packages/core/src/journal/distill.ts
2
2
  import { readFileSync, readdirSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
- import { groupEvents, lastBranchOf } from "./topic-detector.js";
4
+ import { groupEvents, lastBranchOf, classifyTaskCategory } from "./topic-detector.js";
5
5
  import { renderMechanicalEntry, touchedFilesOf } from "./renderer.js";
6
6
  import { readHighWater, writeHighWater } from "./high-water.js";
7
7
  import { upsertJournalMeta, openTasksForProject, gitRefsForFiles } from "./repository.js";
@@ -80,7 +80,7 @@ export async function distillJournal(opts) {
80
80
  mkdirSync(dir, { recursive: true });
81
81
  const filename = `task-${bucket.task_slug}.md`;
82
82
  const filePath = join(dir, filename);
83
- let fm = buildFrontmatter(bucket, opts.projectSlug);
83
+ let fm = await buildFrontmatter(bucket, opts.projectSlug);
84
84
  const entry = renderMechanicalEntry({
85
85
  task_slug: bucket.task_slug,
86
86
  events: bucket.events,
@@ -99,7 +99,7 @@ export async function distillJournal(opts) {
99
99
  }
100
100
  tasksTouched.push(bucket.task_slug);
101
101
  // Index — register the file in `files` table if not yet, then upsert journal_meta
102
- const fileId = ensureFileRecord(filePath, fm.task, opts.projectId);
102
+ const fileId = ensureFileRecord(filePath, fm.task);
103
103
  upsertJournalMeta({
104
104
  file_id: fileId,
105
105
  project_id: opts.projectId,
@@ -192,7 +192,7 @@ function readRawEvents(opts, sinceTs, untilTs, max, seenKeys) {
192
192
  // itself "default"), check project affinity.
193
193
  if (isMergedDefaultDir && dir === defaultDir) {
194
194
  const matchesProject = (ev.args?.project_id === opts.projectId) ||
195
- (ev.touched?.some(p => p.startsWith(opts.projectSlug)));
195
+ (ev.touched?.some(p => { const n = p.replace(/\\/g, "/"); return n === opts.projectSlug || n.startsWith(`${opts.projectSlug}/`) || n.includes(`/${opts.projectSlug}/`); }));
196
196
  if (!matchesProject)
197
197
  continue;
198
198
  }
@@ -236,7 +236,7 @@ function loadOpenTasks(opts) {
236
236
  };
237
237
  });
238
238
  }
239
- function buildFrontmatter(bucket, projectSlug) {
239
+ async function buildFrontmatter(bucket, projectSlug) {
240
240
  const events = bucket.events;
241
241
  const touched = touchedFilesOf(events);
242
242
  // git_context events are consumed by the grouper rather than bucketed, so the bucket carries the branches that were current.
@@ -249,7 +249,15 @@ function buildFrontmatter(bucket, projectSlug) {
249
249
  ])];
250
250
  const startedAt = events[0].ts;
251
251
  const lastActiveAt = events[events.length - 1].ts;
252
- return {
252
+ // Classify task category (async, may fall back to heuristic)
253
+ let category;
254
+ try {
255
+ category = await classifyTaskCategory(events);
256
+ }
257
+ catch {
258
+ // Best-effort: skip category if classification fails
259
+ }
260
+ const frontmatter = {
253
261
  task: bucket.task_slug,
254
262
  project: projectSlug,
255
263
  tags: ["mechanical"],
@@ -260,6 +268,11 @@ function buildFrontmatter(bucket, projectSlug) {
260
268
  last_active_at: lastActiveAt,
261
269
  distilled_from: [`raw/${startedAt.slice(0, 10)}.jsonl`], // approximate; refine if multi-day
262
270
  };
271
+ // Inject category if available
272
+ if (category) {
273
+ frontmatter.category = category;
274
+ }
275
+ return frontmatter;
263
276
  }
264
277
  function gitRefsFor(fm) {
265
278
  return [
@@ -382,14 +395,17 @@ function mergeFrontmatter(prior, next) {
382
395
  distilled_from: union(prior.distilled_from, next.distilled_from),
383
396
  };
384
397
  }
385
- function ensureFileRecord(filePath, title, projectId) {
398
+ // Journal files are KB files (no project on the files row); journal_meta.project_id records the owning project.
399
+ function ensureFileRecord(filePath, title) {
386
400
  const db = getDatabase();
387
401
  const existing = db.prepare(`SELECT id FROM files WHERE path = ?`).get(filePath);
388
- if (existing)
402
+ if (existing) {
403
+ db.prepare(`UPDATE files SET project_id = NULL WHERE id = ? AND project_id IS NOT NULL`).run(existing.id);
389
404
  return existing.id;
405
+ }
390
406
  const result = db.prepare(`
391
- INSERT INTO files (path, title, project_id, storage_type) VALUES (?, ?, ?, 'local')
392
- `).run(filePath, title, projectId);
407
+ INSERT INTO files (path, title, project_id, storage_type) VALUES (?, ?, NULL, 'local')
408
+ `).run(filePath, title);
393
409
  return Number(result.lastInsertRowid);
394
410
  }
395
411
  //# sourceMappingURL=distill.js.map