feat: add ProviderType classification and JSONC support for providers#406
Merged
Merged
Conversation
Adds a `type` field (app | llm | mcp) to ProviderDefinition so consumers can filter and display providers by category. Backfills all 71 bundled providers. Also introduces a `parse_jsonc` utility that strips // and /* */ comments before JSON parsing, and wires it into the bundled loader and the CLI register command so both .json and .jsonc provider files are accepted. Closes #362 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
ProviderTypeenum (app,llm,mcp) toenums.pyand exports it from the top-level packagetype: ProviderType | Nonefield toProviderDefinition(optional so existing custom providers without the field remain valid)"type"on all 71 bundled provider JSONs:openaiandgoogle-vertex-ai→"llm", everything else →"app"parse_jsonc()toutils.py— regex-based comment stripper (no new dependency) that handles//line comments and/* */block comments while preserving string literalsprovider_repository.pyto load both.jsonand.jsoncbundled files viaparse_jsoncauthsome provider registerCLI command to useparse_jsonc(accepts both.jsonand.jsoncfiles)docs/register-provider.md: mentions.jsoncsupport, addstypefield to both templates and the field reference tableCloses #362
Test plan
uv run pytest— all 340 tests passuv run ruff check src/ tests/— no issuesuv run ty check src/— no issuesauthsome provider listshows providers loaded correctly with thetypefieldauthsome provider register my-provider.jsoncparses a JSONC file with comments🤖 Generated with Claude Code