feat(plugin): admin-configurable marketplace URL as the install default
CI & Build / Python lint (push) Successful in 3s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 46s
CI & Build / Build & push image (push) Successful in 59s

The Settings install command had a <your-scribe-repo> placeholder — not
copyable. Add an instance-global 'plugin_marketplace_url' setting (admin sets
it to the app's own repo) that every user's MCP Access reads, so the
/plugin marketplace add command is copyable out of the box. Keeps it universal
(each deployment configures its own repo) rather than hardcoding one.

- services/settings.get_admin_setting(key): admin-scoped global read.
- routes/plugin: GET /api/plugin/marketplace-url (any user) + PUT (admin).
- SettingsView: Admin → 'Plugin marketplace' field to set it; MCP Access
  marketplace field falls back to the configured value.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 00:17:05 -04:00
co-authored by Claude Opus 4.8
parent b1674169a0
commit 1d82e81527
3 changed files with 112 additions and 2 deletions
+18
View File
@@ -4,10 +4,28 @@ from sqlalchemy import delete as sa_delete, select
from scribe.models import async_session
from scribe.models.setting import Setting
from scribe.models.user import User
logger = logging.getLogger(__name__)
async def get_admin_setting(key: str, default: str = "") -> str:
"""Read an instance-global setting (one stored on an admin account).
Used for settings that aren't per-user — e.g. the plugin marketplace URL
shown to everyone in Settings. Mirrors the admin-scoped lookup used for
the application base URL.
"""
async with async_session() as session:
result = await session.execute(
select(Setting)
.join(User, Setting.user_id == User.id)
.where(User.role == "admin", Setting.key == key)
)
setting = result.scalars().first()
return setting.value if setting and setting.value else default
async def get_setting(user_id: int, key: str, default: str = "") -> str:
async with async_session() as session:
result = await session.execute(