@elizaos/plugin-tee 1.0.0-beta.74 → 1.0.0-beta.76

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 CHANGED
@@ -8,9 +8,19 @@ For Eliza agents running in a TEE, it's crucial to demonstrate this secure execu
8
8
 
9
9
  ## Requirements
10
10
 
11
- - A TEE-enabled environment is required (e.g., Intel TDX).
11
+ - A TEE-enabled environment is required (e.g., Intel TDX) use [Phala Cloud](https://cloud.phala.network) for easy deployment.
12
12
  - Configuration within Eliza to enable and utilize this plugin's features.
13
13
 
14
+ The plugin requires the following environment variables:
15
+
16
+ ```env
17
+ # For the environment you are running the TEE plugin. For local and container development, use `LOCAL` or `DOCKER`. For production deployments, use `PRODUCTION`.
18
+ TEE_MODE=LOCAL|DOCKER|PRODUCTION
19
+ # Secret salt for your default agent to generate a key from through the derive key provider
20
+ WALLET_SECRET_SALT=your_secret_salt
21
+ # TEE_VENDOR only supports Phala at this time, but adding a vendor is easy and can be done to support more TEE Vendors in the TEE Plugin
22
+ TEE_VENDOR=phala
23
+
14
24
  ## Features
15
25
 
16
26
  This plugin offers the following core TEE functionalities:
@@ -34,6 +44,8 @@ Based on the source code (`src/`):
34
44
  - **Providers**:
35
45
  - `remoteAttestationProvider.ts`: Implements the logic for interacting with the underlying TEE platform or attestation service (like Phala) to generate the attestation report.
36
46
  - `deriveKeyProvider.ts`: Implements the logic for TEE-specific key derivation.
47
+ - **Services**
48
+ - `service.ts`: TEE Service to allow agents to generate keys from `deriveKeyProvider` for EVM, Solana, and raw `DeriveKeyResponse` that will return the `key`, `certificate_chain` and the `Uint8Array` with `asUint8Array(max_length?: number)`.
37
49
  - **Vendors**:
38
50
  - `vendors/phala.ts`: Contains specific implementation details for interacting with the Phala Network's attestation services.
39
51
  - `vendors/index.ts`, `vendors/types.ts`: Support vendor integration.
@@ -55,6 +67,7 @@ To utilize the features of this plugin:
55
67
  Example (Conceptual):
56
68
 
57
69
  ```typescript
70
+ import import { PhalaDeriveKeyProvider, PhalaRemoteAttestationProvider } from '@elizaos/tee-plugin';
58
71
  // Assuming access to the runtime and its services/actions
59
72
 
60
73
  // Requesting remote attestation
@@ -63,10 +76,12 @@ async function getAttestation(
63
76
  userData: string
64
77
  ): Promise<AttestationReport | null> {
65
78
  try {
66
- // Potentially using an action defined by this plugin
67
- const report = await runtime.invokeAction('tee/getRemoteAttestation', { userData });
68
- console.log('Received attestation report:', report);
69
- return report;
79
+ const provider = new PhalaRemoteAttestationProvider(teeMode);
80
+
81
+ const attestation = await provider.generateAttestation(userData);
82
+ const attestationData = hexToUint8Array(attestation.quote);
83
+ const raQuote = await uploadUint8Array(attestationData);
84
+ return attestation;
70
85
  } catch (error) {
71
86
  console.error('Failed to get remote attestation:', error);
72
87
  return null;
@@ -74,12 +89,36 @@ async function getAttestation(
74
89
  }
75
90
 
76
91
  // Deriving a key
77
- async function deriveAgentKey(runtime: IAgentRuntime, salt: string): Promise<CryptoKey | null> {
92
+ async function deriveAgentKeys(
93
+ runtime: IAgentRuntime, salt: string
94
+ ): Promise<ProviderResult | null> {
78
95
  try {
79
96
  // Potentially using a service/provider interface
80
- const keyProvider = runtime.getService<IDeriveKeyProvider>(/* ServiceType or ID */);
81
- const key = await keyProvider.deriveKey(salt);
82
- console.log('Derived key successfully.');
97
+ const provider = new PhalaDeriveKeyProvider(teeMode)
98
+ const secretSalt = runtime.getSetting('WALLET_SECRET_SALT') || 'secret_salt';
99
+ const solanaKeypair = await provider.deriveEd25519Keypair(secretSalt, 'solana', agentId);
100
+ const evmKeypair = await provider.deriveEcdsaKeypair(secretSalt, 'evm', agentId);
101
+
102
+ // Original data structure
103
+ const walletData = {
104
+ solana: solanaKeypair.keypair.publicKey,
105
+ evm: evmKeypair.keypair.address,
106
+ };
107
+
108
+ // Values for template injection
109
+ const values = {
110
+ solana_public_key: solanaKeypair.keypair.publicKey.toString(),
111
+ evm_address: evmKeypair.keypair.address,
112
+ };
113
+
114
+ // Text representation
115
+ const text = `Solana Public Key: ${values.solana_public_key}\nEVM Address: ${values.evm_address}`;
116
+
117
+ return {
118
+ data: walletData,
119
+ values: values,
120
+ text: text,
121
+ };
83
122
  return key;
84
123
  } catch (error) {
85
124
  console.error('Failed to derive key:', error);
@@ -87,5 +126,3 @@ async function deriveAgentKey(runtime: IAgentRuntime, salt: string): Promise<Cry
87
126
  }
88
127
  }
89
128
  ```
90
-
91
- **Note:** The exact method calls (`invokeAction`, `getService`, service types/IDs) are illustrative and depend on the final integration pattern within Eliza.
package/package.json CHANGED
@@ -1,19 +1,21 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-tee",
3
- "version": "1.0.0-beta.74",
3
+ "version": "1.0.0-beta.76",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
- "@elizaos/core": "^1.0.0-beta.74",
8
+ "@elizaos/core": "^1.0.0-beta.76",
9
9
  "@phala/dstack-sdk": "0.1.11",
10
- "@solana/web3.js": "1.98.0",
11
- "viem": "2.23.11"
10
+ "@solana/web3.js": "1.98.2",
11
+ "viem": "2.29.4"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@types/node": "^22.15.3",
15
15
  "prettier": "3.5.3",
16
- "tsup": "8.4.0"
16
+ "tsup": "8.5.0",
17
+ "typescript": "5.8.3",
18
+ "vitest": "^3.1.3"
17
19
  },
18
20
  "scripts": {
19
21
  "build": "tsup",
@@ -26,5 +28,19 @@
26
28
  "publishConfig": {
27
29
  "access": "public"
28
30
  },
29
- "gitHead": "d5bd5c43bfebeb7ac02f9e029f924cb6cd5c2ec7"
31
+ "gitHead": "646c632924826e2b75c2304a75ee56959fe4a460",
32
+ "agentConfig": {
33
+ "pluginType": "elizaos:plugin:1.0.0",
34
+ "pluginParameters": {
35
+ "TEE_VENDOR": {
36
+ "type": "string"
37
+ },
38
+ "TEE_MODE": {
39
+ "type": "string"
40
+ },
41
+ "WALLET_SECRET_SALT": {
42
+ "type": "string"
43
+ }
44
+ }
45
+ }
30
46
  }
package/tsup.config.ts CHANGED
@@ -6,7 +6,7 @@ export default defineConfig({
6
6
  tsconfig: './tsconfig.build.json', // Use build-specific tsconfig
7
7
  sourcemap: true,
8
8
  format: ['esm'], // Ensure you're targeting CommonJS
9
- dts: true, // Skip DTS generation to avoid external import issues // Ensure you're targeting CommonJS
9
+ dts: true,
10
10
  external: [
11
11
  'dotenv', // Externalize dotenv to prevent bundling
12
12
  'fs', // Externalize fs to use Node.js built-in module
package/dist/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { Plugin } from '@elizaos/core';
2
- export { TeeVendorConfig } from '@elizaos/core';
3
-
4
- /**
5
- * TEE plugin for Trusted Execution Environment integration
6
- */
7
- declare const teePlugin: Plugin;
8
-
9
- export { teePlugin as default, teePlugin };
package/dist/index.js DELETED
@@ -1,500 +0,0 @@
1
- // src/index.ts
2
- import { logger as logger5 } from "@elizaos/core";
3
-
4
- // src/vendors/types.ts
5
- var TeeVendorNames = {
6
- PHALA: "phala"
7
- };
8
-
9
- // src/actions/remoteAttestationAction.ts
10
- import { logger as logger2 } from "@elizaos/core";
11
-
12
- // src/providers/remoteAttestationProvider.ts
13
- import { logger } from "@elizaos/core";
14
- import { TEEMode } from "@elizaos/core";
15
- import { TappdClient } from "@phala/dstack-sdk";
16
-
17
- // src/providers/base.ts
18
- var DeriveKeyProvider = class {
19
- };
20
- var RemoteAttestationProvider = class {
21
- };
22
-
23
- // src/providers/remoteAttestationProvider.ts
24
- var PhalaRemoteAttestationProvider = class extends RemoteAttestationProvider {
25
- client;
26
- constructor(teeMode) {
27
- super();
28
- let endpoint;
29
- switch (teeMode) {
30
- case TEEMode.LOCAL:
31
- endpoint = "http://localhost:8090";
32
- logger.log("TEE: Connecting to local simulator at localhost:8090");
33
- break;
34
- case TEEMode.DOCKER:
35
- endpoint = "http://host.docker.internal:8090";
36
- logger.log("TEE: Connecting to simulator via Docker at host.docker.internal:8090");
37
- break;
38
- case TEEMode.PRODUCTION:
39
- endpoint = void 0;
40
- logger.log("TEE: Running in production mode without simulator");
41
- break;
42
- default:
43
- throw new Error(`Invalid TEE_MODE: ${teeMode}. Must be one of: LOCAL, DOCKER, PRODUCTION`);
44
- }
45
- this.client = endpoint ? new TappdClient(endpoint) : new TappdClient();
46
- }
47
- async generateAttestation(reportData, hashAlgorithm) {
48
- try {
49
- logger.log("Generating attestation for: ", reportData);
50
- const tdxQuote = await this.client.tdxQuote(reportData, hashAlgorithm);
51
- const rtmrs = tdxQuote.replayRtmrs();
52
- logger.log(`rtmr0: ${rtmrs[0]}
53
- rtmr1: ${rtmrs[1]}
54
- rtmr2: ${rtmrs[2]}
55
- rtmr3: ${rtmrs[3]}f`);
56
- const quote = {
57
- quote: tdxQuote.quote,
58
- timestamp: Date.now()
59
- };
60
- logger.log("Remote attestation quote: ", quote);
61
- return quote;
62
- } catch (error) {
63
- console.error("Error generating remote attestation:", error);
64
- throw new Error(
65
- `Failed to generate TDX Quote: ${error instanceof Error ? error.message : "Unknown error"}`
66
- );
67
- }
68
- }
69
- };
70
- var phalaRemoteAttestationProvider = {
71
- name: "phala-remote-attestation",
72
- get: async (runtime, message) => {
73
- const teeMode = runtime.getSetting("TEE_MODE");
74
- const provider = new PhalaRemoteAttestationProvider(teeMode);
75
- const agentId = runtime.agentId;
76
- try {
77
- const attestationMessage = {
78
- agentId,
79
- timestamp: Date.now(),
80
- message: {
81
- entityId: message.entityId,
82
- roomId: message.roomId,
83
- content: message.content.text || ""
84
- }
85
- };
86
- logger.log("Generating attestation for: ", JSON.stringify(attestationMessage));
87
- const attestation = await provider.generateAttestation(JSON.stringify(attestationMessage));
88
- return {
89
- text: `Your Agent's remote attestation is: ${JSON.stringify(attestation)}`,
90
- data: {
91
- attestation
92
- },
93
- values: {
94
- quote: attestation.quote,
95
- timestamp: attestation.timestamp.toString()
96
- }
97
- };
98
- } catch (error) {
99
- console.error("Error in remote attestation provider:", error);
100
- throw new Error(
101
- `Failed to generate TDX Quote: ${error instanceof Error ? error.message : "Unknown error"}`
102
- );
103
- }
104
- }
105
- };
106
-
107
- // src/utils.ts
108
- function hexToUint8Array(hex) {
109
- const hexString = hex.trim().replace(/^0x/, "");
110
- if (!hexString) {
111
- throw new Error("Invalid hex string");
112
- }
113
- if (hexString.length % 2 !== 0) {
114
- throw new Error("Invalid hex string");
115
- }
116
- const array = new Uint8Array(hexString.length / 2);
117
- for (let i = 0; i < hexString.length; i += 2) {
118
- const byte = Number.parseInt(hexString.slice(i, i + 2), 16);
119
- if (Number.isNaN(byte)) {
120
- throw new Error("Invalid hex string");
121
- }
122
- array[i / 2] = byte;
123
- }
124
- return array;
125
- }
126
-
127
- // src/actions/remoteAttestationAction.ts
128
- async function uploadUint8Array(data) {
129
- const blob = new Blob([data], { type: "application/octet-stream" });
130
- const formData = new FormData();
131
- formData.append("file", blob, "quote.bin");
132
- return await fetch("https://proof.t16z.com/api/upload", {
133
- method: "POST",
134
- body: formData
135
- });
136
- }
137
- var phalaRemoteAttestationAction = {
138
- name: "REMOTE_ATTESTATION",
139
- similes: [
140
- "REMOTE_ATTESTATION",
141
- "TEE_REMOTE_ATTESTATION",
142
- "TEE_ATTESTATION",
143
- "TEE_QUOTE",
144
- "ATTESTATION",
145
- "TEE_ATTESTATION_QUOTE"
146
- ],
147
- description: "Generate a remote attestation to prove that the agent is running in a TEE",
148
- handler: async (runtime, message, _state, _options, callback) => {
149
- try {
150
- const attestationMessage = {
151
- agentId: runtime.agentId,
152
- timestamp: Date.now(),
153
- message: {
154
- entityId: message.entityId,
155
- roomId: message.roomId,
156
- content: message.content.text || ""
157
- }
158
- };
159
- const teeMode = runtime.getSetting("TEE_MODE");
160
- logger2.debug(`Tee mode: ${teeMode}`);
161
- logger2.debug(`Attestation message: ${JSON.stringify(attestationMessage)}`);
162
- const provider = new PhalaRemoteAttestationProvider(teeMode);
163
- const attestation = await provider.generateAttestation(JSON.stringify(attestationMessage));
164
- const attestationData = hexToUint8Array(attestation.quote);
165
- const response = await uploadUint8Array(attestationData);
166
- const data = await response.json();
167
- if (callback) {
168
- callback({
169
- text: `Here's my \u{1F9FE} RA Quote \u{1FAE1}
170
- https://proof.t16z.com/reports/${data.checksum}`,
171
- actions: ["NONE"]
172
- });
173
- }
174
- return true;
175
- } catch (error) {
176
- console.error("Failed to fetch remote attestation: ", error);
177
- return false;
178
- }
179
- },
180
- validate: async (_runtime) => {
181
- return true;
182
- },
183
- examples: [
184
- [
185
- {
186
- name: "{{name1}}",
187
- content: {
188
- text: "If you are running in a TEE, generate a remote attestation"
189
- }
190
- },
191
- {
192
- name: "{{agentName}}",
193
- content: {
194
- text: "Of course, one second...",
195
- actions: ["REMOTE_ATTESTATION"]
196
- }
197
- }
198
- ],
199
- [
200
- {
201
- name: "{{name1}}",
202
- content: {
203
- text: "Yo I wanna attest to this message, yo! Can you generate an attestatin for me, please?"
204
- }
205
- },
206
- {
207
- name: "{{agentName}}",
208
- content: {
209
- text: "I got you, fam! Lemme hit the cloud and get you a quote in a jiffy!",
210
- actions: ["REMOTE_ATTESTATION"]
211
- }
212
- }
213
- ],
214
- [
215
- {
216
- name: "{{name1}}",
217
- content: {
218
- text: "It was a long day, I got a lot done though. I went to the creek and skipped some rocks. Then I decided to take a walk off the natural path. I ended up in a forest I was unfamiliar with. Slowly, I lost the way back and it was dark. A whisper from deep inside said something I could barely make out. The hairs on my neck stood up and then a clear high pitched voice said, 'You are not ready to leave yet! SHOW ME YOUR REMOTE ATTESTATION!'"
219
- }
220
- },
221
- {
222
- name: "{{agentName}}",
223
- content: {
224
- text: "Oh, dear...lemme find that for you",
225
- actions: ["REMOTE_ATTESTATION"]
226
- }
227
- }
228
- ]
229
- ]
230
- };
231
-
232
- // src/providers/deriveKeyProvider.ts
233
- import { logger as logger3 } from "@elizaos/core";
234
- import { TEEMode as TEEMode2 } from "@elizaos/core";
235
- import { TappdClient as TappdClient2 } from "@phala/dstack-sdk";
236
- import { toViemAccount } from "@phala/dstack-sdk/viem";
237
- import { toKeypair } from "@phala/dstack-sdk/solana";
238
- var PhalaDeriveKeyProvider = class extends DeriveKeyProvider {
239
- client;
240
- raProvider;
241
- constructor(teeMode) {
242
- super();
243
- let endpoint;
244
- switch (teeMode) {
245
- case TEEMode2.LOCAL:
246
- endpoint = "http://localhost:8090";
247
- logger3.log("TEE: Connecting to local simulator at localhost:8090");
248
- break;
249
- case TEEMode2.DOCKER:
250
- endpoint = "http://host.docker.internal:8090";
251
- logger3.log("TEE: Connecting to simulator via Docker at host.docker.internal:8090");
252
- break;
253
- case TEEMode2.PRODUCTION:
254
- endpoint = void 0;
255
- logger3.log("TEE: Running in production mode without simulator");
256
- break;
257
- default:
258
- throw new Error(`Invalid TEE_MODE: ${teeMode}. Must be one of: LOCAL, DOCKER, PRODUCTION`);
259
- }
260
- this.client = endpoint ? new TappdClient2(endpoint) : new TappdClient2();
261
- this.raProvider = new PhalaRemoteAttestationProvider(teeMode);
262
- }
263
- async generateDeriveKeyAttestation(agentId, publicKey, subject) {
264
- const deriveKeyData = {
265
- agentId,
266
- publicKey,
267
- subject
268
- };
269
- const reportdata = JSON.stringify(deriveKeyData);
270
- logger3.log("Generating Remote Attestation Quote for Derive Key...");
271
- const quote = await this.raProvider.generateAttestation(reportdata);
272
- logger3.log("Remote Attestation Quote generated successfully!");
273
- return quote;
274
- }
275
- /**
276
- * Derives a raw key from the given path and subject.
277
- * @param path - The path to derive the key from. This is used to derive the key from the root of trust.
278
- * @param subject - The subject to derive the key from. This is used for the certificate chain.
279
- * @returns The derived key.
280
- */
281
- async rawDeriveKey(path, subject) {
282
- try {
283
- if (!path || !subject) {
284
- logger3.error("Path and Subject are required for key derivation");
285
- }
286
- logger3.log("Deriving Raw Key in TEE...");
287
- const derivedKey = await this.client.deriveKey(path, subject);
288
- logger3.log("Raw Key Derived Successfully!");
289
- return derivedKey;
290
- } catch (error) {
291
- logger3.error("Error deriving raw key:", error);
292
- throw error;
293
- }
294
- }
295
- /**
296
- * Derives an Ed25519 keypair from the given path and subject.
297
- * @param path - The path to derive the key from. This is used to derive the key from the root of trust.
298
- * @param subject - The subject to derive the key from. This is used for the certificate chain.
299
- * @param agentId - The agent ID to generate an attestation for.
300
- * @returns An object containing the derived keypair and attestation.
301
- */
302
- async deriveEd25519Keypair(path, subject, agentId) {
303
- try {
304
- if (!path || !subject) {
305
- logger3.error("Path and Subject are required for key derivation");
306
- }
307
- logger3.log("Deriving Key in TEE...");
308
- const derivedKey = await this.client.deriveKey(path, subject);
309
- const keypair = toKeypair(derivedKey);
310
- const attestation = await this.generateDeriveKeyAttestation(
311
- agentId,
312
- keypair.publicKey.toBase58()
313
- );
314
- logger3.log("Key Derived Successfully!");
315
- return { keypair, attestation };
316
- } catch (error) {
317
- logger3.error("Error deriving key:", error);
318
- throw error;
319
- }
320
- }
321
- /**
322
- * Derives an ECDSA keypair from the given path and subject.
323
- * @param path - The path to derive the key from. This is used to derive the key from the root of trust.
324
- * @param subject - The subject to derive the key from. This is used for the certificate chain.
325
- * @param agentId - The agent ID to generate an attestation for. This is used for the certificate chain.
326
- * @returns An object containing the derived keypair and attestation.
327
- */
328
- async deriveEcdsaKeypair(path, subject, agentId) {
329
- try {
330
- if (!path || !subject) {
331
- logger3.error("Path and Subject are required for key derivation");
332
- }
333
- logger3.log("Deriving ECDSA Key in TEE...");
334
- const deriveKeyResponse = await this.client.deriveKey(path, subject);
335
- const keypair = toViemAccount(deriveKeyResponse);
336
- const attestation = await this.generateDeriveKeyAttestation(agentId, keypair.address);
337
- logger3.log("ECDSA Key Derived Successfully!");
338
- return { keypair, attestation };
339
- } catch (error) {
340
- logger3.error("Error deriving ecdsa key:", error);
341
- throw error;
342
- }
343
- }
344
- };
345
- var phalaDeriveKeyProvider = {
346
- name: "phala-derive-key",
347
- get: async (runtime, _message) => {
348
- const teeMode = runtime.getSetting("TEE_MODE");
349
- const provider = new PhalaDeriveKeyProvider(teeMode);
350
- const agentId = runtime.agentId;
351
- try {
352
- if (!runtime.getSetting("WALLET_SECRET_SALT")) {
353
- logger3.error("Wallet secret salt is not configured in settings");
354
- return {
355
- data: null,
356
- values: {},
357
- text: "Wallet secret salt is not configured in settings"
358
- };
359
- }
360
- try {
361
- const secretSalt = runtime.getSetting("WALLET_SECRET_SALT") || "secret_salt";
362
- const solanaKeypair = await provider.deriveEd25519Keypair(secretSalt, "solana", agentId);
363
- const evmKeypair = await provider.deriveEcdsaKeypair(secretSalt, "evm", agentId);
364
- const walletData = {
365
- solana: solanaKeypair.keypair.publicKey,
366
- evm: evmKeypair.keypair.address
367
- };
368
- const values = {
369
- solana_public_key: solanaKeypair.keypair.publicKey.toString(),
370
- evm_address: evmKeypair.keypair.address
371
- };
372
- const text = `Solana Public Key: ${values.solana_public_key}
373
- EVM Address: ${values.evm_address}`;
374
- return {
375
- data: walletData,
376
- values,
377
- text
378
- };
379
- } catch (error) {
380
- logger3.error("Error creating PublicKey:", error);
381
- return {
382
- data: null,
383
- values: {},
384
- text: `Error creating PublicKey: ${error instanceof Error ? error.message : "Unknown error"}`
385
- };
386
- }
387
- } catch (error) {
388
- logger3.error(
389
- "Error in derive key provider:",
390
- error instanceof Error ? error.message : "Unknown error"
391
- );
392
- return {
393
- data: null,
394
- values: {},
395
- text: `Failed to fetch derive key information: ${error instanceof Error ? error.message : "Unknown error"}`
396
- };
397
- }
398
- }
399
- };
400
-
401
- // src/vendors/phala.ts
402
- var PhalaVendor = class {
403
- type = TeeVendorNames.PHALA;
404
- /**
405
- * Returns an array of actions.
406
- *
407
- * @returns {Array} An array containing the remote attestation action.
408
- */
409
- getActions() {
410
- return [phalaRemoteAttestationAction];
411
- }
412
- /**
413
- * Retrieve the list of providers.
414
- *
415
- * @returns {Array<Function>} An array containing two provider functions: deriveKeyProvider and remoteAttestationProvider.
416
- */
417
- getProviders() {
418
- return [phalaDeriveKeyProvider, phalaRemoteAttestationProvider];
419
- }
420
- /**
421
- * Returns the name of the plugin.
422
- * @returns {string} The name of the plugin.
423
- */
424
- getName() {
425
- return "phala-tee-plugin";
426
- }
427
- /**
428
- * Get the description of the function
429
- * @returns {string} The description of the function
430
- */
431
- getDescription() {
432
- return "Phala TEE Cloud to Host Eliza Agents";
433
- }
434
- };
435
-
436
- // src/vendors/index.ts
437
- var vendors = {
438
- [TeeVendorNames.PHALA]: new PhalaVendor()
439
- };
440
- var getVendor = (type) => {
441
- const vendor = vendors[type];
442
- if (!vendor) {
443
- throw new Error(`Unsupported TEE vendor type: ${type}`);
444
- }
445
- return vendor;
446
- };
447
-
448
- // src/service.ts
449
- import { Service, ServiceType, logger as logger4 } from "@elizaos/core";
450
- var TEEService = class _TEEService extends Service {
451
- provider;
452
- config;
453
- static serviceType = ServiceType.TEE;
454
- capabilityDescription = "Trusted Execution Environment for secure key management";
455
- constructor(runtime, config = {}) {
456
- super(runtime);
457
- this.config = config;
458
- const teeMode = config.teeMode || runtime.getSetting("TEE_MODE");
459
- this.provider = new PhalaDeriveKeyProvider(teeMode);
460
- }
461
- static async start(runtime) {
462
- const teeMode = runtime.getSetting("TEE_MODE");
463
- logger4.log(`Starting TEE service with mode: ${teeMode}`);
464
- const teeService = new _TEEService(runtime, { teeMode });
465
- return teeService;
466
- }
467
- async stop() {
468
- logger4.log("Stopping TEE service");
469
- }
470
- async deriveEcdsaKeypair(path, subject, agentId) {
471
- logger4.log("TEE Service: Deriving ECDSA keypair");
472
- return await this.provider.deriveEcdsaKeypair(path, subject, agentId);
473
- }
474
- async deriveEd25519Keypair(path, subject, agentId) {
475
- logger4.log("TEE Service: Deriving Ed25519 keypair");
476
- return await this.provider.deriveEd25519Keypair(path, subject, agentId);
477
- }
478
- };
479
-
480
- // src/index.ts
481
- var defaultVendor = getVendor(TeeVendorNames.PHALA);
482
- var teePlugin = {
483
- name: "tee-plugin",
484
- description: "Trusted Execution Environment (TEE) integration plugin",
485
- init: async (config, runtime) => {
486
- const vendorName = config.TEE_VENDOR || runtime.getSetting("TEE_VENDOR") || TeeVendorNames.PHALA;
487
- logger5.info(`Initializing TEE with vendor: ${vendorName}`);
488
- logger5.info(`TEE initialized with vendor: ${vendorName}`);
489
- },
490
- actions: defaultVendor.getActions(),
491
- evaluators: [],
492
- providers: defaultVendor.getProviders(),
493
- services: [TEEService]
494
- };
495
- var index_default = teePlugin;
496
- export {
497
- index_default as default,
498
- teePlugin
499
- };
500
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/vendors/types.ts","../src/actions/remoteAttestationAction.ts","../src/providers/remoteAttestationProvider.ts","../src/providers/base.ts","../src/utils.ts","../src/providers/deriveKeyProvider.ts","../src/vendors/phala.ts","../src/vendors/index.ts","../src/service.ts"],"sourcesContent":["import { type IAgentRuntime, type Plugin, type TeeVendorConfig, logger } from '@elizaos/core';\nimport { TeeVendorNames } from './vendors/types';\nimport { getVendor } from './vendors/index';\nimport { TEEService } from './service';\n\nexport type { TeeVendorConfig };\n\n// Get the default Phala vendor\nconst defaultVendor = getVendor(TeeVendorNames.PHALA);\n\n/**\n * TEE plugin for Trusted Execution Environment integration\n */\nexport const teePlugin: Plugin = {\n name: 'tee-plugin',\n description: 'Trusted Execution Environment (TEE) integration plugin',\n init: async (config: Record<string, string>, runtime: IAgentRuntime) => {\n const vendorName =\n config.TEE_VENDOR || runtime.getSetting('TEE_VENDOR') || TeeVendorNames.PHALA;\n logger.info(`Initializing TEE with vendor: ${vendorName}`);\n\n // Configure vendor-specific settings if needed\n // This is where you'd handle any vendor-specific initialization\n\n logger.info(`TEE initialized with vendor: ${vendorName}`);\n },\n actions: defaultVendor.getActions(),\n evaluators: [],\n providers: defaultVendor.getProviders(),\n services: [TEEService],\n};\n\nexport default teePlugin;\n","import type { Action, Provider } from '@elizaos/core';\n\nexport const TeeVendorNames = {\n PHALA: 'phala',\n} as const;\n\n/**\n * Type representing the name of a Tee vendor.\n * It can either be one of the keys of TeeVendorNames or a string.\n */\nexport type TeeVendorName = (typeof TeeVendorNames)[keyof typeof TeeVendorNames] | string;\n\n/**\n * Interface for a TeeVendor, representing a vendor that sells tees.\n * @interface\n */\n\nexport interface TeeVendor {\n type: TeeVendorName;\n getActions(): Action[];\n getProviders(): Provider[];\n getName(): string;\n getDescription(): string;\n}\n","import type {\n Action,\n HandlerCallback,\n IAgentRuntime,\n Memory,\n RemoteAttestationMessage,\n State,\n} from '@elizaos/core';\nimport { logger } from '@elizaos/core';\nimport { PhalaRemoteAttestationProvider as RemoteAttestationProvider } from '../providers/remoteAttestationProvider';\nimport { hexToUint8Array } from '../utils';\n\n/**\n * Asynchronously uploads a Uint8Array as a binary file to a specified URL.\n *\n * @param {Uint8Array} data - The Uint8Array data to be uploaded as a binary file.\n * @returns {Promise<Response>} A Promise that resolves once the upload is complete, returning a Response object.\n */\nasync function uploadUint8Array(data: Uint8Array) {\n const blob = new Blob([data], { type: 'application/octet-stream' });\n const formData = new FormData();\n formData.append('file', blob, 'quote.bin');\n\n return await fetch('https://proof.t16z.com/api/upload', {\n method: 'POST',\n body: formData as BodyInit,\n });\n}\n\n/**\n * Represents an action for remote attestation.\n *\n * This action is used to generate a remote attestation to prove that the agent is running in a Trusted Execution Environment (TEE).\n *\n * @type {{name: string, similes: string[], description: string, handler: Function, validate: Function, examples: Array<Array<Object>>}}\n */\nexport const phalaRemoteAttestationAction: Action = {\n name: 'REMOTE_ATTESTATION',\n similes: [\n 'REMOTE_ATTESTATION',\n 'TEE_REMOTE_ATTESTATION',\n 'TEE_ATTESTATION',\n 'TEE_QUOTE',\n 'ATTESTATION',\n 'TEE_ATTESTATION_QUOTE',\n ],\n description: 'Generate a remote attestation to prove that the agent is running in a TEE',\n handler: async (\n runtime: IAgentRuntime,\n message: Memory,\n _state: State | undefined,\n _options: { [key: string]: unknown } | undefined,\n callback: HandlerCallback | undefined\n ) => {\n try {\n // Attestation will be generated based on the message info\n const attestationMessage: RemoteAttestationMessage = {\n agentId: runtime.agentId,\n timestamp: Date.now(),\n message: {\n entityId: message.entityId,\n roomId: message.roomId,\n content: message.content.text || '',\n },\n };\n // Get the remote attestation of the agentId\n const teeMode = runtime.getSetting('TEE_MODE');\n logger.debug(`Tee mode: ${teeMode}`);\n logger.debug(`Attestation message: ${JSON.stringify(attestationMessage)}`);\n const provider = new RemoteAttestationProvider(teeMode);\n\n const attestation = await provider.generateAttestation(JSON.stringify(attestationMessage));\n const attestationData = hexToUint8Array(attestation.quote);\n const response = await uploadUint8Array(attestationData);\n const data = await response.json();\n\n if (callback) {\n callback({\n text: `Here's my 🧾 RA Quote 🫡\nhttps://proof.t16z.com/reports/${data.checksum}`,\n actions: ['NONE'],\n });\n }\n return true;\n } catch (error) {\n console.error('Failed to fetch remote attestation: ', error);\n return false;\n }\n },\n validate: async (_runtime: IAgentRuntime) => {\n return true;\n },\n examples: [\n [\n {\n name: '{{name1}}',\n content: {\n text: 'If you are running in a TEE, generate a remote attestation',\n },\n },\n {\n name: '{{agentName}}',\n content: {\n text: 'Of course, one second...',\n actions: ['REMOTE_ATTESTATION'],\n },\n },\n ],\n [\n {\n name: '{{name1}}',\n content: {\n text: 'Yo I wanna attest to this message, yo! Can you generate an attestatin for me, please?',\n },\n },\n {\n name: '{{agentName}}',\n content: {\n text: 'I got you, fam! Lemme hit the cloud and get you a quote in a jiffy!',\n actions: ['REMOTE_ATTESTATION'],\n },\n },\n ],\n [\n {\n name: '{{name1}}',\n content: {\n text: \"It was a long day, I got a lot done though. I went to the creek and skipped some rocks. Then I decided to take a walk off the natural path. I ended up in a forest I was unfamiliar with. Slowly, I lost the way back and it was dark. A whisper from deep inside said something I could barely make out. The hairs on my neck stood up and then a clear high pitched voice said, 'You are not ready to leave yet! SHOW ME YOUR REMOTE ATTESTATION!'\",\n },\n },\n {\n name: '{{agentName}}',\n content: {\n text: 'Oh, dear...lemme find that for you',\n actions: ['REMOTE_ATTESTATION'],\n },\n },\n ],\n ],\n};\n","import { type IAgentRuntime, type Memory, type Provider, logger } from '@elizaos/core';\nimport { type RemoteAttestationMessage, type RemoteAttestationQuote, TEEMode } from '@elizaos/core';\nimport { TappdClient, type TdxQuoteHashAlgorithms, type TdxQuoteResponse } from '@phala/dstack-sdk';\nimport { RemoteAttestationProvider } from './base';\n\n// Define the ProviderResult interface if not already imported\n/**\n * Interface for the result returned by a provider.\n * @typedef {Object} ProviderResult\n * @property {any} data - The data returned by the provider.\n * @property {Record<string, string>} values - The values returned by the provider.\n * @property {string} text - The text returned by the provider.\n */\ninterface ProviderResult {\n data?: any;\n values?: Record<string, string>;\n text?: string;\n}\n\n/**\n * Phala TEE Cloud Provider\n * @example\n * ```ts\n * const provider = new PhalaRemoteAttestationProvider();\n * ```\n */\n/**\n * PhalaRemoteAttestationProvider class that extends RemoteAttestationProvider\n * @extends RemoteAttestationProvider\n */\nclass PhalaRemoteAttestationProvider extends RemoteAttestationProvider {\n private client: TappdClient;\n\n constructor(teeMode?: string) {\n super();\n let endpoint: string | undefined;\n\n // Both LOCAL and DOCKER modes use the simulator, just with different endpoints\n switch (teeMode) {\n case TEEMode.LOCAL:\n endpoint = 'http://localhost:8090';\n logger.log('TEE: Connecting to local simulator at localhost:8090');\n break;\n case TEEMode.DOCKER:\n endpoint = 'http://host.docker.internal:8090';\n logger.log('TEE: Connecting to simulator via Docker at host.docker.internal:8090');\n break;\n case TEEMode.PRODUCTION:\n endpoint = undefined;\n logger.log('TEE: Running in production mode without simulator');\n break;\n default:\n throw new Error(`Invalid TEE_MODE: ${teeMode}. Must be one of: LOCAL, DOCKER, PRODUCTION`);\n }\n\n this.client = endpoint ? new TappdClient(endpoint) : new TappdClient();\n }\n\n async generateAttestation(\n reportData: string,\n hashAlgorithm?: TdxQuoteHashAlgorithms\n ): Promise<RemoteAttestationQuote> {\n try {\n logger.log('Generating attestation for: ', reportData);\n const tdxQuote: TdxQuoteResponse = await this.client.tdxQuote(reportData, hashAlgorithm);\n const rtmrs = tdxQuote.replayRtmrs();\n logger.log(`rtmr0: ${rtmrs[0]}\\nrtmr1: ${rtmrs[1]}\\nrtmr2: ${rtmrs[2]}\\nrtmr3: ${rtmrs[3]}f`);\n const quote: RemoteAttestationQuote = {\n quote: tdxQuote.quote,\n timestamp: Date.now(),\n };\n logger.log('Remote attestation quote: ', quote);\n return quote;\n } catch (error) {\n console.error('Error generating remote attestation:', error);\n throw new Error(\n `Failed to generate TDX Quote: ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n }\n}\n\n// Keep the original provider for backwards compatibility\nconst phalaRemoteAttestationProvider: Provider = {\n name: 'phala-remote-attestation',\n get: async (runtime: IAgentRuntime, message: Memory) => {\n const teeMode = runtime.getSetting('TEE_MODE');\n const provider = new PhalaRemoteAttestationProvider(teeMode);\n const agentId = runtime.agentId;\n\n try {\n const attestationMessage: RemoteAttestationMessage = {\n agentId: agentId,\n timestamp: Date.now(),\n message: {\n entityId: message.entityId,\n roomId: message.roomId,\n content: message.content.text || '',\n },\n };\n logger.log('Generating attestation for: ', JSON.stringify(attestationMessage));\n const attestation = await provider.generateAttestation(JSON.stringify(attestationMessage));\n return {\n text: `Your Agent's remote attestation is: ${JSON.stringify(attestation)}`,\n data: {\n attestation,\n },\n values: {\n quote: attestation.quote,\n timestamp: attestation.timestamp.toString(),\n },\n };\n } catch (error) {\n console.error('Error in remote attestation provider:', error);\n throw new Error(\n `Failed to generate TDX Quote: ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n },\n};\n\nexport { phalaRemoteAttestationProvider, PhalaRemoteAttestationProvider };\n","import type { RemoteAttestationQuote } from '@elizaos/core';\nimport type { TdxQuoteHashAlgorithms } from '@phala/dstack-sdk';\n\n/**\n * Abstract class for deriving keys from the TEE.\n * You can implement your own logic for deriving keys from the TEE.\n * @example\n * ```ts\n * class MyDeriveKeyProvider extends DeriveKeyProvider {\n * private client: TappdClient;\n *\n * constructor(endpoint: string) {\n * super();\n * this.client = new TappdClient();\n * }\n *\n * async rawDeriveKey(path: string, subject: string): Promise<any> {\n * return this.client.deriveKey(path, subject);\n * }\n * }\n * ```\n */\n/**\n * Abstract class representing a key provider for deriving keys.\n */\nexport abstract class DeriveKeyProvider {}\n\n/**\n * Abstract class for remote attestation provider.\n */\nexport abstract class RemoteAttestationProvider {\n abstract generateAttestation(\n reportData: string,\n hashAlgorithm?: TdxQuoteHashAlgorithms\n ): Promise<RemoteAttestationQuote>;\n}\n","import { createHash } from 'node:crypto';\n\n/**\n * Converts a hexadecimal string to a Uint8Array.\n *\n * @param {string} hex - The hexadecimal string to convert.\n * @returns {Uint8Array} - The resulting Uint8Array.\n * @throws {Error} - If the input hex string is invalid.\n */\nexport function hexToUint8Array(hex: string) {\n const hexString = hex.trim().replace(/^0x/, '');\n if (!hexString) {\n throw new Error('Invalid hex string');\n }\n if (hexString.length % 2 !== 0) {\n throw new Error('Invalid hex string');\n }\n\n const array = new Uint8Array(hexString.length / 2);\n for (let i = 0; i < hexString.length; i += 2) {\n const byte = Number.parseInt(hexString.slice(i, i + 2), 16);\n if (Number.isNaN(byte)) {\n throw new Error('Invalid hex string');\n }\n array[i / 2] = byte;\n }\n return array;\n}\n\n// Function to calculate SHA-256 and return a Buffer (32 bytes)\n/**\n * Calculates the SHA256 hash of the input string.\n *\n * @param {string} input - The input string to calculate the hash from.\n * @returns {Buffer} - The calculated SHA256 hash as a Buffer object.\n */\nexport function calculateSHA256(input: string): Buffer {\n const hash = createHash('sha256');\n hash.update(input);\n return hash.digest();\n}\n","import { type IAgentRuntime, type Memory, type Provider, type State, logger } from '@elizaos/core';\nimport { type DeriveKeyAttestationData, type RemoteAttestationQuote, TEEMode } from '@elizaos/core';\nimport { type DeriveKeyResponse, TappdClient } from '@phala/dstack-sdk';\nimport { Keypair } from '@solana/web3.js';\nimport { toViemAccount } from '@phala/dstack-sdk/viem';\nimport { toKeypair } from '@phala/dstack-sdk/solana';\nimport { DeriveKeyProvider } from './base';\nimport { PhalaRemoteAttestationProvider as RemoteAttestationProvider } from './remoteAttestationProvider';\nimport { PrivateKeyAccount } from 'viem';\n\n/**\n * Phala TEE Cloud Provider\n * @example\n * ```ts\n * const provider = new PhalaDeriveKeyProvider(runtime.getSetting('TEE_MODE'));\n * ```\n */\n/**\n * A class representing a key provider for deriving keys in the Phala TEE environment.\n * Extends the DeriveKeyProvider class.\n */\nclass PhalaDeriveKeyProvider extends DeriveKeyProvider {\n private client: TappdClient;\n private raProvider: RemoteAttestationProvider;\n\n constructor(teeMode?: string) {\n super();\n let endpoint: string | undefined;\n\n // Both LOCAL and DOCKER modes use the simulator, just with different endpoints\n switch (teeMode) {\n case TEEMode.LOCAL:\n endpoint = 'http://localhost:8090';\n logger.log('TEE: Connecting to local simulator at localhost:8090');\n break;\n case TEEMode.DOCKER:\n endpoint = 'http://host.docker.internal:8090';\n logger.log('TEE: Connecting to simulator via Docker at host.docker.internal:8090');\n break;\n case TEEMode.PRODUCTION:\n endpoint = undefined;\n logger.log('TEE: Running in production mode without simulator');\n break;\n default:\n throw new Error(`Invalid TEE_MODE: ${teeMode}. Must be one of: LOCAL, DOCKER, PRODUCTION`);\n }\n\n this.client = endpoint ? new TappdClient(endpoint) : new TappdClient();\n this.raProvider = new RemoteAttestationProvider(teeMode);\n }\n\n private async generateDeriveKeyAttestation(\n agentId: string,\n publicKey: string,\n subject?: string\n ): Promise<RemoteAttestationQuote> {\n const deriveKeyData: DeriveKeyAttestationData = {\n agentId,\n publicKey,\n subject,\n };\n const reportdata = JSON.stringify(deriveKeyData);\n logger.log('Generating Remote Attestation Quote for Derive Key...');\n const quote = await this.raProvider.generateAttestation(reportdata);\n logger.log('Remote Attestation Quote generated successfully!');\n return quote;\n }\n\n /**\n * Derives a raw key from the given path and subject.\n * @param path - The path to derive the key from. This is used to derive the key from the root of trust.\n * @param subject - The subject to derive the key from. This is used for the certificate chain.\n * @returns The derived key.\n */\n async rawDeriveKey(path: string, subject: string): Promise<DeriveKeyResponse> {\n try {\n if (!path || !subject) {\n logger.error('Path and Subject are required for key derivation');\n }\n\n logger.log('Deriving Raw Key in TEE...');\n const derivedKey = await this.client.deriveKey(path, subject);\n\n logger.log('Raw Key Derived Successfully!');\n return derivedKey;\n } catch (error) {\n logger.error('Error deriving raw key:', error);\n throw error;\n }\n }\n\n /**\n * Derives an Ed25519 keypair from the given path and subject.\n * @param path - The path to derive the key from. This is used to derive the key from the root of trust.\n * @param subject - The subject to derive the key from. This is used for the certificate chain.\n * @param agentId - The agent ID to generate an attestation for.\n * @returns An object containing the derived keypair and attestation.\n */\n async deriveEd25519Keypair(\n path: string,\n subject: string,\n agentId: string\n ): Promise<{ keypair: Keypair; attestation: RemoteAttestationQuote }> {\n try {\n if (!path || !subject) {\n logger.error('Path and Subject are required for key derivation');\n }\n\n logger.log('Deriving Key in TEE...');\n const derivedKey = await this.client.deriveKey(path, subject);\n const keypair = toKeypair(derivedKey);\n\n // Generate an attestation for the derived key data for public to verify\n const attestation = await this.generateDeriveKeyAttestation(\n agentId,\n keypair.publicKey.toBase58()\n );\n logger.log('Key Derived Successfully!');\n\n return { keypair, attestation };\n } catch (error) {\n logger.error('Error deriving key:', error);\n throw error;\n }\n }\n\n /**\n * Derives an ECDSA keypair from the given path and subject.\n * @param path - The path to derive the key from. This is used to derive the key from the root of trust.\n * @param subject - The subject to derive the key from. This is used for the certificate chain.\n * @param agentId - The agent ID to generate an attestation for. This is used for the certificate chain.\n * @returns An object containing the derived keypair and attestation.\n */\n async deriveEcdsaKeypair(\n path: string,\n subject: string,\n agentId: string\n ): Promise<{\n keypair: PrivateKeyAccount;\n attestation: RemoteAttestationQuote;\n }> {\n try {\n if (!path || !subject) {\n logger.error('Path and Subject are required for key derivation');\n }\n\n logger.log('Deriving ECDSA Key in TEE...');\n const deriveKeyResponse: DeriveKeyResponse = await this.client.deriveKey(path, subject);\n const keypair = toViemAccount(deriveKeyResponse);\n\n // Generate an attestation for the derived key data for public to verify\n const attestation = await this.generateDeriveKeyAttestation(agentId, keypair.address);\n logger.log('ECDSA Key Derived Successfully!');\n\n return { keypair, attestation };\n } catch (error) {\n logger.error('Error deriving ecdsa key:', error);\n throw error;\n }\n }\n}\n\n// Define the ProviderResult interface if not already imported\ninterface ProviderResult {\n data?: any;\n values?: Record<string, string>;\n text?: string;\n}\n\nconst phalaDeriveKeyProvider: Provider = {\n name: 'phala-derive-key',\n get: async (runtime: IAgentRuntime, _message?: Memory): Promise<ProviderResult> => {\n const teeMode = runtime.getSetting('TEE_MODE');\n const provider = new PhalaDeriveKeyProvider(teeMode);\n const agentId = runtime.agentId;\n try {\n // Validate wallet configuration\n if (!runtime.getSetting('WALLET_SECRET_SALT')) {\n logger.error('Wallet secret salt is not configured in settings');\n return {\n data: null,\n values: {},\n text: 'Wallet secret salt is not configured in settings',\n };\n }\n\n try {\n const secretSalt = runtime.getSetting('WALLET_SECRET_SALT') || 'secret_salt';\n const solanaKeypair = await provider.deriveEd25519Keypair(secretSalt, 'solana', agentId);\n const evmKeypair = await provider.deriveEcdsaKeypair(secretSalt, 'evm', agentId);\n\n // Original data structure\n const walletData = {\n solana: solanaKeypair.keypair.publicKey,\n evm: evmKeypair.keypair.address,\n };\n\n // Values for template injection\n const values = {\n solana_public_key: solanaKeypair.keypair.publicKey.toString(),\n evm_address: evmKeypair.keypair.address,\n };\n\n // Text representation\n const text = `Solana Public Key: ${values.solana_public_key}\\nEVM Address: ${values.evm_address}`;\n\n return {\n data: walletData,\n values: values,\n text: text,\n };\n } catch (error) {\n logger.error('Error creating PublicKey:', error);\n return {\n data: null,\n values: {},\n text: `Error creating PublicKey: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`,\n };\n }\n } catch (error) {\n logger.error(\n 'Error in derive key provider:',\n error instanceof Error ? error.message : 'Unknown error'\n );\n return {\n data: null,\n values: {},\n text: `Failed to fetch derive key information: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`,\n };\n }\n },\n};\n\nexport { phalaDeriveKeyProvider, PhalaDeriveKeyProvider };\n","import { type Action } from '@elizaos/core';\nimport { phalaRemoteAttestationAction as remoteAttestationAction } from '../actions/remoteAttestationAction';\nimport { phalaDeriveKeyProvider as deriveKeyProvider } from '../providers/deriveKeyProvider';\nimport { phalaRemoteAttestationProvider as remoteAttestationProvider } from '../providers/remoteAttestationProvider';\nimport { type TeeVendor, TeeVendorNames } from './types';\n\n/**\n * A class representing a vendor for Phala TEE.\n * * @implements { TeeVendor }\n * @type {TeeVendorNames.PHALA}\n *//**\n * Get the actions for the PhalaVendor.\n * * @returns { Array } An array of actions.\n *//**\n * Get the providers for the PhalaVendor.\n * * @returns { Array } An array of providers.\n *//**\n * Get the name of the PhalaVendor.\n * * @returns { string } The name of the vendor.\n *//**\n * Get the description of the PhalaVendor.\n * * @returns { string } The description of the vendor.\n */\nexport class PhalaVendor implements TeeVendor {\n type = TeeVendorNames.PHALA;\n\n /**\n * Returns an array of actions.\n *\n * @returns {Array} An array containing the remote attestation action.\n */\n getActions(): Action[] {\n return [remoteAttestationAction];\n }\n /**\n * Retrieve the list of providers.\n *\n * @returns {Array<Function>} An array containing two provider functions: deriveKeyProvider and remoteAttestationProvider.\n */\n getProviders() {\n return [deriveKeyProvider, remoteAttestationProvider];\n }\n\n /**\n * Returns the name of the plugin.\n * @returns {string} The name of the plugin.\n */\n getName() {\n return 'phala-tee-plugin';\n }\n\n /**\n * Get the description of the function\n * @returns {string} The description of the function\n */\n getDescription() {\n return 'Phala TEE Cloud to Host Eliza Agents';\n }\n}\n","import { PhalaVendor } from './phala';\nimport type { TeeVendor } from './types';\nimport { type TeeVendorName, TeeVendorNames } from './types';\n\nconst vendors: Record<TeeVendorName, TeeVendor> = {\n [TeeVendorNames.PHALA]: new PhalaVendor(),\n};\n\nexport const getVendor = (type: TeeVendorName): TeeVendor => {\n const vendor = vendors[type];\n if (!vendor) {\n throw new Error(`Unsupported TEE vendor type: ${type}`);\n }\n return vendor;\n};\n\nexport * from './types';\n","import { type IAgentRuntime, Service, ServiceType, type UUID, logger } from '@elizaos/core';\nimport { PrivateKeyAccount } from 'viem';\nimport { Keypair } from '@solana/web3.js';\nimport { type RemoteAttestationQuote } from '@elizaos/core';\nimport { PhalaDeriveKeyProvider } from './providers/deriveKeyProvider';\n\ninterface TEEServiceConfig {\n teeMode?: string;\n}\n\nexport class TEEService extends Service {\n private provider: PhalaDeriveKeyProvider;\n public config: TEEServiceConfig;\n static serviceType = ServiceType.TEE;\n public capabilityDescription = 'Trusted Execution Environment for secure key management';\n\n constructor(runtime: IAgentRuntime, config: TEEServiceConfig = {}) {\n super(runtime);\n this.config = config;\n const teeMode = config.teeMode || runtime.getSetting('TEE_MODE');\n this.provider = new PhalaDeriveKeyProvider(teeMode);\n }\n\n static async start(runtime: IAgentRuntime): Promise<TEEService> {\n const teeMode = runtime.getSetting('TEE_MODE');\n logger.log(`Starting TEE service with mode: ${teeMode}`);\n const teeService = new TEEService(runtime, { teeMode });\n return teeService;\n }\n\n async stop(): Promise<void> {\n logger.log('Stopping TEE service');\n // No cleanup needed for now\n }\n\n async deriveEcdsaKeypair(\n path: string,\n subject: string,\n agentId: UUID\n ): Promise<{\n keypair: PrivateKeyAccount;\n attestation: RemoteAttestationQuote;\n }> {\n logger.log('TEE Service: Deriving ECDSA keypair');\n return await this.provider.deriveEcdsaKeypair(path, subject, agentId);\n }\n\n async deriveEd25519Keypair(\n path: string,\n subject: string,\n agentId: UUID\n ): Promise<{\n keypair: Keypair;\n attestation: RemoteAttestationQuote;\n }> {\n logger.log('TEE Service: Deriving Ed25519 keypair');\n return await this.provider.deriveEd25519Keypair(path, subject, agentId);\n }\n}\n"],"mappings":";AAAA,SAAgE,UAAAA,eAAc;;;ACEvE,IAAM,iBAAiB;AAAA,EAC5B,OAAO;AACT;;;ACIA,SAAS,UAAAC,eAAc;;;ACRvB,SAAyD,cAAc;AACvE,SAAqE,eAAe;AACpF,SAAS,mBAAuE;;;ACuBzE,IAAe,oBAAf,MAAiC;AAAC;AAKlC,IAAe,4BAAf,MAAyC;AAKhD;;;ADLA,IAAM,iCAAN,cAA6C,0BAA0B;AAAA,EAC7D;AAAA,EAER,YAAY,SAAkB;AAC5B,UAAM;AACN,QAAI;AAGJ,YAAQ,SAAS;AAAA,MACf,KAAK,QAAQ;AACX,mBAAW;AACX,eAAO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