@elizaos/cli 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-2CUIHNPL.js → chunk-5GUS4CFO.js} +7 -2
  3. package/dist/{chunk-2ALAPQLV.js → chunk-E6XYTE3A.js} +296 -311
  4. package/dist/chunk-GXWWPFBO.js +39 -0
  5. package/dist/{chunk-I77ZRNYO.js → chunk-T2QDIXGU.js} +2 -2
  6. package/dist/commands/agent/actions/index.d.ts +5 -0
  7. package/dist/commands/agent/actions/index.js +2 -2
  8. package/dist/commands/agent/index.d.ts +2 -2
  9. package/dist/commands/agent/index.js +2 -2
  10. package/dist/commands/create/actions/index.js +3 -3
  11. package/dist/commands/create/index.js +4 -4
  12. package/dist/commands/shared/index.d.ts +11 -28
  13. package/dist/commands/shared/index.js +7 -3
  14. package/dist/index.js +541 -450
  15. package/dist/{registry-N626N4VG.js → registry-433S5F3Y.js} +2 -2
  16. package/dist/templates/plugin-quick-starter/.gitignore +66 -0
  17. package/dist/templates/plugin-quick-starter/.npmignore +5 -0
  18. package/dist/templates/plugin-quick-starter/package.json +11 -3
  19. package/dist/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +499 -146
  20. package/dist/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
  21. package/dist/templates/plugin-quick-starter/src/plugin.ts +7 -13
  22. package/dist/templates/plugin-starter/.gitignore +66 -0
  23. package/dist/templates/plugin-starter/.npmignore +5 -0
  24. package/dist/templates/plugin-starter/README.md +1 -1
  25. package/dist/templates/plugin-starter/package.json +11 -3
  26. package/dist/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
  27. package/dist/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
  28. package/dist/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
  29. package/dist/templates/plugin-starter/src/plugin.ts +18 -22
  30. package/dist/templates/project-starter/.gitignore +57 -0
  31. package/dist/templates/project-starter/.npmignore +11 -0
  32. package/dist/templates/project-starter/README.md +1 -1
  33. package/dist/templates/project-starter/package.json +4 -4
  34. package/dist/templates/project-starter/src/__tests__/env.test.ts +3 -1
  35. package/dist/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
  36. package/dist/templates/project-starter/src/__tests__/integration.test.ts +1 -1
  37. package/dist/templates/project-starter/tsup.config.ts +2 -1
  38. package/dist/templates/project-tee-starter/.dockerignore +64 -14
  39. package/dist/templates/project-tee-starter/.gitignore +57 -0
  40. package/dist/templates/project-tee-starter/.npmignore +6 -0
  41. package/dist/templates/project-tee-starter/Dockerfile +9 -5
  42. package/dist/templates/project-tee-starter/GUIDE.md +103 -42
  43. package/dist/templates/project-tee-starter/README.md +39 -19
  44. package/dist/templates/project-tee-starter/__tests__/build-order.test.ts +62 -0
  45. package/dist/templates/project-tee-starter/__tests__/character.test.ts +19 -17
  46. package/dist/templates/project-tee-starter/__tests__/config.test.ts +10 -3
  47. package/dist/templates/project-tee-starter/__tests__/env.test.ts +2 -1
  48. package/dist/templates/project-tee-starter/__tests__/file-structure.test.ts +14 -3
  49. package/dist/templates/project-tee-starter/__tests__/frontend.test.ts +459 -0
  50. package/dist/templates/project-tee-starter/__tests__/plugin.test.ts +4 -2
  51. package/dist/templates/project-tee-starter/__tests__/routes.test.ts +15 -6
  52. package/dist/templates/project-tee-starter/__tests__/tee-validation.test.ts +295 -0
  53. package/dist/templates/project-tee-starter/__tests__/vite-config-utils.ts +39 -0
  54. package/dist/templates/project-tee-starter/docker-compose.yaml +5 -2
  55. package/dist/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
  56. package/dist/templates/project-tee-starter/package.json +34 -14
  57. package/dist/templates/project-tee-starter/postcss.config.js +3 -0
  58. package/dist/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
  59. package/dist/templates/project-tee-starter/scripts/test-all.sh +82 -0
  60. package/dist/templates/project-tee-starter/src/frontend/index.css +106 -0
  61. package/dist/templates/project-tee-starter/src/frontend/index.html +20 -0
  62. package/dist/templates/project-tee-starter/src/frontend/index.tsx +370 -0
  63. package/dist/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
  64. package/dist/templates/project-tee-starter/src/frontend/utils.ts +6 -0
  65. package/dist/templates/project-tee-starter/src/index.ts +6 -6
  66. package/dist/templates/project-tee-starter/src/plugin.ts +209 -59
  67. package/dist/templates/project-tee-starter/tailwind.config.js +62 -0
  68. package/dist/templates/project-tee-starter/tsconfig.build.json +2 -2
  69. package/dist/templates/project-tee-starter/tsconfig.json +8 -5
  70. package/dist/templates/project-tee-starter/tsup.config.ts +3 -2
  71. package/dist/templates/project-tee-starter/vite.config.ts +39 -0
  72. package/dist/url-utils-CKc_Ebt_.d.ts +35 -0
  73. package/dist/{utils-H66532NB.js → utils-DBLSDYBF.js} +2 -2
  74. package/package.json +12 -7
  75. package/templates/plugin-quick-starter/.gitignore +66 -0
  76. package/templates/plugin-quick-starter/.npmignore +5 -0
  77. package/templates/plugin-quick-starter/package.json +11 -3
  78. package/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +499 -146
  79. package/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
  80. package/templates/plugin-quick-starter/src/plugin.ts +7 -13
  81. package/templates/plugin-starter/.gitignore +66 -0
  82. package/templates/plugin-starter/.npmignore +5 -0
  83. package/templates/plugin-starter/README.md +1 -1
  84. package/templates/plugin-starter/package.json +11 -3
  85. package/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
  86. package/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
  87. package/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
  88. package/templates/plugin-starter/src/plugin.ts +18 -22
  89. package/templates/project-starter/.gitignore +57 -0
  90. package/templates/project-starter/.npmignore +11 -0
  91. package/templates/project-starter/README.md +1 -1
  92. package/templates/project-starter/package.json +4 -4
  93. package/templates/project-starter/src/__tests__/env.test.ts +3 -1
  94. package/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
  95. package/templates/project-starter/src/__tests__/integration.test.ts +1 -1
  96. package/templates/project-starter/tsup.config.ts +2 -1
  97. package/templates/project-tee-starter/.dockerignore +64 -14
  98. package/templates/project-tee-starter/.gitignore +57 -0
  99. package/templates/project-tee-starter/.npmignore +6 -0
  100. package/templates/project-tee-starter/Dockerfile +9 -5
  101. package/templates/project-tee-starter/GUIDE.md +103 -42
  102. package/templates/project-tee-starter/README.md +39 -19
  103. package/templates/project-tee-starter/__tests__/build-order.test.ts +62 -0
  104. package/templates/project-tee-starter/__tests__/character.test.ts +19 -17
  105. package/templates/project-tee-starter/__tests__/config.test.ts +10 -3
  106. package/templates/project-tee-starter/__tests__/env.test.ts +2 -1
  107. package/templates/project-tee-starter/__tests__/file-structure.test.ts +14 -3
  108. package/templates/project-tee-starter/__tests__/frontend.test.ts +459 -0
  109. package/templates/project-tee-starter/__tests__/plugin.test.ts +4 -2
  110. package/templates/project-tee-starter/__tests__/routes.test.ts +15 -6
  111. package/templates/project-tee-starter/__tests__/tee-validation.test.ts +295 -0
  112. package/templates/project-tee-starter/__tests__/vite-config-utils.ts +39 -0
  113. package/templates/project-tee-starter/docker-compose.yaml +5 -2
  114. package/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
  115. package/templates/project-tee-starter/package.json +34 -14
  116. package/templates/project-tee-starter/postcss.config.js +3 -0
  117. package/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
  118. package/templates/project-tee-starter/scripts/test-all.sh +82 -0
  119. package/templates/project-tee-starter/src/frontend/index.css +106 -0
  120. package/templates/project-tee-starter/src/frontend/index.html +20 -0
  121. package/templates/project-tee-starter/src/frontend/index.tsx +370 -0
  122. package/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
  123. package/templates/project-tee-starter/src/frontend/utils.ts +6 -0
  124. package/templates/project-tee-starter/src/index.ts +6 -6
  125. package/templates/project-tee-starter/src/plugin.ts +209 -59
  126. package/templates/project-tee-starter/tailwind.config.js +62 -0
  127. package/templates/project-tee-starter/tsconfig.build.json +2 -2
  128. package/templates/project-tee-starter/tsconfig.json +8 -5
  129. package/templates/project-tee-starter/tsup.config.ts +3 -2
  130. package/templates/project-tee-starter/vite.config.ts +39 -0
  131. package/dist/chunk-4O6EZU37.js +0 -14
  132. package/dist/migration-guides/advanced-migration-guide.md +0 -459
  133. package/dist/migration-guides/completion-requirements.md +0 -379
  134. package/dist/migration-guides/integrated-migration-loop.md +0 -392
  135. package/dist/migration-guides/migration-guide.md +0 -712
  136. package/dist/migration-guides/prompt-and-generation-guide.md +0 -702
  137. package/dist/migration-guides/state-and-providers-guide.md +0 -544
  138. package/dist/migration-guides/testing-guide.md +0 -1021
  139. package/dist/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
  140. package/dist/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
  141. package/dist/templates/plugin-starter/dist/index.js +0 -387
  142. package/dist/templates/plugin-starter/dist/index.js.map +0 -1
  143. package/templates/plugin-starter/dist/.vite/manifest.json +0 -11
  144. package/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
  145. package/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
  146. package/templates/plugin-starter/dist/index.d.ts +0 -14
  147. package/templates/plugin-starter/dist/index.js +0 -387
  148. package/templates/plugin-starter/dist/index.js.map +0 -1
@@ -28,10 +28,10 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@elizaos/cli": "1.3.0",
32
- "@elizaos/core": "1.3.0",
33
- "@elizaos/plugin-bootstrap": "1.3.0",
34
- "@elizaos/plugin-sql": "1.3.0",
31
+ "@elizaos/cli": "1.3.2",
32
+ "@elizaos/core": "1.3.2",
33
+ "@elizaos/plugin-bootstrap": "1.3.2",
34
+ "@elizaos/plugin-sql": "1.3.2",
35
35
  "@tanstack/react-query": "^5.29.0",
36
36
  "clsx": "^2.1.1",
37
37
  "react": "^18.3.1",
@@ -35,7 +35,9 @@ describe('Environment Setup', () => {
35
35
  expect(fs.existsSync(packageJsonPath)).toBe(true);
36
36
 
37
37
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
38
- expect(packageJson).toHaveProperty('name', '@elizaos/project-starter');
38
+ expect(packageJson).toHaveProperty('name');
39
+ expect(typeof packageJson.name).toBe('string');
40
+ expect(packageJson.name.length).toBeGreaterThan(0);
39
41
  expect(packageJson).toHaveProperty('version');
40
42
  expect(packageJson).toHaveProperty('type', 'module');
41
43
  expect(packageJson).toHaveProperty('main');
@@ -59,8 +59,9 @@ describe('Project Structure Validation', () => {
59
59
  it('should have the correct package.json configuration', () => {
60
60
  const packageJson = JSON.parse(fs.readFileSync(path.join(rootDir, 'package.json'), 'utf8'));
61
61
 
62
- // Check package name
63
- expect(packageJson.name).toBe('@elizaos/project-starter');
62
+ // Check package name exists and is valid
63
+ expect(packageJson.name).toBeTruthy();
64
+ expect(typeof packageJson.name).toBe('string');
64
65
 
65
66
  // Check scripts
66
67
  expect(packageJson.scripts).toHaveProperty('build');
@@ -19,7 +19,7 @@ afterAll(() => {
19
19
  });
20
20
 
21
21
  // Skip in CI environments or when running automated tests without interaction
22
- const isCI = Boolean(process.env.CI) || process.env.NODE_ENV === 'test';
22
+ const isCI = Boolean(process.env.CI);
23
23
 
24
24
  /**
25
25
  * Integration tests demonstrate how multiple components of the project work together.
@@ -7,13 +7,14 @@ export default defineConfig({
7
7
  sourcemap: true,
8
8
  clean: false,
9
9
  format: ['esm'], // Ensure you're targeting CommonJS
10
- dts: false, // Skip DTS generation to avoid external import issues // Ensure you're targeting CommonJS
10
+ dts: true, // require DTS so we get d.ts in the dist folder on npm
11
11
  external: [
12
12
  'dotenv', // Externalize dotenv to prevent bundling
13
13
  'fs', // Externalize fs to use Node.js built-in module
14
14
  'path', // Externalize other built-ins if necessary
15
15
  'https',
16
16
  'http',
17
+ '@elizaos/core',
17
18
  'zod',
18
19
  ],
19
20
  });
@@ -1,20 +1,70 @@
1
- # Ignore node_modules from the build context
2
- node_modules
1
+ # Git files
2
+ .git
3
+ .gitignore
3
4
 
4
- # Ignore logs and temporary files
5
+ # Logs
5
6
  *.log
6
- *.tmp
7
- .DS_Store
7
+ logs/
8
8
 
9
- # Ignore Git files and metadata
10
- .gitignore
9
+ # Runtime data
10
+ pids
11
+ *.pid
12
+ *.seed
13
+ *.pid.lock
11
14
 
12
- # Ignore IDE and editor config files
13
- .vscode
14
- .idea
15
+ # Coverage
16
+ coverage/
17
+ .nyc_output/
18
+
19
+ # IDEs
20
+ .vscode/
21
+ .idea/
15
22
  *.swp
23
+ *.swo
24
+
25
+ # OS files
26
+ .DS_Store
27
+ Thumbs.db
28
+
29
+ # Build outputs (we'll build fresh in Docker)
30
+ dist/
31
+ build/
32
+ *.tsbuildinfo
33
+
34
+ # Test files
35
+ **/__tests__/
36
+ **/*.test.ts
37
+ **/*.test.tsx
38
+ **/*.spec.ts
39
+ **/*.spec.tsx
40
+ # Cypress directories removed
41
+
42
+ # Development files
43
+ **/*.map
44
+ .env.local
45
+ .env.development
46
+ .env.test
47
+
48
+ # Documentation
49
+ *.md
50
+ docs/
51
+ GUIDE.md
52
+ PR_REPORT.md
53
+
54
+ # Temporary files
55
+ tmp/
56
+ temp/
57
+ .cache/
58
+
59
+ # Package manager files (we'll use the ones in builder)
60
+ **/node_modules/
61
+ .pnp
62
+ .pnp.js
16
63
 
17
- # Ignore build artifacts from the host
18
- dist
19
- build
20
- .env
64
+ # ElizaOS specific
65
+ .eliza/
66
+ .elizadb/
67
+ pglite/
68
+ cache/
69
+ *.db
70
+ *.pglite
@@ -0,0 +1,57 @@
1
+ # Build outputs
2
+ dist/
3
+ node_modules/
4
+
5
+ # Environment files
6
+ .env
7
+ .env.local
8
+ .env.production
9
+ .env.staging
10
+ .env.development
11
+ .env.bak
12
+ *.env
13
+
14
+ # OS files
15
+ .DS_Store
16
+ Thumbs.db
17
+
18
+ # IDE files
19
+ .vscode/
20
+ .idea/
21
+ *.swp
22
+ *.swo
23
+
24
+ # Logs
25
+ *.log
26
+ npm-debug.log*
27
+ yarn-debug.log*
28
+ yarn-error.log*
29
+
30
+ # Runtime data
31
+ pids/
32
+ *.pid
33
+ *.seed
34
+ *.pid.lock
35
+
36
+ # Coverage directory used by tools like istanbul
37
+ coverage/
38
+
39
+ # Cache directories
40
+ .cache/
41
+ .npm/
42
+ .eslintcache
43
+
44
+ # Temporary folders
45
+ tmp/
46
+ temp/
47
+
48
+ # Database files
49
+ *.db
50
+ *.pglite
51
+ *.pglite3
52
+
53
+ # ElizaOS specific
54
+ .eliza/
55
+ .elizadb/
56
+ pglite/
57
+ cache/
@@ -0,0 +1,6 @@
1
+ .turbo
2
+ dist
3
+ node_modules
4
+ .env
5
+ *.env
6
+ .env.local
@@ -19,11 +19,10 @@ RUN npm install -g bun@1.2.5 turbo@2.3.3
19
19
 
20
20
  RUN ln -s /usr/bin/python3 /usr/bin/python
21
21
 
22
- COPY package.json tsconfig.json tsconfig.build.json tsup.config.ts ./
22
+ COPY bunfig.toml index.html package.json postcss.config.js tailwind.config.js tsconfig.json tsconfig.build.json tsup.config.ts vite.config.ts ./
23
23
  COPY src ./src
24
24
  COPY assets ./assets
25
- COPY elizadb ./elizadb
26
- COPY knowledge ./knowledge
25
+ COPY scripts ./scripts
27
26
 
28
27
  RUN bun install --no-cache
29
28
 
@@ -47,16 +46,21 @@ RUN apt-get update && \
47
46
 
48
47
  RUN npm install -g bun@1.2.5 turbo@2.3.3
49
48
 
49
+ COPY --from=builder /app/bunfig.toml ./bunfig.toml
50
+ # Cypress config removed
51
+ COPY --from=builder /app/index.html ./index.html
52
+ COPY --from=builder /app/postcss.config.js ./postcss.config.js
50
53
  COPY --from=builder /app/package.json ./
51
54
  COPY --from=builder /app/tsconfig.json ./
52
55
  COPY --from=builder /app/tsconfig.build.json ./
53
56
  COPY --from=builder /app/tsup.config.ts ./
57
+ COPY --from=builder /app/tailwind.config.js ./tailwind.config.js
58
+ COPY --from=builder /app/vite.config.ts ./vite.config.ts
54
59
  COPY --from=builder /app/node_modules ./node_modules
55
60
  COPY --from=builder /app/dist ./dist
56
- COPY --from=builder /app/elizadb ./elizadb
57
- COPY --from=builder /app/knowledge ./knowledge
58
61
  COPY --from=builder /app/assets ./assets
59
62
  COPY --from=builder /app/src ./src
63
+ COPY --from=builder /app/scripts ./scripts
60
64
 
61
65
  ENV NODE_ENV=production
62
66
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Mr. TEE** is the TEE Security Drill Sergeant, a battle-hardened character who forges secure, paranoid developers through tough love and cryptographic discipline. He embodies the spirit of Mr. T while preaching the gospel of hardware-based security.
6
6
 
7
- ### Core Traits:
7
+ ### Core Traits
8
8
 
9
9
  - **Personality**: No-nonsense drill sergeant with Mr. T's trademark grit
10
10
  - **Mission**: Transform developers into paranoid security experts
@@ -19,7 +19,7 @@ Mr. TEE uses the **@elizaos/plugin-tee** package's built-in `remoteAttestationAc
19
19
  - Provide attestation quotes with supporting data
20
20
  - Verify the secure enclave environment
21
21
 
22
- ### Example Attestation Requests:
22
+ ### Example Attestation Requests
23
23
 
24
24
  - "Can you provide proof that you're running in a secure environment?"
25
25
  - "Generate an attestation report"
@@ -28,6 +28,26 @@ Mr. TEE uses the **@elizaos/plugin-tee** package's built-in `remoteAttestationAc
28
28
 
29
29
  ## Configuration Steps
30
30
 
31
+ ### Prerequisites
32
+
33
+ Before starting deployment, ensure you have:
34
+
35
+ 1. **ElizaOS CLI installed**:
36
+
37
+ ```bash
38
+ npm install -g @elizaos/cli
39
+ ```
40
+
41
+ 2. **Docker Desktop**:
42
+
43
+ - Install Docker Desktop for your OS
44
+ - Start Docker Desktop
45
+ - Login to Docker Hub: `docker login`
46
+
47
+ 3. **Phala Cloud Account** (for TEE deployments):
48
+ - Create account at <https://dashboard.phala.network>
49
+ - Get your API key from the dashboard
50
+
31
51
  ### 1. Environment Variables
32
52
 
33
53
  Configure the following in your `.env` file:
@@ -54,46 +74,52 @@ REDPILL_API_KEY=your_redpill_key
54
74
  #### Local Development (No TEE)
55
75
 
56
76
  ```bash
57
- # Set TEE_MODE=NONE for development
77
+ # Set TEE_MODE=LOCAL or DOCKER for development
58
78
  bun install
59
79
  bun run dev
60
80
  ```
61
81
 
62
- #### Phala dStack Deployment (Cloud TEE)
82
+ #### Phala Cloud Deployment (Production TEE)
63
83
 
64
84
  ```bash
65
- # Install dstack CLI
66
- npm i -g phala
67
-
68
- # Deploy with TEE_MODE=PRODUCTION
69
- phala cvms create -c docker-compose.yaml --env-file .env
85
+ # Prerequisites:
86
+ # 1. Install ElizaOS CLI: npm install -g @elizaos/cli
87
+ # 2. Ensure Docker is running and you're logged in via Docker CLI
88
+ # 3. Set TEE_MODE=PRODUCTION in your .env file
89
+
90
+ # Step 1: Login to Phala Cloud (get API key from Phala Cloud Dashboard)
91
+ elizaos tee phala auth login
92
+
93
+ # Step 2: Build Docker Image for TEE deployment
94
+ elizaos tee phala docker build
95
+
96
+ # Step 3: Push Docker image to DockerHub
97
+ elizaos tee phala docker push
98
+
99
+ # Step 4: Create CVM (Confidential Virtual Machine) instance
100
+ elizaos tee phala cvms create \
101
+ -n elizaos-tee \
102
+ -c docker-compose.yaml \
103
+ --vcpu 2 \
104
+ --memory 4192 \
105
+ --disk-size 40 \
106
+ -e .env
107
+
108
+ # Step 5: Verify attestation (confirms TEE is running securely)
109
+ elizaos tee phala cvms attestation
110
+
111
+ # Step 6: (Optional) Upgrade CVM when you update your code
112
+ elizaos tee phala cvms upgrade -c docker-compose.yaml
70
113
  ```
71
114
 
72
- #### Intel TDX Deployment (Hardware TEE)
73
-
74
- ```bash
75
- # Requires TDX-enabled hardware
76
- # Set TEE_MODE=PRODUCTION
77
- # Ensure you are also running docker
78
-
79
- # Step0: Set your API Key from Phala Cloud Dashboard
80
- phala auth login
81
-
82
- # Step1: Build Docker Image
83
- phala docker build
115
+ ##### Deployment Parameters Explained
84
116
 
85
- # Step2: Publish Docker Image to DockerHub
86
- phala docker push
87
-
88
- # Step3: Update docker-compose.yaml file with your published Docker image and deploy CVM
89
- phala cvms create -c docker-compose.yaml -e .env
90
-
91
- # (Optional) Step4: Check attestation
92
- phala cvms attestation
93
-
94
- # (Optional) Step5: Upgrade CVM if updated changes
95
- phala cvms upgrade -c docker-compose.yaml
96
- ```
117
+ - `-n elizaos-tee`: Name of your CVM instance
118
+ - `-c docker-compose.yaml`: Configuration file
119
+ - `--vcpu 2`: Number of virtual CPUs
120
+ - `--memory 4192`: Memory in MB (4GB)
121
+ - `--disk-size 40`: Storage in GB
122
+ - `-e .env`: Environment file with your secrets
97
123
 
98
124
  ### 3. Platform Integration
99
125
 
@@ -101,13 +127,13 @@ Mr. TEE can connect to multiple platforms:
101
127
 
102
128
  #### Discord
103
129
 
104
- 1. Create Discord application at https://discord.com/developers
130
+ 1. Create Discord application at <https://discord.com/developers>
105
131
  2. Add bot permissions: Send Messages, Read Message History
106
132
  3. Set `DISCORD_APPLICATION_ID` and `DISCORD_API_TOKEN`
107
133
 
108
134
  #### Voice (ElevenLabs)
109
135
 
110
- 1. Get API key from https://elevenlabs.io
136
+ 1. Get API key from <https://elevenlabs.io>
111
137
  2. Choose or clone a voice ID
112
138
  3. Set `ELEVENLABS_API_KEY` and `ELEVENLABS_VOICE_ID`
113
139
 
@@ -138,40 +164,59 @@ Mr. TEE will provide:
138
164
 
139
165
  ## Security Best Practices
140
166
 
141
- ### Mr. TEE's Security Rules:
167
+ ### Mr. TEE's Security Rules
142
168
 
143
169
  1. **Never expose private keys** - Keep them in the TEE
144
170
  2. **Always verify attestation** - Trust but verify
145
171
  3. **Use secure channels** - Encrypt all communications
146
172
  4. **Audit regularly** - Check for vulnerabilities
147
173
  5. **Stay paranoid** - It's not paranoia if they're really after your keys
174
+ 6. **Rotate API keys regularly** - Fresh keys, fresh security
175
+ 7. **Never commit `.env` files** - Secrets stay secret
148
176
 
149
- ### TEE Guarantees:
177
+ ### TEE Guarantees
150
178
 
151
179
  - **Isolated Execution**: Code runs in hardware-protected memory
152
180
  - **Memory Encryption**: All data encrypted in RAM
153
181
  - **Remote Attestation**: Cryptographic proof of execution environment
154
182
  - **Secure Key Storage**: Keys never leave the enclave
183
+ - **Tamper Resistance**: Hardware protection against physical attacks
155
184
 
156
185
  ## Troubleshooting
157
186
 
158
- ### Common Issues:
187
+ ### Common Issues
159
188
 
160
189
  #### "I can't deploy my Agent"
161
190
 
162
- - Sign up for a Phala Cloud account at https://cloud.phala.network/register
191
+ - Sign up for a Phala Cloud account at <https://dashboard.phala.network>
163
192
  - Add credits to your account for CVM deployments
193
+ - Ensure Docker is running and you're logged in
164
194
 
165
195
  #### "Docker deployment failed"
166
196
 
167
- - Make sure to update the docker-compose.yaml file with your published Docker image
197
+ - Ensure Docker Desktop is started
198
+ - Check: `docker ps`
199
+ - Make sure to authenticate: `docker login`
168
200
  - Check your configuration and try to test docker locally
169
201
 
202
+ #### "Authentication failed"
203
+
204
+ - Verify your Phala API key
205
+ - Re-run: `elizaos tee phala auth login`
206
+ - Check API key from Phala Dashboard
207
+
208
+ #### "Build failures"
209
+
210
+ - Check your `.env` configuration
211
+ - Ensure all dependencies are installed: `bun install`
212
+ - Verify Docker is running properly
213
+
170
214
  #### "Attestation failed"
171
215
 
172
216
  - Check TEE_MODE is set to PRODUCTION if deployed to Phala Cloud
173
217
  - Verify network connectivity for attestation services
174
218
  - Ensure proper TEE initialization
219
+ - Check CVM logs in Phala Dashboard
175
220
 
176
221
  #### "Missing API keys"
177
222
 
@@ -179,7 +224,7 @@ Mr. TEE will provide:
179
224
  - Check .env file formatting
180
225
  - Restart after configuration changes
181
226
 
182
- ### Debug Commands:
227
+ ### Debug Commands
183
228
 
184
229
  ```bash
185
230
  # Check environment
@@ -192,6 +237,13 @@ docker logs [container_name] | grep TEE
192
237
  curl http://localhost:3000/health
193
238
  ```
194
239
 
240
+ ### Monitoring Your Deployment
241
+
242
+ - View CVM status: <https://dashboard.phala.network>
243
+ - Check attestation reports regularly
244
+ - Monitor resource usage and adjust if needed
245
+ - Set up alerts for critical events
246
+
195
247
  ## Advanced Configuration
196
248
 
197
249
  ### Custom Security Policies
@@ -222,13 +274,22 @@ The plugin-tee supports multiple TEE vendors:
222
274
  ### Documentation
223
275
 
224
276
  - [TEE Plugin Documentation](../plugin-tee/README.md)
225
- - [ElizaOS Security Guide](../../docs/security.md)
277
+ - [ElizaOS Documentation](https://eliza.how)
226
278
  - [Character Configuration](./src/character.ts)
279
+ - [Phala Network Docs](https://docs.phala.network)
227
280
 
228
281
  ### Support
229
282
 
230
283
  - GitHub Issues: Report bugs and feature requests
231
284
  - Discord Community: Get help from other developers
285
+ - ElizaOS Forums: Share experiences and best practices
286
+
287
+ ### Next Steps
288
+
289
+ - Test your agent's TEE capabilities with attestation commands
290
+ - Configure additional platform integrations (Discord, etc.)
291
+ - Implement custom TEE-aware actions
292
+ - Join the ElizaOS community for support
232
293
 
233
294
  Remember: Mr. TEE doesn't just talk about security—he lives it. Every interaction is an opportunity to strengthen the security posture of developers and systems alike. Stay paranoid, stay secure!
234
295
 
@@ -2,7 +2,15 @@
2
2
 
3
3
  ## 🔐 Overview
4
4
 
5
- The TEE Project Starter provides a foundation for building secure agents with Trusted Execution Environment (TEE) capabilities using ElizaOS. It features **Mr. TEE**, a security drill sergeant character who teaches TEE best practices while leveraging the **@elizaos/plugin-tee** for attestation and secure operations.
5
+ The TEE Project Starter provides a secure foundation for building AI agents with Trusted Execution Environment (TEE) capabilities using ElizaOS. It demonstrates best practices for secure agent deployment with hardware-based security through Phala Cloud's confidential computing infrastructure.
6
+
7
+ ### What You Get
8
+
9
+ - **Mr. TEE Character** - A security-focused AI personality that teaches TEE concepts with tough love
10
+ - **TEE Plugin Integration** - Pre-configured `@elizaos/plugin-tee` for remote attestation and secure operations
11
+ - **Multi-Platform Support** - Discord integration, voice synthesis, and extensible to other platforms
12
+ - **Production-Ready** - Docker configuration optimized for Phala Cloud TEE deployment
13
+ - **Security First** - Built-in paranoid security principles and best practices
6
14
 
7
15
  ## ✨ Key Features
8
16
 
@@ -17,9 +25,13 @@ The TEE Project Starter provides a foundation for building secure agents with Tr
17
25
  ### Prerequisites
18
26
 
19
27
  - Node.js 20+
20
- - Bun package manager
21
- - Docker (for TEE deployments)
22
- - API keys (OpenAI required, others optional)
28
+ - Bun package manager (`npm install -g bun`)
29
+ - Docker Desktop (for TEE deployments)
30
+ - ElizaOS CLI (`npm install -g @elizaos/cli`)
31
+ - API Keys:
32
+ - **Required**: OpenAI API key
33
+ - **Optional**: Discord, ElevenLabs, RedPill APIs
34
+ - **For TEE**: Phala Cloud account and API key
23
35
 
24
36
  ### Installation
25
37
 
@@ -122,29 +134,37 @@ bun run start
122
134
  ### Phala Cloud (Cloud TEE)
123
135
 
124
136
  ```bash
125
- npm install -g phala
126
- # Set TEE_MODE=PRODUCTION
127
- # Ensure you are also running docker
137
+ # Prerequisites:
138
+ # 1. Install the elizaos CLI: npm install -g @elizaos/cli
139
+ # 2. Ensure Docker is running and you're logged in via Docker CLI
140
+ # 3. Set TEE_MODE=PRODUCTION in your .env file
128
141
 
129
- # Step0: Set your API Key from Phala Cloud Dashboard
130
- phala auth login
142
+ # Step 1: Login to Phala Cloud (get API key from Phala Cloud Dashboard)
143
+ elizaos tee phala auth login
131
144
 
132
- # Step1: Build Docker Image
133
- phala docker build
145
+ # Step 2: Build Docker Image for TEE deployment [[memory:4308171]]
146
+ elizaos tee phala docker build
134
147
 
135
- # Step2: Publish Docker Image to DockerHub
136
- phala docker push
148
+ # Step 3: Push Docker image to DockerHub
149
+ elizaos tee phala docker push
137
150
 
138
- # Step3: Update docker-compose.yaml file with your published Docker image and deploy CVM
139
- phala cvms create -c docker-compose.yaml -e .env
151
+ # Step 4: Create CVM (Confidential Virtual Machine) instance
152
+ elizaos tee phala cvms create -n elizaos-tee -c docker-compose.yaml --vcpu 2 --memory 4192 --disk-size 40 -e .env
140
153
 
141
- # (Optional) Step4: Check attestation
142
- phala cvms attestation
154
+ # Step 5: Verify attestation (confirms TEE is running securely)
155
+ elizaos tee phala cvms attestation
143
156
 
144
- # (Optional) Step5: Upgrade CVM if updated changes
145
- phala cvms upgrade -c docker-compose.yaml
157
+ # Step 6: (Optional) Upgrade CVM when you update your code
158
+ elizaos tee phala cvms upgrade -c docker-compose.yaml
146
159
  ```
147
160
 
161
+ #### Important Notes
162
+
163
+ - **Docker Requirements**: Ensure Docker Desktop is running and you're authenticated (`docker login`)
164
+ - **API Key**: Get your Phala Cloud API key from the [Phala Dashboard](https://dashboard.phala.network)
165
+ - **TEE_MODE**: Must be set to `PRODUCTION` for real TEE deployment
166
+ - **Resource Allocation**: The example uses 2 vCPUs, 4GB RAM, and 40GB disk - adjust based on your needs
167
+
148
168
  ## 🎖️ Mr. TEE's Security Philosophy
149
169
 
150
170
  1. **Never expose private keys** - Keep them in the TEE
@@ -0,0 +1,62 @@
1
+ import { describe, expect, it, beforeAll, afterAll } from 'bun:test';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { $ } from 'bun';
5
+ import { getViteOutDir } from './vite-config-utils';
6
+
7
+ describe('Build Order Integration Test', () => {
8
+ const rootDir = path.resolve(__dirname, '..');
9
+ const distDir = path.join(rootDir, 'dist');
10
+ let viteBuildDir: string;
11
+ const tsupBuildMarker = path.join(distDir, 'index.js'); // TSup creates this
12
+
13
+ beforeAll(async () => {
14
+ // Get the actual vite build directory from config
15
+ const viteOutDirRelative = await getViteOutDir(rootDir);
16
+ viteBuildDir = path.join(rootDir, viteOutDirRelative);
17
+
18
+ // Clean dist directory before test
19
+ if (fs.existsSync(distDir)) {
20
+ await fs.promises.rm(distDir, { recursive: true, force: true });
21
+ }
22
+ });
23
+
24
+ afterAll(async () => {
25
+ // Clean up after test
26
+ if (fs.existsSync(distDir)) {
27
+ await fs.promises.rm(distDir, { recursive: true, force: true });
28
+ }
29
+ });
30
+
31
+ it('should ensure vite build outputs persist after tsup build', async () => {
32
+ // Run the full build process
33
+ await $`cd ${rootDir} && bun run build`;
34
+
35
+ // Check that both vite and tsup outputs exist
36
+ expect(fs.existsSync(viteBuildDir)).toBe(true);
37
+ expect(fs.existsSync(tsupBuildMarker)).toBe(true);
38
+
39
+ // Check vite built frontend files
40
+ console.log('viteBuildDir:', viteBuildDir);
41
+ console.log('viteBuildDir exists?', fs.existsSync(viteBuildDir));
42
+ const frontendFiles = fs.readdirSync(viteBuildDir);
43
+ console.log('frontendFiles:', frontendFiles);
44
+ expect(frontendFiles.length).toBeGreaterThan(0);
45
+
46
+ // Should have HTML entry point
47
+ expect(frontendFiles.some((file) => file.endsWith('.html'))).toBe(true);
48
+
49
+ // Should have assets directory (CSS/JS files are in assets/)
50
+ expect(frontendFiles.includes('assets')).toBe(true);
51
+
52
+ // Verify tsup also produced its expected outputs
53
+ const distFiles = fs.readdirSync(distDir);
54
+
55
+ // Should have tsup outputs (index.js)
56
+ expect(distFiles.some((file) => file === 'index.js')).toBe(true);
57
+
58
+ // Should still have vite build directory
59
+ const viteBuildDirName = path.basename(viteBuildDir);
60
+ expect(distFiles.includes(viteBuildDirName)).toBe(true);
61
+ }, 30000); // 30 second timeout for build process
62
+ });