@elizaos/ui 2.0.0-alpha.526 → 2.0.0-alpha.528

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 (237) hide show
  1. package/apps/app-elizamaker/src/index.d.ts +2 -0
  2. package/apps/app-elizamaker/src/index.d.ts.map +1 -1
  3. package/apps/app-elizamaker/src/index.js +2 -0
  4. package/apps/app-elizamaker/src/init-registry-services.d.ts +18 -0
  5. package/apps/app-elizamaker/src/init-registry-services.d.ts.map +1 -0
  6. package/apps/app-elizamaker/src/init-registry-services.js +63 -0
  7. package/apps/app-elizamaker/src/plugin.d.ts.map +1 -1
  8. package/apps/app-elizamaker/src/plugin.js +7 -0
  9. package/apps/app-elizamaker/src/registry-service-registry.d.ts +4 -0
  10. package/apps/app-elizamaker/src/registry-service-registry.d.ts.map +1 -0
  11. package/apps/app-elizamaker/src/registry-service-registry.js +7 -0
  12. package/apps/app-lifeops/src/automation-node-contributor.d.ts +2 -0
  13. package/apps/app-lifeops/src/automation-node-contributor.d.ts.map +1 -0
  14. package/apps/app-lifeops/src/automation-node-contributor.js +93 -0
  15. package/apps/app-lifeops/src/public.d.ts.map +1 -1
  16. package/apps/app-lifeops/src/public.js +2 -0
  17. package/apps/app-training/src/services/training-service-registry.d.ts +4 -0
  18. package/apps/app-training/src/services/training-service-registry.d.ts.map +1 -0
  19. package/apps/app-training/src/services/training-service-registry.js +7 -0
  20. package/package.json +1 -1
  21. package/packages/agent/src/api/agent-status-routes.d.ts +3 -23
  22. package/packages/agent/src/api/agent-status-routes.d.ts.map +1 -1
  23. package/packages/agent/src/api/agent-status-routes.js +7 -40
  24. package/packages/agent/src/api/coordinator-wiring.d.ts.map +1 -0
  25. package/packages/agent/src/api/misc-routes.d.ts.map +1 -1
  26. package/packages/agent/src/api/misc-routes.js +3 -37
  27. package/packages/agent/src/api/nfa-routes.d.ts.map +1 -1
  28. package/packages/agent/src/api/nfa-routes.js +1 -9
  29. package/packages/agent/src/api/provider-switch-routes.d.ts +8 -7
  30. package/packages/agent/src/api/provider-switch-routes.d.ts.map +1 -1
  31. package/packages/agent/src/api/provider-switch-routes.js +41 -26
  32. package/packages/agent/src/api/server-types.d.ts +0 -6
  33. package/packages/agent/src/api/server-types.d.ts.map +1 -1
  34. package/packages/agent/src/api/server.d.ts.map +1 -1
  35. package/packages/agent/src/api/server.js +31 -138
  36. package/packages/agent/src/api/stream-routes.d.ts.map +1 -1
  37. package/packages/agent/src/api/stream-routes.js +6 -8
  38. package/packages/agent/src/api/wallet-trading-profile.d.ts.map +1 -1
  39. package/packages/agent/src/api/wallet-trading-profile.js +2 -23
  40. package/packages/agent/src/auth/account-storage.d.ts.map +1 -1
  41. package/packages/agent/src/auth/account-storage.js +4 -15
  42. package/packages/agent/src/runtime/eliza.d.ts.map +1 -1
  43. package/packages/agent/src/runtime/eliza.js +2 -6
  44. package/packages/agent/src/runtime/first-time-setup.d.ts.map +1 -1
  45. package/packages/agent/src/runtime/first-time-setup.js +1 -7
  46. package/packages/agent/src/runtime/operations/cold-strategy.d.ts +4 -4
  47. package/packages/agent/src/runtime/operations/cold-strategy.d.ts.map +1 -1
  48. package/packages/agent/src/runtime/operations/cold-strategy.js +13 -46
  49. package/packages/agent/src/runtime/operations/health-checks.d.ts +1 -0
  50. package/packages/agent/src/runtime/operations/health-checks.d.ts.map +1 -1
  51. package/packages/agent/src/runtime/operations/health-checks.js +1 -1
  52. package/packages/agent/src/runtime/operations/health.d.ts.map +1 -1
  53. package/packages/agent/src/runtime/operations/health.js +1 -13
  54. package/packages/agent/src/runtime/operations/index.d.ts +1 -0
  55. package/packages/agent/src/runtime/operations/index.d.ts.map +1 -1
  56. package/packages/agent/src/runtime/operations/index.js +1 -0
  57. package/packages/agent/src/runtime/operations/manager.d.ts +2 -0
  58. package/packages/agent/src/runtime/operations/manager.d.ts.map +1 -1
  59. package/packages/agent/src/runtime/operations/manager.js +27 -7
  60. package/packages/agent/src/runtime/operations/reload-hot.d.ts +4 -1
  61. package/packages/agent/src/runtime/operations/reload-hot.d.ts.map +1 -1
  62. package/packages/agent/src/runtime/operations/reload-hot.js +46 -41
  63. package/packages/agent/src/runtime/operations/repository.d.ts +30 -8
  64. package/packages/agent/src/runtime/operations/repository.d.ts.map +1 -1
  65. package/packages/agent/src/runtime/operations/repository.js +140 -54
  66. package/packages/agent/src/runtime/operations/types.d.ts +26 -24
  67. package/packages/agent/src/runtime/operations/types.d.ts.map +1 -1
  68. package/packages/agent/src/runtime/operations/types.js +8 -20
  69. package/packages/agent/src/runtime/operations/vault-bridge.d.ts +60 -0
  70. package/packages/agent/src/runtime/operations/vault-bridge.d.ts.map +1 -0
  71. package/packages/agent/src/runtime/operations/vault-bridge.js +80 -0
  72. package/packages/agent/src/runtime/plugin-resolver.d.ts.map +1 -1
  73. package/packages/agent/src/runtime/plugin-resolver.js +1 -3
  74. package/packages/agent/src/runtime/plugin-types.d.ts.map +1 -1
  75. package/packages/agent/src/runtime/plugin-types.js +1 -3
  76. package/packages/agent/src/services/app-package-modules.d.ts.map +1 -1
  77. package/packages/agent/src/services/app-package-modules.js +1 -8
  78. package/packages/agent/src/services/app-run-store.d.ts.map +1 -1
  79. package/packages/agent/src/services/app-run-store.js +2 -23
  80. package/packages/agent/src/services/registry-client-local.d.ts.map +1 -1
  81. package/packages/agent/src/services/registry-client-local.js +1 -9
  82. package/packages/agent/src/utils/atomic-json.d.ts +37 -0
  83. package/packages/agent/src/utils/atomic-json.d.ts.map +1 -0
  84. package/packages/agent/src/utils/atomic-json.js +98 -0
  85. package/packages/app-core/src/api/automation-node-contributors.d.ts +14 -0
  86. package/packages/app-core/src/api/automation-node-contributors.d.ts.map +1 -0
  87. package/packages/app-core/src/api/automation-node-contributors.js +14 -0
  88. package/packages/app-core/src/api/client-agent.d.ts +627 -0
  89. package/packages/app-core/src/api/client-agent.d.ts.map +1 -0
  90. package/packages/app-core/src/api/client-agent.js +1442 -0
  91. package/packages/app-core/src/api/client-automations.d.ts +8 -0
  92. package/packages/app-core/src/api/client-automations.d.ts.map +1 -0
  93. package/packages/app-core/src/api/client-automations.js +7 -0
  94. package/packages/app-core/src/api/client-base.d.ts +82 -0
  95. package/packages/app-core/src/api/client-base.d.ts.map +1 -0
  96. package/packages/app-core/src/api/client-base.js +729 -0
  97. package/packages/app-core/src/api/client-browser-workspace.d.ts +25 -0
  98. package/packages/app-core/src/api/client-browser-workspace.d.ts.map +1 -0
  99. package/packages/app-core/src/api/client-browser-workspace.js +98 -0
  100. package/packages/app-core/src/api/client-chat.d.ts +355 -0
  101. package/packages/app-core/src/api/client-chat.d.ts.map +1 -0
  102. package/packages/app-core/src/api/client-chat.js +582 -0
  103. package/packages/app-core/src/api/client-cloud.d.ts +286 -0
  104. package/packages/app-core/src/api/client-cloud.d.ts.map +1 -0
  105. package/packages/app-core/src/api/client-cloud.js +410 -0
  106. package/packages/app-core/src/api/client-computeruse.d.ts +32 -0
  107. package/packages/app-core/src/api/client-computeruse.d.ts.map +1 -0
  108. package/packages/app-core/src/api/client-computeruse.js +16 -0
  109. package/packages/app-core/src/api/client-imessage.d.ts +68 -0
  110. package/packages/app-core/src/api/client-imessage.d.ts.map +1 -0
  111. package/packages/app-core/src/api/client-imessage.js +74 -0
  112. package/packages/app-core/src/api/client-local-inference.d.ts +62 -0
  113. package/packages/app-core/src/api/client-local-inference.d.ts.map +1 -0
  114. package/packages/app-core/src/api/client-local-inference.js +87 -0
  115. package/packages/app-core/src/api/client-n8n.d.ts +27 -0
  116. package/packages/app-core/src/api/client-n8n.d.ts.map +1 -0
  117. package/packages/app-core/src/api/client-n8n.js +61 -0
  118. package/packages/app-core/src/api/client-skills.d.ts +475 -0
  119. package/packages/app-core/src/api/client-skills.d.ts.map +1 -0
  120. package/packages/app-core/src/api/client-skills.js +608 -0
  121. package/packages/app-core/src/api/client-types-babylon.d.ts +254 -0
  122. package/packages/app-core/src/api/client-types-babylon.d.ts.map +1 -0
  123. package/packages/app-core/src/api/client-types-babylon.js +2 -0
  124. package/packages/app-core/src/api/client-types-character.d.ts +39 -0
  125. package/packages/app-core/src/api/client-types-character.d.ts.map +1 -0
  126. package/packages/app-core/src/api/client-types-character.js +1 -0
  127. package/packages/app-core/src/api/client-types-chat.d.ts +428 -0
  128. package/packages/app-core/src/api/client-types-chat.d.ts.map +1 -0
  129. package/packages/app-core/src/api/client-types-chat.js +9 -0
  130. package/packages/app-core/src/api/client-types-config.d.ts +587 -0
  131. package/packages/app-core/src/api/client-types-config.d.ts.map +1 -0
  132. package/packages/app-core/src/api/client-types-config.js +5 -0
  133. package/packages/app-core/src/api/client-types-experience.d.ts +97 -0
  134. package/packages/app-core/src/api/client-types-experience.d.ts.map +1 -0
  135. package/packages/app-core/src/api/client-types-experience.js +1 -0
  136. package/packages/app-core/src/api/client-types-relationships.d.ts +181 -0
  137. package/packages/app-core/src/api/client-types-relationships.d.ts.map +1 -0
  138. package/packages/app-core/src/api/client-types-relationships.js +1 -0
  139. package/packages/app-core/src/api/client-types-steward.d.ts +85 -0
  140. package/packages/app-core/src/api/client-types-steward.d.ts.map +1 -0
  141. package/packages/app-core/src/api/client-types-steward.js +9 -0
  142. package/packages/app-core/src/api/client-types.d.ts +9 -0
  143. package/packages/app-core/src/api/client-types.d.ts.map +1 -0
  144. package/packages/app-core/src/api/client-types.js +12 -0
  145. package/packages/app-core/src/api/client-wallet.d.ts +130 -0
  146. package/packages/app-core/src/api/client-wallet.d.ts.map +1 -0
  147. package/packages/app-core/src/api/client-wallet.js +228 -0
  148. package/packages/app-core/src/api/client.d.ts +36 -0
  149. package/packages/app-core/src/api/client.d.ts.map +1 -0
  150. package/packages/app-core/src/api/client.js +36 -0
  151. package/packages/app-core/src/api/index.d.ts +2 -0
  152. package/packages/app-core/src/api/index.d.ts.map +1 -0
  153. package/packages/app-core/src/api/index.js +1 -0
  154. package/packages/app-core/src/bridge/electrobun-rpc.d.ts +57 -0
  155. package/packages/app-core/src/bridge/electrobun-rpc.d.ts.map +1 -0
  156. package/packages/app-core/src/bridge/electrobun-rpc.js +87 -0
  157. package/packages/app-core/src/bridge/electrobun-runtime.d.ts +3 -0
  158. package/packages/app-core/src/bridge/electrobun-runtime.d.ts.map +1 -0
  159. package/packages/app-core/src/bridge/electrobun-runtime.js +34 -0
  160. package/packages/app-core/src/bridge/native-plugins.d.ts +504 -0
  161. package/packages/app-core/src/bridge/native-plugins.d.ts.map +1 -0
  162. package/packages/app-core/src/bridge/native-plugins.js +67 -0
  163. package/packages/app-core/src/chat/coding-agent-session-state.d.ts +16 -0
  164. package/packages/app-core/src/chat/coding-agent-session-state.d.ts.map +1 -0
  165. package/packages/app-core/src/chat/coding-agent-session-state.js +27 -0
  166. package/packages/app-core/src/components/pages/browser-workspace-wallet.d.ts +80 -0
  167. package/packages/app-core/src/components/pages/browser-workspace-wallet.d.ts.map +1 -0
  168. package/packages/app-core/src/components/pages/browser-workspace-wallet.js +135 -0
  169. package/packages/app-core/src/services/account-pool.d.ts +98 -0
  170. package/packages/app-core/src/services/account-pool.d.ts.map +1 -0
  171. package/packages/app-core/src/services/account-pool.js +506 -0
  172. package/packages/app-core/src/services/account-usage.d.ts +75 -0
  173. package/packages/app-core/src/services/account-usage.d.ts.map +1 -0
  174. package/packages/app-core/src/services/account-usage.js +179 -0
  175. package/packages/app-core/src/services/local-inference/active-model.d.ts +59 -0
  176. package/packages/app-core/src/services/local-inference/active-model.d.ts.map +1 -0
  177. package/packages/app-core/src/services/local-inference/active-model.js +120 -0
  178. package/packages/app-core/src/services/local-inference/device-bridge.d.ts +131 -0
  179. package/packages/app-core/src/services/local-inference/device-bridge.d.ts.map +1 -0
  180. package/packages/app-core/src/services/local-inference/device-bridge.js +748 -0
  181. package/packages/app-core/src/services/local-inference/engine.d.ts +52 -0
  182. package/packages/app-core/src/services/local-inference/engine.d.ts.map +1 -0
  183. package/packages/app-core/src/services/local-inference/engine.js +138 -0
  184. package/packages/app-core/src/services/local-inference/external-scanner.d.ts +17 -0
  185. package/packages/app-core/src/services/local-inference/external-scanner.d.ts.map +1 -0
  186. package/packages/app-core/src/services/local-inference/external-scanner.js +261 -0
  187. package/packages/app-core/src/services/local-inference/handler-registry.d.ts +72 -0
  188. package/packages/app-core/src/services/local-inference/handler-registry.d.ts.map +1 -0
  189. package/packages/app-core/src/services/local-inference/handler-registry.js +160 -0
  190. package/packages/app-core/src/services/local-inference/paths.d.ts +24 -0
  191. package/packages/app-core/src/services/local-inference/paths.d.ts.map +1 -0
  192. package/packages/app-core/src/services/local-inference/paths.js +41 -0
  193. package/packages/app-core/src/services/local-inference/providers.d.ts +61 -0
  194. package/packages/app-core/src/services/local-inference/providers.d.ts.map +1 -0
  195. package/packages/app-core/src/services/local-inference/providers.js +277 -0
  196. package/packages/app-core/src/services/local-inference/registry.d.ts +35 -0
  197. package/packages/app-core/src/services/local-inference/registry.d.ts.map +1 -0
  198. package/packages/app-core/src/services/local-inference/registry.js +108 -0
  199. package/packages/app-core/src/services/local-inference/routing-preferences.d.ts +31 -0
  200. package/packages/app-core/src/services/local-inference/routing-preferences.d.ts.map +1 -0
  201. package/packages/app-core/src/services/local-inference/routing-preferences.js +72 -0
  202. package/packages/app-core/src/services/local-inference/types.d.ts +121 -0
  203. package/packages/app-core/src/services/local-inference/types.d.ts.map +1 -0
  204. package/packages/app-core/src/services/local-inference/types.js +14 -0
  205. package/packages/app-core/src/services/local-inference/verify.d.ts +39 -0
  206. package/packages/app-core/src/services/local-inference/verify.d.ts.map +1 -0
  207. package/packages/app-core/src/services/local-inference/verify.js +104 -0
  208. package/packages/app-core/src/types/index.d.ts +658 -0
  209. package/packages/app-core/src/types/index.d.ts.map +1 -0
  210. package/packages/app-core/src/types/index.js +4 -0
  211. package/packages/app-core/src/utils/assistant-text.d.ts +2 -0
  212. package/packages/app-core/src/utils/assistant-text.d.ts.map +1 -0
  213. package/packages/app-core/src/utils/assistant-text.js +167 -0
  214. package/packages/app-core/src/utils/eliza-globals.d.ts +15 -0
  215. package/packages/app-core/src/utils/eliza-globals.d.ts.map +1 -0
  216. package/packages/app-core/src/utils/eliza-globals.js +50 -0
  217. package/packages/app-core/src/utils/streaming-text.d.ts +9 -0
  218. package/packages/app-core/src/utils/streaming-text.d.ts.map +1 -0
  219. package/packages/app-core/src/utils/streaming-text.js +112 -0
  220. package/packages/shared/src/format-error.d.ts +14 -0
  221. package/packages/shared/src/format-error.d.ts.map +1 -0
  222. package/packages/shared/src/format-error.js +17 -0
  223. package/packages/shared/src/index.d.ts +1 -0
  224. package/packages/shared/src/index.d.ts.map +1 -1
  225. package/packages/shared/src/index.js +1 -0
  226. package/packages/typescript/src/runtime.d.ts +14 -0
  227. package/packages/typescript/src/runtime.d.ts.map +1 -1
  228. package/packages/typescript/src/runtime.js +42 -0
  229. package/packages/typescript/src/services/message.d.ts +8 -0
  230. package/packages/typescript/src/services/message.d.ts.map +1 -1
  231. package/packages/typescript/src/services/message.js +51 -0
  232. package/packages/typescript/src/services/task.d.ts +1 -0
  233. package/packages/typescript/src/services/task.d.ts.map +1 -1
  234. package/packages/typescript/src/services/task.js +26 -3
  235. package/apps/app-task-coordinator/src/api/coordinator-wiring.d.ts.map +0 -1
  236. /package/{apps/app-task-coordinator → packages/agent}/src/api/coordinator-wiring.d.ts +0 -0
  237. /package/{apps/app-task-coordinator → packages/agent}/src/api/coordinator-wiring.js +0 -0
@@ -0,0 +1,582 @@
1
+ /**
2
+ * Chat domain methods — chat, conversations, knowledge, memory, MCP,
3
+ * share ingest, workbench, trajectories, database.
4
+ */
5
+ import { ElizaClient } from "./client-base";
6
+ // ---------------------------------------------------------------------------
7
+ // Prototype augmentation
8
+ // ---------------------------------------------------------------------------
9
+ const LEGACY_CHAT_COMPAT_TITLE = "Quick Chat";
10
+ const LEGACY_CHAT_CONVERSATION_STORAGE_PREFIX = "legacy_chat_conversation";
11
+ function getLegacyChatConversationStorageKey(client) {
12
+ const base = client.getBaseUrl() ||
13
+ (typeof window !== "undefined" ? window.location.origin : "same-origin");
14
+ return `${LEGACY_CHAT_CONVERSATION_STORAGE_PREFIX}:${encodeURIComponent(base)}`;
15
+ }
16
+ function readLegacyChatConversationId(client) {
17
+ if (typeof window === "undefined") {
18
+ return null;
19
+ }
20
+ const stored = window.sessionStorage.getItem(getLegacyChatConversationStorageKey(client));
21
+ return stored?.trim() ? stored.trim() : null;
22
+ }
23
+ function writeLegacyChatConversationId(client, conversationId) {
24
+ if (typeof window === "undefined") {
25
+ return;
26
+ }
27
+ const key = getLegacyChatConversationStorageKey(client);
28
+ if (conversationId?.trim()) {
29
+ window.sessionStorage.setItem(key, conversationId.trim());
30
+ return;
31
+ }
32
+ window.sessionStorage.removeItem(key);
33
+ }
34
+ async function ensureLegacyChatConversationId(client) {
35
+ const cached = readLegacyChatConversationId(client);
36
+ if (cached) {
37
+ return cached;
38
+ }
39
+ const { conversation } = await client.createConversation(LEGACY_CHAT_COMPAT_TITLE);
40
+ writeLegacyChatConversationId(client, conversation.id);
41
+ return conversation.id;
42
+ }
43
+ ElizaClient.prototype.sendChatRest = async function (text, channelType = "DM", conversationMode) {
44
+ const sendToConversation = async (conversationId) => this.sendConversationMessage(conversationId, text, channelType, undefined, conversationMode);
45
+ const conversationId = await ensureLegacyChatConversationId(this);
46
+ try {
47
+ return await sendToConversation(conversationId);
48
+ }
49
+ catch (error) {
50
+ if (error instanceof Error &&
51
+ error.name === "ApiError" &&
52
+ error.status === 404) {
53
+ writeLegacyChatConversationId(this, null);
54
+ return sendToConversation(await ensureLegacyChatConversationId(this));
55
+ }
56
+ throw error;
57
+ }
58
+ };
59
+ ElizaClient.prototype.sendChatStream = async function (text, onToken, channelType = "DM", signal, conversationMode) {
60
+ const streamConversation = async (conversationId) => this.sendConversationMessageStream(conversationId, text, onToken, channelType, signal, undefined, conversationMode);
61
+ const conversationId = await ensureLegacyChatConversationId(this);
62
+ try {
63
+ return await streamConversation(conversationId);
64
+ }
65
+ catch (error) {
66
+ if (error instanceof Error &&
67
+ error.name === "ApiError" &&
68
+ error.status === 404) {
69
+ writeLegacyChatConversationId(this, null);
70
+ return streamConversation(await ensureLegacyChatConversationId(this));
71
+ }
72
+ throw error;
73
+ }
74
+ };
75
+ ElizaClient.prototype.listConversations = async function () {
76
+ return this.fetch("/api/conversations");
77
+ };
78
+ ElizaClient.prototype.createConversation = async function (title, options) {
79
+ const response = await this.fetch("/api/conversations", {
80
+ method: "POST",
81
+ body: JSON.stringify({
82
+ title,
83
+ ...(options?.includeGreeting === true ||
84
+ options?.bootstrapGreeting === true
85
+ ? { includeGreeting: true }
86
+ : {}),
87
+ ...(typeof options?.lang === "string" && options.lang.trim()
88
+ ? { lang: options.lang.trim() }
89
+ : {}),
90
+ ...(options?.metadata ? { metadata: options.metadata } : {}),
91
+ }),
92
+ });
93
+ if (!response.greeting) {
94
+ return response;
95
+ }
96
+ return {
97
+ ...response,
98
+ greeting: {
99
+ ...response.greeting,
100
+ text: this.normalizeGreetingText(response.greeting.text),
101
+ },
102
+ };
103
+ };
104
+ ElizaClient.prototype.getConversationMessages = async function (id) {
105
+ const response = await this.fetch(`/api/conversations/${encodeURIComponent(id)}/messages`);
106
+ return {
107
+ messages: response.messages.map((message) => {
108
+ if (message.role !== "assistant")
109
+ return message;
110
+ const text = this.normalizeAssistantText(message.text);
111
+ return text === message.text ? message : { ...message, text };
112
+ }),
113
+ };
114
+ };
115
+ ElizaClient.prototype.getInboxMessages = async function (options) {
116
+ const params = new URLSearchParams();
117
+ if (typeof options?.limit === "number" && options.limit > 0) {
118
+ params.set("limit", String(options.limit));
119
+ }
120
+ if (options?.sources && options.sources.length > 0) {
121
+ params.set("sources", options.sources.join(","));
122
+ }
123
+ if (typeof options?.roomId === "string" && options.roomId.length > 0) {
124
+ params.set("roomId", options.roomId);
125
+ }
126
+ if (typeof options?.roomSource === "string" &&
127
+ options.roomSource.length > 0) {
128
+ params.set("roomSource", options.roomSource);
129
+ }
130
+ const query = params.toString();
131
+ const path = query ? `/api/inbox/messages?${query}` : "/api/inbox/messages";
132
+ return this.fetch(path);
133
+ };
134
+ ElizaClient.prototype.getInboxSources = async function () {
135
+ return this.fetch("/api/inbox/sources");
136
+ };
137
+ ElizaClient.prototype.getInboxChats = async function (options) {
138
+ const params = new URLSearchParams();
139
+ if (options?.sources && options.sources.length > 0) {
140
+ params.set("sources", options.sources.join(","));
141
+ }
142
+ const query = params.toString();
143
+ const path = query ? `/api/inbox/chats?${query}` : "/api/inbox/chats";
144
+ return this.fetch(path);
145
+ };
146
+ ElizaClient.prototype.sendInboxMessage = async function (data) {
147
+ return this.fetch("/api/inbox/messages", {
148
+ method: "POST",
149
+ body: JSON.stringify(data),
150
+ });
151
+ };
152
+ ElizaClient.prototype.truncateConversationMessages = async function (id, messageId, options) {
153
+ return this.fetch(`/api/conversations/${encodeURIComponent(id)}/messages/truncate`, {
154
+ method: "POST",
155
+ body: JSON.stringify({
156
+ messageId,
157
+ inclusive: options?.inclusive === true,
158
+ }),
159
+ });
160
+ };
161
+ ElizaClient.prototype.sendConversationMessage = async function (id, text, channelType = "DM", images, conversationMode, metadata) {
162
+ const response = await this.fetch(`/api/conversations/${encodeURIComponent(id)}/messages`, {
163
+ method: "POST",
164
+ body: JSON.stringify({
165
+ text,
166
+ channelType,
167
+ ...(images?.length ? { images } : {}),
168
+ ...(conversationMode ? { conversationMode } : {}),
169
+ ...(metadata ? { metadata } : {}),
170
+ }),
171
+ });
172
+ return {
173
+ ...response,
174
+ text: response.noResponseReason === "ignored"
175
+ ? ""
176
+ : this.normalizeAssistantText(response.text),
177
+ };
178
+ };
179
+ ElizaClient.prototype.sendConversationMessageStream = async function (id, text, onToken, channelType = "DM", signal, images, conversationMode, metadata) {
180
+ return this.streamChatEndpoint(`/api/conversations/${encodeURIComponent(id)}/messages/stream`, text, onToken, channelType, signal, images, conversationMode, metadata);
181
+ };
182
+ ElizaClient.prototype.requestGreeting = async function (id, lang) {
183
+ const qs = lang ? `?lang=${encodeURIComponent(lang)}` : "";
184
+ const response = await this.fetch(`/api/conversations/${encodeURIComponent(id)}/greeting${qs}`, {
185
+ method: "POST",
186
+ });
187
+ return {
188
+ ...response,
189
+ text: this.normalizeGreetingText(response.text),
190
+ };
191
+ };
192
+ ElizaClient.prototype.renameConversation = async function (id, title, options) {
193
+ return this.updateConversation(id, {
194
+ title,
195
+ generate: options?.generate,
196
+ });
197
+ };
198
+ ElizaClient.prototype.updateConversation = async function (id, data) {
199
+ return this.fetch(`/api/conversations/${encodeURIComponent(id)}`, {
200
+ method: "PATCH",
201
+ body: JSON.stringify({
202
+ ...(typeof data?.title === "string" ? { title: data.title } : {}),
203
+ ...(typeof data?.generate === "boolean"
204
+ ? { generate: data.generate }
205
+ : {}),
206
+ ...(data && "metadata" in data ? { metadata: data.metadata } : {}),
207
+ }),
208
+ });
209
+ };
210
+ ElizaClient.prototype.deleteConversation = async function (id) {
211
+ return this.fetch(`/api/conversations/${encodeURIComponent(id)}`, {
212
+ method: "DELETE",
213
+ });
214
+ };
215
+ ElizaClient.prototype.cleanupEmptyConversations = async function (options) {
216
+ return this.fetch("/api/conversations/cleanup-empty", {
217
+ method: "POST",
218
+ headers: { "Content-Type": "application/json" },
219
+ body: JSON.stringify({
220
+ ...(options?.keepId ? { keepId: options.keepId } : {}),
221
+ }),
222
+ });
223
+ };
224
+ ElizaClient.prototype.getKnowledgeStats = async function () {
225
+ return this.fetch("/api/knowledge/stats");
226
+ };
227
+ ElizaClient.prototype.listKnowledgeDocuments = async function (options) {
228
+ const params = new URLSearchParams();
229
+ if (options?.limit)
230
+ params.set("limit", String(options.limit));
231
+ if (options?.offset)
232
+ params.set("offset", String(options.offset));
233
+ const query = params.toString();
234
+ return this.fetch(`/api/knowledge/documents${query ? `?${query}` : ""}`);
235
+ };
236
+ ElizaClient.prototype.getKnowledgeDocument = async function (documentId) {
237
+ return this.fetch(`/api/knowledge/documents/${encodeURIComponent(documentId)}`);
238
+ };
239
+ ElizaClient.prototype.updateKnowledgeDocument = async function (documentId, data) {
240
+ return this.fetch(`/api/knowledge/documents/${encodeURIComponent(documentId)}`, {
241
+ method: "PATCH",
242
+ body: JSON.stringify(data),
243
+ });
244
+ };
245
+ ElizaClient.prototype.deleteKnowledgeDocument = async function (documentId) {
246
+ return this.fetch(`/api/knowledge/documents/${encodeURIComponent(documentId)}`, { method: "DELETE" });
247
+ };
248
+ ElizaClient.prototype.uploadKnowledgeDocument = async function (data) {
249
+ return this.fetch("/api/knowledge/documents", {
250
+ method: "POST",
251
+ body: JSON.stringify(data),
252
+ });
253
+ };
254
+ ElizaClient.prototype.uploadKnowledgeDocumentsBulk = async function (data) {
255
+ return this.fetch("/api/knowledge/documents/bulk", {
256
+ method: "POST",
257
+ body: JSON.stringify(data),
258
+ });
259
+ };
260
+ ElizaClient.prototype.uploadKnowledgeFromUrl = async function (url, metadata) {
261
+ return this.fetch("/api/knowledge/documents/url", {
262
+ method: "POST",
263
+ body: JSON.stringify({ url, metadata }),
264
+ });
265
+ };
266
+ ElizaClient.prototype.searchKnowledge = async function (query, options) {
267
+ const params = new URLSearchParams({ q: query });
268
+ if (options?.threshold !== undefined)
269
+ params.set("threshold", String(options.threshold));
270
+ if (options?.limit !== undefined)
271
+ params.set("limit", String(options.limit));
272
+ return this.fetch(`/api/knowledge/search?${params}`);
273
+ };
274
+ ElizaClient.prototype.getKnowledgeFragments = async function (documentId) {
275
+ return this.fetch(`/api/knowledge/fragments/${encodeURIComponent(documentId)}`);
276
+ };
277
+ ElizaClient.prototype.listScratchpadTopics = async function () {
278
+ return this.fetch("/api/knowledge/scratchpad/topics");
279
+ };
280
+ ElizaClient.prototype.createScratchpadTopic = async function (data) {
281
+ return this.fetch("/api/knowledge/scratchpad/topics", {
282
+ method: "POST",
283
+ body: JSON.stringify(data),
284
+ });
285
+ };
286
+ ElizaClient.prototype.getScratchpadTopic = async function (topicId) {
287
+ return this.fetch(`/api/knowledge/scratchpad/topics/${encodeURIComponent(topicId)}`);
288
+ };
289
+ ElizaClient.prototype.replaceScratchpadTopic = async function (topicId, data) {
290
+ return this.fetch(`/api/knowledge/scratchpad/topics/${encodeURIComponent(topicId)}`, {
291
+ method: "PUT",
292
+ body: JSON.stringify(data),
293
+ });
294
+ };
295
+ ElizaClient.prototype.deleteScratchpadTopic = async function (topicId) {
296
+ return this.fetch(`/api/knowledge/scratchpad/topics/${encodeURIComponent(topicId)}`, { method: "DELETE" });
297
+ };
298
+ ElizaClient.prototype.searchScratchpadTopics = async function (query, options) {
299
+ const params = new URLSearchParams({ q: query });
300
+ if (options?.limit !== undefined)
301
+ params.set("limit", String(options.limit));
302
+ return this.fetch(`/api/knowledge/scratchpad/search?${params}`);
303
+ };
304
+ ElizaClient.prototype.previewScratchpadSummary = async function (data) {
305
+ return this.fetch("/api/knowledge/scratchpad/summary-preview", {
306
+ method: "POST",
307
+ body: JSON.stringify(data),
308
+ });
309
+ };
310
+ ElizaClient.prototype.rememberMemory = async function (text) {
311
+ return this.fetch("/api/memory/remember", {
312
+ method: "POST",
313
+ body: JSON.stringify({ text }),
314
+ });
315
+ };
316
+ ElizaClient.prototype.searchMemory = async function (query, options) {
317
+ const params = new URLSearchParams({ q: query });
318
+ if (options?.limit !== undefined)
319
+ params.set("limit", String(options.limit));
320
+ return this.fetch(`/api/memory/search?${params}`);
321
+ };
322
+ ElizaClient.prototype.quickContext = async function (query, options) {
323
+ const params = new URLSearchParams({ q: query });
324
+ if (options?.limit !== undefined)
325
+ params.set("limit", String(options.limit));
326
+ return this.fetch(`/api/context/quick?${params}`);
327
+ };
328
+ ElizaClient.prototype.getMemoryFeed = async function (query) {
329
+ const params = new URLSearchParams();
330
+ if (query?.type)
331
+ params.set("type", query.type);
332
+ if (typeof query?.limit === "number")
333
+ params.set("limit", String(query.limit));
334
+ if (typeof query?.before === "number")
335
+ params.set("before", String(query.before));
336
+ const qs = params.toString();
337
+ return this.fetch(`/api/memories/feed${qs ? `?${qs}` : ""}`);
338
+ };
339
+ ElizaClient.prototype.browseMemories = async function (query) {
340
+ const params = new URLSearchParams();
341
+ if (query?.type)
342
+ params.set("type", query.type);
343
+ if (query?.entityId)
344
+ params.set("entityId", query.entityId);
345
+ if (query?.roomId)
346
+ params.set("roomId", query.roomId);
347
+ if (query?.q)
348
+ params.set("q", query.q);
349
+ if (typeof query?.limit === "number")
350
+ params.set("limit", String(query.limit));
351
+ if (typeof query?.offset === "number")
352
+ params.set("offset", String(query.offset));
353
+ const qs = params.toString();
354
+ return this.fetch(`/api/memories/browse${qs ? `?${qs}` : ""}`);
355
+ };
356
+ ElizaClient.prototype.getMemoriesByEntity = async function (entityId, query) {
357
+ const params = new URLSearchParams();
358
+ if (query?.type)
359
+ params.set("type", query.type);
360
+ if (typeof query?.limit === "number")
361
+ params.set("limit", String(query.limit));
362
+ if (typeof query?.offset === "number")
363
+ params.set("offset", String(query.offset));
364
+ if (query?.entityIds && query.entityIds.length > 0)
365
+ params.set("entityIds", query.entityIds.join(","));
366
+ const qs = params.toString();
367
+ return this.fetch(`/api/memories/by-entity/${encodeURIComponent(entityId)}${qs ? `?${qs}` : ""}`);
368
+ };
369
+ ElizaClient.prototype.getMemoryStats = async function () {
370
+ return this.fetch("/api/memories/stats");
371
+ };
372
+ ElizaClient.prototype.getMcpConfig = async function () {
373
+ return this.fetch("/api/mcp/config");
374
+ };
375
+ ElizaClient.prototype.getMcpStatus = async function () {
376
+ return this.fetch("/api/mcp/status");
377
+ };
378
+ ElizaClient.prototype.searchMcpMarketplace = async function (query, limit) {
379
+ const params = new URLSearchParams({ q: query, limit: String(limit) });
380
+ return this.fetch(`/api/mcp/marketplace/search?${params}`);
381
+ };
382
+ ElizaClient.prototype.getMcpServerDetails = async function (name) {
383
+ return this.fetch(`/api/mcp/marketplace/${encodeURIComponent(name)}`);
384
+ };
385
+ ElizaClient.prototype.addMcpServer = async function (name, config) {
386
+ await this.fetch("/api/mcp/servers", {
387
+ method: "POST",
388
+ body: JSON.stringify({ name, config }),
389
+ });
390
+ };
391
+ ElizaClient.prototype.removeMcpServer = async function (name) {
392
+ await this.fetch(`/api/mcp/servers/${encodeURIComponent(name)}`, {
393
+ method: "DELETE",
394
+ });
395
+ };
396
+ ElizaClient.prototype.ingestShare = async function (payload) {
397
+ return this.fetch("/api/ingest/share", {
398
+ method: "POST",
399
+ body: JSON.stringify(payload),
400
+ });
401
+ };
402
+ ElizaClient.prototype.consumeShareIngest = async function () {
403
+ return this.fetch("/api/share/consume", { method: "POST" });
404
+ };
405
+ ElizaClient.prototype.getWorkbenchOverview = async function () {
406
+ return this.fetch("/api/workbench/overview");
407
+ };
408
+ ElizaClient.prototype.listWorkbenchTasks = async function () {
409
+ return this.fetch("/api/workbench/tasks");
410
+ };
411
+ ElizaClient.prototype.getWorkbenchTask = async function (taskId) {
412
+ return this.fetch(`/api/workbench/tasks/${encodeURIComponent(taskId)}`);
413
+ };
414
+ ElizaClient.prototype.createWorkbenchTask = async function (data) {
415
+ return this.fetch("/api/workbench/tasks", {
416
+ method: "POST",
417
+ body: JSON.stringify(data),
418
+ });
419
+ };
420
+ ElizaClient.prototype.updateWorkbenchTask = async function (taskId, data) {
421
+ return this.fetch(`/api/workbench/tasks/${encodeURIComponent(taskId)}`, {
422
+ method: "PUT",
423
+ body: JSON.stringify(data),
424
+ });
425
+ };
426
+ ElizaClient.prototype.deleteWorkbenchTask = async function (taskId) {
427
+ return this.fetch(`/api/workbench/tasks/${encodeURIComponent(taskId)}`, {
428
+ method: "DELETE",
429
+ });
430
+ };
431
+ ElizaClient.prototype.listWorkbenchTodos = async function () {
432
+ return this.fetch("/api/workbench/todos");
433
+ };
434
+ ElizaClient.prototype.getWorkbenchTodo = async function (todoId) {
435
+ return this.fetch(`/api/workbench/todos/${encodeURIComponent(todoId)}`);
436
+ };
437
+ ElizaClient.prototype.createWorkbenchTodo = async function (data) {
438
+ return this.fetch("/api/workbench/todos", {
439
+ method: "POST",
440
+ body: JSON.stringify(data),
441
+ });
442
+ };
443
+ ElizaClient.prototype.updateWorkbenchTodo = async function (todoId, data) {
444
+ return this.fetch(`/api/workbench/todos/${encodeURIComponent(todoId)}`, {
445
+ method: "PUT",
446
+ body: JSON.stringify(data),
447
+ });
448
+ };
449
+ ElizaClient.prototype.setWorkbenchTodoCompleted = async function (todoId, isCompleted) {
450
+ await this.fetch(`/api/workbench/todos/${encodeURIComponent(todoId)}/complete`, {
451
+ method: "POST",
452
+ body: JSON.stringify({ isCompleted }),
453
+ });
454
+ };
455
+ ElizaClient.prototype.deleteWorkbenchTodo = async function (todoId) {
456
+ return this.fetch(`/api/workbench/todos/${encodeURIComponent(todoId)}`, {
457
+ method: "DELETE",
458
+ });
459
+ };
460
+ ElizaClient.prototype.refreshRegistry = async function () {
461
+ await this.fetch("/api/apps/refresh", { method: "POST" });
462
+ };
463
+ ElizaClient.prototype.getTrajectories = async function (options) {
464
+ const params = new URLSearchParams();
465
+ if (options?.limit)
466
+ params.set("limit", String(options.limit));
467
+ if (options?.offset)
468
+ params.set("offset", String(options.offset));
469
+ if (options?.source)
470
+ params.set("source", options.source);
471
+ if (options?.scenarioId)
472
+ params.set("scenarioId", options.scenarioId);
473
+ if (options?.batchId)
474
+ params.set("batchId", options.batchId);
475
+ if (options?.status)
476
+ params.set("status", options.status);
477
+ if (options?.startDate)
478
+ params.set("startDate", options.startDate);
479
+ if (options?.endDate)
480
+ params.set("endDate", options.endDate);
481
+ if (options?.search)
482
+ params.set("search", options.search);
483
+ const query = params.toString();
484
+ return this.fetch(`/api/trajectories${query ? `?${query}` : ""}`);
485
+ };
486
+ ElizaClient.prototype.getTrajectoryDetail = async function (trajectoryId) {
487
+ return this.fetch(`/api/trajectories/${encodeURIComponent(trajectoryId)}`);
488
+ };
489
+ ElizaClient.prototype.getTrajectoryStats = async function () {
490
+ return this.fetch("/api/trajectories/stats");
491
+ };
492
+ ElizaClient.prototype.getTrajectoryConfig = async function () {
493
+ return this.fetch("/api/trajectories/config");
494
+ };
495
+ ElizaClient.prototype.updateTrajectoryConfig = async function (config) {
496
+ return this.fetch("/api/trajectories/config", {
497
+ method: "PUT",
498
+ body: JSON.stringify(config),
499
+ });
500
+ };
501
+ ElizaClient.prototype.exportTrajectories = async function (options) {
502
+ const res = await this.rawRequest("/api/trajectories/export", {
503
+ method: "POST",
504
+ headers: {
505
+ "Content-Type": "application/json",
506
+ },
507
+ body: JSON.stringify(options),
508
+ });
509
+ return res.blob();
510
+ };
511
+ ElizaClient.prototype.deleteTrajectories = async function (trajectoryIds) {
512
+ return this.fetch("/api/trajectories", {
513
+ method: "DELETE",
514
+ body: JSON.stringify({ trajectoryIds }),
515
+ });
516
+ };
517
+ ElizaClient.prototype.clearAllTrajectories = async function () {
518
+ return this.fetch("/api/trajectories", {
519
+ method: "DELETE",
520
+ body: JSON.stringify({ clearAll: true }),
521
+ });
522
+ };
523
+ ElizaClient.prototype.getDatabaseStatus = async function () {
524
+ return this.fetch("/api/database/status");
525
+ };
526
+ ElizaClient.prototype.getDatabaseConfig = async function () {
527
+ return this.fetch("/api/database/config");
528
+ };
529
+ ElizaClient.prototype.saveDatabaseConfig = async function (config) {
530
+ return this.fetch("/api/database/config", {
531
+ method: "PUT",
532
+ body: JSON.stringify(config),
533
+ });
534
+ };
535
+ ElizaClient.prototype.testDatabaseConnection = async function (creds) {
536
+ return this.fetch("/api/database/test", {
537
+ method: "POST",
538
+ body: JSON.stringify(creds),
539
+ });
540
+ };
541
+ ElizaClient.prototype.getDatabaseTables = async function () {
542
+ return this.fetch("/api/database/tables");
543
+ };
544
+ ElizaClient.prototype.getDatabaseRows = async function (table, opts) {
545
+ const params = new URLSearchParams();
546
+ if (opts?.offset != null)
547
+ params.set("offset", String(opts.offset));
548
+ if (opts?.limit != null)
549
+ params.set("limit", String(opts.limit));
550
+ if (opts?.sort)
551
+ params.set("sort", opts.sort);
552
+ if (opts?.order)
553
+ params.set("order", opts.order);
554
+ if (opts?.search)
555
+ params.set("search", opts.search);
556
+ const qs = params.toString();
557
+ return this.fetch(`/api/database/tables/${encodeURIComponent(table)}/rows${qs ? `?${qs}` : ""}`);
558
+ };
559
+ ElizaClient.prototype.insertDatabaseRow = async function (table, data) {
560
+ return this.fetch(`/api/database/tables/${encodeURIComponent(table)}/rows`, {
561
+ method: "POST",
562
+ body: JSON.stringify({ data }),
563
+ });
564
+ };
565
+ ElizaClient.prototype.updateDatabaseRow = async function (table, where, data) {
566
+ return this.fetch(`/api/database/tables/${encodeURIComponent(table)}/rows`, {
567
+ method: "PUT",
568
+ body: JSON.stringify({ where, data }),
569
+ });
570
+ };
571
+ ElizaClient.prototype.deleteDatabaseRow = async function (table, where) {
572
+ return this.fetch(`/api/database/tables/${encodeURIComponent(table)}/rows`, {
573
+ method: "DELETE",
574
+ body: JSON.stringify({ where }),
575
+ });
576
+ };
577
+ ElizaClient.prototype.executeDatabaseQuery = async function (sql, readOnly = true) {
578
+ return this.fetch("/api/database/query", {
579
+ method: "POST",
580
+ body: JSON.stringify({ sql, readOnly }),
581
+ });
582
+ };