Repository navigation
feat(addons): show the tool count of each add-on before install - #12898
Merged
Merged
Conversation
The add-on cards, the Find add-ons tab and the install dialog said "Adds a page" for a library entry but nothing about chat tools, so the tools only showed once the add-on was installed. The library index now carries toolCount and tools on each entry, with the same names as the installed view. They come from capabilities.tools of the manifest; admin tools are not chat tools and are not counted. Tools is capped at 32 names and toolCount stays the full number. The catalog reader validates the hint and refuses it on a backend entry. addonpkg catalog writes the fields. The new catalog-tools subcommand adds them to an existing index from addons/<id>/manifest.json, and leaves every digest and artifact as it was. The UI reads the fields through the same helper as the installed view and shows "Adds N tools" when N is above zero. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
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.
What changes
A library entry now says what the add-on brings to chat before it is installed: "Adds a page" (already shown) and "Adds N tools" (new, singular "Adds 1 tool"). The line shows when the tool count is above zero, in three places: the featured cards of the first-run page, the Find add-ons tab, and the install dialog (the details of an entry before install). Installed add-ons keep their current text.
N is the number of chat tools in
capabilities.toolsof the manifest. Admin tools (capabilities.adminTools) are not chat tools and are not counted.How
toolCountandtools, the same JSON names as the installed view.toolsis capped at 32 names, likeapps.MaxTools;toolCountstays the full number. An add-on without chat tools has neither field.addonpkg catalogwrites the fields from the verified manifest. A newaddonpkg catalog-toolssubcommand adds them to an existing index fromaddons/<id>/manifest.jsonin the repository, because the packaged artifacts are not needed to read a manifest. It changes no other field: no digest, artifact or policy line moved.gallery/addons/index.yamlwas regenerated with it.catalog.Release) validates the hint (names are tool names, no duplicates, count not below the names listed, at most 32 names) and refuses it on a backend entry. The catalog search and details actions return the release as is, so the fields reach the UI.addedByEntry) feeds the existingaddedByAddonpath. New i18n keyscard.addsTools_oneandcard.addsTools_otherin all locales (English text, as forcard.chatTools).docs/content/features/addons.mdandgallery/addons/README.md.Tool counts in the regenerated index
Tests
pkg/addons/packaging: 138 specs pass (new: tables reports 16 tools and not the admin tool; fine-tuning 8, quantization 6, voice none; the 32-name cap keeps the full count;catalog-toolsreproduces the committed index and is idempotent).core/services/addons/catalog(with-tags auth): 80 specs pass (new: fields carried from the index to the listing and its JSON, absent when empty, cap with full count, malformed hints refused).-tags auth:core/services/addons/...,pkg/addons/...,core/http/endpoints/addons/...,core/gallery/....npm run test:unit200 passed, 0 failed (new: the line is shown only when the count is above zero, the catalog adapter carries the fields, the English wording "Adds 16 tools" and "Adds 1 tool", locale key parity).npm run buildsucceeds.Not run
npm run test:e2e). The existing specs assert the installed-view text, which did not change.