@revealui/ai 0.2.7 → 0.2.9

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 (220) hide show
  1. package/LICENSE +104 -17
  2. package/README.md +2 -2
  3. package/dist/a2a/card.d.ts +1 -1
  4. package/dist/a2a/card.d.ts.map +1 -1
  5. package/dist/a2a/card.js +4 -4
  6. package/dist/a2a/handler.d.ts +4 -4
  7. package/dist/a2a/handler.js +5 -5
  8. package/dist/a2a/index.d.ts +1 -1
  9. package/dist/a2a/index.js +1 -1
  10. package/dist/audit/emitter.d.ts +1 -1
  11. package/dist/audit/emitter.js +2 -2
  12. package/dist/audit/index.d.ts +2 -2
  13. package/dist/audit/index.js +2 -2
  14. package/dist/audit/store.d.ts +2 -2
  15. package/dist/audit/store.js +2 -2
  16. package/dist/client/errors.d.ts +13 -0
  17. package/dist/client/errors.d.ts.map +1 -0
  18. package/dist/client/errors.js +28 -0
  19. package/dist/client/hooks/useAgentContext.d.ts.map +1 -1
  20. package/dist/client/hooks/useAgentContext.js +6 -5
  21. package/dist/client/hooks/useAgentStream.d.ts +2 -2
  22. package/dist/client/hooks/useAgentStream.js +3 -3
  23. package/dist/client/hooks/useEpisodicMemory.d.ts.map +1 -1
  24. package/dist/client/hooks/useEpisodicMemory.js +6 -5
  25. package/dist/client/hooks/useWorkingMemory.d.ts.map +1 -1
  26. package/dist/client/hooks/useWorkingMemory.js +7 -6
  27. package/dist/embeddings/index.d.ts +1 -1
  28. package/dist/embeddings/index.js +4 -4
  29. package/dist/index.d.ts +1 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +1 -2
  32. package/dist/inference/context-budget.d.ts +1 -1
  33. package/dist/inference/context-budget.js +4 -4
  34. package/dist/inference/index.d.ts +1 -1
  35. package/dist/inference/index.js +1 -1
  36. package/dist/inference/runRag.d.ts +3 -3
  37. package/dist/inference/runRag.d.ts.map +1 -1
  38. package/dist/inference/runRag.js +1 -1
  39. package/dist/inference/task-decomposer.d.ts +1 -1
  40. package/dist/inference/task-decomposer.d.ts.map +1 -1
  41. package/dist/inference/task-decomposer.js +3 -3
  42. package/dist/inference/tool-result-compressor.d.ts +1 -1
  43. package/dist/inference/tool-result-compressor.js +1 -1
  44. package/dist/ingestion/{cms-indexer.d.ts → admin-indexer.d.ts} +12 -12
  45. package/dist/ingestion/admin-indexer.d.ts.map +1 -0
  46. package/dist/ingestion/{cms-indexer.js → admin-indexer.js} +9 -9
  47. package/dist/ingestion/bm25.d.ts +1 -1
  48. package/dist/ingestion/bm25.js +1 -1
  49. package/dist/ingestion/file-parsers.d.ts +1 -1
  50. package/dist/ingestion/file-parsers.d.ts.map +1 -1
  51. package/dist/ingestion/file-parsers.js +36 -17
  52. package/dist/ingestion/hybrid-search.d.ts +1 -1
  53. package/dist/ingestion/hybrid-search.js +1 -1
  54. package/dist/ingestion/index.d.ts +1 -1
  55. package/dist/ingestion/index.d.ts.map +1 -1
  56. package/dist/ingestion/index.js +1 -1
  57. package/dist/ingestion/rag-vector-service.d.ts +1 -1
  58. package/dist/ingestion/rag-vector-service.js +1 -1
  59. package/dist/ingestion/reranker.d.ts +1 -1
  60. package/dist/ingestion/reranker.js +1 -1
  61. package/dist/ingestion/text-splitter.d.ts +1 -1
  62. package/dist/ingestion/text-splitter.js +2 -2
  63. package/dist/llm/cache-utils.d.ts.map +1 -1
  64. package/dist/llm/cache-utils.js +1 -17
  65. package/dist/llm/client.d.ts +8 -13
  66. package/dist/llm/client.d.ts.map +1 -1
  67. package/dist/llm/client.js +12 -60
  68. package/dist/llm/key-validator.d.ts +1 -1
  69. package/dist/llm/key-validator.js +8 -8
  70. package/dist/llm/providers/base.d.ts +2 -2
  71. package/dist/llm/providers/groq.d.ts +2 -2
  72. package/dist/llm/providers/groq.d.ts.map +1 -1
  73. package/dist/llm/providers/groq.js +4 -4
  74. package/dist/llm/providers/inference-snaps.d.ts +5 -5
  75. package/dist/llm/providers/inference-snaps.d.ts.map +1 -1
  76. package/dist/llm/providers/inference-snaps.js +6 -6
  77. package/dist/llm/providers/ollama.d.ts +2 -2
  78. package/dist/llm/providers/ollama.d.ts.map +1 -1
  79. package/dist/llm/providers/ollama.js +3 -3
  80. package/dist/llm/providers/{openai.d.ts → openai-compat.d.ts} +8 -7
  81. package/dist/llm/providers/openai-compat.d.ts.map +1 -0
  82. package/dist/llm/providers/{openai.js → openai-compat.js} +13 -17
  83. package/dist/llm/providers/vultr.d.ts.map +1 -1
  84. package/dist/llm/providers/vultr.js +1 -0
  85. package/dist/llm/server.d.ts +1 -3
  86. package/dist/llm/server.d.ts.map +1 -1
  87. package/dist/llm/server.js +1 -3
  88. package/dist/llm/token-counter.d.ts.map +1 -1
  89. package/dist/llm/token-counter.js +11 -8
  90. package/dist/llm/workspace-provider-config.d.ts +1 -1
  91. package/dist/llm/workspace-provider-config.d.ts.map +1 -1
  92. package/dist/llm/workspace-provider-config.js +1 -1
  93. package/dist/memory/crdt/or-set.d.ts +12 -0
  94. package/dist/memory/crdt/or-set.d.ts.map +1 -1
  95. package/dist/memory/crdt/or-set.js +27 -0
  96. package/dist/memory/index.d.ts +1 -0
  97. package/dist/memory/index.d.ts.map +1 -1
  98. package/dist/memory/index.js +1 -0
  99. package/dist/memory/persistence/crdt-persistence.d.ts +21 -1
  100. package/dist/memory/persistence/crdt-persistence.d.ts.map +1 -1
  101. package/dist/memory/persistence/crdt-persistence.js +67 -0
  102. package/dist/memory/preferences/user-preferences-manager.d.ts.map +1 -1
  103. package/dist/memory/preferences/user-preferences-manager.js +11 -1
  104. package/dist/memory/stores/episodic-memory.js +2 -2
  105. package/dist/memory/stores/working-memory.d.ts +7 -2
  106. package/dist/memory/stores/working-memory.d.ts.map +1 -1
  107. package/dist/memory/stores/working-memory.js +31 -17
  108. package/dist/memory/sync/index.d.ts +2 -0
  109. package/dist/memory/sync/index.d.ts.map +1 -0
  110. package/dist/memory/sync/index.js +1 -0
  111. package/dist/memory/sync/sync-manager.d.ts +104 -0
  112. package/dist/memory/sync/sync-manager.d.ts.map +1 -0
  113. package/dist/memory/sync/sync-manager.js +137 -0
  114. package/dist/memory/utils/validation.js +1 -1
  115. package/dist/memory/vector/vector-memory-service.d.ts +1 -1
  116. package/dist/memory/vector/vector-memory-service.js +1 -1
  117. package/dist/orchestration/agent.d.ts +2 -2
  118. package/dist/orchestration/defaults.d.ts +1 -1
  119. package/dist/orchestration/defaults.js +1 -1
  120. package/dist/orchestration/orchestrator.d.ts +3 -3
  121. package/dist/orchestration/orchestrator.js +3 -3
  122. package/dist/orchestration/runtime.d.ts +1 -1
  123. package/dist/orchestration/runtime.js +1 -1
  124. package/dist/orchestration/streaming-runtime.d.ts +2 -2
  125. package/dist/orchestration/streaming-runtime.js +2 -2
  126. package/dist/orchestration/ticket-agent.d.ts +11 -11
  127. package/dist/orchestration/ticket-agent.d.ts.map +1 -1
  128. package/dist/orchestration/ticket-agent.js +10 -10
  129. package/dist/skills/catalog/vercel-catalog.d.ts.map +1 -1
  130. package/dist/skills/catalog/vercel-catalog.js +7 -4
  131. package/dist/skills/loader/github-loader.d.ts.map +1 -1
  132. package/dist/skills/loader/github-loader.js +2 -0
  133. package/dist/skills/loader/local-loader.js +1 -1
  134. package/dist/skills/loader/vercel-loader.d.ts.map +1 -1
  135. package/dist/skills/loader/vercel-loader.js +2 -0
  136. package/dist/skills/parser/skill-md-parser.js +2 -2
  137. package/dist/skills/registry/skill-registry.js +1 -1
  138. package/dist/skills/types.d.ts +6 -6
  139. package/dist/templates/prompt-spec.js +1 -1
  140. package/dist/templates/skill-spec.js +1 -1
  141. package/dist/tools/{cms → admin}/collection-tools.d.ts +2 -2
  142. package/dist/tools/admin/collection-tools.d.ts.map +1 -0
  143. package/dist/tools/{cms → admin}/collection-tools.js +8 -8
  144. package/dist/tools/{cms → admin}/factory.d.ts +11 -11
  145. package/dist/tools/admin/factory.d.ts.map +1 -0
  146. package/dist/tools/{cms → admin}/factory.js +4 -4
  147. package/dist/tools/{cms → admin}/global-tools.d.ts +1 -1
  148. package/dist/tools/admin/global-tools.d.ts.map +1 -0
  149. package/dist/tools/{cms → admin}/global-tools.js +4 -4
  150. package/dist/tools/{cms → admin}/index.d.ts +4 -4
  151. package/dist/tools/admin/index.d.ts.map +1 -0
  152. package/dist/tools/{cms → admin}/index.js +3 -3
  153. package/dist/tools/{cms → admin}/media-tools.d.ts +1 -1
  154. package/dist/tools/admin/media-tools.d.ts.map +1 -0
  155. package/dist/tools/{cms → admin}/media-tools.js +4 -4
  156. package/dist/tools/{cms → admin}/user-tools.d.ts +1 -1
  157. package/dist/tools/admin/user-tools.d.ts.map +1 -0
  158. package/dist/tools/{cms → admin}/user-tools.js +1 -1
  159. package/dist/tools/coding/file-edit.d.ts +1 -1
  160. package/dist/tools/coding/file-edit.js +2 -2
  161. package/dist/tools/coding/file-glob.d.ts +1 -1
  162. package/dist/tools/coding/file-glob.d.ts.map +1 -1
  163. package/dist/tools/coding/file-glob.js +2 -1
  164. package/dist/tools/coding/file-grep.d.ts +1 -1
  165. package/dist/tools/coding/file-grep.d.ts.map +1 -1
  166. package/dist/tools/coding/file-grep.js +2 -1
  167. package/dist/tools/coding/file-read.d.ts +1 -1
  168. package/dist/tools/coding/file-read.d.ts.map +1 -1
  169. package/dist/tools/coding/file-read.js +15 -9
  170. package/dist/tools/coding/file-write.d.ts +1 -1
  171. package/dist/tools/coding/file-write.js +1 -1
  172. package/dist/tools/coding/git-ops.d.ts +1 -1
  173. package/dist/tools/coding/git-ops.d.ts.map +1 -1
  174. package/dist/tools/coding/git-ops.js +5 -7
  175. package/dist/tools/coding/index.d.ts +1 -1
  176. package/dist/tools/coding/index.d.ts.map +1 -1
  177. package/dist/tools/coding/lint-fix.d.ts +1 -1
  178. package/dist/tools/coding/lint-fix.d.ts.map +1 -1
  179. package/dist/tools/coding/lint-fix.js +8 -4
  180. package/dist/tools/coding/project-context.d.ts +1 -1
  181. package/dist/tools/coding/project-context.d.ts.map +1 -1
  182. package/dist/tools/coding/project-context.js +25 -24
  183. package/dist/tools/coding/safety.d.ts +1 -1
  184. package/dist/tools/coding/safety.d.ts.map +1 -1
  185. package/dist/tools/coding/shell-exec.d.ts +1 -1
  186. package/dist/tools/coding/shell-exec.js +1 -1
  187. package/dist/tools/coding/test-runner.d.ts +1 -1
  188. package/dist/tools/coding/test-runner.d.ts.map +1 -1
  189. package/dist/tools/coding/test-runner.js +12 -7
  190. package/dist/tools/deduplicator.js +1 -1
  191. package/dist/tools/document-summarizer.js +2 -2
  192. package/dist/tools/memory/store-memory.d.ts +1 -1
  193. package/dist/tools/memory/store-memory.js +2 -2
  194. package/dist/tools/ticket-tools.d.ts +2 -2
  195. package/dist/tools/ticket-tools.js +3 -3
  196. package/dist/tools/web/duck-duck-go.d.ts +3 -3
  197. package/dist/tools/web/duck-duck-go.js +4 -4
  198. package/dist/tools/web/exa.d.ts +1 -1
  199. package/dist/tools/web/exa.js +1 -1
  200. package/dist/tools/web/scraper.js +1 -1
  201. package/dist/tools/web/tavily.d.ts +2 -2
  202. package/dist/tools/web/tavily.js +2 -2
  203. package/dist/tools/web/types.d.ts +2 -2
  204. package/dist/tools/web/types.js +2 -2
  205. package/package.json +23 -17
  206. package/LICENSE.commercial +0 -111
  207. package/dist/ingestion/cms-indexer.d.ts.map +0 -1
  208. package/dist/llm/providers/anthropic.d.ts +0 -31
  209. package/dist/llm/providers/anthropic.d.ts.map +0 -1
  210. package/dist/llm/providers/anthropic.js +0 -264
  211. package/dist/llm/providers/bitnet.d.ts +0 -28
  212. package/dist/llm/providers/bitnet.d.ts.map +0 -1
  213. package/dist/llm/providers/bitnet.js +0 -36
  214. package/dist/llm/providers/openai.d.ts.map +0 -1
  215. package/dist/tools/cms/collection-tools.d.ts.map +0 -1
  216. package/dist/tools/cms/factory.d.ts.map +0 -1
  217. package/dist/tools/cms/global-tools.d.ts.map +0 -1
  218. package/dist/tools/cms/index.d.ts.map +0 -1
  219. package/dist/tools/cms/media-tools.d.ts.map +0 -1
  220. package/dist/tools/cms/user-tools.d.ts.map +0 -1
package/LICENSE CHANGED
@@ -1,22 +1,109 @@
1
- MIT License
1
+ Functional Source License, Version 1.1, MIT Future License
2
2
 
3
- Copyright (c) 2025-2026 RevealUI Studio
3
+ Abbreviation
4
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:
5
+ FSL-1.1-MIT
11
6
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
7
+ Notice
14
8
 
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.
9
+ Copyright 2025-2026 RevealUI Studio (founder@revealui.com)
22
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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @revealui/ai
2
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.
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
4
 
5
5
 
6
6
  AI system for RevealUI - memory, LLM, orchestration, and tools.
@@ -309,7 +309,7 @@ Potential optimizations (not yet implemented):
309
309
 
310
310
  ## License
311
311
 
312
- Commercialsee [LICENSE.commercial](../../LICENSE.commercial)
312
+ Commercial - see [LICENSE.commercial](../../LICENSE.commercial)
313
313
 
314
314
  ---
315
315
 
@@ -20,7 +20,7 @@ declare class AgentCardRegistry {
20
20
  listDefs(): AgentDefinition[];
21
21
  has(agentId: string): boolean;
22
22
  }
23
- /** Singleton registryimport and use directly */
23
+ /** Singleton registry - import and use directly */
24
24
  export declare const agentCardRegistry: AgentCardRegistry;
25
25
  export type { AgentDefinition };
26
26
  //# sourceMappingURL=card.d.ts.map
@@ -1 +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,G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,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,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,mBAA0B,CAAC;AAEzD,YAAY,EAAE,eAAe,EAAE,CAAC"}
package/dist/a2a/card.js CHANGED
@@ -10,7 +10,7 @@ import { agentDefinitionToCard } from '@revealui/contracts';
10
10
  // =============================================================================
11
11
  // Built-in agent definitions
12
12
  // =============================================================================
13
- /** RevealUI platform meta-agent"The Creator" */
13
+ /** RevealUI platform meta-agent - "The Creator" */
14
14
  const THE_CREATOR_DEF = {
15
15
  id: 'revealui-creator',
16
16
  version: 1,
@@ -21,7 +21,7 @@ const THE_CREATOR_DEF = {
21
21
  model: 'claude-opus-4-6',
22
22
  systemPrompt: 'You are The Creator, the meta-agent for RevealUI. You design, configure, and deploy ' +
23
23
  'purpose-built AI agents for RevealUI users. You have access to agent scaffolding tools, ' +
24
- 'the RevealUI CMS, and the billing system.',
24
+ 'the RevealUI admin, and the billing system.',
25
25
  tools: [
26
26
  {
27
27
  name: 'scaffoldAgent',
@@ -73,7 +73,7 @@ const TICKET_AGENT_DEF = {
73
73
  version: 1,
74
74
  name: 'Ticket Agent',
75
75
  description: 'Handles support tickets, resolves user issues, and escalates when needed. ' +
76
- 'Uses the RevealUI CMS to create and update tickets.',
76
+ 'Uses the RevealUI admin to create and update tickets.',
77
77
  model: 'claude-sonnet-4-6',
78
78
  systemPrompt: 'You are the RevealUI Ticket Agent. You help users resolve issues by creating tickets, ' +
79
79
  'searching for solutions, and escalating complex problems to the support team.',
@@ -169,5 +169,5 @@ class AgentCardRegistry {
169
169
  return this.defs.has(agentId);
170
170
  }
171
171
  }
172
- /** Singleton registryimport and use directly */
172
+ /** Singleton registry - import and use directly */
173
173
  export const agentCardRegistry = new AgentCardRegistry();
@@ -5,10 +5,10 @@
5
5
  * Integrates with AgentRuntime and AgentOrchestrator from @revealui/ai/orchestration.
6
6
  *
7
7
  * Supported methods:
8
- * tasks/sendsynchronous task execution
9
- * tasks/getretrieve task by ID
10
- * tasks/cancelcancel a running task
11
- * tasks/sendSubscribe(handled at route level via SSE; returns taskId here)
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
12
  */
13
13
  import type { A2AJsonRpcRequest, A2AJsonRpcResponse } from '@revealui/contracts';
14
14
  import type { LLMClient } from '../llm/client.js';
@@ -5,10 +5,10 @@
5
5
  * Integrates with AgentRuntime and AgentOrchestrator from @revealui/ai/orchestration.
6
6
  *
7
7
  * Supported methods:
8
- * tasks/sendsynchronous task execution
9
- * tasks/getretrieve task by ID
10
- * tasks/cancelcancel a running task
11
- * tasks/sendSubscribe(handled at route level via SSE; returns taskId here)
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
12
  */
13
13
  import { A2ASendTaskParamsSchema } from '@revealui/contracts';
14
14
  import { logger } from '@revealui/core/observability/logger';
@@ -57,7 +57,7 @@ async function handleTasksSend(id, params, agentId, llmClient) {
57
57
  try {
58
58
  // Transition to working
59
59
  updateTaskState(task.id, 'working');
60
- // Execute via orchestrationfor now, produce a direct text response.
60
+ // Execute via orchestration - for now, produce a direct text response.
61
61
  // Full AgentRuntime integration wires in when an LLM provider is configured.
62
62
  const agentDef = agentId
63
63
  ? agentCardRegistry.getDef(agentId)
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @revealui/aiA2A Protocol Implementation
2
+ * @revealui/ai - A2A Protocol Implementation
3
3
  *
4
4
  * Agent-to-Agent (A2A) protocol support for RevealUI.
5
5
  * Exports the agent card registry, task store, and JSON-RPC handler.
package/dist/a2a/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @revealui/aiA2A Protocol Implementation
2
+ * @revealui/ai - A2A Protocol Implementation
3
3
  *
4
4
  * Agent-to-Agent (A2A) protocol support for RevealUI.
5
5
  * Exports the agent card registry, task store, and JSON-RPC handler.
@@ -15,7 +15,7 @@ import type { AuditEventType, AuditSeverity } from './types.js';
15
15
  */
16
16
  export interface AuditEmitter {
17
17
  /**
18
- * Emit an audit event. This is a fire-and-forget operation
18
+ * Emit an audit event. This is a fire-and-forget operation -
19
19
  * the agent does not receive confirmation or any data back.
20
20
  */
21
21
  emit(eventType: AuditEventType, payload: Record<string, unknown>, severity?: AuditSeverity): void;
@@ -20,12 +20,12 @@
20
20
  export function createAuditEmitter(agentId, handler) {
21
21
  const emitter = {
22
22
  emit(eventType, payload, severity = 'info') {
23
- // Fire-and-forgetagents don't get feedback from the audit system
23
+ // Fire-and-forget - agents don't get feedback from the audit system
24
24
  try {
25
25
  handler(agentId, eventType, payload, severity);
26
26
  }
27
27
  catch {
28
- // Silently swallow errorsaudit failures must never affect agent execution
28
+ // Silently swallow errors - audit failures must never affect agent execution
29
29
  }
30
30
  },
31
31
  };
@@ -9,7 +9,7 @@
9
9
  * - **Store** is append-only (no updates, no deletes)
10
10
  *
11
11
  * This architecture ensures that AI agents cannot tamper with, disable,
12
- * or circumvent the audit trailit lives entirely outside their scope.
12
+ * or circumvent the audit trail - it lives entirely outside their scope.
13
13
  *
14
14
  * ## Quick Start
15
15
  *
@@ -29,7 +29,7 @@
29
29
  *
30
30
  * // Create write-only emitter for an agent
31
31
  * const emitter = observer.createEmitterForAgent('agent-1')
32
- * // Pass `emitter` to the agentit can only call emitter.emit()
32
+ * // Pass `emitter` to the agent - it can only call emitter.emit()
33
33
  *
34
34
  * // Human can halt agents at any time
35
35
  * observer.haltAgent('agent-1', 'admin', 'Suspicious behavior')
@@ -9,7 +9,7 @@
9
9
  * - **Store** is append-only (no updates, no deletes)
10
10
  *
11
11
  * This architecture ensures that AI agents cannot tamper with, disable,
12
- * or circumvent the audit trailit lives entirely outside their scope.
12
+ * or circumvent the audit trail - it lives entirely outside their scope.
13
13
  *
14
14
  * ## Quick Start
15
15
  *
@@ -29,7 +29,7 @@
29
29
  *
30
30
  * // Create write-only emitter for an agent
31
31
  * const emitter = observer.createEmitterForAgent('agent-1')
32
- * // Pass `emitter` to the agentit can only call emitter.emit()
32
+ * // Pass `emitter` to the agent - it can only call emitter.emit()
33
33
  *
34
34
  * // Human can halt agents at any time
35
35
  * observer.haltAgent('agent-1', 'admin', 'Suspicious behavior')
@@ -2,7 +2,7 @@
2
2
  * Audit Store
3
3
  *
4
4
  * Append-only storage interface for audit entries.
5
- * No update or delete operationsthe log is immutable.
5
+ * No update or delete operations - the log is immutable.
6
6
  * Includes an in-memory implementation and a pluggable interface
7
7
  * for persistent backends (PostgreSQL, etc.).
8
8
  */
@@ -25,7 +25,7 @@ export interface AuditStore {
25
25
  }
26
26
  /**
27
27
  * In-memory audit store for development and testing.
28
- * Entries are stored in a simple arraynot suitable for production.
28
+ * Entries are stored in a simple array - not suitable for production.
29
29
  */
30
30
  export declare class InMemoryAuditStore implements AuditStore {
31
31
  private entries;
@@ -2,14 +2,14 @@
2
2
  * Audit Store
3
3
  *
4
4
  * Append-only storage interface for audit entries.
5
- * No update or delete operationsthe log is immutable.
5
+ * No update or delete operations - the log is immutable.
6
6
  * Includes an in-memory implementation and a pluggable interface
7
7
  * for persistent backends (PostgreSQL, etc.).
8
8
  */
9
9
  // ─── In-Memory Implementation ───────────────────────────────────────────────
10
10
  /**
11
11
  * In-memory audit store for development and testing.
12
- * Entries are stored in a simple arraynot suitable for production.
12
+ * Entries are stored in a simple array - not suitable for production.
13
13
  */
14
14
  export class InMemoryAuditStore {
15
15
  entries = [];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Client-safe AI error classes.
3
+ *
4
+ * Lightweight errors for React hooks - no server-side dependencies.
5
+ * Consumers can programmatically handle specific error types (retry on 429, redirect on 401).
6
+ */
7
+ export declare class AIError extends Error {
8
+ readonly statusCode: number;
9
+ readonly operation: string;
10
+ constructor(message: string, statusCode: number, operation: string);
11
+ }
12
+ export declare function createAIError(operation: string, statusCode: number, statusText: string): AIError;
13
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/client/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAa,OAAQ,SAAQ,KAAK;aAGd,UAAU,EAAE,MAAM;aAClB,SAAS,EAAE,MAAM;gBAFjC,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM;CAKpC;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAahG"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Client-safe AI error classes.
3
+ *
4
+ * Lightweight errors for React hooks - no server-side dependencies.
5
+ * Consumers can programmatically handle specific error types (retry on 429, redirect on 401).
6
+ */
7
+ export class AIError extends Error {
8
+ statusCode;
9
+ operation;
10
+ constructor(message, statusCode, operation) {
11
+ super(message);
12
+ this.statusCode = statusCode;
13
+ this.operation = operation;
14
+ this.name = 'AIError';
15
+ }
16
+ }
17
+ export function createAIError(operation, statusCode, statusText) {
18
+ const message = statusCode === 401
19
+ ? `Authentication required for ${operation}`
20
+ : statusCode === 403
21
+ ? `Insufficient permissions for ${operation}`
22
+ : statusCode === 404
23
+ ? `Resource not found: ${operation}`
24
+ : statusCode === 429
25
+ ? `Too many requests — retry ${operation} shortly`
26
+ : `${operation} failed: ${statusText}`;
27
+ return new AIError(message, statusCode, operation);
28
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"useAgentContext.d.ts","sourceRoot":"","sources":["../../../src/client/hooks/useAgentContext.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,WAAW,sBAAsB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K,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAeD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CAkKvB"}
@@ -5,6 +5,7 @@
5
5
  * Wraps AgentContextManager for client-side usage.
6
6
  */
7
7
  import { useCallback, useEffect, useState } from 'react';
8
+ import { createAIError } from '../errors.js';
8
9
  const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
9
10
  const parseContextPayload = (payload) => {
10
11
  if (!isRecord(payload))
@@ -37,7 +38,7 @@ export function useAgentContext(sessionId, agentId, options = {}) {
37
38
  setError(null);
38
39
  const response = await fetch(`/api/memory/context/${sessionId}/${agentId}`);
39
40
  if (!response.ok) {
40
- throw new Error(`Failed to load agent context: ${response.statusText}`);
41
+ throw createAIError('load agent context', response.status, response.statusText);
41
42
  }
42
43
  const payload = (await response.json());
43
44
  if (!mounted)
@@ -65,7 +66,7 @@ export function useAgentContext(sessionId, agentId, options = {}) {
65
66
  try {
66
67
  const response = await fetch(`/api/memory/context/${sessionId}/${agentId}`);
67
68
  if (!response.ok) {
68
- throw new Error(`Failed to sync agent context: ${response.statusText}`);
69
+ throw createAIError('sync agent context', response.status, response.statusText);
69
70
  }
70
71
  const payload = (await response.json());
71
72
  setContextState(parseContextPayload(payload));
@@ -98,7 +99,7 @@ export function useAgentContext(sessionId, agentId, options = {}) {
98
99
  body: JSON.stringify({ [key]: value }),
99
100
  });
100
101
  if (!response.ok) {
101
- throw new Error(`Failed to update context: ${response.statusText}`);
102
+ throw createAIError('update context', response.status, response.statusText);
102
103
  }
103
104
  const payload = (await response.json());
104
105
  setContextState(parseContextPayload(payload));
@@ -118,7 +119,7 @@ export function useAgentContext(sessionId, agentId, options = {}) {
118
119
  body: JSON.stringify(updates),
119
120
  });
120
121
  if (!response.ok) {
121
- throw new Error(`Failed to update context: ${response.statusText}`);
122
+ throw createAIError('update context', response.status, response.statusText);
122
123
  }
123
124
  const payload = (await response.json());
124
125
  setContextState(parseContextPayload(payload));
@@ -138,7 +139,7 @@ export function useAgentContext(sessionId, agentId, options = {}) {
138
139
  body: JSON.stringify({ key }),
139
140
  });
140
141
  if (!response.ok) {
141
- throw new Error(`Failed to remove context key: ${response.statusText}`);
142
+ throw createAIError('remove context key', response.status, response.statusText);
142
143
  }
143
144
  const payload = (await response.json());
144
145
  setContextState(parseContextPayload(payload));
@@ -1,7 +1,7 @@
1
1
  /**
2
- * useAgentStreamReact hook for streaming agent responses via SSE
2
+ * useAgentStream - React hook for streaming agent responses via SSE
3
3
  *
4
- * Uses fetch + ReadableStream (NOT EventSourceit doesn't support POST).
4
+ * Uses fetch + ReadableStream (NOT EventSource - it doesn't support POST).
5
5
  * Accumulates AgentStreamChunks into state and exposes:
6
6
  * - text: accumulated output text
7
7
  * - chunks: all received chunks in order
@@ -1,7 +1,7 @@
1
1
  /**
2
- * useAgentStreamReact hook for streaming agent responses via SSE
2
+ * useAgentStream - React hook for streaming agent responses via SSE
3
3
  *
4
- * Uses fetch + ReadableStream (NOT EventSourceit doesn't support POST).
4
+ * Uses fetch + ReadableStream (NOT EventSource - it doesn't support POST).
5
5
  * Accumulates AgentStreamChunks into state and exposes:
6
6
  * - text: accumulated output text
7
7
  * - chunks: all received chunks in order
@@ -80,7 +80,7 @@ export function useAgentStream() {
80
80
  }));
81
81
  }
82
82
  catch {
83
- // Malformed SSE dataskip
83
+ // Malformed SSE data - skip
84
84
  }
85
85
  }
86
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useEpisodicMemory.d.ts","sourceRoot":"","sources":["../../../src/client/hooks/useEpisodicMemory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAO9D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAC;IACzD,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAmCD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,CA4KzE"}
1
+ {"version":3,"file":"useEpisodicMemory.d.ts","sourceRoot":"","sources":["../../../src/client/hooks/useEpisodicMemory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAQ9D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAC;IACzD,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAmCD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,CA4KzE"}
@@ -4,6 +4,7 @@
4
4
  * React hook for managing episodic memory in client components.
5
5
  */
6
6
  import { useCallback, useEffect, useState } from 'react';
7
+ import { createAIError } from '../errors.js';
7
8
  const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
8
9
  const isAgentMemory = (value) => {
9
10
  if (!isRecord(value))
@@ -43,7 +44,7 @@ export function useEpisodicMemory(userId) {
43
44
  setError(null);
44
45
  const response = await fetch(`/api/memory/episodic/${userId}`);
45
46
  if (!response.ok) {
46
- throw new Error(`Failed to load episodic memory: ${response.statusText}`);
47
+ throw createAIError('load episodic memory', response.status, response.statusText);
47
48
  }
48
49
  const payload = (await response.json());
49
50
  if (!mounted)
@@ -75,7 +76,7 @@ export function useEpisodicMemory(userId) {
75
76
  setError(null);
76
77
  const response = await fetch(`/api/memory/episodic/${userId}`);
77
78
  if (!response.ok) {
78
- throw new Error(`Failed to refresh episodic memory: ${response.statusText}`);
79
+ throw createAIError('refresh episodic memory', response.status, response.statusText);
79
80
  }
80
81
  const payload = (await response.json());
81
82
  const parsed = parseEpisodicPayload(payload);
@@ -100,7 +101,7 @@ export function useEpisodicMemory(userId) {
100
101
  body: JSON.stringify(memory),
101
102
  });
102
103
  if (!response.ok) {
103
- throw new Error(`Failed to add memory: ${response.statusText}`);
104
+ throw createAIError('add memory', response.status, response.statusText);
104
105
  }
105
106
  const payload = (await response.json());
106
107
  const parsed = parseEpisodicPayload(payload);
@@ -121,7 +122,7 @@ export function useEpisodicMemory(userId) {
121
122
  method: 'DELETE',
122
123
  });
123
124
  if (!response.ok) {
124
- throw new Error(`Failed to remove memory: ${response.statusText}`);
125
+ throw createAIError('remove memory', response.status, response.statusText);
125
126
  }
126
127
  // Refresh to get updated list
127
128
  await refresh();
@@ -144,7 +145,7 @@ export function useEpisodicMemory(userId) {
144
145
  body: JSON.stringify({ query, options: { limit: 20, threshold: 0.5 } }),
145
146
  });
146
147
  if (!response.ok) {
147
- throw new Error(`Search failed: ${response.statusText}`);
148
+ throw createAIError('search memory', response.status, response.statusText);
148
149
  }
149
150
  const data = (await response.json());
150
151
  if (data.results && Array.isArray(data.results)) {
@@ -1 +1 @@
1
- {"version":3,"file":"useWorkingMemory.d.ts","sourceRoot":"","sources":["../../../src/client/hooks/useWorkingMemory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CA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AQ,CAAC;YACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9F,YAAY,EAAE,KAAK,CAAC;QAClB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,OAAO,EAAE,CAAC;QACjB,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAiHD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,uBAA4B,GACpC,sBAAsB,CA6NxB"}
@@ -4,6 +4,7 @@
4
4
  * React hook for managing working memory in client components.
5
5
  */
6
6
  import { useCallback, useEffect, useState } from 'react';
7
+ import { createAIError } from '../errors.js';
7
8
  const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
8
9
  const isSessionStatus = (value) => value === 'active' || value === 'paused' || value === 'completed';
9
10
  const isTaskStatus = (value) => value === 'pending' || value === 'running' || value === 'completed' || value === 'failed';
@@ -110,7 +111,7 @@ export function useWorkingMemory(sessionId, options = {}) {
110
111
  setError(null);
111
112
  const response = await fetch(`/api/memory/working/${sessionId}`);
112
113
  if (!response.ok) {
113
- throw new Error(`Failed to load working memory: ${response.statusText}`);
114
+ throw createAIError('load working memory', response.status, response.statusText);
114
115
  }
115
116
  const payload = (await response.json());
116
117
  if (!mounted)
@@ -141,7 +142,7 @@ export function useWorkingMemory(sessionId, options = {}) {
141
142
  try {
142
143
  const response = await fetch(`/api/memory/working/${sessionId}`);
143
144
  if (!response.ok) {
144
- throw new Error(`Failed to sync working memory: ${response.statusText}`);
145
+ throw createAIError('sync working memory', response.status, response.statusText);
145
146
  }
146
147
  const payload = (await response.json());
147
148
  const parsed = parseWorkingPayload(payload);
@@ -173,7 +174,7 @@ export function useWorkingMemory(sessionId, options = {}) {
173
174
  body: JSON.stringify({ context: newContext }),
174
175
  });
175
176
  if (!response.ok) {
176
- throw new Error(`Failed to update context: ${response.statusText}`);
177
+ throw createAIError('update context', response.status, response.statusText);
177
178
  }
178
179
  const payload = (await response.json());
179
180
  setContextState(parseContextPayload(payload));
@@ -206,7 +207,7 @@ export function useWorkingMemory(sessionId, options = {}) {
206
207
  body: JSON.stringify({ sessionState: state }),
207
208
  });
208
209
  if (!response.ok) {
209
- throw new Error(`Failed to update session state: ${response.statusText}`);
210
+ throw createAIError('update session state', response.status, response.statusText);
210
211
  }
211
212
  const payload = (await response.json());
212
213
  setSessionStateState(parseSessionPayload(payload));
@@ -227,7 +228,7 @@ export function useWorkingMemory(sessionId, options = {}) {
227
228
  body: JSON.stringify({ activeAgents: newAgents }),
228
229
  });
229
230
  if (!response.ok) {
230
- throw new Error(`Failed to add agent: ${response.statusText}`);
231
+ throw createAIError('add agent', response.status, response.statusText);
231
232
  }
232
233
  const payload = (await response.json());
233
234
  setActiveAgents(parseActiveAgentsPayload(payload));
@@ -248,7 +249,7 @@ export function useWorkingMemory(sessionId, options = {}) {
248
249
  body: JSON.stringify({ activeAgents: newAgents }),
249
250
  });
250
251
  if (!response.ok) {
251
- throw new Error(`Failed to remove agent: ${response.statusText}`);
252
+ throw createAIError('remove agent', response.status, response.statusText);
252
253
  }
253
254
  const payload = (await response.json());
254
255
  setActiveAgents(parseActiveAgentsPayload(payload));
@@ -4,7 +4,7 @@
4
4
  * Functions for generating embeddings using the configured LLM provider.
5
5
  * Provider is auto-detected from env vars (OLLAMA_BASE_URL → GROQ → ANTHROPIC).
6
6
  * For local/free inference use Ollama with `nomic-embed-text`.
7
- * Note: Groq and Anthropic do not support embeddingsuse Ollama for embedding tasks.
7
+ * Note: Groq and Anthropic do not support embeddings - use Ollama for embedding tasks.
8
8
  */
9
9
  import z from 'zod/v4';
10
10
  declare const EmbeddingSchema: z.ZodObject<{