-
Notifications
You must be signed in to change notification settings - Fork 1
feat: multi backend cli and oauth features and fixes #2
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
b04e6f1
feat(identity): add backend column to agent_identities and unify -a flag
conoremclaughlin 7da7124
docs(agents): add Lumen to agent table and embrace-your-name guidance
conoremclaughlin 81af98e
fix(auth): handle infinite loop on the log in page when token expires
conoremclaughlin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { type NextRequest } from 'next/server'; | ||
| import { updateSession } from './src/lib/supabase/middleware'; | ||
|
|
||
| export async function middleware(request: NextRequest) { | ||
| return await updateSession(request); | ||
| } | ||
|
|
||
| export const config = { | ||
| matcher: [ | ||
| /* | ||
| * Match all request paths except for the ones starting with: | ||
| * - _next/static (static files) | ||
| * - _next/image (image optimization files) | ||
| * - favicon.ico (favicon file) | ||
| * Feel free to modify this pattern to include more paths. | ||
| */ | ||
| '/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)', | ||
| ], | ||
| }; |
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
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||
| -- ===================================================== | ||||||
| -- Add backend column to agent_identities | ||||||
| -- Tracks which CLI backend (claude, codex, gemini) each agent uses | ||||||
| -- ===================================================== | ||||||
|
|
||||||
| -- Add column to main table | ||||||
| ALTER TABLE agent_identities ADD COLUMN IF NOT EXISTS backend TEXT; | ||||||
|
|
||||||
| -- Add column to history table | ||||||
| ALTER TABLE agent_identity_history ADD COLUMN IF NOT EXISTS backend TEXT; | ||||||
|
|
||||||
| -- Update archive trigger to include backend | ||||||
| CREATE OR REPLACE FUNCTION archive_agent_identity_on_update() | ||||||
| RETURNS TRIGGER AS $$ | ||||||
| BEGIN | ||||||
| IF OLD.name IS DISTINCT FROM NEW.name | ||||||
| OR OLD.role IS DISTINCT FROM NEW.role | ||||||
| OR OLD.description IS DISTINCT FROM NEW.description | ||||||
| OR OLD.values IS DISTINCT FROM NEW.values | ||||||
| OR OLD.relationships IS DISTINCT FROM NEW.relationships | ||||||
| OR OLD.capabilities IS DISTINCT FROM NEW.capabilities | ||||||
| OR OLD.metadata IS DISTINCT FROM NEW.metadata | ||||||
| OR OLD.soul IS DISTINCT FROM NEW.soul | ||||||
| OR OLD.heartbeat IS DISTINCT FROM NEW.heartbeat | ||||||
| OR OLD.backend IS DISTINCT FROM NEW.backend THEN | ||||||
|
|
||||||
| INSERT INTO agent_identity_history ( | ||||||
| identity_id, user_id, agent_id, | ||||||
| name, role, description, values, relationships, capabilities, metadata, | ||||||
| soul, heartbeat, backend, | ||||||
| version, created_at, change_type | ||||||
| ) VALUES ( | ||||||
| OLD.id, OLD.user_id, OLD.agent_id, | ||||||
| OLD.name, OLD.role, OLD.description, OLD.values, OLD.relationships, OLD.capabilities, OLD.metadata, | ||||||
| OLD.soul, OLD.heartbeat, OLD.backend, | ||||||
| OLD.version, OLD.created_at, 'update' | ||||||
| ); | ||||||
|
|
||||||
| NEW.version := OLD.version + 1; | ||||||
| END IF; | ||||||
|
|
||||||
| RETURN NEW; | ||||||
| END; | ||||||
| $$ LANGUAGE plpgsql; | ||||||
|
|
||||||
| -- Update delete trigger to include backend | ||||||
| CREATE OR REPLACE FUNCTION archive_agent_identity_on_delete() | ||||||
| RETURNS TRIGGER AS $$ | ||||||
| BEGIN | ||||||
| INSERT INTO agent_identity_history ( | ||||||
| identity_id, user_id, agent_id, | ||||||
| name, role, description, values, relationships, capabilities, metadata, | ||||||
| soul, heartbeat, backend, | ||||||
| version, created_at, change_type | ||||||
| ) VALUES ( | ||||||
| OLD.id, OLD.user_id, OLD.agent_id, | ||||||
| OLD.name, OLD.role, OLD.description, OLD.values, OLD.relationships, OLD.capabilities, OLD.metadata, | ||||||
| OLD.soul, OLD.heartbeat, OLD.backend, | ||||||
| OLD.version, OLD.created_at, 'delete' | ||||||
| ); | ||||||
|
|
||||||
| RETURN OLD; | ||||||
| END; | ||||||
| $$ LANGUAGE plpgsql; | ||||||
|
|
||||||
| -- ===================================================== | ||||||
| -- Backfill existing agents with known backends | ||||||
|
||||||
| -- Backfill existing agents with known backends | |
| -- Document backend column |
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.
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.
Changing the workspace create flag from
--identity/-ito--agent/-ais a breaking CLI interface change (and the repo docs still reference--identity). Consider supporting--identityas a deprecated alias (mapping it to the same option) for backward compatibility, or clearly documenting the breaking change and updating all references in the same PR.