@elizaos/core 1.5.12 → 1.5.13-alpha.2
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/browser/index.browser.js +141 -119
- package/dist/browser/index.browser.js.map +74 -16
- package/dist/elizaos.d.ts +153 -0
- package/dist/elizaos.d.ts.map +1 -0
- package/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.d.ts.map +1 -1
- package/dist/node/index.node.js +319 -102
- package/dist/node/index.node.js.map +14 -13
- package/dist/runtime.d.ts.map +1 -1
- package/dist/schemas/character.d.ts +21 -179
- package/dist/schemas/character.d.ts.map +1 -1
- package/dist/utils/node.d.ts +6 -0
- package/dist/utils/node.d.ts.map +1 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { Character, IAgentRuntime, UUID, Memory, State, Plugin, RuntimeSettings } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Batch operation for sending messages
|
|
4
|
+
*/
|
|
5
|
+
export interface BatchOperation {
|
|
6
|
+
agentId: UUID;
|
|
7
|
+
operation: 'message' | 'action' | 'evaluate';
|
|
8
|
+
payload: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Result of a batch operation
|
|
12
|
+
*/
|
|
13
|
+
export interface BatchResult {
|
|
14
|
+
agentId: UUID;
|
|
15
|
+
success: boolean;
|
|
16
|
+
result?: any;
|
|
17
|
+
error?: Error;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Read-only runtime accessor
|
|
21
|
+
*/
|
|
22
|
+
export interface ReadonlyRuntime {
|
|
23
|
+
getAgent(id: UUID): IAgentRuntime | undefined;
|
|
24
|
+
getAgents(): IAgentRuntime[];
|
|
25
|
+
getState(agentId: UUID): State | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Health status for an agent
|
|
29
|
+
*/
|
|
30
|
+
export interface HealthStatus {
|
|
31
|
+
alive: boolean;
|
|
32
|
+
responsive: boolean;
|
|
33
|
+
memoryUsage?: number;
|
|
34
|
+
uptime?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Update operation for an agent
|
|
38
|
+
*/
|
|
39
|
+
export interface AgentUpdate {
|
|
40
|
+
id: UUID;
|
|
41
|
+
character: Partial<Character>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* ElizaOS - Multi-agent orchestration framework
|
|
45
|
+
* Pure JavaScript implementation for browser and Node.js compatibility
|
|
46
|
+
*/
|
|
47
|
+
export declare class ElizaOS extends EventTarget {
|
|
48
|
+
private runtimes;
|
|
49
|
+
private editableMode;
|
|
50
|
+
/**
|
|
51
|
+
* Add multiple agents (batch operation)
|
|
52
|
+
*/
|
|
53
|
+
addAgents(agents: Array<{
|
|
54
|
+
character: Character;
|
|
55
|
+
plugins?: Plugin[];
|
|
56
|
+
settings?: RuntimeSettings;
|
|
57
|
+
}>): Promise<UUID[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Register an existing runtime
|
|
60
|
+
*/
|
|
61
|
+
registerAgent(runtime: IAgentRuntime): void;
|
|
62
|
+
/**
|
|
63
|
+
* Update an agent's character
|
|
64
|
+
*/
|
|
65
|
+
updateAgent(agentId: UUID, updates: Partial<Character>): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Delete agents
|
|
68
|
+
*/
|
|
69
|
+
deleteAgents(agentIds: UUID[]): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Start multiple agents
|
|
72
|
+
*/
|
|
73
|
+
startAgents(agentIds?: UUID[]): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Stop agents
|
|
76
|
+
*/
|
|
77
|
+
stopAgents(agentIds?: UUID[]): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Get a single agent
|
|
80
|
+
*/
|
|
81
|
+
getAgent(id: UUID): IAgentRuntime | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Get all agents
|
|
84
|
+
*/
|
|
85
|
+
getAgents(): IAgentRuntime[];
|
|
86
|
+
/**
|
|
87
|
+
* Get agents by IDs
|
|
88
|
+
*/
|
|
89
|
+
getAgentsByIds(ids: UUID[]): IAgentRuntime[];
|
|
90
|
+
/**
|
|
91
|
+
* Get agents by names
|
|
92
|
+
*/
|
|
93
|
+
getAgentsByNames(names: string[]): IAgentRuntime[];
|
|
94
|
+
/**
|
|
95
|
+
* Get agent by ID (alias for getAgent for consistency)
|
|
96
|
+
*/
|
|
97
|
+
getAgentById(id: UUID): IAgentRuntime | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Get agent by name
|
|
100
|
+
*/
|
|
101
|
+
getAgentByName(name: string): IAgentRuntime | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Get agent by character name (alias for getAgentByName)
|
|
104
|
+
*/
|
|
105
|
+
getAgentByCharacterName(name: string): IAgentRuntime | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Get agent by character ID
|
|
108
|
+
*/
|
|
109
|
+
getAgentByCharacterId(characterId: UUID): IAgentRuntime | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Send a message to a specific agent - THE ONLY WAY to send messages
|
|
112
|
+
* All message sending (WebSocket, API, CLI, Tests, MessageBus) must use this method
|
|
113
|
+
*/
|
|
114
|
+
sendMessage(agentId: UUID, message: Memory | string, options?: {
|
|
115
|
+
userId?: UUID;
|
|
116
|
+
roomId?: UUID;
|
|
117
|
+
metadata?: Record<string, any>;
|
|
118
|
+
}): Promise<Memory[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Send messages to multiple agents (batch operation)
|
|
121
|
+
* All batch message sending must use this method
|
|
122
|
+
*/
|
|
123
|
+
sendMessages(messages: Array<{
|
|
124
|
+
agentId: UUID;
|
|
125
|
+
message: Memory | string;
|
|
126
|
+
options?: {
|
|
127
|
+
userId?: UUID;
|
|
128
|
+
roomId?: UUID;
|
|
129
|
+
metadata?: Record<string, any>;
|
|
130
|
+
};
|
|
131
|
+
}>): Promise<Array<{
|
|
132
|
+
agentId: UUID;
|
|
133
|
+
responses: Memory[];
|
|
134
|
+
error?: Error;
|
|
135
|
+
}>>;
|
|
136
|
+
/**
|
|
137
|
+
* Validate API keys for agents
|
|
138
|
+
*/
|
|
139
|
+
validateApiKeys(agents?: UUID[]): Promise<Map<UUID, boolean>>;
|
|
140
|
+
/**
|
|
141
|
+
* Health check for agents
|
|
142
|
+
*/
|
|
143
|
+
healthCheck(agents?: UUID[]): Promise<Map<UUID, HealthStatus>>;
|
|
144
|
+
/**
|
|
145
|
+
* Get a read-only runtime accessor
|
|
146
|
+
*/
|
|
147
|
+
getRuntimeAccessor(): ReadonlyRuntime;
|
|
148
|
+
/**
|
|
149
|
+
* Enable editable mode for post-initialization updates
|
|
150
|
+
*/
|
|
151
|
+
enableEditableMode(): void;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=elizaos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elizaos.d.ts","sourceRoot":"","sources":["../src/elizaos.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,IAAI,EACJ,MAAM,EACN,KAAK,EACL,MAAM,EACN,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C,OAAO,EAAE,GAAG,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;C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O,CAAC,KAAK,CAAC;QAAC,OAAO,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAC,CAAC,CAAC;IA0BtE;;OAEG;IACG,eAAe,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAmBnE;;OAEG;IACG,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAwBpE;;OAEG;IACH,kBAAkB,IAAI,eAAe;IAqBrC;;OAEG;IACH,kBAAkB,IAAI,IAAI;CAQ3B"}
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAG1B,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B,eAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;CAGxB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './runtime';
|
|
|
21
21
|
export * from './settings';
|
|
22
22
|
export * from './services';
|
|
23
23
|
export * from './search';
|
|
24
|
+
export * from './elizaos';
|
|
24
25
|
export declare const isBrowser: boolean;
|
|
25
26
|
export declare const isNode: boolean;
|
|
26
27
|
export * from './utils/server-health';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,eAAe,CAAC;AAG9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,eAAO,MAAM,SAAS,SAG+B,CAAC;AACtD,eAAO,MAAM,MAAM,SAG2B,CAAC;AAG/C,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,eAAe,CAAC;AAG9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC;AAG1B,eAAO,MAAM,SAAS,SAG+B,CAAC;AACtD,eAAO,MAAM,MAAM,SAG2B,CAAC;AAG/C,cAAc,uBAAuB,CAAC"}
|
package/dist/index.node.d.ts
CHANGED
|
@@ -9,8 +9,7 @@ export * from './utils';
|
|
|
9
9
|
export * from './schemas/character';
|
|
10
10
|
export * from './utils/environment';
|
|
11
11
|
export * from './utils/buffer';
|
|
12
|
-
export * from './utils/
|
|
13
|
-
export * from './utils/paths';
|
|
12
|
+
export * from './utils/node';
|
|
14
13
|
export * from './actions';
|
|
15
14
|
export * from './database';
|
|
16
15
|
export * from './entities';
|
|
@@ -21,6 +20,7 @@ export * from './runtime';
|
|
|
21
20
|
export * from './settings';
|
|
22
21
|
export * from './services';
|
|
23
22
|
export * from './search';
|
|
23
|
+
export * from './elizaos';
|
|
24
24
|
export declare const isBrowser = false;
|
|
25
25
|
export declare const isNode = true;
|
|
26
26
|
//# sourceMappingURL=index.node.d.ts.map
|
package/dist/index.node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,cAAc,CAAC;AAG7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAG1B,eAAO,MAAM,SAAS,QAAQ,CAAC;AAC/B,eAAO,MAAM,MAAM,OAAO,CAAC"}
|