-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: Add Quick Intel plugin #2391
base: develop
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA new plugin called 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: 2
🧹 Nitpick comments (5)
packages/plugin-quick-intel/src/actions/audit.ts (1)
114-128
: Enhance chain and token address extraction logicThe regular expressions used to extract the chain and token address may miss some valid formats. Consider improving them for better accuracy.
Updated patterns:
- const chainPattern = /(?:on|for|in|at|chain)\s+([a-zA-Z0-9]+)/i; + const chainPattern = /(?:on|for|in|at|chain)\s+([\w\s]+)/i; - const addressPattern = /\b([0-9a-zA-Z]{30,})\b/i; + const addressPattern = /\b(0x[a-fA-F0-9]{40}|[A-HJ-NP-Za-km-z1-9]{32,44})\b/g;These changes broaden chain name matching to include spaces (e.g., "Binance Smart Chain") and refine the address pattern to match Ethereum and other common formats.
packages/plugin-quick-intel/src/templates/index.ts (1)
41-42
: Ensure consistent placeholder names in the templateIn the Quick Intel link, replace
{{token}}
with{{tokenAddress}}
to match your variable naming elsewhere.Updated link:
- https://app.quickintel.io/scanner?type=token&chain={{chain}}&contractAddress={{token}} + https://app.quickintel.io/scanner?type=token&contractAddress={{tokenAddress}}&chain={{chain}}packages/plugin-quick-intel/README.md (3)
96-96
: Fix bare URL in documentationWrap the URL in angle brackets for proper markdown formatting.
-Full list available at https://docs.quickintel.io/quick-intel-scanner/supported-chains +Full list available at <https://docs.quickintel.io/quick-intel-scanner/supported-chains>🧰 Tools
🪛 Markdownlint (0.37.0)
96-96: null
Bare URL used(MD034, no-bare-urls)
128-128
: Add language specifier to code blockEmpty code block should specify a language or use
text
if no specific language applies.-``` +```text🧰 Tools
🪛 Markdownlint (0.37.0)
128-128: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
74-85
: Improve type documentationThe
any
types in the interface should be more specific.interface AuditResponse { success: boolean; data: { - audit: any; // QuickIntel audit data - market?: any; // DexScreener market data + audit: { + riskScore: number; + findings: Array<{ + severity: 'high' | 'medium' | 'low'; + description: string; + }>; + }; + market?: { + price: number; + volume24h: number; + liquidity: number; + }; }; params: { chain: string; tokenAddress: string; }; }
📜 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 (9)
agent/package.json
(1 hunks)packages/plugin-quick-intel/README.md
(1 hunks)packages/plugin-quick-intel/eslint.config.mjs
(1 hunks)packages/plugin-quick-intel/package.json
(1 hunks)packages/plugin-quick-intel/src/actions/audit.ts
(1 hunks)packages/plugin-quick-intel/src/index.ts
(1 hunks)packages/plugin-quick-intel/src/templates/index.ts
(1 hunks)packages/plugin-quick-intel/tsconfig.json
(1 hunks)packages/plugin-quick-intel/tsup.config.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- packages/plugin-quick-intel/eslint.config.mjs
- packages/plugin-quick-intel/tsup.config.ts
- packages/plugin-quick-intel/tsconfig.json
🧰 Additional context used
🪛 LanguageTool
packages/plugin-quick-intel/README.md
[misspelling] ~57-~57: This word is normally spelled as one.
Context: ...9zEt4rX" ``` ### Supported Features - Multi-chain support (EVM chains, Solana, etc.) - Co...
(EN_COMPOUNDS_MULTI_CHAIN)
🪛 Markdownlint (0.37.0)
packages/plugin-quick-intel/README.md
96-96: null
Bare URL used
(MD034, no-bare-urls)
128-128: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (2)
packages/plugin-quick-intel/src/index.ts (1)
1-13
: Plugin definition is correctly implementedThe
quickIntelPlugin
is properly defined and integratesauditAction
as intended.agent/package.json (1)
64-64
: LGTM!The plugin dependency is correctly added and follows the workspace pattern.
elizaLogger.error("Error in AUDIT_TOKEN handler:", error?.message, error?.error); | ||
|
||
if (callback) { | ||
await callback({ | ||
text: `Error performing token audit: ${error.message}`, | ||
content: { error: error.message }, | ||
inReplyTo: message.id | ||
}); | ||
} | ||
return false; | ||
} |
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.
Avoid exposing internal error messages to users
In the error handler, you're sending error.message
directly to the user. This could potentially reveal sensitive internal details. Provide a generic error message instead.
Here's a suggested fix:
if (callback) {
await callback({
- text: `Error performing token audit: ${error.message}`,
- content: { error: error.message },
+ text: "An error occurred while performing the token audit. Please try again later.",
+ content: { error: "Internal server error" },
inReplyTo: message.id
});
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
elizaLogger.error("Error in AUDIT_TOKEN handler:", error?.message, error?.error); | |
if (callback) { | |
await callback({ | |
text: `Error performing token audit: ${error.message}`, | |
content: { error: error.message }, | |
inReplyTo: message.id | |
}); | |
} | |
return false; | |
} | |
elizaLogger.error("Error in AUDIT_TOKEN handler:", error?.message, error?.error); | |
if (callback) { | |
await callback({ | |
text: "An error occurred while performing the token audit. Please try again later.", | |
content: { error: "Internal server error" }, | |
inReplyTo: message.id | |
}); | |
} | |
return false; | |
} |
"@elizaos/core": "workspace:*", | ||
"tsup": "8.3.5" | ||
}, |
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.
🛠️ Refactor suggestion
Review dependency configuration
tsup
should be in devDependencies since it's a build tool.
"dependencies": {
- "@elizaos/core": "workspace:*",
- "tsup": "8.3.5"
+ "@elizaos/core": "workspace:*"
+ },
+ "devDependencies": {
+ "tsup": "8.3.5"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"@elizaos/core": "workspace:*", | |
"tsup": "8.3.5" | |
}, | |
"@elizaos/core": "workspace:*" | |
}, | |
"devDependencies": { | |
"tsup": "8.3.5" | |
}, |
Relates to
N/A
Risks
Low - This plugin is isolated and:
Background
What does this PR do?
What kind of change is this?
Why are we doing this? Any context or related work?
Adds a new plugin for token security analysis using QuickIntel's API. The plugin:
Features (non-breaking change which adds functionality)
Documentation changes needed?
My changes require a change to the project documentation.
Testing
Where should a reviewer start?
Detailed testing steps
Add QUICKINTEL_API_KEY to environment variables
Add plugin to character.json
Review the main plugin files:
Check the README.md for documentation completeness
Screenshots
Before
After
Database changes
N/A
Deployment instructions
N/A
Discord username
ninja_dev