diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 58223a0..a5c3513 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -8,11 +8,11 @@ "name": "mempalace", "source": { "source": "local", - "path": "./.codex-plugin" + "path": "./" }, "policy": { "installation": "AVAILABLE", - "authentication": "NONE" + "authentication": "ON_INSTALL" }, "category": "Coding" } diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 838df4e..b591c37 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -18,12 +18,7 @@ "search" ], "skills": "./skills/", - "hooks": "./hooks.json", - "mcpServers": { - "mempalace": { - "command": "mempalace-mcp" - } - }, + "mcpServers": "./.mcp.json", "interface": { "displayName": "MemPalace", "shortDescription": "AI memory system for Codex", diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 0000000..ca633f5 --- /dev/null +++ b/.mcp.json @@ -0,0 +1,7 @@ +{ + "mcpServers": { + "mempalace": { + "command": "mempalace-mcp" + } + } +} diff --git a/tests/test_codex_plugin_manifest.py b/tests/test_codex_plugin_manifest.py new file mode 100644 index 0000000..0cd80d5 --- /dev/null +++ b/tests/test_codex_plugin_manifest.py @@ -0,0 +1,47 @@ +"""Contract tests for the Codex plugin marketplace metadata.""" + +from __future__ import annotations + +import json +from pathlib import Path + + +REPO_ROOT = Path(__file__).resolve().parent.parent +MARKETPLACE_PATH = REPO_ROOT / ".agents" / "plugins" / "marketplace.json" +MANIFEST_PATH = REPO_ROOT / ".codex-plugin" / "plugin.json" +MCP_PATH = REPO_ROOT / ".mcp.json" + + +def _read_json(path: Path) -> dict: + return json.loads(path.read_text(encoding="utf-8")) + + +def test_marketplace_entry_uses_supported_codex_schema(): + marketplace = _read_json(MARKETPLACE_PATH) + plugin = marketplace["plugins"][0] + + assert plugin["name"] == "mempalace" + assert plugin["source"] == {"source": "local", "path": "./"} + assert plugin["policy"] == { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL", + } + + +def test_plugin_manifest_references_supported_components(): + manifest = _read_json(MANIFEST_PATH) + + assert manifest["mcpServers"] == "./.mcp.json" + assert "hooks" not in manifest + + +def test_mcp_config_registers_mempalace_server(): + config = _read_json(MCP_PATH) + + assert config == { + "mcpServers": { + "mempalace": { + "command": "mempalace-mcp", + } + } + }