feat(tui): migrate quota sidebar and commands to TUI V2 - #196
Open
dmmop wants to merge 6 commits into
Open
Conversation
added 6 commits
August 2, 2026 09:49
- Extend `src/lib/opencode-auth.ts` with a credential database reader - Add `CredentialDatabase` and `CredentialDatabaseConstructor` types - Add `runtimeRequire` to conditionally load `better-sqlite3` - Implement `getCredentialDbPaths`, `readCredentialDatabase`, `openCredentialDatabase`, and `parseCredentialValue` - Modify `readAuthFile` and add `readAuthFiles` + `readCredentialDatabases` to merge credentials from auth.json and OpenCode's database - Preserve precedence: entries in auth.json override database credentials; database serves as a fallback for OAuth credentials - Add tests covering database fallback and auth.json precedence in `tests/lib.opencode-auth.test.ts`
Owner
|
@dmmop Thanks for the PR, code looks good. I believe OpenCode v2 is still in beta, so I'd hold off on releasing this on main for now. If there is support for v2 or when v2 is out of beta I'll definitely return to the PR. |
Author
|
@slkiser Thanks you for this plugin! Yes, v2 is still in beta, thats why "opencode-next.db" is hardcoded in the code. I adapted the plugin to suit my needs in v2, i'll keep this PR update if they introduce any breaking change. |
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
/quotaand token-usage slash commands.auth.jsonas credential source.Testing
pnpm run typecheckpnpm exec vitest run tests/tui-v2-commands.test.tsgit diff --check 87e6540...HEAD/quotain the OpenCode V2 TUI