@elizaos/cli 1.0.6 → 1.0.8

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 (88) hide show
  1. package/README.md +12 -11
  2. package/dist/assets/{index-BlgsVC9v.js → index-CZAd5zm2.js} +17 -17
  3. package/dist/assets/index-CZAd5zm2.js.br +0 -0
  4. package/dist/assets/{index-BlgsVC9v.js.map → index-CZAd5zm2.js.map} +1 -1
  5. package/dist/assets/{index-TLtd8ntA.js → index-CaEsCLCC.js} +4155 -10851
  6. package/dist/assets/{index-TLtd8ntA.js.map → index-CaEsCLCC.js.map} +1 -1
  7. package/dist/assets/index-DyA-lndn.css +1 -0
  8. package/dist/assets/index-DyA-lndn.css.br +0 -0
  9. package/dist/assets/{vendor-BiCY-iVm.js → vendor-DSdxb8P-.js} +2 -2
  10. package/dist/assets/vendor-DSdxb8P-.js.br +0 -0
  11. package/dist/assets/{vendor-BiCY-iVm.js.map → vendor-DSdxb8P-.js.map} +1 -1
  12. package/dist/chunk-33BHGAF7.js +616 -0
  13. package/dist/{chunk-YTV6GDEJ.js → chunk-CVADLFW6.js} +100 -42
  14. package/dist/chunk-F24MS2YR.js +19 -0
  15. package/dist/{chunk-7HDCC22V.js → chunk-IEKLJDUU.js} +99 -0
  16. package/dist/chunk-MA2ZXPG6.js +260 -0
  17. package/dist/chunk-REBZFQYE.js +11728 -0
  18. package/dist/chunk-W3HS2NP6.js +154 -0
  19. package/dist/commands/agent/actions/index.d.ts +25 -0
  20. package/dist/commands/agent/actions/index.js +23 -0
  21. package/dist/commands/agent/index.d.ts +16 -0
  22. package/dist/commands/agent/index.js +24 -0
  23. package/dist/commands/create/actions/index.d.ts +35 -0
  24. package/dist/commands/create/actions/index.js +30 -0
  25. package/dist/commands/create/index.d.ts +5 -0
  26. package/dist/commands/create/index.js +17 -0
  27. package/dist/commands/shared/index.d.ts +35 -0
  28. package/dist/commands/shared/index.js +13 -0
  29. package/dist/index.html +3 -3
  30. package/dist/index.js +103836 -56
  31. package/dist/{prompts-I4LK5NKX.js → lib-NAGYZHVV.js} +3 -3
  32. package/dist/{migrator-BQMHMHSG.js → migrator-KZLCVEIH.js} +117 -117
  33. package/dist/{plugin-creator-EUJNDFIB.js → plugin-creator-IC42XOHG.js} +3 -4
  34. package/dist/{registry-A4UYBEET.js → registry-XFOSZFU4.js} +4 -5
  35. package/dist/utils-DIZZ3HNZ.js +218 -0
  36. package/package.json +19 -12
  37. package/templates/plugin-starter/README.md +26 -9
  38. package/templates/plugin-starter/package.json +6 -2
  39. package/templates/plugin-starter/tsconfig.build.json +1 -3
  40. package/templates/plugin-starter/tsconfig.json +1 -2
  41. package/templates/plugin-starter/tsup.config.ts +1 -1
  42. package/templates/project-starter/README.md +15 -16
  43. package/templates/project-starter/package.json +6 -6
  44. package/templates/project-tee-starter/e2e/project.test.ts +1 -1
  45. package/templates/project-tee-starter/e2e/starter-plugin.test.ts +1 -1
  46. package/templates/project-tee-starter/package.json +6 -5
  47. package/dist/assets/index-BlgsVC9v.js.br +0 -0
  48. package/dist/assets/index-fZleA996.css +0 -1
  49. package/dist/assets/index-fZleA996.css.br +0 -0
  50. package/dist/assets/vendor-BiCY-iVm.js.br +0 -0
  51. package/dist/chunk-335PGADS.js +0 -207
  52. package/dist/chunk-4QRJ6FQC.js +0 -295
  53. package/dist/chunk-5J7S2CSH.js +0 -2771
  54. package/dist/chunk-APFJCFC6.js +0 -78
  55. package/dist/chunk-CR5NR6A6.js +0 -458
  56. package/dist/chunk-KB3JDWUI.js +0 -106
  57. package/dist/chunk-L64NPCT6.js +0 -604
  58. package/dist/chunk-LRSU7IN6.js +0 -4862
  59. package/dist/chunk-LXYNBPDV.js +0 -570
  60. package/dist/chunk-MAGJ4VCL.js +0 -95
  61. package/dist/chunk-O64SGQGU.js +0 -90048
  62. package/dist/chunk-PHLX32YJ.js +0 -7889
  63. package/dist/chunk-RGI5263U.js +0 -7443
  64. package/dist/chunk-VWWF4TGX.js +0 -684
  65. package/dist/chunk-YMKISDXM.js +0 -247
  66. package/dist/commands/agent.d.ts +0 -27
  67. package/dist/commands/agent.js +0 -22
  68. package/dist/commands/create.d.ts +0 -15
  69. package/dist/commands/create.js +0 -18
  70. package/dist/commands/dev.d.ts +0 -8
  71. package/dist/commands/dev.js +0 -17
  72. package/dist/commands/env.d.ts +0 -16
  73. package/dist/commands/env.js +0 -21
  74. package/dist/commands/plugins.d.ts +0 -19
  75. package/dist/commands/plugins.js +0 -25
  76. package/dist/commands/publish.d.ts +0 -5
  77. package/dist/commands/publish.js +0 -18
  78. package/dist/commands/setup-monorepo.d.ts +0 -5
  79. package/dist/commands/setup-monorepo.js +0 -17
  80. package/dist/commands/start.d.ts +0 -198
  81. package/dist/commands/start.js +0 -25
  82. package/dist/commands/tee.d.ts +0 -5
  83. package/dist/commands/tee.js +0 -13
  84. package/dist/commands/test.d.ts +0 -6
  85. package/dist/commands/test.js +0 -24
  86. package/dist/commands/update.d.ts +0 -14
  87. package/dist/commands/update.js +0 -23
  88. package/dist/{chunk-NHI4RJD2.js → chunk-CEE6RKN5.js} +58 -58
@@ -1,198 +0,0 @@
1
- import { UUID, ChannelType, DatabaseAdapter, Character, IAgentRuntime, Plugin } from '@elizaos/core';
2
- import express from 'express';
3
- import http from 'node:http';
4
- import { Server } from 'socket.io';
5
- import { Command } from 'commander';
6
-
7
- interface MessageServer {
8
- id: UUID;
9
- name: string;
10
- sourceType: string;
11
- sourceId?: string;
12
- metadata?: Record<string, any>;
13
- createdAt: Date;
14
- updatedAt: Date;
15
- }
16
- interface MessageChannel {
17
- id: UUID;
18
- messageServerId: UUID;
19
- name: string;
20
- type: ChannelType;
21
- sourceType?: string;
22
- sourceId?: string;
23
- topic?: string;
24
- metadata?: Record<string, any>;
25
- createdAt: Date;
26
- updatedAt: Date;
27
- }
28
- interface CentralRootMessage {
29
- id: UUID;
30
- channelId: UUID;
31
- authorId: UUID;
32
- content: string;
33
- rawMessage?: any;
34
- inReplyToRootMessageId?: UUID;
35
- sourceType?: string;
36
- sourceId?: string;
37
- createdAt: Date;
38
- updatedAt: Date;
39
- metadata?: Record<string, any>;
40
- }
41
-
42
- /**
43
- * Represents a function that acts as a server middleware.
44
- * @param {express.Request} req - The request object.
45
- * @param {express.Response} res - The response object.
46
- * @param {express.NextFunction} next - The next function to be called in the middleware chain.
47
- * @returns {void}
48
- */
49
- type ServerMiddleware = (req: express.Request, res: express.Response, next: express.NextFunction) => void;
50
- /**
51
- * Interface for defining server configuration options.
52
- * @typedef {Object} ServerOptions
53
- * @property {ServerMiddleware[]} [middlewares] - Optional array of server middlewares.
54
- * @property {string} [dataDir] - Optional directory for storing server data.
55
- * @property {string} [postgresUrl] - Optional URL for connecting to a PostgreSQL database.
56
- */
57
- interface ServerOptions {
58
- middlewares?: ServerMiddleware[];
59
- dataDir?: string;
60
- postgresUrl?: string;
61
- }
62
- /**
63
- * Class representing an agent server.
64
- */ /**
65
- * Represents an agent server which handles agents, database, and server functionalities.
66
- */
67
- declare class AgentServer {
68
- app: express.Application;
69
- private agents;
70
- server: http.Server;
71
- socketIO: Server;
72
- private serverPort;
73
- isInitialized: boolean;
74
- database: DatabaseAdapter;
75
- startAgent: (character: Character) => Promise<IAgentRuntime>;
76
- stopAgent: (runtime: IAgentRuntime) => void;
77
- loadCharacterTryPath: (characterPath: string) => Promise<Character>;
78
- jsonToCharacter: (character: unknown) => Promise<Character>;
79
- /**
80
- * Constructor for AgentServer class.
81
- *
82
- * @constructor
83
- */
84
- constructor();
85
- /**
86
- * Initializes the database and server.
87
- *
88
- * @param {ServerOptions} [options] - Optional server options.
89
- * @returns {Promise<void>} A promise that resolves when initialization is complete.
90
- */
91
- initialize(options?: ServerOptions): Promise<void>;
92
- private ensureDefaultServer;
93
- /**
94
- * Initializes the server with the provided options.
95
- *
96
- * @param {ServerOptions} [options] - Optional server options.
97
- * @returns {Promise<void>} - A promise that resolves once the server is initialized.
98
- */
99
- private initializeServer;
100
- /**
101
- * Registers an agent with the provided runtime.
102
- *
103
- * @param {IAgentRuntime} runtime - The runtime object containing agent information.
104
- * @throws {Error} if the runtime is null/undefined, if agentId is missing, if character configuration is missing,
105
- * or if there are any errors during registration.
106
- */
107
- registerAgent(runtime: IAgentRuntime): Promise<void>;
108
- /**
109
- * Unregisters an agent from the system.
110
- *
111
- * @param {UUID} agentId - The unique identifier of the agent to unregister.
112
- * @returns {void}
113
- */
114
- unregisterAgent(agentId: UUID): void;
115
- /**
116
- * Add middleware to the server's request handling pipeline
117
- * @param {ServerMiddleware} middleware - The middleware function to be registered
118
- */
119
- registerMiddleware(middleware: ServerMiddleware): void;
120
- /**
121
- * Starts the server on the specified port.
122
- *
123
- * @param {number} port - The port number on which the server should listen.
124
- * @throws {Error} If the port is invalid or if there is an error while starting the server.
125
- */
126
- start(port: number): void;
127
- /**
128
- * Stops the server if it is running. Closes the server connection,
129
- * stops the database connection, and logs a success message.
130
- */
131
- stop(): Promise<void>;
132
- createServer(data: Omit<MessageServer, 'id' | 'createdAt' | 'updatedAt'>): Promise<MessageServer>;
133
- getServers(): Promise<MessageServer[]>;
134
- getServerById(serverId: UUID): Promise<MessageServer | null>;
135
- getServerBySourceType(sourceType: string): Promise<MessageServer | null>;
136
- createChannel(data: Omit<MessageChannel, 'id' | 'createdAt' | 'updatedAt'> & {
137
- id?: UUID;
138
- }, participantIds?: UUID[]): Promise<MessageChannel>;
139
- addParticipantsToChannel(channelId: UUID, userIds: UUID[]): Promise<void>;
140
- getChannelsForServer(serverId: UUID): Promise<MessageChannel[]>;
141
- getChannelDetails(channelId: UUID): Promise<MessageChannel | null>;
142
- getChannelParticipants(channelId: UUID): Promise<UUID[]>;
143
- deleteMessage(messageId: UUID): Promise<void>;
144
- clearChannelMessages(channelId: UUID): Promise<void>;
145
- findOrCreateCentralDmChannel(user1Id: UUID, user2Id: UUID, messageServerId: UUID): Promise<MessageChannel>;
146
- createMessage(data: Omit<CentralRootMessage, 'id' | 'createdAt' | 'updatedAt'>): Promise<CentralRootMessage>;
147
- getMessagesForChannel(channelId: UUID, limit?: number, beforeTimestamp?: Date): Promise<CentralRootMessage[]>;
148
- removeParticipantFromChannel(channelId: UUID, userId: UUID): Promise<void>;
149
- /**
150
- * Add an agent to a server
151
- * @param {UUID} serverId - The server ID
152
- * @param {UUID} agentId - The agent ID to add
153
- */
154
- addAgentToServer(serverId: UUID, agentId: UUID): Promise<void>;
155
- /**
156
- * Remove an agent from a server
157
- * @param {UUID} serverId - The server ID
158
- * @param {UUID} agentId - The agent ID to remove
159
- */
160
- removeAgentFromServer(serverId: UUID, agentId: UUID): Promise<void>;
161
- /**
162
- * Get all agents associated with a server
163
- * @param {UUID} serverId - The server ID
164
- * @returns {Promise<UUID[]>} Array of agent IDs
165
- */
166
- getAgentsForServer(serverId: UUID): Promise<UUID[]>;
167
- /**
168
- * Get all servers an agent belongs to
169
- * @param {UUID} agentId - The agent ID
170
- * @returns {Promise<UUID[]>} Array of server IDs
171
- */
172
- getServersForAgent(agentId: UUID): Promise<UUID[]>;
173
- }
174
-
175
- /**
176
- * Analyzes project agents and their plugins to determine which environment variables to prompt for
177
- */
178
- declare function promptForProjectPlugins(project: any, pluginToLoad?: {
179
- name: string;
180
- }): Promise<void>;
181
- /**
182
- * Starts an agent with the given character, agent server, initialization function, plugins, and options.
183
- *
184
- * @param character The character object representing the agent.
185
- * @param server The agent server where the agent will be registered.
186
- * @param init Optional initialization function to be called with the agent runtime.
187
- * @param plugins An array of plugins to be used by the agent.
188
- * @param options Additional options for starting the agent, such as data directory and postgres URL.
189
- * @returns A promise that resolves to the agent runtime object.
190
- */
191
- declare function startAgent(character: Character, server: AgentServer, init?: (runtime: IAgentRuntime) => void, plugins?: Plugin[], options?: {
192
- dataDir?: string;
193
- postgresUrl?: string;
194
- isPluginTestMode?: boolean;
195
- }): Promise<IAgentRuntime>;
196
- declare const start: Command;
197
-
198
- export { promptForProjectPlugins, start, startAgent };
@@ -1,25 +0,0 @@
1
-
2
- import { createRequire } from 'module';
3
- const require = createRequire(import.meta.url);
4
-
5
- import {
6
- promptForProjectPlugins,
7
- start,
8
- startAgent
9
- } from "../chunk-O64SGQGU.js";
10
- import "../chunk-NHI4RJD2.js";
11
- import "../chunk-TUAYJIF2.js";
12
- import "../chunk-335PGADS.js";
13
- import "../chunk-PHLX32YJ.js";
14
- import "../chunk-RGI5263U.js";
15
- import "../chunk-GYTAJJOD.js";
16
- import "../chunk-5J7S2CSH.js";
17
- import "../chunk-LRSU7IN6.js";
18
- import "../chunk-7HDCC22V.js";
19
- import "../chunk-KB3JDWUI.js";
20
- import "../chunk-567UPUC7.js";
21
- export {
22
- promptForProjectPlugins,
23
- start,
24
- startAgent
25
- };
@@ -1,5 +0,0 @@
1
- import { Command } from 'commander';
2
-
3
- declare const teeCommand: Command;
4
-
5
- export { teeCommand };
@@ -1,13 +0,0 @@
1
-
2
- import { createRequire } from 'module';
3
- const require = createRequire(import.meta.url);
4
-
5
- import {
6
- teeCommand
7
- } from "../chunk-APFJCFC6.js";
8
- import "../chunk-5J7S2CSH.js";
9
- import "../chunk-KB3JDWUI.js";
10
- import "../chunk-567UPUC7.js";
11
- export {
12
- teeCommand
13
- };
@@ -1,6 +0,0 @@
1
- import { Command } from 'commander';
2
-
3
- declare const test: Command;
4
- declare function registerCommand(cli: Command): Command;
5
-
6
- export { registerCommand as default, test };
@@ -1,24 +0,0 @@
1
-
2
- import { createRequire } from 'module';
3
- const require = createRequire(import.meta.url);
4
-
5
- import {
6
- registerCommand,
7
- test
8
- } from "../chunk-VWWF4TGX.js";
9
- import "../chunk-O64SGQGU.js";
10
- import "../chunk-NHI4RJD2.js";
11
- import "../chunk-TUAYJIF2.js";
12
- import "../chunk-335PGADS.js";
13
- import "../chunk-PHLX32YJ.js";
14
- import "../chunk-RGI5263U.js";
15
- import "../chunk-GYTAJJOD.js";
16
- import "../chunk-5J7S2CSH.js";
17
- import "../chunk-LRSU7IN6.js";
18
- import "../chunk-7HDCC22V.js";
19
- import "../chunk-KB3JDWUI.js";
20
- import "../chunk-567UPUC7.js";
21
- export {
22
- registerCommand as default,
23
- test
24
- };
@@ -1,14 +0,0 @@
1
- import { Command } from 'commander';
2
-
3
- declare function fetchLatestVersion(packageName: string): Promise<string | null>;
4
- declare function checkForUpdates(dependencies: Record<string, string>): Promise<{
5
- hasUpdates: boolean;
6
- updates: Record<string, {
7
- current: string;
8
- latest: string;
9
- }>;
10
- }>;
11
- declare function performCliUpdate(): Promise<boolean>;
12
- declare const update: Command;
13
-
14
- export { checkForUpdates, fetchLatestVersion, performCliUpdate, update };
@@ -1,23 +0,0 @@
1
-
2
- import { createRequire } from 'module';
3
- const require = createRequire(import.meta.url);
4
-
5
- import {
6
- checkForUpdates,
7
- fetchLatestVersion,
8
- performCliUpdate,
9
- update
10
- } from "../chunk-4QRJ6FQC.js";
11
- import "../chunk-RGI5263U.js";
12
- import "../chunk-GYTAJJOD.js";
13
- import "../chunk-5J7S2CSH.js";
14
- import "../chunk-LRSU7IN6.js";
15
- import "../chunk-7HDCC22V.js";
16
- import "../chunk-KB3JDWUI.js";
17
- import "../chunk-567UPUC7.js";
18
- export {
19
- checkForUpdates,
20
- fetchLatestVersion,
21
- performCliUpdate,
22
- update
23
- };
@@ -53,64 +53,6 @@ var require_inherits = __commonJS({
53
53
  }
54
54
  });
55
55
 
56
- // ../../node_modules/safe-buffer/index.js
57
- var require_safe_buffer = __commonJS({
58
- "../../node_modules/safe-buffer/index.js"(exports, module) {
59
- var buffer = __require("buffer");
60
- var Buffer = buffer.Buffer;
61
- function copyProps(src, dst) {
62
- for (var key in src) {
63
- dst[key] = src[key];
64
- }
65
- }
66
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
67
- module.exports = buffer;
68
- } else {
69
- copyProps(buffer, exports);
70
- exports.Buffer = SafeBuffer;
71
- }
72
- function SafeBuffer(arg, encodingOrOffset, length) {
73
- return Buffer(arg, encodingOrOffset, length);
74
- }
75
- SafeBuffer.prototype = Object.create(Buffer.prototype);
76
- copyProps(Buffer, SafeBuffer);
77
- SafeBuffer.from = function(arg, encodingOrOffset, length) {
78
- if (typeof arg === "number") {
79
- throw new TypeError("Argument must not be a number");
80
- }
81
- return Buffer(arg, encodingOrOffset, length);
82
- };
83
- SafeBuffer.alloc = function(size, fill, encoding) {
84
- if (typeof size !== "number") {
85
- throw new TypeError("Argument must be a number");
86
- }
87
- var buf = Buffer(size);
88
- if (fill !== void 0) {
89
- if (typeof encoding === "string") {
90
- buf.fill(fill, encoding);
91
- } else {
92
- buf.fill(fill);
93
- }
94
- } else {
95
- buf.fill(0);
96
- }
97
- return buf;
98
- };
99
- SafeBuffer.allocUnsafe = function(size) {
100
- if (typeof size !== "number") {
101
- throw new TypeError("Argument must be a number");
102
- }
103
- return Buffer(size);
104
- };
105
- SafeBuffer.allocUnsafeSlow = function(size) {
106
- if (typeof size !== "number") {
107
- throw new TypeError("Argument must be a number");
108
- }
109
- return buffer.SlowBuffer(size);
110
- };
111
- }
112
- });
113
-
114
56
  // ../../node_modules/readable-stream/lib/internal/streams/stream.js
115
57
  var require_stream = __commonJS({
116
58
  "../../node_modules/readable-stream/lib/internal/streams/stream.js"(exports, module) {
@@ -1145,6 +1087,64 @@ var require_stream_duplex = __commonJS({
1145
1087
  }
1146
1088
  });
1147
1089
 
1090
+ // ../../node_modules/safe-buffer/index.js
1091
+ var require_safe_buffer = __commonJS({
1092
+ "../../node_modules/safe-buffer/index.js"(exports, module) {
1093
+ var buffer = __require("buffer");
1094
+ var Buffer = buffer.Buffer;
1095
+ function copyProps(src, dst) {
1096
+ for (var key in src) {
1097
+ dst[key] = src[key];
1098
+ }
1099
+ }
1100
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
1101
+ module.exports = buffer;
1102
+ } else {
1103
+ copyProps(buffer, exports);
1104
+ exports.Buffer = SafeBuffer;
1105
+ }
1106
+ function SafeBuffer(arg, encodingOrOffset, length) {
1107
+ return Buffer(arg, encodingOrOffset, length);
1108
+ }
1109
+ SafeBuffer.prototype = Object.create(Buffer.prototype);
1110
+ copyProps(Buffer, SafeBuffer);
1111
+ SafeBuffer.from = function(arg, encodingOrOffset, length) {
1112
+ if (typeof arg === "number") {
1113
+ throw new TypeError("Argument must not be a number");
1114
+ }
1115
+ return Buffer(arg, encodingOrOffset, length);
1116
+ };
1117
+ SafeBuffer.alloc = function(size, fill, encoding) {
1118
+ if (typeof size !== "number") {
1119
+ throw new TypeError("Argument must be a number");
1120
+ }
1121
+ var buf = Buffer(size);
1122
+ if (fill !== void 0) {
1123
+ if (typeof encoding === "string") {
1124
+ buf.fill(fill, encoding);
1125
+ } else {
1126
+ buf.fill(fill);
1127
+ }
1128
+ } else {
1129
+ buf.fill(0);
1130
+ }
1131
+ return buf;
1132
+ };
1133
+ SafeBuffer.allocUnsafe = function(size) {
1134
+ if (typeof size !== "number") {
1135
+ throw new TypeError("Argument must be a number");
1136
+ }
1137
+ return Buffer(size);
1138
+ };
1139
+ SafeBuffer.allocUnsafeSlow = function(size) {
1140
+ if (typeof size !== "number") {
1141
+ throw new TypeError("Argument must be a number");
1142
+ }
1143
+ return buffer.SlowBuffer(size);
1144
+ };
1145
+ }
1146
+ });
1147
+
1148
1148
  // ../../node_modules/string_decoder/lib/string_decoder.js
1149
1149
  var require_string_decoder = __commonJS({
1150
1150
  "../../node_modules/string_decoder/lib/string_decoder.js"(exports) {