Files
Shanghua Gao ac41c28fe8 Add /tooluniverse:setup-keys command for API key configuration (#194)
* feat: add API key metadata catalog source

* feat: add API key catalog generator

* feat: generate API key catalog and regenerate .env.template

* ci: sync API key catalog from tool configs

* feat: load global ~/.tooluniverse/.env from any workspace

* feat: add .env read/mask/merge helper for key setup

* feat: add graphical API key setup server

* feat: add /tooluniverse:setup-keys command and package it

* feat: redesign setup-keys page with domain grouping and per-key context

- Group keys by research domain (Genomics & Variants, Drugs & Chemistry,
  Proteins & Structure, Literature & Patents, Clinical & Safety,
  Models & Infrastructure) instead of Required/Optional/Endpoints.
- Each key shows its purpose (what it unlocks) and a without-it note
  (blocked / demo mode / lower limits / leave blank unless self-hosting).
- Light product UI: white cards in responsive grid, indigo accent,
  Hanken Grotesk + IBM Plex Mono, live progress meter, show/hide toggles.
- Enrich api_key_metadata.json with domain, purpose, without fields;
  generator emits them in api_keys_catalog.json; .env.template regrouped
  by domain with per-key Without notes.

* fix: exclude __pycache__ from plugin scripts dir during build

cp -r was shipping stray .pyc files / __pycache__ dirs into the built
plugin if a developer had run the scripts locally before building.
Switch to rsync with explicit excludes, and add a regression test that
plants a canary __pycache__ before the build and asserts dist/ stays
clean.

* fix: split one-line try/except in pycache regression test (ruff E701)

* refactor: declare API key metadata inline in tool configs (api_key_info)

Instead of a separate api_key_metadata.json, each tool config now carries
an api_key_info block next to its required/optional_api_keys. The generator
scans configs for both the key names and their info, so adding a new key is
a one-file edit. Deletes api_key_metadata.json; runtime code is untouched
(required_api_keys stays a list of strings). Catalog + .env.template output
is byte-identical.

* chore: sync API key catalog [skip ci]

* docs: document api_key_info convention in custom-tool skill

The JSON-tool authoring guide now explains declaring required/optional_api_keys
and the inline api_key_info block (domain/purpose/without/register_url/type)
that flows into the /tooluniverse:setup-keys UI and .env.template, plus the
generator + CI auto-sync step.

* fix: add UMLS, ICD-11, Gemini, OpenRouter keys to the catalog

These keys are read by umls_tool / icd_tool / llm_clients via os.getenv but
were never declared in any tool config, so the generated catalog and
.env.template omitted them (UMLS_API_KEY + ICD_CLIENT_ID/SECRET regressed
vs main). Declare them as optional_api_keys with api_key_info on the
relevant tools so they appear in /tooluniverse:setup-keys and .env.template.
Runtime load behavior unchanged (optional, not required).

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-05-26 08:50:26 -07:00
..