Skip to content

Commit 66ee7b2

Browse files
authored
Merge branch 'develop' into develop
2 parents c7ff3d6 + 9c84c37 commit 66ee7b2

32 files changed

+3235
-1034
lines changed

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ DISCORD_APPLICATION_ID=
3131
DISCORD_API_TOKEN= # Bot token
3232
DISCORD_VOICE_CHANNEL_ID= # The ID of the voice channel the bot should join (optional)
3333

34+
# Devin Configuration
35+
DEVIN_API_TOKEN= # Get your API key from docs.devin.ai/tutorials/api-integration
36+
3437
# Farcaster Neynar Configuration
3538
FARCASTER_FID= # The FID associated with the account your are sending casts from
3639
FARCASTER_NEYNAR_API_KEY= # Neynar API key: https://neynar.com/

agent/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@
102102
"@elizaos/plugin-hyperliquid": "workspace:*",
103103
"@elizaos/plugin-akash": "workspace:*",
104104
"@elizaos/plugin-quai": "workspace:*",
105+
"@elizaos/plugin-lightning": "workspace:*",
105106
"@elizaos/plugin-b2": "workspace:*",
106107
"@elizaos/plugin-nft-collections": "workspace:*",
107108
"@elizaos/plugin-pyth-data": "workspace:*",
108109
"@elizaos/plugin-openai": "workspace:*",
110+
"@elizaos/plugin-devin": "workspace:*",
109111
"readline": "1.3.0",
110112
"ws": "8.18.0",
111113
"yargs": "17.7.2"

agent/src/index.ts

+27-9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { DirectClient } from "@elizaos/client-direct";
1515
import { agentKitPlugin } from "@elizaos/plugin-agentkit";
1616
// import { ReclaimAdapter } from "@elizaos/plugin-reclaim";
1717
import { PrimusAdapter } from "@elizaos/plugin-primus";
18+
import { lightningPlugin } from "@elizaos/plugin-lightning";
1819
import { elizaCodeinPlugin, onchainJson } from "@elizaos/plugin-iq6900";
1920

2021
import {
@@ -107,7 +108,10 @@ import { hyperliquidPlugin } from "@elizaos/plugin-hyperliquid";
107108
import { echoChambersPlugin } from "@elizaos/plugin-echochambers";
108109
import { dexScreenerPlugin } from "@elizaos/plugin-dexscreener";
109110
import { pythDataPlugin } from "@elizaos/plugin-pyth-data";
111+
110112
import { openaiPlugin } from '@elizaos/plugin-openai';
113+
import { devinPlugin } from '@elizaos/plugin-devin';
114+
111115

112116
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
113117
import Database from "better-sqlite3";
@@ -209,7 +213,9 @@ export async function loadCharacterFromOnchain(): Promise<Character[]> {
209213

210214
// .id isn't really valid
211215
const characterId = character.id || character.name;
212-
const characterPrefix = `CHARACTER.${characterId.toUpperCase().replace(/ /g, "_")}.`;
216+
const characterPrefix = `CHARACTER.${characterId
217+
.toUpperCase()
218+
.replace(/ /g, "_")}.`;
213219

214220
const characterSettings = Object.entries(process.env)
215221
.filter(([key]) => key.startsWith(characterPrefix))
@@ -281,7 +287,9 @@ async function jsonToCharacter(
281287

282288
// .id isn't really valid
283289
const characterId = character.id || character.name;
284-
const characterPrefix = `CHARACTER.${characterId.toUpperCase().replace(/ /g, "_")}.`;
290+
const characterPrefix = `CHARACTER.${characterId
291+
.toUpperCase()
292+
.replace(/ /g, "_")}.`;
285293
const characterSettings = Object.entries(process.env)
286294
.filter(([key]) => key.startsWith(characterPrefix))
287295
.reduce((settings, [key, value]) => {
@@ -391,8 +399,9 @@ export async function loadCharacters(
391399
if (characterPaths?.length > 0) {
392400
for (const characterPath of characterPaths) {
393401
try {
394-
const character: Character =
395-
await loadCharacterTryPath(characterPath);
402+
const character: Character = await loadCharacterTryPath(
403+
characterPath
404+
);
396405
loadedCharacters.push(character);
397406
} catch (e) {
398407
process.exit(1);
@@ -555,9 +564,10 @@ export function getTokenForProvider(
555564
settings.VENICE_API_KEY
556565
);
557566
case ModelProviderName.ATOMA:
558-
return (
559-
character.settings?.secrets?.ATOMASDK_BEARER_AUTH ||
560-
settings.ATOMASDK_BEARER_AUTH
567+
return (
568+
character.settings?.secrets?.ATOMASDK_BEARER_AUTH ||
569+
settings.ATOMASDK_BEARER_AUTH
570+
);
561571
case ModelProviderName.NVIDIA:
562572
return (
563573
character.settings?.secrets?.NVIDIA_API_KEY ||
@@ -1051,9 +1061,18 @@ export async function createAgent(
10511061
getSecret(character, "PYTH_MAINNET_PROGRAM_KEY")
10521062
? pythDataPlugin
10531063
: null,
1054-
getSecret(character, "OPENAI_API_KEY") && getSecret(character, "ENABLE_OPEN_AI_COMMUNITY_PLUGIN")
1064+
getSecret(character, "LND_TLS_CERT") &&
1065+
getSecret(character, "LND_MACAROON") &&
1066+
getSecret(character, "LND_SOCKET")
1067+
? lightningPlugin
1068+
: null,
1069+
getSecret(character, "OPENAI_API_KEY") &&
1070+
getSecret(character, "ENABLE_OPEN_AI_COMMUNITY_PLUGIN")
10551071
? openaiPlugin
10561072
: null,
1073+
getSecret(character, "DEVIN_API_TOKEN")
1074+
? devinPlugin
1075+
: null,
10571076
].filter(Boolean),
10581077
providers: [],
10591078
actions: [],
@@ -1297,4 +1316,3 @@ if (
12971316
console.error("unhandledRejection", err);
12981317
});
12991318
}
1300-

packages/client-telegram/README.md

+32-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,43 @@ This plugin integrates a Telegram client with ElizaOS, allowing characters in El
44

55
## Features
66

7-
- **Seamless Telegram Integration**: Connects ElizaOS characters to Telegram through the bot API.
8-
- **Configuration Validation**: Ensures required settings are properly configured before starting.
9-
- **Startup Logging**: Logs successful initialization of the Telegram client for better debugging.
10-
- **Future-proof Design**: Provides a basic structure for stopping the client (currently unsupported).
7+
- **Seamless Telegram Integration**: Connects ElizaOS characters to Telegram through the bot API.
8+
- **Configuration Validation**: Ensures required settings are properly configured before starting.
9+
- **Startup Logging**: Logs successful initialization of the Telegram client for better debugging.
10+
- **Future-proof Design**: Provides a basic structure for stopping the client (currently unsupported).
1111

1212
## Configuration
1313

1414
Before starting the plugin, ensure the following environment variables or settings are configured:
1515

1616
TELEGRAM_BOT_TOKEN: The bot token obtained from the Telegram BotFather.
1717

18-
## License
18+
## Pre-Requisites
19+
20+
1. Add the token to the `.env` file in the project root:
21+
22+
```env
23+
TELEGRAM_BOT_TOKEN=your-bot-token
24+
```
25+
26+
2. Add the same token to your character configuration file:
27+
28+
Create or modify `characters/your-character.json`:
1929

30+
````json
31+
{
32+
"clients": ["telegram"],
33+
"secrets": {
34+
"key": "<your-bot-token>"
35+
}
36+
}
37+
+```
38+
39+
## From the project root:
40+
npm run dev
41+
42+
# Or using pnpm:
43+
pnpm start --character="characters/your-character.json"
44+
45+
## License
46+
````

packages/plugin-agentkit/src/index.ts

+14-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,26 @@ console.log("│ Initializing AgentKit Plugin... │");
1010
console.log("│ Version: 0.0.1 │");
1111
console.log("└════════════════════════════════════════┘");
1212

13+
const initializeActions = async () => {
14+
try {
15+
const actions = await getAgentKitActions({
16+
getClient,
17+
});
18+
console.log("✔ AgentKit actions initialized successfully.");
19+
return actions;
20+
} catch (error) {
21+
console.error("❌ Failed to initialize AgentKit actions:", error);
22+
return null;
23+
}
24+
};
25+
1326
export const agentKitPlugin: Plugin = {
1427
name: "[AgentKit] Integration",
1528
description: "AgentKit integration plugin",
1629
providers: [walletProvider],
1730
evaluators: [],
1831
services: [],
19-
actions: await getAgentKitActions({
20-
getClient,
21-
}),
32+
actions: await initializeActions(),
2233
};
2334

2435
export default agentKitPlugin;

packages/plugin-devin/README.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# @elizaos/plugin-devin
2+
3+
Devin API integration plugin for Eliza, providing automated engineering assistance through the Devin API.
4+
5+
## Installation
6+
7+
```bash
8+
pnpm add @elizaos/plugin-devin
9+
```
10+
11+
## Configuration
12+
13+
The plugin requires a Devin API token for authentication. Set the following environment variable:
14+
15+
```bash
16+
DEVIN_API_TOKEN=your_api_token_here
17+
```
18+
19+
Or configure it in your Eliza runtime settings:
20+
21+
```typescript
22+
runtime.setSetting("DEVIN_API_TOKEN", "your_api_token_here");
23+
```
24+
25+
## Features
26+
27+
- Session Management: Create and manage Devin engineering sessions
28+
- State Tracking: Monitor session status and progress
29+
- Client Agnostic: Works with any Eliza client implementation
30+
- Rate Limiting: Built-in API request rate limiting
31+
- Error Handling: Comprehensive error handling with retries
32+
33+
## Usage
34+
35+
### Actions
36+
37+
#### START_DEVIN_SESSION
38+
39+
Creates a new Devin session with the specified prompt.
40+
41+
```typescript
42+
const result = await runtime.runAction("START_DEVIN_SESSION", {
43+
content: { text: "Help me refactor this code" }
44+
});
45+
```
46+
47+
### Providers
48+
49+
#### devinProvider
50+
51+
Manages Devin session state and provides session information.
52+
53+
```typescript
54+
const state = await runtime.getState();
55+
const devinState = state.devin;
56+
57+
// Access session details
58+
console.log(devinState.sessionId);
59+
console.log(devinState.status);
60+
console.log(devinState.url);
61+
```
62+
63+
## Testing
64+
65+
Run the test suite:
66+
67+
```bash
68+
pnpm test
69+
```
70+
71+
## API Documentation
72+
73+
For detailed API documentation, visit:
74+
- [Devin API Integration Guide](https://docs.devin.ai/tutorials/api-integration)
75+
- [External API Reference](https://docs.devin.ai/external-api/)
76+
77+
## License
78+
79+
MIT

0 commit comments

Comments
 (0)