-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 for with PDA #2107
Conversation
@coderabbitai review |
📝 WalkthroughWalkthroughThe pull request introduces a new 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: 7
🔭 Outside diff range comments (3)
packages/plugin-iq6900/src/functions/bringIQData.ts (3)
Line range hint
254-255
: Avoid using spread syntax in reducers to improve performance.Using the spread operator (
...
) inside a reducer causes a new object to be created on each iteration, leading to O(n²) time complexity. Modify the accumulator object directly to enhance performance.Apply this diff:
- return { ...settings, [settingKey]: value }; + settings[settingKey] = value; + return settings;
Line range hint
309-310
: Avoid using spread syntax in reducers to improve performance.Similar to the previous comment, avoid using the spread operator inside the reducer.
Apply this diff:
- return { ...settings, [settingKey]: value }; + settings[settingKey] = value; + return settings;
Line range hint
236-289
: Remove duplicate 'loadCharacterFromOnchain' function declaration.The function
loadCharacterFromOnchain
is declared twice in this file (lines 236-289 and lines 291-344), causing a redeclaration error. Remove one of the declarations to fix this issue.Delete the duplicate function:
-// Duplicate 'loadCharacterFromOnchain' function starts here -// Lines 291 to 344 -// Remove these lines to eliminate the duplicate declaration.
🧹 Nitpick comments (6)
packages/plugin-iq6900/src/functions/bringIQData.ts (1)
25-25
: Replace 'console.error' with 'elizaLogger.error' for consistent logging.For consistent logging throughout the application, use
elizaLogger.error
instead ofconsole.error
.Apply this diff:
- console.error("Error fetching PDA:", error); + elizaLogger.error("Error fetching PDA:", error); - console.error("chunk data undefined"); + elizaLogger.error("Chunk data undefined"); - console.error("before data undefined"); + elizaLogger.error("Before data undefined");Also applies to: 116-116, 126-126
agent/src/index.ts (1)
1194-1199
: Clarify the logic for loading characters when on-chain data is available.The current logic may overwrite characters loaded from on-chain data if both
onchainJson
andcharactersArg
are present. Ensure that the character loading behavior reflects the intended priority.Consider updating the conditional statements to reflect the correct loading sequence.
packages/plugin-iq6900/tsup.config.ts (2)
8-8
: Remove misleading comment about CommonJSThe format is set to ESM but the comment suggests CommonJS targeting.
- format: ["esm"], // Ensure you're targeting CommonJS + format: ["esm"],
19-20
: Remove TODO placeholder commentThe comment "Add other modules you want to externalize" should be removed as it's a development placeholder.
- // Add other modules you want to externalize
packages/plugin-iq6900/README.md (2)
10-10
: Format URLs as markdown linksBare URLs should be formatted as proper markdown links for better readability.
-Go to the site and engrave your character file on-chain. https://elizacodein.com/ +Go to the site and engrave your character file on-chain. [Code-In Website](https://elizacodein.com/) -Learn more: https://linktr.ee/IQ6900Docs +Learn more: [IQ6900 Documentation](https://linktr.ee/IQ6900Docs)Also applies to: 28-28
🧰 Tools
🪛 Markdownlint (0.37.0)
10-10: null
Bare URL used(MD034, no-bare-urls)
19-20
: Improve setup instructions clarityThe setup instructions lack specific details about the command and environment variable.
-To be sure, right after inscription, wait about 5 minutes and just type pmpn start. You are now all set. +To be sure, right after inscription: +1. Wait about 5 minutes +2. Run `pnpm start` command +3. You are now all set.🧰 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)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
agent/package.json
(1 hunks)agent/src/index.ts
(9 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/eslint.config.mjs
- packages/plugin-iq6900/tsconfig.json
- packages/plugin-iq6900/.npmignore
- packages/plugin-iq6900/package.json
🧰 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)
🪛 Biome (1.9.4)
agent/src/index.ts
[error] 290-344: Illegal use of an export declaration not at the top level
move this declaration to the top level
(parse)
[error] 291-291: Shouldn't redeclare 'loadCharacterFromOnchain'. Consider to delete it or rename it.
'loadCharacterFromOnchain' is defined here:
(lint/suspicious/noRedeclare)
[error] 255-255: 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)
[error] 310-310: 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)
🔇 Additional comments (1)
agent/package.json (1)
75-75
: LGTM!The plugin dependency is correctly added using workspace syntax.
@zo-eth can you resolve these minor issues; lgtm otherwise |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Code In Plugin For Eliza
Description
Through IQ6900's new inscription standard "Code-In", powerful inscription functionality is provided to Eliza.
Engrave Eliza on the blockchain forever.
All your Character JSON files are input onto the blockchain without compression.
Everyone can read your agent from blocks forever.
inscription
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.
You have engraved an eternal record.
Imagine, someone could develop your agent 200 years from now.
Many things will be updated.
Learn more: https://linktr.ee/IQ6900Docs