Skip to content

Commit

Permalink
Merge pull request #4 from blockydevs/ELIZAAI-1-set-up-repository-and…
Browse files Browse the repository at this point in the history
…-add-initial-readme

chore: initialize cosmos plugin
  • Loading branch information
KacperKoza343 authored Dec 30, 2024
2 parents ea8cfb3 + 3165999 commit d60be7e
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 0 deletions.
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@ai16z/plugin-coinbase": "workspace:*",
"@ai16z/plugin-conflux": "workspace:*",
"@ai16z/plugin-evm": "workspace:*",
"@ai16z/plugin-cosmos": "workspace:*",
"@ai16z/plugin-flow": "workspace:*",
"@ai16z/plugin-story": "workspace:*",
"@ai16z/plugin-goat": "workspace:*",
Expand Down
2 changes: 2 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
} from "@ai16z/plugin-coinbase";
import { confluxPlugin } from "@ai16z/plugin-conflux";
import { evmPlugin } from "@ai16z/plugin-evm";
import { cosmosPlugin } from "@ai16z/plugin-cosmos";
import { storyPlugin } from "@ai16z/plugin-story";
import { flowPlugin } from "@ai16z/plugin-flow";
import { imageGenerationPlugin } from "@ai16z/plugin-image-generation";
Expand Down Expand Up @@ -510,6 +511,7 @@ export async function createAgent(
getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
? evmPlugin
: null,
cosmosPlugin,
(getSecret(character, "SOLANA_PUBLIC_KEY") ||
(getSecret(character, "WALLET_PUBLIC_KEY") &&
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith(
Expand Down
25 changes: 25 additions & 0 deletions packages/plugin-cosmos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# `@ai16z/plugin-cosmos`

This plugin provides actions and providers for interacting with Cosmos compatible chains.

---

## Configuration

### Default Setup

### Adding Support for Other Chains

## Provider

## Actions

### Transfer

### Running Tests

Navigate to the `plugin-cosmos` directory and run:

```bash
pnpm test
```
39 changes: 39 additions & 0 deletions packages/plugin-cosmos/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import eslintGlobalConfig from "../../eslint.config.mjs";

export default [
...eslintGlobalConfig,
{
rules: {
indent: ["error", 2],
'padding-line-between-statements': [
'error',
// Blank line between "use strict" (or other directives) and imports
{ blankLine: 'always', prev: 'directive', next: 'import' },

// No blank lines between import statements
{ blankLine: 'never', prev: 'import', next: 'import' },

// One blank line after the last import statement
{
blankLine: 'always',
prev: 'import',
next: ['const', 'let', 'var', 'function', 'expression', 'if', 'block', 'class', 'export', 'block-like']
},

{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
{ blankLine: 'always', prev: '*', next: 'block-like' }
],
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
},
},
];
16 changes: 16 additions & 0 deletions packages/plugin-cosmos/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@ai16z/plugin-cosmos",
"version": "1.0.0",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"tsup": "8.3.5"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch",
"lint": "eslint --fix --cache .",
"test": "vitest run"
}
}
12 changes: 12 additions & 0 deletions packages/plugin-cosmos/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Plugin } from "@ai16z/eliza";

export const cosmosPlugin: Plugin = {
name: "Cosmos",
description: "Cosmos blockchain integration plugin",
providers: [],
evaluators: [],
services: [],
actions: [],
};

export default cosmosPlugin;
15 changes: 15 additions & 0 deletions packages/plugin-cosmos/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../core/tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"typeRoots": [
"./node_modules/@types",
"./src/types"
],
"declaration": true
},
"include": [
"src"
]
}
19 changes: 19 additions & 0 deletions packages/plugin-cosmos/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts"],
outDir: "dist",
sourcemap: true,
clean: true,
format: ["esm"], // Ensure you're targeting CommonJS
external: [
"dotenv", // Externalize dotenv to prevent bundling
"fs", // Externalize fs to use Node.js built-in module
"path", // Externalize other built-ins if necessary
"@reflink/reflink",
"@node-llama-cpp",
"https",
"http",
"agentkeepalive",
],
});
9 changes: 9 additions & 0 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 d60be7e

Please sign in to comment.