@elizaos/server 1.6.2-alpha.8 → 1.6.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{main-CpHBkAFA.js → main-BtcZiEuQ.js} +3 -3
- package/dist/client/assets/{main-CpHBkAFA.js.map → main-BtcZiEuQ.js.map} +1 -1
- package/dist/client/assets/{main-CNv6B3RZ.css → main-DrN44Cbu.css} +1 -1
- package/dist/client/assets/main-r3TR7Sku.js +155 -0
- package/dist/client/assets/{main-SfTqS-Wp.js.map → main-r3TR7Sku.js.map} +1 -1
- package/dist/client/assets/react-vendor-DPGVcrXi.js +611 -0
- package/dist/client/assets/react-vendor-DPGVcrXi.js.map +1 -0
- package/dist/client/index.html +1 -1
- package/dist/index.d.ts +50 -22
- package/dist/index.js +1489 -1325
- package/package.json +5 -5
- package/dist/characters/default.d.ts +0 -14
- package/dist/client/assets/main-SfTqS-Wp.js +0 -155
- package/dist/client/assets/react-vendor-C1OK-nqm.js +0 -611
- package/dist/client/assets/react-vendor-C1OK-nqm.js.map +0 -1
- package/dist/managers/ConfigManager.d.ts +0 -32
- package/dist/managers/PluginInstaller.d.ts +0 -10
- package/dist/managers/PluginLoader.d.ts +0 -27
package/dist/client/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
7
7
|
<title>ElizaOS - Client</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-BtcZiEuQ.js"></script>
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/dist/index.d.ts
CHANGED
|
@@ -21,17 +21,21 @@ export declare function resolvePgliteDir(dir?: string, fallbackDir?: string): st
|
|
|
21
21
|
*/
|
|
22
22
|
export type ServerMiddleware = (req: express.Request, res: express.Response, next: express.NextFunction) => void;
|
|
23
23
|
/**
|
|
24
|
-
* Interface for defining server configuration
|
|
25
|
-
*
|
|
26
|
-
* @property {ServerMiddleware[]} [middlewares] - Optional array of server middlewares.
|
|
27
|
-
* @property {string} [dataDir] - Optional directory for storing server data.
|
|
28
|
-
* @property {string} [postgresUrl] - Optional URL for connecting to a PostgreSQL database.
|
|
24
|
+
* Interface for defining server configuration.
|
|
25
|
+
* Used for unified server initialization and startup.
|
|
29
26
|
*/
|
|
30
|
-
export interface
|
|
27
|
+
export interface ServerConfig {
|
|
31
28
|
middlewares?: ServerMiddleware[];
|
|
32
29
|
dataDir?: string;
|
|
33
30
|
postgresUrl?: string;
|
|
34
31
|
clientPath?: string;
|
|
32
|
+
port?: number;
|
|
33
|
+
agents?: Array<{
|
|
34
|
+
character: Character;
|
|
35
|
+
plugins?: (Plugin | string)[];
|
|
36
|
+
init?: (runtime: IAgentRuntime) => Promise<void>;
|
|
37
|
+
}>;
|
|
38
|
+
isTestMode?: boolean;
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* Determines if the web UI should be enabled based on environment variables.
|
|
@@ -52,18 +56,22 @@ export declare class AgentServer {
|
|
|
52
56
|
private isWebUIEnabled;
|
|
53
57
|
private clientPath?;
|
|
54
58
|
elizaOS?: ElizaOS;
|
|
55
|
-
private pluginLoader?;
|
|
56
|
-
private configManager?;
|
|
57
59
|
database: DatabaseAdapter;
|
|
58
60
|
loadCharacterTryPath: (characterPath: string) => Promise<Character>;
|
|
59
61
|
jsonToCharacter: (character: unknown) => Promise<Character>;
|
|
60
62
|
/**
|
|
61
63
|
* Start multiple agents in batch (true parallel)
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
+
* @param agents - Array of agent configurations (character + optional plugins/init)
|
|
65
|
+
* @param options - Optional configuration (e.g., isTestMode for test dependencies)
|
|
64
66
|
* @returns Array of started agent runtimes
|
|
65
67
|
*/
|
|
66
|
-
startAgents(
|
|
68
|
+
startAgents(agents: Array<{
|
|
69
|
+
character: Character;
|
|
70
|
+
plugins?: (Plugin | string)[];
|
|
71
|
+
init?: (runtime: IAgentRuntime) => Promise<void>;
|
|
72
|
+
}>, options?: {
|
|
73
|
+
isTestMode?: boolean;
|
|
74
|
+
}): Promise<IAgentRuntime[]>;
|
|
67
75
|
/**
|
|
68
76
|
* Stop multiple agents in batch
|
|
69
77
|
* @param agentIds - Array of agent IDs to stop
|
|
@@ -87,18 +95,20 @@ export declare class AgentServer {
|
|
|
87
95
|
*/
|
|
88
96
|
constructor();
|
|
89
97
|
/**
|
|
90
|
-
* Initializes the database and server.
|
|
98
|
+
* Initializes the database and server (internal use only).
|
|
91
99
|
*
|
|
92
|
-
* @param {
|
|
100
|
+
* @param {ServerConfig} [config] - Optional server configuration.
|
|
93
101
|
* @returns {Promise<void>} A promise that resolves when initialization is complete.
|
|
102
|
+
* @private
|
|
94
103
|
*/
|
|
95
|
-
initialize
|
|
104
|
+
private initialize;
|
|
96
105
|
private ensureDefaultServer;
|
|
97
106
|
/**
|
|
98
|
-
* Initializes the server with the provided
|
|
107
|
+
* Initializes the server with the provided configuration.
|
|
99
108
|
*
|
|
100
|
-
* @param {
|
|
109
|
+
* @param {ServerConfig} [config] - Optional server configuration.
|
|
101
110
|
* @returns {Promise<void>} - A promise that resolves once the server is initialized.
|
|
111
|
+
* @private
|
|
102
112
|
*/
|
|
103
113
|
private initializeServer;
|
|
104
114
|
/**
|
|
@@ -124,13 +134,33 @@ export declare class AgentServer {
|
|
|
124
134
|
*/
|
|
125
135
|
registerMiddleware(middleware: ServerMiddleware): void;
|
|
126
136
|
/**
|
|
127
|
-
* Starts the server
|
|
137
|
+
* Starts the server with unified configuration.
|
|
138
|
+
* Handles initialization, port resolution, and optional agent startup.
|
|
128
139
|
*
|
|
129
|
-
* @param {
|
|
140
|
+
* @param {ServerConfig} config - Server configuration including port, agents, and infrastructure options.
|
|
130
141
|
* @returns {Promise<void>} A promise that resolves when the server is listening.
|
|
131
|
-
* @throws {Error} If
|
|
142
|
+
* @throws {Error} If there is an error during initialization or startup.
|
|
132
143
|
*/
|
|
133
|
-
start(
|
|
144
|
+
start(config?: ServerConfig): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Resolves and finds an available port.
|
|
147
|
+
* - If port is provided (number): validates and returns it (strict - fails if unavailable)
|
|
148
|
+
* - If port is undefined: finds next available port starting from env/default (auto-discovery)
|
|
149
|
+
*/
|
|
150
|
+
private resolveAndFindPort;
|
|
151
|
+
/**
|
|
152
|
+
* Finds an available port starting from the requested port.
|
|
153
|
+
* Tries incrementing ports up to maxAttempts.
|
|
154
|
+
*/
|
|
155
|
+
private findAvailablePort;
|
|
156
|
+
/**
|
|
157
|
+
* Checks if a port is available by attempting to bind to it.
|
|
158
|
+
*/
|
|
159
|
+
private isPortAvailable;
|
|
160
|
+
/**
|
|
161
|
+
* Starts the HTTP server on the specified port.
|
|
162
|
+
*/
|
|
163
|
+
private startHttpServer;
|
|
134
164
|
/**
|
|
135
165
|
* Stops the server if it is running. Closes the server connection,
|
|
136
166
|
* stops the database connection, and logs a success message.
|
|
@@ -200,5 +230,3 @@ export declare class AgentServer {
|
|
|
200
230
|
export { tryLoadFile, loadCharactersFromUrl, jsonToCharacter, loadCharacter, loadCharacterTryPath, hasValidRemoteUrls, loadCharacters, } from './loader';
|
|
201
231
|
export * from './types';
|
|
202
232
|
export { ElizaOS } from '@elizaos/core';
|
|
203
|
-
export { PluginLoader } from './managers/PluginLoader';
|
|
204
|
-
export { ConfigManager } from './managers/ConfigManager';
|