From 6f24839464f363f5b08c6610037fc9f48399af56 Mon Sep 17 00:00:00 2001 From: HashWarlock Date: Fri, 3 Jan 2025 21:13:28 -0600 Subject: [PATCH] fix last items for cleanup --- docs/docs/packages/plugins.md | 12 ++++++++++-- packages/plugin-tee/src/actions/remoteAttestation.ts | 12 +++++------- packages/plugin-tee/tsup.config.ts | 1 + 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/docs/packages/plugins.md b/docs/docs/packages/plugins.md index 8e13cf7062..f93f28e522 100644 --- a/docs/docs/packages/plugins.md +++ b/docs/docs/packages/plugins.md @@ -449,6 +449,10 @@ const response = await runtime.triggerAction("INVOKE_CONTRACT", { Integrates [Dstack SDK](https://github.com/Dstack-TEE/dstack) to enable TEE (Trusted Execution Environment) functionality and deploy secure & privacy-enhanced Eliza Agents: +**Actions:** + +- `REMOTE_ATTESTATION` - Generate a Remote Attestation Quote based on `runtime.agentId` when the agent is prompted for a remote attestation. The quote is uploaded to the [proof.t16z.com](https://proof.t16z.com) service and the agent is informed of the attestation report URL. + **Providers:** - `deriveKeyProvider` - Allows for secure key derivation within a TEE environment. It supports deriving keys for both Solana (Ed25519) and Ethereum (ECDSA) chains. @@ -526,8 +530,12 @@ docker run --rm -p 8090:8090 phalanetwork/tappd-simulator:latest When using the provider through the runtime environment, ensure the following settings are configured: ```env - # Optional, for simulator purposes if testing on mac or windows. Leave empty for Linux x86 machines. -DSTACK_SIMULATOR_ENDPOINT="http://host.docker.internal:8090" +# TEE_MODE options: +# - LOCAL: Uses simulator at localhost:8090 (for local development) +# - DOCKER: Uses simulator at host.docker.internal:8090 (for docker development) +# - PRODUCTION: No simulator, uses production endpoints +# Defaults to OFF if not specified +TEE_MODE=OFF # LOCAL | DOCKER | PRODUCTION WALLET_SECRET_SALT=your-secret-salt // Required to single agent deployments ``` diff --git a/packages/plugin-tee/src/actions/remoteAttestation.ts b/packages/plugin-tee/src/actions/remoteAttestation.ts index 1b118ac34b..e3df40727c 100644 --- a/packages/plugin-tee/src/actions/remoteAttestation.ts +++ b/packages/plugin-tee/src/actions/remoteAttestation.ts @@ -1,6 +1,6 @@ import type { IAgentRuntime, Memory, State, HandlerCallback } from "@elizaos/core"; import { RemoteAttestationProvider } from "../providers/remoteAttestationProvider"; -import { fetch, type BodyInit } from 'undici' +import { fetch, type BodyInit } from "undici"; function hexToUint8Array(hex: string) { hex = hex.trim(); @@ -58,11 +58,9 @@ export const remoteAttestationAction = { const response = await uploadUint8Array(attestationData); const data = await response.json(); callback({ - text: `Uploading attestation to proof.t16z.com...`, - action: "NONE", - }); - callback({ - text: `Attestation report for ${agentName}: https://proof.t16z.com/reports/${data.checksum}`, + text: `Here's my 🧾 RA Quote 🫡 + + https://proof.t16z.com/reports/${data.checksum}`, action: "NONE", }); return true; @@ -85,7 +83,7 @@ export const remoteAttestationAction = { { user: "{{user2}}", content: { - text: "One second, let me generate and upload my attestation report", + text: "Of course, one second...", action: "REMOTE_ATTESTATION", }, } diff --git a/packages/plugin-tee/tsup.config.ts b/packages/plugin-tee/tsup.config.ts index b94c126be7..153f6658f9 100644 --- a/packages/plugin-tee/tsup.config.ts +++ b/packages/plugin-tee/tsup.config.ts @@ -24,5 +24,6 @@ export default defineConfig({ "@solana/buffer-layout", "stream", "buffer", + "undici", ], });