@elizaos/cli 1.0.9 → 1.0.10

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 (240) hide show
  1. package/README.md +9 -16
  2. package/dist/assets/{index-CCyz05Yl.js → index-CmuPnu0u.js} +72 -89
  3. package/dist/assets/index-CmuPnu0u.js.br +0 -0
  4. package/dist/assets/index-CmuPnu0u.js.map +1 -0
  5. package/dist/assets/{index-Cxd2b7is.js → index-DDQnwxzL.js} +1318 -13721
  6. package/dist/assets/{index-Cxd2b7is.js.map → index-DDQnwxzL.js.map} +1 -1
  7. package/dist/assets/index-Df1AFSuJ.css +1 -0
  8. package/dist/assets/index-Df1AFSuJ.css.br +0 -0
  9. package/dist/assets/vendor-DSdxb8P-.js.map +1 -1
  10. package/dist/{chunk-Y755OOSP.js → chunk-7HYEGM5V.js} +877 -1550
  11. package/dist/{chunk-HZQCHL3J.js → chunk-B4KJXECB.js} +13 -18
  12. package/dist/{chunk-Z6GVELRX.js → chunk-GWQB7PBK.js} +58 -29
  13. package/dist/{chunk-CVADLFW6.js → chunk-LQ6XHF53.js} +4543 -3043
  14. package/dist/{chunk-JWONHNLD.js → chunk-RIAWNDYI.js} +2 -9
  15. package/dist/{chunk-IEKLJDUU.js → chunk-WS4DWCDZ.js} +54 -32
  16. package/dist/commands/agent/actions/index.d.ts +5 -1
  17. package/dist/commands/agent/actions/index.js +5 -3
  18. package/dist/commands/agent/index.js +3 -3
  19. package/dist/commands/create/actions/index.js +4 -4
  20. package/dist/commands/create/index.js +5 -5
  21. package/dist/{fileFromPath-DCRQMDLJ.js → fileFromPath-KB6XMTJ4.js} +1 -0
  22. package/dist/index.html +2 -2
  23. package/dist/index.js +9351 -102236
  24. package/dist/{migrator-KZLCVEIH.js → migrator-JREQPDN3.js} +42 -220
  25. package/dist/pglite.data +0 -0
  26. package/dist/pglite.wasm +0 -0
  27. package/dist/plugin-creator-T4K2673C.js +910 -0
  28. package/dist/{registry-W7CIK4O2.js → registry-CBMRMYCG.js} +3 -3
  29. package/dist/templates/plugin-starter/README.md +255 -0
  30. package/dist/templates/plugin-starter/bunfig.toml +6 -0
  31. package/dist/templates/plugin-starter/cypress.config.ts +18 -0
  32. package/dist/templates/plugin-starter/index.html +13 -0
  33. package/dist/templates/plugin-starter/package.json +95 -0
  34. package/dist/templates/plugin-starter/postcss.config.js +3 -0
  35. package/dist/templates/plugin-starter/scripts/test-e2e-manual.js +201 -0
  36. package/dist/templates/plugin-starter/src/__tests__/cypress/component/ExampleRoute.cy.tsx +404 -0
  37. package/dist/templates/plugin-starter/src/__tests__/cypress/component/PanelComponent.cy.tsx +287 -0
  38. package/dist/templates/plugin-starter/src/__tests__/cypress/support/commands.ts +38 -0
  39. package/dist/templates/plugin-starter/src/__tests__/cypress/support/component-index.html +11 -0
  40. package/dist/templates/plugin-starter/src/__tests__/cypress/support/component.ts +33 -0
  41. package/dist/templates/plugin-starter/src/__tests__/cypress/support/e2e.ts +11 -0
  42. package/dist/templates/plugin-starter/src/__tests__/cypress/tsconfig.json +10 -0
  43. package/dist/templates/plugin-starter/src/__tests__/e2e/README.md +47 -0
  44. package/dist/templates/plugin-starter/src/__tests__/e2e/starter-plugin.ts +320 -0
  45. package/{templates/plugin-starter → dist/templates/plugin-starter/src}/__tests__/integration.test.ts +22 -17
  46. package/{templates/plugin-starter → dist/templates/plugin-starter/src}/__tests__/plugin.test.ts +8 -8
  47. package/{templates/plugin-starter → dist/templates/plugin-starter/src}/__tests__/test-utils.ts +17 -17
  48. package/dist/templates/plugin-starter/src/frontend/index.css +77 -0
  49. package/dist/templates/plugin-starter/src/frontend/index.tsx +164 -0
  50. package/dist/templates/plugin-starter/src/frontend/utils.ts +6 -0
  51. package/dist/templates/plugin-starter/src/index.ts +274 -0
  52. package/dist/templates/plugin-starter/src/tests.ts +6 -0
  53. package/dist/templates/plugin-starter/tailwind.config.js +62 -0
  54. package/dist/templates/plugin-starter/tsconfig.build.json +11 -0
  55. package/dist/templates/plugin-starter/tsconfig.json +28 -0
  56. package/dist/templates/plugin-starter/tsup.config.ts +20 -0
  57. package/dist/templates/plugin-starter/vite.config.ts +20 -0
  58. package/dist/templates/project-starter/.env.example +153 -0
  59. package/dist/templates/project-starter/README.md +109 -0
  60. package/dist/templates/project-starter/bunfig.toml +6 -0
  61. package/dist/templates/project-starter/cypress.config.ts +31 -0
  62. package/dist/templates/project-starter/index.html +13 -0
  63. package/dist/templates/project-starter/package.json +83 -0
  64. package/dist/templates/project-starter/postcss.config.js +3 -0
  65. package/dist/templates/project-starter/scripts/test-all.sh +101 -0
  66. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/actions.test.ts +6 -6
  67. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/character.test.ts +3 -3
  68. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/config.test.ts +18 -18
  69. package/dist/templates/project-starter/src/__tests__/cypress/component/Accessibility.cy.tsx +271 -0
  70. package/dist/templates/project-starter/src/__tests__/cypress/component/ApiIntegration.cy.tsx +220 -0
  71. package/dist/templates/project-starter/src/__tests__/cypress/component/ExampleRoute.cy.tsx +146 -0
  72. package/dist/templates/project-starter/src/__tests__/cypress/component/PanelComponent.cy.tsx +51 -0
  73. package/dist/templates/project-starter/src/__tests__/cypress/e2e/agent-chat.cy.ts +235 -0
  74. package/dist/templates/project-starter/src/__tests__/cypress/e2e/dashboard.cy.ts +146 -0
  75. package/dist/templates/project-starter/src/__tests__/cypress/e2e/user-workflow.cy.ts +257 -0
  76. package/dist/templates/project-starter/src/__tests__/cypress/support/commands.ts +44 -0
  77. package/dist/templates/project-starter/src/__tests__/cypress/support/component-index.html +11 -0
  78. package/dist/templates/project-starter/src/__tests__/cypress/support/component.ts +33 -0
  79. package/dist/templates/project-starter/src/__tests__/cypress/support/e2e.ts +179 -0
  80. package/dist/templates/project-starter/src/__tests__/e2e/index.ts +14 -0
  81. package/dist/templates/project-starter/src/__tests__/e2e/natural-language.test.ts +246 -0
  82. package/dist/templates/project-starter/src/__tests__/e2e/project.test.ts +155 -0
  83. package/dist/templates/project-starter/src/__tests__/e2e/starter-plugin.test.ts +421 -0
  84. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/env.test.ts +2 -2
  85. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/error-handling.test.ts +17 -17
  86. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/events.test.ts +7 -7
  87. package/dist/templates/project-starter/src/__tests__/file-structure.test.ts +135 -0
  88. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/integration.test.ts +25 -25
  89. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/models.test.ts +6 -6
  90. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/plugin.test.ts +9 -9
  91. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/provider.test.ts +7 -7
  92. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/routes.test.ts +3 -3
  93. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/test-utils.ts +17 -17
  94. package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/utils/core-test-utils.ts +3 -3
  95. package/dist/templates/project-starter/src/frontend/index.css +77 -0
  96. package/dist/templates/project-starter/src/frontend/index.html +19 -0
  97. package/dist/templates/project-starter/src/frontend/index.tsx +98 -0
  98. package/dist/templates/project-starter/src/frontend/utils.ts +6 -0
  99. package/dist/templates/project-starter/src/index.ts +153 -0
  100. package/dist/templates/project-starter/src/plugin.ts +255 -0
  101. package/dist/templates/project-starter/tailwind.config.js +62 -0
  102. package/dist/templates/project-starter/tsconfig.build.json +20 -0
  103. package/dist/templates/project-starter/tsconfig.json +39 -0
  104. package/dist/templates/project-starter/tsup.config.ts +19 -0
  105. package/dist/templates/project-starter/vite.config.ts +39 -0
  106. package/dist/templates/project-tee-starter/.dockerignore +20 -0
  107. package/dist/templates/project-tee-starter/.env.example +55 -0
  108. package/dist/templates/project-tee-starter/Dockerfile +66 -0
  109. package/dist/templates/project-tee-starter/GUIDE.md +235 -0
  110. package/dist/templates/project-tee-starter/README.md +173 -0
  111. package/dist/templates/project-tee-starter/__tests__/actions.test.ts +9 -0
  112. package/dist/templates/project-tee-starter/__tests__/character.test.ts +86 -0
  113. package/dist/templates/project-tee-starter/__tests__/config.test.ts +31 -0
  114. package/dist/templates/project-tee-starter/__tests__/env.test.ts +87 -0
  115. package/dist/templates/project-tee-starter/__tests__/error-handling.test.ts +30 -0
  116. package/dist/templates/project-tee-starter/__tests__/events.test.ts +21 -0
  117. package/{templates/project-starter → dist/templates/project-tee-starter}/__tests__/file-structure.test.ts +6 -6
  118. package/dist/templates/project-tee-starter/__tests__/integration.test.ts +205 -0
  119. package/dist/templates/project-tee-starter/__tests__/models.test.ts +22 -0
  120. package/dist/templates/project-tee-starter/__tests__/plugin.test.ts +38 -0
  121. package/dist/templates/project-tee-starter/__tests__/provider.test.ts +189 -0
  122. package/dist/templates/project-tee-starter/__tests__/routes.test.ts +21 -0
  123. package/dist/templates/project-tee-starter/__tests__/test-utils.ts +121 -0
  124. package/dist/templates/project-tee-starter/__tests__/utils/core-test-utils.ts +167 -0
  125. package/dist/templates/project-tee-starter/assets/mr-tee-portrait.jpg +0 -0
  126. package/dist/templates/project-tee-starter/bunfig.toml +6 -0
  127. package/dist/templates/project-tee-starter/docker-compose.yaml +57 -0
  128. package/dist/templates/project-tee-starter/e2e/project.test.ts +38 -0
  129. package/dist/templates/project-tee-starter/e2e/starter-plugin.test.ts +92 -0
  130. package/dist/templates/project-tee-starter/package.json +74 -0
  131. package/dist/templates/project-tee-starter/src/character.ts +257 -0
  132. package/dist/templates/project-tee-starter/src/index.ts +33 -0
  133. package/dist/templates/project-tee-starter/src/plugin.ts +169 -0
  134. package/dist/templates/project-tee-starter/tsconfig.build.json +13 -0
  135. package/dist/templates/project-tee-starter/tsconfig.json +30 -0
  136. package/dist/templates/project-tee-starter/tsup.config.ts +19 -0
  137. package/dist/{utils-2G2QVMW3.js → utils-TIALZU53.js} +9 -7
  138. package/package.json +28 -9
  139. package/templates/plugin-starter/README.md +38 -13
  140. package/templates/plugin-starter/bunfig.toml +6 -0
  141. package/templates/plugin-starter/cypress.config.ts +18 -0
  142. package/templates/plugin-starter/index.html +13 -0
  143. package/templates/plugin-starter/package.json +19 -7
  144. package/templates/plugin-starter/postcss.config.js +3 -0
  145. package/templates/plugin-starter/scripts/test-e2e-manual.js +201 -0
  146. package/templates/plugin-starter/src/__tests__/cypress/component/ExampleRoute.cy.tsx +404 -0
  147. package/templates/plugin-starter/src/__tests__/cypress/component/PanelComponent.cy.tsx +287 -0
  148. package/templates/plugin-starter/src/__tests__/cypress/support/commands.ts +38 -0
  149. package/templates/plugin-starter/src/__tests__/cypress/support/component-index.html +11 -0
  150. package/templates/plugin-starter/src/__tests__/cypress/support/component.ts +33 -0
  151. package/templates/plugin-starter/src/__tests__/cypress/support/e2e.ts +11 -0
  152. package/templates/plugin-starter/src/__tests__/cypress/tsconfig.json +10 -0
  153. package/templates/plugin-starter/src/__tests__/e2e/README.md +47 -0
  154. package/templates/plugin-starter/src/__tests__/e2e/starter-plugin.ts +320 -0
  155. package/templates/plugin-starter/src/__tests__/integration.test.ts +138 -0
  156. package/templates/plugin-starter/src/__tests__/plugin.test.ts +182 -0
  157. package/templates/plugin-starter/src/__tests__/test-utils.ts +162 -0
  158. package/templates/plugin-starter/src/frontend/index.css +77 -0
  159. package/templates/plugin-starter/src/frontend/index.tsx +164 -0
  160. package/templates/plugin-starter/src/frontend/utils.ts +6 -0
  161. package/templates/plugin-starter/src/index.ts +30 -7
  162. package/templates/plugin-starter/src/tests.ts +6 -0
  163. package/templates/plugin-starter/tailwind.config.js +62 -0
  164. package/templates/plugin-starter/tsconfig.json +8 -8
  165. package/templates/plugin-starter/vite.config.ts +20 -0
  166. package/templates/project-starter/bunfig.toml +6 -0
  167. package/templates/project-starter/cypress.config.ts +31 -0
  168. package/templates/project-starter/index.html +13 -0
  169. package/templates/project-starter/package.json +37 -14
  170. package/templates/project-starter/postcss.config.js +3 -0
  171. package/templates/project-starter/scripts/test-all.sh +101 -0
  172. package/templates/project-starter/src/__tests__/actions.test.ts +155 -0
  173. package/templates/project-starter/src/__tests__/character.test.ts +86 -0
  174. package/templates/project-starter/src/__tests__/config.test.ts +193 -0
  175. package/templates/project-starter/src/__tests__/cypress/component/Accessibility.cy.tsx +271 -0
  176. package/templates/project-starter/src/__tests__/cypress/component/ApiIntegration.cy.tsx +220 -0
  177. package/templates/project-starter/src/__tests__/cypress/component/ExampleRoute.cy.tsx +146 -0
  178. package/templates/project-starter/src/__tests__/cypress/component/PanelComponent.cy.tsx +51 -0
  179. package/templates/project-starter/src/__tests__/cypress/e2e/agent-chat.cy.ts +235 -0
  180. package/templates/project-starter/src/__tests__/cypress/e2e/dashboard.cy.ts +146 -0
  181. package/templates/project-starter/src/__tests__/cypress/e2e/user-workflow.cy.ts +257 -0
  182. package/templates/project-starter/src/__tests__/cypress/support/commands.ts +44 -0
  183. package/templates/project-starter/src/__tests__/cypress/support/component-index.html +11 -0
  184. package/templates/project-starter/src/__tests__/cypress/support/component.ts +33 -0
  185. package/templates/project-starter/src/__tests__/cypress/support/e2e.ts +179 -0
  186. package/templates/project-starter/src/__tests__/e2e/index.ts +14 -0
  187. package/templates/project-starter/src/__tests__/e2e/natural-language.test.ts +246 -0
  188. package/templates/project-starter/src/__tests__/e2e/project.test.ts +155 -0
  189. package/templates/project-starter/src/__tests__/e2e/starter-plugin.test.ts +421 -0
  190. package/templates/project-starter/src/__tests__/env.test.ts +87 -0
  191. package/templates/project-starter/src/__tests__/error-handling.test.ts +177 -0
  192. package/templates/project-starter/src/__tests__/events.test.ts +144 -0
  193. package/templates/project-starter/src/__tests__/file-structure.test.ts +135 -0
  194. package/templates/project-starter/src/__tests__/integration.test.ts +209 -0
  195. package/templates/project-starter/src/__tests__/models.test.ts +152 -0
  196. package/templates/project-starter/src/__tests__/plugin.test.ts +393 -0
  197. package/templates/project-starter/src/__tests__/provider.test.ts +325 -0
  198. package/templates/project-starter/src/__tests__/routes.test.ts +79 -0
  199. package/templates/project-starter/src/__tests__/test-utils.ts +121 -0
  200. package/templates/project-starter/src/__tests__/utils/core-test-utils.ts +180 -0
  201. package/templates/project-starter/src/frontend/index.css +77 -0
  202. package/templates/project-starter/src/frontend/index.html +19 -0
  203. package/templates/project-starter/src/frontend/index.tsx +98 -0
  204. package/templates/project-starter/src/frontend/utils.ts +6 -0
  205. package/templates/project-starter/src/index.ts +3 -0
  206. package/templates/project-starter/tailwind.config.js +62 -0
  207. package/templates/project-starter/tsconfig.build.json +9 -2
  208. package/templates/project-starter/tsconfig.json +15 -6
  209. package/templates/project-starter/tsup.config.ts +1 -1
  210. package/templates/project-starter/vite.config.ts +39 -0
  211. package/templates/project-tee-starter/__tests__/actions.test.ts +1 -1
  212. package/templates/project-tee-starter/__tests__/character.test.ts +1 -1
  213. package/templates/project-tee-starter/__tests__/config.test.ts +1 -1
  214. package/templates/project-tee-starter/__tests__/env.test.ts +2 -2
  215. package/templates/project-tee-starter/__tests__/error-handling.test.ts +1 -1
  216. package/templates/project-tee-starter/__tests__/events.test.ts +1 -1
  217. package/templates/project-tee-starter/__tests__/file-structure.test.ts +5 -5
  218. package/templates/project-tee-starter/__tests__/integration.test.ts +22 -26
  219. package/templates/project-tee-starter/__tests__/models.test.ts +1 -1
  220. package/templates/project-tee-starter/__tests__/plugin.test.ts +6 -12
  221. package/templates/project-tee-starter/__tests__/provider.test.ts +6 -6
  222. package/templates/project-tee-starter/__tests__/routes.test.ts +1 -1
  223. package/templates/project-tee-starter/__tests__/test-utils.ts +15 -15
  224. package/templates/project-tee-starter/__tests__/utils/core-test-utils.ts +3 -3
  225. package/templates/project-tee-starter/bunfig.toml +6 -0
  226. package/templates/project-tee-starter/package.json +10 -12
  227. package/dist/assets/index-CCyz05Yl.js.br +0 -0
  228. package/dist/assets/index-CCyz05Yl.js.map +0 -1
  229. package/dist/assets/index-DeXwJbtm.css +0 -1
  230. package/dist/assets/index-DeXwJbtm.css.br +0 -0
  231. package/dist/chunk-CEE6RKN5.js +0 -2746
  232. package/dist/chunk-TUAYJIF2.js +0 -3649
  233. package/dist/plugin-creator-IK6H4LVZ.js +0 -29165
  234. package/templates/plugin-starter/e2e/starter-plugin.test.ts +0 -171
  235. package/templates/plugin-starter/images/README.md +0 -24
  236. package/templates/plugin-starter/vitest.config.ts +0 -16
  237. package/templates/project-starter/e2e/project.test.ts +0 -34
  238. package/templates/project-starter/e2e/starter-plugin.test.ts +0 -217
  239. package/templates/project-starter/vitest.config.ts +0 -16
  240. package/templates/project-tee-starter/vitest.config.ts +0 -19
@@ -0,0 +1,33 @@
1
+ // ***********************************************************
2
+ // This file is processed and loaded automatically before your test files.
3
+ // You can change the location of this file or turn off processing using the
4
+ // 'supportFile' config option.
5
+ // ***********************************************************
6
+
7
+ // Import commands.js using ES2015 syntax:
8
+ import './commands';
9
+
10
+ // Import Testing Library Cypress commands
11
+ import '@testing-library/cypress/add-commands';
12
+
13
+ // Import styles
14
+ import '../../../frontend/index.css';
15
+
16
+ // Add custom TypeScript types
17
+ declare global {
18
+ namespace Cypress {
19
+ interface Chainable {
20
+ /**
21
+ * Custom command to mount React components
22
+ * @example cy.mount(<Component />)
23
+ */
24
+ mount(component: React.ReactElement): Chainable<any>;
25
+ }
26
+ }
27
+ }
28
+
29
+ // Import React mount function
30
+ import { mount } from '@cypress/react';
31
+
32
+ // Make mount available globally
33
+ Cypress.Commands.add('mount', mount);
@@ -0,0 +1,179 @@
1
+ /**
2
+ * E2E Support File
3
+ *
4
+ * This file is loaded automatically before E2E test files.
5
+ * Use it to set up global configuration and custom commands.
6
+ */
7
+
8
+ // ***********************************************************
9
+ // This file is processed and loaded automatically before your test files.
10
+ // You can change the location of this file or turn off processing using the
11
+ // 'supportFile' config option.
12
+ // ***********************************************************
13
+
14
+ // Import commands (shared with component tests)
15
+ import './commands';
16
+
17
+ // Import Testing Library Cypress commands
18
+ import '@testing-library/cypress/add-commands';
19
+
20
+ // E2E-specific configurations
21
+ Cypress.on('uncaught:exception', (err, runnable) => {
22
+ // Prevent Cypress from failing the test on uncaught exceptions
23
+ // This is useful for E2E tests where third-party scripts might throw errors
24
+ console.error('Uncaught exception:', err);
25
+ return false;
26
+ });
27
+
28
+ // Custom E2E commands
29
+ declare global {
30
+ namespace Cypress {
31
+ interface Chainable {
32
+ /**
33
+ * Login to the application
34
+ * @param username - Username to login with
35
+ * @param password - Password to login with
36
+ */
37
+ login(username?: string, password?: string): Chainable<void>;
38
+
39
+ /**
40
+ * Wait for the application to be ready
41
+ */
42
+ waitForApp(): Chainable<void>;
43
+
44
+ /**
45
+ * Navigate to a specific agent chat
46
+ * @param agentId - ID of the agent to chat with
47
+ */
48
+ navigateToAgent(agentId?: string): Chainable<void>;
49
+
50
+ /**
51
+ * Send a chat message and wait for response
52
+ * @param message - Message to send
53
+ */
54
+ sendChatMessage(message: string): Chainable<void>;
55
+
56
+ /**
57
+ * Clear all application data
58
+ */
59
+ clearAppData(): Chainable<void>;
60
+ }
61
+ }
62
+ }
63
+
64
+ // Login command
65
+ Cypress.Commands.add('login', (username = 'testuser', password = 'testpass') => {
66
+ // Check if login is required
67
+ cy.get('body').then(($body) => {
68
+ if ($body.find('[data-testid="login"], form[name="login"], input[name="username"]').length) {
69
+ cy.get('input[name="username"], input[type="email"]').first().type(username);
70
+ cy.get('input[name="password"], input[type="password"]').first().type(password);
71
+ cy.get('button[type="submit"], button:contains("Login")').first().click();
72
+ cy.wait(1000);
73
+ }
74
+ });
75
+ });
76
+
77
+ // Wait for app to be ready
78
+ Cypress.Commands.add('waitForApp', () => {
79
+ // Wait for any loading indicators to disappear
80
+ cy.get('[data-testid="loading"], .loading, .spinner', { timeout: 10000 }).should('not.exist');
81
+
82
+ // Ensure the app container is visible
83
+ cy.get('#root, #app, [data-testid="app"]').should('be.visible');
84
+
85
+ // Wait a bit for any animations
86
+ cy.wait(500);
87
+ });
88
+
89
+ // Navigate to agent
90
+ Cypress.Commands.add('navigateToAgent', (agentId?: string) => {
91
+ if (agentId) {
92
+ cy.visit(`/agent/${agentId}`);
93
+ } else {
94
+ cy.get('a[href*="agent"], button:contains("agent")').first().click({ force: true });
95
+ }
96
+ cy.waitForApp();
97
+ });
98
+
99
+ // Send chat message
100
+ Cypress.Commands.add('sendChatMessage', (message: string) => {
101
+ // Find and type in the input
102
+ cy.get('input[type="text"], textarea, [contenteditable="true"]')
103
+ .filter(':visible')
104
+ .first()
105
+ .clear()
106
+ .type(message);
107
+
108
+ // Send the message
109
+ cy.get('button').filter(':contains("Send"), [aria-label*="send"]').first().click();
110
+
111
+ // Wait for the message to appear
112
+ cy.contains(message, { timeout: 5000 }).should('be.visible');
113
+
114
+ // Wait for agent response
115
+ cy.get('[data-testid*="agent"], [class*="agent"], [data-sender="agent"]', {
116
+ timeout: 15000,
117
+ }).should('exist');
118
+ });
119
+
120
+ // Clear app data
121
+ Cypress.Commands.add('clearAppData', () => {
122
+ cy.window().then((win) => {
123
+ // Clear local storage
124
+ (win as any).localStorage.clear();
125
+
126
+ // Clear session storage
127
+ (win as any).sessionStorage.clear();
128
+
129
+ // Clear cookies
130
+ cy.clearCookies();
131
+
132
+ // Note: IndexedDB clearing is commented out due to TypeScript compatibility issues
133
+ // If your app uses IndexedDB, you may need to add custom clearing logic here
134
+ // Example:
135
+ // cy.window().its('indexedDB').invoke('deleteDatabase', 'your-db-name');
136
+ });
137
+ });
138
+
139
+ // E2E-specific viewport settings
140
+ beforeEach(() => {
141
+ // Set a consistent viewport for E2E tests
142
+ cy.viewport(1280, 720);
143
+ });
144
+
145
+ // Screenshot on failure
146
+ Cypress.on('fail', (error, runnable) => {
147
+ // Take a screenshot when a test fails
148
+ cy.screenshot(`failed-${runnable.parent?.title}-${runnable.title}`, {
149
+ capture: 'runner',
150
+ });
151
+ throw error;
152
+ });
153
+
154
+ /**
155
+ * E2E TESTING UTILITIES
156
+ *
157
+ * These commands help with common E2E testing scenarios:
158
+ *
159
+ * 1. LOGIN FLOWS
160
+ * - cy.login() - Handle authentication
161
+ * - Supports different auth methods
162
+ *
163
+ * 2. NAVIGATION
164
+ * - cy.navigateToAgent() - Go to agent chat
165
+ * - cy.waitForApp() - Wait for app ready
166
+ *
167
+ * 3. INTERACTIONS
168
+ * - cy.sendChatMessage() - Send and verify messages
169
+ * - Handles async responses
170
+ *
171
+ * 4. STATE MANAGEMENT
172
+ * - cy.clearAppData() - Reset application state
173
+ * - Clears all storage types
174
+ *
175
+ * BEST PRACTICES:
176
+ * - Use these commands for consistency
177
+ * - Add new commands as patterns emerge
178
+ * - Keep commands focused and reusable
179
+ */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * E2E Test Suite Exports
3
+ *
4
+ * This file exports all E2E test suites for the ElizaOS test runner.
5
+ */
6
+
7
+ import projectTestSuite from './project.test';
8
+ import starterTestSuite from './starter-plugin.test';
9
+ import naturalLanguageTestSuite from './natural-language.test';
10
+
11
+ // Export test suites for the test runner to discover
12
+ export const testSuites = [projectTestSuite, starterTestSuite, naturalLanguageTestSuite];
13
+
14
+ export default testSuites;
@@ -0,0 +1,246 @@
1
+ import { type TestSuite } from '@elizaos/core';
2
+
3
+ /**
4
+ * Natural Language E2E Test Suite
5
+ *
6
+ * This suite tests the agent's ability to respond to natural language inputs,
7
+ * including the requested "hello world" test.
8
+ *
9
+ * HOW TO ADD NEW NATURAL LANGUAGE TESTS:
10
+ * 1. Add a new test object to the `tests` array
11
+ * 2. Create a message with natural language content
12
+ * 3. Process it through the runtime
13
+ * 4. Verify the agent's response makes sense
14
+ *
15
+ * These tests use the REAL runtime with actual language processing,
16
+ * so responses may vary based on the model and character configuration.
17
+ */
18
+ export class NaturalLanguageTestSuite implements TestSuite {
19
+ name = 'natural-language';
20
+ description = 'E2E tests for natural language processing and agent responses';
21
+
22
+ tests = [
23
+ {
24
+ name: 'Agent responds to hello world',
25
+ fn: async (runtime: any) => {
26
+ /**
27
+ * This test verifies that the agent can respond appropriately
28
+ * to a simple "hello world" greeting.
29
+ */
30
+ try {
31
+ // Create a unique room for this test
32
+ const roomId = `test-room-hello-${Date.now()}`;
33
+ const userId = 'test-user-hello';
34
+
35
+ // Create a message saying "hello world"
36
+ const helloMessage = {
37
+ id: `msg-${Date.now()}`,
38
+ userId: userId,
39
+ agentId: runtime.agentId,
40
+ roomId: roomId,
41
+ content: {
42
+ text: 'hello world',
43
+ type: 'text',
44
+ },
45
+ createdAt: Date.now(),
46
+ };
47
+
48
+ console.log('Sending hello world message to agent...');
49
+
50
+ // Process the message through the runtime
51
+ // This will trigger the agent to generate a response
52
+ await runtime.processMessage(helloMessage);
53
+
54
+ // Give the agent a moment to process and respond
55
+ await new Promise((resolve) => setTimeout(resolve, 1000));
56
+
57
+ // Retrieve messages from the conversation
58
+ const messages = await runtime.messageManager.getMessages({
59
+ roomId,
60
+ limit: 10,
61
+ });
62
+
63
+ console.log(`Retrieved ${messages.length} messages from conversation`);
64
+
65
+ // Verify we have at least 2 messages (user + agent)
66
+ if (messages.length < 2) {
67
+ throw new Error(`Expected at least 2 messages, got ${messages.length}`);
68
+ }
69
+
70
+ // Find the agent's response
71
+ const agentResponse = messages.find(
72
+ (m: any) =>
73
+ m.userId === runtime.agentId && m.roomId === roomId && m.id !== helloMessage.id
74
+ );
75
+
76
+ if (!agentResponse) {
77
+ throw new Error('Agent did not respond to hello world message');
78
+ }
79
+
80
+ console.log('Agent response:', agentResponse.content.text);
81
+
82
+ // Verify the response contains a greeting
83
+ const responseText = agentResponse.content.text.toLowerCase();
84
+ const greetingWords = ['hello', 'hi', 'hey', 'greetings', 'welcome'];
85
+
86
+ const containsGreeting = greetingWords.some((word) => responseText.includes(word));
87
+
88
+ if (!containsGreeting) {
89
+ throw new Error(
90
+ `Agent response did not contain a greeting. ` +
91
+ `Response was: "${agentResponse.content.text}"`
92
+ );
93
+ }
94
+
95
+ console.log('✓ Agent successfully responded to hello world');
96
+ } catch (error) {
97
+ throw new Error(`Hello world test failed: ${(error as Error).message}`);
98
+ }
99
+ },
100
+ },
101
+
102
+ {
103
+ name: 'Agent responds to casual greeting',
104
+ fn: async (runtime: any) => {
105
+ /**
106
+ * Test various casual greetings to ensure the agent
107
+ * responds appropriately to different forms of hello.
108
+ */
109
+ try {
110
+ const greetings = ['hey there!', 'hi, how are you?', 'good morning!', 'whats up?'];
111
+
112
+ for (const greeting of greetings) {
113
+ const roomId = `test-room-greeting-${Date.now()}-${Math.random()}`;
114
+ const userId = 'test-user-greeting';
115
+
116
+ const message = {
117
+ id: `msg-${Date.now()}-${Math.random()}`,
118
+ userId: userId,
119
+ agentId: runtime.agentId,
120
+ roomId: roomId,
121
+ content: {
122
+ text: greeting,
123
+ type: 'text',
124
+ },
125
+ createdAt: Date.now(),
126
+ };
127
+
128
+ console.log(`Testing greeting: "${greeting}"`);
129
+
130
+ await runtime.processMessage(message);
131
+ await new Promise((resolve) => setTimeout(resolve, 500));
132
+
133
+ const messages = await runtime.messageManager.getMessages({
134
+ roomId,
135
+ limit: 10,
136
+ });
137
+
138
+ const agentResponse = messages.find(
139
+ (m: any) => m.userId === runtime.agentId && m.id !== message.id
140
+ );
141
+
142
+ if (!agentResponse) {
143
+ throw new Error(`Agent did not respond to greeting: "${greeting}"`);
144
+ }
145
+
146
+ // Just verify we got a response - content may vary
147
+ if (!agentResponse.content.text || agentResponse.content.text.length < 2) {
148
+ throw new Error(`Agent gave empty response to: "${greeting}"`);
149
+ }
150
+
151
+ console.log(`✓ Agent responded to: "${greeting}"`);
152
+ }
153
+ } catch (error) {
154
+ throw new Error(`Casual greeting test failed: ${(error as Error).message}`);
155
+ }
156
+ },
157
+ },
158
+
159
+ {
160
+ name: 'Agent maintains conversation context',
161
+ fn: async (runtime: any) => {
162
+ /**
163
+ * Test that the agent remembers context from previous messages
164
+ * in the same conversation.
165
+ */
166
+ try {
167
+ const roomId = `test-room-context-${Date.now()}`;
168
+ const userId = 'test-user-context';
169
+
170
+ // First message - introduce a topic
171
+ const firstMessage = {
172
+ id: `msg-1-${Date.now()}`,
173
+ userId: userId,
174
+ agentId: runtime.agentId,
175
+ roomId: roomId,
176
+ content: {
177
+ text: "My favorite color is blue. What's yours?",
178
+ type: 'text',
179
+ },
180
+ createdAt: Date.now(),
181
+ };
182
+
183
+ console.log('Sending first message about favorite color...');
184
+ await runtime.processMessage(firstMessage);
185
+ await new Promise((resolve) => setTimeout(resolve, 1000));
186
+
187
+ // Second message - reference the topic
188
+ const secondMessage = {
189
+ id: `msg-2-${Date.now()}`,
190
+ userId: userId,
191
+ agentId: runtime.agentId,
192
+ roomId: roomId,
193
+ content: {
194
+ text: 'Why did you choose that color?',
195
+ type: 'text',
196
+ },
197
+ createdAt: Date.now() + 1000,
198
+ };
199
+
200
+ console.log('Sending follow-up question...');
201
+ await runtime.processMessage(secondMessage);
202
+ await new Promise((resolve) => setTimeout(resolve, 1000));
203
+
204
+ // Get all messages
205
+ const messages = await runtime.messageManager.getMessages({
206
+ roomId,
207
+ limit: 10,
208
+ });
209
+
210
+ // Should have at least 4 messages (2 user + 2 agent)
211
+ if (messages.length < 4) {
212
+ throw new Error(`Expected at least 4 messages, got ${messages.length}`);
213
+ }
214
+
215
+ // Find the agent's second response
216
+ const agentResponses = messages.filter((m: any) => m.userId === runtime.agentId);
217
+ if (agentResponses.length < 2) {
218
+ throw new Error('Agent did not respond to both messages');
219
+ }
220
+
221
+ // The second response should reference colors or the previous conversation
222
+ const secondResponse = agentResponses[agentResponses.length - 1];
223
+ const responseText = secondResponse.content.text.toLowerCase();
224
+
225
+ // Check if the response shows context awareness
226
+ const contextWords = ['color', 'blue', 'favorite', 'chose', 'choice', 'because'];
227
+ const hasContext = contextWords.some((word) => responseText.includes(word));
228
+
229
+ if (!hasContext) {
230
+ console.warn(
231
+ 'Agent response may not show context awareness. ' +
232
+ `Response: "${secondResponse.content.text}"`
233
+ );
234
+ }
235
+
236
+ console.log('✓ Agent maintained conversation context');
237
+ } catch (error) {
238
+ throw new Error(`Context test failed: ${(error as Error).message}`);
239
+ }
240
+ },
241
+ },
242
+ ];
243
+ }
244
+
245
+ // Export a default instance for the test runner
246
+ export default new NaturalLanguageTestSuite();
@@ -0,0 +1,155 @@
1
+ import { type TestSuite } from '@elizaos/core';
2
+
3
+ /**
4
+ * Project E2E Test Suite
5
+ *
6
+ * This file demonstrates how to write end-to-end (E2E) tests for ElizaOS projects.
7
+ * E2E tests are run using the `elizaos test` command, which provides a REAL runtime
8
+ * environment with actual database, services, and plugin initialization.
9
+ *
10
+ * Key differences from unit tests:
11
+ * - E2E tests receive a fully initialized IAgentRuntime instance
12
+ * - The runtime has a real database (in-memory PGLite for testing)
13
+ * - All plugins and services are actually initialized and running
14
+ * - You can test real agent interactions and behaviors
15
+ *
16
+ * HOW TO ADD NEW E2E TESTS:
17
+ * 1. Add a new test object to the `tests` array below
18
+ * 2. Each test should have a descriptive `name` and async `fn` function
19
+ * 3. The test function receives a real runtime instance as its parameter
20
+ * 4. Use the runtime to simulate real agent interactions
21
+ * 5. Throw an error if the test fails (assertions that fail should throw)
22
+ *
23
+ * IMPORTANT: These tests run in a real environment, so:
24
+ * - Don't use mocks or stubs - everything is real
25
+ * - Tests may be slower than unit tests due to real operations
26
+ * - Each test should be independent and not rely on previous test state
27
+ */
28
+ export class ProjectTestSuite implements TestSuite {
29
+ name = 'project';
30
+ description = 'E2E tests for project-specific features';
31
+
32
+ tests = [
33
+ {
34
+ name: 'Project runtime environment test',
35
+ fn: async (runtime: any) => {
36
+ /**
37
+ * This test verifies that the project's runtime environment is set up correctly.
38
+ * It's a basic smoke test to ensure the character and core systems are loaded.
39
+ */
40
+ try {
41
+ // Verify character is loaded
42
+ if (!runtime.character) {
43
+ throw new Error('Character not loaded in runtime');
44
+ }
45
+
46
+ // Verify expected character properties
47
+ const character = runtime.character;
48
+ if (!character.name) {
49
+ throw new Error('Character name is missing');
50
+ }
51
+
52
+ // Verify the character has the expected name
53
+ if (character.name !== 'Eliza') {
54
+ throw new Error(`Expected character name 'Eliza', got '${character.name}'`);
55
+ }
56
+
57
+ // Verify character has required configuration
58
+ if (!character.system) {
59
+ throw new Error('Character system prompt is missing');
60
+ }
61
+
62
+ if (!Array.isArray(character.bio)) {
63
+ throw new Error('Character bio should be an array');
64
+ }
65
+
66
+ if (!Array.isArray(character.messageExamples)) {
67
+ throw new Error('Character message examples should be an array');
68
+ }
69
+
70
+ // Verify plugins are loaded (if specified in character)
71
+ if (character.plugins && !Array.isArray(character.plugins)) {
72
+ throw new Error('Character plugins should be an array');
73
+ }
74
+
75
+ // Test passed - no need to return anything
76
+ // The test framework considers it successful if no error is thrown
77
+ } catch (error) {
78
+ // Re-throw with more context for debugging
79
+ throw new Error(`Project runtime environment test failed: ${(error as Error).message}`);
80
+ }
81
+ },
82
+ },
83
+
84
+ /**
85
+ * Example: How to add a new test that checks if services are initialized
86
+ * Uncomment and modify this template for your own tests
87
+ */
88
+ /*
89
+ {
90
+ name: 'Services initialization test',
91
+ fn: async (runtime: any) => {
92
+ // Example: Check if a specific service is available
93
+ const myService = runtime.getService('my-service-name');
94
+ if (!myService) {
95
+ throw new Error('Expected service not found');
96
+ }
97
+
98
+ // Example: Test service functionality
99
+ const result = await myService.doSomething();
100
+ if (!result) {
101
+ throw new Error('Service did not return expected result');
102
+ }
103
+ },
104
+ },
105
+ */
106
+
107
+ /**
108
+ * Example: How to test agent message processing
109
+ * This shows how to simulate a conversation with the agent
110
+ */
111
+ /*
112
+ {
113
+ name: 'Agent conversation test',
114
+ fn: async (runtime: any) => {
115
+ // Create a test room/conversation
116
+ const roomId = `test-room-${Date.now()}`;
117
+
118
+ // Simulate sending a message to the agent
119
+ const userMessage = {
120
+ userId: 'test-user',
121
+ roomId: roomId,
122
+ content: { text: 'Hello agent!' },
123
+ // Add other required message properties
124
+ };
125
+
126
+ // Process the message through the runtime
127
+ await runtime.processMessage(userMessage);
128
+
129
+ // Retrieve messages from the conversation
130
+ const messages = await runtime.messageManager.getMessages({ roomId });
131
+
132
+ // Verify the agent responded
133
+ if (messages.length < 2) {
134
+ throw new Error('Agent did not respond to message');
135
+ }
136
+
137
+ // Check the agent's response
138
+ const agentResponse = messages.find(m => m.userId === runtime.agentId);
139
+ if (!agentResponse) {
140
+ throw new Error('Could not find agent response');
141
+ }
142
+
143
+ // Verify response content
144
+ if (!agentResponse.content.text.toLowerCase().includes('hello')) {
145
+ throw new Error('Agent response did not contain expected greeting');
146
+ }
147
+ },
148
+ },
149
+ */
150
+ ];
151
+ }
152
+
153
+ // Export a default instance of the test suite for the E2E test runner
154
+ // The test runner will automatically discover and run this suite
155
+ export default new ProjectTestSuite();