@elizaos/cli 1.0.14 → 1.0.16
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/assets/{index-WVhZEObe.js → index-BBiLesJT.js} +3 -3
- package/dist/assets/index-BBiLesJT.js.br +0 -0
- package/dist/assets/{index-WVhZEObe.js.map → index-BBiLesJT.js.map} +1 -1
- package/dist/assets/index-DxW_jg81.css +1 -0
- package/dist/assets/index-DxW_jg81.css.br +0 -0
- package/dist/assets/{index-BHRtDt-w.js → index-EfDd1Y35.js} +2105 -1820
- package/dist/assets/index-EfDd1Y35.js.br +0 -0
- package/dist/assets/{index-BHRtDt-w.js.map → index-EfDd1Y35.js.map} +1 -1
- package/dist/assets/{vendor-DSdxb8P-.js → vendor-DS2z8upE.js} +2 -2
- package/dist/assets/vendor-DS2z8upE.js.br +0 -0
- package/dist/assets/{vendor-DSdxb8P-.js.map → vendor-DS2z8upE.js.map} +1 -1
- package/dist/{chunk-IYFVOAOM.js → chunk-OK5O2MHJ.js} +505 -705
- package/dist/{chunk-E2PKE6N5.js → chunk-PRO6QOLZ.js} +188 -56
- package/dist/{chunk-23FI2G4U.js → chunk-UVBNT4WP.js} +19 -6
- package/dist/{chunk-KB3JDWUI.js → chunk-W4NJVJQV.js} +43 -1
- package/dist/commands/agent/actions/index.js +2 -3
- package/dist/commands/agent/index.js +2 -3
- package/dist/commands/create/actions/index.d.ts +3 -0
- package/dist/commands/create/actions/index.js +3 -4
- package/dist/commands/create/index.js +4 -5
- package/dist/elizaos-avatar.png +0 -0
- package/dist/index.html +3 -3
- package/dist/index.js +1462 -381
- package/dist/migration-guides/advanced-migration-guide.md +459 -0
- package/dist/migration-guides/completion-requirements.md +379 -0
- package/dist/migration-guides/integrated-migration-loop.md +392 -0
- package/dist/migration-guides/migration-guide.md +712 -0
- package/dist/migration-guides/prompt-and-generation-guide.md +702 -0
- package/dist/migration-guides/state-and-providers-guide.md +544 -0
- package/dist/migration-guides/testing-guide.md +1021 -0
- package/dist/{plugin-creator-TLQLTQIB.js → plugin-creator-ZCOZ3UCT.js} +1 -2
- package/dist/{registry-3YA2T6KV.js → registry-FBPEGL2T.js} +2 -3
- package/dist/templates/project-starter/package.json +4 -4
- package/dist/templates/project-starter/src/__tests__/character-plugin-ordering.test.ts +440 -0
- package/dist/templates/project-starter/src/character.ts +11 -4
- package/dist/templates/project-tee-starter/package.json +3 -3
- package/dist/templates/project-tee-starter/src/character.ts +13 -2
- package/dist/{utils-QKNGJZLP.js → utils-I3EA43DE.js} +6 -19
- package/package.json +8 -6
- package/templates/project-starter/package.json +4 -4
- package/templates/project-starter/src/__tests__/character-plugin-ordering.test.ts +440 -0
- package/templates/project-starter/src/character.ts +11 -4
- package/templates/project-tee-starter/package.json +3 -3
- package/templates/project-tee-starter/src/character.ts +13 -2
- package/dist/assets/index-DzLbKTxV.css +0 -1
- package/dist/assets/index-DzLbKTxV.css.br +0 -0
- package/dist/assets/index-WVhZEObe.js.br +0 -0
- package/dist/assets/vendor-DSdxb8P-.js.br +0 -0
- package/dist/chunk-RIAWNDYI.js +0 -49
- package/dist/migrator-UQ4XFYE5.js +0 -744
|
@@ -28,9 +28,8 @@ import {
|
|
|
28
28
|
setEnvVar,
|
|
29
29
|
setGitHubToken,
|
|
30
30
|
validateDataDir
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-KB3JDWUI.js";
|
|
31
|
+
} from "./chunk-OK5O2MHJ.js";
|
|
32
|
+
import "./chunk-W4NJVJQV.js";
|
|
34
33
|
import "./chunk-F24MS2YR.js";
|
|
35
34
|
import "./chunk-AQ6OMR2A.js";
|
|
36
35
|
export {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@elizaos/cli": "1.0.
|
|
32
|
-
"@elizaos/core": "1.0.
|
|
33
|
-
"@elizaos/plugin-bootstrap": "1.0.
|
|
34
|
-
"@elizaos/plugin-sql": "1.0.
|
|
31
|
+
"@elizaos/cli": "1.0.15",
|
|
32
|
+
"@elizaos/core": "1.0.15",
|
|
33
|
+
"@elizaos/plugin-bootstrap": "1.0.15",
|
|
34
|
+
"@elizaos/plugin-sql": "1.0.15",
|
|
35
35
|
"@tanstack/react-query": "^5.29.0",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"react": "^18.3.1",
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from 'bun:test';
|
|
2
|
+
import { character } from '../character';
|
|
3
|
+
|
|
4
|
+
describe('Project Starter Character Plugin Ordering', () => {
|
|
5
|
+
let originalEnv: Record<string, string | undefined>;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
// Save original environment
|
|
9
|
+
originalEnv = {
|
|
10
|
+
ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY,
|
|
11
|
+
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
|
|
12
|
+
OPENROUTER_API_KEY: process.env.OPENROUTER_API_KEY,
|
|
13
|
+
OLLAMA_API_ENDPOINT: process.env.OLLAMA_API_ENDPOINT,
|
|
14
|
+
GOOGLE_GENERATIVE_AI_API_KEY: process.env.GOOGLE_GENERATIVE_AI_API_KEY,
|
|
15
|
+
DISCORD_API_TOKEN: process.env.DISCORD_API_TOKEN,
|
|
16
|
+
TWITTER_API_KEY: process.env.TWITTER_API_KEY,
|
|
17
|
+
TWITTER_API_SECRET_KEY: process.env.TWITTER_API_SECRET_KEY,
|
|
18
|
+
TWITTER_ACCESS_TOKEN: process.env.TWITTER_ACCESS_TOKEN,
|
|
19
|
+
TWITTER_ACCESS_TOKEN_SECRET: process.env.TWITTER_ACCESS_TOKEN_SECRET,
|
|
20
|
+
TELEGRAM_BOT_TOKEN: process.env.TELEGRAM_BOT_TOKEN,
|
|
21
|
+
IGNORE_BOOTSTRAP: process.env.IGNORE_BOOTSTRAP,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Clear all environment variables
|
|
25
|
+
Object.keys(originalEnv).forEach((key) => {
|
|
26
|
+
delete process.env[key];
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
afterEach(() => {
|
|
31
|
+
// Restore original environment
|
|
32
|
+
Object.entries(originalEnv).forEach(([key, value]) => {
|
|
33
|
+
if (value === undefined) {
|
|
34
|
+
delete process.env[key];
|
|
35
|
+
} else {
|
|
36
|
+
process.env[key] = value;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('Core Plugin Ordering', () => {
|
|
42
|
+
it('should always include SQL plugin first', () => {
|
|
43
|
+
expect(character.plugins[0]).toBe('@elizaos/plugin-sql');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should include bootstrap plugin by default (not ignored)', () => {
|
|
47
|
+
expect(character.plugins).toContain('@elizaos/plugin-bootstrap');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should exclude bootstrap plugin when IGNORE_BOOTSTRAP is set', () => {
|
|
51
|
+
// Note: Since character is imported statically, we test the conditional logic structure
|
|
52
|
+
// The actual dynamic behavior is tested in the CLI tests with getElizaCharacter()
|
|
53
|
+
expect(character.plugins).toContain('@elizaos/plugin-bootstrap');
|
|
54
|
+
// In a dynamic context, bootstrap would be excluded when IGNORE_BOOTSTRAP is set
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('Local AI Fallback Logic Structure', () => {
|
|
59
|
+
it('should have local-ai fallback condition that checks all AI providers', () => {
|
|
60
|
+
// Test the structure of the conditional logic by examining the character definition
|
|
61
|
+
const characterStr = character.toString();
|
|
62
|
+
|
|
63
|
+
// The local-ai plugin should be conditional on NO other AI providers being available
|
|
64
|
+
expect(typeof character.plugins).toBe('object');
|
|
65
|
+
expect(Array.isArray(character.plugins)).toBe(true);
|
|
66
|
+
|
|
67
|
+
// Test the logical structure - local AI may or may not be present depending on env
|
|
68
|
+
const hasOtherAiProviders = character.plugins.some((plugin) =>
|
|
69
|
+
[
|
|
70
|
+
'@elizaos/plugin-anthropic',
|
|
71
|
+
'@elizaos/plugin-openai',
|
|
72
|
+
'@elizaos/plugin-openrouter',
|
|
73
|
+
'@elizaos/plugin-ollama',
|
|
74
|
+
'@elizaos/plugin-google-genai',
|
|
75
|
+
].includes(plugin)
|
|
76
|
+
);
|
|
77
|
+
const hasLocalAi = character.plugins.includes('@elizaos/plugin-local-ai');
|
|
78
|
+
|
|
79
|
+
// If other AI providers exist, local-ai should not be present (and vice versa)
|
|
80
|
+
if (hasOtherAiProviders) {
|
|
81
|
+
expect(hasLocalAi).toBe(false);
|
|
82
|
+
} else {
|
|
83
|
+
expect(hasLocalAi).toBe(true);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should structure embedding plugins after text-only plugins', () => {
|
|
88
|
+
const plugins = character.plugins;
|
|
89
|
+
|
|
90
|
+
// Find indices of key plugins
|
|
91
|
+
const sqlIndex = plugins.indexOf('@elizaos/plugin-sql');
|
|
92
|
+
const localAiIndex = plugins.indexOf('@elizaos/plugin-local-ai');
|
|
93
|
+
|
|
94
|
+
// SQL should be first
|
|
95
|
+
expect(sqlIndex).toBe(0);
|
|
96
|
+
|
|
97
|
+
// Local AI should be last when present
|
|
98
|
+
if (localAiIndex !== -1) {
|
|
99
|
+
expect(localAiIndex).toBe(plugins.length - 1);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe('Plugin Categories and Ordering', () => {
|
|
105
|
+
it('should categorize plugins correctly', () => {
|
|
106
|
+
const plugins = character.plugins;
|
|
107
|
+
|
|
108
|
+
// Core plugins
|
|
109
|
+
expect(plugins).toContain('@elizaos/plugin-sql');
|
|
110
|
+
|
|
111
|
+
// Text-only AI plugins (no embedding support)
|
|
112
|
+
const textOnlyPlugins = ['@elizaos/plugin-anthropic', '@elizaos/plugin-openrouter'];
|
|
113
|
+
|
|
114
|
+
// Embedding-capable AI plugins
|
|
115
|
+
const embeddingPlugins = [
|
|
116
|
+
'@elizaos/plugin-openai',
|
|
117
|
+
'@elizaos/plugin-ollama',
|
|
118
|
+
'@elizaos/plugin-google-genai',
|
|
119
|
+
'@elizaos/plugin-local-ai',
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
// Platform plugins
|
|
123
|
+
const platformPlugins = [
|
|
124
|
+
'@elizaos/plugin-discord',
|
|
125
|
+
'@elizaos/plugin-twitter',
|
|
126
|
+
'@elizaos/plugin-telegram',
|
|
127
|
+
];
|
|
128
|
+
|
|
129
|
+
// Bootstrap plugin
|
|
130
|
+
const bootstrapPlugin = '@elizaos/plugin-bootstrap';
|
|
131
|
+
|
|
132
|
+
// Verify all categories are represented in the plugin structure
|
|
133
|
+
const allExpectedPlugins = [
|
|
134
|
+
'@elizaos/plugin-sql',
|
|
135
|
+
...textOnlyPlugins,
|
|
136
|
+
...platformPlugins,
|
|
137
|
+
bootstrapPlugin,
|
|
138
|
+
...embeddingPlugins,
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
// Check that our character has conditional logic for all these plugins
|
|
142
|
+
// SQL should always be present
|
|
143
|
+
expect(plugins).toContain('@elizaos/plugin-sql');
|
|
144
|
+
|
|
145
|
+
// Bootstrap should be present unless IGNORE_BOOTSTRAP is set
|
|
146
|
+
expect(plugins).toContain('@elizaos/plugin-bootstrap');
|
|
147
|
+
|
|
148
|
+
// Local AI is only present when no other AI providers are available
|
|
149
|
+
const hasOtherAiProviders = plugins.some((plugin) =>
|
|
150
|
+
[
|
|
151
|
+
'@elizaos/plugin-anthropic',
|
|
152
|
+
'@elizaos/plugin-openai',
|
|
153
|
+
'@elizaos/plugin-openrouter',
|
|
154
|
+
'@elizaos/plugin-ollama',
|
|
155
|
+
'@elizaos/plugin-google-genai',
|
|
156
|
+
].includes(plugin)
|
|
157
|
+
);
|
|
158
|
+
const hasLocalAi = plugins.includes('@elizaos/plugin-local-ai');
|
|
159
|
+
|
|
160
|
+
if (hasOtherAiProviders) {
|
|
161
|
+
expect(hasLocalAi).toBe(false);
|
|
162
|
+
} else {
|
|
163
|
+
expect(hasLocalAi).toBe(true);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it('should maintain proper ordering between plugin categories', () => {
|
|
168
|
+
const plugins = character.plugins;
|
|
169
|
+
|
|
170
|
+
// Get indices of representative plugins from each category
|
|
171
|
+
const sqlIndex = plugins.indexOf('@elizaos/plugin-sql');
|
|
172
|
+
const bootstrapIndex = plugins.indexOf('@elizaos/plugin-bootstrap');
|
|
173
|
+
const localAiIndex = plugins.indexOf('@elizaos/plugin-local-ai');
|
|
174
|
+
|
|
175
|
+
// SQL should be first
|
|
176
|
+
expect(sqlIndex).toBe(0);
|
|
177
|
+
|
|
178
|
+
// Bootstrap should come before embedding plugins
|
|
179
|
+
if (bootstrapIndex !== -1 && localAiIndex !== -1) {
|
|
180
|
+
expect(bootstrapIndex).toBeLessThan(localAiIndex);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
describe('Environment Variable Integration', () => {
|
|
186
|
+
it('should have conditional logic for all AI providers', () => {
|
|
187
|
+
// Test that the character structure includes conditional logic
|
|
188
|
+
// Note: Since this is a static import, we test the structure rather than dynamic behavior
|
|
189
|
+
|
|
190
|
+
const plugins = character.plugins;
|
|
191
|
+
|
|
192
|
+
// Should always have core plugins
|
|
193
|
+
expect(plugins).toContain('@elizaos/plugin-sql');
|
|
194
|
+
expect(plugins).toContain('@elizaos/plugin-bootstrap');
|
|
195
|
+
|
|
196
|
+
// Local AI presence depends on other AI providers
|
|
197
|
+
const hasOtherAiProviders = plugins.some((plugin) =>
|
|
198
|
+
[
|
|
199
|
+
'@elizaos/plugin-anthropic',
|
|
200
|
+
'@elizaos/plugin-openai',
|
|
201
|
+
'@elizaos/plugin-openrouter',
|
|
202
|
+
'@elizaos/plugin-ollama',
|
|
203
|
+
'@elizaos/plugin-google-genai',
|
|
204
|
+
].includes(plugin)
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
if (!hasOtherAiProviders) {
|
|
208
|
+
expect(plugins).toContain('@elizaos/plugin-local-ai');
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it('should include proper conditional checks for Twitter', () => {
|
|
213
|
+
// Twitter requires all 4 environment variables
|
|
214
|
+
// Test that the logic structure is sound
|
|
215
|
+
const plugins = character.plugins;
|
|
216
|
+
|
|
217
|
+
// Twitter should not be in default config (no env vars set)
|
|
218
|
+
expect(plugins).not.toContain('@elizaos/plugin-twitter');
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
it('should structure platform plugins between AI plugins', () => {
|
|
222
|
+
const plugins = character.plugins;
|
|
223
|
+
|
|
224
|
+
// Platform plugins should be positioned correctly in the array structure
|
|
225
|
+
const sqlIndex = plugins.indexOf('@elizaos/plugin-sql');
|
|
226
|
+
const bootstrapIndex = plugins.indexOf('@elizaos/plugin-bootstrap');
|
|
227
|
+
|
|
228
|
+
// Platform plugins (when present) should be between SQL and bootstrap
|
|
229
|
+
expect(sqlIndex).toBeLessThan(bootstrapIndex);
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
describe('Embedding Plugin Priority Verification', () => {
|
|
234
|
+
it('should structure embedding plugins at the end', () => {
|
|
235
|
+
const plugins = character.plugins;
|
|
236
|
+
|
|
237
|
+
// Get the last few plugins
|
|
238
|
+
const lastThreePlugins = plugins.slice(-3);
|
|
239
|
+
|
|
240
|
+
// At least one should be an embedding-capable plugin
|
|
241
|
+
const embeddingPlugins = [
|
|
242
|
+
'@elizaos/plugin-openai',
|
|
243
|
+
'@elizaos/plugin-ollama',
|
|
244
|
+
'@elizaos/plugin-google-genai',
|
|
245
|
+
'@elizaos/plugin-local-ai',
|
|
246
|
+
];
|
|
247
|
+
|
|
248
|
+
// Check if any embedding plugins are present
|
|
249
|
+
const embeddingPluginsPresent = plugins.filter((plugin) => embeddingPlugins.includes(plugin));
|
|
250
|
+
|
|
251
|
+
// If embedding plugins are present, at least one should be at the end
|
|
252
|
+
if (embeddingPluginsPresent.length > 0) {
|
|
253
|
+
const hasEmbeddingAtEnd = lastThreePlugins.some((plugin) =>
|
|
254
|
+
embeddingPlugins.includes(plugin)
|
|
255
|
+
);
|
|
256
|
+
expect(hasEmbeddingAtEnd).toBe(true);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it('should place local-ai as final fallback when present', () => {
|
|
261
|
+
const plugins = character.plugins;
|
|
262
|
+
const localAiIndex = plugins.indexOf('@elizaos/plugin-local-ai');
|
|
263
|
+
|
|
264
|
+
// Local AI should be the last plugin when it's present (no other AI providers)
|
|
265
|
+
if (localAiIndex !== -1) {
|
|
266
|
+
expect(localAiIndex).toBe(plugins.length - 1);
|
|
267
|
+
} else {
|
|
268
|
+
// If local AI is not present, other AI providers should exist
|
|
269
|
+
const hasOtherAiProviders = plugins.some((plugin) =>
|
|
270
|
+
[
|
|
271
|
+
'@elizaos/plugin-anthropic',
|
|
272
|
+
'@elizaos/plugin-openai',
|
|
273
|
+
'@elizaos/plugin-openrouter',
|
|
274
|
+
'@elizaos/plugin-ollama',
|
|
275
|
+
'@elizaos/plugin-google-genai',
|
|
276
|
+
].includes(plugin)
|
|
277
|
+
);
|
|
278
|
+
expect(hasOtherAiProviders).toBe(true);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it('should maintain consistent plugin structure', () => {
|
|
283
|
+
// Test multiple evaluations for consistency
|
|
284
|
+
const plugins1 = character.plugins;
|
|
285
|
+
const plugins2 = character.plugins;
|
|
286
|
+
|
|
287
|
+
expect(plugins1).toEqual(plugins2);
|
|
288
|
+
expect(plugins1.length).toBe(plugins2.length);
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
describe('Plugin Logic Validation', () => {
|
|
293
|
+
it('should follow the expected plugin ordering pattern', () => {
|
|
294
|
+
const plugins = character.plugins;
|
|
295
|
+
|
|
296
|
+
// Expected pattern: [SQL, Text-only AI, Platforms, Bootstrap, Embedding AI]
|
|
297
|
+
// Verify the basic structure exists
|
|
298
|
+
expect(plugins[0]).toBe('@elizaos/plugin-sql'); // SQL always first
|
|
299
|
+
expect(plugins).toContain('@elizaos/plugin-bootstrap'); // Bootstrap present
|
|
300
|
+
|
|
301
|
+
// Verify ordering: text-only plugins before embedding plugins
|
|
302
|
+
const textOnlyPlugins = ['@elizaos/plugin-anthropic', '@elizaos/plugin-openrouter'];
|
|
303
|
+
const embeddingPlugins = [
|
|
304
|
+
'@elizaos/plugin-openai',
|
|
305
|
+
'@elizaos/plugin-ollama',
|
|
306
|
+
'@elizaos/plugin-google-genai',
|
|
307
|
+
'@elizaos/plugin-local-ai',
|
|
308
|
+
];
|
|
309
|
+
|
|
310
|
+
const textOnlyIndices = textOnlyPlugins
|
|
311
|
+
.map((p) => plugins.indexOf(p))
|
|
312
|
+
.filter((i) => i !== -1);
|
|
313
|
+
const embeddingIndices = embeddingPlugins
|
|
314
|
+
.map((p) => plugins.indexOf(p))
|
|
315
|
+
.filter((i) => i !== -1);
|
|
316
|
+
|
|
317
|
+
if (textOnlyIndices.length > 0 && embeddingIndices.length > 0) {
|
|
318
|
+
const maxTextOnly = Math.max(...textOnlyIndices);
|
|
319
|
+
const minEmbedding = Math.min(...embeddingIndices);
|
|
320
|
+
expect(minEmbedding).toBeGreaterThan(maxTextOnly);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
it('should have valid plugin names', () => {
|
|
325
|
+
const plugins = character.plugins;
|
|
326
|
+
|
|
327
|
+
plugins.forEach((plugin) => {
|
|
328
|
+
expect(typeof plugin).toBe('string');
|
|
329
|
+
expect(plugin).toMatch(/^@elizaos\/plugin-/);
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
it('should not have duplicate plugins', () => {
|
|
334
|
+
const plugins = character.plugins;
|
|
335
|
+
const uniquePlugins = [...new Set(plugins)];
|
|
336
|
+
|
|
337
|
+
expect(plugins.length).toBe(uniquePlugins.length);
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
describe('Complex Configuration Scenarios', () => {
|
|
342
|
+
it('should handle complete AI provider setup correctly', () => {
|
|
343
|
+
// This tests the theoretical structure for when all providers are available
|
|
344
|
+
const allAiProviders = [
|
|
345
|
+
'@elizaos/plugin-anthropic',
|
|
346
|
+
'@elizaos/plugin-openrouter',
|
|
347
|
+
'@elizaos/plugin-openai',
|
|
348
|
+
'@elizaos/plugin-ollama',
|
|
349
|
+
'@elizaos/plugin-google-genai',
|
|
350
|
+
];
|
|
351
|
+
|
|
352
|
+
// In a complete setup, local-ai should not be included
|
|
353
|
+
// Test the logical structure based on current environment
|
|
354
|
+
const hasOtherAiProviders = character.plugins.some((plugin) =>
|
|
355
|
+
allAiProviders.includes(plugin)
|
|
356
|
+
);
|
|
357
|
+
const hasLocalAi = character.plugins.includes('@elizaos/plugin-local-ai');
|
|
358
|
+
|
|
359
|
+
// If other AI providers exist, local-ai should not be present
|
|
360
|
+
if (hasOtherAiProviders) {
|
|
361
|
+
expect(hasLocalAi).toBe(false);
|
|
362
|
+
} else {
|
|
363
|
+
expect(hasLocalAi).toBe(true);
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
it('should validate embedding vs text-only categorization', () => {
|
|
368
|
+
const embeddingCapablePlugins = [
|
|
369
|
+
'@elizaos/plugin-openai',
|
|
370
|
+
'@elizaos/plugin-ollama',
|
|
371
|
+
'@elizaos/plugin-google-genai',
|
|
372
|
+
'@elizaos/plugin-local-ai',
|
|
373
|
+
];
|
|
374
|
+
|
|
375
|
+
const textOnlyPlugins = ['@elizaos/plugin-anthropic', '@elizaos/plugin-openrouter'];
|
|
376
|
+
|
|
377
|
+
// Verify our categorization is complete and mutually exclusive
|
|
378
|
+
const intersection = embeddingCapablePlugins.filter((plugin) =>
|
|
379
|
+
textOnlyPlugins.includes(plugin)
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
expect(intersection.length).toBe(0); // No overlap
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
it('should structure conditional logic properly', () => {
|
|
386
|
+
// Test that the character has the right structure for conditional loading
|
|
387
|
+
const plugins = character.plugins;
|
|
388
|
+
|
|
389
|
+
// Should have core plugins
|
|
390
|
+
expect(plugins).toContain('@elizaos/plugin-sql');
|
|
391
|
+
|
|
392
|
+
// Should have bootstrap (unless ignored)
|
|
393
|
+
expect(plugins).toContain('@elizaos/plugin-bootstrap');
|
|
394
|
+
|
|
395
|
+
// Should have fallback logic working correctly
|
|
396
|
+
const hasOtherAiProviders = plugins.some((plugin) =>
|
|
397
|
+
[
|
|
398
|
+
'@elizaos/plugin-anthropic',
|
|
399
|
+
'@elizaos/plugin-openai',
|
|
400
|
+
'@elizaos/plugin-openrouter',
|
|
401
|
+
'@elizaos/plugin-ollama',
|
|
402
|
+
'@elizaos/plugin-google-genai',
|
|
403
|
+
].includes(plugin)
|
|
404
|
+
);
|
|
405
|
+
const hasLocalAi = plugins.includes('@elizaos/plugin-local-ai');
|
|
406
|
+
|
|
407
|
+
// Either has other AI providers OR has local-ai fallback
|
|
408
|
+
expect(hasOtherAiProviders || hasLocalAi).toBe(true);
|
|
409
|
+
|
|
410
|
+
// Conditional plugins depend on actual environment variables
|
|
411
|
+
// Test that the structure is logical based on what's present
|
|
412
|
+
if (hasOtherAiProviders) {
|
|
413
|
+
// If other AI providers are present, local-ai should not be
|
|
414
|
+
expect(hasLocalAi).toBe(false);
|
|
415
|
+
} else {
|
|
416
|
+
// If no other AI providers, local-ai should be present as fallback
|
|
417
|
+
expect(hasLocalAi).toBe(true);
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
describe('Character Properties Validation', () => {
|
|
423
|
+
it('should have all required character properties', () => {
|
|
424
|
+
expect(character.name).toBe('Eliza');
|
|
425
|
+
expect(Array.isArray(character.plugins)).toBe(true);
|
|
426
|
+
expect(typeof character.system).toBe('string');
|
|
427
|
+
expect(Array.isArray(character.bio)).toBe(true);
|
|
428
|
+
expect(Array.isArray(character.topics)).toBe(true);
|
|
429
|
+
expect(Array.isArray(character.messageExamples)).toBe(true);
|
|
430
|
+
expect(typeof character.style).toBe('object');
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
it('should have consistent character configuration', () => {
|
|
434
|
+
// Verify character is properly configured
|
|
435
|
+
expect(character.plugins.length).toBeGreaterThan(0);
|
|
436
|
+
expect(character.bio.length).toBeGreaterThan(0);
|
|
437
|
+
expect(character.system.length).toBeGreaterThan(0);
|
|
438
|
+
});
|
|
439
|
+
});
|
|
440
|
+
});
|
|
@@ -9,19 +9,24 @@ import { type Character } from '@elizaos/core';
|
|
|
9
9
|
export const character: Character = {
|
|
10
10
|
name: 'Eliza',
|
|
11
11
|
plugins: [
|
|
12
|
+
// Core plugins first
|
|
12
13
|
'@elizaos/plugin-sql',
|
|
14
|
+
|
|
15
|
+
// Text-only plugins (no embedding support)
|
|
13
16
|
...(process.env.ANTHROPIC_API_KEY ? ['@elizaos/plugin-anthropic'] : []),
|
|
14
17
|
...(process.env.OPENROUTER_API_KEY ? ['@elizaos/plugin-openrouter'] : []),
|
|
18
|
+
|
|
19
|
+
// Embedding-capable plugins last (lowest priority for embedding fallback)
|
|
20
|
+
...(process.env.OPENAI_API_KEY ? ['@elizaos/plugin-openai'] : []),
|
|
15
21
|
...(process.env.OLLAMA_API_ENDPOINT ? ['@elizaos/plugin-ollama'] : []),
|
|
16
22
|
...(process.env.GOOGLE_GENERATIVE_AI_API_KEY ? ['@elizaos/plugin-google-genai'] : []),
|
|
17
|
-
...(process.env.
|
|
18
|
-
...(!process.env.ANTHROPIC_API_KEY &&
|
|
19
|
-
!process.env.OPENROUTER_API_KEY &&
|
|
20
|
-
!process.env.GOOGLE_GENERATIVE_AI_API_KEY &&
|
|
23
|
+
...(!process.env.GOOGLE_GENERATIVE_AI_API_KEY &&
|
|
21
24
|
!process.env.OLLAMA_API_ENDPOINT &&
|
|
22
25
|
!process.env.OPENAI_API_KEY
|
|
23
26
|
? ['@elizaos/plugin-local-ai']
|
|
24
27
|
: []),
|
|
28
|
+
|
|
29
|
+
// Platform plugins
|
|
25
30
|
...(process.env.DISCORD_API_TOKEN ? ['@elizaos/plugin-discord'] : []),
|
|
26
31
|
...(process.env.TWITTER_API_KEY &&
|
|
27
32
|
process.env.TWITTER_API_SECRET_KEY &&
|
|
@@ -30,6 +35,8 @@ export const character: Character = {
|
|
|
30
35
|
? ['@elizaos/plugin-twitter']
|
|
31
36
|
: []),
|
|
32
37
|
...(process.env.TELEGRAM_BOT_TOKEN ? ['@elizaos/plugin-telegram'] : []),
|
|
38
|
+
|
|
39
|
+
// Bootstrap plugin
|
|
33
40
|
...(!process.env.IGNORE_BOOTSTRAP ? ['@elizaos/plugin-bootstrap'] : []),
|
|
34
41
|
],
|
|
35
42
|
settings: {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"GUIDE.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@elizaos/cli": "1.0.
|
|
37
|
-
"@elizaos/core": "1.0.
|
|
36
|
+
"@elizaos/cli": "1.0.15",
|
|
37
|
+
"@elizaos/core": "1.0.15",
|
|
38
38
|
"@elizaos/plugin-redpill": "1.0.3",
|
|
39
|
-
"@elizaos/plugin-sql": "1.0.
|
|
39
|
+
"@elizaos/plugin-sql": "1.0.15",
|
|
40
40
|
"@phala/dstack-sdk": "0.1.11",
|
|
41
41
|
"@solana/web3.js": "1.98.2",
|
|
42
42
|
"viem": "2.30.1",
|
|
@@ -19,12 +19,23 @@ const avatar = fs.existsSync(imagePath)
|
|
|
19
19
|
export const mrTeeCharacter: Character = {
|
|
20
20
|
name: 'Mr. TEE',
|
|
21
21
|
plugins: [
|
|
22
|
+
// Core plugins first
|
|
22
23
|
'@elizaos/plugin-sql',
|
|
23
|
-
'@elizaos/plugin-openai',
|
|
24
|
-
'@elizaos/plugin-redpill',
|
|
25
24
|
'@elizaos/plugin-bootstrap',
|
|
25
|
+
|
|
26
|
+
// LLM provider
|
|
27
|
+
'@elizaos/plugin-redpill',
|
|
28
|
+
|
|
29
|
+
// Voice Provider
|
|
26
30
|
'@elizaos/plugin-elevenlabs',
|
|
31
|
+
|
|
32
|
+
// Embedding-capable plugins after other AI plugins
|
|
33
|
+
'@elizaos/plugin-openai',
|
|
34
|
+
|
|
35
|
+
// Specialized Plugins
|
|
27
36
|
'@elizaos/plugin-tee',
|
|
37
|
+
|
|
38
|
+
// Platform Plugins
|
|
28
39
|
'@elizaos/plugin-discord',
|
|
29
40
|
],
|
|
30
41
|
settings: {
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
buildGitHubSpecifier,
|
|
12
12
|
buildProject,
|
|
13
13
|
checkAndShowUpdateNotification,
|
|
14
|
-
checkPluginRequirements,
|
|
15
14
|
checkServer,
|
|
16
15
|
configSchema,
|
|
17
16
|
configureDatabaseSettings,
|
|
@@ -34,10 +33,10 @@ import {
|
|
|
34
33
|
findNextAvailablePort,
|
|
35
34
|
forkExists,
|
|
36
35
|
forkRepository,
|
|
37
|
-
formatEnvFileWithTemplate,
|
|
38
36
|
getAuthenticatedUser,
|
|
39
37
|
getCliInstallTag,
|
|
40
38
|
getConfigFilePath,
|
|
39
|
+
getDisplayDirectory,
|
|
41
40
|
getElizaDirectories,
|
|
42
41
|
getEnvFilePath,
|
|
43
42
|
getFileContent,
|
|
@@ -45,11 +44,9 @@ import {
|
|
|
45
44
|
getInstallCommand,
|
|
46
45
|
getLatestCliVersion,
|
|
47
46
|
getLocalPackages,
|
|
48
|
-
getMissingEnvVars,
|
|
49
47
|
getPackageInfo,
|
|
50
48
|
getPackageManager,
|
|
51
49
|
getPackageVersion,
|
|
52
|
-
getPluginStatus,
|
|
53
50
|
getVersion,
|
|
54
51
|
handleError,
|
|
55
52
|
installPlugin,
|
|
@@ -57,6 +54,7 @@ import {
|
|
|
57
54
|
isCliInstalledViaNpm,
|
|
58
55
|
isGlobalInstallation,
|
|
59
56
|
isPortFree,
|
|
57
|
+
isRunningFromNodeModules,
|
|
60
58
|
isRunningViaBunx,
|
|
61
59
|
isRunningViaNpx,
|
|
62
60
|
isUtf8Locale,
|
|
@@ -70,7 +68,6 @@ import {
|
|
|
70
68
|
loadEnvironment,
|
|
71
69
|
loadPluginModule,
|
|
72
70
|
logHeader,
|
|
73
|
-
mergeProcessEnvWithTemplate,
|
|
74
71
|
migrateCliToBun,
|
|
75
72
|
promptAndStoreAnthropicKey,
|
|
76
73
|
promptAndStoreGoogleKey,
|
|
@@ -79,7 +76,6 @@ import {
|
|
|
79
76
|
promptAndStoreOpenAIKey,
|
|
80
77
|
promptAndStoreOpenRouterKey,
|
|
81
78
|
promptAndStorePostgresUrl,
|
|
82
|
-
promptForEnvVars,
|
|
83
79
|
promptForMultipleItems,
|
|
84
80
|
promptWithNav,
|
|
85
81
|
provideLocalPluginGuidance,
|
|
@@ -108,15 +104,12 @@ import {
|
|
|
108
104
|
testPublishToGitHub,
|
|
109
105
|
testPublishToNpm,
|
|
110
106
|
updateFile,
|
|
111
|
-
validateEnvVars,
|
|
112
107
|
validateGitHubToken,
|
|
113
|
-
validatePluginEnvVars,
|
|
114
108
|
writeEnvFile
|
|
115
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-OK5O2MHJ.js";
|
|
116
110
|
import {
|
|
117
111
|
runBunCommand
|
|
118
|
-
} from "./chunk-
|
|
119
|
-
import "./chunk-KB3JDWUI.js";
|
|
112
|
+
} from "./chunk-W4NJVJQV.js";
|
|
120
113
|
import "./chunk-F24MS2YR.js";
|
|
121
114
|
import "./chunk-AQ6OMR2A.js";
|
|
122
115
|
export {
|
|
@@ -128,7 +121,6 @@ export {
|
|
|
128
121
|
buildGitHubSpecifier,
|
|
129
122
|
buildProject,
|
|
130
123
|
checkAndShowUpdateNotification,
|
|
131
|
-
checkPluginRequirements,
|
|
132
124
|
checkServer,
|
|
133
125
|
configSchema,
|
|
134
126
|
configureDatabaseSettings,
|
|
@@ -151,10 +143,10 @@ export {
|
|
|
151
143
|
findNextAvailablePort,
|
|
152
144
|
forkExists,
|
|
153
145
|
forkRepository,
|
|
154
|
-
formatEnvFileWithTemplate,
|
|
155
146
|
getAuthenticatedUser,
|
|
156
147
|
getCliInstallTag,
|
|
157
148
|
getConfigFilePath,
|
|
149
|
+
getDisplayDirectory,
|
|
158
150
|
getElizaDirectories,
|
|
159
151
|
getEnvFilePath,
|
|
160
152
|
getFileContent,
|
|
@@ -162,11 +154,9 @@ export {
|
|
|
162
154
|
getInstallCommand,
|
|
163
155
|
getLatestCliVersion,
|
|
164
156
|
getLocalPackages,
|
|
165
|
-
getMissingEnvVars,
|
|
166
157
|
getPackageInfo,
|
|
167
158
|
getPackageManager,
|
|
168
159
|
getPackageVersion,
|
|
169
|
-
getPluginStatus,
|
|
170
160
|
getVersion,
|
|
171
161
|
handleError,
|
|
172
162
|
installPlugin,
|
|
@@ -174,6 +164,7 @@ export {
|
|
|
174
164
|
isCliInstalledViaNpm,
|
|
175
165
|
isGlobalInstallation,
|
|
176
166
|
isPortFree,
|
|
167
|
+
isRunningFromNodeModules,
|
|
177
168
|
isRunningViaBunx,
|
|
178
169
|
isRunningViaNpx,
|
|
179
170
|
isUtf8Locale,
|
|
@@ -187,7 +178,6 @@ export {
|
|
|
187
178
|
loadEnvironment,
|
|
188
179
|
loadPluginModule,
|
|
189
180
|
logHeader,
|
|
190
|
-
mergeProcessEnvWithTemplate,
|
|
191
181
|
migrateCliToBun,
|
|
192
182
|
promptAndStoreAnthropicKey,
|
|
193
183
|
promptAndStoreGoogleKey,
|
|
@@ -196,7 +186,6 @@ export {
|
|
|
196
186
|
promptAndStoreOpenAIKey,
|
|
197
187
|
promptAndStoreOpenRouterKey,
|
|
198
188
|
promptAndStorePostgresUrl,
|
|
199
|
-
promptForEnvVars,
|
|
200
189
|
promptForMultipleItems,
|
|
201
190
|
promptWithNav,
|
|
202
191
|
provideLocalPluginGuidance,
|
|
@@ -226,8 +215,6 @@ export {
|
|
|
226
215
|
testPublishToGitHub,
|
|
227
216
|
testPublishToNpm,
|
|
228
217
|
updateFile,
|
|
229
|
-
validateEnvVars,
|
|
230
218
|
validateGitHubToken,
|
|
231
|
-
validatePluginEnvVars,
|
|
232
219
|
writeEnvFile
|
|
233
220
|
};
|