Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(marketplace): consumer taxonomy, honest longevity metadata, seed<->override merge
Ruben Lütke9ac79edb3afa
diff --git a/jarvis/marketplace/catalog.py b/jarvis/marketplace/catalog.pyindex 94750956a9..89e3df0a2a 100644--- a/jarvis/marketplace/catalog.py+++ b/jarvis/marketplace/catalog.py@@ -92,20 +92,63 @@ AuthConfig = Annotated[]-Category = Literal["Developer", "Productivity", "Communication"]+# Display order for the Plugins view, served to the frontend alongside the+# catalog. `category` is deliberately a plain string, NOT a Literal: the value+# crosses Python -> JSON -> TS -> the section grouping, and pinning it in every+# layer is the multi-layer drift class this repo has paid for four times+# (docs/anti-drift-three-layer.md). With the order declared here and the+# frontend appending anything it does not recognize, adding a category is a+# backend-only change. `test_catalog_seed` asserts every category the shipped+# seed uses appears below, so a typo is still caught — just not by breaking a+# user's local catalog on upgrade.+CATEGORY_ORDER: tuple[str, ...] = (+ "Home & Devices",+ "Lists & Tasks",+ "Calendar & Mail",+ "Messaging",+ "Knowledge & Reading",+ "Media & Creativity",+ "Files & Photos",+ "Developer",+)+++# How long a connection survives once made — the honest answer to "this must+# never expire", surfaced on the card BEFORE the user connects.+# permanent - the credential has no expiry mechanism at all+# self_renewing - it expires, but background refresh keeps it alive+# indefinitely (the common OAuth case)+# provider_limited - the provider forces re-authorization on a schedule we+# cannot extend; `longevity_note` must say how often+Longevity = Literal["permanent", "self_renewing", "provider_limited"]class PluginSpec(_BaseAuth):id: strdisplay_name: strdescription: str- category: Category+ category: strlogo_slug: strlogo_color: str | None = None# When set, the frontend uses this URL instead of the simpleicons CDN.# Use for brands whose original logo is multicolor (e.g. Slack's hash).logo_url: str | None = Nonefeatured: bool = False+ # Honest connection lifetime, rendered as a badge on the card. Defaulted so+ # every already-shipped entry stays valid; each catalog entry should still+ # state it explicitly rather than inherit the default.+ longevity: Longevity = "self_renewing"+ # One plain sentence shown next to the badge — mandatory in spirit for+ # `provider_limited` ("Google requires re-approval every 7 days while the+ # OAuth app is in Testing mode"), optional otherwise.+ longevity_note: str | None = None+ # Which `<family>_oauth_client_id` secret pair overrides this plugin's+ # catalog client, for providers where the downloader must register their+ # own OAuth app. Lives here so a new plugin stays a catalog-only change:+ # this replaced a hand-maintained map that was duplicated in the connect+ # helper AND the frontend, where a missing entry silently removed the+ # "use your own OAuth client" affordance.+ oauth_client_family: str | None = Noneauth: AuthConfig# Installer/transport metadata for the eventual MCP-spawn wave. The route# layer does not consume this today, but the catalog already carries it,diff --git a/jarvis/marketplace/catalog_data.py b/jarvis/marketplace/catalog_data.pyindex 5796efef4e..f580d871b5 100644--- a/jarvis/marketplace/catalog_data.py+++ b/jarvis/marketplace/catalog_data.py@@ -92,26 +92,100 @@ def _migrate_obsolete_mcp_transports(raw: object) -> object:return raw-def _read(path: Path) -> PluginCatalog:+# What a user's `data/` override is allowed to keep when the package seed also+# knows the plugin: the connection details they may genuinely have customized+# (their own OAuth client id, a self-hosted MCP endpoint). Everything else —+# name, description, category, logo, longevity badge — is a PRODUCT decision+# that ships with the app, so it comes from the seed. Without this split, a+# taxonomy or logo change would land only on fresh installs.+_OVERRIDE_OWNED_FIELDS: tuple[str, ...] = ("auth", "mcp_server")+++def _merge_with_seed(override: object, seed: object) -> object:+ """Reconcile a user's `data/` catalog with the shipped package seed.++ Before this merge the override replaced the seed WHOLESALE, so a connector+ added to the shipped catalog reached only FRESH installs: every machine+ that had ever materialized ``data/`` kept serving its frozen list, and the+ new plugin was invisible there — while every test, which reads the seed+ directly, stayed green. That is the inverted form of "works on my machine",+ and it hid new catalog work from the very box it was developed on.++ Two rules now apply:+ * a seed plugin the override does not declare is ADDED;+ * a plugin both know is presented from the SEED, except for the fields in+ ``_OVERRIDE_OWNED_FIELDS``, which stay the user's.++ Consequence worth knowing: deleting an entry from the override no longer+ hides a plugin — the seed supplies it again. Curation means editing an+ entry, not removing it.+ """+ if not isinstance(override, dict) or not isinstance(override.get("plugins"), list):+ return override+ if not isinstance(seed, dict) or not isinstance(seed.get("plugins"), list):+ return override++ seed_by_id = {+ str(plugin["id"]): plugin+ for plugin in seed["plugins"]+ if isinstance(plugin, dict) and plugin.get("id")+ }+ merged_plugins: list[object] = []+ declared: set[str] = set()+ for plugin in override["plugins"]:+ if not isinstance(plugin, dict) or not plugin.get("id"):+ merged_plugins.append(plugin)+ continue+ plugin_id = str(plugin["id"])+ declared.add(plugin_id)+ seed_plugin = seed_by_id.get(plugin_id)+ if seed_plugin is None:+ merged_plugins.append(plugin) # a purely local entry+ continue+ reconciled = dict(seed_plugin)+ for field in _OVERRIDE_OWNED_FIELDS:+ if field in plugin:+ reconciled[field] = plugin[field]+ merged_plugins.append(reconciled)++ merged_plugins.extend(+ plugin for plugin_id, plugin in seed_by_id.items() if plugin_id not in declared+ )+ result = dict(override)+ result["plugins"] = merged_plugins+ return result+++def _read_raw(path: Path) -> object:with path.open(encoding="utf-8-sig") as f:- raw = json.load(f)+ return json.load(f)+++def _read(path: Path) -> PluginCatalog:+ raw = _read_raw(path)if path.resolve() == _DEFAULT_CATALOG_PATH.resolve():raw = _migrate_obsolete_mcp_transports(raw)return PluginCatalog.model_validate(raw)-def _resolve_path(path: Path | None) -> Path:- """Explicit path wins; else the user's data/ override; else the seed."""- if path is not None:- return path- if _DEFAULT_CATALOG_PATH.exists():- return _DEFAULT_CATALOG_PATH- return _PACKAGE_SEED_PATH--@lru_cache(maxsize=4)def load_catalog(path: Path | None = None) -> PluginCatalog:- return _read(_resolve_path(path))+ """Explicit path wins; else the user's data/ override topped up from the+ package seed; else the seed alone (fresh clone / headless VPS)."""+ if path is not None:+ return _read(path)+ if not _DEFAULT_CATALOG_PATH.exists():+ return _read(_PACKAGE_SEED_PATH)+ raw = _migrate_obsolete_mcp_transports(_read_raw(_DEFAULT_CATALOG_PATH))+ try:+ seed_raw = _read_raw(_PACKAGE_SEED_PATH)+ except (OSError, ValueError):+ # A missing/corrupt package seed must never take the user's own+ # catalog down with it — serve the override unchanged.+ seed_raw = None+ if seed_raw is not None:+ raw = _merge_with_seed(raw, seed_raw)+ return PluginCatalog.model_validate(raw)def clear_cache() -> None:diff --git a/jarvis/marketplace/connect_helpers.py b/jarvis/marketplace/connect_helpers.pyindex e3943634cb..f3d431cd9a 100644--- a/jarvis/marketplace/connect_helpers.py+++ b/jarvis/marketplace/connect_helpers.py@@ -41,6 +41,11 @@ _PLACEHOLDER_MARKERS: tuple[str, ...] = (# (per the catalog hint "shares the Google client with Drive"); slack and asana# each get their own. DCR plugins (notion/linear/cloudflare) register their client# dynamically and are intentionally absent — they have no static client to supply.+#+# The catalog's `oauth_client_family` field is now authoritative; this table is+# the compatibility fallback for a user's `data/` override written before that+# field existed. Do NOT add new plugins here — put the family in the catalog+# entry, which is the whole point of moving it there._OAUTH_CLIENT_FAMILY: dict[str, str] = {"gmail": "google","google_drive": "google",@@ -50,6 +55,24 @@ _OAUTH_CLIENT_FAMILY: dict[str, str] = {}+def oauth_client_family(plugin_id: str) -> str | None:+ """Return the BYO-OAuth-client secret family for a plugin, or ``None``.++ Catalog field first, legacy table second. One resolver so the connect+ route, the refresh scheduler and the frontend cannot drift apart.+ """+ try:+ from jarvis.marketplace.catalog_data import load_catalog++ spec = load_catalog().by_id(plugin_id)+ except Exception: # noqa: BLE001 - a broken catalog must not break refresh+ spec = None+ declared = getattr(spec, "oauth_client_family", None) if spec else None+ if declared:+ return str(declared)+ return _OAUTH_CLIENT_FAMILY.get(plugin_id)++def is_placeholder_client_id(value: str | None) -> bool:"""True when an OAuth client_id is empty or an unfilled catalog placeholder."""if value is None:@@ -75,7 +98,7 @@ def resolve_pkce_client(the catalog value (``or`` fallback), so a placeholder catalog client stillbuilds a handler and the scheduler can honestly flag needs_reauth."""- family = _OAUTH_CLIENT_FAMILY.get(plugin_id)+ family = oauth_client_family(plugin_id)if family is None:return catalog_client_id, catalog_client_secretfrom jarvis.core.config import get_secretdiff --git a/jarvis/marketplace/seed_catalog.json b/jarvis/marketplace/seed_catalog.jsonindex f1a3eb5ddf..3341b406fe 100644--- a/jarvis/marketplace/seed_catalog.json+++ b/jarvis/marketplace/seed_catalog.json@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"schema_version": "2026-05-09","plugins": [{@@ -9,6 +9,8 @@"category": "Developer","logo_slug": "github","featured": true,+ "longevity": "permanent",+ "longevity_note": "Pick 'No expiration' when you create the token.","auth": {"mode": "pat_paste","token_creation_url": "https://github.com/settings/tokens/new?scopes=repo,workflow,read:user&description=Personal+Jarvis",@@ -30,6 +32,8 @@"category": "Developer","logo_slug": "vercel","featured": true,+ "longevity": "permanent",+ "longevity_note": "Pick 'No expiration' when you create the token.","auth": {"mode": "pat_paste","token_creation_url": "https://vercel.com/account/tokens",@@ -47,6 +51,7 @@"category": "Developer","logo_slug": "supabase","featured": false,+ "longevity": "permanent","auth": {"mode": "pat_paste","token_creation_url": "https://supabase.com/dashboard/account/tokens",@@ -65,9 +70,10 @@"id": "notion","display_name": "Notion","description": "Pages, databases and comments — multi-workspace",- "category": "Productivity",+ "category": "Knowledge & Reading","logo_slug": "notion","featured": true,+ "longevity": "self_renewing","auth": {"mode": "hosted_mcp_oauth_dcr","discovery_url": "https://mcp.notion.com/.well-known/oauth-protected-resource",@@ -94,10 +100,12 @@"id": "slack","display_name": "Slack","description": "Channels, DMs, search and Canvas drafts",- "category": "Communication",+ "category": "Messaging","logo_slug": "slack","logo_url": "/plugin-assets/slack-logo.svg","featured": true,+ "longevity": "self_renewing",+ "oauth_client_family": "slack","auth": {"mode": "oauth_pkce_loopback","authorization_url": "https://slack.com/oauth/v2/authorize",@@ -136,6 +144,7 @@"category": "Developer","logo_slug": "linear","featured": true,+ "longevity": "self_renewing","auth": {"mode": "hosted_mcp_oauth_dcr","discovery_url": "https://mcp.linear.app/.well-known/oauth-protected-resource",@@ -155,6 +164,7 @@"category": "Developer","logo_slug": "stripe","featured": false,+ "longevity": "permanent","auth": {"mode": "pat_paste","token_creation_url": "https://dashboard.stripe.com/apikeys",@@ -176,6 +186,7 @@"category": "Developer","logo_slug": "cloudflare","featured": false,+ "longevity": "self_renewing","auth": {"mode": "hosted_mcp_oauth_dcr","discovery_url": "https://observability.mcp.cloudflare.com/.well-known/oauth-protected-resource",@@ -198,9 +209,11 @@"id": "discord","display_name": "Discord","description": "Chat with Jarvis from Discord (your bot)",- "category": "Communication",+ "category": "Messaging","logo_slug": "discord","featured": false,+ "longevity": "permanent",+ "longevity_note": "A bot token stays valid until you reset it in the Discord developer portal.","auth": {"mode": "pat_paste","auth_scheme": "bot",@@ -215,9 +228,11 @@"id": "telegram","display_name": "Telegram","description": "Chat with Jarvis from Telegram (your bot)",- "category": "Communication",+ "category": "Messaging","logo_slug": "telegram","featured": false,+ "longevity": "permanent",+ "longevity_note": "A bot token stays valid until you revoke it in BotFather.","auth": {"mode": "pat_paste","auth_scheme": "telegram_path",@@ -232,9 +247,11 @@"id": "asana","display_name": "Asana","description": "Tasks, projects and workspaces",- "category": "Productivity",+ "category": "Lists & Tasks","logo_slug": "asana","featured": false,+ "longevity": "self_renewing",+ "oauth_client_family": "asana","auth": {"mode": "oauth_pkce_loopback","authorization_url": "https://app.asana.com/-/oauth_authorize",@@ -242,7 +259,9 @@"revocation_url": "https://app.asana.com/-/oauth_revoke","client_id": "REPLACE_WITH_JARVIS_ASANA_CLIENT_ID","callback_port": 3119,- "scopes": ["default"],+ "scopes": [+ "default"+ ],"refresh_supported": true,"resource": "https://mcp.asana.com/v2"},@@ -257,9 +276,12 @@"id": "google_drive","display_name": "Google Drive","description": "Search, read, create, share and delete your Drive files",- "category": "Productivity",+ "category": "Files & Photos","logo_slug": "googledrive","featured": false,+ "longevity": "provider_limited",+ "longevity_note": "Google expires the authorization after 7 days while your own OAuth app is in Testing mode. Publish the app to keep the connection indefinitely.",+ "oauth_client_family": "google","auth": {"mode": "oauth_pkce_loopback","authorization_url": "https://accounts.google.com/o/oauth2/v2/auth",@@ -268,7 +290,9 @@"client_id": "REPLACE_WITH_JARVIS_GOOGLE_CLIENT_ID","callback_port": 3120,"callback_path": "",- "scopes": ["https://www.googleapis.com/auth/drive"],+ "scopes": [+ "https://www.googleapis.com/auth/drive"+ ],"scope_separator": "space","user_scopes_only": false,"refresh_supported": true,@@ -281,9 +305,12 @@"id": "gmail","display_name": "Gmail","description": "Read, send, organize and delete mail in your inbox",- "category": "Communication",+ "category": "Calendar & Mail","logo_slug": "gmail","featured": false,+ "longevity": "provider_limited",+ "longevity_note": "Google expires the authorization after 7 days while your own OAuth app is in Testing mode. Publish the app to keep the connection indefinitely.",+ "oauth_client_family": "google","auth": {"mode": "oauth_pkce_loopback","authorization_url": "https://accounts.google.com/o/oauth2/v2/auth",@@ -307,9 +334,12 @@"id": "google_calendar","display_name": "Google Calendar","description": "See your schedule and create, move or delete events by voice",- "category": "Productivity",+ "category": "Calendar & Mail","logo_slug": "googlecalendar","featured": true,+ "longevity": "provider_limited",+ "longevity_note": "Google expires the authorization after 7 days while your own OAuth app is in Testing mode. Publish the app to keep the connection indefinitely.",+ "oauth_client_family": "google","auth": {"mode": "oauth_pkce_loopback","authorization_url": "https://accounts.google.com/o/oauth2/v2/auth",diff --git a/jarvis/ui/web/marketplace_routes.py b/jarvis/ui/web/marketplace_routes.pyindex 49039d7c60..771f26cf80 100644--- a/jarvis/ui/web/marketplace_routes.py+++ b/jarvis/ui/web/marketplace_routes.py@@ -32,6 +32,7 @@ from jarvis.marketplace.auth import (get_registry,)from jarvis.marketplace.catalog import (+ CATEGORY_ORDER,HostedMcpOAuthDcrAuth,OAuthDeviceFlowAuth,OAuthPkceLoopbackAuth,@@ -254,6 +255,11 @@ async def list_plugins(response: Response) -> dict[str, Any]:return {"version": catalog.version,"schema_version": catalog.schema_version,+ # Section order for the store. Served rather than hardcoded in the UI so+ # a new category is a backend-only change; the frontend appends any+ # category it receives that is not listed here instead of dropping (or+ # crashing on) it.+ "category_order": list(CATEGORY_ORDER),"plugins": enriched,"total": len(enriched),"connected": connected,diff --git a/tests/unit/marketplace/test_catalog_load.py b/tests/unit/marketplace/test_catalog_load.pyindex 946339a6de..f0b2efb96d 100644--- a/tests/unit/marketplace/test_catalog_load.py+++ b/tests/unit/marketplace/test_catalog_load.py@@ -12,6 +12,7 @@ contract the frontend depends on (id, display_name, category, auth.mode).from __future__ import annotations+from jarvis.marketplace.catalog import CATEGORY_ORDERfrom jarvis.marketplace.catalog_data import clear_cache, load_catalog@@ -36,7 +37,9 @@ def test_every_plugin_has_a_resolvable_auth_block() -> None:for plugin in catalog.plugins:assert plugin.id, "plugin without id"assert plugin.display_name, f"{plugin.id}: missing display_name"- assert plugin.category in {"Developer", "Productivity", "Communication"}+ assert plugin.category in set(CATEGORY_ORDER), (+ f"{plugin.id}: category {plugin.category!r} is not in CATEGORY_ORDER"+ )assert plugin.auth.mode in known_modes, (f"{plugin.id}: unknown auth mode {plugin.auth.mode!r}")diff --git a/tests/unit/marketplace/test_catalog_seed.py b/tests/unit/marketplace/test_catalog_seed.pyindex 708c4fb558..0698be8547 100644--- a/tests/unit/marketplace/test_catalog_seed.py+++ b/tests/unit/marketplace/test_catalog_seed.py@@ -21,6 +21,26 @@ def test_package_seed_exists_and_is_valid() -> None:assert {"github", "notion", "linear"} <= ids+def test_every_seed_category_is_declared_in_the_display_order() -> None:+ """`category` is a free string so a taxonomy change cannot break a user's+ local catalog on upgrade. This is what still catches a typo in the seed."""+ from jarvis.marketplace.catalog import CATEGORY_ORDER++ used = {p.category for p in _seed().plugins}+ assert used <= set(CATEGORY_ORDER), (+ f"seed categories missing from CATEGORY_ORDER: {sorted(used - set(CATEGORY_ORDER))}"+ )+++def test_every_seed_plugin_states_its_longevity_note_when_limited() -> None:+ """A `provider_limited` card must say HOW often the user has to come back —+ the badge alone would be a warning without an answer."""+ limited = [p for p in _seed().plugins if p.longevity == "provider_limited"]+ assert limited, "the Google family is provider-limited; this test would be vacuous"+ for plugin in limited:+ assert plugin.longevity_note, f"{plugin.id} is provider_limited without a note"++def test_developer_connectors_use_hosted_mcp_without_local_runtimes() -> None:catalog = _seed()github = catalog.by_id("github")@@ -51,17 +71,63 @@ def test_falls_back_to_seed_when_no_data_override(monkeypatch, tmp_path) -> Noneclear_cache()-def test_data_override_wins_when_present(monkeypatch, tmp_path) -> None:+def test_override_keeps_connection_details_but_not_presentation(+ monkeypatch, tmp_path+) -> None:+ """The user's own OAuth client survives; the product's own copy does not.++ A local catalog may legitimately carry a user's own OAuth client id. It+ must NOT freeze the card's category, wording or logo, or a taxonomy change+ would land on fresh installs only.+ """clear_cache()+ seed = json.loads(catalog_data._PACKAGE_SEED_PATH.read_text(encoding="utf-8"))+ seed_slack = next(item for item in seed["plugins"] if item["id"] == "slack")+ local_slack = json.loads(json.dumps(seed_slack))+ local_slack["description"] = "stale local wording"+ local_slack["category"] = "Retired Category"+ local_slack["auth"]["client_id"] = "1234.my-own-slack-client"override = tmp_path / "plugin_catalog.json"override.write_text(- json.dumps({"version": 9, "schema_version": "ovr", "plugins": []}),+ json.dumps({"version": 9, "schema_version": "ovr", "plugins": [local_slack]}),encoding="utf-8",)monkeypatch.setattr(catalog_data, "_DEFAULT_CATALOG_PATH", override)- cat = load_catalog()- assert cat.version == 9- assert cat.plugins == []++ slack = load_catalog().by_id("slack")++ assert slack.auth.client_id == "1234.my-own-slack-client"+ assert slack.description == seed_slack["description"]+ assert slack.category == seed_slack["category"]+ clear_cache()+++def test_stale_override_still_receives_plugins_added_to_the_seed(+ monkeypatch, tmp_path+) -> None:+ """A new seed connector must reach installs that already have a data/ override.++ Before the merge the override replaced the seed wholesale, so a plugin+ added to the shipped catalog appeared only on FRESH installs while every+ existing machine — including the one it was developed on — kept serving its+ frozen list. The tests stayed green because they read the seed directly.+ """+ clear_cache()+ seed = json.loads(catalog_data._PACKAGE_SEED_PATH.read_text(encoding="utf-8"))+ stale = [item for item in seed["plugins"] if item["id"] == "github"]+ override = tmp_path / "plugin_catalog.json"+ override.write_text(+ json.dumps({"version": 1, "schema_version": "old", "plugins": stale}),+ encoding="utf-8",+ )+ monkeypatch.setattr(catalog_data, "_DEFAULT_CATALOG_PATH", override)++ ids = {p.id for p in load_catalog().plugins}++ assert "github" in ids, "the override's own entry must survive"+ assert {p["id"] for p in seed["plugins"]} <= ids, (+ "every seed plugin must surface through a stale override"+ )clear_cache()