kontexta 5.2.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/bundle/standalone/CHANGELOG.md +33 -0
  2. package/bundle/standalone/apps/web/.next/BUILD_ID +1 -1
  3. package/bundle/standalone/apps/web/.next/app-build-manifest.json +54 -54
  4. package/bundle/standalone/apps/web/.next/app-path-routes-manifest.json +14 -14
  5. package/bundle/standalone/apps/web/.next/build-manifest.json +2 -2
  6. package/bundle/standalone/apps/web/.next/prerender-manifest.json +3 -3
  7. package/bundle/standalone/apps/web/.next/required-server-files.json +1 -0
  8. package/bundle/standalone/apps/web/.next/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 +4 -4
  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.nft.json +1 -1
  15. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/hooks/route_client-reference-manifest.js +1 -1
  16. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/mcp/route.js.nft.json +1 -1
  17. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/mcp/route_client-reference-manifest.js +1 -1
  18. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/route.js.nft.json +1 -1
  19. package/bundle/standalone/apps/web/.next/server/app/api/agents/[id]/route_client-reference-manifest.js +1 -1
  20. package/bundle/standalone/apps/web/.next/server/app/api/agents/route.js.nft.json +1 -1
  21. package/bundle/standalone/apps/web/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  22. package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  23. package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  24. package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  25. package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  26. package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route.js.nft.json +1 -1
  27. package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
  28. package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  29. package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  30. package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route.js.nft.json +1 -1
  31. package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route_client-reference-manifest.js +1 -1
  32. package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route.js.nft.json +1 -1
  33. package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route_client-reference-manifest.js +1 -1
  34. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route.js.nft.json +1 -1
  35. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route_client-reference-manifest.js +1 -1
  36. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route.js.nft.json +1 -1
  37. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route_client-reference-manifest.js +1 -1
  38. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route.js.nft.json +1 -1
  39. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route_client-reference-manifest.js +1 -1
  40. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route.js.nft.json +1 -1
  41. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route_client-reference-manifest.js +1 -1
  42. package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route.js.nft.json +1 -1
  43. package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route_client-reference-manifest.js +1 -1
  44. package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route.js.nft.json +1 -1
  45. package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route_client-reference-manifest.js +1 -1
  46. package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route.js.nft.json +1 -1
  47. package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route_client-reference-manifest.js +1 -1
  48. package/bundle/standalone/apps/web/.next/server/app/api/clip/route.js.nft.json +1 -1
  49. package/bundle/standalone/apps/web/.next/server/app/api/clip/route_client-reference-manifest.js +1 -1
  50. package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route.js.nft.json +1 -1
  51. package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route_client-reference-manifest.js +1 -1
  52. package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route.js.nft.json +1 -1
  53. package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route_client-reference-manifest.js +1 -1
  54. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/backlinks/route.js.nft.json +1 -1
  55. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/backlinks/route_client-reference-manifest.js +1 -1
  56. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route.js.nft.json +1 -1
  57. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route_client-reference-manifest.js +1 -1
  58. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-html/route.js.nft.json +1 -1
  59. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-html/route_client-reference-manifest.js +1 -1
  60. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route.js.nft.json +1 -1
  61. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route_client-reference-manifest.js +1 -1
  62. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route.js.nft.json +1 -1
  63. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route_client-reference-manifest.js +1 -1
  64. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route.js.nft.json +1 -1
  65. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route_client-reference-manifest.js +1 -1
  66. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route.js.nft.json +1 -1
  67. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route_client-reference-manifest.js +1 -1
  68. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route.js.nft.json +1 -1
  69. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route_client-reference-manifest.js +1 -1
  70. package/bundle/standalone/apps/web/.next/server/app/api/files/route.js.nft.json +1 -1
  71. package/bundle/standalone/apps/web/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  72. package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route.js.nft.json +1 -1
  73. package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route_client-reference-manifest.js +1 -1
  74. package/bundle/standalone/apps/web/.next/server/app/api/folders/route.js +1 -1
  75. package/bundle/standalone/apps/web/.next/server/app/api/folders/route.js.nft.json +1 -1
  76. package/bundle/standalone/apps/web/.next/server/app/api/folders/route_client-reference-manifest.js +1 -1
  77. package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route.js.nft.json +1 -1
  78. package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route_client-reference-manifest.js +1 -1
  79. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route.js.nft.json +1 -1
  80. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route_client-reference-manifest.js +1 -1
  81. package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route.js.nft.json +1 -1
  82. package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route_client-reference-manifest.js +1 -1
  83. package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route.js.nft.json +1 -1
  84. package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route_client-reference-manifest.js +1 -1
  85. package/bundle/standalone/apps/web/.next/server/app/api/health/route.js.nft.json +1 -1
  86. package/bundle/standalone/apps/web/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  87. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js +1 -1
  88. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js.nft.json +1 -1
  89. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route_client-reference-manifest.js +1 -1
  90. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js +1 -1
  91. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js.nft.json +1 -1
  92. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route_client-reference-manifest.js +1 -1
  93. package/bundle/standalone/apps/web/.next/server/app/api/profile/route.js.nft.json +1 -1
  94. package/bundle/standalone/apps/web/.next/server/app/api/profile/route_client-reference-manifest.js +1 -1
  95. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route.js.nft.json +1 -1
  96. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route_client-reference-manifest.js +1 -1
  97. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route.js.nft.json +1 -1
  98. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route_client-reference-manifest.js +1 -1
  99. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route.js.nft.json +1 -1
  100. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route_client-reference-manifest.js +1 -1
  101. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route.js.nft.json +1 -1
  102. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route_client-reference-manifest.js +1 -1
  103. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route.js.nft.json +1 -1
  104. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route_client-reference-manifest.js +1 -1
  105. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  106. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  107. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route.js.nft.json +1 -1
  108. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route_client-reference-manifest.js +1 -1
  109. package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route.js.nft.json +1 -1
  110. package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route_client-reference-manifest.js +1 -1
  111. package/bundle/standalone/apps/web/.next/server/app/api/projects/route.js.nft.json +1 -1
  112. package/bundle/standalone/apps/web/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  113. package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route.js.nft.json +1 -1
  114. package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route_client-reference-manifest.js +1 -1
  115. package/bundle/standalone/apps/web/.next/server/app/api/publish/route.js.nft.json +1 -1
  116. package/bundle/standalone/apps/web/.next/server/app/api/publish/route_client-reference-manifest.js +1 -1
  117. package/bundle/standalone/apps/web/.next/server/app/api/refresh/route.js.nft.json +1 -1
  118. package/bundle/standalone/apps/web/.next/server/app/api/refresh/route_client-reference-manifest.js +1 -1
  119. package/bundle/standalone/apps/web/.next/server/app/api/reindex/route.js.nft.json +1 -1
  120. package/bundle/standalone/apps/web/.next/server/app/api/reindex/route_client-reference-manifest.js +1 -1
  121. package/bundle/standalone/apps/web/.next/server/app/api/reports/resources/[name]/route.js.nft.json +1 -1
  122. package/bundle/standalone/apps/web/.next/server/app/api/reports/resources/[name]/route_client-reference-manifest.js +1 -1
  123. package/bundle/standalone/apps/web/.next/server/app/api/search/route.js.nft.json +1 -1
  124. package/bundle/standalone/apps/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  125. package/bundle/standalone/apps/web/.next/server/app/api/tags/route.js.nft.json +1 -1
  126. package/bundle/standalone/apps/web/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  127. package/bundle/standalone/apps/web/.next/server/app/api/version-check/route.js.nft.json +1 -1
  128. package/bundle/standalone/apps/web/.next/server/app/api/version-check/route_client-reference-manifest.js +1 -1
  129. package/bundle/standalone/apps/web/.next/server/app/api/welcome/route.js.nft.json +1 -1
  130. package/bundle/standalone/apps/web/.next/server/app/api/welcome/route_client-reference-manifest.js +1 -1
  131. package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route.js.nft.json +1 -1
  132. package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route_client-reference-manifest.js +1 -1
  133. package/bundle/standalone/apps/web/.next/server/app/apple-icon.png/route.js.nft.json +1 -1
  134. package/bundle/standalone/apps/web/.next/server/app/calendar/page.js.nft.json +1 -1
  135. package/bundle/standalone/apps/web/.next/server/app/calendar/page_client-reference-manifest.js +1 -1
  136. package/bundle/standalone/apps/web/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  137. package/bundle/standalone/apps/web/.next/server/app/icon.png/route.js.nft.json +1 -1
  138. package/bundle/standalone/apps/web/.next/server/app/login/page.js.nft.json +1 -1
  139. package/bundle/standalone/apps/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  140. package/bundle/standalone/apps/web/.next/server/app/page.js +4 -4
  141. package/bundle/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
  142. package/bundle/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  143. package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page.js.nft.json +1 -1
  144. package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page_client-reference-manifest.js +1 -1
  145. package/bundle/standalone/apps/web/.next/server/app/preview/motifs.html +2 -2
  146. package/bundle/standalone/apps/web/.next/server/app/preview/motifs.rsc +4 -4
  147. package/bundle/standalone/apps/web/.next/server/app-paths-manifest.json +14 -14
  148. package/bundle/standalone/apps/web/.next/server/chunks/3668.js +2 -2
  149. package/bundle/standalone/apps/web/.next/server/pages/404.html +1 -1
  150. package/bundle/standalone/apps/web/.next/server/pages/500.html +1 -1
  151. package/bundle/standalone/apps/web/.next/server/pages/_app.js.nft.json +1 -1
  152. package/bundle/standalone/apps/web/.next/server/pages/_document.js.nft.json +1 -1
  153. package/bundle/standalone/apps/web/.next/server/pages/_error.js.nft.json +1 -1
  154. package/bundle/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  155. package/bundle/standalone/apps/web/.next/static/chunks/app/{layout-da10917c290d5da7.js → layout-b3fc3a7cf96952bd.js} +1 -1
  156. package/bundle/standalone/apps/web/.next/static/chunks/app/page-f2e6293531d0db55.js +1 -0
  157. package/bundle/standalone/apps/web/.next/static/css/{d6e83b3f51ebdda3.css → c9d10f1f97d629ff.css} +1 -1
  158. package/bundle/standalone/apps/web/package.json +6 -5
  159. package/bundle/standalone/apps/web/server.js +1 -1
  160. package/bundle/standalone/apps/web/src/lib/mcp-tools.json +103 -95
  161. package/bundle/standalone/node_modules/kontexta-mcp/dist/agent-rules/rules-block.md +28 -185
  162. package/bundle/standalone/node_modules/kontexta-mcp/dist/agent-rules/rules-reference.md +207 -0
  163. package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js +12 -12
  164. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/formatter.js +1 -1
  165. package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/schema-doc.js +1 -1
  166. package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js +196 -68
  167. package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js.map +1 -1
  168. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.js +3 -3
  169. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-commit-upgrades-tool.js +1 -1
  170. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-housekeep-tool.js +1 -1
  171. package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-tools.js +2 -2
  172. package/bundle/standalone/node_modules/kontexta-mcp/dist/repo-write-guard.js +1 -1
  173. package/bundle/standalone/node_modules/kontexta-mcp/package.json +4 -2
  174. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.d.ts +5 -0
  175. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.d.ts.map +1 -1
  176. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.js +84 -25
  177. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.js.map +1 -1
  178. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/rules-block.md +28 -185
  179. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/rules-reference.md +207 -0
  180. package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.d.ts +25 -1
  181. package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.d.ts.map +1 -1
  182. package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.js +159 -32
  183. package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.js.map +1 -1
  184. package/bundle/standalone/node_modules/kxta-core/dist/decision/engine.d.ts +71 -0
  185. package/bundle/standalone/node_modules/kxta-core/dist/decision/engine.d.ts.map +1 -0
  186. package/bundle/standalone/node_modules/kxta-core/dist/decision/engine.js +192 -0
  187. package/bundle/standalone/node_modules/kxta-core/dist/decision/engine.js.map +1 -0
  188. package/bundle/standalone/node_modules/kxta-core/dist/decision/index.d.ts +9 -0
  189. package/bundle/standalone/node_modules/kxta-core/dist/decision/index.d.ts.map +1 -0
  190. package/bundle/standalone/node_modules/kxta-core/dist/decision/index.js +10 -0
  191. package/bundle/standalone/node_modules/kxta-core/dist/decision/index.js.map +1 -0
  192. package/bundle/standalone/node_modules/kxta-core/dist/decision/intent-router.d.ts +20 -0
  193. package/bundle/standalone/node_modules/kxta-core/dist/decision/intent-router.d.ts.map +1 -0
  194. package/bundle/standalone/node_modules/kxta-core/dist/decision/intent-router.js +124 -0
  195. package/bundle/standalone/node_modules/kxta-core/dist/decision/intent-router.js.map +1 -0
  196. package/bundle/standalone/node_modules/kxta-core/dist/decision/pruning.d.ts +20 -0
  197. package/bundle/standalone/node_modules/kxta-core/dist/decision/pruning.d.ts.map +1 -0
  198. package/bundle/standalone/node_modules/kxta-core/dist/decision/pruning.js +28 -0
  199. package/bundle/standalone/node_modules/kxta-core/dist/decision/pruning.js.map +1 -0
  200. package/bundle/standalone/node_modules/kxta-core/dist/decision/sufficiency.d.ts +30 -0
  201. package/bundle/standalone/node_modules/kxta-core/dist/decision/sufficiency.d.ts.map +1 -0
  202. package/bundle/standalone/node_modules/kxta-core/dist/decision/sufficiency.js +57 -0
  203. package/bundle/standalone/node_modules/kxta-core/dist/decision/sufficiency.js.map +1 -0
  204. package/bundle/standalone/node_modules/kxta-core/dist/decision/types.d.ts +42 -0
  205. package/bundle/standalone/node_modules/kxta-core/dist/decision/types.d.ts.map +1 -0
  206. package/bundle/standalone/node_modules/kxta-core/dist/decision/types.js +7 -0
  207. package/bundle/standalone/node_modules/kxta-core/dist/decision/types.js.map +1 -0
  208. package/bundle/standalone/node_modules/kxta-core/dist/files/index.d.ts +3 -1
  209. package/bundle/standalone/node_modules/kxta-core/dist/files/index.d.ts.map +1 -1
  210. package/bundle/standalone/node_modules/kxta-core/dist/files/index.js +10 -1
  211. package/bundle/standalone/node_modules/kxta-core/dist/files/index.js.map +1 -1
  212. package/bundle/standalone/node_modules/kxta-core/dist/hooks/alerts.js +2 -2
  213. package/bundle/standalone/node_modules/kxta-core/dist/index.d.ts +4 -1
  214. package/bundle/standalone/node_modules/kxta-core/dist/index.d.ts.map +1 -1
  215. package/bundle/standalone/node_modules/kxta-core/dist/index.js +4 -1
  216. package/bundle/standalone/node_modules/kxta-core/dist/index.js.map +1 -1
  217. package/bundle/standalone/node_modules/kxta-core/dist/inference/bundled.d.ts +3 -0
  218. package/bundle/standalone/node_modules/kxta-core/dist/inference/bundled.d.ts.map +1 -0
  219. package/bundle/standalone/node_modules/kxta-core/dist/inference/bundled.js +27 -0
  220. package/bundle/standalone/node_modules/kxta-core/dist/inference/bundled.js.map +1 -0
  221. package/bundle/standalone/node_modules/kxta-core/dist/inference/cache-manager.d.ts +41 -0
  222. package/bundle/standalone/node_modules/kxta-core/dist/inference/cache-manager.d.ts.map +1 -0
  223. package/bundle/standalone/node_modules/kxta-core/dist/inference/cache-manager.js +140 -0
  224. package/bundle/standalone/node_modules/kxta-core/dist/inference/cache-manager.js.map +1 -0
  225. package/bundle/standalone/node_modules/kxta-core/dist/inference/index.d.ts +14 -0
  226. package/bundle/standalone/node_modules/kxta-core/dist/inference/index.d.ts.map +1 -0
  227. package/bundle/standalone/node_modules/kxta-core/dist/inference/index.js +15 -0
  228. package/bundle/standalone/node_modules/kxta-core/dist/inference/index.js.map +1 -0
  229. package/bundle/standalone/node_modules/kxta-core/dist/inference/runtime.d.ts +132 -0
  230. package/bundle/standalone/node_modules/kxta-core/dist/inference/runtime.d.ts.map +1 -0
  231. package/bundle/standalone/node_modules/kxta-core/dist/inference/runtime.js +311 -0
  232. package/bundle/standalone/node_modules/kxta-core/dist/inference/runtime.js.map +1 -0
  233. package/bundle/standalone/node_modules/kxta-core/dist/inference/types.d.ts +53 -0
  234. package/bundle/standalone/node_modules/kxta-core/dist/inference/types.d.ts.map +1 -0
  235. package/bundle/standalone/node_modules/kxta-core/dist/inference/types.js +6 -0
  236. package/bundle/standalone/node_modules/kxta-core/dist/inference/types.js.map +1 -0
  237. package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.js +18 -5
  238. package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.js.map +1 -1
  239. package/bundle/standalone/node_modules/kxta-core/dist/journal/event-triage.d.ts +31 -0
  240. package/bundle/standalone/node_modules/kxta-core/dist/journal/event-triage.d.ts.map +1 -0
  241. package/bundle/standalone/node_modules/kxta-core/dist/journal/event-triage.js +94 -0
  242. package/bundle/standalone/node_modules/kxta-core/dist/journal/event-triage.js.map +1 -0
  243. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.js +2 -2
  244. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.js.map +1 -1
  245. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.d.ts.map +1 -1
  246. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.js +5 -0
  247. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.js.map +1 -1
  248. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tool-classes.d.ts.map +1 -1
  249. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tool-classes.js +30 -5
  250. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tool-classes.js.map +1 -1
  251. package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.js +2 -2
  252. package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.d.ts +34 -0
  253. package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.d.ts.map +1 -1
  254. package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.js +251 -6
  255. package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.js.map +1 -1
  256. package/bundle/standalone/node_modules/kxta-core/dist/journal/types.d.ts +1 -0
  257. package/bundle/standalone/node_modules/kxta-core/dist/journal/types.d.ts.map +1 -1
  258. package/bundle/standalone/node_modules/kxta-core/dist/mcp-install/tools.generated.js +58 -58
  259. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.d.ts.map +1 -1
  260. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.js +10 -1
  261. package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.js.map +1 -1
  262. package/bundle/standalone/node_modules/kxta-core/dist/project-map/index.js +1 -1
  263. package/bundle/standalone/node_modules/kxta-core/dist/rerank/arbitrator.d.ts +29 -0
  264. package/bundle/standalone/node_modules/kxta-core/dist/rerank/arbitrator.d.ts.map +1 -0
  265. package/bundle/standalone/node_modules/kxta-core/dist/rerank/arbitrator.js +68 -0
  266. package/bundle/standalone/node_modules/kxta-core/dist/rerank/arbitrator.js.map +1 -0
  267. package/bundle/standalone/node_modules/kxta-core/dist/rerank/engine.d.ts +57 -0
  268. package/bundle/standalone/node_modules/kxta-core/dist/rerank/engine.d.ts.map +1 -0
  269. package/bundle/standalone/node_modules/kxta-core/dist/rerank/engine.js +199 -0
  270. package/bundle/standalone/node_modules/kxta-core/dist/rerank/engine.js.map +1 -0
  271. package/bundle/standalone/node_modules/kxta-core/dist/rerank/index.d.ts +7 -0
  272. package/bundle/standalone/node_modules/kxta-core/dist/rerank/index.d.ts.map +1 -0
  273. package/bundle/standalone/node_modules/kxta-core/dist/rerank/index.js +8 -0
  274. package/bundle/standalone/node_modules/kxta-core/dist/rerank/index.js.map +1 -0
  275. package/bundle/standalone/node_modules/kxta-core/dist/rerank/types.d.ts +50 -0
  276. package/bundle/standalone/node_modules/kxta-core/dist/rerank/types.d.ts.map +1 -0
  277. package/bundle/standalone/node_modules/kxta-core/dist/rerank/types.js +2 -0
  278. package/bundle/standalone/node_modules/kxta-core/dist/rerank/types.js.map +1 -0
  279. package/bundle/standalone/node_modules/kxta-core/dist/types.d.ts +5 -0
  280. package/bundle/standalone/node_modules/kxta-core/dist/types.d.ts.map +1 -1
  281. package/bundle/standalone/node_modules/kxta-core/dist/util/paths.js +1 -1
  282. package/bundle/standalone/node_modules/kxta-core/package.json +4 -2
  283. package/bundle/standalone/node_modules/kxta-publish/package.json +3 -3
  284. package/bundle/standalone/package.json +3 -2
  285. package/package.json +5 -3
  286. package/bundle/standalone/apps/web/.next/static/chunks/app/page-df34c386b7c150bb.js +0 -1
  287. /package/bundle/standalone/apps/web/.next/static/{yyj-uK2RH8Rffeq9wVzjU → olhhWqI4356zOu5Kz_S1K}/_buildManifest.js +0 -0
  288. /package/bundle/standalone/apps/web/.next/static/{yyj-uK2RH8Rffeq9wVzjU → olhhWqI4356zOu5Kz_S1K}/_ssgManifest.js +0 -0
@@ -28,7 +28,7 @@ export const SESSION_START_HOOK_SNIPPET = JSON.stringify({
28
28
  hooks: [
29
29
  {
30
30
  type: "command",
31
- command: "echo 'kontexta: journal.distill recommended at session start' && true",
31
+ command: "echo 'kontexta: journal_distill recommended at session start' && true",
32
32
  },
33
33
  ],
34
34
  },
@@ -43,7 +43,7 @@ export const STOP_HOOK_SNIPPET = JSON.stringify({
43
43
  hooks: [
44
44
  {
45
45
  type: "command",
46
- command: "echo 'kontexta: end-of-session journal.distill recommended' && true",
46
+ command: "echo 'kontexta: end-of-session journal_distill recommended' && true",
47
47
  },
48
48
  ],
49
49
  },
@@ -87,22 +87,21 @@ export const SCAFFOLDS = {
87
87
  copilot: { path: ".github/copilot-instructions.md", header: claudeStyleHeader },
88
88
  generic: { path: "CLAUDE.md", header: claudeStyleHeader },
89
89
  };
90
- function loadRulesBlockBody() {
90
+ /** Shared candidate-path builder for rules-block.md and rules-reference.md. */
91
+ function rulesCandidates(filename) {
91
92
  const here = dirname(fileURLToPath(import.meta.url));
92
- // We check multiple candidates to handle different deployment environments:
93
- // 1. Standard tsc build: dist/agent-rules/rules-block.md (here/rules-block.md)
94
- // 2. Tsup bundle (MCP): apps/mcp/dist/agent-rules/rules-block.md (here/agent-rules/rules-block.md)
95
- // 3. Next.js standalone: handles monorepo flattening or relative tracing.
96
- const candidates = [
97
- join(here, "rules-block.md"),
98
- join(here, "agent-rules", "rules-block.md"),
99
- join(here, "..", "..", "src", "agent-rules", "rules-block.md"), // dist/agent-rules → package root → src/agent-rules
100
- join(process.cwd(), "packages", "core", "src", "agent-rules", "rules-block.md"),
101
- join(process.cwd(), "packages", "core", "dist", "agent-rules", "rules-block.md"),
102
- // Next.js standalone: server.js chdirs into apps/web, so monorepo root is two up
103
- join(process.cwd(), "..", "..", "packages", "core", "src", "agent-rules", "rules-block.md"),
104
- join(process.cwd(), "..", "..", "packages", "core", "dist", "agent-rules", "rules-block.md"),
93
+ return [
94
+ join(here, filename),
95
+ join(here, "agent-rules", filename),
96
+ join(here, "..", "..", "src", "agent-rules", filename),
97
+ join(process.cwd(), "packages", "core", "src", "agent-rules", filename),
98
+ join(process.cwd(), "packages", "core", "dist", "agent-rules", filename),
99
+ join(process.cwd(), "..", "..", "packages", "core", "src", "agent-rules", filename),
100
+ join(process.cwd(), "..", "..", "packages", "core", "dist", "agent-rules", filename),
105
101
  ];
102
+ }
103
+ function loadMarkdownAsset(filename, marker) {
104
+ const candidates = rulesCandidates(filename);
106
105
  const errors = [];
107
106
  for (const p of candidates) {
108
107
  try {
@@ -111,24 +110,33 @@ function loadRulesBlockBody() {
111
110
  continue;
112
111
  }
113
112
  const raw = readFileSync(p, "utf8");
114
- const beginIdx = raw.indexOf("<!-- BEGIN kontexta:rules");
115
- if (beginIdx === -1) {
116
- errors.push(`missing BEGIN marker: ${p}`);
117
- continue;
113
+ if (marker) {
114
+ const beginIdx = raw.indexOf(marker);
115
+ if (beginIdx === -1) {
116
+ errors.push(`missing marker: ${p}`);
117
+ continue;
118
+ }
119
+ return raw.slice(beginIdx).replace(/\{\{VERSION\}\}/g, RULE_BLOCK_VERSION);
118
120
  }
119
- return raw.slice(beginIdx).replace(/\{\{VERSION\}\}/g, RULE_BLOCK_VERSION);
121
+ return raw.replace(/\{\{VERSION\}\}/g, RULE_BLOCK_VERSION);
120
122
  }
121
123
  catch (e) {
122
124
  errors.push(`error reading ${p}: ${e.message}`);
123
125
  }
124
126
  }
125
- throw new Error(`rules-block.md not found or invalid. Checked:\n- ${candidates.join("\n- ")}\nDetails:\n- ${errors.join("\n- ")}`);
127
+ throw new Error(`${filename} not found or invalid. Checked:\n- ${candidates.join("\n- ")}\nDetails:\n- ${errors.join("\n- ")}`);
128
+ }
129
+ function loadRulesBlockBody() {
130
+ return loadMarkdownAsset("rules-block.md", "<!-- BEGIN kontexta:rules");
131
+ }
132
+ function loadRulesReferenceBody() {
133
+ return loadMarkdownAsset("rules-reference.md", null);
126
134
  }
127
135
  // Try eagerly so existing `import { RULES_BLOCK_BODY }` consumers still see
128
136
  // the content, but DON'T throw if the asset is missing — previously a missing
129
137
  // rules-block.md broke every `import "kxta-core"` (web, MCP, publish, etc.)
130
138
  // even for callers that never touch agent-rules. The deferred error surfaces
131
- // only when getRulesBlockBody() is actually called.
139
+ // only when getRulesBlockBody() / getRulesReferenceBody() is actually called.
132
140
  let _rulesBlockBody = null;
133
141
  let _rulesBlockError = null;
134
142
  try {
@@ -140,7 +148,6 @@ catch (e) {
140
148
  export function getRulesBlockBody() {
141
149
  if (_rulesBlockBody != null)
142
150
  return _rulesBlockBody;
143
- // Retry once in case the file appeared after module load (HMR / lazy copy).
144
151
  try {
145
152
  _rulesBlockBody = loadRulesBlockBody();
146
153
  _rulesBlockError = null;
@@ -152,6 +159,27 @@ export function getRulesBlockBody() {
152
159
  }
153
160
  }
154
161
  export const RULES_BLOCK_BODY = _rulesBlockBody ?? "";
162
+ let _rulesReferenceBody = null;
163
+ try {
164
+ _rulesReferenceBody = loadRulesReferenceBody();
165
+ }
166
+ catch {
167
+ // Non-fatal: reference file is only needed when syncAgentRules writes KONTEXTA.md
168
+ }
169
+ export function getRulesReferenceBody() {
170
+ if (_rulesReferenceBody != null)
171
+ return _rulesReferenceBody;
172
+ try {
173
+ _rulesReferenceBody = loadRulesReferenceBody();
174
+ return _rulesReferenceBody;
175
+ }
176
+ catch (e) {
177
+ throw e instanceof Error ? e : new Error(String(e));
178
+ }
179
+ }
180
+ export const RULES_REFERENCE_BODY = _rulesReferenceBody ?? "";
181
+ /** File name for the full rules reference at the project root. */
182
+ export const KONTEXTA_MD = "KONTEXTA.md";
155
183
  // Note: .aider.conf.yml is intentionally NOT in this list. It's a YAML file;
156
184
  // injectOrUpdate writes HTML-comment markers (<!-- BEGIN... -->) which would
157
185
  // syntax-corrupt YAML. Aider's rules go in .aider/kontexta.md (see SCAFFOLDS),
@@ -301,6 +329,35 @@ export function syncAgentRules(opts) {
301
329
  const { projectPath, project, files, targetAgent } = opts;
302
330
  const written = [];
303
331
  const skipped = [];
332
+ let reference;
333
+ // Always write/update KONTEXTA.md with the full rules reference.
334
+ try {
335
+ const refBody = getRulesReferenceBody();
336
+ const kontextaPath = resolveInside(projectPath, KONTEXTA_MD);
337
+ if (kontextaPath) {
338
+ // Strip the HTML comment header (authoring notes) — only the rendered content goes to the project.
339
+ const headerEnd = refBody.indexOf("-->");
340
+ const cleanBody = headerEnd !== -1 ? refBody.slice(headerEnd + 3).replace(/^\n+/, "") : refBody;
341
+ let needsWrite = true;
342
+ const alreadyExists = existsSync(kontextaPath);
343
+ try {
344
+ const existing = readFileSync(kontextaPath, "utf8");
345
+ if (existing === cleanBody)
346
+ needsWrite = false;
347
+ }
348
+ catch { /* file doesn't exist yet, write it */ }
349
+ if (needsWrite) {
350
+ atomicWrite(kontextaPath, cleanBody);
351
+ reference = { path: KONTEXTA_MD, action: alreadyExists ? "updated" : "created", version: RULE_BLOCK_VERSION };
352
+ }
353
+ else {
354
+ reference = { path: KONTEXTA_MD, action: "skipped", version: RULE_BLOCK_VERSION };
355
+ }
356
+ }
357
+ }
358
+ catch (e) {
359
+ // Non-fatal: if rules-reference.md is unavailable, agent stubs still work.
360
+ }
304
361
  if (files.length === 0) {
305
362
  if (!targetAgent) {
306
363
  throw new Error("syncAgentRules: targetAgent required when files is empty");
@@ -310,7 +367,7 @@ export function syncAgentRules(opts) {
310
367
  const absPath = resolveInside(projectPath, relPath);
311
368
  if (!absPath) {
312
369
  skipped.push({ path: relPath, reason: "escape" });
313
- return { written, skipped };
370
+ return { written, skipped, ...(reference ? { reference } : {}) };
314
371
  }
315
372
  const initial = scaffold.header(project) + getRulesBlockBody();
316
373
  atomicWrite(absPath, initial);
@@ -318,6 +375,7 @@ export function syncAgentRules(opts) {
318
375
  return {
319
376
  written,
320
377
  skipped,
378
+ ...(reference ? { reference } : {}),
321
379
  optional_hook_snippet: SESSION_START_HOOK_SNIPPET,
322
380
  optional_hook_install_path: "~/.claude/settings.json (Claude Code only)",
323
381
  optional_hook_snippets: {
@@ -388,6 +446,7 @@ export function syncAgentRules(opts) {
388
446
  return {
389
447
  written,
390
448
  skipped,
449
+ ...(reference ? { reference } : {}),
391
450
  optional_hook_snippet: SESSION_START_HOOK_SNIPPET,
392
451
  optional_hook_install_path: "~/.claude/settings.json (Claude Code only)",
393
452
  optional_hook_snippets: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent-rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7H,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,SAAS,sBAAsB;IAC7B,IAAI,CAAC;QACH,IAAI,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,OAAO,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YAC3C,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;gBAChD,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;oBAC7B,OAAO,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC;gBACpD,CAAC;YACH,CAAC;YACD,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,OAAO,CAAC;AACjB,C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AE,MAAM,CAAC,IAAI;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,194 +1,37 @@
1
1
  <!--
2
- Source of truth for the kontexta agent rules block.
2
+ Compact kontexta rules stub — injected into agent context files
3
+ (CLAUDE.md, GEMINI.md, AGENTS.md, .cursor/rules/kontexta.mdc, etc.).
3
4
 
4
- Authoring rules:
5
- 1. One clause per cell. <= 80 chars. Verbs, no fluff.
6
- 2. "When NOT" is the documented failure mode, not a hypothetical edge case.
7
- 3. "Use instead" is the BETTER sibling tool. Empty if no sibling.
8
- 4. Every row stands alone — no cross-references.
9
- 5. Every new server.tool() in apps/mcp/src/index.ts MUST add a row in the
10
- relevant bucket below AND bump rulesVersion in packages/core/package.json.
11
- Tests enforce this.
5
+ The full reference (tool routing matrix, KI workflow, content class) lives in
6
+ rules-reference.md and is written to KONTEXTA.md at the project root by
7
+ syncAgentRules(). This stub is kept small to minimize per-turn token cost.
12
8
 
13
9
  The placeholder {{VERSION}} is substituted at module init with RULE_BLOCK_VERSION.
14
10
  -->
15
11
  <!-- BEGIN kontexta:rules v{{VERSION}} -->
16
12
  ## Working with kontexta
17
13
 
18
- This project is registered with kontexta. Honor these rules to keep the index, history, and journal coherent — and to avoid burning tokens on workflows kontexta already solves. Tools live under the `kxta` MCP server.
19
-
20
- ### Core rules
21
-
22
- **Print the session welcome as your first message.** On the very first turn of any new session, call `admin.refresh_session_context` and print a brief greeting to the user based on what it returns — today's date, their name from the profile, upcoming events / conflicts if any, a nudge if the profile is empty or stale. 1–3 lines, not a report. Two reasons: (1) if the client lazy-loads MCP servers, this is what actually triggers `initialize`; (2) the user sees kontexta is connected and knows what context you have. Skip if the user's first message is already a work request — do the work.
23
-
24
- **Search before reading.** Use `files.search` (pass `include_bodies: true` for token-budgeted bodies) or `files.regex_search` to find context first. Skipping straight to `files.read` on a guessed path wastes tokens and often misses the right file.
25
-
26
- **All KB writes go through kontexta.** Use `files.create` / `files.update` (pass `section` for a surgical single-heading edit) / `journal.write`. **Never** edit a KB file with raw filesystem tools (Edit/Write/cat) — the watcher and FTS index will diverge until `projects.refresh_index` runs, and subsequent searches will return stale results.
27
-
28
- **Batch reads. Don't loop `files.read`.** Need ≥2 files? Call `files.read` with `ids: [...]` (one round-trip, up to 200 IDs) or `files.search` with `include_bodies: true` (token-budgeted blob). Looping single-ID `files.read` calls wastes round-trips and inflates response overhead.
29
-
30
- **Address `journal.suggested_action` before the next tool call.** Many tool responses include a `journal` envelope. If `journal.suggested_action` is set (e.g., `"journal.distill"`), call that tool before issuing your next tool. To dismiss for the rest of the session, pass `journal_acknowledge: true` on your next tool call.
31
-
32
- **Relay `hooks` prompts once per session.** If a tool response carries a `hooks.prompt` (or the session welcome mentions hooks), tell the user once that kontexta can capture their conversation and shell commands for the agents they enabled. Only call `admin.onboard_agent` with `hooks: true` after they agree.
33
-
34
- **Use `journal.write({kind: "note", text, tags})` for decisions and abandonments.** When you make a non-obvious call, try something that doesn't work, or capture a workaround, log it. Hands runs are auto-captured now.
35
-
36
- **Use `journal.write({kind: "intent", summary})` when the user pivots.** One short sentence so the distillation step knows the topic shifted.
37
-
38
- **Strict mode awareness.** If a project sets `journal.mode = "strict"` in its `kontexta.json`, the MCP server returns a `JOURNAL_BACKLOG` error on read tools (search/read_*/list_*) when undistilled events exist. The error includes `next_action: "journal.distill"`. Either run `journal.distill` first, OR pass `journal_bypass: true` on the read call to override (logged for audit).
39
-
40
- **Confirm Hands tokens within 60 seconds.** When a Hands tool returns an approval token, do NOT chain a long question or another tool call before `hands.confirm`. Tokens expire; the user will have to re-issue the whole flow.
41
-
42
- **Save specs to a canonical location.** When generating a spec, plan, or design doc, write it to the KB at `specs/<project-name>/<spec-name>.md` (use `files.create` with `destination: "knowledge"`, `folder: "specs/<project-name>"`). One folder per project keeps specs queryable.
43
-
44
- **Tag new KB files at creation time.** Pass `tags` on `files.create`, or call `tags.add` immediately after. Untagged files are recoverable but invisible to `files.find_related`.
45
-
46
- **`admin.overview({mode: "whats_new"})` early. `admin.commit_backup` late.** Run it at session start if you've been away — it returns files added/changed since a cutoff. End the session with `admin.commit_backup` if you mutated KB files and the project has a remote.
47
-
48
- **Use `.mmd` for diagrams, not fenced code in `.md`.** When creating an architecture / flow / sequence diagram, call `files.create` with `format: "mmd"` and put the raw mermaid source as the body (no ```` ```mermaid ```` fence). The web UI renders `.mmd` files as live diagrams with SVG/PNG export; mermaid embedded in markdown is just text. Default folder: `mermaid/` (or `<project>/mermaid/` for project-scoped diagrams).
49
-
50
-
51
- ### Knowledge Items (KI)
52
-
53
- KIs are curated, distilled KB files — the highest-signal context in the vault.
54
- They save tokens and prevent redundant research when used correctly.
55
-
56
- **Check KIs before independent research.** At the start of any task, run
57
- `files.search` (optionally `include_bodies: true`) over the KB for the task topic. If a matching KI
58
- exists, read it before writing code, designing architecture, or forming a plan.
59
- Skipping this step is the single most common source of duplicated work.
60
-
61
- **KIs are starting points, not ground truth.** KIs are snapshots. Always
62
- cross-reference a KI's API patterns, file paths, and config values against the
63
- *current* source on disk before acting on them. KIs can lag behind code.
64
-
65
- **Close the loop: update the KI after significant changes.** When you ship a
66
- meaningful change (new API, config schema change, architecture shift), update
67
- the relevant KI via `files.update` (whole file or, with `section`, one heading). If no KI exists
68
- yet, create one with `files.create` under `knowledge/` with appropriate tags.
69
- A KI that isn't maintained becomes noise — which is worse than no KI.
70
-
71
- **Use `admin.overview({mode: "whats_new"})` at session start after a gap.** If you haven't touched the
72
- project in a while, run it with `since: "7d"` to surface recently changed
73
- files — including KIs updated by other agents or the user.
74
-
75
- ### Content class
76
-
77
- `files.create` requires `kind` for KB writes (single file or `files` array, both):
78
- - **`dictionary`** = source of truth (mappings, glossaries, runbooks, PR templates, architecture docs)
79
- - **`note`** = snapshot (meeting notes, PR findings, sprint reviews, post-mortems, working thoughts)
80
-
81
- Test: *if this file disagreed with the code, who wins?* File wins → dictionary; file loses → note. Search ranks dictionary hits above everything else; filter with `kind` on any read tool for one class. `journal`/`project` are auto-assigned — don't pass them to `files.create`.
82
-
83
- ### Tool reference
84
-
85
- The matrix below is grouped by intent. For each tool: when to reach for it, the most common wrong context, and the better sibling tool when wrong.
86
-
87
- #### Find
88
-
89
- | Tool | When | Not when | Use instead |
90
- |---|---|---|---|
91
- | `files.search` | Natural-language keyword across KB (FTS); pass `include_bodies: true` for a token-budgeted bundle of hits + bodies | Substrings, URLs, code idents | `files.regex_search` |
92
- | `files.regex_search` | Substrings, URLs, code identifiers across files; pass `file_id` to scan just one known file | Natural-language queries | `files.search` |
93
- | `files.find_related` | Discover siblings via tag overlap | Text content matching | `files.search` |
94
- | `tags.suggest` | Propose tags for an existing file | Finding files by tag | `files.find_related` |
95
-
96
- #### Read
97
-
98
- | Tool | When | Not when | Use instead |
99
- |---|---|---|---|
100
- | `files.read` | One file (`id` or `path`), a batch (`ids`), or a partial read (`section` or `lines`) | Only metadata needed | `files.describe` |
101
- | `files.read_outline` | Triaging an unfamiliar file's structure | Structure already known | `files.describe` |
102
- | `files.describe` | Metadata only (size, tags, mtime) | Need content | `files.read` |
103
- | `admin.get_profile` | Read user profile/context at session start | Reading normal files | `files.read` |
104
-
105
- #### Write
106
-
107
- | Tool | When | Not when | Use instead |
108
- |---|---|---|---|
109
- | `files.create` | One new file, or a `files` array for bulk-creating ≥2 (md, mmd, or html via `format`) | File already exists | `files.update` |
110
- | `files.update` | Replacing the whole body, or a surgical edit at a known heading via `section` | File doesn't exist yet | `files.create` |
111
- | `files.delete` | One file, or an `ids` array for bulk delete | Want to keep the file but hide it | `tags.remove` / `tags.set_favorite` |
112
- | `files.move` | Rename or relocate a file | File content needs changing | `files.update` |
113
-
114
- #### Organize
115
-
116
- | Tool | When | Not when | Use instead |
117
- |---|---|---|---|
118
- | `tags.add` | Tag an existing file | Tagging at creation time | `files.create` (with `tags` param) |
119
- | `tags.remove` | Untag a file | Want to delete the file | `files.delete` |
120
- | `tags.list` | Enumerate all tags in the vault | Want files for a given tag | `files.find_related` |
121
- | `tags.set_favorite` | Pin / unpin a file | Semantic categorization | `tags.add` |
122
- | `tags.search` | Bulk-tag every hit from a search | Tagging a single file | `tags.add` |
123
- | `journal.write` | Log an event: `kind: "note"` (decision/workaround), `kind: "intent"` (topic pivot), or `kind: "append"` (timestamped daily journal entry) | Summarizing accumulated events | `journal.distill` |
124
- | `journal.distill` | Summarize accumulated journal events | Individual events | `journal.write` |
125
- | `journal.status` | Check backlog size and high-water mark before distilling | Need the raw events themselves | `journal.distill` |
126
- | `journal.commit_upgrades` | Mark journal entries upgraded after a subagent rewrites them | Running the initial distillation | `journal.distill` |
127
- | `journal.housekeep` | Prune old raw journal files and archive cold tasks | Need to distill new events first | `journal.distill` |
128
- | `resources.clip_url` | Capture a web URL into the KB | Saving a local file | `files.create` |
129
- | `folders.list` | Enumerate folders in the project | Finding files | `files.list` |
130
- | `folders.create` | Create a new (possibly nested) folder | Files don't need explicit folders | |
131
- | `folders.delete` | Remove an empty folder | Folder still has files | `files.delete` (bulk) first |
132
-
133
- #### Reports
134
-
135
- | Tool | When | Not when | Use instead |
136
- |---|---|---|---|
137
- | `resources.add_report` | Add an image to the shared `reports/resources/` pool | Embedding data URIs | |
138
- | `resources.list_reports` | List all shared report resources | Need full file list | `files.list` |
139
- | `resources.delete_report` | Delete a shared resource by name | Deleting a report file | `files.delete` |
140
- | `resources.export_report` | Export an HTML report as PDF or PNG | Exporting markdown | |
141
-
142
- #### History & recovery
143
-
144
- | Tool | When | Not when | Use instead |
145
- |---|---|---|---|
146
- | `files.get_history` | List a file's revisions | Want a diff between two revisions | `files.get_diff` |
147
- | `files.get_diff` | Compare two specific revisions | Want full content of one | `files.restore` |
148
- | `files.restore` | Roll back a KB file to an earlier revision | Want to use raw `git` | |
149
- | `files.diff_against_disk` | Find drift after raw filesystem edits | Normal search staleness | `projects.refresh_index` |
150
- | `projects.refresh_index` | Rescan after out-of-band changes | Normal in-app edits | |
151
- | `admin.commit_backup` | Push KB changes to remote git | Local-only work | |
152
-
153
- #### Discover
154
-
155
- | Tool | When | Not when | Use instead |
156
- |---|---|---|---|
157
- | `projects.list` | Enumerate registered projects | Files within one project | `files.list` |
158
- | `files.list` | Files in a project (filterable) | Full-text content matters | `files.search` |
159
- | `projects.map` | Folder/file tree for a project | Flat file list | `files.list` |
160
- | `admin.overview` | `mode: "stats"` for counts/health, `mode: "whats_new"` for files changed since a cutoff | Per-file detail or full-text search | `files.describe` / `files.search` |
161
- | `admin.refresh_session_context` | Re-fetch profile + upcoming events after mid-session edits | Reading a single profile field | `admin.get_profile` |
162
-
163
- #### Calendar
164
-
165
- | Tool | When | Not when | Use instead |
166
- |---|---|---|---|
167
- | `calendar.entities.add` | Register a new thing to track (server, vehicle, location, etc.) | Entity already exists | `calendar.entities.update` |
168
- | `calendar.entities.update` | Rename, retag, or retire (`active:false`) an entity | Entity doesn't exist yet | `calendar.entities.add` |
169
- | `calendar.entities.delete` | Permanently remove an entity, cascading its events/links | Just want to stop scheduling against it | `calendar.entities.update` |
170
- | `calendar.entities.list` | Enumerate entities with their dependency links | Need conflict or event data | `calendar.events.conflicts` |
171
- | `calendar.entities.link` | Record or remove a dependency edge for conflict detection | Want to see existing links | `calendar.entities.list` |
172
- | `calendar.events.add` | Schedule a one-off event (downtime, maintenance, delivery, etc.) | Editing an existing event | `calendar.events.update` |
173
- | `calendar.events.update` | Move, retitle, or re-home an existing event | Event doesn't exist yet | `calendar.events.add` |
174
- | `calendar.events.delete` | Remove one event permanently | Want to just move it | `calendar.events.update` |
175
- | `calendar.events.list` | List/filter events in a time window | Only need the conflict report | `calendar.events.conflicts` |
176
- | `calendar.events.conflicts` | Find overlapping or too-close-together events in a window | Just need the raw event list | `calendar.events.list` |
177
- | `calendar.export_ics` | Export a window as an ICS file for calendar apps | Need machine-readable event data | `calendar.events.list` |
178
-
179
- #### Hands (project tools)
180
-
181
- | Tool | When | Not when | Use instead |
182
- |---|---|---|---|
183
- | `hands.list` | Enumerate Hands tools; pass `schema: true` for the `kontexta.json` authoring reference | Neither list nor schema needed | |
184
- | `hands.confirm` | Approve a Hands token within 60s of issue | Normal MCP tool calls | |
185
- | `hands.reload` | Re-read `hands.yaml` after editing it | First-time use (auto-loads) | |
186
-
187
- #### Onboarding
188
-
189
- | Tool | When | Not when | Use instead |
190
- |---|---|---|---|
191
- | `projects.register` | Register a new project root with kontexta | Already registered | `projects.list` |
192
- | `admin.onboard_agent` | Write/update the rules block in CLAUDE.md / AGENTS.md / etc. | Editing regular project content | `files.update` |
193
- | `admin.transfer_agent_context` | Copy CLAUDE.md / AGENTS.md / `.cursor/rules/*.mdc` etc. from the project repo into Kontexta's KB. Originals are NEVER deleted by this tool. | User wants files to stay in the repo (default) | `projects.register` (which keeps files in place) |
14
+ This project uses kontexta for context, knowledge, and journal management. Tools live under the `kxta` MCP server.
15
+
16
+ **Core constraints:**
17
+ - **Session start:** Call `admin_refresh_session_context` on turn 1; print a 1–3 line greeting (date, profile, conflicts). Skip if the user's first message is a task.
18
+ - **User profile:** Call `admin_get_profile` to read user context, role, preferences, and goals.
19
+ - **All KB writes go through kontexta.** Use `files_create` / `files_update` / `journal_write`. Never edit KB files with raw filesystem tools. Never write context artifacts (diagrams, specs, notes, `.mmd` files) directly into the project repo — use `files_create` with `destination: "knowledge"`.
20
+ - **Search before reading.** Use `files_search` (no bodies first; `include_bodies` only for several files at once, with a small `max_tokens`) or `files_regex_search`, then `files_read` the top hit, not a guessed path.
21
+ - **Act on `journal.suggested_action`** before your next tool call, or pass `journal_acknowledge: true` to dismiss.
22
+ - **Tag new KB files** at creation time via `tags` on `files_create` or `tags_add`.
23
+ - **Use `.mmd` for diagrams** via `files_create` with `format: "mmd"`, `destination: "knowledge"`. Never fenced mermaid in `.md`, never `.mmd` files in the project repo.
24
+ - **Confirm Hands tokens within 60 seconds.** Tokens expire.
25
+ - **Log decisions** with `journal_write({kind: "note"})` and **topic pivots** with `journal_write({kind: "intent"})`.
26
+ - **Relay `hooks` prompts** once per session when present in tool responses.
27
+
28
+ **Strict folder structure in Knowledge Base:**
29
+ All context artifacts must strictly follow this folder hierarchy inside the Knowledge Base (`destination: "knowledge"`):
30
+ - **HTML reports:** `html/` (use `files_create` with `format: "html"`, `destination: "knowledge"`)
31
+ - **Mermaid diagrams (`.mmd`):** `mermaid/` (use `files_create` with `format: "mmd"`, `destination: "knowledge"`)
32
+ - **Journals:** `journal/` (managed via `journal_write` / `journal_distill`)
33
+ - **Knowledge Base files:** `knowledge/dictionary/` (`kind: "dictionary"` for sources of truth) or `knowledge/notes/` (`kind: "note"` for working notes & snapshots)
34
+ Never write context or diagram files directly into the project repository.
35
+
36
+ **Full rules, tool routing matrix, and workflow guidance:** See [KONTEXTA.md](./KONTEXTA.md).
194
37
  <!-- END kontexta:rules v{{VERSION}} -->