@revealui/ai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) hide show
  1. package/LICENSE +22 -0
  2. package/LICENSE.commercial +112 -0
  3. package/README.md +314 -0
  4. package/dist/a2a/card.d.ts +26 -0
  5. package/dist/a2a/card.d.ts.map +1 -0
  6. package/dist/a2a/card.js +173 -0
  7. package/dist/a2a/handler.d.ts +26 -0
  8. package/dist/a2a/handler.d.ts.map +1 -0
  9. package/dist/a2a/handler.js +170 -0
  10. package/dist/a2a/index.d.ts +10 -0
  11. package/dist/a2a/index.d.ts.map +1 -0
  12. package/dist/a2a/index.js +9 -0
  13. package/dist/a2a/task-store.d.ts +42 -0
  14. package/dist/a2a/task-store.d.ts.map +1 -0
  15. package/dist/a2a/task-store.js +99 -0
  16. package/dist/audit/emitter.d.ts +34 -0
  17. package/dist/audit/emitter.d.ts.map +1 -0
  18. package/dist/audit/emitter.js +34 -0
  19. package/dist/audit/index.d.ts +44 -0
  20. package/dist/audit/index.d.ts.map +1 -0
  21. package/dist/audit/index.js +48 -0
  22. package/dist/audit/observer.d.ts +108 -0
  23. package/dist/audit/observer.d.ts.map +1 -0
  24. package/dist/audit/observer.js +271 -0
  25. package/dist/audit/policy.d.ts +70 -0
  26. package/dist/audit/policy.d.ts.map +1 -0
  27. package/dist/audit/policy.js +209 -0
  28. package/dist/audit/store.d.ts +42 -0
  29. package/dist/audit/store.d.ts.map +1 -0
  30. package/dist/audit/store.js +80 -0
  31. package/dist/audit/types.d.ts +169 -0
  32. package/dist/audit/types.d.ts.map +1 -0
  33. package/dist/audit/types.js +80 -0
  34. package/dist/client/hooks/index.d.ts +22 -0
  35. package/dist/client/hooks/index.d.ts.map +1 -0
  36. package/dist/client/hooks/index.js +21 -0
  37. package/dist/client/hooks/useAgentContext.d.ts +30 -0
  38. package/dist/client/hooks/useAgentContext.d.ts.map +1 -0
  39. package/dist/client/hooks/useAgentContext.js +161 -0
  40. package/dist/client/hooks/useAgentEvents.d.ts +126 -0
  41. package/dist/client/hooks/useAgentEvents.d.ts.map +1 -0
  42. package/dist/client/hooks/useAgentEvents.js +232 -0
  43. package/dist/client/hooks/useAgentStream.d.ts +44 -0
  44. package/dist/client/hooks/useAgentStream.d.ts.map +1 -0
  45. package/dist/client/hooks/useAgentStream.js +101 -0
  46. package/dist/client/hooks/useEpisodicMemory.d.ts +25 -0
  47. package/dist/client/hooks/useEpisodicMemory.d.ts.map +1 -0
  48. package/dist/client/hooks/useEpisodicMemory.js +174 -0
  49. package/dist/client/hooks/useWorkingMemory.d.ts +57 -0
  50. package/dist/client/hooks/useWorkingMemory.d.ts.map +1 -0
  51. package/dist/client/hooks/useWorkingMemory.js +276 -0
  52. package/dist/client/index.d.ts +14 -0
  53. package/dist/client/index.d.ts.map +1 -0
  54. package/dist/client/index.js +13 -0
  55. package/dist/embeddings/index.d.ts +51 -0
  56. package/dist/embeddings/index.d.ts.map +1 -0
  57. package/dist/embeddings/index.js +73 -0
  58. package/dist/index.d.ts +83 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +103 -0
  61. package/dist/inference/context-assembly.d.ts +27 -0
  62. package/dist/inference/context-assembly.d.ts.map +1 -0
  63. package/dist/inference/context-assembly.js +81 -0
  64. package/dist/inference/overflow-compressor.d.ts +17 -0
  65. package/dist/inference/overflow-compressor.d.ts.map +1 -0
  66. package/dist/inference/overflow-compressor.js +40 -0
  67. package/dist/inference/runRag.d.ts +35 -0
  68. package/dist/inference/runRag.d.ts.map +1 -0
  69. package/dist/inference/runRag.js +53 -0
  70. package/dist/ingestion/bm25.d.ts +29 -0
  71. package/dist/ingestion/bm25.d.ts.map +1 -0
  72. package/dist/ingestion/bm25.js +161 -0
  73. package/dist/ingestion/cms-indexer.d.ts +39 -0
  74. package/dist/ingestion/cms-indexer.d.ts.map +1 -0
  75. package/dist/ingestion/cms-indexer.js +74 -0
  76. package/dist/ingestion/file-parsers.d.ts +51 -0
  77. package/dist/ingestion/file-parsers.d.ts.map +1 -0
  78. package/dist/ingestion/file-parsers.js +247 -0
  79. package/dist/ingestion/hybrid-search.d.ts +22 -0
  80. package/dist/ingestion/hybrid-search.d.ts.map +1 -0
  81. package/dist/ingestion/hybrid-search.js +63 -0
  82. package/dist/ingestion/index.d.ts +9 -0
  83. package/dist/ingestion/index.d.ts.map +1 -0
  84. package/dist/ingestion/index.js +8 -0
  85. package/dist/ingestion/pipeline.d.ts +35 -0
  86. package/dist/ingestion/pipeline.d.ts.map +1 -0
  87. package/dist/ingestion/pipeline.js +114 -0
  88. package/dist/ingestion/rag-vector-service.d.ts +34 -0
  89. package/dist/ingestion/rag-vector-service.d.ts.map +1 -0
  90. package/dist/ingestion/rag-vector-service.js +98 -0
  91. package/dist/ingestion/reranker.d.ts +10 -0
  92. package/dist/ingestion/reranker.d.ts.map +1 -0
  93. package/dist/ingestion/reranker.js +41 -0
  94. package/dist/ingestion/text-splitter.d.ts +25 -0
  95. package/dist/ingestion/text-splitter.d.ts.map +1 -0
  96. package/dist/ingestion/text-splitter.js +119 -0
  97. package/dist/llm/cache-utils.d.ts +146 -0
  98. package/dist/llm/cache-utils.d.ts.map +1 -0
  99. package/dist/llm/cache-utils.js +204 -0
  100. package/dist/llm/client.d.ts +134 -0
  101. package/dist/llm/client.d.ts.map +1 -0
  102. package/dist/llm/client.js +497 -0
  103. package/dist/llm/key-validator.d.ts +25 -0
  104. package/dist/llm/key-validator.d.ts.map +1 -0
  105. package/dist/llm/key-validator.js +101 -0
  106. package/dist/llm/provider-health.d.ts +40 -0
  107. package/dist/llm/provider-health.d.ts.map +1 -0
  108. package/dist/llm/provider-health.js +97 -0
  109. package/dist/llm/providers/anthropic.d.ts +31 -0
  110. package/dist/llm/providers/anthropic.d.ts.map +1 -0
  111. package/dist/llm/providers/anthropic.js +248 -0
  112. package/dist/llm/providers/base.d.ts +111 -0
  113. package/dist/llm/providers/base.d.ts.map +1 -0
  114. package/dist/llm/providers/base.js +6 -0
  115. package/dist/llm/providers/groq.d.ts +23 -0
  116. package/dist/llm/providers/groq.d.ts.map +1 -0
  117. package/dist/llm/providers/groq.js +27 -0
  118. package/dist/llm/providers/ollama.d.ts +27 -0
  119. package/dist/llm/providers/ollama.d.ts.map +1 -0
  120. package/dist/llm/providers/ollama.js +48 -0
  121. package/dist/llm/providers/openai.d.ts +19 -0
  122. package/dist/llm/providers/openai.d.ts.map +1 -0
  123. package/dist/llm/providers/openai.js +245 -0
  124. package/dist/llm/providers/vultr.d.ts +18 -0
  125. package/dist/llm/providers/vultr.d.ts.map +1 -0
  126. package/dist/llm/providers/vultr.js +168 -0
  127. package/dist/llm/response-cache.d.ts +166 -0
  128. package/dist/llm/response-cache.d.ts.map +1 -0
  129. package/dist/llm/response-cache.js +233 -0
  130. package/dist/llm/semantic-cache.d.ts +179 -0
  131. package/dist/llm/semantic-cache.d.ts.map +1 -0
  132. package/dist/llm/semantic-cache.js +306 -0
  133. package/dist/llm/server.d.ts +14 -0
  134. package/dist/llm/server.d.ts.map +1 -0
  135. package/dist/llm/server.js +15 -0
  136. package/dist/llm/token-counter.d.ts +48 -0
  137. package/dist/llm/token-counter.d.ts.map +1 -0
  138. package/dist/llm/token-counter.js +77 -0
  139. package/dist/llm/workspace-provider-config.d.ts +38 -0
  140. package/dist/llm/workspace-provider-config.d.ts.map +1 -0
  141. package/dist/llm/workspace-provider-config.js +47 -0
  142. package/dist/memory/agent/context-manager.d.ts +148 -0
  143. package/dist/memory/agent/context-manager.d.ts.map +1 -0
  144. package/dist/memory/agent/context-manager.js +284 -0
  145. package/dist/memory/agent/index.d.ts +7 -0
  146. package/dist/memory/agent/index.d.ts.map +1 -0
  147. package/dist/memory/agent/index.js +6 -0
  148. package/dist/memory/crdt/index.d.ts +13 -0
  149. package/dist/memory/crdt/index.d.ts.map +1 -0
  150. package/dist/memory/crdt/index.js +12 -0
  151. package/dist/memory/crdt/lww-register.d.ts +108 -0
  152. package/dist/memory/crdt/lww-register.d.ts.map +1 -0
  153. package/dist/memory/crdt/lww-register.js +169 -0
  154. package/dist/memory/crdt/or-set.d.ts +141 -0
  155. package/dist/memory/crdt/or-set.d.ts.map +1 -0
  156. package/dist/memory/crdt/or-set.js +291 -0
  157. package/dist/memory/crdt/pn-counter.d.ts +116 -0
  158. package/dist/memory/crdt/pn-counter.d.ts.map +1 -0
  159. package/dist/memory/crdt/pn-counter.js +174 -0
  160. package/dist/memory/crdt/vector-clock.d.ts +115 -0
  161. package/dist/memory/crdt/vector-clock.d.ts.map +1 -0
  162. package/dist/memory/crdt/vector-clock.js +179 -0
  163. package/dist/memory/errors/index.d.ts +56 -0
  164. package/dist/memory/errors/index.d.ts.map +1 -0
  165. package/dist/memory/errors/index.js +85 -0
  166. package/dist/memory/index.d.ts +21 -0
  167. package/dist/memory/index.d.ts.map +1 -0
  168. package/dist/memory/index.js +20 -0
  169. package/dist/memory/persistence/crdt-persistence.d.ts +85 -0
  170. package/dist/memory/persistence/crdt-persistence.d.ts.map +1 -0
  171. package/dist/memory/persistence/crdt-persistence.js +204 -0
  172. package/dist/memory/persistence/index.d.ts +7 -0
  173. package/dist/memory/persistence/index.d.ts.map +1 -0
  174. package/dist/memory/persistence/index.js +6 -0
  175. package/dist/memory/preferences/index.d.ts +7 -0
  176. package/dist/memory/preferences/index.d.ts.map +1 -0
  177. package/dist/memory/preferences/index.js +6 -0
  178. package/dist/memory/preferences/user-preferences-manager.d.ts +133 -0
  179. package/dist/memory/preferences/user-preferences-manager.d.ts.map +1 -0
  180. package/dist/memory/preferences/user-preferences-manager.js +342 -0
  181. package/dist/memory/services/index.d.ts +8 -0
  182. package/dist/memory/services/index.d.ts.map +1 -0
  183. package/dist/memory/services/index.js +6 -0
  184. package/dist/memory/services/node-id-service.d.ts +75 -0
  185. package/dist/memory/services/node-id-service.d.ts.map +1 -0
  186. package/dist/memory/services/node-id-service.js +190 -0
  187. package/dist/memory/stores/episodic-memory.d.ts +182 -0
  188. package/dist/memory/stores/episodic-memory.d.ts.map +1 -0
  189. package/dist/memory/stores/episodic-memory.js +378 -0
  190. package/dist/memory/stores/index.d.ts +16 -0
  191. package/dist/memory/stores/index.d.ts.map +1 -0
  192. package/dist/memory/stores/index.js +15 -0
  193. package/dist/memory/stores/procedural-memory.d.ts +89 -0
  194. package/dist/memory/stores/procedural-memory.d.ts.map +1 -0
  195. package/dist/memory/stores/procedural-memory.js +152 -0
  196. package/dist/memory/stores/semantic-memory.d.ts +92 -0
  197. package/dist/memory/stores/semantic-memory.d.ts.map +1 -0
  198. package/dist/memory/stores/semantic-memory.js +155 -0
  199. package/dist/memory/stores/working-memory.d.ts +225 -0
  200. package/dist/memory/stores/working-memory.d.ts.map +1 -0
  201. package/dist/memory/stores/working-memory.js +336 -0
  202. package/dist/memory/utils/deep-clone.d.ts +10 -0
  203. package/dist/memory/utils/deep-clone.d.ts.map +1 -0
  204. package/dist/memory/utils/deep-clone.js +9 -0
  205. package/dist/memory/utils/index.d.ts +8 -0
  206. package/dist/memory/utils/index.d.ts.map +1 -0
  207. package/dist/memory/utils/index.js +7 -0
  208. package/dist/memory/utils/logger.d.ts +21 -0
  209. package/dist/memory/utils/logger.d.ts.map +1 -0
  210. package/dist/memory/utils/logger.js +62 -0
  211. package/dist/memory/utils/sql-helpers.d.ts +97 -0
  212. package/dist/memory/utils/sql-helpers.d.ts.map +1 -0
  213. package/dist/memory/utils/sql-helpers.js +214 -0
  214. package/dist/memory/utils/validation.d.ts +62 -0
  215. package/dist/memory/utils/validation.d.ts.map +1 -0
  216. package/dist/memory/utils/validation.js +244 -0
  217. package/dist/memory/vector/index.d.ts +12 -0
  218. package/dist/memory/vector/index.d.ts.map +1 -0
  219. package/dist/memory/vector/index.js +14 -0
  220. package/dist/memory/vector/vector-memory-service.d.ts +88 -0
  221. package/dist/memory/vector/vector-memory-service.d.ts.map +1 -0
  222. package/dist/memory/vector/vector-memory-service.js +335 -0
  223. package/dist/observability/logger.d.ts +79 -0
  224. package/dist/observability/logger.d.ts.map +1 -0
  225. package/dist/observability/logger.js +165 -0
  226. package/dist/observability/metrics.d.ts +43 -0
  227. package/dist/observability/metrics.d.ts.map +1 -0
  228. package/dist/observability/metrics.js +197 -0
  229. package/dist/observability/query.d.ts +150 -0
  230. package/dist/observability/query.d.ts.map +1 -0
  231. package/dist/observability/query.js +339 -0
  232. package/dist/observability/types.d.ts +140 -0
  233. package/dist/observability/types.d.ts.map +1 -0
  234. package/dist/observability/types.js +6 -0
  235. package/dist/orchestration/agent.d.ts +98 -0
  236. package/dist/orchestration/agent.d.ts.map +1 -0
  237. package/dist/orchestration/agent.js +6 -0
  238. package/dist/orchestration/defaults.d.ts +21 -0
  239. package/dist/orchestration/defaults.d.ts.map +1 -0
  240. package/dist/orchestration/defaults.js +22 -0
  241. package/dist/orchestration/memory-integration.d.ts +58 -0
  242. package/dist/orchestration/memory-integration.d.ts.map +1 -0
  243. package/dist/orchestration/memory-integration.js +130 -0
  244. package/dist/orchestration/orchestrator.d.ts +67 -0
  245. package/dist/orchestration/orchestrator.d.ts.map +1 -0
  246. package/dist/orchestration/orchestrator.js +174 -0
  247. package/dist/orchestration/runtime.d.ts +82 -0
  248. package/dist/orchestration/runtime.d.ts.map +1 -0
  249. package/dist/orchestration/runtime.js +251 -0
  250. package/dist/orchestration/streaming-runtime.d.ts +36 -0
  251. package/dist/orchestration/streaming-runtime.d.ts.map +1 -0
  252. package/dist/orchestration/streaming-runtime.js +175 -0
  253. package/dist/orchestration/ticket-agent.d.ts +70 -0
  254. package/dist/orchestration/ticket-agent.d.ts.map +1 -0
  255. package/dist/orchestration/ticket-agent.js +146 -0
  256. package/dist/skills/activation/index.d.ts +7 -0
  257. package/dist/skills/activation/index.d.ts.map +1 -0
  258. package/dist/skills/activation/index.js +6 -0
  259. package/dist/skills/activation/skill-activator.d.ts +68 -0
  260. package/dist/skills/activation/skill-activator.d.ts.map +1 -0
  261. package/dist/skills/activation/skill-activator.js +224 -0
  262. package/dist/skills/catalog/catalog-search.d.ts +55 -0
  263. package/dist/skills/catalog/catalog-search.d.ts.map +1 -0
  264. package/dist/skills/catalog/catalog-search.js +111 -0
  265. package/dist/skills/catalog/catalog-types.d.ts +81 -0
  266. package/dist/skills/catalog/catalog-types.d.ts.map +1 -0
  267. package/dist/skills/catalog/catalog-types.js +66 -0
  268. package/dist/skills/catalog/index.d.ts +9 -0
  269. package/dist/skills/catalog/index.d.ts.map +1 -0
  270. package/dist/skills/catalog/index.js +7 -0
  271. package/dist/skills/catalog/vercel-catalog.d.ts +42 -0
  272. package/dist/skills/catalog/vercel-catalog.d.ts.map +1 -0
  273. package/dist/skills/catalog/vercel-catalog.js +189 -0
  274. package/dist/skills/compat/index.d.ts +9 -0
  275. package/dist/skills/compat/index.d.ts.map +1 -0
  276. package/dist/skills/compat/index.js +8 -0
  277. package/dist/skills/compat/skill-enhancer.d.ts +37 -0
  278. package/dist/skills/compat/skill-enhancer.d.ts.map +1 -0
  279. package/dist/skills/compat/skill-enhancer.js +76 -0
  280. package/dist/skills/compat/tool-mapper.d.ts +61 -0
  281. package/dist/skills/compat/tool-mapper.d.ts.map +1 -0
  282. package/dist/skills/compat/tool-mapper.js +168 -0
  283. package/dist/skills/compat/vercel-compat.d.ts +33 -0
  284. package/dist/skills/compat/vercel-compat.d.ts.map +1 -0
  285. package/dist/skills/compat/vercel-compat.js +132 -0
  286. package/dist/skills/index.d.ts +40 -0
  287. package/dist/skills/index.d.ts.map +1 -0
  288. package/dist/skills/index.js +47 -0
  289. package/dist/skills/integration/agent-skill-provider.d.ts +94 -0
  290. package/dist/skills/integration/agent-skill-provider.d.ts.map +1 -0
  291. package/dist/skills/integration/agent-skill-provider.js +161 -0
  292. package/dist/skills/integration/index.d.ts +7 -0
  293. package/dist/skills/integration/index.d.ts.map +1 -0
  294. package/dist/skills/integration/index.js +6 -0
  295. package/dist/skills/loader/github-loader.d.ts +61 -0
  296. package/dist/skills/loader/github-loader.d.ts.map +1 -0
  297. package/dist/skills/loader/github-loader.js +176 -0
  298. package/dist/skills/loader/index.d.ts +10 -0
  299. package/dist/skills/loader/index.d.ts.map +1 -0
  300. package/dist/skills/loader/index.js +9 -0
  301. package/dist/skills/loader/local-loader.d.ts +56 -0
  302. package/dist/skills/loader/local-loader.d.ts.map +1 -0
  303. package/dist/skills/loader/local-loader.js +186 -0
  304. package/dist/skills/loader/vercel-loader.d.ts +64 -0
  305. package/dist/skills/loader/vercel-loader.d.ts.map +1 -0
  306. package/dist/skills/loader/vercel-loader.js +313 -0
  307. package/dist/skills/loader/vercel-types.d.ts +64 -0
  308. package/dist/skills/loader/vercel-types.d.ts.map +1 -0
  309. package/dist/skills/loader/vercel-types.js +55 -0
  310. package/dist/skills/parser/index.d.ts +7 -0
  311. package/dist/skills/parser/index.d.ts.map +1 -0
  312. package/dist/skills/parser/index.js +6 -0
  313. package/dist/skills/parser/skill-md-parser.d.ts +64 -0
  314. package/dist/skills/parser/skill-md-parser.d.ts.map +1 -0
  315. package/dist/skills/parser/skill-md-parser.js +242 -0
  316. package/dist/skills/registry/index.d.ts +7 -0
  317. package/dist/skills/registry/index.d.ts.map +1 -0
  318. package/dist/skills/registry/index.js +6 -0
  319. package/dist/skills/registry/skill-registry.d.ts +133 -0
  320. package/dist/skills/registry/skill-registry.d.ts.map +1 -0
  321. package/dist/skills/registry/skill-registry.js +373 -0
  322. package/dist/skills/types.d.ts +216 -0
  323. package/dist/skills/types.d.ts.map +1 -0
  324. package/dist/skills/types.js +176 -0
  325. package/dist/templates/agent-spec.d.ts +138 -0
  326. package/dist/templates/agent-spec.d.ts.map +1 -0
  327. package/dist/templates/agent-spec.js +138 -0
  328. package/dist/templates/index.d.ts +56 -0
  329. package/dist/templates/index.d.ts.map +1 -0
  330. package/dist/templates/index.js +58 -0
  331. package/dist/templates/prompt-spec.d.ts +140 -0
  332. package/dist/templates/prompt-spec.d.ts.map +1 -0
  333. package/dist/templates/prompt-spec.js +210 -0
  334. package/dist/templates/skill-spec.d.ts +106 -0
  335. package/dist/templates/skill-spec.d.ts.map +1 -0
  336. package/dist/templates/skill-spec.js +119 -0
  337. package/dist/tools/base.d.ts +74 -0
  338. package/dist/tools/base.d.ts.map +1 -0
  339. package/dist/tools/base.js +6 -0
  340. package/dist/tools/cms/collection-tools.d.ts +36 -0
  341. package/dist/tools/cms/collection-tools.d.ts.map +1 -0
  342. package/dist/tools/cms/collection-tools.js +178 -0
  343. package/dist/tools/cms/factory.d.ts +89 -0
  344. package/dist/tools/cms/factory.d.ts.map +1 -0
  345. package/dist/tools/cms/factory.js +462 -0
  346. package/dist/tools/cms/global-tools.d.ts +21 -0
  347. package/dist/tools/cms/global-tools.d.ts.map +1 -0
  348. package/dist/tools/cms/global-tools.js +92 -0
  349. package/dist/tools/cms/index.d.ts +11 -0
  350. package/dist/tools/cms/index.d.ts.map +1 -0
  351. package/dist/tools/cms/index.js +11 -0
  352. package/dist/tools/cms/media-tools.d.ts +31 -0
  353. package/dist/tools/cms/media-tools.d.ts.map +1 -0
  354. package/dist/tools/cms/media-tools.js +140 -0
  355. package/dist/tools/cms/user-tools.d.ts +31 -0
  356. package/dist/tools/cms/user-tools.d.ts.map +1 -0
  357. package/dist/tools/cms/user-tools.js +135 -0
  358. package/dist/tools/deduplicator.d.ts +19 -0
  359. package/dist/tools/deduplicator.d.ts.map +1 -0
  360. package/dist/tools/deduplicator.js +53 -0
  361. package/dist/tools/document-summarizer.d.ts +11 -0
  362. package/dist/tools/document-summarizer.d.ts.map +1 -0
  363. package/dist/tools/document-summarizer.js +82 -0
  364. package/dist/tools/mcp-adapter.d.ts +66 -0
  365. package/dist/tools/mcp-adapter.d.ts.map +1 -0
  366. package/dist/tools/mcp-adapter.js +152 -0
  367. package/dist/tools/memory/index.d.ts +3 -0
  368. package/dist/tools/memory/index.d.ts.map +1 -0
  369. package/dist/tools/memory/index.js +1 -0
  370. package/dist/tools/memory/store-memory.d.ts +39 -0
  371. package/dist/tools/memory/store-memory.d.ts.map +1 -0
  372. package/dist/tools/memory/store-memory.js +94 -0
  373. package/dist/tools/registry.d.ts +14 -0
  374. package/dist/tools/registry.d.ts.map +1 -0
  375. package/dist/tools/registry.js +48 -0
  376. package/dist/tools/ticket-tools.d.ts +31 -0
  377. package/dist/tools/ticket-tools.d.ts.map +1 -0
  378. package/dist/tools/ticket-tools.js +74 -0
  379. package/dist/tools/web/duck-duck-go.d.ts +52 -0
  380. package/dist/tools/web/duck-duck-go.d.ts.map +1 -0
  381. package/dist/tools/web/duck-duck-go.js +202 -0
  382. package/dist/tools/web/exa.d.ts +34 -0
  383. package/dist/tools/web/exa.d.ts.map +1 -0
  384. package/dist/tools/web/exa.js +80 -0
  385. package/dist/tools/web/index.d.ts +6 -0
  386. package/dist/tools/web/index.d.ts.map +1 -0
  387. package/dist/tools/web/index.js +4 -0
  388. package/dist/tools/web/scraper.d.ts +9 -0
  389. package/dist/tools/web/scraper.d.ts.map +1 -0
  390. package/dist/tools/web/scraper.js +118 -0
  391. package/dist/tools/web/tavily.d.ts +32 -0
  392. package/dist/tools/web/tavily.d.ts.map +1 -0
  393. package/dist/tools/web/tavily.js +73 -0
  394. package/dist/tools/web/types.d.ts +31 -0
  395. package/dist/tools/web/types.d.ts.map +1 -0
  396. package/dist/tools/web/types.js +9 -0
  397. package/package.json +143 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 RevealUI Studio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,112 @@
1
+ RevealUI Commercial License
2
+ Version 1.0, February 2026
3
+
4
+ Copyright (c) 2025-2026 RevealUI Studio (founder@revealui.com)
5
+
6
+ TERMS AND CONDITIONS
7
+
8
+ 1. DEFINITIONS
9
+
10
+ "Software" means the RevealUI source code, documentation, and associated
11
+ files contained in directories and packages designated as commercial,
12
+ including but not limited to: packages/ai, packages/mcp, packages/editors,
13
+ packages/services, packages/harnesses, and any directory named "ee" within
14
+ the repository.
15
+
16
+ "License Key" means a valid RevealUI license key obtained through an active
17
+ paid subscription at https://revealui.com.
18
+
19
+ "Licensee" means the individual or organization that holds a valid License
20
+ Key through an active subscription.
21
+
22
+ "Production Use" means any use of the Software beyond local development and
23
+ evaluation, including but not limited to: deploying the Software to serve
24
+ end users, integrating the Software into a product or service, or using the
25
+ Software in a revenue-generating capacity.
26
+
27
+ 2. GRANT OF RIGHTS
28
+
29
+ Subject to the terms of this License and a valid License Key, the Licensee
30
+ is granted a non-exclusive, non-transferable, revocable license to:
31
+
32
+ (a) Use the Software for internal development and Production Use.
33
+ (b) Modify the Software for internal use.
34
+ (c) Deploy the Software on infrastructure controlled by the Licensee.
35
+
36
+ Enterprise License holders are additionally granted the right to:
37
+
38
+ (d) Deploy the Software in a self-hosted environment.
39
+ (e) Remove or replace RevealUI branding (white-label).
40
+ (f) Use the Software for multiple tenants within the Licensee's
41
+ organization or customer base.
42
+
43
+ 3. RESTRICTIONS
44
+
45
+ The Licensee SHALL NOT:
46
+
47
+ (a) Provide the Software, or any portion of it, to third parties as a
48
+ hosted or managed service that competes with RevealUI.
49
+ (b) Redistribute, sublicense, sell, or otherwise transfer the Software
50
+ or any portion of it to third parties.
51
+ (c) Remove, alter, or circumvent the license key verification
52
+ functionality of the Software.
53
+ (d) Use the Software in Production without a valid License Key.
54
+ (e) Share, publish, or make the License Key available to unauthorized
55
+ parties.
56
+
57
+ 4. EVALUATION
58
+
59
+ The Software may be used for evaluation and local development purposes
60
+ without a License Key. Evaluation use does not grant any rights to
61
+ Production Use.
62
+
63
+ 5. SUBSCRIPTION AND PAYMENT
64
+
65
+ This License is valid only during the term of an active paid subscription.
66
+ Upon cancellation or expiration of the subscription:
67
+
68
+ (a) The License terminates automatically.
69
+ (b) A grace period of fourteen (14) days is provided for the Licensee
70
+ to transition away from Production Use.
71
+ (c) After the grace period, the Licensee must cease all Production Use
72
+ of the Software.
73
+
74
+ 6. INTELLECTUAL PROPERTY
75
+
76
+ The Software is and remains the intellectual property of RevealUI Studio.
77
+ This License does not grant any ownership rights. Contributions to
78
+ commercial portions of the Software require a Contributor License Agreement.
79
+
80
+ 7. OPEN SOURCE COMPONENTS
81
+
82
+ This License applies only to files and directories designated as commercial.
83
+ Files under the MIT License (as indicated in the root LICENSE file) are not
84
+ subject to this commercial license and may be used freely under MIT terms.
85
+
86
+ 8. DISCLAIMER OF WARRANTY
87
+
88
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
89
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
90
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
91
+
92
+ 9. LIMITATION OF LIABILITY
93
+
94
+ IN NO EVENT SHALL REVEALUI STUDIO BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
95
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
96
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
97
+ DEALINGS IN THE SOFTWARE, EXCEEDING THE AMOUNT PAID BY THE LICENSEE IN
98
+ THE TWELVE (12) MONTHS PRECEDING THE CLAIM.
99
+
100
+ 10. GOVERNING LAW
101
+
102
+ This License shall be governed by the laws of the State of California,
103
+ United States of America, without regard to its conflict of law provisions.
104
+
105
+ 11. ENTIRE AGREEMENT
106
+
107
+ This License constitutes the entire agreement between the parties with
108
+ respect to the commercial portions of the Software and supersedes all
109
+ prior agreements, understandings, and communications.
110
+
111
+ For licensing inquiries: founder@revealui.com
112
+ For pricing and subscriptions: https://revealui.com/pricing
package/README.md ADDED
@@ -0,0 +1,314 @@
1
+ # @revealui/ai
2
+
3
+ AI system for RevealUI - memory, LLM, orchestration, and tools.
4
+
5
+ ## Features
6
+
7
+ - **Memory System**: CRDT-based persistent memory (Working, Episodic, Semantic)
8
+ - **LLM Integration**: Provider abstractions for Anthropic, GROQ, Ollama, and more
9
+ - **Agent Orchestration**: Runtime and execution engine for AI agents
10
+ - **Tool Calling**: Tool registry and execution system
11
+ - **Vector Search**: Semantic search with pgvector
12
+ - **Type-safe**: Full TypeScript support
13
+ - **Performant**: Optimized for low-latency operations
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ pnpm add @revealui/ai
19
+ ```
20
+
21
+ ## Quick Start
22
+
23
+ ```typescript
24
+ import { EpisodicMemory } from '@revealui/ai/memory/stores'
25
+ import { NodeIdService } from '@revealui/ai/memory/services'
26
+ import { createClient } from '@revealui/db/client'
27
+
28
+ const db = createClient({ connectionString: process.env.POSTGRES_URL! })
29
+ const nodeIdService = new NodeIdService(db)
30
+ const nodeId = await nodeIdService.getNodeId('user', 'user-123')
31
+ const memory = new EpisodicMemory('user-123', nodeId, db)
32
+ ```
33
+
34
+ ## Testing
35
+
36
+ ⚠️ **Important**: This package has known testing limitations. See [TESTING.md](./TESTING.md) for details.
37
+
38
+ ### Quick Commands
39
+
40
+ ```bash
41
+ # Unit tests (always work)
42
+ pnpm --filter @revealui/ai test
43
+
44
+ # Integration tests (require Neon instance)
45
+ POSTGRES_URL="postgresql://..." pnpm --filter @revealui/ai test __tests__/integration
46
+
47
+ # Production validation
48
+ POSTGRES_URL="postgresql://..." ./scripts/validate-production.sh
49
+ ```
50
+
51
+ ### Testing Limitations
52
+
53
+ - ❌ Local PostgreSQL testing not possible (Neon HTTP driver limitation)
54
+ - ⚠️ Mock database tests may fail (known limitation, not a bug)
55
+
56
+ **Full documentation**: See [TESTING.md](./TESTING.md)
57
+
58
+ ## Documentation
59
+
60
+ - **[TESTING.md](./TESTING.md)**: Complete testing guide, limitations, and validation plan
61
+ - **[OBSERVABILITY.md](./OBSERVABILITY.md)**: Observability and monitoring guide
62
+ - **Source Code**: `packages/ai/src/memory/`
63
+ - **Helper Functions**: `packages/ai/src/memory/utils/sql-helpers.ts`
64
+
65
+ ## API Reference
66
+
67
+ ### Memory System
68
+
69
+ #### EpisodicMemory
70
+
71
+ Long-term memory for conversation history and agent memories.
72
+
73
+ ```typescript
74
+ import { EpisodicMemory } from '@revealui/ai/memory/stores'
75
+
76
+ const memory = new EpisodicMemory(userId, nodeId, db)
77
+ await memory.add(agentMemory)
78
+ await memory.save()
79
+ const memories = await memory.getAll()
80
+ ```
81
+
82
+ #### NodeIdService
83
+
84
+ Deterministic node IDs for CRDT operations.
85
+
86
+ ```typescript
87
+ import { NodeIdService } from '@revealui/ai/memory/services'
88
+
89
+ const nodeIdService = new NodeIdService(db)
90
+ const nodeId = await nodeIdService.getNodeId('user', 'user-123')
91
+ ```
92
+
93
+ #### CRDTPersistence
94
+
95
+ Generic adapter for saving/loading CRDT state.
96
+
97
+ ```typescript
98
+ import { CRDTPersistence } from '@revealui/ai/memory/persistence'
99
+
100
+ const persistence = new CRDTPersistence(db)
101
+ await persistence.saveCRDTState(crdtId, 'lww_register', data)
102
+ const state = await persistence.loadCRDTState(crdtId, 'lww_register')
103
+ ```
104
+
105
+ ### LLM Integration
106
+
107
+ Provider abstractions and unified client for Anthropic, GROQ, and Ollama.
108
+
109
+ ```typescript
110
+ import { LLMClient, createLLMClientFromEnv } from '@revealui/ai/llm/client'
111
+
112
+ const client = createLLMClientFromEnv()
113
+ const response = await client.chat([
114
+ { role: 'user', content: 'Hello!' }
115
+ ])
116
+ ```
117
+
118
+ #### Vultr (Vultr AI / Serverless Inference)
119
+
120
+ 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:
121
+
122
+ ```
123
+ LLM_PROVIDER=vultr
124
+ VULTR_API_KEY=your_inference_api_key
125
+ VULTR_BASE_URL=https://api.vultrinference.com/v1 # optional
126
+ ```
127
+
128
+ 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.
129
+
130
+ Demo: quick test script
131
+
132
+ You can run a quick demo script that exercises chat and embeddings endpoints. From the repository root:
133
+
134
+ ```bash
135
+ # replace with real values
136
+ VULTR_API_KEY=your_key VULTR_MODEL=your-model-id ts-node packages/ai/scripts/test-vultr.ts
137
+ ```
138
+
139
+ The script prints the raw API responses and a simplified assistant output.
140
+
141
+
142
+ ### Agent Orchestration
143
+
144
+ Agent runtime and execution engine for autonomous agents.
145
+
146
+ ```typescript
147
+ import { AgentRuntime } from '@revealui/ai/orchestration/runtime'
148
+ import { AgentOrchestrator } from '@revealui/ai/orchestration/orchestrator'
149
+
150
+ const runtime = new AgentRuntime()
151
+ const orchestrator = new AgentOrchestrator()
152
+ ```
153
+
154
+ ### Tools
155
+
156
+ Tool registry and execution system with MCP integration.
157
+
158
+ ```typescript
159
+ import { ToolRegistry } from '@revealui/ai/tools/registry'
160
+ import { registerMCPTools } from '@revealui/ai/tools/mcp-adapter'
161
+
162
+ const registry = new ToolRegistry()
163
+ await registerMCPTools(mcpClient, registry)
164
+ ```
165
+
166
+ ## Performance Considerations
167
+
168
+ The memory system uses deep cloning to ensure immutability and prevent data corruption. Understanding the cloning strategy is important for performance optimization.
169
+
170
+ ### Cloning Layers
171
+
172
+ 1. **LWWRegister Level** (Core CRDT)
173
+ - `get()`: Clones object/array values on every call
174
+ - `set()`: Clones values when storing
175
+ - `merge()`: Clones winning values during merge
176
+ - `toData()`: Clones values when serializing
177
+
178
+ 2. **WorkingMemory Level**
179
+ - `getContext()`: Returns cloned context from LWWRegister
180
+ - `getContextValue()`: Returns value from cloned context (no additional cloning)
181
+ - `setContext()`: Clones entire context object
182
+ - `updateContext()`: Clones context once for multiple updates
183
+
184
+ 3. **AgentContextManager Level**
185
+ - `getContext()`: Returns value from cloned context (no additional cloning)
186
+ - `getAllContext()`: Returns cloned context from WorkingMemory
187
+ - `setContext()`: Validates then sets (cloning happens in WorkingMemory)
188
+ - `updateContext()`: Validates then updates (cloning happens in WorkingMemory)
189
+
190
+ ### Performance Implications
191
+
192
+ #### ✅ Efficient Operations
193
+
194
+ - **Single key access**: `getContext(key)` - No double cloning
195
+ - **Multiple updates**: `updateContext({ k1: v1, k2: v2 })` - Single clone
196
+ - **Primitive values**: No cloning overhead
197
+
198
+ #### ⚠️ Performance Considerations
199
+
200
+ - **Large contexts**: Every `getContext()` clones the entire context
201
+ - **Frequent updates**: Each update clones the context
202
+ - **Deep nesting**: Deep cloning is recursive and can be slow for very deep objects
203
+
204
+ ### Best Practices
205
+
206
+ **1. Batch Updates**: Use `updateContext()` for multiple changes instead of multiple `setContext()` calls
207
+
208
+ ```typescript
209
+ // ❌ Bad: Clones context 3 times
210
+ manager.setContext('key1', 'value1')
211
+ manager.setContext('key2', 'value2')
212
+ manager.setContext('key3', 'value3')
213
+
214
+ // ✅ Good: Clones context once
215
+ manager.updateContext({
216
+ key1: 'value1',
217
+ key2: 'value2',
218
+ key3: 'value3',
219
+ })
220
+ ```
221
+
222
+ **2. Cache Context**: If you need to access multiple values, get the full context once
223
+
224
+ ```typescript
225
+ // ❌ Bad: Clones context multiple times
226
+ const value1 = manager.getContext('key1')
227
+ const value2 = manager.getContext('key2')
228
+ const value3 = manager.getContext('key3')
229
+
230
+ // ✅ Good: Clone once, access multiple times
231
+ const context = manager.getAllContext()
232
+ const value1 = context.key1
233
+ const value2 = context.key2
234
+ const value3 = context.key3
235
+ ```
236
+
237
+ **3. Avoid Deep Nesting**: Keep context structure relatively flat
238
+
239
+ ```typescript
240
+ // ❌ Bad: Very deep nesting
241
+ context: {
242
+ user: {
243
+ profile: {
244
+ settings: {
245
+ theme: {
246
+ color: 'dark'
247
+ }
248
+ }
249
+ }
250
+ }
251
+ }
252
+
253
+ // ✅ Good: Flatter structure
254
+ context: {
255
+ 'user.profile.settings.theme.color': 'dark'
256
+ }
257
+ ```
258
+
259
+ **4. Use Primitives When Possible**: Primitives don't require cloning
260
+
261
+ ```typescript
262
+ // ✅ Good: Primitives are fast
263
+ manager.setContext('count', 42)
264
+ manager.setContext('name', 'John')
265
+
266
+ // ⚠️ Consider: Objects require cloning
267
+ manager.setContext('user', { name: 'John', age: 30 })
268
+ ```
269
+
270
+ ### Size Limits
271
+
272
+ The system enforces limits to prevent performance issues:
273
+
274
+ - **Max Context Keys**: 10,000 keys
275
+ - **Max Context Size**: ~10MB (approximate)
276
+ - **Max Object Depth**: 100 levels
277
+
278
+ These limits prevent:
279
+ - Memory exhaustion
280
+ - Stack overflow from deep recursion
281
+ - Performance degradation from huge objects
282
+
283
+ ### Monitoring Performance
284
+
285
+ If you experience performance issues:
286
+
287
+ 1. **Profile Context Size**: Check how large your contexts are
288
+ 2. **Monitor Clone Operations**: Count how many times contexts are cloned
289
+ 3. **Check Depth**: Ensure objects aren't too deeply nested
290
+ 4. **Review Update Patterns**: Look for opportunities to batch updates
291
+
292
+ ### Future Optimizations
293
+
294
+ Potential optimizations (not yet implemented):
295
+
296
+ - **Lazy Cloning**: Only clone when values are actually accessed
297
+ - **Structural Sharing**: Share unchanged parts of objects
298
+ - **Caching**: Cache cloned values for frequently accessed keys
299
+ - **Incremental Updates**: Only clone changed parts of context
300
+
301
+ ## Requirements
302
+
303
+ - Node.js 18+
304
+ - PostgreSQL with pgvector extension
305
+ - Neon Postgres (for production) or compatible database
306
+
307
+ ## License
308
+
309
+ Commercial — see [LICENSE.commercial](../../LICENSE.commercial)
310
+
311
+ ---
312
+
313
+ **Last Updated**: 2026-03-04
314
+ **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,CAAA;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAyB,MAAM,qBAAqB,CAAA;AAwI9E,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqC;;IAO1D,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,CAAA;AAExD,YAAY,EAAE,eAAe,EAAE,CAAA"}
@@ -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_PARSE_ERROR, RPC_INVALID_REQUEST };
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,CAAA;AAG5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAgBjD,QAAA,MAAM,eAAe,SAAS,CAAA;AAC9B,QAAA,MAAM,mBAAmB,SAAS,CAAA;AA0JlC;;;;;;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,eAAe,EAAE,mBAAmB,EAAE,CAAA"}