@revealui/ai 0.0.0-canary-20260409021642

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 (444) hide show
  1. package/LICENSE +109 -0
  2. package/README.md +317 -0
  3. package/dist/a2a/card.d.ts +26 -0
  4. package/dist/a2a/card.d.ts.map +1 -0
  5. package/dist/a2a/card.js +173 -0
  6. package/dist/a2a/handler.d.ts +26 -0
  7. package/dist/a2a/handler.d.ts.map +1 -0
  8. package/dist/a2a/handler.js +170 -0
  9. package/dist/a2a/index.d.ts +10 -0
  10. package/dist/a2a/index.d.ts.map +1 -0
  11. package/dist/a2a/index.js +9 -0
  12. package/dist/a2a/task-store.d.ts +42 -0
  13. package/dist/a2a/task-store.d.ts.map +1 -0
  14. package/dist/a2a/task-store.js +99 -0
  15. package/dist/audit/emitter.d.ts +34 -0
  16. package/dist/audit/emitter.d.ts.map +1 -0
  17. package/dist/audit/emitter.js +34 -0
  18. package/dist/audit/index.d.ts +44 -0
  19. package/dist/audit/index.d.ts.map +1 -0
  20. package/dist/audit/index.js +48 -0
  21. package/dist/audit/observer.d.ts +108 -0
  22. package/dist/audit/observer.d.ts.map +1 -0
  23. package/dist/audit/observer.js +271 -0
  24. package/dist/audit/policy.d.ts +70 -0
  25. package/dist/audit/policy.d.ts.map +1 -0
  26. package/dist/audit/policy.js +209 -0
  27. package/dist/audit/store.d.ts +42 -0
  28. package/dist/audit/store.d.ts.map +1 -0
  29. package/dist/audit/store.js +80 -0
  30. package/dist/audit/types.d.ts +169 -0
  31. package/dist/audit/types.d.ts.map +1 -0
  32. package/dist/audit/types.js +80 -0
  33. package/dist/client/hooks/index.d.ts +22 -0
  34. package/dist/client/hooks/index.d.ts.map +1 -0
  35. package/dist/client/hooks/index.js +21 -0
  36. package/dist/client/hooks/useAgentContext.d.ts +30 -0
  37. package/dist/client/hooks/useAgentContext.d.ts.map +1 -0
  38. package/dist/client/hooks/useAgentContext.js +161 -0
  39. package/dist/client/hooks/useAgentEvents.d.ts +126 -0
  40. package/dist/client/hooks/useAgentEvents.d.ts.map +1 -0
  41. package/dist/client/hooks/useAgentEvents.js +232 -0
  42. package/dist/client/hooks/useAgentStream.d.ts +44 -0
  43. package/dist/client/hooks/useAgentStream.d.ts.map +1 -0
  44. package/dist/client/hooks/useAgentStream.js +101 -0
  45. package/dist/client/hooks/useEpisodicMemory.d.ts +25 -0
  46. package/dist/client/hooks/useEpisodicMemory.d.ts.map +1 -0
  47. package/dist/client/hooks/useEpisodicMemory.js +174 -0
  48. package/dist/client/hooks/useWorkingMemory.d.ts +57 -0
  49. package/dist/client/hooks/useWorkingMemory.d.ts.map +1 -0
  50. package/dist/client/hooks/useWorkingMemory.js +276 -0
  51. package/dist/client/index.d.ts +14 -0
  52. package/dist/client/index.d.ts.map +1 -0
  53. package/dist/client/index.js +13 -0
  54. package/dist/embeddings/index.d.ts +51 -0
  55. package/dist/embeddings/index.d.ts.map +1 -0
  56. package/dist/embeddings/index.js +73 -0
  57. package/dist/index.d.ts +82 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +102 -0
  60. package/dist/inference/context-assembly.d.ts +27 -0
  61. package/dist/inference/context-assembly.d.ts.map +1 -0
  62. package/dist/inference/context-assembly.js +81 -0
  63. package/dist/inference/context-budget.d.ts +46 -0
  64. package/dist/inference/context-budget.d.ts.map +1 -0
  65. package/dist/inference/context-budget.js +113 -0
  66. package/dist/inference/index.d.ts +8 -0
  67. package/dist/inference/index.d.ts.map +1 -0
  68. package/dist/inference/index.js +7 -0
  69. package/dist/inference/overflow-compressor.d.ts +17 -0
  70. package/dist/inference/overflow-compressor.d.ts.map +1 -0
  71. package/dist/inference/overflow-compressor.js +40 -0
  72. package/dist/inference/runRag.d.ts +35 -0
  73. package/dist/inference/runRag.d.ts.map +1 -0
  74. package/dist/inference/runRag.js +53 -0
  75. package/dist/inference/task-decomposer.d.ts +75 -0
  76. package/dist/inference/task-decomposer.d.ts.map +1 -0
  77. package/dist/inference/task-decomposer.js +190 -0
  78. package/dist/inference/tool-result-compressor.d.ts +39 -0
  79. package/dist/inference/tool-result-compressor.d.ts.map +1 -0
  80. package/dist/inference/tool-result-compressor.js +180 -0
  81. package/dist/ingestion/bm25.d.ts +29 -0
  82. package/dist/ingestion/bm25.d.ts.map +1 -0
  83. package/dist/ingestion/bm25.js +161 -0
  84. package/dist/ingestion/cms-indexer.d.ts +39 -0
  85. package/dist/ingestion/cms-indexer.d.ts.map +1 -0
  86. package/dist/ingestion/cms-indexer.js +74 -0
  87. package/dist/ingestion/file-parsers.d.ts +51 -0
  88. package/dist/ingestion/file-parsers.d.ts.map +1 -0
  89. package/dist/ingestion/file-parsers.js +247 -0
  90. package/dist/ingestion/hybrid-search.d.ts +22 -0
  91. package/dist/ingestion/hybrid-search.d.ts.map +1 -0
  92. package/dist/ingestion/hybrid-search.js +63 -0
  93. package/dist/ingestion/index.d.ts +9 -0
  94. package/dist/ingestion/index.d.ts.map +1 -0
  95. package/dist/ingestion/index.js +8 -0
  96. package/dist/ingestion/pipeline.d.ts +36 -0
  97. package/dist/ingestion/pipeline.d.ts.map +1 -0
  98. package/dist/ingestion/pipeline.js +119 -0
  99. package/dist/ingestion/rag-vector-service.d.ts +34 -0
  100. package/dist/ingestion/rag-vector-service.d.ts.map +1 -0
  101. package/dist/ingestion/rag-vector-service.js +98 -0
  102. package/dist/ingestion/reranker.d.ts +10 -0
  103. package/dist/ingestion/reranker.d.ts.map +1 -0
  104. package/dist/ingestion/reranker.js +41 -0
  105. package/dist/ingestion/text-splitter.d.ts +25 -0
  106. package/dist/ingestion/text-splitter.d.ts.map +1 -0
  107. package/dist/ingestion/text-splitter.js +119 -0
  108. package/dist/llm/cache-utils.d.ts +146 -0
  109. package/dist/llm/cache-utils.d.ts.map +1 -0
  110. package/dist/llm/cache-utils.js +188 -0
  111. package/dist/llm/client.d.ts +142 -0
  112. package/dist/llm/client.d.ts.map +1 -0
  113. package/dist/llm/client.js +515 -0
  114. package/dist/llm/key-validator.d.ts +25 -0
  115. package/dist/llm/key-validator.d.ts.map +1 -0
  116. package/dist/llm/key-validator.js +101 -0
  117. package/dist/llm/provider-health.d.ts +40 -0
  118. package/dist/llm/provider-health.d.ts.map +1 -0
  119. package/dist/llm/provider-health.js +97 -0
  120. package/dist/llm/providers/base.d.ts +138 -0
  121. package/dist/llm/providers/base.d.ts.map +1 -0
  122. package/dist/llm/providers/base.js +6 -0
  123. package/dist/llm/providers/bitnet.d.ts +28 -0
  124. package/dist/llm/providers/bitnet.d.ts.map +1 -0
  125. package/dist/llm/providers/bitnet.js +36 -0
  126. package/dist/llm/providers/groq.d.ts +23 -0
  127. package/dist/llm/providers/groq.d.ts.map +1 -0
  128. package/dist/llm/providers/groq.js +27 -0
  129. package/dist/llm/providers/inference-snaps.d.ts +44 -0
  130. package/dist/llm/providers/inference-snaps.d.ts.map +1 -0
  131. package/dist/llm/providers/inference-snaps.js +65 -0
  132. package/dist/llm/providers/ollama.d.ts +27 -0
  133. package/dist/llm/providers/ollama.d.ts.map +1 -0
  134. package/dist/llm/providers/ollama.js +48 -0
  135. package/dist/llm/providers/openai-compat.d.ts +20 -0
  136. package/dist/llm/providers/openai-compat.d.ts.map +1 -0
  137. package/dist/llm/providers/openai-compat.js +243 -0
  138. package/dist/llm/providers/vultr.d.ts +18 -0
  139. package/dist/llm/providers/vultr.d.ts.map +1 -0
  140. package/dist/llm/providers/vultr.js +169 -0
  141. package/dist/llm/response-cache.d.ts +166 -0
  142. package/dist/llm/response-cache.d.ts.map +1 -0
  143. package/dist/llm/response-cache.js +233 -0
  144. package/dist/llm/semantic-cache.d.ts +179 -0
  145. package/dist/llm/semantic-cache.d.ts.map +1 -0
  146. package/dist/llm/semantic-cache.js +314 -0
  147. package/dist/llm/server.d.ts +15 -0
  148. package/dist/llm/server.d.ts.map +1 -0
  149. package/dist/llm/server.js +16 -0
  150. package/dist/llm/token-counter.d.ts +48 -0
  151. package/dist/llm/token-counter.d.ts.map +1 -0
  152. package/dist/llm/token-counter.js +77 -0
  153. package/dist/llm/workspace-provider-config.d.ts +38 -0
  154. package/dist/llm/workspace-provider-config.d.ts.map +1 -0
  155. package/dist/llm/workspace-provider-config.js +47 -0
  156. package/dist/memory/agent/context-manager.d.ts +148 -0
  157. package/dist/memory/agent/context-manager.d.ts.map +1 -0
  158. package/dist/memory/agent/context-manager.js +284 -0
  159. package/dist/memory/agent/index.d.ts +7 -0
  160. package/dist/memory/agent/index.d.ts.map +1 -0
  161. package/dist/memory/agent/index.js +6 -0
  162. package/dist/memory/crdt/index.d.ts +13 -0
  163. package/dist/memory/crdt/index.d.ts.map +1 -0
  164. package/dist/memory/crdt/index.js +12 -0
  165. package/dist/memory/crdt/lww-register.d.ts +108 -0
  166. package/dist/memory/crdt/lww-register.d.ts.map +1 -0
  167. package/dist/memory/crdt/lww-register.js +169 -0
  168. package/dist/memory/crdt/or-set.d.ts +141 -0
  169. package/dist/memory/crdt/or-set.d.ts.map +1 -0
  170. package/dist/memory/crdt/or-set.js +291 -0
  171. package/dist/memory/crdt/pn-counter.d.ts +116 -0
  172. package/dist/memory/crdt/pn-counter.d.ts.map +1 -0
  173. package/dist/memory/crdt/pn-counter.js +174 -0
  174. package/dist/memory/crdt/vector-clock.d.ts +115 -0
  175. package/dist/memory/crdt/vector-clock.d.ts.map +1 -0
  176. package/dist/memory/crdt/vector-clock.js +179 -0
  177. package/dist/memory/errors/index.d.ts +56 -0
  178. package/dist/memory/errors/index.d.ts.map +1 -0
  179. package/dist/memory/errors/index.js +85 -0
  180. package/dist/memory/index.d.ts +21 -0
  181. package/dist/memory/index.d.ts.map +1 -0
  182. package/dist/memory/index.js +20 -0
  183. package/dist/memory/persistence/crdt-persistence.d.ts +85 -0
  184. package/dist/memory/persistence/crdt-persistence.d.ts.map +1 -0
  185. package/dist/memory/persistence/crdt-persistence.js +201 -0
  186. package/dist/memory/persistence/index.d.ts +7 -0
  187. package/dist/memory/persistence/index.d.ts.map +1 -0
  188. package/dist/memory/persistence/index.js +6 -0
  189. package/dist/memory/preferences/index.d.ts +7 -0
  190. package/dist/memory/preferences/index.d.ts.map +1 -0
  191. package/dist/memory/preferences/index.js +6 -0
  192. package/dist/memory/preferences/user-preferences-manager.d.ts +133 -0
  193. package/dist/memory/preferences/user-preferences-manager.d.ts.map +1 -0
  194. package/dist/memory/preferences/user-preferences-manager.js +342 -0
  195. package/dist/memory/services/index.d.ts +8 -0
  196. package/dist/memory/services/index.d.ts.map +1 -0
  197. package/dist/memory/services/index.js +6 -0
  198. package/dist/memory/services/node-id-service.d.ts +75 -0
  199. package/dist/memory/services/node-id-service.d.ts.map +1 -0
  200. package/dist/memory/services/node-id-service.js +190 -0
  201. package/dist/memory/stores/episodic-memory.d.ts +182 -0
  202. package/dist/memory/stores/episodic-memory.d.ts.map +1 -0
  203. package/dist/memory/stores/episodic-memory.js +379 -0
  204. package/dist/memory/stores/index.d.ts +16 -0
  205. package/dist/memory/stores/index.d.ts.map +1 -0
  206. package/dist/memory/stores/index.js +15 -0
  207. package/dist/memory/stores/procedural-memory.d.ts +89 -0
  208. package/dist/memory/stores/procedural-memory.d.ts.map +1 -0
  209. package/dist/memory/stores/procedural-memory.js +152 -0
  210. package/dist/memory/stores/semantic-memory.d.ts +92 -0
  211. package/dist/memory/stores/semantic-memory.d.ts.map +1 -0
  212. package/dist/memory/stores/semantic-memory.js +155 -0
  213. package/dist/memory/stores/working-memory.d.ts +225 -0
  214. package/dist/memory/stores/working-memory.d.ts.map +1 -0
  215. package/dist/memory/stores/working-memory.js +336 -0
  216. package/dist/memory/utils/deep-clone.d.ts +10 -0
  217. package/dist/memory/utils/deep-clone.d.ts.map +1 -0
  218. package/dist/memory/utils/deep-clone.js +9 -0
  219. package/dist/memory/utils/index.d.ts +7 -0
  220. package/dist/memory/utils/index.d.ts.map +1 -0
  221. package/dist/memory/utils/index.js +6 -0
  222. package/dist/memory/utils/sql-helpers.d.ts +97 -0
  223. package/dist/memory/utils/sql-helpers.d.ts.map +1 -0
  224. package/dist/memory/utils/sql-helpers.js +214 -0
  225. package/dist/memory/utils/validation.d.ts +62 -0
  226. package/dist/memory/utils/validation.d.ts.map +1 -0
  227. package/dist/memory/utils/validation.js +246 -0
  228. package/dist/memory/vector/index.d.ts +12 -0
  229. package/dist/memory/vector/index.d.ts.map +1 -0
  230. package/dist/memory/vector/index.js +14 -0
  231. package/dist/memory/vector/vector-memory-service.d.ts +91 -0
  232. package/dist/memory/vector/vector-memory-service.d.ts.map +1 -0
  233. package/dist/memory/vector/vector-memory-service.js +348 -0
  234. package/dist/observability/logger.d.ts +79 -0
  235. package/dist/observability/logger.d.ts.map +1 -0
  236. package/dist/observability/logger.js +165 -0
  237. package/dist/observability/metrics.d.ts +43 -0
  238. package/dist/observability/metrics.d.ts.map +1 -0
  239. package/dist/observability/metrics.js +197 -0
  240. package/dist/observability/query.d.ts +150 -0
  241. package/dist/observability/query.d.ts.map +1 -0
  242. package/dist/observability/query.js +339 -0
  243. package/dist/observability/types.d.ts +140 -0
  244. package/dist/observability/types.d.ts.map +1 -0
  245. package/dist/observability/types.js +6 -0
  246. package/dist/orchestration/agent.d.ts +98 -0
  247. package/dist/orchestration/agent.d.ts.map +1 -0
  248. package/dist/orchestration/agent.js +6 -0
  249. package/dist/orchestration/defaults.d.ts +21 -0
  250. package/dist/orchestration/defaults.d.ts.map +1 -0
  251. package/dist/orchestration/defaults.js +22 -0
  252. package/dist/orchestration/memory-integration.d.ts +58 -0
  253. package/dist/orchestration/memory-integration.d.ts.map +1 -0
  254. package/dist/orchestration/memory-integration.js +130 -0
  255. package/dist/orchestration/orchestrator.d.ts +67 -0
  256. package/dist/orchestration/orchestrator.d.ts.map +1 -0
  257. package/dist/orchestration/orchestrator.js +174 -0
  258. package/dist/orchestration/runtime.d.ts +106 -0
  259. package/dist/orchestration/runtime.d.ts.map +1 -0
  260. package/dist/orchestration/runtime.js +317 -0
  261. package/dist/orchestration/streaming-runtime.d.ts +36 -0
  262. package/dist/orchestration/streaming-runtime.d.ts.map +1 -0
  263. package/dist/orchestration/streaming-runtime.js +182 -0
  264. package/dist/orchestration/ticket-agent.d.ts +70 -0
  265. package/dist/orchestration/ticket-agent.d.ts.map +1 -0
  266. package/dist/orchestration/ticket-agent.js +148 -0
  267. package/dist/skills/activation/index.d.ts +7 -0
  268. package/dist/skills/activation/index.d.ts.map +1 -0
  269. package/dist/skills/activation/index.js +6 -0
  270. package/dist/skills/activation/skill-activator.d.ts +68 -0
  271. package/dist/skills/activation/skill-activator.d.ts.map +1 -0
  272. package/dist/skills/activation/skill-activator.js +224 -0
  273. package/dist/skills/catalog/catalog-search.d.ts +55 -0
  274. package/dist/skills/catalog/catalog-search.d.ts.map +1 -0
  275. package/dist/skills/catalog/catalog-search.js +111 -0
  276. package/dist/skills/catalog/catalog-types.d.ts +81 -0
  277. package/dist/skills/catalog/catalog-types.d.ts.map +1 -0
  278. package/dist/skills/catalog/catalog-types.js +66 -0
  279. package/dist/skills/catalog/index.d.ts +9 -0
  280. package/dist/skills/catalog/index.d.ts.map +1 -0
  281. package/dist/skills/catalog/index.js +7 -0
  282. package/dist/skills/catalog/vercel-catalog.d.ts +42 -0
  283. package/dist/skills/catalog/vercel-catalog.d.ts.map +1 -0
  284. package/dist/skills/catalog/vercel-catalog.js +189 -0
  285. package/dist/skills/compat/index.d.ts +9 -0
  286. package/dist/skills/compat/index.d.ts.map +1 -0
  287. package/dist/skills/compat/index.js +8 -0
  288. package/dist/skills/compat/skill-enhancer.d.ts +37 -0
  289. package/dist/skills/compat/skill-enhancer.d.ts.map +1 -0
  290. package/dist/skills/compat/skill-enhancer.js +76 -0
  291. package/dist/skills/compat/tool-mapper.d.ts +61 -0
  292. package/dist/skills/compat/tool-mapper.d.ts.map +1 -0
  293. package/dist/skills/compat/tool-mapper.js +168 -0
  294. package/dist/skills/compat/vercel-compat.d.ts +33 -0
  295. package/dist/skills/compat/vercel-compat.d.ts.map +1 -0
  296. package/dist/skills/compat/vercel-compat.js +132 -0
  297. package/dist/skills/index.d.ts +40 -0
  298. package/dist/skills/index.d.ts.map +1 -0
  299. package/dist/skills/index.js +47 -0
  300. package/dist/skills/integration/agent-skill-provider.d.ts +94 -0
  301. package/dist/skills/integration/agent-skill-provider.d.ts.map +1 -0
  302. package/dist/skills/integration/agent-skill-provider.js +161 -0
  303. package/dist/skills/integration/index.d.ts +7 -0
  304. package/dist/skills/integration/index.d.ts.map +1 -0
  305. package/dist/skills/integration/index.js +6 -0
  306. package/dist/skills/loader/github-loader.d.ts +61 -0
  307. package/dist/skills/loader/github-loader.d.ts.map +1 -0
  308. package/dist/skills/loader/github-loader.js +195 -0
  309. package/dist/skills/loader/index.d.ts +10 -0
  310. package/dist/skills/loader/index.d.ts.map +1 -0
  311. package/dist/skills/loader/index.js +9 -0
  312. package/dist/skills/loader/local-loader.d.ts +56 -0
  313. package/dist/skills/loader/local-loader.d.ts.map +1 -0
  314. package/dist/skills/loader/local-loader.js +186 -0
  315. package/dist/skills/loader/vercel-loader.d.ts +64 -0
  316. package/dist/skills/loader/vercel-loader.d.ts.map +1 -0
  317. package/dist/skills/loader/vercel-loader.js +331 -0
  318. package/dist/skills/loader/vercel-types.d.ts +64 -0
  319. package/dist/skills/loader/vercel-types.d.ts.map +1 -0
  320. package/dist/skills/loader/vercel-types.js +55 -0
  321. package/dist/skills/parser/index.d.ts +7 -0
  322. package/dist/skills/parser/index.d.ts.map +1 -0
  323. package/dist/skills/parser/index.js +6 -0
  324. package/dist/skills/parser/skill-md-parser.d.ts +64 -0
  325. package/dist/skills/parser/skill-md-parser.d.ts.map +1 -0
  326. package/dist/skills/parser/skill-md-parser.js +242 -0
  327. package/dist/skills/registry/index.d.ts +7 -0
  328. package/dist/skills/registry/index.d.ts.map +1 -0
  329. package/dist/skills/registry/index.js +6 -0
  330. package/dist/skills/registry/skill-registry.d.ts +133 -0
  331. package/dist/skills/registry/skill-registry.d.ts.map +1 -0
  332. package/dist/skills/registry/skill-registry.js +373 -0
  333. package/dist/skills/types.d.ts +216 -0
  334. package/dist/skills/types.d.ts.map +1 -0
  335. package/dist/skills/types.js +176 -0
  336. package/dist/templates/agent-spec.d.ts +138 -0
  337. package/dist/templates/agent-spec.d.ts.map +1 -0
  338. package/dist/templates/agent-spec.js +138 -0
  339. package/dist/templates/index.d.ts +56 -0
  340. package/dist/templates/index.d.ts.map +1 -0
  341. package/dist/templates/index.js +58 -0
  342. package/dist/templates/prompt-spec.d.ts +140 -0
  343. package/dist/templates/prompt-spec.d.ts.map +1 -0
  344. package/dist/templates/prompt-spec.js +210 -0
  345. package/dist/templates/skill-spec.d.ts +106 -0
  346. package/dist/templates/skill-spec.d.ts.map +1 -0
  347. package/dist/templates/skill-spec.js +119 -0
  348. package/dist/tools/base.d.ts +107 -0
  349. package/dist/tools/base.d.ts.map +1 -0
  350. package/dist/tools/base.js +6 -0
  351. package/dist/tools/cms/collection-tools.d.ts +36 -0
  352. package/dist/tools/cms/collection-tools.d.ts.map +1 -0
  353. package/dist/tools/cms/collection-tools.js +178 -0
  354. package/dist/tools/cms/factory.d.ts +89 -0
  355. package/dist/tools/cms/factory.d.ts.map +1 -0
  356. package/dist/tools/cms/factory.js +462 -0
  357. package/dist/tools/cms/global-tools.d.ts +21 -0
  358. package/dist/tools/cms/global-tools.d.ts.map +1 -0
  359. package/dist/tools/cms/global-tools.js +92 -0
  360. package/dist/tools/cms/index.d.ts +11 -0
  361. package/dist/tools/cms/index.d.ts.map +1 -0
  362. package/dist/tools/cms/index.js +11 -0
  363. package/dist/tools/cms/media-tools.d.ts +31 -0
  364. package/dist/tools/cms/media-tools.d.ts.map +1 -0
  365. package/dist/tools/cms/media-tools.js +140 -0
  366. package/dist/tools/cms/user-tools.d.ts +31 -0
  367. package/dist/tools/cms/user-tools.d.ts.map +1 -0
  368. package/dist/tools/cms/user-tools.js +135 -0
  369. package/dist/tools/coding/file-edit.d.ts +6 -0
  370. package/dist/tools/coding/file-edit.d.ts.map +1 -0
  371. package/dist/tools/coding/file-edit.js +73 -0
  372. package/dist/tools/coding/file-glob.d.ts +6 -0
  373. package/dist/tools/coding/file-glob.d.ts.map +1 -0
  374. package/dist/tools/coding/file-glob.js +120 -0
  375. package/dist/tools/coding/file-grep.d.ts +6 -0
  376. package/dist/tools/coding/file-grep.d.ts.map +1 -0
  377. package/dist/tools/coding/file-grep.js +194 -0
  378. package/dist/tools/coding/file-read.d.ts +6 -0
  379. package/dist/tools/coding/file-read.d.ts.map +1 -0
  380. package/dist/tools/coding/file-read.js +69 -0
  381. package/dist/tools/coding/file-write.d.ts +6 -0
  382. package/dist/tools/coding/file-write.d.ts.map +1 -0
  383. package/dist/tools/coding/file-write.js +49 -0
  384. package/dist/tools/coding/git-ops.d.ts +6 -0
  385. package/dist/tools/coding/git-ops.d.ts.map +1 -0
  386. package/dist/tools/coding/git-ops.js +102 -0
  387. package/dist/tools/coding/index.d.ts +40 -0
  388. package/dist/tools/coding/index.d.ts.map +1 -0
  389. package/dist/tools/coding/index.js +62 -0
  390. package/dist/tools/coding/lint-fix.d.ts +9 -0
  391. package/dist/tools/coding/lint-fix.d.ts.map +1 -0
  392. package/dist/tools/coding/lint-fix.js +256 -0
  393. package/dist/tools/coding/project-context.d.ts +6 -0
  394. package/dist/tools/coding/project-context.d.ts.map +1 -0
  395. package/dist/tools/coding/project-context.js +126 -0
  396. package/dist/tools/coding/safety.d.ts +26 -0
  397. package/dist/tools/coding/safety.d.ts.map +1 -0
  398. package/dist/tools/coding/safety.js +104 -0
  399. package/dist/tools/coding/shell-exec.d.ts +6 -0
  400. package/dist/tools/coding/shell-exec.d.ts.map +1 -0
  401. package/dist/tools/coding/shell-exec.js +79 -0
  402. package/dist/tools/coding/test-runner.d.ts +10 -0
  403. package/dist/tools/coding/test-runner.d.ts.map +1 -0
  404. package/dist/tools/coding/test-runner.js +214 -0
  405. package/dist/tools/deduplicator.d.ts +19 -0
  406. package/dist/tools/deduplicator.d.ts.map +1 -0
  407. package/dist/tools/deduplicator.js +53 -0
  408. package/dist/tools/document-summarizer.d.ts +11 -0
  409. package/dist/tools/document-summarizer.d.ts.map +1 -0
  410. package/dist/tools/document-summarizer.js +82 -0
  411. package/dist/tools/mcp-adapter.d.ts +66 -0
  412. package/dist/tools/mcp-adapter.d.ts.map +1 -0
  413. package/dist/tools/mcp-adapter.js +152 -0
  414. package/dist/tools/memory/index.d.ts +3 -0
  415. package/dist/tools/memory/index.d.ts.map +1 -0
  416. package/dist/tools/memory/index.js +1 -0
  417. package/dist/tools/memory/store-memory.d.ts +39 -0
  418. package/dist/tools/memory/store-memory.d.ts.map +1 -0
  419. package/dist/tools/memory/store-memory.js +94 -0
  420. package/dist/tools/registry.d.ts +14 -0
  421. package/dist/tools/registry.d.ts.map +1 -0
  422. package/dist/tools/registry.js +48 -0
  423. package/dist/tools/ticket-tools.d.ts +31 -0
  424. package/dist/tools/ticket-tools.d.ts.map +1 -0
  425. package/dist/tools/ticket-tools.js +74 -0
  426. package/dist/tools/web/duck-duck-go.d.ts +52 -0
  427. package/dist/tools/web/duck-duck-go.d.ts.map +1 -0
  428. package/dist/tools/web/duck-duck-go.js +202 -0
  429. package/dist/tools/web/exa.d.ts +34 -0
  430. package/dist/tools/web/exa.d.ts.map +1 -0
  431. package/dist/tools/web/exa.js +80 -0
  432. package/dist/tools/web/index.d.ts +6 -0
  433. package/dist/tools/web/index.d.ts.map +1 -0
  434. package/dist/tools/web/index.js +4 -0
  435. package/dist/tools/web/scraper.d.ts +9 -0
  436. package/dist/tools/web/scraper.d.ts.map +1 -0
  437. package/dist/tools/web/scraper.js +118 -0
  438. package/dist/tools/web/tavily.d.ts +32 -0
  439. package/dist/tools/web/tavily.d.ts.map +1 -0
  440. package/dist/tools/web/tavily.js +73 -0
  441. package/dist/tools/web/types.d.ts +31 -0
  442. package/dist/tools/web/types.d.ts.map +1 -0
  443. package/dist/tools/web/types.js +9 -0
  444. package/package.json +174 -0
package/LICENSE ADDED
@@ -0,0 +1,109 @@
1
+ Functional Source License, Version 1.1, MIT Future License
2
+
3
+ Abbreviation
4
+
5
+ FSL-1.1-MIT
6
+
7
+ Notice
8
+
9
+ Copyright 2025-2026 RevealUI Studio (founder@revealui.com)
10
+
11
+ Terms and Conditions
12
+
13
+ Licensor: RevealUI Studio
14
+
15
+ Licensed Work: @revealui/ai
16
+ The Licensed Work is copyright 2025-2026 RevealUI Studio.
17
+
18
+ Change Date: 2028-04-08
19
+
20
+ Change License: MIT
21
+
22
+ For information about alternative licensing arrangements for the Licensed Work,
23
+ please contact: founder@revealui.com
24
+
25
+ License text below is the Functional Source License, Version 1.1, MIT Future
26
+ License, as published at https://fsl.software/FSL-1.1-MIT.template.md
27
+
28
+ ---
29
+
30
+ ## Terms and Conditions
31
+
32
+ ### Acceptance
33
+
34
+ In order to get any license under these terms, you must agree to them as
35
+ both strict obligations and conditions to all your licenses.
36
+
37
+ ### Copyright License
38
+
39
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
40
+ non-sublicensable, non-transferable license to use, copy, distribute, make
41
+ available, and prepare derivative works of the licensed work, in each case
42
+ subject to the limitations and conditions below.
43
+
44
+ ### Limitations
45
+
46
+ You may not make the functionality of the licensed work or a modified
47
+ version available to third parties as a service, or distribute the
48
+ licensed work or a modified version in a way that makes the functionality
49
+ of the software available to third parties. Making the functionality of
50
+ the licensed work available to third parties includes, without limitation,
51
+ enabling third parties to interact with the functionality of the licensed
52
+ work remotely through a computer network, offering a service the value of
53
+ which entirely or primarily derives from the value of the licensed work,
54
+ or offering a service that accomplishes for users the primary purpose of
55
+ the licensed work or a modified version.
56
+
57
+ ### Patents
58
+
59
+ The licensor grants you a license, under any patent claims the licensor
60
+ can license, or becomes able to license, to make, have made, use, sell,
61
+ offer for sale, import and have imported the licensed work, in each case
62
+ subject to the limitations and conditions in this license. This license
63
+ does not cover any patent claims that you cause to be infringed by
64
+ modifications or additions to the licensed work. If you or your company
65
+ make any written claim that the licensed work infringes or contributes to
66
+ infringement of any patent, your patent license for the licensed work
67
+ granted under these terms ends immediately. If your company makes such a
68
+ claim, your patent license ends immediately for work on behalf of your
69
+ company.
70
+
71
+ ### Fair Use
72
+
73
+ This license is not intended to limit any right of fair use, fair
74
+ dealing, or other applicable copyright exception or limitation.
75
+
76
+ ### No Other Rights
77
+
78
+ These terms do not allow you to sublicense or transfer any of your
79
+ licenses to anyone else, or prevent the licensor from granting licenses
80
+ to anyone else. These terms do not imply any other licenses.
81
+
82
+ ### Termination
83
+
84
+ If you use the licensed work in violation of these terms, such use is
85
+ not licensed, and your licenses may be revoked if you do not cure the
86
+ violation.
87
+
88
+ The licensor may also revoke your licenses if you fail to comply with
89
+ these terms.
90
+
91
+ ### No Liability
92
+
93
+ ***As far as the law allows, the licensed work comes as is, without any
94
+ warranty or condition, and the licensor will not be liable to you for any
95
+ damages arising out of these terms or the use or nature of the licensed
96
+ work, under any kind of legal claim.***
97
+
98
+ ### Change Date
99
+
100
+ On the Change Date, or the fourth anniversary of the first publicly
101
+ available distribution of a specific version of the Licensed Work under
102
+ this License, whichever comes first, the Licensor hereby grants you
103
+ rights under the terms of the Change License, and the rights granted in
104
+ the paragraphs above terminate.
105
+
106
+ ### Change License
107
+
108
+ On the Change Date, the Licensed Work will be made available under the
109
+ Change License specified above (MIT).
package/README.md ADDED
@@ -0,0 +1,317 @@
1
+ # @revealui/ai
2
+
3
+ > **Commercial package** — requires a [RevealUI Pro license](https://revealui.com/pro). Free to install and evaluate; a license key is required for production use.
4
+
5
+
6
+ AI system for RevealUI - memory, LLM, orchestration, and tools.
7
+
8
+ ## Features
9
+
10
+ - **Memory System**: CRDT-based persistent memory (Working, Episodic, Semantic)
11
+ - **LLM Integration**: Provider abstractions for Anthropic, GROQ, Ollama, and more
12
+ - **Agent Orchestration**: Runtime and execution engine for AI agents
13
+ - **Tool Calling**: Tool registry and execution system
14
+ - **Vector Search**: Semantic search with pgvector
15
+ - **Type-safe**: Full TypeScript support
16
+ - **Performant**: Optimized for low-latency operations
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pnpm add @revealui/ai
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```typescript
27
+ import { EpisodicMemory } from '@revealui/ai/memory/stores'
28
+ import { NodeIdService } from '@revealui/ai/memory/services'
29
+ import { createClient } from '@revealui/db/client'
30
+
31
+ const db = createClient({ connectionString: process.env.POSTGRES_URL! })
32
+ const nodeIdService = new NodeIdService(db)
33
+ const nodeId = await nodeIdService.getNodeId('user', 'user-123')
34
+ const memory = new EpisodicMemory('user-123', nodeId, db)
35
+ ```
36
+
37
+ ## Testing
38
+
39
+ ⚠️ **Important**: This package has known testing limitations. See [TESTING.md](./TESTING.md) for details.
40
+
41
+ ### Quick Commands
42
+
43
+ ```bash
44
+ # Unit tests (always work)
45
+ pnpm --filter @revealui/ai test
46
+
47
+ # Integration tests (require Neon instance)
48
+ POSTGRES_URL="postgresql://..." pnpm --filter @revealui/ai test __tests__/integration
49
+
50
+ # Production validation
51
+ POSTGRES_URL="postgresql://..." ./scripts/validate-production.sh
52
+ ```
53
+
54
+ ### Testing Limitations
55
+
56
+ - ❌ Local PostgreSQL testing not possible (Neon HTTP driver limitation)
57
+ - ⚠️ Mock database tests may fail (known limitation, not a bug)
58
+
59
+ **Full documentation**: See [TESTING.md](./TESTING.md)
60
+
61
+ ## Documentation
62
+
63
+ - **[TESTING.md](./TESTING.md)**: Complete testing guide, limitations, and validation plan
64
+ - **[OBSERVABILITY.md](./OBSERVABILITY.md)**: Observability and monitoring guide
65
+ - **Source Code**: `packages/ai/src/memory/`
66
+ - **Helper Functions**: `packages/ai/src/memory/utils/sql-helpers.ts`
67
+
68
+ ## API Reference
69
+
70
+ ### Memory System
71
+
72
+ #### EpisodicMemory
73
+
74
+ Long-term memory for conversation history and agent memories.
75
+
76
+ ```typescript
77
+ import { EpisodicMemory } from '@revealui/ai/memory/stores'
78
+
79
+ const memory = new EpisodicMemory(userId, nodeId, db)
80
+ await memory.add(agentMemory)
81
+ await memory.save()
82
+ const memories = await memory.getAll()
83
+ ```
84
+
85
+ #### NodeIdService
86
+
87
+ Deterministic node IDs for CRDT operations.
88
+
89
+ ```typescript
90
+ import { NodeIdService } from '@revealui/ai/memory/services'
91
+
92
+ const nodeIdService = new NodeIdService(db)
93
+ const nodeId = await nodeIdService.getNodeId('user', 'user-123')
94
+ ```
95
+
96
+ #### CRDTPersistence
97
+
98
+ Generic adapter for saving/loading CRDT state.
99
+
100
+ ```typescript
101
+ import { CRDTPersistence } from '@revealui/ai/memory/persistence'
102
+
103
+ const persistence = new CRDTPersistence(db)
104
+ await persistence.saveCRDTState(crdtId, 'lww_register', data)
105
+ const state = await persistence.loadCRDTState(crdtId, 'lww_register')
106
+ ```
107
+
108
+ ### LLM Integration
109
+
110
+ Provider abstractions and unified client for Anthropic, GROQ, and Ollama.
111
+
112
+ ```typescript
113
+ import { LLMClient, createLLMClientFromEnv } from '@revealui/ai/llm/client'
114
+
115
+ const client = createLLMClientFromEnv()
116
+ const response = await client.chat([
117
+ { role: 'user', content: 'Hello!' }
118
+ ])
119
+ ```
120
+
121
+ #### Vultr (Vultr AI / Serverless Inference)
122
+
123
+ You can configure the client to use Vultr Serverless Inference by setting `LLM_PROVIDER=vultr` and providing the `VULTR_API_KEY` and optionally `VULTR_BASE_URL` env vars. Example:
124
+
125
+ ```
126
+ LLM_PROVIDER=vultr
127
+ VULTR_API_KEY=your_inference_api_key
128
+ VULTR_BASE_URL=https://api.vultrinference.com/v1 # optional
129
+ ```
130
+
131
+ The `VultrProvider` supports the chat and (if available for the selected model) embeddings endpoints. Streaming is attempted via the chat streaming endpoint when supported by the API.
132
+
133
+ Demo: quick test script
134
+
135
+ You can run a quick demo script that exercises chat and embeddings endpoints. From the repository root:
136
+
137
+ ```bash
138
+ # replace with real values
139
+ VULTR_API_KEY=your_key VULTR_MODEL=your-model-id ts-node packages/ai/scripts/test-vultr.ts
140
+ ```
141
+
142
+ The script prints the raw API responses and a simplified assistant output.
143
+
144
+
145
+ ### Agent Orchestration
146
+
147
+ Agent runtime and execution engine for autonomous agents.
148
+
149
+ ```typescript
150
+ import { AgentRuntime } from '@revealui/ai/orchestration/runtime'
151
+ import { AgentOrchestrator } from '@revealui/ai/orchestration/orchestrator'
152
+
153
+ const runtime = new AgentRuntime()
154
+ const orchestrator = new AgentOrchestrator()
155
+ ```
156
+
157
+ ### Tools
158
+
159
+ Tool registry and execution system with MCP integration.
160
+
161
+ ```typescript
162
+ import { ToolRegistry } from '@revealui/ai/tools/registry'
163
+ import { registerMCPTools } from '@revealui/ai/tools/mcp-adapter'
164
+
165
+ const registry = new ToolRegistry()
166
+ await registerMCPTools(mcpClient, registry)
167
+ ```
168
+
169
+ ## Performance Considerations
170
+
171
+ The memory system uses deep cloning to ensure immutability and prevent data corruption. Understanding the cloning strategy is important for performance optimization.
172
+
173
+ ### Cloning Layers
174
+
175
+ 1. **LWWRegister Level** (Core CRDT)
176
+ - `get()`: Clones object/array values on every call
177
+ - `set()`: Clones values when storing
178
+ - `merge()`: Clones winning values during merge
179
+ - `toData()`: Clones values when serializing
180
+
181
+ 2. **WorkingMemory Level**
182
+ - `getContext()`: Returns cloned context from LWWRegister
183
+ - `getContextValue()`: Returns value from cloned context (no additional cloning)
184
+ - `setContext()`: Clones entire context object
185
+ - `updateContext()`: Clones context once for multiple updates
186
+
187
+ 3. **AgentContextManager Level**
188
+ - `getContext()`: Returns value from cloned context (no additional cloning)
189
+ - `getAllContext()`: Returns cloned context from WorkingMemory
190
+ - `setContext()`: Validates then sets (cloning happens in WorkingMemory)
191
+ - `updateContext()`: Validates then updates (cloning happens in WorkingMemory)
192
+
193
+ ### Performance Implications
194
+
195
+ #### ✅ Efficient Operations
196
+
197
+ - **Single key access**: `getContext(key)` - No double cloning
198
+ - **Multiple updates**: `updateContext({ k1: v1, k2: v2 })` - Single clone
199
+ - **Primitive values**: No cloning overhead
200
+
201
+ #### ⚠️ Performance Considerations
202
+
203
+ - **Large contexts**: Every `getContext()` clones the entire context
204
+ - **Frequent updates**: Each update clones the context
205
+ - **Deep nesting**: Deep cloning is recursive and can be slow for very deep objects
206
+
207
+ ### Best Practices
208
+
209
+ **1. Batch Updates**: Use `updateContext()` for multiple changes instead of multiple `setContext()` calls
210
+
211
+ ```typescript
212
+ // ❌ Bad: Clones context 3 times
213
+ manager.setContext('key1', 'value1')
214
+ manager.setContext('key2', 'value2')
215
+ manager.setContext('key3', 'value3')
216
+
217
+ // ✅ Good: Clones context once
218
+ manager.updateContext({
219
+ key1: 'value1',
220
+ key2: 'value2',
221
+ key3: 'value3',
222
+ })
223
+ ```
224
+
225
+ **2. Cache Context**: If you need to access multiple values, get the full context once
226
+
227
+ ```typescript
228
+ // ❌ Bad: Clones context multiple times
229
+ const value1 = manager.getContext('key1')
230
+ const value2 = manager.getContext('key2')
231
+ const value3 = manager.getContext('key3')
232
+
233
+ // ✅ Good: Clone once, access multiple times
234
+ const context = manager.getAllContext()
235
+ const value1 = context.key1
236
+ const value2 = context.key2
237
+ const value3 = context.key3
238
+ ```
239
+
240
+ **3. Avoid Deep Nesting**: Keep context structure relatively flat
241
+
242
+ ```typescript
243
+ // ❌ Bad: Very deep nesting
244
+ context: {
245
+ user: {
246
+ profile: {
247
+ settings: {
248
+ theme: {
249
+ color: 'dark'
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
255
+
256
+ // ✅ Good: Flatter structure
257
+ context: {
258
+ 'user.profile.settings.theme.color': 'dark'
259
+ }
260
+ ```
261
+
262
+ **4. Use Primitives When Possible**: Primitives don't require cloning
263
+
264
+ ```typescript
265
+ // ✅ Good: Primitives are fast
266
+ manager.setContext('count', 42)
267
+ manager.setContext('name', 'John')
268
+
269
+ // ⚠️ Consider: Objects require cloning
270
+ manager.setContext('user', { name: 'John', age: 30 })
271
+ ```
272
+
273
+ ### Size Limits
274
+
275
+ The system enforces limits to prevent performance issues:
276
+
277
+ - **Max Context Keys**: 10,000 keys
278
+ - **Max Context Size**: ~10MB (approximate)
279
+ - **Max Object Depth**: 100 levels
280
+
281
+ These limits prevent:
282
+ - Memory exhaustion
283
+ - Stack overflow from deep recursion
284
+ - Performance degradation from huge objects
285
+
286
+ ### Monitoring Performance
287
+
288
+ If you experience performance issues:
289
+
290
+ 1. **Profile Context Size**: Check how large your contexts are
291
+ 2. **Monitor Clone Operations**: Count how many times contexts are cloned
292
+ 3. **Check Depth**: Ensure objects aren't too deeply nested
293
+ 4. **Review Update Patterns**: Look for opportunities to batch updates
294
+
295
+ ### Future Optimizations
296
+
297
+ Potential optimizations (not yet implemented):
298
+
299
+ - **Lazy Cloning**: Only clone when values are actually accessed
300
+ - **Structural Sharing**: Share unchanged parts of objects
301
+ - **Caching**: Cache cloned values for frequently accessed keys
302
+ - **Incremental Updates**: Only clone changed parts of context
303
+
304
+ ## Requirements
305
+
306
+ - Node.js 18+
307
+ - PostgreSQL with pgvector extension
308
+ - Neon Postgres (for production) or compatible database
309
+
310
+ ## License
311
+
312
+ Commercial — see [LICENSE.commercial](../../LICENSE.commercial)
313
+
314
+ ---
315
+
316
+ **Last Updated**: 2026-03-04
317
+ **Consolidated**: 2026-01-31 (Merged PERFORMANCE.md into this README)
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A2A Agent Card Registry
3
+ *
4
+ * In-memory registry of AgentDefinitions. Generates A2A Agent Cards on demand
5
+ * by mapping AgentDefinition → A2AAgentCard via @revealui/contracts mappers.
6
+ *
7
+ * Pre-seeded with the RevealUI platform agent ("The Creator") and the TicketAgent.
8
+ */
9
+ import type { AgentDefinition } from '@revealui/contracts';
10
+ import { type A2AAgentCard } from '@revealui/contracts';
11
+ declare class AgentCardRegistry {
12
+ private readonly defs;
13
+ constructor();
14
+ register(def: AgentDefinition): void;
15
+ unregister(agentId: string): boolean;
16
+ update(agentId: string, patch: Partial<Omit<AgentDefinition, 'id' | 'version'>>): boolean;
17
+ getDef(agentId: string): AgentDefinition | undefined;
18
+ getCard(agentId: string, baseUrl: string): A2AAgentCard | null;
19
+ listCards(baseUrl: string): A2AAgentCard[];
20
+ listDefs(): AgentDefinition[];
21
+ has(agentId: string): boolean;
22
+ }
23
+ /** Singleton registry — import and use directly */
24
+ export declare const agentCardRegistry: AgentCardRegistry;
25
+ export type { AgentDefinition };
26
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/a2a/card.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,KAAK,YAAY,EAAyB,MAAM,qBAAqB,CAAC;AAwI/E,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsC;;IAO3D,QAAQ,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAIpC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIpC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,OAAO;IAOzF,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIpD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAM9D,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE;IAI1C,QAAQ,IAAI,eAAe,EAAE;IAI7B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;CAG9B;AAED,mDAAmD;AACnD,eAAO,MAAM,iBAAiB,mBAA0B,CAAC;AAEzD,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * A2A Agent Card Registry
3
+ *
4
+ * In-memory registry of AgentDefinitions. Generates A2A Agent Cards on demand
5
+ * by mapping AgentDefinition → A2AAgentCard via @revealui/contracts mappers.
6
+ *
7
+ * Pre-seeded with the RevealUI platform agent ("The Creator") and the TicketAgent.
8
+ */
9
+ import { agentDefinitionToCard } from '@revealui/contracts';
10
+ // =============================================================================
11
+ // Built-in agent definitions
12
+ // =============================================================================
13
+ /** RevealUI platform meta-agent — "The Creator" */
14
+ const THE_CREATOR_DEF = {
15
+ id: 'revealui-creator',
16
+ version: 1,
17
+ name: 'The Creator',
18
+ description: 'The RevealUI platform agent. Scaffolds new AI agents, manages agent lifecycles, ' +
19
+ 'orchestrates multi-agent workflows, and acts as the primary interface for AI capabilities ' +
20
+ 'on the RevealUI platform.',
21
+ model: 'claude-opus-4-6',
22
+ systemPrompt: 'You are The Creator, the meta-agent for RevealUI. You design, configure, and deploy ' +
23
+ 'purpose-built AI agents for RevealUI users. You have access to agent scaffolding tools, ' +
24
+ 'the RevealUI CMS, and the billing system.',
25
+ tools: [
26
+ {
27
+ name: 'scaffoldAgent',
28
+ description: 'Scaffold a new AI agent from a template with name, capabilities, and system prompt',
29
+ parameters: {
30
+ name: { type: 'string', description: 'Agent name', required: true },
31
+ template: {
32
+ type: 'string',
33
+ description: 'Agent template',
34
+ required: true,
35
+ enum: ['content', 'code', 'support', 'analytics'],
36
+ },
37
+ description: { type: 'string', description: 'Agent description', required: true },
38
+ systemPrompt: { type: 'string', description: 'Agent system prompt', required: false },
39
+ },
40
+ destructive: false,
41
+ },
42
+ {
43
+ name: 'listAgents',
44
+ description: 'List all registered agents and their current status',
45
+ parameters: {},
46
+ destructive: false,
47
+ },
48
+ {
49
+ name: 'deployAgent',
50
+ description: 'Deploy a configured agent to the RevealUI platform',
51
+ parameters: {
52
+ agentId: { type: 'string', description: 'Agent ID to deploy', required: true },
53
+ },
54
+ destructive: false,
55
+ },
56
+ {
57
+ name: 'retireAgent',
58
+ description: 'Retire and deregister an agent from the platform',
59
+ parameters: {
60
+ agentId: { type: 'string', description: 'Agent ID to retire', required: true },
61
+ },
62
+ destructive: true,
63
+ },
64
+ ],
65
+ capabilities: ['agent-scaffolding', 'orchestration', 'lifecycle-management'],
66
+ temperature: 0.7,
67
+ maxTokens: 4096,
68
+ canDelegateToAgents: ['revealui-ticket-agent'],
69
+ };
70
+ /** RevealUI ticket / support agent */
71
+ const TICKET_AGENT_DEF = {
72
+ id: 'revealui-ticket-agent',
73
+ version: 1,
74
+ name: 'Ticket Agent',
75
+ description: 'Handles support tickets, resolves user issues, and escalates when needed. ' +
76
+ 'Uses the RevealUI CMS to create and update tickets.',
77
+ model: 'claude-sonnet-4-6',
78
+ systemPrompt: 'You are the RevealUI Ticket Agent. You help users resolve issues by creating tickets, ' +
79
+ 'searching for solutions, and escalating complex problems to the support team.',
80
+ tools: [
81
+ {
82
+ name: 'createTicket',
83
+ description: 'Create a new support ticket with title, description, priority, and board assignment',
84
+ parameters: {
85
+ title: { type: 'string', description: 'Ticket title', required: true },
86
+ description: { type: 'string', description: 'Ticket description', required: true },
87
+ priority: {
88
+ type: 'string',
89
+ description: 'Priority level',
90
+ required: false,
91
+ enum: ['low', 'medium', 'high', 'critical'],
92
+ },
93
+ boardId: { type: 'string', description: 'Board ID to assign ticket to', required: true },
94
+ },
95
+ destructive: false,
96
+ },
97
+ {
98
+ name: 'searchTickets',
99
+ description: 'Search existing tickets by keyword, status, or priority',
100
+ parameters: {
101
+ query: { type: 'string', description: 'Search query', required: true },
102
+ status: {
103
+ type: 'string',
104
+ description: 'Filter by status',
105
+ required: false,
106
+ enum: ['open', 'in-progress', 'resolved', 'closed'],
107
+ },
108
+ },
109
+ destructive: false,
110
+ },
111
+ {
112
+ name: 'updateTicketStatus',
113
+ description: 'Update the status of an existing ticket',
114
+ parameters: {
115
+ ticketId: { type: 'string', description: 'Ticket ID', required: true },
116
+ status: {
117
+ type: 'string',
118
+ description: 'New status',
119
+ required: true,
120
+ enum: ['open', 'in-progress', 'resolved', 'closed'],
121
+ },
122
+ note: { type: 'string', description: 'Status update note', required: false },
123
+ },
124
+ destructive: false,
125
+ },
126
+ ],
127
+ capabilities: ['ticket-management', 'search', 'escalation'],
128
+ temperature: 0.3,
129
+ maxTokens: 2048,
130
+ };
131
+ // =============================================================================
132
+ // Registry
133
+ // =============================================================================
134
+ class AgentCardRegistry {
135
+ defs = new Map();
136
+ constructor() {
137
+ this.register(THE_CREATOR_DEF);
138
+ this.register(TICKET_AGENT_DEF);
139
+ }
140
+ register(def) {
141
+ this.defs.set(def.id, def);
142
+ }
143
+ unregister(agentId) {
144
+ return this.defs.delete(agentId);
145
+ }
146
+ update(agentId, patch) {
147
+ const existing = this.defs.get(agentId);
148
+ if (!existing)
149
+ return false;
150
+ this.defs.set(agentId, { ...existing, ...patch });
151
+ return true;
152
+ }
153
+ getDef(agentId) {
154
+ return this.defs.get(agentId);
155
+ }
156
+ getCard(agentId, baseUrl) {
157
+ const def = this.defs.get(agentId);
158
+ if (!def)
159
+ return null;
160
+ return agentDefinitionToCard(def, baseUrl);
161
+ }
162
+ listCards(baseUrl) {
163
+ return Array.from(this.defs.values()).map((def) => agentDefinitionToCard(def, baseUrl));
164
+ }
165
+ listDefs() {
166
+ return Array.from(this.defs.values());
167
+ }
168
+ has(agentId) {
169
+ return this.defs.has(agentId);
170
+ }
171
+ }
172
+ /** Singleton registry — import and use directly */
173
+ export const agentCardRegistry = new AgentCardRegistry();
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A2A JSON-RPC Handler
3
+ *
4
+ * Dispatches A2A JSON-RPC 2.0 methods to the appropriate implementation.
5
+ * Integrates with AgentRuntime and AgentOrchestrator from @revealui/ai/orchestration.
6
+ *
7
+ * Supported methods:
8
+ * tasks/send — synchronous task execution
9
+ * tasks/get — retrieve task by ID
10
+ * tasks/cancel — cancel a running task
11
+ * tasks/sendSubscribe — (handled at route level via SSE; returns taskId here)
12
+ */
13
+ import type { A2AJsonRpcRequest, A2AJsonRpcResponse } from '@revealui/contracts';
14
+ import type { LLMClient } from '../llm/client.js';
15
+ declare const RPC_PARSE_ERROR = -32700;
16
+ declare const RPC_INVALID_REQUEST = -32600;
17
+ /**
18
+ * Handle an A2A JSON-RPC request and return a JSON-RPC response.
19
+ *
20
+ * @param req - Parsed JSON-RPC request body
21
+ * @param agentId - Optional agent ID (from X-Agent-ID header)
22
+ * @param llmClient - Optional LLM client for real inference (BYOK)
23
+ */
24
+ export declare function handleA2AJsonRpc(req: A2AJsonRpcRequest, agentId?: string, llmClient?: LLMClient): Promise<A2AJsonRpcResponse>;
25
+ export { RPC_INVALID_REQUEST, RPC_PARSE_ERROR };
26
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/a2a/handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAGnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAgBlD,QAAA,MAAM,eAAe,SAAS,CAAC;AAC/B,QAAA,MAAM,mBAAmB,SAAS,CAAC;AA0JnC;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,iBAAiB,EACtB,OAAO,CAAC,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,SAAS,GACpB,OAAO,CAAC,kBAAkB,CAAC,CAoB7B;AAED,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC"}