@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,77 @@
1
+ @config "../../tailwind.config.js";
2
+ @import 'tailwindcss';
3
+
4
+ @layer base {
5
+ :root {
6
+ --background: 0 0% 97.65%;
7
+ --foreground: 0 0% 12.55%;
8
+ --muted: 0 0% 93.73%;
9
+ --muted-foreground: 0 0% 39.22%;
10
+ --popover: 0 0% 98.82%;
11
+ --popover-foreground: 0 0% 12.55%;
12
+ --card: 0 0% 98.82%;
13
+ --card-foreground: 0 0% 12.55%;
14
+ --border: 0 0% 84.71%;
15
+ --input: 0 0% 94.12%;
16
+ --primary: 22.93 92.59% 52.35%;
17
+ --primary-foreground: 44 0% 100%;
18
+ --secondary: 34.05 100% 85.49%;
19
+ --secondary-foreground: 16.27 50.43% 22.94%;
20
+ --accent: 0 0% 90.98%;
21
+ --accent-foreground: 0 0% 12.55%;
22
+ --destructive: 10.16 77.87% 53.92%;
23
+ --destructive-foreground: 0 0% 100%;
24
+ --ring: 24.8 79.79% 63.14%;
25
+ --chart-1: 22.93 92.59% 52.35%;
26
+ --chart-2: 34.05 100% 85.49%;
27
+ --chart-3: 0 0% 90.98%;
28
+ --chart-4: 34.05 100% 88.49%;
29
+ --chart-5: 22.93 95.59% 52.35%;
30
+ --radius: 0.5rem;
31
+ }
32
+
33
+ .dark {
34
+ --background: 0 0% 6.67%;
35
+ --foreground: 0 0% 93.33%;
36
+ --muted: 0 0% 13.33%;
37
+ --muted-foreground: 0 0% 70.59%;
38
+ --popover: 0 0% 9.8%;
39
+ --popover-foreground: 0 0% 93.33%;
40
+ --card: 0 0% 9.8%;
41
+ --card-foreground: 0 0% 93.33%;
42
+ --border: 44 14% 11%;
43
+ --input: 0 0% 28.24%;
44
+ --primary: 22.93 92.59% 52.35%;
45
+ --primary-foreground: 29.51 0% 100%;
46
+ --secondary: 28.5 64.52% 12.16%;
47
+ --secondary-foreground: 29.51 100% 88.04%;
48
+ --accent: 0 0% 16.47%;
49
+ --accent-foreground: 0 0% 93.33%;
50
+ --destructive: 10.16 77.87% 53.92%;
51
+ --destructive-foreground: 0 0% 100%;
52
+ --ring: 23.11 59.8% 40%;
53
+ --chart-1: 22.93 92.59% 52.35%;
54
+ --chart-2: 28.5 64.52% 12.16%;
55
+ --chart-3: 0 0% 16.47%;
56
+ --chart-4: 28.5 64.52% 15.16%;
57
+ --chart-5: 22.93 95.59% 52.35%;
58
+ }
59
+ }
60
+
61
+ @layer base {
62
+ * {
63
+ @apply border-border;
64
+ }
65
+ body {
66
+ @apply bg-background text-foreground;
67
+ }
68
+ }
69
+
70
+ /* Force dark mode */
71
+ :root {
72
+ color-scheme: dark;
73
+ }
74
+
75
+ body {
76
+ @apply font-mono bg-background text-foreground;
77
+ }
@@ -0,0 +1,164 @@
1
+ import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query';
2
+ import { createRoot } from 'react-dom/client';
3
+ import './index.css';
4
+ import React from 'react';
5
+ import type { UUID } from '@elizaos/core';
6
+
7
+ const queryClient = new QueryClient();
8
+
9
+ // Define the interface for the ELIZA_CONFIG
10
+ interface ElizaConfig {
11
+ agentId: string;
12
+ apiBase: string;
13
+ }
14
+
15
+ // Define the interface for time response
16
+ interface TimeResponse {
17
+ timestamp: string;
18
+ unix: number;
19
+ formatted: string;
20
+ timezone: string;
21
+ }
22
+
23
+ /**
24
+ * Time display component that fetches from backend
25
+ */
26
+ function TimeDisplay({ apiBase }: { apiBase: string }) {
27
+ const { data, isLoading, error, refetch } = useQuery<TimeResponse>({
28
+ queryKey: ['currentTime'],
29
+ queryFn: async () => {
30
+ const response = await fetch(`${apiBase}/api/time`);
31
+ if (!response.ok) {
32
+ throw new Error('Failed to fetch time');
33
+ }
34
+ return response.json();
35
+ },
36
+ refetchInterval: 1000, // Refresh every second
37
+ });
38
+
39
+ if (isLoading) {
40
+ return <div className="text-gray-600">Loading time...</div>;
41
+ }
42
+
43
+ if (error) {
44
+ return (
45
+ <div className="text-red-600">
46
+ Error fetching time: {error instanceof Error ? error.message : 'Unknown error'}
47
+ </div>
48
+ );
49
+ }
50
+
51
+ return (
52
+ <div className="space-y-2" data-testid="time-display">
53
+ <h2 className="text-lg font-semibold">Current Time</h2>
54
+ <div className="space-y-1 text-sm">
55
+ <div>
56
+ <span className="font-medium">Formatted:</span> {data?.formatted}
57
+ </div>
58
+ <div>
59
+ <span className="font-medium">Timezone:</span> {data?.timezone}
60
+ </div>
61
+ <div>
62
+ <span className="font-medium">Unix:</span> {data?.unix}
63
+ </div>
64
+ </div>
65
+ <button
66
+ onClick={() => refetch()}
67
+ className="px-3 py-1 text-sm bg-primary text-primary-foreground rounded hover:opacity-90"
68
+ data-testid="refresh-button"
69
+ >
70
+ Refresh
71
+ </button>
72
+ </div>
73
+ );
74
+ }
75
+
76
+ /**
77
+ * Main Example route component
78
+ */
79
+ function ExampleRoute() {
80
+ const config = (window as any).ELIZA_CONFIG as ElizaConfig | undefined;
81
+ const agentId = config?.agentId;
82
+ const apiBase = config?.apiBase || 'http://localhost:3000';
83
+
84
+ // Apply dark mode to the root element
85
+ React.useEffect(() => {
86
+ document.documentElement.classList.add('dark');
87
+ }, []);
88
+
89
+ if (!agentId) {
90
+ return (
91
+ <div className="p-4 text-center">
92
+ <div className="text-red-600 font-medium">Error: Agent ID not found</div>
93
+ <div className="text-sm text-gray-600 mt-2">
94
+ The server should inject the agent ID configuration.
95
+ </div>
96
+ </div>
97
+ );
98
+ }
99
+
100
+ return <ExampleProvider agentId={agentId as UUID} apiBase={apiBase} />;
101
+ }
102
+
103
+ /**
104
+ * Example provider component
105
+ */
106
+ function ExampleProvider({ agentId, apiBase }: { agentId: UUID; apiBase: string }) {
107
+ return (
108
+ <QueryClientProvider client={queryClient}>
109
+ <div className="p-6 space-y-6">
110
+ <div>
111
+ <h1 className="text-2xl font-bold mb-2">Plugin Starter Example</h1>
112
+ <div className="text-sm text-muted-foreground">Agent ID: {agentId}</div>
113
+ </div>
114
+ <TimeDisplay apiBase={apiBase} />
115
+ </div>
116
+ </QueryClientProvider>
117
+ );
118
+ }
119
+
120
+ // Initialize the application - no router needed for iframe
121
+ const rootElement = document.getElementById('root');
122
+ if (rootElement) {
123
+ createRoot(rootElement).render(<ExampleRoute />);
124
+ }
125
+
126
+ // Define types for integration with agent UI system
127
+ export interface AgentPanel {
128
+ name: string;
129
+ path: string;
130
+ component: React.ComponentType<any>;
131
+ icon?: string;
132
+ public?: boolean;
133
+ shortLabel?: string; // Optional short label for mobile
134
+ }
135
+
136
+ interface PanelProps {
137
+ agentId: string;
138
+ }
139
+
140
+ /**
141
+ * Example panel component for the plugin system
142
+ */
143
+ const PanelComponent: React.FC<PanelProps> = ({ agentId }) => {
144
+ return (
145
+ <div className="p-4">
146
+ <h2 className="text-lg font-semibold mb-2">Example Panel</h2>
147
+ <div>Hello {agentId}!</div>
148
+ </div>
149
+ );
150
+ };
151
+
152
+ // Export the panel configuration for integration with the agent UI
153
+ export const panels: AgentPanel[] = [
154
+ {
155
+ name: 'Example',
156
+ path: 'example',
157
+ component: PanelComponent,
158
+ icon: 'Book',
159
+ public: false,
160
+ shortLabel: 'Example',
161
+ },
162
+ ];
163
+
164
+ export * from './utils';
@@ -0,0 +1,6 @@
1
+ import { type ClassValue, clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }
@@ -0,0 +1,274 @@
1
+ import type { Plugin } from '@elizaos/core';
2
+ import {
3
+ type Action,
4
+ type Content,
5
+ type GenerateTextParams,
6
+ type HandlerCallback,
7
+ type IAgentRuntime,
8
+ type Memory,
9
+ ModelType,
10
+ type Provider,
11
+ type ProviderResult,
12
+ Service,
13
+ type State,
14
+ logger,
15
+ } from '@elizaos/core';
16
+ import { z } from 'zod';
17
+ import { StarterPluginTestSuite } from './tests';
18
+
19
+ /**
20
+ * Defines the configuration schema for a plugin, including the validation rules for the plugin name.
21
+ *
22
+ * @type {import('zod').ZodObject<{ EXAMPLE_PLUGIN_VARIABLE: import('zod').ZodString }>}
23
+ */
24
+ const configSchema = z.object({
25
+ EXAMPLE_PLUGIN_VARIABLE: z
26
+ .string()
27
+ .min(1, 'Example plugin variable is not provided')
28
+ .optional()
29
+ .transform((val) => {
30
+ if (!val) {
31
+ logger.warn('Example plugin variable is not provided (this is expected)');
32
+ }
33
+ return val;
34
+ }),
35
+ });
36
+
37
+ /**
38
+ * Example HelloWorld action
39
+ * This demonstrates the simplest possible action structure
40
+ */
41
+ /**
42
+ * Action representing a hello world message.
43
+ * @typedef {Object} Action
44
+ * @property {string} name - The name of the action.
45
+ * @property {string[]} similes - An array of related actions.
46
+ * @property {string} description - A brief description of the action.
47
+ * @property {Function} validate - Asynchronous function to validate the action.
48
+ * @property {Function} handler - Asynchronous function to handle the action and generate a response.
49
+ * @property {Object[]} examples - An array of example inputs and expected outputs for the action.
50
+ */
51
+ const helloWorldAction: Action = {
52
+ name: 'HELLO_WORLD',
53
+ similes: ['GREET', 'SAY_HELLO'],
54
+ description: 'Responds with a simple hello world message',
55
+
56
+ validate: async (
57
+ _runtime: IAgentRuntime,
58
+ _message: Memory,
59
+ _state: State | undefined
60
+ ): Promise<boolean> => {
61
+ // Always valid
62
+ return true;
63
+ },
64
+
65
+ handler: async (
66
+ _runtime: IAgentRuntime,
67
+ message: Memory,
68
+ _state: State | undefined,
69
+ _options: any,
70
+ callback?: HandlerCallback,
71
+ _responses?: Memory[]
72
+ ) => {
73
+ try {
74
+ logger.info('Handling HELLO_WORLD action');
75
+
76
+ // Simple response content
77
+ const responseContent: Content = {
78
+ text: 'hello world!',
79
+ actions: ['HELLO_WORLD'],
80
+ source: message.content.source,
81
+ };
82
+
83
+ // Call back with the hello world message if callback is provided
84
+ if (callback) {
85
+ await callback(responseContent);
86
+ }
87
+
88
+ return responseContent;
89
+ } catch (error) {
90
+ logger.error('Error in HELLO_WORLD action:', error);
91
+ throw error;
92
+ }
93
+ },
94
+
95
+ examples: [
96
+ [
97
+ {
98
+ name: '{{name1}}',
99
+ content: {
100
+ text: 'Can you say hello?',
101
+ },
102
+ },
103
+ {
104
+ name: '{{name2}}',
105
+ content: {
106
+ text: 'hello world!',
107
+ actions: ['HELLO_WORLD'],
108
+ },
109
+ },
110
+ ],
111
+ ],
112
+ };
113
+
114
+ /**
115
+ * Example Hello World Provider
116
+ * This demonstrates the simplest possible provider implementation
117
+ */
118
+ const helloWorldProvider: Provider = {
119
+ name: 'HELLO_WORLD_PROVIDER',
120
+ description: 'A simple example provider',
121
+
122
+ get: async (
123
+ _runtime: IAgentRuntime,
124
+ _message: Memory,
125
+ _state: State | undefined
126
+ ): Promise<ProviderResult> => {
127
+ return {
128
+ text: 'I am a provider',
129
+ values: {},
130
+ data: {},
131
+ };
132
+ },
133
+ };
134
+
135
+ export class StarterService extends Service {
136
+ static serviceType = 'starter';
137
+ capabilityDescription =
138
+ 'This is a starter service which is attached to the agent through the starter plugin.';
139
+ constructor(protected runtime: IAgentRuntime) {
140
+ super(runtime);
141
+ }
142
+
143
+ static async start(runtime: IAgentRuntime) {
144
+ logger.info(`*** Starting starter service - MODIFIED: ${new Date().toISOString()} ***`);
145
+ const service = new StarterService(runtime);
146
+ return service;
147
+ }
148
+
149
+ static async stop(runtime: IAgentRuntime) {
150
+ logger.info('*** TESTING DEV MODE - STOP MESSAGE CHANGED! ***');
151
+ // get the service from the runtime
152
+ const service = runtime.getService(StarterService.serviceType);
153
+ if (!service) {
154
+ throw new Error('Starter service not found');
155
+ }
156
+ service.stop();
157
+ }
158
+
159
+ async stop() {
160
+ logger.info('*** THIRD CHANGE - TESTING FILE WATCHING! ***');
161
+ }
162
+ }
163
+
164
+ export const starterPlugin: Plugin = {
165
+ name: 'plugin-starter',
166
+ description: 'Plugin starter for elizaOS',
167
+ config: {
168
+ EXAMPLE_PLUGIN_VARIABLE: process.env.EXAMPLE_PLUGIN_VARIABLE,
169
+ },
170
+ async init(config: Record<string, string>) {
171
+ logger.info('*** TESTING DEV MODE - PLUGIN MODIFIED AND RELOADED! ***');
172
+ try {
173
+ const validatedConfig = await configSchema.parseAsync(config);
174
+
175
+ // Set all environment variables at once
176
+ for (const [key, value] of Object.entries(validatedConfig)) {
177
+ if (value) process.env[key] = value;
178
+ }
179
+ } catch (error) {
180
+ if (error instanceof z.ZodError) {
181
+ throw new Error(
182
+ `Invalid plugin configuration: ${error.errors.map((e) => e.message).join(', ')}`
183
+ );
184
+ }
185
+ throw error;
186
+ }
187
+ },
188
+ models: {
189
+ [ModelType.TEXT_SMALL]: async (
190
+ _runtime,
191
+ { prompt, stopSequences = [] }: GenerateTextParams
192
+ ) => {
193
+ return 'Never gonna give you up, never gonna let you down, never gonna run around and desert you...';
194
+ },
195
+ [ModelType.TEXT_LARGE]: async (
196
+ _runtime,
197
+ {
198
+ prompt,
199
+ stopSequences = [],
200
+ maxTokens = 8192,
201
+ temperature = 0.7,
202
+ frequencyPenalty = 0.7,
203
+ presencePenalty = 0.7,
204
+ }: GenerateTextParams
205
+ ) => {
206
+ return 'Never gonna make you cry, never gonna say goodbye, never gonna tell a lie and hurt you...';
207
+ },
208
+ },
209
+ routes: [
210
+ {
211
+ name: 'hello-world-route',
212
+ path: '/helloworld',
213
+ type: 'GET',
214
+ handler: async (_req: any, res: any) => {
215
+ // send a response
216
+ res.json({
217
+ message: 'Hello World!',
218
+ });
219
+ },
220
+ },
221
+ {
222
+ name: 'current-time-route',
223
+ path: '/api/time',
224
+ type: 'GET',
225
+ handler: async (_req: any, res: any) => {
226
+ // Return current time in various formats
227
+ const now = new Date();
228
+ res.json({
229
+ timestamp: now.toISOString(),
230
+ unix: Math.floor(now.getTime() / 1000),
231
+ formatted: now.toLocaleString(),
232
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
233
+ });
234
+ },
235
+ },
236
+ ],
237
+ events: {
238
+ MESSAGE_RECEIVED: [
239
+ async (params) => {
240
+ logger.debug('MESSAGE_RECEIVED event received');
241
+ // print the keys
242
+ logger.debug(Object.keys(params));
243
+ },
244
+ ],
245
+ VOICE_MESSAGE_RECEIVED: [
246
+ async (params) => {
247
+ logger.debug('VOICE_MESSAGE_RECEIVED event received');
248
+ // print the keys
249
+ logger.debug(Object.keys(params));
250
+ },
251
+ ],
252
+ WORLD_CONNECTED: [
253
+ async (params) => {
254
+ logger.debug('WORLD_CONNECTED event received');
255
+ // print the keys
256
+ logger.debug(Object.keys(params));
257
+ },
258
+ ],
259
+ WORLD_JOINED: [
260
+ async (params) => {
261
+ logger.debug('WORLD_JOINED event received');
262
+ // print the keys
263
+ logger.debug(Object.keys(params));
264
+ },
265
+ ],
266
+ },
267
+ services: [StarterService],
268
+ actions: [helloWorldAction],
269
+ providers: [helloWorldProvider],
270
+ tests: [StarterPluginTestSuite],
271
+ // dependencies: ['@elizaos/plugin-knowledge'], <--- plugin dependecies go here (if requires another plugin)
272
+ };
273
+
274
+ export default starterPlugin;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Test exports for the starter plugin
3
+ * This file exports the test suite so it can be included in the plugin build
4
+ */
5
+
6
+ export { StarterPluginTestSuite } from './__tests__/e2e/starter-plugin';
@@ -0,0 +1,62 @@
1
+ import tailwindcssAnimate from 'tailwindcss-animate';
2
+
3
+ /** @type {import('tailwindcss').Config} */
4
+ export default {
5
+ darkMode: ['class'],
6
+ content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
7
+ theme: {
8
+ extend: {
9
+ container: {
10
+ center: true,
11
+ },
12
+ borderRadius: {
13
+ lg: 'var(--radius)',
14
+ md: 'calc(var(--radius) - 2px)',
15
+ sm: 'calc(var(--radius) - 4px)',
16
+ },
17
+ colors: {
18
+ background: 'hsl(var(--background))',
19
+ foreground: 'hsl(var(--foreground))',
20
+ card: {
21
+ DEFAULT: 'hsl(var(--card))',
22
+ foreground: 'hsl(var(--card-foreground))',
23
+ },
24
+ popover: {
25
+ DEFAULT: 'hsl(var(--popover))',
26
+ foreground: 'hsl(var(--popover-foreground))',
27
+ },
28
+ primary: {
29
+ DEFAULT: 'hsl(var(--primary))',
30
+ foreground: 'hsl(var(--primary-foreground))',
31
+ },
32
+ secondary: {
33
+ DEFAULT: 'hsl(var(--secondary))',
34
+ foreground: 'hsl(var(--secondary-foreground))',
35
+ },
36
+ muted: {
37
+ DEFAULT: 'hsl(var(--muted))',
38
+ foreground: 'hsl(var(--muted-foreground))',
39
+ },
40
+ accent: {
41
+ DEFAULT: 'hsl(var(--accent))',
42
+ foreground: 'hsl(var(--accent-foreground))',
43
+ },
44
+ destructive: {
45
+ DEFAULT: 'hsl(var(--destructive))',
46
+ foreground: 'hsl(var(--destructive-foreground))',
47
+ },
48
+ border: 'hsl(var(--border))',
49
+ input: 'hsl(var(--input))',
50
+ ring: 'hsl(var(--ring))',
51
+ chart: {
52
+ 1: 'hsl(var(--chart-1))',
53
+ 2: 'hsl(var(--chart-2))',
54
+ 3: 'hsl(var(--chart-3))',
55
+ 4: 'hsl(var(--chart-4))',
56
+ 5: 'hsl(var(--chart-5))',
57
+ },
58
+ },
59
+ },
60
+ },
61
+ plugins: [tailwindcssAnimate],
62
+ };
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "sourceMap": true,
6
+ "inlineSources": true,
7
+ "declaration": true
8
+ },
9
+ "include": ["src/**/*.ts"],
10
+ "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
11
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "dist",
4
+ "lib": ["ESNext", "dom"],
5
+ "target": "ESNext",
6
+ "module": "Preserve",
7
+ "moduleResolution": "Bundler",
8
+ "strict": false,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": false,
12
+ "allowImportingTsExtensions": true,
13
+ "emitDeclarationOnly": true,
14
+ "declaration": true,
15
+ "resolveJsonModule": true,
16
+ "noImplicitAny": false,
17
+ "allowJs": true,
18
+ "checkJs": false,
19
+ "noEmitOnError": false,
20
+ "moduleDetection": "force",
21
+ "allowArbitraryExtensions": true,
22
+ "jsx": "react",
23
+ "isolatedModules": false,
24
+ "noEmit": true
25
+ },
26
+ "include": ["src/**/*.ts"],
27
+ "exclude": ["src/__tests__/**/*", "e2e/**/*", "**/*.test.ts", "**/*.spec.ts"]
28
+ }
@@ -0,0 +1,20 @@
1
+ import { defineConfig } from 'tsup';
2
+
3
+ export default defineConfig({
4
+ entry: ['src/index.ts'],
5
+ outDir: 'dist',
6
+ tsconfig: './tsconfig.build.json', // Use build-specific tsconfig
7
+ sourcemap: true,
8
+ clean: true,
9
+ format: ['esm'], // Ensure you're targeting CommonJS
10
+ dts: true, // require DTS so we get d.ts in the dist folder on npm
11
+ external: [
12
+ 'dotenv', // Externalize dotenv to prevent bundling
13
+ 'fs', // Externalize fs to use Node.js built-in module
14
+ 'path', // Externalize other built-ins if necessary
15
+ 'https',
16
+ 'http',
17
+ '@elizaos/core',
18
+ 'zod',
19
+ ],
20
+ });
@@ -0,0 +1,20 @@
1
+ import react from '@vitejs/plugin-react-swc';
2
+ import { defineConfig } from 'vite';
3
+ import path from 'path';
4
+ import tailwindcss from '@tailwindcss/vite';
5
+
6
+ // https://vite.dev/config/
7
+ export default defineConfig({
8
+ plugins: [tailwindcss(), react()],
9
+ base: './',
10
+ build: {
11
+ emptyOutDir: false,
12
+ outDir: 'dist',
13
+ manifest: true,
14
+ },
15
+ resolve: {
16
+ alias: {
17
+ '@': path.resolve(__dirname, 'src'),
18
+ },
19
+ },
20
+ });