-
Notifications
You must be signed in to change notification settings - Fork 51
Daily branch 2025 11 10 #89
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
Conversation
- Update @langchain/community from 0.3.57 to 1.0.0 - Update langchain from 0.3.36 to 1.0.3 - Remove JSONLoader dependency due to deprecated export path - Replace JSONLoader with native JSON.parse/stringify for JSON file processing - Update related dependencies (@ai-sdk/react, convex, gpt-tokenizer, etc.)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe PR migrates from the old ShimmerText component to a new Shimmer component from the ai-elements library, updating all usages across multiple files. Additionally, it updates dependencies, expands e2b container setup with security tools, refactors JSON processing logic, and updates system prompt documentation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
convex/_generated/api.d.tsis excluded by!**/_generated/**convex/_generated/server.d.tsis excluded by!**/_generated/**convex/_generated/server.jsis excluded by!**/_generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
app/components/Messages.tsx(2 hunks)app/components/ShimmerText.tsx(0 hunks)app/components/TerminalCodeBlock.tsx(4 hunks)app/components/__tests__/ShimmerText.test.tsx(0 hunks)app/components/tools/SummarizationHandler.tsx(2 hunks)components/ai-elements/shimmer.tsx(1 hunks)components/ui/tool-block.tsx(2 hunks)convex/fileActions.ts(1 hunks)e2b/template.ts(3 hunks)lib/system-prompt.ts(1 hunks)package.json(3 hunks)
💤 Files with no reviewable changes (2)
- app/components/tests/ShimmerText.test.tsx
- app/components/ShimmerText.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/convex_rules.mdc)
**/*.{ts,tsx}: Use Id from ./_generated/dataModel for document IDs (e.g., Id<'users'>) instead of string
Ensure Record key/value types align with validators (e.g., v.record(v.id('users'), v.string()) -> Record<Id<'users'>, string>)
Use as const on string literals in discriminated unions
When using Array type, explicitly declare arrays with const array: Array = [...]
When using Record type, explicitly declare with const record: Record<KeyType, ValueType> = {...}
Files:
components/ui/tool-block.tsxapp/components/Messages.tsxapp/components/TerminalCodeBlock.tsxcomponents/ai-elements/shimmer.tsxconvex/fileActions.tslib/system-prompt.tsapp/components/tools/SummarizationHandler.tsxe2b/template.ts
convex/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/convex_rules.mdc)
convex/**/*.{ts,tsx,js,jsx}: ALWAYS use the new Convex function syntax (query/mutation/action object with args/returns/handler) when defining Convex functions
When a Convex function returns null, include returns: v.null() and return null
Use internalQuery/internalMutation/internalAction for private functions; do not expose sensitive logic with public query/mutation/action
Do NOT register functions via the api or internal objects
ALWAYS provide args and returns validators for query, mutation, action and their internal variants; use v.null() when no value is returned
From Convex functions, use ctx.runQuery/ctx.runMutation/ctx.runAction to call other functions (not direct function calls)
Pass a FunctionReference (from api/internal) to ctx.runQuery/ctx.runMutation/ctx.runAction; do NOT pass the callee function directly
Only call an action from another action when crossing runtimes (e.g., V8 to Node); otherwise refactor shared code into helpers
Minimize calls from actions to queries/mutations to reduce race conditions; prefer fewer transactional boundaries
Organize public query/mutation/action functions under convex/ to align with file-based routing
For pagination, validate args with paginationOptsValidator and call .paginate(args.paginationOpts) on queries
Use v.int64() instead of deprecated v.bigint() for signed 64-bit integers
Use v.record() for record-like structures; v.map() and v.set() are not supported
Do NOT use query().filter(...); define an index in schema and use withIndex instead
Convex queries do not support .delete(); collect or iterate results and call ctx.db.delete(_id) for each
Use .unique() to fetch exactly one document and fail on multiples
When async-iterating query results, prefer for await (const row of query) over .collect() or .take(n)
Use ctx.db.replace to fully replace an existing document; ctx.db.patch to shallow-merge updates
Files defining actions that use Node built-ins must start with "use node"
Never access ctx.db from within an action
D...
Files:
convex/fileActions.ts
convex/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/convex_rules.mdc)
When run-calling a function in the same file, add an explicit return type annotation on the await result to avoid TS circularity issues
Files:
convex/fileActions.ts
package.json
📄 CodeRabbit inference engine (.cursor/rules/convex_rules.mdc)
Add @types/node to devDependencies when using Node.js built-in modules
Files:
package.json
🧠 Learnings (3)
📚 Learning: 2025-10-03T13:15:14.787Z
Learnt from: CR
Repo: hackerai-tech/hackerai PR: 0
File: .cursor/rules/convex_rules.mdc:0-0
Timestamp: 2025-10-03T13:15:14.787Z
Learning: Applies to convex/**/*.{ts,tsx,js,jsx} : Organize public query/mutation/action functions under convex/ to align with file-based routing
Applied to files:
convex/fileActions.ts
📚 Learning: 2025-10-03T13:15:14.787Z
Learnt from: CR
Repo: hackerai-tech/hackerai PR: 0
File: .cursor/rules/convex_rules.mdc:0-0
Timestamp: 2025-10-03T13:15:14.787Z
Learning: Applies to convex/**/*.{ts,tsx,js,jsx} : Files defining actions that use Node built-ins must start with "use node"
Applied to files:
convex/fileActions.ts
📚 Learning: 2025-10-03T13:15:14.787Z
Learnt from: CR
Repo: hackerai-tech/hackerai PR: 0
File: .cursor/rules/convex_rules.mdc:0-0
Timestamp: 2025-10-03T13:15:14.787Z
Learning: Applies to convex/**/*.{ts,tsx,js,jsx} : ALWAYS use the new Convex function syntax (query/mutation/action object with args/returns/handler) when defining Convex functions
Applied to files:
convex/fileActions.ts
🧬 Code graph analysis (5)
components/ui/tool-block.tsx (1)
components/ai-elements/shimmer.tsx (1)
Shimmer(64-64)
app/components/Messages.tsx (1)
components/ai-elements/shimmer.tsx (1)
Shimmer(64-64)
app/components/TerminalCodeBlock.tsx (1)
components/ai-elements/shimmer.tsx (1)
Shimmer(64-64)
components/ai-elements/shimmer.tsx (1)
lib/utils.ts (1)
cn(23-25)
app/components/tools/SummarizationHandler.tsx (1)
components/ai-elements/shimmer.tsx (1)
Shimmer(64-64)
🪛 ESLint
components/ai-elements/shimmer.tsx
[error] 38-38: Error: Cannot create components during render
Components created during render will reset their state each time they are created. Declare components outside of render.
/home/jailuser/git/components/ai-elements/shimmer.tsx:38:6
36 |
37 | return (
38 | <MotionComponent
| ^^^^^^^^^^^^^^^ This component is created during render
39 | animate={{ backgroundPosition: "0% center" }}
40 | className={cn(
41 | "relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
/home/jailuser/git/components/ai-elements/shimmer.tsx:28:27
26 | spread = 2,
27 | }: TextShimmerProps) => {
28 | const MotionComponent = motion.create(
| ^^^^^^^^^^^^^^
29 | Component as keyof JSX.IntrinsicElements,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 | );
| ^^^^ The component is created during render here
31 |
32 | const dynamicSpread = useMemo(
33 | () => (children?.length ?? 0) * spread,
(react-hooks/static-components)
🔇 Additional comments (4)
components/ui/tool-block.tsx (1)
2-2: LGTM! Clean component migration.The migration from
ShimmerTextto the newShimmercomponent is implemented correctly with the updated import path and consistent usage pattern.Also applies to: 46-46
app/components/tools/SummarizationHandler.tsx (1)
3-3: LGTM! Component migration with improved message formatting.The migration from
ShimmerTexttoShimmeris correct, and the template literal approach for appending the ellipsis is cleaner than the previous implementation. TheclassNameprop usage appears appropriate for styling.Also applies to: 23-23
app/components/TerminalCodeBlock.tsx (1)
6-6: LGTM! Consistent component migration across all loading states.All three loading state indicators have been successfully migrated from
ShimmerTexttoShimmer, maintaining the existing conditional rendering logic. The implementation is consistent throughout the file.Also applies to: 174-176, 244-244, 268-268
lib/system-prompt.ts (1)
157-163: LGTM! Improved documentation structure.The reorganization of pre-installed tools into categorized groups (Network Scanning, Web Fuzzing, Recon, Specialized, Documents) with descriptive annotations significantly improves clarity and helps the AI better understand the available toolset in the sandbox environment.
| const MotionComponent = motion.create( | ||
| Component as keyof JSX.IntrinsicElements, | ||
| ); | ||
|
|
||
| const dynamicSpread = useMemo( | ||
| () => (children?.length ?? 0) * spread, | ||
| [children, spread], | ||
| ); | ||
|
|
||
| return ( | ||
| <MotionComponent | ||
| animate={{ backgroundPosition: "0% center" }} | ||
| className={cn( | ||
| "relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", | ||
| "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", | ||
| className, | ||
| )} | ||
| initial={{ backgroundPosition: "100% center" }} | ||
| style={ | ||
| { | ||
| "--spread": `${dynamicSpread}px`, | ||
| backgroundImage: | ||
| "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))", | ||
| } as CSSProperties | ||
| } | ||
| transition={{ | ||
| repeat: Number.POSITIVE_INFINITY, | ||
| duration, | ||
| ease: "linear", | ||
| }} |
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 recreating the motion wrapper every render
ESLint (react-hooks/static-components) is erroring because motion.create runs inside the render path, so the motion component is rebuilt on each render and any local state would reset. Memoize the factory on the Component reference to keep lint happy and avoid unnecessary churn.
Apply this diff:
- const MotionComponent = motion.create(
- Component as keyof JSX.IntrinsicElements,
- );
+ const MotionComponent = useMemo(
+ () => motion.create(Component as keyof JSX.IntrinsicElements),
+ [Component],
+ );📝 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.
| const MotionComponent = motion.create( | |
| Component as keyof JSX.IntrinsicElements, | |
| ); | |
| const dynamicSpread = useMemo( | |
| () => (children?.length ?? 0) * spread, | |
| [children, spread], | |
| ); | |
| return ( | |
| <MotionComponent | |
| animate={{ backgroundPosition: "0% center" }} | |
| className={cn( | |
| "relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", | |
| "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", | |
| className, | |
| )} | |
| initial={{ backgroundPosition: "100% center" }} | |
| style={ | |
| { | |
| "--spread": `${dynamicSpread}px`, | |
| backgroundImage: | |
| "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))", | |
| } as CSSProperties | |
| } | |
| transition={{ | |
| repeat: Number.POSITIVE_INFINITY, | |
| duration, | |
| ease: "linear", | |
| }} | |
| const MotionComponent = useMemo( | |
| () => motion.create(Component as keyof JSX.IntrinsicElements), | |
| [Component], | |
| ); | |
| const dynamicSpread = useMemo( | |
| () => (children?.length ?? 0) * spread, | |
| [children, spread], | |
| ); | |
| return ( | |
| <MotionComponent | |
| animate={{ backgroundPosition: "0% center" }} | |
| className={cn( | |
| "relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", | |
| "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", | |
| className, | |
| )} | |
| initial={{ backgroundPosition: "100% center" }} | |
| style={ | |
| { | |
| "--spread": `${dynamicSpread}px`, | |
| backgroundImage: | |
| "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))", | |
| } as CSSProperties | |
| } | |
| transition={{ | |
| repeat: Number.POSITIVE_INFINITY, | |
| duration, | |
| ease: "linear", | |
| }} |
🧰 Tools
🪛 ESLint
[error] 38-38: Error: Cannot create components during render
Components created during render will reset their state each time they are created. Declare components outside of render.
/home/jailuser/git/components/ai-elements/shimmer.tsx:38:6
36 |
37 | return (
38 | <MotionComponent
| ^^^^^^^^^^^^^^^ This component is created during render
39 | animate={{ backgroundPosition: "0% center" }}
40 | className={cn(
41 | "relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
/home/jailuser/git/components/ai-elements/shimmer.tsx:28:27
26 | spread = 2,
27 | }: TextShimmerProps) => {
28 | const MotionComponent = motion.create(
| ^^^^^^^^^^^^^^
29 | Component as keyof JSX.IntrinsicElements,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 | );
| ^^^^ The component is created during render here
31 |
32 | const dynamicSpread = useMemo(
33 | () => (children?.length ?? 0) * spread,
(react-hooks/static-components)
🤖 Prompt for AI Agents
In components/ai-elements/shimmer.tsx around lines 28 to 57, motion.create is
being called directly during render which recreates the MotionComponent each
render; wrap the factory call in a memo (e.g. useMemo(() =>
motion.create(Component as keyof JSX.IntrinsicElements), [Component])) or useRef
initialized once to preserve the same MotionComponent between renders so the
motion wrapper is not rebuilt and the react-hooks/static-components ESLint error
is resolved.
Summary by CodeRabbit
Release Notes
New Features
Improvements