@elizaos/api-client 1.5.4 → 1.5.5

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 (139) hide show
  1. package/dist/index.d.ts +1102 -1
  2. package/dist/index.js +449 -144
  3. package/dist/index.js.map +1 -19
  4. package/package.json +6 -5
  5. package/dist/api-client/src/client.d.ts +0 -25
  6. package/dist/api-client/src/client.d.ts.map +0 -1
  7. package/dist/api-client/src/index.d.ts +0 -20
  8. package/dist/api-client/src/index.d.ts.map +0 -1
  9. package/dist/api-client/src/lib/base-client.d.ts +0 -31
  10. package/dist/api-client/src/lib/base-client.d.ts.map +0 -1
  11. package/dist/api-client/src/services/agents.d.ts +0 -107
  12. package/dist/api-client/src/services/agents.d.ts.map +0 -1
  13. package/dist/api-client/src/services/audio.d.ts +0 -48
  14. package/dist/api-client/src/services/audio.d.ts.map +0 -1
  15. package/dist/api-client/src/services/media.d.ts +0 -14
  16. package/dist/api-client/src/services/media.d.ts.map +0 -1
  17. package/dist/api-client/src/services/memory.d.ts +0 -107
  18. package/dist/api-client/src/services/memory.d.ts.map +0 -1
  19. package/dist/api-client/src/services/messaging.d.ts +0 -164
  20. package/dist/api-client/src/services/messaging.d.ts.map +0 -1
  21. package/dist/api-client/src/services/server.d.ts +0 -47
  22. package/dist/api-client/src/services/server.d.ts.map +0 -1
  23. package/dist/api-client/src/services/sessions.d.ts +0 -52
  24. package/dist/api-client/src/services/sessions.d.ts.map +0 -1
  25. package/dist/api-client/src/services/system.d.ts +0 -56
  26. package/dist/api-client/src/services/system.d.ts.map +0 -1
  27. package/dist/api-client/src/types/agents.d.ts +0 -67
  28. package/dist/api-client/src/types/agents.d.ts.map +0 -1
  29. package/dist/api-client/src/types/audio.d.ts +0 -42
  30. package/dist/api-client/src/types/audio.d.ts.map +0 -1
  31. package/dist/api-client/src/types/base.d.ts +0 -30
  32. package/dist/api-client/src/types/base.d.ts.map +0 -1
  33. package/dist/api-client/src/types/media.d.ts +0 -21
  34. package/dist/api-client/src/types/media.d.ts.map +0 -1
  35. package/dist/api-client/src/types/memory.d.ts +0 -43
  36. package/dist/api-client/src/types/memory.d.ts.map +0 -1
  37. package/dist/api-client/src/types/messaging.d.ts +0 -186
  38. package/dist/api-client/src/types/messaging.d.ts.map +0 -1
  39. package/dist/api-client/src/types/server.d.ts +0 -44
  40. package/dist/api-client/src/types/server.d.ts.map +0 -1
  41. package/dist/api-client/src/types/sessions.d.ts +0 -134
  42. package/dist/api-client/src/types/sessions.d.ts.map +0 -1
  43. package/dist/api-client/src/types/system.d.ts +0 -16
  44. package/dist/api-client/src/types/system.d.ts.map +0 -1
  45. package/dist/core/src/actions.d.ts +0 -23
  46. package/dist/core/src/actions.d.ts.map +0 -1
  47. package/dist/core/src/database.d.ts +0 -481
  48. package/dist/core/src/database.d.ts.map +0 -1
  49. package/dist/core/src/entities.d.ts +0 -49
  50. package/dist/core/src/entities.d.ts.map +0 -1
  51. package/dist/core/src/index.d.ts +0 -27
  52. package/dist/core/src/index.d.ts.map +0 -1
  53. package/dist/core/src/logger.d.ts +0 -47
  54. package/dist/core/src/logger.d.ts.map +0 -1
  55. package/dist/core/src/prompts.d.ts +0 -8
  56. package/dist/core/src/prompts.d.ts.map +0 -1
  57. package/dist/core/src/roles.d.ts +0 -30
  58. package/dist/core/src/roles.d.ts.map +0 -1
  59. package/dist/core/src/runtime.d.ts +0 -328
  60. package/dist/core/src/runtime.d.ts.map +0 -1
  61. package/dist/core/src/schemas/character.d.ts +0 -228
  62. package/dist/core/src/schemas/character.d.ts.map +0 -1
  63. package/dist/core/src/search.d.ts +0 -317
  64. package/dist/core/src/search.d.ts.map +0 -1
  65. package/dist/core/src/sentry/instrument.d.ts +0 -12
  66. package/dist/core/src/sentry/instrument.d.ts.map +0 -1
  67. package/dist/core/src/services.d.ts +0 -49
  68. package/dist/core/src/services.d.ts.map +0 -1
  69. package/dist/core/src/settings.d.ts +0 -87
  70. package/dist/core/src/settings.d.ts.map +0 -1
  71. package/dist/core/src/types/agent.d.ts +0 -98
  72. package/dist/core/src/types/agent.d.ts.map +0 -1
  73. package/dist/core/src/types/browser.d.ts +0 -127
  74. package/dist/core/src/types/browser.d.ts.map +0 -1
  75. package/dist/core/src/types/components.d.ts +0 -135
  76. package/dist/core/src/types/components.d.ts.map +0 -1
  77. package/dist/core/src/types/database.d.ts +0 -278
  78. package/dist/core/src/types/database.d.ts.map +0 -1
  79. package/dist/core/src/types/email.d.ts +0 -143
  80. package/dist/core/src/types/email.d.ts.map +0 -1
  81. package/dist/core/src/types/environment.d.ts +0 -109
  82. package/dist/core/src/types/environment.d.ts.map +0 -1
  83. package/dist/core/src/types/events.d.ts +0 -208
  84. package/dist/core/src/types/events.d.ts.map +0 -1
  85. package/dist/core/src/types/index.d.ts +0 -30
  86. package/dist/core/src/types/index.d.ts.map +0 -1
  87. package/dist/core/src/types/knowledge.d.ts +0 -60
  88. package/dist/core/src/types/knowledge.d.ts.map +0 -1
  89. package/dist/core/src/types/lp.d.ts +0 -115
  90. package/dist/core/src/types/lp.d.ts.map +0 -1
  91. package/dist/core/src/types/memory.d.ts +0 -165
  92. package/dist/core/src/types/memory.d.ts.map +0 -1
  93. package/dist/core/src/types/message.d.ts +0 -202
  94. package/dist/core/src/types/message.d.ts.map +0 -1
  95. package/dist/core/src/types/messaging.d.ts +0 -45
  96. package/dist/core/src/types/messaging.d.ts.map +0 -1
  97. package/dist/core/src/types/model.d.ts +0 -319
  98. package/dist/core/src/types/model.d.ts.map +0 -1
  99. package/dist/core/src/types/pdf.d.ts +0 -68
  100. package/dist/core/src/types/pdf.d.ts.map +0 -1
  101. package/dist/core/src/types/plugin.d.ts +0 -64
  102. package/dist/core/src/types/plugin.d.ts.map +0 -1
  103. package/dist/core/src/types/post.d.ts +0 -242
  104. package/dist/core/src/types/post.d.ts.map +0 -1
  105. package/dist/core/src/types/primitives.d.ts +0 -72
  106. package/dist/core/src/types/primitives.d.ts.map +0 -1
  107. package/dist/core/src/types/runtime.d.ts +0 -106
  108. package/dist/core/src/types/runtime.d.ts.map +0 -1
  109. package/dist/core/src/types/service.d.ts +0 -147
  110. package/dist/core/src/types/service.d.ts.map +0 -1
  111. package/dist/core/src/types/settings.d.ts +0 -30
  112. package/dist/core/src/types/settings.d.ts.map +0 -1
  113. package/dist/core/src/types/state.d.ts +0 -59
  114. package/dist/core/src/types/state.d.ts.map +0 -1
  115. package/dist/core/src/types/task.d.ts +0 -68
  116. package/dist/core/src/types/task.d.ts.map +0 -1
  117. package/dist/core/src/types/tee.d.ts +0 -97
  118. package/dist/core/src/types/tee.d.ts.map +0 -1
  119. package/dist/core/src/types/testing.d.ts +0 -29
  120. package/dist/core/src/types/testing.d.ts.map +0 -1
  121. package/dist/core/src/types/token.d.ts +0 -73
  122. package/dist/core/src/types/token.d.ts.map +0 -1
  123. package/dist/core/src/types/transcription.d.ts +0 -108
  124. package/dist/core/src/types/transcription.d.ts.map +0 -1
  125. package/dist/core/src/types/video.d.ts +0 -93
  126. package/dist/core/src/types/video.d.ts.map +0 -1
  127. package/dist/core/src/types/wallet.d.ts +0 -49
  128. package/dist/core/src/types/wallet.d.ts.map +0 -1
  129. package/dist/core/src/types/web-search.d.ts +0 -112
  130. package/dist/core/src/types/web-search.d.ts.map +0 -1
  131. package/dist/core/src/utils/buffer.d.ts +0 -105
  132. package/dist/core/src/utils/buffer.d.ts.map +0 -1
  133. package/dist/core/src/utils/environment.d.ts +0 -106
  134. package/dist/core/src/utils/environment.d.ts.map +0 -1
  135. package/dist/core/src/utils/server-health.d.ts +0 -23
  136. package/dist/core/src/utils/server-health.d.ts.map +0 -1
  137. package/dist/core/src/utils.d.ts +0 -177
  138. package/dist/core/src/utils.d.ts.map +0 -1
  139. package/dist/tsconfig.build.tsbuildinfo +0 -1
package/dist/index.d.ts CHANGED
@@ -1 +1,1102 @@
1
- export * from './api-client/src/index';
1
+ import { UUID, ChannelType } from '@elizaos/core';
2
+
3
+ interface ApiSuccessResponse<T> {
4
+ success: true;
5
+ data: T;
6
+ }
7
+ interface ApiErrorResponse {
8
+ success: false;
9
+ error: {
10
+ code: string;
11
+ message: string;
12
+ details?: string;
13
+ };
14
+ }
15
+ type ApiResponse<T> = ApiSuccessResponse<T> | ApiErrorResponse;
16
+ interface RequestConfig {
17
+ headers?: Record<string, string>;
18
+ params?: Record<string, any>;
19
+ timeout?: number;
20
+ }
21
+ interface PaginationParams {
22
+ page?: number;
23
+ limit?: number;
24
+ offset?: number;
25
+ }
26
+ interface ApiClientConfig {
27
+ baseUrl: string;
28
+ apiKey?: string;
29
+ timeout?: number;
30
+ headers?: Record<string, string>;
31
+ }
32
+
33
+ declare class ApiError extends Error {
34
+ code: string;
35
+ details?: string;
36
+ status?: number;
37
+ constructor(code: string, message: string, details?: string, status?: number);
38
+ }
39
+ declare abstract class BaseApiClient {
40
+ protected baseUrl: string;
41
+ protected apiKey?: string;
42
+ protected timeout: number;
43
+ protected defaultHeaders: Record<string, string>;
44
+ constructor(config: ApiClientConfig);
45
+ /**
46
+ * Creates a safe response for no-content scenarios (204 responses)
47
+ * Returns a sensible default based on common API patterns
48
+ */
49
+ private createNoContentResponse;
50
+ protected request<T>(method: string, path: string, options?: {
51
+ body?: any;
52
+ params?: Record<string, any>;
53
+ headers?: Record<string, string>;
54
+ config?: RequestConfig;
55
+ }): Promise<T>;
56
+ protected get<T>(path: string, options?: Omit<Parameters<typeof this.request>[2], 'body'>): Promise<T>;
57
+ protected post<T>(path: string, body?: any, options?: Parameters<typeof this.request>[2]): Promise<T>;
58
+ protected put<T>(path: string, body?: any, options?: Parameters<typeof this.request>[2]): Promise<T>;
59
+ protected patch<T>(path: string, body?: any, options?: Parameters<typeof this.request>[2]): Promise<T>;
60
+ protected delete<T>(path: string, options?: Omit<Parameters<typeof this.request>[2], 'body'>): Promise<T>;
61
+ }
62
+
63
+ interface Agent {
64
+ id: UUID;
65
+ name: string;
66
+ description?: string;
67
+ status: 'active' | 'inactive' | 'stopped';
68
+ enabled?: boolean;
69
+ createdAt: Date;
70
+ updatedAt: Date;
71
+ metadata?: Record<string, any>;
72
+ }
73
+ interface AgentCreateParams {
74
+ characterPath?: string;
75
+ characterJson?: Record<string, any>;
76
+ agent?: Record<string, any>;
77
+ }
78
+ interface AgentUpdateParams {
79
+ name?: string;
80
+ description?: string;
81
+ metadata?: Record<string, any>;
82
+ }
83
+ interface AgentWorld {
84
+ id: UUID;
85
+ name: string;
86
+ description?: string;
87
+ agents?: Agent[];
88
+ }
89
+ interface AgentWorldSettings {
90
+ worldId: UUID;
91
+ settings: Record<string, any>;
92
+ }
93
+ interface AgentPanel {
94
+ id: string;
95
+ name: string;
96
+ url: string;
97
+ type: string;
98
+ metadata?: Record<string, any>;
99
+ }
100
+ interface AgentLog {
101
+ id: UUID;
102
+ agentId: UUID;
103
+ level: 'debug' | 'info' | 'warn' | 'error';
104
+ message: string;
105
+ timestamp: Date;
106
+ metadata?: Record<string, any>;
107
+ }
108
+ interface AgentLogsParams extends PaginationParams {
109
+ level?: 'debug' | 'info' | 'warn' | 'error';
110
+ from?: Date | string;
111
+ to?: Date | string;
112
+ search?: string;
113
+ }
114
+
115
+ declare class AgentsService extends BaseApiClient {
116
+ /**
117
+ * List all agents with minimal details
118
+ */
119
+ listAgents(): Promise<{
120
+ agents: Agent[];
121
+ }>;
122
+ /**
123
+ * Get specific agent details
124
+ */
125
+ getAgent(agentId: UUID): Promise<Agent>;
126
+ /**
127
+ * Create a new agent
128
+ */
129
+ createAgent(params: AgentCreateParams): Promise<Agent>;
130
+ /**
131
+ * Update an existing agent
132
+ */
133
+ updateAgent(agentId: UUID, params: AgentUpdateParams): Promise<Agent>;
134
+ /**
135
+ * Delete an agent
136
+ */
137
+ deleteAgent(agentId: UUID): Promise<{
138
+ success: boolean;
139
+ }>;
140
+ /**
141
+ * Start an existing agent
142
+ */
143
+ startAgent(agentId: UUID): Promise<{
144
+ status: string;
145
+ }>;
146
+ /**
147
+ * Stop a running agent
148
+ */
149
+ stopAgent(agentId: UUID): Promise<{
150
+ status: string;
151
+ }>;
152
+ /**
153
+ * Get all available worlds
154
+ */
155
+ getWorlds(): Promise<{
156
+ worlds: AgentWorld[];
157
+ }>;
158
+ /**
159
+ * Add agent to a world
160
+ */
161
+ addAgentToWorld(agentId: UUID, worldId: UUID): Promise<{
162
+ success: boolean;
163
+ }>;
164
+ /**
165
+ * Update agent's world settings
166
+ */
167
+ updateAgentWorldSettings(agentId: UUID, worldId: UUID, settings: Record<string, any>): Promise<AgentWorldSettings>;
168
+ /**
169
+ * Get agent's plugin panels
170
+ */
171
+ getAgentPanels(agentId: UUID): Promise<{
172
+ panels: AgentPanel[];
173
+ }>;
174
+ /**
175
+ * Get agent logs
176
+ */
177
+ getAgentLogs(agentId: UUID, params?: AgentLogsParams): Promise<AgentLog[]>;
178
+ /**
179
+ * Delete a specific log entry
180
+ */
181
+ deleteAgentLog(agentId: UUID, logId: UUID): Promise<{
182
+ success: boolean;
183
+ }>;
184
+ /**
185
+ * Get agents associated with a server
186
+ */
187
+ getAgentsForServer(serverId: UUID): Promise<{
188
+ success: boolean;
189
+ data: {
190
+ serverId: UUID;
191
+ agents: UUID[];
192
+ };
193
+ }>;
194
+ addAgentToServer(serverId: UUID, agentId: UUID): Promise<{
195
+ success: boolean;
196
+ data: {
197
+ serverId: UUID;
198
+ agentId: UUID;
199
+ message: string;
200
+ };
201
+ }>;
202
+ removeAgentFromServer(serverId: UUID, agentId: UUID): Promise<{
203
+ success: boolean;
204
+ data: {
205
+ serverId: UUID;
206
+ agentId: UUID;
207
+ message: string;
208
+ };
209
+ }>;
210
+ getServersForAgent(agentId: UUID): Promise<{
211
+ success: boolean;
212
+ data: {
213
+ agentId: UUID;
214
+ servers: UUID[];
215
+ };
216
+ }>;
217
+ }
218
+
219
+ interface MessageServer {
220
+ id: UUID;
221
+ name: string;
222
+ sourceType: string;
223
+ sourceId?: string;
224
+ metadata?: Record<string, any>;
225
+ createdAt: Date;
226
+ updatedAt: Date;
227
+ }
228
+ interface MessageChannel {
229
+ id: UUID;
230
+ messageServerId: UUID;
231
+ name: string;
232
+ type: ChannelType;
233
+ sourceType?: string;
234
+ sourceId?: string;
235
+ topic?: string;
236
+ metadata?: Record<string, any>;
237
+ createdAt: Date;
238
+ updatedAt: Date;
239
+ }
240
+ interface Message {
241
+ id: UUID;
242
+ channelId: UUID;
243
+ authorId: UUID;
244
+ content: string;
245
+ rawMessage?: any;
246
+ inReplyToRootMessageId?: UUID;
247
+ sourceType?: string;
248
+ sourceId?: string;
249
+ createdAt: Date;
250
+ updatedAt: Date;
251
+ metadata?: Record<string, any>;
252
+ }
253
+ interface MessageSubmitParams {
254
+ agentId: UUID;
255
+ channelId: UUID;
256
+ content: string;
257
+ inReplyToMessageId?: UUID;
258
+ metadata?: Record<string, any>;
259
+ }
260
+ interface MessageCompleteParams {
261
+ messageId: UUID;
262
+ status: 'completed' | 'failed';
263
+ error?: string;
264
+ }
265
+ interface ExternalMessageParams {
266
+ platform: string;
267
+ channelId: string;
268
+ messages: Array<{
269
+ id: string;
270
+ authorId: string;
271
+ content: string;
272
+ timestamp: number;
273
+ metadata?: Record<string, any>;
274
+ }>;
275
+ }
276
+ interface ChannelCreateParams {
277
+ name: string;
278
+ type: ChannelType;
279
+ serverId?: UUID;
280
+ metadata?: Record<string, any>;
281
+ }
282
+ interface GroupChannelCreateParams {
283
+ name: string;
284
+ participantIds: UUID[];
285
+ metadata?: Record<string, any>;
286
+ }
287
+ interface DmChannelParams {
288
+ participantIds: [UUID, UUID];
289
+ }
290
+ interface ChannelParticipant {
291
+ id: UUID;
292
+ channelId: UUID;
293
+ userId: UUID;
294
+ role?: string;
295
+ joinedAt: Date;
296
+ }
297
+ interface MessageSearchParams extends PaginationParams {
298
+ query?: string;
299
+ channelId?: UUID;
300
+ authorId?: UUID;
301
+ from?: Date | string;
302
+ to?: Date | string;
303
+ }
304
+ interface ServerCreateParams {
305
+ name: string;
306
+ sourceType: string;
307
+ sourceId?: string;
308
+ metadata?: Record<string, any>;
309
+ }
310
+ interface ServerSyncParams {
311
+ channels: Array<{
312
+ name: string;
313
+ type: ChannelType;
314
+ sourceId: string;
315
+ }>;
316
+ }
317
+ interface ChannelUpdateParams {
318
+ name?: string;
319
+ participantCentralUserIds?: UUID[];
320
+ metadata?: Record<string, any>;
321
+ }
322
+
323
+ declare class MessagingService extends BaseApiClient {
324
+ /**
325
+ * Submit agent replies or system messages
326
+ */
327
+ submitMessage(params: MessageSubmitParams): Promise<Message>;
328
+ /**
329
+ * Notify message completion
330
+ */
331
+ completeMessage(params: MessageCompleteParams): Promise<{
332
+ success: boolean;
333
+ }>;
334
+ /**
335
+ * Ingest messages from external platforms
336
+ */
337
+ ingestExternalMessages(params: ExternalMessageParams): Promise<{
338
+ processed: number;
339
+ }>;
340
+ /**
341
+ * Create a new channel
342
+ */
343
+ createChannel(params: ChannelCreateParams): Promise<MessageChannel>;
344
+ /**
345
+ * Create a group channel
346
+ */
347
+ createGroupChannel(params: GroupChannelCreateParams): Promise<MessageChannel>;
348
+ /**
349
+ * Find or create a DM channel
350
+ */
351
+ getOrCreateDmChannel(params: DmChannelParams): Promise<MessageChannel>;
352
+ /**
353
+ * Get channel details
354
+ */
355
+ getChannelDetails(channelId: UUID): Promise<MessageChannel>;
356
+ /**
357
+ * Get channel participants
358
+ */
359
+ getChannelParticipants(channelId: UUID): Promise<{
360
+ participants: ChannelParticipant[];
361
+ }>;
362
+ /**
363
+ * Add agent to channel
364
+ */
365
+ addAgentToChannel(channelId: UUID, agentId: UUID): Promise<{
366
+ success: boolean;
367
+ }>;
368
+ /**
369
+ * Remove agent from channel
370
+ */
371
+ removeAgentFromChannel(channelId: UUID, agentId: UUID): Promise<{
372
+ success: boolean;
373
+ }>;
374
+ /**
375
+ * Delete a channel
376
+ */
377
+ deleteChannel(channelId: UUID): Promise<{
378
+ success: boolean;
379
+ }>;
380
+ /**
381
+ * Clear channel history
382
+ */
383
+ clearChannelHistory(channelId: UUID): Promise<{
384
+ deleted: number;
385
+ }>;
386
+ /**
387
+ * Post a new message to a channel
388
+ */
389
+ postMessage(channelId: UUID, content: string, metadata?: Record<string, any>): Promise<Message>;
390
+ /**
391
+ * Get channel messages
392
+ */
393
+ getChannelMessages(channelId: UUID, params?: PaginationParams & {
394
+ before?: Date | string;
395
+ after?: Date | string;
396
+ }): Promise<{
397
+ messages: Message[];
398
+ }>;
399
+ /**
400
+ * Get a specific message
401
+ */
402
+ getMessage(messageId: UUID): Promise<Message>;
403
+ /**
404
+ * Delete a message from a channel
405
+ */
406
+ deleteMessage(channelId: UUID, messageId: UUID): Promise<{
407
+ success: boolean;
408
+ }>;
409
+ /**
410
+ * Update a message
411
+ */
412
+ updateMessage(messageId: UUID, content: string): Promise<Message>;
413
+ /**
414
+ * Search messages
415
+ */
416
+ searchMessages(params: MessageSearchParams): Promise<{
417
+ messages: Message[];
418
+ }>;
419
+ /**
420
+ * List all message servers
421
+ */
422
+ listServers(): Promise<{
423
+ servers: MessageServer[];
424
+ }>;
425
+ /**
426
+ * Get server channels
427
+ */
428
+ getServerChannels(serverId: UUID): Promise<{
429
+ channels: MessageChannel[];
430
+ }>;
431
+ /**
432
+ * Create a new server
433
+ */
434
+ createServer(params: ServerCreateParams): Promise<MessageServer>;
435
+ /**
436
+ * Sync server channels
437
+ */
438
+ syncServerChannels(serverId: UUID, params: ServerSyncParams): Promise<{
439
+ synced: number;
440
+ }>;
441
+ /**
442
+ * Delete a server
443
+ */
444
+ deleteServer(serverId: UUID): Promise<{
445
+ success: boolean;
446
+ }>;
447
+ /**
448
+ * Update a channel
449
+ */
450
+ updateChannel(channelId: UUID, params: ChannelUpdateParams): Promise<{
451
+ success: boolean;
452
+ data: MessageChannel;
453
+ }>;
454
+ /**
455
+ * Generate channel title
456
+ */
457
+ generateChannelTitle(channelId: UUID, agentId: UUID): Promise<{
458
+ title: string;
459
+ }>;
460
+ /**
461
+ * Add user to channel participants (implemented via updateChannel)
462
+ */
463
+ addUserToChannel(channelId: UUID, userId: UUID): Promise<{
464
+ success: boolean;
465
+ data: MessageChannel;
466
+ }>;
467
+ /**
468
+ * Add multiple users to channel participants (implemented via updateChannel)
469
+ */
470
+ addUsersToChannel(channelId: UUID, userIds: UUID[]): Promise<{
471
+ success: boolean;
472
+ data: MessageChannel;
473
+ }>;
474
+ /**
475
+ * Remove user from channel participants (implemented via updateChannel)
476
+ */
477
+ removeUserFromChannel(channelId: UUID, userId: UUID): Promise<{
478
+ success: boolean;
479
+ data: MessageChannel;
480
+ }>;
481
+ }
482
+
483
+ interface Memory {
484
+ id: UUID;
485
+ agentId: UUID;
486
+ roomId?: UUID;
487
+ type: string;
488
+ content: any;
489
+ embedding?: number[];
490
+ createdAt: Date;
491
+ updatedAt: Date;
492
+ metadata?: Record<string, any>;
493
+ }
494
+ interface Room {
495
+ id: UUID;
496
+ agentId: UUID;
497
+ name: string;
498
+ type?: string;
499
+ createdAt: Date;
500
+ updatedAt: Date;
501
+ metadata?: Record<string, any>;
502
+ }
503
+ interface MemoryParams extends PaginationParams {
504
+ type?: string;
505
+ search?: string;
506
+ from?: Date | string;
507
+ to?: Date | string;
508
+ }
509
+ interface MemoryUpdateParams {
510
+ content?: any;
511
+ metadata?: Record<string, any>;
512
+ }
513
+ interface RoomCreateParams {
514
+ name: string;
515
+ type?: string;
516
+ metadata?: Record<string, any>;
517
+ }
518
+ interface WorldCreateParams {
519
+ serverId: UUID;
520
+ name: string;
521
+ description?: string;
522
+ }
523
+
524
+ declare class MemoryService extends BaseApiClient {
525
+ /**
526
+ * Get agent memories
527
+ */
528
+ getAgentMemories(agentId: UUID, params?: MemoryParams): Promise<{
529
+ memories: Memory[];
530
+ }>;
531
+ /**
532
+ * Get room-specific memories
533
+ */
534
+ getRoomMemories(agentId: UUID, roomId: UUID, params?: MemoryParams): Promise<{
535
+ memories: Memory[];
536
+ }>;
537
+ /**
538
+ * Update a memory
539
+ */
540
+ updateMemory(agentId: UUID, memoryId: UUID, params: MemoryUpdateParams): Promise<Memory>;
541
+ /**
542
+ * Clear all agent memories
543
+ */
544
+ clearAgentMemories(agentId: UUID): Promise<{
545
+ deleted: number;
546
+ }>;
547
+ /**
548
+ * Clear room memories
549
+ */
550
+ clearRoomMemories(agentId: UUID, roomId: UUID): Promise<{
551
+ deleted: number;
552
+ }>;
553
+ /**
554
+ * List agent's rooms
555
+ */
556
+ listAgentRooms(agentId: UUID): Promise<{
557
+ rooms: Room[];
558
+ }>;
559
+ /**
560
+ * Get room details
561
+ */
562
+ getRoom(agentId: UUID, roomId: UUID): Promise<Room>;
563
+ /**
564
+ * Create a room
565
+ */
566
+ createRoom(agentId: UUID, params: RoomCreateParams): Promise<Room>;
567
+ /**
568
+ * Create world from server
569
+ */
570
+ createWorldFromServer(serverId: UUID, params: WorldCreateParams): Promise<{
571
+ worldId: UUID;
572
+ }>;
573
+ /**
574
+ * Delete a world
575
+ */
576
+ deleteWorld(serverId: UUID): Promise<{
577
+ success: boolean;
578
+ }>;
579
+ /**
580
+ * Clear world memories
581
+ */
582
+ clearWorldMemories(serverId: UUID): Promise<{
583
+ deleted: number;
584
+ }>;
585
+ /**
586
+ * Delete a specific memory
587
+ */
588
+ deleteMemory(agentId: UUID, memoryId: UUID): Promise<{
589
+ success: boolean;
590
+ }>;
591
+ /**
592
+ * Get agent internal memories
593
+ */
594
+ getAgentInternalMemories(agentId: UUID, agentPerspectiveRoomId: UUID, includeEmbedding?: boolean): Promise<{
595
+ success: boolean;
596
+ data: any[];
597
+ }>;
598
+ /**
599
+ * Delete agent internal memory
600
+ */
601
+ deleteAgentInternalMemory(agentId: UUID, memoryId: UUID): Promise<{
602
+ success: boolean;
603
+ }>;
604
+ /**
605
+ * Delete all agent internal memories
606
+ */
607
+ deleteAllAgentInternalMemories(agentId: UUID, agentPerspectiveRoomId: UUID): Promise<{
608
+ success: boolean;
609
+ }>;
610
+ /**
611
+ * Update agent internal memory
612
+ */
613
+ updateAgentInternalMemory(agentId: UUID, memoryId: UUID, memoryData: any): Promise<any>;
614
+ /**
615
+ * Delete group memory (implemented via messaging channel message deletion)
616
+ */
617
+ deleteGroupMemory(serverId: UUID, memoryId: UUID): Promise<{
618
+ success: boolean;
619
+ }>;
620
+ /**
621
+ * Clear group chat (implemented via messaging channel history clearing)
622
+ */
623
+ clearGroupChat(serverId: UUID): Promise<{
624
+ success: boolean;
625
+ }>;
626
+ }
627
+
628
+ interface SpeechConversationParams {
629
+ audio: Blob | Buffer | string;
630
+ format?: 'mp3' | 'wav' | 'ogg' | 'webm';
631
+ language?: string;
632
+ metadata?: Record<string, any>;
633
+ }
634
+ interface SpeechGenerateParams {
635
+ text: string;
636
+ voice?: string;
637
+ language?: string;
638
+ speed?: number;
639
+ pitch?: number;
640
+ }
641
+ interface AudioSynthesizeParams {
642
+ messageId: UUID;
643
+ voice?: string;
644
+ format?: 'mp3' | 'wav' | 'ogg';
645
+ }
646
+ interface TranscribeParams {
647
+ audio: Blob | Buffer | string;
648
+ format?: 'mp3' | 'wav' | 'ogg' | 'webm';
649
+ language?: string;
650
+ }
651
+ interface SpeechResponse {
652
+ text?: string;
653
+ audio?: string;
654
+ duration?: number;
655
+ metadata?: Record<string, any>;
656
+ }
657
+ interface TranscriptionResponse {
658
+ text: string;
659
+ language?: string;
660
+ confidence?: number;
661
+ words?: Array<{
662
+ word: string;
663
+ start: number;
664
+ end: number;
665
+ confidence?: number;
666
+ }>;
667
+ }
668
+
669
+ declare class AudioService extends BaseApiClient {
670
+ /**
671
+ * Make a binary request using BaseApiClient infrastructure
672
+ */
673
+ private requestBinary;
674
+ /**
675
+ * Convert audio input to appropriate FormData value
676
+ */
677
+ private processAudioInput;
678
+ /**
679
+ * Check if a string appears to be base64 encoded
680
+ */
681
+ private isBase64String;
682
+ /**
683
+ * Safe check for Buffer type (works in both Node.js and browser environments)
684
+ */
685
+ private isBuffer;
686
+ /**
687
+ * Handle speech conversation
688
+ */
689
+ speechConversation(agentId: UUID, params: SpeechConversationParams): Promise<SpeechResponse>;
690
+ /**
691
+ * Generate speech from text
692
+ */
693
+ generateSpeech(agentId: UUID, params: SpeechGenerateParams): Promise<{
694
+ audio: string;
695
+ format: string;
696
+ }>;
697
+ /**
698
+ * Synthesize audio message
699
+ */
700
+ synthesizeAudioMessage(agentId: UUID, params: AudioSynthesizeParams): Promise<{
701
+ audio: string;
702
+ format: string;
703
+ }>;
704
+ /**
705
+ * Transcribe audio to text
706
+ */
707
+ transcribe(agentId: UUID, params: TranscribeParams): Promise<TranscriptionResponse>;
708
+ /**
709
+ * Process speech input
710
+ */
711
+ processSpeech(agentId: UUID, audio: Blob | Buffer | string, metadata?: Record<string, any>): Promise<SpeechResponse>;
712
+ }
713
+
714
+ interface MediaUploadParams {
715
+ file: File | Blob;
716
+ filename?: string;
717
+ contentType?: string;
718
+ metadata?: Record<string, any>;
719
+ }
720
+ interface MediaUploadResponse {
721
+ url: string;
722
+ type: string;
723
+ filename: string;
724
+ originalName: string;
725
+ size: number;
726
+ }
727
+ interface ChannelUploadResponse {
728
+ url: string;
729
+ type: string;
730
+ filename: string;
731
+ originalName: string;
732
+ size: number;
733
+ }
734
+
735
+ declare class MediaService extends BaseApiClient {
736
+ /**
737
+ * Upload media for an agent
738
+ */
739
+ uploadAgentMedia(agentId: UUID, params: MediaUploadParams): Promise<MediaUploadResponse>;
740
+ /**
741
+ * Upload file to a channel
742
+ */
743
+ uploadChannelMedia(channelId: UUID, file: File): Promise<ChannelUploadResponse>;
744
+ }
745
+
746
+ interface ServerHealth {
747
+ status: 'healthy' | 'degraded' | 'unhealthy';
748
+ uptime: number;
749
+ timestamp: Date;
750
+ version?: string;
751
+ checks?: Record<string, {
752
+ status: 'pass' | 'fail';
753
+ message?: string;
754
+ }>;
755
+ }
756
+ interface ServerStatus {
757
+ agents: {
758
+ total: number;
759
+ active: number;
760
+ inactive: number;
761
+ };
762
+ memory: {
763
+ used: number;
764
+ total: number;
765
+ percentage: number;
766
+ };
767
+ uptime: number;
768
+ version: string;
769
+ }
770
+ interface ServerDebugInfo {
771
+ runtime: {
772
+ agents: Array<{
773
+ id: UUID;
774
+ name: string;
775
+ status: string;
776
+ }>;
777
+ connections: number;
778
+ memory: any;
779
+ };
780
+ environment: Record<string, string>;
781
+ }
782
+ interface LogSubmitParams {
783
+ level: 'debug' | 'info' | 'warn' | 'error';
784
+ message: string;
785
+ source?: string;
786
+ metadata?: Record<string, any>;
787
+ }
788
+
789
+ declare class ServerService extends BaseApiClient {
790
+ /**
791
+ * Health check
792
+ */
793
+ checkHealth(): Promise<ServerHealth>;
794
+ /**
795
+ * Simple ping
796
+ */
797
+ ping(): Promise<{
798
+ pong: boolean;
799
+ }>;
800
+ /**
801
+ * Hello endpoint
802
+ */
803
+ hello(): Promise<{
804
+ message: string;
805
+ }>;
806
+ /**
807
+ * Get server status
808
+ */
809
+ getStatus(): Promise<ServerStatus>;
810
+ /**
811
+ * Stop the server
812
+ */
813
+ stopServer(): Promise<{
814
+ success: boolean;
815
+ }>;
816
+ /**
817
+ * Get runtime debug info
818
+ */
819
+ getDebugInfo(): Promise<ServerDebugInfo>;
820
+ /**
821
+ * Submit logs
822
+ */
823
+ submitLogs(logs: LogSubmitParams[]): Promise<{
824
+ received: number;
825
+ }>;
826
+ /**
827
+ * Clear logs
828
+ */
829
+ clearLogs(): Promise<{
830
+ cleared: number;
831
+ }>;
832
+ }
833
+
834
+ interface SystemEnvironment {
835
+ nodeVersion: string;
836
+ platform: string;
837
+ environment: 'development' | 'production' | 'test';
838
+ features: {
839
+ authentication: boolean;
840
+ tee: boolean;
841
+ plugins: string[];
842
+ };
843
+ configuration: Record<string, any>;
844
+ }
845
+ interface LocalEnvironmentUpdateParams {
846
+ variables: Record<string, string>;
847
+ merge?: boolean;
848
+ }
849
+
850
+ declare class SystemService extends BaseApiClient {
851
+ /**
852
+ * Retrieve the local environment variables from the ElizaOS server.
853
+ *
854
+ * Server route (packages/server/src/api/system):
855
+ * GET /api/system/env/local -> { success: true, data: Record<string,string> }
856
+ */
857
+ getEnvironment(): Promise<Record<string, string>>;
858
+ /**
859
+ * Update (overwrite or merge) the local .env file on the ElizaOS server.
860
+ *
861
+ * Server route (packages/server/src/api/system):
862
+ * POST /api/system/env/local -> { success: true, message: string }
863
+ * Body: { content: Record<string,string> }
864
+ *
865
+ * For developer-ergonomics we accept several shapes:
866
+ * 1. { variables: Record<string,string>; merge?: boolean }
867
+ * 2. { content: Record<string,string> } (server-native)
868
+ * 3. Record<string,string> (shorthand)
869
+ */
870
+ updateLocalEnvironment(params: LocalEnvironmentUpdateParams | {
871
+ content: Record<string, string>;
872
+ } | Record<string, string>): Promise<{
873
+ success: boolean;
874
+ message: string;
875
+ }>;
876
+ /**
877
+ * Global logs functionality - implementing via system endpoints
878
+ */
879
+ getGlobalLogs(params?: {
880
+ level?: string;
881
+ agentName?: string;
882
+ agentId?: string;
883
+ }): Promise<{
884
+ logs: Array<{
885
+ level: number;
886
+ time: number;
887
+ msg: string;
888
+ [key: string]: string | number | boolean | null | undefined;
889
+ }>;
890
+ count: number;
891
+ total: number;
892
+ level: string;
893
+ levels: string[];
894
+ }>;
895
+ private buildUrl;
896
+ private getHeaders;
897
+ deleteGlobalLogs(): Promise<{
898
+ status: string;
899
+ message: string;
900
+ }>;
901
+ deleteLog(logId: string): Promise<void>;
902
+ }
903
+
904
+ /**
905
+ * Attachment type for messages
906
+ */
907
+ interface MessageAttachment {
908
+ type: 'image' | 'file' | 'audio' | 'video' | 'document';
909
+ url: string;
910
+ name?: string;
911
+ size?: number;
912
+ mimeType?: string;
913
+ }
914
+ /**
915
+ * Message metadata type
916
+ */
917
+ interface MessageMetadata {
918
+ source?: string;
919
+ priority?: 'low' | 'normal' | 'high';
920
+ tags?: string[];
921
+ context?: Record<string, string | number | boolean>;
922
+ thought?: string;
923
+ actions?: string[];
924
+ [key: string]: string | number | boolean | string[] | Record<string, string | number | boolean> | undefined;
925
+ }
926
+ /**
927
+ * Metadata associated with a session
928
+ */
929
+ interface SessionMetadata {
930
+ platform?: string;
931
+ username?: string;
932
+ discriminator?: string;
933
+ avatar?: string;
934
+ [key: string]: string | number | boolean | undefined;
935
+ }
936
+ /**
937
+ * Represents a messaging session between a user and an agent
938
+ */
939
+ interface Session {
940
+ id: string;
941
+ agentId: UUID;
942
+ channelId: UUID;
943
+ userId: UUID;
944
+ metadata: SessionMetadata;
945
+ createdAt: Date;
946
+ lastActivity: Date;
947
+ }
948
+ /**
949
+ * Request parameters for creating a session
950
+ */
951
+ interface CreateSessionParams {
952
+ agentId: string;
953
+ userId: string;
954
+ metadata?: SessionMetadata;
955
+ }
956
+ /**
957
+ * Response for session creation
958
+ */
959
+ interface CreateSessionResponse {
960
+ sessionId: string;
961
+ agentId: UUID;
962
+ userId: UUID;
963
+ createdAt: Date;
964
+ metadata: SessionMetadata;
965
+ }
966
+ /**
967
+ * Request parameters for sending a message
968
+ */
969
+ interface SendMessageParams {
970
+ content: string;
971
+ attachments?: MessageAttachment[];
972
+ metadata?: MessageMetadata;
973
+ }
974
+ /**
975
+ * Query parameters for retrieving messages
976
+ */
977
+ interface GetMessagesParams extends PaginationParams {
978
+ before?: Date | string | number;
979
+ after?: Date | string | number;
980
+ }
981
+ /**
982
+ * Simplified message format for API responses
983
+ */
984
+ interface SimplifiedMessage {
985
+ id: string;
986
+ content: string;
987
+ authorId: string;
988
+ isAgent: boolean;
989
+ createdAt: Date;
990
+ metadata: MessageMetadata;
991
+ }
992
+ /**
993
+ * Response for message retrieval
994
+ */
995
+ interface GetMessagesResponse {
996
+ messages: SimplifiedMessage[];
997
+ hasMore: boolean;
998
+ }
999
+ /**
1000
+ * Session info response
1001
+ */
1002
+ interface SessionInfoResponse {
1003
+ sessionId: string;
1004
+ agentId: UUID;
1005
+ userId: UUID;
1006
+ createdAt: Date;
1007
+ lastActivity: Date;
1008
+ metadata: SessionMetadata;
1009
+ }
1010
+ /**
1011
+ * Health check response
1012
+ */
1013
+ interface SessionsHealthResponse {
1014
+ status: 'healthy' | 'unhealthy';
1015
+ activeSessions: number;
1016
+ timestamp: string;
1017
+ }
1018
+ /**
1019
+ * List sessions response
1020
+ */
1021
+ interface ListSessionsResponse {
1022
+ sessions: SessionInfoResponse[];
1023
+ total: number;
1024
+ }
1025
+ /**
1026
+ * Message response when sending a message
1027
+ */
1028
+ interface MessageResponse {
1029
+ id: string;
1030
+ content: string;
1031
+ authorId: string;
1032
+ createdAt: Date;
1033
+ metadata?: MessageMetadata;
1034
+ }
1035
+
1036
+ /**
1037
+ * Service for managing messaging sessions between users and agents
1038
+ */
1039
+ declare class SessionsService extends BaseApiClient {
1040
+ /**
1041
+ * Get health status of the sessions service
1042
+ * @returns Health check response
1043
+ */
1044
+ checkHealth(): Promise<SessionsHealthResponse>;
1045
+ /**
1046
+ * Create a new messaging session
1047
+ * @param params Session creation parameters
1048
+ * @returns Created session response
1049
+ */
1050
+ createSession(params: CreateSessionParams): Promise<CreateSessionResponse>;
1051
+ /**
1052
+ * Get session details
1053
+ * @param sessionId Session ID
1054
+ * @returns Session information
1055
+ */
1056
+ getSession(sessionId: string): Promise<SessionInfoResponse>;
1057
+ /**
1058
+ * Send a message in a session
1059
+ * @param sessionId Session ID
1060
+ * @param params Message parameters
1061
+ * @returns Message response
1062
+ */
1063
+ sendMessage(sessionId: string, params: SendMessageParams): Promise<MessageResponse>;
1064
+ /**
1065
+ * Get messages from a session
1066
+ * @param sessionId Session ID
1067
+ * @param params Query parameters for pagination and filtering
1068
+ * @returns Messages response
1069
+ */
1070
+ getMessages(sessionId: string, params?: GetMessagesParams): Promise<GetMessagesResponse>;
1071
+ /**
1072
+ * Delete a session
1073
+ * @param sessionId Session ID
1074
+ * @returns Success response
1075
+ */
1076
+ deleteSession(sessionId: string): Promise<{
1077
+ success: boolean;
1078
+ }>;
1079
+ /**
1080
+ * List all active sessions (admin endpoint)
1081
+ * @returns List of active sessions
1082
+ */
1083
+ listSessions(): Promise<ListSessionsResponse>;
1084
+ }
1085
+
1086
+ declare class ElizaClient {
1087
+ readonly agents: AgentsService;
1088
+ readonly messaging: MessagingService;
1089
+ readonly memory: MemoryService;
1090
+ readonly audio: AudioService;
1091
+ readonly media: MediaService;
1092
+ readonly server: ServerService;
1093
+ readonly system: SystemService;
1094
+ readonly sessions: SessionsService;
1095
+ constructor(config: ApiClientConfig);
1096
+ /**
1097
+ * Create a new ElizaClient instance
1098
+ */
1099
+ static create(config: ApiClientConfig): ElizaClient;
1100
+ }
1101
+
1102
+ export { type Agent, type AgentCreateParams, type AgentLog, type AgentLogsParams, type AgentPanel, type AgentUpdateParams, type AgentWorld, type AgentWorldSettings, AgentsService, type ApiClientConfig, ApiError, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, AudioService, type AudioSynthesizeParams, BaseApiClient, type ChannelCreateParams, type ChannelParticipant, type ChannelUpdateParams, type ChannelUploadResponse, type CreateSessionParams, type CreateSessionResponse, type DmChannelParams, ElizaClient, type ExternalMessageParams, type GetMessagesParams, type GetMessagesResponse, type GroupChannelCreateParams, type ListSessionsResponse, type LocalEnvironmentUpdateParams, type LogSubmitParams, MediaService, type MediaUploadParams, type MediaUploadResponse, type Memory, type MemoryParams, MemoryService, type MemoryUpdateParams, type Message, type MessageAttachment, type MessageChannel, type MessageCompleteParams, type MessageMetadata, type MessageResponse, type MessageSearchParams, type MessageServer, type MessageSubmitParams, MessagingService, type PaginationParams, type RequestConfig, type Room, type RoomCreateParams, type SendMessageParams, type ServerCreateParams, type ServerDebugInfo, type ServerHealth, ServerService, type ServerStatus, type ServerSyncParams, type Session, type SessionInfoResponse, type SessionMetadata, type SessionsHealthResponse, SessionsService, type SimplifiedMessage, type SpeechConversationParams, type SpeechGenerateParams, type SpeechResponse, type SystemEnvironment, SystemService, type TranscribeParams, type TranscriptionResponse, type WorldCreateParams };