Skip to content

Commit 29af514

Browse files
authored
Merge branch 'develop' into vishal/nft-docs
2 parents 1c8868f + 2af3ba2 commit 29af514

File tree

35 files changed

+975
-384
lines changed

35 files changed

+975
-384
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=
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Generate Readme Translations
2+
on:
3+
push:
4+
branches:
5+
- "1222--README-ci-auto-translation"
6+
7+
jobs:
8+
translation:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
language: [
13+
{code: 'CN', name: 'Chinese'},
14+
{code: 'DE', name: 'German'},
15+
{code: 'ES', name: 'Spanish'},
16+
{code: 'FR', name: 'French'},
17+
{code: 'HE', name: 'Hebrew'},
18+
{code: 'IT', name: 'Italian'},
19+
{code: 'JA', name: 'Japanese'},
20+
{code: 'KOR', name: 'Korean'},
21+
{code: 'PTBR', name: 'Portuguese (Brazil)'},
22+
{code: 'RU', name: 'Russian'},
23+
{code: 'TH', name: 'Thai'},
24+
{code: 'TR', name: 'Turkish'},
25+
{code: 'VI', name: 'Vietnamese'}
26+
]
27+
permissions:
28+
contents: write
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
ref: main
33+
token: ${{ secrets.GH_TOKEN }}
34+
35+
- name: Translate to ${{ matrix.language.name }}
36+
uses: 0xjord4n/aixion@v1.2.1
37+
id: aixion
38+
with:
39+
config: >
40+
{
41+
"provider": "openai",
42+
"provider_options": {
43+
"api_key": "${{ secrets.OPENAI_API_KEY }}"
44+
},
45+
"messages": [
46+
{
47+
"role": "system",
48+
"content": "You will be provided with a markdown file in English, and your task is to translate it into ${{ matrix.language.name }}."
49+
},
50+
{
51+
"role": "user",
52+
"content_path": "README.md"
53+
}
54+
],
55+
"save_path": "README_${{ matrix.language.code }}.md",
56+
"model": "gpt-4o"
57+
}
58+
59+
# Upload each translated file as an artifact
60+
- name: Upload translation
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: readme-${{ matrix.language.code }}
64+
path: README_${{ matrix.language.code }}.md
65+
66+
commit:
67+
needs: translation
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
with:
72+
ref: main
73+
token: ${{ secrets.GH_TOKEN }}
74+
75+
# Download all translation artifacts
76+
- name: Download all translations
77+
uses: actions/download-artifact@v4
78+
with:
79+
pattern: readme-*
80+
merge-multiple: true
81+
82+
- name: Commit all translations
83+
uses: stefanzweifel/git-auto-commit-action@v5
84+
with:
85+
commit_message: "chore: update all README translations"
86+
branch: main
87+
file_pattern: "README_*.md"
88+
commit_author: "GitHub Action <actions@github.com>"

.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

+1
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:*",

agent/src/index.ts

+4-29
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { suiPlugin } from "@elizaos/plugin-sui";
5555
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
5656
import { tonPlugin } from "@elizaos/plugin-ton";
5757
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
58+
import { abstractPlugin } from "@elizaos/plugin-abstract";
5859
import Database from "better-sqlite3";
5960
import fs from "fs";
6061
import path from "path";
@@ -386,12 +387,8 @@ export async function initializeClients(
386387

387388
if (clientTypes.includes(Clients.TWITTER)) {
388389
const twitterClient = await TwitterClientInterface.start(runtime);
389-
390390
if (twitterClient) {
391391
clients.twitter = twitterClient;
392-
(twitterClient as any).enableSearch = !isFalsish(
393-
getSecret(character, "TWITTER_SEARCH_ENABLE")
394-
);
395392
}
396393
}
397394

@@ -433,31 +430,6 @@ export async function initializeClients(
433430
return clients;
434431
}
435432

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-
461433
function getSecret(character: Character, secret: string) {
462434
return character.settings?.secrets?.[secret] || process.env[secret];
463435
}
@@ -562,6 +534,9 @@ export async function createAgent(
562534
? webhookPlugin
563535
: null,
564536
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
537+
getSecret(character, "ABSTRACT_PRIVATE_KEY")
538+
? abstractPlugin
539+
: null,
565540
getSecret(character, "FLOW_ADDRESS") &&
566541
getSecret(character, "FLOW_PRIVATE_KEY")
567542
? flowPlugin

docs/community/Notes/lore.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Week 1 Recap: elizaos Launch and Early Developments
9393

9494
Hello, I am Shaw. I am a cross-disciplinary programmer and entrepreneur living in San Francisco. I have been working on autonomous agents for several years and I am overjoyed to finally get to show that to all of you.
9595

96-
I started elizaos here on Twitter with some very capable folks, in the open, using the http://daos.fun platform. Our technology is open source, and powering many of the agents you talk to today. We call this type of agent an eliza.
96+
I started elizaos here on Twitter with some very capable folks, in the open, using the http://daos.fun platform. Our technology is open source, and powering many of the agents you talk to today. We call this type of agent an "eliza".
9797

9898
Our token character agent is @degenspartanai who is a recreation of a legendary friend and poster who quit Twitter last cycle. $degenai is his token.
9999

docs/community/creator-fund.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Here's when the community learned about who the top holder is:
1818

1919
> "So a ton of people have been asking (justifiably) who the heck I am, why do I have 16% of elizaos supply, and what I’m going to do with it.
2020
>
21-
> It started by @shawmakesmagic tweeting about some agent he built called @degenspartanai, a recreation of a legend on twitter. I put a bunch of my SOL in there because I had been following Shaw and really thought he was building something great. Almost immediately all of that became close to worthless. Degen’s tweets seemed too human-like to be real anyway - so I figured I got scammed.
21+
> It started by @shawmakesmagic tweeting about some agent he built called @degenspartanai, a recreation of a legend on twitter. I put a bunch of my SOL in there because I had been following Shaw and really thought he was building something great. Almost immediately all of that became close to worthless. Degen’s tweets seemed too "human-like" to be real anyway - so I figured I got scammed.
2222
>
2323
> So I DM’ed shaw, not because I was angry, but I was genuinely curious why he might have scammed me. I ended up sending him a google meet, which turned into an hour long conversation about what he was actually building, and me realizing twitter is usually a misrepresentation of the people you think you know. Shaw is just inspiring. Someone who is completely dedicated to accelerating the world for the better, and not optimizing for optics or money - just building.
2424
>

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The TEE Plugin in the Eliza Framework is built on top of the [Dstack SDK](https:
2323

2424
## Core Components
2525

26-
Eliza's TEE implementation consists of two primary providers that handle secure key managementoperations and remote attestations.
26+
Eliza's TEE implementation consists of two primary providers that handle secure key management operations and remote attestations.
2727

2828
These components work together to provide:
2929

@@ -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/adapter-sqljs/src/types.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ declare class Statement {
100100
getSQL(): string;
101101

102102
/**
103-
* Reset a statement, so that it's parameters can be bound to new
103+
* Reset a statement, so that its parameters can be bound to new
104104
* values. It also clears all previous bindings, freeing the memory used
105105
* by bound parameters.
106106
* @see [https://sql.js.org/documentation/Statement.html#["reset"]](https://sql.js.org/documentation/Statement.html#%5B%22reset%22%5D)
@@ -115,7 +115,7 @@ declare class Statement {
115115
run(values?: BindParams): void;
116116

117117
/**
118-
* Execute the statement, fetching the the next line of result, that can
118+
* Execute the statement, fetching the next line of result, that can
119119
* be retrieved with `Statement.get`.
120120
* @see [https://sql.js.org/documentation/Statement.html#["step"]](https://sql.js.org/documentation/Statement.html#%5B%22step%22%5D)
121121
*/
@@ -169,7 +169,7 @@ export declare class Database {
169169
getRowsModified(): number;
170170

171171
/**
172-
* Analyze a result code, return null if no error occured, and throw an
172+
* Analyze a result code, return null if no error occurred, and throw an
173173
* error with a descriptive message otherwise
174174
* @see [https://sql.js.org/documentation/Database.html#["handleError"]](https://sql.js.org/documentation/Database.html#%5B%22handleError%22%5D)
175175
*/

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-github/src/index.ts

+21-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ export class GitHubClient {
5757

5858
// Clone or pull repository
5959
if (!existsSync(this.repoPath)) {
60-
await this.git.clone(
61-
`https://github.com/${this.config.owner}/${this.config.repo}.git`,
62-
this.repoPath
63-
);
60+
await this.cloneRepository();
6461
} else {
6562
const git = simpleGit(this.repoPath);
6663
await git.pull();
@@ -73,6 +70,26 @@ export class GitHubClient {
7370
}
7471
}
7572

73+
private async cloneRepository() {
74+
const repositoryUrl = `https://github.com/${this.config.owner}/${this.config.repo}.git`;
75+
const maxRetries = 3;
76+
let retries = 0;
77+
78+
while (retries < maxRetries) {
79+
try {
80+
await this.git.clone(repositoryUrl, this.repoPath);
81+
elizaLogger.log(`Successfully cloned repository from ${repositoryUrl}`);
82+
return;
83+
} catch (error) {
84+
elizaLogger.error(`Failed to clone repository from ${repositoryUrl}. Retrying...`);
85+
retries++;
86+
if (retries === maxRetries) {
87+
throw new Error(`Unable to clone repository from ${repositoryUrl} after ${maxRetries} retries.`);
88+
}
89+
}
90+
}
91+
}
92+
7693
async createMemoriesFromFiles() {
7794
console.log("Create memories");
7895
const searchPath = this.config.path

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)