Skip to content

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.

feat(marketplace): write the io.github.dodaios manifest namespace and read both (#583)

Ruben Lütke38e5b14c5cdc
diff --git a/docs/marketplace/agent-plugins-standard.md b/docs/marketplace/agent-plugins-standard.md
index 7d72537296..c0fcca81d2 100644
--- a/docs/marketplace/agent-plugins-standard.md
+++ b/docs/marketplace/agent-plugins-standard.md
@@ -22,10 +22,13 @@ Plugins store: GitHub, Notion, Slack, Gmail, …).
never inline in `plugin.json` and never with credentials in `headers`.
3. Everything Dodaios-specific — auth flows, branding, category, longevity
badge, native-tool or channel binding, post-install hints — lives in the
- client extension namespace **`io.github.personaljarvis`** (manifest data
- under `extensions["io.github.personaljarvis"]` in `plugin.json`, files
- under an `io.github.personaljarvis/` directory). Other clients ignore that
- namespace, exactly as the spec intends.
+ client extension namespace **`io.github.dodaios`** (manifest data
+ under `extensions["io.github.dodaios"]` in `plugin.json`, files
+ under an `io.github.personaljarvis/` directory, which keeps the
+ namespace's earlier name). Other clients ignore that
+ namespace, exactly as the spec intends. The namespace's earlier name,
+ `io.github.personaljarvis`, stays valid on read everywhere and for good:
+ see "The namespace has two names" below.
4. Existing catalog entries are migrated per the audit below. The loader
wave has landed for COMMUNITY plugins: `agent_plugins_loader.py` converts
Agent Plugins v1.0.0 manifests from the
@@ -42,10 +45,10 @@ Plugins store: GitHub, Notion, Slack, Gmail, …).
| `description` | `plugin.json` → `description` |
| `mcp_server` (`transport: "http"`) | `mcp.json` → `mcpServers.<id>` with `type: "streamable-http"` and the same `url` |
| `mcp_server.auth_header_template` | **Must NOT move to `mcp.json`** — the spec forbids credentials in `headers`. Token injection stays a client concern in the extension namespace. |
-| `auth` (all five modes), `oauth_client_family` | `extensions["io.github.personaljarvis"]` |
-| `display_name`, `category`, `logo_*`, `featured`, `longevity`, `longevity_note`, `post_install_hint_md`, `future_v2_note` | `extensions["io.github.personaljarvis"]` |
-| `native_tool` (Vercel, Google trio, Home Assistant) | `extensions["io.github.personaljarvis"]` — such a plugin is valid under the spec with `plugin.json` alone (components are optional), but carries nothing portable |
-| Channel enablement (Discord, Telegram) | `extensions["io.github.personaljarvis"]` — same extension-only shape |
+| `auth` (all five modes), `oauth_client_family` | `extensions["io.github.dodaios"]` |
+| `display_name`, `category`, `logo_*`, `featured`, `longevity`, `longevity_note`, `post_install_hint_md`, `future_v2_note` | `extensions["io.github.dodaios"]` |
+| `native_tool` (Vercel, Google trio, Home Assistant) | `extensions["io.github.dodaios"]` — such a plugin is valid under the spec with `plugin.json` alone (components are optional), but carries nothing portable |
+| Channel enablement (Discord, Telegram) | `extensions["io.github.dodaios"]` — same extension-only shape |
Target layout per plugin (seed side; the gitignored `data/` override keeps its
merge semantics):
@@ -57,6 +60,37 @@ jarvis/marketplace/plugins/<name>/
└── io.github.personaljarvis/ # auth, branding, longevity, hints (extension files)
```
+## The namespace has two names
+
+`io.github.dodaios` is the namespace the app writes. `io.github.personaljarvis`
+is what it was called before the product was renamed, and what every package
+published until then carries. Both are read wherever a manifest is read
+(`agent_plugins_loader.extension_of`): the community index, an uploaded
+package, the in-app Publish check and the auth-contract gate. The extension
+directory of a package (`io.github.personaljarvis/usage-card.md`) keeps its
+earlier name for now: the Publish form reads the usage card from there.
+
+- **Identity.** The namespace is the key a block sits under and no part of
+ what the plugin is. A plugin is identified by `plugin.json` → `name`, which
+ becomes the catalog id. The same package under either namespace converts to
+ the same catalog entry, installs into the same row and keeps its update
+ link; an installed plugin is stored as that converted entry, which holds no
+ namespace at all.
+- **Both keys at once.** A manifest may carry its block under both
+ namespaces. The blocks must then be identical; a manifest whose two blocks
+ differ is refused, because the registry validates one key and a client may
+ read the other.
+- **What is published.** A submission from the app carries the block under
+ both keys. The registry validator (`scripts/validate.py`) and every app
+ version released before the rename read only `io.github.personaljarvis`;
+ the copy keeps new submissions valid for both. It is dropped once the
+ registry accepts the new namespace
+ ([validator-parity.md](validator-parity.md), "The extension namespace").
+- **The shipped packages** under `jarvis/marketplace/plugins/` and
+ `jarvis/marketplace/drafts/` keep `io.github.personaljarvis`. They are
+ packages in the published format, and that format's authority still
+ requires the earlier key. They move together with the registry.
+
## Migration audit — status as of 2026-08-08
**Shopify (2026-09-21) is the first plugin packaged this way from day one.**
@@ -108,8 +142,9 @@ Home Assistant); 4 need a spec-conformant rename.
`version`, `license` validates against the published schema
- [ ] Hosted MCP server (when present) declared in `mcp.json` with
`type: "streamable-http"`; **no credentials in `headers`**
-- [ ] All Dodaios-specific fields moved under
- `extensions["io.github.personaljarvis"]`; nothing Dodaios-specific
+- [ ] All Dodaios-specific fields moved under the extension namespace
+ (`extensions["io.github.personaljarvis"]` for a shipped package today,
+ see "The namespace has two names"); nothing Dodaios-specific
remains at top level
- [ ] Seed aggregation still serves the identical `/api/marketplace/plugins`
payload (existing tests stay green; connected users see no change)
diff --git a/docs/marketplace/package-layout.md b/docs/marketplace/package-layout.md
index 3929377cc2..820425e94a 100644
--- a/docs/marketplace/package-layout.md
+++ b/docs/marketplace/package-layout.md
@@ -68,7 +68,7 @@ is what makes it *good* — the tools plus the instructions for using them
well, in one install.
**`plugin.json`** — the identity. Everything Dodaios-specific sits inside the
-`io.github.personaljarvis` namespace, which every other client ignores:
+`io.github.dodaios` namespace, which every other client ignores:
```json
{
@@ -78,7 +78,7 @@ well, in one install.
"version": "1.2.0",
"license": "MIT",
"extensions": {
- "io.github.personaljarvis": {
+ "io.github.dodaios": {
"display_name": "TodoFox",
"category": "Lists & Tasks",
"logo_slug": "todofox",
@@ -93,6 +93,23 @@ well, in one install.
}
```
+The namespace was called `io.github.personaljarvis` before the product was
+renamed. A package written with it stays valid as it is: the app reads the
+block under either key, and a plugin
+is the same plugin whichever one it uses, because its identity is its `name`.
+Three rules keep the two in step:
+
+- Publishing from the app (the Publish tab) sends the block under **both**
+ keys, identical. The registry's validator and app versions released before
+ the rename read only the earlier key, so a submission without it would be
+ refused there (see [validator-parity.md](validator-parity.md), "The
+ extension namespace").
+- A pull request opened against the registry by hand needs the same: until
+ the registry accepts `io.github.dodaios` on its own, keep the block under
+ `io.github.personaljarvis` as well.
+- A manifest that carries both keys must carry the same block under each.
+ Two blocks that differ are refused at install, never merged.
+
**`mcp.json`** — exactly one server, either hosted over HTTPS:
```json
diff --git a/docs/marketplace/public-marketplace-analysis.md b/docs/marketplace/public-marketplace-analysis.md
index 0a57da23b4..274ba5bce6 100644
--- a/docs/marketplace/public-marketplace-analysis.md
+++ b/docs/marketplace/public-marketplace-analysis.md
@@ -41,7 +41,8 @@ Two further pieces matter for a public marketplace:
* **Packaging standard already adopted.** Since 2026-08-08 every new
marketplace plugin must be an Agent Plugins v1.0.0 directory
(`plugin.json`, optional `mcp.json`, Dodaios specifics under the
- `io.github.personaljarvis` extension namespace). The
+ `io.github.dodaios` extension namespace, called `io.github.personaljarvis`
+ before the rename and still read under that name). The
[standard doc](agent-plugins-standard.md) explicitly defers a
"loader/aggregation wave" — a public marketplace **is** that wave.
* **"Install" is already a file write.** Because the catalog loader keeps
diff --git a/docs/marketplace/validator-parity.md b/docs/marketplace/validator-parity.md
index cc2119bfc0..708e653eef 100644
--- a/docs/marketplace/validator-parity.md
+++ b/docs/marketplace/validator-parity.md
@@ -33,7 +33,7 @@ noted at the end.
| 4 | `plugin_json.$schema` must equal the Agent Plugins v1.0.0 URL exactly | `validate_plugin` | not checked |
| 5 | `plugin_json.name` must equal the submission name | `validate_plugin` | not checked |
| 6 | `plugin_json.description` is **required** (not just length-capped) | `validate_plugin` | length checked only when present |
-| 7 | `extensions["io.github.personaljarvis"]` is required | `validate_plugin` | not checked |
+| 7 | `extensions["io.github.personaljarvis"]` is required (the namespace's earlier name; see "The extension namespace" below) | `validate_plugin` | not checked |
| 8 | `native_tool` is refused (repo-contributed code, not publishable) | `validate_plugin` | not checked |
| 9 | `auth.mode` must be one of the five known modes | `AUTH_MODES` | not checked |
| 10 | `mcp_auth_header_template` needs a `$plugin_…` placeholder and may embed no literal credential | `validate_plugin` | not checked |
@@ -65,6 +65,62 @@ The registry repo is private today, which contains the blast radius. It is
scheduled to be reopened once the login path is green (spec §8 step 5), so
this should close before that happens.
+## The extension namespace
+
+The app writes `io.github.dodaios` and reads that namespace and its earlier
+name `io.github.personaljarvis` alike
+(`jarvis/marketplace/agent_plugins_loader.py`: `EXTENSION_NAMESPACES`,
+`extension_of`). The registry does not yet:
+
+| Registry file | Today | Effect of a manifest that uses only `io.github.dodaios` |
+|---|---|---|
+| `scripts/validate.py` (`EXTENSION_NAMESPACE`, `validate_plugin`) | requires `extensions["io.github.personaljarvis"]` | rule 7 fails: the submission is refused |
+| `scripts/expand.py` (`EXTENSION_DIR`) | writes the usage card to `io.github.personaljarvis/usage-card.md` | none for the app: the card travels in the index as `usage_card` text |
+| `scripts/build_index.py` (`EXTENSION_DIR`) | reads the usage card from `io.github.personaljarvis/` | a package whose card sits only in `io.github.dodaios/` is indexed without it |
+| `scripts/export_rules.py` → `rules.json` | publishes one `extension_namespace` | a consumer of `rules.json` learns only the earlier name |
+
+So that publishing keeps working unchanged, a submission from the app carries
+its block under **both** keys, identical
+(`PUBLISHED_EXTENSION_NAMESPACES`, applied in `publish.validate_draft`). The
+registry validates the earlier key as it always has and ignores the new one;
+app versions released before the rename read the earlier key from the index;
+this version reads the new one. Because the two keys are validated by
+different parties, the app refuses a manifest whose two blocks differ.
+
+### What the registry needs, exactly
+
+In `Dodaios/marketplace`, in one change:
+
+1. `scripts/validate.py`: replace the single `EXTENSION_NAMESPACE` with
+ `EXTENSION_NAMESPACES = ("io.github.dodaios", "io.github.personaljarvis")`.
+ In `validate_plugin`, take the block from the first namespace present whose
+ value is an object, and fail rule 7 only when none is. When both are
+ present, require them to be equal (`==` on the parsed objects) and report
+ `plugin_json.extensions: the two namespace blocks must be identical`
+ otherwise. Every later rule (8, 9, 10) then runs on that one block.
+2. `scripts/expand.py`: write the usage card to
+ `io.github.dodaios/usage-card.md`. Leave an existing
+ `io.github.personaljarvis/usage-card.md` in place for packages already
+ expanded; do not rewrite published directories.
+3. `scripts/build_index.py`: read the usage card from
+ `io.github.dodaios/usage-card.md`, falling back to
+ `io.github.personaljarvis/usage-card.md`.
+4. `scripts/export_rules.py`: add `extension_namespaces` (the tuple above) to
+ `rules.json` and keep `extension_namespace` with its current value, so a
+ consumer that reads the old field keeps working.
+5. Tests next to the validator: a plugin under each namespace alone passes; a
+ plugin under both with equal blocks passes; under both with different
+ blocks fails; under neither fails rule 7.
+6. Do **not** rewrite the `plugin.json` of any published package, and do not
+ change any published name: the index is a wire contract, and app versions
+ released before the rename read `io.github.personaljarvis` from it.
+
+Once that is live, the app can stop sending the copy by setting
+`PUBLISHED_EXTENSION_NAMESPACES` to the current namespace only. From then on
+a newly published plugin is no longer installable by an app version released
+before the rename, which is the point at which that support ends; nothing
+else depends on the copy.
+
## The fix that stops it recurring
`rules.json` is now generated from `validate.py` and published next to the
diff --git a/jarvis/core/branding.py b/jarvis/core/branding.py
index ae5a8a5a72..57644160db 100644
--- a/jarvis/core/branding.py
+++ b/jarvis/core/branding.py
@@ -84,6 +84,15 @@ WINDOWS_USER_DATA_DIR_NAME = "Jarvis"
FALLBACK_USER_DATA_DIR_NAME = ".jarvis"
DESKTOP_OUTPUT_MIRROR_DIR_NAME = "Jarvis-Output"
+# --- Marketplace manifest namespace -------------------------------------------
+# The key a plugin package keeps this app's own data under
+# (``plugin.json`` -> ``extensions[<namespace>]``) and the directory its
+# extension files live in (``<namespace>/usage-card.md``). Every package
+# published before the rename carries a legacy namespace, so those are read
+# forever (``jarvis.marketplace.agent_plugins_loader``).
+MARKETPLACE_EXTENSION_NAMESPACE = "io.github.dodaios"
+LEGACY_MARKETPLACE_EXTENSION_NAMESPACES = ("io.github.personaljarvis",)
+
WINDOWS_MUTEX_NAME = rf"Global\{PERSISTENT_COMPACT_NAME}_v1"
WINDOWS_APP_USER_MODEL_ID = f"{PERSISTENT_COMPACT_NAME}.{PERSISTENT_COMPACT_NAME}"
WINDOWS_UNINSTALL_REGISTRY_SUBKEY = (
@@ -187,6 +196,8 @@ __all__ = [
"LINUX_APP_NAME",
"LINUX_DESKTOP_ENTRY_FILE_NAME",
"LINUX_WM_CLASS",
+ "LEGACY_MARKETPLACE_EXTENSION_NAMESPACES",
+ "MARKETPLACE_EXTENSION_NAMESPACE",
"MACOS_APP_DIR_NAME",
"MACOS_APP_NAME",
"MACOS_AUTOSTART_LABEL",
diff --git a/jarvis/marketplace/agent_plugins_loader.py b/jarvis/marketplace/agent_plugins_loader.py
index ae61124dc9..fde06afc30 100644
--- a/jarvis/marketplace/agent_plugins_loader.py
+++ b/jarvis/marketplace/agent_plugins_loader.py
@@ -1,12 +1,14 @@
"""Convert an Agent Plugins v1.0.0 manifest set into a catalog `PluginSpec`.
The community registry distributes plugins as Agent Plugins v1.0.0 packages
-(docs/marketplace/agent-plugins-standard.md): a `plugin.json` whose Jarvis
-specifics live under ``extensions["io.github.personaljarvis"]``, plus an
-optional `mcp.json`. This module is the "loader wave" that document defers:
-it validates the manifests and produces the same `PluginSpec` the seed
-catalog uses, so an installed community plugin flows through the exact same
-runtime (connect flows, relevance gate, worker bridge) as a shipped one.
+(docs/marketplace/agent-plugins-standard.md): a `plugin.json` whose Dodaios
+specifics live under ``extensions["io.github.dodaios"]`` (or, in every package
+published before the rename, under the namespace's earlier name; see
+:func:`extension_of`), plus an optional `mcp.json`. This module is the "loader
+wave" that document defers: it validates the manifests and produces the same
+`PluginSpec` the seed catalog uses, so an installed community plugin flows
+through the exact same runtime (connect flows, relevance gate, worker bridge)
+as a shipped one.
Security posture: the registry auto-merges submissions on green CI, so the
client must NOT blindly trust index content. Every rule CI enforces on
@@ -25,9 +27,29 @@ from typing import Any
from pydantic import ValidationError
+from jarvis.core.branding import (
+ LEGACY_MARKETPLACE_EXTENSION_NAMESPACES,
+ MARKETPLACE_EXTENSION_NAMESPACE,
+)
from jarvis.marketplace.catalog import PluginSpec
-EXTENSION_NAMESPACE = "io.github.personaljarvis"
+#: The namespace this app WRITES: the key of its block in ``plugin.json``'s
+#: ``extensions`` and the directory of its extension files in a package.
+EXTENSION_NAMESPACE = MARKETPLACE_EXTENSION_NAMESPACE
+
+#: Earlier names of that namespace. Read wherever a manifest is read, forever:
+#: installed plugins, the community index and every package already published
+#: carry one of them.
+LEGACY_EXTENSION_NAMESPACES = LEGACY_MARKETPLACE_EXTENSION_NAMESPACES
+
+#: Every namespace a manifest may use, the current one first.
+EXTENSION_NAMESPACES: tuple[str, ...] = (EXTENSION_NAMESPACE, *LEGACY_EXTENSION_NAMESPACES)
+
+#: The registry's validator and every app version released before the rename
+#: read ONLY the earlier namespace (docs/marketplace/validator-parity.md,
+#: "The extension namespace"). Until the registry accepts the current one, a
+#: manifest this app publishes carries its block under both keys.
+PUBLISHED_EXTENSION_NAMESPACES: tuple[str, ...] = EXTENSION_NAMESPACES
# Spec name constraints (agent-plugins.org 1.0.0): 1-64 chars, lowercase
# alphanumerics plus `-` and `.`, alphanumeric start and end, no `--`/`..`,
@@ -437,6 +459,67 @@ def _convert_stdio_server(name: str, server: Mapping[str, Any]) -> dict[str, Any
}
+def extension_of(plugin_json: Mapping[str, Any]) -> Mapping[str, Any] | None:
+ """The plugin's Dodaios block, under whichever namespace the manifest uses.
+
+ The namespace is only the KEY the block sits under. It is no part of what
+ the plugin is: a plugin's identity is its ``name`` (which becomes
+ ``PluginSpec.id``), so the same package read under the current namespace
+ or an earlier one is the same item, installs into the same row and keeps
+ its update link.
+
+ The current namespace is read first, then each earlier one. A manifest
+ that carries the block under several namespaces (what this app publishes
+ while the registry still requires the earlier key) must carry the SAME
+ block under each: the registry validates one key and this client would
+ read another, so two blocks that disagree are refused instead of one being
+ picked.
+
+ Returns ``None`` when the manifest has no block under any namespace.
+ """
+ extensions = plugin_json.get("extensions") if isinstance(plugin_json, Mapping) else None
+ if not isinstance(extensions, Mapping):
+ return None
+ found = [
+ (namespace, extensions[namespace])
+ for namespace in EXTENSION_NAMESPACES
+ if isinstance(extensions.get(namespace), Mapping)
+ ]
+ if not found:
+ return None
+ first_namespace, block = found[0]
+ for namespace, other in found[1:]:
+ if dict(other) != dict(block):
+ raise AgentPluginError(
+ f'plugin.json: extensions["{first_namespace}"] and '
+ f'extensions["{namespace}"] must be identical'
+ )
+ return block
+
+
+def with_published_extension(plugin_json: Mapping[str, Any]) -> dict[str, Any]:
+ """``plugin_json`` as this app publishes it: its block under the current namespace.
+
+ Whatever namespace the draft used, the result carries the block under
+ :data:`EXTENSION_NAMESPACE` and, as long as the registry requires it, an
+ identical copy under each earlier one (:data:`PUBLISHED_EXTENSION_NAMESPACES`).
+ Other clients' extension blocks are left exactly as they are. A manifest
+ without a block of ours is returned unchanged for the validator to refuse.
+ """
+ manifest = dict(plugin_json)
+ block = extension_of(manifest)
+ if block is None:
+ return manifest
+ others = {
+ key: value
+ for key, value in dict(manifest.get("extensions") or {}).items()
+ if key not in EXTENSION_NAMESPACES
+ }
+ published = {namespace: dict(block) for namespace in PUBLISHED_EXTENSION_NAMESPACES}
+ manifest["extensions"] = {**published, **others}
+ return manifest
+
+
def validate_mcp_server(
name: str, server: Mapping[str, Any], extension: Mapping[str, Any] | None = None
) -> dict[str, Any]:
@@ -450,8 +533,8 @@ def validate_mcp_server(
launcher allowlist with its pinned-package rule — without also
reimplementing the "which server did the author mean" selection.
- ``extension`` is the plugin's ``extensions["io.github.personaljarvis"]``
- block, consulted only for a hosted server's optional
+ ``extension`` is the plugin's extension block (:func:`extension_of`),
+ consulted only for a hosted server's optional
``mcp_auth_header_template``; omit it when validating an ``mcp.json`` in
isolation, before the rest of the manifest exists.
"""
@@ -510,9 +593,8 @@ def convert_manifest(
name = validate_spec_name(plugin_json.get("name"))
description = _require_str(plugin_json.get("description"), "plugin description")
- extensions = plugin_json.get("extensions")
- extension = extensions.get(EXTENSION_NAMESPACE) if isinstance(extensions, Mapping) else None
- if not isinstance(extension, Mapping):
+ extension = extension_of(plugin_json)
+ if extension is None:
raise AgentPluginError(
f'plugin.json needs extensions["{EXTENSION_NAMESPACE}"] with the '
"Dodaios auth block — see docs/marketplace/agent-plugins-standard.md"
@@ -540,7 +622,7 @@ def convert_manifest(
if fallback_auth is not None:
if not isinstance(fallback_auth, Mapping):
raise AgentPluginError(
- 'extensions["io.github.personaljarvis"].fallback_auth must be an object'
+ f'extensions["{EXTENSION_NAMESPACE}"].fallback_auth must be an object'
)
if fallback_auth.get("mode") != "pat_paste":
raise AgentPluginError("fallback_auth must use mode 'pat_paste'")
@@ -598,8 +680,13 @@ __all__ = [
"AgentPluginError",
"BundledSkill",
"EXTENSION_NAMESPACE",
+ "EXTENSION_NAMESPACES",
+ "LEGACY_EXTENSION_NAMESPACES",
+ "PUBLISHED_EXTENSION_NAMESPACES",
"convert_manifest",
+ "extension_of",
"validate_bundled_skills",
"validate_mcp_server",
"validate_spec_name",
+ "with_published_extension",
]
diff --git a/jarvis/marketplace/publish.py b/jarvis/marketplace/publish.py
index 940e268444..704985deed 100644
--- a/jarvis/marketplace/publish.py
+++ b/jarvis/marketplace/publish.py
@@ -40,9 +40,10 @@ from typing import Any
import httpx
from jarvis.marketplace.agent_plugins_loader import (
- EXTENSION_NAMESPACE,
MAX_SKILL_MD_BYTES,
AgentPluginError,
+ extension_of,
+ with_published_extension,
)
from jarvis.marketplace.agent_plugins_loader import (
validate_bundled_skills as _install_time_validate_bundled_skills,
@@ -212,6 +213,14 @@ def validate_draft(draft: dict[str, Any]) -> tuple[dict[str, Any] | None, list[F
if mcp_error:
errors.append(FieldError(mcp_error, "mcp_json"))
usage_card = draft.get("usage_card")
+ try:
+ # The submission carries the extension block under the namespace
+ # this app writes and, while the registry requires it, under the
+ # earlier one as well. Whatever namespace the draft was typed or
+ # imported with, what goes out is the same.
+ plugin_json = with_published_extension(plugin_json)
+ except AgentPluginError as exc:
+ errors.append(FieldError(str(exc), "plugin_json"))
value.update(
plugin_json=plugin_json,
mcp_json=mcp_json,
@@ -350,11 +359,9 @@ def _validate_mcp(mcp: dict[str, Any], *, plugin_json: Mapping[str, Any]) -> str
return "mcp_json must define exactly one server"
server_name, server = next(iter(servers.items()))
- extensions = plugin_json.get("extensions") if isinstance(plugin_json, Mapping) else None
- extension = extensions.get(EXTENSION_NAMESPACE) if isinstance(extensions, Mapping) else None
try:
converted = _install_time_validate_mcp_server(
- str(server_name), server, extension if isinstance(extension, Mapping) else None
+ str(server_name), server, extension_of(plugin_json)
)
except AgentPluginError as exc:
return str(exc)
diff --git a/scripts/ci/check_plugin_auth_contract.py b/scripts/ci/check_plugin_auth_contract.py
index 0ebe1475cd..a2131cea25 100644
--- a/scripts/ci/check_plugin_auth_contract.py
+++ b/scripts/ci/check_plugin_auth_contract.py
@@ -65,6 +65,23 @@ FINGERPRINT_FIELDS = (
BROWSER_AUTH_MODES = frozenset(
("hosted_mcp_oauth_dcr", "oauth_device_flow", "oauth_pkce_loopback", "instance_browser")
)
+# The namespaces a mirror may keep its block under, the current one first.
+# This gate is stdlib-only, so the names are restated from
+# jarvis.core.branding; tests/unit/marketplace/test_extension_namespace.py
+# pins them to it.
+EXTENSION_NAMESPACES = ("io.github.dodaios", "io.github.personaljarvis")
+
+
+def _extension_block(manifest: dict) -> dict:
+ """A mirror's own block, under whichever namespace its ``plugin.json`` uses."""
+ extensions = manifest.get("extensions")
+ if not isinstance(extensions, dict):
+ return {}
+ for namespace in EXTENSION_NAMESPACES:
+ block = extensions.get(namespace)
+ if isinstance(block, dict):
+ return block
+ return {}
def config_fingerprint(plugin: dict) -> str:
@@ -332,7 +349,7 @@ def main() -> int:
except Exception as exc: # noqa: BLE001
findings.append(f"mirror {mirror_dir.name}: unreadable plugin.json ({exc})")
continue
- ext = (data.get("extensions") or {}).get("io.github.personaljarvis", {})
+ ext = _extension_block(data)
auth = ext.get("auth", {}) if isinstance(ext.get("auth"), dict) else {}
if not auth:
continue
diff --git a/tests/unit/marketplace/test_extension_namespace.py b/tests/unit/marketplace/test_extension_namespace.py
new file mode 100644
index 0000000000..1cff229960
--- /dev/null
+++ b/tests/unit/marketplace/test_extension_namespace.py
@@ -0,0 +1,294 @@
+"""A plugin manifest's Dodaios block has two addresses: one written, both read.
+
+``plugin.json`` keeps this app's data under ``extensions[<namespace>]``. The
+namespace was ``io.github.personaljarvis`` and is ``io.github.dodaios`` now.
+Every package ever published, the community index and each installed plugin
+carry the earlier one, so it is read everywhere, for good; the current one is
+what the app writes. These tests pin both halves, and the property that makes
+the change safe: the namespace is the key the block sits under, never part of
+what the plugin is.
+"""
+
+from __future__ import annotations
+
+import copy
+import importlib.util
+import json
+import re
+from pathlib import Path
+from typing import Any
+
+import pytest
+
+import jarvis.core.branding as branding
+from jarvis.marketplace import agent_plugins_loader as loader
+from jarvis.marketplace import catalog_data, community_install, publish
+from jarvis.marketplace.agent_plugins_loader import (
+ AgentPluginError,
+ convert_manifest,
+ extension_of,
+ with_published_extension,
+)
+
+_ROOT = Path(__file__).resolve().parents[3]
+
+CURRENT = "io.github.dodaios"
+LEGACY = "io.github.personaljarvis"
+
+NAMESPACES = pytest.mark.parametrize("namespace", [CURRENT, LEGACY])
+
+
+def _block() -> dict[str, Any]:
+ return {
+ "display_name": "TodoFox",
+ "category": "Lists & Tasks",
+ "auth": {
+ "mode": "pat_paste",
+ "token_creation_url": "https://todofox.example/settings/tokens",
+ "token_prefix": "tfx_",
+ "validation_endpoint": "https://api.todofox.example/v1/me",
+ "instruction_md": "Create a token in Settings.",
+ },
+ }
+
+
+def _manifest(*namespaces: str) -> dict[str, Any]:
+ return {
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
+ "name": "todo-fox",
+ "description": "Tasks and reminders from TodoFox",
+ "version": "1.2.0",
+ "extensions": {namespace: _block() for namespace in namespaces},
+ }
+
+
+def _mcp() -> dict[str, Any]:
+ return {
+ "mcpServers": {
+ "todo-fox": {"type": "streamable-http", "url": "https://mcp.todofox.example/mcp"}
+ }
+ }
+
+
+# ---------------------------------------------------------------------------
+# The names
+# ---------------------------------------------------------------------------
+
+
+def test_the_written_namespace_is_the_new_one_and_the_earlier_one_stays_readable() -> None:
+ assert branding.MARKETPLACE_EXTENSION_NAMESPACE == CURRENT
+ assert branding.LEGACY_MARKETPLACE_EXTENSION_NAMESPACES == (LEGACY,)
+ assert loader.EXTENSION_NAMESPACE == CURRENT
+ assert loader.LEGACY_EXTENSION_NAMESPACES == (LEGACY,)
+ assert loader.EXTENSION_NAMESPACES == (CURRENT, LEGACY)
+
+
+def test_the_auth_contract_gate_restates_the_namespaces() -> None:
+ """The gate is stdlib-only and cannot import the package."""
+ spec = importlib.util.spec_from_file_location(
+ "check_plugin_auth_contract", _ROOT / "scripts/ci/check_plugin_auth_contract.py"
+ )
+ assert spec is not None and spec.loader is not None
+ gate = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(gate)
+
+ assert gate.EXTENSION_NAMESPACES == loader.EXTENSION_NAMESPACES
+ for namespace in loader.EXTENSION_NAMESPACES:
+ assert gate._extension_block({"extensions": {namespace: {"auth": {"mode": "x"}}}}) == {
+ "auth": {"mode": "x"}
+ }
+ assert gate._extension_block({"extensions": {"com.example": {"auth": {}}}}) == {}
+ assert gate._extension_block({}) == {}
+
+
+# ---------------------------------------------------------------------------
+# Reading
+# ---------------------------------------------------------------------------
+
+
+@NAMESPACES
+def test_a_manifest_is_read_under_either_namespace(namespace: str) -> None:
+ manifest = _manifest(namespace)
+
+ assert extension_of(manifest) == _block()
+ spec = convert_manifest(manifest, _mcp(), publisher="octo", version="1.2.0")
+ assert spec.id == "todo-fox"
+ assert spec.display_name == "TodoFox"
+ assert spec.auth.mode == "pat_paste"
+
+
+def test_the_namespace_is_no_part_of_what_the_plugin_is() -> None:
+ """The identity rule: same package, either namespace, one and the same item."""
+ current = convert_manifest(_manifest(CURRENT), _mcp(), publisher="octo", version="1.2.0")
+ legacy = convert_manifest(_manifest(LEGACY), _mcp(), publisher="octo", version="1.2.0")
+ both = convert_manifest(_manifest(CURRENT, LEGACY), _mcp(), publisher="octo", version="1.2.0")
+
+ assert current == legacy == both
+ assert current.id == "todo-fox"
+
+
+def test_an_install_under_one_namespace_is_updated_by_the_other(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ """No duplicate card, no lost update link: the row is found by the plugin's id."""
+ monkeypatch.setattr(catalog_data, "_DEFAULT_CATALOG_PATH", tmp_path / "plugin_catalog.json")
+ installed = convert_manifest(_manifest(LEGACY), _mcp(), publisher="octo", version="1.2.0")
+ community_install.install_plugin_spec(installed)
+
+ update = _manifest(CURRENT)
+ update["version"] = "1.3.0"
+ community_install.install_plugin_spec(
+ convert_manifest(update, _mcp(), publisher="octo", version="1.3.0")
+ )
+
+ rows = json.loads((tmp_path / "plugin_catalog.json").read_text(encoding="utf-8"))["plugins"]
+ assert [(row["id"], row["version"]) for row in rows] == [("todo-fox", "1.3.0")]
+ # What an install stores is the converted spec: no namespace is kept, so a
+ # row written before the rename resolves exactly as it did.
+ assert LEGACY not in json.dumps(rows) and CURRENT not in json.dumps(rows)
+ assert community_install.remove_community_plugin("todo-fox") is True
+
+
+def test_two_blocks_that_agree_are_one_block() -> None:
+ assert extension_of(_manifest(CURRENT, LEGACY)) == _block()
+
+
+def test_two_blocks_that_disagree_are_refused() -> None:
+ """The registry validates one key and this client would read the other."""
+ manifest = _manifest(CURRENT, LEGACY)
+ manifest["extensions"][CURRENT]["auth"]["validation_endpoint"] = "https://evil.example/me"
+
+ with pytest.raises(AgentPluginError, match="must be identical"):
+ extension_of(manifest)
+ with pytest.raises(AgentPluginError, match="must be identical"):
+ convert_manifest(manifest, _mcp())
+
+
+ "extensions", [None, {}, {"com.example.other": {"auth": {}}}, {CURRENT: "not an object"}, []]
+)
+def test_a_manifest_without_a_block_of_ours_has_none(extensions: Any) -> None:
+ manifest = _manifest()
+ manifest["extensions"] = extensions
+
+ assert extension_of(manifest) is None
+ with pytest.raises(AgentPluginError, match=re.escape(f'extensions["{CURRENT}"]')):
+ convert_manifest(manifest)
+
+
+def _first_party_manifests() -> list[Path]:
+ root = _ROOT / "jarvis" / "marketplace"
+ return sorted([*root.glob("plugins/*/plugin.json"), *root.glob("drafts/*/plugin.json")])
+
+
+def test_every_first_party_package_is_still_readable() -> None:
+ """The shipped packages keep the earlier namespace (the registry's validator
+ requires it); the reader must keep finding their block."""
+ manifests = _first_party_manifests()
+ assert len(manifests) >= 40
+ for path in manifests:
+ block = extension_of(json.loads(path.read_text(encoding="utf-8")))
+ assert block is not None and isinstance(block.get("auth"), dict), path
+
+
+# ---------------------------------------------------------------------------
+# Writing
+# ---------------------------------------------------------------------------
+
+
+@NAMESPACES
+def test_a_published_manifest_carries_the_block_under_the_current_namespace(
+ namespace: str,
+) -> None:
+ """Whatever the draft used, what goes out is the same."""
+ published = with_published_extension(_manifest(namespace))
+
+ assert published["extensions"][CURRENT] == _block()
+ assert published["extensions"] == with_published_extension(_manifest(CURRENT))["extensions"]
+
+
+def test_a_published_manifest_still_satisfies_the_registry_and_older_apps() -> None:
+ """Both read ONLY the earlier key (validator-parity.md): it must be there, and equal."""
+ published = with_published_extension(_manifest(CURRENT))
+
+ assert loader.PUBLISHED_EXTENSION_NAMESPACES == (CURRENT, LEGACY)
+ assert list(published["extensions"]) == [CURRENT, LEGACY]
+ assert published["extensions"][LEGACY] == published["extensions"][CURRENT]
+ # The copies are independent objects: editing one cannot silently edit the other.
+ assert published["extensions"][LEGACY] is not published["extensions"][CURRENT]
+
+
+def test_publishing_keeps_another_clients_block_and_the_draft_untouched() -> None:
+ draft = _manifest(LEGACY)
+ draft["extensions"]["com.example.other"] = {"anything": True}
+ before = copy.deepcopy(draft)
+
+ published = with_published_extension(draft)
+
+ assert published["extensions"]["com.example.other"] == {"anything": True}
+ assert draft == before
+ assert {k: v for k, v in published.items() if k != "extensions"} == {
+ k: v for k, v in draft.items() if k != "extensions"
+ }
+
+
+def test_publishing_is_idempotent() -> None:
+ once = with_published_extension(_manifest(LEGACY))
+ assert with_published_extension(once) == once
+
+
+def test_a_manifest_without_a_block_is_left_for_the_validator_to_refuse() -> None:
+ manifest = {"name": "todo-fox", "description": "x"}
+ assert with_published_extension(manifest) == manifest
+
+
+@NAMESPACES
+def test_a_submission_goes_out_under_both_keys(namespace: str) -> None:
+ draft = {
+ "kind": "plugin",
+ "name": "todo-fox",
+ "version": "1.2.0",
+ "plugin_json": _manifest(namespace),
+ "mcp_json": _mcp(),
+ "usage_card": None,
+ }
+
+ value, errors = publish.validate_draft(draft)
+
+ assert errors == [] and value is not None
+ extensions = value["plugin_json"]["extensions"]
+ assert extensions[CURRENT] == extensions[LEGACY] == _block()
+ # The form's own draft is not rewritten behind the author's back.
+ assert list(draft["plugin_json"]["extensions"]) == [namespace]
+ # And what was submitted reads back as the very same plugin.
+ assert convert_manifest(value["plugin_json"], value["mcp_json"]).id == "todo-fox"
+
+
+def test_a_submission_whose_two_blocks_disagree_is_refused_in_the_form() -> None:
+ manifest = _manifest(CURRENT, LEGACY)
+ manifest["extensions"][LEGACY]["category"] = "Something else"
+
+ value, errors = publish.validate_draft(
+ {"kind": "plugin", "name": "todo-fox", "version": "1.2.0", "plugin_json": manifest}
+ )
+
+ assert value is None
+ assert any(
+ e["field"] == "plugin_json" and "must be identical" in e["error"] for e in errors
+ )
+
+
+@NAMESPACES
+def test_the_header_template_is_found_under_either_namespace(namespace: str) -> None:
+ """The MCP pre-check reads the block too: a template under the new key must count."""
+ manifest = _manifest(namespace)
+ manifest["extensions"][namespace]["mcp_auth_header_template"] = (
+ "Authorization: Bearer ${plugin_todo-fox_access_token}"
+ )
+
+ assert publish._validate_mcp(_mcp(), plugin_json=manifest) is None
+ spec = convert_manifest(manifest, _mcp())
+ assert spec.mcp_server is not None
+ assert spec.mcp_server["auth_header_template"] == (
+ "Authorization: Bearer ${plugin_todo-fox_access_token}"
+ )