@elizaos/cli 1.3.1 → 1.4.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.
Files changed (198) hide show
  1. package/README.md +47 -1
  2. package/dist/{bun-exec-6CQHTS4F.js → bun-exec-ULMPAIQC.js} +1 -1
  3. package/dist/{chunk-2ALAPQLV.js → chunk-D3QSET5H.js} +342 -360
  4. package/dist/{chunk-FDEDLANP.js → chunk-FQYWRHLX.js} +1 -1
  5. package/dist/{chunk-RM6LUTKD.js → chunk-FSSUAWXQ.js} +3 -3
  6. package/dist/chunk-GXWWPFBO.js +39 -0
  7. package/dist/{chunk-D3Q2UZLZ.js → chunk-I4L4T7QX.js} +1 -1
  8. package/dist/{chunk-KDNV7EA5.js → chunk-SMZBJQJR.js} +1 -1
  9. package/dist/commands/agent/actions/index.d.ts +5 -0
  10. package/dist/commands/agent/actions/index.js +4 -4
  11. package/dist/commands/agent/index.d.ts +2 -2
  12. package/dist/commands/agent/index.js +4 -4
  13. package/dist/commands/create/actions/index.js +5 -5
  14. package/dist/commands/create/index.js +6 -6
  15. package/dist/commands/shared/index.d.ts +11 -28
  16. package/dist/commands/shared/index.js +7 -3
  17. package/dist/index.js +599 -483
  18. package/dist/{plugin-creator-H26ZLR6H.js → plugin-creator-TCUFII32.js} +2 -2
  19. package/dist/{registry-N626N4VG.js → registry-RF6PW3EN.js} +4 -4
  20. package/dist/templates/plugin-quick-starter/README.md +52 -10
  21. package/dist/templates/plugin-quick-starter/package.json +10 -3
  22. package/dist/templates/plugin-quick-starter/src/__tests__/e2e/README.md +140 -0
  23. package/dist/templates/plugin-quick-starter/src/__tests__/e2e/plugin-quick-starter.e2e.ts +339 -0
  24. package/dist/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +537 -146
  25. package/dist/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
  26. package/dist/templates/plugin-quick-starter/src/plugin.ts +20 -26
  27. package/dist/templates/plugin-starter/README.md +124 -49
  28. package/dist/templates/plugin-starter/package.json +10 -3
  29. package/dist/templates/plugin-starter/src/__tests__/e2e/README.md +44 -9
  30. package/{templates/plugin-starter/src/__tests__/e2e/starter-plugin.ts → dist/templates/plugin-starter/src/__tests__/e2e/plugin-starter.e2e.ts} +13 -20
  31. package/dist/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
  32. package/dist/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
  33. package/dist/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
  34. package/dist/templates/plugin-starter/src/plugin.ts +21 -27
  35. package/dist/templates/project-starter/README.md +25 -12
  36. package/dist/templates/project-starter/package.json +4 -4
  37. package/dist/templates/project-starter/src/__tests__/actions.test.ts +2 -2
  38. package/dist/templates/project-starter/src/__tests__/e2e/README.md +103 -0
  39. package/dist/templates/project-starter/src/__tests__/e2e/project-starter.e2e.ts +575 -0
  40. package/dist/templates/project-starter/src/__tests__/env.test.ts +3 -1
  41. package/dist/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
  42. package/dist/templates/project-starter/src/__tests__/integration.test.ts +2 -2
  43. package/dist/templates/project-starter/src/__tests__/models.test.ts +3 -3
  44. package/dist/templates/project-starter/src/__tests__/plugin.test.ts +3 -3
  45. package/dist/templates/project-starter/src/__tests__/provider.test.ts +2 -2
  46. package/dist/templates/project-starter/src/index.ts +4 -3
  47. package/dist/templates/project-starter/src/plugin.ts +5 -5
  48. package/dist/templates/project-starter/tsup.config.ts +2 -1
  49. package/dist/templates/project-tee-starter/.dockerignore +64 -14
  50. package/dist/templates/project-tee-starter/Dockerfile +9 -5
  51. package/dist/templates/project-tee-starter/GUIDE.md +103 -42
  52. package/dist/templates/project-tee-starter/README.md +83 -24
  53. package/dist/templates/project-tee-starter/docker-compose.yaml +5 -2
  54. package/dist/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
  55. package/dist/templates/project-tee-starter/package.json +34 -14
  56. package/dist/templates/project-tee-starter/postcss.config.js +3 -0
  57. package/dist/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
  58. package/dist/templates/project-tee-starter/scripts/test-all.sh +82 -0
  59. package/dist/templates/project-tee-starter/src/__tests__/build-order.test.ts +62 -0
  60. package/dist/templates/project-tee-starter/{__tests__ → src/__tests__}/character.test.ts +20 -18
  61. package/dist/templates/project-tee-starter/{__tests__ → src/__tests__}/config.test.ts +11 -4
  62. package/dist/templates/project-tee-starter/src/__tests__/e2e/README.md +128 -0
  63. package/dist/templates/project-tee-starter/src/__tests__/e2e/project-tee-starter.e2e.ts +280 -0
  64. package/dist/templates/project-tee-starter/{__tests__ → src/__tests__}/env.test.ts +3 -2
  65. package/{templates/project-tee-starter → dist/templates/project-tee-starter/src}/__tests__/error-handling.test.ts +2 -2
  66. package/{templates/project-tee-starter → dist/templates/project-tee-starter/src}/__tests__/events.test.ts +1 -1
  67. package/{templates/project-tee-starter → dist/templates/project-tee-starter/src}/__tests__/file-structure.test.ts +16 -5
  68. package/dist/templates/project-tee-starter/src/__tests__/frontend.test.ts +459 -0
  69. package/{templates/project-tee-starter → dist/templates/project-tee-starter/src}/__tests__/integration.test.ts +2 -2
  70. package/dist/templates/project-tee-starter/{__tests__ → src/__tests__}/models.test.ts +1 -1
  71. package/dist/templates/project-tee-starter/{__tests__ → src/__tests__}/plugin.test.ts +5 -3
  72. package/{templates/project-tee-starter → dist/templates/project-tee-starter/src}/__tests__/provider.test.ts +2 -2
  73. package/dist/templates/project-tee-starter/src/__tests__/routes.test.ts +30 -0
  74. package/dist/templates/project-tee-starter/src/__tests__/tee-validation.test.ts +295 -0
  75. package/{templates/project-tee-starter → dist/templates/project-tee-starter/src}/__tests__/test-utils.ts +2 -2
  76. package/dist/templates/project-tee-starter/src/__tests__/vite-config-utils.ts +51 -0
  77. package/dist/templates/project-tee-starter/src/frontend/index.css +106 -0
  78. package/dist/templates/project-tee-starter/src/frontend/index.html +20 -0
  79. package/dist/templates/project-tee-starter/src/frontend/index.tsx +370 -0
  80. package/dist/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
  81. package/dist/templates/project-tee-starter/src/frontend/utils.ts +6 -0
  82. package/dist/templates/project-tee-starter/src/index.ts +8 -6
  83. package/dist/templates/project-tee-starter/src/plugin.ts +223 -61
  84. package/dist/templates/project-tee-starter/tailwind.config.js +62 -0
  85. package/dist/templates/project-tee-starter/tsconfig.build.json +2 -2
  86. package/dist/templates/project-tee-starter/tsconfig.json +8 -5
  87. package/dist/templates/project-tee-starter/tsup.config.ts +3 -2
  88. package/dist/templates/project-tee-starter/vite.config.ts +39 -0
  89. package/dist/url-utils-CKc_Ebt_.d.ts +35 -0
  90. package/dist/{utils-H66532NB.js → utils-5HPZSIF6.js} +4 -4
  91. package/package.json +7 -6
  92. package/templates/plugin-quick-starter/README.md +52 -10
  93. package/templates/plugin-quick-starter/package.json +10 -3
  94. package/templates/plugin-quick-starter/src/__tests__/e2e/README.md +140 -0
  95. package/templates/plugin-quick-starter/src/__tests__/e2e/plugin-quick-starter.e2e.ts +339 -0
  96. package/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +537 -146
  97. package/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
  98. package/templates/plugin-quick-starter/src/plugin.ts +20 -26
  99. package/templates/plugin-starter/README.md +124 -49
  100. package/templates/plugin-starter/package.json +10 -3
  101. package/templates/plugin-starter/src/__tests__/e2e/README.md +44 -9
  102. package/{dist/templates/plugin-starter/src/__tests__/e2e/starter-plugin.ts → templates/plugin-starter/src/__tests__/e2e/plugin-starter.e2e.ts} +13 -20
  103. package/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
  104. package/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
  105. package/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
  106. package/templates/plugin-starter/src/plugin.ts +21 -27
  107. package/templates/project-starter/README.md +25 -12
  108. package/templates/project-starter/package.json +4 -4
  109. package/templates/project-starter/src/__tests__/actions.test.ts +2 -2
  110. package/templates/project-starter/src/__tests__/e2e/README.md +103 -0
  111. package/templates/project-starter/src/__tests__/e2e/project-starter.e2e.ts +575 -0
  112. package/templates/project-starter/src/__tests__/env.test.ts +3 -1
  113. package/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
  114. package/templates/project-starter/src/__tests__/integration.test.ts +2 -2
  115. package/templates/project-starter/src/__tests__/models.test.ts +3 -3
  116. package/templates/project-starter/src/__tests__/plugin.test.ts +3 -3
  117. package/templates/project-starter/src/__tests__/provider.test.ts +2 -2
  118. package/templates/project-starter/src/index.ts +4 -3
  119. package/templates/project-starter/src/plugin.ts +5 -5
  120. package/templates/project-starter/tsup.config.ts +2 -1
  121. package/templates/project-tee-starter/.dockerignore +64 -14
  122. package/templates/project-tee-starter/Dockerfile +9 -5
  123. package/templates/project-tee-starter/GUIDE.md +103 -42
  124. package/templates/project-tee-starter/README.md +83 -24
  125. package/templates/project-tee-starter/docker-compose.yaml +5 -2
  126. package/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
  127. package/templates/project-tee-starter/package.json +34 -14
  128. package/templates/project-tee-starter/postcss.config.js +3 -0
  129. package/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
  130. package/templates/project-tee-starter/scripts/test-all.sh +82 -0
  131. package/templates/project-tee-starter/src/__tests__/build-order.test.ts +62 -0
  132. package/templates/project-tee-starter/{__tests__ → src/__tests__}/character.test.ts +20 -18
  133. package/templates/project-tee-starter/{__tests__ → src/__tests__}/config.test.ts +11 -4
  134. package/templates/project-tee-starter/src/__tests__/e2e/README.md +128 -0
  135. package/templates/project-tee-starter/src/__tests__/e2e/project-tee-starter.e2e.ts +280 -0
  136. package/templates/project-tee-starter/{__tests__ → src/__tests__}/env.test.ts +3 -2
  137. package/{dist/templates/project-tee-starter → templates/project-tee-starter/src}/__tests__/error-handling.test.ts +2 -2
  138. package/{dist/templates/project-tee-starter → templates/project-tee-starter/src}/__tests__/events.test.ts +1 -1
  139. package/{dist/templates/project-tee-starter → templates/project-tee-starter/src}/__tests__/file-structure.test.ts +16 -5
  140. package/templates/project-tee-starter/src/__tests__/frontend.test.ts +459 -0
  141. package/{dist/templates/project-tee-starter → templates/project-tee-starter/src}/__tests__/integration.test.ts +2 -2
  142. package/templates/project-tee-starter/{__tests__ → src/__tests__}/models.test.ts +1 -1
  143. package/templates/project-tee-starter/{__tests__ → src/__tests__}/plugin.test.ts +5 -3
  144. package/{dist/templates/project-tee-starter → templates/project-tee-starter/src}/__tests__/provider.test.ts +2 -2
  145. package/templates/project-tee-starter/src/__tests__/routes.test.ts +30 -0
  146. package/templates/project-tee-starter/src/__tests__/tee-validation.test.ts +295 -0
  147. package/{dist/templates/project-tee-starter → templates/project-tee-starter/src}/__tests__/test-utils.ts +2 -2
  148. package/templates/project-tee-starter/src/__tests__/vite-config-utils.ts +51 -0
  149. package/templates/project-tee-starter/src/frontend/index.css +106 -0
  150. package/templates/project-tee-starter/src/frontend/index.html +20 -0
  151. package/templates/project-tee-starter/src/frontend/index.tsx +370 -0
  152. package/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
  153. package/templates/project-tee-starter/src/frontend/utils.ts +6 -0
  154. package/templates/project-tee-starter/src/index.ts +8 -6
  155. package/templates/project-tee-starter/src/plugin.ts +223 -61
  156. package/templates/project-tee-starter/tailwind.config.js +62 -0
  157. package/templates/project-tee-starter/tsconfig.build.json +2 -2
  158. package/templates/project-tee-starter/tsconfig.json +8 -5
  159. package/templates/project-tee-starter/tsup.config.ts +3 -2
  160. package/templates/project-tee-starter/vite.config.ts +39 -0
  161. package/dist/chunk-4O6EZU37.js +0 -14
  162. package/dist/migration-guides/advanced-migration-guide.md +0 -459
  163. package/dist/migration-guides/completion-requirements.md +0 -379
  164. package/dist/migration-guides/integrated-migration-loop.md +0 -392
  165. package/dist/migration-guides/migration-guide.md +0 -712
  166. package/dist/migration-guides/prompt-and-generation-guide.md +0 -702
  167. package/dist/migration-guides/state-and-providers-guide.md +0 -544
  168. package/dist/migration-guides/testing-guide.md +0 -1021
  169. package/dist/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
  170. package/dist/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
  171. package/dist/templates/plugin-starter/dist/index.js +0 -387
  172. package/dist/templates/plugin-starter/dist/index.js.map +0 -1
  173. package/dist/templates/plugin-starter/src/tests.ts +0 -6
  174. package/dist/templates/project-starter/src/__tests__/e2e/index.ts +0 -14
  175. package/dist/templates/project-starter/src/__tests__/e2e/natural-language.test.ts +0 -246
  176. package/dist/templates/project-starter/src/__tests__/e2e/project.test.ts +0 -155
  177. package/dist/templates/project-starter/src/__tests__/e2e/starter-plugin.test.ts +0 -421
  178. package/dist/templates/project-tee-starter/__tests__/routes.test.ts +0 -21
  179. package/dist/templates/project-tee-starter/e2e/project.test.ts +0 -38
  180. package/dist/templates/project-tee-starter/e2e/starter-plugin.test.ts +0 -92
  181. package/templates/plugin-starter/dist/.vite/manifest.json +0 -11
  182. package/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
  183. package/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
  184. package/templates/plugin-starter/dist/index.d.ts +0 -14
  185. package/templates/plugin-starter/dist/index.js +0 -387
  186. package/templates/plugin-starter/dist/index.js.map +0 -1
  187. package/templates/plugin-starter/src/tests.ts +0 -6
  188. package/templates/project-starter/src/__tests__/e2e/index.ts +0 -14
  189. package/templates/project-starter/src/__tests__/e2e/natural-language.test.ts +0 -246
  190. package/templates/project-starter/src/__tests__/e2e/project.test.ts +0 -155
  191. package/templates/project-starter/src/__tests__/e2e/starter-plugin.test.ts +0 -421
  192. package/templates/project-tee-starter/__tests__/routes.test.ts +0 -21
  193. package/templates/project-tee-starter/e2e/project.test.ts +0 -38
  194. package/templates/project-tee-starter/e2e/starter-plugin.test.ts +0 -92
  195. /package/dist/templates/project-tee-starter/{__tests__ → src/__tests__}/actions.test.ts +0 -0
  196. /package/dist/templates/project-tee-starter/{__tests__ → src/__tests__}/utils/core-test-utils.ts +0 -0
  197. /package/templates/project-tee-starter/{__tests__ → src/__tests__}/actions.test.ts +0 -0
  198. /package/templates/project-tee-starter/{__tests__ → src/__tests__}/utils/core-test-utils.ts +0 -0
@@ -0,0 +1,280 @@
1
+ import {
2
+ type Content,
3
+ type HandlerCallback,
4
+ type IAgentRuntime,
5
+ type Memory,
6
+ type UUID,
7
+ ChannelType,
8
+ logger,
9
+ } from '@elizaos/core';
10
+ import { v4 as uuidv4 } from 'uuid';
11
+
12
+ /**
13
+ * E2E Test Suite for Project TEE Starter
14
+ * ======================================
15
+ *
16
+ * This test suite validates TEE (Trusted Execution Environment) specific functionality
17
+ * while gracefully handling non-TEE environments where tests are expected to fail.
18
+ *
19
+ * TEST CATEGORIES:
20
+ * ---------------
21
+ * 1. ALWAYS PASS: Basic project setup tests that work in any environment
22
+ * 2. TEE-OPTIONAL: Tests that check for TEE features but pass with warnings if unavailable
23
+ * 3. TEE-REQUIRED: Tests that only pass in actual TEE environments (skip otherwise)
24
+ *
25
+ * ENVIRONMENT DETECTION:
26
+ * ---------------------
27
+ * Tests detect TEE availability by checking:
28
+ * - TEE service registration
29
+ * - TEE-specific environment variables
30
+ * - Embedding model availability
31
+ * - Database schema completeness
32
+ */
33
+
34
+ interface TestCase {
35
+ name: string;
36
+ category?: 'always-pass' | 'tee-optional' | 'tee-required';
37
+ fn: (runtime: IAgentRuntime) => Promise<void>;
38
+ }
39
+
40
+ export class ProjectTeeStarterTestSuite {
41
+ name = 'Project TEE Starter E2E Tests';
42
+ description = 'E2E tests for TEE-specific project features with graceful fallbacks';
43
+
44
+ // Helper to detect TEE environment
45
+ private async detectTeeEnvironment(runtime: IAgentRuntime): Promise<{
46
+ hasService: boolean;
47
+ hasEndpoint: boolean;
48
+ hasEmbeddings: boolean;
49
+ isFullTee: boolean;
50
+ }> {
51
+ const teeService = runtime.getService('tee') || runtime.getService('mr-tee-service');
52
+ const hasEndpoint = !!runtime.getSetting('TEE_ATTESTATION_ENDPOINT');
53
+
54
+ // Check for embedding capability
55
+ let hasEmbeddings = false;
56
+ try {
57
+ // Check if embedding model is available via service
58
+ const embeddingService = runtime.getService('embedding');
59
+ hasEmbeddings = !!embeddingService;
60
+ } catch {
61
+ hasEmbeddings = false;
62
+ }
63
+
64
+ return {
65
+ hasService: !!teeService,
66
+ hasEndpoint,
67
+ hasEmbeddings,
68
+ isFullTee: !!teeService && hasEndpoint && hasEmbeddings,
69
+ };
70
+ }
71
+
72
+ tests: TestCase[] = [
73
+ // ALWAYS PASS: Basic project validation
74
+ {
75
+ name: 'tee_project_should_initialize_correctly',
76
+ category: 'always-pass',
77
+ fn: async (runtime: IAgentRuntime) => {
78
+ if (!runtime.agentId) {
79
+ throw new Error('Agent ID is not set');
80
+ }
81
+
82
+ logger.info(`✓ TEE Project initialized with agent ID: ${runtime.agentId}`);
83
+ },
84
+ },
85
+
86
+ {
87
+ name: 'tee_character_should_be_loaded_correctly',
88
+ category: 'always-pass',
89
+ fn: async (runtime: IAgentRuntime) => {
90
+ if (!runtime.character.name) {
91
+ throw new Error('Character name is not set');
92
+ }
93
+
94
+ if (!runtime.character.bio || runtime.character.bio.length === 0) {
95
+ throw new Error('Character bio is not set');
96
+ }
97
+
98
+ logger.info(`✓ TEE Character "${runtime.character.name}" loaded successfully`);
99
+ },
100
+ },
101
+
102
+ // TEE-OPTIONAL: Features that may or may not be available
103
+ {
104
+ name: 'tee_service_availability_check',
105
+ category: 'tee-optional',
106
+ fn: async (runtime: IAgentRuntime) => {
107
+ const env = await this.detectTeeEnvironment(runtime);
108
+
109
+ if (env.hasService) {
110
+ logger.info('✓ TEE service is available and registered');
111
+ } else {
112
+ logger.info('⚠ TEE service not available (expected in non-TEE environments)');
113
+ }
114
+
115
+ // This test always passes - it's just informational
116
+ },
117
+ },
118
+
119
+ {
120
+ name: 'tee_configuration_check',
121
+ category: 'tee-optional',
122
+ fn: async (runtime: IAgentRuntime) => {
123
+ const env = await this.detectTeeEnvironment(runtime);
124
+ const plugins = runtime.character.plugins || [];
125
+ const teePlugins = plugins.filter(
126
+ (p) => p.toLowerCase().includes('tee') || p.toLowerCase().includes('attestation')
127
+ );
128
+
129
+ logger.info(`✓ Found ${teePlugins.length} TEE-related plugins: ${teePlugins.join(', ')}`);
130
+ logger.info(`✓ TEE mode configured: ${env.isFullTee ? 'FULL' : 'OFF'}`);
131
+
132
+ if (!env.hasEndpoint) {
133
+ logger.info('⚠ TEE_ATTESTATION_ENDPOINT not configured (expected in development)');
134
+ }
135
+ },
136
+ },
137
+
138
+ {
139
+ name: 'tee_plugin_integration_check',
140
+ category: 'tee-optional',
141
+ fn: async (runtime: IAgentRuntime) => {
142
+ const plugins = runtime.character.plugins || [];
143
+ const hasTeePlugin = plugins.some(
144
+ (p) => p.toLowerCase().includes('tee') || p === 'mr-tee-starter-plugin'
145
+ );
146
+
147
+ if (hasTeePlugin) {
148
+ logger.info('✓ TEE plugin is loaded in character configuration');
149
+ } else {
150
+ logger.info('⚠ No TEE plugin in character configuration');
151
+ }
152
+ },
153
+ },
154
+
155
+ // TEE-REQUIRED: Tests that only work in full TEE environments
156
+ {
157
+ name: 'secure_attestation_flow',
158
+ category: 'tee-required',
159
+ fn: async (runtime: IAgentRuntime) => {
160
+ const env = await this.detectTeeEnvironment(runtime);
161
+
162
+ if (!env.isFullTee) {
163
+ logger.info('⚠ Skipping attestation test (requires full TEE environment)');
164
+ return;
165
+ }
166
+
167
+ // Test attestation action availability
168
+ const attestationAction = runtime.actions.find((a) =>
169
+ a.name.toLowerCase().includes('attest')
170
+ );
171
+
172
+ if (!attestationAction) {
173
+ throw new Error('Attestation action not found in TEE environment');
174
+ }
175
+
176
+ logger.info('✓ Attestation flow validated');
177
+ },
178
+ },
179
+
180
+ {
181
+ name: 'secure_memory_operations_with_embeddings',
182
+ category: 'tee-required',
183
+ fn: async (runtime: IAgentRuntime) => {
184
+ const env = await this.detectTeeEnvironment(runtime);
185
+
186
+ if (!env.hasEmbeddings) {
187
+ logger.info('⚠ Skipping embedding test (requires embedding model)');
188
+ return;
189
+ }
190
+
191
+ try {
192
+ const testContent = 'Secure TEE test message';
193
+
194
+ // Create a test memory with content
195
+ const testMemory: Memory = {
196
+ id: uuidv4() as UUID,
197
+ entityId: uuidv4() as UUID,
198
+ agentId: runtime.agentId,
199
+ roomId: uuidv4() as UUID,
200
+ content: {
201
+ text: testContent,
202
+ action: null,
203
+ } as Content,
204
+ createdAt: Date.now(),
205
+ embedding: [], // Would be populated by embedding service
206
+ };
207
+
208
+ await runtime.createMemory(testMemory, 'messages', false);
209
+ logger.info('✓ Secure memory operations with embeddings working');
210
+ } catch (error) {
211
+ logger.info(`⚠ Embedding test failed: ${error.message}`);
212
+ }
213
+ },
214
+ },
215
+
216
+ {
217
+ name: 'tee_agent_message_processing',
218
+ category: 'tee-required',
219
+ fn: async (runtime: IAgentRuntime) => {
220
+ const env = await this.detectTeeEnvironment(runtime);
221
+
222
+ if (!env.isFullTee) {
223
+ logger.info('⚠ Skipping message processing test (requires full TEE environment)');
224
+ return;
225
+ }
226
+
227
+ try {
228
+ const testMessage: Memory = {
229
+ id: uuidv4() as UUID,
230
+ entityId: uuidv4() as UUID,
231
+ agentId: runtime.agentId,
232
+ roomId: uuidv4() as UUID,
233
+ content: {
234
+ text: 'Test TEE secure message processing',
235
+ action: null,
236
+ } as Content,
237
+ createdAt: Date.now(),
238
+ embedding: [],
239
+ };
240
+
241
+ await runtime.createMemory(testMessage, 'messages', false);
242
+ logger.info('✓ TEE message processing completed');
243
+ } catch (error) {
244
+ logger.info(`⚠ Message processing test failed: ${error.message}`);
245
+ }
246
+ },
247
+ },
248
+
249
+ // Database connectivity test (handles schema differences)
250
+ {
251
+ name: 'database_connectivity_and_schema',
252
+ category: 'tee-optional',
253
+ fn: async (runtime: IAgentRuntime) => {
254
+ try {
255
+ // Try a simple query that should work regardless of schema
256
+ const testRoomId = uuidv4() as UUID;
257
+ const memories = await runtime.getMemories({
258
+ roomId: testRoomId,
259
+ count: 1,
260
+ tableName: 'messages',
261
+ });
262
+
263
+ logger.info('✓ Database connection is working');
264
+ } catch (error) {
265
+ // Check if it's a schema issue
266
+ if (error.message?.includes('embeddings.dim_384')) {
267
+ logger.info(
268
+ '⚠ Database schema missing embedding columns (expected without embedding model)'
269
+ );
270
+ } else {
271
+ logger.info(`⚠ Database test failed: ${error.message}`);
272
+ }
273
+ }
274
+ },
275
+ },
276
+ ];
277
+ }
278
+
279
+ // Export the test suite for the test runner
280
+ export default new ProjectTeeStarterTestSuite();
@@ -4,7 +4,7 @@ import { describe, expect, it } from 'bun:test';
4
4
  import { fileURLToPath } from 'node:url';
5
5
 
6
6
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
- const projectRoot = path.resolve(__dirname, '..');
7
+ const projectRoot = path.resolve(__dirname, '..', '..');
8
8
 
9
9
  describe('Environment Setup', () => {
10
10
  it('should verify configuration files exist', () => {
@@ -39,7 +39,8 @@ describe('Environment Setup', () => {
39
39
  expect(fs.existsSync(packageJsonPath)).toBe(true);
40
40
 
41
41
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
42
- expect(packageJson).toHaveProperty('name', '@elizaos/project-tee-starter');
42
+ expect(packageJson).toHaveProperty('name');
43
+ expect(typeof packageJson.name).toBe('string');
43
44
  expect(packageJson).toHaveProperty('version');
44
45
  expect(packageJson).toHaveProperty('type', 'module');
45
46
  expect(packageJson).toHaveProperty('main');
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect } from 'bun:test';
2
- import teeStarterPlugin from '../src/plugin';
3
- import { mrTeeCharacter } from '../src/character';
2
+ import teeStarterPlugin from '../plugin';
3
+ import { mrTeeCharacter } from '../character';
4
4
 
5
5
  describe('Error Handling', () => {
6
6
  describe('Plugin Error Handling', () => {
@@ -1,5 +1,5 @@
1
1
  import { describe, it, expect } from 'bun:test';
2
- import teeStarterPlugin from '../src/plugin';
2
+ import teeStarterPlugin from '../plugin';
3
3
 
4
4
  describe('Plugin Events', () => {
5
5
  it('should not have custom events (relies on plugin-tee for TEE events)', () => {
@@ -1,6 +1,7 @@
1
- import { describe, expect, it } from 'bun:test';
1
+ import { describe, expect, it, beforeAll } from 'bun:test';
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
+ import { $ } from 'bun';
4
5
  import { logger } from '@elizaos/core';
5
6
 
6
7
  // Helper function to check if a file exists
@@ -14,12 +15,21 @@ function directoryExists(dirPath: string): boolean {
14
15
  }
15
16
 
16
17
  describe('Project Structure Validation', () => {
17
- const rootDir = path.resolve(__dirname, '..');
18
+ const rootDir = path.resolve(__dirname, '..', '..');
19
+ const distDir = path.join(rootDir, 'dist');
20
+
21
+ beforeAll(async () => {
22
+ // Build the project if dist doesn't exist
23
+ if (!fs.existsSync(distDir)) {
24
+ console.log('Building project for tests...');
25
+ await $`cd ${rootDir} && bun run build`;
26
+ }
27
+ });
18
28
 
19
29
  describe('Directory Structure', () => {
20
30
  it('should have the expected directory structure', () => {
21
31
  expect(directoryExists(path.join(rootDir, 'src'))).toBe(true);
22
- expect(directoryExists(path.join(rootDir, '__tests__'))).toBe(true);
32
+ expect(directoryExists(path.join(rootDir, 'src', '__tests__'))).toBe(true);
23
33
  });
24
34
 
25
35
  it('should have a dist directory after building', () => {
@@ -59,8 +69,9 @@ describe('Project Structure Validation', () => {
59
69
  it('should have the correct package.json configuration', () => {
60
70
  const packageJson = JSON.parse(fs.readFileSync(path.join(rootDir, 'package.json'), 'utf8'));
61
71
 
62
- // Check package name
63
- expect(packageJson.name).toBe('@elizaos/project-tee-starter');
72
+ // Check package name - should be valid (not checking exact name since it's dynamic in created projects)
73
+ expect(packageJson.name).toBeTruthy();
74
+ expect(typeof packageJson.name).toBe('string');
64
75
 
65
76
  // Check scripts
66
77
  expect(packageJson.scripts).toHaveProperty('build');