@elizaos/cli 1.0.12 → 1.0.14

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 (35) hide show
  1. package/dist/assets/{index-CtxA4ev_.js → index-BHRtDt-w.js} +6524 -3672
  2. package/dist/assets/{index-CtxA4ev_.js.map → index-BHRtDt-w.js.map} +1 -1
  3. package/dist/assets/index-DzLbKTxV.css +1 -0
  4. package/dist/assets/index-DzLbKTxV.css.br +0 -0
  5. package/dist/assets/{index-xhCgCbS4.js → index-WVhZEObe.js} +2 -2
  6. package/dist/assets/index-WVhZEObe.js.br +0 -0
  7. package/dist/assets/{index-xhCgCbS4.js.map → index-WVhZEObe.js.map} +1 -1
  8. package/dist/{chunk-YDVNTQX3.js → chunk-23FI2G4U.js} +27 -4
  9. package/dist/{chunk-PYMK3ECE.js → chunk-E2PKE6N5.js} +192 -6
  10. package/dist/{chunk-Y76S7TNK.js → chunk-IYFVOAOM.js} +162 -15
  11. package/dist/commands/agent/actions/index.js +1 -1
  12. package/dist/commands/agent/index.js +1 -1
  13. package/dist/commands/create/actions/index.d.ts +8 -4
  14. package/dist/commands/create/actions/index.js +4 -2
  15. package/dist/commands/create/index.js +3 -3
  16. package/dist/index.html +2 -2
  17. package/dist/index.js +212 -54
  18. package/dist/{registry-7PBDJL64.js → registry-3YA2T6KV.js} +1 -1
  19. package/dist/templates/plugin-starter/src/index.ts +2 -272
  20. package/dist/templates/plugin-starter/src/plugin.ts +274 -0
  21. package/dist/templates/project-starter/src/character.ts +136 -0
  22. package/dist/templates/project-starter/src/index.ts +3 -133
  23. package/dist/templates/project-starter/src/plugin.ts +1 -1
  24. package/dist/templates/project-tee-starter/src/index.ts +4 -17
  25. package/dist/{utils-WRGBZBAJ.js → utils-QKNGJZLP.js} +9 -1
  26. package/package.json +6 -7
  27. package/templates/plugin-starter/src/index.ts +2 -272
  28. package/templates/plugin-starter/src/plugin.ts +274 -0
  29. package/templates/project-starter/src/character.ts +136 -0
  30. package/templates/project-starter/src/index.ts +3 -133
  31. package/templates/project-starter/src/plugin.ts +1 -1
  32. package/templates/project-tee-starter/src/index.ts +4 -17
  33. package/dist/assets/index-Df1AFSuJ.css +0 -1
  34. package/dist/assets/index-Df1AFSuJ.css.br +0 -0
  35. package/dist/assets/index-xhCgCbS4.js.br +0 -0
@@ -1,137 +1,6 @@
1
- import {
2
- logger,
3
- type Character,
4
- type IAgentRuntime,
5
- type Project,
6
- type ProjectAgent,
7
- } from '@elizaos/core';
1
+ import { logger, type IAgentRuntime, type Project, type ProjectAgent } from '@elizaos/core';
8
2
  import starterPlugin from './plugin.ts';
9
-
10
- /**
11
- * Represents the default character (Eliza) with her specific attributes and behaviors.
12
- * Eliza responds to a wide range of messages, is helpful and conversational.
13
- * She interacts with users in a concise, direct, and helpful manner, using humor and empathy effectively.
14
- * Eliza's responses are geared towards providing assistance on various topics while maintaining a friendly demeanor.
15
- */
16
- export const character: Character = {
17
- name: 'Eliza',
18
- plugins: [
19
- '@elizaos/plugin-sql',
20
- ...(process.env.ANTHROPIC_API_KEY ? ['@elizaos/plugin-anthropic'] : []),
21
- ...(process.env.OPENAI_API_KEY ? ['@elizaos/plugin-openai'] : []),
22
- ...(!process.env.OPENAI_API_KEY ? ['@elizaos/plugin-local-ai'] : []),
23
- ...(process.env.DISCORD_API_TOKEN ? ['@elizaos/plugin-discord'] : []),
24
- ...(process.env.TWITTER_API_KEY &&
25
- process.env.TWITTER_API_SECRET_KEY &&
26
- process.env.TWITTER_ACCESS_TOKEN &&
27
- process.env.TWITTER_ACCESS_TOKEN_SECRET
28
- ? ['@elizaos/plugin-twitter']
29
- : []),
30
- ...(process.env.TELEGRAM_BOT_TOKEN ? ['@elizaos/plugin-telegram'] : []),
31
- ...(!process.env.IGNORE_BOOTSTRAP ? ['@elizaos/plugin-bootstrap'] : []),
32
- ],
33
- settings: {
34
- secrets: {},
35
- },
36
- system:
37
- 'Respond to all messages in a helpful, conversational manner. Provide assistance on a wide range of topics, using knowledge when needed. Be concise but thorough, friendly but professional. Use humor when appropriate and be empathetic to user needs. Provide valuable information and insights when questions are asked.',
38
- bio: [
39
- 'Engages with all types of questions and conversations',
40
- 'Provides helpful, concise responses',
41
- 'Uses knowledge resources effectively when needed',
42
- 'Balances brevity with completeness',
43
- 'Uses humor and empathy appropriately',
44
- 'Adapts tone to match the conversation context',
45
- 'Offers assistance proactively',
46
- 'Communicates clearly and directly',
47
- ],
48
- topics: [
49
- 'general knowledge and information',
50
- 'problem solving and troubleshooting',
51
- 'technology and software',
52
- 'community building and management',
53
- 'business and productivity',
54
- 'creativity and innovation',
55
- 'personal development',
56
- 'communication and collaboration',
57
- 'education and learning',
58
- 'entertainment and media',
59
- ],
60
- messageExamples: [
61
- [
62
- {
63
- name: '{{name1}}',
64
- content: {
65
- text: 'This user keeps derailing technical discussions with personal problems.',
66
- },
67
- },
68
- {
69
- name: 'Eliza',
70
- content: {
71
- text: 'DM them. Sounds like they need to talk about something else.',
72
- },
73
- },
74
- {
75
- name: '{{name1}}',
76
- content: {
77
- text: 'I tried, they just keep bringing drama back to the main channel.',
78
- },
79
- },
80
- {
81
- name: 'Eliza',
82
- content: {
83
- text: "Send them my way. I've got time today.",
84
- },
85
- },
86
- ],
87
- [
88
- {
89
- name: '{{name1}}',
90
- content: {
91
- text: "I can't handle being a mod anymore. It's affecting my mental health.",
92
- },
93
- },
94
- {
95
- name: 'Eliza',
96
- content: {
97
- text: 'Drop the channels. You come first.',
98
- },
99
- },
100
- {
101
- name: '{{name1}}',
102
- content: {
103
- text: "But who's going to handle everything?",
104
- },
105
- },
106
- {
107
- name: 'Eliza',
108
- content: {
109
- text: "We will. Take the break. Come back when you're ready.",
110
- },
111
- },
112
- ],
113
- ],
114
- style: {
115
- all: [
116
- 'Keep responses concise but informative',
117
- 'Use clear and direct language',
118
- 'Be engaging and conversational',
119
- 'Use humor when appropriate',
120
- 'Be empathetic and understanding',
121
- 'Provide helpful information',
122
- 'Be encouraging and positive',
123
- 'Adapt tone to the conversation',
124
- 'Use knowledge resources when needed',
125
- 'Respond to all types of questions',
126
- ],
127
- chat: [
128
- 'Be conversational and natural',
129
- 'Engage with the topic at hand',
130
- 'Be helpful and informative',
131
- 'Show personality and warmth',
132
- ],
133
- },
134
- };
3
+ import { character } from './character.ts';
135
4
 
136
5
  const initCharacter = ({ runtime }: { runtime: IAgentRuntime }) => {
137
6
  logger.info('Initializing character');
@@ -149,5 +18,6 @@ const project: Project = {
149
18
 
150
19
  // Export test suites for the test runner
151
20
  export { testSuites } from './__tests__/e2e';
21
+ export { character } from './character.ts';
152
22
 
153
23
  export default project;
@@ -80,7 +80,7 @@ const helloWorldAction: Action = {
80
80
  // Call back with the hello world message
81
81
  await callback(responseContent);
82
82
 
83
- return responseContent;
83
+ return true;
84
84
  } catch (error) {
85
85
  logger.error('Error in HELLO_WORLD action:', error);
86
86
  throw error;
@@ -1,20 +1,6 @@
1
- import {
2
- logger,
3
- type Character,
4
- type IAgentRuntime,
5
- type Project,
6
- type ProjectAgent,
7
- } from '@elizaos/core';
8
- import mrTeePlugin from './plugin';
9
- import { mrTeeCharacter } from './character';
10
-
11
- /**
12
- * Represents the default character (Eliza) with her specific attributes and behaviors.
13
- * Eliza responds to a wide range of messages, is helpful and conversational.
14
- * She interacts with users in a concise, direct, and helpful manner, using humor and empathy effectively.
15
- * Eliza's responses are geared towards providing assistance on various topics while maintaining a friendly demeanor.
16
- */
17
- export const character: Character = mrTeeCharacter;
1
+ import { logger, type IAgentRuntime, type Project, type ProjectAgent } from '@elizaos/core';
2
+ import mrTeePlugin from './plugin.ts';
3
+ import { mrTeeCharacter } from './character.ts';
18
4
 
19
5
  const initCharacter = ({ runtime }: { runtime: IAgentRuntime }) => {
20
6
  logger.info(`Initializing character: ${mrTeeCharacter.name}`);
@@ -30,4 +16,5 @@ const project: Project = {
30
16
  agents: [projectAgent],
31
17
  };
32
18
 
19
+ export { mrTeeCharacter as character, mrTeePlugin as plugin };
33
20
  export default project;
@@ -64,6 +64,7 @@ import {
64
64
  isValidGoogleKey,
65
65
  isValidOllamaEndpoint,
66
66
  isValidOpenAIKey,
67
+ isValidOpenRouterKey,
67
68
  isValidPostgresUrl,
68
69
  loadConfig,
69
70
  loadEnvironment,
@@ -74,7 +75,9 @@ import {
74
75
  promptAndStoreAnthropicKey,
75
76
  promptAndStoreGoogleKey,
76
77
  promptAndStoreOllamaConfig,
78
+ promptAndStoreOllamaEmbeddingConfig,
77
79
  promptAndStoreOpenAIKey,
80
+ promptAndStoreOpenRouterKey,
78
81
  promptAndStorePostgresUrl,
79
82
  promptForEnvVars,
80
83
  promptForMultipleItems,
@@ -99,6 +102,7 @@ import {
99
102
  storeGoogleKey,
100
103
  storeOllamaConfig,
101
104
  storeOpenAIKey,
105
+ storeOpenRouterKey,
102
106
  storePgliteDataDir,
103
107
  storePostgresUrl,
104
108
  testPublishToGitHub,
@@ -108,7 +112,7 @@ import {
108
112
  validateGitHubToken,
109
113
  validatePluginEnvVars,
110
114
  writeEnvFile
111
- } from "./chunk-Y76S7TNK.js";
115
+ } from "./chunk-IYFVOAOM.js";
112
116
  import {
113
117
  runBunCommand
114
118
  } from "./chunk-RIAWNDYI.js";
@@ -177,6 +181,7 @@ export {
177
181
  isValidGoogleKey,
178
182
  isValidOllamaEndpoint,
179
183
  isValidOpenAIKey,
184
+ isValidOpenRouterKey,
180
185
  isValidPostgresUrl,
181
186
  loadConfig,
182
187
  loadEnvironment,
@@ -187,7 +192,9 @@ export {
187
192
  promptAndStoreAnthropicKey,
188
193
  promptAndStoreGoogleKey,
189
194
  promptAndStoreOllamaConfig,
195
+ promptAndStoreOllamaEmbeddingConfig,
190
196
  promptAndStoreOpenAIKey,
197
+ promptAndStoreOpenRouterKey,
191
198
  promptAndStorePostgresUrl,
192
199
  promptForEnvVars,
193
200
  promptForMultipleItems,
@@ -213,6 +220,7 @@ export {
213
220
  storeGoogleKey,
214
221
  storeOllamaConfig,
215
222
  storeOpenAIKey,
223
+ storeOpenRouterKey,
216
224
  storePgliteDataDir,
217
225
  storePostgresUrl,
218
226
  testPublishToGitHub,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/cli",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "elizaOS CLI - Manage your AI agents and plugins",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -50,7 +50,7 @@
50
50
  "test:types": "tsc --noEmit",
51
51
  "coverage": "c8 --reporter=lcov --reporter=text bun test",
52
52
  "coverage:html": "c8 --reporter=html bun test && open coverage/index.html",
53
- "test:cli": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" bun test tests/commands/ --timeout 120000"
53
+ "test:cli": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" bun test tests/commands/ --timeout 120000 && bash tests/cleanup-processes.sh || true"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/bun": "^1.2.17",
@@ -70,14 +70,13 @@
70
70
  "typescript": "5.8.3",
71
71
  "vite": "^6.3.5"
72
72
  },
73
- "gitHead": "47425598c211a43748abe7386d4259e1fb7080e7",
73
+ "gitHead": "0a2da90f06accb73cf4dd8f0961ba51d0d05e6c0",
74
74
  "dependencies": {
75
75
  "@anthropic-ai/sdk": "^0.54.0",
76
76
  "@clack/prompts": "^0.11.0",
77
- "@elizaos/core": "1.0.12",
78
- "@elizaos/plugin-openai": "1.0.4",
79
- "@elizaos/plugin-sql": "1.0.12",
80
- "@elizaos/server": "1.0.12",
77
+ "@elizaos/core": "1.0.14",
78
+ "@elizaos/plugin-sql": "1.0.14",
79
+ "@elizaos/server": "1.0.14",
81
80
  "bun": "^1.2.17",
82
81
  "chokidar": "^4.0.3",
83
82
  "commander": "^14.0.0",
@@ -1,274 +1,4 @@
1
- import type { Plugin } from '@elizaos/core';
2
- import {
3
- type Action,
4
- type Content,
5
- type GenerateTextParams,
6
- type HandlerCallback,
7
- type IAgentRuntime,
8
- type Memory,
9
- ModelType,
10
- type Provider,
11
- type ProviderResult,
12
- Service,
13
- type State,
14
- logger,
15
- } from '@elizaos/core';
16
- import { z } from 'zod';
17
- import { StarterPluginTestSuite } from './tests';
18
-
19
- /**
20
- * Defines the configuration schema for a plugin, including the validation rules for the plugin name.
21
- *
22
- * @type {import('zod').ZodObject<{ EXAMPLE_PLUGIN_VARIABLE: import('zod').ZodString }>}
23
- */
24
- const configSchema = z.object({
25
- EXAMPLE_PLUGIN_VARIABLE: z
26
- .string()
27
- .min(1, 'Example plugin variable is not provided')
28
- .optional()
29
- .transform((val) => {
30
- if (!val) {
31
- logger.warn('Example plugin variable is not provided (this is expected)');
32
- }
33
- return val;
34
- }),
35
- });
36
-
37
- /**
38
- * Example HelloWorld action
39
- * This demonstrates the simplest possible action structure
40
- */
41
- /**
42
- * Action representing a hello world message.
43
- * @typedef {Object} Action
44
- * @property {string} name - The name of the action.
45
- * @property {string[]} similes - An array of related actions.
46
- * @property {string} description - A brief description of the action.
47
- * @property {Function} validate - Asynchronous function to validate the action.
48
- * @property {Function} handler - Asynchronous function to handle the action and generate a response.
49
- * @property {Object[]} examples - An array of example inputs and expected outputs for the action.
50
- */
51
- const helloWorldAction: Action = {
52
- name: 'HELLO_WORLD',
53
- similes: ['GREET', 'SAY_HELLO'],
54
- description: 'Responds with a simple hello world message',
55
-
56
- validate: async (
57
- _runtime: IAgentRuntime,
58
- _message: Memory,
59
- _state: State | undefined
60
- ): Promise<boolean> => {
61
- // Always valid
62
- return true;
63
- },
64
-
65
- handler: async (
66
- _runtime: IAgentRuntime,
67
- message: Memory,
68
- _state: State | undefined,
69
- _options: any,
70
- callback?: HandlerCallback,
71
- _responses?: Memory[]
72
- ) => {
73
- try {
74
- logger.info('Handling HELLO_WORLD action');
75
-
76
- // Simple response content
77
- const responseContent: Content = {
78
- text: 'hello world!',
79
- actions: ['HELLO_WORLD'],
80
- source: message.content.source,
81
- };
82
-
83
- // Call back with the hello world message if callback is provided
84
- if (callback) {
85
- await callback(responseContent);
86
- }
87
-
88
- return responseContent;
89
- } catch (error) {
90
- logger.error('Error in HELLO_WORLD action:', error);
91
- throw error;
92
- }
93
- },
94
-
95
- examples: [
96
- [
97
- {
98
- name: '{{name1}}',
99
- content: {
100
- text: 'Can you say hello?',
101
- },
102
- },
103
- {
104
- name: '{{name2}}',
105
- content: {
106
- text: 'hello world!',
107
- actions: ['HELLO_WORLD'],
108
- },
109
- },
110
- ],
111
- ],
112
- };
113
-
114
- /**
115
- * Example Hello World Provider
116
- * This demonstrates the simplest possible provider implementation
117
- */
118
- const helloWorldProvider: Provider = {
119
- name: 'HELLO_WORLD_PROVIDER',
120
- description: 'A simple example provider',
121
-
122
- get: async (
123
- _runtime: IAgentRuntime,
124
- _message: Memory,
125
- _state: State | undefined
126
- ): Promise<ProviderResult> => {
127
- return {
128
- text: 'I am a provider',
129
- values: {},
130
- data: {},
131
- };
132
- },
133
- };
134
-
135
- export class StarterService extends Service {
136
- static serviceType = 'starter';
137
- capabilityDescription =
138
- 'This is a starter service which is attached to the agent through the starter plugin.';
139
- constructor(protected runtime: IAgentRuntime) {
140
- super(runtime);
141
- }
142
-
143
- static async start(runtime: IAgentRuntime) {
144
- logger.info(`*** Starting starter service - MODIFIED: ${new Date().toISOString()} ***`);
145
- const service = new StarterService(runtime);
146
- return service;
147
- }
148
-
149
- static async stop(runtime: IAgentRuntime) {
150
- logger.info('*** TESTING DEV MODE - STOP MESSAGE CHANGED! ***');
151
- // get the service from the runtime
152
- const service = runtime.getService(StarterService.serviceType);
153
- if (!service) {
154
- throw new Error('Starter service not found');
155
- }
156
- service.stop();
157
- }
158
-
159
- async stop() {
160
- logger.info('*** THIRD CHANGE - TESTING FILE WATCHING! ***');
161
- }
162
- }
163
-
164
- export const starterPlugin: Plugin = {
165
- name: 'plugin-starter',
166
- description: 'Plugin starter for elizaOS',
167
- config: {
168
- EXAMPLE_PLUGIN_VARIABLE: process.env.EXAMPLE_PLUGIN_VARIABLE,
169
- },
170
- async init(config: Record<string, string>) {
171
- logger.info('*** TESTING DEV MODE - PLUGIN MODIFIED AND RELOADED! ***');
172
- try {
173
- const validatedConfig = await configSchema.parseAsync(config);
174
-
175
- // Set all environment variables at once
176
- for (const [key, value] of Object.entries(validatedConfig)) {
177
- if (value) process.env[key] = value;
178
- }
179
- } catch (error) {
180
- if (error instanceof z.ZodError) {
181
- throw new Error(
182
- `Invalid plugin configuration: ${error.errors.map((e) => e.message).join(', ')}`
183
- );
184
- }
185
- throw error;
186
- }
187
- },
188
- models: {
189
- [ModelType.TEXT_SMALL]: async (
190
- _runtime,
191
- { prompt, stopSequences = [] }: GenerateTextParams
192
- ) => {
193
- return 'Never gonna give you up, never gonna let you down, never gonna run around and desert you...';
194
- },
195
- [ModelType.TEXT_LARGE]: async (
196
- _runtime,
197
- {
198
- prompt,
199
- stopSequences = [],
200
- maxTokens = 8192,
201
- temperature = 0.7,
202
- frequencyPenalty = 0.7,
203
- presencePenalty = 0.7,
204
- }: GenerateTextParams
205
- ) => {
206
- return 'Never gonna make you cry, never gonna say goodbye, never gonna tell a lie and hurt you...';
207
- },
208
- },
209
- routes: [
210
- {
211
- name: 'hello-world-route',
212
- path: '/helloworld',
213
- type: 'GET',
214
- handler: async (_req: any, res: any) => {
215
- // send a response
216
- res.json({
217
- message: 'Hello World!',
218
- });
219
- },
220
- },
221
- {
222
- name: 'current-time-route',
223
- path: '/api/time',
224
- type: 'GET',
225
- handler: async (_req: any, res: any) => {
226
- // Return current time in various formats
227
- const now = new Date();
228
- res.json({
229
- timestamp: now.toISOString(),
230
- unix: Math.floor(now.getTime() / 1000),
231
- formatted: now.toLocaleString(),
232
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
233
- });
234
- },
235
- },
236
- ],
237
- events: {
238
- MESSAGE_RECEIVED: [
239
- async (params) => {
240
- logger.debug('MESSAGE_RECEIVED event received');
241
- // print the keys
242
- logger.debug(Object.keys(params));
243
- },
244
- ],
245
- VOICE_MESSAGE_RECEIVED: [
246
- async (params) => {
247
- logger.debug('VOICE_MESSAGE_RECEIVED event received');
248
- // print the keys
249
- logger.debug(Object.keys(params));
250
- },
251
- ],
252
- WORLD_CONNECTED: [
253
- async (params) => {
254
- logger.debug('WORLD_CONNECTED event received');
255
- // print the keys
256
- logger.debug(Object.keys(params));
257
- },
258
- ],
259
- WORLD_JOINED: [
260
- async (params) => {
261
- logger.debug('WORLD_JOINED event received');
262
- // print the keys
263
- logger.debug(Object.keys(params));
264
- },
265
- ],
266
- },
267
- services: [StarterService],
268
- actions: [helloWorldAction],
269
- providers: [helloWorldProvider],
270
- tests: [StarterPluginTestSuite],
271
- // dependencies: ['@elizaos/plugin-knowledge'], <--- plugin dependencies go here (if requires another plugin)
272
- };
1
+ import { starterPlugin } from './plugin.ts';
273
2
 
3
+ export { starterPlugin, StarterService } from './plugin.ts';
274
4
  export default starterPlugin;