-
Notifications
You must be signed in to change notification settings - Fork 15
Feat/proactive opportunities #362
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
Introduces a new admin UI and backend API for discovering opportunities among index members using natural language prompts. Adds frontend components for opportunity display and mention support, updates the admin service, and implements a generic prompt-driven discovery method in the backend. Sidebar navigation and supporting types are also updated.
Refactors the DiscoveryForm to use a contentEditable input supporting rich @mentions, atomic mention deletion, and improved suggestion handling. Updates the admin opportunities page to use new suggestion types and removes quick action buttons. Improves sidebar and header stickiness in ClientWrapper. Updates admin API to allow index admins (not just owners) to discover opportunities.
Introduces a new /api/subscribe endpoint for newsletter signups using Buttondown. The landing page is fully redesigned with new sections, interactive visualizations, and a newsletter subscription form integrated with the new API.
Introduces a new reusable Footer component and applies it to the landing page and blog pages, replacing inline footer code. Updates the Header to use a new logo asset and adjusts its size. Refactors ClientWrapper to support full-width layouts for landing and blog pages. Adds new logo assets to the public directory. Minor: adds a console.log in the subscribe API route for debugging.
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe changes introduce a standalone SDK framework with public classes (IndexSDK, Users, Intents, Opportunities, Discover) for managing user profiles, intent discovery, and opportunity matching. A new IndexAgent provides reasoning capabilities. The backend adds opportunity discovery services and admin endpoints to support prompt-driven member matching. The frontend receives substantial updates including a landing page redesign with ambient discovery visualization, a new admin interface for opportunity discovery, subscription functionality, and layout/navigation adjustments. Changes
Sequence Diagram(s)sequenceDiagram
participant Admin as Admin User
participant Frontend as Frontend App
participant AdminRoute as /admin/:indexId/<br/>opportunities Route
participant OppService as OpportunityService
participant HydeAgent as HydeGeneratorAgent
participant ProfileDB as Profile Database
participant Embedder as Embedder Service
participant Results as Results
Admin->>Frontend: Enter prompt + members
Frontend->>Frontend: Validate & prepare params
Frontend->>AdminRoute: POST /admin/{indexId}/opportunities<br/>{prompt, memberIds, limit}
AdminRoute->>AdminRoute: Check admin access
AdminRoute->>OppService: discoverOpportunitiesWithPrompt<br/>(prompt, memberIds, indexId, limit)
loop For each memberId
OppService->>ProfileDB: Fetch profile
ProfileDB-->>OppService: Profile data
OppService->>Embedder: Ensure profile embedding
OppService->>HydeAgent: generate(profileContext, {instruction: prompt})
HydeAgent-->>OppService: HyDE description
OppService->>OppService: Run discovery using HyDE
OppService->>OppService: Map results to DiscoveredOpportunity
end
OppService->>OppService: Sort by score
OppService-->>AdminRoute: DiscoveredOpportunity[]
AdminRoute-->>Frontend: OpportunityDiscoveryResponse
Frontend->>Frontend: Display opportunities list
Frontend-->>Admin: Render OpportunityCards with actions
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
|
||
| // Handle contentEditable input with @ detection | ||
| const handleContentInput = useCallback(() => { | ||
| if (!inputRef.current || !enableMentions) return; |
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.
Submit button permanently disabled when mentions disabled
High Severity
When enableMentions is false (the default), the handleContentInput function returns early without calling setInputValue, so inputValue state is never updated from user typing. However, the submit button's disabled prop still checks !inputValue.trim(), which will always be true since inputValue remains empty. This breaks the form for any usage without enableMentions={true}, including the main discovery flow in InboxContent.tsx.
Additional Locations (1)
| }), | ||
| }); | ||
|
|
||
| console.log(res); |
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.
| async discoverOpportunitiesWithPrompt( | ||
| options: DiscoverOpportunitiesOptions | ||
| ): Promise<DiscoveredOpportunity[]> { | ||
| const { prompt, memberIds, limit = 10 } = options; |
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.
Index scoping parameter passed but never used
Medium Severity
The indexId parameter is passed to discoverOpportunitiesWithPrompt but never destructured or used in the implementation. The interface comment states it should "Scope to specific index," but discovery runs against all users in the system. This means admins could discover opportunities involving users outside their index, showing results that may be irrelevant or exposing user information they shouldn't access.
Note
Adds a cohesive SDK and agent for navigating users/intents/opportunities, plus proactive, prompt-driven discovery for index admins, and marketing/site polish.
protocol/src/sdk/*(types, users.hyde, intents.list/mutual/infer, opportunities.between/synthesis, discover.run) andagents/index/*for reasoning over SDK dataPOST /admin/:indexId/opportunitiesusingOpportunityService.discoverOpportunitiesWithPromptand enhancedHydeGeneratorAgent(optionalinstruction)DiscoveryForm(contentEditable +@mentions) andOpportunityCard; sidebar link added; admin service extendedFootercomponent wired into blog pages, sticky header tweaks, new logo asset, andPOST /api/subscribe(Buttondown).gitignoretweak,ClientLayouthideFeedbackpropWritten by Cursor Bugbot for commit ac1aac2. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
Release Notes
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.