Skip to content

feat(themes): create and edit saved themes from an agent over MCP - #318

Merged
egdev6 merged 2 commits into
feat/saved-themesfrom
feat/saved-themes-mcp
Nov 23, 2026
Merged

egdev6 merged 2 commits into
feat/saved-themesfrom
feat/saved-themes-mcp

Conversation

@egdev6

@egdev6 egdev6 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Refs #313 · Phase 5 of saved themes → integration branch feat/saved-themes. User: «habría herramientas mcp para crear un tema? prguntando lo necesario y pudiendo editar cualquier elemento desde el agente?»

  • crear_tema: inactive theme from «Color de cada plataforma» or as a copy, with name and avatar.
  • Optional tema on theme-owned MCP write/read tools (alerts and variations, look, global CSS, widgets/goals/bars/chat variants, commands, timers, interactive config, custom overlay theme CSS, themed config paths): runs the existing handler against a request-isolated copy of the saved look, validates the full look, commits atomically with the conflict check; never activates, never touches live config, no overlay broadcast, no backups (restore points survive an authoring session). Without tema every tool is unchanged. Live counters stay on the current session.
  • MCP prompt disenar_tema: asks one topic at a time (name, avatar, base, colours/typography, alert texts, sounds/media, widgets, custom overlay CSS), shows previewTheme URLs, activates only on explicit request.
  • Full config backup now carries media .css referenced by the active or saved looks; unreferenced CSS skipped/refused; historical import error order preserved.

Verification (independent, Risk 1+3): isolation, validation, 75 race iterations with no lost or misdirected writes; MCP tools/list and calls without tema plus panel HTTP routes identical to feat/saved-themes; legacy importar_tema identical. Its two blockers fixed with regression tests: importar_tema with a theme id and no appearance silently reset the look; config import error precedence with .css changed. Local: unit, browser, platform, typecheck green.

Known advisories: a targeted write racing an active write gets 409 (safe, retry); custom overlay theme CSS can be stored for a missing overlay id (same as the active path).

- crear_tema creates an inactive theme from «Color de cada plataforma» or
  as a copy, with name and avatar.
- Theme-owned MCP write and read tools accept an optional `tema`: the
  existing handler runs against a request-isolated copy of that saved look
  and the result is committed atomically with the usual conflict check. It
  never activates the theme, never touches the live config and sends nothing
  to overlays; the full look is validated before saving (400, nothing
  written); targeted writes create no backups so restore points survive an
  authoring session. Without `tema` every tool behaves exactly as before.
  Live counters stay on the current session.
- MCP prompt «disenar_tema» guides the agent through what to ask, one topic
  at a time, shows the preview URLs and activates only on explicit request.
- The full configuration backup now carries the media `.css` files that
  the active or saved looks reference; unreferenced CSS is still skipped and
  refused, and the historical error order of the import is kept.

Refs #313
…s symlinks

The two new referenced-CSS symlink tests skipped on every Windows run with a
reason the CI baseline does not allow. They now try to create the symlink
and skip with the allowed reason only on EPERM/ENOTSUP, like the other
symlink tests.

Refs #313
@egdev6
egdev6 merged commit c5e077c into feat/saved-themes Nov 23, 2026
5 checks passed
@egdev6
egdev6 deleted the feat/saved-themes-mcp branch November 23, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant