Open-source design agent: on-brand stills, decks, diagrams, charts and motion graphics from a chat thread, built on Deep Agents.
JavaScript agentagentsai-agentdeepagentsdesignhyperframeslanggraphmanaged-agentsmotion-graphicspaperslackvideo
Deploy to MDA for real: binary skill files outside Context Hub, the gateway key for gateway models
Amal Irgashev64393c950030
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a6b6829..868e0e4 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,18 @@## Unreleased+### Changed++- `langsmith:anthropic/*` and `langsmith:openai/*` models use the LangSmith Gateway's native+ routes, so prompt caching, context editing, tool search and effort work through the gateway.+- Tool history drops server tool calls nothing will answer and leaves the latest assistant turn+ as written when it repairs a thread.+- Brand packs can name colour roles per mode; web-format brand fonts load through `@font-face`;+ `fonts verify` checks each file's family; the render font gate accepts web fonts.+- `ask` prints the run's estimated cost; `deploy --name` deploys a separate copy; binary skill+ files ship outside Context Hub; `demo` always uses the sample brand; evals keep the task set's+ brand.+### Added- One shared Deep Agents assembly for Managed Deep Agents, the CLI and the self-hosted path, withdiff --git a/docs/customization.md b/docs/customization.mdindex 4a2d567..aa2f5b7 100644--- a/docs/customization.md+++ b/docs/customization.md@@ -10,9 +10,14 @@ sample pack in `examples/brands/example-studio/` shows every field. `uv run desivalidate` checks it and `brand css` regenerates `tokens.css`. The [brand-onboardingskill](../.agents/skills/brand-onboarding/SKILL.md) builds a pack from your sources.+Colour roles: `design.roles.light` and `design.roles.dark` in `tokens.json` name the token for each+role (`ground`, `ink`, `accent`, `muted`, `quiet`, `rule`, and a `series` list). Charts and diagrams+use them; a role you leave out is measured from the palette.+Fonts: each family in `fonts.toml` points at an open font in `fonts/` or a licensed file in-`private-fonts/` (Git-ignored). Licensed fonts reach the sandbox as deployment files (MDA) or a-read-only mount (self-hosted), never through Git.+`private-fonts/` (Git-ignored), and `family` is the name inside the file (`fonts verify` checks it).+Web formats work: `tokens.css` declares `.woff2` and `.woff` faces with `@font-face`. Licensed fonts+reach the sandbox as deployment files (MDA) or a read-only mount (self-hosted), never through Git.## Instructions and skillsdiff --git a/docs/deploy-mda.md b/docs/deploy-mda.mdindex ad432ed..2b41137 100644--- a/docs/deploy-mda.md+++ b/docs/deploy-mda.md@@ -45,7 +45,12 @@ stay home (Slack tokens for self-hosting, `DATABASE_URL`, your LangSmith key). IWhat ships: code, `instructions.md`, `skills/`, `workspace/tools/`, `config/`, the sample brand andyour `workspace/brand/`, open fonts and your `private-fonts/` (licensed fonts reach the sandbox asdeployment files, never through Git), the sandbox recipe and the MDA declarations-(`agent.py`, `identity.py`, `channels/`, `schedules/`, `sandbox/`, `tools/mcp.py`).+(`agent.py`, `identity.py`, `channels/`, `schedules/`, `sandbox/`, `tools/mcp.py`). MDA syncs+`skills/` to Context Hub, which takes only UTF-8 text, so the few binary skill files (a vendored+preset's fonts) move to `skill-binaries/` and reach `/workspace/skills/` through the stager.++To try a change without touching the deployment people use, deploy under another name:+`uv run design-agent deploy --name design-agent-test`.## 3. Deploydiff --git a/src/design_agent/deploy.py b/src/design_agent/deploy.pyindex cb7e3fe..8714811 100644--- a/src/design_agent/deploy.py+++ b/src/design_agent/deploy.py@@ -25,7 +25,7 @@ from design_agent.config import Settingsfrom design_agent.runtime.sandbox.publish import declared_basefrom design_agent.skills_lock import verifyfrom design_agent.tools.mcp import McpConfigError, declared_servers-from design_agent.workspace.manifest import build_manifest+from design_agent.workspace.manifest import SKILL_BINARIES, build_manifestSTAGE = Path(".mda") / "deploy-src"#: What a deployment needs, relative to the project root. Everything else stays home.@@ -110,6 +110,12 @@ def env_split(values: Mapping[str, str | None]) -> tuple[dict[str, str], list[streturn shipped, sorted(held)+def env_values(root: Path) -> dict[str, str | None]:+ """The project's `.env` entries, or none when there is no `.env`."""+ env_file = root / ".env"+ return dict(dotenv_values(env_file)) if env_file.is_file() else {}++def preflight(root: Path, settings: Settings, *, allow_docker_base: bool = False, require_keys: bool = True) -> Preflight:@@ -149,18 +155,21 @@ def preflight()except McpConfigError as error:report.problems.append(f"config/mcp.toml: {error}")- env_file = root / ".env"- values = dotenv_values(env_file) if env_file.is_file() else {}- shipped, held = env_split(values)+ shipped, held = env_split(env_values(root))report.shipped_env, report.held_env = sorted(shipped), held- lead = settings.lead_model().upstream.provider- needed = {- "anthropic": "ANTHROPIC_API_KEY",- "openai": "OPENAI_API_KEY",- "google_genai": "GOOGLE_API_KEY",- }.get(lead)+ spec = settings.lead_model()+ # A gateway model ships the gateway key: LANGSMITH_API_KEY is the deploy credential, held back.+ needed = (+ "LANGSMITH_GATEWAY_API_KEY"+ if spec.via_gateway+ else {+ "anthropic": "ANTHROPIC_API_KEY",+ "openai": "OPENAI_API_KEY",+ "google_genai": "GOOGLE_API_KEY",+ }.get(spec.provider)+ )if needed is not None and needed not in shipped:- message = f"the lead model ({lead}) needs {needed} in .env"+ message = f"the lead model ({spec}) needs {needed} in .env"(report.problems if require_keys else report.warnings).append(message)if shutil.which("mda") is None and not (root / ".venv" / "bin" / "mda").exists():report.problems.append("the `mda` command is not installed: run `uv sync`")@@ -178,7 +187,12 @@ def _copy(source: Path, target: Path) -> None:def stage(root: Path, *, destination: Path | None = None) -> Path:- """Copy what ships into a fresh staging directory and write its filtered `.env`."""+ """Copy what ships into a fresh staging directory and write its filtered `.env`.++ MDA syncs `skills/` to Context Hub, which takes only UTF-8 text, so a skill's binary files+ (fonts, images) move to `skill-binaries/<skill>/` and ship as deployment files; the workspace+ stager puts them back under `/workspace/skills/<skill>/`.+ """target = destination or root / STAGEshutil.rmtree(target, ignore_errors=True)target.mkdir(parents=True)@@ -186,6 +200,14 @@ def stage(root: Path, *, destination: Path | None = None) -> Path:source = root / relativeif source.exists():_copy(source, target / relative)+ skills = target / "skills"+ for path in sorted(p for p in skills.rglob("*") if p.is_file()) if skills.is_dir() else []:+ try:+ path.read_bytes().decode("utf-8")+ except UnicodeDecodeError:+ moved = target / SKILL_BINARIES / path.relative_to(skills)+ moved.parent.mkdir(parents=True, exist_ok=True)+ path.rename(moved)env_file = root / ".env"if env_file.is_file():shipped, _ = env_split(dotenv_values(env_file))diff --git a/src/design_agent/workspace/manifest.py b/src/design_agent/workspace/manifest.pyindex 6ab816b..170ef86 100644--- a/src/design_agent/workspace/manifest.py+++ b/src/design_agent/workspace/manifest.py@@ -19,6 +19,9 @@ from pathlib import Path, PurePosixPathfrom design_agent.brand.schema import BrandPack, render_tokens_cssWORKSPACE = PurePosixPath("/workspace")+#: Where a deployed project keeps skills' binary files: MDA syncs `skills/` to Context Hub, which+#: takes only UTF-8 text (`deploy.stage` moves them here).+SKILL_BINARIES = "skill-binaries"#: Fonts the sandbox recipe bakes, by sha256, so the stager never uploads them again.BAKED_FONT_SHA256 = frozenset({@@ -141,6 +144,13 @@ def build_manifest(project_root: Path, brand: BrandPack) -> Manifest:for path in _files(root, skill):rel = path.relative_to(skill).as_posix()assets.append(_asset(path, WORKSPACE / "skills" / skill.name / rel))+ # A deployed project keeps skills' binary files here, out of Context Hub (`deploy.stage`).+ binaries = root / SKILL_BINARIES+ if binaries.is_dir():+ for path in _files(root, binaries):+ assets.append(+ _asset(path, WORKSPACE / "skills" / path.relative_to(binaries).as_posix())+ )tools = root / "workspace" / "tools"if tools.is_dir():for path in _files(root, tools):diff --git a/tests/unit/test_deploy.py b/tests/unit/test_deploy.pyindex 190b9fa..e0037c6 100644--- a/tests/unit/test_deploy.py+++ b/tests/unit/test_deploy.py@@ -120,3 +120,30 @@ def test_deploy_asks_first_and_passes_langsmith_credentials_only_in_the_environmargv[1:] == ["deploy", str(tmp_path), "--name", "design-agent"]and env["LANGSMITH_API_KEY"] == "ls-test")+++def test_a_gateway_model_needs_the_gateway_key_shipped(+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch+) -> None:+ monkeypatch.setattr(deploy, "declared_base", lambda _root: "snapshot")+ settings = Settings(_env_file=None, model="langsmith:anthropic/claude-opus-5-5") # type: ignore[call-arg]+ monkeypatch.setattr(deploy, "env_values", lambda _root: {"ANTHROPIC_API_KEY": "sk"})+ report = deploy.preflight(ROOT, settings)+ assert any("needs LANGSMITH_GATEWAY_API_KEY" in p for p in report.problems)+ monkeypatch.setattr(deploy, "env_values", lambda _root: {"LANGSMITH_GATEWAY_API_KEY": "lsv2"})+ assert not any("needs" in p for p in deploy.preflight(ROOT, settings).problems)+++def test_staging_moves_binary_skill_files_out_of_context_hub(tmp_path: Path) -> None:+ from design_agent.brand.schema import load_brand_pack+ from design_agent.workspace.manifest import build_manifest++ staged = deploy.stage(ROOT, destination=tmp_path / "stage")+ for path in (p for p in (staged / "skills").rglob("*") if p.is_file()):+ path.read_bytes().decode("utf-8") # Context Hub takes only UTF-8 text+ moved = sorted((staged / "skill-binaries").rglob("*.woff2"))+ assert moved, "the vendored frame-preset fonts ship as deployment files"+ pack = load_brand_pack(ROOT / "examples/brands/example-studio", project_root=ROOT)+ staged_paths = {str(a.destination) for a in build_manifest(staged, pack).assets}+ rel = moved[0].relative_to(staged / "skill-binaries").as_posix()+ assert f"/workspace/skills/{rel}" in staged_paths, "and still reach the sandbox's skills"