Skip to content

Commit 7fea444

Browse files
authored
Merge branch 'develop' into 1223-fix-todos
2 parents 6f6bf6d + 5acaaf8 commit 7fea444

File tree

31 files changed

+1260
-320
lines changed

31 files changed

+1260
-320
lines changed

.env.example

+5
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ TOGETHER_API_KEY=
191191
# Server Configuration
192192
SERVER_PORT=3000
193193

194+
# Abstract Configuration
195+
ABSTRACT_ADDRESS=
196+
ABSTRACT_PRIVATE_KEY=
197+
ABSTRACT_RPC_URL=https://api.testnet.abs.xyz
198+
194199
# Starknet Configuration
195200
STARKNET_ADDRESS=
196201
STARKNET_PRIVATE_KEY=

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ concatenated-output.ts
99
embedding-cache.json
1010
packages/plugin-buttplug/intiface-engine
1111

12+
.idea
1213
.DS_Store
1314

1415
dist/

agent/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@elizaos/client-slack": "workspace:*",
3131
"@elizaos/core": "workspace:*",
3232
"@elizaos/plugin-0g": "workspace:*",
33+
"@elizaos/plugin-abstract": "workspace:*",
3334
"@elizaos/plugin-aptos": "workspace:*",
3435
"@elizaos/plugin-bootstrap": "workspace:*",
3536
"@elizaos/plugin-intiface": "workspace:*",
@@ -51,6 +52,7 @@
5152
"@elizaos/plugin-multiversx": "workspace:*",
5253
"@elizaos/plugin-near": "workspace:*",
5354
"@elizaos/plugin-zksync-era": "workspace:*",
55+
"@elizaos/plugin-3d-generation": "workspace:*",
5456
"readline": "1.3.0",
5557
"ws": "8.18.0",
5658
"yargs": "17.7.2"

agent/src/index.ts

+8-29
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { evmPlugin } from "@elizaos/plugin-evm";
4646
import { storyPlugin } from "@elizaos/plugin-story";
4747
import { flowPlugin } from "@elizaos/plugin-flow";
4848
import { imageGenerationPlugin } from "@elizaos/plugin-image-generation";
49+
import { ThreeDGenerationPlugin } from "@elizaos/plugin-3d-generation";
4950
import { multiversxPlugin } from "@elizaos/plugin-multiversx";
5051
import { nearPlugin } from "@elizaos/plugin-near";
5152
import { nftGenerationPlugin } from "@elizaos/plugin-nft-generation";
@@ -55,6 +56,7 @@ import { suiPlugin } from "@elizaos/plugin-sui";
5556
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
5657
import { tonPlugin } from "@elizaos/plugin-ton";
5758
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
59+
import { abstractPlugin } from "@elizaos/plugin-abstract";
5860
import Database from "better-sqlite3";
5961
import fs from "fs";
6062
import path from "path";
@@ -386,12 +388,8 @@ export async function initializeClients(
386388

387389
if (clientTypes.includes(Clients.TWITTER)) {
388390
const twitterClient = await TwitterClientInterface.start(runtime);
389-
390391
if (twitterClient) {
391392
clients.twitter = twitterClient;
392-
(twitterClient as any).enableSearch = !isFalsish(
393-
getSecret(character, "TWITTER_SEARCH_ENABLE")
394-
);
395393
}
396394
}
397395

@@ -433,31 +431,6 @@ export async function initializeClients(
433431
return clients;
434432
}
435433

436-
function isFalsish(input: any): boolean {
437-
// If the input is exactly NaN, return true
438-
if (Number.isNaN(input)) {
439-
return true;
440-
}
441-
442-
// Convert input to a string if it's not null or undefined
443-
const value = input == null ? "" : String(input);
444-
445-
// List of common falsish string representations
446-
const falsishValues = [
447-
"false",
448-
"0",
449-
"no",
450-
"n",
451-
"off",
452-
"null",
453-
"undefined",
454-
"",
455-
];
456-
457-
// Check if the value (trimmed and lowercased) is in the falsish list
458-
return falsishValues.includes(value.trim().toLowerCase());
459-
}
460-
461434
function getSecret(character: Character, secret: string) {
462435
return character.settings?.secrets?.[secret] || process.env[secret];
463436
}
@@ -544,6 +517,9 @@ export async function createAgent(
544517
getSecret(character, "HEURIST_API_KEY")
545518
? imageGenerationPlugin
546519
: null,
520+
getSecret(character, "FAL_API_KEY")
521+
? ThreeDGenerationPlugin
522+
: null,
547523
...(getSecret(character, "COINBASE_API_KEY") &&
548524
getSecret(character, "COINBASE_PRIVATE_KEY")
549525
? [
@@ -562,6 +538,9 @@ export async function createAgent(
562538
? webhookPlugin
563539
: null,
564540
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
541+
getSecret(character, "ABSTRACT_PRIVATE_KEY")
542+
? abstractPlugin
543+
: null,
565544
getSecret(character, "FLOW_ADDRESS") &&
566545
getSecret(character, "FLOW_PRIVATE_KEY")
567546
? flowPlugin

docs/docs/advanced/eliza-in-tee.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const quote = await provider.generateAttestation(reportData);
101101
Before getting started with Eliza, ensure you have:
102102

103103
- [Docker Desktop](https://www.docker.com/products/docker-desktop/) or [Orbstack](https://orbstack.dev/) (Orbstack is recommended)
104-
- For Mac/Windows: Check the prerequisites from [Quickstart Guide](./quickstart.md)
104+
- For Mac/Windows: Check the prerequisites from [Quickstart Guide](../quickstart.md)
105105
- For Linux: You just need Docker
106106

107107
---
@@ -144,7 +144,7 @@ To set up your environment for TEE development:
144144
145145
1. **Configure Eliza Agent**
146146
147-
Go through the [configuration guide](./configuration.md) to set up your Eliza agent.
147+
Go through the [configuration guide](../guides/configuration.md) to set up your Eliza agent.
148148
149149
2. **Start the TEE Simulator**
150150
Follow the simulator setup instructions above based on your TEE mode.

docs/docs/core/actions.md

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ interface Action {
3131
examples: ActionExample[][];
3232
handler: Handler;
3333
validate: Validator;
34+
suppressInitialMessage?: boolean;
3435
}
3536
```
3637

@@ -151,6 +152,7 @@ interface Action {
151152
state?: State,
152153
) => Promise<void>;
153154
examples: ActionExample[][];
155+
suppressInitialMessage?: boolean;
154156
}
155157
```
156158

@@ -162,6 +164,7 @@ interface Action {
162164
- **validate**: Determines if the action can be executed
163165
- **handler**: Implements the action's behavior
164166
- **examples**: Demonstrates proper usage patterns
167+
- **suppressInitialMessage**: When true, suppresses the initial response message before processing the action. Useful for actions that generate their own responses (like image generation)
165168

166169
---
167170

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"preinstall": "npx only-allow pnpm",
55
"build": "turbo run build --filter=!eliza-docs",
66
"build-docker": "turbo run build",
7+
"cleanstart": "if [ -f agent/data/db.sqlite ]; then rm agent/data/db.sqlite; fi && pnpm --filter \"@elizaos/agent\" start --isRoot",
8+
"cleanstart:debug": "if [ -f agent/data/db.sqlite ]; then rm agent/data/db.sqlite; fi && cross-env NODE_ENV=development VERBOSE=true DEBUG=eliza:* pnpm --filter \"@elizaos/agent\" start --isRoot",
79
"start": "pnpm --filter \"@elizaos/agent\" start --isRoot",
810
"start:client": "pnpm --dir client dev",
911
"start:debug": "cross-env NODE_ENV=development VERBOSE=true DEBUG=eliza:* pnpm --filter \"@elizaos/agent\" start --isRoot",

packages/client-direct/src/index.ts

+18-3
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ export class DirectClient {
222222

223223
await runtime.evaluate(memory, state);
224224

225+
// Check if we should suppress the initial message
226+
const action = runtime.actions.find(
227+
(a) => a.name === response.action
228+
);
229+
const shouldSuppressInitialMessage =
230+
action?.suppressInitialMessage;
231+
225232
const _result = await runtime.processActions(
226233
memory,
227234
[responseMessage],
@@ -232,10 +239,18 @@ export class DirectClient {
232239
}
233240
);
234241

235-
if (message) {
236-
res.json([response, message]);
242+
if (!shouldSuppressInitialMessage) {
243+
if (message) {
244+
res.json([response, message]);
245+
} else {
246+
res.json([response]);
247+
}
237248
} else {
238-
res.json([response]);
249+
if (message) {
250+
res.json([message]);
251+
} else {
252+
res.json([]);
253+
}
239254
}
240255
}
241256
);

packages/client-twitter/src/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ export const TwitterClientInterface: Client = {
3434

3535
elizaLogger.log("Twitter client started");
3636

37-
const manager = new TwitterManager(runtime, this.enableSearch);
37+
const manager = new TwitterManager(runtime, runtime.getSetting("TWITTER_SEARCH_ENABLE").toLowerCase() === "true");
3838

3939
await manager.client.init();
4040

4141
await manager.post.start();
4242

43+
if (manager.search)
44+
await manager.search.start();
45+
4346
await manager.interaction.start();
4447

4548
await manager.search?.start();

packages/client-twitter/src/search.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SearchMode } from "agent-twitter-client";
2-
import { composeContext } from "@elizaos/core";
2+
import {composeContext, elizaLogger} from "@elizaos/core";
33
import { generateMessageResponse, generateText } from "@elizaos/core";
44
import { messageCompletionFooter } from "@elizaos/core";
55
import {
@@ -59,10 +59,12 @@ export class TwitterSearchClient {
5959
}
6060

6161
private engageWithSearchTermsLoop() {
62-
this.engageWithSearchTerms();
62+
this.engageWithSearchTerms().then();
63+
const randomMinutes = (Math.floor(Math.random() * (120 - 60 + 1)) + 60);
64+
elizaLogger.log(`Next twitter search scheduled in ${randomMinutes} minutes`);
6365
setTimeout(
6466
() => this.engageWithSearchTermsLoop(),
65-
(Math.floor(Math.random() * (120 - 60 + 1)) + 60) * 60 * 1000
67+
randomMinutes * 60 * 1000
6668
);
6769
}
6870

0 commit comments

Comments
 (0)