@elizaos/cli 1.0.9 → 1.0.11

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-Cxd2b7is.js → index-Cuyjmso1.js} +1434 -13725
  3. package/dist/assets/{index-Cxd2b7is.js.map → index-Cuyjmso1.js.map} +1 -1
  4. package/dist/assets/index-Df1AFSuJ.css +1 -0
  5. package/dist/assets/index-Df1AFSuJ.css.br +0 -0
  6. package/dist/assets/{index-CCyz05Yl.js → index-poChVCDJ.js} +72 -89
  7. package/dist/assets/index-poChVCDJ.js.br +0 -0
  8. package/dist/assets/index-poChVCDJ.js.map +1 -0
  9. package/dist/assets/vendor-DSdxb8P-.js.map +1 -1
  10. package/dist/{chunk-Z6GVELRX.js → chunk-HBV76MGW.js} +58 -29
  11. package/dist/{chunk-CVADLFW6.js → chunk-LQ6XHF53.js} +4543 -3043
  12. package/dist/{chunk-Y755OOSP.js → chunk-QLKBXRME.js} +883 -1553
  13. package/dist/{chunk-JWONHNLD.js → chunk-RIAWNDYI.js} +2 -9
  14. package/dist/{chunk-HZQCHL3J.js → chunk-TPLM6M7M.js} +13 -18
  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-PTOPJQEB.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-TDE6Y3CB.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
+ import {
2
+ logger,
3
+ type Character,
4
+ type IAgentRuntime,
5
+ type Project,
6
+ type ProjectAgent,
7
+ } from '@elizaos/core';
8
+ import mrTeePlugin from './plugin';
9
+ import { mrTeeCharacter } from './character';
10
+
11
+ /**
12
+ * Represents the default character (Eliza) with her specific attributes and behaviors.
13
+ * Eliza responds to a wide range of messages, is helpful and conversational.
14
+ * She interacts with users in a concise, direct, and helpful manner, using humor and empathy effectively.
15
+ * Eliza's responses are geared towards providing assistance on various topics while maintaining a friendly demeanor.
16
+ */
17
+ export const character: Character = mrTeeCharacter;
18
+
19
+ const initCharacter = ({ runtime }: { runtime: IAgentRuntime }) => {
20
+ logger.info(`Initializing character: ${mrTeeCharacter.name}`);
21
+ };
22
+
23
+ export const projectAgent: ProjectAgent = {
24
+ character: mrTeeCharacter,
25
+ init: async (runtime: IAgentRuntime) => await initCharacter({ runtime }),
26
+ plugins: [mrTeePlugin],
27
+ };
28
+
29
+ const project: Project = {
30
+ agents: [projectAgent],
31
+ };
32
+
33
+ export default project;
@@ -0,0 +1,169 @@
1
+ import type { Plugin } from '@elizaos/core';
2
+ import { type IAgentRuntime, Service, logger } from '@elizaos/core';
3
+ import { z } from 'zod';
4
+ import { type DeriveKeyResponse, TappdClient } from '@phala/dstack-sdk';
5
+ import { type PrivateKeyAccount, privateKeyToAccount } from 'viem/accounts';
6
+ import { keccak256 } from 'viem';
7
+ import { Keypair } from '@solana/web3.js';
8
+ import crypto from 'node:crypto';
9
+
10
+ // Create a custom TEE Client to make calls to the TEE through the Dstack SDK.
11
+
12
+ /**
13
+ * Define the configuration schema for the plugin with the following properties:
14
+ *
15
+ * @param {string} WALLET_SECRET_SALT - The secret salt for the wallet (min length of 1, optional)
16
+ * @returns {object} - The configured schema object
17
+ */
18
+ const configSchema = z.object({
19
+ WALLET_SECRET_SALT: z
20
+ .string()
21
+ .min(1, 'Wallet secret salt is not provided')
22
+ .optional()
23
+ .transform((val) => {
24
+ if (!val) {
25
+ logger.warn('Warning: Wallet secret salt is not provided');
26
+ }
27
+ return val;
28
+ }),
29
+ });
30
+
31
+ export class StarterService extends Service {
32
+ static serviceType = 'starter';
33
+ capabilityDescription = 'This is a starter service, can be customized for Mr. TEE.';
34
+ private teeClient: TappdClient;
35
+ private secretSalt: string;
36
+ constructor(protected runtime: IAgentRuntime) {
37
+ super(runtime);
38
+ this.teeClient = new TappdClient();
39
+ this.secretSalt = process.env.WALLET_SECRET_SALT || 'secret_salt';
40
+ }
41
+
42
+ static async start(runtime: IAgentRuntime) {
43
+ logger.info("*** Starting Mr. TEE's custom service (StarterService) ***");
44
+ const service = new StarterService(runtime);
45
+ try {
46
+ const deriveKeyResponse: DeriveKeyResponse = await service.teeClient.deriveKey(
47
+ service.secretSalt
48
+ );
49
+
50
+ // ECDSA Key
51
+ const hex = keccak256(deriveKeyResponse.asUint8Array());
52
+ const ecdsaKeypair: PrivateKeyAccount = privateKeyToAccount(hex);
53
+
54
+ // ED25519 Key
55
+ const uint8ArrayDerivedKey = deriveKeyResponse.asUint8Array();
56
+ const hash = crypto.createHash('sha256');
57
+ hash.update(uint8ArrayDerivedKey);
58
+ const seed = hash.digest();
59
+ const seedArray = new Uint8Array(seed);
60
+ const ed25519Keypair = Keypair.fromSeed(seedArray.slice(0, 32));
61
+
62
+ logger.log('ECDSA Key Derived Successfully!');
63
+ logger.log('ECDSA Keypair:', ecdsaKeypair.address);
64
+ logger.log('ED25519 Keypair:', ed25519Keypair.publicKey);
65
+ const signature = await ecdsaKeypair.signMessage({ message: 'Hello, world!' });
66
+ logger.log('Sign message w/ ECDSA keypair: Hello world!, Signature: ', signature);
67
+ } catch (error) {
68
+ // Handle TEE connection errors gracefully
69
+ if (error instanceof Error && error.message.includes('ENOENT')) {
70
+ logger.warn('TEE daemon not available - running in non-TEE mode for testing');
71
+ logger.warn('To run with TEE, ensure tappd is running at /var/run/tappd.sock');
72
+ } else {
73
+ logger.error('Error connecting to TEE:', error);
74
+ }
75
+ // Continue without TEE functionality for testing
76
+ }
77
+ return service;
78
+ }
79
+
80
+ static async stop(runtime: IAgentRuntime) {
81
+ logger.info("*** Stopping Mr. TEE's custom service (StarterService) ***");
82
+ const service = runtime.getService(StarterService.serviceType);
83
+ if (!service) {
84
+ throw new Error('Mr. TEE custom service (StarterService) not found');
85
+ }
86
+ service.stop();
87
+ }
88
+
89
+ async stop() {
90
+ logger.info("*** Stopping Mr. TEE's custom service instance (StarterService) ***");
91
+ }
92
+ }
93
+
94
+ const teeStarterPlugin: Plugin = {
95
+ name: 'mr-tee-starter-plugin',
96
+ description: "Mr. TEE's starter plugin - using plugin-tee for attestation",
97
+ config: {
98
+ TEE_MODE: process.env.TEE_MODE,
99
+ WALLET_SECRET_SALT: process.env.WALLET_SECRET_SALT,
100
+ },
101
+ async init(config: Record<string, string>) {
102
+ logger.info('*** Initializing Mr. TEE plugin ***');
103
+ try {
104
+ const validatedConfig = await configSchema.parseAsync(config);
105
+
106
+ // Set all environment variables at once
107
+ for (const [key, value] of Object.entries(validatedConfig)) {
108
+ if (value) process.env[key] = value;
109
+ }
110
+ } catch (error) {
111
+ if (error instanceof z.ZodError) {
112
+ throw new Error(
113
+ `Invalid plugin configuration: ${error.errors.map((e) => e.message).join(', ')}`
114
+ );
115
+ }
116
+ throw error;
117
+ }
118
+ },
119
+ routes: [
120
+ {
121
+ name: 'mr-tee-status-route',
122
+ path: '/mr-tee-status',
123
+ type: 'GET',
124
+ handler: async (
125
+ _req: Record<string, unknown>,
126
+ res: { json: (data: Record<string, unknown>) => void }
127
+ ) => {
128
+ res.json({
129
+ message: 'Mr. TEE is operational, fool!',
130
+ tee_mode: process.env.TEE_MODE || 'NOT SET',
131
+ tee_vendor: process.env.TEE_VENDOR || 'NOT SET',
132
+ });
133
+ },
134
+ },
135
+ ],
136
+ events: {
137
+ MESSAGE_RECEIVED: [
138
+ async (params) => {
139
+ logger.info(
140
+ '[MR_TEE_PLUGIN] MESSAGE_RECEIVED event',
141
+ params.message?.content?.text?.substring(0, 50)
142
+ );
143
+ },
144
+ ],
145
+ VOICE_MESSAGE_RECEIVED: [
146
+ async (params) => {
147
+ logger.info('[MR_TEE_PLUGIN] VOICE_MESSAGE_RECEIVED event');
148
+ },
149
+ ],
150
+ WORLD_CONNECTED: [
151
+ async (params) => {
152
+ logger.info('[MR_TEE_PLUGIN] WORLD_CONNECTED event');
153
+ },
154
+ ],
155
+ WORLD_JOINED: [
156
+ async (params) => {
157
+ logger.info('[MR_TEE_PLUGIN] WORLD_JOINED event');
158
+ },
159
+ ],
160
+ },
161
+ // Enable this service to run when TEE mode is enabled
162
+ services: [
163
+ /* StarterService */
164
+ ],
165
+ actions: [],
166
+ providers: [],
167
+ };
168
+
169
+ export default teeStarterPlugin;
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./src",
5
+ "outDir": "./dist",
6
+ "sourceMap": true,
7
+ "inlineSources": true,
8
+ "declaration": true,
9
+ "emitDeclarationOnly": true
10
+ },
11
+ "include": ["src/**/*.ts"],
12
+ "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
13
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "dist",
4
+ "rootDir": "src",
5
+ "lib": ["ESNext"],
6
+ "target": "ESNext",
7
+ "module": "Preserve",
8
+ "moduleResolution": "Bundler",
9
+ "strict": false,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "forceConsistentCasingInFileNames": false,
13
+ "allowImportingTsExtensions": true,
14
+ "declaration": true,
15
+ "emitDeclarationOnly": true,
16
+ "resolveJsonModule": true,
17
+ "noImplicitAny": false,
18
+ "allowJs": true,
19
+ "checkJs": false,
20
+ "noEmitOnError": false,
21
+ "moduleDetection": "force",
22
+ "allowArbitraryExtensions": true,
23
+ "baseUrl": ".",
24
+ "paths": {
25
+ "@elizaos/core": ["../../core/src"],
26
+ "@elizaos/core/*": ["../../core/src/*"]
27
+ }
28
+ },
29
+ "include": ["src/**/*.ts"]
30
+ }
@@ -0,0 +1,19 @@
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: false, // Skip DTS generation to avoid external import issues // Ensure you're targeting CommonJS
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
+ 'zod',
18
+ ],
19
+ });
@@ -16,7 +16,6 @@ import {
16
16
  configSchema,
17
17
  configureDatabaseSettings,
18
18
  confirmAction,
19
- convertToAudioBuffer,
20
19
  copyClientDist,
21
20
  copyDir,
22
21
  copyTemplate,
@@ -36,7 +35,6 @@ import {
36
35
  forkExists,
37
36
  forkRepository,
38
37
  formatEnvFileWithTemplate,
39
- getAudioMimeType,
40
38
  getAuthenticatedUser,
41
39
  getCliInstallTag,
42
40
  getConfigFilePath,
@@ -63,6 +61,7 @@ import {
63
61
  isRunningViaNpx,
64
62
  isUtf8Locale,
65
63
  isValidAnthropicKey,
64
+ isValidOllamaEndpoint,
66
65
  isValidOpenAIKey,
67
66
  isValidPostgresUrl,
68
67
  loadConfig,
@@ -72,6 +71,7 @@ import {
72
71
  mergeProcessEnvWithTemplate,
73
72
  migrateCliToBun,
74
73
  promptAndStoreAnthropicKey,
74
+ promptAndStoreOllamaConfig,
75
75
  promptAndStoreOpenAIKey,
76
76
  promptAndStorePostgresUrl,
77
77
  promptForEnvVars,
@@ -94,6 +94,7 @@ import {
94
94
  setupPgLite,
95
95
  showUpdateNotification,
96
96
  storeAnthropicKey,
97
+ storeOllamaConfig,
97
98
  storeOpenAIKey,
98
99
  storePgliteDataDir,
99
100
  storePostgresUrl,
@@ -104,11 +105,11 @@ import {
104
105
  validateGitHubToken,
105
106
  validatePluginEnvVars,
106
107
  writeEnvFile
107
- } from "./chunk-Y755OOSP.js";
108
+ } from "./chunk-QLKBXRME.js";
108
109
  import {
109
110
  runBunCommand
110
- } from "./chunk-JWONHNLD.js";
111
- import "./chunk-IEKLJDUU.js";
111
+ } from "./chunk-RIAWNDYI.js";
112
+ import "./chunk-WS4DWCDZ.js";
112
113
  import "./chunk-F24MS2YR.js";
113
114
  import "./chunk-567UPUC7.js";
114
115
  export {
@@ -125,7 +126,6 @@ export {
125
126
  configSchema,
126
127
  configureDatabaseSettings,
127
128
  confirmAction,
128
- convertToAudioBuffer,
129
129
  copyClientDist,
130
130
  copyDir,
131
131
  copyTemplate,
@@ -145,7 +145,6 @@ export {
145
145
  forkExists,
146
146
  forkRepository,
147
147
  formatEnvFileWithTemplate,
148
- getAudioMimeType,
149
148
  getAuthenticatedUser,
150
149
  getCliInstallTag,
151
150
  getConfigFilePath,
@@ -172,6 +171,7 @@ export {
172
171
  isRunningViaNpx,
173
172
  isUtf8Locale,
174
173
  isValidAnthropicKey,
174
+ isValidOllamaEndpoint,
175
175
  isValidOpenAIKey,
176
176
  isValidPostgresUrl,
177
177
  loadConfig,
@@ -181,6 +181,7 @@ export {
181
181
  mergeProcessEnvWithTemplate,
182
182
  migrateCliToBun,
183
183
  promptAndStoreAnthropicKey,
184
+ promptAndStoreOllamaConfig,
184
185
  promptAndStoreOpenAIKey,
185
186
  promptAndStorePostgresUrl,
186
187
  promptForEnvVars,
@@ -204,6 +205,7 @@ export {
204
205
  setupPgLite,
205
206
  showUpdateNotification,
206
207
  storeAnthropicKey,
208
+ storeOllamaConfig,
207
209
  storeOpenAIKey,
208
210
  storePgliteDataDir,
209
211
  storePostgresUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "elizaOS CLI - Manage your AI agents and plugins",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -33,26 +33,44 @@
33
33
  },
34
34
  "scripts": {
35
35
  "start": "bun run build && node dist/index.js start",
36
- "build": "npx tsup && bun run src/scripts/copy-client-dist.ts && bun run src/scripts/copy-templates.ts",
36
+ "build": "bun run src/scripts/copy-templates.ts && bun x tsup && bun run src/scripts/copy-client-dist.ts",
37
37
  "lint": "prettier --write ./src",
38
38
  "format": "prettier --write ./src",
39
39
  "format:check": "prettier --check ./src",
40
40
  "clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
41
- "test:cli": "bun test tests/commands/"
41
+ "test": "bun run test:all",
42
+ "test:all": "./run-all-tests.sh",
43
+ "test:unit": "bun test --timeout 30000",
44
+ "test:unit:watch": "bun test --watch --timeout 30000",
45
+ "test:unit:coverage": "bun test --coverage --timeout 30000",
46
+ "test:bats": "bats tests/bats",
47
+ "test:bats:commands": "bats tests/bats/commands",
48
+ "test:bats:integration": "bats tests/bats/integration",
49
+ "test:bats:e2e": "bats tests/bats/e2e",
50
+ "test:types": "tsc --noEmit",
51
+ "coverage": "c8 --reporter=lcov --reporter=text bun test",
52
+ "coverage:html": "c8 --reporter=html bun test && open coverage/index.html",
53
+ "test:cli": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" bun test tests/commands/ --timeout 120000"
42
54
  },
43
55
  "devDependencies": {
44
56
  "@anthropic-ai/sdk": "^0.40.0",
45
57
  "@babel/core": "^7.22.1",
46
58
  "@babel/parser": "^7.22.6",
59
+ "@esbuild-plugins/tsconfig-paths": "^0.1.2",
47
60
  "@types/babel__core": "^7.20.1",
48
61
  "@types/diff": "^5.0.3",
49
62
  "@types/fs-extra": "^11.0.1",
63
+ "@types/inquirer": "^9.0.8",
50
64
  "@types/lodash": "^4.17.7",
51
65
  "@types/node": "^22.15.3",
52
66
  "@types/prompts": "^2.4.2",
53
67
  "@types/semver": "^7.5.8",
54
68
  "axios": "^1.7.9",
69
+ "bats-assert": "^2.0.0",
70
+ "bats-support": "^0.3.0",
71
+ "bun-types": "^1.2.16",
55
72
  "commander": "^10.0.0",
73
+ "cross-env": "^7.0.3",
56
74
  "diff": "^5.1.0",
57
75
  "dotenv": "^16.5.0",
58
76
  "esbuild-plugin-copy": "^2.1.1",
@@ -77,20 +95,21 @@
77
95
  "ws": "^8.18.0",
78
96
  "yoctocolors": "^2.1.1"
79
97
  },
80
- "gitHead": "056c917d1068894f25419aa6ea7ce94b6b957c3d",
98
+ "gitHead": "3e09d9ded2b018f0f129706eb430ddeeee29f1cc",
81
99
  "dependencies": {
82
100
  "@clack/prompts": "^0.11.0",
83
101
  "@electric-sql/pglite": "^0.3.2",
84
- "@elizaos/core": "1.0.9",
85
- "@elizaos/plugin-bootstrap": "1.0.9",
102
+ "@elizaos/core": "1.0.11",
103
+ "@elizaos/plugin-anthropic": "^1.0.0",
104
+ "@elizaos/plugin-bootstrap": "1.0.8",
86
105
  "@elizaos/plugin-local-ai": "latest",
87
106
  "@elizaos/plugin-openai": "latest",
88
- "@elizaos/plugin-sql": "1.0.9",
107
+ "@elizaos/plugin-sql": "1.0.11",
108
+ "@elizaos/server": "1.0.11",
89
109
  "@noble/curves": "^1.6.0",
90
110
  "@sindresorhus/merge-streams": "^4.0.0",
91
111
  "@types/express": "^5.0.2",
92
112
  "@types/helmet": "^4.0.0",
93
- "@types/multer": "^1.4.12",
94
113
  "bun": "^1.2.13",
95
114
  "chokidar": "^4.0.3",
96
115
  "drizzle-orm": "^0.44.2",
@@ -98,7 +117,7 @@
98
117
  "express": "^5.1.0",
99
118
  "express-rate-limit": "^7.5.0",
100
119
  "helmet": "^8.1.0",
101
- "multer": "^2.0.0",
120
+ "inquirer": "^12.6.3",
102
121
  "octokit": "^4.1.3",
103
122
  "path-to-regexp": "^8.2.0",
104
123
  "semver": "^7.7.2",
@@ -44,9 +44,10 @@ ElizaOS provides a comprehensive testing structure for plugins:
44
44
  - **Integration Tests**: Test how components work together
45
45
  - Run with: `elizaos test component`
46
46
 
47
- - **End-to-End Tests** (`e2e/` directory):
47
+ - **End-to-End Tests** (`__tests__/e2e/` directory):
48
48
 
49
49
  - Test the plugin within a full ElizaOS runtime
50
+ - Validate complete user scenarios with a real agent
50
51
  - Run with: `elizaos test e2e`
51
52
 
52
53
  - **Running All Tests**:
@@ -72,26 +73,50 @@ describe('Integration: HelloWorld Action with StarterService', () => {
72
73
  });
73
74
  ```
74
75
 
75
- E2E tests use ElizaOS test interface:
76
+ E2E tests run in a real ElizaOS runtime:
76
77
 
77
78
  ```typescript
78
- // E2E test example (e2e/starter-plugin.test.ts)
79
- export class StarterPluginTestSuite implements TestSuite {
80
- name = 'plugin_starter_test_suite';
81
- tests = [
79
+ // E2E test example (__tests__/e2e/starter-plugin.ts)
80
+ export const StarterPluginTestSuite: TestSuite = {
81
+ name: 'plugin_starter_test_suite',
82
+ description: 'E2E tests for the starter plugin',
83
+ tests: [
82
84
  {
83
- name: 'example_test',
85
+ name: 'hello_world_action_test',
84
86
  fn: async (runtime) => {
85
- // Test plugin in a real runtime
87
+ // Simulate user asking agent to say hello
88
+ const testMessage = {
89
+ content: { text: 'Can you say hello?' }
90
+ };
91
+
92
+ // Execute action and capture response
93
+ const response = await helloWorldAction.handler(runtime, testMessage, ...);
94
+
95
+ // Verify agent responds with "hello world"
96
+ if (!response.text.includes('hello world')) {
97
+ throw new Error('Expected "hello world" in response');
98
+ }
86
99
  },
87
100
  },
88
- ];
89
- }
90
-
91
- export default new StarterPluginTestSuite();
101
+ ],
102
+ };
92
103
  ```
93
104
 
94
- The test utilities in `__tests__/test-utils.ts` provide mock objects and setup functions to simplify writing tests.
105
+ #### Key E2E Testing Features:
106
+
107
+ - **Real Runtime Environment**: Tests run with a fully initialized ElizaOS runtime
108
+ - **Plugin Interaction**: Test how your plugin behaves with the actual agent
109
+ - **Scenario Testing**: Validate complete user interactions, not just individual functions
110
+ - **No Mock Required**: Access real services, actions, and providers
111
+
112
+ #### Writing New E2E Tests:
113
+
114
+ 1. Add a new test object to the `tests` array in your test suite
115
+ 2. Each test receives the runtime instance as a parameter
116
+ 3. Throw errors to indicate test failures (no assertion library needed)
117
+ 4. See the comprehensive documentation in `__tests__/e2e/starter-plugin.ts` for detailed examples
118
+
119
+ The test utilities in `__tests__/test-utils.ts` provide mock objects and setup functions to simplify writing component tests.
95
120
 
96
121
  ## Publishing & Continuous Development
97
122
 
@@ -0,0 +1,6 @@
1
+ [test]
2
+ timeout = 60000
3
+ coverage = true
4
+
5
+ [test.env]
6
+ NODE_ENV = "test"
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from 'cypress';
2
+
3
+ export default defineConfig({
4
+ component: {
5
+ devServer: {
6
+ framework: 'react',
7
+ bundler: 'vite',
8
+ },
9
+ specPattern: 'src/__tests__/cypress/component/**/*.cy.{js,jsx,ts,tsx}',
10
+ supportFile: 'src/__tests__/cypress/support/component.ts',
11
+ indexHtmlFile: 'src/__tests__/cypress/support/component-index.html',
12
+ },
13
+ e2e: {
14
+ baseUrl: 'http://localhost:3000',
15
+ supportFile: 'src/__tests__/cypress/support/e2e.ts',
16
+ specPattern: 'src/__tests__/cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
17
+ },
18
+ });
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Agent Plugin View</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/frontend/index.tsx"></script>
12
+ </body>
13
+ </html>
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "@npm-username/plugin-name",
2
+ "name": "@elizaos/plugin-starter",
3
3
  "description": "${PLUGINDESCRIPTION}",
4
4
  "version": "0.1.0",
5
5
  "type": "module",
@@ -41,25 +41,37 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@elizaos/core": "^1.0.0",
44
+ "@tanstack/react-query": "^5.80.7",
45
+ "clsx": "^2.1.1",
46
+ "tailwindcss": "^4.1.10",
47
+ "tailwind-merge": "^3.3.1",
48
+ "vite": "^6.3.5",
44
49
  "zod": "3.24.2"
45
50
  },
46
51
  "peerDependencies": {},
47
52
  "devDependencies": {
53
+ "@cypress/react": "^9.0.1",
48
54
  "@elizaos/cli": "^1.0.0",
55
+ "@tailwindcss/vite": "^4.1.10",
56
+ "@testing-library/cypress": "^10.0.3",
57
+ "@vitejs/plugin-react-swc": "^3.10.2",
58
+ "cypress": "^14.4.1",
49
59
  "dotenv": "16.4.5",
50
60
  "prettier": "3.5.3",
61
+ "tailwindcss-animate": "^1.0.7",
51
62
  "tsup": "8.5.0",
52
- "typescript": "5.8.2",
53
- "vitest": "3.1.4"
63
+ "typescript": "5.8.2"
54
64
  },
55
65
  "scripts": {
56
66
  "start": "elizaos start",
57
67
  "dev": "elizaos dev",
58
- "build": "tsup",
68
+ "build": "tsc --noEmit && vite build && tsup",
59
69
  "lint": "prettier --write ./src",
60
- "test:component": "vitest run",
61
- "test:e2e": "elizaos test",
62
- "test": "npm run test:component && npm run test:e2e",
70
+ "test:component": "bun test",
71
+ "test:e2e": "bun test",
72
+ "test:e2e:manual": "node scripts/test-e2e-manual.js",
73
+ "test:cypress": "cypress run --component",
74
+ "test": "bun run test:component && bun run test:e2e",
63
75
  "publish": "elizaos publish",
64
76
  "format": "prettier --write ./src",
65
77
  "format:check": "prettier --check ./src"
@@ -0,0 +1,3 @@
1
+ export default {
2
+ plugins: {},
3
+ };