-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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: Code In Plugin, load characters from blockchain #2371
base: develop
Are you sure you want to change the base?
Conversation
@coderabbitai review |
📝 WalkthroughWalkthroughThe pull request introduces a new IQ6900 plugin for the Eliza agent system, enabling on-chain character JSON loading. It adds configuration options in the Changes
Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🔭 Outside diff range comments (1)
packages/plugin-iq6900/src/functions/bringIQData.ts (1)
Line range hint
218-218
: Avoid using spread syntax in accumulator to prevent performance issuesUsing the spread operator
...settings
within the.reduce
accumulator can lead to O(n²) time complexity. Consider mutating the accumulator object directly for better performance.Apply this diff to fix the issue:
- return { ...settings, [settingKey]: value }; + settings[settingKey] = value; + return settings;
🧹 Nitpick comments (8)
packages/plugin-iq6900/src/functions/bringIQData.ts (1)
Line range hint
202-202
: Avoid logging sensitive dataLogging the entire
jsonText
may expose sensitive information. Consider removing or sanitizing this log statement in production.agent/src/index.ts (2)
202-202
: Avoid logging sensitive dataLogging
jsonText
may expose sensitive information. Consider removing or limiting this log statement.
1189-1189
: Clarify logical condition with parenthesesThe condition in the
if
statement may not evaluate as intended due to operator precedence. Adding parentheses can clarify the logic.Apply this diff:
- if (!onchainJson && charactersArg || hasValidRemoteUrls()) { + if ((!onchainJson && charactersArg) || hasValidRemoteUrls()) {packages/plugin-iq6900/src/types/iq.ts (1)
3-5
: Avoid unnecessary async IIFE for top-level awaitThe use of an async IIFE with
await
is unnecessary here. You can simplify the code by assigning the promise directly toonchainJson
without the extra function.Apply this diff:
-const onchainJson = await (async () => { - return await bringAgentWithWalletAddress(); -})(); +const onchainJson = await bringAgentWithWalletAddress();packages/plugin-iq6900/README.md (2)
10-10
: Enhance documentation formatting.Wrap URLs in proper markdown syntax for better readability.
-https://elizacodein.com/ +[Eliza Code-In Website](https://elizacodein.com/) -https://iq6900.gitbook.io/iq6900/eliza-code-in +[Learn More](https://iq6900.gitbook.io/iq6900/eliza-code-in)Also applies to: 28-28
🧰 Tools
🪛 Markdownlint (0.37.0)
10-10: null
Bare URL used(MD034, no-bare-urls)
19-20
: Clarify setup instructions.The setup instructions could be more explicit about the waiting period and command.
-To be sure, right after inscription, wait about 5 minutes and just type pmpn start. You are now all set. +After inscription, please: +1. Wait approximately 5 minutes for the transaction to finalize +2. Run `pnpm start` to initialize the plugin +3. Your agent will now load character data from the blockchain🧰 Tools
🪛 LanguageTool
[grammar] ~19-~19: It appears that an article is missing.
Context: ...to your wallet address that you used on website. To be sure, right after inscription, w...(IN_WEBSITE)
.env.example (2)
364-367
: Enhance documentation with JSON format example.Consider adding an example of the expected JSON character file format to help users understand what they need to inscribe.
368-369
: Fix configuration inconsistencies and consider security implications.
- The spacing around the equals sign in
IQSOlRPC
is inconsistent with other configurations.- Consider using a configurable RPC URL instead of hardcoding it.
Apply this diff to fix the spacing and make the RPC URL configurable:
IQ_WALLET_ADDRESS= # If you enter the wallet address used on the site, the most recently inscribed json will be loaded. -IQSOlRPC = https://api.mainnet-beta.solana.com +IQ_SOLANA_RPC_URL=https://api.mainnet-beta.solana.com # Override this with your preferred Solana RPC endpoint
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
.env.example
(1 hunks)agent/package.json
(1 hunks)agent/src/index.ts
(4 hunks)packages/plugin-iq6900/.npmignore
(1 hunks)packages/plugin-iq6900/README.md
(1 hunks)packages/plugin-iq6900/eslint.config.mjs
(1 hunks)packages/plugin-iq6900/package.json
(1 hunks)packages/plugin-iq6900/src/functions/bringIQData.ts
(1 hunks)packages/plugin-iq6900/src/index.ts
(1 hunks)packages/plugin-iq6900/src/types/iq.ts
(1 hunks)packages/plugin-iq6900/tsconfig.json
(1 hunks)packages/plugin-iq6900/tsup.config.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- packages/plugin-iq6900/.npmignore
- packages/plugin-iq6900/eslint.config.mjs
- packages/plugin-iq6900/tsconfig.json
- packages/plugin-iq6900/tsup.config.ts
🧰 Additional context used
🪛 LanguageTool
packages/plugin-iq6900/README.md
[grammar] ~19-~19: It appears that an article is missing.
Context: ...to your wallet address that you used on website. To be sure, right after inscription, w...
(IN_WEBSITE)
🪛 Markdownlint (0.37.0)
packages/plugin-iq6900/README.md
10-10: null
Bare URL used
(MD034, no-bare-urls)
28-28: null
Bare URL used
(MD034, no-bare-urls)
🪛 GitHub Actions: smoke-test
packages/plugin-iq6900/src/index.ts
[error] 429-429: Type mismatch error: Argument of type 'Connection' is not assignable to parameter of type 'Connection'. This suggests a version mismatch between @solana/web3.js dependencies across different packages.
agent/src/index.ts
[error] 429-429: Type mismatch error: Argument of type 'Connection' is not assignable to parameter of type 'Connection'. This suggests a version mismatch between @solana/web3.js dependencies across different packages.
🪛 Biome (1.9.4)
agent/src/index.ts
[error] 218-218: Avoid the use of spread (...
) syntax on accumulators.
Spread syntax should be avoided on accumulators (like those in .reduce
) because it causes a time complexity of O(n^2)
.
Consider methods such as .splice or .push instead.
(lint/performance/noAccumulatingSpread)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: integration-tests
🔇 Additional comments (2)
packages/plugin-iq6900/src/index.ts (1)
7-14
: Implementation appears incomplete.The plugin structure is defined but contains empty arrays for actions, providers, and evaluators. This seems inconsistent with the plugin's purpose of loading on-chain character data.
Would you like me to help implement the necessary actions and providers for character data loading?
agent/package.json (1)
73-73
: LGTM!The workspace dependency is correctly configured.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Relates to
Re-made due to environmental conflict
Risks
.env file is already exist, please check it once and remove the .env
Background
What does this PR do?
connect to IQ on-chain standard "code-in"
What kind of change is this?
Re-made due to environmental conflict
Detailed testing steps
inscription
how to :https://iq6900.gitbook.io/iq6900/eliza-code-in
Onchain git
Update your files anytime.
On our site, your files are managed in a format similar to GitHub,
and our plugin automatically loads your latest agent file.
Let's get started
To be sure, right after inscription, wait about 5 minutes and just type pmpn start. You are now all set.
Discord username
zo_eth