fix: make REPL auth-agnostic + Auth0 SPA login for playground#14
Merged
Conversation
- Remove custom configure/mount/flush handlers from playground - Use ReplSession from @tigrisdata/agent-shell/repl - Implement ReplIO for xterm.js with prompt support - Remove credentials.ts (session manages state) - Update welcome message with login and configure options Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- src/repl/auth.ts: slimmed to types only (LoginFn, LoginResult, Organization) - src/cli/auth.ts: device flow implementation moved here (CLI-specific) - ReplSession accepts loginFn via constructor — no hardcoded auth - CLI passes deviceLogin, playground passes browserLogin Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ddc865e. Configure here.
- playground/src/auth.ts: browser login via @auth0/auth0-spa-js - ShellLoop passes browserLogin to ReplSession - Fix prompt redraw showing $ instead of "Enter number: " during org selection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ddc865e to
435419f
Compare
MantasMiksys
approved these changes
Apr 22, 2026
|
🎉 This PR is included in version 0.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
3 tasks
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.

Summary
Package changes (triggers 0.3.1 release)
src/repl/auth.ts: slimmed to types only —LoginFn,LoginResult,Organizationsrc/cli/auth.ts: device flow moved here (CLI-specific, not exported)ReplSessionacceptsloginFnvia constructor — auth-agnosticsrc/repl/index.ts: exportsLoginFntype, removesdeviceLoginPlayground changes
ReplSessionplayground/src/auth.ts: browser login via@auth0/auth0-spa-js(Authorization Code + PKCE)logincommand opens Auth0 popup in browser, device flow in CLI$instead of "Enter number:" during org selectioncredentials.ts— session manages stateTest plan
login→ device flow → org selection → bucket mountedlogin→ Auth0 popup → org selection → bucket mountedconfigurestill works in both🤖 Generated with Claude Code
Note
Medium Risk
Touches login/auth flows and changes how REPL sessions obtain credentials, which can break CLI/browser sign-in and org selection if miswired. Most changes are contained to wiring and dependency bumps, but affect user entrypoints.
Overview
Refactors the REPL to be auth-provider agnostic by replacing the built-in
deviceLoginimplementation with aLoginFncallback passed intoReplSession, and updates exports accordingly.Moves the OAuth device-flow implementation into a new CLI-only module (
src/cli/auth.ts) and wires the CLI to use it vianew ReplSession({ loginFn: deviceLogin }).Updates the playground to
@tigrisdata/agent-shell@^0.3.0and switches the xterm shell loop to delegate execution to the sharedReplSession, adding a browser Auth0 popup login (playground/src/auth.ts) and improving prompt handling during interactive org selection (plus removing the old in-memory credentials helper).Reviewed by Cursor Bugbot for commit 435419f. Bugbot is set up for automated code reviews on this repo. Configure here.