-
-
Notifications
You must be signed in to change notification settings - Fork 769
feat(registry): add tool options support for http backend #7061
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
Conversation
Adds the ability to define tool options directly in registry.toml, enabling tools to specify version_list_url and platform-specific configurations. Changes: - Add `options` field to RegistryTool struct with platform support - Create jq.rs module for JSON path extraction (e.g., `.[].version`) - Create version_list.rs for fetching/parsing version lists from URLs - Update http backend to use version_list_url option - Merge registry options with user-provided options in BackendArg - Add claude-code entry using http backend with version list endpoint - Update registry.toml schema to allow options field Example registry.toml entry: ```toml [tools.claude.options] version_list_url = "https://storage.googleapis.com/.../stable" bin = "claude" [tools.claude.options.platforms.macos-arm64] url = "https://storage.googleapis.com/.../{version}/darwin-arm64/claude" ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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.
Pull request overview
This PR adds support for tool-specific options in the registry, enabling HTTP backend tools to fetch version lists from URLs without relying on npm or other package managers. The implementation includes a custom JQ-like JSON path extractor for parsing various version list formats.
Key changes:
- Added
optionsfield to registry tool definitions with platform-specific configuration support - Implemented JSON path extraction and version list parsing utilities
- Modified HTTP backend to fetch versions from configurable URLs
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/registry.rs | Adds options field to RegistryTool struct and tool_options() method to convert registry options |
| src/cli/args/backend_arg.rs | Merges registry options with user-provided options, giving user options precedence |
| src/backend/version_list.rs | New module for fetching and parsing version lists from URLs with multiple format support |
| src/backend/jq.rs | New module implementing simplified JQ-like JSON path extraction |
| src/backend/http.rs | Updates HTTP backend to use version_list_url option for remote version listing |
| src/backend/mod.rs | Registers new jq and version_list modules |
| schema/mise-registry.json | Adds options field schema with platform-specific configuration support |
| registry.toml | Adds claude-code tool configuration using HTTP backend with version list URL |
| build.rs | Updates registry codegen to serialize options field from TOML |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let version_list_url = match opts.get("version_list_url") { | ||
| Some(url) => url.clone(), | ||
| None => return Ok(vec![]), | ||
| }; | ||
|
|
||
| // Get optional version regex pattern or JSON path | ||
| let version_regex = opts.get("version_regex").map(|s| s.as_str()); | ||
| let version_json_path = opts.get("version_json_path").map(|s| s.as_str()); | ||
|
|
||
| // Use the version_list module to fetch and parse versions | ||
| version_list::fetch_versions(&version_list_url, version_regex, version_json_path).await |
Copilot
AI
Nov 25, 2025
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.
The clone() is unnecessary here. Since opts.get() returns Option<&String>, you can use as_str() to get &str and pass it directly to fetch_versions without cloning.
| let version_list_url = match opts.get("version_list_url") { | |
| Some(url) => url.clone(), | |
| None => return Ok(vec![]), | |
| }; | |
| // Get optional version regex pattern or JSON path | |
| let version_regex = opts.get("version_regex").map(|s| s.as_str()); | |
| let version_json_path = opts.get("version_json_path").map(|s| s.as_str()); | |
| // Use the version_list module to fetch and parse versions | |
| version_list::fetch_versions(&version_list_url, version_regex, version_json_path).await | |
| let version_list_url = opts.get("version_list_url").map(|s| s.as_str()); | |
| if version_list_url.is_none() { | |
| return Ok(vec![]); | |
| } | |
| // Get optional version regex pattern or JSON path | |
| let version_regex = opts.get("version_regex").map(|s| s.as_str()); | |
| let version_json_path = opts.get("version_json_path").map(|s| s.as_str()); | |
| // Use the version_list module to fetch and parse versions | |
| version_list::fetch_versions(version_list_url.unwrap(), version_regex, version_json_path).await |
| // Get version_list_url from options | ||
| let version_list_url = match opts.get("version_list_url") { | ||
| Some(url) => url.clone(), | ||
| None => return Ok(vec![]), | ||
| }; | ||
|
|
||
| // Get optional version regex pattern or JSON path |
Copilot
AI
Nov 25, 2025
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.
[nitpick] These two lines extract options that are already being extracted from opts. Consider extracting all three options (version_list_url, version_regex, version_json_path) consistently at the same location for better code organization.
| // Get version_list_url from options | |
| let version_list_url = match opts.get("version_list_url") { | |
| Some(url) => url.clone(), | |
| None => return Ok(vec![]), | |
| }; | |
| // Get optional version regex pattern or JSON path | |
| // Get version_list_url and related options from options | |
| let version_list_url = match opts.get("version_list_url") { | |
| Some(url) => url.clone(), | |
| None => return Ok(vec![]), | |
| }; |
| } | ||
| } else if let Some(obj) = val.as_object() { | ||
| // Try common version field names | ||
| for field in ["version", "tag_name", "name", "tag", "v"] { |
Copilot
AI
Nov 25, 2025
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.
[nitpick] The field name \"v\" is a single letter which could match unintended fields. Consider removing it or placing it last in the priority order to avoid false matches.
The npm backend doesn't use the http-specific tool options. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Options are now specified per-backend, allowing different backends for the same tool to have different configurations. This enables claude-code to have both http and npm backends. Example: ```toml [[tools.claude.backends]] full = "http:claude" [tools.claude.backends.options] version_list_url = "..." bin = "claude" [[tools.claude.backends]] full = "npm:@anthropic-ai/claude-code" ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…tions Document new HTTP backend options for fetching available versions: - version_list_url: URL to fetch version list from - version_regex: Regex to extract versions from response - version_json_path: jq-like path for JSON version extraction 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
When version_json_path is provided but JSON parsing fails or the path doesn't match, gracefully fall back to text parsing instead of failing. This makes the behavior consistent with auto-detection mode. Also adds e2e test for claude-code http backend with version_list_url. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.7 x -- echo |
19.4 ± 0.4 | 18.8 | 23.1 | 1.00 |
mise x -- echo |
20.7 ± 0.2 | 20.1 | 21.6 | 1.07 ± 0.02 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.7 env |
19.5 ± 0.6 | 18.8 | 25.8 | 1.00 |
mise env |
20.0 ± 0.7 | 18.6 | 30.1 | 1.03 ± 0.05 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.7 hook-env |
18.6 ± 0.4 | 17.8 | 21.6 | 1.00 |
mise hook-env |
19.4 ± 0.5 | 18.0 | 20.7 | 1.04 ± 0.04 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.7 ls |
16.0 ± 0.4 | 15.3 | 18.6 | 1.00 |
mise ls |
17.7 ± 0.4 | 16.2 | 18.8 | 1.10 ± 0.04 |
xtasks/test/perf
| Command | mise-2025.11.7 | mise | Variance |
|---|---|---|---|
| install (cached) | 108ms | 108ms | +0% |
| ls (cached) | 64ms | 65ms | -1% |
| bin-paths (cached) | 71ms | 72ms | -1% |
| task-ls (cached) | 430ms | 439ms | -2% |
Add raw_string_literal() helper that dynamically determines the minimum number of '#' characters needed to safely delimit raw strings. This prevents build failures if registry option values, descriptions, or test commands contain sequences like "###. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
| ToolVersionOptions::default() | ||
| } | ||
| }) | ||
| }); |
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.
Bug: Fallback option parsing uses wrong string source
The fallback code in the opts() method attempts to parse bracket notation from self.full(), but self.full() doesn't contain bracket notation—it returns the clean backend specification. Brackets are extracted during BackendArg construction from the tool name, not the full string. While this fallback may not execute in normal usage since self.opts is set during construction, the logic is incorrect if it ever does execute. The regex check at line 294 will never match a full backend string like http:claude since bracket notation is handled separately.
### 📦 Registry - add blender by @lucasew in [#7014](#7014) - add vespa-cli by @buinauskas in [#7037](#7037) - fix vespa-cli order by @buinauskas in [#7038](#7038) - add scooter by @TyceHerrman in [#7039](#7039) - Prefer github backend for allure by @TobiX in [#7049](#7049) ### 🚀 Features - **(plugins)** Install a plugin from a zip file over HTTPS by @KaanYT in [#6992](#6992) - **(registry)** add tool options support for http backend by @jdx in [#7061](#7061) ### 🐛 Bug Fixes - **(core)** trim `core:` prefix in unalias_backend by @kou029w in [#7040](#7040) - **(go)** use -mod=readonly for go install by @joonas in [#7052](#7052) - **(npm)** handle v-prefixed versions correctly by @jdx in [#7062](#7062) - **(tasks)** add missing task fields to JSON output by @roele in [#7044](#7044) - semver in aqua by @lucasew in [#7018](#7018) - use the musl version if installing in Android (Termux) by @lucasew in [#7027](#7027) - empty enable_tools crash by @moshen in [#7035](#7035) ### 📚 Documentation - add MISE and USAGE syntax hl queries to neovim cookbook by @okuuva in [#7047](#7047) - use local assets for screenshots by @okuuva in [#7056](#7056) - remove GitHub issues link from roadmap by @jdx in [6897286](6897286) ### 📦️ Dependency Updates - update docker/metadata-action digest to 318604b by @renovate[bot] in [#7033](#7033) - update actions/checkout digest to 34e1148 by @renovate[bot] in [#7032](#7032) - lock file maintenance by @renovate[bot] in [#7048](#7048) ### Chore - upgrade actionlint to 1.7.9 and fix lint issues by @jdx in [#7065](#7065) ### New Contributors - @joonas made their first contribution in [#7052](#7052) - @KaanYT made their first contribution in [#6992](#6992) - @kou029w made their first contribution in [#7040](#7040) - @moshen made their first contribution in [#7035](#7035) - @buinauskas made their first contribution in [#7038](#7038) - @lucasew made their first contribution in [#7014](#7014) ## 📦 Aqua Registry Updates #### New Packages (3) - [`m7medVision/lazycommit`](https://github.com/m7medVision/lazycommit) - [`microsoft/component-detection`](https://github.com/microsoft/component-detection) - [`owenlamont/ryl`](https://github.com/owenlamont/ryl) #### Updated Packages (1) - [`sst/opencode`](https://github.com/sst/opencode)
Summary
optionsfield to RegistryTool struct with platform supportjq.rsmodule for JSON path extraction (e.g.,.[].version)version_list.rsfor fetching/parsing version lists from URLsversion_list_urloptionThis enables tools to specify version list URLs and platform-specific configurations directly in the registry, reducing reliance on npm/other backends for simple binary downloads.
Example registry.toml entry:
Test plan
mise ls-remote claudereturns version from version_list_urlmise install [email protected]installs from http backendmise exec [email protected] -- claude --versionoutputs correct version🤖 Generated with Claude Code
Note
Adds HTTP backend remote version listing (regex/jq path parsing) with registry-backed options and introduces claude tool via HTTP; updates docs/schema/tests.
version_list_url, supportingversion_regexandversion_json_path.backend/jq.rs(jq-like JSON extraction) andbackend/version_list.rs(fetch/parse versions), with unit tests.BackendArg::opts()now merges registry backend options with user options (user takes precedence).schema/mise-registry.jsonto allow per-backendoptions(including nestedplatforms).build.rsgenerates backendoptions; introduceraw_string_literalfor safe string embedding.RegistryBackendgainsoptions; add accessorsget_backendandbackend_options.registry.tomlto addtools.claudeHTTP backend withversion_list_url,bin, and platform-specific URLs; restrict OS; keep npm as alternate.version_list_url,version_regex, andversion_json_pathusage.e2e/backend/test_http_version_list_slowvalidatingls-remoteand install forclaude.Written by Cursor Bugbot for commit 7cb7c3e. This will update automatically on new commits. Configure here.