feat(integrations): Adding Integrations button via OpenInt #6
Open
pellicceama wants to merge 6 commits intofreestyle-sh:mainfrom
Open
feat(integrations): Adding Integrations button via OpenInt #6pellicceama wants to merge 6 commits intofreestyle-sh:mainfrom
pellicceama wants to merge 6 commits intofreestyle-sh:mainfrom
Conversation
There was a problem hiding this comment.
What Changed
This PR introduces an "Integrations" button powered by OpenInt. Key changes include:
- Adding the
@openint/connectdependency. - Creating a new API endpoint
src/app/api/integration/route.tsto generate OpenInt tokens for users, requiring anOPENINT_API_KEY. - Implementing a new
src/components/IntegrationButton.tsxcomponent that fetches this token and renders the OpenIntConnectButton. This component also includes anonEventhandler that triggers anonPromptcallback when an integration is connected. - Integrating this
IntegrationButtoninto thesrc/components/chat.tsxinterface. - Updating
src/lib/system.tsto modify the system message. It now instructs the LLM to check the/integrationsdirectory for available clients and guides users to connect integrations if they aren't already set up. When an integration is added, a system prompt with pre-tested code and managed authentication is added to the chat history.
Risks / Concerns
The review identified a couple of minor risks in src/components/IntegrationButton.tsx:
- Lack of response status checking before parsing JSON on line 21, which could lead to errors if the API returns a non-2xx status.
- Potential for
classNameto beundefinedon line 63, which could result in an invalid class string "undefined mb-2".
Additionally, the new /api/integration endpoint and the integration button functionality depend on the OPENINT_API_KEY environment variable being set.
6 files reviewed | 2 comments | Review on Mesa | Edit Reviewer Settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds an integrations button powered by OpenInt. It's an example implementation meant for feedback.
How it works:
OPENINT_API_KEYa Manage Integrations button is rendered. Skipped if not.Demo one-shotting a github integration with auth: https://www.loom.com/share/2486d9e2b8ab424b8a462e05ba7df200?sid=78bd2e1d-01cb-4f45-bbcc-80085e1bd6f6