@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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Mr. TEE - ElizaOS TEE Agent</title>
|
|
7
|
+
<script>
|
|
8
|
+
// This will be injected by the server in production
|
|
9
|
+
window.ELIZA_CONFIG = {
|
|
10
|
+
agentId: 'test-agent-id',
|
|
11
|
+
apiBase: 'http://localhost:3000',
|
|
12
|
+
};
|
|
13
|
+
</script>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<div id="root"></div>
|
|
18
|
+
<script type="module" src="/index.tsx"></script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import './index.css';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { UUID } from '@elizaos/core';
|
|
6
|
+
|
|
7
|
+
const queryClient = new QueryClient();
|
|
8
|
+
|
|
9
|
+
// Define the interface for the ELIZA_CONFIG
|
|
10
|
+
interface ElizaConfig {
|
|
11
|
+
agentId: string;
|
|
12
|
+
apiBase: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Declare global window extension for TypeScript
|
|
16
|
+
declare global {
|
|
17
|
+
interface Window {
|
|
18
|
+
ELIZA_CONFIG?: ElizaConfig;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Main TEE Status route component
|
|
24
|
+
*/
|
|
25
|
+
function TEEStatusRoute() {
|
|
26
|
+
const config = window.ELIZA_CONFIG;
|
|
27
|
+
const agentId = config?.agentId;
|
|
28
|
+
|
|
29
|
+
// Apply dark mode to the root element
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
document.documentElement.classList.add('dark');
|
|
32
|
+
}, []);
|
|
33
|
+
|
|
34
|
+
if (!agentId) {
|
|
35
|
+
return (
|
|
36
|
+
<div className="p-4 text-center">
|
|
37
|
+
<div className="text-red-600 font-medium">Error: Agent ID not found</div>
|
|
38
|
+
<div className="text-sm text-gray-600 mt-2">
|
|
39
|
+
The server should inject the agent ID configuration.
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return <TEEProvider agentId={agentId as UUID} />;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* TEE Status provider component
|
|
50
|
+
*/
|
|
51
|
+
function TEEProvider({ agentId }: { agentId: UUID }) {
|
|
52
|
+
return (
|
|
53
|
+
<QueryClientProvider client={queryClient}>
|
|
54
|
+
<div className="min-h-screen bg-background">
|
|
55
|
+
<TEEStatusPanel agentId={agentId} />
|
|
56
|
+
</div>
|
|
57
|
+
</QueryClientProvider>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Initialize the application - no router needed for iframe
|
|
62
|
+
const rootElement = document.getElementById('root');
|
|
63
|
+
if (rootElement) {
|
|
64
|
+
createRoot(rootElement).render(<TEEStatusRoute />);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Define types for integration with agent UI system
|
|
68
|
+
export interface AgentPanel {
|
|
69
|
+
name: string;
|
|
70
|
+
path: string;
|
|
71
|
+
component: React.ComponentType<any>;
|
|
72
|
+
icon?: string;
|
|
73
|
+
public?: boolean;
|
|
74
|
+
shortLabel?: string; // Optional short label for mobile
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface PanelProps {
|
|
78
|
+
agentId: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Error types for better error handling
|
|
82
|
+
type TEEError = {
|
|
83
|
+
type: 'network' | 'timeout' | 'server' | 'parse' | 'unknown';
|
|
84
|
+
message: string;
|
|
85
|
+
details?: string;
|
|
86
|
+
retryable: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type TEEStatus = {
|
|
90
|
+
connected: boolean;
|
|
91
|
+
loading: boolean;
|
|
92
|
+
mode?: string;
|
|
93
|
+
vendor?: string;
|
|
94
|
+
error?: TEEError;
|
|
95
|
+
lastUpdated?: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// Create a network error helper
|
|
99
|
+
const createNetworkError = (error: Error): TEEError => {
|
|
100
|
+
// Network failure detection
|
|
101
|
+
if (error.name === 'NetworkError' || error.message.includes('Failed to fetch')) {
|
|
102
|
+
return {
|
|
103
|
+
type: 'network',
|
|
104
|
+
message: 'Network connection failed',
|
|
105
|
+
details: 'Unable to reach the TEE service. Please check your connection.',
|
|
106
|
+
retryable: true,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Timeout detection
|
|
111
|
+
if (error.name === 'AbortError' || error.message.includes('timeout')) {
|
|
112
|
+
return {
|
|
113
|
+
type: 'timeout',
|
|
114
|
+
message: 'Request timeout',
|
|
115
|
+
details: 'The TEE service is taking too long to respond.',
|
|
116
|
+
retryable: true,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Server error detection
|
|
121
|
+
if (error.message.includes('5')) {
|
|
122
|
+
return {
|
|
123
|
+
type: 'server',
|
|
124
|
+
message: 'Server error',
|
|
125
|
+
details: 'The TEE service encountered an internal error.',
|
|
126
|
+
retryable: true,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
type: 'unknown',
|
|
132
|
+
message: error.message || 'An unknown error occurred',
|
|
133
|
+
details: 'Please try again or contact support if the problem persists.',
|
|
134
|
+
retryable: true,
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Fetch with timeout and retry logic
|
|
139
|
+
const fetchWithRetry = async (
|
|
140
|
+
url: string,
|
|
141
|
+
options: { timeout?: number; retries?: number } = {}
|
|
142
|
+
): Promise<Response> => {
|
|
143
|
+
const { timeout = 10000, retries = 3 } = options;
|
|
144
|
+
|
|
145
|
+
for (let attempt = 1; attempt <= retries; attempt++) {
|
|
146
|
+
try {
|
|
147
|
+
const controller = new AbortController();
|
|
148
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
149
|
+
|
|
150
|
+
const response = await fetch(url, {
|
|
151
|
+
...options,
|
|
152
|
+
signal: controller.signal,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
clearTimeout(timeoutId);
|
|
156
|
+
|
|
157
|
+
if (!response.ok) {
|
|
158
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return response;
|
|
162
|
+
} catch (error) {
|
|
163
|
+
if (attempt === retries) {
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Wait before retry (exponential backoff)
|
|
168
|
+
await new Promise((resolve) => setTimeout(resolve, Math.pow(2, attempt - 1) * 1000));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
throw new Error('Max retries exceeded');
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* TEE Status panel component that shows TEE connection status and information
|
|
177
|
+
*/
|
|
178
|
+
const TEEStatusPanel: React.FC<PanelProps> = ({ agentId }) => {
|
|
179
|
+
const [teeStatus, setTeeStatus] = React.useState<TEEStatus>({
|
|
180
|
+
connected: false,
|
|
181
|
+
loading: true,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// Function to fetch TEE status with improved error handling
|
|
185
|
+
const fetchTEEStatus = React.useCallback(async () => {
|
|
186
|
+
try {
|
|
187
|
+
setTeeStatus((prev) => ({ ...prev, loading: true, error: undefined }));
|
|
188
|
+
|
|
189
|
+
const response = await fetchWithRetry('/mr-tee-status', {
|
|
190
|
+
timeout: 10000,
|
|
191
|
+
retries: 3,
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const data = await response.json();
|
|
195
|
+
|
|
196
|
+
setTeeStatus({
|
|
197
|
+
connected: true,
|
|
198
|
+
loading: false,
|
|
199
|
+
mode: data.tee_mode,
|
|
200
|
+
vendor: data.tee_vendor,
|
|
201
|
+
lastUpdated: new Date().toISOString(),
|
|
202
|
+
});
|
|
203
|
+
} catch (error) {
|
|
204
|
+
const teeError = createNetworkError(error as Error);
|
|
205
|
+
setTeeStatus({
|
|
206
|
+
connected: false,
|
|
207
|
+
loading: false,
|
|
208
|
+
error: teeError,
|
|
209
|
+
lastUpdated: new Date().toISOString(),
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}, []);
|
|
213
|
+
|
|
214
|
+
// Auto-retry function
|
|
215
|
+
const retryConnection = React.useCallback(() => {
|
|
216
|
+
fetchTEEStatus();
|
|
217
|
+
}, [fetchTEEStatus]);
|
|
218
|
+
|
|
219
|
+
React.useEffect(() => {
|
|
220
|
+
fetchTEEStatus();
|
|
221
|
+
|
|
222
|
+
// Set up periodic refresh every 30 seconds
|
|
223
|
+
const interval = setInterval(fetchTEEStatus, 30000);
|
|
224
|
+
|
|
225
|
+
return () => clearInterval(interval);
|
|
226
|
+
}, [fetchTEEStatus]);
|
|
227
|
+
|
|
228
|
+
return (
|
|
229
|
+
<div className="p-6">
|
|
230
|
+
<div className="max-w-4xl mx-auto">
|
|
231
|
+
<div className="mb-8">
|
|
232
|
+
<h1 className="text-3xl font-bold text-foreground mb-2">Mr. TEE Status</h1>
|
|
233
|
+
<p className="text-muted-foreground">
|
|
234
|
+
Agent ID: <code className="text-sm bg-muted px-2 py-1 rounded">{agentId}</code>
|
|
235
|
+
</p>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<div className="grid gap-6 md:grid-cols-2">
|
|
239
|
+
{/* Connection Status Card */}
|
|
240
|
+
<div className="bg-card rounded-lg p-6 border border-border">
|
|
241
|
+
<div className="flex items-center justify-between mb-4">
|
|
242
|
+
<h2 className="text-xl font-semibold">TEE Connection</h2>
|
|
243
|
+
{teeStatus.loading && (
|
|
244
|
+
<div className="animate-spin h-4 w-4 border-2 border-primary border-t-transparent rounded-full"></div>
|
|
245
|
+
)}
|
|
246
|
+
</div>
|
|
247
|
+
<div className="space-y-3">
|
|
248
|
+
<div className="flex items-center justify-between">
|
|
249
|
+
<span className="text-muted-foreground">Status</span>
|
|
250
|
+
<span
|
|
251
|
+
className={`tee-status-badge ${
|
|
252
|
+
teeStatus.loading
|
|
253
|
+
? 'loading'
|
|
254
|
+
: teeStatus.connected
|
|
255
|
+
? 'connected'
|
|
256
|
+
: 'disconnected'
|
|
257
|
+
}`}
|
|
258
|
+
>
|
|
259
|
+
{teeStatus.loading
|
|
260
|
+
? 'Connecting...'
|
|
261
|
+
: teeStatus.connected
|
|
262
|
+
? 'Connected'
|
|
263
|
+
: 'Disconnected'}
|
|
264
|
+
</span>
|
|
265
|
+
</div>
|
|
266
|
+
{teeStatus.mode && (
|
|
267
|
+
<div className="flex items-center justify-between">
|
|
268
|
+
<span className="text-muted-foreground">Mode</span>
|
|
269
|
+
<span className="text-foreground">{teeStatus.mode}</span>
|
|
270
|
+
</div>
|
|
271
|
+
)}
|
|
272
|
+
{teeStatus.vendor && (
|
|
273
|
+
<div className="flex items-center justify-between">
|
|
274
|
+
<span className="text-muted-foreground">Vendor</span>
|
|
275
|
+
<span className="text-foreground">{teeStatus.vendor}</span>
|
|
276
|
+
</div>
|
|
277
|
+
)}
|
|
278
|
+
{teeStatus.lastUpdated && (
|
|
279
|
+
<div className="flex items-center justify-between">
|
|
280
|
+
<span className="text-muted-foreground">Last Updated</span>
|
|
281
|
+
<span className="text-foreground text-sm">
|
|
282
|
+
{new Date(teeStatus.lastUpdated).toLocaleTimeString()}
|
|
283
|
+
</span>
|
|
284
|
+
</div>
|
|
285
|
+
)}
|
|
286
|
+
{teeStatus.error && (
|
|
287
|
+
<div className="mt-4 space-y-3">
|
|
288
|
+
<div className="p-3 bg-destructive/10 border border-destructive/20 rounded">
|
|
289
|
+
<div className="flex items-center justify-between mb-2">
|
|
290
|
+
<p className="text-sm font-medium text-destructive">
|
|
291
|
+
{teeStatus.error.message}
|
|
292
|
+
</p>
|
|
293
|
+
<span className="text-xs px-2 py-1 bg-destructive/20 text-destructive rounded">
|
|
294
|
+
{teeStatus.error.type}
|
|
295
|
+
</span>
|
|
296
|
+
</div>
|
|
297
|
+
{teeStatus.error.details && (
|
|
298
|
+
<p className="text-xs text-destructive/80">{teeStatus.error.details}</p>
|
|
299
|
+
)}
|
|
300
|
+
</div>
|
|
301
|
+
{teeStatus.error.retryable && (
|
|
302
|
+
<button
|
|
303
|
+
onClick={retryConnection}
|
|
304
|
+
disabled={teeStatus.loading}
|
|
305
|
+
className="w-full px-3 py-2 text-sm bg-primary text-primary-foreground rounded hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
306
|
+
>
|
|
307
|
+
{teeStatus.loading ? 'Retrying...' : 'Retry Connection'}
|
|
308
|
+
</button>
|
|
309
|
+
)}
|
|
310
|
+
</div>
|
|
311
|
+
)}
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
|
|
315
|
+
{/* TEE Information Card */}
|
|
316
|
+
<div className="bg-card rounded-lg p-6 border border-border">
|
|
317
|
+
<h2 className="text-xl font-semibold mb-4">TEE Information</h2>
|
|
318
|
+
<div className="space-y-3">
|
|
319
|
+
<div>
|
|
320
|
+
<h3 className="text-sm font-medium text-muted-foreground mb-1">About TEE</h3>
|
|
321
|
+
<p className="text-sm">
|
|
322
|
+
Trusted Execution Environment provides hardware-based security for sensitive
|
|
323
|
+
operations, including key derivation and cryptographic signing.
|
|
324
|
+
</p>
|
|
325
|
+
</div>
|
|
326
|
+
<div>
|
|
327
|
+
<h3 className="text-sm font-medium text-muted-foreground mb-1">Features</h3>
|
|
328
|
+
<ul className="text-sm space-y-1">
|
|
329
|
+
<li>• Secure key derivation</li>
|
|
330
|
+
<li>• Hardware-isolated execution</li>
|
|
331
|
+
<li>• Remote attestation support</li>
|
|
332
|
+
<li>• Protected memory regions</li>
|
|
333
|
+
</ul>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
{/* Agent Portrait */}
|
|
339
|
+
<div className="md:col-span-2 bg-card rounded-lg p-6 border border-border">
|
|
340
|
+
<h2 className="text-xl font-semibold mb-4">Agent Portrait</h2>
|
|
341
|
+
<div className="flex justify-center">
|
|
342
|
+
<img
|
|
343
|
+
src="/assets/mr-tee-portrait.jpg"
|
|
344
|
+
alt="Mr. TEE"
|
|
345
|
+
className="w-48 h-48 rounded-full border-4 border-primary"
|
|
346
|
+
/>
|
|
347
|
+
</div>
|
|
348
|
+
<p className="text-center mt-4 text-muted-foreground">
|
|
349
|
+
Mr. TEE - Your Trusted Execution Environment Agent
|
|
350
|
+
</p>
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
);
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
// Export the panel configuration for integration with the agent UI
|
|
359
|
+
export const panels: AgentPanel[] = [
|
|
360
|
+
{
|
|
361
|
+
name: 'TEE Status',
|
|
362
|
+
path: 'tee-status',
|
|
363
|
+
component: TEEStatusPanel,
|
|
364
|
+
icon: 'Shield',
|
|
365
|
+
public: false,
|
|
366
|
+
shortLabel: 'TEE',
|
|
367
|
+
},
|
|
368
|
+
];
|
|
369
|
+
|
|
370
|
+
export * from './utils';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Route } from '@elizaos/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Export panel routes for TEE status visualization
|
|
5
|
+
*/
|
|
6
|
+
export const panels: Route[] = [
|
|
7
|
+
{
|
|
8
|
+
type: 'GET',
|
|
9
|
+
path: '/public/tee-status',
|
|
10
|
+
name: 'TEE Status',
|
|
11
|
+
public: true,
|
|
12
|
+
handler: async (req: any, res: any, runtime: any) => {
|
|
13
|
+
// Serve the TEE status panel
|
|
14
|
+
res.sendFile('index.html', { root: 'dist/frontend' });
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { logger, type IAgentRuntime, type Project, type ProjectAgent } from '@elizaos/core';
|
|
2
|
-
import
|
|
3
|
-
import { mrTeeCharacter } from './character.ts';
|
|
2
|
+
import teeStarterPlugin, { StarterService } from './plugin.ts';
|
|
3
|
+
import { mrTeeCharacter as character } from './character.ts';
|
|
4
4
|
|
|
5
5
|
const initCharacter = ({ runtime }: { runtime: IAgentRuntime }) => {
|
|
6
|
-
logger.info(`Initializing character: ${
|
|
6
|
+
logger.info(`Initializing character: ${character.name}`);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
/* Import the TEE plugin if you want to use it for a custom TEE agent */
|
|
9
10
|
export const projectAgent: ProjectAgent = {
|
|
10
|
-
character
|
|
11
|
+
character,
|
|
11
12
|
init: async (runtime: IAgentRuntime) => await initCharacter({ runtime }),
|
|
12
|
-
plugins: [mrTeePlugin],
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const project: Project = {
|
|
16
16
|
agents: [projectAgent],
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
export {
|
|
19
|
+
export { character, teeStarterPlugin, StarterService };
|
|
20
20
|
export default project;
|