@elizaos/cli 1.5.11-alpha.6 → 1.5.11-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/commands/agent/utils/validation.d.ts +3 -31
- package/dist/commands/agent/utils/validation.d.ts.map +1 -1
- package/dist/commands/create/types.d.ts +7 -8
- package/dist/commands/create/types.d.ts.map +1 -1
- package/dist/commands/create/utils/validation.d.ts +2 -2
- package/dist/commands/create/utils/validation.d.ts.map +1 -1
- package/dist/commands/report/src/report-schema.d.ts +11 -167
- package/dist/commands/report/src/report-schema.d.ts.map +1 -1
- package/dist/commands/scenario/src/MockEngine.d.ts +11 -11
- package/dist/commands/scenario/src/matrix-schema.d.ts +5 -70
- package/dist/commands/scenario/src/matrix-schema.d.ts.map +1 -1
- package/dist/commands/scenario/src/schema.d.ts +175 -2007
- package/dist/commands/scenario/src/schema.d.ts.map +1 -1
- package/dist/index.js +23802 -15090
- package/dist/index.js.map +76 -8
- package/dist/templates/plugin-quick-starter/package.json +4 -4
- package/dist/templates/plugin-starter/package.json +4 -4
- package/dist/templates/project-starter/package.json +7 -7
- package/dist/templates/project-tee-starter/package.json +5 -5
- package/dist/templates/project-tee-starter/src/__tests__/config.test.ts +1 -1
- package/dist/templates/project-tee-starter/src/__tests__/tee-validation.test.ts +60 -4
- package/dist/templates/project-tee-starter/src/plugin.ts +66 -25
- package/dist/utils/get-config.d.ts +27 -194
- package/dist/utils/get-config.d.ts.map +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +2 -2
- package/package.json +8 -8
- package/templates/plugin-quick-starter/package.json +4 -4
- package/templates/plugin-starter/package.json +4 -4
- package/templates/project-starter/package.json +7 -7
- package/templates/project-tee-starter/package.json +5 -5
- package/templates/project-tee-starter/src/__tests__/config.test.ts +1 -1
- package/templates/project-tee-starter/src/__tests__/tee-validation.test.ts +60 -4
- package/templates/project-tee-starter/src/plugin.ts +66 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/cli",
|
|
3
|
-
"version": "1.5.11-
|
|
3
|
+
"version": "1.5.11-beta.0",
|
|
4
4
|
"description": "elizaOS CLI - Manage your AI agents and plugins",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
"typescript": "5.8.3",
|
|
75
75
|
"vite": "^6.3.5"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "caadaa3d79cb1a2b5ef4655987019ae1fccf3e90",
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@anthropic-ai/claude-code": "^1.0.35",
|
|
80
80
|
"@anthropic-ai/sdk": "^0.54.0",
|
|
81
81
|
"@clack/prompts": "^0.11.0",
|
|
82
|
-
"@elizaos/api-client": "1.5.11-
|
|
83
|
-
"@elizaos/core": "1.5.11-
|
|
84
|
-
"@elizaos/plugin-bootstrap": "1.5.11-
|
|
82
|
+
"@elizaos/api-client": "1.5.11-beta.0",
|
|
83
|
+
"@elizaos/core": "1.5.11-beta.0",
|
|
84
|
+
"@elizaos/plugin-bootstrap": "1.5.11-beta.0",
|
|
85
85
|
"@elizaos/plugin-openai": "1.0.11",
|
|
86
|
-
"@elizaos/plugin-sql": "1.5.11-
|
|
87
|
-
"@elizaos/server": "1.5.11-
|
|
86
|
+
"@elizaos/plugin-sql": "1.5.11-beta.0",
|
|
87
|
+
"@elizaos/server": "1.5.11-beta.0",
|
|
88
88
|
"bun": "^1.2.21",
|
|
89
89
|
"chalk": "^5.4.1",
|
|
90
90
|
"chokidar": "^4.0.3",
|
|
@@ -102,6 +102,6 @@
|
|
|
102
102
|
"tsconfig-paths": "^4.2.0",
|
|
103
103
|
"type-fest": "^4.41.0",
|
|
104
104
|
"yoctocolors": "^2.1.1",
|
|
105
|
-
"zod": "
|
|
105
|
+
"zod": "4.1.11"
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"package.json"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elizaos/core": "1.5.11-
|
|
43
|
-
"zod": "
|
|
42
|
+
"@elizaos/core": "1.5.11-beta.0",
|
|
43
|
+
"zod": "4.1.11"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@elizaos/cli": "1.5.11-
|
|
46
|
+
"@elizaos/cli": "1.5.11-beta.0",
|
|
47
47
|
"dotenv": "16.4.5",
|
|
48
48
|
"prettier": "3.5.3",
|
|
49
49
|
"typescript": "5.8.2"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"resolutions": {
|
|
64
64
|
"// Note": "langchain 0.3.30 fixes @langchain/core zod/v3 import issues",
|
|
65
|
-
"zod": "
|
|
65
|
+
"zod": "4.1.11",
|
|
66
66
|
"langchain": "0.3.30",
|
|
67
67
|
"@langchain/core": "0.3.30"
|
|
68
68
|
},
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"package.json"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elizaos/core": "1.5.11-
|
|
42
|
+
"@elizaos/core": "1.5.11-beta.0",
|
|
43
43
|
"@tanstack/react-query": "^5.80.7",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"tailwind-merge": "^3.3.1",
|
|
46
46
|
"tailwindcss": "^4.1.10",
|
|
47
47
|
"vite": "^6.3.5",
|
|
48
|
-
"zod": "
|
|
48
|
+
"zod": "4.1.11"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@elizaos/cli": "1.5.11-
|
|
51
|
+
"@elizaos/cli": "1.5.11-beta.0",
|
|
52
52
|
"@tailwindcss/vite": "^4.1.10",
|
|
53
53
|
"@vitejs/plugin-react-swc": "^3.10.2",
|
|
54
54
|
"dotenv": "16.4.5",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
"resolutions": {
|
|
79
79
|
"// Note": "langchain 0.3.30 fixes @langchain/core zod/v3 import issues",
|
|
80
|
-
"zod": "
|
|
80
|
+
"zod": "4.1.11",
|
|
81
81
|
"langchain": "0.3.30",
|
|
82
82
|
"@langchain/core": "0.3.30"
|
|
83
83
|
},
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@elizaos/cli": "1.5.11-
|
|
31
|
-
"@elizaos/client": "1.5.11-
|
|
32
|
-
"@elizaos/core": "1.5.11-
|
|
33
|
-
"@elizaos/plugin-bootstrap": "1.5.11-
|
|
34
|
-
"@elizaos/plugin-sql": "1.5.11-
|
|
35
|
-
"@elizaos/server": "1.5.11-
|
|
30
|
+
"@elizaos/cli": "1.5.11-beta.0",
|
|
31
|
+
"@elizaos/client": "1.5.11-beta.0",
|
|
32
|
+
"@elizaos/core": "1.5.11-beta.0",
|
|
33
|
+
"@elizaos/plugin-bootstrap": "1.5.11-beta.0",
|
|
34
|
+
"@elizaos/plugin-sql": "1.5.11-beta.0",
|
|
35
|
+
"@elizaos/server": "1.5.11-beta.0",
|
|
36
36
|
"@tanstack/react-query": "^5.29.0",
|
|
37
37
|
"clsx": "^2.1.1",
|
|
38
38
|
"react": "^18.3.1",
|
|
39
39
|
"react-dom": "^18.3.1",
|
|
40
40
|
"tailwind-merge": "^2.6.0",
|
|
41
41
|
"tailwindcss": "^4.1.10",
|
|
42
|
-
"zod": "
|
|
42
|
+
"zod": "4.1.11"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/react": "^18.3.3",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"GUIDE.md"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@elizaos/cli": "1.5.11-
|
|
36
|
-
"@elizaos/core": "1.5.11-
|
|
37
|
-
"@elizaos/plugin-bootstrap": "1.5.11-
|
|
35
|
+
"@elizaos/cli": "1.5.11-beta.0",
|
|
36
|
+
"@elizaos/core": "1.5.11-beta.0",
|
|
37
|
+
"@elizaos/plugin-bootstrap": "1.5.11-beta.0",
|
|
38
38
|
"@elizaos/plugin-redpill": "1.2.1",
|
|
39
|
-
"@elizaos/plugin-sql": "1.5.11-
|
|
39
|
+
"@elizaos/plugin-sql": "1.5.11-beta.0",
|
|
40
40
|
"@phala/dstack-sdk": "0.1.11",
|
|
41
41
|
"@solana/web3.js": "1.98.2",
|
|
42
42
|
"@tanstack/react-query": "^5.29.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"tailwind-merge": "^2.6.0",
|
|
47
47
|
"tailwindcss": "^4.1.10",
|
|
48
48
|
"viem": "2.30.1",
|
|
49
|
-
"zod": "
|
|
49
|
+
"zod": "4.1.11"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/jsdom": "^21.1.7",
|
|
@@ -48,7 +48,7 @@ describe('Plugin Configuration', () => {
|
|
|
48
48
|
// Test with invalid config should fail validation during init
|
|
49
49
|
const invalidConfig = { TEE_MODE: 'INVALID_MODE' };
|
|
50
50
|
await expect(teeStarterPlugin.init(invalidConfig, mockRuntime)).rejects.toThrow(
|
|
51
|
-
'
|
|
51
|
+
'TEE_MODE must be one of: OFF, LOCAL, DOCKER, PRODUCTION'
|
|
52
52
|
);
|
|
53
53
|
} finally {
|
|
54
54
|
// Restore original environment
|
|
@@ -154,7 +154,9 @@ describe('TEE Environment Validation', () => {
|
|
|
154
154
|
try {
|
|
155
155
|
await expect(async () => {
|
|
156
156
|
await teeStarterPlugin.init?.({}, mockRuntime);
|
|
157
|
-
}).toThrow(
|
|
157
|
+
}).toThrow(
|
|
158
|
+
'Wallet secret salt must be at least 8 characters long for security (excluding whitespace)'
|
|
159
|
+
);
|
|
158
160
|
} finally {
|
|
159
161
|
// Restore original argv
|
|
160
162
|
process.argv = originalArgv;
|
|
@@ -189,7 +191,60 @@ describe('TEE Environment Validation', () => {
|
|
|
189
191
|
|
|
190
192
|
await expect(async () => {
|
|
191
193
|
await teeStarterPlugin.init?.({}, mockRuntime);
|
|
192
|
-
}).toThrow('Wallet secret salt must not exceed 128 characters');
|
|
194
|
+
}).toThrow('Wallet secret salt must not exceed 128 characters (excluding whitespace)');
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
test('should reject whitespace-only salt', async () => {
|
|
198
|
+
// Test various whitespace-only values
|
|
199
|
+
const whitespaceSalts = [' ', '\t\t\t\t', ' \t ', '\n\n\n\n\n\n\n\n'];
|
|
200
|
+
|
|
201
|
+
for (const salt of whitespaceSalts) {
|
|
202
|
+
// Remove argv test detection temporarily to test validation
|
|
203
|
+
const originalArgv = process.argv;
|
|
204
|
+
process.argv = ['node', 'script.js']; // Remove test from argv
|
|
205
|
+
|
|
206
|
+
process.env.NODE_ENV = 'production';
|
|
207
|
+
process.env.TEE_MODE = 'OFF';
|
|
208
|
+
process.env.TEE_VENDOR = 'phala';
|
|
209
|
+
process.env.WALLET_SECRET_SALT = salt;
|
|
210
|
+
|
|
211
|
+
try {
|
|
212
|
+
await expect(async () => {
|
|
213
|
+
await teeStarterPlugin.init?.({}, mockRuntime);
|
|
214
|
+
}).toThrow(
|
|
215
|
+
'Wallet secret salt must be at least 8 characters long for security (excluding whitespace)'
|
|
216
|
+
);
|
|
217
|
+
} finally {
|
|
218
|
+
// Restore original argv
|
|
219
|
+
process.argv = originalArgv;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
test('should trim salt and accept if valid after trimming', async () => {
|
|
225
|
+
// Test values with leading/trailing whitespace that are valid after trimming
|
|
226
|
+
const paddedSalts = [
|
|
227
|
+
' valid_salt_123 ',
|
|
228
|
+
'\tvalid_salt_123\t',
|
|
229
|
+
'\n\nvalid_salt_123\n\n',
|
|
230
|
+
' valid_salt_123 ',
|
|
231
|
+
];
|
|
232
|
+
|
|
233
|
+
for (const salt of paddedSalts) {
|
|
234
|
+
process.env.NODE_ENV = 'production';
|
|
235
|
+
process.env.TEE_MODE = 'OFF';
|
|
236
|
+
process.env.TEE_VENDOR = 'phala';
|
|
237
|
+
process.env.WALLET_SECRET_SALT = salt;
|
|
238
|
+
|
|
239
|
+
let error = null;
|
|
240
|
+
try {
|
|
241
|
+
await teeStarterPlugin.init?.({}, mockRuntime);
|
|
242
|
+
} catch (e) {
|
|
243
|
+
error = e;
|
|
244
|
+
}
|
|
245
|
+
// Should not throw error since trimmed value is valid
|
|
246
|
+
expect(error).toBeNull();
|
|
247
|
+
}
|
|
193
248
|
});
|
|
194
249
|
});
|
|
195
250
|
|
|
@@ -281,10 +336,11 @@ describe('TEE Environment Validation', () => {
|
|
|
281
336
|
process.env.TEE_VENDOR = ' phala '; // Whitespace around valid value
|
|
282
337
|
process.env.WALLET_SECRET_SALT = ' test_salt_123 '; // Whitespace around valid value
|
|
283
338
|
|
|
284
|
-
//
|
|
339
|
+
// TEE_MODE and TEE_VENDOR whitespace should cause validation failure
|
|
340
|
+
// But WALLET_SECRET_SALT is now trimmed and should pass if length is valid after trimming
|
|
285
341
|
await expect(async () => {
|
|
286
342
|
await teeStarterPlugin.init?.({}, mockRuntime);
|
|
287
|
-
}).toThrow();
|
|
343
|
+
}).toThrow(); // Will throw due to TEE_MODE/TEE_VENDOR whitespace
|
|
288
344
|
} finally {
|
|
289
345
|
// Restore original values
|
|
290
346
|
process.argv = originalArgv;
|
|
@@ -28,10 +28,13 @@ const configSchema = z.object({
|
|
|
28
28
|
}
|
|
29
29
|
return val;
|
|
30
30
|
})
|
|
31
|
-
.refine(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
.refine(
|
|
32
|
+
(val) => {
|
|
33
|
+
if (!val) return true; // Allow undefined in non-test environments
|
|
34
|
+
return ['OFF', 'LOCAL', 'DOCKER', 'PRODUCTION'].includes(val);
|
|
35
|
+
},
|
|
36
|
+
{ message: 'TEE_MODE must be one of: OFF, LOCAL, DOCKER, PRODUCTION' }
|
|
37
|
+
),
|
|
35
38
|
|
|
36
39
|
TEE_VENDOR: z
|
|
37
40
|
.string()
|
|
@@ -43,10 +46,13 @@ const configSchema = z.object({
|
|
|
43
46
|
}
|
|
44
47
|
return val;
|
|
45
48
|
})
|
|
46
|
-
.refine(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
.refine(
|
|
50
|
+
(val) => {
|
|
51
|
+
if (!val) return true; // Allow undefined in non-test environments
|
|
52
|
+
return val === 'phala';
|
|
53
|
+
},
|
|
54
|
+
{ message: 'TEE_VENDOR must be: phala' }
|
|
55
|
+
),
|
|
50
56
|
|
|
51
57
|
WALLET_SECRET_SALT: z
|
|
52
58
|
.string()
|
|
@@ -60,26 +66,33 @@ const configSchema = z.object({
|
|
|
60
66
|
}
|
|
61
67
|
if (!val) {
|
|
62
68
|
logger.warn('Warning: Wallet secret salt is not provided');
|
|
69
|
+
return val;
|
|
63
70
|
}
|
|
64
|
-
|
|
71
|
+
// Trim whitespace to prevent security bypass
|
|
72
|
+
return val.trim();
|
|
65
73
|
})
|
|
66
74
|
.refine(
|
|
67
75
|
(val) => {
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
if (val === undefined) return true; // Allow undefined in non-test environments
|
|
77
|
+
// Empty string after trimming is not allowed (reject whitespace-only values)
|
|
78
|
+
if (!val || val.length === 0) return false;
|
|
79
|
+
// Check trimmed length for security (val is already trimmed from transform)
|
|
80
|
+
return val.length >= 8;
|
|
71
81
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (trimmedVal.length < 8) {
|
|
76
|
-
return { message: 'Wallet secret salt must be at least 8 characters long for security' };
|
|
77
|
-
}
|
|
78
|
-
if (trimmedVal.length > 128) {
|
|
79
|
-
return { message: 'Wallet secret salt must not exceed 128 characters' };
|
|
80
|
-
}
|
|
81
|
-
return { message: 'Invalid wallet secret salt' };
|
|
82
|
+
{
|
|
83
|
+
message:
|
|
84
|
+
'Wallet secret salt must be at least 8 characters long for security (excluding whitespace)',
|
|
82
85
|
}
|
|
86
|
+
)
|
|
87
|
+
.refine(
|
|
88
|
+
(val) => {
|
|
89
|
+
if (val === undefined) return true; // Allow undefined in non-test environments
|
|
90
|
+
// Empty strings not allowed (already checked in previous refine, but be consistent)
|
|
91
|
+
if (!val || val.length === 0) return false;
|
|
92
|
+
// Check trimmed length (val is already trimmed from transform)
|
|
93
|
+
return val.length <= 128;
|
|
94
|
+
},
|
|
95
|
+
{ message: 'Wallet secret salt must not exceed 128 characters (excluding whitespace)' }
|
|
83
96
|
),
|
|
84
97
|
});
|
|
85
98
|
|
|
@@ -95,7 +108,8 @@ type TeeServiceConfig = {
|
|
|
95
108
|
*/
|
|
96
109
|
const createTeeServiceConfig = (runtime: IAgentRuntime): TeeServiceConfig => ({
|
|
97
110
|
teeClient: new TappdClient(),
|
|
98
|
-
|
|
111
|
+
// Ensure salt is trimmed to match validation behavior
|
|
112
|
+
secretSalt: (process.env.WALLET_SECRET_SALT || 'secret_salt').trim(),
|
|
99
113
|
runtime,
|
|
100
114
|
});
|
|
101
115
|
|
|
@@ -260,9 +274,36 @@ const teeStarterPlugin: Plugin = {
|
|
|
260
274
|
}
|
|
261
275
|
} catch (error) {
|
|
262
276
|
if (error instanceof z.ZodError) {
|
|
263
|
-
|
|
264
|
-
|
|
277
|
+
// Check if this is validation with an invalid TEE_MODE from the test
|
|
278
|
+
const hasInvalidMode = error.issues.some(
|
|
279
|
+
(e) => e.path[0] === 'TEE_MODE' && e.message.includes('TEE_MODE must be')
|
|
265
280
|
);
|
|
281
|
+
if (hasInvalidMode) {
|
|
282
|
+
// Throw the specific validation error for TEE_MODE
|
|
283
|
+
const teeError = error.issues.find((e) => e.path[0] === 'TEE_MODE');
|
|
284
|
+
throw new Error(
|
|
285
|
+
teeError?.message || 'TEE_MODE must be one of: OFF, LOCAL, DOCKER, PRODUCTION'
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Check if this is validation with an invalid TEE_VENDOR from the test
|
|
290
|
+
const hasInvalidVendor = error.issues.some(
|
|
291
|
+
(e) => e.path[0] === 'TEE_VENDOR' && e.message.includes('TEE_VENDOR must be')
|
|
292
|
+
);
|
|
293
|
+
if (hasInvalidVendor) {
|
|
294
|
+
const vendorError = error.issues.find((e) => e.path[0] === 'TEE_VENDOR');
|
|
295
|
+
throw new Error(vendorError?.message || 'TEE_VENDOR must be: phala');
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Check if this is validation with an invalid WALLET_SECRET_SALT from the test
|
|
299
|
+
const hasSaltError = error.issues.some((e) => e.path[0] === 'WALLET_SECRET_SALT');
|
|
300
|
+
if (hasSaltError) {
|
|
301
|
+
const saltError = error.issues.find((e) => e.path[0] === 'WALLET_SECRET_SALT');
|
|
302
|
+
throw new Error(saltError?.message || 'Invalid wallet secret salt');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Generic invalid configuration error
|
|
306
|
+
throw new Error('Invalid plugin configuration');
|
|
266
307
|
}
|
|
267
308
|
throw error;
|
|
268
309
|
}
|