Skip to content

Commit

Permalink
Merge branch 'develop' into stakesei
Browse files Browse the repository at this point in the history
  • Loading branch information
mj850 authored Feb 3, 2025
2 parents 8cfce88 + 2330af2 commit 4284b77
Show file tree
Hide file tree
Showing 149 changed files with 6,545 additions and 27,871 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -952,4 +952,7 @@ ARBITRAGE_EVM_PRIVATE_KEY= # Private key for the wallet executi
FLASHBOTS_RELAY_SIGNING_KEY= # Signing key for Flashbots relay interactions
BUNDLE_EXECUTOR_ADDRESS= # Address of the bundle executor contract

# DESK Exchange Plugin Configration
DESK_EXCHANGE_PRIVATE_KEY= # Required for trading and cancelling orders
DESK_EXCHANGE_NETWORK= # "mainnet" or "testnet

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ scripts/bug_hunt/reports/*.md
lit-config.json

# Configuration to exclude the extra and local_docs directories
extra
extra
**/dist/**
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ WORKDIR /app
# Copy built artifacts and production dependencies from the builder stage
COPY --from=builder /app/package.json ./
COPY --from=builder /app/pnpm-workspace.yaml ./
COPY --from=builder /app/eslint.config.mjs ./
COPY --from=builder /app/.eslintrc.json ./
COPY --from=builder /app/.npmrc ./
COPY --from=builder /app/turbo.json ./
COPY --from=builder /app/node_modules ./node_modules
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

## ✨ Features

- 🛠️ Full-featured Discord, Twitter and Telegram connectors
- 🛠️ Full-featured Discord, X (Twitter) and Telegram connectors
- 🔗 Support for every model (Llama, Grok, OpenAI, Anthropic, Gemini, etc.)
- 👥 Multi-agent and room support
- 📚 Easily ingest and interact with your documents
Expand Down
4 changes: 2 additions & 2 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@
"@elizaos/plugin-coinmarketcap": "workspace:*",
"@elizaos/plugin-conflux": "workspace:*",
"@elizaos/plugin-cosmos": "workspace:*",
"@elizaos/plugin-desk-exchange": "workspace:*",
"@elizaos/plugin-echochambers": "workspace:*",
"@elizaos/plugin-evm": "workspace:*",
"@elizaos/plugin-edwin": "workspace:*",
"@elizaos/plugin-flow": "workspace:*",
"@elizaos/plugin-gelato": "workspace:*",
"@elizaos/plugin-giphy": "workspace:*",
Expand All @@ -66,9 +68,7 @@
"@elizaos/plugin-icp": "workspace:*",
"@elizaos/plugin-initia": "workspace:*",
"@elizaos/plugin-image-generation": "workspace:*",
"@elizaos/plugin-intiface": "workspace:*",
"@elizaos/plugin-lens-network": "workspace:*",
"@elizaos/plugin-letzai": "workspace:*",
"@elizaos/plugin-lit": "workspace:*",
"@elizaos/plugin-massa": "workspace:*",
"@elizaos/plugin-mind-network": "workspace:*",
Expand Down
11 changes: 10 additions & 1 deletion agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ import { coinmarketcapPlugin } from "@elizaos/plugin-coinmarketcap";
import { confluxPlugin } from "@elizaos/plugin-conflux";
import { createCosmosPlugin } from "@elizaos/plugin-cosmos";
import { cronosZkEVMPlugin } from "@elizaos/plugin-cronoszkevm";
import { deskExchangePlugin } from "@elizaos/plugin-desk-exchange";
import { evmPlugin } from "@elizaos/plugin-evm";
import { edwinPlugin } from "@elizaos/plugin-edwin";
import { flowPlugin } from "@elizaos/plugin-flow";
import { fuelPlugin } from "@elizaos/plugin-fuel";
import { genLayerPlugin } from "@elizaos/plugin-genlayer";
Expand Down Expand Up @@ -136,7 +138,6 @@ import { holdstationPlugin } from "@elizaos/plugin-holdstation";
import { nvidiaNimPlugin } from "@elizaos/plugin-nvidia-nim";
import { zxPlugin } from "@elizaos/plugin-0x";
import { hyperbolicPlugin } from "@elizaos/plugin-hyperbolic";
import { litPlugin } from "@elizaos/plugin-lit";
import Database from "better-sqlite3";
import fs from "fs";
import net from "net";
Expand Down Expand Up @@ -1068,6 +1069,10 @@ export async function createAgent(
getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
? evmPlugin
: null,
(getSecret(character, "EVM_PRIVATE_KEY") ||
getSecret(character, "SOLANA_PRIVATE_KEY"))
? edwinPlugin
: null,
(getSecret(character, "EVM_PUBLIC_KEY") ||
getSecret(character, "INJECTIVE_PUBLIC_KEY")) &&
getSecret(character, "INJECTIVE_PRIVATE_KEY")
Expand Down Expand Up @@ -1296,6 +1301,10 @@ export async function createAgent(
getSecret(character, "ARBITRAGE_BUNDLE_EXECUTOR_ADDRESS")
? arbitragePlugin
: null,
getSecret(character, "DESK_EXCHANGE_PRIVATE_KEY") ||
getSecret(character, "DESK_EXCHANGE_NETWORK")
? deskExchangePlugin
: null,
]
.flat()
.filter(Boolean),
Expand Down
22 changes: 12 additions & 10 deletions client/src/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ChatInput } from "@/components/ui/chat/chat-input";
import { ChatMessageList } from "@/components/ui/chat/chat-message-list";
import { useTransition, animated, type AnimatedProps } from "@react-spring/web";
import { Paperclip, Send, X } from "lucide-react";
import { useEffect, useRef, useState, useCallback } from "react";
import { useEffect, useRef, useState } from "react";
import type { Content, UUID } from "@elizaos/core";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { apiClient } from "@/lib/api";
Expand All @@ -22,6 +22,7 @@ import AIWriter from "react-aiwriter";
import type { IAttachment } from "@/types";
import { AudioRecorder } from "./audio-recorder";
import { Badge } from "./ui/badge";
import { useAutoScroll } from "./ui/chat/hooks/useAutoScroll";

type ExtraContentFields = {
user: string;
Expand All @@ -39,7 +40,6 @@ export default function Page({ agentId }: { agentId: UUID }) {
const { toast } = useToast();
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [input, setInput] = useState("");
const messagesContainerRef = useRef<HTMLDivElement>(null);
const inputRef = useRef<HTMLTextAreaElement>(null);
const fileInputRef = useRef<HTMLInputElement>(null);
const formRef = useRef<HTMLFormElement>(null);
Expand All @@ -49,13 +49,10 @@ export default function Page({ agentId }: { agentId: UUID }) {
const getMessageVariant = (role: string) =>
role !== "user" ? "received" : "sent";

const scrollToBottom = useCallback(() => {
if (messagesContainerRef.current) {
messagesContainerRef.current.scrollTop =
messagesContainerRef.current.scrollHeight;
}
}, []);

const { scrollRef, isAtBottom, scrollToBottom, disableAutoScroll } = useAutoScroll({
smooth: true,
});

useEffect(() => {
scrollToBottom();
}, [queryClient.getQueryData(["messages", agentId])]);
Expand Down Expand Up @@ -176,7 +173,12 @@ export default function Page({ agentId }: { agentId: UUID }) {
return (
<div className="flex flex-col w-full h-[calc(100dvh)] p-4">
<div className="flex-1 overflow-y-auto">
<ChatMessageList ref={messagesContainerRef}>
<ChatMessageList
scrollRef={scrollRef}
isAtBottom={isAtBottom}
scrollToBottom={scrollToBottom}
disableAutoScroll={disableAutoScroll}
>
{transitions((style, message: ContentWithUser) => {
const variant = getMessageVariant(message?.user);
return (
Expand Down
13 changes: 5 additions & 8 deletions client/src/components/ui/chat/chat-message-list.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import * as React from "react";
import { ArrowDown } from "lucide-react";
import { Button } from "@/components/ui/button";
import { useAutoScroll } from "@/components/ui/chat/hooks/useAutoScroll";

interface ChatMessageListProps extends React.HTMLAttributes<HTMLDivElement> {
scrollRef: React.RefObject<HTMLDivElement | null>;
isAtBottom: boolean;
scrollToBottom: () => void;
disableAutoScroll: () => void;
smooth?: boolean;
}

const ChatMessageList = React.forwardRef<HTMLDivElement, ChatMessageListProps>(
({ className, children, smooth = false, ...props }, _ref) => {
const { scrollRef, isAtBottom, scrollToBottom, disableAutoScroll } =
useAutoScroll({
smooth,
content: children,
});

({ className, children, scrollRef, isAtBottom, scrollToBottom, disableAutoScroll, ...props }) => {
return (
<div className="relative w-full h-full">
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The conversation focused on integrating @bigdookie's artwork as bumpers in their
- Do we need video producers? Why is it complicated for comfy stuff to be fast-paced? (asked by [boom](09:56))
- What are the next steps in establishing a Creative Studio and bidding on projects? How does budget influence project success? (asked by [whobody, boom](10:27))
- How will the open-source approach help us? How can Banodoco handle bids on their end? (asked by [boom (10:00)])
- Can we prompt an engineer to help the story arch or main punchlines for AI-assisted writing? How does it come together with human and AI collaboration in filmmaking? (asked by [boom] (10:05))
- Can we prompt an engineer to help the story arc or main punchlines for AI-assisted writing? How does it come together with human and AI collaboration in filmmaking? (asked by [boom] (10:05))

## Who Helped Who

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Summary

In the chat, Cyfer785 sought assistance for creating a frontend interface that would display AI-generated content in a retro style with live scrolling text, reminiscent of Claude's capabilities but tailored to their own AI pipe output. DegenSpartan and Poe engaged in the conversation, suggesting that Cyfer785 was essentially attempting to replicate features from existing projects like Infinite Backrooms and Claude without adding original value. The discussion highlighted a divergence of interests as Cyfer785's vision did not align with what DegenSpartan and Poe were willing or able to provide, leading to the conclusion that they were not suitable collaborators for this project. Despite some initial enthusiasm from other participants like astr0x., who humorously claimed a share of non-existent profits, the technical focus remained on Cyfer785's request for a unique AI interface development.
In the chat, Cyfer785 sought assistance for creating a frontend interface that would display AI-generated content in a retro style with live scrolling text, reminiscent of Claude's capabilities but tailored to their own AI pipe output. DegenSpartan and Poe engaged in the conversation, suggesting that Cyfer785 was essentially attempting to replicate features from existing projects like Infinite Backrooms and Claude without adding original value. The discussion highlighted a divergence of interests as Cyfer785's vision did not align with what DegenSpartan and Poe were willing or able to provide, leading to the conclusion that they were not suitable collaborators for this project. Despite some initial enthusiasm from other participants like astr0x, who humorously claimed a share of non-existent profits, the technical focus remained on Cyfer785's request for a unique AI interface development.

## FAQ

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@polkadot/types-codec": "10.13.1",
"@polkadot/keyring": "12.6.2",
"@ai-sdk/provider": "1.0.6",
"@ai-sdk/provider-utils": "2.1.2",
"@ai-sdk/provider-utils": "2.1.6",
"cookie": "0.7.0",
"bs58": "5.0.0",
"@coral-xyz/anchor": "0.28.0"
Expand Down
2 changes: 2 additions & 0 deletions packages/client-twitter/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export async function buildConversationThread(
text: currentTweet.text,
source: "twitter",
url: currentTweet.permanentUrl,
imageUrls: currentTweet.photos.map((p) => p.url) || [],
inReplyTo: currentTweet.inReplyToStatusId
? stringToUuid(
currentTweet.inReplyToStatusId +
Expand Down Expand Up @@ -278,6 +279,7 @@ export async function sendTweet(
text: tweet.text,
source: "twitter",
url: tweet.permanentUrl,
imageUrls: tweet.photos.map((p) => p.url) || [],
inReplyTo: tweet.inReplyToStatusId
? stringToUuid(
tweet.inReplyToStatusId + "-" + client.runtime.agentId
Expand Down
7 changes: 7 additions & 0 deletions packages/core/__tests__/parsing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ describe("Parsing Module", () => {
});
});

it("should parse JSON objects containing array values", () => {
const input = '{"key": ["item1", "item2", "item3"]}';
expect(parseJSONObjectFromText(input)).toEqual({
key: ["item1", "item2", "item3"],
});
});

it("should handle empty objects", () => {
expect(parseJSONObjectFromText("```json\n{}\n```")).toEqual({});
expect(parseJSONObjectFromText("{}")).toEqual({});
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
"@ai-sdk/google-vertex": "0.0.43",
"@ai-sdk/groq": "0.0.3",
"@ai-sdk/mistral": "1.0.9",
"@ai-sdk/openai": "1.0.5",
"@ai-sdk/openai": "1.1.9",
"@ai-sdk/amazon-bedrock": "1.1.0",
"@fal-ai/client": "1.2.0",
"@tavily/core": "^0.0.2",
"@types/uuid": "10.0.0",
"ai": "3.4.33",
"ai": "4.1.16",
"anthropic-vertex-ai": "1.0.2",
"dotenv": "16.4.5",
"fastembed": "1.14.1",
Expand All @@ -84,7 +84,7 @@
"js-tiktoken": "1.0.15",
"langchain": "0.3.6",
"ollama-ai-provider": "0.16.1",
"openai": "4.73.0",
"openai": "4.82.0",
"pino": "^9.6.0",
"pino-pretty": "^13.0.0",
"tinyld": "1.3.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function parseJSONObjectFromText(
} catch (e) {
console.error("Error parsing JSON:", e);
console.error("Text is not JSON", text);
return extractAttributes(parsingText);
return extractAttributes(text);
}
} else {
const objectPattern = /{[\s\S]*?}/;
Expand All @@ -165,7 +165,7 @@ export function parseJSONObjectFromText(
} catch (e) {
console.error("Error parsing JSON:", e);
console.error("Text is not JSON", text);
return extractAttributes(parsingText);
return extractAttributes(text);
}
}
}
Expand Down Expand Up @@ -237,7 +237,7 @@ export const normalizeJsonString = (str: string) => {

// "key": unquotedValue → "key": "unquotedValue"
str = str.replace(
/("[\w\d_-]+")\s*: \s*(?!")([\s\S]+?)(?=(,\s*"|\}$))/g,
/("[\w\d_-]+")\s*: \s*(?!"|\[)([\s\S]+?)(?=(,\s*"|\}$))/g,
'$1: "$2"',
);

Expand Down
41 changes: 41 additions & 0 deletions packages/plugin-0g/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"organizeImports": {
"enabled": false
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedVariables": "error"
},
"suspicious": {
"noExplicitAny": "error"
},
"style": {
"useConst": "error",
"useImportType": "off"
}
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingCommas": "es5"
}
},
"files": {
"ignore": [
"dist/**/*",
"extra/**/*",
"node_modules/**/*"
]
}
}
3 changes: 0 additions & 3 deletions packages/plugin-0g/eslint.config.mjs

This file was deleted.

6 changes: 5 additions & 1 deletion packages/plugin-0g/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@
"tsup": "8.3.5"
},
"devDependencies": {
"@biomejs/biome": "1.5.3",
"vitest": "^1.2.1"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch",
"test": "vitest run",
"lint": "eslint --fix --cache ."
"lint": "biome check src/",
"lint:fix": "biome check --apply src/",
"format": "biome format src/",
"format:fix": "biome format --write src/"
}
}
Loading

0 comments on commit 4284b77

Please sign in to comment.