Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
IkigaiLabsETH committed Dec 21, 2024
1 parent de0442b commit c06a170
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 34 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@deepgram/sdk": "^3.9.0",
"@vitest/eslint-plugin": "1.0.1",
"amqplib": "0.10.5",
"better-sqlite3": "11.6.0",
"csv-parse": "5.6.0",
"ollama-ai-provider": "0.16.1",
"optional": "0.1.4",
Expand Down
23 changes: 17 additions & 6 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,7 @@ export type Client = {
stop: (runtime: IAgentRuntime) => Promise<unknown>;
};

/**
* Plugin for extending agent functionality
*/
export type Plugin = {
export type IPlugin = {
/** Plugin name */
name: string;

Expand All @@ -605,6 +602,21 @@ export type Plugin = {
clients?: Client[];
};

export abstract class Plugin implements IPlugin {
abstract readonly name: string;
abstract readonly description: string;
actions?: Action[] = [];
providers?: Provider[] = [];
evaluators?: Evaluator[] = [];
services?: Service[] = [];
clients?: Client[] = [];

constructor() {}

async setup(_character: Character): Promise<void> {}
async teardown(): Promise<void> {}
}

/**
* Available client platforms
*/
Expand Down Expand Up @@ -755,7 +767,6 @@ export type Character = {
slack?: {
shouldIgnoreBotMessages?: boolean;
shouldIgnoreDirectMessages?: boolean;

};
};

Expand All @@ -777,7 +788,7 @@ export type Character = {
/** Optional NFT prompt */
nft?: {
prompt: string;
}
};
};

/**
Expand Down
6 changes: 4 additions & 2 deletions packages/plugin-nft-collections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "@ai16z/plugin-nft-collections",
"version": "0.1.0",
"description": "NFT collections plugin for Eliza",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"build": "tsup src/index.ts --format esm --dts",
"test": "jest",
"lint": "eslint src --ext .ts",
"format": "prettier --write src/**/*.ts"
Expand All @@ -21,7 +22,8 @@
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.56.0",
"prettier": "^3.2.5",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"tsup": "^8.0.1"
},
"peerDependencies": {
"@ai16z/eliza": "workspace:*"
Expand Down
10 changes: 4 additions & 6 deletions packages/plugin-nft-collections/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"baseUrl": "./src",
"paths": {
"*": [
"*"
]
}
"module": "ESNext",
"target": "ESNext",
"moduleResolution": "Node",
"esModuleInterop": true
},
"include": [
"src/**/*"
Expand Down
60 changes: 40 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c06a170

Please sign in to comment.