@debian777/kairos-mcp 3.0.1-beta.14

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 (502) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +108 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/cli/api-client.d.ts +31 -0
  5. package/dist/cli/api-client.d.ts.map +1 -0
  6. package/dist/cli/api-client.js +110 -0
  7. package/dist/cli/api-client.js.map +1 -0
  8. package/dist/cli/commands/attest.d.ts +6 -0
  9. package/dist/cli/commands/attest.d.ts.map +1 -0
  10. package/dist/cli/commands/attest.js +52 -0
  11. package/dist/cli/commands/attest.js.map +1 -0
  12. package/dist/cli/commands/begin.d.ts +6 -0
  13. package/dist/cli/commands/begin.d.ts.map +1 -0
  14. package/dist/cli/commands/begin.js +32 -0
  15. package/dist/cli/commands/begin.js.map +1 -0
  16. package/dist/cli/commands/delete.d.ts +6 -0
  17. package/dist/cli/commands/delete.d.ts.map +1 -0
  18. package/dist/cli/commands/delete.js +32 -0
  19. package/dist/cli/commands/delete.js.map +1 -0
  20. package/dist/cli/commands/mint.d.ts +6 -0
  21. package/dist/cli/commands/mint.d.ts.map +1 -0
  22. package/dist/cli/commands/mint.js +48 -0
  23. package/dist/cli/commands/mint.js.map +1 -0
  24. package/dist/cli/commands/next.d.ts +6 -0
  25. package/dist/cli/commands/next.d.ts.map +1 -0
  26. package/dist/cli/commands/next.js +89 -0
  27. package/dist/cli/commands/next.js.map +1 -0
  28. package/dist/cli/commands/search.d.ts +6 -0
  29. package/dist/cli/commands/search.d.ts.map +1 -0
  30. package/dist/cli/commands/search.js +32 -0
  31. package/dist/cli/commands/search.js.map +1 -0
  32. package/dist/cli/commands/update.d.ts +6 -0
  33. package/dist/cli/commands/update.d.ts.map +1 -0
  34. package/dist/cli/commands/update.js +72 -0
  35. package/dist/cli/commands/update.js.map +1 -0
  36. package/dist/cli/config.d.ts +9 -0
  37. package/dist/cli/config.d.ts.map +1 -0
  38. package/dist/cli/config.js +14 -0
  39. package/dist/cli/config.js.map +1 -0
  40. package/dist/cli/index.d.ts +6 -0
  41. package/dist/cli/index.d.ts.map +1 -0
  42. package/dist/cli/index.js +40 -0
  43. package/dist/cli/index.js.map +1 -0
  44. package/dist/cli/output.d.ts +10 -0
  45. package/dist/cli/output.d.ts.map +1 -0
  46. package/dist/cli/output.js +20 -0
  47. package/dist/cli/output.js.map +1 -0
  48. package/dist/config.d.ts +58 -0
  49. package/dist/config.d.ts.map +1 -0
  50. package/dist/config.js +165 -0
  51. package/dist/config.js.map +1 -0
  52. package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002001.md +324 -0
  53. package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002002.md +48 -0
  54. package/dist/http/bearer-validate.d.ts +14 -0
  55. package/dist/http/bearer-validate.d.ts.map +1 -0
  56. package/dist/http/bearer-validate.js +111 -0
  57. package/dist/http/bearer-validate.js.map +1 -0
  58. package/dist/http/http-api-attest.d.ts +7 -0
  59. package/dist/http/http-api-attest.d.ts.map +1 -0
  60. package/dist/http/http-api-attest.js +103 -0
  61. package/dist/http/http-api-attest.js.map +1 -0
  62. package/dist/http/http-api-begin-step.d.ts +8 -0
  63. package/dist/http/http-api-begin-step.d.ts.map +1 -0
  64. package/dist/http/http-api-begin-step.js +108 -0
  65. package/dist/http/http-api-begin-step.js.map +1 -0
  66. package/dist/http/http-api-begin.d.ts +8 -0
  67. package/dist/http/http-api-begin.d.ts.map +1 -0
  68. package/dist/http/http-api-begin.js +167 -0
  69. package/dist/http/http-api-begin.js.map +1 -0
  70. package/dist/http/http-api-delete.d.ts +9 -0
  71. package/dist/http/http-api-delete.d.ts.map +1 -0
  72. package/dist/http/http-api-delete.js +67 -0
  73. package/dist/http/http-api-delete.js.map +1 -0
  74. package/dist/http/http-api-dump.d.ts +8 -0
  75. package/dist/http/http-api-dump.d.ts.map +1 -0
  76. package/dist/http/http-api-dump.js +34 -0
  77. package/dist/http/http-api-dump.js.map +1 -0
  78. package/dist/http/http-api-mint.d.ts +9 -0
  79. package/dist/http/http-api-mint.d.ts.map +1 -0
  80. package/dist/http/http-api-mint.js +100 -0
  81. package/dist/http/http-api-mint.js.map +1 -0
  82. package/dist/http/http-api-next.d.ts +9 -0
  83. package/dist/http/http-api-next.d.ts.map +1 -0
  84. package/dist/http/http-api-next.js +237 -0
  85. package/dist/http/http-api-next.js.map +1 -0
  86. package/dist/http/http-api-routes.d.ts +13 -0
  87. package/dist/http/http-api-routes.d.ts.map +1 -0
  88. package/dist/http/http-api-routes.js +28 -0
  89. package/dist/http/http-api-routes.js.map +1 -0
  90. package/dist/http/http-api-snapshot.d.ts +4 -0
  91. package/dist/http/http-api-snapshot.d.ts.map +1 -0
  92. package/dist/http/http-api-snapshot.js +36 -0
  93. package/dist/http/http-api-snapshot.js.map +1 -0
  94. package/dist/http/http-api-update.d.ts +9 -0
  95. package/dist/http/http-api-update.d.ts.map +1 -0
  96. package/dist/http/http-api-update.js +105 -0
  97. package/dist/http/http-api-update.js.map +1 -0
  98. package/dist/http/http-auth-callback.d.ts +6 -0
  99. package/dist/http/http-auth-callback.d.ts.map +1 -0
  100. package/dist/http/http-auth-callback.js +183 -0
  101. package/dist/http/http-auth-callback.js.map +1 -0
  102. package/dist/http/http-auth-middleware.d.ts +30 -0
  103. package/dist/http/http-auth-middleware.d.ts.map +1 -0
  104. package/dist/http/http-auth-middleware.js +224 -0
  105. package/dist/http/http-auth-middleware.js.map +1 -0
  106. package/dist/http/http-error-handlers.d.ts +7 -0
  107. package/dist/http/http-error-handlers.d.ts.map +1 -0
  108. package/dist/http/http-error-handlers.js +35 -0
  109. package/dist/http/http-error-handlers.js.map +1 -0
  110. package/dist/http/http-health-routes.d.ts +9 -0
  111. package/dist/http/http-health-routes.d.ts.map +1 -0
  112. package/dist/http/http-health-routes.js +117 -0
  113. package/dist/http/http-health-routes.js.map +1 -0
  114. package/dist/http/http-mcp-handler.d.ts +8 -0
  115. package/dist/http/http-mcp-handler.d.ts.map +1 -0
  116. package/dist/http/http-mcp-handler.js +136 -0
  117. package/dist/http/http-mcp-handler.js.map +1 -0
  118. package/dist/http/http-metrics-middleware.d.ts +7 -0
  119. package/dist/http/http-metrics-middleware.d.ts.map +1 -0
  120. package/dist/http/http-metrics-middleware.js +56 -0
  121. package/dist/http/http-metrics-middleware.js.map +1 -0
  122. package/dist/http/http-server-config.d.ts +11 -0
  123. package/dist/http/http-server-config.d.ts.map +1 -0
  124. package/dist/http/http-server-config.js +15 -0
  125. package/dist/http/http-server-config.js.map +1 -0
  126. package/dist/http/http-server-startup.d.ts +9 -0
  127. package/dist/http/http-server-startup.d.ts.map +1 -0
  128. package/dist/http/http-server-startup.js +26 -0
  129. package/dist/http/http-server-startup.js.map +1 -0
  130. package/dist/http/http-server.d.ts +4 -0
  131. package/dist/http/http-server.d.ts.map +1 -0
  132. package/dist/http/http-server.js +39 -0
  133. package/dist/http/http-server.js.map +1 -0
  134. package/dist/http/http-well-known.d.ts +13 -0
  135. package/dist/http/http-well-known.d.ts.map +1 -0
  136. package/dist/http/http-well-known.js +32 -0
  137. package/dist/http/http-well-known.js.map +1 -0
  138. package/dist/index.d.ts +7 -0
  139. package/dist/index.d.ts.map +1 -0
  140. package/dist/index.js +100 -0
  141. package/dist/index.js.map +1 -0
  142. package/dist/metrics-server.d.ts +14 -0
  143. package/dist/metrics-server.d.ts.map +1 -0
  144. package/dist/metrics-server.js +41 -0
  145. package/dist/metrics-server.js.map +1 -0
  146. package/dist/resources/docs-resources.d.ts +2 -0
  147. package/dist/resources/docs-resources.d.ts.map +1 -0
  148. package/dist/resources/docs-resources.js +47 -0
  149. package/dist/resources/docs-resources.js.map +1 -0
  150. package/dist/resources/embedded-mcp-resources.d.ts +73 -0
  151. package/dist/resources/embedded-mcp-resources.d.ts.map +1 -0
  152. package/dist/resources/embedded-mcp-resources.js +132 -0
  153. package/dist/resources/embedded-mcp-resources.js.map +1 -0
  154. package/dist/resources/mem-resources-boot.d.ts +10 -0
  155. package/dist/resources/mem-resources-boot.d.ts.map +1 -0
  156. package/dist/resources/mem-resources-boot.js +164 -0
  157. package/dist/resources/mem-resources-boot.js.map +1 -0
  158. package/dist/resources/prompt-resources.d.ts +5 -0
  159. package/dist/resources/prompt-resources.d.ts.map +1 -0
  160. package/dist/resources/prompt-resources.js +42 -0
  161. package/dist/resources/prompt-resources.js.map +1 -0
  162. package/dist/resources/resource-bootstrap.d.ts +7 -0
  163. package/dist/resources/resource-bootstrap.d.ts.map +1 -0
  164. package/dist/resources/resource-bootstrap.js +33 -0
  165. package/dist/resources/resource-bootstrap.js.map +1 -0
  166. package/dist/server.d.ts +4 -0
  167. package/dist/server.d.ts.map +1 -0
  168. package/dist/server.js +79 -0
  169. package/dist/server.js.map +1 -0
  170. package/dist/services/chain-utils.d.ts +22 -0
  171. package/dist/services/chain-utils.d.ts.map +1 -0
  172. package/dist/services/chain-utils.js +95 -0
  173. package/dist/services/chain-utils.js.map +1 -0
  174. package/dist/services/code-block-processor.d.ts +40 -0
  175. package/dist/services/code-block-processor.d.ts.map +1 -0
  176. package/dist/services/code-block-processor.js +169 -0
  177. package/dist/services/code-block-processor.js.map +1 -0
  178. package/dist/services/embedding/config.d.ts +5 -0
  179. package/dist/services/embedding/config.d.ts.map +1 -0
  180. package/dist/services/embedding/config.js +13 -0
  181. package/dist/services/embedding/config.js.map +1 -0
  182. package/dist/services/embedding/providers.d.ts +5 -0
  183. package/dist/services/embedding/providers.d.ts.map +1 -0
  184. package/dist/services/embedding/providers.js +141 -0
  185. package/dist/services/embedding/providers.js.map +1 -0
  186. package/dist/services/embedding/service.d.ts +39 -0
  187. package/dist/services/embedding/service.d.ts.map +1 -0
  188. package/dist/services/embedding/service.js +302 -0
  189. package/dist/services/embedding/service.js.map +1 -0
  190. package/dist/services/embedding/types.d.ts +17 -0
  191. package/dist/services/embedding/types.d.ts.map +1 -0
  192. package/dist/services/embedding/types.js +2 -0
  193. package/dist/services/embedding/types.js.map +1 -0
  194. package/dist/services/id-generator.d.ts +63 -0
  195. package/dist/services/id-generator.d.ts.map +1 -0
  196. package/dist/services/id-generator.js +101 -0
  197. package/dist/services/id-generator.js.map +1 -0
  198. package/dist/services/key-value-store-factory.d.ts +7 -0
  199. package/dist/services/key-value-store-factory.d.ts.map +1 -0
  200. package/dist/services/key-value-store-factory.js +15 -0
  201. package/dist/services/key-value-store-factory.js.map +1 -0
  202. package/dist/services/key-value-store.d.ts +24 -0
  203. package/dist/services/key-value-store.d.ts.map +1 -0
  204. package/dist/services/key-value-store.js +6 -0
  205. package/dist/services/key-value-store.js.map +1 -0
  206. package/dist/services/memory/chain-builder-proof.d.ts +18 -0
  207. package/dist/services/memory/chain-builder-proof.d.ts.map +1 -0
  208. package/dist/services/memory/chain-builder-proof.js +78 -0
  209. package/dist/services/memory/chain-builder-proof.js.map +1 -0
  210. package/dist/services/memory/chain-builder.d.ts +4 -0
  211. package/dist/services/memory/chain-builder.d.ts.map +1 -0
  212. package/dist/services/memory/chain-builder.js +185 -0
  213. package/dist/services/memory/chain-builder.js.map +1 -0
  214. package/dist/services/memory/store-chain-default-handler.d.ts +9 -0
  215. package/dist/services/memory/store-chain-default-handler.d.ts.map +1 -0
  216. package/dist/services/memory/store-chain-default-handler.js +118 -0
  217. package/dist/services/memory/store-chain-default-handler.js.map +1 -0
  218. package/dist/services/memory/store-chain-header-handler.d.ts +8 -0
  219. package/dist/services/memory/store-chain-header-handler.d.ts.map +1 -0
  220. package/dist/services/memory/store-chain-header-handler.js +98 -0
  221. package/dist/services/memory/store-chain-header-handler.js.map +1 -0
  222. package/dist/services/memory/store-chain-helpers.d.ts +27 -0
  223. package/dist/services/memory/store-chain-helpers.d.ts.map +1 -0
  224. package/dist/services/memory/store-chain-helpers.js +102 -0
  225. package/dist/services/memory/store-chain-helpers.js.map +1 -0
  226. package/dist/services/memory/store-chain.d.ts +15 -0
  227. package/dist/services/memory/store-chain.d.ts.map +1 -0
  228. package/dist/services/memory/store-chain.js +56 -0
  229. package/dist/services/memory/store-chain.js.map +1 -0
  230. package/dist/services/memory/store-init.d.ts +3 -0
  231. package/dist/services/memory/store-init.d.ts.map +1 -0
  232. package/dist/services/memory/store-init.js +127 -0
  233. package/dist/services/memory/store-init.js.map +1 -0
  234. package/dist/services/memory/store-methods.d.ts +35 -0
  235. package/dist/services/memory/store-methods.d.ts.map +1 -0
  236. package/dist/services/memory/store-methods.js +308 -0
  237. package/dist/services/memory/store-methods.js.map +1 -0
  238. package/dist/services/memory/store.d.ts +36 -0
  239. package/dist/services/memory/store.d.ts.map +1 -0
  240. package/dist/services/memory/store.js +119 -0
  241. package/dist/services/memory/store.js.map +1 -0
  242. package/dist/services/memory-store.d.ts +33 -0
  243. package/dist/services/memory-store.d.ts.map +1 -0
  244. package/dist/services/memory-store.js +158 -0
  245. package/dist/services/memory-store.js.map +1 -0
  246. package/dist/services/metrics/agent-metrics.d.ts +12 -0
  247. package/dist/services/metrics/agent-metrics.d.ts.map +1 -0
  248. package/dist/services/metrics/agent-metrics.js +34 -0
  249. package/dist/services/metrics/agent-metrics.js.map +1 -0
  250. package/dist/services/metrics/embedding-metrics.d.ts +12 -0
  251. package/dist/services/metrics/embedding-metrics.d.ts.map +1 -0
  252. package/dist/services/metrics/embedding-metrics.js +41 -0
  253. package/dist/services/metrics/embedding-metrics.js.map +1 -0
  254. package/dist/services/metrics/http-metrics.d.ts +12 -0
  255. package/dist/services/metrics/http-metrics.d.ts.map +1 -0
  256. package/dist/services/metrics/http-metrics.js +41 -0
  257. package/dist/services/metrics/http-metrics.js.map +1 -0
  258. package/dist/services/metrics/mcp-metrics.d.ts +16 -0
  259. package/dist/services/metrics/mcp-metrics.d.ts.map +1 -0
  260. package/dist/services/metrics/mcp-metrics.js +55 -0
  261. package/dist/services/metrics/mcp-metrics.js.map +1 -0
  262. package/dist/services/metrics/memory-metrics.d.ts +10 -0
  263. package/dist/services/metrics/memory-metrics.d.ts.map +1 -0
  264. package/dist/services/metrics/memory-metrics.js +28 -0
  265. package/dist/services/metrics/memory-metrics.js.map +1 -0
  266. package/dist/services/metrics/qdrant-metrics.d.ts +11 -0
  267. package/dist/services/metrics/qdrant-metrics.d.ts.map +1 -0
  268. package/dist/services/metrics/qdrant-metrics.js +35 -0
  269. package/dist/services/metrics/qdrant-metrics.js.map +1 -0
  270. package/dist/services/metrics/registry.d.ts +9 -0
  271. package/dist/services/metrics/registry.d.ts.map +1 -0
  272. package/dist/services/metrics/registry.js +19 -0
  273. package/dist/services/metrics/registry.js.map +1 -0
  274. package/dist/services/metrics/system-metrics.d.ts +10 -0
  275. package/dist/services/metrics/system-metrics.d.ts.map +1 -0
  276. package/dist/services/metrics/system-metrics.js +35 -0
  277. package/dist/services/metrics/system-metrics.js.map +1 -0
  278. package/dist/services/proof-of-work-store.d.ts +66 -0
  279. package/dist/services/proof-of-work-store.d.ts.map +1 -0
  280. package/dist/services/proof-of-work-store.js +141 -0
  281. package/dist/services/proof-of-work-store.js.map +1 -0
  282. package/dist/services/qdrant/connection.d.ts +24 -0
  283. package/dist/services/qdrant/connection.d.ts.map +1 -0
  284. package/dist/services/qdrant/connection.js +126 -0
  285. package/dist/services/qdrant/connection.js.map +1 -0
  286. package/dist/services/qdrant/index.d.ts +3 -0
  287. package/dist/services/qdrant/index.d.ts.map +1 -0
  288. package/dist/services/qdrant/index.js +4 -0
  289. package/dist/services/qdrant/index.js.map +1 -0
  290. package/dist/services/qdrant/initialization.d.ts +25 -0
  291. package/dist/services/qdrant/initialization.d.ts.map +1 -0
  292. package/dist/services/qdrant/initialization.js +170 -0
  293. package/dist/services/qdrant/initialization.js.map +1 -0
  294. package/dist/services/qdrant/listing.d.ts +26 -0
  295. package/dist/services/qdrant/listing.d.ts.map +1 -0
  296. package/dist/services/qdrant/listing.js +88 -0
  297. package/dist/services/qdrant/listing.js.map +1 -0
  298. package/dist/services/qdrant/memory-retrieval.d.ts +14 -0
  299. package/dist/services/qdrant/memory-retrieval.d.ts.map +1 -0
  300. package/dist/services/qdrant/memory-retrieval.js +110 -0
  301. package/dist/services/qdrant/memory-retrieval.js.map +1 -0
  302. package/dist/services/qdrant/memory-store.d.ts +16 -0
  303. package/dist/services/qdrant/memory-store.d.ts.map +1 -0
  304. package/dist/services/qdrant/memory-store.js +108 -0
  305. package/dist/services/qdrant/memory-store.js.map +1 -0
  306. package/dist/services/qdrant/memory-updates.d.ts +8 -0
  307. package/dist/services/qdrant/memory-updates.d.ts.map +1 -0
  308. package/dist/services/qdrant/memory-updates.js +206 -0
  309. package/dist/services/qdrant/memory-updates.js.map +1 -0
  310. package/dist/services/qdrant/protocol.d.ts +16 -0
  311. package/dist/services/qdrant/protocol.d.ts.map +1 -0
  312. package/dist/services/qdrant/protocol.js +48 -0
  313. package/dist/services/qdrant/protocol.js.map +1 -0
  314. package/dist/services/qdrant/quality.d.ts +14 -0
  315. package/dist/services/qdrant/quality.d.ts.map +1 -0
  316. package/dist/services/qdrant/quality.js +101 -0
  317. package/dist/services/qdrant/quality.js.map +1 -0
  318. package/dist/services/qdrant/resources.d.ts +7 -0
  319. package/dist/services/qdrant/resources.d.ts.map +1 -0
  320. package/dist/services/qdrant/resources.js +108 -0
  321. package/dist/services/qdrant/resources.js.map +1 -0
  322. package/dist/services/qdrant/search.d.ts +22 -0
  323. package/dist/services/qdrant/search.d.ts.map +1 -0
  324. package/dist/services/qdrant/search.js +75 -0
  325. package/dist/services/qdrant/search.js.map +1 -0
  326. package/dist/services/qdrant/service.d.ts +90 -0
  327. package/dist/services/qdrant/service.d.ts.map +1 -0
  328. package/dist/services/qdrant/service.js +95 -0
  329. package/dist/services/qdrant/service.js.map +1 -0
  330. package/dist/services/qdrant/snapshots.d.ts +19 -0
  331. package/dist/services/qdrant/snapshots.d.ts.map +1 -0
  332. package/dist/services/qdrant/snapshots.js +130 -0
  333. package/dist/services/qdrant/snapshots.js.map +1 -0
  334. package/dist/services/qdrant/types.d.ts +39 -0
  335. package/dist/services/qdrant/types.d.ts.map +1 -0
  336. package/dist/services/qdrant/types.js +2 -0
  337. package/dist/services/qdrant/types.js.map +1 -0
  338. package/dist/services/qdrant/utils.d.ts +20 -0
  339. package/dist/services/qdrant/utils.d.ts.map +1 -0
  340. package/dist/services/qdrant/utils.js +121 -0
  341. package/dist/services/qdrant/utils.js.map +1 -0
  342. package/dist/services/redis-cache.d.ts +43 -0
  343. package/dist/services/redis-cache.d.ts.map +1 -0
  344. package/dist/services/redis-cache.js +214 -0
  345. package/dist/services/redis-cache.js.map +1 -0
  346. package/dist/services/redis.d.ts +43 -0
  347. package/dist/services/redis.d.ts.map +1 -0
  348. package/dist/services/redis.js +234 -0
  349. package/dist/services/redis.js.map +1 -0
  350. package/dist/services/stats/bonuses.d.ts +28 -0
  351. package/dist/services/stats/bonuses.d.ts.map +1 -0
  352. package/dist/services/stats/bonuses.js +96 -0
  353. package/dist/services/stats/bonuses.js.map +1 -0
  354. package/dist/services/stats/healer.d.ts +6 -0
  355. package/dist/services/stats/healer.d.ts.map +1 -0
  356. package/dist/services/stats/healer.js +24 -0
  357. package/dist/services/stats/healer.js.map +1 -0
  358. package/dist/services/stats/model-stats.d.ts +53 -0
  359. package/dist/services/stats/model-stats.d.ts.map +1 -0
  360. package/dist/services/stats/model-stats.js +238 -0
  361. package/dist/services/stats/model-stats.js.map +1 -0
  362. package/dist/services/stats/protocol.d.ts +11 -0
  363. package/dist/services/stats/protocol.d.ts.map +1 -0
  364. package/dist/services/stats/protocol.js +55 -0
  365. package/dist/services/stats/protocol.js.map +1 -0
  366. package/dist/services/stats/scoring.d.ts +19 -0
  367. package/dist/services/stats/scoring.d.ts.map +1 -0
  368. package/dist/services/stats/scoring.js +102 -0
  369. package/dist/services/stats/scoring.js.map +1 -0
  370. package/dist/services/stats/types.d.ts +39 -0
  371. package/dist/services/stats/types.d.ts.map +1 -0
  372. package/dist/services/stats/types.js +8 -0
  373. package/dist/services/stats/types.js.map +1 -0
  374. package/dist/tools/kairos_attest.d.ts +7 -0
  375. package/dist/tools/kairos_attest.d.ts.map +1 -0
  376. package/dist/tools/kairos_attest.js +179 -0
  377. package/dist/tools/kairos_attest.js.map +1 -0
  378. package/dist/tools/kairos_begin.d.ts +9 -0
  379. package/dist/tools/kairos_begin.d.ts.map +1 -0
  380. package/dist/tools/kairos_begin.js +149 -0
  381. package/dist/tools/kairos_begin.js.map +1 -0
  382. package/dist/tools/kairos_begin_schema.d.ts +48 -0
  383. package/dist/tools/kairos_begin_schema.d.ts.map +1 -0
  384. package/dist/tools/kairos_begin_schema.js +48 -0
  385. package/dist/tools/kairos_begin_schema.js.map +1 -0
  386. package/dist/tools/kairos_delete.d.ts +2 -0
  387. package/dist/tools/kairos_delete.d.ts.map +1 -0
  388. package/dist/tools/kairos_delete.js +113 -0
  389. package/dist/tools/kairos_delete.js.map +1 -0
  390. package/dist/tools/kairos_dump.d.ts +14 -0
  391. package/dist/tools/kairos_dump.d.ts.map +1 -0
  392. package/dist/tools/kairos_dump.js +148 -0
  393. package/dist/tools/kairos_dump.js.map +1 -0
  394. package/dist/tools/kairos_mint.d.ts +7 -0
  395. package/dist/tools/kairos_mint.d.ts.map +1 -0
  396. package/dist/tools/kairos_mint.js +233 -0
  397. package/dist/tools/kairos_mint.js.map +1 -0
  398. package/dist/tools/kairos_next-missing-proof-payload.d.ts +24 -0
  399. package/dist/tools/kairos_next-missing-proof-payload.d.ts.map +1 -0
  400. package/dist/tools/kairos_next-missing-proof-payload.js +32 -0
  401. package/dist/tools/kairos_next-missing-proof-payload.js.map +1 -0
  402. package/dist/tools/kairos_next-pow-helpers.d.ts +57 -0
  403. package/dist/tools/kairos_next-pow-helpers.d.ts.map +1 -0
  404. package/dist/tools/kairos_next-pow-helpers.js +271 -0
  405. package/dist/tools/kairos_next-pow-helpers.js.map +1 -0
  406. package/dist/tools/kairos_next-previous-step.d.ts +36 -0
  407. package/dist/tools/kairos_next-previous-step.d.ts.map +1 -0
  408. package/dist/tools/kairos_next-previous-step.js +121 -0
  409. package/dist/tools/kairos_next-previous-step.js.map +1 -0
  410. package/dist/tools/kairos_next.d.ts +12 -0
  411. package/dist/tools/kairos_next.d.ts.map +1 -0
  412. package/dist/tools/kairos_next.js +285 -0
  413. package/dist/tools/kairos_next.js.map +1 -0
  414. package/dist/tools/kairos_next_schema.d.ts +80 -0
  415. package/dist/tools/kairos_next_schema.d.ts.map +1 -0
  416. package/dist/tools/kairos_next_schema.js +82 -0
  417. package/dist/tools/kairos_next_schema.js.map +1 -0
  418. package/dist/tools/kairos_search.d.ts +15 -0
  419. package/dist/tools/kairos_search.d.ts.map +1 -0
  420. package/dist/tools/kairos_search.js +262 -0
  421. package/dist/tools/kairos_search.js.map +1 -0
  422. package/dist/tools/kairos_spaces.d.ts +10 -0
  423. package/dist/tools/kairos_spaces.d.ts.map +1 -0
  424. package/dist/tools/kairos_spaces.js +129 -0
  425. package/dist/tools/kairos_spaces.js.map +1 -0
  426. package/dist/tools/kairos_update.d.ts +2 -0
  427. package/dist/tools/kairos_update.d.ts.map +1 -0
  428. package/dist/tools/kairos_update.js +158 -0
  429. package/dist/tools/kairos_update.js.map +1 -0
  430. package/dist/types/index.d.ts +60 -0
  431. package/dist/types/index.d.ts.map +1 -0
  432. package/dist/types/index.js +21 -0
  433. package/dist/types/index.js.map +1 -0
  434. package/dist/types/memory.d.ts +38 -0
  435. package/dist/types/memory.d.ts.map +1 -0
  436. package/dist/types/memory.js +2 -0
  437. package/dist/types/memory.js.map +1 -0
  438. package/dist/utils/build-version.d.ts +15 -0
  439. package/dist/utils/build-version.d.ts.map +1 -0
  440. package/dist/utils/build-version.js +46 -0
  441. package/dist/utils/build-version.js.map +1 -0
  442. package/dist/utils/global-error-handlers.d.ts +7 -0
  443. package/dist/utils/global-error-handlers.d.ts.map +1 -0
  444. package/dist/utils/global-error-handlers.js +61 -0
  445. package/dist/utils/global-error-handlers.js.map +1 -0
  446. package/dist/utils/log-core.d.ts +11 -0
  447. package/dist/utils/log-core.d.ts.map +1 -0
  448. package/dist/utils/log-core.js +78 -0
  449. package/dist/utils/log-core.js.map +1 -0
  450. package/dist/utils/logger.d.ts +22 -0
  451. package/dist/utils/logger.d.ts.map +1 -0
  452. package/dist/utils/logger.js +63 -0
  453. package/dist/utils/logger.js.map +1 -0
  454. package/dist/utils/memory-body.d.ts +6 -0
  455. package/dist/utils/memory-body.d.ts.map +1 -0
  456. package/dist/utils/memory-body.js +21 -0
  457. package/dist/utils/memory-body.js.map +1 -0
  458. package/dist/utils/memory-store-utils.d.ts +14 -0
  459. package/dist/utils/memory-store-utils.d.ts.map +1 -0
  460. package/dist/utils/memory-store-utils.js +83 -0
  461. package/dist/utils/memory-store-utils.js.map +1 -0
  462. package/dist/utils/qdrant-collection-utils.d.ts +11 -0
  463. package/dist/utils/qdrant-collection-utils.d.ts.map +1 -0
  464. package/dist/utils/qdrant-collection-utils.js +62 -0
  465. package/dist/utils/qdrant-collection-utils.js.map +1 -0
  466. package/dist/utils/qdrant-query-utils.d.ts +6 -0
  467. package/dist/utils/qdrant-query-utils.d.ts.map +1 -0
  468. package/dist/utils/qdrant-query-utils.js +23 -0
  469. package/dist/utils/qdrant-query-utils.js.map +1 -0
  470. package/dist/utils/qdrant-utils.d.ts +5 -0
  471. package/dist/utils/qdrant-utils.d.ts.map +1 -0
  472. package/dist/utils/qdrant-utils.js +5 -0
  473. package/dist/utils/qdrant-utils.js.map +1 -0
  474. package/dist/utils/qdrant-vector-management.d.ts +25 -0
  475. package/dist/utils/qdrant-vector-management.d.ts.map +1 -0
  476. package/dist/utils/qdrant-vector-management.js +284 -0
  477. package/dist/utils/qdrant-vector-management.js.map +1 -0
  478. package/dist/utils/qdrant-vector-types.d.ts +35 -0
  479. package/dist/utils/qdrant-vector-types.d.ts.map +1 -0
  480. package/dist/utils/qdrant-vector-types.js +42 -0
  481. package/dist/utils/qdrant-vector-types.js.map +1 -0
  482. package/dist/utils/space-display.d.ts +11 -0
  483. package/dist/utils/space-display.d.ts.map +1 -0
  484. package/dist/utils/space-display.js +25 -0
  485. package/dist/utils/space-display.js.map +1 -0
  486. package/dist/utils/space-filter.d.ts +15 -0
  487. package/dist/utils/space-filter.d.ts.map +1 -0
  488. package/dist/utils/space-filter.js +18 -0
  489. package/dist/utils/space-filter.js.map +1 -0
  490. package/dist/utils/structured-logger.d.ts +41 -0
  491. package/dist/utils/structured-logger.d.ts.map +1 -0
  492. package/dist/utils/structured-logger.js +133 -0
  493. package/dist/utils/structured-logger.js.map +1 -0
  494. package/dist/utils/tenant-context.d.ts +67 -0
  495. package/dist/utils/tenant-context.d.ts.map +1 -0
  496. package/dist/utils/tenant-context.js +154 -0
  497. package/dist/utils/tenant-context.js.map +1 -0
  498. package/dist/utils/uri-builder.d.ts +37 -0
  499. package/dist/utils/uri-builder.d.ts.map +1 -0
  500. package/dist/utils/uri-builder.js +60 -0
  501. package/dist/utils/uri-builder.js.map +1 -0
  502. package/package.json +121 -0
package/dist/index.js ADDED
@@ -0,0 +1,100 @@
1
+ /**
2
+ * KAIROS MCP Server
3
+ *
4
+ * Supporting HTTP transport only (STDIO removed for simplicity)
5
+ */
6
+ import { structuredLogger } from './utils/structured-logger.js';
7
+ import { installGlobalErrorHandlers } from './utils/global-error-handlers.js';
8
+ import { logger } from './utils/logger.js';
9
+ import { MemoryQdrantStore } from './services/memory/store.js';
10
+ import { createServer } from './server.js';
11
+ import { startServer } from './http/http-server.js';
12
+ import { injectMemResourcesAtBoot } from './resources/mem-resources-boot.js';
13
+ import { startMetricsServer } from './metrics-server.js';
14
+ import { PORT, METRICS_PORT, QDRANT_SNAPSHOT_ON_START, QDRANT_SNAPSHOT_DIR } from './config.js';
15
+ import { qdrantService } from './services/qdrant/index.js';
16
+ import { triggerQdrantSnapshot } from './services/qdrant/snapshots.js';
17
+ // Import system metrics to ensure they're initialized
18
+ import './services/metrics/system-metrics.js';
19
+ /**
20
+ * Wait for Qdrant to be available with retries
21
+ * Uses shorter intervals for faster detection when Qdrant becomes available quickly
22
+ */
23
+ async function waitForQdrant(memoryStore, maxRetries = 30, intervalMs = 1000) {
24
+ structuredLogger.info('Waiting for Qdrant to be available...');
25
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
26
+ try {
27
+ const isHealthy = await memoryStore.checkHealth(5000); // 5 second timeout per check
28
+ if (isHealthy) {
29
+ structuredLogger.info(`Qdrant is available after ${attempt} attempt(s)`);
30
+ return;
31
+ }
32
+ }
33
+ catch (err) {
34
+ const errorMessage = err instanceof Error ? err.message : String(err);
35
+ structuredLogger.debug(`Qdrant health check error on attempt ${attempt}: ${errorMessage}`);
36
+ // Health check failed, will retry
37
+ }
38
+ if (attempt < maxRetries) {
39
+ structuredLogger.info(`Qdrant not ready yet (attempt ${attempt}/${maxRetries}), retrying in ${intervalMs}ms...`);
40
+ await new Promise(resolve => setTimeout(resolve, intervalMs));
41
+ }
42
+ }
43
+ throw new Error(`Qdrant did not become available after ${maxRetries} attempts (${maxRetries * intervalMs / 1000}s)`);
44
+ }
45
+ async function main() {
46
+ try {
47
+ // Install once at startup to capture any background errors/warnings
48
+ installGlobalErrorHandlers();
49
+ const memoryStore = new MemoryQdrantStore();
50
+ // Wait for Qdrant to be available before initializing
51
+ await waitForQdrant(memoryStore);
52
+ structuredLogger.info('Initializing Qdrant memory store...');
53
+ await memoryStore.init();
54
+ structuredLogger.info('Memory store ready');
55
+ if (QDRANT_SNAPSHOT_ON_START) {
56
+ const snapshotResult = await triggerQdrantSnapshot(qdrantService, {
57
+ enabled: true,
58
+ directory: QDRANT_SNAPSHOT_DIR,
59
+ reason: 'startup'
60
+ });
61
+ if (!snapshotResult.success) {
62
+ structuredLogger.warn(`Startup snapshot failed: ${snapshotResult.message || 'unknown error'}`);
63
+ }
64
+ }
65
+ else {
66
+ structuredLogger.info('Startup snapshot disabled (QDRANT_SNAPSHOT_ON_START=false)');
67
+ }
68
+ // Inject mem resources from embedded-mcp-resources into Qdrant at boot
69
+ // Use --force flag to allow override in new versions
70
+ await injectMemResourcesAtBoot(memoryStore, { force: true });
71
+ // Start dedicated metrics server on separate port
72
+ // This runs independently from the main application server
73
+ startMetricsServer();
74
+ structuredLogger.info(`Application server: ${PORT}`);
75
+ structuredLogger.info(`Metrics server: ${METRICS_PORT} (isolated)`);
76
+ const server = createServer(memoryStore);
77
+ await startServer(server, memoryStore);
78
+ }
79
+ catch (err) {
80
+ const error = err instanceof Error ? err : new Error(String(err));
81
+ // Prefer structured HTTP logger for fatal errors
82
+ try {
83
+ structuredLogger.error('Fatal error during KAIROS MCP startup', error);
84
+ }
85
+ catch {
86
+ // Ignore logging failures from structured logger
87
+ }
88
+ // Fallback to generic logger (stdio-safe)
89
+ try {
90
+ logger.error('Fatal error during KAIROS MCP startup', error);
91
+ }
92
+ catch {
93
+ // Ignore logging failures from generic logger
94
+ }
95
+ // Ensure non-zero exit so supervisors can detect failure
96
+ process.exitCode = 1;
97
+ }
98
+ }
99
+ await main();
100
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,sDAAsD;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,CAAC,CAAC;QAElE,iDAAiD;QACjD,IAAI,CAAC;YACD,gBAAgB,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC3E,CAAC;QAAC,MAAM,CAAC;YACL,iDAAiD;QACrD,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QACjE,CAAC;QAAC,MAAM,CAAC;YACL,8CAA8C;QAClD,CAAC;QAED,yDAAyD;QACzD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACzB,CAAC;AACL,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import './services/metrics/system-metrics.js';
2
+ /**
3
+ * Start dedicated metrics server on separate port.
4
+ *
5
+ * This server ONLY exposes /metrics endpoint for Prometheus scraping.
6
+ *
7
+ * Production benefits:
8
+ * - Complete isolation from application traffic
9
+ * - Can be restricted to internal networks only
10
+ * - No impact on application performance
11
+ * - Standard Prometheus deployment pattern
12
+ */
13
+ export declare function startMetricsServer(port?: number): void;
14
+ //# sourceMappingURL=metrics-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics-server.d.ts","sourceRoot":"","sources":["../src/metrics-server.ts"],"names":[],"mappings":"AAKA,OAAO,sCAAsC,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAqB,GAAG,IAAI,CAwBpE"}
@@ -0,0 +1,41 @@
1
+ import express from 'express';
2
+ import { register } from './services/metrics/registry.js';
3
+ import { structuredLogger } from './utils/structured-logger.js';
4
+ import { METRICS_PORT } from './config.js';
5
+ // Import system metrics to ensure they're initialized
6
+ import './services/metrics/system-metrics.js';
7
+ /**
8
+ * Start dedicated metrics server on separate port.
9
+ *
10
+ * This server ONLY exposes /metrics endpoint for Prometheus scraping.
11
+ *
12
+ * Production benefits:
13
+ * - Complete isolation from application traffic
14
+ * - Can be restricted to internal networks only
15
+ * - No impact on application performance
16
+ * - Standard Prometheus deployment pattern
17
+ */
18
+ export function startMetricsServer(port = METRICS_PORT) {
19
+ const app = express();
20
+ // ONLY route: /metrics endpoint
21
+ app.get('/metrics', async (req, res) => {
22
+ try {
23
+ res.set('Content-Type', register.contentType);
24
+ const metrics = await register.metrics();
25
+ res.end(metrics);
26
+ }
27
+ catch (error) {
28
+ structuredLogger.error('Error generating metrics', error);
29
+ res.status(500).end('Error generating metrics');
30
+ }
31
+ });
32
+ // Health check for metrics server (optional but recommended)
33
+ app.get('/health', (req, res) => {
34
+ res.status(200).json({ status: 'ok', service: 'metrics' });
35
+ });
36
+ app.listen(port, () => {
37
+ structuredLogger.info(`Metrics server listening on port ${port}`);
38
+ structuredLogger.info(`Metrics endpoint: http://localhost:${port}/metrics`);
39
+ });
40
+ }
41
+ //# sourceMappingURL=metrics-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics-server.js","sourceRoot":"","sources":["../src/metrics-server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,sDAAsD;AACtD,OAAO,sCAAsC,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,YAAY;IAC5D,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IAEtB,gCAAgC;IAChC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QACrC,IAAI,CAAC;YACH,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;YAC9C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAC;YACzC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,gBAAgB,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;YAC1D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAClD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,6DAA6D;IAC7D,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC9B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACpB,gBAAgB,CAAC,IAAI,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC;QAClE,gBAAgB,CAAC,IAAI,CAAC,sCAAsC,IAAI,UAAU,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function registerDocsResources(server: any): void;
2
+ //# sourceMappingURL=docs-resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-resources.d.ts","sourceRoot":"","sources":["../../src/resources/docs-resources.ts"],"names":[],"mappings":"AASA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,GAAG,QAqDhD"}
@@ -0,0 +1,47 @@
1
+ import { getResource, getResources } from './embedded-mcp-resources.js';
2
+ import { logger } from '../utils/logger.js';
3
+ function mdOrFallback(uri, text, notFound = 'Document not found') {
4
+ return {
5
+ contents: [{ uri: uri.href, mimeType: 'text/markdown', text: text || `# ${notFound}` }]
6
+ };
7
+ }
8
+ export function registerDocsResources(server) {
9
+ logger.info('Registering docs resources dynamically from embedded resources (excluding templates)');
10
+ const resources = getResources();
11
+ const toTitle = (s) => s.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase());
12
+ // Handle both flat resources (directly in resources/) and nested resources (in subdirectories)
13
+ for (const [key, value] of Object.entries(resources)) {
14
+ if (typeof value === 'string') {
15
+ // Flat resource: treat as if in 'doc' subdirectory
16
+ const subdir = 'doc';
17
+ const filename = key;
18
+ const prefix = `kairos://${subdir}`;
19
+ const uri = `${prefix}/${filename}`;
20
+ const name = toTitle(filename);
21
+ const description = `Documentation for ${name}`;
22
+ server.registerResource(`${subdir}-${filename}`, uri, { name, description, mimeType: 'text/markdown' }, (uriObj) => {
23
+ const resourceContent = getResource(filename);
24
+ return mdOrFallback(uriObj, resourceContent);
25
+ });
26
+ }
27
+ else if (typeof value === 'object' && value !== null) {
28
+ // Nested resource: subdirectory structure (doc, mem, etc.)
29
+ const subdir = key;
30
+ const prefix = `kairos://${subdir}`;
31
+ // Iterate through files in this subdirectory
32
+ for (const [filename, content] of Object.entries(value)) {
33
+ if (typeof content === 'string') {
34
+ const uri = `${prefix}/${filename}`;
35
+ const name = toTitle(filename);
36
+ const description = `Documentation for ${name}`;
37
+ server.registerResource(`${subdir}-${filename}`, uri, { name, description, mimeType: 'text/markdown' }, (uriObj) => {
38
+ const resourceContent = getResource(`${subdir}.${filename}`);
39
+ return mdOrFallback(uriObj, resourceContent);
40
+ });
41
+ }
42
+ }
43
+ }
44
+ }
45
+ // Tools docs are not registered as resources to keep resources/list lean.
46
+ }
47
+ //# sourceMappingURL=docs-resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-resources.js","sourceRoot":"","sources":["../../src/resources/docs-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,SAAS,YAAY,CAAC,GAAQ,EAAE,IAAa,EAAE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C,OAAO,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;YAC/C,CAAC,CACF,CAAC;QACJ,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACvD,2DAA2D;YAC3D,MAAM,MAAM,GAAG,GAAG,CAAC;YACnB,MAAM,MAAM,GAAG,YAAY,MAAM,EAAE,CAAC;YAEpC,6CAA6C;YAC7C,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAChC,MAAM,GAAG,GAAG,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC;oBACpC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC/B,MAAM,WAAW,GAAG,qBAAqB,IAAI,EAAE,CAAC;oBAEhD,MAAM,CAAC,gBAAgB,CACrB,GAAG,MAAM,IAAI,QAAQ,EAAE,EACvB,GAAG,EACH,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,EAChD,CAAC,MAAW,EAAE,EAAE;wBACd,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAC;wBAC7D,OAAO,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;oBAC/C,CAAC,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,0EAA0E;AAC5E,CAAC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * AUTO-GENERATED FILE - DO NOT EDIT
3
+ *
4
+ * Generated by: scripts/embed-docs.ts
5
+ * Contains: MCP guide resources dynamically embedded at build time
6
+ * Structure reflects src/embed-docs/ directory structure
7
+ *
8
+ * To update: npm run build (or manually run ts-node scripts/embed-docs.ts)
9
+ */
10
+ export declare const mcpResources: {
11
+ prompts: {
12
+ "contextual-prompt": string;
13
+ };
14
+ resources: {
15
+ "building-kairos-workflows": string;
16
+ };
17
+ templates: {
18
+ "kairos-memory": string;
19
+ };
20
+ tools: {
21
+ kairos_attest: string;
22
+ kairos_begin: string;
23
+ kairos_delete: string;
24
+ kairos_dump: string;
25
+ kairos_mint: string;
26
+ kairos_next: string;
27
+ kairos_search: string;
28
+ kairos_spaces: string;
29
+ kairos_update: string;
30
+ };
31
+ mem: {};
32
+ };
33
+ /**
34
+ * Get prompts object
35
+ */
36
+ export declare function getPrompts(): Record<string, any>;
37
+ /**
38
+ * Get resources object
39
+ */
40
+ export declare function getResources(): Record<string, any>;
41
+ /**
42
+ * Get templates object
43
+ */
44
+ export declare function getTemplates(): Record<string, any>;
45
+ /**
46
+ * Get tools object
47
+ */
48
+ export declare function getTools(): Record<string, any>;
49
+ /**
50
+ * Get mem object
51
+ */
52
+ export declare function getMem(): Record<string, any>;
53
+ /**
54
+ * Get a prompt by key (e.g. 'contextual-prompt')
55
+ */
56
+ export declare function getPrompt(key: string): string | undefined;
57
+ /**
58
+ * Get a resource by key (e.g. 'TEST', 'doc.TEST', 'mem.<uuid>')
59
+ */
60
+ export declare function getResource(key: string): string | any | undefined;
61
+ /**
62
+ * Get a template by key (e.g. 'kairos-memory')
63
+ */
64
+ export declare function getTemplate(key: string): string | undefined;
65
+ /**
66
+ * Get a tool doc by key (e.g. 'kairos_begin')
67
+ */
68
+ export declare function getToolDoc(key: string): string | undefined;
69
+ /**
70
+ * Get all available resource categories and names
71
+ */
72
+ export declare function listResourceKeys(): Record<string, string[]>;
73
+ //# sourceMappingURL=embedded-mcp-resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedded-mcp-resources.d.ts","sourceRoot":"","sources":["../../src/resources/embedded-mcp-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;CAsBxB,CAAC;AAEF;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAEhD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAElD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAElD;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAE9C;AAED;;GAEG;AACH,wBAAgB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAE5C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGzD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,SAAS,CAYjE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG3D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG1D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAkB3D"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * AUTO-GENERATED FILE - DO NOT EDIT
3
+ *
4
+ * Generated by: scripts/embed-docs.ts
5
+ * Contains: MCP guide resources dynamically embedded at build time
6
+ * Structure reflects src/embed-docs/ directory structure
7
+ *
8
+ * To update: npm run build (or manually run ts-node scripts/embed-docs.ts)
9
+ */
10
+ export const mcpResources = {
11
+ "prompts": {
12
+ "contextual-prompt": "You are KAIROS — a deterministic execution engine for protocol chains.\n\nYou turn user intent into a KAIROS protocol run, then execute it exactly.\nProtocols are stored as memory chains. Each step can define a challenge.\nYou advance a protocol by submitting a matching solution.\n\n**Execution policy:** When running KAIROS protocols, follow the tools'\n`next_action` and `challenge.description` exactly. Do not invent work or\nskip steps. Respond to the user only after the protocol run is complete\n(after calling `kairos_attest` when `next_action` directs you to it).\n\n## Execution loop\n\nFollow this loop for any protocol run.\n\n1. Call `kairos_search` when the user's intent maps to a protocol.\n2. Choose a protocol from `choices`; call `kairos_begin` with its URI.\n3. While `next_action` says to call `kairos_next`:\n - Read the `challenge` for the current step.\n - Complete the work. By `challenge.type`:\n - `shell` — Run `challenge.shell.cmd`. Report actual\n `exit_code`/`stdout`/`stderr`. Never fabricate.\n - `mcp` — Call `challenge.mcp.tool_name`. Report actual result.\n `success` must reflect reality.\n - `user_input` — Display `challenge.user_input.prompt` verbatim to\n the user. Place their exact reply in `user_input.confirmation`.\n Never invent it.\n - `comment` — Write a genuine comment about this step that meets\n `challenge.comment.min_length` and is relevant to the step.\n - Call `kairos_next` with the URI from `next_action` and a `solution`\n matching `challenge.type`.\n - Echo `challenge.nonce` as `solution.nonce` when present.\n - Echo `challenge.proof_hash` as `solution.proof_hash` for step 1.\n For later steps, echo the `proof_hash` from the previous\n `kairos_next` response.\n - Never compute hashes. The server generates all hashes.\n4. When `next_action` directs you to `kairos_attest`, call it with the\n given URI and outcome/message. The protocol run is done; respond to\n the user.\n\n## MUST ALWAYS\n\n- Follow `next_action` when `must_obey: true`. No deviation.\n- Perform actual challenge work before submitting a solution.\n- Complete `kairos_attest` before responding to the user.\n- Run an existing protocol instead of inventing a new workflow.\n\n## MUST NEVER\n\n- Compute or modify hashes or nonces.\n- Fabricate shell output, MCP results, or user confirmations.\n- Respond to the user before `kairos_attest` when `must_obey: true`.\n\n## Minting and editing protocols\n\nWhen minting (`kairos_mint`) or editing (`kairos_update`) a workflow\ndocument (H1 chain, H2 steps), add a trailing ` ```json ` block at the\nend of each step with `{\"challenge\": {...}}` (same shape as\n`kairos_begin`/`kairos_next`). Use the challenge type that matches the\nwork: `shell`, `mcp`, `user_input`, or `comment`.\n\n## `must_obey` semantics\n\n- `must_obey: true` — Follow `next_action` exactly.\n- `must_obey: false` — Use judgment. Choose from options in\n `next_action`. Repair with `kairos_update` when safe; otherwise ask\n the user.\n"
13
+ },
14
+ "resources": {
15
+ "building-kairos-workflows": "# Building KAIROS workflows with challenge/solution\n\n**Purpose:** Primary guide for building KAIROS protocol workflows.\nChallenge/solution is the core mechanism: each step defines a\n**challenge** (what must be done); execution advances by submitting a\nmatching **solution** via `kairos_next`. This guide covers document\nstructure, minting with `kairos_mint`, and solution submission.\n\n---\n\n## Mission\n\nBuild KAIROS protocol workflows where challenges (defined per step) are\nvalidated by solutions (submitted in `kairos_next`). Create documents\nwith `kairos_mint` that define these challenges; maintain exact\nconsistency between markdown structure and memory chain behavior.\n\n---\n\n## Structure\n\n**Document organization:**\n\n- **H1 (`# Title`)** — defines a protocol chain (one H1 = one chain).\n- **Steps** — defined by a trailing ` ```json ` block with\n `{\"challenge\": {...}}`. H2 headings are used as step labels when\n present in a segment.\n- **Challenge** — a fenced ` ```json ` block with `{\"challenge\": {...}}`\n (same shape as `kairos_begin`/`kairos_next`).\n\n**Memory mapping:**\n\n- Each H1 section → one protocol chain.\n- Each challenge block (` ```json ` with `challenge` key) → one memory\n step; content before that block is the step's text.\n- Optional content after the last challenge block → final step (no\n proof required).\n- H2 in a segment → used as that step's label when present.\n\n**Processing flow:**\n\n```\nMarkdown document\n ↓\nkairos_mint(markdown_doc, llm_model_id)\n ↓\nMemory chain (array of memory objects)\n ↓\nEach memory has:\n - memory_uuid\n - label (from H2 heading)\n - text (H2 content)\n - proof_of_work (from trailing JSON challenge block)\n```\n\n---\n\n## Challenge definitions\n\nAdd a trailing ` ```json ` block at the end of each step with an object\nthat has a `challenge` key. The value is the same shape as the challenge\nreturned by `kairos_begin`/`kairos_next`; it round-trips with\n`kairos_dump`.\n\n**`shell`:**\n\nExample: ```json\n{\n \"challenge\": {\n \"type\": \"shell\",\n \"shell\": { \"cmd\": \"echo \\\"test\\\"\", \"timeout_seconds\": 30 },\n \"required\": true\n }\n}\n```\n\n**`mcp`:**\n\nExample: ```json\n{\n \"challenge\": {\n \"type\": \"mcp\",\n \"mcp\": { \"tool_name\": \"tool_name\", \"expected_result\": null },\n \"required\": true\n }\n}\n```\n\n**`user_input`:**\n\nExample: ```json\n{\n \"challenge\": {\n \"type\": \"user_input\",\n \"user_input\": { \"prompt\": \"Confirm completion\" },\n \"required\": true\n }\n}\n```\n\n**`comment`:**\n\nExample: ```json\n{\n \"challenge\": {\n \"type\": \"comment\",\n \"comment\": { \"min_length\": 50 },\n \"required\": true\n }\n}\n```\n\n**Parsing rule:** Only the **last** fenced code block in a step is read;\nit must be valid JSON with a `challenge` key. The block is stripped from\nstored text; the challenge becomes that step's `proof_of_work`.\n\n### Challenge execution semantics\n\n- **`shell`:** Run the command; report `exit_code`/`stdout`/`stderr`.\n Exit code 0 = success.\n- **`mcp`:** Call the tool; report `result` and `success`.\n- **`user_input`:** Display the prompt to the user; place only their\n reply in `user_input.confirmation`.\n- **`comment`:** Provide text meeting the minimum length; the server\n validates relevance to the step.\n\nFor agent execution rules (what agents must do per type), see the\n`kairos_begin` and `kairos_next` tool descriptions.\n\n---\n\n## MUST ALWAYS\n\n**Document structure:**\n\n- Use H1 (`# Title`) for protocol chain labels.\n- Use H2 (`## Step N`) for individual steps.\n- Place challenge markers **within** the H2 section they apply to.\n\n**Challenge placement:**\n\n- Place the challenge at the **end** of an H2 section as a single\n trailing ` ```json ` block.\n- Only the **last** code block in a step is parsed as the challenge.\n- Ensure the opening \\`\\`\\`json is at **line start** (on its own line,\n no prefix). Blocks with text on the same line (e.g. `Example: \\`\\`\\`json`)\n are not parsed as steps.\n\n**`kairos_mint` usage:**\n\n- Pass `markdown_doc` as a string.\n- Include `llm_model_id` (e.g. `\"minimax/minimax-m2:free\"`).\n- Use `force_update: true` to overwrite existing chains with the same\n label.\n\n**Solution submission:**\n\n- Submit via `kairos_next(uri, solution)`.\n- Solution structure by type:\n - `shell`: `{ type: \"shell\", shell: { exit_code, stdout, stderr,\n duration_seconds } }`\n - `mcp`: `{ type: \"mcp\", mcp: { tool_name, arguments, result,\n success } }`\n - `user_input`: `{ type: \"user_input\", user_input: { confirmation,\n timestamp } }`\n - `comment`: `{ type: \"comment\", comment: { text } }`\n\n---\n\n## MUST NEVER\n\n**Document structure:**\n\n- Mix H1 and H2 in unpredictable ways.\n- Place the challenge JSON block outside the H2 section it ends.\n- Use legacy line-based challenge syntax; use only the trailing JSON\n block.\n\n**Challenge definitions:**\n\n- Use the deprecated `proof_of_work` field in API calls; use `solution`\n instead.\n- Submit solutions that do not match the challenge type.\n\n**`kairos_mint`:**\n\n- Pass `markdown_doc` as an object — always pass as a string.\n- Omit `llm_model_id` — it is required.\n- Store duplicate chains without `force_update: true`.\n\n**Workflow:**\n\n- Confuse `challenge` (output from `kairos_next`) with `solution` (input\n to `kairos_next`).\n- Use the deprecated `proof_of_work` field; use `solution`.\n- Assume step 1 requires a solution submission — step 1 is begun with\n `kairos_begin` only.\n\n---\n\n## Workflow examples\n\n### Example 1: Simple protocol with shell challenges\n\nUse one H1, then one H2 per step. End each step with a ` ```json `\nblock containing `{\"challenge\": {...}}`:\n\n```\n## Step 1: Initialize\nCreate the project structure.\n\n```json\n{\"challenge\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"mkdir -p project/src\",\"timeout_seconds\":10},\"required\":true}}\n```\n```\n\nRepeat for Steps 2 and 3 with their own `shell` challenge blocks.\n\n**Execution flow:**\n\n1. `kairos_search(\"simple setup\")` → returns `must_obey: true` with\n `next_action` containing URI.\n2. `kairos_begin(uri)` → returns step 1 with `challenge` and\n `next_action` with next URI.\n3. `kairos_next(step2_uri, { type: \"shell\", proof_hash: \"...\",\n shell: {...} })` → returns step 2.\n4. Continue through all steps; echo `proof_hash` from each response.\n5. Last `kairos_next` returns `next_action` to call `kairos_attest`.\n Call it to complete the run.\n\n### Example 2: Protocol with comment and user_input challenges\n\nStep 1 ends with a `comment` challenge block; Step 2 with a\n`user_input` block.\n\nStep 1 markdown:\n\n```\n## Step 1: Review\nReview the documentation for accuracy.\n\n```json\n{\"challenge\":{\"type\":\"comment\",\"comment\":{\"min_length\":50},\"required\":true}}\n```\n```\n\nStep 2 markdown:\n\n```\n## Step 2: Confirm\nConfirm review is complete.\n\n```json\n{\"challenge\":{\"type\":\"user_input\",\"user_input\":{\"prompt\":\"Type 'approved' to confirm\"},\"required\":true}}\n```\n```\n\n### Example 3: Multi-chain document\n\nUse two H1 sections (Protocol A, Protocol B). Each H1 creates a\nseparate chain. Each chain has one or more H2 steps; each step ends with\na ` ```json ` challenge block.\n\n**Result:** Two separate protocol chains are created.\n\n---\n\n## Challenge vs solution nomenclature\n\n- **Challenge** = what `kairos_next` **returns** (what the agent must\n complete).\n- **Solution** = what you **submit** to `kairos_next` (proof you\n completed it).\n\nIn markdown: use a trailing ` ```json ` block with `{\"challenge\": {...}}`\nper step. The API uses `challenge` (output) and `solution` (input).\n\n---\n\n## Validation rules\n\n| Type | Pass condition |\n|------|----------------|\n| `shell` | `exit_code === 0` |\n| `mcp` | `success === true` |\n| `user_input` | Any non-empty `confirmation` |\n| `comment` | `text.length` ≥ `challenge.comment.min_length` |\n\n**Step progression:**\n\n- Step 1: no solution required — call `kairos_begin` only.\n- Steps 2+: solution required — submit matching `solution`.\n- Include `nonce` and `proof_hash` in solution (echo from\n challenge/response).\n- Last step: `kairos_next` directs to `kairos_attest`; call attest to\n finalize.\n\n**Error handling (two-phase retry):**\n\n- Retries 1–3: `must_obey: true` with `error_code` and `next_action`\n for recovery.\n- After 3 retries: `must_obey: false` — choose to fix the step, abort,\n or ask the user.\n- Error responses include `error_code` (e.g. `NONCE_MISMATCH`,\n `TYPE_MISMATCH`) and `retry_count`.\n\n---\n\n## Quick reference\n\n| Operation | Tool | Required fields |\n|-----------|------|-----------------|\n| Mint document | `kairos_mint` | `markdown_doc`, `llm_model_id` |\n| Find protocol | `kairos_search` | `query` |\n| Start protocol | `kairos_begin` | `uri` (from `next_action`) |\n| Continue step | `kairos_next` | `uri` (from `next_action`), `solution` with `nonce` + `proof_hash` |\n| Complete protocol | `kairos_attest` | `uri`, `outcome`, `message` |\n"
16
+ },
17
+ "templates": {
18
+ "kairos-memory": "# {Protocol title}\n\n{One-sentence description of what this protocol does and when to run it.}\n\n## Natural Language Triggers\n\n**Run this protocol when the user says ANY of:**\n\n- \"{trigger phrase 1}\"\n- \"{trigger phrase 2}\"\n- \"{trigger phrase 3}\"\n\n**Trigger verbs** + ({noun1} / {noun2} / {noun3}):\n\n- **{verb1}** / **{verb2}** / **{verb3}**\n\n**Must Never:**\n\n- Trigger on \"{phrase}\" when the user means {different intent}\n- Run without {required precondition}\n\n**Must Always:**\n\n- {Mandatory behaviour 1}\n- {Mandatory behaviour 2}\n\n**Good trigger examples:**\n\n- \"{phrase that activates}\" → run this protocol\n- \"{phrase that activates}\" → run this protocol\n\n**Bad trigger examples:**\n\n- \"{phrase that must not activate}\" → {what to do instead}\n- \"{phrase that must not activate}\" → {what to do instead}\n\n## Step 1: {Step label}\n\n{What the agent must do in this step.}\n\n```json\n{\n \"challenge\": {\n \"type\": \"shell\",\n \"shell\": { \"cmd\": \"{command}\", \"timeout_seconds\": 60 },\n \"required\": true\n }\n}\n```\n\n## Step 2: {Step label}\n\n{What the agent must do in this step.}\n\n```json\n{\n \"challenge\": {\n \"type\": \"comment\",\n \"comment\": { \"min_length\": 50 },\n \"required\": true\n }\n}\n```\n\n## Completion rule\n\nOnly reachable after all prior steps are solved. Show the outputs from\nall prior steps to the user. No additional challenge.\n"
19
+ },
20
+ "tools": {
21
+ "kairos_attest": "Attest protocol completion or failure. Final step of every protocol run.\n\n**Precondition:** `kairos_next` (or `kairos_begin` for a single-step\nprotocol) returned `next_action` directing you to call `kairos_attest`.\nThere are no more steps to solve.\n\n**Input:**\n\n- `uri` — last step URI from the completion response's `next_action`.\n- `outcome` — `\"success\"` or `\"failure\"`.\n- `message` — short summary (1–2 sentences) of how the protocol went.\n\n**Response:** Confirmation that the run is recorded.\n\n**After attestation:** The protocol run is complete. Respond to the\nuser. Do not respond before attestation when `must_obey: true`.\n\n**MUST ALWAYS**\n\n- Call `kairos_attest` as the final action of every protocol run.\n- Report `outcome: \"failure\"` when any step failed or was aborted.\n\n**MUST NEVER**\n\n- Respond to the user before calling `kairos_attest` when `must_obey:\n true`.\n- Skip attestation on error paths — always attest, even on failure.\n",
22
+ "kairos_begin": "Start protocol execution. Loads step 1 and returns its challenge.\nStep 1 never requires a solution submission.\n\n**Precondition:** You have a URI from `kairos_search` (via a choice's\n`next_action`). Do not call with a URI you invented.\n\n**Input:** `uri` — the protocol URI from `next_action`. If you supply a\nnon-step-1 URI, KAIROS auto-redirects to step 1.\n\n**Response:** `current_step` (content + uri), `challenge` (type,\ndescription, nonce, proof_hash), `next_action` with the exact URI for\nthe next call. Always `must_obey: true`.\n\n**AI decision tree:**\n\n- `next_action` mentions `kairos_next`: execute the challenge, then call\n `kairos_next` with the URI from `next_action` and a solution matching\n the challenge type.\n- `next_action` directs you to `kairos_attest`: single-step protocol.\n Call `kairos_attest` with the given URI and outcome/message; run is\n done.\n\n**Execution rules by `challenge.type`:**\n\n- `shell`: Run `challenge.shell.cmd`. Report actual `exit_code`,\n `stdout`, `stderr`. Never fabricate.\n- `mcp`: Call `challenge.mcp.tool_name`. Report actual result.\n `success` must reflect reality.\n- `user_input`: Display `challenge.user_input.prompt` verbatim to the\n user. Place their exact reply in `user_input.confirmation`. Never\n invent it.\n- `comment`: Write a genuine comment relevant to the step that meets\n `challenge.comment.min_length`.\n\n**Proof hash:** Echo `challenge.proof_hash` as `solution.proof_hash` in\nthe next `kairos_next` call. The server generates all hashes.\n\n**MUST ALWAYS**\n\n- Perform the actual challenge work before submitting the solution.\n- Echo `challenge.nonce` and `challenge.proof_hash` verbatim in the\n next `kairos_next` call.\n\n**MUST NEVER**\n\n- Compute or modify hashes or nonces.\n- Call `kairos_begin` again on error — use the fresh challenge in the\n error response to retry via `kairos_next`.\n",
23
+ "kairos_delete": "Delete one or more memories from KAIROS.\n\n**Precondition:** You have the target memory URI(s). Resolve URIs via\n`kairos_search` and chain navigation before calling.\n\n**Input:**\n\n- `uris` (required, non-empty array) — `kairos://mem/{uuid}` URIs to\n delete.\n\n**Response:** Confirmation of deleted URIs.\n\n**MUST ALWAYS**\n\n- Resolve and verify the target URIs before deleting.\n- Confirm the user's intent to delete before calling when acting on\n user instruction.\n\n**MUST NEVER**\n\n- Delete a URI you have not resolved or verified.\n- Call with an empty `uris` array.\n",
24
+ "kairos_dump": "Read-only inspection of a memory or full protocol. Returns\n`markdown_doc` for use with `kairos_update` or `kairos_mint`. No run\nstate, no nonce.\n\n**Precondition:** You have a memory URI.\n\n**Input:**\n\n- `uri` — `kairos://mem/{uuid}`.\n- `protocol` (optional, default `false`) — when `true`, returns the\n full chain as one markdown document; otherwise returns the single\n step's content.\n\n**Output:**\n\n- Default mode: `markdown_doc` (string), and optionally `uri`, `label`,\n `position`, `challenge`.\n- Protocol mode: `markdown_doc` (string), and optionally `uri` (chain\n head), `label`, `step_count`.\n\n**Round-trip edit flow (single step):**\n\n1. `kairos_dump(uri)` → receive `markdown_doc`.\n2. Edit `markdown_doc`.\n3. `kairos_update({ uris: [uri], markdown_doc: [edited] })`.\n\n**Round-trip edit flow (full protocol):**\n\n1. `kairos_dump(uri, { protocol: true })` → receive full `markdown_doc`.\n2. Edit.\n3. `kairos_mint({ markdown_doc, llm_model_id, force_update: true })`.\n\n**MUST NEVER**\n\n- Use `kairos_dump` to bypass execution; use it only for inspection and\n round-trip edit flows.\n",
25
+ "kairos_mint": "Store a markdown document as a KAIROS protocol chain. Each H1 defines\na chain; each H2 defines a step.\n\n**Precondition:** You have a complete markdown document with H1 title,\nH2 steps, and a trailing ` ```json ` challenge block per verifiable step.\n\n**Input:**\n\n- `markdown_doc` (string) — the markdown protocol document.\n- `llm_model_id` (required) — e.g. `\"minimax/minimax-m2:free\"`.\n- `force_update` (optional, default `false`) — set `true` to overwrite\n an existing chain with the same label.\n\n**Challenge block format:** Place a single trailing ` ```json ` block at\nthe end of each H2 step. The object must have a `challenge` key. Only\nthe last code block in a step is parsed as the challenge. **The opening\n\\`\\`\\`json must be at line start** (on its own line with no text before\nit). Blocks with text on the same line (e.g. `Example: \\`\\`\\`json`) are\nnot parsed as steps.\n\nAdd a challenge to every step that can be verified. Omit challenges only\nfor purely informational steps where no verification is possible.\n\n**Challenge examples (one per type):**\n\n`shell` — run a command:\n\nExample: ```json\n{\n \"challenge\": {\n \"type\": \"shell\",\n \"shell\": { \"cmd\": \"npm test\", \"timeout_seconds\": 60 },\n \"required\": true\n }\n}\n```\n\n`comment` — verification text:\n\nExample: ```json\n{\n \"challenge\": {\n \"type\": \"comment\",\n \"comment\": { \"min_length\": 50 },\n \"required\": true\n }\n}\n```\n\n`user_input` — human confirmation:\n\nExample: ```json\n{\n \"challenge\": {\n \"type\": \"user_input\",\n \"user_input\": { \"prompt\": \"Approve deployment?\" },\n \"required\": true\n }\n}\n```\n\n`mcp` — call an MCP tool:\n\nExample: ```json\n{\n \"challenge\": {\n \"type\": \"mcp\",\n \"mcp\": { \"tool_name\": \"kairos_mint\" },\n \"required\": true\n }\n}\n```\n\n**Response:** Chain head URI(s). Find the minted protocol via\n`kairos_search` with a query matching the document content.\n\n**MUST ALWAYS**\n\n- Pass `markdown_doc` as a string.\n- Include `llm_model_id`.\n- Use `force_update: true` when overwriting an existing chain with the\n same label.\n\n**MUST NEVER**\n\n- Pass `markdown_doc` as an object.\n- Omit `llm_model_id`.\n- Store duplicate chains without `force_update: true`.\n",
26
+ "kairos_next": "Submit a solution and advance to the next step. Use for every step\nafter step 1.\n\n**Precondition:** You have completed the current step's challenge. You\nhave the URI from the previous response's `next_action`.\n\n**Input:**\n\n- `uri` — current step URI from `next_action` of the previous response.\n Do not use for step 1 — use `kairos_begin` for step 1.\n- `solution` — proof matching `challenge.type`:\n - `shell`: `{ type: \"shell\", shell: { exit_code, stdout?, stderr?,\n duration_seconds? } }` — `exit_code: 0` = success.\n - `mcp`: `{ type: \"mcp\", mcp: { tool_name, result, success,\n arguments? } }` — `success` must be `true`.\n - `user_input`: `{ type: \"user_input\", user_input: { confirmation,\n timestamp? } }`.\n - `comment`: `{ type: \"comment\", comment: { text } }` — `text.length`\n must meet `challenge.comment.min_length`.\n- `solution.nonce` — echo from `challenge.nonce` when present.\n- `solution.proof_hash` — echo `challenge.proof_hash` for step 1; for\n steps 2+ echo the `proof_hash` from the previous `kairos_next`\n response. The server generates all hashes.\n\n**Execution rules by `challenge.type`:**\n\n- `shell`: Run `challenge.shell.cmd`. Report actual `exit_code`,\n `stdout`, `stderr`. Never fabricate.\n- `mcp`: Call `challenge.mcp.tool_name`. Report actual result.\n `success` must reflect reality.\n- `user_input`: Display `challenge.user_input.prompt` verbatim to the\n user. Place their exact reply in `user_input.confirmation`. Never\n invent it.\n- `comment`: Write a genuine comment relevant to the step that meets\n `challenge.comment.min_length`.\n\n**Response:** `current_step`, `challenge` (for next step), `next_action`\n(next tool call with embedded URI), `proof_hash` (use as\n`solution.proof_hash` for the next step).\n\n**AI decision tree:**\n\n- `must_obey: true` — follow `next_action` (success or recoverable\n error, retries 1–3).\n- `must_obey: false` — use judgment (max retries exceeded). Options in\n `next_action`: fix the step via `kairos_update`, abort via\n `kairos_attest` with `outcome: \"failure\"`, or ask the user.\n- `next_action` directs you to `kairos_attest` — call attest with the\n given URI and outcome/message; protocol run is done, then respond to\n the user.\n\n**Error responses** include `error_code` (e.g. `NONCE_MISMATCH`,\n`TYPE_MISMATCH`, `MAX_RETRIES_EXCEEDED`) and `retry_count`. A fresh\n`challenge` with a new nonce is included for retry.\n\n**MUST ALWAYS**\n\n- Perform the actual challenge work before submitting.\n- Use the URI from the previous `next_action`, not a stored or invented\n URI.\n- Echo `nonce` and `proof_hash` verbatim from the correct source.\n\n**MUST NEVER**\n\n- Fabricate shell output, MCP results, or user confirmations.\n- Compute or modify hashes or nonces.\n- Re-call `kairos_begin` on error; retry using the error response's\n fresh challenge.\n",
27
+ "kairos_search": "Search for protocol chains matching a query. Entry point for every\nKAIROS workflow.\n\n**Precondition:** You have a user intent to translate into a protocol run.\n\n**Input:** `query` — 3–8 specific words (nouns + verbs). Use domain or\ntool names when the user implied one. Stay faithful to the user's\nintent; add specificity, do not substitute your own interpretation.\nExpand slash-commands or shorthand (e.g. `/ai-docs` → `write ai\ninstructions zero-drift template`).\n\n**Response:** Always `must_obey: true`. Contains `choices` array (each\nwith `uri`, `label`, `chain_label`, `score`, `role`, `tags`,\n`next_action`), `message`, and a global `next_action`.\n\n**Choice roles:**\n\n- `role: \"match\"` — search result with `score` (0.0–1.0). Higher score\n = closer match. That choice's `next_action` directs you to call\n `kairos_begin` with its URI.\n- `role: \"refine\"` — step-by-step help to build a more specific query. That\n choice's `next_action` directs you to call `kairos_begin` with the\n refine-help protocol URI.\n- `role: \"create\"` — create a new protocol (`score: null`). That\n choice's `next_action` directs you to call `kairos_begin` with the\n creation protocol URI.\n\n**Ordering:** Match choices first (top N), then refine (if present),\nthen create (if present). Refine and create are not part of the search\nlimit.\n\n**AI decision tree:** `must_obey: true` — pick one choice and follow\n**that choice's `next_action`**. The global `next_action` says: \"Pick\none choice and follow that choice's next_action.\"\n\nWhen results are weak (no scores above 0.7), pick the refine choice and\nrun that protocol for step-by-step help improving the query.\n\n**MUST ALWAYS**\n\n- Follow the chosen choice's `next_action`, not the global `next_action`.\n- Call `kairos_begin` with the chosen URI as the next step.\n\n**MUST NEVER**\n\n- Reuse a vague query that already returned no strong match.\n- Run `kairos_begin` with a URI not returned by this response.\n",
28
+ "kairos_spaces": "List the agent's available spaces with human-readable names and chain\ncounts.\n\n**Precondition:** None.\n\n**Input:**\n\n- `include_chain_titles` (optional, default `false`) — when `true`,\n each space includes a `chains` array with `chain_id`, `title`, and\n `step_count`.\n\n**Output:** `spaces` array. Each item has:\n\n- `name` — human-readable: `\"Personal\"`, `\"Group: <ref>\"`, or\n `\"Kairos app\"`.\n- `chain_count` — number of protocol chains in this space.\n- `chains` (optional) — array of `{ chain_id, title, step_count }` when\n `include_chain_titles: true`.\n\nSpaces include the agent's personal space, any group spaces, and the\nKairos app space (read-only protocols).\n\n**MUST ALWAYS**\n\n- Use space names (not raw IDs) in tool parameters such as `kairos_mint`.\n\n**MUST NEVER**\n\n- Pass raw space IDs in tool parameters; the backend resolves names to\n IDs.\n",
29
+ "kairos_update": "Update one or more existing memories in KAIROS using markdown or\nfield-level updates.\n\n**Precondition:** You have the target memory URI(s). Resolve URIs via\n`kairos_search` followed by chain navigation, or use a URI already in\nscope.\n\n**Input:**\n\n- `uris` (required) — array of `kairos://mem/{uuid}` URIs to update.\n- `markdown_doc` (array of markdown strings, one per URI) — replaces\n the full content of each targeted memory.\n- `updates` (field-level updates) — use when replacing specific fields\n instead of the full document.\n\nProvide either `markdown_doc` or `updates`, not both.\n\n**Typical round-trip edit flow:**\n\n1. Call `kairos_dump(uri)` to retrieve the current `markdown_doc`.\n2. Edit the markdown.\n3. Call `kairos_update({ uris: [uri], markdown_doc: [edited_markdown] })`.\n\n**Response:** Updated memory URI(s) and confirmation.\n\n**MUST ALWAYS**\n\n- Resolve the target URI before calling `kairos_update`.\n- Provide one `markdown_doc` entry per URI in `uris` when using\n `markdown_doc` mode.\n\n**MUST NEVER**\n\n- Update a URI you have not resolved or verified.\n- Mix `markdown_doc` and `updates` in the same call.\n"
30
+ },
31
+ "mem": {}
32
+ };
33
+ /**
34
+ * Get prompts object
35
+ */
36
+ export function getPrompts() {
37
+ return mcpResources.prompts || {};
38
+ }
39
+ /**
40
+ * Get resources object
41
+ */
42
+ export function getResources() {
43
+ return mcpResources.resources || {};
44
+ }
45
+ /**
46
+ * Get templates object
47
+ */
48
+ export function getTemplates() {
49
+ return mcpResources.templates || {};
50
+ }
51
+ /**
52
+ * Get tools object
53
+ */
54
+ export function getTools() {
55
+ return mcpResources.tools || {};
56
+ }
57
+ /**
58
+ * Get mem object
59
+ */
60
+ export function getMem() {
61
+ return mcpResources.mem || {};
62
+ }
63
+ /**
64
+ * Get a prompt by key (e.g. 'contextual-prompt')
65
+ */
66
+ export function getPrompt(key) {
67
+ const prompts = (mcpResources.prompts || {});
68
+ return prompts[key];
69
+ }
70
+ /**
71
+ * Get a resource by key (e.g. 'TEST', 'doc.TEST', 'mem.<uuid>')
72
+ */
73
+ export function getResource(key) {
74
+ const resources = (mcpResources.resources || {});
75
+ const parts = key.split('.');
76
+ let current = resources;
77
+ for (const part of parts) {
78
+ if (current && typeof current === 'object') {
79
+ current = current[part];
80
+ }
81
+ else {
82
+ return undefined;
83
+ }
84
+ }
85
+ return current;
86
+ }
87
+ /**
88
+ * Get a template by key (e.g. 'kairos-memory')
89
+ */
90
+ export function getTemplate(key) {
91
+ const templates = (mcpResources.templates || {});
92
+ return templates[key];
93
+ }
94
+ /**
95
+ * Get a tool doc by key (e.g. 'kairos_begin')
96
+ */
97
+ export function getToolDoc(key) {
98
+ const tools = (mcpResources.tools || {});
99
+ return tools[key];
100
+ }
101
+ /**
102
+ * Get all available resource categories and names
103
+ */
104
+ export function listResourceKeys() {
105
+ const prompts = Object.keys((mcpResources.prompts || {}));
106
+ const resources = collectAllKeys((mcpResources.resources || {}));
107
+ const templates = Object.keys((mcpResources.templates || {}));
108
+ const tools = Object.keys((mcpResources.tools || {}));
109
+ const result = { prompts, resources, templates, tools };
110
+ // Add any other top-level categories
111
+ for (const [key, value] of Object.entries(mcpResources)) {
112
+ if (!['prompts', 'resources', 'templates', 'tools'].includes(key)) {
113
+ if (typeof value === 'object' && value !== null) {
114
+ result[key] = Object.keys(value);
115
+ }
116
+ }
117
+ }
118
+ return result;
119
+ }
120
+ function collectAllKeys(obj, prefix = '', keys = []) {
121
+ for (const [key, value] of Object.entries(obj)) {
122
+ const fullKey = prefix ? `${prefix}.${key}` : key;
123
+ if (typeof value === 'string') {
124
+ keys.push(fullKey);
125
+ }
126
+ else if (typeof value === 'object' && value !== null) {
127
+ collectAllKeys(value, fullKey, keys);
128
+ }
129
+ }
130
+ return keys;
131
+ }
132
+ //# sourceMappingURL=embedded-mcp-resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedded-mcp-resources.js","sourceRoot":"","sources":["../../src/resources/embedded-mcp-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE;QACT,mBAAmB,EAAE,6/FAA6/F;KACnhG;IACD,WAAW,EAAE;QACX,2BAA2B,EAAE,+8RAA+8R;KAC7+R;IACD,WAAW,EAAE;QACX,eAAe,EAAE,y6CAAy6C;KAC37C;IACD,OAAO,EAAE;QACP,eAAe,EAAE,q9BAAq9B;QACt+B,cAAc,EAAE,m3DAAm3D;QACn4D,eAAe,EAAE,4kBAA4kB;QAC7lB,aAAa,EAAE,qmCAAqmC;QACpnC,aAAa,EAAE,mwEAAmwE;QAClxE,aAAa,EAAE,y1FAAy1F;QACx2F,eAAe,EAAE,48DAA48D;QAC79D,eAAe,EAAE,43BAA43B;QAC74B,eAAe,EAAE,yoCAAyoC;KAC3pC;IACD,KAAK,EAAE,EAAE;CACV,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,YAAY,CAAC,OAAO,IAAI,EAAE,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,YAAY,CAAC,GAAG,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,MAAM,OAAO,GAAG,CAAC,YAAY,CAA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,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { MemoryQdrantStore } from '../services/memory/store.js';
2
+ /**
3
+ * Inject mem resources from filesystem into Qdrant at system boot
4
+ * Uses the key (filename) as the UUID and supports force option for override
5
+ * Uses storeChain for processing but updates UUID to match filename
6
+ */
7
+ export declare function injectMemResourcesAtBoot(memoryStore: MemoryQdrantStore, options?: {
8
+ force?: boolean;
9
+ }): Promise<void>;
10
+ //# sourceMappingURL=mem-resources-boot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mem-resources-boot.d.ts","sourceRoot":"","sources":["../../src/resources/mem-resources-boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAkEhE;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,iBAAiB,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA0G/H"}