@elizaos/api-client 1.0.12

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Shaw Walters and elizaOS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # @elizaos/api-client
2
+
3
+ Type-safe API client for ElizaOS server.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun add @elizaos/api-client
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { ElizaClient } from '@elizaos/api-client';
15
+
16
+ // Create client instance
17
+ const client = ElizaClient.create({
18
+ baseUrl: 'http://localhost:3000',
19
+ apiKey: 'your-api-key', // optional
20
+ });
21
+
22
+ // List all agents
23
+ const { agents } = await client.agents.listAgents();
24
+
25
+ // Create a new agent
26
+ const agent = await client.agents.createAgent({
27
+ name: 'My Agent',
28
+ description: 'A helpful assistant',
29
+ });
30
+
31
+ // Send a message
32
+ const message = await client.messaging.postMessage(channelId, 'Hello, world!');
33
+
34
+ // Upload media
35
+ const upload = await client.media.uploadAgentMedia(agentId, {
36
+ file: myFile,
37
+ filename: 'image.png',
38
+ });
39
+ ```
40
+
41
+ ## API Domains
42
+
43
+ ### Agents
44
+
45
+ - CRUD operations for agents
46
+ - Agent lifecycle management (start/stop)
47
+ - World management
48
+ - Plugin panels and logs
49
+
50
+ ### Messaging
51
+
52
+ - Message submission and management
53
+ - Channel operations
54
+ - Server management
55
+ - Message search
56
+
57
+ ### Memory
58
+
59
+ - Agent memory management
60
+ - Room operations
61
+ - World management
62
+
63
+ ### Audio
64
+
65
+ - Speech processing
66
+ - Text-to-speech
67
+ - Audio transcription
68
+
69
+ ### Media
70
+
71
+ - File uploads for agents and channels
72
+
73
+ ### Server
74
+
75
+ - Health checks and status
76
+ - Runtime debugging
77
+ - Log management
78
+
79
+ ### System
80
+
81
+ - Environment configuration
82
+
83
+ ## Error Handling
84
+
85
+ ```typescript
86
+ import { ApiError } from '@elizaos/api-client';
87
+
88
+ try {
89
+ await client.agents.getAgent(agentId);
90
+ } catch (error) {
91
+ if (error instanceof ApiError) {
92
+ console.error(`Error ${error.code}: ${error.message}`);
93
+ if (error.details) {
94
+ console.error('Details:', error.details);
95
+ }
96
+ }
97
+ }
98
+ ```
99
+
100
+ ## TypeScript Support
101
+
102
+ This package is written in TypeScript and provides full type definitions for all API endpoints, request parameters, and responses.