Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support autonome platform #2121

Merged
merged 7 commits into from
Jan 10, 2025
Merged

Conversation

autonome-ai
Copy link
Contributor

Relates to

Risks

Background

What does this PR do?

To support https://dev.autonome.fun platform, using Eliza launch Eliza anytime.

eliza.mp4

What kind of change is this?

Documentation changes needed?

Testing

Where should a reviewer start?

Detailed testing steps

Added two new environments:

AUTONOME_JWT_TOKEN=
AUTONOME_RPC=https://wizard-bff-rpc.alt.technology/v1/bff/aaa/apps

Once can login to https://dev.autonome.fun to get their JWT token from console, while AUTONOME_RPC is fixed for now and it is production already.

@wtfsayo
Copy link
Member

wtfsayo commented Jan 10, 2025

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jan 10, 2025

📝 Walkthrough

Walkthrough

This pull request introduces the Autonome plugin for the Eliza agent system. The changes include adding configuration options in .env.example, integrating a new @elizaos/plugin-autonome package, and implementing a launch agent functionality. The plugin enables conditional loading of Autonome-specific features based on JWT token configuration, expanding the agent's capabilities with a new RPC-based launch mechanism.

Changes

File Change Summary
.env.example Added two new configuration entries: AUTONOME_JWT_TOKEN and AUTONOME_RPC
agent/package.json Added @elizaos/plugin-autonome as a workspace dependency
agent/src/index.ts Imported autonomePlugin and conditionally added to agent plugins
packages/plugin-autonome/* Created new package with configuration files, source code, and plugin implementation for launching agents via RPC

Finishing Touches

  • 📝 CodeRabbit is generating docstrings... (♻️ Check again to generate again)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (4)
packages/plugin-autonome/src/actions/launchAgent.ts (3)

71-75: Avoid Using Deprecated Function generateObjectDeprecated

The function generateObjectDeprecated is deprecated. Consider using the updated function to ensure future compatibility.


116-116: Simplify Condition with Optional Chaining

You can simplify the conditional check using optional chaining for better readability.

Apply this diff:

-    if (resp && resp.data && resp.data.app && resp.data.app.id) {
+    if (resp?.data?.app?.id) {
🧰 Tools
🪛 Biome (1.9.4)

[error] 116-116: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


144-146: Handle Errors Safely in Catch Block

The error object may not always have a message property. Use a fallback to prevent undefined errors.

Apply this diff:

                     callback({
-                        text: `Error launching agent: ${error.message}`,
-                        content: { error: error.message },
+                        text: `Error launching agent: ${error?.message || error}`,
+                        content: { error: error?.message || error },
                     });
.env.example (1)

479-482: Document JWT token requirements and consider RPC URL flexibility.

While the RPC URL is confirmed to be in production, consider:

  1. Adding a comment describing the JWT token format and how to obtain it
  2. Making the RPC URL configurable for different environments (dev/staging)
 # Autonome Configuration
-AUTONOME_JWT_TOKEN=
+AUTONOME_JWT_TOKEN=                    # Format: xxx.yyy.zzz - Obtain from Autonome dashboard
-AUTONOME_RPC=https://wizard-bff-rpc.alt.technology/v1/bff/aaa/apps
+AUTONOME_RPC=                          # Default: https://wizard-bff-rpc.alt.technology/v1/bff/aaa/apps
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b249393 and 5fada5c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .env.example (1 hunks)
  • agent/package.json (1 hunks)
  • agent/src/index.ts (2 hunks)
  • packages/plugin-autonome/.npmignore (1 hunks)
  • packages/plugin-autonome/eslint.config.mjs (1 hunks)
  • packages/plugin-autonome/package.json (1 hunks)
  • packages/plugin-autonome/src/actions/launchAgent.ts (1 hunks)
  • packages/plugin-autonome/src/index.ts (1 hunks)
  • packages/plugin-autonome/tsconfig.json (1 hunks)
  • packages/plugin-autonome/tsup.config.ts (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • packages/plugin-autonome/.npmignore
  • packages/plugin-autonome/eslint.config.mjs
  • packages/plugin-autonome/tsup.config.ts
  • packages/plugin-autonome/tsconfig.json
  • packages/plugin-autonome/package.json
🧰 Additional context used
🪛 Biome (1.9.4)
packages/plugin-autonome/src/actions/launchAgent.ts

[error] 116-116: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (3)
packages/plugin-autonome/src/index.ts (1)

1-12: Code Implementation Looks Good

The autonomePlugin is correctly defined and exported.

agent/src/index.ts (1)

74-74: Correct Integration of autonomePlugin

The autonomePlugin is properly imported and conditionally included based on AUTONOME_JWT_TOKEN. This ensures the plugin is only activated when configured.

Also applies to: 641-641

agent/package.json (1)

60-60: LGTM! Dependency addition follows workspace conventions.

The new Autonome plugin dependency is correctly added with workspace syntax.

packages/plugin-autonome/src/actions/launchAgent.ts Outdated Show resolved Hide resolved
packages/plugin-autonome/src/actions/launchAgent.ts Outdated Show resolved Hide resolved
packages/plugin-autonome/src/actions/launchAgent.ts Outdated Show resolved Hide resolved
odilitime and others added 5 commits January 10, 2025 10:28
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@elizaOS elizaOS deleted a comment from coderabbitai bot Jan 10, 2025
@wtfsayo wtfsayo self-requested a review January 10, 2025 18:52
@wtfsayo wtfsayo enabled auto-merge (squash) January 10, 2025 18:57
@wtfsayo wtfsayo merged commit e1b7c80 into elizaOS:develop Jan 10, 2025
4 checks passed
0xpi-ai pushed a commit to 0xpi-ai/NayariAI that referenced this pull request Jan 15, 2025
* feat: support autonome platform

* Update packages/plugin-autonome/src/actions/launchAgent.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix typo

* Update packages/plugin-autonome/src/actions/launchAgent.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Sayo <hi@sayo.wtf>
Co-authored-by: Odilitime <janesmith@airmail.cc>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants