@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.
- package/README.md +1 -1
- package/dist/{chunk-2CUIHNPL.js → chunk-5GUS4CFO.js} +7 -2
- package/dist/{chunk-2ALAPQLV.js → chunk-E6XYTE3A.js} +296 -311
- package/dist/chunk-GXWWPFBO.js +39 -0
- package/dist/{chunk-I77ZRNYO.js → chunk-T2QDIXGU.js} +2 -2
- package/dist/commands/agent/actions/index.d.ts +5 -0
- package/dist/commands/agent/actions/index.js +2 -2
- package/dist/commands/agent/index.d.ts +2 -2
- package/dist/commands/agent/index.js +2 -2
- package/dist/commands/create/actions/index.js +3 -3
- package/dist/commands/create/index.js +4 -4
- package/dist/commands/shared/index.d.ts +11 -28
- package/dist/commands/shared/index.js +7 -3
- package/dist/index.js +541 -450
- package/dist/{registry-N626N4VG.js → registry-433S5F3Y.js} +2 -2
- package/dist/templates/plugin-quick-starter/.gitignore +66 -0
- package/dist/templates/plugin-quick-starter/.npmignore +5 -0
- package/dist/templates/plugin-quick-starter/package.json +11 -3
- package/dist/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +499 -146
- package/dist/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
- package/dist/templates/plugin-quick-starter/src/plugin.ts +7 -13
- package/dist/templates/plugin-starter/.gitignore +66 -0
- package/dist/templates/plugin-starter/.npmignore +5 -0
- package/dist/templates/plugin-starter/README.md +1 -1
- package/dist/templates/plugin-starter/package.json +11 -3
- package/dist/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
- package/dist/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
- package/dist/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
- package/dist/templates/plugin-starter/src/plugin.ts +18 -22
- package/dist/templates/project-starter/.gitignore +57 -0
- package/dist/templates/project-starter/.npmignore +11 -0
- package/dist/templates/project-starter/README.md +1 -1
- package/dist/templates/project-starter/package.json +4 -4
- package/dist/templates/project-starter/src/__tests__/env.test.ts +3 -1
- package/dist/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
- package/dist/templates/project-starter/src/__tests__/integration.test.ts +1 -1
- package/dist/templates/project-starter/tsup.config.ts +2 -1
- package/dist/templates/project-tee-starter/.dockerignore +64 -14
- package/dist/templates/project-tee-starter/.gitignore +57 -0
- package/dist/templates/project-tee-starter/.npmignore +6 -0
- package/dist/templates/project-tee-starter/Dockerfile +9 -5
- package/dist/templates/project-tee-starter/GUIDE.md +103 -42
- package/dist/templates/project-tee-starter/README.md +39 -19
- package/dist/templates/project-tee-starter/__tests__/build-order.test.ts +62 -0
- package/dist/templates/project-tee-starter/__tests__/character.test.ts +19 -17
- package/dist/templates/project-tee-starter/__tests__/config.test.ts +10 -3
- package/dist/templates/project-tee-starter/__tests__/env.test.ts +2 -1
- package/dist/templates/project-tee-starter/__tests__/file-structure.test.ts +14 -3
- package/dist/templates/project-tee-starter/__tests__/frontend.test.ts +459 -0
- package/dist/templates/project-tee-starter/__tests__/plugin.test.ts +4 -2
- package/dist/templates/project-tee-starter/__tests__/routes.test.ts +15 -6
- package/dist/templates/project-tee-starter/__tests__/tee-validation.test.ts +295 -0
- package/dist/templates/project-tee-starter/__tests__/vite-config-utils.ts +39 -0
- package/dist/templates/project-tee-starter/docker-compose.yaml +5 -2
- package/dist/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
- package/dist/templates/project-tee-starter/package.json +34 -14
- package/dist/templates/project-tee-starter/postcss.config.js +3 -0
- package/dist/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
- package/dist/templates/project-tee-starter/scripts/test-all.sh +82 -0
- package/dist/templates/project-tee-starter/src/frontend/index.css +106 -0
- package/dist/templates/project-tee-starter/src/frontend/index.html +20 -0
- package/dist/templates/project-tee-starter/src/frontend/index.tsx +370 -0
- package/dist/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
- package/dist/templates/project-tee-starter/src/frontend/utils.ts +6 -0
- package/dist/templates/project-tee-starter/src/index.ts +6 -6
- package/dist/templates/project-tee-starter/src/plugin.ts +209 -59
- package/dist/templates/project-tee-starter/tailwind.config.js +62 -0
- package/dist/templates/project-tee-starter/tsconfig.build.json +2 -2
- package/dist/templates/project-tee-starter/tsconfig.json +8 -5
- package/dist/templates/project-tee-starter/tsup.config.ts +3 -2
- package/dist/templates/project-tee-starter/vite.config.ts +39 -0
- package/dist/url-utils-CKc_Ebt_.d.ts +35 -0
- package/dist/{utils-H66532NB.js → utils-DBLSDYBF.js} +2 -2
- package/package.json +12 -7
- package/templates/plugin-quick-starter/.gitignore +66 -0
- package/templates/plugin-quick-starter/.npmignore +5 -0
- package/templates/plugin-quick-starter/package.json +11 -3
- package/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +499 -146
- package/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
- package/templates/plugin-quick-starter/src/plugin.ts +7 -13
- package/templates/plugin-starter/.gitignore +66 -0
- package/templates/plugin-starter/.npmignore +5 -0
- package/templates/plugin-starter/README.md +1 -1
- package/templates/plugin-starter/package.json +11 -3
- package/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
- package/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
- package/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
- package/templates/plugin-starter/src/plugin.ts +18 -22
- package/templates/project-starter/.gitignore +57 -0
- package/templates/project-starter/.npmignore +11 -0
- package/templates/project-starter/README.md +1 -1
- package/templates/project-starter/package.json +4 -4
- package/templates/project-starter/src/__tests__/env.test.ts +3 -1
- package/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
- package/templates/project-starter/src/__tests__/integration.test.ts +1 -1
- package/templates/project-starter/tsup.config.ts +2 -1
- package/templates/project-tee-starter/.dockerignore +64 -14
- package/templates/project-tee-starter/.gitignore +57 -0
- package/templates/project-tee-starter/.npmignore +6 -0
- package/templates/project-tee-starter/Dockerfile +9 -5
- package/templates/project-tee-starter/GUIDE.md +103 -42
- package/templates/project-tee-starter/README.md +39 -19
- package/templates/project-tee-starter/__tests__/build-order.test.ts +62 -0
- package/templates/project-tee-starter/__tests__/character.test.ts +19 -17
- package/templates/project-tee-starter/__tests__/config.test.ts +10 -3
- package/templates/project-tee-starter/__tests__/env.test.ts +2 -1
- package/templates/project-tee-starter/__tests__/file-structure.test.ts +14 -3
- package/templates/project-tee-starter/__tests__/frontend.test.ts +459 -0
- package/templates/project-tee-starter/__tests__/plugin.test.ts +4 -2
- package/templates/project-tee-starter/__tests__/routes.test.ts +15 -6
- package/templates/project-tee-starter/__tests__/tee-validation.test.ts +295 -0
- package/templates/project-tee-starter/__tests__/vite-config-utils.ts +39 -0
- package/templates/project-tee-starter/docker-compose.yaml +5 -2
- package/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
- package/templates/project-tee-starter/package.json +34 -14
- package/templates/project-tee-starter/postcss.config.js +3 -0
- package/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
- package/templates/project-tee-starter/scripts/test-all.sh +82 -0
- package/templates/project-tee-starter/src/frontend/index.css +106 -0
- package/templates/project-tee-starter/src/frontend/index.html +20 -0
- package/templates/project-tee-starter/src/frontend/index.tsx +370 -0
- package/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
- package/templates/project-tee-starter/src/frontend/utils.ts +6 -0
- package/templates/project-tee-starter/src/index.ts +6 -6
- package/templates/project-tee-starter/src/plugin.ts +209 -59
- package/templates/project-tee-starter/tailwind.config.js +62 -0
- package/templates/project-tee-starter/tsconfig.build.json +2 -2
- package/templates/project-tee-starter/tsconfig.json +8 -5
- package/templates/project-tee-starter/tsup.config.ts +3 -2
- package/templates/project-tee-starter/vite.config.ts +39 -0
- package/dist/chunk-4O6EZU37.js +0 -14
- package/dist/migration-guides/advanced-migration-guide.md +0 -459
- package/dist/migration-guides/completion-requirements.md +0 -379
- package/dist/migration-guides/integrated-migration-loop.md +0 -392
- package/dist/migration-guides/migration-guide.md +0 -712
- package/dist/migration-guides/prompt-and-generation-guide.md +0 -702
- package/dist/migration-guides/state-and-providers-guide.md +0 -544
- package/dist/migration-guides/testing-guide.md +0 -1021
- package/dist/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
- package/dist/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
- package/dist/templates/plugin-starter/dist/index.js +0 -387
- package/dist/templates/plugin-starter/dist/index.js.map +0 -1
- package/templates/plugin-starter/dist/.vite/manifest.json +0 -11
- package/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
- package/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
- package/templates/plugin-starter/dist/index.d.ts +0 -14
- package/templates/plugin-starter/dist/index.js +0 -387
- 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.
|
|
32
|
-
"@elizaos/core": "1.3.
|
|
33
|
-
"@elizaos/plugin-bootstrap": "1.3.
|
|
34
|
-
"@elizaos/plugin-sql": "1.3.
|
|
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'
|
|
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).
|
|
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)
|
|
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:
|
|
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
|
-
#
|
|
2
|
-
|
|
1
|
+
# Git files
|
|
2
|
+
.git
|
|
3
|
+
.gitignore
|
|
3
4
|
|
|
4
|
-
#
|
|
5
|
+
# Logs
|
|
5
6
|
*.log
|
|
6
|
-
|
|
7
|
-
.DS_Store
|
|
7
|
+
logs/
|
|
8
8
|
|
|
9
|
-
#
|
|
10
|
-
|
|
9
|
+
# Runtime data
|
|
10
|
+
pids
|
|
11
|
+
*.pid
|
|
12
|
+
*.seed
|
|
13
|
+
*.pid.lock
|
|
11
14
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
.
|
|
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
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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/
|
|
@@ -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
|
|
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=
|
|
77
|
+
# Set TEE_MODE=LOCAL or DOCKER for development
|
|
58
78
|
bun install
|
|
59
79
|
bun run dev
|
|
60
80
|
```
|
|
61
81
|
|
|
62
|
-
#### Phala
|
|
82
|
+
#### Phala Cloud Deployment (Production TEE)
|
|
63
83
|
|
|
64
84
|
```bash
|
|
65
|
-
#
|
|
66
|
-
npm
|
|
67
|
-
|
|
68
|
-
#
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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://
|
|
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
|
-
-
|
|
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
|
|
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
|
|
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
|
-
-
|
|
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
|
-
|
|
126
|
-
#
|
|
127
|
-
# Ensure you
|
|
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
|
-
#
|
|
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
|
-
#
|
|
133
|
-
phala docker build
|
|
145
|
+
# Step 2: Build Docker Image for TEE deployment [[memory:4308171]]
|
|
146
|
+
elizaos tee phala docker build
|
|
134
147
|
|
|
135
|
-
#
|
|
136
|
-
phala docker push
|
|
148
|
+
# Step 3: Push Docker image to DockerHub
|
|
149
|
+
elizaos tee phala docker push
|
|
137
150
|
|
|
138
|
-
#
|
|
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
|
-
#
|
|
142
|
-
phala cvms attestation
|
|
154
|
+
# Step 5: Verify attestation (confirms TEE is running securely)
|
|
155
|
+
elizaos tee phala cvms attestation
|
|
143
156
|
|
|
144
|
-
# (Optional)
|
|
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
|
+
});
|