Skip to content

Commit 329e080

Browse files
committed
remove TEE logs out
1 parent d98e073 commit 329e080

15 files changed

+14
-1050
lines changed

Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ COPY packages ./packages
3030

3131
# Install dependencies
3232
RUN bun install
33-
RUN bun add better-sqlite3
3433

3534
# Build the project
3635
RUN bun run build
@@ -63,7 +62,7 @@ COPY --from=builder /app/scripts ./scripts
6362
ENV NODE_ENV=production
6463

6564
# Expose any necessary ports (if needed)
66-
EXPOSE 3000 5173
65+
EXPOSE 3000
6766

6867
# Start the application
6968
CMD ["bun", "run", "start"]

packages/core/src/types.ts

-70
Original file line numberDiff line numberDiff line change
@@ -1166,21 +1166,6 @@ export interface IFileService extends Service {
11661166
generateSignedUrl(fileName: string, expiresIn: number): Promise<string>;
11671167
}
11681168

1169-
export interface ITeeLogService extends Service {
1170-
log(
1171-
agentId: string,
1172-
roomId: string,
1173-
entityId: string,
1174-
type: string,
1175-
content: string
1176-
): Promise<boolean>;
1177-
1178-
generateAttestation<T>(reportData: string, hashAlgorithm?: T | any): Promise<string>;
1179-
getAllAgents(): Promise<TeeAgent[]>;
1180-
getAgent(agentId: string): Promise<TeeAgent | null>;
1181-
getLogs(query: TeeLogQuery, page: number, pageSize: number): Promise<TeePageQuery<TeeLog[]>>;
1182-
}
1183-
11841169
export interface TestCase {
11851170
name: string;
11861171
fn: (runtime: IAgentRuntime) => Promise<void> | void;
@@ -1191,28 +1176,6 @@ export interface TestSuite {
11911176
tests: TestCase[];
11921177
}
11931178

1194-
// Represents a log entry in the TeeLog table, containing details about agent activities.
1195-
export interface TeeLog {
1196-
id: string;
1197-
agentId: string;
1198-
roomId: string;
1199-
entityId: string;
1200-
type: string;
1201-
content: string;
1202-
timestamp: number;
1203-
signature: string;
1204-
}
1205-
1206-
export interface TeeLogQuery {
1207-
agentId?: string;
1208-
roomId?: string;
1209-
entityId?: string;
1210-
type?: string;
1211-
containsContent?: string;
1212-
startTimestamp?: number;
1213-
endTimestamp?: number;
1214-
}
1215-
12161179
// Represents an agent in the TeeAgent table, containing details about the agent.
12171180
export interface TeeAgent {
12181181
id: string; // Primary key
@@ -1226,33 +1189,6 @@ export interface TeeAgent {
12261189
attestation: string;
12271190
}
12281191

1229-
export interface TeePageQuery<Result = any> {
1230-
page: number;
1231-
pageSize: number;
1232-
total?: number;
1233-
data?: Result;
1234-
}
1235-
1236-
export abstract class TeeLogDAO<DB = any> {
1237-
db: DB;
1238-
1239-
abstract initialize(): Promise<void>;
1240-
1241-
abstract addLog(log: TeeLog): Promise<boolean>;
1242-
1243-
abstract getPagedLogs(
1244-
query: TeeLogQuery,
1245-
page: number,
1246-
pageSize: number
1247-
): Promise<TeePageQuery<TeeLog[]>>;
1248-
1249-
abstract addAgent(agent: TeeAgent): Promise<boolean>;
1250-
1251-
abstract getAgent(agentId: string): Promise<TeeAgent>;
1252-
1253-
abstract getAllAgents(): Promise<TeeAgent[]>;
1254-
}
1255-
12561192
export enum TEEMode {
12571193
OFF = 'OFF',
12581194
LOCAL = 'LOCAL', // For local development with simulator
@@ -1281,13 +1217,7 @@ export interface RemoteAttestationMessage {
12811217
};
12821218
}
12831219

1284-
export interface SgxAttestation {
1285-
quote: string;
1286-
timestamp: number;
1287-
}
1288-
12891220
export enum TeeType {
1290-
SGX_GRAMINE = 'sgx_gramine',
12911221
TDX_DSTACK = 'tdx_dstack',
12921222
}
12931223

packages/plugin-tee/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
"types": "dist/index.d.ts",
77
"dependencies": {
88
"@elizaos/core": "^1.0.0-alpha.67",
9-
"@phala/dstack-sdk": "^0.1.7",
10-
"@solana/web3.js": "^1.98.0",
11-
"better-sqlite3": "11.8.1",
12-
"elliptic": "6.6.1"
9+
"@phala/dstack-sdk": "0.1.11",
10+
"@solana/web3.js": "1.98.0",
11+
"viem": "2.23.11"
1312
},
1413
"devDependencies": {
1514
"@types/node": "^20.0.0",

packages/plugin-tee/src/actions/remoteAttestationAction.ts

-62
Original file line numberDiff line numberDiff line change
@@ -128,65 +128,3 @@ https://proof.t16z.com/reports/${data.checksum}`,
128128
],
129129
],
130130
};
131-
132-
/**
133-
* Marlin Remote Attestation action.
134-
*
135-
* This action allows generating a remote attestation to prove that the agent is running in a Trusted Execution Environment (TEE).
136-
*
137-
* @type {{
138-
* name: string,
139-
* similes: string[],
140-
* description: string,
141-
* handler: (runtime: IAgentRuntime, _message: Memory, _state: State, _options: Record<string, unknown>, callback: HandlerCallback) => Promise<boolean>,
142-
* validate: (runtime: IAgentRuntime) => Promise<boolean>,
143-
* examples: { name: string, content: { text: string, actions: string[] } }[][]
144-
* }}
145-
*/
146-
export const marlinRemoteAttestationAction = {
147-
name: 'REMOTE_ATTESTATION',
148-
similes: ['REMOTE_ATTESTATION', 'TEE_REMOTE_ATTESTATION', 'TEE_ATTESTATION'],
149-
description: 'Generate a remote attestation to prove that the agent is running in a TEE',
150-
handler: async (
151-
runtime: IAgentRuntime,
152-
_message: Memory,
153-
_state: State,
154-
_options: Record<string, unknown>, // Replaced any with Record<string, unknown>
155-
callback: HandlerCallback
156-
) => {
157-
try {
158-
const endpoint =
159-
runtime.getSetting('TEE_MARLIN_ATTESTATION_ENDPOINT') ?? 'http://127.0.0.1:1350';
160-
const response = await fetch(`${endpoint}/attestation/hex`);
161-
callback({
162-
text: `Here you go - ${await response.text()}`,
163-
actions: ['NONE'],
164-
});
165-
return true;
166-
} catch (error) {
167-
console.error('Failed to fetch remote attestation: ', error);
168-
return false;
169-
}
170-
},
171-
validate: async (_runtime: IAgentRuntime) => {
172-
return true;
173-
},
174-
examples: [
175-
[
176-
{
177-
name: 'user',
178-
content: {
179-
text: 'Attest yourself',
180-
actions: ['REMOTE_ATTESTATION'],
181-
},
182-
},
183-
{
184-
name: 'user',
185-
content: {
186-
text: 'Generate a remote attestation',
187-
actions: ['REMOTE_ATTESTATION'],
188-
},
189-
},
190-
],
191-
],
192-
};

packages/plugin-tee/src/adapters/sqliteDAO.ts

-191
This file was deleted.

0 commit comments

Comments
 (0)