kontexta 5.1.3 → 5.2.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 (436) hide show
  1. package/bundle/standalone/CHANGELOG.md +18 -0
  2. package/bundle/standalone/apps/web/.next/BUILD_ID +1 -1
  3. package/bundle/standalone/apps/web/.next/app-build-manifest.json +91 -84
  4. package/bundle/standalone/apps/web/.next/app-path-routes-manifest.json +11 -10
  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/routes-manifest.json +8 -0
  8. package/bundle/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  9. package/bundle/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  10. package/bundle/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  11. package/bundle/standalone/apps/web/.next/server/app/_not-found.rsc +2 -2
  12. package/bundle/standalone/apps/web/.next/server/app/api/about/route.js.nft.json +1 -1
  13. package/bundle/standalone/apps/web/.next/server/app/api/about/route_client-reference-manifest.js +1 -1
  14. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/hooks/route.js +1 -1
  15. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/hooks/route.js.nft.json +1 -1
  16. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/hooks/route_client-reference-manifest.js +1 -1
  17. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/mcp/route.js +1 -0
  18. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/mcp/route.js.nft.json +1 -0
  19. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/mcp/route_client-reference-manifest.js +1 -0
  20. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/route.js +1 -1
  21. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/route.js.nft.json +1 -1
  22. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/route_client-reference-manifest.js +1 -1
  23. package/bundle/standalone/apps/web/.next/server/app/api/agents/route.js +1 -1
  24. package/bundle/standalone/apps/web/.next/server/app/api/agents/route.js.nft.json +1 -1
  25. package/bundle/standalone/apps/web/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  26. package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  27. package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  28. package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  29. package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  30. package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route.js.nft.json +1 -1
  31. package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
  32. package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  33. package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  34. package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route.js.nft.json +1 -1
  35. package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route_client-reference-manifest.js +1 -1
  36. package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route.js.nft.json +1 -1
  37. package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route_client-reference-manifest.js +1 -1
  38. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route.js.nft.json +1 -1
  39. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route_client-reference-manifest.js +1 -1
  40. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route.js.nft.json +1 -1
  41. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route_client-reference-manifest.js +1 -1
  42. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route.js.nft.json +1 -1
  43. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route_client-reference-manifest.js +1 -1
  44. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route.js.nft.json +1 -1
  45. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route_client-reference-manifest.js +1 -1
  46. package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route.js.nft.json +1 -1
  47. package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route_client-reference-manifest.js +1 -1
  48. package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route.js.nft.json +1 -1
  49. package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route_client-reference-manifest.js +1 -1
  50. package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route.js.nft.json +1 -1
  51. package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route_client-reference-manifest.js +1 -1
  52. package/bundle/standalone/apps/web/.next/server/app/api/clip/route.js.nft.json +1 -1
  53. package/bundle/standalone/apps/web/.next/server/app/api/clip/route_client-reference-manifest.js +1 -1
  54. package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route.js.nft.json +1 -1
  55. package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route_client-reference-manifest.js +1 -1
  56. package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route.js.nft.json +1 -1
  57. package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route_client-reference-manifest.js +1 -1
  58. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/backlinks/route.js.nft.json +1 -1
  59. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/backlinks/route_client-reference-manifest.js +1 -1
  60. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route.js.nft.json +1 -1
  61. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route_client-reference-manifest.js +1 -1
  62. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-html/route.js.nft.json +1 -1
  63. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-html/route_client-reference-manifest.js +1 -1
  64. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route.js.nft.json +1 -1
  65. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route_client-reference-manifest.js +1 -1
  66. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route.js.nft.json +1 -1
  67. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route_client-reference-manifest.js +1 -1
  68. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route.js.nft.json +1 -1
  69. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route_client-reference-manifest.js +1 -1
  70. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route.js.nft.json +1 -1
  71. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route_client-reference-manifest.js +1 -1
  72. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route.js.nft.json +1 -1
  73. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route_client-reference-manifest.js +1 -1
  74. package/bundle/standalone/apps/web/.next/server/app/api/files/route.js.nft.json +1 -1
  75. package/bundle/standalone/apps/web/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  76. package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route.js.nft.json +1 -1
  77. package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route_client-reference-manifest.js +1 -1
  78. package/bundle/standalone/apps/web/.next/server/app/api/folders/route.js +1 -1
  79. package/bundle/standalone/apps/web/.next/server/app/api/folders/route.js.nft.json +1 -1
  80. package/bundle/standalone/apps/web/.next/server/app/api/folders/route_client-reference-manifest.js +1 -1
  81. package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route.js.nft.json +1 -1
  82. package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route_client-reference-manifest.js +1 -1
  83. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route.js +1 -1
  84. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route.js.nft.json +1 -1
  85. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route_client-reference-manifest.js +1 -1
  86. package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route.js.nft.json +1 -1
  87. package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route_client-reference-manifest.js +1 -1
  88. package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route.js.nft.json +1 -1
  89. package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route_client-reference-manifest.js +1 -1
  90. package/bundle/standalone/apps/web/.next/server/app/api/health/route.js.nft.json +1 -1
  91. package/bundle/standalone/apps/web/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  92. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js +9 -9
  93. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js.nft.json +1 -1
  94. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route_client-reference-manifest.js +1 -1
  95. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js +1 -1
  96. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js.nft.json +1 -1
  97. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route_client-reference-manifest.js +1 -1
  98. package/bundle/standalone/apps/web/.next/server/app/api/profile/route.js.nft.json +1 -1
  99. package/bundle/standalone/apps/web/.next/server/app/api/profile/route_client-reference-manifest.js +1 -1
  100. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route.js.nft.json +1 -1
  101. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route_client-reference-manifest.js +1 -1
  102. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route.js.nft.json +1 -1
  103. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route_client-reference-manifest.js +1 -1
  104. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route.js.nft.json +1 -1
  105. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route_client-reference-manifest.js +1 -1
  106. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route.js.nft.json +1 -1
  107. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route_client-reference-manifest.js +1 -1
  108. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route.js.nft.json +1 -1
  109. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route_client-reference-manifest.js +1 -1
  110. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  111. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  112. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route.js.nft.json +1 -1
  113. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route_client-reference-manifest.js +1 -1
  114. package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route.js.nft.json +1 -1
  115. package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route_client-reference-manifest.js +1 -1
  116. package/bundle/standalone/apps/web/.next/server/app/api/projects/route.js.nft.json +1 -1
  117. package/bundle/standalone/apps/web/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  118. package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route.js.nft.json +1 -1
  119. package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route_client-reference-manifest.js +1 -1
  120. package/bundle/standalone/apps/web/.next/server/app/api/publish/route.js.nft.json +1 -1
  121. package/bundle/standalone/apps/web/.next/server/app/api/publish/route_client-reference-manifest.js +1 -1
  122. package/bundle/standalone/apps/web/.next/server/app/api/refresh/route.js.nft.json +1 -1
  123. package/bundle/standalone/apps/web/.next/server/app/api/refresh/route_client-reference-manifest.js +1 -1
  124. package/bundle/standalone/apps/web/.next/server/app/api/reindex/route.js.nft.json +1 -1
  125. package/bundle/standalone/apps/web/.next/server/app/api/reindex/route_client-reference-manifest.js +1 -1
  126. package/bundle/standalone/apps/web/.next/server/app/api/reports/resources/[name]/route.js.nft.json +1 -1
  127. package/bundle/standalone/apps/web/.next/server/app/api/reports/resources/[name]/route_client-reference-manifest.js +1 -1
  128. package/bundle/standalone/apps/web/.next/server/app/api/search/route.js.nft.json +1 -1
  129. package/bundle/standalone/apps/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  130. package/bundle/standalone/apps/web/.next/server/app/api/tags/route.js.nft.json +1 -1
  131. package/bundle/standalone/apps/web/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  132. package/bundle/standalone/apps/web/.next/server/app/api/version-check/route.js.nft.json +1 -1
  133. package/bundle/standalone/apps/web/.next/server/app/api/version-check/route_client-reference-manifest.js +1 -1
  134. package/bundle/standalone/apps/web/.next/server/app/api/welcome/route.js.nft.json +1 -1
  135. package/bundle/standalone/apps/web/.next/server/app/api/welcome/route_client-reference-manifest.js +1 -1
  136. package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route.js.nft.json +1 -1
  137. package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route_client-reference-manifest.js +1 -1
  138. package/bundle/standalone/apps/web/.next/server/app/apple-icon.png/route.js.nft.json +1 -1
  139. package/bundle/standalone/apps/web/.next/server/app/calendar/page.js +1 -1
  140. package/bundle/standalone/apps/web/.next/server/app/calendar/page.js.nft.json +1 -1
  141. package/bundle/standalone/apps/web/.next/server/app/calendar/page_client-reference-manifest.js +1 -1
  142. package/bundle/standalone/apps/web/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  143. package/bundle/standalone/apps/web/.next/server/app/icon.png/route.js.nft.json +1 -1
  144. package/bundle/standalone/apps/web/.next/server/app/login/page.js.nft.json +1 -1
  145. package/bundle/standalone/apps/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  146. package/bundle/standalone/apps/web/.next/server/app/page.js +4 -4
  147. package/bundle/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
  148. package/bundle/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  149. package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page.js.nft.json +1 -1
  150. package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page_client-reference-manifest.js +1 -1
  151. package/bundle/standalone/apps/web/.next/server/app/preview/motifs.html +2 -2
  152. package/bundle/standalone/apps/web/.next/server/app/preview/motifs.rsc +2 -2
  153. package/bundle/standalone/apps/web/.next/server/app-paths-manifest.json +11 -10
  154. package/bundle/standalone/apps/web/.next/server/pages/404.html +1 -1
  155. package/bundle/standalone/apps/web/.next/server/pages/500.html +1 -1
  156. package/bundle/standalone/apps/web/.next/server/pages/_app.js.nft.json +1 -1
  157. package/bundle/standalone/apps/web/.next/server/pages/_document.js.nft.json +1 -1
  158. package/bundle/standalone/apps/web/.next/server/pages/_error.js.nft.json +1 -1
  159. package/bundle/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  160. package/bundle/standalone/apps/web/.next/static/chunks/app/api/about/route-e920054b7eb00274.js +1 -0
  161. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/hooks/route-e920054b7eb00274.js +1 -0
  162. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/mcp/route-e920054b7eb00274.js +1 -0
  163. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/route-e920054b7eb00274.js +1 -0
  164. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/route-e920054b7eb00274.js +1 -0
  165. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/login/route-e920054b7eb00274.js +1 -0
  166. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/logout/route-e920054b7eb00274.js +1 -0
  167. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/setup/route-e920054b7eb00274.js +1 -0
  168. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/status/route-e920054b7eb00274.js +1 -0
  169. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/token/route-e920054b7eb00274.js +1 -0
  170. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/conflicts/route-e920054b7eb00274.js +1 -0
  171. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/[id]/route-e920054b7eb00274.js +1 -0
  172. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/route-e920054b7eb00274.js +1 -0
  173. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/[id]/route-e920054b7eb00274.js +1 -0
  174. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/route-e920054b7eb00274.js +1 -0
  175. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/ics/route-e920054b7eb00274.js +1 -0
  176. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/links/route-e920054b7eb00274.js +1 -0
  177. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/settings/route-e920054b7eb00274.js +1 -0
  178. package/bundle/standalone/apps/web/.next/static/chunks/app/api/clip/route-e920054b7eb00274.js +1 -0
  179. package/bundle/standalone/apps/web/.next/static/chunks/app/api/docker-config/route-e920054b7eb00274.js +1 -0
  180. package/bundle/standalone/apps/web/.next/static/chunks/app/api/export/zip/route-e920054b7eb00274.js +1 -0
  181. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/backlinks/route-e920054b7eb00274.js +1 -0
  182. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/download/route-e920054b7eb00274.js +1 -0
  183. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-html/route-e920054b7eb00274.js +1 -0
  184. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-pdf/route-e920054b7eb00274.js +1 -0
  185. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/restore/route-e920054b7eb00274.js +1 -0
  186. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/route-e920054b7eb00274.js +1 -0
  187. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/move/route-e920054b7eb00274.js +1 -0
  188. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/route-e920054b7eb00274.js +1 -0
  189. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/route-e920054b7eb00274.js +1 -0
  190. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/upload/route-e920054b7eb00274.js +1 -0
  191. package/bundle/standalone/apps/web/.next/static/chunks/app/api/folders/route-e920054b7eb00274.js +1 -0
  192. package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/remote/route-e920054b7eb00274.js +1 -0
  193. package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/sync-all/route-e920054b7eb00274.js +1 -0
  194. package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/test-pattern/route-e920054b7eb00274.js +1 -0
  195. package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/validate/route-e920054b7eb00274.js +1 -0
  196. package/bundle/standalone/apps/web/.next/static/chunks/app/api/health/route-e920054b7eb00274.js +1 -0
  197. package/bundle/standalone/apps/web/.next/static/chunks/app/api/install-snippets/route-e920054b7eb00274.js +1 -0
  198. package/bundle/standalone/apps/web/.next/static/chunks/app/api/mcp-tools/route-e920054b7eb00274.js +1 -0
  199. package/bundle/standalone/apps/web/.next/static/chunks/app/api/profile/route-e920054b7eb00274.js +1 -0
  200. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/hands-config/route-e920054b7eb00274.js +1 -0
  201. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-config/route-e920054b7eb00274.js +1 -0
  202. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-status/route-e920054b7eb00274.js +1 -0
  203. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/onboard/route-e920054b7eb00274.js +1 -0
  204. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/refresh/route-e920054b7eb00274.js +1 -0
  205. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/route-e920054b7eb00274.js +1 -0
  206. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/sync/route-e920054b7eb00274.js +1 -0
  207. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/onboard/route-e920054b7eb00274.js +1 -0
  208. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/route-e920054b7eb00274.js +1 -0
  209. package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/html/route-e920054b7eb00274.js +1 -0
  210. package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/route-e920054b7eb00274.js +1 -0
  211. package/bundle/standalone/apps/web/.next/static/chunks/app/api/refresh/route-e920054b7eb00274.js +1 -0
  212. package/bundle/standalone/apps/web/.next/static/chunks/app/api/reindex/route-e920054b7eb00274.js +1 -0
  213. package/bundle/standalone/apps/web/.next/static/chunks/app/api/reports/resources/[name]/route-e920054b7eb00274.js +1 -0
  214. package/bundle/standalone/apps/web/.next/static/chunks/app/api/search/route-e920054b7eb00274.js +1 -0
  215. package/bundle/standalone/apps/web/.next/static/chunks/app/api/tags/route-e920054b7eb00274.js +1 -0
  216. package/bundle/standalone/apps/web/.next/static/chunks/app/api/version-check/route-e920054b7eb00274.js +1 -0
  217. package/bundle/standalone/apps/web/.next/static/chunks/app/api/welcome/route-e920054b7eb00274.js +1 -0
  218. package/bundle/standalone/apps/web/.next/static/chunks/app/api/ws-config/route-e920054b7eb00274.js +1 -0
  219. package/bundle/standalone/apps/web/.next/static/chunks/app/calendar/page-7d520da68bac245d.js +1 -0
  220. package/bundle/standalone/apps/web/.next/static/chunks/app/page-df34c386b7c150bb.js +1 -0
  221. package/bundle/standalone/apps/web/.next/static/chunks/app/preview/motifs/page-e920054b7eb00274.js +1 -0
  222. package/bundle/standalone/apps/web/.next/static/css/{c2dc6e054d3457fa.css → d6e83b3f51ebdda3.css} +1 -1
  223. package/bundle/standalone/apps/web/package.json +4 -4
  224. package/bundle/standalone/apps/web/src/lib/mcp-tools.json +50 -50
  225. package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js +16 -16
  226. package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js.map +1 -1
  227. package/bundle/standalone/node_modules/kontexta-mcp/dist/connect-cli.d.ts +3 -0
  228. package/bundle/standalone/node_modules/kontexta-mcp/dist/connect-cli.d.ts.map +1 -0
  229. package/bundle/standalone/node_modules/kontexta-mcp/dist/connect-cli.js +166 -0
  230. package/bundle/standalone/node_modules/kontexta-mcp/dist/connect-cli.js.map +1 -0
  231. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/executor.js +1 -1
  232. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/executor.js.map +1 -1
  233. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/loader.js +1 -1
  234. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/loader.js.map +1 -1
  235. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/sanitizer.js +2 -2
  236. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/sanitizer.js.map +1 -1
  237. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/schema-doc.js +26 -26
  238. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks/emit.mjs +39 -2
  239. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks-block.js +1 -1
  240. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks-block.js.map +1 -1
  241. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks-cli.js +2 -2
  242. package/bundle/standalone/node_modules/kontexta-mcp/dist/hooks-cli.js.map +1 -1
  243. package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js +78 -60
  244. package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js.map +1 -1
  245. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.js +6 -6
  246. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.js.map +1 -1
  247. package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/011-journal-files-in-kb.sql +2 -0
  248. package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/012-agents-mcp.sql +6 -0
  249. package/bundle/standalone/node_modules/kontexta-mcp/dist/profile-tool.js +1 -1
  250. package/bundle/standalone/node_modules/kontexta-mcp/dist/profile-tool.js.map +1 -1
  251. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.d.ts +7 -0
  252. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.d.ts.map +1 -0
  253. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.js +13 -0
  254. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.js.map +1 -0
  255. package/bundle/standalone/node_modules/kontexta-mcp/package.json +2 -1
  256. package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/011-journal-files-in-kb.sql +2 -0
  257. package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/012-agents-mcp.sql +6 -0
  258. package/bundle/standalone/node_modules/kxta-core/dist/hooks/agents.d.ts +19 -2
  259. package/bundle/standalone/node_modules/kxta-core/dist/hooks/agents.d.ts.map +1 -1
  260. package/bundle/standalone/node_modules/kxta-core/dist/hooks/agents.js +15 -15
  261. package/bundle/standalone/node_modules/kxta-core/dist/hooks/agents.js.map +1 -1
  262. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.d.ts +2 -0
  263. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.d.ts.map +1 -1
  264. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.js +3 -3
  265. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.js.map +1 -1
  266. package/bundle/standalone/node_modules/kxta-core/dist/hooks/emit.mjs +39 -2
  267. package/bundle/standalone/node_modules/kxta-core/dist/hooks/index.d.ts +2 -2
  268. package/bundle/standalone/node_modules/kxta-core/dist/hooks/index.d.ts.map +1 -1
  269. package/bundle/standalone/node_modules/kxta-core/dist/hooks/index.js +1 -1
  270. package/bundle/standalone/node_modules/kxta-core/dist/hooks/index.js.map +1 -1
  271. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/antigravity.d.ts +3 -0
  272. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/antigravity.d.ts.map +1 -0
  273. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/antigravity.js +75 -0
  274. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/antigravity.js.map +1 -0
  275. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/codex.js +1 -1
  276. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/codex.js.map +1 -1
  277. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/copilot.d.ts.map +1 -1
  278. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/copilot.js +4 -3
  279. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/copilot.js.map +1 -1
  280. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/gemini.d.ts.map +1 -1
  281. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/gemini.js +0 -1
  282. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/gemini.js.map +1 -1
  283. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/hermes.d.ts +3 -0
  284. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/hermes.d.ts.map +1 -0
  285. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/hermes.js +107 -0
  286. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/hermes.js.map +1 -0
  287. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/index.d.ts.map +1 -1
  288. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/index.js +4 -0
  289. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/index.js.map +1 -1
  290. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/json-config.d.ts +2 -0
  291. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/json-config.d.ts.map +1 -1
  292. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/json-config.js +27 -13
  293. package/bundle/standalone/node_modules/kxta-core/dist/hooks/installers/json-config.js.map +1 -1
  294. package/bundle/standalone/node_modules/kxta-core/dist/hooks/registry.d.ts +11 -0
  295. package/bundle/standalone/node_modules/kxta-core/dist/hooks/registry.d.ts.map +1 -1
  296. package/bundle/standalone/node_modules/kxta-core/dist/hooks/registry.js +29 -3
  297. package/bundle/standalone/node_modules/kxta-core/dist/hooks/registry.js.map +1 -1
  298. package/bundle/standalone/node_modules/kxta-core/dist/index.d.ts +1 -0
  299. package/bundle/standalone/node_modules/kxta-core/dist/index.d.ts.map +1 -1
  300. package/bundle/standalone/node_modules/kxta-core/dist/index.js +1 -0
  301. package/bundle/standalone/node_modules/kxta-core/dist/index.js.map +1 -1
  302. package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.js +8 -5
  303. package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.js.map +1 -1
  304. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/alerts.d.ts +8 -0
  305. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/alerts.d.ts.map +1 -0
  306. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/alerts.js +8 -0
  307. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/alerts.js.map +1 -0
  308. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/entry.d.ts +31 -0
  309. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/entry.d.ts.map +1 -0
  310. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/entry.js +55 -0
  311. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/entry.js.map +1 -0
  312. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/index.d.ts +10 -0
  313. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/index.d.ts.map +1 -0
  314. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/index.js +7 -0
  315. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/index.js.map +1 -0
  316. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/install.d.ts +46 -0
  317. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/install.d.ts.map +1 -0
  318. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/install.js +113 -0
  319. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/install.js.map +1 -0
  320. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/claude-code.d.ts +3 -0
  321. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/claude-code.d.ts.map +1 -0
  322. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/claude-code.js +115 -0
  323. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/claude-code.js.map +1 -0
  324. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/codex.d.ts +3 -0
  325. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/codex.d.ts.map +1 -0
  326. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/codex.js +76 -0
  327. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/codex.js.map +1 -0
  328. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/continue.d.ts +3 -0
  329. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/continue.d.ts.map +1 -0
  330. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/continue.js +64 -0
  331. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/continue.js.map +1 -0
  332. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/hermes.d.ts +3 -0
  333. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/hermes.d.ts.map +1 -0
  334. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/hermes.js +90 -0
  335. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/hermes.js.map +1 -0
  336. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/index.d.ts +3 -0
  337. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/index.d.ts.map +1 -0
  338. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/index.js +17 -0
  339. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/index.js.map +1 -0
  340. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/json-servers.d.ts +31 -0
  341. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/json-servers.d.ts.map +1 -0
  342. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/json-servers.js +136 -0
  343. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/installers/json-servers.js.map +1 -0
  344. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/rules.d.ts +5 -0
  345. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/rules.d.ts.map +1 -0
  346. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/rules.js +19 -0
  347. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/rules.js.map +1 -0
  348. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.d.ts +5 -0
  349. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.d.ts.map +1 -0
  350. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.js +62 -0
  351. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.js.map +1 -0
  352. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/types.d.ts +55 -0
  353. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/types.d.ts.map +1 -0
  354. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/types.js +2 -0
  355. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/types.js.map +1 -0
  356. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/write.d.ts +3 -0
  357. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/write.d.ts.map +1 -0
  358. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/write.js +25 -0
  359. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/write.js.map +1 -0
  360. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/yaml-config.d.ts +5 -0
  361. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/yaml-config.d.ts.map +1 -0
  362. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/yaml-config.js +17 -0
  363. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/yaml-config.js.map +1 -0
  364. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.d.ts.map +1 -1
  365. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.js +2 -0
  366. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.js.map +1 -1
  367. package/bundle/standalone/node_modules/kxta-core/package.json +4 -2
  368. package/bundle/standalone/node_modules/kxta-publish/package.json +2 -2
  369. package/bundle/standalone/package.json +1 -1
  370. package/dist/connect-AL5DTU3K.js +22 -0
  371. package/dist/index.js +7 -1
  372. package/dist/{start-RJVUJT4B.js → start-GP4ERBBP.js} +7 -0
  373. package/package.json +3 -1
  374. package/bundle/standalone/apps/web/.next/static/chunks/app/api/about/route-0cc6597bb67aea3b.js +0 -1
  375. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/hooks/route-0cc6597bb67aea3b.js +0 -1
  376. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/[id]/route-0cc6597bb67aea3b.js +0 -1
  377. package/bundle/standalone/apps/web/.next/static/chunks/app/api/agents/route-0cc6597bb67aea3b.js +0 -1
  378. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/login/route-0cc6597bb67aea3b.js +0 -1
  379. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/logout/route-0cc6597bb67aea3b.js +0 -1
  380. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/setup/route-0cc6597bb67aea3b.js +0 -1
  381. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/status/route-0cc6597bb67aea3b.js +0 -1
  382. package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/token/route-0cc6597bb67aea3b.js +0 -1
  383. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/conflicts/route-0cc6597bb67aea3b.js +0 -1
  384. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/[id]/route-0cc6597bb67aea3b.js +0 -1
  385. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/route-0cc6597bb67aea3b.js +0 -1
  386. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/[id]/route-0cc6597bb67aea3b.js +0 -1
  387. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/route-0cc6597bb67aea3b.js +0 -1
  388. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/ics/route-0cc6597bb67aea3b.js +0 -1
  389. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/links/route-0cc6597bb67aea3b.js +0 -1
  390. package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/settings/route-0cc6597bb67aea3b.js +0 -1
  391. package/bundle/standalone/apps/web/.next/static/chunks/app/api/clip/route-0cc6597bb67aea3b.js +0 -1
  392. package/bundle/standalone/apps/web/.next/static/chunks/app/api/docker-config/route-0cc6597bb67aea3b.js +0 -1
  393. package/bundle/standalone/apps/web/.next/static/chunks/app/api/export/zip/route-0cc6597bb67aea3b.js +0 -1
  394. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/backlinks/route-0cc6597bb67aea3b.js +0 -1
  395. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/download/route-0cc6597bb67aea3b.js +0 -1
  396. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-html/route-0cc6597bb67aea3b.js +0 -1
  397. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-pdf/route-0cc6597bb67aea3b.js +0 -1
  398. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/restore/route-0cc6597bb67aea3b.js +0 -1
  399. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/route-0cc6597bb67aea3b.js +0 -1
  400. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/move/route-0cc6597bb67aea3b.js +0 -1
  401. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/route-0cc6597bb67aea3b.js +0 -1
  402. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/route-0cc6597bb67aea3b.js +0 -1
  403. package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/upload/route-0cc6597bb67aea3b.js +0 -1
  404. package/bundle/standalone/apps/web/.next/static/chunks/app/api/folders/route-0cc6597bb67aea3b.js +0 -1
  405. package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/remote/route-0cc6597bb67aea3b.js +0 -1
  406. package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/sync-all/route-0cc6597bb67aea3b.js +0 -1
  407. package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/test-pattern/route-0cc6597bb67aea3b.js +0 -1
  408. package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/validate/route-0cc6597bb67aea3b.js +0 -1
  409. package/bundle/standalone/apps/web/.next/static/chunks/app/api/health/route-0cc6597bb67aea3b.js +0 -1
  410. package/bundle/standalone/apps/web/.next/static/chunks/app/api/install-snippets/route-0cc6597bb67aea3b.js +0 -1
  411. package/bundle/standalone/apps/web/.next/static/chunks/app/api/mcp-tools/route-0cc6597bb67aea3b.js +0 -1
  412. package/bundle/standalone/apps/web/.next/static/chunks/app/api/profile/route-0cc6597bb67aea3b.js +0 -1
  413. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/hands-config/route-0cc6597bb67aea3b.js +0 -1
  414. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-config/route-0cc6597bb67aea3b.js +0 -1
  415. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-status/route-0cc6597bb67aea3b.js +0 -1
  416. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/onboard/route-0cc6597bb67aea3b.js +0 -1
  417. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/refresh/route-0cc6597bb67aea3b.js +0 -1
  418. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/route-0cc6597bb67aea3b.js +0 -1
  419. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/sync/route-0cc6597bb67aea3b.js +0 -1
  420. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/onboard/route-0cc6597bb67aea3b.js +0 -1
  421. package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/route-0cc6597bb67aea3b.js +0 -1
  422. package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/html/route-0cc6597bb67aea3b.js +0 -1
  423. package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/route-0cc6597bb67aea3b.js +0 -1
  424. package/bundle/standalone/apps/web/.next/static/chunks/app/api/refresh/route-0cc6597bb67aea3b.js +0 -1
  425. package/bundle/standalone/apps/web/.next/static/chunks/app/api/reindex/route-0cc6597bb67aea3b.js +0 -1
  426. package/bundle/standalone/apps/web/.next/static/chunks/app/api/reports/resources/[name]/route-0cc6597bb67aea3b.js +0 -1
  427. package/bundle/standalone/apps/web/.next/static/chunks/app/api/search/route-0cc6597bb67aea3b.js +0 -1
  428. package/bundle/standalone/apps/web/.next/static/chunks/app/api/tags/route-0cc6597bb67aea3b.js +0 -1
  429. package/bundle/standalone/apps/web/.next/static/chunks/app/api/version-check/route-0cc6597bb67aea3b.js +0 -1
  430. package/bundle/standalone/apps/web/.next/static/chunks/app/api/welcome/route-0cc6597bb67aea3b.js +0 -1
  431. package/bundle/standalone/apps/web/.next/static/chunks/app/api/ws-config/route-0cc6597bb67aea3b.js +0 -1
  432. package/bundle/standalone/apps/web/.next/static/chunks/app/calendar/page-f9542f9f518f9257.js +0 -1
  433. package/bundle/standalone/apps/web/.next/static/chunks/app/page-19695d4fd9fa5c0a.js +0 -1
  434. package/bundle/standalone/apps/web/.next/static/chunks/app/preview/motifs/page-0cc6597bb67aea3b.js +0 -1
  435. /package/bundle/standalone/apps/web/.next/static/{KgyobLEcr42ig4jXUMcNO → yyj-uK2RH8Rffeq9wVzjU}/_buildManifest.js +0 -0
  436. /package/bundle/standalone/apps/web/.next/static/{KgyobLEcr42ig4jXUMcNO → yyj-uK2RH8Rffeq9wVzjU}/_ssgManifest.js +0 -0
@@ -13,6 +13,7 @@ import { buildSchemaDoc } from "./hands/schema-doc.js";
13
13
  import { formatExecResult } from "./hands/formatter.js";
14
14
  import { killAllActiveChildren } from "./hands/executor.js";
15
15
  import { initCapture, shutdownCapture, wrapHandler, startGitPoller, appendVoluntaryEvent, getCurrentAgent, getCurrentSid } from "./journal-capture.js";
16
+ import { refuseProjectDestination, refuseRepoFile, refuseProjectFolder } from "./repo-write-guard.js";
16
17
  import { registerJournalTools } from "./journal-tools.js";
17
18
  import { currentHooksBlock, enableAndInstallHooks } from "./hooks-block.js";
18
19
  import { registerCommitUpgradesTool } from "./journal-commit-upgrades-tool.js";
@@ -36,7 +37,7 @@ function getAgentRulesWarning(projectId) {
36
37
  else {
37
38
  projects = db.prepare("SELECT id, path, name FROM projects").all();
38
39
  }
39
- // Projects with zero detected context files have NEVER been onboarded —
40
+ // Projects with zero detected context files have NEVER been onboarded,
40
41
  // distinct from "outdated" (a file exists but predates the current
41
42
  // rulesVersion). Both need admin.onboard_agent, so both are surfaced
42
43
  // here; without this, a project that skipped its one-shot
@@ -164,11 +165,11 @@ if (!pkgVersionFound) {
164
165
  function resolveKindFolder({ destination, folder, kind, format, title }) {
165
166
  if (destination !== "knowledge") {
166
167
  // HTML reports only make sense in the KB's html/ bucket (see
167
- // resources.export_report) — silently allowing destination='project'
168
+ // resources.export_report): silently allowing destination='project'
168
169
  // here means a report lands inside the user's own repo instead, with
169
170
  // no error and no way to find it via the reports UI.
170
171
  if (format === "html") {
171
- return { error: "format='html' requires destination='knowledge' — HTML reports must live in the KB's html/ bucket, not a project or kontexta destination." };
172
+ return { error: "format='html' requires destination='knowledge', HTML reports must live in the KB's html/ bucket, not a project or kontexta destination." };
172
173
  }
173
174
  return { folder };
174
175
  }
@@ -181,7 +182,7 @@ function resolveKindFolder({ destination, folder, kind, format, title }) {
181
182
  }
182
183
  // HTML reports always live under html/, never nested inside
183
184
  // knowledge/dictionary or knowledge/notes (layout.ts requires .md
184
- // there). `kind` doesn't apply — content_class for html/ paths is
185
+ // there). `kind` doesn't apply: content_class for html/ paths is
185
186
  // inferred as "note" from the path alone (see computeContentClass).
186
187
  if (format === "html") {
187
188
  const alreadyHtmlScoped = norm === "html" || norm.startsWith("html/");
@@ -191,14 +192,14 @@ function resolveKindFolder({ destination, folder, kind, format, title }) {
191
192
  // (layout.ts), so an unrouted .mmd file would always fail at write
192
193
  // time. Unlike html, mermaid diagrams committed inside a project's own
193
194
  // repo are a legitimate use case, so this only applies to destination
194
- // === "knowledge" — no destination restriction like html has.
195
+ // === "knowledge": no destination restriction like html has.
195
196
  if (format === "mmd") {
196
197
  const alreadyMermaidScoped = norm === "mermaid" || norm.startsWith("mermaid/");
197
198
  return { folder: alreadyMermaidScoped ? folder : (norm ? `mermaid/${norm}` : "mermaid") };
198
199
  }
199
200
  if (!kind)
200
201
  return { error: "kind is required for destination='knowledge': must be 'dictionary' or 'note'" };
201
- // Non-KB buckets (html/mermaid) also skip rewrite — their layout forbids nesting under knowledge/.
202
+ // Non-KB buckets (html/mermaid) also skip rewrite: their layout forbids nesting under knowledge/.
202
203
  const CLASS_PREFIXES = ["knowledge/dictionary", "knowledge/notes", "knowledge/urlclips", "journal", "html", "mermaid"];
203
204
  const alreadyClassScoped = CLASS_PREFIXES.some((p) => norm === p || norm.startsWith(p + "/"));
204
205
  if (alreadyClassScoped) {
@@ -206,14 +207,14 @@ function resolveKindFolder({ destination, folder, kind, format, title }) {
206
207
  const impliedNote = norm.startsWith("knowledge/notes");
207
208
  const impliedClass = impliedDict ? "dictionary" : impliedNote ? "note" : null;
208
209
  if (impliedClass && impliedClass !== kind) {
209
- return { folder, warning: `kind='${kind}' but folder targets '${impliedClass}' tree — path wins; content_class will be '${impliedClass}'.` };
210
+ return { folder, warning: `kind='${kind}' but folder targets '${impliedClass}' tree, path wins; content_class will be '${impliedClass}'.` };
210
211
  }
211
212
  return { folder };
212
213
  }
213
214
  const classRoot = kind === "dictionary" ? "knowledge/dictionary" : "knowledge/notes";
214
215
  return { folder: norm ? `${classRoot}/${norm}` : classRoot };
215
216
  }
216
- // Format as UTC — server/user timezone divergence would silently mislead otherwise.
217
+ // Format as UTC: server/user timezone divergence would silently mislead otherwise.
217
218
  function fmtWhen(iso) {
218
219
  const d = new Date(iso);
219
220
  if (isNaN(d.getTime()))
@@ -249,7 +250,7 @@ function buildCalendarSection(now) {
249
250
  lines.push("");
250
251
  lines.push(`⚠️ CONFLICTS (${conflicts.length})`);
251
252
  for (const c of conflicts.slice(0, 5)) {
252
- lines.push(` ${c.kind}: "${c.event_a.title}" (${entityName(c.event_a.entity_id)}) vs "${c.event_b.title}" (${entityName(c.event_b.entity_id)}) — ${c.reason}`);
253
+ lines.push(` ${c.kind}: "${c.event_a.title}" (${entityName(c.event_a.entity_id)}) vs "${c.event_b.title}" (${entityName(c.event_b.entity_id)}), ${c.reason}`);
253
254
  }
254
255
  }
255
256
  return lines.join("\n");
@@ -281,14 +282,14 @@ function loadProfileInstructions() {
281
282
  const profileExists = existsSync(path);
282
283
  const content = profileExists ? readFileSync(path, "utf8").trim() : "";
283
284
  const empty = profileExists ? getEmptySections(content) : [];
284
- const header = `👋 Kontexta welcome — ${today}\n\n` +
285
- `This is the user's session context. Read and honor it for the rest of this session — especially "Session coding style" (comment style, git etiquette, review-before-push) and "Team members and roles" (who's who when writing updates or referencing people).`;
285
+ const header = `👋 Kontexta welcome: ${today}\n\n` +
286
+ `This is the user's session context. Read and honor it for the rest of this session: especially "Session coding style" (comment style, git etiquette, review-before-push) and "Team members and roles" (who's who when writing updates or referencing people).`;
286
287
  const profileBlock = profileExists && content
287
288
  ? `📋 PROFILE (knowledge/profile.md)\n${content}`
288
- : `📋 PROFILE\n (not set up yet — nudge the user to fill it in at knowledge/profile.md or the dashboard's profile pane)`;
289
+ : `📋 PROFILE\n (not set up yet, nudge the user to fill it in at knowledge/profile.md or the dashboard's profile pane)`;
289
290
  const calendarBlock = buildCalendarSection(now);
290
291
  const freshness = profileExists ? profileFreshnessNote(path, empty) : "";
291
- // Recurring nudge — projects.register's onboarding prompt fires once, at
292
+ // Recurring nudge: projects.register's onboarding prompt fires once, at
292
293
  // register time; if the calling agent doesn't relay it in the moment
293
294
  // there was previously no second chance to see it. Surfacing it here
294
295
  // means it comes back every session until admin.onboard_agent is run.
@@ -359,7 +360,7 @@ process.on("SIGTERM", () => { if (!_shutdownInFlight) {
359
360
  } });
360
361
  // Auto-wrap every tool registration that follows. journal.write is excluded
361
362
  // because the auto-wrap re-enters journal recording, and journal.write itself
362
- // records journal events — including it would loop.
363
+ // records journal events: including it would loop.
363
364
  const _origServerTool = server.tool.bind(server);
364
365
  server.tool = function (name, ...rest) {
365
366
  if (name === "journal.write") {
@@ -372,8 +373,8 @@ server.tool = function (name, ...rest) {
372
373
  return _origServerTool(name, ...rest);
373
374
  };
374
375
  // Excluded from wrapHandler (see above) so it does NOT get the
375
- // journal-backlog envelope injected — it IS the journal write path.
376
- server.tool("journal.write", "Write one event to the current project's journal. `kind: 'append'` = timestamped entry in today's daily journal file in the Knowledge Base (creates the file if it doesn't exist; both calls on the same calendar day return the same file_id; returns `{file_id}`). `kind: 'note'` = free-form decision/abandonment/observation, stored as an `agent_note` event in Layer 1 (surfaces in distilled task entries; returns `{ok, recorded_at}`). `kind: 'intent'` = topic/intent pivot — use when the user redirects what you're working on so the distillation step splits task buckets correctly (returns `{ok, recorded_at}`). Required fields depend on `kind`: 'append'/'note' need `text`; 'intent' needs `summary`.", {
376
+ // journal-backlog envelope injected: it IS the journal write path.
377
+ server.tool("journal.write", "Write one event to the current project's journal. `kind: 'append'` = timestamped entry in today's daily journal file in the Knowledge Base (creates the file if it doesn't exist; both calls on the same calendar day return the same file_id; returns `{file_id}`). `kind: 'note'` = free-form decision/abandonment/observation, stored as an `agent_note` event in Layer 1 (surfaces in distilled task entries; returns `{ok, recorded_at}`). `kind: 'intent'` = topic/intent pivot, use when the user redirects what you're working on so the distillation step splits task buckets correctly (returns `{ok, recorded_at}`). Required fields depend on `kind`: 'append'/'note' need `text`; 'intent' needs `summary`.", {
377
378
  kind: z.enum(["append", "note", "intent"]).describe("Event kind. Selects which body fields are required and how the event is stored."),
378
379
  text: z.string().optional().describe("Required for kind='append' or kind='note'. Body of the entry."),
379
380
  summary: z.string().optional().describe("Required for kind='intent'. One-line summary of the new intent."),
@@ -408,7 +409,7 @@ server.tool("journal.write", "Write one event to the current project's journal.
408
409
  else {
409
410
  // Create a new daily journal file.
410
411
  const timestamp = new Date().toISOString().replace("T", " ").slice(0, 19);
411
- const content = `# Journal — ${today}\n\n---\n**${timestamp}** ${text}\n`;
412
+ const content = `# Journal: ${today}\n\n---\n**${timestamp}** ${text}\n`;
412
413
  const result = await createFile({
413
414
  title,
414
415
  content,
@@ -457,7 +458,7 @@ server.tool("journal.write", "Write one event to the current project's journal.
457
458
  appendVoluntaryEvent(ev);
458
459
  return { content: [{ type: "text", text: JSON.stringify({ ok: true, recorded_at: ev.ts }) }] };
459
460
  });
460
- server.tool("files.create", "Create one or more markdown, mermaid, or HTML files in the knowledge base or project (up to 200 per call). Pass a single-element `files` array for the one-file case. This operation writes each file to disk and adds it to the local SQLite FTS5 index. Destination can be 'knowledge' (global KB), 'project' (reference file inside a project repo), or 'kontexta' (internal Kontexta schema file). If destination is 'project' or 'kontexta', project_id is strictly required. If destination is 'knowledge', 'kind' is strictly required for md files — pick 'dictionary' (authoritative source-of-truth) or 'note' (informational snapshot); see the kind param for the rubric. No external auth required. Rate limits do not apply (local operation). Per-item failures are isolated to `errors[]` — the rest of the batch still commits; a single-item call still reports its failure the same way. Returns `{created_count, error_count, created, errors}`. If a destination directory does not exist, it will be created automatically. To modify an existing file, use 'files.update' instead. Pass format='mmd' on an item to create a Mermaid diagram file (.mmd) — for destination='knowledge' it's auto-routed to the KB's `mermaid/` bucket (`kind` ignored, not required); for destination='project' it's written wherever `folder` says, same as any project file. Pass format='html' for an HTML report — `destination` MUST be 'knowledge' (html reports are auto-routed to the KB's `html/` bucket; `kind` is ignored and not required for html). Format defaults to 'md'.", {
461
+ server.tool("files.create", "Create one or more markdown, mermaid, or HTML files in the knowledge base or project (up to 200 per call). Pass a single-element `files` array for the one-file case. This operation writes each file to disk and adds it to the local SQLite FTS5 index. Destination is 'knowledge' (global KB) or 'kontexta' (internal Kontexta schema file, project_id required). 'project' is REFUSED: nothing created through kxta is written into a project repo. If destination is 'knowledge', 'kind' is strictly required for md files, pick 'dictionary' (authoritative source-of-truth) or 'note' (informational snapshot); see the kind param for the rubric. No external auth required. Rate limits do not apply (local operation). Per-item failures are isolated to `errors[]`, the rest of the batch still commits; a single-item call still reports its failure the same way. Returns `{created_count, error_count, created, errors}`. If a destination directory does not exist, it will be created automatically. To modify an existing file, use 'files.update' instead. Pass format='mmd' on an item to create a Mermaid diagram file (.mmd), for destination='knowledge' it's auto-routed to the KB's `mermaid/` bucket (`kind` ignored, not required); Pass format='html' for an HTML report, `destination` MUST be 'knowledge' (html reports are auto-routed to the KB's `html/` bucket; `kind` is ignored and not required for html). Format defaults to 'md'.", {
461
462
  files: z
462
463
  .array(z.object({
463
464
  title: z.string().describe("Title of the file"),
@@ -479,6 +480,11 @@ server.tool("files.create", "Create one or more markdown, mermaid, or HTML files
479
480
  for (let i = 0; i < files.length; i++) {
480
481
  const f = files[i];
481
482
  try {
483
+ const refusal = refuseProjectDestination(f.destination);
484
+ if (refusal) {
485
+ errors.push({ index: i, title: f.title, error: refusal });
486
+ continue;
487
+ }
482
488
  const resolved = resolveKindFolder({ destination: f.destination, folder: f.folder, kind: f.kind, format: f.format, title: f.title });
483
489
  if ("error" in resolved) {
484
490
  errors.push({ index: i, title: f.title, error: resolved.error });
@@ -512,7 +518,7 @@ server.tool("files.create", "Create one or more markdown, mermaid, or HTML files
512
518
  ],
513
519
  };
514
520
  });
515
- server.tool("resources.add_report", "Write an image or other binary resource into the shared reports/resources/ folder. Returns { filename, size, src, url } — embed the report's <img>/<a> tags with `src` exactly as given (e.g. `<img src=\"resources/chart.png\">`); it is the only form that resolves correctly both in the dashboard viewer and in PDF/PNG export. Do not use `url` inside report HTML — it only works in the dashboard. Bytes are passed base64-encoded.", {
521
+ server.tool("resources.add_report", "Write an image or other binary resource into the shared reports/resources/ folder. Returns { filename, size, src, url }: embed the report's <img>/<a> tags with `src` exactly as given (e.g. `<img src=\"resources/chart.png\">`); it is the only form that resolves correctly both in the dashboard viewer and in PDF/PNG export. Do not use `url` inside report HTML: it only works in the dashboard. Bytes are passed base64-encoded.", {
516
522
  filename: z.string().describe("Requested filename with extension"),
517
523
  bytes_base64: z.string().describe("Base64-encoded file bytes"),
518
524
  }, async ({ filename, bytes_base64 }) => {
@@ -527,7 +533,7 @@ server.tool("resources.delete_report", "Delete a file from reports/resources/. N
527
533
  deleteResource(dataDir, filename);
528
534
  return { content: [{ type: "text", text: JSON.stringify({ ok: true, filename }, null, 2) }] };
529
535
  });
530
- server.tool("resources.export_report", "Export an existing HTML report as PDF or PNG. Returns { url } for the web-served download (requires an authenticated dashboard request) by default. Set inline_bytes=true to render in-process and get { bytes_base64 } instead — only available when running via the full `kontexta` CLI, not the standalone kontexta-mcp package; falls back to { url } with a note if unavailable.", {
536
+ server.tool("resources.export_report", "Export an existing HTML report as PDF or PNG. Returns { url } for the web-served download (requires an authenticated dashboard request) by default. Set inline_bytes=true to render in-process and get { bytes_base64 } instead: only available when running via the full `kontexta` CLI, not the standalone kontexta-mcp package; falls back to { url } with a note if unavailable.", {
531
537
  id: z.number().describe("File ID of the HTML report to export."),
532
538
  format: z.enum(["pdf", "png"]).default("pdf").describe("Output format: 'pdf' or 'png'."),
533
539
  inline_bytes: z.boolean().optional().default(false).describe("If true, render in-process and return raw bytes (base64). Only available in the full kontexta CLI bundle; falls back to {url} otherwise."),
@@ -537,7 +543,7 @@ server.tool("resources.export_report", "Export an existing HTML report as PDF or
537
543
  return { content: [{ type: "text", text: JSON.stringify({ url }, null, 2) }] };
538
544
  try {
539
545
  const { readFile } = await import("kxta-core");
540
- // kxta-publish is intentionally undeclared here (private/workspace-only) — only resolves under the bundled `kontexta` CLI; the catch below covers the standalone package.
546
+ // kxta-publish is intentionally undeclared here (private/workspace-only): only resolves under the bundled `kontexta` CLI; the catch below covers the standalone package.
541
547
  const mod = await import("kxta-publish/render/html-export");
542
548
  const { join } = await import("node:path");
543
549
  const f = readFile(id);
@@ -550,7 +556,7 @@ server.tool("resources.export_report", "Export an existing HTML report as PDF or
550
556
  return { content: [{ type: "text", text: JSON.stringify({ url, note: `inline_bytes unavailable in this install: ${e?.message ?? String(e)}` }, null, 2) }] };
551
557
  }
552
558
  });
553
- server.tool("files.read", "Read one or more files, in full or in part. Modes: single-by-id (`id`), single-by-path (`path`, absolute on-disk path — must be exactly as indexed), batch-by-id (`ids`, up to 200), partial-by-heading (`id`+`section`), partial-by-line-range (`id`+`lines`). Exactly one of `id`/`path`/`ids` is required. `section` and `lines` are mutually exclusive and only valid with `id` (not `ids` or `path`). Read-only; no side effects, auth, or rate limits. Response shape: a single file object (with `content`, tags, est_tokens) for `id`/`path`; a partial-content object for `section`/`lines`; `{files, total_est_tokens, error_count, errors}` for `ids` (per-ID failures isolated, batch never partial-throws). Prefer `files.describe` to inspect without paying body tokens.", {
559
+ server.tool("files.read", "Read one or more files, in full or in part. Modes: single-by-id (`id`), single-by-path (`path`, absolute on-disk path, must be exactly as indexed), batch-by-id (`ids`, up to 200), partial-by-heading (`id`+`section`), partial-by-line-range (`id`+`lines`). Exactly one of `id`/`path`/`ids` is required. `section` and `lines` are mutually exclusive and only valid with `id` (not `ids` or `path`). Read-only; no side effects, auth, or rate limits. Response shape: a single file object (with `content`, tags, est_tokens) for `id`/`path`; a partial-content object for `section`/`lines`; `{files, total_est_tokens, error_count, errors}` for `ids` (per-ID failures isolated, batch never partial-throws). Prefer `files.describe` to inspect without paying body tokens.", {
554
560
  id: z.number().int().positive().optional().describe("Single file by ID."),
555
561
  path: z.string().optional().describe("Single file by absolute on-disk path (must match exactly what Kontexta indexed)."),
556
562
  ids: z.array(z.number()).min(1).max(200).optional().describe("Batch mode: multiple file IDs (max 200 per call); returns an array plus aggregate token cost."),
@@ -767,7 +773,7 @@ server.tool("files.describe", "Return everything ABOUT a file without pulling it
767
773
  };
768
774
  }
769
775
  });
770
- server.tool("files.regex_search", "Match a JS regex against file bodies. Default mode scans every file in scope (project, KB, or all) and returns per-file hits with line numbers — slower than FTS `files.search` because it reads each file's content; use only when FTS misses substrings, URLs, or code identifiers. Pass `file_id` to instead scan just that one file (catches what FTS misses within a single known file); response shape changes to `{file_id, path, pattern, match_count, truncated, matches}`. Read-only; no side effects, auth, or rate limits. Multi-file mode capped at 500 files / 10 hits per file by default (`files_truncated` reports the cap); single-file mode capped at 100 hits by default, max 500. `project_id`/`kind` are ignored when `file_id` is set. Invalid regex throws.", {
776
+ server.tool("files.regex_search", "Match a JS regex against file bodies. Default mode scans every file in scope (project, KB, or all) and returns per-file hits with line numbers: slower than FTS `files.search` because it reads each file's content; use only when FTS misses substrings, URLs, or code identifiers. Pass `file_id` to instead scan just that one file (catches what FTS misses within a single known file); response shape changes to `{file_id, path, pattern, match_count, truncated, matches}`. Read-only; no side effects, auth, or rate limits. Multi-file mode capped at 500 files / 10 hits per file by default (`files_truncated` reports the cap); single-file mode capped at 100 hits by default, max 500. `project_id`/`kind` are ignored when `file_id` is set. Invalid regex throws.", {
771
777
  pattern: z.string().describe("JavaScript RegExp source"),
772
778
  file_id: z.number().optional().describe("Scan only this file instead of every file in scope. When set, `project_id`/`kind`/`max_files`/`max_matches_per_file` are ignored in favor of `max_matches`."),
773
779
  project_id: z.number().nullable().optional().describe("Scope to one project, null for KB-only, omit for everything. Ignored when `file_id` is set."),
@@ -881,16 +887,19 @@ server.tool("files.regex_search", "Match a JS regex against file bodies. Default
881
887
  };
882
888
  }
883
889
  });
884
- server.tool("files.update", "Rewrite a file. Default = full-body replacement: `content` becomes the entire file, triggering disk write + FTS5 re-index. Pass `section` to instead rewrite ONLY that heading's body (case-insensitive exact-string after trim; the heading line itself is preserved, siblings untouched) — saves context budget vs resending the whole file. Throws if `section` is set but the heading doesn't exist (this mode will NOT create a new section — append the section text via a full-body update first). Operates locally with no external auth or rate limits. Returns the updated file metadata including new estimated token counts.", {
890
+ server.tool("files.update", "Rewrite a KB file (project-repo files are refused: kxta never writes into a repo). Default = full-body replacement: `content` becomes the entire file, triggering disk write + FTS5 re-index. Pass `section` to instead rewrite ONLY that heading's body (case-insensitive exact-string after trim; the heading line itself is preserved, siblings untouched), saves context budget vs resending the whole file. Throws if `section` is set but the heading doesn't exist (this mode will NOT create a new section, append the section text via a full-body update first). Operates locally with no external auth or rate limits. Returns the updated file metadata including new estimated token counts.", {
885
891
  id: z.number().describe("File ID"),
886
892
  content: z.string().describe("New content. With `section` set, this replaces just that heading's body; otherwise it becomes the entire file body."),
887
893
  section: z.string().optional().describe("Case-insensitive exact-string heading. When set, only this heading's body is rewritten instead of the whole file."),
888
894
  }, async ({ id, content, section }) => {
889
895
  try {
896
+ const target = readFile(id);
897
+ const refusal = refuseRepoFile(target);
898
+ if (refusal)
899
+ throw new Error(refusal);
890
900
  let newBody = content;
891
901
  if (section !== undefined) {
892
- const file = readFile(id);
893
- newBody = replaceSection(file.content, section, content);
902
+ newBody = replaceSection(target.content, section, content);
894
903
  }
895
904
  const result = await updateFile(id, newBody, dataDir);
896
905
  return {
@@ -904,7 +913,7 @@ server.tool("files.update", "Rewrite a file. Default = full-body replacement: `c
904
913
  };
905
914
  }
906
915
  });
907
- server.tool("files.delete", "DESTRUCTIVE. Permanently delete one or more files by ID (up to 500 per call). Pass a single-element `ids` array for the one-file case. KB files are unlinked from disk AND removed from the FTS5 index; project reference files only have their index entry removed (the file on disk is left alone so the watcher does not fight your editor). Not idempotent — deleting an unknown ID surfaces as a per-item error. No external auth or rate limits. Per-ID failures are isolated to `errors[]` and the rest of the batch still commits — partial success is the norm, always inspect `error_count`. Returns `{deleted_count, error_count, deleted, errors}`. Use only when the file is truly obsolete; to deprioritise without losing data, untag (`tags.remove`) or unfavorite (`tags.set_favorite`) instead. To preview the set before deleting, run `files.list` with the same filter and confirm the IDs.", {
916
+ server.tool("files.delete", "DESTRUCTIVE. Permanently delete one or more files by ID (up to 500 per call). Pass a single-element `ids` array for the one-file case. KB files are unlinked from disk AND removed from the FTS5 index; project reference files only have their index entry removed (the file on disk is left alone so the watcher does not fight your editor). Not idempotent: deleting an unknown ID surfaces as a per-item error. No external auth or rate limits. Per-ID failures are isolated to `errors[]` and the rest of the batch still commits: partial success is the norm, always inspect `error_count`. Returns `{deleted_count, error_count, deleted, errors}`. Use only when the file is truly obsolete; to deprioritise without losing data, untag (`tags.remove`) or unfavorite (`tags.set_favorite`) instead. To preview the set before deleting, run `files.list` with the same filter and confirm the IDs.", {
908
917
  ids: z.array(z.number()).min(1).max(500).describe("File IDs to delete. Single-element array = one-file case. Max 500 per call."),
909
918
  }, async ({ ids }) => {
910
919
  const deleted = [];
@@ -962,7 +971,7 @@ server.tool("files.list", "List file metadata with optional filters (project_id,
962
971
  content: [{ type: "text", text: JSON.stringify({ files: annotated, total_est_tokens }, null, 2) }],
963
972
  };
964
973
  });
965
- server.tool("files.search", "Full-text (SQLite FTS5) keyword search across files. Default mode returns ranked matches with inline match_excerpt and title_highlight (no follow-up `files.read` needed for snippets) plus tags, est_tokens, size_bytes, content_class, and aggregate `total_est_tokens`. Pass `include_bodies: true` to instead get a single prompt-ready bundle: matched bodies concatenated into XML `<document>` blocks or markdown headers + fences (see `format`/`max_tokens`), capped at the token budget — files are added in rank order until the next would exceed it, the rest going to `meta.skipped[]`. Use `include_bodies` instead of `files.search` + N×`files.read` when you need several related files as one context blob. Read-only; no side effects, auth, or rate limits. Ordering: dictionary hits sort above everything else for the same query (dictionary-wins on conflict), then BM25 rank. FTS is tokenised: it WILL miss URLs, hyphenated terms, and partial substrings — fall back to `files.regex_search` for those. `project_id: null` searches only the KB; omit the field to span everything; `tags[]` requires ALL listed tags to match; `kind` narrows to one content class.", {
974
+ server.tool("files.search", "Full-text (SQLite FTS5) keyword search across files. Default mode returns ranked matches with inline match_excerpt and title_highlight (no follow-up `files.read` needed for snippets) plus tags, est_tokens, size_bytes, content_class, and aggregate `total_est_tokens`. Pass `include_bodies: true` to instead get a single prompt-ready bundle: matched bodies concatenated into XML `<document>` blocks or markdown headers + fences (see `format`/`max_tokens`), capped at the token budget, files are added in rank order until the next would exceed it, the rest going to `meta.skipped[]`. Use `include_bodies` instead of `files.search` + N×`files.read` when you need several related files as one context blob. Read-only; no side effects, auth, or rate limits. Ordering: dictionary hits sort above everything else for the same query (dictionary-wins on conflict), then BM25 rank. FTS is tokenised: it WILL miss URLs, hyphenated terms, and partial substrings, fall back to `files.regex_search` for those. `project_id: null` searches only the KB; omit the field to span everything; `tags[]` requires ALL listed tags to match; `kind` narrows to one content class.", {
966
975
  query: z.string().describe("Search query"),
967
976
  project_id: z.number().nullable().optional().describe("Filter by project ID. Pass null to search ONLY Knowledge Base files."),
968
977
  tags: z.array(z.string()).optional().describe("Filter by tags (all must match)"),
@@ -1013,7 +1022,7 @@ server.tool("files.search", "Full-text (SQLite FTS5) keyword search across files
1013
1022
  content: [{ type: "text", text: JSON.stringify({ matches: annotated, total_est_tokens }, null, 2) }],
1014
1023
  };
1015
1024
  });
1016
- server.tool("tags.add", "Append tags to ONE file. Additive — existing tags are preserved; re-adding an existing tag is a no-op (idempotent per tag). New tag names auto-create rows in the global `tags` table. Persists to local SQLite. No external auth or rate limits. Returns `{success: true}`; throws if file_id is unknown. Use to label a single file. To tag every file matching a query in one call use `tags.search`; to remove tags use `tags.remove`.", {
1025
+ server.tool("tags.add", "Append tags to ONE file. Additive: existing tags are preserved; re-adding an existing tag is a no-op (idempotent per tag). New tag names auto-create rows in the global `tags` table. Persists to local SQLite. No external auth or rate limits. Returns `{success: true}`; throws if file_id is unknown. Use to label a single file. To tag every file matching a query in one call use `tags.search`; to remove tags use `tags.remove`.", {
1017
1026
  file_id: z.number().describe("File ID"),
1018
1027
  tags: z.array(z.string()).describe("Array of tag names to add"),
1019
1028
  }, async ({ file_id, tags }) => {
@@ -1022,7 +1031,7 @@ server.tool("tags.add", "Append tags to ONE file. Additive — existing tags are
1022
1031
  content: [{ type: "text", text: JSON.stringify({ success: true }, null, 2) }],
1023
1032
  };
1024
1033
  });
1025
- server.tool("tags.remove", "Detach one or more tag IDs from ONE file. Destructive on the link only — does NOT delete the file or the global tag definition (orphan tags survive in `tags.list`). Idempotent: removing an already-absent tag is a no-op. No external auth or rate limits. Returns `{success: true}`. Note: takes tag IDs (integers), not names — fetch them via `tags.list`. To remove ALL tags from many files via a query, see `tags.search` (additive only) — there is no bulk-untag-by-query tool.", {
1034
+ server.tool("tags.remove", "Detach one or more tag IDs from ONE file. Destructive on the link only: does NOT delete the file or the global tag definition (orphan tags survive in `tags.list`). Idempotent: removing an already-absent tag is a no-op. No external auth or rate limits. Returns `{success: true}`. Note: takes tag IDs (integers), not names, fetch them via `tags.list`. To remove ALL tags from many files via a query, see `tags.search` (additive only), there is no bulk-untag-by-query tool.", {
1026
1035
  file_id: z.number().describe("File ID"),
1027
1036
  tag_ids: z.array(z.number()).describe("Array of tag IDs to remove"),
1028
1037
  }, async ({ file_id, tag_ids }) => {
@@ -1031,7 +1040,7 @@ server.tool("tags.remove", "Detach one or more tag IDs from ONE file. Destructiv
1031
1040
  content: [{ type: "text", text: JSON.stringify({ success: true }, null, 2) }],
1032
1041
  };
1033
1042
  });
1034
- server.tool("tags.set_favorite", "Set or clear the favorite flag on one file (idempotent — re-setting the same value is a no-op; not a toggle, you pass the desired state). Persists to local SQLite. No external auth or rate limits. Returns `{success: true}`. Use to curate quick-access pins; `files.list` / `files.search` accept `favorite: true` to filter to the pinned set.", {
1043
+ server.tool("tags.set_favorite", "Set or clear the favorite flag on one file (idempotent: re-setting the same value is a no-op; not a toggle, you pass the desired state). Persists to local SQLite. No external auth or rate limits. Returns `{success: true}`. Use to curate quick-access pins; `files.list` / `files.search` accept `favorite: true` to filter to the pinned set.", {
1035
1044
  file_id: z.number().describe("File ID"),
1036
1045
  favorite: z.boolean().describe("Favorite status"),
1037
1046
  }, async ({ file_id, favorite }) => {
@@ -1068,7 +1077,7 @@ server.tool("projects.list", "List every registered project with id, name, absol
1068
1077
  });
1069
1078
  server.tool("projects.register", `Register a new project and link it to the Kontexta knowledge system.
1070
1079
 
1071
- SIDE EFFECTS: Writes project metadata to disk (persisted in the Kontexta data directory). Scans the project root recursively to discover and index all markdown files into the local database. Registers any kontexta.json-declared Hands tools found in the project root. This operation is idempotent — re-registering an existing project updates its metadata without data loss.
1080
+ SIDE EFFECTS: Writes project metadata to disk (persisted in the Kontexta data directory). Scans the project root recursively to discover and index all markdown files into the local database. Registers any kontexta.json-declared Hands tools found in the project root. This operation is idempotent, re-registering an existing project updates its metadata without data loss.
1072
1081
 
1073
1082
  AUTH / RATE LIMITS: None. Operates entirely on the local file system.
1074
1083
 
@@ -1128,20 +1137,20 @@ ERROR CONDITIONS: Returns isError=true if path is missing or unresolvable. Scan
1128
1137
  .map((s) => `${s.path} (found ${s.version ?? "none"})`)
1129
1138
  .join(", ");
1130
1139
  recommendationReason =
1131
- `Your project's agent instructions file is out of date — it still references kontexta workflow rules from an older release. ` +
1140
+ `Your project's agent instructions file is out of date: it still references kontexta workflow rules from an older release. ` +
1132
1141
  `Files needing an update: ${versions}. Latest rules version is v${RULE_BLOCK_VERSION}. ` +
1133
1142
  `Run admin.onboard_agent to refresh the kontexta rules block in-place (your existing project content is preserved).`;
1134
1143
  }
1135
1144
  else {
1136
1145
  recommendationReason =
1137
- `Found ${detected.join(", ")} with kontexta workflow rules already at the latest version (v${RULE_BLOCK_VERSION}). No action needed — your AI agent will load these rules automatically every session.`;
1146
+ `Found ${detected.join(", ")} with kontexta workflow rules already at the latest version (v${RULE_BLOCK_VERSION}). No action needed: your AI agent will load these rules automatically every session.`;
1138
1147
  }
1139
1148
  }
1140
1149
  else {
1141
1150
  recommendationReason =
1142
1151
  `No AI agent instructions file (e.g. CLAUDE.md, AGENTS.md, GEMINI.md, ANTIGRAVITY.md, .cursor/rules, .continue/rules, .aider/kontexta.md) was found in this project. ` +
1143
1152
  `These files are how coding agents (Claude Code, Codex, Cursor, Gemini, Aider, etc.) load project-specific context at the start of every session. ` +
1144
- `Without one, your agent won't know this project is registered with kontexta and will skip the search/read/journal workflow — wasting tokens re-reading files it could have looked up. ` +
1153
+ `Without one, your agent won't know this project is registered with kontexta and will skip the search/read/journal workflow: wasting tokens re-reading files it could have looked up. ` +
1145
1154
  `Run admin.onboard_agent with target_agent set to your coding tool to scaffold the right file (CLAUDE.md for Claude Code, .aider/kontexta.md for Aider, etc.) pre-populated with kontexta workflow rules.`;
1146
1155
  }
1147
1156
  const needsOnboarding = outdated.length > 0 || detected.length === 0;
@@ -1203,7 +1212,7 @@ ERROR CONDITIONS: Returns isError=true if path is missing or unresolvable. Scan
1203
1212
  };
1204
1213
  }
1205
1214
  });
1206
- server.tool("admin.onboard_agent", `Write or update the kontexta workflow rules block in a project's agent context file(s). Idempotent — uses fenced markers + version to skip no-op writes.
1215
+ server.tool("admin.onboard_agent", `Write or update the kontexta workflow rules block in a project's agent context file(s). Idempotent: uses fenced markers + version to skip no-op writes.
1207
1216
 
1208
1217
  MANDATORY: This tool modifies project configuration files. You MUST seek explicit user consent before calling this tool. Set 'confirm: true' only after the user has agreed.
1209
1218
 
@@ -1297,7 +1306,7 @@ PARAMETERS:
1297
1306
  RETURNS: { transferred: [{ source_path, kb_id, kb_path, est_tokens }], skipped: [{ source_path, reason }], next_action }
1298
1307
  Skip reasons: "missing" | "symlink" | "outside_project" | "already_transferred_same_content" | "read_error" | "write_error".
1299
1308
 
1300
- IDEMPOTENT: re-running with the same files copies nothing if the content is unchanged — duplicate transfers are detected via SHA-256 hash comparison against existing project KB rows.`, {
1309
+ IDEMPOTENT: re-running with the same files copies nothing if the content is unchanged, duplicate transfers are detected via SHA-256 hash comparison against existing project KB rows.`, {
1301
1310
  project_id: z.number().describe("Project ID returned from register_project"),
1302
1311
  confirm: z.boolean().describe("MANDATORY: Set to true only after obtaining explicit user consent."),
1303
1312
  files: z.array(z.string()).optional().describe("Project-relative paths to transfer. Omit to transfer all detected context files."),
@@ -1334,7 +1343,7 @@ IDEMPOTENT: re-running with the same files copies nothing if the content is unch
1334
1343
  const transferred = [];
1335
1344
  const skipped = [];
1336
1345
  for (const rel of targetRels) {
1337
- // Containment check — reject absolute paths, "..", null bytes.
1346
+ // Containment check: reject absolute paths, "..", null bytes.
1338
1347
  let abs;
1339
1348
  try {
1340
1349
  abs = assertPathInside(projectPath, rel);
@@ -1418,7 +1427,7 @@ IDEMPOTENT: re-running with the same files copies nothing if the content is unch
1418
1427
  };
1419
1428
  }
1420
1429
  });
1421
- server.tool("admin.commit_backup", "SIDE-EFFECTFUL — TOUCHES THE NETWORK. Sync the project's KB data into its git backup directory, create a commit, and `git push` to `origin`. AUTH: relies on the local user's git credentials (SSH agent, credential helper, etc.) — there is no in-server auth. Kontexta does not rate-limit, but the remote may. Idempotent in steady state: a no-op commit is skipped, but the push still runs. Throws if the project has no configured backup repo or if push fails (network, auth, conflict). Returns `{success, copied_files_count, copied_paths}`. Use after a batch of KB writes to get changes off-machine.", {
1430
+ server.tool("admin.commit_backup", "SIDE-EFFECTFUL: TOUCHES THE NETWORK. Sync the project's KB data into its git backup directory, create a commit, and `git push` to `origin`. AUTH: relies on the local user's git credentials (SSH agent, credential helper, etc.), there is no in-server auth. Kontexta does not rate-limit, but the remote may. Idempotent in steady state: a no-op commit is skipped, but the push still runs. Throws if the project has no configured backup repo or if push fails (network, auth, conflict). Returns `{success, copied_files_count, copied_paths}`. Use after a batch of KB writes to get changes off-machine.", {
1422
1431
  project_id: z.number().describe("Project ID"),
1423
1432
  }, async ({ project_id }) => {
1424
1433
  try {
@@ -1443,7 +1452,7 @@ server.tool("admin.commit_backup", "SIDE-EFFECTFUL — TOUCHES THE NETWORK. Sync
1443
1452
  };
1444
1453
  }
1445
1454
  });
1446
- server.tool("resources.clip_url", "SIDE-EFFECTFUL — fetches an EXTERNAL URL and writes a NEW KB file. Downloads the page, extracts the main article via Readability, converts to markdown, and saves it under `knowledge/urlclips/`. Auto-classified as content_class='dictionary' (clipped external references are treated as authoritative reference material). NOT idempotent / no de-dup — re-clipping the same URL creates a second file. AUTH: anonymous by default; pass `headers` (e.g. `{Cookie: 'session=...'}` or `{Authorization: 'Bearer ...'}`) to clip behind logins. Kontexta does not rate-limit but the upstream may throttle. On auth-required pages returns isError with `code: AUTH_REQUIRED`, optional `login_url`, and a hint to retry with `headers`. Returns `{file_id, path, title, source}`. Use to ingest external docs into the KB.", {
1455
+ server.tool("resources.clip_url", "SIDE-EFFECTFUL: fetches an EXTERNAL URL and writes a NEW KB file. Downloads the page, extracts the main article via Readability, converts to markdown, and saves it under `knowledge/urlclips/`. Auto-classified as content_class='dictionary' (clipped external references are treated as authoritative reference material). NOT idempotent / no de-dup: re-clipping the same URL creates a second file. AUTH: anonymous by default; pass `headers` (e.g. `{Cookie: 'session=...'}` or `{Authorization: 'Bearer ...'}`) to clip behind logins. Kontexta does not rate-limit but the upstream may throttle. On auth-required pages returns isError with `code: AUTH_REQUIRED`, optional `login_url`, and a hint to retry with `headers`. Returns `{file_id, path, title, source}`. Use to ingest external docs into the KB.", {
1447
1456
  url: z.string().url().describe("The URL to clip"),
1448
1457
  title: z.string().optional().describe("Optional title override (defaults to the page's <title>)"),
1449
1458
  headers: z
@@ -1511,7 +1520,7 @@ server.tool("files.get_history", "Return the git commit history for one file (ne
1511
1520
  ],
1512
1521
  };
1513
1522
  });
1514
- server.tool("files.get_diff", "Return the unified diff of one file between two commit hashes (typically obtained from `files.get_history` for the same file). Read-only; no side effects, auth, or rate limits. Order matters — `commit_a` is treated as the earlier side; reversing the args inverts the diff. Throws if either hash is unknown to the file's repo. Use after `files.get_history` to see WHAT changed, not just THAT it changed.", {
1523
+ server.tool("files.get_diff", "Return the unified diff of one file between two commit hashes (typically obtained from `files.get_history` for the same file). Read-only; no side effects, auth, or rate limits. Order matters: `commit_a` is treated as the earlier side; reversing the args inverts the diff. Throws if either hash is unknown to the file's repo. Use after `files.get_history` to see WHAT changed, not just THAT it changed.", {
1515
1524
  file_id: z.number().describe("ID of the file"),
1516
1525
  commit_a: z.string().describe("Earlier commit hash (from get_history)"),
1517
1526
  commit_b: z.string().describe("Later commit hash (from get_history)"),
@@ -1533,6 +1542,9 @@ server.tool("files.restore", "DESTRUCTIVE. Overwrite a file's current on-disk co
1533
1542
  }, async ({ file_id, hash }) => {
1534
1543
  try {
1535
1544
  const file = readFile(file_id);
1545
+ const refusal = refuseRepoFile(file);
1546
+ if (refusal)
1547
+ throw new Error(refusal);
1536
1548
  const content = await restoreVersion(repoDirForFile(file), file.path, hash);
1537
1549
  return {
1538
1550
  content: [
@@ -1556,7 +1568,7 @@ server.tool("files.restore", "DESTRUCTIVE. Overwrite a file's current on-disk co
1556
1568
  };
1557
1569
  }
1558
1570
  });
1559
- server.tool("files.read_outline", "Return a flat list of markdown headings for one file (level, text, line, byteStart, byteEnd). Read-only; no side effects, auth, or rate limits. Use as a cheap probe before `files.read({ id, section })` or `files.update({ file_id, section, content })` so you don't spend tokens on the full body just to learn what sections exist. Empty outline means the file has no markdown headings (it may still have content — fall back to `files.read` in full or `files.read({ id, lines })`).", {
1571
+ server.tool("files.read_outline", "Return a flat list of markdown headings for one file (level, text, line, byteStart, byteEnd). Read-only; no side effects, auth, or rate limits. Use as a cheap probe before `files.read({ id, section })` or `files.update({ file_id, section, content })` so you don't spend tokens on the full body just to learn what sections exist. Empty outline means the file has no markdown headings (it may still have content: fall back to `files.read` in full or `files.read({ id, lines })`).", {
1560
1572
  file_id: z.number().describe("File ID"),
1561
1573
  }, async ({ file_id }) => {
1562
1574
  try {
@@ -1627,12 +1639,15 @@ server.tool("folders.list", "List folder paths under a project root (or the Know
1627
1639
  };
1628
1640
  }
1629
1641
  });
1630
- server.tool("folders.create", "Create a folder under a project root or the KB. Idempotent — creating an existing folder succeeds. Nested paths like `notes/inbox` create intermediates. REJECTS: empty names, null bytes, leading path separators, and any segment equal to `..` (the call returns isError, no folder is touched). Side effect: a directory is mkdir'd on disk; no DB rows are written until a file lands inside. No external auth or rate limits. Returns `{path, base_path}`.", {
1642
+ server.tool("folders.create", "Create a folder in the KB (a `project_id` is refused: kxta never writes into a project repo). Idempotent, creating an existing folder succeeds. Nested paths like `notes/inbox` create intermediates. REJECTS: empty names, null bytes, leading path separators, and any segment equal to `..` (the call returns isError, no folder is touched). Side effect: a directory is mkdir'd on disk; no DB rows are written until a file lands inside. No external auth or rate limits. Returns `{path, base_path}`.", {
1631
1643
  project_id: z.number().nullable().optional().describe("Project ID. Pass null or omit to create the folder under the KB."),
1632
1644
  name: z.string().describe("Folder name (relative; supports nested paths via '/')"),
1633
1645
  }, async ({ project_id, name }) => {
1634
1646
  try {
1635
1647
  validateFolderName(name);
1648
+ const refusal = refuseProjectFolder(project_id);
1649
+ if (refusal)
1650
+ throw new Error(refusal);
1636
1651
  const base = resolveFolderBase(project_id);
1637
1652
  const path = createFolder(base, name, { dataDir });
1638
1653
  return {
@@ -1646,7 +1661,7 @@ server.tool("folders.create", "Create a folder under a project root or the KB. I
1646
1661
  };
1647
1662
  }
1648
1663
  });
1649
- server.tool("folders.delete", "DESTRUCTIVE — recursively delete a folder under the KB AND every file inside it (disk + FTS rows). REFUSES (returns isError) when `project_id` is supplied: deleting inside a registered project would race the file watcher and re-ingest the contents — remove project content via your editor instead. Same name validation as `folders.create`. Not recoverable from Kontexta after the call (only the git backup, if configured, retains it). No external auth or rate limits. Returns `{success: true}`.", {
1664
+ server.tool("folders.delete", "DESTRUCTIVE: recursively delete a folder under the KB AND every file inside it (disk + FTS rows). REFUSES (returns isError) when `project_id` is supplied: deleting inside a registered project would race the file watcher and re-ingest the contents, remove project content via your editor instead. Same name validation as `folders.create`. Not recoverable from Kontexta after the call (only the git backup, if configured, retains it). No external auth or rate limits. Returns `{success: true}`.", {
1650
1665
  project_id: z.number().nullable().optional().describe("Project ID. Pass null or omit to delete from the KB. Project IDs are rejected."),
1651
1666
  name: z.string().describe("Folder name (relative)"),
1652
1667
  }, async ({ project_id, name }) => {
@@ -1665,13 +1680,13 @@ server.tool("folders.delete", "DESTRUCTIVE — recursively delete a folder under
1665
1680
  ],
1666
1681
  };
1667
1682
  }
1668
- // Refuse deleting a bare bucket name — would wipe the whole bucket and orphan DB rows.
1683
+ // Refuse deleting a bare bucket name: would wipe the whole bucket and orphan DB rows.
1669
1684
  const KB_BUCKETS_TOP = new Set(["journal", "knowledge", "mermaid", "html"]);
1670
1685
  const segments = name.split(/[/\\]/).filter(Boolean);
1671
1686
  if (segments.length === 1 && KB_BUCKETS_TOP.has(segments[0])) {
1672
1687
  return {
1673
1688
  isError: true,
1674
- content: [{ type: "text", text: JSON.stringify({ error: `Cannot delete the '${segments[0]}' bucket — part of the fixed KB layout.` }, null, 2) }],
1689
+ content: [{ type: "text", text: JSON.stringify({ error: `Cannot delete the '${segments[0]}' bucket, part of the fixed KB layout.` }, null, 2) }],
1675
1690
  };
1676
1691
  }
1677
1692
  const base = resolveFolderBase(null);
@@ -1687,7 +1702,7 @@ server.tool("folders.delete", "DESTRUCTIVE — recursively delete a folder under
1687
1702
  };
1688
1703
  }
1689
1704
  });
1690
- server.tool("files.move", "Move/rename a file. Destination 'new_path' must be absolute and resolve INSIDE the file's owning project or global knowledge directory. Cross-project moves are rejected. Alternative: pass `kind='dictionary'|'note'` (with no `new_path`) to move a KB file into the mirrored path in the other class tree — subfolder path is preserved. Operates locally with no auth or limits.", {
1705
+ server.tool("files.move", "Move/rename a KB file (project-repo files are refused). Destination 'new_path' must be absolute and resolve INSIDE the file's owning project or global knowledge directory. Cross-project moves are rejected. Alternative: pass `kind='dictionary'|'note'` (with no `new_path`) to move a KB file into the mirrored path in the other class tree, subfolder path is preserved. Operates locally with no auth or limits.", {
1691
1706
  file_id: z.number().describe("File ID"),
1692
1707
  new_path: z.string().optional().describe("Absolute destination path"),
1693
1708
  kind: z.enum(["dictionary", "note"]).optional()
@@ -1695,6 +1710,9 @@ server.tool("files.move", "Move/rename a file. Destination 'new_path' must be ab
1695
1710
  }, async ({ file_id, new_path, kind }) => {
1696
1711
  try {
1697
1712
  const file = readFile(file_id);
1713
+ const refusal = refuseRepoFile(file);
1714
+ if (refusal)
1715
+ throw new Error(refusal);
1698
1716
  if (kind && !new_path) {
1699
1717
  if (file.storage_type !== "local") {
1700
1718
  throw new Error("move_file with kind is only supported for KB files (storage_type='local')");
@@ -1728,7 +1746,7 @@ server.tool("files.move", "Move/rename a file. Destination 'new_path' must be ab
1728
1746
  else {
1729
1747
  base = join(dataDir, "knowledge");
1730
1748
  }
1731
- // Use realpath to follow symlinks before the containment check —
1749
+ // Use realpath to follow symlinks before the containment check,
1732
1750
  // path.resolve() only normalises `.`/`..`, so a symlink inside the
1733
1751
  // vault pointing outside (e.g. knowledge/escape -> /etc) would let
1734
1752
  // moveFile write through it. realpath the dest's PARENT since the
@@ -1755,7 +1773,7 @@ server.tool("files.move", "Move/rename a file. Destination 'new_path' must be ab
1755
1773
  }
1756
1774
  // Defense-in-depth: also confirm the SOURCE lives under the same base.
1757
1775
  // If a project was re-registered to a new path after this file was
1758
- // ingested, fileRecord.path can point outside the current base — and
1776
+ // ingested, fileRecord.path can point outside the current base: and
1759
1777
  // without this check moveFile would relocate that orphan into the
1760
1778
  // project root.
1761
1779
  let srcResolved;
@@ -1780,7 +1798,7 @@ server.tool("files.move", "Move/rename a file. Destination 'new_path' must be ab
1780
1798
  };
1781
1799
  }
1782
1800
  });
1783
- server.tool("files.find_related", "Find other files sharing tags with the given file, ranked by `shared_tag_count` descending. Read-only; no side effects, auth, or rate limits. Returns annotated file rows with `shared_tag_count` and `shared_tags`. Empty result means the file has no tags or no other file shares them — try `files.search`/`files.regex_search` for content-based discovery, or `tags.suggest` to bootstrap labels first. `kind` narrows to one content class. Default limit 10.", {
1801
+ server.tool("files.find_related", "Find other files sharing tags with the given file, ranked by `shared_tag_count` descending. Read-only; no side effects, auth, or rate limits. Returns annotated file rows with `shared_tag_count` and `shared_tags`. Empty result means the file has no tags or no other file shares them: try `files.search`/`files.regex_search` for content-based discovery, or `tags.suggest` to bootstrap labels first. `kind` narrows to one content class. Default limit 10.", {
1784
1802
  file_id: z.number().describe("ID of the file to find relations for"),
1785
1803
  limit: z.number().optional().describe("Maximum number of related files to return (default 10)"),
1786
1804
  kind: z.enum(["dictionary", "note", "journal", "project"]).optional()
@@ -1803,11 +1821,11 @@ server.tool("files.find_related", "Find other files sharing tags with the given
1803
1821
  ],
1804
1822
  };
1805
1823
  });
1806
- server.tool("tags.search", "Bulk-tag — run an FTS `search` and append `add_tags` to every matching file in one call. Side effect: each match gets `addTags` applied (additive, idempotent per tag); the matched files themselves are NOT modified beyond their tag links. Per-file failures isolated to `errors[]`. No external auth or rate limits. There is NO dry-run flag, so ALWAYS run `files.search` with the same query first to verify the match set before tagging. The `tags[]` filter requires existing tags to ALL match (it scopes the search; it does not control which tags get added). Returns `{matched_count, tagged_count, tags_applied, tagged_ids, errors}`.", {
1824
+ server.tool("tags.search", "Bulk-tag: run an FTS `search` and append `add_tags` to every matching file in one call. Side effect: each match gets `addTags` applied (additive, idempotent per tag); the matched files themselves are NOT modified beyond their tag links. Per-file failures isolated to `errors[]`. No external auth or rate limits. There is NO dry-run flag, so ALWAYS run `files.search` with the same query first to verify the match set before tagging. The `tags[]` filter requires existing tags to ALL match (it scopes the search; it does not control which tags get added). Returns `{matched_count, tagged_count, tags_applied, tagged_ids, errors}`.", {
1807
1825
  query: z.string().describe("Full-text search query"),
1808
1826
  add_tags: z.array(z.string()).min(1).describe("Tags to add to every matching file"),
1809
1827
  project_id: z.number().nullable().optional().describe("Scope search to a specific project. Pass null for KB-only results."),
1810
- tags: z.array(z.string()).optional().describe("Filter — only matches that already carry ALL of these tags"),
1828
+ tags: z.array(z.string()).optional().describe("Filter, only matches that already carry ALL of these tags"),
1811
1829
  favorite: z.boolean().optional().describe("If true, restrict to favorited files only."),
1812
1830
  }, async ({ query, add_tags, project_id, tags, favorite }) => {
1813
1831
  const filters = { query };
@@ -1853,7 +1871,7 @@ server.tool("tags.search", "Bulk-tag — run an FTS `search` and append `add_tag
1853
1871
  ],
1854
1872
  };
1855
1873
  });
1856
- server.tool("admin.overview", "Vault-state snapshot. `mode: 'stats'` = aggregate counts for a scope: `file_count`, `untagged_count`, `favorite_count`, `top_tags`. With `project_id` omitted (everything), also returns `by_project` breakdown. `include_token_total: true` stat()s every matching file on disk to compute a body-size estimate — measurably slower on large vaults; default false. `mode: 'whats_new'` = list files created or modified since a checkpoint (`since`, REQUIRED for this mode — ISO-8601 like `2025-01-15T00:00:00Z` or relative durations like `1h`/`7d`/`2w`; invalid formats throw); CAVEAT: hard-deleted files are NOT surfaced, only mtime-driven changes. Both modes: `project_id: null` = KB only; omit = everything. Read-only; no side effects, auth, or rate limits. Use `stats` as a cheap dashboard or to spot untagged content for cleanup (for live disk-vs-index drift use `files.diff_against_disk`); use `whats_new` at session start to catch up.", {
1874
+ server.tool("admin.overview", "Vault-state snapshot. `mode: 'stats'` = aggregate counts for a scope: `file_count`, `untagged_count`, `favorite_count`, `top_tags`. With `project_id` omitted (everything), also returns `by_project` breakdown. `include_token_total: true` stat()s every matching file on disk to compute a body-size estimate, measurably slower on large vaults; default false. `mode: 'whats_new'` = list files created or modified since a checkpoint (`since`, REQUIRED for this mode, ISO-8601 like `2025-01-15T00:00:00Z` or relative durations like `1h`/`7d`/`2w`; invalid formats throw); CAVEAT: hard-deleted files are NOT surfaced, only mtime-driven changes. Both modes: `project_id: null` = KB only; omit = everything. Read-only; no side effects, auth, or rate limits. Use `stats` as a cheap dashboard or to spot untagged content for cleanup (for live disk-vs-index drift use `files.diff_against_disk`); use `whats_new` at session start to catch up.", {
1857
1875
  mode: z.enum(["stats", "whats_new"]).describe("Which snapshot to return. 'whats_new' requires `since`."),
1858
1876
  project_id: z.number().nullable().optional().describe("Filter to a single project. Pass null for KB-only. Omit for everything."),
1859
1877
  top_tags: z.number().int().positive().max(100).optional().describe("mode='stats' only: how many top tags to return (default 10)"),
@@ -1984,7 +2002,7 @@ server.tool("admin.overview", "Vault-state snapshot. `mode: 'stats'` = aggregate
1984
2002
  };
1985
2003
  }
1986
2004
  });
1987
- server.tool("tags.suggest", "Propose tags for a file by mining the existing tag corpus via FTS — picks distinctive terms from the file (≥4 chars, stopword-filtered) and returns tags applied to other files that score high on those terms. No LLM, no network. Already-applied tags are excluded so the suggestions are net-new. Read-only; no side effects, auth, or rate limits. Returns `{file_id, path, existing_tags, suggestions: [{tag, score, sources}]}`. Empty suggestions = no distinctive terms or no overlap with the existing taxonomy yet — bootstrap with `tags.add` first. Default limit 10, max 50. Suggestions are NOT auto-applied.", {
2005
+ server.tool("tags.suggest", "Propose tags for a file by mining the existing tag corpus via FTS: picks distinctive terms from the file (≥4 chars, stopword-filtered) and returns tags applied to other files that score high on those terms. No LLM, no network. Already-applied tags are excluded so the suggestions are net-new. Read-only; no side effects, auth, or rate limits. Returns `{file_id, path, existing_tags, suggestions: [{tag, score, sources}]}`. Empty suggestions = no distinctive terms or no overlap with the existing taxonomy yet, bootstrap with `tags.add` first. Default limit 10, max 50. Suggestions are NOT auto-applied.", {
1988
2006
  file_id: z.number().describe("File ID to suggest tags for"),
1989
2007
  limit: z.number().int().positive().max(50).optional().describe("Max suggestions to return (default 10)"),
1990
2008
  }, async ({ file_id, limit }) => {
@@ -2064,7 +2082,7 @@ server.tool("tags.suggest", "Propose tags for a file by mining the existing tag
2064
2082
  };
2065
2083
  }
2066
2084
  });
2067
- server.tool("files.diff_against_disk", "Diagnose drift between one file's disk content and its FTS index. Status is one of `in_sync`, `diverged`, `disk_unreadable`, or `no_index_row`. On divergence returns sizes, line counts, the first divergent line number, and the disk vs index sample for that line — NOT a full diff (use `files.get_diff` for full diffs between commits). Read-only; no side effects, auth, or rate limits. Use when search results look stale; if status is `diverged` or `no_index_row`, run `projects.refresh_index` to fix.", {
2085
+ server.tool("files.diff_against_disk", "Diagnose drift between one file's disk content and its FTS index. Status is one of `in_sync`, `diverged`, `disk_unreadable`, or `no_index_row`. On divergence returns sizes, line counts, the first divergent line number, and the disk vs index sample for that line: NOT a full diff (use `files.get_diff` for full diffs between commits). Read-only; no side effects, auth, or rate limits. Use when search results look stale; if status is `diverged` or `no_index_row`, run `projects.refresh_index` to fix.", {
2068
2086
  file_id: z.number().describe("File ID"),
2069
2087
  }, async ({ file_id }) => {
2070
2088
  try {
@@ -2171,7 +2189,7 @@ server.tool("files.diff_against_disk", "Diagnose drift between one file's disk c
2171
2189
  };
2172
2190
  }
2173
2191
  });
2174
- server.tool("projects.refresh_index", "Reconcile the FTS index against disk. For a project (`project_id` set), re-runs `discoverFiles`. For the KB (`project_id` null/omitted), walks `knowledge/`, ingests new .md files, reindexes any whose content hash drifted, and PRUNES rows for files no longer on disk. SIDE-EFFECTFUL: writes/updates/deletes file and FTS rows (the prune is destructive on stale index rows but never deletes files from disk). Idempotent — running twice is a near no-op. Skips files >5MB and standard junk dirs (`node_modules`, `.git`, `dist`, `build`, etc.). No external auth or rate limits. Returns `{scope, newly_indexed, refreshed, pruned}`. Use after editing files outside Kontexta, or when `files.diff_against_disk` reports drift.", {
2192
+ server.tool("projects.refresh_index", "Reconcile the FTS index against disk. For a project (`project_id` set), re-runs `discoverFiles`. For the KB (`project_id` null/omitted), walks `knowledge/`, ingests new .md files, reindexes any whose content hash drifted, and PRUNES rows for files no longer on disk. SIDE-EFFECTFUL: writes/updates/deletes file and FTS rows (the prune is destructive on stale index rows but never deletes files from disk). Idempotent, running twice is a near no-op. Skips files >5MB and standard junk dirs (`node_modules`, `.git`, `dist`, `build`, etc.). No external auth or rate limits. Returns `{scope, newly_indexed, refreshed, pruned}`. Use after editing files outside Kontexta, or when `files.diff_against_disk` reports drift.", {
2175
2193
  project_id: z.number().nullable().optional().describe("Project ID. Pass null or omit to reindex the Knowledge Base."),
2176
2194
  }, async ({ project_id }) => {
2177
2195
  try {
@@ -2192,7 +2210,7 @@ server.tool("projects.refresh_index", "Reconcile the FTS index against disk. For
2192
2210
  };
2193
2211
  }
2194
2212
  });
2195
- server.tool("projects.map", "Return a compact indented outline of folders, file titles, tags, and IDs in a single dense block — substantially fewer tokens than the equivalent `files.list` JSON for the same scope. Read-only; no side effects, auth, or rate limits. Capped at `max_lines` (default 5000); the response reports `est_tokens` and emits a `warning` field if it exceeds `KONTEXTA_PROJECT_TOKEN_WARN`. `project_id: null` = KB only; omit = everything. Defaults: include_tags=true, show_titles=true. Use to orient yourself in an unfamiliar vault or project; for keyword lookup use `files.search`.", {
2213
+ server.tool("projects.map", "Return a compact indented outline of folders, file titles, tags, and IDs in a single dense block: substantially fewer tokens than the equivalent `files.list` JSON for the same scope. Read-only; no side effects, auth, or rate limits. Capped at `max_lines` (default 5000); the response reports `est_tokens` and emits a `warning` field if it exceeds `KONTEXTA_PROJECT_TOKEN_WARN`. `project_id: null` = KB only; omit = everything. Defaults: include_tags=true, show_titles=true. Use to orient yourself in an unfamiliar vault or project; for keyword lookup use `files.search`.", {
2196
2214
  project_id: z.number().nullable().optional().describe("Restrict to a single project. Pass null for knowledge-base-only files. Omit for everything."),
2197
2215
  include_tags: z.boolean().optional().describe("Append #tags inline. Default true. Set false to shrink the outline."),
2198
2216
  show_titles: z.boolean().optional().describe("Show file titles instead of filenames. Default true."),
@@ -2271,7 +2289,7 @@ server.resource("File Content", new ResourceTemplate("kontexta://files/{id}", {
2271
2289
  ],
2272
2290
  };
2273
2291
  });
2274
- server.tool("hands.list", "List every Hands command tool currently registered, with project scope, tool name, danger level, confirmation flag, and description. Hands tools come from per-project `kontexta.json` files loaded at register time. Pass `schema: true` to instead get the complete `kontexta.json` authoring reference (JSON schema, validation rules, security guarantees, limitations, annotated example) — a static document, unrelated to any specific registered hand. Read-only; no side effects, auth, or rate limits. Use the default list mode to discover what side-effectful project commands the agent is permitted to run; use `schema: true` when helping a user write or fix a `kontexta.json`; reload after editing one with `hands.reload`.", {
2292
+ server.tool("hands.list", "List every Hands command tool currently registered, with project scope, tool name, danger level, confirmation flag, and description. Hands tools come from per-project `kontexta.json` files loaded at register time. Pass `schema: true` to instead get the complete `kontexta.json` authoring reference (JSON schema, validation rules, security guarantees, limitations, annotated example), a static document, unrelated to any specific registered hand. Read-only; no side effects, auth, or rate limits. Use the default list mode to discover what side-effectful project commands the agent is permitted to run; use `schema: true` when helping a user write or fix a `kontexta.json`; reload after editing one with `hands.reload`.", {
2275
2293
  schema: z.boolean().optional().describe("If true, return the kontexta.json authoring reference document instead of the registered-hands list. Default false."),
2276
2294
  }, async ({ schema }) => {
2277
2295
  if (schema) {
@@ -2280,14 +2298,14 @@ server.tool("hands.list", "List every Hands command tool currently registered, w
2280
2298
  const items = handsRegistry.list();
2281
2299
  return { content: [{ type: "text", text: JSON.stringify({ hands: items }, null, 2) }] };
2282
2300
  });
2283
- server.tool("hands.reload", "Re-scan every registered project's `kontexta.json` and rebuild the live Hands tool registry — newly-declared tools become callable immediately, removed tools disappear from `tools/list`. SIDE EFFECT is on the running MCP session's tool inventory only (no disk writes). Idempotent. No external auth or rate limits. Takes no parameters. Returns per-project load results (counts of registered/disabled tools and any validation warnings). Use after editing a `kontexta.json` mid-session; for the schema see `hands.list({ schema: true })`.", {}, async () => {
2301
+ server.tool("hands.reload", "Re-scan every registered project's `kontexta.json` and rebuild the live Hands tool registry: newly-declared tools become callable immediately, removed tools disappear from `tools/list`. SIDE EFFECT is on the running MCP session's tool inventory only (no disk writes). Idempotent. No external auth or rate limits. Takes no parameters. Returns per-project load results (counts of registered/disabled tools and any validation warnings). Use after editing a `kontexta.json` mid-session; for the schema see `hands.list({ schema: true })`.", {}, async () => {
2284
2302
  const projects = listProjects()
2285
2303
  .filter((p) => p.path && existsSync(p.path))
2286
2304
  .map((p) => ({ name: p.name, root: p.path }));
2287
2305
  const r = handsRegistry.reloadAll(projects);
2288
2306
  return { content: [{ type: "text", text: JSON.stringify(r, null, 2) }] };
2289
2307
  });
2290
- server.tool("hands.confirm", "Approve and EXECUTE a previously-issued Hands invocation by its single-use approval token. The token is returned by any confirm-required Hands tool; tokens expire after 60 seconds and CANNOT be reused. Side effect equals whatever the underlying Hand does — this can be highly destructive (running arbitrary shell commands, modifying files, etc.), so only call when the user has authorised the pending action. The token IS the auth (no external auth, no rate limits). Invalid, expired, or already-consumed tokens return an inert text response, NOT an error.", { token: z.string().describe("The approval token from the pending response") }, async ({ token }) => {
2308
+ server.tool("hands.confirm", "Approve and EXECUTE a previously-issued Hands invocation by its single-use approval token. The token is returned by any confirm-required Hands tool; tokens expire after 60 seconds and CANNOT be reused. Side effect equals whatever the underlying Hand does: this can be highly destructive (running arbitrary shell commands, modifying files, etc.), so only call when the user has authorised the pending action. The token IS the auth (no external auth, no rate limits). Invalid, expired, or already-consumed tokens return an inert text response, NOT an error.", { token: z.string().describe("The approval token from the pending response") }, async ({ token }) => {
2291
2309
  const pending = handsRegistry.getConfirmStore().consume(token);
2292
2310
  if (!pending) {
2293
2311
  return { content: [{ type: "text", text: "Token invalid, expired, or already consumed." }] };